@dative-gpi/foundation-shared-components 1.0.94 → 1.0.96

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 (43) hide show
  1. package/components/FSDialogContent.vue +10 -7
  2. package/components/FSDialogFormBody.vue +2 -2
  3. package/components/FSDialogMultiFormBody.vue +3 -2
  4. package/components/FSDialogSubmit.vue +2 -2
  5. package/components/FSEditImageUI.vue +10 -2
  6. package/components/FSFadeOut.vue +3 -10
  7. package/components/FSGrid.vue +0 -1
  8. package/components/FSTab.vue +15 -13
  9. package/components/agenda/FSAgenda.vue +26 -7
  10. package/components/agenda/FSAgendaHeader.vue +33 -8
  11. package/components/agenda/FSAgendaHorizontalEvent.vue +3 -1
  12. package/components/agenda/FSAgendaHoursRow.vue +23 -7
  13. package/components/agenda/FSWeekAgenda.vue +2 -2
  14. package/components/fields/FSBaseField.vue +32 -22
  15. package/components/fields/FSColorField.vue +2 -1
  16. package/components/fields/FSIconField.vue +0 -1
  17. package/components/fields/FSNumberField.vue +5 -1
  18. package/components/fields/FSRichTextField.vue +4 -3
  19. package/components/fields/FSTermField.vue +8 -1
  20. package/components/lists/FSDataTableUI.vue +24 -22
  21. package/components/lists/FSLoadDataTable.vue +10 -7
  22. package/components/tiles/FSChartTile.vue +73 -0
  23. package/components/tiles/FSChartTileUI.vue +14 -20
  24. package/components/tiles/FSCommentTileUI.vue +13 -9
  25. package/components/tiles/FSLocationTileUI.vue +52 -48
  26. package/components/views/desktop/FSBaseEntityDesktopView.vue +6 -7
  27. package/components/views/mobile/FSBaseEntityMobileView.vue +6 -7
  28. package/composables/useBreakpoints.ts +5 -0
  29. package/package.json +4 -4
  30. package/styles/components/fs_agenda.scss +4 -0
  31. package/styles/components/fs_agenda_hours_row.scss +3 -3
  32. package/styles/components/fs_autocomplete_field.scss +0 -13
  33. package/styles/components/fs_color_field.scss +0 -4
  34. package/styles/components/fs_magic_config_field.scss +1 -2
  35. package/styles/components/fs_select_field.scss +0 -13
  36. package/styles/components/fs_wrap_group.scss +3 -2
  37. package/styles/components/index.scss +0 -4
  38. package/components/views/FSEntityHeader.vue +0 -343
  39. package/components/views/FSListHeader.vue +0 -83
  40. package/styles/components/fs_icon_field.scss +0 -12
  41. package/styles/components/fs_search_field.scss +0 -3
  42. package/styles/components/fs_tag_field.scss +0 -8
  43. package/styles/components/fs_time_field.scss +0 -12
@@ -19,13 +19,16 @@
19
19
  >
20
20
  {{ $props.title }}
21
21
  </FSText>
22
- <v-spacer />
23
- <FSButton
24
- icon="mdi-close"
25
- variant="icon"
26
- :color="ColorEnum.Dark"
27
- @click="$emit('update:modelValue', false)"
28
- />
22
+ <FSRow
23
+ align="center-right"
24
+ >
25
+ <FSButton
26
+ icon="mdi-close"
27
+ variant="icon"
28
+ :color="ColorEnum.Dark"
29
+ @click="$emit('update:modelValue', false)"
30
+ />
31
+ </FSRow>
29
32
  </FSRow>
30
33
  <FSText
31
34
  v-if="$props.subtitle"
