@dative-gpi/foundation-shared-components 0.0.7 → 0.0.9

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 (139) 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 +184 -0
  8. package/components/FSCalendarTwin.vue +412 -0
  9. package/components/FSCard.vue +77 -0
  10. package/components/FSCarousel.vue +63 -0
  11. package/components/FSCheckbox.vue +111 -104
  12. package/components/FSChip.vue +140 -0
  13. package/components/FSClock.vue +172 -0
  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 -99
  33. package/components/FSRadio.vue +107 -110
  34. package/components/FSRadioGroup.vue +55 -57
  35. package/components/FSRemoveDialog.vue +123 -0
  36. package/components/FSRichTextField.vue +551 -0
  37. package/components/FSRow.vue +110 -104
  38. package/components/FSSearchField.vue +114 -105
  39. package/components/FSSelectField.vue +188 -0
  40. package/components/FSSlideGroup.vue +45 -49
  41. package/components/FSSlider.vue +130 -0
  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 +183 -128
  49. package/components/FSTagGroup.vue +38 -45
  50. package/components/FSText.vue +74 -64
  51. package/components/FSTextArea.vue +209 -0
  52. package/components/FSTextField.vue +152 -149
  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/FSDataTable.vue +964 -0
  66. package/components/lists/FSFilterButton.vue +176 -0
  67. package/components/lists/FSHeaderButton.vue +99 -0
  68. package/components/lists/FSHiddenButton.vue +79 -0
  69. package/components/tiles/FSDeviceOrganisationTileUI.vue +232 -0
  70. package/components/tiles/FSGroupTileUI.vue +192 -0
  71. package/composables/index.ts +2 -1
  72. package/composables/useBreakpoints.ts +33 -0
  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/dispositions.ts +33 -0
  82. package/models/index.ts +9 -0
  83. package/models/modelStatuses.ts +11 -0
  84. package/models/rules.ts +50 -0
  85. package/models/toggleSets.ts +7 -0
  86. package/package.json +13 -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 -14
  91. package/styles/components/fs_calendar.scss +138 -0
  92. package/styles/components/fs_card.scss +4 -0
  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 +12 -0
  106. package/styles/components/fs_header_button.scss +4 -0
  107. package/styles/components/fs_icon.scss +14 -4
  108. package/styles/components/fs_icon_field.scss +12 -0
  109. package/styles/components/fs_image.scss +7 -0
  110. package/styles/components/fs_load_tile.scss +49 -0
  111. package/styles/components/fs_password_field.scss +2 -2
  112. package/styles/components/fs_rich_text_field.scss +67 -0
  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 +40 -0
  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 +6 -8
  121. package/styles/components/fs_text_area.scss +105 -0
  122. package/styles/components/fs_text_field.scss +23 -15
  123. package/styles/components/fs_tile.scss +33 -0
  124. package/styles/components/fs_tooltip.scss +5 -0
  125. package/styles/components/fs_wrap_group.scss +7 -8
  126. package/styles/components/index.scss +26 -0
  127. package/styles/globals/breakpoints.scss +7 -0
  128. package/styles/globals/overrides.scss +20 -7
  129. package/styles/globals/text_fonts.scss +8 -8
  130. package/themes/default.ts +1 -11
  131. package/utils/css.ts +11 -0
  132. package/utils/icons.ts +75416 -0
  133. package/utils/index.ts +5 -0
  134. package/utils/levenshtein.ts +97 -0
  135. package/utils/lexical.ts +27 -0
  136. package/utils/sort.ts +9 -0
  137. package/composables/useTouch.ts +0 -9
  138. package/models/FSTags.ts +0 -8
  139. package/models/FSTextFields.ts +0 -17
@@ -1,61 +1,57 @@
1
1
  <template>
2
- <v-slide-group
3
- class="fs-slide-group"
4
- show-arrows
5
- :style="style"
6
- v-bind="$attrs"
2
+ <v-slide-group
3
+ class="fs-slide-group"
4
+ :showArrows="true"
5
+ :style="style"
6
+ v-bind="$attrs"
7
+ >
8
+ <v-slide-group-item
9
+ v-for="(component, index) in getChildren()"
10
+ :key="index"
7
11
  >
8
- <FSRow>
9
- <v-slide-group-item v-for="(component, index) in $slots.default()" :key="index">
10
- <component :is="component" v-bind="{ color, colors, style }" />
11
- </v-slide-group-item>
12
- </FSRow>
13
- </v-slide-group>
12
+ <component :is="component" />
13
+ </v-slide-group-item>
14
+ </v-slide-group>
14
15
  </template>
15
16
 
16
17
  <script lang="ts">
17
- import { defineComponent, PropType, Ref, ref, toRefs } from "vue";
18
+ import { computed, defineComponent } from "vue";
18
19
 
