@opentiny/vue-renderless 3.19.5 → 3.20.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 (77) hide show
  1. package/base-select/index.js +11 -74
  2. package/base-select/vue.js +10 -10
  3. package/bulletin-board/index.js +5 -1
  4. package/bulletin-board/vue.js +5 -4
  5. package/button/index.js +11 -3
  6. package/button/vue.js +6 -2
  7. package/button-group/index.js +1 -1
  8. package/color-picker/index.js +4 -4
  9. package/color-picker/utils/color.js +358 -83
  10. package/color-picker/utils/hsv-to-rgb.js +59 -0
  11. package/color-picker/vue.js +27 -8
  12. package/color-select-panel/alpha-select/index.js +65 -14
  13. package/color-select-panel/alpha-select/vue.js +29 -44
  14. package/color-select-panel/hue-select/index.js +47 -61
  15. package/color-select-panel/hue-select/vue.js +29 -47
  16. package/color-select-panel/index.js +230 -80
  17. package/color-select-panel/sv-select/index.js +68 -0
  18. package/color-select-panel/sv-select/vue.js +32 -0
  19. package/color-select-panel/utils/color.js +345 -82
  20. package/color-select-panel/utils/getClientXY.js +54 -0
  21. package/color-select-panel/vue.js +47 -72
  22. package/common/deps/popper.js +1 -1
  23. package/common/deps/useUserAgent.js +16 -0
  24. package/common/event.js +21 -0
  25. package/common/index.js +1 -1
  26. package/common/runtime.js +1 -1
  27. package/date-picker-mobile/index.js +4 -4
  28. package/dialog-box/index.js +1 -1
  29. package/dropdown/index.js +5 -1
  30. package/dropdown/vue.js +2 -2
  31. package/file-upload/vue.js +1 -0
  32. package/flowchart/index.js +3 -2
  33. package/form/index.js +2 -2
  34. package/form-item/index.js +4 -1
  35. package/grid-select/index.js +82 -0
  36. package/grid-select/vue.js +30 -0
  37. package/input/index.js +2 -2
  38. package/menu/vue.js +5 -1
  39. package/modal/index.js +2 -0
  40. package/numeric/index.js +29 -9
  41. package/option/index.js +6 -0
  42. package/option/vue.js +12 -2
  43. package/package.json +1 -1
  44. package/picker/index.js +1 -1
  45. package/recycle-scroller/index.js +43 -27
  46. package/recycle-scroller/vue.js +9 -4
  47. package/rich-text/index.js +13 -0
  48. package/rich-text/vue.js +4 -2
  49. package/select/index.js +71 -23
  50. package/select/vue.js +12 -4
  51. package/select-dropdown/vue.js +1 -1
  52. package/tabbar/index.js +4 -1
  53. package/tabbar/vue.js +1 -1
  54. package/tabs/index.js +8 -5
  55. package/tabs/vue.js +4 -1
  56. package/time-panel/vue.js +1 -1
  57. package/tooltip/vue.js +1 -0
  58. package/tree-menu/index.js +5 -1
  59. package/tree-node/index.js +5 -4
  60. package/tree-select/index.js +77 -1
  61. package/tree-select/vue.js +21 -7
  62. package/types/button.type.d.ts +7 -3
  63. package/types/color-select-panel.type.d.ts +23 -1
  64. package/types/file-upload.type.d.ts +1 -1
  65. package/types/input.type.d.ts +1 -1
  66. package/types/numeric.type.d.ts +5 -5
  67. package/types/popover.type.d.ts +1 -1
  68. package/types/transfer.type.d.ts +3 -3
  69. package/types/tree-menu.type.d.ts +1 -1
  70. package/types/upload-dragger.type.d.ts +1 -1
  71. package/types/{upload-list.type-26173587.d.ts → upload-list.type-6189e4c9.d.ts} +7 -3
  72. package/types/upload-list.type.d.ts +1 -1
  73. package/types/upload.type.d.ts +1 -1
  74. package/types/user-head.type.d.ts +4 -0
  75. package/user-head/index.js +1 -1
  76. package/year-table/index.js +14 -29
  77. package/year-table/vue.js +17 -5
@@ -17,7 +17,9 @@ import {
17
17
  scrollToPosition,
18
18
  scrollToItem,
19
19
  computeViewStyle,
20
- computeViewEvent
20
+ computeViewEvent,
21
+ resetTemporary,
22
+ init
21
23
  } from "./index";
22
24
  import { addResizeListener, removeResizeListener } from "../common/deps/resize-event";
