@dative-gpi/foundation-shared-components 0.0.49 → 0.0.51
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/FSAccordion.vue +3 -3
- package/components/FSAccordionPanel.vue +5 -5
- package/components/FSBadge.vue +1 -1
- package/components/FSBreadcrumbs.vue +1 -1
- package/components/FSButton.vue +5 -5
- package/components/FSCalendar.vue +22 -12
- package/components/FSCalendarTwin.vue +16 -12
- package/components/FSCard.vue +11 -2
- package/components/FSCarousel.vue +1 -1
- package/components/FSCheckbox.vue +4 -4
- package/components/FSChip.vue +4 -4
- package/components/FSClickable.vue +1 -1
- package/components/FSClock.vue +40 -48
- package/components/FSCol.vue +1 -1
- package/components/FSColor.vue +9 -7
- package/components/FSColorIcon.vue +1 -1
- package/components/FSDivider.vue +2 -2
- package/components/FSEditImage.vue +131 -0
- package/components/FSErrorToast.vue +1 -1
- package/components/FSFadeOut.vue +1 -1
- package/components/FSForm.vue +4 -4
- package/components/FSGrid.vue +1 -1
- package/components/FSImage.vue +50 -12
- package/components/FSLabel.vue +1 -1
- package/components/FSLink.vue +1 -1
- package/components/FSLoader.vue +1 -1
- package/components/FSOptionGroup.vue +3 -3
- package/components/FSOptionItem.vue +4 -4
- package/components/FSPagination.vue +1 -1
- package/components/FSRadio.vue +4 -4
- package/components/FSRadioGroup.vue +3 -3
- package/components/FSRow.vue +1 -1
- package/components/FSSlideGroup.vue +11 -11
- package/components/FSSlider.vue +4 -4
- package/components/FSSpan.vue +1 -1
- package/components/FSSubmitDialog.vue +8 -8
- package/components/FSSwitch.vue +4 -4
- package/components/FSTab.vue +4 -4
- package/components/FSTabs.vue +2 -2
- package/components/FSTag.vue +2 -2
- package/components/FSText.vue +1 -1
- package/components/FSToggleSet.vue +4 -4
- package/components/FSWindow.vue +1 -1
- package/components/FSWrapGroup.vue +2 -2
- package/components/buttons/FSButtonFile.vue +17 -10
- package/components/buttons/FSButtonFileIcon.vue +17 -10
- package/components/buttons/FSButtonFileLabel.vue +17 -10
- package/components/buttons/FSButtonFileMini.vue +17 -10
- package/components/deviceOrganisations/FSConnectivityCard.vue +2 -2
- package/components/deviceOrganisations/FSStatusCard.vue +2 -2
- package/components/deviceOrganisations/FSStatusesCarousel.vue +2 -3
- package/components/deviceOrganisations/FSStatusesRow.vue +2 -3
- package/components/deviceOrganisations/FSWorstAlertCard.vue +2 -2
- package/components/fields/FSAutocompleteField.vue +5 -5
- package/components/fields/FSColorField.vue +3 -3
- package/components/fields/FSDateField.vue +10 -9
- package/components/fields/FSDateRangeField.vue +8 -8
- package/components/fields/FSDateTimeField.vue +16 -14
- package/components/fields/FSDateTimeRangeField.vue +12 -14
- package/components/fields/FSIconField.vue +10 -10
- package/components/fields/FSNumberField.vue +2 -2
- package/components/fields/FSPasswordField.vue +4 -4
- package/components/fields/FSRichTextField.vue +82 -92
- package/components/fields/FSSearchField.vue +8 -8
- package/components/fields/FSSelectField.vue +6 -6
- package/components/fields/FSTagField.vue +4 -4
- package/components/fields/FSTextArea.vue +5 -5
- package/components/fields/FSTextField.vue +5 -5
- package/components/fields/FSTimeField.vue +15 -9
- package/components/fields/FSTimeSlotField.vue +49 -21
- package/components/lists/FSDataTableUI.vue +24 -12
- package/components/lists/FSDraggable.vue +12 -6
- package/components/lists/FSFilterButton.vue +11 -8
- package/components/lists/FSLoadDataTable.vue +1 -1
- package/components/selects/FSSelectTimeZone.vue +7 -11
- package/components/tiles/FSDeviceOrganisationTileUI.vue +3 -3
- package/components/tiles/FSGroupTileUI.vue +3 -3
- package/components/tiles/FSLoadTile.vue +1 -1
- package/components/tiles/FSTile.vue +1 -1
- package/composables/index.ts +1 -0
- package/composables/useFiles.ts +13 -0
- package/composables/useRules.ts +1 -1
- package/models/colors.ts +1 -1
- package/models/deviceStatuses.ts +1 -1
- package/models/images.ts +4 -0
- package/models/index.ts +1 -0
- package/models/rules.ts +2 -2
- package/package.json +4 -4
- package/styles/components/fs_clock.scss +3 -2
- package/styles/components/fs_edit_image.scss +3 -0
- package/styles/components/index.scss +1 -0
- package/styles/globals/overrides.scss +1 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSRow
|
|
3
|
+
width="fill"
|
|
4
|
+
gap="24px"
|
|
5
|
+
>
|
|
6
|
+
<FSCard
|
|
7
|
+
class="fs-edit-image"
|
|
8
|
+
:borderRadius="$props.borderRadius"
|
|
9
|
+
:padding="$props.padding"
|
|
10
|
+
>
|
|
11
|
+
<FSImage
|
|
12
|
+
:borderRadius="$props.borderRadius"
|
|
13
|
+
:aspectRatio="$props.aspectRatio"
|
|
14
|
+
:height="$props.height"
|
|
15
|
+
:imageB64="realSource"
|
|
16
|
+
:width="$props.width"
|
|
17
|
+
/>
|
|
18
|
+
</FSCard>
|
|
19
|
+
<FSCol
|
|
20
|
+
height="fill"
|
|
21
|
+
align="bottom-left"
|
|
22
|
+
>
|
|
23
|
+
<FSText
|
|
24
|
+
v-if="fileSelected"
|
|
25
|
+
font="text-body"
|
|
26
|
+
>
|
|
27
|
+
{{ fileSelected.fileName }}
|
|
28
|
+
</FSText>
|
|
29
|
+
<FSRow>
|
|
30
|
+
<FSButtonFileIcon
|
|
31
|
+
accept="image/*"
|
|
32
|
+
:readFile="false"
|
|
33
|
+
@update:modelValue="onUpload"
|
|
34
|
+
/>
|
|
35
|
+
<FSButtonRemoveIcon
|
|
36
|
+
@click="onRemove"
|
|
37
|
+
/>
|
|
38
|
+
</FSRow>
|
|
39
|
+
</FSCol>
|
|
40
|
+
</FSRow>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script lang="ts">
|
|
44
|
+
import { computed, defineComponent, PropType, ref } from "vue";
|
|
45
|
+
|
|
46
|
+
import { useFiles } from "@dative-gpi/foundation-shared-components/composables";
|
|
47
|
+
import { FileImage } from "@dative-gpi/foundation-shared-components/models";
|
|
48
|
+
|
|
49
|
+
import FSButtonRemoveIcon from "./buttons/FSButtonRemoveIcon.vue";
|
|
50
|
+
import FSButtonFileIcon from "./buttons/FSButtonFileIcon.vue";
|
|
51
|
+
import FSImage from "./FSImage.vue";
|
|
52
|
+
import FSCard from "./FSCard.vue";
|
|
53
|
+
import FSText from "./FSText.vue";
|
|
54
|
+
|
|
55
|
+
export default defineComponent({
|
|
56
|
+
name: "FSEditImage",
|
|
57
|
+
components: {
|
|
58
|
+
FSButtonRemoveIcon,
|
|
59
|
+
FSButtonFileIcon,
|
|
60
|
+
FSImage,
|
|
61
|
+
FSCard,
|
|
62
|
+
FSText
|
|
63
|
+
},
|
|
64
|
+
props: {
|
|
65
|
+
padding: {
|
|
66
|
+
type: [String, Number],
|
|
67
|
+
required: false,
|
|
68
|
+
default: "8px"
|
|
69
|
+
},
|
|
70
|
+
width: {
|
|
71
|
+
type: [String, Number],
|
|
72
|
+
required: false,
|
|
73
|
+
default: null
|
|
74
|
+
},
|
|
75
|
+
height: {
|
|
76
|
+
type: [String, Number],
|
|
77
|
+
required: false,
|
|
78
|
+
default: null
|
|
79
|
+
},
|
|
80
|
+
aspectRatio: {
|
|
81
|
+
type: String as PropType<string | null>,
|
|
82
|
+
required: false,
|
|
83
|
+
default: null
|
|
84
|
+
},
|
|
85
|
+
borderRadius: {
|
|
86
|
+
type: [String, Number],
|
|
87
|
+
required: false,
|
|
88
|
+
default: "4px"
|
|
89
|
+
},
|
|
90
|
+
modelValue: {
|
|
91
|
+
type: String as PropType<string | null>,
|
|
92
|
+
required: false,
|
|
93
|
+
default: null
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
emits: ["update:modelValue"],
|
|
97
|
+
setup(props, { emit }) {
|
|
98
|
+
const { read } = useFiles();
|
|
99
|
+
|
|
100
|
+
const fileSelected = ref<FileImage>({ fileName: "", fileContent: null });
|
|
101
|
+
|
|
102
|
+
const realSource = computed(() => {
|
|
103
|
+
if (fileSelected.value && fileSelected.value.fileName) {
|
|
104
|
+
return fileSelected.value.fileContent as string;
|
|
105
|
+
}
|
|
106
|
+
return props.modelValue;
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
const onUpload = (payload: File) => {
|
|
110
|
+
read(payload, (content: string) => {
|
|
111
|
+
fileSelected.value.fileName = payload.name;
|
|
112
|
+
fileSelected.value.fileContent = content;
|
|
113
|
+
emit("update:modelValue", content);
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const onRemove = () => {
|
|
118
|
+
fileSelected.value.fileName = "";
|
|
119
|
+
fileSelected.value.fileContent = null;
|
|
120
|
+
emit("update:modelValue", null);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
return {
|
|
124
|
+
fileSelected,
|
|
125
|
+
realSource,
|
|
126
|
+
onUpload,
|
|
127
|
+
onRemove
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
</script>
|
|
@@ -48,7 +48,7 @@ export default defineComponent({
|
|
|
48
48
|
|
|
49
49
|
const errors = getColors(ColorEnum.Error);
|
|
50
50
|
|
|
51
|
-
const style = computed((): { [
|
|
51
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
52
52
|
return {
|
|
53
53
|
"--fs-error-toast-border-radius" : sizeToVar(props.borderRadius),
|
|
54
54
|
"--fs-error-toast-background-color": errors.base,
|
package/components/FSFadeOut.vue
CHANGED
|
@@ -52,7 +52,7 @@ export default defineComponent({
|
|
|
52
52
|
const bottomMaskHeight = ref("0px");
|
|
53
53
|
const topMaskHeight = ref("0px");
|
|
54
54
|
|
|
55
|
-
const style = computed((): { [
|
|
55
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
56
56
|
return {
|
|
57
57
|
"--fs-fade-out-height" : sizeToVar(props.height),
|
|
58
58
|
"--fs-fade-out-width" : sizeToVar(props.width),
|
package/components/FSForm.vue
CHANGED
|
@@ -17,7 +17,7 @@ export default defineComponent({
|
|
|
17
17
|
name: "FSForm",
|
|
18
18
|
props: {
|
|
19
19
|
modelValue: {
|
|
20
|
-
type: Boolean
|
|
20
|
+
type: Boolean as PropType<boolean | null>,
|
|
21
21
|
required: false,
|
|
22
22
|
default: null
|
|
23
23
|
},
|
|
@@ -44,9 +44,9 @@ export default defineComponent({
|
|
|
44
44
|
event.stopImmediatePropagation();
|
|
45
45
|
event.preventDefault();
|
|
46
46
|
submitted.value = true;
|
|
47
|
-
await formRef.value.validate();
|
|
48
|
-
emit("update:modelValue", !!formRef.value.isValid);
|
|
49
|
-
emit("submit", !!formRef.value.isValid);
|
|
47
|
+
await (formRef.value as any).validate();
|
|
48
|
+
emit("update:modelValue", !!(formRef.value as any).isValid);
|
|
49
|
+
emit("submit", !!(formRef.value as any).isValid);
|
|
50
50
|
|
|
51
51
|
};
|
|
52
52
|
|
package/components/FSGrid.vue
CHANGED
|
@@ -85,7 +85,7 @@ export default defineComponent({
|
|
|
85
85
|
|
|
86
86
|
const lights = getColors(ColorEnum.Light);
|
|
87
87
|
|
|
88
|
-
const style = computed((): {[
|
|
88
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
89
89
|
return {
|
|
90
90
|
"--fs-grid-border-color": lights.dark
|
|
91
91
|
};
|
package/components/FSImage.vue
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
36
|
<script lang="ts">
|
|
37
|
-
import { computed, defineComponent, ref, watch } from "vue";
|
|
37
|
+
import { computed, defineComponent, PropType, ref, watch } from "vue";
|
|
38
38
|
import { decode, isBlurhashValid } from "blurhash";
|
|
39
39
|
|
|
40
40
|
import { useImageBlurHash } from "@dative-gpi/foundation-shared-services/composables";
|
|
@@ -50,7 +50,12 @@ export default defineComponent({
|
|
|
50
50
|
},
|
|
51
51
|
props: {
|
|
52
52
|
imageId: {
|
|
53
|
-
type:
|
|
53
|
+
type: String as PropType<string | null>,
|
|
54
|
+
required: false,
|
|
55
|
+
default: null
|
|
56
|
+
},
|
|
57
|
+
imageB64: {
|
|
58
|
+
type: String as PropType<string | null>,
|
|
54
59
|
required: false,
|
|
55
60
|
default: null
|
|
56
61
|
},
|
|
@@ -70,7 +75,7 @@ export default defineComponent({
|
|
|
70
75
|
default: null
|
|
71
76
|
},
|
|
72
77
|
aspectRatio: {
|
|
73
|
-
type: String
|
|
78
|
+
type: String as PropType<string | null>,
|
|
74
79
|
required: false,
|
|
75
80
|
default: null
|
|
76
81
|
},
|
|
@@ -83,10 +88,18 @@ export default defineComponent({
|
|
|
83
88
|
setup(props) {
|
|
84
89
|
const { get: fetchBlurHash, entity: blurHash } = useImageBlurHash();
|
|
85
90
|
|
|
86
|
-
const imageRef = ref(null);
|
|
87
|
-
const canvasRef = ref(null);
|
|
91
|
+
const imageRef = ref<HTMLFormElement | null>(null);
|
|
92
|
+
const canvasRef = ref<HTMLCanvasElement | null>(null);
|
|
93
|
+
|
|
94
|
+
const signatures = ref<{ [key: string]: string }>({
|
|
95
|
+
JVBERi0 : "application/pdf",
|
|
96
|
+
R0lGODdh : "image/gif",
|
|
97
|
+
R0lGODlh : "image/gif",
|
|
98
|
+
iVBORw0KGgo: "image/png",
|
|
99
|
+
"/9j/" : "image/jpg",
|
|
100
|
+
});
|
|
88
101
|
|
|
89
|
-
const style = computed((): { [
|
|
102
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
90
103
|
return {
|
|
91
104
|
"--fs-image-border-radius" : sizeToVar(props.borderRadius),
|
|
92
105
|
"--fs-image-blurhash-opacity": blurHash.value ? "1" : "0"
|
|
@@ -98,7 +111,7 @@ export default defineComponent({
|
|
|
98
111
|
return props.height;
|
|
99
112
|
}
|
|
100
113
|
if (props.width) {
|
|
101
|
-
if (typeof(props.width) === "string") {
|
|
114
|
+
if (typeof (props.width) === "string") {
|
|
102
115
|
return undefined;
|
|
103
116
|
}
|
|
104
117
|
if (props.aspectRatio) {
|
|
@@ -117,7 +130,7 @@ export default defineComponent({
|
|
|
117
130
|
return props.width;
|
|
118
131
|
}
|
|
119
132
|
if (props.height) {
|
|
120
|
-
if (typeof(props.height) === "string") {
|
|
133
|
+
if (typeof (props.height) === "string") {
|
|
121
134
|
return undefined;
|
|
122
135
|
}
|
|
123
136
|
if (props.aspectRatio) {
|
|
@@ -131,16 +144,41 @@ export default defineComponent({
|
|
|
131
144
|
return undefined;
|
|
132
145
|
});
|
|
133
146
|
|
|
134
|
-
const source = computed((): string |
|
|
147
|
+
const source = computed((): string | undefined => {
|
|
135
148
|
if (props.imageId) {
|
|
136
149
|
return IMAGE_RAW_URL(props.imageId);
|
|
137
150
|
}
|
|
151
|
+
else if (props.imageB64) {
|
|
152
|
+
if (imageType.value && imageData.value) {
|
|
153
|
+
return `${imageType.value},${imageData.value}`;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
const imageData = computed((): string | null => {
|
|
159
|
+
if (props.imageB64 && props.imageB64.includes(",")) {
|
|
160
|
+
return props.imageB64.split(",")[1];
|
|
161
|
+
}
|
|
162
|
+
return props.imageB64;
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
const imageType = computed((): string | null => {
|
|
166
|
+
if (props.imageB64 && props.imageB64.includes(",")) {
|
|
167
|
+
return props.imageB64.split(",")[0];
|
|
168
|
+
}
|
|
169
|
+
if (props.imageB64) {
|
|
170
|
+
for (const s in signatures.value) {
|
|
171
|
+
if (props.imageB64.startsWith(s)) {
|
|
172
|
+
return `data:${signatures.value[s]};base64`;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
138
176
|
return null;
|
|
139
177
|
});
|
|
140
178
|
|
|
141
179
|
const onError = (): void => {
|
|
142
180
|
if (props.imageId) {
|
|
143
|
-
fetchBlurHash(props.imageId);
|
|
181
|
+
fetchBlurHash(props.imageId);
|
|
144
182
|
}
|
|
145
183
|
};
|
|
146
184
|
|
|
@@ -149,8 +187,8 @@ export default defineComponent({
|
|
|
149
187
|
if (blurHash.value && isBlurhashValid(blurHash.value.blurHash).result) {
|
|
150
188
|
const ctx = canvasRef.value.getContext("2d");
|
|
151
189
|
if (ctx) {
|
|
152
|
-
const pixels = decode(blurHash.value.blurHash, imageRef.value.$el.clientWidth, imageRef.value.$el.clientHeight);
|
|
153
|
-
const imageData = ctx.createImageData(imageRef.value.$el.clientWidth, imageRef.value.$el.clientHeight);
|
|
190
|
+
const pixels = decode(blurHash.value.blurHash, (imageRef.value as any).$el.clientWidth, (imageRef.value as any).$el.clientHeight);
|
|
191
|
+
const imageData = ctx.createImageData((imageRef.value as any).$el.clientWidth, (imageRef.value as any).$el.clientHeight);
|
|
154
192
|
imageData.data.set(pixels);
|
|
155
193
|
ctx.putImageData(imageData, 0, 0);
|
|
156
194
|
}
|
package/components/FSLabel.vue
CHANGED
|
@@ -80,7 +80,7 @@ export default defineComponent({
|
|
|
80
80
|
return classNames;
|
|
81
81
|
});
|
|
82
82
|
|
|
83
|
-
const style = computed((): { [
|
|
83
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
84
84
|
switch (props.variant) {
|
|
85
85
|
case "base": return {
|
|
86
86
|
"--fs-span-line-clamp": props.lineClamp.toString(),
|
package/components/FSLink.vue
CHANGED
|
@@ -79,7 +79,7 @@ export default defineComponent({
|
|
|
79
79
|
return classNames;
|
|
80
80
|
});
|
|
81
81
|
|
|
82
|
-
const style = computed((): { [
|
|
82
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
83
83
|
switch (props.variant) {
|
|
84
84
|
case "base": return {
|
|
85
85
|
"--fs-span-line-clamp": props.lineClamp.toString(),
|
package/components/FSLoader.vue
CHANGED
|
@@ -48,7 +48,7 @@ export default defineComponent({
|
|
|
48
48
|
|
|
49
49
|
const backgrounds = getColors(ColorEnum.Background);
|
|
50
50
|
|
|
51
|
-
const style = computed((): {[
|
|
51
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
52
52
|
return {
|
|
53
53
|
"--fs-loader-background-color": backgrounds.base,
|
|
54
54
|
"--fs-loader-border-radius" : ["chip"].includes(props.variant) ? "50px" : sizeToVar(props.borderRadius),
|
|
@@ -146,9 +146,9 @@ export default defineComponent({
|
|
|
146
146
|
default: null
|
|
147
147
|
},
|
|
148
148
|
modelValue: {
|
|
149
|
-
type: [Array, String, Number] as PropType<(string | number)[] | string | number>,
|
|
149
|
+
type: [Array, String, Number] as PropType<(string | number)[] | string | number | null>,
|
|
150
150
|
required: false,
|
|
151
|
-
default:
|
|
151
|
+
default: null
|
|
152
152
|
},
|
|
153
153
|
optionColor: {
|
|
154
154
|
type: String as PropType<ColorBase>,
|
|
@@ -195,7 +195,7 @@ export default defineComponent({
|
|
|
195
195
|
|
|
196
196
|
const firstChild = getFirstChild("item");
|
|
197
197
|
|
|
198
|
-
const style = computed((): { [
|
|
198
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
199
199
|
return {
|
|
200
200
|
"--fs-option-group-border-size" : props.border ? "1px" : "0",
|
|
201
201
|
"--fs-option-group-border-radius": sizeToVar(props.borderRadius),
|
|
@@ -63,22 +63,22 @@ export default defineComponent({
|
|
|
63
63
|
},
|
|
64
64
|
props: {
|
|
65
65
|
prependIcon: {
|
|
66
|
-
type: String
|
|
66
|
+
type: String as PropType<string | null>,
|
|
67
67
|
required: false,
|
|
68
68
|
default: null
|
|
69
69
|
},
|
|
70
70
|
label: {
|
|
71
|
-
type:
|
|
71
|
+
type: String as PropType<string | null>,
|
|
72
72
|
required: false,
|
|
73
73
|
default: null
|
|
74
74
|
},
|
|
75
75
|
appendIcon: {
|
|
76
|
-
type: String
|
|
76
|
+
type: String as PropType<string | null>,
|
|
77
77
|
required: false,
|
|
78
78
|
default: null
|
|
79
79
|
},
|
|
80
80
|
icon: {
|
|
81
|
-
type: String
|
|
81
|
+
type: String as PropType<string | null>,
|
|
82
82
|
required: false,
|
|
83
83
|
default: null
|
|
84
84
|
},
|
|
@@ -63,7 +63,7 @@ export default defineComponent({
|
|
|
63
63
|
const lights = getColors(ColorEnum.Light);
|
|
64
64
|
const darks = getColors(ColorEnum.Dark);
|
|
65
65
|
|
|
66
|
-
const style = computed((): {[
|
|
66
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
67
67
|
switch (props.color) {
|
|
68
68
|
case ColorEnum.Light:
|
|
69
69
|
case ColorEnum.Dark: return {
|
package/components/FSRadio.vue
CHANGED
|
@@ -73,12 +73,12 @@ export default defineComponent({
|
|
|
73
73
|
},
|
|
74
74
|
props: {
|
|
75
75
|
label: {
|
|
76
|
-
type: String
|
|
76
|
+
type: String as PropType<string | null>,
|
|
77
77
|
required: false,
|
|
78
78
|
default: null
|
|
79
79
|
},
|
|
80
80
|
description: {
|
|
81
|
-
type: String
|
|
81
|
+
type: String as PropType<string | null>,
|
|
82
82
|
required: false,
|
|
83
83
|
default: null
|
|
84
84
|
},
|
|
@@ -97,7 +97,7 @@ export default defineComponent({
|
|
|
97
97
|
default: ColorEnum.Primary
|
|
98
98
|
},
|
|
99
99
|
rules: {
|
|
100
|
-
type: Array as PropType<
|
|
100
|
+
type: Array as PropType<any[]>,
|
|
101
101
|
required: false,
|
|
102
102
|
default: () => []
|
|
103
103
|
},
|
|
@@ -122,7 +122,7 @@ export default defineComponent({
|
|
|
122
122
|
const lights = getColors(ColorEnum.Light);
|
|
123
123
|
const darks = getColors(ColorEnum.Dark);
|
|
124
124
|
|
|
125
|
-
const style = computed((): {[
|
|
125
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
126
126
|
if (!props.editable) {
|
|
127
127
|
return {
|
|
128
128
|
"--fs-radio-cursor" : "default",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSCol width="hug">
|
|
3
3
|
<FSRadio
|
|
4
|
-
v-for="item in $props.values"
|
|
5
|
-
:key="
|
|
4
|
+
v-for="(item, index) in $props.values"
|
|
5
|
+
:key="index"
|
|
6
6
|
:label="item.label"
|
|
7
7
|
:description="item.description"
|
|
8
8
|
:selected="isSelected(item.value)"
|
|
@@ -30,7 +30,7 @@ export default defineComponent({
|
|
|
30
30
|
},
|
|
31
31
|
props: {
|
|
32
32
|
values: {
|
|
33
|
-
type: Array as PropType<{ value:
|
|
33
|
+
type: Array as PropType<{ value: string | boolean | number, label?: string, description?: string }[]>,
|
|
34
34
|
required: true,
|
|
35
35
|
default: false
|
|
36
36
|
},
|
package/components/FSRow.vue
CHANGED
|
@@ -48,7 +48,7 @@ export default defineComponent({
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
setup(props) {
|
|
51
|
-
const style = computed((): {[
|
|
51
|
+
const style = computed((): { [key: string] : string | undefined } => ({
|
|
52
52
|
"--fs-row-flex-wrap": props.wrap ? "wrap" : "nowrap",
|
|
53
53
|
"--fs-row-padding" : sizeToVar(props.padding),
|
|
54
54
|
"--fs-row-gap" : sizeToVar(props.gap),
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
</template>
|
|
21
21
|
<template #default>
|
|
22
22
|
<v-slide-group-item
|
|
23
|
-
v-for="(component, index) in getChildren()"
|
|
23
|
+
v-for="(component, index) in getChildren(undefined)"
|
|
24
24
|
:key="index"
|
|
25
25
|
>
|
|
26
26
|
<component :is="component" />
|
|
@@ -87,9 +87,9 @@ export default defineComponent({
|
|
|
87
87
|
|
|
88
88
|
const darks = getColors(ColorEnum.Dark);
|
|
89
89
|
|
|
90
|
-
const slideGroupRef = ref(null);
|
|
90
|
+
const slideGroupRef = ref<HTMLElement | null>(null);
|
|
91
91
|
|
|
92
|
-
const style = computed((): { [
|
|
92
|
+
const style = computed((): { [key: string] : string | undefined } => ({
|
|
93
93
|
"--fs-group-arrows-width": props.dash ? "52px" : "32px",
|
|
94
94
|
"--fs-group-padding" : sizeToVar(props.padding),
|
|
95
95
|
"--fs-group-gap" : sizeToVar(props.gap),
|
|
@@ -99,31 +99,31 @@ export default defineComponent({
|
|
|
99
99
|
|
|
100
100
|
const goToStart = () => {
|
|
101
101
|
if (slideGroupRef.value) {
|
|
102
|
-
slideGroupRef.value.scrollOffset = 0;
|
|
102
|
+
(slideGroupRef.value as any).scrollOffset = 0;
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
105
|
|
|
106
106
|
const goToPrev = () => {
|
|
107
107
|
if (slideGroupRef.value) {
|
|
108
|
-
slideGroupRef.value.scrollOffset = Math.max(0, slideGroupRef.value.scrollOffset - props.speed);
|
|
108
|
+
(slideGroupRef.value as any).scrollOffset = Math.max(0, (slideGroupRef.value as any).scrollOffset - props.speed);
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
111
|
|
|
112
112
|
const goToEnd = () => {
|
|
113
113
|
if (slideGroupRef.value) {
|
|
114
|
-
const contentSize = slideGroupRef.value.$el.children[1].children[0].clientWidth;
|
|
115
|
-
const containerSize = slideGroupRef.value.$el.clientWidth;
|
|
114
|
+
const contentSize = (slideGroupRef.value as any).$el.children[1].children[0].clientWidth;
|
|
115
|
+
const containerSize = (slideGroupRef.value as any).$el.clientWidth;
|
|
116
116
|
const arrowsOffset = props.dash ? 104 : 64;
|
|
117
|
-
slideGroupRef.value.scrollOffset = (contentSize - containerSize + arrowsOffset);
|
|
117
|
+
(slideGroupRef.value as any).scrollOffset = (contentSize - containerSize + arrowsOffset);
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
120
|
|
|
121
121
|
const goToNext = () => {
|
|
122
122
|
if (slideGroupRef.value) {
|
|
123
|
-
const contentSize = slideGroupRef.value.$el.children[1].children[0].clientWidth;
|
|
124
|
-
const containerSize = slideGroupRef.value.$el.clientWidth;
|
|
123
|
+
const contentSize = (slideGroupRef.value as any).$el.children[1].children[0].clientWidth;
|
|
124
|
+
const containerSize = (slideGroupRef.value as any).$el.clientWidth;
|
|
125
125
|
const arrowsOffset = props.dash ? 104 : 64;
|
|
126
|
-
slideGroupRef.value.scrollOffset = Math.min(contentSize - containerSize + arrowsOffset, slideGroupRef.value.scrollOffset + props.speed);
|
|
126
|
+
(slideGroupRef.value as any).scrollOffset = Math.min(contentSize - containerSize + arrowsOffset, (slideGroupRef.value as any).scrollOffset + props.speed);
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
129
|
|
package/components/FSSlider.vue
CHANGED
|
@@ -70,17 +70,17 @@ export default defineComponent({
|
|
|
70
70
|
},
|
|
71
71
|
props: {
|
|
72
72
|
label: {
|
|
73
|
-
type: String
|
|
73
|
+
type: String as PropType<string | null>,
|
|
74
74
|
required: false,
|
|
75
75
|
default: null
|
|
76
76
|
},
|
|
77
77
|
description: {
|
|
78
|
-
type: String
|
|
78
|
+
type: String as PropType<string | null>,
|
|
79
79
|
required: false,
|
|
80
80
|
default: null
|
|
81
81
|
},
|
|
82
82
|
modelValue: {
|
|
83
|
-
type: [String, Number]
|
|
83
|
+
type: [String, Number] as PropType<string | number | null>,
|
|
84
84
|
required: false,
|
|
85
85
|
default: null
|
|
86
86
|
},
|
|
@@ -107,7 +107,7 @@ export default defineComponent({
|
|
|
107
107
|
const lights = getColors(ColorEnum.Light);
|
|
108
108
|
const darks = getColors(ColorEnum.Dark);
|
|
109
109
|
|
|
110
|
-
const style = computed((): {[
|
|
110
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
111
111
|
if (!props.editable) {
|
|
112
112
|
return {
|
|
113
113
|
"--fs-slider-cursor" : "default",
|
package/components/FSSpan.vue
CHANGED
|
@@ -56,7 +56,7 @@ export default defineComponent({
|
|
|
56
56
|
return classNames;
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
-
const style = computed((): {[
|
|
59
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
60
60
|
return {
|
|
61
61
|
"--fs-span-line-clamp": props.lineClamp.toString()
|
|
62
62
|
};
|
|
@@ -78,27 +78,27 @@ export default defineComponent({
|
|
|
78
78
|
default: "auto"
|
|
79
79
|
},
|
|
80
80
|
title: {
|
|
81
|
-
type: String
|
|
81
|
+
type: String as PropType<string | null>,
|
|
82
82
|
required: false,
|
|
83
83
|
default: null
|
|
84
84
|
},
|
|
85
85
|
subtitle: {
|
|
86
|
-
type: String
|
|
86
|
+
type: String as PropType<string | null>,
|
|
87
87
|
required: false,
|
|
88
88
|
default: null
|
|
89
89
|
},
|
|
90
90
|
leftButtonPrependIcon: {
|
|
91
|
-
type: String
|
|
91
|
+
type: String as PropType<string | null>,
|
|
92
92
|
required: false,
|
|
93
93
|
default: null
|
|
94
94
|
},
|
|
95
95
|
leftButtonLabel: {
|
|
96
|
-
type: String
|
|
96
|
+
type: String as PropType<string | null>,
|
|
97
97
|
required: false,
|
|
98
98
|
default: null
|
|
99
99
|
},
|
|
100
100
|
leftButtonAppendIcon: {
|
|
101
|
-
type: String
|
|
101
|
+
type: String as PropType<string | null>,
|
|
102
102
|
required: false,
|
|
103
103
|
default: null
|
|
104
104
|
},
|
|
@@ -108,17 +108,17 @@ export default defineComponent({
|
|
|
108
108
|
default: "standard"
|
|
109
109
|
},
|
|
110
110
|
rightButtonPrependIcon: {
|
|
111
|
-
type: String
|
|
111
|
+
type: String as PropType<string | null>,
|
|
112
112
|
required: false,
|
|
113
113
|
default: null
|
|
114
114
|
},
|
|
115
115
|
rightButtonLabel: {
|
|
116
|
-
type: String
|
|
116
|
+
type: String as PropType<string | null>,
|
|
117
117
|
required: false,
|
|
118
118
|
default: null
|
|
119
119
|
},
|
|
120
120
|
rightButtonAppendIcon: {
|
|
121
|
-
type: String
|
|
121
|
+
type: String as PropType<string | null>,
|
|
122
122
|
required: false,
|
|
123
123
|
default: null
|
|
124
124
|
},
|
package/components/FSSwitch.vue
CHANGED
|
@@ -62,12 +62,12 @@ export default defineComponent({
|
|
|
62
62
|
},
|
|
63
63
|
props: {
|
|
64
64
|
label: {
|
|
65
|
-
type: String
|
|
65
|
+
type: String as PropType<string | null>,
|
|
66
66
|
required: false,
|
|
67
67
|
default: null
|
|
68
68
|
},
|
|
69
69
|
description: {
|
|
70
|
-
type: String
|
|
70
|
+
type: String as PropType<string | null>,
|
|
71
71
|
required: false,
|
|
72
72
|
default: null
|
|
73
73
|
},
|
|
@@ -82,7 +82,7 @@ export default defineComponent({
|
|
|
82
82
|
default: ColorEnum.Primary
|
|
83
83
|
},
|
|
84
84
|
rules: {
|
|
85
|
-
type: Array as PropType<
|
|
85
|
+
type: Array as PropType<any[]>,
|
|
86
86
|
required: false,
|
|
87
87
|
default: () => []
|
|
88
88
|
},
|
|
@@ -108,7 +108,7 @@ export default defineComponent({
|
|
|
108
108
|
const lights = getColors(ColorEnum.Light);
|
|
109
109
|
const darks = getColors(ColorEnum.Dark);
|
|
110
110
|
|
|
111
|
-
const style = computed((): { [
|
|
111
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
112
112
|
if (!props.editable) {
|
|
113
113
|
return {
|
|
114
114
|
"--fs-switch-translate-x": props.modelValue ? "8px" : "-8px",
|