@dative-gpi/foundation-shared-components 1.0.26 → 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 +34 -19
- 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
|
@@ -29,9 +29,10 @@
|
|
|
29
29
|
</FSSpan>
|
|
30
30
|
</FSRow>
|
|
31
31
|
</slot>
|
|
32
|
-
<
|
|
33
|
-
<template
|
|
32
|
+
<FSRow
|
|
34
33
|
v-if="$props.editable"
|
|
34
|
+
align="center-right"
|
|
35
|
+
:wrap="false"
|
|
35
36
|
>
|
|
36
37
|
<FSIcon
|
|
37
38
|
class="fs-rich-text-field-icon"
|
|
@@ -140,7 +141,7 @@
|
|
|
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
|
/>
|
|
@@ -177,16 +178,22 @@
|
|
|
177
178
|
>
|
|
178
179
|
mdi-format-align-justify
|
|
179
180
|
</FSIcon>
|
|
180
|
-
</
|
|
181
|
+
</FSRow>
|
|
181
182
|
</FSRow>
|
|
183
|
+
<FSText
|
|
184
|
+
v-if="readonly && !$props.modelValue && $props.emptyLabel"
|
|
185
|
+
variant="soft"
|
|
186
|
+
>
|
|
187
|
+
{{ $props.emptyLabel }}
|
|
188
|
+
</FSText>
|
|
182
189
|
<div
|
|
183
|
-
class="
|
|
190
|
+
:class="classes"
|
|
184
191
|
:style="style"
|
|
185
192
|
>
|
|
186
193
|
<div
|
|
187
194
|
class="fs-rich-text-field-content"
|
|
188
|
-
:data-variable-values="
|
|
189
|
-
:contenteditable="!readonly && $props.editable"
|
|
195
|
+
:data-variable-values="variableValues"
|
|
196
|
+
:contenteditable="!readonly && $props.editable && !loading"
|
|
190
197
|
:data-readonly="$props.variant === 'readonly'"
|
|
191
198
|
:id="id"
|
|
192
199
|
/>
|
|
@@ -237,6 +244,7 @@ import FSAutoCompleteField from "./FSAutocompleteField.vue";
|
|
|
237
244
|
import FSTextField from "./FSTextField.vue";
|
|
238
245
|
import FSIcon from "../FSIcon.vue";
|
|
239
246
|
import FSCard from "../FSCard.vue";
|
|
247
|
+
import FSText from "../FSText.vue";
|
|
240
248
|
import FSCol from "../FSCol.vue";
|
|
241
249
|
import FSRow from "../FSRow.vue";
|
|
242
250
|
|
|
@@ -245,6 +253,7 @@ export default defineComponent({
|
|
|
245
253
|
components: {
|
|
246
254
|
FSAutoCompleteField,
|
|
247
255
|
FSTextField,
|
|
256
|
+
FSText,
|
|
248
257
|
FSIcon,
|
|
249
258
|
FSCard,
|
|
250
259
|
FSCol,
|
|
@@ -261,11 +270,16 @@ export default defineComponent({
|
|
|
261
270
|
required: false,
|
|
262
271
|
default: null
|
|
263
272
|
},
|
|
264
|
-
|
|
273
|
+
emptyLabel: {
|
|
265
274
|
type: String as PropType<string | null>,
|
|
266
275
|
required: false,
|
|
267
276
|
default: null
|
|
268
277
|
},
|
|
278
|
+
modelValue: {
|
|
279
|
+
type: [Object, String] as PropType<{ [key: string]: any } | string | null>,
|
|
280
|
+
required: false,
|
|
281
|
+
default: null
|
|
282
|
+
},
|
|
269
283
|
linkColor: {
|
|
270
284
|
type: String as PropType<ColorBase>,
|
|
271
285
|
required: false,
|
|
@@ -303,13 +317,14 @@ export default defineComponent({
|
|
|
303
317
|
},
|
|
304
318
|
emits: ["update:modelValue"],
|
|
305
319
|
setup(props, { emit }) {
|
|
306
|
-
const { isMobileSized } = useBreakpoints();
|
|
320
|
+
const { fontStyles, isMobileSized } = useBreakpoints();
|
|
307
321
|
const { getColors } = useColors();
|
|
308
322
|
|
|
309
323
|
const linkColors = computed(() => getColors(props.linkColor));
|
|
310
324
|
const lights = getColors(ColorEnum.Light);
|
|
311
325
|
const darks = getColors(ColorEnum.Dark);
|
|
312
326
|
|
|
327
|
+
const loading = ref(true);
|
|
313
328
|
const canUndo = ref(false);
|
|
314
329
|
const isLink = ref(false);
|
|
315
330
|
const isBold = ref(false);
|
|
@@ -350,6 +365,10 @@ export default defineComponent({
|
|
|
350
365
|
onError: console.error
|
|
351
366
|
}
|
|
352
367
|
|
|
368
|
+
const isEmpty = computed((): boolean => {
|
|
369
|
+
return editor.getEditorState().isEmpty();
|
|
370
|
+
});
|
|
371
|
+
|
|
353
372
|
const editor = createEditor(config);
|
|
354
373
|
|
|
355
374
|
onMounted((): void => {
|
|
@@ -358,16 +377,8 @@ export default defineComponent({
|
|
|
358
377
|
registerRichText(editor);
|
|
359
378
|
registerHistory(editor, createEmptyHistoryState(), 250);
|
|
360
379
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
editor.setEditorState(editor.parseEditorState(props.modelValue!));
|
|
364
|
-
});
|
|
365
|
-
}
|
|
366
|
-
else {
|
|
367
|
-
editor.update((): void => {
|
|
368
|
-
editor.setEditorState(editor.parseEditorState(emptyLexicalState));
|
|
369
|
-
});
|
|
370
|
-
}
|
|
380
|
+
updateEditorState();
|
|
381
|
+
loading.value = false;
|
|
371
382
|
});
|
|
372
383
|
|
|
373
384
|
const readonly = computed((): boolean => {
|
|
@@ -390,39 +401,53 @@ export default defineComponent({
|
|
|
390
401
|
case "standard": {
|
|
391
402
|
if (!props.editable) {
|
|
392
403
|
return {
|
|
393
|
-
"--fs-rich-text-field-undo-cursor": "default",
|
|
394
|
-
"--fs-rich-text-field-icon-cursor": "default",
|
|
395
|
-
"--fs-rich-text-field-border-color": lights.base,
|
|
396
|
-
"--fs-rich-text-field-color": lights.dark,
|
|
404
|
+
"--fs-rich-text-field-undo-cursor" : "default",
|
|
405
|
+
"--fs-rich-text-field-icon-cursor" : "default",
|
|
406
|
+
"--fs-rich-text-field-border-color" : lights.base,
|
|
407
|
+
"--fs-rich-text-field-color" : lights.dark,
|
|
397
408
|
"--fs-rich-text-field-active-border-color": lights.base,
|
|
398
|
-
"--fs-rich-text-field-link-color": linkColors.value.light,
|
|
399
|
-
"--fs-rich-text-field-min-height": minHeight
|
|
409
|
+
"--fs-rich-text-field-link-color" : linkColors.value.light,
|
|
410
|
+
"--fs-rich-text-field-min-height" : minHeight,
|
|
411
|
+
"--fs-rich-text-field-padding" : isMobileSized.value ? "6px 16px" : "10px 12px",
|
|
412
|
+
...fontStyles.value
|
|
400
413
|
};
|
|
401
414
|
}
|
|
402
415
|
else {
|
|
403
416
|
return {
|
|
404
|
-
"--fs-rich-text-field-undo-cursor": canUndo.value ? "pointer" : "default",
|
|
405
|
-
"--fs-rich-text-field-icon-cursor": "pointer",
|
|
406
|
-
"--fs-rich-text-field-border-color": lights.dark,
|
|
407
|
-
"--fs-rich-text-field-color": darks.base,
|
|
408
|
-
"--fs-rich-text-field-active-border-color": darks.dark,
|
|
409
|
-
"--fs-rich-text-field-link-color": linkColors.value.dark,
|
|
410
|
-
"--fs-rich-text-field-min-height": minHeight,
|
|
417
|
+
"--fs-rich-text-field-undo-cursor" : canUndo.value ? "pointer" : "default",
|
|
418
|
+
"--fs-rich-text-field-icon-cursor" : "pointer",
|
|
419
|
+
"--fs-rich-text-field-border-color" : lights.dark,
|
|
420
|
+
"--fs-rich-text-field-color" : darks.base,
|
|
421
|
+
"--fs-rich-text-field-active-border-color" : darks.dark,
|
|
422
|
+
"--fs-rich-text-field-link-color" : linkColors.value.dark,
|
|
423
|
+
"--fs-rich-text-field-min-height" : minHeight,
|
|
411
424
|
"--fs-rich-text-field-variable-backgroundcolor": getColors(ColorEnum.Primary).light,
|
|
412
|
-
"--fs-rich-text-field-variable-color": getColors(ColorEnum.Primary).lightContrast
|
|
425
|
+
"--fs-rich-text-field-variable-color" : getColors(ColorEnum.Primary).lightContrast!,
|
|
426
|
+
"--fs-rich-text-field-padding" : isMobileSized.value ? "6px 16px" : "10px 12px",
|
|
427
|
+
...fontStyles.value
|
|
413
428
|
};
|
|
414
429
|
}
|
|
415
430
|
}
|
|
416
431
|
case "readonly": return {
|
|
417
|
-
"--fs-rich-text-field-border-color": "transparent",
|
|
418
|
-
"--fs-rich-text-field-color": darks.base,
|
|
432
|
+
"--fs-rich-text-field-border-color" : "transparent",
|
|
433
|
+
"--fs-rich-text-field-color" : darks.base,
|
|
419
434
|
"--fs-rich-text-field-active-border-color": "transparent",
|
|
420
|
-
"--fs-rich-text-field-link-color": linkColors.value.dark,
|
|
421
|
-
"--fs-rich-text-field-min-height": minHeight
|
|
435
|
+
"--fs-rich-text-field-link-color" : linkColors.value.dark,
|
|
436
|
+
"--fs-rich-text-field-min-height" : minHeight,
|
|
437
|
+
"--fs-rich-text-field-padding" : "0",
|
|
438
|
+
...fontStyles.value
|
|
422
439
|
}
|
|
423
440
|
}
|
|
424
441
|
});
|
|
425
442
|
|
|
443
|
+
const classes = computed((): string[] => {
|
|
444
|
+
const innerClasses = ["fs-rich-text-field"];
|
|
445
|
+
if (!readonly.value) {
|
|
446
|
+
innerClasses.push("fs-rich-text-field-readonly");
|
|
447
|
+
}
|
|
448
|
+
return innerClasses;
|
|
449
|
+
});
|
|
450
|
+
|
|
426
451
|
const toolbarColors = computed((): { [code: string]: string } => {
|
|
427
452
|
if (props.editable) {
|
|
428
453
|
return {
|
|
@@ -447,6 +472,10 @@ export default defineComponent({
|
|
|
447
472
|
}
|
|
448
473
|
});
|
|
449
474
|
|
|
475
|
+
const variableValues = computed(() => {
|
|
476
|
+
return JSON.stringify(props.variableValues)
|
|
477
|
+
});
|
|
478
|
+
|
|
450
479
|
const updateToolbar = (): void => {
|
|
451
480
|
const selection = $getSelection();
|
|
452
481
|
isVariable.value = false;
|
|
@@ -467,11 +496,16 @@ export default defineComponent({
|
|
|
467
496
|
editor.registerUpdateListener(({ editorState }) => {
|
|
468
497
|
editorState.read(() => {
|
|
469
498
|
updateToolbar();
|
|
470
|
-
if
|
|
471
|
-
|
|
499
|
+
if(loading.value) {
|
|
500
|
+
return;
|
|
472
501
|
}
|
|
473
|
-
|
|
502
|
+
const editorModelValue = JSON.stringify(editorState.toJSON());
|
|
503
|
+
if(editorModelValue === emptyLexicalState) {
|
|
474
504
|
emit("update:modelValue", null);
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
if(editorModelValue !== props.modelValue) {
|
|
508
|
+
emit("update:modelValue", editorModelValue);
|
|
475
509
|
}
|
|
476
510
|
});
|
|
477
511
|
});
|
|
@@ -634,29 +668,45 @@ export default defineComponent({
|
|
|
634
668
|
isLink.value = false;
|
|
635
669
|
}
|
|
636
670
|
|
|
637
|
-
|
|
638
|
-
if (JSON.stringify(editor.getEditorState().toJSON())
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
}
|
|
648
|
-
|
|
671
|
+
const updateEditorState = () => {
|
|
672
|
+
if (JSON.stringify(editor.getEditorState().toJSON()) === props.modelValue) {
|
|
673
|
+
return;
|
|
674
|
+
}
|
|
675
|
+
if (props.modelValue != null) {
|
|
676
|
+
editor.update(() => {
|
|
677
|
+
if (typeof props.modelValue === "string") {
|
|
678
|
+
if (props.modelValue !== "") {
|
|
679
|
+
editor.setEditorState(editor.parseEditorState(props.modelValue!));
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
else {
|
|
683
|
+
editor.setEditorState(editor.parseEditorState(JSON.stringify(props.modelValue)));
|
|
684
|
+
}
|
|
685
|
+
});
|
|
686
|
+
return;
|
|
649
687
|
}
|
|
688
|
+
editor.update(() => {
|
|
689
|
+
editor.setEditorState(editor.parseEditorState(emptyLexicalState));
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
watch(() => props.modelValue, () => {
|
|
694
|
+
updateEditorState();
|
|
650
695
|
});
|
|
651
696
|
|
|
652
697
|
return {
|
|
653
698
|
FORMAT_ELEMENT_COMMAND,
|
|
654
699
|
FORMAT_TEXT_COMMAND,
|
|
700
|
+
variableValues,
|
|
655
701
|
toolbarColors,
|
|
656
702
|
menuVariable,
|
|
657
703
|
UNDO_COMMAND,
|
|
704
|
+
ColorEnum,
|
|
658
705
|
readonly,
|
|
659
706
|
linkUrl,
|
|
707
|
+
classes,
|
|
708
|
+
loading,
|
|
709
|
+
isEmpty,
|
|
660
710
|
editor,
|
|
661
711
|
isLink,
|
|
662
712
|
style,
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSTextField
|
|
3
|
-
|
|
3
|
+
class="fs-search-field"
|
|
4
4
|
:placeholder="placeholder"
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
:modelValue="$props.modelValue"
|
|
6
|
+
prependInnerIcon="mdi-magnify"
|
|
7
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
7
8
|
v-bind="$attrs"
|
|
8
9
|
>
|
|
9
10
|
<template
|
|
10
|
-
v-for="(_, name) in slots"
|
|
11
|
+
v-for="(_, name) in $slots"
|
|
11
12
|
v-slot:[name]="slotData"
|
|
12
13
|
>
|
|
13
14
|
<slot
|
|
@@ -15,60 +16,20 @@
|
|
|
15
16
|
v-bind="slotData"
|
|
16
17
|
/>
|
|
17
18
|
</template>
|
|
18
|
-
<template
|
|
19
|
-
v-if="$props.prependInnerIcon || $slots['prepend-inner']"
|
|
20
|
-
#prepend-inner
|
|
21
|
-
>
|
|
22
|
-
<FSButton
|
|
23
|
-
v-if="$props.prependInnerIcon"
|
|
24
|
-
variant="icon"
|
|
25
|
-
:icon="$props.prependInnerIcon"
|
|
26
|
-
:editable="$props.editable"
|
|
27
|
-
:color="ColorEnum.Dark"
|
|
28
|
-
@click="onSearch"
|
|
29
|
-
/>
|
|
30
|
-
<slot
|
|
31
|
-
name="prepend-inner"
|
|
32
|
-
/>
|
|
33
|
-
</template>
|
|
34
|
-
<template
|
|
35
|
-
v-if="$props.variant !== 'instant' || $slots.append"
|
|
36
|
-
#append
|
|
37
|
-
>
|
|
38
|
-
<FSButton
|
|
39
|
-
v-if="$props.variant !== 'instant'"
|
|
40
|
-
:prependIcon="$props.buttonPrependIcon"
|
|
41
|
-
:label="buttonLabel"
|
|
42
|
-
:appendIcon="$props.buttonAppendIcon"
|
|
43
|
-
:variant="$props.buttonVariant"
|
|
44
|
-
:color="$props.buttonColor"
|
|
45
|
-
:editable="$props.editable"
|
|
46
|
-
@click="onSearch"
|
|
47
|
-
/>
|
|
48
|
-
<slot
|
|
49
|
-
name="append"
|
|
50
|
-
/>
|
|
51
|
-
</template>
|
|
52
19
|
</FSTextField>
|
|
53
20
|
</template>
|
|
54
21
|
|
|
55
22
|
<script lang="ts">
|
|
56
|
-
import type
|
|
57
|
-
import { computed, defineComponent, ref, watch } from "vue";
|
|
23
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
58
24
|
|
|
59
25
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
60
|
-
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
61
|
-
|
|
62
|
-
import { useSlots } from "../../composables";
|
|
63
26
|
|
|
64
27
|
import FSTextField from "./FSTextField.vue";
|
|
65
|
-
import FSButton from "../FSButton.vue";
|
|
66
28
|
|
|
67
29
|
export default defineComponent({
|
|
68
30
|
name: "FSSearchField",
|
|
69
31
|
components: {
|
|
70
|
-
FSTextField
|
|
71
|
-
FSButton
|
|
32
|
+
FSTextField
|
|
72
33
|
},
|
|
73
34
|
props: {
|
|
74
35
|
placeholder: {
|
|
@@ -76,89 +37,22 @@ export default defineComponent({
|
|
|
76
37
|
required: false,
|
|
77
38
|
default: null
|
|
78
39
|
},
|
|
79
|
-
prependInnerIcon: {
|
|
80
|
-
type: String as PropType<string | null>,
|
|
81
|
-
required: false,
|
|
82
|
-
default: "mdi-magnify"
|
|
83
|
-
},
|
|
84
|
-
variant: {
|
|
85
|
-
type: String as PropType<"standard" | "instant">,
|
|
86
|
-
required: false,
|
|
87
|
-
default: "instant"
|
|
88
|
-
},
|
|
89
|
-
buttonPrependIcon: {
|
|
90
|
-
type: String as PropType<string | null>,
|
|
91
|
-
required: false,
|
|
92
|
-
default: null
|
|
93
|
-
},
|
|
94
|
-
buttonLabel: {
|
|
95
|
-
type: String as PropType<string | null>,
|
|
96
|
-
required: false,
|
|
97
|
-
default: null
|
|
98
|
-
},
|
|
99
|
-
buttonAppendIcon: {
|
|
100
|
-
type: String as PropType<string | null>,
|
|
101
|
-
required: false,
|
|
102
|
-
default: null
|
|
103
|
-
},
|
|
104
|
-
buttonVariant: {
|
|
105
|
-
type: String as PropType<"standard" | "full" | "icon">,
|
|
106
|
-
required: false,
|
|
107
|
-
default: "standard"
|
|
108
|
-
},
|
|
109
40
|
modelValue: {
|
|
110
41
|
type: String as PropType<string | null>,
|
|
111
42
|
required: false,
|
|
112
43
|
default: null
|
|
113
|
-
},
|
|
114
|
-
buttonColor: {
|
|
115
|
-
type: String as PropType<ColorBase>,
|
|
116
|
-
required: false,
|
|
117
|
-
default: ColorEnum.Primary
|
|
118
|
-
},
|
|
119
|
-
editable: {
|
|
120
|
-
type: Boolean,
|
|
121
|
-
required: false,
|
|
122
|
-
default: true
|
|
123
44
|
}
|
|
124
45
|
},
|
|
125
46
|
emits: ["update:modelValue"],
|
|
126
|
-
setup(props
|
|
47
|
+
setup(props) {
|
|
127
48
|
const { $tr } = useTranslationsProvider();
|
|
128
|
-
const { slots } = useSlots();
|
|
129
|
-
|
|
130
|
-
delete slots["prepend-inner"];
|
|
131
|
-
delete slots.append;
|
|
132
|
-
|
|
133
|
-
const innerValue = ref(props.modelValue);
|
|
134
49
|
|
|
135
50
|
const placeholder = computed(() => {
|
|
136
|
-
return props.placeholder ?? $tr('
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
const buttonLabel = computed(() => {
|
|
140
|
-
return props.buttonLabel ?? $tr('ui.button.search', 'Search');
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
const onSearch = (event: Event) => {
|
|
144
|
-
event.stopImmediatePropagation();
|
|
145
|
-
event.preventDefault();
|
|
146
|
-
emit('update:modelValue', innerValue.value);
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
watch(innerValue, () => {
|
|
150
|
-
if (["instant"].includes(props.variant)) {
|
|
151
|
-
emit("update:modelValue", innerValue.value);
|
|
152
|
-
}
|
|
51
|
+
return props.placeholder ?? $tr('search-field.placeholder', 'Search...');
|
|
153
52
|
});
|
|
154
53
|
|
|
155
54
|
return {
|
|
156
55
|
placeholder,
|
|
157
|
-
buttonLabel,
|
|
158
|
-
innerValue,
|
|
159
|
-
ColorEnum,
|
|
160
|
-
slots,
|
|
161
|
-
onSearch
|
|
162
56
|
};
|
|
163
57
|
}
|
|
164
58
|
});
|