23
25
  const api = [
@@ -27,12 +29,13 @@ const api = [
27
29
  "scrollToItem",
28
30
  "computeViewStyle",
29
31
  "computeViewEvent",
30
- "updateVisibleItems"
32
+ "updateVisibleItems",
33
+ "resetTemporary"
31
34
  ];
32
35
  const addWatchers = ({ watch, props, api: api2, state }) => {
33
36
  watch(
34
37
  () => props.items,
35
- () => api2.updateVisibleItems(true)
38
+ () => api2.init()
36
39
  );
37
40
  watch(
38
41
  () => props.pageMode,
@@ -91,7 +94,9 @@ const renderless = (props, { reactive, computed, onBeforeUnmount, onMounted, onA
91
94
  applyPageMode: applyPageMode({ api: api2, props }),
92
95
  addListeners: addListeners({ api: api2, state }),
93
96
  removeListeners: removeListeners({ api: api2, state }),
94
- scrollToItem: scrollToItem({ api: api2, props, state })
97
+ scrollToItem: scrollToItem({ api: api2, props, state }),
98
+ resetTemporary: resetTemporary({ state }),
99
+ init: init({ api: api2 })
95
100
  });
96
101
  state.temporary = {
97
102
  startIndex: 0,
@@ -54,6 +54,7 @@ const initQuill = ({ api, emit, props, vm, service, state, Quill, ImageDrop, Ima
54
54
  state.quill.enable(false);
55
55
  state.quill.on("selection-change", api.selectionChange);
56
56
  state.quill.on("text-change", api.textChange);
57
+ state.quill.root.addEventListener("click", api.handleClick);
57
58
  if (state.content) {
58
59
  state.quill.pasteHTML(xss.filterHtml(state.content));
59
60
  api.textChange();
@@ -64,6 +65,16 @@ const initQuill = ({ api, emit, props, vm, service, state, Quill, ImageDrop, Ima
64
65
  emit("ready", state.quill);
65
66
  api.setToolbarTips();
66
67
  };
68
+ const handleClick = ({ state, Quill }) => (event) => {
69
+ const el = event.target;
70
+ if (!(el instanceof HTMLElement) || el.tagName !== "IMG") {
71
+ return;
72
+ }
73
+ event.stopPropagation();
74
+ const imgBlot = Quill.find(el);
75
+ const index = state.quill.getIndex(imgBlot);
76
+ state.quill.setSelection(index + 1);
77
+ };
67
78
  const setToolbarTips = ({ t, vm }) => () => {
68
79
  let tip;
69
80
  const item = getToolbarTips(t);
@@ -173,12 +184,14 @@ const mounted = ({ api, props, state, i18n, watch }) => () => {
173
184
  const beforeUnmount = ({ api, state }) => () => {
174
185
  state.quill.off("selection-change", api.selectionChange);
175
186
  state.quill.off("text-change", api.textChange);
187
+ state.quill.root.removeEventListener("click", api.handleClick);
176
188
  state.quill = null;
177
189
  delete state.quill;
178
190
  };
179
191
  export {
180
192
  beforeUnmount,
181
193
  getFileUploadUrl,
194
+ handleClick,
182
195
  handlePaste,
183
196
  initContent,
184
197
  initQuill,
package/rich-text/vue.js CHANGED
@@ -11,7 +11,8 @@ import {
11
11
  beforeUnmount,
12
12
  maxLength,
13
13
  handlePaste,
14
- isDisplayOnly
14
+ isDisplayOnly,
15
+ handleClick
15
16
  } from "./index";
16
17
  const api = [
17
18
  "state",
@@ -51,7 +52,8 @@ const initApi = (args) => {
51
52
  beforeUnmount: beforeUnmount({ api: api2, state }),
52
53
  maxLength: maxLength({ props, constants }),
53
54
  handlePaste: handlePaste({ state }),
54
- isDisplayOnly: isDisplayOnly({ state, props, parent, nextTick })
55
+ isDisplayOnly: isDisplayOnly({ state, props, parent, nextTick }),
56
+ handleClick: handleClick({ state, Quill })
55
57
  });
56
58
  };
57
59
  const initWatch = ({ watch, props, api: api2, state }) => {
package/select/index.js CHANGED
@@ -19,6 +19,7 @@ import { isNull } from "../common/type";
19
19
  import { fastdom } from "../common/deps/fastdom";
20
20
  import { deepClone } from "../picker-column";
21
21
  import { escapeRegexpString } from "../option";
22
+ import { correctTarget } from "../common/event";
22
23
  const handleComposition = ({ api, nextTick, state }) => (event) => {
23
24
  const text = event.target.value;
24
25
  if (event.type === "compositionend") {
@@ -94,11 +95,12 @@ const defaultOnQueryChange = ({ props, state, constants, api, nextTick }) => (va
94
95
  }
95
96
  setFilteredSelectCls(nextTick, state, props);
96
97
  api.getOptionIndexArr();
97
- state.magicKey = state.magicKey > 0 ? -1 : 1;
98
98
  };
99
99
  const queryChange = ({ props, state, constants }) => (value, isInput) => {
100
100
  if (props.optimization && isInput) {
101
- const filterDatas = state.initDatas.filter((item) => new RegExp(escapeRegexpString(value), "i").test(item.label));
101
+ const filterDatas = state.initDatas.filter(
102
+ (item) => new RegExp(escapeRegexpString(value), "i").test(item[props.textField])
103
+ );
102
104
  state.datas = filterDatas;
103
105
  } else {
104
106
  state.selectEmitter.emit(constants.EVENT_NAME.queryChange, value);
@@ -146,7 +148,7 @@ const handleQueryChange = ({ api, constants, nextTick, props, vm, state }) => (v
146
148
  }
147
149
  });
148
150
  state.hoverIndex = -1;
149
- if (props.multiple && (props.filterable || props.searchable) && !props.shape) {
151
+ if (props.multiple && (props.filterable || props.searchable) && !props.shape && !state.selectDisabled) {
150
152
  nextTick(() => {
151
153
  if (!vm.$refs.input) {
152
154
  return;
@@ -241,15 +243,15 @@ const getOption = ({ props, state, api }) => (value) => {
241
243
  if (props.optimization) {
242
244
  option = api.getSelectedOption(value);
243
245
  if (option) {
244
- return { value: option.value, currentLabel: option.label || option.currentLabel };
246
+ return { value: option.value, currentLabel: option[props.textField] || option.currentLabel };
245
247
  }
246
- option = state.datas.find((v) => getObj(v, props.valueKey) === value);
248
+ option = state.datas.find((v) => getObj(v, props.valueField) === value);
247
249
  if (option) {
248
- return { value: option.value, currentLabel: option.label || option.currentLabel };
250
+ return { value: option[props.valueField], currentLabel: option[props.textField] || option.currentLabel };
249
251
  }
250
252
  }
251
253
  const label = !isObject && !isNull2 && !isUndefined && !props.clearNoMatchValue ? value : "";
252
- let newOption = { value, currentLabel: label };
254
+ let newOption = { value, currentLabel: label, isFakeLabel: true };
253
255
  if (props.multiple) {
254
256
  newOption.hitState = false;
255
257
  }
@@ -258,9 +260,9 @@ const getOption = ({ props, state, api }) => (value) => {
258
260
  const getSelectedOption = ({ props, state }) => (value) => {
259
261
  let option;
260
262
  if (props.multiple) {
261
- option = state.selected.find((v) => getObj(v, props.valueKey) === value);
263
+ option = state.selected.find((v) => getObj(v, props.valueField) === value && !v.isFakeLabel);
262
264
  } else {
263
- if (!isEmptyObject(state.selected) && getObj(state.selected, props.valueKey) === value) {
265
+ if (!isEmptyObject(state.selected) && getObj(state.selected, props.valueField) === value && !state.selected.isFakeLabel) {
264
266
  option = state.selected;
265
267
  }
266
268
  }
@@ -328,6 +330,8 @@ const setGridOrTreeSelected = ({ props, state, vm, isTree, api, init }) => {
328
330
  state.selectedLabel = label;
329
331
  state.selected = obj;
330
332
  state.currentKey = data[props.valueField];
333
+ vm.$refs.selectTree && vm.$refs.selectTree.setCurrentKey && vm.$refs.selectTree.setCurrentKey(state.currentKey);
334
+ props.treeOp.showRadio && (state.defaultCheckedKeys = [state.currentKey]);
331
335
  };
332
336
  const setSelected = ({ api, constants, nextTick, props, vm, state }) => (init) => {
333
337
  const isTree = props.renderType === constants.TYPE.Tree;
@@ -417,8 +421,19 @@ const blur = ({ vm, state }) => () => {
417
421
  const handleBlur = ({ constants, dispatch, emit, state, designConfig }) => (event) => {
418
422
  var _a;
419
423
  clearTimeout(state.timer);
424
+ const target = event.target;
420
425
  state.timer = setTimeout(() => {
421
426
  var _a2;
427
+ correctTarget(event, target);
428
+ if (event.target !== target) {
429
+ Object.defineProperty(event, "target", {
430
+ get() {
431
+ return target;
432
+ },
433
+ enumerable: true,
434
+ configurable: true
435
+ });
436
+ }
422
437
  if (state.isSilentBlur) {
423
438
  state.isSilentBlur = false;
424
439
  } else {
@@ -508,7 +523,6 @@ const resetInputHeight = ({ constants, nextTick, props, vm, state, api, designCo
508
523
  if (!state.isDisplayOnly && (props.hoverExpand || props.clickExpand) && !props.disabled) {
509
524
  api.calcCollapseTags();
510
525
  }
511
- const sizeInMap = (designConfig == null ? void 0 : designConfig.state.initialInputHeight) || Math.round(state.initialInputHeight) || 32;
512
526
  const noSelected = state.selected.length === 0;
513
527
  const spacingHeight = (_b = (_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.spacingHeight) != null ? _b : constants.SPACING_HEIGHT;
514
528
  if (!state.isDisplayOnly) {
@@ -516,11 +530,11 @@ const resetInputHeight = ({ constants, nextTick, props, vm, state, api, designCo
516
530
  fastdom.measure(() => {
517
531
  const tagsClientHeight = tags.clientHeight;
518
532
  fastdom.mutate(() => {
519
- input.style.height = Math.max(tagsClientHeight + spacingHeight, sizeInMap) + "px";
533
+ input.style.height = Math.max(tagsClientHeight + spacingHeight, state.currentSizeMap) + "px";
520
534
  });
521
535
  });
522
536
  } else {
523
- input.style.height = noSelected ? sizeInMap + "px" : Math.max(0, sizeInMap) + "px";
537
+ input.style.height = noSelected ? state.currentSizeMap + "px" : Math.max(0, state.currentSizeMap) + "px";
524
538
  }
525
539
  } else {
526
540
  input.style.height = "auto";
@@ -632,14 +646,23 @@ const getValueIndex = (props) => (arr = [], value = null) => {
632
646
  return index;
633
647
  }
634
648
  };
635
- const toggleMenu = ({ vm, state, props, api }) => (e) => {
649
+ const toggleMenu = ({ vm, state, props, api, designConfig }) => (e) => {
650
+ var _a, _b, _c;
636
651
  if (props.keepFocus && state.visible && (props.filterable || props.searchable)) {
637
652
  return;
638
653
  }
654
+ if (state.isIOS) {
655
+ state.selectHover = true;
656
+ state.inputHovering = true;
657
+ }
639
658
  const event = e || window.event;
640
659
  const enterCode = 13;
641
660
  const nodeName = event.target && event.target.nodeName;
642
661
  const toggleVisible = props.ignoreEnter ? event.keyCode !== enterCode && nodeName === "INPUT" : true;
662
+ const isStop = (_c = (_b = props.stopPropagation) != null ? _b : (_a = designConfig == null ? void 0 : designConfig.props) == null ? void 0 : _a.stopPropagation) != null ? _c : false;
663
+ if (!props.displayOnly && isStop) {
664
+ event.stopPropagation();
665
+ }
643
666
  if (!state.selectDisabled) {
644
667
  toggleVisible && !state.softFocus && (state.visible = !state.visible);
645
668
  state.softFocus = false;
@@ -654,6 +677,7 @@ const toggleMenu = ({ vm, state, props, api }) => (e) => {
654
677
  };
655
678
  const selectOption = ({ api, state, props }) => (e) => {
656
679
  if (!state.visible || props.hideDrop) {
680
+ state.softFocus = false;
657
681
  api.toggleMenu(e);
658
682
  } else {
659
683
  let option = "";
@@ -915,7 +939,10 @@ const watchValue = ({ api, constants, dispatch, props, vm, state }) => (value, o
915
939
  state.currentPlaceholder = state.cachedPlaceHolder;
916
940
  }
917
941
  if ((props.filterable || props.searchable) && !props.reserveKeyword) {
918
- props.renderType !== constants.TYPE.Grid && !props.searchable && (state.query = "");
942
+ const isChange = false;
943
+ const isInput = true;
944
+ state.query = "";
945
+ api.handleQueryChange(state.query, isChange, isInput);
919
946
  }
920
947
  }
921
948
  api.setSelected();
@@ -1139,7 +1166,7 @@ const handleCopyClick = ({ parent, props, state }) => () => {
1139
1166
  document.execCommand("copy");
1140
1167
  parent.$el.removeChild(input);
1141
1168
  };
1142
- const selectChange = ({ props, state, api }) => ({ $table, selection, checked, row }) => {
1169
+ const selectChange = ({ props, state, api, vm }) => ({ $table, selection, checked, row }) => {
1143
1170
  const { textField, valueField } = props;
1144
1171
  const remoteItem = (row2) => {
1145
1172
  const removeItem = find(state.selected, (item) => item[valueField] === row2[valueField]);
@@ -1152,6 +1179,9 @@ const selectChange = ({ props, state, api }) => ({ $table, selection, checked, r
1152
1179
  selection.filter((row2) => !~state.modelValue.indexOf(row2[valueField]))
1153
1180
  ) : $table.tableFullData.forEach((row2) => remoteItem(row2));
1154
1181
  }
1182
+ if (props.filterable && props.multiple) {
1183
+ vm.$refs.input.focus();
1184
+ }
1155
1185
  const keys = state.selected.map((item) => item[valueField]);
1156
1186
  api.updateModelValue(keys);
1157
1187
  api.directEmitChange(keys, state.selected);
@@ -1299,11 +1329,19 @@ const buildRadioConfig = ({ props, state }) => () => {
1299
1329
  return Object.assign({}, radioConfig, { checkRowKey, highlight });
1300
1330
  };
1301
1331
  const onMouseenterNative = ({ state }) => () => {
1302
- state.inputHovering = true;
1332
+ if (!state.isIOS) {
1333
+ state.inputHovering = true;
1334
+ }
1303
1335
  if (state.searchSingleCopy && state.selectedLabel) {
1304
1336
  state.softFocus = true;
1305
1337
  }
1306
1338
  };
1339
+ const onMouseenterSelf = ({ state }) => () => {
1340
+ if (!state.isIOS) {
1341
+ state.selectHover = true;
1342
+ state.inputHovering = true;
1343
+ }
1344
+ };
1307
1345
  const onMouseleaveNative = ({ state }) => (e) => {
1308
1346
  if (e.target === e.currentTarget)
1309
1347
  return;
@@ -1421,9 +1459,14 @@ const initQuery = ({ props, state, constants, vm }) => ({ init } = {}) => {
1421
1459
  }
1422
1460
  return Promise.resolve(selected);
1423
1461
  };
1424
- const mounted = ({ api, parent, state, props, vm, designConfig }) => () => {
1462
+ const computedCurrentSizeMap = ({ state, designConfig }) => () => {
1425
1463
  var _a;
1426
- state.defaultCheckedKeys = state.gridCheckedData;
1464
+ const defaultSizeMap = { default: 32, mini: 24, small: 28, medium: 40 };
1465
+ const sizeMap = ((_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.sizeMap) || defaultSizeMap;
1466
+ return sizeMap[state.selectSize || "default"];
1467
+ };
1468
+ const mounted = ({ api, parent, state, props, vm, designConfig }) => () => {
1469
+ state.defaultCheckedKeys = props.multiple ? state.gridCheckedData : props.treeOp.defaultCheckedKeys || [];
1427
1470
  const parentEl = parent.$el;
1428
1471
  const inputEl = parentEl.querySelector('input[data-tag="tiny-input-inner"]');
1429
1472
  const inputClientRect = inputEl && inputEl.getBoundingClientRect() || {};
@@ -1431,12 +1474,9 @@ const mounted = ({ api, parent, state, props, vm, designConfig }) => () => {
1431
1474
  document.activeElement.blur();
1432
1475
  }
1433
1476
  state.completed = true;
1434
- const defaultSizeMap = { default: 32, mini: 24, small: 36, medium: 40 };
1435
- const sizeMap = ((_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.sizeMap) || defaultSizeMap;
1436
1477
  if (props.multiple && Array.isArray(props.modelValue) && props.modelValue.length > 0) {
1437
1478
  state.currentPlaceholder = "";
1438
1479
  }
1439
- state.initialInputHeight = state.isDisplayOnly ? sizeMap[state.selectSize || "default"] : inputClientRect.height || sizeMap[state.selectSize];
1440
1480
  addResizeListener(parentEl, api.handleResize);
1441
1481
  if (vm.$refs.tags) {
1442
1482
  addResizeListener(vm.$refs.tags, api.resetInputHeight);
@@ -1569,7 +1609,13 @@ const computedTagsStyle = ({ props, parent, state, vm }) => () => {
1569
1609
  }
1570
1610
  return tagsStyle;
1571
1611
  };
1572
- const computedReadonly = ({ props, state }) => () => state.device === "mb" || props.readonly || !(props.filterable || props.searchable) || props.multiple || browserInfo.name !== BROWSER_NAME.IE && browserInfo.name !== BROWSER_NAME.Edge && !state.visible;
1612
+ const computedReadonly = ({ props, state }) => () => {
1613
+ if (state.isIOS && props.filterable) {
1614
+ return false;
1615
+ } else {
1616
+ return state.device === "mb" || props.readonly || !(props.filterable || props.searchable) || props.multiple || browserInfo.name !== BROWSER_NAME.IE && browserInfo.name !== BROWSER_NAME.Edge && !state.visible;
1617
+ }
1618
+ };
1573
1619
  const computedShowClose = ({ props, state }) => () => props.clearable && !state.selectDisabled && (state.inputHovering || props.multiple && state.visible) && (props.multiple ? Array.isArray(props.modelValue) && props.modelValue.length > 0 : !isNull(props.modelValue) && props.modelValue !== "");
1574
1620
  const computedCollapseTagSize = (state) => () => state.selectSize;
1575
1621
  const computedShowNewOption = ({ props, state }) => () => {
@@ -1667,7 +1713,7 @@ const clearNoMatchValue = ({ props, emit }) => (newModelValue) => {
1667
1713
  }
1668
1714
  };
1669
1715
  const handleDebouncedQueryChange = ({ state, api }) => debounce(state.debounce, (value) => {
1670
- api.handleQueryChange(value);
1716
+ api.handleQueryChange(value, false, true);
1671
1717
  });
1672
1718
  const onClickCollapseTag = ({ state, props, nextTick, api }) => (event) => {
1673
1719
  event.stopPropagation();
@@ -1689,6 +1735,7 @@ export {
1689
1735
  computeMultipleLimit,
1690
1736
  computeOptimizeOpts,
1691
1737
  computedCollapseTagSize,
1738
+ computedCurrentSizeMap,
1692
1739
  computedDisabledTooltipContent,
1693
1740
  computedGetIcon,
1694
1741
  computedGetTagType,
@@ -1751,6 +1798,7 @@ export {
1751
1798
  onCopying,
1752
1799
  onInputChange,
1753
1800
  onMouseenterNative,
1801
+ onMouseenterSelf,
1754
1802
  onMouseleaveNative,
1755
1803
  onOptionDestroy,
1756
1804
  queryChange,
package/select/vue.js CHANGED
@@ -67,6 +67,7 @@ import {
67
67
  buildRadioConfig,
68
68
  onMouseenterNative,
69
69
  onMouseleaveNative,
70
+ onMouseenterSelf,
70
71
  onCopying,
71
72
  gridOnQueryChange,
72
73
  defaultOnQueryChange,
@@ -111,10 +112,12 @@ import {
111
112
  onClickCollapseTag,
112
113
  computedIsExpand,
113
114
  computedShowTagText,
114
- isTagClosable
115
+ isTagClosable,
116
+ computedCurrentSizeMap
115
117
  } from "./index";
116
118
  import debounce from "../common/deps/debounce";
117
119
  import { isNumber } from "../common/type";
120
+ import { useUserAgent } from "../common/deps/useUserAgent";
118
121
  const api = [
119
122
  "state",
120
123
  "nodeCollapse",
@@ -167,6 +170,7 @@ const api = [
167
170
  "buildRadioConfig",
168
171
  "onMouseenterNative",
169
172
  "onMouseleaveNative",
173
+ "onMouseenterSelf",
170
174
  "onCopying",
171
175
  "handleDropdownClick",
172
176
  "handleEnterTag",
@@ -185,7 +189,6 @@ const initState = ({ reactive, computed, props, api: api2, emitter, parent, cons
185
189
  datas: [],
186
190
  initDatas: [],
187
191
  query: "",
188
- magicKey: 0,
189
192
  options: [],
190
193
  visible: false,
191
194
  showCopy: computed(() => api2.computedShowCopy()),
@@ -239,11 +242,13 @@ const initState = ({ reactive, computed, props, api: api2, emitter, parent, cons
239
242
  }
240
243
  return true;
241
244
  })(),
242
- designConfig
245
+ designConfig,
246
+ currentSizeMap: computed(() => api2.computedCurrentSizeMap())
243
247
  }));
244
248
  return state;
245
249
  };
246
250
  const initStateAdd = ({ computed, props, api: api2, parent }) => {
251
+ const { isIOS } = useUserAgent();
247
252
  return {
248
253
  selectedTags: [],
249
254
  tips: "",
@@ -298,6 +303,7 @@ const initStateAdd = ({ computed, props, api: api2, parent }) => {
298
303
  isHidden: false,
299
304
  defaultCheckedKeys: [],
300
305
  optionIndexArr: [],
306
+ isIOS,
301
307
  showCollapseTag: false,
302
308
  exceedMaxVisibleRow: false,
303
309
  // 是否超出默认最大显示行数
@@ -366,6 +372,7 @@ const initApi = ({
366
372
  buildRadioConfig: buildRadioConfig({ props, state }),
367
373
  onMouseenterNative: onMouseenterNative({ state }),
368
374
  onMouseleaveNative: onMouseleaveNative({ state }),
375
+ onMouseenterSelf: onMouseenterSelf({ state }),
369
376
  onCopying: onCopying({ state, vm }),
370
377
  gridOnQueryChange: gridOnQueryChange({ props, vm, constants, state }),
371
378
  watchHoverIndex: watchHoverIndex({ state }),
@@ -394,7 +401,8 @@ const initApi = ({
394
401
  clearSearchText: clearSearchText({ state, api: api2 }),
395
402
  clearNoMatchValue: clearNoMatchValue({ props, emit }),
396
403
  computedShowTagText: computedShowTagText({ state }),
397
- isTagClosable: isTagClosable()
404
+ isTagClosable: isTagClosable(),
405
+ computedCurrentSizeMap: computedCurrentSizeMap({ state, designConfig })
398
406
  });
399
407
  addApi({ api: api2, props, state, emit, constants, parent, nextTick, dispatch, vm, isMobileFirstMode, designConfig });
400
408
  };
@@ -98,7 +98,7 @@ const initWatch = ({ watch, selectVm, state, nextTick }) => {
98
98
  state.zIndex = PopupManager.nextZIndex();
99
99
  }, 0);
100
100
  if (val && selectVm.multiple) {
101
- state.originValue = selectVm.modelValue.slice(0);
101
+ state.originValue = selectVm.modelValue && selectVm.modelValue.slice(0);
102
102
  }
103
103
  }
104
104
  );
package/tabbar/index.js CHANGED
@@ -45,8 +45,11 @@ const initPage = ({ vm, state }) => () => {
45
45
  }
46
46
  });
47
47
  };
48
- const beforeDestroy = (api) => () => {
48
+ const beforeDestroy = ({ vm, api }) => () => {
49
49
  off(window, "resize", api.initPage);
50
+ vm.$off("updateItems");
51
+ vm.$off("activeItem");
52
+ vm.$off("showIndex");
50
53
  };
51
54
  export {
52
55
  beforeDestroy,
package/tabbar/vue.js CHANGED
@@ -21,7 +21,7 @@ const renderless = (props, { computed, onMounted, reactive, watch, onBeforeUnmou
21
21
  setActiveItem: setActiveItem({ props, state }),
22
22
  getChildrens: getChildrens({ childrenHandler, api: api2 }),
23
23
  getItems: getItems(state),
24
- beforeDestroy: beforeDestroy(api2),
24
+ beforeDestroy: beforeDestroy({ vm, api: api2 }),
25
25
  initPage: initPage({ state, vm })
26
26
  });
27
27
  onMounted(() => {
package/tabs/index.js CHANGED
@@ -86,14 +86,17 @@ const calcMorePanes = ({ parent, props, state, refs }) => () => {
86
86
  }
87
87
  if (tabs && tabs.length) {
88
88
  let tabsAllWidth = 0;
89
+ if (state.currentIndex === -1) {
90
+ state.currentIndex = state.panes.findIndex((item) => item.state.paneName === state.currentName);
91
+ }
92
+ const currentIndex = state.currentIndex < 0 ? 0 : state.currentIndex;
93
+ const tabsHeaderWidth = tabNavRefs.navScroll.offsetWidth;
89
94
  for (let i = 0; i < tabs.length; i++) {
90
95
  const tabItem = tabs[i];
91
96
  tabsAllWidth = tabItem.offsetLeft + tabItem.offsetWidth / 2;
92
- const tabsHeaderWidth = tabNavRefs.navScroll.offsetWidth;
93
- const currentName = Number(state.currentName || 0);
94
- if (tabsAllWidth > tabsHeaderWidth && currentName >= 0) {
95
- if (currentName >= i + 1) {
96
- state.showPanesCount = currentName - 0;
97
+ if (tabsAllWidth > tabsHeaderWidth && currentIndex >= 0) {
98
+ if (currentIndex >= i + 1) {
99
+ state.showPanesCount = currentIndex;
97
100
  } else {
98
101
  state.showPanesCount = i;
99
102
  }
package/tabs/vue.js CHANGED
@@ -72,7 +72,7 @@ const initWatcher = ({
72
72
  { immediate: true }
73
73
  );
74
74
  };
75
- const renderless = (props, { onMounted, onUpdated, provide, reactive, watch }, { refs, parent, emit, constants, nextTick, childrenHandler }) => {
75
+ const renderless = (props, { onMounted, onUpdated, provide, reactive, watch, onUnmounted }, { vm, refs, parent, emit, constants, nextTick, childrenHandler }) => {
76
76
  const api2 = {};
77
77
  const state = initState({ reactive, props });
78
78
  Object.assign(api2, {
@@ -105,6 +105,9 @@ const renderless = (props, { onMounted, onUpdated, provide, reactive, watch }, {
105
105
  api2.calcMorePanes();
106
106
  api2.calcExpandPanes();
107
107
  });
108
+ onUnmounted(() => {
109
+ vm.$off("tab-nav-update");
110
+ });
108
111
  return api2;
109
112
  };
110
113
  export {
package/time-panel/vue.js CHANGED
@@ -39,7 +39,7 @@ const initState = ({ reactive, computed, api: api2 }) => {
39
39
  get: () => state.realValue || state.default,
40
40
  set: (value) => {
41
41
  const valid = state.items.some((item) => item.value === value);
42
- state.realValue = valid ? value : "";
42
+ state.realValue = state.lastEmitValue = valid ? value : "";
43
43
  }
44
44
  })
45
45
  });
package/tooltip/vue.js CHANGED
@@ -113,6 +113,7 @@ const renderless = (props, {
113
113
  onUnmounted(() => {
114
114
  api2.destroyed();
115
115
  api2.observer && api2.observer.disconnect();
116
+ vm.$off("tooltip-update");
116
117
  });
117
118
  return api2;
118
119
  };
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  __spreadValues
3
3
  } from "../chunk-G2ADBYYC.js";
4
+ import { xss } from "../common/xss";
4
5
  const initData = ({ state, props, service, api }) => async () => {
5
6
  if (props.data) {
6
7
  state.data = props.data;
@@ -82,7 +83,10 @@ const checkChange = (emit) => (data, checked, indeterminate) => {
82
83
  const check = (emit) => (data, checkedStatus) => {
83
84
  emit("check", data, checkedStatus);
84
85
  };
85
- const currentChange = (emit) => (data, node) => {
86
+ const currentChange = (emit) => (data, node, e) => {
87
+ if (data && data.url && e.target.nodeName !== "A" && e.target.nodeName !== "SPAN") {
88
+ window.open(xss.filterUrl(data.url), "_self").opener = null;
89
+ }
86
90
  emit("current-change", data, node);
87
91
  };
88
92
  const getTitle = (props) => (label) => props.showTitle ? label : "";
@@ -53,13 +53,14 @@ const handleClick = ({ api, vm, props, state }) => (e) => {
53
53
  return;
54
54
  }
55
55
  const store = state.tree.state.store;
56
- state.tree.clearCurrentStore(props.node);
57
56
  if (!state.tree.onlyCheckChildren) {
57
+ state.tree.clearCurrentStore(props.node);
58
58
  store.setCurrentNode(props.node);
59
- !props.node.disabled && state.tree.$emit("current-change", store.currentNode ? store.currentNode.data : null, store.currentNode);
59
+ !props.node.disabled && state.tree.$emit("current-change", store.currentNode ? store.currentNode.data : null, store.currentNode, e);
60
60
  } else if (props.node.isLeaf && !props.node.disabled) {
61
+ state.tree.clearCurrentStore(props.node);
61
62
  store.setCurrentNode(props.node);
62
- state.tree.$emit("current-change", store.currentNode ? store.currentNode.data : null, store.currentNode);
63
+ state.tree.$emit("current-change", store.currentNode ? store.currentNode.data : null, store.currentNode, e);
63
64
  }
64
65
  state.tree.currentNode = vm;
65
66
  if (state.tree.checkOnClickNode && !props.node.disabled) {
@@ -102,7 +103,7 @@ const handleContextMenu = ({ treeRoot, vm, props, state, nextTick }) => (event)
102
103
  const menuWidth = vm.$refs.menuContext.offsetWidth;
103
104
  const treeWidth = state.tree.$parent.$el.offsetWidth;
104
105
  if (event.clientY > -10) {
105
- state.menuposition.top = `${vm.$refs.node.offsetTop + vm.$refs.node.childNodes[0].offsetHeight / 2}px`;
106
+ state.menuposition.top = `${vm.$refs.node.offsetTop + vm.$refs.content.offsetHeight / 2}px`;
106
107
  }
107
108
  if (event.clientX > -10) {
108
109
  if (menuWidth > treeWidth) {