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

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 (140) 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/FSDataTableUI.vue +982 -0
  66. package/components/lists/FSFilterButton.vue +177 -0
  67. package/components/lists/FSHeaderButton.vue +99 -0
  68. package/components/lists/FSHiddenButton.vue +81 -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/index.ts +9 -0
  82. package/models/modelStatuses.ts +11 -0
  83. package/models/rules.ts +50 -0
  84. package/models/tables.ts +33 -0
  85. package/models/toggleSets.ts +7 -0
  86. package/package.json +6 -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 +21 -0
  106. package/styles/components/fs_header_button.scss +4 -0
  107. package/styles/components/fs_hidden_button.scss +12 -0
  108. package/styles/components/fs_icon.scss +19 -3
  109. package/styles/components/fs_icon_field.scss +12 -0
  110. package/styles/components/fs_image.scss +7 -0
  111. package/styles/components/fs_load_tile.scss +49 -0
  112. package/styles/components/fs_password_field.scss +2 -2
  113. package/styles/components/fs_row.scss +4 -1
  114. package/styles/components/fs_select_field.scss +71 -0
  115. package/styles/components/fs_slide_group.scss +6 -0
  116. package/styles/components/fs_slider.scss +29 -9
  117. package/styles/components/fs_span.scss +8 -0
  118. package/styles/components/fs_submit_dialog.scss +9 -0
  119. package/styles/components/fs_tabs.scss +4 -0
  120. package/styles/components/fs_tag_field.scss +0 -11
  121. package/styles/components/fs_text_field.scss +23 -15
  122. package/styles/components/fs_tile.scss +33 -0
  123. package/styles/components/fs_tooltip.scss +5 -0
  124. package/styles/components/fs_wrap_group.scss +7 -8
  125. package/styles/components/index.scss +22 -1
  126. package/styles/globals/breakpoints.scss +7 -0
  127. package/styles/globals/overrides.scss +20 -7
  128. package/styles/globals/text_fonts.scss +8 -8
  129. package/themes/default.ts +1 -11
  130. package/utils/css.ts +11 -0
  131. package/utils/icons.ts +75416 -0
  132. package/utils/index.ts +5 -1
  133. package/utils/levenshtein.ts +97 -0
  134. package/utils/sort.ts +9 -0
  135. package/components/FSDatePicker.vue +0 -226
  136. package/composables/useDates.ts +0 -39
  137. package/models/FSTags.ts +0 -8
  138. package/models/FSTextFields.ts +0 -23
  139. package/styles/components/fs_date_picker.scss +0 -0
  140. /package/utils/{FSRichTextField.ts → lexical.ts} +0 -0
@@ -1,109 +1,115 @@
1
1
  <template>
2
- <div
3
- :style="style"
4
- :class="classes"
5
- v-bind="$attrs"
6
- >
7
- <slot />
8
- </div>
2
+ <div
3
+ :style="style"
4
+ :class="classes"
5
+ v-bind="$attrs"
6
+ >
7
+ <slot />
8
+ </div>
9
9
  </template>
10
10
 
11
11
  <script lang="ts">
12
- import { computed, defineComponent, PropType, toRefs } from "vue";
12
+ import { computed, defineComponent, PropType } from "vue";
13
+
14
+ import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
13
15
 
