@dative-gpi/foundation-shared-components 1.0.66 → 1.0.67-map-edit
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/assets/images/map/snow.png +0 -0
- package/components/FSAccordionPanel.vue +40 -21
- package/components/FSBreadcrumbs.vue +21 -12
- package/components/FSButton.vue +11 -9
- package/components/FSCalendar.vue +50 -12
- package/components/FSCalendarTwin.vue +95 -43
- package/components/FSCard.vue +61 -9
- package/components/FSCardPlaceholder.vue +8 -5
- package/components/FSCheckbox.vue +5 -4
- package/components/FSChip.vue +73 -45
- package/components/FSChipGroup.vue +69 -0
- package/components/FSClickable.vue +11 -9
- package/components/FSClock.vue +30 -12
- package/components/FSCol.vue +11 -5
- package/components/FSDialog.vue +2 -1
- package/components/FSDialogContent.vue +12 -11
- package/components/FSDialogForm.vue +22 -2
- package/components/FSDialogFormBody.vue +50 -31
- package/components/FSDialogMenu.vue +17 -8
- package/components/FSDialogMultiFormBody.vue +23 -13
- package/components/FSDialogRemove.vue +7 -8
- package/components/FSDialogSubmit.vue +20 -11
- package/components/FSEditImageUI.vue +13 -5
- package/components/FSFadeOut.vue +53 -21
- package/components/FSForm.vue +10 -8
- package/components/FSGrid.vue +0 -1
- package/components/FSIcon.vue +2 -2
- package/components/FSIconCard.vue +68 -12
- package/components/FSInformationsMenu.vue +142 -0
- package/components/FSInstantPicker.vue +268 -0
- package/components/FSLink.vue +25 -9
- package/components/FSLoader.vue +28 -10
- package/components/FSMenu.vue +47 -0
- package/components/FSOptionGroup.vue +8 -8
- package/components/FSOptionItem.vue +4 -4
- package/components/FSOptionsMenu.vue +165 -0
- package/components/FSPagination.vue +1 -1
- package/components/FSPlayButtons.vue +72 -0
- package/components/FSProgressBar.vue +94 -0
- package/components/FSRadio.vue +5 -4
- package/components/FSRadioGroup.vue +3 -3
- package/components/FSRangePicker.vue +275 -0
- package/components/FSRangeSlider.vue +84 -0
- package/components/FSRouterLink.vue +42 -0
- package/components/FSSlideGroup.vue +19 -5
- package/components/FSSlider.vue +44 -79
- package/components/FSSpan.vue +12 -7
- package/components/FSSwitch.vue +44 -48
- package/components/FSTab.vue +15 -13
- package/components/FSTabs.vue +32 -7
- package/components/FSTag.vue +3 -3
- package/components/FSTagGroup.vue +6 -4
- package/components/FSText.vue +11 -7
- package/components/FSToggleSet.vue +7 -7
- package/components/FSWindow.vue +122 -5
- package/components/FSWrapGroup.vue +13 -1
- package/components/agenda/FSAgenda.vue +26 -7
- package/components/agenda/FSAgendaDialogCalendar.vue +2 -2
- package/components/agenda/FSAgendaHeader.vue +35 -10
- package/components/agenda/FSAgendaHorizontalEvent.vue +18 -6
- package/components/agenda/FSAgendaHoursRow.vue +48 -8
- package/components/agenda/FSAgendaVerticalEvent.vue +1 -1
- package/components/agenda/FSDayAgenda.vue +0 -1
- package/components/agenda/FSMonthAgenda.vue +1 -6
- package/components/agenda/FSSelectAgendaMode.vue +2 -2
- package/components/agenda/FSWeekAgenda.vue +5 -10
- package/components/autocompletes/FSAutoCompleteAddress.vue +25 -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/FSButtonCheckbox.vue +4 -4
- package/components/buttons/FSButtonCopy.vue +1 -1
- package/components/buttons/FSButtonCopyLabel.vue +1 -1
- 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 +5 -3
- package/components/deviceOrganisations/FSStatus.vue +5 -3
- package/components/deviceOrganisations/FSStatusCard.vue +7 -9
- package/components/deviceOrganisations/FSStatusRichCard.vue +171 -0
- package/components/deviceOrganisations/FSWorstAlert.vue +24 -36
- package/components/deviceOrganisations/FSWorstAlertCard.vue +8 -47
- package/components/fields/FSAutocompleteField.vue +85 -82
- package/components/fields/FSAutocompleteTag.vue +1 -1
- package/components/fields/FSBaseField.vue +42 -25
- package/components/fields/FSClosableSearchField.vue +83 -0
- package/components/fields/FSColorField.vue +12 -10
- package/components/fields/FSCommentField.vue +28 -16
- package/components/fields/FSDateField.vue +13 -10
- package/components/fields/FSDateRangeField.vue +6 -5
- package/components/fields/FSDateTimeField.vue +14 -11
- package/components/fields/FSDateTimeRangeDialog.vue +160 -0
- package/components/fields/FSDateTimeRangeField.vue +23 -115
- package/components/fields/FSEntityFieldUI.vue +19 -16
- package/components/fields/FSGradientField.vue +5 -5
- package/components/fields/FSIconField.vue +16 -9
- package/components/fields/FSMagicConfigField.vue +15 -7
- package/components/fields/FSMagicField.vue +7 -2
- package/components/fields/FSNumberField.vue +8 -4
- package/components/fields/FSPasswordField.vue +7 -7
- package/components/fields/FSRichTextField.vue +78 -58
- package/components/fields/FSSearchField.vue +9 -115
- package/components/fields/FSSelectField.vue +69 -71
- package/components/fields/FSTagField.vue +9 -9
- package/components/fields/FSTermField.vue +69 -46
- package/components/fields/FSTextArea.vue +17 -11
- package/components/fields/FSTextField.vue +15 -10
- package/components/fields/FSTimeField.vue +14 -10
- package/components/fields/FSTimeRangeField.vue +310 -0
- package/components/fields/FSTimeStepField.vue +5 -5
- package/components/fields/FSTranslateField.vue +10 -10
- package/components/fields/FSTranslateRichTextField.vue +41 -20
- package/components/fields/FSTranslateTextArea.vue +10 -10
- package/components/fields/FSTreeViewField.vue +15 -13
- package/components/fields/periodicField/FSPeriodicDailyField.vue +7 -7
- package/components/fields/periodicField/FSPeriodicField.vue +15 -15
- package/components/fields/periodicField/FSPeriodicMonthlyField.vue +16 -16
- package/components/fields/periodicField/FSPeriodicWeeklyField.vue +28 -18
- package/components/fields/periodicField/FSPeriodicYearlyField.vue +12 -12
- package/components/lists/FSDataIteratorItem.vue +23 -67
- package/components/lists/FSDataTableUI.vue +198 -123
- package/components/lists/FSDraggable.vue +2 -2
- package/components/lists/FSFilterButton.vue +14 -16
- package/components/lists/FSHeaderButton.vue +11 -9
- package/components/lists/FSHiddenButton.vue +9 -9
- package/components/lists/FSLoadDataTable.vue +10 -7
- package/components/lists/FSSimpleList.vue +95 -88
- package/components/lists/FSSimpleListItem.vue +131 -0
- package/components/map/FSMap.vue +144 -158
- package/components/map/FSMapEditLocationAddress.vue +189 -0
- package/components/map/FSMapFeatureGroup.vue +7 -1
- package/components/map/FSMapLayerButton.vue +4 -3
- package/components/map/FSMapMarker.vue +103 -42
- package/components/map/FSMapMarkerClusterGroup.vue +32 -7
- package/components/map/FSMapOverlay.vue +44 -24
- package/components/map/FSMapPolygon.vue +16 -4
- package/components/map/FSMapTileLayer.vue +26 -9
- package/components/map/layers.ts +0 -0
- package/components/selects/FSSelectAutoRefresh.vue +8 -8
- package/components/selects/FSSelectDashboardVariableType.vue +4 -3
- package/components/selects/FSSelectDateSetting.vue +2 -2
- package/components/selects/FSSelectDays.vue +8 -8
- package/components/selects/FSSelectListMode.vue +2 -2
- package/components/selects/FSSelectMapLayer.vue +68 -0
- package/components/selects/FSSelectMonths.vue +13 -13
- 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 +61 -52
- package/components/tiles/FSCommentTileUI.vue +38 -13
- package/components/tiles/FSDashboardOrganisationTypeTileUI.vue +14 -2
- package/components/tiles/FSDashboardShallowTileUI.vue +14 -2
- package/components/tiles/FSDeviceOrganisationTileUI.vue +0 -6
- package/components/tiles/FSEntityCountBadge.vue +72 -0
- package/components/tiles/FSFolderTileUI.vue +38 -4
- package/components/tiles/FSGroupTileUI.vue +32 -136
- package/components/tiles/FSLoadTile.vue +16 -10
- package/components/tiles/FSLocationTileUI.vue +45 -63
- package/components/tiles/FSServiceAccountOrganisationTileUI.vue +0 -6
- package/components/tiles/FSSimpleTileUI.vue +30 -24
- package/components/tiles/FSTile.vue +46 -39
- package/components/tiles/FSUserOrganisationTileUI.vue +1 -7
- package/components/tiles/FSUserTileUI.vue +119 -0
- package/components/toggleSets/FSToggleSetPosition.vue +1 -1
- package/components/views/FSBaseView.vue +64 -0
- package/components/views/FSEntityView.vue +12 -146
- 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 +211 -0
- package/components/views/mobile/FSBaseDefaultMobileView.vue +133 -0
- package/components/views/mobile/FSBaseEntityMobileView.vue +206 -0
- package/components/views/mobile/FSBaseMobileView.vue +53 -0
- package/composables/index.ts +1 -0
- package/composables/useAddress.ts +40 -8
- package/composables/useBreakpoints.ts +40 -4
- package/composables/useColors.ts +16 -7
- package/composables/useMagicFieldProvider.ts +1 -0
- package/composables/useMapLayers.ts +69 -0
- package/composables/useSlots.ts +2 -1
- package/models/colors.ts +2 -1
- package/models/deviceAlerts.ts +1 -0
- package/models/magicFields.ts +1 -0
- package/models/map.ts +12 -10
- package/models/rules.ts +5 -2
- package/models/tables.ts +2 -1
- package/models/variableNode.ts +8 -5
- package/package.json +5 -5
- package/styles/components/fs_agenda.scss +4 -0
- package/styles/components/fs_agenda_event.scss +1 -1
- package/styles/components/fs_agenda_hours_row.scss +0 -8
- 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_calendar.scss +1 -0
- package/styles/components/fs_card.scss +9 -0
- package/styles/components/fs_chip.scss +13 -7
- package/styles/components/fs_clickable.scss +16 -23
- package/styles/components/fs_clock.scss +0 -10
- package/styles/components/fs_col.scss +1 -1
- package/styles/components/fs_color_field.scss +0 -4
- package/styles/components/fs_data_table.scss +6 -9
- package/styles/components/fs_dialog.scss +4 -10
- package/styles/components/fs_dialog_menu.scss +4 -2
- package/styles/components/fs_draggable.scss +0 -5
- package/styles/components/fs_fade_out.scss +10 -2
- package/styles/components/fs_filter_button.scss +1 -1
- 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 +57 -17
- package/styles/components/fs_meta_field.scss +3 -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 -10
- package/styles/components/fs_select_field.scss +4 -13
- package/styles/components/fs_slide_group.scss +7 -0
- package/styles/components/fs_slider.scss +0 -40
- package/styles/components/fs_span.scss +13 -5
- package/styles/components/fs_status_rich_card.scss +6 -0
- package/styles/components/fs_tabs.scss +18 -37
- package/styles/components/fs_tag.scss +8 -22
- package/styles/components/fs_text_area.scss +2 -21
- package/styles/components/fs_tile.scss +0 -19
- package/styles/components/fs_window.scss +3 -1
- package/styles/components/fs_wrap_group.scss +7 -0
- package/styles/components/index.scss +2 -6
- package/styles/globals/index.scss +1 -5
- package/styles/globals/overrides.scss +26 -54
- package/styles/globals/scrollbars.scss +8 -0
- package/styles/globals/text_fonts.scss +18 -66
- package/styles/globals/touchscreen.scss +2 -2
- package/tools/alertsTools.ts +94 -18
- package/tools/chartsTools.ts +155 -16
- package/tools/index.ts +3 -1
- package/tools/reportsTools.ts +38 -0
- package/tools/timeRangeTools.ts +125 -0
- package/utils/badge.ts +9 -5
- package/utils/filter.ts +4 -1
- package/utils/index.ts +2 -0
- package/utils/leafletMarkers.ts +4 -4
- package/utils/operations.ts +108 -0
- package/utils/picker.ts +40 -0
- package/utils/sort.ts +2 -2
- package/utils/time.ts +13 -13
- package/components/fields/FSTimeSlotField.vue +0 -250
- package/components/views/FSEntityHeader.vue +0 -343
- 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_data_iterator_item.scss +0 -33
- package/styles/components/fs_icon_field.scss +0 -12
- package/styles/components/fs_search_field.scss +0 -3
- 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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
:description="$props.description"
|
|
5
5
|
:hideHeader="$props.hideHeader"
|
|
6
6
|
:required="$props.required"
|
|
7
|
-
:
|
|
7
|
+
:disabled="$props.disabled"
|
|
8
8
|
:messages="messages"
|
|
9
9
|
>
|
|
10
10
|
<template
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
:hideDetails="true"
|
|
27
27
|
:noResize="true"
|
|
28
28
|
:autoGrow="$props.autoGrow"
|
|
29
|
-
:
|
|
30
|
-
:clearable="$props.clearable &&
|
|
29
|
+
:disabled="$props.disabled"
|
|
30
|
+
:clearable="$props.clearable && !$props.disabled && !!$props.modelValue"
|
|
31
31
|
:rules="$props.rules"
|
|
32
32
|
:validateOn="validateOn"
|
|
33
33
|
:modelValue="$props.modelValue"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
align="center-center"
|
|
51
51
|
>
|
|
52
52
|
<FSButton
|
|
53
|
-
v-if="$props.clearable &&
|
|
53
|
+
v-if="$props.clearable && !$props.disabled && !!$props.modelValue"
|
|
54
54
|
icon="mdi-close"
|
|
55
55
|
variant="icon"
|
|
56
56
|
:color="ColorEnum.Dark"
|
|
@@ -128,16 +128,16 @@ export default defineComponent({
|
|
|
128
128
|
required: false,
|
|
129
129
|
default: true
|
|
130
130
|
},
|
|
131
|
-
|
|
131
|
+
disabled: {
|
|
132
132
|
type: Boolean,
|
|
133
133
|
required: false,
|
|
134
|
-
default:
|
|
134
|
+
default: false
|
|
135
135
|
}
|
|
136
136
|
},
|
|
137
137
|
emits: ["update:modelValue"],
|
|
138
138
|
setup(props) {
|
|
139
|
+
const { fontStyles, isMobileSized } = useBreakpoints();
|
|
139
140
|
const { validateOn, getMessages } = useRules();
|
|
140
|
-
const { isMobileSized } = useBreakpoints();
|
|
141
141
|
const { getColors } = useColors();
|
|
142
142
|
const { slots } = useSlots();
|
|
143
143
|
|
|
@@ -152,7 +152,7 @@ export default defineComponent({
|
|
|
152
152
|
let fieldHeight: string | undefined = undefined;
|
|
153
153
|
if (!props.autoGrow) {
|
|
154
154
|
const base = isMobileSized.value ? 34 : 38;
|
|
155
|
-
const row = isMobileSized.value ?
|
|
155
|
+
const row = isMobileSized.value ? 18 : 20;
|
|
156
156
|
if (props.rows > 1) {
|
|
157
157
|
height = `${base + (props.rows - 1) * row}px`;
|
|
158
158
|
}
|
|
@@ -161,14 +161,17 @@ export default defineComponent({
|
|
|
161
161
|
}
|
|
162
162
|
fieldHeight = `${props.rows * row}px`;
|
|
163
163
|
}
|
|
164
|
-
if (
|
|
164
|
+
if (props.disabled) {
|
|
165
165
|
return {
|
|
166
166
|
"--fs-text-area-cursor" : "default",
|
|
167
167
|
"--fs-text-area-border-color" : lights.base,
|
|
168
168
|
"--fs-text-area-color" : lights.dark,
|
|
169
169
|
"--fs-text-area-active-border-color": lights.base,
|
|
170
170
|
"--fs-text-area-height" : height,
|
|
171
|
-
"--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
|
|
172
175
|
};
|
|
173
176
|
}
|
|
174
177
|
return {
|
|
@@ -178,7 +181,10 @@ export default defineComponent({
|
|
|
178
181
|
"--fs-text-area-active-border-color": darks.dark,
|
|
179
182
|
"--fs-text-area-error-border-color" : errors.base,
|
|
180
183
|
"--fs-text-area-height" : height,
|
|
181
|
-
"--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
|
|
182
188
|
};
|
|
183
189
|
});
|
|
184
190
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
:description="$props.description"
|
|
5
5
|
:hideHeader="$props.hideHeader"
|
|
6
6
|
:required="$props.required"
|
|
7
|
-
:
|
|
7
|
+
:disabled="$props.disabled"
|
|
8
8
|
:messages="messages"
|
|
9
9
|
>
|
|
10
10
|
<template
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
:type="$props.type"
|
|
33
33
|
:persistentClear="true"
|
|
34
34
|
:hideDetails="true"
|
|
35
|
-
:
|
|
36
|
-
:clearable="$props.clearable &&
|
|
35
|
+
:disabled="$props.disabled"
|
|
36
|
+
:clearable="$props.clearable && !$props.disabled && !!$props.modelValue"
|
|
37
37
|
:rules="$props.rules"
|
|
38
38
|
:validateOn="validateOn"
|
|
39
39
|
:modelValue="$props.modelValue"
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
name="clear"
|
|
57
57
|
>
|
|
58
58
|
<FSButton
|
|
59
|
-
v-if="$props.clearable &&
|
|
59
|
+
v-if="$props.clearable && !$props.disabled && !!$props.modelValue"
|
|
60
60
|
icon="mdi-close"
|
|
61
61
|
variant="icon"
|
|
62
62
|
:color="ColorEnum.Dark"
|
|
@@ -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";
|
|
@@ -129,14 +129,15 @@ export default defineComponent({
|
|
|
129
129
|
required: false,
|
|
130
130
|
default: true
|
|
131
131
|
},
|
|
132
|
-
|
|
132
|
+
disabled: {
|
|
133
133
|
type: Boolean,
|
|
134
134
|
required: false,
|
|
135
|
-
default:
|
|
135
|
+
default: false
|
|
136
136
|
}
|
|
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();
|
|
@@ -149,12 +150,14 @@ export default defineComponent({
|
|
|
149
150
|
const darks = getColors(ColorEnum.Dark);
|
|
150
151
|
|
|
151
152
|
const style = computed((): StyleValue => {
|
|
152
|
-
if (
|
|
153
|
+
if (props.disabled) {
|
|
153
154
|
return {
|
|
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
|
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
:description="$props.description"
|
|
4
4
|
:hideHeader="$props.hideHeader"
|
|
5
5
|
:required="$props.required"
|
|
6
|
-
:
|
|
6
|
+
:disabled="$props.disabled"
|
|
7
7
|
:label="$props.label"
|
|
8
8
|
:messages="messages"
|
|
9
9
|
>
|
|
10
10
|
<FSRow>
|
|
11
11
|
<FSNumberField
|
|
12
12
|
:validationValue="$props.modelValue"
|
|
13
|
-
:
|
|
13
|
+
:disabled="$props.disabled"
|
|
14
14
|
:validateOn="validateOn"
|
|
15
15
|
:rules="$props.rules"
|
|
16
16
|
:hideHeader="true"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
</FSNumberField>
|
|
32
32
|
<FSSelectField
|
|
33
33
|
class="fs-time-field-select"
|
|
34
|
-
:
|
|
34
|
+
:disabled="$props.disabled"
|
|
35
35
|
:hideHeader="true"
|
|
36
36
|
:clearable="false"
|
|
37
37
|
:items="timeScale"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
</template>
|
|
54
54
|
|
|
55
55
|
<script lang="ts">
|
|
56
|
-
import { computed, defineComponent, type PropType, ref, watch } from "vue";
|
|
56
|
+
import { computed, defineComponent, type PropType, ref, watch, type StyleValue } from "vue";
|
|
57
57
|
|
|
58
58
|
import { useColors, useRules, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
59
59
|
import { getTimeScaleIndex, timeScale } from "@dative-gpi/foundation-shared-components/utils";
|
|
@@ -108,10 +108,10 @@ export default defineComponent({
|
|
|
108
108
|
required: false,
|
|
109
109
|
default: null
|
|
110
110
|
},
|
|
111
|
-
|
|
111
|
+
disabled: {
|
|
112
112
|
type: Boolean,
|
|
113
113
|
required: false,
|
|
114
|
-
default:
|
|
114
|
+
default: false
|
|
115
115
|
}
|
|
116
116
|
},
|
|
117
117
|
emits: ["update:modelValue"],
|
|
@@ -131,7 +131,7 @@ export default defineComponent({
|
|
|
131
131
|
const selectedUnit = ref(timeScale[0]);
|
|
132
132
|
|
|
133
133
|
const style = computed((): StyleValue => {
|
|
134
|
-
if (
|
|
134
|
+
if (props.disabled) {
|
|
135
135
|
return {
|
|
136
136
|
"--fs-time-field-cursor" : "default",
|
|
137
137
|
"--fs-time-field-border-color" : lights.base,
|
|
@@ -153,14 +153,14 @@ export default defineComponent({
|
|
|
153
153
|
return Object.keys(slots).filter(k => k.startsWith("number-")).reduce((acc, key) => {
|
|
154
154
|
acc[key.substring("number-".length)] = slots[key];
|
|
155
155
|
return acc;
|
|
156
|
-
}, {});
|
|
156
|
+
}, {} as Record<string, any>);
|
|
157
157
|
});
|
|
158
158
|
|
|
159
159
|
const selectSlots = computed((): any => {
|
|
160
160
|
return Object.keys(slots).filter(k => k.startsWith("select-")).reduce((acc, key) => {
|
|
161
161
|
acc[key.substring("select-".length)] = slots[key];
|
|
162
162
|
return acc;
|
|
163
|
-
}, {});
|
|
163
|
+
}, {} as Record<string, any>);
|
|
164
164
|
});
|
|
165
165
|
|
|
166
166
|
const messages = computed((): string[] => props.messages ?? getMessages(props.modelValue, props.rules));
|
|
@@ -171,7 +171,11 @@ export default defineComponent({
|
|
|
171
171
|
};
|
|
172
172
|
|
|
173
173
|
const onSubmitTimeScale = (value: number): void => {
|
|
174
|
-
|
|
174
|
+
const newUnit = timeScale.find((item) => item.id === value);
|
|
175
|
+
if(!newUnit) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
selectedUnit.value = newUnit;
|
|
175
179
|
emit("update:modelValue", innerTime.value * selectedUnit.value.id);
|
|
176
180
|
};
|
|
177
181
|
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSBaseField
|
|
3
|
+
:description="$props.description"
|
|
4
|
+
:hideHeader="$props.hideHeader"
|
|
5
|
+
:required="$props.required"
|
|
6
|
+
:disabled="$props.disabled"
|
|
7
|
+
:label="$props.label"
|
|
8
|
+
:messages="messages"
|
|
9
|
+
:maxWidth="$props.maxWidth"
|
|
10
|
+
>
|
|
11
|
+
<FSRow>
|
|
12
|
+
<FSRow
|
|
13
|
+
:wrap="false"
|
|
14
|
+
>
|
|
15
|
+
<FSSelectField
|
|
16
|
+
:validationValue="$props.modelValue"
|
|
17
|
+
:disabled="$props.disabled"
|
|
18
|
+
:validateOn="validateOn"
|
|
19
|
+
:rules="$props.rules"
|
|
20
|
+
:items="daysItems"
|
|
21
|
+
:hideHeader="true"
|
|
22
|
+
:clearable="false"
|
|
23
|
+
:modelValue="realTime?.startDay ?? 0"
|
|
24
|
+
@update:modelValue="onChangeDayStart"
|
|
25
|
+
/>
|
|
26
|
+
<FSClock
|
|
27
|
+
:disabled="$props.disabled"
|
|
28
|
+
:color="ColorEnum.Light"
|
|
29
|
+
:slider="false"
|
|
30
|
+
:modelValue="startTime"
|
|
31
|
+
@update:modelValue="onChangeHourStart"
|
|
32
|
+
/>
|
|
33
|
+
</FSRow>
|
|
34
|
+
<FSRow
|
|
35
|
+
:wrap="false"
|
|
36
|
+
>
|
|
37
|
+
<FSSelectField
|
|
38
|
+
:disabled="$props.disabled"
|
|
39
|
+
:items="daysItems"
|
|
40
|
+
:hideHeader="true"
|
|
41
|
+
:clearable="false"
|
|
42
|
+
:modelValue="realTime?.endDay ?? 0"
|
|
43
|
+
@update:modelValue="onChangeDayEnd"
|
|
44
|
+
/>
|
|
45
|
+
<FSClock
|
|
46
|
+
:disabled="$props.disabled"
|
|
47
|
+
:color="ColorEnum.Light"
|
|
48
|
+
:slider="false"
|
|
49
|
+
:modelValue="endTime"
|
|
50
|
+
@update:modelValue="onChangeHourEnd"
|
|
51
|
+
/>
|
|
52
|
+
</FSRow>
|
|
53
|
+
<FSSelectField
|
|
54
|
+
v-if="$props.showVariant"
|
|
55
|
+
width="hug"
|
|
56
|
+
:label="$tr('ui.common.type', 'Type')"
|
|
57
|
+
:items="dateTypeItems"
|
|
58
|
+
:hideHeader="true"
|
|
59
|
+
:clearable="false"
|
|
60
|
+
:modelValue="modelValue?.variant ?? DateType.Local"
|
|
61
|
+
@update:modelValue="onUpdateVariant"
|
|
62
|
+
/>
|
|
63
|
+
</FSRow>
|
|
64
|
+
</FSBaseField>
|
|
65
|
+
</template>
|
|
66
|
+
|
|
67
|
+
<script lang="ts">
|
|
68
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
69
|
+
|
|
70
|
+
import { useTranslations as useTranslationProvider } from "@dative-gpi/bones-ui/composables";
|
|
71
|
+
import { useRules } from "@dative-gpi/foundation-shared-components/composables";
|
|
72
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
73
|
+
import { DateType, Days } from "@dative-gpi/foundation-shared-domain/enums";
|
|
74
|
+
import { getEnumEntries } from "@dative-gpi/foundation-shared-domain/tools";
|
|
75
|
+
|
|
76
|
+
import FSSelectField from "./FSSelectField.vue";
|
|
77
|
+
import FSBaseField from "./FSBaseField.vue";
|
|
78
|
+
import FSClock from "../FSClock.vue";
|
|
79
|
+
import FSRow from "../FSRow.vue";
|
|
80
|
+
|
|
81
|
+
import { applyOffset, dayLabel, type DateTimeRange } from "../../tools";
|
|
82
|
+
|
|
83
|
+
export default defineComponent({
|
|
84
|
+
name: "FSTimeRangeField",
|
|
85
|
+
components: {
|
|
86
|
+
FSSelectField,
|
|
87
|
+
FSBaseField,
|
|
88
|
+
FSClock,
|
|
89
|
+
FSRow
|
|
90
|
+
},
|
|
91
|
+
props: {
|
|
92
|
+
label: {
|
|
93
|
+
type: String as PropType<string | null>,
|
|
94
|
+
required: false,
|
|
95
|
+
default: null
|
|
96
|
+
},
|
|
97
|
+
description: {
|
|
98
|
+
type: String as PropType<string | null>,
|
|
99
|
+
required: false,
|
|
100
|
+
default: null
|
|
101
|
+
},
|
|
102
|
+
modelValue: {
|
|
103
|
+
type: Object as PropType<DateTimeRange>,
|
|
104
|
+
required: true,
|
|
105
|
+
default: null
|
|
106
|
+
},
|
|
107
|
+
hideHeader: {
|
|
108
|
+
type: Boolean,
|
|
109
|
+
required: false,
|
|
110
|
+
default: false
|
|
111
|
+
},
|
|
112
|
+
required: {
|
|
113
|
+
type: Boolean,
|
|
114
|
+
required: false,
|
|
115
|
+
default: false
|
|
116
|
+
},
|
|
117
|
+
rules: {
|
|
118
|
+
type: Array as PropType<any[]>,
|
|
119
|
+
required: false,
|
|
120
|
+
default: () => []
|
|
121
|
+
},
|
|
122
|
+
messages: {
|
|
123
|
+
type: Array as PropType<string[]>,
|
|
124
|
+
required: false,
|
|
125
|
+
default: null
|
|
126
|
+
},
|
|
127
|
+
disabled: {
|
|
128
|
+
type: Boolean,
|
|
129
|
+
required: false,
|
|
130
|
+
default: false
|
|
131
|
+
},
|
|
132
|
+
showVariant: {
|
|
133
|
+
type: Boolean,
|
|
134
|
+
required: false,
|
|
135
|
+
default: false
|
|
136
|
+
},
|
|
137
|
+
maxWidth: {
|
|
138
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
139
|
+
required: false,
|
|
140
|
+
default: null
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
emits: ["update:modelValue"],
|
|
144
|
+
setup(props, { emit }) {
|
|
145
|
+
const { $tr } = useTranslationProvider();
|
|
146
|
+
const { validateOn, getMessages } = useRules();
|
|
147
|
+
|
|
148
|
+
const dateTypeItems = [
|
|
149
|
+
{
|
|
150
|
+
id: DateType.Local,
|
|
151
|
+
label: $tr('ui.common.local', 'Local')
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
id: DateType.UTC,
|
|
155
|
+
label: $tr('ui.common.utc', 'UTC')
|
|
156
|
+
}
|
|
157
|
+
];
|
|
158
|
+
|
|
159
|
+
const daysItems = computed(()=>{
|
|
160
|
+
return getEnumEntries(Days).map((f)=>{
|
|
161
|
+
return {
|
|
162
|
+
id: f.value as number,
|
|
163
|
+
label: dayLabel(f.value)
|
|
164
|
+
}
|
|
165
|
+
})
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
const realTime = computed(() => {
|
|
169
|
+
return applyOffset(props.modelValue, false);
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
const startTime = computed((): number => {
|
|
173
|
+
if (realTime.value) {
|
|
174
|
+
return realTime.value.startHour * 60 * 60 * 1000 + realTime.value.startMinute * 60 * 1000;
|
|
175
|
+
}
|
|
176
|
+
return 0;
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
const endTime = computed((): number => {
|
|
180
|
+
if (realTime.value) {
|
|
181
|
+
return realTime.value.endHour * 60 * 60 * 1000 + realTime.value.endMinute * 60 * 1000;
|
|
182
|
+
}
|
|
183
|
+
return 0;
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
const messages = computed((): string[] => props.messages ?? getMessages(props.modelValue, props.rules));
|
|
187
|
+
|
|
188
|
+
const onChangeDayStart = (value: number) => {
|
|
189
|
+
if (value === Days.AllDays) {
|
|
190
|
+
emit("update:modelValue",
|
|
191
|
+
{
|
|
192
|
+
startDay: value,
|
|
193
|
+
startHour: props.modelValue.startHour,
|
|
194
|
+
startMinute: props.modelValue.startMinute,
|
|
195
|
+
endDay: value,
|
|
196
|
+
endHour: props.modelValue.endHour,
|
|
197
|
+
endMinute: props.modelValue.endMinute,
|
|
198
|
+
variant: props.modelValue.variant
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
const t = applyOffset({
|
|
204
|
+
startDay: value,
|
|
205
|
+
startHour: realTime.value.startHour,
|
|
206
|
+
startMinute: realTime.value.startMinute,
|
|
207
|
+
endDay: props.modelValue.endDay == Days.AllDays ? value : realTime.value.endDay,
|
|
208
|
+
endHour: realTime.value.endHour,
|
|
209
|
+
endMinute: realTime.value.endMinute,
|
|
210
|
+
variant: realTime.value.variant
|
|
211
|
+
}, true);
|
|
212
|
+
emit("update:modelValue",t);
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
const onChangeHourStart = (value: number) => {
|
|
218
|
+
const innerHours = value ? Math.floor(value / (60 * 60 * 1000)) : 0;
|
|
219
|
+
const innerMinutes = value ? Math.floor((value % (60 * 60 * 1000)) / (60 * 1000)) : 0;
|
|
220
|
+
const t = {
|
|
221
|
+
startDay: realTime.value.startDay,
|
|
222
|
+
startHour: innerHours,
|
|
223
|
+
startMinute: innerMinutes,
|
|
224
|
+
endDay: realTime.value.endDay,
|
|
225
|
+
endHour: realTime.value.endHour,
|
|
226
|
+
endMinute: realTime.value.endMinute,
|
|
227
|
+
variant: realTime.value.variant
|
|
228
|
+
};
|
|
229
|
+
const newTime = applyOffset(t, true);
|
|
230
|
+
emit("update:modelValue", newTime);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
const onChangeDayEnd = (value: number) => {
|
|
234
|
+
|
|
235
|
+
if (value === Days.AllDays) {
|
|
236
|
+
emit("update:modelValue",{
|
|
237
|
+
startDay: value,
|
|
238
|
+
startHour: props.modelValue.startHour,
|
|
239
|
+
startMinute: props.modelValue.startMinute,
|
|
240
|
+
endDay: value,
|
|
241
|
+
endHour: props.modelValue.endHour,
|
|
242
|
+
endMinute: props.modelValue.endMinute,
|
|
243
|
+
variant: props.modelValue.variant
|
|
244
|
+
});
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
const t = applyOffset({
|
|
249
|
+
startDay: props.modelValue.startDay == Days.AllDays ? value : realTime.value.startDay,
|
|
250
|
+
startHour: realTime.value.startHour,
|
|
251
|
+
startMinute: realTime.value.startMinute,
|
|
252
|
+
endDay: value,
|
|
253
|
+
endHour: realTime.value.endHour,
|
|
254
|
+
endMinute: realTime.value.endMinute,
|
|
255
|
+
variant: realTime.value.variant
|
|
256
|
+
}, true);
|
|
257
|
+
emit("update:modelValue", t);
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
const onChangeHourEnd = (value: number) => {
|
|
262
|
+
const innerHours = value ? Math.floor(value / (60 * 60 * 1000)) : 0;
|
|
263
|
+
const innerMinutes = value ? Math.floor((value % (60 * 60 * 1000)) / (60 * 1000)) : 0;
|
|
264
|
+
if (realTime.value) {
|
|
265
|
+
const t = {
|
|
266
|
+
startDay: realTime.value.startDay,
|
|
267
|
+
startHour: realTime.value.startHour,
|
|
268
|
+
startMinute: realTime.value.startMinute,
|
|
269
|
+
endDay: realTime.value.endDay,
|
|
270
|
+
endHour: innerHours,
|
|
271
|
+
endMinute: innerMinutes,
|
|
272
|
+
variant: realTime.value.variant
|
|
273
|
+
};
|
|
274
|
+
const newTime = applyOffset(t, true);
|
|
275
|
+
emit("update:modelValue", newTime);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
const onUpdateVariant = (value: DateType) => {
|
|
280
|
+
const t = applyOffset({
|
|
281
|
+
startDay: realTime.value.startDay,
|
|
282
|
+
startHour: realTime.value.startHour,
|
|
283
|
+
startMinute: realTime.value.startMinute,
|
|
284
|
+
endDay: realTime.value.endDay,
|
|
285
|
+
endHour: realTime.value.endHour,
|
|
286
|
+
endMinute: realTime.value.endMinute,
|
|
287
|
+
variant: value
|
|
288
|
+
}, true);
|
|
289
|
+
emit("update:modelValue", t );
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
return {
|
|
293
|
+
dateTypeItems,
|
|
294
|
+
validateOn,
|
|
295
|
+
daysItems,
|
|
296
|
+
ColorEnum,
|
|
297
|
+
startTime,
|
|
298
|
+
realTime,
|
|
299
|
+
messages,
|
|
300
|
+
DateType,
|
|
301
|
+
endTime,
|
|
302
|
+
onChangeHourStart,
|
|
303
|
+
onChangeDayStart,
|
|
304
|
+
onChangeHourEnd,
|
|
305
|
+
onUpdateVariant,
|
|
306
|
+
onChangeDayEnd
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
</script>
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
:description="$props.description"
|
|
4
4
|
:hideHeader="$props.hideHeader"
|
|
5
5
|
:required="$props.required"
|
|
6
|
-
:
|
|
6
|
+
:disabled="$props.disabled"
|
|
7
7
|
:label="$props.label"
|
|
8
8
|
:messages="messages"
|
|
9
9
|
>
|
|
10
10
|
<FSRow>
|
|
11
11
|
<FSNumberField
|
|
12
12
|
:validationValue="$props.modelValue"
|
|
13
|
-
:
|
|
13
|
+
:disabled="$props.disabled"
|
|
14
14
|
:validateOn="validateOn"
|
|
15
15
|
:rules="$props.rules"
|
|
16
16
|
:hideHeader="true"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
</FSNumberField>
|
|
32
32
|
<FSSelectField
|
|
33
33
|
class="fs-time-field-select"
|
|
34
|
-
:
|
|
34
|
+
:disabled="$props.disabled"
|
|
35
35
|
:hideHeader="true"
|
|
36
36
|
:clearable="false"
|
|
37
37
|
:items="units"
|
|
@@ -113,10 +113,10 @@ export default defineComponent({
|
|
|
113
113
|
required: false,
|
|
114
114
|
default: null
|
|
115
115
|
},
|
|
116
|
-
|
|
116
|
+
disabled: {
|
|
117
117
|
type: Boolean,
|
|
118
118
|
required: false,
|
|
119
|
-
default:
|
|
119
|
+
default: false
|
|
120
120
|
}
|
|
121
121
|
},
|
|
122
122
|
emits: ["update:modelValue"],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSTextField
|
|
3
|
-
:
|
|
3
|
+
:disabled="$props.disabled"
|
|
4
4
|
:modelValue="$props.modelValue"
|
|
5
5
|
@update:modelValue="$emit('update:modelValue', $event)"
|
|
6
6
|
v-bind="$attrs"
|
|
@@ -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,8 +43,8 @@
|
|
|
43
43
|
gap="32px"
|
|
44
44
|
>
|
|
45
45
|
<FSTextField
|
|
46
|
-
:label="$tr('ui.
|
|
47
|
-
:
|
|
46
|
+
:label="$tr('ui.common.default-value', 'Default value')"
|
|
47
|
+
:disabled="true"
|
|
48
48
|
:modelValue="$props.modelValue"
|
|
49
49
|
/>
|
|
50
50
|
<FSCol
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
>
|
|
53
53
|
<FSTextField
|
|
54
54
|
v-for="(language, index) in languages"
|
|
55
|
-
:
|
|
55
|
+
:disabled="$props.disabled"
|
|
56
56
|
:key="index"
|
|
57
57
|
:modelValue="getTranslation(language.code)"
|
|
58
58
|
@update:modelValue="setTranslation(language.code, $event)"
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
font="text-overline"
|
|
70
70
|
:style="style"
|
|
71
71
|
>
|
|
72
|
-
{{ $tr("
|
|
72
|
+
{{ $tr("translate-field.translate-in", "Translate in {0}", language.label) }}
|
|
73
73
|
</FSSpan>
|
|
74
74
|
<FSIcon>
|
|
75
75
|
{{ language.icon }}
|
|
@@ -149,10 +149,10 @@ export default defineComponent({
|
|
|
149
149
|
required: false,
|
|
150
150
|
default: ColorEnum.Primary
|
|
151
151
|
},
|
|
152
|
-
|
|
152
|
+
disabled: {
|
|
153
153
|
type: Boolean,
|
|
154
154
|
required: false,
|
|
155
|
-
default:
|
|
155
|
+
default: false
|
|
156
156
|
}
|
|
157
157
|
},
|
|
158
158
|
emits: ["update:modelValue", "update:translations"],
|
|
@@ -171,7 +171,7 @@ export default defineComponent({
|
|
|
171
171
|
const darks = getColors(ColorEnum.Dark);
|
|
172
172
|
|
|
173
173
|
const style = computed((): StyleValue => {
|
|
174
|
-
if (
|
|
174
|
+
if (props.disabled) {
|
|
175
175
|
return {
|
|
176
176
|
"--fs-translate-field-color": lights.dark
|
|
177
177
|
};
|
|
@@ -214,7 +214,7 @@ export default defineComponent({
|
|
|
214
214
|
|
|
215
215
|
const onSubmit = (): void => {
|
|
216
216
|
dialog.value = false;
|
|
217
|
-
if (props.
|
|
217
|
+
if (!props.disabled) {
|
|
218
218
|
emit("update:translations", innerTranslations.value);
|
|
219
219
|
}
|
|
220
220
|
};
|