@dative-gpi/foundation-shared-components 0.0.8 → 0.0.9

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 (139) hide show
  1. package/{models/FSButtons.ts → aliases/FSButton.ts} +24 -21
  2. package/aliases/index.ts +1 -0
  3. package/components/FSAutocompleteField.vue +207 -0
  4. package/components/FSBadge.vue +38 -0
  5. package/components/FSBreadcrumbs.vue +49 -55
  6. package/components/FSButton.vue +116 -101
  7. package/components/FSCalendar.vue +52 -39
  8. package/components/FSCalendarTwin.vue +120 -102
  9. package/components/FSCard.vue +35 -21
  10. package/components/FSCarousel.vue +63 -0
  11. package/components/FSCheckbox.vue +111 -103
  12. package/components/FSChip.vue +140 -0
  13. package/components/FSClock.vue +149 -15
  14. package/components/FSCol.vue +104 -98
  15. package/components/FSColor.vue +61 -64
  16. package/components/FSColorIcon.vue +67 -0
  17. package/components/FSContainer.vue +64 -0
  18. package/components/FSDateField.vue +211 -0
  19. package/components/FSDateRangeField.vue +225 -0
  20. package/components/FSDateTimeField.vue +257 -0
  21. package/components/FSDateTimeRangeField.vue +286 -0
  22. package/components/FSDialog.vue +103 -0
  23. package/components/FSDivider.vue +39 -0
  24. package/components/FSFadeOut.vue +49 -59
  25. package/components/FSFileButton.vue +245 -0
  26. package/components/FSHeaderButton.vue +17 -0
  27. package/components/FSIcon.vue +23 -23
  28. package/components/FSIconField.vue +232 -0
  29. package/components/FSImage.vue +142 -0
  30. package/components/FSLoadTile.vue +93 -0
  31. package/components/FSNumberField.vue +51 -53
  32. package/components/FSPasswordField.vue +99 -101
  33. package/components/FSRadio.vue +107 -109
  34. package/components/FSRadioGroup.vue +55 -57
  35. package/components/FSRemoveDialog.vue +123 -0
  36. package/components/FSRichTextField.vue +26 -33
  37. package/components/FSRow.vue +110 -104
  38. package/components/FSSearchField.vue +35 -27
  39. package/components/FSSelectField.vue +188 -0
  40. package/components/FSSlideGroup.vue +45 -49
  41. package/components/FSSlider.vue +31 -33
  42. package/components/FSSpan.vue +53 -37
  43. package/components/FSSubmitDialog.vue +165 -0
  44. package/components/FSSwitch.vue +110 -109
  45. package/components/FSTab.vue +61 -61
  46. package/components/FSTabs.vue +53 -55
  47. package/components/FSTag.vue +88 -84
  48. package/components/FSTagField.vue +32 -36
  49. package/components/FSTagGroup.vue +38 -45
  50. package/components/FSText.vue +74 -64
  51. package/components/FSTextArea.vue +187 -185
  52. package/components/FSTextField.vue +18 -20
  53. package/components/FSTile.vue +90 -0
  54. package/components/FSToggleSet.vue +282 -0
  55. package/components/FSTooltip.vue +21 -0
  56. package/components/FSWindow.vue +26 -16
  57. package/components/FSWrapGroup.vue +44 -47
  58. package/components/deviceOrganisations/FSConnectivity.vue +114 -0
  59. package/components/deviceOrganisations/FSStatus.vue +117 -0
  60. package/components/deviceOrganisations/FSStatusesCarousel.vue +105 -0
  61. package/components/deviceOrganisations/FSStatusesRow.vue +66 -0
  62. package/components/deviceOrganisations/FSWorstAlert.vue +165 -0
  63. package/components/lists/FSDataIteratorGroup.vue +7 -0
  64. package/components/lists/FSDataIteratorItem.vue +103 -0
  65. package/components/lists/FSDataTable.vue +964 -0
  66. package/components/lists/FSFilterButton.vue +176 -0
  67. package/components/lists/FSHeaderButton.vue +99 -0
  68. package/components/lists/FSHiddenButton.vue +79 -0
  69. package/components/tiles/FSDeviceOrganisationTileUI.vue +232 -0
  70. package/components/tiles/FSGroupTileUI.vue +192 -0
  71. package/composables/index.ts +1 -1
  72. package/composables/useBreakpoints.ts +23 -4
  73. package/composables/useColors.ts +53 -23
  74. package/composables/useSlots.ts +43 -0
  75. package/index.ts +6 -0
  76. package/models/breadcrumbs.ts +8 -0
  77. package/models/colors.ts +17 -0
  78. package/models/deviceAlerts.ts +10 -0
  79. package/models/deviceConnectivities.ts +11 -0
  80. package/models/deviceStatuses.ts +16 -0
  81. package/models/dispositions.ts +33 -0
  82. package/models/index.ts +9 -0
  83. package/models/modelStatuses.ts +11 -0
  84. package/models/rules.ts +50 -0
  85. package/models/toggleSets.ts +7 -0
  86. package/package.json +5 -4
  87. package/plugins/colorPlugin.ts +2 -2
  88. package/shims-plugin.d.ts +1 -1
  89. package/styles/components/fs_autocomplete_field.scss +123 -0
  90. package/styles/components/fs_button.scss +4 -6
  91. package/styles/components/fs_calendar.scss +24 -1
  92. package/styles/components/fs_card.scss +2 -5
  93. package/styles/components/fs_carousel.scss +4 -0
  94. package/styles/components/fs_chip.scss +33 -0
  95. package/styles/components/fs_clock.scss +43 -0
  96. package/styles/components/fs_col.scss +2 -0
  97. package/styles/components/fs_color_icon.scss +37 -0
  98. package/styles/components/fs_container.scss +16 -0
  99. package/styles/components/fs_data_iterator_item.scss +19 -0
  100. package/styles/components/fs_data_table.scss +97 -0
  101. package/styles/components/fs_date_field.scss +8 -0
  102. package/styles/components/fs_dialog.scss +30 -0
  103. package/styles/components/fs_divider.scss +5 -0
  104. package/styles/components/fs_fade_out.scss +10 -2
  105. package/styles/components/fs_filter_button.scss +12 -0
  106. package/styles/components/fs_header_button.scss +4 -0
  107. package/styles/components/fs_icon.scss +19 -3
  108. package/styles/components/fs_icon_field.scss +12 -0
  109. package/styles/components/fs_image.scss +7 -0
  110. package/styles/components/fs_load_tile.scss +49 -0
  111. package/styles/components/fs_password_field.scss +2 -2
  112. package/styles/components/fs_row.scss +4 -1
  113. package/styles/components/fs_select_field.scss +71 -0
  114. package/styles/components/fs_slide_group.scss +6 -0
  115. package/styles/components/fs_slider.scss +29 -9
  116. package/styles/components/fs_span.scss +8 -0
  117. package/styles/components/fs_submit_dialog.scss +9 -0
  118. package/styles/components/fs_tabs.scss +4 -0
  119. package/styles/components/fs_tag_field.scss +0 -11
  120. package/styles/components/fs_text_field.scss +23 -15
  121. package/styles/components/fs_tile.scss +33 -0
  122. package/styles/components/fs_tooltip.scss +5 -0
  123. package/styles/components/fs_wrap_group.scss +7 -8
  124. package/styles/components/index.scss +21 -1
  125. package/styles/globals/breakpoints.scss +7 -0
  126. package/styles/globals/overrides.scss +20 -7
  127. package/styles/globals/text_fonts.scss +8 -8
  128. package/themes/default.ts +1 -11
  129. package/utils/css.ts +11 -0
  130. package/utils/icons.ts +75416 -0
  131. package/utils/index.ts +5 -1
  132. package/utils/levenshtein.ts +97 -0
  133. package/utils/sort.ts +9 -0
  134. package/components/FSDatePicker.vue +0 -226
  135. package/composables/useDates.ts +0 -39
  136. package/models/FSTags.ts +0 -8
  137. package/models/FSTextFields.ts +0 -23
  138. package/styles/components/fs_date_picker.scss +0 -0
  139. /package/utils/{FSRichTextField.ts → lexical.ts} +0 -0
