@tachybase/client 0.23.22 → 0.23.40

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.
Files changed (203) hide show
  1. package/es/application/schema-initializer/components/SchemaInitializerButton.mjs +1 -1
  2. package/es/application/schema-initializer/components/SchemaInitializerChildren.mjs +1 -1
  3. package/es/built-in/admin-layout/AdminLayout.mjs +15 -1
  4. package/es/built-in/admin-layout/InternalAdminLayout.mjs +4 -2
  5. package/es/built-in/admin-layout/MenuEditor.mjs +2 -2
  6. package/es/built-in/admin-layout/style.d.ts +1 -1
  7. package/es/built-in/admin-layout/style.mjs +4 -4
  8. package/es/built-in/attachment-preview/previewers/file-pdf.mjs +4 -2
  9. package/es/built-in/context-menu/ContextMenu.provider.d.ts +1 -0
  10. package/es/built-in/context-menu/ContextMenu.provider.mjs +29 -1
  11. package/es/built-in/context-menu/index.mjs +1 -0
  12. package/es/built-in/index.mjs +44 -10
  13. package/es/built-in/page-style/TabHeader.d.ts +1 -1
  14. package/es/built-in/page-style/TabHeader.mjs +26 -33
  15. package/es/built-in/page-style/TabHeader.style.d.ts +4 -0
  16. package/es/built-in/page-style/TabHeader.style.mjs +35 -0
  17. package/es/built-in/pinned-list/PinnedPluginListProvider.d.ts +3 -1
  18. package/es/built-in/pinned-list/PinnedPluginListProvider.mjs +5 -4
  19. package/es/built-in/scroll-assistant/useJoystick.mjs +3 -1
  20. package/es/built-in/setting-layout/SettingLayout.mjs +10 -1
  21. package/es/built-in/{assistant/calculator → setting-layout}/style.d.ts +1 -1
  22. package/es/built-in/setting-layout/style.mjs +25 -0
  23. package/es/collection-manager/action-hooks.d.ts +1 -4
  24. package/es/collection-manager/action-hooks.mjs +39 -11
  25. package/es/icon/preloaded.mjs +4 -4
  26. package/es/index.d.ts +0 -1
  27. package/es/index.mjs +0 -1
  28. package/es/modules/actions/associate/AssociateActionInitializer.d.ts +1 -0
  29. package/es/modules/actions/associate/AssociateActionInitializer.mjs +71 -0
  30. package/es/modules/actions/associate/AssociateActionProvider.d.ts +7 -0
  31. package/es/modules/actions/associate/AssociateActionProvider.mjs +82 -0
  32. package/es/modules/actions/associate/AssociateActionSettings.d.ts +2 -0
  33. package/es/modules/actions/associate/AssociateActionSettings.mjs +57 -0
  34. package/es/modules/blocks/data-blocks/details-multi/detailsWithPaginationSettings.mjs +2 -1
  35. package/es/modules/blocks/data-blocks/form/RecordFormBlockInitializer.mjs +21 -14
  36. package/es/modules/blocks/data-blocks/form/createEditFormBlockUISchema.d.ts +1 -2
  37. package/es/modules/blocks/data-blocks/grid-card/gridCardBlockSettings.mjs +2 -1
  38. package/es/modules/blocks/data-blocks/list/listBlockSettings.mjs +2 -1
  39. package/es/modules/blocks/data-blocks/table/TableActionInitializers.mjs +15 -0
  40. package/es/modules/blocks/data-blocks/table/tableBlockSettings.mjs +2 -1
  41. package/es/modules/blocks/data-blocks/table/tableColumnSettings.mjs +2 -2
  42. package/es/modules/blocks/data-blocks/table-selector/tableSelectorBlockSettings.mjs +2 -1
  43. package/es/modules/fields/component/Cascader/cascaderComponentFieldSettings.mjs +2 -1
  44. package/es/modules/fields/component/Radio/radioComponentFieldSettings.mjs +4 -0
  45. package/es/modules/fields/component/Select/selectComponentFieldSettings.mjs +16 -2
  46. package/es/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.mjs +2 -1
  47. package/es/modules/menu/GroupItem.mjs +5 -1
  48. package/es/modules/menu/LinkMenuItem.mjs +7 -3
  49. package/es/modules/menu/PageMenuItem.mjs +5 -1
  50. package/es/modules/menu/UploadMenuItem.d.ts +1 -0
  51. package/es/modules/menu/UploadMenuItem.mjs +81 -0
  52. package/es/modules/menu/menuItemInitializer.d.ts +0 -4
  53. package/es/modules/menu/menuItemInitializer.mjs +3 -23
  54. package/es/schema-component/antd/action/Action.Designer.mjs +4 -1
  55. package/es/schema-component/antd/association-select/AssociationSelect.mjs +4 -2
  56. package/es/schema-component/antd/checkbox/Checkbox.mjs +11 -6
  57. package/es/schema-component/antd/date-picker/DatePicker.mjs +4 -0
  58. package/es/schema-component/antd/form-item/FormItem.Settings.d.ts +2 -0
  59. package/es/schema-component/antd/form-item/FormItem.Settings.mjs +14 -1
  60. package/es/schema-component/antd/form-v2/Form.Settings.mjs +2 -1
  61. package/es/schema-component/antd/grid-card/GridCard.Designer.mjs +2 -1
  62. package/es/schema-component/antd/list/List.Designer.mjs +2 -1
  63. package/es/schema-component/antd/menu/AdminMenu.d.ts +1 -0
  64. package/es/schema-component/antd/menu/AdminMenu.mjs +75 -0
  65. package/es/schema-component/antd/menu/AdminMenu.style.d.ts +4 -0
  66. package/es/schema-component/antd/menu/AdminMenu.style.mjs +36 -0
  67. package/es/schema-component/antd/menu/Menu.Designer.d.ts +2 -1
  68. package/es/schema-component/antd/menu/Menu.Designer.mjs +62 -42
  69. package/es/schema-component/antd/menu/Menu.mjs +124 -163
  70. package/es/schema-component/antd/menu/Menu.styles.d.ts +1 -2
  71. package/es/schema-component/antd/menu/Menu.styles.mjs +8 -20
  72. package/es/schema-component/antd/menu/MenuAdd.d.ts +1 -0
  73. package/es/schema-component/antd/menu/MenuAdd.mjs +18 -0
  74. package/es/schema-component/antd/menu/MenuSearchAdd.d.ts +7 -0
  75. package/es/schema-component/antd/menu/MenuSearchAdd.mjs +41 -0
  76. package/es/schema-component/antd/menu/MenuSearchAdd.style.d.ts +3 -0
  77. package/es/schema-component/antd/menu/MenuSearchAdd.style.mjs +25 -0
  78. package/es/schema-component/antd/menu/tools.d.ts +9 -0
  79. package/es/schema-component/antd/menu/tools.mjs +36 -0
  80. package/es/schema-component/antd/scroll-area/ScrollArea.mjs +0 -17
  81. package/es/schema-component/antd/select/Select.d.ts +3 -13
  82. package/es/schema-component/antd/select/Select.mjs +33 -2
  83. package/es/schema-component/antd/table/Table.Void.Designer.mjs +2 -1
  84. package/es/schema-component/antd/table-v2/TableBlockDesigner.mjs +2 -1
  85. package/es/schema-component/antd/table-v2/TableSelectorDesigner.mjs +2 -1
  86. package/es/schema-component/common/dnd-context/index.d.ts +1 -2
  87. package/es/schema-component/common/sortable-item/DragHandleMenu.d.ts +1 -0
  88. package/es/schema-component/common/sortable-item/DragHandleMenu.mjs +78 -0
  89. package/es/schema-component/common/sortable-item/DragHandleMenu.style.d.ts +3 -0
  90. package/es/schema-component/common/sortable-item/DragHandleMenu.style.mjs +25 -0
  91. package/es/schema-component/common/sortable-item/SortableItem.d.ts +1 -0
  92. package/es/schema-initializer/SchemaInitializerPlugin.mjs +5 -2
  93. package/es/schema-initializer/utils.mjs +9 -7
  94. package/es/schema-settings/GeneralSchemaDesigner.d.ts +2 -1
  95. package/es/schema-settings/GeneralSchemaDesigner.mjs +9 -1
  96. package/es/schema-settings/SchemaSettings.d.ts +3 -1
  97. package/es/schema-settings/SchemaSettings.mjs +16 -4
  98. package/es/schema-settings/SchemaSettingsPlugin.mjs +2 -0
  99. package/es/schema-settings/SchemaSettingsSortingRule.mjs +2 -1
  100. package/es/schema-settings/styles.mjs +2 -2
  101. package/lib/application/schema-initializer/components/SchemaInitializerButton.js +1 -1
  102. package/lib/application/schema-initializer/components/SchemaInitializerChildren.js +1 -1
  103. package/lib/built-in/admin-layout/AdminLayout.js +15 -1
  104. package/lib/built-in/admin-layout/InternalAdminLayout.js +4 -2
  105. package/lib/built-in/admin-layout/MenuEditor.js +2 -2
  106. package/lib/built-in/admin-layout/style.js +4 -4
  107. package/lib/built-in/attachment-preview/previewers/file-pdf.js +4 -2
  108. package/lib/built-in/context-menu/ContextMenu.provider.js +29 -0
  109. package/lib/built-in/context-menu/index.js +1 -0
  110. package/lib/built-in/index.js +142 -114
  111. package/lib/built-in/page-style/TabHeader.js +26 -33
  112. package/lib/built-in/page-style/TabHeader.style.js +69 -0
  113. package/lib/built-in/pinned-list/PinnedPluginListProvider.js +5 -4
  114. package/lib/built-in/scroll-assistant/useJoystick.js +17 -1
  115. package/lib/built-in/setting-layout/SettingLayout.js +10 -1
  116. package/lib/built-in/{assistant/context.js → setting-layout/style.js} +24 -5
  117. package/lib/collection-manager/action-hooks.js +39 -11
  118. package/lib/icon/preloaded.js +4 -4
  119. package/lib/index.js +71 -86
  120. package/lib/locale/en_US.js +8 -0
  121. package/lib/locale/zh-CN.js +8 -0
  122. package/lib/modules/actions/associate/AssociateActionInitializer.js +105 -0
  123. package/lib/modules/actions/associate/AssociateActionProvider.js +116 -0
  124. package/lib/modules/actions/associate/AssociateActionSettings.js +91 -0
  125. package/lib/modules/blocks/data-blocks/details-multi/detailsWithPaginationSettings.js +2 -1
  126. package/lib/modules/blocks/data-blocks/form/RecordFormBlockInitializer.js +21 -14
  127. package/lib/modules/blocks/data-blocks/grid-card/gridCardBlockSettings.js +2 -1
  128. package/lib/modules/blocks/data-blocks/list/listBlockSettings.js +2 -1
  129. package/lib/modules/blocks/data-blocks/table/TableActionInitializers.js +15 -0
  130. package/lib/modules/blocks/data-blocks/table/tableBlockSettings.js +2 -1
  131. package/lib/modules/blocks/data-blocks/table/tableColumnSettings.js +2 -2
  132. package/lib/modules/blocks/data-blocks/table-selector/tableSelectorBlockSettings.js +2 -1
  133. package/lib/modules/fields/component/Cascader/cascaderComponentFieldSettings.js +2 -1
  134. package/lib/modules/fields/component/Radio/radioComponentFieldSettings.js +4 -0
  135. package/lib/modules/fields/component/Select/selectComponentFieldSettings.js +16 -2
  136. package/lib/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.js +2 -1
  137. package/lib/modules/menu/GroupItem.js +5 -1
  138. package/lib/modules/menu/LinkMenuItem.js +7 -3
  139. package/lib/modules/menu/PageMenuItem.js +5 -1
  140. package/lib/modules/menu/UploadMenuItem.js +115 -0
  141. package/lib/modules/menu/menuItemInitializer.js +2 -23
  142. package/lib/schema-component/antd/action/Action.Designer.js +4 -1
  143. package/lib/schema-component/antd/association-select/AssociationSelect.js +4 -2
  144. package/lib/schema-component/antd/checkbox/Checkbox.js +11 -6
  145. package/lib/schema-component/antd/date-picker/DatePicker.js +4 -0
  146. package/lib/schema-component/antd/form-item/FormItem.Settings.js +16 -1
  147. package/lib/schema-component/antd/form-v2/Form.Settings.js +2 -1
  148. package/lib/schema-component/antd/grid-card/GridCard.Designer.js +2 -1
  149. package/lib/schema-component/antd/list/List.Designer.js +2 -1
  150. package/lib/schema-component/antd/menu/AdminMenu.js +109 -0
  151. package/lib/schema-component/antd/menu/AdminMenu.style.js +70 -0
  152. package/lib/schema-component/antd/menu/Menu.Designer.js +62 -41
  153. package/lib/schema-component/antd/menu/Menu.js +124 -163
  154. package/lib/schema-component/antd/menu/Menu.styles.js +8 -20
  155. package/lib/{built-in/assistant/calculator/CalculatorDisplay.js → schema-component/antd/menu/MenuAdd.js} +14 -17
  156. package/lib/schema-component/antd/menu/MenuSearchAdd.js +89 -0
  157. package/lib/schema-component/antd/menu/MenuSearchAdd.style.js +59 -0
  158. package/lib/schema-component/antd/menu/tools.js +72 -0
  159. package/lib/schema-component/antd/scroll-area/ScrollArea.js +0 -17
  160. package/lib/schema-component/antd/select/Select.js +33 -2
  161. package/lib/schema-component/antd/table/Table.Void.Designer.js +2 -1
  162. package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +2 -1
  163. package/lib/schema-component/antd/table-v2/TableSelectorDesigner.js +2 -1
  164. package/lib/schema-component/common/sortable-item/DragHandleMenu.js +112 -0
  165. package/lib/schema-component/common/sortable-item/DragHandleMenu.style.js +59 -0
  166. package/lib/schema-initializer/SchemaInitializerPlugin.js +5 -2
  167. package/lib/schema-initializer/utils.js +9 -7
  168. package/lib/schema-settings/GeneralSchemaDesigner.js +9 -1
  169. package/lib/schema-settings/SchemaSettings.js +16 -4
  170. package/lib/schema-settings/SchemaSettingsPlugin.js +2 -0
  171. package/lib/schema-settings/SchemaSettingsSortingRule.js +2 -1
  172. package/lib/schema-settings/styles.js +2 -2
  173. package/package.json +8 -7
  174. package/es/built-in/assistant/Assistant.provider.d.ts +0 -9
  175. package/es/built-in/assistant/Assistant.provider.mjs +0 -125
  176. package/es/built-in/assistant/calculator/AutoScalingText.d.ts +0 -3
  177. package/es/built-in/assistant/calculator/AutoScalingText.mjs +0 -33
  178. package/es/built-in/assistant/calculator/Calculator.d.ts +0 -2
  179. package/es/built-in/assistant/calculator/Calculator.mjs +0 -235
  180. package/es/built-in/assistant/calculator/CalculatorDisplay.d.ts +0 -4
  181. package/es/built-in/assistant/calculator/CalculatorDisplay.mjs +0 -21
  182. package/es/built-in/assistant/calculator/CalculatorKey.d.ts +0 -5
  183. package/es/built-in/assistant/calculator/CalculatorKey.mjs +0 -11
  184. package/es/built-in/assistant/calculator/CalculatorProvider.d.ts +0 -10
  185. package/es/built-in/assistant/calculator/CalculatorProvider.mjs +0 -29
  186. package/es/built-in/assistant/calculator/Draggable.d.ts +0 -8
  187. package/es/built-in/assistant/calculator/Draggable.mjs +0 -54
  188. package/es/built-in/assistant/calculator/style.mjs +0 -25
  189. package/es/built-in/assistant/context.d.ts +0 -3
  190. package/es/built-in/assistant/context.mjs +0 -6
  191. package/es/built-in/assistant/index.d.ts +0 -7
  192. package/es/built-in/assistant/index.mjs +0 -16
  193. package/es/built-in/assistant/search-and-jump/index.d.ts +0 -16
  194. package/es/built-in/assistant/search-and-jump/index.mjs +0 -59
  195. package/lib/built-in/assistant/Assistant.provider.js +0 -161
  196. package/lib/built-in/assistant/calculator/AutoScalingText.js +0 -67
  197. package/lib/built-in/assistant/calculator/Calculator.js +0 -283
  198. package/lib/built-in/assistant/calculator/CalculatorKey.js +0 -45
  199. package/lib/built-in/assistant/calculator/CalculatorProvider.js +0 -65
  200. package/lib/built-in/assistant/calculator/Draggable.js +0 -102
  201. package/lib/built-in/assistant/calculator/style.js +0 -59
  202. package/lib/built-in/assistant/index.js +0 -107
  203. package/lib/built-in/assistant/search-and-jump/index.js +0 -96
