@vuetify/nightly 3.6.14-master.2024-08-02 → 3.6.14-master.2024-08-03
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 +16 -16
- package/dist/json/importMap.json +128 -128
- package/dist/json/web-types.json +1 -1
- package/dist/vuetify-labs.css +3322 -3322
- package/dist/vuetify-labs.d.ts +4 -10
- package/dist/vuetify-labs.esm.js +5 -7
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +5 -7
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.css +2175 -2175
- package/dist/vuetify.d.ts +44 -44
- package/dist/vuetify.esm.js +4 -4
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +4 -4
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +4 -4
- package/dist/vuetify.min.js.map +1 -1
- package/lib/directives/click-outside/index.mjs +1 -1
- package/lib/directives/click-outside/index.mjs.map +1 -1
- package/lib/directives/index.d.mts +1 -1
- package/lib/entry-bundler.mjs +1 -1
- package/lib/framework.mjs +1 -1
- package/lib/index.d.mts +43 -43
- package/lib/labs/VTreeview/VTreeview.mjs +1 -3
- package/lib/labs/VTreeview/VTreeview.mjs.map +1 -1
- package/lib/labs/VTreeview/index.d.mts +3 -9
- package/lib/labs/components.d.mts +3 -9
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["attachedRoot","defaultConditional","checkEvent","e","el","binding","checkIsActive","root","ShadowRoot","host","target","elements","value","include","push","some","contains","isActive","closeConditional","directive","handler","_clickOutside","lastMousedownWasOutside","setTimeout","handleShadow","callback","document","ClickOutside","mounted","onClick","onMousedown","app","addEventListener","instance","$","uid","
|
1
|
+
{"version":3,"file":"index.mjs","names":["attachedRoot","defaultConditional","checkEvent","e","el","binding","checkIsActive","root","ShadowRoot","host","target","elements","value","include","push","some","contains","isActive","closeConditional","directive","handler","_clickOutside","lastMousedownWasOutside","setTimeout","handleShadow","callback","document","ClickOutside","mounted","onClick","onMousedown","app","addEventListener","instance","$","uid","beforeUnmount","removeEventListener"],"sources":["../../../src/directives/click-outside/index.ts"],"sourcesContent":["// Utilities\nimport { attachedRoot } from '@/util'\n\n// Types\nimport type { DirectiveBinding } from 'vue'\n\ninterface ClickOutsideBindingArgs {\n handler: (e: MouseEvent) => void\n closeConditional?: (e: Event) => boolean\n include?: () => HTMLElement[]\n}\n\ninterface ClickOutsideDirectiveBinding extends DirectiveBinding {\n value: ((e: MouseEvent) => void) | ClickOutsideBindingArgs\n}\n\nfunction defaultConditional () {\n return true\n}\n\nfunction checkEvent (e: MouseEvent, el: HTMLElement, binding: ClickOutsideDirectiveBinding): boolean {\n // The include element callbacks below can be expensive\n // so we should avoid calling them when we're not active.\n // Explicitly check for false to allow fallback compatibility\n // with non-toggleable components\n if (!e || checkIsActive(e, binding) === false) return false\n\n // If we're clicking inside the shadowroot, then the app root doesn't get the same\n // level of introspection as to _what_ we're clicking. We want to check to see if\n // our target is the shadowroot parent container, and if it is, ignore.\n const root = attachedRoot(el)\n if (\n typeof ShadowRoot !== 'undefined' &&\n root instanceof ShadowRoot &&\n root.host === e.target\n ) return false\n\n // Check if additional elements were passed to be included in check\n // (click must be outside all included elements, if any)\n const elements = ((typeof binding.value === 'object' && binding.value.include) || (() => []))()\n // Add the root element for the component this directive was defined on\n elements.push(el)\n\n // Check if it's a click outside our elements, and then if our callback returns true.\n // Non-toggleable components should take action in their callback and return falsy.\n // Toggleable can return true if it wants to deactivate.\n // Note that, because we're in the capture phase, this callback will occur before\n // the bubbling click event on any outside elements.\n return !elements.some(el => el?.contains(e.target as Node))\n}\n\nfunction checkIsActive (e: MouseEvent, binding: ClickOutsideDirectiveBinding): boolean | void {\n const isActive = (typeof binding.value === 'object' && binding.value.closeConditional) || defaultConditional\n\n return isActive(e)\n}\n\nfunction directive (e: MouseEvent, el: HTMLElement, binding: ClickOutsideDirectiveBinding) {\n const handler = typeof binding.value === 'function' ? binding.value : binding.value.handler\n\n el._clickOutside!.lastMousedownWasOutside && checkEvent(e, el, binding) && setTimeout(() => {\n checkIsActive(e, binding) && handler && handler(e)\n }, 0)\n}\n\nfunction handleShadow (el: HTMLElement, callback: Function): void {\n const root = attachedRoot(el)\n\n callback(document)\n\n if (typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot) {\n callback(root)\n }\n}\n\nexport const ClickOutside = {\n // [data-app] may not be found\n // if using bind, inserted makes\n // sure that the root element is\n // available, iOS does not support\n // clicks on body\n mounted (el: HTMLElement, binding: ClickOutsideDirectiveBinding) {\n const onClick = (e: Event) => directive(e as MouseEvent, el, binding)\n const onMousedown = (e: Event) => {\n el._clickOutside!.lastMousedownWasOutside = checkEvent(e as MouseEvent, el, binding)\n }\n\n handleShadow(el, (app: HTMLElement) => {\n app.addEventListener('click', onClick, true)\n app.addEventListener('mousedown', onMousedown, true)\n })\n\n if (!el._clickOutside) {\n el._clickOutside = {\n lastMousedownWasOutside: false,\n }\n }\n\n el._clickOutside[binding.instance!.$.uid] = {\n onClick,\n onMousedown,\n }\n },\n\n beforeUnmount (el: HTMLElement, binding: ClickOutsideDirectiveBinding) {\n if (!el._clickOutside) return\n\n handleShadow(el, (app: HTMLElement) => {\n if (!app || !el._clickOutside?.[binding.instance!.$.uid]) return\n\n const { onClick, onMousedown } = el._clickOutside[binding.instance!.$.uid]!\n\n app.removeEventListener('click', onClick, true)\n app.removeEventListener('mousedown', onMousedown, true)\n })\n\n delete el._clickOutside[binding.instance!.$.uid]\n },\n}\n\nexport default ClickOutside\n"],"mappings":"AAAA;AAAA,SACSA,YAAY,gCAErB;AAaA,SAASC,kBAAkBA,CAAA,EAAI;EAC7B,OAAO,IAAI;AACb;AAEA,SAASC,UAAUA,CAAEC,CAAa,EAAEC,EAAe,EAAEC,OAAqC,EAAW;EACnG;EACA;EACA;EACA;EACA,IAAI,CAACF,CAAC,IAA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iB,aAAa,EAAE;IAEvBG,YAAY,CAACpB,EAAE,EAAG2B,GAAgB,IAAK;MACrC,IAAI,CAACA,GAAG,IAAI,CAAC3B,EAAE,CAACiB,aAAa,GAAGhB,OAAO,CAAC4B,QAAQ,CAAEC,CAAC,CAACC,GAAG,CAAC,EAAE;MAE1D,MAAM;QAAEN,OAAO;QAAEC;MAAY,CAAC,GAAG1B,EAAE,CAACiB,aAAa,CAAChB,OAAO,CAAC4B,QAAQ,CAAEC,CAAC,CAACC,GAAG,CAAE;MAE3EJ,GAAG,CAACM,mBAAmB,CAAC,OAAO,EAAER,OAAO,EAAE,IAAI,CAAC;MAC/CE,GAAG,CAACM,mBAAmB,CAAC,WAAW,EAAEP,WAAW,EAAE,IAAI,CAAC;IACzD,CAAC,CAAC;IAEF,OAAO1B,EAAE,CAACiB,aAAa,CAAChB,OAAO,CAAC4B,QAAQ,CAAEC,CAAC,CAACC,GAAG,CAAC;EAClD;AACF,CAAC;AAED,eAAeR,YAAY","ignoreList":[]}
|
@@ -10,7 +10,7 @@ interface ClickOutsideDirectiveBinding extends DirectiveBinding {
|
|
10
10
|
}
|
11
11
|
declare const ClickOutside: {
|
12
12
|
mounted(el: HTMLElement, binding: ClickOutsideDirectiveBinding): void;
|
13
|
-
|
13
|
+
beforeUnmount(el: HTMLElement, binding: ClickOutsideDirectiveBinding): void;
|
14
14
|
};
|
15
15
|
|
16
16
|
type ObserveHandler = (isIntersecting: boolean, entries: IntersectionObserverEntry[], observer: IntersectionObserver) => void;
|
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.6.14-master.2024-08-
|
19
|
+
export const version = "3.6.14-master.2024-08-03";
|
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
@@ -464,42 +464,43 @@ declare global {
|
|
464
464
|
}
|
465
465
|
}
|
466
466
|
interface _GlobalComponents {
|
467
|
-
|
467
|
+
VAlert: typeof import('vuetify/components')['VAlert']
|
468
|
+
VAlertTitle: typeof import('vuetify/components')['VAlertTitle']
|
468
469
|
VAppBar: typeof import('vuetify/components')['VAppBar']
|
469
470
|
VAppBarNavIcon: typeof import('vuetify/components')['VAppBarNavIcon']
|
470
471
|
VAppBarTitle: typeof import('vuetify/components')['VAppBarTitle']
|
471
|
-
|
472
|
-
|
472
|
+
VApp: typeof import('vuetify/components')['VApp']
|
473
|
+
VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
|
473
474
|
VBanner: typeof import('vuetify/components')['VBanner']
|
474
475
|
VBannerActions: typeof import('vuetify/components')['VBannerActions']
|
475
476
|
VBannerText: typeof import('vuetify/components')['VBannerText']
|
476
|
-
VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
|
477
477
|
VAvatar: typeof import('vuetify/components')['VAvatar']
|
478
|
+
VBottomSheet: typeof import('vuetify/components')['VBottomSheet']
|
479
|
+
VBottomNavigation: typeof import('vuetify/components')['VBottomNavigation']
|
480
|
+
VBadge: typeof import('vuetify/components')['VBadge']
|
478
481
|
VBreadcrumbs: typeof import('vuetify/components')['VBreadcrumbs']
|
479
482
|
VBreadcrumbsItem: typeof import('vuetify/components')['VBreadcrumbsItem']
|
480
483
|
VBreadcrumbsDivider: typeof import('vuetify/components')['VBreadcrumbsDivider']
|
481
|
-
VBadge: typeof import('vuetify/components')['VBadge']
|
482
|
-
VBtn: typeof import('vuetify/components')['VBtn']
|
483
|
-
VBottomNavigation: typeof import('vuetify/components')['VBottomNavigation']
|
484
|
-
VBottomSheet: typeof import('vuetify/components')['VBottomSheet']
|
485
|
-
VBtnToggle: typeof import('vuetify/components')['VBtnToggle']
|
486
484
|
VBtnGroup: typeof import('vuetify/components')['VBtnGroup']
|
485
|
+
VBtn: typeof import('vuetify/components')['VBtn']
|
487
486
|
VCarousel: typeof import('vuetify/components')['VCarousel']
|
488
487
|
VCarouselItem: typeof import('vuetify/components')['VCarouselItem']
|
488
|
+
VBtnToggle: typeof import('vuetify/components')['VBtnToggle']
|
489
|
+
VChip: typeof import('vuetify/components')['VChip']
|
489
490
|
VCard: typeof import('vuetify/components')['VCard']
|
490
491
|
VCardActions: typeof import('vuetify/components')['VCardActions']
|
491
492
|
VCardItem: typeof import('vuetify/components')['VCardItem']
|
492
493
|
VCardSubtitle: typeof import('vuetify/components')['VCardSubtitle']
|
493
494
|
VCardText: typeof import('vuetify/components')['VCardText']
|
494
495
|
VCardTitle: typeof import('vuetify/components')['VCardTitle']
|
495
|
-
VChip: typeof import('vuetify/components')['VChip']
|
496
|
-
VChipGroup: typeof import('vuetify/components')['VChipGroup']
|
497
|
-
VCode: typeof import('vuetify/components')['VCode']
|
498
496
|
VCheckbox: typeof import('vuetify/components')['VCheckbox']
|
499
497
|
VCheckboxBtn: typeof import('vuetify/components')['VCheckboxBtn']
|
500
|
-
VCombobox: typeof import('vuetify/components')['VCombobox']
|
501
498
|
VColorPicker: typeof import('vuetify/components')['VColorPicker']
|
499
|
+
VChipGroup: typeof import('vuetify/components')['VChipGroup']
|
500
|
+
VCode: typeof import('vuetify/components')['VCode']
|
501
|
+
VCombobox: typeof import('vuetify/components')['VCombobox']
|
502
502
|
VCounter: typeof import('vuetify/components')['VCounter']
|
503
|
+
VDialog: typeof import('vuetify/components')['VDialog']
|
503
504
|
VDataTable: typeof import('vuetify/components')['VDataTable']
|
504
505
|
VDataTableHeaders: typeof import('vuetify/components')['VDataTableHeaders']
|
505
506
|
VDataTableFooter: typeof import('vuetify/components')['VDataTableFooter']
|
@@ -513,7 +514,6 @@ interface _GlobalComponents {
|
|
513
514
|
VDatePickerMonth: typeof import('vuetify/components')['VDatePickerMonth']
|
514
515
|
VDatePickerMonths: typeof import('vuetify/components')['VDatePickerMonths']
|
515
516
|
VDatePickerYears: typeof import('vuetify/components')['VDatePickerYears']
|
516
|
-
VDialog: typeof import('vuetify/components')['VDialog']
|
517
517
|
VEmptyState: typeof import('vuetify/components')['VEmptyState']
|
518
518
|
VDivider: typeof import('vuetify/components')['VDivider']
|
519
519
|
VExpansionPanels: typeof import('vuetify/components')['VExpansionPanels']
|
@@ -521,21 +521,24 @@ interface _GlobalComponents {
|
|
521
521
|
VExpansionPanelText: typeof import('vuetify/components')['VExpansionPanelText']
|
522
522
|
VExpansionPanelTitle: typeof import('vuetify/components')['VExpansionPanelTitle']
|
523
523
|
VFab: typeof import('vuetify/components')['VFab']
|
524
|
-
|
524
|
+
VFooter: typeof import('vuetify/components')['VFooter']
|
525
525
|
VField: typeof import('vuetify/components')['VField']
|
526
526
|
VFieldLabel: typeof import('vuetify/components')['VFieldLabel']
|
527
|
-
|
527
|
+
VFileInput: typeof import('vuetify/components')['VFileInput']
|
528
528
|
VIcon: typeof import('vuetify/components')['VIcon']
|
529
529
|
VComponentIcon: typeof import('vuetify/components')['VComponentIcon']
|
530
530
|
VSvgIcon: typeof import('vuetify/components')['VSvgIcon']
|
531
531
|
VLigatureIcon: typeof import('vuetify/components')['VLigatureIcon']
|
532
532
|
VClassIcon: typeof import('vuetify/components')['VClassIcon']
|
533
|
-
VImg: typeof import('vuetify/components')['VImg']
|
534
|
-
VInfiniteScroll: typeof import('vuetify/components')['VInfiniteScroll']
|
535
533
|
VItemGroup: typeof import('vuetify/components')['VItemGroup']
|
536
534
|
VItem: typeof import('vuetify/components')['VItem']
|
537
|
-
|
535
|
+
VImg: typeof import('vuetify/components')['VImg']
|
536
|
+
VInfiniteScroll: typeof import('vuetify/components')['VInfiniteScroll']
|
537
|
+
VKbd: typeof import('vuetify/components')['VKbd']
|
538
538
|
VLabel: typeof import('vuetify/components')['VLabel']
|
539
|
+
VMain: typeof import('vuetify/components')['VMain']
|
540
|
+
VInput: typeof import('vuetify/components')['VInput']
|
541
|
+
VMessages: typeof import('vuetify/components')['VMessages']
|
539
542
|
VList: typeof import('vuetify/components')['VList']
|
540
543
|
VListGroup: typeof import('vuetify/components')['VListGroup']
|
541
544
|
VListImg: typeof import('vuetify/components')['VListImg']
|
@@ -545,53 +548,56 @@ interface _GlobalComponents {
|
|
545
548
|
VListItemSubtitle: typeof import('vuetify/components')['VListItemSubtitle']
|
546
549
|
VListItemTitle: typeof import('vuetify/components')['VListItemTitle']
|
547
550
|
VListSubheader: typeof import('vuetify/components')['VListSubheader']
|
548
|
-
VKbd: typeof import('vuetify/components')['VKbd']
|
549
|
-
VMain: typeof import('vuetify/components')['VMain']
|
550
551
|
VMenu: typeof import('vuetify/components')['VMenu']
|
551
|
-
VMessages: typeof import('vuetify/components')['VMessages']
|
552
552
|
VNavigationDrawer: typeof import('vuetify/components')['VNavigationDrawer']
|
553
553
|
VOtpInput: typeof import('vuetify/components')['VOtpInput']
|
554
554
|
VOverlay: typeof import('vuetify/components')['VOverlay']
|
555
555
|
VPagination: typeof import('vuetify/components')['VPagination']
|
556
|
-
VProgressCircular: typeof import('vuetify/components')['VProgressCircular']
|
557
556
|
VProgressLinear: typeof import('vuetify/components')['VProgressLinear']
|
558
|
-
|
557
|
+
VProgressCircular: typeof import('vuetify/components')['VProgressCircular']
|
559
558
|
VRating: typeof import('vuetify/components')['VRating']
|
559
|
+
VRadioGroup: typeof import('vuetify/components')['VRadioGroup']
|
560
560
|
VSelect: typeof import('vuetify/components')['VSelect']
|
561
|
-
VSheet: typeof import('vuetify/components')['VSheet']
|
562
|
-
VSelectionControlGroup: typeof import('vuetify/components')['VSelectionControlGroup']
|
563
561
|
VSelectionControl: typeof import('vuetify/components')['VSelectionControl']
|
562
|
+
VSheet: typeof import('vuetify/components')['VSheet']
|
564
563
|
VSlider: typeof import('vuetify/components')['VSlider']
|
564
|
+
VSelectionControlGroup: typeof import('vuetify/components')['VSelectionControlGroup']
|
565
565
|
VSkeletonLoader: typeof import('vuetify/components')['VSkeletonLoader']
|
566
566
|
VSlideGroup: typeof import('vuetify/components')['VSlideGroup']
|
567
567
|
VSlideGroupItem: typeof import('vuetify/components')['VSlideGroupItem']
|
568
|
+
VSwitch: typeof import('vuetify/components')['VSwitch']
|
568
569
|
VSnackbar: typeof import('vuetify/components')['VSnackbar']
|
569
570
|
VSystemBar: typeof import('vuetify/components')['VSystemBar']
|
570
|
-
|
571
|
+
VStepper: typeof import('vuetify/components')['VStepper']
|
572
|
+
VStepperActions: typeof import('vuetify/components')['VStepperActions']
|
573
|
+
VStepperHeader: typeof import('vuetify/components')['VStepperHeader']
|
574
|
+
VStepperItem: typeof import('vuetify/components')['VStepperItem']
|
575
|
+
VStepperWindow: typeof import('vuetify/components')['VStepperWindow']
|
576
|
+
VStepperWindowItem: typeof import('vuetify/components')['VStepperWindowItem']
|
577
|
+
VTextarea: typeof import('vuetify/components')['VTextarea']
|
571
578
|
VTab: typeof import('vuetify/components')['VTab']
|
572
579
|
VTabs: typeof import('vuetify/components')['VTabs']
|
573
580
|
VTabsWindow: typeof import('vuetify/components')['VTabsWindow']
|
574
581
|
VTabsWindowItem: typeof import('vuetify/components')['VTabsWindowItem']
|
575
|
-
VTextField: typeof import('vuetify/components')['VTextField']
|
576
582
|
VToolbar: typeof import('vuetify/components')['VToolbar']
|
577
583
|
VToolbarTitle: typeof import('vuetify/components')['VToolbarTitle']
|
578
584
|
VToolbarItems: typeof import('vuetify/components')['VToolbarItems']
|
579
|
-
|
580
|
-
VTextarea: typeof import('vuetify/components')['VTextarea']
|
581
|
-
VTooltip: typeof import('vuetify/components')['VTooltip']
|
585
|
+
VTextField: typeof import('vuetify/components')['VTextField']
|
582
586
|
VTimeline: typeof import('vuetify/components')['VTimeline']
|
583
587
|
VTimelineItem: typeof import('vuetify/components')['VTimelineItem']
|
588
|
+
VTable: typeof import('vuetify/components')['VTable']
|
589
|
+
VTooltip: typeof import('vuetify/components')['VTooltip']
|
584
590
|
VWindow: typeof import('vuetify/components')['VWindow']
|
585
591
|
VWindowItem: typeof import('vuetify/components')['VWindowItem']
|
586
592
|
VConfirmEdit: typeof import('vuetify/components')['VConfirmEdit']
|
587
593
|
VDataIterator: typeof import('vuetify/components')['VDataIterator']
|
588
594
|
VDefaultsProvider: typeof import('vuetify/components')['VDefaultsProvider']
|
589
595
|
VForm: typeof import('vuetify/components')['VForm']
|
596
|
+
VHover: typeof import('vuetify/components')['VHover']
|
590
597
|
VContainer: typeof import('vuetify/components')['VContainer']
|
591
598
|
VCol: typeof import('vuetify/components')['VCol']
|
592
599
|
VRow: typeof import('vuetify/components')['VRow']
|
593
600
|
VSpacer: typeof import('vuetify/components')['VSpacer']
|
594
|
-
VHover: typeof import('vuetify/components')['VHover']
|
595
601
|
VLayout: typeof import('vuetify/components')['VLayout']
|
596
602
|
VLayoutItem: typeof import('vuetify/components')['VLayoutItem']
|
597
603
|
VLazy: typeof import('vuetify/components')['VLazy']
|
@@ -604,8 +610,8 @@ interface _GlobalComponents {
|
|
604
610
|
VSparkline: typeof import('vuetify/components')['VSparkline']
|
605
611
|
VSpeedDial: typeof import('vuetify/components')['VSpeedDial']
|
606
612
|
VThemeProvider: typeof import('vuetify/components')['VThemeProvider']
|
607
|
-
VValidation: typeof import('vuetify/components')['VValidation']
|
608
613
|
VVirtualScroll: typeof import('vuetify/components')['VVirtualScroll']
|
614
|
+
VValidation: typeof import('vuetify/components')['VValidation']
|
609
615
|
VFabTransition: typeof import('vuetify/components')['VFabTransition']
|
610
616
|
VDialogBottomTransition: typeof import('vuetify/components')['VDialogBottomTransition']
|
611
617
|
VDialogTopTransition: typeof import('vuetify/components')['VDialogTopTransition']
|
@@ -622,27 +628,21 @@ interface _GlobalComponents {
|
|
622
628
|
VExpandTransition: typeof import('vuetify/components')['VExpandTransition']
|
623
629
|
VExpandXTransition: typeof import('vuetify/components')['VExpandXTransition']
|
624
630
|
VDialogTransition: typeof import('vuetify/components')['VDialogTransition']
|
625
|
-
VStepper: typeof import('vuetify/components')['VStepper']
|
626
|
-
VStepperActions: typeof import('vuetify/components')['VStepperActions']
|
627
|
-
VStepperHeader: typeof import('vuetify/components')['VStepperHeader']
|
628
|
-
VStepperItem: typeof import('vuetify/components')['VStepperItem']
|
629
|
-
VStepperWindow: typeof import('vuetify/components')['VStepperWindow']
|
630
|
-
VStepperWindowItem: typeof import('vuetify/components')['VStepperWindowItem']
|
631
|
-
VNumberInput: typeof import('vuetify/labs/components')['VNumberInput']
|
632
631
|
VCalendar: typeof import('vuetify/labs/components')['VCalendar']
|
633
632
|
VCalendarDay: typeof import('vuetify/labs/components')['VCalendarDay']
|
634
633
|
VCalendarHeader: typeof import('vuetify/labs/components')['VCalendarHeader']
|
635
634
|
VCalendarInterval: typeof import('vuetify/labs/components')['VCalendarInterval']
|
636
635
|
VCalendarIntervalEvent: typeof import('vuetify/labs/components')['VCalendarIntervalEvent']
|
637
636
|
VCalendarMonthDay: typeof import('vuetify/labs/components')['VCalendarMonthDay']
|
637
|
+
VNumberInput: typeof import('vuetify/labs/components')['VNumberInput']
|
638
|
+
VTimePicker: typeof import('vuetify/labs/components')['VTimePicker']
|
639
|
+
VTimePickerClock: typeof import('vuetify/labs/components')['VTimePickerClock']
|
640
|
+
VTimePickerControls: typeof import('vuetify/labs/components')['VTimePickerControls']
|
638
641
|
VStepperVertical: typeof import('vuetify/labs/components')['VStepperVertical']
|
639
642
|
VStepperVerticalItem: typeof import('vuetify/labs/components')['VStepperVerticalItem']
|
640
643
|
VStepperVerticalActions: typeof import('vuetify/labs/components')['VStepperVerticalActions']
|
641
644
|
VPicker: typeof import('vuetify/labs/components')['VPicker']
|
642
645
|
VPickerTitle: typeof import('vuetify/labs/components')['VPickerTitle']
|
643
|
-
VTimePicker: typeof import('vuetify/labs/components')['VTimePicker']
|
644
|
-
VTimePickerClock: typeof import('vuetify/labs/components')['VTimePickerClock']
|
645
|
-
VTimePickerControls: typeof import('vuetify/labs/components')['VTimePickerControls']
|
646
646
|
VTreeview: typeof import('vuetify/labs/components')['VTreeview']
|
647
647
|
VTreeviewItem: typeof import('vuetify/labs/components')['VTreeviewItem']
|
648
648
|
VTreeviewGroup: typeof import('vuetify/labs/components')['VTreeviewGroup']
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"VTreeview.mjs","names":["makeVTreeviewChildrenProps","VTreeviewChildren","makeVListProps","useListItems","VList","provideDefaults","makeFilterProps","useFilter","useProxiedModel","computed","provide","ref","toRef","genericComponent","omit","propsFactory","useRender","VTreeviewSymbol","flatten","items","flat","arguments","length","undefined","item","push","children","makeVTreeviewProps","openAll","Boolean","search","String","filterKeys","collapseIcon","expandIcon","slim","VTreeview","name","props","emits","val","value","setup","_ref","slots","activeColor","baseColor","color","activated","selected","vListRef","opened","flatItems","filteredItems","visibleIds","Set","flatMap","getPath","getChildren","id","path","parent","unshift","parents","get","arr","queue","slice","child","shift","ids","i","concat","VTreeviewGroup","VTreeviewItem","activeClass","density","disabled","lines","variant","listProps","filterProps","treeviewChildrenProps","_createVNode","_mergeProps","class","style","$event","default","open"],"sources":["../../../src/labs/VTreeview/VTreeview.tsx"],"sourcesContent":["// Components\nimport { makeVTreeviewChildrenProps, VTreeviewChildren } from './VTreeviewChildren'\nimport { makeVListProps, useListItems, VList } from '@/components/VList/VList'\n\n// Composables\nimport { provideDefaults } from '@/composables/defaults'\nimport { makeFilterProps, useFilter } from '@/composables/filter'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, provide, ref, toRef } from 'vue'\nimport { genericComponent, omit, propsFactory, useRender } from '@/util'\n\n// Types\nimport { VTreeviewSymbol } from './shared'\nimport type { VListChildrenSlots } from '@/components/VList/VListChildren'\nimport type { ListItem } from '@/composables/list-items'\nimport type { GenericProps } from '@/util'\n\nfunction flatten (items: ListItem[], flat: ListItem[] = []) {\n for (const item of items) {\n flat.push(item)\n if (item.children) flatten(item.children, flat)\n }\n return flat\n}\n\nexport const makeVTreeviewProps = propsFactory({\n openAll: Boolean,\n search: String,\n\n ...makeFilterProps({ filterKeys: ['title'] }),\n ...makeVTreeviewChildrenProps(),\n ...omit(makeVListProps({\n collapseIcon: '$treeviewCollapse',\n expandIcon: '$treeviewExpand',\n slim: true,\n }), ['nav']),\n}, 'VTreeview')\n\nexport const VTreeview = genericComponent<new <T>(\n props: {\n items?: T[]\n },\n slots: VListChildrenSlots<T>\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VTreeview',\n\n props: makeVTreeviewProps(),\n\n emits: {\n 'update:opened': (val: unknown) => true,\n 'update:activated': (val: unknown) => true,\n 'update:selected': (val: unknown) => true,\n 'click:open': (value: { id: unknown, value: boolean, path: unknown[] }) => true,\n 'click:select': (value: { id: unknown, value: boolean, path: unknown[] }) => true,\n },\n\n setup (props, { slots }) {\n const { items } = useListItems(props)\n const activeColor = toRef(props, 'activeColor')\n const baseColor = toRef(props, 'baseColor')\n const color = toRef(props, 'color')\n const activated = useProxiedModel(props, 'activated')\n const selected = useProxiedModel(props, 'selected')\n\n const vListRef = ref<VList>()\n\n const opened = computed(() => props.openAll ? openAll(items.value) : props.opened)\n const flatItems = computed(() => flatten(items.value))\n const search = toRef(props, 'search')\n const { filteredItems } = useFilter(props, flatItems, search)\n const visibleIds = computed(() => {\n if (!search.value) {\n return null\n }\n return new Set(filteredItems.value.flatMap(item => {\n return [...getPath(item.props.value), ...getChildren(item.props.value)]\n }))\n })\n\n function getPath (id: unknown) {\n const path: unknown[] = []\n let parent: unknown = id\n while (parent != null) {\n path.unshift(parent)\n parent = vListRef.value?.parents.get(parent)\n }\n return path\n }\n\n function getChildren (id: unknown) {\n const arr: unknown[] = []\n const queue = ((vListRef.value?.children.get(id) ?? []).slice())\n while (queue.length) {\n const child = queue.shift()\n if (!child) continue\n arr.push(child)\n queue.push(...((vListRef.value?.children.get(child) ?? []).slice()))\n }\n return arr\n }\n\n function openAll (item: any) {\n let ids: number[] = []\n\n for (const i of item) {\n if (!i.children) continue\n\n ids.push(i.value)\n\n if (i.children) {\n ids = ids.concat(openAll(i.children))\n }\n }\n\n return ids\n }\n\n provide(VTreeviewSymbol, { visibleIds })\n\n provideDefaults({\n VTreeviewGroup: {\n activeColor,\n baseColor,\n color,\n collapseIcon: toRef(props, 'collapseIcon'),\n expandIcon: toRef(props, 'expandIcon'),\n },\n VTreeviewItem: {\n activeClass: toRef(props, 'activeClass'),\n activeColor,\n baseColor,\n color,\n density: toRef(props, 'density'),\n disabled: toRef(props, 'disabled'),\n lines: toRef(props, 'lines'),\n variant: toRef(props, 'variant'),\n },\n })\n\n useRender(() => {\n const listProps = VList.filterProps(props)\n\n const treeviewChildrenProps = VTreeviewChildren.filterProps(props)\n\n return (\n <VList\n ref={ vListRef }\n { ...listProps }\n class={[\n 'v-treeview',\n props.class,\n ]}\n style={ props.style }\n opened={ opened.value }\n v-model:activated={ activated.value }\n v-model:selected={ selected.value }\n >\n <VTreeviewChildren\n { ...treeviewChildrenProps }\n items={ items.value }\n v-slots={ slots }\n ></VTreeviewChildren>\n </VList>\n )\n })\n\n return {\n open,\n }\n },\n})\n\nexport type VTreeview = InstanceType<typeof VTreeview>\n"],"mappings":";AAAA;AAAA,SACSA,0BAA0B,EAAEC,iBAAiB;AAAA,SAC7CC,cAAc,EAAEC,YAAY,EAAEC,KAAK,4CAE5C;AAAA,SACSC,eAAe;AAAA,SACfC,eAAe,EAAEC,SAAS;AAAA,SAC1BC,eAAe,8CAExB;AACA,SAASC,QAAQ,EAAEC,OAAO,EAAEC,GAAG,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAC1CC,gBAAgB,EAAEC,IAAI,EAAEC,YAAY,EAAEC,SAAS,gCAExD;AAAA,SACSC,eAAe;AAKxB,SAASC,OAAOA,CAAEC,KAAiB,EAAyB;EAAA,IAAvBC,IAAgB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EACxD,KAAK,MAAMG,IAAI,IAAIL,KAAK,EAAE;IACxBC,IAAI,CAACK,IAAI,CAACD,IAAI,CAAC;IACf,IAAIA,IAAI,CAACE,QAAQ,EAAER,OAAO,CAACM,IAAI,CAACE,QAAQ,EAAEN,IAAI,CAAC;EACjD;E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EAAE,aAAa,CAAC;QACxCO,WAAW;QACXC,SAAS;QACTC,KAAK;QACL6B,OAAO,EAAEhE,KAAK,CAAC0B,KAAK,EAAE,SAAS,CAAC;QAChCuC,QAAQ,EAAEjE,KAAK,CAAC0B,KAAK,EAAE,UAAU,CAAC;QAClCwC,KAAK,EAAElE,KAAK,CAAC0B,KAAK,EAAE,OAAO,CAAC;QAC5ByC,OAAO,EAAEnE,KAAK,CAAC0B,KAAK,EAAE,SAAS;MACjC;IACF,CAAC,CAAC;IAEFtB,SAAS,CAAC,MAAM;MACd,MAAMgE,SAAS,GAAG5E,KAAK,CAAC6E,WAAW,CAAC3C,KAAK,CAAC;MAE1C,MAAM4C,qBAAqB,GAAGjF,iBAAiB,CAACgF,WAAW,CAAC3C,KAAK,CAAC;MAElE,OAAA6C,YAAA,CAAA/E,KAAA,EAAAgF,WAAA;QAAA,OAEUlC;MAAQ,GACT8B,SAAS;QAAA,SACP,CACL,YAAY,EACZ1C,KAAK,CAAC+C,KAAK,CACZ;QAAA,SACO/C,KAAK,CAACgD,KAAK;QAAA,UACVnC,MAAM,CAACV,KAAK;QAAA,aACDO,SAAS,CAACP,KAAK;QAAA,sBAAA8C,MAAA,IAAfvC,SAAS,CAACP,KAAK,GAAA8C,MAAA;QAAA,YAChBtC,QAAQ,CAACR,KAAK;QAAA,qBAAA8C,MAAA,IAAdtC,QAAQ,CAACR,KAAK,GAAA8C;MAAA;QAAAC,OAAA,EAAAA,CAAA,MAAAL,YAAA,CAAAlF,iBAAA,EAAAmF,WAAA,CAG1BF,qBAAqB;UAAA,SAClB/D,KAAK,CAACsB;QAAK,IACTG,KAAK;MAAA;IAIvB,CAAC,CAAC;IAEF,OAAO;MACL6C;IACF,CAAC;EACH;AACF,CAAC,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"file":"VTreeview.mjs","names":["makeVTreeviewChildrenProps","VTreeviewChildren","makeVListProps","useListItems","VList","provideDefaults","makeFilterProps","useFilter","useProxiedModel","computed","provide","ref","toRef","genericComponent","omit","propsFactory","useRender","VTreeviewSymbol","flatten","items","flat","arguments","length","undefined","item","push","children","makeVTreeviewProps","openAll","Boolean","search","String","filterKeys","collapseIcon","expandIcon","slim","VTreeview","name","props","emits","val","value","setup","_ref","slots","activeColor","baseColor","color","activated","selected","vListRef","opened","flatItems","filteredItems","visibleIds","Set","flatMap","getPath","getChildren","id","path","parent","unshift","parents","get","arr","queue","slice","child","shift","ids","i","concat","VTreeviewGroup","VTreeviewItem","activeClass","density","disabled","lines","variant","listProps","filterProps","treeviewChildrenProps","_createVNode","_mergeProps","class","style","$event","default"],"sources":["../../../src/labs/VTreeview/VTreeview.tsx"],"sourcesContent":["// Components\nimport { makeVTreeviewChildrenProps, VTreeviewChildren } from './VTreeviewChildren'\nimport { makeVListProps, useListItems, VList } from '@/components/VList/VList'\n\n// Composables\nimport { provideDefaults } from '@/composables/defaults'\nimport { makeFilterProps, useFilter } from '@/composables/filter'\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed, provide, ref, toRef } from 'vue'\nimport { genericComponent, omit, propsFactory, useRender } from '@/util'\n\n// Types\nimport { VTreeviewSymbol } from './shared'\nimport type { VListChildrenSlots } from '@/components/VList/VListChildren'\nimport type { ListItem } from '@/composables/list-items'\nimport type { GenericProps } from '@/util'\n\nfunction flatten (items: ListItem[], flat: ListItem[] = []) {\n for (const item of items) {\n flat.push(item)\n if (item.children) flatten(item.children, flat)\n }\n return flat\n}\n\nexport const makeVTreeviewProps = propsFactory({\n openAll: Boolean,\n search: String,\n\n ...makeFilterProps({ filterKeys: ['title'] }),\n ...makeVTreeviewChildrenProps(),\n ...omit(makeVListProps({\n collapseIcon: '$treeviewCollapse',\n expandIcon: '$treeviewExpand',\n slim: true,\n }), ['nav']),\n}, 'VTreeview')\n\nexport const VTreeview = genericComponent<new <T>(\n props: {\n items?: T[]\n },\n slots: VListChildrenSlots<T>\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VTreeview',\n\n props: makeVTreeviewProps(),\n\n emits: {\n 'update:opened': (val: unknown) => true,\n 'update:activated': (val: unknown) => true,\n 'update:selected': (val: unknown) => true,\n 'click:open': (value: { id: unknown, value: boolean, path: unknown[] }) => true,\n 'click:select': (value: { id: unknown, value: boolean, path: unknown[] }) => true,\n },\n\n setup (props, { slots }) {\n const { items } = useListItems(props)\n const activeColor = toRef(props, 'activeColor')\n const baseColor = toRef(props, 'baseColor')\n const color = toRef(props, 'color')\n const activated = useProxiedModel(props, 'activated')\n const selected = useProxiedModel(props, 'selected')\n\n const vListRef = ref<VList>()\n\n const opened = computed(() => props.openAll ? openAll(items.value) : props.opened)\n const flatItems = computed(() => flatten(items.value))\n const search = toRef(props, 'search')\n const { filteredItems } = useFilter(props, flatItems, search)\n const visibleIds = computed(() => {\n if (!search.value) {\n return null\n }\n return new Set(filteredItems.value.flatMap(item => {\n return [...getPath(item.props.value), ...getChildren(item.props.value)]\n }))\n })\n\n function getPath (id: unknown) {\n const path: unknown[] = []\n let parent: unknown = id\n while (parent != null) {\n path.unshift(parent)\n parent = vListRef.value?.parents.get(parent)\n }\n return path\n }\n\n function getChildren (id: unknown) {\n const arr: unknown[] = []\n const queue = ((vListRef.value?.children.get(id) ?? []).slice())\n while (queue.length) {\n const child = queue.shift()\n if (!child) continue\n arr.push(child)\n queue.push(...((vListRef.value?.children.get(child) ?? []).slice()))\n }\n return arr\n }\n\n function openAll (item: any) {\n let ids: number[] = []\n\n for (const i of item) {\n if (!i.children) continue\n\n ids.push(i.value)\n\n if (i.children) {\n ids = ids.concat(openAll(i.children))\n }\n }\n\n return ids\n }\n\n provide(VTreeviewSymbol, { visibleIds })\n\n provideDefaults({\n VTreeviewGroup: {\n activeColor,\n baseColor,\n color,\n collapseIcon: toRef(props, 'collapseIcon'),\n expandIcon: toRef(props, 'expandIcon'),\n },\n VTreeviewItem: {\n activeClass: toRef(props, 'activeClass'),\n activeColor,\n baseColor,\n color,\n density: toRef(props, 'density'),\n disabled: toRef(props, 'disabled'),\n lines: toRef(props, 'lines'),\n variant: toRef(props, 'variant'),\n },\n })\n\n useRender(() => {\n const listProps = VList.filterProps(props)\n\n const treeviewChildrenProps = VTreeviewChildren.filterProps(props)\n\n return (\n <VList\n ref={ vListRef }\n { ...listProps }\n class={[\n 'v-treeview',\n props.class,\n ]}\n style={ props.style }\n opened={ opened.value }\n v-model:activated={ activated.value }\n v-model:selected={ selected.value }\n >\n <VTreeviewChildren\n { ...treeviewChildrenProps }\n items={ items.value }\n v-slots={ slots }\n ></VTreeviewChildren>\n </VList>\n )\n })\n\n return { }\n },\n})\n\nexport type VTreeview = InstanceType<typeof VTreeview>\n"],"mappings":";AAAA;AAAA,SACSA,0BAA0B,EAAEC,iBAAiB;AAAA,SAC7CC,cAAc,EAAEC,YAAY,EAAEC,KAAK,4CAE5C;AAAA,SACSC,eAAe;AAAA,SACfC,eAAe,EAAEC,SAAS;AAAA,SAC1BC,eAAe,8CAExB;AACA,SAASC,QAAQ,EAAEC,OAAO,EAAEC,GAAG,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAC1CC,gBAAgB,EAAEC,IAAI,EAAEC,YAAY,EAAEC,SAAS,gCAExD;AAAA,SACSC,eAAe;AAKxB,SAASC,OAAOA,CAAEC,KAAiB,EAAyB;EAAA,IAAvBC,IAAgB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EACxD,KAAK,MAAMG,IAAI,IAAIL,KAAK,EAAE;IACxBC,IAAI,CAACK,IAAI,CAACD,IAAI,CAAC;IACf,IAAIA,IAAI,CAACE,QAAQ,EAAER,OAAO,CAACM,IAAI,CAACE,QAAQ,EAAEN,IAAI,CAAC;EACjD;EACA,OAAOA,IAAI;AACb;AAEA,OAAO,MAAMO,kBAAkB,GAAGZ,YAAY,CAAC;EAC7Ca,OAAO,EAAEC,OAAO;EAChBC,MAAM,EAAEC,MAAM;EAEd,GAAGzB,eAAe,CAAC;IAAE0B,UAAU,E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AAU,CAAC;QAClCwC,KAAK,EAAElE,KAAK,CAAC0B,KAAK,EAAE,OAAO,CAAC;QAC5ByC,OAAO,EAAEnE,KAAK,CAAC0B,KAAK,EAAE,SAAS;MACjC;IACF,CAAC,CAAC;IAEFtB,SAAS,CAAC,MAAM;MACd,MAAMgE,SAAS,GAAG5E,KAAK,CAAC6E,WAAW,CAAC3C,KAAK,CAAC;MAE1C,MAAM4C,qBAAqB,GAAGjF,iBAAiB,CAACgF,WAAW,CAAC3C,KAAK,CAAC;MAElE,OAAA6C,YAAA,CAAA/E,KAAA,EAAAgF,WAAA;QAAA,OAEUlC;MAAQ,GACT8B,SAAS;QAAA,SACP,CACL,YAAY,EACZ1C,KAAK,CAAC+C,KAAK,CACZ;QAAA,SACO/C,KAAK,CAACgD,KAAK;QAAA,UACVnC,MAAM,CAACV,KAAK;QAAA,aACDO,SAAS,CAACP,KAAK;QAAA,sBAAA8C,MAAA,IAAfvC,SAAS,CAACP,KAAK,GAAA8C,MAAA;QAAA,YAChBtC,QAAQ,CAACR,KAAK;QAAA,qBAAA8C,MAAA,IAAdtC,QAAQ,CAACR,KAAK,GAAA8C;MAAA;QAAAC,OAAA,EAAAA,CAAA,MAAAL,YAAA,CAAAlF,iBAAA,EAAAmF,WAAA,CAG1BF,qBAAqB;UAAA,SAClB/D,KAAK,CAACsB;QAAK,IACTG,KAAK;MAAA;IAIvB,CAAC,CAAC;IAEF,OAAO,CAAE,CAAC;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
|
@@ -247,9 +247,7 @@ declare const VTreeview: {
|
|
247
247
|
value: boolean;
|
248
248
|
path: unknown[];
|
249
249
|
}) => any) | undefined;
|
250
|
-
}, {
|
251
|
-
open: typeof open;
|
252
|
-
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
|
250
|
+
}, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
|
253
251
|
'update:opened': (val: unknown) => boolean;
|
254
252
|
'update:activated': (val: unknown) => boolean;
|
255
253
|
'update:selected': (val: unknown) => boolean;
|
@@ -515,9 +513,7 @@ declare const VTreeview: {
|
|
515
513
|
value: boolean;
|
516
514
|
path: unknown[];
|
517
515
|
}) => any) | undefined;
|
518
|
-
}, {
|
519
|
-
open: typeof open;
|
520
|
-
}, {}, {}, {}, {
|
516
|
+
}, {}, {}, {}, {}, {
|
521
517
|
variant: NonNullable<"flat" | "text" | "elevated" | "tonal" | "outlined" | "plain">;
|
522
518
|
style: vue.StyleValue;
|
523
519
|
disabled: boolean;
|
@@ -628,9 +624,7 @@ declare const VTreeview: {
|
|
628
624
|
value: boolean;
|
629
625
|
path: unknown[];
|
630
626
|
}) => any) | undefined;
|
631
|
-
}, {
|
632
|
-
open: typeof open;
|
633
|
-
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
|
627
|
+
}, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
|
634
628
|
'update:opened': (val: unknown) => boolean;
|
635
629
|
'update:activated': (val: unknown) => boolean;
|
636
630
|
'update:selected': (val: unknown) => boolean;
|
@@ -9839,9 +9839,7 @@ declare const VTreeview: {
|
|
9839
9839
|
value: boolean;
|
9840
9840
|
path: unknown[];
|
9841
9841
|
}) => any) | undefined;
|
9842
|
-
}, {
|
9843
|
-
open: typeof open;
|
9844
|
-
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
|
9842
|
+
}, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
|
9845
9843
|
'update:opened': (val: unknown) => boolean;
|
9846
9844
|
'update:activated': (val: unknown) => boolean;
|
9847
9845
|
'update:selected': (val: unknown) => boolean;
|
@@ -10107,9 +10105,7 @@ declare const VTreeview: {
|
|
10107
10105
|
value: boolean;
|
10108
10106
|
path: unknown[];
|
10109
10107
|
}) => any) | undefined;
|
10110
|
-
}, {
|
10111
|
-
open: typeof open;
|
10112
|
-
}, {}, {}, {}, {
|
10108
|
+
}, {}, {}, {}, {}, {
|
10113
10109
|
variant: NonNullable<"flat" | "text" | "elevated" | "tonal" | "outlined" | "plain">;
|
10114
10110
|
style: vue.StyleValue;
|
10115
10111
|
disabled: boolean;
|
@@ -10220,9 +10216,7 @@ declare const VTreeview: {
|
|
10220
10216
|
value: boolean;
|
10221
10217
|
path: unknown[];
|
10222
10218
|
}) => any) | undefined;
|
10223
|
-
}, {
|
10224
|
-
open: typeof open;
|
10225
|
-
}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
|
10219
|
+
}, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
|
10226
10220
|
'update:opened': (val: unknown) => boolean;
|
10227
10221
|
'update:activated': (val: unknown) => boolean;
|
10228
10222
|
'update:selected': (val: unknown) => boolean;
|
package/package.json
CHANGED