@dative-gpi/foundation-shared-components 1.0.194 → 1.1.0

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.
@@ -41,12 +41,13 @@
41
41
  :scrollOutside="false"
42
42
  maxHeight="80dvh"
43
43
  >
44
- <FSClickable
44
+ <FSCard
45
45
  v-for="(item, index) in $props.items"
46
46
  width="100%"
47
47
  padding="8px"
48
48
  height="40px"
49
49
  :key="index"
50
+ :color="ColorEnum.Light"
50
51
  :border="false"
51
52
  @click="onClickItem(item)"
52
53
  >
@@ -68,7 +69,7 @@
68
69
  </FSText>
69
70
  </FSRow>
70
71
  </slot>
71
- </FSClickable>
72
+ </FSCard>
72
73
  </FSFadeOut>
73
74
  </FSCol>
74
75
  </slot>
@@ -81,7 +82,7 @@ import { defineComponent, ref, type PropType } from "vue";
81
82
 
82
83
  import { useColors } from "@dative-gpi/foundation-shared-components/composables";
83
84
 
84
- import { ColorEnum, type ColorBase } from '@dative-gpi/foundation-shared-components/models';
85
+ import { CardVariants, ColorEnum, type ColorBase } from '@dative-gpi/foundation-shared-components/models';
85
86
 
86
87
  import FSRow from '@dative-gpi/foundation-shared-components/components/FSRow.vue';
87
88
  import FSCol from '@dative-gpi/foundation-shared-components/components/FSCol.vue';
@@ -90,7 +91,6 @@ import FSMenu from '@dative-gpi/foundation-shared-components/components/FSMenu.v
90
91
  import FSCard from '@dative-gpi/foundation-shared-components/components/FSCard.vue';
91
92
  import FSText from '@dative-gpi/foundation-shared-components/components/FSText.vue';
92
93
  import FSButton from '@dative-gpi/foundation-shared-components/components/FSButton.vue';
93
- import FSClickable from '@dative-gpi/foundation-shared-components/components/FSClickable.vue';
94
94
 
