@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,75 +1,12 @@
1
- .fs-time-slot-field {
2
- padding: 0px !important;
3
- width: 100%;
4
-
5
- & > .v-input__control > .v-field {
6
- border: 1px solid var(--fs-time-slot-field-border-color) !important;
7
- cursor: var(--fs-time-slot-field-cursor) !important;
8
- border-radius: 4px !important;
9
- padding: 0 16px !important;
10
- gap: 8px;
11
-
12
- &--error {
13
- border-color: var(--fs-time-slot-field-error-border-color) !important;
14
- }
15
-
16
- &:not(.v-field--error):focus-within {
17
- border-color: var(--fs-time-slot-field-active-border-color) !important;
18
- }
19
-
20
- & > .v-field__outline {
21
- display: none;
22
- }
23
-
24
- & > .v-field__field > .v-field__input {
25
- @extend .text-body;
26
-
27
- padding-inline: 0 !important;
28
- color: var(--fs-time-slot-field-color);
29
- cursor: var(--fs-time-slot-field-cursor) !important;
30
-
31
- @include web {
32
- min-height: 38px !important;
33
- height: 38px !important;
34
- }
35
-
36
- @include mobile {
37
- min-height: 34px !important;
38
- height: 34px !important;
39
- }
40
-
41
- & > .v-select__selection {
42
- height: 100%;
43
- }
44
- }
45
-
46
- & > .v-field__clearable {
47
- margin-inline: 0px;
48
- }
49
-
50
- & > .v-field__append-inner {
51
- color: var(--fs-time-slot-field-color);
52
-
53
- & > i {
54
- margin-inline-start: 0px;
55
- }
56
- }
57
- }
58
- }
59
-
60
1
  .fs-time-slot-field-label {
61
- color: var(--fs-time-slot-field-color);
2
+ color: var(--fs-time-slot-field-color);
62
3
  }
63
4
 
64
5
  .fs-time-slot-field-messages {
65
- align-self: stretch;
66
- color: var(--fs-time-slot-field-error-color);
6
+ align-self: stretch;
7
+ color: var(--fs-time-slot-field-error-color);
67
8
  }
68
9
 
69
10
  .fs-time-slot-field-description {
70
- color: var(--fs-time-slot-field-color);
71
- }
72
-
73
- .fs-time-slot-field-number > .fs-row {
74
- padding: 0px !important;
11
+ color: var(--fs-time-slot-field-color);
75
12
  }
@@ -17,6 +17,14 @@
17
17
  margin-inline-start: 8px !important;
18
18
  }
19
19
 
20
+ // Clearable icon is always centered vertically
21
+ .v-input__control > .v-field > .v-field__clearable {
22
+ align-items: center;
23
+ padding-top: 0px;
24
+ height: 100%;
25
+ }
26
+
27
+
20
28
  // No up / down buttons in input field of type number
