@dative-gpi/foundation-shared-components 0.0.160 → 0.0.161

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.
@@ -22,6 +22,9 @@
22
22
  >
23
23
  {{ $props.modelValue }}
24
24
  </FSIcon>
25
+ <slot
26
+ name="append-inner"
27
+ />
25
28
  </template>
26
29
  </FSTextField>
27
30
  <FSToggleSet
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <FSTextField
3
+ class="fs-number-field"
3
4
  :editable="$props.editable"
4
5
  :modelValue="$props.modelValue?.toString()"
5
6
  @update:modelValue="onUpdate"
@@ -18,17 +18,16 @@
18
18
  <template
19
19
  #append-inner
20
20
  >
21
+ <FSButton
22
+ variant="icon"
23
+ :editable="$props.editable"
24
+ :color="ColorEnum.Dark"
25
+ :icon="icon"
26
+ @click="onToggle"
27
+ />
21
28
  <slot
22
29
  name="append-inner"
23
- >
24
- <FSButton
25
- variant="icon"
26
- :editable="$props.editable"
27
- :color="ColorEnum.Dark"
28
- :icon="icon"
29
- @click="onToggle"
30
- />
31
- </slot>
30
+ />
32
31
  </template>
33
32
  </FSTextField>
34
33
  </template>
@@ -16,38 +16,36 @@
16
16
  />
17
17
  </template>
18
18
  <template
19
- v-if="$props.prependInnerIcon"
20
19
  #prepend-inner
21
20
  >
21
+ <FSButton
22
+ v-if="$props.prependInnerIcon"
23
+ variant="icon"
24
+ :icon="$props.prependInnerIcon"
25
+ :editable="$props.editable"
26
+ :color="ColorEnum.Dark"
27
+ @click="onSearch"
28
+ />
22
29
  <slot
23
30
  name="prepend-inner"
24
- >
25
- <FSButton
26
- variant="icon"
27
- :icon="$props.prependInnerIcon"
28
- :editable="$props.editable"
29
- :color="ColorEnum.Dark"
30
- @click="onSearch"
31
- />
32
- </slot>
31
+ />
33
32
  </template>
34
33
  <template
35
- v-if="!['instant'].includes($props.variant)"
36
34
  #append
37
35
  >
36
+ <FSButton
37
+ v-if="!['instant'].includes($props.variant)"
38
+ :prependIcon="$props.buttonPrependIcon"
39
+ :label="buttonLabel"
40
+ :appendIcon="$props.buttonAppendIcon"
41
+ :variant="$props.buttonVariant"
42
+ :color="$props.buttonColor"
43
+ :editable="$props.editable"
44
+ @click="onSearch"
45
+ />
38
46
  <slot
39
47
  name="append"
40
- >
41
- <FSButton
42
- :prependIcon="$props.buttonPrependIcon"
43
- :label="buttonLabel"
44
- :appendIcon="$props.buttonAppendIcon"
45
- :variant="$props.buttonVariant"
46
- :color="$props.buttonColor"
47
- :editable="$props.editable"
48
- @click="onSearch"
49
- />
50
- </slot>
48
+ />
51
49
  </template>
52
50
  </FSTextField>
53
51
  </template>
@@ -20,7 +20,7 @@
20
20
  v-bind="$attrs"
21
21
  >
22
22
  <template
23
- v-for="(_, name) in $slots"
23
+ v-for="(_, name) in numberSlots"
24
24
  v-slot:[name]="slotData"
25
25
  >
26
26
  <slot
@@ -37,7 +37,17 @@
37
37
  :items="timeScale"
38
38
  :modelValue="selectedUnit.id"
39
39
  @update:modelValue="onSubmitTimeScale"
40
- />
40
+ >
41
+ <template
42
+ v-for="(_, name) in selectSlots"
43
+ v-slot:[name]="slotData"
44
+ >
45
+ <slot
46
+ :name="name"
47
+ v-bind="slotData"
48
+ />
49
+ </template>
50
+ </FSSelectField>
41
51
  </FSRow>
42
52
  </FSBaseField>
43
53
  </template>
@@ -45,8 +55,8 @@
45
55
  <script lang="ts">
46
56
  import { computed, defineComponent, PropType, ref } from "vue";
47
57
 
58
+ import { useColors, useRules, useSlots } from "@dative-gpi/foundation-shared-components/composables";
48
59
  import { getTimeScaleIndex, timeScale } from "@dative-gpi/foundation-shared-components/utils";
49
- import { useColors, useRules } from "@dative-gpi/foundation-shared-components/composables";
50
60
  import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
51
61
 
52
62
  import FSNumberField from "./FSNumberField.vue";
