@tachybase/client 0.23.22 → 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.
Files changed (187) hide show
  1. package/es/application/schema-initializer/components/SchemaInitializerChildren.mjs +1 -1
  2. package/es/built-in/admin-layout/InternalAdminLayout.mjs +4 -2
  3. package/es/built-in/admin-layout/MenuEditor.mjs +2 -2
  4. package/es/built-in/admin-layout/style.d.ts +1 -1
  5. package/es/built-in/admin-layout/style.mjs +4 -4
  6. package/es/built-in/assistant/Assistant.provider.d.ts +0 -6
  7. package/es/built-in/assistant/Assistant.provider.mjs +15 -112
  8. package/es/built-in/assistant/index.d.ts +0 -1
  9. package/es/built-in/assistant/index.mjs +0 -7
  10. package/es/built-in/attachment-preview/previewers/file-pdf.mjs +4 -2
  11. package/es/built-in/context-menu/ContextMenu.provider.d.ts +1 -0
  12. package/es/built-in/context-menu/ContextMenu.provider.mjs +29 -1
  13. package/es/built-in/context-menu/index.mjs +1 -0
  14. package/es/built-in/index.mjs +44 -5
  15. package/es/built-in/page-style/TabHeader.d.ts +1 -1
  16. package/es/built-in/page-style/TabHeader.mjs +26 -33
  17. package/es/built-in/page-style/TabHeader.style.d.ts +4 -0
  18. package/es/built-in/page-style/TabHeader.style.mjs +35 -0
  19. package/es/built-in/pinned-list/PinnedPluginListProvider.d.ts +3 -1
  20. package/es/built-in/pinned-list/PinnedPluginListProvider.mjs +5 -4
  21. package/es/built-in/scroll-assistant/useJoystick.mjs +3 -1
  22. package/es/built-in/setting-layout/SettingLayout.mjs +10 -1
  23. package/es/built-in/{assistant/calculator → setting-layout}/style.d.ts +1 -1
  24. package/es/built-in/setting-layout/style.mjs +25 -0
  25. package/es/collection-manager/action-hooks.d.ts +1 -4
  26. package/es/collection-manager/action-hooks.mjs +39 -11
  27. package/es/icon/preloaded.mjs +4 -4
  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 +71 -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 +1 -1
  68. package/es/schema-component/antd/menu/Menu.Designer.mjs +59 -40
  69. package/es/schema-component/antd/menu/Menu.mjs +108 -141
  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/MenuSearch.d.ts +5 -0
  73. package/es/schema-component/antd/menu/MenuSearch.mjs +32 -0
  74. package/es/schema-component/antd/menu/tools.d.ts +9 -0
  75. package/es/schema-component/antd/menu/tools.mjs +36 -0
  76. package/es/schema-component/antd/scroll-area/ScrollArea.mjs +0 -17
  77. package/es/schema-component/antd/select/Select.d.ts +3 -13
  78. package/es/schema-component/antd/select/Select.mjs +33 -2
  79. package/es/schema-component/antd/table/Table.Void.Designer.mjs +2 -1
  80. package/es/schema-component/antd/table-v2/TableBlockDesigner.mjs +2 -1
  81. package/es/schema-component/antd/table-v2/TableSelectorDesigner.mjs +2 -1
  82. package/es/schema-component/common/dnd-context/index.d.ts +1 -2
  83. package/es/schema-component/common/sortable-item/DragHandleMenu.d.ts +1 -0
  84. package/es/schema-component/common/sortable-item/DragHandleMenu.mjs +78 -0
  85. package/es/schema-component/common/sortable-item/DragHandleMenu.style.d.ts +3 -0
  86. package/es/schema-component/common/sortable-item/DragHandleMenu.style.mjs +25 -0
  87. package/es/schema-initializer/SchemaInitializerPlugin.mjs +5 -2
  88. package/es/schema-initializer/utils.mjs +9 -7
  89. package/es/schema-settings/GeneralSchemaDesigner.d.ts +2 -1
  90. package/es/schema-settings/GeneralSchemaDesigner.mjs +9 -1
  91. package/es/schema-settings/SchemaSettings.d.ts +3 -1
  92. package/es/schema-settings/SchemaSettings.mjs +16 -4
  93. package/es/schema-settings/SchemaSettingsPlugin.mjs +2 -0
  94. package/es/schema-settings/SchemaSettingsSortingRule.mjs +2 -1
  95. package/es/schema-settings/styles.mjs +2 -2
  96. package/lib/application/schema-initializer/components/SchemaInitializerChildren.js +1 -1
  97. package/lib/built-in/admin-layout/InternalAdminLayout.js +4 -2
  98. package/lib/built-in/admin-layout/MenuEditor.js +2 -2
  99. package/lib/built-in/admin-layout/style.js +4 -4
  100. package/lib/built-in/assistant/Assistant.provider.js +16 -115
  101. package/lib/built-in/assistant/index.js +3 -16
  102. package/lib/built-in/attachment-preview/previewers/file-pdf.js +4 -2
  103. package/lib/built-in/context-menu/ContextMenu.provider.js +29 -0
  104. package/lib/built-in/context-menu/index.js +1 -0
  105. package/lib/built-in/index.js +44 -5
  106. package/lib/built-in/page-style/TabHeader.js +26 -33
  107. package/lib/built-in/page-style/TabHeader.style.js +69 -0
  108. package/lib/built-in/pinned-list/PinnedPluginListProvider.js +5 -4
  109. package/lib/built-in/scroll-assistant/useJoystick.js +17 -1
  110. package/lib/built-in/setting-layout/SettingLayout.js +10 -1
  111. package/lib/built-in/{assistant/calculator/CalculatorKey.js → setting-layout/style.js} +25 -11
  112. package/lib/collection-manager/action-hooks.js +39 -11
  113. package/lib/icon/preloaded.js +4 -4
  114. package/lib/locale/en_US.js +8 -0
  115. package/lib/locale/zh-CN.js +8 -0
  116. package/lib/modules/actions/associate/AssociateActionInitializer.js +105 -0
  117. package/lib/modules/actions/associate/AssociateActionProvider.js +116 -0
  118. package/lib/modules/actions/associate/AssociateActionSettings.js +91 -0
  119. package/lib/modules/blocks/data-blocks/details-multi/detailsWithPaginationSettings.js +2 -1
  120. package/lib/modules/blocks/data-blocks/form/RecordFormBlockInitializer.js +21 -14
  121. package/lib/modules/blocks/data-blocks/grid-card/gridCardBlockSettings.js +2 -1
  122. package/lib/modules/blocks/data-blocks/list/listBlockSettings.js +2 -1
  123. package/lib/modules/blocks/data-blocks/table/TableActionInitializers.js +15 -0
  124. package/lib/modules/blocks/data-blocks/table/tableBlockSettings.js +2 -1
  125. package/lib/modules/blocks/data-blocks/table/tableColumnSettings.js +2 -2
  126. package/lib/modules/blocks/data-blocks/table-selector/tableSelectorBlockSettings.js +2 -1
  127. package/lib/modules/fields/component/Cascader/cascaderComponentFieldSettings.js +2 -1
  128. package/lib/modules/fields/component/Radio/radioComponentFieldSettings.js +4 -0
  129. package/lib/modules/fields/component/Select/selectComponentFieldSettings.js +16 -2
  130. package/lib/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.js +2 -1
  131. package/lib/modules/menu/GroupItem.js +5 -1
  132. package/lib/modules/menu/LinkMenuItem.js +7 -3
  133. package/lib/modules/menu/PageMenuItem.js +5 -1
  134. package/lib/modules/menu/UploadMenuItem.js +115 -0
  135. package/lib/modules/menu/menuItemInitializer.js +2 -23
  136. package/lib/schema-component/antd/action/Action.Designer.js +4 -1
  137. package/lib/schema-component/antd/association-select/AssociationSelect.js +4 -2
  138. package/lib/schema-component/antd/checkbox/Checkbox.js +11 -6
  139. package/lib/schema-component/antd/date-picker/DatePicker.js +4 -0
  140. package/lib/schema-component/antd/form-item/FormItem.Settings.js +16 -1
  141. package/lib/schema-component/antd/form-v2/Form.Settings.js +2 -1
  142. package/lib/schema-component/antd/grid-card/GridCard.Designer.js +2 -1
  143. package/lib/schema-component/antd/list/List.Designer.js +2 -1
  144. package/lib/schema-component/antd/menu/AdminMenu.js +105 -0
  145. package/lib/schema-component/antd/menu/AdminMenu.style.js +70 -0
  146. package/lib/schema-component/antd/menu/Menu.Designer.js +59 -40
  147. package/lib/schema-component/antd/menu/Menu.js +108 -141
  148. package/lib/schema-component/antd/menu/Menu.styles.js +8 -20
  149. package/lib/schema-component/antd/menu/MenuSearch.js +80 -0
  150. package/lib/schema-component/antd/menu/tools.js +72 -0
  151. package/lib/schema-component/antd/scroll-area/ScrollArea.js +0 -17
  152. package/lib/schema-component/antd/select/Select.js +33 -2
  153. package/lib/schema-component/antd/table/Table.Void.Designer.js +2 -1
  154. package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +2 -1
  155. package/lib/schema-component/antd/table-v2/TableSelectorDesigner.js +2 -1
  156. package/lib/schema-component/common/sortable-item/DragHandleMenu.js +112 -0
  157. package/lib/schema-component/common/sortable-item/DragHandleMenu.style.js +59 -0
  158. package/lib/schema-initializer/SchemaInitializerPlugin.js +5 -2
  159. package/lib/schema-initializer/utils.js +9 -7
  160. package/lib/schema-settings/GeneralSchemaDesigner.js +9 -1
  161. package/lib/schema-settings/SchemaSettings.js +16 -4
  162. package/lib/schema-settings/SchemaSettingsPlugin.js +2 -0
  163. package/lib/schema-settings/SchemaSettingsSortingRule.js +2 -1
  164. package/lib/schema-settings/styles.js +2 -2
  165. package/package.json +8 -7
  166. package/es/built-in/assistant/calculator/AutoScalingText.d.ts +0 -3
  167. package/es/built-in/assistant/calculator/AutoScalingText.mjs +0 -33
  168. package/es/built-in/assistant/calculator/Calculator.d.ts +0 -2
  169. package/es/built-in/assistant/calculator/Calculator.mjs +0 -235
  170. package/es/built-in/assistant/calculator/CalculatorDisplay.d.ts +0 -4
  171. package/es/built-in/assistant/calculator/CalculatorDisplay.mjs +0 -21
  172. package/es/built-in/assistant/calculator/CalculatorKey.d.ts +0 -5
  173. package/es/built-in/assistant/calculator/CalculatorKey.mjs +0 -11
  174. package/es/built-in/assistant/calculator/CalculatorProvider.d.ts +0 -10
  175. package/es/built-in/assistant/calculator/CalculatorProvider.mjs +0 -29
  176. package/es/built-in/assistant/calculator/Draggable.d.ts +0 -8
  177. package/es/built-in/assistant/calculator/Draggable.mjs +0 -54
  178. package/es/built-in/assistant/calculator/style.mjs +0 -25
  179. package/es/built-in/assistant/search-and-jump/index.d.ts +0 -16
  180. package/es/built-in/assistant/search-and-jump/index.mjs +0 -59
  181. package/lib/built-in/assistant/calculator/AutoScalingText.js +0 -67
  182. package/lib/built-in/assistant/calculator/Calculator.js +0 -283
  183. package/lib/built-in/assistant/calculator/CalculatorDisplay.js +0 -55
  184. package/lib/built-in/assistant/calculator/CalculatorProvider.js +0 -65
  185. package/lib/built-in/assistant/calculator/Draggable.js +0 -102
  186. package/lib/built-in/assistant/calculator/style.js +0 -59
  187. package/lib/built-in/assistant/search-and-jump/index.js +0 -96
