@nocobase/client 0.7.2-alpha.7 → 0.7.4-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/application/Application.d.ts +1 -0
- package/es/application/Application.js +7 -1
- package/es/block-provider/FormBlockProvider.js +15 -3
- package/es/block-provider/TableFieldProvider.d.ts +1 -0
- package/es/block-provider/TableFieldProvider.js +5 -2
- package/es/block-provider/TableSelectorProvider.js +42 -14
- package/es/block-provider/hooks/index.d.ts +6 -0
- package/es/block-provider/hooks/index.js +159 -65
- package/es/collection-manager/CollectionField.js +11 -4
- package/es/collection-manager/Configuration/AddFieldAction.js +6 -0
- package/es/collection-manager/Configuration/EditFieldAction.js +7 -0
- package/es/collection-manager/Configuration/index.js +5 -1
- package/es/collection-manager/Configuration/schemas/collections.js +2 -1
- package/es/collection-manager/interfaces/checkbox.js +1 -0
- package/es/collection-manager/interfaces/checkboxGroup.js +1 -0
- package/es/collection-manager/interfaces/datetime.js +1 -0
- package/es/collection-manager/interfaces/email.js +1 -0
- package/es/collection-manager/interfaces/icon.js +1 -0
- package/es/collection-manager/interfaces/input.js +104 -0
- package/es/collection-manager/interfaces/integer.js +64 -0
- package/es/collection-manager/interfaces/m2m.js +2 -0
- package/es/collection-manager/interfaces/m2o.js +1 -0
- package/es/collection-manager/interfaces/markdown.js +35 -0
- package/es/collection-manager/interfaces/multipleSelect.js +1 -0
- package/es/collection-manager/interfaces/number.js +56 -0
- package/es/collection-manager/interfaces/o2m.js +1 -0
- package/es/collection-manager/interfaces/o2o.js +3 -0
- package/es/collection-manager/interfaces/password.js +37 -1
- package/es/collection-manager/interfaces/percent.js +98 -0
- package/es/collection-manager/interfaces/phone.js +1 -0
- package/es/collection-manager/interfaces/properties/index.d.ts +1 -0
- package/es/collection-manager/interfaces/properties/index.js +1 -0
- package/es/collection-manager/interfaces/properties/operators.js +4 -4
- package/es/collection-manager/interfaces/radioGroup.js +1 -0
- package/es/collection-manager/interfaces/richText.js +35 -0
- package/es/collection-manager/interfaces/select.js +1 -0
- package/es/collection-manager/interfaces/textarea.js +35 -0
- package/es/collection-manager/interfaces/time.js +1 -0
- package/es/file-manager/FileStorageShortcut.js +2 -2
- package/es/locale/en_US.d.ts +8 -2
- package/es/locale/en_US.js +9 -3
- package/es/locale/zh_CN.d.ts +28 -2
- package/es/locale/zh_CN.js +29 -3
- package/es/plugin-manager/PluginManager.d.ts +1 -0
- package/es/plugin-manager/PluginManager.js +20 -6
- package/es/schema-component/antd/action/Action.Modal.js +1 -1
- package/es/schema-component/antd/calendar/Calendar.Designer.js +16 -10
- package/es/schema-component/antd/date-picker/DatePicker.d.ts +1 -1
- package/es/schema-component/antd/date-picker/DatePicker.js +1 -1
- package/es/schema-component/antd/date-picker/ReadPretty.js +1 -1
- package/es/schema-component/antd/date-picker/util.d.ts +0 -10
- package/es/schema-component/antd/date-picker/util.js +1 -79
- package/es/schema-component/antd/form-item/FormItem.js +193 -10
- package/es/schema-component/antd/grid/Grid.js +72 -6
- package/es/schema-component/antd/input-number/InputNumber.d.ts +1 -5
- package/es/schema-component/antd/input-number/InputNumber.js +25 -1
- package/es/schema-component/antd/input-number/ReadPretty.js +2 -4
- package/es/schema-component/antd/kanban/Kanban.Card.Designer.js +20 -14
- package/es/schema-component/antd/menu/Menu.js +6 -3
- package/es/schema-component/antd/percent/Percent.js +2 -2
- package/es/schema-component/antd/record-picker/InputRecordPicker.js +27 -13
- package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +5 -3
- package/es/schema-component/antd/table/Table.Array.js +2 -2
- package/es/schema-component/antd/table/Table.Void.js +11 -1
- package/es/schema-component/antd/table-v2/Table.Column.Designer.js +3 -1
- package/es/schema-component/antd/table-v2/Table.d.ts +0 -11
- package/es/schema-component/antd/table-v2/Table.js +163 -92
- package/es/schema-component/antd/table-v2/TableField.js +3 -0
- package/es/schema-component/antd/tabs/Tabs.Designer.js +23 -12
- package/es/schema-component/antd/tabs/Tabs.js +7 -1
- package/es/schema-component/antd/time-picker/ReadPretty.js +11 -5
- package/es/schema-component/core/DesignableSwitch.js +7 -1
- package/es/schema-component/hooks/useDesignable.js +21 -21
- package/es/schema-component/hooks/useProps.js +1 -1
- package/es/schema-initializer/buttons/FormItemInitializers.js +14 -3
- package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +8 -0
- package/es/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +14 -3
- package/es/schema-initializer/buttons/RecordBlockInitializers.js +32 -3
- package/es/schema-initializer/buttons/TabPaneInitializers.js +11 -3
- package/es/schema-initializer/buttons/TableActionInitializers.js +11 -0
- package/es/schema-initializer/components/assigned-field/AssignedField.d.ts +4 -0
- package/es/schema-initializer/components/assigned-field/AssignedField.js +255 -69
- package/es/schema-initializer/items/index.d.ts +2 -0
- package/es/schema-initializer/items/index.js +48 -2
- package/es/schema-initializer/utils.js +22 -2
- package/es/schema-settings/SchemaSettings.js +7 -0
- package/es/system-settings/SystemSettingsShortcut.js +35 -12
- package/lib/application/Application.d.ts +1 -0
- package/lib/application/Application.js +11 -2
- package/lib/block-provider/FormBlockProvider.js +15 -2
- package/lib/block-provider/TableFieldProvider.d.ts +1 -0
- package/lib/block-provider/TableFieldProvider.js +4 -1
- package/lib/block-provider/TableSelectorProvider.js +42 -14
- package/lib/block-provider/hooks/index.d.ts +6 -0
- package/lib/block-provider/hooks/index.js +168 -67
- package/lib/collection-manager/CollectionField.js +12 -4
- package/lib/collection-manager/Configuration/AddFieldAction.js +6 -0
- package/lib/collection-manager/Configuration/EditFieldAction.js +7 -0
- package/lib/collection-manager/Configuration/index.js +5 -0
- package/lib/collection-manager/Configuration/schemas/collections.js +2 -1
- package/lib/collection-manager/interfaces/checkbox.js +1 -0
- package/lib/collection-manager/interfaces/checkboxGroup.js +1 -0
- package/lib/collection-manager/interfaces/datetime.js +1 -0
- package/lib/collection-manager/interfaces/email.js +1 -0
- package/lib/collection-manager/interfaces/icon.js +1 -0
- package/lib/collection-manager/interfaces/input.js +105 -0
- package/lib/collection-manager/interfaces/integer.js +66 -0
- package/lib/collection-manager/interfaces/m2m.js +2 -0
- package/lib/collection-manager/interfaces/m2o.js +1 -0
- package/lib/collection-manager/interfaces/markdown.js +36 -0
- package/lib/collection-manager/interfaces/multipleSelect.js +1 -0
- package/lib/collection-manager/interfaces/number.js +57 -0
- package/lib/collection-manager/interfaces/o2m.js +1 -0
- package/lib/collection-manager/interfaces/o2o.js +3 -0
- package/lib/collection-manager/interfaces/password.js +38 -1
- package/lib/collection-manager/interfaces/percent.js +100 -0
- package/lib/collection-manager/interfaces/phone.js +1 -0
- package/lib/collection-manager/interfaces/properties/index.d.ts +1 -0
- package/lib/collection-manager/interfaces/properties/index.js +1 -0
- package/lib/collection-manager/interfaces/properties/operators.js +4 -4
- package/lib/collection-manager/interfaces/radioGroup.js +1 -0
- package/lib/collection-manager/interfaces/richText.js +36 -0
- package/lib/collection-manager/interfaces/select.js +1 -0
- package/lib/collection-manager/interfaces/textarea.js +36 -0
- package/lib/collection-manager/interfaces/time.js +1 -0
- package/lib/file-manager/FileStorageShortcut.js +1 -1
- package/lib/locale/en_US.d.ts +8 -2
- package/lib/locale/en_US.js +9 -3
- package/lib/locale/zh_CN.d.ts +28 -2
- package/lib/locale/zh_CN.js +29 -3
- package/lib/plugin-manager/PluginManager.d.ts +1 -0
- package/lib/plugin-manager/PluginManager.js +23 -5
- package/lib/schema-component/antd/action/Action.Modal.js +1 -1
- package/lib/schema-component/antd/calendar/Calendar.Designer.js +16 -10
- package/lib/schema-component/antd/date-picker/DatePicker.d.ts +1 -1
- package/lib/schema-component/antd/date-picker/DatePicker.js +2 -2
- package/lib/schema-component/antd/date-picker/ReadPretty.js +6 -6
- package/lib/schema-component/antd/date-picker/util.d.ts +0 -10
- package/lib/schema-component/antd/date-picker/util.js +6 -89
- package/lib/schema-component/antd/form-item/FormItem.js +196 -12
- package/lib/schema-component/antd/grid/Grid.js +69 -3
- package/lib/schema-component/antd/input-number/InputNumber.d.ts +1 -5
- package/lib/schema-component/antd/input-number/InputNumber.js +28 -1
- package/lib/schema-component/antd/input-number/ReadPretty.js +2 -5
- package/lib/schema-component/antd/kanban/Kanban.Card.Designer.js +20 -14
- package/lib/schema-component/antd/menu/Menu.js +6 -3
- package/lib/schema-component/antd/percent/Percent.js +2 -2
- package/lib/schema-component/antd/record-picker/InputRecordPicker.js +27 -12
- package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +4 -2
- package/lib/schema-component/antd/table/Table.Array.js +2 -2
- package/lib/schema-component/antd/table/Table.Void.js +11 -1
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +3 -1
- package/lib/schema-component/antd/table-v2/Table.d.ts +0 -11
- package/lib/schema-component/antd/table-v2/Table.js +172 -94
- package/lib/schema-component/antd/table-v2/TableField.js +3 -0
- package/lib/schema-component/antd/tabs/Tabs.Designer.js +23 -12
- package/lib/schema-component/antd/tabs/Tabs.js +8 -1
- package/lib/schema-component/antd/time-picker/ReadPretty.js +10 -3
- package/lib/schema-component/core/DesignableSwitch.js +8 -1
- package/lib/schema-component/hooks/useDesignable.js +21 -21
- package/lib/schema-component/hooks/useProps.js +1 -1
- package/lib/schema-initializer/buttons/FormItemInitializers.js +14 -2
- package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +8 -0
- package/lib/schema-initializer/buttons/ReadPrettyFormItemInitializers.js +14 -2
- package/lib/schema-initializer/buttons/RecordBlockInitializers.js +34 -4
- package/lib/schema-initializer/buttons/TabPaneInitializers.js +11 -3
- package/lib/schema-initializer/buttons/TableActionInitializers.js +11 -0
- package/lib/schema-initializer/components/assigned-field/AssignedField.d.ts +4 -0
- package/lib/schema-initializer/components/assigned-field/AssignedField.js +257 -66
- package/lib/schema-initializer/items/index.d.ts +2 -0
- package/lib/schema-initializer/items/index.js +54 -2
- package/lib/schema-initializer/utils.js +22 -2
- package/lib/schema-settings/SchemaSettings.js +7 -0
- package/lib/system-settings/SystemSettingsShortcut.js +37 -13
- package/package.json +7 -4
|
@@ -77,6 +77,25 @@ var KanbanCardDesigner = function KanbanCardDesigner(props) {
|
|
|
77
77
|
readPretty: true,
|
|
78
78
|
block: 'Kanban'
|
|
79
79
|
});
|
|
80
|
+
var associationFields = (0, _utils.useAssociatedFormItemInitializerFields)({
|
|
81
|
+
readPretty: true,
|
|
82
|
+
block: 'Kanban'
|
|
83
|
+
});
|
|
84
|
+
var items = [{
|
|
85
|
+
type: 'itemGroup',
|
|
86
|
+
title: t('Display fields'),
|
|
87
|
+
children: fields
|
|
88
|
+
}];
|
|
89
|
+
|
|
90
|
+
if (associationFields.length > 0) {
|
|
91
|
+
items.push({
|
|
92
|
+
type: 'divider'
|
|
93
|
+
}, {
|
|
94
|
+
type: 'itemGroup',
|
|
95
|
+
title: t('Display association fields'),
|
|
96
|
+
children: associationFields
|
|
97
|
+
});
|
|
98
|
+
}
|
|
80
99
|
|
|
81
100
|
if (!designable) {
|
|
82
101
|
return null;
|
|
@@ -113,20 +132,7 @@ var KanbanCardDesigner = function KanbanCardDesigner(props) {
|
|
|
113
132
|
dn.loadAPIClientEvents();
|
|
114
133
|
dn.insertBeforeEnd(schema);
|
|
115
134
|
},
|
|
116
|
-
items:
|
|
117
|
-
type: 'itemGroup',
|
|
118
|
-
title: t('Display fields'),
|
|
119
|
-
children: fields
|
|
120
|
-
}, {
|
|
121
|
-
type: 'divider'
|
|
122
|
-
}, {
|
|
123
|
-
type: 'itemGroup',
|
|
124
|
-
title: t('Display association fields'),
|
|
125
|
-
children: (0, _utils.useAssociatedFormItemInitializerFields)({
|
|
126
|
-
readPretty: true,
|
|
127
|
-
block: 'Kanban'
|
|
128
|
-
})
|
|
129
|
-
}],
|
|
135
|
+
items: items,
|
|
130
136
|
component: /*#__PURE__*/_react2.default.createElement(_icons.MenuOutlined, {
|
|
131
137
|
style: {
|
|
132
138
|
cursor: 'pointer',
|
|
@@ -34,7 +34,7 @@ var _excluded = ["onSelect", "mode", "selectedUid", "defaultSelectedUid", "sideM
|
|
|
34
34
|
_excluded3 = ["icon"],
|
|
35
35
|
_excluded4 = ["icon"];
|
|
36
36
|
|
|
37
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
37
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
38
38
|
|
|
39
39
|
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); }
|
|
40
40
|
|
|
@@ -299,6 +299,7 @@ Menu.Item = (0, _react.observer)(function (props) {
|
|
|
299
299
|
var field = (0, _react.useField)();
|
|
300
300
|
var Designer = (0, _react2.useContext)(MenuItemDesignerContext);
|
|
301
301
|
return /*#__PURE__*/_react2.default.createElement(_antd.Menu.Item, _objectSpread(_objectSpread({}, others), {}, {
|
|
302
|
+
className: (0, _css.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n :active {\n background: inherit;\n }\n "]))),
|
|
302
303
|
key: schema.name,
|
|
303
304
|
eventKey: schema.name,
|
|
304
305
|
schema: schema
|
|
@@ -307,7 +308,7 @@ Menu.Item = (0, _react.observer)(function (props) {
|
|
|
307
308
|
}, /*#__PURE__*/_react2.default.createElement(_2.Icon, {
|
|
308
309
|
type: icon
|
|
309
310
|
}), /*#__PURE__*/_react2.default.createElement("span", {
|
|
310
|
-
className: (0, _css.css)(
|
|
311
|
+
className: (0, _css.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n overflow: hidden;\n text-overflow: ellipsis;\n display: inline-block;\n width: 100%;\n vertical-align: middle;\n "])))
|
|
311
312
|
}, field.title), /*#__PURE__*/_react2.default.createElement(Designer, null)));
|
|
312
313
|
});
|
|
313
314
|
Menu.URL = (0, _react.observer)(function (props) {
|
|
@@ -318,6 +319,7 @@ Menu.URL = (0, _react.observer)(function (props) {
|
|
|
318
319
|
var field = (0, _react.useField)();
|
|
319
320
|
var Designer = (0, _react2.useContext)(MenuItemDesignerContext);
|
|
320
321
|
return /*#__PURE__*/_react2.default.createElement(_antd.Menu.Item, _objectSpread(_objectSpread({}, others), {}, {
|
|
322
|
+
className: (0, _css.css)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n :active {\n background: inherit;\n }\n "]))),
|
|
321
323
|
key: schema.name,
|
|
322
324
|
eventKey: schema.name,
|
|
323
325
|
schema: schema,
|
|
@@ -329,7 +331,7 @@ Menu.URL = (0, _react.observer)(function (props) {
|
|
|
329
331
|
}, /*#__PURE__*/_react2.default.createElement(_2.Icon, {
|
|
330
332
|
type: icon
|
|
331
333
|
}), /*#__PURE__*/_react2.default.createElement("span", {
|
|
332
|
-
className: (0, _css.css)(
|
|
334
|
+
className: (0, _css.css)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n overflow: hidden;\n text-overflow: ellipsis;\n display: inline-block;\n width: 100%;\n vertical-align: middle;\n "])))
|
|
333
335
|
}, field.title), /*#__PURE__*/_react2.default.createElement(Designer, null)));
|
|
334
336
|
});
|
|
335
337
|
Menu.SubMenu = (0, _react.observer)(function (props) {
|
|
@@ -346,6 +348,7 @@ Menu.SubMenu = (0, _react.observer)(function (props) {
|
|
|
346
348
|
}
|
|
347
349
|
|
|
348
350
|
return /*#__PURE__*/_react2.default.createElement(_antd.Menu.SubMenu, _objectSpread(_objectSpread({}, others), {}, {
|
|
351
|
+
className: (0, _css.css)(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n :active {\n background: inherit;\n }\n "]))),
|
|
349
352
|
key: schema.name,
|
|
350
353
|
eventKey: schema.name,
|
|
351
354
|
title: /*#__PURE__*/_react2.default.createElement(_.SortableItem, {
|
|
@@ -34,10 +34,10 @@ var Percent = (0, _react.connect)(function (props) {
|
|
|
34
34
|
_onChange = props.onChange;
|
|
35
35
|
return /*#__PURE__*/_react2.default.createElement(_antd.InputNumber, _objectSpread(_objectSpread({}, props), {}, {
|
|
36
36
|
addonAfter: "%",
|
|
37
|
-
value: math.round(value * 100, 9),
|
|
37
|
+
value: value ? math.round(value * 100, 9) : null,
|
|
38
38
|
onChange: function onChange(v) {
|
|
39
39
|
if (_onChange) {
|
|
40
|
-
_onChange(math.round(v / 100, 9));
|
|
40
|
+
_onChange(v ? math.round(v / 100, 9) : null);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
}));
|
|
@@ -11,6 +11,8 @@ var _react = require("@formily/react");
|
|
|
11
11
|
|
|
12
12
|
var _antd = require("antd");
|
|
13
13
|
|
|
14
|
+
var _lodash = require("lodash");
|
|
15
|
+
|
|
14
16
|
var _react2 = _interopRequireWildcard(require("react"));
|
|
15
17
|
|
|
16
18
|
var _TableSelectorProvider = require("../../../block-provider/TableSelectorProvider");
|
|
@@ -57,31 +59,44 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
57
59
|
var RecordPickerContext = /*#__PURE__*/(0, _react2.createContext)(null);
|
|
58
60
|
|
|
59
61
|
var useTableSelectorProps = function useTableSelectorProps() {
|
|
62
|
+
var field = (0, _react.useField)();
|
|
63
|
+
|
|
60
64
|
var _useContext = (0, _react2.useContext)(RecordPickerContext),
|
|
61
65
|
multiple = _useContext.multiple,
|
|
62
66
|
value = _useContext.value,
|
|
63
67
|
setSelectedRows = _useContext.setSelectedRows,
|
|
64
|
-
|
|
68
|
+
rcSelectRows = _useContext.selectedRows;
|
|
65
69
|
|
|
66
70
|
var _useTsp = (0, _TableSelectorProvider.useTableSelectorProps)(),
|
|
67
71
|
_onRowSelectionChange = _useTsp.onRowSelectionChange,
|
|
68
72
|
rowKey = _useTsp.rowKey,
|
|
69
|
-
others = _objectWithoutProperties(_useTsp, _excluded);
|
|
73
|
+
others = _objectWithoutProperties(_useTsp, _excluded); // console.log('useTableSelectorProps', field.value, value);
|
|
74
|
+
|
|
70
75
|
|
|
71
76
|
return _objectSpread(_objectSpread({}, others), {}, {
|
|
72
77
|
rowKey: rowKey,
|
|
73
78
|
rowSelection: {
|
|
74
79
|
type: multiple ? 'checkbox' : 'radio',
|
|
75
|
-
defaultSelectedRowKeys:
|
|
76
|
-
|
|
77
|
-
}),
|
|
78
|
-
selectedRowKeys: selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.map(function (item) {
|
|
80
|
+
// defaultSelectedRowKeys: rcSelectRows?.map((item) => item[rowKey||'id']),
|
|
81
|
+
selectedRowKeys: rcSelectRows === null || rcSelectRows === void 0 ? void 0 : rcSelectRows.map(function (item) {
|
|
79
82
|
return item[rowKey || 'id'];
|
|
80
83
|
})
|
|
81
84
|
},
|
|
82
85
|
onRowSelectionChange: function onRowSelectionChange(selectedRowKeys, selectedRows) {
|
|
83
|
-
|
|
84
|
-
|
|
86
|
+
if (multiple) {
|
|
87
|
+
var scopeRows = field.value || [];
|
|
88
|
+
var allSelectedRows = rcSelectRows || [];
|
|
89
|
+
var otherRows = (0, _lodash.differenceBy)(allSelectedRows, scopeRows, rowKey || 'id');
|
|
90
|
+
var unionSelectedRows = (0, _lodash.unionBy)(otherRows, selectedRows, rowKey || 'id');
|
|
91
|
+
var unionSelectedRowKeys = unionSelectedRows.map(function (item) {
|
|
92
|
+
return item[rowKey || 'id'];
|
|
93
|
+
});
|
|
94
|
+
setSelectedRows === null || setSelectedRows === void 0 ? void 0 : setSelectedRows(unionSelectedRows);
|
|
95
|
+
_onRowSelectionChange === null || _onRowSelectionChange === void 0 ? void 0 : _onRowSelectionChange(unionSelectedRowKeys, unionSelectedRows);
|
|
96
|
+
} else {
|
|
97
|
+
setSelectedRows === null || setSelectedRows === void 0 ? void 0 : setSelectedRows(selectedRows);
|
|
98
|
+
_onRowSelectionChange === null || _onRowSelectionChange === void 0 ? void 0 : _onRowSelectionChange(selectedRowKeys, selectedRows);
|
|
99
|
+
}
|
|
85
100
|
}
|
|
86
101
|
});
|
|
87
102
|
};
|
|
@@ -159,13 +174,13 @@ var InputRecordPicker = function InputRecordPicker(props) {
|
|
|
159
174
|
setSelectedRows(opts);
|
|
160
175
|
}
|
|
161
176
|
}, [value]);
|
|
162
|
-
(0, _react2.useEffect)(function () {});
|
|
163
177
|
|
|
164
178
|
var getValue = function getValue() {
|
|
165
|
-
if (multiple == null) return null;
|
|
166
|
-
|
|
179
|
+
if (multiple == null) return null; // console.log('getValue', multiple, value, Array.isArray(value));
|
|
180
|
+
|
|
181
|
+
return Array.isArray(value) ? value === null || value === void 0 ? void 0 : value.map(function (v) {
|
|
167
182
|
return v[fieldNames.value];
|
|
168
|
-
}) :
|
|
183
|
+
}) : value === null || value === void 0 ? void 0 : value[fieldNames.value];
|
|
169
184
|
};
|
|
170
185
|
|
|
171
186
|
return /*#__PURE__*/_react2.default.createElement("div", null, /*#__PURE__*/_react2.default.createElement(_antd.Select, _objectSpread(_objectSpread({}, others), {}, {
|
|
@@ -81,7 +81,9 @@ var ReadPrettyRecordPicker = (0, _react.observer)(function (props) {
|
|
|
81
81
|
|
|
82
82
|
var renderRecords = function renderRecords() {
|
|
83
83
|
return (0, _shared.toArr)(field.value).map(function (record, index, arr) {
|
|
84
|
-
return /*#__PURE__*/_react2.default.createElement(_react2.
|
|
84
|
+
return /*#__PURE__*/_react2.default.createElement(_react2.Fragment, {
|
|
85
|
+
key: "".concat(record.id, "_").concat(index)
|
|
86
|
+
}, /*#__PURE__*/_react2.default.createElement("span", null, /*#__PURE__*/_react2.default.createElement("a", {
|
|
85
87
|
onClick: function onClick(e) {
|
|
86
88
|
var _ellipsisWithTooltipR;
|
|
87
89
|
|
|
@@ -91,7 +93,7 @@ var ReadPrettyRecordPicker = (0, _react.observer)(function (props) {
|
|
|
91
93
|
setRecord(record);
|
|
92
94
|
ellipsisWithTooltipRef === null || ellipsisWithTooltipRef === void 0 ? void 0 : (_ellipsisWithTooltipR = ellipsisWithTooltipRef.current) === null || _ellipsisWithTooltipR === void 0 ? void 0 : _ellipsisWithTooltipR.setPopoverVisible(false);
|
|
93
95
|
}
|
|
94
|
-
}, compile(record === null || record === void 0 ? void 0 : record[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label) || 'label']))), index < arr.length - 1 ? /*#__PURE__*/_react2.default.createElement("span", {
|
|
96
|
+
}, compile(record === null || record === void 0 ? void 0 : record[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label) || 'label']) || (record === null || record === void 0 ? void 0 : record[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value) || 'value']) || (record === null || record === void 0 ? void 0 : record.id))), index < arr.length - 1 ? /*#__PURE__*/_react2.default.createElement("span", {
|
|
95
97
|
style: {
|
|
96
98
|
marginRight: 4,
|
|
97
99
|
color: '#aaa'
|
|
@@ -94,8 +94,8 @@ var useTableColumns = function useTableColumns() {
|
|
|
94
94
|
render: function render(v, record) {
|
|
95
95
|
var _field$value;
|
|
96
96
|
|
|
97
|
-
var index = (_field$value = field.value) === null || _field$value === void 0 ? void 0 : _field$value.indexOf(record);
|
|
98
|
-
|
|
97
|
+
var index = (_field$value = field.value) === null || _field$value === void 0 ? void 0 : _field$value.indexOf(record); // console.log((Date.now() - start) / 1000);
|
|
98
|
+
|
|
99
99
|
return /*#__PURE__*/_react2.default.createElement(_2.RecordIndexProvider, {
|
|
100
100
|
index: index
|
|
101
101
|
}, /*#__PURE__*/_react2.default.createElement(_2.RecordProvider, {
|
|
@@ -32,7 +32,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
32
32
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
33
33
|
|
|
34
34
|
var usePaginationProps = function usePaginationProps(props, service) {
|
|
35
|
-
var _props$request, _props$request$params;
|
|
35
|
+
var _props$request, _props$request$params, _service$data;
|
|
36
36
|
|
|
37
37
|
if (props.pagination === false) {
|
|
38
38
|
return false;
|
|
@@ -46,6 +46,16 @@ var usePaginationProps = function usePaginationProps(props, service) {
|
|
|
46
46
|
pagination.defaultPageSize = props === null || props === void 0 ? void 0 : (_props$request2 = props.request) === null || _props$request2 === void 0 ? void 0 : (_props$request2$param = _props$request2.params) === null || _props$request2$param === void 0 ? void 0 : _props$request2$param.pageSize;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
if (!pagination.total && (service === null || service === void 0 ? void 0 : (_service$data = service.data) === null || _service$data === void 0 ? void 0 : _service$data.meta)) {
|
|
50
|
+
var _service$data$meta = service.data.meta,
|
|
51
|
+
count = _service$data$meta.count,
|
|
52
|
+
page = _service$data$meta.page,
|
|
53
|
+
pageSize = _service$data$meta.pageSize;
|
|
54
|
+
pagination.total = count;
|
|
55
|
+
pagination.current = page;
|
|
56
|
+
pagination.pageSize = pageSize;
|
|
57
|
+
}
|
|
58
|
+
|
|
49
59
|
return _objectSpread(_objectSpread({
|
|
50
60
|
showSizeChanger: true
|
|
51
61
|
}, pagination), {}, {
|
|
@@ -128,7 +128,9 @@ var TableColumnDesigner = function TableColumnDesigner(props) {
|
|
|
128
128
|
options: options,
|
|
129
129
|
value: fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames['label'],
|
|
130
130
|
onChange: function onChange(label) {
|
|
131
|
-
var
|
|
131
|
+
var _collectionField$uiSc2, _fieldSchema$xCompon2;
|
|
132
|
+
|
|
133
|
+
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$xCompon2 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon2 === void 0 ? void 0 : _fieldSchema$xCompon2['fieldNames']), {}, {
|
|
132
134
|
label: label
|
|
133
135
|
});
|
|
134
136
|
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
export declare const components: {
|
|
2
|
-
header: {
|
|
3
|
-
wrapper: (props: any) => JSX.Element;
|
|
4
|
-
cell: (props: any) => JSX.Element;
|
|
5
|
-
};
|
|
6
|
-
body: {
|
|
7
|
-
wrapper: (props: any) => JSX.Element;
|
|
8
|
-
row: (props: any) => JSX.Element;
|
|
9
|
-
cell: (props: any) => JSX.Element;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
1
|
export declare const Table: any;
|