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

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 (70) hide show
  1. package/components/FSButton.vue +1 -1
  2. package/components/FSCheckbox.vue +3 -3
  3. package/components/FSClock.vue +45 -30
  4. package/components/FSDivider.vue +46 -7
  5. package/components/FSForm.vue +52 -0
  6. package/components/FSImage.vue +41 -32
  7. package/components/FSLabel.vue +105 -0
  8. package/components/FSPagination.vue +25 -9
  9. package/components/FSPermissions.vue +0 -0
  10. package/components/FSRadio.vue +3 -3
  11. package/components/FSSubmitDialog.vue +1 -1
  12. package/components/FSSwitch.vue +3 -3
  13. package/components/FSText.vue +1 -1
  14. package/components/{FSAutocompleteField.vue → fields/FSAutocompleteField.vue} +18 -17
  15. package/components/fields/FSColorField.vue +194 -0
  16. package/components/{FSDateField.vue → fields/FSDateField.vue} +14 -49
  17. package/components/{FSDateRangeField.vue → fields/FSDateRangeField.vue} +18 -64
  18. package/components/{FSDateTimeField.vue → fields/FSDateTimeField.vue} +16 -51
  19. package/components/{FSDateTimeRangeField.vue → fields/FSDateTimeRangeField.vue} +23 -67
  20. package/components/{FSIconField.vue → fields/FSIconField.vue} +15 -50
  21. package/components/{FSNumberField.vue → fields/FSNumberField.vue} +0 -24
  22. package/components/{FSPasswordField.vue → fields/FSPasswordField.vue} +5 -29
  23. package/components/{FSRichTextField.vue → fields/FSRichTextField.vue} +3 -3
  24. package/components/{FSSearchField.vue → fields/FSSearchField.vue} +1 -1
  25. package/components/{FSSelectField.vue → fields/FSSelectField.vue} +17 -21
  26. package/components/{FSTagField.vue → fields/FSTagField.vue} +15 -50
  27. package/components/{FSTextArea.vue → fields/FSTextArea.vue} +24 -24
  28. package/components/{FSTextField.vue → fields/FSTextField.vue} +18 -18
  29. package/components/fields/FSTimeField.vue +104 -0
  30. package/components/fields/FSTimeSlotField.vue +263 -0
  31. package/components/lists/FSDataTableUI.vue +2 -2
  32. package/components/lists/FSFilterButton.vue +1 -1
  33. package/components/tiles/FSDeviceOrganisationTileUI.vue +4 -9
  34. package/components/tiles/FSGroupTileUI.vue +4 -9
  35. package/composables/index.ts +1 -0
  36. package/composables/useBreakpoints.ts +7 -5
  37. package/composables/useRules.ts +72 -0
  38. package/elements/FSFormElement.ts +17 -0
  39. package/icons/flags/France.vue +9 -0
  40. package/icons/flags/Germany.vue +7 -0
  41. package/icons/flags/GreatBritain.vue +9 -0
  42. package/icons/flags/Italy.vue +9 -0
  43. package/icons/flags/Portugal.vue +59 -0
  44. package/icons/flags/Spain.vue +546 -0
  45. package/icons/flags/UnitedStates.vue +12 -0
  46. package/icons/sets.ts +17 -0
  47. package/models/rules.ts +8 -0
  48. package/package.json +4 -4
  49. package/pages/FSExternalIdentityButton.vue +64 -0
  50. package/pages/FSLanguageSetter.vue +140 -0
  51. package/pages/FSLoginPage.vue +253 -0
  52. package/styles/components/fs_clock.scss +4 -0
  53. package/styles/components/fs_color_field.scss +17 -0
  54. package/styles/components/fs_divider.scss +5 -0
  55. package/styles/components/fs_image.scss +12 -1
  56. package/styles/components/fs_label.scss +86 -0
  57. package/styles/components/fs_pagination.scss +3 -3
  58. package/styles/components/fs_time_field.scss +3 -0
  59. package/styles/components/fs_timeslot_field.scss +75 -0
  60. package/styles/components/index.scss +4 -0
  61. package/styles/globals/text_fonts.scss +18 -0
  62. package/styles/main.scss +3 -1
  63. package/styles/pages/fs_language_setter.scss +55 -0
  64. package/styles/pages/index.scss +1 -0
  65. package/utils/color.ts +7 -0
  66. package/utils/css.ts +2 -1
  67. package/utils/index.ts +3 -1
  68. package/utils/time.ts +29 -0
  69. package/components/FSHeaderButton.vue +0 -17
  70. package/components/lists/FSDataIteratorGroup.vue +0 -7
