@dative-gpi/foundation-shared-components 0.0.160 → 0.0.162
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.
- package/components/fields/FSIconField.vue +3 -0
- package/components/fields/FSNumberField.vue +1 -0
- package/components/fields/FSPasswordField.vue +8 -9
- package/components/fields/FSSearchField.vue +28 -23
- package/components/fields/FSTagField.vue +14 -11
- package/components/fields/FSTimeField.vue +33 -3
- package/components/fields/FSTranslateField.vue +16 -13
- package/package.json +4 -4
- package/styles/components/fs_rich_text_field.scss +1 -1
- package/styles/components/fs_time_field.scss +0 -4
- package/styles/globals/overrides.scss +8 -3
|
@@ -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>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
v-bind="$attrs"
|
|
8
8
|
>
|
|
9
9
|
<template
|
|
10
|
-
v-for="(_, name) in
|
|
10
|
+
v-for="(_, name) in slots"
|
|
11
11
|
v-slot:[name]="slotData"
|
|
12
12
|
>
|
|
13
13
|
<slot
|
|
@@ -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>
|
|
@@ -58,6 +56,8 @@ import { computed, defineComponent, PropType, ref, watch } from "vue";
|
|
|
58
56
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
59
57
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
60
58
|
|
|
59
|
+
import { useSlots } from "../../composables";
|
|
60
|
+
|
|
61
61
|
import FSTextField from "./FSTextField.vue";
|
|
62
62
|
import FSButton from "../FSButton.vue";
|
|
63
63
|
|
|
@@ -122,6 +122,10 @@ export default defineComponent({
|
|
|
122
122
|
emits: ["update:modelValue"],
|
|
123
123
|
setup(props, { emit }) {
|
|
124
124
|
const { $tr } = useTranslationsProvider();
|
|
125
|
+
const { slots } = useSlots();
|
|
126
|
+
|
|
127
|
+
delete slots["prepend-inner"];
|
|
128
|
+
delete slots.append;
|
|
125
129
|
|
|
126
130
|
const innerValue = ref(props.modelValue);
|
|
127
131
|
|
|
@@ -150,6 +154,7 @@ export default defineComponent({
|
|
|
150
154
|
buttonLabel,
|
|
151
155
|
innerValue,
|
|
152
156
|
ColorEnum,
|
|
157
|
+
slots,
|
|
153
158
|
onSearch
|
|
154
159
|
};
|
|
155
160
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
v-bind="$attrs"
|
|
16
16
|
>
|
|
17
17
|
<template
|
|
18
|
-
v-for="(_, name) in
|
|
18
|
+
v-for="(_, name) in slots"
|
|
19
19
|
v-slot:[name]="slotData"
|
|
20
20
|
>
|
|
21
21
|
<slot
|
|
@@ -26,17 +26,16 @@
|
|
|
26
26
|
<template
|
|
27
27
|
#append-inner
|
|
28
28
|
>
|
|
29
|
+
<FSButton
|
|
30
|
+
variant="icon"
|
|
31
|
+
icon="mdi-tag-outline"
|
|
32
|
+
:editable="$props.editable"
|
|
33
|
+
:color="ColorEnum.Dark"
|
|
34
|
+
@click="onAdd"
|
|
35
|
+
/>
|
|
29
36
|
<slot
|
|
30
37
|
name="append-inner"
|
|
31
|
-
|
|
32
|
-
<FSButton
|
|
33
|
-
variant="icon"
|
|
34
|
-
icon="mdi-tag-outline"
|
|
35
|
-
:editable="$props.editable"
|
|
36
|
-
:color="ColorEnum.Dark"
|
|
37
|
-
@click="onAdd"
|
|
38
|
-
/>
|
|
39
|
-
</slot>
|
|
38
|
+
/>
|
|
40
39
|
</template>
|
|
41
40
|
</FSTextField>
|
|
42
41
|
<FSTagGroup
|
|
@@ -52,8 +51,8 @@
|
|
|
52
51
|
<script lang="ts">
|
|
53
52
|
import { computed, defineComponent, PropType, ref } from "vue";
|
|
54
53
|
|
|
54
|
+
import { useColors, useRules, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
55
55
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
56
|
-
import { useColors, useRules } from "@dative-gpi/foundation-shared-components/composables";
|
|
57
56
|
|
|
58
57
|
import FSTextField from "./FSTextField.vue";
|
|
59
58
|
import FSTagGroup from "../FSTagGroup.vue";
|
|
@@ -119,6 +118,9 @@ export default defineComponent({
|
|
|
119
118
|
setup(props, { emit }) {
|
|
120
119
|
const {validateOn, getMessages} = useRules();
|
|
121
120
|
const { getColors } = useColors();
|
|
121
|
+
const { slots } = useSlots();
|
|
122
|
+
|
|
123
|
+
delete slots["append-inner"];
|
|
122
124
|
|
|
123
125
|
const errors = getColors(ColorEnum.Error);
|
|
124
126
|
const lights = getColors(ColorEnum.Light);
|
|
@@ -170,6 +172,7 @@ export default defineComponent({
|
|
|
170
172
|
validateOn,
|
|
171
173
|
ColorEnum,
|
|
172
174
|
messages,
|
|
175
|
+
slots,
|
|
173
176
|
style,
|
|
174
177
|
onRemove,
|
|
175
178
|
onAdd
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
v-bind="$attrs"
|
|
21
21
|
>
|
|
22
22
|
<template
|
|
23
|
-
v-for="(_, name) in
|
|
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,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
v-bind="$attrs"
|
|
7
7
|
>
|
|
8
8
|
<template
|
|
9
|
-
v-for="(_, name) in
|
|
9
|
+
v-for="(_, name) in slots"
|
|
10
10
|
v-slot:[name]="slotData"
|
|
11
11
|
>
|
|
12
12
|
<slot
|
|
@@ -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
|
|
@@ -90,7 +89,7 @@ import { computed, defineComponent, onMounted, PropType, ref } from "vue";
|
|
|
90
89
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
91
90
|
import { useLanguages } from "@dative-gpi/foundation-shared-services/composables";
|
|
92
91
|
|
|
93
|
-
import { useColors } from "../../composables";
|
|
92
|
+
import { useColors, useSlots } from "../../composables";
|
|
94
93
|
|
|
95
94
|
import FSDialogSubmit from "../FSDialogSubmit.vue";
|
|
96
95
|
import FSTextField from "./FSTextField.vue";
|
|
@@ -160,6 +159,9 @@ export default defineComponent({
|
|
|
160
159
|
setup(props, { emit }) {
|
|
161
160
|
const { getMany: getManyLanguages, fetching: fetchingLanguages, entities: languages } = useLanguages();
|
|
162
161
|
const { getColors } = useColors();
|
|
162
|
+
const { slots } = useSlots();
|
|
163
|
+
|
|
164
|
+
delete slots.append;
|
|
163
165
|
|
|
164
166
|
const innerTranslations = ref(props.translations);
|
|
165
167
|
const dialog = ref(false);
|
|
@@ -226,6 +228,7 @@ export default defineComponent({
|
|
|
226
228
|
ColorEnum,
|
|
227
229
|
languages,
|
|
228
230
|
dialog,
|
|
231
|
+
slots,
|
|
229
232
|
style,
|
|
230
233
|
getTranslation,
|
|
231
234
|
setTranslation,
|
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.
|
|
4
|
+
"version": "0.0.162",
|
|
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.
|
|
14
|
-
"@dative-gpi/foundation-shared-services": "0.0.
|
|
13
|
+
"@dative-gpi/foundation-shared-domain": "0.0.162",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "0.0.162",
|
|
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": "
|
|
35
|
+
"gitHead": "bc6eb7f88688792ee99ea10e71b4a53df55b464f"
|
|
36
36
|
}
|
|
@@ -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:
|
|
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;
|