design-system-next 2.12.1 → 2.12.6
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/design-system-next.es.js +8040 -8213
- package/dist/design-system-next.es.js.gz +0 -0
- package/dist/design-system-next.umd.js +12 -12
- package/dist/design-system-next.umd.js.gz +0 -0
- package/dist/main.css +1 -1
- package/dist/main.css.gz +0 -0
- package/dist/package.json.d.ts +1 -1
- package/package.json +1 -1
- package/src/App.vue +49 -1
- package/src/assets/scripts/border-radius.ts +15 -15
- package/src/assets/scripts/colors.ts +134 -134
- package/src/assets/scripts/max-width.ts +11 -11
- package/src/assets/scripts/spacing.ts +23 -23
- package/src/assets/scripts/utilities.ts +15 -15
- package/src/components/accordion/accordion.ts +43 -43
- package/src/components/accordion/use-accordion.ts +43 -43
- package/src/components/avatar/avatar.ts +71 -64
- package/src/components/avatar/avatar.vue +10 -5
- package/src/components/avatar/use-avatar.ts +14 -3
- package/src/components/badge/badge.ts +43 -43
- package/src/components/banner/banner.ts +20 -20
- package/src/components/button/button.ts +72 -72
- package/src/components/button/button.vue +15 -15
- package/src/components/calendar/calendar.ts +12 -2
- package/src/components/card/card.ts +52 -52
- package/src/components/checkbox/checkbox.ts +45 -45
- package/src/components/chips/chips.ts +101 -95
- package/src/components/chips/use-chips.ts +11 -3
- package/src/components/collapsible/collapsible.ts +21 -21
- package/src/components/collapsible/collapsible.vue +27 -27
- package/src/components/date-picker/__tests__/date-picker.test.ts +112 -112
- package/src/components/date-picker/date-picker.ts +157 -157
- package/src/components/dropdown/__tests__/dropdown-fixes.spec.ts +106 -106
- package/src/components/dropdown/__tests__/dropdown-value-types.spec.ts +213 -213
- package/src/components/dropdown/fix-multi-number.ts +92 -92
- package/src/components/dropdown/use-dropdown.ts +488 -488
- package/src/components/empty-state/empty-state.ts +50 -50
- package/src/components/file-upload/file-upload.ts +87 -87
- package/src/components/floating-action/floating-action.ts +12 -12
- package/src/components/input/input-contact-number/input-contact-number.ts +83 -83
- package/src/components/input/input-email/input-email.vue +17 -17
- package/src/components/input/input-password/use-input-password.ts +19 -19
- package/src/components/input/input-search/input-search.vue +13 -13
- package/src/components/input/input-url/input-url.vue +20 -20
- package/src/components/input/input-username/input-username.vue +17 -17
- package/src/components/input/input.vue +72 -72
- package/src/components/list/ladderized-list/ladderized-list.ts +39 -39
- package/src/components/logo/logo.ts +43 -43
- package/src/components/logo/logo.vue +14 -14
- package/src/components/logo/use-logo.ts +41 -41
- package/src/components/modal/modal.ts +45 -45
- package/src/components/progress-bar/progress-bar.ts +39 -39
- package/src/components/radio/radio.ts +42 -42
- package/src/components/select/select.ts +144 -144
- package/src/components/sidenav/sidenav.ts +5 -4
- package/src/components/sidenav/sidenav.vue +66 -50
- package/src/components/sidenav/use-sidenav.ts +29 -20
- package/src/components/sidepanel/sidepanel.vue +55 -55
- package/src/components/sidepanel/stacking-sidepanel/stacking-sidepanel.ts +16 -16
- package/src/components/sidepanel/stacking-sidepanel/stacking-sidepanel.vue +39 -39
- package/src/components/slider/slider.ts +38 -38
- package/src/components/snackbar/snack/snack.ts +71 -71
- package/src/components/snackbar/use-snackbar.ts +34 -34
- package/src/components/status/status.ts +19 -19
- package/src/components/status/status.vue +13 -13
- package/src/components/stepper/step/step.ts +47 -47
- package/src/components/stepper/stepper.ts +47 -47
- package/src/components/stepper/stepper.vue +34 -34
- package/src/components/switch/switch.ts +42 -42
- package/src/components/table/table-actions/table-actions.ts +42 -42
- package/src/components/table/table-actions/table-actions.vue +40 -40
- package/src/components/table/table-chips-title/table-chips-title.ts +27 -27
- package/src/components/table/table-chips-title/table-chips-title.vue +32 -32
- package/src/components/table/table-chips-title/use-table-chips-title.ts +22 -22
- package/src/components/table/table-lozenge-title/table-lozenge-title.ts +23 -23
- package/src/components/table/table-lozenge-title/table-lozenge-title.vue +26 -26
- package/src/components/table/table-lozenge-title/use-table-lozenge-title.ts +21 -21
- package/src/components/table/table-pagination/table-pagination.ts +63 -63
- package/src/components/table/table-pagination/table-pagination.vue +72 -72
- package/src/components/table/table.ts +174 -173
- package/src/components/table/table.vue +2 -2
- package/src/components/table/use-table.ts +13 -8
- package/src/components/tabs/tabs.ts +43 -43
- package/src/components/textarea/textarea.ts +72 -72
- package/src/components/textarea/textarea.vue +45 -45
- package/src/components/time-picker/time-picker.ts +69 -69
- package/src/components/tooltip/use-tooltip.ts +13 -13
- package/src/stores/useSnackbarStore.ts +44 -44
- package/src/examples/dropdown-number-multi-select.vue +0 -76
- package/src/vite-env.d.ts +0 -6
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
|
|
3
|
-
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
-
|
|
5
|
-
export const radioPropTypes = {
|
|
6
|
-
id: {
|
|
7
|
-
type: String,
|
|
8
|
-
required: true,
|
|
9
|
-
},
|
|
10
|
-
modelValue: {
|
|
11
|
-
type: [String, Number, Boolean],
|
|
12
|
-
},
|
|
13
|
-
disabled: {
|
|
14
|
-
type: Boolean,
|
|
15
|
-
default: false,
|
|
16
|
-
},
|
|
17
|
-
name: {
|
|
18
|
-
type: String,
|
|
19
|
-
required: true,
|
|
20
|
-
},
|
|
21
|
-
value: {
|
|
22
|
-
type: [String, Number, Boolean],
|
|
23
|
-
required: true,
|
|
24
|
-
},
|
|
25
|
-
description: {
|
|
26
|
-
type: String,
|
|
27
|
-
},
|
|
28
|
-
bordered: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
default: false,
|
|
31
|
-
},
|
|
32
|
-
fullWidth: {
|
|
33
|
-
type: Boolean,
|
|
34
|
-
default: false,
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export const radioEmitTypes = ['update:modelValue'];
|
|
39
|
-
|
|
40
|
-
export type RadioPropTypes = ExtractPropTypes<typeof radioPropTypes>;
|
|
41
|
-
|
|
42
|
-
export type RadioEmitTypes = typeof radioEmitTypes;
|
|
1
|
+
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
4
|
+
|
|
5
|
+
export const radioPropTypes = {
|
|
6
|
+
id: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: [String, Number, Boolean],
|
|
12
|
+
},
|
|
13
|
+
disabled: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: false,
|
|
16
|
+
},
|
|
17
|
+
name: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
value: {
|
|
22
|
+
type: [String, Number, Boolean],
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
description: {
|
|
26
|
+
type: String,
|
|
27
|
+
},
|
|
28
|
+
bordered: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: false,
|
|
31
|
+
},
|
|
32
|
+
fullWidth: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false,
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const radioEmitTypes = ['update:modelValue'];
|
|
39
|
+
|
|
40
|
+
export type RadioPropTypes = ExtractPropTypes<typeof radioPropTypes>;
|
|
41
|
+
|
|
42
|
+
export type RadioEmitTypes = typeof radioEmitTypes;
|
|
@@ -1,144 +1,144 @@
|
|
|
1
|
-
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
-
import type { MenuListType } from '../list/list';
|
|
3
|
-
|
|
4
|
-
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
5
|
-
|
|
6
|
-
const GROUPED_ITEMS_BY_TYPES = ['A-Z', 'Z-A'] as const;
|
|
7
|
-
|
|
8
|
-
const PLACEMENTS_TYPES = [
|
|
9
|
-
'auto',
|
|
10
|
-
'auto-start',
|
|
11
|
-
'auto-end',
|
|
12
|
-
'top',
|
|
13
|
-
'top-start',
|
|
14
|
-
'top-end',
|
|
15
|
-
'right',
|
|
16
|
-
'right-start',
|
|
17
|
-
'right-end',
|
|
18
|
-
'bottom',
|
|
19
|
-
'bottom-start',
|
|
20
|
-
'bottom-end',
|
|
21
|
-
'left',
|
|
22
|
-
'left-start',
|
|
23
|
-
'left-end',
|
|
24
|
-
] as const;
|
|
25
|
-
|
|
26
|
-
const POPPER_STRATEGY_TYPES = ['fixed', 'absolute'] as const;
|
|
27
|
-
|
|
28
|
-
export const selectPropTypes = {
|
|
29
|
-
id: {
|
|
30
|
-
type: String,
|
|
31
|
-
required: true,
|
|
32
|
-
default: 'select',
|
|
33
|
-
},
|
|
34
|
-
modelValue: {
|
|
35
|
-
type: [String, Number, Object, Array] as PropType<
|
|
36
|
-
string | number | Record<string, unknown> | (string | number | Record<string, unknown>)[]
|
|
37
|
-
>,
|
|
38
|
-
default: '',
|
|
39
|
-
},
|
|
40
|
-
options: {
|
|
41
|
-
type: Array as PropType<MenuListType[] | string[] | Record<string, unknown>[]>,
|
|
42
|
-
required: true,
|
|
43
|
-
default: [],
|
|
44
|
-
},
|
|
45
|
-
groupItemsBy: {
|
|
46
|
-
type: String as PropType<(typeof GROUPED_ITEMS_BY_TYPES)[number]>,
|
|
47
|
-
validator: (value: (typeof GROUPED_ITEMS_BY_TYPES)[number] | undefined) => {
|
|
48
|
-
return value === undefined || GROUPED_ITEMS_BY_TYPES.includes(value);
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
textField: {
|
|
52
|
-
type: String,
|
|
53
|
-
default: 'text',
|
|
54
|
-
description: 'Field name to use for display text when using dynamic object arrays',
|
|
55
|
-
},
|
|
56
|
-
valueField: {
|
|
57
|
-
type: String,
|
|
58
|
-
default: 'value',
|
|
59
|
-
description: 'Field name to use for value when using dynamic object arrays',
|
|
60
|
-
},
|
|
61
|
-
placeholder: {
|
|
62
|
-
type: String,
|
|
63
|
-
},
|
|
64
|
-
label: {
|
|
65
|
-
type: String,
|
|
66
|
-
default: '',
|
|
67
|
-
},
|
|
68
|
-
placement: {
|
|
69
|
-
type: String as PropType<(typeof PLACEMENTS_TYPES)[number]>,
|
|
70
|
-
validator: (value: (typeof PLACEMENTS_TYPES)[number]) => PLACEMENTS_TYPES.includes(value),
|
|
71
|
-
default: 'bottom',
|
|
72
|
-
},
|
|
73
|
-
popperStrategy: {
|
|
74
|
-
type: String,
|
|
75
|
-
validator: (value: 'fixed' | 'absolute') => POPPER_STRATEGY_TYPES.includes(value),
|
|
76
|
-
default: 'absolute',
|
|
77
|
-
},
|
|
78
|
-
popperWidth: {
|
|
79
|
-
type: String,
|
|
80
|
-
default: '100%',
|
|
81
|
-
},
|
|
82
|
-
width: {
|
|
83
|
-
type: String,
|
|
84
|
-
default: '100%',
|
|
85
|
-
},
|
|
86
|
-
wrapperPosition: {
|
|
87
|
-
type: String,
|
|
88
|
-
default: 'relative',
|
|
89
|
-
},
|
|
90
|
-
displayText: {
|
|
91
|
-
type: String,
|
|
92
|
-
default: '',
|
|
93
|
-
},
|
|
94
|
-
displayHelper: {
|
|
95
|
-
type: Boolean,
|
|
96
|
-
default: false,
|
|
97
|
-
},
|
|
98
|
-
helperIcon: {
|
|
99
|
-
type: String,
|
|
100
|
-
default: null,
|
|
101
|
-
},
|
|
102
|
-
helperText: {
|
|
103
|
-
type: String,
|
|
104
|
-
default: '',
|
|
105
|
-
},
|
|
106
|
-
active: {
|
|
107
|
-
type: Boolean,
|
|
108
|
-
default: false,
|
|
109
|
-
},
|
|
110
|
-
disabled: {
|
|
111
|
-
type: Boolean,
|
|
112
|
-
default: false,
|
|
113
|
-
},
|
|
114
|
-
error: {
|
|
115
|
-
type: Boolean,
|
|
116
|
-
default: false,
|
|
117
|
-
},
|
|
118
|
-
clearable: {
|
|
119
|
-
type: Boolean,
|
|
120
|
-
default: false,
|
|
121
|
-
},
|
|
122
|
-
searchable: {
|
|
123
|
-
type: Boolean,
|
|
124
|
-
default: false,
|
|
125
|
-
},
|
|
126
|
-
disabledLocalSearch: {
|
|
127
|
-
type: Boolean,
|
|
128
|
-
default: false,
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
export const selectEmitTypes = {
|
|
133
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
134
|
-
'update:modelValue': (_value: unknown) => true,
|
|
135
|
-
|
|
136
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
137
|
-
'infinite-scroll-trigger': (_triggered: boolean) => true,
|
|
138
|
-
|
|
139
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
140
|
-
'search-string': (_search: string | number) => true,
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
export type SelectPropTypes = ExtractPropTypes<typeof selectPropTypes>;
|
|
144
|
-
export type SelectEmitTypes = typeof selectEmitTypes;
|
|
1
|
+
import type { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
import type { MenuListType } from '../list/list';
|
|
3
|
+
|
|
4
|
+
export const definePropType = <T>(val: unknown): PropType<T> => val as PropType<T>;
|
|
5
|
+
|
|
6
|
+
const GROUPED_ITEMS_BY_TYPES = ['A-Z', 'Z-A'] as const;
|
|
7
|
+
|
|
8
|
+
const PLACEMENTS_TYPES = [
|
|
9
|
+
'auto',
|
|
10
|
+
'auto-start',
|
|
11
|
+
'auto-end',
|
|
12
|
+
'top',
|
|
13
|
+
'top-start',
|
|
14
|
+
'top-end',
|
|
15
|
+
'right',
|
|
16
|
+
'right-start',
|
|
17
|
+
'right-end',
|
|
18
|
+
'bottom',
|
|
19
|
+
'bottom-start',
|
|
20
|
+
'bottom-end',
|
|
21
|
+
'left',
|
|
22
|
+
'left-start',
|
|
23
|
+
'left-end',
|
|
24
|
+
] as const;
|
|
25
|
+
|
|
26
|
+
const POPPER_STRATEGY_TYPES = ['fixed', 'absolute'] as const;
|
|
27
|
+
|
|
28
|
+
export const selectPropTypes = {
|
|
29
|
+
id: {
|
|
30
|
+
type: String,
|
|
31
|
+
required: true,
|
|
32
|
+
default: 'select',
|
|
33
|
+
},
|
|
34
|
+
modelValue: {
|
|
35
|
+
type: [String, Number, Object, Array] as PropType<
|
|
36
|
+
string | number | Record<string, unknown> | (string | number | Record<string, unknown>)[]
|
|
37
|
+
>,
|
|
38
|
+
default: '',
|
|
39
|
+
},
|
|
40
|
+
options: {
|
|
41
|
+
type: Array as PropType<MenuListType[] | string[] | Record<string, unknown>[]>,
|
|
42
|
+
required: true,
|
|
43
|
+
default: [],
|
|
44
|
+
},
|
|
45
|
+
groupItemsBy: {
|
|
46
|
+
type: String as PropType<(typeof GROUPED_ITEMS_BY_TYPES)[number]>,
|
|
47
|
+
validator: (value: (typeof GROUPED_ITEMS_BY_TYPES)[number] | undefined) => {
|
|
48
|
+
return value === undefined || GROUPED_ITEMS_BY_TYPES.includes(value);
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
textField: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: 'text',
|
|
54
|
+
description: 'Field name to use for display text when using dynamic object arrays',
|
|
55
|
+
},
|
|
56
|
+
valueField: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: 'value',
|
|
59
|
+
description: 'Field name to use for value when using dynamic object arrays',
|
|
60
|
+
},
|
|
61
|
+
placeholder: {
|
|
62
|
+
type: String,
|
|
63
|
+
},
|
|
64
|
+
label: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: '',
|
|
67
|
+
},
|
|
68
|
+
placement: {
|
|
69
|
+
type: String as PropType<(typeof PLACEMENTS_TYPES)[number]>,
|
|
70
|
+
validator: (value: (typeof PLACEMENTS_TYPES)[number]) => PLACEMENTS_TYPES.includes(value),
|
|
71
|
+
default: 'bottom',
|
|
72
|
+
},
|
|
73
|
+
popperStrategy: {
|
|
74
|
+
type: String,
|
|
75
|
+
validator: (value: 'fixed' | 'absolute') => POPPER_STRATEGY_TYPES.includes(value),
|
|
76
|
+
default: 'absolute',
|
|
77
|
+
},
|
|
78
|
+
popperWidth: {
|
|
79
|
+
type: String,
|
|
80
|
+
default: '100%',
|
|
81
|
+
},
|
|
82
|
+
width: {
|
|
83
|
+
type: String,
|
|
84
|
+
default: '100%',
|
|
85
|
+
},
|
|
86
|
+
wrapperPosition: {
|
|
87
|
+
type: String,
|
|
88
|
+
default: 'relative',
|
|
89
|
+
},
|
|
90
|
+
displayText: {
|
|
91
|
+
type: String,
|
|
92
|
+
default: '',
|
|
93
|
+
},
|
|
94
|
+
displayHelper: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
default: false,
|
|
97
|
+
},
|
|
98
|
+
helperIcon: {
|
|
99
|
+
type: String,
|
|
100
|
+
default: null,
|
|
101
|
+
},
|
|
102
|
+
helperText: {
|
|
103
|
+
type: String,
|
|
104
|
+
default: '',
|
|
105
|
+
},
|
|
106
|
+
active: {
|
|
107
|
+
type: Boolean,
|
|
108
|
+
default: false,
|
|
109
|
+
},
|
|
110
|
+
disabled: {
|
|
111
|
+
type: Boolean,
|
|
112
|
+
default: false,
|
|
113
|
+
},
|
|
114
|
+
error: {
|
|
115
|
+
type: Boolean,
|
|
116
|
+
default: false,
|
|
117
|
+
},
|
|
118
|
+
clearable: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: false,
|
|
121
|
+
},
|
|
122
|
+
searchable: {
|
|
123
|
+
type: Boolean,
|
|
124
|
+
default: false,
|
|
125
|
+
},
|
|
126
|
+
disabledLocalSearch: {
|
|
127
|
+
type: Boolean,
|
|
128
|
+
default: false,
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export const selectEmitTypes = {
|
|
133
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
134
|
+
'update:modelValue': (_value: unknown) => true,
|
|
135
|
+
|
|
136
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
137
|
+
'infinite-scroll-trigger': (_triggered: boolean) => true,
|
|
138
|
+
|
|
139
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
140
|
+
'search-string': (_search: string | number) => true,
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export type SelectPropTypes = ExtractPropTypes<typeof selectPropTypes>;
|
|
144
|
+
export type SelectEmitTypes = typeof selectEmitTypes;
|
|
@@ -95,10 +95,11 @@ export type Attributes = {
|
|
|
95
95
|
name: string;
|
|
96
96
|
value: unknown | string | number | boolean | AttrLozenge;
|
|
97
97
|
};
|
|
98
|
-
|
|
98
|
+
|
|
99
|
+
export type AttrLozenge = {
|
|
99
100
|
label: string;
|
|
100
101
|
tone?: string;
|
|
101
|
-
}
|
|
102
|
+
};
|
|
102
103
|
|
|
103
104
|
export interface MappedNavItem {
|
|
104
105
|
title: string;
|
|
@@ -108,7 +109,7 @@ export interface MappedNavItem {
|
|
|
108
109
|
isAbsoluteURL: boolean;
|
|
109
110
|
link: string;
|
|
110
111
|
};
|
|
111
|
-
attributes?: AttrLozenge | unknown
|
|
112
|
+
attributes?: AttrLozenge | unknown[];
|
|
112
113
|
menuLinks?: {
|
|
113
114
|
menuHeading: string;
|
|
114
115
|
items: MappedNavItem[];
|
|
@@ -137,7 +138,7 @@ export const sidenavPropTypes = {
|
|
|
137
138
|
},
|
|
138
139
|
navLinks: {
|
|
139
140
|
type: Object as PropType<NavLinks>,
|
|
140
|
-
default: () => [],
|
|
141
|
+
default: () => ({ top: [], bottom: [] }),
|
|
141
142
|
},
|
|
142
143
|
notificationCount: {
|
|
143
144
|
type: [String, Number],
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
'spr-hidden-scrolls spr-fixed spr-bottom-0 spr-left-0 spr-top-0',
|
|
5
5
|
'spr-background-color spr-w-auto spr-overflow-y-auto spr-overflow-x-hidden',
|
|
6
6
|
'spr-border-color-weak spr-border-b-0 spr-border-l-0 spr-border-r spr-border-t-0 spr-border-solid',
|
|
7
|
-
'spr-transition spr-duration-150 spr-ease-in-out',
|
|
7
|
+
'spr-z-10 spr-transition spr-duration-150 spr-ease-in-out',
|
|
8
8
|
]"
|
|
9
9
|
>
|
|
10
10
|
<div
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
:triggers="[]"
|
|
40
40
|
:popper-hide-triggers="[]"
|
|
41
41
|
instant-move
|
|
42
|
+
:delay="0"
|
|
42
43
|
>
|
|
43
44
|
<div
|
|
44
45
|
:class="{
|
|
@@ -153,6 +154,7 @@
|
|
|
153
154
|
placement="right"
|
|
154
155
|
:triggers="['click', 'hover']"
|
|
155
156
|
instant-move
|
|
157
|
+
:delay="0"
|
|
156
158
|
>
|
|
157
159
|
<!-- #region - Parent Links -->
|
|
158
160
|
<div
|
|
@@ -225,6 +227,7 @@
|
|
|
225
227
|
placement="right-start"
|
|
226
228
|
:triggers="['click', 'hover']"
|
|
227
229
|
instant-move
|
|
230
|
+
:delay="0"
|
|
228
231
|
>
|
|
229
232
|
<!-- #region - Menu links -->
|
|
230
233
|
<div
|
|
@@ -242,10 +245,10 @@
|
|
|
242
245
|
></div>
|
|
243
246
|
<span>{{ menuLinkItem.title }}</span>
|
|
244
247
|
<div class="spr-flex spr-items-center spr-gap-1">
|
|
245
|
-
<template v-for="(attr, i) in menuLinkItem?.attributes" :key="i">
|
|
248
|
+
<template v-for="(attr, i) in menuLinkItem?.attributes" :key="i">
|
|
246
249
|
<spr-lozenge
|
|
247
250
|
v-if="attr?.name === 'lozenge' && attr?.value"
|
|
248
|
-
:label="(attr
|
|
251
|
+
:label="getLozengeLabel(attr)"
|
|
249
252
|
:tone="getLozengeTone(attr)"
|
|
250
253
|
fill
|
|
251
254
|
/>
|
|
@@ -266,7 +269,12 @@
|
|
|
266
269
|
"sidenav-submenu-l2-wrapper" - Popper is currently hidden since sidenav only has 1 level of submenu links.
|
|
267
270
|
-->
|
|
268
271
|
<template #popper>
|
|
269
|
-
<Menu
|
|
272
|
+
<Menu
|
|
273
|
+
aria-id="sidenav-submenu-l2-wrapper"
|
|
274
|
+
:triggers="['click', 'hover']"
|
|
275
|
+
instant-move
|
|
276
|
+
:delay="0"
|
|
277
|
+
>
|
|
270
278
|
<template
|
|
271
279
|
v-for="(submenuLink, submenuLinkIndex) in menuLinkItem.submenuLinks"
|
|
272
280
|
:key="submenuLinkIndex"
|
|
@@ -310,12 +318,13 @@
|
|
|
310
318
|
v-show="props.activeNav.submenu === submenuLinkItem.title"
|
|
311
319
|
class="spr-background-color-brand-base spr-absolute spr-left-0 spr-top-0 spr-h-full spr-w-[2px]"
|
|
312
320
|
></div>
|
|
313
|
-
<span>{{ submenuLinkItem.title }}</span>
|
|
314
321
|
<div class="spr-flex spr-items-center spr-gap-1">
|
|
315
|
-
<
|
|
322
|
+
<span>{{ submenuLinkItem.title }}</span>
|
|
323
|
+
|
|
324
|
+
<template v-for="(attr, i) in submenuLinkItem?.attributes" :key="i">
|
|
316
325
|
<spr-lozenge
|
|
317
326
|
v-if="attr?.name === 'lozenge' && attr?.value"
|
|
318
|
-
:label="(attr
|
|
327
|
+
:label="getLozengeLabel(attr)"
|
|
319
328
|
:tone="getLozengeTone(attr)"
|
|
320
329
|
fill
|
|
321
330
|
/>
|
|
@@ -350,10 +359,10 @@
|
|
|
350
359
|
class="spr-background-color-brand-base spr-absolute spr-left-0 spr-top-0 spr-h-full spr-w-[2px]"
|
|
351
360
|
></div>
|
|
352
361
|
<span>{{ menuLinkItem.title }}</span>
|
|
353
|
-
<template v-for="(attr, i) in menuLinkItem?.attributes" :key="i">
|
|
362
|
+
<template v-for="(attr, i) in menuLinkItem?.attributes" :key="i">
|
|
354
363
|
<spr-lozenge
|
|
355
364
|
v-if="attr?.name === 'lozenge' && attr?.value"
|
|
356
|
-
:label="(attr
|
|
365
|
+
:label="getLozengeLabel(attr)"
|
|
357
366
|
:tone="getLozengeTone(attr)"
|
|
358
367
|
fill
|
|
359
368
|
/>
|
|
@@ -417,7 +426,6 @@
|
|
|
417
426
|
<Icon v-else icon="ph:globe" />
|
|
418
427
|
</template>
|
|
419
428
|
</div>
|
|
420
|
-
<!-- #endregion - Parent Links -->
|
|
421
429
|
</spr-tooltip>
|
|
422
430
|
</template>
|
|
423
431
|
<!-- #endregion - Parent link only -->
|
|
@@ -449,7 +457,7 @@
|
|
|
449
457
|
placement="right"
|
|
450
458
|
:triggers="['click', 'hover']"
|
|
451
459
|
instant-move
|
|
452
|
-
:
|
|
460
|
+
:delay="0"
|
|
453
461
|
>
|
|
454
462
|
<!-- #region - Parent Links -->
|
|
455
463
|
<div
|
|
@@ -522,6 +530,7 @@
|
|
|
522
530
|
placement="right-start"
|
|
523
531
|
:triggers="['click', 'hover']"
|
|
524
532
|
instant-move
|
|
533
|
+
:delay="0"
|
|
525
534
|
>
|
|
526
535
|
<!-- #region - Menu links -->
|
|
527
536
|
<div
|
|
@@ -553,7 +562,12 @@
|
|
|
553
562
|
"sidenav-submenu-l2-wrapper" - Popper is currently hidden since sidenav only has 1 level of submenu links.
|
|
554
563
|
-->
|
|
555
564
|
<template #popper>
|
|
556
|
-
<Menu
|
|
565
|
+
<Menu
|
|
566
|
+
aria-id="sidenav-submenu-l2-wrapper"
|
|
567
|
+
:triggers="['click', 'hover']"
|
|
568
|
+
instant-move
|
|
569
|
+
:delay="0"
|
|
570
|
+
>
|
|
557
571
|
<template
|
|
558
572
|
v-for="(submenuLink, submenuLinkIndex) in menuLinkItem.submenuLinks"
|
|
559
573
|
:key="submenuLinkIndex"
|
|
@@ -597,7 +611,18 @@
|
|
|
597
611
|
v-show="props.activeNav.submenu === submenuLinkItem.title"
|
|
598
612
|
class="spr-background-color-brand-base spr-absolute spr-left-0 spr-top-0 spr-h-full spr-w-[2px]"
|
|
599
613
|
></div>
|
|
600
|
-
<
|
|
614
|
+
<div class="spr-flex spr-items-center spr-gap-1">
|
|
615
|
+
<span>{{ submenuLinkItem.title }}</span>
|
|
616
|
+
|
|
617
|
+
<template v-for="(attr, i) in submenuLinkItem?.attributes" :key="i">
|
|
618
|
+
<spr-lozenge
|
|
619
|
+
v-if="attr?.name === 'lozenge' && attr?.value"
|
|
620
|
+
:label="getLozengeLabel(attr)"
|
|
621
|
+
:tone="getLozengeTone(attr)"
|
|
622
|
+
fill
|
|
623
|
+
/>
|
|
624
|
+
</template>
|
|
625
|
+
</div>
|
|
601
626
|
</div>
|
|
602
627
|
<!-- #endregion - Submenu Links -->
|
|
603
628
|
</template>
|
|
@@ -775,30 +800,24 @@
|
|
|
775
800
|
<Menu
|
|
776
801
|
v-model:shown="isUserMenuVisible"
|
|
777
802
|
aria-id="user-menu-wrapper"
|
|
778
|
-
distance="
|
|
803
|
+
distance="16"
|
|
779
804
|
placement="right"
|
|
780
805
|
:triggers="['click', 'hover']"
|
|
781
806
|
instant-move
|
|
807
|
+
:delay="0"
|
|
782
808
|
>
|
|
783
|
-
<
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
>
|
|
795
|
-
<template v-if="props.userMenu.profileImage && !userProfileError">
|
|
796
|
-
<img :src="props.userMenu.profileImage" alt="profile" @error="userProfileError = true" />
|
|
797
|
-
</template>
|
|
798
|
-
<template v-else>
|
|
799
|
-
<span>{{ getUserInitials(props.userMenu.name) }}</span>
|
|
800
|
-
</template>
|
|
801
|
-
</div>
|
|
809
|
+
<template v-if="props.userMenu.profileImage">
|
|
810
|
+
<spr-avatar
|
|
811
|
+
class="spr-cursor-pointer"
|
|
812
|
+
variant="image"
|
|
813
|
+
:src="props.userMenu.profileImage"
|
|
814
|
+
:initial="props.userMenu.name"
|
|
815
|
+
size="md"
|
|
816
|
+
/>
|
|
817
|
+
</template>
|
|
818
|
+
<template v-else>
|
|
819
|
+
<spr-avatar class="spr-cursor-pointer" :initial="props.userMenu.name" size="md" />
|
|
820
|
+
</template>
|
|
802
821
|
|
|
803
822
|
<template #popper>
|
|
804
823
|
<div
|
|
@@ -808,20 +827,17 @@
|
|
|
808
827
|
]"
|
|
809
828
|
>
|
|
810
829
|
<div class="spr-flex spr-items-center spr-gap-2">
|
|
811
|
-
<
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
<span>{{ getUserInitials(props.userMenu.name) }}</span>
|
|
823
|
-
</template>
|
|
824
|
-
</div>
|
|
830
|
+
<template v-if="props.userMenu.profileImage">
|
|
831
|
+
<spr-avatar
|
|
832
|
+
variant="image"
|
|
833
|
+
:src="props.userMenu.profileImage"
|
|
834
|
+
:initial="props.userMenu.name"
|
|
835
|
+
size="md"
|
|
836
|
+
/>
|
|
837
|
+
</template>
|
|
838
|
+
<template v-else>
|
|
839
|
+
<spr-avatar :initial="props.userMenu.name" size="md" />
|
|
840
|
+
</template>
|
|
825
841
|
<div class="spr-grid spr-justify-between spr-gap-1">
|
|
826
842
|
<h3 class="spr-body-sm-regular spr-m-0 spr-truncate">
|
|
827
843
|
{{ props.userMenu.name }}
|
|
@@ -873,9 +889,10 @@ import 'floating-vue/dist/style.css';
|
|
|
873
889
|
import { sidenavPropTypes, sidenavEmitTypes } from './sidenav';
|
|
874
890
|
import { useSidenav } from './use-sidenav';
|
|
875
891
|
|
|
876
|
-
import
|
|
892
|
+
import SprAvatar from '../avatar/avatar.vue';
|
|
877
893
|
import SprBadge from '../badge/badge.vue';
|
|
878
894
|
import SprLozenge from '../lozenge/lozenge.vue';
|
|
895
|
+
import SprTooltip from '../tooltip/tooltip.vue';
|
|
879
896
|
|
|
880
897
|
const props = defineProps(sidenavPropTypes);
|
|
881
898
|
const emit = defineEmits(sidenavEmitTypes);
|
|
@@ -884,10 +901,9 @@ const {
|
|
|
884
901
|
navLinks,
|
|
885
902
|
isQuckActionMenuVisible,
|
|
886
903
|
isUserMenuVisible,
|
|
887
|
-
userProfileError,
|
|
888
|
-
getUserInitials,
|
|
889
904
|
handleRedirect,
|
|
890
905
|
generateId,
|
|
906
|
+
getLozengeLabel,
|
|
891
907
|
getLozengeTone,
|
|
892
908
|
} = useSidenav(props, emit);
|
|
893
909
|
</script>
|