@@ -9,7 +9,10 @@
9
9
  {{ $props.label }}
10
10
  </FSSpan>
11
11
  </FSRow>
12
- <FSRow>
12
+ <FSRow
13
+ class="fs-calendar-twin"
14
+ :style="style"
15
+ >
13
16
  <FSCol
14
17
  :class="leftClasses"
15
18
  :style="style"
@@ -22,6 +25,7 @@
22
25
  size="l"
23
26
  variant="icon"
24
27
  icon="mdi-chevron-left"
28
+ :color="ColorEnum.Dark"
25
29
  @click="onClickPrevious"
26
30
  />
27
31
  <FSSpan
@@ -41,7 +45,8 @@
41
45
  :month="innerLeftMonth"
42
46
  :year="innerLeftYear"
43
47
  :multiple="true"
44
- :modelValue="datesTools.epochToPicker(innerLeftValue)"
48
+ :allowedDates="allowedDates"
49
+ :modelValue="innerLeftValue.map(epochToPicker)"
45
50
  @update:modelValue="onClickLeft"
46
51
  @update:month="null"
47
52
  @update:year="null"
@@ -67,6 +72,7 @@
67
72
  size="l"
68
73
  variant="icon"
69
74
  icon="mdi-chevron-right"
75
+ :color="ColorEnum.Dark"
70
76
  @click="onClickNext"
