@opentiny/vue-renderless 3.14.0 → 3.15.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 (106) hide show
  1. package/LICENSE +22 -0
  2. package/action-menu/index.js +44 -0
  3. package/action-menu/vue.js +25 -8
  4. package/calendar-view/index.js +21 -13
  5. package/calendar-view/vue.js +6 -3
  6. package/cascader/index.js +1 -1
  7. package/cascader-select/index.js +5 -0
  8. package/cascader-select/vue.js +3 -1
  9. package/common/bigInt.js +2 -2
  10. package/common/deps/date-util.js +4 -2
  11. package/common/deps/vue-popper.js +22 -2
  12. package/common/index.js +15 -2
  13. package/common/runtime.js +1 -1
  14. package/date-range/vue.js +1 -0
  15. package/date-table/index.js +30 -53
  16. package/date-table/vue.js +1 -1
  17. package/dept/index.js +8 -1
  18. package/dept/vue.js +10 -1
  19. package/dialog-box/index.js +12 -6
  20. package/dialog-box/vue.js +1 -1
  21. package/dropdown-item/mf.js +2 -2
  22. package/file-upload/index.js +0 -1
  23. package/grid/utils/dom.js +30 -10
  24. package/image/index.js +4 -0
  25. package/image/vue.js +6 -3
  26. package/image-viewer/vue.js +3 -1
  27. package/input/index.js +6 -1
  28. package/input/vue.js +9 -5
  29. package/modal/index.js +1 -1
  30. package/numeric/index.js +9 -20
  31. package/numeric/vue.js +3 -12
  32. package/option-group/index.js +13 -0
  33. package/option-group/vue.js +19 -6
  34. package/package.json +7 -7
  35. package/picker/index.js +218 -193
  36. package/picker/vue.js +7 -4
  37. package/popconfirm/index.js +6 -0
  38. package/popconfirm/vue.js +11 -3
  39. package/popeditor/index.js +2 -2
  40. package/popover/index.js +4 -1
  41. package/popover/vue.js +2 -1
  42. package/quarter-panel/index.js +61 -0
  43. package/quarter-panel/vue.js +46 -0
  44. package/select/index.js +111 -55
  45. package/select/vue.js +53 -19
  46. package/skeleton/vue.js +2 -2
  47. package/skeleton-item/vue.js +1 -1
  48. package/statistic/index.js +22 -0
  49. package/statistic/vue.js +20 -0
  50. package/tabs/index.js +16 -1
  51. package/tall-storage/index.js +1 -1
  52. package/time-picker-mobile/index.js +10 -1
  53. package/time-picker-mobile/vue.js +5 -3
  54. package/time-spinner/index.js +52 -1
  55. package/time-spinner/vue.js +4 -2
  56. package/timeline-item/index.js +14 -1
  57. package/timeline-item/vue.js +7 -4
  58. package/tree/index.js +8 -4
  59. package/tree/vue.js +3 -3
  60. package/tree-node/index.js +2 -2
  61. package/types/action-menu.type.d.ts +40 -12
  62. package/types/action-sheet.type.d.ts +2 -2
  63. package/types/alert.type.d.ts +1 -1
  64. package/types/checkbox.type.d.ts +3 -3
  65. package/types/collapse.type.d.ts +1 -1
  66. package/types/date-table.type.d.ts +13 -0
  67. package/types/dialog-box.type.d.ts +1 -1
  68. package/types/drawer.type.d.ts +1 -1
  69. package/types/{dropdown-item.type-8475a549.d.ts → dropdown-item.type-678794c9.d.ts} +4 -0
  70. package/types/dropdown-item.type.d.ts +1 -1
  71. package/types/dropdown-menu.type.d.ts +1 -1
  72. package/types/file-upload.type.d.ts +1 -1
  73. package/types/form-item.type.d.ts +1 -1
  74. package/types/{form.type-222799ae.d.ts → form.type-8e30b25c.d.ts} +2 -1
  75. package/types/form.type.d.ts +1 -1
  76. package/types/image.type.d.ts +4 -0
  77. package/types/input.type.d.ts +3 -1
  78. package/types/milestone.type.d.ts +1 -1
  79. package/types/numeric.type.d.ts +4 -5
  80. package/types/pager.type.d.ts +1 -1
  81. package/types/popconfirm.type.d.ts +8 -0
  82. package/types/popeditor.type.d.ts +1 -1
  83. package/types/popover.type.d.ts +3 -3
  84. package/types/progress.type.d.ts +1 -1
  85. package/types/skeleton.type.d.ts +1 -1
  86. package/types/statistic.type.d.ts +56 -0
  87. package/types/steps.type.d.ts +1 -1
  88. package/types/switch.type.d.ts +3 -3
  89. package/types/tag.type.d.ts +4 -1
  90. package/types/{time-line.type-b155cb4f.d.ts → time-line.type-1b501c41.d.ts} +7 -0
  91. package/types/time-line.type.d.ts +1 -1
  92. package/types/timeline-item.type.d.ts +1 -1
  93. package/types/transfer.type.d.ts +3 -3
  94. package/types/upload-dragger.type.d.ts +2 -2
  95. package/types/{upload-list.type-a29aea50.d.ts → upload-list.type-f34997c8.d.ts} +9 -5
  96. package/types/upload-list.type.d.ts +1 -1
  97. package/types/upload.type.d.ts +1 -1
  98. package/user/index.js +1 -1
  99. package/credit-card/index.js +0 -93
  100. package/credit-card/vue.js +0 -62
  101. package/credit-card-form/index.js +0 -112
  102. package/credit-card-form/vue.js +0 -119
  103. package/detail-page/index.js +0 -79
  104. package/detail-page/vue.js +0 -78
  105. package/slide-bar/index.js +0 -67
  106. package/slide-bar/vue.js +0 -32
