vuetify 3.5.17 → 3.5.18
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/json/importMap-labs.json +8 -8
- package/dist/json/importMap.json +128 -128
- package/dist/json/web-types.json +1 -1
- package/dist/vuetify-labs.css +2051 -2052
- package/dist/vuetify-labs.esm.js +17 -13
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +17 -13
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +351 -351
- package/dist/vuetify.d.ts +40 -40
- package/dist/vuetify.esm.js +16 -11
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +16 -11
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +13 -12
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VDatePicker/VDatePicker.mjs +4 -4
- package/lib/components/VDatePicker/VDatePicker.mjs.map +1 -1
- package/lib/components/VSnackbar/VSnackbar.mjs +12 -5
- package/lib/components/VSnackbar/VSnackbar.mjs.map +1 -1
- package/lib/composables/directiveComponent.mjs +4 -2
- package/lib/composables/directiveComponent.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/index.d.mts +40 -40
- package/lib/labs/VCalendar/VCalendar.css +0 -1
- package/lib/labs/VCalendar/VCalendar.sass +0 -2
- package/lib/labs/VSpeedDial/VSpeedDial.mjs +1 -2
- package/lib/labs/VSpeedDial/VSpeedDial.mjs.map +1 -1
- package/lib/locale/ko.mjs +8 -8
- package/lib/locale/ko.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -167,10 +167,10 @@ export const VDatePicker = genericComponent()({
|
|
|
167
167
|
emit('update:year', value);
|
|
168
168
|
}
|
|
169
169
|
watch(model, (val, oldVal) => {
|
|
170
|
-
const before = adapter.date(wrapInArray(
|
|
171
|
-
const after = adapter.date(wrapInArray(
|
|
172
|
-
const newMonth = adapter.getMonth(
|
|
173
|
-
const newYear = adapter.getYear(
|
|
170
|
+
const before = adapter.date(wrapInArray(oldVal)[oldVal.length - 1]);
|
|
171
|
+
const after = adapter.date(wrapInArray(val)[val.length - 1]);
|
|
172
|
+
const newMonth = adapter.getMonth(after);
|
|
173
|
+
const newYear = adapter.getYear(after);
|
|
174
174
|
if (newMonth !== month.value) {
|
|
175
175
|
month.value = newMonth;
|
|
176
176
|
onUpdateMonth(month.value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VDatePicker.mjs","names":["makeVDatePickerControlsProps","VDatePickerControls","VDatePickerHeader","makeVDatePickerMonthProps","VDatePickerMonth","makeVDatePickerMonthsProps","VDatePickerMonths","makeVDatePickerYearsProps","VDatePickerYears","VFadeTransition","VDefaultsProvider","makeVPickerProps","VPicker","useDate","useLocale","useProxiedModel","computed","ref","shallowRef","watch","genericComponent","omit","propsFactory","useRender","wrapInArray","makeVDatePickerProps","header","type","String","default","title","modelValue","VDatePicker","name","props","emits","date","setup","_ref","emit","slots","adapter","t","model","undefined","v","multiple","viewMode","internal","value","isValid","month","Number","getMonth","startOfMonth","year","getYear","startOfYear","setMonth","isReversing","length","format","text","setYear","setDate","headerTransition","minDate","min","maxDate","max","disabled","targets","push","_date","addDays","isAfter","endOfMonth","onClickNext","onUpdateYear","onUpdateMonth","onClickPrev","onClickDate","onClickMonth","onClickYear","val","oldVal","before","after","newMonth","newYear","isBefore","pickerProps","filterProps","datePickerControlsProps","datePickerHeaderProps","datePickerMonthProps","datePickerMonthsProps","datePickerYearsProps","headerProps","transition","_createVNode","_mergeProps","showWeek","class","style","_Fragment","$event","actions"],"sources":["../../../src/components/VDatePicker/VDatePicker.tsx"],"sourcesContent":["// Styles\nimport './VDatePicker.sass'\n\n// Components\nimport { makeVDatePickerControlsProps, VDatePickerControls } from './VDatePickerControls'\nimport { VDatePickerHeader } from './VDatePickerHeader'\nimport { makeVDatePickerMonthProps, VDatePickerMonth } from './VDatePickerMonth'\nimport { makeVDatePickerMonthsProps, VDatePickerMonths } from './VDatePickerMonths'\nimport { makeVDatePickerYearsProps, VDatePickerYears } from './VDatePickerYears'\nimport { VFadeTransition } from '@/components/transitions'\nimport { VDefaultsProvider } from '@/components/VDefaultsProvider'\nimport { makeVPickerProps, VPicker } from '@/labs/VPicker/VPicker'\n\n// Composables\nimport { useDate } from '@/composables/date'\nimport { useLocale } from '@/composables/locale'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, ref, shallowRef, watch } from 'vue'\nimport { genericComponent, omit, propsFactory, useRender, wrapInArray } from '@/util'\n\n// Types\nimport type { VPickerSlots } from '@/labs/VPicker/VPicker'\nimport type { GenericProps } from '@/util'\n\n// Types\nexport type VDatePickerSlots = Omit<VPickerSlots, 'header'> & {\n header: {\n header: string\n transition: string\n }\n}\n\nexport const makeVDatePickerProps = propsFactory({\n // TODO: implement in v3.5\n // calendarIcon: {\n // type: String,\n // default: '$calendar',\n // },\n // keyboardIcon: {\n // type: String,\n // default: '$edit',\n // },\n // inputMode: {\n // type: String as PropType<'calendar' | 'keyboard'>,\n // default: 'calendar',\n // },\n // inputText: {\n // type: String,\n // default: '$vuetify.datePicker.input.placeholder',\n // },\n // inputPlaceholder: {\n // type: String,\n // default: 'dd/mm/yyyy',\n // },\n header: {\n type: String,\n default: '$vuetify.datePicker.header',\n },\n\n ...makeVDatePickerControlsProps(),\n ...makeVDatePickerMonthProps(),\n ...omit(makeVDatePickerMonthsProps(), ['modelValue']),\n ...omit(makeVDatePickerYearsProps(), ['modelValue']),\n ...makeVPickerProps({ title: '$vuetify.datePicker.title' }),\n\n modelValue: null,\n}, 'VDatePicker')\n\nexport const VDatePicker = genericComponent<new <\n T,\n Multiple extends boolean | 'range' | number | (string & {}) = false,\n TModel = Multiple extends true | number | string\n ? T[]\n : T,\n> (\n props: {\n modelValue?: TModel\n 'onUpdate:modelValue'?: (value: TModel) => void\n multiple?: Multiple\n },\n slots: VDatePickerSlots\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VDatePicker',\n\n props: makeVDatePickerProps(),\n\n emits: {\n 'update:modelValue': (date: any) => true,\n 'update:month': (date: any) => true,\n 'update:year': (date: any) => true,\n // 'update:inputMode': (date: any) => true,\n 'update:viewMode': (date: any) => true,\n },\n\n setup (props, { emit, slots }) {\n const adapter = useDate()\n const { t } = useLocale()\n\n const model = useProxiedModel(\n props,\n 'modelValue',\n undefined,\n v => wrapInArray(v),\n v => props.multiple ? v : v[0],\n )\n\n const viewMode = useProxiedModel(props, 'viewMode')\n // const inputMode = useProxiedModel(props, 'inputMode')\n const internal = computed(() => {\n const value = adapter.date(model.value?.[0])\n\n return value && adapter.isValid(value) ? value : adapter.date()\n })\n\n const month = ref(Number(props.month ?? adapter.getMonth(adapter.startOfMonth(internal.value))))\n const year = ref(Number(props.year ?? adapter.getYear(adapter.startOfYear(adapter.setMonth(internal.value, month.value)))))\n\n const isReversing = shallowRef(false)\n const header = computed(() => {\n if (props.multiple && model.value.length > 1) {\n return t('$vuetify.datePicker.itemsSelected', model.value.length)\n }\n\n return (model.value[0] && adapter.isValid(model.value[0]))\n ? adapter.format(adapter.date(model.value[0]), 'normalDateWithWeekday')\n : t(props.header)\n })\n const text = computed(() => {\n let date = adapter.date()\n\n date = adapter.setYear(date, year.value)\n date = adapter.setMonth(date, month.value)\n date = adapter.setDate(date, 1)\n\n return adapter.format(date, 'monthAndYear')\n })\n // const headerIcon = computed(() => props.inputMode === 'calendar' ? props.keyboardIcon : props.calendarIcon)\n const headerTransition = computed(() => `date-picker-header${isReversing.value ? '-reverse' : ''}-transition`)\n const minDate = computed(() => {\n const date = adapter.date(props.min)\n\n return props.min && adapter.isValid(date) ? date : null\n })\n const maxDate = computed(() => {\n const date = adapter.date(props.max)\n\n return props.max && adapter.isValid(date) ? date : null\n })\n const disabled = computed(() => {\n if (props.disabled) return true\n\n const targets = []\n\n if (viewMode.value !== 'month') {\n targets.push(...['prev', 'next'])\n } else {\n let _date = adapter.date()\n\n _date = adapter.setYear(_date, year.value)\n _date = adapter.setMonth(_date, month.value)\n\n if (minDate.value) {\n const date = adapter.addDays(adapter.startOfMonth(_date), -1)\n\n adapter.isAfter(minDate.value, date) && targets.push('prev')\n }\n\n if (maxDate.value) {\n const date = adapter.addDays(adapter.endOfMonth(_date), 1)\n\n adapter.isAfter(date, maxDate.value) && targets.push('next')\n }\n }\n\n return targets\n })\n\n // function onClickAppend () {\n // inputMode.value = inputMode.value === 'calendar' ? 'keyboard' : 'calendar'\n // }\n\n function onClickNext () {\n if (month.value < 11) {\n month.value++\n } else {\n year.value++\n month.value = 0\n onUpdateYear(year.value)\n }\n onUpdateMonth(month.value)\n }\n\n function onClickPrev () {\n if (month.value > 0) {\n month.value--\n } else {\n year.value--\n month.value = 11\n onUpdateYear(year.value)\n }\n onUpdateMonth(month.value)\n }\n\n function onClickDate () {\n viewMode.value = 'month'\n }\n\n function onClickMonth () {\n viewMode.value = viewMode.value === 'months' ? 'month' : 'months'\n }\n\n function onClickYear () {\n viewMode.value = viewMode.value === 'year' ? 'month' : 'year'\n }\n\n function onUpdateMonth (value: number) {\n if (viewMode.value === 'months') onClickMonth()\n\n emit('update:month', value)\n }\n\n function onUpdateYear (value: number) {\n if (viewMode.value === 'year') onClickYear()\n\n emit('update:year', value)\n }\n\n watch(model, (val, oldVal) => {\n const before = adapter.date(wrapInArray(val)[0])\n const after = adapter.date(wrapInArray(oldVal)[0])\n const newMonth = adapter.getMonth(before)\n const newYear = adapter.getYear(before)\n\n if (newMonth !== month.value) {\n month.value = newMonth\n onUpdateMonth(month.value)\n }\n\n if (newYear !== year.value) {\n year.value = newYear\n onUpdateYear(year.value)\n }\n\n isReversing.value = adapter.isBefore(before, after)\n })\n\n useRender(() => {\n const pickerProps = VPicker.filterProps(props)\n const datePickerControlsProps = VDatePickerControls.filterProps(props)\n const datePickerHeaderProps = VDatePickerHeader.filterProps(props)\n const datePickerMonthProps = VDatePickerMonth.filterProps(props)\n const datePickerMonthsProps = omit(VDatePickerMonths.filterProps(props), ['modelValue'])\n const datePickerYearsProps = omit(VDatePickerYears.filterProps(props), ['modelValue'])\n\n const headerProps = {\n header: header.value,\n transition: headerTransition.value,\n }\n\n return (\n <VPicker\n { ...pickerProps }\n class={[\n 'v-date-picker',\n `v-date-picker--${viewMode.value}`,\n {\n 'v-date-picker--show-week': props.showWeek,\n },\n props.class,\n ]}\n style={ props.style }\n v-slots={{\n title: () => slots.title?.() ?? (\n <div class=\"v-date-picker__title\">\n { t(props.title) }\n </div>\n ),\n header: () => slots.header ? (\n <VDefaultsProvider\n defaults={{\n VDatePickerHeader: { ...headerProps },\n }}\n >\n { slots.header?.(headerProps) }\n </VDefaultsProvider>\n ) : (\n <VDatePickerHeader\n key=\"header\"\n { ...datePickerHeaderProps }\n { ...headerProps }\n onClick={ viewMode.value !== 'month' ? onClickDate : undefined }\n v-slots={{\n ...slots,\n default: undefined,\n }}\n />\n ),\n default: () => (\n <>\n <VDatePickerControls\n { ...datePickerControlsProps }\n disabled={ disabled.value }\n text={ text.value }\n onClick:next={ onClickNext }\n onClick:prev={ onClickPrev }\n onClick:month={ onClickMonth }\n onClick:year={ onClickYear }\n />\n\n <VFadeTransition hideOnLeave>\n { viewMode.value === 'months' ? (\n <VDatePickerMonths\n key=\"date-picker-months\"\n { ...datePickerMonthsProps }\n v-model={ month.value }\n onUpdate:modelValue={ onUpdateMonth }\n min={ minDate.value }\n max={ maxDate.value }\n />\n ) : viewMode.value === 'year' ? (\n <VDatePickerYears\n key=\"date-picker-years\"\n { ...datePickerYearsProps }\n v-model={ year.value }\n onUpdate:modelValue={ onUpdateYear }\n min={ minDate.value }\n max={ maxDate.value }\n />\n ) : (\n <VDatePickerMonth\n key=\"date-picker-month\"\n { ...datePickerMonthProps }\n v-model={ model.value }\n v-model:month={ month.value }\n v-model:year={ year.value }\n onUpdate:month={ onUpdateMonth }\n onUpdate:year={ onUpdateYear }\n min={ minDate.value }\n max={ maxDate.value }\n />\n )}\n </VFadeTransition>\n </>\n ),\n actions: slots.actions,\n }}\n />\n )\n })\n\n return {}\n },\n})\n\nexport type VDatePicker = InstanceType<typeof VDatePicker>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,4BAA4B,EAAEC,mBAAmB;AAAA,SACjDC,iBAAiB;AAAA,SACjBC,yBAAyB,EAAEC,gBAAgB;AAAA,SAC3CC,0BAA0B,EAAEC,iBAAiB;AAAA,SAC7CC,yBAAyB,EAAEC,gBAAgB;AAAA,SAC3CC,eAAe;AAAA,SACfC,iBAAiB;AAAA,SACjBC,gBAAgB,EAAEC,OAAO,0CAElC;AAAA,SACSC,OAAO;AAAA,SACPC,SAAS;AAAA,SACTC,eAAe,8CAExB;AACA,SAASC,QAAQ,EAAEC,GAAG,EAAEC,UAAU,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAC7CC,gBAAgB,EAAEC,IAAI,EAAEC,YAAY,EAAEC,SAAS,EAAEC,WAAW,gCAErE;AAIA;AAQA,OAAO,MAAMC,oBAAoB,GAAGH,YAAY,CAAC;EAC/C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACAI,MAAM,EAAE;IACNC,IAAI,EAAEC,MAAM;IACZC,OAAO,EAAE;EACX,CAAC;EAED,GAAG7B,4BAA4B,CAAC,CAAC;EACjC,GAAGG,yBAAyB,CAAC,CAAC;EAC9B,GAAGkB,IAAI,CAAChB,0BAA0B,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;EACrD,GAAGgB,IAAI,CAACd,yBAAyB,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;EACpD,GAAGI,gBAAgB,CAAC;IAAEmB,KAAK,EAAE;EAA4B,CAAC,CAAC;EAE3DC,UAAU,EAAE;AACd,CAAC,EAAE,aAAa,CAAC;AAEjB,OAAO,MAAMC,WAAW,GAAGZ,gBAAgB,CAaI,CAAC,CA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A,OAC5BZ,OAAO,CAACjB,KAAK;YAAA,OACbmB,OAAO,CAACnB;UAAK,YAAAmD,YAAA,CAAAhG,gBAAA,EAAAiG,WAAA;YAAA;UAAA,GAKdN,oBAAoB;YAAA,cACfpD,KAAK,CAACM,KAAK;YAAA,uBAAAyD,MAAA,IAAX/D,KAAK,CAACM,KAAK,GAAAyD,MAAA;YAAA,SACLvD,KAAK,CAACF,KAAK;YAAA,mBAAAyD,MAAA,IAAXvD,KAAK,CAACF,KAAK,GAAAyD,MAAA,EAEV3B,aAAa;YAAA,QADfxB,IAAI,CAACN,KAAK;YAAA,kBAAAyD,MAAA,IAAVnD,IAAI,CAACN,KAAK,GAAAyD,MAAA,EAET5B,YAAY;YAAA,OACtBZ,OAAO,CAACjB,KAAK;YAAA,OACbmB,OAAO,CAACnB;UAAK,SAEtB;QAAA,IAGN;QACD0D,OAAO,EAAEnE,KAAK,CAACmE;MACjB,CAAC;IAGP,CAAC,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"VDatePicker.mjs","names":["makeVDatePickerControlsProps","VDatePickerControls","VDatePickerHeader","makeVDatePickerMonthProps","VDatePickerMonth","makeVDatePickerMonthsProps","VDatePickerMonths","makeVDatePickerYearsProps","VDatePickerYears","VFadeTransition","VDefaultsProvider","makeVPickerProps","VPicker","useDate","useLocale","useProxiedModel","computed","ref","shallowRef","watch","genericComponent","omit","propsFactory","useRender","wrapInArray","makeVDatePickerProps","header","type","String","default","title","modelValue","VDatePicker","name","props","emits","date","setup","_ref","emit","slots","adapter","t","model","undefined","v","multiple","viewMode","internal","value","isValid","month","Number","getMonth","startOfMonth","year","getYear","startOfYear","setMonth","isReversing","length","format","text","setYear","setDate","headerTransition","minDate","min","maxDate","max","disabled","targets","push","_date","addDays","isAfter","endOfMonth","onClickNext","onUpdateYear","onUpdateMonth","onClickPrev","onClickDate","onClickMonth","onClickYear","val","oldVal","before","after","newMonth","newYear","isBefore","pickerProps","filterProps","datePickerControlsProps","datePickerHeaderProps","datePickerMonthProps","datePickerMonthsProps","datePickerYearsProps","headerProps","transition","_createVNode","_mergeProps","showWeek","class","style","_Fragment","$event","actions"],"sources":["../../../src/components/VDatePicker/VDatePicker.tsx"],"sourcesContent":["// Styles\nimport './VDatePicker.sass'\n\n// Components\nimport { makeVDatePickerControlsProps, VDatePickerControls } from './VDatePickerControls'\nimport { VDatePickerHeader } from './VDatePickerHeader'\nimport { makeVDatePickerMonthProps, VDatePickerMonth } from './VDatePickerMonth'\nimport { makeVDatePickerMonthsProps, VDatePickerMonths } from './VDatePickerMonths'\nimport { makeVDatePickerYearsProps, VDatePickerYears } from './VDatePickerYears'\nimport { VFadeTransition } from '@/components/transitions'\nimport { VDefaultsProvider } from '@/components/VDefaultsProvider'\nimport { makeVPickerProps, VPicker } from '@/labs/VPicker/VPicker'\n\n// Composables\nimport { useDate } from '@/composables/date'\nimport { useLocale } from '@/composables/locale'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, ref, shallowRef, watch } from 'vue'\nimport { genericComponent, omit, propsFactory, useRender, wrapInArray } from '@/util'\n\n// Types\nimport type { VPickerSlots } from '@/labs/VPicker/VPicker'\nimport type { GenericProps } from '@/util'\n\n// Types\nexport type VDatePickerSlots = Omit<VPickerSlots, 'header'> & {\n header: {\n header: string\n transition: string\n }\n}\n\nexport const makeVDatePickerProps = propsFactory({\n // TODO: implement in v3.5\n // calendarIcon: {\n // type: String,\n // default: '$calendar',\n // },\n // keyboardIcon: {\n // type: String,\n // default: '$edit',\n // },\n // inputMode: {\n // type: String as PropType<'calendar' | 'keyboard'>,\n // default: 'calendar',\n // },\n // inputText: {\n // type: String,\n // default: '$vuetify.datePicker.input.placeholder',\n // },\n // inputPlaceholder: {\n // type: String,\n // default: 'dd/mm/yyyy',\n // },\n header: {\n type: String,\n default: '$vuetify.datePicker.header',\n },\n\n ...makeVDatePickerControlsProps(),\n ...makeVDatePickerMonthProps(),\n ...omit(makeVDatePickerMonthsProps(), ['modelValue']),\n ...omit(makeVDatePickerYearsProps(), ['modelValue']),\n ...makeVPickerProps({ title: '$vuetify.datePicker.title' }),\n\n modelValue: null,\n}, 'VDatePicker')\n\nexport const VDatePicker = genericComponent<new <\n T,\n Multiple extends boolean | 'range' | number | (string & {}) = false,\n TModel = Multiple extends true | number | string\n ? T[]\n : T,\n> (\n props: {\n modelValue?: TModel\n 'onUpdate:modelValue'?: (value: TModel) => void\n multiple?: Multiple\n },\n slots: VDatePickerSlots\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VDatePicker',\n\n props: makeVDatePickerProps(),\n\n emits: {\n 'update:modelValue': (date: any) => true,\n 'update:month': (date: any) => true,\n 'update:year': (date: any) => true,\n // 'update:inputMode': (date: any) => true,\n 'update:viewMode': (date: any) => true,\n },\n\n setup (props, { emit, slots }) {\n const adapter = useDate()\n const { t } = useLocale()\n\n const model = useProxiedModel(\n props,\n 'modelValue',\n undefined,\n v => wrapInArray(v),\n v => props.multiple ? v : v[0],\n )\n\n const viewMode = useProxiedModel(props, 'viewMode')\n // const inputMode = useProxiedModel(props, 'inputMode')\n const internal = computed(() => {\n const value = adapter.date(model.value?.[0])\n\n return value && adapter.isValid(value) ? value : adapter.date()\n })\n\n const month = ref(Number(props.month ?? adapter.getMonth(adapter.startOfMonth(internal.value))))\n const year = ref(Number(props.year ?? adapter.getYear(adapter.startOfYear(adapter.setMonth(internal.value, month.value)))))\n\n const isReversing = shallowRef(false)\n const header = computed(() => {\n if (props.multiple && model.value.length > 1) {\n return t('$vuetify.datePicker.itemsSelected', model.value.length)\n }\n\n return (model.value[0] && adapter.isValid(model.value[0]))\n ? adapter.format(adapter.date(model.value[0]), 'normalDateWithWeekday')\n : t(props.header)\n })\n const text = computed(() => {\n let date = adapter.date()\n\n date = adapter.setYear(date, year.value)\n date = adapter.setMonth(date, month.value)\n date = adapter.setDate(date, 1)\n\n return adapter.format(date, 'monthAndYear')\n })\n // const headerIcon = computed(() => props.inputMode === 'calendar' ? props.keyboardIcon : props.calendarIcon)\n const headerTransition = computed(() => `date-picker-header${isReversing.value ? '-reverse' : ''}-transition`)\n const minDate = computed(() => {\n const date = adapter.date(props.min)\n\n return props.min && adapter.isValid(date) ? date : null\n })\n const maxDate = computed(() => {\n const date = adapter.date(props.max)\n\n return props.max && adapter.isValid(date) ? date : null\n })\n const disabled = computed(() => {\n if (props.disabled) return true\n\n const targets = []\n\n if (viewMode.value !== 'month') {\n targets.push(...['prev', 'next'])\n } else {\n let _date = adapter.date()\n\n _date = adapter.setYear(_date, year.value)\n _date = adapter.setMonth(_date, month.value)\n\n if (minDate.value) {\n const date = adapter.addDays(adapter.startOfMonth(_date), -1)\n\n adapter.isAfter(minDate.value, date) && targets.push('prev')\n }\n\n if (maxDate.value) {\n const date = adapter.addDays(adapter.endOfMonth(_date), 1)\n\n adapter.isAfter(date, maxDate.value) && targets.push('next')\n }\n }\n\n return targets\n })\n\n // function onClickAppend () {\n // inputMode.value = inputMode.value === 'calendar' ? 'keyboard' : 'calendar'\n // }\n\n function onClickNext () {\n if (month.value < 11) {\n month.value++\n } else {\n year.value++\n month.value = 0\n onUpdateYear(year.value)\n }\n onUpdateMonth(month.value)\n }\n\n function onClickPrev () {\n if (month.value > 0) {\n month.value--\n } else {\n year.value--\n month.value = 11\n onUpdateYear(year.value)\n }\n onUpdateMonth(month.value)\n }\n\n function onClickDate () {\n viewMode.value = 'month'\n }\n\n function onClickMonth () {\n viewMode.value = viewMode.value === 'months' ? 'month' : 'months'\n }\n\n function onClickYear () {\n viewMode.value = viewMode.value === 'year' ? 'month' : 'year'\n }\n\n function onUpdateMonth (value: number) {\n if (viewMode.value === 'months') onClickMonth()\n\n emit('update:month', value)\n }\n\n function onUpdateYear (value: number) {\n if (viewMode.value === 'year') onClickYear()\n\n emit('update:year', value)\n }\n\n watch(model, (val, oldVal) => {\n const before = adapter.date(wrapInArray(oldVal)[oldVal.length - 1])\n const after = adapter.date(wrapInArray(val)[val.length - 1])\n const newMonth = adapter.getMonth(after)\n const newYear = adapter.getYear(after)\n\n if (newMonth !== month.value) {\n month.value = newMonth\n onUpdateMonth(month.value)\n }\n\n if (newYear !== year.value) {\n year.value = newYear\n onUpdateYear(year.value)\n }\n\n isReversing.value = adapter.isBefore(before, after)\n })\n\n useRender(() => {\n const pickerProps = VPicker.filterProps(props)\n const datePickerControlsProps = VDatePickerControls.filterProps(props)\n const datePickerHeaderProps = VDatePickerHeader.filterProps(props)\n const datePickerMonthProps = VDatePickerMonth.filterProps(props)\n const datePickerMonthsProps = omit(VDatePickerMonths.filterProps(props), ['modelValue'])\n const datePickerYearsProps = omit(VDatePickerYears.filterProps(props), ['modelValue'])\n\n const headerProps = {\n header: header.value,\n transition: headerTransition.value,\n }\n\n return (\n <VPicker\n { ...pickerProps }\n class={[\n 'v-date-picker',\n `v-date-picker--${viewMode.value}`,\n {\n 'v-date-picker--show-week': props.showWeek,\n },\n props.class,\n ]}\n style={ props.style }\n v-slots={{\n title: () => slots.title?.() ?? (\n <div class=\"v-date-picker__title\">\n { t(props.title) }\n </div>\n ),\n header: () => slots.header ? (\n <VDefaultsProvider\n defaults={{\n VDatePickerHeader: { ...headerProps },\n }}\n >\n { slots.header?.(headerProps) }\n </VDefaultsProvider>\n ) : (\n <VDatePickerHeader\n key=\"header\"\n { ...datePickerHeaderProps }\n { ...headerProps }\n onClick={ viewMode.value !== 'month' ? onClickDate : undefined }\n v-slots={{\n ...slots,\n default: undefined,\n }}\n />\n ),\n default: () => (\n <>\n <VDatePickerControls\n { ...datePickerControlsProps }\n disabled={ disabled.value }\n text={ text.value }\n onClick:next={ onClickNext }\n onClick:prev={ onClickPrev }\n onClick:month={ onClickMonth }\n onClick:year={ onClickYear }\n />\n\n <VFadeTransition hideOnLeave>\n { viewMode.value === 'months' ? (\n <VDatePickerMonths\n key=\"date-picker-months\"\n { ...datePickerMonthsProps }\n v-model={ month.value }\n onUpdate:modelValue={ onUpdateMonth }\n min={ minDate.value }\n max={ maxDate.value }\n />\n ) : viewMode.value === 'year' ? (\n <VDatePickerYears\n key=\"date-picker-years\"\n { ...datePickerYearsProps }\n v-model={ year.value }\n onUpdate:modelValue={ onUpdateYear }\n min={ minDate.value }\n max={ maxDate.value }\n />\n ) : (\n <VDatePickerMonth\n key=\"date-picker-month\"\n { ...datePickerMonthProps }\n v-model={ model.value }\n v-model:month={ month.value }\n v-model:year={ year.value }\n onUpdate:month={ onUpdateMonth }\n onUpdate:year={ onUpdateYear }\n min={ minDate.value }\n max={ maxDate.value }\n />\n )}\n </VFadeTransition>\n </>\n ),\n actions: slots.actions,\n }}\n />\n )\n })\n\n return {}\n },\n})\n\nexport type VDatePicker = InstanceType<typeof VDatePicker>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,4BAA4B,EAAEC,mBAAmB;AAAA,SACjDC,iBAAiB;AAAA,SACjBC,yBAAyB,EAAEC,gBAAgB;AAAA,SAC3CC,0BAA0B,EAAEC,iBAAiB;AAAA,SAC7CC,yBAAyB,EAAEC,gBAAgB;AAAA,SAC3CC,eAAe;AAAA,SACfC,iBAAiB;AAAA,SACjBC,gBAAgB,EAAEC,OAAO,0CAElC;AAAA,SACSC,OAAO;AAAA,SACPC,SAAS;AAAA,SACTC,eAAe,8CAExB;AACA,SAASC,QAAQ,EAAEC,GAAG,EAAEC,UAAU,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAC7CC,gBAAgB,EAAEC,IAAI,EAAEC,YAAY,EAAEC,SAAS,EAAEC,WAAW,gCAErE;AAIA;AAQA,OAAO,MAAMC,oBAAoB,GAAGH,YAAY,CAAC;EAC/C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACAI,MAAM,EAAE;IACNC,IAAI,EAAEC,MAAM;IACZC,OAAO,EAAE;EACX,CAAC;EAED,GAAG7B,4BAA4B,CAAC,CAAC;EACjC,GAAGG,yB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;YAAA,cAChB7C,KAAK,CAACF,KAAK;YAAA,wBAAAyD,MAAA,IAAXvD,KAAK,CAACF,KAAK,GAAAyD,MAAA,EACC3B,aAAa;YAAA,OAC7Bb,OAAO,CAACjB,KAAK;YAAA,OACbmB,OAAO,CAACnB;UAAK,YAEnBF,QAAQ,CAACE,KAAK,KAAK,MAAM,GAAAmD,YAAA,CAAA5F,gBAAA,EAAA6F,WAAA;YAAA;UAAA,GAGpBJ,oBAAoB;YAAA,cACf1C,IAAI,CAACN,KAAK;YAAA,wBAAAyD,MAAA,IAAVnD,IAAI,CAACN,KAAK,GAAAyD,MAAA,EACE5B,YAAY;YAAA,OAC5BZ,OAAO,CAACjB,KAAK;YAAA,OACbmB,OAAO,CAACnB;UAAK,YAAAmD,YAAA,CAAAhG,gBAAA,EAAAiG,WAAA;YAAA;UAAA,GAKdN,oBAAoB;YAAA,cACfpD,KAAK,CAACM,KAAK;YAAA,uBAAAyD,MAAA,IAAX/D,KAAK,CAACM,KAAK,GAAAyD,MAAA;YAAA,SACLvD,KAAK,CAACF,KAAK;YAAA,mBAAAyD,MAAA,IAAXvD,KAAK,CAACF,KAAK,GAAAyD,MAAA,EAEV3B,aAAa;YAAA,QADfxB,IAAI,CAACN,KAAK;YAAA,kBAAAyD,MAAA,IAAVnD,IAAI,CAACN,KAAK,GAAAyD,MAAA,EAET5B,YAAY;YAAA,OACtBZ,OAAO,CAACjB,KAAK;YAAA,OACbmB,OAAO,CAACnB;UAAK,SAEtB;QAAA,IAGN;QACD0D,OAAO,EAAEnE,KAAK,CAACmE;MACjB,CAAC;IAGP,CAAC,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -9,14 +9,16 @@ import { makeVOverlayProps } from "../VOverlay/VOverlay.mjs";
|
|
|
9
9
|
import { VProgressLinear } from "../VProgressLinear/index.mjs"; // Composables
|
|
10
10
|
import { useLayout } from "../../composables/index.mjs";
|
|
11
11
|
import { forwardRefs } from "../../composables/forwardRefs.mjs";
|
|
12
|
+
import { VuetifyLayoutKey } from "../../composables/layout.mjs";
|
|
12
13
|
import { makeLocationProps } from "../../composables/location.mjs";
|
|
13
14
|
import { makePositionProps, usePosition } from "../../composables/position.mjs";
|
|
14
15
|
import { useProxiedModel } from "../../composables/proxiedModel.mjs";
|
|
15
16
|
import { makeRoundedProps, useRounded } from "../../composables/rounded.mjs";
|
|
16
17
|
import { useScopeId } from "../../composables/scopeId.mjs";
|
|
17
18
|
import { makeThemeProps, provideTheme } from "../../composables/theme.mjs";
|
|
19
|
+
import { useToggleScope } from "../../composables/toggleScope.mjs";
|
|
18
20
|
import { genOverlays, makeVariantProps, useVariant } from "../../composables/variant.mjs"; // Utilities
|
|
19
|
-
import { computed, mergeProps, nextTick, onMounted, onScopeDispose, ref, shallowRef, watch } from 'vue';
|
|
21
|
+
import { computed, inject, mergeProps, nextTick, onMounted, onScopeDispose, ref, shallowRef, watch, watchEffect } from 'vue';
|
|
20
22
|
import { genericComponent, omit, propsFactory, refElement, useRender } from "../../util/index.mjs";
|
|
21
23
|
function useCountdown(milliseconds) {
|
|
22
24
|
const time = shallowRef(milliseconds);
|
|
@@ -81,9 +83,6 @@ export const VSnackbar = genericComponent()({
|
|
|
81
83
|
slots
|
|
82
84
|
} = _ref;
|
|
83
85
|
const isActive = useProxiedModel(props, 'modelValue');
|
|
84
|
-
const {
|
|
85
|
-
mainStyles
|
|
86
|
-
} = useLayout();
|
|
87
86
|
const {
|
|
88
87
|
positionClasses
|
|
89
88
|
} = usePosition(props);
|
|
@@ -106,6 +105,14 @@ export const VSnackbar = genericComponent()({
|
|
|
106
105
|
const timerRef = ref();
|
|
107
106
|
const isHovering = shallowRef(false);
|
|
108
107
|
const startY = shallowRef(0);
|
|
108
|
+
const mainStyles = ref();
|
|
109
|
+
const hasLayout = inject(VuetifyLayoutKey, undefined);
|
|
110
|
+
useToggleScope(() => !!hasLayout, () => {
|
|
111
|
+
const layout = useLayout();
|
|
112
|
+
watchEffect(() => {
|
|
113
|
+
mainStyles.value = layout.mainStyles.value;
|
|
114
|
+
});
|
|
115
|
+
});
|
|
109
116
|
watch(isActive, startTimeout);
|
|
110
117
|
watch(() => props.timeout, startTimeout);
|
|
111
118
|
onMounted(() => {
|
|
@@ -175,7 +182,7 @@ export const VSnackbar = genericComponent()({
|
|
|
175
182
|
"scrim": false,
|
|
176
183
|
"scrollStrategy": "none",
|
|
177
184
|
"_disableGlobalStack": true,
|
|
178
|
-
"
|
|
185
|
+
"onTouchstartPassive": onTouchstart,
|
|
179
186
|
"onTouchend": onTouchend
|
|
180
187
|
}, scopeId), {
|
|
181
188
|
default: () => [genOverlays(false, 'v-snackbar'), props.timer && !isHovering.value && _createVNode("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VSnackbar.mjs","names":["VDefaultsProvider","VOverlay","makeVOverlayProps","VProgressLinear","useLayout","forwardRefs","makeLocationProps","makePositionProps","usePosition","useProxiedModel","makeRoundedProps","useRounded","useScopeId","makeThemeProps","provideTheme","genOverlays","makeVariantProps","useVariant","computed","mergeProps","nextTick","onMounted","onScopeDispose","ref","shallowRef","watch","genericComponent","omit","propsFactory","refElement","useRender","useCountdown","milliseconds","time","timer","clear","clearInterval","reset","value","start","el","style","getComputedStyle","transitionDuration","interval","parseFloat","startTime","performance","now","window","setInterval","elapsed","Math","max","makeVSnackbarProps","multiLine","Boolean","text","String","timeout","type","Number","default","vertical","location","transition","VSnackbar","name","props","emits","v","setup","_ref","slots","isActive","mainStyles","positionClasses","scopeId","themeClasses","colorClasses","colorStyles","variantClasses","roundedClasses","countdown","overlay","timerRef","isHovering","startY","startTimeout","activeTimeout","clearTimeout","element","setTimeout","onPointerenter","onPointerleave","onTouchstart","event","touches","clientY","onTouchend","abs","changedTouches","locationClasses","split","reduce","acc","loc","overlayProps","filterProps","hasContent","_createVNode","_mergeProps","class","$event","contentProps","actions","VBtn","variant","ripple","slim","activator"],"sources":["../../../src/components/VSnackbar/VSnackbar.tsx"],"sourcesContent":["// Styles\nimport './VSnackbar.sass'\n\n// Components\nimport { VDefaultsProvider } from '@/components/VDefaultsProvider'\nimport { VOverlay } from '@/components/VOverlay'\nimport { makeVOverlayProps } from '@/components/VOverlay/VOverlay'\nimport { VProgressLinear } from '@/components/VProgressLinear'\n\n// Composables\nimport { useLayout } from '@/composables'\nimport { forwardRefs } from '@/composables/forwardRefs'\nimport { makeLocationProps } from '@/composables/location'\nimport { makePositionProps, usePosition } from '@/composables/position'\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { makeRoundedProps, useRounded } from '@/composables/rounded'\nimport { useScopeId } from '@/composables/scopeId'\nimport { makeThemeProps, provideTheme } from '@/composables/theme'\nimport { genOverlays, makeVariantProps, useVariant } from '@/composables/variant'\n\n// Utilities\nimport { computed, mergeProps, nextTick, onMounted, onScopeDispose, ref, shallowRef, watch } from 'vue'\nimport { genericComponent, omit, propsFactory, refElement, useRender } from '@/util'\n\ntype VSnackbarSlots = {\n activator: { isActive: boolean, props: Record<string, any> }\n default: never\n actions: never\n text: never\n}\n\nfunction useCountdown (milliseconds: number) {\n const time = shallowRef(milliseconds)\n let timer = -1\n\n function clear () {\n clearInterval(timer)\n }\n\n function reset () {\n clear()\n\n nextTick(() => time.value = milliseconds)\n }\n\n function start (el?: HTMLElement) {\n const style = el ? getComputedStyle(el) : { transitionDuration: 0.2 }\n const interval = parseFloat(style.transitionDuration) * 1000 || 200\n\n clear()\n\n if (time.value <= 0) return\n\n const startTime = performance.now()\n timer = window.setInterval(() => {\n const elapsed = performance.now() - startTime + interval\n time.value = Math.max(milliseconds - elapsed, 0)\n\n if (time.value <= 0) clear()\n }, interval)\n }\n\n onScopeDispose(clear)\n\n return { clear, time, start, reset }\n}\n\nexport const makeVSnackbarProps = propsFactory({\n multiLine: Boolean,\n text: String,\n timer: [Boolean, String],\n timeout: {\n type: [Number, String],\n default: 5000,\n },\n vertical: Boolean,\n\n ...makeLocationProps({ location: 'bottom' } as const),\n ...makePositionProps(),\n ...makeRoundedProps(),\n ...makeVariantProps(),\n ...makeThemeProps(),\n ...omit(makeVOverlayProps({\n transition: 'v-snackbar-transition',\n }), ['persistent', 'noClickAnimation', 'scrim', 'scrollStrategy']),\n}, 'VSnackbar')\n\nexport const VSnackbar = genericComponent<VSnackbarSlots>()({\n name: 'VSnackbar',\n\n props: makeVSnackbarProps(),\n\n emits: {\n 'update:modelValue': (v: boolean) => true,\n },\n\n setup (props, { slots }) {\n const isActive = useProxiedModel(props, 'modelValue')\n const { mainStyles } = useLayout()\n const { positionClasses } = usePosition(props)\n const { scopeId } = useScopeId()\n const { themeClasses } = provideTheme(props)\n const { colorClasses, colorStyles, variantClasses } = useVariant(props)\n const { roundedClasses } = useRounded(props)\n const countdown = useCountdown(Number(props.timeout))\n\n const overlay = ref<VOverlay>()\n const timerRef = ref<VProgressLinear>()\n const isHovering = shallowRef(false)\n const startY = shallowRef(0)\n\n watch(isActive, startTimeout)\n watch(() => props.timeout, startTimeout)\n\n onMounted(() => {\n if (isActive.value) startTimeout()\n })\n\n let activeTimeout = -1\n function startTimeout () {\n countdown.reset()\n window.clearTimeout(activeTimeout)\n const timeout = Number(props.timeout)\n\n if (!isActive.value || timeout === -1) return\n\n const element = refElement(timerRef.value)\n\n countdown.start(element)\n\n activeTimeout = window.setTimeout(() => {\n isActive.value = false\n }, timeout)\n }\n\n function clearTimeout () {\n countdown.reset()\n window.clearTimeout(activeTimeout)\n }\n\n function onPointerenter () {\n isHovering.value = true\n clearTimeout()\n }\n\n function onPointerleave () {\n isHovering.value = false\n startTimeout()\n }\n\n function onTouchstart (event: TouchEvent) {\n startY.value = event.touches[0].clientY\n }\n\n function onTouchend (event: TouchEvent) {\n if (Math.abs(startY.value - event.changedTouches[0].clientY) > 50) {\n isActive.value = false\n }\n }\n\n const locationClasses = computed(() => {\n return props.location.split(' ').reduce((acc, loc) => {\n acc[`v-snackbar--${loc}`] = true\n\n return acc\n }, {} as Record<string, any>)\n })\n\n useRender(() => {\n const overlayProps = VOverlay.filterProps(props)\n const hasContent = !!(slots.default || slots.text || props.text)\n\n return (\n <VOverlay\n ref={ overlay }\n class={[\n 'v-snackbar',\n {\n 'v-snackbar--active': isActive.value,\n 'v-snackbar--multi-line': props.multiLine && !props.vertical,\n 'v-snackbar--timer': !!props.timer,\n 'v-snackbar--vertical': props.vertical,\n },\n locationClasses.value,\n positionClasses.value,\n props.class,\n ]}\n style={[\n mainStyles.value,\n props.style,\n ]}\n { ...overlayProps }\n v-model={ isActive.value }\n contentProps={ mergeProps({\n class: [\n 'v-snackbar__wrapper',\n themeClasses.value,\n colorClasses.value,\n roundedClasses.value,\n variantClasses.value,\n ],\n style: [\n colorStyles.value,\n ],\n onPointerenter,\n onPointerleave,\n }, overlayProps.contentProps)}\n persistent\n noClickAnimation\n scrim={ false }\n scrollStrategy=\"none\"\n _disableGlobalStack\n onTouchstart={ onTouchstart }\n onTouchend={ onTouchend }\n { ...scopeId }\n v-slots={{ activator: slots.activator }}\n >\n { genOverlays(false, 'v-snackbar') }\n\n { props.timer && !isHovering.value && (\n <div key=\"timer\" class=\"v-snackbar__timer\">\n <VProgressLinear\n ref={ timerRef }\n color={ typeof props.timer === 'string' ? props.timer : 'info' }\n max={ props.timeout }\n model-value={ countdown.time.value }\n />\n </div>\n )}\n\n { hasContent && (\n <div\n key=\"content\"\n class=\"v-snackbar__content\"\n role=\"status\"\n aria-live=\"polite\"\n >\n { slots.text?.() ?? props.text }\n\n { slots.default?.() }\n </div>\n )}\n\n { slots.actions && (\n <VDefaultsProvider\n defaults={{\n VBtn: {\n variant: 'text',\n ripple: false,\n slim: true,\n },\n }}\n >\n <div class=\"v-snackbar__actions\">\n { slots.actions() }\n </div>\n </VDefaultsProvider>\n )}\n </VOverlay>\n )\n })\n\n return forwardRefs({}, overlay)\n },\n})\n\nexport type VSnackbar = InstanceType<typeof VSnackbar>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,iBAAiB;AAAA,SACjBC,QAAQ;AAA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C,EAAEa,YAAY,CAACO,YAAY,CAAC;QAAA;QAAA;QAAA,SAGrB,KAAK;QAAA;QAAA;QAAA,gBAGEnB,YAAY;QAAA,cACdI;MAAU,GAClBtB,OAAO;QAAAf,OAAA,EAAAA,CAAA,MAGV/C,WAAW,CAAC,KAAK,EAAE,YAAY,CAAC,EAEhCqD,KAAK,CAAClC,KAAK,IAAI,CAACoD,UAAU,CAAChD,KAAK,IAAAwE,YAAA;UAAA;UAAA;QAAA,IAAAA,YAAA,CAAA3G,eAAA;UAAA,OAGtBkF,QAAQ;UAAA,SACN,OAAOjB,KAAK,CAAClC,KAAK,KAAK,QAAQ,GAAGkC,KAAK,CAAClC,KAAK,GAAG,MAAM;UAAA,OACxDkC,KAAK,CAACT,OAAO;UAAA,eACLwB,SAAS,CAAClD,IAAI,CAACK;QAAK,UAGvC,EAECuE,UAAU,IAAAC,YAAA;UAAA;UAAA;UAAA;UAAA;QAAA,IAONrC,KAAK,CAAChB,IAAI,GAAG,CAAC,IAAIW,KAAK,CAACX,IAAI,EAE5BgB,KAAK,CAACX,OAAO,GAAG,CAAC,EAEtB,EAECW,KAAK,CAAC0C,OAAO,IAAAL,YAAA,CAAA9G,iBAAA;UAAA,YAED;YACRoH,IAAI,EAAE;cACJC,OAAO,EAAE,MAAM;cACfC,MAAM,EAAE,KAAK;cACbC,IAAI,EAAE;YACR;UACF;QAAC;UAAAzD,OAAA,EAAAA,CAAA,MAAAgD,YAAA;YAAA;UAAA,IAGGrC,KAAK,CAAC0C,OAAO,CAAC,CAAC;QAAA,EAGtB;QA1CUK,SAAS,EAAE/C,KAAK,CAAC+C;MAAS;IA6C3C,CAAC,CAAC;IAEF,OAAOnH,WAAW,CAAC,CAAC,CAAC,EAAE+E,OAAO,CAAC;EACjC;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"VSnackbar.mjs","names":["VDefaultsProvider","VOverlay","makeVOverlayProps","VProgressLinear","useLayout","forwardRefs","VuetifyLayoutKey","makeLocationProps","makePositionProps","usePosition","useProxiedModel","makeRoundedProps","useRounded","useScopeId","makeThemeProps","provideTheme","useToggleScope","genOverlays","makeVariantProps","useVariant","computed","inject","mergeProps","nextTick","onMounted","onScopeDispose","ref","shallowRef","watch","watchEffect","genericComponent","omit","propsFactory","refElement","useRender","useCountdown","milliseconds","time","timer","clear","clearInterval","reset","value","start","el","style","getComputedStyle","transitionDuration","interval","parseFloat","startTime","performance","now","window","setInterval","elapsed","Math","max","makeVSnackbarProps","multiLine","Boolean","text","String","timeout","type","Number","default","vertical","location","transition","VSnackbar","name","props","emits","v","setup","_ref","slots","isActive","positionClasses","scopeId","themeClasses","colorClasses","colorStyles","variantClasses","roundedClasses","countdown","overlay","timerRef","isHovering","startY","mainStyles","hasLayout","undefined","layout","startTimeout","activeTimeout","clearTimeout","element","setTimeout","onPointerenter","onPointerleave","onTouchstart","event","touches","clientY","onTouchend","abs","changedTouches","locationClasses","split","reduce","acc","loc","overlayProps","filterProps","hasContent","_createVNode","_mergeProps","class","$event","contentProps","actions","VBtn","variant","ripple","slim","activator"],"sources":["../../../src/components/VSnackbar/VSnackbar.tsx"],"sourcesContent":["// Styles\nimport './VSnackbar.sass'\n\n// Components\nimport { VDefaultsProvider } from '@/components/VDefaultsProvider'\nimport { VOverlay } from '@/components/VOverlay'\nimport { makeVOverlayProps } from '@/components/VOverlay/VOverlay'\nimport { VProgressLinear } from '@/components/VProgressLinear'\n\n// Composables\nimport { useLayout } from '@/composables'\nimport { forwardRefs } from '@/composables/forwardRefs'\nimport { VuetifyLayoutKey } from '@/composables/layout'\nimport { makeLocationProps } from '@/composables/location'\nimport { makePositionProps, usePosition } from '@/composables/position'\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { makeRoundedProps, useRounded } from '@/composables/rounded'\nimport { useScopeId } from '@/composables/scopeId'\nimport { makeThemeProps, provideTheme } from '@/composables/theme'\nimport { useToggleScope } from '@/composables/toggleScope'\nimport { genOverlays, makeVariantProps, useVariant } from '@/composables/variant'\n\n// Utilities\nimport { computed, inject, mergeProps, nextTick, onMounted, onScopeDispose, ref, shallowRef, watch, watchEffect } from 'vue'\nimport { genericComponent, omit, propsFactory, refElement, useRender } from '@/util'\n\ntype VSnackbarSlots = {\n activator: { isActive: boolean, props: Record<string, any> }\n default: never\n actions: never\n text: never\n}\n\nfunction useCountdown (milliseconds: number) {\n const time = shallowRef(milliseconds)\n let timer = -1\n\n function clear () {\n clearInterval(timer)\n }\n\n function reset () {\n clear()\n\n nextTick(() => time.value = milliseconds)\n }\n\n function start (el?: HTMLElement) {\n const style = el ? getComputedStyle(el) : { transitionDuration: 0.2 }\n const interval = parseFloat(style.transitionDuration) * 1000 || 200\n\n clear()\n\n if (time.value <= 0) return\n\n const startTime = performance.now()\n timer = window.setInterval(() => {\n const elapsed = performance.now() - startTime + interval\n time.value = Math.max(milliseconds - elapsed, 0)\n\n if (time.value <= 0) clear()\n }, interval)\n }\n\n onScopeDispose(clear)\n\n return { clear, time, start, reset }\n}\n\nexport const makeVSnackbarProps = propsFactory({\n multiLine: Boolean,\n text: String,\n timer: [Boolean, String],\n timeout: {\n type: [Number, String],\n default: 5000,\n },\n vertical: Boolean,\n\n ...makeLocationProps({ location: 'bottom' } as const),\n ...makePositionProps(),\n ...makeRoundedProps(),\n ...makeVariantProps(),\n ...makeThemeProps(),\n ...omit(makeVOverlayProps({\n transition: 'v-snackbar-transition',\n }), ['persistent', 'noClickAnimation', 'scrim', 'scrollStrategy']),\n}, 'VSnackbar')\n\nexport const VSnackbar = genericComponent<VSnackbarSlots>()({\n name: 'VSnackbar',\n\n props: makeVSnackbarProps(),\n\n emits: {\n 'update:modelValue': (v: boolean) => true,\n },\n\n setup (props, { slots }) {\n const isActive = useProxiedModel(props, 'modelValue')\n const { positionClasses } = usePosition(props)\n const { scopeId } = useScopeId()\n const { themeClasses } = provideTheme(props)\n const { colorClasses, colorStyles, variantClasses } = useVariant(props)\n const { roundedClasses } = useRounded(props)\n const countdown = useCountdown(Number(props.timeout))\n\n const overlay = ref<VOverlay>()\n const timerRef = ref<VProgressLinear>()\n const isHovering = shallowRef(false)\n const startY = shallowRef(0)\n const mainStyles = ref()\n const hasLayout = inject(VuetifyLayoutKey, undefined)\n\n useToggleScope(() => !!hasLayout, () => {\n const layout = useLayout()\n\n watchEffect(() => {\n mainStyles.value = layout.mainStyles.value\n })\n })\n\n watch(isActive, startTimeout)\n watch(() => props.timeout, startTimeout)\n\n onMounted(() => {\n if (isActive.value) startTimeout()\n })\n\n let activeTimeout = -1\n function startTimeout () {\n countdown.reset()\n window.clearTimeout(activeTimeout)\n const timeout = Number(props.timeout)\n\n if (!isActive.value || timeout === -1) return\n\n const element = refElement(timerRef.value)\n\n countdown.start(element)\n\n activeTimeout = window.setTimeout(() => {\n isActive.value = false\n }, timeout)\n }\n\n function clearTimeout () {\n countdown.reset()\n window.clearTimeout(activeTimeout)\n }\n\n function onPointerenter () {\n isHovering.value = true\n clearTimeout()\n }\n\n function onPointerleave () {\n isHovering.value = false\n startTimeout()\n }\n\n function onTouchstart (event: TouchEvent) {\n startY.value = event.touches[0].clientY\n }\n\n function onTouchend (event: TouchEvent) {\n if (Math.abs(startY.value - event.changedTouches[0].clientY) > 50) {\n isActive.value = false\n }\n }\n\n const locationClasses = computed(() => {\n return props.location.split(' ').reduce((acc, loc) => {\n acc[`v-snackbar--${loc}`] = true\n\n return acc\n }, {} as Record<string, any>)\n })\n\n useRender(() => {\n const overlayProps = VOverlay.filterProps(props)\n const hasContent = !!(slots.default || slots.text || props.text)\n\n return (\n <VOverlay\n ref={ overlay }\n class={[\n 'v-snackbar',\n {\n 'v-snackbar--active': isActive.value,\n 'v-snackbar--multi-line': props.multiLine && !props.vertical,\n 'v-snackbar--timer': !!props.timer,\n 'v-snackbar--vertical': props.vertical,\n },\n locationClasses.value,\n positionClasses.value,\n props.class,\n ]}\n style={[\n mainStyles.value,\n props.style,\n ]}\n { ...overlayProps }\n v-model={ isActive.value }\n contentProps={ mergeProps({\n class: [\n 'v-snackbar__wrapper',\n themeClasses.value,\n colorClasses.value,\n roundedClasses.value,\n variantClasses.value,\n ],\n style: [\n colorStyles.value,\n ],\n onPointerenter,\n onPointerleave,\n }, overlayProps.contentProps)}\n persistent\n noClickAnimation\n scrim={ false }\n scrollStrategy=\"none\"\n _disableGlobalStack\n onTouchstartPassive={ onTouchstart }\n onTouchend={ onTouchend }\n { ...scopeId }\n v-slots={{ activator: slots.activator }}\n >\n { genOverlays(false, 'v-snackbar') }\n\n { props.timer && !isHovering.value && (\n <div key=\"timer\" class=\"v-snackbar__timer\">\n <VProgressLinear\n ref={ timerRef }\n color={ typeof props.timer === 'string' ? props.timer : 'info' }\n max={ props.timeout }\n model-value={ countdown.time.value }\n />\n </div>\n )}\n\n { hasContent && (\n <div\n key=\"content\"\n class=\"v-snackbar__content\"\n role=\"status\"\n aria-live=\"polite\"\n >\n { slots.text?.() ?? props.text }\n\n { slots.default?.() }\n </div>\n )}\n\n { slots.actions && (\n <VDefaultsProvider\n defaults={{\n VBtn: {\n variant: 'text',\n ripple: false,\n slim: true,\n },\n }}\n >\n <div class=\"v-snackbar__actions\">\n { slots.actions() }\n </div>\n </VDefaultsProvider>\n )}\n </VOverlay>\n )\n })\n\n return forwardRefs({}, overlay)\n },\n})\n\nexport type VSnackbar = InstanceType<typeof VSnackbar>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,iBAAiB;AAAA,SACjBC,QAAQ;AAAA,SACRC,iBAAiB;AAAA,SACjBC,eAAe,wCAExB;AAAA,SACSC,SAAS;AAAA,SACTC,WAAW;AAAA,SACXC,gBAAgB;AAAA,SAChBC,iBAAiB;AAAA,SACjBC,iBAAiB,EAAEC,WAAW;AAAA,SAC9BC,eAAe;AAAA,SACfC,gBAAgB,EAAEC,UAAU;AAAA,SAC5BC,UAAU;AAAA,SACVC,cAAc,EAAEC,YAAY;AAAA,SAC5BC,cAAc;AAAA,SACdC,WAAW,EAAEC,gBAAgB,EAAEC,UAAU,yCAElD;AACA,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13
|
|
|
14
14
|
// Get the children from the props or directive value, or the element's children
|
|
15
|
-
const children = props
|
|
15
|
+
const children = props?.text || value?.text || el.innerHTML;
|
|
16
16
|
|
|
17
17
|
// If vnode.ctx is the same as the instance, then we're bound to a plain element
|
|
18
18
|
// and need to find the nearest parent component instance to inherit provides from
|
|
19
19
|
const provides = (vnode.ctx === binding.instance.$ ? findComponentParent(vnode, binding.instance.$)?.provides : vnode.ctx?.provides) ?? binding.instance.$.provides;
|
|
20
|
-
const node = h(concreteComponent, mergeProps(props, value),
|
|
20
|
+
const node = h(concreteComponent, mergeProps(props, value), {
|
|
21
|
+
default: () => children
|
|
22
|
+
});
|
|
21
23
|
node.appContext = Object.assign(Object.create(null), binding.instance.$.appContext, {
|
|
22
24
|
provides
|
|
23
25
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directiveComponent.mjs","names":["h","mergeProps","render","resolveComponent","useDirectiveComponent","component","props","concreteComponent","mounted","el","binding","vnode","value","children","text","innerHTML","provides","ctx","instance","$","findComponentParent","node","appContext","Object","assign","create","unmounted","root","stack","Set","walk","child","add","Array","isArray","result","subTree","delete","Error","from","reverse"],"sources":["../../src/composables/directiveComponent.ts"],"sourcesContent":["// Utilities\nimport { h, mergeProps, render, resolveComponent } from 'vue'\n\n// Types\nimport type {\n Component,\n ComponentInternalInstance,\n ComponentPublicInstance,\n ConcreteComponent,\n DirectiveBinding,\n ObjectDirective,\n VNode,\n} from 'vue'\n\nexport const useDirectiveComponent = (\n component: string | Component,\n props?: any\n): ObjectDirective => {\n const concreteComponent = (typeof component === 'string'\n ? resolveComponent(component)\n : component) as ConcreteComponent\n\n return {\n mounted (el: HTMLElement, binding: DirectiveBinding, vnode: VNode) {\n const { value } = binding\n\n // Get the children from the props or directive value, or the element's children\n const children = props
|
|
1
|
+
{"version":3,"file":"directiveComponent.mjs","names":["h","mergeProps","render","resolveComponent","useDirectiveComponent","component","props","concreteComponent","mounted","el","binding","vnode","value","children","text","innerHTML","provides","ctx","instance","$","findComponentParent","node","default","appContext","Object","assign","create","unmounted","root","stack","Set","walk","child","add","Array","isArray","result","subTree","delete","Error","from","reverse"],"sources":["../../src/composables/directiveComponent.ts"],"sourcesContent":["// Utilities\nimport { h, mergeProps, render, resolveComponent } from 'vue'\n\n// Types\nimport type {\n Component,\n ComponentInternalInstance,\n ComponentPublicInstance,\n ConcreteComponent,\n DirectiveBinding,\n ObjectDirective,\n VNode,\n} from 'vue'\n\nexport const useDirectiveComponent = (\n component: string | Component,\n props?: any\n): ObjectDirective => {\n const concreteComponent = (typeof component === 'string'\n ? resolveComponent(component)\n : component) as ConcreteComponent\n\n return {\n mounted (el: HTMLElement, binding: DirectiveBinding, vnode: VNode) {\n const { value } = binding\n\n // Get the children from the props or directive value, or the element's children\n const children = props?.text || value?.text || el.innerHTML\n\n // If vnode.ctx is the same as the instance, then we're bound to a plain element\n // and need to find the nearest parent component instance to inherit provides from\n const provides = (vnode.ctx === binding.instance!.$\n ? findComponentParent(vnode, binding.instance!.$)?.provides\n : vnode.ctx?.provides) ?? binding.instance!.$.provides\n\n const node = h(concreteComponent, mergeProps(props, value), { default: () => children })\n node.appContext = Object.assign(\n Object.create(null),\n (binding.instance as ComponentPublicInstance).$.appContext,\n { provides }\n )\n\n render(node, el)\n },\n unmounted (el: HTMLElement) {\n render(null, el)\n },\n }\n}\n\nfunction findComponentParent (vnode: VNode, root: ComponentInternalInstance): ComponentInternalInstance | null {\n // Walk the tree from root until we find the child vnode\n const stack = new Set<VNode>()\n const walk = (children: VNode[]): boolean => {\n for (const child of children) {\n if (!child) continue\n\n if (child === vnode) {\n return true\n }\n\n stack.add(child)\n if (Array.isArray(child.children)) {\n const result = walk(child.children as VNode[])\n if (result) {\n return result\n }\n } else if (child.component?.vnode) {\n const result = walk([child.component?.subTree])\n if (result) {\n return result\n }\n }\n stack.delete(child)\n }\n\n return false\n }\n if (!walk([root.subTree])) {\n throw new Error('Could not find original vnode')\n }\n\n // Return the first component parent\n const result = Array.from(stack).reverse()\n for (const child of result) {\n if (child.component) {\n return child.component\n }\n }\n return root\n}\n"],"mappings":"AAAA;AACA,SAASA,CAAC,EAAEC,UAAU,EAAEC,MAAM,EAAEC,gBAAgB,QAAQ,KAAK;;AAE7D;;AAWA,OAAO,MAAMC,qBAAqB,GAAGA,CACnCC,SAA6B,EAC7BC,KAAW,KACS;EACpB,MAAMC,iBAAiB,GAAI,OAAOF,SAAS,KAAK,QAAQ,GACpDF,gBAAgB,CAACE,SAAS,CAAC,GAC3BA,SAA+B;EAEnC,OAAO;IACLG,OAAOA,CAAEC,EAAe,EAAEC,OAAyB,EAAEC,KAAY,EAAE;MACjE,MAAM;QAAEC;MAAM,CAAC,GAAGF,OAAO;;MAEzB;MACA,MAAMG,QAAQ,GAAGP,KAAK,EAAEQ,IAAI,IAAIF,KAAK,EAAEE,IAAI,IAAIL,EAAE,CAACM,SAAS;;MAE3D;MACA;MACA,MAAMC,QAAQ,GAAG,CAACL,KAAK,CAACM,GAAG,KAAKP,OAAO,CAACQ,QAAQ,CAAEC,CAAC,GAC/CC,mBAAmB,CAACT,KAAK,EAAED,OAAO,CAACQ,QAAQ,CAAEC,CAAC,CAAC,EAAEH,QAAQ,GACzDL,KAAK,CAACM,GAAG,EAAED,QAAQ,KAAKN,OAAO,CAACQ,QAAQ,CAAEC,CAAC,CAACH,QAAQ;MAExD,MAAMK,IAAI,GAAGrB,CAAC,CAACO,iBAAiB,EAAEN,UAAU,CAACK,KAAK,EAAEM,KAAK,CAAC,EAAE;QAAEU,OAAO,EAAEA,CAAA,KAAMT;MAAS,CAAC,CAAC;MACxFQ,IAAI,CAACE,UAAU,GAAGC,MAAM,CAACC,MAAM,CAC7BD,MAAM,CAACE,MAAM,CAAC,IAAI,CAAC,EAClBhB,OAAO,CAACQ,QAAQ,CAA6BC,CAAC,CAACI,UAAU,EAC1D;QAAEP;MAAS,CACb,CAAC;MAEDd,MAAM,CAACmB,IAAI,EAAEZ,EAAE,CAAC;IAClB,CAAC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,OAAO2B,KAAK,CAAC3B,SAAS;IACxB;EACF;EACA,OAAOuB,IAAI;AACb","ignoreList":[]}
|
package/lib/entry-bundler.mjs
CHANGED
|
@@ -16,7 +16,7 @@ export const createVuetify = function () {
|
|
|
16
16
|
...options
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
|
-
export const version = "3.5.
|
|
19
|
+
export const version = "3.5.18";
|
|
20
20
|
createVuetify.version = version;
|
|
21
21
|
export { blueprints, components, directives };
|
|
22
22
|
export * from "./composables/index.mjs";
|
package/lib/framework.mjs
CHANGED
package/lib/index.d.mts
CHANGED
|
@@ -523,44 +523,42 @@ declare module '@vue/runtime-core' {
|
|
|
523
523
|
}
|
|
524
524
|
|
|
525
525
|
export interface GlobalComponents {
|
|
526
|
+
VAlert: typeof import('vuetify/components')['VAlert']
|
|
527
|
+
VAlertTitle: typeof import('vuetify/components')['VAlertTitle']
|
|
528
|
+
VApp: typeof import('vuetify/components')['VApp']
|
|
526
529
|
VAppBar: typeof import('vuetify/components')['VAppBar']
|
|
527
530
|
VAppBarNavIcon: typeof import('vuetify/components')['VAppBarNavIcon']
|
|
528
531
|
VAppBarTitle: typeof import('vuetify/components')['VAppBarTitle']
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
VAlertTitle: typeof import('vuetify/components')['VAlertTitle']
|
|
532
|
-
VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
|
|
532
|
+
VAvatar: typeof import('vuetify/components')['VAvatar']
|
|
533
|
+
VBadge: typeof import('vuetify/components')['VBadge']
|
|
533
534
|
VBanner: typeof import('vuetify/components')['VBanner']
|
|
534
535
|
VBannerActions: typeof import('vuetify/components')['VBannerActions']
|
|
535
536
|
VBannerText: typeof import('vuetify/components')['VBannerText']
|
|
536
|
-
VAvatar: typeof import('vuetify/components')['VAvatar']
|
|
537
|
-
VBottomSheet: typeof import('vuetify/components')['VBottomSheet']
|
|
538
537
|
VBottomNavigation: typeof import('vuetify/components')['VBottomNavigation']
|
|
539
|
-
|
|
540
|
-
VBtn: typeof import('vuetify/components')['VBtn']
|
|
541
|
-
VBtnToggle: typeof import('vuetify/components')['VBtnToggle']
|
|
538
|
+
VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
|
|
542
539
|
VBtnGroup: typeof import('vuetify/components')['VBtnGroup']
|
|
540
|
+
VBottomSheet: typeof import('vuetify/components')['VBottomSheet']
|
|
541
|
+
VBtnToggle: typeof import('vuetify/components')['VBtnToggle']
|
|
542
|
+
VBtn: typeof import('vuetify/components')['VBtn']
|
|
543
543
|
VBreadcrumbs: typeof import('vuetify/components')['VBreadcrumbs']
|
|
544
544
|
VBreadcrumbsItem: typeof import('vuetify/components')['VBreadcrumbsItem']
|
|
545
545
|
VBreadcrumbsDivider: typeof import('vuetify/components')['VBreadcrumbsDivider']
|
|
546
|
-
VCheckbox: typeof import('vuetify/components')['VCheckbox']
|
|
547
|
-
VCheckboxBtn: typeof import('vuetify/components')['VCheckboxBtn']
|
|
548
546
|
VCard: typeof import('vuetify/components')['VCard']
|
|
549
547
|
VCardActions: typeof import('vuetify/components')['VCardActions']
|
|
550
548
|
VCardItem: typeof import('vuetify/components')['VCardItem']
|
|
551
549
|
VCardSubtitle: typeof import('vuetify/components')['VCardSubtitle']
|
|
552
550
|
VCardText: typeof import('vuetify/components')['VCardText']
|
|
553
551
|
VCardTitle: typeof import('vuetify/components')['VCardTitle']
|
|
552
|
+
VColorPicker: typeof import('vuetify/components')['VColorPicker']
|
|
553
|
+
VCheckbox: typeof import('vuetify/components')['VCheckbox']
|
|
554
|
+
VCheckboxBtn: typeof import('vuetify/components')['VCheckboxBtn']
|
|
554
555
|
VCarousel: typeof import('vuetify/components')['VCarousel']
|
|
555
556
|
VCarouselItem: typeof import('vuetify/components')['VCarouselItem']
|
|
556
557
|
VChipGroup: typeof import('vuetify/components')['VChipGroup']
|
|
557
|
-
VCode: typeof import('vuetify/components')['VCode']
|
|
558
558
|
VChip: typeof import('vuetify/components')['VChip']
|
|
559
|
+
VCode: typeof import('vuetify/components')['VCode']
|
|
559
560
|
VCombobox: typeof import('vuetify/components')['VCombobox']
|
|
560
561
|
VCounter: typeof import('vuetify/components')['VCounter']
|
|
561
|
-
VColorPicker: typeof import('vuetify/components')['VColorPicker']
|
|
562
|
-
VDialog: typeof import('vuetify/components')['VDialog']
|
|
563
|
-
VDivider: typeof import('vuetify/components')['VDivider']
|
|
564
562
|
VDataTable: typeof import('vuetify/components')['VDataTable']
|
|
565
563
|
VDataTableHeaders: typeof import('vuetify/components')['VDataTableHeaders']
|
|
566
564
|
VDataTableFooter: typeof import('vuetify/components')['VDataTableFooter']
|
|
@@ -568,32 +566,35 @@ declare module '@vue/runtime-core' {
|
|
|
568
566
|
VDataTableRow: typeof import('vuetify/components')['VDataTableRow']
|
|
569
567
|
VDataTableVirtual: typeof import('vuetify/components')['VDataTableVirtual']
|
|
570
568
|
VDataTableServer: typeof import('vuetify/components')['VDataTableServer']
|
|
569
|
+
VDialog: typeof import('vuetify/components')['VDialog']
|
|
571
570
|
VDatePicker: typeof import('vuetify/components')['VDatePicker']
|
|
572
571
|
VDatePickerControls: typeof import('vuetify/components')['VDatePickerControls']
|
|
573
572
|
VDatePickerHeader: typeof import('vuetify/components')['VDatePickerHeader']
|
|
574
573
|
VDatePickerMonth: typeof import('vuetify/components')['VDatePickerMonth']
|
|
575
574
|
VDatePickerMonths: typeof import('vuetify/components')['VDatePickerMonths']
|
|
576
575
|
VDatePickerYears: typeof import('vuetify/components')['VDatePickerYears']
|
|
577
|
-
|
|
578
|
-
VFieldLabel: typeof import('vuetify/components')['VFieldLabel']
|
|
576
|
+
VDivider: typeof import('vuetify/components')['VDivider']
|
|
579
577
|
VExpansionPanels: typeof import('vuetify/components')['VExpansionPanels']
|
|
580
578
|
VExpansionPanel: typeof import('vuetify/components')['VExpansionPanel']
|
|
581
579
|
VExpansionPanelText: typeof import('vuetify/components')['VExpansionPanelText']
|
|
582
580
|
VExpansionPanelTitle: typeof import('vuetify/components')['VExpansionPanelTitle']
|
|
581
|
+
VField: typeof import('vuetify/components')['VField']
|
|
582
|
+
VFieldLabel: typeof import('vuetify/components')['VFieldLabel']
|
|
583
583
|
VFileInput: typeof import('vuetify/components')['VFileInput']
|
|
584
|
+
VFooter: typeof import('vuetify/components')['VFooter']
|
|
584
585
|
VIcon: typeof import('vuetify/components')['VIcon']
|
|
585
586
|
VComponentIcon: typeof import('vuetify/components')['VComponentIcon']
|
|
586
587
|
VSvgIcon: typeof import('vuetify/components')['VSvgIcon']
|
|
587
588
|
VLigatureIcon: typeof import('vuetify/components')['VLigatureIcon']
|
|
588
589
|
VClassIcon: typeof import('vuetify/components')['VClassIcon']
|
|
589
|
-
VFooter: typeof import('vuetify/components')['VFooter']
|
|
590
|
-
VInfiniteScroll: typeof import('vuetify/components')['VInfiniteScroll']
|
|
591
590
|
VImg: typeof import('vuetify/components')['VImg']
|
|
592
591
|
VInput: typeof import('vuetify/components')['VInput']
|
|
593
|
-
VLabel: typeof import('vuetify/components')['VLabel']
|
|
594
592
|
VItemGroup: typeof import('vuetify/components')['VItemGroup']
|
|
595
593
|
VItem: typeof import('vuetify/components')['VItem']
|
|
596
594
|
VKbd: typeof import('vuetify/components')['VKbd']
|
|
595
|
+
VInfiniteScroll: typeof import('vuetify/components')['VInfiniteScroll']
|
|
596
|
+
VLabel: typeof import('vuetify/components')['VLabel']
|
|
597
|
+
VMain: typeof import('vuetify/components')['VMain']
|
|
597
598
|
VList: typeof import('vuetify/components')['VList']
|
|
598
599
|
VListGroup: typeof import('vuetify/components')['VListGroup']
|
|
599
600
|
VListImg: typeof import('vuetify/components')['VListImg']
|
|
@@ -603,58 +604,57 @@ declare module '@vue/runtime-core' {
|
|
|
603
604
|
VListItemSubtitle: typeof import('vuetify/components')['VListItemSubtitle']
|
|
604
605
|
VListItemTitle: typeof import('vuetify/components')['VListItemTitle']
|
|
605
606
|
VListSubheader: typeof import('vuetify/components')['VListSubheader']
|
|
606
|
-
VMain: typeof import('vuetify/components')['VMain']
|
|
607
607
|
VMenu: typeof import('vuetify/components')['VMenu']
|
|
608
608
|
VMessages: typeof import('vuetify/components')['VMessages']
|
|
609
|
-
|
|
609
|
+
VOtpInput: typeof import('vuetify/components')['VOtpInput']
|
|
610
610
|
VNavigationDrawer: typeof import('vuetify/components')['VNavigationDrawer']
|
|
611
|
-
|
|
611
|
+
VOverlay: typeof import('vuetify/components')['VOverlay']
|
|
612
612
|
VProgressLinear: typeof import('vuetify/components')['VProgressLinear']
|
|
613
|
-
VOtpInput: typeof import('vuetify/components')['VOtpInput']
|
|
614
613
|
VProgressCircular: typeof import('vuetify/components')['VProgressCircular']
|
|
615
|
-
|
|
614
|
+
VPagination: typeof import('vuetify/components')['VPagination']
|
|
616
615
|
VRadioGroup: typeof import('vuetify/components')['VRadioGroup']
|
|
617
|
-
|
|
616
|
+
VRating: typeof import('vuetify/components')['VRating']
|
|
618
617
|
VSelect: typeof import('vuetify/components')['VSelect']
|
|
619
|
-
|
|
618
|
+
VSelectionControl: typeof import('vuetify/components')['VSelectionControl']
|
|
620
619
|
VSheet: typeof import('vuetify/components')['VSheet']
|
|
620
|
+
VSelectionControlGroup: typeof import('vuetify/components')['VSelectionControlGroup']
|
|
621
|
+
VSkeletonLoader: typeof import('vuetify/components')['VSkeletonLoader']
|
|
621
622
|
VSlideGroup: typeof import('vuetify/components')['VSlideGroup']
|
|
622
623
|
VSlideGroupItem: typeof import('vuetify/components')['VSlideGroupItem']
|
|
623
|
-
VSkeletonLoader: typeof import('vuetify/components')['VSkeletonLoader']
|
|
624
624
|
VSlider: typeof import('vuetify/components')['VSlider']
|
|
625
|
-
VSnackbar: typeof import('vuetify/components')['VSnackbar']
|
|
626
625
|
VStepper: typeof import('vuetify/components')['VStepper']
|
|
627
626
|
VStepperActions: typeof import('vuetify/components')['VStepperActions']
|
|
628
627
|
VStepperHeader: typeof import('vuetify/components')['VStepperHeader']
|
|
629
628
|
VStepperItem: typeof import('vuetify/components')['VStepperItem']
|
|
630
629
|
VStepperWindow: typeof import('vuetify/components')['VStepperWindow']
|
|
631
630
|
VStepperWindowItem: typeof import('vuetify/components')['VStepperWindowItem']
|
|
632
|
-
|
|
631
|
+
VSnackbar: typeof import('vuetify/components')['VSnackbar']
|
|
633
632
|
VTabs: typeof import('vuetify/components')['VTabs']
|
|
634
633
|
VTab: typeof import('vuetify/components')['VTab']
|
|
634
|
+
VSystemBar: typeof import('vuetify/components')['VSystemBar']
|
|
635
|
+
VSwitch: typeof import('vuetify/components')['VSwitch']
|
|
636
|
+
VTextarea: typeof import('vuetify/components')['VTextarea']
|
|
635
637
|
VTable: typeof import('vuetify/components')['VTable']
|
|
636
638
|
VTextField: typeof import('vuetify/components')['VTextField']
|
|
637
|
-
VSystemBar: typeof import('vuetify/components')['VSystemBar']
|
|
638
639
|
VTimeline: typeof import('vuetify/components')['VTimeline']
|
|
639
640
|
VTimelineItem: typeof import('vuetify/components')['VTimelineItem']
|
|
640
|
-
VToolbar: typeof import('vuetify/components')['VToolbar']
|
|
641
|
-
VToolbarTitle: typeof import('vuetify/components')['VToolbarTitle']
|
|
642
|
-
VToolbarItems: typeof import('vuetify/components')['VToolbarItems']
|
|
643
641
|
VTooltip: typeof import('vuetify/components')['VTooltip']
|
|
644
|
-
VTextarea: typeof import('vuetify/components')['VTextarea']
|
|
645
642
|
VWindow: typeof import('vuetify/components')['VWindow']
|
|
646
643
|
VWindowItem: typeof import('vuetify/components')['VWindowItem']
|
|
644
|
+
VToolbar: typeof import('vuetify/components')['VToolbar']
|
|
645
|
+
VToolbarTitle: typeof import('vuetify/components')['VToolbarTitle']
|
|
646
|
+
VToolbarItems: typeof import('vuetify/components')['VToolbarItems']
|
|
647
647
|
VDataIterator: typeof import('vuetify/components')['VDataIterator']
|
|
648
648
|
VDefaultsProvider: typeof import('vuetify/components')['VDefaultsProvider']
|
|
649
|
+
VForm: typeof import('vuetify/components')['VForm']
|
|
649
650
|
VContainer: typeof import('vuetify/components')['VContainer']
|
|
650
651
|
VCol: typeof import('vuetify/components')['VCol']
|
|
651
652
|
VRow: typeof import('vuetify/components')['VRow']
|
|
652
653
|
VSpacer: typeof import('vuetify/components')['VSpacer']
|
|
653
|
-
VForm: typeof import('vuetify/components')['VForm']
|
|
654
654
|
VHover: typeof import('vuetify/components')['VHover']
|
|
655
|
-
VLazy: typeof import('vuetify/components')['VLazy']
|
|
656
655
|
VLayout: typeof import('vuetify/components')['VLayout']
|
|
657
656
|
VLayoutItem: typeof import('vuetify/components')['VLayoutItem']
|
|
657
|
+
VLazy: typeof import('vuetify/components')['VLazy']
|
|
658
658
|
VLocaleProvider: typeof import('vuetify/components')['VLocaleProvider']
|
|
659
659
|
VNoSsr: typeof import('vuetify/components')['VNoSsr']
|
|
660
660
|
VParallax: typeof import('vuetify/components')['VParallax']
|
|
@@ -662,8 +662,8 @@ declare module '@vue/runtime-core' {
|
|
|
662
662
|
VRangeSlider: typeof import('vuetify/components')['VRangeSlider']
|
|
663
663
|
VResponsive: typeof import('vuetify/components')['VResponsive']
|
|
664
664
|
VThemeProvider: typeof import('vuetify/components')['VThemeProvider']
|
|
665
|
-
VValidation: typeof import('vuetify/components')['VValidation']
|
|
666
665
|
VVirtualScroll: typeof import('vuetify/components')['VVirtualScroll']
|
|
666
|
+
VValidation: typeof import('vuetify/components')['VValidation']
|
|
667
667
|
VFabTransition: typeof import('vuetify/components')['VFabTransition']
|
|
668
668
|
VDialogBottomTransition: typeof import('vuetify/components')['VDialogBottomTransition']
|
|
669
669
|
VDialogTopTransition: typeof import('vuetify/components')['VDialogTopTransition']
|
|
@@ -686,20 +686,20 @@ declare module '@vue/runtime-core' {
|
|
|
686
686
|
VCalendarInterval: typeof import('vuetify/labs/components')['VCalendarInterval']
|
|
687
687
|
VCalendarIntervalEvent: typeof import('vuetify/labs/components')['VCalendarIntervalEvent']
|
|
688
688
|
VCalendarMonthDay: typeof import('vuetify/labs/components')['VCalendarMonthDay']
|
|
689
|
+
VEmptyState: typeof import('vuetify/labs/components')['VEmptyState']
|
|
689
690
|
VFab: typeof import('vuetify/labs/components')['VFab']
|
|
690
691
|
VNumberInput: typeof import('vuetify/labs/components')['VNumberInput']
|
|
691
692
|
VPicker: typeof import('vuetify/labs/components')['VPicker']
|
|
692
693
|
VPickerTitle: typeof import('vuetify/labs/components')['VPickerTitle']
|
|
693
|
-
VEmptyState: typeof import('vuetify/labs/components')['VEmptyState']
|
|
694
694
|
VTimePicker: typeof import('vuetify/labs/components')['VTimePicker']
|
|
695
695
|
VTimePickerClock: typeof import('vuetify/labs/components')['VTimePickerClock']
|
|
696
696
|
VTimePickerControls: typeof import('vuetify/labs/components')['VTimePickerControls']
|
|
697
697
|
VConfirmEdit: typeof import('vuetify/labs/components')['VConfirmEdit']
|
|
698
698
|
VSnackbarQueue: typeof import('vuetify/labs/components')['VSnackbarQueue']
|
|
699
699
|
VSparkline: typeof import('vuetify/labs/components')['VSparkline']
|
|
700
|
-
VSpeedDial: typeof import('vuetify/labs/components')['VSpeedDial']
|
|
701
700
|
VTreeview: typeof import('vuetify/labs/components')['VTreeview']
|
|
702
701
|
VTreeviewItem: typeof import('vuetify/labs/components')['VTreeviewItem']
|
|
703
702
|
VTreeviewGroup: typeof import('vuetify/labs/components')['VTreeviewGroup']
|
|
703
|
+
VSpeedDial: typeof import('vuetify/labs/components')['VSpeedDial']
|
|
704
704
|
}
|
|
705
705
|
}
|
|
@@ -56,8 +56,7 @@ export const VSpeedDial = genericComponent()({
|
|
|
56
56
|
default: () => [_createVNode(MaybeTransition, {
|
|
57
57
|
"appear": true,
|
|
58
58
|
"group": true,
|
|
59
|
-
"transition": props.transition
|
|
60
|
-
"mode": "out-in"
|
|
59
|
+
"transition": props.transition
|
|
61
60
|
}, {
|
|
62
61
|
default: () => [slots.default?.(slotProps)]
|
|
63
62
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VSpeedDial.mjs","names":["VDefaultsProvider","makeVMenuProps","VMenu","makeComponentProps","MaybeTransition","computed","ref","genericComponent","propsFactory","useRender","makeVSpeedDialProps","offset","minWidth","openDelay","closeDelay","location","transition","VSpeedDial","name","props","setup","_ref","slots","menuRef","y","x","split","locationClasses","value","replace","menuProps","filterProps","_createVNode","_mergeProps","class","style","default","slotProps","VBtn","size"],"sources":["../../../src/labs/VSpeedDial/VSpeedDial.tsx"],"sourcesContent":["// Styles\nimport './VSpeedDial.sass'\n\n// Components\nimport { VDefaultsProvider } from '@/components/VDefaultsProvider'\nimport { makeVMenuProps, VMenu } from '@/components/VMenu/VMenu'\n\n// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { MaybeTransition } from '@/composables/transition'\n\n// Utilities\nimport { computed, ref } from 'vue'\nimport { genericComponent, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { ComputedRef } from 'vue'\nimport type { OverlaySlots } from '@/components/VOverlay/VOverlay'\nimport type { Anchor } from '@/util'\n\nexport const makeVSpeedDialProps = propsFactory({\n ...makeComponentProps(),\n ...makeVMenuProps({\n offset: 8,\n minWidth: 0,\n openDelay: 0,\n closeDelay: 100,\n location: 'top center' as const,\n transition: 'scale-transition',\n }),\n}, 'VSpeedDial')\n\nexport const VSpeedDial = genericComponent<OverlaySlots>()({\n name: 'VSpeedDial',\n\n props: makeVSpeedDialProps(),\n\n setup (props, { slots }) {\n const menuRef = ref<VMenu>()\n\n const location = computed(() => {\n const [y, x = 'center'] = props.location.split(' ')\n\n return `${y} ${x}`\n }) as ComputedRef<Anchor>\n\n const locationClasses = computed(() => ({\n [`v-speed-dial__content--${location.value.replace(' ', '-')}`]: true,\n }))\n\n useRender(() => {\n const menuProps = VMenu.filterProps(props)\n\n return (\n <VMenu\n { ...menuProps }\n class={ props.class }\n style={ props.style }\n contentClass={[\n 'v-speed-dial__content',\n locationClasses.value,\n ]}\n location={ location.value }\n ref={ menuRef }\n transition=\"fade-transition\"\n >\n {{\n ...slots,\n default: slotProps => (\n <VDefaultsProvider\n defaults={{\n VBtn: {\n size: 'small',\n },\n }}\n >\n <MaybeTransition\n appear\n group\n transition={ props.transition }\n
|
|
1
|
+
{"version":3,"file":"VSpeedDial.mjs","names":["VDefaultsProvider","makeVMenuProps","VMenu","makeComponentProps","MaybeTransition","computed","ref","genericComponent","propsFactory","useRender","makeVSpeedDialProps","offset","minWidth","openDelay","closeDelay","location","transition","VSpeedDial","name","props","setup","_ref","slots","menuRef","y","x","split","locationClasses","value","replace","menuProps","filterProps","_createVNode","_mergeProps","class","style","default","slotProps","VBtn","size"],"sources":["../../../src/labs/VSpeedDial/VSpeedDial.tsx"],"sourcesContent":["// Styles\nimport './VSpeedDial.sass'\n\n// Components\nimport { VDefaultsProvider } from '@/components/VDefaultsProvider'\nimport { makeVMenuProps, VMenu } from '@/components/VMenu/VMenu'\n\n// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { MaybeTransition } from '@/composables/transition'\n\n// Utilities\nimport { computed, ref } from 'vue'\nimport { genericComponent, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { ComputedRef } from 'vue'\nimport type { OverlaySlots } from '@/components/VOverlay/VOverlay'\nimport type { Anchor } from '@/util'\n\nexport const makeVSpeedDialProps = propsFactory({\n ...makeComponentProps(),\n ...makeVMenuProps({\n offset: 8,\n minWidth: 0,\n openDelay: 0,\n closeDelay: 100,\n location: 'top center' as const,\n transition: 'scale-transition',\n }),\n}, 'VSpeedDial')\n\nexport const VSpeedDial = genericComponent<OverlaySlots>()({\n name: 'VSpeedDial',\n\n props: makeVSpeedDialProps(),\n\n setup (props, { slots }) {\n const menuRef = ref<VMenu>()\n\n const location = computed(() => {\n const [y, x = 'center'] = props.location.split(' ')\n\n return `${y} ${x}`\n }) as ComputedRef<Anchor>\n\n const locationClasses = computed(() => ({\n [`v-speed-dial__content--${location.value.replace(' ', '-')}`]: true,\n }))\n\n useRender(() => {\n const menuProps = VMenu.filterProps(props)\n\n return (\n <VMenu\n { ...menuProps }\n class={ props.class }\n style={ props.style }\n contentClass={[\n 'v-speed-dial__content',\n locationClasses.value,\n ]}\n location={ location.value }\n ref={ menuRef }\n transition=\"fade-transition\"\n >\n {{\n ...slots,\n default: slotProps => (\n <VDefaultsProvider\n defaults={{\n VBtn: {\n size: 'small',\n },\n }}\n >\n <MaybeTransition\n appear\n group\n transition={ props.transition }\n >\n { slots.default?.(slotProps) }\n </MaybeTransition>\n </VDefaultsProvider>\n ),\n }}\n </VMenu>\n )\n })\n\n return {}\n },\n})\n\nexport type VSpeedDial = InstanceType<typeof VSpeedDial>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,iBAAiB;AAAA,SACjBC,cAAc,EAAEC,KAAK,4CAE9B;AAAA,SACSC,kBAAkB;AAAA,SAClBC,eAAe,4CAExB;AACA,SAASC,QAAQ,EAAEC,GAAG,QAAQ,KAAK;AAAA,SAC1BC,gBAAgB,EAAEC,YAAY,EAAEC,SAAS,gCAElD;AAKA,OAAO,MAAMC,mBAAmB,GAAGF,YAAY,CAAC;EAC9C,GAAGL,kBAAkB,CAAC,CAAC;EACvB,GAAGF,cAAc,CAAC;IAChBU,MAAM,EAAE,CAAC;IACTC,QAAQ,EAAE,CAAC;IACXC,SAAS,EAAE,CAAC;IACZC,UAAU,EAAE,GAAG;IACfC,QAAQ,EAAE,YAAqB;IAC/BC,UAAU,EAAE;EACd,CAAC;AACH,CAAC,EAAE,YAAY,CAAC;AAEhB,OAAO,MAAMC,UAAU,GAAGV,gBAAgB,CAAe,CAAC,CAAC;EACzDW,IAAI,EAAE,YAAY;EAElBC,KAAK,EAAET,mBAAmB,CAAC,CAAC;EAE5BU,KAAKA,CAAED,KAAK,EAAAE,IAAA,EAAa;IAAA,IAAX;MAAEC;IAAM,CAAC,GAAAD,IAAA;IACrB,MAAME,OAAO,GAAGjB,GAAG,CAAQ,CAAC;IAE5B,MAAMS,QAAQ,GAAGV,QAAQ,CAAC,MAAM;MAC9B,MAAM,CAACmB,CAAC,EAAEC,CAAC,GAAG,QAAQ,CAAC,GAAGN,KAAK,CAACJ,QAAQ,CAACW,KAAK,CAAC,GAAG,CAAC;MAEnD,OAAQ,GA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