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

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 (60) hide show
  1. package/aliases/FSButton.ts +8 -6
  2. package/components/FSAutocompleteField.vue +7 -5
  3. package/components/FSBreadcrumbs.vue +3 -1
  4. package/components/FSButton.vue +12 -9
  5. package/components/FSCalendar.vue +4 -3
  6. package/components/FSCalendarTwin.vue +4 -3
  7. package/components/FSCarousel.vue +3 -1
  8. package/components/FSCheckbox.vue +5 -3
  9. package/components/FSChip.vue +5 -3
  10. package/components/FSClock.vue +5 -4
  11. package/components/FSColor.vue +3 -1
  12. package/components/FSColorIcon.vue +3 -1
  13. package/components/FSContainer.vue +4 -2
  14. package/components/FSDateField.vue +4 -3
  15. package/components/FSDateRangeField.vue +4 -3
  16. package/components/FSDateTimeField.vue +4 -3
  17. package/components/FSDateTimeRangeField.vue +4 -3
  18. package/components/FSDivider.vue +3 -1
  19. package/components/FSFadeOut.vue +3 -1
  20. package/components/FSFileButton.vue +4 -3
  21. package/components/FSIconField.vue +5 -3
  22. package/components/FSImage.vue +1 -1
  23. package/components/FSLink.vue +95 -0
  24. package/components/FSPagination.vue +80 -0
  25. package/components/FSPasswordField.vue +4 -2
  26. package/components/FSRadio.vue +5 -3
  27. package/components/FSRemoveDialog.vue +1 -1
  28. package/components/FSRichTextField.vue +7 -6
  29. package/components/FSSearchField.vue +46 -13
  30. package/components/FSSelectField.vue +5 -3
  31. package/components/FSSlideGroup.vue +2 -1
  32. package/components/FSSlider.vue +5 -3
  33. package/components/FSSubmitDialog.vue +1 -1
  34. package/components/FSSwitch.vue +6 -4
  35. package/components/FSTabs.vue +4 -3
  36. package/components/FSTag.vue +4 -2
  37. package/components/FSTagField.vue +4 -3
  38. package/components/FSText.vue +2 -1
  39. package/components/FSTextArea.vue +4 -3
  40. package/components/FSTextField.vue +5 -3
  41. package/components/FSWrapGroup.vue +2 -1
  42. package/components/deviceOrganisations/FSConnectivity.vue +2 -1
  43. package/components/deviceOrganisations/FSWorstAlert.vue +2 -1
  44. package/components/lists/FSDataTableUI.vue +5 -4
  45. package/components/lists/FSFilterButton.vue +24 -16
  46. package/components/lists/FSHiddenButton.vue +1 -0
  47. package/components/lists/FSLoadDataTable.vue +88 -0
  48. package/components/tiles/FSDeviceOrganisationTileUI.vue +1 -1
  49. package/components/tiles/FSGroupTileUI.vue +1 -1
  50. package/components/{FSLoadTile.vue → tiles/FSLoadTile.vue} +9 -7
  51. package/components/{FSTile.vue → tiles/FSTile.vue} +5 -4
  52. package/composables/index.ts +1 -0
  53. package/composables/useDebounce.ts +22 -0
  54. package/models/rules.ts +2 -1
  55. package/package.json +6 -4
  56. package/styles/components/fs_link.scss +6 -0
  57. package/styles/components/fs_load_data_table.scss +77 -0
  58. package/styles/components/fs_pagination.scss +11 -0
  59. package/styles/components/index.scss +3 -0
  60. package/index.ts +0 -6
@@ -1,10 +1,12 @@
1
- import { useTranslationsProvider } from "@dative-gpi/foundation-shared-services";
1
+ import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
2
2
  import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
3
3
 
4
4
  import FSButton from "@dative-gpi/foundation-shared-components/components/FSButton.vue";
5
5
 
6
6
  const { $tr } = useTranslationsProvider();
7
7
 
