@dative-gpi/foundation-shared-components 1.0.35 → 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
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
>
|
|
8
8
|
<FSRichTextField
|
|
9
9
|
:editable="false"
|
|
10
|
-
:label="$tr('ui.
|
|
10
|
+
:label="$tr('ui.common.default-value', 'Default value')"
|
|
11
11
|
:modelValue="$props.modelValue"
|
|
12
12
|
v-bind="$attrs"
|
|
13
13
|
/>
|
|
@@ -24,12 +24,13 @@
|
|
|
24
24
|
>
|
|
25
25
|
<FSRow
|
|
26
26
|
:wrap="false"
|
|
27
|
+
align="center-left"
|
|
27
28
|
>
|
|
28
29
|
<FSSpan
|
|
29
30
|
class="fs-translate-field-label"
|
|
30
31
|
font="text-overline"
|
|
31
32
|
>
|
|
32
|
-
{{ $tr('
|
|
33
|
+
{{ $tr('translate-rich-text-field.translate-in', 'Translate in {0}', language.label) }}
|
|
33
34
|
</FSSpan>
|
|
34
35
|
<FSIcon>{{ language.icon }}</FSIcon>
|
|
35
36
|
</FSRow>
|
|
@@ -39,10 +40,9 @@
|
|
|
39
40
|
<FSRow
|
|
40
41
|
:wrap="false"
|
|
41
42
|
>
|
|
42
|
-
<
|
|
43
|
+
<FSButtonCancelLabel
|
|
43
44
|
prependIcon="mdi-cancel"
|
|
44
45
|
width="100%"
|
|
45
|
-
:label="$tr('ui.translateRichTextField.cancelButton.label', 'Cancel')"
|
|
46
46
|
@click="onCancelTranslations"
|
|
47
47
|
/>
|
|
48
48
|
<FSButton
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
prependIcon="mdi-check"
|
|
51
51
|
color="primary"
|
|
52
52
|
width="100%"
|
|
53
|
-
:label="$tr('
|
|
53
|
+
:label="$tr('translate-rich-text-field.validate', 'Validate translations')"
|
|
54
54
|
@click="onSubmitTranslations"
|
|
55
55
|
/>
|
|
56
56
|
</FSRow>
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
prependIcon="mdi-translate"
|
|
70
70
|
color="primary"
|
|
71
71
|
width="100%"
|
|
72
|
-
:label="$tr('
|
|
72
|
+
:label="$tr('translate-rich-text-field.manage-translations', 'Manage translations')"
|
|
73
73
|
@click="() => $emit('update:translationsExpanded', true)"
|
|
74
74
|
/>
|
|
75
75
|
</template>
|
|
@@ -77,12 +77,13 @@
|
|
|
77
77
|
</template>
|
|
78
78
|
|
|
79
79
|
<script lang="ts">
|
|
80
|
-
import { defineComponent, type PropType, ref } from 'vue';
|
|
80
|
+
import { defineComponent, type PropType, ref, watch } from 'vue';
|
|
81
81
|
|
|
82
82
|
import { useAppLanguages } from "@dative-gpi/foundation-shared-services/composables";
|
|
83
83
|
|
|
84
84
|
import { emptyLexicalState } from '../../utils';
|
|
85
85
|
|
|
86
|
+
import FSButtonCancelLabel from '../buttons/FSButtonCancelLabel.vue';
|
|
86
87
|
import FSRichTextField from './FSRichTextField.vue';
|
|
87
88
|
import FSButton from '../FSButton.vue';
|
|
88
89
|
import FSIcon from '../FSIcon.vue';
|
|
@@ -93,6 +94,7 @@ import FSRow from '../FSRow.vue';
|
|
|
93
94
|
export default defineComponent({
|
|
94
95
|
name: 'FSTranslateRichTextField',
|
|
95
96
|
components: {
|
|
97
|
+
FSButtonCancelLabel,
|
|
96
98
|
FSRichTextField,
|
|
97
99
|
FSButton,
|
|
98
100
|
FSIcon,
|
|
@@ -110,12 +112,15 @@ export default defineComponent({
|
|
|
110
112
|
default: true,
|
|
111
113
|
},
|
|
112
114
|
modelValue: {
|
|
113
|
-
type: String as PropType<string | null>,
|
|
115
|
+
type: [Object, String] as PropType<{ [key: string]: any } | string | null>,
|
|
114
116
|
required: false,
|
|
115
117
|
default: null
|
|
116
118
|
},
|
|
117
119
|
translations: {
|
|
118
|
-
type: Array as PropType<{
|
|
120
|
+
type: Array as PropType<{
|
|
121
|
+
languageCode: string;
|
|
122
|
+
[key: string]: string | object | null;
|
|
123
|
+
}[]>,
|
|
119
124
|
required: false,
|
|
120
125
|
default: () => []
|
|
121
126
|
},
|
|
@@ -129,9 +134,12 @@ export default defineComponent({
|
|
|
129
134
|
setup(props, { emit }) {
|
|
130
135
|
const { languages } = useAppLanguages();
|
|
131
136
|
|
|
132
|
-
const innerTranslations = ref
|
|
137
|
+
const innerTranslations = ref<{
|
|
138
|
+
languageCode: string;
|
|
139
|
+
[key: string]: string | object | null;
|
|
140
|
+
}[]>([]);
|
|
133
141
|
|
|
134
|
-
const getTranslation = (languageCode: string): string => {
|
|
142
|
+
const getTranslation = (languageCode: string): string | object => {
|
|
135
143
|
if (!innerTranslations.value) {
|
|
136
144
|
return emptyLexicalState;
|
|
137
145
|
}
|
|
@@ -139,7 +147,7 @@ export default defineComponent({
|
|
|
139
147
|
if (!translation || !translation[props.property]) {
|
|
140
148
|
return emptyLexicalState;
|
|
141
149
|
}
|
|
142
|
-
return translation[props.property]
|
|
150
|
+
return translation[props.property]!;
|
|
143
151
|
};
|
|
144
152
|
|
|
145
153
|
const setTranslation = (languageCode: string, value: string): void => {
|
|
@@ -173,6 +181,18 @@ export default defineComponent({
|
|
|
173
181
|
emit('update:translationsExpanded', false);
|
|
174
182
|
};
|
|
175
183
|
|
|
184
|
+
watch(() => props.translations, (newTranslations) => {
|
|
185
|
+
innerTranslations.value = newTranslations.map((translation) => {
|
|
186
|
+
if(typeof translation[props.property] === 'string'){
|
|
187
|
+
return translation;
|
|
188
|
+
}
|
|
189
|
+
return {
|
|
190
|
+
...translation,
|
|
191
|
+
[props.property]: JSON.stringify(translation[props.property])
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}, { immediate: true, deep: true });
|
|
195
|
+
|
|
176
196
|
return {
|
|
177
197
|
languages,
|
|
178
198
|
onCancelTranslations,
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSTextArea
|
|
3
|
+
:editable="$props.editable"
|
|
4
|
+
:modelValue="$props.modelValue"
|
|
5
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
6
|
+
v-bind="$attrs"
|
|
7
|
+
>
|
|
8
|
+
<template
|
|
9
|
+
v-for="(_, name) in $slots"
|
|
10
|
+
v-slot:[name]="slotData"
|
|
11
|
+
>
|
|
12
|
+
<slot
|
|
13
|
+
:name="name"
|
|
14
|
+
v-bind="slotData"
|
|
15
|
+
/>
|
|
16
|
+
</template>
|
|
17
|
+
<template
|
|
18
|
+
#append
|
|
19
|
+
>
|
|
20
|
+
<FSButton
|
|
21
|
+
height="100%"
|
|
22
|
+
style=""
|
|
23
|
+
:prependIcon="$props.buttonPrependIcon"
|
|
24
|
+
:appendIcon="$props.buttonAppendIcon"
|
|
25
|
+
:variant="$props.buttonVariant"
|
|
26
|
+
:color="$props.buttonColor"
|
|
27
|
+
@click="dialog = true"
|
|
28
|
+
/>
|
|
29
|
+
<slot
|
|
30
|
+
name="append"
|
|
31
|
+
/>
|
|
32
|
+
</template>
|
|
33
|
+
</FSTextArea>
|
|
34
|
+
<FSDialogSubmit
|
|
35
|
+
:title="$tr('translate-text-area.title', 'Handle translations')"
|
|
36
|
+
:submitButtonColor="$props.buttonColor"
|
|
37
|
+
@click:submitButton="onSubmit"
|
|
38
|
+
v-model="dialog"
|
|
39
|
+
>
|
|
40
|
+
<template
|
|
41
|
+
#body
|
|
42
|
+
>
|
|
43
|
+
<FSCol
|
|
44
|
+
gap="32px"
|
|
45
|
+
>
|
|
46
|
+
<FSTextArea
|
|
47
|
+
:label="$tr('ui.common.default-value', 'Default value')"
|
|
48
|
+
:editable="false"
|
|
49
|
+
:rows="($attrs.rows as number)"
|
|
50
|
+
:modelValue="$props.modelValue"
|
|
51
|
+
/>
|
|
52
|
+
<FSCol
|
|
53
|
+
gap="20px"
|
|
54
|
+
>
|
|
55
|
+
<FSTextArea
|
|
56
|
+
v-for="(language, index) in languages"
|
|
57
|
+
:editable="$props.editable"
|
|
58
|
+
:key="index"
|
|
59
|
+
:modelValue="getTranslation(language.code)"
|
|
60
|
+
:rows="($attrs.rows as number)"
|
|
61
|
+
@update:modelValue="setTranslation(language.code, $event)"
|
|
62
|
+
>
|
|
63
|
+
<template
|
|
64
|
+
#label
|
|
65
|
+
>
|
|
66
|
+
<FSRow
|
|
67
|
+
:wrap="false"
|
|
68
|
+
align="center-left"
|
|
69
|
+
>
|
|
70
|
+
<FSSpan
|
|
71
|
+
font="text-overline"
|
|
72
|
+
:style="style"
|
|
73
|
+
>
|
|
74
|
+
{{ $tr("translate-field.translate-in", "Translate in {0}", language.label) }}
|
|
75
|
+
</FSSpan>
|
|
76
|
+
<FSIcon>
|
|
77
|
+
{{ language.icon }}
|
|
78
|
+
</FSIcon>
|
|
79
|
+
</FSRow>
|
|
80
|
+
</template>
|
|
81
|
+
</FSTextArea>
|
|
82
|
+
</FSCol>
|
|
83
|
+
</FSCol>
|
|
84
|
+
</template>
|
|
85
|
+
</FSDialogSubmit>
|
|
86
|
+
</template>
|
|
87
|
+
|
|
88
|
+
<script lang="ts">
|
|
89
|
+
import { computed, defineComponent, type PropType, ref, type StyleValue } from "vue";
|
|
90
|
+
|
|
91
|
+
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
92
|
+
import { useAppLanguages } from "@dative-gpi/foundation-shared-services/composables";
|
|
93
|
+
|
|
94
|
+
import { useColors } from "../../composables";
|
|
95
|
+
|
|
96
|
+
import FSDialogSubmit from "../FSDialogSubmit.vue";
|
|
97
|
+
import FSTextArea from "./FSTextArea.vue";
|
|
98
|
+
import FSButton from "../FSButton.vue";
|
|
99
|
+
import FSIcon from "../FSIcon.vue";
|
|
100
|
+
import FSSpan from "../FSSpan.vue";
|
|
101
|
+
import FSRow from "../FSRow.vue";
|
|
102
|
+
|
|
103
|
+
export default defineComponent({
|
|
104
|
+
name: "FSTranslateTextArea",
|
|
105
|
+
components: {
|
|
106
|
+
FSDialogSubmit,
|
|
107
|
+
FSTextArea,
|
|
108
|
+
FSButton,
|
|
109
|
+
FSIcon,
|
|
110
|
+
FSSpan,
|
|
111
|
+
FSRow
|
|
112
|
+
},
|
|
113
|
+
props: {
|
|
114
|
+
buttonPrependIcon: {
|
|
115
|
+
type: String as PropType<string | null>,
|
|
116
|
+
required: false,
|
|
117
|
+
default: "mdi-translate"
|
|
118
|
+
},
|
|
119
|
+
buttonLabel: {
|
|
120
|
+
type: String as PropType<string | null>,
|
|
121
|
+
required: false,
|
|
122
|
+
default: null
|
|
123
|
+
},
|
|
124
|
+
buttonAppendIcon: {
|
|
125
|
+
type: String as PropType<string | null>,
|
|
126
|
+
required: false,
|
|
127
|
+
default: null
|
|
128
|
+
},
|
|
129
|
+
buttonVariant: {
|
|
130
|
+
type: String as PropType<"standard" | "full" | "icon">,
|
|
131
|
+
required: false,
|
|
132
|
+
default: "standard"
|
|
133
|
+
},
|
|
134
|
+
modelValue: {
|
|
135
|
+
type: String as PropType<string | null>,
|
|
136
|
+
required: false,
|
|
137
|
+
default: null
|
|
138
|
+
},
|
|
139
|
+
property: {
|
|
140
|
+
type: String as PropType<string>,
|
|
141
|
+
required: false,
|
|
142
|
+
default: "label"
|
|
143
|
+
},
|
|
144
|
+
translations: {
|
|
145
|
+
type: Array as PropType<{ languageCode: string; [key: string]: string }[]>,
|
|
146
|
+
required: false,
|
|
147
|
+
default: () => []
|
|
148
|
+
},
|
|
149
|
+
buttonColor: {
|
|
150
|
+
type: String as PropType<ColorBase>,
|
|
151
|
+
required: false,
|
|
152
|
+
default: ColorEnum.Primary
|
|
153
|
+
},
|
|
154
|
+
editable: {
|
|
155
|
+
type: Boolean,
|
|
156
|
+
required: false,
|
|
157
|
+
default: true
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
emits: ["update:modelValue", "update:translations"],
|
|
161
|
+
setup(props, { emit }) {
|
|
162
|
+
const { languages } = useAppLanguages();
|
|
163
|
+
const { getColors } = useColors();
|
|
164
|
+
|
|
165
|
+
const dialog = ref(false);
|
|
166
|
+
|
|
167
|
+
const innerTranslations = ref(props.translations);
|
|
168
|
+
|
|
169
|
+
const lights = getColors(ColorEnum.Light);
|
|
170
|
+
const darks = getColors(ColorEnum.Dark);
|
|
171
|
+
|
|
172
|
+
const style = computed((): StyleValue => {
|
|
173
|
+
if (!props.editable) {
|
|
174
|
+
return {
|
|
175
|
+
"--fs-translate-field-color": lights.dark
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
"--fs-translate-field-color": darks.base
|
|
180
|
+
};
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
const getTranslation = (languageCode: string): string => {
|
|
184
|
+
if (!innerTranslations.value) {
|
|
185
|
+
return "";
|
|
186
|
+
}
|
|
187
|
+
const translation = innerTranslations.value.find((t) => t.languageCode === languageCode);
|
|
188
|
+
if (!translation || !translation[props.property]) {
|
|
189
|
+
return "";
|
|
190
|
+
}
|
|
191
|
+
return translation[props.property];
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
const setTranslation = (languageCode: string, value: string): void => {
|
|
195
|
+
if (!innerTranslations.value) {
|
|
196
|
+
innerTranslations.value = [{
|
|
197
|
+
languageCode,
|
|
198
|
+
[props.property]: value
|
|
199
|
+
}]
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
const translation = innerTranslations.value.find((t) => t.languageCode === languageCode);
|
|
203
|
+
if (translation) {
|
|
204
|
+
translation[props.property] = value;
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
innerTranslations.value.push({
|
|
208
|
+
languageCode,
|
|
209
|
+
[props.property]: value
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
const onSubmit = (): void => {
|
|
215
|
+
dialog.value = false;
|
|
216
|
+
if (props.editable) {
|
|
217
|
+
emit("update:translations", innerTranslations.value);
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
return {
|
|
222
|
+
innerTranslations,
|
|
223
|
+
ColorEnum,
|
|
224
|
+
languages,
|
|
225
|
+
dialog,
|
|
226
|
+
style,
|
|
227
|
+
getTranslation,
|
|
228
|
+
setTranslation,
|
|
229
|
+
onSubmit
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
</script>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<FSSpan
|
|
15
15
|
:font="font"
|
|
16
16
|
>
|
|
17
|
-
{{ $tr('ui.
|
|
17
|
+
{{ $tr('ui.common.every', 'Every') }}
|
|
18
18
|
</FSSpan>
|
|
19
19
|
<FSNumberField
|
|
20
20
|
:editable="$props.editable"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
<FSSpan
|
|
27
27
|
:font="font"
|
|
28
28
|
>
|
|
29
|
-
{{ $tr('
|
|
29
|
+
{{ $tr('periodic-field.daysat', 'day(s) at') }}
|
|
30
30
|
</FSSpan>
|
|
31
31
|
<FSClock
|
|
32
32
|
:editable="$props.editable"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
</template>
|
|
47
47
|
|
|
48
48
|
<script lang="ts">
|
|
49
|
-
import { ref, defineComponent,
|
|
49
|
+
import { ref, defineComponent, type PropType, watch } from "vue";
|
|
50
50
|
|
|
51
51
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui";
|
|
52
52
|
|
|
@@ -71,7 +71,7 @@ export default defineComponent({
|
|
|
71
71
|
},
|
|
72
72
|
props: {
|
|
73
73
|
modelValue: {
|
|
74
|
-
type: String as PropType<
|
|
74
|
+
type: String as PropType<string>,
|
|
75
75
|
required: true
|
|
76
76
|
},
|
|
77
77
|
editable: {
|
|
@@ -85,10 +85,10 @@ export default defineComponent({
|
|
|
85
85
|
const { $tr } = useTranslationsProvider();
|
|
86
86
|
|
|
87
87
|
const availablePeriod = [
|
|
88
|
-
{ label: $tr("ui.
|
|
89
|
-
{ label: $tr("ui.
|
|
90
|
-
{ label: $tr("ui.
|
|
91
|
-
{ label: $tr("ui.
|
|
88
|
+
{ label: $tr("ui.common.daily", "Daily") , value: "daily" , item: { default : "0 12 */1 * *"} },
|
|
89
|
+
{ label: $tr("ui.common.weekly", "Weekly") , value: "weekly" , item: { default : "0 12 * * 1"} },
|
|
90
|
+
{ label: $tr("ui.common.monthly", "Monthly"), value: "monthly", item: { default : "0 12 1 * *"} },
|
|
91
|
+
{ label: $tr("ui.common.yearly", "Yearly") , value: "yearly" , item: { default : "0 12 1 1 *"} }
|
|
92
92
|
];
|
|
93
93
|
|
|
94
94
|
const selectedPeriod = ref("daily");
|
|
@@ -118,9 +118,9 @@ export default defineComponent({
|
|
|
118
118
|
emit('update:modelValue', period.item.default);
|
|
119
119
|
});
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
watch(() => props.modelValue, () => {
|
|
122
122
|
selectedPeriod.value = getPeriod(props.modelValue);
|
|
123
|
-
});
|
|
123
|
+
}, { immediate: true });
|
|
124
124
|
|
|
125
125
|
return {
|
|
126
126
|
availablePeriod,
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<FSSpan
|
|
15
15
|
:font="font"
|
|
16
16
|
>
|
|
17
|
-
{{ $tr("ui.
|
|
17
|
+
{{ $tr("ui.common.day", "Day") }}
|
|
18
18
|
</FSSpan>
|
|
19
19
|
<FSSelectField
|
|
20
20
|
:editable="$props.editable"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<FSSpan
|
|
28
28
|
:font="font"
|
|
29
29
|
>
|
|
30
|
-
{{ $tr("
|
|
30
|
+
{{ $tr("periodic-monthly-field.every-month-at", "every month at") }}
|
|
31
31
|
</FSSpan>
|
|
32
32
|
<FSClock
|
|
33
33
|
:editable="$props.editable"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
<FSSpan
|
|
46
46
|
:font="font"
|
|
47
47
|
>
|
|
48
|
-
{{ $tr("ui.
|
|
48
|
+
{{ $tr("ui.common.every", "Every") }}
|
|
49
49
|
</FSSpan>
|
|
50
50
|
<FSSelectField
|
|
51
51
|
:editable="$props.editable"
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
<FSSpan
|
|
66
66
|
:font="font"
|
|
67
67
|
>
|
|
68
|
-
{{ $tr("ui.
|
|
68
|
+
{{ $tr("ui.common.at", "at") }}
|
|
69
69
|
</FSSpan>
|
|
70
70
|
<FSClock
|
|
71
71
|
:editable="$props.editable"
|
|
@@ -119,10 +119,10 @@ export default defineComponent({
|
|
|
119
119
|
const { $tr } = useTranslationsProvider();
|
|
120
120
|
|
|
121
121
|
const dayWeekNumbers = [
|
|
122
|
-
{ id: 1, label: $tr("ui.
|
|
123
|
-
{ id: 2, label: $tr("ui.
|
|
124
|
-
{ id: 3, label: $tr("ui.
|
|
125
|
-
{ id: 4, label: $tr("ui.
|
|
122
|
+
{ id: 1, label: $tr("ui.common.first" , "First") },
|
|
123
|
+
{ id: 2, label: $tr("ui.common.second", "Second") },
|
|
124
|
+
{ id: 3, label: $tr("ui.common.third" , "Third") },
|
|
125
|
+
{ id: 4, label: $tr("ui.common.fourth", "Fourth") },
|
|
126
126
|
];
|
|
127
127
|
|
|
128
128
|
const availableConfigurations = [
|
|
@@ -14,19 +14,22 @@
|
|
|
14
14
|
<FSSpan
|
|
15
15
|
:font="font"
|
|
16
16
|
>
|
|
17
|
-
{{ $tr("ui.
|
|
17
|
+
{{ $tr("ui.common.every", "Every") }}
|
|
18
18
|
</FSSpan>
|
|
19
19
|
<FSSelectDays
|
|
20
|
+
width="200px"
|
|
21
|
+
:placeholder="$tr('ui.common.selected-days', '{0} selected day(s)', days.length)"
|
|
20
22
|
:editable="$props.editable"
|
|
23
|
+
:multiple="true"
|
|
21
24
|
:useAllDays="false"
|
|
22
25
|
:hideHeader="true"
|
|
23
|
-
:modelValue="
|
|
26
|
+
:modelValue="days"
|
|
24
27
|
@update:modelValue="onUpdateDay($event)"
|
|
25
28
|
/>
|
|
26
29
|
<FSSpan
|
|
27
30
|
:font="font"
|
|
28
31
|
>
|
|
29
|
-
{{ $tr("ui.
|
|
32
|
+
{{ $tr("ui.common.at", "at") }}
|
|
30
33
|
</FSSpan>
|
|
31
34
|
<FSClock
|
|
32
35
|
:editable="$props.editable"
|
|
@@ -80,11 +83,13 @@ export default defineComponent({
|
|
|
80
83
|
|
|
81
84
|
const selectedConfiguration = ref("custom");
|
|
82
85
|
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
return
|
|
86
|
+
const days = computed((): number[] => {
|
|
87
|
+
try {
|
|
88
|
+
return props.modelValue[4].split(",").map((day) => parseInt(day) - 1);
|
|
89
|
+
} catch (error) {
|
|
90
|
+
console.error("Error parsing days:", error);
|
|
91
|
+
return [];
|
|
86
92
|
}
|
|
87
|
-
return parseInt(props.modelValue[4]) - 1;
|
|
88
93
|
});
|
|
89
94
|
|
|
90
95
|
const time = computed((): number => {
|
|
@@ -94,16 +99,21 @@ export default defineComponent({
|
|
|
94
99
|
return ((parseInt(props.modelValue[0])) + (parseInt(props.modelValue[1]) * 60)) * 60 * 1000;
|
|
95
100
|
});
|
|
96
101
|
|
|
97
|
-
const onUpdateDay = (value: number): void => {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
102
|
+
const onUpdateDay = (value: number[]): void => {
|
|
103
|
+
if(value.length === 0) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
const hours = Math.floor(time.value / (60 * 60 * 1000));
|
|
107
|
+
const minutes = Math.floor(time.value / (60 * 1000) % 60);
|
|
108
|
+
const daysCron = value.map((day) => day + 1).join(",");
|
|
109
|
+
emit("update:modelValue", [`${minutes}`, `${hours}`, `*`, `*`, `${daysCron}`]);
|
|
101
110
|
};
|
|
102
111
|
|
|
103
112
|
const onUpdateHours = (value: number): void => {
|
|
104
113
|
const hours = Math.floor(value / (60 * 60 * 1000));
|
|
105
114
|
const minutes = Math.floor(value / (60 * 1000) % 60);
|
|
106
|
-
|
|
115
|
+
const daysCron = days.value.map((day) => day + 1).join(",");
|
|
116
|
+
emit("update:modelValue", [`${minutes}`, `${hours}`, `*`, `*`, `${daysCron}`]);
|
|
107
117
|
};
|
|
108
118
|
|
|
109
119
|
return {
|
|
@@ -111,7 +121,7 @@ export default defineComponent({
|
|
|
111
121
|
selectedConfiguration,
|
|
112
122
|
ColorEnum,
|
|
113
123
|
time,
|
|
114
|
-
|
|
124
|
+
days,
|
|
115
125
|
onUpdateHours,
|
|
116
126
|
onUpdateDay
|
|
117
127
|
};
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<FSSpan
|
|
15
15
|
:font="font"
|
|
16
16
|
>
|
|
17
|
-
{{ $tr("ui.
|
|
17
|
+
{{ $tr("ui.common.every-year", "Every year") }}
|
|
18
18
|
</FSSpan>
|
|
19
19
|
<FSSelectMonths
|
|
20
20
|
:editable="$props.editable"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
<FSSpan
|
|
34
34
|
:font="font"
|
|
35
35
|
>
|
|
36
|
-
{{ $tr("ui.
|
|
36
|
+
{{ $tr("ui.common.at", "at") }}
|
|
37
37
|
</FSSpan>
|
|
38
38
|
<FSClock
|
|
39
39
|
:editable="$props.editable"
|
|
@@ -100,7 +100,7 @@ export default defineComponent({
|
|
|
100
100
|
if (isNaN(parseInt(props.modelValue[3]))) {
|
|
101
101
|
return 0;
|
|
102
102
|
}
|
|
103
|
-
return parseInt(props.modelValue[3])
|
|
103
|
+
return parseInt(props.modelValue[3]);
|
|
104
104
|
});
|
|
105
105
|
|
|
106
106
|
const time = computed((): number => {
|
|
@@ -113,19 +113,19 @@ export default defineComponent({
|
|
|
113
113
|
const onUpdateDay = (value: number): void => {
|
|
114
114
|
const hours = Math.floor(value / (60 * 60 * 1000));
|
|
115
115
|
const minutes = Math.floor(value / (60 * 1000) % 60);
|
|
116
|
-
emit("update:modelValue", [`${minutes}`, `${hours}`, `${value}`, `${month.value
|
|
116
|
+
emit("update:modelValue", [`${minutes}`, `${hours}`, `${value}`, `${month.value}`, "*"]);
|
|
117
117
|
};
|
|
118
118
|
|
|
119
119
|
const onUpdateHours = (value: number): void => {
|
|
120
120
|
const hours = Math.floor(value / (60 * 60 * 1000));
|
|
121
121
|
const minutes = Math.floor(value / (60 * 1000) % 60);
|
|
122
|
-
emit("update:modelValue", [`${minutes}`, `${hours}`, `${day.value}`, `${month.value
|
|
122
|
+
emit("update:modelValue", [`${minutes}`, `${hours}`, `${day.value}`, `${month.value}`, "*"]);
|
|
123
123
|
};
|
|
124
124
|
|
|
125
125
|
const onUpdateMonth = (value: number): void => {
|
|
126
126
|
const hours = Math.floor(value / (60 * 60 * 1000));
|
|
127
127
|
const minutes = Math.floor(value / (60 * 1000) % 60);
|
|
128
|
-
emit("update:modelValue", [`${minutes}`, `${hours}`, `${day.value}`, `${value
|
|
128
|
+
emit("update:modelValue", [`${minutes}`, `${hours}`, `${day.value}`, `${value}`, "*"]);
|
|
129
129
|
};
|
|
130
130
|
|
|
131
131
|
return {
|