From 7605393d355b598e28aef854d8607903d11c186f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piggy=20Park=20=28=EB=B0=95=EC=9A=A9=ED=83=9C=29?= Date: Tue, 3 Dec 2024 11:01:56 +0900 Subject: [PATCH] feat(widget-field-value-manager): create widget-field-value-manager (#5115) * feat(widget-field-value-manager): create widget-field-value-manager Signed-off-by: samuel.park * chore: create temporary type Signed-off-by: samuel.park * fix: add widget-config constructor args & create validator registry Signed-off-by: samuel.park * chore: fix typo Signed-off-by: samuel.park * feat: create new dataField field component Signed-off-by: samuel.park * chore: add annotation Signed-off-by: samuel.park * chore: small fix Signed-off-by: samuel.park --------- Signed-off-by: samuel.park --- .../widget-field-components-constant.ts | 2 +- .../_widget-field-value-manager/index.ts | 83 ++++++++++++++++++ .../_widget-field-value-manager/type.ts | 85 +++++++++++++++++++ .../validator-registry.ts | 23 +++++ .../data-field/_WidgetFieldDataField.vue | 82 ++++++++++++++++++ .../widgets/_widget-fields/data-field/type.ts | 5 ++ .../WidgetFieldDateAggregationOptions.vue | 4 +- .../constant.ts | 0 .../type.ts | 2 +- .../_widget-fields/granularity/type.ts | 4 + .../widgets/_widget-fields/max/type.ts | 5 ++ .../widgets/_widget-fields/min/type.ts | 5 ++ .../_widget-fields/pie-chart-type/type.ts | 5 ++ .../widgets/_widget-fields/sub-total/type.ts | 6 ++ .../widgets/types/widget-field-type.ts | 11 ++- .../widgets/types/widget-field-value-type.ts | 2 +- 16 files changed, 318 insertions(+), 6 deletions(-) create mode 100644 apps/web/src/common/modules/widgets/_widget-field-value-manager/index.ts create mode 100644 apps/web/src/common/modules/widgets/_widget-field-value-manager/type.ts create mode 100644 apps/web/src/common/modules/widgets/_widget-field-value-manager/validator-registry.ts create mode 100644 apps/web/src/common/modules/widgets/_widget-fields/data-field/_WidgetFieldDataField.vue rename apps/web/src/common/modules/widgets/_widget-fields/{data-aggregation-options => date-aggregation-options}/WidgetFieldDateAggregationOptions.vue (95%) rename apps/web/src/common/modules/widgets/_widget-fields/{data-aggregation-options => date-aggregation-options}/constant.ts (100%) rename apps/web/src/common/modules/widgets/_widget-fields/{data-aggregation-options => date-aggregation-options}/type.ts (85%) create mode 100644 apps/web/src/common/modules/widgets/_widget-fields/granularity/type.ts diff --git a/apps/web/src/common/modules/widgets/_constants/widget-field-components-constant.ts b/apps/web/src/common/modules/widgets/_constants/widget-field-components-constant.ts index 6f509088c3..3676a73082 100644 --- a/apps/web/src/common/modules/widgets/_constants/widget-field-components-constant.ts +++ b/apps/web/src/common/modules/widgets/_constants/widget-field-components-constant.ts @@ -5,9 +5,9 @@ import categoryBy from '@/common/modules/widgets/_widget-fields/category-by/Widg import colorSchema from '@/common/modules/widgets/_widget-fields/color-schema/WidgetFieldColorSchema.vue'; import comparison from '@/common/modules/widgets/_widget-fields/comparison/WidgetFieldComparison.vue'; import customTableColumnWidth from '@/common/modules/widgets/_widget-fields/custom-table-column-width/WidgetFieldCustomTableColumnWidth.vue'; -import dateAggregationOptions from '@/common/modules/widgets/_widget-fields/data-aggregation-options/WidgetFieldDateAggregationOptions.vue'; import dataFieldHeatmapColor from '@/common/modules/widgets/_widget-fields/data-field-heatmap-color/WidgetFieldDataFieldHeatmapColor.vue'; import dataField from '@/common/modules/widgets/_widget-fields/data-field/WidgetFieldDataField.vue'; +import dateAggregationOptions from '@/common/modules/widgets/_widget-fields/date-aggregation-options/WidgetFieldDateAggregationOptions.vue'; import dateFormat from '@/common/modules/widgets/_widget-fields/date-format/WidgetFieldDateFormat.vue'; import dateRange from '@/common/modules/widgets/_widget-fields/date-range/WidgetFieldDateRange.vue'; import displayAnnotation from '@/common/modules/widgets/_widget-fields/display-annotation/WidgetFieldDisplayAnnotation.vue'; diff --git a/apps/web/src/common/modules/widgets/_widget-field-value-manager/index.ts b/apps/web/src/common/modules/widgets/_widget-field-value-manager/index.ts new file mode 100644 index 0000000000..b2dbdcccfb --- /dev/null +++ b/apps/web/src/common/modules/widgets/_widget-field-value-manager/index.ts @@ -0,0 +1,83 @@ +import type { FieldValueValidator, WidgetFieldTypeMap, WidgetFieldValueMap } from '@/common/modules/widgets/_widget-field-value-manager/type'; +import type { WidgetConfig } from '@/common/modules/widgets/types/widget-config-type'; + + +export default class WidgetFieldValueManager { + private widgetConfig: WidgetConfig; + + private originData: WidgetFieldValueMap; + + private modifiedData: WidgetFieldValueMap; + + private fieldValidators: Record>; + + private validationErrors: Record = {}; + + constructor( + widgetConfig: WidgetConfig, + originData: WidgetFieldValueMap, + fieldValidators: Record>, + ) { + this.widgetConfig = widgetConfig; + this.originData = originData; + this.modifiedData = { ...originData }; + this.fieldValidators = fieldValidators; + } + + setFieldValue(key: Key, value: WidgetFieldTypeMap[Key]['value']): boolean { + const field = this.modifiedData[key] || this.originData[key]; + if (!field) { + throw new Error(`Field "${key}" does not exist.`); + } + + this.modifiedData[key] = { ...field, value }; + + const validator = this.fieldValidators[key]; + if (validator) { + const isValid = validator(this.modifiedData[key], this.widgetConfig); + if (!isValid) { + this.validationErrors[key as string] = `Invalid value for field "${key}"`; + return false; + } + } + + delete this.validationErrors[key as string]; + return true; + } + + validateAll(): boolean { + this.validationErrors = {}; + let isValid = true; + + Object.entries(this.modifiedData).forEach(([key, field]) => { + const validator = this.fieldValidators[key]; + if (validator && !validator(field, this.widgetConfig)) { + this.validationErrors[key] = `Invalid value for field "${key}"`; + isValid = false; + } + }); + + return isValid; + } + + getValidationErrors(): Record { + return this.validationErrors; + } + + get computedData(): WidgetFieldValueMap { + return new Proxy(this.modifiedData, { + get: (target, key) => target[key as keyof WidgetFieldValueMap], + }); + } + + resetToOrigin(): void { + this.modifiedData = { ...this.originData }; + this.validationErrors = {}; + } + + setOrigin(data: WidgetFieldValueMap): void { + this.originData = { ...data }; + this.modifiedData = { ...data }; + this.validationErrors = {}; + } +} diff --git a/apps/web/src/common/modules/widgets/_widget-field-value-manager/type.ts b/apps/web/src/common/modules/widgets/_widget-field-value-manager/type.ts new file mode 100644 index 0000000000..d751452bc7 --- /dev/null +++ b/apps/web/src/common/modules/widgets/_widget-field-value-manager/type.ts @@ -0,0 +1,85 @@ +import type { AdvancedFormatRulesValue } from '@/common/modules/widgets/_widget-fields/advanced-format-rules/type'; +import type { CategoryByValue } from '@/common/modules/widgets/_widget-fields/category-by/type'; +import type { ColorSchemaValue } from '@/common/modules/widgets/_widget-fields/color-schema/type'; +import type { ComparisonValue } from '@/common/modules/widgets/_widget-fields/comparison/type'; +import type { CustomTableColumnWidthValue } from '@/common/modules/widgets/_widget-fields/custom-table-column-width/type'; +import type { DataFieldHeatmapColorValue } from '@/common/modules/widgets/_widget-fields/data-field-heatmap-color/type'; +import type { DataFieldValue } from '@/common/modules/widgets/_widget-fields/data-field/type'; +import type { DateAggregationOptionsValue } from '@/common/modules/widgets/_widget-fields/date-aggregation-options/type'; +import type { DateFormatValue } from '@/common/modules/widgets/_widget-fields/date-format/type'; +import type { DateRangeValue } from '@/common/modules/widgets/_widget-fields/date-range/type'; +import type { DisplayAnnotationValue } from '@/common/modules/widgets/_widget-fields/display-annotation/type'; +import type { DisplaySeriesLabelValue } from '@/common/modules/widgets/_widget-fields/display-series-label/type'; +import type { FormatRulesValue } from '@/common/modules/widgets/_widget-fields/format-rules/type'; +import type { GranularityValue } from '@/common/modules/widgets/_widget-fields/granularity/type'; +import type { GroupByValue } from '@/common/modules/widgets/_widget-fields/group-by/type'; +import type { WidgetHeaderValue } from '@/common/modules/widgets/_widget-fields/header/type'; +import type { IconValue } from '@/common/modules/widgets/_widget-fields/icon/type'; +import type { LegendValue } from '@/common/modules/widgets/_widget-fields/legend/type'; +import type { LineByValue } from '@/common/modules/widgets/_widget-fields/line-by/type'; +import type { MaxValue } from '@/common/modules/widgets/_widget-fields/max/type'; +import type { MinValue } from '@/common/modules/widgets/_widget-fields/min/type'; +import type { MissingValueValue } from '@/common/modules/widgets/_widget-fields/missing-value/type'; +import type { NumberFormatValue } from '@/common/modules/widgets/_widget-fields/number-format/type'; +import type { PieChartTypeValue } from '@/common/modules/widgets/_widget-fields/pie-chart-type/type'; +import type { ProgressBarValue } from '@/common/modules/widgets/_widget-fields/progress-bar/type'; +import type { StackByValue } from '@/common/modules/widgets/_widget-fields/stack-by/type'; +import type { SubTotalValue } from '@/common/modules/widgets/_widget-fields/sub-total/type'; +import type { TableColumnWidthValue } from '@/common/modules/widgets/_widget-fields/table-column-width/type'; +import type { TableDataFieldValue } from '@/common/modules/widgets/_widget-fields/table-data-field/type'; +import type { TextWrapValue } from '@/common/modules/widgets/_widget-fields/text-wrap/type'; +import type { TooltipNumberFormatValue } from '@/common/modules/widgets/_widget-fields/tooltip-number-format/type'; +import type { TotalValue } from '@/common/modules/widgets/_widget-fields/total/type'; +import type { WidgetHeightValue } from '@/common/modules/widgets/_widget-fields/widget-height/type'; +import type { XAxisValue } from '@/common/modules/widgets/_widget-fields/x-axis/type'; +import type { YAxisValue } from '@/common/modules/widgets/_widget-fields/y-axis/type'; +import type { WidgetConfig } from '@/common/modules/widgets/types/widget-config-type'; + +export type FieldValueValidator = (fieldValue: T, widgetConfig: WidgetConfig) => boolean; + +export interface WidgetFieldValueMap { + [fieldKey: string]: WidgetFieldValue; +} + +export interface WidgetFieldValue { + value: T; + meta?: Record; +} + +export interface WidgetFieldTypeMap { + xAxis: WidgetFieldValue; + yAxis: WidgetFieldValue; + widgetHeight: WidgetFieldValue; + total: WidgetFieldValue; + tooltipNumberFormat: WidgetFieldValue; + textWrap: WidgetFieldValue; + tableDataField: WidgetFieldValue; + tableColumnWidth: WidgetFieldValue; + subTotal: WidgetFieldValue; + stackBy: WidgetFieldValue; + progressBar: WidgetFieldValue; + pieChartType: WidgetFieldValue; + numberFormat: WidgetFieldValue; + missingValue: WidgetFieldValue; + min: WidgetFieldValue; + max: WidgetFieldValue; + lineBy: WidgetFieldValue; + legend: WidgetFieldValue; + icon: WidgetFieldValue; + header: WidgetFieldValue; + groupBy: WidgetFieldValue; + granularity: WidgetFieldValue; + formatRules: WidgetFieldValue; + displaySeriesLabel: WidgetFieldValue; + displayAnnotation: WidgetFieldValue; + dateRange: WidgetFieldValue; + dateFormat: WidgetFieldValue; + dataFieldHeatmapColor: WidgetFieldValue; + dataField: WidgetFieldValue; + dateAggregationOptions: WidgetFieldValue; + customTableColumnWidth: WidgetFieldValue; + comparison: WidgetFieldValue; + colorSchema: WidgetFieldValue; + categoryBy: WidgetFieldValue; + advancedFormatRules: WidgetFieldValue; +} diff --git a/apps/web/src/common/modules/widgets/_widget-field-value-manager/validator-registry.ts b/apps/web/src/common/modules/widgets/_widget-field-value-manager/validator-registry.ts new file mode 100644 index 0000000000..8813931f32 --- /dev/null +++ b/apps/web/src/common/modules/widgets/_widget-field-value-manager/validator-registry.ts @@ -0,0 +1,23 @@ +import type { FieldValueValidator } from '@/common/modules/widgets/_widget-field-value-manager/type'; +import type { DataFieldOptions, DataFieldValue } from '@/common/modules/widgets/_widget-fields/data-field/type'; +import type { WidgetConfig } from '@/common/modules/widgets/types/widget-config-type'; + +interface WidgetValidatorRegistry { + [fieldKey: string]: FieldValueValidator; +} + +export const widgetValidatorRegistry: WidgetValidatorRegistry = { + dataField: (fieldValue: DataFieldValue, widgetConfig) => { + const _fieldsSchema = integrateFieldsSchema(widgetConfig.requiredFieldsSchema, widgetConfig.optionalFieldsSchema); + const dataFieldOptions = _fieldsSchema.dataField?.options as DataFieldOptions; + if (dataFieldOptions.multiSelectable) { + return Array.isArray(fieldValue.data) && !!fieldValue.data.length; + } + return !!fieldValue.data; + }, +}; + +const integrateFieldsSchema = (requiredFieldsSchema: WidgetConfig['requiredFieldsSchema'], optionalFieldsSchema: WidgetConfig['optionalFieldsSchema']) => ({ + ...requiredFieldsSchema, + ...optionalFieldsSchema, +}); diff --git a/apps/web/src/common/modules/widgets/_widget-fields/data-field/_WidgetFieldDataField.vue b/apps/web/src/common/modules/widgets/_widget-fields/data-field/_WidgetFieldDataField.vue new file mode 100644 index 0000000000..d51e2bbb6a --- /dev/null +++ b/apps/web/src/common/modules/widgets/_widget-fields/data-field/_WidgetFieldDataField.vue @@ -0,0 +1,82 @@ + + + + + + + diff --git a/apps/web/src/common/modules/widgets/_widget-fields/data-field/type.ts b/apps/web/src/common/modules/widgets/_widget-fields/data-field/type.ts index fd4137b9a9..ddb3d83a18 100644 --- a/apps/web/src/common/modules/widgets/_widget-fields/data-field/type.ts +++ b/apps/web/src/common/modules/widgets/_widget-fields/data-field/type.ts @@ -1,3 +1,8 @@ + export interface DataFieldOptions { multiSelectable?: boolean; } + +export interface DataFieldValue { + data: string|string[]; +} diff --git a/apps/web/src/common/modules/widgets/_widget-fields/data-aggregation-options/WidgetFieldDateAggregationOptions.vue b/apps/web/src/common/modules/widgets/_widget-fields/date-aggregation-options/WidgetFieldDateAggregationOptions.vue similarity index 95% rename from apps/web/src/common/modules/widgets/_widget-fields/data-aggregation-options/WidgetFieldDateAggregationOptions.vue rename to apps/web/src/common/modules/widgets/_widget-fields/date-aggregation-options/WidgetFieldDateAggregationOptions.vue index b8e4dd29af..19117672d8 100644 --- a/apps/web/src/common/modules/widgets/_widget-fields/data-aggregation-options/WidgetFieldDateAggregationOptions.vue +++ b/apps/web/src/common/modules/widgets/_widget-fields/date-aggregation-options/WidgetFieldDateAggregationOptions.vue @@ -7,12 +7,12 @@ import type { MenuItem } from '@cloudforet/mirinae/types/controls/context-menu/t import { i18n } from '@/translations'; import { useProxyValue } from '@/common/composables/proxy-state'; -import { DATE_AGGREGATION_OPTIONS } from '@/common/modules/widgets/_widget-fields/data-aggregation-options/constant'; +import { DATE_AGGREGATION_OPTIONS } from '@/common/modules/widgets/_widget-fields/date-aggregation-options/constant'; import type { DateAggregationOptionsOptions, DateAggregationOptionsValue, DateAggregationOtionsType, -} from '@/common/modules/widgets/_widget-fields/data-aggregation-options/type'; +} from '@/common/modules/widgets/_widget-fields/date-aggregation-options/type'; import type { WidgetFieldComponentProps, WidgetFieldComponentEmit, diff --git a/apps/web/src/common/modules/widgets/_widget-fields/data-aggregation-options/constant.ts b/apps/web/src/common/modules/widgets/_widget-fields/date-aggregation-options/constant.ts similarity index 100% rename from apps/web/src/common/modules/widgets/_widget-fields/data-aggregation-options/constant.ts rename to apps/web/src/common/modules/widgets/_widget-fields/date-aggregation-options/constant.ts diff --git a/apps/web/src/common/modules/widgets/_widget-fields/data-aggregation-options/type.ts b/apps/web/src/common/modules/widgets/_widget-fields/date-aggregation-options/type.ts similarity index 85% rename from apps/web/src/common/modules/widgets/_widget-fields/data-aggregation-options/type.ts rename to apps/web/src/common/modules/widgets/_widget-fields/date-aggregation-options/type.ts index 21a85fbd7a..c0fc01d756 100644 --- a/apps/web/src/common/modules/widgets/_widget-fields/data-aggregation-options/type.ts +++ b/apps/web/src/common/modules/widgets/_widget-fields/date-aggregation-options/type.ts @@ -1,4 +1,4 @@ -import type { DATE_AGGREGATION_OPTIONS } from '@/common/modules/widgets/_widget-fields/data-aggregation-options/constant'; +import type { DATE_AGGREGATION_OPTIONS } from '@/common/modules/widgets/_widget-fields/date-aggregation-options/constant'; export interface DateAggregationOptionsValue { value: DateAggregationOtionsType; diff --git a/apps/web/src/common/modules/widgets/_widget-fields/granularity/type.ts b/apps/web/src/common/modules/widgets/_widget-fields/granularity/type.ts new file mode 100644 index 0000000000..b17af39459 --- /dev/null +++ b/apps/web/src/common/modules/widgets/_widget-fields/granularity/type.ts @@ -0,0 +1,4 @@ + +export interface GranularityValue { + granularity: 'YEARLY' | 'MONTHLY' | 'DAILY'; +} diff --git a/apps/web/src/common/modules/widgets/_widget-fields/max/type.ts b/apps/web/src/common/modules/widgets/_widget-fields/max/type.ts index f2b7134617..0673706698 100644 --- a/apps/web/src/common/modules/widgets/_widget-fields/max/type.ts +++ b/apps/web/src/common/modules/widgets/_widget-fields/max/type.ts @@ -1,3 +1,8 @@ + export interface MaxOptions { default?: number; } + +export interface MaxValue { + max: number; +} diff --git a/apps/web/src/common/modules/widgets/_widget-fields/min/type.ts b/apps/web/src/common/modules/widgets/_widget-fields/min/type.ts index ddbed02898..454e9f1291 100644 --- a/apps/web/src/common/modules/widgets/_widget-fields/min/type.ts +++ b/apps/web/src/common/modules/widgets/_widget-fields/min/type.ts @@ -1,3 +1,8 @@ + export interface MinOptions { default?: number; } + +export interface MinValue { + min: number; +} diff --git a/apps/web/src/common/modules/widgets/_widget-fields/pie-chart-type/type.ts b/apps/web/src/common/modules/widgets/_widget-fields/pie-chart-type/type.ts index c9a1d4a917..2d76d5f111 100644 --- a/apps/web/src/common/modules/widgets/_widget-fields/pie-chart-type/type.ts +++ b/apps/web/src/common/modules/widgets/_widget-fields/pie-chart-type/type.ts @@ -1,3 +1,8 @@ + export interface PieChartTypeOptions { default?: string; } + +export interface PieChartTypeValue { + type: 'pie' | 'donut'; +} diff --git a/apps/web/src/common/modules/widgets/_widget-fields/sub-total/type.ts b/apps/web/src/common/modules/widgets/_widget-fields/sub-total/type.ts index 988309fcd6..be97de8ba0 100644 --- a/apps/web/src/common/modules/widgets/_widget-fields/sub-total/type.ts +++ b/apps/web/src/common/modules/widgets/_widget-fields/sub-total/type.ts @@ -3,3 +3,9 @@ export interface SubTotalOptions { default?: boolean; toggle?: boolean; } + + +export interface SubTotalValue { + toggleValue: boolean; + freeze: boolean; +} diff --git a/apps/web/src/common/modules/widgets/types/widget-field-type.ts b/apps/web/src/common/modules/widgets/types/widget-field-type.ts index 55bf90da9e..f98e8f8dd6 100644 --- a/apps/web/src/common/modules/widgets/types/widget-field-type.ts +++ b/apps/web/src/common/modules/widgets/types/widget-field-type.ts @@ -2,14 +2,15 @@ import type { DateRange } from '@/schema/dashboard/_types/dashboard-type'; import type { PrivateDataTableModel } from '@/schema/dashboard/private-data-table/model'; import type { PublicDataTableModel } from '@/schema/dashboard/public-data-table/model'; +import type WidgetFieldValueManager from '@/common/modules/widgets/_widget-field-value-manager'; import type { AdvancedFormatRulesOptions } from '@/common/modules/widgets/_widget-fields/advanced-format-rules/type'; import type { CategoryByOptions } from '@/common/modules/widgets/_widget-fields/category-by/type'; import type { ColorSchemaOptions } from '@/common/modules/widgets/_widget-fields/color-schema/type'; import type { ComparisonOptions } from '@/common/modules/widgets/_widget-fields/comparison/type'; import type { CustomTableColumnWidthOptions } from '@/common/modules/widgets/_widget-fields/custom-table-column-width/type'; -import type { DateAggregationOptionsOptions } from '@/common/modules/widgets/_widget-fields/data-aggregation-options/type'; import type { DataFieldHeatmapColorOptions } from '@/common/modules/widgets/_widget-fields/data-field-heatmap-color/type'; import type { DataFieldOptions } from '@/common/modules/widgets/_widget-fields/data-field/type'; +import type { DateAggregationOptionsOptions } from '@/common/modules/widgets/_widget-fields/date-aggregation-options/type'; import type { DateFormatOptions } from '@/common/modules/widgets/_widget-fields/date-format/type'; import type { DateRangeOptions } from '@/common/modules/widgets/_widget-fields/date-range/type'; import type { DisplaySeriesLabelOptions } from '@/common/modules/widgets/_widget-fields/display-series-label/type'; @@ -79,6 +80,14 @@ export interface WidgetFieldComponentProps { dateRange?: DateRange; } +// TODO: replace this with WidgetFieldComponentProps +export interface _WidgetFieldComponentProps { + widgetFieldSchema: WidgetFieldSchema; + manager: WidgetFieldValueManager; + widgetConfig: WidgetConfig; + widgetId: string; +} + export interface WidgetFieldComponentEmit { (e: 'update:value', value: ValueType): void; (e: 'update:is-valid', value: boolean): void; diff --git a/apps/web/src/common/modules/widgets/types/widget-field-value-type.ts b/apps/web/src/common/modules/widgets/types/widget-field-value-type.ts index ca94220cc1..a59223ad96 100644 --- a/apps/web/src/common/modules/widgets/types/widget-field-value-type.ts +++ b/apps/web/src/common/modules/widgets/types/widget-field-value-type.ts @@ -3,8 +3,8 @@ import type { CategoryByValue } from '@/common/modules/widgets/_widget-fields/ca import type { ColorSchemaValue } from '@/common/modules/widgets/_widget-fields/color-schema/type'; import type { ComparisonValue } from '@/common/modules/widgets/_widget-fields/comparison/type'; import type { CustomTableColumnWidthValue } from '@/common/modules/widgets/_widget-fields/custom-table-column-width/type'; -import type { DateAggregationOptionsValue } from '@/common/modules/widgets/_widget-fields/data-aggregation-options/type'; import type { DataFieldHeatmapColorValue } from '@/common/modules/widgets/_widget-fields/data-field-heatmap-color/type'; +import type { DateAggregationOptionsValue } from '@/common/modules/widgets/_widget-fields/date-aggregation-options/type'; import type { DateFormatValue } from '@/common/modules/widgets/_widget-fields/date-format/type'; import type { DateRangeValue } from '@/common/modules/widgets/_widget-fields/date-range/type'; import type { DisplayAnnotationValue } from '@/common/modules/widgets/_widget-fields/display-annotation/type';