@moubing/bing-ui 0.11.1 → 0.12.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.
- package/README.md +300 -171
- package/dist/_virtual/_plugin-vue_export-helper.js +8 -0
- package/dist/bing-ui.css +1 -1
- package/dist/components/BingAnimatedText/BingAnimatedText.js +7 -0
- package/dist/components/BingAnimatedText/BingAnimatedText.vue_vue_type_script_setup_true_lang.js +194 -0
- package/dist/components/BingAppSwitcherTransition/BingAppSwitcherTransition.js +7 -0
- package/dist/components/BingAppSwitcherTransition/BingAppSwitcherTransition.vue_vue_type_script_setup_true_lang.js +244 -0
- package/dist/components/BingAutocomplete/BingAutocomplete.js +7 -0
- package/dist/components/BingAutocomplete/BingAutocomplete.vue.d.ts +4 -4
- package/dist/components/BingAutocomplete/BingAutocomplete.vue_vue_type_script_setup_true_lang.js +560 -0
- package/dist/components/BingButton/BingButton.js +7 -0
- package/dist/components/BingButton/BingButton.vue.d.ts +2 -2
- package/dist/components/BingButton/BingButton.vue_vue_type_script_setup_true_lang.js +200 -0
- package/dist/components/BingCard/BingCard.js +7 -0
- package/dist/components/BingCard/BingCard.vue_vue_type_script_setup_true_lang.js +481 -0
- package/dist/components/BingCarouselTransition/BingCarouselTransition.js +7 -0
- package/dist/components/BingCarouselTransition/BingCarouselTransition.vue_vue_type_script_setup_true_lang.js +174 -0
- package/dist/components/BingCheckbox/BingCheckbox.js +7 -0
- package/dist/components/BingCheckbox/BingCheckbox.vue.d.ts +4 -4
- package/dist/components/BingCheckbox/BingCheckbox.vue_vue_type_script_setup_true_lang.js +233 -0
- package/dist/components/BingCheckboxGroup/BingCheckboxGroup.context.js +4 -0
- package/dist/components/BingCheckboxGroup/BingCheckboxGroup.js +7 -0
- package/dist/components/BingCheckboxGroup/BingCheckboxGroup.vue.d.ts +4 -4
- package/dist/components/BingCheckboxGroup/BingCheckboxGroup.vue_vue_type_script_setup_true_lang.js +105 -0
- package/dist/components/BingCodeBlock/BingCodeBlock.highlight.js +78 -0
- package/dist/components/BingCodeBlock/BingCodeBlock.js +7 -0
- package/dist/components/BingCodeBlock/BingCodeBlock.vue_vue_type_script_setup_true_lang.js +347 -0
- package/dist/components/BingColorPicker/BingColorPicker.js +7 -0
- package/dist/components/BingColorPicker/BingColorPicker.utils.d.ts +70 -0
- package/dist/components/BingColorPicker/BingColorPicker.utils.js +265 -0
- package/dist/components/BingColorPicker/BingColorPicker.vue.d.ts +7 -7
- package/dist/components/BingColorPicker/BingColorPicker.vue_vue_type_script_setup_true_lang.js +540 -0
- package/dist/components/BingColorPicker/BingColorPickerFormatEditor.js +7 -0
- package/dist/components/BingColorPicker/BingColorPickerFormatEditor.vue.d.ts +27 -0
- package/dist/components/BingColorPicker/BingColorPickerFormatEditor.vue_vue_type_script_setup_true_lang.js +142 -0
- package/dist/components/BingColorPicker/BingColorPickerSpectrum.js +7 -0
- package/dist/components/BingColorPicker/BingColorPickerSpectrum.vue.d.ts +26 -0
- package/dist/components/BingColorPicker/BingColorPickerSpectrum.vue_vue_type_script_setup_true_lang.js +168 -0
- package/dist/components/BingConfigProvider/BingConfigProvider.js +5 -0
- package/dist/components/BingConfigProvider/BingConfigProvider.types.d.ts +5 -0
- package/dist/components/BingConfigProvider/BingConfigProvider.vue.d.ts +18 -0
- package/dist/components/BingConfigProvider/BingConfigProvider.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/components/BingConfigProvider/index.d.ts +3 -0
- package/dist/components/BingCursor/BingCursor.controller.js +240 -0
- package/dist/components/BingCursor/BingCursor.js +7 -0
- package/dist/components/BingCursor/BingCursor.native.js +20 -0
- package/dist/components/BingCursor/BingCursor.presets.js +60 -0
- package/dist/components/BingCursor/BingCursor.shapes.js +83 -0
- package/dist/components/BingCursor/BingCursor.styleSource.js +83 -0
- package/dist/components/BingCursor/BingCursor.vue_vue_type_script_setup_true_lang.js +73 -0
- package/dist/components/BingDatePicker/BingDatePicker.js +7 -0
- package/dist/components/BingDatePicker/BingDatePicker.utils.d.ts +26 -0
- package/dist/components/BingDatePicker/BingDatePicker.utils.js +137 -0
- package/dist/components/BingDatePicker/BingDatePicker.vue.d.ts +14 -14
- package/dist/components/BingDatePicker/BingDatePicker.vue_vue_type_script_setup_true_lang.js +804 -0
- package/dist/components/BingDatePicker/BingDatePickerCalendar.js +7 -0
- package/dist/components/BingDatePicker/BingDatePickerCalendar.vue.d.ts +37 -0
- package/dist/components/BingDatePicker/BingDatePickerCalendar.vue_vue_type_script_setup_true_lang.js +248 -0
- package/dist/components/BingDatePicker/BingDatePickerTimePanel.js +7 -0
- package/dist/components/BingDatePicker/BingDatePickerTimePanel.vue.d.ts +26 -0
- package/dist/components/BingDatePicker/BingDatePickerTimePanel.vue_vue_type_script_setup_true_lang.js +97 -0
- package/dist/components/BingDeckTransition/BingDeckTransition.js +7 -0
- package/dist/components/BingDeckTransition/BingDeckTransition.vue_vue_type_script_setup_true_lang.js +187 -0
- package/dist/components/BingDialog/BingDialog.js +7 -0
- package/dist/components/BingDialog/BingDialog.vue.d.ts +4 -5
- package/dist/components/BingDialog/BingDialog.vue_vue_type_script_setup_true_lang.js +558 -0
- package/dist/components/BingDropDown/BingDropDown.context.js +4 -0
- package/dist/components/BingDropDown/BingDropDown.js +7 -0
- package/dist/components/BingDropDown/BingDropDown.vue.d.ts +1 -2
- package/dist/components/BingDropDown/BingDropDown.vue_vue_type_script_setup_true_lang.js +649 -0
- package/dist/components/BingDropDown/BingDropDownItem.js +7 -0
- package/dist/components/BingDropDown/BingDropDownItem.vue.d.ts +1 -1
- package/dist/components/BingDropDown/BingDropDownItem.vue_vue_type_script_setup_true_lang.js +308 -0
- package/dist/components/BingFilePreview/BingFilePreview.js +7 -0
- package/dist/components/BingFilePreview/BingFilePreview.vue.d.ts +4 -5
- package/dist/components/BingFilePreview/BingFilePreview.vue_vue_type_script_setup_true_lang.js +589 -0
- package/dist/components/BingForm/BingForm.context.js +7 -0
- package/dist/components/BingForm/BingForm.js +7 -0
- package/dist/components/BingForm/BingForm.vue.d.ts +0 -1
- package/dist/components/BingForm/BingForm.vue_vue_type_script_setup_true_lang.js +300 -0
- package/dist/components/BingForm/formFocus.js +13 -0
- package/dist/components/BingForm/formTabOrder.js +27 -0
- package/dist/components/BingForm/useFormControl.d.ts +1 -1
- package/dist/components/BingForm/useFormControl.js +24 -0
- package/dist/components/BingForm/useFormNextHint.js +135 -0
- package/dist/components/BingFormItem/BingFormItem.js +7 -0
- package/dist/components/BingFormItem/BingFormItem.vue.d.ts +1 -1
- package/dist/components/BingFormItem/BingFormItem.vue_vue_type_script_setup_true_lang.js +252 -0
- package/dist/components/BingIcon/BingIcon.js +7 -0
- package/dist/components/BingIcon/BingIcon.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/components/BingImage/BingImage.js +7 -0
- package/dist/components/BingImage/BingImage.vue_vue_type_script_setup_true_lang.js +244 -0
- package/dist/components/BingImagePreview/BingImagePreview.js +7 -0
- package/dist/components/BingImagePreview/BingImagePreview.vue.d.ts +4 -5
- package/dist/components/BingImagePreview/BingImagePreview.vue_vue_type_script_setup_true_lang.js +699 -0
- package/dist/components/BingInput/BingInput.js +7 -0
- package/dist/components/BingInput/BingInput.vue.d.ts +6 -6
- package/dist/components/BingInput/BingInput.vue_vue_type_script_setup_true_lang.js +311 -0
- package/dist/components/BingRadio/BingRadio.js +7 -0
- package/dist/components/BingRadio/BingRadio.vue.d.ts +4 -4
- package/dist/components/BingRadio/BingRadio.vue_vue_type_script_setup_true_lang.js +170 -0
- package/dist/components/BingRadioGroup/BingRadioGroup.context.js +4 -0
- package/dist/components/BingRadioGroup/BingRadioGroup.js +7 -0
- package/dist/components/BingRadioGroup/BingRadioGroup.vue.d.ts +4 -4
- package/dist/components/BingRadioGroup/BingRadioGroup.vue_vue_type_script_setup_true_lang.js +125 -0
- package/dist/components/BingResizable/BingResizable.js +7 -0
- package/dist/components/BingResizable/BingResizable.vue.d.ts +1 -1
- package/dist/components/BingResizable/BingResizable.vue_vue_type_script_setup_true_lang.js +555 -0
- package/dist/components/BingScrollbar/BingScrollbar.js +7 -0
- package/dist/components/BingScrollbar/BingScrollbar.vue.d.ts +2 -2
- package/dist/components/BingScrollbar/BingScrollbar.vue_vue_type_script_setup_true_lang.js +398 -0
- package/dist/components/BingSelect/BingSelect.js +7 -0
- package/dist/components/BingSelect/BingSelect.vue.d.ts +7 -7
- package/dist/components/BingSelect/BingSelect.vue_vue_type_script_setup_true_lang.js +1066 -0
- package/dist/components/BingSlider/BingSlider.js +7 -0
- package/dist/components/BingSlider/BingSlider.vue.d.ts +6 -6
- package/dist/components/BingSlider/BingSlider.vue_vue_type_script_setup_true_lang.js +130 -0
- package/dist/components/BingSortableList/BingSortableList.js +7 -0
- package/dist/components/BingSortableList/BingSortableList.vue_vue_type_script_setup_true_lang.js +334 -0
- package/dist/components/BingSortableList/BingSortableListItem.js +7 -0
- package/dist/components/BingSortableList/BingSortableListItem.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/components/BingSplitPane/BingSplitPane.js +7 -0
- package/dist/components/BingSplitPane/BingSplitPane.vue_vue_type_script_setup_true_lang.js +167 -0
- package/dist/components/BingTable/BingTable.js +7 -0
- package/dist/components/BingTable/BingTable.measurements.js +72 -0
- package/dist/components/BingTable/BingTable.vue.d.ts +1 -2
- package/dist/components/BingTable/BingTable.vue_vue_type_script_setup_true_lang.js +1416 -0
- package/dist/components/BingTable/BingTableCellValue.js +7 -0
- package/dist/components/BingTable/BingTableCellValue.vue_vue_type_script_setup_true_lang.js +68 -0
- package/dist/components/BingTable/BingTableHeaderCell.js +5 -0
- package/dist/components/BingTable/BingTableHeaderCell.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/components/BingTable/BingTableHeaderContent.js +7 -0
- package/dist/components/BingTable/BingTableHeaderContent.vue_vue_type_script_setup_true_lang.js +110 -0
- package/dist/components/BingTable/useTableColumns.js +126 -0
- package/dist/components/BingTableColumnControls/BingTableColumnControls.js +7 -0
- package/dist/components/BingTableColumnControls/BingTableColumnControls.vue.d.ts +1 -1
- package/dist/components/BingTableColumnControls/BingTableColumnControls.vue_vue_type_script_setup_true_lang.js +251 -0
- package/dist/components/BingTabs/BingTabs.js +7 -0
- package/dist/components/BingTabs/BingTabs.vue.d.ts +2 -3
- package/dist/components/BingTabs/BingTabs.vue_vue_type_script_setup_true_lang.js +320 -0
- package/dist/components/BingTag/BingTag.js +7 -0
- package/dist/components/BingTag/BingTag.vue.d.ts +0 -1
- package/dist/components/BingTag/BingTag.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/components/BingTextarea/BingTextarea.js +7 -0
- package/dist/components/BingTextarea/BingTextarea.vue.d.ts +6 -6
- package/dist/components/BingTextarea/BingTextarea.vue_vue_type_script_setup_true_lang.js +243 -0
- package/dist/components/BingToast/BingToast.js +7 -0
- package/dist/components/BingToast/BingToast.service.js +132 -0
- package/dist/components/BingToast/BingToast.types.d.ts +1 -1
- package/dist/components/BingToast/BingToast.types.js +19 -0
- package/dist/components/BingToast/BingToast.vue.d.ts +0 -1
- package/dist/components/BingToast/BingToast.vue_vue_type_script_setup_true_lang.js +307 -0
- package/dist/components/BingTooltip/BingTooltip.js +7 -0
- package/dist/components/BingTooltip/BingTooltip.shared.js +14 -0
- package/dist/components/BingTooltip/BingTooltip.vue.d.ts +4 -5
- package/dist/components/BingTooltip/BingTooltip.vue_vue_type_script_setup_true_lang.js +572 -0
- package/dist/components/BingTreeSelect/BingTreeSelect.js +7 -0
- package/dist/components/BingTreeSelect/BingTreeSelect.vue.d.ts +7 -7
- package/dist/components/BingTreeSelect/BingTreeSelect.vue_vue_type_script_setup_true_lang.js +1274 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/icons/LICENSE-lucide.txt +39 -0
- package/dist/icons/createIcon.d.ts +8 -0
- package/dist/icons/createIcon.js +36 -0
- package/dist/icons/icons.d.ts +51 -0
- package/dist/icons/icons.js +252 -0
- package/dist/icons/index.d.ts +3 -0
- package/dist/index.js +48 -0
- package/dist/motion/clickParticles.d.ts +1 -1
- package/dist/motion/clickParticles2.js +66 -0
- package/dist/motion/index.d.ts +1 -1
- package/dist/motion/index.js +17 -0
- package/dist/motion/liquidHover.js +36 -0
- package/dist/motion/optionDetailMotion.d.ts +7 -1
- package/dist/motion/optionDetailMotion.js +74 -0
- package/dist/motion/panelMotion.js +19 -0
- package/dist/motion/reducedMotion.d.ts +16 -0
- package/dist/motion/reducedMotion.js +28 -0
- package/dist/motion/selectPanelMotion.js +115 -0
- package/dist/motion/smoothScroll.d.ts +2 -0
- package/dist/motion/smoothScroll.js +276 -0
- package/dist/motion/useClickFeedback.js +47 -0
- package/dist/motion/useTextControlCaret.js +136 -0
- package/dist/utils/clipboard.d.ts +9 -0
- package/dist/utils/clipboard.js +16 -0
- package/dist/utils/config.d.ts +42 -0
- package/dist/utils/config.js +37 -0
- package/dist/utils/controlAttrs.js +37 -0
- package/dist/utils/floating.d.ts +86 -0
- package/dist/utils/floating.js +99 -0
- package/dist/utils/glass.js +25 -0
- package/dist/utils/overlay.js +94 -0
- package/dist/utils/scrollLock.js +44 -0
- package/dist/utils/search.d.ts +16 -0
- package/dist/utils/search.js +23 -0
- package/dist/utils/useClientReady.js +10 -0
- package/dist/utils/useDeferredBlurValidation.d.ts +18 -0
- package/dist/utils/useDeferredBlurValidation.js +34 -0
- package/dist/utils/useKeyboardScrollSync.d.ts +11 -0
- package/dist/utils/useKeyboardScrollSync.js +28 -0
- package/dist/utils/useOptionDetailPanel.d.ts +50 -0
- package/dist/utils/useOptionDetailPanel.js +180 -0
- package/dist/utils/useOutsidePointerDown.d.ts +8 -0
- package/dist/utils/useOutsidePointerDown.js +17 -0
- package/dist/utils/useSearchShortcutFocus.d.ts +18 -0
- package/dist/utils/useSearchShortcutFocus.js +47 -0
- package/dist/utils/useVirtualList.d.ts +42 -0
- package/dist/utils/useVirtualList.js +74 -0
- package/package.json +15 -9
- package/dist/bing-ui.es.js +0 -31276
- package/dist/bing-ui.umd.js +0 -229
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import { useConfigSize as e } from "../../utils/config.js";
|
|
2
|
+
import { useReducedMotion as t } from "../../motion/reducedMotion.js";
|
|
3
|
+
import { useClickFeedback as n } from "../../motion/useClickFeedback.js";
|
|
4
|
+
import { compactSmoothScrollOptions as r, resolveComponentSmoothScroll as i } from "../../motion/smoothScroll.js";
|
|
5
|
+
import a from "../BingScrollbar/BingScrollbar.js";
|
|
6
|
+
import { Fragment as o, computed as s, createBlock as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, defineComponent as f, mergeProps as p, nextTick as m, normalizeClass as h, onBeforeUnmount as g, onBeforeUpdate as _, onMounted as v, openBlock as y, ref as b, renderList as ee, renderSlot as te, toDisplayString as ne, watch as x, withCtx as S } from "vue";
|
|
7
|
+
import { gsap as C } from "gsap";
|
|
8
|
+
//#region src/components/BingTabs/BingTabs.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
var re = ["aria-label"], ie = [
|
|
10
|
+
"aria-selected",
|
|
11
|
+
"aria-disabled",
|
|
12
|
+
"aria-label",
|
|
13
|
+
"disabled",
|
|
14
|
+
"tabindex",
|
|
15
|
+
"onClick",
|
|
16
|
+
"onKeydown",
|
|
17
|
+
"onFocus",
|
|
18
|
+
"onBlur"
|
|
19
|
+
], ae = { class: "bing-tabs__tab-surface" }, w = { class: "bing-tabs__tab-content" }, T = /* @__PURE__ */ f({
|
|
20
|
+
inheritAttrs: !1,
|
|
21
|
+
__name: "BingTabs",
|
|
22
|
+
props: {
|
|
23
|
+
modelValue: { default: void 0 },
|
|
24
|
+
items: { default: () => [] },
|
|
25
|
+
size: {},
|
|
26
|
+
variant: { default: "pill" },
|
|
27
|
+
activation: { default: "auto" },
|
|
28
|
+
disabled: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: !1
|
|
31
|
+
},
|
|
32
|
+
block: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: !1
|
|
35
|
+
},
|
|
36
|
+
loop: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: !0
|
|
39
|
+
},
|
|
40
|
+
animated: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: !0
|
|
43
|
+
},
|
|
44
|
+
respectReducedMotion: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: !0
|
|
47
|
+
},
|
|
48
|
+
smoothScroll: {
|
|
49
|
+
type: [Boolean, Object],
|
|
50
|
+
default: !0
|
|
51
|
+
},
|
|
52
|
+
ariaLabel: { default: "标签页" }
|
|
53
|
+
},
|
|
54
|
+
emits: [
|
|
55
|
+
"update:modelValue",
|
|
56
|
+
"change",
|
|
57
|
+
"focus",
|
|
58
|
+
"blur"
|
|
59
|
+
],
|
|
60
|
+
setup(f, { emit: T }) {
|
|
61
|
+
let { playClickFeedback: oe } = n(), se = t(), E = f, D = T, O = e(() => E.size), k = b(null), A = b(null), j = b(null), M = b([]), N = b(void 0), P = b(-1), F = b(!1), I, L, R = 0, z = s(() => E.modelValue !== void 0), ce = s(() => E.items.filter((e) => !e.disabled)), le = s(() => ce.value[0]), B = s(() => z.value ? E.modelValue : N.value ?? le.value?.value), V = s(() => E.items.findIndex((e) => Object.is(e.value, B.value))), ue = s(() => [
|
|
62
|
+
"bing-tabs",
|
|
63
|
+
`bing-tabs--${E.variant}`,
|
|
64
|
+
`bing-tabs--${O.value}`,
|
|
65
|
+
{
|
|
66
|
+
"is-block": E.block,
|
|
67
|
+
"is-disabled": E.disabled,
|
|
68
|
+
"is-indicator-ready": F.value
|
|
69
|
+
}
|
|
70
|
+
]), H = s(() => i(E.smoothScroll, r, {
|
|
71
|
+
keyboard: !1,
|
|
72
|
+
smoothTouchpad: !1,
|
|
73
|
+
respectReducedMotion: !0
|
|
74
|
+
}));
|
|
75
|
+
function U() {
|
|
76
|
+
return typeof window < "u";
|
|
77
|
+
}
|
|
78
|
+
function de() {
|
|
79
|
+
return !E.animated || E.respectReducedMotion && se();
|
|
80
|
+
}
|
|
81
|
+
function W(e, t) {
|
|
82
|
+
let n = t === "left" ? "borderLeftWidth" : "borderTopWidth", r = Number.parseFloat(window.getComputedStyle(e)[n]);
|
|
83
|
+
return Number.isFinite(r) ? r : t === "left" ? e.clientLeft : e.clientTop;
|
|
84
|
+
}
|
|
85
|
+
function G(e) {
|
|
86
|
+
return E.disabled || !!e.disabled;
|
|
87
|
+
}
|
|
88
|
+
function fe(e, t) {
|
|
89
|
+
e instanceof HTMLButtonElement && (M.value[t] = e);
|
|
90
|
+
}
|
|
91
|
+
function pe(e) {
|
|
92
|
+
return e.querySelector(".bing-tabs__tab-surface") ?? e;
|
|
93
|
+
}
|
|
94
|
+
function me(e) {
|
|
95
|
+
return G(E.items[e]) ? -1 : P.value >= 0 ? P.value === e ? 0 : -1 : V.value === e ? 0 : -1;
|
|
96
|
+
}
|
|
97
|
+
function K(e, t) {
|
|
98
|
+
let n = E.items.length;
|
|
99
|
+
if (n === 0) return -1;
|
|
100
|
+
let r = e;
|
|
101
|
+
for (let e = 0; e < n; e += 1) {
|
|
102
|
+
if (r += t, E.loop) r = (r + n) % n;
|
|
103
|
+
else if (r < 0 || r >= n) return -1;
|
|
104
|
+
let e = E.items[r];
|
|
105
|
+
if (e && !G(e)) return r;
|
|
106
|
+
}
|
|
107
|
+
return -1;
|
|
108
|
+
}
|
|
109
|
+
function q(e) {
|
|
110
|
+
let t = (e === "first" ? E.items : [...E.items].reverse()).findIndex((e) => !G(e));
|
|
111
|
+
return t < 0 ? -1 : e === "first" ? t : E.items.length - 1 - t;
|
|
112
|
+
}
|
|
113
|
+
function he(e) {
|
|
114
|
+
return E.items.find((t) => Object.is(t.value, e));
|
|
115
|
+
}
|
|
116
|
+
function J() {
|
|
117
|
+
return U() && !!k.value?.contains(document.activeElement);
|
|
118
|
+
}
|
|
119
|
+
function Y(e = !1) {
|
|
120
|
+
if (E.activation !== "auto" || V.value < 0) return;
|
|
121
|
+
let t = E.items[V.value];
|
|
122
|
+
!t || G(t) || (P.value = V.value, e && J() && Z(V.value));
|
|
123
|
+
}
|
|
124
|
+
function X(e, t) {
|
|
125
|
+
if (G(e)) {
|
|
126
|
+
t.preventDefault();
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
oe(t, M.value[E.items.indexOf(e)]);
|
|
130
|
+
let n = B.value;
|
|
131
|
+
if (Object.is(n, e.value)) return;
|
|
132
|
+
z.value || (N.value = e.value);
|
|
133
|
+
let r = {
|
|
134
|
+
value: e.value,
|
|
135
|
+
previousValue: n,
|
|
136
|
+
item: e,
|
|
137
|
+
previousItem: he(n),
|
|
138
|
+
event: t
|
|
139
|
+
};
|
|
140
|
+
D("update:modelValue", e.value), D("change", r);
|
|
141
|
+
}
|
|
142
|
+
function ge(e, t, n) {
|
|
143
|
+
n.defaultPrevented || (P.value = t, X(e, n));
|
|
144
|
+
}
|
|
145
|
+
function Z(e) {
|
|
146
|
+
let t = M.value[e];
|
|
147
|
+
t && (A.value?.stop(), P.value = e, t.focus());
|
|
148
|
+
}
|
|
149
|
+
function Q(e, t) {
|
|
150
|
+
let n = E.items[e];
|
|
151
|
+
!n || G(n) || (t.preventDefault(), Z(e), E.activation === "auto" && (X(n, t), m().then(() => {
|
|
152
|
+
Object.is(B.value, n.value) || Y(!0);
|
|
153
|
+
})));
|
|
154
|
+
}
|
|
155
|
+
function _e(e, t) {
|
|
156
|
+
if (t.key === "ArrowRight" || t.key === "ArrowDown") {
|
|
157
|
+
Q(K(e, 1), t);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
if (t.key === "ArrowLeft" || t.key === "ArrowUp") {
|
|
161
|
+
Q(K(e, -1), t);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (t.key === "Home") {
|
|
165
|
+
Q(q("first"), t);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
if (t.key === "End") {
|
|
169
|
+
Q(q("last"), t);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
if (t.key === "Enter" || t.key === " ") {
|
|
173
|
+
let n = E.items[e];
|
|
174
|
+
if (!n) return;
|
|
175
|
+
t.preventDefault(), X(n, t);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
function ve(e, t, n) {
|
|
179
|
+
A.value?.stop(), P.value = t, D("focus", {
|
|
180
|
+
value: e.value,
|
|
181
|
+
item: e,
|
|
182
|
+
event: n
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
function ye(e, t) {
|
|
186
|
+
k.value?.contains(t.relatedTarget) || (P.value = -1), D("blur", {
|
|
187
|
+
value: e.value,
|
|
188
|
+
item: e,
|
|
189
|
+
event: t
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
function be(e) {
|
|
193
|
+
if (H.value !== !1 && (A.value?.handleWheel(e) ?? !1) || e.defaultPrevented || !k.value) return;
|
|
194
|
+
let t = e.deltaX || (e.shiftKey ? e.deltaY : 0), n = Math.max(0, k.value.scrollWidth - k.value.clientWidth);
|
|
195
|
+
n > .5 && (t < 0 ? k.value.scrollLeft > .5 : t > 0 && k.value.scrollLeft < n - .5) && e.stopPropagation();
|
|
196
|
+
}
|
|
197
|
+
function xe(e = !0) {
|
|
198
|
+
U() && (R && window.cancelAnimationFrame(R), R = window.requestAnimationFrame(() => {
|
|
199
|
+
R = 0, $(e);
|
|
200
|
+
}));
|
|
201
|
+
}
|
|
202
|
+
function $(e = !0) {
|
|
203
|
+
let t = k.value, n = j.value, r = M.value[V.value];
|
|
204
|
+
if (!t || !n || !r || V.value < 0) {
|
|
205
|
+
n && C.set(n, { autoAlpha: 0 }), F.value = !1;
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
let i = t.getBoundingClientRect(), a = pe(r).getBoundingClientRect(), o = n.getBoundingClientRect(), s = W(t, "left"), c = W(t, "top"), l = Math.max(1, a.width), u = Math.max(1, a.height), d = a.left - i.left - s + t.scrollLeft, f = a.top - i.top - c, p = F.value && o.width > 0 && o.height > 0, m = p ? o.left - i.left - s + t.scrollLeft : d, h = p ? o.top - i.top - c : f, g = p ? o.width / l : 1, _ = p ? o.height / u : 1, v = e && p && !de();
|
|
209
|
+
I?.kill(), C.set(n, {
|
|
210
|
+
width: l,
|
|
211
|
+
height: u,
|
|
212
|
+
transformOrigin: "0 0",
|
|
213
|
+
willChange: "transform, opacity"
|
|
214
|
+
}), v ? I = C.fromTo(n, {
|
|
215
|
+
x: m,
|
|
216
|
+
y: h,
|
|
217
|
+
scaleX: g,
|
|
218
|
+
scaleY: _,
|
|
219
|
+
autoAlpha: 1
|
|
220
|
+
}, {
|
|
221
|
+
x: d,
|
|
222
|
+
y: f,
|
|
223
|
+
scaleX: 1,
|
|
224
|
+
scaleY: 1,
|
|
225
|
+
autoAlpha: 1,
|
|
226
|
+
duration: .42,
|
|
227
|
+
ease: "power3.out",
|
|
228
|
+
overwrite: "auto",
|
|
229
|
+
force3D: !0,
|
|
230
|
+
onComplete: () => {
|
|
231
|
+
I = void 0;
|
|
232
|
+
}
|
|
233
|
+
}) : C.set(n, {
|
|
234
|
+
x: d,
|
|
235
|
+
y: f,
|
|
236
|
+
scaleX: 1,
|
|
237
|
+
scaleY: 1,
|
|
238
|
+
autoAlpha: 1,
|
|
239
|
+
force3D: !0
|
|
240
|
+
}), F.value = !0;
|
|
241
|
+
}
|
|
242
|
+
return _(() => {
|
|
243
|
+
M.value = [];
|
|
244
|
+
}), v(() => {
|
|
245
|
+
m().then(() => {
|
|
246
|
+
$(!1);
|
|
247
|
+
}), typeof ResizeObserver < "u" && k.value && (L = new ResizeObserver(() => {
|
|
248
|
+
xe(!1);
|
|
249
|
+
}), L.observe(k.value));
|
|
250
|
+
}), g(() => {
|
|
251
|
+
I?.kill(), A.value?.stop(), R && U() && window.cancelAnimationFrame(R), L?.disconnect();
|
|
252
|
+
}), x(() => E.smoothScroll, () => A.value?.stop(), { deep: !0 }), x(() => [
|
|
253
|
+
B.value,
|
|
254
|
+
E.items.length,
|
|
255
|
+
O.value,
|
|
256
|
+
E.variant,
|
|
257
|
+
E.block
|
|
258
|
+
], () => {
|
|
259
|
+
m().then(() => {
|
|
260
|
+
$(!0);
|
|
261
|
+
});
|
|
262
|
+
}), x(V, () => {
|
|
263
|
+
P.value < 0 || !J() || m().then(() => {
|
|
264
|
+
Y(!0);
|
|
265
|
+
});
|
|
266
|
+
}), (e, t) => (y(), c(a, {
|
|
267
|
+
ref_key: "scrollbarRef",
|
|
268
|
+
ref: A,
|
|
269
|
+
class: h(["bing-tabs__scroll", { "is-block": f.block }]),
|
|
270
|
+
vertical: !1,
|
|
271
|
+
horizontal: "",
|
|
272
|
+
focusable: !1,
|
|
273
|
+
smooth: H.value
|
|
274
|
+
}, {
|
|
275
|
+
viewport: S(({ viewportRef: t, viewportAttrs: n }) => [u("div", p(p(e.$attrs, {
|
|
276
|
+
...n,
|
|
277
|
+
onWheel: be
|
|
278
|
+
}), {
|
|
279
|
+
ref: (e) => {
|
|
280
|
+
k.value = e, t(e);
|
|
281
|
+
},
|
|
282
|
+
class: ue.value,
|
|
283
|
+
role: "tablist",
|
|
284
|
+
"aria-orientation": "horizontal",
|
|
285
|
+
"aria-label": f.ariaLabel
|
|
286
|
+
}), [u("span", {
|
|
287
|
+
ref_key: "indicatorRef",
|
|
288
|
+
ref: j,
|
|
289
|
+
class: "bing-tabs__indicator",
|
|
290
|
+
"aria-hidden": "true"
|
|
291
|
+
}, null, 512), (y(!0), l(o, null, ee(f.items, (t, n) => (y(), l("button", {
|
|
292
|
+
key: String(t.value),
|
|
293
|
+
ref_for: !0,
|
|
294
|
+
ref: (e) => fe(e, n),
|
|
295
|
+
class: h(["bing-tabs__tab", {
|
|
296
|
+
"is-active": Object.is(t.value, B.value),
|
|
297
|
+
"is-disabled": G(t)
|
|
298
|
+
}]),
|
|
299
|
+
type: "button",
|
|
300
|
+
role: "tab",
|
|
301
|
+
"aria-selected": Object.is(t.value, B.value),
|
|
302
|
+
"aria-disabled": G(t) || void 0,
|
|
303
|
+
"aria-label": t.ariaLabel,
|
|
304
|
+
disabled: G(t),
|
|
305
|
+
tabindex: me(n),
|
|
306
|
+
onClick: (e) => ge(t, n, e),
|
|
307
|
+
onKeydown: (e) => _e(n, e),
|
|
308
|
+
onFocus: (e) => ve(t, n, e),
|
|
309
|
+
onBlur: (e) => ye(t, e)
|
|
310
|
+
}, [u("span", ae, [u("span", w, [te(e.$slots, "item", {
|
|
311
|
+
item: t,
|
|
312
|
+
active: Object.is(t.value, B.value),
|
|
313
|
+
disabled: G(t)
|
|
314
|
+
}, () => [d(ne(t.label), 1)], !0)])])], 42, ie))), 128))], 16, re)]),
|
|
315
|
+
_: 3
|
|
316
|
+
}, 8, ["class", "smooth"]));
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
//#endregion
|
|
320
|
+
export { T as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./BingTag.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/components/BingTag/BingTag.vue
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-fde45373"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { n as default };
|
|
@@ -11,7 +11,6 @@ declare const __VLS_base: import('vue').DefineComponent<BingTagProps, {}, {}, {}
|
|
|
11
11
|
disabled: boolean;
|
|
12
12
|
label: string;
|
|
13
13
|
variant: import('./BingTag.types').BingTagVariant;
|
|
14
|
-
size: import('./BingTag.types').BingTagSize;
|
|
15
14
|
tone: import('./BingTag.types').BingTagTone;
|
|
16
15
|
closable: boolean;
|
|
17
16
|
closeAriaLabel: string;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { useConfigSize as e } from "../../utils/config.js";
|
|
2
|
+
import t from "../BingButton/BingButton.js";
|
|
3
|
+
import { X as n } from "../../icons/icons.js";
|
|
4
|
+
import r from "../BingIcon/BingIcon.js";
|
|
5
|
+
import { computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, normalizeClass as f, openBlock as p, renderSlot as m, toDisplayString as h, unref as g, withCtx as _, withModifiers as v } from "vue";
|
|
6
|
+
//#region src/components/BingTag/BingTag.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var y = { class: "bing-tag__label" }, b = /* @__PURE__ */ d({
|
|
8
|
+
__name: "BingTag",
|
|
9
|
+
props: {
|
|
10
|
+
label: { default: void 0 },
|
|
11
|
+
size: {},
|
|
12
|
+
tone: { default: "primary" },
|
|
13
|
+
variant: { default: "glass" },
|
|
14
|
+
closable: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: !1
|
|
17
|
+
},
|
|
18
|
+
disabled: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: !1
|
|
21
|
+
},
|
|
22
|
+
closeAriaLabel: { default: void 0 }
|
|
23
|
+
},
|
|
24
|
+
emits: ["close"],
|
|
25
|
+
setup(d, { emit: b }) {
|
|
26
|
+
let x = d, S = b, C = e(() => x.size), w = i(() => [
|
|
27
|
+
"bing-tag",
|
|
28
|
+
`bing-tag--${C.value}`,
|
|
29
|
+
`bing-tag--${x.tone}`,
|
|
30
|
+
`bing-tag--${x.variant}`,
|
|
31
|
+
{
|
|
32
|
+
"is-closable": x.closable,
|
|
33
|
+
"is-disabled": x.disabled
|
|
34
|
+
}
|
|
35
|
+
]), T = i(() => x.closeAriaLabel ?? (x.label ? `移除 ${x.label}` : "移除标签"));
|
|
36
|
+
function E(e) {
|
|
37
|
+
if (e.stopPropagation(), x.disabled) {
|
|
38
|
+
e.preventDefault();
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
S("close", e);
|
|
42
|
+
}
|
|
43
|
+
return (e, i) => (p(), s("span", { class: f(w.value) }, [c("span", y, [m(e.$slots, "default", {}, () => [l(h(d.label), 1)], !0)]), d.closable ? (p(), a(t, {
|
|
44
|
+
key: 0,
|
|
45
|
+
variant: "ghost",
|
|
46
|
+
size: "xs",
|
|
47
|
+
rounded: "sm",
|
|
48
|
+
throttle: !1,
|
|
49
|
+
class: "bing-tag__close",
|
|
50
|
+
disabled: d.disabled,
|
|
51
|
+
"aria-label": T.value,
|
|
52
|
+
onMousedown: i[0] ||= v(() => {}, ["prevent", "stop"]),
|
|
53
|
+
onClick: E
|
|
54
|
+
}, {
|
|
55
|
+
prefix: _(() => [u(r, {
|
|
56
|
+
icon: g(n),
|
|
57
|
+
size: 12,
|
|
58
|
+
"stroke-width": 1.75
|
|
59
|
+
}, null, 8, ["icon"])]),
|
|
60
|
+
_: 1
|
|
61
|
+
}, 8, ["disabled", "aria-label"])) : o("", !0)], 2));
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
//#endregion
|
|
65
|
+
export { b as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./BingTextarea.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/components/BingTextarea/BingTextarea.vue
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-77e08710"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { n as default };
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { BingTextareaExpose, BingTextareaProps } from './BingTextarea.types';
|
|
2
2
|
declare const __VLS_export: import('vue').DefineComponent<BingTextareaProps, BingTextareaExpose, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
3
|
-
clear: () => any;
|
|
4
|
-
input: (value: string, event: Event) => any;
|
|
5
3
|
blur: (event: FocusEvent) => any;
|
|
6
4
|
focus: (event: FocusEvent) => any;
|
|
5
|
+
clear: () => any;
|
|
6
|
+
input: (value: string, event: Event) => any;
|
|
7
7
|
keydown: (event: KeyboardEvent) => any;
|
|
8
8
|
"update:modelValue": (value: string) => any;
|
|
9
9
|
}, string, import('vue').PublicProps, Readonly<BingTextareaProps> & Readonly<{
|
|
10
|
-
onClear?: (() => any) | undefined;
|
|
11
|
-
onInput?: ((value: string, event: Event) => any) | undefined;
|
|
12
10
|
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
13
11
|
onFocus?: ((event: FocusEvent) => any) | undefined;
|
|
12
|
+
onClear?: (() => any) | undefined;
|
|
13
|
+
onInput?: ((value: string, event: Event) => any) | undefined;
|
|
14
14
|
onKeydown?: ((event: KeyboardEvent) => any) | undefined;
|
|
15
15
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
16
16
|
}>, {
|
|
17
|
+
name: string;
|
|
18
|
+
status: "default" | "error" | "success" | "warning";
|
|
17
19
|
disabled: boolean;
|
|
18
20
|
resize: "none" | "vertical" | "horizontal" | "both";
|
|
19
21
|
id: string;
|
|
@@ -27,8 +29,6 @@ declare const __VLS_export: import('vue').DefineComponent<BingTextareaProps, Bin
|
|
|
27
29
|
smoothCaret: boolean;
|
|
28
30
|
clearAriaLabel: string;
|
|
29
31
|
ariaDescribedby: string;
|
|
30
|
-
status: "default" | "error" | "success" | "warning";
|
|
31
|
-
name: string;
|
|
32
32
|
autocomplete: string;
|
|
33
33
|
spellcheck: boolean | "true" | "false";
|
|
34
34
|
rows: number;
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { useFormControl as e } from "../BingForm/useFormControl.js";
|
|
2
|
+
import t from "../BingButton/BingButton.js";
|
|
3
|
+
import { useControlAttrs as n } from "../../utils/controlAttrs.js";
|
|
4
|
+
import { useTextControlCaret as r } from "../../motion/useTextControlCaret.js";
|
|
5
|
+
import { X as i } from "../../icons/icons.js";
|
|
6
|
+
import a from "../BingIcon/BingIcon.js";
|
|
7
|
+
import o from "../BingScrollbar/BingScrollbar.js";
|
|
8
|
+
import { computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createVNode as f, defineComponent as p, mergeProps as m, nextTick as h, onBeforeUnmount as ee, onMounted as g, openBlock as _, ref as v, toDisplayString as y, unref as b, useCssVars as x, watch as S, withCtx as C, withModifiers as w } from "vue";
|
|
9
|
+
//#region src/components/BingTextarea/BingTextarea.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
+
var T = [
|
|
11
|
+
"id",
|
|
12
|
+
"value",
|
|
13
|
+
"placeholder",
|
|
14
|
+
"disabled",
|
|
15
|
+
"readonly",
|
|
16
|
+
"rows",
|
|
17
|
+
"maxlength",
|
|
18
|
+
"name",
|
|
19
|
+
"autocomplete",
|
|
20
|
+
"spellcheck",
|
|
21
|
+
"aria-label",
|
|
22
|
+
"aria-describedby",
|
|
23
|
+
"aria-invalid"
|
|
24
|
+
], E = {
|
|
25
|
+
key: 1,
|
|
26
|
+
class: "bing-textarea__count",
|
|
27
|
+
"aria-live": "polite"
|
|
28
|
+
}, D = /* @__PURE__ */ p({
|
|
29
|
+
inheritAttrs: !1,
|
|
30
|
+
__name: "BingTextarea",
|
|
31
|
+
props: {
|
|
32
|
+
id: { default: void 0 },
|
|
33
|
+
modelValue: { default: "" },
|
|
34
|
+
placeholder: { default: void 0 },
|
|
35
|
+
disabled: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: void 0
|
|
38
|
+
},
|
|
39
|
+
readonly: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: !1
|
|
42
|
+
},
|
|
43
|
+
clearable: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: !0
|
|
46
|
+
},
|
|
47
|
+
smoothCaret: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: !0
|
|
50
|
+
},
|
|
51
|
+
rows: { default: 3 },
|
|
52
|
+
autosize: {
|
|
53
|
+
type: [Boolean, Object],
|
|
54
|
+
default: !1
|
|
55
|
+
},
|
|
56
|
+
maxLength: { default: void 0 },
|
|
57
|
+
showCount: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: !1
|
|
60
|
+
},
|
|
61
|
+
size: { default: void 0 },
|
|
62
|
+
block: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: !1
|
|
65
|
+
},
|
|
66
|
+
ariaLabel: { default: void 0 },
|
|
67
|
+
ariaDescribedby: { default: void 0 },
|
|
68
|
+
status: { default: void 0 },
|
|
69
|
+
name: { default: void 0 },
|
|
70
|
+
autocomplete: { default: void 0 },
|
|
71
|
+
spellcheck: {
|
|
72
|
+
type: [Boolean, String],
|
|
73
|
+
default: void 0
|
|
74
|
+
},
|
|
75
|
+
resize: { default: "vertical" },
|
|
76
|
+
clearAriaLabel: { default: "清空文本" }
|
|
77
|
+
},
|
|
78
|
+
emits: [
|
|
79
|
+
"update:modelValue",
|
|
80
|
+
"input",
|
|
81
|
+
"clear",
|
|
82
|
+
"focus",
|
|
83
|
+
"blur",
|
|
84
|
+
"keydown"
|
|
85
|
+
],
|
|
86
|
+
setup(p, { expose: D, emit: te }) {
|
|
87
|
+
x((e) => ({ v75cac693: e.resize }));
|
|
88
|
+
let O = p, k = te, { rootAttrs: A, controlAttrs: j } = n(), { formItem: M, resolvedId: N, resolvedSize: P, resolvedDisabled: F, resolvedStatus: I, resolvedAriaDescribedby: L } = e(O), R = v(null), z = v(null), B = v(null);
|
|
89
|
+
r(R, z, B, () => O.smoothCaret);
|
|
90
|
+
let V = v(null), H = v(null), U, W, G = !1, K = s(() => O.modelValue.length > 0), q = s(() => O.clearable && !O.readonly && !F.value && K.value), J = s(() => O.modelValue.length), Y = s(() => typeof O.maxLength == "number" ? `${J.value}/${O.maxLength}` : String(J.value)), X = s(() => [
|
|
91
|
+
"bing-textarea",
|
|
92
|
+
`bing-textarea--${P.value}`,
|
|
93
|
+
`bing-textarea--status-${I.value}`,
|
|
94
|
+
{
|
|
95
|
+
"is-block": O.block || !!M,
|
|
96
|
+
"is-disabled": F.value,
|
|
97
|
+
"is-invalid": I.value === "error",
|
|
98
|
+
"has-value": K.value,
|
|
99
|
+
"can-clear": q.value,
|
|
100
|
+
"has-footer": O.showCount,
|
|
101
|
+
"is-resizable": O.resize !== "none"
|
|
102
|
+
}
|
|
103
|
+
]);
|
|
104
|
+
function Z() {
|
|
105
|
+
if (O.autosize === !0) return {
|
|
106
|
+
minRows: O.rows,
|
|
107
|
+
maxRows: void 0
|
|
108
|
+
};
|
|
109
|
+
if (O.autosize) return {
|
|
110
|
+
minRows: O.autosize.minRows ?? O.rows,
|
|
111
|
+
maxRows: O.autosize.maxRows
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function Q() {
|
|
115
|
+
let e = R.value, t = Z();
|
|
116
|
+
if (!e) return;
|
|
117
|
+
if (!t) {
|
|
118
|
+
G &&= (e.style.height = "", e.style.overflowY = "", !1), V.value?.update();
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
G = !0;
|
|
122
|
+
let n = window.getComputedStyle(e), r = Number.parseFloat(n.lineHeight) || 20, i = Number.parseFloat(n.borderTopWidth) + Number.parseFloat(n.borderBottomWidth) + Number.parseFloat(n.paddingTop) + Number.parseFloat(n.paddingBottom), a = t.minRows * r + i, o = typeof t.maxRows == "number" ? t.maxRows * r + i : Infinity;
|
|
123
|
+
e.style.height = "0px", e.style.height = `${Math.max(a, Math.min(e.scrollHeight, o))}px`, e.style.overflowY = e.scrollHeight > o ? "auto" : "hidden", V.value?.update();
|
|
124
|
+
}
|
|
125
|
+
function ne(e) {
|
|
126
|
+
let t = e.target.value;
|
|
127
|
+
k("update:modelValue", t), k("input", t, e), M?.handleControlChange(), h(Q);
|
|
128
|
+
}
|
|
129
|
+
function re() {
|
|
130
|
+
q.value && (k("update:modelValue", ""), k("clear"), M?.handleControlChange(), h(Q), R.value?.focus());
|
|
131
|
+
}
|
|
132
|
+
function ie(e) {
|
|
133
|
+
k("focus", e);
|
|
134
|
+
}
|
|
135
|
+
function ae(e) {
|
|
136
|
+
k("blur", e), M?.handleControlBlur();
|
|
137
|
+
}
|
|
138
|
+
function $(e) {
|
|
139
|
+
e?.target instanceof Element && e.target.closest(".bing-scrollbar__rail") || R.value?.focus();
|
|
140
|
+
}
|
|
141
|
+
function oe() {
|
|
142
|
+
R.value?.blur();
|
|
143
|
+
}
|
|
144
|
+
function se() {
|
|
145
|
+
R.value?.select();
|
|
146
|
+
}
|
|
147
|
+
return S(() => [
|
|
148
|
+
O.modelValue,
|
|
149
|
+
O.autosize,
|
|
150
|
+
O.rows,
|
|
151
|
+
P.value
|
|
152
|
+
], () => {
|
|
153
|
+
h(Q);
|
|
154
|
+
}), g(() => {
|
|
155
|
+
if (Q(), !H.value || typeof ResizeObserver > "u") return;
|
|
156
|
+
let e = -1;
|
|
157
|
+
U = new ResizeObserver(([t]) => {
|
|
158
|
+
!t || t.contentRect.width === e || (e = t.contentRect.width, W !== void 0 && cancelAnimationFrame(W), W = requestAnimationFrame(() => {
|
|
159
|
+
W = void 0, Q();
|
|
160
|
+
}));
|
|
161
|
+
}), U.observe(H.value);
|
|
162
|
+
}), ee(() => {
|
|
163
|
+
U?.disconnect(), W !== void 0 && cancelAnimationFrame(W);
|
|
164
|
+
}), D({
|
|
165
|
+
get textarea() {
|
|
166
|
+
return R.value;
|
|
167
|
+
},
|
|
168
|
+
focus: $,
|
|
169
|
+
blur: oe,
|
|
170
|
+
select: se
|
|
171
|
+
}), (e, n) => (_(), u("div", m(b(A)(), {
|
|
172
|
+
ref_key: "rootRef",
|
|
173
|
+
ref: H,
|
|
174
|
+
class: X.value,
|
|
175
|
+
onClick: $
|
|
176
|
+
}), [
|
|
177
|
+
f(o, {
|
|
178
|
+
ref_key: "scrollbarRef",
|
|
179
|
+
ref: V,
|
|
180
|
+
class: "bing-textarea__scroll",
|
|
181
|
+
smooth: !1,
|
|
182
|
+
focusable: !1,
|
|
183
|
+
"min-thumb-size": 12,
|
|
184
|
+
horizontal: ""
|
|
185
|
+
}, {
|
|
186
|
+
viewport: C(({ viewportRef: e, viewportAttrs: t }) => [d("textarea", m(m(b(j)(), t), {
|
|
187
|
+
ref: (t) => {
|
|
188
|
+
R.value = t, e(t);
|
|
189
|
+
},
|
|
190
|
+
class: "bing-textarea__field",
|
|
191
|
+
id: b(N),
|
|
192
|
+
value: p.modelValue,
|
|
193
|
+
placeholder: p.placeholder,
|
|
194
|
+
disabled: b(F),
|
|
195
|
+
readonly: p.readonly,
|
|
196
|
+
rows: p.rows,
|
|
197
|
+
maxlength: p.maxLength ?? b(j)().maxlength,
|
|
198
|
+
name: p.name,
|
|
199
|
+
autocomplete: p.autocomplete,
|
|
200
|
+
spellcheck: p.spellcheck,
|
|
201
|
+
"aria-label": p.ariaLabel || void 0,
|
|
202
|
+
"aria-describedby": b(L),
|
|
203
|
+
"aria-invalid": b(I) === "error" || void 0,
|
|
204
|
+
onInput: ne,
|
|
205
|
+
onFocus: ie,
|
|
206
|
+
onBlur: ae,
|
|
207
|
+
onKeydown: n[0] ||= (e) => k("keydown", e)
|
|
208
|
+
}), null, 16, T), d("span", {
|
|
209
|
+
ref_key: "caretLayerRef",
|
|
210
|
+
ref: z,
|
|
211
|
+
class: "bing-textarea__caret-layer",
|
|
212
|
+
"aria-hidden": "true"
|
|
213
|
+
}, [d("span", {
|
|
214
|
+
ref_key: "caretRef",
|
|
215
|
+
ref: B,
|
|
216
|
+
class: "bing-textarea__caret"
|
|
217
|
+
}, null, 512)], 512)]),
|
|
218
|
+
_: 1
|
|
219
|
+
}, 512),
|
|
220
|
+
q.value ? (_(), c(t, {
|
|
221
|
+
key: 0,
|
|
222
|
+
variant: "ghost",
|
|
223
|
+
size: "xs",
|
|
224
|
+
rounded: "sm",
|
|
225
|
+
throttle: !1,
|
|
226
|
+
class: "bing-textarea__clear",
|
|
227
|
+
"aria-label": p.clearAriaLabel,
|
|
228
|
+
onMousedown: n[1] ||= w(() => {}, ["prevent"]),
|
|
229
|
+
onClick: w(re, ["stop"])
|
|
230
|
+
}, {
|
|
231
|
+
prefix: C(() => [f(a, {
|
|
232
|
+
icon: b(i),
|
|
233
|
+
size: "xs",
|
|
234
|
+
"stroke-width": 1.75
|
|
235
|
+
}, null, 8, ["icon"])]),
|
|
236
|
+
_: 1
|
|
237
|
+
}, 8, ["aria-label"])) : l("", !0),
|
|
238
|
+
p.showCount ? (_(), u("span", E, y(Y.value), 1)) : l("", !0)
|
|
239
|
+
], 16));
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
//#endregion
|
|
243
|
+
export { D as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./BingToast.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/components/BingToast/BingToast.vue
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-462e8ac5"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { n as default };
|