71
77
  />
72
78
  </FSRow>
@@ -79,7 +85,8 @@
79
85
  :month="innerRightMonth"
80
86
  :year="innerRightYear"
81
87
  :multiple="true"
82
- :modelValue="datesTools.epochToPicker(innerRightValue)"
88
+ :allowedDates="allowedDates"
89
+ :modelValue="innerRightValue.map(epochToPicker)"
83
90
  @update:modelValue="onClickRight"
84
91
  @update:month="null"
85
92
  @update:year="null"
@@ -91,12 +98,11 @@
91
98
  </template>
92
99
 
93
100
  <script lang="ts">
94
- import { computed, defineComponent, onMounted, PropType, ref, toRefs } from "vue";
95
- import { useDate as useAdapter } from "vuetify/lib/composables/date/index.mjs";
101
+ import { computed, defineComponent, onMounted, PropType, ref } from "vue";
96
102
 
97
- import { useColors, useDates } from "@dative-gpi/foundation-shared-components/composables";
98
- import { useLanguageCode } from "@dative-gpi/foundation-shared-services/composables";
99
- import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
103
+ import { useTimeZone, useLanguageCode } from "@dative-gpi/foundation-shared-services/composables";
104
+ import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
105
+ import { useColors } from "@dative-gpi/foundation-shared-components/composables";
100
106
 
101
107
  import FSButton from "./FSButton.vue";
102
108
  import FSSpan from "./FSSpan.vue";
