@dative-gpi/foundation-shared-components 0.0.13 → 0.0.14

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 (38) hide show
  1. package/components/FSCalendarTwin.vue +2 -0
  2. package/components/FSClock.vue +7 -15
  3. package/components/FSCol.vue +2 -2
  4. package/components/FSSlideGroup.vue +10 -11
  5. package/components/FSWrapGroup.vue +10 -11
  6. package/components/fields/FSAutocompleteField.vue +8 -2
  7. package/components/fields/FSColorField.vue +89 -78
  8. package/components/fields/FSDateField.vue +1 -1
  9. package/components/fields/FSDateRangeField.vue +1 -5
  10. package/components/fields/FSDateTimeField.vue +1 -1
  11. package/components/fields/FSDateTimeRangeField.vue +23 -15
  12. package/components/fields/FSIconField.vue +1 -5
  13. package/components/fields/FSNumberField.vue +17 -3
  14. package/components/fields/FSRichTextField.vue +10 -8
  15. package/components/fields/FSTagField.vue +3 -3
  16. package/components/fields/FSTextArea.vue +2 -2
  17. package/components/fields/FSTimeField.vue +118 -20
  18. package/components/fields/FSTimeSlotField.vue +59 -53
  19. package/components/lists/FSDataTableUI.vue +8 -10
  20. package/package.json +4 -4
  21. package/styles/components/fs_autocomplete_field.scss +3 -60
  22. package/styles/components/fs_color_field.scss +4 -0
  23. package/styles/components/fs_data_table.scss +7 -2
  24. package/styles/components/fs_rich_text_field.scss +1 -1
  25. package/styles/components/fs_select_field.scss +3 -4
  26. package/styles/components/fs_switch.scss +4 -4
  27. package/styles/components/fs_text_area.scss +2 -0
  28. package/styles/components/fs_text_field.scss +1 -0
  29. package/styles/components/fs_time_field.scss +13 -0
  30. package/styles/components/fs_timeslot_field.scss +4 -67
  31. package/styles/globals/overrides.scss +8 -6
  32. package/styles/main.scss +1 -3
  33. package/utils/icons.ts +88 -2
  34. package/pages/FSExternalIdentityButton.vue +0 -64
  35. package/pages/FSLanguageSetter.vue +0 -140
  36. package/pages/FSLoginPage.vue +0 -253
  37. package/styles/pages/fs_language_setter.scss +0 -55
  38. package/styles/pages/index.scss +0 -1
@@ -1,12 +1,52 @@
1
1
  <template>
2
- <FSNumberField
3
- class="fs-time-field"
4
- :editable="$props.editable"
5
- :modelValue="innerTime"
6
- @update:modelValue="onSubmitValue"
7
- v-bind="$attrs"
8
- >
9
- <template #append>
2
+ <FSCol>
3
+ <slot v-if="!$props.hideHeader" name="label">
4
+ <FSRow :wrap="false">
5
+ <FSSpan
6
+ v-if="$props.label"
7
+ class="fs-time-field-label"
8
+ font="text-overline"
9
+ :style="style"
10
+ >
11
+ {{ $props.label }}
12
+ </FSSpan>
13
+ <FSSpan
14
+ v-if="$props.label && $props.required"
15
+ class="fs-time-field-label"
16
+ style="margin-left: -8px;"
17
+ font="text-overline"
18
+ :ellipsis="false"
19
+ :style="style"
20
+ >
21
+ *
22
+ </FSSpan>
23
+ <v-spacer style="min-width: 40px;" />
24
+ <FSSpan
25
+ v-if="messages.length > 0"
26
+ class="fs-time-field-messages"
27
+ font="text-overline"
28
+ :style="style"
29
+ >
30
+ {{ messages.join(", ") }}
31
+ </FSSpan>
32
+ </FSRow>
33
+ </slot>
34
+ <FSRow>
35
+ <FSNumberField
36
+ :editable="$props.editable"
37
+ :hideHeader="true"
38
+ :rules="$props.rules"
39
+ :messages="messages"
40
+ :validateOn="validateOn"
41
+ :validationValue="$props.modelValue"
42
+ :modelValue="innerTime"
43
+ @update:modelValue="onSubmitValue"
44
+ v-bind="$attrs"
45
+ >
46
+ <template v-for="(_, name) in slots" v-slot:[name]="slotData">
47
+ <slot :name="name" v-bind="slotData" />
48
+ </template>
49
+ </FSNumberField>
10
50
  <FSSelectField
