@dative-gpi/foundation-shared-components 0.0.92 → 0.0.94
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/FSAccordionPanel.vue +12 -4
- package/components/FSDialog.vue +10 -5
- package/components/buttons/FSButtonCheckbox.vue +72 -0
- package/components/deviceOrganisations/FSConnectivityCard.vue +5 -15
- package/components/lists/FSDataTableUI.vue +1 -2
- package/package.json +4 -4
- package/styles/components/fs_dialog.scss +5 -5
- package/utils/css.ts +1 -1
- package/utils/index.ts +1 -0
- package/utils/levenshtein.ts +3 -3
- package/utils/statuses.ts +13 -0
|
@@ -8,8 +8,12 @@
|
|
|
8
8
|
:style="style"
|
|
9
9
|
v-bind="$attrs"
|
|
10
10
|
>
|
|
11
|
-
<template
|
|
12
|
-
|
|
11
|
+
<template
|
|
12
|
+
#title
|
|
13
|
+
>
|
|
14
|
+
<slot
|
|
15
|
+
name="title"
|
|
16
|
+
>
|
|
13
17
|
<FSRow>
|
|
14
18
|
<FSIcon
|
|
15
19
|
v-if="$props.prependIcon"
|
|
@@ -24,8 +28,12 @@
|
|
|
24
28
|
</FSRow>
|
|
25
29
|
</slot>
|
|
26
30
|
</template>
|
|
27
|
-
<template
|
|
28
|
-
|
|
31
|
+
<template
|
|
32
|
+
#text
|
|
33
|
+
>
|
|
34
|
+
<slot
|
|
35
|
+
name="content"
|
|
36
|
+
>
|
|
29
37
|
<FSText
|
|
30
38
|
:lineClamp="$props.lineClampContent"
|
|
31
39
|
>
|
package/components/FSDialog.vue
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-dialog
|
|
3
3
|
transition="dialog-bottom-transition"
|
|
4
|
-
|
|
4
|
+
class="fs-dialog"
|
|
5
|
+
:style="style"
|
|
5
6
|
:modelValue="$props.modelValue"
|
|
6
7
|
@update:modelValue="$emit('update:modelValue', $event)"
|
|
7
8
|
v-bind="$attrs"
|
|
@@ -127,18 +128,22 @@ export default defineComponent({
|
|
|
127
128
|
return classNames;
|
|
128
129
|
});
|
|
129
130
|
|
|
130
|
-
const
|
|
131
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
131
132
|
if (isExtraSmall.value) {
|
|
132
|
-
return
|
|
133
|
+
return {
|
|
134
|
+
"--fs-dialog-width": "100%"
|
|
135
|
+
};
|
|
133
136
|
}
|
|
134
|
-
return
|
|
137
|
+
return {
|
|
138
|
+
"--fs-dialog-width": sizeToVar(props.width)
|
|
139
|
+
};
|
|
135
140
|
});
|
|
136
141
|
|
|
137
142
|
return {
|
|
138
143
|
isExtraSmall,
|
|
139
144
|
ColorEnum,
|
|
140
145
|
classes,
|
|
141
|
-
|
|
146
|
+
style
|
|
142
147
|
};
|
|
143
148
|
}
|
|
144
149
|
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSButton
|
|
3
|
+
:editable="$props.editable"
|
|
4
|
+
:prependIcon="prependIcon"
|
|
5
|
+
:load="$props.load"
|
|
6
|
+
:variant="variant"
|
|
7
|
+
@click.stop="onClick"
|
|
8
|
+
v-bind="$attrs"
|
|
9
|
+
>
|
|
10
|
+
<template
|
|
11
|
+
v-for="(_, name) in $slots"
|
|
12
|
+
v-slot:[name]="slotData"
|
|
13
|
+
>
|
|
14
|
+
<slot
|
|
15
|
+
:name="name"
|
|
16
|
+
v-bind="slotData"
|
|
17
|
+
/>
|
|
18
|
+
</template>
|
|
19
|
+
</FSButton>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script lang="ts">
|
|
23
|
+
import { computed, defineComponent } from "vue";
|
|
24
|
+
|
|
25
|
+
import FSButton from "../FSButton.vue";
|
|
26
|
+
|
|
27
|
+
export default defineComponent({
|
|
28
|
+
name: "FSButtonCheckbox",
|
|
29
|
+
components: {
|
|
30
|
+
FSButton
|
|
31
|
+
},
|
|
32
|
+
props: {
|
|
33
|
+
modelValue: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
required: false,
|
|
36
|
+
default: false
|
|
37
|
+
},
|
|
38
|
+
load: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
required: false,
|
|
41
|
+
default: false
|
|
42
|
+
},
|
|
43
|
+
editable: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
required: false,
|
|
46
|
+
default: true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
emits: ["update:modelValue"],
|
|
50
|
+
setup(props, { emit }) {
|
|
51
|
+
const prependIcon = computed((): string => {
|
|
52
|
+
return props.modelValue ? "mdi-checkbox-marked" : "mdi-checkbox-blank-outline";
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const variant = computed((): "full" | "standard" => {
|
|
56
|
+
return props.modelValue ? "full" : "standard";
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const onClick = (): void => {
|
|
60
|
+
if (props.editable && !props.load) {
|
|
61
|
+
emit("update:modelValue", !props.modelValue);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
prependIcon,
|
|
67
|
+
variant,
|
|
68
|
+
onClick
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
</script>
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
<FSChip
|
|
29
29
|
:prependIcon="$props.deviceConnectivity.icon"
|
|
30
30
|
:color="$props.deviceConnectivity.color"
|
|
31
|
-
:label="connectivityLabel"
|
|
31
|
+
:label="connectivityLabel($props.deviceConnectivity.status)"
|
|
32
32
|
/>
|
|
33
33
|
<FSRow
|
|
34
34
|
width="hug"
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
<script lang="ts">
|
|
58
58
|
import { computed, defineComponent, PropType } from "vue";
|
|
59
59
|
|
|
60
|
-
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
61
60
|
import { FSDeviceConnectivity } from "@dative-gpi/foundation-shared-components/models";
|
|
62
61
|
import { useAppTimeZone } from "@dative-gpi/foundation-shared-services/composables";
|
|
63
|
-
|
|
62
|
+
|
|
63
|
+
import { connectivityLabel } from "../../utils";
|
|
64
64
|
|
|
65
65
|
import FSButton from "../FSButton.vue";
|
|
66
66
|
import FSCard from "../FSCard.vue";
|
|
@@ -90,16 +90,6 @@ export default defineComponent({
|
|
|
90
90
|
emit: ["close"],
|
|
91
91
|
setup(props) {
|
|
92
92
|
const { epochToLongTimeFormat } = useAppTimeZone();
|
|
93
|
-
const { $tr } = useTranslationsProvider();
|
|
94
|
-
|
|
95
|
-
const connectivityLabel = computed((): string => {
|
|
96
|
-
switch (props.deviceConnectivity.status) {
|
|
97
|
-
case ConnectivityStatus.Connected: return $tr("ui.connectivity-status.connected", "Connected");
|
|
98
|
-
case ConnectivityStatus.PartiallyConnected: return $tr("ui.connectivity-status.partially-connected", "Partially connected");
|
|
99
|
-
case ConnectivityStatus.AlmostOffline: return $tr("ui.connectivity-status.almost-offline", "Almost offline");
|
|
100
|
-
default: return $tr("ui.connectivity-status.offline", "Offline");
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
93
|
|
|
104
94
|
const deviceTimestamp = computed((): string => {
|
|
105
95
|
if (props.deviceConnectivity.sourceTimestamp) {
|
|
@@ -109,8 +99,8 @@ export default defineComponent({
|
|
|
109
99
|
});
|
|
110
100
|
|
|
111
101
|
return {
|
|
112
|
-
|
|
113
|
-
|
|
102
|
+
deviceTimestamp,
|
|
103
|
+
connectivityLabel
|
|
114
104
|
};
|
|
115
105
|
}
|
|
116
106
|
});
|
|
@@ -303,7 +303,7 @@
|
|
|
303
303
|
</slot>
|
|
304
304
|
</template>
|
|
305
305
|
<template
|
|
306
|
-
v-for="
|
|
306
|
+
v-for="item in itemsSlots"
|
|
307
307
|
#[item.slotName]="props"
|
|
308
308
|
>
|
|
309
309
|
<div
|
|
@@ -315,7 +315,6 @@
|
|
|
315
315
|
>
|
|
316
316
|
<FSRow
|
|
317
317
|
align="center-left"
|
|
318
|
-
:key="index"
|
|
319
318
|
>
|
|
320
319
|
<FSSpan
|
|
321
320
|
font="text-overline"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-shared-components",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.94",
|
|
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": "0.0.
|
|
14
|
-
"@dative-gpi/foundation-shared-services": "0.0.
|
|
13
|
+
"@dative-gpi/foundation-shared-domain": "0.0.94",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "0.0.94",
|
|
15
15
|
"@fontsource/montserrat": "^5.0.16",
|
|
16
16
|
"@lexical/clipboard": "^0.12.5",
|
|
17
17
|
"@lexical/history": "^0.12.5",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"sass": "^1.69.5",
|
|
33
33
|
"sass-loader": "^13.3.2"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "32dca3eabc60908f1b2b7af0a77865153adfb199"
|
|
36
36
|
}
|
|
@@ -11,17 +11,17 @@
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.v-overlay__content:has(.fs-dialog) {
|
|
14
|
-
width:
|
|
14
|
+
width: var(--fs-dialog-width) !important;
|
|
15
15
|
max-height: 90vh !important;
|
|
16
16
|
min-width: 35vw !important;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.fs-dialog {
|
|
20
|
-
width:
|
|
20
|
+
width: var(--fs-dialog-width) !important;
|
|
21
21
|
max-height: 90vh !important;
|
|
22
22
|
min-width: 35vw !important;
|
|
23
|
+
}
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
25
|
+
.fs-dialog-mobile {
|
|
26
|
+
width: 100vw !important;
|
|
27
27
|
}
|
package/utils/css.ts
CHANGED
package/utils/index.ts
CHANGED
package/utils/levenshtein.ts
CHANGED
|
@@ -9,7 +9,7 @@ export const levenshteinDistance = (a: string, b: string) => {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
if (a.length > b.length) {
|
|
12
|
-
|
|
12
|
+
const tmp = a;
|
|
13
13
|
a = b;
|
|
14
14
|
b = tmp;
|
|
15
15
|
}
|
|
@@ -49,14 +49,14 @@ export const levenshteinDistance = (a: string, b: string) => {
|
|
|
49
49
|
let bx2: number;
|
|
50
50
|
let bx3: number;
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
const vector: number[] = [];
|
|
53
53
|
|
|
54
54
|
for (y = 0; y < la; y++) {
|
|
55
55
|
vector.push(y + 1);
|
|
56
56
|
vector.push(a.charCodeAt(offset + y));
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
const len = vector.length - 1;
|
|
60
60
|
|
|
61
61
|
for (; x < lb - 3;) {
|
|
62
62
|
bx0 = b.charCodeAt(offset + (d0 = x));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
2
|
+
import { ConnectivityStatus } from "@dative-gpi/foundation-shared-domain/models";
|
|
3
|
+
|
|
4
|
+
const { $tr } = useTranslationsProvider();
|
|
5
|
+
|
|
6
|
+
export const connectivityLabel = ((status: ConnectivityStatus): string => {
|
|
7
|
+
switch (status) {
|
|
8
|
+
case ConnectivityStatus.Connected: return $tr("ui.connectivity-status.connected", "Connected");
|
|
9
|
+
case ConnectivityStatus.PartiallyConnected: return $tr("ui.connectivity-status.partially-connected", "Partially connected");
|
|
10
|
+
case ConnectivityStatus.AlmostOffline: return $tr("ui.connectivity-status.almost-offline", "Almost offline");
|
|
11
|
+
default: return $tr("ui.connectivity-status.offline", "Offline");
|
|
12
|
+
}
|
|
13
|
+
});
|