@dative-gpi/foundation-shared-components 0.0.118 → 0.1.120

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.
Files changed (37) hide show
  1. package/components/FSBreadcrumbs.vue +1 -1
  2. package/components/FSButton.vue +1 -1
  3. package/components/FSChip.vue +1 -1
  4. package/components/FSClickable.vue +2 -2
  5. package/components/FSClock.vue +1 -7
  6. package/components/FSCol.vue +1 -1
  7. package/components/FSDialogForm.vue +141 -52
  8. package/components/FSDialogMultiForm.vue +39 -40
  9. package/components/FSDialogRemove.vue +2 -2
  10. package/components/FSDialogSubmit.vue +44 -39
  11. package/components/FSDivider.vue +1 -1
  12. package/components/FSSlideGroup.vue +1 -1
  13. package/components/FSTabs.vue +12 -12
  14. package/components/FSTagGroup.vue +28 -5
  15. package/components/FSText.vue +1 -1
  16. package/components/FSWrapGroup.vue +1 -1
  17. package/components/deviceOrganisations/FSStatusCard.vue +0 -1
  18. package/components/fields/FSAutocompleteField.vue +284 -106
  19. package/components/fields/FSDateRangeField.vue +2 -2
  20. package/components/fields/FSDateTimeRangeField.vue +5 -11
  21. package/components/fields/FSSelectField.vue +11 -3
  22. package/components/fields/FSTagField.vue +2 -2
  23. package/components/fields/FSTermField.vue +3 -1
  24. package/components/lists/FSDataTableUI.vue +1 -0
  25. package/components/tiles/FSDeviceOrganisationTileUI.vue +1 -1
  26. package/components/tiles/FSGroupTileUI.vue +1 -1
  27. package/components/tiles/FSSimpleIconTileUI.vue +1 -1
  28. package/components/tiles/FSUserOrganisationTileUI.vue +2 -2
  29. package/composables/useColors.ts +39 -49
  30. package/package.json +4 -4
  31. package/styles/components/fs_data_table.scss +100 -94
  32. package/styles/components/fs_dialog.scss +4 -3
  33. package/styles/components/fs_dialog_menu.scss +2 -2
  34. package/styles/components/fs_slider.scss +9 -1
  35. package/styles/components/fs_tabs.scss +5 -4
  36. package/styles/globals/overrides.scss +2 -2
  37. package/styles/globals/scrollbars.scss +46 -36