11
51
  class="fs-time-field-select"
12
52
  :editable="$props.editable"
@@ -16,32 +56,78 @@
16
56
  :modelValue="selectedUnit.id"
17
57
  @update:modelValue="onSubmitTimeScale"
18
58
  />
19
- </template>
20
- </FSNumberField>
59
+ </FSRow>
60
+ <slot name="description">
61
+ <FSSpan
62
+ v-if="$props.description"
63
+ class="fs-time-field-description"
64
+ font="text-underline"
65
+ :style="style"
66
+ >
67
+ {{ $props.description }}
68
+ </FSSpan>
69
+ </slot>
70
+ </FSCol>
21
71
  </template>
22
72
 
23
73
  <script lang="ts">
24
- import { computed, defineComponent, ref } from "vue";
74
+ import { computed, defineComponent, PropType, ref } from "vue";
25
75
 
26
76
  import { getTimeScaleIndex, timeScale } from "@dative-gpi/foundation-shared-components/utils";
27
- import { useColors } from "@dative-gpi/foundation-shared-components/composables";
77
+ import { useColors, useRules, useSlots } from "@dative-gpi/foundation-shared-components/composables";
28
78
  import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
29
79
 
30
80
  import FSNumberField from "./FSNumberField.vue";
31
81
  import FSSelectField from "./FSSelectField.vue";
82
+ import FSSpan from "../FSSpan.vue";
83
+ import FSCol from "../FSCol.vue";
84
+ import FSRow from "../FSRow.vue";
32
85
 