@@ -1,11 +1,11 @@
1
- .fs-pagination {
1
+ .fs-pagination-page {
2
2
  height: 4px;
3
- min-width: 12%;
4
3
  border-radius: 4px;
4
+ min-width: var(--fs-pagination-page-width);
5
5
  background-color: var(--fs-pagination-background-color);
6
6
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
7
7
 
8
- &.fs-pagination-active {
8
+ &.fs-pagination-active-page {
9
9
  background-color: var(--fs-pagination-active-background-color);
10
10
  }
11
11
  }
@@ -0,0 +1,3 @@
1
+ .fs-time-field-select {
2
+ min-width: 180px;
3
+ }
@@ -0,0 +1,75 @@
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
+ .fs-time-slot-field-label {
61
+ color: var(--fs-time-slot-field-color);
62
+ }
63
+
64
+ .fs-time-slot-field-messages {
65
+ align-self: stretch;
66
+ color: var(--fs-time-slot-field-error-color);
67
+ }
68
+
69
+ .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;
75
+ }
@@ -8,6 +8,7 @@
8
8
  @import "fs_chip.scss";
9
9
  @import "fs_clock.scss";
10
10
  @import "fs_col.scss";
11
+ @import "fs_color_field.scss";
11
12
  @import "fs_color.scss";
12
13
  @import "fs_color_icon.scss";
13
14
  @import "fs_container.scss";
@@ -23,6 +24,7 @@
23
24
  @import "fs_icon_field.scss";
24
25
  @import "fs_icon.scss";
25
26
  @import "fs_image.scss";
27
+ @import "fs_label.scss";
26
28
  @import "fs_link.scss";
27
29
  @import "fs_load_data_table.scss";
28
30
  @import "fs_load_tile.scss";
@@ -44,5 +46,7 @@
44
46
  @import "fs_text_field.scss";
45
47
  @import "fs_text.scss";
46
48
  @import "fs_tile.scss";
49
+ @import "fs_time_field.scss";
50
+ @import "fs_timeslot_field.scss";
47
51
  @import "fs_tooltip.scss";
48
52
  @import "fs_wrap_group.scss";
@@ -56,6 +56,24 @@
56
56
  }
57
57
  }
58
58
 
