vuetify 3.5.8 → 3.5.9

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.
Files changed (81) hide show
  1. package/dist/json/attributes.json +419 -7
  2. package/dist/json/importMap-labs.json +20 -8
  3. package/dist/json/importMap.json +150 -150
  4. package/dist/json/tags.json +118 -0
  5. package/dist/json/web-types.json +1315 -8
  6. package/dist/vuetify-labs.css +1437 -1420
  7. package/dist/vuetify-labs.d.ts +3021 -692
  8. package/dist/vuetify-labs.esm.js +790 -230
  9. package/dist/vuetify-labs.esm.js.map +1 -1
  10. package/dist/vuetify-labs.js +790 -230
  11. package/dist/vuetify-labs.min.css +2 -2
  12. package/dist/vuetify.css +592 -591
  13. package/dist/vuetify.d.ts +569 -68
  14. package/dist/vuetify.esm.js +220 -20
  15. package/dist/vuetify.esm.js.map +1 -1
  16. package/dist/vuetify.js +220 -20
  17. package/dist/vuetify.js.map +1 -1
  18. package/dist/vuetify.min.css +2 -2
  19. package/dist/vuetify.min.js +486 -466
  20. package/dist/vuetify.min.js.map +1 -1
  21. package/lib/components/VAutocomplete/VAutocomplete.mjs +5 -3
  22. package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
  23. package/lib/components/VAutocomplete/index.d.mts +138 -6
  24. package/lib/components/VColorPicker/VColorPickerPreview.css +1 -0
  25. package/lib/components/VColorPicker/VColorPickerPreview.sass +1 -0
  26. package/lib/components/VColorPicker/_variables.scss +1 -0
  27. package/lib/components/VCombobox/VCombobox.mjs +5 -3
  28. package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
  29. package/lib/components/VCombobox/index.d.mts +138 -6
  30. package/lib/components/VDatePicker/VDatePickerControls.mjs +1 -0
  31. package/lib/components/VDatePicker/VDatePickerControls.mjs.map +1 -1
  32. package/lib/components/VList/VList.mjs +8 -2
  33. package/lib/components/VList/VList.mjs.map +1 -1
  34. package/lib/components/VList/VListGroup.mjs +3 -1
  35. package/lib/components/VList/VListGroup.mjs.map +1 -1
  36. package/lib/components/VList/VListItem.mjs +17 -4
  37. package/lib/components/VList/VListItem.mjs.map +1 -1
  38. package/lib/components/VList/index.d.mts +108 -6
  39. package/lib/components/VSelect/VSelect.mjs +5 -3
  40. package/lib/components/VSelect/VSelect.mjs.map +1 -1
  41. package/lib/components/VSelect/index.d.mts +138 -6
  42. package/lib/components/index.d.mts +522 -24
  43. package/lib/composables/nested/activeStrategies.mjs +121 -0
  44. package/lib/composables/nested/activeStrategies.mjs.map +1 -0
  45. package/lib/composables/nested/nested.mjs +50 -1
  46. package/lib/composables/nested/nested.mjs.map +1 -1
  47. package/lib/composables/nested/selectStrategies.mjs +4 -2
  48. package/lib/composables/nested/selectStrategies.mjs.map +1 -1
  49. package/lib/entry-bundler.mjs +1 -1
  50. package/lib/framework.mjs +1 -1
  51. package/lib/iconsets/fa.mjs +2 -0
  52. package/lib/iconsets/fa.mjs.map +1 -1
  53. package/lib/iconsets/fa4.mjs +2 -0
  54. package/lib/iconsets/fa4.mjs.map +1 -1
  55. package/lib/iconsets/md.mjs +2 -0
  56. package/lib/iconsets/md.mjs.map +1 -1
  57. package/lib/iconsets/mdi-svg.mjs +2 -0
  58. package/lib/iconsets/mdi-svg.mjs.map +1 -1
  59. package/lib/iconsets/mdi.mjs +2 -0
  60. package/lib/iconsets/mdi.mjs.map +1 -1
  61. package/lib/index.d.mts +47 -44
  62. package/lib/labs/VTreeview/VTreeview.mjs +154 -0
  63. package/lib/labs/VTreeview/VTreeview.mjs.map +1 -0
  64. package/lib/labs/VTreeview/VTreeviewChildren.mjs +98 -0
  65. package/lib/labs/VTreeview/VTreeviewChildren.mjs.map +1 -0
  66. package/lib/labs/VTreeview/VTreeviewGroup.mjs +48 -0
  67. package/lib/labs/VTreeview/VTreeviewGroup.mjs.map +1 -0
  68. package/lib/labs/VTreeview/VTreeviewItem.css +17 -0
  69. package/lib/labs/VTreeview/VTreeviewItem.mjs +86 -0
  70. package/lib/labs/VTreeview/VTreeviewItem.mjs.map +1 -0
  71. package/lib/labs/VTreeview/VTreeviewItem.sass +19 -0
  72. package/lib/labs/VTreeview/index.d.mts +1975 -0
  73. package/lib/labs/VTreeview/index.mjs +4 -0
  74. package/lib/labs/VTreeview/index.mjs.map +1 -0
  75. package/lib/labs/VTreeview/shared.mjs +4 -0
  76. package/lib/labs/VTreeview/shared.mjs.map +1 -0
  77. package/lib/labs/VTreeview/variables.scss +8 -0
  78. package/lib/labs/components.d.mts +3708 -1773
  79. package/lib/labs/components.mjs +3 -2
  80. package/lib/labs/components.mjs.map +1 -1
  81. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"mdi.mjs","names":["VClassIcon","h","aliases","collapse","complete","cancel","close","delete","clear","success","info","warning","error","prev","next","checkboxOn","checkboxOff","checkboxIndeterminate","delimiter","sortAsc","sortDesc","expand","menu","subgroup","dropdown","radioOn","radioOff","edit","ratingEmpty","ratingFull","ratingHalf","loading","first","last","unfold","file","plus","minus","calendar","eyeDropper","mdi","component","props","class"],"sources":["../../src/iconsets/mdi.ts"],"sourcesContent":["// Composables\nimport { VClassIcon } from '@/composables/icons'\n\n// Utilities\nimport { h } from 'vue'\n\n// Types\nimport type { IconAliases, IconSet } from '@/composables/icons'\n\nconst aliases: IconAliases = {\n collapse: 'mdi-chevron-up',\n complete: 'mdi-check',\n cancel: 'mdi-close-circle',\n close: 'mdi-close',\n delete: 'mdi-close-circle', // delete (e.g. v-chip close)\n clear: 'mdi-close-circle',\n success: 'mdi-check-circle',\n info: 'mdi-information',\n warning: 'mdi-alert-circle',\n error: 'mdi-close-circle',\n prev: 'mdi-chevron-left',\n next: 'mdi-chevron-right',\n checkboxOn: 'mdi-checkbox-marked',\n checkboxOff: 'mdi-checkbox-blank-outline',\n checkboxIndeterminate: 'mdi-minus-box',\n delimiter: 'mdi-circle', // for carousel\n sortAsc: 'mdi-arrow-up',\n sortDesc: 'mdi-arrow-down',\n expand: 'mdi-chevron-down',\n menu: 'mdi-menu',\n subgroup: 'mdi-menu-down',\n dropdown: 'mdi-menu-down',\n radioOn: 'mdi-radiobox-marked',\n radioOff: 'mdi-radiobox-blank',\n edit: 'mdi-pencil',\n ratingEmpty: 'mdi-star-outline',\n ratingFull: 'mdi-star',\n ratingHalf: 'mdi-star-half-full',\n loading: 'mdi-cached',\n first: 'mdi-page-first',\n last: 'mdi-page-last',\n unfold: 'mdi-unfold-more-horizontal',\n file: 'mdi-paperclip',\n plus: 'mdi-plus',\n minus: 'mdi-minus',\n calendar: 'mdi-calendar',\n eyeDropper: 'mdi-eyedropper',\n}\n\nconst mdi: IconSet = {\n // Not using mergeProps here, functional components merge props by default (?)\n component: (props: any) => h(VClassIcon, { ...props, class: 'mdi' }),\n}\n\nexport { aliases, mdi }\n"],"mappings":"AAAA;AAAA,SACSA,UAAU,oCAEnB;AACA,SAASC,CAAC,QAAQ,KAAK;;AAEvB;;AAGA,MAAMC,OAAoB,GAAG;EAC3BC,QAAQ,EAAE,gBAAgB;EAC1BC,QAAQ,EAAE,WAAW;EACrBC,MAAM,EAAE,kBAAkB;EAC1BC,KAAK,EAAE,WAAW;EAClBC,MAAM,EAAE,kBAAkB;EAAE;EAC5BC,KAAK,EAAE,kBAAkB;EACzBC,OAAO,EAAE,kBAAkB;EAC3BC,IAAI,EAAE,iBAAiB;EACvBC,OAAO,EAAE,kBAAkB;EAC3BC,KAAK,EAAE,kBAAkB;EACzBC,IAAI,EAAE,kBAAkB;EACxBC,IAAI,EAAE,mBAAmB;EACzBC,UAAU,EAAE,qBAAqB;EACjCC,WAAW,EAAE,4BAA4B;EACzCC,qBAAqB,EAAE,eAAe;EACtCC,SAAS,EAAE,YAAY;EAAE;EACzBC,OAAO,EAAE,cAAc;EACvBC,QAAQ,EAAE,gBAAgB;EAC1BC,MAAM,EAAE,kBAAkB;EAC1BC,IAAI,EAAE,UAAU;EAChBC,QAAQ,EAAE,eAAe;EACzBC,QAAQ,EAAE,eAAe;EACzBC,OAAO,EAAE,qBAAqB;EAC9BC,QAAQ,EAAE,oBAAoB;EAC9BC,IAAI,EAAE,YAAY;EAClBC,WAAW,EAAE,kBAAkB;EAC/BC,UAAU,EAAE,UAAU;EACtBC,UAAU,EAAE,oBAAoB;EAChCC,OAAO,EAAE,YAAY;EACrBC,KAAK,EAAE,gBAAgB;EACvBC,IAAI,EAAE,eAAe;EACrBC,MAAM,EAAE,4BAA4B;EACpCC,IAAI,EAAE,eAAe;EACrBC,IAAI,EAAE,UAAU;EAChBC,KAAK,EAAE,WAAW;EAClBC,QAAQ,EAAE,cAAc;EACxBC,UAAU,EAAE;AACd,CAAC;AAED,MAAMC,GAAY,GAAG;EACnB;EACAC,SAAS,EAAGC,KAAU,IAAKzC,CAAC,CAACD,UAAU,EAAE;IAAE,GAAG0C,KAAK;IAAEC,KAAK,EAAE;EAAM,CAAC;AACrE,CAAC;AAED,SAASzC,OAAO,EAAEsC,GAAG"}
