@dative-gpi/foundation-shared-components 0.0.48 → 0.0.49

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.
@@ -1,11 +1,13 @@
1
1
  <template>
2
2
  <button
3
3
  v-if="!href"
4
- :class="wrapperClasses"
5
4
  :type="$props.type"
5
+ :style="style"
6
6
  @click.stop="onClick"
7
7
  >
8
8
  <FSCard
9
+ :height="$props.height"
10
+ :width="$props.width"
9
11
  :class="classes"
10
12
  :style="style"
11
13
  v-bind="$attrs"
@@ -26,10 +28,12 @@
26
28
  </button>
27
29
  <router-link
28
30
  v-else
29
- :class="wrapperClasses"
31
+ :style="style"
30
32
  :to="href"
31
33
  >
32
34
  <FSCard
35
+ :height="$props.height"
36
+ :width="$props.width"
33
37
  :class="classes"
34
38
  :style="style"
35
39
  v-bind="$attrs"
@@ -96,10 +100,15 @@ export default defineComponent({
96
100
  required: false,
97
101
  default: ColorEnum.Light
98
102
  },
99
- fullWidth: {
100
- type: Boolean,
103
+ width: {
104
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number>,
101
105
  required: false,
102
- default: false
106
+ default: null
107
+ },
108
+ height: {
109
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number>,
110
+ required: false,
111
+ default: null
103
112
  },
104
113
  load: {
105
114
  type: Boolean,
@@ -128,7 +137,9 @@ export default defineComponent({
128
137
  "--fs-clickable-border-radius" : sizeToVar(props.borderRadius),
129
138
  "--fs-clickable-background-color": lights.light,
130
139
  "--fs-clickable-border-color" : lights.dark,
131
- "--fs-clickable-color" : lights.dark
140
+ "--fs-clickable-color" : lights.dark,
141
+ "--fs-clickable-height" : sizeToVar(props.height),
142
+ "--fs-clickable-width" : sizeToVar(props.width)
132
143
  };
133
144
  }
134
145
  switch (props.variant) {
@@ -143,7 +154,9 @@ export default defineComponent({
143
154
  "--fs-clickable-hover-color" : colors.value.baseContrast,
144
155
  "--fs-clickable-active-background-color": colors.value.dark,
145
156
  "--fs-clickable-active-border-color" : colors.value.darkContrast,
146
- "--fs-clickable-active-color" : colors.value.darkContrast
157
+ "--fs-clickable-active-color" : colors.value.darkContrast,
158
+ "--fs-clickable-height" : sizeToVar(props.height),
159
+ "--fs-clickable-width" : sizeToVar(props.width)
147
160
  };
148
161
  case "full": return {
149
162
  "--fs-clickable-border-size" : props.border ? "1px" : "0",
@@ -156,7 +169,9 @@ export default defineComponent({
156
169
  "--fs-clickable-hover-color" : colors.value.baseContrast,
157
170
  "--fs-clickable-active-background-color": colors.value.dark,
158
171
  "--fs-clickable-active-border-color" : colors.value.dark,
159
- "--fs-clickable-active-color" : colors.value.darkContrast
172
+ "--fs-clickable-active-color" : colors.value.darkContrast,
173
+ "--fs-clickable-height" : sizeToVar(props.height),
174
+ "--fs-clickable-width" : sizeToVar(props.width)
160
175
  };
161
176
  }
162
177
  });
@@ -169,14 +184,6 @@ export default defineComponent({
169
184
  return classNames;
170
185
  });
171
186
 
172
- const wrapperClasses = computed((): string[] => {
173
- const classNames: string[] = [];
174
- if (props.fullWidth) {
175
- classNames.push("fs-clickable-wrapper-full-width");
176
- }
177
- return classNames;
178
- });
179
-
180
187
  const href = computed((): string | null => {
181
188
  if (!props.to || !props.editable || props.load) {
182
189
  return null;
@@ -206,7 +213,6 @@ export default defineComponent({
206
213
  };
207
214
 
208
215
  return {
209
- wrapperClasses,
210
216
  loadColor,
211
217
  classes,
212
218
  style,
@@ -3,9 +3,10 @@
3
3
  :class="classes"
4
4
  :style="style"
5
5
  :to="href"
6
+ v-slot="props"
6
7
  v-bind="$attrs"
7
8
  >
8
- <slot>
9
+ <slot v-bind="props">
9
10
  {{ $props.label }}
10
11
  </slot>
11
12
  </router-link>
@@ -45,6 +45,7 @@
45
45
  :itemValue="$props.itemValue"
46
46
  :readonly="!$props.editable"
47
47
  :clearable="$props.editable && !!$props.modelValue"
48
+ :returnObject="$props.returnObject"
48
49
  :rules="$props.rules"
49
50
  :validateOn="validateOn"
50
51
  :modelValue="$props.modelValue"
@@ -127,6 +128,11 @@ export default defineComponent({
127
128
  required: false,
128
129
  default: false
129
130
  },
131
+ returnObject: {
132
+ type: Boolean,
133
+ required: false,
134
+ default: false
135
+ },
130
136
  required: {
131
137
  type: Boolean,
132
138
  required: false,
@@ -43,6 +43,7 @@
43
43
  :itemValue="$props.itemValue"
44
44
  :readonly="!$props.editable"
45
45
  :clearable="$props.editable && $props.clearable"
46
+ :returnObject="$props.returnObject"
46
47
  :rules="$props.rules"
47
48
  :validateOn="validateOn"
48
49
  :modelValue="$props.modelValue"
@@ -119,6 +120,11 @@ export default defineComponent({
119
120
  required: false,
120
121
  default: false
121
122
  },
123
+ returnObject: {
124
+ type: Boolean,
125
+ required: false,
126
+ default: false
127
+ },
122
128
  required: {
123
129
  type: Boolean,
124
130
  required: false,
@@ -423,6 +423,7 @@
423
423
  width="120px"
424
424
  >
425
425
  <FSSelectField
426
+ class="fs-data-table-rows-per-page"
426
427
  :clearable="false"
427
428
  :hideHeader="true"
428
429
  :items="rowsPerPageOptions"
@@ -1,32 +1,38 @@
1
1
  <template>
2
2
  <FSSelectField
3
3
  itemTitle="id"
4
- :items="entities"
4
+ :items="timeZones"
5
5
  :modelValue="$props.modelValue"
6
6
  @update:modelValue="$emit('update:modelValue', $event)"
7
7
  v-bind="$attrs"
8
8
  >
9
- <template #selection>
10
- <FSRow>
11
- <FSSpan font="text-underline" :style="style">
12
- {{ entities.find((entity) => entity.id === $props.modelValue)?.id }}
13
- </FSSpan>
14
- </FSRow>
9
+ <template #append-inner>
10
+ <slot name="append-inner">
11
+ <FSChip
12
+ v-if="offset"
13
+ variant="standard"
14
+ :color="ColorEnum.Dark"
15
+ :label="offset"
16
+ />
17
+ </slot>
15
18
  </template>
16
19
  </FSSelectField>
17
20
  </template>
18
21
 
19
22
  <script lang="ts">
20
- import { defineComponent, onMounted } from "vue";
23
+ import { computed, defineComponent, onMounted } from "vue";
21
24
 
22
25
  import { useTimeZones } from "@dative-gpi/foundation-shared-services/composables";
26
+ import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
23
27
 
24
28
  import FSSelectField from "../fields/FSSelectField.vue";
29
+ import FSChip from "../FSChip.vue";
25
30
 
26
31
  export default defineComponent({
27
32
  name: "FSSelectTimeZone",
28
33
  components: {
29
- FSSelectField
34
+ FSSelectField,
35
+ FSChip
30
36
  },
31
37
  props: {
32
38
  modelValue: {
@@ -36,15 +42,21 @@ export default defineComponent({
36
42
  },
37
43
  },
38
44
  emits: ["update:modelValue"],
39
- setup() {
40
- const { getMany, entities } = useTimeZones();
45
+ setup(props) {
46
+ const { getMany: getTimeZones, entities: timeZones } = useTimeZones();
47
+
48
+ const offset = computed((): string => {
49
+ return timeZones.value.find((entity) => entity.id === props.modelValue)?.offset;
50
+ });
41
51
 
42
52
  onMounted(() => {
43
- getMany();
53
+ getTimeZones();
44
54
  });
45
55
 
46
56
  return {
47
- entities
57
+ ColorEnum,
58
+ timeZones,
59
+ offset
48
60
  };
49
61
  }
50
62
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-shared-components",
3
3
  "sideEffects": false,
4
- "version": "0.0.48",
4
+ "version": "0.0.49",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -10,8 +10,8 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@dative-gpi/foundation-shared-domain": "0.0.48",
14
- "@dative-gpi/foundation-shared-services": "0.0.48",
13
+ "@dative-gpi/foundation-shared-domain": "0.0.49",
14
+ "@dative-gpi/foundation-shared-services": "0.0.49",
15
15
  "@fontsource/montserrat": "^5.0.16",
16
16
  "@lexical/clipboard": "^0.12.5",
17
17
  "@lexical/history": "^0.12.5",
@@ -32,5 +32,5 @@
32
32
  "sass": "^1.69.5",
33
33
  "sass-loader": "^13.3.2"
34
34
  },
35
- "gitHead": "0029f53ff50ea72e704647e64d3419266ae680fa"
35
+ "gitHead": "cf285c38be7fcc0f02f813f2cb3693867d277003"
36
36
  }
@@ -26,19 +26,17 @@
26
26
  }
27
27
 
28
28
  a:has(.fs-clickable) {
29
+ position: relative !important;
29
30
  text-decoration: none;
30
31
  padding: 0 !important;
31
- position: relative !important;
32
- width: fit-content;
32
+ height: var(--fs-clickable-height);
33
+ width: var(--fs-clickable-width);
33
34
  }
34
35
 
35
36
  button:has(.fs-clickable) {
36
37
  position: relative !important;
37
- width: fit-content;
38
- }
39
-
40
- .fs-clickable-wrapper-full-width {
41
- width: 100% !important;
38
+ height: var(--fs-clickable-height);
39
+ width: var(--fs-clickable-width);
42
40
  }
43
41
 
44
42
  .fs-clickable-load {