@dative-gpi/foundation-shared-components 0.1.120 → 1.0.0
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 +210 -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 +7 -5
- package/components/tiles/FSDashboardOrganisationTypeTileUI.vue +7 -5
- package/components/tiles/FSDashboardShallowTileUI.vue +7 -5
- package/components/tiles/FSDeviceOrganisationTileUI.vue +11 -12
- package/components/tiles/FSFolderTileUI.vue +8 -6
- package/components/tiles/FSGroupTileUI.vue +13 -15
- package/components/tiles/{FSSimpleIconTileUI.vue → FSSimpleTileUI.vue} +29 -15
- package/components/tiles/FSTile.vue +5 -11
- package/components/tiles/FSUserOrganisationTileUI.vue +2 -1
- 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 +46 -26
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<FSSimpleTileUI
|
|
3
3
|
:bottomColor="color"
|
|
4
4
|
:icon="$props.icon"
|
|
5
5
|
v-bind="$attrs"
|
|
@@ -7,11 +7,13 @@
|
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
9
|
<script lang="ts">
|
|
10
|
-
import {
|
|
10
|
+
import type { PropType } from "vue";
|
|
11
|
+
import { computed, defineComponent } from "vue";
|
|
11
12
|
|
|
12
|
-
import { ColorBase
|
|
13
|
+
import type { ColorBase} from "@dative-gpi/foundation-shared-components/models";
|
|
14
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
13
15
|
|
|
14
|
-
import
|
|
16
|
+
import FSSimpleTileUI from "./FSSimpleTileUI.vue";
|
|
15
17
|
|
|
16
18
|
export default defineComponent({
|
|
17
19
|
name: "FSDashboardOrganisationTileUI",
|
|
@@ -28,7 +30,7 @@ export default defineComponent({
|
|
|
28
30
|
}
|
|
29
31
|
},
|
|
30
32
|
components: {
|
|
31
|
-
|
|
33
|
+
FSSimpleTileUI
|
|
32
34
|
},
|
|
33
35
|
setup(props){
|
|
34
36
|
const color = computed(() => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<FSSimpleTileUI
|
|
3
3
|
:bottomColor="color"
|
|
4
4
|
:icon="$props.icon"
|
|
5
5
|
v-bind="$attrs"
|
|
@@ -7,11 +7,13 @@
|
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
9
|
<script lang="ts">
|
|
10
|
-
import {
|
|
10
|
+
import type { PropType } from "vue";
|
|
11
|
+
import { computed, defineComponent } from "vue";
|
|
11
12
|
|
|
12
|
-
import { ColorBase
|
|
13
|
+
import type { ColorBase} from "@dative-gpi/foundation-shared-components/models";
|
|
14
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
13
15
|
|
|
14
|
-
import
|
|
16
|
+
import FSSimpleTileUI from "./FSSimpleTileUI.vue";
|
|
15
17
|
|
|
16
18
|
export default defineComponent({
|
|
17
19
|
name: "FSDashboardOrganisationTypeTileUI",
|
|
@@ -28,7 +30,7 @@ export default defineComponent({
|
|
|
28
30
|
}
|
|
29
31
|
},
|
|
30
32
|
components: {
|
|
31
|
-
|
|
33
|
+
FSSimpleTileUI
|
|
32
34
|
},
|
|
33
35
|
setup(props){
|
|
34
36
|
const color = computed(() => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<FSSimpleTileUI
|
|
3
3
|
:bottomColor="color"
|
|
4
4
|
:icon="$props.icon"
|
|
5
5
|
v-bind="$attrs"
|
|
@@ -7,11 +7,13 @@
|
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
9
|
<script lang="ts">
|
|
10
|
-
import {
|
|
10
|
+
import type { PropType } from "vue";
|
|
11
|
+
import { computed, defineComponent } from "vue";
|
|
11
12
|
|
|
12
|
-
import { ColorBase
|
|
13
|
+
import type { ColorBase} from "@dative-gpi/foundation-shared-components/models";
|
|
14
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
13
15
|
|
|
14
|
-
import
|
|
16
|
+
import FSSimpleTileUI from "./FSSimpleTileUI.vue";
|
|
15
17
|
|
|
16
18
|
export default defineComponent({
|
|
17
19
|
name: "FSDashboardShallowTileUI",
|
|
@@ -28,7 +30,7 @@ export default defineComponent({
|
|
|
28
30
|
}
|
|
29
31
|
},
|
|
30
32
|
components: {
|
|
31
|
-
|
|
33
|
+
FSSimpleTileUI
|
|
32
34
|
},
|
|
33
35
|
setup(props){
|
|
34
36
|
const color = computed(() => {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
:bottomColor="ColorEnum.Primary"
|
|
4
4
|
:editable="$props.editable"
|
|
5
5
|
:modelValue="$props.modelValue"
|
|
6
|
+
:width="$props.width"
|
|
6
7
|
v-bind="$attrs"
|
|
7
8
|
>
|
|
8
9
|
<FSCol
|
|
@@ -17,10 +18,10 @@
|
|
|
17
18
|
>
|
|
18
19
|
<FSCol
|
|
19
20
|
gap="12px"
|
|
21
|
+
:width="`calc(100% - ${imageSize}px - 24px)`"
|
|
20
22
|
>
|
|
21
23
|
<FSCol
|
|
22
24
|
gap="6px"
|
|
23
|
-
:width="infoWidth"
|
|
24
25
|
>
|
|
25
26
|
<FSText
|
|
26
27
|
font="text-button"
|
|
@@ -63,9 +64,10 @@
|
|
|
63
64
|
</template>
|
|
64
65
|
|
|
65
66
|
<script lang="ts">
|
|
66
|
-
import {
|
|
67
|
+
import type { PropType } from "vue";
|
|
68
|
+
import { computed, defineComponent } from "vue";
|
|
67
69
|
|
|
68
|
-
import { FSModelStatus, FSDeviceStatus, FSDeviceAlert, FSDeviceConnectivity } from "@dative-gpi/foundation-shared-components/models";
|
|
70
|
+
import type { FSModelStatus, FSDeviceStatus, FSDeviceAlert, FSDeviceConnectivity } from "@dative-gpi/foundation-shared-components/models";
|
|
69
71
|
import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
|
|
70
72
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
71
73
|
|
|
@@ -140,7 +142,12 @@ export default defineComponent({
|
|
|
140
142
|
type: Boolean,
|
|
141
143
|
required: false,
|
|
142
144
|
default: true
|
|
143
|
-
}
|
|
145
|
+
},
|
|
146
|
+
width: {
|
|
147
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
148
|
+
required: false,
|
|
149
|
+
default: () => [352, 336]
|
|
150
|
+
},
|
|
144
151
|
},
|
|
145
152
|
setup(props) {
|
|
146
153
|
const { isMobileSized } = useBreakpoints();
|
|
@@ -189,13 +196,6 @@ export default defineComponent({
|
|
|
189
196
|
return isMobileSized.value ? 90 : 100;
|
|
190
197
|
});
|
|
191
198
|
|
|
192
|
-
const infoWidth = computed((): number => {
|
|
193
|
-
let width = isMobileSized.value ? 288 : 304;
|
|
194
|
-
if (props.imageId) {
|
|
195
|
-
width -= imageSize.value;
|
|
196
|
-
}
|
|
197
|
-
return width;
|
|
198
|
-
});
|
|
199
199
|
|
|
200
200
|
return {
|
|
201
201
|
carouselDeviceStatuses,
|
|
@@ -204,7 +204,6 @@ export default defineComponent({
|
|
|
204
204
|
singleModelStatuses,
|
|
205
205
|
ColorEnum,
|
|
206
206
|
imageSize,
|
|
207
|
-
infoWidth
|
|
208
207
|
};
|
|
209
208
|
}
|
|
210
209
|
});
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<FSSimpleTileUI
|
|
3
|
+
:iconBackgroundColor="true"
|
|
3
4
|
:bottomColor="color"
|
|
4
5
|
:icon="$props.icon"
|
|
5
|
-
:iconBackgroundColor="true"
|
|
6
6
|
v-bind="$attrs"
|
|
7
7
|
/>
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
10
|
<script lang="ts">
|
|
11
|
-
import {
|
|
11
|
+
import type { PropType } from "vue";
|
|
12
|
+
import { computed, defineComponent } from "vue";
|
|
12
13
|
|
|
13
|
-
import { ColorBase
|
|
14
|
+
import type { ColorBase} from "@dative-gpi/foundation-shared-components/models";
|
|
15
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
14
16
|
|
|
15
|
-
import
|
|
17
|
+
import FSSimpleTileUI from "./FSSimpleTileUI.vue";
|
|
16
18
|
|
|
17
19
|
export default defineComponent({
|
|
18
20
|
name: "FSFolderTileUI",
|
|
@@ -29,7 +31,7 @@ export default defineComponent({
|
|
|
29
31
|
}
|
|
30
32
|
},
|
|
31
33
|
components: {
|
|
32
|
-
|
|
34
|
+
FSSimpleTileUI
|
|
33
35
|
},
|
|
34
36
|
setup(props){
|
|
35
37
|
const color = computed(() => {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
:bottomColor="ColorEnum.Error"
|
|
4
4
|
:editable="$props.editable"
|
|
5
5
|
:modelValue="$props.modelValue"
|
|
6
|
+
:width="$props.width"
|
|
6
7
|
v-bind="$attrs"
|
|
7
8
|
>
|
|
8
9
|
<FSCol
|
|
@@ -17,10 +18,10 @@
|
|
|
17
18
|
>
|
|
18
19
|
<FSCol
|
|
19
20
|
gap="12px"
|
|
21
|
+
:width="`calc(100% - ${imageSize}px - 24px)`"
|
|
20
22
|
>
|
|
21
23
|
<FSCol
|
|
22
24
|
gap="6px"
|
|
23
|
-
:width="infoWidth"
|
|
24
25
|
>
|
|
25
26
|
<FSText
|
|
26
27
|
font="text-button"
|
|
@@ -100,7 +101,8 @@
|
|
|
100
101
|
</template>
|
|
101
102
|
|
|
102
103
|
<script lang="ts">
|
|
103
|
-
import {
|
|
104
|
+
import type { PropType } from "vue";
|
|
105
|
+
import { computed, defineComponent } from "vue";
|
|
104
106
|
|
|
105
107
|
import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
|
|
106
108
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
@@ -139,12 +141,12 @@ export default defineComponent({
|
|
|
139
141
|
default: null
|
|
140
142
|
},
|
|
141
143
|
recursiveGroupsIds: {
|
|
142
|
-
type: Array as PropType<
|
|
144
|
+
type: Array as PropType<string[]>,
|
|
143
145
|
required: false,
|
|
144
146
|
default: () => []
|
|
145
147
|
},
|
|
146
148
|
recursiveDeviceOrganisationsIds: {
|
|
147
|
-
type: Array as PropType<
|
|
149
|
+
type: Array as PropType<string[]>,
|
|
148
150
|
required: false,
|
|
149
151
|
default: () => []
|
|
150
152
|
},
|
|
@@ -157,7 +159,12 @@ export default defineComponent({
|
|
|
157
159
|
type: Boolean,
|
|
158
160
|
required: false,
|
|
159
161
|
default: true
|
|
160
|
-
}
|
|
162
|
+
},
|
|
163
|
+
width: {
|
|
164
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
165
|
+
required: false,
|
|
166
|
+
default: () => [352, 336]
|
|
167
|
+
},
|
|
161
168
|
},
|
|
162
169
|
setup(props) {
|
|
163
170
|
const { isMobileSized } = useBreakpoints();
|
|
@@ -174,20 +181,11 @@ export default defineComponent({
|
|
|
174
181
|
return isMobileSized.value ? 90 : 100;
|
|
175
182
|
});
|
|
176
183
|
|
|
177
|
-
const infoWidth = computed((): number => {
|
|
178
|
-
let width = isMobileSized.value ? 288 : 304;
|
|
179
|
-
if (props.imageId) {
|
|
180
|
-
width -= imageSize.value;
|
|
181
|
-
}
|
|
182
|
-
return width;
|
|
183
|
-
});
|
|
184
|
-
|
|
185
184
|
return {
|
|
186
185
|
ColorEnum,
|
|
187
186
|
groupsLabel,
|
|
188
187
|
deviceOrganisationsLabel,
|
|
189
|
-
imageSize
|
|
190
|
-
infoWidth
|
|
188
|
+
imageSize
|
|
191
189
|
};
|
|
192
190
|
}
|
|
193
191
|
});
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
:bottomColor="$props.bottomColor"
|
|
4
4
|
:editable="$props.editable"
|
|
5
5
|
:modelValue="$props.modelValue"
|
|
6
|
+
:width="$props.width"
|
|
6
7
|
v-bind="$attrs"
|
|
7
8
|
>
|
|
8
9
|
<FSCol
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
>
|
|
18
19
|
<FSCol
|
|
19
20
|
gap="6px"
|
|
21
|
+
:width="`calc(100% - ${imageSize}px - 24px)`"
|
|
20
22
|
>
|
|
21
23
|
<FSText
|
|
22
24
|
font="text-button"
|
|
@@ -31,7 +33,14 @@
|
|
|
31
33
|
{{ $props.code }}
|
|
32
34
|
</FSText>
|
|
33
35
|
</FSCol>
|
|
36
|
+
<FSImage
|
|
37
|
+
v-if="$props.imageId"
|
|
38
|
+
:height="imageSize"
|
|
39
|
+
:width="imageSize"
|
|
40
|
+
:imageId="$props.imageId"
|
|
41
|
+
/>
|
|
34
42
|
<FSIconCard
|
|
43
|
+
v-else
|
|
35
44
|
:backgroundColor="iconBackgroundColor"
|
|
36
45
|
:icon="$props.icon"
|
|
37
46
|
:size="imageSize"
|
|
@@ -42,23 +51,27 @@
|
|
|
42
51
|
</template>
|
|
43
52
|
|
|
44
53
|
<script lang="ts">
|
|
45
|
-
import {
|
|
54
|
+
import type { PropType } from "vue";
|
|
55
|
+
import { computed, defineComponent } from "vue";
|
|
46
56
|
|
|
47
57
|
import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
|
|
48
|
-
import { ColorBase
|
|
58
|
+
import type { ColorBase} from "@dative-gpi/foundation-shared-components/models";
|
|
59
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
49
60
|
|
|
50
61
|
import FSIconCard from "../FSIconCard.vue";
|
|
62
|
+
import FSImage from "../FSImage.vue";
|
|
51
63
|
import FSText from "../FSText.vue";
|
|
52
64
|
import FSTile from "./FSTile.vue";
|
|
53
65
|
import FSCol from "../FSCol.vue";
|
|
54
66
|
import FSRow from "../FSRow.vue";
|
|
55
67
|
|
|
56
68
|
export default defineComponent({
|
|
57
|
-
name: "
|
|
69
|
+
name: "FSSimpleTileUI",
|
|
58
70
|
components: {
|
|
59
71
|
FSIconCard,
|
|
60
|
-
|
|
72
|
+
FSImage,
|
|
61
73
|
FSTile,
|
|
74
|
+
FSText,
|
|
62
75
|
FSCol,
|
|
63
76
|
FSRow
|
|
64
77
|
},
|
|
@@ -93,11 +106,21 @@ export default defineComponent({
|
|
|
93
106
|
required: false,
|
|
94
107
|
default: "mdi-ab-testing"
|
|
95
108
|
},
|
|
109
|
+
imageId: {
|
|
110
|
+
type: String as PropType<string>,
|
|
111
|
+
required: false,
|
|
112
|
+
default: null
|
|
113
|
+
},
|
|
96
114
|
editable: {
|
|
97
115
|
type: Boolean,
|
|
98
116
|
required: false,
|
|
99
117
|
default: true
|
|
100
|
-
}
|
|
118
|
+
},
|
|
119
|
+
width: {
|
|
120
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
121
|
+
required: false,
|
|
122
|
+
default: () => [352, 336]
|
|
123
|
+
},
|
|
101
124
|
},
|
|
102
125
|
setup(props) {
|
|
103
126
|
const { isMobileSized } = useBreakpoints();
|
|
@@ -110,19 +133,10 @@ export default defineComponent({
|
|
|
110
133
|
return isMobileSized.value ? 90 : 100;
|
|
111
134
|
});
|
|
112
135
|
|
|
113
|
-
const infoWidth = computed((): number => {
|
|
114
|
-
let width = isMobileSized.value ? 288 : 304;
|
|
115
|
-
if (props.icon) {
|
|
116
|
-
width -= imageSize.value;
|
|
117
|
-
}
|
|
118
|
-
return width;
|
|
119
|
-
});
|
|
120
|
-
|
|
121
136
|
return {
|
|
122
137
|
iconBackgroundColor,
|
|
123
138
|
ColorEnum,
|
|
124
|
-
imageSize
|
|
125
|
-
infoWidth
|
|
139
|
+
imageSize
|
|
126
140
|
};
|
|
127
141
|
}
|
|
128
142
|
});
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
class="fs-tile"
|
|
6
6
|
padding="12px"
|
|
7
7
|
:height="height"
|
|
8
|
-
:width="width"
|
|
9
8
|
:style="style"
|
|
10
9
|
:href="$props.href"
|
|
11
10
|
:to="$props.to"
|
|
@@ -33,7 +32,6 @@
|
|
|
33
32
|
class="fs-tile"
|
|
34
33
|
padding="12px"
|
|
35
34
|
:style="style"
|
|
36
|
-
:width="width"
|
|
37
35
|
:height="height"
|
|
38
36
|
v-bind="$attrs"
|
|
39
37
|
>
|
|
@@ -58,11 +56,12 @@
|
|
|
58
56
|
</template>
|
|
59
57
|
|
|
60
58
|
<script lang="ts">
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
59
|
+
import type { PropType, StyleValue } from "vue";
|
|
60
|
+
import { computed, defineComponent } from "vue";
|
|
61
|
+
import type { RouteLocation } from "vue-router";
|
|
63
62
|
|
|
64
63
|
import { useBreakpoints, useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
65
|
-
import { ColorBase } from "@dative-gpi/foundation-shared-components/models";
|
|
64
|
+
import type { ColorBase } from "@dative-gpi/foundation-shared-components/models";
|
|
66
65
|
|
|
67
66
|
import FSClickable from "../FSClickable.vue";
|
|
68
67
|
import FSCheckbox from "../FSCheckbox.vue";
|
|
@@ -107,7 +106,7 @@ export default defineComponent({
|
|
|
107
106
|
const { isMobileSized } = useBreakpoints();
|
|
108
107
|
const { getGradients } = useColors();
|
|
109
108
|
|
|
110
|
-
const style = computed(():
|
|
109
|
+
const style = computed((): StyleValue => {
|
|
111
110
|
if (props.bottomColor) {
|
|
112
111
|
const bottomColors = getGradients(props.bottomColor);
|
|
113
112
|
return {
|
|
@@ -117,17 +116,12 @@ export default defineComponent({
|
|
|
117
116
|
return {};
|
|
118
117
|
});
|
|
119
118
|
|
|
120
|
-
const width = computed(() => {
|
|
121
|
-
return isMobileSized.value ? 336 : 352;
|
|
122
|
-
});
|
|
123
|
-
|
|
124
119
|
const height = computed(() => {
|
|
125
120
|
return isMobileSized.value ? 156 : 170;
|
|
126
121
|
});
|
|
127
122
|
|
|
128
123
|
return {
|
|
129
124
|
height,
|
|
130
|
-
width,
|
|
131
125
|
style
|
|
132
126
|
};
|
|
133
127
|
}
|
|
@@ -55,7 +55,8 @@
|
|
|
55
55
|
</template>
|
|
56
56
|
|
|
57
57
|
<script lang="ts">
|
|
58
|
-
import {
|
|
58
|
+
import type { PropType } from "vue";
|
|
59
|
+
import { computed, defineComponent } from "vue";
|
|
59
60
|
|
|
60
61
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
61
62
|
import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSToggleSet
|
|
3
|
+
:values="positions"
|
|
4
|
+
:modelValue="$props.modelValue"
|
|
5
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
6
|
+
v-bind="$attrs"
|
|
7
|
+
>
|
|
8
|
+
<template
|
|
9
|
+
v-for="(_, name) in $slots"
|
|
10
|
+
v-slot:[name]="slotData"
|
|
11
|
+
>
|
|
12
|
+
<slot
|
|
13
|
+
:name="name"
|
|
14
|
+
v-bind="slotData"
|
|
15
|
+
/>
|
|
16
|
+
</template>
|
|
17
|
+
</FSToggleSet>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
import { computed, defineComponent } from "vue";
|
|
22
|
+
import type { PropType } from "vue";
|
|
23
|
+
|
|
24
|
+
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
25
|
+
import { Position } from "@dative-gpi/foundation-shared-domain/models";
|
|
26
|
+
|
|
27
|
+
export default defineComponent({
|
|
28
|
+
name: "FSToggleSetPosition",
|
|
29
|
+
props: {
|
|
30
|
+
modelValue: {
|
|
31
|
+
type: Number as PropType<Position>,
|
|
32
|
+
required: false,
|
|
33
|
+
default: Position.Abscissa
|
|
34
|
+
},
|
|
35
|
+
useNone: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
required: false,
|
|
38
|
+
default: false
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
emits: ["update:modelValue"],
|
|
42
|
+
setup(props) {
|
|
43
|
+
const { $tr } = useTranslationsProvider();
|
|
44
|
+
|
|
45
|
+
const positions = computed((): { id: Position; label: string }[] => {
|
|
46
|
+
const items = [
|
|
47
|
+
{ id: Position.Abscissa, label: $tr("ui.position.abscissa", "Right") },
|
|
48
|
+
{ id: Position.Ordinate, label: $tr("ui.position.ordinate", "Bottom") }
|
|
49
|
+
];
|
|
50
|
+
if (props.useNone) {
|
|
51
|
+
items.unshift({ id: Position.None, label: $tr("ui.position.none", "None") });
|
|
52
|
+
}
|
|
53
|
+
return items;
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
positions
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
</script>
|
package/composables/index.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
export * from "./useAddress";
|
|
1
2
|
export * from "./useAutocomplete";
|
|
2
3
|
export * from "./useBreakpoints";
|
|
3
4
|
export * from "./useColors";
|
|
4
5
|
export * from "./useDebounce";
|
|
6
|
+
export * from "./useMagicFieldProvider";
|
|
5
7
|
export * from "./useRules";
|
|
6
|
-
export * from "./useSlots";
|
|
8
|
+
export * from "./useSlots";
|
|
9
|
+
export * from "./useTables";
|
|
10
|
+
export * from "./useTreeView";
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import type { Place } from "@dative-gpi/foundation-shared-domain/models";
|
|
2
|
+
import { Address } from "@dative-gpi/foundation-shared-domain/models";
|
|
3
|
+
import _ from "lodash";
|
|
4
|
+
|
|
5
|
+
export const useAddress = () => {
|
|
6
|
+
const enabled = true;
|
|
7
|
+
let initialized = false;
|
|
8
|
+
let searchService: google.maps.places.AutocompleteService;
|
|
9
|
+
let placeService: google.maps.places.PlacesService;
|
|
10
|
+
let sessionId: google.maps.places.AutocompleteSessionToken;
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
const init = async () => {
|
|
14
|
+
await window.initMap;
|
|
15
|
+
searchService = new google.maps.places.AutocompleteService();
|
|
16
|
+
placeService = new google.maps.places.PlacesService(
|
|
17
|
+
document.getElementById("places") as HTMLDivElement
|
|
18
|
+
);
|
|
19
|
+
sessionId = new google.maps.places.AutocompleteSessionToken();
|
|
20
|
+
initialized = true;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const search = async (search: string): Promise<Place[]> => {
|
|
24
|
+
if(!initialized){
|
|
25
|
+
await init();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return _search(search).then(result => {
|
|
29
|
+
return _.map(result, r => ({ id: r.place_id, label: r.description }));
|
|
30
|
+
}).catch(() => {
|
|
31
|
+
return [];
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const get = async (place: Place): Promise<Address> => {
|
|
36
|
+
if(!initialized){
|
|
37
|
+
await init();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const response = await _get(place.id);
|
|
41
|
+
sessionId = new google.maps.places.AutocompleteSessionToken();
|
|
42
|
+
if (response.address_components && response.formatted_address && response.geometry) {
|
|
43
|
+
return new Address({
|
|
44
|
+
formattedAddress: response.formatted_address,
|
|
45
|
+
locality: _find(response.address_components, "locality"),
|
|
46
|
+
country: _find(response.address_components, "country"),
|
|
47
|
+
latitude: response.geometry.location?.lat() ?? 0,
|
|
48
|
+
longitude: response.geometry.location?.lng() ?? 0,
|
|
49
|
+
|
|
50
|
+
placeId: place.id,
|
|
51
|
+
placeLabel: place.label,
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
throw new Error("missing informations");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const reverseSearch = async (lat: number, lon: number): Promise<Address> => {
|
|
58
|
+
if(!initialized){
|
|
59
|
+
await init();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return _reverseSearch(lat, lon).then(result => {
|
|
63
|
+
if (result.length > 0) {
|
|
64
|
+
const response = result[0];
|
|
65
|
+
if (response.address_components && response.formatted_address && response.geometry) {
|
|
66
|
+
return new Address({
|
|
67
|
+
formattedAddress: response.formatted_address,
|
|
68
|
+
locality: _find(response.address_components, "locality"),
|
|
69
|
+
country: _find(response.address_components, "country"),
|
|
70
|
+
latitude: response.geometry.location?.lat() ?? 0,
|
|
71
|
+
longitude: response.geometry.location?.lng() ?? 0,
|
|
72
|
+
placeId: response.place_id,
|
|
73
|
+
placeLabel: response.formatted_address
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
throw new Error("missing informations");
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const _search = (search: string) => {
|
|
82
|
+
if (!enabled) {
|
|
83
|
+
throw new Error("offline mode, do not call this method");
|
|
84
|
+
}
|
|
85
|
+
return new Promise<google.maps.places.AutocompletePrediction[]>(
|
|
86
|
+
(resolve, reject) => {
|
|
87
|
+
searchService!.getPlacePredictions(
|
|
88
|
+
{
|
|
89
|
+
input: search,
|
|
90
|
+
sessionToken: sessionId!
|
|
91
|
+
},
|
|
92
|
+
function (result, status) {
|
|
93
|
+
if (status != google.maps.places.PlacesServiceStatus.OK || !result) {
|
|
94
|
+
reject(status);
|
|
95
|
+
} else {
|
|
96
|
+
resolve(result);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const _reverseSearch = (lat: number, lon: number) => {
|
|
105
|
+
if (!enabled) {
|
|
106
|
+
throw new Error("offline mode, do not call this method");
|
|
107
|
+
}
|
|
108
|
+
return new Promise<google.maps.GeocoderResult[]>((resolve, reject) => {
|
|
109
|
+
new google.maps.Geocoder().geocode(
|
|
110
|
+
{
|
|
111
|
+
location: { lat: lat, lng: lon }
|
|
112
|
+
},
|
|
113
|
+
(result, status) => {
|
|
114
|
+
if (status != google.maps.GeocoderStatus.OK || !result) {
|
|
115
|
+
reject(status);
|
|
116
|
+
} else {
|
|
117
|
+
resolve(result);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const _get = (id: string) => {
|
|
125
|
+
if (!enabled) {
|
|
126
|
+
throw new Error("offline mode, do not call this method");
|
|
127
|
+
}
|
|
128
|
+
return new Promise<google.maps.places.PlaceResult>((resolve, reject) => {
|
|
129
|
+
placeService!.getDetails(
|
|
130
|
+
{
|
|
131
|
+
placeId: id,
|
|
132
|
+
sessionToken: sessionId!,
|
|
133
|
+
fields: ["formatted_address", "geometry", "address_components", "name"]
|
|
134
|
+
},
|
|
135
|
+
(result, status) => {
|
|
136
|
+
if (status != google.maps.places.PlacesServiceStatus.OK || !result) {
|
|
137
|
+
reject(status);
|
|
138
|
+
} else {
|
|
139
|
+
resolve(result);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const _find = (components: google.maps.GeocoderAddressComponent[], type: string): string => {
|
|
147
|
+
const found = _.find(components, c =>
|
|
148
|
+
_.some(c.types, t => t === type)
|
|
149
|
+
);
|
|
150
|
+
return found?.long_name ?? "";
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return {
|
|
154
|
+
search,
|
|
155
|
+
get,
|
|
156
|
+
reverseSearch
|
|
157
|
+
}
|
|
158
|
+
}
|