14
16
  export default defineComponent({
15
- name: "FSCol",
16
- props: {
17
- width: {
18
- type: String as PropType<"hug" | "fill" | string>,
19
- required: false,
20
- default: "fill"
21
- },
22
- height: {
23
- type: String as PropType<"hug" | "fill" | string>,
24
- required: false,
25
- default: "hug"
26
- },
27
- align: {
28
- type: String as PropType<"top-left" | "top-center" | "top-right" | "center-left" | "center-center" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right">,
29
- required: false,
30
- default: "top-left"
31
- },
32
- gap: {
33
- type: Number,
34
- required: false,
35
- default: 8
36
- }
17
+ name: "FSCol",
18
+ props: {
19
+ width: {
20
+ type: String as PropType<"hug" | "fill" | string>,
21
+ required: false,
22
+ default: "fill"
37
23
  },
38
- setup(props) {
39
- const { width, height, align, gap } = toRefs(props);
40
-
41
- const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => ({
42
- "--fs-col-gap": `${gap.value}px`,
43
- "--fs-col-width": width.value,
44
- "--fs-col-height": height.value
45
- }));
24
+ height: {
25
+ type: String as PropType<"hug" | "fill" | string>,
26
+ required: false,
27
+ default: "hug"
28
+ },
29
+ align: {
30
+ type: String as PropType<"top-left" | "top-center" | "top-right" | "center-left" | "center-center" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right">,
31
+ required: false,
32
+ default: "top-left"
33
+ },
34
+ padding: {
35
+ type: [String, Number],
36
+ required: false,
37
+ default: "0"
38
+ },
39
+ gap: {
40
+ type: [String, Number],
41
+ required: false,
42
+ default: "8px"
43
+ }
44
+ },
45
+ setup(props) {
46
+ const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => ({
47
+ "--fs-col-padding": sizeToVar(props.padding),
48
+ "--fs-col-gap" : sizeToVar(props.gap),
49
+ "--fs-col-width" : sizeToVar(props.width),
50
+ "--fs-col-height" : sizeToVar(props.height)
51
+ }));
46
52
 
47
- const classes = computed((): string[] => {
48
- const classes = ["fs-col"];
49
- switch (width.value) {
50
- case "hug":
51
- classes.push("fs-col-width-hug");
52
- break;
53
- case "fill":
54
- classes.push("fs-col-width-fill");
55
- break;
56
- default:
57
- classes.push("fs-col-width-fixed");
58
- break;
59
- }
60
- switch (height.value) {
61
- case "hug":
62
- classes.push("fs-col-height-hug");
63
- break;
64
- case "fill":
65
- classes.push("fs-col-height-fill");
66
- break;
67
- default:
68
- classes.push("fs-col-height-fixed");
69
- break;
70
- }
71
- switch (align.value) {
72
- case "top-left":
73
- classes.push("fs-col-top-left");
74
- break;
75
- case "top-center":
76
- classes.push("fs-col-top-center");
77
- break;
78
- case "top-right":
79
- classes.push("fs-col-top-right");
80
- break;
81
- case "center-left":
82
- classes.push("fs-col-center-left");
83
- break;
84
- case "center-center":
85
- classes.push("fs-col-center-center");
86
- break;
87
- case "center-right":
88
- classes.push("fs-col-center-right");
89
- break;
90
- case "bottom-left":
91
- classes.push("fs-col-bottom-left");
92
- break;
93
- case "bottom-center":
94
- classes.push("fs-col-bottom-center");
95
- break;
96
- case "bottom-right":
97
- classes.push("fs-col-bottom-right");
98
- break;
99
- }
100
- return classes;
101
- });
53
+ const classes = computed((): string[] => {
54
+ const classNames = ["fs-col"];
55
+ switch (props.width) {
56
+ case "hug":
57
+ classNames.push("fs-col-width-hug");
58
+ break;
59
+ case "fill":
60
+ classNames.push("fs-col-width-fill");
61
+ break;
62
+ default:
63
+ classNames.push("fs-col-width-fixed");
64
+ break;
65
+ }
66
+ switch (props.height) {
67
+ case "hug":
68
+ classNames.push("fs-col-height-hug");
69
+ break;
70
+ case "fill":
71
+ classNames.push("fs-col-height-fill");
72
+ break;
73
+ default:
74
+ classNames.push("fs-col-height-fixed");
75
+ break;
76
+ }
77
+ switch (props.align) {
78
+ case "top-left":
79
+ classNames.push("fs-col-top-left");
80
+ break;
81
+ case "top-center":
82
+ classNames.push("fs-col-top-center");
83
+ break;
84
+ case "top-right":
85
+ classNames.push("fs-col-top-right");
86
+ break;
87
+ case "center-left":
88
+ classNames.push("fs-col-center-left");
89
+ break;
90
+ case "center-center":
91
+ classNames.push("fs-col-center-center");
92
+ break;
93
+ case "center-right":
94
+ classNames.push("fs-col-center-right");
95
+ break;
96
+ case "bottom-left":
97
+ classNames.push("fs-col-bottom-left");
98
+ break;
99
+ case "bottom-center":
100
+ classNames.push("fs-col-bottom-center");
101
+ break;
102
+ case "bottom-right":
103
+ classNames.push("fs-col-bottom-right");
104
+ break;
105
+ }
106
+ return classNames;
107
+ });
102
108
 
103
- return {
104
- style,
105
- classes
106
- };
107
- }
109
+ return {
110
+ style,
111
+ classes
112
+ };
113
+ }
108
114
  });
