@opentiny/vue-renderless 3.13.1 → 3.14.0

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 (321) 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/date.js +7 -5
  54. package/common/deps/clickoutside.js +6 -2
  55. package/common/deps/dom.js +19 -4
  56. package/common/deps/popper.js +44 -11
  57. package/common/deps/resize-event.js +1 -0
  58. package/common/deps/touch-emulator.js +4 -1
  59. package/common/deps/tree-model/node.js +2 -2
  60. package/common/deps/tree-model/tree-store.js +2 -13
  61. package/common/deps/useRect.js +25 -0
  62. package/common/deps/vue-popper.js +38 -20
  63. package/common/index.js +2 -2
  64. package/common/runtime.js +1 -1
  65. package/common/string.js +2 -2
  66. package/common/type.js +2 -1
  67. package/common/validate/rules/enum.js +1 -1
  68. package/common/validate/rules/pattern.js +2 -2
  69. package/common/validate/rules/range.js +8 -5
  70. package/common/validate/rules/required.js +1 -1
  71. package/common/validate/rules/type.js +5 -5
  72. package/common/validate/rules/whitespace.js +1 -1
  73. package/common/validate/util.js +15 -16
  74. package/common/validate/validations/integer.js +1 -1
  75. package/common/validate/validations/method.js +1 -1
  76. package/currency/index.js +74 -7
  77. package/currency/vue.js +21 -5
  78. package/date-panel/index.js +16 -0
  79. package/date-panel/vue.js +8 -2
  80. package/date-picker-mobile/index.js +12 -0
  81. package/date-picker-mobile/vue.js +7 -1
  82. package/date-range/vue.js +14 -6
  83. package/date-table/index.js +5 -0
  84. package/date-table/vue.js +3 -1
  85. package/dialog-box/index.js +46 -14
  86. package/dialog-box/vue.js +30 -7
  87. package/dialog-select/index.js +6 -3
  88. package/dialog-select/vue.js +8 -4
  89. package/drawer/index.js +27 -5
  90. package/drawer/vue.js +14 -7
  91. package/dropdown/index.js +7 -7
  92. package/dropdown/vue.js +6 -2
  93. package/dropdown-item/index.js +9 -1
  94. package/dropdown-item/mf.js +6 -10
  95. package/dropdown-item/vue.js +20 -7
  96. package/dropdown-menu/index.js +20 -7
  97. package/dropdown-menu/vue.js +4 -3
  98. package/exception/index.js +2 -7
  99. package/exception/vue.js +7 -10
  100. package/fall-menu/index.js +5 -1
  101. package/fall-menu/vue.js +13 -2
  102. package/file-upload/index.js +68 -18
  103. package/file-upload/vue.js +38 -8
  104. package/filter-box/index.js +1 -0
  105. package/float-button/index.js +42 -0
  106. package/float-button/vue.js +101 -0
  107. package/floating-button/index.js +62 -16
  108. package/floating-button/vue.js +27 -9
  109. package/flowchart/index.js +134 -25
  110. package/flowchart/node.js +13 -4
  111. package/flowchart/vue.js +16 -4
  112. package/form/vue.js +8 -0
  113. package/form-item/index.js +5 -5
  114. package/form-item/vue.js +3 -1
  115. package/fullscreen/index.js +5 -5
  116. package/fullscreen/vue.js +3 -3
  117. package/grid/plugins/export.js +5 -2
  118. package/grid/utils/column.js +1 -0
  119. package/grid/utils/dom.js +7 -1
  120. package/image/index.js +6 -1
  121. package/image/vue.js +6 -3
  122. package/image-viewer/index.js +62 -51
  123. package/image-viewer/vue.js +17 -5
  124. package/input/index.js +81 -20
  125. package/input/vue.js +44 -18
  126. package/ip-address/index.js +61 -19
  127. package/ip-address/vue.js +22 -4
  128. package/link/vue.js +3 -1
  129. package/loading/index.js +2 -2
  130. package/loading/vue.js +8 -2
  131. package/logout/index.js +1 -1
  132. package/menu/index.js +15 -2
  133. package/menu/vue.js +22 -17
  134. package/mind-map/index.js +47 -0
  135. package/mind-map/vue.js +53 -0
  136. package/modal/index.js +44 -4
  137. package/modal/vue.js +18 -4
  138. package/multi-select/index.js +186 -11
  139. package/multi-select/vue.js +60 -15
  140. package/multi-select-item/index.js +23 -0
  141. package/multi-select-item/vue.js +31 -0
  142. package/numeric/index.js +46 -12
  143. package/numeric/vue.js +44 -19
  144. package/option/index.js +27 -9
  145. package/option/vue.js +37 -21
  146. package/option-group/index.js +3 -3
  147. package/package.json +1 -1
  148. package/pager/index.js +18 -4
  149. package/pager/vue.js +16 -5
  150. package/picker/index.js +258 -49
  151. package/picker/mb.js +42 -0
  152. package/picker/vue.js +70 -17
  153. package/picker-column/index.js +1 -1
  154. package/pop-upload/vue.js +3 -0
  155. package/popconfirm/index.js +3 -6
  156. package/popconfirm/vue.js +1 -1
  157. package/popeditor/index.js +71 -32
  158. package/popeditor/vue.js +15 -11
  159. package/popover/index.js +4 -4
  160. package/popover/vue.js +6 -6
  161. package/popup/index.js +3 -3
  162. package/popup/vue.js +5 -5
  163. package/pull-refresh/index.js +13 -13
  164. package/pull-refresh/vue.js +5 -4
  165. package/radio/index.js +0 -17
  166. package/radio/vue.js +4 -10
  167. package/rate/index.js +1 -1
  168. package/rate/vue.js +0 -2
  169. package/record/index.js +4 -1
  170. package/rich-text/clipboard.js +54 -0
  171. package/rich-text/index.js +192 -0
  172. package/rich-text/module/file-upload.js +107 -0
  173. package/rich-text/module/image-drop.js +63 -0
  174. package/rich-text/module/image-upload.js +89 -0
  175. package/rich-text/options.js +141 -0
  176. package/rich-text/table-module.js +382 -0
  177. package/rich-text/vue.js +102 -0
  178. package/{rich-text-edtior → rich-text-editor}/index.js +2 -2
  179. package/{rich-text-edtior → rich-text-editor}/vue.js +2 -5
  180. package/scrollbar/index.js +11 -11
  181. package/scrollbar/vue-bar.js +3 -3
  182. package/scrollbar/vue.js +5 -5
  183. package/search/index.js +9 -9
  184. package/search/vue.js +8 -6
  185. package/select/index.js +457 -389
  186. package/select/vue.js +257 -161
  187. package/select-dropdown/index.js +61 -3
  188. package/select-dropdown/vue.js +85 -8
  189. package/select-view/index.js +3 -1
  190. package/selected-box/index.js +2 -0
  191. package/selected-box/vue.js +6 -3
  192. package/signature/index.js +241 -0
  193. package/signature/vue.js +88 -0
  194. package/skeleton/index.js +14 -0
  195. package/skeleton/vue.js +15 -0
  196. package/skeleton-item/vue.js +15 -0
  197. package/slider/index.js +70 -17
  198. package/slider/vue.js +16 -7
  199. package/split/index.js +5 -3
  200. package/split/vue.js +4 -6
  201. package/standard-list-item/index.js +15 -1
  202. package/standard-list-item/vue.js +6 -5
  203. package/steps/index.js +25 -2
  204. package/steps/slide-bar.js +8 -1
  205. package/steps/vue.js +15 -3
  206. package/tab-item-mf/vue.js +14 -8
  207. package/tab-nav/index.js +30 -5
  208. package/tab-nav/vue.js +16 -4
  209. package/tabbar/vue.js +9 -3
  210. package/tabbar-item/vue.js +3 -2
  211. package/tabs/index.js +16 -4
  212. package/tabs/vue.js +2 -1
  213. package/tabs-mf/index.js +20 -6
  214. package/tabs-mf/vue-nav.js +26 -11
  215. package/tabs-mf/vue.js +7 -7
  216. package/tabs-mf/wheel.js +1 -0
  217. package/tag/index.js +1 -1
  218. package/tag-group/index.js +2 -1
  219. package/time/index.js +5 -2
  220. package/time/vue.js +1 -1
  221. package/time-line/index.js +3 -3
  222. package/time-line/vue.js +2 -2
  223. package/time-picker-mobile/index.js +24 -5
  224. package/time-picker-mobile/vue.js +17 -7
  225. package/time-range/index.js +2 -0
  226. package/timeline-item/vue.js +1 -1
  227. package/tooltip/index.js +6 -3
  228. package/tooltip/vue.js +4 -4
  229. package/transfer/index.js +20 -22
  230. package/transfer/vue.js +1 -6
  231. package/transfer-panel/vue.js +3 -5
  232. package/tree/index.js +21 -4
  233. package/tree/vue.js +10 -8
  234. package/tree-menu/index.js +31 -5
  235. package/tree-menu/vue.js +28 -15
  236. package/tree-node/index.js +18 -18
  237. package/tree-node/vue.js +6 -5
  238. package/types/action-sheet.type.d.ts +118 -1
  239. package/types/alert.type.d.ts +1 -1
  240. package/types/amount.type.d.ts +168 -1
  241. package/types/area.type.d.ts +134 -1
  242. package/types/async-flowchart.type.d.ts +72 -0
  243. package/types/autocomplete.type.d.ts +199 -1
  244. package/types/badge.type.d.ts +3 -1
  245. package/types/breadcrumb-item.type.d.ts +2 -0
  246. package/types/breadcrumb.type.d.ts +2 -0
  247. package/types/button-group.type.d.ts +3 -3
  248. package/types/button.type.d.ts +4 -0
  249. package/types/cascader-menu.type.d.ts +3 -4
  250. package/types/cascader-node.type.d.ts +5 -2
  251. package/types/cascader-panel.type-2bd03be3.d.ts +241 -0
  252. package/types/cascader-panel.type.d.ts +3 -241
  253. package/types/cascader.type.d.ts +329 -1
  254. package/types/checkbox.type.d.ts +9 -3
  255. package/types/collapse.type.d.ts +20 -3
  256. package/types/date-picker.type.d.ts +37 -0
  257. package/types/dialog-box.type.d.ts +13 -3
  258. package/types/drawer.type.d.ts +133 -1
  259. package/types/{dropdown-item.type-8ea6c633.d.ts → dropdown-item.type-8475a549.d.ts} +7 -13
  260. package/types/dropdown-item.type.d.ts +1 -1
  261. package/types/dropdown-menu.type.d.ts +1 -1
  262. package/types/dropdown.type.d.ts +1 -5
  263. package/types/fall-menu.type.d.ts +94 -1
  264. package/types/file-upload.type.d.ts +1 -1
  265. package/types/float-button.type.d.ts +123 -0
  266. package/types/form-item.type.d.ts +1 -1
  267. package/types/{form.type-d0fd42f3.d.ts → form.type-222799ae.d.ts} +5 -2
  268. package/types/form.type.d.ts +1 -1
  269. package/types/{index-e0250f63.d.ts → index-b012f687.d.ts} +9 -0
  270. package/types/input.type.d.ts +1 -5
  271. package/types/ip-address.type.d.ts +160 -1
  272. package/types/link.type.d.ts +6 -3
  273. package/types/loading.type.d.ts +7 -0
  274. package/types/milestone.type.d.ts +1 -1
  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 +13 -1
  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 +5 -1
  282. package/types/popover.type.d.ts +3 -3
  283. package/types/progress.type.d.ts +3 -1
  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 +15 -4
  292. package/types/switch.type.d.ts +3 -3
  293. package/types/tab-bar.type.d.ts +1 -1
  294. package/types/tab-nav.type.d.ts +7 -2
  295. package/types/tabs.type.d.ts +9 -1
  296. package/types/tag-group.type.d.ts +64 -1
  297. package/types/{time-line.type-d7daa669.d.ts → time-line.type-b155cb4f.d.ts} +12 -0
  298. package/types/time-line.type.d.ts +1 -1
  299. package/types/timeline-item.type.d.ts +1 -1
  300. package/types/tooltip.type.d.ts +2 -2
  301. package/types/transfer.type.d.ts +185 -1
  302. package/types/tree-menu.type.d.ts +210 -1
  303. package/types/upload-dragger.type.d.ts +2 -2
  304. package/types/{upload-list.type-343e8c11.d.ts → upload-list.type-a29aea50.d.ts} +31 -8
  305. package/types/upload-list.type.d.ts +1 -1
  306. package/types/upload.type.d.ts +1 -1
  307. package/types/user-head.type.d.ts +146 -1
  308. package/types/wizard.type.d.ts +1 -0
  309. package/upload/index.js +64 -34
  310. package/upload/vue.js +9 -5
  311. package/upload-dragger/index.js +22 -20
  312. package/upload-list/index.js +24 -18
  313. package/upload-list/vue.js +9 -4
  314. package/user/index.js +34 -25
  315. package/user/vue.js +1 -1
  316. package/user-head/index.js +3 -3
  317. package/watermark/index.js +11 -0
  318. package/wheel/index.js +3 -0
  319. package/wizard/vue.js +4 -2
  320. package/common/deps/modal-queue.js +0 -6
  321. package/common/deps/requestAnimationFrame.js +0 -25
