@uzum-tech/ui 2.0.6 → 2.0.8
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.
- package/dist/index.js +159 -87
- package/dist/index.mjs +159 -87
- package/dist/index.prod.js +2 -2
- package/dist/index.prod.mjs +2 -2
- package/es/_internal/icons/index.d.ts +0 -1
- package/es/_internal/icons/index.mjs +0 -1
- package/es/components.d.ts +74 -31
- package/es/tree/src/Tree.d.ts +49 -24
- package/es/tree/src/Tree.mjs +18 -13
- package/es/tree/src/TreeNodeCheckbox.d.ts +4 -0
- package/es/tree/src/TreeNodeSwitcher.mjs +24 -26
- package/es/tree/src/styles/index.cssr.mjs +11 -8
- package/es/tree/styles/light.d.ts +4 -0
- package/es/tree/styles/light.mjs +2 -0
- package/es/tree-select/index.d.ts +1 -1
- package/es/tree-select/src/TreeSelect.d.ts +52 -17
- package/es/tree-select/src/TreeSelect.mjs +78 -45
- package/es/tree-select/src/interface.d.ts +7 -1
- package/es/tree-select/src/scroll-option-end.d.ts +3 -0
- package/es/tree-select/src/scroll-option-end.mjs +28 -0
- package/es/tree-select/styles/light.d.ts +2 -0
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/lib/_internal/icons/index.d.ts +0 -1
- package/lib/_internal/icons/index.js +1 -3
- package/lib/components.d.ts +74 -31
- package/lib/tree/src/Tree.d.ts +49 -24
- package/lib/tree/src/Tree.js +16 -15
- package/lib/tree/src/TreeNodeCheckbox.d.ts +4 -0
- package/lib/tree/src/TreeNodeSwitcher.js +11 -14
- package/lib/tree/src/styles/index.cssr.js +11 -8
- package/lib/tree/styles/light.d.ts +4 -0
- package/lib/tree/styles/light.js +2 -0
- package/lib/tree-select/index.d.ts +1 -1
- package/lib/tree-select/src/TreeSelect.d.ts +52 -17
- package/lib/tree-select/src/TreeSelect.js +79 -49
- package/lib/tree-select/src/interface.d.ts +7 -1
- package/lib/tree-select/src/scroll-option-end.d.ts +3 -0
- package/lib/tree-select/src/scroll-option-end.js +30 -0
- package/lib/tree-select/styles/light.d.ts +2 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +5 -4
- package/web-types.json +41 -1
- package/es/_internal/icons/Switcher.d.ts +0 -2
- package/es/_internal/icons/Switcher.mjs +0 -12
- package/lib/_internal/icons/Switcher.d.ts +0 -2
- package/lib/_internal/icons/Switcher.js +0 -10
package/dist/index.mjs
CHANGED
|
@@ -11170,7 +11170,7 @@ function setCacheAdd(value) {
|
|
|
11170
11170
|
* @name has
|
|
11171
11171
|
* @memberOf SetCache
|
|
11172
11172
|
* @param {*} value The value to search for.
|
|
11173
|
-
* @returns {
|
|
11173
|
+
* @returns {boolean} Returns `true` if `value` is found, else `false`.
|
|
11174
11174
|
*/
|
|
11175
11175
|
function setCacheHas(value) {
|
|
11176
11176
|
return this.__data__.has(value);
|
|
@@ -14806,13 +14806,6 @@ var SuccessIcon = replaceable(
|
|
|
14806
14806
|
))
|
|
14807
14807
|
);
|
|
14808
14808
|
|
|
14809
|
-
var SwitcherIcon = defineComponent({
|
|
14810
|
-
name: "Switcher",
|
|
14811
|
-
render() {
|
|
14812
|
-
return /* @__PURE__ */ h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" }, /* @__PURE__ */ h("path", { d: "M12 8l10 8l-10 8z" }));
|
|
14813
|
-
}
|
|
14814
|
-
});
|
|
14815
|
-
|
|
14816
14809
|
var TimeIcon = replaceable(
|
|
14817
14810
|
"time",
|
|
14818
14811
|
/* @__PURE__ */ h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512" }, /* @__PURE__ */ h(
|
|
@@ -49217,6 +49210,8 @@ function self$g(vars) {
|
|
|
49217
49210
|
nodeColorPressed: elementsQuaternary,
|
|
49218
49211
|
nodeColorActive: brandPrimary100,
|
|
49219
49212
|
arrowColor: elementsPrimary,
|
|
49213
|
+
switcherColor: elementsTertiary,
|
|
49214
|
+
switcherSize: "22px",
|
|
49220
49215
|
nodeTextColor: textPrimary,
|
|
49221
49216
|
nodeTextColorDisabled: textSecondary,
|
|
49222
49217
|
loadingColor: elementsPrimary,
|
|
@@ -108199,6 +108194,16 @@ var UTreeNodeSwitcher = defineComponent({
|
|
|
108199
108194
|
treeInjectionKey,
|
|
108200
108195
|
null
|
|
108201
108196
|
);
|
|
108197
|
+
const renderSwitchIcon = () => {
|
|
108198
|
+
const { value: renderSwitcherIcon } = renderSwitcherIconRef;
|
|
108199
|
+
return /* @__PURE__ */ h(UIconSwitchTransition, null, {
|
|
108200
|
+
default: () => renderSwitcherIcon ? renderSwitcherIcon({
|
|
108201
|
+
expanded: props.expanded,
|
|
108202
|
+
selected: props.selected,
|
|
108203
|
+
option: props.tmNode.rawNode
|
|
108204
|
+
}) : /* @__PURE__ */ h(UBaseIcon, { clsPrefix: props.clsPrefix, key: "switcher" }, { default: () => /* @__PURE__ */ h(ChevronRightIcon, null) })
|
|
108205
|
+
});
|
|
108206
|
+
};
|
|
108202
108207
|
return () => {
|
|
108203
108208
|
const { clsPrefix, expanded, hide, indent, onClick } = props;
|
|
108204
108209
|
return /* @__PURE__ */ h(
|
|
@@ -108213,28 +108218,16 @@ var UTreeNodeSwitcher = defineComponent({
|
|
|
108213
108218
|
style: { width: `${indent}px` },
|
|
108214
108219
|
onClick
|
|
108215
108220
|
},
|
|
108216
|
-
/* @__PURE__ */ h("div", { class: `${clsPrefix}-tree-node-switcher__icon` }, /* @__PURE__ */ h(
|
|
108217
|
-
|
|
108218
|
-
|
|
108219
|
-
|
|
108220
|
-
|
|
108221
|
-
|
|
108222
|
-
|
|
108223
|
-
|
|
108224
|
-
radius: 85,
|
|
108225
|
-
strokeWidth: 20,
|
|
108226
|
-
...spinPropsRef?.value
|
|
108227
|
-
}
|
|
108228
|
-
);
|
|
108229
|
-
}
|
|
108230
|
-
const { value: renderSwitcherIcon } = renderSwitcherIconRef;
|
|
108231
|
-
return renderSwitcherIcon ? renderSwitcherIcon({
|
|
108232
|
-
expanded: props.expanded,
|
|
108233
|
-
selected: props.selected,
|
|
108234
|
-
option: props.tmNode.rawNode
|
|
108235
|
-
}) : /* @__PURE__ */ h(UBaseIcon, { clsPrefix, key: "switcher" }, { default: () => /* @__PURE__ */ h(SwitcherIcon, null) });
|
|
108221
|
+
/* @__PURE__ */ h("div", { class: `${clsPrefix}-tree-node-switcher__icon` }, props.loading ? /* @__PURE__ */ h(
|
|
108222
|
+
UBaseLoading,
|
|
108223
|
+
{
|
|
108224
|
+
clsPrefix,
|
|
108225
|
+
key: "loading",
|
|
108226
|
+
radius: 85,
|
|
108227
|
+
strokeWidth: 20,
|
|
108228
|
+
...spinPropsRef?.value
|
|
108236
108229
|
}
|
|
108237
|
-
|
|
108230
|
+
) : renderSwitchIcon())
|
|
108238
108231
|
);
|
|
108239
108232
|
};
|
|
108240
108233
|
}
|
|
@@ -108922,19 +108915,20 @@ var style$3 = cB("tree", `
|
|
|
108922
108915
|
vertical-align: bottom;
|
|
108923
108916
|
`, [cE("icon", `
|
|
108924
108917
|
position: relative;
|
|
108925
|
-
height:
|
|
108926
|
-
width:
|
|
108918
|
+
height: var(--u-switcher-size);
|
|
108919
|
+
width: var(--u-switcher-size);
|
|
108927
108920
|
display: flex;
|
|
108921
|
+
align-items: center;
|
|
108922
|
+
justify-content: center;
|
|
108923
|
+
border-radius: 50%;
|
|
108928
108924
|
color: var(--u-arrow-color);
|
|
108929
|
-
|
|
108925
|
+
background-color: var(--u-switcher-color);
|
|
108926
|
+
transition:
|
|
108927
|
+
color .3s var(--u-bezier),
|
|
108928
|
+
background-color .3s var(--u-bezier);
|
|
108930
108929
|
font-size: 14px;
|
|
108931
108930
|
`, [cB("icon", [iconSwitchTransitionNode]), cB("base-loading", `
|
|
108932
108931
|
color: var(--u-loading-color);
|
|
108933
|
-
position: absolute;
|
|
108934
|
-
left: 0;
|
|
108935
|
-
top: 0;
|
|
108936
|
-
right: 0;
|
|
108937
|
-
bottom: 0;
|
|
108938
108932
|
`, [iconSwitchTransitionNode]), cB("base-icon", [iconSwitchTransitionNode])]), cM("hide", "visibility: hidden;"), cM("expanded", "transform: rotate(90deg);")]), cB("tree-node-checkbox", `
|
|
108939
108933
|
display: inline-flex;
|
|
108940
108934
|
height: var(--u-node-content-height);
|
|
@@ -109071,7 +109065,7 @@ const treeProps = {
|
|
|
109071
109065
|
scrollbarProps: Object,
|
|
109072
109066
|
indent: {
|
|
109073
109067
|
type: Number,
|
|
109074
|
-
default:
|
|
109068
|
+
default: 36
|
|
109075
109069
|
},
|
|
109076
109070
|
allowDrop: {
|
|
109077
109071
|
type: Function,
|
|
@@ -109107,6 +109101,7 @@ const treeProps = {
|
|
|
109107
109101
|
"onUpdate:checkedKeys": [Function, Array],
|
|
109108
109102
|
onUpdateSelectedKeys: [Function, Array],
|
|
109109
109103
|
"onUpdate:selectedKeys": [Function, Array],
|
|
109104
|
+
onScroll: [Function, Array],
|
|
109110
109105
|
...treeSharedProps,
|
|
109111
109106
|
// internal props for tree-select
|
|
109112
109107
|
internalTreeSelect: Boolean,
|
|
@@ -109846,8 +109841,8 @@ var _UTree = defineComponent({
|
|
|
109846
109841
|
}
|
|
109847
109842
|
doDragLeave({ event, node: node.rawNode });
|
|
109848
109843
|
}
|
|
109849
|
-
function handleDragLeaveTree(
|
|
109850
|
-
if (
|
|
109844
|
+
function handleDragLeaveTree(event) {
|
|
109845
|
+
if (event.target !== event.currentTarget)
|
|
109851
109846
|
return;
|
|
109852
109847
|
resetDropState();
|
|
109853
109848
|
}
|
|
@@ -110044,22 +110039,26 @@ var _UTree = defineComponent({
|
|
|
110044
110039
|
});
|
|
110045
110040
|
resetDndState();
|
|
110046
110041
|
}
|
|
110047
|
-
function
|
|
110042
|
+
function doScroll(event) {
|
|
110043
|
+
props.onScroll && call(props.onScroll, event);
|
|
110044
|
+
}
|
|
110045
|
+
function handleScroll(event) {
|
|
110048
110046
|
syncScrollbar();
|
|
110047
|
+
doScroll(event);
|
|
110049
110048
|
}
|
|
110050
110049
|
function handleResize() {
|
|
110051
110050
|
syncScrollbar();
|
|
110052
110051
|
}
|
|
110053
|
-
function handleFocusout(
|
|
110052
|
+
function handleFocusout(event) {
|
|
110054
110053
|
if (props.virtualScroll || props.internalScrollable) {
|
|
110055
110054
|
const { value: scrollbarInst } = scrollbarInstRef;
|
|
110056
|
-
if (scrollbarInst?.containerRef?.contains(
|
|
110055
|
+
if (scrollbarInst?.containerRef?.contains(event.relatedTarget)) {
|
|
110057
110056
|
return;
|
|
110058
110057
|
}
|
|
110059
110058
|
pendingNodeKeyRef.value = null;
|
|
110060
110059
|
} else {
|
|
110061
110060
|
const { value: selfEl } = selfElRef;
|
|
110062
|
-
if (selfEl?.contains(
|
|
110061
|
+
if (selfEl?.contains(event.relatedTarget))
|
|
110063
110062
|
return;
|
|
110064
110063
|
pendingNodeKeyRef.value = null;
|
|
110065
110064
|
}
|
|
@@ -110172,6 +110171,8 @@ var _UTree = defineComponent({
|
|
|
110172
110171
|
nodeColorPressed,
|
|
110173
110172
|
nodeColorActive,
|
|
110174
110173
|
arrowColor,
|
|
110174
|
+
switcherColor,
|
|
110175
|
+
switcherSize,
|
|
110175
110176
|
loadingColor,
|
|
110176
110177
|
nodeTextColor,
|
|
110177
110178
|
nodeTextColorDisabled,
|
|
@@ -110188,6 +110189,8 @@ var _UTree = defineComponent({
|
|
|
110188
110189
|
);
|
|
110189
110190
|
return {
|
|
110190
110191
|
"--u-arrow-color": arrowColor,
|
|
110192
|
+
"--u-switcher-color": switcherColor,
|
|
110193
|
+
"--u-switcher-size": switcherSize,
|
|
110191
110194
|
"--u-loading-color": loadingColor,
|
|
110192
110195
|
"--u-bezier": cubicBezierEaseInOut,
|
|
110193
110196
|
"--u-font-size": fontSize,
|
|
@@ -110336,6 +110339,7 @@ var _UTree = defineComponent({
|
|
|
110336
110339
|
...scrollbarProps,
|
|
110337
110340
|
class: treeClass,
|
|
110338
110341
|
tabindex,
|
|
110342
|
+
onScroll: this.handleScroll,
|
|
110339
110343
|
onKeydown: mergedFocusable ? handleKeydown : void 0,
|
|
110340
110344
|
onFocusout: mergedFocusable ? handleFocusout : void 0,
|
|
110341
110345
|
style: this.cssVars,
|
|
@@ -110379,6 +110383,34 @@ var _UTree = defineComponent({
|
|
|
110379
110383
|
}
|
|
110380
110384
|
});
|
|
110381
110385
|
|
|
110386
|
+
function isVerticallyVisibleWithin(element, containerRect) {
|
|
110387
|
+
const elementRect = element.getBoundingClientRect();
|
|
110388
|
+
return elementRect.top < containerRect.bottom && elementRect.bottom > containerRect.top;
|
|
110389
|
+
}
|
|
110390
|
+
function scanReachedRootOptions(scrollElement, rootNodes, expandedKeys, previousVisibleKeys) {
|
|
110391
|
+
const containerRect = scrollElement.getBoundingClientRect();
|
|
110392
|
+
const visibleKeys = /* @__PURE__ */new Set();
|
|
110393
|
+
const reachedOptions = [];
|
|
110394
|
+
for (const rootNode of rootNodes) {
|
|
110395
|
+
const {
|
|
110396
|
+
children
|
|
110397
|
+
} = rootNode;
|
|
110398
|
+
if (!children?.length || !expandedKeys?.includes(rootNode.key)) continue;
|
|
110399
|
+
const lastChild = children[children.length - 1];
|
|
110400
|
+
const lastChildElement = scrollElement.querySelector(`[data-key="${createDataKey(lastChild.key)}"]`);
|
|
110401
|
+
const isHiddenOrMissing = !lastChildElement || !isVerticallyVisibleWithin(lastChildElement, containerRect);
|
|
110402
|
+
if (isHiddenOrMissing) continue;
|
|
110403
|
+
visibleKeys.add(rootNode.key);
|
|
110404
|
+
if (!previousVisibleKeys.has(rootNode.key)) {
|
|
110405
|
+
reachedOptions.push(rootNode.rawNode);
|
|
110406
|
+
}
|
|
110407
|
+
}
|
|
110408
|
+
return {
|
|
110409
|
+
reachedOptions,
|
|
110410
|
+
visibleKeys
|
|
110411
|
+
};
|
|
110412
|
+
}
|
|
110413
|
+
|
|
110382
110414
|
var style$2 = c$1([cB("tree-select", `
|
|
110383
110415
|
z-index: auto;
|
|
110384
110416
|
outline: none;
|
|
@@ -110462,6 +110494,7 @@ const treeSelectProps = {
|
|
|
110462
110494
|
loading: Boolean,
|
|
110463
110495
|
maxTagCount: [String, Number],
|
|
110464
110496
|
multiple: Boolean,
|
|
110497
|
+
remote: Boolean,
|
|
110465
110498
|
showPath: Boolean,
|
|
110466
110499
|
separator: {
|
|
110467
110500
|
type: String,
|
|
@@ -110497,6 +110530,9 @@ const treeSelectProps = {
|
|
|
110497
110530
|
nodeProps: Function,
|
|
110498
110531
|
onBlur: Function,
|
|
110499
110532
|
onFocus: Function,
|
|
110533
|
+
onScroll: [Function, Array],
|
|
110534
|
+
onScrollOptionEnd: [Function, Array],
|
|
110535
|
+
onSearch: [Function, Array],
|
|
110500
110536
|
onLoad: Function,
|
|
110501
110537
|
onUpdateShow: [Function, Array],
|
|
110502
110538
|
onUpdateValue: [Function, Array],
|
|
@@ -110547,15 +110583,16 @@ var _UTreeSelect = defineComponent({
|
|
|
110547
110583
|
const controlledShowRef = toRef(props, "show");
|
|
110548
110584
|
const mergedShowRef = useMergedState(controlledShowRef, uncontrolledShowRef);
|
|
110549
110585
|
const patternRef = ref("");
|
|
110586
|
+
const treePatternRef = computed(() => {
|
|
110587
|
+
return props.remote ? "" : patternRef.value;
|
|
110588
|
+
});
|
|
110550
110589
|
const mergedFilterRef = computed(() => {
|
|
110551
|
-
|
|
110552
|
-
|
|
110553
|
-
return filter;
|
|
110554
|
-
const { labelField } = props;
|
|
110590
|
+
if (props.filter)
|
|
110591
|
+
return props.filter;
|
|
110555
110592
|
return (pattern, node) => {
|
|
110556
110593
|
if (!pattern.length)
|
|
110557
110594
|
return true;
|
|
110558
|
-
return node[labelField].toLowerCase().includes(pattern.toLowerCase());
|
|
110595
|
+
return node[props.labelField].toLowerCase().includes(pattern.toLowerCase());
|
|
110559
110596
|
};
|
|
110560
110597
|
});
|
|
110561
110598
|
const dataTreeMateRef = computed(
|
|
@@ -110585,6 +110622,7 @@ var _UTreeSelect = defineComponent({
|
|
|
110585
110622
|
uncontrolledExpandedKeysRef
|
|
110586
110623
|
);
|
|
110587
110624
|
const focusedRef = ref(false);
|
|
110625
|
+
let visibleRootEndKeys = /* @__PURE__ */ new Set();
|
|
110588
110626
|
const mergedPlaceholderRef = computed(() => {
|
|
110589
110627
|
const { placeholder } = props;
|
|
110590
110628
|
if (placeholder !== void 0)
|
|
@@ -110727,17 +110765,17 @@ var _UTreeSelect = defineComponent({
|
|
|
110727
110765
|
}
|
|
110728
110766
|
uncontrolledExpandedKeysRef.value = keys;
|
|
110729
110767
|
}
|
|
110730
|
-
function doFocus(
|
|
110768
|
+
function doFocus(event) {
|
|
110731
110769
|
const { onFocus } = props;
|
|
110732
110770
|
if (onFocus)
|
|
110733
|
-
onFocus(
|
|
110771
|
+
onFocus(event);
|
|
110734
110772
|
triggerFormFocus();
|
|
110735
110773
|
}
|
|
110736
|
-
function doBlur(
|
|
110774
|
+
function doBlur(event) {
|
|
110737
110775
|
closeMenu();
|
|
110738
110776
|
const { onBlur } = props;
|
|
110739
110777
|
if (onBlur)
|
|
110740
|
-
onBlur(
|
|
110778
|
+
onBlur(event);
|
|
110741
110779
|
triggerFormBlur();
|
|
110742
110780
|
}
|
|
110743
110781
|
function closeMenu() {
|
|
@@ -110754,11 +110792,12 @@ var _UTreeSelect = defineComponent({
|
|
|
110754
110792
|
}
|
|
110755
110793
|
function handleMenuLeave() {
|
|
110756
110794
|
patternRef.value = "";
|
|
110795
|
+
visibleRootEndKeys = /* @__PURE__ */ new Set();
|
|
110757
110796
|
}
|
|
110758
|
-
function handleMenuClickoutside(
|
|
110797
|
+
function handleMenuClickoutside(event) {
|
|
110759
110798
|
if (mergedShowRef.value) {
|
|
110760
110799
|
if (!triggerInstRef.value?.$el.contains(
|
|
110761
|
-
getPreciseEventTarget(
|
|
110800
|
+
getPreciseEventTarget(event)
|
|
110762
110801
|
)) {
|
|
110763
110802
|
closeMenu();
|
|
110764
110803
|
}
|
|
@@ -110806,34 +110845,34 @@ var _UTreeSelect = defineComponent({
|
|
|
110806
110845
|
doUpdateIndeterminateKeys(keys, getOptionsByKeys(keys));
|
|
110807
110846
|
}
|
|
110808
110847
|
}
|
|
110809
|
-
function handleTriggerFocus(
|
|
110810
|
-
if (menuElRef.value?.contains(
|
|
110848
|
+
function handleTriggerFocus(event) {
|
|
110849
|
+
if (menuElRef.value?.contains(event.relatedTarget))
|
|
110811
110850
|
return;
|
|
110812
110851
|
focusedRef.value = true;
|
|
110813
|
-
doFocus(
|
|
110852
|
+
doFocus(event);
|
|
110814
110853
|
}
|
|
110815
|
-
function handleTriggerBlur(
|
|
110816
|
-
if (menuElRef.value?.contains(
|
|
110854
|
+
function handleTriggerBlur(event) {
|
|
110855
|
+
if (menuElRef.value?.contains(event.relatedTarget))
|
|
110817
110856
|
return;
|
|
110818
110857
|
focusedRef.value = false;
|
|
110819
|
-
doBlur(
|
|
110858
|
+
doBlur(event);
|
|
110820
110859
|
}
|
|
110821
|
-
function handleMenuFocusin(
|
|
110822
|
-
if (menuElRef.value?.contains(
|
|
110860
|
+
function handleMenuFocusin(event) {
|
|
110861
|
+
if (menuElRef.value?.contains(event.relatedTarget) || triggerInstRef.value?.$el?.contains(event.relatedTarget)) {
|
|
110823
110862
|
return;
|
|
110824
110863
|
}
|
|
110825
110864
|
focusedRef.value = true;
|
|
110826
|
-
doFocus(
|
|
110865
|
+
doFocus(event);
|
|
110827
110866
|
}
|
|
110828
|
-
function handleMenuFocusout(
|
|
110829
|
-
if (menuElRef.value?.contains(
|
|
110867
|
+
function handleMenuFocusout(event) {
|
|
110868
|
+
if (menuElRef.value?.contains(event.relatedTarget) || triggerInstRef.value?.$el?.contains(event.relatedTarget)) {
|
|
110830
110869
|
return;
|
|
110831
110870
|
}
|
|
110832
110871
|
focusedRef.value = false;
|
|
110833
|
-
doBlur(
|
|
110872
|
+
doBlur(event);
|
|
110834
110873
|
}
|
|
110835
|
-
function handleClear(
|
|
110836
|
-
|
|
110874
|
+
function handleClear(event) {
|
|
110875
|
+
event.stopPropagation();
|
|
110837
110876
|
const { multiple } = props;
|
|
110838
110877
|
if (!multiple && props.filterable) {
|
|
110839
110878
|
closeMenu();
|
|
@@ -110886,20 +110925,24 @@ var _UTreeSelect = defineComponent({
|
|
|
110886
110925
|
}
|
|
110887
110926
|
}
|
|
110888
110927
|
}
|
|
110889
|
-
function
|
|
110890
|
-
|
|
110928
|
+
function doSearch(value) {
|
|
110929
|
+
props.onSearch && call(props.onSearch, value);
|
|
110930
|
+
}
|
|
110931
|
+
function handlePatternInput(event) {
|
|
110932
|
+
const { value } = event.target;
|
|
110891
110933
|
patternRef.value = value;
|
|
110934
|
+
doSearch(value);
|
|
110892
110935
|
}
|
|
110893
|
-
function treeHandleKeydown(
|
|
110936
|
+
function treeHandleKeydown(event) {
|
|
110894
110937
|
const { value: treeInst } = treeInstRef;
|
|
110895
110938
|
if (treeInst) {
|
|
110896
|
-
treeInst.handleKeydown(
|
|
110939
|
+
treeInst.handleKeydown(event);
|
|
110897
110940
|
}
|
|
110898
110941
|
}
|
|
110899
|
-
function handleKeydown(
|
|
110900
|
-
if (
|
|
110942
|
+
function handleKeydown(event) {
|
|
110943
|
+
if (event.key === "Enter") {
|
|
110901
110944
|
if (mergedShowRef.value) {
|
|
110902
|
-
treeHandleKeydown(
|
|
110945
|
+
treeHandleKeydown(event);
|
|
110903
110946
|
if (!props.multiple) {
|
|
110904
110947
|
closeMenu();
|
|
110905
110948
|
focusSelection();
|
|
@@ -110907,17 +110950,17 @@ var _UTreeSelect = defineComponent({
|
|
|
110907
110950
|
} else {
|
|
110908
110951
|
openMenu();
|
|
110909
110952
|
}
|
|
110910
|
-
|
|
110911
|
-
} else if (
|
|
110953
|
+
event.preventDefault();
|
|
110954
|
+
} else if (event.key === "Escape") {
|
|
110912
110955
|
if (mergedShowRef.value) {
|
|
110913
|
-
markEventEffectPerformed(
|
|
110956
|
+
markEventEffectPerformed(event);
|
|
110914
110957
|
closeMenu();
|
|
110915
110958
|
focusSelection();
|
|
110916
110959
|
}
|
|
110917
110960
|
} else {
|
|
110918
110961
|
if (mergedShowRef.value) {
|
|
110919
|
-
treeHandleKeydown(
|
|
110920
|
-
} else if (
|
|
110962
|
+
treeHandleKeydown(event);
|
|
110963
|
+
} else if (event.key === "ArrowDown") {
|
|
110921
110964
|
openMenu();
|
|
110922
110965
|
}
|
|
110923
110966
|
}
|
|
@@ -110926,9 +110969,35 @@ var _UTreeSelect = defineComponent({
|
|
|
110926
110969
|
closeMenu();
|
|
110927
110970
|
focusSelection();
|
|
110928
110971
|
}
|
|
110929
|
-
function handleMenuMousedown(
|
|
110930
|
-
if (!happensIn(
|
|
110931
|
-
|
|
110972
|
+
function handleMenuMousedown(event) {
|
|
110973
|
+
if (!happensIn(event, "action"))
|
|
110974
|
+
event.preventDefault();
|
|
110975
|
+
}
|
|
110976
|
+
function doScroll(event) {
|
|
110977
|
+
const { onScroll } = props;
|
|
110978
|
+
if (onScroll)
|
|
110979
|
+
call(onScroll, event);
|
|
110980
|
+
}
|
|
110981
|
+
function doScrollOptionEnd(option, event) {
|
|
110982
|
+
props.onScrollOptionEnd && call(props.onScrollOptionEnd, option, event);
|
|
110983
|
+
}
|
|
110984
|
+
function handleTreeScroll(event) {
|
|
110985
|
+
doScroll(event);
|
|
110986
|
+
if (!props.onScrollOptionEnd)
|
|
110987
|
+
return;
|
|
110988
|
+
const scrollElement = event.currentTarget || event.target;
|
|
110989
|
+
if (!scrollElement)
|
|
110990
|
+
return;
|
|
110991
|
+
const { reachedOptions, visibleKeys } = scanReachedRootOptions(
|
|
110992
|
+
scrollElement,
|
|
110993
|
+
dataTreeMateRef.value.treeNodes,
|
|
110994
|
+
mergedExpandedKeysRef.value,
|
|
110995
|
+
visibleRootEndKeys
|
|
110996
|
+
);
|
|
110997
|
+
visibleRootEndKeys = visibleKeys;
|
|
110998
|
+
for (const reachedOption of reachedOptions) {
|
|
110999
|
+
doScrollOptionEnd(reachedOption, event);
|
|
111000
|
+
}
|
|
110932
111001
|
}
|
|
110933
111002
|
const selectionRenderTagRef = computed(() => {
|
|
110934
111003
|
const { renderTag } = props;
|
|
@@ -111060,6 +111129,7 @@ var _UTreeSelect = defineComponent({
|
|
|
111060
111129
|
selectedOption: selectedOptionRef,
|
|
111061
111130
|
selectedOptions: selectedOptionsRef,
|
|
111062
111131
|
pattern: patternRef,
|
|
111132
|
+
treePattern: treePatternRef,
|
|
111063
111133
|
pendingNodeKey: pendingNodeKeyRef,
|
|
111064
111134
|
mergedCascade: mergedCascadeRef,
|
|
111065
111135
|
mergedFilter: mergedFilterRef,
|
|
@@ -111081,6 +111151,7 @@ var _UTreeSelect = defineComponent({
|
|
|
111081
111151
|
handleKeydown,
|
|
111082
111152
|
handleTabOut,
|
|
111083
111153
|
handleMenuMousedown,
|
|
111154
|
+
handleTreeScroll,
|
|
111084
111155
|
mergedTheme: themeRef,
|
|
111085
111156
|
cssVars: inlineThemeDisabled ? void 0 : cssVarsRef,
|
|
111086
111157
|
themeClass: themeClassHandle?.themeClass,
|
|
@@ -111191,7 +111262,7 @@ var _UTreeSelect = defineComponent({
|
|
|
111191
111262
|
allowCheckingNotLoaded: this.allowCheckingNotLoaded,
|
|
111192
111263
|
showIrrelevantNodes: false,
|
|
111193
111264
|
animated: false,
|
|
111194
|
-
pattern: this.
|
|
111265
|
+
pattern: this.treePattern,
|
|
111195
111266
|
filter: this.mergedFilter,
|
|
111196
111267
|
data: options,
|
|
111197
111268
|
cancelable: multiple,
|
|
@@ -111241,7 +111312,8 @@ var _UTreeSelect = defineComponent({
|
|
|
111241
111312
|
onLoad: this.onLoad,
|
|
111242
111313
|
onUpdateCheckedKeys: this.handleUpdateCheckedKeys,
|
|
111243
111314
|
onUpdateIndeterminateKeys: this.handleUpdateIndeterminateKeys,
|
|
111244
|
-
onUpdateExpandedKeys: this.doUpdateExpandedKeys
|
|
111315
|
+
onUpdateExpandedKeys: this.doUpdateExpandedKeys,
|
|
111316
|
+
onScroll: this.handleTreeScroll
|
|
111245
111317
|
}
|
|
111246
111318
|
),
|
|
111247
111319
|
resolveWrappedSlot($slots.action, (children) => {
|
|
@@ -113169,7 +113241,7 @@ function useThemeVars() {
|
|
|
113169
113241
|
});
|
|
113170
113242
|
}
|
|
113171
113243
|
|
|
113172
|
-
var version = "2.0.
|
|
113244
|
+
var version = "2.0.8";
|
|
113173
113245
|
|
|
113174
113246
|
function create({
|
|
113175
113247
|
componentPrefix = "U",
|