@dative-gpi/foundation-shared-components 1.0.27 → 1.0.28-remove-deprecated2
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 +1 -0
- 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 +20 -12
- 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 +51 -32
- package/components/FSDialogMultiFormBody.vue +79 -56
- package/components/FSDialogRemove.vue +7 -7
- package/components/FSDialogSubmit.vue +20 -11
- package/components/FSEditImage.vue +1 -1
- package/components/FSEditImageUI.vue +20 -10
- package/components/FSFadeOut.vue +44 -18
- package/components/FSForm.vue +10 -8
- package/components/FSGrid.vue +1 -1
- package/components/FSIcon.vue +2 -1
- package/components/FSIconCard.vue +21 -4
- package/components/FSImage.vue +12 -4
- package/components/FSImageUI.vue +8 -15
- package/components/FSLink.vue +25 -9
- package/components/FSLoader.vue +28 -11
- package/components/FSOptionGroup.vue +51 -3
- package/components/FSRouterLink.vue +42 -0
- package/components/FSSlideGroup.vue +19 -5
- package/components/FSSpan.vue +9 -2
- 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 +4 -2
- 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 +24 -39
- package/components/autocompletes/FSAutocompleteTimeZone.vue +26 -38
- 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 +28 -0
- package/components/buttons/FSButtonCopyIcon.vue +28 -0
- package/components/buttons/FSButtonCopyLabel.vue +27 -0
- package/components/buttons/FSButtonCopyMini.vue +28 -0
- 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 +516 -341
- package/components/fields/FSAutocompleteTag.vue +100 -0
- 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 +2 -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 +15 -7
- package/components/fields/FSMagicField.vue +9 -4
- package/components/fields/FSNumberField.vue +13 -6
- package/components/fields/FSRichTextField.vue +102 -52
- package/components/fields/FSSearchField.vue +9 -115
- package/components/fields/FSSelectField.vue +489 -252
- package/components/fields/FSTagField.vue +1 -1
- package/components/fields/FSTermField.vue +33 -11
- package/components/fields/FSTextArea.vue +26 -7
- package/components/fields/FSTextField.vue +19 -10
- 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 +15 -10
- package/components/fields/FSTranslateTextArea.vue +233 -0
- package/components/fields/FSTreeViewField.vue +3 -3
- package/components/fields/periodicField/FSPeriodicDailyField.vue +120 -0
- package/components/fields/periodicField/FSPeriodicField.vue +131 -0
- package/components/fields/periodicField/FSPeriodicMonthlyField.vue +222 -0
- package/components/fields/periodicField/FSPeriodicWeeklyField.vue +120 -0
- package/components/fields/periodicField/FSPeriodicYearlyField.vue +144 -0
- package/components/lists/FSDataTableUI.vue +148 -89
- package/components/lists/FSDraggable.vue +2 -2
- package/components/lists/FSFilterButton.vue +23 -28
- package/components/lists/FSHeaderButton.vue +4 -4
- package/components/lists/FSHiddenButton.vue +11 -15
- 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 +280 -399
- package/components/map/FSMapFeatureGroup.vue +51 -0
- package/components/map/FSMapLayerButton.vue +5 -5
- package/components/map/FSMapMarker.vue +120 -0
- package/components/map/FSMapMarkerClusterGroup.vue +72 -0
- package/components/map/FSMapOverlay.vue +70 -82
- package/components/map/FSMapPolygon.vue +81 -0
- package/components/map/FSMapTileLayer.vue +50 -0
- package/components/map/keys.ts +4 -0
- 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 +67 -0
- 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/FSChartTile.vue +73 -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 +134 -0
- package/components/views/desktop/FSBaseDesktopView.vue +53 -0
- package/components/views/desktop/FSBaseEntityDesktopView.vue +208 -0
- package/components/views/mobile/FSBaseDefaultMobileView.vue +132 -0
- package/components/views/mobile/FSBaseEntityMobileView.vue +198 -0
- package/components/views/mobile/FSBaseMobileView.vue +53 -0
- package/composables/useAddress.ts +2 -2
- package/composables/useBreakpoints.ts +39 -3
- package/composables/useColors.ts +3 -2
- package/composables/useMagicFieldProvider.ts +1 -0
- 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 +5 -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 +6 -12
- package/styles/components/fs_card.scss +0 -1
- package/styles/components/fs_clickable.scss +7 -14
- package/styles/components/fs_clock.scss +0 -10
- package/styles/components/fs_color_field.scss +1 -4
- package/styles/components/fs_data_table.scss +6 -9
- package/styles/components/fs_dialog.scss +7 -17
- package/styles/components/fs_edit_image.scss +8 -0
- package/styles/components/fs_fade_out.scss +11 -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 +1 -1
- package/styles/components/fs_magic_config_field.scss +1 -2
- package/styles/components/fs_map.scss +36 -30
- package/styles/components/fs_meta_field.scss +3 -5
- package/styles/components/fs_option_group.scss +15 -5
- 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 +0 -13
- package/styles/components/fs_slide_group.scss +7 -0
- package/styles/components/fs_span.scss +2 -1
- package/styles/components/fs_switch.scss +1 -0
- package/styles/components/fs_tabs.scss +10 -24
- package/styles/components/fs_tag.scss +3 -19
- 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 +5 -5
- package/styles/globals/index.scss +1 -5
- package/styles/globals/overrides.scss +17 -57
- package/styles/globals/text_fonts.scss +18 -66
- package/tools/alertsTools.ts +69 -0
- package/tools/chartsTools.ts +427 -0
- package/tools/index.ts +3 -0
- package/tools/timeRangeTools.ts +125 -0
- package/utils/filter.ts +18 -0
- package/utils/index.ts +1 -0
- package/utils/leafletMarkers.ts +9 -3
- package/utils/sort.ts +2 -2
- package/utils/statuses.ts +1 -1
- package/utils/time.ts +17 -17
- package/components/autocompletes/FSAutocompleteTag.vue +0 -138
- package/components/fields/FSTimeSlotField.vue +0 -250
- package/components/map/FSMapEditPointAddressOverlay.vue +0 -164
- 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_map_overlay.scss +0 -38
- 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>
|
|
@@ -83,6 +83,7 @@ import { useAppLanguages } from "@dative-gpi/foundation-shared-services/composab
|
|
|
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
|
},
|
|
@@ -131,7 +136,7 @@ export default defineComponent({
|
|
|
131
136
|
|
|
132
137
|
const innerTranslations = ref(props.translations);
|
|
133
138
|
|
|
134
|
-
const getTranslation = (languageCode: string): string => {
|
|
139
|
+
const getTranslation = (languageCode: string): string | object => {
|
|
135
140
|
if (!innerTranslations.value) {
|
|
136
141
|
return emptyLexicalState;
|
|
137
142
|
}
|
|
@@ -139,7 +144,7 @@ export default defineComponent({
|
|
|
139
144
|
if (!translation || !translation[props.property]) {
|
|
140
145
|
return emptyLexicalState;
|
|
141
146
|
}
|
|
142
|
-
return translation[props.property]
|
|
147
|
+
return translation[props.property]!;
|
|
143
148
|
};
|
|
144
149
|
|
|
145
150
|
const setTranslation = (languageCode: string, value: string): void => {
|
|
@@ -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>
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
#body
|
|
58
58
|
>
|
|
59
59
|
<FSFadeOut
|
|
60
|
-
:
|
|
60
|
+
:maxHeight="maxHeight"
|
|
61
61
|
>
|
|
62
62
|
<v-treeview
|
|
63
63
|
:itemTitle="$props.itemTitle"
|
|
@@ -381,7 +381,7 @@ export default defineComponent({
|
|
|
381
381
|
|
|
382
382
|
const messages = computed((): string[] => props.messages ?? getMessages(props.modelValue, props.rules));
|
|
383
383
|
|
|
384
|
-
const
|
|
384
|
+
const maxHeight = computed(() => {
|
|
385
385
|
const other = 8 + 8; // Paddings
|
|
386
386
|
return `calc(100vh - 40px - ${other}px)`;
|
|
387
387
|
});
|
|
@@ -501,11 +501,11 @@ export default defineComponent({
|
|
|
501
501
|
innerValue,
|
|
502
502
|
fieldSlots,
|
|
503
503
|
validateOn,
|
|
504
|
+
maxHeight,
|
|
504
505
|
menuSlots,
|
|
505
506
|
treeItems,
|
|
506
507
|
messages,
|
|
507
508
|
dialog,
|
|
508
|
-
height,
|
|
509
509
|
style,
|
|
510
510
|
menu,
|
|
511
511
|
openMobileOverlay,
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSRadioGroup
|
|
3
|
+
:values="availableConfigurations"
|
|
4
|
+
:editable="$props.editable"
|
|
5
|
+
v-model="selectedConfiguration"
|
|
6
|
+
>
|
|
7
|
+
<template
|
|
8
|
+
#label="{ item, font }"
|
|
9
|
+
>
|
|
10
|
+
<FSRow
|
|
11
|
+
v-if="item.value === 'custom'"
|
|
12
|
+
align="center-left"
|
|
13
|
+
>
|
|
14
|
+
<FSSpan
|
|
15
|
+
:font="font"
|
|
16
|
+
>
|
|
17
|
+
{{ $tr('ui.common.every', 'Every') }}
|
|
18
|
+
</FSSpan>
|
|
19
|
+
<FSNumberField
|
|
20
|
+
:editable="$props.editable"
|
|
21
|
+
:modelValue="days"
|
|
22
|
+
:hideHeader="true"
|
|
23
|
+
:clearable="false"
|
|
24
|
+
@update:modelValue="onUpdateDays($event)"
|
|
25
|
+
/>
|
|
26
|
+
<FSSpan
|
|
27
|
+
:font="font"
|
|
28
|
+
>
|
|
29
|
+
{{ $tr('periodic-field.daysat', 'day(s) at') }}
|
|
30
|
+
</FSSpan>
|
|
31
|
+
<FSClock
|
|
32
|
+
:editable="$props.editable"
|
|
33
|
+
:color="ColorEnum.Light"
|
|
34
|
+
:modelValue="time"
|
|
35
|
+
:hideHeader="true"
|
|
36
|
+
:slider="false"
|
|
37
|
+
@update:modelValue="onUpdateHours($event)"
|
|
38
|
+
/>
|
|
39
|
+
</FSRow>
|
|
40
|
+
</template>
|
|
41
|
+
</FSRadioGroup>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<script lang="ts">
|
|
45
|
+
import { ref, defineComponent, computed } from "vue";
|
|
46
|
+
|
|
47
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
48
|
+
|
|
49
|
+
import FSRadioGroup from "../../FSRadioGroup.vue";
|
|
50
|
+
import FSNumberField from "../FSNumberField.vue";
|
|
51
|
+
import FSClock from "../../FSClock.vue";
|
|
52
|
+
import FSSpan from "../../FSSpan.vue";
|
|
53
|
+
import FSRow from "../../FSRow.vue";
|
|
54
|
+
|
|
55
|
+
export default defineComponent({
|
|
56
|
+
name: "FSPeriodicDailyField",
|
|
57
|
+
components: {
|
|
58
|
+
FSNumberField,
|
|
59
|
+
FSRadioGroup,
|
|
60
|
+
FSClock,
|
|
61
|
+
FSSpan,
|
|
62
|
+
FSRow
|
|
63
|
+
},
|
|
64
|
+
props: {
|
|
65
|
+
modelValue: {
|
|
66
|
+
type: Array<string>,
|
|
67
|
+
required: true
|
|
68
|
+
},
|
|
69
|
+
editable: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
required: false,
|
|
72
|
+
default: true
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
emits: ["update:modelValue"],
|
|
76
|
+
setup(props, { emit }) {
|
|
77
|
+
const availableConfigurations = [
|
|
78
|
+
{ value: "custom", item: { value: "custom" } }
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
const selectedConfiguration = ref("custom");
|
|
82
|
+
|
|
83
|
+
const days = computed((): number => {
|
|
84
|
+
if (isNaN(parseInt(props.modelValue[2].replace("*/", "")))) {
|
|
85
|
+
return 0
|
|
86
|
+
}
|
|
87
|
+
return parseInt(props.modelValue[2].replace("*/", ""));
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
const time = computed((): number => {
|
|
91
|
+
if (isNaN(parseInt(props.modelValue[0])) || isNaN(parseInt(props.modelValue[1]))) {
|
|
92
|
+
return 0;
|
|
93
|
+
}
|
|
94
|
+
return ((parseInt(props.modelValue[0])) + (parseInt(props.modelValue[1]) * 60)) * 60 * 1000;
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const onUpdateDays = (value: number): void => {
|
|
98
|
+
const hours = Math.floor(value / (60 * 60 * 1000));
|
|
99
|
+
const minutes = Math.floor(value / (60 * 1000) % 60);
|
|
100
|
+
emit("update:modelValue", [`${minutes}`, `${hours}`, `*/${value}`, "*", "*"]);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const onUpdateHours = (value: number): void => {
|
|
104
|
+
const hours = Math.floor(value / (60 * 60 * 1000));
|
|
105
|
+
const minutes = Math.floor(value / (60 * 1000) % 60);
|
|
106
|
+
emit("update:modelValue", [`${minutes}`, `${hours}`, `*/${days.value}`, "*", "*"]);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
return {
|
|
110
|
+
availableConfigurations,
|
|
111
|
+
selectedConfiguration,
|
|
112
|
+
ColorEnum,
|
|
113
|
+
days,
|
|
114
|
+
time,
|
|
115
|
+
onUpdateHours,
|
|
116
|
+
onUpdateDays
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
</script>
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSRow
|
|
3
|
+
gap="12px"
|
|
4
|
+
:wrap="false"
|
|
5
|
+
>
|
|
6
|
+
<FSRadioGroup
|
|
7
|
+
:values="availablePeriod"
|
|
8
|
+
:editable="editable"
|
|
9
|
+
v-model="selectedPeriod"
|
|
10
|
+
/>
|
|
11
|
+
<FSRow
|
|
12
|
+
align="center-left"
|
|
13
|
+
height="fill"
|
|
14
|
+
gap="12px"
|
|
15
|
+
:wrap="false"
|
|
16
|
+
>
|
|
17
|
+
<FSDivider
|
|
18
|
+
:vertical="true"
|
|
19
|
+
/>
|
|
20
|
+
<FSPeriodicDailyField
|
|
21
|
+
v-if="selectedPeriod === 'daily'"
|
|
22
|
+
:editable="editable"
|
|
23
|
+
:modelValue="$props.modelValue.split(' ')"
|
|
24
|
+
@update:modelValue="$emit('update:modelValue', $event.join(' '))"
|
|
25
|
+
/>
|
|
26
|
+
<FSPeriodicWeeklyField
|
|
27
|
+
v-else-if="selectedPeriod === 'weekly'"
|
|
28
|
+
:editable="editable"
|
|
29
|
+
:modelValue="$props.modelValue.split(' ')"
|
|
30
|
+
@update:modelValue="$emit('update:modelValue', $event.join(' '))"
|
|
31
|
+
/>
|
|
32
|
+
<FSPeriodicMonthlyField
|
|
33
|
+
v-else-if="selectedPeriod === 'monthly'"
|
|
34
|
+
:editable="editable"
|
|
35
|
+
:modelValue="$props.modelValue.split(' ')"
|
|
36
|
+
@update:modelValue="$emit('update:modelValue', $event.join(' '))"
|
|
37
|
+
/>
|
|
38
|
+
<FSPeriodicYearlyField
|
|
39
|
+
v-else-if="selectedPeriod === 'yearly'"
|
|
40
|
+
:editable="editable"
|
|
41
|
+
:modelValue="$props.modelValue.split(' ')"
|
|
42
|
+
@update:modelValue="$emit('update:modelValue', $event.join(' '))"
|
|
43
|
+
/>
|
|
44
|
+
</FSRow>
|
|
45
|
+
</FSRow>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script lang="ts">
|
|
49
|
+
import { ref, defineComponent, type PropType, watch } from "vue";
|
|
50
|
+
|
|
51
|
+
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui";
|
|
52
|
+
|
|
53
|
+
import FSPeriodicMonthlyField from "./FSPeriodicMonthlyField.vue";
|
|
54
|
+
import FSPeriodicWeeklyField from "./FSPeriodicWeeklyField.vue";
|
|
55
|
+
import FSPeriodicYearlyField from "./FSPeriodicYearlyField.vue";
|
|
56
|
+
import FSPeriodicDailyField from "./FSPeriodicDailyField.vue";
|
|
57
|
+
import FSRadioGroup from "../../FSRadioGroup.vue";
|
|
58
|
+
import FSDivider from "../../FSDivider.vue";
|
|
59
|
+
import FSRow from "../../FSRow.vue";
|
|
60
|
+
|
|
61
|
+
export default defineComponent({
|
|
62
|
+
name: "FSPeriodicField",
|
|
63
|
+
components: {
|
|
64
|
+
FSPeriodicMonthlyField,
|
|
65
|
+
FSPeriodicWeeklyField,
|
|
66
|
+
FSPeriodicYearlyField,
|
|
67
|
+
FSPeriodicDailyField,
|
|
68
|
+
FSRadioGroup,
|
|
69
|
+
FSDivider,
|
|
70
|
+
FSRow
|
|
71
|
+
},
|
|
72
|
+
props: {
|
|
73
|
+
modelValue: {
|
|
74
|
+
type: String as PropType<string>,
|
|
75
|
+
required: true
|
|
76
|
+
},
|
|
77
|
+
editable: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
required: false,
|
|
80
|
+
default: true
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
emits: ["update:modelValue"],
|
|
84
|
+
setup(props, { emit }) {
|
|
85
|
+
const { $tr } = useTranslationsProvider();
|
|
86
|
+
|
|
87
|
+
const availablePeriod = [
|
|
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
|
+
];
|
|
93
|
+
|
|
94
|
+
const selectedPeriod = ref("daily");
|
|
95
|
+
|
|
96
|
+
const getPeriod = (value: string) => {
|
|
97
|
+
const cronArray = value.split(" ");
|
|
98
|
+
if (cronArray[3] !== "*") {
|
|
99
|
+
return "yearly";
|
|
100
|
+
}
|
|
101
|
+
else if(!cronArray[2].includes("*") || cronArray[2].includes("-")) {
|
|
102
|
+
return "monthly";
|
|
103
|
+
}
|
|
104
|
+
else if(cronArray[4] !== "*") {
|
|
105
|
+
return "weekly";
|
|
106
|
+
}
|
|
107
|
+
return "daily";
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
watch(() => selectedPeriod.value, () => {
|
|
111
|
+
if (getPeriod(props.modelValue) === selectedPeriod.value) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const period = availablePeriod.find((item) => item.value === selectedPeriod.value);
|
|
115
|
+
if (!period) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
emit('update:modelValue', period.item.default);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
watch(() => props.modelValue, () => {
|
|
122
|
+
selectedPeriod.value = getPeriod(props.modelValue);
|
|
123
|
+
}, { immediate: true });
|
|
124
|
+
|
|
125
|
+
return {
|
|
126
|
+
availablePeriod,
|
|
127
|
+
selectedPeriod
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
</script>
|