@@ -108,6 +118,10 @@ export default defineComponent({
108
118
  setup(props, { emit }) {
109
119
  const { validateOn, getMessages } = useRules();
110
120
  const { getColors } = useColors();
121
+ const { slots } = useSlots();
122
+
123
+ delete slots.label;
124
+ delete slots.description;
111
125
 
112
126
  const errors = getColors(ColorEnum.Error);
113
127
  const lights = getColors(ColorEnum.Light);
@@ -145,6 +159,20 @@ export default defineComponent({
145
159
  };
146
160
  });
147
161
 
162
+ const numberSlots = computed((): any => {
163
+ return Object.keys(slots).filter(k => k.startsWith("number-")).reduce((acc, key) => {
164
+ acc[key.substring("number-".length)] = slots[key];
165
+ return acc;
166
+ }, {});
167
+ });
168
+
169
+ const selectSlots = computed((): any => {
170
+ return Object.keys(slots).filter(k => k.startsWith("select-")).reduce((acc, key) => {
171
+ acc[key.substring("select-".length)] = slots[key];
172
+ return acc;
173
+ }, {});
174
+ });
175
+
148
176
  const messages = computed((): string[] => props.messages ?? getMessages(props.modelValue, props.rules));
149
177
 
150
178
  const onSubmitValue = (value: number): void => {
@@ -159,6 +187,8 @@ export default defineComponent({
159
187
 
160
188
  return {
161
189
  selectedUnit,
190
+ numberSlots,
191
+ selectSlots,
162
192
  validateOn,
163
193
  innerTime,
164
194
  timeScale,
@@ -17,19 +17,18 @@
17
17
  <template
18
18
  #append
19
19
  >
20
+ <FSButton
21
+ :prependIcon="$props.buttonPrependIcon"
22
+ :label="$props.buttonLabel"
23
+ :appendIcon="$props.buttonAppendIcon"
24
+ :variant="$props.buttonVariant"
25
+ :color="$props.buttonColor"
26
+ :load="fetchingLanguages"
27
+ @click="dialog = true"
28
+ />
20
29
  <slot
21
30
  name="append"
22
- >
23
- <FSButton
24
- :prependIcon="$props.buttonPrependIcon"
25
- :label="$props.buttonLabel"
26
- :appendIcon="$props.buttonAppendIcon"
27
- :variant="$props.buttonVariant"
28
- :color="$props.buttonColor"
29
- :load="fetchingLanguages"
30
- @click="dialog = true"
31
- />
32
- </slot>
31
+ />
33
32
  </template>
34
33
  </FSTextField>
35
34
  <FSDialogSubmit
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.160",
4
+ "version": "0.0.161",
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.160",
14
- "@dative-gpi/foundation-shared-services": "0.0.160",
13
+ "@dative-gpi/foundation-shared-domain": "0.0.161",
14
+ "@dative-gpi/foundation-shared-services": "0.0.161",
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": "fb4e1055e6dcf28c07dd57ab94cccc303e98ebbb"
35
+ "gitHead": "f6534cbfe0ebbaf134fd2734c7abd9ecad95fcc4"
36
36
  }
@@ -1,6 +1,6 @@
1
1
  .fs-rich-text-field {
2
2
  width: 100%;
3
- min-width: 240px;
3
+ min-width: 120px;
4
4
  outline: none !important;
5
5
  border: 1px solid var(--fs-rich-text-field-border-color) !important;
6
6
  border-radius: 4px !important;
@@ -1,7 +1,3 @@
1
- .fs-time-field-select {
2
- min-width: 180px;
3
- }
4
-
5
1
  .fs-time-field-label {
6
2
  color: var(--fs-time-field-color);
7
3
  }
@@ -34,8 +34,13 @@
34
34
  flex: 0 0 auto;
35
35
  }
36
36
 
37
- &:not(.v-checkbox):not(.v-slider):not(.fs-small-input) {
38
- min-width: 150px;
37
+ &:not(.v-checkbox):not(.v-slider):not(.fs-small-input):not(.fs-number-field) {
38
+ min-width: 120px;
39
+ width: 100%;
40
+ }
41
+
42
+ &.fs-number-field {
43
+ min-width: 80px;
39
44
  width: 100%;
40
45
  }
41
46
 
@@ -85,7 +90,7 @@
85
90
  }
86
91
 
87
92
  &:not(.fs-text-area) > .v-input__control > .v-field {
88
- padding: 0 16px !important;
93
+ padding: 0 12px 0 16px !important;
89
94
 
90
95
  & > .v-field__field > .v-field__input {
91
96
  @extend .text-body;