@dative-gpi/foundation-shared-components 0.1.120 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/assets/images/map/imagery.png +0 -0
  2. package/assets/images/map/map.png +0 -0
  3. package/components/FSAccordion.vue +2 -1
  4. package/components/FSAccordionPanel.vue +20 -1
  5. package/components/FSBadge.vue +7 -3
  6. package/components/FSBreadcrumbs.vue +4 -2
  7. package/components/FSButton.vue +15 -8
  8. package/components/FSCalendar.vue +5 -2
  9. package/components/FSCalendarTwin.vue +6 -3
  10. package/components/FSCard.vue +4 -2
  11. package/components/FSCardPlaceholder.vue +80 -0
  12. package/components/FSCheckbox.vue +10 -7
  13. package/components/FSChip.vue +4 -2
  14. package/components/FSClickable.vue +5 -3
  15. package/components/FSClock.vue +18 -4
  16. package/components/FSCol.vue +12 -5
  17. package/components/FSColor.vue +4 -2
  18. package/components/FSColorIcon.vue +5 -3
  19. package/components/FSDialog.vue +28 -87
  20. package/components/FSDialogContent.vue +133 -0
  21. package/components/FSDialogForm.vue +25 -236
  22. package/components/FSDialogFormBody.vue +273 -0
  23. package/components/FSDialogMenu.vue +5 -2
  24. package/components/FSDialogMultiForm.vue +21 -197
  25. package/components/FSDialogMultiFormBody.vue +231 -0
  26. package/components/FSDialogSubmit.vue +4 -2
  27. package/components/FSDivider.vue +6 -4
  28. package/components/FSEditImage.vue +16 -9
  29. package/components/FSErrorToast.vue +2 -1
  30. package/components/FSFadeOut.vue +1 -1
  31. package/components/FSForm.vue +7 -7
  32. package/components/FSGrid.vue +4 -2
  33. package/components/FSGridMosaic.vue +3 -2
  34. package/components/FSIcon.vue +3 -2
  35. package/components/FSIconCard.vue +10 -3
  36. package/components/FSIconCheck.vue +2 -1
  37. package/components/FSIconFlag.vue +2 -1
  38. package/components/FSImage.vue +2 -1
  39. package/components/FSImageCard.vue +72 -0
  40. package/components/FSLabel.vue +4 -2
  41. package/components/FSLink.vue +5 -3
  42. package/components/FSLoader.vue +2 -1
  43. package/components/FSOptionGroup.vue +28 -20
  44. package/components/FSOptionItem.vue +8 -18
  45. package/components/FSPagination.vue +4 -2
  46. package/components/FSRadio.vue +23 -11
  47. package/components/FSRadioGroup.vue +23 -10
  48. package/components/FSRow.vue +8 -1
  49. package/components/FSSlideGroup.vue +27 -6
  50. package/components/FSSlider.vue +4 -2
  51. package/components/FSSpan.vue +2 -1
  52. package/components/FSSwitch.vue +13 -10
  53. package/components/FSTab.vue +4 -2
  54. package/components/FSTabs.vue +5 -14
  55. package/components/FSTag.vue +11 -4
  56. package/components/FSTagGroup.vue +4 -2
  57. package/components/FSText.vue +4 -2
  58. package/components/FSToggleSet.vue +30 -17
  59. package/components/FSTooltip.vue +15 -4
  60. package/components/FSWindow.vue +2 -2
  61. package/components/FSWrapGroup.vue +2 -1
  62. package/components/autocompletes/FSAutoCompleteAddress.vue +104 -0
  63. package/components/autocompletes/FSAutocompleteLanguage.vue +18 -26
  64. package/components/autocompletes/FSAutocompleteTag.vue +138 -0
  65. package/components/autocompletes/FSAutocompleteTimeZone.vue +19 -30
  66. package/components/buttons/FSButtonAdd.vue +28 -0
  67. package/components/buttons/FSButtonAddIcon.vue +28 -0
  68. package/components/buttons/FSButtonAddLabel.vue +27 -0
  69. package/components/buttons/FSButtonAddMini.vue +27 -0
  70. package/components/buttons/FSButtonFile.vue +4 -4
  71. package/components/buttons/FSButtonFileIcon.vue +4 -4
  72. package/components/buttons/FSButtonFileLabel.vue +4 -4
  73. package/components/buttons/FSButtonFileMini.vue +4 -4
  74. package/components/deviceOrganisations/FSConnectivity.vue +3 -2
  75. package/components/deviceOrganisations/FSConnectivityCard.vue +3 -2
  76. package/components/deviceOrganisations/FSStatus.vue +3 -2
  77. package/components/deviceOrganisations/FSStatusCard.vue +3 -2
  78. package/components/deviceOrganisations/FSStatusesCarousel.vue +3 -2
  79. package/components/deviceOrganisations/FSStatusesRow.vue +3 -2
  80. package/components/deviceOrganisations/FSWorstAlert.vue +5 -4
  81. package/components/deviceOrganisations/FSWorstAlertCard.vue +4 -2
  82. package/components/fields/FSAutocompleteField.vue +210 -97
  83. package/components/fields/FSBaseField.vue +2 -1
  84. package/components/fields/FSColorField.vue +65 -94
  85. package/components/fields/FSDateField.vue +12 -25
  86. package/components/fields/FSDateRangeField.vue +15 -27
  87. package/components/fields/FSDateTimeField.vue +22 -32
  88. package/components/fields/FSDateTimeRangeField.vue +43 -51
  89. package/components/fields/FSGradientField.vue +143 -0
  90. package/components/fields/FSIconField.vue +9 -6
  91. package/components/fields/FSMagicConfigField.vue +154 -0
  92. package/components/fields/FSMagicField.vue +185 -0
  93. package/components/fields/FSNumberField.vue +3 -1
  94. package/components/fields/FSPasswordField.vue +10 -10
  95. package/components/fields/FSRichTextField.vue +136 -50
  96. package/components/fields/FSSearchField.vue +41 -62
  97. package/components/fields/FSSelectField.vue +148 -53
  98. package/components/fields/FSTagField.vue +19 -16
  99. package/components/fields/FSTermField.vue +192 -186
  100. package/components/fields/FSTextArea.vue +4 -4
  101. package/components/fields/FSTextField.vue +29 -6
  102. package/components/fields/FSTimeField.vue +55 -20
  103. package/components/fields/FSTimeSlotField.vue +6 -5
  104. package/components/fields/FSTranslateField.vue +234 -0
  105. package/components/fields/FSTranslateRichTextField.vue +185 -0
  106. package/components/fields/FSTreeViewField.vue +520 -0
  107. package/components/lists/FSDataIteratorItem.vue +18 -3
  108. package/components/lists/FSDataTableUI.vue +138 -51
  109. package/components/lists/FSFilterButton.vue +4 -2
  110. package/components/lists/FSHiddenButton.vue +4 -2
  111. package/components/map/FSMap.vue +598 -0
  112. package/components/map/FSMapEditPointAddressOverlay.vue +164 -0
  113. package/components/map/FSMapLayerButton.vue +77 -0
  114. package/components/map/FSMapOverlay.vue +150 -0
  115. package/components/selects/FSSelectAutoRefresh.vue +62 -0
  116. package/components/selects/FSSelectDashboardVariableType.vue +47 -0
  117. package/components/selects/FSSelectDateSetting.vue +39 -37
  118. package/components/selects/FSSelectDays.vue +62 -0
  119. package/components/tiles/FSDashboardOrganisationTileUI.vue +7 -5
  120. package/components/tiles/FSDashboardOrganisationTypeTileUI.vue +7 -5
  121. package/components/tiles/FSDashboardShallowTileUI.vue +7 -5
  122. package/components/tiles/FSDeviceOrganisationTileUI.vue +11 -12
  123. package/components/tiles/FSFolderTileUI.vue +8 -6
  124. package/components/tiles/FSGroupTileUI.vue +13 -15
  125. package/components/tiles/{FSSimpleIconTileUI.vue → FSSimpleTileUI.vue} +29 -15
  126. package/components/tiles/FSTile.vue +5 -11
  127. package/components/tiles/FSUserOrganisationTileUI.vue +2 -1
  128. package/components/toggleSets/FSToggleSetPosition.vue +61 -0
  129. package/composables/index.ts +5 -1
  130. package/composables/useAddress.ts +158 -0
  131. package/composables/useAutocomplete.ts +4 -3
  132. package/composables/useColors.ts +8 -25
  133. package/composables/useDebounce.ts +2 -1
  134. package/composables/useMagicFieldProvider.ts +22 -0
  135. package/composables/useRules.ts +4 -12
  136. package/composables/useSlots.ts +46 -26
  137. package/composables/useTables.ts +29 -0
  138. package/composables/useTreeView.ts +48 -0
  139. package/elements/FSFormElement.ts +2 -1
  140. package/icons/flags/France.vue +21 -5
  141. package/icons/flags/Germany.vue +16 -4
  142. package/icons/flags/GreatBritain.vue +25 -6
  143. package/icons/flags/Italy.vue +21 -5
  144. package/icons/flags/Portugal.vue +225 -51
  145. package/icons/flags/Spain.vue +2781 -543
  146. package/icons/flags/UnitedStates.vue +31 -7
  147. package/icons/widgetTemplates/DevicesWidget.vue +189 -189
  148. package/icons/widgetTemplates/ProfileWidget.vue +9 -9
  149. package/icons/widgetTemplates/TextWidget.vue +6 -6
  150. package/models/breadcrumbs.ts +1 -1
  151. package/models/deviceAlerts.ts +1 -1
  152. package/models/deviceConnectivities.ts +1 -1
  153. package/models/index.ts +2 -0
  154. package/models/magicFields.ts +9 -0
  155. package/models/map.ts +18 -0
  156. package/models/richTextVariable.ts +5 -0
  157. package/models/rules.ts +11 -2
  158. package/models/tables.ts +30 -21
  159. package/models/variableNode.ts +104 -0
  160. package/package.json +21 -18
  161. package/plugins/colorPlugin.ts +2 -2
  162. package/plugins/index.ts +2 -1
  163. package/plugins/mapsPlugin.ts +37 -0
  164. package/shims-plugin.d.ts +2 -2
  165. package/shims-window.d.ts +3 -0
  166. package/styles/components/fs_button.scss +5 -0
  167. package/styles/components/fs_card.scss +0 -1
  168. package/styles/components/fs_col.scss +1 -0
  169. package/styles/components/fs_color_field.scss +12 -2
  170. package/styles/components/fs_data_iterator_item.scss +19 -6
  171. package/styles/components/fs_dialog.scss +12 -22
  172. package/styles/components/fs_gradient_field.scss +16 -0
  173. package/styles/components/fs_image_card.scss +18 -0
  174. package/styles/components/fs_magic_config_field.scss +13 -0
  175. package/styles/components/fs_map.scss +129 -0
  176. package/styles/components/fs_map_overlay.scss +38 -0
  177. package/styles/components/fs_meta_field.scss +6 -0
  178. package/styles/components/fs_option_group.scss +1 -0
  179. package/styles/components/fs_radio.scss +1 -1
  180. package/styles/components/fs_rich_text_field.scss +17 -5
  181. package/styles/components/fs_row.scss +1 -1
  182. package/styles/components/fs_select_field.scss +9 -14
  183. package/styles/components/fs_text.scss +1 -1
  184. package/styles/components/fs_time_field.scss +0 -4
  185. package/styles/components/fs_translate_field.scss +3 -0
  186. package/styles/components/fs_tree_view_field.scss +53 -0
  187. package/styles/components/index.scss +8 -1
  188. package/styles/globals/overrides.scss +54 -8
  189. package/styles/globals/scrollbars.scss +2 -2
  190. package/themes/default.ts +1 -1
  191. package/utils/gradient.ts +1601 -0
  192. package/utils/index.ts +3 -1
  193. package/utils/leafletMarkers.ts +23 -0
  194. package/utils/lexical.ts +3 -1
  195. package/components/selects/FSSelectTimeZone.vue +0 -67
  196. package/styles/components/fs_date_field.scss +0 -8