19
- import { useColors } from "@dative-gpi/foundation-shared-components/composables";
20
- import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
21
-
22
- import FSRow from "./FSRow.vue";
20
+ import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
21
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
23
22
 
24
23
  export default defineComponent({
25
- name: "FSSlideGroup",
26
- components: {
27
- FSRow
28
- },
29
- props: {
30
- color: {
31
- type: String as PropType<ColorBase>,
32
- required: false,
33
- default: ColorBase.Primary
34
- }
24
+ name: "FSSlideGroup",
25
+ props: {
26
+ padding: {
27
+ type: [String, Number],
28
+ required: false,
29
+ default: 0
35
30
  },
36
- setup(props) {
37
- const { color } = toRefs(props);
38
-
39
- const textColors = useColors().getContrasts(color.value);
40
- const colors = useColors().getColors(color.value);
41
-
42
- const darks = useColors().getColors(ColorBase.Dark);
43
-
44
- const style: Ref<{ [code: string]: string } & Partial<CSSStyleDeclaration>> = ref({
45
- "--fs-group-color": darks.base,
46
- "--fs-group-hover-background-color": colors.light,
47
- "--fs-group-hover-color": darks.dark,
48
- "--fs-group-disabled-color": darks.light,
49
- "--fs-group-light": colors.light,
50
- "--fs-group-base": colors.base,
51
- "--fs-group-dark": colors.dark
52
- });
53
-
54
- return {
55
- color,
56
- colors,
57
- style
58
- };
31
+ gap: {
32
+ type: Number,
33
+ required: false,
34
+ default: 8
59
35
  }
36
+ },
37
+ setup(props) {
38
+ const { getChildren } = useSlots();
39
+
40
+ const darks = useColors().getColors(ColorEnum.Dark);
41
+
42
+ const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
43
+ return {
44
+ "--fs-group-padding" : typeof(props.padding) === "string" ? props.padding : `${props.padding}px`,
45
+ "--fs-group-gap" : `${props.gap}px`,
46
+ "--fs-group-color" : darks.light,
47
+ "--fs-group-hover-color": darks.dark
48
+ }
49
+ });
50
+
51
+ return {
52
+ style,
53
+ getChildren
54
+ };
55
+ }
60
56
  });
61
57
  </script>
@@ -0,0 +1,130 @@
1
+ <template>
2
+ <FSCol>
3
+ <slot name="label">
4
+ <FSRow :wrap="false">
5
+ <FSSpan
6
+ v-if="$props.label"
7
+ class="fs-slider-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-slider-label"
16
+ style="margin-left: -8px;"
17
+ font="text-overline"
18
+ :ellipsis="false"
19
+ :style="style"
20
+ >
21
+ *
22
+ </FSSpan>
23
+ </FSRow>
24
+ </slot>
25
+ <v-slider
26
+ class="fs-slider"
27
+ hide-details
28
+ :tickSize="4"
29
+ :style="style"
30
+ :elevation="0"
31
+ :ripple="false"
32
+ :disabled="!$props.editable"
33
+ :modelValue="$props.modelValue"
34
+ @update:modelValue="(value) => $emit('update:modelValue', value)"
35
+ v-bind="$attrs"
36
+ >
37
+ <template v-for="(_, name) in $slots" v-slot:[name]="slotData">
38
+ <slot :name="name" v-bind="slotData" />
39
+ </template>
40
+ </v-slider>
41
+ <slot name="description">
42
+ <FSSpan
43
+ v-if="$props.description"
44
+ class="fs-slider-description"
45
+ font="text-underline"
46
+ :style="style"
47
+ >
48
+ {{ $props.description }}
49
+ </FSSpan>
50
+ </slot>
51
+ </FSCol>
52
+ </template>
53
+
54
+ <script lang="ts">
55
+ import { computed, defineComponent, PropType } from "vue";
56
+
57
+ import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
58
+ import { useColors } from "@dative-gpi/foundation-shared-components/composables";
59
+
60
+ import FSSpan from "./FSSpan.vue";
61
+ import FSCol from "./FSCol.vue";
62
+ import FSRow from "./FSRow.vue";
63
+
64
+ export default defineComponent({
65
+ name: "FSSlider",
66
+ components: {
67
+ FSSpan,
68
+ FSCol,
69
+ FSRow
70
+ },
71
+ props: {
72
+ label: {
73
+ type: String,
74
+ required: false,
75
+ default: null
76
+ },
77
+ description: {
78
+ type: String,
79
+ required: false,
80
+ default: null
81
+ },
82
+ modelValue: {
83
+ type: [String, Number],
84
+ required: false,
85
+ default: null
86
+ },
87
+ color: {
88
+ type: String as PropType<ColorBase>,
89
+ required: false,
90
+ default: ColorEnum.Dark
91
+ },
92
+ required: {
93
+ type: Boolean,
94
+ required: false,
95
+ default: false
96
+ },
97
+ editable: {
98
+ type: Boolean,
99
+ required: false,
100
+ default: true
101
+ }
102
+ },
103
+ setup(props) {
104
+ const colors = computed(() => useColors().getColors(props.color));
105
+ const lights = useColors().getColors(ColorEnum.Light);
106
+ const darks = useColors().getColors(ColorEnum.Dark);
107
+
108
+ const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
109
+ if (!props.editable) {
110
+ return {
111
+ "--fs-slider-cursor" : "default",
112
+ "--fs-slider-track-color": lights.base,
113
+ "--fs-slider-thumb-color": lights.base,
114
+ "--fs-slider-color" : lights.dark
115
+ };
116
+ }
117
+ return {
118
+ "--fs-slider-cursor" : "pointer",
119
+ "--fs-slider-track-color": colors.value.light,
120
+ "--fs-slider-thumb-color": colors.value.base,
121
+ "--fs-slider-color" : darks.base
122
+ };
123
+ });
124
+
125
+ return {
126
+ style
127
+ };
128
+ }
129
+ });
130
+ </script>
@@ -1,48 +1,64 @@
1
1
  <template>
