@moubing/bing-ui 0.11.2 → 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 -31278
- package/dist/bing-ui.umd.js +0 -229
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./BingDatePickerCalendar.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/components/BingDatePicker/BingDatePickerCalendar.vue
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-d03df976"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { n as default };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { default as dayjs, Dayjs } from 'dayjs';
|
|
2
|
+
import { BingDatePickerType } from './BingDatePicker.types';
|
|
3
|
+
import { DatePeriodUnit } from './BingDatePicker.utils';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
type: BingDatePickerType;
|
|
6
|
+
panel: 'date' | 'month' | 'year';
|
|
7
|
+
locale: string;
|
|
8
|
+
firstDayOfWeek: number;
|
|
9
|
+
canSwitchYear: boolean;
|
|
10
|
+
isSelected: (value: Dayjs, unit: DatePeriodUnit) => boolean;
|
|
11
|
+
isInRange: (value: Dayjs, unit: DatePeriodUnit) => boolean;
|
|
12
|
+
isDateDisabled: (value: Dayjs) => boolean;
|
|
13
|
+
isMonthDisabled: (value: Dayjs) => boolean;
|
|
14
|
+
isYearDisabled: (value: Dayjs) => boolean;
|
|
15
|
+
};
|
|
16
|
+
type __VLS_ModelProps = {
|
|
17
|
+
'month': Dayjs;
|
|
18
|
+
'year': number;
|
|
19
|
+
};
|
|
20
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
21
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
22
|
+
hover: (value: dayjs.Dayjs) => any;
|
|
23
|
+
select: (value: dayjs.Dayjs) => any;
|
|
24
|
+
"select-year": (value: dayjs.Dayjs) => any;
|
|
25
|
+
"open-year": () => any;
|
|
26
|
+
"update:month": (value: dayjs.Dayjs) => any;
|
|
27
|
+
"update:year": (value: number) => any;
|
|
28
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
29
|
+
onHover?: ((value: dayjs.Dayjs) => any) | undefined;
|
|
30
|
+
onSelect?: ((value: dayjs.Dayjs) => any) | undefined;
|
|
31
|
+
"onSelect-year"?: ((value: dayjs.Dayjs) => any) | undefined;
|
|
32
|
+
"onOpen-year"?: (() => any) | undefined;
|
|
33
|
+
"onUpdate:month"?: ((value: dayjs.Dayjs) => any) | undefined;
|
|
34
|
+
"onUpdate:year"?: ((value: number) => any) | undefined;
|
|
35
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
36
|
+
declare const _default: typeof __VLS_export;
|
|
37
|
+
export default _default;
|
package/dist/components/BingDatePicker/BingDatePickerCalendar.vue_vue_type_script_setup_true_lang.js
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { useClickFeedback as e } from "../../motion/useClickFeedback.js";
|
|
2
|
+
import t from "../BingButton/BingButton.js";
|
|
3
|
+
import { ChevronLeft as n, ChevronRight as r, ChevronsLeft as ee, ChevronsRight as i } from "../../icons/icons.js";
|
|
4
|
+
import a from "../BingIcon/BingIcon.js";
|
|
5
|
+
import o from "../BingTooltip/BingTooltip.js";
|
|
6
|
+
import { getCalendarCells as s, getMonthCells as te, getWeekdayLabels as ne, getYearBlockStart as c, getYearCells as l } from "./BingDatePicker.utils.js";
|
|
7
|
+
import { Fragment as u, computed as d, createBlock as f, createCommentVNode as re, createElementBlock as p, createElementVNode as m, createTextVNode as ie, createVNode as h, defineComponent as g, mergeModels as _, normalizeClass as v, openBlock as y, renderList as b, toDisplayString as x, unref as S, useModel as C, withCtx as w, withDirectives as T } from "vue";
|
|
8
|
+
import E from "dayjs";
|
|
9
|
+
//#region src/components/BingDatePicker/BingDatePickerCalendar.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
+
var D = { class: "bing-date-picker__calendar-shell" }, O = { class: "bing-date-picker__nav" }, k = { class: "bing-date-picker__nav-group" }, A = { class: "bing-date-picker__nav-group" }, j = { class: "bing-date-picker__nav-button-slot" }, M = {
|
|
11
|
+
key: 1,
|
|
12
|
+
class: "bing-date-picker__nav-button-slot is-empty",
|
|
13
|
+
"aria-hidden": "true"
|
|
14
|
+
}, N = { class: "bing-date-picker__weekdays" }, P = { class: "bing-date-picker__date-grid" }, F = [
|
|
15
|
+
"disabled",
|
|
16
|
+
"onMouseenter",
|
|
17
|
+
"onClick"
|
|
18
|
+
], I = { class: "bing-date-picker__cell-surface" }, L = {
|
|
19
|
+
key: 1,
|
|
20
|
+
class: "bing-date-picker__month-grid"
|
|
21
|
+
}, R = [
|
|
22
|
+
"disabled",
|
|
23
|
+
"onMouseenter",
|
|
24
|
+
"onClick"
|
|
25
|
+
], z = { class: "bing-date-picker__cell-surface" }, B = {
|
|
26
|
+
key: 2,
|
|
27
|
+
class: "bing-date-picker__year-grid"
|
|
28
|
+
}, V = [
|
|
29
|
+
"disabled",
|
|
30
|
+
"onMouseenter",
|
|
31
|
+
"onClick"
|
|
32
|
+
], ae = { class: "bing-date-picker__cell-surface" }, H = /* @__PURE__ */ g({
|
|
33
|
+
__name: "BingDatePickerCalendar",
|
|
34
|
+
props: /* @__PURE__ */ _({
|
|
35
|
+
type: {},
|
|
36
|
+
panel: {},
|
|
37
|
+
locale: {},
|
|
38
|
+
firstDayOfWeek: {},
|
|
39
|
+
canSwitchYear: { type: Boolean },
|
|
40
|
+
isSelected: { type: Function },
|
|
41
|
+
isInRange: { type: Function },
|
|
42
|
+
isDateDisabled: { type: Function },
|
|
43
|
+
isMonthDisabled: { type: Function },
|
|
44
|
+
isYearDisabled: { type: Function }
|
|
45
|
+
}, {
|
|
46
|
+
month: { required: !0 },
|
|
47
|
+
monthModifiers: {},
|
|
48
|
+
year: { required: !0 },
|
|
49
|
+
yearModifiers: {}
|
|
50
|
+
}),
|
|
51
|
+
emits: /* @__PURE__ */ _([
|
|
52
|
+
"hover",
|
|
53
|
+
"select",
|
|
54
|
+
"select-year",
|
|
55
|
+
"open-year"
|
|
56
|
+
], ["update:month", "update:year"]),
|
|
57
|
+
setup(g, { emit: _ }) {
|
|
58
|
+
let H = g, U = _, W = C(g, "month"), G = C(g, "year"), { vClickFeedback: K } = e(), q = d(() => ne(H.locale, H.firstDayOfWeek)), J = d(() => new Intl.DateTimeFormat(H.locale, { month: "short" })), oe = d(() => s(W.value, H.firstDayOfWeek)), se = d(() => te(G.value)), Y = d(() => c(G.value)), ce = d(() => l(G.value)), le = d(() => H.panel === "year" ? `${Y.value} - ${Y.value + 11}` : H.panel === "month" ? String(G.value) : new Intl.DateTimeFormat(H.locale, {
|
|
59
|
+
year: "numeric",
|
|
60
|
+
month: "long"
|
|
61
|
+
}).format(W.value.toDate())), X = d(() => H.panel === "year" ? "前12年" : H.panel === "month" ? "上一年" : "上个月"), Z = d(() => H.panel === "year" ? "后12年" : H.panel === "month" ? "下一年" : "下个月");
|
|
62
|
+
function Q(e) {
|
|
63
|
+
let t = W.value.add(e, "month");
|
|
64
|
+
W.value = t, G.value = t.year();
|
|
65
|
+
}
|
|
66
|
+
function $() {
|
|
67
|
+
if (H.panel === "year") {
|
|
68
|
+
G.value -= 12;
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (H.panel === "month") {
|
|
72
|
+
--G.value;
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
Q(-1);
|
|
76
|
+
}
|
|
77
|
+
function ue() {
|
|
78
|
+
if (H.panel === "year") {
|
|
79
|
+
G.value += 12;
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (H.panel === "month") {
|
|
83
|
+
G.value += 1;
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
Q(1);
|
|
87
|
+
}
|
|
88
|
+
function de() {
|
|
89
|
+
if (H.panel === "year") {
|
|
90
|
+
G.value -= 12;
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
--G.value, W.value = W.value.subtract(1, "year");
|
|
94
|
+
}
|
|
95
|
+
function fe() {
|
|
96
|
+
if (H.panel === "year") {
|
|
97
|
+
G.value += 12;
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
G.value += 1, W.value = W.value.add(1, "year");
|
|
101
|
+
}
|
|
102
|
+
return (e, s) => (y(), p("div", D, [m("div", O, [
|
|
103
|
+
m("div", k, [m("span", { class: v(["bing-date-picker__nav-button-slot", { "is-empty": g.panel !== "date" }]) }, [g.panel === "date" ? (y(), f(o, {
|
|
104
|
+
key: 0,
|
|
105
|
+
content: "上一年",
|
|
106
|
+
placement: "top",
|
|
107
|
+
align: "center"
|
|
108
|
+
}, {
|
|
109
|
+
default: w(() => [h(t, {
|
|
110
|
+
variant: "ghost",
|
|
111
|
+
size: "xs",
|
|
112
|
+
rounded: "sm",
|
|
113
|
+
throttle: !1,
|
|
114
|
+
class: "bing-date-picker__nav-button",
|
|
115
|
+
"aria-label": "上一年",
|
|
116
|
+
onClick: de
|
|
117
|
+
}, {
|
|
118
|
+
prefix: w(() => [h(a, {
|
|
119
|
+
icon: S(ee),
|
|
120
|
+
size: "sm"
|
|
121
|
+
}, null, 8, ["icon"])]),
|
|
122
|
+
_: 1
|
|
123
|
+
})]),
|
|
124
|
+
_: 1
|
|
125
|
+
})) : re("", !0)], 2), h(o, {
|
|
126
|
+
content: X.value,
|
|
127
|
+
placement: "top",
|
|
128
|
+
align: "center"
|
|
129
|
+
}, {
|
|
130
|
+
default: w(() => [h(t, {
|
|
131
|
+
variant: "ghost",
|
|
132
|
+
size: "xs",
|
|
133
|
+
rounded: "sm",
|
|
134
|
+
throttle: !1,
|
|
135
|
+
class: "bing-date-picker__nav-button",
|
|
136
|
+
"aria-label": X.value,
|
|
137
|
+
onClick: $
|
|
138
|
+
}, {
|
|
139
|
+
prefix: w(() => [h(a, {
|
|
140
|
+
icon: S(n),
|
|
141
|
+
size: "sm"
|
|
142
|
+
}, null, 8, ["icon"])]),
|
|
143
|
+
_: 1
|
|
144
|
+
}, 8, ["aria-label"])]),
|
|
145
|
+
_: 1
|
|
146
|
+
}, 8, ["content"])]),
|
|
147
|
+
h(t, {
|
|
148
|
+
variant: "ghost",
|
|
149
|
+
size: "xs",
|
|
150
|
+
rounded: "sm",
|
|
151
|
+
throttle: !1,
|
|
152
|
+
class: v(["bing-date-picker__nav-label", { "is-clickable": g.canSwitchYear }]),
|
|
153
|
+
disabled: !g.canSwitchYear,
|
|
154
|
+
"aria-label": g.canSwitchYear ? "选择年份" : void 0,
|
|
155
|
+
onClick: s[0] ||= (e) => U("open-year")
|
|
156
|
+
}, {
|
|
157
|
+
default: w(() => [ie(x(le.value), 1)]),
|
|
158
|
+
_: 1
|
|
159
|
+
}, 8, [
|
|
160
|
+
"class",
|
|
161
|
+
"disabled",
|
|
162
|
+
"aria-label"
|
|
163
|
+
]),
|
|
164
|
+
m("div", A, [h(o, {
|
|
165
|
+
content: Z.value,
|
|
166
|
+
placement: "top",
|
|
167
|
+
align: "center"
|
|
168
|
+
}, {
|
|
169
|
+
default: w(() => [h(t, {
|
|
170
|
+
variant: "ghost",
|
|
171
|
+
size: "xs",
|
|
172
|
+
rounded: "sm",
|
|
173
|
+
throttle: !1,
|
|
174
|
+
class: "bing-date-picker__nav-button",
|
|
175
|
+
"aria-label": Z.value,
|
|
176
|
+
onClick: ue
|
|
177
|
+
}, {
|
|
178
|
+
prefix: w(() => [h(a, {
|
|
179
|
+
icon: S(r),
|
|
180
|
+
size: "sm"
|
|
181
|
+
}, null, 8, ["icon"])]),
|
|
182
|
+
_: 1
|
|
183
|
+
}, 8, ["aria-label"])]),
|
|
184
|
+
_: 1
|
|
185
|
+
}, 8, ["content"]), g.panel === "date" ? (y(), f(o, {
|
|
186
|
+
key: 0,
|
|
187
|
+
content: "下一年",
|
|
188
|
+
placement: "top",
|
|
189
|
+
align: "center"
|
|
190
|
+
}, {
|
|
191
|
+
default: w(() => [m("span", j, [h(t, {
|
|
192
|
+
variant: "ghost",
|
|
193
|
+
size: "xs",
|
|
194
|
+
rounded: "sm",
|
|
195
|
+
throttle: !1,
|
|
196
|
+
class: "bing-date-picker__nav-button",
|
|
197
|
+
"aria-label": "下一年",
|
|
198
|
+
onClick: fe
|
|
199
|
+
}, {
|
|
200
|
+
prefix: w(() => [h(a, {
|
|
201
|
+
icon: S(i),
|
|
202
|
+
size: "sm"
|
|
203
|
+
}, null, 8, ["icon"])]),
|
|
204
|
+
_: 1
|
|
205
|
+
})])]),
|
|
206
|
+
_: 1
|
|
207
|
+
})) : (y(), p("span", M))])
|
|
208
|
+
]), (y(), p("div", {
|
|
209
|
+
key: g.panel,
|
|
210
|
+
class: v(["bing-date-picker__view", `bing-date-picker__view--${g.panel}`])
|
|
211
|
+
}, [g.panel === "date" ? (y(), p(u, { key: 0 }, [m("div", N, [(y(!0), p(u, null, b(q.value, (e) => (y(), p("span", { key: e }, x(e), 1))), 128))]), m("div", P, [(y(!0), p(u, null, b(oe.value, (e) => T((y(), p("button", {
|
|
212
|
+
key: e.format("YYYY-MM-DD"),
|
|
213
|
+
class: v(["bing-date-picker__cell", {
|
|
214
|
+
"is-muted": e.month() !== W.value.month(),
|
|
215
|
+
"is-today": e.isSame(S(E)(), "day"),
|
|
216
|
+
"is-selected": g.isSelected(e, "day"),
|
|
217
|
+
"is-in-range": g.isInRange(e, "day")
|
|
218
|
+
}]),
|
|
219
|
+
type: "button",
|
|
220
|
+
disabled: g.isDateDisabled(e),
|
|
221
|
+
onMouseenter: (t) => U("hover", e),
|
|
222
|
+
onClick: (t) => U("select", e)
|
|
223
|
+
}, [m("span", I, x(e.date()), 1)], 42, F)), [[S(K)]])), 128))])], 64)) : g.panel === "month" ? (y(), p("div", L, [(y(!0), p(u, null, b(se.value, (e) => T((y(), p("button", {
|
|
224
|
+
key: e.format("YYYY-MM"),
|
|
225
|
+
class: v(["bing-date-picker__cell bing-date-picker__cell--wide", {
|
|
226
|
+
"is-selected": g.isSelected(e, "month"),
|
|
227
|
+
"is-in-range": g.isInRange(e, "month")
|
|
228
|
+
}]),
|
|
229
|
+
type: "button",
|
|
230
|
+
disabled: g.isMonthDisabled(e),
|
|
231
|
+
onMouseenter: (t) => U("hover", e),
|
|
232
|
+
onClick: (t) => U("select", e)
|
|
233
|
+
}, [m("span", z, x(J.value.format(e.toDate())), 1)], 42, R)), [[S(K)]])), 128))])) : (y(), p("div", B, [(y(!0), p(u, null, b(ce.value, (e) => T((y(), p("button", {
|
|
234
|
+
key: e.format("YYYY"),
|
|
235
|
+
class: v(["bing-date-picker__cell bing-date-picker__cell--wide", {
|
|
236
|
+
"is-selected": g.type === "year" && g.isSelected(e, "year"),
|
|
237
|
+
"is-view-active": g.type !== "year" && e.year() === G.value,
|
|
238
|
+
"is-in-range": g.type === "year" && g.isInRange(e, "year")
|
|
239
|
+
}]),
|
|
240
|
+
type: "button",
|
|
241
|
+
disabled: g.isYearDisabled(e),
|
|
242
|
+
onMouseenter: (t) => U("hover", e),
|
|
243
|
+
onClick: (t) => U("select-year", e)
|
|
244
|
+
}, [m("span", ae, x(e.format("YYYY")), 1)], 42, V)), [[S(K)]])), 128))]))], 2))]));
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
//#endregion
|
|
248
|
+
export { H as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./BingDatePickerTimePanel.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/components/BingDatePicker/BingDatePickerTimePanel.vue
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-03c0c3ba"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { n as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Dayjs } from 'dayjs';
|
|
2
|
+
import { BingScrollbarProps } from '../BingScrollbar/BingScrollbar.types';
|
|
3
|
+
import { BingDatePickerTimeUnit } from './BingDatePicker.types';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
/** 当前正在编辑的值,用来高亮各列的选中项。 */
|
|
6
|
+
value: Dayjs;
|
|
7
|
+
compact: boolean;
|
|
8
|
+
hourStep: number;
|
|
9
|
+
minuteStep: number;
|
|
10
|
+
secondStep: number;
|
|
11
|
+
smooth: BingScrollbarProps['smooth'];
|
|
12
|
+
isDisabled: (unit: BingDatePickerTimeUnit, value: number) => boolean;
|
|
13
|
+
};
|
|
14
|
+
declare function stop(): void;
|
|
15
|
+
/** 把各列当前选中的值滚到可见范围内(已可见时不动)。 */
|
|
16
|
+
declare function scrollToCurrent(): void;
|
|
17
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {
|
|
18
|
+
stop: typeof stop;
|
|
19
|
+
scrollToCurrent: typeof scrollToCurrent;
|
|
20
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
21
|
+
select: (unit: BingDatePickerTimeUnit, value: number) => any;
|
|
22
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
23
|
+
onSelect?: ((unit: BingDatePickerTimeUnit, value: number) => any) | undefined;
|
|
24
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
declare const _default: typeof __VLS_export;
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { useClickFeedback as e } from "../../motion/useClickFeedback.js";
|
|
2
|
+
import t from "../BingScrollbar/BingScrollbar.js";
|
|
3
|
+
import { createStepOptions as n } from "./BingDatePicker.utils.js";
|
|
4
|
+
import { Fragment as r, computed as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, normalizeClass as l, normalizeStyle as u, openBlock as d, renderList as f, toDisplayString as p, unref as m, withCtx as h, withDirectives as g } from "vue";
|
|
5
|
+
//#region src/components/BingDatePicker/BingDatePickerTimePanel.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var _ = { class: "bing-date-picker__time-label" }, v = { class: "bing-date-picker__time-options" }, y = [
|
|
7
|
+
"data-time-unit",
|
|
8
|
+
"data-time-value",
|
|
9
|
+
"disabled",
|
|
10
|
+
"onClick"
|
|
11
|
+
], b = { class: "bing-date-picker__time-option-surface" }, x = /* @__PURE__ */ c({
|
|
12
|
+
__name: "BingDatePickerTimePanel",
|
|
13
|
+
props: {
|
|
14
|
+
value: {},
|
|
15
|
+
compact: { type: Boolean },
|
|
16
|
+
hourStep: {},
|
|
17
|
+
minuteStep: {},
|
|
18
|
+
secondStep: {},
|
|
19
|
+
smooth: { type: [Boolean, Object] },
|
|
20
|
+
isDisabled: { type: Function }
|
|
21
|
+
},
|
|
22
|
+
emits: ["select"],
|
|
23
|
+
setup(c, { expose: x, emit: S }) {
|
|
24
|
+
let C = c, w = S, { vClickFeedback: T } = e(), E = [
|
|
25
|
+
"hour",
|
|
26
|
+
"minute",
|
|
27
|
+
"second"
|
|
28
|
+
], D = {
|
|
29
|
+
hour: "时",
|
|
30
|
+
minute: "分",
|
|
31
|
+
second: "秒"
|
|
32
|
+
}, O = {}, k = i(() => ({
|
|
33
|
+
hour: n(24, C.hourStep),
|
|
34
|
+
minute: n(60, C.minuteStep),
|
|
35
|
+
second: n(60, C.secondStep)
|
|
36
|
+
})), A = i(() => C.compact ? 224 : 244), j = i(() => ({ "--bing-date-picker-time-list-height": `${A.value}px` }));
|
|
37
|
+
function M(e, t) {
|
|
38
|
+
if (t) {
|
|
39
|
+
O[e] = t;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
delete O[e];
|
|
43
|
+
}
|
|
44
|
+
function N() {
|
|
45
|
+
E.forEach((e) => O[e]?.stop());
|
|
46
|
+
}
|
|
47
|
+
function P() {
|
|
48
|
+
E.forEach((e) => {
|
|
49
|
+
let t = O[e], n = t?.viewport;
|
|
50
|
+
if (!t || !n) return;
|
|
51
|
+
let r = n.querySelector(`[data-time-unit="${e}"][data-time-value="${C.value[e]()}"]`);
|
|
52
|
+
if (!r) return;
|
|
53
|
+
let i = n.getBoundingClientRect(), a = r.getBoundingClientRect(), o = n.scrollTop;
|
|
54
|
+
if (a.top < i.top) o -= i.top - a.top;
|
|
55
|
+
else if (a.bottom > i.bottom) o += a.bottom - i.bottom;
|
|
56
|
+
else return;
|
|
57
|
+
t.scrollTo(Math.max(0, o));
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return x({
|
|
61
|
+
stop: N,
|
|
62
|
+
scrollToCurrent: P
|
|
63
|
+
}), (e, n) => (d(), a("div", {
|
|
64
|
+
class: "bing-date-picker__time-panel",
|
|
65
|
+
style: u(j.value)
|
|
66
|
+
}, [(d(), a(r, null, f(E, (e) => o("div", {
|
|
67
|
+
key: e,
|
|
68
|
+
class: "bing-date-picker__time-column"
|
|
69
|
+
}, [o("span", _, p(D[e]), 1), s(t, {
|
|
70
|
+
ref_for: !0,
|
|
71
|
+
ref: (t) => M(e, t),
|
|
72
|
+
class: "bing-date-picker__time-list",
|
|
73
|
+
height: A.value,
|
|
74
|
+
smooth: c.smooth,
|
|
75
|
+
focusable: !1,
|
|
76
|
+
always: "",
|
|
77
|
+
"aria-label": `${D[e]}选项`
|
|
78
|
+
}, {
|
|
79
|
+
default: h(() => [o("div", v, [(d(!0), a(r, null, f(k.value[e], (t) => g((d(), a("button", {
|
|
80
|
+
key: `${e}-${t}`,
|
|
81
|
+
class: l(["bing-date-picker__time-option", { "is-selected": c.value[e]() === t }]),
|
|
82
|
+
"data-time-unit": e,
|
|
83
|
+
"data-time-value": t,
|
|
84
|
+
type: "button",
|
|
85
|
+
disabled: c.isDisabled(e, t),
|
|
86
|
+
onClick: (n) => w("select", e, t)
|
|
87
|
+
}, [o("span", b, p(String(t).padStart(2, "0")), 1)], 10, y)), [[m(T)]])), 128))])]),
|
|
88
|
+
_: 2
|
|
89
|
+
}, 1032, [
|
|
90
|
+
"height",
|
|
91
|
+
"smooth",
|
|
92
|
+
"aria-label"
|
|
93
|
+
])])), 64))], 4));
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
//#endregion
|
|
97
|
+
export { x as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./BingDeckTransition.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/components/BingDeckTransition/BingDeckTransition.vue
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-b3566951"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { n as default };
|
package/dist/components/BingDeckTransition/BingDeckTransition.vue_vue_type_script_setup_true_lang.js
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { useReducedMotion as e } from "../../motion/reducedMotion.js";
|
|
2
|
+
import t from "../BingButton/BingButton.js";
|
|
3
|
+
import { Fragment as n, computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, nextTick as u, normalizeClass as d, onBeforeUnmount as f, onBeforeUpdate as p, onMounted as m, openBlock as h, ref as g, renderList as _, renderSlot as v, toDisplayString as y, watch as b, withCtx as x } from "vue";
|
|
4
|
+
import { gsap as S } from "gsap";
|
|
5
|
+
//#region src/components/BingDeckTransition/BingDeckTransition.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var C = { class: "bing-deck-transition__stage" }, w = ["aria-hidden"], T = /* @__PURE__ */ l({
|
|
7
|
+
__name: "BingDeckTransition",
|
|
8
|
+
props: {
|
|
9
|
+
modelValue: { default: void 0 },
|
|
10
|
+
items: { default: () => [] },
|
|
11
|
+
disabled: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: !1
|
|
14
|
+
},
|
|
15
|
+
respectReducedMotion: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: !0
|
|
18
|
+
},
|
|
19
|
+
loop: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: !0
|
|
22
|
+
},
|
|
23
|
+
showControls: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: !0
|
|
26
|
+
},
|
|
27
|
+
controlLabel: { default: "切换下一张" }
|
|
28
|
+
},
|
|
29
|
+
emits: ["update:modelValue", "change"],
|
|
30
|
+
setup(l, { emit: T }) {
|
|
31
|
+
let E = e(), D = l, O = T, k = g([]), A = g(!1), j = g(void 0), M, N, P = r(() => D.items.filter((e) => !e.disabled)), F = r(() => P.value[0]), I = r(() => D.modelValue !== void 0), L = r(() => I.value ? D.modelValue : j.value ?? F.value?.value), R = r(() => {
|
|
32
|
+
let e = D.items.findIndex((e) => Object.is(e.value, L.value));
|
|
33
|
+
return e >= 0 ? e : 0;
|
|
34
|
+
}), z = r(() => D.items[R.value]);
|
|
35
|
+
function B() {
|
|
36
|
+
return D.disabled || D.respectReducedMotion && E();
|
|
37
|
+
}
|
|
38
|
+
function V(e) {
|
|
39
|
+
let t = D.items.length;
|
|
40
|
+
return t === 0 ? 0 : D.loop ? (e + t) % t : Math.min(Math.max(e, 0), t - 1);
|
|
41
|
+
}
|
|
42
|
+
function H(e, t = R.value) {
|
|
43
|
+
return V(e - t);
|
|
44
|
+
}
|
|
45
|
+
function U(e, t = R.value) {
|
|
46
|
+
let n = H(e, t);
|
|
47
|
+
return {
|
|
48
|
+
x: 0,
|
|
49
|
+
xPercent: n * 7,
|
|
50
|
+
y: n * 36,
|
|
51
|
+
rotation: n === 0 ? 0 : n * 9 - 5,
|
|
52
|
+
scale: 1 - n * .09,
|
|
53
|
+
opacity: 1 - n * .16,
|
|
54
|
+
zIndex: 10 - n,
|
|
55
|
+
force3D: !0
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function W(e, t) {
|
|
59
|
+
e instanceof HTMLElement && (k.value[t] = e);
|
|
60
|
+
}
|
|
61
|
+
function G(e) {
|
|
62
|
+
let t = D.items[e];
|
|
63
|
+
if (!t || D.disabled || t.disabled || Object.is(t.value, L.value)) return !1;
|
|
64
|
+
let n = L.value, r = D.items.find((e) => Object.is(e.value, n));
|
|
65
|
+
return N = t.value, I.value || (j.value = t.value), O("update:modelValue", t.value), O("change", {
|
|
66
|
+
value: t.value,
|
|
67
|
+
previousValue: n,
|
|
68
|
+
item: t,
|
|
69
|
+
previousItem: r
|
|
70
|
+
}), !0;
|
|
71
|
+
}
|
|
72
|
+
function K(e = R.value, t = !1) {
|
|
73
|
+
let n = t || B() ? 0 : .58;
|
|
74
|
+
M?.kill(), M = S.timeline({
|
|
75
|
+
defaults: {
|
|
76
|
+
duration: n,
|
|
77
|
+
ease: "power3.out",
|
|
78
|
+
overwrite: "auto"
|
|
79
|
+
},
|
|
80
|
+
onStart: () => {
|
|
81
|
+
A.value = !0;
|
|
82
|
+
},
|
|
83
|
+
onComplete: () => {
|
|
84
|
+
A.value = !1, M = void 0;
|
|
85
|
+
},
|
|
86
|
+
onInterrupt: () => {
|
|
87
|
+
A.value = !1;
|
|
88
|
+
}
|
|
89
|
+
}), k.value.forEach((t, n) => {
|
|
90
|
+
M?.to(t, U(n, e), 0);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function q() {
|
|
94
|
+
if (D.disabled || A.value || D.items.length === 0) return;
|
|
95
|
+
let e = R.value, t = V(R.value + 1);
|
|
96
|
+
if (!G(t)) return;
|
|
97
|
+
if (B()) {
|
|
98
|
+
K(t, !0);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
M?.kill(), M = S.timeline({
|
|
102
|
+
defaults: { overwrite: "auto" },
|
|
103
|
+
onStart: () => {
|
|
104
|
+
A.value = !0;
|
|
105
|
+
},
|
|
106
|
+
onComplete: () => {
|
|
107
|
+
A.value = !1, M = void 0;
|
|
108
|
+
},
|
|
109
|
+
onInterrupt: () => {
|
|
110
|
+
A.value = !1;
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
let n = k.value[e];
|
|
114
|
+
n && M.to(n, {
|
|
115
|
+
x: -260,
|
|
116
|
+
y: 82,
|
|
117
|
+
rotation: -24,
|
|
118
|
+
scale: .82,
|
|
119
|
+
opacity: .18,
|
|
120
|
+
duration: .24,
|
|
121
|
+
ease: "power2.in",
|
|
122
|
+
force3D: !0
|
|
123
|
+
}, 0), k.value.forEach((e, n) => {
|
|
124
|
+
M?.to(e, {
|
|
125
|
+
...U(n, t),
|
|
126
|
+
duration: .46,
|
|
127
|
+
ease: "power3.out"
|
|
128
|
+
}, .24);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
function J(e) {
|
|
132
|
+
e.defaultPrevented || D.disabled || Math.abs(e.deltaX) <= Math.abs(e.deltaY) || (e.preventDefault(), Math.abs(e.deltaX) > 24 && q());
|
|
133
|
+
}
|
|
134
|
+
return p(() => {
|
|
135
|
+
k.value = [];
|
|
136
|
+
}), m(() => {
|
|
137
|
+
u().then(() => {
|
|
138
|
+
K(R.value, !0);
|
|
139
|
+
});
|
|
140
|
+
}), f(() => {
|
|
141
|
+
M?.kill(), S.killTweensOf(k.value);
|
|
142
|
+
}), b(L, (e) => {
|
|
143
|
+
if (e === void 0) return;
|
|
144
|
+
if (Object.is(e, N)) {
|
|
145
|
+
N = void 0;
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
let t = D.items.findIndex((t) => Object.is(t.value, e));
|
|
149
|
+
t < 0 || u().then(() => {
|
|
150
|
+
K(t, !0);
|
|
151
|
+
});
|
|
152
|
+
}), (e, r) => (h(), a("section", {
|
|
153
|
+
class: d(["bing-deck-transition", { "is-disabled": l.disabled }]),
|
|
154
|
+
onWheel: J
|
|
155
|
+
}, [o("div", C, [(h(!0), a(n, null, _(l.items, (t, n) => (h(), a("article", {
|
|
156
|
+
key: String(t.value),
|
|
157
|
+
ref_for: !0,
|
|
158
|
+
ref: (e) => W(e, n),
|
|
159
|
+
class: d(["bing-deck-transition__card", { "is-active": Object.is(L.value, t.value) }]),
|
|
160
|
+
"aria-hidden": !Object.is(L.value, t.value)
|
|
161
|
+
}, [v(e.$slots, "default", {
|
|
162
|
+
item: t,
|
|
163
|
+
index: n,
|
|
164
|
+
active: Object.is(L.value, t.value),
|
|
165
|
+
isAnimating: A.value
|
|
166
|
+
}, () => [s(y(t.label), 1)], !0)], 10, w))), 128))]), l.showControls ? v(e.$slots, "controls", {
|
|
167
|
+
key: 0,
|
|
168
|
+
next: q,
|
|
169
|
+
activeItem: z.value,
|
|
170
|
+
activeIndex: R.value,
|
|
171
|
+
isAnimating: A.value
|
|
172
|
+
}, () => [c(t, {
|
|
173
|
+
class: "bing-deck-transition__button",
|
|
174
|
+
variant: "primary",
|
|
175
|
+
size: "sm",
|
|
176
|
+
"text-effect": "none",
|
|
177
|
+
disabled: l.disabled,
|
|
178
|
+
throttle: !1,
|
|
179
|
+
onClick: q
|
|
180
|
+
}, {
|
|
181
|
+
default: x(() => [s(y(l.controlLabel), 1)]),
|
|
182
|
+
_: 1
|
|
183
|
+
}, 8, ["disabled"])], !0) : i("", !0)], 34));
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
//#endregion
|
|
187
|
+
export { T as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./BingDialog.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/components/BingDialog/BingDialog.vue
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-76f1574d"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { n as default };
|
|
@@ -17,21 +17,20 @@ type __VLS_Slots = {} & {
|
|
|
17
17
|
footer?: (props: typeof __VLS_40) => any;
|
|
18
18
|
};
|
|
19
19
|
declare const __VLS_base: import('vue').DefineComponent<BingDialogProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
20
|
-
cancel: () => any;
|
|
21
20
|
close: (reason: BingDialogCloseReason) => any;
|
|
22
|
-
"update:modelValue": (value: boolean) => any;
|
|
23
21
|
confirm: () => any;
|
|
22
|
+
cancel: () => any;
|
|
23
|
+
"update:modelValue": (value: boolean) => any;
|
|
24
24
|
}, string, import('vue').PublicProps, Readonly<BingDialogProps> & Readonly<{
|
|
25
|
-
onCancel?: (() => any) | undefined;
|
|
26
25
|
onClose?: ((reason: BingDialogCloseReason) => any) | undefined;
|
|
27
|
-
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
28
26
|
onConfirm?: (() => any) | undefined;
|
|
27
|
+
onCancel?: (() => any) | undefined;
|
|
28
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
29
29
|
}>, {
|
|
30
30
|
height: string | number;
|
|
31
31
|
maxHeight: string | number;
|
|
32
32
|
maxWidth: string | number;
|
|
33
33
|
width: string | number;
|
|
34
|
-
zIndex: number;
|
|
35
34
|
title: string;
|
|
36
35
|
ariaLabel: string;
|
|
37
36
|
modelValue: boolean;
|