@@ -0,0 +1,164 @@
1
+ <template>
2
+ <FSCard
3
+ padding="16px"
4
+ height="100%"
5
+ width="100%"
6
+ :elevation="true"
7
+ >
8
+ <FSCol
9
+ gap="24px"
10
+ >
11
+ <FSRow>
12
+ <FSText
13
+ font="text-h3"
14
+ >
15
+ {{ $tr('ui.map.modify-location', 'Modify location') }}
16
+ </FSText>
17
+ <v-spacer />
18
+ <FSButton
19
+ v-if="menuLocationCoordinates"
20
+ icon="mdi-arrow-collapse"
21
+ variant="icon"
22
+ @click="menuLocationCoordinates = !menuLocationCoordinates"
23
+ />
24
+ <FSButton
25
+ v-else
26
+ icon="mdi-arrow-expand"
27
+ variant="icon"
28
+ @click="menuLocationCoordinates = !menuLocationCoordinates"
29
+ />
30
+ </FSRow>
31
+ <FSCol
32
+ v-if="menuLocationCoordinates"
33
+ >
34
+ <FSAutoCompleteAddress
35
+ :modelValue="$props.modelValue"
36
+ @update:modelValue="onAddressFieldSubmit($event)"
37
+ />
38
+ <FSForm
39
+ variant="standard"
40
+ @submit="onCoordinatesChange()"
41
+ >
42
+ <FSRow>
43
+ <FSNumberField
44
+ :label="$tr('ui.map.latitude', 'Latitude')"
45
+ v-model="latitude"
46
+ />
47
+ <FSNumberField
48
+ :label="$tr('ui.map.longitude', 'Longitude')"
49
+ v-model="longitude"
50
+ />
51
+ </FSRow>
52
+ <FSButton
53
+ prependIcon="mdi-content-save"
54
+ style="display: none;"
55
+ color="primary"
56
+ type="submit"
57
+ :label="$tr('ui.map.save', 'Save')"
58
+ />
59
+ </FSForm>
60
+ </FSCol>
61
+ <FSRow
62
+ align="center-right"
63
+ >
64
+ <FSButton
65
+ :label="$tr('ui.map.cancel', 'Cancel')"
66
+ @click="onCancel"
67
+ />
68
+ <FSButton
69
+ prependIcon="mdi-content-save"
70
+ color="primary"
71
+ :label="$tr('ui.map.save', 'Save')"
72
+ @click="onSubmit"
73
+ />
74
+ </FSRow>
75
+ </FSCol>
76
+ </FSCard>
77
+ </template>
78
+
79
+ <script lang="ts">
80
+ import { defineComponent, type PropType, ref, watch } from "vue";
81
+
82
+ import { Address } from "@dative-gpi/foundation-shared-domain/models";
83
+
84
+ import FSAutoCompleteAddress from "../autocompletes/FSAutoCompleteAddress.vue";
85
+ import FSNumberField from "../fields/FSNumberField.vue";
86
+ import FSButton from "../FSButton.vue";
87
+ import FSCard from "../FSCard.vue";
88
+ import FSForm from "../FSForm.vue";
89
+ import FSText from "../FSText.vue";
90
+ import FSCol from "../FSCol.vue";
91
+ import FSRow from "../FSRow.vue";
92
+
93
+ export default defineComponent({
94
+ name: "FSMapEditPointAddressOverlay.vue",
95
+ components: {
96
+ FSAutoCompleteAddress,
97
+ FSNumberField,
98
+ FSButton,
99
+ FSCard,
100
+ FSForm,
101
+ FSText,
102
+ FSCol,
103
+ FSRow
104
+ },
105
+ props: {
106
+ modelValue: {
107
+ type: Object as PropType<Address | null>,
108
+ default: null
109
+ }
110
+ },
111
+ emits: ["update:modelValue", "update:locationCoordinates", "submit", "cancel"],
112
+ setup(props, { emit }) {
113
+ const menuLocationCoordinates = ref(false);
114
+
115
+ const latitude = ref(0);
116
+ const longitude = ref(0);
117
+
118
+ const onCoordinatesChange = () => {
119
+ const newModelValue = new Address({
120
+ country: "",
121
+ formattedAddress: "",
122
+ locality: "",
123
+ placeId: "",
124
+ placeLabel: "",
125
+ latitude: latitude.value,
126
+ longitude: longitude.value,
127
+ });
128
+ emit("update:locationCoordinates", newModelValue);
129
+ };
130
+
131
+ const onAddressFieldSubmit = (address: Address|null) => {
132
+ if(!address) {
133
+ return;
134
+ }
135
+ emit('update:modelValue', address);
136
+ };
137
+
138
+ const onSubmit = () => {
139
+ emit('submit');
140
+ };
141
+
142
+ const onCancel = () => {
143
+ emit('cancel');
144
+ };
145
+
146
+ watch(() => props.modelValue, () => {
147
+ if (props.modelValue) {
148
+ latitude.value = props.modelValue.latitude;
149
+ longitude.value = props.modelValue.longitude;
150
+ }
151
+ }, { immediate: true });
152
+
153
+ return {
154
+ menuLocationCoordinates,
155
+ longitude,
156
+ latitude,
157
+ onAddressFieldSubmit,
158
+ onCoordinatesChange,
159
+ onCancel,
160
+ onSubmit
161
+ };
162
+ }
163
+ });
164
+ </script>
@@ -0,0 +1,77 @@
1
+ <template>
2
+ <FSButton
3
+ prependIcon="mdi-layers-outline"
4
+ :elevation="true"
5
+ @click="dialog = true"
6
+ />
7
+ <FSDialog
8
+ v-model="dialog"
9
+ title="Select Layers"
10
+ width="442px"
11
+ >
12
+ <template
13
+ v-slot:body
14
+ >
15
+ <FSRow
16
+ align="center-center"
17
+ >
18
+ <FSImageCard
19
+ v-for="layer in layers"
20
+ :variant="modelValue === layer.name ? 'full' : 'background'"
21
+ :color="modelValue === layer.name ? 'primary' : 'light'"
22
+ :label="layer.label"
23
+ :src="layer.image"
24
+ :key="layer.name"
25
+ @click="onLayerClick(layer.name)"
26
+ />
27
+ </FSRow>
28
+ </template>
29
+ </FSDialog>
30
+ </template>
31
+
32
+ <script lang="ts">
33
+ import { defineComponent, type PropType, ref } from "vue";
34
+
35
+ import { type MapLayer } from "../../models";
36
+
37
+ import FSImageCard from "../FSImageCard.vue";
38
+ import FSButton from "../FSButton.vue";
39
+ import FSDialog from "../FSDialog.vue";
40
+ import FSRow from "../FSRow.vue";
41
+
42
+ export default defineComponent({
43
+ name: "FSMapLayerButton",
44
+ components: {
45
+ FSImageCard,
46
+ FSButton,
47
+ FSDialog,
48
+ FSRow
49
+ },
50
+ props: {
51
+ layers: {
52
+ type: Array as PropType<MapLayer[]>,
53
+ required: false,
54
+ default: () => []
55
+ },
56
+ modelValue: {
57
+ type: String,
58
+ required: false,
59
+ default: ""
60
+ }
61
+ },
62
+ emits: ["update:modelValue"],
63
+ setup(_, { emit }) {
64
+ const dialog = ref(false);
65
+
66
+ const onLayerClick = (layer: string) => {
67
+ emit("update:modelValue", layer);
68
+ dialog.value = false;
69
+ };
70
+
71
+ return {
72
+ dialog,
73
+ onLayerClick
74
+ };
75
+ }
76
+ });
77
+ </script>
@@ -0,0 +1,150 @@
1
+ <template>
2
+ <FSCol
3
+ v-show="isExtraSmall"
4
+ :id="`left-overlay-mobile-${$props.mapId}`"
5
+ :height="$props.mode === 'expand' ? '100%' : ($props.mode === 'half' ? '50%' : 'hug')"
6
+ :style="style"
7
+ class="fs-map-overlay-left-mobile"
8
+ ref="mobileOverlayElement"
9
+ align="bottom-center"
10
+ width="hug"
11
+ gap="2px"
12
+ @click="$event.target === mobileOverlayElement?.$el ? $emit('update:mode', 'collapse') : null"
13
+ >
14
+ <FSCard
15
+ padding="0px"
16
+ :elevation="true"
17
+ :border="false"
18
+ >
19
+ <FSCol
20
+ gap="0px"
21
+ height="fill"
22
+ >
23
+ <FSRow
24
+ align="center-center"
25
+ @touchstart="$props.mode === 'expand' ? $emit('update:mode', 'collapse') : $emit('update:mode', 'expand')"
26
+ >
27
+ <FSButton
28
+ :icon="$props.mode === 'expand' ? 'mdi-chevron-down' : 'mdi-chevron-up'"
29
+ variant="icon"
30
+ @click="$props.mode === 'expand' ? $emit('update:mode', 'collapse') : $emit('update:mode', 'expand')"
31
+ />
32
+ </FSRow>
33
+ <FSCol
34
+ class="fs-map-overlay-left-mobile-content"
35
+ height="fill"
36
+ >
37
+ <slot
38
+ name="leftoverlay-header"
39
+ />
40
+ <FSFadeOut
41
+ :height="$props.mode === 'collapse' ? '0px' : '100%'"
42
+ maskHeight="0px"
43
+ >
44
+ <slot
45
+ name="leftoverlay-body"
46
+ />
47
+ </FSFadeOut>
48
+ </FSCol>
49
+ </FSCol>
50
+ </FSCard>
51
+ </FSCol>
52
+ <FSCol
53
+ v-show="!isExtraSmall"
54
+ :style="style"
55
+ :id="`left-overlay-${$props.mapId}`"
56
+ class="fs-map-overlay-left"
57
+ width="hug"
58
+ gap="2px"
59
+ >
60
+ <FSCard
61
+ padding="4px"
62
+ :elevation="true"
63
+ :border="false"
64
+ >
65
+ <FSCol
66
+ class="fs-map-overlay-left-content"
67
+ >
68
+ <slot
69
+ name="leftoverlay-header"
70
+ />
71
+ <FSFadeOut
72
+ maskHeight="0"
73
+ height="100%"
74
+ >
75
+ <slot
76
+ name="leftoverlay-body"
77
+ />
78
+ </FSFadeOut>
79
+ </FSCol>
80
+ </FSCard>
81
+ </FSCol>
82
+ </template>
83
+
84
+ <script lang="ts">
85
+ import { computed, defineComponent, type PropType, ref } from "vue";
86
+
87
+ import { useBreakpoints } from "../../composables";
88
+
89
+ import FSFadeOut from "../FSFadeOut.vue";
90
+ import FSButton from "../FSButton.vue";
91
+ import FSCard from "../FSCard.vue";
92
+ import FSCol from "../FSCol.vue";
93
+ import FSRow from "../FSRow.vue";
94
+
95
+ export default defineComponent({
96
+ name: "FSMapOverlay",
97
+ props: {
98
+ height: {
99
+ type: [String, Number] as PropType<string | number | null>,
100
+ required: false,
101
+ default: "100%"
102
+ },
103
+ mode: {
104
+ type: String as PropType<"collapse" | "half" | "expand">,
105
+ required: false,
106
+ default: "collapse"
107
+ },
108
+ mapId: {
109
+ type: String,
110
+ required: true
111
+ }
112
+ },
113
+ components: {
114
+ FSFadeOut,
115
+ FSButton,
116
+ FSCard,
117
+ FSCol,
118
+ FSRow
119
+ },
120
+ emits: ["update:mode"],
121
+ setup(props) {
122
+ const { isExtraSmall } = useBreakpoints();
123
+
124
+ const leftOverlayMenuMobile = ref(false);
125
+ const mobileOverlayElement = ref(null);
126
+
127
+ const style = computed((): { [key: string]: string | null | undefined } => {
128
+ if (props.mode === "expand") {
129
+ return {
130
+ "--fs-map-overlay-max-height": `calc(${props.height} - 40px)`,
131
+ "--fs-map-overlay-card-height": "95%",
132
+ };
133
+ }
134
+ else {
135
+ return {
136
+ "--fs-map-overlay-max-height": `calc(${props.height} - 40px)`,
137
+ "--fs-map-overlay-card-height": "100%",
138
+ };
139
+ }
140
+ });
141
+
142
+ return {
143
+ leftOverlayMenuMobile,
144
+ mobileOverlayElement,
145
+ isExtraSmall,
146
+ style
147
+ };
148
+ }
149
+ });
150
+ </script>
@@ -0,0 +1,62 @@
1
+ <template>
2
+ <FSSelectField
3
+ :items="autoRefreshes"
4
+ :clearable="false"
5
+ :modelValue="$props.modelValue"
6
+ @update:modelValue="$emit('update:modelValue', $event)"
7
+ v-bind="$attrs"
8
+ />
9
+ </template>
10
+
11
+ <script lang="ts">
12
+ import type { PropType} from "vue";
13
+ import { computed, defineComponent } from "vue";
14
+
15
+ import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
16
+ import { AutoRefresh } from "@dative-gpi/foundation-shared-domain/models";
17
+
18
+ import FSSelectField from "../fields/FSSelectField.vue";
19
+
20
+ export default defineComponent({
21
+ name: "FSSelectAutoRefresh",
22
+ components: {
23
+ FSSelectField
24
+ },
25
+ props: {
26
+ modelValue: {
27
+ type: Number as PropType<AutoRefresh>,
28
+ required: false,
29
+ default: AutoRefresh.FifteenSeconds
30
+ },
31
+ useNone: {
32
+ type: Boolean,
33
+ required: false,
34
+ default: false
35
+ }
36
+ },
37
+ emits: ["update:modelValue"],
38
+ setup(props) {
39
+ const { $tr } = useTranslationsProvider();
40
+
41
+ const autoRefreshes = computed((): { id: AutoRefresh; label: string }[] => {
42
+ const items = [
43
+ { id: AutoRefresh.FifteenSeconds, label: $tr("ui.auto-refresh.fifteen-seconds", "Fifteen seconds") },
44
+ { id: AutoRefresh.ThirtySeconds, label: $tr("ui.auto-refresh.thirty-seconds", "Thirty seconds") },
45
+ { id: AutoRefresh.OneMinute, label: $tr("ui.auto-refresh.one-minute", "One minute") },
46
+ { id: AutoRefresh.FiveMinutes, label: $tr("ui.auto-refresh.five-minutes", "Five minutes") },
47
+ { id: AutoRefresh.FifteenMinutes, label: $tr("ui.auto-refresh.fifteen-minutes", "Fifteen minutes") },
48
+ { id: AutoRefresh.ThirtyMinutes, label: $tr("ui.auto-refresh.thirty-minutes", "Thirty minutes") },
49
+ { id: AutoRefresh.OneHour, label: $tr("ui.auto-refresh.one-hour", "One hour") },
50
+ ];
51
+ if (props.useNone) {
52
+ items.unshift({ id: AutoRefresh.None, label: $tr("ui.auto-refresh.none", "None") });
53
+ }
54
+ return items;
55
+ });
56
+
57
+ return {
58
+ autoRefreshes
59
+ };
60
+ }
61
+ });
62
+ </script>
@@ -0,0 +1,47 @@
1
+ <template>
2
+ <FSSelectField
3
+ :items="dashboardVariableTypes"
4
+ :clearable="false"
5
+ :modelValue="$props.modelValue"
6
+ @update:modelValue="$emit('update:modelValue', $event)"
7
+ v-bind="$attrs"
8
+ />
9
+ </template>
10
+
11
+ <script lang="ts">
12
+ import type { PropType} from "vue";
13
+ import { computed, defineComponent } from "vue";
14
+
15
+ import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
16
+ import { DashboardVariableType } from "@dative-gpi/foundation-shared-domain/models";
17
+
18
+ import FSSelectField from "../fields/FSSelectField.vue";
19
+
20
+ export default defineComponent({
21
+ name: "FSSelectDashboardVariableType",
22
+ components: {
23
+ FSSelectField
24
+ },
25
+ props: {
26
+ modelValue: {
27
+ type: Number as PropType<DashboardVariableType>,
28
+ required: false,
29
+ default: DashboardVariableType.Number
30
+ }
31
+ },
32
+ emits: ["update:modelValue"],
33
+ setup() {
34
+ const { $tr } = useTranslationsProvider();
35
+
36
+ const dashboardVariableTypes = computed((): { id: DashboardVariableType; label: string }[] => ([
37
+ { id: DashboardVariableType.Number, label: $tr("ui.dashboard-variable-type.number", "Number") },
38
+ { id: DashboardVariableType.String, label: $tr("ui.dashboard-variable-type.string", "String") },
39
+ { id: DashboardVariableType.TimeStep, label: $tr("ui.dashboard-variable-type.time-step", "Time step") }
40
+ ]));
41
+
42
+ return {
43
+ dashboardVariableTypes
44
+ };
45
+ }
46
+ });
47
+ </script>
@@ -1,8 +1,6 @@
1
1
  <template>