2
- <span
3
- :class="classes"
4
- v-bind="$attrs"
5
- >
6
- <slot />
7
- </span>
2
+ <span
3
+ :class="classes"
4
+ :style="style"
5
+ v-bind="$attrs"
6
+ >
7
+ <slot />
8
+ </span>
8
9
  </template>
9
10
 
10
11
  <script lang="ts">
11
- import { computed, defineComponent, PropType, toRefs, useSlots } from "vue";
12
+ import { computed, defineComponent, PropType } from "vue";
13
+
14
+ import { useSlots } from "@dative-gpi/foundation-shared-components/composables";
12
15
 
13
16
  export default defineComponent({
14
- name: "FSSpan",
15
- props: {
16
- font: {
17
- type: String as PropType<"text-h1" | "text-h2" | "text-h3" | "text-body" | "text-button" | "text-overline" | "text-underline">,
18
- required: false,
19
- default: "text-body"
20
- },
21
- ellipsis: {
22
- type: Boolean,
23
- required: false,
24
- default: true
25
- }
17
+ name: "FSSpan",
18
+ props: {
19
+ font: {
20
+ type: String as PropType<"text-h1" | "text-h2" | "text-h3" | "text-body" | "text-button" | "text-overline" | "text-underline">,
21
+ required: false,
22
+ default: "text-body"
23
+ },
24
+ lineClamp: {
25
+ type: Number,
26
+ required: false,
27
+ default: 1
26
28
  },
27
- setup(props) {
28
- const { font } = toRefs(props);
29
-
30
- const slots = useSlots();
29
+ ellipsis: {
30
+ type: Boolean,
31
+ required: false,
32
+ default: true
33
+ }
34
+ },
35
+ setup(props) {
36
+ const { slots } = useSlots();
31
37
 
32
- const classes = computed((): string[] => {
33
- const classes = ["fs-span", font.value];
34
- if (props.ellipsis) {
35
- classes.push("fs-span-ellipsis");
36
- }
37
- if (!slots.default) {
38
- classes.push("fs-span-pre-wrap");
39
- }
40
- return classes;
41
- });
38
+ const classes = computed((): string[] => {
39
+ const classNames = ["fs-span", props.font];
40
+ if (!slots.default) {
41
+ classNames.push("fs-span-pre-wrap");
42
+ }
43
+ if (props.lineClamp > 1) {
44
+ classNames.push("fs-span-line-clamp");
45
+ }
46
+ else if (props.ellipsis) {
47
+ classNames.push("fs-span-ellipsis");
48
+ }
49
+ return classNames;
50
+ });
42
51
 
43
- return {
44
- classes
45
- };
46
- }
52
+ const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
53
+ return {
54
+ "--fs-span-line-clamp": props.lineClamp.toString()
55
+ };
56
+ });
57
+
58
+ return {
59
+ classes,
60
+ style
61
+ };
62
+ }
47
63
  });
48
64
  </script>
