bitboss-ui 2.0.21 → 2.0.22
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/index107.js +5 -5
- package/dist/index115.js +1 -1
- package/dist/index117.js +5 -5
- package/dist/index119.js +1 -1
- package/dist/index123.js +1 -1
- package/dist/index124.js +1 -1
- package/dist/index125.js +1 -1
- package/dist/index127.js +1 -1
- package/dist/index129.js +2 -2
- package/dist/index130.js +1 -1
- package/dist/index14.js +1 -1
- package/dist/index16.js +3 -3
- package/dist/index18.js +2 -2
- package/dist/index199.js +81 -2
- package/dist/index199.js.map +1 -1
- package/dist/index20.js +14 -14
- package/dist/index200.js +8 -5
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +3 -16
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +2 -16
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +44 -19
- package/dist/index203.js.map +1 -1
- package/dist/index205.js +13 -27
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +158 -3
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +84 -2
- package/dist/index207.js.map +1 -1
- package/dist/index209.js +3 -249
- package/dist/index209.js.map +1 -1
- package/dist/index210.js +35 -52
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +5 -43
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +7 -5
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +281 -49
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +14 -124
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +13 -120
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +19 -2
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +19 -35
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +25 -172
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +3 -6
- package/dist/index219.js.map +1 -1
- package/dist/index22.js +15 -15
- package/dist/index220.js +2 -44
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +252 -0
- package/dist/index221.js.map +1 -0
- package/dist/index222.js +52 -13
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +44 -5
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +5 -369
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +48 -80
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +2 -3
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +4 -7
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +2 -158
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +125 -83
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +126 -0
- package/dist/index230.js.map +1 -0
- package/dist/index231.js +2 -2
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +174 -4
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +5 -2
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +369 -3
- package/dist/index234.js.map +1 -1
- package/dist/index235.js +2 -2
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +2 -18
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +17 -105
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +109 -0
- package/dist/index238.js.map +1 -0
- package/dist/index24.js +5 -5
- package/dist/{index239.js → index240.js} +2 -2
- package/dist/{index239.js.map → index240.js.map} +1 -1
- package/dist/index244.js +6 -3
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +15 -8
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +9 -23
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +3 -281
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +9 -6
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +23 -2
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +224 -2
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +3 -2
- package/dist/index251.js.map +1 -1
- package/dist/index253.js +7 -2
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +3 -2
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +12 -2
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +9 -2
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +9 -2
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +17 -2
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +2 -28
- package/dist/index259.js.map +1 -1
- package/dist/index26.js +1 -1
- package/dist/index260.js +61 -17
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +8 -0
- package/dist/index261.js.map +1 -0
- package/dist/index262.js +429 -5
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +89 -6
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +6 -16
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +2 -2
- package/dist/index266.js +2 -126
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +2 -431
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +2 -3
- package/dist/index268.js.map +1 -1
- package/dist/{index252.js → index269.js} +1 -1
- package/dist/index269.js.map +1 -0
- package/dist/index270.js +2 -22
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +5 -0
- package/dist/index271.js.map +1 -0
- package/dist/index272.js +2 -89
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +2 -200
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +2 -436
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +26 -125
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +22 -3
- package/dist/index276.js.map +1 -1
- package/dist/index278.js +199 -8
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +4 -9
- package/dist/index279.js.map +1 -1
- package/dist/index28.js +3 -3
- package/dist/index280.js +2 -17
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +126 -4
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +22 -9
- package/dist/index282.js.map +1 -1
- package/dist/index284.js +436 -2
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +126 -65
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +1 -1
- package/dist/index287.js +1 -1
- package/dist/index288.js +2 -2
- package/dist/index289.js +15 -5
- package/dist/index289.js.map +1 -1
- package/dist/index290.js +4 -15
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +4 -79
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +62 -0
- package/dist/index292.js.map +1 -0
- package/dist/index293.js +79 -7
- package/dist/index293.js.map +1 -1
- package/dist/index295.js +2 -4
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +11 -4
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +34 -58
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +6 -6
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +18 -34
- package/dist/index299.js.map +1 -1
- package/dist/index30.js +2 -2
- package/dist/index300.js +46 -10
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +6 -46
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +480 -2
- package/dist/index302.js.map +1 -1
- package/dist/index304.js +424 -0
- package/dist/index304.js.map +1 -0
- package/dist/index305.js +42 -416
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +2 -47
- package/dist/index306.js.map +1 -1
- package/dist/index32.js +2 -2
- package/dist/index34.js +3 -3
- package/dist/index36.js +13 -13
- package/dist/index38.js +4 -4
- package/dist/index40.js +2 -2
- package/dist/index42.js +2 -2
- package/dist/index44.js +6 -6
- package/dist/index46.js +2 -2
- package/dist/index48.js +2 -2
- package/dist/index54.js +1 -1
- package/dist/index56.js +1 -1
- package/dist/index72.js +3 -3
- package/dist/index76.js +2 -2
- package/dist/index78.js +1 -1
- package/dist/index81.js +2 -2
- package/dist/index83.js +76 -65
- package/dist/index83.js.map +1 -1
- package/dist/index85.js +3 -3
- package/dist/index87.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/index204.js +0 -22
- package/dist/index204.js.map +0 -1
- package/dist/index208.js +0 -11
- package/dist/index208.js.map +0 -1
- package/dist/index241.js +0 -5
- package/dist/index241.js.map +0 -1
- package/dist/index252.js.map +0 -1
- package/dist/index277.js +0 -15
- package/dist/index277.js.map +0 -1
- package/dist/index283.js +0 -227
- package/dist/index283.js.map +0 -1
- package/dist/index294.js +0 -22
- package/dist/index294.js.map +0 -1
- package/dist/index303.js +0 -483
- package/dist/index303.js.map +0 -1
- package/dist/index307.js +0 -5
- package/dist/index307.js.map +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index221.js","sources":["../src/components/BaseDatePicker/BaseDatePickerInputDaySelector.vue"],"sourcesContent":["<template>\n\t<div\n\t\tref=\"calendar\"\n\t\tclass=\"bb-base-date-picker__days-selector\"\n\t\t:class=\"{ 'bb-base-date-picker__days-selector--hidden': !current }\"\n\t\t@keydown.prevent.down=\"onArrowDown\"\n\t\t@keydown.prevent.end=\"onEnd\"\n\t\t@keydown.prevent.home=\"onHome\"\n\t\t@keydown.prevent.left=\"onArrowLeft\"\n\t\t@keydown.prevent.page-down=\"onPageDown\"\n\t\t@keydown.prevent.page-up=\"onPageUp\"\n\t\t@keydown.prevent.right=\"onArrowRight\"\n\t\t@keydown.prevent.up=\"onArrowUp\"\n\t>\n\t\t<SlideTransition :direction=\"direction\" :gap=\"30\">\n\t\t\t<div :key=\"cursor.month().toString()\" class=\"bb-base-date-picker__month\">\n\t\t\t\t<div class=\"bb-base-date-picker__header-container\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-for=\"header in mappedHeaders\"\n\t\t\t\t\t\t:key=\"header.id\"\n\t\t\t\t\t\t:abbr=\"header.accessibleLabel\"\n\t\t\t\t\t\tclass=\"bb-base-date-picker__header-cell\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{{ header.label }}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\tv-for=\"week in dates\"\n\t\t\t\t\t:key=\"week[0].id\"\n\t\t\t\t\tclass=\"bb-base-date-picker__week\"\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-for=\"cell in week\"\n\t\t\t\t\t\t:key=\"cell.id\"\n\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t'bb-base-date-picker__date--current': cell.current,\n\t\t\t\t\t\t\t'bb-base-date-picker__date--disabled': disabled || cell.disabled,\n\t\t\t\t\t\t\t'bb-base-date-picker__date--first': cell.first,\n\t\t\t\t\t\t\t'bb-base-date-picker__date--highlighted': cell.highlighted,\n\t\t\t\t\t\t\t'bb-base-date-picker__date--last': cell.last,\n\t\t\t\t\t\t\t'bb-base-date-picker__date--middle': cell.middle,\n\t\t\t\t\t\t\t'bb-base-date-picker__date--selected': cell.selected,\n\t\t\t\t\t\t\t'bb-base-date-picker__date--today': cell.today,\n\t\t\t\t\t\t\t'bb-base-date-picker__date': true,\n\t\t\t\t\t\t}\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t:id=\"cell.buttonId\"\n\t\t\t\t\t\t\t:class=\"'bb-base-date-picker__date-button'\"\n\t\t\t\t\t\t\t:disabled=\"disabled || cell.disabled\"\n\t\t\t\t\t\t\t:tabindex=\"Number(cell.current) - 1\"\n\t\t\t\t\t\t\t:type=\"'button'\"\n\t\t\t\t\t\t\t@click=\"onButtonClick\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{{ cell.label }}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t:first=\"cell.first\"\n\t\t\t\t\t\t\t:highlighted=\"cell.highlighted\"\n\t\t\t\t\t\t\t:item=\"cell.original\"\n\t\t\t\t\t\t\t:label=\"cell.label\"\n\t\t\t\t\t\t\t:last=\"cell.last\"\n\t\t\t\t\t\t\t:middle=\"cell.middle\"\n\t\t\t\t\t\t\t:name=\"'day'\"\n\t\t\t\t\t\t\t:selected=\"cell.selected\"\n\t\t\t\t\t\t></slot>\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t:first=\"cell.first\"\n\t\t\t\t\t\t\t:highlighted=\"cell.highlighted\"\n\t\t\t\t\t\t\t:item=\"cell.original\"\n\t\t\t\t\t\t\t:label=\"cell.label\"\n\t\t\t\t\t\t\t:last=\"cell.last\"\n\t\t\t\t\t\t\t:middle=\"cell.middle\"\n\t\t\t\t\t\t\t:name=\"cell.slotName\"\n\t\t\t\t\t\t\t:selected=\"cell.selected\"\n\t\t\t\t\t\t></slot>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</SlideTransition>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport { chunk } from '@/utilities/functions/chunk';\nimport { identity } from '@/utilities/functions/identity';\nimport { isNotNil } from '@/utilities/functions/isNotNil';\nimport { last } from '@/utilities/functions/last';\nimport { nextTick } from 'vue';\nimport { ref } from 'vue';\nimport { sort } from '@/utilities/functions/sort';\nimport { watch } from 'vue';\nimport dayjs from 'dayjs';\nimport SlideTransition from '../Transitions/Slide.vue';\nimport type { Dayjs } from 'dayjs';\n\ntype Props = {\n\tcursor: Dayjs;\n\tcurrent: boolean;\n\tdisabled: boolean;\n\tfirstDayOfWeek: number;\n\t/**\n\t * Used by v-model. Can be null, a single string, or an array of strings based on whether a range or single date is needed\n\t */\n\tmodelValue: string | string[] | null;\n\tmax?: Date | string | number;\n\tmin?: Date | string | number;\n\tselectable?: (date: Date) => boolean;\n\trange?: boolean;\n\tmultiple?: boolean;\n\treadonly?: boolean;\n};\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{\n\t(event: 'update:modelValue', value: any): void;\n\t(event: 'update:cursor', value: Dayjs): void;\n}>();\n\nconst calendar = ref<HTMLElement | null>(null);\n\nconst today = dayjs().startOf('day');\n\nconst modelValueMetadata = computed(() => {\n\tlet min = Infinity;\n\tlet max = -Infinity;\n\tlet selected: { [key: number]: number } = {};\n\n\tif (props.modelValue) {\n\t\tconst arr = ([] as (string | Date)[])\n\t\t\t.concat(props.modelValue)\n\t\t\t.filter(identity)\n\t\t\t.map((value) => dayjs(value).startOf('day'))\n\t\t\t.map((date) => date.valueOf());\n\t\tarr.forEach((item, index) => {\n\t\t\tif (item < min) min = item;\n\t\t\tif (item > max) max = item;\n\t\t\tselected[item] = index;\n\t\t});\n\t}\n\treturn {\n\t\tmin,\n\t\tmax,\n\t\tindex: (date: Dayjs) => selected[date.valueOf()],\n\t\tselected: (date: Dayjs) => isNotNil(selected[date.valueOf()]),\n\t\tisFirstOfRange: (date: Dayjs) => date.valueOf() === min,\n\t\tisLastOfRange: (date: Dayjs) => date.valueOf() === max,\n\t\tisBetween: (date: Dayjs) => date.valueOf() > min && date.valueOf() < max,\n\t};\n});\n\nconst mappedHeaders = computed(() => {\n\treturn (\n\t\tnew Array(7)\n\t\t\t.fill('')\n\t\t\t// Sort days based on first day of the week\n\t\t\t.map((_, index) => dayjs().day((index + props.firstDayOfWeek) % 7))\n\t\t\t.map((day) => {\n\t\t\t\treturn {\n\t\t\t\t\taccessibleLabel: day.format('dddd'),\n\t\t\t\t\tlabel: day.format('dd').slice(0, 1).toUpperCase(),\n\t\t\t\t\tid: day.toISOString(),\n\t\t\t\t\toriginal: day,\n\t\t\t\t};\n\t\t\t})\n\t);\n});\n\ntype Cell = {\n\tbuttonId: string;\n\tcurrent: boolean;\n\tdisabled: boolean;\n\tfirst: boolean;\n\thighlighted: boolean;\n\tid: string;\n\tlabel: string;\n\tlast: boolean;\n\tmiddle: boolean;\n\toriginal: Dayjs;\n\tselected: boolean;\n\tslotName: string;\n\tweek: string;\n\ttoday: boolean;\n};\n\nconst dates = computed<Cell[][]>(() => {\n\tconst year = props.cursor.year().toString();\n\tconst month = props.cursor.month().toString();\n\tlet startOfMonth = props.cursor.clone().startOf('month');\n\tlet firstValueToDisplay = startOfMonth.clone().startOf('week');\n\tlet endOfMonth = props.cursor.clone().endOf('month');\n\tlet lastValueToDisplay = endOfMonth.clone().endOf('week');\n\tlet currentAtMidnight = dayjs(props.cursor).startOf('day');\n\tlet datesInPage: Dayjs[] = [];\n\tfor (\n\t\tlet index = firstValueToDisplay;\n\t\tindex.isBefore(lastValueToDisplay);\n\t\tindex = index.add(1, 'day')\n\t) {\n\t\tdatesInPage.push(index.clone());\n\t}\n\tconst mapped = datesInPage.map<Cell>((date) => {\n\t\tconst id = date.toISOString();\n\t\tconst week = date.week().toString();\n\t\tlet selected = modelValueMetadata.value.selected(date);\n\n\t\tconst first = props.range && modelValueMetadata.value.isFirstOfRange(date);\n\t\tconst last = props.range && modelValueMetadata.value.isLastOfRange(date);\n\t\tconst middle =\n\t\t\tprops.range &&\n\t\t\t!first &&\n\t\t\t!last &&\n\t\t\tmodelValueMetadata.value.isBetween(date);\n\t\tconst highlighted =\n\t\t\tdate.month().toString() === month && date.year().toString() === year;\n\t\tconst isToday = date.isSame(today);\n\t\tconst current = date.isSame(currentAtMidnight);\n\t\tconst disabled = isDateDisabled(date);\n\t\tconst label = date.get('D').toString();\n\t\tconst buttonId = 'date_' + id;\n\n\t\treturn {\n\t\t\tbuttonId,\n\t\t\tcurrent,\n\t\t\tdisabled,\n\t\t\tfirst,\n\t\t\thighlighted,\n\t\t\tid,\n\t\t\tlabel,\n\t\t\tlast,\n\t\t\tmiddle,\n\t\t\toriginal: date,\n\t\t\tselected,\n\t\t\tslotName: id,\n\t\t\ttoday: isToday,\n\t\t\tweek,\n\t\t};\n\t});\n\treturn chunk(mapped, 7);\n});\n\nconst isDateDisabled = (date: Dayjs) => {\n\tlet passing = true;\n\tif (props.min) {\n\t\tpassing &&= date.isSameOrAfter(dayjs(props.min).startOf('day'));\n\t}\n\tif (props.max) {\n\t\tpassing &&= date.isSameOrBefore(dayjs(props.max).startOf('day'));\n\t}\n\tif (typeof props.selectable === 'function') {\n\t\tpassing &&= props.selectable(date.toDate());\n\t}\n\treturn !passing;\n};\n\nconst direction = ref<'left' | 'right'>('left');\nconst setSlideDirection = (\n\tcurrent: Dayjs | undefined,\n\tprevious: Dayjs | undefined\n) => {\n\tif (current && previous) {\n\t\tdirection.value = current.isBefore(previous) ? 'left' : 'right';\n\t}\n};\n\nwatch(\n\t() => props.cursor,\n\t(current, previous) => {\n\t\tsetSlideDirection(current, previous);\n\t}\n);\n\nconst updateCursor = (date: Dayjs) => emit('update:cursor', date);\n\nconst focusOnCursor = async () => {\n\tif (!calendar.value) return;\n\tawait nextTick();\n\tconst el = last([\n\t\t...calendar.value.querySelectorAll(\n\t\t\t'.bb-base-date-picker__date--current button'\n\t\t),\n\t]);\n\tif (el instanceof HTMLElement) {\n\t\tel.focus();\n\t}\n};\n\nconst onButtonClick = (event: MouseEvent) => {\n\tif (props.readonly) return;\n\tif (event.target instanceof HTMLButtonElement) {\n\t\tconst [, id] = event.target.id.split('_');\n\t\tconst d = dayjs(id);\n\t\tif (props.cursor.month() !== d.month()) {\n\t\t\tupdateCursor(d);\n\t\t\treturn;\n\t\t}\n\t\tconst date = dates.value.flat().find((el) => el.id === id)!;\n\t\tif (date.disabled) return;\n\t\tupdateCursor(d);\n\t\tonDateSelected(date);\n\t}\n};\n\nconst onDateSelected = (date: Cell) => {\n\tif (props.range) onDateSelectedRange(date);\n\telse if (props.multiple) onDateSelectedMultiple(date);\n\telse onDateSelectedSingle(date);\n};\n\nconst onDateSelectedRange = (date: Cell) => {\n\tif (!Array.isArray(props.modelValue)) return;\n\tconst value = date.original.toISOString();\n\tif (props.modelValue.length !== 1) emit('update:modelValue', [value]);\n\telse {\n\t\tconst arr = sort([props.modelValue[0], date.original.toISOString()]);\n\t\temit('update:modelValue', arr);\n\t}\n};\nconst onDateSelectedMultiple = (date: Cell) => {\n\tif (!Array.isArray(props.modelValue)) return;\n\tif (date.selected) {\n\t\tconst asString = date.original.toISOString();\n\t\tconst valueToEmit = props.modelValue.filter((el) => el !== asString);\n\t\temit('update:modelValue', valueToEmit);\n\t} else {\n\t\tconst arr = sort([...props.modelValue, date.original.toISOString()]);\n\t\temit('update:modelValue', arr);\n\t}\n};\nconst onDateSelectedSingle = (date: Cell) => {\n\tif (date.selected) emit('update:modelValue', null);\n\telse emit('update:modelValue', date.original.toISOString());\n};\n\nconst onArrowRight = () => {\n\tconst date = props.cursor.clone().add(1, 'day');\n\tif (isDateDisabled(date)) return;\n\temit('update:cursor', date);\n\tfocusOnCursor();\n};\nconst onArrowLeft = () => {\n\tconst date = props.cursor.clone().subtract(1, 'day');\n\tif (isDateDisabled(date)) return;\n\temit('update:cursor', date);\n\tfocusOnCursor();\n};\nconst onArrowUp = () => {\n\tconst date = props.cursor.clone().subtract(1, 'week');\n\tif (isDateDisabled(date)) return;\n\temit('update:cursor', date);\n\tfocusOnCursor();\n};\nconst onArrowDown = () => {\n\tconst date = props.cursor.clone().add(1, 'week');\n\tif (isDateDisabled(date)) return;\n\temit('update:cursor', date);\n\tfocusOnCursor();\n};\nconst onEnd = () => {\n\tconst date = props.cursor.clone().endOf('week');\n\tif (isDateDisabled(date)) return;\n\temit('update:cursor', date);\n\tfocusOnCursor();\n};\nconst onHome = () => {\n\tconst date = props.cursor.clone().startOf('week');\n\tif (isDateDisabled(date)) return;\n\temit('update:cursor', date);\n\tfocusOnCursor();\n};\nconst onPageUp = (event: KeyboardEvent) => {\n\tif (event.shiftKey) {\n\t\tconst date = props.cursor.clone().subtract(1, 'year');\n\t\tif (isDateDisabled(date)) return;\n\t\temit('update:cursor', date);\n\t} else {\n\t\tconst date = props.cursor.clone().subtract(1, 'month');\n\t\tif (isDateDisabled(date)) return;\n\t\temit('update:cursor', date);\n\t}\n\tfocusOnCursor();\n};\nconst onPageDown = (event: KeyboardEvent) => {\n\tif (event.shiftKey) {\n\t\tconst date = props.cursor.clone().add(1, 'year');\n\t\tif (isDateDisabled(date)) return;\n\t\temit('update:cursor', date);\n\t} else {\n\t\tconst date = props.cursor.clone().add(1, 'month');\n\t\tif (isDateDisabled(date)) return;\n\t\temit('update:cursor', date);\n\t}\n\tfocusOnCursor();\n};\n</script>\n\n<style lang=\"postcss\"></style>\n"],"names":["props","__props","emit","__emit","calendar","ref","today","dayjs","modelValueMetadata","computed","min","max","selected","identity","value","date","item","index","isNotNil","mappedHeaders","_","day","dates","year","month","firstValueToDisplay","lastValueToDisplay","currentAtMidnight","datesInPage","mapped","id","week","first","last","middle","highlighted","isToday","current","disabled","isDateDisabled","label","chunk","passing","direction","setSlideDirection","previous","watch","updateCursor","focusOnCursor","nextTick","el","onButtonClick","event","d","onDateSelected","onDateSelectedRange","onDateSelectedMultiple","arr","sort","asString","valueToEmit","onDateSelectedSingle","onArrowRight","onArrowLeft","onArrowUp","onArrowDown","onEnd","onHome","onPageUp","onPageDown"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAiHA,UAAMA,IAAQC,GAERC,IAAOC,GAKPC,IAAWC,EAAwB,IAAI,GAEvCC,IAAQC,EAAA,EAAQ,QAAQ,KAAK,GAE7BC,IAAqBC,EAAS,MAAM;AACzC,UAAIC,IAAM,OACNC,IAAM,QACNC,IAAsC,CAAA;AAE1C,aAAIZ,EAAM,cACI,GACX,OAAOA,EAAM,UAAU,EACvB,OAAOa,EAAQ,EACf,IAAI,CAACC,MAAUP,EAAMO,CAAK,EAAE,QAAQ,KAAK,CAAC,EAC1C,IAAI,CAACC,MAASA,EAAK,QAAA,CAAS,EAC1B,QAAQ,CAACC,GAAMC,MAAU;AACxB,QAAAD,IAAON,MAAWA,IAAAM,IAClBA,IAAOL,MAAWA,IAAAK,IACtBJ,EAASI,CAAI,IAAIC;AAAA,MAAA,CACjB,GAEK;AAAA,QACN,KAAAP;AAAA,QACA,KAAAC;AAAA,QACA,OAAO,CAACI,MAAgBH,EAASG,EAAK,SAAS;AAAA,QAC/C,UAAU,CAACA,MAAgBG,GAASN,EAASG,EAAK,QAAA,CAAS,CAAC;AAAA,QAC5D,gBAAgB,CAACA,MAAgBA,EAAK,QAAc,MAAAL;AAAA,QACpD,eAAe,CAACK,MAAgBA,EAAK,QAAc,MAAAJ;AAAA,QACnD,WAAW,CAACI,MAAgBA,EAAK,QAAY,IAAAL,KAAOK,EAAK,QAAA,IAAYJ;AAAA,MAAA;AAAA,IACtE,CACA,GAEKQ,IAAgBV,EAAS,MAE7B,IAAI,M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AS,MAAM;AACpB,YAAMpD,IAAOf,EAAM,OAAO,MAAM,EAAE,QAAQ,MAAM;AAC5C,MAAAuC,EAAexB,CAAI,MACvBb,EAAK,iBAAiBa,CAAI,GACZiC;IAAA,GAEToB,IAAW,CAAChB,MAAyB;AAC1C,UAAIA,EAAM,UAAU;AACnB,cAAMrC,IAAOf,EAAM,OAAO,MAAQ,EAAA,SAAS,GAAG,MAAM;AAChD,YAAAuC,EAAexB,CAAI,EAAG;AAC1B,QAAAb,EAAK,iBAAiBa,CAAI;AAAA,MAAA,OACpB;AACN,cAAMA,IAAOf,EAAM,OAAO,MAAQ,EAAA,SAAS,GAAG,OAAO;AACjD,YAAAuC,EAAexB,CAAI,EAAG;AAC1B,QAAAb,EAAK,iBAAiBa,CAAI;AAAA,MAC3B;AACc,MAAAiC;IAAA,GAETqB,IAAa,CAACjB,MAAyB;AAC5C,UAAIA,EAAM,UAAU;AACnB,cAAMrC,IAAOf,EAAM,OAAO,MAAQ,EAAA,IAAI,GAAG,MAAM;AAC3C,YAAAuC,EAAexB,CAAI,EAAG;AAC1B,QAAAb,EAAK,iBAAiBa,CAAI;AAAA,MAAA,OACpB;AACN,cAAMA,IAAOf,EAAM,OAAO,MAAQ,EAAA,IAAI,GAAG,OAAO;AAC5C,YAAAuC,EAAexB,CAAI,EAAG;AAC1B,QAAAb,EAAK,iBAAiBa,CAAI;AAAA,MAC3B;AACc,MAAAiC;IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index222.js
CHANGED
@@ -1,16 +1,55 @@
|
|
1
|
-
import { openBlock as
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
}
|
12
|
-
|
1
|
+
import { defineComponent as p, ref as b, watch as _, computed as m, openBlock as d, createElementBlock as c, normalizeClass as u, createElementVNode as t, createVNode as h, withCtx as f, toDisplayString as o } from "vue";
|
2
|
+
import k from "./index224.js";
|
3
|
+
const y = { class: "bb-base-date-picker__year-container" }, v = {
|
4
|
+
"aria-live": "polite",
|
5
|
+
class: "bb-base-date-picker__selected-day-label"
|
6
|
+
}, B = { class: "bb-base-date-picker__weekday" }, D = { class: "bb-base-date-picker__monthday" }, M = { class: "bb-base-date-picker__month-button" }, C = /* @__PURE__ */ p({
|
7
|
+
__name: "BaseDatePickerHeader",
|
8
|
+
props: {
|
9
|
+
cursor: {},
|
10
|
+
disabled: { type: Boolean },
|
11
|
+
hidden: { type: Boolean }
|
12
|
+
},
|
13
|
+
emits: ["mode:year", "mode:month"],
|
14
|
+
setup(n) {
|
15
|
+
const s = n, r = b("top"), l = (e, a) => {
|
16
|
+
e && a && (r.value = e.isBefore(a) ? "top" : "bottom");
|
17
|
+
};
|
18
|
+
_(
|
19
|
+
() => s.cursor,
|
20
|
+
(e, a) => {
|
21
|
+
l(e, a);
|
22
|
+
}
|
23
|
+
);
|
24
|
+
const i = m(() => s.cursor.format("YYYY"));
|
25
|
+
return (e, a) => (d(), c("div", {
|
26
|
+
class: u(["bb-base-date-picker__header", { "bb-base-date-picker__header--hidden": e.hidden }])
|
27
|
+
}, [
|
28
|
+
t("div", y, [
|
29
|
+
h(k, {
|
30
|
+
direction: r.value,
|
31
|
+
duration: 500,
|
32
|
+
gap: 30
|
33
|
+
}, {
|
34
|
+
default: f(() => [
|
35
|
+
(d(), c("span", {
|
36
|
+
key: i.value,
|
37
|
+
"aria-live": "polite",
|
38
|
+
class: "bb-base-date-picker__year-button"
|
39
|
+
}, o(i.value), 1))
|
40
|
+
]),
|
41
|
+
_: 1
|
42
|
+
}, 8, ["direction"])
|
43
|
+
]),
|
44
|
+
t("div", v, [
|
45
|
+
t("span", B, o(e.cursor.format("ddd")) + ", ", 1),
|
46
|
+
t("span", D, o(e.cursor.format("DD")), 1),
|
47
|
+
t("span", M, o(e.cursor.format("MMMM")), 1)
|
48
|
+
])
|
49
|
+
], 2));
|
50
|
+
}
|
51
|
+
});
|
13
52
|
export {
|
14
|
-
|
53
|
+
C as default
|
15
54
|
};
|
16
55
|
//# sourceMappingURL=index222.js.map
|
package/dist/index222.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index222.js","sources":["../src/components/
|
1
|
+
{"version":3,"file":"index222.js","sources":["../src/components/BaseDatePicker/BaseDatePickerHeader.vue"],"sourcesContent":["<template>\n\t<div\n\t\tclass=\"bb-base-date-picker__header\"\n\t\t:class=\"{ 'bb-base-date-picker__header--hidden': hidden }\"\n\t>\n\t\t<div class=\"bb-base-date-picker__year-container\">\n\t\t\t<SlideTransition :direction=\"direction\" :duration=\"500\" :gap=\"30\">\n\t\t\t\t<span\n\t\t\t\t\t:key=\"year\"\n\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\tclass=\"bb-base-date-picker__year-button\"\n\t\t\t\t>\n\t\t\t\t\t{{ year }}\n\t\t\t\t</span>\n\t\t\t</SlideTransition>\n\t\t</div>\n\t\t<div aria-live=\"polite\" class=\"bb-base-date-picker__selected-day-label\">\n\t\t\t<span class=\"bb-base-date-picker__weekday\"\n\t\t\t\t>{{ cursor.format('ddd') }},\n\t\t\t</span>\n\t\t\t<span class=\"bb-base-date-picker__monthday\">{{\n\t\t\t\tcursor.format('DD')\n\t\t\t}}</span>\n\t\t\t<span class=\"bb-base-date-picker__month-button\">\n\t\t\t\t{{ cursor.format('MMMM') }}\n\t\t\t</span>\n\t\t</div>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport type { Dayjs } from 'dayjs';\nimport { ref } from 'vue';\nimport { watch } from 'vue';\nimport SlideTransition from '../Transitions/Slide.vue';\nimport { computed } from 'vue';\n\ntype Props = {\n\tcursor: Dayjs;\n\tdisabled: boolean;\n\thidden: boolean;\n};\nconst props = defineProps<Props>();\n\ndefineEmits<{\n\t(event: 'mode:year'): void;\n\t(event: 'mode:month'): void;\n}>();\n\nconst direction = ref<'top' | 'bottom'>('top');\nconst setSlideDirection = (\n\tcurrent: Dayjs | undefined,\n\tprevious: Dayjs | undefined\n) => {\n\tif (current && previous) {\n\t\tdirection.value = current.isBefore(previous) ? 'top' : 'bottom';\n\t}\n};\n\nwatch(\n\t() => props.cursor,\n\t(current, previous) => {\n\t\tsetSlideDirection(current, previous);\n\t}\n);\n\nconst year = computed(() => props.cursor.format('YYYY'));\n</script>\n"],"names":["props","__props","direction","ref","setSlideDirection","current","previous","watch","year","computed"],"mappings":";;;;;;;;;;;;;;AA0CA,UAAMA,IAAQC,GAORC,IAAYC,EAAsB,KAAK,GACvCC,IAAoB,CACzBC,GACAC,MACI;AACJ,MAAID,KAAWC,MACdJ,EAAU,QAAQG,EAAQ,SAASC,CAAQ,IAAI,QAAQ;AAAA,IACxD;AAGD,IAAAC;AAAA,MACC,MAAMP,EAAM;AAAA,MACZ,CAACK,GAASC,MAAa;AACtB,QAAAF,EAAkBC,GAASC,CAAQ;AAAA,MACpC;AAAA,IAAA;AAGD,UAAME,IAAOC,EAAS,MAAMT,EAAM,OAAO,OAAO,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index223.js
CHANGED
@@ -1,8 +1,47 @@
|
|
1
|
-
import o from "
|
2
|
-
|
3
|
-
|
4
|
-
const
|
1
|
+
import { defineComponent as _, computed as a, openBlock as o, createElementBlock as c, createElementVNode as p, Fragment as b, renderList as h, createBlock as k, normalizeClass as f, withCtx as y, createTextVNode as x, toDisplayString as B } from "vue";
|
2
|
+
import C from "./index14.js";
|
3
|
+
/* empty css */
|
4
|
+
const M = { class: "bb-base-date-picker__button-menu bb-base-date-picker__month-selector" }, v = { class: "content" }, E = /* @__PURE__ */ _({
|
5
|
+
__name: "BaseDatePickerMonthSelector",
|
6
|
+
props: {
|
7
|
+
cursor: {},
|
8
|
+
disabled: { type: Boolean }
|
9
|
+
},
|
10
|
+
emits: ["update:month"],
|
11
|
+
setup(l, { emit: d }) {
|
12
|
+
const s = l, m = d, i = a(() => s.cursor.month()), u = a(
|
13
|
+
() => new Array(12).fill(0).map((r, t) => {
|
14
|
+
const n = s.cursor.clone().startOf("year").add(t, "month");
|
15
|
+
return {
|
16
|
+
text: n.format("MMMM"),
|
17
|
+
key: n.unix(),
|
18
|
+
selected: n.month() === i.value,
|
19
|
+
handler: () => m("update:month", t)
|
20
|
+
};
|
21
|
+
})
|
22
|
+
);
|
23
|
+
return (r, t) => (o(), c("div", M, [
|
24
|
+
p("div", v, [
|
25
|
+
(o(!0), c(b, null, h(u.value, (e) => (o(), k(C, {
|
26
|
+
key: e.key,
|
27
|
+
class: f({
|
28
|
+
content__btn: !0,
|
29
|
+
"content__btn--selected": e.selected
|
30
|
+
}),
|
31
|
+
disabled: r.disabled,
|
32
|
+
type: "button",
|
33
|
+
onClick: e.handler
|
34
|
+
}, {
|
35
|
+
default: y(() => [
|
36
|
+
x(B(e.text), 1)
|
37
|
+
]),
|
38
|
+
_: 2
|
39
|
+
}, 1032, ["class", "disabled", "onClick"]))), 128))
|
40
|
+
])
|
41
|
+
]));
|
42
|
+
}
|
43
|
+
});
|
5
44
|
export {
|
6
|
-
|
45
|
+
E as default
|
7
46
|
};
|
8
47
|
//# sourceMappingURL=index223.js.map
|
package/dist/index223.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index223.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index223.js","sources":["../src/components/BaseDatePicker/BaseDatePickerMonthSelector.vue"],"sourcesContent":["<template>\n\t<div\n\t\tclass=\"bb-base-date-picker__button-menu bb-base-date-picker__month-selector\"\n\t>\n\t\t<div class=\"content\">\n\t\t\t<BaseButton\n\t\t\t\tv-for=\"option in options\"\n\t\t\t\t:key=\"option.key\"\n\t\t\t\t:class=\"{\n\t\t\t\t\tcontent__btn: true,\n\t\t\t\t\t'content__btn--selected': option.selected,\n\t\t\t\t}\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\ttype=\"button\"\n\t\t\t\t@click=\"option.handler\"\n\t\t\t>\n\t\t\t\t{{ option.text }}\n\t\t\t</BaseButton>\n\t\t</div>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport type { Dayjs } from 'dayjs';\nimport { computed } from 'vue';\nimport BaseButton from '../BaseButton/BaseButton.vue';\n\ntype Props = {\n\tcursor: Dayjs;\n\tdisabled: boolean;\n};\nconst props = defineProps<Props>();\nconst emit = defineEmits<{\n\t(event: 'update:month', value: number): void;\n}>();\n\nconst month = computed(() => props.cursor.month());\n\nconst options = computed(() =>\n\tnew Array(12).fill(0).map((_: unknown, index) => {\n\t\tlet base = props.cursor.clone().startOf('year');\n\t\tconst d = base.add(index, 'month');\n\t\treturn {\n\t\t\ttext: d.format('MMMM'),\n\t\t\tkey: d.unix(),\n\t\t\tselected: d.month() === month.value,\n\t\t\thandler: () => emit('update:month', index),\n\t\t};\n\t})\n);\n</script>\n"],"names":["props","__props","emit","__emit","month","computed","options","_","index","d"],"mappings":";;;;;;;;;;;AA+BA,UAAMA,IAAQC,GACRC,IAAOC,GAIPC,IAAQC,EAAS,MAAML,EAAM,OAAO,OAAO,GAE3CM,IAAUD;AAAA,MAAS,MACxB,IAAI,MAAM,EAAE,EAAE,KAAK,CAAC,EAAE,IAAI,CAACE,GAAYC,MAAU;AAEhD,cAAMC,IADKT,EAAM,OAAO,MAAM,EAAE,QAAQ,MAAM,EAC/B,IAAIQ,GAAO,OAAO;AAC1B,eAAA;AAAA,UACN,MAAMC,EAAE,OAAO,MAAM;AAAA,UACrB,KAAKA,EAAE,KAAK;AAAA,UACZ,UAAUA,EAAE,MAAM,MAAML,EAAM;AAAA,UAC9B,SAAS,MAAMF,EAAK,gBAAgBM,CAAK;AAAA,QAAA;AAAA,MAC1C,CACA;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index224.js
CHANGED
@@ -1,372 +1,8 @@
|
|
1
|
-
import
|
2
|
-
|
3
|
-
import
|
4
|
-
|
5
|
-
const e = y(t);
|
6
|
-
let n = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
|
7
|
-
const o = R(t), c = o ? t.offsetWidth : n, s = o ? t.offsetHeight : i, r = D(n) !== c || D(i) !== s;
|
8
|
-
return r && (n = c, i = s), {
|
9
|
-
width: n,
|
10
|
-
height: i,
|
11
|
-
$: r
|
12
|
-
};
|
13
|
-
}
|
14
|
-
function k(t) {
|
15
|
-
return x(t) ? t : t.contextElement;
|
16
|
-
}
|
17
|
-
function F(t) {
|
18
|
-
const e = k(t);
|
19
|
-
if (!R(e))
|
20
|
-
return b(1);
|
21
|
-
const n = e.getBoundingClientRect(), {
|
22
|
-
width: i,
|
23
|
-
height: o,
|
24
|
-
$: c
|
25
|
-
} = J(e);
|
26
|
-
let s = (c ? D(n.width) : n.width) / i, r = (c ? D(n.height) : n.height) / o;
|
27
|
-
return (!s || !Number.isFinite(s)) && (s = 1), (!r || !Number.isFinite(r)) && (r = 1), {
|
28
|
-
x: s,
|
29
|
-
y: r
|
30
|
-
};
|
31
|
-
}
|
32
|
-
const ft = /* @__PURE__ */ b(0);
|
33
|
-
function Q(t) {
|
34
|
-
const e = E(t);
|
35
|
-
return !j() || !e.visualViewport ? ft : {
|
36
|
-
x: e.visualViewport.offsetLeft,
|
37
|
-
y: e.visualViewport.offsetTop
|
38
|
-
};
|
39
|
-
}
|
40
|
-
function ut(t, e, n) {
|
41
|
-
return e === void 0 && (e = !1), !n || e && n !== E(t) ? !1 : e;
|
42
|
-
}
|
43
|
-
function L(t, e, n, i) {
|
44
|
-
e === void 0 && (e = !1), n === void 0 && (n = !1);
|
45
|
-
const o = t.getBoundingClientRect(), c = k(t);
|
46
|
-
let s = b(1);
|
47
|
-
e && (i ? x(i) && (s = F(i)) : s = F(t));
|
48
|
-
const r = ut(c, n, i) ? Q(c) : b(0);
|
49
|
-
let l = (o.left + r.x) / s.x, f = (o.top + r.y) / s.y, u = o.width / s.x, h = o.height / s.y;
|
50
|
-
if (c) {
|
51
|
-
const m = E(c), g = i && x(i) ? E(i) : i;
|
52
|
-
let v = m, a = U(v);
|
53
|
-
for (; a && i && g !== v; ) {
|
54
|
-
const p = F(a), d = a.getBoundingClientRect(), w = y(a), O = d.left + (a.clientLeft + parseFloat(w.paddingLeft)) * p.x, B = d.top + (a.clientTop + parseFloat(w.paddingTop)) * p.y;
|
55
|
-
l *= p.x, f *= p.y, u *= p.x, h *= p.y, l += O, f += B, v = E(a), a = U(v);
|
56
|
-
}
|
57
|
-
}
|
58
|
-
return X({
|
59
|
-
width: u,
|
60
|
-
height: h,
|
61
|
-
x: l,
|
62
|
-
y: f
|
63
|
-
});
|
64
|
-
}
|
65
|
-
function ht(t) {
|
66
|
-
let {
|
67
|
-
elements: e,
|
68
|
-
rect: n,
|
69
|
-
offsetParent: i,
|
70
|
-
strategy: o
|
71
|
-
} = t;
|
72
|
-
const c = o === "fixed", s = C(i), r = e ? S(e.floating) : !1;
|
73
|
-
if (i === s || r && c)
|
74
|
-
return n;
|
75
|
-
let l = {
|
76
|
-
scrollLeft: 0,
|
77
|
-
scrollTop: 0
|
78
|
-
}, f = b(1);
|
79
|
-
const u = b(0), h = R(i);
|
80
|
-
if ((h || !h && !c) && ((M(i) !== "body" || _(s)) && (l = H(i)), R(i))) {
|
81
|
-
const m = L(i);
|
82
|
-
f = F(i), u.x = m.x + i.clientLeft, u.y = m.y + i.clientTop;
|
83
|
-
}
|
84
|
-
return {
|
85
|
-
width: n.width * f.x,
|
86
|
-
height: n.height * f.y,
|
87
|
-
x: n.x * f.x - l.scrollLeft * f.x + u.x,
|
88
|
-
y: n.y * f.y - l.scrollTop * f.y + u.y
|
89
|
-
};
|
90
|
-
}
|
91
|
-
function at(t) {
|
92
|
-
return Array.from(t.getClientRects());
|
93
|
-
}
|
94
|
-
function Y(t) {
|
95
|
-
return L(C(t)).left + H(t).scrollLeft;
|
96
|
-
}
|
97
|
-
function dt(t) {
|
98
|
-
const e = C(t), n = H(t), i = t.ownerDocument.body, o = T(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), c = T(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
|
99
|
-
let s = -n.scrollLeft + Y(t);
|
100
|
-
const r = -n.scrollTop;
|
101
|
-
return y(i).direction === "rtl" && (s += T(e.clientWidth, i.clientWidth) - o), {
|
102
|
-
width: o,
|
103
|
-
height: c,
|
104
|
-
x: s,
|
105
|
-
y: r
|
106
|
-
};
|
107
|
-
}
|
108
|
-
function gt(t, e) {
|
109
|
-
const n = E(t), i = C(t), o = n.visualViewport;
|
110
|
-
let c = i.clientWidth, s = i.clientHeight, r = 0, l = 0;
|
111
|
-
if (o) {
|
112
|
-
c = o.width, s = o.height;
|
113
|
-
const f = j();
|
114
|
-
(!f || f && e === "fixed") && (r = o.offsetLeft, l = o.offsetTop);
|
115
|
-
}
|
116
|
-
return {
|
117
|
-
width: c,
|
118
|
-
height: s,
|
119
|
-
x: r,
|
120
|
-
y: l
|
121
|
-
};
|
122
|
-
}
|
123
|
-
function pt(t, e) {
|
124
|
-
const n = L(t, !0, e === "fixed"), i = n.top + t.clientTop, o = n.left + t.clientLeft, c = R(t) ? F(t) : b(1), s = t.clientWidth * c.x, r = t.clientHeight * c.y, l = o * c.x, f = i * c.y;
|
125
|
-
return {
|
126
|
-
width: s,
|
127
|
-
height: r,
|
128
|
-
x: l,
|
129
|
-
y: f
|
130
|
-
};
|
131
|
-
}
|
132
|
-
function K(t, e, n) {
|
133
|
-
let i;
|
134
|
-
if (e === "viewport")
|
135
|
-
i = gt(t, n);
|
136
|
-
else if (e === "document")
|
137
|
-
i = dt(C(t));
|
138
|
-
else if (x(e))
|
139
|
-
i = pt(e, n);
|
140
|
-
else {
|
141
|
-
const o = Q(t);
|
142
|
-
i = {
|
143
|
-
...e,
|
144
|
-
x: e.x - o.x,
|
145
|
-
y: e.y - o.y
|
146
|
-
};
|
147
|
-
}
|
148
|
-
return X(i);
|
149
|
-
}
|
150
|
-
function Z(t, e) {
|
151
|
-
const n = W(t);
|
152
|
-
return n === e || !x(n) || N(n) ? !1 : y(n).position === "fixed" || Z(n, e);
|
153
|
-
}
|
154
|
-
function wt(t, e) {
|
155
|
-
const n = e.get(t);
|
156
|
-
if (n)
|
157
|
-
return n;
|
158
|
-
let i = $(t, [], !1).filter((r) => x(r) && M(r) !== "body"), o = null;
|
159
|
-
const c = y(t).position === "fixed";
|
160
|
-
let s = c ? W(t) : t;
|
161
|
-
for (; x(s) && !N(s); ) {
|
162
|
-
const r = y(s), l = G(s);
|
163
|
-
!l && r.position === "fixed" && (o = null), (c ? !l && !o : !l && r.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || _(s) && !l && Z(t, s)) ? i = i.filter((u) => u !== s) : o = r, s = W(s);
|
164
|
-
}
|
165
|
-
return e.set(t, i), i;
|
166
|
-
}
|
167
|
-
function mt(t) {
|
168
|
-
let {
|
169
|
-
element: e,
|
170
|
-
boundary: n,
|
171
|
-
rootBoundary: i,
|
172
|
-
strategy: o
|
173
|
-
} = t;
|
174
|
-
const s = [...n === "clippingAncestors" ? S(e) ? [] : wt(e, this._c) : [].concat(n), i], r = s[0], l = s.reduce((f, u) => {
|
175
|
-
const h = K(e, u, o);
|
176
|
-
return f.top = T(h.top, f.top), f.right = z(h.right, f.right), f.bottom = z(h.bottom, f.bottom), f.left = T(h.left, f.left), f;
|
177
|
-
}, K(e, r, o));
|
178
|
-
return {
|
179
|
-
width: l.right - l.left,
|
180
|
-
height: l.bottom - l.top,
|
181
|
-
x: l.left,
|
182
|
-
y: l.top
|
183
|
-
};
|
184
|
-
}
|
185
|
-
function vt(t) {
|
186
|
-
const {
|
187
|
-
width: e,
|
188
|
-
height: n
|
189
|
-
} = J(t);
|
190
|
-
return {
|
191
|
-
width: e,
|
192
|
-
height: n
|
193
|
-
};
|
194
|
-
}
|
195
|
-
function xt(t, e, n) {
|
196
|
-
const i = R(e), o = C(e), c = n === "fixed", s = L(t, !0, c, e);
|
197
|
-
let r = {
|
198
|
-
scrollLeft: 0,
|
199
|
-
scrollTop: 0
|
200
|
-
};
|
201
|
-
const l = b(0);
|
202
|
-
if (i || !i && !c)
|
203
|
-
if ((M(e) !== "body" || _(o)) && (r = H(e)), i) {
|
204
|
-
const h = L(e, !0, c, e);
|
205
|
-
l.x = h.x + e.clientLeft, l.y = h.y + e.clientTop;
|
206
|
-
} else o && (l.x = Y(o));
|
207
|
-
const f = s.left + r.scrollLeft - l.x, u = s.top + r.scrollTop - l.y;
|
208
|
-
return {
|
209
|
-
x: f,
|
210
|
-
y: u,
|
211
|
-
width: s.width,
|
212
|
-
height: s.height
|
213
|
-
};
|
214
|
-
}
|
215
|
-
function V(t) {
|
216
|
-
return y(t).position === "static";
|
217
|
-
}
|
218
|
-
function P(t, e) {
|
219
|
-
return !R(t) || y(t).position === "fixed" ? null : e ? e(t) : t.offsetParent;
|
220
|
-
}
|
221
|
-
function tt(t, e) {
|
222
|
-
const n = E(t);
|
223
|
-
if (S(t))
|
224
|
-
return n;
|
225
|
-
if (!R(t)) {
|
226
|
-
let o = W(t);
|
227
|
-
for (; o && !N(o); ) {
|
228
|
-
if (x(o) && !V(o))
|
229
|
-
return o;
|
230
|
-
o = W(o);
|
231
|
-
}
|
232
|
-
return n;
|
233
|
-
}
|
234
|
-
let i = P(t, e);
|
235
|
-
for (; i && ct(i) && V(i); )
|
236
|
-
i = P(i, e);
|
237
|
-
return i && N(i) && V(i) && !G(i) ? n : i || lt(t) || n;
|
238
|
-
}
|
239
|
-
const yt = async function(t) {
|
240
|
-
const e = this.getOffsetParent || tt, n = this.getDimensions, i = await n(t.floating);
|
241
|
-
return {
|
242
|
-
reference: xt(t.reference, await e(t.floating), t.strategy),
|
243
|
-
floating: {
|
244
|
-
x: 0,
|
245
|
-
y: 0,
|
246
|
-
width: i.width,
|
247
|
-
height: i.height
|
248
|
-
}
|
249
|
-
};
|
250
|
-
};
|
251
|
-
function bt(t) {
|
252
|
-
return y(t).direction === "rtl";
|
253
|
-
}
|
254
|
-
const Rt = {
|
255
|
-
convertOffsetParentRelativeRectToViewportRelativeRect: ht,
|
256
|
-
getDocumentElement: C,
|
257
|
-
getClippingRect: mt,
|
258
|
-
getOffsetParent: tt,
|
259
|
-
getElementRects: yt,
|
260
|
-
getClientRects: at,
|
261
|
-
getDimensions: vt,
|
262
|
-
getScale: F,
|
263
|
-
isElement: x,
|
264
|
-
isRTL: bt
|
265
|
-
};
|
266
|
-
function Ct(t, e) {
|
267
|
-
let n = null, i;
|
268
|
-
const o = C(t);
|
269
|
-
function c() {
|
270
|
-
var r;
|
271
|
-
clearTimeout(i), (r = n) == null || r.disconnect(), n = null;
|
272
|
-
}
|
273
|
-
function s(r, l) {
|
274
|
-
r === void 0 && (r = !1), l === void 0 && (l = 1), c();
|
275
|
-
const {
|
276
|
-
left: f,
|
277
|
-
top: u,
|
278
|
-
width: h,
|
279
|
-
height: m
|
280
|
-
} = t.getBoundingClientRect();
|
281
|
-
if (r || e(), !h || !m)
|
282
|
-
return;
|
283
|
-
const g = A(u), v = A(o.clientWidth - (f + h)), a = A(o.clientHeight - (u + m)), p = A(f), w = {
|
284
|
-
rootMargin: -g + "px " + -v + "px " + -a + "px " + -p + "px",
|
285
|
-
threshold: T(0, z(1, l)) || 1
|
286
|
-
};
|
287
|
-
let O = !0;
|
288
|
-
function B(q) {
|
289
|
-
const I = q[0].intersectionRatio;
|
290
|
-
if (I !== l) {
|
291
|
-
if (!O)
|
292
|
-
return s();
|
293
|
-
I ? s(!1, I) : i = setTimeout(() => {
|
294
|
-
s(!1, 1e-7);
|
295
|
-
}, 1e3);
|
296
|
-
}
|
297
|
-
O = !1;
|
298
|
-
}
|
299
|
-
try {
|
300
|
-
n = new IntersectionObserver(B, {
|
301
|
-
...w,
|
302
|
-
// Handle <iframe>s
|
303
|
-
root: o.ownerDocument
|
304
|
-
});
|
305
|
-
} catch {
|
306
|
-
n = new IntersectionObserver(B, w);
|
307
|
-
}
|
308
|
-
n.observe(t);
|
309
|
-
}
|
310
|
-
return s(!0), c;
|
311
|
-
}
|
312
|
-
function Tt(t, e, n, i) {
|
313
|
-
i === void 0 && (i = {});
|
314
|
-
const {
|
315
|
-
ancestorScroll: o = !0,
|
316
|
-
ancestorResize: c = !0,
|
317
|
-
elementResize: s = typeof ResizeObserver == "function",
|
318
|
-
layoutShift: r = typeof IntersectionObserver == "function",
|
319
|
-
animationFrame: l = !1
|
320
|
-
} = i, f = k(t), u = o || c ? [...f ? $(f) : [], ...$(e)] : [];
|
321
|
-
u.forEach((d) => {
|
322
|
-
o && d.addEventListener("scroll", n, {
|
323
|
-
passive: !0
|
324
|
-
}), c && d.addEventListener("resize", n);
|
325
|
-
});
|
326
|
-
const h = f && r ? Ct(f, n) : null;
|
327
|
-
let m = -1, g = null;
|
328
|
-
s && (g = new ResizeObserver((d) => {
|
329
|
-
let [w] = d;
|
330
|
-
w && w.target === f && g && (g.unobserve(e), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
|
331
|
-
var O;
|
332
|
-
(O = g) == null || O.observe(e);
|
333
|
-
})), n();
|
334
|
-
}), f && !l && g.observe(f), g.observe(e));
|
335
|
-
let v, a = l ? L(t) : null;
|
336
|
-
l && p();
|
337
|
-
function p() {
|
338
|
-
const d = L(t);
|
339
|
-
a && (d.x !== a.x || d.y !== a.y || d.width !== a.width || d.height !== a.height) && n(), a = d, v = requestAnimationFrame(p);
|
340
|
-
}
|
341
|
-
return n(), () => {
|
342
|
-
var d;
|
343
|
-
u.forEach((w) => {
|
344
|
-
o && w.removeEventListener("scroll", n), c && w.removeEventListener("resize", n);
|
345
|
-
}), h == null || h(), (d = g) == null || d.disconnect(), g = null, l && cancelAnimationFrame(v);
|
346
|
-
};
|
347
|
-
}
|
348
|
-
const Ft = et, Wt = it, Bt = nt, At = ot, Dt = st, Nt = (t, e, n) => {
|
349
|
-
const i = /* @__PURE__ */ new Map(), o = {
|
350
|
-
platform: Rt,
|
351
|
-
...n
|
352
|
-
}, c = {
|
353
|
-
...o.platform,
|
354
|
-
_c: i
|
355
|
-
};
|
356
|
-
return rt(t, e, {
|
357
|
-
...o,
|
358
|
-
platform: c
|
359
|
-
});
|
360
|
-
};
|
1
|
+
import o from "./index276.js";
|
2
|
+
/* empty css */
|
3
|
+
import t from "./index253.js";
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8c6b13bd"]]);
|
361
5
|
export {
|
362
|
-
|
363
|
-
Tt as autoUpdate,
|
364
|
-
Nt as computePosition,
|
365
|
-
Bt as flip,
|
366
|
-
$ as getOverflowAncestors,
|
367
|
-
At as hide,
|
368
|
-
Ft as offset,
|
369
|
-
Rt as platform,
|
370
|
-
Wt as shift
|
6
|
+
m as default
|
371
7
|
};
|
372
8
|
//# sourceMappingURL=index224.js.map
|