@nocobase/client 0.9.0-alpha.2 → 0.9.1-alpha.1
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/es/acl/ACLProvider.js +4 -7
- package/es/api-client/APIClient.js +6 -0
- package/es/block-provider/BlockProvider.js +9 -6
- package/es/block-provider/FormBlockProvider.js +3 -1
- package/es/block-provider/KanbanBlockProvider.js +1 -1
- package/es/block-provider/SharedFilterProvider.js +9 -1
- package/es/block-provider/TableBlockProvider.js +1 -1
- package/es/block-provider/TableSelectorProvider.js +2 -2
- package/es/block-provider/hooks/index.js +22 -7
- package/es/collection-manager/CollectionManagerProvider.d.ts +1 -0
- package/es/collection-manager/CollectionManagerProvider.js +71 -9
- package/es/collection-manager/CollectionManagerShortcut.js +36 -23
- package/es/collection-manager/Configuration/AddCategoryAction.d.ts +2 -0
- package/es/collection-manager/Configuration/AddCategoryAction.js +117 -0
- package/es/collection-manager/Configuration/AddCollectionAction.js +8 -3
- package/es/collection-manager/Configuration/AddFieldAction.js +1 -0
- package/es/collection-manager/Configuration/ConfigurationTable.js +33 -4
- package/es/collection-manager/Configuration/ConfigurationTabs.d.ts +1 -0
- package/es/collection-manager/Configuration/ConfigurationTabs.js +381 -0
- package/es/collection-manager/Configuration/EditCategoryAction.d.ts +2 -0
- package/es/collection-manager/Configuration/EditCategoryAction.js +150 -0
- package/es/collection-manager/Configuration/EditCollectionAction.js +6 -2
- package/es/collection-manager/Configuration/OverridingCollectionField.js +17 -8
- package/es/collection-manager/Configuration/components/CollectionCategory.d.ts +2 -0
- package/es/collection-manager/Configuration/components/CollectionCategory.js +13 -0
- package/es/collection-manager/Configuration/index.d.ts +3 -0
- package/es/collection-manager/Configuration/index.js +3 -0
- package/es/collection-manager/Configuration/schemas/collections.d.ts +3 -0
- package/es/collection-manager/Configuration/schemas/collections.js +309 -176
- package/es/collection-manager/Configuration/templates.d.ts +1 -0
- package/es/collection-manager/Configuration/templates.js +1 -1
- package/es/collection-manager/action-hooks.js +3 -1
- package/es/collection-manager/context.d.ts +4 -0
- package/es/collection-manager/context.js +5 -1
- package/es/collection-manager/hooks/useCollectionManager.d.ts +7 -0
- package/es/collection-manager/hooks/useCollectionManager.js +51 -6
- package/es/collection-manager/interfaces/m2m.js +2 -2
- package/es/collection-manager/interfaces/properties/index.d.ts +0 -56
- package/es/collection-manager/interfaces/properties/index.js +1 -2
- package/es/collection-manager/templates/calendar.js +1 -1
- package/es/collection-manager/templates/general.js +1 -1
- package/es/collection-manager/templates/properties/index.d.ts +12 -1
- package/es/collection-manager/templates/properties/index.js +11 -0
- package/es/i18n/i18n.js +3 -1
- package/es/locale/en_US.d.ts +23 -0
- package/es/locale/en_US.js +23 -0
- package/es/locale/ja_JP.d.ts +23 -0
- package/es/locale/ja_JP.js +24 -1
- package/es/locale/ru_RU.d.ts +1 -0
- package/es/locale/ru_RU.js +1 -0
- package/es/locale/zh_CN.d.ts +43 -4
- package/es/locale/zh_CN.js +44 -5
- package/es/route-switch/antd/admin-layout/index.js +13 -33
- package/es/schema-component/antd/action/Action.Designer.js +22 -15
- package/es/schema-component/antd/action/Action.js +25 -3
- package/es/schema-component/antd/action/utils.d.ts +1 -0
- package/es/schema-component/antd/action/utils.js +49 -0
- package/es/schema-component/antd/association-filter/AssociationFilter.js +4 -4
- package/es/schema-component/antd/association-select/AssociationSelect.d.ts +2 -2
- package/es/schema-component/antd/association-select/useServiceOptions.js +47 -6
- package/es/schema-component/antd/calendar/Calendar.Designer.js +17 -36
- package/es/schema-component/antd/checkbox/Checkbox.js +9 -8
- package/es/schema-component/antd/date-picker/util.d.ts +1 -1
- package/es/schema-component/antd/date-picker/util.js +1 -1
- package/es/schema-component/antd/filter/DynamicComponent.js +3 -1
- package/es/schema-component/antd/filter/Filter.js +2 -1
- package/es/schema-component/antd/filter/FilterGroup.js +7 -4
- package/es/schema-component/antd/filter/FilterItem.js +3 -2
- package/es/schema-component/antd/filter/context.d.ts +1 -0
- package/es/schema-component/antd/filter/useValues.js +14 -11
- package/es/schema-component/antd/form/Form.js +11 -5
- package/es/schema-component/antd/form-item/FormItem.js +17 -8
- package/es/schema-component/antd/form-v2/Form.Designer.js +2 -0
- package/es/schema-component/antd/form-v2/Form.js +90 -7
- package/es/schema-component/antd/form-v2/utils.d.ts +5 -0
- package/es/schema-component/antd/form-v2/utils.js +161 -0
- package/es/schema-component/antd/grid/Grid.js +10 -5
- package/es/schema-component/antd/icon-picker/IconPicker.js +1 -0
- package/es/schema-component/antd/index.d.ts +1 -0
- package/es/schema-component/antd/index.js +1 -0
- package/es/schema-component/antd/input/Input.d.ts +2 -1
- package/es/schema-component/antd/input/Json.d.ts +5 -3
- package/es/schema-component/antd/input/Json.js +3 -2
- package/es/schema-component/antd/input-number/InputNumber.js +3 -1
- package/es/schema-component/antd/page/FixedBlock.js +3 -1
- package/es/schema-component/antd/page/Page.js +11 -5
- package/es/schema-component/antd/page/PageTabDesigner.js +3 -3
- package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +3 -1
- package/es/schema-component/antd/record-picker/RecordPicker.js +1 -2
- package/es/schema-component/antd/record-picker/util.js +7 -0
- package/es/schema-component/antd/remote-select/RemoteSelect.js +76 -36
- package/es/schema-component/antd/rich-text/RichText.js +4 -2
- package/es/schema-component/antd/select/Select.js +14 -4
- package/es/schema-component/antd/table/Table.Array.js +10 -3
- package/es/schema-component/antd/table-v2/Table.Column.Designer.js +2 -2
- package/es/schema-component/antd/table-v2/TableBlockDesigner.js +3 -2
- package/es/schema-component/antd/tabs/Tabs.Designer.js +1 -0
- package/es/schema-component/antd/time-picker/TimePicker.js +1 -1
- package/es/schema-component/antd/variable/Input.d.ts +2 -0
- package/es/schema-component/antd/variable/Input.js +244 -0
- package/es/schema-component/antd/variable/JSONInput.d.ts +2 -0
- package/es/schema-component/antd/variable/JSONInput.js +82 -0
- package/es/schema-component/antd/variable/TextArea.d.ts +2 -0
- package/es/schema-component/antd/variable/TextArea.js +322 -0
- package/es/schema-component/antd/variable/Variable.d.ts +8 -0
- package/es/schema-component/antd/variable/Variable.js +11 -0
- package/es/schema-component/antd/variable/index.d.ts +1 -0
- package/es/schema-component/antd/variable/index.js +1 -0
- package/es/schema-component/common/sortable-item/SortableItem.js +36 -6
- package/es/schema-component/common/utils/logic.js +523 -0
- package/es/schema-component/common/utils/uitls.d.ts +1 -0
- package/es/schema-component/common/utils/uitls.js +89 -0
- package/es/schema-initializer/SchemaInitializer.js +0 -1
- package/es/schema-initializer/buttons/TableActionColumnInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/TableActionColumnInitializers.js +1 -3
- package/es/schema-initializer/index.d.ts +2 -1
- package/es/schema-initializer/index.js +2 -1
- package/es/schema-initializer/items/CalendarBlockInitializer.js +24 -41
- package/es/schema-initializer/utils.js +22 -7
- package/es/schema-settings/LinkageRules/DynamicComponent.d.ts +1 -0
- package/es/schema-settings/LinkageRules/DynamicComponent.js +113 -0
- package/es/schema-settings/LinkageRules/FilterDynamicComponent.d.ts +2 -0
- package/es/schema-settings/LinkageRules/FilterDynamicComponent.js +15 -0
- package/es/schema-settings/LinkageRules/LinkageRuleAction.d.ts +3 -0
- package/es/schema-settings/LinkageRules/LinkageRuleAction.js +162 -0
- package/es/schema-settings/LinkageRules/LinkageRuleActionGroup.d.ts +3 -0
- package/es/schema-settings/LinkageRules/LinkageRuleActionGroup.js +71 -0
- package/es/schema-settings/LinkageRules/ValueDynamicComponent.d.ts +1 -0
- package/es/schema-settings/LinkageRules/ValueDynamicComponent.js +82 -0
- package/es/schema-settings/LinkageRules/Variables.d.ts +7 -0
- package/es/schema-settings/LinkageRules/Variables.js +115 -0
- package/es/schema-settings/LinkageRules/action-hooks.d.ts +1 -0
- package/es/schema-settings/LinkageRules/action-hooks.js +115 -0
- package/es/schema-settings/LinkageRules/context.d.ts +13 -0
- package/es/schema-settings/LinkageRules/context.js +4 -0
- package/es/schema-settings/LinkageRules/index.d.ts +2 -0
- package/es/schema-settings/LinkageRules/index.js +132 -0
- package/es/schema-settings/LinkageRules/type.d.ts +13 -0
- package/es/schema-settings/LinkageRules/type.js +15 -0
- package/es/schema-settings/LinkageRules/useValues.d.ts +1 -0
- package/es/schema-settings/LinkageRules/useValues.js +84 -0
- package/es/schema-settings/SchemaSettings.d.ts +4 -1
- package/es/schema-settings/SchemaSettings.js +153 -26
- package/es/schema-templates/BlockTemplate.js +9 -1
- package/es/system-settings/SystemSettingsShortcut.js +1 -1
- package/lib/acl/ACLProvider.js +4 -7
- package/lib/api-client/APIClient.js +6 -0
- package/lib/block-provider/BlockProvider.js +9 -6
- package/lib/block-provider/FormBlockProvider.js +3 -1
- package/lib/block-provider/KanbanBlockProvider.js +1 -1
- package/lib/block-provider/SharedFilterProvider.js +9 -3
- package/lib/block-provider/TableBlockProvider.js +1 -1
- package/lib/block-provider/TableSelectorProvider.js +2 -2
- package/lib/block-provider/hooks/index.js +23 -7
- package/lib/collection-manager/CollectionManagerProvider.d.ts +1 -0
- package/lib/collection-manager/CollectionManagerProvider.js +81 -16
- package/lib/collection-manager/CollectionManagerShortcut.js +36 -23
- package/lib/collection-manager/Configuration/AddCategoryAction.d.ts +2 -0
- package/lib/collection-manager/Configuration/AddCategoryAction.js +145 -0
- package/lib/collection-manager/Configuration/AddCollectionAction.js +8 -3
- package/lib/collection-manager/Configuration/AddFieldAction.js +1 -0
- package/lib/collection-manager/Configuration/ConfigurationTable.js +34 -4
- package/lib/collection-manager/Configuration/ConfigurationTabs.d.ts +1 -0
- package/lib/collection-manager/Configuration/ConfigurationTabs.js +407 -0
- package/lib/collection-manager/Configuration/EditCategoryAction.d.ts +2 -0
- package/lib/collection-manager/Configuration/EditCategoryAction.js +178 -0
- package/lib/collection-manager/Configuration/EditCollectionAction.js +6 -2
- package/lib/collection-manager/Configuration/OverridingCollectionField.js +17 -8
- package/lib/collection-manager/Configuration/components/CollectionCategory.d.ts +2 -0
- package/lib/collection-manager/Configuration/components/CollectionCategory.js +27 -0
- package/lib/collection-manager/Configuration/index.d.ts +3 -0
- package/lib/collection-manager/Configuration/index.js +39 -0
- package/lib/collection-manager/Configuration/schemas/collections.d.ts +3 -0
- package/lib/collection-manager/Configuration/schemas/collections.js +316 -178
- package/lib/collection-manager/Configuration/templates.d.ts +1 -0
- package/lib/collection-manager/Configuration/templates.js +2 -0
- package/lib/collection-manager/action-hooks.js +3 -1
- package/lib/collection-manager/context.d.ts +4 -0
- package/lib/collection-manager/context.js +7 -2
- package/lib/collection-manager/hooks/useCollectionManager.d.ts +7 -0
- package/lib/collection-manager/hooks/useCollectionManager.js +52 -6
- package/lib/collection-manager/interfaces/m2m.js +2 -2
- package/lib/collection-manager/interfaces/properties/index.d.ts +0 -56
- package/lib/collection-manager/interfaces/properties/index.js +1 -2
- package/lib/collection-manager/templates/calendar.js +1 -1
- package/lib/collection-manager/templates/general.js +1 -1
- package/lib/collection-manager/templates/properties/index.d.ts +12 -1
- package/lib/collection-manager/templates/properties/index.js +11 -0
- package/lib/i18n/i18n.js +3 -1
- package/lib/locale/en_US.d.ts +23 -0
- package/lib/locale/en_US.js +23 -0
- package/lib/locale/ja_JP.d.ts +23 -0
- package/lib/locale/ja_JP.js +24 -1
- package/lib/locale/ru_RU.d.ts +1 -0
- package/lib/locale/ru_RU.js +1 -0
- package/lib/locale/zh_CN.d.ts +43 -4
- package/lib/locale/zh_CN.js +44 -5
- package/lib/route-switch/antd/admin-layout/index.js +13 -33
- package/lib/schema-component/antd/action/Action.Designer.js +24 -14
- package/lib/schema-component/antd/action/Action.js +27 -2
- package/lib/schema-component/antd/action/utils.d.ts +1 -0
- package/lib/schema-component/antd/action/utils.js +58 -2
- package/lib/schema-component/antd/association-filter/AssociationFilter.js +3 -3
- package/lib/schema-component/antd/association-select/AssociationSelect.d.ts +2 -2
- package/lib/schema-component/antd/association-select/useServiceOptions.js +47 -4
- package/lib/schema-component/antd/calendar/Calendar.Designer.js +15 -33
- package/lib/schema-component/antd/checkbox/Checkbox.js +8 -7
- package/lib/schema-component/antd/date-picker/util.d.ts +1 -1
- package/lib/schema-component/antd/date-picker/util.js +1 -1
- package/lib/schema-component/antd/filter/DynamicComponent.js +3 -1
- package/lib/schema-component/antd/filter/Filter.js +2 -1
- package/lib/schema-component/antd/filter/FilterGroup.js +7 -4
- package/lib/schema-component/antd/filter/FilterItem.js +3 -2
- package/lib/schema-component/antd/filter/context.d.ts +1 -0
- package/lib/schema-component/antd/filter/useValues.js +15 -11
- package/lib/schema-component/antd/form/Form.js +9 -3
- package/lib/schema-component/antd/form-item/FormItem.js +21 -7
- package/lib/schema-component/antd/form-v2/Form.Designer.js +2 -0
- package/lib/schema-component/antd/form-v2/Form.js +89 -5
- package/lib/schema-component/antd/form-v2/utils.d.ts +5 -0
- package/lib/schema-component/antd/form-v2/utils.js +181 -0
- package/lib/schema-component/antd/grid/Grid.js +10 -5
- package/lib/schema-component/antd/icon-picker/IconPicker.js +1 -0
- package/lib/schema-component/antd/index.d.ts +1 -0
- package/lib/schema-component/antd/index.js +13 -0
- package/lib/schema-component/antd/input/Input.d.ts +2 -1
- package/lib/schema-component/antd/input/Json.d.ts +5 -3
- package/lib/schema-component/antd/input/Json.js +6 -3
- package/lib/schema-component/antd/input-number/InputNumber.js +2 -0
- package/lib/schema-component/antd/page/FixedBlock.js +3 -1
- package/lib/schema-component/antd/page/Page.js +14 -5
- package/lib/schema-component/antd/page/PageTabDesigner.js +1 -1
- package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +3 -1
- package/lib/schema-component/antd/record-picker/RecordPicker.js +1 -2
- package/lib/schema-component/antd/record-picker/util.js +7 -0
- package/lib/schema-component/antd/remote-select/RemoteSelect.js +76 -37
- package/lib/schema-component/antd/rich-text/RichText.js +4 -2
- package/lib/schema-component/antd/select/Select.js +14 -4
- package/lib/schema-component/antd/table/Table.Array.js +8 -1
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +2 -2
- package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +3 -2
- package/lib/schema-component/antd/tabs/Tabs.Designer.js +1 -0
- package/lib/schema-component/antd/time-picker/TimePicker.js +1 -1
- package/lib/schema-component/antd/variable/Input.d.ts +2 -0
- package/lib/schema-component/antd/variable/Input.js +262 -0
- package/lib/schema-component/antd/variable/JSONInput.d.ts +2 -0
- package/lib/schema-component/antd/variable/JSONInput.js +100 -0
- package/lib/schema-component/antd/variable/TextArea.d.ts +2 -0
- package/lib/schema-component/antd/variable/TextArea.js +341 -0
- package/lib/schema-component/antd/variable/Variable.d.ts +8 -0
- package/lib/schema-component/antd/variable/Variable.js +25 -0
- package/lib/schema-component/antd/variable/index.d.ts +1 -0
- package/lib/schema-component/antd/variable/index.js +18 -0
- package/lib/schema-component/common/sortable-item/SortableItem.js +36 -6
- package/lib/schema-component/common/utils/logic.js +525 -0
- package/lib/schema-component/common/utils/uitls.d.ts +1 -0
- package/lib/schema-component/common/utils/uitls.js +103 -0
- package/lib/schema-initializer/SchemaInitializer.js +0 -1
- package/lib/schema-initializer/buttons/TableActionColumnInitializers.d.ts +1 -0
- package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +3 -1
- package/lib/schema-initializer/index.d.ts +2 -1
- package/lib/schema-initializer/index.js +51 -2
- package/lib/schema-initializer/items/CalendarBlockInitializer.js +16 -33
- package/lib/schema-initializer/utils.js +22 -6
- package/lib/schema-settings/LinkageRules/DynamicComponent.d.ts +1 -0
- package/lib/schema-settings/LinkageRules/DynamicComponent.js +139 -0
- package/lib/schema-settings/LinkageRules/FilterDynamicComponent.d.ts +2 -0
- package/lib/schema-settings/LinkageRules/FilterDynamicComponent.js +27 -0
- package/lib/schema-settings/LinkageRules/LinkageRuleAction.d.ts +3 -0
- package/lib/schema-settings/LinkageRules/LinkageRuleAction.js +190 -0
- package/lib/schema-settings/LinkageRules/LinkageRuleActionGroup.d.ts +3 -0
- package/lib/schema-settings/LinkageRules/LinkageRuleActionGroup.js +90 -0
- package/lib/schema-settings/LinkageRules/ValueDynamicComponent.d.ts +1 -0
- package/lib/schema-settings/LinkageRules/ValueDynamicComponent.js +104 -0
- package/lib/schema-settings/LinkageRules/Variables.d.ts +7 -0
- package/lib/schema-settings/LinkageRules/Variables.js +124 -0
- package/lib/schema-settings/LinkageRules/action-hooks.d.ts +1 -0
- package/lib/schema-settings/LinkageRules/action-hooks.js +127 -0
- package/lib/schema-settings/LinkageRules/context.d.ts +13 -0
- package/lib/schema-settings/LinkageRules/context.js +15 -0
- package/lib/schema-settings/LinkageRules/index.d.ts +2 -0
- package/lib/schema-settings/LinkageRules/index.js +149 -0
- package/lib/schema-settings/LinkageRules/type.d.ts +13 -0
- package/lib/schema-settings/LinkageRules/type.js +22 -0
- package/lib/schema-settings/LinkageRules/useValues.d.ts +1 -0
- package/lib/schema-settings/LinkageRules/useValues.js +95 -0
- package/lib/schema-settings/SchemaSettings.d.ts +4 -1
- package/lib/schema-settings/SchemaSettings.js +176 -48
- package/lib/schema-templates/BlockTemplate.js +9 -1
- package/lib/system-settings/SystemSettingsShortcut.js +1 -1
- package/package.json +4 -4
|
@@ -423,15 +423,20 @@ Grid.Row = (0, _react.observer)(function (props) {
|
|
|
423
423
|
})));
|
|
424
424
|
});
|
|
425
425
|
Grid.Col = (0, _react.observer)(function (props) {
|
|
426
|
-
var _schema$xComponentP;
|
|
427
|
-
|
|
428
426
|
var _useContext = (0, _react2.useContext)(GridRowContext),
|
|
429
|
-
cols = _useContext.cols
|
|
427
|
+
_useContext$cols = _useContext.cols,
|
|
428
|
+
cols = _useContext$cols === void 0 ? [] : _useContext$cols;
|
|
430
429
|
|
|
431
430
|
var schema = (0, _react.useFieldSchema)();
|
|
432
431
|
var field = (0, _react.useField)();
|
|
433
|
-
var
|
|
434
|
-
|
|
432
|
+
var width = '100%';
|
|
433
|
+
|
|
434
|
+
if (cols === null || cols === void 0 ? void 0 : cols.length) {
|
|
435
|
+
var _schema$xComponentP;
|
|
436
|
+
|
|
437
|
+
var w = (schema === null || schema === void 0 ? void 0 : (_schema$xComponentP = schema['x-component-props']) === null || _schema$xComponentP === void 0 ? void 0 : _schema$xComponentP['width']) || 100 / cols.length;
|
|
438
|
+
width = "calc(".concat(w, "% - 24px - 24px / ").concat(cols.length, ")");
|
|
439
|
+
}
|
|
435
440
|
|
|
436
441
|
var _useDroppable3 = (0, _core.useDroppable)({
|
|
437
442
|
id: field.address.toString(),
|
|
@@ -498,4 +498,17 @@ Object.keys(_upload).forEach(function (key) {
|
|
|
498
498
|
});
|
|
499
499
|
});
|
|
500
500
|
|
|
501
|
+
var _variable = require("./variable");
|
|
502
|
+
|
|
503
|
+
Object.keys(_variable).forEach(function (key) {
|
|
504
|
+
if (key === "default" || key === "__esModule") return;
|
|
505
|
+
if (key in exports && exports[key] === _variable[key]) return;
|
|
506
|
+
Object.defineProperty(exports, key, {
|
|
507
|
+
enumerable: true,
|
|
508
|
+
get: function get() {
|
|
509
|
+
return _variable[key];
|
|
510
|
+
}
|
|
511
|
+
});
|
|
512
|
+
});
|
|
513
|
+
|
|
501
514
|
require("./index.less");
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { InputProps, TextAreaProps } from 'antd/lib/input';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { JSONTextAreaProps } from './Json';
|
|
3
4
|
declare type ComposedInput = React.FC<InputProps> & {
|
|
4
5
|
TextArea?: React.FC<TextAreaProps>;
|
|
5
6
|
URL?: React.FC<InputProps>;
|
|
6
|
-
JSON?: React.FC<
|
|
7
|
+
JSON?: React.FC<JSONTextAreaProps>;
|
|
7
8
|
};
|
|
8
9
|
export declare const Input: ComposedInput;
|
|
9
10
|
export default Input;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React, { Ref } from 'react';
|
|
2
2
|
import { TextAreaProps } from 'antd/lib/input';
|
|
3
|
-
export declare
|
|
3
|
+
export declare type JSONTextAreaProps = TextAreaProps & {
|
|
4
|
+
ref: Ref<any>;
|
|
4
5
|
value: any;
|
|
5
6
|
space: number;
|
|
6
|
-
}
|
|
7
|
+
};
|
|
8
|
+
export declare const Json: React.ForwardRefExoticComponent<React.RefAttributes<React.Ref<any>>>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.Json =
|
|
6
|
+
exports.Json = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -25,7 +25,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
25
25
|
|
|
26
26
|
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; }
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
var Json = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
29
29
|
var value = _ref.value,
|
|
30
30
|
_onChange = _ref.onChange,
|
|
31
31
|
_ref$space = _ref.space,
|
|
@@ -34,6 +34,7 @@ function Json(_ref) {
|
|
|
34
34
|
|
|
35
35
|
var field = (0, _react2.useField)();
|
|
36
36
|
return /*#__PURE__*/_react.default.createElement(_antd.Input.TextArea, _objectSpread(_objectSpread({}, props), {}, {
|
|
37
|
+
ref: ref,
|
|
37
38
|
defaultValue: value != null ? JSON.stringify(value, null, space) : '',
|
|
38
39
|
onChange: function onChange(ev) {
|
|
39
40
|
try {
|
|
@@ -50,4 +51,6 @@ function Json(_ref) {
|
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
}));
|
|
53
|
-
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
exports.Json = Json;
|
|
@@ -31,6 +31,8 @@ var InputNumber = (0, _react.connect)(function (props) {
|
|
|
31
31
|
var onChange = props.onChange,
|
|
32
32
|
others = _objectWithoutProperties(props, _excluded);
|
|
33
33
|
|
|
34
|
+
var field = (0, _react.useField)();
|
|
35
|
+
|
|
34
36
|
var handleChange = function handleChange(v) {
|
|
35
37
|
onChange(parseFloat(v));
|
|
36
38
|
};
|
|
@@ -117,13 +117,15 @@ var useFixedBlockDesignerSetting = function useFixedBlockDesignerSetting() {
|
|
|
117
117
|
|
|
118
118
|
var record = (0, _recordProvider.useRecord)();
|
|
119
119
|
return (0, _react.useMemo)(function () {
|
|
120
|
+
var _fieldSchema$xDecora3;
|
|
121
|
+
|
|
120
122
|
if (Object.keys(record).length) {
|
|
121
123
|
return;
|
|
122
124
|
}
|
|
123
125
|
|
|
124
126
|
return /*#__PURE__*/_react.default.createElement(_schemaSettings.SchemaSettings.SwitchItem, {
|
|
125
127
|
title: t('Fix block'),
|
|
126
|
-
checked: fieldSchema['x-decorator-props']
|
|
128
|
+
checked: (_fieldSchema$xDecora3 = fieldSchema['x-decorator-props']) === null || _fieldSchema$xDecora3 === void 0 ? void 0 : _fieldSchema$xDecora3.fixedBlock,
|
|
127
129
|
onChange: function () {
|
|
128
130
|
var _onChange = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(fixedBlock) {
|
|
129
131
|
var _schema;
|
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.Page = void 0;
|
|
9
9
|
|
|
10
|
+
var _icons = require("@ant-design/icons");
|
|
11
|
+
|
|
10
12
|
var _css = require("@emotion/css");
|
|
11
13
|
|
|
12
14
|
var _antd = require("@formily/antd");
|
|
@@ -27,6 +29,10 @@ var _documentTitle = require("../../../document-title");
|
|
|
27
29
|
|
|
28
30
|
var _icon = require("../../../icon");
|
|
29
31
|
|
|
32
|
+
var _common = require("../../common");
|
|
33
|
+
|
|
34
|
+
var _sortableItem = require("../../common/sortable-item");
|
|
35
|
+
|
|
30
36
|
var _core = require("../../core");
|
|
31
37
|
|
|
32
38
|
var _hooks = require("../../hooks");
|
|
@@ -140,7 +146,7 @@ var Page = function Page(props) {
|
|
|
140
146
|
ghost: false,
|
|
141
147
|
title: hidePageTitle ? undefined : fieldSchema.title || compile(title)
|
|
142
148
|
}, others), {}, {
|
|
143
|
-
footer: enablePageTabs && /*#__PURE__*/_react2.default.createElement(_antd2.Tabs, {
|
|
149
|
+
footer: enablePageTabs && /*#__PURE__*/_react2.default.createElement(_common.DndContext, null, /*#__PURE__*/_react2.default.createElement(_antd2.Tabs, {
|
|
144
150
|
size: 'small',
|
|
145
151
|
activeKey: activeKey,
|
|
146
152
|
onTabClick: function onTabClick(activeKey) {
|
|
@@ -152,7 +158,8 @@ var Page = function Page(props) {
|
|
|
152
158
|
}, 50);
|
|
153
159
|
},
|
|
154
160
|
tabBarExtraContent: dn.designable && /*#__PURE__*/_react2.default.createElement(_antd2.Button, {
|
|
155
|
-
|
|
161
|
+
icon: /*#__PURE__*/_react2.default.createElement(_icons.PlusOutlined, null),
|
|
162
|
+
className: (0, _css.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n border-color: rgb(241, 139, 98) !important;\n color: rgb(241, 139, 98) !important;\n "]))),
|
|
156
163
|
type: 'dashed',
|
|
157
164
|
onClick: function () {
|
|
158
165
|
var _onClick = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
@@ -215,10 +222,12 @@ var Page = function Page(props) {
|
|
|
215
222
|
|
|
216
223
|
return onClick;
|
|
217
224
|
}()
|
|
218
|
-
},
|
|
225
|
+
}, t('Add tab'))
|
|
219
226
|
}, fieldSchema.mapProperties(function (schema) {
|
|
220
227
|
return /*#__PURE__*/_react2.default.createElement(_antd2.Tabs.TabPane, {
|
|
221
|
-
tab: /*#__PURE__*/_react2.default.createElement(
|
|
228
|
+
tab: /*#__PURE__*/_react2.default.createElement(_sortableItem.SortableItem, {
|
|
229
|
+
id: schema.name,
|
|
230
|
+
schema: schema,
|
|
222
231
|
className: (0, _classnames.default)('nb-action-link', designerCss, props.className)
|
|
223
232
|
}, schema['x-icon'] && /*#__PURE__*/_react2.default.createElement(_icon.Icon, {
|
|
224
233
|
style: {
|
|
@@ -230,7 +239,7 @@ var Page = function Page(props) {
|
|
|
230
239
|
})),
|
|
231
240
|
key: schema.name
|
|
232
241
|
});
|
|
233
|
-
}))
|
|
242
|
+
})))
|
|
234
243
|
}))), /*#__PURE__*/_react2.default.createElement("div", {
|
|
235
244
|
style: {
|
|
236
245
|
margin: 24
|
|
@@ -156,7 +156,7 @@ var PageTabDesigner = function PageTabDesigner(_ref3) {
|
|
|
156
156
|
}, /*#__PURE__*/_react2.default.createElement(_antd.Space, {
|
|
157
157
|
size: 2,
|
|
158
158
|
align: 'center'
|
|
159
|
-
}, /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings, {
|
|
159
|
+
}, /*#__PURE__*/_react2.default.createElement(_.DragHandler, null, /*#__PURE__*/_react2.default.createElement(_icons.DragOutlined, null)), /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings, {
|
|
160
160
|
title: /*#__PURE__*/_react2.default.createElement(_icons.MenuOutlined, {
|
|
161
161
|
style: {
|
|
162
162
|
cursor: 'pointer',
|
|
@@ -56,6 +56,8 @@ var toValue = function toValue(value, placeholder) {
|
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
var ReadPrettyRecordPicker = (0, _react.observer)(function (props) {
|
|
59
|
+
var _collectionField$targ;
|
|
60
|
+
|
|
59
61
|
var ellipsis = props.ellipsis;
|
|
60
62
|
var fieldSchema = (0, _react.useFieldSchema)();
|
|
61
63
|
var recordCtx = (0, _recordProvider.useRecord)();
|
|
@@ -147,7 +149,7 @@ var ReadPrettyRecordPicker = (0, _react.observer)(function (props) {
|
|
|
147
149
|
return collectionField ? /*#__PURE__*/_react2.default.createElement("div", null, /*#__PURE__*/_react2.default.createElement(_blockProvider.BlockAssociationContext.Provider, {
|
|
148
150
|
value: "".concat(collectionField.collectionName, ".").concat(collectionField.name)
|
|
149
151
|
}, /*#__PURE__*/_react2.default.createElement(_collectionManager.CollectionProvider, {
|
|
150
|
-
name: collectionField.target
|
|
152
|
+
name: (_collectionField$targ = collectionField.target) !== null && _collectionField$targ !== void 0 ? _collectionField$targ : collectionField.targetCollection
|
|
151
153
|
}, /*#__PURE__*/_react2.default.createElement(_EllipsisWithTooltip.EllipsisWithTooltip, {
|
|
152
154
|
ellipsis: ellipsis,
|
|
153
155
|
ref: ellipsisWithTooltipRef
|
|
@@ -11,6 +11,5 @@ var _InputRecordPicker = require("./InputRecordPicker");
|
|
|
11
11
|
|
|
12
12
|
var _ReadPrettyRecordPicker = require("./ReadPrettyRecordPicker");
|
|
13
13
|
|
|
14
|
-
var RecordPicker = (0, _react.connect)(_InputRecordPicker.InputRecordPicker,
|
|
15
|
-
(0, _react.mapReadPretty)(_ReadPrettyRecordPicker.ReadPrettyRecordPicker));
|
|
14
|
+
var RecordPicker = (0, _react.connect)(_InputRecordPicker.InputRecordPicker, (0, _react.mapReadPretty)(_ReadPrettyRecordPicker.ReadPrettyRecordPicker));
|
|
16
15
|
exports.RecordPicker = RecordPicker;
|
|
@@ -41,6 +41,13 @@ var getDatePickerLabels = function getDatePickerLabels(props) {
|
|
|
41
41
|
exports.getDatePickerLabels = getDatePickerLabels;
|
|
42
42
|
|
|
43
43
|
var getLabelFormatValue = function getLabelFormatValue(labelUiSchema, value) {
|
|
44
|
+
if (Array.isArray(labelUiSchema === null || labelUiSchema === void 0 ? void 0 : labelUiSchema.enum) && value) {
|
|
45
|
+
var opt = labelUiSchema.enum.find(function (option) {
|
|
46
|
+
return option.value === value;
|
|
47
|
+
});
|
|
48
|
+
return opt === null || opt === void 0 ? void 0 : opt.label;
|
|
49
|
+
}
|
|
50
|
+
|
|
44
51
|
switch (labelUiSchema === null || labelUiSchema === void 0 ? void 0 : labelUiSchema['x-component']) {
|
|
45
52
|
case 'DatePicker':
|
|
46
53
|
return getDatePickerLabels(_objectSpread(_objectSpread({}, labelUiSchema === null || labelUiSchema === void 0 ? void 0 : labelUiSchema['x-component-props']), {}, {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
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); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -15,34 +13,26 @@ var _react2 = _interopRequireWildcard(require("react"));
|
|
|
15
13
|
|
|
16
14
|
var _apiClient = require("../../../api-client");
|
|
17
15
|
|
|
16
|
+
var _SharedFilterProvider = require("../../../block-provider/SharedFilterProvider");
|
|
17
|
+
|
|
18
18
|
var _hooks = require("../../hooks");
|
|
19
19
|
|
|
20
20
|
var _select = require("../select");
|
|
21
21
|
|
|
22
22
|
var _ReadPretty = require("./ReadPretty");
|
|
23
23
|
|
|
24
|
-
var _excluded = ["fieldNames", "service", "wait"];
|
|
24
|
+
var _excluded = ["fieldNames", "service", "wait", "value", "objectValue"];
|
|
25
25
|
|
|
26
26
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
27
|
|
|
28
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
29
|
|
|
30
|
+
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); }
|
|
31
|
+
|
|
30
32
|
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); } }
|
|
31
33
|
|
|
32
34
|
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); }); }; }
|
|
33
35
|
|
|
34
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
35
|
-
|
|
36
|
-
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."); }
|
|
37
|
-
|
|
38
|
-
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); }
|
|
39
|
-
|
|
40
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
41
|
-
|
|
42
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
43
|
-
|
|
44
|
-
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; }
|
|
45
|
-
|
|
46
36
|
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; }
|
|
47
37
|
|
|
48
38
|
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; }
|
|
@@ -54,7 +44,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
54
44
|
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; }
|
|
55
45
|
|
|
56
46
|
var InternalRemoteSelect = (0, _react.connect)(function (props) {
|
|
57
|
-
var _service$params
|
|
47
|
+
var _service$params;
|
|
58
48
|
|
|
59
49
|
var _props$fieldNames = props.fieldNames,
|
|
60
50
|
fieldNames = _props$fieldNames === void 0 ? {} : _props$fieldNames,
|
|
@@ -62,9 +52,12 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
|
|
|
62
52
|
service = _props$service === void 0 ? {} : _props$service,
|
|
63
53
|
_props$wait = props.wait,
|
|
64
54
|
wait = _props$wait === void 0 ? 300 : _props$wait,
|
|
55
|
+
value = props.value,
|
|
56
|
+
objectValue = props.objectValue,
|
|
65
57
|
others = _objectWithoutProperties(props, _excluded);
|
|
66
58
|
|
|
67
59
|
var compile = (0, _hooks.useCompile)();
|
|
60
|
+
var firstRun = (0, _react2.useRef)(false);
|
|
68
61
|
|
|
69
62
|
var _useRequest = (0, _apiClient.useRequest)(_objectSpread(_objectSpread({
|
|
70
63
|
action: 'list'
|
|
@@ -72,33 +65,43 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
|
|
|
72
65
|
params: _objectSpread(_objectSpread({
|
|
73
66
|
pageSize: 200
|
|
74
67
|
}, service === null || service === void 0 ? void 0 : service.params), {}, {
|
|
75
|
-
fields: [fieldNames.label, fieldNames.value
|
|
68
|
+
// fields: [fieldNames.label, fieldNames.value, ...(service?.params?.fields || [])],
|
|
76
69
|
// search needs
|
|
77
|
-
filter:
|
|
78
|
-
$and: [service === null || service === void 0 ? void 0 : (_service$params2 = service.params) === null || _service$params2 === void 0 ? void 0 : _service$params2.filter].filter(Boolean)
|
|
79
|
-
}
|
|
70
|
+
filter: (0, _SharedFilterProvider.mergeFilter)([service === null || service === void 0 ? void 0 : (_service$params = service.params) === null || _service$params === void 0 ? void 0 : _service$params.filter])
|
|
80
71
|
})
|
|
81
72
|
}), {
|
|
82
|
-
|
|
83
|
-
|
|
73
|
+
manual: true,
|
|
74
|
+
debounceWait: wait
|
|
84
75
|
}),
|
|
85
76
|
data = _useRequest.data,
|
|
86
|
-
run = _useRequest.run
|
|
77
|
+
run = _useRequest.run,
|
|
78
|
+
loading = _useRequest.loading;
|
|
79
|
+
|
|
80
|
+
var runDep = (0, _react2.useMemo)(function () {
|
|
81
|
+
return JSON.stringify({
|
|
82
|
+
service: service,
|
|
83
|
+
fieldNames: fieldNames
|
|
84
|
+
});
|
|
85
|
+
}, [service, fieldNames]);
|
|
86
|
+
(0, _react2.useEffect)(function () {
|
|
87
|
+
// Lazy load
|
|
88
|
+
if (firstRun.current) {
|
|
89
|
+
run();
|
|
90
|
+
}
|
|
91
|
+
}, [runDep]);
|
|
87
92
|
|
|
88
93
|
var onSearch = /*#__PURE__*/function () {
|
|
89
94
|
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(search) {
|
|
90
|
-
var _service$
|
|
95
|
+
var _service$params2;
|
|
91
96
|
|
|
92
97
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
93
98
|
while (1) {
|
|
94
99
|
switch (_context.prev = _context.next) {
|
|
95
100
|
case 0:
|
|
96
101
|
run({
|
|
97
|
-
filter: {
|
|
98
|
-
$
|
|
99
|
-
|
|
100
|
-
}), service === null || service === void 0 ? void 0 : (_service$params3 = service.params) === null || _service$params3 === void 0 ? void 0 : _service$params3.filter].filter(Boolean)
|
|
101
|
-
}
|
|
102
|
+
filter: (0, _SharedFilterProvider.mergeFilter)([_defineProperty({}, fieldNames.label, {
|
|
103
|
+
$includes: search
|
|
104
|
+
}), service === null || service === void 0 ? void 0 : (_service$params2 = service.params) === null || _service$params2 === void 0 ? void 0 : _service$params2.filter])
|
|
102
105
|
});
|
|
103
106
|
|
|
104
107
|
case 1:
|
|
@@ -114,25 +117,61 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
|
|
|
114
117
|
};
|
|
115
118
|
}();
|
|
116
119
|
|
|
120
|
+
var getOptionsByFieldNames = (0, _react2.useCallback)(function (item) {
|
|
121
|
+
return Object.keys(fieldNames).reduce(function (obj, key) {
|
|
122
|
+
var value = item[fieldNames[key]];
|
|
123
|
+
|
|
124
|
+
if (value) {
|
|
125
|
+
// support hidden, disabled, etc.
|
|
126
|
+
obj[['label', 'value', 'options'].includes(key) ? fieldNames[key] : key] = key === 'label' ? compile(value) : value;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return obj;
|
|
130
|
+
}, {});
|
|
131
|
+
}, [fieldNames]);
|
|
132
|
+
var normalizeOptions = (0, _react2.useCallback)(function (obj) {
|
|
133
|
+
var _ref3;
|
|
134
|
+
|
|
135
|
+
if (objectValue || _typeof(obj) === 'object') {
|
|
136
|
+
return getOptionsByFieldNames(obj);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return _ref3 = {}, _defineProperty(_ref3, fieldNames.value, obj), _defineProperty(_ref3, fieldNames.label, obj), _ref3;
|
|
140
|
+
}, [objectValue, getOptionsByFieldNames]);
|
|
117
141
|
var options = (0, _react2.useMemo)(function () {
|
|
118
|
-
var _data$data;
|
|
142
|
+
var _data$data, _data$data2;
|
|
143
|
+
|
|
144
|
+
if (!(data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.length)) {
|
|
145
|
+
return value !== undefined && value !== null ? Array.isArray(value) ? value.map(normalizeOptions) : [normalizeOptions(value)] : [];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return (data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : _data$data2.map(getOptionsByFieldNames)) || [];
|
|
149
|
+
}, [data === null || data === void 0 ? void 0 : data.data, getOptionsByFieldNames, normalizeOptions, value]);
|
|
150
|
+
|
|
151
|
+
var onDropdownVisibleChange = function onDropdownVisibleChange() {
|
|
152
|
+
if (firstRun.current) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
run();
|
|
157
|
+
firstRun.current = true;
|
|
158
|
+
};
|
|
119
159
|
|
|
120
|
-
return (data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.map(function (item) {
|
|
121
|
-
return _objectSpread(_objectSpread({}, item), {}, _defineProperty({}, fieldNames.label, compile(item[fieldNames.label])));
|
|
122
|
-
})) || [];
|
|
123
|
-
}, [data, fieldNames.label]);
|
|
124
160
|
return /*#__PURE__*/_react2.default.createElement(_select.Select, _objectSpread(_objectSpread({
|
|
125
161
|
autoClearSearchValue: true,
|
|
126
162
|
filterOption: false,
|
|
127
163
|
filterSort: null,
|
|
128
164
|
fieldNames: fieldNames,
|
|
129
|
-
onSearch: onSearch
|
|
165
|
+
onSearch: onSearch,
|
|
166
|
+
onDropdownVisibleChange: onDropdownVisibleChange,
|
|
167
|
+
objectValue: objectValue,
|
|
168
|
+
value: value
|
|
130
169
|
}, others), {}, {
|
|
170
|
+
loading: loading,
|
|
131
171
|
options: options
|
|
132
172
|
}));
|
|
133
173
|
}, (0, _react.mapProps)({
|
|
134
|
-
dataSource: 'options'
|
|
135
|
-
loading: true
|
|
174
|
+
dataSource: 'options'
|
|
136
175
|
}, function (props, field) {
|
|
137
176
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
138
177
|
fieldNames: _objectSpread(_objectSpread(_objectSpread({}, _select.defaultFieldNames), props.fieldNames), field.componentProps.fieldNames),
|
|
@@ -33,12 +33,14 @@ var RichText = (0, _react.connect)(function (props) {
|
|
|
33
33
|
};
|
|
34
34
|
var formats = ['header', 'bold', 'italic', 'underline', 'strike', 'blockquote', 'list', 'bullet', 'indent', 'link', 'image'];
|
|
35
35
|
var value = props.value,
|
|
36
|
-
onChange = props.onChange
|
|
36
|
+
onChange = props.onChange,
|
|
37
|
+
disabled = props.disabled;
|
|
37
38
|
return /*#__PURE__*/_react2.default.createElement(_reactQuill.default, {
|
|
38
39
|
modules: modules,
|
|
39
40
|
formats: formats,
|
|
40
41
|
value: typeof value === 'string' ? value : '',
|
|
41
|
-
onChange: onChange
|
|
42
|
+
onChange: onChange,
|
|
43
|
+
readOnly: disabled
|
|
42
44
|
});
|
|
43
45
|
}, (0, _react.mapReadPretty)(function (props) {
|
|
44
46
|
return /*#__PURE__*/_react2.default.createElement(_input.ReadPretty.Html, _objectSpread({}, props));
|
|
@@ -20,7 +20,7 @@ var _ReadPretty = require("./ReadPretty");
|
|
|
20
20
|
var _shared2 = require("./shared");
|
|
21
21
|
|
|
22
22
|
var _excluded = ["value", "options", "onChange", "fieldNames", "mode"],
|
|
23
|
-
_excluded2 = ["objectValue"];
|
|
23
|
+
_excluded2 = ["objectValue", "value"];
|
|
24
24
|
|
|
25
25
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
26
|
|
|
@@ -114,12 +114,22 @@ var filterOption = function filterOption(input, option) {
|
|
|
114
114
|
|
|
115
115
|
var InternalSelect = (0, _react.connect)(function (props) {
|
|
116
116
|
var objectValue = props.objectValue,
|
|
117
|
+
value = props.value,
|
|
117
118
|
others = _objectWithoutProperties(props, _excluded2);
|
|
118
119
|
|
|
119
120
|
var mode = props.mode || props.multiple ? 'multiple' : undefined;
|
|
120
121
|
|
|
122
|
+
var toValue = function toValue(v) {
|
|
123
|
+
if (['multiple', 'tags'].includes(mode)) {
|
|
124
|
+
return v || [];
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return v;
|
|
128
|
+
};
|
|
129
|
+
|
|
121
130
|
if (objectValue) {
|
|
122
131
|
return /*#__PURE__*/_react2.default.createElement(ObjectSelect, _objectSpread(_objectSpread({}, others), {}, {
|
|
132
|
+
value: toValue(value),
|
|
123
133
|
mode: mode
|
|
124
134
|
}));
|
|
125
135
|
}
|
|
@@ -127,7 +137,8 @@ var InternalSelect = (0, _react.connect)(function (props) {
|
|
|
127
137
|
return /*#__PURE__*/_react2.default.createElement(_antd.Select, _objectSpread(_objectSpread({
|
|
128
138
|
showSearch: true,
|
|
129
139
|
filterOption: filterOption,
|
|
130
|
-
allowClear: true
|
|
140
|
+
allowClear: true,
|
|
141
|
+
value: toValue(value)
|
|
131
142
|
}, others), {}, {
|
|
132
143
|
onChange: function onChange(changed) {
|
|
133
144
|
var _props$onChange;
|
|
@@ -137,8 +148,7 @@ var InternalSelect = (0, _react.connect)(function (props) {
|
|
|
137
148
|
mode: mode
|
|
138
149
|
}));
|
|
139
150
|
}, (0, _react.mapProps)({
|
|
140
|
-
dataSource: 'options'
|
|
141
|
-
loading: true
|
|
151
|
+
dataSource: 'options'
|
|
142
152
|
}, function (props, field) {
|
|
143
153
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
144
154
|
fieldNames: _objectSpread(_objectSpread({}, _shared2.defaultFieldNames), props.fieldNames),
|
|
@@ -69,6 +69,11 @@ var isColumnComponent = function isColumnComponent(schema) {
|
|
|
69
69
|
return ((_schema$xComponent = schema['x-component']) === null || _schema$xComponent === void 0 ? void 0 : _schema$xComponent.endsWith('.Column')) > -1;
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
+
var useScope = function useScope(key) {
|
|
73
|
+
var scope = (0, _react2.useContext)(_react.SchemaExpressionScopeContext);
|
|
74
|
+
return scope[key] !== false;
|
|
75
|
+
};
|
|
76
|
+
|
|
72
77
|
var useTableColumns = function useTableColumns() {
|
|
73
78
|
var start = Date.now();
|
|
74
79
|
var field = (0, _react.useField)();
|
|
@@ -79,9 +84,11 @@ var useTableColumns = function useTableColumns() {
|
|
|
79
84
|
render = _useSchemaInitializer.render;
|
|
80
85
|
|
|
81
86
|
var columns = schema.reduceProperties(function (buf, s) {
|
|
82
|
-
if (isColumnComponent(s)) {
|
|
87
|
+
if (isColumnComponent(s) && useScope(s['x-visible'])) {
|
|
83
88
|
return buf.concat([s]);
|
|
84
89
|
}
|
|
90
|
+
|
|
91
|
+
return buf;
|
|
85
92
|
}, []).map(function (s) {
|
|
86
93
|
return {
|
|
87
94
|
title: /*#__PURE__*/_react2.default.createElement(_react.RecursionField, {
|
|
@@ -51,7 +51,7 @@ var useLabelFields = function useLabelFields(collectionName) {
|
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
var TableColumnDesigner = function TableColumnDesigner(props) {
|
|
54
|
-
var _fieldSchema$xCompon, _uiSchema$xComponent, _collectionField$uiSc, _columnSchema$xCompo;
|
|
54
|
+
var _fieldSchema$xCompon, _uiSchema$xComponent, _collectionField$targ, _collectionField$uiSc, _columnSchema$xCompo;
|
|
55
55
|
|
|
56
56
|
var uiSchema = props.uiSchema,
|
|
57
57
|
fieldSchema = props.fieldSchema,
|
|
@@ -71,7 +71,7 @@ var TableColumnDesigner = function TableColumnDesigner(props) {
|
|
|
71
71
|
dn = _useDesignable.dn;
|
|
72
72
|
|
|
73
73
|
var fieldNames = (fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon === void 0 ? void 0 : _fieldSchema$xCompon['fieldNames']) || (uiSchema === null || uiSchema === void 0 ? void 0 : (_uiSchema$xComponent = uiSchema['x-component-props']) === null || _uiSchema$xComponent === void 0 ? void 0 : _uiSchema$xComponent['fieldNames']);
|
|
74
|
-
var options = useLabelFields(collectionField === null || collectionField === void 0 ? void 0 : collectionField.target);
|
|
74
|
+
var options = useLabelFields((_collectionField$targ = collectionField === null || collectionField === void 0 ? void 0 : collectionField.target) !== null && _collectionField$targ !== void 0 ? _collectionField$targ : collectionField === null || collectionField === void 0 ? void 0 : collectionField.targetCollection);
|
|
75
75
|
var intefaceCfg = getInterface(collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface);
|
|
76
76
|
return /*#__PURE__*/_react2.default.createElement(_schemaSettings.GeneralSchemaDesigner, {
|
|
77
77
|
disableInitializer: true
|
|
@@ -50,7 +50,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
50
50
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
51
51
|
|
|
52
52
|
var TableBlockDesigner = function TableBlockDesigner() {
|
|
53
|
-
var _fieldSchema$xDecora, _fieldSchema$xDecora$, _fieldSchema$xDecora2, _fieldSchema$xDecora3, _fieldSchema$xDecora4, _field$decoratorProps, _field$decoratorProps2;
|
|
53
|
+
var _fieldSchema$xDecora, _fieldSchema$xDecora$, _fieldSchema$xDecora2, _fieldSchema$xDecora3, _fieldSchema$xDecora4, _fieldSchema$xDecora5, _field$decoratorProps, _field$decoratorProps2;
|
|
54
54
|
|
|
55
55
|
var _useCollection = (0, _collectionManager.useCollection)(),
|
|
56
56
|
name = _useCollection.name,
|
|
@@ -75,6 +75,7 @@ var TableBlockDesigner = function TableBlockDesigner() {
|
|
|
75
75
|
var defaultFilter = (fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xDecora = fieldSchema['x-decorator-props']) === null || _fieldSchema$xDecora === void 0 ? void 0 : (_fieldSchema$xDecora$ = _fieldSchema$xDecora.params) === null || _fieldSchema$xDecora$ === void 0 ? void 0 : _fieldSchema$xDecora$.filter) || {};
|
|
76
76
|
var defaultSort = (fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xDecora2 = fieldSchema['x-decorator-props']) === null || _fieldSchema$xDecora2 === void 0 ? void 0 : (_fieldSchema$xDecora3 = _fieldSchema$xDecora2.params) === null || _fieldSchema$xDecora3 === void 0 ? void 0 : _fieldSchema$xDecora3.sort) || [];
|
|
77
77
|
var defaultResource = fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xDecora4 = fieldSchema['x-decorator-props']) === null || _fieldSchema$xDecora4 === void 0 ? void 0 : _fieldSchema$xDecora4.resource;
|
|
78
|
+
var supportTemplate = !(fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xDecora5 = fieldSchema['x-decorator-props']) === null || _fieldSchema$xDecora5 === void 0 ? void 0 : _fieldSchema$xDecora5.disableTemplate);
|
|
78
79
|
var sort = defaultSort === null || defaultSort === void 0 ? void 0 : defaultSort.map(function (item) {
|
|
79
80
|
return item.startsWith('-') ? {
|
|
80
81
|
field: item.substring(1),
|
|
@@ -262,7 +263,7 @@ var TableBlockDesigner = function TableBlockDesigner() {
|
|
|
262
263
|
schema: (_schema4 = {}, _defineProperty(_schema4, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema4, 'x-decorator-props', fieldSchema['x-decorator-props']), _schema4)
|
|
263
264
|
});
|
|
264
265
|
}
|
|
265
|
-
}), /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.Divider, null), /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.Template, {
|
|
266
|
+
}), supportTemplate && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.Divider, null), supportTemplate && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.Template, {
|
|
266
267
|
componentName: 'Table',
|
|
267
268
|
collectionName: name,
|
|
268
269
|
resourceName: defaultResource
|
|
@@ -32,6 +32,7 @@ var TabsDesigner = function TabsDesigner() {
|
|
|
32
32
|
return /*#__PURE__*/_react2.default.createElement(_2.GeneralSchemaDesigner, {
|
|
33
33
|
disableInitializer: true
|
|
34
34
|
}, /*#__PURE__*/_react2.default.createElement(_2.SchemaSettings.ModalItem, {
|
|
35
|
+
key: "edit",
|
|
35
36
|
title: t('Edit'),
|
|
36
37
|
schema: {
|
|
37
38
|
type: 'object',
|
|
@@ -20,7 +20,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
20
20
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
21
|
|
|
22
22
|
var mapTimeFormat = function mapTimeFormat() {
|
|
23
|
-
return function (props) {
|
|
23
|
+
return function (props, field) {
|
|
24
24
|
var format = props['format'] || 'HH:mm:ss';
|
|
25
25
|
var _onChange = props.onChange;
|
|
26
26
|
return _objectSpread(_objectSpread({}, props), {}, {
|