@expcat/tigercat-vue 2.0.0 → 2.0.4
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/{chunk-KE6RGD4Y.mjs → chunk-26OI3TEA.mjs} +25 -55
- package/dist/{chunk-A7QIMKWQ.mjs → chunk-2T2NEZRZ.mjs} +1 -1
- package/dist/chunk-4HUYX5WW.mjs +239 -0
- package/dist/{chunk-IDUEWMWN.mjs → chunk-7KCOF5US.mjs} +61 -62
- package/dist/{chunk-RHV6DWY6.mjs → chunk-7VHXZX7Y.mjs} +20 -28
- package/dist/{chunk-IZRQ7LB3.mjs → chunk-AU6IC6K7.mjs} +1 -1
- package/dist/{chunk-O6BN5R6J.mjs → chunk-AUMTHL6N.mjs} +1 -1
- package/dist/{chunk-MNSVJBNH.mjs → chunk-B4MDHE3L.mjs} +18 -4
- package/dist/{chunk-N7LWKAYS.mjs → chunk-BZ6MVFV7.mjs} +190 -174
- package/dist/{chunk-TK3QU367.mjs → chunk-DI6RRAGQ.mjs} +3 -3
- package/dist/{chunk-4ZZYQITT.mjs → chunk-FWO7RNGI.mjs} +249 -220
- package/dist/{chunk-EZZD4OCV.mjs → chunk-GS4SV2HK.mjs} +1 -1
- package/dist/{chunk-EUSODI5E.mjs → chunk-HKYRRQS7.mjs} +11 -5
- package/dist/{chunk-D4APFWWS.mjs → chunk-IPGPLFUZ.mjs} +18 -4
- package/dist/{chunk-JKPXJ3VB.mjs → chunk-JALHMWKW.mjs} +14 -6
- package/dist/{chunk-OHPXOLNB.mjs → chunk-K3WTQBE4.mjs} +40 -15
- package/dist/{chunk-VMYV5EWI.mjs → chunk-KICZSLOX.mjs} +9 -8
- package/dist/{chunk-SK2QJ66E.mjs → chunk-KROVW4AW.mjs} +19 -59
- package/dist/{chunk-AQMPCLX7.mjs → chunk-NMAJD353.mjs} +248 -253
- package/dist/{chunk-4BO6JNA6.mjs → chunk-OAPIT53X.mjs} +4 -4
- package/dist/{chunk-SYRRMZT2.mjs → chunk-OQVGB7X6.mjs} +43 -29
- package/dist/{chunk-DWK5GUMB.mjs → chunk-OTGGPXDT.mjs} +26 -19
- package/dist/{chunk-DWPZRG7A.mjs → chunk-PGF7HLLR.mjs} +43 -39
- package/dist/chunk-Q7Y22OFX.mjs +330 -0
- package/dist/{chunk-NP6DZQ3O.mjs → chunk-RID7A5V7.mjs} +1 -1
- package/dist/{chunk-DKMKJZ7A.mjs → chunk-S5RTMAQN.mjs} +1 -1
- package/dist/{chunk-SJ7W5I5H.mjs → chunk-TCV6YPH5.mjs} +1 -1
- package/dist/{chunk-LFENEILY.mjs → chunk-WC5MKASU.mjs} +110 -99
- package/dist/components/ActivityFeed.mjs +3 -3
- package/dist/components/AutoComplete.mjs +2 -1
- package/dist/components/BackTop.d.mts +2 -2
- package/dist/components/Cascader.mjs +2 -1
- package/dist/components/ColorPicker.mjs +2 -1
- package/dist/components/CropUpload.mjs +3 -3
- package/dist/components/DataExport.mjs +3 -3
- package/dist/components/DataTableWithToolbar.mjs +6 -6
- package/dist/components/DatePicker.mjs +2 -1
- package/dist/components/DonutChart.d.mts +1 -1
- package/dist/components/Drawer.d.mts +2 -2
- package/dist/components/Drawer.mjs +2 -2
- package/dist/components/Dropdown.d.mts +2 -2
- package/dist/components/Dropdown.mjs +2 -2
- package/dist/components/FloatButton.d.mts +1 -1
- package/dist/components/FormItem.mjs +2 -1
- package/dist/components/Image.mjs +3 -3
- package/dist/components/Loading.mjs +2 -2
- package/dist/components/Mentions.mjs +2 -1
- package/dist/components/Menu.mjs +2 -2
- package/dist/components/Modal.d.mts +1 -1
- package/dist/components/Modal.mjs +2 -2
- package/dist/components/NotificationCenter.mjs +3 -3
- package/dist/components/PieChart.d.mts +1 -1
- package/dist/components/Popconfirm.d.mts +2 -2
- package/dist/components/Popconfirm.mjs +3 -3
- package/dist/components/Popover.d.mts +2 -2
- package/dist/components/Popover.mjs +3 -3
- package/dist/components/Select.mjs +2 -1
- package/dist/components/Spotlight.d.mts +1 -1
- package/dist/components/Spotlight.mjs +2 -2
- package/dist/components/Table.mjs +3 -2
- package/dist/components/TimePicker.mjs +2 -1
- package/dist/components/Tooltip.d.mts +2 -2
- package/dist/components/Tooltip.mjs +3 -3
- package/dist/components/Tour.mjs +2 -2
- package/dist/components/TreeSelect.mjs +2 -1
- package/dist/index.mjs +4 -2
- package/package.json +2 -2
- package/dist/chunk-BDTPFPSB.mjs +0 -163
- package/dist/chunk-EWUHEW6W.mjs +0 -219
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
renderVueOverlayTeleport,
|
|
3
|
+
useVueAnchoredOverlay
|
|
4
|
+
} from "./chunk-Q7Y22OFX.mjs";
|
|
1
5
|
import {
|
|
2
6
|
useTigerConfig
|
|
3
7
|
} from "./chunk-UOJOJBEU.mjs";
|
|
@@ -228,6 +232,19 @@ var Select = defineComponent({
|
|
|
228
232
|
const dropdownRef = ref(null);
|
|
229
233
|
const triggerRef = ref(null);
|
|
230
234
|
const searchInputRef = ref(null);
|
|
235
|
+
const overlay = useVueAnchoredOverlay({
|
|
236
|
+
enabled: isOpen,
|
|
237
|
+
referenceRef: triggerRef,
|
|
238
|
+
floatingRef: dropdownRef,
|
|
239
|
+
placement: "bottom-start",
|
|
240
|
+
offset: 4,
|
|
241
|
+
layout: "fullscreen-sm",
|
|
242
|
+
matchReferenceWidth: true,
|
|
243
|
+
dismissOnOutside: true,
|
|
244
|
+
dismissOnEscape: true,
|
|
245
|
+
restoreFocusOnDismiss: true,
|
|
246
|
+
onDismiss: closeDropdown
|
|
247
|
+
});
|
|
231
248
|
const virtualScrollTop = ref(0);
|
|
232
249
|
const virtualScrollRef = ref(null);
|
|
233
250
|
watch(activeIndex, (idx) => {
|
|
@@ -369,11 +386,6 @@ var Select = defineComponent({
|
|
|
369
386
|
emit("update:modelValue", newValue);
|
|
370
387
|
emit("change", newValue);
|
|
371
388
|
}
|
|
372
|
-
function handleClickOutside(event) {
|
|
373
|
-
if (dropdownRef.value && triggerRef.value && !dropdownRef.value.contains(event.target) && !triggerRef.value.contains(event.target)) {
|
|
374
|
-
closeDropdown();
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
389
|
function handleSearchInput(event) {
|
|
378
390
|
const target = event.target;
|
|
379
391
|
updateSearchValue(target.value);
|
|
@@ -532,7 +544,6 @@ var Select = defineComponent({
|
|
|
532
544
|
isOpen,
|
|
533
545
|
(open) => {
|
|
534
546
|
if (open) {
|
|
535
|
-
document.addEventListener("click", handleClickOutside);
|
|
536
547
|
const selectedIndex = (() => {
|
|
537
548
|
if (props.multiple && Array.isArray(props.modelValue)) {
|
|
538
549
|
const values = props.modelValue;
|
|
@@ -556,8 +567,6 @@ var Select = defineComponent({
|
|
|
556
567
|
if (!props.searchable) {
|
|
557
568
|
focusOptionAt(nextActive);
|
|
558
569
|
}
|
|
559
|
-
} else {
|
|
560
|
-
document.removeEventListener("click", handleClickOutside);
|
|
561
570
|
}
|
|
562
571
|
},
|
|
563
572
|
{ immediate: true }
|
|
@@ -579,7 +588,6 @@ var Select = defineComponent({
|
|
|
579
588
|
}
|
|
580
589
|
);
|
|
581
590
|
onBeforeUnmount(() => {
|
|
582
|
-
document.removeEventListener("click", handleClickOutside);
|
|
583
591
|
searchDebouncer.cancel();
|
|
584
592
|
});
|
|
585
593
|
return () => {
|
|
@@ -643,188 +651,196 @@ var Select = defineComponent({
|
|
|
643
651
|
]
|
|
644
652
|
),
|
|
645
653
|
// Dropdown
|
|
646
|
-
isOpen.value &&
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
"
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
const
|
|
677
|
-
selected
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
654
|
+
isOpen.value && renderVueOverlayTeleport(
|
|
655
|
+
h(
|
|
656
|
+
"div",
|
|
657
|
+
{
|
|
658
|
+
ref: dropdownRef,
|
|
659
|
+
class: classNames(selectDropdownBaseClasses, overlay.floatingClasses.value),
|
|
660
|
+
style: overlay.floatingStyles.value,
|
|
661
|
+
"data-positioned": overlay.positioned.value,
|
|
662
|
+
role: "listbox",
|
|
663
|
+
id: listboxId,
|
|
664
|
+
"aria-multiselectable": props.multiple ? true : void 0,
|
|
665
|
+
onKeydown: handleDropdownKeyDown
|
|
666
|
+
},
|
|
667
|
+
[
|
|
668
|
+
// Search input
|
|
669
|
+
props.searchable && h("input", {
|
|
670
|
+
ref: searchInputRef,
|
|
671
|
+
type: "text",
|
|
672
|
+
class: selectSearchInputClasses,
|
|
673
|
+
placeholder: resolveLocaleText(
|
|
674
|
+
"Search...",
|
|
675
|
+
mergedLocale.value?.common?.searchPlaceholder
|
|
676
|
+
),
|
|
677
|
+
value: searchQuery.value,
|
|
678
|
+
onInput: handleSearchInput,
|
|
679
|
+
onKeydown: handleSearchKeyDown
|
|
680
|
+
}),
|
|
681
|
+
// Options list
|
|
682
|
+
filteredOptions.value.length > 0 ? (() => {
|
|
683
|
+
let optionIndex = -1;
|
|
684
|
+
const renderOptionItem = (option, idx, displayLabel = option.label) => {
|
|
685
|
+
const selected = isSelected(option);
|
|
686
|
+
const active = idx === activeIndex.value;
|
|
687
|
+
const optionAria = getPickerOptionAria({
|
|
688
|
+
selected,
|
|
689
|
+
disabled: !!option.disabled
|
|
690
|
+
});
|
|
691
|
+
return h(
|
|
692
|
+
"div",
|
|
693
|
+
{
|
|
694
|
+
key: option.value,
|
|
695
|
+
id: getOptionId(idx),
|
|
696
|
+
"data-option-index": idx,
|
|
697
|
+
...optionAria,
|
|
698
|
+
tabindex: active ? 0 : -1,
|
|
699
|
+
class: getSelectOptionClasses(selected, !!option.disabled, props.size),
|
|
700
|
+
onMouseenter: () => {
|
|
701
|
+
if (!option.disabled) {
|
|
702
|
+
activeIndex.value = idx;
|
|
703
|
+
}
|
|
704
|
+
},
|
|
705
|
+
onClick: () => selectOption(option)
|
|
706
|
+
},
|
|
707
|
+
[
|
|
708
|
+
h("span", { class: "flex items-center justify-between w-full" }, [
|
|
709
|
+
h("span", displayLabel),
|
|
710
|
+
selected && h("span", CheckIcon)
|
|
711
|
+
])
|
|
712
|
+
]
|
|
713
|
+
);
|
|
714
|
+
};
|
|
715
|
+
const hasGroups = filteredOptions.value.some(isOptionGroup);
|
|
716
|
+
if (props.virtual && !hasGroups) {
|
|
717
|
+
const flat = filteredOptions.value.filter(
|
|
718
|
+
(o) => !isOptionGroup(o)
|
|
719
|
+
);
|
|
720
|
+
const all = creatableOption.value ? [...flat, creatableOption.value] : flat;
|
|
721
|
+
const itemH = getSelectVirtualItemHeight(props.size);
|
|
722
|
+
const { startIndex, endIndex, totalHeight } = fixedSizeStrategy(
|
|
723
|
+
itemH
|
|
724
|
+
).getRange(virtualScrollTop.value, props.listHeight, all.length, 5);
|
|
725
|
+
const visible = [];
|
|
726
|
+
for (let i = startIndex; i <= endIndex; i++) {
|
|
727
|
+
const isCreate = creatableOption.value && i === all.length - 1;
|
|
728
|
+
visible.push(
|
|
729
|
+
renderOptionItem(
|
|
730
|
+
all[i],
|
|
731
|
+
i,
|
|
732
|
+
isCreate ? getCreateSelectOptionLabel(all[i], props.createOptionText) : all[i].label
|
|
733
|
+
)
|
|
734
|
+
);
|
|
735
|
+
}
|
|
736
|
+
return h(
|
|
737
|
+
"div",
|
|
738
|
+
{
|
|
739
|
+
ref: virtualScrollRef,
|
|
740
|
+
"data-tiger-select-virtual": "",
|
|
741
|
+
style: { maxHeight: `${props.listHeight}px`, overflowY: "auto" },
|
|
742
|
+
onScroll: (e) => {
|
|
743
|
+
virtualScrollTop.value = e.target.scrollTop;
|
|
692
744
|
}
|
|
693
745
|
},
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
const
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
746
|
+
[
|
|
747
|
+
h(
|
|
748
|
+
"div",
|
|
749
|
+
{ style: { height: `${totalHeight}px`, position: "relative" } },
|
|
750
|
+
[
|
|
751
|
+
h(
|
|
752
|
+
"div",
|
|
753
|
+
{ style: { transform: `translateY(${startIndex * itemH}px)` } },
|
|
754
|
+
visible
|
|
755
|
+
)
|
|
756
|
+
]
|
|
757
|
+
)
|
|
758
|
+
]
|
|
759
|
+
);
|
|
760
|
+
}
|
|
761
|
+
const optionNodes = filteredOptions.value.map((item) => {
|
|
762
|
+
if (isOptionGroup(item)) {
|
|
763
|
+
return h("div", { key: item.label }, [
|
|
764
|
+
h("div", { class: selectGroupLabelClasses }, item.label),
|
|
765
|
+
item.options.map((option) => {
|
|
766
|
+
optionIndex += 1;
|
|
767
|
+
return renderOptionItem(option, optionIndex);
|
|
768
|
+
})
|
|
769
|
+
]);
|
|
770
|
+
}
|
|
771
|
+
optionIndex += 1;
|
|
772
|
+
return renderOptionItem(item, optionIndex);
|
|
773
|
+
});
|
|
774
|
+
if (creatableOption.value) {
|
|
775
|
+
optionIndex += 1;
|
|
776
|
+
optionNodes.push(
|
|
718
777
|
renderOptionItem(
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
778
|
+
creatableOption.value,
|
|
779
|
+
optionIndex,
|
|
780
|
+
getCreateSelectOptionLabel(
|
|
781
|
+
creatableOption.value,
|
|
782
|
+
props.createOptionText
|
|
783
|
+
)
|
|
722
784
|
)
|
|
723
785
|
);
|
|
724
786
|
}
|
|
787
|
+
return optionNodes;
|
|
788
|
+
})() : creatableOption.value ? (() => {
|
|
789
|
+
const optionLabel = getCreateSelectOptionLabel(
|
|
790
|
+
creatableOption.value,
|
|
791
|
+
props.createOptionText
|
|
792
|
+
);
|
|
725
793
|
return h(
|
|
726
794
|
"div",
|
|
727
795
|
{
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
796
|
+
key: creatableOption.value.value,
|
|
797
|
+
id: getOptionId(0),
|
|
798
|
+
"data-option-index": 0,
|
|
799
|
+
role: "option",
|
|
800
|
+
"aria-selected": false,
|
|
801
|
+
tabindex: activeIndex.value === 0 ? 0 : -1,
|
|
802
|
+
class: getSelectOptionClasses(false, false, props.size),
|
|
803
|
+
onMouseenter: () => {
|
|
804
|
+
activeIndex.value = 0;
|
|
805
|
+
},
|
|
806
|
+
onClick: () => selectOption(creatableOption.value)
|
|
734
807
|
},
|
|
735
808
|
[
|
|
736
809
|
h(
|
|
737
|
-
"
|
|
738
|
-
{
|
|
739
|
-
|
|
740
|
-
h(
|
|
741
|
-
"div",
|
|
742
|
-
{ style: { transform: `translateY(${startIndex * itemH}px)` } },
|
|
743
|
-
visible
|
|
744
|
-
)
|
|
745
|
-
]
|
|
810
|
+
"span",
|
|
811
|
+
{ class: "flex items-center justify-between w-full" },
|
|
812
|
+
optionLabel
|
|
746
813
|
)
|
|
747
814
|
]
|
|
748
815
|
);
|
|
749
|
-
}
|
|
750
|
-
const optionNodes = filteredOptions.value.map((item) => {
|
|
751
|
-
if (isOptionGroup(item)) {
|
|
752
|
-
return h("div", { key: item.label }, [
|
|
753
|
-
h("div", { class: selectGroupLabelClasses }, item.label),
|
|
754
|
-
item.options.map((option) => {
|
|
755
|
-
optionIndex += 1;
|
|
756
|
-
return renderOptionItem(option, optionIndex);
|
|
757
|
-
})
|
|
758
|
-
]);
|
|
759
|
-
}
|
|
760
|
-
optionIndex += 1;
|
|
761
|
-
return renderOptionItem(item, optionIndex);
|
|
762
|
-
});
|
|
763
|
-
if (creatableOption.value) {
|
|
764
|
-
optionIndex += 1;
|
|
765
|
-
optionNodes.push(
|
|
766
|
-
renderOptionItem(
|
|
767
|
-
creatableOption.value,
|
|
768
|
-
optionIndex,
|
|
769
|
-
getCreateSelectOptionLabel(creatableOption.value, props.createOptionText)
|
|
770
|
-
)
|
|
771
|
-
);
|
|
772
|
-
}
|
|
773
|
-
return optionNodes;
|
|
774
|
-
})() : creatableOption.value ? (() => {
|
|
775
|
-
const optionLabel = getCreateSelectOptionLabel(
|
|
776
|
-
creatableOption.value,
|
|
777
|
-
props.createOptionText
|
|
778
|
-
);
|
|
779
|
-
return h(
|
|
816
|
+
})() : h(
|
|
780
817
|
"div",
|
|
781
|
-
{
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
)
|
|
800
|
-
]
|
|
801
|
-
);
|
|
802
|
-
})() : h(
|
|
803
|
-
"div",
|
|
804
|
-
{ class: selectEmptyStateClasses },
|
|
805
|
-
resolveLocaleText(
|
|
806
|
-
"No options found",
|
|
807
|
-
props.emptyText,
|
|
808
|
-
mergedLocale.value?.common?.emptyText
|
|
809
|
-
)
|
|
810
|
-
),
|
|
811
|
-
h("div", { class: selectDoneActionClasses }, [
|
|
812
|
-
h(
|
|
813
|
-
"button",
|
|
814
|
-
{
|
|
815
|
-
type: "button",
|
|
816
|
-
class: selectDoneButtonClasses,
|
|
817
|
-
onClick: closeDropdown,
|
|
818
|
-
onKeydown: (event) => {
|
|
819
|
-
if (event.key === "Enter" || event.key === " ") {
|
|
820
|
-
event.stopPropagation();
|
|
818
|
+
{ class: selectEmptyStateClasses },
|
|
819
|
+
resolveLocaleText(
|
|
820
|
+
"No options found",
|
|
821
|
+
props.emptyText,
|
|
822
|
+
mergedLocale.value?.common?.emptyText
|
|
823
|
+
)
|
|
824
|
+
),
|
|
825
|
+
h("div", { class: selectDoneActionClasses }, [
|
|
826
|
+
h(
|
|
827
|
+
"button",
|
|
828
|
+
{
|
|
829
|
+
type: "button",
|
|
830
|
+
class: selectDoneButtonClasses,
|
|
831
|
+
onClick: closeDropdown,
|
|
832
|
+
onKeydown: (event) => {
|
|
833
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
834
|
+
event.stopPropagation();
|
|
835
|
+
}
|
|
821
836
|
}
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
)
|
|
826
|
-
]
|
|
827
|
-
|
|
837
|
+
},
|
|
838
|
+
doneText.value
|
|
839
|
+
)
|
|
840
|
+
])
|
|
841
|
+
]
|
|
842
|
+
),
|
|
843
|
+
overlay.target.value
|
|
828
844
|
)
|
|
829
845
|
]);
|
|
830
846
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Table
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AU6IC6K7.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Select
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BZ6MVFV7.mjs";
|
|
7
7
|
import {
|
|
8
8
|
Popover
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OQVGB7X6.mjs";
|
|
10
10
|
import {
|
|
11
11
|
Input
|
|
12
12
|
} from "./chunk-XLNK3Z2P.mjs";
|