@@ -0,0 +1,61 @@
1
+ import "../chunk-G2ADBYYC.js";
2
+ import { modifyDate, nextYear, prevYear } from "../common/deps/date-util";
3
+ import { DATEPICKER } from "../common";
4
+ const getTarget = (event) => {
5
+ let target = event.target;
6
+ const tagName = target.tagName;
7
+ if (tagName === "A") {
8
+ target = target.parentNode.parentNode;
9
+ }
10
+ if (tagName === "DIV") {
11
+ target = target.parentNode;
12
+ }
13
+ if (target.tagName !== "TD") {
14
+ return;
15
+ }
16
+ return target;
17
+ };
18
+ const handleQuarterTableClick = ({ state, emit }) => (event) => {
19
+ const target = getTarget(event);
20
+ const currentDate = new Date(state.date.getFullYear(), DATEPICKER.QuarterMap[target.cellIndex], 1);
21
+ state.value = currentDate;
22
+ emit("pick", currentDate);
23
+ };
24
+ const showYearPicker = ({ state }) => () => state.currentView = DATEPICKER.Year;
25
+ const cusPrevYear = ({ state }) => () => {
26
+ if (state.currentView === DATEPICKER.Year) {
27
+ state.startYear = state.startYear - DATEPICKER.PanelYearNum;
28
+ } else {
29
+ state.date = prevYear(state.date);
30
+ }
31
+ };
32
+ const cusNextYear = ({ state }) => () => {
33
+ if (state.currentView === DATEPICKER.Year) {
34
+ state.startYear = state.startYear + DATEPICKER.PanelYearNum;
35
+ } else {
36
+ state.date = nextYear(state.date);
37
+ }
38
+ };
39
+ const handleYearPick = ({ state }) => (value) => {
40
+ state.currentView = DATEPICKER.Quarter;
41
+ state.date = modifyDate(state.date, value, state.date.getMonth(), state.date.getDate());
42
+ };
43
+ const getYearLabel = ({ state, t }) => () => {
44
+ return state.date.getFullYear();
45
+ };
46
+ const getCellStyle = ({ api, props, state }) => (cell) => {
47
+ const year = state.date.getFullYear();
48
+ const quarter = cell.text.slice(1) - 1;
49
+ const style = {};
50
+ style.current = state.value && state.value.getFullYear() === year && state.value.getMonth() === DATEPICKER.QuarterMap[quarter];
51
+ return style;
52
+ };
53
+ export {
54
+ cusNextYear,
55
+ cusPrevYear,
56
+ getCellStyle,
57
+ getYearLabel,
58
+ handleQuarterTableClick,
59
+ handleYearPick,
60
+ showYearPicker
61
+ };
@@ -0,0 +1,46 @@
1
+ import "../chunk-G2ADBYYC.js";
2
+ import { DATEPICKER } from "../common";
3
+ import {
4
+ handleQuarterTableClick,
5
+ showYearPicker,
6
+ handleYearPick,
7
+ cusPrevYear,
8
+ cusNextYear,
9
+ getYearLabel,
10
+ getCellStyle
11
+ } from "./index";
12
+ const api = [
13
+ "state",
14
+ "handleQuarterTableClick",
15
+ "showYearPicker",
16
+ "handleYearPick",
17
+ "cusPrevYear",
18
+ "cusNextYear",
19
+ "getCellStyle"
20
+ ];
21
+ const renderless = (props, { reactive, computed }, { emit, t }) => {
22
+ const api2 = {};
23
+ const state = reactive({
24
+ date: /* @__PURE__ */ new Date(),
25
+ visible: false,
26
+ currentView: DATEPICKER.Quarter,
27
+ yearLabel: computed(() => api2.getYearLabel()),
28
+ startYear: Math.floor((/* @__PURE__ */ new Date()).getFullYear() / 10) * 10,
29
+ rows: [{ text: "Q1" }, { text: "Q2" }, { text: "Q3" }, { text: "Q4" }]
30
+ });
31
+ Object.assign(api2, {
32
+ state,
33
+ handleQuarterTableClick: handleQuarterTableClick({ state, emit }),
34
+ showYearPicker: showYearPicker({ state }),
35
+ handleYearPick: handleYearPick({ state }),
36
+ cusPrevYear: cusPrevYear({ state }),
37
+ cusNextYear: cusNextYear({ state }),
38
+ getYearLabel: getYearLabel({ state, t }),
39
+ getCellStyle: getCellStyle({ api: api2, props, state })
40
+ });
41
+ return api2;
42
+ };
43
+ export {
44
+ api,
45
+ renderless
46
+ };
package/select/index.js CHANGED
@@ -180,7 +180,7 @@ const emitChange = ({ emit, props, state, constants }) => (value, changed) => {
180
180
  if (constants.TYPE.Tree === flag) {
181
181
  const recurNode = (node) => {
182
182
  val === node[props.valueField] && items.push(node);
183
- val !== node[props.valueField] && Array.isArray(node.children) && node.children.forEach(recurNode);
183
+ val !== node[props.valueField] && Array.isArray(node[state.childrenName]) && node[state.childrenName].forEach(recurNode);
184
184
  };
185
185
  arr.forEach(recurNode);
186
186
  } else if (constants.TYPE.Grid === flag) {
@@ -360,26 +360,8 @@ const getPluginOption = ({ api, props, state }) => (value, isTree) => {
360
360
  return items;
361
361
  };
362
362
  const toggleCheckAll = ({ api, state, props }) => (filtered) => {
363
- const getEnabledValues = (options) => {
364
- let values = [];
365
- for (let i = 0; i < options.length; i++) {
366
- const isEnabled = !options[i].state.disabled && !options[i].state.groupDisabled;
367
- const isRequired = options[i].required;
368
- const isDisabledAndChecked = !isEnabled && options[i].state.selectCls === "checked-sur";
369
- if (state.isSelectAll) {
370
- if (isRequired || isDisabledAndChecked) {
371
- values.push(options[i].value);
372
- }
373
- } else {
374
- if (isEnabled || isRequired || isDisabledAndChecked) {
375
- values.push(options[i].value);
376
- }
377
- }
378
- }
379
- return values;
380
- };
381
- let value;
382
- const enabledValues = getEnabledValues(state.options);
363
+ let value = [];
364
+ const enabledValues = state.options.filter((op) => !op.state.disabled && !op.state.groupDisabled && !op.required && op.state.visible).map((op) => op.value);
383
365
  if (filtered) {
384
366
  if (state.filteredSelectCls === "check" || state.filteredSelectCls === "halfselect") {
385
367
  value = [.../* @__PURE__ */ new Set([...state.modelValue, ...enabledValues])];
@@ -393,9 +375,12 @@ const toggleCheckAll = ({ api, state, props }) => (filtered) => {
393
375
  const unchecked = state.options.filter((item) => !item.state.disabled && item.state.selectCls === "check");
394
376
  unchecked.length ? value = enabledValues : value = [];
395
377
  } else if (state.selectCls === "checked-sur") {
396
- value = getEnabledValues(state.options);
378
+ value = [];
397
379
  }
398
380
  }
381
+ const requiredValue = state.options.filter((op) => op.required).map((op) => op.value);
382
+ const disabledSelectedValues = state.options.filter((op) => (op.state.disabled || op.state.groupDisabled) && op.state.selectCls === "checked-sur").map((op) => op.value);
383
+ value = [...value, ...requiredValue, ...disabledSelectedValues];
399
384
  api.setSoftFocus();
400
385
  state.isSilentBlur = true;
401
386
  api.updateModelValue(value);
@@ -424,23 +409,33 @@ const blur = ({ vm, state }) => () => {
424
409
  state.visible = false;
425
410
  vm.$refs.reference.blur();
426
411
  };
427
- const handleBlur = ({ constants, dispatch, emit, state }) => (event) => {
412
+ const handleBlur = ({ constants, dispatch, emit, state, designConfig }) => (event) => {
413
+ var _a;
428
414
  clearTimeout(state.timer);
429
415
  state.timer = setTimeout(() => {
416
+ var _a2;
430
417
  if (state.isSilentBlur) {
431
418
  state.isSilentBlur = false;
432
419
  } else {
433
420
  emit("blur", event);
434
421
  }
422
+ if ((_a2 = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a2.delayBlur) {
423
+ dispatch(constants.COMPONENT_NAME.FormItem, constants.EVENT_NAME.formBlur, event.target.value);
424
+ }
435
425
  }, 200);
436
- dispatch(constants.COMPONENT_NAME.FormItem, constants.EVENT_NAME.formBlur, event.target.value);
426
+ if (!((_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.delayBlur)) {
427
+ dispatch(constants.COMPONENT_NAME.FormItem, constants.EVENT_NAME.formBlur, event.target.value);
428
+ }
437
429
  state.softFocus = false;
438
430
  };
439
431
  const handleClearClick = (api) => (event) => {
440
432
  api.deleteSelected(event);
441
433
  };
442
434
  const doDestroy = (vm) => () => {
443
- vm.$refs.popper && vm.$refs.popper.doDestroy();
435
+ var _a;
436
+ if ((_a = vm == null ? void 0 : vm.$refs) == null ? void 0 : _a.popper) {
437
+ vm.$refs.popper.doDestroy();
438
+ }
444
439
  };
445
440
  const handleClose = (state) => () => {
446
441
  state.visible = false;
@@ -501,15 +496,16 @@ const resetInputHeight = ({ constants, nextTick, props, vm, state, api, designCo
501
496
  }
502
497
  let input = vm.$refs.reference.type === "text" && vm.$refs.reference.$el.querySelector("input");
503
498
  const tags = vm.$refs.tags;
499
+ const limitText = vm.$refs.reference.$el.querySelector("span.tiny-select__limit-txt");
504
500
  if (!input) {
505
501
  return;
506
502
  }
507
- if (!state.isDisplayOnly && props.hoverExpand && !props.disabled) {
503
+ if (!state.isDisplayOnly && (props.hoverExpand || props.clickExpand) && !props.disabled) {
508
504
  api.calcCollapseTags();
509
505
  }
510
- const sizeInMap = state.initialInputHeight || (state.isSaaSTheme ? 28 : 30);
506
+ const sizeInMap = (designConfig == null ? void 0 : designConfig.state.initialInputHeight) || state.initialInputHeight || (state.isSaaSTheme ? 28 : 30);
511
507
  const noSelected = state.selected.length === 0;
512
- const spacingHeight = designConfig ? (_a = designConfig.state) == null ? void 0 : _a.spacingHeight : 2;
508
+ const spacingHeight = designConfig ? (_a = designConfig.state) == null ? void 0 : _a.spacingHeight : constants.SPACING_HEIGHT;
513
509
  if (!state.isDisplayOnly) {
514
510
  if (!noSelected && tags) {
515
511
  fastdom.measure(() => {
@@ -524,6 +520,12 @@ const resetInputHeight = ({ constants, nextTick, props, vm, state, api, designCo
524
520
  } else {
525
521
  input.style.height = "auto";
526
522
  }
523
+ if (limitText && props.multipleLimit) {
524
+ const { width, marginLeft, marginRight } = getComputedStyle(limitText);
525
+ vm.$refs.tags.style.paddingRight = `${Math.ceil(
526
+ parseFloat(width) + parseFloat(marginLeft) + parseFloat(marginRight)
527
+ )}px`;
528
+ }
527
529
  if (state.visible && state.emptyText !== false) {
528
530
  state.selectEmitter.emit(constants.EVENT_NAME.updatePopper, true);
529
531
  }
@@ -909,10 +911,7 @@ const watchValue = ({ api, constants, dispatch, props, vm, state }) => (value, o
909
911
  state.currentPlaceholder = state.cachedPlaceHolder;
910
912
  }
911
913
  if (props.filterable && !props.reserveKeyword) {
912
- const isChange = false;
913
- const isInput = true;
914
- props.renderType !== constants.TYPE.Grid && (state.query = "");
915
- api.handleQueryChange(state.query, isChange, isInput);
914
+ props.renderType !== constants.TYPE.Grid && !props.searchable && (state.query = "");
916
915
  }
917
916
  }
918
917
  api.setSelected();
@@ -1113,7 +1112,7 @@ const queryVisibleOptions = ({ props, vm, isMobileFirstMode }) => () => {
1113
1112
  if (props.optimization) {
1114
1113
  return optmzApis.queryVisibleOptions(vm, isMobileFirstMode);
1115
1114
  } else {
1116
- return Array.from(vm.$refs.scrollbar.$el.querySelectorAll('[data-index]:not([style*="display: none"])'));
1115
+ return vm.$refs.scrollbar ? Array.from(vm.$refs.scrollbar.$el.querySelectorAll('[data-index]:not([style*="display: none"])')) : [];
1117
1116
  }
1118
1117
  };
1119
1118
  const handleCopyClick = ({ parent, props, state }) => () => {
@@ -1166,14 +1165,14 @@ const radioChange = ({ props, state, api, vm }) => ({ row }) => {
1166
1165
  api.updateModelValue(row.value);
1167
1166
  api.directEmitChange(row);
1168
1167
  };
1169
- const getTreeData = (props) => (data) => {
1168
+ const getTreeData = (props, state) => (data) => {
1170
1169
  const nodes = [];
1171
1170
  const getChild = (data2, pId) => {
1172
1171
  data2.forEach((node) => {
1173
1172
  node.pId = pId;
1174
1173
  nodes.push(node);
1175
- if (node.children && node.children.length > 0) {
1176
- getChild(node.children, node[props.valueField]);
1174
+ if (node[state.childrenName] && node[state.childrenName].length > 0) {
1175
+ getChild(node[state.childrenName], node[props.valueField]);
1177
1176
  }
1178
1177
  });
1179
1178
  };
@@ -1310,7 +1309,11 @@ const watchHoverIndex = ({ state }) => (value) => {
1310
1309
  state.hoverValue = state.optionIndexArr[value];
1311
1310
  }
1312
1311
  };
1313
- const handleDropdownClick = ({ emit }) => ($event) => {
1312
+ const handleDropdownClick = ({ vm, state, props, emit }) => ($event) => {
1313
+ if (props.allowCopy && vm.$refs.reference) {
1314
+ vm.$refs.reference.$el.querySelector("input").selectionEnd = 0;
1315
+ }
1316
+ state.softFocus = false;
1314
1317
  emit("dropdown-click", $event);
1315
1318
  };
1316
1319
  const handleEnterTag = ({ state }) => ($event, key) => {
@@ -1319,13 +1322,13 @@ const handleEnterTag = ({ state }) => ($event, key) => {
1319
1322
  state.tooltipContent = __spreadProps(__spreadValues({}, state.tooltipContent), { [key]: target.innerText });
1320
1323
  }
1321
1324
  };
1322
- const calcCollapseTags = ({ state, vm }) => () => {
1323
- if (state.inputHovering) {
1325
+ const calcCollapseTags = ({ state, vm, props }) => () => {
1326
+ if (state.inputHovering && !props.clickExpand) {
1324
1327
  return state.isHidden = true;
1325
1328
  }
1326
1329
  const tags = vm.$refs.tags;
1327
1330
  const collapseTag = tags && tags.querySelector('[data-tag="tags-collapse"]');
1328
- if (!tags || !collapseTag) {
1331
+ if (!collapseTag || !tags) {
1329
1332
  return;
1330
1333
  }
1331
1334
  const { width: tagsContentWidth, paddingLeft, paddingRight } = window.getComputedStyle(tags);
@@ -1333,19 +1336,37 @@ const calcCollapseTags = ({ state, vm }) => () => {
1333
1336
  const { width: collapseTagContentWidth, marginRight } = collapseTag && window.getComputedStyle(collapseTag);
1334
1337
  const collapseTagWidth = collapseTag && parseFloat(collapseTagContentWidth) + parseFloat(marginRight);
1335
1338
  const tagList = Array.from(tags.querySelectorAll('[data-tag="tiny-tag"]'));
1336
- let { total, dom, idx } = { total: collapseTagWidth, dom: null, idx: 0 };
1337
- tagList.forEach((tag, index) => {
1338
- if (tag !== collapseTag) {
1339
- const { width: tagContentWidth, marginRight: marginRight2 } = tag && window.getComputedStyle(tag);
1340
- total += parseFloat(tagContentWidth) + parseFloat(marginRight2);
1339
+ let [dom, idx, currentRowWidth, currentTagIndex] = [null, 0, 0, 0];
1340
+ for (let rowNum = 0; rowNum < props.maxVisibleRows; rowNum++) {
1341
+ currentRowWidth = 0;
1342
+ let currentTagWidth = 0;
1343
+ for (currentTagIndex; currentTagIndex < tagList.length; currentTagIndex++) {
1344
+ const tag = tagList[currentTagIndex];
1345
+ if (tag !== collapseTag) {
1346
+ const { width: tagContentWidth, marginRight: marginRight2, marginLeft } = tag && window.getComputedStyle(tag);
1347
+ currentTagWidth = parseFloat(tagContentWidth) + parseFloat(marginRight2) + parseFloat(marginLeft);
1348
+ currentRowWidth += currentTagWidth;
1349
+ }
1350
+ if (tag !== collapseTag && currentRowWidth > tagsWidth) {
1351
+ if (!dom && rowNum === props.maxVisibleRows - 1) {
1352
+ if (currentRowWidth - currentTagWidth + collapseTagWidth < tagsWidth) {
1353
+ dom = tag;
1354
+ idx = currentTagIndex;
1355
+ } else {
1356
+ dom = tagList[currentTagIndex - 1];
1357
+ idx = currentTagIndex - 1;
1358
+ }
1359
+ }
1360
+ break;
1361
+ }
1341
1362
  }
1342
- if (tag !== collapseTag && total > tagsWidth && !dom) {
1343
- dom = tag;
1344
- idx = index;
1363
+ if (currentTagIndex === tagList.length - 1) {
1364
+ break;
1345
1365
  }
1346
- });
1347
- let isOneLine = total - collapseTagWidth <= tagsWidth;
1348
- if (isOneLine) {
1366
+ }
1367
+ if (idx === 0) {
1368
+ state.exceedMaxVisibleRow = false;
1369
+ state.showCollapseTag = false;
1349
1370
  return state.isHidden = true;
1350
1371
  }
1351
1372
  if (dom) {
@@ -1355,6 +1376,8 @@ const calcCollapseTags = ({ state, vm }) => () => {
1355
1376
  state.isHidden = true;
1356
1377
  }
1357
1378
  state.collapseTagsLength = tagList.length - idx;
1379
+ state.exceedMaxVisibleRow = true;
1380
+ state.toHideIndex = idx;
1358
1381
  };
1359
1382
  const watchInputHover = ({ vm }) => (newVal) => {
1360
1383
  const [inputHovering, visible] = newVal;
@@ -1506,12 +1529,27 @@ const getLabelSlotValue = ({ props, state }) => (item) => {
1506
1529
  });
1507
1530
  return ["grid", "tree"].includes(props.renderType) ? item : obj;
1508
1531
  };
1509
- const computedTagsStyle = ({ props, parent, state }) => () => {
1532
+ const computedTagsStyle = ({ props, parent, state, vm }) => () => {
1510
1533
  const isReadonly = props.disabled || (parent.form || {}).disabled || props.displayOnly;
1511
- return {
1534
+ let tagsStyle = {
1512
1535
  "max-width": isReadonly ? "" : state.inputWidth - state.inputPaddingRight + "px",
1513
1536
  width: "100%"
1514
1537
  };
1538
+ if (props.clickExpand && !state.exceedMaxVisibleRow || state.visible) {
1539
+ Object.assign(tagsStyle, { height: "auto" });
1540
+ }
1541
+ if (props.clickExpand && state.exceedMaxVisibleRow && !state.showCollapseTag) {
1542
+ const tags = vm.$refs.tags;
1543
+ const { paddingTop: tagsPaddingTop, paddingBottom: tagsPaddingBottom } = window.getComputedStyle(tags);
1544
+ const tagsPaddingVertical = parseFloat(tagsPaddingTop) + parseFloat(tagsPaddingBottom);
1545
+ const tag = tags == null ? void 0 : tags.querySelector('[data-tag="tiny-tag"]');
1546
+ if (tag) {
1547
+ const { height: tagHeight, marginTop, marginBottom } = window.getComputedStyle(tag);
1548
+ const rowHeight = (parseFloat(tagHeight) + parseFloat(marginTop) + parseFloat(marginBottom)) * props.maxVisibleRows;
1549
+ Object.assign(tagsStyle, { "height": `${rowHeight + tagsPaddingVertical}px` });
1550
+ }
1551
+ }
1552
+ return tagsStyle;
1515
1553
  };
1516
1554
  const computedReadonly = ({ props, state }) => () => state.device === "mb" || props.readonly || !props.filterable || props.multiple || browserInfo.name !== BROWSER_NAME.IE && browserInfo.name !== BROWSER_NAME.Edge && !state.visible;
1517
1555
  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 !== "");
@@ -1524,6 +1562,11 @@ const computedShowCopy = ({ props, state }) => () => props.multiple && props.cop
1524
1562
  const computedOptionsAllDisabled = (state) => () => state.options.filter((option) => option.visible).every((option) => option.disabled);
1525
1563
  const computedDisabledTooltipContent = (state) => () => state.selected.map((item) => item.state ? item.state.currentLabel : item.currentLabel).join("\uFF1B");
1526
1564
  const computedSelectDisabled = ({ props, parent }) => () => props.disabled || (parent.form || {}).disabled || props.displayOnly || (parent.form || {}).displayOnly;
1565
+ const computedIsExpand = ({ props, state }) => () => {
1566
+ const hoverExpanded = (state.selectHover || state.visible) && props.hoverExpand && !props.disabled;
1567
+ const clickExpanded = props.clickExpand && state.exceedMaxVisibleRow && state.showCollapseTag;
1568
+ return hoverExpanded || clickExpanded;
1569
+ };
1527
1570
  const computedIsExpandAll = (props) => () => {
1528
1571
  const { defaultExpandAll, lazy } = props.treeOp;
1529
1572
  return !lazy && defaultExpandAll !== false;
@@ -1531,9 +1574,9 @@ const computedIsExpandAll = (props) => () => {
1531
1574
  const loadTreeData = ({ state, vm, props, api }) => ({ data = [], init = false }) => {
1532
1575
  const getTreeDatas = (datas, newDatas = []) => {
1533
1576
  datas.forEach(({ data: data2, childNodes }) => {
1534
- let temData = __spreadProps(__spreadValues({}, data2), { children: [] });
1577
+ let temData = __spreadProps(__spreadValues({}, data2), { [state.childrenName]: [] });
1535
1578
  if (childNodes && childNodes.length) {
1536
- getTreeDatas(childNodes, temData.children);
1579
+ getTreeDatas(childNodes, temData[state.childrenName]);
1537
1580
  }
1538
1581
  newDatas.push(temData);
1539
1582
  });
@@ -1597,6 +1640,16 @@ const clearNoMatchValue = ({ props, emit }) => (newModelValue) => {
1597
1640
  emit("update:modelValue", newModelValue);
1598
1641
  }
1599
1642
  };
1643
+ const handleDebouncedQueryChange = ({ state, api }) => debounce(state.debounce, (value) => {
1644
+ api.handleQueryChange(value);
1645
+ });
1646
+ const onClickCollapseTag = ({ state, props, nextTick, api }) => (event) => {
1647
+ event.stopPropagation();
1648
+ if (props.clickExpand && !props.disabled && !state.isDisplayOnly) {
1649
+ state.showCollapseTag = !state.showCollapseTag;
1650
+ nextTick(api.resetInputHeight);
1651
+ }
1652
+ };
1600
1653
  export {
1601
1654
  blur,
1602
1655
  buildRadioConfig,
@@ -1613,6 +1666,7 @@ export {
1613
1666
  computedDisabledTooltipContent,
1614
1667
  computedGetIcon,
1615
1668
  computedGetTagType,
1669
+ computedIsExpand,
1616
1670
  computedIsExpandAll,
1617
1671
  computedOptionsAllDisabled,
1618
1672
  computedReadonly,
@@ -1648,6 +1702,7 @@ export {
1648
1702
  handleClose,
1649
1703
  handleComposition,
1650
1704
  handleCopyClick,
1705
+ handleDebouncedQueryChange,
1651
1706
  handleDropdownClick,
1652
1707
  handleEnterTag,
1653
1708
  handleFocus,
@@ -1664,6 +1719,7 @@ export {
1664
1719
  nodeCheckClick,
1665
1720
  nodeCollapse,
1666
1721
  nodeExpand,
1722
+ onClickCollapseTag,
1667
1723
  onCopying,
1668
1724
  onInputChange,
1669
1725
  onMouseenterNative,
package/select/vue.js CHANGED
@@ -106,7 +106,10 @@ import {
106
106
  computedGetIcon,
107
107
  computedGetTagType,
108
108
  clearSearchText,
109
- clearNoMatchValue
109
+ clearNoMatchValue,
110
+ handleDebouncedQueryChange,
111
+ onClickCollapseTag,
112
+ computedIsExpand
110
113
  } from "./index";
111
114
  import debounce from "../common/deps/debounce";
112
115
  import { isNumber } from "../common/type";
@@ -168,9 +171,10 @@ const api = [
168
171
  "getLabelSlotValue",
169
172
  "loadTreeData",
170
173
  "updateModelValue",
171
- "clearSearchText"
174
+ "clearSearchText",
175
+ "onClickCollapseTag"
172
176
  ];
173
- const initState = ({ reactive, computed, props, api: api2, emitter, parent, constants, useBreakpoint, vm }) => {
177
+ const initState = ({ reactive, computed, props, api: api2, emitter, parent, constants, useBreakpoint, vm, designConfig }) => {
174
178
  const stateAdd = initStateAdd({ computed, props, api: api2, parent });
175
179
  const state = reactive(__spreadProps(__spreadValues({}, stateAdd), {
176
180
  selectEmitter: emitter(),
@@ -201,7 +205,7 @@ const initState = ({ reactive, computed, props, api: api2, emitter, parent, cons
201
205
  collapseTags: computed(() => api2.computeCollapseTags()),
202
206
  multipleLimit: computed(() => api2.computeMultipleLimit()),
203
207
  disabledTooltipContent: computed(() => api2.computedDisabledTooltipContent()),
204
- isExpand: computed(() => (state.selectHover || state.visible) && props.hoverExpand && !props.disabled),
208
+ isExpand: computed(() => api2.computedIsExpand()),
205
209
  collapseTagsLength: 0,
206
210
  initValue: [],
207
211
  key: 0,
@@ -224,7 +228,13 @@ const initState = ({ reactive, computed, props, api: api2, emitter, parent, cons
224
228
  // tiny 新增
225
229
  getIcon: computed(() => api2.computedGetIcon()),
226
230
  getTagType: computed(() => api2.computedGetTagType()),
227
- isSelectAll: computed(() => state.selectCls === "checked-sur")
231
+ isSelectAll: computed(() => state.selectCls === "checked-sur"),
232
+ autoHideDownIcon: (() => {
233
+ if ((designConfig == null ? void 0 : designConfig.state) && "autoHideDownIcon" in designConfig.state) {
234
+ return designConfig.state.autoHideDownIcon;
235
+ }
236
+ return true;
237
+ })()
228
238
  }));
229
239
  return state;
230
240
  };
@@ -276,10 +286,16 @@ const initStateAdd = ({ computed, props, api: api2, parent }) => {
276
286
  gridCheckedData: computed(() => api2.getcheckedData()),
277
287
  isExpandAll: computed(() => api2.computedIsExpandAll()),
278
288
  searchSingleCopy: computed(() => props.allowCopy && !props.multiple && props.filterable),
289
+ childrenName: computed(() => props.treeOp.props && props.treeOp.props.children || "children"),
279
290
  tooltipContent: {},
280
291
  isHidden: false,
281
292
  defaultCheckedKeys: [],
282
- optionIndexArr: []
293
+ optionIndexArr: [],
294
+ showCollapseTag: false,
295
+ exceedMaxVisibleRow: false,
296
+ // 是否超出默认最大显示行数
297
+ toHideIndex: Infinity
298
+ // 第一个超出被隐藏的索引
283
299
  };
284
300
  };
285
301
  const initApi = ({
@@ -301,7 +317,7 @@ const initApi = ({
301
317
  state,
302
318
  maskState,
303
319
  doDestroy: doDestroy(vm),
304
- getTreeData: getTreeData(props),
320
+ getTreeData: getTreeData(props, state),
305
321
  blur: blur({ vm, state }),
306
322
  focus: focus({ vm, state }),
307
323
  getValueKey: getValueKey(props),
@@ -331,7 +347,7 @@ const initApi = ({
331
347
  setOptionHighlight: setOptionHighlight(state),
332
348
  nodeExpand: nodeExpand({ state, constants, nextTick }),
333
349
  nodeCollapse: nodeCollapse({ state, constants, nextTick }),
334
- handleBlur: handleBlur({ constants, dispatch, emit, state }),
350
+ handleBlur: handleBlur({ constants, dispatch, emit, state, designConfig }),
335
351
  toggleLastOptionHitState: toggleLastOptionHitState({ state }),
336
352
  emptyText: emptyText({ I18N: constants.I18N, props, state, t, isMobileFirstMode }),
337
353
  emptyFlag: emptyFlag({ props, state }),
@@ -352,7 +368,7 @@ const initApi = ({
352
368
  watchInputHover: watchInputHover({ vm }),
353
369
  initQuery: initQuery({ props, state, constants, vm }),
354
370
  updateModelValue: updateModelValue({ props, emit, state }),
355
- computedTagsStyle: computedTagsStyle({ props, parent, state }),
371
+ computedTagsStyle: computedTagsStyle({ props, parent, state, vm }),
356
372
  computedReadonly: computedReadonly({ props, state }),
357
373
  computedShowClose: computedShowClose({ props, state }),
358
374
  computedCollapseTagSize: computedCollapseTagSize(state),
@@ -361,6 +377,7 @@ const initApi = ({
361
377
  computedOptionsAllDisabled: computedOptionsAllDisabled(state),
362
378
  computedDisabledTooltipContent: computedDisabledTooltipContent(state),
363
379
  computedSelectDisabled: computedSelectDisabled({ props, parent }),
380
+ computedIsExpand: computedIsExpand({ props, state }),
364
381
  computedIsExpandAll: computedIsExpandAll(props),
365
382
  watchInitValue: watchInitValue({ props, emit }),
366
383
  watchShowClose: watchShowClose({ nextTick, state, parent }),
@@ -410,9 +427,11 @@ const addApi = ({
410
427
  handleOptionSelect: handleOptionSelect({ api: api2, nextTick, props, vm, state }),
411
428
  getPluginOption: getPluginOption({ api: api2, props, state }),
412
429
  toggleCheckAll: toggleCheckAll({ api: api2, emit, state, props }),
413
- debouncedQueryChange: debounce(state.debounce, (event) => {
414
- api2.handleQueryChange(props.shape ? event : event.target.value, false, true);
415
- }),
430
+ handleDebouncedQueryChange: handleDebouncedQueryChange({ state, api: api2 }),
431
+ debouncedQueryChange: (event) => {
432
+ const value = props.shape ? event : event.target.value;
433
+ api2.handleDebouncedQueryChange(value);
434
+ },
416
435
  debouncedOnInputChange: debounce(state.debounce, () => {
417
436
  api2.onInputChange();
418
437
  }),
@@ -422,12 +441,13 @@ const addApi = ({
422
441
  mounted: mounted({ api: api2, parent, state, props, vm, designConfig }),
423
442
  unMount: unMount({ api: api2, parent, vm, state }),
424
443
  watchOptimizeOpts: watchOptimizeOpts({ props, state }),
425
- handleDropdownClick: handleDropdownClick({ emit }),
444
+ handleDropdownClick: handleDropdownClick({ props, vm, state, emit }),
426
445
  handleEnterTag: handleEnterTag({ state }),
427
- calcCollapseTags: calcCollapseTags({ state, vm }),
446
+ calcCollapseTags: calcCollapseTags({ state, vm, props }),
428
447
  initValue: initValue({ state }),
429
448
  getLabelSlotValue: getLabelSlotValue({ props, state }),
430
- loadTreeData: loadTreeData({ state, vm, props, api: api2 })
449
+ loadTreeData: loadTreeData({ state, vm, props, api: api2 }),
450
+ onClickCollapseTag: onClickCollapseTag({ state, props, nextTick, api: api2 })
431
451
  });
432
452
  };
433
453
  const initWatch = ({ watch, props, api: api2, state, nextTick }) => {
@@ -519,7 +539,18 @@ const addWatch = ({ watch, props, api: api2, state, nextTick }) => {
519
539
  };
520
540
  const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, watch, provide, inject }, { vm, parent, emit, constants, nextTick, dispatch, t, emitter, isMobileFirstMode, useBreakpoint, designConfig }) => {
521
541
  const api2 = {};
522
- const state = initState({ reactive, computed, props, api: api2, emitter, parent, constants, useBreakpoint, vm });
542
+ const state = initState({
543
+ reactive,
544
+ computed,
545
+ props,
546
+ api: api2,
547
+ emitter,
548
+ parent,
549
+ constants,
550
+ useBreakpoint,
551
+ vm,
552
+ designConfig
553
+ });
523
554
  const dialog = inject("dialog", null);
524
555
  provide("selectEmitter", state.selectEmitter);
525
556
  provide("selectVm", vm);
@@ -539,9 +570,6 @@ const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, wat
539
570
  isMobileFirstMode,
540
571
  designConfig
541
572
  });
542
- initWatch({ watch, props, api: api2, state, nextTick });
543
- onMounted(api2.mounted);
544
- onBeforeUnmount(api2.unMount);
545
573
  parent.$on("handle-clear", (event) => {
546
574
  api2.handleClearClick(event);
547
575
  });
@@ -555,6 +583,12 @@ const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, wat
555
583
  state.selectEmitter.on(constants.EVENT_NAME.handleOptionClick, api2.handleOptionSelect);
556
584
  state.selectEmitter.on(constants.EVENT_NAME.setSelected, api2.setSelected);
557
585
  state.selectEmitter.on(constants.EVENT_NAME.initValue, api2.initValue);
586
+ initWatch({ watch, props, api: api2, state, nextTick });
587
+ onMounted(api2.mounted);
588
+ onBeforeUnmount(() => {
589
+ api2.unMount();
590
+ dialog && dialog.state.emitter.off("handleSelectClose", api2.handleClose);
591
+ });
558
592
  return api2;
559
593
  };
560
594
  export {
package/skeleton/vue.js CHANGED
@@ -2,8 +2,8 @@ import "../chunk-G2ADBYYC.js";
2
2
  import { toPxStyle } from "./index";
3
3
  const api = ["toPxStyle"];
4
4
  const renderless = (props, { toRefs, provide }) => {
5
- const { active } = toRefs(props);
6
- provide("active", active);
5
+ const { animated } = toRefs(props);
6
+ provide("animated", animated);
7
7
  const api2 = {
8
8
  toPxStyle
9
9
  };
@@ -2,7 +2,7 @@ import "../chunk-G2ADBYYC.js";
2
2
  const api = ["state"];
3
3
  const renderless = (props, { reactive, inject }) => {
4
4
  const state = reactive({
5
- isActive: inject("active", false)
5
+ isActive: inject("animated", false)
6
6
  });
7
7
  const api2 = {
8
8
  state
@@ -0,0 +1,22 @@
1
+ import "../chunk-G2ADBYYC.js";
2
+ import { isFunction } from "../common/type";
3
+ const isNumber = ({ props }) => () => {
4
+ return typeof props.value === "number";
5
+ };
6
+ const getIntegerAndDecimal = ({ props }) => () => {
7
+ var _a, _b;
8
+ if (isFunction(props.formatter)) {
9
+ return props.formatter(props.value);
10
+ }
11
+ if (!isNumber(props.value)) {
12
+ return props.value;
13
+ }
14
+ let displayValue = props.value ? String(props.value).split(".") : "";
15
+ let integer = (_a = displayValue[0]) == null ? void 0 : _a.replace(/\B(?=(\d{3})+(?!\d))/g, props.groupSeparator);
16
+ let decimal = (_b = displayValue[1]) == null ? void 0 : _b.padEnd(props.precision, "0").slice(0, props.precision > 0 ? props.precision : 0);
17
+ return [integer, decimal].join(decimal ? "." : "");
18
+ };
19
+ export {
20
+ getIntegerAndDecimal,
21
+ isNumber
22
+ };