@opentiny/vue-renderless 3.18.5 → 3.19.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 (122) hide show
  1. package/action-menu/index.js +2 -2
  2. package/action-menu/vue.js +2 -2
  3. package/anchor/index.js +8 -6
  4. package/anchor/vue.js +1 -1
  5. package/badge/index.js +4 -3
  6. package/base-select/index.js +3 -3
  7. package/breadcrumb-item/vue.js +1 -1
  8. package/bulletin-board/index.js +1 -1
  9. package/button/index.js +1 -1
  10. package/button-group/index.js +6 -1
  11. package/carousel-item/index.js +1 -1
  12. package/cascader/vue.js +17 -4
  13. package/chart-core/deps/utils.js +1 -1
  14. package/checkbox/index.js +1 -1
  15. package/common/deps/dom.js +9 -1
  16. package/common/deps/useWindowSize.js +23 -0
  17. package/common/deps/vue-popper.js +1 -1
  18. package/common/index.js +2 -2
  19. package/common/prop-util.js +43 -0
  20. package/common/runtime.js +1 -1
  21. package/crop/index.js +14 -22
  22. package/crop/vue.js +33 -29
  23. package/date-panel/index.js +13 -2
  24. package/date-panel/vue.js +16 -10
  25. package/dialog-select/index.js +78 -0
  26. package/dialog-select/vue.js +28 -6
  27. package/drawer/index.js +14 -1
  28. package/drawer/vue.js +4 -3
  29. package/dropdown-item/index.js +2 -2
  30. package/dropdown-item/vue.js +9 -6
  31. package/espace/index.js +1 -1
  32. package/fall-menu/index.js +5 -1
  33. package/fall-menu/vue.js +15 -2
  34. package/filter-box/vue.js +5 -2
  35. package/floatbar/index.js +1 -1
  36. package/fluent-editor/options.js +26 -24
  37. package/form/index.js +7 -4
  38. package/form/vue.js +1 -1
  39. package/grid/plugins/export.js +1 -1
  40. package/grid/utils/dom.js +3 -1
  41. package/guide/index.js +17 -2
  42. package/guide/vue.js +5 -3
  43. package/image-viewer/vue.js +1 -1
  44. package/input/index.js +6 -7
  45. package/input/vue.js +10 -11
  46. package/ip-address/index.js +0 -10
  47. package/ip-address/vue.js +2 -5
  48. package/load-list/index.js +43 -0
  49. package/load-list/vue.js +69 -0
  50. package/locales/index.js +1 -5
  51. package/logout/index.js +1 -1
  52. package/milestone/index.js +55 -8
  53. package/milestone/vue.js +16 -3
  54. package/modal/index.js +6 -6
  55. package/modal/vue.js +4 -3
  56. package/nav-menu/index.js +1 -1
  57. package/package.json +1 -1
  58. package/pager/index.js +25 -0
  59. package/pager/vue.js +18 -4
  60. package/picker/index.js +3 -3
  61. package/picker/vue.js +1 -1
  62. package/popeditor/index.js +12 -1
  63. package/popeditor/vue.js +9 -5
  64. package/rich-text/table-module.js +4 -3
  65. package/roles/index.js +1 -1
  66. package/select/index.js +6 -6
  67. package/select/vue.js +2 -1
  68. package/selected-box/vue.js +2 -1
  69. package/slider/index.js +2 -2
  70. package/slider-button-group/vue.js +3 -2
  71. package/split/vue.js +4 -2
  72. package/sticky/index.js +89 -0
  73. package/sticky/vue.js +74 -0
  74. package/tabbar-item/vue.js +1 -1
  75. package/tall-storage/index.js +1 -1
  76. package/time/vue.js +2 -1
  77. package/time-range/vue.js +4 -1
  78. package/time-spinner/index.js +4 -1
  79. package/toggle-menu/index.js +1 -1
  80. package/transfer-panel/vue.js +7 -6
  81. package/tree/index.js +17 -7
  82. package/tree/vue.js +10 -6
  83. package/tree-node/index.js +2 -2
  84. package/tree-node/vue.js +6 -2
  85. package/types/action-menu.type.d.ts +1 -1
  86. package/types/alert.type.d.ts +2 -0
  87. package/types/anchor.type.d.ts +5 -1
  88. package/types/badge.type.d.ts +1 -1
  89. package/types/button-group.type.d.ts +3 -0
  90. package/types/button.type.d.ts +1 -1
  91. package/types/date-picker.type.d.ts +3 -0
  92. package/types/drawer.type.d.ts +5 -1
  93. package/types/{dropdown-item.type-16d59fd0.d.ts → dropdown-item.type-c9badbc1.d.ts} +2 -2
  94. package/types/dropdown-item.type.d.ts +1 -1
  95. package/types/dropdown-menu.type.d.ts +1 -1
  96. package/types/fall-menu.type.d.ts +1 -0
  97. package/types/file-upload.type.d.ts +1 -1
  98. package/types/image.type.d.ts +4 -0
  99. package/types/input.type.d.ts +8 -4
  100. package/types/load-list.type.d.ts +58 -0
  101. package/types/milestone.type.d.ts +27 -1
  102. package/types/modal.type.d.ts +3 -2
  103. package/types/pager.type.d.ts +5 -1
  104. package/types/picker.type.d.ts +3 -0
  105. package/types/popover.type.d.ts +1 -1
  106. package/types/search.type.d.ts +0 -3
  107. package/types/steps.type.d.ts +1 -0
  108. package/types/tag.type.d.ts +1 -0
  109. package/types/tooltip.type.d.ts +3 -0
  110. package/types/transfer.type.d.ts +3 -3
  111. package/types/tree-menu.type.d.ts +8 -0
  112. package/types/upload-dragger.type.d.ts +1 -1
  113. package/types/{upload-list.type-4194f534.d.ts → upload-list.type-26173587.d.ts} +11 -3
  114. package/types/upload-list.type.d.ts +1 -1
  115. package/types/upload.type.d.ts +1 -1
  116. package/types/user-contact.type.d.ts +127 -1
  117. package/types/user-head.type.d.ts +1 -4
  118. package/upload-list/vue.js +7 -7
  119. package/virtual-scroll-box/index.js +294 -0
  120. package/virtual-scroll-box/vue.js +43 -0
  121. package/virtual-tree/index.js +168 -0
  122. package/virtual-tree/vue.js +53 -0