109
115
  </script>
@@ -1,80 +1,77 @@
1
1
  <template>
2
- <FSRow
3
- class="fs-color"
4
- :width="$props.width"
5
- :height="$props.height"
6
- :align="$props.align"
7
- :wrap="$props.wrap"
8
- :gap="$props.gap"
9
- :style="style"
10
- >
11
- <slot name="default" v-bind="{ color, colors }" />
12
- </FSRow>
2
+ <FSRow
3
+ class="fs-color"
4
+ :width="$props.width"
5
+ :height="$props.height"
6
+ :align="$props.align"
7
+ :wrap="$props.wrap"
8
+ :gap="$props.gap"
9
+ :style="style"
10
+ >
11
+ <slot v-bind="{ color: $props.color, colors }" />
12
+ </FSRow>
13
13
  </template>
14
14
 
15
15
  <script lang="ts">
16
- import { defineComponent, PropType, ref, Ref, toRefs } from "vue";
16
+ import { computed, defineComponent, PropType, ref, Ref } from "vue";
17
17
 
18
+ import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
18
19
  import { useColors } from "@dative-gpi/foundation-shared-components/composables";
19
- import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
20
20
 
21
21
  import FSRow from "./FSRow.vue";
22
22
 
23
23
  export default defineComponent({
24
- name: "FSColor",
25
- components: {
26
- FSRow
24
+ name: "FSColor",
25
+ components: {
26
+ FSRow
27
+ },
28
+ props: {
29
+ width: {
30
+ type: String as PropType<"hug" | "fill" | string>,
31
+ required: false,
32
+ default: "hug"
27
33
  },
28
- props: {
29
- width: {
30
- type: String as PropType<"hug" | "fill" | string>,
31
- required: false,
32
- default: "hug"
33
- },
34
- height: {
35
- type: String as PropType<"hug" | "fill" | string>,
36
- required: false,
37
- default: "hug"
38
- },
39
- align: {
40
- type: String as PropType<"top-left" | "top-center" | "top-right" | "center-left" | "center-center" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right">,
41
- required: false,
42
- default: "center-left"
43
- },
44
- wrap: {
45
- type: Boolean,
46
- required: false,
47
- default: true
48
- },
49
- gap: {
50
- type: Number,
51
- required: false,
52
- default: 8
53
- },
54
- color: {
55
- type: String as PropType<ColorBase | String>,
56
- required: false,
57
- default: ColorBase.Primary
58
- }
34
+ height: {
35
+ type: String as PropType<"hug" | "fill" | string>,
36
+ required: false,
37
+ default: "hug"
59
38
  },
60
- setup(props) {
61
- const { color } = toRefs(props);
62
-
63
- const colors = useColors().getColors(color.value);
39
+ align: {
40
+ type: String as PropType<"top-left" | "top-center" | "top-right" | "center-left" | "center-center" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right">,
41
+ required: false,
42
+ default: "center-left"
43
+ },
44
+ wrap: {
45
+ type: Boolean,
46
+ required: false,
47
+ default: true
48
+ },
49
+ gap: {
50
+ type: [String, Number],
51
+ required: false,
52
+ default: "8px"
53
+ },
54
+ color: {
55
+ type: String as PropType<ColorBase>,
56
+ required: false,
57
+ default: ColorEnum.Primary
58
+ }
59
+ },
60
+ setup(props) {
61
+ const colors = computed(() => useColors().getColors(props.color));
64
62
 
65
- const style: Ref<{ [code: string]: string } & Partial<CSSStyleDeclaration>> = ref({
66
- "--fs-color-background-color": colors.light,
67
- "--fs-color-color": colors.base,
68
- "--fs-color-light": colors.light,
69
- "--fs-color-base": colors.base,
70
- "--fs-color-dark": colors.dark
71
- });
63
+ const style: Ref<{ [code: string]: string } & Partial<CSSStyleDeclaration>> = ref({
64
+ "--fs-color-background-color": colors.value.light,
65
+ "--fs-color-color" : colors.value.base,
66
+ "--fs-color-light" : colors.value.light,
67
+ "--fs-color-base" : colors.value.base,
68
+ "--fs-color-dark" : colors.value.dark
69
+ });
72
70
 
73
- return {
74
- colors,
75
- color,
76
- style
77
- };
78
- }
71
+ return {
72
+ colors,
73
+ style
74
+ };
75
+ }
79
76
  });
80
77
  </script>
@@ -0,0 +1,67 @@
1
+ <template>
2
+ <v-icon
3
+ :color="$props.color"
4
+ :class="classes"
5
+ :style="style"
6
+ v-bind="$attrs"
7
+ >
8
+ <slot />
9
+ </v-icon>
10
+ </template>
11
+
12
+ <script lang="ts">
13
+ import { computed, defineComponent, PropType } from "vue";
14
+
15
+ import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
16
+ import { useColors } from "@dative-gpi/foundation-shared-components/composables";
17
+
18
+ export default defineComponent({
19
+ name: "FSColorIcon",
20
+ props: {
21
+ size: {
22
+ type: String as PropType<"s" | "m" | "l">,
23
+ required: false,
24
+ default: "m"
25
+ },
26
+ variant: {
27
+ type: String as PropType<"standard" | "fill">,
28
+ required: false,
29
+ default: "standard"
30
+ },
31
+ color: {
32
+ type: String as PropType<ColorBase>,
33
+ required: false,
34
+ default: ColorEnum.Dark
35
+ }
36
+ },
37
+ setup(props) {
38
+ const colors = computed(() => useColors().getColors(props.color));
39
+
40
+ const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
41
+ switch (props.variant) {
42
+ case "fill": return {
43
+ "--fs-icon-background-color": colors.value.light
44
+ };
45
+ default: return {
46
+ "--fs-icon-background-color": "transparent"
47
+ };
48
+ }
49
+ });
50
+
51
+ const classes = computed((): string[] => {
52
+ const classNames = [`fs-icon-${props.size}`];
53
+ switch (props.variant) {
54
+ case "fill":
55
+ classNames.push("fs-color-icon");
56
+ break;
57
+ }
58
+ return classNames;
59
+ });
60
+
61
+ return {
62
+ style,
63
+ classes
64
+ };
65
+ }
66
+ });
67
+ </script>
@@ -0,0 +1,64 @@
1
+ <template>
2
+ <div
3
+ :class="classes"
4
+ :style="style"
5
+ >
6
+ <slot />
7
+ </div>
8
+ </template>
9
+
10
+ <script lang="ts">
11
+ import { computed, defineComponent } from "vue";
12
+
13
+ import { useColors } from "@dative-gpi/foundation-shared-components/composables";
14
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
15
+
16
+ export default defineComponent({
17
+ name: "FSContainer",
18
+ props: {
19
+ padding: {
20
+ type: [String, Number],
21
+ required: false,
22
+ default: 8
23
+ },
24
+ border: {
25
+ type: Boolean,
26
+ required: false,
27
+ default: true
28
+ },
29
+ elevation: {
30
+ type: Boolean,
31
+ required: false,
32
+ default: false
33
+ }
34
+ },
35
+ setup(props) {
36
+ const backgrounds = useColors().getColors(ColorEnum.Background);
37
+ const lights = useColors().getColors(ColorEnum.Light);
38
+
39
+ const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
40
+ return {
41
+ "--fs-container-padding" : typeof(props.padding) === "string" ? props.padding : `${props.padding}px`,
42
+ "--fs-container-background-color": backgrounds.base,
43
+ "--fs-container-border-color" : lights.dark
44
+ };
45
+ });
46
+
47
+ const classes = computed((): string[] => {
48
+ const classNames = ["fs-container"];
49
+ if (props.border) {
50
+ classNames.push("fs-container-border");
51
+ }
52
+ if (props.elevation) {
53
+ classNames.push("fs-container-elevation");
54
+ }
55
+ return classNames;
56
+ });
57
+
58
+ return {
59
+ style,
60
+ classes
61
+ };
62
+ }
63
+ })
64
+ </script>