Skip to content

Commit

Permalink
chore: change from _WidgetFieldComponentProps to `WidgetFieldCompon…
Browse files Browse the repository at this point in the history
…entProps` (#5309)

* chore: change from `_WidgetFieldComponentProps` to `WidgetFieldComponentProps`

Signed-off-by: yuda <[email protected]>

* chore: change type name

Signed-off-by: yuda <[email protected]>

* feat: delete unused widget hook

Signed-off-by: yuda <[email protected]>

---------

Signed-off-by: yuda <[email protected]>
  • Loading branch information
yuda110 authored Dec 23, 2024
1 parent 7b35d73 commit 19b9f99
Show file tree
Hide file tree
Showing 32 changed files with 61 additions and 203 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import type {
CategoryByOptions,
} from '@/common/modules/widgets/_widget-fields/category-by/type';
import type {
_WidgetFieldComponentProps,
WidgetFieldComponentProps,
} from '@/common/modules/widgets/types/widget-field-type';
const FIELD_KEY = 'categoryBy';
const props = defineProps<_WidgetFieldComponentProps<CategoryByOptions>>();
const props = defineProps<WidgetFieldComponentProps<CategoryByOptions>>();
const widgetGenerateStore = useWidgetGenerateStore();
const widgetGenerateGetters = widgetGenerateStore.getters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ import type {
_ColorSchemaOptions as ColorSchemaOptions,
} from '@/common/modules/widgets/_widget-fields/color-schema/type';
import type {
_WidgetFieldComponentProps,
WidgetFieldComponentProps,
} from '@/common/modules/widgets/types/widget-field-type';
const FIELD_KEY = 'colorSchema';
const props = defineProps<_WidgetFieldComponentProps<ColorSchemaOptions>>();
const props = defineProps<WidgetFieldComponentProps<ColorSchemaOptions>>();
type ColorSchemaMenuItem = {
name: ColorSchemaValue['colorName'],
label: ColorSchemaValue['colorName']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ import {
import type { ComparisonFormat, ComparisonValue, ComparisonOptions } from '@/common/modules/widgets/_widget-fields/comparison/type';
import type { GroupByValue } from '@/common/modules/widgets/_widget-fields/group-by/type';
import type {
_WidgetFieldComponentProps,
WidgetFieldComponentProps,
} from '@/common/modules/widgets/types/widget-field-type';
const FIELD_KEY = 'comparison';
const props = defineProps<_WidgetFieldComponentProps<ComparisonOptions>>();
const props = defineProps<WidgetFieldComponentProps<ComparisonOptions>>();
const state = reactive({
fieldValue: computed<ComparisonValue>(() => props.fieldManager.data[FIELD_KEY].value),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ import type {
CustomTableColumnWidthValue, CustomTableColumnWidthOptions,
} from '@/common/modules/widgets/_widget-fields/custom-table-column-width/type';
import type {
_WidgetFieldComponentProps,
WidgetFieldComponentProps,
} from '@/common/modules/widgets/types/widget-field-type';
interface CustomWidthFieldItem extends CustomColumnWidthItem {
key: string;
}
const FIELD_KEY = 'customTableColumnWidth';
const props = defineProps<_WidgetFieldComponentProps<CustomTableColumnWidthOptions>>();
const props = defineProps<WidgetFieldComponentProps<CustomTableColumnWidthOptions>>();
const widgetGenerateStore = useWidgetGenerateStore();
const widgetGenerateGetters = widgetGenerateStore.getters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import type {
_DataFieldHeatmapColorValue,
} from '@/common/modules/widgets/_widget-fields/data-field-heatmap-color/type';
import type {
_WidgetFieldComponentProps,
WidgetFieldComponentProps,
} from '@/common/modules/widgets/types/widget-field-type';
const FIELD_KEY = 'dataFieldHeatmapColor';
const props = defineProps<_WidgetFieldComponentProps<DataFieldHeatmapColorOptions>>();
const props = defineProps<WidgetFieldComponentProps<DataFieldHeatmapColorOptions>>();
const widgetGenerateStore = useWidgetGenerateStore();
const widgetGenerateGetters = widgetGenerateStore.getters;
const state = reactive({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import { useWidgetGenerateStore } from '@/common/modules/widgets/_store/widget-g
import { widgetValidatorRegistry } from '@/common/modules/widgets/_widget-field-value-manager/constant/validator-registry';
import type { DataFieldOptions, DataFieldValue } from '@/common/modules/widgets/_widget-fields/data-field/type';
import type {
_WidgetFieldComponentProps,
WidgetFieldComponentProps,
} from '@/common/modules/widgets/types/widget-field-type';

const FIELD_KEY = 'dataField';
const props = withDefaults(defineProps<_WidgetFieldComponentProps<DataFieldOptions>>(), {
const props = withDefaults(defineProps<WidgetFieldComponentProps<DataFieldOptions>>(), {
widgetFieldSchema: () => ({}),
});
const widgetGenerateStore = useWidgetGenerateStore();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
DateFormatValue,
} from '@/common/modules/widgets/_widget-fields/date-format/type';
import type {
_WidgetFieldComponentProps,
WidgetFieldComponentProps,
} from '@/common/modules/widgets/types/widget-field-type';
const BIRTHDAY_OF_WONNY = '2020-01-29';
Expand All @@ -27,7 +27,7 @@ const DATE_FORMAT_LABEL_MAP = {
};
const FIELD_KEY = 'dateFormat';
const props = defineProps<_WidgetFieldComponentProps<DateFormatOptions>>();
const props = defineProps<WidgetFieldComponentProps<DateFormatOptions>>();
const state = reactive({
fieldValue: computed<DateFormatValue>(() => props.fieldManager.data[FIELD_KEY].value),
menuItems: computed<MenuItem[]>(() => Object.keys(DATE_FORMAT).map((d) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import type {
} from '@/common/modules/widgets/_widget-fields/date-range/type';
import type { GranularityValue } from '@/common/modules/widgets/_widget-fields/granularity/type';
import type {
_WidgetFieldComponentProps,
WidgetFieldComponentProps,
} from '@/common/modules/widgets/types/widget-field-type';
import { useDashboardDetailInfoStore } from '@/services/dashboards/stores/dashboard-detail-info-store';
Expand All @@ -50,7 +50,7 @@ const getCommonDateRangeValueLabel = (value: string): string => {
};
const FIELD_KEY = 'dateRange';
const props = defineProps<_WidgetFieldComponentProps<DateRangeOptions>>();
const props = defineProps<WidgetFieldComponentProps<DateRangeOptions>>();
const dashboardDetailStore = useDashboardDetailInfoStore();
const dashboardDetailState = dashboardDetailStore.state;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import {
} from '@/common/modules/widgets/_widget-field-value-manager/constant/validator-registry';
import type { DisplayAnnotationValue } from '@/common/modules/widgets/_widget-fields/display-annotation/type';
import type {
_WidgetFieldComponentProps,
WidgetFieldComponentProps,
} from '@/common/modules/widgets/types/widget-field-type';
const FIELD_KEY = 'displayAnnotation';
const validator = widgetValidatorRegistry[FIELD_KEY];
const props = defineProps<_WidgetFieldComponentProps<undefined>>();
const props = defineProps<WidgetFieldComponentProps<undefined>>();
const state = reactive({
fieldValue: computed<DisplayAnnotationValue>(() => props.fieldManager.data[FIELD_KEY].value),
invalid: computed(() => !validator(state.fieldValue, props.widgetConfig)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { i18n } from '@/translations';
import type { DisplaySeriesLabelValue, DisplaySeriesLabelOptions } from '@/common/modules/widgets/_widget-fields/display-series-label/type';
import type {
_WidgetFieldComponentProps,
WidgetFieldComponentProps,
} from '@/common/modules/widgets/types/widget-field-type';
Expand All @@ -21,7 +21,7 @@ const ROTATE_MIN = -90;
const ROTATE_MAX = 90;
const FIELD_KEY = 'displaySeriesLabel';
const props = defineProps<_WidgetFieldComponentProps<DisplaySeriesLabelOptions>>();
const props = defineProps<WidgetFieldComponentProps<DisplaySeriesLabelOptions>>();
const state = reactive({
fieldValue: computed<DisplaySeriesLabelValue>(() => props.fieldManager.data[FIELD_KEY].value),
menuItems: computed<SelectDropdownMenuItem[]>(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import type {
} from '@/common/modules/widgets/_widget-fields/format-rules/type';
import type {
_WidgetFieldComponentProps,
WidgetFieldComponentProps,
} from '@/common/modules/widgets/types/widget-field-type';
const FIELD_KEY = 'formatRules';
const props = defineProps<_WidgetFieldComponentProps<FormatRulesOptions>>();
const props = defineProps<WidgetFieldComponentProps<FormatRulesOptions>>();
const widgetGenerateStore = useWidgetGenerateStore();
const widgetGenerateGetters = widgetGenerateStore.getters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import { VariableModelFactory } from '@/lib/variable-models';
import type { GranularityValue } from '@/common/modules/widgets/_widget-fields/granularity/type';
import type {
_WidgetFieldComponentProps,
WidgetFieldComponentProps,
} from '@/common/modules/widgets/types/widget-field-type';
const FIELD_KEY = 'granularity';
const props = defineProps<_WidgetFieldComponentProps<undefined>>();
const props = defineProps<WidgetFieldComponentProps<undefined>>();
const state = reactive({
fieldValue: computed<GranularityValue>(() => props.fieldManager.data[FIELD_KEY].value),
granularityMenuItems: asyncComputed<MenuItem[]>(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ import type {
GroupByValue,
} from '@/common/modules/widgets/_widget-fields/group-by/type';
import type {
_WidgetFieldComponentProps,
WidgetFieldComponentProps,
} from '@/common/modules/widgets/types/widget-field-type';
const DEFAULT_COUNT = 5;
const FIELD_KEY = 'groupBy';
const props = defineProps<_WidgetFieldComponentProps<GroupByOptions>>();
const props = defineProps<WidgetFieldComponentProps<GroupByOptions>>();
const widgetGenerateStore = useWidgetGenerateStore();
const widgetGenerateGetters = widgetGenerateStore.getters;
// const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import {
} from '@/common/modules/widgets/_widget-field-value-manager/constant/validator-registry';
import type { WidgetHeaderValue } from '@/common/modules/widgets/_widget-fields/header/type';
import type {
_WidgetFieldComponentProps,
WidgetFieldComponentProps,
} from '@/common/modules/widgets/types/widget-field-type';
const FIELD_KEY = 'widgetHeader';
const props = defineProps<_WidgetFieldComponentProps<undefined>>();
const props = defineProps<WidgetFieldComponentProps<undefined>>();
const validator = widgetValidatorRegistry[FIELD_KEY];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ import {
import { ICON_FIELD_ITEMS } from '@/common/modules/widgets/_widget-fields/icon/constant';
import type { Icon, IconOptions, IconValue } from '@/common/modules/widgets/_widget-fields/icon/type';
import type {
_WidgetFieldComponentProps,
WidgetFieldComponentProps,
} from '@/common/modules/widgets/types/widget-field-type';
const FIELD_KEY = 'icon';
const props = defineProps<_WidgetFieldComponentProps<IconOptions>>();
const props = defineProps<WidgetFieldComponentProps<IconOptions>>();
const validator = widgetValidatorRegistry[FIELD_KEY];
const state = reactive({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import {
} from '@/common/modules/widgets/_widget-field-value-manager/constant/default-value-registry';
import type { LegendValue, LegendOptions } from '@/common/modules/widgets/_widget-fields/legend/type';
import type {
_WidgetFieldComponentProps,
WidgetFieldComponentProps,
} from '@/common/modules/widgets/types/widget-field-type';
const FIELD_KEY = 'legend';
const props = defineProps<_WidgetFieldComponentProps<LegendOptions>>();
const props = defineProps<WidgetFieldComponentProps<LegendOptions>>();
const state = reactive({
fieldValue: computed<LegendValue>(() => props.fieldManager.data[FIELD_KEY].value),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import { PFieldGroup, PTextInput } from '@cloudforet/mirinae';
import type { MaxOptions, MaxValue } from '@/common/modules/widgets/_widget-fields/max/type';
import type {
_WidgetFieldComponentProps,
WidgetFieldComponentProps,
} from '@/common/modules/widgets/types/widget-field-type';
const FIELD_KEY = 'max';
const props = defineProps<_WidgetFieldComponentProps<MaxOptions>>();
const props = defineProps<WidgetFieldComponentProps<MaxOptions>>();
const state = reactive({
fieldValue: computed<MaxValue>(() => props.fieldManager.data[FIELD_KEY].value),
Expand Down
Loading

0 comments on commit 19b9f99

Please sign in to comment.