@tachybase/client 1.3.24 → 1.4.0
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/api-client/APIClient.mjs +21 -4
- package/es/application/components/AppComponent.mjs +3 -1
- package/es/application/utils/globalDeps.mjs +1 -0
- package/es/built-in/acl/ACLProvider.mjs +3 -1
- package/es/built-in/index.mjs +2 -2
- package/es/built-in/pm/PluginManager.mjs +51 -8
- package/es/built-in/system-version/SystemVersion.provider.mjs +52 -5
- package/es/collection-manager/Configuration/AddFieldAction.mjs +1 -1
- package/es/collection-manager/Configuration/ImportXlsx/xlsxFieldsConfigure.mjs +0 -1
- package/es/common/appInfo/CurrentAppInfoProvider.d.ts +4 -1
- package/es/modules/blocks/data-blocks/table/hooks/useTableBlockProps.mjs +2 -1
- package/es/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.d.ts +9 -0
- package/es/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.mjs +35 -2
- package/es/schema-component/antd/action/Action.Area.mjs +2 -2
- package/es/schema-component/antd/action/Action.Area.style.d.ts +1 -0
- package/es/schema-component/antd/action/Action.Area.style.mjs +12 -1
- package/es/schema-component/antd/action/types.d.ts +1 -0
- package/es/schema-component/antd/association-field/InternalNester.mjs +2 -2
- package/es/schema-component/antd/association-field/InternalSubTable.mjs +2 -2
- package/es/schema-component/antd/association-field/SubTable.mjs +24 -3
- package/es/schema-component/antd/association-field/hooks.mjs +6 -2
- package/es/schema-component/antd/icon-picker/IconFilterInput.mjs +3 -2
- package/es/schema-component/antd/icon-picker/index.d.ts +2 -0
- package/es/schema-component/antd/icon-picker/index.mjs +2 -0
- package/es/schema-component/antd/menu/Menu.mjs +1 -1
- package/es/schema-component/antd/page/Page.mjs +1 -1
- package/es/schema-component/antd/page/Page.style.mjs +3 -3
- package/es/schema-component/antd/page/components/AddTabForm.d.ts +1 -0
- package/es/schema-component/antd/page/components/AddTabForm.mjs +35 -0
- package/es/schema-component/antd/table-v2/Table.mjs +3 -2
- package/es/schema-component/antd/table-v2/Table.styles.mjs +1 -1
- package/es/schema-component/common/sortable-item/DragHandlePageTab.mjs +11 -46
- package/es/schema-component/common/sortable-item/DragHandlePageTab.style.mjs +1 -1
- package/es/schema-component/hooks/useDesignable.d.ts +5 -5
- package/es/schema-component/hooks/useDesignable.mjs +18 -18
- package/es/user/CurrentUser.mjs +11 -3
- package/lib/api-client/APIClient.js +21 -4
- package/lib/application/components/AppComponent.js +3 -1
- package/lib/application/utils/globalDeps.js +2 -1
- package/lib/block-provider/hooks/index.js +2 -2
- package/lib/built-in/acl/ACLProvider.js +3 -1
- package/lib/built-in/index.js +11 -11
- package/lib/built-in/pm/PluginManager.js +51 -8
- package/lib/built-in/system-version/SystemVersion.provider.js +52 -5
- package/lib/collection-manager/Configuration/AddFieldAction.js +1 -1
- package/lib/collection-manager/Configuration/ImportXlsx/xlsxFieldsConfigure.js +0 -1
- package/lib/locale/en_US.js +9 -0
- package/lib/locale/es_ES.js +4 -0
- package/lib/locale/fr_FR.js +4 -0
- package/lib/locale/ja_JP.js +4 -0
- package/lib/locale/ko_KR.js +4 -0
- package/lib/locale/pt_BR.js +4 -0
- package/lib/locale/ru_RU.js +4 -0
- package/lib/locale/tr_TR.js +4 -0
- package/lib/locale/uk_UA.js +4 -0
- package/lib/locale/zh-CN.js +10 -1
- package/lib/locale/zh-TW.js +4 -0
- package/lib/modules/blocks/data-blocks/table/hooks/useTableBlockProps.js +2 -1
- package/lib/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.js +39 -3
- package/lib/schema-component/antd/action/Action.Area.js +2 -2
- package/lib/schema-component/antd/action/Action.Area.style.js +12 -1
- package/lib/schema-component/antd/association-field/InternalNester.js +2 -2
- package/lib/schema-component/antd/association-field/InternalSubTable.js +2 -2
- package/lib/schema-component/antd/association-field/SubTable.js +22 -1
- package/lib/schema-component/antd/association-field/hooks.js +6 -2
- package/lib/schema-component/antd/icon-picker/IconFilterInput.js +3 -2
- package/lib/schema-component/antd/icon-picker/index.js +18 -0
- package/lib/schema-component/antd/menu/Menu.js +1 -1
- package/lib/schema-component/antd/page/Page.js +1 -1
- package/lib/schema-component/antd/page/Page.style.js +3 -3
- package/lib/schema-component/antd/page/components/AddTabForm.js +69 -0
- package/lib/schema-component/antd/table-v2/Table.js +3 -2
- package/lib/schema-component/antd/table-v2/Table.styles.js +1 -1
- package/lib/schema-component/common/sortable-item/DragHandlePageTab.js +10 -45
- package/lib/schema-component/common/sortable-item/DragHandlePageTab.style.js +1 -1
- package/lib/schema-component/hooks/useDesignable.js +18 -18
- package/lib/user/CurrentUser.js +11 -3
- package/package.json +7 -7
|
@@ -27,7 +27,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
27
|
clickToSelect: ()=>clickToSelect,
|
|
28
28
|
subTablePopoverComponentFieldSettings: ()=>subTablePopoverComponentFieldSettings,
|
|
29
29
|
allowAddNewData: ()=>allowAddNewData,
|
|
30
|
-
setDefaultSortingRules: ()=>setDefaultSortingRules
|
|
30
|
+
setDefaultSortingRules: ()=>setDefaultSortingRules,
|
|
31
|
+
tablePagination: ()=>tablePagination
|
|
31
32
|
});
|
|
32
33
|
const external_react_namespaceObject = require("react");
|
|
33
34
|
const schema_namespaceObject = require("@tachybase/schema");
|
|
@@ -426,6 +427,38 @@ const clickToSelect = {
|
|
|
426
427
|
};
|
|
427
428
|
}
|
|
428
429
|
};
|
|
430
|
+
const tablePagination = {
|
|
431
|
+
name: 'tablePagination',
|
|
432
|
+
type: 'switch',
|
|
433
|
+
useComponentProps () {
|
|
434
|
+
var _fieldSchema_xcomponentprops;
|
|
435
|
+
const { dn } = (0, external_schema_component_index_js_namespaceObject.useDesignable)();
|
|
436
|
+
const fieldSchema = (0, schema_namespaceObject.useFieldSchema)();
|
|
437
|
+
const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
|
|
438
|
+
const field = (0, schema_namespaceObject.useField)();
|
|
439
|
+
return {
|
|
440
|
+
title: t('Pagination'),
|
|
441
|
+
checked: (null == (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) ? void 0 : _fieldSchema_xcomponentprops.pagination) || false,
|
|
442
|
+
onChange (v) {
|
|
443
|
+
if (!fieldSchema['x-component-props'].pagination) fieldSchema['x-component-props'] = {
|
|
444
|
+
...fieldSchema['x-component-props'],
|
|
445
|
+
pagination: false
|
|
446
|
+
};
|
|
447
|
+
fieldSchema['x-component-props'].pagination = v;
|
|
448
|
+
field.componentProps['pagination'] = v;
|
|
449
|
+
dn.emit('patch', {
|
|
450
|
+
schema: {
|
|
451
|
+
'x-uid': fieldSchema['x-uid'],
|
|
452
|
+
'x-component-props': {
|
|
453
|
+
...null == fieldSchema ? void 0 : fieldSchema['x-component-props']
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
dn.refresh();
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
};
|
|
429
462
|
const subTablePopoverComponentFieldSettings = new SchemaSettings_js_namespaceObject.SchemaSettings({
|
|
430
463
|
name: 'fieldSettings:component:SubTable',
|
|
431
464
|
items: [
|
|
@@ -433,18 +466,21 @@ const subTablePopoverComponentFieldSettings = new SchemaSettings_js_namespaceObj
|
|
|
433
466
|
allowAddNewData,
|
|
434
467
|
allowSelectExistingRecord,
|
|
435
468
|
setDefaultSortingRules,
|
|
436
|
-
clickToSelect
|
|
469
|
+
clickToSelect,
|
|
470
|
+
tablePagination
|
|
437
471
|
]
|
|
438
472
|
});
|
|
439
473
|
exports.allowAddNewData = __webpack_exports__.allowAddNewData;
|
|
440
474
|
exports.clickToSelect = __webpack_exports__.clickToSelect;
|
|
441
475
|
exports.setDefaultSortingRules = __webpack_exports__.setDefaultSortingRules;
|
|
442
476
|
exports.subTablePopoverComponentFieldSettings = __webpack_exports__.subTablePopoverComponentFieldSettings;
|
|
477
|
+
exports.tablePagination = __webpack_exports__.tablePagination;
|
|
443
478
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
444
479
|
"allowAddNewData",
|
|
445
480
|
"clickToSelect",
|
|
446
481
|
"setDefaultSortingRules",
|
|
447
|
-
"subTablePopoverComponentFieldSettings"
|
|
482
|
+
"subTablePopoverComponentFieldSettings",
|
|
483
|
+
"tablePagination"
|
|
448
484
|
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
449
485
|
Object.defineProperty(exports, '__esModule', {
|
|
450
486
|
value: true
|
|
@@ -90,14 +90,14 @@ const ActionAreaPlayer = (param)=>{
|
|
|
90
90
|
return visible && ref.current ? /*#__PURE__*/ (0, external_react_dom_namespaceObject.createPortal)(children, ref.current) : null;
|
|
91
91
|
};
|
|
92
92
|
const ActionArea = (0, schema_namespaceObject.observer)((props)=>{
|
|
93
|
-
const { footerNodeName = 'ActionArea.Footer' } = props;
|
|
93
|
+
const { footerNodeName = 'ActionArea.Footer', stickyFooter = false } = props;
|
|
94
94
|
const schema = (0, schema_namespaceObject.useFieldSchema)();
|
|
95
95
|
const field = (0, schema_namespaceObject.useField)();
|
|
96
96
|
const { styles } = (0, external_Action_Area_style_js_namespaceObject.useStyles)();
|
|
97
97
|
const Current = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
98
98
|
children: [
|
|
99
99
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
100
|
-
className: styles.footer,
|
|
100
|
+
className: "".concat(styles.footer, " ").concat(stickyFooter ? styles.stickyFooter : ''),
|
|
101
101
|
children: [
|
|
102
102
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
103
103
|
className: "title",
|
|
@@ -58,11 +58,22 @@ function _templateObject1() {
|
|
|
58
58
|
};
|
|
59
59
|
return data;
|
|
60
60
|
}
|
|
61
|
+
function _templateObject2() {
|
|
62
|
+
const data = _tagged_template_literal([
|
|
63
|
+
"\n position: sticky !important;\n top: 0 !important;\n z-index: 100 !important;\n background: #fff !important;\n background-color: #fff !important;\n padding: ",
|
|
64
|
+
"px 0;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n border-bottom: 1px solid rgba(5, 5, 5, 0.06);\n margin: 0 -16px;\n padding-left: 16px;\n padding-right: 16px;\n\n /* \u786E\u4FDD\u5B8C\u5168\u906E\u6321 */\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: -100vw;\n right: -100vw;\n bottom: 0;\n background: #fff;\n z-index: -1;\n }\n "
|
|
65
|
+
]);
|
|
66
|
+
_templateObject2 = function() {
|
|
67
|
+
return data;
|
|
68
|
+
};
|
|
69
|
+
return data;
|
|
70
|
+
}
|
|
61
71
|
const useStyles = (0, external_antd_style_namespaceObject.createStyles)((param)=>{
|
|
62
72
|
let { css, token } = param;
|
|
63
73
|
return {
|
|
64
74
|
container: css(_templateObject(), token.padding),
|
|
65
|
-
footer: css(_templateObject1(), token.padding, token.margin, token.fontSizeHeading3, token.lineHeightHeading3)
|
|
75
|
+
footer: css(_templateObject1(), token.padding, token.margin, token.fontSizeHeading3, token.lineHeightHeading3),
|
|
76
|
+
stickyFooter: css(_templateObject2(), token.padding)
|
|
66
77
|
};
|
|
67
78
|
});
|
|
68
79
|
exports.useStyles = __webpack_exports__.useStyles;
|
|
@@ -88,7 +88,7 @@ const InternalNester = (0, schema_namespaceObject.observer)(()=>{
|
|
|
88
88
|
const { options: collectionField } = (0, external_hooks_js_namespaceObject.useAssociationFieldContext)();
|
|
89
89
|
var _fieldSchema_xdecoratorprops_showTitle;
|
|
90
90
|
const showTitle = null != (_fieldSchema_xdecoratorprops_showTitle = null == (_fieldSchema_xdecoratorprops = fieldSchema['x-decorator-props']) ? void 0 : _fieldSchema_xdecoratorprops.showTitle) ? _fieldSchema_xdecoratorprops_showTitle : true;
|
|
91
|
-
const {
|
|
91
|
+
const { params } = (0, index_js_namespaceObject.useACLActionParamsContext)();
|
|
92
92
|
const { styles } = useStyles();
|
|
93
93
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
94
94
|
insertNester(external_schema_js_default().Nester);
|
|
@@ -96,7 +96,7 @@ const InternalNester = (0, schema_namespaceObject.observer)(()=>{
|
|
|
96
96
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_collection_manager_index_js_namespaceObject.CollectionProvider_deprecated, {
|
|
97
97
|
name: collectionField.target,
|
|
98
98
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.ACLCollectionProvider, {
|
|
99
|
-
actionPath: "".concat(collectionField.target, ":").concat(actionName),
|
|
99
|
+
actionPath: "".concat(collectionField.target, ":").concat(null == params ? void 0 : params.actionName),
|
|
100
100
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(client_namespaceObject.FormLayout, {
|
|
101
101
|
layout: 'vertical',
|
|
102
102
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
@@ -79,7 +79,7 @@ const InternalSubTable = (0, schema_namespaceObject.observer)(()=>{
|
|
|
79
79
|
const insert = (0, external_hooks_js_namespaceObject.useInsertSchema)('SubTable');
|
|
80
80
|
const insertSelector = (0, external_hooks_js_namespaceObject.useInsertSchema)('Selector');
|
|
81
81
|
const { options } = (0, external_hooks_js_namespaceObject.useAssociationFieldContext)();
|
|
82
|
-
const { actionName } = (0, index_js_namespaceObject.useACLActionParamsContext)();
|
|
82
|
+
const { params, actionName } = (0, index_js_namespaceObject.useACLActionParamsContext)();
|
|
83
83
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
84
84
|
insert(external_schema_js_default().SubTable);
|
|
85
85
|
field.required = fieldSchema['required'];
|
|
@@ -104,7 +104,7 @@ const InternalSubTable = (0, schema_namespaceObject.observer)(()=>{
|
|
|
104
104
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_collection_manager_index_js_namespaceObject.CollectionProvider_deprecated, {
|
|
105
105
|
name: options.target,
|
|
106
106
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.ACLCollectionProvider, {
|
|
107
|
-
actionPath: "".concat(options.target, ":").concat(actionName || 'view'),
|
|
107
|
+
actionPath: "".concat(options.target, ":").concat(actionName || (null == params ? void 0 : params.actionName) || 'view'),
|
|
108
108
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(client_namespaceObject.FormLayout, {
|
|
109
109
|
className: styles.container,
|
|
110
110
|
layout: 'vertical',
|
|
@@ -112,9 +112,11 @@ const useStyles = (0, external_antd_style_namespaceObject.createStyles)((param)=
|
|
|
112
112
|
};
|
|
113
113
|
});
|
|
114
114
|
const SubTable = (0, schema_namespaceObject.observer)((props)=>{
|
|
115
|
+
var _subTableField_componentProps_pagination, _subTableField_componentProps, _subTableField_componentProps_pagination1, _subTableField_componentProps1, _field_value;
|
|
115
116
|
const { openSize } = props;
|
|
116
117
|
const { styles } = useStyles();
|
|
117
118
|
const { field, options: collectionField } = (0, external_hooks_js_namespaceObject.useAssociationFieldContext)();
|
|
119
|
+
const subTableField = (0, schema_namespaceObject.useField)();
|
|
118
120
|
const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
|
|
119
121
|
const [visibleSelector, setVisibleSelector] = (0, external_react_namespaceObject.useState)(false);
|
|
120
122
|
const [selectedRows, setSelectedRows] = (0, external_react_namespaceObject.useState)([]);
|
|
@@ -139,6 +141,7 @@ const SubTable = (0, schema_namespaceObject.observer)((props)=>{
|
|
|
139
141
|
return field.onInput(field.value);
|
|
140
142
|
});
|
|
141
143
|
};
|
|
144
|
+
const { dn } = (0, external_hooks_index_js_namespaceObject.useDesignable)();
|
|
142
145
|
field.move = move;
|
|
143
146
|
const options = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
144
147
|
if (field.value && Object.keys(field.value).length > 0) {
|
|
@@ -201,6 +204,23 @@ const SubTable = (0, schema_namespaceObject.observer)((props)=>{
|
|
|
201
204
|
fieldValue,
|
|
202
205
|
setFieldValue
|
|
203
206
|
};
|
|
207
|
+
const paginationProps = {
|
|
208
|
+
pageSize: (null == (_subTableField_componentProps = subTableField.componentProps) ? void 0 : null == (_subTableField_componentProps_pagination = _subTableField_componentProps.pagination) ? void 0 : _subTableField_componentProps_pagination.pageSize) || 5,
|
|
209
|
+
current: (null == (_subTableField_componentProps1 = subTableField.componentProps) ? void 0 : null == (_subTableField_componentProps_pagination1 = _subTableField_componentProps1.pagination) ? void 0 : _subTableField_componentProps_pagination1.current) || 1,
|
|
210
|
+
total: (null == (_field_value = field.value) ? void 0 : _field_value.length) || 0
|
|
211
|
+
};
|
|
212
|
+
const onChange = (props)=>{
|
|
213
|
+
if (subTableField && fieldSchema) {
|
|
214
|
+
subTableField['componentProps'] = {
|
|
215
|
+
...subTableField.componentProps,
|
|
216
|
+
pagination: props
|
|
217
|
+
};
|
|
218
|
+
fieldSchema['x-component-props'] = {
|
|
219
|
+
...fieldSchema['x-component-props'],
|
|
220
|
+
pagination: props
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
};
|
|
204
224
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
205
225
|
className: styles.container,
|
|
206
226
|
children: [
|
|
@@ -218,13 +238,14 @@ const SubTable = (0, schema_namespaceObject.observer)((props)=>{
|
|
|
218
238
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Table_js_namespaceObject.Table, {
|
|
219
239
|
className: styles.table,
|
|
220
240
|
bordered: true,
|
|
241
|
+
onChange: onChange,
|
|
221
242
|
size: 'small',
|
|
222
243
|
field: field,
|
|
223
244
|
showIndex: true,
|
|
224
245
|
dragSort: field.editable,
|
|
225
246
|
showDel: field.editable,
|
|
226
247
|
setFieldValue: setFieldValue,
|
|
227
|
-
pagination:
|
|
248
|
+
pagination: field.componentProps.pagination ? paginationProps : false,
|
|
228
249
|
rowSelection: {
|
|
229
250
|
type: 'none',
|
|
230
251
|
hideSelectAll: true
|
|
@@ -194,11 +194,15 @@ const useSubFormValue = ()=>{
|
|
|
194
194
|
};
|
|
195
195
|
const useCustomTitle = (record, schema, fieldNames)=>{
|
|
196
196
|
var _schema_xcomponentprops, _schema_xcomponentprops_fieldNames, _schema_xcomponentprops1;
|
|
197
|
+
if (schema) return {
|
|
198
|
+
formulaRecord: {},
|
|
199
|
+
fieldNames
|
|
200
|
+
};
|
|
197
201
|
if ((null == (_schema_xcomponentprops = schema['x-component-props']) ? void 0 : _schema_xcomponentprops.mode) === 'CustomTitle' && (null == (_schema_xcomponentprops1 = schema['x-component-props']) ? void 0 : null == (_schema_xcomponentprops_fieldNames = _schema_xcomponentprops1.fieldNames) ? void 0 : _schema_xcomponentprops_fieldNames.formula)) {
|
|
198
|
-
if (Array.isArray(record[schema['name']])) record[schema['name']].forEach((recordItem)=>{
|
|
202
|
+
if (Array.isArray(record[null == schema ? void 0 : schema['name']])) record[null == schema ? void 0 : schema['name']].forEach((recordItem)=>{
|
|
199
203
|
recordItem['customLabel'] = getCustomLabel(recordItem, schema);
|
|
200
204
|
});
|
|
201
|
-
else record[schema['name']]['customLabel'] = getCustomLabel(record[schema['name']], schema);
|
|
205
|
+
else record[null == schema ? void 0 : schema['name']]['customLabel'] = getCustomLabel(record[null == schema ? void 0 : schema['name']], schema);
|
|
202
206
|
return {
|
|
203
207
|
formulaRecord: record,
|
|
204
208
|
fieldNames: {
|
|
@@ -36,19 +36,20 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
36
36
|
IconFilterInput: ()=>IconFilterInput
|
|
37
37
|
});
|
|
38
38
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
39
|
-
require("react");
|
|
40
39
|
const external_antd_namespaceObject = require("antd");
|
|
41
40
|
const external_lodash_namespaceObject = require("lodash");
|
|
42
41
|
var external_lodash_default = /*#__PURE__*/ __webpack_require__.n(external_lodash_namespaceObject);
|
|
42
|
+
const external_react_i18next_namespaceObject = require("react-i18next");
|
|
43
43
|
const IconFilterInput = (props)=>{
|
|
44
44
|
const { changeFilterKey } = props;
|
|
45
|
+
const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
|
|
45
46
|
const onChange = external_lodash_default().debounce((e)=>{
|
|
46
47
|
const inputValue = e.target.value;
|
|
47
48
|
changeFilterKey(inputValue);
|
|
48
49
|
}, 100);
|
|
49
50
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Input, {
|
|
50
51
|
allowClear: true,
|
|
51
|
-
placeholder: '
|
|
52
|
+
placeholder: t("The key in Antd, such as 'ApiOutlined', ignoring case"),
|
|
52
53
|
onChange: onChange
|
|
53
54
|
});
|
|
54
55
|
};
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
+
"./IconFilterInput": function(module) {
|
|
4
|
+
module.exports = require("./IconFilterInput.js");
|
|
5
|
+
},
|
|
6
|
+
"./IconList": function(module) {
|
|
7
|
+
module.exports = require("./IconList.js");
|
|
8
|
+
},
|
|
3
9
|
"./IconPicker": function(module) {
|
|
4
10
|
module.exports = require("./IconPicker.js");
|
|
5
11
|
}
|
|
@@ -53,6 +59,18 @@ var __webpack_exports__ = {};
|
|
|
53
59
|
return _IconPicker__WEBPACK_IMPORTED_MODULE_0__[key];
|
|
54
60
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
55
61
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
62
|
+
var _IconList__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./IconList");
|
|
63
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
64
|
+
for(var __WEBPACK_IMPORT_KEY__ in _IconList__WEBPACK_IMPORTED_MODULE_1__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
65
|
+
return _IconList__WEBPACK_IMPORTED_MODULE_1__[key];
|
|
66
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
67
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
68
|
+
var _IconFilterInput__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./IconFilterInput");
|
|
69
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
70
|
+
for(var __WEBPACK_IMPORT_KEY__ in _IconFilterInput__WEBPACK_IMPORTED_MODULE_2__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
|
71
|
+
return _IconFilterInput__WEBPACK_IMPORTED_MODULE_2__[key];
|
|
72
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
73
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
56
74
|
})();
|
|
57
75
|
for(var __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
58
76
|
Object.defineProperty(exports, '__esModule', {
|
|
@@ -29,8 +29,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
30
|
const external_react_namespaceObject = require("react");
|
|
31
31
|
const schema_namespaceObject = require("@tachybase/schema");
|
|
32
|
-
const core_namespaceObject = require("@dnd-kit/core");
|
|
33
32
|
const client_namespaceObject = require("@tego/client");
|
|
33
|
+
const core_namespaceObject = require("@dnd-kit/core");
|
|
34
34
|
const external_antd_namespaceObject = require("antd");
|
|
35
35
|
const external_react_dom_namespaceObject = require("react-dom");
|
|
36
36
|
const external_index_js_namespaceObject = require("../../index.js");
|
|
@@ -38,10 +38,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
38
38
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
39
39
|
const external_react_namespaceObject = require("react");
|
|
40
40
|
const schema_namespaceObject = require("@tachybase/schema");
|
|
41
|
+
const client_namespaceObject = require("@tego/client");
|
|
41
42
|
const icons_namespaceObject = require("@ant-design/icons");
|
|
42
43
|
const pro_layout_namespaceObject = require("@ant-design/pro-layout");
|
|
43
44
|
const core_namespaceObject = require("@dnd-kit/core");
|
|
44
|
-
const client_namespaceObject = require("@tego/client");
|
|
45
45
|
const external_antd_namespaceObject = require("antd");
|
|
46
46
|
const external_antd_style_namespaceObject = require("antd-style");
|
|
47
47
|
const external_classnames_namespaceObject = require("classnames");
|
|
@@ -37,7 +37,7 @@ function _tagged_template_literal(strings, raw) {
|
|
|
37
37
|
}
|
|
38
38
|
function _templateObject() {
|
|
39
39
|
const data = _tagged_template_literal([
|
|
40
|
-
"\n .ant-tabs-nav-wrap.ant-tabs-nav-wrap {\n flex: none;\n }\n .ant-tabs-tab.ant-tabs-tab {\n border: none;\n background-color: #ffffff;\n }\n\n .ant-tabs-tab-active.ant-tabs-tab-active.ant-tabs-tab-active.ant-tabs-tab-active {\n border-radius: 8px 8px 0 0;\n box-shadow: none;\n text-shadow: none;\n background-color: var(--tb-box-bg);\n }\n .ant-tabs-extra-content {\n flex: 1;\n }\n "
|
|
40
|
+
"\n .ant-tabs-nav-wrap.ant-tabs-nav-wrap {\n flex: none;\n }\n .ant-tabs-tab.ant-tabs-tab.ant-tabs-tab {\n padding: 0;\n border: none;\n background-color: #ffffff;\n }\n\n .ant-tabs-tab-active.ant-tabs-tab-active.ant-tabs-tab-active.ant-tabs-tab-active {\n border-radius: 8px 8px 0 0;\n box-shadow: none;\n text-shadow: none;\n background-color: var(--tb-box-bg);\n }\n .ant-tabs-extra-content {\n flex: 1;\n }\n "
|
|
41
41
|
]);
|
|
42
42
|
_templateObject = function() {
|
|
43
43
|
return data;
|
|
@@ -46,7 +46,7 @@ function _templateObject() {
|
|
|
46
46
|
}
|
|
47
47
|
function _templateObject1() {
|
|
48
48
|
const data = _tagged_template_literal([
|
|
49
|
-
"\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n
|
|
49
|
+
"\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n &.designable {\n justify-content: space-between;\n }\n .add-tab-btn {\n border-radius: 8px 8px 0 0;\n }\n\n .scroll-area-extra-content {\n align-self: flex-end;\n }\n "
|
|
50
50
|
]);
|
|
51
51
|
_templateObject1 = function() {
|
|
52
52
|
return data;
|
|
@@ -55,7 +55,7 @@ function _templateObject1() {
|
|
|
55
55
|
}
|
|
56
56
|
function _templateObject2() {
|
|
57
57
|
const data = _tagged_template_literal([
|
|
58
|
-
"\n position: relative;\n &:hover {\n .tab-designer-wrapper {\n display: block;\n }\n }\n .tab-designer-wrapper {\n display: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 0 2px;\n border-radius: 3px;\n color: #000000;\n background-color: #ffffff;\n\n &:hover {\n color: #ffffff;\n background-color: var(--colorSettings);\n }\n }\n "
|
|
58
|
+
"\n position: relative;\n border-radius: 8px 8px 0 0;\n &:hover {\n .tab-designer-wrapper {\n display: block;\n }\n }\n .tab-designer-wrapper {\n display: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 0 2px;\n border-radius: 3px;\n color: #000000;\n background-color: #ffffff;\n\n &:hover {\n color: #ffffff;\n background-color: var(--colorSettings);\n }\n }\n "
|
|
59
59
|
]);
|
|
60
60
|
_templateObject2 = function() {
|
|
61
61
|
return data;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
AddTabForm: ()=>AddTabForm
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const client_namespaceObject = require("@tego/client");
|
|
31
|
+
const external_react_i18next_namespaceObject = require("react-i18next");
|
|
32
|
+
const index_js_namespaceObject = require("../../../core/index.js");
|
|
33
|
+
const AddTabForm = (props)=>{
|
|
34
|
+
const { options } = props;
|
|
35
|
+
const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
|
|
36
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.SchemaComponentOptions, {
|
|
37
|
+
scope: options.scope,
|
|
38
|
+
components: {
|
|
39
|
+
...options.components
|
|
40
|
+
},
|
|
41
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(client_namespaceObject.FormLayout, {
|
|
42
|
+
layout: 'vertical',
|
|
43
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.SchemaComponent, {
|
|
44
|
+
schema: {
|
|
45
|
+
properties: {
|
|
46
|
+
title: {
|
|
47
|
+
title: t('Tab name'),
|
|
48
|
+
'x-component': 'Input',
|
|
49
|
+
'x-decorator': 'FormItem',
|
|
50
|
+
required: true
|
|
51
|
+
},
|
|
52
|
+
icon: {
|
|
53
|
+
title: t('Icon'),
|
|
54
|
+
'x-component': 'IconPicker',
|
|
55
|
+
'x-decorator': 'FormItem'
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
})
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
exports.AddTabForm = __webpack_exports__.AddTabForm;
|
|
64
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
65
|
+
"AddTabForm"
|
|
66
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
67
|
+
Object.defineProperty(exports, '__esModule', {
|
|
68
|
+
value: true
|
|
69
|
+
});
|
|
@@ -39,9 +39,9 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
39
39
|
const external_react_namespaceObject = require("react");
|
|
40
40
|
var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_namespaceObject);
|
|
41
41
|
const schema_namespaceObject = require("@tachybase/schema");
|
|
42
|
+
const client_namespaceObject = require("@tego/client");
|
|
42
43
|
const icons_namespaceObject = require("@ant-design/icons");
|
|
43
44
|
const sortable_namespaceObject = require("@dnd-kit/sortable");
|
|
44
|
-
const client_namespaceObject = require("@tego/client");
|
|
45
45
|
const external_ahooks_namespaceObject = require("ahooks");
|
|
46
46
|
const external_antd_namespaceObject = require("antd");
|
|
47
47
|
const external_classnames_namespaceObject = require("classnames");
|
|
@@ -277,7 +277,7 @@ const Table = (0, withDynamicSchemaProps_js_namespaceObject.withDynamicSchemaPro
|
|
|
277
277
|
const { styles } = (0, external_Table_styles_js_namespaceObject.useStyles)();
|
|
278
278
|
const { pagination: pagination1, useProps, ...others1 } = props;
|
|
279
279
|
const { pagination: pagination2, ...others2 } = (null == useProps ? void 0 : useProps()) || {};
|
|
280
|
-
const { dragSort
|
|
280
|
+
const { dragSort: tableDragSort, showIndex = true, onRowSelectionChange, onChange: onTableChange, rowSelection, rowKey, required, onExpand, onClickRow, ...others } = {
|
|
281
281
|
...others1,
|
|
282
282
|
...others2
|
|
283
283
|
};
|
|
@@ -295,6 +295,7 @@ const Table = (0, withDynamicSchemaProps_js_namespaceObject.withDynamicSchemaPro
|
|
|
295
295
|
const [selectedRow, setSelectedRow] = (0, external_react_namespaceObject.useState)([]);
|
|
296
296
|
const dataSource = (null == field ? void 0 : null == (_field_value = field.value) ? void 0 : null == (_field_value_slice1 = _field_value.slice) ? void 0 : null == (_field_value_slice = _field_value_slice1.call(_field_value)) ? void 0 : null == (_field_value_slice_filter = _field_value_slice.filter) ? void 0 : _field_value_slice_filter.call(_field_value_slice, Boolean)) || [];
|
|
297
297
|
const isRowSelect = (null == rowSelection ? void 0 : rowSelection.type) !== 'none';
|
|
298
|
+
const dragSort = tableDragSort || field.componentProps.dragSort || false;
|
|
298
299
|
const defaultRowKeyMap = (0, external_react_namespaceObject.useRef)(new Map());
|
|
299
300
|
let onRow = null, highlightRow = '';
|
|
300
301
|
if (onClickRow) {
|
|
@@ -100,7 +100,7 @@ function _templateObject5() {
|
|
|
100
100
|
}
|
|
101
101
|
function _templateObject6() {
|
|
102
102
|
const data = _tagged_template_literal([
|
|
103
|
-
"\n max-width: 300px;\n white-space: nowrap;\n .
|
|
103
|
+
"\n max-width: 300px;\n white-space: nowrap;\n .ant-color-picker-trigger {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n }\n "
|
|
104
104
|
]);
|
|
105
105
|
_templateObject6 = function() {
|
|
106
106
|
return data;
|
|
@@ -28,6 +28,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
30
|
const external_react_namespaceObject = require("react");
|
|
31
|
+
const utilities_namespaceObject = require("@dnd-kit/utilities");
|
|
31
32
|
const external_antd_style_namespaceObject = require("antd-style");
|
|
32
33
|
const index_js_namespaceObject = require("../../hooks/index.js");
|
|
33
34
|
const external_DragHandlePageTab_style_js_namespaceObject = require("./DragHandlePageTab.style.js");
|
|
@@ -36,46 +37,16 @@ const DragHandlePageTab = (props)=>{
|
|
|
36
37
|
const { isSubMenu, children, className: overStyle, isAdminMenu } = props;
|
|
37
38
|
const { draggable } = (0, external_react_namespaceObject.useContext)(external_SortableItem_js_namespaceObject.SortableContext);
|
|
38
39
|
const { designable } = (0, index_js_namespaceObject.useDesignable)();
|
|
39
|
-
const { attributes, listeners, setNodeRef, transform,
|
|
40
|
+
const { attributes, listeners, setNodeRef, isDragging, transform, transition } = draggable;
|
|
40
41
|
const { styles } = (0, external_DragHandlePageTab_style_js_namespaceObject.useStyles)();
|
|
41
|
-
const ref = (0, external_react_namespaceObject.useRef)(null);
|
|
42
|
-
const [dimensions, setDimensions] = (0, external_react_namespaceObject.useState)({
|
|
43
|
-
width: 0,
|
|
44
|
-
height: 0
|
|
45
|
-
});
|
|
46
|
-
const [initialPosition, setInitialPosition] = (0, external_react_namespaceObject.useState)({
|
|
47
|
-
x: 0,
|
|
48
|
-
y: 0
|
|
49
|
-
});
|
|
50
|
-
const style = {
|
|
51
|
-
position: isDragging ? 'fixed' : 'static',
|
|
52
|
-
top: isDragging ? initialPosition.y - 5 * dimensions.height : 0,
|
|
53
|
-
left: isDragging ? initialPosition.x - dimensions.width : 0,
|
|
54
|
-
width: isDragging ? 'max-content' : '100%',
|
|
55
|
-
height: isDragging ? 'max-content' : '100%',
|
|
56
|
-
zIndex: isDragging ? 999 : 'auto',
|
|
57
|
-
pointerEvents: isDragging ? 'none' : 'auto',
|
|
58
|
-
transform: transform ? "translate3d(".concat(transform.x, "px, ").concat(transform.y, "px, 0) scale(").concat(isDragging ? 1.05 : 1, ")") : void 0,
|
|
59
|
-
boxShadow: isDragging ? '0 8px 24px 4px rgba(0,0,0,0.18)' : 'none',
|
|
60
|
-
WebkitTransform: transform ? "translate3d(".concat(transform.x, "px, ").concat(transform.y, "px, 0) scale(").concat(isDragging ? 1.05 : 1, ")") : void 0,
|
|
61
|
-
WebkitPerspective: isDragging ? 1000 : void 0,
|
|
62
|
-
isolation: isDragging ? 'isolate' : void 0
|
|
63
|
-
};
|
|
64
|
-
const handleMouseDown = (event)=>{
|
|
65
|
-
if (ref.current) {
|
|
66
|
-
const { width, height } = ref.current.getBoundingClientRect();
|
|
67
|
-
const { clientX, clientY } = event;
|
|
68
|
-
setDimensions({
|
|
69
|
-
width,
|
|
70
|
-
height
|
|
71
|
-
});
|
|
72
|
-
setInitialPosition({
|
|
73
|
-
x: clientX,
|
|
74
|
-
y: clientY
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
42
|
if (!designable) return children;
|
|
43
|
+
({
|
|
44
|
+
...props.style,
|
|
45
|
+
transform: utilities_namespaceObject.CSS.Translate.toString(transform),
|
|
46
|
+
transition,
|
|
47
|
+
cursor: 'move',
|
|
48
|
+
zIndex: isDragging ? 999 : 'auto'
|
|
49
|
+
});
|
|
79
50
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
80
51
|
ref: setNodeRef,
|
|
81
52
|
className: (0, external_antd_style_namespaceObject.cx)(styles.dragHandleMenu, {
|
|
@@ -83,16 +54,10 @@ const DragHandlePageTab = (props)=>{
|
|
|
83
54
|
leftBorder: isSubMenu && isDragging,
|
|
84
55
|
adminMenu: isAdminMenu && isDragging
|
|
85
56
|
}, overStyle),
|
|
86
|
-
style: style,
|
|
87
57
|
...listeners,
|
|
88
58
|
...attributes,
|
|
89
59
|
role: "none",
|
|
90
|
-
|
|
91
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
92
|
-
ref: ref,
|
|
93
|
-
className: 'wrapper',
|
|
94
|
-
children: children
|
|
95
|
-
})
|
|
60
|
+
children: children
|
|
96
61
|
});
|
|
97
62
|
};
|
|
98
63
|
exports.DragHandlePageTab = __webpack_exports__.DragHandlePageTab;
|
|
@@ -37,7 +37,7 @@ function _tagged_template_literal(strings, raw) {
|
|
|
37
37
|
}
|
|
38
38
|
function _templateObject() {
|
|
39
39
|
const data = _tagged_template_literal([
|
|
40
|
-
"\n position: relative;\n width: 100%;\n height: 100%;\n
|
|
40
|
+
"\n position: relative;\n width: 100%;\n height: 100%;\n padding: 6px 16px;\n border-radius: 8px 8px 0 0;\n &.draggable {\n cursor: move;\n padding: 0 10px;\n border-radius: 5px;\n background: #f0f0f0;\n }\n "
|
|
41
41
|
]);
|
|
42
42
|
_templateObject = function() {
|
|
43
43
|
return data;
|