@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tachybase/client",
3
- "version": "0.23.22",
3
+ "version": "0.23.40",
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/components": "0.23.22",
67
- "@tachybase/schema": "0.23.22",
68
- "@tachybase/requirejs": "0.23.22",
69
- "@tachybase/sdk": "0.23.22",
70
- "@tachybase/utils": "0.23.22",
71
- "@tachybase/evaluators": "0.23.22"
67
+ "@tachybase/components": "0.23.40",
68
+ "@tachybase/evaluators": "0.23.40",
69
+ "@tachybase/requirejs": "0.23.40",
70
+ "@tachybase/schema": "0.23.40",
71
+ "@tachybase/utils": "0.23.40",
72
+ "@tachybase/sdk": "0.23.40"
72
73
  },
73
74
  "devDependencies": {
74
75
  "@testing-library/react": "^14.3.1",
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- export declare const AssistantProvider: ({ children }: {
3
- children: any;
4
- }) => import("react/jsx-runtime").JSX.Element;
5
- export declare const AssistantListProvider: (props: {
6
- items: any;
7
- children: React.ReactNode;
8
- }) => import("react/jsx-runtime").JSX.Element;
9
- export declare const AssistantList: () => import("react/jsx-runtime").JSX.Element;
@@ -1,125 +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__tachybase_schema__ from "@tachybase/schema";
4
- import * as __WEBPACK_EXTERNAL_MODULE__ant_design_icons__ from "@ant-design/icons";
5
- import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
6
- import * as __WEBPACK_EXTERNAL_MODULE_antd_style__ from "antd-style";
7
- import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash";
8
- import * as __WEBPACK_EXTERNAL_MODULE_react_hotkeys_hook__ from "react-hotkeys-hook";
9
- import * as __WEBPACK_EXTERNAL_MODULE__icon_index_mjs__ from "../../icon/index.mjs";
10
- import * as __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__ from "../../schema-component/index.mjs";
11
- import * as __WEBPACK_EXTERNAL_MODULE__acl_index_mjs__ from "../acl/index.mjs";
12
- import * as __WEBPACK_EXTERNAL_MODULE__context_menu_index_mjs__ from "../context-menu/index.mjs";
13
- import * as __WEBPACK_EXTERNAL_MODULE__calculator_CalculatorProvider_mjs__ from "./calculator/CalculatorProvider.mjs";
14
- import * as __WEBPACK_EXTERNAL_MODULE__context_mjs__ from "./context.mjs";
15
- import * as __WEBPACK_EXTERNAL_MODULE__search_and_jump_index_mjs__ from "./search-and-jump/index.mjs";
16
- function _tagged_template_literal(strings, raw) {
17
- if (!raw) raw = strings.slice(0);
18
- return Object.freeze(Object.defineProperties(strings, {
19
- raw: {
20
- value: Object.freeze(raw)
21
- }
22
- }));
23
- }
24
- function _templateObject() {
25
- const data = _tagged_template_literal([
26
- "\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 "
27
- ]);
28
- _templateObject = function() {
29
- return data;
30
- };
31
- return data;
32
- }
33
- const AssistantProvider = (param)=>{
34
- let { children } = param;
35
- const { designable, setDesignable } = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useDesignable)();
36
- const { visible, setVisible } = (0, __WEBPACK_EXTERNAL_MODULE__calculator_CalculatorProvider_mjs__.useCalculator)();
37
- const { setOpen } = (0, __WEBPACK_EXTERNAL_MODULE__search_and_jump_index_mjs__.useSearchAndJump)();
38
- (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)();
39
- (0, __WEBPACK_EXTERNAL_MODULE_react_hotkeys_hook__.useHotkeys)('Ctrl+Shift+U', ()=>setDesignable(!designable), [
40
- designable
41
- ]);
42
- (0, __WEBPACK_EXTERNAL_MODULE_react_hotkeys_hook__.useHotkeys)('Ctrl+K', ()=>setOpen((open)=>!open), []);
43
- (0, __WEBPACK_EXTERNAL_MODULE_react_hotkeys_hook__.useHotkeys)('Cmd+K', ()=>setOpen((open)=>!open), []);
44
- const { contextMenuEnabled, setContextMenuEnable } = (0, __WEBPACK_EXTERNAL_MODULE__context_menu_index_mjs__.useContextMenu)();
45
- return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.Fragment, {
46
- children: [
47
- children,
48
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(__WEBPACK_EXTERNAL_MODULE_antd__.FloatButton.Group, {
49
- trigger: "hover",
50
- type: "default",
51
- style: {
52
- right: 24,
53
- zIndex: 1250
54
- },
55
- icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__ant_design_icons__.ToolOutlined, {}),
56
- children: [
57
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.FloatButton, {
58
- icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__ant_design_icons__.SearchOutlined, {}),
59
- onClick: ()=>setOpen(true)
60
- }),
61
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.FloatButton, {
62
- icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__icon_index_mjs__.Icon, {
63
- type: "Design"
64
- }),
65
- type: designable ? 'primary' : 'default',
66
- onClick: ()=>setDesignable(!designable)
67
- }),
68
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.FloatButton, {
69
- type: visible ? 'primary' : 'default',
70
- icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__ant_design_icons__.CalculatorOutlined, {}),
71
- onClick: ()=>{
72
- setVisible((visible)=>!visible);
73
- }
74
- }),
75
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.FloatButton, {
76
- type: contextMenuEnabled ? 'primary' : 'default',
77
- icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__ant_design_icons__.ToolOutlined, {
78
- onClick: ()=>setContextMenuEnable(!contextMenuEnabled)
79
- })
80
- }),
81
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(AssistantList, {})
82
- ]
83
- })
84
- ]
85
- });
86
- };
87
- const AssistantListProvider = (props)=>{
88
- const { children, items } = props;
89
- const ctx = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(__WEBPACK_EXTERNAL_MODULE__context_mjs__.AssistantListContext);
90
- return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.Fragment, {
91
- children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__context_mjs__.AssistantListContext.Provider, {
92
- value: {
93
- items: {
94
- ...ctx.items,
95
- ...items
96
- }
97
- },
98
- children: children
99
- })
100
- });
101
- };
102
- const useStyles = (0, __WEBPACK_EXTERNAL_MODULE_antd_style__.createStyles)((param)=>{
103
- let { css } = param;
104
- return {
105
- container: css(_templateObject())
106
- };
107
- });
108
- const AssistantList = ()=>{
109
- const { allowAll, snippets } = (0, __WEBPACK_EXTERNAL_MODULE__acl_index_mjs__.useACLRoleContext)();
110
- const getSnippetsAllow = function(aclKey) {
111
- let isPublic = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
112
- return allowAll || isPublic || (null == snippets ? void 0 : snippets.includes(aclKey));
113
- };
114
- const { styles } = useStyles();
115
- const ctx = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(__WEBPACK_EXTERNAL_MODULE__context_mjs__.AssistantListContext);
116
- const { components } = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.SchemaOptionsContext);
117
- return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
118
- className: styles.container,
119
- 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)=>{
120
- const Action = (0, __WEBPACK_EXTERNAL_MODULE_lodash__.get)(components, ctx.items[key].component);
121
- return Action ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(Action, {}, key) : null;
122
- })
123
- });
124
- };
125
- export { AssistantList, AssistantListProvider, AssistantProvider };
@@ -1,3 +0,0 @@
1
- export declare const AutoScalingText: ({ children }: {
2
- children: any;
3
- }) => import("react/jsx-runtime").JSX.Element;
@@ -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 };
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const CalculatorWrapper: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
@@ -1,235 +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__CalculatorDisplay_mjs__ from "./CalculatorDisplay.mjs";
4
- import * as __WEBPACK_EXTERNAL_MODULE__CalculatorKey_mjs__ from "./CalculatorKey.mjs";
5
- import * as __WEBPACK_EXTERNAL_MODULE__style_mjs__ from "./style.mjs";
6
- const CalculatorOperations = {
7
- '/': (prevValue, nextValue)=>prevValue / nextValue,
8
- '*': (prevValue, nextValue)=>prevValue * nextValue,
9
- '+': (prevValue, nextValue)=>prevValue + nextValue,
10
- '-': (prevValue, nextValue)=>prevValue - nextValue,
11
- '=': (prevValue, nextValue)=>nextValue
12
- };
13
- const Calculator = /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].forwardRef((param, ref)=>{
14
- let { className } = param;
15
- const [value, setValue] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(null);
16
- const [displayValue, setDisplayValue] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)('0');
17
- const [operator, setOperator] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(null);
18
- const [waitingForOperand, setWaitingForOperand] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(false);
19
- const clearAll = ()=>{
20
- setValue(null);
21
- setDisplayValue('0');
22
- setOperator(null);
23
- setWaitingForOperand(false);
24
- };
25
- const clearDisplay = ()=>{
26
- setDisplayValue('0');
27
- };
28
- const clearLastChar = ()=>{
29
- setDisplayValue(displayValue.substring(0, displayValue.length - 1) || '0');
30
- };
31
- const toggleSign = ()=>{
32
- const newValue = -1 * parseFloat(displayValue);
33
- setDisplayValue(String(newValue));
34
- };
35
- const inputPercent = ()=>{
36
- const currentValue = parseFloat(displayValue);
37
- if (0 === currentValue) return;
38
- const fixedDigits = displayValue.replace(/^-?\d*\.?/, '');
39
- const newValue = parseFloat(displayValue) / 100;
40
- setDisplayValue(String(newValue.toFixed(fixedDigits.length + 2)));
41
- };
42
- const inputDot = ()=>{
43
- if (!/\./.test(displayValue)) {
44
- setDisplayValue(displayValue + '.');
45
- setWaitingForOperand(false);
46
- }
47
- };
48
- const inputDigit = (digit)=>{
49
- if (waitingForOperand) {
50
- setDisplayValue(String(digit));
51
- setWaitingForOperand(false);
52
- } else setDisplayValue('0' === displayValue ? String(digit) : displayValue + digit);
53
- };
54
- const performOperation = (nextOperator)=>{
55
- const inputValue = parseFloat(displayValue);
56
- if (null == value) setValue(inputValue);
57
- else if (operator) {
58
- const currentValue = value || 0;
59
- const newValue = CalculatorOperations[operator](currentValue, inputValue);
60
- setValue(newValue);
61
- setDisplayValue(String(newValue));
62
- }
63
- setWaitingForOperand(true);
64
- setOperator(nextOperator);
65
- };
66
- (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
67
- const handleKeyDown = (event)=>{
68
- let { key } = event;
69
- if ('Enter' === key) key = '=';
70
- if (/\d/.test(key)) {
71
- event.preventDefault();
72
- inputDigit(parseInt(key, 10));
73
- } else if (key in CalculatorOperations) {
74
- event.preventDefault();
75
- performOperation(key);
76
- } else if ('.' === key) {
77
- event.preventDefault();
78
- inputDot();
79
- } else if ('%' === key) {
80
- event.preventDefault();
81
- inputPercent();
82
- } else if ('Backspace' === key) {
83
- event.preventDefault();
84
- clearLastChar();
85
- } else if ('Clear' === key) {
86
- event.preventDefault();
87
- if ('0' !== displayValue) clearDisplay();
88
- else clearAll();
89
- }
90
- };
91
- document.addEventListener('keydown', handleKeyDown);
92
- return ()=>{
93
- document.removeEventListener('keydown', handleKeyDown);
94
- };
95
- });
96
- const clearKey = '0' !== displayValue;
97
- const clearText = clearKey ? 'C' : 'AC';
98
- return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
99
- className: "calculator",
100
- ref: ref,
101
- children: [
102
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__CalculatorDisplay_mjs__.CalculatorDisplay, {
103
- value: displayValue
104
- }),
105
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
106
- className: "calculator-keypad",
107
- children: [
108
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
109
- className: "input-keys",
110
- children: [
111
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
112
- className: "function-keys",
113
- children: [
114
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__CalculatorKey_mjs__.CalculatorKey, {
115
- className: "key-clear",
116
- onPress: ()=>clearKey ? clearDisplay() : clearAll(),
117
- children: clearText
118
- }),
119
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__CalculatorKey_mjs__.CalculatorKey, {
120
- className: "key-sign",
121
- onPress: ()=>toggleSign(),
122
- children: "\xb1"
123
- }),
124
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__CalculatorKey_mjs__.CalculatorKey, {
125
- className: "key-percent",
126
- onPress: ()=>inputPercent(),
127
- children: "%"
128
- })
129
- ]
130
- }),
131
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
132
- className: "digit-keys",
133
- children: [
134
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__CalculatorKey_mjs__.CalculatorKey, {
135
- className: "key-0",
136
- onPress: ()=>inputDigit(0),
137
- children: "0"
138
- }),
139
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__CalculatorKey_mjs__.CalculatorKey, {
140
- className: "key-dot",
141
- onPress: ()=>inputDot(),
142
- children: "●"
143
- }),
144
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__CalculatorKey_mjs__.CalculatorKey, {
145
- className: "key-1",
146
- onPress: ()=>inputDigit(1),
147
- children: "1"
148
- }),
149
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__CalculatorKey_mjs__.CalculatorKey, {
150
- className: "key-2",
151
- onPress: ()=>inputDigit(2),
152
- children: "2"
153
- }),
154
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__CalculatorKey_mjs__.CalculatorKey, {
155
- className: "key-3",
156
- onPress: ()=>inputDigit(3),
157
- children: "3"
158
- }),
159
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__CalculatorKey_mjs__.CalculatorKey, {
160
- className: "key-4",
161
- onPress: ()=>inputDigit(4),
162
- children: "4"
163
- }),
164
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__CalculatorKey_mjs__.CalculatorKey, {
165
- className: "key-5",
166
- onPress: ()=>inputDigit(5),
167
- children: "5"
168
- }),
169
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__CalculatorKey_mjs__.CalculatorKey, {
170
- className: "key-6",
171
- onPress: ()=>inputDigit(6),
172
- children: "6"
173
- }),
174
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__CalculatorKey_mjs__.CalculatorKey, {
175
- className: "key-7",
176
- onPress: ()=>inputDigit(7),
177
- children: "7"
178
- }),
179
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__CalculatorKey_mjs__.CalculatorKey, {
180
- className: "key-8",
181
- onPress: ()=>inputDigit(8),
182
- children: "8"
183
- }),
184
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__CalculatorKey_mjs__.CalculatorKey, {
185
- className: "key-9",
186
- onPress: ()=>inputDigit(9),
187
- children: "9"
188
- })
189
- ]
190
- })
191
- ]
192
- }),
193
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
194
- className: "operator-keys",
195
- children: [
196
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__CalculatorKey_mjs__.CalculatorKey, {
197
- className: "key-divide",
198
- onPress: ()=>performOperation('/'),
199
- children: "\xf7"
200
- }),
201
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__CalculatorKey_mjs__.CalculatorKey, {
202
- className: "key-multiply",
203
- onPress: ()=>performOperation('*'),
204
- children: "\xd7"
205
- }),
206
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__CalculatorKey_mjs__.CalculatorKey, {
207
- className: "key-subtract",
208
- onPress: ()=>performOperation('-'),
209
- children: "−"
210
- }),
211
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__CalculatorKey_mjs__.CalculatorKey, {
212
- className: "key-add",
213
- onPress: ()=>performOperation('+'),
214
- children: "+"
215
- }),
216
- /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__CalculatorKey_mjs__.CalculatorKey, {
217
- className: "key-equals",
218
- onPress: ()=>performOperation('='),
219
- children: "="
220
- })
221
- ]
222
- })
223
- ]
224
- })
225
- ]
226
- });
227
- });
228
- const CalculatorWrapper = /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].forwardRef((props, ref)=>{
229
- const { styles } = (0, __WEBPACK_EXTERNAL_MODULE__style_mjs__.useStyles)();
230
- return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(Calculator, {
231
- ref: ref,
232
- className: styles.container
233
- });
234
- });
235
- export { CalculatorWrapper };
@@ -1,4 +0,0 @@
1
- export declare const CalculatorDisplay: ({ value, ...props }: {
2
- [x: string]: any;
3
- value: any;
4
- }) => import("react/jsx-runtime").JSX.Element;
@@ -1,21 +0,0 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
2
- import "react";
3
- import * as __WEBPACK_EXTERNAL_MODULE__AutoScalingText_mjs__ from "./AutoScalingText.mjs";
4
- const CalculatorDisplay = (param)=>{
5
- let { value, ...props } = param;
6
- const language = navigator.language || 'en-US';
7
- let formattedValue = parseFloat(value).toLocaleString(language, {
8
- useGrouping: true,
9
- maximumFractionDigits: 6
10
- });
11
- const match = value.match(/\.\d*?(0*)$/);
12
- if (match) formattedValue += /[1-9]/.test(match[0]) ? match[1] : match[0];
13
- return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
14
- ...props,
15
- className: "calculator-display",
16
- children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__AutoScalingText_mjs__.AutoScalingText, {
17
- children: formattedValue
18
- })
19
- });
20
- };
21
- export { CalculatorDisplay };
@@ -1,5 +0,0 @@
1
- export declare const CalculatorKey: ({ onPress, className, ...props }: {
2
- [x: string]: any;
3
- onPress: any;
4
- className: any;
5
- }) => import("react/jsx-runtime").JSX.Element;
@@ -1,11 +0,0 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
2
- import "react";
3
- const CalculatorKey = (param)=>{
4
- let { onPress, className, ...props } = param;
5
- return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("button", {
6
- onClick: onPress,
7
- className: "calculator-key ".concat(className),
8
- ...props
9
- });
10
- };
11
- export { CalculatorKey };
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- export interface CalculatorProps {
3
- visible: any;
4
- setVisible: any;
5
- }
6
- export declare const CalculatorContext: React.Context<Partial<CalculatorProps>>;
7
- export declare const useCalculator: () => Partial<CalculatorProps>;
8
- export declare const CalculatorProvider: ({ children }: {
9
- children: any;
10
- }) => import("react/jsx-runtime").JSX.Element;
@@ -1,29 +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_react_dom__ from "react-dom";
4
- import * as __WEBPACK_EXTERNAL_MODULE__Calculator_mjs__ from "./Calculator.mjs";
5
- import * as __WEBPACK_EXTERNAL_MODULE__Draggable_mjs__ from "./Draggable.mjs";
6
- import * as __WEBPACK_EXTERNAL_MODULE__style_mjs__ from "./style.mjs";
7
- const CalculatorContext = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.createContext)({});
8
- const useCalculator = ()=>(0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(CalculatorContext);
9
- const CalculatorProvider = (param)=>{
10
- let { children } = param;
11
- const [visible, setVisible] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(false);
12
- const { styles } = (0, __WEBPACK_EXTERNAL_MODULE__style_mjs__.useStyles)();
13
- return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(CalculatorContext.Provider, {
14
- value: {
15
- visible,
16
- setVisible
17
- },
18
- children: [
19
- children,
20
- visible ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_dom__.createPortal)(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
21
- className: styles.container,
22
- children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__Draggable_mjs__.Draggable, {
23
- children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__Calculator_mjs__.CalculatorWrapper, {})
24
- })
25
- }), document.body) : null
26
- ]
27
- });
28
- };
29
- export { CalculatorContext, CalculatorProvider, useCalculator };
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- export declare const Draggable: ({ children, updateTransform, }: {
3
- children: any;
4
- updateTransform?: (transformStr: any, tx: any, ty: any, tdom: any) => void;
5
- }) => React.DetailedReactHTMLElement<{
6
- ref: React.MutableRefObject<any>;
7
- style: any;
8
- }, HTMLElement>;
@@ -1,54 +0,0 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
2
- const Draggable = (param)=>{
3
- let { children, updateTransform = (transformStr, tx, ty, tdom)=>{
4
- tdom.style.transform = transformStr;
5
- } } = param;
6
- const ref = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)();
7
- const positionRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)({
8
- startX: 0,
9
- startY: 0,
10
- dx: 0,
11
- dy: 0,
12
- tx: 0,
13
- ty: 0
14
- });
15
- (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
16
- const node = ref.current;
17
- if (!node) return;
18
- const start = (event)=>{
19
- if (0 !== event.button) return;
20
- document.addEventListener('mousemove', docMove);
21
- positionRef.current.startX = event.pageX - positionRef.current.dx;
22
- positionRef.current.startY = event.pageY - positionRef.current.dy;
23
- };
24
- const docMove = (event)=>{
25
- const tx = event.pageX - positionRef.current.startX;
26
- const ty = event.pageY - positionRef.current.startY;
27
- const transformStr = "translate(".concat(tx, "px,").concat(ty, "px)");
28
- updateTransform(transformStr, tx, ty, node);
29
- positionRef.current.dx = tx;
30
- positionRef.current.dy = ty;
31
- };
32
- const docMouseUp = (event)=>{
33
- document.removeEventListener('mousemove', docMove);
34
- };
35
- node.addEventListener('mousedown', start);
36
- document.addEventListener('mouseup', docMouseUp);
37
- return ()=>{
38
- node.removeEventListener('mousedown', start);
39
- document.removeEventListener('mouseup', docMouseUp);
40
- };
41
- }, [
42
- updateTransform
43
- ]);
44
- const newStyle = {
45
- ...children.props.style,
46
- cursor: 'move',
47
- userSelect: 'none'
48
- };
49
- return /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].cloneElement(__WEBPACK_EXTERNAL_MODULE_react__["default"].Children.only(children), {
50
- ref,
51
- style: newStyle
52
- });
53
- };
54
- export { Draggable };
@@ -1,25 +0,0 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_antd_style__ from "antd-style";
2
- function _tagged_template_literal(strings, raw) {
3
- if (!raw) raw = strings.slice(0);
4
- return Object.freeze(Object.defineProperties(strings, {
5
- raw: {
6
- value: Object.freeze(raw)
7
- }
8
- }));
9
- }
10
- function _templateObject() {
11
- const data = _tagged_template_literal([
12
- "\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 320px;\n height: 520px;\n z-index: 1350;\n\n button {\n display: block;\n background: none;\n border: none;\n padding: 0;\n font-family: inherit;\n user-select: none;\n cursor: pointer;\n outline: none;\n\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n }\n\n button:active {\n box-shadow: inset 0px 0px 80px 0px rgba(0, 0, 0, 0.25);\n }\n\n .calculator {\n width: 100%;\n height: 100%;\n background: black;\n\n display: flex;\n flex-direction: column;\n }\n\n #wrapper .calculator {\n box-shadow: 0px 0px 20px 0px #aaa;\n }\n\n .calculator-display {\n color: white;\n background: #1c191c;\n line-height: 130px;\n font-size: 6em;\n\n flex: 1;\n }\n\n .auto-scaling-text {\n display: inline-block;\n }\n\n .calculator-display .auto-scaling-text {\n padding: 0 30px;\n position: absolute;\n right: 0;\n transform-origin: right;\n }\n\n .calculator-keypad {\n height: 400px;\n\n display: flex;\n }\n\n .calculator .input-keys {\n width: 240px;\n }\n\n .calculator .function-keys {\n display: flex;\n }\n\n .calculator .digit-keys {\n background: #e0e0e7;\n\n display: flex;\n flex-direction: row;\n flex-wrap: wrap-reverse;\n }\n\n .calculator-key {\n width: 80px;\n height: 80px;\n border-top: 1px solid #777;\n border-right: 1px solid #666;\n text-align: center;\n line-height: 80px;\n }\n .calculator .function-keys .calculator-key {\n font-size: 2em;\n }\n .calculator .function-keys .key-multiply {\n line-height: 50px;\n }\n .calculator .digit-keys .calculator-key {\n font-size: 2.25em;\n }\n .calculator .digit-keys .key-0 {\n width: 160px;\n text-align: left;\n padding-left: 32px;\n }\n .calculator .digit-keys .key-dot {\n padding-top: 1em;\n font-size: 0.75em;\n }\n .calculator .operator-keys .calculator-key {\n color: white;\n border-right: 0;\n font-size: 3em;\n }\n\n .calculator .function-keys {\n background: linear-gradient(to bottom, rgba(202, 202, 204, 1) 0%, rgba(196, 194, 204, 1) 100%);\n }\n .calculator .operator-keys {\n background: linear-gradient(to bottom, rgba(252, 156, 23, 1) 0%, rgba(247, 126, 27, 1) 100%);\n }\n "
13
- ]);
14
- _templateObject = function() {
15
- return data;
16
- };
17
- return data;
18
- }
19
- const useStyles = (0, __WEBPACK_EXTERNAL_MODULE_antd_style__.createStyles)((param)=>{
20
- let { css } = param;
21
- return {
22
- container: css(_templateObject())
23
- };
24
- });
25
- export { useStyles };
@@ -1,3 +0,0 @@
1
- export declare const AssistantListContext: import("react").Context<{
2
- items: {};
3
- }>;
@@ -1,6 +0,0 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
2
- const AssistantListContext = (0, __WEBPACK_EXTERNAL_MODULE_react__.createContext)({
3
- items: {}
4
- });
5
- AssistantListContext.displayName = 'AssistantListContext';
6
- export { AssistantListContext };