@pisell/materials 1.0.472 → 1.0.474
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 +7 -7
- 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 +17 -17
- package/es/components/cardMetricItem/index.less +1 -0
- package/es/components/dataSourceComponents/dataSourceForm/index.less +1 -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 +46 -5
- 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/pisellAnchor/index.less +77 -77
- package/es/components/pisellStatisticList/index.less +1 -1
- package/es/components/pisellWalletPassCard/index.js +3 -1
- package/es/components/pisellWalletPassCard/index.less +23 -9
- 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/components/walletCard/index.d.ts +6 -4
- package/es/components/walletCard/index.js +34 -15
- 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/cardMetricItem/index.less +1 -0
- package/lib/components/dataSourceComponents/dataSourceForm/index.less +1 -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 +46 -5
- 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/pisellAnchor/index.less +77 -77
- package/lib/components/pisellStatisticList/index.less +1 -1
- package/lib/components/pisellWalletPassCard/index.js +1 -1
- package/lib/components/pisellWalletPassCard/index.less +23 -9
- 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/components/walletCard/index.d.ts +6 -4
- package/lib/components/walletCard/index.js +24 -13
- 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 +4 -4
|
@@ -184,13 +184,14 @@ export var customApi = /*#__PURE__*/function () {
|
|
|
184
184
|
*/
|
|
185
185
|
export var updateNocobaseData = /*#__PURE__*/function () {
|
|
186
186
|
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(params) {
|
|
187
|
-
var key, id, data;
|
|
187
|
+
var key, id, data, headers;
|
|
188
188
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
189
189
|
while (1) switch (_context7.prev = _context7.next) {
|
|
190
190
|
case 0:
|
|
191
|
-
key = params.key, id = params.id, data = params.data;
|
|
191
|
+
key = params.key, id = params.id, data = params.data, headers = params.headers;
|
|
192
192
|
return _context7.abrupt("return", request.getRequest().post("/".concat(key, ":update?filterByTk=").concat(id), data, {
|
|
193
|
-
isNocobase: true
|
|
193
|
+
isNocobase: true,
|
|
194
|
+
headers: headers
|
|
194
195
|
}));
|
|
195
196
|
case 2:
|
|
196
197
|
case "end":
|
|
@@ -31,13 +31,13 @@ export declare const formItemNameReverse: (name: string) => string;
|
|
|
31
31
|
* @Author: shengjie.zuo
|
|
32
32
|
* @Date: 2024-11-23 17:14:25
|
|
33
33
|
*/
|
|
34
|
-
export declare const withFormItem: <P extends object>(WrappedComponent: React.ComponentType<P>) => React.FC<P & WithFormItemProps>;
|
|
34
|
+
export declare const withFormItem: <P extends object>(WrappedComponent: React.ComponentType<P>, otherFormItemProps?: Record<string, any>) => React.FC<P & WithFormItemProps>;
|
|
35
35
|
export declare const withDataSource: <P extends unknown>(WrappedComponent: React.ComponentType<P>) => (props: P & {
|
|
36
36
|
dataSource?: any;
|
|
37
37
|
}) => React.JSX.Element;
|
|
38
38
|
export declare const withOptions: <P extends unknown>(WrappedComponent: React.ComponentType<P>) => (props: P & {
|
|
39
39
|
options?: any;
|
|
40
|
-
optionSourceType?:
|
|
40
|
+
optionSourceType?: "default" | "custom" | "api" | undefined;
|
|
41
41
|
labelField: string;
|
|
42
42
|
valueField: string;
|
|
43
43
|
}) => React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
2
|
var _excluded = ["renderMode", "value", "onChange"],
|
|
3
|
-
_excluded2 = ["name", "label", "mode", "tooltip", "noStyle", "extra", "required", "requiredobj", "minLengthobj", "maxLengthobj", "typeobj", "maxobj", "minobj", "normalize", "getValueProps", "validator", "style", "__designMode"];
|
|
3
|
+
_excluded2 = ["name", "label", "mode", "tooltip", "noStyle", "extra", "required", "requiredobj", "minLengthobj", "maxLengthobj", "typeobj", "maxobj", "minobj", "normalize", "getValueProps", "validator", "style", "validateTrigger", "__designMode", "labelCol", "innerStyle"];
|
|
4
4
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
5
5
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
6
6
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -19,6 +19,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
19
19
|
import React, { useEffect, useMemo } from 'react';
|
|
20
20
|
import { isArr, isString } from '@pisell/utils';
|
|
21
21
|
import { Tag } from 'antd';
|
|
22
|
+
import { getText } from "../../../locales";
|
|
22
23
|
import Form from "../../form";
|
|
23
24
|
import useDataSource from "../hooks/useDataSource";
|
|
24
25
|
import useFormSetting from "./provider/hooks/useFormSetting";
|
|
@@ -77,7 +78,7 @@ export var formItemNameReverse = function formItemNameReverse(name) {
|
|
|
77
78
|
* @Author: shengjie.zuo
|
|
78
79
|
* @Date: 2024-11-23 17:14:25
|
|
79
80
|
*/
|
|
80
|
-
export var withFormItem = function withFormItem(WrappedComponent) {
|
|
81
|
+
export var withFormItem = function withFormItem(WrappedComponent, otherFormItemProps) {
|
|
81
82
|
return function (_ref2) {
|
|
82
83
|
var _field$uiSchema;
|
|
83
84
|
var propsName = _ref2.name,
|
|
@@ -97,7 +98,10 @@ export var withFormItem = function withFormItem(WrappedComponent) {
|
|
|
97
98
|
getValueProps = _ref2.getValueProps,
|
|
98
99
|
validator = _ref2.validator,
|
|
99
100
|
style = _ref2.style,
|
|
101
|
+
validateTrigger = _ref2.validateTrigger,
|
|
100
102
|
__designMode = _ref2.__designMode,
|
|
103
|
+
labelCol = _ref2.labelCol,
|
|
104
|
+
innerStyle = _ref2.innerStyle,
|
|
101
105
|
otherProps = _objectWithoutProperties(_ref2, _excluded2);
|
|
102
106
|
var _useJsonPrefixPath = useJsonPrefixPath(),
|
|
103
107
|
_useJsonPrefixPath$pa = _useJsonPrefixPath.path,
|
|
@@ -120,9 +124,11 @@ export var withFormItem = function withFormItem(WrappedComponent) {
|
|
|
120
124
|
var renderComponent = useMemo(function () {
|
|
121
125
|
// 使用renderMode属性,避免和组件mode冲突
|
|
122
126
|
return /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, otherProps, {
|
|
123
|
-
|
|
127
|
+
mode: propsMode,
|
|
128
|
+
renderMode: effectiveMode,
|
|
129
|
+
style: _objectSpread(_objectSpread({}, (otherFormItemProps === null || otherFormItemProps === void 0 ? void 0 : otherFormItemProps.innerStyle) || {}), innerStyle)
|
|
124
130
|
}));
|
|
125
|
-
}, [effectiveMode, otherProps]);
|
|
131
|
+
}, [effectiveMode, otherProps, propsMode, innerStyle, otherFormItemProps === null || otherFormItemProps === void 0 ? void 0 : otherFormItemProps.innerStyle]);
|
|
126
132
|
var isDesignMode = __designMode === 'design';
|
|
127
133
|
var isHidden = effectiveMode === 'hidden';
|
|
128
134
|
|
|
@@ -131,24 +137,42 @@ export var withFormItem = function withFormItem(WrappedComponent) {
|
|
|
131
137
|
var concatName = name !== undefined ? [].concat(_toConsumableArray(prefixPath), _toConsumableArray(toArr(name))) : undefined;
|
|
132
138
|
var rules = [];
|
|
133
139
|
if (requiredobj && requiredobj.required) {
|
|
134
|
-
rules.push(requiredobj)
|
|
140
|
+
rules.push(_objectSpread(_objectSpread({}, requiredobj), {}, {
|
|
141
|
+
message: requiredobj.message || getText('pisell-data-source-form-required-message')
|
|
142
|
+
}));
|
|
135
143
|
}
|
|
136
144
|
if (typeobj && typeobj.enabled) {
|
|
137
|
-
|
|
145
|
+
if (typeobj.type === 'email') {
|
|
146
|
+
rules.push(_objectSpread(_objectSpread({}, typeobj), {}, {
|
|
147
|
+
message: typeobj.message || getText('pisell-data-source-form-email-message')
|
|
148
|
+
}));
|
|
149
|
+
} else {
|
|
150
|
+
rules.push(_objectSpread(_objectSpread({}, typeobj), {}, {
|
|
151
|
+
message: typeobj.message || getText('pisell-data-source-form-type-message')(typeobj === null || typeobj === void 0 ? void 0 : typeobj.type)
|
|
152
|
+
}));
|
|
153
|
+
}
|
|
138
154
|
}
|
|
139
155
|
if (maxLengthobj && maxLengthobj.enabled) {
|
|
140
|
-
rules.push(maxLengthobj)
|
|
156
|
+
rules.push(_objectSpread(_objectSpread({}, maxLengthobj), {}, {
|
|
157
|
+
message: maxLengthobj.message || getText('pisell-data-source-form-max-length-message')(maxLengthobj === null || maxLengthobj === void 0 ? void 0 : maxLengthobj.max)
|
|
158
|
+
}));
|
|
141
159
|
}
|
|
142
160
|
if (minLengthobj && minLengthobj.enabled) {
|
|
143
|
-
rules.push(minLengthobj)
|
|
161
|
+
rules.push(_objectSpread(_objectSpread({}, minLengthobj), {}, {
|
|
162
|
+
message: minLengthobj.message || getText('pisell-data-source-form-min-length-message')(minLengthobj === null || minLengthobj === void 0 ? void 0 : minLengthobj.min)
|
|
163
|
+
}));
|
|
144
164
|
}
|
|
145
165
|
if (maxobj && maxobj.enabled) {
|
|
146
|
-
rules.push(maxobj)
|
|
166
|
+
rules.push(_objectSpread(_objectSpread({}, maxobj), {}, {
|
|
167
|
+
message: maxobj.message || getText('pisell-data-source-form-max-value-message')(maxobj === null || maxobj === void 0 ? void 0 : maxobj.max)
|
|
168
|
+
}));
|
|
147
169
|
}
|
|
148
170
|
if (minobj && minobj.enabled) {
|
|
149
|
-
rules.push(minobj)
|
|
171
|
+
rules.push(_objectSpread(_objectSpread({}, minobj), {}, {
|
|
172
|
+
message: minobj.message || getText('pisell-data-source-form-min-value-message')(minobj === null || minobj === void 0 ? void 0 : minobj.min)
|
|
173
|
+
}));
|
|
150
174
|
}
|
|
151
|
-
return /*#__PURE__*/React.createElement(Form.Item, {
|
|
175
|
+
return /*#__PURE__*/React.createElement(Form.Item, _extends({
|
|
152
176
|
required: required,
|
|
153
177
|
style: _objectSpread(_objectSpread({
|
|
154
178
|
width: '100%'
|
|
@@ -164,8 +188,10 @@ export var withFormItem = function withFormItem(WrappedComponent) {
|
|
|
164
188
|
rules: rules,
|
|
165
189
|
normalize: normalize,
|
|
166
190
|
getValueProps: getValueProps,
|
|
167
|
-
validator: validator
|
|
168
|
-
|
|
191
|
+
validator: validator,
|
|
192
|
+
validateTrigger: validateTrigger,
|
|
193
|
+
labelCol: labelCol
|
|
194
|
+
}, otherFormItemProps), renderComponent);
|
|
169
195
|
};
|
|
170
196
|
};
|
|
171
197
|
export var withDataSource = function withDataSource(WrappedComponent) {
|
|
@@ -205,11 +231,9 @@ export var withOptions = function withOptions(WrappedComponent) {
|
|
|
205
231
|
};
|
|
206
232
|
})) || [];
|
|
207
233
|
}, [propsOptions, optionSourceType, list === null || list === void 0 ? void 0 : (_list$data2 = list.data) === null || _list$data2 === void 0 ? void 0 : _list$data2.data]);
|
|
208
|
-
return /*#__PURE__*/React.createElement(
|
|
209
|
-
dataSource: options
|
|
210
|
-
}, /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, props, {
|
|
234
|
+
return /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, props, {
|
|
211
235
|
options: options
|
|
212
|
-
}))
|
|
236
|
+
}));
|
|
213
237
|
};
|
|
214
238
|
};
|
|
215
239
|
|
|
@@ -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,15 @@
|
|
|
1
|
+
var _excluded = ["children", "dataSourceKey"];
|
|
2
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
3
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import Typography from "../../../typography";
|
|
6
|
+
import withParseVariables from "../utils";
|
|
7
|
+
var DataSourceTypography = function DataSourceTypography(props) {
|
|
8
|
+
var children = props.children,
|
|
9
|
+
dataSourceKey = props.dataSourceKey,
|
|
10
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
11
|
+
return /*#__PURE__*/React.createElement(Typography, rest, children);
|
|
12
|
+
};
|
|
13
|
+
var Text = withParseVariables(Typography.Text, ['children']);
|
|
14
|
+
DataSourceTypography.Text = Text;
|
|
15
|
+
export 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,82 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import React, { useMemo, useEffect, useState, useRef } from 'react';
|
|
14
|
+
import { isArr, isString } from '@pisell/utils';
|
|
15
|
+
import { useMemoizedFn } from 'ahooks';
|
|
16
|
+
import { getVariableKey } from "../provider/variables/utils";
|
|
17
|
+
import useVariables from "../hooks/useVariables";
|
|
18
|
+
// 提取变量解析逻辑
|
|
19
|
+
var parseValueToVariableKey = function parseValueToVariableKey(value) {
|
|
20
|
+
if (isArr(value) && value.length === 1 && isString(value[0])) {
|
|
21
|
+
var _key = getVariableKey(value[0]);
|
|
22
|
+
return _key ? _key.split('.')[0] : null;
|
|
23
|
+
}
|
|
24
|
+
if (isString(value)) {
|
|
25
|
+
var _key2 = getVariableKey(value);
|
|
26
|
+
return _key2 ? _key2.split('.')[0] : null;
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// 包装变量解析组件
|
|
32
|
+
var withParseVariables = function withParseVariables(Component, keys) {
|
|
33
|
+
return function (props) {
|
|
34
|
+
var _useState = useState({}),
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
variables = _useState2[0],
|
|
37
|
+
setVariables = _useState2[1];
|
|
38
|
+
var _useVariables = useVariables(),
|
|
39
|
+
parseVariable = _useVariables.parseVariable,
|
|
40
|
+
subscribeVariables = _useVariables.subscribeVariables;
|
|
41
|
+
var valuesRef = useRef(new Set());
|
|
42
|
+
var handleVariableChange = useMemoizedFn(function (allVariables, updateVariables) {
|
|
43
|
+
var changedKey = Object.keys(updateVariables)[0];
|
|
44
|
+
if (valuesRef.current.has(changedKey)) {
|
|
45
|
+
setVariables(function (prev) {
|
|
46
|
+
return _objectSpread(_objectSpread({}, prev), allVariables);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
useEffect(function () {
|
|
51
|
+
// 收集当前组件需要监听的变量值
|
|
52
|
+
var values = new Set();
|
|
53
|
+
keys.forEach(function (key) {
|
|
54
|
+
var variableKey = parseValueToVariableKey(props[key]);
|
|
55
|
+
if (variableKey) {
|
|
56
|
+
values.add(variableKey);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
valuesRef.current = values;
|
|
60
|
+
}, [props, keys]);
|
|
61
|
+
useEffect(function () {
|
|
62
|
+
var unsubscribe = subscribeVariables === null || subscribeVariables === void 0 ? void 0 : subscribeVariables(handleVariableChange);
|
|
63
|
+
return function () {
|
|
64
|
+
unsubscribe === null || unsubscribe === void 0 ? void 0 : unsubscribe();
|
|
65
|
+
};
|
|
66
|
+
}, []);
|
|
67
|
+
var parsedProps = useMemo(function () {
|
|
68
|
+
var result = _objectSpread({}, props);
|
|
69
|
+
keys.forEach(function (key) {
|
|
70
|
+
var value = props[key];
|
|
71
|
+
if (isArr(value) && value.length === 1 && isString(value[0])) {
|
|
72
|
+
result[key] = parseVariable === null || parseVariable === void 0 ? void 0 : parseVariable(value[0], variables);
|
|
73
|
+
} else if (isString(value)) {
|
|
74
|
+
result[key] = parseVariable === null || parseVariable === void 0 ? void 0 : parseVariable(value, variables);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
return result;
|
|
78
|
+
}, [props, variables, keys]);
|
|
79
|
+
return /*#__PURE__*/React.createElement(Component, parsedProps);
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
export default withParseVariables;
|
|
@@ -1,62 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
var _excluded = ["columns", "dataSource", "detailContent", "editContent", "showDetailButton", "showEditButton", "showDeleteButton", "showAddButton", "addContent", "__designMode", "componentId"];
|
|
1
|
+
var _excluded = ["columns", "dataSource", "operationContent"];
|
|
3
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
5
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
6
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
7
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
8
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
9
|
-
import React, { useEffect
|
|
10
|
-
import {
|
|
5
|
+
import React, { useEffect } from 'react';
|
|
6
|
+
import { useUpdateEffect } from 'ahooks';
|
|
11
7
|
import Table from "../../table";
|
|
12
8
|
import useVariables from "../hooks/useVariables";
|
|
13
|
-
import useColumns from "./hooks/useColumns";
|
|
14
|
-
import usePagination from "./hooks/usePagination";
|
|
15
9
|
import ActionsProvider from "../provider/actions/ActionsProvider";
|
|
16
10
|
import useDrawerState from "./hooks/useDrawerState";
|
|
17
11
|
import useDesignMode from "./hooks/useDesignMode";
|
|
12
|
+
import useComponentId from "../hooks/useComponentId";
|
|
18
13
|
import useTableQuery from "./hooks/useTableQuery";
|
|
19
|
-
import { getText } from "../../../locales";
|
|
20
14
|
import useDataSource from "../hooks/useDataSource";
|
|
21
15
|
import TableSettingProvider from "./provider/tableSetting/TableSettingProvider";
|
|
22
16
|
import useDataSourceKey from "./hooks/useDataSourceKey";
|
|
23
|
-
|
|
24
|
-
detail: getText('pisell-data-source-table-detail'),
|
|
25
|
-
edit: getText('pisell-data-source-table-edit'),
|
|
26
|
-
add: getText('pisell-data-source-table-add')
|
|
27
|
-
};
|
|
17
|
+
import useTableProps from "./hooks/useTableProps";
|
|
28
18
|
var BaseTable = function BaseTable(props) {
|
|
29
19
|
var propsColumns = props.columns,
|
|
30
20
|
dataSource = props.dataSource,
|
|
31
|
-
|
|
32
|
-
editContent = props.editContent,
|
|
33
|
-
showDetailButton = props.showDetailButton,
|
|
34
|
-
showEditButton = props.showEditButton,
|
|
35
|
-
showDeleteButton = props.showDeleteButton,
|
|
36
|
-
showAddButton = props.showAddButton,
|
|
37
|
-
addContent = props.addContent,
|
|
38
|
-
__designMode = props.__designMode,
|
|
39
|
-
componentId = props.componentId,
|
|
21
|
+
operationContent = props.operationContent,
|
|
40
22
|
others = _objectWithoutProperties(props, _excluded);
|
|
23
|
+
var componentId = useComponentId(props);
|
|
41
24
|
var _useVariables = useVariables(),
|
|
42
25
|
registerValueVariable = _useVariables.registerValueVariable;
|
|
43
26
|
var _useDataSource = useDataSource(),
|
|
44
|
-
list = _useDataSource.list
|
|
45
|
-
destroy = _useDataSource.destroy;
|
|
27
|
+
list = _useDataSource.list;
|
|
46
28
|
var data = list.data;
|
|
47
29
|
var _useDataSourceKey = useDataSourceKey(),
|
|
48
30
|
dataSourceKey = _useDataSourceKey.dataSourceKey,
|
|
49
31
|
dataSourceKeyRef = _useDataSourceKey.dataSourceKeyRef;
|
|
50
|
-
var _useDrawerState = useDrawerState(),
|
|
32
|
+
var _useDrawerState = useDrawerState(operationContent),
|
|
51
33
|
drawerVisible = _useDrawerState.drawerVisible,
|
|
52
34
|
setDrawerVisible = _useDrawerState.setDrawerVisible,
|
|
53
|
-
drawerType = _useDrawerState.drawerType,
|
|
54
35
|
openDrawer = _useDrawerState.openDrawer,
|
|
55
|
-
closeDrawer = _useDrawerState.closeDrawer
|
|
56
|
-
|
|
36
|
+
closeDrawer = _useDrawerState.closeDrawer,
|
|
37
|
+
containerProps = _useDrawerState.containerProps,
|
|
38
|
+
Container = _useDrawerState.Container,
|
|
39
|
+
drawerContent = _useDrawerState.drawerContent;
|
|
40
|
+
var _useTableQuery = useTableQuery(props),
|
|
57
41
|
queryPageConfig = _useTableQuery.queryPageConfig,
|
|
58
42
|
handleValuesChange = _useTableQuery.handleValuesChange,
|
|
59
|
-
refreshData = _useTableQuery.refreshData
|
|
43
|
+
refreshData = _useTableQuery.refreshData,
|
|
44
|
+
handleFilterChange = _useTableQuery.handleFilterChange;
|
|
60
45
|
|
|
61
46
|
// 设计模式下对抽屉的显隐处理
|
|
62
47
|
useDesignMode(props, {
|
|
@@ -65,7 +50,7 @@ var BaseTable = function BaseTable(props) {
|
|
|
65
50
|
closeDrawer: closeDrawer,
|
|
66
51
|
data: data === null || data === void 0 ? void 0 : data.data
|
|
67
52
|
});
|
|
68
|
-
|
|
53
|
+
useUpdateEffect(function () {
|
|
69
54
|
refreshData();
|
|
70
55
|
}, [dataSourceKey]);
|
|
71
56
|
useEffect(function () {
|
|
@@ -75,14 +60,11 @@ var BaseTable = function BaseTable(props) {
|
|
|
75
60
|
list === null || list === void 0 ? void 0 : list.mutate([]);
|
|
76
61
|
}
|
|
77
62
|
}, [queryPageConfig]);
|
|
78
|
-
|
|
79
|
-
// 打开抽屉
|
|
80
|
-
var handleOpenDrawer = function handleOpenDrawer(record, type) {
|
|
63
|
+
useEffect(function () {
|
|
81
64
|
registerValueVariable === null || registerValueVariable === void 0 ? void 0 : registerValueVariable(componentId, {
|
|
82
|
-
|
|
65
|
+
currentDataSource: dataSource
|
|
83
66
|
});
|
|
84
|
-
|
|
85
|
-
};
|
|
67
|
+
}, [dataSource]);
|
|
86
68
|
|
|
87
69
|
// 关闭抽屉
|
|
88
70
|
var handleCloseDrawer = function handleCloseDrawer() {
|
|
@@ -91,116 +73,28 @@ var BaseTable = function BaseTable(props) {
|
|
|
91
73
|
currentRecord: null
|
|
92
74
|
});
|
|
93
75
|
};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
try {
|
|
102
|
-
registerValueVariable === null || registerValueVariable === void 0 ? void 0 : registerValueVariable(componentId, {
|
|
103
|
-
currentRecord: record
|
|
104
|
-
});
|
|
105
|
-
setTimeout( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
106
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
107
|
-
while (1) switch (_context.prev = _context.next) {
|
|
108
|
-
case 0:
|
|
109
|
-
_context.next = 2;
|
|
110
|
-
return destroy === null || destroy === void 0 ? void 0 : destroy.run(record.id);
|
|
111
|
-
case 2:
|
|
112
|
-
refreshData();
|
|
113
|
-
case 3:
|
|
114
|
-
case "end":
|
|
115
|
-
return _context.stop();
|
|
116
|
-
}
|
|
117
|
-
}, _callee);
|
|
118
|
-
})));
|
|
119
|
-
} catch (error) {
|
|
120
|
-
console.error(error);
|
|
121
|
-
message.error('删除失败,请重试');
|
|
122
|
-
}
|
|
123
|
-
case 1:
|
|
124
|
-
case "end":
|
|
125
|
-
return _context2.stop();
|
|
126
|
-
}
|
|
127
|
-
}, _callee2);
|
|
128
|
-
}));
|
|
129
|
-
return function handleDelete(_x) {
|
|
130
|
-
return _ref.apply(this, arguments);
|
|
131
|
-
};
|
|
132
|
-
}();
|
|
133
|
-
|
|
134
|
-
// 操作列
|
|
135
|
-
var actionsColumns = useMemo(function () {
|
|
136
|
-
return [{
|
|
137
|
-
title: '操作',
|
|
138
|
-
key: 'actions',
|
|
139
|
-
showDetailButton: showDetailButton,
|
|
140
|
-
showEditButton: showEditButton,
|
|
141
|
-
showDeleteButton: showDeleteButton,
|
|
142
|
-
render: function render(_, record) {
|
|
143
|
-
return /*#__PURE__*/React.createElement(Space, null, showDetailButton && /*#__PURE__*/React.createElement(Button, {
|
|
144
|
-
onClick: function onClick() {
|
|
145
|
-
return handleOpenDrawer(record, 'detail');
|
|
146
|
-
},
|
|
147
|
-
type: "link"
|
|
148
|
-
}, getText('pisell-data-source-table-detail')), showEditButton && /*#__PURE__*/React.createElement(Button, {
|
|
149
|
-
onClick: function onClick() {
|
|
150
|
-
return handleOpenDrawer(record, 'edit');
|
|
151
|
-
},
|
|
152
|
-
type: "link"
|
|
153
|
-
}, getText('pisell-data-source-table-edit')), showDeleteButton && /*#__PURE__*/React.createElement(Button, {
|
|
154
|
-
onClick: function onClick() {
|
|
155
|
-
return handleDelete(record);
|
|
156
|
-
},
|
|
157
|
-
type: "link",
|
|
158
|
-
danger: true
|
|
159
|
-
}, getText('pisell-data-source-table-delete')));
|
|
160
|
-
}
|
|
161
|
-
}];
|
|
162
|
-
}, [showDetailButton, showEditButton, showDeleteButton]);
|
|
163
|
-
var columns = useColumns({
|
|
164
|
-
columns: propsColumns,
|
|
165
|
-
fields: dataSource === null || dataSource === void 0 ? void 0 : dataSource.fields,
|
|
166
|
-
// 操作列
|
|
167
|
-
actionsColumns: actionsColumns
|
|
168
|
-
});
|
|
169
|
-
var pagination = usePagination({
|
|
170
|
-
data: data
|
|
76
|
+
var transformProps = useTableProps({
|
|
77
|
+
data: data,
|
|
78
|
+
originProps: props,
|
|
79
|
+
openDrawer: openDrawer,
|
|
80
|
+
closeDrawer: closeDrawer,
|
|
81
|
+
refreshData: refreshData,
|
|
82
|
+
handleFilterChange: handleFilterChange
|
|
171
83
|
});
|
|
172
|
-
|
|
173
|
-
var contentMap = {
|
|
174
|
-
detail: detailContent,
|
|
175
|
-
edit: editContent,
|
|
176
|
-
add: addContent
|
|
177
|
-
};
|
|
178
|
-
return contentMap[drawerType];
|
|
179
|
-
}, [drawerType, detailContent, editContent, addContent]);
|
|
180
|
-
return /*#__PURE__*/React.createElement(TableSettingProvider, null, showAddButton && /*#__PURE__*/React.createElement("div", {
|
|
181
|
-
style: {
|
|
182
|
-
marginBottom: 16
|
|
183
|
-
}
|
|
184
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
185
|
-
type: "primary",
|
|
186
|
-
onClick: function onClick() {
|
|
187
|
-
return handleOpenDrawer(null, 'add');
|
|
188
|
-
}
|
|
189
|
-
}, getText('pisell-data-source-table-add'))), /*#__PURE__*/React.createElement(Table, _extends({}, others, {
|
|
190
|
-
columns: columns,
|
|
84
|
+
return /*#__PURE__*/React.createElement(TableSettingProvider, null, /*#__PURE__*/React.createElement(Table, _extends({}, others, transformProps, {
|
|
191
85
|
dataSource: (data === null || data === void 0 ? void 0 : data.data) || [],
|
|
192
86
|
loading: list === null || list === void 0 ? void 0 : list.loading,
|
|
193
|
-
onValuesChange: handleValuesChange
|
|
194
|
-
pagination: pagination
|
|
87
|
+
onValuesChange: handleValuesChange
|
|
195
88
|
})), /*#__PURE__*/React.createElement(ActionsProvider, {
|
|
196
89
|
visible: drawerVisible,
|
|
197
90
|
setVisible: setDrawerVisible,
|
|
198
91
|
refreshTableData: refreshData
|
|
199
|
-
}, /*#__PURE__*/React.createElement(
|
|
200
|
-
title
|
|
92
|
+
}, /*#__PURE__*/React.createElement(Container, _extends({}, containerProps, {
|
|
93
|
+
// title={DRAWER_TITLES[drawerType]}
|
|
201
94
|
open: drawerVisible,
|
|
202
95
|
onClose: handleCloseDrawer,
|
|
96
|
+
onCancel: handleCloseDrawer,
|
|
203
97
|
destroyOnClose: true
|
|
204
|
-
}, drawerContent)));
|
|
98
|
+
}), drawerContent)));
|
|
205
99
|
};
|
|
206
100
|
export default BaseTable;
|
|
@@ -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;
|