8
+ import { computed } from "vue";
9
+
8
10
  export const FSButtonsAliases = {
9
11
  FSButtonSearch: FSButton,
10
12
  FSButtonSearchMini: FSButton,
@@ -23,7 +25,7 @@ export const FSButtonsAliases = {
23
25
  export const FSButtonsProps = {
24
26
  FSButtonSearch: {
25
27
  prependIcon: "mdi-magnify",
26
- label: $tr("ui.button.search", "Search"),
28
+ get label() { return $tr("ui.button.search", "Search") },
27
29
  variant: "standard",
28
30
  color: ColorEnum.Primary
29
31
  },
@@ -41,7 +43,7 @@ export const FSButtonsProps = {
41
43
  },
42
44
  FSButtonRemove: {
43
45
  prependIcon: "mdi-delete-outline",
44
- label: $tr("ui.button.remove", "Remove"),
46
+ get label() { return $tr("ui.button.remove", "Remove") },
45
47
  variant: "standard",
46
48
  color: ColorEnum.Error
47
49
  },
@@ -59,7 +61,7 @@ export const FSButtonsProps = {
59
61
  },
60
62
  FSButtonSave: {
61
63
  prependIcon: "mdi-content-save-outline",
62
- label: $tr("ui.button.save", "Save"),
64
+ get label() { return $tr("ui.button.save", "Save") },
63
65
  variant: "standard",
64
66
  color: ColorEnum.Primary
65
67
  },
@@ -77,7 +79,7 @@ export const FSButtonsProps = {
77
79
  },
78
80
  FSButtonCancel: {
79
81
  prependIcon: "mdi-cancel",
80
- label: $tr("ui.button.cancel", "Cancel"),
82
+ get label() { return $tr("ui.button.cancel", "Cancel") },
81
83
  variant: "standard",
82
84
  color: ColorEnum.Light
83
85
  },
@@ -95,7 +97,7 @@ export const FSButtonsProps = {
95
97
  },
96
98
  FSButtonDocumentation: {
97
99
  prependIcon: "mdi-file-document-outline",
98
- label: $tr("ui.button.documentation", "Documentation"),
100
+ get label() { return $tr("ui.button.documentation", "Documentation") },
99
101
  variant: "standard",
100
102
  color: ColorEnum.Light
101
103
  },
@@ -142,16 +142,18 @@ export default defineComponent({
142
142
  }
143
143
  },
144
144
  emits: ["update:modelValue", "update:search"],
145
- setup: (props, { emit }) => {
145
+ setup: (props, { emit }) => {
146
+ const { getColors } = useColors();
146
147
  const { slots } = useSlots();
148
+
147
149
  delete slots.label;
148
150
  delete slots.description;
149
151
 
150
- const innerSearch = ref("");
152
+ const errors = getColors(ColorEnum.Error);
153
+ const lights = getColors(ColorEnum.Light);
154
+ const darks = getColors(ColorEnum.Dark);
151
155
 
152
- const errors = useColors().getColors(ColorEnum.Error);
153
- const lights = useColors().getColors(ColorEnum.Light);
154
- const darks = useColors().getColors(ColorEnum.Dark);
156
+ const innerSearch = ref("");
155
157
 
156
158
  const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
157
159
  if (!props.editable) {
@@ -38,7 +38,9 @@ export default defineComponent({
38
38
  }
39
39
  },
40
40
  setup() {
41
- const darks = useColors().getColors(ColorEnum.Dark);
41
+ const { getColors } = useColors();
42
+
43
+ const darks = getColors(ColorEnum.Dark);
42
44
 
43
45
  const style: Ref<{ [code: string]: string } & Partial<CSSStyleDeclaration>> = ref({
44
46
  "--fs-breadcrumbs-color": darks.dark,
@@ -84,7 +84,7 @@ export default defineComponent({
84
84
  default: null
85
85
  },
86
86
  label: {
87
- type: String,
87
+ type: [String, Function],
88
88
  required: false,
89
89
  default: null
90
90
  },
@@ -120,14 +120,16 @@ export default defineComponent({
120
120
  }
121
121
  },
122
122
  setup(props) {
123
- props = useDefaults(props, getCurrentInstance().type.name)
124
-
125
- const textColors = computed(() => useColors().getContrasts(props.color));
126
- const colors = computed(() => useColors().getColors(props.color));
127
- const lights = useColors().getColors(ColorEnum.Light);
123
+ props = useDefaults(props, getCurrentInstance()?.type?.name ?? "FSButton");
128
124
 
125
+ const { getColors, getContrasts } = useColors();
129
126
  const { slots } = useSlots();
130
127
 
128
+ const textColors = computed(() => getContrasts(props.color));
129
+ const colors = computed(() => getColors(props.color));
130
+ const lights = getColors(ColorEnum.Light);
131
+ const darks = getColors(ColorEnum.Dark);
132
+
131
133
  const isEmpty = computed(() => {
132
134
  return !slots.default && !props.label;
133
135
  });
@@ -173,9 +175,10 @@ export default defineComponent({
173
175
  "--fs-button-active-color" : textColors.value.light,
174
176
  };
175
177
  case "icon": switch (props.color) {
176
- case ColorEnum.Dark: return {
177
- "--fs-button-color" : colors.value.light,
178
- "--fs-button-hover-color": colors.value.dark,
178
+ case ColorEnum.Dark:
179
+ case ColorEnum.Light: return {
180
+ "--fs-button-color" : darks.base,
181
+ "--fs-button-hover-color": darks.dark,
179
182
  };
180
183
  default: return {
181
184
  "--fs-button-color" : colors.value.base,
@@ -105,10 +105,11 @@ export default defineComponent({
105
105
  setup(props) {
106
106
  const { epochToPicker, pickerToEpoch, todayToEpoch } = useTimeZone();
107
107
  const { languageCode } = useLanguageCode();
108
+ const { getColors } = useColors();
108
109
 
109
- const colors = computed(() => useColors().getColors(props.color));
110
- const backgrounds = useColors().getColors(ColorEnum.Background);
111
- const darks = useColors().getColors(ColorEnum.Dark);
110
+ const colors = computed(() => getColors(props.color));
111
+ const backgrounds = getColors(ColorEnum.Background);
112
+ const darks = getColors(ColorEnum.Dark);
112
113
 
113
114
  const innerMonth = ref(props.modelValue ? epochToPicker(props.modelValue).getMonth() : new Date().getMonth());
114
115
  const innerYear = ref(props.modelValue ? epochToPicker(props.modelValue).getFullYear() : new Date().getFullYear());
@@ -143,10 +143,11 @@ export default defineComponent({
143
143
  setup(props, { emit }) {
144
144
  const { epochToPicker, epochToPickerHeader, pickerToEpoch, todayToEpoch } = useTimeZone();
145
145
  const { languageCode } = useLanguageCode();
146
+ const { getColors } = useColors();
146
147
 
147
- const colors = computed(() => useColors().getColors(props.color));
148
- const backgrounds = useColors().getColors(ColorEnum.Background);
149
- const darks = useColors().getColors(ColorEnum.Dark);
148
+ const colors = computed(() => getColors(props.color));
149
+ const backgrounds = getColors(ColorEnum.Background);
150
+ const darks = getColors(ColorEnum.Dark);
150
151
 
151
152
  const innerLeftMonth = ref(new Date().getMonth());
152
153
  const innerLeftYear = ref(new Date().getFullYear());
@@ -37,9 +37,11 @@ export default defineComponent({
37
37
  },
38
38
  setup(props) {
39
39
  const { slots, getChildren } = useSlots();
40
+ const { getColors } = useColors();
41
+
40
42
  delete slots.default;
41
43
 
42
- const backgrounds = useColors().getColors(ColorEnum.Background);
44
+ const backgrounds = getColors(ColorEnum.Background);
43
45
 
44
46
  const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
45
47
  return {
@@ -92,9 +92,11 @@ export default defineComponent({
92
92
  },
93
93
  emits: ["update:modelValue"],
94
94
  setup(props, { emit }) {
95
- const colors = computed(() => useColors().getColors(props.color));
96
- const lights = useColors().getColors(ColorEnum.Light);
97
- const darks = useColors().getColors(ColorEnum.Dark);
95
+ const { getColors } = useColors();
96
+
97
+ const colors = computed(() => getColors(props.color));
98
+ const lights = getColors(ColorEnum.Light);
99
+ const darks = getColors(ColorEnum.Dark);
98
100
 
99
101
  const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
100
102
  if (!props.editable) {
@@ -85,13 +85,15 @@ export default defineComponent({
85
85
  }
86
86
  },
87
87
  setup(props) {
88
- const colors = computed(() => useColors().getColors(props.color));
89
- const backgrounds = useColors().getColors(ColorEnum.Background);
88
+ const { getColors, getContrasts } = useColors();
89
+
90
+ const colors = computed(() => getColors(props.color));
91
+ const backgrounds = getColors(ColorEnum.Background);
90
92
 
91
93
  const textColors = computed(() => {
92
94
  switch (props.variant) {
93
95
  case "standard": return colors.value;
94
- case "full": return useColors().getContrasts(props.color);
96
+ case "full": return getContrasts(props.color);
95
97
  }
96
98
  });
97
99
 
@@ -117,11 +117,12 @@ export default defineComponent({
117
117
  emits: ["update:modelValue"],
118
118
  setup(props, { emit }) {
119
119
  const { epochToLongDateFormat } = useTimeZone();
120
+ const { getColors } = useColors();
120
121
 
121
- const colors = computed(() => useColors().getColors(props.color));
122
- const backgrounds = useColors().getColors(ColorEnum.Background);
123
- const lights = useColors().getColors(ColorEnum.Light);
124
- const darks = useColors().getColors(ColorEnum.Dark);
122
+ const colors = computed(() => getColors(props.color));
123
+ const backgrounds = getColors(ColorEnum.Background);
124
+ const lights = getColors(ColorEnum.Light);
125
+ const darks = getColors(ColorEnum.Dark);
125
126
 
126
127
  const innerHours = ref(props.modelValue ? Math.floor(props.modelValue / (60 * 60 * 1000)) : 0);
127
128
  const innerMinutes = ref(props.modelValue ? Math.floor((props.modelValue % (60 * 60 * 1000)) / (60 * 1000)) : 0);
@@ -58,7 +58,9 @@ export default defineComponent({
58
58
  }
59
59
  },
60
60
  setup(props) {
61
- const colors = computed(() => useColors().getColors(props.color));
61
+ const { getColors } = useColors();
62
+
63
+ const colors = computed(() => getColors(props.color));
62
64
 
63
65
  const style: Ref<{ [code: string]: string } & Partial<CSSStyleDeclaration>> = ref({
64
66
  "--fs-color-background-color": colors.value.light,
@@ -35,7 +35,9 @@ export default defineComponent({
35
35
  }
36
36
  },
37
37
  setup(props) {
38
- const colors = computed(() => useColors().getColors(props.color));
38
+ const { getColors } = useColors();
39
+
40
+ const colors = computed(() => getColors(props.color));
39
41
 
40
42
  const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
41
43
  switch (props.variant) {
@@ -33,8 +33,10 @@ export default defineComponent({
33
33
  }
34
34
  },
35
35
  setup(props) {
36
- const backgrounds = useColors().getColors(ColorEnum.Background);
37
- const lights = useColors().getColors(ColorEnum.Light);
36
+ const { getColors } = useColors();
37
+
38
+ const backgrounds = getColors(ColorEnum.Background);
39
+ const lights = getColors(ColorEnum.Light);
38
40
 
39
41
  const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
40
42
  return {
@@ -155,10 +155,11 @@ export default defineComponent({
155
155
  emits: ["update:modelValue"],
156
156
  setup(props, { emit }) {
157
157
  const { epochToLongDateFormat } = useTimeZone();
158
+ const { getColors } = useColors();
158
159
 
159
- const errors = useColors().getColors(ColorEnum.Error);
160
- const lights = useColors().getColors(ColorEnum.Light);
161
- const darks = useColors().getColors(ColorEnum.Dark);
160
+ const errors = getColors(ColorEnum.Error);
161
+ const lights = getColors(ColorEnum.Light);
162
+ const darks = getColors(ColorEnum.Dark);
162
163
 
163
164
  const menu = ref(false);
164
165
  const innerDate = ref(props.modelValue);
@@ -144,10 +144,11 @@ export default defineComponent({
144
144
  emits: ["update:modelValue"],
145
145
  setup(props, { emit }) {
146
146
  const { epochToShortDateFormat } = useTimeZone();
147
+ const { getColors } = useColors();
147
148
 
148
- const errors = useColors().getColors(ColorEnum.Error);
149
- const lights = useColors().getColors(ColorEnum.Light);
150
- const darks = useColors().getColors(ColorEnum.Dark);
149
+ const errors = getColors(ColorEnum.Error);
150
+ const lights = getColors(ColorEnum.Light);
151
+ const darks = getColors(ColorEnum.Dark);
151
152
 
152
153
  const dialog = ref(false);
153
154
  const innerDateRange = ref(props.modelValue);
@@ -183,10 +183,11 @@ export default defineComponent({
183
183
  emits: ["update:modelValue"],
184
184
  setup(props, { emit }) {
185
185
  const { getUserOffsetMillis, epochToLongTimeFormat } = useTimeZone();
186
+ const { getColors } = useColors();
186
187
 
187
- const errors = useColors().getColors(ColorEnum.Error);
188
- const lights = useColors().getColors(ColorEnum.Light);
189
- const darks = useColors().getColors(ColorEnum.Dark);
188
+ const errors = getColors(ColorEnum.Error);
189
+ const lights = getColors(ColorEnum.Light);
190
+ const darks = getColors(ColorEnum.Dark);
190
191
 
191
192
  const menu = ref(false);
192
193
  const tabs = ref(0);
@@ -162,10 +162,11 @@ export default defineComponent({
162
162
  emits: ["update:modelValue"],
163
163
  setup(props, { emit }) {
164
164
  const { getUserOffsetMillis, epochToShortTimeFormat } = useTimeZone();
165
+ const { getColors } = useColors();
165
166
 
166
- const errors = useColors().getColors(ColorEnum.Error);
167
- const lights = useColors().getColors(ColorEnum.Light);
168
- const darks = useColors().getColors(ColorEnum.Dark);
167
+ const errors = getColors(ColorEnum.Error);
168
+ const lights = getColors(ColorEnum.Light);
169
+ const darks = getColors(ColorEnum.Dark);
169
170
 
170
171
  const dialog = ref(false);
171
172
 
@@ -22,7 +22,9 @@ export default defineComponent({
22
22
  }
23
23
  },
24
24
  setup(props) {
25
- const lights = useColors().getColors(ColorEnum.Light);
25
+ const { getColors } = useColors();
26
+
27
+ const lights = getColors(ColorEnum.Light);
26
28
 
27
29
  const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
28
30
  return {
@@ -31,7 +31,9 @@ export default defineComponent({
31
31
  }
32
32
  },
33
33
  setup(props) {
34
- const backgrounds = useColors().getColors(ColorEnum.Background);
34
+ const { getColors } = useColors();
35
+
36
+ const backgrounds = getColors(ColorEnum.Background);
35
37
 
36
38
  const style: Ref<{ [code: string]: string } & Partial<CSSStyleDeclaration>> = ref({
37
39
  "--fs-fade-out-mask-color" : backgrounds.base,
@@ -130,11 +130,12 @@ export default defineComponent({
130
130
  },
131
131
  emits: ["update:modelValue"],
132
132
  setup(props, { emit }) {
133
+ const { getColors, getContrasts } = useColors();
133
134
  const { slots } = useSlots();
134
135
 
135
- const textColors = computed(() => useColors().getContrasts(props.color));
136
- const colors = computed(() => useColors().getColors(props.color));
137
- const lights = useColors().getColors(ColorEnum.Light);
136
+ const textColors = computed(() => getContrasts(props.color));
137
+ const colors = computed(() => getColors(props.color));
138
+ const lights = getColors(ColorEnum.Light);
138
139
 
139
140
  const input = ref(null);
140
141
 
@@ -151,9 +151,11 @@ export default defineComponent({
151
151
  },
152
152
  emits: ["update:modelValue"],
153
153
  setup(props) {
154
- const errors = useColors().getColors(ColorEnum.Error);
155
- const lights = useColors().getColors(ColorEnum.Light);
156
- const darks = useColors().getColors(ColorEnum.Dark);
154
+ const { getColors } = useColors();
155
+
156
+ const errors = getColors(ColorEnum.Error);
157
+ const lights = getColors(ColorEnum.Light);
158
+ const darks = getColors(ColorEnum.Dark);
157
159
 
158
160
  const innerValue = ref(null);
159
161
 
@@ -18,7 +18,7 @@
18
18
  <script lang="ts">
19
19
  import { computed, defineComponent, onMounted } from "vue";
20
20
 
21
- import { useImageRaw, useImageBlurHash } from "@dative-gpi/foundation-shared-services";
21
+ import { useImageRaw, useImageBlurHash } from "@dative-gpi/foundation-shared-services/composables";
22
22
 
23
23
  export default defineComponent({
24
24
  name: "FSImage",
@@ -0,0 +1,95 @@
1
+ <template>
2
+ <a
3
+ :href="$props.to"
4
+ :class="classes"
5
+ :style="style"
6
+ v-bind="$attrs"
7
+ >
8
+ <slot />
9
+ </a>
10
+ </template>
11
+
12
+ <script lang="ts">
13
+ import { computed, defineComponent, PropType } from "vue";
14
+
15
+ import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
16
+ import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
17
+
18
+ export default defineComponent({
19
+ name: "FSLink",
20
+ props: {
21
+ to: {
22
+ type: String,
23
+ required: false,
24
+ default: "_blank"
25
+ },
26
+ font: {
27
+ type: String as PropType<"text-h1" | "text-h2" | "text-h3" | "text-body" | "text-button" | "text-overline" | "text-underline">,
28
+ required: false,
29
+ default: "text-body"
30
+ },
31
+ lineClamp: {
32
+ type: Number,
33
+ required: false,
34
+ default: 1
35
+ },
36
+ ellipsis: {
37
+ type: Boolean,
38
+ required: false,
39
+ default: true
40
+ },
41
+ color: {
42
+ type: String as PropType<ColorBase>,
43
+ required: false,
44
+ default: ColorEnum.Primary
45
+ },
46
+ variant: {
47
+ type: String as PropType<"base" | "light" | "dark">,
48
+ required: false,
49
+ default: "dark"
50
+ }
51
+ },
52
+ setup(props) {
53
+ const { getColors } = useColors();
54
+ const { slots } = useSlots();
55
+
56
+ const colors = computed(() => getColors(props.color));
57
+
58
+ const classes = computed((): string[] => {
59
+ const classNames = ["fs-link", props.font];
60
+ if (!slots.default) {
61
+ classNames.push("fs-span-pre-wrap");
62
+ }
63
+ if (props.lineClamp > 1) {
64
+ classNames.push("fs-span-line-clamp");
65
+ }
66
+ else if (props.ellipsis) {
67
+ classNames.push("fs-span-ellipsis");
68
+ }
69
+ return classNames;
70
+ });
71
+
72
+ const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
73
+ switch (props.variant) {
74
+ case "base": return {
75
+ "--fs-span-line-clamp": props.lineClamp.toString(),
76
+ "--fs-link-color" : colors.value.base
77
+ };
78
+ case "light": return {
79
+ "--fs-span-line-clamp": props.lineClamp.toString(),
80
+ "--fs-link-color" : colors.value.light
81
+ };
82
+ case "dark": return {
83
+ "--fs-span-line-clamp": props.lineClamp.toString(),
84
+ "--fs-link-color" : colors.value.dark
85
+ };
86
+ }
87
+ });
88
+
89
+ return {
90
+ classes,
91
+ style
92
+ };
93
+ }
94
+ });
95
+ </script>
@@ -0,0 +1,80 @@
1
+ <template>
2
+ <FSRow
3
+ align="center-center"
4
+ gap="4px"
5
+ >
6
+ <div
7
+ v-for="(_, index) in $props.pages"
8
+ :class="classes(index)"
9
+ :style="style"
10
+ :key="index"
11
+ />
12
+ </FSRow>
13
+ </template>
14
+
15
+ <script lang="ts">
16
+ import { computed, defineComponent, PropType } from "vue";
17
+
18
+ import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
19
+ import { useColors } from "@dative-gpi/foundation-shared-components/composables";
20
+
21
+ import FSRow from "./FSRow.vue";
22
+
23
+ export default defineComponent({
24
+ name: "FSPagination",
25
+ components: {
26
+ FSRow
27
+ },
28
+ props: {
29
+ modelValue: {
30
+ type: Number,
31
+ required: false,
32
+ default: 0
33
+ },
34
+ pages: {
35
+ type: Number,
36
+ required: false,
37
+ default: 1
38
+ },
39
+ color: {
40
+ type: String as PropType<ColorBase>,
41
+ required: false,
42
+ default: ColorEnum.Dark
43
+ }
44
+ },
45
+ setup(props) {
46
+ const { getColors } = useColors();
47
+
48
+ const colors = computed(() => getColors(props.color));
49
+ const lights = getColors(ColorEnum.Light);
50
+ const darks = getColors(ColorEnum.Dark);
51
+
52
+ const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
53
+ switch (props.color) {
54
+ case ColorEnum.Light:
55
+ case ColorEnum.Dark: return {
56
+ "--fs-pagination-background-color": lights.dark,
57
+ "--fs-pagination-active-background-color": darks.base
58
+ }
59
+ default: return {
60
+ "--fs-pagination-background-color": colors.value.light,
61
+ "--fs-pagination-active-background-color": colors.value.base
62
+ }
63
+ }
64
+ });
65
+
66
+ const classes = (page: number): string[] => {
67
+ const innerClasses = ["fs-pagination"];
68
+ if (page === props.modelValue) {
69
+ innerClasses.push("fs-pagination-active");
70
+ }
71
+ return innerClasses;
72
+ };
73
+
74
+ return {
75
+ style,
76
+ classes
77
+ };
78
+ }
79
+ });
80
+ </script>
@@ -76,8 +76,10 @@ export default defineComponent({
76
76
  },
77
77
  emits: ["update:modelValue"],
78
78
  setup(props) {
79
- const lights = useColors().getColors(ColorEnum.Light);
80
- const darks = useColors().getColors(ColorEnum.Dark);
79
+ const { getColors } = useColors();
80
+
81
+ const lights = getColors(ColorEnum.Light);
82
+ const darks = getColors(ColorEnum.Dark);
81
83
 
82
84
  const stars = ref(true);
83
85
 
@@ -86,9 +86,11 @@ export default defineComponent({
86
86
  },
87
87
  emits: ["update:modelValue"],
88
88
  setup(props, { emit }) {
89
- const colors = computed(() => useColors().getColors(props.color));
90
- const lights = useColors().getColors(ColorEnum.Light);
91
- const darks = useColors().getColors(ColorEnum.Dark);
89
+ const { getColors } = useColors();
90
+
91
+ const colors = computed(() => getColors(props.color));
92
+ const lights = getColors(ColorEnum.Light);
93
+ const darks = getColors(ColorEnum.Dark);
92
94
 
93
95
  const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
94
96
  if (!props.editable) {
@@ -55,7 +55,7 @@
55
55
  <script lang="ts">
56
56
  import { computed, defineComponent } from "vue";
57
57
 
58
- import { useTranslationsProvider } from "@dative-gpi/foundation-shared-services/composables";
58
+ import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
59
59
  import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
60
60
  import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
61
61
 
@@ -141,10 +141,10 @@
141
141
  :contenteditable="!readonly && $props.editable"
142
142
  />
143
143
  <FSTextField
144
- v-if="isLink && $props.editable"
145
- v-model="linkUrl"
144
+ v-if="isLink && !readonly && $props.editable"
146
145
  :hideHeader="true"
147
146
  @keypress.enter.stop="toggleLink"
147
+ v-model="linkUrl"
148
148
  />
149
149
  <slot name="description">
150
150
  <FSSpan
@@ -229,10 +229,11 @@ export default defineComponent({
229
229
  emits: ["update:modelValue"],
230
230
  setup(props, { emit }) {
231
231
  const { isMobileSized } = useBreakpoints();
232
+ const { getColors } = useColors();
232
233
 
233
- const linkColors = computed(()=> useColors().getColors(props.linkColor));
234
- const lights = useColors().getColors(ColorEnum.Light);
235
- const darks = useColors().getColors(ColorEnum.Dark);
234
+ const linkColors = computed(()=> getColors(props.linkColor));
235
+ const lights = getColors(ColorEnum.Light);
236
+ const darks = getColors(ColorEnum.Dark);
236
237
 
237
238
  const canUndo = ref(false);
238
239
  const isLink = ref(false);
@@ -287,7 +288,7 @@ export default defineComponent({
287
288
  });
288
289
 
289
290
  const readonly = computed((): boolean => {
290
- return props.variant === "readonly";
291
+ return ["readonly"].includes(props.variant);
291
292
  });
292
293
 
293
294
  const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {