@dative-gpi/foundation-shared-components 0.0.51 → 0.0.52
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/FSEditImage.vue +7 -8
- package/components/FSLabel.vue +1 -1
- package/components/FSLink.vue +1 -1
- package/components/FSSpan.vue +1 -1
- package/components/FSText.vue +1 -1
- package/components/buttons/FSButtonFile.vue +7 -8
- package/components/buttons/FSButtonFileIcon.vue +7 -8
- package/components/buttons/FSButtonFileLabel.vue +7 -8
- package/components/buttons/FSButtonFileMini.vue +7 -8
- package/composables/index.ts +0 -1
- package/package.json +4 -4
- package/composables/useFiles.ts +0 -13
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
<script lang="ts">
|
|
44
44
|
import { computed, defineComponent, PropType, ref } from "vue";
|
|
45
45
|
|
|
46
|
-
import { useFiles } from "@dative-gpi/foundation-shared-
|
|
46
|
+
import { useFiles } from "@dative-gpi/foundation-shared-services/composables";
|
|
47
47
|
import { FileImage } from "@dative-gpi/foundation-shared-components/models";
|
|
48
48
|
|
|
49
49
|
import FSButtonRemoveIcon from "./buttons/FSButtonRemoveIcon.vue";
|
|
@@ -95,7 +95,7 @@ export default defineComponent({
|
|
|
95
95
|
},
|
|
96
96
|
emits: ["update:modelValue"],
|
|
97
97
|
setup(props, { emit }) {
|
|
98
|
-
const {
|
|
98
|
+
const { readFile } = useFiles();
|
|
99
99
|
|
|
100
100
|
const fileSelected = ref<FileImage>({ fileName: "", fileContent: null });
|
|
101
101
|
|
|
@@ -106,12 +106,11 @@ export default defineComponent({
|
|
|
106
106
|
return props.modelValue;
|
|
107
107
|
});
|
|
108
108
|
|
|
109
|
-
const onUpload = (payload: File) => {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
});
|
|
109
|
+
const onUpload = async (payload: File) => {
|
|
110
|
+
const content = await readFile(payload);
|
|
111
|
+
fileSelected.value.fileName = payload.name;
|
|
112
|
+
fileSelected.value.fileContent = content;
|
|
113
|
+
emit("update:modelValue", content);
|
|
115
114
|
};
|
|
116
115
|
|
|
117
116
|
const onRemove = () => {
|
package/components/FSLabel.vue
CHANGED
package/components/FSLink.vue
CHANGED
package/components/FSSpan.vue
CHANGED
package/components/FSText.vue
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<script lang="ts">
|
|
23
23
|
import { defineComponent, ref } from "vue";
|
|
24
24
|
|
|
25
|
-
import { useFiles } from "@dative-gpi/foundation-shared-
|
|
25
|
+
import { useFiles } from "@dative-gpi/foundation-shared-services/composables";
|
|
26
26
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
27
27
|
|
|
28
28
|
import FSButton from "../FSButton.vue";
|
|
@@ -46,23 +46,23 @@ export default defineComponent({
|
|
|
46
46
|
},
|
|
47
47
|
emits: ["update:modelValue"],
|
|
48
48
|
setup(props, { emit }) {
|
|
49
|
-
const {
|
|
49
|
+
const { readFile } = useFiles();
|
|
50
50
|
|
|
51
51
|
const input = ref<HTMLFormElement | null>(null);
|
|
52
52
|
|
|
53
|
-
const clear = () => {
|
|
53
|
+
const clear = (): void => {
|
|
54
54
|
if (input.value) {
|
|
55
55
|
input.value.form && input.value.form.reset();
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
const onClick = () => {
|
|
59
|
+
const onClick = (): void => {
|
|
60
60
|
if (input.value) {
|
|
61
61
|
input.value.click();
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
const onInput = () => {
|
|
65
|
+
const onInput = async (): Promise<void> => {
|
|
66
66
|
if (!input.value) {
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
@@ -75,9 +75,8 @@ export default defineComponent({
|
|
|
75
75
|
clear();
|
|
76
76
|
}
|
|
77
77
|
else {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
});
|
|
78
|
+
const content = await readFile(file);
|
|
79
|
+
emit("update:modelValue", content);
|
|
81
80
|
}
|
|
82
81
|
};
|
|
83
82
|
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<script lang="ts">
|
|
23
23
|
import { defineComponent, ref } from "vue";
|
|
24
24
|
|
|
25
|
-
import { useFiles } from "@dative-gpi/foundation-shared-
|
|
25
|
+
import { useFiles } from "@dative-gpi/foundation-shared-services/composables";
|
|
26
26
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
27
27
|
|
|
28
28
|
import FSButton from "../FSButton.vue";
|
|
@@ -46,23 +46,23 @@ export default defineComponent({
|
|
|
46
46
|
},
|
|
47
47
|
emits: ["update:modelValue"],
|
|
48
48
|
setup(props, { emit }) {
|
|
49
|
-
const {
|
|
49
|
+
const { readFile } = useFiles();
|
|
50
50
|
|
|
51
51
|
const input = ref<HTMLFormElement | null>(null);
|
|
52
52
|
|
|
53
|
-
const clear = () => {
|
|
53
|
+
const clear = (): void => {
|
|
54
54
|
if (input.value) {
|
|
55
55
|
input.value.form && input.value.form.reset();
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
const onClick = () => {
|
|
59
|
+
const onClick = (): void => {
|
|
60
60
|
if (input.value) {
|
|
61
61
|
input.value.click();
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
const onInput = () => {
|
|
65
|
+
const onInput = async (): Promise<void> => {
|
|
66
66
|
if (!input.value) {
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
@@ -75,9 +75,8 @@ export default defineComponent({
|
|
|
75
75
|
clear();
|
|
76
76
|
}
|
|
77
77
|
else {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
});
|
|
78
|
+
const content = await readFile(file);
|
|
79
|
+
emit("update:modelValue", content);
|
|
81
80
|
}
|
|
82
81
|
};
|
|
83
82
|
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<script lang="ts">
|
|
22
22
|
import { defineComponent, ref } from "vue";
|
|
23
23
|
|
|
24
|
-
import { useFiles } from "@dative-gpi/foundation-shared-
|
|
24
|
+
import { useFiles } from "@dative-gpi/foundation-shared-services/composables";
|
|
25
25
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
26
26
|
|
|
27
27
|
import FSButton from "../FSButton.vue";
|
|
@@ -45,23 +45,23 @@ export default defineComponent({
|
|
|
45
45
|
},
|
|
46
46
|
emits: ["update:modelValue"],
|
|
47
47
|
setup(props, { emit }) {
|
|
48
|
-
const {
|
|
48
|
+
const { readFile } = useFiles();
|
|
49
49
|
|
|
50
50
|
const input = ref<HTMLFormElement | null>(null);
|
|
51
51
|
|
|
52
|
-
const clear = () => {
|
|
52
|
+
const clear = (): void => {
|
|
53
53
|
if (input.value) {
|
|
54
54
|
input.value.form && input.value.form.reset();
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
const onClick = () => {
|
|
58
|
+
const onClick = (): void => {
|
|
59
59
|
if (input.value) {
|
|
60
60
|
input.value.click();
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
const onInput = () => {
|
|
64
|
+
const onInput = async (): Promise<void> => {
|
|
65
65
|
if (!input.value) {
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
@@ -74,9 +74,8 @@ export default defineComponent({
|
|
|
74
74
|
clear();
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
});
|
|
77
|
+
const content = await readFile(file);
|
|
78
|
+
emit("update:modelValue", content);
|
|
80
79
|
}
|
|
81
80
|
};
|
|
82
81
|
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<script lang="ts">
|
|
22
22
|
import { defineComponent, ref } from "vue";
|
|
23
23
|
|
|
24
|
-
import { useFiles } from "@dative-gpi/foundation-shared-
|
|
24
|
+
import { useFiles } from "@dative-gpi/foundation-shared-services/composables";
|
|
25
25
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
26
26
|
|
|
27
27
|
import FSButton from "../FSButton.vue";
|
|
@@ -45,23 +45,23 @@ export default defineComponent({
|
|
|
45
45
|
},
|
|
46
46
|
emits: ["update:modelValue"],
|
|
47
47
|
setup(props, { emit }) {
|
|
48
|
-
const {
|
|
48
|
+
const { readFile } = useFiles();
|
|
49
49
|
|
|
50
50
|
const input = ref<HTMLFormElement | null>(null);
|
|
51
51
|
|
|
52
|
-
const clear = () => {
|
|
52
|
+
const clear = (): void => {
|
|
53
53
|
if (input.value) {
|
|
54
54
|
input.value.form && input.value.form.reset();
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
const onClick = () => {
|
|
58
|
+
const onClick = (): void => {
|
|
59
59
|
if (input.value) {
|
|
60
60
|
input.value.click();
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
const onInput = () => {
|
|
64
|
+
const onInput = async (): Promise<void> => {
|
|
65
65
|
if (!input.value) {
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
@@ -74,9 +74,8 @@ export default defineComponent({
|
|
|
74
74
|
clear();
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
});
|
|
77
|
+
const content = await readFile(file);
|
|
78
|
+
emit("update:modelValue", content);
|
|
80
79
|
}
|
|
81
80
|
};
|
|
82
81
|
|
package/composables/index.ts
CHANGED
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.52",
|
|
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.52",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "0.0.52",
|
|
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": "1cea46f60262aceae3135923684ed4a5af60d0bb"
|
|
36
36
|
}
|
package/composables/useFiles.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export const useFiles = () => {
|
|
2
|
-
const read = (file: File, callback: Function): void => {
|
|
3
|
-
const reader = new FileReader();
|
|
4
|
-
reader.addEventListener("load", (fileEv) => {
|
|
5
|
-
callback(fileEv.target && fileEv.target.result);
|
|
6
|
-
});
|
|
7
|
-
reader.readAsDataURL(file);
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
read
|
|
12
|
-
};
|
|
13
|
-
}
|