@dative-gpi/foundation-shared-components 1.0.66 → 1.0.68
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/FSIconCard.vue +2 -2
- package/components/FSSlideGroup.vue +13 -1
- package/components/FSTabs.vue +27 -5
- package/components/FSWrapGroup.vue +13 -1
- package/components/lists/FSDataTableUI.vue +4 -4
- package/components/lists/FSDraggable.vue +2 -2
- package/components/map/FSMapLayerButton.vue +1 -0
- package/components/tiles/FSLocationTileUI.vue +80 -68
- package/components/tiles/FSSimpleTileUI.vue +2 -1
- package/components/views/FSSkeletonView.vue +1 -1
- package/package.json +4 -4
- package/styles/components/fs_slide_group.scss +5 -0
- package/styles/components/fs_wrap_group.scss +4 -0
- package/styles/globals/overrides.scss +0 -10
- package/utils/filter.ts +4 -1
|
@@ -58,7 +58,7 @@ export default defineComponent({
|
|
|
58
58
|
iconColor: {
|
|
59
59
|
type: String as PropType<ColorBase>,
|
|
60
60
|
required: false,
|
|
61
|
-
default: ColorEnum.
|
|
61
|
+
default: ColorEnum.Primary
|
|
62
62
|
},
|
|
63
63
|
iconVariant: {
|
|
64
64
|
type: String as PropType<"base" | "baseContrast" | "soft" | "softContrast" | "light" | "lightContrast" | "dark" | "darkContrast">,
|
|
@@ -68,7 +68,7 @@ export default defineComponent({
|
|
|
68
68
|
iconSize: {
|
|
69
69
|
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
70
70
|
required: false,
|
|
71
|
-
default: "
|
|
71
|
+
default: "42px"
|
|
72
72
|
},
|
|
73
73
|
border: {
|
|
74
74
|
type: Boolean,
|
|
@@ -59,6 +59,16 @@ export default defineComponent({
|
|
|
59
59
|
FSButton
|
|
60
60
|
},
|
|
61
61
|
props: {
|
|
62
|
+
height: {
|
|
63
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
64
|
+
required: false,
|
|
65
|
+
default: "fit-content"
|
|
66
|
+
},
|
|
67
|
+
width: {
|
|
68
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
69
|
+
required: false,
|
|
70
|
+
default: "fit-content"
|
|
71
|
+
},
|
|
62
72
|
padding: {
|
|
63
73
|
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
64
74
|
required: false,
|
|
@@ -92,7 +102,9 @@ export default defineComponent({
|
|
|
92
102
|
"--fs-group-padding" : sizeToVar(props.padding),
|
|
93
103
|
"--fs-group-gap" : sizeToVar(props.gap),
|
|
94
104
|
"--fs-group-color" : darks.soft,
|
|
95
|
-
"--fs-group-hover-color" : darks.dark
|
|
105
|
+
"--fs-group-hover-color" : darks.dark,
|
|
106
|
+
"--fs-group-width" : sizeToVar(props.width),
|
|
107
|
+
"--fs-group-height" : sizeToVar(props.height)
|
|
96
108
|
}));
|
|
97
109
|
|
|
98
110
|
const nextClasses = computed((): string[] => {
|
package/components/FSTabs.vue
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
:style="style"
|
|
8
8
|
:grow="true"
|
|
9
9
|
:modelValue="$props.tab"
|
|
10
|
-
@update:modelValue="
|
|
10
|
+
@update:modelValue="onUpdateTab($event)"
|
|
11
11
|
v-bind="$attrs"
|
|
12
12
|
>
|
|
13
13
|
<slot/>
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
17
|
<script lang="ts">
|
|
18
|
-
import { computed, defineComponent, type PropType, type StyleValue } from "vue";
|
|
18
|
+
import { computed, defineComponent, onMounted, type PropType, type StyleValue } from "vue";
|
|
19
|
+
import { useRouter } from "vue-router";
|
|
19
20
|
|
|
20
21
|
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
21
22
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
@@ -24,7 +25,7 @@ export default defineComponent({
|
|
|
24
25
|
name: "FSTabs",
|
|
25
26
|
props: {
|
|
26
27
|
tab: {
|
|
27
|
-
type: Number,
|
|
28
|
+
type: [String, Number, Object] as PropType<any>,
|
|
28
29
|
required: false,
|
|
29
30
|
default: 0
|
|
30
31
|
},
|
|
@@ -32,10 +33,17 @@ export default defineComponent({
|
|
|
32
33
|
type: String as PropType<ColorBase>,
|
|
33
34
|
required: false,
|
|
34
35
|
default: ColorEnum.Primary
|
|
36
|
+
},
|
|
37
|
+
recordNavigation: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
required: false,
|
|
40
|
+
default: false
|
|
35
41
|
}
|
|
36
42
|
},
|
|
37
|
-
|
|
43
|
+
emits: ["update:tab"],
|
|
44
|
+
setup(props, { emit }) {
|
|
38
45
|
const { getColors } = useColors();
|
|
46
|
+
const router = useRouter();
|
|
39
47
|
|
|
40
48
|
const colors = computed(() => getColors(props.color));
|
|
41
49
|
const lights = getColors(ColorEnum.Light);
|
|
@@ -51,8 +59,22 @@ export default defineComponent({
|
|
|
51
59
|
"--fs-tab-tag-color" : colors.value.baseContrast!
|
|
52
60
|
}));
|
|
53
61
|
|
|
62
|
+
const onUpdateTab = (tab: number): void => {
|
|
63
|
+
if (props.recordNavigation) {
|
|
64
|
+
router.replace({ query: { tab: tab.toString() } });
|
|
65
|
+
}
|
|
66
|
+
emit("update:tab", tab);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
onMounted((): void => {
|
|
70
|
+
if (props.recordNavigation && router.currentRoute.value.query.tab) {
|
|
71
|
+
emit("update:tab", router.currentRoute.value.query.tab);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
|
|
54
75
|
return {
|
|
55
|
-
style
|
|
76
|
+
style,
|
|
77
|
+
onUpdateTab
|
|
56
78
|
};
|
|
57
79
|
}
|
|
58
80
|
});
|
|
@@ -29,6 +29,16 @@ import { uuidv4 } from "@dative-gpi/bones-ui/tools/uuid";
|
|
|
29
29
|
export default defineComponent({
|
|
30
30
|
name: "FSWrapGroup",
|
|
31
31
|
props: {
|
|
32
|
+
height: {
|
|
33
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
34
|
+
required: false,
|
|
35
|
+
default: "fit-content"
|
|
36
|
+
},
|
|
37
|
+
width: {
|
|
38
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
39
|
+
required: false,
|
|
40
|
+
default: "fit-content"
|
|
41
|
+
},
|
|
32
42
|
padding: {
|
|
33
43
|
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
34
44
|
required: false,
|
|
@@ -55,7 +65,9 @@ export default defineComponent({
|
|
|
55
65
|
"--fs-group-padding" : sizeToVar(props.padding),
|
|
56
66
|
"--fs-group-gap" : sizeToVar(props.gap),
|
|
57
67
|
"--fs-group-color" : darks.soft,
|
|
58
|
-
"--fs-group-hover-color": darks.dark
|
|
68
|
+
"--fs-group-hover-color": darks.dark,
|
|
69
|
+
"--fs-group-height" : sizeToVar(props.height),
|
|
70
|
+
"--fs-group-width" : sizeToVar(props.width)
|
|
59
71
|
}));
|
|
60
72
|
|
|
61
73
|
onMounted((): void => {
|
|
@@ -446,7 +446,7 @@
|
|
|
446
446
|
v-for="(item, index) in items"
|
|
447
447
|
elementSelector=".fs-draggable-item"
|
|
448
448
|
:disabled="draggableDisabled"
|
|
449
|
-
:item="item"
|
|
449
|
+
:item="{ ...item, index }"
|
|
450
450
|
:key="index"
|
|
451
451
|
@update:dragend="(event, dragged) => onDragEnd(event, dragged, '.fs-data-iterator-container')"
|
|
452
452
|
@dragover="(event) => onDragOver(event, '.fs-draggable-item', '.fs-data-iterator-container')"
|
|
@@ -617,7 +617,7 @@
|
|
|
617
617
|
v-for="(item, index) in items.filter((item) => item.type === 'item')"
|
|
618
618
|
elementSelector=".fs-draggable-item"
|
|
619
619
|
:disabled="draggableDisabled"
|
|
620
|
-
:item="item"
|
|
620
|
+
:item="{ ...item, index }"
|
|
621
621
|
:key="index"
|
|
622
622
|
@update:dragend="(event, dragged) => onDragEnd(event, dragged, '.fs-data-iterator-container')"
|
|
623
623
|
@dragover="(event) => onDragOver(event, '.fs-draggable-item', '.fs-data-iterator-container')"
|
|
@@ -1360,10 +1360,10 @@ export default defineComponent({
|
|
|
1360
1360
|
};
|
|
1361
1361
|
|
|
1362
1362
|
const resetRowIndex = (initialIndex: number, currentIndex: number, draggedElement: HTMLElement, tbodyElement: HTMLElement) => {
|
|
1363
|
-
if (initialIndex > currentIndex) {
|
|
1363
|
+
if (initialIndex > currentIndex && tbodyElement.children[initialIndex]) {
|
|
1364
1364
|
tbodyElement.children[initialIndex].insertAdjacentElement("afterend", draggedElement);
|
|
1365
1365
|
}
|
|
1366
|
-
else {
|
|
1366
|
+
else if(tbodyElement.children[initialIndex]) {
|
|
1367
1367
|
tbodyElement.children[initialIndex].insertAdjacentElement("beforebegin", draggedElement);
|
|
1368
1368
|
}
|
|
1369
1369
|
};
|
|
@@ -74,7 +74,7 @@ export default defineComponent({
|
|
|
74
74
|
const dragged = (event.target as HTMLElement)?.closest(props.elementSelector) as HTMLElement;
|
|
75
75
|
dragged.classList.add("fs-draggable-dragging");
|
|
76
76
|
dragged.classList.add("fs-draggable-dragging-grabbegin");
|
|
77
|
-
dragged.dataset.initialIndex = props.item
|
|
77
|
+
dragged.dataset.initialIndex = props.item.index;
|
|
78
78
|
event.preventDefault();
|
|
79
79
|
}
|
|
80
80
|
}, mobileGrabThreshold);
|
|
@@ -171,7 +171,7 @@ export default defineComponent({
|
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
173
|
const dragged = (event.target as HTMLElement)?.closest(props.elementSelector) as HTMLElement;
|
|
174
|
-
dragged.dataset.initialIndex = props.item
|
|
174
|
+
dragged.dataset.initialIndex = props.item.index;
|
|
175
175
|
event.dataTransfer?.setDragImage(dragged, 25, 25);
|
|
176
176
|
|
|
177
177
|
if (event.dataTransfer) {
|
|
@@ -6,81 +6,81 @@
|
|
|
6
6
|
:width="$props.width"
|
|
7
7
|
v-bind="$attrs"
|
|
8
8
|
>
|
|
9
|
-
<
|
|
9
|
+
<FSCol
|
|
10
10
|
align="center-center"
|
|
11
|
-
width="
|
|
12
|
-
gap="24px"
|
|
13
|
-
:wrap="false"
|
|
11
|
+
width="fill"
|
|
14
12
|
>
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
<FSRow
|
|
14
|
+
align="center-left"
|
|
15
|
+
gap="24px"
|
|
16
|
+
:height="imageSize"
|
|
17
|
+
:wrap="false"
|
|
19
18
|
>
|
|
20
|
-
<FSCol
|
|
21
|
-
gap="
|
|
19
|
+
<FSCol
|
|
20
|
+
gap="12px"
|
|
21
|
+
:width="infoWidth"
|
|
22
22
|
>
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
:lineClamp="1"
|
|
23
|
+
<FSCol
|
|
24
|
+
gap="6px"
|
|
26
25
|
>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
:color="ColorEnum.Light"
|
|
45
|
-
:border="false"
|
|
26
|
+
<FSSpan
|
|
27
|
+
font="text-button"
|
|
28
|
+
:lineClamp="1"
|
|
29
|
+
>
|
|
30
|
+
{{ $props.label }}
|
|
31
|
+
</FSSpan>
|
|
32
|
+
<FSSpan
|
|
33
|
+
v-if="$props.code"
|
|
34
|
+
font="text-overline"
|
|
35
|
+
variant="soft"
|
|
36
|
+
>
|
|
37
|
+
{{ $props.code }}
|
|
38
|
+
</FSSpan>
|
|
39
|
+
</FSCol>
|
|
40
|
+
<FSRow
|
|
41
|
+
:wrap="false"
|
|
42
|
+
align="center-left"
|
|
46
43
|
>
|
|
47
|
-
<
|
|
48
|
-
|
|
44
|
+
<FSColor
|
|
45
|
+
padding="0 8px"
|
|
46
|
+
height="24px"
|
|
47
|
+
:color="ColorEnum.Light"
|
|
48
|
+
:border="false"
|
|
49
49
|
>
|
|
50
|
-
<
|
|
51
|
-
|
|
50
|
+
<FSRow
|
|
51
|
+
align="center-center"
|
|
52
52
|
>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
53
|
+
<FSSpan
|
|
54
|
+
font="text-overline"
|
|
55
|
+
>
|
|
56
|
+
{{ $props.deviceCount }}
|
|
57
|
+
</FSSpan>
|
|
58
|
+
</FSRow>
|
|
59
|
+
</FSColor>
|
|
60
|
+
<FSSpan
|
|
61
|
+
font="text-overline"
|
|
62
|
+
>
|
|
63
|
+
{{ $tr("entity.location.devices", "Devices") }}
|
|
64
|
+
</FSSpan>
|
|
65
|
+
</FSRow>
|
|
66
|
+
</FSCol>
|
|
67
67
|
<FSIconCard
|
|
68
|
-
|
|
68
|
+
backgroundVariant="standard"
|
|
69
|
+
:backgroundColor="ColorEnum.Background"
|
|
69
70
|
:iconColor="$props.color"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
variant="background"
|
|
73
|
-
:border="true"
|
|
71
|
+
:icon="$props.icon"
|
|
72
|
+
:size="imageSize"
|
|
74
73
|
/>
|
|
75
|
-
</
|
|
76
|
-
</
|
|
74
|
+
</FSRow>
|
|
75
|
+
</FSCol>
|
|
77
76
|
</FSTile>
|
|
78
77
|
</template>
|
|
79
78
|
|
|
80
79
|
<script lang="ts">
|
|
81
|
-
import { defineComponent, type PropType } from "vue";
|
|
80
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
82
81
|
|
|
83
|
-
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
82
|
+
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
83
|
+
import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
|
|
84
84
|
|
|
85
85
|
import FSIconCard from "../FSIconCard.vue";
|
|
86
86
|
import FSColor from "../FSColor.vue";
|
|
@@ -110,11 +110,6 @@ export default defineComponent({
|
|
|
110
110
|
required: false,
|
|
111
111
|
default: null
|
|
112
112
|
},
|
|
113
|
-
color: {
|
|
114
|
-
type: String,
|
|
115
|
-
required: false,
|
|
116
|
-
default: () => ColorEnum.Primary
|
|
117
|
-
},
|
|
118
113
|
icon: {
|
|
119
114
|
type: String,
|
|
120
115
|
required: false,
|
|
@@ -125,20 +120,37 @@ export default defineComponent({
|
|
|
125
120
|
required: false,
|
|
126
121
|
default: 0
|
|
127
122
|
},
|
|
128
|
-
|
|
129
|
-
type:
|
|
123
|
+
color: {
|
|
124
|
+
type: String as PropType<ColorBase>,
|
|
130
125
|
required: false,
|
|
131
|
-
default:
|
|
126
|
+
default: ColorEnum.Primary
|
|
132
127
|
},
|
|
133
128
|
width: {
|
|
134
129
|
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
135
130
|
required: false,
|
|
136
131
|
default: () => [352, 336]
|
|
137
132
|
},
|
|
133
|
+
modelValue: {
|
|
134
|
+
type: Boolean,
|
|
135
|
+
required: false,
|
|
136
|
+
default: false
|
|
137
|
+
}
|
|
138
138
|
},
|
|
139
139
|
setup() {
|
|
140
|
+
const { isMobileSized } = useBreakpoints();
|
|
141
|
+
|
|
142
|
+
const imageSize = computed((): number => {
|
|
143
|
+
return isMobileSized.value ? 90 : 100;
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
const infoWidth = computed((): string => {
|
|
147
|
+
return `calc(100% - ${imageSize.value}px - 24px)`;
|
|
148
|
+
});
|
|
149
|
+
|
|
140
150
|
return {
|
|
141
|
-
ColorEnum
|
|
151
|
+
ColorEnum,
|
|
152
|
+
imageSize,
|
|
153
|
+
infoWidth
|
|
142
154
|
};
|
|
143
155
|
}
|
|
144
156
|
});
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
v-else-if="$props.icon"
|
|
45
45
|
:backgroundVariant="$props.iconBackgroundVariant"
|
|
46
46
|
:backgroundColor="$props.iconBackgroundColor"
|
|
47
|
+
:iconColor="$props.activeColor"
|
|
47
48
|
:border="$props.iconBorder"
|
|
48
49
|
:icon="$props.icon"
|
|
49
50
|
:size="imageSize"
|
|
@@ -99,7 +100,7 @@ export default defineComponent({
|
|
|
99
100
|
iconBackgroundVariant: {
|
|
100
101
|
type: String as PropType<"background" | "standard" | "full" | "gradient">,
|
|
101
102
|
required: false,
|
|
102
|
-
default: "
|
|
103
|
+
default: "standard"
|
|
103
104
|
},
|
|
104
105
|
iconBackgroundColor: {
|
|
105
106
|
type: [Array, String] as PropType<ColorBase | ColorBase[]>,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-shared-components",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.68",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@dative-gpi/foundation-shared-domain": "1.0.
|
|
14
|
-
"@dative-gpi/foundation-shared-services": "1.0.
|
|
13
|
+
"@dative-gpi/foundation-shared-domain": "1.0.68",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "1.0.68"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@dative-gpi/bones-ui": "^0.0.75",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"sass": "1.71.1",
|
|
36
36
|
"sass-loader": "13.3.2"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "341389f8890f7ebe2e0ac03ea54e5ed38e9c7e56"
|
|
39
39
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
.fs-slide-group {
|
|
2
|
+
height: var(--fs-group-height);
|
|
3
|
+
width: var(--fs-group-width);
|
|
4
|
+
max-width: 100%;
|
|
5
|
+
|
|
2
6
|
& > .v-slide-group__container > .v-slide-group__content {
|
|
7
|
+
margin: 0 2px 1px 0 !important;
|
|
3
8
|
padding: var(--fs-group-padding);
|
|
4
9
|
gap: var(--fs-group-gap);
|
|
5
10
|
}
|
|
@@ -182,16 +182,6 @@ $nthOverlay: 25;
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
/***** Applies to all slide groups (FSTabs, FSSlideGroup, FSWrapGroup) *****/
|
|
186
|
-
.fs-slide-group {
|
|
187
|
-
max-width: 100%;
|
|
188
|
-
|
|
189
|
-
// To avoid borders clipping
|
|
190
|
-
& > .v-slide-group__container > .v-slide-group__content {
|
|
191
|
-
margin: 0 2px 1px 0 !important;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
185
|
// On touchscreen, hide arrows
|
|
196
186
|
// Otherwise show small ones with base text color
|
|
197
187
|
.v-slide-group__prev,
|
package/utils/filter.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export const containsSearchTerm = (obj: any, searchTerm: string): boolean => {
|
|
2
|
+
if (obj == null) {
|
|
3
|
+
return false;
|
|
4
|
+
}
|
|
2
5
|
if (typeof obj === 'object') {
|
|
3
6
|
return Object.values(obj).some(value => containsSearchTerm(value, searchTerm));
|
|
4
7
|
}
|
|
@@ -12,4 +15,4 @@ export const filterItems = <T>(items: T[], filter: string): T[] => {
|
|
|
12
15
|
const searchTerm = filter.toLowerCase();
|
|
13
16
|
|
|
14
17
|
return items.filter(item => containsSearchTerm(item, searchTerm));
|
|
15
|
-
};
|
|
18
|
+
};
|