@@ -254,7 +254,7 @@ const initDisplay = ({ api, constants, props, state, nextTick }) => (value) => {
254
254
  });
255
255
  }
256
256
  };
257
- const openDialog = ({ api, props, state, emit }) => () => {
257
+ const openDialog = ({ api, props, state, emit, nextTick }) => () => {
258
258
  if (state.disabled) {
259
259
  return;
260
260
  }
@@ -264,6 +264,9 @@ const openDialog = ({ api, props, state, emit }) => () => {
264
264
  state.showContent = true;
265
265
  emit("popup");
266
266
  props.autoLookup && props.alwaysLoad && api.query();
267
+ nextTick(() => {
268
+ api.computedTreeMaxHeight();
269
+ });
267
270
  };
268
271
  const localFilter = ({ props, state }) => {
269
272
  const keys = Object.keys(state.search);
@@ -651,10 +654,18 @@ const selectedBoxDrag = ({ props, state }) => ({ state: { select } }) => {
651
654
  state.selectedValues = values;
652
655
  }
653
656
  };
657
+ const computedTreeMaxHeight = ({ vm, state }) => () => {
658
+ var _a;
659
+ const dialogBoxEl = vm.$refs.popeditorDialogBox.$el;
660
+ const searchInputBottom = 20;
661
+ const searchInputHeight = ((_a = dialogBoxEl.querySelector(".tiny-popeditor__filter-input")) == null ? void 0 : _a.clientHeight) || 0;
662
+ state.treeWrapperMaxHeight = `${dialogBoxEl.querySelector(".tiny-dialog-box__body").clientHeight - searchInputHeight - searchInputBottom}px`;
663
+ };
654
664
  export {
655
665
  closeSuggestPanel,
656
666
  computedGetTitle,
657
667
  computedModalWidth,
668
+ computedTreeMaxHeight,
658
669
  computedTreeOp,
659
670
  createSearchForm,
660
671
  doClear,
package/popeditor/vue.js CHANGED
@@ -46,7 +46,8 @@ import {
46
46
  selectedBoxClear,
47
47
  selectedBoxDelete,
48
48
  selectedBoxDrag,
49
- radioChangeFn
49
+ radioChangeFn,
50
+ computedTreeMaxHeight
50
51
  } from "./index";
51
52
  const api = [
52
53
  "state",
@@ -76,7 +77,8 @@ const api = [
76
77
  "selectedBoxClear",
77
78
  "selectedBoxDelete",
78
79
  "selectedBoxDrag",
79
- "radioChangeFn"
80
+ "radioChangeFn",
81
+ "computedTreeMaxHeight"
80
82
  ];
81
83
  const initState = ({ reactive, computed, props, api: api2, constants, t, parent, vm }) => {
82
84
  const state = reactive({
@@ -117,7 +119,8 @@ const initState = ({ reactive, computed, props, api: api2, constants, t, parent,
117
119
  showSuggestPanel: false,
118
120
  inputHover: false,
119
121
  search: null,
120
- closeSuggestPanelInvoker: null
122
+ closeSuggestPanelInvoker: null,
123
+ treeWrapperMaxHeight: "auto"
121
124
  });
122
125
  return state;
123
126
  };
@@ -140,7 +143,7 @@ const initApi = ({ api: api2, props, state, parent, vm, emit, popper, constants,
140
143
  selectedGridSelectAll: selectedGridSelectAll({ constants, props, vm, state }),
141
144
  selectedGridSelectChange: selectedGridSelectChange({ constants, props, vm, state }),
142
145
  handleReset: handleReset({ api: api2, state, props }),
143
- openDialog: openDialog({ api: api2, emit, props, state }),
146
+ openDialog: openDialog({ api: api2, emit, props, state, nextTick }),
144
147
  initDisplay: initDisplay({ api: api2, constants, props, state, nextTick }),
145
148
  handleSearch: handleSearch({ api: api2, props, state, vm, constants }),
146
149
  computedTreeOp: computedTreeOp({ api: api2, constants }),
@@ -167,7 +170,8 @@ const initApi = ({ api: api2, props, state, parent, vm, emit, popper, constants,
167
170
  selectedBoxClear: selectedBoxClear(api2),
168
171
  selectedBoxDelete: selectedBoxDelete(api2),
169
172
  selectedBoxDrag: selectedBoxDrag({ props, state }),
170
- radioChangeFn: radioChangeFn({ props, api: api2 })
173
+ radioChangeFn: radioChangeFn({ props, api: api2 }),
174
+ computedTreeMaxHeight: computedTreeMaxHeight({ vm, state })
171
175
  });
172
176
  state.search = api2.createSearchForm(false);
173
177
  };
@@ -18,8 +18,8 @@ function addMatcherTr({ _quill, oper }) {
18
18
  return delta;
19
19
  });
20
20
  }
21
- function addMatcherTd({ _quill, oper, Delta }) {
22
- _quill.clipboard.addMatcher("TD", function(node, delta) {
21
+ function addMatcherTdOrTh({ _quill, oper, Delta, tagName }) {
22
+ _quill.clipboard.addMatcher(tagName, function(node, delta) {
23
23
  const tableId = oper.getTableId();
24
24
  const rowId = oper.getRowId();
25
25
  const cellId = cellName();
@@ -84,7 +84,8 @@ function addMatcher({ qil: _quill, Delta }) {
84
84
  };
85
85
  addMatcherTable({ _quill, oper });
86
86
  addMatcherTr({ _quill, oper });
87
- addMatcherTd({ _quill, oper, Delta });
87
+ addMatcherTdOrTh({ _quill, oper, Delta, tagName: "TD" });
88
+ addMatcherTdOrTh({ _quill, oper, Delta, tagName: "TH" });
88
89
  addMatcher3(_quill);
89
90
  addMatcherFont(_quill);
90
91
  }
package/roles/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
- import { xss } from "../common";
2
+ import { xss } from "../common/xss";
3
3
  const showList = (state) => () => state.showPopover = true;
4
4
  const show = (state) => () => state.showIcon = false;
5
5
  const hide = (state) => () => state.showIcon = true;
package/select/index.js CHANGED
@@ -495,7 +495,7 @@ const resetInputHeight = ({ constants, nextTick, props, vm, state, api, designCo
495
495
  return;
496
496
  }
497
497
  nextTick(() => {
498
- var _a;
498
+ var _a, _b;
499
499
  if (!vm.$refs.reference) {
500
500
  return;
501
501
  }
@@ -508,9 +508,9 @@ const resetInputHeight = ({ constants, nextTick, props, vm, state, api, designCo
508
508
  if (!state.isDisplayOnly && (props.hoverExpand || props.clickExpand) && !props.disabled) {
509
509
  api.calcCollapseTags();
510
510
  }
511
- const sizeInMap = (designConfig == null ? void 0 : designConfig.state.initialInputHeight) || Math.round(state.initialInputHeight) || (state.isSaaSTheme ? 28 : 30);
511
+ const sizeInMap = (designConfig == null ? void 0 : designConfig.state.initialInputHeight) || Math.round(state.initialInputHeight) || 32;
512
512
  const noSelected = state.selected.length === 0;
513
- const spacingHeight = designConfig ? (_a = designConfig.state) == null ? void 0 : _a.spacingHeight : constants.SPACING_HEIGHT;
513
+ const spacingHeight = (_b = (_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.spacingHeight) != null ? _b : constants.SPACING_HEIGHT;
514
514
  if (!state.isDisplayOnly) {
515
515
  if (!noSelected && tags) {
516
516
  fastdom.measure(() => {
@@ -1431,7 +1431,7 @@ const mounted = ({ api, parent, state, props, vm, designConfig }) => () => {
1431
1431
  document.activeElement.blur();
1432
1432
  }
1433
1433
  state.completed = true;
1434
- const defaultSizeMap = { default: 28, mini: 24, small: 32, medium: 40 };
1434
+ const defaultSizeMap = { default: 32, mini: 24, small: 36, medium: 40 };
1435
1435
  const sizeMap = ((_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.sizeMap) || defaultSizeMap;
1436
1436
  if (props.multiple && Array.isArray(props.modelValue) && props.modelValue.length > 0) {
1437
1437
  state.currentPlaceholder = "";
@@ -1487,7 +1487,7 @@ const optmzApis = {
1487
1487
  vm.$refs.scrollbar.$el.querySelectorAll(
1488
1488
  '.tiny-recycle-scroller__slot, .tiny-recycle-scroller__item-view:not([style*="transform: translateY(-9999px) translateX(0px)"])'
1489
1489
  )
1490
- ).map((item) => item.querySelector(`[data-tag="tiny-select-dropdown-item"]:not(${querySelectKey})`)).filter((v) => v);
1490
+ ).map((item) => item.querySelector(`[data-tag="tiny-option"]:not(${querySelectKey})`)).filter((v) => v);
1491
1491
  },
1492
1492
  setScrollTop: ({ refs, state }) => {
1493
1493
  const { optimizeStore } = state;
@@ -1642,7 +1642,7 @@ const computedShowTagText = ({ state }) => () => state.isDisplayOnly;
1642
1642
  const isTagClosable = () => (item) => !item.required;
1643
1643
  const computedGetIcon = ({ designConfig, props }) => () => {
1644
1644
  return props.dropdownIcon ? { icon: props.dropdownIcon } : {
1645
- icon: (designConfig == null ? void 0 : designConfig.icons.dropdownIcon) || "icon-delta-down",
1645
+ icon: (designConfig == null ? void 0 : designConfig.icons.dropdownIcon) || "icon-down-ward",
1646
1646
  isDefault: true
1647
1647
  };
1648
1648
  };
package/select/vue.js CHANGED
@@ -238,7 +238,8 @@ const initState = ({ reactive, computed, props, api: api2, emitter, parent, cons
238
238
  return designConfig.state.autoHideDownIcon;
239
239
  }
240
240
  return true;
241
- })()
241
+ })(),
242
+ designConfig
242
243
  }));
243
244
  return state;
244
245
  };
@@ -52,7 +52,8 @@ const renderless = (props, { reactive, computed, onBeforeMount, onMounted, onBef
52
52
  popoverContent: "",
53
53
  dragInstance: null,
54
54
  slotParams: computed(() => ({ inverse: state.inverse, total: state.total, select: state.select })),
55
- showClear: computed(() => api2.computedShowClear())
55
+ showClear: computed(() => api2.computedShowClear()),
56
+ theme: vm.theme
56
57
  });
57
58
  const api2 = {
58
59
  state,
package/slider/index.js CHANGED
@@ -478,9 +478,9 @@ const handleSlotInput = ({ state, api }) => (event, isLeftInput = true) => {
478
478
  state.activeValue = Number(inputValue);
479
479
  api.updateSlotValue();
480
480
  };
481
- const inputOnChange = ({ api, emit, props, state }) => (event) => {
481
+ const inputOnChange = ({ api, emit, props, state }) => (currentValue) => {
482
482
  if (!props.changeCompat) {
483
- if (!/^\d+$/.test(event.target.value)) {
483
+ if (!/^\d+$/.test(currentValue)) {
484
484
  state.activeValue = state.leftBtnValue;
485
485
  return;
486
486
  }
@@ -53,8 +53,9 @@ const renderless = (props, { reactive, provide, onMounted, onBeforeUnmount, watc
53
53
  api2.watchSliderButtonChange();
54
54
  });
55
55
  onBeforeUnmount(() => {
56
- mutationObserver == null ? void 0 : mutationObserver.disconnect();
57
- intersectionObserver == null ? void 0 : intersectionObserver.disconnect();
56
+ var _a, _b;
57
+ (_a = state.mutationObserver) == null ? void 0 : _a.disconnect();
58
+ (_b = state.intersectionObserver) == null ? void 0 : _b.disconnect();
58
59
  });
59
60
  watch(
60
61
  () => props.modelValue,
package/split/vue.js CHANGED
@@ -18,7 +18,8 @@ import {
18
18
  } from "./index";
19
19
  import { on, off } from "../common/deps/dom";
20
20
  const api = ["state", "handleMousedown", "buttonMousedown", "buttonLeftTopClick", "buttonRightBottomClick"];
21
- const renderless = (props, hooks, { vm, nextTick, emit, constants }) => {
21
+ const renderless = (props, hooks, { vm, nextTick, emit, constants, designConfig }) => {
22
+ var _a;
22
23
  const api2 = {};
23
24
  const { computed, reactive } = hooks;
24
25
  const getUseOffset = useOffset({ nextTick, props, vm, constants, hooks });
@@ -39,7 +40,8 @@ const renderless = (props, hooks, { vm, nextTick, emit, constants }) => {
39
40
  paneClasses: computed(() => [
40
41
  `${state.prefix}-pane ${props.scrollable ? "tiny-split-scroll" : ""}`,
41
42
  { [`${state.prefix}-pane-moving`]: state.isMoving }
42
- ])
43
+ ]),
44
+ triggerBarConWithLine: (_a = designConfig == null ? void 0 : designConfig.triggerBarConWithLine) != null ? _a : true
43
45
  }, getUseOffset.state));
44
46
  Object.assign(api2, __spreadProps(__spreadValues({
45
47
  state,
@@ -0,0 +1,89 @@
1
+ import "../chunk-G2ADBYYC.js";
2
+ const computedRootStyle = ({ props, state }) => () => {
3
+ return {
4
+ height: state.isFixed ? `${state.rootHeight}px` : "",
5
+ width: state.isFixed ? `${state.rootWidth}px` : ""
6
+ };
7
+ };
8
+ const computedStickyStyle = ({ props, state }) => () => {
9
+ if (!state.isFixed)
10
+ return {};
11
+ const offset = props.offset ? typeof props.offset === "number" ? props.offset + "px" : props.offset : 0;
12
+ return {
13
+ height: `${state.rootHeight}px`,
14
+ width: `${state.rootWidth}px`,
15
+ top: props.position === "top" ? offset : "",
16
+ bottom: props.position === "bottom" ? offset : "",
17
+ transform: state.transform ? `translateY(${state.transform}px)` : "",
18
+ zIndex: props.zIndex
19
+ };
20
+ };
21
+ const updateRoot = ({ props, state, emit, api }) => () => {
22
+ if (!state.scrollParent || !state.target)
23
+ return;
24
+ api.getRootRect();
25
+ state.scrollTop = state.scrollParent instanceof Window ? document.documentElement.scrollTop : state.scrollParent.scrollTop || 0;
26
+ if (props.target) {
27
+ state.targetRect = api.useRect(state.target);
28
+ }
29
+ if (props.position === "top") {
30
+ if (props.target) {
31
+ const difference = state.targetRect.bottom - state.offset - state.rootHeight;
32
+ state.isFixed = state.offset > state.rootTop && state.targetRect.bottom > 0;
33
+ state.transform = difference < 0 ? difference : 0;
34
+ } else {
35
+ state.isFixed = state.offset > state.rootTop;
36
+ }
37
+ } else if (props.target) {
38
+ const difference = state.windowHeight - state.targetRect.top - state.offset - state.rootHeight;
39
+ state.isFixed = state.windowHeight - state.offset < state.rootBottom && state.windowHeight > state.targetRect.top;
40
+ state.transform = difference < 0 ? -difference : 0;
41
+ } else {
42
+ state.isFixed = state.windowHeight - state.offset < state.rootBottom;
43
+ }
44
+ emit("scroll", { scrollTop: state.scrollTop, isFixed: state.isFixed });
45
+ };
46
+ const getRootRect = ({ state, vm, api }) => () => {
47
+ const rootRect = api.useRect(vm.$refs.root);
48
+ state.rootHeight = rootRect.height;
49
+ state.rootWidth = rootRect.width;
50
+ state.rootTop = rootRect.top;
51
+ state.rootBottom = rootRect.bottom;
52
+ };
53
+ const getTarget = ({ state, props, api }) => () => {
54
+ var _a;
55
+ if (props.target) {
56
+ state.target = (_a = document.querySelector(props.target)) != null ? _a : void 0;
57
+ if (state.target) {
58
+ state.targetRect = api.useRect(state.target);
59
+ } else {
60
+ throw new Error(`[AUI Error][aui-sticky] Target does not exist: ${props.target}`);
61
+ }
62
+ } else {
63
+ state.target = document.documentElement;
64
+ }
65
+ };
66
+ const unitToPx = () => (value) => {
67
+ if (typeof value === "number") {
68
+ return value;
69
+ }
70
+ if (value.endsWith("rem")) {
71
+ const rootFontSize = parseFloat(window.getComputedStyle(document.documentElement).fontSize);
72
+ return parseFloat(value) * rootFontSize;
73
+ }
74
+ if (value.endsWith("vh")) {
75
+ return parseFloat(value) / 100 * window.innerHeight;
76
+ }
77
+ if (value.endsWith("vw")) {
78
+ return parseFloat(value) / 100 * window.innerWidth;
79
+ }
80
+ return parseFloat(value);
81
+ };
82
+ export {
83
+ computedRootStyle,
84
+ computedStickyStyle,
85
+ getRootRect,
86
+ getTarget,
87
+ unitToPx,
88
+ updateRoot
89
+ };
package/sticky/vue.js ADDED
@@ -0,0 +1,74 @@
1
+ import "../chunk-G2ADBYYC.js";
2
+ import { useRect } from "../common/deps/useRect";
3
+ import { useWindowSize } from "../common/deps/useWindowSize";
4
+ import { useEventListener } from "../common/deps/useEventListener";
5
+ import { useScrollParent } from "../common/deps/dom";
6
+ import { computedRootStyle, computedStickyStyle, updateRoot, unitToPx, getRootRect, getTarget } from "./index";
7
+ const api = ["state"];
8
+ const renderless = (props, hooks, { vm, emit }) => {
9
+ const { reactive, computed, unref, ref, toRef, onMounted, watch } = hooks;
10
+ const state = reactive({
11
+ root: null,
12
+ target: null,
13
+ windowHeight: 0,
14
+ windowWidth: 0,
15
+ rootHeight: 0,
16
+ rootWidth: 0,
17
+ rootTop: 0,
18
+ rootBottom: 0,
19
+ isFixed: false,
20
+ scrollTop: 0,
21
+ transform: 0,
22
+ scrollParent: null,
23
+ targetRect: null,
24
+ offset: 0,
25
+ rootStyle: computed(() => api2.computedRootStyle()),
26
+ stickyStyle: computed(() => api2.computedStickyStyle())
27
+ });
28
+ const api2 = {};
29
+ Object.assign(api2, {
30
+ state,
31
+ computedRootStyle: computedRootStyle({ props, state }),
32
+ computedStickyStyle: computedStickyStyle({ props, state }),
33
+ updateRoot: updateRoot({ props, state, emit, api: api2 }),
34
+ getRootRect: getRootRect({ vm, state, api: api2 }),
35
+ getTarget: getTarget({ props, state, api: api2 }),
36
+ useEventListener: useEventListener(hooks),
37
+ useScrollParent: useScrollParent(hooks),
38
+ useWindowSize: useWindowSize(ref),
39
+ useRect: useRect(unref),
40
+ unitToPx: unitToPx()
41
+ });
42
+ watch(
43
+ () => state.isFixed,
44
+ (value) => {
45
+ emit("change", value);
46
+ }
47
+ );
48
+ watch(
49
+ () => props.offset,
50
+ (value) => {
51
+ state.offset = api2.unitToPx(value);
52
+ api2.updateRoot();
53
+ },
54
+ { immediate: true }
55
+ );
56
+ const { width, height } = api2.useWindowSize();
57
+ state.windowHeight = height;
58
+ state.windowWidth = width;
59
+ state.scrollParent = api2.useScrollParent(toRef(state, "root"));
60
+ api2.useEventListener("scroll", api2.updateRoot, { target: toRef(state, "scrollParent"), passive: true });
61
+ onMounted(() => {
62
+ state.root = vm.$refs.root;
63
+ setTimeout(() => {
64
+ api2.getTarget();
65
+ api2.getRootRect();
66
+ api2.updateRoot();
67
+ });
68
+ });
69
+ return api2;
70
+ };
71
+ export {
72
+ api,
73
+ renderless
74
+ };
@@ -1,6 +1,6 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
2
  import { getRouteActive, onClick, bindChildren, routeTab, getTabbarItemsWidth } from "./index";
3
- import { xss } from "../common";
3
+ import { xss } from "../common/xss";
4
4
  const api = ["state", "onClick", "getTabbarItemsWidth"];
5
5
  const renderless = (props, { computed, onMounted, reactive, inject }, { parent, emit, nextTick, route, router, dispatch, vm }) => {
6
6
  const api2 = {};
@@ -92,7 +92,7 @@ const setLocalStorageage = (name, value, memorySpace = 5) => {
92
92
  }
93
93
  };
94
94
  const addMemory = (props) => (value) => {
95
- if (props.name && value) {
95
+ if (props.name && (value == null ? void 0 : value.trim())) {
96
96
  setLocalStorageage(props.name, value, props.memorySpace);
97
97
  }
98
98
  };
package/time/vue.js CHANGED
@@ -38,10 +38,11 @@ const initState = ({ reactive, props, computed, api: api2 }) => {
38
38
  return state;
39
39
  };
40
40
  const renderless = (props, { computed, onMounted, reactive, watch, nextTick }, { t, emit: $emit, vm, designConfig }) => {
41
+ var _a;
41
42
  const api2 = {};
42
43
  const emit = props.emitter ? props.emitter.emit : $emit;
43
44
  const state = initState({ reactive, props, computed, api: api2 });
44
- state.showTimePickerButton = designConfig == null ? void 0 : designConfig.showTimePickerButton;
45
+ state.showTimePickerButton = (_a = designConfig == null ? void 0 : designConfig.showTimePickerButton) != null ? _a : true;
45
46
  Object.assign(api2, {
46
47
  t,
47
48
  state,
package/time-range/vue.js CHANGED
@@ -41,6 +41,7 @@ const initState = ({ reactive, computed, vm, api: api2 }) => {
41
41
  arrowControl: false,
42
42
  maxDate: /* @__PURE__ */ new Date(),
43
43
  minDate: /* @__PURE__ */ new Date(),
44
+ showTimePickerRangeButton: false,
44
45
  showSeconds: computed(() => (state.format || "").includes("ss")),
45
46
  offset: computed(() => state.showSeconds ? 11 : 8),
46
47
  spinner: computed(() => state.selectionRange[0] < state.offset ? vm.$refs.minSpinner : vm.$refs.maxSpinner),
@@ -49,12 +50,14 @@ const initState = ({ reactive, computed, vm, api: api2 }) => {
49
50
  });
50
51
  return state;
51
52
  };
52
- const renderless = (props, { computed, reactive, watch, nextTick }, { t, vm, emit: $emit }) => {
53
+ const renderless = (props, { computed, reactive, watch, nextTick }, { t, vm, emit: $emit, designConfig }) => {
54
+ var _a;
53
55
  const api2 = {};
54
56
  const emit = props.emitter ? props.emitter.emit : $emit;
55
57
  const MIN_TIME = parseDate("00:00:00", "HH:mm:ss", t);
56
58
  const MAX_TIME = parseDate("23:59:59", "HH:mm:ss", t);
57
59
  const state = initState({ reactive, computed, vm, api: api2 });
60
+ state.showTimePickerRangeButton = (_a = designConfig == null ? void 0 : designConfig.showTimePickerRangeButton) != null ? _a : true;
58
61
  Object.assign(api2, {
59
62
  t,
60
63
  state,
@@ -193,7 +193,10 @@ const amPm = (props) => (hour) => {
193
193
  }
194
194
  return content;
195
195
  };
196
- const typeItemHeight = ({ vm, designConfig }) => (type) => vm.$refs[type].$el.querySelector(DATEPICKER.Qurtyli).offsetHeight + ((designConfig == null ? void 0 : designConfig.itemMarginSpace) || 0);
196
+ const typeItemHeight = ({ vm, designConfig }) => (type) => {
197
+ var _a;
198
+ return vm.$refs[type].$el.querySelector(DATEPICKER.Qurtyli).offsetHeight + ((_a = designConfig == null ? void 0 : designConfig.itemMarginSpace) != null ? _a : 12);
199
+ };
197
200
  const scrollBarHeight = (vm) => (type) => vm.$refs[type].$el.offsetHeight;
198
201
  export {
199
202
  adjustCurrentSpinner,
@@ -1,5 +1,5 @@
1
1
  import "../chunk-G2ADBYYC.js";
2
- import { xss } from "../common/xss.js";
2
+ import { xss } from "../common/xss";
3
3
  import { isObject } from "../common/type";
4
4
  const filterNode = (props) => (value, data) => {
5
5
  const node = data[props.props.label || "label"] || "";
@@ -36,12 +36,12 @@ const api = [
36
36
  "selectChange",
37
37
  "handlePageChange"
38
38
  ];
39
- const initState = ({ reactive, props, parent, computed, api: api2, slots }) => {
39
+ const initState = ({ reactive, props, parent, computed, api: api2, slots, designConfig }) => {
40
+ var _a;
40
41
  const state = reactive({
41
42
  query: "",
42
43
  checked: [],
43
44
  allChecked: false,
44
- inputHover: false,
45
45
  internalPage: props.pagerOp.pageVO.currentPage || 1,
46
46
  pagerTotal: 0,
47
47
  pageChangeData: parent.state.isToLeft,
@@ -54,14 +54,15 @@ const initState = ({ reactive, props, parent, computed, api: api2, slots }) => {
54
54
  checkedSummary: computed(() => api2.getCheckedSummary()),
55
55
  isIndeterminate: computed(() => api2.getDeteminate()),
56
56
  hasNoMatch: computed(() => state.query.length > 0 && state.filteredData.length === 0),
57
- inputIcon: computed(() => state.query.length > 0 && state.inputHover ? "circle-close" : "search"),
58
57
  labelProp: computed(() => props.props.label || "label"),
59
58
  keyProp: computed(() => props.props.key || "key"),
60
59
  disabledProp: computed(() => props.props.disabled || "disabled"),
61
60
  childrenProp: computed(() => props.treeOp && props.treeOp.props && props.treeOp.props.childern || "children"),
62
61
  hasFooter: computed(() => (!!parent.slots["left-footer"] || !!parent.slots["right-footer"]) && !!slots.default),
63
62
  renderType: computed(() => props.render && props.render.plugin.name),
64
- expanded: []
63
+ expanded: [],
64
+ inputBoxType: (designConfig == null ? void 0 : designConfig.inputBoxType) || "underline",
65
+ showInputSearch: (_a = designConfig == null ? void 0 : designConfig.showInputSearch) != null ? _a : true
65
66
  });
66
67
  return state;
67
68
  };
@@ -113,11 +114,11 @@ const initWatcher = ({ watch, state, api: api2, props, Table }) => {
113
114
  }
114
115
  );
115
116
  };
116
- const renderless = (props, { computed, reactive, watch, toRaw }, { $prefix, emit, parent, vm, slots }) => {
117
+ const renderless = (props, { computed, reactive, watch, toRaw }, { $prefix, emit, parent, vm, slots, designConfig }) => {
117
118
  const api2 = {};
118
119
  const Table = $prefix + "Table";
119
120
  const Tree = $prefix + "Tree";
120
- const state = initState({ reactive, props, parent, computed, api: api2, slots });
121
+ const state = initState({ reactive, props, parent, computed, api: api2, slots, designConfig });
121
122
  Object.assign(api2, {
122
123
  state,
123
124
  toRaw,
package/tree/index.js CHANGED
@@ -86,7 +86,7 @@ const setDropIndicatorTop = (dropNode, parent, dropType) => {
86
86
  }
87
87
  dropType === "inner" ? addClass(dropNode.$el, "is-drop-inner") : removeClass(dropNode.$el, "is-drop-inner");
88
88
  };
89
- const getDragDir = ({ draggingNode, dropNode, allowDrop, emit, dragState }) => {
89
+ const getDragDir = ({ draggingNode, dropNode, allowDrop, emit, dragState, event: event2 }) => {
90
90
  let dropPrev = true;
91
91
  let dropInner = true;
92
92
  let dropNext = true;
@@ -97,10 +97,10 @@ const getDragDir = ({ draggingNode, dropNode, allowDrop, emit, dragState }) => {
97
97
  userAllowDropInner = dropInner = allowDrop(draggingNode.node, dropNode.node, "inner");
98
98
  dropNext = allowDrop(draggingNode.node, dropNode.node, "next");
99
99
  }
100
- event.dataTransfer.dropEffect = dropInner ? "copy" : "none";
100
+ event2.dataTransfer.dropEffect = dropInner ? "copy" : "none";
101
101
  if ((dropPrev || dropInner || dropNext) && oldDropNode !== dropNode) {
102
- oldDropNode && emit("node-drag-leave", draggingNode.node, oldDropNode.node, event);
103
- emit("node-drag-enter", draggingNode.node, dropNode.node, event);
102
+ oldDropNode && emit("node-drag-leave", draggingNode.node, oldDropNode.node, event2);
103
+ emit("node-drag-enter", draggingNode.node, dropNode.node, event2);
104
104
  }
105
105
  if (dropPrev || dropInner || dropNext) {
106
106
  dragState.dropNode = dropNode;
@@ -136,7 +136,8 @@ const dragOver = ({ state, emit, props, vm }) => (event2, dropNode) => {
136
136
  dropNode,
137
137
  allowDrop: props.allowDrop,
138
138
  emit,
139
- dragState
139
+ dragState,
140
+ event: event2
140
141
  });
141
142
  const dropType = getDropType(dropPrev, dropInner, dropNext, dropNode);
142
143
  setDropIndicatorTop(dropNode, vm, dropType);
@@ -397,7 +398,7 @@ const initTabIndex = ({ vm, state }) => () => {
397
398
  }
398
399
  state.treeItems[0] && state.treeItems[0].setAttribute("tabindex", 0);
399
400
  };
400
- const handleKeydown = ({ vm, state }) => (event2) => {
401
+ const handleKeydown = ({ vm, state, TreeAdapter }) => (event2) => {
401
402
  const currentItem = event2.target;
402
403
  if (!JSON.stringify(currentItem.className).includes("tiny-tree-node")) {
403
404
  return;
@@ -413,7 +414,16 @@ const handleKeydown = ({ vm, state }) => (event2) => {
413
414
  } else {
414
415
  nextIndex = currentIndex < state.treeItemArray.length - 1 ? currentIndex + 1 : 0;
415
416
  }
416
- state.treeItemArray[nextIndex].focus();
417
+ const treeNode = state.treeItemArray[nextIndex];
418
+ if (TreeAdapter) {
419
+ const nodeContent = treeNode.querySelector("div.tiny-tree-node__content");
420
+ treeNode.focus({ preventScroll: true });
421
+ if (nodeContent && nodeContent.scrollIntoView) {
422
+ nodeContent.scrollIntoView({ behavior: "instant", block: "nearest", inline: "nearest" });
423
+ }
424
+ } else {
425
+ treeNode.focus();
426
+ }
417
427
  } else if ([KEY_CODE.ArrowLeft, KEY_CODE.ArrowRight].includes(keyCode)) {
418
428
  event2.preventDefault();
419
429
  currentItem.click();
package/tree/vue.js CHANGED
@@ -118,7 +118,7 @@ const api = [
118
118
  "handleClickPlainNode",
119
119
  "setCheckedByNodeKey"
120
120
  ];
121
- const initState = ({ reactive, emitter, props, computed, api: api2 }) => {
121
+ const initState = ({ reactive, emitter, props, computed, api: api2, TreeAdapter }) => {
122
122
  const state = reactive({
123
123
  loaded: !props.lazy,
124
124
  checkEasily: false,
@@ -164,13 +164,16 @@ const initState = ({ reactive, emitter, props, computed, api: api2 }) => {
164
164
  newNodeId: Math.floor(random() * 1e4),
165
165
  plainNodeStore: {},
166
166
  allNodeKeys: [],
167
+ renderedChildNodes: computed(() => {
168
+ return state.root.childNodes.filter((childNode) => TreeAdapter ? TreeAdapter.shouldRender(childNode) : true);
169
+ }),
167
170
  // tiny 新增
168
171
  filterText: ""
169
172
  // 记录当前过滤的内容
170
173
  });
171
174
  return state;
172
175
  };
173
- const initApi = ({ state, dispatch, broadcast, props, vm, constants, t, emit, api: api2 }) => ({
176
+ const initApi = ({ state, dispatch, broadcast, props, vm, constants, t, emit, api: api2, TreeAdapter }) => ({
174
177
  state,
175
178
  dispatch,
176
179
  broadcast,
@@ -203,7 +206,7 @@ const initApi = ({ state, dispatch, broadcast, props, vm, constants, t, emit, ap
203
206
  insertAfter: insertAfter(state),
204
207
  updateKeyChildren: updateKeyChildren({ props, state }),
205
208
  initTabIndex: initTabIndex({ vm, state }),
206
- handleKeydown: handleKeydown({ vm, state }),
209
+ handleKeydown: handleKeydown({ vm, state, TreeAdapter }),
207
210
  computedShowEmptyText: computedShowEmptyText({ constants, t }),
208
211
  setCurrentRadio: setCurrentRadio({ props, state }),
209
212
  expandAllNodes: expandAllNodes({ state }),
@@ -238,11 +241,12 @@ const initWatcher = ({ watch, props, api: api2, state, isVue2 }) => {
238
241
  { immediate: true }
239
242
  );
240
243
  };
241
- const renderless = (props, { computed, onMounted, onUpdated, reactive, watch, provide, onBeforeUnmount }, { vm, t, emit, constants, broadcast, dispatch, service, emitter, nextTick }, { isVue2 }) => {
244
+ const renderless = (props, { computed, onMounted, onUpdated, reactive, watch, provide, onBeforeUnmount, inject }, { vm, t, emit, constants, broadcast, dispatch, service, emitter, nextTick }, { isVue2 }) => {
242
245
  const api2 = {};
243
- const state = initState({ reactive, emitter, props, computed, api: api2 });
246
+ const TreeAdapter = inject("TreeAdapter", null);
247
+ const state = initState({ reactive, emitter, props, computed, api: api2, TreeAdapter });
244
248
  provide("parentEmitter", state.emitter);
245
- Object.assign(api2, initApi({ state, dispatch, broadcast, props, vm, constants, t, emit, api: api2 }), {
249
+ Object.assign(api2, initApi({ state, dispatch, broadcast, props, vm, constants, t, emit, api: api2, TreeAdapter }), {
246
250
  closeMenu: closeMenu(state),
247
251
  mounted: mounted({ api: api2, vm }),
248
252
  created: created({ api: api2, props, state }),
@@ -234,8 +234,8 @@ const computedExpandIcon = ({ designConfig }) => (treeRoot, state) => {
234
234
  return state.tree.icon;
235
235
  }
236
236
  if (treeRoot.showLine) {
237
- const expandIcon = ((_a = designConfig == null ? void 0 : designConfig.icons) == null ? void 0 : _a.expanded) || "icon-minus-square";
238
- const collapseIcon = ((_b = designConfig == null ? void 0 : designConfig.icons) == null ? void 0 : _b.collapse) || "icon-plus-square";
237
+ const expandIcon = ((_a = designConfig == null ? void 0 : designConfig.icons) == null ? void 0 : _a.expanded) || "icon-expand";
238
+ const collapseIcon = ((_b = designConfig == null ? void 0 : designConfig.icons) == null ? void 0 : _b.collapse) || "icon-put-away";
239
239
  return state.expanded ? expandIcon : collapseIcon;
240
240
  }
241
241
  return "icon-chevron-right";