33
86
  export default defineComponent({
34
87
  name: "FSTimeField",
35
88
  components: {
36
89
  FSNumberField,
37
- FSSelectField
90
+ FSSelectField,
91
+ FSSpan,
92
+ FSCol,
93
+ FSRow
38
94
  },
39
95
  props: {
96
+ label: {
97
+ type: String,
98
+ required: false,
99
+ default: null
100
+ },
101
+ description: {
102
+ type: String,
103
+ required: false,
104
+ default: null
105
+ },
40
106
  modelValue: {
41
107
  type: Number,
42
108
  required: false,
43
109
  default: null
44
110
  },
111
+ hideHeader: {
112
+ type: Boolean,
113
+ required: false,
114
+ default: false
115
+ },
116
+ required: {
117
+ type: Boolean,
118
+ required: false,
119
+ default: false
120
+ },
121
+ rules: {
122
+ type: Array as PropType<Function[]>,
123
+ required: false,
124
+ default: () => []
125
+ },
126
+ messages: {
127
+ type: Array as PropType<string[]>,
128
+ required: false,
129
+ default: null
130
+ },
45
131
  editable: {
46
132
  type: Boolean,
47
133
  required: false,
@@ -50,6 +136,17 @@ export default defineComponent({
50
136
  },
51
137
  emits: ["update:modelValue"],
52
138
  setup(props, { emit }) {
139
+ const { validateOn, blurred, getMessages } = useRules();
140
+ const { getColors } = useColors();
141
+ const { slots } = useSlots();
142
+
143
+ delete slots.label;
144
+ delete slots.description;
145
+
146
+ const errors = getColors(ColorEnum.Error);
147
+ const lights = getColors(ColorEnum.Light);
148
+ const darks = getColors(ColorEnum.Dark);
149
+
53
150
  const innerTime = ref(props.modelValue);
54
151
  const selectedUnit = ref(timeScale[0]);
55
152
 
@@ -58,10 +155,6 @@ export default defineComponent({
58
155
  innerTime.value = props.modelValue / selectedUnit.value.id;
59
156
  }
60
157
 
61
- const errors = useColors().getColors(ColorEnum.Error);
62
- const lights = useColors().getColors(ColorEnum.Light);
63
- const darks = useColors().getColors(ColorEnum.Dark);
64
-
65
158
  const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
66
159
  if (!props.editable) {
67
160
  return {
@@ -81,6 +174,8 @@ export default defineComponent({
81
174
  };
82
175
  });
83
176
 
177
+ const messages = computed((): string[] => props.messages ?? getMessages(props.modelValue, props.rules));
178
+
84
179
  const onSubmitValue = (value: number): void => {
85
180
  innerTime.value = value;
86
181
  emit("update:modelValue", innerTime.value * selectedUnit.value.id);
@@ -92,12 +187,15 @@ export default defineComponent({
92
187
  };
93
188
 
94
189
  return {
95
- style,
96
- innerTime,
97
190
  selectedUnit,
191
+ validateOn,
192
+ innerTime,
98
193
  timeScale,
99
- onSubmitValue,
194
+ messages,
195
+ blurred,
196
+ style,
100
197
  onSubmitTimeScale,
198
+ onSubmitValue
101
199
  };
102
200
  }
103
201
  });
@@ -32,55 +32,61 @@
32
32
  </FSRow>
33
33
  </slot>
34
34
  <FSRow>
35
- <FSSelectField
36
- class="fs-time-slot-field-select"
37
- :editable="$props.editable"
38
- :items="daysObject"
39
- :hideHeader="true"
40
- :clearable="false"
41
- :style="style"
42
- :modelValue="dayStart"
43
- @update:modelValue="onChangeDayStart"
35
+ <FSRow
36
+ :wrap="false"
44
37
  >
45
- <template v-for="(_, name) in slots" v-slot:[name]="slotData">
46
- <slot :name="name" v-bind="slotData" />
47
- </template>
48
- <template #append>
49
- <FSClock
50
- class="fs-time-slot-field-number"
51
- :editable="$props.editable"
52
- :color="ColorEnum.Light"
53
- :reminder="false"
54
- :slider="false"
55
- :style="style"
56
- :modelValue="$props.modelValue[0][1]"
57
- @update:modelValue="onChangeHourStart"
58
- />
59
- </template>
60
- </FSSelectField>
61
- <FSSelectField
62
- class="fs-time-slot-field-select"
63
- :editable="$props.editable"
64
- :items="daysObject"
65
- :hideHeader="true"
66
- :clearable="false"
67
- :style="style"
68
- :modelValue="dayEnd"
69
- @update:modelValue="onChangeDayEnd"
38
+ <FSSelectField
39
+ :editable="$props.editable"
40
+ :items="daysObject"
41
+ :hideHeader="true"
42
+ :clearable="false"
43
+ :style="style"
44
+ :rules="$props.rules"
45
+ :messages="messages"
46
+ :validateOn="validateOn"
47
+ :validationValue="$props.modelValue"
48
+ :modelValue="dayStart"
49
+ @update:modelValue="onChangeDayStart"
50
+ >
51
+ <template v-for="(_, name) in slots" v-slot:[name]="slotData">
52
+ <slot :name="name" v-bind="slotData" />
53
+ </template>
54
+ </FSSelectField>
55
+ <FSClock
56
+ class="fs-time-slot-field-number"
57
+ :editable="$props.editable"
58
+ :color="ColorEnum.Light"
59
+ :reminder="false"
60
+ :slider="false"
61
+ :style="style"
62
+ :modelValue="$props.modelValue[0][1]"
63
+ @update:modelValue="onChangeHourStart"
64
+ />
65
+ </FSRow>
66
+ <FSRow
67
+ :wrap="false"
70
68
  >
71
- <template #append>
72
- <FSClock
73
- class="fs-time-slot-field-number"
74
- :editable="$props.editable"
75
- :color="ColorEnum.Light"
76
- :reminder="false"
77
- :slider="false"
78
- :style="style"
79
- :modelValue="$props.modelValue[1][1]"
80
- @update:modelValue="onChangeHourEnd"
81
- />
82
- </template>
83
- </FSSelectField>
69
+ <FSSelectField
70
+ class="fs-time-slot-field-select"
71
+ :editable="$props.editable"
72
+ :items="daysObject"
73
+ :hideHeader="true"
74
+ :clearable="false"
75
+ :style="style"
76
+ :modelValue="dayEnd"
77
+ @update:modelValue="onChangeDayEnd"
78
+ />
79
+ <FSClock
80
+ class="fs-time-slot-field-number"
81
+ :editable="$props.editable"
82
+ :color="ColorEnum.Light"
83
+ :reminder="false"
84
+ :slider="false"
85
+ :style="style"
86
+ :modelValue="$props.modelValue[1][1]"
87
+ @update:modelValue="onChangeHourEnd"
88
+ />
89
+ </FSRow>
84
90
  </FSRow>
85
91
  <slot name="description">
86
92
  <FSSpan
@@ -244,19 +250,19 @@ export default defineComponent({
244
250
  };
245
251
 
246
252
  return {
247
- ColorEnum,
248
253
  daysObject,
249
- dayStart,
250
- dayEnd,
251
254
  validateOn,
255
+ ColorEnum,
256
+ dayStart,
252
257
  messages,
253
258
  blurred,
259
+ dayEnd,
254
260
  slots,
255
261
  style,
256
- onChangeDayStart,
257
262
  onChangeHourStart,
258
- onChangeDayEnd,
259
- onChangeHourEnd
263
+ onChangeDayStart,
264
+ onChangeHourEnd,
265
+ onChangeDayEnd
260
266
  };
261
267
  }
262
268
  });
@@ -222,6 +222,7 @@
222
222
  <v-spacer />
223
223
  <FSRow
224
224
  align="center-right"
225
+ width="hug"
225
226
  :wrap="false"
226
227
  >
227
228
  <FSText
@@ -229,16 +230,13 @@
229
230
  >
230
231
  {{ $tr("ui.data-table.rows-per-page", "Rows per page") }}
231
232
  </FSText>
232
- <FSRow
233
- width="120px"
234
- >
235
- <FSSelectField
236
- :clearable="false"
237
- :hideHeader="true"
238
- :items="rowsPerPageOptions"
239
- v-model="innerRowsPerPage"
240
- />
241
- </FSRow>
233
+ <FSSelectField
234
+ class="fs-data-table-rows-per-page"
235
+ :clearable="false"
236
+ :hideHeader="true"
237
+ :items="rowsPerPageOptions"
238
+ v-model="innerRowsPerPage"
239
+ />
242
240
  </FSRow>
243
241
  <FSToggleSet
244
242
  v-if="innerRowsPerPage !== -1"
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.13",
4
+ "version": "0.0.14",
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.13",
14
- "@dative-gpi/foundation-shared-services": "0.0.13",
13
+ "@dative-gpi/foundation-shared-domain": "0.0.14",
14
+ "@dative-gpi/foundation-shared-services": "0.0.14",
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": "c99a5f4be0427449b3b00ef6d467528bae8b1ada"
35
+ "gitHead": "e0e44041b264a555d7eccfb49ae4deaf933bd436"
36
36
  }
@@ -1,5 +1,6 @@
1
1
  .fs-autocomplete-field {
2
2
  padding: 0px !important;
3
+ min-width: 240px;
3
4
  width: 100%;
4
5
 
5
6
  & > .v-input__control > .v-field {
@@ -24,6 +25,8 @@
24
25
  & > .v-field__field > .v-field__input {
25
26
  @extend .text-body;
26
27
 
28
+ flex-wrap: nowrap;
29
+ overflow: hidden;
27
30
  padding-inline: 0 !important;
28
31
  color: var(--fs-autocomplete-field-color);
29
32
  cursor: var(--fs-autocomplete-field-cursor) !important;
@@ -37,32 +40,6 @@
37
40
  min-height: 34px !important;
38
41
  height: 34px !important;
39
42
  }
40
-
41
- & > .v-autocomplete__selection {
42
- @include web {
43
- margin-top: -16px;
44
- height: 38px !important;
45
- }
46
-
47
- @include mobile {
48
- margin-top: -15px;
49
- height: 34px !important;
50
- }
51
- }
52
-
53
- & > input {
54
- @include web {
55
- top: 16px;
56
- margin-top: -16px;
57
- height: 38px !important;
58
- }
59
-
60
- @include mobile {
61
- top: 17px;
62
- margin-top: -17px;
63
- height: 34px !important;
64
- }
65
- }
66
43
  }
67
44
 
68
45
  & > .v-field__clearable {
@@ -71,40 +48,6 @@
71
48
 
72
49
  & > .v-field__append-inner {
73
50
  color: var(--fs-autocomplete-field-color);
74
-
75
- & > i {
76
- margin-inline-start: 0px;
77
- }
78
- }
79
- }
80
- }
81
-
82
- .fs-autocomplete-multiple-field {
83
- & > .v-input__control > .v-field {
84
- & > .v-field__field > .v-field__input {
85
- & > .v-autocomplete__selection {
86
- @include web {
87
- margin-top: -16px;
88
- height: 38px !important;
89
- }
90
-
91
- @include mobile {
92
- margin-top: -15px;
93
- height: 34px !important;
94
- }
95
- }
96
-
97
- & > input {
98
- @include web {
99
- margin-top: -16px;
100
- height: 38px !important;
101
- }
102
-
103
- @include mobile {
104
- margin-top: -17px;
105
- height: 34px !important;
106
- }
107
- }
108
51
  }
109
52
  }
110
53
  }
@@ -14,4 +14,8 @@
14
14
  background: none !important;
15
15
  min-width: auto !important;
16
16
  width: 100% !important;
17
+ }
18
+
19
+ .fs-color-field-description {
20
+ color: var(--fs-color-field-color);
17
21
  }
@@ -80,13 +80,18 @@
80
80
  background-color: var(--fs-data-table-background-color);
81
81
  }
82
82
 
83
+ .fs-data-table-rows-per-page > .fs-select-field {
84
+ min-width: 120px !important;
85
+ width: 120px !important;
86
+ }
87
+
83
88
  .fs-data-table-pagination {
84
89
  @include web {
85
- width: 172px;
90
+ max-width: 200px;
86
91
  }
87
92
 
88
93
  @include mobile {
89
- width: 172px;
94
+ max-width: 194px;
90
95
  }
91
96
  }
92
97
 
@@ -1,5 +1,6 @@
1
1
  .fs-rich-text-field {
2
2
  width: 100%;
3
+ min-width: 240px;
3
4
  outline: none !important;
4
5
  border: 1px solid var(--fs-rich-text-field-border-color) !important;
5
6
  border-radius: 4px !important;
@@ -63,5 +64,4 @@
63
64
 
64
65
  .editor-link {
65
66
  color: var(--fs-rich-text-field-link-color);
66
- text-decoration: underline;
67
67
  }
@@ -1,5 +1,6 @@
1
1
  .fs-select-field {
2
2
  padding: 0px !important;
3
+ min-width: 240px;
3
4
  width: 100%;
4
5
 
5
6
  & > .v-input__control > .v-field {
@@ -24,6 +25,8 @@
24
25
  & > .v-field__field > .v-field__input {
25
26
  @extend .text-body;
26
27
 
28
+ flex-wrap: nowrap;
29
+ overflow: hidden;
27
30
  padding-inline: 0 !important;
28
31
  color: var(--fs-select-field-color);
29
32
  cursor: var(--fs-select-field-cursor) !important;
@@ -49,10 +52,6 @@
49
52
 
50
53
  & > .v-field__append-inner {
51
54
  color: var(--fs-select-field-color);
52
-
53
- & > i {
54
- margin-inline-start: 0px;
55
- }
56
55
  }
57
56
  }
58
57
  }
@@ -1,4 +1,5 @@
1
1
  .fs-switch-size {
2
+ min-width: 40px !important;
2
3
  width: 40px !important;
3
4
  min-height: 24px !important;
4
5
  height: 24px !important;
@@ -37,11 +38,10 @@
37
38
  color: var(--fs-switch-color) !important;
38
39
  }
39
40
 
40
- .v-switch__track {
41
- width: 40px !important;
42
- height: 24px !important;
43
- background-color: var(--fs-switch-track-color) !important;
41
+ .v-switch--inset .v-switch__track {
42
+ @extend .fs-switch-size;
44
43
 
44
+ background-color: var(--fs-switch-track-color) !important;
45
45
  }
46
46
 
47
47
  .v-switch__thumb {
@@ -1,5 +1,6 @@
1
1
  .fs-text-area:not(.fs-text-area-auto-grow) {
2
2
  padding: 0px !important;
3
+ min-width: 240px;
3
4
  width: 100%;
4
5
 
5
6
  & > .v-input__control > .v-field {
@@ -47,6 +48,7 @@
47
48
 
48
49
  .fs-text-area-auto-grow {
49
50
  padding: 0px !important;
51
+ min-width: 240px;
50
52
  width: 100%;
51
53
 
52
54
  & > .v-input__control > .v-field {
@@ -1,5 +1,6 @@
1
1
  .fs-text-field {
2
2
  padding: 0px !important;
3
+ min-width: 240px;
3
4
  width: 100%;
4
5
 
5
6
  & > .v-input__control > .v-field {
@@ -1,3 +1,16 @@
1
1
  .fs-time-field-select {
2
2
  min-width: 180px;
3
+ }
4
+
5
+ .fs-time-field-label {
6
+ color: var(--fs-time-field-color);
7
+ }
8
+
9
+ .fs-time-field-messages {
10
+ align-self: stretch;
11
+ color: var(--fs-time-field-error-color);
12
+ }
13
+
14
+ .fs-time-field-description {
15
+ color: var(--fs-time-field-color);
3
16
  }