@dative-gpi/foundation-shared-components 0.0.50 → 0.0.52

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 (84) hide show
  1. package/components/FSAccordion.vue +3 -3
  2. package/components/FSAccordionPanel.vue +5 -5
  3. package/components/FSBadge.vue +1 -1
  4. package/components/FSBreadcrumbs.vue +1 -1
  5. package/components/FSButton.vue +5 -5
  6. package/components/FSCalendar.vue +19 -9
  7. package/components/FSCalendarTwin.vue +13 -9
  8. package/components/FSCard.vue +11 -2
  9. package/components/FSCarousel.vue +1 -1
  10. package/components/FSCheckbox.vue +4 -4
  11. package/components/FSChip.vue +4 -4
  12. package/components/FSClickable.vue +1 -1
  13. package/components/FSClock.vue +38 -46
  14. package/components/FSCol.vue +1 -1
  15. package/components/FSColor.vue +9 -7
  16. package/components/FSColorIcon.vue +1 -1
  17. package/components/FSDivider.vue +2 -2
  18. package/components/FSEditImage.vue +13 -11
  19. package/components/FSErrorToast.vue +1 -1
  20. package/components/FSFadeOut.vue +1 -1
  21. package/components/FSForm.vue +4 -4
  22. package/components/FSGrid.vue +1 -1
  23. package/components/FSImage.vue +13 -14
  24. package/components/FSLabel.vue +2 -2
  25. package/components/FSLink.vue +2 -2
  26. package/components/FSLoader.vue +1 -1
  27. package/components/FSOptionGroup.vue +3 -3
  28. package/components/FSOptionItem.vue +4 -4
  29. package/components/FSPagination.vue +1 -1
  30. package/components/FSRadio.vue +4 -4
  31. package/components/FSRadioGroup.vue +3 -3
  32. package/components/FSRow.vue +1 -1
  33. package/components/FSSlideGroup.vue +11 -11
  34. package/components/FSSlider.vue +4 -4
  35. package/components/FSSpan.vue +2 -2
  36. package/components/FSSubmitDialog.vue +8 -8
  37. package/components/FSSwitch.vue +4 -4
  38. package/components/FSTab.vue +4 -4
  39. package/components/FSTabs.vue +2 -2
  40. package/components/FSTag.vue +2 -2
  41. package/components/FSText.vue +2 -2
  42. package/components/FSToggleSet.vue +4 -4
  43. package/components/FSWindow.vue +1 -1
  44. package/components/FSWrapGroup.vue +2 -2
  45. package/components/buttons/FSButtonFile.vue +18 -12
  46. package/components/buttons/FSButtonFileIcon.vue +18 -12
  47. package/components/buttons/FSButtonFileLabel.vue +19 -13
  48. package/components/buttons/FSButtonFileMini.vue +19 -13
  49. package/components/deviceOrganisations/FSStatusesCarousel.vue +2 -3
  50. package/components/deviceOrganisations/FSStatusesRow.vue +2 -3
  51. package/components/fields/FSAutocompleteField.vue +5 -5
  52. package/components/fields/FSColorField.vue +3 -3
  53. package/components/fields/FSDateField.vue +8 -7
  54. package/components/fields/FSDateRangeField.vue +6 -6
  55. package/components/fields/FSDateTimeField.vue +14 -12
  56. package/components/fields/FSDateTimeRangeField.vue +10 -12
  57. package/components/fields/FSIconField.vue +10 -10
  58. package/components/fields/FSNumberField.vue +2 -2
  59. package/components/fields/FSPasswordField.vue +4 -4
  60. package/components/fields/FSRichTextField.vue +82 -92
  61. package/components/fields/FSSearchField.vue +8 -8
  62. package/components/fields/FSSelectField.vue +6 -6
  63. package/components/fields/FSTagField.vue +4 -4
  64. package/components/fields/FSTextArea.vue +5 -5
  65. package/components/fields/FSTextField.vue +5 -5
  66. package/components/fields/FSTimeField.vue +15 -9
  67. package/components/fields/FSTimeSlotField.vue +49 -21
  68. package/components/lists/FSDataTableUI.vue +1 -1
  69. package/components/lists/FSDraggable.vue +12 -6
  70. package/components/lists/FSFilterButton.vue +11 -8
  71. package/components/lists/FSLoadDataTable.vue +1 -1
  72. package/components/selects/FSSelectTimeZone.vue +2 -2
  73. package/components/tiles/FSDeviceOrganisationTileUI.vue +3 -3
  74. package/components/tiles/FSGroupTileUI.vue +3 -3
  75. package/components/tiles/FSLoadTile.vue +1 -1
  76. package/components/tiles/FSTile.vue +1 -1
  77. package/composables/index.ts +0 -1
  78. package/composables/useRules.ts +1 -1
  79. package/models/colors.ts +1 -1
  80. package/models/deviceStatuses.ts +1 -1
  81. package/package.json +4 -4
  82. package/styles/components/fs_clock.scss +3 -2
  83. package/styles/globals/overrides.scss +1 -1
  84. package/composables/useFiles.ts +0 -13
