vuetify 3.9.0-beta.0 → 3.9.0
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/_component-variables-labs.sass +1 -0
- package/dist/json/attributes.json +3590 -3502
- package/dist/json/importMap-labs.json +16 -12
- package/dist/json/importMap.json +186 -186
- package/dist/json/tags.json +31 -4
- package/dist/json/web-types.json +6626 -6392
- package/dist/vuetify-labs.cjs +1082 -195
- package/dist/vuetify-labs.css +4654 -4339
- package/dist/vuetify-labs.d.ts +2027 -493
- package/dist/vuetify-labs.esm.js +1082 -196
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +1082 -195
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.cjs +663 -170
- package/dist/vuetify.cjs.map +1 -1
- package/dist/vuetify.css +4744 -4671
- package/dist/vuetify.d.ts +1575 -267
- package/dist/vuetify.esm.js +663 -171
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +663 -170
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +1182 -1126
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.d.ts +39 -14
- package/lib/components/VAutocomplete/VAutocomplete.js +2 -2
- package/lib/components/VAutocomplete/VAutocomplete.js.map +1 -1
- package/lib/components/VBtn/VBtn.sass +3 -1
- package/lib/components/VCarousel/VCarousel.css +0 -1
- package/lib/components/VCarousel/VCarousel.js +1 -0
- package/lib/components/VCarousel/VCarousel.js.map +1 -1
- package/lib/components/VCarousel/VCarousel.sass +0 -1
- package/lib/components/VCombobox/VCombobox.d.ts +39 -14
- package/lib/components/VCombobox/VCombobox.js +2 -2
- package/lib/components/VCombobox/VCombobox.js.map +1 -1
- package/lib/components/VDataIterator/composables/items.d.ts +2 -1
- package/lib/components/VDataIterator/composables/items.js.map +1 -1
- package/lib/components/VDataTable/VDataTable.css +12 -1
- package/lib/components/VDataTable/VDataTable.d.ts +20 -38
- package/lib/components/VDataTable/VDataTable.sass +12 -2
- package/lib/components/VDataTable/VDataTableColumn.d.ts +9 -3
- package/lib/components/VDataTable/VDataTableColumn.js +12 -4
- package/lib/components/VDataTable/VDataTableColumn.js.map +1 -1
- package/lib/components/VDataTable/VDataTableHeaders.d.ts +0 -13
- package/lib/components/VDataTable/VDataTableHeaders.js +10 -9
- package/lib/components/VDataTable/VDataTableHeaders.js.map +1 -1
- package/lib/components/VDataTable/VDataTableRow.js +2 -0
- package/lib/components/VDataTable/VDataTableRow.js.map +1 -1
- package/lib/components/VDataTable/VDataTableServer.d.ts +10 -23
- package/lib/components/VDataTable/VDataTableVirtual.d.ts +10 -23
- package/lib/components/VDataTable/composables/headers.d.ts +22 -14
- package/lib/components/VDataTable/composables/headers.js +51 -22
- package/lib/components/VDataTable/composables/headers.js.map +1 -1
- package/lib/components/VDataTable/composables/sort.js +2 -1
- package/lib/components/VDataTable/composables/sort.js.map +1 -1
- package/lib/components/VDataTable/types.d.ts +4 -2
- package/lib/components/VDataTable/types.js.map +1 -1
- package/lib/components/VDatePicker/VDatePicker.js +2 -1
- package/lib/components/VDatePicker/VDatePicker.js.map +1 -1
- package/lib/components/VDatePicker/VDatePickerControls.css +1 -0
- package/lib/components/VDatePicker/VDatePickerControls.sass +1 -0
- package/lib/components/VDatePicker/VDatePickerMonth.css +3 -8
- package/lib/components/VDatePicker/VDatePickerMonth.js +7 -3
- package/lib/components/VDatePicker/VDatePickerMonth.js.map +1 -1
- package/lib/components/VDatePicker/VDatePickerMonth.sass +3 -8
- package/lib/components/VField/VField.js +2 -10
- package/lib/components/VField/VField.js.map +1 -1
- package/lib/components/VKbd/VKbd.css +14 -5
- package/lib/components/VKbd/VKbd.js.map +1 -1
- package/lib/components/VKbd/VKbd.scss +26 -0
- package/lib/components/VKbd/_variables.scss +12 -6
- package/lib/components/VKbd/index.js.map +1 -1
- package/lib/components/VList/VList.d.ts +24 -27
- package/lib/components/VList/VList.js +1 -5
- package/lib/components/VList/VList.js.map +1 -1
- package/lib/components/VList/VListGroup.d.ts +13 -0
- package/lib/components/VList/VListGroup.js +2 -1
- package/lib/components/VList/VListGroup.js.map +1 -1
- package/lib/components/VList/VListItem.d.ts +6 -3
- package/lib/components/VList/VListItem.js +1 -1
- package/lib/components/VList/VListItem.js.map +1 -1
- package/lib/components/VNumberInput/VNumberInput.js +4 -10
- package/lib/components/VNumberInput/VNumberInput.js.map +1 -1
- package/lib/components/VNumberInput/hold.js +4 -0
- package/lib/components/VNumberInput/hold.js.map +1 -1
- package/lib/components/VOtpInput/VOtpInput.js +17 -14
- package/lib/components/VOtpInput/VOtpInput.js.map +1 -1
- package/lib/components/VOverlay/locationStrategies.js +1 -1
- package/lib/components/VOverlay/locationStrategies.js.map +1 -1
- package/lib/components/VSelect/VSelect.d.ts +58 -22
- package/lib/components/VSelect/VSelect.js +2 -2
- package/lib/components/VSelect/VSelect.js.map +1 -1
- package/lib/components/VTextField/VTextField.js +1 -1
- package/lib/components/VTextField/VTextField.js.map +1 -1
- package/lib/components/VTimePicker/VTimePicker.css +1 -6
- package/lib/components/VTimePicker/VTimePicker.sass +1 -6
- package/lib/components/VTimePicker/VTimePickerClock.css +5 -4
- package/lib/components/VTimePicker/VTimePickerClock.sass +5 -4
- package/lib/components/VTimePicker/VTimePickerControls.css +2 -1
- package/lib/components/VTimePicker/VTimePickerControls.sass +2 -3
- package/lib/components/VTreeview/VTreeview.d.ts +235 -188
- package/lib/components/VTreeview/VTreeview.js +13 -12
- package/lib/components/VTreeview/VTreeview.js.map +1 -1
- package/lib/components/VTreeview/VTreeviewChildren.d.ts +94 -10
- package/lib/components/VTreeview/VTreeviewChildren.js +61 -17
- package/lib/components/VTreeview/VTreeviewChildren.js.map +1 -1
- package/lib/components/VTreeview/VTreeviewGroup.d.ts +13 -0
- package/lib/components/VTreeview/VTreeviewItem.css +57 -0
- package/lib/components/VTreeview/VTreeviewItem.d.ts +1334 -97
- package/lib/components/VTreeview/VTreeviewItem.js +25 -16
- package/lib/components/VTreeview/VTreeviewItem.js.map +1 -1
- package/lib/components/VTreeview/VTreeviewItem.sass +60 -0
- package/lib/components/VTreeview/_variables.scss +15 -0
- package/lib/composables/calendar.d.ts +2 -1
- package/lib/composables/calendar.js +8 -8
- package/lib/composables/calendar.js.map +1 -1
- package/lib/composables/date/adapters/vuetify.js +1 -1
- package/lib/composables/date/adapters/vuetify.js.map +1 -1
- package/lib/composables/filter.d.ts +1 -0
- package/lib/composables/filter.js +1 -1
- package/lib/composables/filter.js.map +1 -1
- package/lib/composables/hotkey/hotkey-parsing.d.ts +15 -0
- package/lib/composables/hotkey/hotkey-parsing.js +154 -0
- package/lib/composables/hotkey/hotkey-parsing.js.map +1 -0
- package/lib/composables/hotkey/hotkey.d.ts +9 -0
- package/lib/composables/{hotkey.js → hotkey/hotkey.js} +31 -39
- package/lib/composables/hotkey/hotkey.js.map +1 -0
- package/lib/composables/hotkey/index.d.ts +1 -0
- package/lib/composables/hotkey/index.js +2 -0
- package/lib/composables/hotkey/index.js.map +1 -0
- package/lib/composables/hotkey/key-aliases.d.ts +14 -0
- package/lib/composables/hotkey/key-aliases.js +38 -0
- package/lib/composables/hotkey/key-aliases.js.map +1 -0
- package/lib/composables/icons.d.ts +11 -0
- package/lib/composables/icons.js.map +1 -1
- package/lib/composables/index.d.ts +1 -0
- package/lib/composables/index.js +1 -0
- package/lib/composables/index.js.map +1 -1
- package/lib/composables/list-items.d.ts +14 -1
- package/lib/composables/list-items.js +9 -3
- package/lib/composables/list-items.js.map +1 -1
- package/lib/composables/nested/nested.d.ts +7 -4
- package/lib/composables/nested/nested.js +24 -14
- package/lib/composables/nested/nested.js.map +1 -1
- package/lib/composables/nested/selectStrategies.d.ts +2 -1
- package/lib/composables/nested/selectStrategies.js +22 -11
- package/lib/composables/nested/selectStrategies.js.map +1 -1
- package/lib/composables/virtual.js +1 -1
- package/lib/composables/virtual.js.map +1 -1
- package/lib/entry-bundler.js +1 -1
- package/lib/entry-bundler.js.map +1 -1
- package/lib/framework.d.ts +91 -66
- package/lib/framework.js +1 -1
- package/lib/framework.js.map +1 -1
- package/lib/iconsets/fa.js +12 -1
- package/lib/iconsets/fa.js.map +1 -1
- package/lib/iconsets/fa4.js +12 -1
- package/lib/iconsets/fa4.js.map +1 -1
- package/lib/iconsets/md.js +12 -1
- package/lib/iconsets/md.js.map +1 -1
- package/lib/iconsets/mdi-svg.js +12 -1
- package/lib/iconsets/mdi-svg.js.map +1 -1
- package/lib/iconsets/mdi.js +12 -1
- package/lib/iconsets/mdi.js.map +1 -1
- package/lib/labs/VCalendar/VCalendar.d.ts +33 -33
- package/lib/labs/VCalendar/VCalendar.js +10 -10
- package/lib/labs/VCalendar/VCalendar.js.map +1 -1
- package/lib/labs/VCalendar/VCalendarDay.d.ts +33 -33
- package/lib/labs/VCalendar/VCalendarDay.js +1 -1
- package/lib/labs/VCalendar/VCalendarDay.js.map +1 -1
- package/lib/labs/VCalendar/VCalendarInterval.d.ts +36 -36
- package/lib/labs/VCalendar/VCalendarInterval.js +9 -9
- package/lib/labs/VCalendar/VCalendarInterval.js.map +1 -1
- package/lib/labs/VCalendar/VCalendarIntervalEvent.d.ts +12 -12
- package/lib/labs/VCalendar/VCalendarIntervalEvent.js +1 -1
- package/lib/labs/VCalendar/VCalendarIntervalEvent.js.map +1 -1
- package/lib/labs/VCalendar/VCalendarMonthDay.d.ts +36 -36
- package/lib/labs/VCalendar/VCalendarMonthDay.js +4 -4
- package/lib/labs/VCalendar/VCalendarMonthDay.js.map +1 -1
- package/lib/labs/VHotkey/VHotkey.css +242 -0
- package/lib/labs/VHotkey/VHotkey.d.ts +387 -0
- package/lib/labs/VHotkey/VHotkey.js +432 -0
- package/lib/labs/VHotkey/VHotkey.js.map +1 -0
- package/lib/labs/VHotkey/VHotkey.scss +253 -0
- package/lib/labs/VHotkey/_variables.scss +43 -0
- package/lib/labs/VHotkey/index.d.ts +1 -0
- package/lib/labs/VHotkey/index.js +2 -0
- package/lib/labs/VHotkey/index.js.map +1 -0
- package/lib/labs/VIconBtn/VIconBtn.js +1 -0
- package/lib/labs/VIconBtn/VIconBtn.js.map +1 -1
- package/lib/labs/VPicker/VPicker.css +4 -0
- package/lib/labs/VPicker/VPicker.sass +4 -0
- package/lib/labs/components.d.ts +1 -0
- package/lib/labs/components.js +1 -0
- package/lib/labs/components.js.map +1 -1
- package/lib/locale/af.d.ts +18 -0
- package/lib/locale/af.js +18 -0
- package/lib/locale/af.js.map +1 -1
- package/lib/locale/ar.d.ts +18 -0
- package/lib/locale/ar.js +18 -0
- package/lib/locale/ar.js.map +1 -1
- package/lib/locale/az.d.ts +18 -0
- package/lib/locale/az.js +18 -0
- package/lib/locale/az.js.map +1 -1
- package/lib/locale/bg.d.ts +18 -0
- package/lib/locale/bg.js +18 -0
- package/lib/locale/bg.js.map +1 -1
- package/lib/locale/ca.d.ts +18 -0
- package/lib/locale/ca.js +18 -0
- package/lib/locale/ca.js.map +1 -1
- package/lib/locale/ckb.d.ts +18 -0
- package/lib/locale/ckb.js +18 -0
- package/lib/locale/ckb.js.map +1 -1
- package/lib/locale/cs.d.ts +18 -0
- package/lib/locale/cs.js +18 -0
- package/lib/locale/cs.js.map +1 -1
- package/lib/locale/da.d.ts +18 -0
- package/lib/locale/da.js +18 -0
- package/lib/locale/da.js.map +1 -1
- package/lib/locale/de.d.ts +18 -0
- package/lib/locale/de.js +18 -0
- package/lib/locale/de.js.map +1 -1
- package/lib/locale/el.d.ts +18 -0
- package/lib/locale/el.js +18 -0
- package/lib/locale/el.js.map +1 -1
- package/lib/locale/en.d.ts +18 -0
- package/lib/locale/en.js +18 -0
- package/lib/locale/en.js.map +1 -1
- package/lib/locale/es.d.ts +18 -0
- package/lib/locale/es.js +18 -0
- package/lib/locale/es.js.map +1 -1
- package/lib/locale/et.d.ts +18 -0
- package/lib/locale/et.js +18 -0
- package/lib/locale/et.js.map +1 -1
- package/lib/locale/fa.d.ts +18 -0
- package/lib/locale/fa.js +18 -0
- package/lib/locale/fa.js.map +1 -1
- package/lib/locale/fi.d.ts +18 -0
- package/lib/locale/fi.js +18 -0
- package/lib/locale/fi.js.map +1 -1
- package/lib/locale/fr.d.ts +18 -0
- package/lib/locale/fr.js +18 -0
- package/lib/locale/fr.js.map +1 -1
- package/lib/locale/he.d.ts +18 -0
- package/lib/locale/he.js +18 -0
- package/lib/locale/he.js.map +1 -1
- package/lib/locale/hr.d.ts +18 -0
- package/lib/locale/hr.js +18 -0
- package/lib/locale/hr.js.map +1 -1
- package/lib/locale/hu.d.ts +18 -0
- package/lib/locale/hu.js +18 -0
- package/lib/locale/hu.js.map +1 -1
- package/lib/locale/id.d.ts +18 -0
- package/lib/locale/id.js +18 -0
- package/lib/locale/id.js.map +1 -1
- package/lib/locale/it.d.ts +18 -0
- package/lib/locale/it.js +18 -0
- package/lib/locale/it.js.map +1 -1
- package/lib/locale/ja.d.ts +18 -0
- package/lib/locale/ja.js +18 -0
- package/lib/locale/ja.js.map +1 -1
- package/lib/locale/km.d.ts +18 -0
- package/lib/locale/km.js +18 -0
- package/lib/locale/km.js.map +1 -1
- package/lib/locale/ko.d.ts +18 -0
- package/lib/locale/ko.js +18 -0
- package/lib/locale/ko.js.map +1 -1
- package/lib/locale/lt.d.ts +18 -0
- package/lib/locale/lt.js +18 -0
- package/lib/locale/lt.js.map +1 -1
- package/lib/locale/lv.d.ts +18 -0
- package/lib/locale/lv.js +18 -0
- package/lib/locale/lv.js.map +1 -1
- package/lib/locale/nl.d.ts +18 -0
- package/lib/locale/nl.js +18 -0
- package/lib/locale/nl.js.map +1 -1
- package/lib/locale/no.d.ts +18 -0
- package/lib/locale/no.js +18 -0
- package/lib/locale/no.js.map +1 -1
- package/lib/locale/pl.d.ts +18 -0
- package/lib/locale/pl.js +18 -0
- package/lib/locale/pl.js.map +1 -1
- package/lib/locale/pt.d.ts +18 -0
- package/lib/locale/pt.js +18 -0
- package/lib/locale/pt.js.map +1 -1
- package/lib/locale/ro.d.ts +18 -0
- package/lib/locale/ro.js +18 -0
- package/lib/locale/ro.js.map +1 -1
- package/lib/locale/ru.d.ts +18 -0
- package/lib/locale/ru.js +18 -0
- package/lib/locale/ru.js.map +1 -1
- package/lib/locale/sk.d.ts +18 -0
- package/lib/locale/sk.js +18 -0
- package/lib/locale/sk.js.map +1 -1
- package/lib/locale/sl.d.ts +18 -0
- package/lib/locale/sl.js +18 -0
- package/lib/locale/sl.js.map +1 -1
- package/lib/locale/sr-Cyrl.d.ts +18 -0
- package/lib/locale/sr-Cyrl.js +18 -0
- package/lib/locale/sr-Cyrl.js.map +1 -1
- package/lib/locale/sr-Latn.d.ts +18 -0
- package/lib/locale/sr-Latn.js +18 -0
- package/lib/locale/sr-Latn.js.map +1 -1
- package/lib/locale/sv.d.ts +18 -0
- package/lib/locale/sv.js +18 -0
- package/lib/locale/sv.js.map +1 -1
- package/lib/locale/th.d.ts +18 -0
- package/lib/locale/th.js +18 -0
- package/lib/locale/th.js.map +1 -1
- package/lib/locale/tr.d.ts +18 -0
- package/lib/locale/tr.js +18 -0
- package/lib/locale/tr.js.map +1 -1
- package/lib/locale/uk.d.ts +18 -0
- package/lib/locale/uk.js +18 -0
- package/lib/locale/uk.js.map +1 -1
- package/lib/locale/vi.d.ts +18 -0
- package/lib/locale/vi.js +18 -0
- package/lib/locale/vi.js.map +1 -1
- package/lib/locale/zh-Hans.d.ts +18 -0
- package/lib/locale/zh-Hans.js +18 -0
- package/lib/locale/zh-Hans.js.map +1 -1
- package/lib/locale/zh-Hant.d.ts +18 -0
- package/lib/locale/zh-Hant.js +18 -0
- package/lib/locale/zh-Hant.js.map +1 -1
- package/lib/util/helpers.d.ts +3 -0
- package/lib/util/helpers.js +4 -0
- package/lib/util/helpers.js.map +1 -1
- package/lib/util/indentLines.d.ts +17 -0
- package/lib/util/indentLines.js +34 -0
- package/lib/util/indentLines.js.map +1 -0
- package/lib/util/index.d.ts +1 -0
- package/lib/util/index.js +1 -0
- package/lib/util/index.js.map +1 -1
- package/package.json +2 -2
- package/lib/components/VKbd/VKbd.sass +0 -15
- package/lib/composables/hotkey.d.ts +0 -9
- package/lib/composables/hotkey.js.map +0 -1
|
@@ -19,20 +19,18 @@ function flatten(items) {
|
|
|
19
19
|
export const makeVTreeviewProps = propsFactory({
|
|
20
20
|
fluid: Boolean,
|
|
21
21
|
openAll: Boolean,
|
|
22
|
+
indentLines: [Boolean, String],
|
|
22
23
|
search: String,
|
|
23
24
|
...makeFilterProps({
|
|
24
25
|
filterKeys: ['title']
|
|
25
26
|
}),
|
|
26
|
-
...omit(makeVTreeviewChildrenProps(), ['index', 'path']),
|
|
27
|
+
...omit(makeVTreeviewChildrenProps(), ['index', 'path', 'indentLinesVariant', 'parentIndentLines', 'isLastGroup']),
|
|
27
28
|
...omit(makeVListProps({
|
|
28
29
|
collapseIcon: '$treeviewCollapse',
|
|
29
30
|
expandIcon: '$treeviewExpand',
|
|
30
31
|
slim: true
|
|
31
|
-
}), ['
|
|
32
|
-
modelValue:
|
|
33
|
-
type: Array,
|
|
34
|
-
default: () => []
|
|
35
|
-
}
|
|
32
|
+
}), ['nav', 'openStrategy']),
|
|
33
|
+
modelValue: Array
|
|
36
34
|
}, 'VTreeview');
|
|
37
35
|
export const VTreeview = genericComponent()({
|
|
38
36
|
name: 'VTreeview',
|
|
@@ -47,7 +45,8 @@ export const VTreeview = genericComponent()({
|
|
|
47
45
|
},
|
|
48
46
|
setup(props, _ref) {
|
|
49
47
|
let {
|
|
50
|
-
slots
|
|
48
|
+
slots,
|
|
49
|
+
emit
|
|
51
50
|
} = _ref;
|
|
52
51
|
const {
|
|
53
52
|
items
|
|
@@ -56,13 +55,12 @@ export const VTreeview = genericComponent()({
|
|
|
56
55
|
const baseColor = toRef(() => props.baseColor);
|
|
57
56
|
const color = toRef(() => props.color);
|
|
58
57
|
const activated = useProxiedModel(props, 'activated');
|
|
59
|
-
const
|
|
60
|
-
const _selected = useProxiedModel(props, 'selected', props.modelValue);
|
|
58
|
+
const _selected = useProxiedModel(props, 'selected');
|
|
61
59
|
const selected = computed({
|
|
62
|
-
get: () => _selected.value,
|
|
60
|
+
get: () => props.modelValue ?? _selected.value,
|
|
63
61
|
set(val) {
|
|
64
62
|
_selected.value = val;
|
|
65
|
-
|
|
63
|
+
emit('update:modelValue', val);
|
|
66
64
|
}
|
|
67
65
|
});
|
|
68
66
|
const vListRef = ref();
|
|
@@ -128,6 +126,7 @@ export const VTreeview = genericComponent()({
|
|
|
128
126
|
useRender(() => {
|
|
129
127
|
const listProps = VList.filterProps(props);
|
|
130
128
|
const treeviewChildrenProps = VTreeviewChildren.filterProps(props);
|
|
129
|
+
const indentLinesVariant = typeof props.indentLines === 'boolean' ? 'default' : props.indentLines;
|
|
131
130
|
return _createVNode(VList, _mergeProps({
|
|
132
131
|
"ref": vListRef
|
|
133
132
|
}, listProps, {
|
|
@@ -145,7 +144,9 @@ export const VTreeview = genericComponent()({
|
|
|
145
144
|
default: () => [_createVNode(VTreeviewChildren, _mergeProps(treeviewChildrenProps, {
|
|
146
145
|
"density": props.density,
|
|
147
146
|
"returnObject": props.returnObject,
|
|
148
|
-
"items": items.value
|
|
147
|
+
"items": items.value,
|
|
148
|
+
"parentIndentLines": props.indentLines ? [] : undefined,
|
|
149
|
+
"indentLinesVariant": indentLinesVariant
|
|
149
150
|
}), slots)]
|
|
150
151
|
});
|
|
151
152
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VTreeview.js","names":["makeVTreeviewChildrenProps","VTreeviewChildren","makeVListProps","useListItems","VList","provideDefaults","makeFilterProps","useFilter","useProxiedModel","computed","provide","ref","toRaw","toRef","genericComponent","omit","propsFactory","useRender","VTreeviewSymbol","flatten","items","flat","arguments","length","undefined","item","push","children","makeVTreeviewProps","fluid","Boolean","openAll","search","String","filterKeys","collapseIcon","expandIcon","slim","modelValue","type","Array","default","VTreeview","name","props","emits","val","value","setup","_ref","slots","activeColor","baseColor","color","activated","model","_selected","selected","get","set","vListRef","opened","flatItems","filteredItems","visibleIds","getPath","Set","flatMap","itemVal","returnObject","raw","getChildren","map","id","arr","queue","slice","child","shift","ids","i","concat","VTreeviewGroup","VTreeviewItem","activeClass","density","disabled","lines","variant","listProps","filterProps","treeviewChildrenProps","_createVNode","_mergeProps","class","style","$event"],"sources":["../../../src/components/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, toRaw, toRef } from 'vue'\nimport { genericComponent, omit, propsFactory, useRender } from '@/util'\n\n// Types\nimport { VTreeviewSymbol } from './shared'\nimport type { InternalListItem } from '@/components/VList/VList'\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 fluid: Boolean,\n openAll: Boolean,\n search: String,\n\n ...makeFilterProps({ filterKeys: ['title'] }),\n ...omit(makeVTreeviewChildrenProps(), ['index', 'path']),\n ...omit(makeVListProps({\n collapseIcon: '$treeviewCollapse',\n expandIcon: '$treeviewExpand',\n slim: true,\n }), ['itemType', 'nav', 'openStrategy']),\n modelValue: {\n type: Array,\n default: () => ([]),\n },\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 'update:modelValue': (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 model = useProxiedModel(props, 'modelValue')\n const _selected = useProxiedModel(props, 'selected', props.modelValue)\n\n const selected = computed({\n get: () => _selected.value,\n set (val) {\n _selected.value = val\n model.value = val\n },\n })\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) return null\n const getPath = vListRef.value?.getPath\n if (!getPath) return null\n return new Set(filteredItems.value.flatMap(item => {\n const itemVal = props.returnObject ? item.raw : item.props.value\n return [\n ...getPath(itemVal),\n ...getChildren(itemVal),\n ].map(toRaw)\n }))\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 (items: InternalListItem<any>[]) {\n let ids: any[] = []\n\n for (const i of items) {\n if (!i.children) continue\n\n ids.push(props.returnObject ? toRaw(i.raw) : 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 {\n 'v-treeview--fluid': props.fluid,\n },\n props.class,\n ]}\n open-strategy=\"multiple\"\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 density={ props.density }\n returnObject={ props.returnObject }\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,6BAE5C;AAAA,SACSC,eAAe;AAAA,SACfC,eAAe,EAAEC,SAAS;AAAA,SAC1BC,eAAe,6CAExB;AACA,SAASC,QAAQ,EAAEC,OAAO,EAAEC,GAAG,EAAEC,KAAK,EAAEC,KAAK,QAAQ,KAAK;AAAA,SACjDC,gBAAgB,EAAEC,IAAI,EAAEC,YAAY,EAAEC,SAAS,+BAExD;AAAA,SACSC,eAAe;AAMxB,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,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CAACmD,KAAK;QAAA,UACVlC,MAAM,CAACd,KAAK;QAAA,aACDO,SAAS,CAACP,KAAK;QAAA,sBAAAiD,MAAA,IAAf1C,SAAS,CAACP,KAAK,GAAAiD,MAAA;QAAA,YAChBvC,QAAQ,CAACV,KAAK;QAAA,qBAAAiD,MAAA,IAAdvC,QAAQ,CAACV,KAAK,GAAAiD;MAAA;QAAAvD,OAAA,EAAAA,CAAA,MAAAmD,YAAA,CAAA3F,iBAAA,EAAA4F,WAAA,CAG1BF,qBAAqB;UAAA,WAChB/C,KAAK,CAACyC,OAAO;UAAA,gBACRzC,KAAK,CAACyB,YAAY;UAAA,SACzBjD,KAAK,CAAC2B;QAAK,IACTG,KAAK;MAAA;IAIvB,CAAC,CAAC;IAEF,OAAO,CAAE,CAAC;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"VTreeview.js","names":["makeVTreeviewChildrenProps","VTreeviewChildren","makeVListProps","useListItems","VList","provideDefaults","makeFilterProps","useFilter","useProxiedModel","computed","provide","ref","toRaw","toRef","genericComponent","omit","propsFactory","useRender","VTreeviewSymbol","flatten","items","flat","arguments","length","undefined","item","push","children","makeVTreeviewProps","fluid","Boolean","openAll","indentLines","String","search","filterKeys","collapseIcon","expandIcon","slim","modelValue","Array","VTreeview","name","props","emits","val","value","setup","_ref","slots","emit","activeColor","baseColor","color","activated","_selected","selected","get","set","vListRef","opened","flatItems","filteredItems","visibleIds","getPath","Set","flatMap","itemVal","returnObject","raw","getChildren","map","id","arr","queue","slice","child","shift","ids","i","concat","VTreeviewGroup","VTreeviewItem","activeClass","density","disabled","lines","variant","listProps","filterProps","treeviewChildrenProps","indentLinesVariant","_createVNode","_mergeProps","class","style","$event","default"],"sources":["../../../src/components/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, toRaw, toRef } from 'vue'\nimport { genericComponent, omit, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\nimport { VTreeviewSymbol } from './shared'\nimport type { InternalListItem } from '@/components/VList/VList'\nimport type { VListChildrenSlots } from '@/components/VList/VListChildren'\nimport type { ListItem } from '@/composables/list-items'\nimport type { GenericProps, IndentLinesVariant } 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 fluid: Boolean,\n openAll: Boolean,\n indentLines: [Boolean, String] as PropType<boolean | IndentLinesVariant>,\n search: String,\n\n ...makeFilterProps({ filterKeys: ['title'] }),\n ...omit(makeVTreeviewChildrenProps(), [\n 'index',\n 'path',\n 'indentLinesVariant',\n 'parentIndentLines',\n 'isLastGroup',\n ]),\n ...omit(makeVListProps({\n collapseIcon: '$treeviewCollapse',\n expandIcon: '$treeviewExpand',\n slim: true,\n }), ['nav', 'openStrategy']),\n\n modelValue: Array,\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 'update:modelValue': (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, emit }) {\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 selected = computed({\n get: () => props.modelValue ?? _selected.value,\n set (val) {\n _selected.value = val\n emit('update:modelValue', val)\n },\n })\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) return null\n const getPath = vListRef.value?.getPath\n if (!getPath) return null\n return new Set(filteredItems.value.flatMap(item => {\n const itemVal = props.returnObject ? item.raw : item.props.value\n return [\n ...getPath(itemVal),\n ...getChildren(itemVal),\n ].map(toRaw)\n }))\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 (items: InternalListItem<any>[]) {\n let ids: any[] = []\n\n for (const i of items) {\n if (!i.children) continue\n\n ids.push(props.returnObject ? toRaw(i.raw) : 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 const indentLinesVariant = typeof props.indentLines === 'boolean' ? 'default' : props.indentLines\n\n return (\n <VList\n ref={ vListRef }\n { ...listProps }\n class={[\n 'v-treeview',\n {\n 'v-treeview--fluid': props.fluid,\n },\n props.class,\n ]}\n open-strategy=\"multiple\"\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 density={ props.density }\n returnObject={ props.returnObject }\n items={ items.value }\n parentIndentLines={ props.indentLines ? [] : undefined }\n indentLinesVariant={ indentLinesVariant }\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,6BAE5C;AAAA,SACSC,eAAe;AAAA,SACfC,eAAe,EAAEC,SAAS;AAAA,SAC1BC,eAAe,6CAExB;AACA,SAASC,QAAQ,EAAEC,OAAO,EAAEC,GAAG,EAAEC,KAAK,EAAEC,KAAK,QAAQ,KAAK;AAAA,SACjDC,gBAAgB,EAAEC,IAAI,EAAEC,YAAY,EAAEC,SAAS,+BAExD;AAAA,SAESC,eAAe;AAMxB,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,KAAK,EAAEC,OAAO;EACdC,OAAO,EAAED,OAAO;EAChBE,WAAW,EAAE,CAACF,OAAO,EAAEG,MAAM,CAA2C;EACxEC,MAA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AAA,aACDQ,SAAS,CAACR,KAAK;QAAA,sBAAAkD,MAAA,IAAf1C,SAAS,CAACR,KAAK,GAAAkD,MAAA;QAAA,YAChBxC,QAAQ,CAACV,KAAK;QAAA,qBAAAkD,MAAA,IAAdxC,QAAQ,CAACV,KAAK,GAAAkD;MAAA;QAAAC,OAAA,EAAAA,CAAA,MAAAL,YAAA,CAAA3F,iBAAA,EAAA4F,WAAA,CAG1BH,qBAAqB;UAAA,WAChB/C,KAAK,CAACyC,OAAO;UAAA,gBACRzC,KAAK,CAACyB,YAAY;UAAA,SACzBhD,KAAK,CAAC0B,KAAK;UAAA,qBACCH,KAAK,CAACX,WAAW,GAAG,EAAE,GAAGR,SAAS;UAAA,sBACjCmE;QAAkB,IAC7B1C,KAAK;MAAA;IAIvB,CAAC,CAAC;IAEF,OAAO,CAAE,CAAC;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@ import type { PropType } from 'vue';
|
|
|
3
3
|
import type { InternalListItem } from "../VList/VList.js";
|
|
4
4
|
import type { VListItemSlots } from "../VList/VListItem.js";
|
|
5
5
|
import type { SelectStrategyProp } from "../../composables/nested/nested.js";
|
|
6
|
-
import type { GenericProps } from "../../util/index.js";
|
|
6
|
+
import type { GenericProps, IndentLinesVariant, IndentLineType } from "../../util/index.js";
|
|
7
7
|
export type VTreeviewChildrenSlots<T> = {
|
|
8
8
|
[K in keyof Omit<VListItemSlots, 'default'>]: VListItemSlots[K] & {
|
|
9
9
|
item: T;
|
|
@@ -16,9 +16,16 @@ export type VTreeviewChildrenSlots<T> = {
|
|
|
16
16
|
item: T;
|
|
17
17
|
internalItem: InternalListItem<T>;
|
|
18
18
|
};
|
|
19
|
+
divider: {
|
|
20
|
+
props: InternalListItem['props'];
|
|
21
|
+
};
|
|
22
|
+
subheader: {
|
|
23
|
+
props: InternalListItem['props'];
|
|
24
|
+
};
|
|
19
25
|
};
|
|
20
26
|
export declare const makeVTreeviewChildrenProps: <Defaults extends {
|
|
21
27
|
density?: unknown;
|
|
28
|
+
hideActions?: unknown;
|
|
22
29
|
disabled?: unknown;
|
|
23
30
|
loadChildren?: unknown;
|
|
24
31
|
loadingIcon?: unknown;
|
|
@@ -28,10 +35,15 @@ export declare const makeVTreeviewChildrenProps: <Defaults extends {
|
|
|
28
35
|
falseIcon?: unknown;
|
|
29
36
|
trueIcon?: unknown;
|
|
30
37
|
returnObject?: unknown;
|
|
38
|
+
activatable?: unknown;
|
|
31
39
|
selectable?: unknown;
|
|
32
40
|
selectedColor?: unknown;
|
|
33
41
|
selectStrategy?: unknown;
|
|
34
42
|
index?: unknown;
|
|
43
|
+
isLastGroup?: unknown;
|
|
44
|
+
separateRoots?: unknown;
|
|
45
|
+
parentIndentLines?: unknown;
|
|
46
|
+
indentLinesVariant?: unknown;
|
|
35
47
|
path?: unknown;
|
|
36
48
|
} = {}>(defaults?: Defaults | undefined) => {
|
|
37
49
|
density: unknown extends Defaults["density"] ? {
|
|
@@ -46,6 +58,10 @@ export declare const makeVTreeviewChildrenProps: <Defaults extends {
|
|
|
46
58
|
type: PropType<unknown extends Defaults["density"] ? import("../../composables/density.js").Density : import("../../composables/density.js").Density | Defaults["density"]>;
|
|
47
59
|
default: unknown extends Defaults["density"] ? import("../../composables/density.js").Density : NonNullable<import("../../composables/density.js").Density> | Defaults["density"];
|
|
48
60
|
};
|
|
61
|
+
hideActions: unknown extends Defaults["hideActions"] ? BooleanConstructor : {
|
|
62
|
+
type: PropType<unknown extends Defaults["hideActions"] ? boolean : boolean | Defaults["hideActions"]>;
|
|
63
|
+
default: unknown extends Defaults["hideActions"] ? boolean : boolean | Defaults["hideActions"];
|
|
64
|
+
};
|
|
49
65
|
disabled: unknown extends Defaults["disabled"] ? BooleanConstructor : {
|
|
50
66
|
type: PropType<unknown extends Defaults["disabled"] ? boolean : boolean | Defaults["disabled"]>;
|
|
51
67
|
default: unknown extends Defaults["disabled"] ? boolean : boolean | Defaults["disabled"];
|
|
@@ -100,6 +116,10 @@ export declare const makeVTreeviewChildrenProps: <Defaults extends {
|
|
|
100
116
|
type: PropType<unknown extends Defaults["returnObject"] ? boolean : boolean | Defaults["returnObject"]>;
|
|
101
117
|
default: unknown extends Defaults["returnObject"] ? boolean : boolean | Defaults["returnObject"];
|
|
102
118
|
};
|
|
119
|
+
activatable: unknown extends Defaults["activatable"] ? BooleanConstructor : {
|
|
120
|
+
type: PropType<unknown extends Defaults["activatable"] ? boolean : boolean | Defaults["activatable"]>;
|
|
121
|
+
default: unknown extends Defaults["activatable"] ? boolean : boolean | Defaults["activatable"];
|
|
122
|
+
};
|
|
103
123
|
selectable: unknown extends Defaults["selectable"] ? BooleanConstructor : {
|
|
104
124
|
type: PropType<unknown extends Defaults["selectable"] ? boolean : boolean | Defaults["selectable"]>;
|
|
105
125
|
default: unknown extends Defaults["selectable"] ? boolean : boolean | Defaults["selectable"];
|
|
@@ -116,6 +136,22 @@ export declare const makeVTreeviewChildrenProps: <Defaults extends {
|
|
|
116
136
|
type: PropType<unknown extends Defaults["index"] ? number : number | Defaults["index"]>;
|
|
117
137
|
default: unknown extends Defaults["index"] ? number : number | Defaults["index"];
|
|
118
138
|
};
|
|
139
|
+
isLastGroup: unknown extends Defaults["isLastGroup"] ? BooleanConstructor : {
|
|
140
|
+
type: PropType<unknown extends Defaults["isLastGroup"] ? boolean : boolean | Defaults["isLastGroup"]>;
|
|
141
|
+
default: unknown extends Defaults["isLastGroup"] ? boolean : boolean | Defaults["isLastGroup"];
|
|
142
|
+
};
|
|
143
|
+
separateRoots: unknown extends Defaults["separateRoots"] ? BooleanConstructor : {
|
|
144
|
+
type: PropType<unknown extends Defaults["separateRoots"] ? boolean : boolean | Defaults["separateRoots"]>;
|
|
145
|
+
default: unknown extends Defaults["separateRoots"] ? boolean : boolean | Defaults["separateRoots"];
|
|
146
|
+
};
|
|
147
|
+
parentIndentLines: unknown extends Defaults["parentIndentLines"] ? PropType<IndentLineType[]> : {
|
|
148
|
+
type: PropType<unknown extends Defaults["parentIndentLines"] ? IndentLineType[] : IndentLineType[] | Defaults["parentIndentLines"]>;
|
|
149
|
+
default: unknown extends Defaults["parentIndentLines"] ? IndentLineType[] : IndentLineType[] | Defaults["parentIndentLines"];
|
|
150
|
+
};
|
|
151
|
+
indentLinesVariant: unknown extends Defaults["indentLinesVariant"] ? PropType<IndentLinesVariant> : {
|
|
152
|
+
type: PropType<unknown extends Defaults["indentLinesVariant"] ? IndentLinesVariant : IndentLinesVariant | Defaults["indentLinesVariant"]>;
|
|
153
|
+
default: unknown extends Defaults["indentLinesVariant"] ? IndentLinesVariant : Defaults["indentLinesVariant"] | NonNullable<IndentLinesVariant>;
|
|
154
|
+
};
|
|
119
155
|
path: unknown extends Defaults["path"] ? {
|
|
120
156
|
type: PropType<number[]>;
|
|
121
157
|
default: () => never[];
|
|
@@ -131,29 +167,37 @@ export declare const VTreeviewChildren: {
|
|
|
131
167
|
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<{
|
|
132
168
|
path: number[];
|
|
133
169
|
disabled: boolean;
|
|
170
|
+
isLastGroup: boolean;
|
|
171
|
+
separateRoots: boolean;
|
|
134
172
|
returnObject: boolean;
|
|
135
173
|
density: import("../../composables/density.js").Density;
|
|
136
174
|
indeterminateIcon: IconValue;
|
|
175
|
+
activatable: boolean;
|
|
137
176
|
selectable: boolean;
|
|
177
|
+
hideActions: boolean;
|
|
138
178
|
loadingIcon: string;
|
|
139
179
|
} & {
|
|
140
180
|
index?: number | undefined;
|
|
181
|
+
parentIndentLines?: IndentLineType[] | undefined;
|
|
141
182
|
selectStrategy?: SelectStrategyProp | undefined;
|
|
142
183
|
openOnClick?: boolean | undefined;
|
|
143
184
|
falseIcon?: IconValue | undefined;
|
|
144
185
|
trueIcon?: IconValue | undefined;
|
|
145
186
|
selectedColor?: string | undefined;
|
|
146
187
|
loadChildren?: ((item: unknown) => Promise<void>) | undefined;
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}>[] | JSX.Element)[] | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Omit<Record<string, any>, "$children" | "v-slots" | "v-slot:default" | "items" | "v-slot:prepend" | "v-slot:append" | "v-slot:title" | "v-slot:subtitle" | "v-slot:item">, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, {
|
|
188
|
+
indentLinesVariant?: IndentLinesVariant | undefined;
|
|
189
|
+
}, () => import("vue").VNodeChild[] | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Omit<Record<string, any>, "$children" | "v-slots" | "v-slot:default" | "items" | "v-slot:prepend" | "v-slot:append" | "v-slot:title" | "v-slot:subtitle" | "v-slot:item" | "v-slot:divider" | "v-slot:subheader">, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, {
|
|
150
190
|
path: number[];
|
|
151
191
|
disabled: boolean;
|
|
192
|
+
isLastGroup: boolean;
|
|
193
|
+
separateRoots: boolean;
|
|
152
194
|
returnObject: boolean;
|
|
153
195
|
density: import("../../composables/density.js").Density;
|
|
154
196
|
openOnClick: boolean;
|
|
155
197
|
indeterminateIcon: IconValue;
|
|
198
|
+
activatable: boolean;
|
|
156
199
|
selectable: boolean;
|
|
200
|
+
hideActions: boolean;
|
|
157
201
|
loadingIcon: string;
|
|
158
202
|
}, true, {}, import("vue").SlotsType<Partial<{
|
|
159
203
|
title: (arg: import("../VList/VListItem.js").ListItemTitleSlot & {
|
|
@@ -178,6 +222,12 @@ export declare const VTreeviewChildren: {
|
|
|
178
222
|
item: InternalListItem<any>;
|
|
179
223
|
internalItem: InternalListItem<InternalListItem<any>>;
|
|
180
224
|
}) => import("vue").VNode[];
|
|
225
|
+
divider: (arg: {
|
|
226
|
+
props: InternalListItem["props"];
|
|
227
|
+
}) => import("vue").VNode[];
|
|
228
|
+
subheader: (arg: {
|
|
229
|
+
props: InternalListItem["props"];
|
|
230
|
+
}) => import("vue").VNode[];
|
|
181
231
|
}>>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
182
232
|
P: {};
|
|
183
233
|
B: {};
|
|
@@ -188,29 +238,37 @@ export declare const VTreeviewChildren: {
|
|
|
188
238
|
}, {
|
|
189
239
|
path: number[];
|
|
190
240
|
disabled: boolean;
|
|
241
|
+
isLastGroup: boolean;
|
|
242
|
+
separateRoots: boolean;
|
|
191
243
|
returnObject: boolean;
|
|
192
244
|
density: import("../../composables/density.js").Density;
|
|
193
245
|
indeterminateIcon: IconValue;
|
|
246
|
+
activatable: boolean;
|
|
194
247
|
selectable: boolean;
|
|
248
|
+
hideActions: boolean;
|
|
195
249
|
loadingIcon: string;
|
|
196
250
|
} & {
|
|
197
251
|
index?: number | undefined;
|
|
252
|
+
parentIndentLines?: IndentLineType[] | undefined;
|
|
198
253
|
selectStrategy?: SelectStrategyProp | undefined;
|
|
199
254
|
openOnClick?: boolean | undefined;
|
|
200
255
|
falseIcon?: IconValue | undefined;
|
|
201
256
|
trueIcon?: IconValue | undefined;
|
|
202
257
|
selectedColor?: string | undefined;
|
|
203
258
|
loadChildren?: ((item: unknown) => Promise<void>) | undefined;
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}>[] | JSX.Element)[] | undefined, {}, {}, {}, {
|
|
259
|
+
indentLinesVariant?: IndentLinesVariant | undefined;
|
|
260
|
+
}, () => import("vue").VNodeChild[] | undefined, {}, {}, {}, {
|
|
207
261
|
path: number[];
|
|
208
262
|
disabled: boolean;
|
|
263
|
+
isLastGroup: boolean;
|
|
264
|
+
separateRoots: boolean;
|
|
209
265
|
returnObject: boolean;
|
|
210
266
|
density: import("../../composables/density.js").Density;
|
|
211
267
|
openOnClick: boolean;
|
|
212
268
|
indeterminateIcon: IconValue;
|
|
269
|
+
activatable: boolean;
|
|
213
270
|
selectable: boolean;
|
|
271
|
+
hideActions: boolean;
|
|
214
272
|
loadingIcon: string;
|
|
215
273
|
}>;
|
|
216
274
|
__isFragment?: never;
|
|
@@ -219,29 +277,37 @@ export declare const VTreeviewChildren: {
|
|
|
219
277
|
} & import("vue").ComponentOptionsBase<{
|
|
220
278
|
path: number[];
|
|
221
279
|
disabled: boolean;
|
|
280
|
+
isLastGroup: boolean;
|
|
281
|
+
separateRoots: boolean;
|
|
222
282
|
returnObject: boolean;
|
|
223
283
|
density: import("../../composables/density.js").Density;
|
|
224
284
|
indeterminateIcon: IconValue;
|
|
285
|
+
activatable: boolean;
|
|
225
286
|
selectable: boolean;
|
|
287
|
+
hideActions: boolean;
|
|
226
288
|
loadingIcon: string;
|
|
227
289
|
} & {
|
|
228
290
|
index?: number | undefined;
|
|
291
|
+
parentIndentLines?: IndentLineType[] | undefined;
|
|
229
292
|
selectStrategy?: SelectStrategyProp | undefined;
|
|
230
293
|
openOnClick?: boolean | undefined;
|
|
231
294
|
falseIcon?: IconValue | undefined;
|
|
232
295
|
trueIcon?: IconValue | undefined;
|
|
233
296
|
selectedColor?: string | undefined;
|
|
234
297
|
loadChildren?: ((item: unknown) => Promise<void>) | undefined;
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}>[] | JSX.Element)[] | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Omit<Record<string, any>, "$children" | "v-slots" | "v-slot:default" | "items" | "v-slot:prepend" | "v-slot:append" | "v-slot:title" | "v-slot:subtitle" | "v-slot:item">, string, {
|
|
298
|
+
indentLinesVariant?: IndentLinesVariant | undefined;
|
|
299
|
+
}, () => import("vue").VNodeChild[] | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Omit<Record<string, any>, "$children" | "v-slots" | "v-slot:default" | "items" | "v-slot:prepend" | "v-slot:append" | "v-slot:title" | "v-slot:subtitle" | "v-slot:item" | "v-slot:divider" | "v-slot:subheader">, string, {
|
|
238
300
|
path: number[];
|
|
239
301
|
disabled: boolean;
|
|
302
|
+
isLastGroup: boolean;
|
|
303
|
+
separateRoots: boolean;
|
|
240
304
|
returnObject: boolean;
|
|
241
305
|
density: import("../../composables/density.js").Density;
|
|
242
306
|
openOnClick: boolean;
|
|
243
307
|
indeterminateIcon: IconValue;
|
|
308
|
+
activatable: boolean;
|
|
244
309
|
selectable: boolean;
|
|
310
|
+
hideActions: boolean;
|
|
245
311
|
loadingIcon: string;
|
|
246
312
|
}, {}, string, import("vue").SlotsType<Partial<{
|
|
247
313
|
title: (arg: import("../VList/VListItem.js").ListItemTitleSlot & {
|
|
@@ -266,6 +332,12 @@ export declare const VTreeviewChildren: {
|
|
|
266
332
|
item: InternalListItem<any>;
|
|
267
333
|
internalItem: InternalListItem<InternalListItem<any>>;
|
|
268
334
|
}) => import("vue").VNode[];
|
|
335
|
+
divider: (arg: {
|
|
336
|
+
props: InternalListItem["props"];
|
|
337
|
+
}) => import("vue").VNode[];
|
|
338
|
+
subheader: (arg: {
|
|
339
|
+
props: InternalListItem["props"];
|
|
340
|
+
}) => import("vue").VNode[];
|
|
269
341
|
}>>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new <T extends InternalListItem>(props: {
|
|
270
342
|
items?: readonly T[];
|
|
271
343
|
}, slots: VTreeviewChildrenSlots<T>) => GenericProps<typeof props, typeof slots>) & import("../../util/index.js").FilterPropsOptions<{
|
|
@@ -274,6 +346,7 @@ export declare const VTreeviewChildren: {
|
|
|
274
346
|
default: string;
|
|
275
347
|
validator: (v: any) => boolean;
|
|
276
348
|
};
|
|
349
|
+
hideActions: BooleanConstructor;
|
|
277
350
|
disabled: BooleanConstructor;
|
|
278
351
|
loadChildren: PropType<(item: unknown) => Promise<void>>;
|
|
279
352
|
loadingIcon: {
|
|
@@ -292,10 +365,15 @@ export declare const VTreeviewChildren: {
|
|
|
292
365
|
falseIcon: PropType<IconValue>;
|
|
293
366
|
trueIcon: PropType<IconValue>;
|
|
294
367
|
returnObject: BooleanConstructor;
|
|
368
|
+
activatable: BooleanConstructor;
|
|
295
369
|
selectable: BooleanConstructor;
|
|
296
370
|
selectedColor: StringConstructor;
|
|
297
371
|
selectStrategy: PropType<SelectStrategyProp>;
|
|
298
372
|
index: NumberConstructor;
|
|
373
|
+
isLastGroup: BooleanConstructor;
|
|
374
|
+
separateRoots: BooleanConstructor;
|
|
375
|
+
parentIndentLines: PropType<IndentLineType[]>;
|
|
376
|
+
indentLinesVariant: PropType<IndentLinesVariant>;
|
|
299
377
|
path: {
|
|
300
378
|
type: PropType<number[]>;
|
|
301
379
|
default: () => never[];
|
|
@@ -306,6 +384,7 @@ export declare const VTreeviewChildren: {
|
|
|
306
384
|
default: string;
|
|
307
385
|
validator: (v: any) => boolean;
|
|
308
386
|
};
|
|
387
|
+
hideActions: BooleanConstructor;
|
|
309
388
|
disabled: BooleanConstructor;
|
|
310
389
|
loadChildren: PropType<(item: unknown) => Promise<void>>;
|
|
311
390
|
loadingIcon: {
|
|
@@ -324,10 +403,15 @@ export declare const VTreeviewChildren: {
|
|
|
324
403
|
falseIcon: PropType<IconValue>;
|
|
325
404
|
trueIcon: PropType<IconValue>;
|
|
326
405
|
returnObject: BooleanConstructor;
|
|
406
|
+
activatable: BooleanConstructor;
|
|
327
407
|
selectable: BooleanConstructor;
|
|
328
408
|
selectedColor: StringConstructor;
|
|
329
409
|
selectStrategy: PropType<SelectStrategyProp>;
|
|
330
410
|
index: NumberConstructor;
|
|
411
|
+
isLastGroup: BooleanConstructor;
|
|
412
|
+
separateRoots: BooleanConstructor;
|
|
413
|
+
parentIndentLines: PropType<IndentLineType[]>;
|
|
414
|
+
indentLinesVariant: PropType<IndentLinesVariant>;
|
|
331
415
|
path: {
|
|
332
416
|
type: PropType<number[]>;
|
|
333
417
|
default: () => never[];
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { Fragment as _Fragment, createVNode as _createVNode, createElementVNode as _createElementVNode, mergeProps as _mergeProps } from "vue";
|
|
2
2
|
// Components
|
|
3
3
|
import { VTreeviewGroup } from "./VTreeviewGroup.js";
|
|
4
|
-
import { VTreeviewItem } from "./VTreeviewItem.js";
|
|
5
|
-
import { VCheckboxBtn } from "../VCheckbox/index.js";
|
|
4
|
+
import { makeVTreeviewItemProps, VTreeviewItem } from "./VTreeviewItem.js";
|
|
5
|
+
import { VCheckboxBtn } from "../VCheckbox/index.js";
|
|
6
|
+
import { VDivider } from "../VDivider/index.js";
|
|
7
|
+
import { VListSubheader } from "../VList/index.js"; // Composables
|
|
6
8
|
import { makeDensityProps } from "../../composables/density.js";
|
|
7
9
|
import { IconValue } from "../../composables/icons.js"; // Utilities
|
|
8
|
-
import { computed, reactive,
|
|
9
|
-
import { genericComponent, propsFactory } from "../../util/index.js"; // Types
|
|
10
|
+
import { computed, reactive, ref, toRaw } from 'vue';
|
|
11
|
+
import { genericComponent, getIndentLines, pick, propsFactory, renderSlot } from "../../util/index.js"; // Types
|
|
10
12
|
export const makeVTreeviewChildrenProps = propsFactory({
|
|
11
13
|
disabled: Boolean,
|
|
12
14
|
loadChildren: Function,
|
|
@@ -26,14 +28,20 @@ export const makeVTreeviewChildrenProps = propsFactory({
|
|
|
26
28
|
falseIcon: IconValue,
|
|
27
29
|
trueIcon: IconValue,
|
|
28
30
|
returnObject: Boolean,
|
|
31
|
+
activatable: Boolean,
|
|
29
32
|
selectable: Boolean,
|
|
30
33
|
selectedColor: String,
|
|
31
34
|
selectStrategy: [String, Function, Object],
|
|
32
35
|
index: Number,
|
|
36
|
+
isLastGroup: Boolean,
|
|
37
|
+
separateRoots: Boolean,
|
|
38
|
+
parentIndentLines: Array,
|
|
39
|
+
indentLinesVariant: String,
|
|
33
40
|
path: {
|
|
34
41
|
type: Array,
|
|
35
42
|
default: () => []
|
|
36
43
|
},
|
|
44
|
+
...pick(makeVTreeviewItemProps(), ['hideActions']),
|
|
37
45
|
...makeDensityProps()
|
|
38
46
|
}, 'VTreeviewChildren');
|
|
39
47
|
export const VTreeviewChildren = genericComponent()({
|
|
@@ -44,7 +52,8 @@ export const VTreeviewChildren = genericComponent()({
|
|
|
44
52
|
slots
|
|
45
53
|
} = _ref;
|
|
46
54
|
const isLoading = reactive(new Set());
|
|
47
|
-
const
|
|
55
|
+
const activatorItems = ref([]);
|
|
56
|
+
const isClickOnOpen = computed(() => !props.disabled && (props.openOnClick != null ? props.openOnClick : props.selectable && !props.activatable));
|
|
48
57
|
async function checkChildren(item) {
|
|
49
58
|
try {
|
|
50
59
|
if (!props.items?.length || !props.loadChildren) return;
|
|
@@ -58,22 +67,35 @@ export const VTreeviewChildren = genericComponent()({
|
|
|
58
67
|
}
|
|
59
68
|
function selectItem(select, isSelected) {
|
|
60
69
|
if (props.selectable) {
|
|
61
|
-
select(
|
|
70
|
+
select(isSelected);
|
|
62
71
|
}
|
|
63
72
|
}
|
|
64
|
-
return () => slots.default?.() ?? props.items?.map((item, index) => {
|
|
73
|
+
return () => slots.default?.() ?? props.items?.map((item, index, items) => {
|
|
65
74
|
const {
|
|
66
75
|
children,
|
|
67
76
|
props: itemProps
|
|
68
77
|
} = item;
|
|
69
78
|
const loading = isLoading.has(item.value);
|
|
79
|
+
const nextItemHasChildren = !!items.at(index + 1)?.children;
|
|
80
|
+
const depth = props.path?.length ?? 0;
|
|
81
|
+
const isLast = items.length - 1 === index;
|
|
70
82
|
const treeItemProps = {
|
|
71
83
|
index,
|
|
72
|
-
depth
|
|
84
|
+
depth,
|
|
73
85
|
isFirst: index === 0,
|
|
74
|
-
isLast
|
|
75
|
-
path: [...props.path, index]
|
|
86
|
+
isLast,
|
|
87
|
+
path: [...props.path, index],
|
|
88
|
+
hideAction: props.hideActions
|
|
76
89
|
};
|
|
90
|
+
const indentLines = getIndentLines({
|
|
91
|
+
depth,
|
|
92
|
+
isLast,
|
|
93
|
+
isLastGroup: props.isLastGroup,
|
|
94
|
+
leafLinks: !props.hideActions,
|
|
95
|
+
separateRoots: props.separateRoots,
|
|
96
|
+
parentIndentLines: props.parentIndentLines,
|
|
97
|
+
variant: props.indentLinesVariant
|
|
98
|
+
});
|
|
77
99
|
const slotsWithItem = {
|
|
78
100
|
prepend: slotProps => _createElementVNode(_Fragment, null, [props.selectable && (!children || children && !['leaf', 'single-leaf'].includes(props.selectStrategy)) && _createElementVNode("div", null, [_createVNode(VCheckboxBtn, {
|
|
79
101
|
"key": item.value,
|
|
@@ -86,7 +108,8 @@ export const VTreeviewChildren = genericComponent()({
|
|
|
86
108
|
"indeterminateIcon": props.indeterminateIcon,
|
|
87
109
|
"falseIcon": props.falseIcon,
|
|
88
110
|
"trueIcon": props.trueIcon,
|
|
89
|
-
"
|
|
111
|
+
"onUpdate:modelValue": v => selectItem(slotProps.select, v),
|
|
112
|
+
"onClick": e => e.stopPropagation(),
|
|
90
113
|
"onKeydown": e => {
|
|
91
114
|
if (!['Enter', 'Space'].includes(e.key)) return;
|
|
92
115
|
e.stopPropagation();
|
|
@@ -133,24 +156,45 @@ export const VTreeviewChildren = genericComponent()({
|
|
|
133
156
|
...activatorProps,
|
|
134
157
|
value: itemProps?.value,
|
|
135
158
|
onToggleExpand: [() => checkChildren(item), activatorProps.onClick],
|
|
136
|
-
onClick: isClickOnOpen.value ? [() => checkChildren(item), activatorProps.onClick] :
|
|
159
|
+
onClick: isClickOnOpen.value ? [() => checkChildren(item), activatorProps.onClick] : () => selectItem(activatorItems.value[index]?.select, !activatorItems.value[index]?.isSelected)
|
|
137
160
|
};
|
|
138
|
-
return _createVNode(VTreeviewItem, _mergeProps(
|
|
161
|
+
return _createVNode(VTreeviewItem, _mergeProps({
|
|
162
|
+
"ref": el => activatorItems.value[index] = el
|
|
163
|
+
}, listItemProps, {
|
|
164
|
+
"hideActions": props.hideActions,
|
|
165
|
+
"indentLines": indentLines.node,
|
|
139
166
|
"value": props.returnObject ? item.raw : itemProps.value,
|
|
140
167
|
"loading": loading
|
|
141
168
|
}), slotsWithItem);
|
|
142
169
|
},
|
|
143
170
|
default: () => _createVNode(VTreeviewChildren, _mergeProps(treeviewChildrenProps, {
|
|
144
171
|
"items": children,
|
|
172
|
+
"indentLinesVariant": props.indentLinesVariant,
|
|
173
|
+
"parentIndentLines": indentLines.children,
|
|
174
|
+
"isLastGroup": nextItemHasChildren,
|
|
145
175
|
"returnObject": props.returnObject
|
|
146
176
|
}), slots)
|
|
147
|
-
}) : slots.item
|
|
177
|
+
}) : renderSlot(slots.item, {
|
|
148
178
|
props: itemProps,
|
|
149
179
|
item: item.raw,
|
|
150
180
|
internalItem: item
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
181
|
+
}, () => {
|
|
182
|
+
if (item.type === 'divider') {
|
|
183
|
+
return renderSlot(slots.divider, {
|
|
184
|
+
props: item.raw
|
|
185
|
+
}, () => _createVNode(VDivider, item.props, null));
|
|
186
|
+
}
|
|
187
|
+
if (item.type === 'subheader') {
|
|
188
|
+
return renderSlot(slots.subheader, {
|
|
189
|
+
props: item.raw
|
|
190
|
+
}, () => _createVNode(VListSubheader, item.props, null));
|
|
191
|
+
}
|
|
192
|
+
return _createVNode(VTreeviewItem, _mergeProps(itemProps, {
|
|
193
|
+
"hideActions": props.hideActions,
|
|
194
|
+
"indentLines": indentLines.leaf,
|
|
195
|
+
"value": props.returnObject ? toRaw(item.raw) : itemProps.value
|
|
196
|
+
}), slotsWithItem);
|
|
197
|
+
});
|
|
154
198
|
});
|
|
155
199
|
}
|
|
156
200
|
});
|