@opentiny/vue-renderless 3.13.2 → 3.14.1

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 (320) hide show
  1. package/action-sheet/index.js +20 -13
  2. package/action-sheet/vue.js +8 -7
  3. package/amount/index.js +100 -25
  4. package/amount/vue.js +102 -26
  5. package/anchor/index.js +1 -0
  6. package/area/index.js +8 -8
  7. package/area/vue.js +5 -5
  8. package/async-flowchart/index.js +16 -3
  9. package/autocomplete/index.js +58 -14
  10. package/autocomplete/vue.js +40 -12
  11. package/badge/index.js +12 -0
  12. package/badge/vue.js +6 -4
  13. package/breadcrumb/vue.js +3 -1
  14. package/breadcrumb-item/vue.js +6 -2
  15. package/button/index.js +5 -1
  16. package/calendar/index.js +2 -86
  17. package/calendar-bar/index.js +18 -4
  18. package/calendar-view/index.js +5 -1
  19. package/calendar-view/vue.js +16 -3
  20. package/card-group/vue.js +4 -2
  21. package/cascader/index.js +86 -34
  22. package/cascader/vue.js +61 -20
  23. package/cascader-menu/index.js +7 -7
  24. package/cascader-menu/vue.js +2 -3
  25. package/cascader-mobile/index.js +36 -23
  26. package/cascader-mobile/vue.js +6 -0
  27. package/cascader-node/index.js +13 -1
  28. package/cascader-node/vue.js +15 -4
  29. package/cascader-panel/index.js +1 -1
  30. package/cascader-select/column-index.js +150 -0
  31. package/cascader-select/column.js +120 -0
  32. package/cascader-select/index.js +29 -165
  33. package/cascader-select/usePicker.js +251 -0
  34. package/cascader-select/useTouch.js +65 -0
  35. package/cascader-select/vue.js +35 -47
  36. package/cell/vue.js +2 -1
  37. package/chart-bar/index.js +2 -3
  38. package/chart-core/deps/constants.js +43 -43
  39. package/chart-core/index.js +1 -1
  40. package/chart-gauge/index.js +2 -2
  41. package/chart-heatmap/index.js +17 -10
  42. package/chart-line/index.js +8 -9
  43. package/chart-tree/index.js +2 -2
  44. package/chart-waterfall/index.js +4 -6
  45. package/checkbox/index.js +18 -1
  46. package/checkbox/vue.js +15 -7
  47. package/checkbox-group/vue.js +1 -0
  48. package/col/vue.js +1 -1
  49. package/collapse/index.js +3 -3
  50. package/color-select-panel/vue.js +0 -7
  51. package/column-list-item/index.js +17 -1
  52. package/column-list-item/vue.js +8 -3
  53. package/common/bigInt.js +2 -2
  54. package/common/date.js +7 -5
  55. package/common/deps/clickoutside.js +6 -2
  56. package/common/deps/date-util.js +4 -2
  57. package/common/deps/dom.js +19 -4
  58. package/common/deps/popper.js +44 -11
  59. package/common/deps/resize-event.js +1 -0
  60. package/common/deps/touch-emulator.js +4 -1
  61. package/common/deps/tree-model/node.js +2 -2
  62. package/common/deps/tree-model/tree-store.js +2 -13
  63. package/common/deps/useRect.js +25 -0
  64. package/common/deps/vue-popper.js +38 -20
  65. package/common/index.js +2 -2
  66. package/common/runtime.js +1 -1
  67. package/common/string.js +2 -2
  68. package/common/type.js +2 -1
  69. package/common/validate/rules/enum.js +1 -1
  70. package/common/validate/rules/pattern.js +2 -2
  71. package/common/validate/rules/range.js +8 -5
  72. package/common/validate/rules/required.js +1 -1
  73. package/common/validate/rules/type.js +5 -5
  74. package/common/validate/rules/whitespace.js +1 -1
  75. package/common/validate/util.js +15 -16
  76. package/common/validate/validations/integer.js +1 -1
  77. package/common/validate/validations/method.js +1 -1
  78. package/currency/index.js +74 -7
  79. package/currency/vue.js +21 -5
  80. package/date-panel/index.js +16 -0
  81. package/date-panel/vue.js +8 -2
  82. package/date-picker-mobile/index.js +12 -0
  83. package/date-picker-mobile/vue.js +7 -1
  84. package/date-range/vue.js +15 -6
  85. package/date-table/index.js +35 -53
  86. package/date-table/vue.js +4 -2
  87. package/dialog-box/index.js +46 -14
  88. package/dialog-box/vue.js +30 -7
  89. package/dialog-select/index.js +6 -3
  90. package/dialog-select/vue.js +8 -4
  91. package/drawer/index.js +27 -5
  92. package/drawer/vue.js +14 -7
  93. package/dropdown/index.js +7 -7
  94. package/dropdown/vue.js +6 -2
  95. package/dropdown-item/index.js +9 -1
  96. package/dropdown-item/mf.js +6 -10
  97. package/dropdown-item/vue.js +20 -7
  98. package/dropdown-menu/index.js +20 -7
  99. package/dropdown-menu/vue.js +4 -3
  100. package/exception/index.js +2 -7
  101. package/exception/vue.js +7 -10
  102. package/fall-menu/index.js +5 -1
  103. package/fall-menu/vue.js +13 -2
  104. package/file-upload/index.js +68 -18
  105. package/file-upload/vue.js +38 -8
  106. package/filter-box/index.js +1 -0
  107. package/float-button/index.js +42 -0
  108. package/float-button/vue.js +101 -0
  109. package/floating-button/index.js +62 -16
  110. package/floating-button/vue.js +27 -9
  111. package/flowchart/index.js +134 -25
  112. package/flowchart/node.js +13 -4
  113. package/flowchart/vue.js +16 -4
  114. package/form/vue.js +8 -0
  115. package/form-item/index.js +5 -5
  116. package/form-item/vue.js +3 -1
  117. package/fullscreen/index.js +5 -5
  118. package/fullscreen/vue.js +3 -3
  119. package/grid/plugins/export.js +5 -2
  120. package/grid/utils/column.js +1 -0
  121. package/grid/utils/dom.js +7 -1
  122. package/image/index.js +6 -1
  123. package/image/vue.js +6 -3
  124. package/image-viewer/index.js +62 -51
  125. package/image-viewer/vue.js +17 -5
  126. package/input/index.js +81 -20
  127. package/input/vue.js +44 -18
  128. package/ip-address/index.js +61 -19
  129. package/ip-address/vue.js +22 -4
  130. package/link/vue.js +3 -1
  131. package/loading/index.js +2 -2
  132. package/loading/vue.js +8 -2
  133. package/logout/index.js +1 -1
  134. package/menu/index.js +15 -2
  135. package/menu/vue.js +22 -17
  136. package/mind-map/index.js +47 -0
  137. package/mind-map/vue.js +53 -0
  138. package/modal/index.js +44 -4
  139. package/modal/vue.js +18 -4
  140. package/multi-select/index.js +186 -11
  141. package/multi-select/vue.js +60 -15
  142. package/multi-select-item/index.js +23 -0
  143. package/multi-select-item/vue.js +31 -0
  144. package/numeric/index.js +48 -12
  145. package/numeric/vue.js +44 -19
  146. package/option/index.js +27 -9
  147. package/option/vue.js +37 -21
  148. package/option-group/index.js +3 -3
  149. package/package.json +1 -1
  150. package/pager/index.js +18 -4
  151. package/pager/vue.js +16 -5
  152. package/picker/index.js +290 -77
  153. package/picker/mb.js +42 -0
  154. package/picker/vue.js +76 -20
  155. package/picker-column/index.js +1 -1
  156. package/pop-upload/vue.js +3 -0
  157. package/popconfirm/index.js +3 -6
  158. package/popconfirm/vue.js +1 -1
  159. package/popeditor/index.js +73 -34
  160. package/popeditor/vue.js +15 -11
  161. package/popover/index.js +4 -4
  162. package/popover/vue.js +6 -6
  163. package/popup/index.js +3 -3
  164. package/popup/vue.js +5 -5
  165. package/pull-refresh/index.js +13 -13
  166. package/pull-refresh/vue.js +5 -4
  167. package/radio/index.js +0 -17
  168. package/radio/vue.js +4 -10
  169. package/rate/index.js +1 -1
  170. package/rate/vue.js +0 -2
  171. package/record/index.js +4 -1
  172. package/rich-text/clipboard.js +54 -0
  173. package/rich-text/index.js +192 -0
  174. package/rich-text/module/file-upload.js +107 -0
  175. package/rich-text/module/image-drop.js +63 -0
  176. package/rich-text/module/image-upload.js +89 -0
  177. package/rich-text/options.js +141 -0
  178. package/rich-text/table-module.js +382 -0
  179. package/rich-text/vue.js +102 -0
  180. package/{rich-text-edtior → rich-text-editor}/index.js +2 -2
  181. package/{rich-text-edtior → rich-text-editor}/vue.js +2 -5
  182. package/scrollbar/index.js +11 -11
  183. package/scrollbar/vue-bar.js +3 -3
  184. package/scrollbar/vue.js +5 -5
  185. package/search/index.js +9 -9
  186. package/search/vue.js +8 -6
  187. package/select/index.js +442 -393
  188. package/select/vue.js +278 -164
  189. package/select-dropdown/index.js +61 -3
  190. package/select-dropdown/vue.js +85 -8
  191. package/select-view/index.js +3 -1
  192. package/selected-box/index.js +2 -0
  193. package/selected-box/vue.js +6 -3
  194. package/signature/index.js +241 -0
  195. package/signature/vue.js +88 -0
  196. package/skeleton/index.js +14 -0
  197. package/skeleton/vue.js +15 -0
  198. package/skeleton-item/vue.js +15 -0
  199. package/slider/index.js +70 -17
  200. package/slider/vue.js +16 -7
  201. package/split/index.js +5 -3
  202. package/split/vue.js +4 -6
  203. package/standard-list-item/index.js +15 -1
  204. package/standard-list-item/vue.js +6 -5
  205. package/steps/index.js +25 -2
  206. package/steps/slide-bar.js +8 -1
  207. package/steps/vue.js +15 -3
  208. package/tab-item-mf/vue.js +14 -8
  209. package/tab-nav/index.js +30 -5
  210. package/tab-nav/vue.js +16 -4
  211. package/tabbar/vue.js +9 -3
  212. package/tabbar-item/vue.js +3 -2
  213. package/tabs/index.js +16 -4
  214. package/tabs/vue.js +2 -1
  215. package/tabs-mf/index.js +20 -6
  216. package/tabs-mf/vue-nav.js +26 -11
  217. package/tabs-mf/vue.js +7 -7
  218. package/tabs-mf/wheel.js +1 -0
  219. package/tag/index.js +1 -1
  220. package/tag-group/index.js +2 -1
  221. package/time/index.js +5 -2
  222. package/time/vue.js +1 -1
  223. package/time-line/index.js +3 -3
  224. package/time-line/vue.js +2 -2
  225. package/time-picker-mobile/index.js +24 -5
  226. package/time-picker-mobile/vue.js +17 -7
  227. package/time-range/index.js +2 -0
  228. package/timeline-item/vue.js +1 -1
  229. package/tooltip/index.js +6 -3
  230. package/tooltip/vue.js +4 -4
  231. package/transfer/index.js +20 -22
  232. package/transfer/vue.js +1 -6
  233. package/transfer-panel/vue.js +3 -5
  234. package/tree/index.js +21 -4
  235. package/tree/vue.js +10 -8
  236. package/tree-menu/index.js +29 -3
  237. package/tree-menu/vue.js +28 -15
  238. package/tree-node/index.js +18 -18
  239. package/tree-node/vue.js +6 -5
  240. package/types/action-sheet.type.d.ts +118 -1
  241. package/types/amount.type.d.ts +168 -1
  242. package/types/area.type.d.ts +134 -1
  243. package/types/async-flowchart.type.d.ts +72 -0
  244. package/types/autocomplete.type.d.ts +199 -1
  245. package/types/badge.type.d.ts +3 -1
  246. package/types/breadcrumb-item.type.d.ts +2 -0
  247. package/types/breadcrumb.type.d.ts +2 -0
  248. package/types/button-group.type.d.ts +3 -3
  249. package/types/button.type.d.ts +4 -0
  250. package/types/cascader-menu.type.d.ts +3 -4
  251. package/types/cascader-node.type.d.ts +5 -2
  252. package/types/cascader-panel.type-2bd03be3.d.ts +241 -0
  253. package/types/cascader-panel.type.d.ts +3 -241
  254. package/types/cascader.type.d.ts +329 -1
  255. package/types/checkbox.type.d.ts +6 -0
  256. package/types/collapse.type.d.ts +19 -2
  257. package/types/date-picker.type.d.ts +38 -1
  258. package/types/dialog-box.type.d.ts +13 -3
  259. package/types/drawer.type.d.ts +133 -1
  260. package/types/{dropdown-item.type-8ea6c633.d.ts → dropdown-item.type-8475a549.d.ts} +7 -13
  261. package/types/dropdown-item.type.d.ts +1 -1
  262. package/types/dropdown-menu.type.d.ts +1 -1
  263. package/types/dropdown.type.d.ts +1 -5
  264. package/types/fall-menu.type.d.ts +94 -1
  265. package/types/file-upload.type.d.ts +1 -1
  266. package/types/float-button.type.d.ts +123 -0
  267. package/types/form-item.type.d.ts +1 -1
  268. package/types/{form.type-d0fd42f3.d.ts → form.type-a2dc0099.d.ts} +4 -1
  269. package/types/form.type.d.ts +1 -1
  270. package/types/{index-e0250f63.d.ts → index-b012f687.d.ts} +9 -0
  271. package/types/input.type.d.ts +2 -6
  272. package/types/ip-address.type.d.ts +160 -1
  273. package/types/link.type.d.ts +6 -3
  274. package/types/loading.type.d.ts +7 -0
  275. package/types/mind-map.type.d.ts +20 -0
  276. package/types/modal.type.d.ts +29 -2
  277. package/types/numeric.type.d.ts +41 -10
  278. package/types/pager.type.d.ts +12 -0
  279. package/types/picker.type.d.ts +18 -0
  280. package/types/popconfirm.type.d.ts +86 -1
  281. package/types/popeditor.type.d.ts +4 -0
  282. package/types/popover.type.d.ts +3 -3
  283. package/types/progress.type.d.ts +2 -0
  284. package/types/radio.type.d.ts +0 -4
  285. package/types/rate.type.d.ts +236 -1
  286. package/types/search.type.d.ts +88 -1
  287. package/types/shared.type.d.ts +1 -1
  288. package/types/skeleton-item.type.d.ts +38 -0
  289. package/types/skeleton.type.d.ts +45 -0
  290. package/types/slider.type.d.ts +49 -10
  291. package/types/steps.type.d.ts +14 -3
  292. package/types/tab-bar.type.d.ts +1 -1
  293. package/types/tab-nav.type.d.ts +7 -2
  294. package/types/tabs.type.d.ts +9 -1
  295. package/types/tag-group.type.d.ts +64 -1
  296. package/types/{time-line.type-d7daa669.d.ts → time-line.type-b155cb4f.d.ts} +12 -0
  297. package/types/time-line.type.d.ts +1 -1
  298. package/types/timeline-item.type.d.ts +1 -1
  299. package/types/tooltip.type.d.ts +2 -2
  300. package/types/transfer.type.d.ts +185 -1
  301. package/types/tree-menu.type.d.ts +210 -1
  302. package/types/upload-dragger.type.d.ts +1 -1
  303. package/types/{upload-list.type-343e8c11.d.ts → upload-list.type-6d6e3d0e.d.ts} +35 -8
  304. package/types/upload-list.type.d.ts +1 -1
  305. package/types/upload.type.d.ts +1 -1
  306. package/types/user-head.type.d.ts +146 -1
  307. package/types/wizard.type.d.ts +1 -0
  308. package/upload/index.js +64 -34
  309. package/upload/vue.js +9 -5
  310. package/upload-dragger/index.js +22 -20
  311. package/upload-list/index.js +24 -18
  312. package/upload-list/vue.js +9 -4
  313. package/user/index.js +35 -26
  314. package/user/vue.js +1 -1
  315. package/user-head/index.js +3 -3
  316. package/watermark/index.js +11 -0
  317. package/wheel/index.js +3 -0
  318. package/wizard/vue.js +4 -2
  319. package/common/deps/modal-queue.js +0 -6
  320. package/common/deps/requestAnimationFrame.js +0 -25
