@nocobase/client 0.10.0-alpha.2 → 0.10.0-alpha.4
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/MenuItemsProvider.js +3 -3
- package/es/application/Application.js +2 -2
- package/es/auth/SigninPage.js +12 -9
- package/es/block-provider/GanttBlockProvider.js +5 -4
- package/es/block-provider/TableBlockProvider.d.ts +1 -0
- package/es/block-provider/TableBlockProvider.js +51 -17
- package/es/collection-manager/Configuration/AddCollectionAction.js +31 -25
- package/es/collection-manager/Configuration/AddFieldAction.js +45 -32
- package/es/collection-manager/Configuration/AddSubFieldAction.js +24 -19
- package/es/collection-manager/Configuration/ConfigurationTabs.js +57 -50
- package/es/collection-manager/hooks/useOptions.js +39 -36
- package/es/collection-manager/interfaces/integer.js +1 -1
- package/es/collection-manager/interfaces/number.js +3 -3
- package/es/collection-manager/interfaces/percent.js +3 -3
- package/es/formula/Expression.js +66 -46
- package/es/hooks/index.d.ts +1 -0
- package/es/hooks/index.js +1 -0
- package/es/hooks/useAdminSchemaUid.d.ts +1 -0
- package/es/hooks/useAdminSchemaUid.js +6 -0
- package/es/hooks/useMenuItem.d.ts +37 -0
- package/es/hooks/useMenuItem.js +93 -0
- package/es/index.d.ts +2 -3
- package/es/index.js +3 -4
- package/es/locale/en_US.d.ts +3 -1
- package/es/locale/en_US.js +4 -2
- package/es/locale/es_ES.d.ts +1 -1
- package/es/locale/es_ES.js +1 -1
- package/es/locale/ja_JP.d.ts +3 -1
- package/es/locale/ja_JP.js +4 -2
- package/es/locale/pt_BR.d.ts +1 -1
- package/es/locale/pt_BR.js +1 -1
- package/es/locale/ru_RU.d.ts +1 -1
- package/es/locale/ru_RU.js +1 -1
- package/es/locale/zh_CN.d.ts +3 -1
- package/es/locale/zh_CN.js +3 -1
- package/es/pm/Card.js +5 -5
- package/es/pm/PluginManagerLink.js +16 -12
- package/es/pm/index.d.ts +2 -1
- package/es/pm/index.js +36 -22
- package/es/route-switch/antd/admin-layout/index.js +5 -5
- package/es/schema-component/antd/action/Action.Designer.js +3 -5
- package/es/schema-component/antd/action/Action.Drawer.js +1 -1
- package/es/schema-component/antd/action/ActionBar.js +1 -1
- package/es/schema-component/antd/association-field/Editable.js +1 -2
- package/es/schema-component/antd/association-field/Nester.js +7 -1
- package/es/schema-component/antd/association-field/SubTable.js +1 -1
- package/es/schema-component/antd/calendar/DeleteEvent.js +1 -1
- package/es/schema-component/antd/cascader/Cascader.js +1 -1
- package/es/schema-component/antd/form-item/FormItem.js +10 -3
- package/es/schema-component/antd/form-v2/Form.js +2 -2
- package/es/schema-component/antd/gantt/components/gantt/gantt.js +0 -1
- package/es/schema-component/antd/gantt/components/grid/grid-body.js +3 -3
- package/es/schema-component/antd/gantt/components/task-item/bar/bar-small.js +1 -1
- package/es/schema-component/antd/gantt/components/task-item/task-item.js +1 -1
- package/es/schema-component/antd/gantt/helpers/bar-helper.d.ts +1 -1
- package/es/schema-component/antd/gantt/helpers/bar-helper.js +4 -4
- package/es/schema-component/antd/gantt/helpers/other-helper.js +3 -1
- package/es/schema-component/antd/grid/Grid.js +2 -2
- package/es/schema-component/antd/grid-card/GridCard.Designer.js +3 -4
- package/es/schema-component/antd/grid-card/GridCard.Item.js +3 -3
- package/es/schema-component/antd/index.less +1 -3
- package/es/schema-component/antd/list/List.Decorator.js +3 -3
- package/es/schema-component/antd/list/List.Item.js +2 -2
- package/es/schema-component/antd/list/List.d.ts +2 -2
- package/es/schema-component/antd/list/List.js +6 -6
- package/es/schema-component/antd/menu/Menu.js +306 -156
- package/es/schema-component/antd/page/Page.js +29 -23
- package/es/schema-component/antd/remote-select/RemoteSelect.js +60 -10
- package/es/schema-component/antd/remote-select/utils.d.ts +4 -0
- package/es/schema-component/antd/remote-select/utils.js +31 -0
- package/es/schema-component/antd/table-v2/FilterDynamicComponent.js +17 -2
- package/es/schema-component/antd/table-v2/Table.Column.Designer.js +51 -12
- package/es/schema-component/antd/table-v2/Table.js +28 -47
- package/es/schema-component/antd/table-v2/utils.d.ts +0 -1
- package/es/schema-component/antd/table-v2/utils.js +0 -28
- package/es/schema-component/antd/tabs/Tabs.js +35 -22
- package/es/schema-component/antd/tabs/context.d.ts +1 -1
- package/es/schema-component/antd/upload/ReadPretty.js +7 -3
- package/es/schema-component/antd/variable/VariableSelect.js +1 -1
- package/es/schema-component/common/utils/uitls.d.ts +1 -0
- package/es/schema-component/common/utils/uitls.js +1 -1
- package/es/schema-initializer/SchemaInitializer.d.ts +7 -2
- package/es/schema-initializer/SchemaInitializer.js +158 -103
- package/es/schema-initializer/SelectCollection.d.ts +1 -2
- package/es/schema-initializer/SelectCollection.js +19 -16
- package/es/schema-initializer/buttons/TableActionColumnInitializers.js +1 -1
- package/es/schema-initializer/buttons/TableActionInitializers.js +5 -5
- package/es/schema-initializer/buttons/TableColumnInitializers.js +3 -2
- package/es/schema-initializer/components/CreateRecordAction.js +37 -27
- package/es/schema-initializer/components/assigned-field/AssignedField.js +2 -1
- package/es/schema-initializer/items/CalendarBlockInitializer.js +2 -2
- package/es/schema-initializer/utils.d.ts +0 -1
- package/es/schema-initializer/utils.js +40 -25
- package/es/schema-settings/SchemaSettings.js +110 -29
- package/es/schema-settings/VariableInput/hooks/useFormVariable.d.ts +19 -0
- package/es/schema-settings/VariableInput/hooks/useFormVariable.js +89 -0
- package/es/schema-settings/VariableInput/hooks/useIterationVariable.d.ts +8 -0
- package/es/schema-settings/VariableInput/hooks/useIterationVariable.js +77 -0
- package/es/schema-settings/VariableInput/hooks/useVariableOptions.d.ts +5 -12
- package/es/schema-settings/VariableInput/hooks/useVariableOptions.js +19 -3
- package/es/schema-templates/BlockTemplateDetails.js +5 -1
- package/es/schema-templates/BlockTemplatePage.js +4 -1
- package/es/user/ChangePassword.d.ts +1 -2
- package/es/user/ChangePassword.js +30 -26
- package/es/user/CurrentUser.js +172 -141
- package/es/user/EditProfile.d.ts +1 -2
- package/es/user/EditProfile.js +30 -24
- package/es/user/LanguageSettings.d.ts +1 -2
- package/es/user/LanguageSettings.js +67 -64
- package/es/user/SigninPage.js +25 -22
- package/es/user/SwitchRole.d.ts +1 -2
- package/es/user/SwitchRole.js +54 -49
- package/es/user/ThemeSettings.d.ts +1 -2
- package/es/user/ThemeSettings.js +56 -52
- package/lib/acl/Configuration/MenuItemsProvider.js +3 -3
- package/lib/application/Application.js +2 -2
- package/lib/auth/SigninPage.js +25 -22
- package/lib/block-provider/GanttBlockProvider.js +5 -4
- package/lib/block-provider/TableBlockProvider.d.ts +1 -0
- package/lib/block-provider/TableBlockProvider.js +53 -17
- package/lib/collection-manager/Configuration/AddCollectionAction.js +29 -23
- package/lib/collection-manager/Configuration/AddFieldAction.js +43 -30
- package/lib/collection-manager/Configuration/AddSubFieldAction.js +22 -17
- package/lib/collection-manager/Configuration/ConfigurationTabs.js +57 -49
- package/lib/collection-manager/hooks/useOptions.js +39 -36
- package/lib/collection-manager/interfaces/integer.js +1 -1
- package/lib/collection-manager/interfaces/number.js +3 -3
- package/lib/collection-manager/interfaces/percent.js +3 -3
- package/lib/formula/Expression.js +64 -44
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.js +11 -0
- package/lib/hooks/useAdminSchemaUid.d.ts +1 -0
- package/lib/hooks/useAdminSchemaUid.js +13 -0
- package/lib/hooks/useMenuItem.d.ts +37 -0
- package/lib/hooks/useMenuItem.js +108 -0
- package/lib/index.d.ts +2 -3
- package/lib/index.js +22 -33
- package/lib/locale/en_US.d.ts +3 -1
- package/lib/locale/en_US.js +4 -2
- package/lib/locale/es_ES.d.ts +1 -1
- package/lib/locale/es_ES.js +1 -1
- package/lib/locale/ja_JP.d.ts +3 -1
- package/lib/locale/ja_JP.js +4 -2
- package/lib/locale/pt_BR.d.ts +1 -1
- package/lib/locale/pt_BR.js +1 -1
- package/lib/locale/ru_RU.d.ts +1 -1
- package/lib/locale/ru_RU.js +1 -1
- package/lib/locale/zh_CN.d.ts +3 -1
- package/lib/locale/zh_CN.js +3 -1
- package/lib/pm/Card.js +6 -6
- package/lib/pm/PluginManagerLink.js +15 -10
- package/lib/pm/index.d.ts +2 -1
- package/lib/pm/index.js +37 -23
- package/lib/route-switch/antd/admin-layout/index.js +4 -4
- package/lib/schema-component/antd/action/Action.Designer.js +2 -4
- package/lib/schema-component/antd/action/Action.Drawer.js +1 -1
- package/lib/schema-component/antd/association-field/Editable.js +0 -1
- package/lib/schema-component/antd/association-field/Nester.js +6 -0
- package/lib/schema-component/antd/association-field/SubTable.js +1 -1
- package/lib/schema-component/antd/calendar/DeleteEvent.js +1 -1
- package/lib/schema-component/antd/cascader/Cascader.js +1 -1
- package/lib/schema-component/antd/form-item/FormItem.js +10 -3
- package/lib/schema-component/antd/form-v2/Form.js +2 -2
- package/lib/schema-component/antd/gantt/components/gantt/gantt.js +0 -1
- package/lib/schema-component/antd/gantt/components/grid/grid-body.js +2 -2
- package/lib/schema-component/antd/gantt/components/task-item/bar/bar-small.js +1 -1
- package/lib/schema-component/antd/gantt/components/task-item/task-item.js +1 -1
- package/lib/schema-component/antd/gantt/helpers/bar-helper.d.ts +1 -1
- package/lib/schema-component/antd/gantt/helpers/bar-helper.js +4 -4
- package/lib/schema-component/antd/gantt/helpers/other-helper.js +3 -1
- package/lib/schema-component/antd/grid/Grid.js +1 -1
- package/lib/schema-component/antd/grid-card/GridCard.Designer.js +4 -5
- package/lib/schema-component/antd/grid-card/GridCard.Item.js +8 -8
- package/lib/schema-component/antd/index.less +1 -3
- package/lib/schema-component/antd/list/List.Decorator.js +3 -3
- package/lib/schema-component/antd/list/List.Item.js +6 -6
- package/lib/schema-component/antd/list/List.d.ts +2 -2
- package/lib/schema-component/antd/list/List.js +24 -24
- package/lib/schema-component/antd/menu/Menu.js +304 -154
- package/lib/schema-component/antd/page/Page.js +29 -23
- package/lib/schema-component/antd/remote-select/RemoteSelect.js +57 -7
- package/lib/schema-component/antd/remote-select/utils.d.ts +4 -0
- package/lib/schema-component/antd/remote-select/utils.js +41 -0
- package/lib/schema-component/antd/table-v2/FilterDynamicComponent.js +17 -2
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +50 -11
- package/lib/schema-component/antd/table-v2/Table.js +26 -45
- package/lib/schema-component/antd/table-v2/utils.d.ts +0 -1
- package/lib/schema-component/antd/table-v2/utils.js +0 -29
- package/lib/schema-component/antd/tabs/Tabs.js +34 -21
- package/lib/schema-component/antd/tabs/context.d.ts +1 -1
- package/lib/schema-component/antd/upload/ReadPretty.js +7 -3
- package/lib/schema-component/antd/variable/VariableSelect.js +1 -1
- package/lib/schema-component/common/utils/uitls.d.ts +1 -0
- package/lib/schema-component/common/utils/uitls.js +3 -1
- package/lib/schema-initializer/SchemaInitializer.d.ts +7 -2
- package/lib/schema-initializer/SchemaInitializer.js +155 -101
- package/lib/schema-initializer/SelectCollection.d.ts +1 -2
- package/lib/schema-initializer/SelectCollection.js +22 -17
- package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +1 -1
- package/lib/schema-initializer/buttons/TableActionInitializers.js +5 -5
- package/lib/schema-initializer/buttons/TableColumnInitializers.js +2 -1
- package/lib/schema-initializer/components/CreateRecordAction.js +35 -25
- package/lib/schema-initializer/components/assigned-field/AssignedField.js +2 -1
- package/lib/schema-initializer/items/CalendarBlockInitializer.js +9 -9
- package/lib/schema-initializer/utils.d.ts +0 -1
- package/lib/schema-initializer/utils.js +41 -25
- package/lib/schema-settings/SchemaSettings.js +106 -27
- package/lib/schema-settings/VariableInput/hooks/useFormVariable.d.ts +19 -0
- package/lib/schema-settings/VariableInput/hooks/useFormVariable.js +96 -0
- package/lib/schema-settings/VariableInput/hooks/useIterationVariable.d.ts +8 -0
- package/lib/schema-settings/VariableInput/hooks/useIterationVariable.js +84 -0
- package/lib/schema-settings/VariableInput/hooks/useVariableOptions.d.ts +5 -12
- package/lib/schema-settings/VariableInput/hooks/useVariableOptions.js +19 -3
- package/lib/schema-templates/BlockTemplateDetails.js +5 -1
- package/lib/schema-templates/BlockTemplatePage.js +5 -2
- package/lib/user/ChangePassword.d.ts +1 -2
- package/lib/user/ChangePassword.js +30 -26
- package/lib/user/CurrentUser.js +166 -135
- package/lib/user/EditProfile.d.ts +1 -2
- package/lib/user/EditProfile.js +31 -25
- package/lib/user/LanguageSettings.d.ts +1 -2
- package/lib/user/LanguageSettings.js +66 -63
- package/lib/user/SigninPage.js +25 -22
- package/lib/user/SwitchRole.d.ts +1 -2
- package/lib/user/SwitchRole.js +57 -51
- package/lib/user/ThemeSettings.d.ts +1 -2
- package/lib/user/ThemeSettings.js +59 -54
- package/package.json +9 -8
- package/es/settings-form/SettingsForm.d.ts +0 -13
- package/es/settings-form/SettingsForm.js +0 -309
- package/es/settings-form/index.d.ts +0 -1
- package/es/settings-form/index.js +0 -1
- package/lib/settings-form/SettingsForm.d.ts +0 -13
- package/lib/settings-form/SettingsForm.js +0 -320
- package/lib/settings-form/index.d.ts +0 -1
- package/lib/settings-form/index.js +0 -16
|
@@ -95,6 +95,7 @@ FormItem.Designer = function Designer() {
|
|
|
95
95
|
getField = _useCollection.getField;
|
|
96
96
|
var _useFormBlockContext = (0, _FormBlockProvider.useFormBlockContext)(),
|
|
97
97
|
form = _useFormBlockContext.form;
|
|
98
|
+
var ctx = (0, _BlockProvider.useBlockRequestContext)();
|
|
98
99
|
var field = (0, _react.useField)();
|
|
99
100
|
var fieldSchema = (0, _react.useFieldSchema)();
|
|
100
101
|
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
@@ -411,12 +412,15 @@ FormItem.Designer = function Designer() {
|
|
|
411
412
|
properties: {
|
|
412
413
|
filter: {
|
|
413
414
|
default: defaultFilter,
|
|
414
|
-
// title: '数据范围',
|
|
415
415
|
enum: dataSource,
|
|
416
416
|
'x-component': 'Filter',
|
|
417
417
|
'x-component-props': {
|
|
418
418
|
dynamicComponent: function dynamicComponent(props) {
|
|
419
|
-
return (0, _FilterDynamicComponent.FilterDynamicComponent)(_objectSpread({}, props)
|
|
419
|
+
return (0, _FilterDynamicComponent.FilterDynamicComponent)(_objectSpread(_objectSpread({}, props), {}, {
|
|
420
|
+
form: form,
|
|
421
|
+
collectionField: collectionField,
|
|
422
|
+
rootCollection: ctx.props.collection || ctx.props.resource
|
|
423
|
+
}));
|
|
420
424
|
}
|
|
421
425
|
}
|
|
422
426
|
}
|
|
@@ -428,7 +432,6 @@ FormItem.Designer = function Designer() {
|
|
|
428
432
|
filter = (0, _filter.removeNullCondition)(filter);
|
|
429
433
|
_lodash.default.set(field.componentProps, 'service.params.filter', filter);
|
|
430
434
|
fieldSchema['x-component-props'] = field.componentProps;
|
|
431
|
-
field.componentProps = field.componentProps;
|
|
432
435
|
dn.emit('patch', {
|
|
433
436
|
schema: (_schema5 = {}, _defineProperty(_schema5, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema5, 'x-component-props', field.componentProps), _schema5)
|
|
434
437
|
});
|
|
@@ -790,6 +793,10 @@ FormItem.Designer = function Designer() {
|
|
|
790
793
|
function isFileCollection(collection) {
|
|
791
794
|
return (collection === null || collection === void 0 ? void 0 : collection.template) === 'file';
|
|
792
795
|
}
|
|
796
|
+
function extractFirstPart(path) {
|
|
797
|
+
var firstDotIndex = path.indexOf('.');
|
|
798
|
+
return firstDotIndex !== -1 ? path.slice(0, firstDotIndex) : path;
|
|
799
|
+
}
|
|
793
800
|
FormItem.FilterFormDesigner = _FormItem.FilterFormDesigner;
|
|
794
801
|
function getFieldDefaultValue(fieldSchema, collectionField) {
|
|
795
802
|
var _fieldSchema$default, _collectionField$uiSc5;
|
|
@@ -171,7 +171,7 @@ var WithForm = function WithForm(props) {
|
|
|
171
171
|
form.removeEffects(id);
|
|
172
172
|
};
|
|
173
173
|
}, [linkageRules]);
|
|
174
|
-
return fieldSchema['x-decorator'] === '
|
|
174
|
+
return fieldSchema['x-decorator'] === 'FormV2' ? /*#__PURE__*/_react2.default.createElement(FormDecorator, _objectSpread({}, props)) : /*#__PURE__*/_react2.default.createElement(FormComponent, _objectSpread({}, props));
|
|
175
175
|
};
|
|
176
176
|
var WithoutForm = function WithoutForm(props) {
|
|
177
177
|
var fieldSchema = (0, _react.useFieldSchema)();
|
|
@@ -187,7 +187,7 @@ var WithoutForm = function WithoutForm(props) {
|
|
|
187
187
|
}
|
|
188
188
|
});
|
|
189
189
|
}, []);
|
|
190
|
-
return fieldSchema['x-decorator'] === '
|
|
190
|
+
return fieldSchema['x-decorator'] === 'FormV2' ? /*#__PURE__*/_react2.default.createElement(FormDecorator, _objectSpread({
|
|
191
191
|
form: form
|
|
192
192
|
}, props)) : /*#__PURE__*/_react2.default.createElement(FormComponent, _objectSpread({
|
|
193
193
|
form: form
|
|
@@ -247,7 +247,6 @@ var Gantt = function Gantt(props) {
|
|
|
247
247
|
(0, _react2.useEffect)(function () {
|
|
248
248
|
tableCtx.field.onExpandClick = handleTableExpanderClick;
|
|
249
249
|
tableCtx.field.onRowSelect = handleRowSelect;
|
|
250
|
-
tableCtx.setExpandFlag(true);
|
|
251
250
|
}, []);
|
|
252
251
|
(0, _react2.useEffect)(function () {
|
|
253
252
|
expandAndCollapseAll === null || expandAndCollapseAll === void 0 ? void 0 : expandAndCollapseAll(!expandFlag);
|
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.GridBody = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
7
|
var _css = require("@emotion/css");
|
|
8
|
+
var _client = require("@nocobase/utils/client");
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _dateHelper = require("../../helpers/date-helper");
|
|
10
11
|
var _style = require("./style");
|
|
11
|
-
var _client = require("@nocobase/utils/client");
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
14
14
|
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); }
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.BarSmall = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
7
|
var _css = require("@emotion/css");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _barHelper = require("../../../helpers/bar-helper");
|
|
10
10
|
var _barDisplay = require("./bar-display");
|
|
11
11
|
var _barProgressHandle = require("./bar-progress-handle");
|
|
@@ -109,6 +109,6 @@ var TaskItem = function TaskItem(props) {
|
|
|
109
109
|
y: isProjectBar ? task.y - 8 : isTextInside ? task.y + taskHeight * 0.5 : task.y + taskHeight * 0.65,
|
|
110
110
|
className: isProjectBar ? (0, _css.cx)(_style.projectLabel) : isTextInside ? (0, _css.cx)(_style.barLabel) : (0, _css.cx)(_style.barLabel) && (0, _css.cx)(_style.barLabelOutside),
|
|
111
111
|
ref: textRef
|
|
112
|
-
}, isProjectBar ? "".concat(task.name, ":
|
|
112
|
+
}, isProjectBar && (0, _otherHelper.getYmd)(task.start) && (0, _otherHelper.getYmd)(task.end) ? "".concat(task.name, ": ").concat((0, _otherHelper.getYmd)(task.start), " ~ ").concat((0, _otherHelper.getYmd)(task.end)) : task.name));
|
|
113
113
|
};
|
|
114
114
|
exports.TaskItem = TaskItem;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Task } from '../types/public-types';
|
|
2
1
|
import { BarTask } from '../types/bar-task';
|
|
3
2
|
import { BarMoveAction } from '../types/gantt-task-actions';
|
|
3
|
+
import { Task } from '../types/public-types';
|
|
4
4
|
export declare const convertToBarTasks: (tasks: Task[], dates: Date[], columnWidth: number, rowHeight: number, taskHeight: number, barCornerRadius: number, handleWidth: number, rtl: boolean, barProgressColor: string, barProgressSelectedColor: string, barBackgroundColor: string, barBackgroundSelectedColor: string, projectProgressColor: string, projectProgressSelectedColor: string, projectBackgroundColor: string, projectBackgroundSelectedColor: string, milestoneBackgroundColor: string, milestoneBackgroundSelectedColor: string) => BarTask[];
|
|
5
5
|
export declare const progressWithByParams: (taskX1: number, taskX2: number, progress: number, rtl: boolean) => number[];
|
|
6
6
|
export declare const progressByProgressWidth: (progressWidth: number, barTask: BarTask) => number;
|
|
@@ -65,7 +65,7 @@ var convertToBar = function convertToBar(task, index, dates, columnWidth, rowHei
|
|
|
65
65
|
var typeInternal = task.type;
|
|
66
66
|
if (typeInternal === 'task' && x2 - x1 < handleWidth * 2) {
|
|
67
67
|
typeInternal = 'smalltask';
|
|
68
|
-
x2 = x1 + handleWidth * 2;
|
|
68
|
+
x2 = x1 > 0 ? x1 + handleWidth * 2 : x1;
|
|
69
69
|
}
|
|
70
70
|
var _progressWithByParams = progressWithByParams(x1, x2, task.progress, rtl),
|
|
71
71
|
_progressWithByParams2 = _slicedToArray(_progressWithByParams, 2),
|
|
@@ -133,16 +133,16 @@ var taskXCoordinate = function taskXCoordinate(xDate, dates, columnWidth) {
|
|
|
133
133
|
var remainderMillis = (xDate === null || xDate === void 0 ? void 0 : xDate.getTime()) - ((_dates$index = dates[index]) === null || _dates$index === void 0 ? void 0 : _dates$index.getTime());
|
|
134
134
|
var percentOfInterval = remainderMillis / (((_dates = dates[index + 1]) === null || _dates === void 0 ? void 0 : _dates.getTime()) - ((_dates$index2 = dates[index]) === null || _dates$index2 === void 0 ? void 0 : _dates$index2.getTime()));
|
|
135
135
|
var x = index * columnWidth + percentOfInterval * columnWidth;
|
|
136
|
-
return x;
|
|
136
|
+
return isNaN(x) ? 0 : x;
|
|
137
137
|
};
|
|
138
138
|
var taskXCoordinateRTL = function taskXCoordinateRTL(xDate, dates, columnWidth) {
|
|
139
139
|
var x = taskXCoordinate(xDate, dates, columnWidth);
|
|
140
140
|
x += columnWidth;
|
|
141
|
-
return x;
|
|
141
|
+
return isNaN(x) ? 0 : x;
|
|
142
142
|
};
|
|
143
143
|
var taskYCoordinate = function taskYCoordinate(index, rowHeight, taskHeight) {
|
|
144
144
|
var y = index * rowHeight + (rowHeight - taskHeight) / 2;
|
|
145
|
-
return y;
|
|
145
|
+
return isNaN(y) ? 0 : y;
|
|
146
146
|
};
|
|
147
147
|
var progressWithByParams = function progressWithByParams(taskX1, taskX2, progress, rtl) {
|
|
148
148
|
var progressWidth = (taskX2 - taskX1) * progress * 0.01;
|
|
@@ -73,6 +73,8 @@ var sortTasks = function sortTasks(taskA, taskB) {
|
|
|
73
73
|
};
|
|
74
74
|
exports.sortTasks = sortTasks;
|
|
75
75
|
var getYmd = function getYmd(date) {
|
|
76
|
-
|
|
76
|
+
if (!isNaN(date.getTime())) {
|
|
77
|
+
return date.getFullYear() + '/' + "".concat(date.getMonth() + 1) + '/' + date.getDate();
|
|
78
|
+
}
|
|
77
79
|
};
|
|
78
80
|
exports.getYmd = getYmd;
|
|
@@ -353,7 +353,7 @@ Grid.Row = (0, _react.observer)(function () {
|
|
|
353
353
|
cols: cols
|
|
354
354
|
}
|
|
355
355
|
}, /*#__PURE__*/_react2.default.createElement("div", {
|
|
356
|
-
className: (0, _classnames.default)('nb-grid-row', (0, _css.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n
|
|
356
|
+
className: (0, _classnames.default)('nb-grid-row', (0, _css.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n position: relative;\n /* z-index: 0; */\n "])))),
|
|
357
357
|
style: {
|
|
358
358
|
margin: showDivider ? '0 calc(-1 * var(--nb-spacing))' : null
|
|
359
359
|
}
|
|
@@ -4,30 +4,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.GridCardDesigner = void 0;
|
|
7
|
-
var _react = require("@formily/react");
|
|
8
|
-
var _react2 = _interopRequireWildcard(require("react"));
|
|
9
7
|
var _antd = require("@formily/antd");
|
|
8
|
+
var _react = require("@formily/react");
|
|
10
9
|
var _antd2 = require("antd");
|
|
11
10
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
11
|
+
var _react2 = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _reactI18next = require("react-i18next");
|
|
13
13
|
var _collectionManager = require("../../../collection-manager");
|
|
14
14
|
var _schemaSettings = require("../../../schema-settings");
|
|
15
15
|
var _schemaTemplates = require("../../../schema-templates");
|
|
16
|
+
var _core = require("../../core");
|
|
16
17
|
var _hooks = require("../../hooks");
|
|
17
18
|
var _filter = require("../filter");
|
|
18
19
|
var _FilterDynamicComponent = require("../table-v2/FilterDynamicComponent");
|
|
19
|
-
var _core = require("../../core");
|
|
20
20
|
var _options = require("./options");
|
|
21
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
21
|
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); }
|
|
23
22
|
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; }
|
|
23
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
24
|
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); }
|
|
25
25
|
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; }
|
|
26
26
|
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; }
|
|
27
27
|
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; }
|
|
28
28
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
29
29
|
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); }
|
|
30
|
-
_antd2.Slider;
|
|
31
30
|
var columnCountMarks = [1, 2, 3, 4, 6, 8, 12, 24].reduce(function (obj, cur) {
|
|
32
31
|
obj[cur] = cur;
|
|
33
32
|
return obj;
|
|
@@ -4,22 +4,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.GridCardItem = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _antd = require("antd");
|
|
9
7
|
var _css = require("@emotion/css");
|
|
10
|
-
var
|
|
8
|
+
var _react = require("@formily/react");
|
|
9
|
+
var _antd = require("antd");
|
|
10
|
+
var _react2 = _interopRequireDefault(require("react"));
|
|
11
11
|
var _recordProvider = require("../../../record-provider");
|
|
12
12
|
var _templateObject, _templateObject2;
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
15
15
|
var itemCss = (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n width: 100%;\n height: 100%;\n flex-direction: column;\n justify-content: space-between;\n gap: 8px;\n"])));
|
|
16
16
|
var GridCardItem = function GridCardItem(props) {
|
|
17
|
-
var field = (0,
|
|
18
|
-
return /*#__PURE__*/
|
|
19
|
-
className: (0, _css.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n
|
|
20
|
-
}, /*#__PURE__*/
|
|
17
|
+
var field = (0, _react.useField)();
|
|
18
|
+
return /*#__PURE__*/_react2.default.createElement(_antd.Card, {
|
|
19
|
+
className: (0, _css.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: 100%;\n > .ant-card-body {\n padding: 24px 24px 0px;\n height: 100%;\n }\n .nb-action-bar button {\n margin-bottom: 10px;\n }\n "])))
|
|
20
|
+
}, /*#__PURE__*/_react2.default.createElement("div", {
|
|
21
21
|
className: itemCss
|
|
22
|
-
}, /*#__PURE__*/
|
|
22
|
+
}, /*#__PURE__*/_react2.default.createElement(_recordProvider.RecordSimpleProvider, {
|
|
23
23
|
value: field.value
|
|
24
24
|
}, props.children)));
|
|
25
25
|
};
|
|
@@ -42,7 +42,5 @@
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
html body {
|
|
45
|
-
--adm-font-family: -apple-system,
|
|
46
|
-
Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji,
|
|
47
|
-
Segoe UI Symbol;
|
|
45
|
+
--adm-font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
|
|
48
46
|
}
|
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.useListItemProps = exports.useListBlockContext = exports.ListBlockProvider = exports.ListBlockContext = void 0;
|
|
8
|
+
var _css = require("@emotion/css");
|
|
9
|
+
var _antd = require("@formily/antd");
|
|
8
10
|
var _core = require("@formily/core");
|
|
9
11
|
var _react = require("@formily/react");
|
|
10
|
-
var _css = require("@emotion/css");
|
|
11
12
|
var _react2 = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _antd = require("@formily/antd");
|
|
13
13
|
var _blockProvider = require("../../../block-provider");
|
|
14
14
|
var _templateObject;
|
|
15
15
|
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); }
|
|
@@ -49,7 +49,7 @@ var InternalListBlockProvider = function InternalListBlockProvider(props) {
|
|
|
49
49
|
}, /*#__PURE__*/_react2.default.createElement(_antd.FormLayout, {
|
|
50
50
|
layout: 'vertical'
|
|
51
51
|
}, /*#__PURE__*/_react2.default.createElement("div", {
|
|
52
|
-
className: (0, _css.cx)((0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ant-description-input {\n line-height: 34px;\n }\n .ant-formily-item-feedback-layout-loose {\n
|
|
52
|
+
className: (0, _css.cx)((0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ant-description-input {\n line-height: 34px;\n }\n .ant-formily-item-feedback-layout-loose {\n display: inline;\n }\n "]))))
|
|
53
53
|
}, props.children))));
|
|
54
54
|
};
|
|
55
55
|
var ListBlockProvider = function ListBlockProvider(props) {
|
|
@@ -4,19 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ListItem = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
7
|
var _css = require("@emotion/css");
|
|
9
|
-
var
|
|
8
|
+
var _react = require("@formily/react");
|
|
9
|
+
var _react2 = _interopRequireDefault(require("react"));
|
|
10
10
|
var _recordProvider = require("../../../record-provider");
|
|
11
11
|
var _templateObject;
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
14
|
-
var itemCss = (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n width: 100%;\n flex-direction: column;\n // gap: 8px;\n padding: 5px 0;\n border-bottom: 1px solid #f0f0f0;\n"])));
|
|
14
|
+
var itemCss = (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n width: 100%;\n flex-direction: column;\n // gap: 8px;\n padding: 4px 5px 0;\n border-bottom: 1px solid #f0f0f0;\n"])));
|
|
15
15
|
var ListItem = function ListItem(props) {
|
|
16
|
-
var field = (0,
|
|
17
|
-
return /*#__PURE__*/
|
|
16
|
+
var field = (0, _react.useField)();
|
|
17
|
+
return /*#__PURE__*/_react2.default.createElement("div", {
|
|
18
18
|
className: itemCss
|
|
19
|
-
}, /*#__PURE__*/
|
|
19
|
+
}, /*#__PURE__*/_react2.default.createElement(_recordProvider.RecordSimpleProvider, {
|
|
20
20
|
value: field.value
|
|
21
21
|
}, props.children));
|
|
22
22
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ListDesigner } from './List.Designer';
|
|
2
|
-
import { ListBlockProvider } from './List.Decorator';
|
|
3
1
|
import React from 'react';
|
|
2
|
+
import { ListBlockProvider } from './List.Decorator';
|
|
3
|
+
import { ListDesigner } from './List.Designer';
|
|
4
4
|
import { ListItem } from './List.Item';
|
|
5
5
|
export declare const List: ((props: any) => React.JSX.Element) & {
|
|
6
6
|
Item: typeof ListItem;
|
|
@@ -5,16 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.List = void 0;
|
|
8
|
-
var _List = require("./List.Designer");
|
|
9
|
-
var _List2 = require("./List.Decorator");
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _react2 = require("@formily/react");
|
|
12
8
|
var _css = require("@emotion/css");
|
|
9
|
+
var _react = require("@formily/react");
|
|
13
10
|
var _antd = require("antd");
|
|
14
|
-
var
|
|
11
|
+
var _react2 = _interopRequireWildcard(require("react"));
|
|
15
12
|
var _common = require("../../common");
|
|
16
13
|
var _core = require("../../core");
|
|
17
|
-
var
|
|
14
|
+
var _hooks = require("../../hooks");
|
|
15
|
+
var _hooks2 = require("./hooks");
|
|
16
|
+
var _List = require("./List.Decorator");
|
|
17
|
+
var _List2 = require("./List.Designer");
|
|
18
18
|
var _List3 = require("./List.Item");
|
|
19
19
|
var _templateObject;
|
|
20
20
|
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); }
|
|
@@ -31,43 +31,43 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
31
31
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
32
32
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
33
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
34
|
-
var designerCss = (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n margin-bottom: var(--nb-spacing);\n &:hover {\n > .general-schema-designer {\n display: block;\n }\n }\n\n > .general-schema-designer {\n position: absolute;\n z-index: 999;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: none;\n background: rgba(241, 139, 98, 0.06);\n border: 0;\n pointer-events: none;\n > .general-schema-designer-icons {\n position: absolute;\n right: 2px;\n top: 2px;\n line-height: 16px;\n pointer-events: all;\n .ant-space-item {\n background-color: #f18b62;\n color: #fff;\n line-height: 16px;\n width: 16px;\n padding-left: 1px;\n }\n }\n }\n"])));
|
|
34
|
+
var designerCss = (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n margin-bottom: var(--nb-spacing);\n .nb-action-bar {\n margin-top: 10px;\n }\n &:hover {\n > .general-schema-designer {\n display: block;\n }\n }\n\n > .general-schema-designer {\n position: absolute;\n z-index: 999;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: none;\n background: rgba(241, 139, 98, 0.06);\n border: 0;\n pointer-events: none;\n > .general-schema-designer-icons {\n position: absolute;\n right: 2px;\n top: 2px;\n line-height: 16px;\n pointer-events: all;\n .ant-space-item {\n background-color: #f18b62;\n color: #fff;\n line-height: 16px;\n width: 16px;\n padding-left: 1px;\n }\n }\n }\n"])));
|
|
35
35
|
var InternalList = function InternalList(props) {
|
|
36
36
|
var _service$data, _field$value;
|
|
37
|
-
var _useListBlockContext = (0,
|
|
37
|
+
var _useListBlockContext = (0, _List.useListBlockContext)(),
|
|
38
38
|
service = _useListBlockContext.service;
|
|
39
39
|
var run = service.run,
|
|
40
40
|
params = service.params;
|
|
41
|
-
var fieldSchema = (0,
|
|
42
|
-
var Designer = (0,
|
|
41
|
+
var fieldSchema = (0, _react.useFieldSchema)();
|
|
42
|
+
var Designer = (0, _hooks.useDesigner)();
|
|
43
43
|
var meta = service === null || service === void 0 ? void 0 : (_service$data = service.data) === null || _service$data === void 0 ? void 0 : _service$data.meta;
|
|
44
|
-
var field = (0,
|
|
45
|
-
var _useState = (0,
|
|
44
|
+
var field = (0, _react.useField)();
|
|
45
|
+
var _useState = (0, _react2.useState)(new Map()),
|
|
46
46
|
_useState2 = _slicedToArray(_useState, 1),
|
|
47
47
|
schemaMap = _useState2[0];
|
|
48
|
-
var getSchema = (0,
|
|
48
|
+
var getSchema = (0, _react2.useCallback)(function (key) {
|
|
49
49
|
if (!schemaMap.has(key)) {
|
|
50
|
-
schemaMap.set(key, new
|
|
50
|
+
schemaMap.set(key, new _react.Schema({
|
|
51
51
|
type: 'object',
|
|
52
52
|
properties: _defineProperty({}, key, fieldSchema.properties['item'])
|
|
53
53
|
}));
|
|
54
54
|
}
|
|
55
55
|
return schemaMap.get(key);
|
|
56
56
|
}, [fieldSchema.properties, schemaMap]);
|
|
57
|
-
var onPaginationChange = (0,
|
|
57
|
+
var onPaginationChange = (0, _react2.useCallback)(function (page, pageSize) {
|
|
58
58
|
run(_objectSpread(_objectSpread({}, params === null || params === void 0 ? void 0 : params[0]), {}, {
|
|
59
59
|
page: page,
|
|
60
60
|
pageSize: pageSize
|
|
61
61
|
}));
|
|
62
62
|
}, [run, params]);
|
|
63
|
-
return /*#__PURE__*/
|
|
63
|
+
return /*#__PURE__*/_react2.default.createElement(_core.SchemaComponentOptions, {
|
|
64
64
|
scope: {
|
|
65
|
-
useListItemProps:
|
|
66
|
-
useListActionBarProps:
|
|
65
|
+
useListItemProps: _List.useListItemProps,
|
|
66
|
+
useListActionBarProps: _hooks2.useListActionBarProps
|
|
67
67
|
}
|
|
68
|
-
}, /*#__PURE__*/
|
|
68
|
+
}, /*#__PURE__*/_react2.default.createElement(_common.SortableItem, {
|
|
69
69
|
className: (0, _css.cx)('nb-list', designerCss)
|
|
70
|
-
}, /*#__PURE__*/
|
|
70
|
+
}, /*#__PURE__*/_react2.default.createElement(_antd.List, {
|
|
71
71
|
pagination: !meta || meta.count <= meta.pageSize ? false : {
|
|
72
72
|
onChange: onPaginationChange,
|
|
73
73
|
total: (meta === null || meta === void 0 ? void 0 : meta.count) || 0,
|
|
@@ -76,17 +76,17 @@ var InternalList = function InternalList(props) {
|
|
|
76
76
|
},
|
|
77
77
|
loading: service === null || service === void 0 ? void 0 : service.loading
|
|
78
78
|
}, (_field$value = field.value) === null || _field$value === void 0 ? void 0 : _field$value.map(function (item, index) {
|
|
79
|
-
return /*#__PURE__*/
|
|
79
|
+
return /*#__PURE__*/_react2.default.createElement(_react.RecursionField, {
|
|
80
80
|
basePath: field.address,
|
|
81
81
|
key: index,
|
|
82
82
|
name: index,
|
|
83
83
|
onlyRenderProperties: true,
|
|
84
84
|
schema: getSchema(index)
|
|
85
85
|
});
|
|
86
|
-
})), /*#__PURE__*/
|
|
86
|
+
})), /*#__PURE__*/_react2.default.createElement(Designer, null)));
|
|
87
87
|
};
|
|
88
88
|
var List = InternalList;
|
|
89
89
|
exports.List = List;
|
|
90
90
|
List.Item = _List3.ListItem;
|
|
91
|
-
List.Designer =
|
|
92
|
-
List.Decorator =
|
|
91
|
+
List.Designer = _List2.ListDesigner;
|
|
92
|
+
List.Decorator = _List.ListBlockProvider;
|