@dative-gpi/foundation-shared-components 1.0.27 → 1.0.28-remove-deprecated2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/FSBreadcrumbs.vue +1 -0
- package/components/FSButton.vue +10 -10
- package/components/FSCalendar.vue +52 -14
- package/components/FSCalendarTwin.vue +96 -40
- package/components/FSCard.vue +28 -7
- package/components/FSCardPlaceholder.vue +8 -5
- package/components/FSChip.vue +12 -2
- package/components/FSClickable.vue +20 -12
- package/components/FSClock.vue +16 -7
- package/components/FSColorIcon.vue +23 -5
- package/components/FSDialog.vue +2 -1
- package/components/FSDialogContent.vue +12 -11
- package/components/FSDialogForm.vue +22 -2
- package/components/FSDialogFormBody.vue +51 -32
- package/components/FSDialogMultiFormBody.vue +79 -56
- package/components/FSDialogRemove.vue +7 -7
- package/components/FSDialogSubmit.vue +20 -11
- package/components/FSEditImage.vue +1 -1
- package/components/FSEditImageUI.vue +20 -10
- package/components/FSFadeOut.vue +44 -18
- package/components/FSForm.vue +10 -8
- package/components/FSGrid.vue +1 -1
- package/components/FSIcon.vue +2 -1
- package/components/FSIconCard.vue +21 -4
- package/components/FSImage.vue +12 -4
- package/components/FSImageUI.vue +8 -15
- package/components/FSLink.vue +25 -9
- package/components/FSLoader.vue +28 -11
- package/components/FSOptionGroup.vue +51 -3
- package/components/FSRouterLink.vue +42 -0
- package/components/FSSlideGroup.vue +19 -5
- package/components/FSSpan.vue +9 -2
- package/components/FSSwitch.vue +57 -27
- package/components/FSTab.vue +15 -13
- package/components/FSTabs.vue +32 -7
- package/components/FSTag.vue +14 -3
- package/components/FSTagGroup.vue +1 -1
- package/components/FSText.vue +4 -2
- package/components/FSWindow.vue +128 -4
- package/components/FSWrapGroup.vue +13 -1
- package/components/agenda/FSAgenda.vue +223 -0
- package/components/agenda/FSAgendaDialogCalendar.vue +76 -0
- package/components/agenda/FSAgendaHeader.vue +215 -0
- package/components/agenda/FSAgendaHorizontalEvent.vue +174 -0
- package/components/agenda/FSAgendaHorizontalTimeLineMarker.vue +46 -0
- package/components/agenda/FSAgendaHoursCol.vue +103 -0
- package/components/agenda/FSAgendaHoursRow.vue +164 -0
- package/components/agenda/FSAgendaVerticalEvent.vue +160 -0
- package/components/agenda/FSAgendaVerticalTimeLineMarker.vue +46 -0
- package/components/agenda/FSDayAgenda.vue +199 -0
- package/components/agenda/FSMonthAgenda.vue +252 -0
- package/components/agenda/FSSelectAgendaMode.vue +54 -0
- package/components/agenda/FSWeekAgenda.vue +323 -0
- package/components/autocompletes/FSAutoCompleteAddress.vue +22 -20
- package/components/autocompletes/FSAutocompleteLanguage.vue +24 -39
- package/components/autocompletes/FSAutocompleteTimeZone.vue +26 -38
- package/components/buttons/FSButtonAdd.vue +1 -1
- package/components/buttons/FSButtonAddLabel.vue +1 -1
- package/components/buttons/FSButtonCancel.vue +1 -1
- package/components/buttons/FSButtonCancelLabel.vue +1 -1
- package/components/buttons/FSButtonCopy.vue +28 -0
- package/components/buttons/FSButtonCopyIcon.vue +28 -0
- package/components/buttons/FSButtonCopyLabel.vue +27 -0
- package/components/buttons/FSButtonCopyMini.vue +28 -0
- package/components/buttons/FSButtonDragIcon.vue +27 -0
- package/components/buttons/FSButtonDuplicate.vue +1 -1
- package/components/buttons/FSButtonDuplicateLabel.vue +1 -1
- package/components/buttons/FSButtonEdit.vue +1 -1
- package/components/buttons/FSButtonEditLabel.vue +1 -1
- package/components/buttons/FSButtonFile.vue +1 -1
- package/components/buttons/FSButtonFileLabel.vue +1 -1
- package/components/buttons/FSButtonNext.vue +1 -1
- package/components/buttons/FSButtonNextLabel.vue +1 -1
- package/components/buttons/FSButtonPrevious.vue +1 -1
- package/components/buttons/FSButtonPreviousLabel.vue +1 -1
- package/components/buttons/FSButtonRedo.vue +1 -1
- package/components/buttons/FSButtonRedoLabel.vue +1 -1
- package/components/buttons/FSButtonRemove.vue +1 -1
- package/components/buttons/FSButtonRemoveLabel.vue +1 -1
- package/components/buttons/FSButtonSave.vue +1 -1
- package/components/buttons/FSButtonSaveLabel.vue +1 -1
- package/components/buttons/FSButtonSearch.vue +1 -1
- package/components/buttons/FSButtonSearchLabel.vue +1 -1
- package/components/buttons/FSButtonUndo.vue +1 -1
- package/components/buttons/FSButtonUndoLabel.vue +1 -1
- package/components/buttons/FSButtonUpdate.vue +1 -1
- package/components/buttons/FSButtonUpdateLabel.vue +1 -1
- package/components/buttons/FSButtonValidate.vue +1 -1
- package/components/buttons/FSButtonValidateLabel.vue +1 -1
- package/components/calendar/FSSimpleCalendar.vue +145 -0
- package/components/calendar/FSSimpleCalendarHeader.vue +60 -0
- package/components/calendar/FSSimpleMonthSelector.vue +138 -0
- package/components/deviceOrganisations/FSConnectivity.vue +11 -1
- package/components/deviceOrganisations/FSConnectivityCard.vue +19 -47
- package/components/deviceOrganisations/FSStatus.vue +11 -1
- package/components/deviceOrganisations/FSStatusCard.vue +35 -61
- package/components/deviceOrganisations/FSStatusesCarousel.vue +1 -0
- package/components/deviceOrganisations/FSStatusesRow.vue +9 -3
- package/components/deviceOrganisations/FSWorstAlert.vue +30 -37
- package/components/deviceOrganisations/FSWorstAlertCard.vue +36 -85
- package/components/fields/FSAutocompleteField.vue +516 -341
- package/components/fields/FSAutocompleteTag.vue +100 -0
- package/components/fields/FSBaseField.vue +44 -27
- package/components/fields/FSColorField.vue +42 -39
- package/components/fields/FSCommentField.vue +105 -0
- package/components/fields/FSDateField.vue +2 -2
- package/components/fields/FSDateRangeField.vue +3 -2
- package/components/fields/FSDateTimeField.vue +4 -3
- package/components/fields/FSDateTimeRangeField.vue +8 -6
- package/components/fields/FSEntityFieldUI.vue +271 -0
- package/components/fields/FSGradientField.vue +27 -33
- package/components/fields/FSIconField.vue +0 -1
- package/components/fields/FSMagicConfigField.vue +15 -7
- package/components/fields/FSMagicField.vue +9 -4
- package/components/fields/FSNumberField.vue +13 -6
- package/components/fields/FSRichTextField.vue +102 -52
- package/components/fields/FSSearchField.vue +9 -115
- package/components/fields/FSSelectField.vue +489 -252
- package/components/fields/FSTagField.vue +1 -1
- package/components/fields/FSTermField.vue +33 -11
- package/components/fields/FSTextArea.vue +26 -7
- package/components/fields/FSTextField.vue +19 -10
- package/components/fields/FSTimeRangeField.vue +304 -0
- package/components/fields/FSTimeStepField.vue +3 -3
- package/components/fields/FSTranslateField.vue +4 -3
- package/components/fields/FSTranslateRichTextField.vue +15 -10
- package/components/fields/FSTranslateTextArea.vue +233 -0
- package/components/fields/FSTreeViewField.vue +3 -3
- package/components/fields/periodicField/FSPeriodicDailyField.vue +120 -0
- package/components/fields/periodicField/FSPeriodicField.vue +131 -0
- package/components/fields/periodicField/FSPeriodicMonthlyField.vue +222 -0
- package/components/fields/periodicField/FSPeriodicWeeklyField.vue +120 -0
- package/components/fields/periodicField/FSPeriodicYearlyField.vue +144 -0
- package/components/lists/FSDataTableUI.vue +148 -89
- package/components/lists/FSDraggable.vue +2 -2
- package/components/lists/FSFilterButton.vue +23 -28
- package/components/lists/FSHeaderButton.vue +4 -4
- package/components/lists/FSHiddenButton.vue +11 -15
- package/components/lists/FSLoadDataTable.vue +10 -7
- package/components/lists/FSSimpleList.vue +234 -0
- package/components/lists/FSSimpleListItem.vue +132 -0
- package/components/map/FSMap.vue +280 -399
- package/components/map/FSMapFeatureGroup.vue +51 -0
- package/components/map/FSMapLayerButton.vue +5 -5
- package/components/map/FSMapMarker.vue +120 -0
- package/components/map/FSMapMarkerClusterGroup.vue +72 -0
- package/components/map/FSMapOverlay.vue +70 -82
- package/components/map/FSMapPolygon.vue +81 -0
- package/components/map/FSMapTileLayer.vue +50 -0
- package/components/map/keys.ts +4 -0
- package/components/selects/FSSelectAutoRefresh.vue +9 -9
- package/components/selects/FSSelectDashboardVariableType.vue +5 -4
- package/components/selects/FSSelectDateSetting.vue +3 -2
- package/components/selects/FSSelectDays.vue +9 -9
- package/components/selects/FSSelectListMode.vue +51 -0
- package/components/selects/FSSelectMonths.vue +67 -0
- package/components/selects/chartSelectors/FSAggregationSelector.vue +52 -0
- package/components/selects/chartSelectors/FSAxisTypeSelector.vue +49 -0
- package/components/selects/chartSelectors/FSDisplayAsSelector.vue +53 -0
- package/components/selects/chartSelectors/FSFilterTypeSelector.vue +54 -0
- package/components/selects/chartSelectors/FSHeatmapRuleSelector.vue +54 -0
- package/components/selects/chartSelectors/FSOperationOnSelector.vue +53 -0
- package/components/selects/chartSelectors/FSPlanningTypeSelector.vue +53 -0
- package/components/selects/chartSelectors/FSPlotPerSelector.vue +52 -0
- package/components/selects/chartSelectors/FSSelectEntityType.vue +59 -0
- package/components/selects/chartSelectors/FSSerieTypeSelector.vue +53 -0
- package/components/tiles/FSAlertTileUI.vue +90 -0
- package/components/tiles/FSChartTile.vue +73 -0
- package/components/tiles/FSChartTileUI.vue +111 -0
- package/components/tiles/FSCommentTileUI.vue +174 -0
- package/components/tiles/FSDeviceOrganisationTileUI.vue +6 -0
- package/components/tiles/FSGroupTileUI.vue +2 -2
- package/components/tiles/FSLoadTile.vue +2 -0
- package/components/tiles/FSLocationTileUI.vue +192 -0
- package/components/tiles/FSModelTileUI.vue +18 -0
- package/components/tiles/FSSimpleTileUI.vue +9 -4
- package/components/tiles/FSTile.vue +93 -74
- package/components/tiles/FSUserOrganisationTileUI.vue +1 -1
- package/components/toggleSets/FSToggleSetPosition.vue +2 -2
- package/components/views/FSBaseView.vue +64 -0
- package/components/views/FSEntityView.vue +12 -140
- package/components/views/FSSimpleView.vue +29 -0
- package/components/views/desktop/FSBaseDefaultDesktopView.vue +134 -0
- package/components/views/desktop/FSBaseDesktopView.vue +53 -0
- package/components/views/desktop/FSBaseEntityDesktopView.vue +208 -0
- package/components/views/mobile/FSBaseDefaultMobileView.vue +132 -0
- package/components/views/mobile/FSBaseEntityMobileView.vue +198 -0
- package/components/views/mobile/FSBaseMobileView.vue +53 -0
- package/composables/useAddress.ts +2 -2
- package/composables/useBreakpoints.ts +39 -3
- package/composables/useColors.ts +3 -2
- package/composables/useMagicFieldProvider.ts +1 -0
- package/models/agenda.ts +9 -0
- package/models/deviceAlerts.ts +1 -1
- package/models/deviceConnectivities.ts +1 -1
- package/models/index.ts +1 -0
- package/models/magicFields.ts +1 -0
- package/models/map.ts +2 -2
- package/models/rules.ts +5 -5
- package/models/tables.ts +5 -2
- package/models/variableNode.ts +8 -5
- package/package.json +5 -5
- package/styles/components/fs_agenda.scss +36 -0
- package/styles/components/fs_agenda_event.scss +41 -0
- package/styles/components/fs_agenda_hours_col.scss +4 -0
- package/styles/components/fs_agenda_hours_row.scss +5 -0
- package/styles/components/fs_agenda_time_line_marker.scss +19 -0
- package/styles/components/fs_autocomplete_field.scss +0 -13
- package/styles/components/fs_breadcrumbs.scss +6 -12
- package/styles/components/fs_card.scss +0 -1
- package/styles/components/fs_clickable.scss +7 -14
- package/styles/components/fs_clock.scss +0 -10
- package/styles/components/fs_color_field.scss +1 -4
- package/styles/components/fs_data_table.scss +6 -9
- package/styles/components/fs_dialog.scss +7 -17
- package/styles/components/fs_edit_image.scss +8 -0
- package/styles/components/fs_fade_out.scss +11 -2
- package/styles/components/fs_filter_button.scss +1 -6
- package/styles/components/fs_gradient_field.scss +11 -11
- package/styles/components/fs_hidden_button.scss +2 -7
- package/styles/components/fs_image_card.scss +1 -1
- package/styles/components/fs_magic_config_field.scss +1 -2
- package/styles/components/fs_map.scss +36 -30
- package/styles/components/fs_meta_field.scss +3 -5
- package/styles/components/fs_option_group.scss +15 -5
- package/styles/components/fs_rich_text_field.scss +1 -9
- package/styles/components/fs_select_date_settings.scss +3 -0
- package/styles/components/fs_select_field.scss +0 -13
- package/styles/components/fs_slide_group.scss +7 -0
- package/styles/components/fs_span.scss +2 -1
- package/styles/components/fs_switch.scss +1 -0
- package/styles/components/fs_tabs.scss +10 -24
- package/styles/components/fs_tag.scss +3 -19
- package/styles/components/fs_text_area.scss +13 -17
- package/styles/components/fs_tile.scss +21 -15
- package/styles/components/fs_window.scss +7 -0
- package/styles/components/fs_wrap_group.scss +7 -0
- package/styles/components/index.scss +5 -5
- package/styles/globals/index.scss +1 -5
- package/styles/globals/overrides.scss +17 -57
- package/styles/globals/text_fonts.scss +18 -66
- package/tools/alertsTools.ts +69 -0
- package/tools/chartsTools.ts +427 -0
- package/tools/index.ts +3 -0
- package/tools/timeRangeTools.ts +125 -0
- package/utils/filter.ts +18 -0
- package/utils/index.ts +1 -0
- package/utils/leafletMarkers.ts +9 -3
- package/utils/sort.ts +2 -2
- package/utils/statuses.ts +1 -1
- package/utils/time.ts +17 -17
- package/components/autocompletes/FSAutocompleteTag.vue +0 -138
- package/components/fields/FSTimeSlotField.vue +0 -250
- package/components/map/FSMapEditPointAddressOverlay.vue +0 -164
- package/components/views/FSEntityHeader.vue +0 -350
- package/components/views/FSListHeader.vue +0 -83
- package/components/views/FSListView.vue +0 -83
- package/components/views/FSSkeletonView.vue +0 -100
- package/styles/components/fs_icon_field.scss +0 -12
- package/styles/components/fs_map_overlay.scss +0 -38
- package/styles/components/fs_tag_field.scss +0 -8
- package/styles/components/fs_time_field.scss +0 -12
- package/styles/components/fs_timeslot_field.scss +0 -12
- package/styles/globals/breakpoints.scss +0 -20
- package/styles/globals/fixes.scss +0 -5
package/utils/time.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
2
2
|
|
|
3
|
-
import { TimeUnit } from "@dative-gpi/foundation-shared-domain/
|
|
3
|
+
import { TimeUnit } from "@dative-gpi/foundation-shared-domain/enums"
|
|
4
4
|
|
|
5
5
|
const { $tr } = useTranslationsProvider();
|
|
6
6
|
|
|
7
7
|
export const timeSteps = [
|
|
8
|
-
{ id: TimeUnit.Second,
|
|
9
|
-
{ id: TimeUnit.Minute,
|
|
10
|
-
{ id: TimeUnit.Hour,
|
|
11
|
-
{ id: TimeUnit.Day,
|
|
12
|
-
{ id: TimeUnit.Week,
|
|
13
|
-
{ id: TimeUnit.Month,
|
|
14
|
-
{ id: TimeUnit.Year,
|
|
15
|
-
]
|
|
8
|
+
{ id: TimeUnit.Second, get label() { return $tr("ui.common.second", "Second") }, get plural() { return $tr("ui.common.seconds", "Seconds") } },
|
|
9
|
+
{ id: TimeUnit.Minute, get label() { return $tr("ui.common.minute", "Minute") }, get plural() { return $tr("ui.common.minutes", "Minutes") } },
|
|
10
|
+
{ id: TimeUnit.Hour, get label() { return $tr("ui.common.hour", "Hour") }, get plural() { return $tr("ui.common.hours", "Hours") } },
|
|
11
|
+
{ id: TimeUnit.Day, get label() { return $tr("ui.common.day", "Day") }, get plural() { return $tr("ui.common.days", "Days") } },
|
|
12
|
+
{ id: TimeUnit.Week, get label() { return $tr("ui.common.week", "Week") }, get plural() { return $tr("ui.common.weeks", "Weeks") } },
|
|
13
|
+
{ id: TimeUnit.Month, get label() { return $tr("ui.common.month", "Month") }, get plural() { return $tr("ui.common.months", "Months") } },
|
|
14
|
+
{ id: TimeUnit.Year, get label() { return $tr("ui.common.year", "Year") }, get plural() { return $tr("ui.common.years", "Years") } },
|
|
15
|
+
];
|
|
16
16
|
|
|
17
17
|
export const timeStepToString = (value: { value: number, unit: TimeUnit } | null): string => {
|
|
18
18
|
if (!value) {
|
|
@@ -25,15 +25,15 @@ export const timeStepToString = (value: { value: number, unit: TimeUnit } | null
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
return `${value.value} ${value.value === 1 ? unit.label.toLowerCase() : unit.plural.toLowerCase()}`;
|
|
28
|
-
}
|
|
28
|
+
};
|
|
29
29
|
|
|
30
30
|
// TODO : remove everything below this line
|
|
31
|
-
export const timeScale
|
|
32
|
-
{ id: 1, label
|
|
33
|
-
{ id: 60, label
|
|
34
|
-
{ id: 3600, label
|
|
35
|
-
{ id: 86400, label
|
|
36
|
-
{ id: 604800, label
|
|
31
|
+
export const timeScale = [
|
|
32
|
+
{ id: 1, get label() { return $tr("ui.common.second", "Second") }, get plural() { return $tr("ui.common.seconds", "Seconds") } },
|
|
33
|
+
{ id: 60, get label() { return $tr("ui.common.minute", "Minute") }, get plural() { return $tr("ui.common.minutes", "Minutes") } },
|
|
34
|
+
{ id: 3600, get label() { return $tr("ui.common.hour", "Hour") }, get plural() { return $tr("ui.common.hours", "Hours") } },
|
|
35
|
+
{ id: 86400, get label() { return $tr("ui.common.day", "Day") }, get plural() { return $tr("ui.common.days", "Days") } },
|
|
36
|
+
{ id: 604800, get label() { return $tr("ui.common.week", "Week") }, get plural() { return $tr("ui.common.weeks", "Weeks") } },
|
|
37
37
|
];
|
|
38
38
|
|
|
39
39
|
export const getTimeScaleIndex = (value: number): number => {
|
|
@@ -52,4 +52,4 @@ export const getTimeBestString = (value: number): string => {
|
|
|
52
52
|
const unit = getTimeScaleIndex(value);
|
|
53
53
|
const figure = value / timeScale[unit].id;
|
|
54
54
|
return `${figure} ${figure === 1 ? timeScale[unit].label.toLowerCase() : timeScale[unit].plural.toLowerCase()}`;
|
|
55
|
-
}
|
|
55
|
+
};
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<FSCol>
|
|
3
|
-
<FSAutocompleteField
|
|
4
|
-
v-if="variant=='standard'"
|
|
5
|
-
:label="label"
|
|
6
|
-
:items="innerItems"
|
|
7
|
-
:multiple="true"
|
|
8
|
-
:modelValue="modelValue?.map(m=>m.id)"
|
|
9
|
-
@update:modelValue="onUpdateModelValue"
|
|
10
|
-
@keydown="onKeydown"
|
|
11
|
-
v-binds="$attrs"
|
|
12
|
-
>
|
|
13
|
-
<template
|
|
14
|
-
#autocomplete-chip
|
|
15
|
-
>
|
|
16
|
-
</template>
|
|
17
|
-
</FSAutocompleteField>
|
|
18
|
-
<FSAutocompleteField
|
|
19
|
-
v-else
|
|
20
|
-
:label="label"
|
|
21
|
-
:items="innerItems"
|
|
22
|
-
:multiple="true"
|
|
23
|
-
:modelValue="modelValue?.map(m=>m.id)"
|
|
24
|
-
:showSearch="true"
|
|
25
|
-
@update:modelValue="onUpdateModelValue"
|
|
26
|
-
@add:item="onAddItem"
|
|
27
|
-
@keydown="onKeydown"
|
|
28
|
-
v-binds="$attrs"
|
|
29
|
-
>
|
|
30
|
-
<template
|
|
31
|
-
#autocomplete-chip
|
|
32
|
-
>
|
|
33
|
-
</template>
|
|
34
|
-
</FSAutocompleteField>
|
|
35
|
-
<FSTagGroup
|
|
36
|
-
v-if="modelValue != null"
|
|
37
|
-
:tags="modelValue?.map((v) => v.label) ?? []"
|
|
38
|
-
@remove="onRemoveValue($event)"
|
|
39
|
-
/>
|
|
40
|
-
</FSCol>
|
|
41
|
-
</template>
|
|
42
|
-
|
|
43
|
-
<script lang="ts">
|
|
44
|
-
import type { PropType } from "vue";
|
|
45
|
-
import { computed, defineComponent, ref, watch } from "vue";
|
|
46
|
-
|
|
47
|
-
import { uuidv4 } from '@dative-gpi/bones-ui';
|
|
48
|
-
|
|
49
|
-
import FSAutocompleteField from "../fields/FSAutocompleteField.vue";
|
|
50
|
-
import FSTagGroup from "../FSTagGroup.vue";
|
|
51
|
-
|
|
52
|
-
export default defineComponent({
|
|
53
|
-
components: {
|
|
54
|
-
FSAutocompleteField,
|
|
55
|
-
FSTagGroup,
|
|
56
|
-
},
|
|
57
|
-
props:{
|
|
58
|
-
modelValue: {
|
|
59
|
-
type: Array as PropType<{id : string, label : string, isCustom: boolean}[] | null>,
|
|
60
|
-
required: false,
|
|
61
|
-
default: () => []
|
|
62
|
-
},
|
|
63
|
-
items: {
|
|
64
|
-
type: Array as PropType<{id : string, label : string, isCustom: boolean}[]>,
|
|
65
|
-
required: false,
|
|
66
|
-
default: () => []
|
|
67
|
-
},
|
|
68
|
-
label : {
|
|
69
|
-
type: String,
|
|
70
|
-
required: false
|
|
71
|
-
},
|
|
72
|
-
variant: {
|
|
73
|
-
type: String as PropType<'standard' | 'tagged'>,
|
|
74
|
-
required: false,
|
|
75
|
-
default : 'standard'
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
emits: ["update:modelValue"],
|
|
79
|
-
setup(props, {emit}) {
|
|
80
|
-
|
|
81
|
-
const tagValues = ref<{id : string, label : string, isCustom : boolean}[]>([]);
|
|
82
|
-
|
|
83
|
-
const innerItems = computed(()=>{
|
|
84
|
-
|
|
85
|
-
if(props.variant === 'standard'){
|
|
86
|
-
return props.items
|
|
87
|
-
}
|
|
88
|
-
else{
|
|
89
|
-
return props.items.concat(tagValues.value);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
const onUpdateModelValue = (value: string[] | null) => {
|
|
94
|
-
emit('update:modelValue', value?.map((v) => innerItems.value.find((i) => i.id === v)));
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const onRemoveValue = (value: string) => {
|
|
98
|
-
const idValue = innerItems.value.find((v) => v.label === value)?.id;
|
|
99
|
-
if (idValue) {
|
|
100
|
-
if(tagValues.value.map((v) => v.label).includes(value)){
|
|
101
|
-
tagValues.value = tagValues.value.filter((v) => v.label !== value);
|
|
102
|
-
}
|
|
103
|
-
emit('update:modelValue', [...props.modelValue?.filter((v) => v.id !== idValue) ?? []]);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
const onAddItem = (value: string) => {
|
|
108
|
-
if (innerItems.value.map((v) => v.label).includes(value)) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
let item = {id: uuidv4(), label: value, isCustom: true};
|
|
112
|
-
tagValues.value.push(item);
|
|
113
|
-
emit('update:modelValue', [...props.modelValue?? [],item]);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const onKeydown = (event: KeyboardEvent) => {
|
|
117
|
-
if (event.key === 'Backspace') {
|
|
118
|
-
emit('update:modelValue', [...props.modelValue ?? []]);
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
watch(() => props.modelValue, (newValue) => {
|
|
123
|
-
if (newValue) {
|
|
124
|
-
tagValues.value = props.modelValue?.filter(m=>m.isCustom) ?? [];
|
|
125
|
-
}
|
|
126
|
-
}, {immediate: true});
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
return {
|
|
130
|
-
innerItems,
|
|
131
|
-
onUpdateModelValue,
|
|
132
|
-
onAddItem,
|
|
133
|
-
onRemoveValue,
|
|
134
|
-
onKeydown
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
})
|
|
138
|
-
</script>
|
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<FSBaseField
|
|
3
|
-
:description="$props.description"
|
|
4
|
-
:hideHeader="$props.hideHeader"
|
|
5
|
-
:required="$props.required"
|
|
6
|
-
:editable="$props.editable"
|
|
7
|
-
:label="$props.label"
|
|
8
|
-
:messages="messages"
|
|
9
|
-
>
|
|
10
|
-
<FSRow>
|
|
11
|
-
<FSRow
|
|
12
|
-
:wrap="false"
|
|
13
|
-
>
|
|
14
|
-
<FSSelectField
|
|
15
|
-
:validationValue="$props.modelValue"
|
|
16
|
-
:editable="$props.editable"
|
|
17
|
-
:validateOn="validateOn"
|
|
18
|
-
:rules="$props.rules"
|
|
19
|
-
:items="daysObject"
|
|
20
|
-
:hideHeader="true"
|
|
21
|
-
:clearable="false"
|
|
22
|
-
:style="style"
|
|
23
|
-
:modelValue="dayStart"
|
|
24
|
-
@update:modelValue="onChangeDayStart"
|
|
25
|
-
/>
|
|
26
|
-
<FSClock
|
|
27
|
-
class="fs-time-slot-field-number"
|
|
28
|
-
:editable="$props.editable"
|
|
29
|
-
:color="ColorEnum.Light"
|
|
30
|
-
:slider="false"
|
|
31
|
-
:style="style"
|
|
32
|
-
:modelValue="$props.modelValue[0][1]"
|
|
33
|
-
@update:modelValue="onChangeHourStart"
|
|
34
|
-
/>
|
|
35
|
-
</FSRow>
|
|
36
|
-
<FSRow
|
|
37
|
-
:wrap="false"
|
|
38
|
-
>
|
|
39
|
-
<FSSelectField
|
|
40
|
-
class="fs-time-slot-field-select"
|
|
41
|
-
:editable="$props.editable"
|
|
42
|
-
:items="daysObject"
|
|
43
|
-
:hideHeader="true"
|
|
44
|
-
:clearable="false"
|
|
45
|
-
:style="style"
|
|
46
|
-
:modelValue="dayEnd"
|
|
47
|
-
@update:modelValue="onChangeDayEnd"
|
|
48
|
-
/>
|
|
49
|
-
<FSClock
|
|
50
|
-
class="fs-time-slot-field-number"
|
|
51
|
-
:editable="$props.editable"
|
|
52
|
-
:color="ColorEnum.Light"
|
|
53
|
-
:slider="false"
|
|
54
|
-
:style="style"
|
|
55
|
-
:modelValue="$props.modelValue[1][1]"
|
|
56
|
-
@update:modelValue="onChangeHourEnd"
|
|
57
|
-
/>
|
|
58
|
-
</FSRow>
|
|
59
|
-
</FSRow>
|
|
60
|
-
</FSBaseField>
|
|
61
|
-
</template>
|
|
62
|
-
|
|
63
|
-
<script lang="ts">
|
|
64
|
-
import { computed, defineComponent, type PropType, type StyleValue } from "vue";
|
|
65
|
-
|
|
66
|
-
import { useColors, useRules } from "@dative-gpi/foundation-shared-components/composables";
|
|
67
|
-
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
68
|
-
import { Days } from "@dative-gpi/foundation-shared-domain/models";
|
|
69
|
-
|
|
70
|
-
import FSSelectField from "./FSSelectField.vue";
|
|
71
|
-
import FSBaseField from "./FSBaseField.vue";
|
|
72
|
-
import FSClock from "../FSClock.vue";
|
|
73
|
-
import FSRow from "../FSRow.vue";
|
|
74
|
-
|
|
75
|
-
export default defineComponent({
|
|
76
|
-
name: "FSTimeSlotField",
|
|
77
|
-
components: {
|
|
78
|
-
FSSelectField,
|
|
79
|
-
FSBaseField,
|
|
80
|
-
FSClock,
|
|
81
|
-
FSRow
|
|
82
|
-
},
|
|
83
|
-
props: {
|
|
84
|
-
label: {
|
|
85
|
-
type: String as PropType<string | null>,
|
|
86
|
-
required: false,
|
|
87
|
-
default: null
|
|
88
|
-
},
|
|
89
|
-
description: {
|
|
90
|
-
type: String as PropType<string | null>,
|
|
91
|
-
required: false,
|
|
92
|
-
default: null
|
|
93
|
-
},
|
|
94
|
-
modelValue: {
|
|
95
|
-
type: Array as PropType<number[][] | null>,
|
|
96
|
-
required: true,
|
|
97
|
-
default: null
|
|
98
|
-
},
|
|
99
|
-
hideHeader: {
|
|
100
|
-
type: Boolean,
|
|
101
|
-
required: false,
|
|
102
|
-
default: false
|
|
103
|
-
},
|
|
104
|
-
required: {
|
|
105
|
-
type: Boolean,
|
|
106
|
-
required: false,
|
|
107
|
-
default: false
|
|
108
|
-
},
|
|
109
|
-
rules: {
|
|
110
|
-
type: Array as PropType<any[]>,
|
|
111
|
-
required: false,
|
|
112
|
-
default: () => []
|
|
113
|
-
},
|
|
114
|
-
messages: {
|
|
115
|
-
type: Array as PropType<string[]>,
|
|
116
|
-
required: false,
|
|
117
|
-
default: null
|
|
118
|
-
},
|
|
119
|
-
editable: {
|
|
120
|
-
type: Boolean,
|
|
121
|
-
required: false,
|
|
122
|
-
default: true
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
emits: ["update:modelValue"],
|
|
126
|
-
setup(props, { emit }) {
|
|
127
|
-
const { validateOn, getMessages } = useRules();
|
|
128
|
-
const { getColors } = useColors();
|
|
129
|
-
|
|
130
|
-
const errors = getColors(ColorEnum.Error);
|
|
131
|
-
const lights = getColors(ColorEnum.Light);
|
|
132
|
-
const darks = getColors(ColorEnum.Dark);
|
|
133
|
-
|
|
134
|
-
const daysObject: { id: number; label: string }[] = Object.keys(Days).reduce((acc, key) => {
|
|
135
|
-
if (isNaN(Number(key))) {
|
|
136
|
-
acc.push({
|
|
137
|
-
id: Days[key],
|
|
138
|
-
label: key
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
return acc;
|
|
142
|
-
}, [] as { id: number, label: string }[]);
|
|
143
|
-
|
|
144
|
-
const style = computed((): StyleValue => {
|
|
145
|
-
if (!props.editable) {
|
|
146
|
-
return {
|
|
147
|
-
"--fs-time-slot-field-cursor" : "default",
|
|
148
|
-
"--fs-time-slot-field-border-color" : lights.base,
|
|
149
|
-
"--fs-time-slot-field-color" : lights.dark,
|
|
150
|
-
"--fs-time-slot-field-active-border-color": lights.base
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
return {
|
|
154
|
-
"--fs-time-slot-field-cursor" : "text",
|
|
155
|
-
"--fs-time-slot-field-border-color" : lights.dark,
|
|
156
|
-
"--fs-time-slot-field-color" : darks.base,
|
|
157
|
-
"--fs-time-slot-field-active-border-color": darks.dark,
|
|
158
|
-
"--fs-time-slot-field-error-color" : errors.base,
|
|
159
|
-
"--fs-time-slot-field-error-border-color" : errors.base
|
|
160
|
-
};
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
const dayStart = computed((): number => {
|
|
164
|
-
if (props.modelValue) {
|
|
165
|
-
return props.modelValue[1][0] === 7 ? 7 : props.modelValue[0][0];
|
|
166
|
-
}
|
|
167
|
-
return 0;
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
const dayEnd = computed((): number => {
|
|
171
|
-
if (props.modelValue) {
|
|
172
|
-
return props.modelValue[0][0] === 7 ? 7 : props.modelValue[1][0];
|
|
173
|
-
}
|
|
174
|
-
return 0;
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
const messages = computed((): string[] => props.messages ?? getMessages(props.modelValue, props.rules));
|
|
178
|
-
|
|
179
|
-
const onChangeDayStart = (value: number) => {
|
|
180
|
-
if (value === 7) {
|
|
181
|
-
if (props.modelValue) {
|
|
182
|
-
emit("update:modelValue", [[7, props.modelValue[0][1]], [7, props.modelValue[1][1]]]);
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
emit("update:modelValue", [[7, 0], [7, 0]]);
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
if (props.modelValue) {
|
|
189
|
-
if (props.modelValue[1][0] === 7) {
|
|
190
|
-
emit("update:modelValue", [[value, props.modelValue[0][1]], [value, props.modelValue[1][1]]]);
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
emit("update:modelValue", [[value, props.modelValue[0][1]], props.modelValue[1]]);
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
emit("update:modelValue", [[value, 0], [value, 0]]);
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
const onChangeHourStart = (value: number) => {
|
|
200
|
-
if (props.modelValue) {
|
|
201
|
-
emit("update:modelValue", [[props.modelValue[0][0], value], props.modelValue[1]]);
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
emit("update:modelValue", [[0, value], [0, 0]]);
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
const onChangeDayEnd = (value: number) => {
|
|
208
|
-
if (value === 7) {
|
|
209
|
-
if (props.modelValue) {
|
|
210
|
-
emit("update:modelValue", [[7, props.modelValue[0][1]], [7, props.modelValue[1][1]]]);
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
emit("update:modelValue", [[7, 0], [7, 0]]);
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
if (props.modelValue) {
|
|
217
|
-
if (props.modelValue[0][0] === 7) {
|
|
218
|
-
emit("update:modelValue", [[value, props.modelValue[0][1]], [value, props.modelValue[1][1]]]);
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
emit("update:modelValue", [props.modelValue[0], [value, props.modelValue[1][1]]]);
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
|
-
emit("update:modelValue", [[value, 0], [value, 0]]);
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
const onChangeHourEnd = (value: number) => {
|
|
228
|
-
if (props.modelValue) {
|
|
229
|
-
emit("update:modelValue", [props.modelValue[0], [props.modelValue[1][0], value]]);
|
|
230
|
-
return;
|
|
231
|
-
}
|
|
232
|
-
emit("update:modelValue", [[0, 0], [0, value]]);
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
return {
|
|
236
|
-
daysObject,
|
|
237
|
-
validateOn,
|
|
238
|
-
ColorEnum,
|
|
239
|
-
dayStart,
|
|
240
|
-
messages,
|
|
241
|
-
dayEnd,
|
|
242
|
-
style,
|
|
243
|
-
onChangeHourStart,
|
|
244
|
-
onChangeDayStart,
|
|
245
|
-
onChangeHourEnd,
|
|
246
|
-
onChangeDayEnd
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
});
|
|
250
|
-
</script>
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<FSCard
|
|
3
|
-
padding="16px"
|
|
4
|
-
height="100%"
|
|
5
|
-
width="100%"
|
|
6
|
-
:elevation="true"
|
|
7
|
-
>
|
|
8
|
-
<FSCol
|
|
9
|
-
gap="24px"
|
|
10
|
-
>
|
|
11
|
-
<FSRow>
|
|
12
|
-
<FSText
|
|
13
|
-
font="text-h3"
|
|
14
|
-
>
|
|
15
|
-
{{ $tr('ui.map.modify-location', 'Modify location') }}
|
|
16
|
-
</FSText>
|
|
17
|
-
<v-spacer />
|
|
18
|
-
<FSButton
|
|
19
|
-
v-if="menuLocationCoordinates"
|
|
20
|
-
icon="mdi-arrow-collapse"
|
|
21
|
-
variant="icon"
|
|
22
|
-
@click="menuLocationCoordinates = !menuLocationCoordinates"
|
|
23
|
-
/>
|
|
24
|
-
<FSButton
|
|
25
|
-
v-else
|
|
26
|
-
icon="mdi-arrow-expand"
|
|
27
|
-
variant="icon"
|
|
28
|
-
@click="menuLocationCoordinates = !menuLocationCoordinates"
|
|
29
|
-
/>
|
|
30
|
-
</FSRow>
|
|
31
|
-
<FSCol
|
|
32
|
-
v-if="menuLocationCoordinates"
|
|
33
|
-
>
|
|
34
|
-
<FSAutoCompleteAddress
|
|
35
|
-
:modelValue="$props.modelValue"
|
|
36
|
-
@update:modelValue="onAddressFieldSubmit($event)"
|
|
37
|
-
/>
|
|
38
|
-
<FSForm
|
|
39
|
-
variant="standard"
|
|
40
|
-
@submit="onCoordinatesChange()"
|
|
41
|
-
>
|
|
42
|
-
<FSRow>
|
|
43
|
-
<FSNumberField
|
|
44
|
-
:label="$tr('ui.map.latitude', 'Latitude')"
|
|
45
|
-
v-model="latitude"
|
|
46
|
-
/>
|
|
47
|
-
<FSNumberField
|
|
48
|
-
:label="$tr('ui.map.longitude', 'Longitude')"
|
|
49
|
-
v-model="longitude"
|
|
50
|
-
/>
|
|
51
|
-
</FSRow>
|
|
52
|
-
<FSButton
|
|
53
|
-
prependIcon="mdi-content-save"
|
|
54
|
-
style="display: none;"
|
|
55
|
-
color="primary"
|
|
56
|
-
type="submit"
|
|
57
|
-
:label="$tr('ui.map.save', 'Save')"
|
|
58
|
-
/>
|
|
59
|
-
</FSForm>
|
|
60
|
-
</FSCol>
|
|
61
|
-
<FSRow
|
|
62
|
-
align="center-right"
|
|
63
|
-
>
|
|
64
|
-
<FSButton
|
|
65
|
-
:label="$tr('ui.map.cancel', 'Cancel')"
|
|
66
|
-
@click="onCancel"
|
|
67
|
-
/>
|
|
68
|
-
<FSButton
|
|
69
|
-
prependIcon="mdi-content-save"
|
|
70
|
-
color="primary"
|
|
71
|
-
:label="$tr('ui.map.save', 'Save')"
|
|
72
|
-
@click="onSubmit"
|
|
73
|
-
/>
|
|
74
|
-
</FSRow>
|
|
75
|
-
</FSCol>
|
|
76
|
-
</FSCard>
|
|
77
|
-
</template>
|
|
78
|
-
|
|
79
|
-
<script lang="ts">
|
|
80
|
-
import { defineComponent, type PropType, ref, watch } from "vue";
|
|
81
|
-
|
|
82
|
-
import { Address } from "@dative-gpi/foundation-shared-domain/models";
|
|
83
|
-
|
|
84
|
-
import FSAutoCompleteAddress from "../autocompletes/FSAutoCompleteAddress.vue";
|
|
85
|
-
import FSNumberField from "../fields/FSNumberField.vue";
|
|
86
|
-
import FSButton from "../FSButton.vue";
|
|
87
|
-
import FSCard from "../FSCard.vue";
|
|
88
|
-
import FSForm from "../FSForm.vue";
|
|
89
|
-
import FSText from "../FSText.vue";
|
|
90
|
-
import FSCol from "../FSCol.vue";
|
|
91
|
-
import FSRow from "../FSRow.vue";
|
|
92
|
-
|
|
93
|
-
export default defineComponent({
|
|
94
|
-
name: "FSMapEditPointAddressOverlay.vue",
|
|
95
|
-
components: {
|
|
96
|
-
FSAutoCompleteAddress,
|
|
97
|
-
FSNumberField,
|
|
98
|
-
FSButton,
|
|
99
|
-
FSCard,
|
|
100
|
-
FSForm,
|
|
101
|
-
FSText,
|
|
102
|
-
FSCol,
|
|
103
|
-
FSRow
|
|
104
|
-
},
|
|
105
|
-
props: {
|
|
106
|
-
modelValue: {
|
|
107
|
-
type: Object as PropType<Address | null>,
|
|
108
|
-
default: null
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
emits: ["update:modelValue", "update:locationCoordinates", "submit", "cancel"],
|
|
112
|
-
setup(props, { emit }) {
|
|
113
|
-
const menuLocationCoordinates = ref(false);
|
|
114
|
-
|
|
115
|
-
const latitude = ref(0);
|
|
116
|
-
const longitude = ref(0);
|
|
117
|
-
|
|
118
|
-
const onCoordinatesChange = () => {
|
|
119
|
-
const newModelValue = new Address({
|
|
120
|
-
country: "",
|
|
121
|
-
formattedAddress: "",
|
|
122
|
-
locality: "",
|
|
123
|
-
placeId: "",
|
|
124
|
-
placeLabel: "",
|
|
125
|
-
latitude: latitude.value,
|
|
126
|
-
longitude: longitude.value,
|
|
127
|
-
});
|
|
128
|
-
emit("update:locationCoordinates", newModelValue);
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
const onAddressFieldSubmit = (address: Address|null) => {
|
|
132
|
-
if(!address) {
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
emit('update:modelValue', address);
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
const onSubmit = () => {
|
|
139
|
-
emit('submit');
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
const onCancel = () => {
|
|
143
|
-
emit('cancel');
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
watch(() => props.modelValue, () => {
|
|
147
|
-
if (props.modelValue) {
|
|
148
|
-
latitude.value = props.modelValue.latitude;
|
|
149
|
-
longitude.value = props.modelValue.longitude;
|
|
150
|
-
}
|
|
151
|
-
}, { immediate: true });
|
|
152
|
-
|
|
153
|
-
return {
|
|
154
|
-
menuLocationCoordinates,
|
|
155
|
-
longitude,
|
|
156
|
-
latitude,
|
|
157
|
-
onAddressFieldSubmit,
|
|
158
|
-
onCoordinatesChange,
|
|
159
|
-
onCancel,
|
|
160
|
-
onSubmit
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
</script>
|