@tachybase/client 0.23.20 → 0.23.35
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/schema-initializer/components/SchemaInitializerChildren.mjs +1 -1
- package/es/built-in/admin-layout/InternalAdminLayout.mjs +4 -2
- package/es/built-in/admin-layout/MenuEditor.mjs +2 -2
- package/es/built-in/admin-layout/style.d.ts +1 -1
- package/es/built-in/admin-layout/style.mjs +4 -4
- package/es/built-in/assistant/Assistant.provider.d.ts +0 -6
- package/es/built-in/assistant/Assistant.provider.mjs +15 -112
- package/es/built-in/assistant/index.d.ts +0 -1
- package/es/built-in/assistant/index.mjs +0 -7
- package/es/built-in/attachment-preview/previewers/file-pdf.mjs +4 -2
- package/es/built-in/context-menu/ContextMenu.provider.d.ts +1 -0
- package/es/built-in/context-menu/ContextMenu.provider.mjs +29 -1
- package/es/built-in/context-menu/index.mjs +1 -0
- package/es/built-in/index.mjs +44 -5
- package/es/built-in/page-style/TabHeader.d.ts +1 -1
- package/es/built-in/page-style/TabHeader.mjs +26 -33
- package/es/built-in/page-style/TabHeader.style.d.ts +4 -0
- package/es/built-in/page-style/TabHeader.style.mjs +35 -0
- package/es/built-in/pinned-list/PinnedPluginListProvider.d.ts +3 -1
- package/es/built-in/pinned-list/PinnedPluginListProvider.mjs +5 -4
- package/es/built-in/scroll-assistant/useJoystick.mjs +3 -1
- package/es/built-in/setting-layout/SettingLayout.mjs +10 -1
- package/es/built-in/{assistant/calculator → setting-layout}/style.d.ts +1 -1
- package/es/built-in/setting-layout/style.mjs +25 -0
- package/es/collection-manager/action-hooks.d.ts +1 -4
- package/es/collection-manager/action-hooks.mjs +39 -11
- package/es/icon/preloaded.mjs +4 -4
- package/es/modules/actions/associate/AssociateActionInitializer.d.ts +1 -0
- package/es/modules/actions/associate/AssociateActionInitializer.mjs +71 -0
- package/es/modules/actions/associate/AssociateActionProvider.d.ts +7 -0
- package/es/modules/actions/associate/AssociateActionProvider.mjs +82 -0
- package/es/modules/actions/associate/AssociateActionSettings.d.ts +2 -0
- package/es/modules/actions/associate/AssociateActionSettings.mjs +57 -0
- package/es/modules/blocks/data-blocks/details-multi/detailsWithPaginationSettings.mjs +2 -1
- package/es/modules/blocks/data-blocks/form/RecordFormBlockInitializer.mjs +21 -14
- package/es/modules/blocks/data-blocks/form/createEditFormBlockUISchema.d.ts +1 -2
- package/es/modules/blocks/data-blocks/grid-card/gridCardBlockSettings.mjs +2 -1
- package/es/modules/blocks/data-blocks/list/listBlockSettings.mjs +2 -1
- package/es/modules/blocks/data-blocks/table/TableActionInitializers.mjs +15 -0
- package/es/modules/blocks/data-blocks/table/tableBlockSettings.mjs +2 -1
- package/es/modules/blocks/data-blocks/table/tableColumnSettings.mjs +2 -2
- package/es/modules/blocks/data-blocks/table-selector/tableSelectorBlockSettings.mjs +2 -1
- package/es/modules/fields/component/Cascader/cascaderComponentFieldSettings.mjs +2 -1
- package/es/modules/fields/component/Radio/radioComponentFieldSettings.mjs +4 -0
- package/es/modules/fields/component/Select/selectComponentFieldSettings.mjs +16 -2
- package/es/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.mjs +2 -1
- package/es/modules/menu/GroupItem.mjs +5 -1
- package/es/modules/menu/LinkMenuItem.mjs +7 -3
- package/es/modules/menu/PageMenuItem.mjs +5 -1
- package/es/modules/menu/UploadMenuItem.d.ts +1 -0
- package/es/modules/menu/UploadMenuItem.mjs +81 -0
- package/es/modules/menu/menuItemInitializer.d.ts +0 -4
- package/es/modules/menu/menuItemInitializer.mjs +3 -23
- package/es/schema-component/antd/action/Action.Designer.mjs +4 -1
- package/es/schema-component/antd/association-select/AssociationSelect.mjs +4 -2
- package/es/schema-component/antd/checkbox/Checkbox.mjs +11 -6
- package/es/schema-component/antd/date-picker/DatePicker.mjs +4 -0
- package/es/schema-component/antd/form-item/FormItem.Settings.d.ts +2 -0
- package/es/schema-component/antd/form-item/FormItem.Settings.mjs +14 -1
- package/es/schema-component/antd/form-v2/Form.Settings.mjs +2 -1
- package/es/schema-component/antd/grid-card/GridCard.Designer.mjs +2 -1
- package/es/schema-component/antd/list/List.Designer.mjs +2 -1
- package/es/schema-component/antd/menu/AdminMenu.d.ts +1 -0
- package/es/schema-component/antd/menu/AdminMenu.mjs +71 -0
- package/es/schema-component/antd/menu/AdminMenu.style.d.ts +4 -0
- package/es/schema-component/antd/menu/AdminMenu.style.mjs +36 -0
- package/es/schema-component/antd/menu/Menu.Designer.d.ts +1 -1
- package/es/schema-component/antd/menu/Menu.Designer.mjs +59 -40
- package/es/schema-component/antd/menu/Menu.mjs +108 -141
- package/es/schema-component/antd/menu/Menu.styles.d.ts +1 -2
- package/es/schema-component/antd/menu/Menu.styles.mjs +8 -20
- package/es/schema-component/antd/menu/MenuSearch.d.ts +5 -0
- package/es/schema-component/antd/menu/MenuSearch.mjs +32 -0
- package/es/schema-component/antd/menu/tools.d.ts +9 -0
- package/es/schema-component/antd/menu/tools.mjs +36 -0
- package/es/schema-component/antd/scroll-area/ScrollArea.mjs +0 -17
- package/es/schema-component/antd/select/Select.d.ts +3 -13
- package/es/schema-component/antd/select/Select.mjs +33 -2
- package/es/schema-component/antd/table/Table.Void.Designer.mjs +2 -1
- package/es/schema-component/antd/table-v2/TableBlockDesigner.mjs +2 -1
- package/es/schema-component/antd/table-v2/TableSelectorDesigner.mjs +2 -1
- package/es/schema-component/common/dnd-context/index.d.ts +1 -2
- package/es/schema-component/common/sortable-item/DragHandleMenu.d.ts +1 -0
- package/es/schema-component/common/sortable-item/DragHandleMenu.mjs +78 -0
- package/es/schema-component/common/sortable-item/DragHandleMenu.style.d.ts +3 -0
- package/es/schema-component/common/sortable-item/DragHandleMenu.style.mjs +25 -0
- package/es/schema-initializer/SchemaInitializerPlugin.mjs +5 -2
- package/es/schema-initializer/utils.mjs +24 -12
- package/es/schema-settings/GeneralSchemaDesigner.d.ts +2 -1
- package/es/schema-settings/GeneralSchemaDesigner.mjs +9 -1
- package/es/schema-settings/SchemaSettings.d.ts +3 -1
- package/es/schema-settings/SchemaSettings.mjs +16 -4
- package/es/schema-settings/SchemaSettingsPlugin.mjs +2 -0
- package/es/schema-settings/SchemaSettingsSortingRule.mjs +2 -1
- package/es/schema-settings/styles.mjs +2 -2
- package/lib/application/schema-initializer/components/SchemaInitializerChildren.js +1 -1
- package/lib/built-in/admin-layout/InternalAdminLayout.js +4 -2
- package/lib/built-in/admin-layout/MenuEditor.js +2 -2
- package/lib/built-in/admin-layout/style.js +4 -4
- package/lib/built-in/assistant/Assistant.provider.js +16 -115
- package/lib/built-in/assistant/index.js +3 -16
- package/lib/built-in/attachment-preview/previewers/file-pdf.js +4 -2
- package/lib/built-in/context-menu/ContextMenu.provider.js +29 -0
- package/lib/built-in/context-menu/index.js +1 -0
- package/lib/built-in/index.js +44 -5
- package/lib/built-in/page-style/TabHeader.js +26 -33
- package/lib/built-in/page-style/TabHeader.style.js +69 -0
- package/lib/built-in/pinned-list/PinnedPluginListProvider.js +5 -4
- package/lib/built-in/scroll-assistant/useJoystick.js +17 -1
- package/lib/built-in/setting-layout/SettingLayout.js +10 -1
- package/lib/built-in/{assistant/calculator/CalculatorKey.js → setting-layout/style.js} +25 -11
- package/lib/collection-manager/action-hooks.js +39 -11
- package/lib/icon/preloaded.js +4 -4
- package/lib/locale/en_US.js +8 -0
- package/lib/locale/zh-CN.js +8 -0
- package/lib/modules/actions/associate/AssociateActionInitializer.js +105 -0
- package/lib/modules/actions/associate/AssociateActionProvider.js +116 -0
- package/lib/modules/actions/associate/AssociateActionSettings.js +91 -0
- package/lib/modules/blocks/data-blocks/details-multi/detailsWithPaginationSettings.js +2 -1
- package/lib/modules/blocks/data-blocks/form/RecordFormBlockInitializer.js +21 -14
- package/lib/modules/blocks/data-blocks/grid-card/gridCardBlockSettings.js +2 -1
- package/lib/modules/blocks/data-blocks/list/listBlockSettings.js +2 -1
- package/lib/modules/blocks/data-blocks/table/TableActionInitializers.js +15 -0
- package/lib/modules/blocks/data-blocks/table/tableBlockSettings.js +2 -1
- package/lib/modules/blocks/data-blocks/table/tableColumnSettings.js +2 -2
- package/lib/modules/blocks/data-blocks/table-selector/tableSelectorBlockSettings.js +2 -1
- package/lib/modules/fields/component/Cascader/cascaderComponentFieldSettings.js +2 -1
- package/lib/modules/fields/component/Radio/radioComponentFieldSettings.js +4 -0
- package/lib/modules/fields/component/Select/selectComponentFieldSettings.js +16 -2
- package/lib/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.js +2 -1
- package/lib/modules/menu/GroupItem.js +5 -1
- package/lib/modules/menu/LinkMenuItem.js +7 -3
- package/lib/modules/menu/PageMenuItem.js +5 -1
- package/lib/modules/menu/UploadMenuItem.js +115 -0
- package/lib/modules/menu/menuItemInitializer.js +2 -23
- package/lib/schema-component/antd/action/Action.Designer.js +4 -1
- package/lib/schema-component/antd/association-select/AssociationSelect.js +4 -2
- package/lib/schema-component/antd/checkbox/Checkbox.js +11 -6
- package/lib/schema-component/antd/date-picker/DatePicker.js +4 -0
- package/lib/schema-component/antd/form-item/FormItem.Settings.js +16 -1
- package/lib/schema-component/antd/form-v2/Form.Settings.js +2 -1
- package/lib/schema-component/antd/grid-card/GridCard.Designer.js +2 -1
- package/lib/schema-component/antd/list/List.Designer.js +2 -1
- package/lib/schema-component/antd/menu/AdminMenu.js +105 -0
- package/lib/schema-component/antd/menu/AdminMenu.style.js +70 -0
- package/lib/schema-component/antd/menu/Menu.Designer.js +59 -40
- package/lib/schema-component/antd/menu/Menu.js +108 -141
- package/lib/schema-component/antd/menu/Menu.styles.js +8 -20
- package/lib/schema-component/antd/menu/MenuSearch.js +80 -0
- package/lib/schema-component/antd/menu/tools.js +72 -0
- package/lib/schema-component/antd/scroll-area/ScrollArea.js +0 -17
- package/lib/schema-component/antd/select/Select.js +33 -2
- package/lib/schema-component/antd/table/Table.Void.Designer.js +2 -1
- package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +2 -1
- package/lib/schema-component/antd/table-v2/TableSelectorDesigner.js +2 -1
- package/lib/schema-component/common/sortable-item/DragHandleMenu.js +112 -0
- package/lib/schema-component/common/sortable-item/DragHandleMenu.style.js +59 -0
- package/lib/schema-initializer/SchemaInitializerPlugin.js +5 -2
- package/lib/schema-initializer/utils.js +24 -12
- package/lib/schema-settings/GeneralSchemaDesigner.js +9 -1
- package/lib/schema-settings/SchemaSettings.js +16 -4
- package/lib/schema-settings/SchemaSettingsPlugin.js +2 -0
- package/lib/schema-settings/SchemaSettingsSortingRule.js +2 -1
- package/lib/schema-settings/styles.js +2 -2
- package/package.json +8 -7
- package/es/built-in/assistant/calculator/AutoScalingText.d.ts +0 -3
- package/es/built-in/assistant/calculator/AutoScalingText.mjs +0 -33
- package/es/built-in/assistant/calculator/Calculator.d.ts +0 -2
- package/es/built-in/assistant/calculator/Calculator.mjs +0 -235
- package/es/built-in/assistant/calculator/CalculatorDisplay.d.ts +0 -4
- package/es/built-in/assistant/calculator/CalculatorDisplay.mjs +0 -21
- package/es/built-in/assistant/calculator/CalculatorKey.d.ts +0 -5
- package/es/built-in/assistant/calculator/CalculatorKey.mjs +0 -11
- package/es/built-in/assistant/calculator/CalculatorProvider.d.ts +0 -10
- package/es/built-in/assistant/calculator/CalculatorProvider.mjs +0 -29
- package/es/built-in/assistant/calculator/Draggable.d.ts +0 -8
- package/es/built-in/assistant/calculator/Draggable.mjs +0 -54
- package/es/built-in/assistant/calculator/style.mjs +0 -25
- package/es/built-in/assistant/search-and-jump/index.d.ts +0 -16
- package/es/built-in/assistant/search-and-jump/index.mjs +0 -59
- package/lib/built-in/assistant/calculator/AutoScalingText.js +0 -67
- package/lib/built-in/assistant/calculator/Calculator.js +0 -283
- package/lib/built-in/assistant/calculator/CalculatorDisplay.js +0 -55
- package/lib/built-in/assistant/calculator/CalculatorProvider.js +0 -65
- package/lib/built-in/assistant/calculator/Draggable.js +0 -102
- package/lib/built-in/assistant/calculator/style.js +0 -59
- package/lib/built-in/assistant/search-and-jump/index.js +0 -96
|
@@ -43,7 +43,6 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
43
43
|
default: ()=>Select_rslib_entry_
|
|
44
44
|
});
|
|
45
45
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
46
|
-
require("react");
|
|
47
46
|
const schema_namespaceObject = require("@tachybase/schema");
|
|
48
47
|
const client_namespaceObject = require("@tachybase/utils/client");
|
|
49
48
|
const icons_namespaceObject = require("@ant-design/icons");
|
|
@@ -194,7 +193,39 @@ const InternalSelect = (0, schema_namespaceObject.connect)((props)=>{
|
|
|
194
193
|
},
|
|
195
194
|
suffixIcon: (null == field ? void 0 : field['loading']) || (null == field ? void 0 : field['validating']) ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.LoadingOutlined, {}) : props.suffixIcon
|
|
196
195
|
})), (0, schema_namespaceObject.mapReadPretty)(external_ReadPretty_js_namespaceObject.ReadPretty));
|
|
197
|
-
const
|
|
196
|
+
const InternalRadioGroup = (0, schema_namespaceObject.connect)((props)=>{
|
|
197
|
+
const { options, value, onChange } = props;
|
|
198
|
+
const handleCancel = (e)=>{
|
|
199
|
+
e.stopPropagation();
|
|
200
|
+
const currentValue = e.target.value;
|
|
201
|
+
if ('radio' === e.target.type && currentValue === value) null == onChange || onChange('');
|
|
202
|
+
};
|
|
203
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
204
|
+
onClick: handleCancel,
|
|
205
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Radio.Group, {
|
|
206
|
+
...props,
|
|
207
|
+
value: value,
|
|
208
|
+
options: options
|
|
209
|
+
})
|
|
210
|
+
});
|
|
211
|
+
}, (0, schema_namespaceObject.mapProps)({
|
|
212
|
+
dataSource: 'options',
|
|
213
|
+
onInput: 'onChange',
|
|
214
|
+
value: 'value'
|
|
215
|
+
}), (0, schema_namespaceObject.mapReadPretty)(external_ReadPretty_js_namespaceObject.ReadPretty));
|
|
216
|
+
const Select = (props)=>{
|
|
217
|
+
switch(props.mode){
|
|
218
|
+
case 'Radio group':
|
|
219
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InternalRadioGroup, {
|
|
220
|
+
...props
|
|
221
|
+
});
|
|
222
|
+
case 'Select':
|
|
223
|
+
default:
|
|
224
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InternalSelect, {
|
|
225
|
+
...props
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
};
|
|
198
229
|
Select.ReadPretty = external_ReadPretty_js_namespaceObject.ReadPretty;
|
|
199
230
|
const Select_rslib_entry_ = Select;
|
|
200
231
|
var __webpack_export_target__ = exports;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = function(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 = function(obj, prop) {
|
|
13
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
(()=>{
|
|
17
|
+
__webpack_require__.r = function(exports1) {
|
|
18
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
19
|
+
value: 'Module'
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
22
|
+
value: true
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
})();
|
|
26
|
+
var __webpack_exports__ = {};
|
|
27
|
+
__webpack_require__.r(__webpack_exports__);
|
|
28
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
29
|
+
DragHandleMenu: ()=>DragHandleMenu
|
|
30
|
+
});
|
|
31
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
32
|
+
const external_react_namespaceObject = require("react");
|
|
33
|
+
const external_antd_style_namespaceObject = require("antd-style");
|
|
34
|
+
const MenuContext_namespaceObject = require("rc-menu/es/context/MenuContext");
|
|
35
|
+
const index_js_namespaceObject = require("../../hooks/index.js");
|
|
36
|
+
const external_DragHandleMenu_style_js_namespaceObject = require("./DragHandleMenu.style.js");
|
|
37
|
+
const external_SortableItem_js_namespaceObject = require("./SortableItem.js");
|
|
38
|
+
const DragHandleMenu = (props)=>{
|
|
39
|
+
const { isSubMenu, name, children, className: overStyle, isAdminMenu } = props;
|
|
40
|
+
const { draggable } = (0, external_react_namespaceObject.useContext)(external_SortableItem_js_namespaceObject.SortableContext);
|
|
41
|
+
const { onOpenChange } = (0, external_react_namespaceObject.useContext)(MenuContext_namespaceObject.MenuContext) || {};
|
|
42
|
+
const { designable } = (0, index_js_namespaceObject.useDesignable)();
|
|
43
|
+
const { attributes, listeners, setNodeRef, transform, isDragging } = draggable;
|
|
44
|
+
const { styles } = (0, external_DragHandleMenu_style_js_namespaceObject.useStyles)();
|
|
45
|
+
const ref = (0, external_react_namespaceObject.useRef)(null);
|
|
46
|
+
const [dimensions, setDimensions] = (0, external_react_namespaceObject.useState)({
|
|
47
|
+
width: 0,
|
|
48
|
+
height: 0
|
|
49
|
+
});
|
|
50
|
+
const [initialPosition, setInitialPosition] = (0, external_react_namespaceObject.useState)({
|
|
51
|
+
x: 0,
|
|
52
|
+
y: 0
|
|
53
|
+
});
|
|
54
|
+
const centerOffset = {
|
|
55
|
+
x: dimensions.width / 4,
|
|
56
|
+
y: dimensions.height / 4
|
|
57
|
+
};
|
|
58
|
+
const style = {
|
|
59
|
+
position: isDragging ? 'fixed' : 'static',
|
|
60
|
+
top: isDragging ? initialPosition.y - centerOffset.y : 0,
|
|
61
|
+
left: isDragging ? initialPosition.x - centerOffset.x : 0,
|
|
62
|
+
width: isDragging ? dimensions.width : '100%',
|
|
63
|
+
height: isDragging ? dimensions.height : '100%',
|
|
64
|
+
zIndex: isDragging ? 999 : 'auto',
|
|
65
|
+
pointerEvents: isDragging ? 'none' : 'auto',
|
|
66
|
+
transform: transform ? "translate3d(".concat(transform.x, "px, ").concat(transform.y, "px, 0) scale(").concat(isDragging ? 1.05 : 1, ")") : void 0,
|
|
67
|
+
boxShadow: isDragging ? '0 4px 8px rgba(0, 0, 0, 0.1)' : 'none'
|
|
68
|
+
};
|
|
69
|
+
const handleMouseDown = (event)=>{
|
|
70
|
+
if (ref.current) {
|
|
71
|
+
const { width, height } = ref.current.getBoundingClientRect();
|
|
72
|
+
const { clientX, clientY } = event;
|
|
73
|
+
setDimensions({
|
|
74
|
+
width,
|
|
75
|
+
height
|
|
76
|
+
});
|
|
77
|
+
setInitialPosition({
|
|
78
|
+
x: clientX,
|
|
79
|
+
y: clientY
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
84
|
+
if (isSubMenu && isDragging) null == onOpenChange || onOpenChange(name, false);
|
|
85
|
+
}, [
|
|
86
|
+
isDragging
|
|
87
|
+
]);
|
|
88
|
+
if (!designable) return children;
|
|
89
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
90
|
+
ref: setNodeRef,
|
|
91
|
+
className: (0, external_antd_style_namespaceObject.cx)(styles.dragHandleMenu, {
|
|
92
|
+
draggable: isDragging,
|
|
93
|
+
leftBorder: isSubMenu && isDragging,
|
|
94
|
+
adminMenu: isAdminMenu && isDragging
|
|
95
|
+
}, overStyle),
|
|
96
|
+
style: style,
|
|
97
|
+
...listeners,
|
|
98
|
+
...attributes,
|
|
99
|
+
role: "none",
|
|
100
|
+
onMouseDown: handleMouseDown,
|
|
101
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
102
|
+
ref: ref,
|
|
103
|
+
className: 'wrapper',
|
|
104
|
+
children: children
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
var __webpack_export_target__ = exports;
|
|
109
|
+
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
110
|
+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
111
|
+
value: true
|
|
112
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = function(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 = function(obj, prop) {
|
|
13
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
(()=>{
|
|
17
|
+
__webpack_require__.r = function(exports1) {
|
|
18
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
19
|
+
value: 'Module'
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
22
|
+
value: true
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
})();
|
|
26
|
+
var __webpack_exports__ = {};
|
|
27
|
+
__webpack_require__.r(__webpack_exports__);
|
|
28
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
29
|
+
useStyles: ()=>useStyles
|
|
30
|
+
});
|
|
31
|
+
const external_antd_style_namespaceObject = require("antd-style");
|
|
32
|
+
function _tagged_template_literal(strings, raw) {
|
|
33
|
+
if (!raw) raw = strings.slice(0);
|
|
34
|
+
return Object.freeze(Object.defineProperties(strings, {
|
|
35
|
+
raw: {
|
|
36
|
+
value: Object.freeze(raw)
|
|
37
|
+
}
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
function _templateObject() {
|
|
41
|
+
const data = _tagged_template_literal([
|
|
42
|
+
"\n position: relative;\n width: 100%;\n height: 100%;\n\n &.draggable {\n cursor: move;\n padding: 0 10px;\n border-radius: 5px;\n background: #f0f0f0;\n }\n &.leftBorder {\n ::before {\n content: '';\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n width: 3px;\n height: 50%;\n background-color: var(--colorPrimaryText);\n\n /* 使用 clip-path 裁剪为梯形 */\n clip-path: polygon(0 0, 100% 15%, 100% 85%, 0 100%);\n }\n }\n\n &.adminMenu {\n .general-schema-designer {\n display: none;\n }\n }\n\n .wrapper {\n display: flex;\n flex-direction: row;\n justify-content: space-around;\n }\n "
|
|
43
|
+
]);
|
|
44
|
+
_templateObject = function() {
|
|
45
|
+
return data;
|
|
46
|
+
};
|
|
47
|
+
return data;
|
|
48
|
+
}
|
|
49
|
+
const useStyles = (0, external_antd_style_namespaceObject.createStyles)((param)=>{
|
|
50
|
+
let { css, token } = param;
|
|
51
|
+
return {
|
|
52
|
+
dragHandleMenu: css(_templateObject())
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
var __webpack_export_target__ = exports;
|
|
56
|
+
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
57
|
+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
58
|
+
value: true
|
|
59
|
+
});
|
|
@@ -34,6 +34,8 @@ const CreateActionInitializer_js_namespaceObject = require("../modules/actions/a
|
|
|
34
34
|
const createFormBlockInitializers_js_namespaceObject = require("../modules/actions/add-new/createFormBlockInitializers.js");
|
|
35
35
|
const CustomizeAddRecordActionInitializer_js_namespaceObject = require("../modules/actions/add-record/CustomizeAddRecordActionInitializer.js");
|
|
36
36
|
const customizeCreateFormBlockInitializers_js_namespaceObject = require("../modules/actions/add-record/customizeCreateFormBlockInitializers.js");
|
|
37
|
+
const AssociateActionInitializer_js_namespaceObject = require("../modules/actions/associate/AssociateActionInitializer.js");
|
|
38
|
+
const AssociateActionProvider_js_namespaceObject = require("../modules/actions/associate/AssociateActionProvider.js");
|
|
37
39
|
const BulkDestroyActionInitializer_js_namespaceObject = require("../modules/actions/bulk-destroy/BulkDestroyActionInitializer.js");
|
|
38
40
|
const DestroyActionInitializer_js_namespaceObject = require("../modules/actions/delete/DestroyActionInitializer.js");
|
|
39
41
|
const DisassociateActionInitializer_js_namespaceObject = require("../modules/actions/disassociate/DisassociateActionInitializer.js");
|
|
@@ -119,7 +121,9 @@ class SchemaInitializerPlugin extends Plugin_js_namespaceObject.Plugin {
|
|
|
119
121
|
DisassociateActionInitializer: DisassociateActionInitializer_js_namespaceObject.DisassociateActionInitializer,
|
|
120
122
|
FilterActionInitializer: FilterActionInitializer_js_namespaceObject.FilterActionInitializer,
|
|
121
123
|
RefreshActionInitializer: RefreshActionInitializer_js_namespaceObject.RefreshActionInitializer,
|
|
122
|
-
FilterFormItemCustom: external_items_index_js_namespaceObject.FilterFormItemCustom
|
|
124
|
+
FilterFormItemCustom: external_items_index_js_namespaceObject.FilterFormItemCustom,
|
|
125
|
+
AssociateActionInitializer: AssociateActionInitializer_js_namespaceObject.AssociateActionInitializer,
|
|
126
|
+
AssociateActionProvider: AssociateActionProvider_js_namespaceObject.AssociateActionProvider
|
|
123
127
|
});
|
|
124
128
|
this.app.schemaInitializerManager.add(BlockInitializers_js_namespaceObject.blockInitializers);
|
|
125
129
|
this.app.schemaInitializerManager.add(table_index_js_namespaceObject.tableActionInitializers);
|
|
@@ -149,7 +153,6 @@ class SchemaInitializerPlugin extends Plugin_js_namespaceObject.Plugin {
|
|
|
149
153
|
this.app.schemaInitializerManager.add(external_buttons_index_js_namespaceObject.tabPaneInitializers_deprecated);
|
|
150
154
|
this.app.schemaInitializerManager.add(external_buttons_index_js_namespaceObject.tabPaneInitializersForRecordBlock);
|
|
151
155
|
this.app.schemaInitializerManager.add(external_buttons_index_js_namespaceObject.tabPaneInitializersForBulkEditFormBlock);
|
|
152
|
-
this.app.schemaInitializerManager.add(menuItemInitializer_js_namespaceObject.menuItemInitializer_deprecated);
|
|
153
156
|
this.app.schemaInitializerManager.add(menuItemInitializer_js_namespaceObject.menuItemInitializer);
|
|
154
157
|
}
|
|
155
158
|
}
|
|
@@ -349,7 +349,7 @@ const useFormItemInitializerFields = (options)=>{
|
|
|
349
349
|
},
|
|
350
350
|
schema
|
|
351
351
|
};
|
|
352
|
-
if ('Kanban'
|
|
352
|
+
if ('Kanban' === block) resultItem['find'] = (schema, key, action)=>{
|
|
353
353
|
const s = findSchema(schema, 'x-component', block);
|
|
354
354
|
return findSchema(s, key, action);
|
|
355
355
|
};
|
|
@@ -484,10 +484,14 @@ const useAssociatedFormItemInitializerFields = (options)=>{
|
|
|
484
484
|
});
|
|
485
485
|
return groups;
|
|
486
486
|
};
|
|
487
|
-
const getItem = (field, schemaName, collectionName, getCollectionFields, processedCollections)=>{
|
|
487
|
+
const getItem = (field, schemaName, collectionName, getCollectionFields, processedCollections, level, fieldPath)=>{
|
|
488
|
+
if (level >= 3) return null;
|
|
488
489
|
if ([
|
|
489
490
|
'm2o',
|
|
490
|
-
'obo'
|
|
491
|
+
'obo',
|
|
492
|
+
'oho',
|
|
493
|
+
'o2m',
|
|
494
|
+
'm2m'
|
|
491
495
|
].includes(field.interface)) {
|
|
492
496
|
var _field_uiSchema, _field_uiSchema1;
|
|
493
497
|
if (processedCollections.includes(field.target)) return null;
|
|
@@ -496,25 +500,29 @@ const getItem = (field, schemaName, collectionName, getCollectionFields, process
|
|
|
496
500
|
subFields.forEach((subField)=>{
|
|
497
501
|
if ([
|
|
498
502
|
'm2o',
|
|
499
|
-
'obo'
|
|
500
|
-
|
|
503
|
+
'obo',
|
|
504
|
+
'oho',
|
|
505
|
+
'o2m',
|
|
506
|
+
'm2m'
|
|
507
|
+
].includes(subField.interface)) options.push(getResultSchema("".concat(schemaName, ".").concat(subField.name), subField, collectionName, (fieldPath || '') + field.key));
|
|
501
508
|
options.push(getItem(subField, "".concat(schemaName, ".").concat(subField.name), collectionName, getCollectionFields, [
|
|
502
509
|
...processedCollections,
|
|
503
510
|
field.target
|
|
504
|
-
]));
|
|
511
|
+
], level + 1, (fieldPath || '') + field.key));
|
|
505
512
|
});
|
|
506
513
|
return {
|
|
507
514
|
type: 'subMenu',
|
|
508
515
|
name: null === (_field_uiSchema = field.uiSchema) || void 0 === _field_uiSchema ? void 0 : _field_uiSchema.title,
|
|
509
516
|
title: null === (_field_uiSchema1 = field.uiSchema) || void 0 === _field_uiSchema1 ? void 0 : _field_uiSchema1.title,
|
|
517
|
+
key: (fieldPath || '') + field.key + 'menu',
|
|
510
518
|
children: options.filter(Boolean)
|
|
511
519
|
};
|
|
512
520
|
}
|
|
513
521
|
if ((0, utils_js_namespaceObject.isAssocField)(field)) return null;
|
|
514
|
-
return getResultSchema(schemaName, field, collectionName);
|
|
522
|
+
return getResultSchema(schemaName, field, collectionName, (fieldPath || '') + field.key);
|
|
515
523
|
};
|
|
516
|
-
const getResultSchema = (schemaName, field, collectionName)=>{
|
|
517
|
-
var _field_uiSchema, _field_uiSchema1;
|
|
524
|
+
const getResultSchema = (schemaName, field, collectionName, fieldPath)=>{
|
|
525
|
+
var _field_uiSchema, _field_uiSchema1, _field_uiSchema2;
|
|
518
526
|
const schema = {
|
|
519
527
|
type: 'string',
|
|
520
528
|
name: schemaName,
|
|
@@ -531,7 +539,8 @@ const getResultSchema = (schemaName, field, collectionName)=>{
|
|
|
531
539
|
const result = {
|
|
532
540
|
name: (null === (_field_uiSchema = field.uiSchema) || void 0 === _field_uiSchema ? void 0 : _field_uiSchema.title) || field.name,
|
|
533
541
|
type: 'item',
|
|
534
|
-
|
|
542
|
+
key: ((null === (_field_uiSchema1 = field.uiSchema) || void 0 === _field_uiSchema1 ? void 0 : _field_uiSchema1.title) || field.name) + fieldPath,
|
|
543
|
+
title: (null === (_field_uiSchema2 = field.uiSchema) || void 0 === _field_uiSchema2 ? void 0 : _field_uiSchema2.title) || field.name,
|
|
535
544
|
Component: 'CollectionFieldInitializer',
|
|
536
545
|
remove: removeGridFormItem,
|
|
537
546
|
schema
|
|
@@ -544,9 +553,12 @@ const useFilterAssociatedFormItemInitializerFields = ()=>{
|
|
|
544
553
|
const { getCollectionFields } = (0, index_js_namespaceObject.useCollectionManager_deprecated)();
|
|
545
554
|
const interfaces = [
|
|
546
555
|
'm2o',
|
|
547
|
-
'obo'
|
|
556
|
+
'obo',
|
|
557
|
+
'oho',
|
|
558
|
+
'o2m',
|
|
559
|
+
'm2m'
|
|
548
560
|
];
|
|
549
|
-
const groups = null == fields ? void 0 : null === (_fields_filter = fields.filter((field)=>interfaces.includes(field.interface))) || void 0 === _fields_filter ? void 0 : _fields_filter.map((field)=>getItem(field, field.name, name, getCollectionFields, []));
|
|
561
|
+
const groups = null == fields ? void 0 : null === (_fields_filter = fields.filter((field)=>interfaces.includes(field.interface))) || void 0 === _fields_filter ? void 0 : _fields_filter.map((field)=>getItem(field, field.name, name, getCollectionFields, [], 0));
|
|
550
562
|
return groups;
|
|
551
563
|
};
|
|
552
564
|
const useInheritsFormItemInitializerFields = (options)=>{
|
|
@@ -60,7 +60,7 @@ const external_SchemaSettings_js_namespaceObject = require("./SchemaSettings.js"
|
|
|
60
60
|
const external_styles_js_namespaceObject = require("./styles.js");
|
|
61
61
|
const GeneralSchemaDesigner = (props)=>{
|
|
62
62
|
var _rowCtx_cols, _ctx_renderSchemaInitializer;
|
|
63
|
-
const { disableInitializer, title, template, schemaSettings, contextValue, draggable = true, showDataSource = true } = props;
|
|
63
|
+
const { disableInitializer, title, template, schemaSettings, contextValue, draggable = true, showDataSource = true, AddMenuModalComponent } = props;
|
|
64
64
|
const { dn, designable } = (0, external_schema_component_index_js_namespaceObject.useDesignable)();
|
|
65
65
|
const field = (0, schema_namespaceObject.useField)();
|
|
66
66
|
const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
|
|
@@ -135,6 +135,14 @@ const GeneralSchemaDesigner = (props)=>{
|
|
|
135
135
|
size: 3,
|
|
136
136
|
align: 'center',
|
|
137
137
|
children: [
|
|
138
|
+
!!AddMenuModalComponent && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_SchemaSettings_js_namespaceObject.SchemaSettingsDropdown, {
|
|
139
|
+
title: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.PlusOutlined, {
|
|
140
|
+
role: "button",
|
|
141
|
+
"aria-label": getAriaLabel('add-menu')
|
|
142
|
+
}),
|
|
143
|
+
...schemaSettingsProps,
|
|
144
|
+
children: AddMenuModalComponent
|
|
145
|
+
}),
|
|
138
146
|
draggable && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_schema_component_index_js_namespaceObject.DragHandler, {
|
|
139
147
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.DragOutlined, {
|
|
140
148
|
role: "button",
|
|
@@ -410,9 +410,9 @@ const SchemaSettingsFormItemTemplate = function(props) {
|
|
|
410
410
|
});
|
|
411
411
|
};
|
|
412
412
|
const SchemaSettingsItem = (props)=>{
|
|
413
|
+
const { eventKey, title } = props;
|
|
413
414
|
const { pushMenuItem } = (0, useMenuItem_js_namespaceObject.useCollectMenuItems)();
|
|
414
415
|
const { collectMenuItem } = (0, useMenuItem_js_namespaceObject.useCollectMenuItem)();
|
|
415
|
-
const { eventKey, title } = props;
|
|
416
416
|
const { name } = (0, external_index_js_namespaceObject.useSchemaSettingsItem)();
|
|
417
417
|
const item = {
|
|
418
418
|
key: title,
|
|
@@ -475,7 +475,7 @@ const SchemaSettingsDivider = function() {
|
|
|
475
475
|
return null;
|
|
476
476
|
};
|
|
477
477
|
const SchemaSettingsRemove = (props)=>{
|
|
478
|
-
const { confirm, removeParentsIfNoChildren, breakRemoveOn } = props;
|
|
478
|
+
const { icon, confirm, removeParentsIfNoChildren, breakRemoveOn } = props;
|
|
479
479
|
const { dn, template } = useSchemaSettings();
|
|
480
480
|
const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
|
|
481
481
|
const field = (0, schema_namespaceObject.useField)();
|
|
@@ -487,6 +487,12 @@ const SchemaSettingsRemove = (props)=>{
|
|
|
487
487
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SchemaSettingsItem, {
|
|
488
488
|
title: "Delete",
|
|
489
489
|
eventKey: "remove",
|
|
490
|
+
icon: icon ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_index_js_namespaceObject.Icon, {
|
|
491
|
+
style: {
|
|
492
|
+
color: '#eb5050'
|
|
493
|
+
},
|
|
494
|
+
type: icon
|
|
495
|
+
}) : null,
|
|
490
496
|
onClick: ()=>{
|
|
491
497
|
modal.confirm({
|
|
492
498
|
title: t('Delete block'),
|
|
@@ -514,7 +520,12 @@ const SchemaSettingsRemove = (props)=>{
|
|
|
514
520
|
}
|
|
515
521
|
});
|
|
516
522
|
},
|
|
517
|
-
children:
|
|
523
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
524
|
+
style: {
|
|
525
|
+
color: '#eb5050'
|
|
526
|
+
},
|
|
527
|
+
children: t('Delete')
|
|
528
|
+
})
|
|
518
529
|
});
|
|
519
530
|
};
|
|
520
531
|
const SchemaSettingsConnectDataBlocks = (props)=>{
|
|
@@ -1070,7 +1081,8 @@ const SchemaSettingsDefaultSortingRules = function(props) {
|
|
|
1070
1081
|
'x-component-props': {
|
|
1071
1082
|
style: {
|
|
1072
1083
|
width: 260
|
|
1073
|
-
}
|
|
1084
|
+
},
|
|
1085
|
+
optionLabelProp: 'fullLabel'
|
|
1074
1086
|
}
|
|
1075
1087
|
},
|
|
1076
1088
|
direction: {
|
|
@@ -32,6 +32,7 @@ const Plugin_js_namespaceObject = require("../application/Plugin.js");
|
|
|
32
32
|
const addChildActionSettings_js_namespaceObject = require("../modules/actions/add-child/addChildActionSettings.js");
|
|
33
33
|
const addNewActionSettings_js_namespaceObject = require("../modules/actions/add-new/addNewActionSettings.js");
|
|
34
34
|
const customizeAddRecordActionSettings_js_namespaceObject = require("../modules/actions/add-record/customizeAddRecordActionSettings.js");
|
|
35
|
+
const AssociateActionSettings_js_namespaceObject = require("../modules/actions/associate/AssociateActionSettings.js");
|
|
35
36
|
const bulkDeleteActionSettings_js_namespaceObject = require("../modules/actions/bulk-destroy/bulkDeleteActionSettings.js");
|
|
36
37
|
const deleteActionSettings_js_namespaceObject = require("../modules/actions/delete/deleteActionSettings.js");
|
|
37
38
|
const disassociateActionSettings_js_namespaceObject = require("../modules/actions/disassociate/disassociateActionSettings.js");
|
|
@@ -113,6 +114,7 @@ class SchemaSettingsPlugin extends Plugin_js_namespaceObject.Plugin {
|
|
|
113
114
|
this.schemaSettingsManager.add(customizeSaveRecordActionSettings_js_namespaceObject.customizeSaveRecordActionSettings);
|
|
114
115
|
this.schemaSettingsManager.add(addChildActionSettings_js_namespaceObject.addChildActionSettings);
|
|
115
116
|
this.schemaSettingsManager.add(expendableActionSettings_js_namespaceObject.expendableActionSettings);
|
|
117
|
+
this.schemaSettingsManager.add(AssociateActionSettings_js_namespaceObject.associateActionSettings);
|
|
116
118
|
this.schemaSettingsManager.add(fieldSettingsFormItem_js_namespaceObject.fieldSettingsFormItem);
|
|
117
119
|
this.schemaSettingsManager.add(FilterItemCustomSettings_js_namespaceObject.FilterItemCustomSettings);
|
|
118
120
|
this.schemaSettingsManager.add(tableColumnSettings_js_namespaceObject.tableColumnSettings);
|
|
@@ -39,7 +39,7 @@ function _tagged_template_literal(strings, raw) {
|
|
|
39
39
|
}
|
|
40
40
|
function _templateObject() {
|
|
41
41
|
const data = _tagged_template_literal([
|
|
42
|
-
"\n pointer-events: none;\n position: absolute;\n font-size: 12px;\n
|
|
42
|
+
"\n pointer-events: none;\n position: absolute;\n font-size: 12px;\n padding: 0;\n line-height: 16px;\n height: 16px;\n border-bottom-right-radius: 2px;\n border-radius: 2px;\n top: 2px;\n left: 2px;\n .title-tag {\n padding: 0 3px;\n border-radius: 2px;\n background: var(--colorSettings);\n color: #fff;\n display: block;\n }\n "
|
|
43
43
|
]);
|
|
44
44
|
_templateObject = function() {
|
|
45
45
|
return data;
|
|
@@ -48,7 +48,7 @@ function _templateObject() {
|
|
|
48
48
|
}
|
|
49
49
|
function _templateObject1() {
|
|
50
50
|
const data = _tagged_template_literal([
|
|
51
|
-
"\n & .ant-space-item .anticon {\n margin: 0;\n }\n\n &:hover {\n display:
|
|
51
|
+
"\n & .ant-space-item .anticon {\n margin: 0;\n }\n\n &:hover {\n display: flex !important;\n }\n "
|
|
52
52
|
]);
|
|
53
53
|
_templateObject1 = function() {
|
|
54
54
|
return data;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/client",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.35",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"mathjs": "^10.6.4",
|
|
43
43
|
"mitt": "^3.0.1",
|
|
44
44
|
"nanoid": "^3.3.8",
|
|
45
|
+
"rc-menu": "9.16.0",
|
|
45
46
|
"rc-tree-select": "^5.25.0",
|
|
46
47
|
"rc-util": "^5.44.2",
|
|
47
48
|
"react-beautiful-dnd": "^13.1.1",
|
|
@@ -63,12 +64,12 @@
|
|
|
63
64
|
"react-zoom-pan-pinch": "^3.6.1",
|
|
64
65
|
"sanitize-html": "2.14.0",
|
|
65
66
|
"use-deep-compare-effect": "^1.8.1",
|
|
66
|
-
"@tachybase/
|
|
67
|
-
"@tachybase/requirejs": "0.23.
|
|
68
|
-
"@tachybase/
|
|
69
|
-
"@tachybase/
|
|
70
|
-
"@tachybase/
|
|
71
|
-
"@tachybase/utils": "0.23.
|
|
67
|
+
"@tachybase/components": "0.23.35",
|
|
68
|
+
"@tachybase/requirejs": "0.23.35",
|
|
69
|
+
"@tachybase/sdk": "0.23.35",
|
|
70
|
+
"@tachybase/evaluators": "0.23.35",
|
|
71
|
+
"@tachybase/schema": "0.23.35",
|
|
72
|
+
"@tachybase/utils": "0.23.35"
|
|
72
73
|
},
|
|
73
74
|
"devDependencies": {
|
|
74
75
|
"@testing-library/react": "^14.3.1",
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
|
|
2
|
-
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
3
|
-
const AutoScalingText = (param)=>{
|
|
4
|
-
let { children } = param;
|
|
5
|
-
const ref = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)();
|
|
6
|
-
const [scale, setScale] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(1);
|
|
7
|
-
(0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
|
|
8
|
-
const observer = new ResizeObserver((entries)=>{
|
|
9
|
-
const node = entries[0].target;
|
|
10
|
-
const parentNode = node.parentNode;
|
|
11
|
-
const availableWidth = parentNode.offsetWidth;
|
|
12
|
-
const actualWidth = node.offsetWidth;
|
|
13
|
-
const actualScale = availableWidth / actualWidth;
|
|
14
|
-
setScale((scale)=>{
|
|
15
|
-
if (actualScale < 1) return actualScale;
|
|
16
|
-
if (scale < 1) return 1;
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
const node = ref.current;
|
|
20
|
-
observer.observe(node);
|
|
21
|
-
return ()=>observer.unobserve(node);
|
|
22
|
-
}, []);
|
|
23
|
-
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
|
|
24
|
-
className: "auto-scaling-text",
|
|
25
|
-
style: {
|
|
26
|
-
transition: 'transform 0.5s ease',
|
|
27
|
-
transform: "scale(".concat(scale, ",").concat(scale, ")")
|
|
28
|
-
},
|
|
29
|
-
ref: ref,
|
|
30
|
-
children: children
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
export { AutoScalingText };
|