@pisell/materials 1.0.471 → 1.0.473
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +7 -7
- package/build/lowcode/preview.js +142 -142
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +18 -18
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +15 -15
- package/es/components/dataSourceComponents/dataSourceForm/index.less +1 -1
- package/es/components/dataSourceComponents/dataSourceForm/provider/hooks/useJsonPrefixPath.d.ts +4 -1
- package/es/components/dataSourceComponents/dataSourceForm/serve.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceForm/serve.js +4 -3
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +41 -17
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.d.ts +3 -0
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.js +4 -0
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +3 -0
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.js +4 -0
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceTypography/index.d.ts +10 -0
- package/es/components/dataSourceComponents/dataSourceShow/dataSourceTypography/index.js +15 -0
- package/es/components/dataSourceComponents/dataSourceShow/utils.d.ts +6 -0
- package/es/components/dataSourceComponents/dataSourceShow/utils.js +82 -0
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +33 -139
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +25 -0
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.js +162 -0
- package/es/components/dataSourceComponents/dataSourceTable/filter/utils.d.ts +8 -0
- package/es/components/dataSourceComponents/dataSourceTable/filter/utils.js +135 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.js +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDesignMode.js +35 -39
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +20 -4
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.js +65 -11
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useFormat.d.ts +17 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useFormat.js +105 -6
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +77 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +245 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +20 -7
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +41 -12
- package/es/components/dataSourceComponents/dataSourceTable/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/index.js +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/index.less +5 -0
- package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +57 -9
- package/es/components/dataSourceComponents/dataSourceWrapper/BaseWrapper.d.ts +7 -0
- package/es/components/dataSourceComponents/dataSourceWrapper/BaseWrapper.js +23 -0
- package/es/components/dataSourceComponents/dataSourceWrapper/index.d.ts +2 -4
- package/es/components/dataSourceComponents/dataSourceWrapper/index.js +17 -2
- package/es/components/dataSourceComponents/fields/Checkbox/ReadPretty.js +7 -1
- package/es/components/dataSourceComponents/fields/Checkbox/index.js +3 -1
- package/es/components/dataSourceComponents/fields/DatePicker/index.js +5 -1
- package/es/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.js +7 -0
- package/es/components/dataSourceComponents/fields/DateRangePicker/WithMode.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/DateRangePicker/WithMode.js +5 -0
- package/es/components/dataSourceComponents/fields/DateRangePicker/index.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/DateRangePicker/index.js +5 -0
- package/es/components/dataSourceComponents/fields/DateRangePicker/index.less +14 -0
- package/es/components/dataSourceComponents/fields/DateRangePicker/type.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/DateRangePicker/type.js +1 -0
- package/es/components/dataSourceComponents/fields/Input/index.d.ts +6 -1
- package/es/components/dataSourceComponents/fields/Input/index.js +4 -0
- package/es/components/dataSourceComponents/fields/Input.Email/ReadPretty.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/Input.Email/ReadPretty.js +5 -0
- package/es/components/dataSourceComponents/fields/Input.Email/WithMode.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/Input.Email/WithMode.js +17 -0
- package/es/components/dataSourceComponents/fields/Input.Email/index.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/Input.Email/index.js +4 -0
- package/es/components/dataSourceComponents/fields/Input.Email/type.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Input.Email/type.js +1 -0
- package/es/components/dataSourceComponents/fields/Input.Json/ReadPretty.js +2 -2
- package/es/components/dataSourceComponents/fields/Input.Json/WithMode.d.ts +2 -2
- package/es/components/dataSourceComponents/fields/Input.Json/WithMode.js +41 -1
- package/es/components/dataSourceComponents/fields/Input.Json/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Input.Phone/ReadPretty.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/ReadPretty.js +5 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.js +12 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/index.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/index.js +4 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/type.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Input.Phone/type.js +1 -0
- package/es/components/dataSourceComponents/fields/InputNumber/index.js +5 -1
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +52 -4
- package/es/components/dataSourceComponents/fields/index.js +7 -2
- package/es/components/dataSourceComponents/fields/type.d.ts +18 -0
- package/es/components/dataSourceComponents/fields/type.js +1 -0
- package/es/components/dataSourceComponents/fields/utils.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/utils.js +111 -0
- package/es/components/dataSourceComponents/hooks/useActions.js +22 -7
- package/es/components/dataSourceComponents/hooks/useComponentId.d.ts +2 -0
- package/es/components/dataSourceComponents/hooks/useComponentId.js +9 -0
- package/es/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +19 -2
- package/es/components/dataSourceComponents/provider/dataSource/DataSourceProvider.d.ts +1 -1
- package/es/components/dataSourceComponents/provider/dataSource/DataSourceProvider.js +37 -27
- package/es/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +3 -2
- package/es/components/dataSourceComponents/provider/variables/VariablesProvider.js +19 -13
- package/es/components/dataSourceComponents/provider/variables/utils.d.ts +2 -0
- package/es/components/dataSourceComponents/provider/variables/utils.js +9 -0
- package/es/components/filter/components/Dropdown/index.d.ts +1 -0
- package/es/components/filter/components/Dropdown/index.js +6 -2
- package/es/components/filter/components/FilterButton/index.js +5 -3
- package/es/components/filter/components/FilterButton/types.d.ts +2 -0
- package/es/components/table/Actions/index.js +16 -7
- package/es/components/table/Gallery/index.d.ts +3 -3
- package/es/components/table/Gallery/index.js +25 -7
- package/es/components/table/Gallery/index.less +1 -0
- package/es/components/table/Header/index.d.ts +10 -3
- package/es/components/table/Header/index.js +37 -11
- package/es/components/table/Header/index.less +10 -2
- package/es/components/table/Table/utils.js +4 -0
- package/es/components/table/Tabs/index.d.ts +14 -0
- package/es/components/table/Tabs/index.js +37 -0
- package/es/components/table/hooks/useTriggerValuesChange.js +3 -0
- package/es/components/table/index.js +16 -3
- package/es/components/table/types.d.ts +14 -2
- package/es/components/typography/index.d.ts +2 -2
- package/es/components/typography/index.js +4 -3
- package/es/index.d.ts +4 -0
- package/es/index.js +5 -1
- package/es/locales/en-US.d.ts +7 -0
- package/es/locales/en-US.js +16 -1
- package/es/locales/zh-CN.d.ts +7 -0
- package/es/locales/zh-CN.js +16 -1
- package/es/locales/zh-TW.d.ts +7 -0
- package/es/locales/zh-TW.js +16 -1
- package/lib/components/dataSourceComponents/dataSourceForm/index.less +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/provider/hooks/useJsonPrefixPath.d.ts +4 -1
- package/lib/components/dataSourceComponents/dataSourceForm/serve.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceForm/serve.js +3 -2
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +58 -11
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.js +38 -0
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.js +38 -0
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceTypography/index.d.ts +10 -0
- package/lib/components/dataSourceComponents/dataSourceShow/dataSourceTypography/index.js +44 -0
- package/lib/components/dataSourceComponents/dataSourceShow/utils.d.ts +6 -0
- package/lib/components/dataSourceComponents/dataSourceShow/utils.js +95 -0
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +29 -90
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +25 -0
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.js +176 -0
- package/lib/components/dataSourceComponents/dataSourceTable/filter/utils.d.ts +8 -0
- package/lib/components/dataSourceComponents/dataSourceTable/filter/utils.js +176 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDesignMode.js +24 -37
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +20 -4
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.js +53 -7
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useFormat.d.ts +17 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useFormat.js +73 -3
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +77 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +236 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +20 -7
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +38 -11
- package/lib/components/dataSourceComponents/dataSourceTable/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/index.js +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/index.less +5 -0
- package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +57 -9
- package/lib/components/dataSourceComponents/dataSourceWrapper/BaseWrapper.d.ts +7 -0
- package/lib/components/dataSourceComponents/dataSourceWrapper/BaseWrapper.js +51 -0
- package/lib/components/dataSourceComponents/dataSourceWrapper/index.d.ts +2 -4
- package/lib/components/dataSourceComponents/dataSourceWrapper/index.js +14 -2
- package/lib/components/dataSourceComponents/fields/Checkbox/ReadPretty.js +3 -1
- package/lib/components/dataSourceComponents/fields/Checkbox/index.js +3 -1
- package/lib/components/dataSourceComponents/fields/DatePicker/index.js +5 -1
- package/lib/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.js +41 -0
- package/lib/components/dataSourceComponents/fields/DateRangePicker/WithMode.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/DateRangePicker/WithMode.js +42 -0
- package/lib/components/dataSourceComponents/fields/DateRangePicker/index.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/DateRangePicker/index.js +39 -0
- package/lib/components/dataSourceComponents/fields/DateRangePicker/index.less +14 -0
- package/lib/components/dataSourceComponents/fields/DateRangePicker/type.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/DateRangePicker/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/Input/index.d.ts +6 -1
- package/lib/components/dataSourceComponents/fields/Input/index.js +4 -0
- package/lib/components/dataSourceComponents/fields/Input.Email/ReadPretty.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/Input.Email/ReadPretty.js +39 -0
- package/lib/components/dataSourceComponents/fields/Input.Email/WithMode.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/Input.Email/WithMode.js +57 -0
- package/lib/components/dataSourceComponents/fields/Input.Email/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/Input.Email/index.js +38 -0
- package/lib/components/dataSourceComponents/fields/Input.Email/type.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Input.Email/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/Input.Json/ReadPretty.js +2 -2
- package/lib/components/dataSourceComponents/fields/Input.Json/WithMode.d.ts +2 -2
- package/lib/components/dataSourceComponents/fields/Input.Json/WithMode.js +30 -2
- package/lib/components/dataSourceComponents/fields/Input.Json/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Input.Phone/ReadPretty.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/ReadPretty.js +39 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.js +43 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/index.js +38 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/type.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Input.Phone/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/InputNumber/index.js +5 -1
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +52 -4
- package/lib/components/dataSourceComponents/fields/index.js +6 -1
- package/lib/components/dataSourceComponents/fields/type.d.ts +18 -0
- package/lib/components/dataSourceComponents/fields/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/utils.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/utils.js +134 -0
- package/lib/components/dataSourceComponents/hooks/useActions.js +14 -5
- package/lib/components/dataSourceComponents/hooks/useComponentId.d.ts +2 -0
- package/lib/components/dataSourceComponents/hooks/useComponentId.js +32 -0
- package/lib/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +19 -2
- package/lib/components/dataSourceComponents/provider/dataSource/DataSourceProvider.d.ts +1 -1
- package/lib/components/dataSourceComponents/provider/dataSource/DataSourceProvider.js +29 -16
- package/lib/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +3 -2
- package/lib/components/dataSourceComponents/provider/variables/VariablesProvider.js +17 -8
- package/lib/components/dataSourceComponents/provider/variables/utils.d.ts +2 -0
- package/lib/components/dataSourceComponents/provider/variables/utils.js +15 -2
- package/lib/components/filter/components/Dropdown/index.d.ts +1 -0
- package/lib/components/filter/components/Dropdown/index.js +6 -2
- package/lib/components/filter/components/FilterButton/index.js +5 -3
- package/lib/components/filter/components/FilterButton/types.d.ts +2 -0
- package/lib/components/table/Actions/index.js +18 -9
- package/lib/components/table/Gallery/index.d.ts +3 -3
- package/lib/components/table/Gallery/index.js +17 -0
- package/lib/components/table/Gallery/index.less +1 -0
- package/lib/components/table/Header/index.d.ts +10 -3
- package/lib/components/table/Header/index.js +29 -4
- package/lib/components/table/Header/index.less +10 -2
- package/lib/components/table/Table/utils.js +4 -0
- package/lib/components/table/Tabs/index.d.ts +14 -0
- package/lib/components/table/Tabs/index.js +70 -0
- package/lib/components/table/hooks/useTriggerValuesChange.js +3 -0
- package/lib/components/table/index.js +17 -2
- package/lib/components/table/types.d.ts +14 -2
- package/lib/components/typography/index.d.ts +2 -2
- package/lib/components/typography/index.js +4 -3
- package/lib/index.d.ts +4 -0
- package/lib/index.js +12 -0
- package/lib/locales/en-US.d.ts +7 -0
- package/lib/locales/en-US.js +8 -1
- package/lib/locales/zh-CN.d.ts +7 -0
- package/lib/locales/zh-CN.js +8 -1
- package/lib/locales/zh-TW.d.ts +7 -0
- package/lib/locales/zh-TW.js +8 -1
- package/lowcode/_utils/defaultSchema.ts +452 -83
- package/lowcode/_utils/type.ts +5 -0
- package/lowcode/_utils/utils.ts +1 -0
- package/lowcode/button/meta.ts +1 -2
- package/lowcode/data-source-form/constants.ts +5 -0
- package/lowcode/data-source-form/meta.ts +259 -273
- package/lowcode/data-source-form/snippets.ts +9 -0
- package/lowcode/data-source-form/utils.ts +80 -15
- package/lowcode/data-source-image/meta.ts +74 -0
- package/lowcode/data-source-image/snippets.ts +14 -0
- package/lowcode/data-source-qrcode/meta.ts +158 -0
- package/lowcode/data-source-qrcode/snippets.ts +20 -0
- package/lowcode/data-source-table/meta.ts +4577 -2285
- package/lowcode/data-source-table/snippets.ts +10 -4
- package/lowcode/data-source-table/utils.tsx +254 -0
- package/lowcode/data-source-typography/meta.ts +54 -0
- package/lowcode/data-source-typography.text/meta.ts +212 -0
- package/lowcode/data-source-typography.text/snippets.ts +12 -0
- package/lowcode/data-source-wrapper/meta.ts +243 -0
- package/lowcode/data-source-wrapper/snippets.ts +11 -0
- package/lowcode/data-source-wrapper/utils.ts +45 -0
- package/lowcode/form-item-color-picker/snippets.ts +1 -0
- package/lowcode/form-item-input/meta.ts +2 -1
- package/lowcode/form-item-input/snippets.ts +2 -1
- package/lowcode/form-item-input.email/meta.ts +284 -0
- package/lowcode/form-item-input.email/snippets.ts +35 -0
- package/lowcode/form-item-input.phone/meta.ts +295 -0
- package/lowcode/form-item-input.phone/snippets.ts +16 -0
- package/lowcode/form-item-input.text-area/meta.ts +243 -32
- package/lowcode/form-item-input.text-area/snippets.ts +2 -1
- package/lowcode/form-item-input.url/meta.ts +44 -20
- package/lowcode/form-item-input.url/snippets.ts +5 -5
- package/lowcode/table/snippets.ts +6 -0
- package/lowcode/test/meta.ts +1 -2
- package/package.json +2 -2
|
@@ -43,6 +43,7 @@ module.exports = __toCommonJS(utils_exports);
|
|
|
43
43
|
var import_react = __toESM(require("react"));
|
|
44
44
|
var import_utils = require("@pisell/utils");
|
|
45
45
|
var import_antd = require("antd");
|
|
46
|
+
var import_locales = require("../../../locales");
|
|
46
47
|
var import_form = __toESM(require("../../form"));
|
|
47
48
|
var import_useDataSource = __toESM(require("../hooks/useDataSource"));
|
|
48
49
|
var import_useFormSetting = __toESM(require("./provider/hooks/useFormSetting"));
|
|
@@ -81,7 +82,7 @@ var formItemNameReplace = (name) => {
|
|
|
81
82
|
var formItemNameReverse = (name) => {
|
|
82
83
|
return name.replace(new RegExp(FORM_ITEM_SPLIT_CHAR, "g"), ".");
|
|
83
84
|
};
|
|
84
|
-
var withFormItem = (WrappedComponent) => {
|
|
85
|
+
var withFormItem = (WrappedComponent, otherFormItemProps) => {
|
|
85
86
|
return ({
|
|
86
87
|
name: propsName,
|
|
87
88
|
label: propsLabel,
|
|
@@ -100,7 +101,10 @@ var withFormItem = (WrappedComponent) => {
|
|
|
100
101
|
getValueProps,
|
|
101
102
|
validator,
|
|
102
103
|
style,
|
|
104
|
+
validateTrigger,
|
|
103
105
|
__designMode,
|
|
106
|
+
labelCol,
|
|
107
|
+
innerStyle,
|
|
104
108
|
...otherProps
|
|
105
109
|
}) => {
|
|
106
110
|
var _a;
|
|
@@ -112,30 +116,70 @@ var withFormItem = (WrappedComponent) => {
|
|
|
112
116
|
const label = propsLabel || ((_a = field == null ? void 0 : field.uiSchema) == null ? void 0 : _a.title) || propsName;
|
|
113
117
|
const effectiveMode = propsMode || globalMode;
|
|
114
118
|
const renderComponent = (0, import_react.useMemo)(() => {
|
|
115
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
116
|
-
|
|
119
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
120
|
+
WrappedComponent,
|
|
121
|
+
{
|
|
122
|
+
...otherProps,
|
|
123
|
+
mode: propsMode,
|
|
124
|
+
renderMode: effectiveMode,
|
|
125
|
+
style: {
|
|
126
|
+
...(otherFormItemProps == null ? void 0 : otherFormItemProps.innerStyle) || {},
|
|
127
|
+
...innerStyle
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
}, [effectiveMode, otherProps, propsMode, innerStyle, otherFormItemProps == null ? void 0 : otherFormItemProps.innerStyle]);
|
|
117
132
|
const isDesignMode = __designMode === "design";
|
|
118
133
|
const isHidden = effectiveMode === "hidden";
|
|
119
134
|
const name = (0, import_utils.isString)(propsName) && propsName.includes(".") ? [propsName] : propsName;
|
|
120
135
|
const concatName = name !== void 0 ? [...prefixPath, ...toArr(name)] : void 0;
|
|
121
136
|
const rules = [];
|
|
122
137
|
if (requiredobj && requiredobj.required) {
|
|
123
|
-
rules.push(
|
|
138
|
+
rules.push({
|
|
139
|
+
...requiredobj,
|
|
140
|
+
message: requiredobj.message || (0, import_locales.getText)("pisell-data-source-form-required-message")
|
|
141
|
+
});
|
|
124
142
|
}
|
|
125
143
|
if (typeobj && typeobj.enabled) {
|
|
126
|
-
|
|
144
|
+
if (typeobj.type === "email") {
|
|
145
|
+
rules.push({
|
|
146
|
+
...typeobj,
|
|
147
|
+
message: typeobj.message || (0, import_locales.getText)("pisell-data-source-form-email-message")
|
|
148
|
+
});
|
|
149
|
+
} else {
|
|
150
|
+
rules.push({
|
|
151
|
+
...typeobj,
|
|
152
|
+
message: typeobj.message || (0, import_locales.getText)("pisell-data-source-form-type-message")(typeobj == null ? void 0 : typeobj.type)
|
|
153
|
+
});
|
|
154
|
+
}
|
|
127
155
|
}
|
|
128
156
|
if (maxLengthobj && maxLengthobj.enabled) {
|
|
129
|
-
rules.push(
|
|
157
|
+
rules.push({
|
|
158
|
+
...maxLengthobj,
|
|
159
|
+
message: maxLengthobj.message || (0, import_locales.getText)("pisell-data-source-form-max-length-message")(
|
|
160
|
+
maxLengthobj == null ? void 0 : maxLengthobj.max
|
|
161
|
+
)
|
|
162
|
+
});
|
|
130
163
|
}
|
|
131
164
|
if (minLengthobj && minLengthobj.enabled) {
|
|
132
|
-
rules.push(
|
|
165
|
+
rules.push({
|
|
166
|
+
...minLengthobj,
|
|
167
|
+
message: minLengthobj.message || (0, import_locales.getText)("pisell-data-source-form-min-length-message")(
|
|
168
|
+
minLengthobj == null ? void 0 : minLengthobj.min
|
|
169
|
+
)
|
|
170
|
+
});
|
|
133
171
|
}
|
|
134
172
|
if (maxobj && maxobj.enabled) {
|
|
135
|
-
rules.push(
|
|
173
|
+
rules.push({
|
|
174
|
+
...maxobj,
|
|
175
|
+
message: maxobj.message || (0, import_locales.getText)("pisell-data-source-form-max-value-message")(maxobj == null ? void 0 : maxobj.max)
|
|
176
|
+
});
|
|
136
177
|
}
|
|
137
178
|
if (minobj && minobj.enabled) {
|
|
138
|
-
rules.push(
|
|
179
|
+
rules.push({
|
|
180
|
+
...minobj,
|
|
181
|
+
message: minobj.message || (0, import_locales.getText)("pisell-data-source-form-min-value-message")(minobj == null ? void 0 : minobj.min)
|
|
182
|
+
});
|
|
139
183
|
}
|
|
140
184
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
141
185
|
import_form.default.Item,
|
|
@@ -155,7 +199,10 @@ var withFormItem = (WrappedComponent) => {
|
|
|
155
199
|
rules,
|
|
156
200
|
normalize,
|
|
157
201
|
getValueProps,
|
|
158
|
-
validator
|
|
202
|
+
validator,
|
|
203
|
+
validateTrigger,
|
|
204
|
+
labelCol,
|
|
205
|
+
...otherFormItemProps
|
|
159
206
|
},
|
|
160
207
|
renderComponent
|
|
161
208
|
);
|
|
@@ -195,7 +242,7 @@ var withOptions = (WrappedComponent) => {
|
|
|
195
242
|
value: item[valueField]
|
|
196
243
|
}))) || [];
|
|
197
244
|
}, [propsOptions, optionSourceType, (_a = list == null ? void 0 : list.data) == null ? void 0 : _a.data]);
|
|
198
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
245
|
+
return /* @__PURE__ */ import_react.default.createElement(WrappedComponent, { ...props, options });
|
|
199
246
|
};
|
|
200
247
|
};
|
|
201
248
|
var getNestedValue = (obj, path) => {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.tsx
|
|
30
|
+
var dataSourceImage_exports = {};
|
|
31
|
+
__export(dataSourceImage_exports, {
|
|
32
|
+
default: () => dataSourceImage_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(dataSourceImage_exports);
|
|
35
|
+
var import_antd = require("antd");
|
|
36
|
+
var import_utils = __toESM(require("../utils"));
|
|
37
|
+
var DataSourceImage = (0, import_utils.default)(import_antd.Image, ["src"]);
|
|
38
|
+
var dataSourceImage_default = DataSourceImage;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.tsx
|
|
30
|
+
var dataSourceQRCode_exports = {};
|
|
31
|
+
__export(dataSourceQRCode_exports, {
|
|
32
|
+
default: () => dataSourceQRCode_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(dataSourceQRCode_exports);
|
|
35
|
+
var import_qrcode = __toESM(require("../../../qrcode"));
|
|
36
|
+
var import_utils = __toESM(require("../utils"));
|
|
37
|
+
var DataSourceQRCode = (0, import_utils.default)(import_qrcode.default, ["value"]);
|
|
38
|
+
var dataSourceQRCode_default = DataSourceQRCode;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface DataSourceTypographyProps {
|
|
3
|
+
dataSourceKey: string;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
declare const DataSourceTypography: {
|
|
7
|
+
(props: DataSourceTypographyProps): React.JSX.Element;
|
|
8
|
+
Text: (props: import("../utils").ParsedProps) => React.JSX.Element;
|
|
9
|
+
};
|
|
10
|
+
export default DataSourceTypography;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/dataSourceComponents/dataSourceShow/dataSourceTypography/index.tsx
|
|
30
|
+
var dataSourceTypography_exports = {};
|
|
31
|
+
__export(dataSourceTypography_exports, {
|
|
32
|
+
default: () => dataSourceTypography_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(dataSourceTypography_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_typography = __toESM(require("../../../typography"));
|
|
37
|
+
var import_utils = __toESM(require("../utils"));
|
|
38
|
+
var DataSourceTypography = (props) => {
|
|
39
|
+
const { children, dataSourceKey, ...rest } = props;
|
|
40
|
+
return /* @__PURE__ */ import_react.default.createElement(import_typography.default, { ...rest }, children);
|
|
41
|
+
};
|
|
42
|
+
var Text = (0, import_utils.default)(import_typography.default.Text, ["children"]);
|
|
43
|
+
DataSourceTypography.Text = Text;
|
|
44
|
+
var dataSourceTypography_default = DataSourceTypography;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ParsedProps {
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
}
|
|
5
|
+
declare const withParseVariables: <P extends ParsedProps>(Component: React.ComponentType<P>, keys: string[]) => (props: P) => React.JSX.Element;
|
|
6
|
+
export default withParseVariables;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/dataSourceComponents/dataSourceShow/utils.tsx
|
|
30
|
+
var utils_exports = {};
|
|
31
|
+
__export(utils_exports, {
|
|
32
|
+
default: () => utils_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(utils_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_utils = require("@pisell/utils");
|
|
37
|
+
var import_ahooks = require("ahooks");
|
|
38
|
+
var import_utils2 = require("../provider/variables/utils");
|
|
39
|
+
var import_useVariables = __toESM(require("../hooks/useVariables"));
|
|
40
|
+
var parseValueToVariableKey = (value) => {
|
|
41
|
+
if ((0, import_utils.isArr)(value) && value.length === 1 && (0, import_utils.isString)(value[0])) {
|
|
42
|
+
const key = (0, import_utils2.getVariableKey)(value[0]);
|
|
43
|
+
return key ? key.split(".")[0] : null;
|
|
44
|
+
}
|
|
45
|
+
if ((0, import_utils.isString)(value)) {
|
|
46
|
+
const key = (0, import_utils2.getVariableKey)(value);
|
|
47
|
+
return key ? key.split(".")[0] : null;
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
};
|
|
51
|
+
var withParseVariables = (Component, keys) => {
|
|
52
|
+
return (props) => {
|
|
53
|
+
const [variables, setVariables] = (0, import_react.useState)({});
|
|
54
|
+
const { parseVariable, subscribeVariables } = (0, import_useVariables.default)();
|
|
55
|
+
const valuesRef = (0, import_react.useRef)(/* @__PURE__ */ new Set());
|
|
56
|
+
const handleVariableChange = (0, import_ahooks.useMemoizedFn)(
|
|
57
|
+
(allVariables, updateVariables) => {
|
|
58
|
+
const changedKey = Object.keys(updateVariables)[0];
|
|
59
|
+
if (valuesRef.current.has(changedKey)) {
|
|
60
|
+
setVariables((prev) => ({ ...prev, ...allVariables }));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
(0, import_react.useEffect)(() => {
|
|
65
|
+
const values = /* @__PURE__ */ new Set();
|
|
66
|
+
keys.forEach((key) => {
|
|
67
|
+
const variableKey = parseValueToVariableKey(props[key]);
|
|
68
|
+
if (variableKey) {
|
|
69
|
+
values.add(variableKey);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
valuesRef.current = values;
|
|
73
|
+
}, [props, keys]);
|
|
74
|
+
(0, import_react.useEffect)(() => {
|
|
75
|
+
const unsubscribe = subscribeVariables == null ? void 0 : subscribeVariables(handleVariableChange);
|
|
76
|
+
return () => {
|
|
77
|
+
unsubscribe == null ? void 0 : unsubscribe();
|
|
78
|
+
};
|
|
79
|
+
}, []);
|
|
80
|
+
const parsedProps = (0, import_react.useMemo)(() => {
|
|
81
|
+
const result = { ...props };
|
|
82
|
+
keys.forEach((key) => {
|
|
83
|
+
const value = props[key];
|
|
84
|
+
if ((0, import_utils.isArr)(value) && value.length === 1 && (0, import_utils.isString)(value[0])) {
|
|
85
|
+
result[key] = parseVariable == null ? void 0 : parseVariable(value[0], variables);
|
|
86
|
+
} else if ((0, import_utils.isString)(value)) {
|
|
87
|
+
result[key] = parseVariable == null ? void 0 : parseVariable(value, variables);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
return result;
|
|
91
|
+
}, [props, variables, keys]);
|
|
92
|
+
return /* @__PURE__ */ import_react.default.createElement(Component, { ...parsedProps });
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
var utils_default = withParseVariables;
|
|
@@ -33,58 +33,47 @@ __export(BaseTable_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(BaseTable_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
|
-
var
|
|
36
|
+
var import_ahooks = require("ahooks");
|
|
37
37
|
var import_table = __toESM(require("../../table"));
|
|
38
38
|
var import_useVariables = __toESM(require("../hooks/useVariables"));
|
|
39
|
-
var import_useColumns = __toESM(require("./hooks/useColumns"));
|
|
40
|
-
var import_usePagination = __toESM(require("./hooks/usePagination"));
|
|
41
39
|
var import_ActionsProvider = __toESM(require("../provider/actions/ActionsProvider"));
|
|
42
40
|
var import_useDrawerState = __toESM(require("./hooks/useDrawerState"));
|
|
43
41
|
var import_useDesignMode = __toESM(require("./hooks/useDesignMode"));
|
|
42
|
+
var import_useComponentId = __toESM(require("../hooks/useComponentId"));
|
|
44
43
|
var import_useTableQuery = __toESM(require("./hooks/useTableQuery"));
|
|
45
|
-
var import_locales = require("../../../locales");
|
|
46
44
|
var import_useDataSource = __toESM(require("../hooks/useDataSource"));
|
|
47
45
|
var import_TableSettingProvider = __toESM(require("./provider/tableSetting/TableSettingProvider"));
|
|
48
46
|
var import_useDataSourceKey = __toESM(require("./hooks/useDataSourceKey"));
|
|
49
|
-
var
|
|
50
|
-
detail: (0, import_locales.getText)("pisell-data-source-table-detail"),
|
|
51
|
-
edit: (0, import_locales.getText)("pisell-data-source-table-edit"),
|
|
52
|
-
add: (0, import_locales.getText)("pisell-data-source-table-add")
|
|
53
|
-
};
|
|
47
|
+
var import_useTableProps = __toESM(require("./hooks/useTableProps"));
|
|
54
48
|
var BaseTable = (props) => {
|
|
55
49
|
const {
|
|
56
50
|
columns: propsColumns,
|
|
57
51
|
dataSource,
|
|
58
|
-
|
|
59
|
-
editContent,
|
|
60
|
-
showDetailButton,
|
|
61
|
-
showEditButton,
|
|
62
|
-
showDeleteButton,
|
|
63
|
-
showAddButton,
|
|
64
|
-
addContent,
|
|
65
|
-
__designMode,
|
|
66
|
-
componentId,
|
|
52
|
+
operationContent,
|
|
67
53
|
...others
|
|
68
54
|
} = props;
|
|
55
|
+
const componentId = (0, import_useComponentId.default)(props);
|
|
69
56
|
const { registerValueVariable } = (0, import_useVariables.default)();
|
|
70
|
-
const { list
|
|
57
|
+
const { list } = (0, import_useDataSource.default)();
|
|
71
58
|
const { data } = list;
|
|
72
59
|
const { dataSourceKey, dataSourceKeyRef } = (0, import_useDataSourceKey.default)();
|
|
73
60
|
const {
|
|
74
61
|
drawerVisible,
|
|
75
62
|
setDrawerVisible,
|
|
76
|
-
drawerType,
|
|
77
63
|
openDrawer,
|
|
78
|
-
closeDrawer
|
|
79
|
-
|
|
80
|
-
|
|
64
|
+
closeDrawer,
|
|
65
|
+
containerProps,
|
|
66
|
+
Container,
|
|
67
|
+
drawerContent
|
|
68
|
+
} = (0, import_useDrawerState.default)(operationContent);
|
|
69
|
+
const { queryPageConfig, handleValuesChange, refreshData, handleFilterChange } = (0, import_useTableQuery.default)(props);
|
|
81
70
|
(0, import_useDesignMode.default)(props, {
|
|
82
71
|
registerValueVariable,
|
|
83
72
|
openDrawer,
|
|
84
73
|
closeDrawer,
|
|
85
74
|
data: data == null ? void 0 : data.data
|
|
86
75
|
});
|
|
87
|
-
(0,
|
|
76
|
+
(0, import_ahooks.useUpdateEffect)(() => {
|
|
88
77
|
refreshData();
|
|
89
78
|
}, [dataSourceKey]);
|
|
90
79
|
(0, import_react.useEffect)(() => {
|
|
@@ -94,84 +83,33 @@ var BaseTable = (props) => {
|
|
|
94
83
|
list == null ? void 0 : list.mutate([]);
|
|
95
84
|
}
|
|
96
85
|
}, [queryPageConfig]);
|
|
97
|
-
|
|
86
|
+
(0, import_react.useEffect)(() => {
|
|
98
87
|
registerValueVariable == null ? void 0 : registerValueVariable(componentId, {
|
|
99
|
-
|
|
88
|
+
currentDataSource: dataSource
|
|
100
89
|
});
|
|
101
|
-
|
|
102
|
-
};
|
|
90
|
+
}, [dataSource]);
|
|
103
91
|
const handleCloseDrawer = () => {
|
|
104
92
|
closeDrawer();
|
|
105
93
|
registerValueVariable == null ? void 0 : registerValueVariable(componentId, {
|
|
106
94
|
currentRecord: null
|
|
107
95
|
});
|
|
108
96
|
};
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
refreshData();
|
|
117
|
-
});
|
|
118
|
-
} catch (error) {
|
|
119
|
-
console.error(error);
|
|
120
|
-
import_antd.message.error("删除失败,请重试");
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
const actionsColumns = (0, import_react.useMemo)(() => {
|
|
124
|
-
return [
|
|
125
|
-
{
|
|
126
|
-
title: "操作",
|
|
127
|
-
key: "actions",
|
|
128
|
-
showDetailButton,
|
|
129
|
-
showEditButton,
|
|
130
|
-
showDeleteButton,
|
|
131
|
-
render: (_, record) => {
|
|
132
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd.Space, null, showDetailButton && /* @__PURE__ */ import_react.default.createElement(
|
|
133
|
-
import_antd.Button,
|
|
134
|
-
{
|
|
135
|
-
onClick: () => handleOpenDrawer(record, "detail"),
|
|
136
|
-
type: "link"
|
|
137
|
-
},
|
|
138
|
-
(0, import_locales.getText)("pisell-data-source-table-detail")
|
|
139
|
-
), showEditButton && /* @__PURE__ */ import_react.default.createElement(
|
|
140
|
-
import_antd.Button,
|
|
141
|
-
{
|
|
142
|
-
onClick: () => handleOpenDrawer(record, "edit"),
|
|
143
|
-
type: "link"
|
|
144
|
-
},
|
|
145
|
-
(0, import_locales.getText)("pisell-data-source-table-edit")
|
|
146
|
-
), showDeleteButton && /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: () => handleDelete(record), type: "link", danger: true }, (0, import_locales.getText)("pisell-data-source-table-delete")));
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
];
|
|
150
|
-
}, [showDetailButton, showEditButton, showDeleteButton]);
|
|
151
|
-
const columns = (0, import_useColumns.default)({
|
|
152
|
-
columns: propsColumns,
|
|
153
|
-
fields: dataSource == null ? void 0 : dataSource.fields,
|
|
154
|
-
// 操作列
|
|
155
|
-
actionsColumns
|
|
97
|
+
const transformProps = (0, import_useTableProps.default)({
|
|
98
|
+
data,
|
|
99
|
+
originProps: props,
|
|
100
|
+
openDrawer,
|
|
101
|
+
closeDrawer,
|
|
102
|
+
refreshData,
|
|
103
|
+
handleFilterChange
|
|
156
104
|
});
|
|
157
|
-
|
|
158
|
-
const drawerContent = (0, import_react.useMemo)(() => {
|
|
159
|
-
const contentMap = {
|
|
160
|
-
detail: detailContent,
|
|
161
|
-
edit: editContent,
|
|
162
|
-
add: addContent
|
|
163
|
-
};
|
|
164
|
-
return contentMap[drawerType];
|
|
165
|
-
}, [drawerType, detailContent, editContent, addContent]);
|
|
166
|
-
return /* @__PURE__ */ import_react.default.createElement(import_TableSettingProvider.default, null, showAddButton && /* @__PURE__ */ import_react.default.createElement("div", { style: { marginBottom: 16 } }, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { type: "primary", onClick: () => handleOpenDrawer(null, "add") }, (0, import_locales.getText)("pisell-data-source-table-add"))), /* @__PURE__ */ import_react.default.createElement(
|
|
105
|
+
return /* @__PURE__ */ import_react.default.createElement(import_TableSettingProvider.default, null, /* @__PURE__ */ import_react.default.createElement(
|
|
167
106
|
import_table.default,
|
|
168
107
|
{
|
|
169
108
|
...others,
|
|
170
|
-
|
|
109
|
+
...transformProps,
|
|
171
110
|
dataSource: (data == null ? void 0 : data.data) || [],
|
|
172
111
|
loading: list == null ? void 0 : list.loading,
|
|
173
|
-
onValuesChange: handleValuesChange
|
|
174
|
-
pagination
|
|
112
|
+
onValuesChange: handleValuesChange
|
|
175
113
|
}
|
|
176
114
|
), /* @__PURE__ */ import_react.default.createElement(
|
|
177
115
|
import_ActionsProvider.default,
|
|
@@ -181,11 +119,12 @@ var BaseTable = (props) => {
|
|
|
181
119
|
refreshTableData: refreshData
|
|
182
120
|
},
|
|
183
121
|
/* @__PURE__ */ import_react.default.createElement(
|
|
184
|
-
|
|
122
|
+
Container,
|
|
185
123
|
{
|
|
186
|
-
|
|
124
|
+
...containerProps,
|
|
187
125
|
open: drawerVisible,
|
|
188
126
|
onClose: handleCloseDrawer,
|
|
127
|
+
onCancel: handleCloseDrawer,
|
|
189
128
|
destroyOnClose: true
|
|
190
129
|
},
|
|
191
130
|
drawerContent
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface BaseFilterItem {
|
|
3
|
+
name?: string;
|
|
4
|
+
value: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
type?: string;
|
|
7
|
+
isHidden: boolean;
|
|
8
|
+
isCustom?: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface FilterProps {
|
|
11
|
+
componentId: string;
|
|
12
|
+
filterBy: Record<string, any>;
|
|
13
|
+
quickFilterMaxLength?: number;
|
|
14
|
+
sortButtonShow?: boolean;
|
|
15
|
+
mode?: 'simple' | 'complex';
|
|
16
|
+
items: BaseFilterItem[];
|
|
17
|
+
handleValuesChange: (changedFields: any, allFields: any) => void;
|
|
18
|
+
search: {
|
|
19
|
+
show: boolean;
|
|
20
|
+
placeholder: string;
|
|
21
|
+
key: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
declare const Filter: (props: FilterProps) => React.JSX.Element;
|
|
25
|
+
export default Filter;
|