@dative-gpi/foundation-shared-components 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/{models/FSButtons.ts → aliases/FSButton.ts} +24 -21
  2. package/aliases/index.ts +1 -0
  3. package/components/FSAutocompleteField.vue +207 -0
  4. package/components/FSBadge.vue +38 -0
  5. package/components/FSBreadcrumbs.vue +49 -55
  6. package/components/FSButton.vue +116 -101
  7. package/components/FSCalendar.vue +52 -39
  8. package/components/FSCalendarTwin.vue +120 -102
  9. package/components/FSCard.vue +35 -21
  10. package/components/FSCarousel.vue +63 -0
  11. package/components/FSCheckbox.vue +111 -103
  12. package/components/FSChip.vue +140 -0
  13. package/components/FSClock.vue +149 -15
  14. package/components/FSCol.vue +104 -98
  15. package/components/FSColor.vue +61 -64
  16. package/components/FSColorIcon.vue +67 -0
  17. package/components/FSContainer.vue +64 -0
  18. package/components/FSDateField.vue +211 -0
  19. package/components/FSDateRangeField.vue +225 -0
  20. package/components/FSDateTimeField.vue +257 -0
  21. package/components/FSDateTimeRangeField.vue +286 -0
  22. package/components/FSDialog.vue +103 -0
  23. package/components/FSDivider.vue +39 -0
  24. package/components/FSFadeOut.vue +49 -59
  25. package/components/FSFileButton.vue +245 -0
  26. package/components/FSHeaderButton.vue +17 -0
  27. package/components/FSIcon.vue +23 -23
  28. package/components/FSIconField.vue +232 -0
  29. package/components/FSImage.vue +142 -0
  30. package/components/FSLoadTile.vue +93 -0
  31. package/components/FSNumberField.vue +51 -53
  32. package/components/FSPasswordField.vue +99 -101
  33. package/components/FSRadio.vue +107 -109
  34. package/components/FSRadioGroup.vue +55 -57
  35. package/components/FSRemoveDialog.vue +123 -0
  36. package/components/FSRichTextField.vue +26 -33
  37. package/components/FSRow.vue +110 -104
  38. package/components/FSSearchField.vue +35 -27
  39. package/components/FSSelectField.vue +188 -0
  40. package/components/FSSlideGroup.vue +45 -49
  41. package/components/FSSlider.vue +31 -33
  42. package/components/FSSpan.vue +53 -37
  43. package/components/FSSubmitDialog.vue +165 -0
  44. package/components/FSSwitch.vue +110 -109
  45. package/components/FSTab.vue +61 -61
  46. package/components/FSTabs.vue +53 -55
  47. package/components/FSTag.vue +88 -84
  48. package/components/FSTagField.vue +32 -36
  49. package/components/FSTagGroup.vue +38 -45
  50. package/components/FSText.vue +74 -64
  51. package/components/FSTextArea.vue +187 -185
  52. package/components/FSTextField.vue +18 -20
  53. package/components/FSTile.vue +90 -0
  54. package/components/FSToggleSet.vue +282 -0
  55. package/components/FSTooltip.vue +21 -0
  56. package/components/FSWindow.vue +26 -16
  57. package/components/FSWrapGroup.vue +44 -47
  58. package/components/deviceOrganisations/FSConnectivity.vue +114 -0
  59. package/components/deviceOrganisations/FSStatus.vue +117 -0
  60. package/components/deviceOrganisations/FSStatusesCarousel.vue +105 -0
  61. package/components/deviceOrganisations/FSStatusesRow.vue +66 -0
  62. package/components/deviceOrganisations/FSWorstAlert.vue +165 -0
  63. package/components/lists/FSDataIteratorGroup.vue +7 -0
  64. package/components/lists/FSDataIteratorItem.vue +103 -0
  65. package/components/lists/FSDataTableUI.vue +982 -0
  66. package/components/lists/FSFilterButton.vue +177 -0
  67. package/components/lists/FSHeaderButton.vue +99 -0
  68. package/components/lists/FSHiddenButton.vue +81 -0
  69. package/components/tiles/FSDeviceOrganisationTileUI.vue +232 -0
  70. package/components/tiles/FSGroupTileUI.vue +192 -0
  71. package/composables/index.ts +1 -1
  72. package/composables/useBreakpoints.ts +23 -4
  73. package/composables/useColors.ts +53 -23
  74. package/composables/useSlots.ts +43 -0
  75. package/index.ts +6 -0
  76. package/models/breadcrumbs.ts +8 -0
  77. package/models/colors.ts +17 -0
  78. package/models/deviceAlerts.ts +10 -0
  79. package/models/deviceConnectivities.ts +11 -0
  80. package/models/deviceStatuses.ts +16 -0
  81. package/models/index.ts +9 -0
  82. package/models/modelStatuses.ts +11 -0
  83. package/models/rules.ts +50 -0
  84. package/models/tables.ts +33 -0
  85. package/models/toggleSets.ts +7 -0
  86. package/package.json +6 -4
  87. package/plugins/colorPlugin.ts +2 -2
  88. package/shims-plugin.d.ts +1 -1
  89. package/styles/components/fs_autocomplete_field.scss +123 -0
  90. package/styles/components/fs_button.scss +4 -6
  91. package/styles/components/fs_calendar.scss +24 -1
  92. package/styles/components/fs_card.scss +2 -5
  93. package/styles/components/fs_carousel.scss +4 -0
  94. package/styles/components/fs_chip.scss +33 -0
  95. package/styles/components/fs_clock.scss +43 -0
  96. package/styles/components/fs_col.scss +2 -0
  97. package/styles/components/fs_color_icon.scss +37 -0
  98. package/styles/components/fs_container.scss +16 -0
  99. package/styles/components/fs_data_iterator_item.scss +19 -0
  100. package/styles/components/fs_data_table.scss +97 -0
  101. package/styles/components/fs_date_field.scss +8 -0
  102. package/styles/components/fs_dialog.scss +30 -0
  103. package/styles/components/fs_divider.scss +5 -0
  104. package/styles/components/fs_fade_out.scss +10 -2
  105. package/styles/components/fs_filter_button.scss +21 -0
  106. package/styles/components/fs_header_button.scss +4 -0
  107. package/styles/components/fs_hidden_button.scss +12 -0
  108. package/styles/components/fs_icon.scss +19 -3
  109. package/styles/components/fs_icon_field.scss +12 -0
  110. package/styles/components/fs_image.scss +7 -0
  111. package/styles/components/fs_load_tile.scss +49 -0
  112. package/styles/components/fs_password_field.scss +2 -2
  113. package/styles/components/fs_row.scss +4 -1
  114. package/styles/components/fs_select_field.scss +71 -0
  115. package/styles/components/fs_slide_group.scss +6 -0
  116. package/styles/components/fs_slider.scss +29 -9
  117. package/styles/components/fs_span.scss +8 -0
  118. package/styles/components/fs_submit_dialog.scss +9 -0
  119. package/styles/components/fs_tabs.scss +4 -0
  120. package/styles/components/fs_tag_field.scss +0 -11
  121. package/styles/components/fs_text_field.scss +23 -15
  122. package/styles/components/fs_tile.scss +33 -0
  123. package/styles/components/fs_tooltip.scss +5 -0
  124. package/styles/components/fs_wrap_group.scss +7 -8
  125. package/styles/components/index.scss +22 -1
  126. package/styles/globals/breakpoints.scss +7 -0
  127. package/styles/globals/overrides.scss +20 -7
  128. package/styles/globals/text_fonts.scss +8 -8
  129. package/themes/default.ts +1 -11
  130. package/utils/css.ts +11 -0
  131. package/utils/icons.ts +75416 -0
  132. package/utils/index.ts +5 -1
  133. package/utils/levenshtein.ts +97 -0
  134. package/utils/sort.ts +9 -0
  135. package/components/FSDatePicker.vue +0 -226
  136. package/composables/useDates.ts +0 -39
  137. package/models/FSTags.ts +0 -8
  138. package/models/FSTextFields.ts +0 -23
  139. package/styles/components/fs_date_picker.scss +0 -0
  140. /package/utils/{FSRichTextField.ts → lexical.ts} +0 -0
