From 6e4135593fe117c3c7a4d08d797e8988974f03c1 Mon Sep 17 00:00:00 2001 From: nichenqin Date: Wed, 21 Aug 2024 14:00:50 +0800 Subject: [PATCH] feat: long text field --- apps/frontend/schema.graphql | 1 + .../blocks/field-control/field-control.svelte | 2 + .../field-control/long-text-control.svelte | 8 ++ .../blocks/field-icon/field-icon.svelte | 4 +- .../blocks/field-options/field-options.svelte | 2 + .../long-text-field-option.svelte | 42 ++++++++ .../blocks/field-value/field-value.svelte | 2 + .../blocks/field-value/long-text-field.svelte | 12 +++ .../editable-cell/long-text-cell.svelte | 66 +++++++++++++ .../blocks/grid-view/grid-view-cell.svelte | 4 +- packages/graphql/src/index.ts | 1 + packages/i18n/src/i18n/en/index.ts | 1 + packages/i18n/src/i18n/i18n-types.ts | 8 ++ .../record/record-query-creator-visitor.ts | 2 + .../record-query-spec-creator-visitor.ts | 2 + .../src/record/record-reference-visitor.ts | 4 + .../src/record/record-select-field-visitor.ts | 5 + .../record/record-spec-reference-visitor.ts | 2 + .../src/record/record.filter-visitor.ts | 5 + .../src/record/record.mutate-visitor.ts | 4 + .../underlying-table-field.visitor.ts | 5 + .../record/record-visitor.interface.ts | 2 + .../schema/fields/dto/create-field.dto.ts | 2 + .../modules/schema/fields/dto/field.dto.ts | 3 + .../schema/fields/field-value.factory.ts | 3 + .../modules/schema/fields/field.aggregate.ts | 2 + .../modules/schema/fields/field.factory.ts | 3 + .../src/modules/schema/fields/field.type.ts | 13 +++ .../src/modules/schema/fields/field.util.ts | 2 + .../modules/schema/fields/field.visitor.ts | 2 + .../modules/schema/fields/fieldAggregate.ts | 24 +++++ .../modules/schema/fields/variants/index.ts | 1 + .../fields/variants/long-text-field/index.ts | 6 ++ .../long-text-field-constraint.vo.ts | 27 +++++ .../long-text-field-value.visitor.ts | 5 + .../long-text-field-value.vo.ts | 15 +++ .../long-text-field.aggregate.ts | 11 +++ .../long-text-field.condition.ts | 21 ++++ .../long-text-field.specification.ts | 27 +++++ .../long-text-field/long-text-field.vo.ts | 99 +++++++++++++++++++ .../view/view-aggregate/view-aggregate.vo.ts | 3 +- 41 files changed, 450 insertions(+), 3 deletions(-) create mode 100644 apps/frontend/src/lib/components/blocks/field-control/long-text-control.svelte create mode 100644 apps/frontend/src/lib/components/blocks/field-options/long-text-field-option.svelte create mode 100644 apps/frontend/src/lib/components/blocks/field-value/long-text-field.svelte create mode 100644 apps/frontend/src/lib/components/blocks/grid-view/editable-cell/long-text-cell.svelte create mode 100644 packages/table/src/modules/schema/fields/fieldAggregate.ts create mode 100644 packages/table/src/modules/schema/fields/variants/long-text-field/index.ts create mode 100644 packages/table/src/modules/schema/fields/variants/long-text-field/long-text-field-constraint.vo.ts create mode 100644 packages/table/src/modules/schema/fields/variants/long-text-field/long-text-field-value.visitor.ts create mode 100644 packages/table/src/modules/schema/fields/variants/long-text-field/long-text-field-value.vo.ts create mode 100644 packages/table/src/modules/schema/fields/variants/long-text-field/long-text-field.aggregate.ts create mode 100644 packages/table/src/modules/schema/fields/variants/long-text-field/long-text-field.condition.ts create mode 100644 packages/table/src/modules/schema/fields/variants/long-text-field/long-text-field.specification.ts create mode 100644 packages/table/src/modules/schema/fields/variants/long-text-field/long-text-field.vo.ts diff --git a/apps/frontend/schema.graphql b/apps/frontend/schema.graphql index a30722ab1..567c0b382 100644 --- a/apps/frontend/schema.graphql +++ b/apps/frontend/schema.graphql @@ -41,6 +41,7 @@ enum FieldType { email id json + longText number rating reference diff --git a/apps/frontend/src/lib/components/blocks/field-control/field-control.svelte b/apps/frontend/src/lib/components/blocks/field-control/field-control.svelte index 34eedab83..310e5ea6c 100644 --- a/apps/frontend/src/lib/components/blocks/field-control/field-control.svelte +++ b/apps/frontend/src/lib/components/blocks/field-control/field-control.svelte @@ -14,6 +14,7 @@ import CheckboxControl from "./checkbox-control.svelte" import UrlControl from "./url-control.svelte" import RollupField from "../field-value/rollup-field.svelte" + import LongTextControl from "./long-text-control.svelte" export let readonly = false export let field: NoneSystemField @@ -34,6 +35,7 @@ const map: Record = { string: StringControl, + longText: LongTextControl, number: NumberControl, reference: ReferenceControl, rollup: RollupField, diff --git a/apps/frontend/src/lib/components/blocks/field-control/long-text-control.svelte b/apps/frontend/src/lib/components/blocks/field-control/long-text-control.svelte new file mode 100644 index 000000000..91d98aaa0 --- /dev/null +++ b/apps/frontend/src/lib/components/blocks/field-control/long-text-control.svelte @@ -0,0 +1,8 @@ + + +