@@ -118,33 +124,29 @@ export default defineComponent({
118
124
  default: null
119
125
  },
120
126
  modelValue: {
121
- type: Array as PropType<Array<number>>,
127
+ type: Array as PropType<number[]>,
122
128
  required: false,
123
129
  default: null
124
130
  },
125
131
  color: {
126
132
  type: String as PropType<ColorBase>,
127
133
  required: false,
128
- default: ColorBase.Dark
134
+ default: ColorEnum.Dark
129
135
  },
130
- buttonColor: {
131
- type: String as PropType<ColorBase>,
136
+ limit: {
137
+ type: String as PropType<"none" | "past" | "future">,
132
138
  required: false,
133
- default: ColorBase.Primary
139
+ default: "none"
134
140
  }
135
141
  },
136
142
  emits: ["update:modelValue"],
137
143
  setup(props, { emit }) {
138
- const { modelValue, color, buttonColor } = toRefs(props);
139
-
140
- const languageCode = useLanguageCode().languageCode;
141
- const datesTools = useDates();
142
- const adapter = useAdapter();
143
-
144
- const colors = useColors().getColors(color.value);
145
- const buttonColors = useColors().getColors(buttonColor.value);
144
+ const { epochToPicker, epochToPickerHeader, pickerToEpoch, todayToEpoch } = useTimeZone();
145
+ const { languageCode } = useLanguageCode();
146
146
 
147
- const backgrounds = useColors().getColors(ColorBase.Background);
147
+ const colors = computed(() => useColors().getColors(props.color));
148
+ const backgrounds = useColors().getColors(ColorEnum.Background);
149
+ const darks = useColors().getColors(ColorEnum.Dark);
148
150
 
149
151
  const innerLeftMonth = ref(new Date().getMonth());
150
152
  const innerLeftYear = ref(new Date().getFullYear());
@@ -152,34 +154,32 @@ export default defineComponent({
152
154
  const innerRightMonth = ref(new Date().getMonth());
153
155
  const innerRightYear = ref(new Date().getFullYear());
154
156
 
155
- const toggle = ref(modelValue.value.length % 2);
157
+ const toggle = ref((props.modelValue?.length ?? 0) % 2);
156
158
 
157
159
  onMounted((): void => {
158
- switch (modelValue.value.length) {
159
- case 0:
160
- innerLeftMonth.value = new Date().getMonth();
161
- innerLeftYear.value = new Date().getFullYear();
162
- if (innerLeftMonth.value < 11) {
163
- innerRightMonth.value = innerLeftMonth.value + 1;
164
- innerRightYear.value = innerLeftYear.value;
165
- }
166
- else {
167
- innerRightMonth.value = 0;
168
- innerRightYear.value = innerLeftYear.value + 1;
169
- }
170
- break;
171
- default:
172
- innerLeftMonth.value = datesTools.epochToPickerHeader(modelValue.value[0]).m;
173
- innerLeftYear.value = datesTools.epochToPickerHeader(modelValue.value[0]).y;
174
- if (innerLeftMonth.value < 11) {
175
- innerRightMonth.value = innerLeftMonth.value + 1;
176
- innerRightYear.value = innerLeftYear.value;
177
- }
178
- else {
179
- innerRightMonth.value = 0;
180
- innerRightYear.value = innerLeftYear.value + 1;
181
- }
182
- break;
160
+ if (!props.modelValue || !props.modelValue.length) {
161
+ innerLeftMonth.value = new Date().getMonth();
162
+ innerLeftYear.value = new Date().getFullYear();
163
+ if (innerLeftMonth.value < 11) {
164
+ innerRightMonth.value = innerLeftMonth.value + 1;
165
+ innerRightYear.value = innerLeftYear.value;
166
+ }
167
+ else {
168
+ innerRightMonth.value = 0;
169
+ innerRightYear.value = innerLeftYear.value + 1;
170
+ }
171
+ }
172
+ else {
173
+ innerLeftMonth.value = epochToPickerHeader(props.modelValue[0]).m;
174
+ innerLeftYear.value = epochToPickerHeader(props.modelValue[0]).y;
175
+ if (innerLeftMonth.value < 11) {
176
+ innerRightMonth.value = innerLeftMonth.value + 1;
177
+ innerRightYear.value = innerLeftYear.value;
178
+ }
179
+ else {
180
+ innerRightMonth.value = 0;
181
+ innerRightYear.value = innerLeftYear.value + 1;
182
+ }
183
183
  }
184
184
  });
185
185
 
@@ -212,89 +212,93 @@ export default defineComponent({
212
212
  const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
213
213
  return {
214
214
  "--fs-calendar-background-color" : backgrounds.base,
215
- "--fs-calendar-hover-background-color" : buttonColors.light,
216
- "--fs-calendar-active-background-color": buttonColors.base,
217
- "--fs-calendar-border-color" : colors.base,
218
- "--fs-calendar-hover-border-color" : buttonColors.base,
219
- "--fs-calendar-active-border-color" : buttonColors.base,
220
- "--fs-calendar-color" : colors.base,
221
- "--fs-calendar-hover-color" : buttonColors.base,
222
- "--fs-calendar-active-color" : buttonColors.light
215
+ "--fs-calendar-hover-background-color" : colors.value.light,
216
+ "--fs-calendar-active-background-color": colors.value.base,
217
+ "--fs-calendar-border-color" : darks.base,
218
+ "--fs-calendar-hover-border-color" : colors.value.base,
219
+ "--fs-calendar-active-border-color" : colors.value.base,
220
+ "--fs-calendar-color" : darks.base,
221
+ "--fs-calendar-hover-color" : colors.value.base,
222
+ "--fs-calendar-active-color" : colors.value.light
223
223
  };
224
224
  });
225
225
 
226
226
  const innerLeftValue = computed((): number[] => {
227
- return modelValue.value.filter(value =>
228
- compare("during", "left", datesTools.epochToPickerHeader(value)) || compare("before", "left", datesTools.epochToPickerHeader(value))
227
+ if (!props.modelValue || !props.modelValue.length) {
228
+ return [];
229
+ }
230
+ return props.modelValue.filter(value =>
231
+ compare("during", "left", epochToPickerHeader(value)) || compare("before", "left", epochToPickerHeader(value))
229
232
  );
230
233
  });
231
234
 
232
235
  const innerRightValue = computed((): number[] => {
233
- return modelValue.value.filter(value =>
234
- compare("during", "right", datesTools.epochToPickerHeader(value)) || compare("after", "right", datesTools.epochToPickerHeader(value))
236
+ if (!props.modelValue || !props.modelValue.length) {
237
+ return [];
238
+ }
239
+ return props.modelValue.filter(value =>
240
+ compare("during", "right", epochToPickerHeader(value)) || compare("after", "right", epochToPickerHeader(value))
235
241
  );
236
242
  });
237
243
 
238
244
  const leftText = computed(() => {
239
- adapter.locale = languageCode;
240
- return adapter.format(
241
- adapter.setYear(adapter.setMonth(adapter.date(), innerLeftMonth.value), innerLeftYear.value),
242
- 'monthAndYear',
243
- );
245
+ const date = new Date(0);
246
+ date.setMonth(innerLeftMonth.value);
247
+ date.setFullYear(innerLeftYear.value);
248
+ return new Intl.DateTimeFormat(languageCode.value, { month: "long", year: "numeric" }).format(date);
244
249
  });
245
250
 
246
251
  const rightText = computed(() => {
247
- adapter.locale = languageCode;
248
- return adapter.format(
249
- adapter.setYear(adapter.setMonth(adapter.date(), innerRightMonth.value), innerRightYear.value),
250
- 'monthAndYear',
251
- );
252
+ const date = new Date(0);
253
+ date.setMonth(innerRightMonth.value);
254
+ date.setFullYear(innerRightYear.value);
255
+ return new Intl.DateTimeFormat(languageCode.value, { month: "long", year: "numeric" }).format(date);
252
256
  });
253
257
 
254
258
  const leftClasses = computed((): string[] => {
255
- const classes = ["fs-calendar", "fs-calendar-left"];
256
- if (modelValue.value.length > 1) {
257
- const first = datesTools.epochToPickerHeader(modelValue.value[0]);
258
- const last = datesTools.epochToPickerHeader(modelValue.value[1]);
259
+ const classNames = ["fs-calendar-half", "fs-calendar-left"];
260
+ if (props.modelValue && props.modelValue.length > 1) {
261
+ const first = epochToPickerHeader(props.modelValue[0]);
262
+ const last = epochToPickerHeader(props.modelValue[1]);
259
263
  if (compare("before", "left", first) && compare("after", "left", last)) {
260
- classes.push("fs-calendar-full");
264
+ classNames.push("fs-calendar-full");
261
265
  }
262
266
  else if (compare("during", "left", first) && compare("during", "left", last)) {
263
267
  if (first.d !== last.d) {
264
- classes.push("fs-calendar-part");
268
+ classNames.push("fs-calendar-part");
265
269
  }
266
270
  }
267
271
  else if (compare("during", "left", first)) {
268
- classes.push("fs-calendar-start");
272
+ classNames.push("fs-calendar-start");
269
273
  }
270
274
  else if (compare("during", "left", last)) {
271
- classes.push("fs-calendar-end");
275
+ classNames.push("fs-calendar-end");
272
276
  }
273
277
  }
274
- return classes;
278
+ return classNames;
275
279
  });
276
280
 
277
281
  const rightClasses = computed((): string[] => {
278
- const classes = ["fs-calendar", "fs-calendar-right"];
279
- if (modelValue.value.length > 1) {
280
- const first = datesTools.epochToPickerHeader(modelValue.value[0]);
281
- const last = datesTools.epochToPickerHeader(modelValue.value[1]);
282
+ const classNames = ["fs-calendar-half", "fs-calendar-right"];
283
+ if (props.modelValue && props.modelValue.length > 1) {
284
+ const first = epochToPickerHeader(props.modelValue[0]);
285
+ const last = epochToPickerHeader(props.modelValue[1]);
282
286
  if (compare("before", "right", first) && compare("after", "right", last)) {
283
- classes.push("fs-calendar-full");
287
+ classNames.push("fs-calendar-full");
284
288
  }
285
289
  else if (compare("during", "right", first) && compare("during", "right", last)) {
286
290
  if (first.d !== last.d) {
287
- classes.push("fs-calendar-part");
291
+ classNames.push("fs-calendar-part");
288
292
  }
289
293
  }
290
294
  else if (compare("during", "right", first)) {
291
- classes.push("fs-calendar-start");
295
+ classNames.push("fs-calendar-start");
292
296
  }
293
297
  else if (compare("during", "right", last)) {
294
- classes.push("fs-calendar-end");
298
+ classNames.push("fs-calendar-end");
295
299
  }
296
300
  }
297
- return classes;
301
+ return classNames;
298
302
  });
299
303
 
300
304
  const onClickPrevious = (): void => {
@@ -332,45 +336,58 @@ export default defineComponent({
332
336
  };
333
337
 
334
338
  const onClickLeft = (value: Date[]): void => {
335
- const clicked = datesTools.pickerToEpoch([value[value.length - 1]])[0];
336
- if (modelValue.value.length === 0) {
339
+ const clicked = pickerToEpoch(value[value.length - 1]);
340
+ if (!props.modelValue || !props.modelValue.length) {
337
341
  emit("update:modelValue", [clicked, clicked]);
338
342
  }
339
- else if (modelValue.value.length === 1) {
340
- emit("update:modelValue", [modelValue.value[0], clicked].sort());
343
+ else if (props.modelValue.length === 1) {
344
+ emit("update:modelValue", [props.modelValue[0], clicked].sort());
341
345
  }
342
346
  else {
343
347
  if (innerLeftValue.value.length === 0) {
344
- emit("update:modelValue", [clicked, modelValue.value[1]]);
348
+ emit("update:modelValue", [clicked, props.modelValue[1]]);
345
349
  }
346
350
  else {
347
- emit("update:modelValue", [clicked, modelValue.value[toggle.value]].sort());
351
+ emit("update:modelValue", [clicked, props.modelValue[toggle.value]].sort());
348
352
  toggle.value = (++toggle.value) % 2;
349
353
  }
350
354
  }
351
355
  };
352
356
 
353
357
  const onClickRight = (value: Date[]): void => {
354
- const clicked = datesTools.pickerToEpoch([value[value.length - 1]])[0];
355
- if (modelValue.value.length === 0) {
358
+ const clicked = pickerToEpoch(value[value.length - 1]);
359
+ if (!props.modelValue || !props.modelValue.length) {
356
360
  emit("update:modelValue", [clicked, clicked]);
357
361
  }
358
- else if (modelValue.value.length === 1) {
359
- emit("update:modelValue", [modelValue.value[0], clicked].sort());
362
+ else if (props.modelValue.length === 1) {
363
+ emit("update:modelValue", [props.modelValue[0], clicked].sort());
360
364
  }
361
365
  else {
362
366
  if (innerRightValue.value.length === 0) {
363
- emit("update:modelValue", [modelValue.value[0], clicked]);
367
+ emit("update:modelValue", [props.modelValue[0], clicked]);
364
368
  }
365
369
  else {
366
- emit("update:modelValue", [clicked, modelValue.value[toggle.value]].sort());
370
+ emit("update:modelValue", [clicked, props.modelValue[toggle.value]].sort());
367
371
  toggle.value = (++toggle.value) % 2;
368
372
  }
369
373
  }
370
374
  toggle.value = (++toggle.value) % 2;
371
375
  };
372
376
 
377
+ const allowedDates = (value: Date): boolean => {
378
+ const valueEpoch = pickerToEpoch(value);
379
+ switch (props.limit) {
380
+ case "past":
381
+ return valueEpoch <= todayToEpoch(true);
382
+ case "future":
383
+ return valueEpoch >= todayToEpoch(true);
384
+ default:
385
+ return true;
386
+ }
387
+ };
388
+
373
389
  return {
390
+ ColorEnum,
374
391
  languageCode,
375
392
  style,
376
393
  leftClasses,
@@ -383,11 +400,12 @@ export default defineComponent({
383
400
  innerRightMonth,
384
401
  innerRightYear,
385
402
  innerRightValue,
386
- datesTools,
403
+ epochToPicker,
387
404
  onClickPrevious,
388
405
  onClickNext,
389
406
  onClickLeft,
390
- onClickRight
407
+ onClickRight,
408
+ allowedDates
391
409
  };
392
410
  }
393
411
  });
@@ -1,57 +1,71 @@
1
1
  <template>
2
- <div
2
+ <FSContainer
3
3
  class="fs-card"
4
4
  :style="style"
5
+ v-bind="$attrs"
5
6
  >
6
- <slot name="default">
7
- <FSCol>
8
- <FSRow v-if="$slots.header">
7
+ <slot>
8
+ <FSCol
9
+ :gap="$props.gap"
10
+ >
11
+ <FSRow
12
+ v-if="$slots.header"
13
+ >
9
14
  <slot name="header" />
10
15
  </FSRow>
11
- <FSRow v-if="$slots.body">
16
+ <FSRow
17
+ v-if="$slots.body"
18
+ >
12
19
  <slot name="body" />
13
20
  </FSRow>
14
- <FSRow v-if="$slots.footer">
21
+ <FSRow
22
+ v-if="$slots.footer"
23
+ >
15
24
  <slot name="footer" />
16
25
  </FSRow>
17
26
  </FSCol>
18
27
  </slot>
19
- </div>
28
+ </FSContainer>
20
29
  </template>
21
30
 
22
31
  <script lang="ts">
23
- import { computed, defineComponent, PropType, toRefs } from "vue";
32
+ import { computed, defineComponent } from "vue";
24
33
 
25
- import { useColors } from "@dative-gpi/foundation-shared-components/composables";
26
- import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
34
+ import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
27
35
 
36
+ import FSContainer from "./FSContainer.vue";
28
37
  import FSCol from "./FSCol.vue";
29
38
  import FSRow from "./FSRow.vue";
30
39
 
31
40
  export default defineComponent({
32
41
  name: "FSCard",
33
42
  components: {
43
+ FSContainer,
34
44
  FSCol,
35
45
  FSRow
36
46
  },
37
47
  props: {
38
- color: {
39
- type: String as PropType<ColorBase>,
48
+ width: {
49
+ type: [String, Number],
40
50
  required: false,
41
- default: ColorBase.Dark
51
+ default: null
42
52
  },
53
+ height: {
54
+ type: [String, Number],
55
+ required: false,
56
+ default: null
57
+ },
58
+ gap: {
59
+ type: [String, Number],
60
+ required: false,
61
+ default: 8
62
+ }
43
63
  },
44
64
  setup(props) {
45
- const { color } = toRefs(props);
46
-
47
- const colors = useColors().getColors(color.value);
48
-
49
- const backgrounds = useColors().getColors(ColorBase.Background);
50
-
51
65
  const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
52
66
  return {
53
- "--fs-card-background-color": backgrounds.base,
54
- "--fs-card-border-color" : colors.base
67
+ "--fs-card-width" : sizeToVar(props.width),
68
+ "--fs-card-height": sizeToVar(props.height)
55
69
  };
56
70
  });
57
71
 
@@ -0,0 +1,63 @@
1
+ <template>
2
+ <v-carousel
3
+ class="fs-carousel"
4
+ :hideDelimiters="true"
5
+ :style="style"
6
+ v-bind="$attrs"
7
+ >
8
+ <template v-for="(_, name) in slots" v-slot:[name]="slotData">
9
+ <slot :name="name" v-bind="slotData" />
10
+ </template>
11
+ <v-carousel-item
12
+ v-for="(component, index) in getChildren('default')"
13
+ :value="value(component, index)"
14
+ :key="index"
15
+ >
16
+ <component
17
+ :is="component"
18
+ />
19
+ </v-carousel-item>
20
+ </v-carousel>
21
+ </template>
22
+
23
+ <script lang="ts">
24
+ import { computed, defineComponent, VNode } from "vue";
25
+
26
+ import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
27
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
28
+
29
+ export default defineComponent({
30
+ name: "FSCarousel",
31
+ props: {
32
+ height: {
33
+ type: [String, Number],
34
+ required: false,
35
+ default: "100%"
36
+ }
37
+ },
38
+ setup(props) {
39
+ const { slots, getChildren } = useSlots();
40
+ delete slots.default;
41
+
42
+ const backgrounds = useColors().getColors(ColorEnum.Background);
43
+
44
+ const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
45
+ return {
46
+ "--fs-carousel-height" : typeof(props.height) === "string" ? props.height : `${props.height}px`,
47
+ "--fs-carousel-background-color": backgrounds.base
48
+ };
49
+ });
50
+
51
+ const value = (component: VNode, index: number): any => {
52
+ return component?.props?.value ?? index;
53
+ };
54
+
55
+ return {
56
+ getChildren,
57
+ slots,
58
+ style,
59
+ value
60
+ };
61
+ }
62
+ })
63
+ </script>