Skip to content

Commit

Permalink
fix: change input setter to data grid
Browse files Browse the repository at this point in the history
  • Loading branch information
owenlongbo committed Oct 25, 2023
1 parent 1790fb4 commit ae265de
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions apps/builder/src/widgetLibrary/DataGridWidget/panelConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function getColumnsTypeSubSetter(type: ColumnType): PanelFieldConfig[] {
id: `${baseWidgetName}-column-format`,
labelName: i18n.t("editor.inspect.setter_label.format"),
attrName: "format",
setterType: "INPUT_SETTER",
setterType: "DATA_GRID_MAPPED_INPUT_SETTER",
defaultValue: "YYYY-MM-DD",
expectedType: VALIDATION_TYPES.STRING,
},
Expand All @@ -85,7 +85,7 @@ export function getColumnsTypeSubSetter(type: ColumnType): PanelFieldConfig[] {
id: `${baseWidgetName}-column-tagColor`,
labelName: i18n.t("editor.inspect.setter_label.table.tag_color"),
labelDesc: i18n.t("editor.inspect.setter_tips.table.tag_color"),
setterType: "INPUT_SETTER",
setterType: "DATA_GRID_MAPPED_INPUT_SETTER",
attrName: "tagColor",
},
]
Expand All @@ -103,7 +103,7 @@ export function getColumnsTypeSubSetter(type: ColumnType): PanelFieldConfig[] {
id: `${baseWidgetName}-column-format`,
labelName: i18n.t("editor.inspect.setter_label.format"),
attrName: "format",
setterType: "INPUT_SETTER",
setterType: "DATA_GRID_MAPPED_INPUT_SETTER",
defaultValue: "YYYY-MM-DD HH:mm:ss",
expectedType: VALIDATION_TYPES.STRING,
},
Expand All @@ -123,7 +123,7 @@ export function getColumnsTypeSubSetter(type: ColumnType): PanelFieldConfig[] {
labelName: i18n.t("editor.inspect.setter_label.decimal_places"),
attrName: "decimalPlaces",
placeholder: "{{ 0 }}",
setterType: "INPUT_SETTER",
setterType: "DATA_GRID_MAPPED_INPUT_SETTER",
expectedType: VALIDATION_TYPES.NUMBER,
},
{
Expand All @@ -145,7 +145,7 @@ export function getColumnsTypeSubSetter(type: ColumnType): PanelFieldConfig[] {
labelName: i18n.t("editor.inspect.setter_label.table.locale"),
labelDesc: i18n.t("editor.inspect.setter_tips.table.locale"),
attrName: "locale",
setterType: "INPUT_SETTER",
setterType: "DATA_GRID_MAPPED_INPUT_SETTER",
expectedType: VALIDATION_TYPES.STRING,
bindAttrName: ["showThousandsSeparator"],
shown: (value) => value,
Expand All @@ -168,7 +168,7 @@ export function getColumnsTypeSubSetter(type: ColumnType): PanelFieldConfig[] {
labelName: i18n.t("editor.inspect.setter_label.decimal_places"),
attrName: "decimalPlaces",
placeholder: "{{ 0 }}",
setterType: "INPUT_SETTER",
setterType: "DATA_GRID_MAPPED_INPUT_SETTER",
expectedType: VALIDATION_TYPES.NUMBER,
},
{
Expand All @@ -190,7 +190,7 @@ export function getColumnsTypeSubSetter(type: ColumnType): PanelFieldConfig[] {
labelName: i18n.t("editor.inspect.setter_label.table.locale"),
labelDesc: i18n.t("editor.inspect.setter_tips.table.locale"),
attrName: "locale",
setterType: "INPUT_SETTER",
setterType: "DATA_GRID_MAPPED_INPUT_SETTER",
expectedType: VALIDATION_TYPES.STRING,
bindAttrName: ["showThousandsSeparator"],
shown: (value) => value,
Expand Down Expand Up @@ -239,7 +239,7 @@ export function getColumnsTypeSubSetter(type: ColumnType): PanelFieldConfig[] {
labelDesc: i18n.t("editor.inspect.setter_tooltip.disabled"),
placeholder: "{{false}}",
attrName: "disabled",
setterType: "INPUT_SETTER",
setterType: "DATA_GRID_MAPPED_INPUT_SETTER",
expectedType: VALIDATION_TYPES.BOOLEAN,
},
{
Expand Down Expand Up @@ -277,7 +277,7 @@ export function getColumnsTypeSubSetter(type: ColumnType): PanelFieldConfig[] {
labelDesc: i18n.t("editor.inspect.setter_tooltip.disabled"),
placeholder: "{{false}}",
attrName: "disabled",
setterType: "INPUT_SETTER",
setterType: "DATA_GRID_MAPPED_INPUT_SETTER",
expectedType: VALIDATION_TYPES.BOOLEAN,
},
{
Expand Down Expand Up @@ -336,7 +336,7 @@ export function getColumnsTypeSubSetter(type: ColumnType): PanelFieldConfig[] {
labelName: i18n.t("editor.inspect.setter_label.max_count"),
attrName: "maxCount",
placeholder: "{{ 5 }}",
setterType: "INPUT_SETTER",
setterType: "DATA_GRID_MAPPED_INPUT_SETTER",
expectedType: VALIDATION_TYPES.NUMBER,
},
]
Expand Down Expand Up @@ -369,15 +369,15 @@ export function getColumnsTypeSubSetter(type: ColumnType): PanelFieldConfig[] {
"editor.inspect.setter_placeholder.table.currency_code",
),
attrName: "currencyCode",
setterType: "INPUT_SETTER",
setterType: "DATA_GRID_MAPPED_INPUT_SETTER",
expectedType: VALIDATION_TYPES.STRING,
},
{
id: `${baseWidgetName}-column-decimalPlaces`,
labelName: i18n.t("editor.inspect.setter_label.decimal_places"),
attrName: "decimalPlaces",
placeholder: "{{ 0 }}",
setterType: "INPUT_SETTER",
setterType: "DATA_GRID_MAPPED_INPUT_SETTER",
expectedType: VALIDATION_TYPES.NUMBER,
},
{
Expand All @@ -399,7 +399,7 @@ export function getColumnsTypeSubSetter(type: ColumnType): PanelFieldConfig[] {
labelName: i18n.t("editor.inspect.setter_label.table.locale"),
labelDesc: i18n.t("editor.inspect.setter_tips.table.locale"),
attrName: "locale",
setterType: "INPUT_SETTER",
setterType: "DATA_GRID_MAPPED_INPUT_SETTER",
expectedType: VALIDATION_TYPES.STRING,
bindAttrName: ["showThousandsSeparator"],
shown: (value) => value,
Expand All @@ -417,7 +417,7 @@ export const DATA_GRID_COMMON_COLUMN_SETTER_CONFIG: PanelFieldConfig[] = [
id: `${baseWidgetName}-column-headerName`,
labelName: i18n.t("editor.inspect.setter_label.column_title"),
attrName: "headerName",
setterType: "INPUT_SETTER",
setterType: "DATA_GRID_MAPPED_INPUT_SETTER",
expectedType: VALIDATION_TYPES.STRING,
},
{
Expand All @@ -433,15 +433,15 @@ export const DATA_GRID_COMMON_COLUMN_SETTER_CONFIG: PanelFieldConfig[] = [
labelName: i18n.t("editor.inspect.setter_label.column_description"),
labelDesc: i18n.t("editor.inspect.setter_tips.column_description"),
attrName: "description",
setterType: "INPUT_SETTER",
setterType: "DATA_GRID_MAPPED_INPUT_SETTER",
expectedType: VALIDATION_TYPES.STRING,
},
{
id: `${baseWidgetName}-column-width`,
labelName: i18n.t("editor.inspect.setter_label.width"),
labelDesc: i18n.t("editor.inspect.setter_tips.width"),
attrName: "width",
setterType: "INPUT_SETTER",
setterType: "DATA_GRID_MAPPED_INPUT_SETTER",
expectedType: VALIDATION_TYPES.NUMBER,
},
{
Expand Down Expand Up @@ -722,7 +722,7 @@ export const DATA_GRID_PANEL_CONFIG: PanelConfig[] = [
id: `${baseWidgetName}-basic-totalRowCount`,
labelName: i18n.t("editor.inspect.setter_label.table.total_row_count"),
attrName: "totalRowCount",
setterType: "INPUT_SETTER",
setterType: "DATA_GRID_MAPPED_INPUT_SETTER",
isSetterSingleRow: true,
expectedType: VALIDATION_TYPES.NUMBER,
bindAttrName: ["enableServerSidePagination"],
Expand All @@ -732,7 +732,7 @@ export const DATA_GRID_PANEL_CONFIG: PanelConfig[] = [
id: `${baseWidgetName}-basic-previousCursor`,
labelName: i18n.t("editor.inspect.setter_label.previous_cursor"),
attrName: "previousCursor",
setterType: "INPUT_SETTER",
setterType: "DATA_GRID_MAPPED_INPUT_SETTER",
expectedType: VALIDATION_TYPES.STRING,
bindAttrName: ["enableServerSidePagination", "paginationType"],
shown: (enable, paginationType) =>
Expand All @@ -742,7 +742,7 @@ export const DATA_GRID_PANEL_CONFIG: PanelConfig[] = [
id: `${baseWidgetName}-basic-nextCursor`,
labelName: i18n.t("editor.inspect.setter_label.table.next_cursor"),
attrName: "nextCursor",
setterType: "INPUT_SETTER",
setterType: "DATA_GRID_MAPPED_INPUT_SETTER",
expectedType: VALIDATION_TYPES.STRING,
bindAttrName: ["enableServerSidePagination", "paginationType"],
shown: (enable, paginationType) =>
Expand All @@ -752,7 +752,7 @@ export const DATA_GRID_PANEL_CONFIG: PanelConfig[] = [
id: `${baseWidgetName}-basic-hasNextPage`,
labelName: i18n.t("editor.inspect.setter_label.table.has_next_page"),
attrName: "hasNextPage",
setterType: "INPUT_SETTER",
setterType: "DATA_GRID_MAPPED_INPUT_SETTER",
expectedType: VALIDATION_TYPES.BOOLEAN,
bindAttrName: ["enableServerSidePagination", "paginationType"],
shown: (enable, paginationType) =>
Expand All @@ -763,7 +763,7 @@ export const DATA_GRID_PANEL_CONFIG: PanelConfig[] = [
labelName: i18n.t("editor.inspect.setter_label.pageSize"),
placeholder: "{{30}}",
attrName: "pageSize",
setterType: "INPUT_SETTER",
setterType: "DATA_GRID_MAPPED_INPUT_SETTER",
bindAttrName: [
"overFlow",
"enableServerSidePagination",
Expand All @@ -777,7 +777,7 @@ export const DATA_GRID_PANEL_CONFIG: PanelConfig[] = [
labelName: i18n.t("editor.inspect.setter_label.page"),
placeholder: "{{0}}",
attrName: "page",
setterType: "INPUT_SETTER",
setterType: "DATA_GRID_MAPPED_INPUT_SETTER",
bindAttrName: [
"overFlow",
"enableServerSidePagination",
Expand All @@ -795,7 +795,7 @@ export const DATA_GRID_PANEL_CONFIG: PanelConfig[] = [
labelName: i18n.t("editor.inspect.setter_label.page_size_options"),
placeholder: "{{[5, 10, 25]}}",
attrName: "pageSizeOptions",
setterType: "INPUT_SETTER",
setterType: "DATA_GRID_MAPPED_INPUT_SETTER",
bindAttrName: ["overFlow"],
shown: (overFlow) => overFlow === "pagination",
isSetterSingleRow: true,
Expand Down

0 comments on commit ae265de

Please sign in to comment.