@agrotools1/at-components 0.5.1 → 0.5.2
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/README.md +7 -7
- package/dist/Accordion/Accordion.vue.js +8 -8
- package/dist/Accordion/Accordion.vue3.js +2 -2
- package/dist/Avatar/Avatar.vue.js +1 -1
- package/dist/Avatar/Avatar.vue3.js +2 -2
- package/dist/Button/Button.vue.js +1 -1
- package/dist/Button/Button.vue3.js +2 -2
- package/dist/CardWithInsights/CardWithInsights.vue.js +6 -6
- package/dist/CardWithInsights/CardWithInsights.vue4.js +2 -2
- package/dist/Checkbox/Checkbox.vue.js +1 -1
- package/dist/Checkbox/img/checkmarck.svg.js +1 -1
- package/dist/ColorPicker/ColorPicker.Saturation.vue.js +10 -10
- package/dist/ColorPicker/ColorPicker.Saturation.vue3.js +2 -2
- package/dist/ColorPicker/ColorPicker.vue.js +4 -4
- package/dist/DataTable/Column/Column.vue.js +6 -6
- package/dist/DataTable/Column/imgs/filter.svg.js +1 -1
- package/dist/DataTable/Counters/Counters.vue.js +1 -1
- package/dist/DataTable/Counters/imgs/close.svg.js +1 -1
- package/dist/DataTable/DataTable.vue.js +46 -46
- package/dist/DatePicker/DatePicker.d.ts +3 -2
- package/dist/DatePicker/DatePicker.vue.js +35 -35
- package/dist/DatePicker/DatePicker.vue2.js +61 -58
- package/dist/DatePicker/DatePickerCalendar/DatePickerCalendar.vue.js +3 -3
- package/dist/DatePicker/DatePickerHeader/DatePickerHeader.scss.js +2 -2
- package/dist/DatePicker/DatePickerHeader/DatePickerHeader.vue.js +4 -4
- package/dist/DatePicker/DatePickerListSelector/DatePickerListSelector.vue.js +5 -5
- package/dist/DatePicker/DatePickerTime/DatePickerTime.scss.js +2 -2
- package/dist/DatePicker/DatePickerTime/DatePickerTime.vue.js +8 -8
- package/dist/Dropdown/Checklist/Dropdown.Checklist.vue.js +20 -20
- package/dist/Dropdown/Dropdown.core.vue.js +1 -1
- package/dist/Dropdown/Dropdown.core.vue3.js +2 -2
- package/dist/Faq/Faq.vue.js +2 -2
- package/dist/Filter/components/Filter.vue.js +14 -14
- package/dist/Illustration/Illustration.vue.js +5 -5
- package/dist/Illustration/images/renovabio-illustrations/biomass.svg.js +1 -1
- package/dist/Illustration/images/renovabio-illustrations/volume.svg.js +1 -1
- package/dist/Illustration/images/system-images/add-file.svg.js +1 -1
- package/dist/Illustration/images/system-images/cloud-connection.svg.js +1 -1
- package/dist/Illustration/images/system-images/cloud-download.svg.js +1 -1
- package/dist/Illustration/images/system-images/cloud-upload.svg.js +1 -1
- package/dist/Illustration/images/system-images/corrupted-file.svg.js +1 -1
- package/dist/Illustration/images/system-images/empty-box.svg.js +1 -1
- package/dist/Illustration/images/system-images/empty-folder-2.svg.js +1 -1
- package/dist/Illustration/images/system-images/empty-folder.svg.js +1 -1
- package/dist/Illustration/images/system-images/empty.svg.js +1 -1
- package/dist/Illustration/images/system-images/error-illustration.svg.js +1 -1
- package/dist/Illustration/images/system-images/file-backup-2.svg.js +1 -1
- package/dist/Illustration/images/system-images/file-backup.svg.js +1 -1
- package/dist/Illustration/images/system-images/filtering-upload.svg.js +1 -1
- package/dist/Illustration/images/system-images/flight.svg.js +1 -1
- package/dist/Illustration/images/system-images/fly.svg.js +1 -1
- package/dist/Illustration/images/system-images/movies.svg.js +1 -1
- package/dist/Illustration/images/system-images/multimedia.svg.js +1 -1
- package/dist/Illustration/images/system-images/notification-bell.svg.js +1 -1
- package/dist/Illustration/images/system-images/page-2.svg.js +1 -1
- package/dist/Illustration/images/system-images/page.svg.js +1 -1
- package/dist/Illustration/images/system-images/photos.svg.js +1 -1
- package/dist/Illustration/images/system-images/recycle-bin.svg.js +1 -1
- package/dist/Illustration/images/system-images/rocket-launch.svg.js +1 -1
- package/dist/Illustration/images/system-images/signal.svg.js +1 -1
- package/dist/Illustration/images/system-images/wrong.svg.js +1 -1
- package/dist/Illustration/images/tools-images/advanced-analysis.svg.js +1 -1
- package/dist/Illustration/images/tools-images/agriculture.svg.js +1 -1
- package/dist/Illustration/images/tools-images/alert-center.svg.js +1 -1
- package/dist/Illustration/images/tools-images/area.svg.js +1 -1
- package/dist/Illustration/images/tools-images/at-insights.svg.js +1 -1
- package/dist/Illustration/images/tools-images/conservation-unit.svg.js +1 -1
- package/dist/Illustration/images/tools-images/credit.svg.js +2 -2
- package/dist/Illustration/images/tools-images/deforestation.svg.js +1 -1
- package/dist/Illustration/images/tools-images/distance-proximity-rivers.svg.js +1 -1
- package/dist/Illustration/images/tools-images/estimated-productivity-penalty.svg.js +1 -1
- package/dist/Illustration/images/tools-images/extract.svg.js +1 -1
- package/dist/Illustration/images/tools-images/farm.svg.js +1 -1
- package/dist/Illustration/images/tools-images/geographical-consultation-municipalities.svg.js +1 -1
- package/dist/Illustration/images/tools-images/gix.svg.js +1 -1
- package/dist/Illustration/images/tools-images/insurance.svg.js +1 -1
- package/dist/Illustration/images/tools-images/land-appreciation.svg.js +1 -1
- package/dist/Illustration/images/tools-images/lockdown.svg.js +1 -1
- package/dist/Illustration/images/tools-images/map.svg.js +1 -1
- package/dist/Illustration/images/tools-images/pasture.svg.js +1 -1
- package/dist/Illustration/images/tools-images/rating-2.svg.js +1 -1
- package/dist/Illustration/images/tools-images/rating.svg.js +1 -1
- package/dist/Illustration/images/tools-images/recurrence.svg.js +1 -1
- package/dist/Illustration/images/tools-images/refrigerators.svg.js +1 -1
- package/dist/Illustration/images/tools-images/settings.svg.js +1 -1
- package/dist/Illustration/images/tools-images/socio-environmental-analysis.svg.js +1 -1
- package/dist/Illustration/images/tools-images/soil-use.svg.js +1 -1
- package/dist/Illustration/images/tools-images/storm.svg.js +1 -1
- package/dist/Illustration/images/tools-images/territory-details.svg.js +1 -1
- package/dist/Illustration/images/tools-images/timeline.svg.js +1 -1
- package/dist/Input/Input.core.vue.js +10 -10
- package/dist/Input/imgs/error.svg.js +2 -2
- package/dist/Legend/Legend.vue.js +6 -6
- package/dist/List/components/List.vue.js +24 -24
- package/dist/List/components/List.vue3.js +2 -2
- package/dist/Map/Map.d.ts +3 -2
- package/dist/Map/Map.vue2.js +43 -39
- package/dist/Modal/Modal.vue.js +6 -6
- package/dist/Modal/images/cross.svg.js +1 -1
- package/dist/Notifications/Notification/Notification.vue.js +4 -4
- package/dist/Notifications/Notifications.vue.js +4 -4
- package/dist/Paginator/Paginator.vue.js +2 -2
- package/dist/Paginator/imgs/double-left-arrow.svg.js +1 -1
- package/dist/Paginator/imgs/double-right-arrow.svg.js +1 -1
- package/dist/Paginator/imgs/left-arrow.svg.js +1 -1
- package/dist/Paginator/imgs/right-arrow.svg.js +1 -1
- package/dist/ProgressBar/ProgressBar.vue.js +2 -2
- package/dist/RadioButton/RadioButton.vue.js +1 -1
- package/dist/RadioButton/RadioButton.vue3.js +2 -2
- package/dist/Search/Search.vue.js +7 -6
- package/dist/Search/Search.vue2.js +12 -12
- package/dist/Select/Item/Item.vue.js +16 -16
- package/dist/Select/Multiple/Select.multiple.vue.js +4 -4
- package/dist/Select/Multiple/Select.multiple.vue2.js +35 -30
- package/dist/Select/Single/Select.single.vue.js +3 -3
- package/dist/Select/imgs/indicator.svg.js +1 -1
- package/dist/Stepper/Stepper.vue.js +2 -2
- package/dist/TableConfig/TableConfig.vue.js +4 -4
- package/dist/Tabs/Tab/Tab.vue.js +1 -1
- package/dist/Tabs/Tab/Tab.vue3.js +2 -2
- package/dist/Tabs/Tabs.vue.js +6 -6
- package/dist/Tabs/Tabs.vue2.js +23 -27
- package/dist/Tabs/Tabs.vue3.js +2 -2
- package/dist/Tag/Tag.vue.js +1 -1
- package/dist/Tipograph/Paragraph/Paragraph.vue.js +2 -2
- package/dist/Tipograph/Paragraph/Paragraph.vue3.js +2 -2
- package/dist/Tipograph/Title/Title.vue.js +2 -2
- package/dist/Toggle/Toggle.vue.js +2 -2
- package/dist/Tooltip/Tooltip.vue.js +5 -5
- package/dist/Tooltip/Tooltip.vue3.js +2 -2
- package/dist/Upload/MultipleUpload/MultipleUpload.d.ts +213 -0
- package/dist/Upload/MultipleUpload/MultipleUpload.vue.js +58 -0
- package/dist/Upload/MultipleUpload/MultipleUpload.vue2.js +138 -0
- package/dist/Upload/MultipleUpload/MultipleUpload.vue3.js +4 -0
- package/dist/Upload/SingleUpload/SingleUpload.d.ts +199 -0
- package/dist/Upload/SingleUpload/SingleUpload.vue.js +50 -0
- package/dist/Upload/SingleUpload/SingleUpload.vue2.js +135 -0
- package/dist/Upload/SingleUpload/SingleUpload.vue3.js +4 -0
- package/dist/Upload/Upload.d.ts +28 -53
- package/dist/Upload/Upload.vue.js +32 -121
- package/dist/Upload/Upload.vue2.js +18 -47
- package/dist/Upload/UploaderHeader/UploaderHeader.d.ts +68 -0
- package/dist/Upload/UploaderHeader/UploaderHeader.vue.js +30 -0
- package/dist/Upload/UploaderHeader/UploaderHeader.vue2.js +51 -0
- package/dist/Upload/UploaderHeader/UploaderHeader.vue3.js +4 -0
- package/dist/Upload/UploaderInfoProgress/UploaderInfoProgress.d.ts +44 -0
- package/dist/Upload/UploaderInfoProgress/UploaderInfoProgress.vue.js +44 -0
- package/dist/Upload/UploaderInfoProgress/UploaderInfoProgress.vue2.js +36 -0
- package/dist/Upload/UploaderInfoProgress/UploaderInfoProgress.vue3.js +4 -0
- package/dist/Upload/UploaderInput/UploaderInput.d.ts +79 -0
- package/dist/Upload/UploaderInput/UploaderInput.vue.js +57 -0
- package/dist/Upload/UploaderInput/UploaderInput.vue2.js +56 -0
- package/dist/Upload/UploaderInput/UploaderInput.vue3.js +4 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import c from "./MultipleUpload.vue2.js";
|
|
2
|
+
import { resolveComponent as p, openBlock as t, createElementBlock as o, createVNode as r, createElementVNode as n, normalizeStyle as l, Fragment as m, renderList as v, createCommentVNode as f, pushScopeId as h, popScopeId as y } from "vue";
|
|
3
|
+
import "./MultipleUpload.vue3.js";
|
|
4
|
+
import $ from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const g = (e) => (h("data-v-5752e54b"), e = e(), y(), e), w = { class: "at-uploader-multiple-input-container" }, U = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "at-uploader-file-container"
|
|
8
|
+
}, I = /* @__PURE__ */ g(() => /* @__PURE__ */ n("span", null, "Arquivos", -1)), T = { class: "at-uploader-files" };
|
|
9
|
+
function S(e, P, B, _, b, k) {
|
|
10
|
+
const i = p("UploaderHeader"), s = p("UploaderInput"), d = p("AtProgressBar");
|
|
11
|
+
return t(), o("div", null, [
|
|
12
|
+
r(i, {
|
|
13
|
+
"warning-text-upload": e.$props.warningTextUpload,
|
|
14
|
+
"interactive-text-button": e.$props.interactiveTextButton,
|
|
15
|
+
"interactive-texthref": e.$props.interactiveTexthref,
|
|
16
|
+
"interactive-text-download-name": e.$props.interactiveTextDownloadName,
|
|
17
|
+
"warning-function": e.$props.warningFunction
|
|
18
|
+
}, null, 8, ["warning-text-upload", "interactive-text-button", "interactive-texthref", "interactive-text-download-name", "warning-function"]),
|
|
19
|
+
n("div", {
|
|
20
|
+
class: "at-uploader-multiple",
|
|
21
|
+
style: l(e.uploaderContainerStyle)
|
|
22
|
+
}, [
|
|
23
|
+
n("div", w, [
|
|
24
|
+
r(s, {
|
|
25
|
+
style: l(e.inputStyle),
|
|
26
|
+
"handle-drop": e.handleDrop,
|
|
27
|
+
"upload-text": e.$props.uploadText,
|
|
28
|
+
"upload-interaction-text": e.$props.uploadInteractionText,
|
|
29
|
+
"multiple-select": e.$props.multipleSelect,
|
|
30
|
+
"accept-types": e.$props.acceptTypes,
|
|
31
|
+
"accept-types-input": e.$props.acceptTypesInput,
|
|
32
|
+
"handle-file-upload": e.handleFileUpload
|
|
33
|
+
}, null, 8, ["style", "handle-drop", "upload-text", "upload-interaction-text", "multiple-select", "accept-types", "accept-types-input", "handle-file-upload"])
|
|
34
|
+
]),
|
|
35
|
+
e.files && e.files.length ? (t(), o("div", U, [
|
|
36
|
+
I,
|
|
37
|
+
n("div", T, [
|
|
38
|
+
(t(!0), o(m, null, v(e.files, (a, u) => (t(), o("div", {
|
|
39
|
+
key: a.name + u,
|
|
40
|
+
class: "at-uploader-file"
|
|
41
|
+
}, [
|
|
42
|
+
r(d, {
|
|
43
|
+
file: a,
|
|
44
|
+
"handle-remove-file": () => e.handleRemove(a),
|
|
45
|
+
"is-only-use": !1,
|
|
46
|
+
interval: e.$props.progressInterval,
|
|
47
|
+
onUpdateProgress: e.handleUpdateProgressOnParent
|
|
48
|
+
}, null, 8, ["file", "handle-remove-file", "interval", "onUpdateProgress"])
|
|
49
|
+
]))), 128))
|
|
50
|
+
])
|
|
51
|
+
])) : f("", !0)
|
|
52
|
+
], 4)
|
|
53
|
+
]);
|
|
54
|
+
}
|
|
55
|
+
const V = /* @__PURE__ */ $(c, [["render", S], ["__scopeId", "data-v-5752e54b"]]);
|
|
56
|
+
export {
|
|
57
|
+
V as default
|
|
58
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { defineComponent as f, ref as d, computed as p } from "vue";
|
|
2
|
+
import c from "../../ProgressBar/ProgressBar.vue.js";
|
|
3
|
+
import g from "../UploaderHeader/UploaderHeader.vue.js";
|
|
4
|
+
import y from "../UploaderInput/UploaderInput.vue.js";
|
|
5
|
+
const S = f({
|
|
6
|
+
name: "MultipleUpload",
|
|
7
|
+
components: {
|
|
8
|
+
AtProgressBar: c,
|
|
9
|
+
UploaderHeader: g,
|
|
10
|
+
UploaderInput: y
|
|
11
|
+
},
|
|
12
|
+
props: {
|
|
13
|
+
warningTextUpload: {
|
|
14
|
+
type: String,
|
|
15
|
+
required: !0,
|
|
16
|
+
default: "Texto de aviso sobre o upload",
|
|
17
|
+
validator: (e) => typeof e == "string"
|
|
18
|
+
},
|
|
19
|
+
loadingText: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: !1,
|
|
22
|
+
default: "Estamos analisando o arquivo, em breve, retornaremos com os resultados.",
|
|
23
|
+
validator: (e) => typeof e == "string"
|
|
24
|
+
},
|
|
25
|
+
completeText: {
|
|
26
|
+
type: String,
|
|
27
|
+
required: !1,
|
|
28
|
+
default: "O upload foi concluído.",
|
|
29
|
+
validator: (e) => typeof e == "string"
|
|
30
|
+
},
|
|
31
|
+
progressInterval: {
|
|
32
|
+
type: Number,
|
|
33
|
+
required: !1,
|
|
34
|
+
default: 1e3,
|
|
35
|
+
validator: (e) => typeof e == "number"
|
|
36
|
+
},
|
|
37
|
+
interactiveTextButton: {
|
|
38
|
+
type: String,
|
|
39
|
+
required: !1,
|
|
40
|
+
default: "",
|
|
41
|
+
validator: (e) => typeof e == "string"
|
|
42
|
+
},
|
|
43
|
+
interactiveTexthref: {
|
|
44
|
+
type: String,
|
|
45
|
+
required: !1,
|
|
46
|
+
default: "",
|
|
47
|
+
validator: (e) => typeof e == "string"
|
|
48
|
+
},
|
|
49
|
+
interactiveTextDownloadName: {
|
|
50
|
+
type: String,
|
|
51
|
+
required: !1,
|
|
52
|
+
default: "",
|
|
53
|
+
validator: (e) => typeof e == "string"
|
|
54
|
+
},
|
|
55
|
+
warningFunction: {
|
|
56
|
+
type: Function,
|
|
57
|
+
required: !1,
|
|
58
|
+
default: () => {
|
|
59
|
+
console.warn("This is a warning");
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
multipleSelect: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
required: !1,
|
|
65
|
+
default: !1,
|
|
66
|
+
validator: (e) => typeof e == "boolean"
|
|
67
|
+
},
|
|
68
|
+
uploadText: {
|
|
69
|
+
type: String,
|
|
70
|
+
required: !1,
|
|
71
|
+
default: "Importe seu arquivo aqui",
|
|
72
|
+
validator: (e) => typeof e == "string"
|
|
73
|
+
},
|
|
74
|
+
uploadInteractionText: {
|
|
75
|
+
type: String,
|
|
76
|
+
required: !1,
|
|
77
|
+
default: "Arraste ou clique para fazer upload do arquivo",
|
|
78
|
+
validator: (e) => typeof e == "string"
|
|
79
|
+
},
|
|
80
|
+
uploadProgress: {
|
|
81
|
+
type: Number,
|
|
82
|
+
required: !1,
|
|
83
|
+
default: 0,
|
|
84
|
+
validator: (e) => typeof e == "number"
|
|
85
|
+
},
|
|
86
|
+
acceptTypes: {
|
|
87
|
+
type: Array,
|
|
88
|
+
default: () => []
|
|
89
|
+
},
|
|
90
|
+
acceptTypesInput: {
|
|
91
|
+
type: String,
|
|
92
|
+
default: "*"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
emits: ["updateFile", "updateProgress"],
|
|
96
|
+
setup(e, { emit: l }) {
|
|
97
|
+
const a = d([]), n = d(e.uploadProgress), u = (t) => {
|
|
98
|
+
if (t.preventDefault(), t.dataTransfer) {
|
|
99
|
+
const r = Array.from(t.dataTransfer.files), o = i(r);
|
|
100
|
+
o.length && (a.value.push(...o), l("updateFile", a.value));
|
|
101
|
+
}
|
|
102
|
+
}, i = (t) => {
|
|
103
|
+
if (!e.acceptTypes.length)
|
|
104
|
+
return t;
|
|
105
|
+
const r = e.acceptTypes.map((s) => s.toLowerCase()), o = t.filter(
|
|
106
|
+
(s) => r.includes(s.type.toLowerCase())
|
|
107
|
+
);
|
|
108
|
+
return o.length !== t.length && console.warn(
|
|
109
|
+
"O tipo de alguns arquivos não é suportado. Eles serão removidos"
|
|
110
|
+
), o;
|
|
111
|
+
};
|
|
112
|
+
return {
|
|
113
|
+
handleDrop: u,
|
|
114
|
+
handleFileUpload: async (t) => {
|
|
115
|
+
const r = t.target.files;
|
|
116
|
+
if (!r)
|
|
117
|
+
return;
|
|
118
|
+
const o = i(Array.from(r));
|
|
119
|
+
o.length && (a.value.push(...o), l("updateFile", a.value));
|
|
120
|
+
},
|
|
121
|
+
handleRemove: (t) => {
|
|
122
|
+
const r = a.value.indexOf(t);
|
|
123
|
+
r !== -1 && (a.value.splice(r, 1), a.value.length === 0 && (n.value = 0, l("updateProgress", 0)), l("updateFile", a.value));
|
|
124
|
+
},
|
|
125
|
+
handleUpdateProgressOnParent: (t) => {
|
|
126
|
+
n.value = t, l("updateProgress", n.value);
|
|
127
|
+
},
|
|
128
|
+
getAcceptedFiles: i,
|
|
129
|
+
files: a,
|
|
130
|
+
progress: n,
|
|
131
|
+
inputStyle: p(() => a.value.length > 0 ? { height: "256px", width: "256px" } : { width: "100%" }),
|
|
132
|
+
uploaderContainerStyle: p(() => a.value.length <= 0 ? { width: "100%", padding: "0px" } : {})
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
export {
|
|
137
|
+
S as default
|
|
138
|
+
};
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { type PropType } from "vue";
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
warningTextUpload: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
required: true;
|
|
6
|
+
default: string;
|
|
7
|
+
validator: (value: string) => boolean;
|
|
8
|
+
};
|
|
9
|
+
loadingText: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
required: false;
|
|
12
|
+
default: string;
|
|
13
|
+
validator: (value: string) => boolean;
|
|
14
|
+
};
|
|
15
|
+
completeText: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
required: false;
|
|
18
|
+
default: string;
|
|
19
|
+
validator: (value: string) => boolean;
|
|
20
|
+
};
|
|
21
|
+
progressInterval: {
|
|
22
|
+
type: NumberConstructor;
|
|
23
|
+
required: false;
|
|
24
|
+
default: number;
|
|
25
|
+
validator: (value: number) => boolean;
|
|
26
|
+
};
|
|
27
|
+
interactiveTextButton: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
required: false;
|
|
30
|
+
default: string;
|
|
31
|
+
validator: (value: string) => boolean;
|
|
32
|
+
};
|
|
33
|
+
interactiveTexthref: {
|
|
34
|
+
type: StringConstructor;
|
|
35
|
+
required: false;
|
|
36
|
+
default: string;
|
|
37
|
+
validator: (value: string) => boolean;
|
|
38
|
+
};
|
|
39
|
+
interactiveTextDownloadName: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
required: false;
|
|
42
|
+
default: string;
|
|
43
|
+
validator: (value: string) => boolean;
|
|
44
|
+
};
|
|
45
|
+
warningFunction: {
|
|
46
|
+
type: FunctionConstructor;
|
|
47
|
+
required: false;
|
|
48
|
+
default: () => void;
|
|
49
|
+
};
|
|
50
|
+
multipleSelect: {
|
|
51
|
+
type: BooleanConstructor;
|
|
52
|
+
required: false;
|
|
53
|
+
default: boolean;
|
|
54
|
+
validator: (value: boolean) => boolean;
|
|
55
|
+
};
|
|
56
|
+
uploadText: {
|
|
57
|
+
type: StringConstructor;
|
|
58
|
+
required: false;
|
|
59
|
+
default: string;
|
|
60
|
+
validator: (value: string) => boolean;
|
|
61
|
+
};
|
|
62
|
+
uploadInteractionText: {
|
|
63
|
+
type: StringConstructor;
|
|
64
|
+
required: false;
|
|
65
|
+
default: string;
|
|
66
|
+
validator: (value: string) => boolean;
|
|
67
|
+
};
|
|
68
|
+
uploadProgress: {
|
|
69
|
+
type: NumberConstructor;
|
|
70
|
+
required: false;
|
|
71
|
+
default: number;
|
|
72
|
+
validator: (value: number) => boolean;
|
|
73
|
+
};
|
|
74
|
+
acceptTypes: {
|
|
75
|
+
type: PropType<string[]>;
|
|
76
|
+
default: () => never[];
|
|
77
|
+
};
|
|
78
|
+
acceptTypesInput: {
|
|
79
|
+
type: StringConstructor;
|
|
80
|
+
default: string;
|
|
81
|
+
};
|
|
82
|
+
}, {
|
|
83
|
+
handleDrop: (event: DragEvent) => void;
|
|
84
|
+
handleFileUpload: (event: Event) => Promise<void>;
|
|
85
|
+
handleRemove: () => void;
|
|
86
|
+
handleUpdateProgressOnParent: (newValue: number) => void;
|
|
87
|
+
getAcceptedFiles: (files: File[]) => File[];
|
|
88
|
+
file: import("vue").Ref<{
|
|
89
|
+
readonly lastModified: number;
|
|
90
|
+
readonly name: string;
|
|
91
|
+
readonly webkitRelativePath: string;
|
|
92
|
+
readonly size: number;
|
|
93
|
+
readonly type: string;
|
|
94
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
95
|
+
slice: (start?: number | undefined, end?: number | undefined, contentType?: string | undefined) => Blob;
|
|
96
|
+
stream: () => ReadableStream<Uint8Array>;
|
|
97
|
+
text: () => Promise<string>;
|
|
98
|
+
} | null>;
|
|
99
|
+
progress: import("vue").Ref<number>;
|
|
100
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("updateProgress" | "updateFile")[], "updateProgress" | "updateFile", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
101
|
+
warningTextUpload: {
|
|
102
|
+
type: StringConstructor;
|
|
103
|
+
required: true;
|
|
104
|
+
default: string;
|
|
105
|
+
validator: (value: string) => boolean;
|
|
106
|
+
};
|
|
107
|
+
loadingText: {
|
|
108
|
+
type: StringConstructor;
|
|
109
|
+
required: false;
|
|
110
|
+
default: string;
|
|
111
|
+
validator: (value: string) => boolean;
|
|
112
|
+
};
|
|
113
|
+
completeText: {
|
|
114
|
+
type: StringConstructor;
|
|
115
|
+
required: false;
|
|
116
|
+
default: string;
|
|
117
|
+
validator: (value: string) => boolean;
|
|
118
|
+
};
|
|
119
|
+
progressInterval: {
|
|
120
|
+
type: NumberConstructor;
|
|
121
|
+
required: false;
|
|
122
|
+
default: number;
|
|
123
|
+
validator: (value: number) => boolean;
|
|
124
|
+
};
|
|
125
|
+
interactiveTextButton: {
|
|
126
|
+
type: StringConstructor;
|
|
127
|
+
required: false;
|
|
128
|
+
default: string;
|
|
129
|
+
validator: (value: string) => boolean;
|
|
130
|
+
};
|
|
131
|
+
interactiveTexthref: {
|
|
132
|
+
type: StringConstructor;
|
|
133
|
+
required: false;
|
|
134
|
+
default: string;
|
|
135
|
+
validator: (value: string) => boolean;
|
|
136
|
+
};
|
|
137
|
+
interactiveTextDownloadName: {
|
|
138
|
+
type: StringConstructor;
|
|
139
|
+
required: false;
|
|
140
|
+
default: string;
|
|
141
|
+
validator: (value: string) => boolean;
|
|
142
|
+
};
|
|
143
|
+
warningFunction: {
|
|
144
|
+
type: FunctionConstructor;
|
|
145
|
+
required: false;
|
|
146
|
+
default: () => void;
|
|
147
|
+
};
|
|
148
|
+
multipleSelect: {
|
|
149
|
+
type: BooleanConstructor;
|
|
150
|
+
required: false;
|
|
151
|
+
default: boolean;
|
|
152
|
+
validator: (value: boolean) => boolean;
|
|
153
|
+
};
|
|
154
|
+
uploadText: {
|
|
155
|
+
type: StringConstructor;
|
|
156
|
+
required: false;
|
|
157
|
+
default: string;
|
|
158
|
+
validator: (value: string) => boolean;
|
|
159
|
+
};
|
|
160
|
+
uploadInteractionText: {
|
|
161
|
+
type: StringConstructor;
|
|
162
|
+
required: false;
|
|
163
|
+
default: string;
|
|
164
|
+
validator: (value: string) => boolean;
|
|
165
|
+
};
|
|
166
|
+
uploadProgress: {
|
|
167
|
+
type: NumberConstructor;
|
|
168
|
+
required: false;
|
|
169
|
+
default: number;
|
|
170
|
+
validator: (value: number) => boolean;
|
|
171
|
+
};
|
|
172
|
+
acceptTypes: {
|
|
173
|
+
type: PropType<string[]>;
|
|
174
|
+
default: () => never[];
|
|
175
|
+
};
|
|
176
|
+
acceptTypesInput: {
|
|
177
|
+
type: StringConstructor;
|
|
178
|
+
default: string;
|
|
179
|
+
};
|
|
180
|
+
}>> & {
|
|
181
|
+
onUpdateProgress?: ((...args: any[]) => any) | undefined;
|
|
182
|
+
onUpdateFile?: ((...args: any[]) => any) | undefined;
|
|
183
|
+
}, {
|
|
184
|
+
warningTextUpload: string;
|
|
185
|
+
interactiveTextButton: string;
|
|
186
|
+
interactiveTexthref: string;
|
|
187
|
+
interactiveTextDownloadName: string;
|
|
188
|
+
warningFunction: Function;
|
|
189
|
+
uploadText: string;
|
|
190
|
+
uploadInteractionText: string;
|
|
191
|
+
multipleSelect: boolean;
|
|
192
|
+
acceptTypes: string[];
|
|
193
|
+
acceptTypesInput: string;
|
|
194
|
+
loadingText: string;
|
|
195
|
+
completeText: string;
|
|
196
|
+
progressInterval: number;
|
|
197
|
+
uploadProgress: number;
|
|
198
|
+
}, {}>;
|
|
199
|
+
export default _default;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import i from "./SingleUpload.vue2.js";
|
|
2
|
+
import { resolveComponent as t, openBlock as o, createElementBlock as r, createVNode as n, createElementVNode as d, createBlock as c } from "vue";
|
|
3
|
+
import "./SingleUpload.vue3.js";
|
|
4
|
+
import u from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const m = { class: "at-uploader-single" }, f = {
|
|
6
|
+
key: 1,
|
|
7
|
+
class: "at-uploader-status-container at-uploader-loading-input-container"
|
|
8
|
+
};
|
|
9
|
+
function g(e, v, h, $, U, w) {
|
|
10
|
+
const p = t("UploaderHeader"), a = t("UploaderInput"), l = t("UploaderInfoProgress"), s = t("AtProgressBar");
|
|
11
|
+
return o(), r("div", null, [
|
|
12
|
+
n(p, {
|
|
13
|
+
"warning-text-upload": e.$props.warningTextUpload,
|
|
14
|
+
"interactive-text-button": e.$props.interactiveTextButton,
|
|
15
|
+
"interactive-texthref": e.$props.interactiveTexthref,
|
|
16
|
+
"interactive-text-download-name": e.$props.interactiveTextDownloadName,
|
|
17
|
+
"warning-function": e.$props.warningFunction
|
|
18
|
+
}, null, 8, ["warning-text-upload", "interactive-text-button", "interactive-texthref", "interactive-text-download-name", "warning-function"]),
|
|
19
|
+
d("div", m, [
|
|
20
|
+
e.file === null ? (o(), c(a, {
|
|
21
|
+
key: 0,
|
|
22
|
+
style: { width: "100%" },
|
|
23
|
+
"handle-drop": e.handleDrop,
|
|
24
|
+
"upload-text": e.$props.uploadText,
|
|
25
|
+
"upload-interaction-text": e.$props.uploadInteractionText,
|
|
26
|
+
"multiple-select": e.$props.multipleSelect,
|
|
27
|
+
"accept-types": e.$props.acceptTypes,
|
|
28
|
+
"accept-types-input": e.$props.acceptTypesInput,
|
|
29
|
+
"handle-file-upload": e.handleFileUpload
|
|
30
|
+
}, null, 8, ["handle-drop", "upload-text", "upload-interaction-text", "multiple-select", "accept-types", "accept-types-input", "handle-file-upload"])) : (o(), r("div", f, [
|
|
31
|
+
n(l, {
|
|
32
|
+
"complete-text": e.$props.completeText,
|
|
33
|
+
progress: e.progress,
|
|
34
|
+
"loading-text": e.$props.loadingText
|
|
35
|
+
}, null, 8, ["complete-text", "progress", "loading-text"]),
|
|
36
|
+
n(s, {
|
|
37
|
+
file: e.file,
|
|
38
|
+
"handle-remove-file": e.handleRemove,
|
|
39
|
+
"is-only-use": !1,
|
|
40
|
+
interval: e.$props.progressInterval,
|
|
41
|
+
onUpdateProgress: e.handleUpdateProgressOnParent
|
|
42
|
+
}, null, 8, ["file", "handle-remove-file", "interval", "onUpdateProgress"])
|
|
43
|
+
]))
|
|
44
|
+
])
|
|
45
|
+
]);
|
|
46
|
+
}
|
|
47
|
+
const x = /* @__PURE__ */ u(i, [["render", g], ["__scopeId", "data-v-d2e3501f"]]);
|
|
48
|
+
export {
|
|
49
|
+
x as default
|
|
50
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { defineComponent as u, ref as d } from "vue";
|
|
2
|
+
import f from "../../ProgressBar/ProgressBar.vue.js";
|
|
3
|
+
import c from "../UploaderHeader/UploaderHeader.vue.js";
|
|
4
|
+
import g from "../UploaderInfoProgress/UploaderInfoProgress.vue.js";
|
|
5
|
+
import y from "../UploaderInput/UploaderInput.vue.js";
|
|
6
|
+
const x = u({
|
|
7
|
+
name: "SingleUpload",
|
|
8
|
+
components: {
|
|
9
|
+
UploaderInfoProgress: g,
|
|
10
|
+
AtProgressBar: f,
|
|
11
|
+
UploaderHeader: c,
|
|
12
|
+
UploaderInput: y
|
|
13
|
+
},
|
|
14
|
+
props: {
|
|
15
|
+
warningTextUpload: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: !0,
|
|
18
|
+
default: "Texto de aviso sobre o upload",
|
|
19
|
+
validator: (e) => typeof e == "string"
|
|
20
|
+
},
|
|
21
|
+
loadingText: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: !1,
|
|
24
|
+
default: "Estamos analisando o arquivo, em breve, retornaremos com os resultados.",
|
|
25
|
+
validator: (e) => typeof e == "string"
|
|
26
|
+
},
|
|
27
|
+
completeText: {
|
|
28
|
+
type: String,
|
|
29
|
+
required: !1,
|
|
30
|
+
default: "O upload foi concluído.",
|
|
31
|
+
validator: (e) => typeof e == "string"
|
|
32
|
+
},
|
|
33
|
+
progressInterval: {
|
|
34
|
+
type: Number,
|
|
35
|
+
required: !1,
|
|
36
|
+
default: 1e3,
|
|
37
|
+
validator: (e) => typeof e == "number"
|
|
38
|
+
},
|
|
39
|
+
interactiveTextButton: {
|
|
40
|
+
type: String,
|
|
41
|
+
required: !1,
|
|
42
|
+
default: "",
|
|
43
|
+
validator: (e) => typeof e == "string"
|
|
44
|
+
},
|
|
45
|
+
interactiveTexthref: {
|
|
46
|
+
type: String,
|
|
47
|
+
required: !1,
|
|
48
|
+
default: "",
|
|
49
|
+
validator: (e) => typeof e == "string"
|
|
50
|
+
},
|
|
51
|
+
interactiveTextDownloadName: {
|
|
52
|
+
type: String,
|
|
53
|
+
required: !1,
|
|
54
|
+
default: "",
|
|
55
|
+
validator: (e) => typeof e == "string"
|
|
56
|
+
},
|
|
57
|
+
warningFunction: {
|
|
58
|
+
type: Function,
|
|
59
|
+
required: !1,
|
|
60
|
+
default: () => {
|
|
61
|
+
console.warn("This is a warning");
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
multipleSelect: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
required: !1,
|
|
67
|
+
default: !1,
|
|
68
|
+
validator: (e) => typeof e == "boolean"
|
|
69
|
+
},
|
|
70
|
+
uploadText: {
|
|
71
|
+
type: String,
|
|
72
|
+
required: !1,
|
|
73
|
+
default: "Importe seu arquivo aqui",
|
|
74
|
+
validator: (e) => typeof e == "string"
|
|
75
|
+
},
|
|
76
|
+
uploadInteractionText: {
|
|
77
|
+
type: String,
|
|
78
|
+
required: !1,
|
|
79
|
+
default: "Arraste ou clique para fazer upload do arquivo",
|
|
80
|
+
validator: (e) => typeof e == "string"
|
|
81
|
+
},
|
|
82
|
+
uploadProgress: {
|
|
83
|
+
type: Number,
|
|
84
|
+
required: !1,
|
|
85
|
+
default: 0,
|
|
86
|
+
validator: (e) => typeof e == "number"
|
|
87
|
+
},
|
|
88
|
+
acceptTypes: {
|
|
89
|
+
type: Array,
|
|
90
|
+
default: () => []
|
|
91
|
+
},
|
|
92
|
+
acceptTypesInput: {
|
|
93
|
+
type: String,
|
|
94
|
+
default: "*"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
emits: ["updateFile", "updateProgress"],
|
|
98
|
+
setup(e, { emit: l }) {
|
|
99
|
+
const a = d(null), n = d(e.uploadProgress), p = (t) => {
|
|
100
|
+
if (t.preventDefault(), t.dataTransfer) {
|
|
101
|
+
const o = t.dataTransfer.files, r = i(Array.from(o));
|
|
102
|
+
r.length && (a.value = r[0], l("updateFile", a.value));
|
|
103
|
+
}
|
|
104
|
+
}, i = (t) => {
|
|
105
|
+
if (!e.acceptTypes.length)
|
|
106
|
+
return t;
|
|
107
|
+
const o = e.acceptTypes.map((s) => s.toLowerCase()), r = t.filter(
|
|
108
|
+
(s) => o.includes(s.type.toLowerCase())
|
|
109
|
+
);
|
|
110
|
+
return r.length === 0 && console.warn("O tipo de arquivo enviado não é permitido."), r;
|
|
111
|
+
};
|
|
112
|
+
return {
|
|
113
|
+
handleDrop: p,
|
|
114
|
+
handleFileUpload: async (t) => {
|
|
115
|
+
const o = t.target.files;
|
|
116
|
+
if (!o)
|
|
117
|
+
return;
|
|
118
|
+
const r = i(Array.from(o));
|
|
119
|
+
r.length && (a.value = r[0], l("updateFile", a.value));
|
|
120
|
+
},
|
|
121
|
+
handleRemove: () => {
|
|
122
|
+
a.value = null, n.value = 0, l("updateFile", null), l("updateProgress", 0);
|
|
123
|
+
},
|
|
124
|
+
handleUpdateProgressOnParent: (t) => {
|
|
125
|
+
n.value = t, l("updateProgress", n.value);
|
|
126
|
+
},
|
|
127
|
+
getAcceptedFiles: i,
|
|
128
|
+
file: a,
|
|
129
|
+
progress: n
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
export {
|
|
134
|
+
x as default
|
|
135
|
+
};
|