1
+ {"version":3,"file":"mdi.mjs","names":["VClassIcon","h","aliases","collapse","complete","cancel","close","delete","clear","success","info","warning","error","prev","next","checkboxOn","checkboxOff","checkboxIndeterminate","delimiter","sortAsc","sortDesc","expand","menu","subgroup","dropdown","radioOn","radioOff","edit","ratingEmpty","ratingFull","ratingHalf","loading","first","last","unfold","file","plus","minus","calendar","treeviewCollapse","treeviewExpand","eyeDropper","mdi","component","props","class"],"sources":["../../src/iconsets/mdi.ts"],"sourcesContent":["// Composables\nimport { VClassIcon } from '@/composables/icons'\n\n// Utilities\nimport { h } from 'vue'\n\n// Types\nimport type { IconAliases, IconSet } from '@/composables/icons'\n\nconst aliases: IconAliases = {\n collapse: 'mdi-chevron-up',\n complete: 'mdi-check',\n cancel: 'mdi-close-circle',\n close: 'mdi-close',\n delete: 'mdi-close-circle', // delete (e.g. v-chip close)\n clear: 'mdi-close-circle',\n success: 'mdi-check-circle',\n info: 'mdi-information',\n warning: 'mdi-alert-circle',\n error: 'mdi-close-circle',\n prev: 'mdi-chevron-left',\n next: 'mdi-chevron-right',\n checkboxOn: 'mdi-checkbox-marked',\n checkboxOff: 'mdi-checkbox-blank-outline',\n checkboxIndeterminate: 'mdi-minus-box',\n delimiter: 'mdi-circle', // for carousel\n sortAsc: 'mdi-arrow-up',\n sortDesc: 'mdi-arrow-down',\n expand: 'mdi-chevron-down',\n menu: 'mdi-menu',\n subgroup: 'mdi-menu-down',\n dropdown: 'mdi-menu-down',\n radioOn: 'mdi-radiobox-marked',\n radioOff: 'mdi-radiobox-blank',\n edit: 'mdi-pencil',\n ratingEmpty: 'mdi-star-outline',\n ratingFull: 'mdi-star',\n ratingHalf: 'mdi-star-half-full',\n loading: 'mdi-cached',\n first: 'mdi-page-first',\n last: 'mdi-page-last',\n unfold: 'mdi-unfold-more-horizontal',\n file: 'mdi-paperclip',\n plus: 'mdi-plus',\n minus: 'mdi-minus',\n calendar: 'mdi-calendar',\n treeviewCollapse: 'mdi-menu-down',\n treeviewExpand: 'mdi-menu-right',\n eyeDropper: 'mdi-eyedropper',\n}\n\nconst mdi: IconSet = {\n // Not using mergeProps here, functional components merge props by default (?)\n component: (props: any) => h(VClassIcon, { ...props, class: 'mdi' }),\n}\n\nexport { aliases, mdi }\n"],"mappings":"AAAA;AAAA,SACSA,UAAU,oCAEnB;AACA,SAASC,CAAC,QAAQ,KAAK;;AAEvB;;AAGA,MAAMC,OAAoB,GAAG;EAC3BC,QAAQ,EAAE,gBAAgB;EAC1BC,QAAQ,EAAE,WAAW;EACrBC,MAAM,EAAE,kBAAkB;EAC1BC,KAAK,EAAE,WAAW;EAClBC,MAAM,EAAE,kBAAkB;EAAE;EAC5BC,KAAK,EAAE,kBAAkB;EACzBC,OAAO,EAAE,kBAAkB;EAC3BC,IAAI,EAAE,iBAAiB;EACvBC,OAAO,EAAE,kBAAkB;EAC3BC,KAAK,EAAE,kBAAkB;EACzBC,IAAI,EAAE,kBAAkB;EACxBC,IAAI,EAAE,mBAAmB;EACzBC,UAAU,EAAE,qBAAqB;EACjCC,WAAW,EAAE,4BAA4B;EACzCC,qBAAqB,EAAE,eAAe;EACtCC,SAAS,EAAE,YAAY;EAAE;EACzBC,OAAO,EAAE,cAAc;EACvBC,QAAQ,EAAE,gBAAgB;EAC1BC,MAAM,EAAE,kBAAkB;EAC1BC,IAAI,EAAE,UAAU;EAChBC,QAAQ,EAAE,eAAe;EACzBC,QAAQ,EAAE,eAAe;EACzBC,OAAO,EAAE,qBAAqB;EAC9BC,QAAQ,EAAE,oBAAoB;EAC9BC,IAAI,EAAE,YAAY;EAClBC,WAAW,EAAE,kBAAkB;EAC/BC,UAAU,EAAE,UAAU;EACtBC,UAAU,EAAE,oBAAoB;EAChCC,OAAO,EAAE,YAAY;EACrBC,KAAK,EAAE,gBAAgB;EACvBC,IAAI,EAAE,eAAe;EACrBC,MAAM,EAAE,4BAA4B;EACpCC,IAAI,EAAE,eAAe;EACrBC,IAAI,EAAE,UAAU;EAChBC,KAAK,EAAE,WAAW;EAClBC,QAAQ,EAAE,cAAc;EACxBC,gBAAgB,EAAE,eAAe;EACjCC,cAAc,EAAE,gBAAgB;EAChCC,UAAU,EAAE;AACd,CAAC;AAED,MAAMC,GAAY,GAAG;EACnB;EACAC,SAAS,EAAGC,KAAU,IAAK3C,CAAC,CAACD,UAAU,EAAE;IAAE,GAAG4C,KAAK;IAAEC,KAAK,EAAE;EAAM,CAAC;AACrE,CAAC;AAED,SAAS3C,OAAO,EAAEwC,GAAG"}
package/lib/index.d.mts CHANGED
@@ -517,41 +517,48 @@ declare module '@vue/runtime-core' {
517
517
  }
