@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
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSCarousel
|
|
3
|
+
:height="height"
|
|
4
|
+
>
|
|
5
|
+
<template #prev="{ props }">
|
|
6
|
+
<FSButton
|
|
7
|
+
v-if="$props.modelStatuses.length > 1"
|
|
8
|
+
variant="icon"
|
|
9
|
+
icon="mdi-chevron-left"
|
|
10
|
+
:color="ColorEnum.Dark"
|
|
11
|
+
@click="props.onClick"
|
|
12
|
+
/>
|
|
13
|
+
</template>
|
|
14
|
+
<template #next="{ props }">
|
|
15
|
+
<FSButton
|
|
16
|
+
v-if="$props.modelStatuses.length > 1"
|
|
17
|
+
variant="icon"
|
|
18
|
+
icon="mdi-chevron-right"
|
|
19
|
+
:color="ColorEnum.Dark"
|
|
20
|
+
@click="props.onClick"
|
|
21
|
+
/>
|
|
22
|
+
</template>
|
|
23
|
+
<FSRow
|
|
24
|
+
v-for="(modelStatus, index) in $props.modelStatuses"
|
|
25
|
+
align="center-center"
|
|
26
|
+
width="hug"
|
|
27
|
+
gap="4px"
|
|
28
|
+
:key="index"
|
|
29
|
+
:wrap="false"
|
|
30
|
+
>
|
|
31
|
+
<FSStatus
|
|
32
|
+
v-for="(statusGroup, index) in deviceStatus(modelStatus)"
|
|
33
|
+
:modelStatus="modelStatus"
|
|
34
|
+
:statusGroup="statusGroup"
|
|
35
|
+
:key="index"
|
|
36
|
+
/>
|
|
37
|
+
</FSRow>
|
|
38
|
+
</FSCarousel>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script lang="ts">
|
|
42
|
+
import { computed, defineComponent, PropType, ref } from "vue";
|
|
43
|
+
|
|
44
|
+
import { FSDeviceStatus, FSDeviceStatusGroup, FSModelStatus } from "@dative-gpi/foundation-shared-components/models";
|
|
45
|
+
import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
|
|
46
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
47
|
+
|
|
48
|
+
import FSCarousel from "../FSCarousel.vue";
|
|
49
|
+
import FSButton from "../FSButton.vue";
|
|
50
|
+
import FSStatus from "./FSStatus.vue";
|
|
51
|
+
import FSRow from "../FSRow.vue";
|
|
52
|
+
|
|
53
|
+
export default defineComponent({
|
|
54
|
+
name: "FSStatusesCarousel",
|
|
55
|
+
components: {
|
|
56
|
+
FSCarousel,
|
|
57
|
+
FSButton,
|
|
58
|
+
FSStatus,
|
|
59
|
+
FSRow
|
|
60
|
+
},
|
|
61
|
+
props: {
|
|
62
|
+
modelStatuses: {
|
|
63
|
+
type: Array as PropType<FSModelStatus[]>,
|
|
64
|
+
required: true
|
|
65
|
+
},
|
|
66
|
+
deviceStatuses: {
|
|
67
|
+
type: Array as PropType<FSDeviceStatus[]>,
|
|
68
|
+
required: true
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
setup(props) {
|
|
72
|
+
const { isMobileSized } = useBreakpoints();
|
|
73
|
+
|
|
74
|
+
const tab = ref(0);
|
|
75
|
+
|
|
76
|
+
const height = computed((): number => {
|
|
77
|
+
return isMobileSized.value ? 20 : 26;
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
const deviceStatus = (modelStatus: FSModelStatus): FSDeviceStatusGroup[] => {
|
|
81
|
+
const deviceStatus = props.deviceStatuses
|
|
82
|
+
.find((deviceStatus: FSDeviceStatus) => deviceStatus.modelStatusId === modelStatus.id);
|
|
83
|
+
if (deviceStatus != null) {
|
|
84
|
+
return deviceStatus.statusGroups;
|
|
85
|
+
}
|
|
86
|
+
if (modelStatus.showDefault) {
|
|
87
|
+
return [{
|
|
88
|
+
label: modelStatus.label,
|
|
89
|
+
value: null,
|
|
90
|
+
icon: modelStatus.iconDefault,
|
|
91
|
+
color: modelStatus.colorDefault
|
|
92
|
+
}];
|
|
93
|
+
}
|
|
94
|
+
return [];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return {
|
|
98
|
+
ColorEnum,
|
|
99
|
+
height,
|
|
100
|
+
tab,
|
|
101
|
+
deviceStatus
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
</script>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSRow
|
|
3
|
+
v-for="(modelStatus, index) in $props.modelStatuses"
|
|
4
|
+
align="center-center"
|
|
5
|
+
width="hug"
|
|
6
|
+
gap="4px"
|
|
7
|
+
:key="index"
|
|
8
|
+
:wrap="false"
|
|
9
|
+
>
|
|
10
|
+
<FSStatus
|
|
11
|
+
v-for="(statusGroup, index) in deviceStatus(modelStatus)"
|
|
12
|
+
:modelStatus="modelStatus"
|
|
13
|
+
:statusGroup="statusGroup"
|
|
14
|
+
:key="index"
|
|
15
|
+
/>
|
|
16
|
+
</FSRow>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script lang="ts">
|
|
20
|
+
import { defineComponent, PropType } from "vue";
|
|
21
|
+
|
|
22
|
+
import { FSDeviceStatus, FSDeviceStatusGroup, FSModelStatus } from "@dative-gpi/foundation-shared-components/models";
|
|
23
|
+
|
|
24
|
+
import FSStatus from "./FSStatus.vue";
|
|
25
|
+
import FSRow from "../FSRow.vue";
|
|
26
|
+
|
|
27
|
+
export default defineComponent({
|
|
28
|
+
name: "FSStatusesRow",
|
|
29
|
+
components: {
|
|
30
|
+
FSStatus,
|
|
31
|
+
FSRow
|
|
32
|
+
},
|
|
33
|
+
props: {
|
|
34
|
+
modelStatuses: {
|
|
35
|
+
type: Array as PropType<FSModelStatus[]>,
|
|
36
|
+
required: true
|
|
37
|
+
},
|
|
38
|
+
deviceStatuses: {
|
|
39
|
+
type: Array as PropType<FSDeviceStatus[]>,
|
|
40
|
+
required: true
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
setup(props) {
|
|
44
|
+
const deviceStatus = (modelStatus: FSModelStatus): FSDeviceStatusGroup[] => {
|
|
45
|
+
const deviceStatus = props.deviceStatuses
|
|
46
|
+
.find((deviceStatus: FSDeviceStatus) => deviceStatus.modelStatusId === modelStatus.id);
|
|
47
|
+
if (deviceStatus != null) {
|
|
48
|
+
return deviceStatus.statusGroups;
|
|
49
|
+
}
|
|
50
|
+
if (modelStatus.showDefault) {
|
|
51
|
+
return [{
|
|
52
|
+
label: modelStatus.label,
|
|
53
|
+
value: null,
|
|
54
|
+
icon: modelStatus.iconDefault,
|
|
55
|
+
color: modelStatus.colorDefault
|
|
56
|
+
}];
|
|
57
|
+
}
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
deviceStatus
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
</script>
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-menu
|
|
3
|
+
v-if="$props.deviceAlert"
|
|
4
|
+
:closeOnContentClick="false"
|
|
5
|
+
v-model="menu"
|
|
6
|
+
>
|
|
7
|
+
<template #activator="{ props }">
|
|
8
|
+
<FSBadge
|
|
9
|
+
:content="badgeLabel"
|
|
10
|
+
:color="criticityColor"
|
|
11
|
+
>
|
|
12
|
+
<FSColorIcon
|
|
13
|
+
size="m"
|
|
14
|
+
variant="fill"
|
|
15
|
+
:color="criticityColor"
|
|
16
|
+
v-bind="props"
|
|
17
|
+
>
|
|
18
|
+
{{ statusIcon }}
|
|
19
|
+
</FSColorIcon>
|
|
20
|
+
</FSBadge>
|
|
21
|
+
</template>
|
|
22
|
+
<FSCard
|
|
23
|
+
:elevation="true"
|
|
24
|
+
:border="false"
|
|
25
|
+
>
|
|
26
|
+
<FSCol
|
|
27
|
+
align="center-center"
|
|
28
|
+
padding="6px 24px"
|
|
29
|
+
>
|
|
30
|
+
<FSCol
|
|
31
|
+
align="center-center"
|
|
32
|
+
gap="12px"
|
|
33
|
+
>
|
|
34
|
+
<FSChip
|
|
35
|
+
:color="criticityColor"
|
|
36
|
+
:prependIcon="statusIcon"
|
|
37
|
+
:label="$props.deviceAlert.label"
|
|
38
|
+
/>
|
|
39
|
+
<FSRow
|
|
40
|
+
width="hug"
|
|
41
|
+
>
|
|
42
|
+
<FSText>
|
|
43
|
+
{{ statusLabel }}
|
|
44
|
+
</FSText>
|
|
45
|
+
</FSRow>
|
|
46
|
+
</FSCol>
|
|
47
|
+
<FSRow
|
|
48
|
+
v-if="deviceTimestamp"
|
|
49
|
+
width="hug"
|
|
50
|
+
>
|
|
51
|
+
<FSSpan
|
|
52
|
+
font="text-overline"
|
|
53
|
+
>
|
|
54
|
+
{{ deviceTimestamp }}
|
|
55
|
+
</FSSpan>
|
|
56
|
+
</FSRow>
|
|
57
|
+
</FSCol>
|
|
58
|
+
</FSCard>
|
|
59
|
+
</v-menu>
|
|
60
|
+
</template>
|
|
61
|
+
|
|
62
|
+
<script lang="ts">
|
|
63
|
+
import { computed, defineComponent, PropType, ref } from "vue";
|
|
64
|
+
|
|
65
|
+
import { useTimeZone, useTranslationsProvider } from "@dative-gpi/foundation-shared-services/composables";
|
|
66
|
+
import { AlertStatus, Criticity } from "@dative-gpi/foundation-shared-domain/models";
|
|
67
|
+
import { FSDeviceAlert } from "@dative-gpi/foundation-shared-components/models";
|
|
68
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
69
|
+
|
|
70
|
+
import FSColorIcon from "../FSColorIcon.vue";
|
|
71
|
+
import FSBadge from "../FSBadge.vue";
|
|
72
|
+
import FSCard from "../FSCard.vue";
|
|
73
|
+
import FSChip from "../FSChip.vue";
|
|
74
|
+
import FSText from "../FSText.vue";
|
|
75
|
+
import FSSpan from "../FSSpan.vue";
|
|
76
|
+
|
|
77
|
+
export default defineComponent({
|
|
78
|
+
name: "FSWorstAlert",
|
|
79
|
+
components: {
|
|
80
|
+
FSColorIcon,
|
|
81
|
+
FSBadge,
|
|
82
|
+
FSCard,
|
|
83
|
+
FSChip,
|
|
84
|
+
FSText,
|
|
85
|
+
FSSpan
|
|
86
|
+
},
|
|
87
|
+
props: {
|
|
88
|
+
deviceAlert: {
|
|
89
|
+
type: Object as PropType<FSDeviceAlert>,
|
|
90
|
+
required: true
|
|
91
|
+
},
|
|
92
|
+
deviceAlerts: {
|
|
93
|
+
type: Number,
|
|
94
|
+
required: false,
|
|
95
|
+
default: 0
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
setup(props) {
|
|
99
|
+
const { epochToLongTimeFormat } = useTimeZone();
|
|
100
|
+
const { $tr } = useTranslationsProvider();
|
|
101
|
+
|
|
102
|
+
const menu = ref(false);
|
|
103
|
+
|
|
104
|
+
const criticityColor = computed(() => {
|
|
105
|
+
switch (props.deviceAlert?.criticity) {
|
|
106
|
+
case Criticity.Error: return ColorEnum.Error;
|
|
107
|
+
case Criticity.Warning: return ColorEnum.Warning;
|
|
108
|
+
default: return ColorEnum.Primary;
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
const statusIcon = computed(() => {
|
|
113
|
+
switch (props.deviceAlert?.status) {
|
|
114
|
+
case AlertStatus.Pending: return "mdi-timer-outline";
|
|
115
|
+
case AlertStatus.Untriggered: return "mdi-timer-off-outline";
|
|
116
|
+
case AlertStatus.Unresolved: return "mdi-alert-circle-outline";
|
|
117
|
+
case AlertStatus.Resolved: return "mdi-check-circle-outline";
|
|
118
|
+
case AlertStatus.Expired: return "mdi-clock-outline";
|
|
119
|
+
case AlertStatus.Triggered: return "mdi-alert-circle-outline";
|
|
120
|
+
case AlertStatus.Abandoned: return "mdi-cancel"
|
|
121
|
+
default: return "";
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
const statusLabel = computed(() => {
|
|
126
|
+
switch (props.deviceAlert?.status) {
|
|
127
|
+
case AlertStatus.Pending: return $tr("ui.alert-status.pending", "Pending");
|
|
128
|
+
case AlertStatus.Untriggered: return $tr("ui.alert-status.untriggered", "Untriggered");
|
|
129
|
+
case AlertStatus.Unresolved: return $tr("ui.alert-status.unresolved", "Unresolved");
|
|
130
|
+
case AlertStatus.Resolved: return $tr("ui.alert-status.resolved", "Resolved");
|
|
131
|
+
case AlertStatus.Expired: return $tr("ui.alert-status.expired", "Expired");
|
|
132
|
+
case AlertStatus.Triggered: return $tr("ui.alert-status.triggered", "Triggered");
|
|
133
|
+
case AlertStatus.Abandoned: return $tr("ui.alert-status.abandoned", "Abandoned");
|
|
134
|
+
default: return "";
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
const badgeLabel = computed((): string | null => {
|
|
139
|
+
if (props.deviceAlerts < 1) {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
if (props.deviceAlerts > 8) {
|
|
143
|
+
return "9+";
|
|
144
|
+
}
|
|
145
|
+
return (props.deviceAlerts + 1).toString();
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
const deviceTimestamp = computed((): string => {
|
|
149
|
+
if (props.deviceAlert.sourceTimestamp) {
|
|
150
|
+
return epochToLongTimeFormat(props.deviceAlert.sourceTimestamp);
|
|
151
|
+
}
|
|
152
|
+
return "";
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
return {
|
|
156
|
+
deviceTimestamp,
|
|
157
|
+
criticityColor,
|
|
158
|
+
statusLabel,
|
|
159
|
+
statusIcon,
|
|
160
|
+
badgeLabel,
|
|
161
|
+
menu
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
</script>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSCard
|
|
3
|
+
class="fs-data-iterator-item"
|
|
4
|
+
padding="12px"
|
|
5
|
+
width="50%"
|
|
6
|
+
>
|
|
7
|
+
<FSCol>
|
|
8
|
+
<slot name="item.top" v-bind="{ item: $props.item }" />
|
|
9
|
+
<FSRow
|
|
10
|
+
v-for="(header, index) in $props.headers"
|
|
11
|
+
align="center-left"
|
|
12
|
+
:wrap="false"
|
|
13
|
+
:key="index"
|
|
14
|
+
>
|
|
15
|
+
<slot :name="`header.${header.value}`" v-bind="{ header }">
|
|
16
|
+
<FSRow
|
|
17
|
+
align="center-left"
|
|
18
|
+
>
|
|
19
|
+
<FSText
|
|
20
|
+
font="text-button"
|
|
21
|
+
>
|
|
22
|
+
{{ header.text }}
|
|
23
|
+
</FSText>
|
|
24
|
+
</FSRow>
|
|
25
|
+
</slot>
|
|
26
|
+
<slot :name="`item.${header.value}`" v-bind="{ item: $props.item }">
|
|
27
|
+
<FSRow
|
|
28
|
+
align="center-left"
|
|
29
|
+
>
|
|
30
|
+
<FSText>
|
|
31
|
+
{{ $props.item[header.value] }}
|
|
32
|
+
</FSText>
|
|
33
|
+
</FSRow>
|
|
34
|
+
</slot>
|
|
35
|
+
</FSRow>
|
|
36
|
+
<slot name="item.bottom" v-bind="{ item: $props.item }" />
|
|
37
|
+
</FSCol>
|
|
38
|
+
<FSContainer
|
|
39
|
+
v-if="$props.showSelect"
|
|
40
|
+
class="fs-data-iterator-item-checkbox"
|
|
41
|
+
:border="false"
|
|
42
|
+
>
|
|
43
|
+
<FSCheckbox
|
|
44
|
+
:color="$props.color"
|
|
45
|
+
:modelValue="$props.modelValue"
|
|
46
|
+
@update:modelValue="() => $emit('update:modelValue', $props.item)"
|
|
47
|
+
/>
|
|
48
|
+
</FSContainer>
|
|
49
|
+
</FSCard>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<script lang="ts">
|
|
53
|
+
import { defineComponent, PropType } from "vue";
|
|
54
|
+
|
|
55
|
+
import { ColorEnum, FSDataTableColumn } from "@dative-gpi/foundation-shared-components/models";
|
|
56
|
+
|
|
57
|
+
import FSContainer from "../FSContainer.vue";
|
|
58
|
+
import FSCheckbox from "../FSCheckbox.vue";
|
|
59
|
+
import FSCard from "../FSCard.vue";
|
|
60
|
+
import FSText from "../FSText.vue";
|
|
61
|
+
import FSRow from "../FSRow.vue";
|
|
62
|
+
|
|
63
|
+
export default defineComponent({
|
|
64
|
+
name: "FSIteratorCard",
|
|
65
|
+
components: {
|
|
66
|
+
FSContainer,
|
|
67
|
+
FSCheckbox,
|
|
68
|
+
FSCard,
|
|
69
|
+
FSText,
|
|
70
|
+
FSRow
|
|
71
|
+
},
|
|
72
|
+
props: {
|
|
73
|
+
headers: {
|
|
74
|
+
type: Array as PropType<FSDataTableColumn[]>,
|
|
75
|
+
required: true
|
|
76
|
+
},
|
|
77
|
+
item: {
|
|
78
|
+
type: Object,
|
|
79
|
+
required: true
|
|
80
|
+
},
|
|
81
|
+
itemTo: {
|
|
82
|
+
type: Function,
|
|
83
|
+
required: false,
|
|
84
|
+
default: null
|
|
85
|
+
},
|
|
86
|
+
modelValue: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
required: false,
|
|
89
|
+
default: false
|
|
90
|
+
},
|
|
91
|
+
color: {
|
|
92
|
+
type: String as PropType<ColorEnum>,
|
|
93
|
+
required: false,
|
|
94
|
+
default: ColorEnum.Primary
|
|
95
|
+
},
|
|
96
|
+
showSelect: {
|
|
97
|
+
type: Boolean,
|
|
98
|
+
required: false,
|
|
99
|
+
default: true
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
</script>
|