@@ -55,7 +55,7 @@ export default defineComponent({
55
55
  const style: Ref<{ [key: string] : string }> = ref({
56
56
  "--fs-breadcrumbs-color": darks.dark,
57
57
  "--fs-breadcrumbs-active-color": darks.base,
58
- "--fs-breadcrumbs-disabled-color": darks.light
58
+ "--fs-breadcrumbs-disabled-color": darks.soft
59
59
  });
60
60
 
61
61
  const classes = (item: FSBreadcrumbItem): string[] => {
@@ -251,7 +251,7 @@ export default defineComponent({
251
251
  case ColorEnum.Success:
252
252
  case ColorEnum.Warning:
253
253
  case ColorEnum.Error : return ["standard"].includes(props.variant) ? colors.value.dark : colors.value.light;
254
- default : return ["standard"].includes(props.variant) ? darks.dark : darks.light;
254
+ default : return ["standard"].includes(props.variant) ? darks.dark : darks.soft;
255
255
  }
256
256
  });
257
257
 
@@ -122,7 +122,7 @@ export default defineComponent({
122
122
  case "full": return {
123
123
  "--fs-chip-height" : sizeToVar(props.height),
124
124
  "--fs-chip-background-color" : colors.value.base,
125
- "--fs-chip-border-color" : colors.value.baseContrast,
125
+ "--fs-chip-border-color" : colors.value.base,
126
126
  "--fs-chip-color" : colors.value.baseContrast,
127
127
  "--fs-chip-hover-background-color" : colors.value.base,
128
128
  "--fs-chip-hover-border-color" : colors.value.base,
@@ -254,7 +254,7 @@ export default defineComponent({
254
254
  "--fs-clickable-border-color" : colors.value.lightContrast,
255
255
  "--fs-clickable-color" : colors.value.lightContrast,
256
256
  "--fs-clickable-hover-background-color" : colors.value.base,
257
- "--fs-clickable-hover-border-color" : colors.value.baseContrast,
257
+ "--fs-clickable-hover-border-color" : colors.value.base,
258
258
  "--fs-clickable-hover-color" : colors.value.baseContrast,
259
259
  "--fs-clickable-active-background-color": colors.value.dark,
260
260
  "--fs-clickable-active-border-color" : colors.value.darkContrast,
@@ -326,7 +326,7 @@ export default defineComponent({
326
326
  case ColorEnum.Success:
327
327
  case ColorEnum.Warning:
328
328
  case ColorEnum.Error : return ["full"].includes(props.variant) ? colors.value.light : colors.value.dark;
329
- default : return ["full"].includes(props.variant) ? darks.light : darks.dark;
329
+ default : return ["full"].includes(props.variant) ? darks.soft : darks.dark;
330
330
  }
331
331
  });
332
332
 
@@ -1,7 +1,5 @@
1
1
  <template>
2
- <FSCol
3
- width="fill"
4
- >
2
+ <FSCol>
5
3
  <FSRow
6
4
  align="center-center"
7
5
  :wrap="false"
@@ -40,10 +38,6 @@
40
38
  :min="0"
41
39
  v-model="innerHours"
42
40
  />
43
- </FSCol>
44
- <FSCol
45
- v-if="$props.slider"
46
- >
47
41
  <FSSlider
48
42
  :label="$tr('ui.clock.minutes', 'Minutes')"
49
43
  :readonly="!$props.editable"
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div
3
- :style="style"
4
3
  :class="classes"
4
+ :style="style"
5
5
  v-bind="$attrs"
6
6
  >
7
7
  <slot />
@@ -1,20 +1,71 @@
1
1
  <template>
2
2
  <FSDialog
3
- :title="$props.title"
4
3
  :subtitle="$props.subtitle"
4
+ :title="$props.title"
5
5
  :width="$props.width"
6
6
  :modelValue="$props.modelValue"
7
- @update:modelValue="$emit('update:modelValue', $event)"
7
+ @update:modelValue="onClose"
8
8
  v-bind="$attrs"
9
9
  >
10
10
  <template
11
11
  #body
12
12
  >
13
- <FSForm
14
- ref="formRef"
15
- :variant="$props.variant"
16
- @submit="onSubmit"
17
- v-model="valid"
13
+ <template
14
+ v-if="!$props.validation"
15
+ >
16
+ <FSForm
17
+ ref="formRef"
18
+ :variant="$props.variant"
19
+ @submit="onSubmit"
20
+ v-model="valid"
21
+ >
22
+ <FSCol
23
+ gap="24px"
24
+ >
25
+ <FSFadeOut
26
+ :height="height"
27
+ padding="0 8px 0 0"
28
+ >
29
+ <slot
30
+ name="body"
31
+ />
32
+ </FSFadeOut>
33
+ <FSRow
34
+ padding="0 16px 0 0"
35
+ >
36
+ <slot
37
+ name="left-footer"
38
+ />
39
+ <FSRow
40
+ class="fs-dialog-actions"
41
+ align="top-right"
42
+ :wrap="false"
43
+ >
44
+ <FSButton
45
+ :prependIcon="$props.cancelButtonPrependIcon"
46
+ :appendIcon="$props.cancelButtonAppendIcon"
47
+ :variant="$props.cancelButtonVariant"
48
+ :color="$props.cancelButtonColor"
49
+ :label="cancelLabel"
50
+ @click="() => $emit('update:modelValue', false)"
51
+ />
52
+ <FSButton
53
+ type="submit"
54
+ :prependIcon="$props.submitButtonPrependIcon"
55
+ :appendIcon="$props.submitButtonAppendIcon"
56
+ :variant="$props.submitButtonVariant"
57
+ :color="$props.submitButtonColor"
58
+ :editable="$props.editable"
59
+ :label="submitLabel"
60
+ :load="$props.load"
61
+ />
62
+ </FSRow>
63
+ </FSRow>
64
+ </FSCol>
65
+ </FSForm>
66
+ </template>
67
+ <template
68
+ v-else
18
69
  >
19
70
  <FSCol
20
71
  gap="24px"
@@ -24,7 +75,7 @@
24
75
  padding="0 8px 0 0"
25
76
  >
26
77
  <slot
27
- name="body"
78
+ name="validation"
28
79
  />
29
80
  </FSFadeOut>
30
81
  <FSRow
@@ -39,27 +90,17 @@
39
90
  :wrap="false"
40
91
  >
41
92
  <FSButton
42
- :prependIcon="$props.leftButtonPrependIcon"
43
- :label="cancelButtonLabel"
44
- :appendIcon="$props.leftButtonAppendIcon"
45
- :variant="$props.leftButtonVariant"
46
- :color="$props.leftButtonColor"
47
- @click="() => $emit('update:modelValue', false)"
48
- />
49
- <FSButton
50
- type="submit"
51
- :prependIcon="$props.rightButtonPrependIcon"
52
- :label="submitButtonLabel"
53
- :appendIcon="$props.rightButtonAppendIcon"
54
- :variant="$props.rightButtonVariant"
55
- :color="$props.rightButtonColor"
56
- :load="$props.load"
57
- :editable="$props.editable"
93
+ :prependIcon="$props.validateButtonPrependIcon"
94
+ :appendIcon="$props.validateButtonAppendIcon"
95
+ :variant="$props.validateButtonVariant"
96
+ :color="$props.validateButtonColor"
97
+ :label="validateLabel"
98
+ @click="onValidate"
58
99
  />
59
100
  </FSRow>
60
101
  </FSRow>
61
102
  </FSCol>
62
- </FSForm>
103
+ </template>
63
104
  </template>
64
105
  </FSDialog>
65
106
  </template>
@@ -112,55 +153,85 @@ export default defineComponent({
112
153
  required: false,
113
154
  default: false
114
155
  },
115
- leftButtonPrependIcon: {
156
+ cancelButtonPrependIcon: {
116
157
  type: String as PropType<string | null>,
117
158
  required: false,
118
159
  default: null
119
160
  },
120
- leftButtonLabel: {
161
+ cancelButtonLabel: {
121
162
  type: String as PropType<string | null>,
122
163
  required: false,
123
164
  default: null
124
165
  },
125
- leftButtonAppendIcon: {
166
+ cancelButtonAppendIcon: {
126
167
  type: String as PropType<string | null>,
127
168
  required: false,
128
169
  default: null
129
170
  },
130
- leftButtonVariant: {
171
+ cancelButtonVariant: {
131
172
  type: String as PropType<"standard" | "full" | "icon">,
132
173
  required: false,
133
174
  default: "standard"
134
175
  },
135
- rightButtonPrependIcon: {
176
+ cancelButtonColor: {
177
+ type: String as PropType<ColorBase>,
178
+ required: false,
179
+ default: ColorEnum.Light
180
+ },
181
+ submitButtonPrependIcon: {
136
182
  type: String as PropType<string | null>,
137
183
  required: false,
138
184
  default: null
139
185
  },
140
- rightButtonLabel: {
186
+ submitButtonLabel: {
141
187
  type: String as PropType<string | null>,
142
188
  required: false,
143
189
  default: null
144
190
  },
145
- rightButtonAppendIcon: {
191
+ submitButtonAppendIcon: {
146
192
  type: String as PropType<string | null>,
147
193
  required: false,
148
194
  default: null
149
195
  },
150
- rightButtonVariant: {
196
+ submitButtonVariant: {
151
197
  type: String as PropType<"standard" | "full" | "icon">,
152
198
  required: false,
153
199
  default: "full"
154
200
  },
155
- leftButtonColor: {
201
+ submitButtonColor: {
156
202
  type: String as PropType<ColorBase>,
157
203
  required: false,
158
- default: ColorEnum.Light
204
+ default: ColorEnum.Primary
205
+ },
206
+ validateButtonPrependIcon: {
207
+ type: String as PropType<string | null>,
208
+ required: false,
209
+ default: null
210
+ },
211
+ validateButtonLabel: {
212
+ type: String as PropType<string | null>,
213
+ required: false,
214
+ default: null
215
+ },
216
+ validateButtonAppendIcon: {
217
+ type: String as PropType<string | null>,
218
+ required: false,
219
+ default: null
220
+ },
221
+ validateButtonVariant: {
222
+ type: String as PropType<"standard" | "full" | "icon">,
223
+ required: false,
224
+ default: "standard"
159
225
  },
160
- rightButtonColor: {
226
+ validateButtonColor: {
161
227
  type: String as PropType<ColorBase>,
162
228
  required: false,
163
- default: ColorEnum.Primary
229
+ default: ColorEnum.Light
230
+ },
231
+ validation: {
232
+ type: Boolean,
233
+ required: false,
234
+ default: false
164
235
  },
165
236
  load: {
166
237
  type: Boolean,
@@ -173,7 +244,7 @@ export default defineComponent({
173
244
  default: true
174
245
  }
175
246
  },
176
- emits: ["update:modelValue", "click:rightButton"],
247
+ emits: ["update:modelValue", "click:submitButton", "click:validateButton"],
177
248
  setup(props, { emit }) {
178
249
  const { isMobileSized } = useBreakpoints();
179
250
  const { $tr } = useTranslationsProvider();
@@ -182,36 +253,54 @@ export default defineComponent({
182
253
  const valid = ref(false);
183
254
 
184
255
  const height = computed(() => {
185
- const other = 24 + 24 // Paddings
186
- + (props.title ? isMobileSized.value ? 24 : 32 : 0) // Title
187
- + (props.subtitle ? isMobileSized.value ? 14 + 8 : 16 + 8 : 0) // Subtitle
188
- + (isMobileSized.value ? 36 : 40) // Footer
189
- + 64; // Debug mask
190
- return `calc(90vh - ${other}px)`;
256
+ const other = 24 + 24 // Paddings
257
+ + (isMobileSized.value ? 24 : 32) + 24 // Title
258
+ + (props.subtitle ? (isMobileSized.value ? 14 : 16) + 8 : 0) // Subtitle
259
+ + (isMobileSized.value ? 36 : 40) + 24; // Footer
260
+ return `calc(100vh - 40px - ${other}px)`;
261
+ });
262
+
263
+ const cancelLabel = computed(() => {
264
+ return props.cancelButtonLabel ?? $tr("ui.button.cancel", "Cancel");
191
265
  });
192
266
 
193
- const cancelButtonLabel = computed(() => {
194
- return props.leftButtonLabel ?? $tr("ui.button.cancel", "Cancel");
267
+ const submitLabel = computed(() => {
268
+ return props.submitButtonLabel ?? $tr("ui.button.submit", "Submit");
195
269
  });
196
270
 
197
- const submitButtonLabel = computed(() => {
198
- return props.rightButtonLabel ?? $tr("ui.button.validate", "Validate");
271
+ const validateLabel = computed(() => {
272
+ return props.validateButtonLabel ?? $tr("ui.button.validate", "Done");
199
273
  });
200
274
 
275
+ const onClose = () => {
276
+ if (props.validation) {
277
+ emit("click:validateButton");
278
+ }
279
+ emit("update:modelValue", false);
280
+ };
281
+
201
282
  const onSubmit = () => {
202
283
  if (valid.value) {
203
- emit("click:rightButton");
284
+ emit("click:submitButton");
204
285
  }
205
286
  };
206
287
 
288
+ const onValidate = () => {
289
+ emit("click:validateButton");
290
+ emit("update:modelValue", false);
291
+ };
292
+
207
293
  return {
208
- cancelButtonLabel,
209
- submitButtonLabel,
294
+ validateLabel,
295
+ cancelLabel,
296
+ submitLabel,
210
297
  ColorEnum,
211
298
  formRef,
212
299
  height,
213
300
  valid,
214
- onSubmit
301
+ onValidate,
302
+ onSubmit,
303
+ onClose
215
304
  };
216
305
  }
217
306
  });
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <FSDialog
3
- :title="$props.title"
4
3
  :subtitle="$props.subtitle"
4
+ :title="$props.title"
5
5
  :width="$props.width"
6
6
  :modelValue="$props.modelValue"
7
7
  @update:modelValue="$emit('update:modelValue', $event)"
@@ -16,8 +16,8 @@
16
16
  >
17
17
  <FSForm
18
18
  v-for="(step, index) in $props.steps"
19
- :key="index"
20
19
  :variant="$props.variant"
20
+ :key="index"
21
21
  @submit="onSubmit"
22
22
  v-model="valid"
23
23
  >
@@ -44,22 +44,22 @@
44
44
  :wrap="false"
45
45
  >
46
46
  <FSButton
47
- :prependIcon="$props.leftButtonPrependIcon"
47
+ :prependIcon="$props.cancelButtonPrependIcon"
48
+ :appendIcon="$props.cancelButtonAppendIcon"
49
+ :variant="$props.cancelButtonVariant"
50
+ :color="$props.cancelButtonColor"
48
51
  :label="previousButtonLabel"
49
- :appendIcon="$props.leftButtonAppendIcon"
50
- :variant="$props.leftButtonVariant"
51
- :color="$props.leftButtonColor"
52
52
  @click="onPrevious()"
53
53
  />
54
54
  <FSButton
55
55
  type="submit"
56
- :prependIcon="$props.rightButtonPrependIcon"
57
- :label="nextButtonLabel"
58
- :appendIcon="$props.rightButtonAppendIcon"
56
+ :prependIcon="$props.submitButtonPrependIcon"
57
+ :appendIcon="$props.submitButtonAppendIcon"
58
+ :color="$props.submitButtonColor"
59
59
  :variant="nextButtonVariant"
60
- :color="$props.rightButtonColor"
61
- :load="$props.load"
62
60
  :editable="$props.editable"
61
+ :label="nextButtonLabel"
62
+ :load="$props.load"
63
63
  />
64
64
  </FSRow>
65
65
  </FSRow>
@@ -122,52 +122,52 @@ export default defineComponent({
122
122
  type: Number,
123
123
  required: true
124
124
  },
125
- leftButtonPrependIcon: {
125
+ cancelButtonPrependIcon: {
126
126
  type: String as PropType<string | null>,
127
127
  required: false,
128
128
  default: null
129
129
  },
130
- leftButtonLabel: {
130
+ cancelButtonLabel: {
131
131
  type: String as PropType<string | null>,
132
132
  required: false,
133
133
  default: null
134
134
  },
135
- leftButtonAppendIcon: {
135
+ cancelButtonAppendIcon: {
136
136
  type: String as PropType<string | null>,
137
137
  required: false,
138
138
  default: null
139
139
  },
140
- leftButtonVariant: {
140
+ cancelButtonVariant: {
141
141
  type: String as PropType<"standard" | "full" | "icon">,
142
142
  required: false,
143
143
  default: "standard"
144
144
  },
145
- rightButtonPrependIcon: {
145
+ cancelButtonColor: {
146
+ type: String as PropType<ColorBase>,
147
+ required: false,
148
+ default: ColorEnum.Light
149
+ },
150
+ submitButtonPrependIcon: {
146
151
  type: String as PropType<string | null>,
147
152
  required: false,
148
153
  default: null
149
154
  },
150
- rightButtonLabel: {
155
+ submitButtonLabel: {
151
156
  type: String as PropType<string | null>,
152
157
  required: false,
153
158
  default: null
154
159
  },
155
- rightButtonAppendIcon: {
160
+ submitButtonAppendIcon: {
156
161
  type: String as PropType<string | null>,
157
162
  required: false,
158
163
  default: null
159
164
  },
160
- rightButtonVariant: {
165
+ submitButtonVariant: {
161
166
  type: String as PropType<"standard" | "full" | "icon">,
162
167
  required: false,
163
168
  default: "full"
164
169
  },
165
- leftButtonColor: {
166
- type: String as PropType<ColorBase>,
167
- required: false,
168
- default: ColorEnum.Light
169
- },
170
- rightButtonColor: {
170
+ submitButtonColor: {
171
171
  type: String as PropType<ColorBase>,
172
172
  required: false,
173
173
  default: ColorEnum.Primary
@@ -183,7 +183,7 @@ export default defineComponent({
183
183
  default: true
184
184
  }
185
185
  },
186
- emits: ["update:modelValue", "click:rightButton"],
186
+ emits: ["update:modelValue", "click:submitButton"],
187
187
  setup(props, { emit }) {
188
188
  const { isMobileSized } = useBreakpoints();
189
189
  const { $tr } = useTranslationsProvider();
@@ -193,36 +193,35 @@ export default defineComponent({
193
193
  const valids = ref(Array.from({ length: props.steps }, () => false));
194
194
 
195
195
  const height = computed(() => {
196
- const other = 24 + 24 // Paddings
197
- + (props.title ? isMobileSized.value ? 24 : 32 : 0) // Title
198
- + (props.subtitle ? isMobileSized.value ? 14 + 8 : 16 + 8 : 0) // Subtitle
199
- + (isMobileSized.value ? 36 : 40) // Footer
200
- + 64; // Debug mask
201
- return `calc(90vh - ${other}px)`;
196
+ const other = 24 + 24 // Paddings
197
+ + (isMobileSized.value ? 24 : 32) + 24 // Title
198
+ + (props.subtitle ? (isMobileSized.value ? 14 : 16) + 8 : 0) // Subtitle
199
+ + (isMobileSized.value ? 36 : 40) + 24; // Footer
200
+ return `calc(100vh - 40px - ${other}px)`;
202
201
  });
203
202
 
204
203
  const previousButtonLabel = computed(() => {
205
204
  return currentStep.value == 1
206
- ? props.leftButtonLabel ?? $tr("ui.button.cancel", "Cancel")
205
+ ? props.cancelButtonLabel ?? $tr("ui.button.cancel", "Cancel")
207
206
  : $tr("ui.button.back", "Back");
208
207
  });
209
208
 
210
209
  const nextButtonLabel = computed(() => {
211
210
  return currentStep.value == props.steps
212
- ? props.rightButtonLabel ?? $tr("ui.button.validate", "Validate")
211
+ ? props.submitButtonLabel ?? $tr("ui.button.validate", "Validate")
213
212
  : $tr("ui.button.next", "Next");
214
213
  });
215
214
 
216
215
  const nextButtonVariant = computed(() => {
217
216
  return currentStep.value == props.steps
218
- ? props.rightButtonVariant ?? "full"
219
- : "standard";
217
+ ? props.submitButtonVariant ?? "full" : "standard";
220
218
  });
221
219
 
222
220
  const onPrevious = () => {
223
221
  if (currentStep.value > 1) {
224
222
  currentStep.value--;
225
- } else {
223
+ }
224
+ else {
226
225
  emit("update:modelValue", false);
227
226
  }
228
227
  };
@@ -231,7 +230,7 @@ export default defineComponent({
231
230
  if (valid.value) {
232
231
  switch (currentStep.value) {
233
232
  case props.steps:
234
- emit("click:rightButton");
233
+ emit("click:submitButton");
235
234
  break;
236
235
  default:
237
236
  currentStep.value++;
@@ -249,8 +248,8 @@ export default defineComponent({
249
248
  height,
250
249
  valids,
251
250
  valid,
252
- onSubmit,
253
- onPrevious
251
+ onPrevious,
252
+ onSubmit
254
253
  };
255
254
  }
256
255
  });
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <FSDialogSubmit
3
3
  :title="title"
4
- :rightButtonLabel="$tr('ui.button.remove', 'Remove')"
5
- :rightButtonColor="ColorEnum.Error"
4
+ :submitButtonLabel="$tr('ui.button.remove', 'Remove')"
5
+ :submitButtonColor="ColorEnum.Error"
6
6
  :modelValue="$props.modelValue"
7
7
  @update:modelValue="$emit('update:modelValue', $event)"
8
8
  v-bind="$attrs"