@dative-gpi/foundation-shared-components 0.0.8 → 0.0.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.
- package/{models/FSButtons.ts → aliases/FSButton.ts} +24 -21
- package/aliases/index.ts +1 -0
- package/components/FSAutocompleteField.vue +207 -0
- package/components/FSBadge.vue +38 -0
- package/components/FSBreadcrumbs.vue +49 -55
- package/components/FSButton.vue +116 -101
- package/components/FSCalendar.vue +52 -39
- package/components/FSCalendarTwin.vue +120 -102
- package/components/FSCard.vue +35 -21
- package/components/FSCarousel.vue +63 -0
- package/components/FSCheckbox.vue +111 -103
- package/components/FSChip.vue +140 -0
- package/components/FSClock.vue +149 -15
- package/components/FSCol.vue +104 -98
- package/components/FSColor.vue +61 -64
- package/components/FSColorIcon.vue +67 -0
- package/components/FSContainer.vue +64 -0
- package/components/FSDateField.vue +211 -0
- package/components/FSDateRangeField.vue +225 -0
- package/components/FSDateTimeField.vue +257 -0
- package/components/FSDateTimeRangeField.vue +286 -0
- package/components/FSDialog.vue +103 -0
- package/components/FSDivider.vue +39 -0
- package/components/FSFadeOut.vue +49 -59
- package/components/FSFileButton.vue +245 -0
- package/components/FSHeaderButton.vue +17 -0
- package/components/FSIcon.vue +23 -23
- package/components/FSIconField.vue +232 -0
- package/components/FSImage.vue +142 -0
- package/components/FSLoadTile.vue +93 -0
- package/components/FSNumberField.vue +51 -53
- package/components/FSPasswordField.vue +99 -101
- package/components/FSRadio.vue +107 -109
- package/components/FSRadioGroup.vue +55 -57
- package/components/FSRemoveDialog.vue +123 -0
- package/components/FSRichTextField.vue +26 -33
- package/components/FSRow.vue +110 -104
- package/components/FSSearchField.vue +35 -27
- package/components/FSSelectField.vue +188 -0
- package/components/FSSlideGroup.vue +45 -49
- package/components/FSSlider.vue +31 -33
- package/components/FSSpan.vue +53 -37
- package/components/FSSubmitDialog.vue +165 -0
- package/components/FSSwitch.vue +110 -109
- package/components/FSTab.vue +61 -61
- package/components/FSTabs.vue +53 -55
- package/components/FSTag.vue +88 -84
- package/components/FSTagField.vue +32 -36
- package/components/FSTagGroup.vue +38 -45
- package/components/FSText.vue +74 -64
- package/components/FSTextArea.vue +187 -185
- package/components/FSTextField.vue +18 -20
- package/components/FSTile.vue +90 -0
- package/components/FSToggleSet.vue +282 -0
- package/components/FSTooltip.vue +21 -0
- package/components/FSWindow.vue +26 -16
- package/components/FSWrapGroup.vue +44 -47
- package/components/deviceOrganisations/FSConnectivity.vue +114 -0
- package/components/deviceOrganisations/FSStatus.vue +117 -0
- package/components/deviceOrganisations/FSStatusesCarousel.vue +105 -0
- package/components/deviceOrganisations/FSStatusesRow.vue +66 -0
- package/components/deviceOrganisations/FSWorstAlert.vue +165 -0
- package/components/lists/FSDataIteratorGroup.vue +7 -0
- package/components/lists/FSDataIteratorItem.vue +103 -0
- package/components/lists/FSDataTable.vue +964 -0
- package/components/lists/FSFilterButton.vue +176 -0
- package/components/lists/FSHeaderButton.vue +99 -0
- package/components/lists/FSHiddenButton.vue +79 -0
- package/components/tiles/FSDeviceOrganisationTileUI.vue +232 -0
- package/components/tiles/FSGroupTileUI.vue +192 -0
- package/composables/index.ts +1 -1
- package/composables/useBreakpoints.ts +23 -4
- package/composables/useColors.ts +53 -23
- package/composables/useSlots.ts +43 -0
- package/index.ts +6 -0
- package/models/breadcrumbs.ts +8 -0
- package/models/colors.ts +17 -0
- package/models/deviceAlerts.ts +10 -0
- package/models/deviceConnectivities.ts +11 -0
- package/models/deviceStatuses.ts +16 -0
- package/models/dispositions.ts +33 -0
- package/models/index.ts +9 -0
- package/models/modelStatuses.ts +11 -0
- package/models/rules.ts +50 -0
- package/models/toggleSets.ts +7 -0
- package/package.json +5 -4
- package/plugins/colorPlugin.ts +2 -2
- package/shims-plugin.d.ts +1 -1
- package/styles/components/fs_autocomplete_field.scss +123 -0
- package/styles/components/fs_button.scss +4 -6
- package/styles/components/fs_calendar.scss +24 -1
- package/styles/components/fs_card.scss +2 -5
- package/styles/components/fs_carousel.scss +4 -0
- package/styles/components/fs_chip.scss +33 -0
- package/styles/components/fs_clock.scss +43 -0
- package/styles/components/fs_col.scss +2 -0
- package/styles/components/fs_color_icon.scss +37 -0
- package/styles/components/fs_container.scss +16 -0
- package/styles/components/fs_data_iterator_item.scss +19 -0
- package/styles/components/fs_data_table.scss +97 -0
- package/styles/components/fs_date_field.scss +8 -0
- package/styles/components/fs_dialog.scss +30 -0
- package/styles/components/fs_divider.scss +5 -0
- package/styles/components/fs_fade_out.scss +10 -2
- package/styles/components/fs_filter_button.scss +12 -0
- package/styles/components/fs_header_button.scss +4 -0
- package/styles/components/fs_icon.scss +19 -3
- package/styles/components/fs_icon_field.scss +12 -0
- package/styles/components/fs_image.scss +7 -0
- package/styles/components/fs_load_tile.scss +49 -0
- package/styles/components/fs_password_field.scss +2 -2
- package/styles/components/fs_row.scss +4 -1
- package/styles/components/fs_select_field.scss +71 -0
- package/styles/components/fs_slide_group.scss +6 -0
- package/styles/components/fs_slider.scss +29 -9
- package/styles/components/fs_span.scss +8 -0
- package/styles/components/fs_submit_dialog.scss +9 -0
- package/styles/components/fs_tabs.scss +4 -0
- package/styles/components/fs_tag_field.scss +0 -11
- package/styles/components/fs_text_field.scss +23 -15
- package/styles/components/fs_tile.scss +33 -0
- package/styles/components/fs_tooltip.scss +5 -0
- package/styles/components/fs_wrap_group.scss +7 -8
- package/styles/components/index.scss +21 -1
- package/styles/globals/breakpoints.scss +7 -0
- package/styles/globals/overrides.scss +20 -7
- package/styles/globals/text_fonts.scss +8 -8
- package/themes/default.ts +1 -11
- package/utils/css.ts +11 -0
- package/utils/icons.ts +75416 -0
- package/utils/index.ts +5 -1
- package/utils/levenshtein.ts +97 -0
- package/utils/sort.ts +9 -0
- package/components/FSDatePicker.vue +0 -226
- package/composables/useDates.ts +0 -39
- package/models/FSTags.ts +0 -8
- package/models/FSTextFields.ts +0 -23
- package/styles/components/fs_date_picker.scss +0 -0
- /package/utils/{FSRichTextField.ts → lexical.ts} +0 -0
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useTranslationsProvider } from "@dative-gpi/foundation-shared-services";
|
|
2
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
2
3
|
|
|
3
4
|
import FSButton from "@dative-gpi/foundation-shared-components/components/FSButton.vue";
|
|
4
5
|
|
|
6
|
+
const { $tr } = useTranslationsProvider();
|
|
7
|
+
|
|
5
8
|
export const FSButtonsAliases = {
|
|
6
9
|
FSButtonSearch: FSButton,
|
|
7
10
|
FSButtonSearchMini: FSButton,
|
|
@@ -20,92 +23,92 @@ export const FSButtonsAliases = {
|
|
|
20
23
|
export const FSButtonsProps = {
|
|
21
24
|
FSButtonSearch: {
|
|
22
25
|
prependIcon: "mdi-magnify",
|
|
23
|
-
label: "Search",
|
|
26
|
+
label: $tr("ui.button.search", "Search"),
|
|
24
27
|
variant: "standard",
|
|
25
|
-
color:
|
|
28
|
+
color: ColorEnum.Primary
|
|
26
29
|
},
|
|
27
30
|
FSButtonSearchMini: {
|
|
28
31
|
prependIcon: "mdi-magnify",
|
|
29
32
|
label: undefined,
|
|
30
33
|
variant: "standard",
|
|
31
|
-
color:
|
|
34
|
+
color: ColorEnum.Primary
|
|
32
35
|
},
|
|
33
36
|
FSButtonSearchIcon: {
|
|
34
37
|
icon: "mdi-magnify",
|
|
35
38
|
label: undefined,
|
|
36
39
|
variant: "icon",
|
|
37
|
-
color:
|
|
40
|
+
color: ColorEnum.Primary
|
|
38
41
|
},
|
|
39
42
|
FSButtonRemove: {
|
|
40
43
|
prependIcon: "mdi-delete-outline",
|
|
41
|
-
label: "Remove",
|
|
44
|
+
label: $tr("ui.button.remove", "Remove"),
|
|
42
45
|
variant: "standard",
|
|
43
|
-
color:
|
|
46
|
+
color: ColorEnum.Error
|
|
44
47
|
},
|
|
45
48
|
FSButtonRemoveMini: {
|
|
46
49
|
prependIcon: "mdi-delete-outline",
|
|
47
50
|
label: undefined,
|
|
48
51
|
variant: "standard",
|
|
49
|
-
color:
|
|
52
|
+
color: ColorEnum.Error
|
|
50
53
|
},
|
|
51
54
|
FSButtonRemoveIcon: {
|
|
52
55
|
icon: "mdi-delete-outline",
|
|
53
56
|
label: undefined,
|
|
54
57
|
variant: "icon",
|
|
55
|
-
color:
|
|
58
|
+
color: ColorEnum.Error
|
|
56
59
|
},
|
|
57
60
|
FSButtonSave: {
|
|
58
61
|
prependIcon: "mdi-content-save-outline",
|
|
59
|
-
label: "Save",
|
|
62
|
+
label: $tr("ui.button.save", "Save"),
|
|
60
63
|
variant: "standard",
|
|
61
|
-
color:
|
|
64
|
+
color: ColorEnum.Primary
|
|
62
65
|
},
|
|
63
66
|
FSButtonSaveMini: {
|
|
64
67
|
prependIcon: "mdi-content-save-outline",
|
|
65
68
|
label: undefined,
|
|
66
69
|
variant: "standard",
|
|
67
|
-
color:
|
|
70
|
+
color: ColorEnum.Primary
|
|
68
71
|
},
|
|
69
72
|
FSButtonSaveIcon: {
|
|
70
73
|
icon: "mdi-content-save-outline",
|
|
71
74
|
label: undefined,
|
|
72
75
|
variant: "icon",
|
|
73
|
-
color:
|
|
76
|
+
color: ColorEnum.Primary
|
|
74
77
|
},
|
|
75
78
|
FSButtonCancel: {
|
|
76
79
|
prependIcon: "mdi-cancel",
|
|
77
|
-
label: "Cancel",
|
|
80
|
+
label: $tr("ui.button.cancel", "Cancel"),
|
|
78
81
|
variant: "standard",
|
|
79
|
-
color:
|
|
82
|
+
color: ColorEnum.Light
|
|
80
83
|
},
|
|
81
84
|
FSButtonCancelMini: {
|
|
82
85
|
prependIcon: "mdi-cancel",
|
|
83
86
|
label: undefined,
|
|
84
87
|
variant: "standard",
|
|
85
|
-
color:
|
|
88
|
+
color: ColorEnum.Light
|
|
86
89
|
},
|
|
87
90
|
FSButtonCancelIcon: {
|
|
88
91
|
icon: "mdi-cancel",
|
|
89
92
|
label: undefined,
|
|
90
93
|
variant: "icon",
|
|
91
|
-
color:
|
|
94
|
+
color: ColorEnum.Light
|
|
92
95
|
},
|
|
93
96
|
FSButtonDocumentation: {
|
|
94
97
|
prependIcon: "mdi-file-document-outline",
|
|
95
|
-
label: "Documentation",
|
|
98
|
+
label: $tr("ui.button.documentation", "Documentation"),
|
|
96
99
|
variant: "standard",
|
|
97
|
-
color:
|
|
100
|
+
color: ColorEnum.Light
|
|
98
101
|
},
|
|
99
102
|
FSButtonDocumentationMini: {
|
|
100
103
|
prependIcon: "mdi-file-document-outline",
|
|
101
104
|
label: undefined,
|
|
102
105
|
variant: "standard",
|
|
103
|
-
color:
|
|
106
|
+
color: ColorEnum.Light
|
|
104
107
|
},
|
|
105
108
|
FSButtonDocumentationIcon: {
|
|
106
109
|
icon: "mdi-file-document-outline",
|
|
107
110
|
label: undefined,
|
|
108
111
|
variant: "icon",
|
|
109
|
-
color:
|
|
112
|
+
color: ColorEnum.Light
|
|
110
113
|
}
|
|
111
114
|
}
|
package/aliases/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./FSButton";
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSCol>
|
|
3
|
+
<slot v-if="!$props.hideHeader" name="label">
|
|
4
|
+
<FSRow :wrap="false">
|
|
5
|
+
<FSSpan
|
|
6
|
+
v-if="$props.label"
|
|
7
|
+
class="fs-autocomplete-field-label"
|
|
8
|
+
font="text-overline"
|
|
9
|
+
:style="style"
|
|
10
|
+
>
|
|
11
|
+
{{ $props.label }}
|
|
12
|
+
</FSSpan>
|
|
13
|
+
<FSSpan
|
|
14
|
+
v-if="$props.label && $props.required"
|
|
15
|
+
class="fs-autocomplete-field-label"
|
|
16
|
+
style="margin-left: -8px;"
|
|
17
|
+
font="text-overline"
|
|
18
|
+
:ellipsis="false"
|
|
19
|
+
:style="style"
|
|
20
|
+
>
|
|
21
|
+
*
|
|
22
|
+
</FSSpan>
|
|
23
|
+
<v-spacer style="min-width: 40px;" />
|
|
24
|
+
<FSSpan
|
|
25
|
+
v-if="messages.length > 0"
|
|
26
|
+
class="fs-autocomplete-field-messages"
|
|
27
|
+
font="text-overline"
|
|
28
|
+
:style="style"
|
|
29
|
+
>
|
|
30
|
+
{{ messages.join(", ") }}
|
|
31
|
+
</FSSpan>
|
|
32
|
+
</FSRow>
|
|
33
|
+
</slot>
|
|
34
|
+
<v-autocomplete
|
|
35
|
+
menuIcon="mdi-chevron-down"
|
|
36
|
+
clearIcon="mdi-close"
|
|
37
|
+
variant="outlined"
|
|
38
|
+
:style="style"
|
|
39
|
+
:class="classes"
|
|
40
|
+
:hideDetails="true"
|
|
41
|
+
:items="$props.items"
|
|
42
|
+
:autoSelectFirst="true"
|
|
43
|
+
:multiple="$props.multiple"
|
|
44
|
+
:error="messages.length > 0"
|
|
45
|
+
:itemTitle="$props.itemTitle"
|
|
46
|
+
:itemValue="$props.itemValue"
|
|
47
|
+
:readonly="!$props.editable"
|
|
48
|
+
:clearable="$props.editable"
|
|
49
|
+
:modelValue="$props.modelValue"
|
|
50
|
+
@update:modelValue="(value) => $emit('update:modelValue', value)"
|
|
51
|
+
v-model:search="innerSearch"
|
|
52
|
+
v-bind="$attrs"
|
|
53
|
+
>
|
|
54
|
+
<template v-for="(_, name) in slots" v-slot:[name]="slotData">
|
|
55
|
+
<slot :name="name" v-bind="slotData" />
|
|
56
|
+
</template>
|
|
57
|
+
</v-autocomplete>
|
|
58
|
+
<slot name="description">
|
|
59
|
+
<FSSpan
|
|
60
|
+
v-if="$props.description"
|
|
61
|
+
class="fs-autocomplete-field-description"
|
|
62
|
+
font="text-underline"
|
|
63
|
+
:style="style"
|
|
64
|
+
>
|
|
65
|
+
{{ $props.description }}
|
|
66
|
+
</FSSpan>
|
|
67
|
+
</slot>
|
|
68
|
+
</FSCol>
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
<script lang="ts">
|
|
72
|
+
import { computed, defineComponent, PropType, ref, watch } from "vue";
|
|
73
|
+
|
|
74
|
+
import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
75
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
76
|
+
|
|
77
|
+
import FSSpan from "./FSSpan.vue";
|
|
78
|
+
import FSCol from "./FSCol.vue";
|
|
79
|
+
import FSRow from "./FSRow.vue";
|
|
80
|
+
|
|
81
|
+
export default defineComponent({
|
|
82
|
+
name: "FSAutocompleteField",
|
|
83
|
+
components: {
|
|
84
|
+
FSSpan,
|
|
85
|
+
FSCol,
|
|
86
|
+
FSRow
|
|
87
|
+
},
|
|
88
|
+
props: {
|
|
89
|
+
label: {
|
|
90
|
+
type: String,
|
|
91
|
+
required: false,
|
|
92
|
+
default: null
|
|
93
|
+
},
|
|
94
|
+
description: {
|
|
95
|
+
type: String,
|
|
96
|
+
required: false,
|
|
97
|
+
default: null
|
|
98
|
+
},
|
|
99
|
+
items: {
|
|
100
|
+
type: Array as PropType<any[]>,
|
|
101
|
+
required: true
|
|
102
|
+
},
|
|
103
|
+
itemValue: {
|
|
104
|
+
type: String,
|
|
105
|
+
required: false,
|
|
106
|
+
default: "id"
|
|
107
|
+
},
|
|
108
|
+
itemTitle: {
|
|
109
|
+
type: String,
|
|
110
|
+
required: false,
|
|
111
|
+
default: "label"
|
|
112
|
+
},
|
|
113
|
+
modelValue: {
|
|
114
|
+
type: [Array, String] as PropType<string[] | string>,
|
|
115
|
+
required: false,
|
|
116
|
+
default: null
|
|
117
|
+
},
|
|
118
|
+
multiple: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
required: false,
|
|
121
|
+
default: false
|
|
122
|
+
},
|
|
123
|
+
hideHeader: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
required: false,
|
|
126
|
+
default: false
|
|
127
|
+
},
|
|
128
|
+
required: {
|
|
129
|
+
type: Boolean,
|
|
130
|
+
required: false,
|
|
131
|
+
default: false
|
|
132
|
+
},
|
|
133
|
+
rules: {
|
|
134
|
+
type: Array as PropType<Function[]>,
|
|
135
|
+
required: false,
|
|
136
|
+
default: () => []
|
|
137
|
+
},
|
|
138
|
+
editable: {
|
|
139
|
+
type: Boolean,
|
|
140
|
+
required: false,
|
|
141
|
+
default: true
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
emits: ["update:modelValue", "update:search"],
|
|
145
|
+
setup: (props, { emit }) => {
|
|
146
|
+
const { slots } = useSlots();
|
|
147
|
+
delete slots.label;
|
|
148
|
+
delete slots.description;
|
|
149
|
+
|
|
150
|
+
const innerSearch = ref("");
|
|
151
|
+
|
|
152
|
+
const errors = useColors().getColors(ColorEnum.Error);
|
|
153
|
+
const lights = useColors().getColors(ColorEnum.Light);
|
|
154
|
+
const darks = useColors().getColors(ColorEnum.Dark);
|
|
155
|
+
|
|
156
|
+
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
|
|
157
|
+
if (!props.editable) {
|
|
158
|
+
return {
|
|
159
|
+
"--fs-autocomplete-field-cursor" : "default",
|
|
160
|
+
"--fs-autocomplete-field-border-color" : lights.base,
|
|
161
|
+
"--fs-autocomplete-field-color" : lights.dark,
|
|
162
|
+
"--fs-autocomplete-field-active-border-color": lights.base
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
return {
|
|
166
|
+
"--fs-autocomplete-field-cursor" : "text",
|
|
167
|
+
"--fs-autocomplete-field-border-color" : lights.dark,
|
|
168
|
+
"--fs-autocomplete-field-color" : darks.base,
|
|
169
|
+
"--fs-autocomplete-field-active-border-color": darks.dark,
|
|
170
|
+
"--fs-autocomplete-field-error-color" : errors.base,
|
|
171
|
+
"--fs-autocomplete-field-error-border-color" : errors.base
|
|
172
|
+
};
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
const messages = computed((): string[] => {
|
|
176
|
+
const messages = [];
|
|
177
|
+
for (const rule of props.rules) {
|
|
178
|
+
const message = rule(props.modelValue ?? "");
|
|
179
|
+
if (typeof(message) === "string") {
|
|
180
|
+
messages.push(message);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return messages;
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
const classes = computed((): string[] => {
|
|
187
|
+
const classNames = ["fs-autocomplete-field"];
|
|
188
|
+
if (props.multiple) {
|
|
189
|
+
classNames.push("fs-autocomplete-multiple-field");
|
|
190
|
+
}
|
|
191
|
+
return classNames;
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
watch(innerSearch, () => {
|
|
195
|
+
emit("update:search", innerSearch.value);
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
return {
|
|
199
|
+
messages,
|
|
200
|
+
slots,
|
|
201
|
+
style,
|
|
202
|
+
classes,
|
|
203
|
+
innerSearch
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
</script>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-badge
|
|
3
|
+
v-if="$props.content"
|
|
4
|
+
:content="$props.content"
|
|
5
|
+
:color="$props.color"
|
|
6
|
+
:bordered="true"
|
|
7
|
+
>
|
|
8
|
+
<template v-slot:default>
|
|
9
|
+
<slot />
|
|
10
|
+
</template>
|
|
11
|
+
</v-badge>
|
|
12
|
+
<slot
|
|
13
|
+
v-else
|
|
14
|
+
name="default"
|
|
15
|
+
/>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script lang="ts">
|
|
19
|
+
import { defineComponent, PropType } from "vue";
|
|
20
|
+
|
|
21
|
+
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
22
|
+
|
|
23
|
+
export default defineComponent({
|
|
24
|
+
name: "FSBadge",
|
|
25
|
+
props: {
|
|
26
|
+
content: {
|
|
27
|
+
type: String,
|
|
28
|
+
required: false,
|
|
29
|
+
default: null
|
|
30
|
+
},
|
|
31
|
+
color: {
|
|
32
|
+
type: String as PropType<ColorBase>,
|
|
33
|
+
required: false,
|
|
34
|
+
default: ColorEnum.Primary
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
</script>
|
|
@@ -1,69 +1,63 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
<v-breadcrumbs v-bind="$attrs" :style="style" :items="$props.items">
|
|
3
|
+
<template #title="{ item }">
|
|
4
|
+
<FSSpan :class="classes(item)">
|
|
5
|
+
{{ item.title }}
|
|
6
|
+
</FSSpan>
|
|
7
|
+
</template>
|
|
8
|
+
<template #divider>
|
|
9
|
+
<FSIcon
|
|
10
|
+
class="fs-breadcrumbs-divider"
|
|
11
|
+
size="m"
|
|
12
|
+
>
|
|
13
|
+
mdi-chevron-right
|
|
14
|
+
</FSIcon>
|
|
15
|
+
</template>
|
|
16
|
+
</v-breadcrumbs>
|
|
14
17
|
</template>
|
|
15
18
|
|
|
16
19
|
<script lang="ts">
|
|
17
20
|
import { defineComponent, PropType, Ref, ref } from "vue";
|
|
18
21
|
|
|
22
|
+
import { ColorEnum, FSBreadcrumbItem } from "@dative-gpi/foundation-shared-components/models";
|
|
19
23
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
20
|
-
import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
|
|
21
24
|
|
|
22
25
|
import FSSpan from "./FSSpan.vue";
|
|
23
26
|
import FSIcon from "./FSIcon.vue";
|
|
24
27
|
|
|
25
|
-
export interface FSBreadcrumbItem {
|
|
26
|
-
href: string | undefined,
|
|
27
|
-
replace: boolean | undefined,
|
|
28
|
-
to: string | undefined,
|
|
29
|
-
exact: boolean | undefined,
|
|
30
|
-
title: string,
|
|
31
|
-
disabled: boolean
|
|
32
|
-
}
|
|
33
|
-
|
|
34
28
|
export default defineComponent({
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
setup() {
|
|
47
|
-
const darks = useColors().getColors(ColorBase.Dark);
|
|
48
|
-
|
|
49
|
-
const style: Ref<{ [code: string]: string } & Partial<CSSStyleDeclaration>> = ref({
|
|
50
|
-
"--fs-breadcrumbs-color": darks.dark,
|
|
51
|
-
"--fs-breadcrumbs-active-color": darks.base,
|
|
52
|
-
"--fs-breadcrumbs-disabled-color": darks.light
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
const classes = (item: FSBreadcrumbItem): string[] => {
|
|
56
|
-
const classes = ["fs-breadcrumbs-label"];
|
|
57
|
-
if (item.disabled) {
|
|
58
|
-
classes.push("fs-breadcrumbs-label--disabled");
|
|
59
|
-
}
|
|
60
|
-
return classes;
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
return {
|
|
64
|
-
style,
|
|
65
|
-
classes
|
|
66
|
-
};
|
|
29
|
+
name: "FSBreadcrumbs",
|
|
30
|
+
components: {
|
|
31
|
+
FSSpan,
|
|
32
|
+
FSIcon
|
|
33
|
+
},
|
|
34
|
+
props: {
|
|
35
|
+
items: {
|
|
36
|
+
type: Array as PropType<FSBreadcrumbItem[]>,
|
|
37
|
+
required: true,
|
|
67
38
|
}
|
|
68
|
-
}
|
|
39
|
+
},
|
|
40
|
+
setup() {
|
|
41
|
+
const darks = useColors().getColors(ColorEnum.Dark);
|
|
42
|
+
|
|
43
|
+
const style: Ref<{ [code: string]: string } & Partial<CSSStyleDeclaration>> = ref({
|
|
44
|
+
"--fs-breadcrumbs-color": darks.dark,
|
|
45
|
+
"--fs-breadcrumbs-active-color": darks.base,
|
|
46
|
+
"--fs-breadcrumbs-disabled-color": darks.light
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const classes = (item: FSBreadcrumbItem): string[] => {
|
|
50
|
+
const classNames = ["fs-breadcrumbs-label"];
|
|
51
|
+
if (item.disabled) {
|
|
52
|
+
classNames.push("fs-breadcrumbs-label--disabled");
|
|
53
|
+
}
|
|
54
|
+
return classNames;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
style,
|
|
59
|
+
classes
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
});
|
|
69
63
|
</script>
|