@@ -0,0 +1,165 @@
1
+ <template>
2
+ <FSDialog
3
+ cardClasses="fs-submit-dialog"
4
+ :width="$props.width"
5
+ :modelValue="$props.modelValue"
6
+ @update:modelValue="$emit('update:modelValue', $event)"
7
+ v-bind="$attrs"
8
+ >
9
+ <template #header>
10
+ <slot name="header">
11
+ <FSCol v-if="$props.title">
12
+ <FSSpan font="text-h2">
13
+ {{ $props.title }}
14
+ </FSSpan>
15
+ <FSSpan v-if="$props.subtitle">
16
+ {{ $props.subtitle }}
17
+ </FSSpan>
18
+ </FSCol>
19
+ </slot>
20
+ </template>
21
+ <template #body>
22
+ <slot name="body" />
23
+ </template>
24
+ <template #footer>
25
+ <slot name="footer">
26
+ <FSRow
27
+ class="fs-submit-dialog-actions"
28
+ align="top-right"
29
+ :wrap="false"
30
+ >
31
+ <FSButton
32
+ :prependIcon="$props.leftButtonPrependIcon"
33
+ :label="cancelButtonLabel"
34
+ :appendIcon="$props.leftButtonAppendIcon"
35
+ :variant="$props.leftButtonVariant"
36
+ :color="$props.leftButtonColor"
37
+ @click="() => $emit('update:modelValue', false)"
38
+ />
39
+ <FSButton
40
+ :prependIcon="$props.rightButtonPrependIcon"
41
+ :label="submitButtonLabel"
42
+ :appendIcon="$props.rightButtonAppendIcon"
43
+ :variant="$props.rightButtonVariant"
44
+ :color="$props.rightButtonColor"
45
+ :editable="$props.editable"
46
+ @click="() => $emit('click:rightButton')"
47
+ />
48
+ </FSRow>
49
+ </slot>
50
+ </template>
51
+ </FSDialog>
52
+ </template>
53
+
54
+ <script lang="ts">
55
+ import { computed, defineComponent, PropType } from "vue";
56
+
57
+ import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
58
+ import { useTranslationsProvider } from "@dative-gpi/foundation-shared-services";
59
+
60
+ import FSDialog from "./FSDialog.vue";
61
+ import FSRow from "./FSRow.vue";
62
+
63
+ export default defineComponent({
64
+ name: "FSSubmitDialog",
65
+ components: {
66
+ FSDialog,
67
+ FSRow
68
+ },
69
+ props: {
70
+ modelValue: {
71
+ type: Boolean,
72
+ required: false,
73
+ default: false
74
+ },
75
+ width: {
76
+ type: [String, Number],
77
+ required: false,
78
+ default: "auto"
79
+ },
80
+ title: {
81
+ type: String,
82
+ required: false,
83
+ default: null
84
+ },
85
+ subtitle: {
86
+ type: String,
87
+ required: false,
88
+ default: null
89
+ },
90
+ leftButtonPrependIcon: {
91
+ type: String,
92
+ required: false,
93
+ default: null
94
+ },
95
+ leftButtonLabel: {
96
+ type: String,
97
+ required: false,
98
+ default: null
99
+ },
100
+ leftButtonAppendIcon: {
101
+ type: String,
102
+ required: false,
103
+ default: null
104
+ },
105
+ leftButtonVariant: {
106
+ type: String as PropType<"standard" | "full" | "icon">,
107
+ required: false,
108
+ default: "standard"
109
+ },
110
+ rightButtonPrependIcon: {
111
+ type: String,
112
+ required: false,
113
+ default: null
114
+ },
115
+ rightButtonLabel: {
116
+ type: String,
117
+ required: false,
118
+ default: null
119
+ },
120
+ rightButtonAppendIcon: {
121
+ type: String,
122
+ required: false,
123
+ default: null
124
+ },
125
+ rightButtonVariant: {
126
+ type: String as PropType<"standard" | "full" | "icon">,
127
+ required: false,
128
+ default: "full"
129
+ },
130
+ leftButtonColor: {
131
+ type: String as PropType<ColorBase>,
132
+ required: false,
133
+ default: ColorEnum.Light
134
+ },
135
+ rightButtonColor: {
136
+ type: String as PropType<ColorBase>,
137
+ required: false,
138
+ default: ColorEnum.Primary
139
+ },
140
+ editable: {
141
+ type: Boolean,
142
+ required: false,
143
+ default: true
144
+ }
145
+ },
146
+ emits: ["update:modelValue"],
147
+ setup(props) {
148
+ const { $tr } = useTranslationsProvider();
149
+
150
+ const cancelButtonLabel = computed(() => {
151
+ return props.leftButtonLabel ?? $tr("ui.button.cancel", "Cancel");
152
+ });
153
+
154
+ const submitButtonLabel = computed(() => {
155
+ return props.rightButtonLabel ?? $tr("ui.button.validate", "Validate");
156
+ });
157
+
158
+ return {
159
+ ColorEnum,
160
+ cancelButtonLabel,
161
+ submitButtonLabel
162
+ };
163
+ }
164
+ });
165
+ </script>