@dative-gpi/foundation-shared-components 0.1.120 → 1.0.1
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/imagery.png +0 -0
- package/assets/images/map/map.png +0 -0
- package/components/FSAccordion.vue +2 -1
- package/components/FSAccordionPanel.vue +20 -1
- package/components/FSBadge.vue +7 -3
- package/components/FSBreadcrumbs.vue +4 -2
- package/components/FSButton.vue +15 -8
- package/components/FSCalendar.vue +5 -2
- package/components/FSCalendarTwin.vue +6 -3
- package/components/FSCard.vue +4 -2
- package/components/FSCardPlaceholder.vue +80 -0
- package/components/FSCheckbox.vue +10 -7
- package/components/FSChip.vue +4 -2
- package/components/FSClickable.vue +5 -3
- package/components/FSClock.vue +18 -4
- package/components/FSCol.vue +12 -5
- package/components/FSColor.vue +4 -2
- package/components/FSColorIcon.vue +5 -3
- package/components/FSDialog.vue +28 -87
- package/components/FSDialogContent.vue +133 -0
- package/components/FSDialogForm.vue +25 -236
- package/components/FSDialogFormBody.vue +273 -0
- package/components/FSDialogMenu.vue +5 -2
- package/components/FSDialogMultiForm.vue +21 -197
- package/components/FSDialogMultiFormBody.vue +231 -0
- package/components/FSDialogSubmit.vue +4 -2
- package/components/FSDivider.vue +6 -4
- package/components/FSEditImage.vue +16 -9
- package/components/FSErrorToast.vue +2 -1
- package/components/FSFadeOut.vue +1 -1
- package/components/FSForm.vue +7 -7
- package/components/FSGrid.vue +4 -2
- package/components/FSGridMosaic.vue +3 -2
- package/components/FSIcon.vue +3 -2
- package/components/FSIconCard.vue +10 -3
- package/components/FSIconCheck.vue +2 -1
- package/components/FSIconFlag.vue +2 -1
- package/components/FSImage.vue +2 -1
- package/components/FSImageCard.vue +72 -0
- package/components/FSLabel.vue +4 -2
- package/components/FSLink.vue +5 -3
- package/components/FSLoader.vue +2 -1
- package/components/FSOptionGroup.vue +28 -20
- package/components/FSOptionItem.vue +8 -18
- package/components/FSPagination.vue +4 -2
- package/components/FSRadio.vue +23 -11
- package/components/FSRadioGroup.vue +23 -10
- package/components/FSRow.vue +8 -1
- package/components/FSSlideGroup.vue +27 -6
- package/components/FSSlider.vue +4 -2
- package/components/FSSpan.vue +2 -1
- package/components/FSSwitch.vue +13 -10
- package/components/FSTab.vue +4 -2
- package/components/FSTabs.vue +5 -14
- package/components/FSTag.vue +11 -4
- package/components/FSTagGroup.vue +4 -2
- package/components/FSText.vue +4 -2
- package/components/FSToggleSet.vue +30 -17
- package/components/FSTooltip.vue +15 -4
- package/components/FSWindow.vue +2 -2
- package/components/FSWrapGroup.vue +2 -1
- package/components/autocompletes/FSAutoCompleteAddress.vue +104 -0
- package/components/autocompletes/FSAutocompleteLanguage.vue +18 -26
- package/components/autocompletes/FSAutocompleteTag.vue +138 -0
- package/components/autocompletes/FSAutocompleteTimeZone.vue +19 -30
- package/components/buttons/FSButtonAdd.vue +28 -0
- package/components/buttons/FSButtonAddIcon.vue +28 -0
- package/components/buttons/FSButtonAddLabel.vue +27 -0
- package/components/buttons/FSButtonAddMini.vue +27 -0
- package/components/buttons/FSButtonFile.vue +4 -4
- package/components/buttons/FSButtonFileIcon.vue +4 -4
- package/components/buttons/FSButtonFileLabel.vue +4 -4
- package/components/buttons/FSButtonFileMini.vue +4 -4
- package/components/deviceOrganisations/FSConnectivity.vue +3 -2
- package/components/deviceOrganisations/FSConnectivityCard.vue +3 -2
- package/components/deviceOrganisations/FSStatus.vue +3 -2
- package/components/deviceOrganisations/FSStatusCard.vue +3 -2
- package/components/deviceOrganisations/FSStatusesCarousel.vue +3 -2
- package/components/deviceOrganisations/FSStatusesRow.vue +3 -2
- package/components/deviceOrganisations/FSWorstAlert.vue +5 -4
- package/components/deviceOrganisations/FSWorstAlertCard.vue +4 -2
- package/components/fields/FSAutocompleteField.vue +219 -97
- package/components/fields/FSBaseField.vue +2 -1
- package/components/fields/FSColorField.vue +65 -94
- package/components/fields/FSDateField.vue +12 -25
- package/components/fields/FSDateRangeField.vue +15 -27
- package/components/fields/FSDateTimeField.vue +22 -32
- package/components/fields/FSDateTimeRangeField.vue +43 -51
- package/components/fields/FSGradientField.vue +143 -0
- package/components/fields/FSIconField.vue +9 -6
- package/components/fields/FSMagicConfigField.vue +154 -0
- package/components/fields/FSMagicField.vue +185 -0
- package/components/fields/FSNumberField.vue +3 -1
- package/components/fields/FSPasswordField.vue +10 -10
- package/components/fields/FSRichTextField.vue +136 -50
- package/components/fields/FSSearchField.vue +41 -62
- package/components/fields/FSSelectField.vue +148 -53
- package/components/fields/FSTagField.vue +19 -16
- package/components/fields/FSTermField.vue +192 -186
- package/components/fields/FSTextArea.vue +4 -4
- package/components/fields/FSTextField.vue +29 -6
- package/components/fields/FSTimeField.vue +55 -20
- package/components/fields/FSTimeSlotField.vue +6 -5
- package/components/fields/FSTranslateField.vue +234 -0
- package/components/fields/FSTranslateRichTextField.vue +185 -0
- package/components/fields/FSTreeViewField.vue +520 -0
- package/components/lists/FSDataIteratorItem.vue +18 -3
- package/components/lists/FSDataTableUI.vue +138 -51
- package/components/lists/FSFilterButton.vue +4 -2
- package/components/lists/FSHiddenButton.vue +4 -2
- package/components/map/FSMap.vue +598 -0
- package/components/map/FSMapEditPointAddressOverlay.vue +164 -0
- package/components/map/FSMapLayerButton.vue +77 -0
- package/components/map/FSMapOverlay.vue +150 -0
- package/components/selects/FSSelectAutoRefresh.vue +62 -0
- package/components/selects/FSSelectDashboardVariableType.vue +47 -0
- package/components/selects/FSSelectDateSetting.vue +39 -37
- package/components/selects/FSSelectDays.vue +62 -0
- package/components/tiles/FSDashboardOrganisationTileUI.vue +8 -8
- package/components/tiles/FSDashboardOrganisationTypeTileUI.vue +8 -8
- package/components/tiles/FSDashboardShallowTileUI.vue +8 -8
- package/components/tiles/FSDeviceOrganisationTileUI.vue +20 -15
- package/components/tiles/FSFolderTileUI.vue +7 -7
- package/components/tiles/FSGroupTileUI.vue +34 -27
- package/components/tiles/FSServiceAccountOrganisationTileUI.vue +142 -0
- package/components/tiles/{FSSimpleIconTileUI.vue → FSSimpleTileUI.vue} +48 -25
- package/components/tiles/FSTile.vue +51 -13
- package/components/tiles/FSUserOrganisationTileUI.vue +25 -34
- package/components/toggleSets/FSToggleSetPosition.vue +61 -0
- package/composables/index.ts +5 -1
- package/composables/useAddress.ts +158 -0
- package/composables/useAutocomplete.ts +4 -3
- package/composables/useColors.ts +8 -25
- package/composables/useDebounce.ts +2 -1
- package/composables/useMagicFieldProvider.ts +22 -0
- package/composables/useRules.ts +4 -12
- package/composables/useSlots.ts +65 -27
- package/composables/useTables.ts +29 -0
- package/composables/useTreeView.ts +48 -0
- package/elements/FSFormElement.ts +2 -1
- package/icons/flags/France.vue +21 -5
- package/icons/flags/Germany.vue +16 -4
- package/icons/flags/GreatBritain.vue +25 -6
- package/icons/flags/Italy.vue +21 -5
- package/icons/flags/Portugal.vue +225 -51
- package/icons/flags/Spain.vue +2781 -543
- package/icons/flags/UnitedStates.vue +31 -7
- package/icons/widgetTemplates/DevicesWidget.vue +189 -189
- package/icons/widgetTemplates/ProfileWidget.vue +9 -9
- package/icons/widgetTemplates/TextWidget.vue +6 -6
- package/models/breadcrumbs.ts +1 -1
- package/models/deviceAlerts.ts +1 -1
- package/models/deviceConnectivities.ts +1 -1
- package/models/index.ts +2 -0
- package/models/magicFields.ts +9 -0
- package/models/map.ts +18 -0
- package/models/richTextVariable.ts +5 -0
- package/models/rules.ts +11 -2
- package/models/tables.ts +30 -21
- package/models/variableNode.ts +104 -0
- package/package.json +21 -18
- package/plugins/colorPlugin.ts +2 -2
- package/plugins/index.ts +2 -1
- package/plugins/mapsPlugin.ts +37 -0
- package/shims-plugin.d.ts +2 -2
- package/shims-window.d.ts +3 -0
- package/styles/components/fs_button.scss +5 -0
- package/styles/components/fs_card.scss +0 -1
- package/styles/components/fs_col.scss +1 -0
- package/styles/components/fs_color_field.scss +12 -2
- package/styles/components/fs_data_iterator_item.scss +19 -6
- package/styles/components/fs_dialog.scss +12 -22
- package/styles/components/fs_gradient_field.scss +16 -0
- package/styles/components/fs_image_card.scss +18 -0
- package/styles/components/fs_magic_config_field.scss +13 -0
- package/styles/components/fs_map.scss +129 -0
- package/styles/components/fs_map_overlay.scss +38 -0
- package/styles/components/fs_meta_field.scss +6 -0
- package/styles/components/fs_option_group.scss +1 -0
- package/styles/components/fs_radio.scss +1 -1
- package/styles/components/fs_rich_text_field.scss +17 -5
- package/styles/components/fs_row.scss +1 -1
- package/styles/components/fs_select_field.scss +9 -14
- package/styles/components/fs_text.scss +1 -1
- package/styles/components/fs_time_field.scss +0 -4
- package/styles/components/fs_translate_field.scss +3 -0
- package/styles/components/fs_tree_view_field.scss +53 -0
- package/styles/components/index.scss +8 -1
- package/styles/globals/overrides.scss +54 -8
- package/styles/globals/scrollbars.scss +2 -2
- package/themes/default.ts +1 -1
- package/utils/gradient.ts +1601 -0
- package/utils/index.ts +3 -1
- package/utils/leafletMarkers.ts +23 -0
- package/utils/lexical.ts +3 -1
- package/components/selects/FSSelectTimeZone.vue +0 -67
- package/styles/components/fs_date_field.scss +0 -8
|
@@ -7,96 +7,40 @@
|
|
|
7
7
|
<template
|
|
8
8
|
#activator="{ props }"
|
|
9
9
|
>
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
<FSBaseField
|
|
11
|
+
class="fs-color-field"
|
|
12
|
+
:hideHeader="$props.hideHeader"
|
|
13
|
+
:required="$props.required"
|
|
14
|
+
:editable="$props.editable"
|
|
15
|
+
:modelValue="innerColor"
|
|
16
|
+
:description="$props.description"
|
|
17
|
+
:label="$props.label"
|
|
18
|
+
:style="style"
|
|
19
|
+
:width="$props.width"
|
|
20
|
+
v-bind="$attrs"
|
|
21
|
+
>
|
|
22
|
+
<FSCard
|
|
23
|
+
width="100%"
|
|
24
|
+
padding="8px"
|
|
13
25
|
v-bind="props"
|
|
26
|
+
:class="{ 'fs-color-field-disabled': !$props.editable }"
|
|
14
27
|
>
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
:hideHeader="$props.hideHeader"
|
|
18
|
-
:required="$props.required"
|
|
19
|
-
:editable="$props.editable"
|
|
20
|
-
:clearable="false"
|
|
21
|
-
:readonly="true"
|
|
22
|
-
:modelValue="innerColor"
|
|
23
|
-
v-bind="$attrs"
|
|
28
|
+
<FSRow
|
|
29
|
+
align="center-center"
|
|
24
30
|
>
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
:color="innerColor"
|
|
33
|
-
>
|
|
34
|
-
mdi-circle
|
|
35
|
-
</FSIcon>
|
|
36
|
-
</slot>
|
|
37
|
-
</template>
|
|
38
|
-
<template
|
|
39
|
-
#append
|
|
40
|
-
>
|
|
41
|
-
<FSButton
|
|
42
|
-
prependIcon="mdi-pencil"
|
|
43
|
-
variant="full"
|
|
44
|
-
:editable="$props.editable"
|
|
45
|
-
v-bind="props"
|
|
46
|
-
/>
|
|
47
|
-
</template>
|
|
48
|
-
</FSTextField>
|
|
49
|
-
<FSTextField
|
|
50
|
-
v-if="$props.allowOpacity && !$props.onlyBaseColors"
|
|
51
|
-
class="fs-color-field-opacity"
|
|
52
|
-
:label="$tr('ui.color-field.opacity', 'Opacity')"
|
|
53
|
-
:hideHeader="$props.hideHeader"
|
|
54
|
-
:required="$props.required"
|
|
55
|
-
:editable="$props.editable"
|
|
56
|
-
:clearable="false"
|
|
57
|
-
:readonly="true"
|
|
58
|
-
:modelValue="(Math.round(getPercentageFromHex(innerOpacity) * 100)) + ' %'"
|
|
59
|
-
>
|
|
60
|
-
<template
|
|
61
|
-
#prepend-inner
|
|
62
|
-
>
|
|
63
|
-
<slot
|
|
64
|
-
name="prepend-inner"
|
|
65
|
-
>
|
|
66
|
-
<FSIcon
|
|
67
|
-
:color="ColorEnum.Dark"
|
|
68
|
-
:editable="$props.editable"
|
|
69
|
-
:style="{ opacity: getPercentageFromHex(innerOpacity) }"
|
|
70
|
-
>
|
|
71
|
-
mdi-circle
|
|
72
|
-
</FSIcon>
|
|
73
|
-
</slot>
|
|
74
|
-
</template>
|
|
75
|
-
<template
|
|
76
|
-
#append
|
|
31
|
+
<FSIcon
|
|
32
|
+
:color="innerColor"
|
|
33
|
+
size="20px"
|
|
34
|
+
icon="mdi-circle-half"
|
|
35
|
+
/>
|
|
36
|
+
<FSText
|
|
37
|
+
font="text-overline"
|
|
77
38
|
>
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
/>
|
|
84
|
-
</template>
|
|
85
|
-
</FSTextField>
|
|
86
|
-
</FSRow>
|
|
87
|
-
<slot
|
|
88
|
-
name="description"
|
|
89
|
-
>
|
|
90
|
-
<FSSpan
|
|
91
|
-
v-if="$props.description"
|
|
92
|
-
class="fs-color-field-description"
|
|
93
|
-
font="text-underline"
|
|
94
|
-
:style="style"
|
|
95
|
-
>
|
|
96
|
-
{{ $props.description }}
|
|
97
|
-
</FSSpan>
|
|
98
|
-
</slot>
|
|
99
|
-
</FSCol>
|
|
39
|
+
{{ innerColor }}
|
|
40
|
+
</FSText>
|
|
41
|
+
</FSRow>
|
|
42
|
+
</FSCard>
|
|
43
|
+
</FSBaseField>
|
|
100
44
|
</template>
|
|
101
45
|
<FSCard
|
|
102
46
|
:elevation="true"
|
|
@@ -133,30 +77,35 @@
|
|
|
133
77
|
</template>
|
|
134
78
|
|
|
135
79
|
<script lang="ts">
|
|
136
|
-
import { computed, defineComponent, PropType, ref } from "vue";
|
|
80
|
+
import { computed, defineComponent, type PropType, ref, watch } from "vue";
|
|
137
81
|
|
|
138
82
|
import { getPercentageFromHex, getHexFromPercentage } from "@dative-gpi/foundation-shared-components/utils";
|
|
139
83
|
import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
140
84
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
141
85
|
|
|
142
|
-
import
|
|
143
|
-
import FSButton from "../FSButton.vue";
|
|
86
|
+
import FSBaseField from "./FSBaseField.vue";
|
|
144
87
|
import FSCard from "../FSCard.vue";
|
|
145
88
|
import FSIcon from "../FSIcon.vue";
|
|
89
|
+
import FSText from "../FSText.vue";
|
|
146
90
|
import FSRow from "../FSRow.vue";
|
|
147
91
|
import FSCol from "../FSCol.vue";
|
|
148
92
|
|
|
149
93
|
export default defineComponent({
|
|
150
94
|
name: "FSColorField",
|
|
151
95
|
components: {
|
|
152
|
-
|
|
153
|
-
|
|
96
|
+
FSBaseField,
|
|
97
|
+
FSText,
|
|
154
98
|
FSCard,
|
|
155
99
|
FSIcon,
|
|
156
100
|
FSCol,
|
|
157
101
|
FSRow
|
|
158
102
|
},
|
|
159
103
|
props: {
|
|
104
|
+
label: {
|
|
105
|
+
type: String as PropType<string | null>,
|
|
106
|
+
required: false,
|
|
107
|
+
default: null
|
|
108
|
+
},
|
|
160
109
|
description: {
|
|
161
110
|
type: String as PropType<string | null>,
|
|
162
111
|
required: false,
|
|
@@ -196,6 +145,11 @@ export default defineComponent({
|
|
|
196
145
|
type: Boolean,
|
|
197
146
|
required: false,
|
|
198
147
|
default: false
|
|
148
|
+
},
|
|
149
|
+
width: {
|
|
150
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
151
|
+
required: false,
|
|
152
|
+
default: "fill"
|
|
199
153
|
}
|
|
200
154
|
},
|
|
201
155
|
emits: ["update:modelValue", "update:opacity"],
|
|
@@ -209,18 +163,25 @@ export default defineComponent({
|
|
|
209
163
|
const darks = getColors(ColorEnum.Dark);
|
|
210
164
|
|
|
211
165
|
const menu = ref(false);
|
|
212
|
-
|
|
166
|
+
|
|
167
|
+
const innerColor = ref(getColors(props.modelValue).base);
|
|
213
168
|
const innerOpacity = ref(getHexFromPercentage(props.opacityValue));
|
|
214
169
|
const fullColor = ref(innerColor.value + innerOpacity.value);
|
|
215
170
|
|
|
216
171
|
const style = computed((): { [key: string]: string | undefined } => {
|
|
217
172
|
if (!props.editable) {
|
|
218
173
|
return {
|
|
219
|
-
"--fs-color-field-
|
|
174
|
+
"--fs-color-field-cursor" : "default",
|
|
175
|
+
"--fs-color-field-border-color" : lights.base,
|
|
176
|
+
"--fs-color-field-color" : lights.dark,
|
|
177
|
+
"--fs-color-field-colorvalue" : fullColor.value,
|
|
220
178
|
};
|
|
221
179
|
}
|
|
222
180
|
return {
|
|
223
|
-
"--fs-color-field-
|
|
181
|
+
"--fs-color-field-cursor" : "pointer",
|
|
182
|
+
"--fs-color-field-border-color" : lights.dark,
|
|
183
|
+
"--fs-color-field-color" : darks.base,
|
|
184
|
+
"--fs-color-field-colorvalue" : fullColor.value,
|
|
224
185
|
};
|
|
225
186
|
});
|
|
226
187
|
|
|
@@ -233,6 +194,16 @@ export default defineComponent({
|
|
|
233
194
|
emit("update:opacity", getPercentageFromHex(innerOpacity.value));
|
|
234
195
|
};
|
|
235
196
|
|
|
197
|
+
const reset = (): void => {
|
|
198
|
+
innerColor.value = getColors(props.modelValue)['base'];
|
|
199
|
+
innerOpacity.value = getHexFromPercentage(props.opacityValue);
|
|
200
|
+
fullColor.value = innerColor.value + innerOpacity.value;
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
watch(() => props.modelValue, () => {
|
|
204
|
+
reset();
|
|
205
|
+
});
|
|
206
|
+
|
|
236
207
|
return {
|
|
237
208
|
getPercentageFromHex,
|
|
238
209
|
getBasePaletteColors,
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
:modelValue="epochToLongDateFormat($props.modelValue)"
|
|
20
20
|
@update:modelValue="onClear"
|
|
21
21
|
@click="openMobileOverlay"
|
|
22
|
-
@blur="blurred = true"
|
|
23
22
|
>
|
|
24
23
|
<template
|
|
25
24
|
#prepend-inner
|
|
@@ -95,7 +94,6 @@
|
|
|
95
94
|
:validationValue="$props.modelValue"
|
|
96
95
|
:modelValue="epochToLongDateFormat($props.modelValue)"
|
|
97
96
|
@update:modelValue="onClear"
|
|
98
|
-
@blur="blurred = true"
|
|
99
97
|
v-bind="props"
|
|
100
98
|
>
|
|
101
99
|
<template
|
|
@@ -149,10 +147,11 @@
|
|
|
149
147
|
</template>
|
|
150
148
|
|
|
151
149
|
<script lang="ts">
|
|
152
|
-
import { computed, defineComponent, PropType, ref } from "vue";
|
|
150
|
+
import { computed, defineComponent, type PropType, ref, watch } from "vue";
|
|
151
|
+
import _ from "lodash";
|
|
153
152
|
|
|
154
|
-
import { useBreakpoints,
|
|
155
|
-
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
153
|
+
import { useBreakpoints, useRules } from "@dative-gpi/foundation-shared-components/composables";
|
|
154
|
+
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
156
155
|
import { useAppTimeZone } from "@dative-gpi/foundation-shared-services/composables";
|
|
157
156
|
|
|
158
157
|
import FSDialogMenu from "../FSDialogMenu.vue";
|
|
@@ -216,31 +215,15 @@ export default defineComponent({
|
|
|
216
215
|
},
|
|
217
216
|
emits: ["update:modelValue"],
|
|
218
217
|
setup(props, { emit }) {
|
|
219
|
-
const { validateOn, blurred, getMessages} = useRules();
|
|
220
218
|
const { epochToLongDateFormat } = useAppTimeZone();
|
|
219
|
+
const { validateOn, getMessages} = useRules();
|
|
221
220
|
const { isExtraSmall } = useBreakpoints();
|
|
222
|
-
const { getColors } = useColors();
|
|
223
221
|
|
|
224
222
|
const dialog = ref(false);
|
|
225
223
|
const menu = ref(false);
|
|
224
|
+
|
|
226
225
|
const innerDate = ref<number | null>(props.modelValue);
|
|
227
226
|
|
|
228
|
-
const errors = getColors(ColorEnum.Error);
|
|
229
|
-
const lights = getColors(ColorEnum.Light);
|
|
230
|
-
const darks = getColors(ColorEnum.Dark);
|
|
231
|
-
|
|
232
|
-
const style = computed((): { [key: string] : string | null | undefined } => {
|
|
233
|
-
if (!props.editable) {
|
|
234
|
-
return {
|
|
235
|
-
"--fs-date-field-color": lights.dark
|
|
236
|
-
};
|
|
237
|
-
}
|
|
238
|
-
return {
|
|
239
|
-
"--fs-date-field-color" : darks.base,
|
|
240
|
-
"--fs-date-field-error-color": errors.base
|
|
241
|
-
};
|
|
242
|
-
});
|
|
243
|
-
|
|
244
227
|
const messages = computed((): string[] => getMessages(props.modelValue, props.rules));
|
|
245
228
|
|
|
246
229
|
const openMobileOverlay = () => {
|
|
@@ -261,15 +244,19 @@ export default defineComponent({
|
|
|
261
244
|
menu.value = false;
|
|
262
245
|
};
|
|
263
246
|
|
|
247
|
+
watch(() => props.modelValue, () => {
|
|
248
|
+
if (!_.isEqual(innerDate.value, props.modelValue)) {
|
|
249
|
+
innerDate.value = props.modelValue;
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
|
|
264
253
|
return {
|
|
265
254
|
isExtraSmall,
|
|
266
255
|
validateOn,
|
|
267
256
|
ColorEnum,
|
|
268
257
|
innerDate,
|
|
269
258
|
messages,
|
|
270
|
-
blurred,
|
|
271
259
|
dialog,
|
|
272
|
-
style,
|
|
273
260
|
menu,
|
|
274
261
|
epochToLongDateFormat,
|
|
275
262
|
openMobileOverlay,
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
:modelValue="toShortDateFormat"
|
|
16
16
|
@click="onClick"
|
|
17
17
|
@update:modelValue="onClear"
|
|
18
|
-
@blur="blurred = true"
|
|
19
18
|
>
|
|
20
19
|
<template
|
|
21
20
|
#prepend-inner
|
|
@@ -59,11 +58,12 @@
|
|
|
59
58
|
</template>
|
|
60
59
|
|
|
61
60
|
<script lang="ts">
|
|
62
|
-
import { computed, defineComponent, PropType, ref } from "vue";
|
|
61
|
+
import { computed, defineComponent, type PropType, ref, watch } from "vue";
|
|
62
|
+
import _ from "lodash";
|
|
63
63
|
|
|
64
|
-
import {
|
|
65
|
-
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
64
|
+
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
66
65
|
import { useAppTimeZone } from "@dative-gpi/foundation-shared-services/composables";
|
|
66
|
+
import { useRules } from "@dative-gpi/foundation-shared-components/composables";
|
|
67
67
|
|
|
68
68
|
import FSDialogSubmit from "../FSDialogSubmit.vue";
|
|
69
69
|
import FSCalendarTwin from "../FSCalendarTwin.vue";
|
|
@@ -122,29 +122,13 @@ export default defineComponent({
|
|
|
122
122
|
},
|
|
123
123
|
emits: ["update:modelValue"],
|
|
124
124
|
setup(props, { emit }) {
|
|
125
|
-
const { validateOn,
|
|
125
|
+
const { validateOn, getMessages } = useRules();
|
|
126
126
|
const { epochToShortDateFormat } = useAppTimeZone();
|
|
127
|
-
const { getColors } = useColors();
|
|
128
|
-
|
|
129
|
-
const errors = getColors(ColorEnum.Error);
|
|
130
|
-
const lights = getColors(ColorEnum.Light);
|
|
131
|
-
const darks = getColors(ColorEnum.Dark);
|
|
132
127
|
|
|
133
128
|
const dialog = ref(false);
|
|
129
|
+
|
|
134
130
|
const innerDateRange = ref<number[] | null>(props.modelValue);
|
|
135
131
|
|
|
136
|
-
const style = computed((): { [key: string] : string | null | undefined } => {
|
|
137
|
-
if (!props.editable) {
|
|
138
|
-
return {
|
|
139
|
-
"--fs-date-field-color": lights.dark
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
return {
|
|
143
|
-
"--fs-date-field-color" : darks.base,
|
|
144
|
-
"--fs-date-field-error-color": errors.base
|
|
145
|
-
};
|
|
146
|
-
});
|
|
147
|
-
|
|
148
132
|
const toShortDateFormat = computed((): string => {
|
|
149
133
|
if (!props.modelValue || !Array.isArray(props.modelValue) || !props.modelValue.length) {
|
|
150
134
|
return "";
|
|
@@ -170,15 +154,19 @@ export default defineComponent({
|
|
|
170
154
|
dialog.value = false;
|
|
171
155
|
};
|
|
172
156
|
|
|
157
|
+
watch(() => props.modelValue, () => {
|
|
158
|
+
if (!_.isEqual(innerDateRange.value, props.modelValue)) {
|
|
159
|
+
innerDateRange.value = props.modelValue;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
|
|
173
163
|
return {
|
|
174
|
-
|
|
164
|
+
toShortDateFormat,
|
|
165
|
+
innerDateRange,
|
|
175
166
|
validateOn,
|
|
167
|
+
ColorEnum,
|
|
176
168
|
messages,
|
|
177
|
-
blurred,
|
|
178
|
-
style,
|
|
179
169
|
dialog,
|
|
180
|
-
toShortDateFormat,
|
|
181
|
-
innerDateRange,
|
|
182
170
|
onClick,
|
|
183
171
|
onClear,
|
|
184
172
|
onSubmit
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
:modelValue="epochToLongTimeFormat($props.modelValue)"
|
|
20
20
|
@update:modelValue="onClear"
|
|
21
21
|
@click="openMobileOverlay"
|
|
22
|
-
@blur="blurred = true"
|
|
23
22
|
>
|
|
24
23
|
<template
|
|
25
24
|
#prepend-inner
|
|
@@ -115,7 +114,6 @@
|
|
|
115
114
|
:validationValue="$props.modelValue"
|
|
116
115
|
:modelValue="epochToLongTimeFormat($props.modelValue)"
|
|
117
116
|
@update:modelValue="onClear"
|
|
118
|
-
@blur="blurred = true"
|
|
119
117
|
v-bind="props"
|
|
120
118
|
>
|
|
121
119
|
<template
|
|
@@ -195,10 +193,10 @@
|
|
|
195
193
|
</template>
|
|
196
194
|
|
|
197
195
|
<script lang="ts">
|
|
198
|
-
import { computed, defineComponent, PropType, ref, watch } from "vue";
|
|
196
|
+
import { computed, defineComponent, type PropType, ref, watch } from "vue";
|
|
199
197
|
|
|
200
|
-
import { useBreakpoints,
|
|
201
|
-
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
198
|
+
import { useBreakpoints, useRules } from "@dative-gpi/foundation-shared-components/composables";
|
|
199
|
+
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
202
200
|
import { useAppTimeZone } from "@dative-gpi/foundation-shared-services/composables";
|
|
203
201
|
|
|
204
202
|
import FSDialogMenu from "../FSDialogMenu.vue";
|
|
@@ -267,39 +265,16 @@ export default defineComponent({
|
|
|
267
265
|
emits: ["update:modelValue"],
|
|
268
266
|
setup(props, { emit }) {
|
|
269
267
|
const { getUserOffsetMillis, epochToLongTimeFormat } = useAppTimeZone();
|
|
270
|
-
const { validateOn,
|
|
268
|
+
const { validateOn, getMessages } = useRules();
|
|
271
269
|
const { isExtraSmall } = useBreakpoints();
|
|
272
|
-
const { getColors } = useColors();
|
|
273
270
|
|
|
274
271
|
const dialog = ref(false);
|
|
275
272
|
const menu = ref(false);
|
|
276
273
|
const tabs = ref(0);
|
|
274
|
+
|
|
277
275
|
const innerDate = ref<number | null>(null);
|
|
278
276
|
const innerTime = ref(0);
|
|
279
277
|
|
|
280
|
-
const errors = getColors(ColorEnum.Error);
|
|
281
|
-
const lights = getColors(ColorEnum.Light);
|
|
282
|
-
const darks = getColors(ColorEnum.Dark);
|
|
283
|
-
|
|
284
|
-
if (props.modelValue) {
|
|
285
|
-
// FSClock just gives two numbers without consideration for the time zone
|
|
286
|
-
// We must adjust the time to the user's time zone
|
|
287
|
-
innerTime.value = Math.floor((props.modelValue + getUserOffsetMillis()) % (24 * 60 * 60 * 1000));
|
|
288
|
-
innerDate.value = props.modelValue - innerTime.value;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
const style = computed((): { [key: string] : string | null | undefined } => {
|
|
292
|
-
if (!props.editable) {
|
|
293
|
-
return {
|
|
294
|
-
"--fs-date-field-color": lights.dark
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
return {
|
|
298
|
-
"--fs-date-field-color" : darks.base,
|
|
299
|
-
"--fs-date-field-error-color": errors.base
|
|
300
|
-
};
|
|
301
|
-
});
|
|
302
|
-
|
|
303
278
|
const messages = computed((): string[] => getMessages(props.modelValue, props.rules));
|
|
304
279
|
|
|
305
280
|
const openMobileOverlay = () => {
|
|
@@ -321,6 +296,23 @@ export default defineComponent({
|
|
|
321
296
|
menu.value = false;
|
|
322
297
|
};
|
|
323
298
|
|
|
299
|
+
const reset = (): void => {
|
|
300
|
+
if (props.modelValue) {
|
|
301
|
+
// FSClock just gives two numbers without consideration for the time zone
|
|
302
|
+
// We must adjust the time to the user's time zone
|
|
303
|
+
innerTime.value = Math.floor((props.modelValue + getUserOffsetMillis()) % (24 * 60 * 60 * 1000));
|
|
304
|
+
innerDate.value = props.modelValue - innerTime.value;
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
innerDate.value = null;
|
|
308
|
+
innerTime.value = 0;
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
watch(() => props.modelValue, () => {
|
|
313
|
+
reset();
|
|
314
|
+
}, { immediate: true });
|
|
315
|
+
|
|
324
316
|
watch([menu, dialog], (): void => {
|
|
325
317
|
if (!menu.value && !dialog.value) {
|
|
326
318
|
setTimeout(() => tabs.value = 0, 290);
|
|
@@ -334,9 +326,7 @@ export default defineComponent({
|
|
|
334
326
|
innerDate,
|
|
335
327
|
innerTime,
|
|
336
328
|
messages,
|
|
337
|
-
blurred,
|
|
338
329
|
dialog,
|
|
339
|
-
style,
|
|
340
330
|
menu,
|
|
341
331
|
tabs,
|
|
342
332
|
epochToLongTimeFormat,
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
:modelValue="toShortTimeFormat"
|
|
16
16
|
@click="onClick"
|
|
17
17
|
@update:modelValue="onClear"
|
|
18
|
-
@blur="blurred = true"
|
|
19
18
|
>
|
|
20
19
|
<template
|
|
21
20
|
#prepend-inner
|
|
@@ -77,11 +76,11 @@
|
|
|
77
76
|
</template>
|
|
78
77
|
|
|
79
78
|
<script lang="ts">
|
|
80
|
-
import { computed, defineComponent, PropType, ref } from "vue";
|
|
79
|
+
import { computed, defineComponent, type PropType, ref, watch } from "vue";
|
|
81
80
|
|
|
82
|
-
import {
|
|
83
|
-
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
81
|
+
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
84
82
|
import { useAppTimeZone } from "@dative-gpi/foundation-shared-services/composables";
|
|
83
|
+
import { useRules } from "@dative-gpi/foundation-shared-components/composables";
|
|
85
84
|
|
|
86
85
|
import FSDialogSubmit from "../FSDialogSubmit.vue";
|
|
87
86
|
import FSCalendarTwin from "../FSCalendarTwin.vue";
|
|
@@ -147,51 +146,14 @@ export default defineComponent({
|
|
|
147
146
|
emits: ["update:modelValue"],
|
|
148
147
|
setup(props, { emit }) {
|
|
149
148
|
const { getUserOffsetMillis, epochToShortTimeFormat } = useAppTimeZone();
|
|
150
|
-
const { validateOn,
|
|
151
|
-
const { getColors } = useColors();
|
|
152
|
-
|
|
153
|
-
const errors = getColors(ColorEnum.Error);
|
|
154
|
-
const lights = getColors(ColorEnum.Light);
|
|
155
|
-
const darks = getColors(ColorEnum.Dark);
|
|
149
|
+
const { validateOn, getMessages } = useRules();
|
|
156
150
|
|
|
157
151
|
const dialog = ref(false);
|
|
152
|
+
|
|
158
153
|
const innerDateRange = ref<number[] | null>(null);
|
|
159
154
|
const innerTimeRight = ref(0);
|
|
160
155
|
const innerTimeLeft = ref(0);
|
|
161
156
|
|
|
162
|
-
if (props.modelValue && Array.isArray(props.modelValue)) {
|
|
163
|
-
// FSClock just gives two numbers without consideration for the time zone
|
|
164
|
-
// We must adjust the time to the user's time zone
|
|
165
|
-
switch (props.modelValue.length) {
|
|
166
|
-
case 0: {
|
|
167
|
-
break;
|
|
168
|
-
}
|
|
169
|
-
case 1: {
|
|
170
|
-
innerTimeLeft.value = Math.floor((props.modelValue[0] + getUserOffsetMillis()) % (24 * 60 * 60 * 1000));
|
|
171
|
-
innerDateRange.value = [props.modelValue[0] - innerTimeLeft.value];
|
|
172
|
-
break;
|
|
173
|
-
}
|
|
174
|
-
default: {
|
|
175
|
-
innerTimeLeft.value = Math.floor((props.modelValue[0] + getUserOffsetMillis()) % (24 * 60 * 60 * 1000));
|
|
176
|
-
innerTimeRight.value = Math.floor((props.modelValue[1] + getUserOffsetMillis()) % (24 * 60 * 60 * 1000));
|
|
177
|
-
innerDateRange.value = [props.modelValue[0] - innerTimeLeft.value, props.modelValue[1] - innerTimeRight.value];
|
|
178
|
-
break;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
const style = computed((): { [key: string] : string | null | undefined } => {
|
|
184
|
-
if (!props.editable) {
|
|
185
|
-
return {
|
|
186
|
-
"--fs-date-field-color": lights.dark
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
return {
|
|
190
|
-
"--fs-date-field-color" : darks.base,
|
|
191
|
-
"--fs-date-field-error-color": errors.base
|
|
192
|
-
};
|
|
193
|
-
});
|
|
194
|
-
|
|
195
157
|
const toShortTimeFormat = computed((): string => {
|
|
196
158
|
if (!props.modelValue || !Array.isArray(props.modelValue) || !props.modelValue.length) {
|
|
197
159
|
return "";
|
|
@@ -235,22 +197,52 @@ export default defineComponent({
|
|
|
235
197
|
dialog.value = false;
|
|
236
198
|
};
|
|
237
199
|
|
|
200
|
+
const reset = (): void => {
|
|
201
|
+
if (props.modelValue && Array.isArray(props.modelValue)) {
|
|
202
|
+
// FSClock just gives two numbers without consideration for the time zone
|
|
203
|
+
// We must adjust the time to the user's time zone
|
|
204
|
+
switch (props.modelValue.length) {
|
|
205
|
+
case 0: {
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
case 1: {
|
|
209
|
+
innerTimeLeft.value = Math.floor((props.modelValue[0] + getUserOffsetMillis()) % (24 * 60 * 60 * 1000));
|
|
210
|
+
innerDateRange.value = [props.modelValue[0] - innerTimeLeft.value];
|
|
211
|
+
break;
|
|
212
|
+
}
|
|
213
|
+
default: {
|
|
214
|
+
innerTimeLeft.value = Math.floor((props.modelValue[0] + getUserOffsetMillis()) % (24 * 60 * 60 * 1000));
|
|
215
|
+
innerTimeRight.value = Math.floor((props.modelValue[1] + getUserOffsetMillis()) % (24 * 60 * 60 * 1000));
|
|
216
|
+
innerDateRange.value = [props.modelValue[0] - innerTimeLeft.value, props.modelValue[1] - innerTimeRight.value];
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
innerDateRange.value = null;
|
|
223
|
+
innerTimeLeft.value = 0;
|
|
224
|
+
innerTimeRight.value = 0;
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
watch(() => props.modelValue, () => {
|
|
229
|
+
reset();
|
|
230
|
+
}, { immediate: true });
|
|
231
|
+
|
|
238
232
|
return {
|
|
239
|
-
ColorEnum,
|
|
240
|
-
validateOn,
|
|
241
|
-
messages,
|
|
242
|
-
blurred,
|
|
243
|
-
style,
|
|
244
|
-
dialog,
|
|
245
233
|
toShortTimeFormat,
|
|
246
234
|
innerDateLeft,
|
|
247
235
|
innerTimeLeft,
|
|
248
236
|
innerDateRight,
|
|
249
237
|
innerTimeRight,
|
|
250
238
|
innerDateRange,
|
|
251
|
-
|
|
239
|
+
validateOn,
|
|
240
|
+
ColorEnum,
|
|
241
|
+
messages,
|
|
242
|
+
dialog,
|
|
243
|
+
onSubmit,
|
|
252
244
|
onClear,
|
|
253
|
-
|
|
245
|
+
onClick
|
|
254
246
|
};
|
|
255
247
|
}
|
|
256
248
|
});
|