@@ -56,7 +56,6 @@
56
56
  class="fs-time-slot-field-number"
57
57
  :editable="$props.editable"
58
58
  :color="ColorEnum.Light"
59
- :reminder="false"
60
59
  :slider="false"
61
60
  :style="style"
62
61
  :modelValue="$props.modelValue[0][1]"
@@ -80,7 +79,6 @@
80
79
  class="fs-time-slot-field-number"
81
80
  :editable="$props.editable"
82
81
  :color="ColorEnum.Light"
83
- :reminder="false"
84
82
  :slider="false"
85
83
  :style="style"
86
84
  :modelValue="$props.modelValue[1][1]"
@@ -125,17 +123,17 @@ export default defineComponent({
125
123
  },
126
124
  props: {
127
125
  label: {
128
- type: String,
126
+ type: String as PropType<string | null>,
129
127
  required: false,
130
128
  default: null
131
129
  },
132
130
  description: {
133
- type: String,
131
+ type: String as PropType<string | null>,
134
132
  required: false,
135
133
  default: null
136
134
  },
137
135
  modelValue: {
138
- type: Array as PropType<number[][]>,
136
+ type: Array as PropType<number[][] | null>,
139
137
  required: true,
140
138
  default: null
141
139
  },
@@ -150,7 +148,7 @@ export default defineComponent({
150
148
  default: false
151
149
  },
152
150
  rules: {
153
- type: Array as PropType<Function[]>,
151
+ type: Array as PropType<any[]>,
154
152
  required: false,
155
153
  default: () => []
156
154
  },
@@ -179,16 +177,16 @@ export default defineComponent({
179
177
  const darks = getColors(ColorEnum.Dark);
180
178
 
181
179
  const daysObject: { id: number; label: string }[] = Object.keys(Days).reduce((acc, key) => {
182
- if(isNaN(Number(key))){
180
+ if (isNaN(Number(key))) {
183
181
  acc.push({
184
182
  id: Days[key],
185
183
  label: key
186
184
  });
187
185
  }
188
186
  return acc;
189
- }, []);
187
+ }, [] as { id: number, label: string }[]);
190
188
 
191
- const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
189
+ const style = computed((): { [key: string] : string | undefined } => {
192
190
  if (!props.editable) {
193
191
  return {
194
192
  "--fs-time-slot-field-cursor" : "default",
@@ -208,45 +206,75 @@ export default defineComponent({
208
206
  });
209
207
 
210
208
  const dayStart = computed((): number => {
211
- return props.modelValue[1][0] === 7 ? 7 : props.modelValue[0][0];
209
+ if (props.modelValue) {
210
+ return props.modelValue[1][0] === 7 ? 7 : props.modelValue[0][0];
211
+ }
212
+ return 0;
212
213
  });
213
214
 
214
215
  const dayEnd = computed((): number => {
215
- return props.modelValue[0][0] === 7 ? 7 : props.modelValue[1][0];
216
+ if (props.modelValue) {
217
+ return props.modelValue[0][0] === 7 ? 7 : props.modelValue[1][0];
218
+ }
219
+ return 0;
216
220
  });
217
221
 
218
222
  const messages = computed((): string[] => props.messages ?? getMessages(props.modelValue, props.rules));
219
223
 
220
224
  const onChangeDayStart = (value: number) => {
221
225
  if (value === 7) {
222
- emit("update:modelValue", [[7, props.modelValue[0][1]], [7, props.modelValue[1][1]]]);
226
+ if (props.modelValue) {
227
+ emit("update:modelValue", [[7, props.modelValue[0][1]], [7, props.modelValue[1][1]]]);
228
+ return;
229
+ }
230
+ emit("update:modelValue", [[7, 0], [7, 0]]);
223
231
  return;
224
232
  }
225
- if (props.modelValue[1][0] === 7) {
226
- emit("update:modelValue", [[value, props.modelValue[0][1]], [value, props.modelValue[1][1]]]);
233
+ if (props.modelValue) {
234
+ if (props.modelValue[1][0] === 7) {
235
+ emit("update:modelValue", [[value, props.modelValue[0][1]], [value, props.modelValue[1][1]]]);
236
+ return;
237
+ }
238
+ emit("update:modelValue", [[value, props.modelValue[0][1]], props.modelValue[1]]);
227
239
  return;
228
240
  }
229
- emit("update:modelValue", [[value, props.modelValue[0][1]], props.modelValue[1]]);
241
+ emit("update:modelValue", [[value, 0], [value, 0]]);
230
242
  };
231
243
 
232
244
  const onChangeHourStart = (value: number) => {
233
- emit("update:modelValue", [[props.modelValue[0][0], value], props.modelValue[1]]);
245
+ if (props.modelValue) {
246
+ emit("update:modelValue", [[props.modelValue[0][0], value], props.modelValue[1]]);
247
+ return;
248
+ }
249
+ emit("update:modelValue", [[0, value], [0, 0]]);
234
250
  };
235
251
 
236
252
  const onChangeDayEnd = (value: number) => {
237
253
  if (value === 7) {
238
- emit("update:modelValue", [[7, props.modelValue[0][1]], [7, props.modelValue[1][1]]]);
254
+ if (props.modelValue) {
255
+ emit("update:modelValue", [[7, props.modelValue[0][1]], [7, props.modelValue[1][1]]]);
256
+ return;
257
+ }
258
+ emit("update:modelValue", [[7, 0], [7, 0]]);
239
259
  return;
240
260
  }
241
- if (props.modelValue[0][0] === 7) {
242
- emit("update:modelValue", [[value, props.modelValue[0][1]], [value, props.modelValue[1][1]]]);
261
+ if (props.modelValue) {
262
+ if (props.modelValue[0][0] === 7) {
263
+ emit("update:modelValue", [[value, props.modelValue[0][1]], [value, props.modelValue[1][1]]]);
264
+ return;
265
+ }
266
+ emit("update:modelValue", [props.modelValue[0], [value, props.modelValue[1][1]]]);
243
267
  return;
244
268
  }
245
- emit("update:modelValue", [props.modelValue[0], [value, props.modelValue[1][1]]]);
269
+ emit("update:modelValue", [[value, 0], [value, 0]]);
246
270
  };
247
271
 
248
272
  const onChangeHourEnd = (value: number) => {
249
- emit("update:modelValue", [props.modelValue[0], [props.modelValue[1][0], value]]);
273
+ if (props.modelValue) {
274
+ emit("update:modelValue", [props.modelValue[0], [props.modelValue[1][0], value]]);
275
+ return;
276
+ }
277
+ emit("update:modelValue", [[0, 0], [0, value]]);
250
278
  };
251
279
 
252
280
  return {
@@ -743,7 +743,7 @@ export default defineComponent({
743
743
  return slots;
744
744
  });
745
745
 
746
- const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
746
+ const style = computed((): { [key: string] : string | undefined } => {
747
747
  return {
748
748
  "--fs-data-table-background-color": backgrounds.base,
749
749
  "--fs-data-table-border-color": lights.base
@@ -80,9 +80,11 @@ export default defineComponent({
80
80
  touchEndX.value = touch.clientX;
81
81
  touchEndY.value = touch.clientY;
82
82
 
83
- draggedElementCopy.value.style.left = `${touchEndX.value - 25}px`;
84
- draggedElementCopy.value.style.top = `${touchEndY.value - 25}px`;
85
- document.body.appendChild(draggedElementCopy.value);
83
+ if (draggedElementCopy.value) {
84
+ draggedElementCopy.value.style.left = `${touchEndX.value - 25}px`;
85
+ draggedElementCopy.value.style.top = `${touchEndY.value - 25}px`;
86
+ document.body.appendChild(draggedElementCopy.value);
87
+ }
86
88
  const dragOverTarget = document.elementFromPoint(touchEndX.value, touchEndY.value)?.closest(props.elementSelector);
87
89
 
88
90
  if (dragOverTarget) {
@@ -116,8 +118,10 @@ export default defineComponent({
116
118
  }
117
119
  event.preventDefault();
118
120
  const dragged = (event.target as HTMLElement)?.closest(props.elementSelector);
119
- draggedElementCopy.value.remove();
120
- draggedElementCopy.value = null;
121
+ if (draggedElementCopy.value) {
122
+ draggedElementCopy.value.remove();
123
+ draggedElementCopy.value = null;
124
+ }
121
125
 
122
126
  const dropTarget = document.elementFromPoint(touchEndX.value, touchEndY.value);
123
127
  const dragEndEvent = new Event("dragend");
@@ -137,7 +141,9 @@ export default defineComponent({
137
141
  touchStartY.value = 0;
138
142
  touchEndX.value = 0;
139
143
  touchEndY.value = 0;
140
- dragged.classList.remove("fs-draggable-dragging");
144
+ if (dragged) {
145
+ dragged.classList.remove("fs-draggable-dragging");
146
+ }
141
147
  };
142
148
 
143
149
  const onDragStart = (event: DragEvent) => {
@@ -113,21 +113,24 @@ export default defineComponent({
113
113
 
114
114
  const singlePick = ref(false);
115
115
  const expanded = ref(false);
116
- const search = ref(null);
116
+ const search = ref<string | null>(null);
117
117
 
118
- const label = computed(() => {
119
- if (props.filters) {
120
- const hidden = props.filters.filter(f => f.hidden).length;
121
- if (hidden > 0) {
122
- return $tr("ui.data-table.some-filters-visible", "{0}: {1} visible", props.header.text, (props.filters.length - hidden).toString());
118
+ const label = computed((): string | null => {
119
+ if (props.header.text) {
120
+ if (props.filters) {
121
+ const hidden = props.filters.filter(f => f.hidden).length;
122
+ if (hidden > 0) {
123
+ return $tr("ui.data-table.some-filters-visible", "{0}: {1} visible", props.header.text, (props.filters.length - hidden).toString());
124
+ }
123
125
  }
126
+ return $tr("ui.data-table.all-filters-visible", "{0}: All visible", props.header.text);
124
127
  }
125
- return $tr("ui.data-table.all-filters-visible", "{0}: All visible", props.header.text);
128
+ return null;
126
129
  });
127
130
 
128
131
  const searchedFilters = computed((): FSDataTableFilter[] => {
129
132
  if (search.value) {
130
- return props.filters.filter(f => (f.text + f.value).includes(search.value));
133
+ return props.filters.filter(f => (f.text + f.value).includes(search.value!));
131
134
  }
132
135
  return props.filters;
133
136
  });
@@ -81,7 +81,7 @@ export default defineComponent({
81
81
 
82
82
  const backgroundColors = getColors(ColorEnum.Background);
83
83
 
84
- const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
84
+ const style = computed((): { [key: string] : string | undefined } => {
85
85
  return {
86
86
  "--fs-load-data-table-background-color": backgroundColors.base
87
87
  };
@@ -16,7 +16,7 @@
16
16
  </template>
17
17
 
18
18
  <script lang="ts">
19
- import { computed, defineComponent, onMounted } from "vue";
19
+ import { computed, defineComponent, onMounted, PropType } from "vue";
20
20
 
21
21
  import { useTimeZones } from "@dative-gpi/foundation-shared-services/composables";
22
22
  import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
@@ -32,7 +32,7 @@ export default defineComponent({
32
32
  },
33
33
  props: {
34
34
  modelValue: {
35
- type: String,
35
+ type: String as PropType<string | null>,
36
36
  required: false,
37
37
  default: null
38
38
  },
@@ -103,17 +103,17 @@ export default defineComponent({
103
103
  },
104
104
  props: {
105
105
  imageId: {
106
- type: String,
106
+ type: String as PropType<string | null>,
107
107
  required: false,
108
108
  default: null
109
109
  },
110
110
  label: {
111
- type: String,
111
+ type: String as PropType<string | null>,
112
112
  required: false,
113
113
  default: null
114
114
  },
115
115
  code: {
116
- type: String,
116
+ type: String as PropType<string | null>,
117
117
  required: false,
118
118
  default: null
119
119
  },
@@ -125,17 +125,17 @@ export default defineComponent({
125
125
  },
126
126
  props: {
127
127
  imageId: {
128
- type: String,
128
+ type: String as PropType<string | null>,
129
129
  required: false,
130
130
  default: null
131
131
  },
132
132
  label: {
133
- type: String,
133
+ type: String as PropType<string | null>,
134
134
  required: false,
135
135
  default: null
136
136
  },
137
137
  code: {
138
- type: String,
138
+ type: String as PropType<string | null>,
139
139
  required: false,
140
140
  default: null
141
141
  },
@@ -108,7 +108,7 @@ export default defineComponent({
108
108
  }
109
109
  });
110
110
 
111
- const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
111
+ const style = computed((): { [key: string] : string | undefined } => {
112
112
  return {
113
113
  "--fs-load-tile-background-color": backgroundColors.base
114
114
  };
@@ -64,7 +64,7 @@ export default defineComponent({
64
64
 
65
65
  const bottomColors = computed(() => getGradients(props.bottomColor));
66
66
 
67
- const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
67
+ const style = computed((): { [key: string] : string | undefined } => {
68
68
  return {
69
69
  "--fs-tile-border-color": bottomColors.value.base
70
70
  };
@@ -1,6 +1,5 @@
1
1
  export * from "./useBreakpoints";
2
2
  export * from "./useColors";
3
3
  export * from "./useDebounce";
4
- export * from "./useFiles";
5
4
  export * from "./useRules";
6
5
  export * from "./useSlots";
@@ -6,7 +6,7 @@ export const useRules = () => {
6
6
 
7
7
  const blurred = ref(false);
8
8
 
9
- const validateOn = computed((): string => {
9
+ const validateOn = computed((): "input" | "submit" | "blur" => {
10
10
  switch (innerValidateOn.value) {
11
11
  case "submit": return submitted.value ? "input" : "submit";
12
12
  case "blur": return blurred.value ? "input" : "blur";
package/models/colors.ts CHANGED
@@ -19,4 +19,4 @@ export interface ColorVariations {
19
19
  darkContrast?: string;
20
20
  };
21
21
 
22
- export type ColorBase = (String | ColorEnum);
22
+ export type ColorBase = (string | ColorEnum);
@@ -6,7 +6,7 @@ export interface FSDeviceStatus {
6
6
  export interface FSDeviceStatusGroup {
7
7
  label: string;
8
8
  groupByValue?: string;
9
- value: string;
9
+ value?: string;
10
10
  unit?: string;
11
11
  icon: string;
12
12
  color: string;
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.50",
4
+ "version": "0.0.52",
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.50",
14
- "@dative-gpi/foundation-shared-services": "0.0.50",
13
+ "@dative-gpi/foundation-shared-domain": "0.0.52",
14
+ "@dative-gpi/foundation-shared-services": "0.0.52",
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": "be18a14ae47c91c1f3ccd22a196593050f06aae8"
35
+ "gitHead": "1cea46f60262aceae3135923684ed4a5af60d0bb"
36
36
  }
@@ -4,10 +4,10 @@
4
4
 
5
5
  .fs-clock-field {
6
6
  padding: 0px !important;
7
- width: 72px !important;
8
7
 
9
8
  &.v-input {
10
- flex: 0 0 auto !important;
9
+ min-width: 76px !important;
10
+ max-width: 76px !important;
11
11
  }
12
12
 
13
13
  & > .v-input__control > .v-field {
@@ -15,6 +15,7 @@
15
15
  border: 1px solid var(--fs-clock-field-border-color) !important;
16
16
  border-radius: 4px !important;
17
17
  padding: 0 16px !important;
18
+ gap: 0 !important;
18
19
 
19
20
  &:not(.v-field--error):focus-within {
20
21
  border-color: var(--fs-clock-field-active-border-color) !important;
@@ -30,7 +30,7 @@
30
30
  .v-input {
31
31
  padding: 0px !important;
32
32
 
33
- &:not(.v-checkbox) {
33
+ &:not(.v-checkbox):not(.v-slider) {
34
34
  min-width: 200px;
35
35
  width: 100%;
36
36
  }
@@ -1,13 +0,0 @@
1
- export const useFiles = () => {
2
- const read = (file: File, callback: Function): void => {
3
- const reader = new FileReader();
4
- reader.addEventListener("load", (fileEv) => {
5
- callback(fileEv.target && fileEv.target.result);
6
- });
7
- reader.readAsDataURL(file);
8
- };
9
-
10
- return {
11
- read
12
- };
13
- }