@@ -1,10 +1,16 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
- const getData = ({ props, state, updatePopper, nextTick }) => (queryString) => {
2
+ const getData = ({
3
+ props,
4
+ state,
5
+ updatePopper,
6
+ nextTick
7
+ }) => (queryString) => {
8
+ var _a;
3
9
  if (state.suggestionDisabled) {
4
10
  return;
5
11
  }
6
12
  state.loading = true;
7
- props.fetchSuggestions(queryString, (suggestions) => {
13
+ (_a = props == null ? void 0 : props.fetchSuggestions) == null ? void 0 : _a.call(props, queryString, (suggestions) => {
8
14
  state.loading = false;
9
15
  if (state.suggestionDisabled) {
10
16
  return;
@@ -18,7 +24,12 @@ const getData = ({ props, state, updatePopper, nextTick }) => (queryString) => {
18
24
  nextTick(updatePopper);
19
25
  });
20
26
  };
21
- const handleChange = ({ api, emit, state, props }) => (value) => {
27
+ const handleChange = ({
28
+ api,
29
+ emit,
30
+ state,
31
+ props
32
+ }) => (value) => {
22
33
  state.activated = true;
23
34
  emit("update:modelValue", value);
24
35
  state.suggestionDisabled = false;
@@ -29,10 +40,17 @@ const handleChange = ({ api, emit, state, props }) => (value) => {
29
40
  }
30
41
  api.debouncedGetData(value);
31
42
  };
32
- const handleFocus = ({ api, emit, props, state }) => (event) => {
43
+ const handleFocus = ({
44
+ api,
45
+ emit,
46
+ props,
47
+ state
48
+ }) => (event) => {
33
49
  state.activated = true;
34
50
  emit("focus", event);
35
51
  if (props.triggerOnFocus) {
52
+ state.suggestions = [];
53
+ state.highlightedIndex = -1;
36
54
  state.suggestionDisabled = false;
37
55
  api.debouncedGetData(props.modelValue);
38
56
  }
@@ -48,7 +66,16 @@ const handleClear = ({ emit, state }) => () => {
48
66
  const close = (state) => () => {
49
67
  state.activated = false;
50
68
  };
51
- const handleKeyEnter = ({ api, emit, nextTick, props, state }) => (event) => {
69
+ const open = (api) => () => {
70
+ api.handleFocus();
71
+ };
72
+ const handleKeyEnter = ({
73
+ api,
74
+ emit,
75
+ nextTick,
76
+ props,
77
+ state
78
+ }) => (event) => {
52
79
  if (state.suggestionVisible && state.highlightedIndex >= 0 && state.highlightedIndex < state.suggestions.length) {
53
80
  event.preventDefault();
54
81
  api.select(state.suggestions[state.highlightedIndex]);
@@ -60,7 +87,12 @@ const handleKeyEnter = ({ api, emit, nextTick, props, state }) => (event) => {
60
87
  });
61
88
  }
62
89
  };
63
- const select = ({ emit, nextTick, props, state }) => (item) => {
90
+ const select = ({
91
+ emit,
92
+ nextTick,
93
+ props,
94
+ state
95
+ }) => (item) => {
64
96
  emit("update:modelValue", item[props.valueKey]);
65
97
  emit("select", item);
66
98
  nextTick(() => {
@@ -69,7 +101,11 @@ const select = ({ emit, nextTick, props, state }) => (item) => {
69
101
  state.highlightedIndex = -1;
70
102
  });
71
103
  };
72
- const highlight = ({ constants, refs, state }) => (index) => {
104
+ const highlight = ({
105
+ constants,
106
+ vm,
107
+ state
108
+ }) => (index) => {
73
109
  if (!state.suggestionVisible || state.loading) {
74
110
  return;
75
111
  }
@@ -80,7 +116,7 @@ const highlight = ({ constants, refs, state }) => (index) => {
80
116
  if (index >= state.suggestions.length) {
81
117
  index = state.suggestions.length - 1;
82
118
  }
83
- const suggestion = refs.popper.querySelector(constants.WARP_CLS);
119
+ const suggestion = vm.$refs.popper.querySelector(constants.WARP_CLS);
84
120
  const suggestionList = suggestion.querySelectorAll(constants.ITEM_CLS);
85
121
  let highlightItem = suggestionList[index];
86
122
  let scrollTop = suggestion.scrollTop;
@@ -92,7 +128,7 @@ const highlight = ({ constants, refs, state }) => (index) => {
92
128
  suggestion.scrollTop -= highlightItem.scrollHeight;
93
129
  }
94
130
  state.highlightedIndex = index;
95
- let $input = refs.input.getInput();
131
+ let $input = vm.$refs.input.getInput();
96
132
  $input.setAttribute("aria-activedescendant", `${state.id}-item-${state.highlightedIndex}`);
97
133
  };
98
134
  const computedVisible = (state) => {
@@ -100,17 +136,24 @@ const computedVisible = (state) => {
100
136
  let isValidData = Array.isArray(suggestions) && suggestions.length > 0;
101
137
  return (isValidData || state.loading) && state.activated;
102
138
  };
103
- const watchVisible = ({ suggestionState, refs }) => (val) => {
104
- let $input = refs.input.getInput();
139
+ const watchVisible = ({
140
+ suggestionState,
141
+ vm
142
+ }) => (val) => {
143
+ let $input = vm.$refs.input.getInput();
105
144
  if ($input) {
106
145
  suggestionState.dropdownWidth = $input.offsetWidth + "px";
107
146
  suggestionState.showPopper = val;
108
147
  }
109
148
  };
110
- const mounted = ({ refs, state, suggestionState }) => () => {
111
- const input = refs.input;
149
+ const mounted = ({
150
+ vm,
151
+ state,
152
+ suggestionState
153
+ }) => () => {
154
+ const input = vm.$refs.input;
112
155
  const $input = input.getInput();
113
- suggestionState.popperElm = refs.popper;
156
+ suggestionState.popperElm = state.popperElm = vm.$refs.popper;
114
157
  suggestionState.referenceElm = $input;
115
158
  $input.setAttribute("role", "textbox");
116
159
  $input.setAttribute("aria-autocomplete", "list");
@@ -128,6 +171,7 @@ export {
128
171
  handleKeyEnter,
129
172
  highlight,
130
173
  mounted,
174
+ open,
131
175
  select,
132
176
  watchVisible
133
177
  };
@@ -12,6 +12,7 @@ import {
12
12
  handleBlur,
13
13
  handleClear,
14
14
  close,
15
+ open,
15
16
  handleKeyEnter,
16
17
  select,
17
18
  highlight
@@ -23,6 +24,7 @@ const api = [
23
24
  "getInput",
24
25
  "handleChange",
25
26
  "close",
27
+ "open",
26
28
  "handleFocus",
27
29
  "handleBlur",
28
30
  "handleClear",
@@ -31,8 +33,15 @@ const api = [
31
33
  "select",
32
34
  "doDestroy"
33
35
  ];
34
- const initState = ({ reactive, $prefix, computed }) => {
36
+ const initState = ({
37
+ reactive,
38
+ $prefix,
39
+ computed,
40
+ inject
41
+ }) => {
35
42
  const state = reactive({
43
+ showAutoWidth: inject("showAutoWidth", null),
44
+ popperElm: null,
36
45
  activated: false,
37
46
  suggestions: [],
38
47
  loading: false,
@@ -43,39 +52,57 @@ const initState = ({ reactive, $prefix, computed }) => {
43
52
  });
44
53
  return state;
45
54
  };
46
- const initSuggestionState = ({ reactive, parent, showPopper, popperElm, referenceElm }) => reactive({
55
+ const initSuggestionState = ({
56
+ reactive,
47
57
  parent,
48
- dropdownWidth: "",
49
58
  showPopper,
50
59
  popperElm,
51
60
  referenceElm
52
- });
53
- const initApi = ({ api: api2, state, doDestroy, suggestionState, emit, refs, props, updatePopper, nextTick, constants }) => {
61
+ }) => {
62
+ return reactive({
63
+ parent,
64
+ dropdownWidth: "",
65
+ showPopper,
66
+ popperElm,
67
+ referenceElm
68
+ });
69
+ };
70
+ const initApi = ({ api: api2, state, doDestroy, suggestionState, emit, vm, props, updatePopper, nextTick, constants }) => {
54
71
  api2.getData = getData({ props, state, updatePopper, nextTick });
55
72
  Object.assign(api2, {
56
73
  state,
57
74
  doDestroy,
58
75
  suggestionState,
59
76
  close: close(state),
77
+ open: open(api2),
60
78
  handleBlur: handleBlur({ emit, state }),
61
- mounted: mounted({ refs, state, suggestionState }),
62
- highlight: highlight({ constants, refs, state }),
79
+ mounted: mounted({ vm, state, suggestionState }),
80
+ highlight: highlight({ constants, vm, state }),
63
81
  handleClear: handleClear({ emit, state }),
64
82
  select: select({ emit, nextTick, props, state }),
65
- watchVisible: watchVisible({ suggestionState, refs }),
83
+ watchVisible: watchVisible({ suggestionState, vm }),
66
84
  handleChange: handleChange({ api: api2, emit, state, props }),
67
85
  handleFocus: handleFocus({ api: api2, emit, props, state }),
68
86
  handleKeyEnter: handleKeyEnter({ api: api2, emit, nextTick, props, state }),
69
87
  debouncedGetData: debounce(props.debounce, api2.getData)
70
88
  });
71
89
  };
72
- const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, watch, toRefs, onDeactivated }, { $prefix, refs, parent, emit, constants, nextTick, slots }) => {
90
+ const renderless = (props, {
91
+ computed,
92
+ onBeforeUnmount,
93
+ onMounted,
94
+ reactive,
95
+ watch,
96
+ toRefs,
97
+ onDeactivated,
98
+ inject
99
+ }, { $prefix, vm, parent, emit, constants, nextTick, slots }) => {
73
100
  const api2 = {};
74
- const state = initState({ reactive, $prefix, computed });
101
+ const state = initState({ reactive, $prefix, computed, inject });
75
102
  const { showPopper, popperElm, referenceElm, doDestroy, updatePopper } = userPopper({
76
103
  reactive,
77
104
  watch,
78
- refs,
105
+ vm,
79
106
  emit,
80
107
  slots,
81
108
  nextTick,
@@ -85,12 +112,13 @@ const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, wat
85
112
  onDeactivated
86
113
  });
87
114
  const suggestionState = initSuggestionState({ reactive, parent, showPopper, popperElm, referenceElm });
88
- initApi({ api: api2, state, doDestroy, suggestionState, emit, refs, props, updatePopper, nextTick, constants });
115
+ initApi({ api: api2, state, doDestroy, suggestionState, emit, vm, props, updatePopper, nextTick, constants });
89
116
  watch(() => state.suggestionVisible, api2.watchVisible);
90
117
  onMounted(api2.mounted);
91
118
  return api2;
92
119
  };
93
120
  export {
94
121
  api,
122
+ initSuggestionState,
95
123
  renderless
96
124
  };
package/badge/index.js CHANGED
@@ -6,7 +6,19 @@ const computedValueRef = ({ props }) => () => {
6
6
  }
7
7
  return typeof props.modelValue === "number" ? props.modelValue : void 0;
8
8
  };
9
+ const computedTransform = ({ designConfig, props }) => () => {
10
+ if ((designConfig == null ? void 0 : designConfig.transform) === "unset") {
11
+ return null;
12
+ }
13
+ return {
14
+ transform: `translate(
15
+ ${props.offset[0]}${typeof props.offset[0] === "number" ? "px" : ""},
16
+ ${props.offset[1]}${typeof props.offset[1] === "number" ? "px" : ""}
17
+ )`
18
+ };
19
+ };
9
20
  export {
10
21
  computedContent,
22
+ computedTransform,
11
23
  computedValueRef
12
24
  };
package/badge/vue.js CHANGED
@@ -1,18 +1,20 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
- import { computedContent, computedValueRef } from "./index";
2
+ import { computedContent, computedValueRef, computedTransform } from "./index";
3
3
  import { xss } from "../common/xss";
4
4
  const api = ["state"];
5
- const renderless = (props, { computed, reactive }) => {
5
+ const renderless = (props, { computed, reactive }, { designConfig }) => {
6
6
  const state = reactive({
7
7
  isOverstep: false,
8
8
  valueRef: computed(() => api2.computedValueRef()),
9
9
  content: computed(() => api2.computedContent()),
10
- href: computed(() => xss.filterUrl(props.href))
10
+ href: computed(() => xss.filterUrl(props.href)),
11
+ transform: computed(() => api2.computedTransform())
11
12
  });
12
13
  const api2 = {
13
14
  state,
14
15
  computedValueRef: computedValueRef({ props }),
15
- computedContent: computedContent({ props, state })
16
+ computedContent: computedContent({ props, state }),
17
+ computedTransform: computedTransform({ props, designConfig })
16
18
  };
17
19
  return api2;
18
20
  };
package/breadcrumb/vue.js CHANGED
@@ -1,15 +1,17 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
2
  import { breadcrumbItemSelect } from "./index";
3
- const api = ["breadcrumbItemSelect"];
3
+ const api = ["breadcrumbItemSelect", "state"];
4
4
  const renderless = (props, { reactive, provide }, { emit, constants, emitter }) => {
5
5
  const state = reactive({
6
6
  breadcrumbEmitter: emitter(),
7
+ size: props.size,
7
8
  currentBreadcrumbItem: {}
8
9
  });
9
10
  const api2 = {
10
11
  state,
11
12
  breadcrumbItemSelect: () => breadcrumbItemSelect({ api: api2, emit, state, constants })
12
13
  };
14
+ provide("size", state.size);
13
15
  provide("breadcrumbEmitter", state.breadcrumbEmitter);
14
16
  api2.breadcrumbItemSelect();
15
17
  return api2;
@@ -1,11 +1,15 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
2
  import { linkClick } from "./index";
3
- const api = ["linkClick"];
4
- const renderless = (props, { inject }, { refs, router, emit }) => {
3
+ const api = ["linkClick", "state"];
4
+ const renderless = (props, { reactive, inject }, { refs, router, emit }) => {
5
5
  const breadcrumbEmitter = inject("breadcrumbEmitter");
6
6
  const breadcrumb = inject("breadcrumb");
7
7
  const constants = breadcrumb._constants;
8
+ const state = reactive({
9
+ size: inject("size", null)
10
+ });
8
11
  const api2 = {
12
+ state,
9
13
  linkClick: linkClick({ props, refs, router, emit, breadcrumbEmitter, constants })
10
14
  };
11
15
  return api2;
package/button/index.js CHANGED
@@ -1,6 +1,10 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
+ import { xss } from "../common";
2
3
  const handleClick = ({ emit, props, state }) => (event) => {
3
- if (props.nativeType === "button" && props.resetTime > 0) {
4
+ const urlHref = xss.filterUrl(props.href);
5
+ if (urlHref) {
6
+ location.href = urlHref;
7
+ } else if (props.nativeType === "button" && props.resetTime > 0) {
4
8
  state.disabled = true;
5
9
  state.timer = window.setTimeout(() => {
6
10
  state.disabled = false;
package/calendar/index.js CHANGED
@@ -1,83 +1,6 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
- import { isLeapYear } from "../common/date";
3
2
  import { copyArray } from "../common/object";
4
- const getDays = (year, month) => [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month - 1];
5
- const getWeek = (year, month, day) => (/* @__PURE__ */ new Date(`${year}/${month}/${day}`)).getDay();
6
- const lastMonth = (year, month) => {
7
- year = Number(year);
8
- month = Number(month);
9
- if (month === 1) {
10
- year--;
11
- month = 12;
12
- } else {
13
- month--;
14
- }
15
- return { year, month };
16
- };
17
- const nextMonth = (year, month) => {
18
- year = Number(year);
19
- month = Number(month);
20
- if (month === 12) {
21
- year++;
22
- month = 1;
23
- } else {
24
- month++;
25
- }
26
- return { year, month };
27
- };
28
- const getCalendar = (year, month) => {
29
- if (year && month && month <= 12) {
30
- const days = getDays(year, month);
31
- const firstWeek = getWeek(year, month, 1);
32
- const lastWeek = getWeek(year, month, days);
33
- const last = lastMonth(year, month);
34
- const lastDays = getDays(last.year, last.month);
35
- let remainDays = 0;
36
- const totalDays = days + firstWeek + 7 - lastWeek - 1;
37
- if (totalDays / 7 < 6 && totalDays / 7 >= 5) {
38
- remainDays = 6 * 7 - totalDays;
39
- }
40
- return {
41
- last: {
42
- start: lastDays - (firstWeek - 1),
43
- end: lastDays
44
- },
45
- current: {
46
- start: 1,
47
- end: days
48
- },
49
- next: {
50
- start: 1,
51
- end: 7 - lastWeek - 1 + remainDays
52
- }
53
- };
54
- }
55
- };
56
- const transformArray = (array) => {
57
- const result = [];
58
- let index = 0;
59
- if (array && array.length) {
60
- const length = array.length / 7;
61
- for (let i = 0; i < length; i++) {
62
- result[i] = [];
63
- for (let j = 0; j < 7; j++) {
64
- result[i][j] = array[index++];
65
- }
66
- }
67
- }
68
- return result;
69
- };
70
- const parseDate = (time) => {
71
- const date = new Date(time && typeof time === "number" ? time : 0);
72
- return {
73
- year: date.getFullYear(),
74
- month: date.getMonth() + 1,
75
- day: date.getDate(),
76
- hours: date.getHours(),
77
- minutes: date.getMinutes(),
78
- seconds: date.getSeconds()
79
- };
80
- };
3
+ import { lastMonth, nextMonth, getCalendar, transformArray, parseDate } from "../common/calendar/calendar";
81
4
  const computedCalendar = ({ state }) => () => {
82
5
  const calendar = getCalendar(state.activeYear, state.activeMonth);
83
6
  const result = [];
@@ -223,22 +146,15 @@ export {
223
146
  computedCalendar,
224
147
  computedEventList,
225
148
  genMonths,
226
- getCalendar,
227
149
  getCurrentDate,
228
- getDays,
229
150
  getEventByDay,
230
151
  getEventByMonth,
231
152
  getTime,
232
- getWeek,
233
153
  getYearList,
234
154
  isThisMonth,
235
155
  isToday,
236
- lastMonth,
237
- nextMonth,
238
- parseDate,
239
156
  selectDay,
240
157
  selectMonth,
241
158
  toToday,
242
- toggeModel,
243
- transformArray
159
+ toggeModel
244
160
  };
@@ -192,7 +192,7 @@ const getWeekOfDate = ({ api }) => (type, date) => {
192
192
  };
193
193
  const showWeekChange = ({ state }) => (value) => {
194
194
  if (value) {
195
- state.weekDates = state.calendarDays.filter((day) => day.row === state.activeRow);
195
+ getWeekDatesByActiveRow(state);
196
196
  } else {
197
197
  state.calendarDays.forEach((date) => {
198
198
  if (state.activeDate === date.dateStr) {
@@ -207,6 +207,13 @@ const formatDate = (date) => {
207
207
  const newDate = new Date(date);
208
208
  return newDate.getFullYear() + "-" + pad0(newDate.getMonth() + 1) + "-" + pad0(newDate.getDate());
209
209
  };
210
+ const getWeekDatesByActiveRow = (state) => {
211
+ state.weekDates = state.calendarDays.filter((day) => day.row === state.activeRow);
212
+ if (!state.weekDates.length) {
213
+ state.activeRow = 0;
214
+ state.weekDates = state.calendarDays.filter((day) => day.row === state.activeRow);
215
+ }
216
+ };
210
217
  const computedCurrentRow = (state) => () => {
211
218
  const { calendarDays } = state;
212
219
  if (Array.isArray(calendarDays) && calendarDays.length) {
@@ -249,10 +256,17 @@ const handleClickDay = ({ api, emit, props, state }) => (day) => {
249
256
  api.getCalendarDays(day.dateStr, props.config, "next");
250
257
  }
251
258
  const showCalendarDays = [...state.calendarDays, ...state.weekDates];
252
- showCalendarDays.forEach((date) => date.isCur = day.dateStr === date.dateStr);
259
+ state.activeRow = day.row;
260
+ showCalendarDays.forEach((date) => {
261
+ if (day.dateStr === date.dateStr) {
262
+ date.isCur = true;
263
+ state.activeRow = date.row;
264
+ } else {
265
+ date.isCur = false;
266
+ }
267
+ });
253
268
  state.activeDate = day.dateStr;
254
269
  state.currentDate = day.dateArr[2];
255
- state.activeRow = day.row;
256
270
  emit("update:modelValue", day.dateStr);
257
271
  }
258
272
  };
@@ -368,7 +382,7 @@ const handleCascaderChange = ({ api, emit, props, state }) => (val) => {
368
382
  api.getCalendarDays(dateStr, props.config, "last");
369
383
  api.getCalendarDays(dateStr, props.config, "next");
370
384
  emit("update:modelValue", dateStr);
371
- state.weekDates = state.calendarDays.filter((day) => day.row === state.activeRow);
385
+ getWeekDatesByActiveRow(state);
372
386
  };
373
387
  const computeCascaderOptions = (t) => () => [
374
388
  {
@@ -60,7 +60,7 @@ const isSelectedDate = ({ state }) => (day) => {
60
60
  const getDayBgColor = ({ props }) => (day) => {
61
61
  const date = day.year + "-" + day.month + "-" + day.value;
62
62
  const isFunction = props.setDayBgColor instanceof Function;
63
- const bgColor = isFunction ? props.setDayBgColor(date) : "";
63
+ const bgColor = isFunction ? props.setDayBgColor(date) : "white";
64
64
  return bgColor;
65
65
  };
66
66
  const parseDate = (time) => {
@@ -195,7 +195,9 @@ const selectDay = ({ state, emit }) => (day, i) => {
195
195
  } else {
196
196
  state.selectedDates.push(date);
197
197
  }
198
+ emit("update:modelValue", state.selectedDates);
198
199
  emit("selected-date-change", state.selectedDates);
200
+ emit("date-click", date);
199
201
  } else {
200
202
  if (day.isNext) {
201
203
  const { year, month } = nextMonth(state.activeYear, state.activeMonth);
@@ -209,6 +211,8 @@ const selectDay = ({ state, emit }) => (day, i) => {
209
211
  }
210
212
  state.selectedDate = day.value.toString().length > 2 ? day.value : `${state.activeYear}-${state.activeMonth}-${day.value}`;
211
213
  state.showSelectedDateEvents = true;
214
+ emit("update:modelValue", state.selectedDate);
215
+ emit("date-click", state.selectedDate);
212
216
  }
213
217
  };
214
218
  const getEventByMonth = ({ state }) => (year, month) => {
@@ -135,6 +135,19 @@ const initState = ({ reactive, props, computed, api: api2, images, modesIcon })
135
135
  return state;
136
136
  };
137
137
  const initWatch = ({ watch, props, state, emit, api: api2, nextTick }) => {
138
+ watch(
139
+ () => props.modelValue,
140
+ (value) => {
141
+ if (value) {
142
+ if (props.multiSelect && Array.isArray(value)) {
143
+ state.selectedDates = value;
144
+ } else {
145
+ state.selectedDate = value;
146
+ }
147
+ }
148
+ },
149
+ { immediate: true, deep: true }
150
+ );
138
151
  watch(
139
152
  () => props.mode,
140
153
  () => {
@@ -151,9 +164,6 @@ const initWatch = ({ watch, props, state, emit, api: api2, nextTick }) => {
151
164
  watch(
152
165
  () => state.selectedDate,
153
166
  () => {
154
- if (state.mode === "month") {
155
- api2.getEventByDate(state.selectedDate, state.selectedDateEvents);
156
- }
157
167
  emit("selected-date-change", state.selectedDate);
158
168
  },
159
169
  { deep: true }
@@ -184,6 +194,9 @@ const initWatch = ({ watch, props, state, emit, api: api2, nextTick }) => {
184
194
  });
185
195
  }
186
196
  );
197
+ addWatch({ watch, props, state, emit, api: api2 });
198
+ };
199
+ const addWatch = ({ watch, props, state, emit, api: api2 }) => {
187
200
  watch(
188
201
  () => props.month,
189
202
  (val, oldVal) => {
package/card-group/vue.js CHANGED
@@ -1,8 +1,10 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
2
  const api = ["state"];
3
- const renderless = (props, { reactive }, { vm }) => {
3
+ const renderless = (props, { reactive, computed }, { vm }) => {
4
4
  const api2 = {};
5
- const state = reactive({});
5
+ const state = reactive({
6
+ size: computed(() => props.size)
7
+ });
6
8
  Object.assign(api2, {
7
9
  state
8
10
  });