vuetify 3.1.10 → 3.1.11
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/attributes.json +203 -27
- package/dist/json/importMap.json +98 -98
- package/dist/json/tags.json +46 -2
- package/dist/json/web-types.json +481 -49
- package/dist/vuetify-labs.css +224 -204
- package/dist/vuetify-labs.d.ts +56923 -14294
- package/dist/vuetify-labs.esm.js +121 -129
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +121 -129
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +47 -39
- package/dist/vuetify.d.ts +55374 -15927
- package/dist/vuetify.esm.js +118 -129
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +118 -129
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +640 -642
- package/dist/vuetify.min.js.map +1 -1
- package/lib/blueprints/index.d.ts +6 -9
- package/lib/blueprints/md1.d.ts +6 -9
- package/lib/blueprints/md2.d.ts +6 -9
- package/lib/blueprints/md3.d.ts +6 -9
- package/lib/blueprints/md3.mjs +6 -0
- package/lib/blueprints/md3.mjs.map +1 -1
- package/lib/components/VAlert/index.d.ts +509 -83
- package/lib/components/VApp/VApp.css +1 -0
- package/lib/components/VApp/VApp.sass +1 -0
- package/lib/components/VApp/index.d.ts +158 -20
- package/lib/components/VAppBar/VAppBar.mjs +2 -2
- package/lib/components/VAppBar/VAppBar.mjs.map +1 -1
- package/lib/components/VAppBar/index.d.ts +616 -110
- package/lib/components/VAutocomplete/VAutocomplete.mjs +2 -2
- package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
- package/lib/components/VAutocomplete/index.d.ts +1656 -130
- package/lib/components/VAvatar/index.d.ts +205 -29
- package/lib/components/VBadge/index.d.ts +284 -42
- package/lib/components/VBanner/index.d.ts +478 -84
- package/lib/components/VBottomNavigation/index.d.ts +321 -40
- package/lib/components/VBreadcrumbs/index.d.ts +325 -45
- package/lib/components/VBtn/VBtn.css +0 -5
- package/lib/components/VBtn/VBtn.mjs +40 -39
- package/lib/components/VBtn/VBtn.mjs.map +1 -1
- package/lib/components/VBtn/VBtn.sass +0 -7
- package/lib/components/VBtn/_variables.scss +0 -2
- package/lib/components/VBtn/index.d.ts +452 -69
- package/lib/components/VBtnGroup/VBtnGroup.mjs +1 -7
- package/lib/components/VBtnGroup/VBtnGroup.mjs.map +1 -1
- package/lib/components/VBtnGroup/index.d.ts +185 -26
- package/lib/components/VBtnToggle/VBtnToggle.mjs +2 -2
- package/lib/components/VBtnToggle/VBtnToggle.mjs.map +1 -1
- package/lib/components/VBtnToggle/index.d.ts +245 -35
- package/lib/components/VCard/index.d.ts +938 -172
- package/lib/components/VCarousel/index.d.ts +561 -123
- package/lib/components/VCheckbox/VCheckbox.mjs +2 -2
- package/lib/components/VCheckbox/VCheckbox.mjs.map +1 -1
- package/lib/components/VCheckbox/VCheckboxBtn.mjs +1 -4
- package/lib/components/VCheckbox/VCheckboxBtn.mjs.map +1 -1
- package/lib/components/VCheckbox/index.d.ts +831 -147
- package/lib/components/VChip/index.d.ts +473 -75
- package/lib/components/VChipGroup/index.d.ts +227 -32
- package/lib/components/VCode/index.d.ts +109 -16
- package/lib/components/VColorPicker/index.d.ts +284 -20
- package/lib/components/VCombobox/VCombobox.mjs +2 -2
- package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
- package/lib/components/VCombobox/index.d.ts +1668 -130
- package/lib/components/VCounter/index.d.ts +1894 -87
- package/lib/components/VDefaultsProvider/index.d.ts +131 -22
- package/lib/components/VDialog/VDialog.css +31 -24
- package/lib/components/VDialog/VDialog.mjs +2 -2
- package/lib/components/VDialog/VDialog.mjs.map +1 -1
- package/lib/components/VDialog/VDialog.sass +19 -12
- package/lib/components/VDialog/index.d.ts +2362 -146
- package/lib/components/VDivider/index.d.ts +130 -23
- package/lib/components/VExpansionPanel/index.d.ts +719 -119
- package/lib/components/VField/index.d.ts +163 -21
- package/lib/components/VFileInput/index.d.ts +1038 -104
- package/lib/components/VFooter/index.d.ts +203 -28
- package/lib/components/VForm/index.d.ts +204 -23
- package/lib/components/VGrid/VCol.mjs +6 -5
- package/lib/components/VGrid/VCol.mjs.map +1 -1
- package/lib/components/VGrid/VRow.mjs +4 -4
- package/lib/components/VGrid/VRow.mjs.map +1 -1
- package/lib/components/VGrid/index.d.ts +733 -76
- package/lib/components/VHover/index.d.ts +182 -35
- package/lib/components/VIcon/index.d.ts +494 -50
- package/lib/components/VImg/index.d.ts +275 -46
- package/lib/components/VInput/index.d.ts +315 -53
- package/lib/components/VItemGroup/index.d.ts +308 -52
- package/lib/components/VKbd/VKbd.css +1 -0
- package/lib/components/VKbd/VKbd.sass +1 -0
- package/lib/components/VKbd/_variables.scss +1 -0
- package/lib/components/VKbd/index.d.ts +109 -16
- package/lib/components/VLabel/index.d.ts +113 -20
- package/lib/components/VLayout/index.d.ts +296 -41
- package/lib/components/VLazy/VLazy.mjs +4 -1
- package/lib/components/VLazy/VLazy.mjs.map +1 -1
- package/lib/components/VLazy/index.d.ts +219 -30
- package/lib/components/VList/VListChildren.mjs +2 -2
- package/lib/components/VList/VListChildren.mjs.map +1 -1
- package/lib/components/VList/VListGroup.mjs +1 -4
- package/lib/components/VList/VListGroup.mjs.map +1 -1
- package/lib/components/VList/index.d.ts +1461 -223
- package/lib/components/VLocaleProvider/index.d.ts +121 -20
- package/lib/components/VMain/index.d.ts +118 -17
- package/lib/components/VMenu/VMenu.css +4 -4
- package/lib/components/VMenu/VMenu.mjs +2 -2
- package/lib/components/VMenu/VMenu.mjs.map +1 -1
- package/lib/components/VMenu/VMenu.sass +1 -1
- package/lib/components/VMenu/index.d.ts +2368 -142
- package/lib/components/VMessages/index.d.ts +1921 -98
- package/lib/components/VNavigationDrawer/index.d.ts +379 -56
- package/lib/components/VOverlay/VOverlay.css +2 -2
- package/lib/components/VOverlay/VOverlay.mjs +1 -4
- package/lib/components/VOverlay/VOverlay.mjs.map +1 -1
- package/lib/components/VOverlay/VOverlay.sass +1 -1
- package/lib/components/VOverlay/_variables.scss +1 -1
- package/lib/components/VOverlay/index.d.ts +519 -85
- package/lib/components/VPagination/index.d.ts +502 -68
- package/lib/components/VParallax/VParallax.mjs +3 -3
- package/lib/components/VParallax/VParallax.mjs.map +1 -1
- package/lib/components/VParallax/index.d.ts +141 -28
- package/lib/components/VProgressCircular/index.d.ts +186 -25
- package/lib/components/VProgressLinear/index.d.ts +319 -48
- package/lib/components/VRadio/index.d.ts +313 -57
- package/lib/components/VRadioGroup/VRadioGroup.mjs +4 -6
- package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
- package/lib/components/VRadioGroup/index.d.ts +463 -83
- package/lib/components/VRangeSlider/index.d.ts +528 -80
- package/lib/components/VRating/index.d.ts +305 -43
- package/lib/components/VResponsive/index.d.ts +142 -27
- package/lib/components/VSelect/VSelect.mjs +2 -2
- package/lib/components/VSelect/VSelect.mjs.map +1 -1
- package/lib/components/VSelect/index.d.ts +3060 -328
- package/lib/components/VSelectionControl/VSelectionControl.mjs +1 -4
- package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
- package/lib/components/VSelectionControl/index.d.ts +76 -4
- package/lib/components/VSelectionControlGroup/index.d.ts +242 -38
- package/lib/components/VSheet/VSheet.mjs +1 -7
- package/lib/components/VSheet/VSheet.mjs.map +1 -1
- package/lib/components/VSheet/index.d.ts +194 -31
- package/lib/components/VSlideGroup/index.d.ts +475 -83
- package/lib/components/VSlider/index.d.ts +521 -79
- package/lib/components/VSlider/slider.mjs +2 -5
- package/lib/components/VSlider/slider.mjs.map +1 -1
- package/lib/components/VSnackbar/VSnackbar.mjs +2 -2
- package/lib/components/VSnackbar/VSnackbar.mjs.map +1 -1
- package/lib/components/VSnackbar/index.d.ts +1219 -81
- package/lib/components/VSwitch/VSwitch.mjs +2 -2
- package/lib/components/VSwitch/VSwitch.mjs.map +1 -1
- package/lib/components/VSwitch/index.d.ts +498 -92
- package/lib/components/VSystemBar/index.d.ts +184 -27
- package/lib/components/VTable/index.d.ts +190 -35
- package/lib/components/VTabs/VTab.mjs +7 -23
- package/lib/components/VTabs/VTab.mjs.map +1 -1
- package/lib/components/VTabs/index.d.ts +623 -71
- package/lib/components/VTextField/VTextField.mjs +8 -5
- package/lib/components/VTextField/VTextField.mjs.map +1 -1
- package/lib/components/VTextField/index.d.ts +1404 -106
- package/lib/components/VTextarea/VTextarea.mjs +7 -1
- package/lib/components/VTextarea/VTextarea.mjs.map +1 -1
- package/lib/components/VTextarea/index.d.ts +1014 -102
- package/lib/components/VThemeProvider/index.d.ts +124 -19
- package/lib/components/VTimeline/index.d.ts +441 -71
- package/lib/components/VToolbar/VToolbar.mjs +1 -4
- package/lib/components/VToolbar/VToolbar.mjs.map +1 -1
- package/lib/components/VToolbar/index.d.ts +542 -93
- package/lib/components/VTooltip/VTooltip.css +3 -3
- package/lib/components/VTooltip/VTooltip.mjs +2 -2
- package/lib/components/VTooltip/VTooltip.mjs.map +1 -1
- package/lib/components/VTooltip/VTooltip.sass +1 -1
- package/lib/components/VTooltip/index.d.ts +1263 -81
- package/lib/components/VValidation/index.d.ts +201 -30
- package/lib/components/VWindow/index.d.ts +527 -95
- package/lib/components/index.d.ts +55131 -15681
- package/lib/components/transitions/index.d.ts +2097 -308
- package/lib/composables/display.mjs +2 -0
- package/lib/composables/display.mjs.map +1 -1
- package/lib/composables/form.mjs.map +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/index.d.ts +32 -35
- package/lib/labs/VDataTable/VDataTable.css +12 -0
- package/lib/labs/VDataTable/VDataTable.sass +6 -0
- package/lib/labs/VDataTable/VDataTableRow.mjs +2 -0
- package/lib/labs/VDataTable/VDataTableRow.mjs.map +1 -1
- package/lib/labs/VDataTable/VDataTableRows.mjs +1 -0
- package/lib/labs/VDataTable/VDataTableRows.mjs.map +1 -1
- package/lib/labs/VDataTable/index.d.ts +4176 -1016
- package/lib/labs/VVirtualScroll/index.d.ts +32 -1
- package/lib/labs/components.d.ts +4212 -1026
- package/lib/styles/main.css +4 -0
- package/lib/styles/settings/_utilities.scss +7 -0
- package/lib/util/animation.mjs +8 -1
- package/lib/util/animation.mjs.map +1 -1
- package/lib/util/defineComponent.mjs +12 -5
- package/lib/util/defineComponent.mjs.map +1 -1
- package/lib/util/helpers.mjs +4 -0
- package/lib/util/helpers.mjs.map +1 -1
- package/package.json +3 -2
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
import { inject, reactive, ref, shallowRef, toRefs, watchEffect } from 'vue';
|
|
3
3
|
import { mergeDeep } from "../util/index.mjs"; // Globals
|
|
4
4
|
import { IN_BROWSER, SUPPORTS_TOUCH } from "../util/globals.mjs"; // Types
|
|
5
|
+
export const breakpoints = ['sm', 'md', 'lg', 'xl', 'xxl']; // no xs
|
|
6
|
+
|
|
5
7
|
export const DisplaySymbol = Symbol.for('vuetify:display');
|
|
6
8
|
const defaultDisplayOptions = {
|
|
7
9
|
mobileBreakpoint: 'lg',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display.mjs","names":["inject","reactive","ref","shallowRef","toRefs","watchEffect","mergeDeep","IN_BROWSER","SUPPORTS_TOUCH","DisplaySymbol","Symbol","for","defaultDisplayOptions","mobileBreakpoint","thresholds","xs","sm","md","lg","xl","xxl","parseDisplayOptions","options","getClientWidth","isHydrate","window","innerWidth","getClientHeight","innerHeight","getPlatform","userAgent","navigator","match","regexp","Boolean","android","ios","cordova","electron","chrome","edge","firefox","opera","win","mac","linux","touch","ssr","createDisplay","height","platform","state","width","updateSize","value","update","name","breakpointValue","mobile","smAndUp","mdAndUp","lgAndUp","xlAndUp","smAndDown","mdAndDown","lgAndDown","xlAndDown","addEventListener","passive","useDisplay","display","Error"],"sources":["../../src/composables/display.ts"],"sourcesContent":["// Utilities\nimport { inject, reactive, ref, shallowRef, toRefs, watchEffect } from 'vue'\nimport { mergeDeep } from '@/util'\n\n// Globals\nimport { IN_BROWSER, SUPPORTS_TOUCH } from '@/util/globals'\n\n// Types\nimport type { InjectionKey, Ref } from 'vue'\n\nexport type DisplayBreakpoint = keyof DisplayThresholds\n\nexport interface DisplayThresholds {\n xs: number\n sm: number\n md: number\n lg: number\n xl: number\n xxl: number\n}\n\nexport interface DisplayOptions {\n mobileBreakpoint?: number | DisplayBreakpoint\n thresholds?: Partial<DisplayThresholds>\n}\n\nexport interface InternalDisplayOptions {\n mobileBreakpoint: number | DisplayBreakpoint\n thresholds: DisplayThresholds\n}\n\nexport interface DisplayPlatform {\n android: boolean\n ios: boolean\n cordova: boolean\n electron: boolean\n chrome: boolean\n edge: boolean\n firefox: boolean\n opera: boolean\n win: boolean\n mac: boolean\n linux: boolean\n touch: boolean\n ssr: boolean\n}\n\nexport interface DisplayInstance {\n xs: Ref<boolean>\n sm: Ref<boolean>\n md: Ref<boolean>\n lg: Ref<boolean>\n xl: Ref<boolean>\n xxl: Ref<boolean>\n smAndUp: Ref<boolean>\n mdAndUp: Ref<boolean>\n lgAndUp: Ref<boolean>\n xlAndUp: Ref<boolean>\n smAndDown: Ref<boolean>\n mdAndDown: Ref<boolean>\n lgAndDown: Ref<boolean>\n xlAndDown: Ref<boolean>\n name: Ref<DisplayBreakpoint>\n height: Ref<number>\n width: Ref<number>\n mobile: Ref<boolean>\n mobileBreakpoint: Ref<number | DisplayBreakpoint>\n platform: Ref<DisplayPlatform>\n thresholds: Ref<DisplayThresholds>\n\n /** @internal */\n ssr: boolean\n\n update (): void\n}\n\nexport const DisplaySymbol: InjectionKey<DisplayInstance> = Symbol.for('vuetify:display')\n\nconst defaultDisplayOptions: DisplayOptions = {\n mobileBreakpoint: 'lg',\n thresholds: {\n xs: 0,\n sm: 600,\n md: 960,\n lg: 1280,\n xl: 1920,\n xxl: 2560,\n },\n}\n\nconst parseDisplayOptions = (options: DisplayOptions = defaultDisplayOptions) => {\n return mergeDeep(defaultDisplayOptions, options) as InternalDisplayOptions\n}\n\nfunction getClientWidth (isHydrate?: boolean) {\n return IN_BROWSER && !isHydrate\n ? window.innerWidth\n : 0\n}\n\nfunction getClientHeight (isHydrate?: boolean) {\n return IN_BROWSER && !isHydrate\n ? window.innerHeight\n : 0\n}\n\nfunction getPlatform (isHydrate?: boolean): DisplayPlatform {\n const userAgent = IN_BROWSER && !isHydrate\n ? window.navigator.userAgent\n : 'ssr'\n\n function match (regexp: RegExp) {\n return Boolean(userAgent.match(regexp))\n }\n\n const android = match(/android/i)\n const ios = match(/iphone|ipad|ipod/i)\n const cordova = match(/cordova/i)\n const electron = match(/electron/i)\n const chrome = match(/chrome/i)\n const edge = match(/edge/i)\n const firefox = match(/firefox/i)\n const opera = match(/opera/i)\n const win = match(/win/i)\n const mac = match(/mac/i)\n const linux = match(/linux/i)\n\n return {\n android,\n ios,\n cordova,\n electron,\n chrome,\n edge,\n firefox,\n opera,\n win,\n mac,\n linux,\n touch: SUPPORTS_TOUCH,\n ssr: userAgent === 'ssr',\n }\n}\n\nexport function createDisplay (options?: DisplayOptions, ssr?: boolean): DisplayInstance {\n const { thresholds, mobileBreakpoint } = parseDisplayOptions(options)\n\n const height = ref(getClientHeight(ssr))\n const platform = shallowRef(getPlatform(ssr))\n const state = reactive({} as DisplayInstance)\n const width = ref(getClientWidth(ssr))\n\n function updateSize () {\n height.value = getClientHeight()\n width.value = getClientWidth()\n }\n function update () {\n updateSize()\n platform.value = getPlatform()\n }\n\n // eslint-disable-next-line max-statements\n watchEffect(() => {\n const xs = width.value < thresholds.sm\n const sm = width.value < thresholds.md && !xs\n const md = width.value < thresholds.lg && !(sm || xs)\n const lg = width.value < thresholds.xl && !(md || sm || xs)\n const xl = width.value < thresholds.xxl && !(lg || md || sm || xs)\n const xxl = width.value >= thresholds.xxl\n const name =\n xs ? 'xs'\n : sm ? 'sm'\n : md ? 'md'\n : lg ? 'lg'\n : xl ? 'xl'\n : 'xxl'\n const breakpointValue = typeof mobileBreakpoint === 'number' ? mobileBreakpoint : thresholds[mobileBreakpoint]\n const mobile = width.value < breakpointValue\n\n state.xs = xs\n state.sm = sm\n state.md = md\n state.lg = lg\n state.xl = xl\n state.xxl = xxl\n state.smAndUp = !xs\n state.mdAndUp = !(xs || sm)\n state.lgAndUp = !(xs || sm || md)\n state.xlAndUp = !(xs || sm || md || lg)\n state.smAndDown = !(md || lg || xl || xxl)\n state.mdAndDown = !(lg || xl || xxl)\n state.lgAndDown = !(xl || xxl)\n state.xlAndDown = !xxl\n state.name = name\n state.height = height.value\n state.width = width.value\n state.mobile = mobile\n state.mobileBreakpoint = mobileBreakpoint\n state.platform = platform.value\n state.thresholds = thresholds\n })\n\n if (IN_BROWSER) {\n window.addEventListener('resize', updateSize, { passive: true })\n }\n\n return { ...toRefs(state), update, ssr: !!ssr }\n}\n\nexport function useDisplay () {\n const display = inject(DisplaySymbol)\n\n if (!display) throw new Error('Could not find Vuetify display injection')\n\n return display\n}\n"],"mappings":"AAAA;AACA,SAASA,MAAM,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,UAAU,EAAEC,MAAM,EAAEC,WAAW,QAAQ,KAAK;AAAA,SACnEC,SAAS,6BAElB;AAAA,SACSC,UAAU,EAAEC,cAAc,+BAEnC;AAqEA,OAAO,MAAMC,aAA4C,GAAGC,MAAM,CAACC,GAAG,CAAC,iBAAiB,CAAC;AAEzF,MAAMC,qBAAqC,GAAG;EAC5CC,gBAAgB,EAAE,IAAI;EACtBC,UAAU,EAAE;IACVC,EAAE,EAAE,CAAC;IACLC,EAAE,EAAE,GAAG;IACPC,EAAE,EAAE,GAAG;IACPC,EAAE,EAAE,IAAI;IACRC,EAAE,EAAE,IAAI;IACRC,GAAG,EAAE;EACP;AACF,CAAC;AAED,MAAMC,mBAAmB,GAAG,YAAqD;EAAA,IAApDC,OAAuB,uEAAGV,qBAAqB;EAC1E,OAAON,SAAS,CAACM,qBAAqB,EAAEU,OAAO,CAAC;AAClD,CAAC;AAED,SAASC,cAAc,CAAEC,SAAmB,EAAE;EAC5C,OAAOjB,UAA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AAK,CAACF,MAAM,GAAGA,MAAM,CAACK,KAAK;IAC3BH,KAAK,CAACC,KAAK,GAAGA,KAAK,CAACE,KAAK;IACzBH,KAAK,CAACO,MAAM,GAAGA,MAAM;IACrBP,KAAK,CAACtC,gBAAgB,GAAGA,gBAAgB;IACzCsC,KAAK,CAACD,QAAQ,GAAGA,QAAQ,CAACI,KAAK;IAC/BH,KAAK,CAACrC,UAAU,GAAGA,UAAU;EAC/B,CAAC,CAAC;EAEF,IAAIP,UAAU,EAAE;IACdkB,MAAM,CAAC0C,gBAAgB,CAAC,QAAQ,EAAEd,UAAU,EAAE;MAAEe,OAAO,EAAE;IAAK,CAAC,CAAC;EAClE;EAEA,OAAO;IAAE,GAAGhE,MAAM,CAAC+C,KAAK,CAAC;IAAEI,MAAM;IAAER,GAAG,EAAE,CAAC,CAACA;EAAI,CAAC;AACjD;AAEA,OAAO,SAASsB,UAAU,GAAI;EAC5B,MAAMC,OAAO,GAAGtE,MAAM,CAACS,aAAa,CAAC;EAErC,IAAI,CAAC6D,OAAO,EAAE,MAAM,IAAIC,KAAK,CAAC,0CAA0C,CAAC;EAEzE,OAAOD,OAAO;AAChB"}
|
|
1
|
+
{"version":3,"file":"display.mjs","names":["inject","reactive","ref","shallowRef","toRefs","watchEffect","mergeDeep","IN_BROWSER","SUPPORTS_TOUCH","breakpoints","DisplaySymbol","Symbol","for","defaultDisplayOptions","mobileBreakpoint","thresholds","xs","sm","md","lg","xl","xxl","parseDisplayOptions","options","getClientWidth","isHydrate","window","innerWidth","getClientHeight","innerHeight","getPlatform","userAgent","navigator","match","regexp","Boolean","android","ios","cordova","electron","chrome","edge","firefox","opera","win","mac","linux","touch","ssr","createDisplay","height","platform","state","width","updateSize","value","update","name","breakpointValue","mobile","smAndUp","mdAndUp","lgAndUp","xlAndUp","smAndDown","mdAndDown","lgAndDown","xlAndDown","addEventListener","passive","useDisplay","display","Error"],"sources":["../../src/composables/display.ts"],"sourcesContent":["// Utilities\nimport { inject, reactive, ref, shallowRef, toRefs, watchEffect } from 'vue'\nimport { mergeDeep } from '@/util'\n\n// Globals\nimport { IN_BROWSER, SUPPORTS_TOUCH } from '@/util/globals'\n\n// Types\nimport type { InjectionKey, Ref } from 'vue'\n\nexport const breakpoints = ['sm', 'md', 'lg', 'xl', 'xxl'] as const // no xs\n\nexport type Breakpoint = typeof breakpoints[number]\n\nexport type DisplayBreakpoint = 'xs' | Breakpoint\n\nexport type DisplayThresholds = {\n [key in DisplayBreakpoint]: number\n}\n\nexport interface DisplayOptions {\n mobileBreakpoint?: number | DisplayBreakpoint\n thresholds?: Partial<DisplayThresholds>\n}\n\nexport interface InternalDisplayOptions {\n mobileBreakpoint: number | DisplayBreakpoint\n thresholds: DisplayThresholds\n}\n\nexport interface DisplayPlatform {\n android: boolean\n ios: boolean\n cordova: boolean\n electron: boolean\n chrome: boolean\n edge: boolean\n firefox: boolean\n opera: boolean\n win: boolean\n mac: boolean\n linux: boolean\n touch: boolean\n ssr: boolean\n}\n\nexport interface DisplayInstance {\n xs: Ref<boolean>\n sm: Ref<boolean>\n md: Ref<boolean>\n lg: Ref<boolean>\n xl: Ref<boolean>\n xxl: Ref<boolean>\n smAndUp: Ref<boolean>\n mdAndUp: Ref<boolean>\n lgAndUp: Ref<boolean>\n xlAndUp: Ref<boolean>\n smAndDown: Ref<boolean>\n mdAndDown: Ref<boolean>\n lgAndDown: Ref<boolean>\n xlAndDown: Ref<boolean>\n name: Ref<DisplayBreakpoint>\n height: Ref<number>\n width: Ref<number>\n mobile: Ref<boolean>\n mobileBreakpoint: Ref<number | DisplayBreakpoint>\n platform: Ref<DisplayPlatform>\n thresholds: Ref<DisplayThresholds>\n\n /** @internal */\n ssr: boolean\n\n update (): void\n}\n\nexport const DisplaySymbol: InjectionKey<DisplayInstance> = Symbol.for('vuetify:display')\n\nconst defaultDisplayOptions: DisplayOptions = {\n mobileBreakpoint: 'lg',\n thresholds: {\n xs: 0,\n sm: 600,\n md: 960,\n lg: 1280,\n xl: 1920,\n xxl: 2560,\n },\n}\n\nconst parseDisplayOptions = (options: DisplayOptions = defaultDisplayOptions) => {\n return mergeDeep(defaultDisplayOptions, options) as InternalDisplayOptions\n}\n\nfunction getClientWidth (isHydrate?: boolean) {\n return IN_BROWSER && !isHydrate\n ? window.innerWidth\n : 0\n}\n\nfunction getClientHeight (isHydrate?: boolean) {\n return IN_BROWSER && !isHydrate\n ? window.innerHeight\n : 0\n}\n\nfunction getPlatform (isHydrate?: boolean): DisplayPlatform {\n const userAgent = IN_BROWSER && !isHydrate\n ? window.navigator.userAgent\n : 'ssr'\n\n function match (regexp: RegExp) {\n return Boolean(userAgent.match(regexp))\n }\n\n const android = match(/android/i)\n const ios = match(/iphone|ipad|ipod/i)\n const cordova = match(/cordova/i)\n const electron = match(/electron/i)\n const chrome = match(/chrome/i)\n const edge = match(/edge/i)\n const firefox = match(/firefox/i)\n const opera = match(/opera/i)\n const win = match(/win/i)\n const mac = match(/mac/i)\n const linux = match(/linux/i)\n\n return {\n android,\n ios,\n cordova,\n electron,\n chrome,\n edge,\n firefox,\n opera,\n win,\n mac,\n linux,\n touch: SUPPORTS_TOUCH,\n ssr: userAgent === 'ssr',\n }\n}\n\nexport function createDisplay (options?: DisplayOptions, ssr?: boolean): DisplayInstance {\n const { thresholds, mobileBreakpoint } = parseDisplayOptions(options)\n\n const height = ref(getClientHeight(ssr))\n const platform = shallowRef(getPlatform(ssr))\n const state = reactive({} as DisplayInstance)\n const width = ref(getClientWidth(ssr))\n\n function updateSize () {\n height.value = getClientHeight()\n width.value = getClientWidth()\n }\n function update () {\n updateSize()\n platform.value = getPlatform()\n }\n\n // eslint-disable-next-line max-statements\n watchEffect(() => {\n const xs = width.value < thresholds.sm\n const sm = width.value < thresholds.md && !xs\n const md = width.value < thresholds.lg && !(sm || xs)\n const lg = width.value < thresholds.xl && !(md || sm || xs)\n const xl = width.value < thresholds.xxl && !(lg || md || sm || xs)\n const xxl = width.value >= thresholds.xxl\n const name =\n xs ? 'xs'\n : sm ? 'sm'\n : md ? 'md'\n : lg ? 'lg'\n : xl ? 'xl'\n : 'xxl'\n const breakpointValue = typeof mobileBreakpoint === 'number' ? mobileBreakpoint : thresholds[mobileBreakpoint]\n const mobile = width.value < breakpointValue\n\n state.xs = xs\n state.sm = sm\n state.md = md\n state.lg = lg\n state.xl = xl\n state.xxl = xxl\n state.smAndUp = !xs\n state.mdAndUp = !(xs || sm)\n state.lgAndUp = !(xs || sm || md)\n state.xlAndUp = !(xs || sm || md || lg)\n state.smAndDown = !(md || lg || xl || xxl)\n state.mdAndDown = !(lg || xl || xxl)\n state.lgAndDown = !(xl || xxl)\n state.xlAndDown = !xxl\n state.name = name\n state.height = height.value\n state.width = width.value\n state.mobile = mobile\n state.mobileBreakpoint = mobileBreakpoint\n state.platform = platform.value\n state.thresholds = thresholds\n })\n\n if (IN_BROWSER) {\n window.addEventListener('resize', updateSize, { passive: true })\n }\n\n return { ...toRefs(state), update, ssr: !!ssr }\n}\n\nexport function useDisplay () {\n const display = inject(DisplaySymbol)\n\n if (!display) throw new Error('Could not find Vuetify display injection')\n\n return display\n}\n"],"mappings":"AAAA;AACA,SAASA,MAAM,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,UAAU,EAAEC,MAAM,EAAEC,WAAW,QAAQ,KAAK;AAAA,SACnEC,SAAS,6BAElB;AAAA,SACSC,UAAU,EAAEC,cAAc,+BAEnC;AAGA,OAAO,MAAMC,WAAW,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAU,EAAC;;AAiEpE,OAAO,MAAMC,aAA4C,GAAGC,MAAM,CAACC,GAAG,CAAC,iBAAiB,CAAC;AAEzF,MAAMC,qBAAqC,GAAG;EAC5CC,gBAAgB,EAAE,IAAI;EACtBC,UAAU,EAAE;IACVC,EAAE,EAAE,CAAC;IACLC,EAAE,EAAE,GAAG;IACPC,EAAE,EAAE,GAAG;IACPC,EAAE,EAAE,IAAI;IACRC,EAAE,EAAE,IAAI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K,CAACa,SAAS,GAAG,EAAE9C,EAAE,IAAIC,EAAE,IAAIC,GAAG,CAAC;IACpC+B,KAAK,CAACc,SAAS,GAAG,EAAE9C,EAAE,IAAIC,GAAG,CAAC;IAC9B+B,KAAK,CAACe,SAAS,GAAG,CAAC9C,GAAG;IACtB+B,KAAK,CAACK,IAAI,GAAGA,IAAI;IACjBL,KAAK,CAACF,MAAM,GAAGA,MAAM,CAACK,KAAK;IAC3BH,KAAK,CAACC,KAAK,GAAGA,KAAK,CAACE,KAAK;IACzBH,KAAK,CAACO,MAAM,GAAGA,MAAM;IACrBP,KAAK,CAACtC,gBAAgB,GAAGA,gBAAgB;IACzCsC,KAAK,CAACD,QAAQ,GAAGA,QAAQ,CAACI,KAAK;IAC/BH,KAAK,CAACrC,UAAU,GAAGA,UAAU;EAC/B,CAAC,CAAC;EAEF,IAAIR,UAAU,EAAE;IACdmB,MAAM,CAAC0C,gBAAgB,CAAC,QAAQ,EAAEd,UAAU,EAAE;MAAEe,OAAO,EAAE;IAAK,CAAC,CAAC;EAClE;EAEA,OAAO;IAAE,GAAGjE,MAAM,CAACgD,KAAK,CAAC;IAAEI,MAAM;IAAER,GAAG,EAAE,CAAC,CAACA;EAAI,CAAC;AACjD;AAEA,OAAO,SAASsB,UAAU,GAAI;EAC5B,MAAMC,OAAO,GAAGvE,MAAM,CAACU,aAAa,CAAC;EAErC,IAAI,CAAC6D,OAAO,EAAE,MAAM,IAAIC,KAAK,CAAC,0CAA0C,CAAC;EAEzE,OAAOD,OAAO;AAChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.mjs","names":["computed","inject","provide","ref","toRef","watch","useProxiedModel","consoleWarn","propsFactory","FormKey","Symbol","for","makeFormProps","disabled","Boolean","fastFail","readonly","modelValue","type","default","validateOn","String","createForm","props","model","isDisabled","isReadonly","isValidating","items","errors","validate","results","valid","value","item","itemErrorMessages","length","push","id","errorMessages","reset","forEach","resetValidation","invalid","isValid","deep","register","some","unregister","filter","update","found","find","useForm"],"sources":["../../src/composables/form.ts"],"sourcesContent":["// Utilities\nimport { computed, inject, provide, ref, toRef, watch } from 'vue'\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { consoleWarn, propsFactory } from '@/util'\n\n// Types\nimport type { ComputedRef, InjectionKey, PropType, Ref } from 'vue'\nimport type { ValidationProps } from './validation'\n\nexport interface FormProvide {\n register: (item: {\n id: number | string\n validate: () => Promise<string[]>\n reset: () => void\n resetValidation: () => void\n }) => void\n unregister: (id: number | string) => void\n update: (id: number | string, isValid: boolean | null, errorMessages: string[]) => void\n items: Ref<FormField[]>\n isDisabled: ComputedRef<boolean>\n isReadonly: ComputedRef<boolean>\n isValidating: Ref<boolean>\n validateOn: Ref<FormProps['validateOn']>\n}\n\
|
|
1
|
+
{"version":3,"file":"form.mjs","names":["computed","inject","provide","ref","toRef","watch","useProxiedModel","consoleWarn","propsFactory","FormKey","Symbol","for","makeFormProps","disabled","Boolean","fastFail","readonly","modelValue","type","default","validateOn","String","createForm","props","model","isDisabled","isReadonly","isValidating","items","errors","validate","results","valid","value","item","itemErrorMessages","length","push","id","errorMessages","reset","forEach","resetValidation","invalid","isValid","deep","register","some","unregister","filter","update","found","find","useForm"],"sources":["../../src/composables/form.ts"],"sourcesContent":["// Utilities\nimport { computed, inject, provide, ref, toRef, watch } from 'vue'\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { consoleWarn, propsFactory } from '@/util'\n\n// Types\nimport type { ComputedRef, InjectionKey, PropType, Ref } from 'vue'\nimport type { ValidationProps } from './validation'\n\nexport interface FormProvide {\n register: (item: {\n id: number | string\n validate: () => Promise<string[]>\n reset: () => void\n resetValidation: () => void\n }) => void\n unregister: (id: number | string) => void\n update: (id: number | string, isValid: boolean | null, errorMessages: string[]) => void\n items: Ref<FormField[]>\n isDisabled: ComputedRef<boolean>\n isReadonly: ComputedRef<boolean>\n isValidating: Ref<boolean>\n validateOn: Ref<FormProps['validateOn']>\n}\n\nexport interface FormField {\n id: number | string\n validate: () => Promise<string[]>\n reset: () => void\n resetValidation: () => void\n isValid: boolean | null\n errorMessages: string[]\n}\n\nexport interface FieldValidationResult {\n id: number | string\n errorMessages: string[]\n}\n\nexport interface FormValidationResult {\n valid: boolean\n errors: FieldValidationResult[]\n}\n\nexport interface SubmitEventPromise extends SubmitEvent, Promise<FormValidationResult> {}\n\nexport const FormKey: InjectionKey<FormProvide> = Symbol.for('vuetify:form')\n\nexport interface FormProps {\n disabled: boolean\n fastFail: boolean\n readonly: boolean\n modelValue: boolean | null\n 'onUpdate:modelValue': ((val: boolean | null) => void) | undefined\n validateOn: ValidationProps['validateOn']\n}\n\nexport const makeFormProps = propsFactory({\n disabled: Boolean,\n fastFail: Boolean,\n readonly: Boolean,\n modelValue: {\n type: Boolean as PropType<boolean | null>,\n default: null,\n },\n validateOn: {\n type: String as PropType<FormProps['validateOn']>,\n default: 'input',\n },\n}, 'form')\n\nexport function createForm (props: FormProps) {\n const model = useProxiedModel(props, 'modelValue')\n\n const isDisabled = computed(() => props.disabled)\n const isReadonly = computed(() => props.readonly)\n const isValidating = ref(false)\n const items = ref<FormField[]>([])\n const errors = ref<FieldValidationResult[]>([])\n\n async function validate () {\n const results = []\n let valid = true\n\n errors.value = []\n isValidating.value = true\n\n for (const item of items.value) {\n const itemErrorMessages = await item.validate()\n\n if (itemErrorMessages.length > 0) {\n valid = false\n\n results.push({\n id: item.id,\n errorMessages: itemErrorMessages,\n })\n }\n\n if (!valid && props.fastFail) break\n }\n\n errors.value = results\n isValidating.value = false\n\n return { valid, errors: errors.value }\n }\n\n function reset () {\n items.value.forEach(item => item.reset())\n model.value = null\n }\n\n function resetValidation () {\n items.value.forEach(item => item.resetValidation())\n errors.value = []\n model.value = null\n }\n\n watch(items, () => {\n let valid = 0\n let invalid = 0\n const results = []\n\n for (const item of items.value) {\n if (item.isValid === false) {\n invalid++\n results.push({\n id: item.id,\n errorMessages: item.errorMessages,\n })\n } else if (item.isValid === true) valid++\n }\n\n errors.value = results\n model.value =\n invalid > 0 ? false\n : valid === items.value.length ? true\n : null\n }, { deep: true })\n\n provide(FormKey, {\n register: ({ id, validate, reset, resetValidation }) => {\n if (items.value.some(item => item.id === id)) {\n consoleWarn(`Duplicate input name \"${id}\"`)\n }\n\n items.value.push({\n id,\n validate,\n reset,\n resetValidation,\n isValid: null,\n errorMessages: [],\n })\n },\n unregister: id => {\n items.value = items.value.filter(item => {\n return item.id !== id\n })\n },\n update: (id, isValid, errorMessages) => {\n const found = items.value.find(item => item.id === id)\n\n if (!found) return\n\n found.isValid = isValid\n found.errorMessages = errorMessages\n },\n isDisabled,\n isReadonly,\n isValidating,\n items,\n validateOn: toRef(props, 'validateOn'),\n })\n\n return {\n errors,\n isDisabled,\n isReadonly,\n isValidating,\n items,\n validate,\n reset,\n resetValidation,\n }\n}\n\nexport function useForm () {\n return inject(FormKey, null)\n}\n"],"mappings":"AAAA;AACA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,OAAO,EAAEC,GAAG,EAAEC,KAAK,EAAEC,KAAK,QAAQ,KAAK;AAAA,SACzDC,eAAe;AAAA,SACfC,WAAW,EAAEC,YAAY,6BAElC;AAyCA,OAAO,MAAMC,OAAkC,GAAGC,MAAM,CAACC,GAAG,CAAC,cAAc,CAAC;AAW5E,OAAO,MAAMC,aAAa,GAAGJ,YAAY,CAAC;EACxCK,QAAQ,EAAEC,OAAO;EACjBC,QAAQ,EAAED,OAAO;EACjBE,QAAQ,EAAEF,OAAO;EACjBG,UAAU,EAAE;IACVC,IAAI,EAAEJ,OAAmC;IACzCK,OAAO,EAAE;EACX,CAAC;EACDC,UAAU,EAAE;IACVF,IAAI,EAAEG,MAA2C;IACjDF,OAAO,EAAE;EACX;AACF,CAAC,EAAE,MAAM,CAAC;AAEV,OAAO,SAASG,UAAU,CAAEC,KAAgB,EAAE;EAC5C,MAAMC,KAAK,GAAGlB,eAAe,CAACiB,KAAK,EAAE,YAAY,CAAC;EAElD,MAAME,UAAU,GAAGzB,QAAQ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J,CAAC;IACDS,UAAU,EAAEV,EAAE,IAAI;MAChBV,KAAK,CAACK,KAAK,GAAGL,KAAK,CAACK,KAAK,CAACgB,MAAM,CAACf,IAAI,IAAI;QACvC,OAAOA,IAAI,CAACI,EAAE,KAAKA,EAAE;MACvB,CAAC,CAAC;IACJ,CAAC;IACDY,MAAM,EAAE,CAACZ,EAAE,EAAEM,OAAO,EAAEL,aAAa,KAAK;MACtC,MAAMY,KAAK,GAAGvB,KAAK,CAACK,KAAK,CAACmB,IAAI,CAAClB,IAAI,IAAIA,IAAI,CAACI,EAAE,KAAKA,EAAE,CAAC;MAEtD,IAAI,CAACa,KAAK,EAAE;MAEZA,KAAK,CAACP,OAAO,GAAGA,OAAO;MACvBO,KAAK,CAACZ,aAAa,GAAGA,aAAa;IACrC,CAAC;IACDd,UAAU;IACVC,UAAU;IACVC,YAAY;IACZC,KAAK;IACLR,UAAU,EAAEhB,KAAK,CAACmB,KAAK,EAAE,YAAY;EACvC,CAAC,CAAC;EAEF,OAAO;IACLM,MAAM;IACNJ,UAAU;IACVC,UAAU;IACVC,YAAY;IACZC,KAAK;IACLE,QAAQ;IACRU,KAAK;IACLE;EACF,CAAC;AACH;AAEA,OAAO,SAASW,OAAO,GAAI;EACzB,OAAOpD,MAAM,CAACQ,OAAO,EAAE,IAAI,CAAC;AAC9B"}
|
package/lib/entry-bundler.mjs
CHANGED
package/lib/framework.mjs
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -91,15 +91,12 @@ interface ThemeInstance {
|
|
|
91
91
|
}
|
|
92
92
|
declare function useTheme(): ThemeInstance;
|
|
93
93
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
xl: number;
|
|
101
|
-
xxl: number;
|
|
102
|
-
}
|
|
94
|
+
declare const breakpoints: readonly ["sm", "md", "lg", "xl", "xxl"];
|
|
95
|
+
type Breakpoint = typeof breakpoints[number];
|
|
96
|
+
type DisplayBreakpoint = 'xs' | Breakpoint;
|
|
97
|
+
type DisplayThresholds = {
|
|
98
|
+
[key in DisplayBreakpoint]: number;
|
|
99
|
+
};
|
|
103
100
|
interface DisplayOptions {
|
|
104
101
|
mobileBreakpoint?: number | DisplayBreakpoint;
|
|
105
102
|
thresholds?: Partial<DisplayThresholds>;
|
|
@@ -315,21 +312,29 @@ declare module '@vue/runtime-core' {
|
|
|
315
312
|
|
|
316
313
|
export interface GlobalComponents {
|
|
317
314
|
VDefaultsProvider: typeof import('vuetify/components')['VDefaultsProvider']
|
|
315
|
+
VForm: typeof import('vuetify/components')['VForm']
|
|
318
316
|
VContainer: typeof import('vuetify/components')['VContainer']
|
|
319
317
|
VCol: typeof import('vuetify/components')['VCol']
|
|
320
318
|
VRow: typeof import('vuetify/components')['VRow']
|
|
321
319
|
VSpacer: typeof import('vuetify/components')['VSpacer']
|
|
322
320
|
VHover: typeof import('vuetify/components')['VHover']
|
|
323
|
-
VForm: typeof import('vuetify/components')['VForm']
|
|
324
321
|
VLazy: typeof import('vuetify/components')['VLazy']
|
|
325
322
|
VLayout: typeof import('vuetify/components')['VLayout']
|
|
326
323
|
VLayoutItem: typeof import('vuetify/components')['VLayoutItem']
|
|
327
|
-
VNoSsr: typeof import('vuetify/components')['VNoSsr']
|
|
328
324
|
VLocaleProvider: typeof import('vuetify/components')['VLocaleProvider']
|
|
329
|
-
|
|
325
|
+
VNoSsr: typeof import('vuetify/components')['VNoSsr']
|
|
330
326
|
VRadio: typeof import('vuetify/components')['VRadio']
|
|
331
327
|
VRangeSlider: typeof import('vuetify/components')['VRangeSlider']
|
|
332
328
|
VResponsive: typeof import('vuetify/components')['VResponsive']
|
|
329
|
+
VParallax: typeof import('vuetify/components')['VParallax']
|
|
330
|
+
VValidation: typeof import('vuetify/components')['VValidation']
|
|
331
|
+
VApp: typeof import('vuetify/components')['VApp']
|
|
332
|
+
VAppBar: typeof import('vuetify/components')['VAppBar']
|
|
333
|
+
VAppBarNavIcon: typeof import('vuetify/components')['VAppBarNavIcon']
|
|
334
|
+
VAppBarTitle: typeof import('vuetify/components')['VAppBarTitle']
|
|
335
|
+
VAlert: typeof import('vuetify/components')['VAlert']
|
|
336
|
+
VAlertTitle: typeof import('vuetify/components')['VAlertTitle']
|
|
337
|
+
VThemeProvider: typeof import('vuetify/components')['VThemeProvider']
|
|
333
338
|
VFabTransition: typeof import('vuetify/components')['VFabTransition']
|
|
334
339
|
VDialogBottomTransition: typeof import('vuetify/components')['VDialogBottomTransition']
|
|
335
340
|
VDialogTopTransition: typeof import('vuetify/components')['VDialogTopTransition']
|
|
@@ -346,28 +351,15 @@ declare module '@vue/runtime-core' {
|
|
|
346
351
|
VExpandTransition: typeof import('vuetify/components')['VExpandTransition']
|
|
347
352
|
VExpandXTransition: typeof import('vuetify/components')['VExpandXTransition']
|
|
348
353
|
VDialogTransition: typeof import('vuetify/components')['VDialogTransition']
|
|
349
|
-
VThemeProvider: typeof import('vuetify/components')['VThemeProvider']
|
|
350
|
-
VApp: typeof import('vuetify/components')['VApp']
|
|
351
|
-
VAppBar: typeof import('vuetify/components')['VAppBar']
|
|
352
|
-
VAppBarNavIcon: typeof import('vuetify/components')['VAppBarNavIcon']
|
|
353
|
-
VAppBarTitle: typeof import('vuetify/components')['VAppBarTitle']
|
|
354
|
-
VAlert: typeof import('vuetify/components')['VAlert']
|
|
355
|
-
VAlertTitle: typeof import('vuetify/components')['VAlertTitle']
|
|
356
354
|
VAvatar: typeof import('vuetify/components')['VAvatar']
|
|
355
|
+
VBadge: typeof import('vuetify/components')['VBadge']
|
|
357
356
|
VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
|
|
358
357
|
VBanner: typeof import('vuetify/components')['VBanner']
|
|
359
358
|
VBannerActions: typeof import('vuetify/components')['VBannerActions']
|
|
360
359
|
VBannerText: typeof import('vuetify/components')['VBannerText']
|
|
361
|
-
VValidation: typeof import('vuetify/components')['VValidation']
|
|
362
|
-
VBadge: typeof import('vuetify/components')['VBadge']
|
|
363
360
|
VBottomNavigation: typeof import('vuetify/components')['VBottomNavigation']
|
|
364
361
|
VBtn: typeof import('vuetify/components')['VBtn']
|
|
365
|
-
VBreadcrumbs: typeof import('vuetify/components')['VBreadcrumbs']
|
|
366
|
-
VBreadcrumbsItem: typeof import('vuetify/components')['VBreadcrumbsItem']
|
|
367
|
-
VBreadcrumbsDivider: typeof import('vuetify/components')['VBreadcrumbsDivider']
|
|
368
362
|
VBtnGroup: typeof import('vuetify/components')['VBtnGroup']
|
|
369
|
-
VCarousel: typeof import('vuetify/components')['VCarousel']
|
|
370
|
-
VCarouselItem: typeof import('vuetify/components')['VCarouselItem']
|
|
371
363
|
VBtnToggle: typeof import('vuetify/components')['VBtnToggle']
|
|
372
364
|
VCard: typeof import('vuetify/components')['VCard']
|
|
373
365
|
VCardActions: typeof import('vuetify/components')['VCardActions']
|
|
@@ -375,6 +367,11 @@ declare module '@vue/runtime-core' {
|
|
|
375
367
|
VCardSubtitle: typeof import('vuetify/components')['VCardSubtitle']
|
|
376
368
|
VCardText: typeof import('vuetify/components')['VCardText']
|
|
377
369
|
VCardTitle: typeof import('vuetify/components')['VCardTitle']
|
|
370
|
+
VCarousel: typeof import('vuetify/components')['VCarousel']
|
|
371
|
+
VCarouselItem: typeof import('vuetify/components')['VCarouselItem']
|
|
372
|
+
VBreadcrumbs: typeof import('vuetify/components')['VBreadcrumbs']
|
|
373
|
+
VBreadcrumbsItem: typeof import('vuetify/components')['VBreadcrumbsItem']
|
|
374
|
+
VBreadcrumbsDivider: typeof import('vuetify/components')['VBreadcrumbsDivider']
|
|
378
375
|
VCheckbox: typeof import('vuetify/components')['VCheckbox']
|
|
379
376
|
VCheckboxBtn: typeof import('vuetify/components')['VCheckboxBtn']
|
|
380
377
|
VChip: typeof import('vuetify/components')['VChip']
|
|
@@ -400,9 +397,10 @@ declare module '@vue/runtime-core' {
|
|
|
400
397
|
VClassIcon: typeof import('vuetify/components')['VClassIcon']
|
|
401
398
|
VImg: typeof import('vuetify/components')['VImg']
|
|
402
399
|
VInput: typeof import('vuetify/components')['VInput']
|
|
403
|
-
VKbd: typeof import('vuetify/components')['VKbd']
|
|
404
400
|
VItemGroup: typeof import('vuetify/components')['VItemGroup']
|
|
405
401
|
VItem: typeof import('vuetify/components')['VItem']
|
|
402
|
+
VKbd: typeof import('vuetify/components')['VKbd']
|
|
403
|
+
VLabel: typeof import('vuetify/components')['VLabel']
|
|
406
404
|
VList: typeof import('vuetify/components')['VList']
|
|
407
405
|
VListGroup: typeof import('vuetify/components')['VListGroup']
|
|
408
406
|
VListImg: typeof import('vuetify/components')['VListImg']
|
|
@@ -412,10 +410,9 @@ declare module '@vue/runtime-core' {
|
|
|
412
410
|
VListItemSubtitle: typeof import('vuetify/components')['VListItemSubtitle']
|
|
413
411
|
VListItemTitle: typeof import('vuetify/components')['VListItemTitle']
|
|
414
412
|
VListSubheader: typeof import('vuetify/components')['VListSubheader']
|
|
415
|
-
VLabel: typeof import('vuetify/components')['VLabel']
|
|
416
|
-
VMain: typeof import('vuetify/components')['VMain']
|
|
417
|
-
VNavigationDrawer: typeof import('vuetify/components')['VNavigationDrawer']
|
|
418
413
|
VMenu: typeof import('vuetify/components')['VMenu']
|
|
414
|
+
VNavigationDrawer: typeof import('vuetify/components')['VNavigationDrawer']
|
|
415
|
+
VMain: typeof import('vuetify/components')['VMain']
|
|
419
416
|
VMessages: typeof import('vuetify/components')['VMessages']
|
|
420
417
|
VOverlay: typeof import('vuetify/components')['VOverlay']
|
|
421
418
|
VPagination: typeof import('vuetify/components')['VPagination']
|
|
@@ -423,8 +420,8 @@ declare module '@vue/runtime-core' {
|
|
|
423
420
|
VProgressLinear: typeof import('vuetify/components')['VProgressLinear']
|
|
424
421
|
VRadioGroup: typeof import('vuetify/components')['VRadioGroup']
|
|
425
422
|
VRating: typeof import('vuetify/components')['VRating']
|
|
426
|
-
VSelectionControlGroup: typeof import('vuetify/components')['VSelectionControlGroup']
|
|
427
423
|
VSelect: typeof import('vuetify/components')['VSelect']
|
|
424
|
+
VSelectionControlGroup: typeof import('vuetify/components')['VSelectionControlGroup']
|
|
428
425
|
VSelectionControl: typeof import('vuetify/components')['VSelectionControl']
|
|
429
426
|
VSheet: typeof import('vuetify/components')['VSheet']
|
|
430
427
|
VSlideGroup: typeof import('vuetify/components')['VSlideGroup']
|
|
@@ -438,13 +435,13 @@ declare module '@vue/runtime-core' {
|
|
|
438
435
|
VTabs: typeof import('vuetify/components')['VTabs']
|
|
439
436
|
VTab: typeof import('vuetify/components')['VTab']
|
|
440
437
|
VTextField: typeof import('vuetify/components')['VTextField']
|
|
438
|
+
VToolbar: typeof import('vuetify/components')['VToolbar']
|
|
439
|
+
VToolbarTitle: typeof import('vuetify/components')['VToolbarTitle']
|
|
440
|
+
VToolbarItems: typeof import('vuetify/components')['VToolbarItems']
|
|
441
|
+
VTooltip: typeof import('vuetify/components')['VTooltip']
|
|
441
442
|
VTimeline: typeof import('vuetify/components')['VTimeline']
|
|
442
443
|
VTimelineItem: typeof import('vuetify/components')['VTimelineItem']
|
|
443
|
-
VTooltip: typeof import('vuetify/components')['VTooltip']
|
|
444
444
|
VWindow: typeof import('vuetify/components')['VWindow']
|
|
445
445
|
VWindowItem: typeof import('vuetify/components')['VWindowItem']
|
|
446
|
-
VToolbar: typeof import('vuetify/components')['VToolbar']
|
|
447
|
-
VToolbarTitle: typeof import('vuetify/components')['VToolbarTitle']
|
|
448
|
-
VToolbarItems: typeof import('vuetify/components')['VToolbarItems']
|
|
449
446
|
}
|
|
450
447
|
}
|
|
@@ -33,6 +33,18 @@
|
|
|
33
33
|
.v-data-table .v-table__wrapper > table tbody > tr th.v-data-table-column--align-end .v-data-table-header__content {
|
|
34
34
|
flex-direction: row-reverse;
|
|
35
35
|
}
|
|
36
|
+
.v-data-table .v-table__wrapper > table > thead > tr > td.v-data-table-column--align-center,
|
|
37
|
+
.v-data-table .v-table__wrapper > table > thead > tr th.v-data-table-column--align-center,
|
|
38
|
+
.v-data-table .v-table__wrapper > table tbody > tr > td.v-data-table-column--align-center,
|
|
39
|
+
.v-data-table .v-table__wrapper > table tbody > tr th.v-data-table-column--align-center {
|
|
40
|
+
text-align: center;
|
|
41
|
+
}
|
|
42
|
+
.v-data-table .v-table__wrapper > table > thead > tr > td.v-data-table-column--align-center .v-data-table-header__content,
|
|
43
|
+
.v-data-table .v-table__wrapper > table > thead > tr th.v-data-table-column--align-center .v-data-table-header__content,
|
|
44
|
+
.v-data-table .v-table__wrapper > table tbody > tr > td.v-data-table-column--align-center .v-data-table-header__content,
|
|
45
|
+
.v-data-table .v-table__wrapper > table tbody > tr th.v-data-table-column--align-center .v-data-table-header__content {
|
|
46
|
+
justify-content: center;
|
|
47
|
+
}
|
|
36
48
|
.v-data-table .v-table__wrapper > table > thead > tr > td.v-data-table-column--no-padding,
|
|
37
49
|
.v-data-table .v-table__wrapper > table > thead > tr th.v-data-table-column--no-padding,
|
|
38
50
|
.v-data-table .v-table__wrapper > table tbody > tr > td.v-data-table-column--no-padding,
|
|
@@ -32,6 +32,12 @@
|
|
|
32
32
|
|
|
33
33
|
.v-data-table-header__content
|
|
34
34
|
flex-direction: row-reverse
|
|
35
|
+
|
|
36
|
+
&.v-data-table-column--align-center
|
|
37
|
+
text-align: center
|
|
38
|
+
|
|
39
|
+
.v-data-table-header__content
|
|
40
|
+
justify-content: center
|
|
35
41
|
|
|
36
42
|
&.v-data-table-column--no-padding
|
|
37
43
|
padding: 0 8px
|
|
@@ -10,6 +10,7 @@ import { defineComponent, useRender } from "../../util/index.mjs"; // Types
|
|
|
10
10
|
export const VDataTableRow = defineComponent({
|
|
11
11
|
name: 'VDataTableRow',
|
|
12
12
|
props: {
|
|
13
|
+
index: Number,
|
|
13
14
|
item: Object,
|
|
14
15
|
onClick: Function
|
|
15
16
|
},
|
|
@@ -47,6 +48,7 @@ export const VDataTableRow = defineComponent({
|
|
|
47
48
|
const item = props.item;
|
|
48
49
|
const slotName = `item.${column.key}`;
|
|
49
50
|
const slotProps = {
|
|
51
|
+
index: props.index,
|
|
50
52
|
item: props.item,
|
|
51
53
|
columns: columns.value,
|
|
52
54
|
isSelected,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VDataTableRow.mjs","names":["VBtn","VCheckboxBtn","useExpanded","useHeaders","useSelection","VDataTableColumn","defineComponent","useRender","VDataTableRow","name","props","item","Object","onClick","Function","setup","slots","isSelected","toggleSelect","isExpanded","toggleExpand","columns","value","length","map","column","i","align","fixed","fixedOffset","lastFixed","key","width","default","slotName","slotProps"],"sources":["../../../src/labs/VDataTable/VDataTableRow.tsx"],"sourcesContent":["// Components\nimport { VBtn } from '@/components/VBtn'\nimport { VCheckboxBtn } from '@/components/VCheckbox'\n\n// Composables\nimport { useExpanded } from './composables/expand'\nimport { useHeaders } from './composables/headers'\nimport { useSelection } from './composables/select'\nimport { VDataTableColumn } from './VDataTableColumn'\n\n// Utilities\nimport { defineComponent, useRender } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\nimport type { DataTableItem } from './types'\n\nexport const VDataTableRow = defineComponent({\n name: 'VDataTableRow',\n\n props: {\n item: Object as PropType<DataTableItem>,\n onClick: Function as PropType<(e: MouseEvent) => void>,\n },\n\n setup (props, { slots }) {\n const { isSelected, toggleSelect } = useSelection()\n const { isExpanded, toggleExpand } = useExpanded()\n const { columns } = useHeaders()\n\n useRender(() => (\n <tr\n class={[\n 'v-data-table__tr',\n {\n 'v-data-table__tr--clickable': !!props.onClick,\n },\n ]}\n onClick={ props.onClick }\n >\n { !columns.value.length && (\n <VDataTableColumn\n key=\"no-data\"\n v-slots={ slots }\n />\n )}\n\n { props.item && columns.value.map((column, i) => (\n <VDataTableColumn\n align={ column.align }\n fixed={ column.fixed }\n fixedOffset={ column.fixedOffset }\n lastFixed={ column.lastFixed }\n noPadding={ column.key === 'data-table-select' || column.key === 'data-table-expand' }\n width={ column.width }\n >\n {{\n default: () => {\n const item = props.item!\n const slotName = `item.${column.key}`\n const slotProps = {\n item: props.item,\n columns: columns.value,\n isSelected,\n toggleSelect,\n isExpanded,\n toggleExpand,\n }\n\n if (slots[slotName]) return slots[slotName]!(slotProps)\n\n if (column.key === 'data-table-select') {\n return slots['item.data-table-select']?.(slotProps) ?? (\n <VCheckboxBtn\n modelValue={ isSelected([item]) }\n onClick={ () => toggleSelect(item) }\n />\n )\n }\n\n if (column.key === 'data-table-expand') {\n return slots['item.data-table-expand']?.(slotProps) ?? (\n <VBtn\n icon={ isExpanded(item) ? '$collapse' : '$expand' }\n size=\"small\"\n variant=\"text\"\n onClick={ () => toggleExpand(item) }\n />\n )\n }\n\n return item.columns[column.key]\n },\n }}\n </VDataTableColumn>\n ))}\n </tr>\n ))\n },\n})\n\nexport type VDataTableRow = InstanceType<typeof VDataTableRow>\n"],"mappings":";AAAA;AAAA,SACSA,IAAI;AAAA,SACJC,YAAY,gDAErB;AAAA,SACSC,WAAW;AAAA,SACXC,UAAU;AAAA,SACVC,YAAY;AAAA,SACZC,gBAAgB,kCAEzB;AAAA,SACSC,eAAe,EAAEC,SAAS,gCAEnC;AAIA,OAAO,MAAMC,aAAa,GAAGF,eAAe,CAAC;EAC3CG,IAAI,EAAE,eAAe;EAErBC,KAAK,EAAE;IACLC,IAAI,EAAEC,MAAiC;IACvCC,OAAO,EAAEC;EACX,CAAC;EAEDC,KAAK,
|
|
1
|
+
{"version":3,"file":"VDataTableRow.mjs","names":["VBtn","VCheckboxBtn","useExpanded","useHeaders","useSelection","VDataTableColumn","defineComponent","useRender","VDataTableRow","name","props","index","Number","item","Object","onClick","Function","setup","slots","isSelected","toggleSelect","isExpanded","toggleExpand","columns","value","length","map","column","i","align","fixed","fixedOffset","lastFixed","key","width","default","slotName","slotProps"],"sources":["../../../src/labs/VDataTable/VDataTableRow.tsx"],"sourcesContent":["// Components\nimport { VBtn } from '@/components/VBtn'\nimport { VCheckboxBtn } from '@/components/VCheckbox'\n\n// Composables\nimport { useExpanded } from './composables/expand'\nimport { useHeaders } from './composables/headers'\nimport { useSelection } from './composables/select'\nimport { VDataTableColumn } from './VDataTableColumn'\n\n// Utilities\nimport { defineComponent, useRender } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\nimport type { DataTableItem } from './types'\n\nexport const VDataTableRow = defineComponent({\n name: 'VDataTableRow',\n\n props: {\n index: Number as PropType<Number>,\n item: Object as PropType<DataTableItem>,\n onClick: Function as PropType<(e: MouseEvent) => void>,\n },\n\n setup (props, { slots }) {\n const { isSelected, toggleSelect } = useSelection()\n const { isExpanded, toggleExpand } = useExpanded()\n const { columns } = useHeaders()\n\n useRender(() => (\n <tr\n class={[\n 'v-data-table__tr',\n {\n 'v-data-table__tr--clickable': !!props.onClick,\n },\n ]}\n onClick={ props.onClick }\n >\n { !columns.value.length && (\n <VDataTableColumn\n key=\"no-data\"\n v-slots={ slots }\n />\n )}\n\n { props.item && columns.value.map((column, i) => (\n <VDataTableColumn\n align={ column.align }\n fixed={ column.fixed }\n fixedOffset={ column.fixedOffset }\n lastFixed={ column.lastFixed }\n noPadding={ column.key === 'data-table-select' || column.key === 'data-table-expand' }\n width={ column.width }\n >\n {{\n default: () => {\n const item = props.item!\n const slotName = `item.${column.key}`\n const slotProps = {\n index: props.index,\n item: props.item,\n columns: columns.value,\n isSelected,\n toggleSelect,\n isExpanded,\n toggleExpand,\n }\n\n if (slots[slotName]) return slots[slotName]!(slotProps)\n\n if (column.key === 'data-table-select') {\n return slots['item.data-table-select']?.(slotProps) ?? (\n <VCheckboxBtn\n modelValue={ isSelected([item]) }\n onClick={ () => toggleSelect(item) }\n />\n )\n }\n\n if (column.key === 'data-table-expand') {\n return slots['item.data-table-expand']?.(slotProps) ?? (\n <VBtn\n icon={ isExpanded(item) ? '$collapse' : '$expand' }\n size=\"small\"\n variant=\"text\"\n onClick={ () => toggleExpand(item) }\n />\n )\n }\n\n return item.columns[column.key]\n },\n }}\n </VDataTableColumn>\n ))}\n </tr>\n ))\n },\n})\n\nexport type VDataTableRow = InstanceType<typeof VDataTableRow>\n"],"mappings":";AAAA;AAAA,SACSA,IAAI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AAOT,MAAM,CAACM,GAAI,EAAC;QACrC,MAAMI,SAAS,GAAG;UAChB1B,KAAK,EAAED,KAAK,CAACC,KAAK;UAClBE,IAAI,EAAEH,KAAK,CAACG,IAAI;UAChBU,OAAO,EAAEA,OAAO,CAACC,KAAK;UACtBL,UAAU;UACVC,YAAY;UACZC,UAAU;UACVC;QACF,CAAC;QAED,IAAIJ,KAAK,CAACkB,QAAQ,CAAC,EAAE,OAAOlB,KAAK,CAACkB,QAAQ,CAAC,CAAEC,SAAS,CAAC;QAEvD,IAAIV,MAAM,CAACM,GAAG,KAAK,mBAAmB,EAAE;UACtC,OAAOf,KAAK,CAAC,wBAAwB,CAAC,GAAGmB,SAAS,CAAC;YAAA,cAElClB,UAAU,CAAC,CAACN,IAAI,CAAC,CAAC;YAAA,WACrB,MAAMO,YAAY,CAACP,IAAI;UAAC,QAErC;QACH;QAEA,IAAIc,MAAM,CAACM,GAAG,KAAK,mBAAmB,EAAE;UACtC,OAAOf,KAAK,CAAC,wBAAwB,CAAC,GAAGmB,SAAS,CAAC;YAAA,QAExChB,UAAU,CAACR,IAAI,CAAC,GAAG,WAAW,GAAG,SAAS;YAAA,QAC5C,OAAO;YAAA,WACJ,MAAM;YAAA,WACJ,MAAMS,YAAY,CAACT,IAAI;UAAC,QAErC;QACH;QAEA,OAAOA,IAAI,CAACU,OAAO,CAACI,MAAM,CAACM,GAAG,CAAC;MACjC;IAAC,EAGN,CAAC,EAEL,CAAC;EACJ;AACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VDataTableRows.mjs","names":["VDataTableGroupHeaderRow","VDataTableRow","useLocale","useExpanded","useHeaders","useSelection","useGroupBy","genericComponent","useRender","VDataTableRows","name","props","loading","Boolean","String","loadingText","type","default","hideNoData","items","Array","noDataText","rowHeight","Number","emits","event","value","setup","emit","slots","columns","expandOnClick","toggleExpand","isExpanded","isSelected","toggleSelect","toggleGroup","isGroupOpen","t","undefined","length","map","item","index","id","slotProps"],"sources":["../../../src/labs/VDataTable/VDataTableRows.tsx"],"sourcesContent":["// Components\nimport { VDataTableGroupHeaderRow } from './VDataTableGroupHeaderRow'\nimport { VDataTableRow } from './VDataTableRow'\n\n// Composables\nimport { useLocale } from '@/composables/locale'\nimport { useExpanded } from './composables/expand'\nimport { useHeaders } from './composables/headers'\nimport { useSelection } from './composables/select'\nimport { useGroupBy } from './composables/group'\n\n// Utilities\nimport { genericComponent, useRender } from '@/util'\n\n// Types\nimport type { DataTableItem, GroupHeaderItem, InternalDataTableHeader, InternalDataTableItem } from './types'\nimport type { PropType } from 'vue'\n\ntype GroupHeaderSlot = {\n index: number\n item: GroupHeaderItem\n columns: InternalDataTableHeader[]\n isExpanded: (item: DataTableItem) => boolean\n toggleExpand: (item: DataTableItem) => void\n isSelected: (items: DataTableItem[]) => boolean\n toggleSelect: (item: DataTableItem) => void\n toggleGroup: (group: GroupHeaderItem) => void\n isGroupOpen: (group: GroupHeaderItem) => boolean\n}\n\ntype ItemSlot = {\n index: number\n item: InternalDataTableItem\n columns: InternalDataTableHeader[]\n isExpanded: (item: DataTableItem) => boolean\n toggleExpand: (item: DataTableItem) => void\n isSelected: (items: DataTableItem[]) => boolean\n toggleSelect: (item: DataTableItem) => void\n}\n\nexport type VDataTableRowsSlots = {\n default: []\n item: [ItemSlot]\n loading: []\n 'group-header': [GroupHeaderSlot]\n 'no-data': []\n 'expanded-row': [ItemSlot]\n 'item.data-table-select': [ItemSlot]\n 'item.data-table-expand': [ItemSlot]\n} & { [key: `item.${string}`]: [ItemSlot] }\n\nexport const VDataTableRows = genericComponent<VDataTableRowsSlots>()({\n name: 'VDataTableRows',\n\n props: {\n loading: [Boolean, String],\n loadingText: {\n type: String,\n default: '$vuetify.dataIterator.loadingText',\n },\n hideNoData: Boolean,\n items: {\n type: Array as PropType<InternalDataTableItem[]>,\n default: () => ([]),\n },\n noDataText: {\n type: String,\n default: '$vuetify.noDataText',\n },\n rowHeight: Number,\n },\n\n emits: {\n 'click:row': (event: Event, value: { item: DataTableItem }) => true,\n },\n\n setup (props, { emit, slots }) {\n const { columns } = useHeaders()\n const { expandOnClick, toggleExpand, isExpanded } = useExpanded()\n const { isSelected, toggleSelect } = useSelection()\n const { toggleGroup, isGroupOpen } = useGroupBy()\n const { t } = useLocale()\n\n useRender(() => (\n <>\n { props.loading ? slots.loading?.() ?? (\n <VDataTableRow\n class=\"v-data-table-rows-no-data\"\n key=\"loading\"\n >\n { t(props.loadingText) }\n </VDataTableRow>\n ) : undefined }\n\n { !props.loading && !props.items.length && !props.hideNoData && (slots['no-data']?.() ?? (\n <VDataTableRow\n class=\"v-data-table-rows-no-data\"\n key=\"no-data\"\n >\n { t(props.noDataText) }\n </VDataTableRow>\n ))}\n\n { props.items.map((item, index) => {\n if (item.type === 'group-header') {\n return slots['group-header'] ? slots['group-header']({\n index,\n item,\n columns: columns.value,\n isExpanded,\n toggleExpand,\n isSelected,\n toggleSelect,\n toggleGroup,\n isGroupOpen,\n } as GroupHeaderSlot) : (\n <VDataTableGroupHeaderRow\n key={ `group-header_${item.id}` }\n item={ item }\n v-slots={ slots }\n />\n )\n }\n\n const slotProps = {\n index,\n item,\n columns: columns.value,\n isExpanded,\n toggleExpand,\n isSelected,\n toggleSelect,\n } as ItemSlot\n\n return (\n <>\n { slots.item ? slots.item(slotProps) : (\n <VDataTableRow\n key={ `item_${item.value}` }\n onClick={ (event: Event) => {\n if (expandOnClick.value) {\n toggleExpand(item)\n }\n\n emit('click:row', event, { item })\n }}\n item={ item }\n v-slots={ slots }\n />\n )}\n\n { isExpanded(item) && slots['expanded-row']?.(slotProps) }\n </>\n )\n })}\n </>\n ))\n\n return {}\n },\n})\n\nexport type VDataTableRows = InstanceType<typeof VDataTableRows>\n"],"mappings":";AAAA;AAAA,SACSA,wBAAwB;AAAA,SACxBC,aAAa,+BAEtB;AAAA,SACSC,SAAS;AAAA,SACTC,WAAW;AAAA,SACXC,UAAU;AAAA,SACVC,YAAY;AAAA,SACZC,UAAU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KAAK,CAACqB,MAAM,IAAI,CAAC7B,KAAK,CAACO,UAAU,KAAKW,KAAK,CAAC,SAAS,CAAC,IAAI;MAAA,SAE3E,2BAA2B;MAAA,OAC7B;IAAS;MAAA,gBAEXS,CAAC,CAAC3B,KAAK,CAACU,UAAU,CAAC;IAAA,EAExB,CAAC,EAEAV,KAAK,CAACQ,KAAK,CAACsB,GAAG,CAAC,CAACC,IAAI,EAAEC,KAAK,KAAK;MACjC,IAAID,IAAI,CAAC1B,IAAI,KAAK,cAAc,EAAE;QAChC,OAAOa,KAAK,CAAC,cAAc,CAAC,GAAGA,KAAK,CAAC,cAAc,CAAC,CAAC;UACnDc,KAAK;UACLD,IAAI;UACJZ,OAAO,EAAEA,OAAO,CAACJ,KAAK;UACtBO,UAAU;UACVD,YAAY;UACZE,UAAU;UACVC,YAAY;UACZC,WAAW;UACXC;QACF,CAAC,CAAoB;UAAA,OAEV,gBAAeK,IAAI,CAACE,EAAG,EAAC;UAAA,QACxBF;QAAI,GACDb,KAAK,CAElB;MACH;MAEA,MAAMgB,SAAS,GAAG;QAChBF,KAAK;QACLD,IAAI;QACJZ,OAAO,EAAEA,OAAO,CAACJ,KAAK;QACtBO,UAAU;QACVD,YAAY;QACZE,UAAU;QACVC;MACF,CAAa;MAEb,sCAEMN,KAAK,CAACa,IAAI,GAAGb,KAAK,CAACa,IAAI,CAACG,SAAS,CAAC;QAAA,OAEzB,QAAOH,IAAI,CAAChB,KAAM,EAAC;QAAA,WACfD,KAAY,IAAK;UAC1B,IAAIM,aAAa,CAACL,KAAK,EAAE;YACvBM,YAAY,CAACU,IAAI,CAAC;UACpB;UAEAd,IAAI,CAAC,WAAW,EAAEH,KAAK,EAAE;YAAEiB;UAAK,CAAC,CAAC;QACpC,CAAC;QAAA,
|
|
1
|
+
{"version":3,"file":"VDataTableRows.mjs","names":["VDataTableGroupHeaderRow","VDataTableRow","useLocale","useExpanded","useHeaders","useSelection","useGroupBy","genericComponent","useRender","VDataTableRows","name","props","loading","Boolean","String","loadingText","type","default","hideNoData","items","Array","noDataText","rowHeight","Number","emits","event","value","setup","emit","slots","columns","expandOnClick","toggleExpand","isExpanded","isSelected","toggleSelect","toggleGroup","isGroupOpen","t","undefined","length","map","item","index","id","slotProps"],"sources":["../../../src/labs/VDataTable/VDataTableRows.tsx"],"sourcesContent":["// Components\nimport { VDataTableGroupHeaderRow } from './VDataTableGroupHeaderRow'\nimport { VDataTableRow } from './VDataTableRow'\n\n// Composables\nimport { useLocale } from '@/composables/locale'\nimport { useExpanded } from './composables/expand'\nimport { useHeaders } from './composables/headers'\nimport { useSelection } from './composables/select'\nimport { useGroupBy } from './composables/group'\n\n// Utilities\nimport { genericComponent, useRender } from '@/util'\n\n// Types\nimport type { DataTableItem, GroupHeaderItem, InternalDataTableHeader, InternalDataTableItem } from './types'\nimport type { PropType } from 'vue'\n\ntype GroupHeaderSlot = {\n index: number\n item: GroupHeaderItem\n columns: InternalDataTableHeader[]\n isExpanded: (item: DataTableItem) => boolean\n toggleExpand: (item: DataTableItem) => void\n isSelected: (items: DataTableItem[]) => boolean\n toggleSelect: (item: DataTableItem) => void\n toggleGroup: (group: GroupHeaderItem) => void\n isGroupOpen: (group: GroupHeaderItem) => boolean\n}\n\ntype ItemSlot = {\n index: number\n item: InternalDataTableItem\n columns: InternalDataTableHeader[]\n isExpanded: (item: DataTableItem) => boolean\n toggleExpand: (item: DataTableItem) => void\n isSelected: (items: DataTableItem[]) => boolean\n toggleSelect: (item: DataTableItem) => void\n}\n\nexport type VDataTableRowsSlots = {\n default: []\n item: [ItemSlot]\n loading: []\n 'group-header': [GroupHeaderSlot]\n 'no-data': []\n 'expanded-row': [ItemSlot]\n 'item.data-table-select': [ItemSlot]\n 'item.data-table-expand': [ItemSlot]\n} & { [key: `item.${string}`]: [ItemSlot] }\n\nexport const VDataTableRows = genericComponent<VDataTableRowsSlots>()({\n name: 'VDataTableRows',\n\n props: {\n loading: [Boolean, String],\n loadingText: {\n type: String,\n default: '$vuetify.dataIterator.loadingText',\n },\n hideNoData: Boolean,\n items: {\n type: Array as PropType<InternalDataTableItem[]>,\n default: () => ([]),\n },\n noDataText: {\n type: String,\n default: '$vuetify.noDataText',\n },\n rowHeight: Number,\n },\n\n emits: {\n 'click:row': (event: Event, value: { item: DataTableItem }) => true,\n },\n\n setup (props, { emit, slots }) {\n const { columns } = useHeaders()\n const { expandOnClick, toggleExpand, isExpanded } = useExpanded()\n const { isSelected, toggleSelect } = useSelection()\n const { toggleGroup, isGroupOpen } = useGroupBy()\n const { t } = useLocale()\n\n useRender(() => (\n <>\n { props.loading ? slots.loading?.() ?? (\n <VDataTableRow\n class=\"v-data-table-rows-no-data\"\n key=\"loading\"\n >\n { t(props.loadingText) }\n </VDataTableRow>\n ) : undefined }\n\n { !props.loading && !props.items.length && !props.hideNoData && (slots['no-data']?.() ?? (\n <VDataTableRow\n class=\"v-data-table-rows-no-data\"\n key=\"no-data\"\n >\n { t(props.noDataText) }\n </VDataTableRow>\n ))}\n\n { props.items.map((item, index) => {\n if (item.type === 'group-header') {\n return slots['group-header'] ? slots['group-header']({\n index,\n item,\n columns: columns.value,\n isExpanded,\n toggleExpand,\n isSelected,\n toggleSelect,\n toggleGroup,\n isGroupOpen,\n } as GroupHeaderSlot) : (\n <VDataTableGroupHeaderRow\n key={ `group-header_${item.id}` }\n item={ item }\n v-slots={ slots }\n />\n )\n }\n\n const slotProps = {\n index,\n item,\n columns: columns.value,\n isExpanded,\n toggleExpand,\n isSelected,\n toggleSelect,\n } as ItemSlot\n\n return (\n <>\n { slots.item ? slots.item(slotProps) : (\n <VDataTableRow\n key={ `item_${item.value}` }\n onClick={ (event: Event) => {\n if (expandOnClick.value) {\n toggleExpand(item)\n }\n\n emit('click:row', event, { item })\n }}\n index={ index }\n item={ item }\n v-slots={ slots }\n />\n )}\n\n { isExpanded(item) && slots['expanded-row']?.(slotProps) }\n </>\n )\n })}\n </>\n ))\n\n return {}\n },\n})\n\nexport type VDataTableRows = InstanceType<typeof VDataTableRows>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