518
518
 
519
519
  export interface GlobalComponents {
520
- VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
521
520
  VApp: typeof import('vuetify/components')['VApp']
522
521
  VAppBar: typeof import('vuetify/components')['VAppBar']
523
522
  VAppBarNavIcon: typeof import('vuetify/components')['VAppBarNavIcon']
524
523
  VAppBarTitle: typeof import('vuetify/components')['VAppBarTitle']
525
524
  VAlert: typeof import('vuetify/components')['VAlert']
526
525
  VAlertTitle: typeof import('vuetify/components')['VAlertTitle']
526
+ VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
527
+ VAvatar: typeof import('vuetify/components')['VAvatar']
528
+ VBottomNavigation: typeof import('vuetify/components')['VBottomNavigation']
527
529
  VBadge: typeof import('vuetify/components')['VBadge']
530
+ VBtn: typeof import('vuetify/components')['VBtn']
528
531
  VBanner: typeof import('vuetify/components')['VBanner']
529
532
  VBannerActions: typeof import('vuetify/components')['VBannerActions']
530
533
  VBannerText: typeof import('vuetify/components')['VBannerText']
531
- VAvatar: typeof import('vuetify/components')['VAvatar']
532
- VBottomNavigation: typeof import('vuetify/components')['VBottomNavigation']
533
- VBtn: typeof import('vuetify/components')['VBtn']
534
534
  VBottomSheet: typeof import('vuetify/components')['VBottomSheet']
535
- VBreadcrumbs: typeof import('vuetify/components')['VBreadcrumbs']
536
- VBreadcrumbsItem: typeof import('vuetify/components')['VBreadcrumbsItem']
537
- VBreadcrumbsDivider: typeof import('vuetify/components')['VBreadcrumbsDivider']
535
+ VBtnToggle: typeof import('vuetify/components')['VBtnToggle']
536
+ VBtnGroup: typeof import('vuetify/components')['VBtnGroup']
538
537
  VCard: typeof import('vuetify/components')['VCard']
539
538
  VCardActions: typeof import('vuetify/components')['VCardActions']
540
539
  VCardItem: typeof import('vuetify/components')['VCardItem']
541
540
  VCardSubtitle: typeof import('vuetify/components')['VCardSubtitle']
542
541
  VCardText: typeof import('vuetify/components')['VCardText']
543
542
  VCardTitle: typeof import('vuetify/components')['VCardTitle']
544
- VBtnToggle: typeof import('vuetify/components')['VBtnToggle']
545
- VBtnGroup: typeof import('vuetify/components')['VBtnGroup']
543
+ VBreadcrumbs: typeof import('vuetify/components')['VBreadcrumbs']
544
+ VBreadcrumbsItem: typeof import('vuetify/components')['VBreadcrumbsItem']
545
+ VBreadcrumbsDivider: typeof import('vuetify/components')['VBreadcrumbsDivider']
546
546
  VCarousel: typeof import('vuetify/components')['VCarousel']
547
547
  VCarouselItem: typeof import('vuetify/components')['VCarouselItem']
548
+ VChip: typeof import('vuetify/components')['VChip']
548
549
  VCheckbox: typeof import('vuetify/components')['VCheckbox']
549
550
  VCheckboxBtn: typeof import('vuetify/components')['VCheckboxBtn']
550
551
  VChipGroup: typeof import('vuetify/components')['VChipGroup']
551
- VChip: typeof import('vuetify/components')['VChip']
552
+ VColorPicker: typeof import('vuetify/components')['VColorPicker']
552
553
  VCode: typeof import('vuetify/components')['VCode']
554
+ VDataTable: typeof import('vuetify/components')['VDataTable']
555
+ VDataTableHeaders: typeof import('vuetify/components')['VDataTableHeaders']
556
+ VDataTableFooter: typeof import('vuetify/components')['VDataTableFooter']
557
+ VDataTableRows: typeof import('vuetify/components')['VDataTableRows']
558
+ VDataTableRow: typeof import('vuetify/components')['VDataTableRow']
559
+ VDataTableVirtual: typeof import('vuetify/components')['VDataTableVirtual']
560
+ VDataTableServer: typeof import('vuetify/components')['VDataTableServer']
553
561
  VCounter: typeof import('vuetify/components')['VCounter']
554
- VColorPicker: typeof import('vuetify/components')['VColorPicker']
555
562
  VCombobox: typeof import('vuetify/components')['VCombobox']
556
563
  VDatePicker: typeof import('vuetify/components')['VDatePicker']
557
564
  VDatePickerControls: typeof import('vuetify/components')['VDatePickerControls']
@@ -559,34 +566,30 @@ declare module '@vue/runtime-core' {
559
566
  VDatePickerMonth: typeof import('vuetify/components')['VDatePickerMonth']
560
567
  VDatePickerMonths: typeof import('vuetify/components')['VDatePickerMonths']
561
568
  VDatePickerYears: typeof import('vuetify/components')['VDatePickerYears']
562
- VDataTable: typeof import('vuetify/components')['VDataTable']
563
- VDataTableHeaders: typeof import('vuetify/components')['VDataTableHeaders']
564
- VDataTableFooter: typeof import('vuetify/components')['VDataTableFooter']
565
- VDataTableRows: typeof import('vuetify/components')['VDataTableRows']
566
- VDataTableRow: typeof import('vuetify/components')['VDataTableRow']
567
- VDataTableVirtual: typeof import('vuetify/components')['VDataTableVirtual']
568
- VDataTableServer: typeof import('vuetify/components')['VDataTableServer']
569
569
  VDialog: typeof import('vuetify/components')['VDialog']
570
570
  VDivider: typeof import('vuetify/components')['VDivider']
571
571
  VField: typeof import('vuetify/components')['VField']
572
572
  VFieldLabel: typeof import('vuetify/components')['VFieldLabel']
573
- VFileInput: typeof import('vuetify/components')['VFileInput']
574
- VExpansionPanels: typeof import('vuetify/components')['VExpansionPanels']
575
- VExpansionPanel: typeof import('vuetify/components')['VExpansionPanel']
576
- VExpansionPanelText: typeof import('vuetify/components')['VExpansionPanelText']
577
- VExpansionPanelTitle: typeof import('vuetify/components')['VExpansionPanelTitle']
578
573
  VFooter: typeof import('vuetify/components')['VFooter']
579
574
  VIcon: typeof import('vuetify/components')['VIcon']
580
575
  VComponentIcon: typeof import('vuetify/components')['VComponentIcon']
581
576
  VSvgIcon: typeof import('vuetify/components')['VSvgIcon']
582
577
  VLigatureIcon: typeof import('vuetify/components')['VLigatureIcon']
583
578
  VClassIcon: typeof import('vuetify/components')['VClassIcon']
579
+ VExpansionPanels: typeof import('vuetify/components')['VExpansionPanels']
580
+ VExpansionPanel: typeof import('vuetify/components')['VExpansionPanel']
581
+ VExpansionPanelText: typeof import('vuetify/components')['VExpansionPanelText']
582
+ VExpansionPanelTitle: typeof import('vuetify/components')['VExpansionPanelTitle']
583
+ VFileInput: typeof import('vuetify/components')['VFileInput']
584
584
  VImg: typeof import('vuetify/components')['VImg']
585
585
  VInfiniteScroll: typeof import('vuetify/components')['VInfiniteScroll']
586
+ VInput: typeof import('vuetify/components')['VInput']
586
587
  VItemGroup: typeof import('vuetify/components')['VItemGroup']
587
588
  VItem: typeof import('vuetify/components')['VItem']
588
- VInput: typeof import('vuetify/components')['VInput']
589
589
  VLabel: typeof import('vuetify/components')['VLabel']
590
+ VMain: typeof import('vuetify/components')['VMain']
591
+ VKbd: typeof import('vuetify/components')['VKbd']
592
+ VMessages: typeof import('vuetify/components')['VMessages']
590
593
  VList: typeof import('vuetify/components')['VList']
591
594
  VListGroup: typeof import('vuetify/components')['VListGroup']
592
595
  VListImg: typeof import('vuetify/components')['VListImg']
@@ -596,51 +599,47 @@ declare module '@vue/runtime-core' {
596
599
  VListItemSubtitle: typeof import('vuetify/components')['VListItemSubtitle']
597
600
  VListItemTitle: typeof import('vuetify/components')['VListItemTitle']
598
601
  VListSubheader: typeof import('vuetify/components')['VListSubheader']
599
- VKbd: typeof import('vuetify/components')['VKbd']
600
- VMain: typeof import('vuetify/components')['VMain']
601
602
  VMenu: typeof import('vuetify/components')['VMenu']
602
- VMessages: typeof import('vuetify/components')['VMessages']
603
603
  VNavigationDrawer: typeof import('vuetify/components')['VNavigationDrawer']
604
604
  VOtpInput: typeof import('vuetify/components')['VOtpInput']
605
605
  VOverlay: typeof import('vuetify/components')['VOverlay']
606
- VPagination: typeof import('vuetify/components')['VPagination']
607
606
  VProgressCircular: typeof import('vuetify/components')['VProgressCircular']
607
+ VPagination: typeof import('vuetify/components')['VPagination']
608
608
  VProgressLinear: typeof import('vuetify/components')['VProgressLinear']
609
- VRadioGroup: typeof import('vuetify/components')['VRadioGroup']
610
- VSelectionControl: typeof import('vuetify/components')['VSelectionControl']
611
609
  VRating: typeof import('vuetify/components')['VRating']
610
+ VRadioGroup: typeof import('vuetify/components')['VRadioGroup']
612
611
  VSelect: typeof import('vuetify/components')['VSelect']
612
+ VSelectionControl: typeof import('vuetify/components')['VSelectionControl']
613
613
  VSelectionControlGroup: typeof import('vuetify/components')['VSelectionControlGroup']
614
- VSheet: typeof import('vuetify/components')['VSheet']
615
614
  VSkeletonLoader: typeof import('vuetify/components')['VSkeletonLoader']
616
615
  VSlideGroup: typeof import('vuetify/components')['VSlideGroup']
617
616
  VSlideGroupItem: typeof import('vuetify/components')['VSlideGroupItem']
617
+ VSheet: typeof import('vuetify/components')['VSheet']
618
618
  VSlider: typeof import('vuetify/components')['VSlider']
619
- VSwitch: typeof import('vuetify/components')['VSwitch']
619
+ VSystemBar: typeof import('vuetify/components')['VSystemBar']
620
+ VTable: typeof import('vuetify/components')['VTable']
621
+ VSnackbar: typeof import('vuetify/components')['VSnackbar']
620
622
  VStepper: typeof import('vuetify/components')['VStepper']
621
623
  VStepperActions: typeof import('vuetify/components')['VStepperActions']
622
624
  VStepperHeader: typeof import('vuetify/components')['VStepperHeader']
623
625
  VStepperItem: typeof import('vuetify/components')['VStepperItem']
624
626
  VStepperWindow: typeof import('vuetify/components')['VStepperWindow']
625
627
  VStepperWindowItem: typeof import('vuetify/components')['VStepperWindowItem']
626
- VSnackbar: typeof import('vuetify/components')['VSnackbar']
628
+ VSwitch: typeof import('vuetify/components')['VSwitch']
627
629
  VTabs: typeof import('vuetify/components')['VTabs']
628
630
  VTab: typeof import('vuetify/components')['VTab']
629
- VSystemBar: typeof import('vuetify/components')['VSystemBar']
630
- VTextField: typeof import('vuetify/components')['VTextField']
631
631
  VTextarea: typeof import('vuetify/components')['VTextarea']
632
- VTable: typeof import('vuetify/components')['VTable']
633
- VTooltip: typeof import('vuetify/components')['VTooltip']
634
- VWindow: typeof import('vuetify/components')['VWindow']
635
- VWindowItem: typeof import('vuetify/components')['VWindowItem']
632
+ VTextField: typeof import('vuetify/components')['VTextField']
636
633
  VTimeline: typeof import('vuetify/components')['VTimeline']
637
634
  VTimelineItem: typeof import('vuetify/components')['VTimelineItem']
638
635
  VToolbar: typeof import('vuetify/components')['VToolbar']
639
636
  VToolbarTitle: typeof import('vuetify/components')['VToolbarTitle']
640
637
  VToolbarItems: typeof import('vuetify/components')['VToolbarItems']
638
+ VWindow: typeof import('vuetify/components')['VWindow']
639
+ VWindowItem: typeof import('vuetify/components')['VWindowItem']
640
+ VTooltip: typeof import('vuetify/components')['VTooltip']
641
641
  VDataIterator: typeof import('vuetify/components')['VDataIterator']
642
642
  VDefaultsProvider: typeof import('vuetify/components')['VDefaultsProvider']
643
- VForm: typeof import('vuetify/components')['VForm']
644
643
  VContainer: typeof import('vuetify/components')['VContainer']
645
644
  VCol: typeof import('vuetify/components')['VCol']
646
645
  VRow: typeof import('vuetify/components')['VRow']
@@ -651,12 +650,14 @@ declare module '@vue/runtime-core' {
651
650
  VLazy: typeof import('vuetify/components')['VLazy']
652
651
  VLocaleProvider: typeof import('vuetify/components')['VLocaleProvider']
653
652
  VNoSsr: typeof import('vuetify/components')['VNoSsr']
654
- VRadio: typeof import('vuetify/components')['VRadio']
653
+ VForm: typeof import('vuetify/components')['VForm']
655
654
  VParallax: typeof import('vuetify/components')['VParallax']
655
+ VRadio: typeof import('vuetify/components')['VRadio']
656
656
  VRangeSlider: typeof import('vuetify/components')['VRangeSlider']
657
657
  VResponsive: typeof import('vuetify/components')['VResponsive']
658
658
  VThemeProvider: typeof import('vuetify/components')['VThemeProvider']
659
659
  VValidation: typeof import('vuetify/components')['VValidation']
660
+ VVirtualScroll: typeof import('vuetify/components')['VVirtualScroll']
660
661
  VFabTransition: typeof import('vuetify/components')['VFabTransition']
661
662
  VDialogBottomTransition: typeof import('vuetify/components')['VDialogBottomTransition']
662
663
  VDialogTopTransition: typeof import('vuetify/components')['VDialogTopTransition']
@@ -673,9 +674,6 @@ declare module '@vue/runtime-core' {
673
674
  VExpandTransition: typeof import('vuetify/components')['VExpandTransition']
674
675
  VExpandXTransition: typeof import('vuetify/components')['VExpandXTransition']
675
676
  VDialogTransition: typeof import('vuetify/components')['VDialogTransition']
676
- VVirtualScroll: typeof import('vuetify/components')['VVirtualScroll']
677
- VPicker: typeof import('vuetify/labs/components')['VPicker']
678
- VPickerTitle: typeof import('vuetify/labs/components')['VPickerTitle']
679
677
  VCalendar: typeof import('vuetify/labs/components')['VCalendar']
680
678
  VCalendarDay: typeof import('vuetify/labs/components')['VCalendarDay']
681
679
  VCalendarHeader: typeof import('vuetify/labs/components')['VCalendarHeader']
@@ -684,8 +682,13 @@ declare module '@vue/runtime-core' {
684
682
  VCalendarMonthDay: typeof import('vuetify/labs/components')['VCalendarMonthDay']
685
683
  VEmptyState: typeof import('vuetify/labs/components')['VEmptyState']
686
684
  VFab: typeof import('vuetify/labs/components')['VFab']
685
+ VPicker: typeof import('vuetify/labs/components')['VPicker']
686
+ VPickerTitle: typeof import('vuetify/labs/components')['VPickerTitle']
687
687
  VConfirmEdit: typeof import('vuetify/labs/components')['VConfirmEdit']
688
688
  VSparkline: typeof import('vuetify/labs/components')['VSparkline']
689
689
  VSpeedDial: typeof import('vuetify/labs/components')['VSpeedDial']
690
+ VTreeview: typeof import('vuetify/labs/components')['VTreeview']
691
+ VTreeviewItem: typeof import('vuetify/labs/components')['VTreeviewItem']
692
+ VTreeviewGroup: typeof import('vuetify/labs/components')['VTreeviewGroup']
690
693
  }
691
694
  }
@@ -0,0 +1,154 @@
1
+ import { createVNode as _createVNode, mergeProps as _mergeProps, resolveDirective as _resolveDirective } from "vue";
2
+ // Components
3
+ import { makeVTreeviewChildrenProps, VTreeviewChildren } from "./VTreeviewChildren.mjs";
4
+ import { makeVListProps, useListItems, VList } from "../../components/VList/VList.mjs"; // Composables
5
+ import { provideDefaults } from "../../composables/defaults.mjs";
6
+ import { makeFilterProps, useFilter } from "../../composables/filter.mjs";
7
+ import { useProxiedModel } from "../../composables/proxiedModel.mjs"; // Utilities
8
+ import { computed, provide, ref, toRef, watch } from 'vue';
9
+ import { genericComponent, omit, propsFactory, useRender } from "../../util/index.mjs"; // Types
10
+ import { VTreeviewSymbol } from "./shared.mjs";
11
+ function flatten(items) {
12
+ let flat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
13
+ for (const item of items) {
14
+ flat.push(item);
15
+ if (item.children) flatten(item.children, flat);
16
+ }
17
+ return flat;
18
+ }
19
+ export const makeVTreeviewProps = propsFactory({
20
+ openAll: Boolean,
21
+ search: String,
22
+ ...makeFilterProps({
23
+ filterKeys: ['title']
24
+ }),
25
+ ...makeVTreeviewChildrenProps(),
26
+ ...omit(makeVListProps({
27
+ collapseIcon: '$treeviewCollapse',
28
+ expandIcon: '$treeviewExpand',
29
+ selectStrategy: 'independent',
30
+ openStrategy: 'multiple',
31
+ slim: true
32
+ }), ['nav'])
33
+ }, 'VTreeview');
34
+ export const VTreeview = genericComponent()({
35
+ name: 'VTreeview',
36
+ props: makeVTreeviewProps(),
37
+ emits: {
38
+ 'update:opened': val => true,
39
+ 'update:activated': val => true,
40
+ 'update:selected': val => true,
41
+ 'click:open': value => true,
42
+ 'click:select': value => true
43
+ },
44
+ setup(props, _ref) {
45
+ let {
46
+ slots
47
+ } = _ref;
48
+ const {
49
+ items
50
+ } = useListItems(props);
51
+ const activeColor = toRef(props, 'activeColor');
52
+ const baseColor = toRef(props, 'baseColor');
53
+ const color = toRef(props, 'color');
54
+ const opened = useProxiedModel(props, 'opened');
55
+ const activated = useProxiedModel(props, 'activated');
56
+ const selected = useProxiedModel(props, 'selected');
57
+ const vListRef = ref();
58
+ const flatItems = computed(() => flatten(items.value));
59
+ const search = toRef(props, 'search');
60
+ const {
61
+ filteredItems
62
+ } = useFilter(props, flatItems, search);
63
+ const visibleIds = computed(() => {
64
+ if (!search.value) {
65
+ return null;
66
+ }
67
+ return new Set(filteredItems.value.flatMap(item => {
68
+ return [...getPath(item.props.value), ...getChildren(item.props.value)];
69
+ }));
70
+ });
71
+ function getPath(id) {
72
+ const path = [];
73
+ let parent = id;
74
+ while (parent != null) {
75
+ path.unshift(parent);
76
+ parent = vListRef.value?.parents.get(parent);
77
+ }
78
+ return path;
79
+ }
80
+ function getChildren(id) {
81
+ const arr = [];
82
+ const queue = (vListRef.value?.children.get(id) ?? []).slice();
83
+ while (queue.length) {
84
+ const child = queue.shift();
85
+ if (!child) continue;
86
+ arr.push(child);
87
+ queue.push(...(vListRef.value?.children.get(child) ?? []).slice());
88
+ }
89
+ return arr;
90
+ }
91
+ watch(() => props.openAll, val => {
92
+ opened.value = val ? openAll(items.value) : [];
93
+ }, {
94
+ immediate: true
95
+ });
96
+ function openAll(item) {
97
+ let ids = [];
98
+ for (const i of item) {
99
+ if (!i.children) continue;
100
+ ids.push(i.value);
101
+ if (i.children) {
102
+ ids = ids.concat(openAll(i.children));
103
+ }
104
+ }
105
+ return ids;
106
+ }
107
+ provide(VTreeviewSymbol, {
108
+ visibleIds
109
+ });
110
+ provideDefaults({
111
+ VTreeviewGroup: {
112
+ activeColor,
113
+ baseColor,
114
+ color,
115
+ collapseIcon: toRef(props, 'collapseIcon'),
116
+ expandIcon: toRef(props, 'expandIcon')
117
+ },
118
+ VTreeviewItem: {
119
+ activeClass: toRef(props, 'activeClass'),
120
+ activeColor,
121
+ baseColor,
122
+ color,
123
+ density: toRef(props, 'density'),
124
+ disabled: toRef(props, 'disabled'),
125
+ lines: toRef(props, 'lines'),
126
+ variant: toRef(props, 'variant')
127
+ }
128
+ });
129
+ useRender(() => {
130
+ const listProps = VList.filterProps(props);
131
+ const treeviewChildrenProps = VTreeviewChildren.filterProps(props);
132
+ return _createVNode(VList, _mergeProps({
133
+ "ref": vListRef
134
+ }, listProps, {
135
+ "class": ['v-treeview', props.class],
136
+ "style": props.style,
137
+ "opened": opened.value,
138
+ "onUpdate:opened": $event => opened.value = $event,
139
+ "activated": activated.value,
140
+ "onUpdate:activated": $event => activated.value = $event,
141
+ "selected": selected.value,
142
+ "onUpdate:selected": $event => selected.value = $event
143
+ }), {
144
+ default: () => [_createVNode(VTreeviewChildren, _mergeProps(treeviewChildrenProps, {
145
+ "items": items.value
146
+ }), slots)]
147
+ });
148
+ });
149
+ return {
150
+ open
151
+ };
152
+ }
153
+ });
154
+ //# sourceMappingURL=VTreeview.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VTreeview.mjs","names":["makeVTreeviewChildrenProps","VTreeviewChildren","makeVListProps","useListItems","VList","provideDefaults","makeFilterProps","useFilter","useProxiedModel","computed","provide","ref","toRef","watch","genericComponent","omit","propsFactory","useRender","VTreeviewSymbol","flatten","items","flat","arguments","length","undefined","item","push","children","makeVTreeviewProps","openAll","Boolean","search","String","filterKeys","collapseIcon","expandIcon","selectStrategy","openStrategy","slim","VTreeview","name","props","emits","val","value","setup","_ref","slots","activeColor","baseColor","color","opened","activated","selected","vListRef","flatItems","filteredItems","visibleIds","Set","flatMap","getPath","getChildren","id","path","parent","unshift","parents","get","arr","queue","slice","child","shift","immediate","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, watch } 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 selectStrategy: 'independent' as const,\n openStrategy: 'multiple' as const,\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 opened = useProxiedModel(props, 'opened')\n const activated = useProxiedModel(props, 'activated')\n const selected = useProxiedModel(props, 'selected')\n\n const vListRef = ref<VList>()\n\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 watch(() => props.openAll, val => {\n opened.value = val ? openAll(items.value) : []\n }, { immediate: true })\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 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 v-model: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,EAAEC,KAAK,QAAQ,KAAK;AAAA,SACjDC,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,GAAG1B,eAAe,CAAC;IAAE2B,UAAU,EAAE,CAAC,OAAO;EAAE,CAAC,CAAC;EAC7C,GAAGjC,0BAA0B,CAAC,CAAC;EAC/B,GAAGe,IAAI,CAACb,cAAc,CAAC;IACrBgC,YAAY,EAAE,mBAAmB;IACjCC,UAAU,EAAE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QAAQ,EAAErE,KAAK,CAAC6B,KAAK,EAAE,UAAU,CAAC;QAClCyC,KAAK,EAAEtE,KAAK,CAAC6B,KAAK,EAAE,OAAO,CAAC;QAC5B0C,OAAO,EAAEvE,KAAK,CAAC6B,KAAK,EAAE,SAAS;MACjC;IACF,CAAC,CAAC;IAEFxB,SAAS,CAAC,MAAM;MACd,MAAMmE,SAAS,GAAGhF,KAAK,CAACiF,WAAW,CAAC5C,KAAK,CAAC;MAC1C,MAAM6C,qBAAqB,GAAGrF,iBAAiB,CAACoF,WAAW,CAAC5C,KAAK,CAAC;MAElE,OAAA8C,YAAA,CAAAnF,KAAA,EAAAoF,WAAA;QAAA,OAEUlC;MAAQ,GACT8B,SAAS;QAAA,SACP,CACL,YAAY,EACZ3C,KAAK,CAACgD,KAAK,CACZ;QAAA,SACOhD,KAAK,CAACiD,KAAK;QAAA,UACFvC,MAAM,CAACP,KAAK;QAAA,mBAAA+C,MAAA,IAAZxC,MAAM,CAACP,KAAK,GAAA+C,MAAA;QAAA,aACTvC,SAAS,CAACR,KAAK;QAAA,sBAAA+C,MAAA,IAAfvC,SAAS,CAACR,KAAK,GAAA+C,MAAA;QAAA,YAChBtC,QAAQ,CAACT,KAAK;QAAA,qBAAA+C,MAAA,IAAdtC,QAAQ,CAACT,KAAK,GAAA+C;MAAA;QAAAC,OAAA,EAAAA,CAAA,MAAAL,YAAA,CAAAtF,iBAAA,EAAAuF,WAAA,CAG1BF,qBAAqB;UAAA,SAClBlE,KAAK,CAACwB;QAAK,IACTG,KAAK;MAAA;IAIvB,CAAC,CAAC;IAEF,OAAO;MACL8C;IACF,CAAC;EACH;AACF,CAAC,CAAC"}
@@ -0,0 +1,98 @@
1
+ import { mergeProps as _mergeProps, resolveDirective as _resolveDirective, createVNode as _createVNode } from "vue";
2
+ // Components
3
+ import { VTreeviewGroup } from "./VTreeviewGroup.mjs";
4
+ import { VTreeviewItem } from "./VTreeviewItem.mjs";
5
+ import { VCheckboxBtn } from "../../components/VCheckbox/index.mjs"; // Utilities
6
+ import { shallowRef } from 'vue';
7
+ import { genericComponent, propsFactory } from "../../util/index.mjs"; // Types
8
+ export const makeVTreeviewChildrenProps = propsFactory({
9
+ loadChildren: Function,
10
+ loadingIcon: {
11
+ type: String,
12
+ default: '$loading'
13
+ },
14
+ items: Array,
15
+ selectable: Boolean
16
+ }, 'VTreeviewChildren');
17
+ export const VTreeviewChildren = genericComponent()({
18
+ name: 'VTreeviewChildren',
19
+ props: makeVTreeviewChildrenProps(),
20
+ setup(props, _ref) {
21
+ let {
22
+ emit,
23
+ slots
24
+ } = _ref;
25
+ const isLoading = shallowRef(false);
26
+ const hasLoaded = shallowRef(false);
27
+ function checkChildren(item) {
28
+ return new Promise(resolve => {
29
+ if (!props.items?.length || !props.loadChildren || hasLoaded.value) return resolve();
30
+ isLoading.value = true;
31
+ props.loadChildren(item).then(resolve);
32
+ }).then(() => {
33
+ hasLoaded.value = true;
34
+ }).finally(() => {
35
+ isLoading.value = false;
36
+ });
37
+ }
38
+ function onClick(e, item) {
39
+ e.stopPropagation();
40
+ checkChildren(item);
41
+ }
42
+ return () => slots.default?.() ?? props.items?.map(_ref2 => {
43
+ let {
44
+ children,
45
+ props: itemProps,
46
+ raw: item
47
+ } = _ref2;
48
+ const slotsWithItem = {
49
+ prepend: slots.prepend ? slotProps => slots.prepend?.({
50
+ ...slotProps,
51
+ item
52
+ }) : props.selectable ? _ref3 => {
53
+ let {
54
+ isSelected,
55
+ isIndeterminate
56
+ } = _ref3;
57
+ return _createVNode(VCheckboxBtn, {
58
+ "key": item.value,
59
+ "tabindex": "-1",
60
+ "modelValue": isSelected,
61
+ "loading": isLoading.value,
62
+ "indeterminate": isIndeterminate,
63
+ "onClick": e => onClick(e, item)
64
+ }, null);
65
+ } : undefined,
66
+ append: slots.append ? slotProps => slots.append?.({
67
+ ...slotProps,
68
+ item
69
+ }) : undefined,
70
+ title: slots.title ? slotProps => slots.title?.({
71
+ ...slotProps,
72
+ item
73
+ }) : undefined
74
+ };
75
+ const treeviewGroupProps = VTreeviewGroup.filterProps(itemProps);
76
+ const treeviewChildrenProps = VTreeviewChildren.filterProps(props);
77
+ return children ? _createVNode(VTreeviewGroup, _mergeProps({
78
+ "value": itemProps?.value
79
+ }, treeviewGroupProps), {
80
+ activator: _ref4 => {
81
+ let {
82
+ props: activatorProps
83
+ } = _ref4;
84
+ return _createVNode(VTreeviewItem, _mergeProps(itemProps, activatorProps, {
85
+ "loading": isLoading.value,
86
+ "onClick": e => onClick(e, item)
87
+ }), slotsWithItem);
88
+ },
89
+ default: () => _createVNode(VTreeviewChildren, _mergeProps(treeviewChildrenProps, {
90
+ "items": children
91
+ }), slots)
92
+ }) : slots.item?.({
93
+ props: itemProps
94
+ }) ?? _createVNode(VTreeviewItem, itemProps, slotsWithItem);
95
+ });
96
+ }
97
+ });
98
+ //# sourceMappingURL=VTreeviewChildren.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VTreeviewChildren.mjs","names":["VTreeviewGroup","VTreeviewItem","VCheckboxBtn","shallowRef","genericComponent","propsFactory","makeVTreeviewChildrenProps","loadChildren","Function","loadingIcon","type","String","default","items","Array","selectable","Boolean","VTreeviewChildren","name","props","setup","_ref","emit","slots","isLoading","hasLoaded","checkChildren","item","Promise","resolve","length","value","then","finally","onClick","e","stopPropagation","map","_ref2","children","itemProps","raw","slotsWithItem","prepend","slotProps","_ref3","isSelected","isIndeterminate","_createVNode","undefined","append","title","treeviewGroupProps","filterProps","treeviewChildrenProps","_mergeProps","activator","_ref4","activatorProps"],"sources":["../../../src/labs/VTreeview/VTreeviewChildren.tsx"],"sourcesContent":["// Components\nimport { VTreeviewGroup } from './VTreeviewGroup'\nimport { VTreeviewItem } from './VTreeviewItem'\nimport { VCheckboxBtn } from '@/components/VCheckbox'\n\n// Utilities\nimport { shallowRef } from 'vue'\nimport { genericComponent, propsFactory } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\nimport type { InternalListItem } from '@/components/VList/VList'\nimport type { VListItemSlots } from '@/components/VList/VListItem'\nimport type { GenericProps } from '@/util'\n\nexport type VTreeviewChildrenSlots<T> = {\n [K in keyof Omit<VListItemSlots, 'default'>]: VListItemSlots[K] & { item: T }\n} & {\n default: never\n item: { props: InternalListItem['props'] }\n}\n\nexport const makeVTreeviewChildrenProps = propsFactory({\n loadChildren: Function as PropType<(item: unknown) => Promise<void>>,\n loadingIcon: {\n type: String,\n default: '$loading',\n },\n items: Array as PropType<readonly InternalListItem[]>,\n selectable: Boolean,\n}, 'VTreeviewChildren')\n\nexport const VTreeviewChildren = genericComponent<new <T extends InternalListItem>(\n props: {\n items?: readonly T[]\n },\n slots: VTreeviewChildrenSlots<T>\n) => GenericProps<typeof props, typeof slots>>()({\n name: 'VTreeviewChildren',\n\n props: makeVTreeviewChildrenProps(),\n\n setup (props, { emit, slots }) {\n const isLoading = shallowRef(false)\n const hasLoaded = shallowRef(false)\n\n function checkChildren (item: unknown) {\n return new Promise<void>(resolve => {\n if (!props.items?.length || !props.loadChildren || hasLoaded.value) return resolve()\n\n isLoading.value = true\n props.loadChildren(item).then(resolve)\n }).then(() => {\n hasLoaded.value = true\n }).finally(() => {\n isLoading.value = false\n })\n }\n\n function onClick (e: MouseEvent | KeyboardEvent, item: any) {\n e.stopPropagation()\n\n checkChildren(item)\n }\n\n return () => slots.default?.() ?? props.items?.map(({ children, props: itemProps, raw: item }) => {\n const slotsWithItem = {\n prepend: slots.prepend\n ? slotProps => slots.prepend?.({ ...slotProps, item })\n : props.selectable\n ? ({ isSelected, isIndeterminate }) => (\n <VCheckboxBtn\n key={ item.value }\n tabindex=\"-1\"\n modelValue={ isSelected }\n loading={ isLoading.value }\n indeterminate={ isIndeterminate }\n onClick={ (e: MouseEvent) => onClick(e, item) }\n />\n )\n : undefined,\n append: slots.append ? slotProps => slots.append?.({ ...slotProps, item }) : undefined,\n title: slots.title ? slotProps => slots.title?.({ ...slotProps, item }) : undefined,\n } satisfies VTreeviewItem['$props']['$children']\n\n const treeviewGroupProps = VTreeviewGroup.filterProps(itemProps)\n const treeviewChildrenProps = VTreeviewChildren.filterProps(props)\n\n return children ? (\n <VTreeviewGroup\n value={ itemProps?.value }\n { ...treeviewGroupProps }\n >\n {{\n activator: ({ props: activatorProps }) => (\n <VTreeviewItem\n { ...itemProps }\n { ...activatorProps }\n loading={ isLoading.value }\n v-slots={ slotsWithItem }\n onClick={ (e: MouseEvent | KeyboardEvent) => onClick(e, item) }\n />\n ),\n default: () => (\n <VTreeviewChildren\n { ...treeviewChildrenProps }\n items={ children }\n v-slots={ slots }\n />\n ),\n }}\n </VTreeviewGroup>\n ) : (\n slots.item?.({ props: itemProps }) ?? (\n <VTreeviewItem\n { ...itemProps }\n v-slots={ slotsWithItem }\n />\n ))\n })\n },\n})\n"],"mappings":";AAAA;AAAA,SACSA,cAAc;AAAA,SACdC,aAAa;AAAA,SACbC,YAAY,gDAErB;AACA,SAASC,UAAU,QAAQ,KAAK;AAAA,SACvBC,gBAAgB,EAAEC,YAAY,gCAEvC;AAaA,OAAO,MAAMC,0BAA0B,GAAGD,YAAY,CAAC;EACrDE,YAAY,EAAEC,QAAsD;EACpEC,WAAW,EAAE;IACXC,IAAI,EAAEC,MAAM;IACZC,OAAO,EAAE;EACX,CAAC;EACDC,KAAK,EAAEC,KAA8C;EACrDC,UAAU,EAAEC;AACd,CAAC,EAAE,mBAAmB,CAAC;AAEvB,OAAO,MAAMC,iBAAiB,GAAGb,gBAAgB,CAKF,CAAC,CAAC;EAC/Cc,IAAI,EAAE,mBAAmB;EAEzBC,KAAK,EAAEb,0BAA0B,CAAC,CAAC;EAEnCc,KAAKA,CAAED,KAAK,EAAAE,IAAA,EAAmB;IAAA,IAAjB;MAAEC,IAAI;MAAEC;IAAM,CAAC,GAAAF,IAAA;IAC3B,MAAMG,SAAS,GAAGrB,UAAU,CAAC,KAAK,CAAC;IACnC,MAAMsB,SAAS,GAAGtB,UAAU,CAAC,KAAK,CAAC;IAEnC,SAASuB,aAAaA,CAAEC,IAAa,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
@@ -0,0 +1,48 @@
1
+ import { mergeProps as _mergeProps, createVNode as _createVNode, Fragment as _Fragment } from "vue";
2
+ // Components
3
+ import { VDefaultsProvider } from "../../components/VDefaultsProvider/index.mjs";
4
+ import { makeVListGroupProps, VListGroup } from "../../components/VList/VListGroup.mjs"; // Utilities
5
+ import { computed, ref } from 'vue';
6
+ import { genericComponent, omit, propsFactory, useRender } from "../../util/index.mjs"; // Types
7
+ export const makeVTreeviewGroupProps = propsFactory({
8
+ ...omit(makeVListGroupProps({
9
+ collapseIcon: '$treeviewCollapse',
10
+ expandIcon: '$treeviewExpand'
11
+ }), ['subgroup'])
12
+ }, 'VTreeviewGroup');
13
+ export const VTreeviewGroup = genericComponent()({
14
+ name: 'VTreeviewGroup',
15
+ props: makeVTreeviewGroupProps(),
16
+ setup(props, _ref) {
17
+ let {
18
+ slots
19
+ } = _ref;
20
+ const vListGroupRef = ref();
21
+ const toggleIcon = computed(() => vListGroupRef.value?.isOpen ? props.collapseIcon : props.expandIcon);
22
+ const activatorDefaults = computed(() => ({
23
+ VTreeviewItem: {
24
+ prependIcon: undefined,
25
+ appendIcon: undefined,
26
+ active: vListGroupRef.value?.isOpen,
27
+ toggleIcon: toggleIcon.value
28
+ }
29
+ }));
30
+ useRender(() => {
31
+ const listGroupProps = VListGroup.filterProps(props);
32
+ return _createVNode(VListGroup, _mergeProps(listGroupProps, {
33
+ "ref": vListGroupRef,
34
+ "class": ['v-treeview-group', props.class],
35
+ "subgroup": true
36
+ }), {
37
+ ...slots,
38
+ activator: slots.activator ? slotProps => _createVNode(_Fragment, null, [_createVNode(VDefaultsProvider, {
39
+ "defaults": activatorDefaults.value
40
+ }, {
41
+ default: () => [slots.activator?.(slotProps)]
42
+ })]) : undefined
43
+ });
44
+ });
45
+ return {};
46
+ }
47
+ });
48
+ //# sourceMappingURL=VTreeviewGroup.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VTreeviewGroup.mjs","names":["VDefaultsProvider","makeVListGroupProps","VListGroup","computed","ref","genericComponent","omit","propsFactory","useRender","makeVTreeviewGroupProps","collapseIcon","expandIcon","VTreeviewGroup","name","props","setup","_ref","slots","vListGroupRef","toggleIcon","value","isOpen","activatorDefaults","VTreeviewItem","prependIcon","undefined","appendIcon","active","listGroupProps","filterProps","_createVNode","_mergeProps","class","activator","slotProps","_Fragment","default"],"sources":["../../../src/labs/VTreeview/VTreeviewGroup.tsx"],"sourcesContent":["// Components\nimport { VDefaultsProvider } from '@/components/VDefaultsProvider'\nimport { makeVListGroupProps, VListGroup } from '@/components/VList/VListGroup'\n\n// Utilities\nimport { computed, ref } from 'vue'\nimport { genericComponent, omit, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { VListGroupSlots } from '@/components/VList/VListGroup'\n\nexport const makeVTreeviewGroupProps = propsFactory({\n ...omit(makeVListGroupProps({\n collapseIcon: '$treeviewCollapse',\n expandIcon: '$treeviewExpand',\n }), ['subgroup']),\n}, 'VTreeviewGroup')\n\nexport const VTreeviewGroup = genericComponent<VListGroupSlots>()({\n name: 'VTreeviewGroup',\n\n props: makeVTreeviewGroupProps(),\n\n setup (props, { slots }) {\n const vListGroupRef = ref<VListGroup>()\n const toggleIcon = computed(() => vListGroupRef.value?.isOpen ? props.collapseIcon : props.expandIcon)\n\n const activatorDefaults = computed(() => ({\n VTreeviewItem: {\n prependIcon: undefined,\n appendIcon: undefined,\n active: vListGroupRef.value?.isOpen,\n toggleIcon: toggleIcon.value,\n },\n }))\n\n useRender(() => {\n const listGroupProps = VListGroup.filterProps(props)\n\n return (\n <VListGroup\n { ...listGroupProps }\n ref={ vListGroupRef }\n class={[\n 'v-treeview-group',\n props.class,\n ]}\n subgroup\n >\n {{\n ...slots,\n activator: slots.activator ? slotProps => (\n <>\n <VDefaultsProvider defaults={ activatorDefaults.value }>\n { slots.activator?.(slotProps) }\n </VDefaultsProvider>\n </>\n ) : undefined,\n }}\n </VListGroup>\n )\n })\n\n return {}\n },\n})\n\nexport type VTreeviewGroup = Instance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QAAA,SACZ,CACL,kBAAkB,EAClBJ,KAAK,CAACkB,KAAK,CACZ;QAAA;MAAA;QAIC,GAAGf,KAAK;QACRgB,SAAS,EAAEhB,KAAK,CAACgB,SAAS,GAAGC,SAAS,IAAAJ,YAAA,CAAAK,SAAA,SAAAL,YAAA,CAAA9B,iBAAA;UAAA,YAEJsB,iBAAiB,CAACF;QAAK;UAAAgB,OAAA,EAAAA,CAAA,MACjDnB,KAAK,CAACgB,SAAS,GAAGC,SAAS,CAAC;QAAA,IAGnC,GAAGT;MAAS;IAIrB,CAAC,CAAC;IAEF,OAAO,CAAC,CAAC;EACX;AACF,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ .v-treeview-item--filtered {
2
+ display: none;
3
+ }
4
+
5
+ .v-treeview {
6
+ --indent-padding: 0px;
7
+ }
8
+
9
+ .v-treeview-group.v-list-group {
10
+ --list-indent-size: 16px;
11
+ }
12
+ .v-list--slim .v-treeview-group.v-list-group {
13
+ --prepend-width: 16px;
14
+ }
15
+ .v-treeview-group.v-list-group .v-list-group__items .v-list-item {
16
+ padding-inline-start: calc(12px + var(--indent-padding)) !important;
17
+ }