@@ -236,9 +236,9 @@ export default defineComponent({
236
236
  const maxHeight = computed(() => {
237
237
  const other = 24 + 24 // Paddings
238
238
  + (isMobileSized.value ? 24 : 32) + 24 // Title
239
- + (props.subtitle ? (isMobileSized.value ? 14 : 16) + 8 : 0) // Subtitle
239
+ + (props.subtitle ? (isMobileSized.value ? 16 : 20) + 8 : 0) // Subtitle
240
240
  + (isMobileSized.value ? 36 : 40) + 24; // Footer
241
- return `calc(100vh - 40px - ${other}px)`;
241
+ return `calc(100vh - 42px - ${other}px)`;
242
242
  });
243
243
 
244
244
  const cancelLabel = computed(() => {
@@ -192,9 +192,10 @@ export default defineComponent({
192
192
  const maxHeight = computed(() => {
193
193
  const other = 24 + 24 // Paddings
194
194
  + (isMobileSized.value ? 24 : 32) + 24 // Title
195
- + (props.subtitle ? (isMobileSized.value ? 14 : 16) + 8 : 0) // Subtitle
195
+ + (props.subtitle ? (isMobileSized.value ? 16 : 20) + 8 : 0) // Subtitle
196
+ + (props.steps > 1 ? 24 + 4 : 0) // Pagination
196
197
  + (isMobileSized.value ? 36 : 40) + 24; // Footer
197
- return `calc(100vh - 40px - ${other}px)`;
198
+ return `calc(100vh - 42px - ${other}px)`;
198
199
  });
199
200
 
200
201
  const previousButtonLabel = computed(() => {
@@ -179,9 +179,9 @@ export default defineComponent({
179
179
  const maxHeight = computed(() => {
180
180
  const other = 24 + 24 // Paddings
181
181
  + (isMobileSized.value ? 24 : 32) + 24 // Title
182
- + (props.subtitle ? (isMobileSized.value ? 14 : 16) + 8 : 0) // Subtitle
182
+ + (props.subtitle ? (isMobileSized.value ? 16 : 20) + 8 : 0) // Subtitle
183
183
  + (isMobileSized.value ? 36 : 40) + 24; // Footer
184
- return `calc(100vh - 40px - ${other}px)`;
184
+ return `calc(100vh - 42px - ${other}px)`;
185
185
  });
186
186
 
187
187
  const cancelLabel = computed(() => {
@@ -243,7 +243,7 @@ export default defineComponent({
243
243
  default: false
244
244
  }
245
245
  },
246
- emits: ["update:modelValue", "update:source"],
246
+ emits: ["update", "update:modelValue", "update:source"],
247
247
  setup(props, { emit }) {
248
248
  const { isExtraSmall } = useBreakpoints();
249
249
  const { getColors } = useColors();
@@ -266,9 +266,15 @@ export default defineComponent({
266
266
  const content = (await readFile(payload)) as string;
267
267
  fileSelected.value.fileName = payload.name;
268
268
  fileSelected.value.fileContent = content;
269
- emit("update:modelValue", content.substring(content.indexOf(',') + 1));
269
+ const newModelValue = content.substring(content.indexOf(',') + 1);
270
270
  if (props.source) {
271
+ emit("update:modelValue", newModelValue);
271
272
  emit("update:source", null);
273
+ emit("update", { source: null, modelValue: newModelValue });
274
+ }
275
+ else {
276
+ emit("update:modelValue", newModelValue);
277
+ emit("update", { source: props.source, modelValue: newModelValue });
272
278
  }
273
279
  };
274
280
 
@@ -277,9 +283,11 @@ export default defineComponent({
277
283
  fileSelected.value.fileContent = null;
278
284
  if (props.modelValue) {
279
285
  emit("update:modelValue", null);
286
+ emit("update", { source: props.source, modelValue: null });
280
287
  }
281
288
  else {
282
289
  emit("update:source", null);
290
+ emit("update", { source: null, modelValue: props.modelValue });
283
291
  }
284
292
  };
285
293
 
@@ -117,20 +117,13 @@ export default defineComponent({
117
117
  else {
118
118
  topMaskHeight.value = sizeToVar(props.maskHeight);
119
119
  }
120
-
121
- // const event = {
122
- // target: fadeOutRef.value,
123
- // onTop: topMaskHeight.value === "0px",
124
- // onBottom: bottomMaskHeight.value === "0px",
125
- // goingUp: (fadeOutRef.value as any).scrollTop < lastScroll.value,
126
- // };
127
-
128
- // emit("scroll", event);
120
+
129
121
  lastScroll.value = (fadeOutRef.value as any).scrollTop;
130
122
  }
131
123
  };
132
124
 
133
- const debounceMasks = (): void => debounce(handleMasks, 1);
125
+ // Delay to wait for animations to end before computing masks
126
+ const debounceMasks = (): void => debounce(handleMasks, 280);
134
127
 
135
128
  onMounted((): void => {
136
129
  debounceMasks();
@@ -52,7 +52,6 @@
52
52
  </template>
53
53
  </template>
54
54
  </FSCol>
55
- <v-spacer />
56
55
  <FSRow
57
56
  v-if="itemEndSlot(item.code)"
58
57
  align="center-right"
@@ -26,19 +26,6 @@
26
26
  {{ $props.label }}
27
27
  </FSSpan>
28
28
  </slot>
29
- <v-spacer
30
- v-if="$props.tag"
31
- />
32
- <slot
33
- name="tag"
34
- >
35
- <FSSpan
36
- v-if="$props.tag"
37
- class="fs-tab-tag"
38
- >
39
- {{ $props.tag }}
40
- </FSSpan>
41
- </slot>
42
29
  <slot
43
30
  name="append"
44
31
  >
@@ -49,6 +36,21 @@
49
36
  {{ $props.appendIcon }}
50
37
  </FSIcon>
51
38
  </slot>
39
+ <FSRow
40
+ align="center-right"
41
+ :wrap="false"
42
+ >
43
+ <slot
44
+ name="tag"
45
+ >
46
+ <FSSpan
47
+ v-if="$props.tag"
48
+ class="fs-tab-tag"
49
+ >
50
+ {{ $props.tag }}
51
+ </FSSpan>
52
+ </slot>
53
+ </FSRow>
52
54
  </FSRow>
53
55
  </slot>
54
56
  </v-tab>
@@ -141,7 +141,7 @@ export default defineComponent({
141
141
  required: false
142
142
  }
143
143
  },
144
- emits: ['update:mode', 'click:eventId', 'update:start', 'update:end'],
144
+ emits: ['update', 'update:mode', 'click:eventId', 'update:start', 'update:end'],
145
145
  setup(props, { emit }) {
146
146
  const { todayToEpoch, epochToLocalDayStart, epochToLocalDayEnd } = useDateFormat();
147
147
  const { isExtraSmall } = useBreakpoints();
@@ -167,18 +167,27 @@ export default defineComponent({
167
167
  return;
168
168
  }
169
169
  if (props.mode === AgendaMode.Week) {
170
- emit("update:start", epochToLocalDayStart(now.value - (new Date(now.value).getDay() - 1) * 24 * 60 * 60 * 1000));
171
- emit("update:end", epochToLocalDayEnd(now.value + (7 - new Date(now.value).getDay()) * 24 * 60 * 60 * 1000));
170
+ const newStart = epochToLocalDayStart(now.value - (new Date(now.value).getDay() - 1) * 24 * 60 * 60 * 1000);
171
+ const newEnd = epochToLocalDayEnd(now.value + (7 - new Date(now.value).getDay()) * 24 * 60 * 60 * 1000);
172
+ emit("update:start", newStart);
173
+ emit("update:end", newEnd);
174
+ emit("update", { start: newStart, end: newEnd, mode: props.mode });
172
175
  return;
173
176
  }
174
177
  if (props.mode === AgendaMode.Month) {
175
178
  const lastDayOfMonth = new Date(new Date(now.value).getFullYear(), new Date(now.value).getMonth() + 1, 0);
176
- emit("update:start", epochToLocalDayStart(new Date(now.value).setDate(1)));
177
- emit("update:end", lastDayOfMonth.getTime());
179
+ const newStart = epochToLocalDayStart(new Date(now.value).setDate(1));
180
+ const newEnd = lastDayOfMonth.getTime()
181
+ emit("update:start", newStart);
182
+ emit("update:end", newEnd );
183
+ emit("update", { start: newStart, end: newEnd, mode: props.mode });
178
184
  return;
179
185
  }
180
- emit("update:start", epochToLocalDayStart(now.value));
181
- emit("update:end", epochToLocalDayEnd(now.value));
186
+ const newStart = epochToLocalDayStart(now.value);
187
+ const newEnd = epochToLocalDayEnd(now.value);
188
+ emit("update:start", newStart);
189
+ emit("update:end", newEnd);
190
+ emit("update", { start: newStart, end: newEnd, mode: props.mode });
182
191
  });
183
192
 
184
193
  onUnmounted(() => {
@@ -188,8 +197,18 @@ export default defineComponent({
188
197
  watch(isExtraSmall, (value) => {
189
198
  if (value && props.mode !== AgendaMode.Day) {
190
199
  emit('update:mode', AgendaMode.Day);
200
+ emit("update", {
201
+ start: props.start,
202
+ end: props.end,
203
+ mode: AgendaMode.Day
204
+ });
191
205
  } else if (!value && defaultMode.value !== AgendaMode.Day) {
192
206
  emit('update:mode', defaultMode.value);
207
+ emit("update", {
208
+ start: props.start,
209
+ end: props.end,
210
+ mode: defaultMode.value
211
+ });
193
212
  }
194
213
  });
195
214
 
@@ -16,12 +16,18 @@
16
16
  @click="onPrevious"
17
17
  />
18
18
  <FSButton
19
- width="180px"
19
+ width="220px"
20
20
  color="primary"
21
21
  :border="false"
22
- :label="epochToMonthYearOnlyFormat($props.start)"
23
22
  @click="showCalendarDialog = true"
24
- />
23
+ >
24
+ <FSSpan
25
+ class="fs-agenda-header-text"
26
+ font="text-h3"
27
+ >
28
+ {{ epochToMonthYearOnlyFormat($props.start) }}
29
+ </FSSpan>
30
+ </FSButton>
25
31
  <FSButton
26
32
  variant="icon"
27
33
  icon="mdi-chevron-right"
@@ -89,7 +95,7 @@
89
95
  </template>
90
96
 
91
97
  <script lang="ts">
92
- import { defineComponent, type PropType, ref } from 'vue';
98
+ import { defineComponent, type PropType, ref, watch } from 'vue';
93
99
 
94
100
  import { useDateFormat } from '@dative-gpi/foundation-shared-services/composables';
95
101
 
@@ -100,6 +106,7 @@ import FSRow from '../FSRow.vue';
100
106
  import FSButton from '../FSButton.vue';
101
107
  import FSSelectAgendaMode from './FSSelectAgendaMode.vue';
102
108
  import FSAgendaDialogCalendar from './FSAgendaDialogCalendar.vue';
109
+ import FSSpan from '../FSSpan.vue';
103
110
 
104
111
  export default defineComponent({
105
112
  name: 'FSAgendaHeader',
@@ -108,6 +115,7 @@ export default defineComponent({
108
115
  FSSelectAgendaMode,
109
116
  FSCol,
110
117
  FSButton,
118
+ FSSpan,
111
119
  FSRow
112
120
  },
113
121
  props: {
@@ -128,7 +136,7 @@ export default defineComponent({
128
136
  required: true
129
137
  }
130
138
  },
131
- emits: ['update:start', 'update:end', 'update:mode'],
139
+ emits: ['update', 'update:start', 'update:end', 'update:mode'],
132
140
  setup(props, { emit }) {
133
141
  const { epochToMonthYearOnlyFormat, epochToDayMonthLongOnly, epochToLocalDayStart, epochToLocalDayEnd } = useDateFormat();
134
142
 
@@ -137,18 +145,24 @@ export default defineComponent({
137
145
  const updateDateRange = (dayStart: number) => {
138
146
  const newStart = epochToLocalDayStart(dayStart);
139
147
  if (props.mode === AgendaMode.Week) {
148
+ const newEnd = epochToLocalDayEnd(newStart + (7 - new Date(newStart).getDay()) * 24 * 60 * 60 * 1000)
140
149
  emit('update:start', newStart);
141
- emit('update:end', epochToLocalDayEnd(newStart + (7 - new Date(newStart).getDay()) * 24 * 60 * 60 * 1000));
150
+ emit('update:end', newEnd);
151
+ emit('update', { start: newStart, end: newEnd, mode: props.mode })
142
152
  return;
143
153
  }
144
154
  if (props.mode === AgendaMode.Month) {
145
155
  emit('update:start', newStart);
146
156
  const lastDayOfMonth = new Date(new Date(newStart).getFullYear(), new Date(newStart).getMonth() + 1, 0);
147
- emit('update:end', epochToLocalDayEnd(lastDayOfMonth.getTime()));
157
+ const newEnd = epochToLocalDayEnd(lastDayOfMonth.getTime());
158
+ emit('update:end', newEnd);
159
+ emit('update', { start: newStart, end: newEnd, mode: props.mode })
148
160
  return;
149
161
  }
162
+ const newEnd = epochToLocalDayEnd(newStart);
150
163
  emit('update:start', newStart);
151
- emit('update:end', epochToLocalDayEnd(newStart));
164
+ emit('update:end', newEnd);
165
+ emit('update', { start: newStart, end: newEnd, mode: props.mode })
152
166
  }
153
167
 
154
168
  const onNext = () => {
@@ -175,6 +189,17 @@ export default defineComponent({
175
189
  }
176
190
  }
177
191
 
192
+ watch(() => props.mode, (newMode) => {
193
+ const dayBtwStartAndEnd = props.start + (props.end - props.start) / 2;
194
+ if (newMode === AgendaMode.Week) {
195
+ updateDateRange(dayBtwStartAndEnd - (new Date(dayBtwStartAndEnd).getDay() - 1) * 24 * 60 * 60 * 1000);
196
+ } else if (newMode === AgendaMode.Month) {
197
+ updateDateRange(new Date(dayBtwStartAndEnd).setDate(1));
198
+ } else if (newMode === AgendaMode.Day) {
199
+ updateDateRange(dayBtwStartAndEnd);
200
+ }
201
+ });
202
+
178
203
  return {
179
204
  AgendaMode,
180
205
  showCalendarDialog,
@@ -15,7 +15,7 @@
15
15
  @click="$emit('click', $props.id)"
16
16
  >
17
17
  <template
18
- #default="{ label, icon, timeStart, timeEnd, iconBis, variant }"
18
+ #default="{ label, icon, timeStart, timeEnd, iconBis, variant, width }"
19
19
  >
20
20
  <slot
21
21
  name="default"
@@ -25,6 +25,7 @@
25
25
  :timeStart="timeStart"
26
26
  :timeEnd="timeEnd"
27
27
  :variant="variant"
28
+ :width="width"
28
29
  />
29
30
  </template>
30
31
  </FSAgendaHorizontalEvent>
@@ -47,6 +48,7 @@
47
48
  :timeStart="epochToShortTimeOnlyFormat($props.start)"
48
49
  :timeEnd="epochToShortTimeOnlyFormat($props.end)"
49
50
  :variant="$props.variant"
51
+ :width="width"
50
52
  />
51
53
  </FSClickable>
52
54
  </template>
@@ -7,6 +7,7 @@
7
7
  :wrap="false"
8
8
  gap="0"
9
9
  align="center-center"
10
+ :style="style"
10
11
  >
11
12
  <FSRow
12
13
  v-for="hour in hours"
@@ -36,14 +37,14 @@
36
37
  </FSRow>
37
38
  </FSRow>
38
39
  <FSRow
39
- class="fs-agenda-hours-row"
40
+ class="fs-agenda-hours-row-markers"
40
41
  :wrap="false"
41
42
  gap="0"
42
43
  >
43
44
  <FSRow
44
- v-for="hour in hours"
45
- :key="hour"
46
- :style="getMarkerStyle(displayNow && hour === modelValue)"
45
+ v-for="hour in 24"
46
+ :key="hour-1"
47
+ :style="getMarkerStyle(displayNow && hour-1 === modelValue)"
47
48
  width="100%"
48
49
  height="0"
49
50
  align="center-center"
@@ -59,7 +60,7 @@
59
60
  <script lang="ts">
60
61
  import { defineComponent, computed, type StyleValue } from 'vue';
61
62
 
62
- import { useColors } from "@dative-gpi/foundation-shared-components/composables";
63
+ import { useBreakpoints, useColors } from "@dative-gpi/foundation-shared-components/composables";
63
64
  import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
64
65
 
65
66
  import FSText from '../FSText.vue';
@@ -90,13 +91,27 @@ export default defineComponent({
90
91
  },
91
92
  setup() {
92
93
  const { getColors } = useColors();
94
+ const { isMobileSized } = useBreakpoints();
93
95
 
94
96
  const lightColors = getColors(ColorEnum.Light);
95
97
  const primaryColors = getColors(ColorEnum.Primary);
96
98
  const fontColor = lightColors.dark;
97
99
 
100
+ const hoursToShow = computed(() => {
101
+ if(isMobileSized.value) {
102
+ return 12;
103
+ }
104
+ return 24;
105
+ });
106
+
98
107
  const hours = computed(() => {
99
- return Array.from({ length: 24 }, (_, i) => i);
108
+ return Array.from({ length: hoursToShow.value }, (_, i) => i * (24 / hoursToShow.value));
109
+ });
110
+
111
+ const style = computed((): StyleValue => {
112
+ return {
113
+ '--fs-agenda-hours-row-transform': `translateX(calc(-${2.4 * 24 / hoursToShow.value}%))`,
114
+ }
100
115
  });
101
116
 
102
117
  const getMarkerStyle = (isNowHour: boolean): StyleValue => {
@@ -113,8 +128,9 @@ export default defineComponent({
113
128
  const to2Digits = (value: number) => value.toString().padStart(2, '0');
114
129
 
115
130
  return {
116
- fontColor,
117
131
  hours,
132
+ style,
133
+ fontColor,
118
134
  getMarkerStyle,
119
135
  to2Digits
120
136
  };
@@ -125,7 +125,7 @@
125
125
  @click="() => $emit('click:eventId', event.id)"
126
126
  >
127
127
  <template
128
- #default="{ label, icon, timeStart, timeEnd, iconBis, variant }"
128
+ #default="{ label, icon, timeStart, timeEnd, iconBis, variant, width }"
129
129
  >
130
130
  <FSRow
131
131
  align="center-left"
@@ -158,7 +158,7 @@
158
158
  </FSRow>
159
159
  </FSCol>
160
160
  <FSCol
161
- v-if="iconBis && variant !== 'current'"
161
+ v-if="iconBis && variant !== 'current' && width > 13"
162
162
  align="center-right"
163
163
  padding="8px 8px 8px 0"
164
164
  width="hug"
@@ -7,39 +7,43 @@
7
7
  name="label"
8
8
  >
9
9
  <FSRow
10
+ gap="40px"
10
11
  :wrap="false"
11
12
  >
12
- <FSSpan
13
- class="fs-base-field-label"
14
- font="text-overline"
13
+ <FSRow
14
+ gap="2px"
15
+ :width="widths.label"
16
+ :wrap="false"
15
17
  >
16
- {{ $props.label }}
17
- </FSSpan>
18
- <FSSpan
19
- v-if="$props.label && $props.required"
20
- class="fs-base-field-label"
21
- style="margin-left: -8px;"
22
- font="text-overline"
23
- :ellipsis="false"
24
- :style="style"
25
- >
26
- *
27
- </FSSpan>
28
- <v-spacer
29
- style="min-width: 40px;"
30
- />
31
- <template
32
- v-if="$props.messages"
18
+ <FSSpan
19
+ class="fs-base-field-label"
20
+ font="text-overline"
21
+ >
22
+ {{ $props.label }}
23
+ </FSSpan>
24
+ <FSSpan
25
+ v-if="$props.label && $props.required"
26
+ class="fs-base-field-label"
27
+ font="text-overline"
28
+ :ellipsis="false"
29
+ :style="style"
30
+ >
31
+ *
32
+ </FSSpan>
33
+ </FSRow>
34
+ <FSRow
35
+ align="center-right"
36
+ :width="widths.messages"
33
37
  >
34
38
  <FSSpan
35
- v-if="$props.messages.length > 0"
39
+ v-if="$props.messages && $props.messages.length > 0"
36
40
  class="fs-base-field-messages"
37
41
  font="text-overline"
38
42
  :style="style"
39
43
  >
40
44
  {{ $props.messages.join(", ") }}
41
45
  </FSSpan>
42
- </template>
46
+ </FSRow>
43
47
  </FSRow>
44
48
  </slot>
45
49
  <slot />
@@ -136,7 +140,13 @@ export default defineComponent({
136
140
  };
137
141
  });
138
142
 
143
+ const widths = computed(() => ({
144
+ label: props.messages && props.messages.length ? "calc(50% - 40px)" : "100%",
145
+ messages: props.messages && props.messages.length ? "50%" : "0"
146
+ }));
147
+
139
148
  return {
149
+ widths,
140
150
  style,
141
151
  slots
142
152
  };
@@ -152,7 +152,7 @@ export default defineComponent({
152
152
  default: "fill"
153
153
  }
154
154
  },
155
- emits: ["update:modelValue", "update:opacity"],
155
+ emits: ["update", "update:modelValue", "update:opacity"],
156
156
  setup(props, { emit }) {
157
157
  const { getColors, getBasePaletteColors } = useColors();
158
158
  const { slots } = useSlots();
@@ -192,6 +192,7 @@ export default defineComponent({
192
192
  fullColor.value = innerColor.value + innerOpacity.value;
193
193
  emit("update:modelValue", innerColor.value);
194
194
  emit("update:opacity", getPercentageFromHex(innerOpacity.value));
195
+ emit("update", { modelValue: innerColor.value, opacity: getPercentageFromHex(innerOpacity.value) });
195
196
  };
196
197
 
197
198
  const reset = (): void => {
@@ -28,7 +28,6 @@
28
28
  </template>
29
29
  </FSTextField>
30
30
  <FSToggleSet
31
- class="fs-icon-field-set"
32
31
  ref="toggleSetRef"
33
32
  variant="slide"
34
33
  :buttonColor="$props.buttonColor"
@@ -43,10 +43,14 @@ export default defineComponent({
43
43
  },
44
44
  emits: ["update:modelValue"],
45
45
  setup(_, { emit }) {
46
- const onUpdate = (value: string) => {
46
+ const onUpdate = (value: string | null | undefined) => {
47
47
  if (value === "-") {
48
48
  return;
49
49
  }
50
+ if(value === null || value === undefined) {
51
+ emit("update:modelValue", null);
52
+ return;
53
+ }
50
54
  const match = /[-]?([0-9 ]*[,.]?)?[0-9]*/.exec(value);
51
55
  if (match != null && !isNaN(parseFloat(match[0].replace(",", ".").replace(" ", "")))) {
52
56
  emit("update:modelValue", parseFloat(match[0].replace(",", ".").replace(" ", "")));
@@ -29,9 +29,10 @@
29
29
  </FSSpan>
30
30
  </FSRow>
31
31
  </slot>
32
- <v-spacer />
33
- <template
32
+ <FSRow
34
33
  v-if="$props.editable"
34
+ align="center-right"
35
+ :wrap="false"
35
36
  >
36
37
  <FSIcon
37
38
  class="fs-rich-text-field-icon"
@@ -177,7 +178,7 @@
177
178
  >
178
179
  mdi-format-align-justify
179
180
  </FSIcon>
180
- </template>
181
+ </FSRow>
181
182
  </FSRow>
182
183
  <FSText
183
184
  v-if="readonly && !$props.modelValue && $props.emptyLabel"
@@ -165,7 +165,7 @@ export default defineComponent({
165
165
  default: true
166
166
  }
167
167
  },
168
- emits: ["update:startDate", "update:endDate"],
168
+ emits: ["update", "update:startDate", "update:endDate"],
169
169
  setup(props, { emit }) {
170
170
  const { parseForPicker, epochToISO, todayToPicker, yesterdayToPicker } = useDateFormat();
171
171
  const { getMessages } = useRules();
@@ -206,6 +206,7 @@ export default defineComponent({
206
206
  innerStartDate.value = value;
207
207
  if (valid.value) {
208
208
  emit("update:startDate", value);
209
+ emit("update", { startDate: innerStartDate.value, endDate: props.endDate });
209
210
  }
210
211
  };
211
212
 
@@ -219,6 +220,7 @@ export default defineComponent({
219
220
  innerEndDate.value = value;
220
221
  if (valid.value) {
221
222
  emit("update:endDate", value);
223
+ emit("update", { startDate: props.startDate, endDate: innerEndDate.value });
222
224
  }
223
225
  };
224
226
 
@@ -354,6 +356,7 @@ export default defineComponent({
354
356
  }
355
357
  emit("update:startDate", innerStartDate.value);
356
358
  emit("update:endDate", innerEndDate.value);
359
+ emit("update", { startDate: innerStartDate.value, endDate: innerEndDate.value });
357
360
  };
358
361
 
359
362
  const innerDateValueChange = (value: number) => {
@@ -417,6 +420,7 @@ export default defineComponent({
417
420
  }
418
421
  emit("update:startDate", innerStartDate.value);
419
422
  emit("update:endDate", innerEndDate.value);
423
+ emit("update", { startDate: innerStartDate.value, endDate: innerEndDate.value });
420
424
  };
421
425
 
422
426
  const onPickDates = (value: number[] | null) => {
@@ -426,6 +430,7 @@ export default defineComponent({
426
430
  if (valid.value) {
427
431
  emit("update:startDate", innerStartDate.value);
428
432
  emit("update:endDate", innerEndDate.value);
433
+ emit("update", { startDate: innerStartDate.value, endDate: innerEndDate.value });
429
434
  }
430
435
  }
431
436
  else {
@@ -433,12 +438,14 @@ export default defineComponent({
433
438
  innerStartDate.value = epochToISO(value[0]);
434
439
  if (valid.value) {
435
440
  emit("update:startDate", innerStartDate.value);
441
+ emit("update", { startDate: innerStartDate.value, endDate: props.endDate });
436
442
  }
437
443
  }
438
444
  if (value && value[1] != null && epochToISO(value[1]) !== innerEndDate.value) {
439
445
  innerEndDate.value = epochToISO(value[1]);
440
446
  if (valid.value) {
441
447
  emit("update:endDate", innerEndDate.value);
448
+ emit("update", { startDate: props.startDate, endDate: innerEndDate.value });
442
449
  }
443
450
  }
444
451
  }