@dative-gpi/foundation-shared-components 1.0.56 → 1.0.58-groupings
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 +16 -16
- 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/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 +50 -31
- package/components/FSDialogMenu.vue +17 -8
- package/components/FSDialogMultiFormBody.vue +79 -56
- package/components/FSDialogRemove.vue +7 -8
- package/components/FSDialogSubmit.vue +20 -11
- 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 +4 -3
- package/components/FSIconCard.vue +68 -12
- package/components/FSImage.vue +9 -2
- package/components/FSImageUI.vue +8 -15
- package/components/FSInformationsMenu.vue +142 -0
- package/components/FSInstantPicker.vue +269 -0
- package/components/FSLink.vue +25 -9
- package/components/FSLoader.vue +28 -10
- package/components/FSMenu.vue +47 -0
- package/components/FSOptionGroup.vue +57 -9
- package/components/FSOptionItem.vue +4 -4
- 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/FSRouterLink.vue +42 -0
- package/components/FSSlideGroup.vue +19 -5
- package/components/FSSlider.vue +6 -5
- package/components/FSSpan.vue +12 -7
- package/components/FSSwitch.vue +47 -21
- package/components/FSTab.vue +15 -13
- package/components/FSTabs.vue +32 -7
- package/components/FSTag.vue +16 -5
- package/components/FSTagGroup.vue +4 -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 +50 -37
- 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 +1 -2
- package/components/agenda/FSMonthAgenda.vue +3 -9
- package/components/agenda/FSSelectAgendaMode.vue +2 -2
- package/components/agenda/FSWeekAgenda.vue +7 -13
- 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 +16 -4
- package/components/deviceOrganisations/FSConnectivityCard.vue +17 -45
- package/components/deviceOrganisations/FSStatus.vue +16 -4
- package/components/deviceOrganisations/FSStatusCard.vue +33 -59
- package/components/deviceOrganisations/FSStatusRichCard.vue +171 -0
- package/components/deviceOrganisations/FSStatusesCarousel.vue +1 -0
- package/components/deviceOrganisations/FSStatusesRow.vue +8 -2
- package/components/deviceOrganisations/FSWorstAlert.vue +37 -42
- package/components/deviceOrganisations/FSWorstAlertCard.vue +35 -84
- package/components/fields/FSAutocompleteField.vue +85 -82
- package/components/fields/FSAutocompleteTag.vue +1 -1
- package/components/fields/FSBaseField.vue +54 -30
- package/components/fields/FSClosableSearchField.vue +83 -0
- package/components/fields/FSColorField.vue +48 -44
- 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 +36 -19
- 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 +9 -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 +10 -10
- package/components/fields/FSTermField.vue +72 -47
- 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 +220 -137
- 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 +96 -102
- package/components/lists/FSSimpleListItem.vue +131 -0
- package/components/map/FSMap.vue +146 -158
- package/components/map/FSMapFeatureGroup.vue +7 -1
- package/components/map/FSMapLayerButton.vue +4 -3
- package/components/map/FSMapMarker.vue +70 -48
- 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 +6 -6
- package/components/tiles/FSGroupTileUI.vue +58 -110
- package/components/tiles/FSGroupingTileUI.vue +115 -0
- package/components/tiles/FSLoadTile.vue +16 -10
- package/components/tiles/FSLocationTileUI.vue +63 -55
- package/components/tiles/FSModelTileUI.vue +5 -46
- package/components/tiles/FSServiceAccountOrganisationTileUI.vue +0 -6
- package/components/tiles/FSSimpleTileUI.vue +34 -29
- package/components/tiles/FSTile.vue +46 -39
- package/components/tiles/FSUserOrganisationTileUI.vue +1 -7
- package/components/toggleSets/FSToggleSetPosition.vue +1 -1
- 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 +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 +62 -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 +6 -3
- package/models/tables.ts +5 -2
- 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 +1 -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_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_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_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 -10
- 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 -5
- package/styles/components/fs_status_rich_card.scss +6 -0
- 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 +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 +28 -61
- 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 +87 -12
- package/tools/chartsTools.ts +143 -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 +7 -4
- package/utils/index.ts +1 -0
- package/utils/leafletMarkers.ts +4 -4
- package/utils/operations.ts +108 -0
- package/utils/sort.ts +2 -2
- package/utils/time.ts +16 -16
- 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_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
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
class="fs-magic-config-field"
|
|
4
4
|
>
|
|
5
5
|
<component
|
|
6
|
+
v-if="$props.type"
|
|
6
7
|
class="fs-magic-config-field-value"
|
|
7
8
|
:is="get($props.type)"
|
|
8
|
-
:label="$tr('ui.
|
|
9
|
-
:
|
|
9
|
+
:label="$tr('ui.common.value', 'Value')"
|
|
10
|
+
:disabled="$props.disabled"
|
|
10
11
|
:required="true"
|
|
11
12
|
:rules="rules"
|
|
12
13
|
:modelValue="valueToInput"
|
|
@@ -16,8 +17,8 @@
|
|
|
16
17
|
gap="24px"
|
|
17
18
|
>
|
|
18
19
|
<FSTranslateField
|
|
19
|
-
:label="$tr('
|
|
20
|
-
:
|
|
20
|
+
:label="$tr('entity.common.label', 'Label')"
|
|
21
|
+
:disabled="$props.disabled"
|
|
21
22
|
:modelValue="$props.labelDefault"
|
|
22
23
|
:translations="$props.translations"
|
|
23
24
|
@update:modelValue="$emit('update:labelDefault', $event)"
|
|
@@ -42,7 +43,7 @@
|
|
|
42
43
|
<script lang="ts">
|
|
43
44
|
import { computed, defineComponent, type PropType } from "vue";
|
|
44
45
|
|
|
45
|
-
import { DateRules, IconRules, NumberRules, TextRules, TimeRules, TimeStepRules } from "../../models";
|
|
46
|
+
import { DateRules, IconRules, NumberRules, TextRules, TimeRules, TimeStepRules, AutocompleteRules } from "../../models";
|
|
46
47
|
import { useMagicFieldProvider } from "../../composables";
|
|
47
48
|
import { MagicFieldType } from "../../models/magicFields";
|
|
48
49
|
|
|
@@ -80,10 +81,10 @@ export default defineComponent({
|
|
|
80
81
|
required: false,
|
|
81
82
|
default: () => []
|
|
82
83
|
},
|
|
83
|
-
|
|
84
|
+
disabled: {
|
|
84
85
|
type: Boolean,
|
|
85
86
|
required: false,
|
|
86
|
-
default:
|
|
87
|
+
default: false
|
|
87
88
|
}
|
|
88
89
|
},
|
|
89
90
|
emits: ["click:remove", "click:add", "update:modelValue", "update:labelDefault", "update:translations"],
|
|
@@ -104,6 +105,8 @@ export default defineComponent({
|
|
|
104
105
|
return [TimeRules.required()];
|
|
105
106
|
case MagicFieldType.TimeStepField:
|
|
106
107
|
return [TimeStepRules.required()];
|
|
108
|
+
case MagicFieldType.PlotPerField:
|
|
109
|
+
return [AutocompleteRules.required()];
|
|
107
110
|
}
|
|
108
111
|
return [];
|
|
109
112
|
});
|
|
@@ -125,6 +128,8 @@ export default defineComponent({
|
|
|
125
128
|
return props.modelValue === "true";
|
|
126
129
|
case MagicFieldType.TimeStepField:
|
|
127
130
|
return JSON.parse(props.modelValue);
|
|
131
|
+
case MagicFieldType.PlotPerField:
|
|
132
|
+
return parseInt(props.modelValue);
|
|
128
133
|
default:
|
|
129
134
|
return props.modelValue;
|
|
130
135
|
}
|
|
@@ -145,6 +150,9 @@ export default defineComponent({
|
|
|
145
150
|
case MagicFieldType.TimeStepField:
|
|
146
151
|
emit("update:modelValue", JSON.stringify(value));
|
|
147
152
|
break;
|
|
153
|
+
case MagicFieldType.PlotPerField:
|
|
154
|
+
emit("update:modelValue", value.toString());
|
|
155
|
+
break;
|
|
148
156
|
default:
|
|
149
157
|
emit("update:modelValue", value);
|
|
150
158
|
break;
|
|
@@ -131,6 +131,8 @@ export default defineComponent({
|
|
|
131
131
|
return props.modelValue === "true";
|
|
132
132
|
case MagicFieldType.TimeStepField:
|
|
133
133
|
return JSON.parse(props.modelValue);
|
|
134
|
+
case MagicFieldType.PlotPerField:
|
|
135
|
+
return parseInt(props.modelValue);
|
|
134
136
|
default:
|
|
135
137
|
return props.modelValue;
|
|
136
138
|
}
|
|
@@ -146,9 +148,9 @@ export default defineComponent({
|
|
|
146
148
|
return value.toString();
|
|
147
149
|
case MagicFieldType.Switch:
|
|
148
150
|
if (value) {
|
|
149
|
-
return $tr("
|
|
151
|
+
return $tr("magic-field.true", "True");
|
|
150
152
|
}
|
|
151
|
-
return $tr("
|
|
153
|
+
return $tr("magic-field.false", "False");
|
|
152
154
|
case MagicFieldType.DateTimeField:
|
|
153
155
|
return epochToShortTimeFormat(parseFloat(value));
|
|
154
156
|
case MagicFieldType.TimeField:
|
|
@@ -175,6 +177,9 @@ export default defineComponent({
|
|
|
175
177
|
case MagicFieldType.TimeStepField:
|
|
176
178
|
emit("update:modelValue", JSON.stringify(value));
|
|
177
179
|
break;
|
|
180
|
+
case MagicFieldType.PlotPerField:
|
|
181
|
+
emit("update:modelValue", value.toString());
|
|
182
|
+
break;
|
|
178
183
|
default:
|
|
179
184
|
emit("update:modelValue", value);
|
|
180
185
|
break;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSTextField
|
|
3
3
|
class="fs-number-field"
|
|
4
|
-
|
|
4
|
+
minWidth="80px"
|
|
5
|
+
:disabled="$props.disabled"
|
|
5
6
|
:modelValue="$props.modelValue?.toString()"
|
|
6
7
|
@update:modelValue="onUpdate"
|
|
7
8
|
v-bind="$attrs"
|
|
@@ -34,18 +35,22 @@ export default defineComponent({
|
|
|
34
35
|
required: false,
|
|
35
36
|
default: null
|
|
36
37
|
},
|
|
37
|
-
|
|
38
|
+
disabled: {
|
|
38
39
|
type: Boolean,
|
|
39
40
|
required: false,
|
|
40
|
-
default:
|
|
41
|
+
default: false
|
|
41
42
|
}
|
|
42
43
|
},
|
|
43
44
|
emits: ["update:modelValue"],
|
|
44
45
|
setup(_, { emit }) {
|
|
45
|
-
const onUpdate = (value: string) => {
|
|
46
|
+
const onUpdate = (value: string | null | undefined) => {
|
|
46
47
|
if (value === "-") {
|
|
47
48
|
return;
|
|
48
49
|
}
|
|
50
|
+
if(value === null || value === undefined) {
|
|
51
|
+
emit("update:modelValue", null);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
49
54
|
const match = /[-]?([0-9 ]*[,.]?)?[0-9]*/.exec(value);
|
|
50
55
|
if (match != null && !isNaN(parseFloat(match[0].replace(",", ".").replace(" ", "")))) {
|
|
51
56
|
emit("update:modelValue", parseFloat(match[0].replace(",", ".").replace(" ", "")));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSTextField
|
|
3
3
|
:type="type"
|
|
4
|
-
:
|
|
4
|
+
:disabled="$props.disabled"
|
|
5
5
|
:modelValue="$props.modelValue"
|
|
6
6
|
@update:modelValue="$emit('update:modelValue', $event)"
|
|
7
7
|
v-bind="$attrs"
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
>
|
|
21
21
|
<FSButton
|
|
22
22
|
variant="icon"
|
|
23
|
-
:
|
|
23
|
+
:disabled="$props.disabled"
|
|
24
24
|
:color="ColorEnum.Dark"
|
|
25
25
|
:icon="icon"
|
|
26
26
|
@click="onToggle"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
</template>
|
|
34
34
|
|
|
35
35
|
<script lang="ts">
|
|
36
|
-
import { computed, defineComponent, type PropType,
|
|
36
|
+
import { computed, defineComponent, ref, type PropType, type StyleValue } from "vue";
|
|
37
37
|
|
|
38
38
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
39
39
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
@@ -53,10 +53,10 @@ export default defineComponent({
|
|
|
53
53
|
required: false,
|
|
54
54
|
default: null
|
|
55
55
|
},
|
|
56
|
-
|
|
56
|
+
disabled: {
|
|
57
57
|
type: Boolean,
|
|
58
58
|
required: false,
|
|
59
|
-
default:
|
|
59
|
+
default: false
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
emits: ["update:modelValue"],
|
|
@@ -69,7 +69,7 @@ export default defineComponent({
|
|
|
69
69
|
const stars = ref(true);
|
|
70
70
|
|
|
71
71
|
const style = computed((): StyleValue => {
|
|
72
|
-
if (
|
|
72
|
+
if (props.disabled) {
|
|
73
73
|
return {
|
|
74
74
|
"--fs-password-field-cursor" : "default",
|
|
75
75
|
"--fs-password-field-color": lights.dark,
|
|
@@ -88,7 +88,7 @@ export default defineComponent({
|
|
|
88
88
|
const icon = computed((): string => stars.value ? "mdi-eye-off-outline" : "mdi-eye-outline");
|
|
89
89
|
|
|
90
90
|
const onToggle = (): void => {
|
|
91
|
-
if (
|
|
91
|
+
if (props.disabled) {
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
94
94
|
stars.value = !stars.value;
|
|
@@ -29,9 +29,10 @@
|
|
|
29
29
|
</FSSpan>
|
|
30
30
|
</FSRow>
|
|
31
31
|
</slot>
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
<FSRow
|
|
33
|
+
v-if="!$props.disabled"
|
|
34
|
+
align="center-right"
|
|
35
|
+
:wrap="false"
|
|
35
36
|
>
|
|
36
37
|
<FSIcon
|
|
37
38
|
class="fs-rich-text-field-icon"
|
|
@@ -115,7 +116,7 @@
|
|
|
115
116
|
>
|
|
116
117
|
mdi-link
|
|
117
118
|
</FSIcon>
|
|
118
|
-
<
|
|
119
|
+
<FSMenu
|
|
119
120
|
v-if="$props.variableReferences && $props.variableReferences.length > 0"
|
|
120
121
|
:closeOnContentClick="false"
|
|
121
122
|
v-model="menuVariable"
|
|
@@ -140,12 +141,12 @@
|
|
|
140
141
|
<FSAutoCompleteField
|
|
141
142
|
itemTitle="label"
|
|
142
143
|
itemValue="code"
|
|
143
|
-
:placeholder="$tr('
|
|
144
|
+
:placeholder="$tr('rich-text-field.variable-placeholder', 'Choose a variable...')"
|
|
144
145
|
:items="$props.variableReferences"
|
|
145
146
|
@update:modelValue="insertVariable($event)"
|
|
146
147
|
/>
|
|
147
148
|
</FSCard>
|
|
148
|
-
</
|
|
149
|
+
</FSMenu>
|
|
149
150
|
<v-divider
|
|
150
151
|
vertical
|
|
151
152
|
/>
|
|
@@ -177,7 +178,7 @@
|
|
|
177
178
|
>
|
|
178
179
|
mdi-format-align-justify
|
|
179
180
|
</FSIcon>
|
|
180
|
-
</
|
|
181
|
+
</FSRow>
|
|
181
182
|
</FSRow>
|
|
182
183
|
<FSText
|
|
183
184
|
v-if="readonly && !$props.modelValue && $props.emptyLabel"
|
|
@@ -191,8 +192,8 @@
|
|
|
191
192
|
>
|
|
192
193
|
<div
|
|
193
194
|
class="fs-rich-text-field-content"
|
|
194
|
-
:data-variable-values="
|
|
195
|
-
:contenteditable="!readonly &&
|
|
195
|
+
:data-variable-values="variableValues"
|
|
196
|
+
:contenteditable="!readonly && !$props.disabled && !loading"
|
|
196
197
|
:data-readonly="$props.variant === 'readonly'"
|
|
197
198
|
:id="id"
|
|
198
199
|
/>
|
|
@@ -203,7 +204,7 @@
|
|
|
203
204
|
</div>
|
|
204
205
|
|
|
205
206
|
<FSTextField
|
|
206
|
-
v-if="isLink && !readonly &&
|
|
207
|
+
v-if="isLink && !readonly && !$props.disabled"
|
|
207
208
|
:hideHeader="true"
|
|
208
209
|
@keypress.enter.stop="toggleLink"
|
|
209
210
|
v-model="linkUrl"
|
|
@@ -214,7 +215,8 @@
|
|
|
214
215
|
<FSSpan
|
|
215
216
|
v-if="!readonly && $props.description"
|
|
216
217
|
class="fs-rich-text-field-description"
|
|
217
|
-
font="text-
|
|
218
|
+
font="text-overline"
|
|
219
|
+
:lineClamp="2"
|
|
218
220
|
:style="style"
|
|
219
221
|
>
|
|
220
222
|
{{ $props.description }}
|
|
@@ -244,6 +246,7 @@ import FSTextField from "./FSTextField.vue";
|
|
|
244
246
|
import FSIcon from "../FSIcon.vue";
|
|
245
247
|
import FSCard from "../FSCard.vue";
|
|
246
248
|
import FSText from "../FSText.vue";
|
|
249
|
+
import FSMenu from '../FSMenu.vue';
|
|
247
250
|
import FSCol from "../FSCol.vue";
|
|
248
251
|
import FSRow from "../FSRow.vue";
|
|
249
252
|
|
|
@@ -255,6 +258,7 @@ export default defineComponent({
|
|
|
255
258
|
FSText,
|
|
256
259
|
FSIcon,
|
|
257
260
|
FSCard,
|
|
261
|
+
FSMenu,
|
|
258
262
|
FSCol,
|
|
259
263
|
FSRow
|
|
260
264
|
},
|
|
@@ -275,7 +279,7 @@ export default defineComponent({
|
|
|
275
279
|
default: null
|
|
276
280
|
},
|
|
277
281
|
modelValue: {
|
|
278
|
-
type: String as PropType<string | null>,
|
|
282
|
+
type: [Object, String] as PropType<{ [key: string]: any } | string | null>,
|
|
279
283
|
required: false,
|
|
280
284
|
default: null
|
|
281
285
|
},
|
|
@@ -308,21 +312,22 @@ export default defineComponent({
|
|
|
308
312
|
required: false,
|
|
309
313
|
default: () => ({})
|
|
310
314
|
},
|
|
311
|
-
|
|
315
|
+
disabled: {
|
|
312
316
|
type: Boolean,
|
|
313
317
|
required: false,
|
|
314
|
-
default:
|
|
318
|
+
default: false
|
|
315
319
|
}
|
|
316
320
|
},
|
|
317
321
|
emits: ["update:modelValue"],
|
|
318
322
|
setup(props, { emit }) {
|
|
319
|
-
const { isMobileSized } = useBreakpoints();
|
|
323
|
+
const { fontStyles, isMobileSized } = useBreakpoints();
|
|
320
324
|
const { getColors } = useColors();
|
|
321
325
|
|
|
322
326
|
const linkColors = computed(() => getColors(props.linkColor));
|
|
323
327
|
const lights = getColors(ColorEnum.Light);
|
|
324
328
|
const darks = getColors(ColorEnum.Dark);
|
|
325
329
|
|
|
330
|
+
const loading = ref(true);
|
|
326
331
|
const canUndo = ref(false);
|
|
327
332
|
const isLink = ref(false);
|
|
328
333
|
const isBold = ref(false);
|
|
@@ -375,16 +380,8 @@ export default defineComponent({
|
|
|
375
380
|
registerRichText(editor);
|
|
376
381
|
registerHistory(editor, createEmptyHistoryState(), 250);
|
|
377
382
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
editor.setEditorState(editor.parseEditorState(props.modelValue!));
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
else {
|
|
384
|
-
editor.update((): void => {
|
|
385
|
-
editor.setEditorState(editor.parseEditorState(emptyLexicalState));
|
|
386
|
-
});
|
|
387
|
-
}
|
|
383
|
+
updateEditorState();
|
|
384
|
+
loading.value = false;
|
|
388
385
|
});
|
|
389
386
|
|
|
390
387
|
const readonly = computed((): boolean => {
|
|
@@ -405,37 +402,43 @@ export default defineComponent({
|
|
|
405
402
|
}
|
|
406
403
|
switch (props.variant) {
|
|
407
404
|
case "standard": {
|
|
408
|
-
if (
|
|
405
|
+
if (props.disabled) {
|
|
409
406
|
return {
|
|
410
|
-
"--fs-rich-text-field-undo-cursor": "default",
|
|
411
|
-
"--fs-rich-text-field-icon-cursor": "default",
|
|
412
|
-
"--fs-rich-text-field-border-color": lights.base,
|
|
413
|
-
"--fs-rich-text-field-color": lights.dark,
|
|
407
|
+
"--fs-rich-text-field-undo-cursor" : "default",
|
|
408
|
+
"--fs-rich-text-field-icon-cursor" : "default",
|
|
409
|
+
"--fs-rich-text-field-border-color" : lights.base,
|
|
410
|
+
"--fs-rich-text-field-color" : lights.dark,
|
|
414
411
|
"--fs-rich-text-field-active-border-color": lights.base,
|
|
415
|
-
"--fs-rich-text-field-link-color": linkColors.value.light,
|
|
416
|
-
"--fs-rich-text-field-min-height": minHeight
|
|
412
|
+
"--fs-rich-text-field-link-color" : linkColors.value.light,
|
|
413
|
+
"--fs-rich-text-field-min-height" : minHeight,
|
|
414
|
+
"--fs-rich-text-field-padding" : isMobileSized.value ? "6px 16px" : "10px 12px",
|
|
415
|
+
...fontStyles.value
|
|
417
416
|
};
|
|
418
417
|
}
|
|
419
418
|
else {
|
|
420
419
|
return {
|
|
421
|
-
"--fs-rich-text-field-undo-cursor": canUndo.value ? "pointer" : "default",
|
|
422
|
-
"--fs-rich-text-field-icon-cursor": "pointer",
|
|
423
|
-
"--fs-rich-text-field-border-color": lights.dark,
|
|
424
|
-
"--fs-rich-text-field-color": darks.base,
|
|
425
|
-
"--fs-rich-text-field-active-border-color": darks.dark,
|
|
426
|
-
"--fs-rich-text-field-link-color": linkColors.value.dark,
|
|
427
|
-
"--fs-rich-text-field-min-height": minHeight,
|
|
420
|
+
"--fs-rich-text-field-undo-cursor" : canUndo.value ? "pointer" : "default",
|
|
421
|
+
"--fs-rich-text-field-icon-cursor" : "pointer",
|
|
422
|
+
"--fs-rich-text-field-border-color" : lights.dark,
|
|
423
|
+
"--fs-rich-text-field-color" : darks.base,
|
|
424
|
+
"--fs-rich-text-field-active-border-color" : darks.dark,
|
|
425
|
+
"--fs-rich-text-field-link-color" : linkColors.value.dark,
|
|
426
|
+
"--fs-rich-text-field-min-height" : minHeight,
|
|
428
427
|
"--fs-rich-text-field-variable-backgroundcolor": getColors(ColorEnum.Primary).light,
|
|
429
|
-
"--fs-rich-text-field-variable-color": getColors(ColorEnum.Primary).lightContrast
|
|
428
|
+
"--fs-rich-text-field-variable-color" : getColors(ColorEnum.Primary).lightContrast!,
|
|
429
|
+
"--fs-rich-text-field-padding" : isMobileSized.value ? "6px 16px" : "10px 12px",
|
|
430
|
+
...fontStyles.value
|
|
430
431
|
};
|
|
431
432
|
}
|
|
432
433
|
}
|
|
433
434
|
case "readonly": return {
|
|
434
|
-
"--fs-rich-text-field-border-color": "transparent",
|
|
435
|
-
"--fs-rich-text-field-color": darks.base,
|
|
435
|
+
"--fs-rich-text-field-border-color" : "transparent",
|
|
436
|
+
"--fs-rich-text-field-color" : darks.base,
|
|
436
437
|
"--fs-rich-text-field-active-border-color": "transparent",
|
|
437
|
-
"--fs-rich-text-field-link-color": linkColors.value.dark,
|
|
438
|
-
"--fs-rich-text-field-min-height": minHeight
|
|
438
|
+
"--fs-rich-text-field-link-color" : linkColors.value.dark,
|
|
439
|
+
"--fs-rich-text-field-min-height" : minHeight,
|
|
440
|
+
"--fs-rich-text-field-padding" : "0",
|
|
441
|
+
...fontStyles.value
|
|
439
442
|
}
|
|
440
443
|
}
|
|
441
444
|
});
|
|
@@ -449,7 +452,7 @@ export default defineComponent({
|
|
|
449
452
|
});
|
|
450
453
|
|
|
451
454
|
const toolbarColors = computed((): { [code: string]: string } => {
|
|
452
|
-
if (props.
|
|
455
|
+
if (!props.disabled) {
|
|
453
456
|
return {
|
|
454
457
|
undo: canUndo.value ? darks.base : lights.base,
|
|
455
458
|
bold: isBold.value ? darks.base : lights.base,
|
|
@@ -472,6 +475,10 @@ export default defineComponent({
|
|
|
472
475
|
}
|
|
473
476
|
});
|
|
474
477
|
|
|
478
|
+
const variableValues = computed(() => {
|
|
479
|
+
return JSON.stringify(props.variableValues)
|
|
480
|
+
});
|
|
481
|
+
|
|
475
482
|
const updateToolbar = (): void => {
|
|
476
483
|
const selection = $getSelection();
|
|
477
484
|
isVariable.value = false;
|
|
@@ -492,11 +499,16 @@ export default defineComponent({
|
|
|
492
499
|
editor.registerUpdateListener(({ editorState }) => {
|
|
493
500
|
editorState.read(() => {
|
|
494
501
|
updateToolbar();
|
|
495
|
-
if
|
|
496
|
-
|
|
502
|
+
if(loading.value) {
|
|
503
|
+
return;
|
|
497
504
|
}
|
|
498
|
-
|
|
505
|
+
const editorModelValue = JSON.stringify(editorState.toJSON());
|
|
506
|
+
if(editorModelValue === emptyLexicalState && props.modelValue !== null) {
|
|
499
507
|
emit("update:modelValue", null);
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
if(editorModelValue !== emptyLexicalState && editorModelValue !== props.modelValue) {
|
|
511
|
+
emit("update:modelValue", editorModelValue);
|
|
500
512
|
}
|
|
501
513
|
});
|
|
502
514
|
});
|
|
@@ -659,24 +671,31 @@ export default defineComponent({
|
|
|
659
671
|
isLink.value = false;
|
|
660
672
|
}
|
|
661
673
|
|
|
662
|
-
|
|
663
|
-
if (JSON.stringify(editor.getEditorState().toJSON())
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
674
|
+
const updateEditorState = () => {
|
|
675
|
+
if (JSON.stringify(editor.getEditorState().toJSON()) === props.modelValue) {
|
|
676
|
+
return;
|
|
677
|
+
}
|
|
678
|
+
if (props.modelValue != null) {
|
|
679
|
+
if (typeof props.modelValue === "string" && props.modelValue !== "") {
|
|
680
|
+
editor.setEditorState(editor.parseEditorState(props.modelValue!));
|
|
681
|
+
return;
|
|
668
682
|
}
|
|
669
|
-
|
|
670
|
-
editor.
|
|
671
|
-
|
|
672
|
-
});
|
|
683
|
+
if (typeof props.modelValue === "object") {
|
|
684
|
+
editor.setEditorState(editor.parseEditorState(JSON.stringify(props.modelValue)));
|
|
685
|
+
return;
|
|
673
686
|
}
|
|
674
687
|
}
|
|
688
|
+
editor.setEditorState(editor.parseEditorState(emptyLexicalState));
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
watch(() => props.modelValue, () => {
|
|
692
|
+
updateEditorState();
|
|
675
693
|
});
|
|
676
694
|
|
|
677
695
|
return {
|
|
678
696
|
FORMAT_ELEMENT_COMMAND,
|
|
679
697
|
FORMAT_TEXT_COMMAND,
|
|
698
|
+
variableValues,
|
|
680
699
|
toolbarColors,
|
|
681
700
|
menuVariable,
|
|
682
701
|
UNDO_COMMAND,
|
|
@@ -684,6 +703,7 @@ export default defineComponent({
|
|
|
684
703
|
readonly,
|
|
685
704
|
linkUrl,
|
|
686
705
|
classes,
|
|
706
|
+
loading,
|
|
687
707
|
isEmpty,
|
|
688
708
|
editor,
|
|
689
709
|
isLink,
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSTextField
|
|
3
3
|
class="fs-search-field"
|
|
4
|
-
:editable="$props.editable"
|
|
5
4
|
:placeholder="placeholder"
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
:modelValue="$props.modelValue"
|
|
6
|
+
prependInnerIcon="mdi-magnify"
|
|
7
|
+
minWidth="200px"
|
|
8
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
8
9
|
v-bind="$attrs"
|
|
9
10
|
>
|
|
10
11
|
<template
|
|
11
|
-
v-for="(_, name) in slots"
|
|
12
|
+
v-for="(_, name) in $slots"
|
|
12
13
|
v-slot:[name]="slotData"
|
|
13
14
|
>
|
|
14
15
|
<slot
|
|
@@ -16,60 +17,20 @@
|
|
|
16
17
|
v-bind="slotData"
|
|
17
18
|
/>
|
|
18
19
|
</template>
|
|
19
|
-
<template
|
|
20
|
-
v-if="$props.prependInnerIcon || $slots['prepend-inner']"
|
|
21
|
-
#prepend-inner
|
|
22
|
-
>
|
|
23
|
-
<FSButton
|
|
24
|
-
v-if="$props.prependInnerIcon"
|
|
25
|
-
variant="icon"
|
|
26
|
-
:icon="$props.prependInnerIcon"
|
|
27
|
-
:editable="$props.editable"
|
|
28
|
-
:color="ColorEnum.Dark"
|
|
29
|
-
@click="onSearch"
|
|
30
|
-
/>
|
|
31
|
-
<slot
|
|
32
|
-
name="prepend-inner"
|
|
33
|
-
/>
|
|
34
|
-
</template>
|
|
35
|
-
<template
|
|
36
|
-
v-if="$props.variant !== 'instant' || $slots.append"
|
|
37
|
-
#append
|
|
38
|
-
>
|
|
39
|
-
<FSButton
|
|
40
|
-
v-if="$props.variant !== 'instant'"
|
|
41
|
-
:prependIcon="$props.buttonPrependIcon"
|
|
42
|
-
:label="buttonLabel"
|
|
43
|
-
:appendIcon="$props.buttonAppendIcon"
|
|
44
|
-
:variant="$props.buttonVariant"
|
|
45
|
-
:color="$props.buttonColor"
|
|
46
|
-
:editable="$props.editable"
|
|
47
|
-
@click="onSearch"
|
|
48
|
-
/>
|
|
49
|
-
<slot
|
|
50
|
-
name="append"
|
|
51
|
-
/>
|
|
52
|
-
</template>
|
|
53
20
|
</FSTextField>
|
|
54
21
|
</template>
|
|
55
22
|
|
|
56
23
|
<script lang="ts">
|
|
57
|
-
import type
|
|
58
|
-
import { computed, defineComponent, ref, watch } from "vue";
|
|
24
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
59
25
|
|
|
60
26
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
61
|
-
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
62
|
-
|
|
63
|
-
import { useSlots } from "../../composables";
|
|
64
27
|
|
|
65
28
|
import FSTextField from "./FSTextField.vue";
|
|
66
|
-
import FSButton from "../FSButton.vue";
|
|
67
29
|
|
|
68
30
|
export default defineComponent({
|
|
69
31
|
name: "FSSearchField",
|
|
70
32
|
components: {
|
|
71
|
-
FSTextField
|
|
72
|
-
FSButton
|
|
33
|
+
FSTextField
|
|
73
34
|
},
|
|
74
35
|
props: {
|
|
75
36
|
placeholder: {
|
|
@@ -77,89 +38,22 @@ export default defineComponent({
|
|
|
77
38
|
required: false,
|
|
78
39
|
default: null
|
|
79
40
|
},
|
|
80
|
-
prependInnerIcon: {
|
|
81
|
-
type: String as PropType<string | null>,
|
|
82
|
-
required: false,
|
|
83
|
-
default: "mdi-magnify"
|
|
84
|
-
},
|
|
85
|
-
variant: {
|
|
86
|
-
type: String as PropType<"standard" | "instant">,
|
|
87
|
-
required: false,
|
|
88
|
-
default: "instant"
|
|
89
|
-
},
|
|
90
|
-
buttonPrependIcon: {
|
|
91
|
-
type: String as PropType<string | null>,
|
|
92
|
-
required: false,
|
|
93
|
-
default: null
|
|
94
|
-
},
|
|
95
|
-
buttonLabel: {
|
|
96
|
-
type: String as PropType<string | null>,
|
|
97
|
-
required: false,
|
|
98
|
-
default: null
|
|
99
|
-
},
|
|
100
|
-
buttonAppendIcon: {
|
|
101
|
-
type: String as PropType<string | null>,
|
|
102
|
-
required: false,
|
|
103
|
-
default: null
|
|
104
|
-
},
|
|
105
|
-
buttonVariant: {
|
|
106
|
-
type: String as PropType<"standard" | "full" | "icon">,
|
|
107
|
-
required: false,
|
|
108
|
-
default: "standard"
|
|
109
|
-
},
|
|
110
41
|
modelValue: {
|
|
111
42
|
type: String as PropType<string | null>,
|
|
112
43
|
required: false,
|
|
113
44
|
default: null
|
|
114
|
-
},
|
|
115
|
-
buttonColor: {
|
|
116
|
-
type: String as PropType<ColorBase>,
|
|
117
|
-
required: false,
|
|
118
|
-
default: ColorEnum.Primary
|
|
119
|
-
},
|
|
120
|
-
editable: {
|
|
121
|
-
type: Boolean,
|
|
122
|
-
required: false,
|
|
123
|
-
default: true
|
|
124
45
|
}
|
|
125
46
|
},
|
|
126
47
|
emits: ["update:modelValue"],
|
|
127
|
-
setup(props
|
|
48
|
+
setup(props) {
|
|
128
49
|
const { $tr } = useTranslationsProvider();
|
|
129
|
-
const { slots } = useSlots();
|
|
130
|
-
|
|
131
|
-
delete slots["prepend-inner"];
|
|
132
|
-
delete slots.append;
|
|
133
|
-
|
|
134
|
-
const innerValue = ref(props.modelValue);
|
|
135
50
|
|
|
136
51
|
const placeholder = computed(() => {
|
|
137
|
-
return props.placeholder ?? $tr('
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
const buttonLabel = computed(() => {
|
|
141
|
-
return props.buttonLabel ?? $tr('ui.button.search', 'Search');
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
const onSearch = (event: Event) => {
|
|
145
|
-
event.stopImmediatePropagation();
|
|
146
|
-
event.preventDefault();
|
|
147
|
-
emit('update:modelValue', innerValue.value);
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
watch(innerValue, () => {
|
|
151
|
-
if (["instant"].includes(props.variant)) {
|
|
152
|
-
emit("update:modelValue", innerValue.value);
|
|
153
|
-
}
|
|
52
|
+
return props.placeholder ?? $tr('search-field.placeholder', 'Search...');
|
|
154
53
|
});
|
|
155
54
|
|
|
156
55
|
return {
|
|
157
56
|
placeholder,
|
|
158
|
-
buttonLabel,
|
|
159
|
-
innerValue,
|
|
160
|
-
ColorEnum,
|
|
161
|
-
slots,
|
|
162
|
-
onSearch
|
|
163
57
|
};
|
|
164
58
|
}
|
|
165
59
|
});
|