@@ -40,12 +40,11 @@ const visibleHandle = ({ emit, state }) => () => {
40
40
  emit("update:visible", false);
41
41
  emit("close", false);
42
42
  };
43
- const watchVisible = ({ emit, props, state }) => (value) => {
44
- state.active = props.modelValue;
43
+ const watchVisible = ({ emit, state }) => (bool) => {
45
44
  setTimeout(() => {
46
- value ? state.toggle = true : state.toggle = false;
45
+ state.toggle = bool;
47
46
  }, 0);
48
- emit("update:visible", value);
47
+ emit("update:visible", bool);
49
48
  };
50
49
  const menuHandle = ({ emit, state }) => (item) => {
51
50
  state.active = item.id;
@@ -54,13 +53,11 @@ const menuHandle = ({ emit, state }) => (item) => {
54
53
  emit("update:modelValue", item.id);
55
54
  emit("click", item);
56
55
  };
57
- const close = ({ emit, vm }) => () => {
58
- vm.$refs.drawer.close();
59
- emit("close", false);
56
+ const close = ({ api }) => () => {
57
+ api.handleClose("close", false);
60
58
  };
61
- const hide = (emit) => () => {
62
- emit("hide", false);
63
- emit("update:visible", false);
59
+ const hide = ({ api }) => () => {
60
+ api.handleClose("hide", false);
64
61
  };
65
62
  const selectOption = ({ emit, props }) => (option) => {
66
63
  const { valueField } = props;
@@ -68,18 +65,28 @@ const selectOption = ({ emit, props }) => (option) => {
68
65
  emit("update:modelValue", option[valueField]);
69
66
  emit("click", option);
70
67
  };
71
- const confirm = ({ emit, state }) => () => {
72
- emit("confirm", state);
73
- emit("update:visible", false);
68
+ const confirm = ({ state, api }) => () => {
69
+ api.handleClose("confirm", state);
74
70
  };
75
71
  const actionSelectOption = ({ emit }) => (option, index) => {
76
72
  emit("update:visible", false);
77
73
  emit("click", option, index);
78
74
  };
75
+ const handleClose = ({ vm, emit, props }) => (type, show) => {
76
+ if (typeof props.beforeClose === "function" && props.beforeClose(type) === false)
77
+ return;
78
+ if (type === "close") {
79
+ vm.$refs.drawer.close(true);
80
+ } else {
81
+ emit("update:visible", false);
82
+ }
83
+ emit(type, show);
84
+ };
79
85
  export {
80
86
  actionSelectOption,
81
87
  close,
82
88
  confirm,
89
+ handleClose,
83
90
  hide,
84
91
  initScrollMenu,
85
92
  menuHandle,
@@ -9,7 +9,8 @@ import {
9
9
  selectOption,
10
10
  confirm,
11
11
  actionSelectOption,
12
- hide
12
+ hide,
13
+ handleClose
13
14
  } from "./index";
14
15
  const api = [
15
16
  "state",
@@ -25,26 +26,26 @@ const api = [
25
26
  "hide"
26
27
  ];
27
28
  const renderless = (props, { reactive, watch }, { emit, nextTick, refs, vm }, { BScroll }) => {
28
- const api2 = {};
29
29
  const state = reactive({
30
30
  toggle: false,
31
- active: null,
32
31
  sheetMaskStyle: {},
33
32
  sheetContentStyle: {},
34
33
  scroll: null
35
34
  });
35
+ const api2 = {};
36
36
  Object.assign(api2, {
37
37
  state,
38
38
  setSheetStyle: setSheetStyle({ state, props }),
39
39
  initScrollMenu: initScrollMenu({ state, nextTick, refs, BScroll }),
40
40
  visibleHandle: visibleHandle({ emit, state }),
41
- watchVisible: watchVisible({ emit, props, state }),
41
+ watchVisible: watchVisible({ emit, state }),
42
42
  menuHandle: menuHandle({ state, emit }),
43
- confirm: confirm({ state, emit }),
43
+ confirm: confirm({ state, api: api2 }),
44
44
  selectOption: selectOption({ emit, props }),
45
45
  actionSelectOption: actionSelectOption({ emit }),
46
- close: close({ emit, vm }),
47
- hide: hide(emit)
46
+ hide: hide({ api: api2 }),
47
+ close: close({ api: api2 }),
48
+ handleClose: handleClose({ vm, emit, props })
48
49
  });
49
50
  watch(
50
51
  () => props.visible,
package/amount/index.js CHANGED
@@ -17,6 +17,7 @@ const initService = (service) => {
17
17
  const getDecimal = (props) => (value) => getMiniDecimal(value, props.plugin);
18
18
  const closePopper = (state) => () => {
19
19
  state.visible = false;
20
+ state.editorPhase = "close";
20
21
  };
21
22
  const popInput = ({ editorState, props, state, api }) => (value) => {
22
23
  value = api.onInputPreprocess(value);
@@ -32,22 +33,54 @@ const popInput = ({ editorState, props, state, api }) => (value) => {
32
33
  editorState.lastInput = value;
33
34
  editorState.amount = value;
34
35
  };
35
- const toggleVisible = ({ api, props, state, editorState }) => () => {
36
- if (props.disabled || !props.popUp) {
36
+ const toggleVisible = ({ api, props, state, editorState, uiMode, isMobileFirstMode: mf }) => () => {
37
+ if (state.disabled || !props.popUp) {
37
38
  return;
38
39
  }
39
40
  state.lock = true;
40
41
  state.visible = !state.visible;
41
42
  if (state.visible) {
42
43
  const { date, currency } = state;
43
- Object.assign(editorState, {
44
- amount: state.amount,
45
- date,
46
- currency
47
- });
48
- api.addOutSideEvent(state.visible);
44
+ if (!state.clearValues) {
45
+ Object.assign(editorState, {
46
+ amount: state.amount,
47
+ date,
48
+ currency
49
+ });
50
+ }
51
+ if (props.date || props.dateAllowEmpty) {
52
+ state.editorPhase = "selection";
53
+ } else {
54
+ state.editorPhase = "currency";
55
+ }
56
+ if (!mf || uiMode.value !== "default") {
57
+ api.addOutSideEvent(state.visible);
58
+ }
59
+ } else {
60
+ state.editorPhase = "close";
49
61
  }
50
62
  };
63
+ const openDetailEditor = ({ state }) => (option, index) => {
64
+ const optionPhase = ["currency", "date"];
65
+ state.editorPhase = optionPhase[index];
66
+ state.visible = true;
67
+ };
68
+ const closeDetailEidtor = ({ state, props, api }) => (triggerCondition) => {
69
+ if (!triggerCondition) {
70
+ return;
71
+ }
72
+ const inSelectionPhase = state.editorPhase === "selection";
73
+ const isMultipleStep = props.date || props.dateAllowEmpty;
74
+ if (!inSelectionPhase && isMultipleStep) {
75
+ state.editorPhase = "selection";
76
+ state.visible = true;
77
+ } else {
78
+ api.toggleVisible();
79
+ }
80
+ setTimeout(() => {
81
+ api.save(true);
82
+ }, 0);
83
+ };
51
84
  const innerFormat = ({ state, props }) => (value) => {
52
85
  const { fraction, zeroize, rounding } = state.format;
53
86
  const { modelTruncation } = props;
@@ -66,11 +99,13 @@ const innerFormat = ({ state, props }) => (value) => {
66
99
  rounding
67
100
  });
68
101
  };
69
- const save = ({ api, state, editorState }) => () => {
102
+ const save = ({ api, state, editorState }) => (keepOpen) => {
70
103
  const { amount, date, currency } = editorState;
71
104
  Object.assign(state, { amount, date, currency });
72
- api.closePopper();
73
- let num = api.innerFormat(String(state.amount));
105
+ if (keepOpen !== true) {
106
+ api.closePopper();
107
+ }
108
+ let num = api.innerFormat(state.amount + "");
74
109
  state.amount = isNaN(num) ? 0 : num;
75
110
  if (!equalsDecimal(state.lastInput, state.amount) || state.lastCurrency !== currency || state.lastDate !== date) {
76
111
  api.emitChange();
@@ -84,16 +119,20 @@ const reset = ({ state, editorState }) => () => {
84
119
  const { amount, date, currency } = state;
85
120
  Object.assign(editorState, { amount, date, currency });
86
121
  };
87
- const emitChange = ({ emit, state }) => () => {
122
+ const emitChange = ({ emit, state, props, api }) => () => {
88
123
  const { date, currency } = state;
89
- const emitAmount = Number(state.amount);
90
- emit("update:modelValue", emitAmount);
124
+ let emitAmount = props.stringMode ? api.getDecimal(state.amount).toString() : Number(state.amount);
125
+ if (props.numAllowEmpty && state.amount === "") {
126
+ emitAmount = state.amount;
127
+ }
128
+ state.amount && (state.clearValues = false);
129
+ !state.clearValues && emit("update:modelValue", emitAmount);
91
130
  emit("update:currency", currency);
92
131
  emit("update:date", date);
93
132
  emit("change", { amount: emitAmount, date, currency });
94
133
  };
95
134
  const inputFocus = ({ state, props }) => () => {
96
- let amount = String(state.amount);
135
+ let amount = state.amount + "";
97
136
  state.isFocus = true;
98
137
  state.lock = false;
99
138
  const { fraction } = state.format;
@@ -105,7 +144,7 @@ const inputFocus = ({ state, props }) => () => {
105
144
  };
106
145
  const inputBlur = ({ api, state, props }) => () => {
107
146
  if (state.amountText !== "") {
108
- let amount = api.innerFormat(String(state.amountText));
147
+ let amount = api.innerFormat(state.amountText + "");
109
148
  if (isNaN(amount)) {
110
149
  state.amount = "";
111
150
  }
@@ -118,8 +157,8 @@ const inputBlur = ({ api, state, props }) => () => {
118
157
  }
119
158
  state.lastInput = state.amount;
120
159
  };
121
- const handelClick = ({ api, refs }) => (e) => {
122
- const contains = refs.root.contains(e.target);
160
+ const handelClick = ({ api, vm }) => (e) => {
161
+ const contains = vm.$refs.root.contains(e.target);
123
162
  if (!contains) {
124
163
  api.closePopper();
125
164
  }
@@ -132,7 +171,7 @@ const addOutSideEvent = (api) => (visible) => {
132
171
  }
133
172
  };
134
173
  const initText = ({ state }) => () => {
135
- let amount = String(state.amount);
174
+ let amount = state.amount + "";
136
175
  state.amountText = amount ? state.isFocus ? amount : formatNumber(state.amount, state.format) : "";
137
176
  };
138
177
  const onInputPreprocess = (props) => (value) => {
@@ -151,7 +190,7 @@ const onInputPreprocess = (props) => (value) => {
151
190
  const onInput = ({ state, props, api }) => (value) => {
152
191
  value = api.onInputPreprocess(value);
153
192
  const { fraction, groupSeparator } = state.format;
154
- value = event.target.value.replace(/^-+/, "-");
193
+ value = event.target.value !== void 0 ? event.target.value.replace(/^-+/, "-") : value.replace(/^-+/, "-");
155
194
  const groups = value.split(groupSeparator).map((val) => val.trim());
156
195
  value = groups.join("");
157
196
  if (value !== "-" && api.getDecimal(value).isNaN()) {
@@ -184,7 +223,17 @@ const getPrecision = ({ service, props, currency }) => {
184
223
  }
185
224
  return __spreadValues(__spreadValues(__spreadProps(__spreadValues({}, defaultFmt), { fraction, rounding }), serFmt), format);
186
225
  };
187
- const getAmountText = ({ state, props }) => () => props.hideCurrency ? typeof state.amountText === "string" ? state.amountText.replace(state.currency, "") : state.amountText : state.amountText;
226
+ const getAmountText = ({ state, props }) => () => {
227
+ const isFilter = props.shape === "filter" && props.filter;
228
+ if (props.hideCurrency && typeof state.amountText === "string") {
229
+ return isFilter ? state.radioVal + state.amountText.replace(state.currency, "") : state.amountText.replace(state.currency, "");
230
+ } else {
231
+ return isFilter ? state.radioVal + state.amountText : state.amountText;
232
+ }
233
+ };
234
+ const getAmountTextWithoutCurrncy = ({ state }) => () => {
235
+ return state.amountText.replace(state.currency, "");
236
+ };
188
237
  const watchModelValue = ({ api, state }) => () => {
189
238
  let value = api.initAmount();
190
239
  state.amount = value;
@@ -197,23 +246,47 @@ const watchCurrency = ({ api, state, editorState }) => (value) => {
197
246
  state.lastCurrency = value;
198
247
  api.initText();
199
248
  };
200
- const initAmount = (props) => () => {
249
+ const watchUiMode = ({ api, isMobileFirstMode: mf }) => (value) => {
250
+ if (mf && value === "default") {
251
+ api.addOutSideEvent(false);
252
+ }
253
+ };
254
+ const initAmount = ({ props, api }) => () => {
201
255
  let value = props.modelValue;
202
256
  value = value === null || isNaN(Number(value)) ? "" : value;
203
257
  if (!props.negative && value && Number(value) < 0) {
204
- value -= 0;
205
- value = Math.abs(value);
258
+ if (props.stringMode) {
259
+ value = api.getDecimal(String(value).replace(/^-/, "")).toString();
260
+ } else {
261
+ value -= 0;
262
+ value = Math.abs(value);
263
+ }
206
264
  }
207
265
  return value;
208
266
  };
267
+ const handleClearClick = ({ state, emit, editorState }) => (event2) => {
268
+ event2.stopPropagation();
269
+ state.amountText = "";
270
+ state.radioVal = "";
271
+ editorState.amount = "";
272
+ state.clearValues = true;
273
+ emit("clear");
274
+ };
275
+ const handleChange = ({ state, emit }) => () => {
276
+ emit("filter-change", state.radioVal);
277
+ };
209
278
  export {
210
279
  addOutSideEvent,
280
+ closeDetailEidtor,
211
281
  closePopper,
212
282
  emitChange,
213
283
  getAmountText,
284
+ getAmountTextWithoutCurrncy,
214
285
  getDecimal,
215
286
  getPrecision,
216
287
  handelClick,
288
+ handleChange,
289
+ handleClearClick,
217
290
  initAmount,
218
291
  initService,
219
292
  initText,
@@ -222,10 +295,12 @@ export {
222
295
  inputFocus,
223
296
  onInput,
224
297
  onInputPreprocess,
298
+ openDetailEditor,
225
299
  popInput,
226
300
  reset,
227
301
  save,
228
302
  toggleVisible,
229
303
  watchCurrency,
230
- watchModelValue
304
+ watchModelValue,
305
+ watchUiMode
231
306
  };
package/amount/vue.js CHANGED
@@ -23,7 +23,13 @@ import {
23
23
  watchModelValue,
24
24
  watchCurrency,
25
25
  onInputPreprocess,
26
- initAmount
26
+ initAmount,
27
+ handleClearClick,
28
+ handleChange,
29
+ closeDetailEidtor,
30
+ openDetailEditor,
31
+ getAmountTextWithoutCurrncy,
32
+ watchUiMode
27
33
  } from "./index";
28
34
  const api = [
29
35
  "t",
@@ -38,9 +44,26 @@ const api = [
38
44
  "inputFocus",
39
45
  "closePopper",
40
46
  "onInput",
41
- "getAmountText"
47
+ "getAmountText",
48
+ "handleClearClick",
49
+ "handleChange",
50
+ "openDetailEditor",
51
+ "closeDetailEidtor",
52
+ "uiMode",
53
+ "getAmountTextWithoutCurrncy",
54
+ "watchUiMode"
42
55
  ];
43
- const initState = ({ reactive, computed, props, $service, editorState }) => {
56
+ const initState = ({
57
+ reactive,
58
+ computed,
59
+ props,
60
+ $service,
61
+ editorState,
62
+ vm,
63
+ api: api2,
64
+ constants,
65
+ parent
66
+ }) => {
44
67
  const state = reactive({
45
68
  visible: false,
46
69
  amount: props.modelValue || "",
@@ -53,45 +76,88 @@ const initState = ({ reactive, computed, props, $service, editorState }) => {
53
76
  lastInput: props.modelValue,
54
77
  lastCurrency: props.currency,
55
78
  lastDate: props.date,
56
- format: computed(() => __spreadProps(__spreadValues({}, getPrecision({ service: $service, props, currency: editorState.currency })), {
57
- prefix: state.currency
58
- }))
79
+ format: computed(() => {
80
+ return __spreadProps(__spreadValues({}, getPrecision({ service: $service, props, currency: editorState.currency })), {
81
+ prefix: state.currency
82
+ });
83
+ }),
84
+ disabled: computed(() => props.disabled || (parent.tinyForm || {}).disabled),
85
+ displayOnly: computed(() => props.displayOnly || (parent.tinyForm || {}).displayOnly),
86
+ theme: vm.theme,
87
+ radioVal: "",
88
+ clearValues: false,
89
+ amountValue: computed(() => api2.getAmountText()),
90
+ amountNumberValue: computed(() => api2.getAmountTextWithoutCurrncy()),
91
+ filterMenu: constants.FILTER_OPTION,
92
+ editorPhase: "close"
93
+ // 'close' | 'selection' | 'currency' | 'date',
59
94
  });
60
95
  return state;
61
96
  };
62
- const initEditorState = ({ reactive, props }) => reactive({
63
- amount: "",
64
- date: "",
65
- currency: props.currency,
66
- lastInput: props.modelValue
67
- });
68
- const initApi = ({ api: api2, t, editorState, props, state, emit, refs }) => {
97
+ const initEditorState = ({
98
+ reactive,
99
+ props
100
+ }) => {
101
+ return reactive({
102
+ amount: "",
103
+ date: "",
104
+ currency: props.currency,
105
+ lastInput: props.modelValue
106
+ });
107
+ };
108
+ const initUiMode = ({ useBreakpoint }) => {
109
+ return useBreakpoint().current;
110
+ };
111
+ const initApi = ({
112
+ api: api2,
113
+ t,
114
+ editorState,
115
+ props,
116
+ state,
117
+ emit,
118
+ vm,
119
+ uiMode,
120
+ isMobileFirstMode
121
+ }) => {
69
122
  Object.assign(api2, {
70
123
  state,
71
124
  t,
72
125
  editorState,
126
+ uiMode,
73
127
  getDecimal: getDecimal(props),
74
128
  innerFormat: innerFormat({ state, props }),
75
129
  getAmountText: getAmountText({ state, props }),
76
- initAmount: initAmount(props),
130
+ getAmountTextWithoutCurrncy: getAmountTextWithoutCurrncy({ state }),
131
+ initAmount: initAmount({ props, api: api2 }),
77
132
  onInputPreprocess: onInputPreprocess(props),
78
133
  onInput: onInput({ state, props, api: api2 }),
79
134
  initText: initText({ state }),
80
135
  inputFocus: inputFocus({ state, props }),
81
136
  inputBlur: inputBlur({ api: api2, props, state }),
82
137
  closePopper: closePopper(state),
83
- emitChange: emitChange({ emit, state }),
138
+ emitChange: emitChange({ emit, state, props, api: api2 }),
84
139
  popInput: popInput({ editorState, api: api2, state, props }),
85
- save: save({ api: api2, state, editorState, props }),
86
- reset: reset({ api: api2, state, editorState }),
87
- handelClick: handelClick({ api: api2, refs }),
140
+ save: save({ api: api2, state, editorState }),
141
+ reset: reset({ state, editorState }),
142
+ handelClick: handelClick({ api: api2, vm }),
88
143
  addOutSideEvent: addOutSideEvent(api2),
89
144
  watchModelValue: watchModelValue({ api: api2, state }),
90
145
  watchCurrency: watchCurrency({ api: api2, state, editorState }),
91
- toggleVisible: toggleVisible({ api: api2, props, state, editorState })
146
+ watchUiMode: watchUiMode({ api: api2, isMobileFirstMode }),
147
+ toggleVisible: toggleVisible({ api: api2, props, state, editorState, uiMode, isMobileFirstMode }),
148
+ handleClearClick: handleClearClick({ state, emit, editorState }),
149
+ handleChange: handleChange({ state, emit }),
150
+ openDetailEditor: openDetailEditor({ state }),
151
+ closeDetailEidtor: closeDetailEidtor({ state, props, api: api2 })
92
152
  });
93
153
  };
94
- const initWatch = ({ watch, props, state, api: api2 }) => {
154
+ const initWatch = ({
155
+ watch,
156
+ props,
157
+ state,
158
+ api: api2,
159
+ uiMode
160
+ }) => {
95
161
  watch(() => props.modelValue, api2.watchModelValue, { immediate: true });
96
162
  watch(() => props.currency, api2.watchCurrency, { immediate: true });
97
163
  watch(
@@ -114,16 +180,26 @@ const initWatch = ({ watch, props, state, api: api2 }) => {
114
180
  state.format.fraction = value;
115
181
  }
116
182
  );
183
+ watch(uiMode, api2.watchUiMode);
117
184
  };
118
- const renderless = (props, { onUnmounted, computed, reactive, watch }, { t, emit, refs, service }) => {
185
+ const renderless = (props, { onUnmounted, computed, reactive, watch, inject }, { t, emit, vm, service, parent, constants, isMobileFirstMode, useBreakpoint }) => {
186
+ var _a;
119
187
  const api2 = {};
120
188
  const $service = initService(service);
121
189
  const editorState = initEditorState({ reactive, props });
122
- const state = initState({ reactive, computed, props, $service, editorState });
123
- initApi({ api: api2, t, editorState, props, state, emit, refs });
124
- api2.getDecimal(0);
125
- initWatch({ watch, props, state, api: api2 });
126
- onUnmounted(() => api2.addOutSideEvent(false));
190
+ const state = initState({ reactive, computed, props, $service, editorState, vm, api: api2, constants, parent });
191
+ const uiMode = initUiMode({ useBreakpoint });
192
+ initApi({ api: api2, t, editorState, props, state, emit, vm, uiMode, isMobileFirstMode });
193
+ parent.tinyForm = parent.tinyForm || inject("form", null);
194
+ (_a = api2 == null ? void 0 : api2.getDecimal) == null ? void 0 : _a.call(api2, 0);
195
+ initWatch({ watch, props, state, api: api2, uiMode });
196
+ onUnmounted(() => {
197
+ var _a2;
198
+ return (_a2 = api2 == null ? void 0 : api2.addOutSideEvent) == null ? void 0 : _a2.call(api2, false);
199
+ });
200
+ parent.$on("handle-clear", (event) => {
201
+ api2.handleClearClick(event);
202
+ });
127
203
  return api2;
128
204
  };
129
205
  export {
package/anchor/index.js CHANGED
@@ -116,6 +116,7 @@ const unmounted = ({ state, api }) => () => {
116
116
  };
117
117
  const onItersectionObserver = ({ state, props, api, vm, emit }) => () => {
118
118
  const { expandLink, scrollContainer } = state;
119
+ state.currentLink && updateSkidPosition({ vm, state, emit });
119
120
  state.intersectionObserver = new IntersectionObserver(
120
121
  (entries) => {
121
122
  const { top } = scrollContainer.getBoundingClientRect();
package/area/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
- const fetchDefaultData = ({ emit, fetchArea, nextTick, props, refs, state }) => () => {
2
+ const fetchDefaultData = ({ emit, fetchArea, nextTick, props, vm, state }) => () => {
3
3
  let parent = "";
4
4
  nextTick(() => {
5
- emit("change-jcr", parent, refs.refInstance.$parent);
5
+ emit("change-jcr", parent, vm.$refs.refInstance.$parent);
6
6
  });
7
7
  let promise;
8
8
  if (props.fetchJcr) {
@@ -20,10 +20,10 @@ const fetchDefaultData = ({ emit, fetchArea, nextTick, props, refs, state }) =>
20
20
  state.office = "";
21
21
  emit("update:modelValue", [state.jcr, state.region, state.rep, state.office]);
22
22
  };
23
- const getRegion = ({ emit, fetchArea, nextTick, props, refs, state }) => (value) => {
23
+ const getRegion = ({ emit, fetchArea, nextTick, props, vm, state }) => (value) => {
24
24
  state.jcr = value;
25
25
  nextTick(() => {
26
- emit("change-region", value, refs.refInstance.$parent);
26
+ emit("change-region", value, vm.$refs.refInstance.$parent);
27
27
  });
28
28
  let promise;
29
29
  if (props.fetchRegion) {
@@ -40,10 +40,10 @@ const getRegion = ({ emit, fetchArea, nextTick, props, refs, state }) => (value)
40
40
  state.rep = "";
41
41
  emit("update:modelValue", [state.jcr, state.region, state.rep, state.office]);
42
42
  };
43
- const getRep = ({ emit, fetchArea, nextTick, props, refs, state }) => (value) => {
43
+ const getRep = ({ emit, fetchArea, nextTick, props, vm, state }) => (value) => {
44
44
  state.region = value;
45
45
  nextTick(() => {
46
- emit("change-rep", value, refs.refInstance.$parent);
46
+ emit("change-rep", value, vm.$refs.refInstance.$parent);
47
47
  });
48
48
  let promise;
49
49
  if (props.fetchRep) {
@@ -59,10 +59,10 @@ const getRep = ({ emit, fetchArea, nextTick, props, refs, state }) => (value) =>
59
59
  state.rep = "";
60
60
  emit("update:modelValue", [state.jcr, state.region, state.rep, state.office]);
61
61
  };
62
- const getOffice = ({ emit, fetchArea, nextTick, props, refs, state }) => (value) => {
62
+ const getOffice = ({ emit, fetchArea, nextTick, props, vm, state }) => (value) => {
63
63
  state.rep = value;
64
64
  nextTick(() => {
65
- emit("change-office", value, refs.refInstance.$parent);
65
+ emit("change-office", value, vm.$refs.refInstance.$parent);
66
66
  });
67
67
  let promise;
68
68
  if (props.fetchOffice) {
package/area/vue.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
2
  import { getRegion, changeOffice, getRep, getOffice, fetchDefaultData, beforeMount } from "./index";
3
3
  const api = ["state", "getRep", "getRegion", "getOffice", "changeOffice"];
4
- const renderless = (props, { onBeforeMount, reactive }, { emit, service, refs, nextTick }) => {
4
+ const renderless = (props, { onBeforeMount, reactive }, { emit, service, vm, nextTick }) => {
5
5
  const api2 = {};
6
6
  const { fetchArea } = service || {};
7
7
  const state = reactive({
@@ -18,10 +18,10 @@ const renderless = (props, { onBeforeMount, reactive }, { emit, service, refs, n
18
18
  state,
19
19
  changeOffice: changeOffice({ emit, state }),
20
20
  beforeMount: beforeMount({ api: api2, props }),
21
- getRep: getRep({ emit, fetchArea, nextTick, props, refs, state }),
22
- getRegion: getRegion({ emit, fetchArea, nextTick, props, refs, state }),
23
- getOffice: getOffice({ emit, fetchArea, nextTick, props, refs, state }),
24
- fetchDefaultData: fetchDefaultData({ emit, fetchArea, nextTick, props, refs, state })
21
+ getRep: getRep({ emit, fetchArea, nextTick, props, vm, state }),
22
+ getRegion: getRegion({ emit, fetchArea, nextTick, props, vm, state }),
23
+ getOffice: getOffice({ emit, fetchArea, nextTick, props, vm, state }),
24
+ fetchDefaultData: fetchDefaultData({ emit, fetchArea, nextTick, props, vm, state })
25
25
  });
26
26
  onBeforeMount(api2.beforeMount);
27
27
  return api2;
@@ -1,15 +1,20 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
2
  import ResizeObserver from "../common/deps/ResizeObserver";
3
- const observeContainerSize = ({ nextTick, vm, state }) => () => {
3
+ const observeContainerSize = ({
4
+ nextTick,
5
+ vm,
6
+ state
7
+ }) => () => {
4
8
  nextTick(() => {
5
9
  const observedElement = vm.$el;
6
10
  if (observedElement) {
7
11
  state.temporary.observer = new ResizeObserver(() => {
8
12
  window.requestAnimationFrame(() => {
13
+ var _a;
9
14
  if (vm.$refs.chart) {
10
15
  vm.$refs.chart.refresh({
11
16
  graphWidth: observedElement.offsetWidth,
12
- adjustX: -state.config.nodeWrapperSize / 2
17
+ adjustX: -(((_a = state == null ? void 0 : state.config) == null ? void 0 : _a.nodeWrapperSize) || 0) / 2
13
18
  });
14
19
  }
15
20
  });
@@ -27,7 +32,15 @@ const unobserveContainerSize = (state) => () => {
27
32
  state.temporary.observed = null;
28
33
  }
29
34
  };
30
- const fetchData = ({ Loading, props, state, vm, markRaw, api, nextTick }) => () => {
35
+ const fetchData = ({
36
+ Loading,
37
+ props,
38
+ state,
39
+ vm,
40
+ markRaw,
41
+ api,
42
+ nextTick
43
+ }) => () => {
31
44
  if (typeof props.fetch === "function") {
32
45
  api.unobserveContainerSize();
33
46
  state.loading = true;