@@ -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,55 +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
- CalculatorDisplay: ()=>CalculatorDisplay
30
- });
31
- const jsx_runtime_namespaceObject = require("react/jsx-runtime");
32
- require("react");
33
- const external_AutoScalingText_js_namespaceObject = require("./AutoScalingText.js");
34
- const CalculatorDisplay = (param)=>{
35
- let { value, ...props } = param;
36
- const language = navigator.language || 'en-US';
37
- let formattedValue = parseFloat(value).toLocaleString(language, {
38
- useGrouping: true,
39
- maximumFractionDigits: 6
40
- });
41
- const match = value.match(/\.\d*?(0*)$/);
42
- if (match) formattedValue += /[1-9]/.test(match[0]) ? match[1] : match[0];
43
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
44
- ...props,
45
- className: "calculator-display",
46
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_AutoScalingText_js_namespaceObject.AutoScalingText, {
47
- children: formattedValue
48
- })
49
- });
50
- };
51
- var __webpack_export_target__ = exports;
52
- for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
53
- if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
54
- value: true
55
- });
@@ -1,65 +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
- CalculatorContext: ()=>CalculatorContext,
30
- CalculatorProvider: ()=>CalculatorProvider,
31
- useCalculator: ()=>useCalculator
32
- });
33
- const jsx_runtime_namespaceObject = require("react/jsx-runtime");
34
- const external_react_namespaceObject = require("react");
35
- const external_react_dom_namespaceObject = require("react-dom");
36
- const external_Calculator_js_namespaceObject = require("./Calculator.js");
37
- const external_Draggable_js_namespaceObject = require("./Draggable.js");
38
- const external_style_js_namespaceObject = require("./style.js");
39
- const CalculatorContext = /*#__PURE__*/ (0, external_react_namespaceObject.createContext)({});
40
- const useCalculator = ()=>(0, external_react_namespaceObject.useContext)(CalculatorContext);
41
- const CalculatorProvider = (param)=>{
42
- let { children } = param;
43
- const [visible, setVisible] = (0, external_react_namespaceObject.useState)(false);
44
- const { styles } = (0, external_style_js_namespaceObject.useStyles)();
45
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(CalculatorContext.Provider, {
46
- value: {
47
- visible,
48
- setVisible
49
- },
50
- children: [
51
- children,
52
- visible ? /*#__PURE__*/ (0, external_react_dom_namespaceObject.createPortal)(/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
53
- className: styles.container,
54
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_Draggable_js_namespaceObject.Draggable, {
55
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_Calculator_js_namespaceObject.CalculatorWrapper, {})
56
- })
57
- }), document.body) : null
58
- ]
59
- });
60
- };
61
- var __webpack_export_target__ = exports;
62
- for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
63
- if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
64
- value: true
65
- });
@@ -1,102 +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
- Draggable: ()=>Draggable
43
- });
44
- const external_react_namespaceObject = require("react");
45
- var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_namespaceObject);
46
- const Draggable = (param)=>{
47
- let { children, updateTransform = (transformStr, tx, ty, tdom)=>{
48
- tdom.style.transform = transformStr;
49
- } } = param;
50
- const ref = (0, external_react_namespaceObject.useRef)();
51
- const positionRef = (0, external_react_namespaceObject.useRef)({
52
- startX: 0,
53
- startY: 0,
54
- dx: 0,
55
- dy: 0,
56
- tx: 0,
57
- ty: 0
58
- });
59
- (0, external_react_namespaceObject.useEffect)(()=>{
60
- const node = ref.current;
61
- if (!node) return;
62
- const start = (event)=>{
63
- if (0 !== event.button) return;
64
- document.addEventListener('mousemove', docMove);
65
- positionRef.current.startX = event.pageX - positionRef.current.dx;
66
- positionRef.current.startY = event.pageY - positionRef.current.dy;
67
- };
68
- const docMove = (event)=>{
69
- const tx = event.pageX - positionRef.current.startX;
70
- const ty = event.pageY - positionRef.current.startY;
71
- const transformStr = "translate(".concat(tx, "px,").concat(ty, "px)");
72
- updateTransform(transformStr, tx, ty, node);
73
- positionRef.current.dx = tx;
74
- positionRef.current.dy = ty;
75
- };
76
- const docMouseUp = (event)=>{
77
- document.removeEventListener('mousemove', docMove);
78
- };
79
- node.addEventListener('mousedown', start);
80
- document.addEventListener('mouseup', docMouseUp);
81
- return ()=>{
82
- node.removeEventListener('mousedown', start);
83
- document.removeEventListener('mouseup', docMouseUp);
84
- };
85
- }, [
86
- updateTransform
87
- ]);
88
- const newStyle = {
89
- ...children.props.style,
90
- cursor: 'move',
91
- userSelect: 'none'
92
- };
93
- return /*#__PURE__*/ external_react_default().cloneElement(external_react_default().Children.only(children), {
94
- ref,
95
- style: newStyle
96
- });
97
- };
98
- var __webpack_export_target__ = exports;
99
- for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
100
- if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
101
- value: true
102
- });
@@ -1,59 +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
- 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: 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 "
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 } = param;
51
- return {
52
- container: 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
- });
@@ -1,96 +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
- SearchAndJumpProvider: ()=>SearchAndJumpProvider,
30
- SearchAndJumpContext: ()=>SearchAndJumpContext,
31
- useSearchAndJump: ()=>useSearchAndJump,
32
- SearchAndJump: ()=>SearchAndJump
33
- });
34
- const jsx_runtime_namespaceObject = require("react/jsx-runtime");
35
- const external_react_namespaceObject = require("react");
36
- const external_antd_namespaceObject = require("antd");
37
- const SearchAndJumpContext = /*#__PURE__*/ (0, external_react_namespaceObject.createContext)({
38
- open: false,
39
- setOpen: (open)=>{}
40
- });
41
- const SearchAndJumpProvider = (param)=>{
42
- let { children } = param;
43
- const [open, setOpen] = (0, external_react_namespaceObject.useState)(false);
44
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(SearchAndJumpContext.Provider, {
45
- value: {
46
- open,
47
- setOpen
48
- },
49
- children: [
50
- children,
51
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SearchAndJump, {
52
- open: open,
53
- setOpen: setOpen
54
- })
55
- ]
56
- });
57
- };
58
- const useSearchAndJump = ()=>(0, external_react_namespaceObject.useContext)(SearchAndJumpContext);
59
- const SearchAndJump = (param)=>{
60
- let { open, setOpen } = param;
61
- const inputRef = (0, external_react_namespaceObject.useRef)();
62
- (0, external_react_namespaceObject.useEffect)(()=>{
63
- if (open && inputRef.current) setTimeout(()=>{
64
- inputRef.current.focus();
65
- }, 0);
66
- }, [
67
- open,
68
- inputRef
69
- ]);
70
- const handleOk = ()=>{
71
- setOpen(false);
72
- };
73
- const handleCancel = ()=>{
74
- setOpen(false);
75
- };
76
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Modal, {
77
- title: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Input, {
78
- style: {
79
- width: '100%'
80
- },
81
- autoFocus: true,
82
- ref: inputRef
83
- }),
84
- closable: false,
85
- open: open,
86
- onOk: handleOk,
87
- onCancel: handleCancel,
88
- footer: null,
89
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {})
90
- });
91
- };
92
- var __webpack_export_target__ = exports;
93
- for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
94
- if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
95
- value: true
96
- });