@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
package/select/vue.js CHANGED
@@ -24,6 +24,7 @@ import {
24
24
  emitChange,
25
25
  directEmitChange,
26
26
  getOption,
27
+ getSelectedOption,
27
28
  setSelected,
28
29
  handleFocus,
29
30
  focus,
@@ -38,6 +39,7 @@ import {
38
39
  resetInputState,
39
40
  resetInputHeight,
40
41
  resetHoverIndex,
42
+ resetDatas,
41
43
  handleOptionSelect,
42
44
  setSoftFocus,
43
45
  getValueIndex,
@@ -50,8 +52,11 @@ import {
50
52
  resetInputWidth,
51
53
  handleResize,
52
54
  checkDefaultFirstOption,
55
+ setOptionHighlight,
53
56
  getValueKey,
54
57
  emptyText,
58
+ emptyFlag,
59
+ recycleScrollerHeight,
55
60
  watchValue,
56
61
  watchVisible,
57
62
  watchOptions,
@@ -65,6 +70,7 @@ import {
65
70
  onCopying,
66
71
  gridOnQueryChange,
67
72
  defaultOnQueryChange,
73
+ queryChange,
68
74
  toVisible,
69
75
  toHide,
70
76
  mounted,
@@ -72,7 +78,6 @@ import {
72
78
  watchHoverIndex,
73
79
  computeOptimizeOpts,
74
80
  watchOptimizeOpts,
75
- getScrollListener,
76
81
  computeCollapseTags,
77
82
  computeMultipleLimit,
78
83
  handleDropdownClick,
@@ -96,13 +101,12 @@ import {
96
101
  watchInitValue,
97
102
  watchShowClose,
98
103
  loadTreeData,
99
- resetFilter,
104
+ getOptionIndexArr,
105
+ queryVisibleOptions,
100
106
  computedGetIcon,
101
107
  computedGetTagType,
102
- computedShowDropdownIcon,
103
- clearNoMatchValue,
104
- debouncedQueryChange,
105
- handleDebouncedQueryChange
108
+ clearSearchText,
109
+ clearNoMatchValue
106
110
  } from "./index";
107
111
  import debounce from "../common/deps/debounce";
108
112
  import { isNumber } from "../common/type";
@@ -132,6 +136,7 @@ const api = [
132
136
  "resetInputHeight",
133
137
  "managePlaceholder",
134
138
  "checkDefaultFirstOption",
139
+ "setOptionHighlight",
135
140
  "toggleLastOptionHitState",
136
141
  "deleteTag",
137
142
  "setSelected",
@@ -162,64 +167,17 @@ const api = [
162
167
  "handleEnterTag",
163
168
  "getLabelSlotValue",
164
169
  "loadTreeData",
165
- "resetFilter",
166
- "computedGetIcon"
170
+ "updateModelValue",
171
+ "clearSearchText"
167
172
  ];
168
- const initStateAdd = ({ computed, props, api: api2, parent }) => ({
169
- selectedTags: [],
170
- tips: "",
171
- showTip: false,
172
- tipHover: false,
173
- selectHover: false,
174
- tipTimer: null,
175
- selectCls: "checked-sur",
176
- overflow: null,
177
- completed: false,
178
- inputWidth: 0,
179
- inputPaddingRight: 0,
180
- hoverIndex: -1,
181
- hoverOption: -1,
182
- inputLength: 20,
183
- optionsCount: 0,
184
- selectFiexd: {},
185
- createdLabel: null,
186
- isSilentBlur: false,
187
- cachedOptions: [],
188
- selectedLabel: "",
189
- previousQuery: null,
190
- inputHovering: false,
191
- createdSelected: false,
192
- isOnComposition: false,
193
- cachedPlaceHolder: props.placeholder,
194
- inputHeight: 0,
195
- initialInputHeight: 28,
196
- currentPlaceholder: props.placeholder,
197
- filteredOptionsCount: 0,
198
- gridData: [],
199
- treeData: [],
200
- remoteData: [],
201
- currentKey: props.modelValue,
202
- updateId: "",
203
- popperElm: null,
204
- debounce: computed(() => isNumber(props.queryDebounce) ? props.queryDebounce : props.remote ? 300 : 0),
205
- emptyText: computed(() => api2.emptyText()),
206
- formItemSize: computed(() => (parent.formItem || {}).formItemSize),
207
- selectDisabled: computed(() => api2.computedSelectDisabled()),
208
- isDisplayOnly: computed(() => props.displayOnly || (parent.form || {}).displayOnly),
209
- gridCheckedData: computed(() => api2.getcheckedData()),
210
- isExpandAll: computed(() => api2.computedIsExpandAll()),
211
- searchSingleCopy: computed(() => props.allowCopy && !props.multiple && props.filterable),
212
- tooltipContent: {},
213
- isHidden: false,
214
- defaultCheckedKeys: [],
215
- filterOrSearch: computed(() => props.filterable || props.searchable)
216
- });
217
- const initState = ({ reactive, computed, props, api: api2, emitter, parent, constants }) => {
173
+ const initState = ({ reactive, computed, props, api: api2, emitter, parent, constants, useBreakpoint, vm, designConfig }) => {
218
174
  const stateAdd = initStateAdd({ computed, props, api: api2, parent });
219
175
  const state = reactive(__spreadProps(__spreadValues({}, stateAdd), {
220
176
  selectEmitter: emitter(),
221
177
  datas: [],
178
+ initDatas: [],
222
179
  query: "",
180
+ magicKey: 0,
223
181
  options: [],
224
182
  visible: false,
225
183
  showCopy: computed(() => api2.computedShowCopy()),
@@ -228,6 +186,7 @@ const initState = ({ reactive, computed, props, api: api2, emitter, parent, cons
228
186
  selected: props.multiple ? [] : {},
229
187
  softFocus: false,
230
188
  hover: false,
189
+ triggerSearch: false,
231
190
  firstAutoSearch: props.remoteConfig.autoSearch,
232
191
  tagsStyle: computed(() => api2.computedTagsStyle()),
233
192
  readonly: computed(() => api2.computedReadonly()),
@@ -238,69 +197,96 @@ const initState = ({ reactive, computed, props, api: api2, emitter, parent, cons
238
197
  showNewOption: computed(() => api2.computedShowNewOption()),
239
198
  selectSize: computed(() => props.size || state.formItemSize),
240
199
  optimizeOpts: computed(() => api2.computeOptimizeOpts()),
241
- optimizeStore: { flag: false, valueIndex: 0, startIndex: 0, viewStyle: "", datas: [] },
200
+ optimizeStore: { valueIndex: 0, recycleScrollerHeight: computed(() => api2.recycleScrollerHeight()) },
242
201
  collapseTags: computed(() => api2.computeCollapseTags()),
243
202
  multipleLimit: computed(() => api2.computeMultipleLimit()),
244
203
  disabledTooltipContent: computed(() => api2.computedDisabledTooltipContent()),
204
+ isExpand: computed(() => (state.selectHover || state.visible) && props.hoverExpand && !props.disabled),
245
205
  collapseTagsLength: 0,
246
206
  initValue: [],
247
207
  key: 0,
248
- isSelectAll: computed(() => state.selectCls === "checked-sur"),
249
- isHalfSelect: computed(() => state.selectCls === "halfselect"),
208
+ device: "",
209
+ timer: null,
210
+ modelValue: [],
211
+ queryValue: "",
212
+ selectedCopy: [],
213
+ compareValue: null,
214
+ selectedVal: computed(
215
+ () => state.device === "mb" && props.multiple && state.visible ? state.selectedCopy : state.selected
216
+ ),
217
+ displayOnlyContent: computed(
218
+ () => props.multiple && Array.isArray(state.selected) ? state.selected.map((item) => item.state ? item.state.currentLabel : item.currentLabel).join("; ") : ""
219
+ ),
220
+ breakpoint: useBreakpoint ? useBreakpoint().current : "",
221
+ isSaaSTheme: vm.theme === "saas",
222
+ disabledOptionHover: false,
223
+ hasClearSelection: false,
224
+ // tiny 新增
250
225
  getIcon: computed(() => api2.computedGetIcon()),
251
226
  getTagType: computed(() => api2.computedGetTagType()),
252
- isShowDropdownIcon: computed(() => api2.computedShowDropdownIcon())
227
+ isSelectAll: computed(() => state.selectCls === "checked-sur"),
228
+ autoHideDownIcon: (() => {
229
+ if ((designConfig == null ? void 0 : designConfig.state) && "autoHideDownIcon" in designConfig.state) {
230
+ return designConfig.state.autoHideDownIcon;
231
+ }
232
+ return true;
233
+ })()
253
234
  }));
254
235
  return state;
255
236
  };
256
- const addApi = ({ api: api2, props, state, emit, constants, parent, nextTick, dispatch, vm, designConfig }) => {
257
- Object.assign(api2, {
258
- resetInputHeight: resetInputHeight({ api: api2, constants, nextTick, props, vm, state, designConfig }),
259
- calcOverFlow: calcOverFlow({ vm, props, state }),
260
- handleFocus: handleFocus({ api: api2, emit, props, state }),
261
- deleteTag: deleteTag({ api: api2, constants, emit, props, vm, nextTick, state }),
262
- watchValue: watchValue({ api: api2, constants, dispatch, props, vm, state }),
263
- toHide: toHide({ constants, state, props, vm, api: api2, nextTick }),
264
- toVisible: toVisible({ constants, state, props, vm, api: api2, nextTick }),
265
- setSelected: setSelected({ api: api2, constants, nextTick, props, vm, state }),
266
- selectOption: selectOption({ api: api2, state, props }),
267
- handleResize: handleResize({ api: api2, props, state }),
268
- watchOptions: watchOptions({ api: api2, constants, nextTick, parent, props, state }),
269
- watchVisible: watchVisible({ api: api2, constants, emit, state, vm, props }),
270
- deletePrevTag: deletePrevTag({ api: api2, constants, props, state, vm }),
271
- onInputChange: onInputChange({ api: api2, props, state, constants, nextTick }),
272
- deleteSelected: deleteSelected({ api: api2, constants, emit, props, vm, state }),
273
- handleMenuEnter: handleMenuEnter({ api: api2, nextTick, state }),
274
- resetInputState: resetInputState({ api: api2, vm, state }),
275
- navigateOptions: navigateOptions({ api: api2, nextTick, state }),
276
- handleClearClick: handleClearClick(api2),
277
- handleComposition: handleComposition({ api: api2, nextTick, state }),
278
- handleQueryChange: handleQueryChange({ api: api2, constants, nextTick, props, vm, state }),
279
- handleOptionSelect: handleOptionSelect({ api: api2, nextTick, props, vm, state }),
280
- getPluginOption: getPluginOption({ api: api2, props, state }),
281
- toggleCheckAll: toggleCheckAll({ api: api2, state }),
282
- handleDebouncedQueryChange: handleDebouncedQueryChange({ state, api: api2 }),
283
- debouncedQueryChange: debouncedQueryChange({ props, api: api2 }),
284
- debouncedOnInputChange: debounce(state.debounce, () => {
285
- api2.onInputChange();
286
- }),
287
- debouncRquest: debouncRquest({ api: api2, state, props }),
288
- defaultOnQueryChange: defaultOnQueryChange({ props, state, constants, api: api2 }),
289
- mounted: mounted({ api: api2, parent, state, props, vm, constants }),
290
- unMount: unMount({ api: api2, parent, vm, state }),
291
- watchOptimizeOpts: watchOptimizeOpts({ api: api2, props, vm, state }),
292
- handleDropdownClick: handleDropdownClick({ emit }),
293
- handleEnterTag: handleEnterTag({ state }),
294
- calcCollapseTags: calcCollapseTags({ state, vm }),
295
- initValue: initValue({ state }),
296
- getLabelSlotValue: getLabelSlotValue({ props, state }),
297
- loadTreeData: loadTreeData({ state, vm, props, api: api2 }),
298
- resetFilter: resetFilter({ state, api: api2 }),
299
- computedGetIcon: computedGetIcon({ constants, designConfig, props }),
300
- computedGetTagType: computedGetTagType({ designConfig, props }),
301
- computedShowDropdownIcon: computedShowDropdownIcon({ props, state }),
302
- clearNoMatchValue: clearNoMatchValue({ props, emit })
303
- });
237
+ const initStateAdd = ({ computed, props, api: api2, parent }) => {
238
+ return {
239
+ selectedTags: [],
240
+ tips: "",
241
+ showTip: false,
242
+ tipHover: false,
243
+ selectHover: false,
244
+ tipTimer: null,
245
+ selectCls: "checked-sur",
246
+ filteredSelectCls: "checked-sur",
247
+ overflow: null,
248
+ completed: false,
249
+ inputWidth: 0,
250
+ inputPaddingRight: 0,
251
+ hoverIndex: -1,
252
+ hoverValue: -1,
253
+ optionsIndex: -1,
254
+ inputLength: 20,
255
+ optionsCount: 0,
256
+ selectFiexd: {},
257
+ createdLabel: null,
258
+ isSilentBlur: false,
259
+ cachedOptions: [],
260
+ selectedLabel: "",
261
+ previousQuery: null,
262
+ inputHovering: false,
263
+ createdSelected: false,
264
+ isOnComposition: false,
265
+ cachedPlaceHolder: props.placeholder,
266
+ inputHeight: 0,
267
+ initialInputHeight: 0,
268
+ currentPlaceholder: props.placeholder,
269
+ filteredOptionsCount: 0,
270
+ gridData: [],
271
+ treeData: [],
272
+ remoteData: [],
273
+ currentKey: props.modelValue,
274
+ updateId: "",
275
+ popperElm: null,
276
+ debounce: computed(() => isNumber(props.queryDebounce) ? props.queryDebounce : props.remote ? 300 : 0),
277
+ emptyText: computed(() => api2.emptyText()),
278
+ emptyFlag: computed(() => api2.emptyFlag()),
279
+ formItemSize: computed(() => (parent.formItem || { state: {} }).state.formItemSize),
280
+ selectDisabled: computed(() => api2.computedSelectDisabled()),
281
+ isDisplayOnly: computed(() => props.displayOnly || (parent.form || {}).displayOnly),
282
+ gridCheckedData: computed(() => api2.getcheckedData()),
283
+ isExpandAll: computed(() => api2.computedIsExpandAll()),
284
+ searchSingleCopy: computed(() => props.allowCopy && !props.multiple && props.filterable),
285
+ tooltipContent: {},
286
+ isHidden: false,
287
+ defaultCheckedKeys: [],
288
+ optionIndexArr: []
289
+ };
304
290
  };
305
291
  const initApi = ({
306
292
  api: api2,
@@ -314,6 +300,7 @@ const initApi = ({
314
300
  dispatch,
315
301
  t,
316
302
  vm,
303
+ isMobileFirstMode,
317
304
  designConfig
318
305
  }) => {
319
306
  Object.assign(api2, {
@@ -327,29 +314,36 @@ const initApi = ({
327
314
  handleClose: handleClose(state),
328
315
  getValueIndex: getValueIndex(props),
329
316
  getChildValue: getChildValue(),
330
- getOption: getOption({ props, state }),
317
+ getOption: getOption({ props, state, api: api2 }),
318
+ getSelectedOption: getSelectedOption({ props, state }),
331
319
  emitChange: emitChange({ emit, props, state, constants }),
332
- directEmitChange: directEmitChange({ emit, props, state }),
333
- toggleMenu: toggleMenu({ vm, state, props }),
320
+ directEmitChange: directEmitChange({ emit, props, state, constants }),
321
+ toggleMenu: toggleMenu({ vm, state, props, api: api2, isMobileFirstMode }),
334
322
  showTip: showTip({ props, state, vm }),
335
323
  onOptionDestroy: onOptionDestroy(state),
336
324
  setSoftFocus: setSoftFocus({ vm, state }),
337
325
  getcheckedData: getcheckedData({ props, state }),
338
326
  resetInputWidth: resetInputWidth({ vm, state }),
339
327
  resetHoverIndex: resetHoverIndex({ props, state }),
328
+ resetDatas: resetDatas({ props, state }),
340
329
  scrollToOption: scrollToOption({ vm, constants }),
341
330
  selectChange: selectChange({ emit, props, vm, state, api: api2 }),
342
- radioChange: radioChange({ emit, props, state, api: api2 }),
331
+ radioChange: radioChange({ emit, props, state, api: api2, vm }),
343
332
  handleCopyClick: handleCopyClick({ parent, props, state }),
344
333
  treeNodeClick: treeNodeClick({ emit, props, state, api: api2, vm }),
345
334
  managePlaceholder: managePlaceholder({ vm, state }),
346
335
  nodeCheckClick: nodeCheckClick({ emit, props, state, api: api2 }),
347
336
  checkDefaultFirstOption: checkDefaultFirstOption(state),
337
+ setOptionHighlight: setOptionHighlight(state),
348
338
  nodeExpand: nodeExpand({ state, constants, nextTick }),
349
339
  nodeCollapse: nodeCollapse({ state, constants, nextTick }),
350
340
  handleBlur: handleBlur({ constants, dispatch, emit, state }),
351
341
  toggleLastOptionHitState: toggleLastOptionHitState({ state }),
352
- emptyText: emptyText({ I18N: constants.I18N, props, state, t }),
342
+ emptyText: emptyText({ I18N: constants.I18N, props, state, t, isMobileFirstMode }),
343
+ emptyFlag: emptyFlag({ props, state }),
344
+ getOptionIndexArr: getOptionIndexArr({ props, state, api: api2 }),
345
+ queryVisibleOptions: queryVisibleOptions({ props, vm, isMobileFirstMode }),
346
+ recycleScrollerHeight: recycleScrollerHeight({ state, props, recycle: constants.RECYCLE }),
353
347
  watchPropsOption: watchPropsOption({ constants, parent, props, state }),
354
348
  buildSelectConfig: buildSelectConfig({ props, state }),
355
349
  buildRadioConfig: buildRadioConfig({ props, state }),
@@ -358,13 +352,12 @@ const initApi = ({
358
352
  onCopying: onCopying({ state, vm }),
359
353
  gridOnQueryChange: gridOnQueryChange({ props, vm, constants, state }),
360
354
  watchHoverIndex: watchHoverIndex({ state }),
361
- computeOptimizeOpts: computeOptimizeOpts({ props, state }),
362
- getScrollListener: getScrollListener({ props, vm, state }),
355
+ computeOptimizeOpts: computeOptimizeOpts({ props, designConfig }),
363
356
  computeCollapseTags: computeCollapseTags(props),
364
357
  computeMultipleLimit: computeMultipleLimit({ props, state }),
365
358
  watchInputHover: watchInputHover({ vm }),
366
359
  initQuery: initQuery({ props, state, constants, vm }),
367
- updateModelValue: updateModelValue({ emit, state }),
360
+ updateModelValue: updateModelValue({ props, emit, state }),
368
361
  computedTagsStyle: computedTagsStyle({ props, parent, state }),
369
362
  computedReadonly: computedReadonly({ props, state }),
370
363
  computedShowClose: computedShowClose({ props, state }),
@@ -376,49 +369,84 @@ const initApi = ({
376
369
  computedSelectDisabled: computedSelectDisabled({ props, parent }),
377
370
  computedIsExpandAll: computedIsExpandAll(props),
378
371
  watchInitValue: watchInitValue({ props, emit }),
379
- watchShowClose: watchShowClose({ nextTick, state, parent })
372
+ watchShowClose: watchShowClose({ nextTick, state, parent }),
373
+ // tiny 新增
374
+ computedGetIcon: computedGetIcon({ designConfig, props }),
375
+ computedGetTagType: computedGetTagType({ designConfig, props }),
376
+ clearSearchText: clearSearchText({ state, api: api2 }),
377
+ clearNoMatchValue: clearNoMatchValue({ props, emit })
380
378
  });
381
- addApi({ api: api2, props, state, emit, constants, parent, nextTick, dispatch, vm, designConfig });
379
+ addApi({ api: api2, props, state, emit, constants, parent, nextTick, dispatch, vm, isMobileFirstMode, designConfig });
382
380
  };
383
- const addWatch = ({ watch, props, api: api2, state, nextTick }) => {
384
- watch(() => [...state.options], api2.watchOptions);
385
- if (props.renderType === "grid") {
386
- watch(() => state.gridData, api2.setSelected, { immediate: true });
387
- }
388
- if (props.renderType === "tree") {
389
- watch(() => state.treeData, api2.setSelected, { immediate: true });
390
- }
391
- watch(() => state.hoverIndex, api2.watchHoverIndex);
392
- if (props.options) {
393
- watch(() => props.options, api2.watchPropsOption, { immediate: true, deep: true });
394
- }
395
- watch(() => state.optimizeOpts, api2.watchOptimizeOpts);
396
- watch([() => state.inputHovering, () => state.visible], api2.watchInputHover);
397
- watch(() => state.showClose, api2.watchShowClose, { immediate: true });
398
- watch(
399
- () => state.selectHover,
400
- () => props.hoverExpand && !props.disabled && !state.isDisplayOnly && nextTick(api2.resetInputHeight)
401
- );
381
+ const addApi = ({
382
+ api: api2,
383
+ props,
384
+ state,
385
+ emit,
386
+ constants,
387
+ parent,
388
+ nextTick,
389
+ dispatch,
390
+ vm,
391
+ isMobileFirstMode,
392
+ designConfig
393
+ }) => {
394
+ Object.assign(api2, {
395
+ resetInputHeight: resetInputHeight({ api: api2, constants, nextTick, props, vm, state, designConfig }),
396
+ calcOverFlow: calcOverFlow({ vm, props, state }),
397
+ handleFocus: handleFocus({ api: api2, emit, props, state }),
398
+ deleteTag: deleteTag({ api: api2, constants, emit, props, vm, nextTick, state }),
399
+ watchValue: watchValue({ api: api2, constants, dispatch, props, vm, state }),
400
+ toHide: toHide({ constants, state, props, vm, api: api2 }),
401
+ toVisible: toVisible({ constants, state, props, vm, api: api2, nextTick }),
402
+ setSelected: setSelected({ api: api2, constants, nextTick, props, vm, state }),
403
+ selectOption: selectOption({ api: api2, state, props }),
404
+ handleResize: handleResize({ api: api2, props, state }),
405
+ watchOptions: watchOptions({ api: api2, constants, nextTick, parent, props, state, vm }),
406
+ watchVisible: watchVisible({ api: api2, constants, emit, state, vm, props, isMobileFirstMode }),
407
+ deletePrevTag: deletePrevTag({ api: api2, constants, props, state, vm }),
408
+ onInputChange: onInputChange({ api: api2, props, state, constants, nextTick }),
409
+ deleteSelected: deleteSelected({ api: api2, constants, emit, props, vm, state }),
410
+ handleMenuEnter: handleMenuEnter({ api: api2, nextTick, state, props }),
411
+ resetInputState: resetInputState({ api: api2, vm, state }),
412
+ navigateOptions: navigateOptions({ api: api2, state, props, nextTick }),
413
+ handleClearClick: handleClearClick(api2),
414
+ handleComposition: handleComposition({ api: api2, nextTick, state }),
415
+ handleQueryChange: handleQueryChange({ api: api2, constants, nextTick, props, vm, state }),
416
+ handleOptionSelect: handleOptionSelect({ api: api2, nextTick, props, vm, state }),
417
+ getPluginOption: getPluginOption({ api: api2, props, state }),
418
+ toggleCheckAll: toggleCheckAll({ api: api2, emit, state, props }),
419
+ debouncedQueryChange: debounce(state.debounce, (event) => {
420
+ api2.handleQueryChange(props.shape ? event : event.target.value, false, true);
421
+ }),
422
+ debouncedOnInputChange: debounce(state.debounce, () => {
423
+ api2.onInputChange();
424
+ }),
425
+ debouncRquest: debouncRquest({ api: api2, state, props }),
426
+ defaultOnQueryChange: defaultOnQueryChange({ props, state, constants, api: api2, nextTick, vm }),
427
+ queryChange: queryChange({ props, state, constants, api: api2, nextTick, vm }),
428
+ mounted: mounted({ api: api2, parent, state, props, vm, designConfig }),
429
+ unMount: unMount({ api: api2, parent, vm, state }),
430
+ watchOptimizeOpts: watchOptimizeOpts({ props, state }),
431
+ handleDropdownClick: handleDropdownClick({ props, vm, state, emit }),
432
+ handleEnterTag: handleEnterTag({ state }),
433
+ calcCollapseTags: calcCollapseTags({ state, vm }),
434
+ initValue: initValue({ state }),
435
+ getLabelSlotValue: getLabelSlotValue({ props, state }),
436
+ loadTreeData: loadTreeData({ state, vm, props, api: api2 })
437
+ });
402
438
  };
403
439
  const initWatch = ({ watch, props, api: api2, state, nextTick }) => {
404
- if (props.renderType === "tree" && props.treeOp.data) {
405
- watch(
406
- () => props.treeOp.data,
407
- (data) => {
408
- data && (state.treeData = data);
409
- },
410
- { immediate: true, deep: true }
411
- );
412
- }
413
- if (props.renderType === "grid" && props.gridOp.data) {
414
- watch(
415
- () => props.gridOp.data,
416
- (data) => {
417
- data && (state.gridData = data);
418
- },
419
- { immediate: true, deep: true }
420
- );
421
- }
440
+ watch(
441
+ () => props.treeOp.data,
442
+ (data) => data && (state.treeData = data),
443
+ { immediate: true, deep: true }
444
+ );
445
+ watch(
446
+ () => props.gridOp.data,
447
+ (data) => data && (state.gridData = data),
448
+ { immediate: true, deep: true }
449
+ );
422
450
  watch(
423
451
  () => state.selectDisabled,
424
452
  () => nextTick(api2.resetInputHeight)
@@ -429,26 +457,105 @@ const initWatch = ({ watch, props, api: api2, state, nextTick }) => {
429
457
  state.cachedPlaceHolder = state.currentPlaceholder = value;
430
458
  }
431
459
  );
432
- watch(() => props.modelValue, api2.watchValue);
460
+ watch(
461
+ () => props.modelValue,
462
+ () => {
463
+ if (props.multiple && Array.isArray(props.modelValue)) {
464
+ state.modelValue = [...props.modelValue];
465
+ } else {
466
+ state.modelValue = props.modelValue;
467
+ }
468
+ },
469
+ { immediate: true, deep: true }
470
+ );
471
+ watch(() => state.modelValue, api2.watchValue);
472
+ watch(
473
+ () => state.selectedLabel,
474
+ () => {
475
+ if (props.trim) {
476
+ state.selectedLabel = state.selectedLabel.trim();
477
+ }
478
+ }
479
+ );
433
480
  watch(
434
481
  () => props.extraQueryParams,
435
482
  () => api2.handleQueryChange(state.previousQuery, true),
436
483
  { deep: true }
437
484
  );
485
+ watch(
486
+ () => state.breakpoint,
487
+ (val) => {
488
+ if (val === "default") {
489
+ state.device = "mb";
490
+ } else {
491
+ state.device = "pc";
492
+ }
493
+ },
494
+ { immediate: true, deep: true }
495
+ );
496
+ watch(
497
+ () => state.device,
498
+ (newVal, oldVal) => {
499
+ if (oldVal !== "" && state.visible) {
500
+ api2.updateModelValue(state.modelValue, true);
501
+ }
502
+ }
503
+ );
438
504
  watch(() => state.visible, api2.watchVisible);
439
505
  watch(() => state.initValue, api2.watchInitValue, { deep: true });
440
506
  addWatch({ watch, props, api: api2, state, nextTick });
441
507
  };
442
- const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, watch, provide }, { vm, parent, emit, constants, nextTick, dispatch, t, emitter, designConfig }) => {
508
+ const addWatch = ({ watch, props, api: api2, state, nextTick }) => {
509
+ watch(() => [...state.options], api2.watchOptions);
510
+ if (props.renderType === "grid" && !props.optimization) {
511
+ watch(() => state.gridData, api2.setSelected, { immediate: true });
512
+ }
513
+ if (props.renderType === "tree" && !props.optimization) {
514
+ watch(() => state.treeData, api2.setSelected, { immediate: true });
515
+ }
516
+ watch(() => state.hoverIndex, api2.watchHoverIndex);
517
+ props.options && watch(() => props.options, api2.watchPropsOption, { immediate: true, deep: true });
518
+ props.optimization && watch(() => state.optimizeOpts, api2.watchOptimizeOpts, { immediate: true });
519
+ watch([() => state.inputHovering, () => state.visible], api2.watchInputHover);
520
+ watch(() => state.showClose, api2.watchShowClose, { immediate: true });
521
+ watch(
522
+ () => state.selectHover,
523
+ () => props.hoverExpand && !props.disabled && !state.isDisplayOnly && nextTick(api2.resetInputHeight)
524
+ );
525
+ };
526
+ const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, watch, provide, inject }, { vm, parent, emit, constants, nextTick, dispatch, t, emitter, isMobileFirstMode, useBreakpoint, designConfig }) => {
443
527
  const api2 = {};
444
- const state = initState({ reactive, computed, props, api: api2, emitter, parent, constants, designConfig });
528
+ const state = initState({
529
+ reactive,
530
+ computed,
531
+ props,
532
+ api: api2,
533
+ emitter,
534
+ parent,
535
+ constants,
536
+ useBreakpoint,
537
+ vm,
538
+ designConfig
539
+ });
540
+ const dialog = inject("dialog", null);
445
541
  provide("selectEmitter", state.selectEmitter);
446
542
  provide("selectVm", vm);
447
543
  const maskState = reactive({ width: "", height: "", top: "" });
448
- initApi({ api: api2, props, state, emit, maskState, constants, parent, nextTick, dispatch, t, vm, designConfig });
449
- initWatch({ watch, props, api: api2, state, nextTick });
450
- onMounted(api2.mounted);
451
- onBeforeUnmount(api2.unMount);
544
+ initApi({
545
+ api: api2,
546
+ props,
547
+ state,
548
+ emit,
549
+ maskState,
550
+ constants,
551
+ parent,
552
+ nextTick,
553
+ dispatch,
554
+ t,
555
+ vm,
556
+ isMobileFirstMode,
557
+ designConfig
558
+ });
452
559
  parent.$on("handle-clear", (event) => {
453
560
  api2.handleClearClick(event);
454
561
  });
@@ -458,9 +565,16 @@ const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, wat
458
565
  if (!props.multiple && Array.isArray(props.modelValue)) {
459
566
  emit("update:modelValue", "");
460
567
  }
568
+ dialog && dialog.state.emitter.on("handleSelectClose", api2.handleClose);
461
569
  state.selectEmitter.on(constants.EVENT_NAME.handleOptionClick, api2.handleOptionSelect);
462
570
  state.selectEmitter.on(constants.EVENT_NAME.setSelected, api2.setSelected);
463
571
  state.selectEmitter.on(constants.EVENT_NAME.initValue, api2.initValue);
572
+ initWatch({ watch, props, api: api2, state, nextTick });
573
+ onMounted(api2.mounted);
574
+ onBeforeUnmount(() => {
575
+ api2.unMount();
576
+ dialog && dialog.state.emitter.off("handleSelectClose", api2.handleClose);
577
+ });
464
578
  return api2;
465
579
  };
466
580
  export {