2
2
  <FSSelectField
3
- :editable="$props.editable"
4
3
  :items="dateSettings"
5
- :hideHeader="true"
6
4
  :clearable="false"
7
5
  :modelValue="$props.modelValue"
8
6
  @update:modelValue="$emit('update:modelValue', $event)"
@@ -11,7 +9,8 @@
11
9
  </template>
12
10
 
13
11
  <script lang="ts">
14
- import { computed, defineComponent, PropType } from "vue";
12
+ import type { PropType } from "vue";
13
+ import { computed, defineComponent } from "vue";
15
14
 
16
15
  import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
17
16
  import { DateSetting } from "@dative-gpi/foundation-shared-domain/models";
@@ -31,17 +30,18 @@ export default defineComponent({
31
30
  },
32
31
  modelValue: {
33
32
  type: Number as PropType<DateSetting>,
34
- required: true
33
+ required: false,
34
+ default: DateSetting.LastDay
35
35
  },
36
36
  lastPeriod: {
37
37
  type: Boolean,
38
38
  required: false,
39
39
  default: false
40
40
  },
41
- editable: {
41
+ useNone: {
42
42
  type: Boolean,
43
43
  required: false,
44
- default: true
44
+ default: false
45
45
  }
46
46
  },
47
47
  emits: ["update:modelValue"],
@@ -51,42 +51,44 @@ export default defineComponent({
51
51
  const dateSettings = computed((): { id: DateSetting, label: string }[] => {
52
52
  if (props.variant === "before-after") {
53
53
  return [
54
- { id: DateSetting.Pick, label: $tr("ui.common.pick-dates", "Pick dates") },
55
- { id: DateSetting.MinutesBeforeAfter, label: $tr("ui.common.x-minutes-before-after-hour", "x Minutes before/after") },
56
- { id: DateSetting.HoursBeforeAfter, label: $tr("ui.common.x-hours-before-after-hour", "x Hours before/after") },
57
- { id: DateSetting.DaysBeforeAfter, label: $tr("ui.common.x-days-before-after-hour", "x Days before/after") },
58
- { id: DateSetting.WeeksBeforeAfter, label: $tr("ui.common.x-weeks-before-after-hour", "x Weeks before/after") },
59
- { id: DateSetting.MinutesBefore, label: $tr("ui.common.x-minutes-before", "x Minutes before") },
60
- { id: DateSetting.HoursBefore, label: $tr("ui.common.x-hours-before", "x Hours before") },
61
- { id: DateSetting.DaysBefore, label: $tr("ui.common.x-days-before", "x Days before") },
62
- { id: DateSetting.WeeksBefore, label: $tr("ui.common.x-weeks-before", "x Weeks before") },
63
- { id: DateSetting.Expression, label: $tr("ui.common.expression", "Expression") }
54
+ { id: DateSetting.Pick, label: $tr("ui.date-setting.pick-dates", "Pick dates") },
55
+ { id: DateSetting.MinutesBeforeAfter, label: $tr("ui.date-setting.x-minutes-before-after-hour", "x Minutes before/after") },
56
+ { id: DateSetting.HoursBeforeAfter, label: $tr("ui.date-setting.x-hours-before-after-hour", "x Hours before/after") },
57
+ { id: DateSetting.DaysBeforeAfter, label: $tr("ui.date-setting.x-days-before-after-hour", "x Days before/after") },
58
+ { id: DateSetting.WeeksBeforeAfter, label: $tr("ui.date-setting.x-weeks-before-after-hour", "x Weeks before/after") },
59
+ { id: DateSetting.MinutesBefore, label: $tr("ui.date-setting.x-minutes-before", "x Minutes before") },
60
+ { id: DateSetting.HoursBefore, label: $tr("ui.date-setting.x-hours-before", "x Hours before") },
61
+ { id: DateSetting.DaysBefore, label: $tr("ui.date-setting.x-days-before", "x Days before") },
62
+ { id: DateSetting.WeeksBefore, label: $tr("ui.date-setting.x-weeks-before", "x Weeks before") },
64
63
  ];
65
64
  }
66
65
  let dateSettings = [
67
- { id: DateSetting.Pick, label: $tr("ui.common.pick-dates", "Pick dates") },
68
- { id: DateSetting.CurrentHour, label: $tr("ui.common.this-hour", "This hour") },
69
- { id: DateSetting.CurrentDay, label: $tr("ui.common.this-day", "This day") },
70
- { id: DateSetting.CurrentWeek, label: $tr("ui.common.this-week", "This week") },
71
- { id: DateSetting.CurrentMonth, label: $tr("ui.common.this-month", "This month") },
72
- { id: DateSetting.CurrentYear, label: $tr("ui.common.this-year", "This year") },
73
- { id: DateSetting.LastDay, label: $tr("ui.common.last-day", "Last day") },
74
- { id: DateSetting.LastWeek, label: $tr("ui.common.last-week", "Last week") },
75
- { id: DateSetting.LastMonth, label: $tr("ui.common.last-month", "Last month") },
76
- { id: DateSetting.LastYear, label: $tr("ui.common.last-year", "Last year") },
77
- { id: DateSetting.SinceLastDay, label: $tr("ui.common.since-last-day", "Since last day") },
78
- { id: DateSetting.SinceLastWeek, label: $tr("ui.common.since-last-week", "Since last week") },
79
- { id: DateSetting.SinceLastMonth, label: $tr("ui.common.since-last-month", "Since last month") },
80
- { id: DateSetting.SinceLastYear, label: $tr("ui.common.since-last-year", "Since last year") },
81
- { id: DateSetting.PastHours, label: $tr("ui.common.past-x-hours", "Past x hours") },
82
- { id: DateSetting.PastDays, label: $tr("ui.common.past-x-days", "Past x days") },
83
- { id: DateSetting.PastWeeks, label: $tr("ui.common.past-x-weeks", "Past x weeks") },
84
- { id: DateSetting.PastMonths, label: $tr("ui.common.past-x-months", "Past x months") },
85
- { id: DateSetting.PastYears, label: $tr("ui.common.past-x-years", "Past x years") },
86
- { id: DateSetting.Expression, label: $tr("ui.common.expression", "Expression") }
66
+ { id: DateSetting.Pick, label: $tr("ui.date-setting.pick-dates", "Pick dates") },
67
+ { id: DateSetting.CurrentHour, label: $tr("ui.date-setting.this-hour", "This hour") },
68
+ { id: DateSetting.CurrentDay, label: $tr("ui.date-setting.this-day", "This day") },
69
+ { id: DateSetting.CurrentWeek, label: $tr("ui.date-setting.this-week", "This week") },
70
+ { id: DateSetting.CurrentMonth, label: $tr("ui.date-setting.this-month", "This month") },
71
+ { id: DateSetting.CurrentYear, label: $tr("ui.date-setting.this-year", "This year") },
72
+ { id: DateSetting.LastDay, label: $tr("ui.date-setting.last-day", "Last day") },
73
+ { id: DateSetting.LastWeek, label: $tr("ui.date-setting.last-week", "Last week") },
74
+ { id: DateSetting.LastMonth, label: $tr("ui.date-setting.last-month", "Last month") },
75
+ { id: DateSetting.LastYear, label: $tr("ui.date-setting.last-year", "Last year") },
76
+ { id: DateSetting.SinceLastDay, label: $tr("ui.date-setting.since-last-day", "Since last day") },
77
+ { id: DateSetting.SinceLastWeek, label: $tr("ui.date-setting.since-last-week", "Since last week") },
78
+ { id: DateSetting.SinceLastMonth, label: $tr("ui.date-setting.since-last-month", "Since last month") },
79
+ { id: DateSetting.SinceLastYear, label: $tr("ui.date-setting.since-last-year", "Since last year") },
80
+ { id: DateSetting.PastHours, label: $tr("ui.date-setting.past-x-hours", "Past x hours") },
81
+ { id: DateSetting.PastDays, label: $tr("ui.date-setting.past-x-days", "Past x days") },
82
+ { id: DateSetting.PastWeeks, label: $tr("ui.date-setting.past-x-weeks", "Past x weeks") },
83
+ { id: DateSetting.PastMonths, label: $tr("ui.date-setting.past-x-months", "Past x months") },
84
+ { id: DateSetting.PastYears, label: $tr("ui.date-setting.past-x-years", "Past x years") },
85
+ { id: DateSetting.Expression, label: $tr("ui.date-setting.expression", "Expression") }
87
86
  ];
88
87
  if (props.lastPeriod) {
89
- dateSettings.push({ id: DateSetting.LastPeriod, label: $tr("ui.common.last-period", "Last period") });
88
+ dateSettings.push({ id: DateSetting.LastPeriod, label: $tr("ui.date-setting.last-period", "Last period") });
89
+ }
90
+ if (props.useNone) {
91
+ dateSettings.unshift({ id: DateSetting.None, label: $tr("ui.date-setting.none", "None") });
90
92
  }
91
93
  return dateSettings;
92
94
  })
@@ -0,0 +1,62 @@
1
+ <template>
2
+ <FSSelectField
3
+ :clearable="false"
4
+ :items="days"
5
+ :modelValue="$props.modelValue"
6
+ @update:modelValue="$emit('update:modelValue', $event)"
7
+ v-bind="$attrs"
8
+ />
9
+ </template>
10
+
11
+ <script lang="ts">
12
+ import type { PropType} from "vue";
13
+ import { computed, defineComponent } from "vue";
14
+
15
+ import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
16
+ import { Days } from "@dative-gpi/foundation-shared-domain/models";
17
+
18
+ import FSSelectField from "../fields/FSSelectField.vue";
19
+
20
+ export default defineComponent({
21
+ name: "FSSelectDays",
22
+ components: {
23
+ FSSelectField
24
+ },
25
+ props: {
26
+ modelValue: {
27
+ type: Number as PropType<Days>,
28
+ required: false,
29
+ default: Days.Monday
30
+ },
31
+ useAllDays: {
32
+ type: Boolean,
33
+ required: false,
34
+ default: true
35
+ }
36
+ },
37
+ emits: ["update:modelValue"],
38
+ setup(props) {
39
+ const { $tr } = useTranslationsProvider();
40
+
41
+ const days = computed((): { id: Days; label: string }[] => {
42
+ const items = [
43
+ { id: Days.Monday, label: $tr("ui.days.monday", "Monday") },
44
+ { id: Days.Tuesday, label: $tr("ui.days.tuesday", "Tuesday") },
45
+ { id: Days.Wednesday, label: $tr("ui.days.wednesday", "Wednesday") },
46
+ { id: Days.Thursday, label: $tr("ui.days.thursday", "Thursday") },
47
+ { id: Days.Friday, label: $tr("ui.days.friday", "Friday") },
48
+ { id: Days.Saturday, label: $tr("ui.days.saturday", "Saturday") },
49
+ { id: Days.Sunday, label: $tr("ui.days.sunday", "Sunday") }
50
+ ];
51
+ if (props.useAllDays) {
52
+ items.unshift({ id: Days.AllDays, label: $tr("ui.days.all-days", "All days") });
53
+ }
54
+ return items;
55
+ });
56
+
57
+ return {
58
+ days
59
+ };
60
+ }
61
+ });
62
+ </script>