@@ -1,7 +0,0 @@
1
- import { Plugin } from '../../application/Plugin';
2
- export * from './context';
3
- export * from './Assistant.provider';
4
- export declare class PluginAssistant extends Plugin {
5
- load(): Promise<void>;
6
- afterLoad(): Promise<void>;
7
- }
@@ -1,16 +0,0 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE__application_Plugin_mjs__ from "../../application/Plugin.mjs";
2
- import * as __WEBPACK_EXTERNAL_MODULE__calculator_CalculatorProvider_mjs__ from "./calculator/CalculatorProvider.mjs";
3
- import * as __WEBPACK_EXTERNAL_MODULE__search_and_jump_index_mjs__ from "./search-and-jump/index.mjs";
4
- export * from "./context.mjs";
5
- export * from "./Assistant.provider.mjs";
6
- class PluginAssistant extends __WEBPACK_EXTERNAL_MODULE__application_Plugin_mjs__.Plugin {
7
- async load() {
8
- this.app.use(__WEBPACK_EXTERNAL_MODULE__search_and_jump_index_mjs__.SearchAndJumpProvider);
9
- this.app.use(__WEBPACK_EXTERNAL_MODULE__calculator_CalculatorProvider_mjs__.CalculatorProvider);
10
- this.app.use(AssistantListProvider, this.options.config);
11
- }
12
- async afterLoad() {
13
- this.app.use(AssistantProvider);
14
- }
15
- }
16
- export { PluginAssistant };
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
- export declare const SearchAndJumpContext: React.Context<{
3
- open: boolean;
4
- setOpen: (open: boolean | ((open: boolean) => boolean)) => void;
5
- }>;
6
- export declare const SearchAndJumpProvider: ({ children }: {
7
- children: any;
8
- }) => import("react/jsx-runtime").JSX.Element;
9
- export declare const useSearchAndJump: () => {
10
- open: boolean;
11
- setOpen: (open: boolean | ((open: boolean) => boolean)) => void;
12
- };
13
- export declare const SearchAndJump: ({ open, setOpen }: {
14
- open: any;
15
- setOpen: any;
16
- }) => import("react/jsx-runtime").JSX.Element;
@@ -1,59 +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
- import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
4
- const SearchAndJumpContext = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.createContext)({
5
- open: false,
6
- setOpen: (open)=>{}
7
- });
8
- const SearchAndJumpProvider = (param)=>{
9
- let { children } = param;
10
- const [open, setOpen] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(false);
11
- return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(SearchAndJumpContext.Provider, {
12
- value: {
13
- open,
14
- setOpen
15
- },
16
- children: [
17
- children,
18
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(SearchAndJump, {
19
- open: open,
20
- setOpen: setOpen
21
- })
22
- ]
23
- });
24
- };
25
- const useSearchAndJump = ()=>(0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(SearchAndJumpContext);
26
- const SearchAndJump = (param)=>{
27
- let { open, setOpen } = param;
28
- const inputRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)();
29
- (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
30
- if (open && inputRef.current) setTimeout(()=>{
31
- inputRef.current.focus();
32
- }, 0);
33
- }, [
34
- open,
35
- inputRef
36
- ]);
37
- const handleOk = ()=>{
38
- setOpen(false);
39
- };
40
- const handleCancel = ()=>{
41
- setOpen(false);
42
- };
43
- return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Modal, {
44
- title: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Input, {
45
- style: {
46
- width: '100%'
47
- },
48
- autoFocus: true,
49
- ref: inputRef
50
- }),
51
- closable: false,
52
- open: open,
53
- onOk: handleOk,
54
- onCancel: handleCancel,
55
- footer: null,
56
- children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("p", {})
57
- });
58
- };
59
- export { SearchAndJump, SearchAndJumpContext, SearchAndJumpProvider, useSearchAndJump };
@@ -1,161 +0,0 @@
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
- AssistantProvider: ()=>AssistantProvider,
30
- AssistantList: ()=>AssistantList,
31
- AssistantListProvider: ()=>AssistantListProvider
32
- });
33
- const jsx_runtime_namespaceObject = require("react/jsx-runtime");
34
- const external_react_namespaceObject = require("react");
35
- const schema_namespaceObject = require("@tachybase/schema");
36
- const icons_namespaceObject = require("@ant-design/icons");
37
- const external_antd_namespaceObject = require("antd");
38
- const external_antd_style_namespaceObject = require("antd-style");
39
- const external_lodash_namespaceObject = require("lodash");
40
- const external_react_hotkeys_hook_namespaceObject = require("react-hotkeys-hook");
41
- const index_js_namespaceObject = require("../../icon/index.js");
42
- const external_schema_component_index_js_namespaceObject = require("../../schema-component/index.js");
43
- const external_acl_index_js_namespaceObject = require("../acl/index.js");
44
- const external_context_menu_index_js_namespaceObject = require("../context-menu/index.js");
45
- const CalculatorProvider_js_namespaceObject = require("./calculator/CalculatorProvider.js");
46
- const external_context_js_namespaceObject = require("./context.js");
47
- const external_search_and_jump_index_js_namespaceObject = require("./search-and-jump/index.js");
48
- function _tagged_template_literal(strings, raw) {
49
- if (!raw) raw = strings.slice(0);
50
- return Object.freeze(Object.defineProperties(strings, {
51
- raw: {
52
- value: Object.freeze(raw)
53
- }
54
- }));
55
- }
56
- function _templateObject() {
57
- const data = _tagged_template_literal([
58
- "\n display: inline-block;\n .ant-btn {\n border: 0;\n height: var(--tb-header-height);\n width: 46px;\n border-radius: 0;\n color: rgba(255, 255, 255, 0.65);\n &:hover {\n background: rgba(255, 255, 255, 0.1) !important;\n }\n }\n "
59
- ]);
60
- _templateObject = function() {
61
- return data;
62
- };
63
- return data;
64
- }
65
- const AssistantProvider = (param)=>{
66
- let { children } = param;
67
- const { designable, setDesignable } = (0, external_schema_component_index_js_namespaceObject.useDesignable)();
68
- const { visible, setVisible } = (0, CalculatorProvider_js_namespaceObject.useCalculator)();
69
- const { setOpen } = (0, external_search_and_jump_index_js_namespaceObject.useSearchAndJump)();
70
- (0, external_react_namespaceObject.useRef)();
71
- (0, external_react_hotkeys_hook_namespaceObject.useHotkeys)('Ctrl+Shift+U', ()=>setDesignable(!designable), [
72
- designable
73
- ]);
74
- (0, external_react_hotkeys_hook_namespaceObject.useHotkeys)('Ctrl+K', ()=>setOpen((open)=>!open), []);
75
- (0, external_react_hotkeys_hook_namespaceObject.useHotkeys)('Cmd+K', ()=>setOpen((open)=>!open), []);
76
- const { contextMenuEnabled, setContextMenuEnable } = (0, external_context_menu_index_js_namespaceObject.useContextMenu)();
77
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
78
- children: [
79
- children,
80
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_antd_namespaceObject.FloatButton.Group, {
81
- trigger: "hover",
82
- type: "default",
83
- style: {
84
- right: 24,
85
- zIndex: 1250
86
- },
87
- icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.ToolOutlined, {}),
88
- children: [
89
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.FloatButton, {
90
- icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.SearchOutlined, {}),
91
- onClick: ()=>setOpen(true)
92
- }),
93
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.FloatButton, {
94
- icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.Icon, {
95
- type: "Design"
96
- }),
97
- type: designable ? 'primary' : 'default',
98
- onClick: ()=>setDesignable(!designable)
99
- }),
100
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.FloatButton, {
101
- type: visible ? 'primary' : 'default',
102
- icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.CalculatorOutlined, {}),
103
- onClick: ()=>{
104
- setVisible((visible)=>!visible);
105
- }
106
- }),
107
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.FloatButton, {
108
- type: contextMenuEnabled ? 'primary' : 'default',
109
- icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.ToolOutlined, {
110
- onClick: ()=>setContextMenuEnable(!contextMenuEnabled)
111
- })
112
- }),
113
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(AssistantList, {})
114
- ]
115
- })
116
- ]
117
- });
118
- };
119
- const AssistantListProvider = (props)=>{
120
- const { children, items } = props;
121
- const ctx = (0, external_react_namespaceObject.useContext)(external_context_js_namespaceObject.AssistantListContext);
122
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(jsx_runtime_namespaceObject.Fragment, {
123
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_context_js_namespaceObject.AssistantListContext.Provider, {
124
- value: {
125
- items: {
126
- ...ctx.items,
127
- ...items
128
- }
129
- },
130
- children: children
131
- })
132
- });
133
- };
134
- const useStyles = (0, external_antd_style_namespaceObject.createStyles)((param)=>{
135
- let { css } = param;
136
- return {
137
- container: css(_templateObject())
138
- };
139
- });
140
- const AssistantList = ()=>{
141
- const { allowAll, snippets } = (0, external_acl_index_js_namespaceObject.useACLRoleContext)();
142
- const getSnippetsAllow = function(aclKey) {
143
- let isPublic = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
144
- return allowAll || isPublic || (null == snippets ? void 0 : snippets.includes(aclKey));
145
- };
146
- const { styles } = useStyles();
147
- const ctx = (0, external_react_namespaceObject.useContext)(external_context_js_namespaceObject.AssistantListContext);
148
- const { components } = (0, external_react_namespaceObject.useContext)(schema_namespaceObject.SchemaOptionsContext);
149
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
150
- className: styles.container,
151
- children: Object.keys(ctx.items).sort((a, b)=>ctx.items[a].order - ctx.items[b].order).filter((key)=>getSnippetsAllow(ctx.items[key].snippet, ctx.items[key].isPublic)).map((key)=>{
152
- const Action = (0, external_lodash_namespaceObject.get)(components, ctx.items[key].component);
153
- return Action ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Action, {}, key) : null;
154
- })
155
- });
156
- };
157
- var __webpack_export_target__ = exports;
158
- for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
159
- if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
160
- value: true
161
- });
@@ -1,67 +0,0 @@
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
- AutoScalingText: ()=>AutoScalingText
30
- });
31
- const jsx_runtime_namespaceObject = require("react/jsx-runtime");
32
- const external_react_namespaceObject = require("react");
33
- const AutoScalingText = (param)=>{
34
- let { children } = param;
35
- const ref = (0, external_react_namespaceObject.useRef)();
36
- const [scale, setScale] = (0, external_react_namespaceObject.useState)(1);
37
- (0, external_react_namespaceObject.useEffect)(()=>{
38
- const observer = new ResizeObserver((entries)=>{
39
- const node = entries[0].target;
40
- const parentNode = node.parentNode;
41
- const availableWidth = parentNode.offsetWidth;
42
- const actualWidth = node.offsetWidth;
43
- const actualScale = availableWidth / actualWidth;
44
- setScale((scale)=>{
45
- if (actualScale < 1) return actualScale;
46
- if (scale < 1) return 1;
47
- });
48
- });
49
- const node = ref.current;
50
- observer.observe(node);
51
- return ()=>observer.unobserve(node);
52
- }, []);
53
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
54
- className: "auto-scaling-text",
55
- style: {
56
- transition: 'transform 0.5s ease',
57
- transform: "scale(".concat(scale, ",").concat(scale, ")")
58
- },
59
- ref: ref,
60
- children: children
61
- });
62
- };
63
- var __webpack_export_target__ = exports;
64
- for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
65
- if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
66
- value: true
67
- });
@@ -1,283 +0,0 @@
1
- "use strict";
2
- var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.n = function(module) {
5
- var getter = module && module.__esModule ? function() {
6
- return module['default'];
7
- } : function() {
8
- return module;
9
- };
10
- __webpack_require__.d(getter, {
11
- a: getter
12
- });
13
- return getter;
14
- };
15
- })();
16
- (()=>{
17
- __webpack_require__.d = function(exports1, definition) {
18
- for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
19
- enumerable: true,
20
- get: definition[key]
21
- });
22
- };
23
- })();
24
- (()=>{
25
- __webpack_require__.o = function(obj, prop) {
26
- return Object.prototype.hasOwnProperty.call(obj, prop);
27
- };
28
- })();
29
- (()=>{
30
- __webpack_require__.r = function(exports1) {
31
- if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
32
- value: 'Module'
33
- });
34
- Object.defineProperty(exports1, '__esModule', {
35
- value: true
36
- });
37
- };
38
- })();
39
- var __webpack_exports__ = {};
40
- __webpack_require__.r(__webpack_exports__);
41
- __webpack_require__.d(__webpack_exports__, {
42
- CalculatorWrapper: ()=>CalculatorWrapper
43
- });
44
- const jsx_runtime_namespaceObject = require("react/jsx-runtime");
45
- const external_react_namespaceObject = require("react");
46
- var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_namespaceObject);
47
- const external_CalculatorDisplay_js_namespaceObject = require("./CalculatorDisplay.js");
48
- const external_CalculatorKey_js_namespaceObject = require("./CalculatorKey.js");
49
- const external_style_js_namespaceObject = require("./style.js");
50
- const CalculatorOperations = {
51
- '/': (prevValue, nextValue)=>prevValue / nextValue,
52
- '*': (prevValue, nextValue)=>prevValue * nextValue,
53
- '+': (prevValue, nextValue)=>prevValue + nextValue,
54
- '-': (prevValue, nextValue)=>prevValue - nextValue,
55
- '=': (prevValue, nextValue)=>nextValue
56
- };
57
- const Calculator = /*#__PURE__*/ external_react_default().forwardRef((param, ref)=>{
58
- let { className } = param;
59
- const [value, setValue] = (0, external_react_namespaceObject.useState)(null);
60
- const [displayValue, setDisplayValue] = (0, external_react_namespaceObject.useState)('0');
61
- const [operator, setOperator] = (0, external_react_namespaceObject.useState)(null);
62
- const [waitingForOperand, setWaitingForOperand] = (0, external_react_namespaceObject.useState)(false);
63
- const clearAll = ()=>{
64
- setValue(null);
65
- setDisplayValue('0');
66
- setOperator(null);
67
- setWaitingForOperand(false);
68
- };
69
- const clearDisplay = ()=>{
70
- setDisplayValue('0');
71
- };
72
- const clearLastChar = ()=>{
73
- setDisplayValue(displayValue.substring(0, displayValue.length - 1) || '0');
74
- };
75
- const toggleSign = ()=>{
76
- const newValue = -1 * parseFloat(displayValue);
77
- setDisplayValue(String(newValue));
78
- };
79
- const inputPercent = ()=>{
80
- const currentValue = parseFloat(displayValue);
81
- if (0 === currentValue) return;
82
- const fixedDigits = displayValue.replace(/^-?\d*\.?/, '');
83
- const newValue = parseFloat(displayValue) / 100;
84
- setDisplayValue(String(newValue.toFixed(fixedDigits.length + 2)));
85
- };
86
- const inputDot = ()=>{
87
- if (!/\./.test(displayValue)) {
88
- setDisplayValue(displayValue + '.');
89
- setWaitingForOperand(false);
90
- }
91
- };
92
- const inputDigit = (digit)=>{
93
- if (waitingForOperand) {
94
- setDisplayValue(String(digit));
95
- setWaitingForOperand(false);
96
- } else setDisplayValue('0' === displayValue ? String(digit) : displayValue + digit);
97
- };
98
- const performOperation = (nextOperator)=>{
99
- const inputValue = parseFloat(displayValue);
100
- if (null == value) setValue(inputValue);
101
- else if (operator) {
102
- const currentValue = value || 0;
103
- const newValue = CalculatorOperations[operator](currentValue, inputValue);
104
- setValue(newValue);
105
- setDisplayValue(String(newValue));
106
- }
107
- setWaitingForOperand(true);
108
- setOperator(nextOperator);
109
- };
110
- (0, external_react_namespaceObject.useEffect)(()=>{
111
- const handleKeyDown = (event)=>{
112
- let { key } = event;
113
- if ('Enter' === key) key = '=';
114
- if (/\d/.test(key)) {
115
- event.preventDefault();
116
- inputDigit(parseInt(key, 10));
117
- } else if (key in CalculatorOperations) {
118
- event.preventDefault();
119
- performOperation(key);
120
- } else if ('.' === key) {
121
- event.preventDefault();
122
- inputDot();
123
- } else if ('%' === key) {
124
- event.preventDefault();
125
- inputPercent();
126
- } else if ('Backspace' === key) {
127
- event.preventDefault();
128
- clearLastChar();
129
- } else if ('Clear' === key) {
130
- event.preventDefault();
131
- if ('0' !== displayValue) clearDisplay();
132
- else clearAll();
133
- }
134
- };
135
- document.addEventListener('keydown', handleKeyDown);
136
- return ()=>{
137
- document.removeEventListener('keydown', handleKeyDown);
138
- };
139
- });
140
- const clearKey = '0' !== displayValue;
141
- const clearText = clearKey ? 'C' : 'AC';
142
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
143
- className: "calculator",
144
- ref: ref,
145
- children: [
146
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CalculatorDisplay_js_namespaceObject.CalculatorDisplay, {
147
- value: displayValue
148
- }),
149
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
150
- className: "calculator-keypad",
151
- children: [
152
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
153
- className: "input-keys",
154
- children: [
155
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
156
- className: "function-keys",
157
- children: [
158
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CalculatorKey_js_namespaceObject.CalculatorKey, {
159
- className: "key-clear",
160
- onPress: ()=>clearKey ? clearDisplay() : clearAll(),
161
- children: clearText
162
- }),
163
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CalculatorKey_js_namespaceObject.CalculatorKey, {
164
- className: "key-sign",
165
- onPress: ()=>toggleSign(),
166
- children: "\xb1"
167
- }),
168
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CalculatorKey_js_namespaceObject.CalculatorKey, {
169
- className: "key-percent",
170
- onPress: ()=>inputPercent(),
171
- children: "%"
172
- })
173
- ]
174
- }),
175
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
176
- className: "digit-keys",
177
- children: [
178
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CalculatorKey_js_namespaceObject.CalculatorKey, {
179
- className: "key-0",
180
- onPress: ()=>inputDigit(0),
181
- children: "0"
182
- }),
183
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CalculatorKey_js_namespaceObject.CalculatorKey, {
184
- className: "key-dot",
185
- onPress: ()=>inputDot(),
186
- children: "●"
187
- }),
188
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CalculatorKey_js_namespaceObject.CalculatorKey, {
189
- className: "key-1",
190
- onPress: ()=>inputDigit(1),
191
- children: "1"
192
- }),
193
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CalculatorKey_js_namespaceObject.CalculatorKey, {
194
- className: "key-2",
195
- onPress: ()=>inputDigit(2),
196
- children: "2"
197
- }),
198
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CalculatorKey_js_namespaceObject.CalculatorKey, {
199
- className: "key-3",
200
- onPress: ()=>inputDigit(3),
201
- children: "3"
202
- }),
203
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CalculatorKey_js_namespaceObject.CalculatorKey, {
204
- className: "key-4",
205
- onPress: ()=>inputDigit(4),
206
- children: "4"
207
- }),
208
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CalculatorKey_js_namespaceObject.CalculatorKey, {
209
- className: "key-5",
210
- onPress: ()=>inputDigit(5),
211
- children: "5"
212
- }),
213
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CalculatorKey_js_namespaceObject.CalculatorKey, {
214
- className: "key-6",
215
- onPress: ()=>inputDigit(6),
216
- children: "6"
217
- }),
218
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CalculatorKey_js_namespaceObject.CalculatorKey, {
219
- className: "key-7",
220
- onPress: ()=>inputDigit(7),
221
- children: "7"
222
- }),
223
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CalculatorKey_js_namespaceObject.CalculatorKey, {
224
- className: "key-8",
225
- onPress: ()=>inputDigit(8),
226
- children: "8"
227
- }),
228
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CalculatorKey_js_namespaceObject.CalculatorKey, {
229
- className: "key-9",
230
- onPress: ()=>inputDigit(9),
231
- children: "9"
232
- })
233
- ]
234
- })
235
- ]
236
- }),
237
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
238
- className: "operator-keys",
239
- children: [
240
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CalculatorKey_js_namespaceObject.CalculatorKey, {
241
- className: "key-divide",
242
- onPress: ()=>performOperation('/'),
243
- children: "\xf7"
244
- }),
245
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CalculatorKey_js_namespaceObject.CalculatorKey, {
246
- className: "key-multiply",
247
- onPress: ()=>performOperation('*'),
248
- children: "\xd7"
249
- }),
250
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CalculatorKey_js_namespaceObject.CalculatorKey, {
251
- className: "key-subtract",
252
- onPress: ()=>performOperation('-'),
253
- children: "−"
254
- }),
255
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CalculatorKey_js_namespaceObject.CalculatorKey, {
256
- className: "key-add",
257
- onPress: ()=>performOperation('+'),
258
- children: "+"
259
- }),
260
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CalculatorKey_js_namespaceObject.CalculatorKey, {
261
- className: "key-equals",
262
- onPress: ()=>performOperation('='),
263
- children: "="
264
- })
265
- ]
266
- })
267
- ]
268
- })
269
- ]
270
- });
271
- });
272
- const CalculatorWrapper = /*#__PURE__*/ external_react_default().forwardRef((props, ref)=>{
273
- const { styles } = (0, external_style_js_namespaceObject.useStyles)();
274
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Calculator, {
275
- ref: ref,
276
- className: styles.container
277
- });
278
- });
279
- var __webpack_export_target__ = exports;
280
- for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
281
- if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
282
- value: true
283
- });
@@ -1,45 +0,0 @@
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
- CalculatorKey: ()=>CalculatorKey
30
- });
31
- const jsx_runtime_namespaceObject = require("react/jsx-runtime");
32
- require("react");
33
- const CalculatorKey = (param)=>{
34
- let { onPress, className, ...props } = param;
35
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
36
- onClick: onPress,
37
- className: "calculator-key ".concat(className),
38
- ...props
39
- });
40
- };
41
- var __webpack_export_target__ = exports;
42
- for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
43
- if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
44
- value: true
45
- });