@dative-gpi/foundation-shared-components 1.0.36 → 1.0.37-report-v1
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/components/FSBreadcrumbs.vue +21 -12
- package/components/FSButton.vue +10 -10
- package/components/FSCalendar.vue +52 -14
- package/components/FSCalendarTwin.vue +96 -40
- package/components/FSCard.vue +28 -7
- package/components/FSCardPlaceholder.vue +8 -5
- package/components/FSChip.vue +12 -2
- package/components/FSClickable.vue +12 -13
- package/components/FSClock.vue +16 -7
- package/components/FSColorIcon.vue +23 -5
- package/components/FSDialog.vue +2 -1
- package/components/FSDialogContent.vue +12 -11
- package/components/FSDialogForm.vue +22 -2
- package/components/FSDialogFormBody.vue +47 -28
- package/components/FSDialogMenu.vue +17 -8
- package/components/FSDialogMultiFormBody.vue +77 -54
- package/components/FSDialogRemove.vue +8 -8
- package/components/FSDialogSubmit.vue +17 -8
- package/components/FSEditImage.vue +1 -1
- package/components/FSEditImageUI.vue +20 -10
- package/components/FSFadeOut.vue +53 -21
- package/components/FSForm.vue +10 -8
- package/components/FSGrid.vue +1 -1
- package/components/FSIcon.vue +2 -1
- package/components/FSIconCard.vue +47 -7
- package/components/FSImage.vue +12 -4
- package/components/FSImageUI.vue +8 -15
- package/components/FSInstantPicker.vue +266 -0
- package/components/FSLink.vue +25 -9
- package/components/FSLoader.vue +28 -11
- package/components/FSOptionGroup.vue +51 -3
- package/components/FSPlayButtons.vue +72 -0
- package/components/FSProgressBar.vue +94 -0
- package/components/FSRouterLink.vue +42 -0
- package/components/FSSlideGroup.vue +19 -5
- package/components/FSSpan.vue +17 -7
- package/components/FSSwitch.vue +57 -27
- package/components/FSTab.vue +15 -13
- package/components/FSTabs.vue +32 -7
- package/components/FSTag.vue +14 -3
- package/components/FSTagGroup.vue +1 -1
- package/components/FSText.vue +11 -7
- package/components/FSWindow.vue +128 -4
- package/components/FSWrapGroup.vue +13 -1
- package/components/agenda/FSAgenda.vue +223 -0
- package/components/agenda/FSAgendaDialogCalendar.vue +76 -0
- package/components/agenda/FSAgendaHeader.vue +215 -0
- package/components/agenda/FSAgendaHorizontalEvent.vue +174 -0
- package/components/agenda/FSAgendaHorizontalTimeLineMarker.vue +46 -0
- package/components/agenda/FSAgendaHoursCol.vue +103 -0
- package/components/agenda/FSAgendaHoursRow.vue +164 -0
- package/components/agenda/FSAgendaVerticalEvent.vue +160 -0
- package/components/agenda/FSAgendaVerticalTimeLineMarker.vue +46 -0
- package/components/agenda/FSDayAgenda.vue +199 -0
- package/components/agenda/FSMonthAgenda.vue +252 -0
- package/components/agenda/FSSelectAgendaMode.vue +54 -0
- package/components/agenda/FSWeekAgenda.vue +323 -0
- package/components/autocompletes/FSAutoCompleteAddress.vue +22 -20
- package/components/autocompletes/FSAutocompleteLanguage.vue +7 -1
- package/components/autocompletes/FSAutocompleteTimeZone.vue +7 -1
- package/components/buttons/FSButtonAdd.vue +1 -1
- package/components/buttons/FSButtonAddLabel.vue +1 -1
- package/components/buttons/FSButtonCancel.vue +1 -1
- package/components/buttons/FSButtonCancelLabel.vue +1 -1
- package/components/buttons/FSButtonCopy.vue +1 -1
- package/components/buttons/FSButtonCopyLabel.vue +1 -1
- package/components/buttons/FSButtonDragIcon.vue +27 -0
- package/components/buttons/FSButtonDuplicate.vue +1 -1
- package/components/buttons/FSButtonDuplicateLabel.vue +1 -1
- package/components/buttons/FSButtonEdit.vue +1 -1
- package/components/buttons/FSButtonEditLabel.vue +1 -1
- package/components/buttons/FSButtonFile.vue +1 -1
- package/components/buttons/FSButtonFileLabel.vue +1 -1
- package/components/buttons/FSButtonNext.vue +1 -1
- package/components/buttons/FSButtonNextLabel.vue +1 -1
- package/components/buttons/FSButtonPrevious.vue +1 -1
- package/components/buttons/FSButtonPreviousLabel.vue +1 -1
- package/components/buttons/FSButtonRedo.vue +1 -1
- package/components/buttons/FSButtonRedoLabel.vue +1 -1
- package/components/buttons/FSButtonRemove.vue +1 -1
- package/components/buttons/FSButtonRemoveLabel.vue +1 -1
- package/components/buttons/FSButtonSave.vue +1 -1
- package/components/buttons/FSButtonSaveLabel.vue +1 -1
- package/components/buttons/FSButtonSearch.vue +1 -1
- package/components/buttons/FSButtonSearchLabel.vue +1 -1
- package/components/buttons/FSButtonUndo.vue +1 -1
- package/components/buttons/FSButtonUndoLabel.vue +1 -1
- package/components/buttons/FSButtonUpdate.vue +1 -1
- package/components/buttons/FSButtonUpdateLabel.vue +1 -1
- package/components/buttons/FSButtonValidate.vue +1 -1
- package/components/buttons/FSButtonValidateLabel.vue +1 -1
- package/components/calendar/FSSimpleCalendar.vue +145 -0
- package/components/calendar/FSSimpleCalendarHeader.vue +60 -0
- package/components/calendar/FSSimpleMonthSelector.vue +138 -0
- package/components/deviceOrganisations/FSConnectivity.vue +11 -1
- package/components/deviceOrganisations/FSConnectivityCard.vue +19 -47
- package/components/deviceOrganisations/FSStatus.vue +11 -1
- package/components/deviceOrganisations/FSStatusCard.vue +35 -61
- package/components/deviceOrganisations/FSStatusesCarousel.vue +1 -0
- package/components/deviceOrganisations/FSStatusesRow.vue +9 -3
- package/components/deviceOrganisations/FSWorstAlert.vue +30 -37
- package/components/deviceOrganisations/FSWorstAlertCard.vue +36 -85
- package/components/fields/FSAutocompleteField.vue +445 -463
- package/components/fields/FSAutocompleteTag.vue +1 -1
- package/components/fields/FSBaseField.vue +44 -27
- package/components/fields/FSColorField.vue +42 -39
- package/components/fields/FSCommentField.vue +105 -0
- package/components/fields/FSDateField.vue +3 -2
- package/components/fields/FSDateRangeField.vue +3 -2
- package/components/fields/FSDateTimeField.vue +4 -3
- package/components/fields/FSDateTimeRangeField.vue +8 -6
- package/components/fields/FSEntityFieldUI.vue +271 -0
- package/components/fields/FSGradientField.vue +27 -33
- package/components/fields/FSIconField.vue +0 -1
- package/components/fields/FSMagicConfigField.vue +10 -3
- package/components/fields/FSMagicField.vue +9 -4
- package/components/fields/FSNumberField.vue +6 -1
- package/components/fields/FSRichTextField.vue +102 -52
- package/components/fields/FSSearchField.vue +9 -115
- package/components/fields/FSSelectField.vue +477 -252
- package/components/fields/FSTagField.vue +1 -1
- package/components/fields/FSTermField.vue +42 -17
- package/components/fields/FSTextArea.vue +26 -7
- package/components/fields/FSTextField.vue +8 -3
- package/components/fields/FSTimeRangeField.vue +304 -0
- package/components/fields/FSTimeStepField.vue +3 -3
- package/components/fields/FSTranslateField.vue +4 -3
- package/components/fields/FSTranslateRichTextField.vue +32 -12
- package/components/fields/FSTranslateTextArea.vue +233 -0
- package/components/fields/periodicField/FSPeriodicDailyField.vue +2 -2
- package/components/fields/periodicField/FSPeriodicField.vue +8 -8
- package/components/fields/periodicField/FSPeriodicMonthlyField.vue +8 -8
- package/components/fields/periodicField/FSPeriodicWeeklyField.vue +23 -13
- package/components/fields/periodicField/FSPeriodicYearlyField.vue +6 -6
- package/components/lists/FSDataTableUI.vue +173 -103
- package/components/lists/FSDraggable.vue +2 -2
- package/components/lists/FSFilterButton.vue +7 -11
- package/components/lists/FSHeaderButton.vue +4 -4
- package/components/lists/FSHiddenButton.vue +3 -5
- package/components/lists/FSLoadDataTable.vue +10 -7
- package/components/lists/FSSimpleList.vue +234 -0
- package/components/lists/FSSimpleListItem.vue +132 -0
- package/components/map/FSMap.vue +83 -33
- package/components/map/FSMapFeatureGroup.vue +2 -2
- package/components/map/FSMapLayerButton.vue +3 -3
- package/components/map/FSMapMarker.vue +11 -7
- package/components/map/FSMapMarkerClusterGroup.vue +8 -3
- package/components/map/FSMapOverlay.vue +37 -20
- package/components/map/FSMapPolygon.vue +5 -5
- package/components/map/FSMapTileLayer.vue +2 -2
- package/components/map/keys.ts +3 -3
- package/components/selects/FSSelectAutoRefresh.vue +9 -9
- package/components/selects/FSSelectDashboardVariableType.vue +5 -4
- package/components/selects/FSSelectDateSetting.vue +3 -2
- package/components/selects/FSSelectDays.vue +9 -9
- package/components/selects/FSSelectListMode.vue +51 -0
- package/components/selects/FSSelectMonths.vue +14 -14
- package/components/selects/chartSelectors/FSAggregationSelector.vue +52 -0
- package/components/selects/chartSelectors/FSAxisTypeSelector.vue +49 -0
- package/components/selects/chartSelectors/FSDisplayAsSelector.vue +53 -0
- package/components/selects/chartSelectors/FSFilterTypeSelector.vue +54 -0
- package/components/selects/chartSelectors/FSHeatmapRuleSelector.vue +54 -0
- package/components/selects/chartSelectors/FSOperationOnSelector.vue +53 -0
- package/components/selects/chartSelectors/FSPlanningTypeSelector.vue +53 -0
- package/components/selects/chartSelectors/FSPlotPerSelector.vue +52 -0
- package/components/selects/chartSelectors/FSSelectEntityType.vue +59 -0
- package/components/selects/chartSelectors/FSSerieTypeSelector.vue +53 -0
- package/components/tiles/FSAlertTileUI.vue +90 -0
- package/components/tiles/FSChartTileUI.vue +111 -0
- package/components/tiles/FSCommentTileUI.vue +174 -0
- package/components/tiles/FSDeviceOrganisationTileUI.vue +6 -0
- package/components/tiles/FSGroupTileUI.vue +2 -2
- package/components/tiles/FSLoadTile.vue +2 -0
- package/components/tiles/FSLocationTileUI.vue +192 -0
- package/components/tiles/FSModelTileUI.vue +18 -0
- package/components/tiles/FSSimpleTileUI.vue +9 -4
- package/components/tiles/FSTile.vue +93 -74
- package/components/tiles/FSUserOrganisationTileUI.vue +1 -1
- package/components/toggleSets/FSToggleSetPosition.vue +2 -2
- package/components/views/FSBaseView.vue +64 -0
- package/components/views/FSEntityView.vue +12 -140
- package/components/views/FSSimpleView.vue +29 -0
- package/components/views/desktop/FSBaseDefaultDesktopView.vue +135 -0
- package/components/views/desktop/FSBaseDesktopView.vue +53 -0
- package/components/views/desktop/FSBaseEntityDesktopView.vue +209 -0
- package/components/views/mobile/FSBaseDefaultMobileView.vue +133 -0
- package/components/views/mobile/FSBaseEntityMobileView.vue +199 -0
- package/components/views/mobile/FSBaseMobileView.vue +53 -0
- package/composables/useBreakpoints.ts +39 -3
- package/composables/useColors.ts +3 -2
- package/composables/useMagicFieldProvider.ts +1 -0
- package/composables/useSlots.ts +2 -1
- package/models/agenda.ts +9 -0
- package/models/deviceAlerts.ts +1 -1
- package/models/deviceConnectivities.ts +1 -1
- package/models/index.ts +1 -0
- package/models/magicFields.ts +1 -0
- package/models/map.ts +2 -2
- package/models/rules.ts +8 -5
- package/models/tables.ts +5 -2
- package/models/variableNode.ts +8 -5
- package/package.json +5 -5
- package/styles/components/fs_agenda.scss +36 -0
- package/styles/components/fs_agenda_event.scss +41 -0
- package/styles/components/fs_agenda_hours_col.scss +4 -0
- package/styles/components/fs_agenda_hours_row.scss +5 -0
- package/styles/components/fs_agenda_time_line_marker.scss +19 -0
- package/styles/components/fs_autocomplete_field.scss +0 -13
- package/styles/components/fs_breadcrumbs.scss +18 -36
- package/styles/components/fs_button.scss +7 -5
- package/styles/components/fs_chip.scss +8 -6
- package/styles/components/fs_clickable.scss +18 -23
- package/styles/components/fs_clock.scss +0 -10
- package/styles/components/fs_color_field.scss +1 -4
- package/styles/components/fs_data_iterator_item.scss +12 -10
- package/styles/components/fs_data_table.scss +6 -9
- package/styles/components/fs_dialog.scss +7 -17
- package/styles/components/fs_dialog_menu.scss +4 -2
- package/styles/components/fs_edit_image.scss +8 -0
- package/styles/components/fs_fade_out.scss +10 -2
- package/styles/components/fs_filter_button.scss +1 -6
- package/styles/components/fs_gradient_field.scss +11 -11
- package/styles/components/fs_hidden_button.scss +2 -7
- package/styles/components/fs_image_card.scss +6 -4
- package/styles/components/fs_magic_config_field.scss +1 -2
- package/styles/components/fs_map.scss +11 -7
- package/styles/components/fs_meta_field.scss +3 -5
- package/styles/components/fs_option_group.scss +15 -5
- package/styles/components/fs_password_field.scss +4 -2
- package/styles/components/fs_progress_bar.scss +14 -0
- package/styles/components/fs_radio.scss +0 -11
- package/styles/components/fs_rich_text_field.scss +1 -9
- package/styles/components/fs_select_date_settings.scss +3 -0
- package/styles/components/fs_select_field.scss +4 -13
- package/styles/components/fs_slide_group.scss +7 -0
- package/styles/components/fs_span.scss +13 -4
- package/styles/components/fs_switch.scss +1 -0
- package/styles/components/fs_tabs.scss +19 -33
- package/styles/components/fs_tag.scss +8 -22
- package/styles/components/fs_text_area.scss +13 -17
- package/styles/components/fs_tile.scss +21 -15
- package/styles/components/fs_window.scss +7 -0
- package/styles/components/fs_wrap_group.scss +7 -0
- package/styles/components/index.scss +6 -4
- package/styles/globals/index.scss +1 -5
- package/styles/globals/overrides.scss +28 -61
- package/styles/globals/scrollbars.scss +10 -0
- package/styles/globals/text_fonts.scss +18 -66
- package/tools/alertsTools.ts +69 -0
- package/tools/chartsTools.ts +427 -0
- package/tools/index.ts +4 -0
- package/tools/reportsTools.ts +38 -0
- package/tools/timeRangeTools.ts +125 -0
- package/utils/filter.ts +18 -0
- package/utils/index.ts +2 -0
- package/utils/leafletMarkers.ts +4 -4
- package/utils/operations.ts +69 -0
- package/utils/sort.ts +2 -2
- package/utils/statuses.ts +1 -1
- package/utils/time.ts +17 -17
- package/components/fields/FSTimeSlotField.vue +0 -250
- package/components/views/FSEntityHeader.vue +0 -350
- package/components/views/FSListHeader.vue +0 -83
- package/components/views/FSListView.vue +0 -83
- package/components/views/FSSkeletonView.vue +0 -100
- package/styles/components/fs_icon_field.scss +0 -12
- package/styles/components/fs_tag_field.scss +0 -8
- package/styles/components/fs_time_field.scss +0 -12
- package/styles/components/fs_timeslot_field.scss +0 -12
- package/styles/globals/breakpoints.scss +0 -20
- package/styles/globals/fixes.scss +0 -5
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
:wrap="false"
|
|
15
15
|
>
|
|
16
16
|
<FSSelectDateSetting
|
|
17
|
+
minWidth="180px"
|
|
17
18
|
:lastPeriod="$props.lastPeriod"
|
|
18
19
|
:editable="$props.editable"
|
|
19
20
|
:variant="$props.variant"
|
|
@@ -22,10 +23,12 @@
|
|
|
22
23
|
@update:modelValue="innerDateSettingChange"
|
|
23
24
|
/>
|
|
24
25
|
<FSNumberField
|
|
26
|
+
minWidth="60px"
|
|
25
27
|
v-if="pastSettings.includes(innerDateSetting)"
|
|
26
28
|
:rules="[NumberRules.required(), NumberRules.min(0)]"
|
|
27
29
|
:editable="$props.editable"
|
|
28
30
|
:hideHeader="true"
|
|
31
|
+
:clearable="false"
|
|
29
32
|
:modelValue="innerDateValue"
|
|
30
33
|
@update:modelValue="innerDateValueChange"
|
|
31
34
|
/>
|
|
@@ -43,6 +46,7 @@
|
|
|
43
46
|
:rules="[TextRules.required(), DateRules.validateExpression($props.variant)]"
|
|
44
47
|
:editable="$props.editable"
|
|
45
48
|
:hideHeader="true"
|
|
49
|
+
:clearable="false"
|
|
46
50
|
:modelValue="innerStartDate"
|
|
47
51
|
@update:modelValue="innerStartDateChange"
|
|
48
52
|
/>
|
|
@@ -58,6 +62,7 @@
|
|
|
58
62
|
:rules="[TextRules.required(), DateRules.validateExpression($props.variant)]"
|
|
59
63
|
:editable="$props.editable"
|
|
60
64
|
:hideHeader="true"
|
|
65
|
+
:clearable="false"
|
|
61
66
|
:modelValue="innerEndDate"
|
|
62
67
|
@update:modelValue="innerEndDateChange"
|
|
63
68
|
/>
|
|
@@ -65,10 +70,12 @@
|
|
|
65
70
|
</template>
|
|
66
71
|
<FSDateTimeRangeField
|
|
67
72
|
v-else-if="innerDateSetting === DateSetting.Pick"
|
|
73
|
+
:width="['350px', '310px']"
|
|
68
74
|
:rules="[DateRules.required()]"
|
|
69
75
|
:editable="$props.editable"
|
|
70
76
|
:hideHeader="true"
|
|
71
|
-
:
|
|
77
|
+
:clearable="false"
|
|
78
|
+
:modelValue="actualValue"
|
|
72
79
|
@update:modelValue="onPickDates"
|
|
73
80
|
/>
|
|
74
81
|
</FSRow>
|
|
@@ -77,13 +84,13 @@
|
|
|
77
84
|
</template>
|
|
78
85
|
|
|
79
86
|
<script lang="ts">
|
|
80
|
-
import { computed, defineComponent, type PropType, ref, watch } from "vue";
|
|
87
|
+
import { computed, defineComponent, onMounted, type PropType, ref, watch } from "vue";
|
|
81
88
|
import _ from "lodash";
|
|
82
89
|
|
|
83
90
|
import { DateRules, NumberRules, TextRules } from "@dative-gpi/foundation-shared-components/models";
|
|
84
|
-
import {
|
|
91
|
+
import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
|
|
85
92
|
import { useRules } from "@dative-gpi/foundation-shared-components/composables";
|
|
86
|
-
import { DateSetting } from "@dative-gpi/foundation-shared-domain/
|
|
93
|
+
import { DateSetting } from "@dative-gpi/foundation-shared-domain/enums";
|
|
87
94
|
|
|
88
95
|
import FSSelectDateSetting from "../selects/FSSelectDateSetting.vue";
|
|
89
96
|
import FSDateTimeRangeField from "./FSDateTimeRangeField.vue";
|
|
@@ -161,9 +168,9 @@ export default defineComponent({
|
|
|
161
168
|
default: true
|
|
162
169
|
}
|
|
163
170
|
},
|
|
164
|
-
emits: ["update:startDate", "update:endDate"],
|
|
171
|
+
emits: ["update", "update:startDate", "update:endDate"],
|
|
165
172
|
setup(props, { emit }) {
|
|
166
|
-
const { parseForPicker,
|
|
173
|
+
const { parseForPicker, epochToISO, todayToPicker, yesterdayToPicker } = useDateFormat();
|
|
167
174
|
const { getMessages } = useRules();
|
|
168
175
|
|
|
169
176
|
const innerDateSetting = ref<DateSetting>(DateSetting.PastDays);
|
|
@@ -181,6 +188,14 @@ export default defineComponent({
|
|
|
181
188
|
];
|
|
182
189
|
});
|
|
183
190
|
|
|
191
|
+
const actualValue = computed(() => {
|
|
192
|
+
const dates = [parseForPicker(innerStartDate.value), parseForPicker(innerEndDate.value)];
|
|
193
|
+
if (dates.some(d => d == null)) {
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
return dates as [number, number];
|
|
197
|
+
})
|
|
198
|
+
|
|
184
199
|
const messages = computed((): string[] => {
|
|
185
200
|
return props.messages ??
|
|
186
201
|
getMessages(props.startDate, props.rules).concat(getMessages(props.endDate, props.rules));
|
|
@@ -194,6 +209,7 @@ export default defineComponent({
|
|
|
194
209
|
innerStartDate.value = value;
|
|
195
210
|
if (valid.value) {
|
|
196
211
|
emit("update:startDate", value);
|
|
212
|
+
emit("update", { startDate: innerStartDate.value, endDate: props.endDate });
|
|
197
213
|
}
|
|
198
214
|
};
|
|
199
215
|
|
|
@@ -207,6 +223,7 @@ export default defineComponent({
|
|
|
207
223
|
innerEndDate.value = value;
|
|
208
224
|
if (valid.value) {
|
|
209
225
|
emit("update:endDate", value);
|
|
226
|
+
emit("update", { startDate: props.startDate, endDate: innerEndDate.value });
|
|
210
227
|
}
|
|
211
228
|
};
|
|
212
229
|
|
|
@@ -342,6 +359,7 @@ export default defineComponent({
|
|
|
342
359
|
}
|
|
343
360
|
emit("update:startDate", innerStartDate.value);
|
|
344
361
|
emit("update:endDate", innerEndDate.value);
|
|
362
|
+
emit("update", { startDate: innerStartDate.value, endDate: innerEndDate.value });
|
|
345
363
|
};
|
|
346
364
|
|
|
347
365
|
const innerDateValueChange = (value: number) => {
|
|
@@ -405,6 +423,7 @@ export default defineComponent({
|
|
|
405
423
|
}
|
|
406
424
|
emit("update:startDate", innerStartDate.value);
|
|
407
425
|
emit("update:endDate", innerEndDate.value);
|
|
426
|
+
emit("update", { startDate: innerStartDate.value, endDate: innerEndDate.value });
|
|
408
427
|
};
|
|
409
428
|
|
|
410
429
|
const onPickDates = (value: number[] | null) => {
|
|
@@ -414,20 +433,22 @@ export default defineComponent({
|
|
|
414
433
|
if (valid.value) {
|
|
415
434
|
emit("update:startDate", innerStartDate.value);
|
|
416
435
|
emit("update:endDate", innerEndDate.value);
|
|
436
|
+
emit("update", { startDate: innerStartDate.value, endDate: innerEndDate.value });
|
|
417
437
|
}
|
|
418
438
|
}
|
|
419
439
|
else {
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
innerStartDate.value = formatFromPicker(value[0]);
|
|
440
|
+
if (value && value[0] != null && epochToISO(value[0]) !== innerStartDate.value) {
|
|
441
|
+
innerStartDate.value = epochToISO(value[0]);
|
|
423
442
|
if (valid.value) {
|
|
424
443
|
emit("update:startDate", innerStartDate.value);
|
|
444
|
+
emit("update", { startDate: innerStartDate.value, endDate: props.endDate });
|
|
425
445
|
}
|
|
426
446
|
}
|
|
427
|
-
if (value && value[1] != null &&
|
|
428
|
-
innerEndDate.value =
|
|
447
|
+
if (value && value[1] != null && epochToISO(value[1]) !== innerEndDate.value) {
|
|
448
|
+
innerEndDate.value = epochToISO(value[1]);
|
|
429
449
|
if (valid.value) {
|
|
430
450
|
emit("update:endDate", innerEndDate.value);
|
|
451
|
+
emit("update", { startDate: props.startDate, endDate: innerEndDate.value });
|
|
431
452
|
}
|
|
432
453
|
}
|
|
433
454
|
}
|
|
@@ -619,7 +640,7 @@ export default defineComponent({
|
|
|
619
640
|
}
|
|
620
641
|
}
|
|
621
642
|
|
|
622
|
-
if (parseForPicker(props.endDate) != null && parseForPicker(props.startDate) != null) {
|
|
643
|
+
if (props.endDate && parseForPicker(props.endDate) != null && props.startDate && parseForPicker(props.startDate) != null) {
|
|
623
644
|
innerDateSetting.value = DateSetting.Pick;
|
|
624
645
|
innerDateValue.value = 1;
|
|
625
646
|
return;
|
|
@@ -629,20 +650,24 @@ export default defineComponent({
|
|
|
629
650
|
innerDateValue.value = 1;
|
|
630
651
|
};
|
|
631
652
|
|
|
653
|
+
// This watcher is called once even if both value are set at the same time
|
|
632
654
|
watch([() => props.startDate, () => props.endDate], () => {
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
innerEndDate.value !== props.endDate
|
|
636
|
-
) {
|
|
655
|
+
// Having one of those different from the inner value means something up the chain is updating
|
|
656
|
+
if (props.startDate !== innerStartDate.value || props.endDate !== innerEndDate.value) {
|
|
637
657
|
reset();
|
|
638
658
|
}
|
|
639
|
-
}
|
|
659
|
+
});
|
|
660
|
+
|
|
661
|
+
onMounted((): void => {
|
|
662
|
+
reset();
|
|
663
|
+
});
|
|
640
664
|
|
|
641
665
|
return {
|
|
642
666
|
innerDateSetting,
|
|
643
667
|
innerDateValue,
|
|
644
668
|
innerStartDate,
|
|
645
669
|
innerEndDate,
|
|
670
|
+
actualValue,
|
|
646
671
|
pastSettings,
|
|
647
672
|
DateSetting,
|
|
648
673
|
NumberRules,
|
|
@@ -7,6 +7,15 @@
|
|
|
7
7
|
:editable="$props.editable"
|
|
8
8
|
:messages="messages"
|
|
9
9
|
>
|
|
10
|
+
<template
|
|
11
|
+
v-if="$slots.label"
|
|
12
|
+
v-slot:label="slotData"
|
|
13
|
+
>
|
|
14
|
+
<slot
|
|
15
|
+
name="label"
|
|
16
|
+
v-bind="slotData"
|
|
17
|
+
/>
|
|
18
|
+
</template>
|
|
10
19
|
<v-textarea
|
|
11
20
|
class="fs-text-area"
|
|
12
21
|
variant="outlined"
|
|
@@ -26,7 +35,7 @@
|
|
|
26
35
|
v-bind="$attrs"
|
|
27
36
|
>
|
|
28
37
|
<template
|
|
29
|
-
v-for="(_, name) in
|
|
38
|
+
v-for="(_, name) in slots"
|
|
30
39
|
v-slot:[name]="slotData"
|
|
31
40
|
>
|
|
32
41
|
<slot
|
|
@@ -56,7 +65,7 @@
|
|
|
56
65
|
<script lang="ts">
|
|
57
66
|
import { computed, defineComponent, type PropType, type StyleValue } from "vue";
|
|
58
67
|
|
|
59
|
-
import { useColors, useBreakpoints, useRules } from "@dative-gpi/foundation-shared-components/composables";
|
|
68
|
+
import { useColors, useBreakpoints, useRules, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
60
69
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
61
70
|
|
|
62
71
|
import FSBaseField from "./FSBaseField.vue";
|
|
@@ -127,9 +136,12 @@ export default defineComponent({
|
|
|
127
136
|
},
|
|
128
137
|
emits: ["update:modelValue"],
|
|
129
138
|
setup(props) {
|
|
139
|
+
const { fontStyles, isMobileSized } = useBreakpoints();
|
|
130
140
|
const { validateOn, getMessages } = useRules();
|
|
131
|
-
const { isMobileSized } = useBreakpoints();
|
|
132
141
|
const { getColors } = useColors();
|
|
142
|
+
const { slots } = useSlots();
|
|
143
|
+
|
|
144
|
+
delete slots.label;
|
|
133
145
|
|
|
134
146
|
const errors = getColors(ColorEnum.Error);
|
|
135
147
|
const lights = getColors(ColorEnum.Light);
|
|
@@ -140,7 +152,7 @@ export default defineComponent({
|
|
|
140
152
|
let fieldHeight: string | undefined = undefined;
|
|
141
153
|
if (!props.autoGrow) {
|
|
142
154
|
const base = isMobileSized.value ? 34 : 38;
|
|
143
|
-
const row = isMobileSized.value ?
|
|
155
|
+
const row = isMobileSized.value ? 18 : 20;
|
|
144
156
|
if (props.rows > 1) {
|
|
145
157
|
height = `${base + (props.rows - 1) * row}px`;
|
|
146
158
|
}
|
|
@@ -156,7 +168,10 @@ export default defineComponent({
|
|
|
156
168
|
"--fs-text-area-color" : lights.dark,
|
|
157
169
|
"--fs-text-area-active-border-color": lights.base,
|
|
158
170
|
"--fs-text-area-height" : height,
|
|
159
|
-
"--fs-text-area-field-height" : fieldHeight
|
|
171
|
+
"--fs-text-area-field-height" : fieldHeight,
|
|
172
|
+
"--fs-text-area-padding" : isMobileSized.value ? "10px 16px" : "11px 16px",
|
|
173
|
+
"--fs-base-field-input-height" : isMobileSized.value ? "34px" : "38px",
|
|
174
|
+
...fontStyles.value
|
|
160
175
|
};
|
|
161
176
|
}
|
|
162
177
|
return {
|
|
@@ -166,7 +181,10 @@ export default defineComponent({
|
|
|
166
181
|
"--fs-text-area-active-border-color": darks.dark,
|
|
167
182
|
"--fs-text-area-error-border-color" : errors.base,
|
|
168
183
|
"--fs-text-area-height" : height,
|
|
169
|
-
"--fs-text-area-field-height" : fieldHeight
|
|
184
|
+
"--fs-text-area-field-height" : fieldHeight,
|
|
185
|
+
"--fs-text-area-padding" : isMobileSized.value ? "10px 16px" : "11px 16px",
|
|
186
|
+
"--fs-base-field-input-height" : isMobileSized.value ? "34px" : "38px",
|
|
187
|
+
...fontStyles.value
|
|
170
188
|
};
|
|
171
189
|
});
|
|
172
190
|
|
|
@@ -185,7 +203,8 @@ export default defineComponent({
|
|
|
185
203
|
ColorEnum,
|
|
186
204
|
messages,
|
|
187
205
|
classes,
|
|
188
|
-
style
|
|
206
|
+
style,
|
|
207
|
+
slots
|
|
189
208
|
};
|
|
190
209
|
}
|
|
191
210
|
});
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
<script lang="ts">
|
|
72
72
|
import { computed, defineComponent, type PropType, type StyleValue } from "vue";
|
|
73
73
|
|
|
74
|
-
import { useColors, useRules, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
74
|
+
import { useBreakpoints, useColors, useRules, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
75
75
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
76
76
|
|
|
77
77
|
import FSBaseField from "./FSBaseField.vue";
|
|
@@ -137,6 +137,7 @@ export default defineComponent({
|
|
|
137
137
|
},
|
|
138
138
|
emits: ["update:modelValue"],
|
|
139
139
|
setup(props) {
|
|
140
|
+
const { fontStyles, isMobileSized } = useBreakpoints();
|
|
140
141
|
const { validateOn, getMessages } = useRules();
|
|
141
142
|
const { getColors } = useColors();
|
|
142
143
|
const { slots } = useSlots();
|
|
@@ -154,7 +155,9 @@ export default defineComponent({
|
|
|
154
155
|
"--fs-text-field-cursor" : "default",
|
|
155
156
|
"--fs-text-field-border-color" : lights.base,
|
|
156
157
|
"--fs-text-field-color" : lights.dark,
|
|
157
|
-
"--fs-text-field-active-border-color": lights.base
|
|
158
|
+
"--fs-text-field-active-border-color": lights.base,
|
|
159
|
+
"--fs-base-field-input-height" : isMobileSized.value ? "34px" : "38px",
|
|
160
|
+
...fontStyles.value
|
|
158
161
|
};
|
|
159
162
|
}
|
|
160
163
|
return {
|
|
@@ -162,7 +165,9 @@ export default defineComponent({
|
|
|
162
165
|
"--fs-text-field-border-color" : lights.dark,
|
|
163
166
|
"--fs-text-field-color" : darks.base,
|
|
164
167
|
"--fs-text-field-active-border-color": darks.dark,
|
|
165
|
-
"--fs-text-field-error-border-color" : errors.base
|
|
168
|
+
"--fs-text-field-error-border-color" : errors.base,
|
|
169
|
+
"--fs-base-field-input-height" : isMobileSized.value ? "34px" : "38px",
|
|
170
|
+
...fontStyles.value
|
|
166
171
|
};
|
|
167
172
|
});
|
|
168
173
|
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSBaseField
|
|
3
|
+
:description="$props.description"
|
|
4
|
+
:hideHeader="$props.hideHeader"
|
|
5
|
+
:required="$props.required"
|
|
6
|
+
:editable="$props.editable"
|
|
7
|
+
:label="$props.label"
|
|
8
|
+
:messages="messages"
|
|
9
|
+
>
|
|
10
|
+
<FSRow>
|
|
11
|
+
<FSRow
|
|
12
|
+
:wrap="false"
|
|
13
|
+
>
|
|
14
|
+
<FSSelectField
|
|
15
|
+
:validationValue="$props.modelValue"
|
|
16
|
+
:editable="$props.editable"
|
|
17
|
+
:validateOn="validateOn"
|
|
18
|
+
:rules="$props.rules"
|
|
19
|
+
:items="daysItems"
|
|
20
|
+
:hideHeader="true"
|
|
21
|
+
:clearable="false"
|
|
22
|
+
:modelValue="realTime?.startDay ?? 0"
|
|
23
|
+
@update:modelValue="onChangeDayStart"
|
|
24
|
+
/>
|
|
25
|
+
<FSClock
|
|
26
|
+
:editable="$props.editable"
|
|
27
|
+
:color="ColorEnum.Light"
|
|
28
|
+
:slider="false"
|
|
29
|
+
:modelValue="startTime"
|
|
30
|
+
@update:modelValue="onChangeHourStart"
|
|
31
|
+
/>
|
|
32
|
+
</FSRow>
|
|
33
|
+
<FSRow
|
|
34
|
+
:wrap="false"
|
|
35
|
+
>
|
|
36
|
+
<FSSelectField
|
|
37
|
+
:editable="$props.editable"
|
|
38
|
+
:items="daysItems"
|
|
39
|
+
:hideHeader="true"
|
|
40
|
+
:clearable="false"
|
|
41
|
+
:modelValue="realTime?.endDay ?? 0"
|
|
42
|
+
@update:modelValue="onChangeDayEnd"
|
|
43
|
+
/>
|
|
44
|
+
<FSClock
|
|
45
|
+
:editable="$props.editable"
|
|
46
|
+
:color="ColorEnum.Light"
|
|
47
|
+
:slider="false"
|
|
48
|
+
:modelValue="endTime"
|
|
49
|
+
@update:modelValue="onChangeHourEnd"
|
|
50
|
+
/>
|
|
51
|
+
</FSRow>
|
|
52
|
+
<FSSelectField
|
|
53
|
+
v-if="$props.showVariant"
|
|
54
|
+
width="hug"
|
|
55
|
+
:label="$tr('ui.common.type', 'Type')"
|
|
56
|
+
:items="dateTypeItems"
|
|
57
|
+
:hideHeader="true"
|
|
58
|
+
:clearable="false"
|
|
59
|
+
:modelValue="modelValue?.variant ?? DateType.Local"
|
|
60
|
+
@update:modelValue="onUpdateVariant"
|
|
61
|
+
/>
|
|
62
|
+
</FSRow>
|
|
63
|
+
</FSBaseField>
|
|
64
|
+
</template>
|
|
65
|
+
|
|
66
|
+
<script lang="ts">
|
|
67
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
68
|
+
|
|
69
|
+
import { useTranslations as useTranslationProvider } from "@dative-gpi/bones-ui/composables";
|
|
70
|
+
import { useRules } from "@dative-gpi/foundation-shared-components/composables";
|
|
71
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
72
|
+
import { DateType, Days } from "@dative-gpi/foundation-shared-domain/enums";
|
|
73
|
+
import { getEnumEntries } from "@dative-gpi/foundation-shared-domain/tools";
|
|
74
|
+
|
|
75
|
+
import FSSelectField from "./FSSelectField.vue";
|
|
76
|
+
import FSBaseField from "./FSBaseField.vue";
|
|
77
|
+
import FSClock from "../FSClock.vue";
|
|
78
|
+
import FSRow from "../FSRow.vue";
|
|
79
|
+
|
|
80
|
+
import { applyOffset, dayLabel, type DateTimeRange } from "../../tools";
|
|
81
|
+
|
|
82
|
+
export default defineComponent({
|
|
83
|
+
name: "FSTimeRangeField",
|
|
84
|
+
components: {
|
|
85
|
+
FSSelectField,
|
|
86
|
+
FSBaseField,
|
|
87
|
+
FSClock,
|
|
88
|
+
FSRow
|
|
89
|
+
},
|
|
90
|
+
props: {
|
|
91
|
+
label: {
|
|
92
|
+
type: String as PropType<string | null>,
|
|
93
|
+
required: false,
|
|
94
|
+
default: null
|
|
95
|
+
},
|
|
96
|
+
description: {
|
|
97
|
+
type: String as PropType<string | null>,
|
|
98
|
+
required: false,
|
|
99
|
+
default: null
|
|
100
|
+
},
|
|
101
|
+
modelValue: {
|
|
102
|
+
type: Object as PropType<DateTimeRange>,
|
|
103
|
+
required: true,
|
|
104
|
+
default: null
|
|
105
|
+
},
|
|
106
|
+
hideHeader: {
|
|
107
|
+
type: Boolean,
|
|
108
|
+
required: false,
|
|
109
|
+
default: false
|
|
110
|
+
},
|
|
111
|
+
required: {
|
|
112
|
+
type: Boolean,
|
|
113
|
+
required: false,
|
|
114
|
+
default: false
|
|
115
|
+
},
|
|
116
|
+
rules: {
|
|
117
|
+
type: Array as PropType<any[]>,
|
|
118
|
+
required: false,
|
|
119
|
+
default: () => []
|
|
120
|
+
},
|
|
121
|
+
messages: {
|
|
122
|
+
type: Array as PropType<string[]>,
|
|
123
|
+
required: false,
|
|
124
|
+
default: null
|
|
125
|
+
},
|
|
126
|
+
editable: {
|
|
127
|
+
type: Boolean,
|
|
128
|
+
required: false,
|
|
129
|
+
default: true
|
|
130
|
+
},
|
|
131
|
+
showVariant: {
|
|
132
|
+
type: Boolean,
|
|
133
|
+
required: false,
|
|
134
|
+
default: false
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
emits: ["update:modelValue"],
|
|
138
|
+
setup(props, { emit }) {
|
|
139
|
+
const { $tr } = useTranslationProvider();
|
|
140
|
+
const { validateOn, getMessages } = useRules();
|
|
141
|
+
|
|
142
|
+
const dateTypeItems = [
|
|
143
|
+
{
|
|
144
|
+
id: DateType.Local,
|
|
145
|
+
label: $tr('ui.common.local', 'Local')
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
id: DateType.UTC,
|
|
149
|
+
label: $tr('ui.common.utc', 'UTC')
|
|
150
|
+
}
|
|
151
|
+
];
|
|
152
|
+
|
|
153
|
+
const daysItems = computed(()=>{
|
|
154
|
+
return getEnumEntries(Days).map((f)=>{
|
|
155
|
+
return {
|
|
156
|
+
id: f.value as number,
|
|
157
|
+
label: dayLabel(f.value)
|
|
158
|
+
}
|
|
159
|
+
})
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
const realTime = computed(() => {
|
|
163
|
+
return applyOffset(props.modelValue, false);
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
const startTime = computed((): number => {
|
|
167
|
+
if (realTime.value) {
|
|
168
|
+
return realTime.value.startHour * 60 * 60 * 1000 + realTime.value.startMinute * 60 * 1000;
|
|
169
|
+
}
|
|
170
|
+
return 0;
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
const endTime = computed((): number => {
|
|
174
|
+
if (realTime.value) {
|
|
175
|
+
return realTime.value.endHour * 60 * 60 * 1000 + realTime.value.endMinute * 60 * 1000;
|
|
176
|
+
}
|
|
177
|
+
return 0;
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
const messages = computed((): string[] => props.messages ?? getMessages(props.modelValue, props.rules));
|
|
181
|
+
|
|
182
|
+
const onChangeDayStart = (value: number) => {
|
|
183
|
+
if (value === Days.AllDays) {
|
|
184
|
+
emit("update:modelValue",
|
|
185
|
+
{
|
|
186
|
+
startDay: value,
|
|
187
|
+
startHour: props.modelValue.startHour,
|
|
188
|
+
startMinute: props.modelValue.startMinute,
|
|
189
|
+
endDay: value,
|
|
190
|
+
endHour: props.modelValue.endHour,
|
|
191
|
+
endMinute: props.modelValue.endMinute,
|
|
192
|
+
variant: props.modelValue.variant
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
const t = applyOffset({
|
|
198
|
+
startDay: value,
|
|
199
|
+
startHour: realTime.value.startHour,
|
|
200
|
+
startMinute: realTime.value.startMinute,
|
|
201
|
+
endDay: props.modelValue.endDay == Days.AllDays ? value : realTime.value.endDay,
|
|
202
|
+
endHour: realTime.value.endHour,
|
|
203
|
+
endMinute: realTime.value.endMinute,
|
|
204
|
+
variant: realTime.value.variant
|
|
205
|
+
}, true);
|
|
206
|
+
emit("update:modelValue",t);
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
const onChangeHourStart = (value: number) => {
|
|
212
|
+
const innerHours = value ? Math.floor(value / (60 * 60 * 1000)) : 0;
|
|
213
|
+
const innerMinutes = value ? Math.floor((value % (60 * 60 * 1000)) / (60 * 1000)) : 0;
|
|
214
|
+
const t = {
|
|
215
|
+
startDay: realTime.value.startDay,
|
|
216
|
+
startHour: innerHours,
|
|
217
|
+
startMinute: innerMinutes,
|
|
218
|
+
endDay: realTime.value.endDay,
|
|
219
|
+
endHour: realTime.value.endHour,
|
|
220
|
+
endMinute: realTime.value.endMinute,
|
|
221
|
+
variant: realTime.value.variant
|
|
222
|
+
};
|
|
223
|
+
const newTime = applyOffset(t, true);
|
|
224
|
+
emit("update:modelValue", newTime);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
const onChangeDayEnd = (value: number) => {
|
|
228
|
+
|
|
229
|
+
if (value === Days.AllDays) {
|
|
230
|
+
emit("update:modelValue",{
|
|
231
|
+
startDay: value,
|
|
232
|
+
startHour: props.modelValue.startHour,
|
|
233
|
+
startMinute: props.modelValue.startMinute,
|
|
234
|
+
endDay: value,
|
|
235
|
+
endHour: props.modelValue.endHour,
|
|
236
|
+
endMinute: props.modelValue.endMinute,
|
|
237
|
+
variant: props.modelValue.variant
|
|
238
|
+
});
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
const t = applyOffset({
|
|
243
|
+
startDay: props.modelValue.startDay == Days.AllDays ? value : realTime.value.startDay,
|
|
244
|
+
startHour: realTime.value.startHour,
|
|
245
|
+
startMinute: realTime.value.startMinute,
|
|
246
|
+
endDay: value,
|
|
247
|
+
endHour: realTime.value.endHour,
|
|
248
|
+
endMinute: realTime.value.endMinute,
|
|
249
|
+
variant: realTime.value.variant
|
|
250
|
+
}, true);
|
|
251
|
+
emit("update:modelValue", t);
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
const onChangeHourEnd = (value: number) => {
|
|
256
|
+
const innerHours = value ? Math.floor(value / (60 * 60 * 1000)) : 0;
|
|
257
|
+
const innerMinutes = value ? Math.floor((value % (60 * 60 * 1000)) / (60 * 1000)) : 0;
|
|
258
|
+
if (realTime.value) {
|
|
259
|
+
const t = {
|
|
260
|
+
startDay: realTime.value.startDay,
|
|
261
|
+
startHour: realTime.value.startHour,
|
|
262
|
+
startMinute: realTime.value.startMinute,
|
|
263
|
+
endDay: realTime.value.endDay,
|
|
264
|
+
endHour: innerHours,
|
|
265
|
+
endMinute: innerMinutes,
|
|
266
|
+
variant: realTime.value.variant
|
|
267
|
+
};
|
|
268
|
+
const newTime = applyOffset(t, true);
|
|
269
|
+
emit("update:modelValue", newTime);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
const onUpdateVariant = (value: DateType) => {
|
|
274
|
+
const t = applyOffset({
|
|
275
|
+
startDay: realTime.value.startDay,
|
|
276
|
+
startHour: realTime.value.startHour,
|
|
277
|
+
startMinute: realTime.value.startMinute,
|
|
278
|
+
endDay: realTime.value.endDay,
|
|
279
|
+
endHour: realTime.value.endHour,
|
|
280
|
+
endMinute: realTime.value.endMinute,
|
|
281
|
+
variant: value
|
|
282
|
+
}, true);
|
|
283
|
+
emit("update:modelValue", t );
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
return {
|
|
287
|
+
dateTypeItems,
|
|
288
|
+
validateOn,
|
|
289
|
+
daysItems,
|
|
290
|
+
ColorEnum,
|
|
291
|
+
startTime,
|
|
292
|
+
realTime,
|
|
293
|
+
messages,
|
|
294
|
+
DateType,
|
|
295
|
+
endTime,
|
|
296
|
+
onChangeHourStart,
|
|
297
|
+
onChangeDayStart,
|
|
298
|
+
onChangeHourEnd,
|
|
299
|
+
onUpdateVariant,
|
|
300
|
+
onChangeDayEnd
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
</script>
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
<script lang="ts">
|
|
56
56
|
import { computed, defineComponent, type PropType } from "vue";
|
|
57
57
|
|
|
58
|
-
import type { TimeUnit } from "@dative-gpi/foundation-shared-domain/
|
|
58
|
+
import type { TimeUnit } from "@dative-gpi/foundation-shared-domain/enums";
|
|
59
59
|
|
|
60
60
|
import { useRules, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
61
61
|
import { timeSteps } from "@dative-gpi/foundation-shared-components/utils";
|
|
@@ -131,14 +131,14 @@ export default defineComponent({
|
|
|
131
131
|
return Object.keys(slots).filter(k => k.startsWith("number-")).reduce((acc, key) => {
|
|
132
132
|
acc[key.substring("number-".length)] = slots[key];
|
|
133
133
|
return acc;
|
|
134
|
-
}, {});
|
|
134
|
+
}, {} as {[index: string]: any});
|
|
135
135
|
});
|
|
136
136
|
|
|
137
137
|
const selectSlots = computed((): any => {
|
|
138
138
|
return Object.keys(slots).filter(k => k.startsWith("select-")).reduce((acc, key) => {
|
|
139
139
|
acc[key.substring("select-".length)] = slots[key];
|
|
140
140
|
return acc;
|
|
141
|
-
}, {});
|
|
141
|
+
}, {} as {[index: string]: any});
|
|
142
142
|
});
|
|
143
143
|
|
|
144
144
|
const messages = computed((): string[] => props.messages ?? getMessages(props.modelValue, props.rules));
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
</template>
|
|
32
32
|
</FSTextField>
|
|
33
33
|
<FSDialogSubmit
|
|
34
|
-
:title="$tr('
|
|
34
|
+
:title="$tr('translate-field.title', 'Handle translations')"
|
|
35
35
|
:submitButtonColor="$props.buttonColor"
|
|
36
36
|
@click:submitButton="onSubmit"
|
|
37
37
|
v-model="dialog"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
gap="32px"
|
|
44
44
|
>
|
|
45
45
|
<FSTextField
|
|
46
|
-
:label="$tr('ui.
|
|
46
|
+
:label="$tr('ui.common.default-value', 'Default value')"
|
|
47
47
|
:editable="false"
|
|
48
48
|
:modelValue="$props.modelValue"
|
|
49
49
|
/>
|
|
@@ -62,13 +62,14 @@
|
|
|
62
62
|
>
|
|
63
63
|
<FSRow
|
|
64
64
|
:wrap="false"
|
|
65
|
+
align="center-left"
|
|
65
66
|
>
|
|
66
67
|
<FSSpan
|
|
67
68
|
class="fs-translate-field-label"
|
|
68
69
|
font="text-overline"
|
|
69
70
|
:style="style"
|
|
70
71
|
>
|
|
71
|
-
{{ $tr("
|
|
72
|
+
{{ $tr("translate-field.translate-in", "Translate in {0}", language.label) }}
|
|
72
73
|
</FSSpan>
|
|
73
74
|
<FSIcon>
|
|
74
75
|
{{ language.icon }}
|