@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
package/input/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
+ import { omitText } from "../common/string";
2
3
  const HIDDEN_STYLE = `
3
4
  height:0 !important;visibility:hidden !important;overflow:hidden !important;
4
5
  position:absolute !important;z-index:-1000 !important;top:0 !important;right:0 !important
@@ -56,6 +57,12 @@ const calcTextareaHeight = ({
56
57
  props,
57
58
  state
58
59
  }) => (targetElement, minRows = 1, maxRows = null) => {
60
+ if (!targetElement) {
61
+ return {
62
+ minHeight: "",
63
+ height: ""
64
+ };
65
+ }
59
66
  if (!hiddenTextarea) {
60
67
  hiddenTextarea = document.createElement("textarea");
61
68
  document.body.appendChild(hiddenTextarea);
@@ -76,7 +83,7 @@ const calcTextareaHeight = ({
76
83
  minHeight = minHeight + paddingSize + borderSize;
77
84
  }
78
85
  if (props.size) {
79
- minHeight = props.size == "mini" ? minHeight * 0.67 : props.size == "small" ? minHeight : minHeight * 1.17;
86
+ minHeight = props.size === "mini" ? minHeight * 0.67 : props.size === "small" ? minHeight : minHeight * 1.17;
80
87
  }
81
88
  if (props.height) {
82
89
  minHeight = props.height;
@@ -110,7 +117,8 @@ const handleBlur = ({
110
117
  eventName,
111
118
  emit,
112
119
  props,
113
- state
120
+ state,
121
+ vm
114
122
  }) => (event) => {
115
123
  state.focused = false;
116
124
  emit("blur", event);
@@ -118,6 +126,9 @@ const handleBlur = ({
118
126
  if (props.validateEvent) {
119
127
  api.dispatch(componentName, eventName, [props.modelValue]);
120
128
  }
129
+ if (props.hoverExpand) {
130
+ vm.$refs.textarea.scrollTop = 0;
131
+ }
121
132
  };
122
133
  const handleFocus = ({ api, emit, state }) => (event) => {
123
134
  state.focused = true;
@@ -137,7 +148,7 @@ const handleInput = ({ api, emit, nextTick, state }) => (event) => {
137
148
  nextTick(api.setNativeInputValue);
138
149
  };
139
150
  const handleChange = (emit) => (event) => emit("change", event.target.value);
140
- const resizeTextarea = ({ api, parent, refs, state }) => () => {
151
+ const resizeTextarea = ({ api, parent, vm, state, props }) => () => {
141
152
  if (isServer) {
142
153
  return;
143
154
  }
@@ -145,15 +156,22 @@ const resizeTextarea = ({ api, parent, refs, state }) => () => {
145
156
  if (type !== "textarea") {
146
157
  return;
147
158
  }
159
+ if (props.hoverExpand && !state.enteredTextarea) {
160
+ state.textareaCalcStyle = {
161
+ minHeight: state.textareaHeight,
162
+ height: state.textareaHeight
163
+ };
164
+ return;
165
+ }
148
166
  if (!autosize) {
149
167
  state.textareaCalcStyle = {
150
- minHeight: api.calcTextareaHeight(refs.textarea).minHeight
168
+ minHeight: api.calcTextareaHeight(vm.$refs.textarea).minHeight
151
169
  };
152
170
  return;
153
171
  }
154
172
  const minRows = autosize.minRows;
155
173
  const maxRows = autosize.maxRows;
156
- state.textareaCalcStyle = api.calcTextareaHeight(refs.textarea, minRows, maxRows);
174
+ state.textareaCalcStyle = api.calcTextareaHeight(vm.$refs.textarea, minRows, maxRows);
157
175
  };
158
176
  const setNativeInputValue = ({ api, state }) => () => {
159
177
  const input = api.getInput();
@@ -222,7 +240,7 @@ const handlePasswordVisible = ({ api, nextTick, state }) => () => {
222
240
  state.passwordVisible = !state.passwordVisible;
223
241
  nextTick(api.focus);
224
242
  };
225
- const getSuffixVisible = ({ parent, props, state }) => () => parent.$slots.suffix || props.suffixIcon || state.showClear || props.showPassword || state.isWordLimitVisible || state.validateState && state.needStatusIcon;
243
+ const getSuffixVisible = ({ parent, props, state }) => () => parent.$slots.suffix || props.suffixIcon || state.showClear || props.showPassword || state.isWordLimitVisible || state.validateState && state.needStatusIcon || props.mask && state.inputDisabled;
226
244
  const textLength = (value) => {
227
245
  if (typeof value === "number") {
228
246
  return String(value).length;
@@ -243,8 +261,25 @@ const hasSelection = (api) => () => {
243
261
  };
244
262
  const handleEnterDisplayOnlyContent = ({ state, props }) => ($event, type) => {
245
263
  const target = $event.target;
246
- if (target && (target.scrollWidth > target.offsetWidth || type === "textarea" && target.scrollHeight > target.offsetHeight)) {
264
+ state.displayOnlyTooltip = "";
265
+ if (!target) {
266
+ return;
267
+ }
268
+ const isOverText = target.scrollWidth > target.offsetWidth || type === "textarea" && target.scrollHeight > target.offsetHeight;
269
+ if (isOverText) {
247
270
  state.displayOnlyTooltip = props.displayOnlyContent || state.nativeInputValue;
271
+ } else {
272
+ let isOverTextWhenMask = false;
273
+ if (props.mask && state.maskValueVisible) {
274
+ const text = target.textContent;
275
+ const font = window.getComputedStyle(target).font;
276
+ const rect = target.getBoundingClientRect();
277
+ const iconWidth = 16 + 15;
278
+ isOverTextWhenMask = omitText(text, font, rect.width - iconWidth).o;
279
+ }
280
+ if (isOverTextWhenMask) {
281
+ state.displayOnlyTooltip = props.displayOnlyContent || state.nativeInputValue;
282
+ }
248
283
  }
249
284
  };
250
285
  const hiddenPassword = ({ state, props }) => () => {
@@ -255,30 +290,53 @@ const hiddenPassword = ({ state, props }) => () => {
255
290
  }
256
291
  return str;
257
292
  };
258
- const dispatchDisplayedValue = ({ state, props, dispatch, api }) => () => {
259
- if (state.isDisplayOnly) {
260
- dispatch("FormItem", "displayed-value-changed", {
261
- type: props.type || "text",
262
- val: api.getDisplayedValue()
263
- });
293
+ const getDisplayedMaskValue = ({ state }) => () => {
294
+ if (state.maskValueVisible) {
295
+ return state.nativeInputValue;
296
+ } else {
297
+ return state.nativeInputValue && state.maskSymbol;
264
298
  }
265
299
  };
266
- const getDisplayedValue = ({ state, props }) => () => {
267
- if (props.type === "password") {
268
- return state.hiddenPassword || "-";
269
- } else {
270
- return props.displayOnlyContent || state.nativeInputValue || "-";
300
+ const setInputDomValue = ({ state, props, nextTick, vm }) => (type) => {
301
+ nextTick(() => {
302
+ const input = vm.$refs.input;
303
+ if (props.mask && state.nativeInputValue && input) {
304
+ input.value = state.maskValueVisible || !state.inputDisabled ? state.nativeInputValue : state.maskSymbol;
305
+ }
306
+ if (type === "mask" && !props.mask && input) {
307
+ input.value = state.nativeInputValue;
308
+ }
309
+ });
310
+ };
311
+ const handleEnterTextarea = ({ api, state, props, nextTick }) => () => {
312
+ if (props.hoverExpand && !state.isDisplayOnly) {
313
+ state.enteredTextarea = true;
314
+ nextTick(api.resizeTextarea);
271
315
  }
272
316
  };
317
+ const handleLeaveTextarea = ({ api, state, props, nextTick, vm }) => () => {
318
+ if (props.hoverExpand && !state.isDisplayOnly) {
319
+ state.enteredTextarea = false;
320
+ nextTick(() => {
321
+ api.resizeTextarea();
322
+ vm.$refs.textarea.scrollTop = 0;
323
+ });
324
+ }
325
+ };
326
+ const getDisplayOnlyText = ({ parent, state, props }) => () => {
327
+ const text = props.displayOnlyContent || state.nativeInputValue;
328
+ const showEmptyValue = typeof props.showEmptyValue === "boolean" ? props.showEmptyValue : (parent.tinyForm || {}).showEmptyValue;
329
+ return showEmptyValue ? text : text || "-";
330
+ };
273
331
  export {
274
332
  blur,
275
333
  calcIconOffset,
276
334
  calcTextareaHeight,
277
335
  calculateNodeStyling,
278
336
  clear,
279
- dispatchDisplayedValue,
280
337
  focus,
281
- getDisplayedValue,
338
+ getDisplayOnlyText,
339
+ getDisplayedMaskValue,
282
340
  getInput,
283
341
  getSuffixVisible,
284
342
  handleBlur,
@@ -287,14 +345,17 @@ export {
287
345
  handleCompositionStart,
288
346
  handleCompositionUpdate,
289
347
  handleEnterDisplayOnlyContent,
348
+ handleEnterTextarea,
290
349
  handleFocus,
291
350
  handleInput,
351
+ handleLeaveTextarea,
292
352
  handlePasswordVisible,
293
353
  hasSelection,
294
354
  hiddenPassword,
295
355
  inputStyle,
296
356
  resizeTextarea,
297
357
  select,
358
+ setInputDomValue,
298
359
  setNativeInputValue,
299
360
  showBox,
300
361
  textLength,
package/input/vue.js CHANGED
@@ -29,9 +29,12 @@ import {
29
29
  hasSelection,
30
30
  handleEnterDisplayOnlyContent,
31
31
  hiddenPassword,
32
- dispatchDisplayedValue,
33
- getDisplayedValue,
34
- inputStyle
32
+ setInputDomValue,
33
+ getDisplayedMaskValue,
34
+ inputStyle,
35
+ handleEnterTextarea,
36
+ handleLeaveTextarea,
37
+ getDisplayOnlyText
35
38
  } from "./index";
36
39
  import useStorageBox from "../tall-storage/vue-storage-box";
37
40
  const api = [
@@ -65,7 +68,9 @@ const api = [
65
68
  "hasSelection",
66
69
  "handleEnterDisplayOnlyContent",
67
70
  "hiddenPassword",
68
- "inputStyle"
71
+ "inputStyle",
72
+ "handleEnterTextarea",
73
+ "handleLeaveTextarea"
69
74
  ];
70
75
  const initState = ({
71
76
  reactive,
@@ -74,22 +79,28 @@ const initState = ({
74
79
  props,
75
80
  parent,
76
81
  constants,
77
- api: api2
82
+ api: api2,
83
+ vm
78
84
  }) => {
79
85
  const state = reactive({
80
86
  mode,
87
+ maskSymbol: constants.MASKSYMBOL,
81
88
  focused: false,
82
89
  hovering: false,
83
90
  isComposing: false,
84
91
  passwordVisible: false,
92
+ maskValueVisible: false,
85
93
  boxVisibility: false,
86
94
  textareaCalcStyle: {},
87
95
  checkedLabel: "",
96
+ enteredTextarea: false,
88
97
  sheetvalue: props.modelValue,
89
98
  inputSize: computed(() => props.size || state.formItemSize),
99
+ inputSizeMf: computed(() => props.size || (parent.tinyForm || {}).size),
90
100
  showClear: computed(
91
101
  () => props.clearable && !state.inputDisabled && !props.readonly && state.nativeInputValue && (state.focused || state.hovering)
92
102
  ),
103
+ textareaHeight: vm.theme === "saas" ? "28px" : "30px",
93
104
  upperLimit: computed(() => parent.$attrs.maxlength),
94
105
  textLength: computed(() => textLength(props.modelValue)),
95
106
  inputExceed: computed(() => state.isWordLimitVisible && state.textLength > state.upperLimit),
@@ -119,7 +130,9 @@ const initState = ({
119
130
  () => (props.displayOnly || (parent.tinyForm || {}).displayOnly) && ["text", "textarea", "password", "number"].includes(props.type)
120
131
  ),
121
132
  displayOnlyTooltip: "",
122
- hiddenPassword: computed(() => api2.hiddenPassword())
133
+ hiddenPassword: computed(() => api2.hiddenPassword()),
134
+ displayedMaskValue: computed(() => api2.getDisplayedMaskValue()),
135
+ displayOnlyText: computed(() => api2.getDisplayOnlyText())
123
136
  });
124
137
  return state;
125
138
  };
@@ -132,7 +145,8 @@ const initApi = ({
132
145
  vm,
133
146
  props,
134
147
  CLASS_PREFIX,
135
- parent
148
+ parent,
149
+ nextTick
136
150
  }) => {
137
151
  Object.assign(api2, {
138
152
  state,
@@ -148,8 +162,10 @@ const initApi = ({
148
162
  calculateNodeStyling: calculateNodeStyling(),
149
163
  handleCompositionStart: handleCompositionStart(state),
150
164
  handleCompositionUpdate: handleCompositionUpdate(state),
151
- dispatchDisplayedValue: dispatchDisplayedValue({ state, props, dispatch, api: api2 }),
152
- getDisplayedValue: getDisplayedValue({ state, props }),
165
+ setInputDomValue: setInputDomValue({ state, props, nextTick, vm }),
166
+ getDisplayOnlyText: getDisplayOnlyText({ parent, props, state }),
167
+ handleEnterTextarea: handleEnterTextarea({ api: api2, state, props, nextTick }),
168
+ handleLeaveTextarea: handleLeaveTextarea({ api: api2, state, props, nextTick, vm }),
153
169
  inputStyle: inputStyle({ props })
154
170
  });
155
171
  };
@@ -163,7 +179,7 @@ const mergeApi = ({
163
179
  nextTick,
164
180
  parent,
165
181
  state,
166
- refs
182
+ vm
167
183
  }) => {
168
184
  const { storageData, isMemoryStorage, addMemory, searchMemory, selectedMemory } = storages;
169
185
  return Object.assign(api2, {
@@ -181,11 +197,12 @@ const mergeApi = ({
181
197
  emit,
182
198
  eventName: eventName.blur,
183
199
  props,
184
- state
200
+ state,
201
+ vm
185
202
  }),
186
203
  handleFocus: handleFocus({ api: api2, emit, state }),
187
204
  handleInput: handleInput({ api: api2, emit, nextTick, state }),
188
- resizeTextarea: resizeTextarea({ api: api2, parent, refs, state }),
205
+ resizeTextarea: resizeTextarea({ api: api2, parent, vm, state, props }),
189
206
  updateIconOffset: updateIconOffset(api2),
190
207
  calcTextareaHeight: calcTextareaHeight({
191
208
  api: api2,
@@ -198,7 +215,8 @@ const mergeApi = ({
198
215
  handlePasswordVisible: handlePasswordVisible({ api: api2, nextTick, state }),
199
216
  hasSelection: hasSelection(api2),
200
217
  handleEnterDisplayOnlyContent: handleEnterDisplayOnlyContent({ state, props }),
201
- hiddenPassword: hiddenPassword({ state, props })
218
+ hiddenPassword: hiddenPassword({ state, props }),
219
+ getDisplayedMaskValue: getDisplayedMaskValue({ state })
202
220
  });
203
221
  };
204
222
  const initWatch = ({
@@ -222,6 +240,15 @@ const initWatch = ({
222
240
  if (props.validateEvent) {
223
241
  api2.dispatch(componentName, eventName.change, [value]);
224
242
  }
243
+ api2.setInputDomValue();
244
+ }
245
+ );
246
+ watch(() => state.maskValueVisible, api2.setInputDomValue);
247
+ watch(() => state.inputDisabled, api2.setInputDomValue);
248
+ watch(
249
+ () => props.mask,
250
+ () => {
251
+ api2.setInputDomValue("mask");
225
252
  }
226
253
  );
227
254
  watch(
@@ -252,7 +279,6 @@ const initWatch = ({
252
279
  api2.setNativeInputValue();
253
280
  api2.resizeTextarea();
254
281
  api2.updateIconOffset();
255
- api2.dispatchDisplayedValue();
256
282
  });
257
283
  }
258
284
  );
@@ -270,17 +296,17 @@ const renderless = (props, { computed, onMounted, onUpdated, reactive, toRefs, w
270
296
  Input: constants.inputMode(mode),
271
297
  InputGroup: constants.inputGroupMode(mode)
272
298
  };
273
- const state = initState({ reactive, computed, mode, props, parent, constants, api: api2 });
274
- initApi({ api: api2, state, dispatch, broadcast, emit, refs, props, CLASS_PREFIX, parent, vm });
299
+ const state = initState({ reactive, computed, mode, props, parent, constants, api: api2, vm });
300
+ initApi({ api: api2, state, dispatch, broadcast, emit, refs, props, CLASS_PREFIX, parent, vm, nextTick });
275
301
  const storages = useStorageBox({ api: api2, props, reactive, toRefs });
276
302
  parent.tinyForm = parent.tinyForm || inject("form", null);
277
- mergeApi({ api: api2, storages, componentName, emit, eventName, props, state, nextTick, parent, refs });
303
+ mergeApi({ api: api2, storages, componentName, emit, eventName, props, state, nextTick, parent, vm });
278
304
  initWatch({ watch, state, api: api2, props, nextTick, emit, componentName, eventName });
279
305
  onMounted(() => {
280
306
  api2.setNativeInputValue();
281
307
  api2.resizeTextarea();
282
308
  api2.updateIconOffset();
283
- api2.dispatchDisplayedValue();
309
+ api2.setInputDomValue();
284
310
  dispatch("Select", "input-mounted", vm.$el);
285
311
  dispatch("Tooltip", "tooltip-update", vm.$el);
286
312
  });
@@ -16,12 +16,13 @@ const ipValidator = ({ props, api }) => (value) => {
16
16
  return result;
17
17
  };
18
18
  const getCursorPosition = (el) => {
19
+ var _a, _b;
19
20
  let cursorPos = 0;
20
21
  let selectRange = null;
21
- if (document.selection) {
22
- selectRange = document.selection.createRange();
23
- selectRange.moveStart("character", -el.value.length);
24
- cursorPos = selectRange.text.length;
22
+ if (document == null ? void 0 : document.selection) {
23
+ selectRange = (_a = document == null ? void 0 : document.selection) == null ? void 0 : _a.createRange();
24
+ selectRange == null ? void 0 : selectRange.moveStart("character", -el.value.length);
25
+ cursorPos = (_b = selectRange == null ? void 0 : selectRange.text) == null ? void 0 : _b.length;
25
26
  }
26
27
  if (el.selectionStart || el.selectionStart === "0") {
27
28
  cursorPos = el.selectionStart;
@@ -51,8 +52,9 @@ const getValue = ({ api, props, state }) => () => {
51
52
  return result;
52
53
  };
53
54
  const setValue = ({ api, props, state }) => (value) => {
55
+ var _a;
54
56
  if (value) {
55
- if (api.ipValidator(value)) {
57
+ if ((_a = api == null ? void 0 : api.ipValidator) == null ? void 0 : _a.call(api, value)) {
56
58
  if (api.isIP6(props.type)) {
57
59
  state.address = value.split(":").map((item) => ({ value: item }));
58
60
  if (state.address.length < 8) {
@@ -76,7 +78,14 @@ const setValue = ({ api, props, state }) => (value) => {
76
78
  state.address = api.isIP6(props.type) ? new Array(8).fill("").map(createValue) : new Array(4).fill("").map(createValue);
77
79
  }
78
80
  };
79
- const activeEvent = ({ emit, parent, state, index, event, type }) => {
81
+ const activeEvent = ({
82
+ emit,
83
+ parent,
84
+ state,
85
+ index,
86
+ event,
87
+ type
88
+ }) => {
80
89
  const target = event && event.target ? event.target : parent.$el.querySelectorAll("input")[index || 0];
81
90
  type === "focus" && (state.active = true);
82
91
  if (!event) {
@@ -92,37 +101,55 @@ const activeEvent = ({ emit, parent, state, index, event, type }) => {
92
101
  !state.isSelected && emit(type, target.value, index);
93
102
  }
94
103
  };
95
- const focus = ({ emit, parent, state }) => ({ index, event }) => {
104
+ const focus = ({
105
+ emit,
106
+ parent,
107
+ state
108
+ }) => ({ index, event }) => {
96
109
  activeEvent({ emit, parent, state, index, event, type: "focus" });
97
110
  };
98
- const select = ({ emit, parent, state }) => ({ index, event }) => {
111
+ const select = ({
112
+ emit,
113
+ parent,
114
+ state
115
+ }) => ({ index, event }) => {
99
116
  activeEvent({ emit, parent, state, index, event, type: "select" });
100
117
  };
101
118
  const inputEvent = ({ api, componentName, emit, eventName, props }) => ({ item, index }) => {
119
+ var _a, _b, _c, _d, _e;
102
120
  const val = item.value.trim();
103
121
  let value = "";
104
122
  if (api.isIP4(props.type)) {
105
- if (!index && api.ipValidator(val)) {
106
- api.setValue(val);
123
+ if (!index && ((_a = api == null ? void 0 : api.ipValidator) == null ? void 0 : _a.call(api, val))) {
124
+ (_b = api == null ? void 0 : api.setValue) == null ? void 0 : _b.call(api, val);
107
125
  } else if (isNaN(val) || val < IPTHRESHOLD.Min || val > IPTHRESHOLD.Max) {
108
126
  item.value = "";
109
127
  }
110
128
  } else {
111
- if (!index && api.ipValidator(val)) {
112
- api.setValue(val);
129
+ if (!index && ((_c = api == null ? void 0 : api.ipValidator) == null ? void 0 : _c.call(api, val))) {
130
+ (_d = api == null ? void 0 : api.setValue) == null ? void 0 : _d.call(api, val);
113
131
  } else if (val.length > 4) {
114
132
  item.value = item.value.slice(0, 4);
115
133
  }
116
134
  }
117
- value = api.getValue();
135
+ value = (_e = api == null ? void 0 : api.getValue) == null ? void 0 : _e.call(api);
118
136
  emit("update:modelValue", value, index);
137
+ emit("input", value, index);
119
138
  api.dispatch(componentName, eventName, [value]);
120
139
  };
121
140
  const change = ({ api, emit }) => () => {
122
- const value = api.getValue();
141
+ var _a;
142
+ const value = (_a = api == null ? void 0 : api.getValue) == null ? void 0 : _a.call(api);
123
143
  emit("change", value);
124
144
  };
125
- const blur = ({ api, componentName, emit, eventName, props, state }) => ({ item, index }) => {
145
+ const blur = ({
146
+ api,
147
+ componentName,
148
+ emit,
149
+ eventName,
150
+ props,
151
+ state
152
+ }) => ({ item, index }) => {
126
153
  state.active = false;
127
154
  state.isDel = false;
128
155
  if (api.isIP4(props.type)) {
@@ -162,20 +189,35 @@ const keyup = ({ api, props }) => ({ item, index, event }) => {
162
189
  }
163
190
  }
164
191
  };
165
- const checkError1 = ({ Tab, Space, NumpadDecimal, NumpadComma, keyCode, value }) => [Tab, Space, NumpadDecimal, NumpadComma].includes(keyCode) && value;
192
+ const checkError1 = ({
193
+ Tab,
194
+ Space,
195
+ NumpadDecimal,
196
+ NumpadComma,
197
+ keyCode,
198
+ value
199
+ }) => [Tab, Space, NumpadDecimal, NumpadComma].includes(keyCode) && value;
166
200
  const checkError2 = (newValue) => newValue && (isNaN(newValue) || newValue > IPTHRESHOLD.Max);
167
201
  const checkError3 = ({ isfilterKeyCodes, isSelected, value }) => !isfilterKeyCodes && !isSelected && value === "0";
168
202
  const checkError4 = ({ isfilterKeyCodes, isSelected, value, key }) => !isfilterKeyCodes && !isSelected && value + key > IPTHRESHOLD.Max;
169
203
  const checkError5 = ({ key, isfilterKeyCodes, value, ctrlKey, keyCode, KeyV }) => isNaN(key) && !isfilterKeyCodes && !(!value && ctrlKey && keyCode === KeyV);
170
- const isError = ({ key, value, isSelected, isfilterKeyCodes, ctrlKey, keyCode, newValue }) => {
204
+ const isError = ({
205
+ key,
206
+ value,
207
+ isSelected,
208
+ isfilterKeyCodes,
209
+ ctrlKey,
210
+ keyCode,
211
+ newValue
212
+ }) => {
171
213
  const { Tab, Space, NumpadDecimal, NumpadComma, KeyV } = KEY_CODE;
172
214
  return checkError1({ Tab, Space, NumpadDecimal, NumpadComma, keyCode, value }) || checkError2(newValue) || checkError3({ isfilterKeyCodes, isSelected, value }) || checkError4({ isfilterKeyCodes, isSelected, value, key }) || checkError5({ key, isfilterKeyCodes, value, ctrlKey, keyCode, KeyV });
173
215
  };
174
216
  const keydown = ({ api, props, state }) => ({ item, index, event }) => {
175
217
  const { target, key, keyCode, ctrlKey } = event;
176
218
  const value = item.value;
177
- const selectionStart = target.selectionStart;
178
- const selectionEnd = target.selectionEnd;
219
+ const selectionStart = target == null ? void 0 : target.selectionStart;
220
+ const selectionEnd = target == null ? void 0 : target.selectionEnd;
179
221
  const isSelected = selectionStart !== selectionEnd;
180
222
  const cursorPosition = api.getCursorPosition(target);
181
223
  const isfilterKeyCodes = state.filterKeyCodes.includes(keyCode);
package/ip-address/vue.js CHANGED
@@ -20,7 +20,13 @@ import {
20
20
  } from "./index";
21
21
  import { KEY_CODE } from "../common";
22
22
  const api = ["state", "focus", "inputEvent", "blur", "keyup", "keydown", "change", "select"];
23
- const initState = ({ reactive, computed, handleValue, parent, props }) => {
23
+ const initState = ({
24
+ reactive,
25
+ computed,
26
+ handleValue,
27
+ parent,
28
+ props
29
+ }) => {
24
30
  const state = reactive(__spreadProps(__spreadValues({}, handleValue.state), {
25
31
  active: false,
26
32
  isSelected: false,
@@ -40,7 +46,18 @@ const initState = ({ reactive, computed, handleValue, parent, props }) => {
40
46
  }));
41
47
  return state;
42
48
  };
43
- const initApi = ({ state, api: api2, dispatch, handleValue, emit, broadcast, parent, componentName, props, eventName }) => {
49
+ const initApi = ({
50
+ state,
51
+ api: api2,
52
+ dispatch,
53
+ handleValue,
54
+ emit,
55
+ broadcast,
56
+ parent,
57
+ componentName,
58
+ props,
59
+ eventName
60
+ }) => {
44
61
  Object.assign(api2, __spreadProps(__spreadValues({}, handleValue.api), {
45
62
  state,
46
63
  dispatch,
@@ -77,8 +94,9 @@ const useHandleValue = ({ componentName, dispatch, eventName, props, reactive, t
77
94
  watch(
78
95
  () => props.modelValue,
79
96
  (value) => {
97
+ var _a;
80
98
  if (!state.isDel) {
81
- api2.setValue(value);
99
+ (_a = api2 == null ? void 0 : api2.setValue) == null ? void 0 : _a.call(api2, value);
82
100
  dispatch(componentName, eventName, [value]);
83
101
  }
84
102
  },
@@ -89,7 +107,7 @@ const useHandleValue = ({ componentName, dispatch, eventName, props, reactive, t
89
107
  api: api2
90
108
  };
91
109
  };
92
- const renderless = (props, { reactive, toRefs, watch, inject, computed }, { $prefix, emit, parent, broadcast, dispatch }) => {
110
+ const renderless = (props, { reactive, toRefs, watch, inject, computed }, { emit, parent, broadcast, dispatch }) => {
93
111
  const api2 = {};
94
112
  const componentName = "FormItem";
95
113
  const eventName = {
package/link/vue.js CHANGED
@@ -1,11 +1,13 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
+ import { xss } from "../common/xss";
2
3
  import { handleClick } from "./index";
3
4
  const api = ["state", "handleClick"];
4
5
  const renderless = (props, { inject, reactive, computed }, { emit, parent }) => {
5
6
  parent.tinyForm = parent.tinyForm || inject("form", null);
6
7
  const state = reactive({
7
8
  formDisabled: computed(() => (parent.tinyForm || {}).disabled),
8
- disabled: computed(() => props.disabled || state.formDisabled)
9
+ disabled: computed(() => props.disabled || state.formDisabled),
10
+ href: computed(() => xss.filterUrl(props.href))
9
11
  });
10
12
  return {
11
13
  state,
package/loading/index.js CHANGED
@@ -12,9 +12,9 @@ const close = ({ state, constants, vm }) => () => {
12
12
  vm,
13
13
  () => {
14
14
  const target = state.fullscreen || state.body ? document.body : state.target;
15
- removeClass(target, constants.PARENT_RELATIVE_CLS);
16
- removeClass(target, constants.PARENT_HIDDEN_CLS);
17
15
  if (vm.$el && vm.$el.parentNode) {
16
+ removeClass(target, constants.PARENT_RELATIVE_CLS);
17
+ removeClass(target, constants.PARENT_HIDDEN_CLS);
18
18
  vm.$el.parentNode.removeChild(vm.$el);
19
19
  }
20
20
  state.closed = true;
package/loading/vue.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
2
  import { handleAfterLeave, setText, close } from "./index";
3
3
  const api = ["state", "handleAfterLeave", "setText", "close"];
4
- const renderless = (props, { reactive }, { constants, vm, emit }) => {
4
+ const renderless = (props, { reactive, computed }, { constants, vm, emit, designConfig }) => {
5
5
  const state = reactive({
6
6
  text: null,
7
7
  spinner: null,
@@ -10,7 +10,13 @@ const renderless = (props, { reactive }, { constants, vm, emit }) => {
10
10
  background: null,
11
11
  fullscreen: true,
12
12
  closed: false,
13
- size: "small"
13
+ size: "",
14
+ iconSize: "",
15
+ loadingImg: computed(() => {
16
+ var _a;
17
+ return props.loadingImg || ((_a = designConfig == null ? void 0 : designConfig.props) == null ? void 0 : _a.loadingImg);
18
+ }),
19
+ iconStyle: computed(() => state.iconSize ? { width: state.iconSize + "px", height: state.iconSize + "px" } : {})
14
20
  });
15
21
  const api2 = {
16
22
  state,
package/logout/index.js CHANGED
@@ -2,7 +2,7 @@ import "../chunk-G2ADBYYC.js";
2
2
  import { xss } from "../common";
3
3
  const logout = ({ service, state, props }) => () => {
4
4
  let { isMock, isLocal, redirectUrl = "", getLogoutUrl, showLogin } = service;
5
- if (typeof props.beforeLogout === "function") {
5
+ if (typeof props.beforeLogout === "function" && !state.logout) {
6
6
  if (props.beforeLogout(redirectUrl) === false) {
7
7
  return;
8
8
  }
package/menu/index.js CHANGED
@@ -1,8 +1,20 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
- import { cloneDeep } from "../chart-core/deps/utils";
2
+ import { xss } from "../common/xss";
3
+ import { deepClone } from "../picker-column";
3
4
  const filterInput = ({ state }) => (val) => {
4
5
  state.filterValue = val;
5
6
  };
7
+ const computeData = ({ props, vm }) => () => filterNodeUrl(props.data || [], vm);
8
+ const filterNodeUrl = (data, vm) => {
9
+ data.forEach((node) => {
10
+ node.url = xss.filterUrl(node.url);
11
+ vm.$set(node, "isCurrent", false);
12
+ if (node.children) {
13
+ filterNodeUrl(node.children, vm);
14
+ }
15
+ });
16
+ return data;
17
+ };
6
18
  const setIsCurrent = ({ props, vm, state }) => (data, node) => {
7
19
  if (props.onlyCheckChildren && node.children)
8
20
  return;
@@ -30,7 +42,7 @@ const getIsCurrent = (vm, node, nodeId) => {
30
42
  };
31
43
  const filterNodes = ({ state, api, nextTick }) => (label) => {
32
44
  if (label !== "") {
33
- state.filterData = filterTree(cloneDeep(state.data), label);
45
+ state.filterData = filterTree(deepClone(state.data), label);
34
46
  } else {
35
47
  state.filterData = [];
36
48
  if (state.activedKeys) {
@@ -117,6 +129,7 @@ const findPaths = (nodes, nodeId) => {
117
129
  }
118
130
  };
119
131
  export {
132
+ computeData,
120
133
  filterInput,
121
134
  filterNodes,
122
135
  getActivedKeysPath,