@@ -0,0 +1,177 @@
1
+ <template>
2
+ <v-menu
3
+ :closeOnContentClick="false"
4
+ v-model="expanded"
5
+ >
6
+ <template #activator="{ props }">
7
+ <FSChip
8
+ class="fs-filter-button"
9
+ variant="standard"
10
+ prependIcon="mdi-filter-variant"
11
+ :color="ColorEnum.Dark"
12
+ :editable="true"
13
+ :label="label"
14
+ v-bind="props"
15
+ />
16
+ </template>
17
+ <FSCard
18
+ class="fs-filter-button-menu"
19
+ :elevation="true"
20
+ :border="false"
21
+ >
22
+ <FSCol
23
+ gap="16px"
24
+ padding="6px 16px"
25
+ >
26
+ <FSSpan
27
+ font="text-overline"
28
+ >
29
+ {{ $tr("ui.data-table.filter", "Filter") }}
30
+ </FSSpan>
31
+ <FSChip
32
+ class="fs-filter-button-all"
33
+ :editable="true"
34
+ :color="$props.color"
35
+ :variant="all ? 'full' : 'standard'"
36
+ :label="$tr('ui.data-table.all-values', 'All values')"
37
+ @click="onToggleAll"
38
+ />
39
+ <FSSearchField
40
+ class="fs-filter-button-all"
41
+ prependInnerIcon="mdi-magnify"
42
+ v-model="search"
43
+ />
44
+ <v-divider />
45
+ <FSFadeOut
46
+ class="fs-filter-button-fade"
47
+ >
48
+ <FSCol>
49
+ <FSChip
50
+ v-for="(filter, index) in searchedFilters"
51
+ class="fs-filter-button-chip"
52
+ :key="index"
53
+ :editable="true"
54
+ :label="filter.text"
55
+ :color="$props.color"
56
+ :variant="getVariant(filter)"
57
+ @click="() => onToggle(filter)"
58
+ >
59
+ <template #default>
60
+ <slot v-bind="{ filter }" />
61
+ </template>
62
+ </FSChip>
63
+ </FSCol>
64
+ </FSFadeOut>
65
+ </FSCol>
66
+ </FSCard>
67
+ </v-menu>
68
+ </template>
69
+
70
+ <script lang="ts">
71
+ import { computed, defineComponent, PropType, ref } from "vue";
72
+
73
+ import { ColorBase, ColorEnum, FSDataTableColumn, FSDataTableFilter } from "@dative-gpi/foundation-shared-components/models";
74
+ import { useTranslationsProvider } from "@dative-gpi/foundation-shared-services/composables";
75
+
76
+ import FSSearchField from "../FSSearchField.vue";
77
+ import FSFadeOut from "../FSFadeOut.vue";
78
+ import FSCard from "../FSCard.vue";
79
+ import FSChip from "../FSChip.vue";
80
+ import FSSpan from "../FSSpan.vue";
81
+ import FSCol from "../FSCol.vue";
82
+
83
+ export default defineComponent({
84
+ name: "FSFilterButton",
85
+ components: {
86
+ FSSearchField,
87
+ FSFadeOut,
88
+ FSCard,
89
+ FSChip,
90
+ FSSpan,
91
+ FSCol
92
+ },
93
+ props: {
94
+ header: {
95
+ type: Object as PropType<FSDataTableColumn>,
96
+ required: true
97
+ },
98
+ filters: {
99
+ type: Array as PropType<FSDataTableFilter[]>,
100
+ required: false,
101
+ default: () => []
102
+ },
103
+ color: {
104
+ type: String as PropType<ColorBase>,
105
+ required: false,
106
+ default: ColorEnum.Primary
107
+ }
108
+ },
109
+ emits: ["update:filter"],
110
+ setup(props, { emit }) {
111
+ const { $tr } = useTranslationsProvider();
112
+
113
+ const expanded = ref(false);
114
+ const search = ref(null);
115
+ const all = ref(!props.filters?.some(f => f.hidden) ?? true);
116
+
117
+ const label = computed(() => {
118
+ if (props.filters) {
119
+ const hidden = props.filters.filter(f => f.hidden).length;
120
+ if (hidden > 0) {
121
+ return $tr("ui.data-table.some-filters-visible", "{0}: {1} visible", props.header.text, (props.filters.length - hidden).toString());
122
+ }
123
+ }
124
+ return $tr("ui.data-table.all-filters-visible", "{0}: All visible", props.header.text);
125
+ });
126
+
127
+ const searchedFilters = computed((): FSDataTableFilter[] => {
128
+ if (search.value) {
129
+ return props.filters.filter(f => (f.text + f.value).includes(search.value));
130
+ }
131
+ return props.filters;
132
+ });
133
+
134
+ const getVariant = (filter: FSDataTableFilter): "standard" | "full" => {
135
+ if (all.value || filter.hidden) {
136
+ return "standard";
137
+ }
138
+ return "full";
139
+ };
140
+
141
+ const onToggle = (filter: FSDataTableFilter): void => {
142
+ if (all.value) {
143
+ all.value = false;
144
+ emit("update:filter", props.filters.map(f => ({ ...f, hidden: f.value !== filter.value })));
145
+ }
146
+ else {
147
+ if (filter.hidden && !props.filters.some(f => !f.hidden && f.value !== filter.value)) {
148
+ all.value = true;
149
+ }
150
+ emit("update:filter", props.filters.map(f => ({ ...f, hidden: f.value === filter.value ? !f.hidden : f.hidden })));
151
+ }
152
+ };
153
+
154
+ const onToggleAll = (): void => {
155
+ if (all.value) {
156
+ all.value = false;
157
+ }
158
+ else {
159
+ all.value = true;
160
+ emit("update:filter", props.filters.map(f => ({ ...f, hidden: false })));
161
+ }
162
+ };
163
+
164
+ return {
165
+ searchedFilters,
166
+ ColorEnum,
167
+ expanded,
168
+ search,
169
+ label,
170
+ all,
171
+ getVariant,
172
+ onToggle,
173
+ onToggleAll
174
+ };
175
+ }
176
+ });
177
+ </script>
@@ -0,0 +1,99 @@
1
+ <template>
2
+ <v-menu
3
+ v-model="expanded"
4
+ >
5
+ <template #activator="{ props }">
6
+ <FSButton
7
+ class="fs-header-button"
8
+ icon="mdi-dots-vertical"
9
+ variant="icon"
10
+ :color="ColorEnum.Light"
11
+ v-bind="props"
12
+ />
13
+ </template>
14
+ <FSCard
15
+ :elevation="true"
16
+ :border="false"
17
+ >
18
+ <FSCol
19
+ gap="16px"
20
+ padding="16px"
21
+ >
22
+ <FSSpan
23
+ font="text-overline"
24
+ >
25
+ {{ $tr("ui.data-table.column-options", "Options for this column") }}
26
+ </FSSpan>
27
+ <FSCol
28
+ padding="16px"
29
+ >
30
+ <FSButton
31
+ variant="icon"
32
+ icon="mdi-eye-off-outline"
33
+ :label="$tr('ui.data-table.hide-column', 'Hide column')"
34
+ :color="ColorEnum.Dark"
35
+ @click="$emit('update:hide')"
36
+ />
37
+ <FSButton
38
+ v-if="!$props.first"
39
+ variant="icon"
40
+ icon="mdi-chevron-left"
41
+ :label="$tr('ui.data-table.move-left', 'Move to the left')"
42
+ :color="ColorEnum.Dark"
43
+ @click="$emit('update:left')"
44
+ />
45
+ <FSButton
46
+ v-if="!$props.last"
47
+ variant="icon"
48
+ icon="mdi-chevron-right"
49
+ :label="$tr('ui.data-table.move-right', 'Move to the right')"
50
+ :color="ColorEnum.Dark"
51
+ @click="$emit('update:right')"
52
+ />
53
+ </FSCol>
54
+ </FSCol>
55
+ </FSCard>
56
+ </v-menu>
57
+ </template>
58
+
59
+ <script lang="ts">
60
+ import { defineComponent, ref } from "vue";
61
+
62
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
63
+
64
+ import FSButton from "../FSButton.vue";
65
+ import FSCard from "../FSCard.vue";
66
+ import FSSpan from "../FSSpan.vue";
67
+ import FSCol from "../FSCol.vue";
68
+
69
+ export default defineComponent({
70
+ name: "FSHeaderButton",
71
+ components: {
72
+ FSButton,
73
+ FSCard,
74
+ FSSpan,
75
+ FSCol
76
+ },
77
+ props: {
78
+ first: {
79
+ type: Boolean,
80
+ required: false,
81
+ default: false
82
+ },
83
+ last: {
84
+ type: Boolean,
85
+ required: false,
86
+ default: false
87
+ }
88
+ },
89
+ emits: ["update:hide", "update:left", "update:right"],
90
+ setup() {
91
+ const expanded = ref(false);
92
+
93
+ return {
94
+ ColorEnum,
95
+ expanded
96
+ };
97
+ }
98
+ })
99
+ </script>
@@ -0,0 +1,81 @@
1
+ <template>
2
+ <v-menu
3
+ :closeOnContentClick="false"
4
+ v-model="expanded"
5
+ >
6
+ <template #activator="{ props }">
7
+ <FSChip
8
+ prependIcon="mdi-eye-off-outline"
9
+ :color="ColorEnum.Light"
10
+ :editable="true"
11
+ :label="$tr('ui.data-table.hidden-columns', '{0} hidden column(s)', $props.headers.length.toString())"
12
+ v-bind="props"
13
+ />
14
+ </template>
15
+ <FSCard
16
+ class="fs-hidden-button-menu"
17
+ :elevation="true"
18
+ :border="false"
19
+ >
20
+ <FSCol
21
+ gap="16px"
22
+ padding="6px 16px"
23
+ >
24
+ <FSSpan
25
+ font="text-overline"
26
+ >
27
+ {{ $tr("ui.data-table.show-columns", "Show columns") }}
28
+ </FSSpan>
29
+ <FSChip
30
+ v-for="(header, index) in $props.headers"
31
+ class="fs-hidden-button-chip"
32
+ :color="$props.color"
33
+ :label="header.text"
34
+ :editable="true"
35
+ :key="index"
36
+ @click="$emit('update:show', header)"
37
+ />
38
+ </FSCol>
39
+ </FSCard>
40
+ </v-menu>
41
+ </template>
42
+
43
+ <script lang="ts">
44
+ import { defineComponent, PropType, ref } from "vue";
45
+
46
+ import { ColorBase, ColorEnum, FSDataTableColumn } from "@dative-gpi/foundation-shared-components/models";
47
+
48
+ import FSCard from "../FSCard.vue";
49
+ import FSChip from "../FSChip.vue";
50
+ import FSSpan from "../FSSpan.vue";
51
+ import FSCol from "../FSCol.vue";
52
+
53
+ export default defineComponent({
54
+ name: "FSHiddenButton",
55
+ components: {
56
+ FSCard,
57
+ FSChip,
58
+ FSSpan,
59
+ FSCol
60
+ },
61
+ props: {
62
+ headers: {
63
+ type: Array as PropType<FSDataTableColumn[]>,
64
+ required: true
65
+ },
66
+ color: {
67
+ type: String as PropType<ColorBase>,
68
+ required: false,
69
+ default: ColorEnum.Primary
70
+ }
71
+ },
72
+ setup() {
73
+ const expanded = ref(false);
74
+
75
+ return {
76
+ ColorEnum,
77
+ expanded
78
+ };
79
+ }
80
+ });
81
+ </script>
@@ -0,0 +1,232 @@
1
+ <template>
2
+ <FSTile
3
+ :bottomColor="ColorEnum.Primary"
4
+ :editable="$props.editable"
5
+ :modelValue="$props.modelValue"
6
+ v-bind="$attrs"
7
+ >
8
+ <FSCol
9
+ align="center-center"
10
+ width="fill"
11
+ >
12
+ <FSRow
13
+ align="center-center"
14
+ gap="24px"
15
+ :wrap="false"
16
+ :height="infoHeight"
17
+ >
18
+ <FSCol
19
+ gap="12px"
20
+ >
21
+ <FSCol
22
+ gap="6px"
23
+ :width="infoWidth"
24
+ >
25
+ <FSSpan
26
+ font="text-button"
27
+ :lineClamp="2"
28
+ >
29
+ {{ $props.label }}
30
+ </FSSpan>
31
+ <FSSpan
32
+ font="text-overline"
33
+ >
34
+ {{ $props.code }}
35
+ </FSSpan>
36
+ </FSCol>
37
+ <FSRow
38
+ gap="4px"
39
+ >
40
+ <FSConnectivity
41
+ :deviceConnectivity="$props.deviceConnectivity"
42
+ />
43
+ <FSWorstAlert
44
+ v-if="$props.deviceWorstAlert"
45
+ :deviceAlert="$props.deviceWorstAlert"
46
+ :deviceAlerts="$props.deviceAlerts.length"
47
+ />
48
+ <FSStatusesRow
49
+ :modelStatuses="lineModelStatuses"
50
+ :deviceStatuses="lineDeviceStatuses"
51
+ />
52
+ </FSRow>
53
+ </FSCol>
54
+ <FSImage
55
+ v-if="$props.imageId"
56
+ :imageId="$props.imageId"
57
+ :width="imageSize"
58
+ />
59
+ </FSRow>
60
+ <template v-if="carouselModelStatuses.length">
61
+ <FSDivider />
62
+ <FSStatusesCarousel
63
+ :modelStatuses="carouselModelStatuses"
64
+ :deviceStatuses="carouselDeviceStatuses"
65
+ />
66
+ </template>
67
+ </FSCol>
68
+ </FSTile>
69
+ </template>
70
+
71
+ <script lang="ts">
72
+ import { computed, defineComponent, PropType } from "vue";
73
+
74
+ import { FSModelStatus, FSDeviceStatus, FSDeviceAlert, FSDeviceConnectivity } from "@dative-gpi/foundation-shared-components/models";
75
+ import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
76
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
77
+
78
+ import FSStatusesCarousel from "../deviceOrganisations/FSStatusesCarousel.vue";
79
+ import FSConnectivity from "../deviceOrganisations/FSConnectivity.vue";
80
+ import FSStatusesRow from "../deviceOrganisations/FSStatusesRow.vue";
81
+ import FSWorstAlert from "../deviceOrganisations/FSWorstAlert.vue";
82
+ import FSDivider from "../FSDivider.vue";
83
+ import FSImage from "../FSImage.vue";
84
+ import FSSpan from "../FSSpan.vue";
85
+ import FSTile from "../FSTile.vue";
86
+ import FSCol from "../FSCol.vue";
87
+ import FSRow from "../FSRow.vue";
88
+
89
+ export default defineComponent({
90
+ name: "FSDeviceOrganisationTileUI",
91
+ components: {
92
+ FSStatusesCarousel,
93
+ FSConnectivity,
94
+ FSStatusesRow,
95
+ FSWorstAlert,
96
+ FSDivider,
97
+ FSImage,
98
+ FSTile,
99
+ FSSpan,
100
+ FSCol,
101
+ FSRow
102
+ },
103
+ props: {
104
+ imageId: {
105
+ type: String,
106
+ required: false,
107
+ default: null
108
+ },
109
+ label: {
110
+ type: String,
111
+ required: false,
112
+ default: null
113
+ },
114
+ code: {
115
+ type: String,
116
+ required: false,
117
+ default: null
118
+ },
119
+ deviceConnectivity: {
120
+ type: Object as PropType<FSDeviceConnectivity>,
121
+ required: false,
122
+ default: null
123
+ },
124
+ deviceWorstAlert: {
125
+ type: Object as PropType<FSDeviceAlert>,
126
+ required: false,
127
+ default: null
128
+ },
129
+ deviceAlerts: {
130
+ type: Array as PropType<FSDeviceAlert[]>,
131
+ required: false,
132
+ default: null
133
+ },
134
+ modelStatuses: {
135
+ type: Array as PropType<FSModelStatus[]>,
136
+ required: true,
137
+ default: () => []
138
+ },
139
+ deviceStatuses: {
140
+ type: Array as PropType<FSDeviceStatus[]>,
141
+ required: true,
142
+ default: () => []
143
+ },
144
+ modelValue: {
145
+ type: Boolean,
146
+ required: false,
147
+ default: false
148
+ },
149
+ editable: {
150
+ type: Boolean,
151
+ required: false,
152
+ default: true
153
+ }
154
+ },
155
+ setup(props) {
156
+ const { isMobileSized } = useBreakpoints();
157
+
158
+ const lineModelStatuses = computed((): FSModelStatus[] => {
159
+ return props.modelStatuses.filter(modelStatus => {
160
+ if (!modelStatus.inline || modelStatus.groupById) {
161
+ return false;
162
+ }
163
+ if (!modelStatus.showDefault) {
164
+ if (!props.deviceStatuses.some(deviceStatus => deviceStatus.modelStatusId === modelStatus.id)) {
165
+ return false;
166
+ }
167
+ }
168
+ return true;
169
+ }).slice(0, 4).sort((a, b) => a.index - b.index);
170
+ });
171
+
172
+ const lineDeviceStatuses = computed((): FSDeviceStatus[] => {
173
+ return props.deviceStatuses.filter(deviceStatus => {
174
+ return lineModelStatuses.value.some(modelStatus => modelStatus.id === deviceStatus.modelStatusId)
175
+ });
176
+ });
177
+
178
+ const carouselModelStatuses = computed((): FSModelStatus[] => {
179
+ const notCarouselModelStatuses = props.modelStatuses.filter(modelStatus => {
180
+ if (!modelStatus.inline || modelStatus.groupById) {
181
+ return false;
182
+ }
183
+ return true;
184
+ }).slice(0, 4);
185
+ return props.modelStatuses.filter(modelStatus => {
186
+ if (notCarouselModelStatuses.some(lineModelStatus => modelStatus.id === lineModelStatus.id)) {
187
+ return false;
188
+ }
189
+ if (!modelStatus.showDefault) {
190
+ if (!props.deviceStatuses.some(deviceStatus => deviceStatus.modelStatusId === modelStatus.id)) {
191
+ return false;
192
+ }
193
+ }
194
+ return true;
195
+ }).sort((a, b) => (a.index + (a.inline ? b.index : 0)) - b.index);
196
+ });
197
+
198
+ const carouselDeviceStatuses = computed((): FSDeviceStatus[] => {
199
+ return props.deviceStatuses.filter(deviceStatus => {
200
+ return carouselModelStatuses.value.some(modelStatus => modelStatus.id === deviceStatus.modelStatusId)
201
+ });
202
+ });
203
+
204
+ const imageSize = computed((): number => {
205
+ return isMobileSized.value ? 90 : 100;
206
+ });
207
+
208
+ const infoWidth = computed((): string => {
209
+ let width = isMobileSized.value ? 288 : 304;
210
+ if (props.imageId) {
211
+ width -= imageSize.value;
212
+ }
213
+ return `${width}px`;
214
+ });
215
+
216
+ const infoHeight = computed((): string => {
217
+ return `${imageSize.value}px`;
218
+ });
219
+
220
+ return {
221
+ ColorEnum,
222
+ lineModelStatuses,
223
+ lineDeviceStatuses,
224
+ carouselModelStatuses,
225
+ carouselDeviceStatuses,
226
+ imageSize,
227
+ infoWidth,
228
+ infoHeight
229
+ };
230
+ }
231
+ });
232
+ </script>