@dative-gpi/foundation-shared-components 1.0.45 → 1.0.47
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/FSLoader.vue +1 -2
- package/components/FSSpan.vue +5 -0
- package/components/buttons/FSButtonDragIcon.vue +27 -0
- package/components/deviceOrganisations/FSStatusesRow.vue +1 -1
- package/components/deviceOrganisations/FSWorstAlert.vue +1 -1
- package/components/deviceOrganisations/FSWorstAlertCard.vue +1 -1
- package/components/fields/FSEntityFieldUI.vue +257 -0
- package/components/fields/FSSelectField.vue +0 -1
- package/components/fields/FSTermField.vue +1 -1
- package/components/fields/FSTimeSlotField.vue +1 -1
- package/components/fields/FSTimeStepField.vue +3 -3
- package/components/lists/FSDataTableUI.vue +1 -1
- package/components/lists/FSSimpleList.vue +133 -0
- package/components/selects/FSSelectAutoRefresh.vue +1 -1
- package/components/selects/FSSelectDashboardVariableType.vue +1 -1
- package/components/selects/FSSelectDateSetting.vue +1 -1
- package/components/selects/FSSelectDays.vue +1 -1
- package/components/selects/FSSelectListMode.vue +1 -1
- package/components/selects/FSSelectMonths.vue +1 -1
- package/components/tiles/FSTile.vue +90 -74
- package/models/deviceAlerts.ts +1 -1
- package/models/deviceConnectivities.ts +1 -1
- package/models/rules.ts +1 -1
- package/package.json +4 -4
- package/styles/components/fs_span.scss +1 -0
- package/styles/components/fs_tile.scss +18 -6
- package/utils/statuses.ts +1 -1
- package/utils/time.ts +1 -1
package/components/FSLoader.vue
CHANGED
|
@@ -69,8 +69,7 @@ export default defineComponent({
|
|
|
69
69
|
case "text-h4" : return isMobileSized.value ? "16px" : "20px";
|
|
70
70
|
case "text-body" :
|
|
71
71
|
case "text-button" : return isMobileSized.value ? "14px" : "16px";
|
|
72
|
-
case "text-overline" :
|
|
73
|
-
case "text-overline": return "16px";
|
|
72
|
+
case "text-overline" : return "16px";
|
|
74
73
|
}
|
|
75
74
|
});
|
|
76
75
|
|
package/components/FSSpan.vue
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSButton
|
|
3
|
+
icon="mdi-drag"
|
|
4
|
+
variant="icon"
|
|
5
|
+
v-bind="$attrs"
|
|
6
|
+
/>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script lang="ts">
|
|
10
|
+
import { defineComponent } from "vue";
|
|
11
|
+
|
|
12
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
13
|
+
|
|
14
|
+
import FSButton from "../FSButton.vue";
|
|
15
|
+
|
|
16
|
+
export default defineComponent({
|
|
17
|
+
name: "FSButtonCopyIcon",
|
|
18
|
+
components: {
|
|
19
|
+
FSButton
|
|
20
|
+
},
|
|
21
|
+
setup() {
|
|
22
|
+
return {
|
|
23
|
+
ColorEnum
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
</script>
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
import { defineComponent, type PropType } from "vue";
|
|
31
31
|
|
|
32
32
|
import type { FSDeviceAlert, FSDeviceConnectivity, FSDeviceStatus, FSDeviceStatusGroup, FSModelStatus } from "@dative-gpi/foundation-shared-components/models";
|
|
33
|
-
import { ConnectivityStatus } from "@dative-gpi/foundation-shared-domain/
|
|
33
|
+
import { ConnectivityStatus } from "@dative-gpi/foundation-shared-domain/enums";
|
|
34
34
|
|
|
35
35
|
import FSConnectivity from "./FSConnectivity.vue";
|
|
36
36
|
import FSWorstAlert from "./FSWorstAlert.vue";
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
<script lang="ts">
|
|
32
32
|
import { computed, defineComponent, type PropType, ref } from "vue";
|
|
33
33
|
|
|
34
|
-
import { AlertStatus, Criticity } from "@dative-gpi/foundation-shared-domain/
|
|
34
|
+
import { AlertStatus, Criticity } from "@dative-gpi/foundation-shared-domain/enums";
|
|
35
35
|
import type { FSDeviceAlert } from "@dative-gpi/foundation-shared-components/models";
|
|
36
36
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
37
37
|
|
|
@@ -60,7 +60,7 @@ import { computed, defineComponent, type PropType } from "vue";
|
|
|
60
60
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
61
61
|
import type { FSDeviceAlert} from "@dative-gpi/foundation-shared-components/models";
|
|
62
62
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
63
|
-
import { AlertStatus, Criticity } from "@dative-gpi/foundation-shared-domain/
|
|
63
|
+
import { AlertStatus, Criticity } from "@dative-gpi/foundation-shared-domain/enums";
|
|
64
64
|
import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
|
|
65
65
|
|
|
66
66
|
import FSButton from "../FSButton.vue";
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSBaseField
|
|
3
|
+
:description="$props.description"
|
|
4
|
+
:hideHeader="$props.hideHeader"
|
|
5
|
+
:required="$props.required"
|
|
6
|
+
:editable="$props.editable"
|
|
7
|
+
:label="$props.label"
|
|
8
|
+
:messages="messages"
|
|
9
|
+
>
|
|
10
|
+
<FSCol
|
|
11
|
+
gap="12px"
|
|
12
|
+
>
|
|
13
|
+
<FSRow>
|
|
14
|
+
<FSSelectField
|
|
15
|
+
:hideHeader="true"
|
|
16
|
+
:modelValue="$props.entityType"
|
|
17
|
+
@update:modelValue="$emit('update:entityType', $event)"
|
|
18
|
+
:items="actualEntityTypes"
|
|
19
|
+
:clearable="false"
|
|
20
|
+
/>
|
|
21
|
+
<template
|
|
22
|
+
v-if="itemsCount > 0"
|
|
23
|
+
>
|
|
24
|
+
<FSButton
|
|
25
|
+
:label="$tr('ui.entity-field.edit', 'Edit')"
|
|
26
|
+
icon="mdi-pencil"
|
|
27
|
+
@click="$emit('click:select')"
|
|
28
|
+
/>
|
|
29
|
+
</template>
|
|
30
|
+
<template
|
|
31
|
+
v-else
|
|
32
|
+
>
|
|
33
|
+
<FSButton
|
|
34
|
+
:label="$tr('ui.entity-field.select', 'Select')"
|
|
35
|
+
icon="mdi-plus-circle-multiple-outline"
|
|
36
|
+
@click="$emit('click:select')"
|
|
37
|
+
/>
|
|
38
|
+
</template>
|
|
39
|
+
</FSRow>
|
|
40
|
+
<FSRow>
|
|
41
|
+
<template
|
|
42
|
+
v-if="itemsCount > 0"
|
|
43
|
+
>
|
|
44
|
+
<FSColor
|
|
45
|
+
:color="ColorEnum.Primary"
|
|
46
|
+
:border="false"
|
|
47
|
+
width="100%"
|
|
48
|
+
>
|
|
49
|
+
<FSRow
|
|
50
|
+
padding="4px"
|
|
51
|
+
align="center-center"
|
|
52
|
+
>
|
|
53
|
+
<FSIcon
|
|
54
|
+
:icon="entityIcon"
|
|
55
|
+
/>
|
|
56
|
+
<FSSpan
|
|
57
|
+
font="text-overline"
|
|
58
|
+
>
|
|
59
|
+
{{ $tr('ui.entity-field.selected', '{0} selected(s)', itemsCount) }}
|
|
60
|
+
</FSSpan>
|
|
61
|
+
</FSRow>
|
|
62
|
+
</FSColor>
|
|
63
|
+
</template>
|
|
64
|
+
|
|
65
|
+
<template
|
|
66
|
+
v-else
|
|
67
|
+
>
|
|
68
|
+
<FSColor
|
|
69
|
+
:color="ColorEnum.Light"
|
|
70
|
+
:border="false"
|
|
71
|
+
width="100%"
|
|
72
|
+
>
|
|
73
|
+
<FSRow
|
|
74
|
+
padding="4px"
|
|
75
|
+
align="center-center"
|
|
76
|
+
>
|
|
77
|
+
<FSIcon
|
|
78
|
+
:icon="entityIcon"
|
|
79
|
+
/>
|
|
80
|
+
<FSSpan
|
|
81
|
+
font="text-overline"
|
|
82
|
+
>
|
|
83
|
+
{{ $tr('ui.entity-field.no-entity-selected', 'No entity selected') }}
|
|
84
|
+
</FSSpan>
|
|
85
|
+
</FSRow>
|
|
86
|
+
</FSColor>
|
|
87
|
+
</template>
|
|
88
|
+
</FSRow>
|
|
89
|
+
|
|
90
|
+
<FSFadeOut
|
|
91
|
+
v-if="$props.showEntities && itemsCount > 0"
|
|
92
|
+
maxHeight="220px"
|
|
93
|
+
width="100%"
|
|
94
|
+
>
|
|
95
|
+
<slot
|
|
96
|
+
name="items"
|
|
97
|
+
/>
|
|
98
|
+
</FSFadeOut>
|
|
99
|
+
</FSCol>
|
|
100
|
+
</FSBaseField>
|
|
101
|
+
</template>
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
<script lang="ts">
|
|
105
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
106
|
+
|
|
107
|
+
import { EntityType } from "@dative-gpi/foundation-shared-domain/enums";
|
|
108
|
+
import { ColorEnum } from "../../models";
|
|
109
|
+
import { useTranslations } from "@dative-gpi/bones-ui";
|
|
110
|
+
|
|
111
|
+
import FSRow from "../FSRow.vue";
|
|
112
|
+
import FSCol from "../FSCol.vue";
|
|
113
|
+
import FSBaseField from "./FSBaseField.vue";
|
|
114
|
+
import FSSelectField from "./FSSelectField.vue";
|
|
115
|
+
import FSButton from "../FSButton.vue";
|
|
116
|
+
import FSIcon from "../FSIcon.vue";
|
|
117
|
+
import FSColor from "../FSColor.vue";
|
|
118
|
+
|
|
119
|
+
export default defineComponent({
|
|
120
|
+
name: "FSEntityFieldUI",
|
|
121
|
+
components: {
|
|
122
|
+
FSBaseField,
|
|
123
|
+
FSSelectField,
|
|
124
|
+
FSButton,
|
|
125
|
+
FSIcon,
|
|
126
|
+
FSColor,
|
|
127
|
+
FSRow,
|
|
128
|
+
FSCol
|
|
129
|
+
},
|
|
130
|
+
props: {
|
|
131
|
+
label: {
|
|
132
|
+
type: String as PropType<string | null>,
|
|
133
|
+
required: false,
|
|
134
|
+
default: null
|
|
135
|
+
},
|
|
136
|
+
description: {
|
|
137
|
+
type: String as PropType<string | null>,
|
|
138
|
+
required: false,
|
|
139
|
+
default: null
|
|
140
|
+
},
|
|
141
|
+
itemsCount: {
|
|
142
|
+
type: Number,
|
|
143
|
+
required: false,
|
|
144
|
+
default: 0
|
|
145
|
+
},
|
|
146
|
+
hideHeader: {
|
|
147
|
+
type: Boolean,
|
|
148
|
+
required: false,
|
|
149
|
+
default: false
|
|
150
|
+
},
|
|
151
|
+
required: {
|
|
152
|
+
type: Boolean,
|
|
153
|
+
required: false,
|
|
154
|
+
default: false
|
|
155
|
+
},
|
|
156
|
+
rules: {
|
|
157
|
+
type: Array as PropType<any[]>,
|
|
158
|
+
required: false,
|
|
159
|
+
default: () => []
|
|
160
|
+
},
|
|
161
|
+
messages: {
|
|
162
|
+
type: Array as PropType<string[]>,
|
|
163
|
+
required: false,
|
|
164
|
+
default: null
|
|
165
|
+
},
|
|
166
|
+
editable: {
|
|
167
|
+
type: Boolean,
|
|
168
|
+
required: false,
|
|
169
|
+
default: true
|
|
170
|
+
},
|
|
171
|
+
entityType: {
|
|
172
|
+
type: Number as PropType<EntityType>,
|
|
173
|
+
required: true
|
|
174
|
+
},
|
|
175
|
+
allowedEntityTypes: {
|
|
176
|
+
type: Array as PropType<EntityType[]>,
|
|
177
|
+
required: false,
|
|
178
|
+
default: () => []
|
|
179
|
+
},
|
|
180
|
+
showEntities: {
|
|
181
|
+
type: Boolean,
|
|
182
|
+
required: false,
|
|
183
|
+
default: true
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
emits: ["update:entityType", "click:select"],
|
|
187
|
+
setup(props) {
|
|
188
|
+
const { $tr } = useTranslations();
|
|
189
|
+
|
|
190
|
+
const actualEntityTypes = computed(() => {
|
|
191
|
+
const items = [
|
|
192
|
+
{
|
|
193
|
+
id: EntityType.Model,
|
|
194
|
+
label: $tr("ui.entity-type.models", "Models")
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
id: EntityType.Group,
|
|
198
|
+
label: $tr("ui.entity-type.groups", "Groups")
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
id: EntityType.Location,
|
|
202
|
+
label: $tr("ui.entity-type.locations", "Locations")
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
id: EntityType.Device,
|
|
206
|
+
label: $tr("ui.entity-type.devices", "Devices")
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
id: EntityType.User,
|
|
210
|
+
label: $tr("ui.entity-type.users", "Users")
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
id: EntityType.Dashboard,
|
|
214
|
+
label: $tr("ui.entity-type.dashboards", "Dashboards")
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
id: EntityType.Folder,
|
|
218
|
+
label: $tr("ui.entity-type.folders", "Folders")
|
|
219
|
+
}
|
|
220
|
+
];
|
|
221
|
+
|
|
222
|
+
if(props.allowedEntityTypes.length) {
|
|
223
|
+
return items.filter(item => props.allowedEntityTypes.includes(item.id));
|
|
224
|
+
} else {
|
|
225
|
+
return items;
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
const entityIcon = computed(() => {
|
|
230
|
+
switch(props.entityType) {
|
|
231
|
+
case EntityType.Model:
|
|
232
|
+
return "mdi-cube";
|
|
233
|
+
case EntityType.Group:
|
|
234
|
+
return "mdi-account-group";
|
|
235
|
+
case EntityType.Location:
|
|
236
|
+
return "mdi-map-marker";
|
|
237
|
+
case EntityType.Device:
|
|
238
|
+
return "mdi-cellphone";
|
|
239
|
+
case EntityType.User:
|
|
240
|
+
return "mdi-account";
|
|
241
|
+
case EntityType.Dashboard:
|
|
242
|
+
return "mdi-view-dashboard";
|
|
243
|
+
case EntityType.Folder:
|
|
244
|
+
return "mdi-folder";
|
|
245
|
+
default:
|
|
246
|
+
return "mdi-cube";
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
return {
|
|
251
|
+
ColorEnum,
|
|
252
|
+
entityIcon,
|
|
253
|
+
actualEntityTypes
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
</script>
|
|
@@ -83,7 +83,7 @@ import _ from "lodash";
|
|
|
83
83
|
import { DateRules, NumberRules, TextRules } from "@dative-gpi/foundation-shared-components/models";
|
|
84
84
|
import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
|
|
85
85
|
import { useRules } from "@dative-gpi/foundation-shared-components/composables";
|
|
86
|
-
import { DateSetting } from "@dative-gpi/foundation-shared-domain/
|
|
86
|
+
import { DateSetting } from "@dative-gpi/foundation-shared-domain/enums";
|
|
87
87
|
|
|
88
88
|
import FSSelectDateSetting from "../selects/FSSelectDateSetting.vue";
|
|
89
89
|
import FSDateTimeRangeField from "./FSDateTimeRangeField.vue";
|
|
@@ -65,7 +65,7 @@ import { computed, defineComponent, type PropType, type StyleValue } from "vue";
|
|
|
65
65
|
|
|
66
66
|
import { useColors, useRules } from "@dative-gpi/foundation-shared-components/composables";
|
|
67
67
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
68
|
-
import { Days } from "@dative-gpi/foundation-shared-domain/
|
|
68
|
+
import { Days } from "@dative-gpi/foundation-shared-domain/enums";
|
|
69
69
|
|
|
70
70
|
import FSSelectField from "./FSSelectField.vue";
|
|
71
71
|
import FSBaseField from "./FSBaseField.vue";
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
<script lang="ts">
|
|
56
56
|
import { computed, defineComponent, type PropType } from "vue";
|
|
57
57
|
|
|
58
|
-
import type { TimeUnit } from "@dative-gpi/foundation-shared-domain/
|
|
58
|
+
import type { TimeUnit } from "@dative-gpi/foundation-shared-domain/enums";
|
|
59
59
|
|
|
60
60
|
import { useRules, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
61
61
|
import { timeSteps } from "@dative-gpi/foundation-shared-components/utils";
|
|
@@ -131,14 +131,14 @@ export default defineComponent({
|
|
|
131
131
|
return Object.keys(slots).filter(k => k.startsWith("number-")).reduce((acc, key) => {
|
|
132
132
|
acc[key.substring("number-".length)] = slots[key];
|
|
133
133
|
return acc;
|
|
134
|
-
}, {});
|
|
134
|
+
}, {} as {[index: string]: any});
|
|
135
135
|
});
|
|
136
136
|
|
|
137
137
|
const selectSlots = computed((): any => {
|
|
138
138
|
return Object.keys(slots).filter(k => k.startsWith("select-")).reduce((acc, key) => {
|
|
139
139
|
acc[key.substring("select-".length)] = slots[key];
|
|
140
140
|
return acc;
|
|
141
|
-
}, {});
|
|
141
|
+
}, {} as {[index: string]: any});
|
|
142
142
|
});
|
|
143
143
|
|
|
144
144
|
const messages = computed((): string[] => props.messages ?? getMessages(props.modelValue, props.rules));
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="$props.direction == 'row' ? FSRow : FSCol"
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
>
|
|
6
|
+
<FSTile
|
|
7
|
+
v-for="item in items"
|
|
8
|
+
:key="item.id"
|
|
9
|
+
v-bind="tileProps(item)"
|
|
10
|
+
:width="$props.direction == 'row' ? 'fit-content' : '100%'"
|
|
11
|
+
height="fit-content"
|
|
12
|
+
>
|
|
13
|
+
<slot
|
|
14
|
+
name="item"
|
|
15
|
+
:item="item"
|
|
16
|
+
>
|
|
17
|
+
<FSRow
|
|
18
|
+
align="center-left"
|
|
19
|
+
>
|
|
20
|
+
<FSButtonDragIcon
|
|
21
|
+
v-if="showDraggable"
|
|
22
|
+
/>
|
|
23
|
+
<slot
|
|
24
|
+
name="itemContent"
|
|
25
|
+
:item="item"
|
|
26
|
+
>
|
|
27
|
+
<!-- TODO : add draggable option -->
|
|
28
|
+
<FSImage
|
|
29
|
+
v-if="item.imageId"
|
|
30
|
+
:imageId="item.imageId"
|
|
31
|
+
width="24px"
|
|
32
|
+
height="24px"
|
|
33
|
+
/>
|
|
34
|
+
<FSIcon
|
|
35
|
+
size="24px"
|
|
36
|
+
v-else-if="item.icon"
|
|
37
|
+
:icon="item.icon"
|
|
38
|
+
/>
|
|
39
|
+
<FSSpan>{{ item[itemLabel] }}</FSSpan>
|
|
40
|
+
</slot>
|
|
41
|
+
<FSRow
|
|
42
|
+
align="center-right"
|
|
43
|
+
>
|
|
44
|
+
<FSButtonEditIcon
|
|
45
|
+
v-if="showEdit"
|
|
46
|
+
@click="$emit('click:edit', item.id)"
|
|
47
|
+
/>
|
|
48
|
+
<FSButtonRemoveIcon
|
|
49
|
+
v-if="showRemove"
|
|
50
|
+
@click="$emit('click:remove', item.id)"
|
|
51
|
+
/>
|
|
52
|
+
</FSRow>
|
|
53
|
+
</FSRow>
|
|
54
|
+
</slot>
|
|
55
|
+
</FSTile>
|
|
56
|
+
</component>
|
|
57
|
+
</template>
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
<script lang="ts">
|
|
61
|
+
import { defineComponent, type PropType } from "vue";
|
|
62
|
+
|
|
63
|
+
import { ColorEnum } from "../../models"
|
|
64
|
+
|
|
65
|
+
import FSRow from "../FSRow.vue";
|
|
66
|
+
import FSCol from "../FSCol.vue";
|
|
67
|
+
import FSImage from "../FSImage.vue";
|
|
68
|
+
import FSIcon from "../FSIcon.vue";
|
|
69
|
+
import FSSpan from "../FSSpan.vue";
|
|
70
|
+
import FSTile from "../tiles/FSTile.vue";
|
|
71
|
+
import FSButtonRemoveIcon from "../buttons/FSButtonRemoveIcon.vue";
|
|
72
|
+
import FSButtonEditIcon from "../buttons/FSButtonEditIcon.vue";
|
|
73
|
+
import FSButtonDragIcon from "../buttons/FSButtonDragIcon.vue";
|
|
74
|
+
|
|
75
|
+
export default defineComponent({
|
|
76
|
+
name: "FSSimpleList",
|
|
77
|
+
components: {
|
|
78
|
+
FSRow,
|
|
79
|
+
FSCol,
|
|
80
|
+
FSTile,
|
|
81
|
+
FSImage,
|
|
82
|
+
FSIcon,
|
|
83
|
+
FSSpan,
|
|
84
|
+
FSButtonRemoveIcon,
|
|
85
|
+
FSButtonEditIcon,
|
|
86
|
+
FSButtonDragIcon,
|
|
87
|
+
},
|
|
88
|
+
props: {
|
|
89
|
+
items: {
|
|
90
|
+
type: Array as PropType<{id: string, label?: string, icon?: string, imageId?: string, [index: string]: any}[]>,
|
|
91
|
+
required: true
|
|
92
|
+
},
|
|
93
|
+
tileProps: {
|
|
94
|
+
type: Function as PropType<(item: any) => Record<string, any>>,
|
|
95
|
+
required: false,
|
|
96
|
+
default: () => () => ({})
|
|
97
|
+
},
|
|
98
|
+
showEdit: {
|
|
99
|
+
type: Boolean,
|
|
100
|
+
required: false,
|
|
101
|
+
default: true
|
|
102
|
+
},
|
|
103
|
+
showRemove: {
|
|
104
|
+
type: Boolean,
|
|
105
|
+
required: false,
|
|
106
|
+
default: true
|
|
107
|
+
},
|
|
108
|
+
showDraggable: {
|
|
109
|
+
type: Boolean,
|
|
110
|
+
required: false,
|
|
111
|
+
default: false
|
|
112
|
+
},
|
|
113
|
+
direction: {
|
|
114
|
+
type: String as PropType<"row" | "column">,
|
|
115
|
+
required: false,
|
|
116
|
+
default: "column"
|
|
117
|
+
},
|
|
118
|
+
itemLabel: {
|
|
119
|
+
type: String,
|
|
120
|
+
required: false,
|
|
121
|
+
default: "label"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
emits: ["click:edit", "click:remove"],
|
|
125
|
+
setup(){
|
|
126
|
+
return {
|
|
127
|
+
ColorEnum,
|
|
128
|
+
FSRow,
|
|
129
|
+
FSCol
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
</script>
|
|
@@ -13,7 +13,7 @@ import type { PropType} from "vue";
|
|
|
13
13
|
import { computed, defineComponent } from "vue";
|
|
14
14
|
|
|
15
15
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
16
|
-
import { AutoRefresh } from "@dative-gpi/foundation-shared-domain/
|
|
16
|
+
import { AutoRefresh } from "@dative-gpi/foundation-shared-domain/enums";
|
|
17
17
|
|
|
18
18
|
import FSSelectField from "../fields/FSSelectField.vue";
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@ import type { PropType} from "vue";
|
|
|
13
13
|
import { computed, defineComponent } from "vue";
|
|
14
14
|
|
|
15
15
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
16
|
-
import { DashboardVariableType } from "@dative-gpi/foundation-shared-domain/
|
|
16
|
+
import { DashboardVariableType } from "@dative-gpi/foundation-shared-domain/enums";
|
|
17
17
|
|
|
18
18
|
import FSSelectField from "../fields/FSSelectField.vue";
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { computed, defineComponent, type PropType } from "vue";
|
|
14
14
|
|
|
15
15
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
16
|
-
import { DateSetting } from "@dative-gpi/foundation-shared-domain/
|
|
16
|
+
import { DateSetting } from "@dative-gpi/foundation-shared-domain/enums";
|
|
17
17
|
|
|
18
18
|
import FSSelectField from "../fields/FSSelectField.vue";
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@ import type { PropType} from "vue";
|
|
|
13
13
|
import { computed, defineComponent } from "vue";
|
|
14
14
|
|
|
15
15
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
16
|
-
import { Days } from "@dative-gpi/foundation-shared-domain/
|
|
16
|
+
import { Days } from "@dative-gpi/foundation-shared-domain/enums";
|
|
17
17
|
|
|
18
18
|
import FSSelectField from "../fields/FSSelectField.vue";
|
|
19
19
|
|
|
@@ -19,7 +19,7 @@ import type { PropType} from "vue";
|
|
|
19
19
|
import { defineComponent } from "vue";
|
|
20
20
|
|
|
21
21
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
22
|
-
import { ListModes } from "@dative-gpi/foundation-shared-domain/
|
|
22
|
+
import { ListModes } from "@dative-gpi/foundation-shared-domain/enums";
|
|
23
23
|
|
|
24
24
|
import FSSelectField from "../fields/FSSelectField.vue";
|
|
25
25
|
|
|
@@ -13,7 +13,7 @@ import type { PropType} from "vue";
|
|
|
13
13
|
import { computed, defineComponent } from "vue";
|
|
14
14
|
|
|
15
15
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
16
|
-
import { Months } from "@dative-gpi/foundation-shared-domain/
|
|
16
|
+
import { Months } from "@dative-gpi/foundation-shared-domain/enums";
|
|
17
17
|
|
|
18
18
|
import FSSelectField from "../fields/FSSelectField.vue";
|
|
19
19
|
|
|
@@ -1,89 +1,93 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
v-if="$props.singleSelect"
|
|
2
|
+
<FSCol
|
|
4
3
|
class="fs-tile"
|
|
5
|
-
|
|
6
|
-
:
|
|
7
|
-
:height="height"
|
|
8
|
-
:color="color"
|
|
9
|
-
:style="style"
|
|
10
|
-
@click="() => $emit('update:modelValue', !$props.modelValue)"
|
|
11
|
-
v-bind="$attrs"
|
|
4
|
+
:height="$props.height"
|
|
5
|
+
:width="$props.width"
|
|
12
6
|
>
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
<FSClickable
|
|
8
|
+
v-if="$props.singleSelect"
|
|
9
|
+
padding="12px"
|
|
10
|
+
:variant="variant"
|
|
11
|
+
:color="color"
|
|
17
12
|
:style="style"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
:height="height"
|
|
28
|
-
:to="$props.to"
|
|
29
|
-
:style="style"
|
|
30
|
-
v-bind="$attrs"
|
|
31
|
-
>
|
|
32
|
-
<slot />
|
|
33
|
-
<FSCard
|
|
34
|
-
v-if="$props.editable"
|
|
35
|
-
class="fs-tile-checkbox"
|
|
13
|
+
width="100%"
|
|
14
|
+
height="100%"
|
|
15
|
+
@click="() => $emit('update:modelValue', !$props.modelValue)"
|
|
16
|
+
v-bind="$attrs"
|
|
17
|
+
>
|
|
18
|
+
<slot />
|
|
19
|
+
</FSClickable>
|
|
20
|
+
<FSClickable
|
|
21
|
+
v-else-if="$props.href || $props.to || $attrs.onClick"
|
|
36
22
|
variant="background"
|
|
23
|
+
class="fs-tile"
|
|
24
|
+
padding="12px"
|
|
37
25
|
:color="ColorEnum.Background"
|
|
38
|
-
:
|
|
26
|
+
:href="$props.href"
|
|
27
|
+
width="100%"
|
|
28
|
+
height="100%"
|
|
29
|
+
:to="$props.to"
|
|
30
|
+
:style="style"
|
|
39
31
|
v-bind="$attrs"
|
|
40
32
|
>
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
:color="color"
|
|
57
|
-
:style="style"
|
|
58
|
-
:height="height"
|
|
59
|
-
v-bind="$attrs"
|
|
60
|
-
>
|
|
61
|
-
<slot />
|
|
33
|
+
<slot />
|
|
34
|
+
<FSCard
|
|
35
|
+
v-if="$props.editable"
|
|
36
|
+
class="fs-tile-checkbox"
|
|
37
|
+
variant="background"
|
|
38
|
+
:color="ColorEnum.Background"
|
|
39
|
+
:border="false"
|
|
40
|
+
v-bind="$attrs"
|
|
41
|
+
>
|
|
42
|
+
<FSCheckbox
|
|
43
|
+
:modelValue="$props.modelValue"
|
|
44
|
+
@update:modelValue="() => $emit('update:modelValue', !$props.modelValue)"
|
|
45
|
+
/>
|
|
46
|
+
</FSCard>
|
|
47
|
+
</FSClickable>
|
|
62
48
|
<FSCard
|
|
63
|
-
v-
|
|
64
|
-
class="fs-tile-checkbox"
|
|
49
|
+
v-else
|
|
65
50
|
variant="background"
|
|
66
|
-
|
|
51
|
+
class="fs-tile"
|
|
52
|
+
padding="12px"
|
|
53
|
+
:color="color"
|
|
54
|
+
:style="style"
|
|
55
|
+
width="100%"
|
|
56
|
+
height="100%"
|
|
67
57
|
v-bind="$attrs"
|
|
68
58
|
>
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
59
|
+
<slot />
|
|
60
|
+
<FSCard
|
|
61
|
+
v-if="$props.editable"
|
|
62
|
+
class="fs-tile-checkbox"
|
|
63
|
+
variant="background"
|
|
64
|
+
:border="false"
|
|
65
|
+
v-bind="$attrs"
|
|
66
|
+
>
|
|
67
|
+
<FSCheckbox
|
|
68
|
+
:modelValue="$props.modelValue"
|
|
69
|
+
@update:modelValue="() => $emit('update:modelValue', !$props.modelValue)"
|
|
70
|
+
/>
|
|
71
|
+
</FSCard>
|
|
72
|
+
</FSCard>
|
|
73
|
+
<div
|
|
74
|
+
v-if="$props.leftColor"
|
|
75
|
+
class="fs-tile-left"
|
|
76
|
+
:style="style"
|
|
77
|
+
/>
|
|
74
78
|
<div
|
|
75
79
|
v-if="$props.bottomColor"
|
|
76
80
|
class="fs-tile-bottom"
|
|
77
81
|
:style="style"
|
|
78
82
|
/>
|
|
79
|
-
</
|
|
83
|
+
</FSCol>
|
|
80
84
|
</template>
|
|
81
85
|
|
|
82
86
|
<script lang="ts">
|
|
83
87
|
import { computed, defineComponent, type PropType, type StyleValue } from "vue";
|
|
84
88
|
import { type RouteLocation } from "vue-router";
|
|
85
89
|
|
|
86
|
-
import {
|
|
90
|
+
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
87
91
|
import { ColorEnum, type ColorBase } from "@dative-gpi/foundation-shared-components/models";
|
|
88
92
|
|
|
89
93
|
import FSClickable from "../FSClickable.vue";
|
|
@@ -123,6 +127,11 @@ export default defineComponent({
|
|
|
123
127
|
required: false,
|
|
124
128
|
default: null
|
|
125
129
|
},
|
|
130
|
+
leftColor: {
|
|
131
|
+
type: [Array, String] as PropType<ColorBase[] | ColorBase | null>,
|
|
132
|
+
required: false,
|
|
133
|
+
default: null
|
|
134
|
+
},
|
|
126
135
|
editable: {
|
|
127
136
|
type: Boolean,
|
|
128
137
|
required: false,
|
|
@@ -132,25 +141,33 @@ export default defineComponent({
|
|
|
132
141
|
type: Boolean,
|
|
133
142
|
required: false,
|
|
134
143
|
default: false
|
|
135
|
-
}
|
|
144
|
+
},
|
|
145
|
+
width: {
|
|
146
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
147
|
+
required: false,
|
|
148
|
+
default: null
|
|
149
|
+
},
|
|
150
|
+
height: {
|
|
151
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
152
|
+
required: false,
|
|
153
|
+
default: () => [170, 156]
|
|
154
|
+
},
|
|
136
155
|
},
|
|
137
156
|
emits: ["update:modelValue"],
|
|
138
157
|
setup(props) {
|
|
139
|
-
const { isMobileSized } = useBreakpoints();
|
|
140
158
|
const { getGradients } = useColors();
|
|
141
159
|
|
|
142
160
|
const style = computed((): StyleValue => {
|
|
161
|
+
const result: StyleValue = {};
|
|
143
162
|
if (props.bottomColor) {
|
|
144
163
|
const bottomColors = getGradients(props.bottomColor);
|
|
145
|
-
|
|
146
|
-
"--fs-tile-border-color": bottomColors.base
|
|
147
|
-
};
|
|
164
|
+
result["--fs-tile-bottom-border-color"] = bottomColors.base;
|
|
148
165
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
return
|
|
166
|
+
if (props.leftColor) {
|
|
167
|
+
const leftColors = getGradients(props.leftColor);
|
|
168
|
+
result["--fs-tile-left-border-color"] = leftColors.base;
|
|
169
|
+
}
|
|
170
|
+
return result;
|
|
154
171
|
});
|
|
155
172
|
|
|
156
173
|
const variant = computed((): "standard" | "background" => {
|
|
@@ -164,7 +181,6 @@ export default defineComponent({
|
|
|
164
181
|
return {
|
|
165
182
|
ColorEnum,
|
|
166
183
|
variant,
|
|
167
|
-
height,
|
|
168
184
|
color,
|
|
169
185
|
style
|
|
170
186
|
};
|
package/models/deviceAlerts.ts
CHANGED
package/models/rules.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { useDateFormat } from "@dative-gpi/foundation-shared-services/composable
|
|
|
3
3
|
import { validateExpression } from "@dative-gpi/foundation-shared-domain/tools";
|
|
4
4
|
|
|
5
5
|
import { getTimeBestString } from "../utils";
|
|
6
|
-
import type { TimeUnit } from "@/shared/foundation-shared-domain";
|
|
6
|
+
import type { TimeUnit } from "@/shared/foundation-shared-domain/enums";
|
|
7
7
|
|
|
8
8
|
const { epochToLongDateFormat } = useDateFormat()!;
|
|
9
9
|
const { $tr } = useTranslationsProvider();
|
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.47",
|
|
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.47",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "1.0.47"
|
|
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": "6a6b6c8bbe0727f403dacdb5813c199a4e0cc104"
|
|
39
39
|
}
|
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
.fs-tile {
|
|
2
2
|
position: relative;
|
|
3
|
-
border-bottom-left-radius: 0px !important;
|
|
4
|
-
border-bottom-right-radius: 0px !important;
|
|
5
3
|
}
|
|
6
4
|
|
|
7
5
|
.fs-tile-bottom {
|
|
8
6
|
position: absolute;
|
|
9
|
-
bottom:
|
|
10
|
-
left:
|
|
11
|
-
width:
|
|
7
|
+
bottom: 0px;
|
|
8
|
+
left: 0;
|
|
9
|
+
width: 100%;
|
|
12
10
|
height: 3px;
|
|
13
|
-
|
|
11
|
+
border-bottom-left-radius: 4px;
|
|
12
|
+
border-bottom-right-radius: 4px;
|
|
13
|
+
background: var(--fs-tile-bottom-border-color);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
.fs-tile-left {
|
|
18
|
+
position: absolute;
|
|
19
|
+
top: 0px;
|
|
20
|
+
left: 0px;
|
|
21
|
+
height: 100%;
|
|
22
|
+
width: 3px;
|
|
23
|
+
border-bottom-left-radius: 4px;
|
|
24
|
+
border-top-left-radius: 4px;
|
|
25
|
+
background: var(--fs-tile-left-border-color);
|
|
14
26
|
}
|
|
15
27
|
|
|
16
28
|
.fs-tile-checkbox {
|
package/utils/statuses.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
2
|
-
import { ConnectivityStatus } from "@dative-gpi/foundation-shared-domain/
|
|
2
|
+
import { ConnectivityStatus } from "@dative-gpi/foundation-shared-domain/enums";
|
|
3
3
|
|
|
4
4
|
const { $tr } = useTranslationsProvider();
|
|
5
5
|
|
package/utils/time.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
2
2
|
|
|
3
|
-
import { TimeUnit } from "@dative-gpi/foundation-shared-domain/
|
|
3
|
+
import { TimeUnit } from "@dative-gpi/foundation-shared-domain/enums"
|
|
4
4
|
|
|
5
5
|
const { $tr } = useTranslationsProvider();
|
|
6
6
|
|