95
95
  export default defineComponent({
96
96
  name: "FSInformationsMenu",
@@ -101,8 +101,7 @@ export default defineComponent({
101
101
  FSText,
102
102
  FSButton,
103
103
  FSCol,
104
- FSIcon,
105
- FSClickable
104
+ FSIcon
106
105
  },
107
106
  props: {
108
107
  items: {
@@ -158,6 +157,7 @@ export default defineComponent({
158
157
  ColorEnum,
159
158
  modelValue,
160
159
  lightColors,
160
+ CardVariants,
161
161
  onClickItem
162
162
  };
163
163
  }
@@ -3,7 +3,7 @@
3
3
  width="hug"
4
4
  gap="4px"
5
5
  >
6
- <FSClickable
6
+ <FSCard
7
7
  variant="full"
8
8
  :color="ColorEnum.Light"
9
9
  borderRadius="50%"
@@ -14,8 +14,8 @@
14
14
  size="18px"
15
15
  icon="mdi-skip-backward"
16
16
  />
17
- </FSClickable>
18
- <FSClickable
17
+ </FSCard>
18
+ <FSCard
19
19
  variant="full"
20
20
  :color="ColorEnum.Light"
21
21
  borderRadius="50%"
@@ -26,8 +26,8 @@
26
26
  size="18px"
27
27
  :icon="$props.modelValue ? 'mdi-pause' : 'mdi-play'"
28
28
  />
29
- </FSClickable>
30
- <FSClickable
29
+ </FSCard>
30
+ <FSCard
31
31
  variant="full"
32
32
  :color="ColorEnum.Light"
33
33
  borderRadius="50%"
@@ -38,7 +38,7 @@
38
38
  size="18px"
39
39
  icon="mdi-skip-forward"
40
40
  />
41
- </FSClickable>
41
+ </FSCard>
42
42
  </FSRow>
43
43
  </template>
44
44
 
@@ -48,12 +48,12 @@ import { defineComponent } from "vue";
48
48
  import { ColorEnum } from '@dative-gpi/foundation-shared-components/models';
49
49
 
50
50
  import FSIcon from '@dative-gpi/foundation-shared-components/components/FSIcon.vue';
51
- import FSClickable from '@dative-gpi/foundation-shared-components/components/FSClickable.vue';
51
+ import FSCard from '@dative-gpi/foundation-shared-components/components/FSCard.vue';
52
52
 
53
53
  export default defineComponent({
54
54
  name: "FSPlayButtons",
55
55
  components: {
56
- FSClickable,
56
+ FSCard,
57
57
  FSIcon
58
58
  },
59
59
  props: {
@@ -1,9 +1,9 @@
1
1
  <template>
2
- <router-link
3
- :to="$props.to"
4
- @auxclick="handleRoutingEvent($event, $props.to)"
5
- @click="handleRoutingEvent($event, $props.to)"
6
- v-bind="$attrs"
2
+ <component
3
+ :is="wrapperComponent"
4
+ v-bind="mergedProps"
5
+ @click="onClick"
6
+ @auxclick="onAuxClick"
7
7
  >
8
8
  <template
9
9
  v-for="(_, name) in $slots"
@@ -14,29 +14,99 @@
14
14
  v-bind="{ ...slotData }"
15
15
  />
16
16
  </template>
17
- </router-link>
17
+ </component>
18
18
  </template>
19
19
 
20
20
  <script lang="ts">
21
- import { defineComponent, type PropType } from "vue";
22
- import { type RouteLocation } from "vue-router";
23
-
21
+ import { computed, defineComponent, type PropType } from "vue";
22
+ import { RouterLink, type RouteLocation } from "vue-router";
24
23
  import { useRouting } from "@dative-gpi/foundation-shared-services/composables";
25
24
 
26
25
  export default defineComponent({
27
26
  name: "FSRouterLink",
28
27
  props: {
29
28
  to: {
30
- type: Object as PropType<RouteLocation>,
31
- required: true
29
+ type: Object as PropType<RouteLocation | null>,
30
+ default: null
31
+ },
32
+ href: {
33
+ type: String as PropType<string | null>,
34
+ default: null
35
+ },
36
+ passive: {
37
+ type: Boolean as PropType<boolean | null>,
38
+ default: null
39
+ },
40
+ type: {
41
+ type: String as PropType<"button" | "submit" | "reset">,
42
+ default: "button"
43
+ },
44
+ defaultWrapper: {
45
+ type: String as PropType<"div" | "a" | "button">,
46
+ default: "button"
47
+ },
48
+ passiveWrapper: {
49
+ type: String as PropType<"div" | "a" | "button">,
50
+ default: "div"
32
51
  }
33
52
  },
34
- setup() {
53
+ setup(props, { attrs, slots }) {
35
54
  const { handleRoutingEvent } = useRouting();
36
55
 
56
+ const actualPassive = computed(() => {
57
+ if (props.passive !== null) {return props.passive;}
58
+ return !props.to && !props.href && !attrs.onClick;
59
+ });
60
+
61
+ const wrapperComponent = computed(() => {
62
+ if (actualPassive.value) {
63
+ return props.passiveWrapper;
64
+ }
65
+ if (props.href) {
66
+ return "a";
67
+ }
68
+ if (props.to) {
69
+ return RouterLink;
70
+ }
71
+ return props.defaultWrapper;
72
+ });
73
+
74
+ const componentProps = computed(() => {
75
+ if (wrapperComponent.value === RouterLink) {
76
+ return { to: props.to };
77
+ } else if (wrapperComponent.value === "a") {
78
+ return { href: props.href };
79
+ } else if (wrapperComponent.value === "button") {
80
+ return { type: props.type };
81
+ } else {
82
+ return {};
83
+ }
84
+ });
85
+
86
+ const mergedProps = computed(() => ({
87
+ ...componentProps.value,
88
+ ...attrs
89
+ }));
90
+
91
+ const onClick = (event: MouseEvent) => {
92
+ if (props.to) {
93
+ handleRoutingEvent(event, props.to);
94
+ }
95
+ };
96
+
97
+ const onAuxClick = (event: MouseEvent) => {
98
+ if (props.to) {
99
+ handleRoutingEvent(event, props.to);
100
+ }
101
+ };
102
+
37
103
  return {
38
- handleRoutingEvent
104
+ wrapperComponent,
105
+ mergedProps,
106
+ slots,
107
+ onClick,
108
+ onAuxClick
39
109
  };
40
110
  }
41
111
  });
42
- </script>
112
+ </script>
@@ -2,7 +2,7 @@
2
2
  <v-slide-group
3
3
  class="fs-slide-group"
4
4
  ref="slideGroupRef"
5
- :showArrows="true"
5
+ :showArrows="$props.showArrows"
6
6
  :id="elementId"
7
7
  :style="style"
8
8
  v-bind="$attrs"
@@ -83,6 +83,10 @@ export default defineComponent({
83
83
  type: Number,
84
84
  required: false,
85
85
  default: 250
86
+ },
87
+ showArrows: {
88
+ type: [Boolean, String] as PropType<boolean | string>,
89
+ default: true
86
90
  }
87
91
  },
88
92
  setup(props) {
@@ -29,7 +29,7 @@
29
29
  />
30
30
  </template>
31
31
  </FSAgendaHorizontalEvent>
32
- <FSClickable
32
+ <FSCard
33
33
  v-if="$props.variant !== 'current' || $props.dayStart < $props.now"
34
34
  :class="`fs-agenda-event fs-agenda-event-${$props.variant}`"
35
35
  :variant="$props.variant === 'current' ? 'full' : 'standard'"
@@ -50,7 +50,7 @@
50
50
  :variant="$props.variant"
51
51
  :width="width"
52
52
  />
53
- </FSClickable>
53
+ </FSCard>
54
54
  </template>
55
55
 
56
56
  <script lang="ts">
@@ -58,13 +58,13 @@ import { defineComponent, computed, type StyleValue, type PropType } from 'vue';
58
58
 
59
59
  import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
60
60
 
61
- import FSClickable from '../FSClickable.vue';
61
+ import FSCard from '../FSCard.vue';
62
62
 
63
63
 
64
64
  export default defineComponent({
65
65
  name: 'FSAgendaHorizontalEvent',
66
66
  components: {
67
- FSClickable
67
+ FSCard
68
68
  },
69
69
  emits: ['click'],
70
70
  props: {
@@ -28,7 +28,7 @@
28
28
  />
29
29
  </template>
30
30
  </FSAgendaVerticalEvent>
31
- <FSClickable
31
+ <FSCard
32
32
  v-if="$props.variant !== 'current' || $props.dayStart < $props.now"
33
33
  :class="`fs-agenda-event fs-agenda-vertical-event fs-agenda-event-${$props.variant}`"
34
34
  :variant="$props.variant === 'current' ? 'full' : 'standard'"
@@ -48,7 +48,7 @@
48
48
  :timeEnd="epochToShortTimeOnlyFormat($props.end)"
49
49
  :variant="$props.variant"
50
50
  />
51
- </FSClickable>
51
+ </FSCard>
52
52
  </template>
53
53
 
54
54
  <script lang="ts">
@@ -56,12 +56,12 @@ import { defineComponent, computed, type StyleValue, type PropType } from 'vue';
56
56
 
57
57
  import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
58
58
 
59
- import FSClickable from '../FSClickable.vue';
59
+ import FSCard from '../FSCard.vue';
60
60
 
61
61
  export default defineComponent({
62
62
  name: 'FSAgendaVerticalEvent',
63
63
  components: {
64
- FSClickable
64
+ FSCard
65
65
  },
66
66
  emits: ['click'],
67
67
  props: {
@@ -1,10 +1,9 @@
1
1
  <template>
2
- <component
2
+ <FSCard
3
3
  v-if="$props.modelStatus"
4
4
  class="fs-status-rich-card"
5
5
  topRightPadding="2px"
6
6
  variant="standard"
7
- :is="$attrs.onClick ? FSClickable : FSCard"
8
7
  :padding="$props.padding"
9
8
  :height="$props.height"
10
9
  :width="$props.width"
@@ -50,7 +49,7 @@
50
49
  v-bind="{ color }"
51
50
  />
52
51
  </template>
53
- </component>
52
+ </FSCard>
54
53
  </template>
55
54
 
56
55
  <script lang="ts">
@@ -59,7 +58,6 @@ import { computed, defineComponent, type PropType, type StyleValue } from "vue";
59
58
  import { ColorEnum, type FSDeviceStatusGroup, type FSModelStatus } from "@dative-gpi/foundation-shared-components/models";
60
59
  import { useColors } from "@dative-gpi/foundation-shared-components/composables";
61
60
 
62
- import FSClickable from "../FSClickable.vue";
63
61
  import FSCard from "../FSCard.vue";
64
62
  import FSIcon from "../FSChip.vue";
65
63
  import FSText from "../FSText.vue";
@@ -68,7 +66,6 @@ import FSCol from "../FSCol.vue";
68
66
  export default defineComponent({
69
67
  name: "FSStatusRichCard",
70
68
  components: {
71
- FSClickable,
72
69
  FSCard,
73
70
  FSIcon,
74
71
  FSText,
@@ -158,8 +155,6 @@ export default defineComponent({
158
155
  }));
159
156
 
160
157
  return {
161
- FSClickable,
162
- FSCard,
163
158
  color,
164
159
  style,
165
160
  title,
@@ -40,6 +40,7 @@
40
40
  :height="['30px', '24px']"
41
41
  :variant="getAllVariant()"
42
42
  :color="$props.color"
43
+ align="center-left"
43
44
  :clickable="true"
44
45
  @click="onToggleAll"
45
46
  />
@@ -63,7 +64,9 @@
63
64
  :height="['30px', '24px']"
64
65
  :color="$props.color"
65
66
  :label="filter.text"
67
+ align="center-left"
66
68
  :clickable="true"
69
+ :border="false"
67
70
  :key="index"
68
71
  @click="() => onToggle(filter)"
69
72
  >
@@ -85,7 +88,7 @@
85
88
  <script lang="ts">
86
89
  import { computed, defineComponent, type PropType, ref } from "vue";
87
90
 
88
- import { type ColorBase, ColorEnum, type FSDataTableColumn, type FSDataTableFilter } from "@dative-gpi/foundation-shared-components/models";
91
+ import { type CardVariant, CardVariants, type ColorBase, ColorEnum, type FSDataTableColumn, type FSDataTableFilter } from "@dative-gpi/foundation-shared-components/models";
89
92
  import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
90
93
 
91
94
  import FSSearchField from "../fields/FSSearchField.vue";
@@ -153,21 +156,21 @@ export default defineComponent({
153
156
  return props.filters;
154
157
  });
155
158
 
156
- const getVariant = (filter: FSDataTableFilter): "standard" | "full" | "borderless" => {
159
+ const getVariant = (filter: FSDataTableFilter): CardVariant => {
157
160
  if (singlePick.value || props.filters.filter(f => f.hidden).length > 0) {
158
161
  if (filter.hidden) {
159
- return "borderless";
162
+ return CardVariants.Background;
160
163
  }
161
- return "full";
164
+ return CardVariants.Full;
162
165
  }
163
- return "borderless";
166
+ return CardVariants.Background;
164
167
  };
165
168
 
166
- const getAllVariant = (): "standard" | "full" => {
169
+ const getAllVariant = (): CardVariant => {
167
170
  if (singlePick.value || props.filters.filter(f => f.hidden).length > 0) {
168
- return "standard";
171
+ return CardVariants.Background;
169
172
  }
170
- return "full";
173
+ return CardVariants.Full;
171
174
  };
172
175
 
173
176
  const onToggle = (filter: FSDataTableFilter): void => {
@@ -32,7 +32,8 @@
32
32
  <FSChip
33
33
  prependIcon="mdi-eye-off-outline"
34
34
  class="fs-header-button-chip"
35
- variant="borderless"
35
+ variant="background"
36
+ :border="false"
36
37
  :label="$tr('data-table.hide-column', 'Hide column')"
37
38
  :height="[30, 24]"
38
39
  :clickable="true"
@@ -41,7 +42,8 @@
41
42
  <FSChip
42
43
  v-if="!$props.first"
43
44
  class="fs-header-button-chip"
44
- variant="borderless"
45
+ variant="background"
46
+ :border="false"
45
47
  prependIcon="mdi-chevron-left"
46
48
  :label="$tr('data-table.move-left', 'Move to the left')"
47
49
  :height="[30, 24]"
@@ -51,7 +53,8 @@
51
53
  <FSChip
52
54
  v-if="!$props.last"
53
55
  class="fs-header-button-chip"
54
- variant="borderless"
56
+ variant="background"
57
+ :border="false"
55
58
  prependIcon="mdi-chevron-right"
56
59
  :label="$tr('data-table.move-right', 'Move to the right')"
57
60
  :height="[30, 24]"
@@ -1,67 +1,26 @@
1
1
  <template>
2
2
  <FSCol
3
3
  class="fs-tile"
4
- :height="$props.height"
4
+ :style="style"
5
5
  :width="$props.width"
6
+ :height="$props.height"
6
7
  >
7
- <FSClickable
8
- v-if="($props.href || $props.to || $attrs.onClick)"
9
- variant="background"
10
- class="fs-tile"
11
- padding="12px"
12
- :href="$props.href"
13
- width="100%"
14
- height="100%"
15
- topRightPadding="1px"
16
- :to="$props.to"
17
- :style="style"
18
- v-bind="$attrs"
19
- >
20
- <slot />
21
- <template
22
- v-if="$props.selectable"
23
- #top-right
24
- >
25
- <FSCard
26
- padding="8px"
27
- :border="false"
28
- >
29
- <FSCheckbox
30
- :modelValue="$props.modelValue"
31
- @update:modelValue="() => $emit('update:modelValue', !$props.modelValue)"
32
- />
33
- </FSCard>
34
- </template>
35
- </FSClickable>
36
-
37
- <FSClickable
38
- v-else-if="$props.selectable && $props.singleSelect"
39
- padding="12px"
40
- :variant="variant"
41
- :color="color"
42
- :style="style"
43
- width="100%"
44
- height="100%"
45
- @click="() => $emit('update:modelValue', !$props.modelValue)"
46
- v-bind="$attrs"
47
- >
48
- <slot />
49
- </FSClickable>
50
-
51
8
  <FSCard
52
- v-else
53
- variant="background"
54
9
  class="fs-tile"
10
+ :variant="selectionState.variant"
11
+ :color="selectionState.color"
55
12
  padding="12px"
56
- :style="style"
57
13
  width="100%"
58
14
  height="100%"
59
15
  topRightPadding="1px"
16
+ :to="$props.to"
17
+ :href="$props.href"
18
+ v-on="selectionState.listeners"
60
19
  v-bind="$attrs"
61
20
  >
62
21
  <slot />
63
22
  <template
64
- v-if="$props.selectable"
23
+ v-if="selectionState.showCheckbox"
65
24
  #top-right
66
25
  >
67
26
  <FSCard
@@ -74,8 +33,7 @@
74
33
  />
75
34
  </FSCard>
76
35
  </template>
77
- </FSCard>
78
-
36
+ </FSCard>
79
37
  <div
80
38
  v-if="$props.leftColor"
81
39
  class="fs-tile-left"
@@ -96,17 +54,15 @@ import { type RouteLocation } from "vue-router";
96
54
  import { useColors } from "@dative-gpi/foundation-shared-components/composables";
97
55
  import { ColorEnum, type ColorBase } from "@dative-gpi/foundation-shared-components/models";
98
56
 
99
- import FSClickable from "../FSClickable.vue";
100
- import FSCheckbox from "../FSCheckbox.vue";
101
57
  import FSCard from "../FSCard.vue";
58
+ import FSCheckbox from "../FSCheckbox.vue";
102
59
 
103
60
  export default defineComponent({
104
61
  name: "FSTile",
105
62
  inheritAttrs: false,
106
63
  components: {
107
- FSClickable,
108
- FSCheckbox,
109
- FSCard
64
+ FSCard,
65
+ FSCheckbox
110
66
  },
111
67
  props: {
112
68
  to: {
@@ -161,7 +117,7 @@ export default defineComponent({
161
117
  },
162
118
  },
163
119
  emits: ["update:modelValue"],
164
- setup(props) {
120
+ setup(props, { emit }) {
165
121
  const { getGradients } = useColors();
166
122
 
167
123
  const style = computed((): StyleValue => {
@@ -177,18 +133,28 @@ export default defineComponent({
177
133
  return result;
178
134
  });
179
135
 
180
- const variant = computed((): "standard" | "background" => {
181
- return (props.singleSelect && props.modelValue) ? "standard" : "background";
182
- });
183
-
184
- const color = computed((): ColorBase => {
185
- return (props.singleSelect && props.modelValue) ? props.activeColor : ColorEnum.Background;
136
+ const selectionState = computed(() => {
137
+ const isSingleSelect = props.selectable && props.singleSelect && !props.href && !props.to;
138
+ const showCheckbox = props.selectable && !isSingleSelect;
139
+ const variant: "standard" | "background" = (isSingleSelect && props.modelValue) ? "standard" : "background";
140
+ const color: ColorBase = (isSingleSelect && props.modelValue) ? props.activeColor : ColorEnum.Background;
141
+ const onClick = () => { emit("update:modelValue", !props.modelValue); };
142
+ const listeners: Record<string, (...args: any[]) => void> = {};
143
+ if (isSingleSelect) {
144
+ listeners.click = onClick;
145
+ }
146
+ return {
147
+ isSingleSelect,
148
+ showCheckbox,
149
+ variant,
150
+ color,
151
+ listeners
152
+ };
186
153
  });
187
154
 
188
155
  return {
156
+ selectionState,
189
157
  ColorEnum,
190
- variant,
191
- color,
192
158
  style
193
159
  };
194
160
  }
package/models/index.ts CHANGED
@@ -12,4 +12,5 @@ export * from "./modelStatuses";
12
12
  export * from "./rules";
13
13
  export * from "./tables";
14
14
  export * from "./toggleSets";
15
- export * from "./translations";
15
+ export * from "./variants";
16
+ export * from "./translations";
@@ -0,0 +1,7 @@
1
+ export type CardVariant = "background" | "standard" | "full" | "gradient";
2
+ export enum CardVariants {
3
+ Background = "background",
4
+ Standard = "standard",
5
+ Full = "full",
6
+ Gradient = "gradient"
7
+ }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "url": "https://github.com/Dative-GPI/foundation-shared-ui.git"
5
5
  },
6
6
  "sideEffects": false,
7
- "version": "1.0.194",
7
+ "version": "1.1.0",
8
8
  "description": "",
9
9
  "publishConfig": {
10
10
  "access": "public"
@@ -13,8 +13,8 @@
13
13
  "author": "",
14
14
  "license": "ISC",
15
15
  "dependencies": {
16
- "@dative-gpi/foundation-shared-domain": "1.0.194",
17
- "@dative-gpi/foundation-shared-services": "1.0.194"
16
+ "@dative-gpi/foundation-shared-domain": "1.1.0",
17
+ "@dative-gpi/foundation-shared-services": "1.1.0"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@dative-gpi/bones-ui": "^1.0.0",
@@ -38,5 +38,5 @@
38
38
  "sass": "1.71.1",
39
39
  "sass-loader": "13.3.2"
40
40
  },
41
- "gitHead": "def5664a8d5b97efeba050d6c166f1a3b9fb33e8"
41
+ "gitHead": "87757abf5add0aa83bd9a3e8171b7d4ea9862ea2"
42
42
  }
@@ -1,20 +1,15 @@
1
1
  .fs-button-icon {
2
+ text-decoration: none;
2
3
  transition: color 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
3
- color: var(--fs-button-color) !important;
4
4
 
5
5
  &.fs-button-disabled,
6
6
  &:has(.fs-button-load) {
7
7
  cursor: default !important;
8
8
  }
9
9
 
10
- & > a, a:hover, a:visited, a:active {
11
- color: inherit;
12
- text-decoration: none;
13
- }
14
-
15
10
  @include clickscreen {
16
11
  &:not(.fs-button-disabled, :has(.fs-button-load)):hover {
17
- color: var(--fs-button-hover-color) !important;
12
+ filter: brightness(0.8) !important;
18
13
  cursor: pointer !important;
19
14
  }
20
15
  }