@nocobase/client 0.9.2-alpha.3 → 0.9.3-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/Configuration/schemas/useRoleResourceValues.d.ts +1 -14
- package/es/api-client/hooks/useRequest.d.ts +1 -14
- package/es/api-client/hooks/useRequest.js +48 -53
- package/es/block-provider/DetailsBlockProvider.js +13 -1
- package/es/block-provider/FormBlockProvider.js +30 -13
- package/es/block-provider/hooks/index.d.ts +11 -1
- package/es/block-provider/hooks/index.js +527 -301
- package/es/collection-manager/Configuration/CollectionFields.js +1 -2
- package/es/collection-manager/Configuration/EditCollectionAction.d.ts +1 -14
- package/es/collection-manager/action-hooks.d.ts +4 -43
- package/es/collection-manager/action-hooks.js +18 -7
- package/es/collection-manager/interfaces/createdBy.js +1 -1
- package/es/collection-manager/interfaces/linkTo.js +5 -40
- package/es/collection-manager/interfaces/m2m.js +6 -39
- package/es/collection-manager/interfaces/m2o.js +6 -39
- package/es/collection-manager/interfaces/o2m.js +6 -69
- package/es/collection-manager/interfaces/o2o.js +31 -122
- package/es/collection-manager/interfaces/types.d.ts +2 -0
- package/es/collection-manager/interfaces/updatedBy.js +1 -1
- package/es/collection-manager/sub-table.d.ts +1 -14
- package/es/collection-manager/templates/tree.js +2 -2
- package/es/filter-provider/FilterProvider.js +3 -1
- package/es/locale/en_US.d.ts +4 -1
- package/es/locale/en_US.js +6 -3
- package/es/locale/ja_JP.d.ts +4 -1
- package/es/locale/ja_JP.js +4 -1
- package/es/locale/pt_BR.d.ts +1 -1
- package/es/locale/pt_BR.js +1 -1
- package/es/locale/zh_CN.d.ts +5 -1
- package/es/locale/zh_CN.js +5 -1
- package/es/schema-component/antd/action/Action.Designer.js +4 -5
- package/es/schema-component/antd/association-field/AssociationFieldProvider.d.ts +2 -0
- package/es/schema-component/antd/association-field/AssociationFieldProvider.js +19 -0
- package/es/schema-component/antd/association-field/AssociationSelect.d.ts +14 -0
- package/es/schema-component/antd/association-field/AssociationSelect.js +118 -0
- package/es/schema-component/antd/association-field/Editable.d.ts +2 -0
- package/es/schema-component/antd/association-field/Editable.js +88 -0
- package/es/schema-component/antd/association-field/FileManager.d.ts +4 -0
- package/es/schema-component/antd/association-field/FileManager.js +243 -0
- package/es/schema-component/antd/association-field/InternalNester.d.ts +1 -0
- package/es/schema-component/antd/association-field/InternalNester.js +28 -0
- package/es/schema-component/antd/association-field/InternalPicker.d.ts +2 -0
- package/es/schema-component/antd/association-field/InternalPicker.js +267 -0
- package/es/schema-component/antd/association-field/InternalSubTable.d.ts +1 -0
- package/es/schema-component/antd/association-field/InternalSubTable.js +28 -0
- package/es/schema-component/antd/association-field/InternalViewer.d.ts +2 -0
- package/es/schema-component/antd/association-field/InternalViewer.js +115 -0
- package/es/schema-component/antd/association-field/Nester.d.ts +1 -0
- package/es/schema-component/antd/association-field/Nester.js +80 -0
- package/es/schema-component/antd/association-field/ReadPretty.d.ts +2 -0
- package/es/schema-component/antd/association-field/ReadPretty.js +38 -0
- package/es/schema-component/antd/association-field/SubTable.d.ts +1 -0
- package/es/schema-component/antd/association-field/SubTable.js +25 -0
- package/es/schema-component/antd/association-field/context.d.ts +7 -0
- package/es/schema-component/antd/association-field/context.js +2 -0
- package/es/schema-component/antd/association-field/hooks.d.ts +8 -0
- package/es/schema-component/antd/association-field/hooks.js +96 -0
- package/es/schema-component/antd/association-field/index.d.ts +1 -0
- package/es/schema-component/antd/association-field/index.js +14 -0
- package/es/schema-component/antd/association-field/schema.d.ts +142 -0
- package/es/schema-component/antd/association-field/schema.js +141 -0
- package/es/schema-component/antd/association-field/util.d.ts +8 -0
- package/es/schema-component/antd/association-field/util.js +84 -0
- package/es/schema-component/antd/association-filter/AssociationFilter.FilterBlockInitializer.js +2 -2
- package/es/schema-component/antd/association-select/AssociationSelect.js +11 -2
- package/es/schema-component/antd/expand-action/Expand.Action.Design.d.ts +1 -0
- package/es/schema-component/antd/expand-action/Expand.Action.Design.js +112 -0
- package/es/schema-component/antd/expand-action/Expand.Action.d.ts +1 -0
- package/es/schema-component/antd/expand-action/Expand.Action.js +40 -0
- package/es/schema-component/antd/expand-action/index.d.ts +1 -0
- package/es/schema-component/antd/expand-action/index.js +5 -0
- package/es/schema-component/antd/filter/Filter.Action.Designer.js +10 -12
- package/es/schema-component/antd/filter/FilterItem.js +1 -1
- package/es/schema-component/antd/filter/useOperators.d.ts +1 -1
- package/es/schema-component/antd/form-item/FormItem.d.ts +2 -1
- package/es/schema-component/antd/form-item/FormItem.js +206 -58
- package/es/schema-component/antd/form-item/SchemaSettingOptions.js +36 -58
- package/es/schema-component/antd/form-v2/utils.js +6 -4
- package/es/schema-component/antd/gantt/components/gantt/gantt.js +3 -3
- package/es/schema-component/antd/gantt/components/other/tooltip.js +1 -1
- package/es/schema-component/antd/index.d.ts +3 -1
- package/es/schema-component/antd/index.js +3 -1
- package/es/schema-component/antd/menu/Menu.js +6 -3
- package/es/schema-component/antd/record-picker/InputRecordPicker.d.ts +1 -0
- package/es/schema-component/antd/record-picker/InputRecordPicker.js +40 -17
- package/es/schema-component/antd/remote-select/RemoteSelect.js +16 -18
- package/es/schema-component/antd/table-v2/Table.Column.Designer.js +18 -9
- package/es/schema-component/antd/table-v2/Table.Index.d.ts +1 -0
- package/es/schema-component/antd/table-v2/Table.Index.js +6 -0
- package/es/schema-component/antd/table-v2/Table.js +9 -5
- package/es/schema-component/antd/table-v2/index.js +3 -1
- package/es/schema-component/antd/table-v2/utils.js +1 -1
- package/es/schema-component/antd/variable/Input.js +15 -16
- package/es/schema-component/antd/variable/TextArea.js +2 -5
- package/es/schema-component/antd/variable/Variable.d.ts +2 -0
- package/es/schema-component/antd/variable/Variable.js +5 -2
- package/es/schema-component/common/dnd-context/index.js +3 -2
- package/es/schema-component/common/sortable-item/SortableItem.js +4 -1
- package/es/schema-component/common/utils/uitls.js +1 -1
- package/es/schema-component/hooks/index.d.ts +1 -0
- package/es/schema-component/hooks/index.js +2 -1
- package/es/schema-component/hooks/useFieldModeOptions.d.ts +4 -0
- package/es/schema-component/hooks/useFieldModeOptions.js +105 -0
- package/es/schema-initializer/components/CreateRecordAction.d.ts +1 -1
- package/es/schema-initializer/components/CreateRecordAction.js +4 -3
- package/es/schema-initializer/items/ExpandActionInitializer.d.ts +0 -1
- package/es/schema-initializer/items/ExpandActionInitializer.js +9 -34
- package/es/schema-initializer/items/SelectActionInitializer.d.ts +1 -0
- package/es/schema-initializer/items/SelectActionInitializer.js +65 -0
- package/es/schema-initializer/items/index.d.ts +1 -0
- package/es/schema-initializer/items/index.js +2 -1
- package/es/schema-initializer/utils.js +57 -43
- package/es/schema-settings/LinkageRules/FilterDynamicComponent.js +1 -1
- package/es/schema-settings/LinkageRules/Variables.d.ts +1 -1
- package/es/schema-settings/LinkageRules/Variables.js +7 -4
- package/es/schema-settings/SchemaSettings.js +3 -3
- package/es/schema-settings/VariableInput/VariableInput.d.ts +3 -2
- package/es/schema-settings/VariableInput/VariableInput.js +3 -1
- package/lib/acl/Configuration/schemas/useRoleResourceValues.d.ts +1 -14
- package/lib/api-client/hooks/useRequest.d.ts +1 -14
- package/lib/api-client/hooks/useRequest.js +48 -53
- package/lib/block-provider/DetailsBlockProvider.js +13 -1
- package/lib/block-provider/FormBlockProvider.js +31 -15
- package/lib/block-provider/hooks/index.d.ts +11 -1
- package/lib/block-provider/hooks/index.js +537 -308
- package/lib/collection-manager/Configuration/CollectionFields.js +1 -2
- package/lib/collection-manager/Configuration/EditCollectionAction.d.ts +1 -14
- package/lib/collection-manager/action-hooks.d.ts +4 -43
- package/lib/collection-manager/action-hooks.js +18 -7
- package/lib/collection-manager/interfaces/createdBy.js +1 -1
- package/lib/collection-manager/interfaces/linkTo.js +4 -39
- package/lib/collection-manager/interfaces/m2m.js +5 -38
- package/lib/collection-manager/interfaces/m2o.js +5 -38
- package/lib/collection-manager/interfaces/o2m.js +8 -71
- package/lib/collection-manager/interfaces/o2o.js +36 -127
- package/lib/collection-manager/interfaces/types.d.ts +2 -0
- package/lib/collection-manager/interfaces/updatedBy.js +1 -1
- package/lib/collection-manager/sub-table.d.ts +1 -14
- package/lib/collection-manager/templates/tree.js +2 -2
- package/lib/filter-provider/FilterProvider.js +3 -1
- package/lib/locale/en_US.d.ts +4 -1
- package/lib/locale/en_US.js +6 -3
- package/lib/locale/ja_JP.d.ts +4 -1
- package/lib/locale/ja_JP.js +4 -1
- package/lib/locale/pt_BR.d.ts +1 -1
- package/lib/locale/pt_BR.js +1 -1
- package/lib/locale/zh_CN.d.ts +5 -1
- package/lib/locale/zh_CN.js +5 -1
- package/lib/schema-component/antd/action/Action.Designer.js +4 -5
- package/lib/schema-component/antd/association-field/AssociationFieldProvider.d.ts +2 -0
- package/lib/schema-component/antd/association-field/AssociationFieldProvider.js +28 -0
- package/lib/schema-component/antd/association-field/AssociationSelect.d.ts +14 -0
- package/lib/schema-component/antd/association-field/AssociationSelect.js +129 -0
- package/lib/schema-component/antd/association-field/Editable.d.ts +2 -0
- package/lib/schema-component/antd/association-field/Editable.js +97 -0
- package/lib/schema-component/antd/association-field/FileManager.d.ts +4 -0
- package/lib/schema-component/antd/association-field/FileManager.js +253 -0
- package/lib/schema-component/antd/association-field/InternalNester.d.ts +1 -0
- package/lib/schema-component/antd/association-field/InternalNester.js +39 -0
- package/lib/schema-component/antd/association-field/InternalPicker.d.ts +2 -0
- package/lib/schema-component/antd/association-field/InternalPicker.js +277 -0
- package/lib/schema-component/antd/association-field/InternalSubTable.d.ts +1 -0
- package/lib/schema-component/antd/association-field/InternalSubTable.js +39 -0
- package/lib/schema-component/antd/association-field/InternalViewer.d.ts +2 -0
- package/lib/schema-component/antd/association-field/InternalViewer.js +126 -0
- package/lib/schema-component/antd/association-field/Nester.d.ts +1 -0
- package/lib/schema-component/antd/association-field/Nester.js +89 -0
- package/lib/schema-component/antd/association-field/ReadPretty.d.ts +2 -0
- package/lib/schema-component/antd/association-field/ReadPretty.js +47 -0
- package/lib/schema-component/antd/association-field/SubTable.d.ts +1 -0
- package/lib/schema-component/antd/association-field/SubTable.js +33 -0
- package/lib/schema-component/antd/association-field/context.d.ts +7 -0
- package/lib/schema-component/antd/association-field/context.js +9 -0
- package/lib/schema-component/antd/association-field/hooks.d.ts +8 -0
- package/lib/schema-component/antd/association-field/hooks.js +107 -0
- package/lib/schema-component/antd/association-field/index.d.ts +1 -0
- package/lib/schema-component/antd/association-field/index.js +21 -0
- package/lib/schema-component/antd/association-field/schema.d.ts +142 -0
- package/lib/schema-component/antd/association-field/schema.js +148 -0
- package/lib/schema-component/antd/association-field/util.d.ts +8 -0
- package/lib/schema-component/antd/association-field/util.js +98 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.FilterBlockInitializer.js +2 -2
- package/lib/schema-component/antd/association-select/AssociationSelect.js +10 -1
- package/lib/schema-component/antd/expand-action/Expand.Action.Design.d.ts +1 -0
- package/lib/schema-component/antd/expand-action/Expand.Action.Design.js +120 -0
- package/lib/schema-component/antd/expand-action/Expand.Action.d.ts +1 -0
- package/lib/schema-component/antd/expand-action/Expand.Action.js +48 -0
- package/lib/schema-component/antd/expand-action/index.d.ts +1 -0
- package/lib/schema-component/antd/expand-action/index.js +12 -0
- package/lib/schema-component/antd/filter/Filter.Action.Designer.js +10 -12
- package/lib/schema-component/antd/filter/FilterItem.js +1 -1
- package/lib/schema-component/antd/filter/useOperators.d.ts +1 -1
- package/lib/schema-component/antd/form-item/FormItem.d.ts +2 -1
- package/lib/schema-component/antd/form-item/FormItem.js +204 -55
- package/lib/schema-component/antd/form-item/SchemaSettingOptions.js +34 -56
- package/lib/schema-component/antd/form-v2/utils.js +6 -5
- package/lib/schema-component/antd/gantt/components/gantt/gantt.js +3 -3
- package/lib/schema-component/antd/gantt/components/other/tooltip.js +1 -1
- package/lib/schema-component/antd/index.d.ts +3 -1
- package/lib/schema-component/antd/index.js +33 -11
- package/lib/schema-component/antd/menu/Menu.js +6 -3
- package/lib/schema-component/antd/record-picker/InputRecordPicker.d.ts +1 -0
- package/lib/schema-component/antd/record-picker/InputRecordPicker.js +42 -18
- package/lib/schema-component/antd/remote-select/RemoteSelect.js +15 -17
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +18 -9
- package/lib/schema-component/antd/table-v2/Table.Index.d.ts +1 -0
- package/lib/schema-component/antd/table-v2/Table.Index.js +14 -0
- package/lib/schema-component/antd/table-v2/Table.js +9 -5
- package/lib/schema-component/antd/table-v2/index.js +3 -1
- package/lib/schema-component/antd/table-v2/utils.js +1 -1
- package/lib/schema-component/antd/variable/Input.js +15 -16
- package/lib/schema-component/antd/variable/TextArea.js +2 -5
- package/lib/schema-component/antd/variable/Variable.d.ts +2 -0
- package/lib/schema-component/antd/variable/Variable.js +6 -2
- package/lib/schema-component/common/dnd-context/index.js +3 -2
- package/lib/schema-component/common/sortable-item/SortableItem.js +4 -1
- package/lib/schema-component/common/utils/uitls.js +1 -1
- package/lib/schema-component/hooks/index.d.ts +1 -0
- package/lib/schema-component/hooks/index.js +11 -0
- package/lib/schema-component/hooks/useFieldModeOptions.d.ts +4 -0
- package/lib/schema-component/hooks/useFieldModeOptions.js +112 -0
- package/lib/schema-initializer/components/CreateRecordAction.d.ts +1 -1
- package/lib/schema-initializer/components/CreateRecordAction.js +4 -3
- package/lib/schema-initializer/items/ExpandActionInitializer.d.ts +0 -1
- package/lib/schema-initializer/items/ExpandActionInitializer.js +11 -37
- package/lib/schema-initializer/items/SelectActionInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/SelectActionInitializer.js +73 -0
- package/lib/schema-initializer/items/index.d.ts +1 -0
- package/lib/schema-initializer/items/index.js +11 -0
- package/lib/schema-initializer/utils.js +56 -42
- package/lib/schema-settings/LinkageRules/FilterDynamicComponent.js +1 -1
- package/lib/schema-settings/LinkageRules/Variables.d.ts +1 -1
- package/lib/schema-settings/LinkageRules/Variables.js +7 -4
- package/lib/schema-settings/SchemaSettings.js +4 -4
- package/lib/schema-settings/VariableInput/VariableInput.d.ts +3 -2
- package/lib/schema-settings/VariableInput/VariableInput.js +3 -1
- package/package.json +5 -6
|
@@ -484,7 +484,7 @@ var Gantt = function Gantt(props) {
|
|
|
484
484
|
_context.next = 2;
|
|
485
485
|
return resource.update({
|
|
486
486
|
filterByTk: task.id,
|
|
487
|
-
values:
|
|
487
|
+
values: _defineProperty({}, fieldNames.progress, task.progress / 100)
|
|
488
488
|
});
|
|
489
489
|
case 2:
|
|
490
490
|
_antd.message.success(t('Saved successfully'));
|
|
@@ -502,14 +502,14 @@ var Gantt = function Gantt(props) {
|
|
|
502
502
|
}();
|
|
503
503
|
var handleTaskChange = /*#__PURE__*/function () {
|
|
504
504
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(task) {
|
|
505
|
-
var
|
|
505
|
+
var _values2;
|
|
506
506
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
507
507
|
while (1) switch (_context2.prev = _context2.next) {
|
|
508
508
|
case 0:
|
|
509
509
|
_context2.next = 2;
|
|
510
510
|
return resource.update({
|
|
511
511
|
filterByTk: task.id,
|
|
512
|
-
values:
|
|
512
|
+
values: (_values2 = {}, _defineProperty(_values2, fieldNames.start, task.start), _defineProperty(_values2, fieldNames.end, task.end), _values2)
|
|
513
513
|
});
|
|
514
514
|
case 2:
|
|
515
515
|
_antd.message.success(t('Saved successfully'));
|
|
@@ -107,7 +107,7 @@ var StandardTooltipContent = function StandardTooltipContent(_ref2) {
|
|
|
107
107
|
}
|
|
108
108
|
}, task.name, ": ", (0, _otherHelper.getYmd)(task.start), " ~ ", (0, _otherHelper.getYmd)(task.end)), task.end.getTime() - task.start.getTime() !== 0 && /*#__PURE__*/_react.default.createElement("p", {
|
|
109
109
|
className: (0, _css.cx)(_style.tooltipDefaultContainerParagraph)
|
|
110
|
-
}, "Duration: ".concat(
|
|
110
|
+
}, "Duration: ".concat(Math.round((task.end.getTime() - task.start.getTime()) / (1000 * 60 * 60 * 24) * 10) / 10, " day(s)")), /*#__PURE__*/_react.default.createElement("p", {
|
|
111
111
|
className: (0, _css.cx)(_style.tooltipDefaultContainerParagraph)
|
|
112
112
|
}, !!task.progress && "Progress: ".concat(task.progress, "%")));
|
|
113
113
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './action';
|
|
2
|
+
export * from './association-field';
|
|
2
3
|
export * from './association-select';
|
|
3
4
|
export * from './block-item';
|
|
4
5
|
export * from './calendar';
|
|
@@ -10,11 +11,13 @@ export * from './color-select';
|
|
|
10
11
|
export * from './cron';
|
|
11
12
|
export * from './date-picker';
|
|
12
13
|
export * from './details';
|
|
14
|
+
export * from './expand-action';
|
|
13
15
|
export * from './filter';
|
|
14
16
|
export * from './form';
|
|
15
17
|
export * from './form-item';
|
|
16
18
|
export * from './form-v2';
|
|
17
19
|
export * from './g2plot';
|
|
20
|
+
export * from './gantt';
|
|
18
21
|
export * from './grid';
|
|
19
22
|
export * from './icon-picker';
|
|
20
23
|
export * from './input';
|
|
@@ -40,5 +43,4 @@ export * from './time-picker';
|
|
|
40
43
|
export * from './tree-select';
|
|
41
44
|
export * from './upload';
|
|
42
45
|
export * from './variable';
|
|
43
|
-
export * from './gantt';
|
|
44
46
|
import './index.less';
|
|
@@ -14,6 +14,17 @@ Object.keys(_action).forEach(function (key) {
|
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
|
+
var _associationField = require("./association-field");
|
|
18
|
+
Object.keys(_associationField).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _associationField[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function get() {
|
|
24
|
+
return _associationField[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
17
28
|
var _associationSelect = require("./association-select");
|
|
18
29
|
Object.keys(_associationSelect).forEach(function (key) {
|
|
19
30
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -135,6 +146,17 @@ Object.keys(_details).forEach(function (key) {
|
|
|
135
146
|
}
|
|
136
147
|
});
|
|
137
148
|
});
|
|
149
|
+
var _expandAction = require("./expand-action");
|
|
150
|
+
Object.keys(_expandAction).forEach(function (key) {
|
|
151
|
+
if (key === "default" || key === "__esModule") return;
|
|
152
|
+
if (key in exports && exports[key] === _expandAction[key]) return;
|
|
153
|
+
Object.defineProperty(exports, key, {
|
|
154
|
+
enumerable: true,
|
|
155
|
+
get: function get() {
|
|
156
|
+
return _expandAction[key];
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
});
|
|
138
160
|
var _filter = require("./filter");
|
|
139
161
|
Object.keys(_filter).forEach(function (key) {
|
|
140
162
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -190,6 +212,17 @@ Object.keys(_g2plot).forEach(function (key) {
|
|
|
190
212
|
}
|
|
191
213
|
});
|
|
192
214
|
});
|
|
215
|
+
var _gantt = require("./gantt");
|
|
216
|
+
Object.keys(_gantt).forEach(function (key) {
|
|
217
|
+
if (key === "default" || key === "__esModule") return;
|
|
218
|
+
if (key in exports && exports[key] === _gantt[key]) return;
|
|
219
|
+
Object.defineProperty(exports, key, {
|
|
220
|
+
enumerable: true,
|
|
221
|
+
get: function get() {
|
|
222
|
+
return _gantt[key];
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
});
|
|
193
226
|
var _grid = require("./grid");
|
|
194
227
|
Object.keys(_grid).forEach(function (key) {
|
|
195
228
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -465,15 +498,4 @@ Object.keys(_variable).forEach(function (key) {
|
|
|
465
498
|
}
|
|
466
499
|
});
|
|
467
500
|
});
|
|
468
|
-
var _gantt = require("./gantt");
|
|
469
|
-
Object.keys(_gantt).forEach(function (key) {
|
|
470
|
-
if (key === "default" || key === "__esModule") return;
|
|
471
|
-
if (key in exports && exports[key] === _gantt[key]) return;
|
|
472
|
-
Object.defineProperty(exports, key, {
|
|
473
|
-
enumerable: true,
|
|
474
|
-
get: function get() {
|
|
475
|
-
return _gantt[key];
|
|
476
|
-
}
|
|
477
|
-
});
|
|
478
|
-
});
|
|
479
501
|
require("./index.less");
|
|
@@ -241,7 +241,8 @@ Menu.Item = (0, _react.observer)(function (props) {
|
|
|
241
241
|
eventKey: schema.name,
|
|
242
242
|
schema: schema
|
|
243
243
|
}), /*#__PURE__*/_react2.default.createElement(_.SortableItem, {
|
|
244
|
-
className: designerCss
|
|
244
|
+
className: designerCss,
|
|
245
|
+
removeParentsIfNoChildren: false
|
|
245
246
|
}, /*#__PURE__*/_react2.default.createElement(_2.Icon, {
|
|
246
247
|
type: icon
|
|
247
248
|
}), /*#__PURE__*/_react2.default.createElement("span", {
|
|
@@ -263,7 +264,8 @@ Menu.URL = (0, _react.observer)(function (props) {
|
|
|
263
264
|
window.open(props.href, '_blank');
|
|
264
265
|
}
|
|
265
266
|
}), /*#__PURE__*/_react2.default.createElement(_.SortableItem, {
|
|
266
|
-
className: designerCss
|
|
267
|
+
className: designerCss,
|
|
268
|
+
removeParentsIfNoChildren: false
|
|
267
269
|
}, /*#__PURE__*/_react2.default.createElement(_2.Icon, {
|
|
268
270
|
type: icon
|
|
269
271
|
}), /*#__PURE__*/_react2.default.createElement("span", {
|
|
@@ -285,7 +287,8 @@ Menu.SubMenu = (0, _react.observer)(function (props) {
|
|
|
285
287
|
key: schema.name,
|
|
286
288
|
eventKey: schema.name,
|
|
287
289
|
title: /*#__PURE__*/_react2.default.createElement(_.SortableItem, {
|
|
288
|
-
className: subMenuDesignerCss
|
|
290
|
+
className: subMenuDesignerCss,
|
|
291
|
+
removeParentsIfNoChildren: false
|
|
289
292
|
}, /*#__PURE__*/_react2.default.createElement(_2.Icon, {
|
|
290
293
|
type: icon
|
|
291
294
|
}), field.title, /*#__PURE__*/_react2.default.createElement(Designer, null))
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare const RecordPickerContext: React.Context<any>;
|
|
3
3
|
export declare const InputRecordPicker: React.FC<any>;
|
|
4
|
+
export declare const RecordPickerProvider: (props: any) => JSX.Element;
|
|
4
5
|
export declare function isShowFilePicker(labelUiSchema: any): boolean;
|
|
@@ -4,7 +4,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.RecordPickerContext = exports.InputRecordPicker = void 0;
|
|
7
|
+
exports.RecordPickerProvider = exports.RecordPickerContext = exports.InputRecordPicker = void 0;
|
|
8
8
|
exports.isShowFilePicker = isShowFilePicker;
|
|
9
9
|
var _react = require("@formily/react");
|
|
10
10
|
var _antd = require("antd");
|
|
@@ -19,7 +19,8 @@ var _preview = require("../preview");
|
|
|
19
19
|
var _useFieldNames = require("./useFieldNames");
|
|
20
20
|
var _util = require("./util");
|
|
21
21
|
var _excluded = ["onRowSelectionChange", "rowKey"],
|
|
22
|
-
_excluded2 = ["value", "multiple", "onChange", "quickUpload", "selectFile"]
|
|
22
|
+
_excluded2 = ["value", "multiple", "onChange", "quickUpload", "selectFile"],
|
|
23
|
+
_excluded3 = ["multiple", "onChange", "selectedRows", "setSelectedRows", "options", "collectionField"];
|
|
23
24
|
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); }
|
|
24
25
|
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; }
|
|
25
26
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -73,7 +74,7 @@ var useTableSelectorProps = function useTableSelectorProps() {
|
|
|
73
74
|
rowKey: rowKey,
|
|
74
75
|
rowSelection: {
|
|
75
76
|
type: multiple ? 'checkbox' : 'radio',
|
|
76
|
-
selectedRowKeys: rcSelectRows.filter(function (item) {
|
|
77
|
+
selectedRowKeys: rcSelectRows === null || rcSelectRows === void 0 ? void 0 : rcSelectRows.filter(function (item) {
|
|
77
78
|
return options.every(function (row) {
|
|
78
79
|
return row[rowKey] !== item[rowKey];
|
|
79
80
|
});
|
|
@@ -218,12 +219,16 @@ var InputRecordPicker = function InputRecordPicker(props) {
|
|
|
218
219
|
allowClear: true,
|
|
219
220
|
onChange: function onChange(changed) {
|
|
220
221
|
if (!changed) {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
setSelectedRows([]);
|
|
222
|
+
var _value = multiple ? [] : null;
|
|
223
|
+
_onChange(_value);
|
|
224
|
+
setSelectedRows(_value);
|
|
225
|
+
setOptions([]);
|
|
226
226
|
} else if (Array.isArray(changed)) {
|
|
227
|
+
if (!changed.length) {
|
|
228
|
+
_onChange([]);
|
|
229
|
+
setSelectedRows([]);
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
227
232
|
var values = options === null || options === void 0 ? void 0 : options.filter(function (option) {
|
|
228
233
|
return changed.includes(option[fieldNames.value]);
|
|
229
234
|
});
|
|
@@ -247,6 +252,26 @@ var InputRecordPicker = function InputRecordPicker(props) {
|
|
|
247
252
|
}));
|
|
248
253
|
};
|
|
249
254
|
exports.InputRecordPicker = InputRecordPicker;
|
|
255
|
+
var RecordPickerProvider = function RecordPickerProvider(props) {
|
|
256
|
+
var multiple = props.multiple,
|
|
257
|
+
onChange = props.onChange,
|
|
258
|
+
selectedRows = props.selectedRows,
|
|
259
|
+
setSelectedRows = props.setSelectedRows,
|
|
260
|
+
options = props.options,
|
|
261
|
+
collectionField = props.collectionField,
|
|
262
|
+
other = _objectWithoutProperties(props, _excluded3);
|
|
263
|
+
return /*#__PURE__*/_react2.default.createElement(RecordPickerContext.Provider, {
|
|
264
|
+
value: _objectSpread({
|
|
265
|
+
multiple: multiple,
|
|
266
|
+
onChange: onChange,
|
|
267
|
+
selectedRows: selectedRows,
|
|
268
|
+
setSelectedRows: setSelectedRows,
|
|
269
|
+
options: options,
|
|
270
|
+
collectionField: collectionField
|
|
271
|
+
}, other)
|
|
272
|
+
}, props.children);
|
|
273
|
+
};
|
|
274
|
+
exports.RecordPickerProvider = RecordPickerProvider;
|
|
250
275
|
var Drawer = function Drawer(_ref) {
|
|
251
276
|
var multiple = _ref.multiple,
|
|
252
277
|
onChange = _ref.onChange,
|
|
@@ -267,16 +292,15 @@ var Drawer = function Drawer(_ref) {
|
|
|
267
292
|
} : {};
|
|
268
293
|
return filter;
|
|
269
294
|
};
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
}, /*#__PURE__*/_react2.default.createElement(_collectionManager.CollectionProvider, {
|
|
295
|
+
var recordPickerProps = {
|
|
296
|
+
multiple: multiple,
|
|
297
|
+
onChange: onChange,
|
|
298
|
+
selectedRows: selectedRows,
|
|
299
|
+
setSelectedRows: setSelectedRows,
|
|
300
|
+
options: options,
|
|
301
|
+
collectionField: collectionField
|
|
302
|
+
};
|
|
303
|
+
return /*#__PURE__*/_react2.default.createElement(RecordPickerProvider, _objectSpread({}, recordPickerProps), /*#__PURE__*/_react2.default.createElement(_collectionManager.CollectionProvider, {
|
|
280
304
|
allowNull: true,
|
|
281
305
|
name: collectionField === null || collectionField === void 0 ? void 0 : collectionField.target
|
|
282
306
|
}, /*#__PURE__*/_react2.default.createElement(_action.ActionContext.Provider, {
|
|
@@ -8,6 +8,7 @@ var _icons = require("@ant-design/icons");
|
|
|
8
8
|
var _react = require("@formily/react");
|
|
9
9
|
var _antd = require("antd");
|
|
10
10
|
var _moment = _interopRequireDefault(require("moment"));
|
|
11
|
+
var _lodash = require("lodash");
|
|
11
12
|
var _react2 = _interopRequireWildcard(require("react"));
|
|
12
13
|
var _apiClient = require("../../../api-client");
|
|
13
14
|
var _SharedFilterProvider = require("../../../block-provider/SharedFilterProvider");
|
|
@@ -31,7 +32,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
31
32
|
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; }
|
|
32
33
|
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; }
|
|
33
34
|
var InternalRemoteSelect = (0, _react.connect)(function (props) {
|
|
34
|
-
var _service$params;
|
|
35
|
+
var _field$componentProps, _field$componentProps2, _field$componentProps3, _service$params;
|
|
35
36
|
var _props$fieldNames = props.fieldNames,
|
|
36
37
|
fieldNames = _props$fieldNames === void 0 ? {} : _props$fieldNames,
|
|
37
38
|
_props$service = props.service,
|
|
@@ -48,6 +49,7 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
|
|
|
48
49
|
var compile = (0, _hooks.useCompile)();
|
|
49
50
|
var firstRun = (0, _react2.useRef)(false);
|
|
50
51
|
var fieldSchema = (0, _react.useFieldSchema)();
|
|
52
|
+
var field = (0, _react.useField)();
|
|
51
53
|
var _useCollection = (0, _collectionManager.useCollection)(),
|
|
52
54
|
getField = _useCollection.getField;
|
|
53
55
|
var _useCollectionManager = (0, _collectionManager.useCollectionManager)(),
|
|
@@ -65,7 +67,7 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
|
|
|
65
67
|
var mapOptionsToTags = (0, _react2.useCallback)(function (options) {
|
|
66
68
|
try {
|
|
67
69
|
return options.map(function (option) {
|
|
68
|
-
var _targetField$uiSchema,
|
|
70
|
+
var _targetField$uiSchema, _objectSpread2;
|
|
69
71
|
var label = option[fieldNames.label];
|
|
70
72
|
if (targetField === null || targetField === void 0 ? void 0 : (_targetField$uiSchema = targetField.uiSchema) === null || _targetField$uiSchema === void 0 ? void 0 : _targetField$uiSchema.enum) {
|
|
71
73
|
if (Array.isArray(label)) {
|
|
@@ -103,7 +105,7 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
|
|
|
103
105
|
var _mapOptions;
|
|
104
106
|
return mapOptions((_mapOptions = {}, _defineProperty(_mapOptions, fieldNames.label, label), _defineProperty(_mapOptions, fieldNames.value, option[fieldNames.value]), _mapOptions));
|
|
105
107
|
}
|
|
106
|
-
return
|
|
108
|
+
return _objectSpread(_objectSpread({}, option), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, fieldNames.label, label || option[fieldNames.value]), _defineProperty(_objectSpread2, fieldNames.value, option[fieldNames.value]), _objectSpread2));
|
|
107
109
|
});
|
|
108
110
|
} catch (err) {
|
|
109
111
|
console.error(err);
|
|
@@ -118,7 +120,7 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
|
|
|
118
120
|
}, service === null || service === void 0 ? void 0 : service.params), {}, {
|
|
119
121
|
// fields: [fieldNames.label, fieldNames.value, ...(service?.params?.fields || [])],
|
|
120
122
|
// search needs
|
|
121
|
-
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])
|
|
123
|
+
filter: (0, _SharedFilterProvider.mergeFilter)([((_field$componentProps = field.componentProps) === null || _field$componentProps === void 0 ? void 0 : (_field$componentProps2 = _field$componentProps.service) === null || _field$componentProps2 === void 0 ? void 0 : (_field$componentProps3 = _field$componentProps2.params) === null || _field$componentProps3 === void 0 ? void 0 : _field$componentProps3.filter) || (service === null || service === void 0 ? void 0 : (_service$params = service.params) === null || _service$params === void 0 ? void 0 : _service$params.filter)])
|
|
122
124
|
})
|
|
123
125
|
}), {
|
|
124
126
|
manual: manual,
|
|
@@ -140,13 +142,13 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
|
|
|
140
142
|
}
|
|
141
143
|
}, [runDep]);
|
|
142
144
|
var onSearch = /*#__PURE__*/function () {
|
|
143
|
-
var
|
|
144
|
-
var _service$params2;
|
|
145
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(search) {
|
|
146
|
+
var _field$componentProps4, _field$componentProps5, _field$componentProps6, _service$params2;
|
|
145
147
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
146
148
|
while (1) switch (_context.prev = _context.next) {
|
|
147
149
|
case 0:
|
|
148
150
|
run({
|
|
149
|
-
filter: (0, _SharedFilterProvider.mergeFilter)([_defineProperty({}, fieldNames.label, _defineProperty({}, operator, search)), service === null || service === void 0 ? void 0 : (_service$params2 = service.params) === null || _service$params2 === void 0 ? void 0 : _service$params2.filter])
|
|
151
|
+
filter: (0, _SharedFilterProvider.mergeFilter)([_defineProperty({}, fieldNames.label, _defineProperty({}, operator, search)), ((_field$componentProps4 = field.componentProps) === null || _field$componentProps4 === void 0 ? void 0 : (_field$componentProps5 = _field$componentProps4.service) === null || _field$componentProps5 === void 0 ? void 0 : (_field$componentProps6 = _field$componentProps5.params) === null || _field$componentProps6 === void 0 ? void 0 : _field$componentProps6.filter) || (service === null || service === void 0 ? void 0 : (_service$params2 = service.params) === null || _service$params2 === void 0 ? void 0 : _service$params2.filter)])
|
|
150
152
|
});
|
|
151
153
|
case 1:
|
|
152
154
|
case "end":
|
|
@@ -155,32 +157,28 @@ var InternalRemoteSelect = (0, _react.connect)(function (props) {
|
|
|
155
157
|
}, _callee);
|
|
156
158
|
}));
|
|
157
159
|
return function onSearch(_x) {
|
|
158
|
-
return
|
|
160
|
+
return _ref.apply(this, arguments);
|
|
159
161
|
};
|
|
160
162
|
}();
|
|
161
163
|
var getOptionsByFieldNames = (0, _react2.useCallback)(function (item) {
|
|
162
164
|
return Object.keys(fieldNames).reduce(function (obj, key) {
|
|
163
|
-
var value = item[fieldNames[key]];
|
|
164
|
-
if (value) {
|
|
165
|
-
// support hidden, disabled, etc.
|
|
166
|
-
obj[['label', 'value', 'options'].includes(key) ? fieldNames[key] : key] = key === 'label' ? compile(value) : value;
|
|
167
|
-
}
|
|
168
165
|
return obj;
|
|
169
166
|
}, {});
|
|
170
167
|
}, [fieldNames]);
|
|
171
168
|
var normalizeOptions = (0, _react2.useCallback)(function (obj) {
|
|
172
|
-
var
|
|
169
|
+
var _ref3;
|
|
173
170
|
if (objectValue || _typeof(obj) === 'object') {
|
|
174
171
|
return getOptionsByFieldNames(obj);
|
|
175
172
|
}
|
|
176
|
-
return
|
|
173
|
+
return _ref3 = {}, _defineProperty(_ref3, fieldNames.value, obj), _defineProperty(_ref3, fieldNames.label, obj), _ref3;
|
|
177
174
|
}, [objectValue, getOptionsByFieldNames]);
|
|
178
175
|
var options = (0, _react2.useMemo)(function () {
|
|
179
176
|
var _data$data, _data$data2;
|
|
180
177
|
if (!(data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.length)) {
|
|
181
|
-
return value !== undefined && value !== null ? Array.isArray(value) ? value
|
|
178
|
+
return value !== undefined && value !== null ? Array.isArray(value) ? value : [value] : [];
|
|
182
179
|
}
|
|
183
|
-
|
|
180
|
+
var valueOptions = value !== undefined && value !== null && (Array.isArray(value) ? value : [value]) || [];
|
|
181
|
+
return (0, _lodash.uniqBy)((data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : _data$data2.concat(valueOptions)) || [], fieldNames.value);
|
|
184
182
|
}, [data === null || data === void 0 ? void 0 : data.data, getOptionsByFieldNames, normalizeOptions, value]);
|
|
185
183
|
var onDropdownVisibleChange = function onDropdownVisibleChange() {
|
|
186
184
|
if (firstRun.current) {
|
|
@@ -38,12 +38,13 @@ var useLabelFields = function useLabelFields(collectionName) {
|
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
40
|
var TableColumnDesigner = function TableColumnDesigner(props) {
|
|
41
|
-
var _fieldSchema$xCompon, _uiSchema$xComponent, _collectionField$targ, _collectionField$uiSc, _columnSchema$xCompo, _fieldSchema$xCompon2
|
|
41
|
+
var _fieldSchema$xCompon, _uiSchema$xComponent, _collectionField$targ, _collectionField$uiSc, _columnSchema$xCompo, _fieldSchema$xCompon2;
|
|
42
42
|
var uiSchema = props.uiSchema,
|
|
43
43
|
fieldSchema = props.fieldSchema,
|
|
44
44
|
collectionField = props.collectionField;
|
|
45
45
|
var _useCollectionManager2 = (0, _collectionManager.useCollectionManager)(),
|
|
46
|
-
getInterface = _useCollectionManager2.getInterface
|
|
46
|
+
getInterface = _useCollectionManager2.getInterface,
|
|
47
|
+
getCollection = _useCollectionManager2.getCollection;
|
|
47
48
|
var field = (0, _react.useField)();
|
|
48
49
|
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
49
50
|
t = _useTranslation.t;
|
|
@@ -53,6 +54,8 @@ var TableColumnDesigner = function TableColumnDesigner(props) {
|
|
|
53
54
|
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']);
|
|
54
55
|
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);
|
|
55
56
|
var intefaceCfg = getInterface(collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface);
|
|
57
|
+
var targetCollection = getCollection(collectionField === null || collectionField === void 0 ? void 0 : collectionField.target);
|
|
58
|
+
var isFileField = isFileCollection(targetCollection);
|
|
56
59
|
return /*#__PURE__*/_react2.default.createElement(_schemaSettings.GeneralSchemaDesigner, {
|
|
57
60
|
disableInitializer: true
|
|
58
61
|
}, /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.ModalItem, {
|
|
@@ -127,17 +130,20 @@ var TableColumnDesigner = function TableColumnDesigner(props) {
|
|
|
127
130
|
});
|
|
128
131
|
dn.refresh();
|
|
129
132
|
}
|
|
130
|
-
}), ['linkTo', 'm2m', 'm2o', 'o2m', 'obo', 'oho', 'snapshot', 'createdBy', 'updatedBy'].includes(collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface) && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.SwitchItem, {
|
|
133
|
+
}), ['linkTo', 'm2m', 'm2o', 'o2m', 'obo', 'oho', 'snapshot', 'createdBy', 'updatedBy'].includes(collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface) && !isFileField && /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.SwitchItem, {
|
|
131
134
|
title: t('Enable link'),
|
|
132
|
-
checked: ((_fieldSchema$xCompon2 =
|
|
135
|
+
checked: ((_fieldSchema$xCompon2 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon2 === void 0 ? void 0 : _fieldSchema$xCompon2.enableLink) !== false,
|
|
133
136
|
onChange: function onChange(flag) {
|
|
134
137
|
fieldSchema['x-component-props'] = _objectSpread(_objectSpread({}, fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema['x-component-props']), {}, {
|
|
135
|
-
|
|
138
|
+
enableLink: flag
|
|
139
|
+
});
|
|
140
|
+
field.componentProps = _objectSpread(_objectSpread({}, fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema['x-component-props']), {}, {
|
|
141
|
+
enableLink: flag
|
|
136
142
|
});
|
|
137
143
|
dn.emit('patch', {
|
|
138
144
|
schema: {
|
|
139
145
|
'x-uid': fieldSchema['x-uid'],
|
|
140
|
-
'x-component-props': _objectSpread({}, fieldSchema['x-component-props'])
|
|
146
|
+
'x-component-props': _objectSpread({}, fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema['x-component-props'])
|
|
141
147
|
}
|
|
142
148
|
});
|
|
143
149
|
dn.refresh();
|
|
@@ -147,8 +153,8 @@ var TableColumnDesigner = function TableColumnDesigner(props) {
|
|
|
147
153
|
options: options,
|
|
148
154
|
value: fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames['label'],
|
|
149
155
|
onChange: function onChange(label) {
|
|
150
|
-
var _collectionField$uiSc2, _fieldSchema$
|
|
151
|
-
var fieldNames = _objectSpread(_objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc2 = collectionField.uiSchema) === null || _collectionField$uiSc2 === void 0 ? void 0 : _collectionField$uiSc2['x-component-props']['fieldNames']), fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$
|
|
156
|
+
var _collectionField$uiSc2, _fieldSchema$xCompon3;
|
|
157
|
+
var fieldNames = _objectSpread(_objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc2 = collectionField.uiSchema) === null || _collectionField$uiSc2 === void 0 ? void 0 : _collectionField$uiSc2['x-component-props']['fieldNames']), fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon3 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon3 === void 0 ? void 0 : _fieldSchema$xCompon3['fieldNames']), {}, {
|
|
152
158
|
label: label
|
|
153
159
|
});
|
|
154
160
|
fieldSchema['x-component-props']['fieldNames'] = fieldNames;
|
|
@@ -173,4 +179,7 @@ var TableColumnDesigner = function TableColumnDesigner(props) {
|
|
|
173
179
|
}
|
|
174
180
|
}));
|
|
175
181
|
};
|
|
176
|
-
exports.TableColumnDesigner = TableColumnDesigner;
|
|
182
|
+
exports.TableColumnDesigner = TableColumnDesigner;
|
|
183
|
+
function isFileCollection(collection) {
|
|
184
|
+
return (collection === null || collection === void 0 ? void 0 : collection.template) === 'file';
|
|
185
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TableIndex: (props: any) => JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TableIndex = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _recordProvider = require("../../../record-provider");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
var TableIndex = function TableIndex(props) {
|
|
11
|
+
var recordIndex = (0, _recordProvider.useRecordIndex)();
|
|
12
|
+
return /*#__PURE__*/_react.default.createElement("div", null, recordIndex + 1);
|
|
13
|
+
};
|
|
14
|
+
exports.TableIndex = TableIndex;
|
|
@@ -44,9 +44,13 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
44
44
|
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; }
|
|
45
45
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
46
46
|
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); }
|
|
47
|
-
var
|
|
48
|
-
var _schema$reducePropert;
|
|
47
|
+
var useArrayField = function useArrayField(props) {
|
|
49
48
|
var field = (0, _react.useField)();
|
|
49
|
+
return props.field || field;
|
|
50
|
+
};
|
|
51
|
+
var useTableColumns = function useTableColumns(props) {
|
|
52
|
+
var _schema$reducePropert;
|
|
53
|
+
var field = useArrayField(props);
|
|
50
54
|
var schema = (0, _react.useFieldSchema)();
|
|
51
55
|
var _useACLFieldWhitelist = (0, _ACLProvider.useACLFieldWhitelist)(),
|
|
52
56
|
schemaInWhitelist = _useACLFieldWhitelist.schemaInWhitelist;
|
|
@@ -87,8 +91,8 @@ var useTableColumns = function useTableColumns() {
|
|
|
87
91
|
}, /*#__PURE__*/_react2.default.createElement(_2.RecordProvider, {
|
|
88
92
|
record: record
|
|
89
93
|
}, /*#__PURE__*/_react2.default.createElement(_react.RecursionField, {
|
|
94
|
+
basePath: field.address.concat(record.__index || index),
|
|
90
95
|
schema: s,
|
|
91
|
-
name: record.__index || index,
|
|
92
96
|
onlyRenderProperties: true
|
|
93
97
|
})));
|
|
94
98
|
}
|
|
@@ -188,8 +192,6 @@ var useValidator = function useValidator(validator) {
|
|
|
188
192
|
};
|
|
189
193
|
var Table = (0, _react.observer)(function (props) {
|
|
190
194
|
var _schema$parent, _schema$parent2, _field$data, _fieldSchema$parent, _fieldSchema$parent$x, _field$value4, _field$value4$slice;
|
|
191
|
-
var field = (0, _react.useField)();
|
|
192
|
-
var columns = useTableColumns();
|
|
193
195
|
var pagination1 = props.pagination,
|
|
194
196
|
useProps = props.useProps,
|
|
195
197
|
onChange = props.onChange,
|
|
@@ -210,6 +212,8 @@ var Table = (0, _react.observer)(function (props) {
|
|
|
210
212
|
required = _others1$others.required,
|
|
211
213
|
_onExpand = _others1$others.onExpand,
|
|
212
214
|
others = _objectWithoutProperties(_others1$others, _excluded3);
|
|
215
|
+
var field = useArrayField(others);
|
|
216
|
+
var columns = useTableColumns(others);
|
|
213
217
|
var schema = (0, _react.useFieldSchema)();
|
|
214
218
|
var isTableSelector = (schema === null || schema === void 0 ? void 0 : (_schema$parent = schema.parent) === null || _schema$parent === void 0 ? void 0 : _schema$parent['x-decorator']) === 'TableSelectorProvider';
|
|
215
219
|
var ctx = isTableSelector ? (0, _2.useTableSelectorContext)() : (0, _2.useTableBlockContext)();
|
|
@@ -13,6 +13,7 @@ var _Table3 = require("./Table.Column");
|
|
|
13
13
|
var _TableColumn = require("./Table.Column.ActionBar");
|
|
14
14
|
var _TableColumn2 = require("./Table.Column.Decorator");
|
|
15
15
|
var _TableColumn3 = require("./Table.Column.Designer");
|
|
16
|
+
var _Table4 = require("./Table.Index");
|
|
16
17
|
var _TableSelector = require("./TableSelector");
|
|
17
18
|
var _TableBlockDesigner = require("./TableBlockDesigner");
|
|
18
19
|
Object.keys(_TableBlockDesigner).forEach(function (key) {
|
|
@@ -57,4 +58,5 @@ TableV2.Column.ActionBar = _TableColumn.TableColumnActionBar;
|
|
|
57
58
|
TableV2.Column.Decorator = _TableColumn2.TableColumnDecorator;
|
|
58
59
|
TableV2.Column.Designer = _TableColumn3.TableColumnDesigner;
|
|
59
60
|
TableV2.ActionColumnDesigner = _Table2.TableActionColumnDesigner;
|
|
60
|
-
TableV2.Selector = _TableSelector.TableSelector;
|
|
61
|
+
TableV2.Selector = _TableSelector.TableSelector;
|
|
62
|
+
TableV2.Index = _Table4.TableIndex;
|
|
@@ -41,7 +41,7 @@ function getIdsWithChildren(nodes) {
|
|
|
41
41
|
var node = _step.value;
|
|
42
42
|
if (node.children && node.children.length > 0) {
|
|
43
43
|
ids.push(node.id);
|
|
44
|
-
ids.push.apply(ids, _toConsumableArray(getIdsWithChildren(node.children)));
|
|
44
|
+
ids.push.apply(ids, _toConsumableArray(getIdsWithChildren(node === null || node === void 0 ? void 0 : node.children)));
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
} catch (err) {
|