59
+ .text-h4 {
60
+ font-family: 'Montserrat', sans-serif !important;
61
+ font-style: normal !important;
62
+ font-weight: 500 !important;
63
+
64
+ @include web {
65
+ font-size: 16px !important;
66
+ line-height: 20px !important;
67
+ letter-spacing: -0.48px !important;
68
+ }
69
+
70
+ @include mobile {
71
+ font-size: 14px !important;
72
+ line-height: 16px !important;
73
+ letter-spacing: -0.41px !important;
74
+ }
75
+ }
76
+
59
77
  .text-body {
60
78
  font-family: 'Montserrat', sans-serif !important;
61
79
  font-style: normal !important;
package/styles/main.scss CHANGED
@@ -1,3 +1,5 @@
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';
3
+ @import 'components/index.scss';
4
+
5
+ @import 'pages/index.scss';
@@ -0,0 +1,55 @@
1
+ .fs-load-language-setter {
2
+ @include web {
3
+ height: 40px;
4
+ max-width: 360px;
5
+ }
6
+ @include mobile {
7
+ height: 36px;
8
+ max-width: 360px;
9
+ }
10
+
11
+ & .v-skeleton-loader__image {
12
+ border-radius: 4px;
13
+ height: 100%;
14
+ width: 100%;
15
+ }
16
+ }
17
+
18
+ .fs-load-language-setter-icon {
19
+ @include mobile {
20
+ width: 72px;
21
+ }
22
+ @include web {
23
+ width: 76px;
24
+ }
25
+ }
26
+
27
+ .fs-language-setter {
28
+ & > .v-input__control > .v-field {
29
+ padding: 0px 8px 0px 12px !important;
30
+ gap: 0px;
31
+
32
+ & > .v-field__field > .v-field__input {
33
+ padding-top: 0px;
34
+ padding-bottom: 0px;
35
+
36
+ & > .v-select__selection {
37
+ height: 100% !important;
38
+
39
+ & > .fs-row > .v-icon {
40
+ padding-bottom: 2px;
41
+ }
42
+ }
43
+ }
44
+ }
45
+ }
46
+
47
+ .fs-language-setter-icon {
48
+ @include mobile {
49
+ width: 72px;
50
+ }
51
+
52
+ @include web {
53
+ width: 76px;
54
+ }
55
+ }
@@ -0,0 +1 @@
1
+ @import "./fs_language_setter.scss";
package/utils/color.ts ADDED
@@ -0,0 +1,7 @@
1
+ export const getPercentageFromHex = (hex: string): number => {
2
+ return parseInt(hex, 16) / 255;
3
+ }
4
+
5
+ export const getHexFromPercentage = (percentage: number): string => {
6
+ return Math.round(percentage * 255).toString(16).padStart(2, "0");
7
+ }
package/utils/css.ts CHANGED
@@ -2,7 +2,8 @@ export const sizeToVar = (value: string | number | null, nullValue: string = "fi
2
2
  if (value == null) {
3
3
  return nullValue;
4
4
  }
5
- return typeof value === 'string' ? value : `${value}${unit}`;
5
+
6
+ return typeof value === 'string' && isNaN(+value) ? value : `${value}${unit}`;
6
7
  };
7
8
 
8
9
  export const varToSize = (value: string): number => {
package/utils/index.ts CHANGED
@@ -1,5 +1,7 @@
1
+ export * from "./color";
1
2
  export * from "./css";
2
3
  export * from "./icons";
3
4
  export * from "./levenshtein";
4
5
  export * from "./lexical";
5
- export * from "./sort";
6
+ export * from "./sort";
7
+ export * from "./time";
package/utils/time.ts ADDED
@@ -0,0 +1,29 @@
1
+ import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
2
+
3
+ const { $tr } = useTranslationsProvider();
4
+
5
+ export const timeScale: any[] = [
6
+ { id: 1, label: $tr("ui.time-field.second.singular", "Second"), plural: $tr("ui.time-field.second.plural", "Seconds") },
7
+ { id: 60, label: $tr("ui.time-field.minute.singular", "Minute"), plural: $tr("ui.time-field.minute.plural", "Minutes") },
8
+ { id: 3600, label: $tr("ui.time-field.hour.singular", "Hour"), plural: $tr("ui.time-field.hour.plural", "Hours") },
9
+ { id: 86400, label: $tr("ui.time-field.day.singular", "Day"), plural: $tr("ui.time-field.day.plural", "Days") },
10
+ { id: 604800, label: $tr("ui.time-field.week.singular", "Week"), plural: $tr("ui.time-field.week.plural", "Weeks") },
11
+ ];
12
+
13
+ export const getTimeScaleIndex = (value: number): number => {
14
+ if (!value) {
15
+ return 0;
16
+ }
17
+ for (let i = timeScale.length - 1; i >= 0; i--) {
18
+ if (value % timeScale[i].id === 0) {
19
+ return i;
20
+ }
21
+ }
22
+ return 0;
23
+ };
24
+
25
+ export const getTimeBestString = (value: number): string => {
26
+ const unit = getTimeScaleIndex(value);
27
+ const figure = value / timeScale[unit].id;
28
+ return `${figure} ${figure === 1 ? timeScale[unit].label.toLowerCase() : timeScale[unit].plural.toLowerCaser()}`;
29
+ }
@@ -1,17 +0,0 @@
1
- <template>
2
-
3
- </template>
4
-
5
- <script lang="ts">
6
- import { defineComponent } from "vue";
7
-
8
- export default defineComponent({
9
- name: "FSHeaderButton",
10
- props: {
11
- },
12
- setup(props) {
13
- return {
14
- };
15
- }
16
- });
17
- </script>
@@ -1,7 +0,0 @@
1
- <template>
2
-
3
- </template>
4
-
5
- <script lang="ts">
6
-
7
- </script>