21
29
  input[type=number] {
22
30
  -moz-appearance: textfield;
@@ -56,12 +64,6 @@ input[type=number]::-webkit-outer-spin-button {
56
64
  color: var(--fs-group-hover-color);
57
65
  }
58
66
 
59
- // remove arrows when disabled
60
- .v-slide-group__prev--disabled,
61
- .v-slide-group__next--disabled {
62
- display: none !important;
63
- }
64
-
65
67
  // Badges are totally overriden
66
68
  .v-badge__badge {
67
69
  align-items: center !important;
package/styles/main.scss CHANGED
@@ -1,5 +1,3 @@
1
1
  // Warning: Imports are loaded in order. If you need to use a variable / property / mixin, import it after the file that defines it
2
2
  @import 'globals/index.scss';
3
- @import 'components/index.scss';
4
-
5
- @import 'pages/index.scss';
3
+ @import 'components/index.scss';
package/utils/icons.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { Flags } from "../icons/sets";
2
+
1
3
  const MdiIcons = [
2
4
  {
3
5
  "name": "ab-testing",
@@ -75408,9 +75410,93 @@ const MdiIcons = [
75408
75410
  "styles": [],
75409
75411
  "tags": []
75410
75412
  }
75411
- ]
75413
+ ];
75414
+
75415
+ const FlagIcons = [
75416
+ {
75417
+ "name": "france",
75418
+ "aliases": [
75419
+ "french-flag"
75420
+ ],
75421
+ "styles": [],
75422
+ "tags": [
75423
+ "Flags",
75424
+ "France"
75425
+ ]
75426
+ },
75427
+ {
75428
+ "name": "germany",
75429
+ "aliases": [
75430
+ "german-flag"
75431
+ ],
75432
+ "styles": [],
75433
+ "tags": [
75434
+ "Flags",
75435
+ "Allemagne"
75436
+ ]
75437
+ },
75438
+ {
75439
+ "name": "greatBritain",
75440
+ "aliases": [
75441
+ "great-britain-flag",
75442
+ "united-kingdom-flag"
75443
+ ],
75444
+ "styles": [],
75445
+ "tags": [
75446
+ "Flags",
75447
+ "Royaume-Uni"
75448
+ ]
75449
+ },
75450
+ {
75451
+ "name": "italy",
75452
+ "aliases": [
75453
+ "italien-flag"
75454
+ ],
75455
+ "styles": [],
75456
+ "tags": [
75457
+ "Flags",
75458
+ "Italie"
75459
+ ]
75460
+ },
75461
+ {
75462
+ "name": "portugal",
75463
+ "aliases": [
75464
+ "portuguese-flag"
75465
+ ],
75466
+ "styles": [],
75467
+ "tags": [
75468
+ "Flags",
75469
+ "Portugal"
75470
+ ]
75471
+ },
75472
+ {
75473
+ "name": "spain",
75474
+ "aliases": [
75475
+ "spanish-flag"
75476
+ ],
75477
+ "styles": [],
75478
+ "tags": [
75479
+ "Flags",
75480
+ "Espagne"
75481
+ ]
75482
+ },
75483
+ {
75484
+ "name": "unitedStates",
75485
+ "aliases": [
75486
+ "united-states-flag"
75487
+ ],
75488
+ "styles": [],
75489
+ "tags": [
75490
+ "Flags",
75491
+ "Etats-Unis"
75492
+ ]
75493
+ }
75494
+ ];
75412
75495
 
75413
75496
  export const Icons: { name: string, fullText: string }[] = MdiIcons.map((icon) => ({
75414
75497
  name: "mdi-" + icon.name,
75415
75498
  fullText: icon.name + icon.name.split("-").join(" ") + " " + icon.aliases.join(" ") + " " + icon.tags.join(" ") + " " + icon.styles.join(" ")
75416
- }));
75499
+ })).concat(FlagIcons.map((icon) => ({
75500
+ name: "$" + icon.name,
75501
+ fullText: icon.name + icon.name.split("-").join(" ") + " " + icon.aliases.join(" ") + " " + icon.tags.join(" ") + " " + icon.styles.join(" ")
75502
+ })));
@@ -1,64 +0,0 @@
1
- <template>
2
- <FSButton
3
- style="flex: 1"
4
- :href="loginUrl"
5
- :prependIcon="icon"
6
- />
7
- </template>
8
-
9
- <script lang="ts">
10
- import { computed, defineComponent, PropType } from "vue";
11
-
12
- import { LOGIN_EXTERNAL_URL, SIGNUP_EXTERNAL_URL } from "@dative-gpi/foundation-shared-services/config";
13
- import { buildURL } from "@dative-gpi/bones-ui";
14
-
15
- import FSButton from "../components/FSButton.vue";
16
- import FSIcon from "../components/FSIcon.vue";
17
-
18
- export default defineComponent({
19
- name: "FSExternalIdentityButton",
20
- components: {
21
- FSButton,
22
- FSIcon
23
- },
24
- props: {
25
- scheme: {
26
- type: String as PropType<"OpenIdConnect" | "Google" | "Facebook">,
27
- required: false,
28
- default: null
29
- },
30
- invitation: {
31
- type: Boolean,
32
- required: false,
33
- default: false
34
- },
35
- token: {
36
- type: String,
37
- required: false,
38
- default: null
39
- }
40
- },
41
- setup(props) {
42
- const loginUrl = computed((): string => {
43
- if (props.invitation) {
44
- return buildURL(SIGNUP_EXTERNAL_URL(), { scheme: props.scheme, token: props.token });
45
- }
46
- return buildURL(LOGIN_EXTERNAL_URL(), { scheme: props.scheme });
47
- });
48
-
49
- const icon = computed((): string => {
50
- switch (props.scheme) {
51
- case "OpenIdConnect": return "mdi-microsoft";
52
- case "Google": return "mdi-google";
53
- case "Facebook": return "mdi-facebook";
54
- default: return "mdi-login";
55
- }
56
- });
57
-
58
- return {
59
- loginUrl,
60
- icon
61
- };
62
- }
63
- })
64
- </script>
@@ -1,140 +0,0 @@
1
- <template>
2
- <v-skeleton-loader
3
- v-if="fetching"
4
- type="image"
5
- :class="loadClasses"
6
- />
7
- <FSSelectField
8
- v-else
9
- itemValue="code"
10
- :class="classes"
11
- :items="entities"
12
- :modelValue="languageCode"
13
- :hideHeader="$props.hideHeader"
14
- @update:modelValue="setLanguageCode($event)"
15
- v-bind="$attrs"
16
- >
17
- <template #selection>
18
- <FSRow
19
- align="center-center"
20
- >
21
- <FSIcon size="l">
22
- {{ languageIcon }}
23
- </FSIcon>
24
- <FSSpan
25
- v-if="$props.withLabel"
26
- >
27
- {{ languageLabel }}
28
- </FSSpan>
29
- </FSRow>
30
- </template>
31
- <template #item="{ item, props }">
32
- <v-list-item v-bind="{ ...props, title: '' }">
33
- <FSRow
34
- align="center-left"
35
- width="hug"
36
- >
37
- <FSIcon size="l">
38
- {{ item.raw.icon }}
39
- </FSIcon>
40
- <FSSpan
41
- v-if="$props.withLabel"
42
- >
43
- {{ item.raw.label }}
44
- </FSSpan>
45
- </FSRow>
46
- </v-list-item>
47
- </template>
48
- </FSSelectField>
49
- </template>
50
-
51
- <script lang="ts">
52
- import { computed, defineComponent, onMounted } from "vue";
53
-
54
- import { useLanguageCode } from "@dative-gpi/foundation-shared-services/composables";
55
- import { useLanguages } from "@dative-gpi/foundation-core-services/composables";
56
-
57
- import FSSelectField from "../components/fields/FSSelectField.vue";
58
- import FSIcon from "../components/FSIcon.vue";
59
- import FSSpan from "../components/FSSpan.vue";
60
- import FSRow from "../components/FSRow.vue";
61
-
62
- export default defineComponent({
63
- name: "FSLanguageSet",
64
- components: {
65
- FSSelectField,
66
- FSIcon,
67
- FSSpan,
68
- FSRow
69
- },
70
- props: {
71
- withLabel: {
72
- type: Boolean,
73
- required: false,
74
- default: false
75
- },
76
- modelValue: {
77
- type: String,
78
- required: false,
79
- default: null
80
- },
81
- hideHeader: {
82
- type: Boolean,
83
- required: false,
84
- default: true
85
- }
86
- },
87
- emits: ["update:modelValue"],
88
- setup(props) {
89
- const { getMany, fetching, entities } = useLanguages();
90
- const { setLanguageCode, languageCode } = useLanguageCode();
91
-
92
- onMounted(() => {
93
- getMany();
94
- });
95
-
96
- const classes = computed((): string[] => {
97
- const innerClasses = ["fs-language-setter"];
98
- if (!props.withLabel) {
99
- innerClasses.push("fs-language-setter-icon");
100
- }
101
- return innerClasses;
102
- });
103
-
104
- const loadClasses = computed((): string[] => {
105
- const innerClasses = ["fs-load-language-setter"];
106
- if (!props.withLabel) {
107
- innerClasses.push("fs-load-language-setter-icon");
108
- }
109
- return innerClasses;
110
- });
111
-
112
- const languageIcon = computed((): string => {
113
- const language = entities.value.find((entity) => entity.code === languageCode.value);
114
- if (language) {
115
- return language.icon;
116
- }
117
- return "";
118
- });
119
-
120
- const languageLabel = computed((): string => {
121
- const language = entities.value.find((entity) => entity.code === languageCode.value);
122
- if (language) {
123
- return language.label;
124
- }
125
- return "";
126
- });
127
-
128
- return {
129
- classes,
130
- fetching,
131
- entities,
132
- loadClasses,
133
- languageCode,
134
- languageIcon,
135
- languageLabel,
136
- setLanguageCode
137
- };
138
- }
139
- });
140
- </script>
@@ -1,253 +0,0 @@
1
- <template>
2
- <FSRow
3
- width="100vw"
4
- gap="0px"
5
- >
6
- <FSCol
7
- align="top-center"
8
- :width="formWidth"
9
- >
10
- <FSCol
11
- width="min(464px, 100%)"
12
- padding="56px 0 0 0"
13
- align="top-center"
14
- gap="32px"
15
- >
16
- <FSCol
17
- align="top-center"
18
- gap="24px"
19
- >
20
- <FSImage
21
- borderRadius="0px"
22
- :imageId="landingPage?.bannerImageId"
23
- :height="bannerSize.height"
24
- :width="bannerSize.width"
25
- />
26
- <FSPagination
27
- class="fs-login-page-pagination"
28
- width="calc(100% - 64px)"
29
- :modelValue="0"
30
- :pages="3"
31
- />
32
- <FSCol
33
- gap="24px"
34
- >
35
- <FSCol
36
- gap="12px"
37
- >
38
- <FSLanguageSetter />
39
- <FSCol
40
- gap="4px"
41
- >
42
- <FSLabel
43
- font="text-h1"
44
- :label="landingPage?.title"
45
- />
46
- <FSLabel
47
- :label="landingPage?.subTitle"
48
- />
49
- </FSCol>
50
- </FSCol>
51
- <FSCol
52
- v-if="securitySettings?.useLocalAccounts"
53
- gap="16px"
54
- >
55
- <FSTextField
56
- :label="$tr('ui.login-page.email', 'Email')"
57
- :required="true"
58
- v-model="innerEmail"
59
- />
60
- <FSPasswordField
61
- :label="$tr('ui.login-page.password', 'Password')"
62
- :required="true"
63
- v-model="innerPassword"
64
- />
65
- <FSRow
66
- align="center-left"
67
- >
68
- <FSCheckbox
69
- :label="$tr('ui.login-page.remember-me', 'Remember me')"
70
- v-model="innerRememberMe"
71
- />
72
- <v-spacer />
73
- <FSLink
74
- to="https://www.google.com"
75
- >
76
- {{ $tr("ui.login-page.forgot-password", "Forgot password?") }}
77
- </FSLink>
78
- </FSRow>
79
- </FSCol>
80
- <FSButton
81
- v-if="securitySettings?.useLocalAccounts"
82
- :label="$tr('ui.login-page.login', 'Login')"
83
- :color="ColorEnum.Primary"
84
- :fullWidth="true"
85
- />
86
- </FSCol>
87
- </FSCol>
88
- <FSDivider
89
- v-if="securitySettings && showDivider"
90
- :label="$tr('ui.login-page.or', 'Or')"
91
- />
92
- <FSRow
93
- align="center-center"
94
- width="fill"
95
- :wrap="false"
96
- >
97
- <FSExternalIdentityButton
98
- v-if="securitySettings && securitySettings.useGoogle"
99
- scheme="Google"
100
- />
101
- <FSExternalIdentityButton
102
- v-if="securitySettings && securitySettings.useFacebook"
103
- scheme="Facebook"
104
- />
105
- <FSExternalIdentityButton
106
- v-if="securitySettings && securitySettings.useMicrosoft"
107
- scheme="OpenIdConnect"
108
- />
109
- </FSRow>
110
- <FSLink
111
- v-if="landingPage && landingPage.faqLink"
112
- :to="landingPage.faqLink"
113
- >
114
- {{ $tr("ui.login-page.frequently-asked-questions", "Frequently asked questions") }}
115
- </FSLink>
116
- </FSCol>
117
- </FSCol>
118
- <FSImage
119
- borderRadius="0px"
120
- :imageId="landingPage?.bannerImageId"
121
- :height="backgroundSize.height"
122
- :width="backgroundSize.width"
123
- />
124
- </FSRow>
125
- </template>
126
-
127
- <script lang="ts">
128
- import { computed, defineComponent, onMounted, ref } from "vue";
129
-
130
- import { useCurrentLandingPage, useCurrentSecuritySettings } from "@dative-gpi/foundation-shared-services/composables";
131
- import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
132
- import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
133
-
134
- import FSExternalIdentityButton from "./FSExternalIdentityButton.vue";
135
- import FSLanguageSetter from "./FSLanguageSetter.vue";
136
-
137
- import FSPasswordField from "../components/fields/FSPasswordField.vue";
138
- import FSTextField from "../components/fields/FSTextField.vue";
139
- import FSPagination from "../components/FSPagination.vue";
140
- import FSCheckbox from "../components/FSCheckbox.vue"
141
- import FSDivider from "../components/FSDivider.vue";
142
- import FSImage from "../components/FSImage.vue";
143
- import FSLabel from "../components/FSLabel.vue";
144
- import FSLink from "../components/FSLink.vue";
145
- import FSRow from "../components/FSRow.vue";
146
- import FSCol from "../components/FSCol.vue";
147
-
148
- export default defineComponent({
149
- name: "FSLoginPage",
150
- components: {
151
- FSExternalIdentityButton,
152
- FSLanguageSetter,
153
- FSPasswordField,
154
- FSPagination,
155
- FSTextField,
156
- FSCheckbox,
157
- FSDivider,
158
- FSImage,
159
- FSLabel,
160
- FSLink,
161
- FSRow,
162
- FSCol
163
- },
164
- props: {
165
- backgroundImageId: {
166
- type: String,
167
- required: false,
168
- default: null
169
- },
170
- bannerImageId: {
171
- type: String,
172
- required: false,
173
- default: null
174
- }
175
- },
176
- setup(props) {
177
- const { getting: gettingLandingPage, get: getLandingPage, entity: landingPage } = useCurrentLandingPage();
178
- const { get: getSecuritySettings, entity: securitySettings } = useCurrentSecuritySettings();
179
- const { isExtraSmall, isMobileSized } = useBreakpoints();
180
-
181
- const innerEmail = ref("");
182
- const innerPassword = ref("");
183
- const innerRememberMe = ref(false);
184
-
185
- const backgroundSize = computed((): { width: number | string, height: number | string } => {
186
- if (!gettingLandingPage && (!landingPage.value || !landingPage.value.bannerImageId)) {
187
- return { width: 0, height: 0 };
188
- }
189
- if (isExtraSmall.value) {
190
- return { width: 0, height: 0 };
191
- }
192
- if (isMobileSized.value) {
193
- return { width: "50%", height: "100vh" };
194
- }
195
- return { width: "60%", height: "100vh" };
196
- });
197
-
198
- const bannerSize = computed((): { width: number | string, height: number | string } => {
199
- if (!gettingLandingPage && (!landingPage.value || !landingPage.value.bannerImageId)) {
200
- return { width: 0, height: 0 };
201
- }
202
- if (isExtraSmall.value) {
203
- return { width: 240, height: 45 };
204
- }
205
- return { width: 360, height: 60 };
206
- });
207
-
208
- const formWidth = computed((): string => {
209
- if (!gettingLandingPage && (!landingPage.value || !landingPage.value.backgroundImageId)) {
210
- return "100%";
211
- }
212
- if (isExtraSmall.value) {
213
- return "100%";
214
- }
215
- if (isMobileSized.value) {
216
- return "50%";
217
- }
218
- return "40%";
219
- });
220
-
221
- const showDivider = computed((): boolean => {
222
- if (!securitySettings.value) {
223
- return true;
224
- }
225
- if (!securitySettings.value.useLocalAccounts) {
226
- return false;
227
- }
228
- if (!securitySettings.value.useGoogle && !securitySettings.value.useFacebook && !securitySettings.value.useMicrosoft) {
229
- return false;
230
- }
231
- return true;
232
- });
233
-
234
- onMounted(() => {
235
- getSecuritySettings();
236
- getLandingPage();
237
- });
238
-
239
- return {
240
- ColorEnum,
241
- securitySettings,
242
- landingPage,
243
- innerEmail,
244
- innerPassword,
245
- innerRememberMe,
246
- backgroundSize,
247
- bannerSize,
248
- formWidth,
249
- showDivider
250
- };
251
- }
252
- });
253
- </script>