@mozaic-ds/web-components 0.9.0-beta → 0.9.0-beta-1

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.
Files changed (189) hide show
  1. package/package.json +1 -1
  2. package/public/ClickOutside-63071e7a.js +1 -15
  3. package/public/ClickOutside-63071e7a.js.map +1 -1
  4. package/public/DataTableDefaultAction.nested-c37a5d51.js +1 -761
  5. package/public/DataTableDefaultAction.nested-c37a5d51.js.map +1 -1
  6. package/public/DataTableUtilities-313a448d.js +1 -385
  7. package/public/DataTableUtilities-313a448d.js.map +1 -1
  8. package/public/EventForward-8492ff62.js +1 -109
  9. package/public/EventForward-8492ff62.js.map +1 -1
  10. package/public/EventHandler-02058705.js +1 -15
  11. package/public/EventHandler-02058705.js.map +1 -1
  12. package/public/adeo/components/datatable/DataTable.js +1 -1
  13. package/public/adeo/components/datatable/DataTable.js.map +1 -1
  14. package/public/adeo/components/datatable/DataTable.svelte +1 -1
  15. package/public/adeo/components/datatable/data.d.ts.map +1 -1
  16. package/public/array-5b770a93.js +1 -13
  17. package/public/array-5b770a93.js.map +1 -1
  18. package/public/axis-fbc0f7b5.js +1 -174
  19. package/public/axis-fbc0f7b5.js.map +1 -1
  20. package/public/band-d7a07d2c.js +1 -186
  21. package/public/band-d7a07d2c.js.map +1 -1
  22. package/public/bricoman/components/datatable/DataTable.js +1 -1
  23. package/public/bricoman/components/datatable/DataTable.js.map +1 -1
  24. package/public/bricoman/components/datatable/DataTable.svelte +1 -1
  25. package/public/bricoman/components/datatable/data.d.ts.map +1 -1
  26. package/public/components/accordion/Accordion.js +1 -365
  27. package/public/components/accordion/Accordion.js.map +1 -1
  28. package/public/components/autocomplete/Autocomplete.js +1 -1515
  29. package/public/components/autocomplete/Autocomplete.js.map +1 -1
  30. package/public/components/badge/Badge.js +1 -155
  31. package/public/components/badge/Badge.js.map +1 -1
  32. package/public/components/badge/Badge.nested.js +1 -101
  33. package/public/components/badge/Badge.nested.js.map +1 -1
  34. package/public/components/breadcrumb/Breadcrumb.js +1 -372
  35. package/public/components/breadcrumb/Breadcrumb.js.map +1 -1
  36. package/public/components/breadcrumb/Breadcrumb.nested.js +1 -319
  37. package/public/components/breadcrumb/Breadcrumb.nested.js.map +1 -1
  38. package/public/components/button/Button.js +1 -1138
  39. package/public/components/button/Button.js.map +1 -1
  40. package/public/components/card/Card.js +1 -369
  41. package/public/components/card/Card.js.map +1 -1
  42. package/public/components/chart/BarChart.js +1 -583
  43. package/public/components/chart/BarChart.js.map +1 -1
  44. package/public/components/chart/Donut.js +1 -1189
  45. package/public/components/chart/Donut.js.map +1 -1
  46. package/public/components/chart/GroupedBarChart.js +1 -750
  47. package/public/components/chart/GroupedBarChart.js.map +1 -1
  48. package/public/components/chart/LineChart.js +1 -1731
  49. package/public/components/chart/LineChart.js.map +1 -1
  50. package/public/components/chart/Radar.js +1 -729
  51. package/public/components/chart/Radar.js.map +1 -1
  52. package/public/components/chart/StackedBarChart.js +1 -745
  53. package/public/components/chart/StackedBarChart.js.map +1 -1
  54. package/public/components/checkbox/Checkbox.js +1 -307
  55. package/public/components/checkbox/Checkbox.js.map +1 -1
  56. package/public/components/checkboxgroup/checkboxGroup.js +1 -404
  57. package/public/components/checkboxgroup/checkboxGroup.js.map +1 -1
  58. package/public/components/datatable/DataTable.js +1 -3098
  59. package/public/components/datatable/DataTable.js.map +1 -1
  60. package/public/components/datatable/DataTable.svelte +1 -1
  61. package/public/components/datatable/DataTableDefaultAction.nested.js +1 -4
  62. package/public/components/datatable/DataTableDefaultAction.nested.js.map +1 -1
  63. package/public/components/datatable/DataTableDefaultEdtion.nested.js +1 -164
  64. package/public/components/datatable/DataTableDefaultEdtion.nested.js.map +1 -1
  65. package/public/components/datatable/DataTableDefaultFilterTags.nested.js +1 -380
  66. package/public/components/datatable/DataTableDefaultFilterTags.nested.js.map +1 -1
  67. package/public/components/datatable/DataTableDefaultSelection.nested.js +1 -424
  68. package/public/components/datatable/DataTableDefaultSelection.nested.js.map +1 -1
  69. package/public/components/datatable/DataTableDefaultSelectionLabel.nested.js +1 -263
  70. package/public/components/datatable/DataTableDefaultSelectionLabel.nested.js.map +1 -1
  71. package/public/components/datatable/DataTableFooter.nested.js +1 -637
  72. package/public/components/datatable/DataTableFooter.nested.js.map +1 -1
  73. package/public/components/datatable/data.d.ts.map +1 -1
  74. package/public/components/dropdown/Dropdown.js +1 -1426
  75. package/public/components/dropdown/Dropdown.js.map +1 -1
  76. package/public/components/field/Field.js +1 -375
  77. package/public/components/field/Field.js.map +1 -1
  78. package/public/components/fileuploader/FileUploader.js +1 -603
  79. package/public/components/fileuploader/FileUploader.js.map +1 -1
  80. package/public/components/fileuploader/ResultFile.nested.js +1 -344
  81. package/public/components/fileuploader/ResultFile.nested.js.map +1 -1
  82. package/public/components/flag/Flag.js +1 -174
  83. package/public/components/flag/Flag.js.map +1 -1
  84. package/public/components/header/Header.js +1 -918
  85. package/public/components/header/Header.js.map +1 -1
  86. package/public/components/hero/Hero.js +1 -271
  87. package/public/components/hero/Hero.js.map +1 -1
  88. package/public/components/kpi/Kpi.js +1 -404
  89. package/public/components/kpi/Kpi.js.map +1 -1
  90. package/public/components/layer/Layer.js +1 -471
  91. package/public/components/layer/Layer.js.map +1 -1
  92. package/public/components/link/Link.js +1 -380
  93. package/public/components/link/Link.js.map +1 -1
  94. package/public/components/listbox/Listbox.js +1 -595
  95. package/public/components/listbox/Listbox.js.map +1 -1
  96. package/public/components/listbox/Listbox.nested.js +1 -629
  97. package/public/components/listbox/Listbox.nested.js.map +1 -1
  98. package/public/components/loader/Loader.js +1 -246
  99. package/public/components/loader/Loader.js.map +1 -1
  100. package/public/components/loader/Loader.nested.js +1 -176
  101. package/public/components/loader/Loader.nested.js.map +1 -1
  102. package/public/components/modal/Modal.js +1 -395
  103. package/public/components/modal/Modal.js.map +1 -1
  104. package/public/components/notification/Notification.js +1 -458
  105. package/public/components/notification/Notification.js.map +1 -1
  106. package/public/components/optionbutton/OptionButton.js +1 -316
  107. package/public/components/optionbutton/OptionButton.js.map +1 -1
  108. package/public/components/overlay/Overlay.js +1 -104
  109. package/public/components/overlay/Overlay.js.map +1 -1
  110. package/public/components/overlay/OverlayLoader.js +1 -151
  111. package/public/components/overlay/OverlayLoader.js.map +1 -1
  112. package/public/components/pagination/Pagination.js +1 -613
  113. package/public/components/pagination/Pagination.js.map +1 -1
  114. package/public/components/passwordinput/PasswordInput.js +1 -291
  115. package/public/components/passwordinput/PasswordInput.js.map +1 -1
  116. package/public/components/phonenumber/PhoneNumber.js +1 -6894
  117. package/public/components/phonenumber/PhoneNumber.js.map +1 -1
  118. package/public/components/price/Price.js +1 -768
  119. package/public/components/price/Price.js.map +1 -1
  120. package/public/components/progressbar/ProgressBar.js +1 -278
  121. package/public/components/progressbar/ProgressBar.js.map +1 -1
  122. package/public/components/quantityselector/QuantitySelector.js +1 -397
  123. package/public/components/quantityselector/QuantitySelector.js.map +1 -1
  124. package/public/components/radio/Radio.js +1 -273
  125. package/public/components/radio/Radio.js.map +1 -1
  126. package/public/components/radiogroup/RadioGroup.js +1 -414
  127. package/public/components/radiogroup/RadioGroup.js.map +1 -1
  128. package/public/components/ratings/StarsInput.js +1 -292
  129. package/public/components/ratings/StarsInput.js.map +1 -1
  130. package/public/components/ratings/StarsResult.js +1 -246
  131. package/public/components/ratings/StarsResult.js.map +1 -1
  132. package/public/components/select/Select.js +1 -451
  133. package/public/components/select/Select.js.map +1 -1
  134. package/public/components/sidebar/Sidebar.js +1 -784
  135. package/public/components/sidebar/Sidebar.js.map +1 -1
  136. package/public/components/sidebar/sidebar-feature-group.nested.js +1 -594
  137. package/public/components/sidebar/sidebar-feature-group.nested.js.map +1 -1
  138. package/public/components/sidebar/sidebar-feature.nested.js +1 -402
  139. package/public/components/sidebar/sidebar-feature.nested.js.map +1 -1
  140. package/public/components/sidebar/sidebar-section.nested.js +1 -394
  141. package/public/components/sidebar/sidebar-section.nested.js.map +1 -1
  142. package/public/components/sidebar/sidebar-segment.nested.js +1 -200
  143. package/public/components/sidebar/sidebar-segment.nested.js.map +1 -1
  144. package/public/components/sidebar/sidebar-separator.nested.js +1 -49
  145. package/public/components/sidebar/sidebar-separator.nested.js.map +1 -1
  146. package/public/components/sidebar/sidebar-sub-features.nested.js +1 -312
  147. package/public/components/sidebar/sidebar-sub-features.nested.js.map +1 -1
  148. package/public/components/sidebar/sidebar-user.nested.js +1 -733
  149. package/public/components/sidebar/sidebar-user.nested.js.map +1 -1
  150. package/public/components/stepper/Stepper.js +1 -371
  151. package/public/components/stepper/Stepper.js.map +1 -1
  152. package/public/components/tabs/Tabs.js +1 -615
  153. package/public/components/tabs/Tabs.js.map +1 -1
  154. package/public/components/tabs/Tabs.nested.js +1 -472
  155. package/public/components/tabs/Tabs.nested.js.map +1 -1
  156. package/public/components/tag/Tag.js +1 -665
  157. package/public/components/tag/Tag.js.map +1 -1
  158. package/public/components/tag/Tag.nested.js +1 -554
  159. package/public/components/tag/Tag.nested.js.map +1 -1
  160. package/public/components/taglist/TagList.js +1 -475
  161. package/public/components/taglist/TagList.js.map +1 -1
  162. package/public/components/textarea/Textarea.js +1 -303
  163. package/public/components/textarea/Textarea.js.map +1 -1
  164. package/public/components/textinput/Textinput.js +1 -497
  165. package/public/components/textinput/Textinput.js.map +1 -1
  166. package/public/components/textinput/Textinput.nested.js +1 -320
  167. package/public/components/textinput/Textinput.nested.js.map +1 -1
  168. package/public/components/toggle/Toggle.js +1 -278
  169. package/public/components/toggle/Toggle.js.map +1 -1
  170. package/public/components/tooltip/Tooltip.js +1 -173
  171. package/public/components/tooltip/Tooltip.js.map +1 -1
  172. package/public/index-c33b3772.js +1 -873
  173. package/public/index-c33b3772.js.map +1 -1
  174. package/public/linear-f46d7e9e.js +1 -700
  175. package/public/linear-f46d7e9e.js.map +1 -1
  176. package/public/path-1b5da959.js +1 -186
  177. package/public/path-1b5da959.js.map +1 -1
  178. package/public/sidebar-service-275bf9ef.js +1 -129
  179. package/public/sidebar-service-275bf9ef.js.map +1 -1
  180. package/public/symbol-b05a6e2b.js +1 -169
  181. package/public/symbol-b05a6e2b.js.map +1 -1
  182. package/public/transform-15d69d5d.js +1 -2743
  183. package/public/transform-15d69d5d.js.map +1 -1
  184. package/public/utilities/EventForward.js +1 -136
  185. package/public/utilities/EventForward.js.map +1 -1
  186. package/public/utilities/EventHandler.js +1 -36
  187. package/public/utilities/EventHandler.js.map +1 -1
  188. package/public/utilities/components/datatable/data.d.ts.map +1 -1
  189. package/public/utilities/stories/datatable/DataTable.stories.d.ts.map +1 -1
@@ -1,604 +1,2 @@
1
- import { S as SvelteElement, i as init, a as attribute_to_object, b as insert, f as flush, s as safe_not_equal, e as element, d as space, t as text, n as noop, g as attr, j as append, l as listen, k as set_data, C as transition_in, D as transition_out, E as check_outros, o as detach, x as create_component, A as mount_component, G as destroy_component, M as group_outros, v as binding_callbacks } from '../../index-c33b3772.js';
2
- import { E as EventHandler } from '../../EventHandler-02058705.js';
3
- import ResultFile_nested from './ResultFile.nested.js';
4
-
5
- /* src/components/fileuploader/FileUploader.svelte generated by Svelte v3.58.0 */
6
-
7
- function create_if_block_1(ctx) {
8
- let resultfile;
9
- let current;
10
-
11
- resultfile = new ResultFile_nested({
12
- props: {
13
- files: /*files*/ ctx[7],
14
- allowedExtensions: /*allowedExtensions*/ ctx[10],
15
- disabled: /*disabled*/ ctx[5],
16
- maxSize: /*maxSize*/ ctx[11],
17
- removelabel: /*removelabel*/ ctx[6],
18
- errorLabels: /*errorLabels*/ ctx[12]
19
- }
20
- });
21
-
22
- resultfile.$on("file-removed", /*deleteFile*/ ctx[14]);
23
-
24
- return {
25
- c() {
26
- create_component(resultfile.$$.fragment);
27
- },
28
- m(target, anchor) {
29
- mount_component(resultfile, target, anchor);
30
- current = true;
31
- },
32
- p(ctx, dirty) {
33
- const resultfile_changes = {};
34
- if (dirty & /*files*/ 128) resultfile_changes.files = /*files*/ ctx[7];
35
- if (dirty & /*allowedExtensions*/ 1024) resultfile_changes.allowedExtensions = /*allowedExtensions*/ ctx[10];
36
- if (dirty & /*disabled*/ 32) resultfile_changes.disabled = /*disabled*/ ctx[5];
37
- if (dirty & /*maxSize*/ 2048) resultfile_changes.maxSize = /*maxSize*/ ctx[11];
38
- if (dirty & /*removelabel*/ 64) resultfile_changes.removelabel = /*removelabel*/ ctx[6];
39
- if (dirty & /*errorLabels*/ 4096) resultfile_changes.errorLabels = /*errorLabels*/ ctx[12];
40
- resultfile.$set(resultfile_changes);
41
- },
42
- i(local) {
43
- if (current) return;
44
- transition_in(resultfile.$$.fragment, local);
45
- current = true;
46
- },
47
- o(local) {
48
- transition_out(resultfile.$$.fragment, local);
49
- current = false;
50
- },
51
- d(detaching) {
52
- destroy_component(resultfile, detaching);
53
- }
54
- };
55
- }
56
-
57
- // (137:2) {#if uploadedFiles.length > 0}
58
- function create_if_block(ctx) {
59
- let resultfile;
60
- let current;
61
-
62
- resultfile = new ResultFile_nested({
63
- props: {
64
- files: /*uploadedFiles*/ ctx[9],
65
- allowedExtensions: /*allowedExtensions*/ ctx[10],
66
- disabled: /*disabled*/ ctx[5],
67
- maxSize: /*maxSize*/ ctx[11],
68
- removelabel: /*removelabel*/ ctx[6],
69
- errorLabels: /*errorLabels*/ ctx[12]
70
- }
71
- });
72
-
73
- resultfile.$on("file-removed", /*deleteUploadedFile*/ ctx[15]);
74
-
75
- return {
76
- c() {
77
- create_component(resultfile.$$.fragment);
78
- },
79
- m(target, anchor) {
80
- mount_component(resultfile, target, anchor);
81
- current = true;
82
- },
83
- p(ctx, dirty) {
84
- const resultfile_changes = {};
85
- if (dirty & /*uploadedFiles*/ 512) resultfile_changes.files = /*uploadedFiles*/ ctx[9];
86
- if (dirty & /*allowedExtensions*/ 1024) resultfile_changes.allowedExtensions = /*allowedExtensions*/ ctx[10];
87
- if (dirty & /*disabled*/ 32) resultfile_changes.disabled = /*disabled*/ ctx[5];
88
- if (dirty & /*maxSize*/ 2048) resultfile_changes.maxSize = /*maxSize*/ ctx[11];
89
- if (dirty & /*removelabel*/ 64) resultfile_changes.removelabel = /*removelabel*/ ctx[6];
90
- if (dirty & /*errorLabels*/ 4096) resultfile_changes.errorLabels = /*errorLabels*/ ctx[12];
91
- resultfile.$set(resultfile_changes);
92
- },
93
- i(local) {
94
- if (current) return;
95
- transition_in(resultfile.$$.fragment, local);
96
- current = true;
97
- },
98
- o(local) {
99
- transition_out(resultfile.$$.fragment, local);
100
- current = false;
101
- },
102
- d(detaching) {
103
- destroy_component(resultfile, detaching);
104
- }
105
- };
106
- }
107
-
108
- function create_fragment(ctx) {
109
- let div;
110
- let input;
111
- let t0;
112
- let label_1;
113
- let span;
114
- let t1;
115
- let t2;
116
- let t3;
117
- let current;
118
- let mounted;
119
- let dispose;
120
- let if_block0 = /*displayfileslist*/ ctx[0] && /*files*/ ctx[7] && /*files*/ ctx[7].length > 0 && create_if_block_1(ctx);
121
- let if_block1 = /*uploadedFiles*/ ctx[9].length > 0 && create_if_block(ctx);
122
-
123
- return {
124
- c() {
125
- div = element("div");
126
- input = element("input");
127
- t0 = space();
128
- label_1 = element("label");
129
- span = element("span");
130
- t1 = text(/*label*/ ctx[2]);
131
- t2 = space();
132
- if (if_block0) if_block0.c();
133
- t3 = space();
134
- if (if_block1) if_block1.c();
135
- this.c = noop;
136
- attr(input, "id", /*id*/ ctx[1]);
137
- attr(input, "type", "file");
138
- attr(input, "class", "mc-fileuploader__input");
139
- attr(input, "accept", /*accept*/ ctx[3]);
140
- input.multiple = /*multiple*/ ctx[4];
141
- input.disabled = /*disabled*/ ctx[5];
142
- attr(span, "class", "mc-fileuploader__label--center");
143
- attr(label_1, "for", /*id*/ ctx[1]);
144
- attr(label_1, "class", "mc-fileuploader__label");
145
- attr(div, "class", "mc-fileuploader");
146
- },
147
- m(target, anchor) {
148
- insert(target, div, anchor);
149
- append(div, input);
150
- append(div, t0);
151
- append(div, label_1);
152
- append(label_1, span);
153
- append(span, t1);
154
- append(div, t2);
155
- if (if_block0) if_block0.m(div, null);
156
- append(div, t3);
157
- if (if_block1) if_block1.m(div, null);
158
- /*div_binding*/ ctx[21](div);
159
- current = true;
160
-
161
- if (!mounted) {
162
- dispose = listen(input, "change", /*handleChange*/ ctx[13]);
163
- mounted = true;
164
- }
165
- },
166
- p(ctx, [dirty]) {
167
- if (!current || dirty & /*id*/ 2) {
168
- attr(input, "id", /*id*/ ctx[1]);
169
- }
170
-
171
- if (!current || dirty & /*accept*/ 8) {
172
- attr(input, "accept", /*accept*/ ctx[3]);
173
- }
174
-
175
- if (!current || dirty & /*multiple*/ 16) {
176
- input.multiple = /*multiple*/ ctx[4];
177
- }
178
-
179
- if (!current || dirty & /*disabled*/ 32) {
180
- input.disabled = /*disabled*/ ctx[5];
181
- }
182
-
183
- if (!current || dirty & /*label*/ 4) set_data(t1, /*label*/ ctx[2]);
184
-
185
- if (!current || dirty & /*id*/ 2) {
186
- attr(label_1, "for", /*id*/ ctx[1]);
187
- }
188
-
189
- if (/*displayfileslist*/ ctx[0] && /*files*/ ctx[7] && /*files*/ ctx[7].length > 0) {
190
- if (if_block0) {
191
- if_block0.p(ctx, dirty);
192
-
193
- if (dirty & /*displayfileslist, files*/ 129) {
194
- transition_in(if_block0, 1);
195
- }
196
- } else {
197
- if_block0 = create_if_block_1(ctx);
198
- if_block0.c();
199
- transition_in(if_block0, 1);
200
- if_block0.m(div, t3);
201
- }
202
- } else if (if_block0) {
203
- group_outros();
204
-
205
- transition_out(if_block0, 1, 1, () => {
206
- if_block0 = null;
207
- });
208
-
209
- check_outros();
210
- }
211
-
212
- if (/*uploadedFiles*/ ctx[9].length > 0) {
213
- if (if_block1) {
214
- if_block1.p(ctx, dirty);
215
-
216
- if (dirty & /*uploadedFiles*/ 512) {
217
- transition_in(if_block1, 1);
218
- }
219
- } else {
220
- if_block1 = create_if_block(ctx);
221
- if_block1.c();
222
- transition_in(if_block1, 1);
223
- if_block1.m(div, null);
224
- }
225
- } else if (if_block1) {
226
- group_outros();
227
-
228
- transition_out(if_block1, 1, 1, () => {
229
- if_block1 = null;
230
- });
231
-
232
- check_outros();
233
- }
234
- },
235
- i(local) {
236
- if (current) return;
237
- transition_in(if_block0);
238
- transition_in(if_block1);
239
- current = true;
240
- },
241
- o(local) {
242
- transition_out(if_block0);
243
- transition_out(if_block1);
244
- current = false;
245
- },
246
- d(detaching) {
247
- if (detaching) detach(div);
248
- if (if_block0) if_block0.d();
249
- if (if_block1) if_block1.d();
250
- /*div_binding*/ ctx[21](null);
251
- mounted = false;
252
- dispose();
253
- }
254
- };
255
- }
256
-
257
- function removeFromArray(fileList, value) {
258
- const array = Array.from(fileList);
259
- const idx = array.indexOf(value);
260
-
261
- if (idx !== -1) {
262
- array.splice(idx, 1);
263
- }
264
-
265
- return array;
266
- }
267
-
268
- function instance($$self, $$props, $$invalidate) {
269
- let allowedExtensions;
270
- let uploadedFiles;
271
- let maxSize;
272
- let errorLabels;
273
- let { id } = $$props;
274
- let { label } = $$props;
275
- let { accept } = $$props;
276
- let { multiple = true } = $$props;
277
- let { allowedextensions } = $$props;
278
- let { maxsize } = $$props;
279
- let { displayfileslist = false } = $$props;
280
- let { disabled = false } = $$props;
281
- let { removelabel = 'Remove' } = $$props;
282
- let { uploadedfiles } = $$props;
283
- let { errorlabels } = $$props;
284
- let { stateless } = $$props;
285
- let files;
286
- let root;
287
- let eventHandler = new EventHandler();
288
-
289
- function checkFileSize(fileSize) {
290
- const fileSizeMB = fileSize / 1024 / 1024;
291
-
292
- if (maxSize && fileSizeMB > maxSize) {
293
- return false;
294
- }
295
-
296
- return true;
297
- }
298
-
299
- function checkFileExtension(fileName) {
300
- if (allowedExtensions && allowedExtensions.length > 0) {
301
- const extension = fileName.slice((fileName.lastIndexOf('.') - 1 >>> 0) + 2);
302
-
303
- if (allowedExtensions && !allowedExtensions.includes(String(extension))) {
304
- return false;
305
- }
306
- }
307
-
308
- return true;
309
- }
310
-
311
- function handleChange(e) {
312
- const target = e.target;
313
- $$invalidate(7, files = target.files);
314
- $$invalidate(0, displayfileslist = true);
315
- const invalidFiles = [];
316
- const fileList = [...files];
317
-
318
- fileList.forEach((file, index) => {
319
- const fileName = file.name;
320
- const fileSize = file.size;
321
- const validExtension = checkFileExtension(fileName);
322
- const validSize = checkFileSize(fileSize);
323
- let errorType = '';
324
-
325
- if (!validExtension) {
326
- errorType = 'invalid-extension';
327
- }
328
-
329
- if (!validSize) {
330
- errorType = 'invalid-size';
331
- }
332
-
333
- if (!validExtension || !validSize) {
334
- invalidFiles.push({ index, fileName, fileSize, errorType });
335
- }
336
- });
337
-
338
- if (invalidFiles.length > 0) {
339
- eventHandler.dispatch('invalid-files', invalidFiles);
340
- }
341
-
342
- eventHandler.dispatch('change', files);
343
-
344
- if (stateless) {
345
- const fileuploader = root.querySelector('.mc-fileuploader__input');
346
- fileuploader.value = '';
347
- }
348
- }
349
-
350
- function deleteFile(e) {
351
- $$invalidate(7, files = removeFromArray(files, e.detail));
352
- const fileuploader = root.querySelector('.mc-fileuploader__input');
353
- fileuploader.value = '';
354
- eventHandler.dispatch('file-removed', e.detail);
355
- }
356
-
357
- function deleteUploadedFile(e) {
358
- const files = removeFromArray(uploadedFiles, e.detail);
359
- $$invalidate(9, uploadedFiles = files);
360
- eventHandler.dispatch('uploaded-file-removed', e.detail);
361
- }
362
-
363
- function div_binding($$value) {
364
- binding_callbacks[$$value ? 'unshift' : 'push'](() => {
365
- root = $$value;
366
- $$invalidate(8, root);
367
- });
368
- }
369
-
370
- $$self.$$set = $$props => {
371
- if ('id' in $$props) $$invalidate(1, id = $$props.id);
372
- if ('label' in $$props) $$invalidate(2, label = $$props.label);
373
- if ('accept' in $$props) $$invalidate(3, accept = $$props.accept);
374
- if ('multiple' in $$props) $$invalidate(4, multiple = $$props.multiple);
375
- if ('allowedextensions' in $$props) $$invalidate(16, allowedextensions = $$props.allowedextensions);
376
- if ('maxsize' in $$props) $$invalidate(17, maxsize = $$props.maxsize);
377
- if ('displayfileslist' in $$props) $$invalidate(0, displayfileslist = $$props.displayfileslist);
378
- if ('disabled' in $$props) $$invalidate(5, disabled = $$props.disabled);
379
- if ('removelabel' in $$props) $$invalidate(6, removelabel = $$props.removelabel);
380
- if ('uploadedfiles' in $$props) $$invalidate(18, uploadedfiles = $$props.uploadedfiles);
381
- if ('errorlabels' in $$props) $$invalidate(19, errorlabels = $$props.errorlabels);
382
- if ('stateless' in $$props) $$invalidate(20, stateless = $$props.stateless);
383
- };
384
-
385
- $$self.$$.update = () => {
386
- if ($$self.$$.dirty & /*allowedextensions*/ 65536) {
387
- $$invalidate(10, allowedExtensions = allowedextensions ? JSON.parse(allowedextensions) : []);
388
- }
389
-
390
- if ($$self.$$.dirty & /*uploadedfiles*/ 262144) {
391
- $$invalidate(9, uploadedFiles = uploadedfiles ? JSON.parse(uploadedfiles) : []);
392
- }
393
-
394
- if ($$self.$$.dirty & /*files*/ 128) ;
395
-
396
- if ($$self.$$.dirty & /*maxsize*/ 131072) {
397
- $$invalidate(11, maxSize = maxsize ? maxsize : undefined);
398
- }
399
-
400
- if ($$self.$$.dirty & /*errorlabels*/ 524288) {
401
- $$invalidate(12, errorLabels = errorlabels ? JSON.parse(errorlabels) : []);
402
- }
403
- };
404
-
405
- return [
406
- displayfileslist,
407
- id,
408
- label,
409
- accept,
410
- multiple,
411
- disabled,
412
- removelabel,
413
- files,
414
- root,
415
- uploadedFiles,
416
- allowedExtensions,
417
- maxSize,
418
- errorLabels,
419
- handleChange,
420
- deleteFile,
421
- deleteUploadedFile,
422
- allowedextensions,
423
- maxsize,
424
- uploadedfiles,
425
- errorlabels,
426
- stateless,
427
- div_binding
428
- ];
429
- }
430
-
431
- class FileUploader extends SvelteElement {
432
- constructor(options) {
433
- super();
434
- const style = document.createElement('style');
435
- style.textContent = `.mc-fileuploader{position:relative;display:block}.mc-fileuploader__input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;visibility:visible;white-space:nowrap}.mc-fileuploader__label{font-family:"LeroyMerlin", sans-serif;font-weight:600;cursor:pointer;border-radius:4px;text-align:center;border:2px solid transparent;-webkit-transition:all ease 200ms;-o-transition:all ease 200ms;transition:all ease 200ms;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;vertical-align:middle;font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem;color:#188803;border-color:#188803;background-color:#ffffff;margin:0;-webkit-box-shadow:none;box-shadow:none;text-decoration:none;outline:none;-webkit-box-sizing:border-box;box-sizing:border-box}.mc-fileuploader__label:hover{background-color:#ebf5de;color:#006902}.mc-fileuploader__label:active{background-color:#c5e39e;color:#035010}.mc-fileuploader__label:active{background-color:#c5e39e;color:#035010}.mc-fileuploader__label:disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-fileuploader__label::before{content:"";width:1.5rem;height:1.5rem;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:transparent url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMS41cmVtIiB3aWR0aD0iMS41cmVtIiBmaWxsPSIjMTg4ODAzIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjx0aXRsZT5NZWRpYV9VcGxvYWRfMjRweDwvdGl0bGU+PHBhdGggZD0iTTguNzEsNy43MSwxMSw1LjQxVjE2YTEsMSwwLDAsMCwyLDBWNS40MWwyLjI5LDIuM2ExLDEsMCwwLDAsMS40MiwwLDEsMSwwLDAsMCwwLTEuNDJsLTQtNGExLDEsMCwwLDAtMS40MiwwbC00LDRBMSwxLDAsMSwwLDguNzEsNy43MVoiLz48cGF0aCBkPSJNMTYuMjIsMTIuNDRhMSwxLDAsMCwwLTEuMi43NywxLDEsMCwwLDAsLjc2LDEuMTlDMTguNTUsMTUsMjAsMTYuMTcsMjAsMTdjMCwxLjIyLTMuMTIsMy04LDNzLTgtMS43OC04LTNjMC0uODMsMS40NS0yLDQuMjItMi42QTEsMSwwLDAsMCw5LDEzLjIxYTEsMSwwLDAsMC0xLjItLjc3QzQuMTYsMTMuMjUsMiwxNSwyLDE3YzAsMi44NSw0LjMsNSwxMCw1czEwLTIuMTUsMTAtNUMyMiwxNSwxOS44NCwxMy4yNSwxNi4yMiwxMi40NFoiLz48L3N2Zz4=") no-repeat;background-size:1.5rem;margin-right:0.5rem;margin-left:-0.5rem}:focus+.mc-fileuploader__label{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc}:hover+.mc-fileuploader__label{color:#006902;background-color:#ebf5de}:disabled+.mc-fileuploader__label{color:#666666;background-color:#cccccc;border-color:transparent;cursor:not-allowed}:disabled+.mc-fileuploader__label::before{background:transparent url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMS41cmVtIiB3aWR0aD0iMS41cmVtIiBmaWxsPSIjNjY2NjY2IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjx0aXRsZT5NZWRpYV9VcGxvYWRfMjRweDwvdGl0bGU+PHBhdGggZD0iTTguNzEsNy43MSwxMSw1LjQxVjE2YTEsMSwwLDAsMCwyLDBWNS40MWwyLjI5LDIuM2ExLDEsMCwwLDAsMS40MiwwLDEsMSwwLDAsMCwwLTEuNDJsLTQtNGExLDEsMCwwLDAtMS40MiwwbC00LDRBMSwxLDAsMSwwLDguNzEsNy43MVoiLz48cGF0aCBkPSJNMTYuMjIsMTIuNDRhMSwxLDAsMCwwLTEuMi43NywxLDEsMCwwLDAsLjc2LDEuMTlDMTguNTUsMTUsMjAsMTYuMTcsMjAsMTdjMCwxLjIyLTMuMTIsMy04LDNzLTgtMS43OC04LTNjMC0uODMsMS40NS0yLDQuMjItMi42QTEsMSwwLDAsMCw5LDEzLjIxYTEsMSwwLDAsMC0xLjItLjc3QzQuMTYsMTMuMjUsMiwxNSwyLDE3YzAsMi44NSw0LjMsNSwxMCw1czEwLTIuMTUsMTAtNUMyMiwxNSwxOS44NCwxMy4yNSwxNi4yMiwxMi40NFoiLz48L3N2Zz4=") no-repeat}`;
436
- this.shadowRoot.appendChild(style);
437
-
438
- init(
439
- this,
440
- {
441
- target: this.shadowRoot,
442
- props: attribute_to_object(this.attributes),
443
- customElement: true
444
- },
445
- instance,
446
- create_fragment,
447
- safe_not_equal,
448
- {
449
- id: 1,
450
- label: 2,
451
- accept: 3,
452
- multiple: 4,
453
- allowedextensions: 16,
454
- maxsize: 17,
455
- displayfileslist: 0,
456
- disabled: 5,
457
- removelabel: 6,
458
- uploadedfiles: 18,
459
- errorlabels: 19,
460
- stateless: 20
461
- },
462
- null
463
- );
464
-
465
- if (options) {
466
- if (options.target) {
467
- insert(options.target, this, options.anchor);
468
- }
469
-
470
- if (options.props) {
471
- this.$set(options.props);
472
- flush();
473
- }
474
- }
475
- }
476
-
477
- static get observedAttributes() {
478
- return [
479
- "id",
480
- "label",
481
- "accept",
482
- "multiple",
483
- "allowedextensions",
484
- "maxsize",
485
- "displayfileslist",
486
- "disabled",
487
- "removelabel",
488
- "uploadedfiles",
489
- "errorlabels",
490
- "stateless"
491
- ];
492
- }
493
-
494
- get id() {
495
- return this.$$.ctx[1];
496
- }
497
-
498
- set id(id) {
499
- this.$$set({ id });
500
- flush();
501
- }
502
-
503
- get label() {
504
- return this.$$.ctx[2];
505
- }
506
-
507
- set label(label) {
508
- this.$$set({ label });
509
- flush();
510
- }
511
-
512
- get accept() {
513
- return this.$$.ctx[3];
514
- }
515
-
516
- set accept(accept) {
517
- this.$$set({ accept });
518
- flush();
519
- }
520
-
521
- get multiple() {
522
- return this.$$.ctx[4];
523
- }
524
-
525
- set multiple(multiple) {
526
- this.$$set({ multiple });
527
- flush();
528
- }
529
-
530
- get allowedextensions() {
531
- return this.$$.ctx[16];
532
- }
533
-
534
- set allowedextensions(allowedextensions) {
535
- this.$$set({ allowedextensions });
536
- flush();
537
- }
538
-
539
- get maxsize() {
540
- return this.$$.ctx[17];
541
- }
542
-
543
- set maxsize(maxsize) {
544
- this.$$set({ maxsize });
545
- flush();
546
- }
547
-
548
- get displayfileslist() {
549
- return this.$$.ctx[0];
550
- }
551
-
552
- set displayfileslist(displayfileslist) {
553
- this.$$set({ displayfileslist });
554
- flush();
555
- }
556
-
557
- get disabled() {
558
- return this.$$.ctx[5];
559
- }
560
-
561
- set disabled(disabled) {
562
- this.$$set({ disabled });
563
- flush();
564
- }
565
-
566
- get removelabel() {
567
- return this.$$.ctx[6];
568
- }
569
-
570
- set removelabel(removelabel) {
571
- this.$$set({ removelabel });
572
- flush();
573
- }
574
-
575
- get uploadedfiles() {
576
- return this.$$.ctx[18];
577
- }
578
-
579
- set uploadedfiles(uploadedfiles) {
580
- this.$$set({ uploadedfiles });
581
- flush();
582
- }
583
-
584
- get errorlabels() {
585
- return this.$$.ctx[19];
586
- }
587
-
588
- set errorlabels(errorlabels) {
589
- this.$$set({ errorlabels });
590
- flush();
591
- }
592
-
593
- get stateless() {
594
- return this.$$.ctx[20];
595
- }
596
-
597
- set stateless(stateless) {
598
- this.$$set({ stateless });
599
- flush();
600
- }
601
- }
602
-
603
- export { FileUploader as default };
1
+ import{S as e,i as s,a as l,b as i,f as t,s as a,e as r,d as o,t as n,n as d,g as c,j as u,l as M,k as w,C as m,D as b,E as p,o as f,x,A as L,G as g,M as $,v as h}from"../../index-c33b3772.js";import{E as D}from"../../EventHandler-02058705.js";import S from"./ResultFile.nested.js";function y(e){let s,l;return s=new S({props:{files:e[7],allowedExtensions:e[10],disabled:e[5],maxSize:e[11],removelabel:e[6],errorLabels:e[12]}}),s.$on("file-removed",e[14]),{c(){x(s.$$.fragment)},m(e,i){L(s,e,i),l=!0},p(e,l){const i={};128&l&&(i.files=e[7]),1024&l&&(i.allowedExtensions=e[10]),32&l&&(i.disabled=e[5]),2048&l&&(i.maxSize=e[11]),64&l&&(i.removelabel=e[6]),4096&l&&(i.errorLabels=e[12]),s.$set(i)},i(e){l||(m(s.$$.fragment,e),l=!0)},o(e){b(s.$$.fragment,e),l=!1},d(e){g(s,e)}}}function N(e){let s,l;return s=new S({props:{files:e[9],allowedExtensions:e[10],disabled:e[5],maxSize:e[11],removelabel:e[6],errorLabels:e[12]}}),s.$on("file-removed",e[15]),{c(){x(s.$$.fragment)},m(e,i){L(s,e,i),l=!0},p(e,l){const i={};512&l&&(i.files=e[9]),1024&l&&(i.allowedExtensions=e[10]),32&l&&(i.disabled=e[5]),2048&l&&(i.maxSize=e[11]),64&l&&(i.removelabel=e[6]),4096&l&&(i.errorLabels=e[12]),s.$set(i)},i(e){l||(m(s.$$.fragment,e),l=!0)},o(e){b(s.$$.fragment,e),l=!1},d(e){g(s,e)}}}function T(e){let s,l,t,a,x,L,g,h,D,S,T,j=e[0]&&e[7]&&e[7].length>0&&y(e),v=e[9].length>0&&N(e);return{c(){s=r("div"),l=r("input"),t=o(),a=r("label"),x=r("span"),L=n(e[2]),g=o(),j&&j.c(),h=o(),v&&v.c(),this.c=d,c(l,"id",e[1]),c(l,"type","file"),c(l,"class","mc-fileuploader__input"),c(l,"accept",e[3]),l.multiple=e[4],l.disabled=e[5],c(x,"class","mc-fileuploader__label--center"),c(a,"for",e[1]),c(a,"class","mc-fileuploader__label"),c(s,"class","mc-fileuploader")},m(r,o){i(r,s,o),u(s,l),u(s,t),u(s,a),u(a,x),u(x,L),u(s,g),j&&j.m(s,null),u(s,h),v&&v.m(s,null),e[21](s),D=!0,S||(T=M(l,"change",e[13]),S=!0)},p(e,[i]){(!D||2&i)&&c(l,"id",e[1]),(!D||8&i)&&c(l,"accept",e[3]),(!D||16&i)&&(l.multiple=e[4]),(!D||32&i)&&(l.disabled=e[5]),(!D||4&i)&&w(L,e[2]),(!D||2&i)&&c(a,"for",e[1]),e[0]&&e[7]&&e[7].length>0?j?(j.p(e,i),129&i&&m(j,1)):(j=y(e),j.c(),m(j,1),j.m(s,h)):j&&($(),b(j,1,1,(()=>{j=null})),p()),e[9].length>0?v?(v.p(e,i),512&i&&m(v,1)):(v=N(e),v.c(),m(v,1),v.m(s,null)):v&&($(),b(v,1,1,(()=>{v=null})),p())},i(e){D||(m(j),m(v),D=!0)},o(e){b(j),b(v),D=!1},d(l){l&&f(s),j&&j.d(),v&&v.d(),e[21](null),S=!1,T()}}}function j(e,s){const l=Array.from(e),i=l.indexOf(s);return-1!==i&&l.splice(i,1),l}function v(e,s,l){let i,t,a,r,o,n,{id:d}=s,{label:c}=s,{accept:u}=s,{multiple:M=!0}=s,{allowedextensions:w}=s,{maxsize:m}=s,{displayfileslist:b=!1}=s,{disabled:p=!1}=s,{removelabel:f="Remove"}=s,{uploadedfiles:x}=s,{errorlabels:L}=s,{stateless:g}=s,$=new D;return e.$$set=e=>{"id"in e&&l(1,d=e.id),"label"in e&&l(2,c=e.label),"accept"in e&&l(3,u=e.accept),"multiple"in e&&l(4,M=e.multiple),"allowedextensions"in e&&l(16,w=e.allowedextensions),"maxsize"in e&&l(17,m=e.maxsize),"displayfileslist"in e&&l(0,b=e.displayfileslist),"disabled"in e&&l(5,p=e.disabled),"removelabel"in e&&l(6,f=e.removelabel),"uploadedfiles"in e&&l(18,x=e.uploadedfiles),"errorlabels"in e&&l(19,L=e.errorlabels),"stateless"in e&&l(20,g=e.stateless)},e.$$.update=()=>{65536&e.$$.dirty&&l(10,i=w?JSON.parse(w):[]),262144&e.$$.dirty&&l(9,t=x?JSON.parse(x):[]),e.$$.dirty,131072&e.$$.dirty&&l(11,a=m||void 0),524288&e.$$.dirty&&l(12,r=L?JSON.parse(L):[])},[b,d,c,u,M,p,f,o,n,t,i,a,r,function(e){const s=e.target;l(7,o=s.files),l(0,b=!0);const t=[];if([...o].forEach(((e,s)=>{const l=e.name,r=e.size,o=function(e){if(i&&i.length>0){const s=e.slice(2+(e.lastIndexOf(".")-1>>>0));if(i&&!i.includes(String(s)))return!1}return!0}(l),n=function(e){return!(a&&e/1024/1024>a)}(r);let d="";o||(d="invalid-extension"),n||(d="invalid-size"),o&&n||t.push({index:s,fileName:l,fileSize:r,errorType:d})})),t.length>0&&$.dispatch("invalid-files",t),$.dispatch("change",o),g){n.querySelector(".mc-fileuploader__input").value=""}},function(e){l(7,o=j(o,e.detail)),n.querySelector(".mc-fileuploader__input").value="",$.dispatch("file-removed",e.detail)},function(e){const s=j(t,e.detail);l(9,t=s),$.dispatch("uploaded-file-removed",e.detail)},w,m,x,L,g,function(e){h[e?"unshift":"push"]((()=>{n=e,l(8,n)}))}]}class E extends e{constructor(e){super();const r=document.createElement("style");r.textContent='.mc-fileuploader{position:relative;display:block}.mc-fileuploader__input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0;visibility:visible;white-space:nowrap}.mc-fileuploader__label{font-family:"LeroyMerlin", sans-serif;font-weight:600;cursor:pointer;border-radius:4px;text-align:center;border:2px solid transparent;-webkit-transition:all ease 200ms;-o-transition:all ease 200ms;transition:all ease 200ms;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;vertical-align:middle;font-size:1rem;line-height:1.375;padding:0.6875rem 1.5rem;min-height:3rem;min-width:3rem;color:#188803;border-color:#188803;background-color:#ffffff;margin:0;-webkit-box-shadow:none;box-shadow:none;text-decoration:none;outline:none;-webkit-box-sizing:border-box;box-sizing:border-box}.mc-fileuploader__label:hover{background-color:#ebf5de;color:#006902}.mc-fileuploader__label:active{background-color:#c5e39e;color:#035010}.mc-fileuploader__label:active{background-color:#c5e39e;color:#035010}.mc-fileuploader__label:disabled{background-color:#cccccc;border-color:transparent;color:#666666;cursor:not-allowed}.mc-fileuploader__label::before{content:"";width:1.5rem;height:1.5rem;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:transparent url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMS41cmVtIiB3aWR0aD0iMS41cmVtIiBmaWxsPSIjMTg4ODAzIiB2aWV3Qm94PSIwIDAgMjQgMjQiPjx0aXRsZT5NZWRpYV9VcGxvYWRfMjRweDwvdGl0bGU+PHBhdGggZD0iTTguNzEsNy43MSwxMSw1LjQxVjE2YTEsMSwwLDAsMCwyLDBWNS40MWwyLjI5LDIuM2ExLDEsMCwwLDAsMS40MiwwLDEsMSwwLDAsMCwwLTEuNDJsLTQtNGExLDEsMCwwLDAtMS40MiwwbC00LDRBMSwxLDAsMSwwLDguNzEsNy43MVoiLz48cGF0aCBkPSJNMTYuMjIsMTIuNDRhMSwxLDAsMCwwLTEuMi43NywxLDEsMCwwLDAsLjc2LDEuMTlDMTguNTUsMTUsMjAsMTYuMTcsMjAsMTdjMCwxLjIyLTMuMTIsMy04LDNzLTgtMS43OC04LTNjMC0uODMsMS40NS0yLDQuMjItMi42QTEsMSwwLDAsMCw5LDEzLjIxYTEsMSwwLDAsMC0xLjItLjc3QzQuMTYsMTMuMjUsMiwxNSwyLDE3YzAsMi44NSw0LjMsNSwxMCw1czEwLTIuMTUsMTAtNUMyMiwxNSwxOS44NCwxMy4yNSwxNi4yMiwxMi40NFoiLz48L3N2Zz4=") no-repeat;background-size:1.5rem;margin-right:0.5rem;margin-left:-0.5rem}:focus+.mc-fileuploader__label{-webkit-box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc;box-shadow:0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #0b96cc}:hover+.mc-fileuploader__label{color:#006902;background-color:#ebf5de}:disabled+.mc-fileuploader__label{color:#666666;background-color:#cccccc;border-color:transparent;cursor:not-allowed}:disabled+.mc-fileuploader__label::before{background:transparent url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMS41cmVtIiB3aWR0aD0iMS41cmVtIiBmaWxsPSIjNjY2NjY2IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjx0aXRsZT5NZWRpYV9VcGxvYWRfMjRweDwvdGl0bGU+PHBhdGggZD0iTTguNzEsNy43MSwxMSw1LjQxVjE2YTEsMSwwLDAsMCwyLDBWNS40MWwyLjI5LDIuM2ExLDEsMCwwLDAsMS40MiwwLDEsMSwwLDAsMCwwLTEuNDJsLTQtNGExLDEsMCwwLDAtMS40MiwwbC00LDRBMSwxLDAsMSwwLDguNzEsNy43MVoiLz48cGF0aCBkPSJNMTYuMjIsMTIuNDRhMSwxLDAsMCwwLTEuMi43NywxLDEsMCwwLDAsLjc2LDEuMTlDMTguNTUsMTUsMjAsMTYuMTcsMjAsMTdjMCwxLjIyLTMuMTIsMy04LDNzLTgtMS43OC04LTNjMC0uODMsMS40NS0yLDQuMjItMi42QTEsMSwwLDAsMCw5LDEzLjIxYTEsMSwwLDAsMC0xLjItLjc3QzQuMTYsMTMuMjUsMiwxNSwyLDE3YzAsMi44NSw0LjMsNSwxMCw1czEwLTIuMTUsMTAtNUMyMiwxNSwxOS44NCwxMy4yNSwxNi4yMiwxMi40NFoiLz48L3N2Zz4=") no-repeat}',this.shadowRoot.appendChild(r),s(this,{target:this.shadowRoot,props:l(this.attributes),customElement:!0},v,T,a,{id:1,label:2,accept:3,multiple:4,allowedextensions:16,maxsize:17,displayfileslist:0,disabled:5,removelabel:6,uploadedfiles:18,errorlabels:19,stateless:20},null),e&&(e.target&&i(e.target,this,e.anchor),e.props&&(this.$set(e.props),t()))}static get observedAttributes(){return["id","label","accept","multiple","allowedextensions","maxsize","displayfileslist","disabled","removelabel","uploadedfiles","errorlabels","stateless"]}get id(){return this.$$.ctx[1]}set id(e){this.$$set({id:e}),t()}get label(){return this.$$.ctx[2]}set label(e){this.$$set({label:e}),t()}get accept(){return this.$$.ctx[3]}set accept(e){this.$$set({accept:e}),t()}get multiple(){return this.$$.ctx[4]}set multiple(e){this.$$set({multiple:e}),t()}get allowedextensions(){return this.$$.ctx[16]}set allowedextensions(e){this.$$set({allowedextensions:e}),t()}get maxsize(){return this.$$.ctx[17]}set maxsize(e){this.$$set({maxsize:e}),t()}get displayfileslist(){return this.$$.ctx[0]}set displayfileslist(e){this.$$set({displayfileslist:e}),t()}get disabled(){return this.$$.ctx[5]}set disabled(e){this.$$set({disabled:e}),t()}get removelabel(){return this.$$.ctx[6]}set removelabel(e){this.$$set({removelabel:e}),t()}get uploadedfiles(){return this.$$.ctx[18]}set uploadedfiles(e){this.$$set({uploadedfiles:e}),t()}get errorlabels(){return this.$$.ctx[19]}set errorlabels(e){this.$$set({errorlabels:e}),t()}get stateless(){return this.$$.ctx[20]}set stateless(e){this.$$set({stateless:e}),t()}}export{E as default};
604
2
  //# sourceMappingURL=FileUploader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileUploader.js","sources":["../../../src/components/fileuploader/FileUploader.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n // @ts-nocheck\n import { EventHandler } from '../../utilities/EventHandler';\n import ResultFile from './ResultFile.nested.svelte';\n\n export let id: string;\n export let label: string;\n export let accept: string;\n export let multiple = true;\n export let allowedextensions: string;\n export let maxsize: number;\n export let displayfileslist = false;\n export let disabled = false;\n export let removelabel = 'Remove';\n export let uploadedfiles: string;\n export let errorlabels: string;\n export let stateless: false;\n\n let files: FileList;\n let root: HTMLElement;\n let eventHandler = new EventHandler();\n\n $: allowedExtensions = allowedextensions ? JSON.parse(allowedextensions) : [];\n $: uploadedFiles = uploadedfiles ? JSON.parse(uploadedfiles) : [];\n $: files;\n $: maxSize = maxsize ? maxsize : undefined;\n $: errorLabels = errorlabels ? JSON.parse(errorlabels) : [];\n\n function checkFileSize(fileSize: number): boolean {\n const fileSizeMB = fileSize / 1024 / 1024; // in MB\n if (maxSize && fileSizeMB > maxSize) {\n return false; // invalid\n }\n\n return true; // valid\n }\n function checkFileExtension(fileName: string): boolean {\n if (allowedExtensions && allowedExtensions.length > 0) {\n const extension: string = fileName.slice(\n ((fileName.lastIndexOf('.') - 1) >>> 0) + 2,\n );\n if (allowedExtensions && !allowedExtensions.includes(String(extension))) {\n return false; // invalid\n }\n }\n\n return true; // valid\n }\n\n function checkFileStatus(file: File): boolean {\n const validExtension = allowedExtensions\n ? checkFileExtension(file.name)\n : true;\n const validSize = checkFileSize(file.size);\n\n if (!validExtension || !validSize) {\n return false; // invalid\n }\n\n return true; // valid\n }\n function handleChange(e: Event): void {\n const target = e.target as HTMLInputElement;\n files = target.files as FileList;\n displayfileslist = true;\n const invalidFiles: Array = [];\n const fileList = [...files];\n fileList.forEach((file, index) => {\n const fileName = file.name;\n const fileSize = file.size;\n const validExtension = checkFileExtension(fileName);\n const validSize = checkFileSize(fileSize);\n let errorType = '';\n\n if (!validExtension) {\n errorType = 'invalid-extension';\n }\n\n if (!validSize) {\n errorType = 'invalid-size';\n }\n\n if (!validExtension || !validSize) {\n invalidFiles.push({\n index: index,\n fileName: fileName,\n fileSize: fileSize,\n errorType: errorType,\n });\n }\n });\n\n if (invalidFiles.length > 0) {\n eventHandler.dispatch('invalid-files', invalidFiles);\n }\n eventHandler.dispatch('change', files);\n if (stateless) {\n const fileuploader = root.querySelector(\n '.mc-fileuploader__input',\n ) as HTMLInputElement;\n fileuploader.value = '';\n }\n }\n\n function removeFromArray(fileList: FileList, value: File): FileList {\n const array = Array.from(fileList);\n const idx = array.indexOf(value);\n if (idx !== -1) {\n array.splice(idx, 1);\n }\n return array as FileList;\n }\n\n function deleteFile(e: CustomEvent): void {\n files = removeFromArray(files, e.detail);\n const fileuploader = root.querySelector(\n '.mc-fileuploader__input',\n ) as HTMLInputElement;\n fileuploader.value = '';\n eventHandler.dispatch('file-removed', e.detail);\n }\n\n function deleteUploadedFile(e: CustomEvent): void {\n const files = removeFromArray(uploadedFiles, e.detail);\n uploadedFiles = files;\n eventHandler.dispatch('uploaded-file-removed', e.detail);\n }\n\n function hasInvalidFiles(e: CustomEvent): void {\n eventHandler.dispatch('invalid-files', e.detail);\n }\n</script>\n\n<div class=\"mc-fileuploader\" bind:this={root}>\n <input\n {id}\n type=\"file\"\n class=\"mc-fileuploader__input\"\n {accept}\n {multiple}\n {disabled}\n on:change={handleChange}\n />\n <label for={id} class=\"mc-fileuploader__label\">\n <span class=\"mc-fileuploader__label--center\">\n {label}\n </span>\n </label>\n {#if displayfileslist && files && files.length > 0}\n <ResultFile\n {files}\n {allowedExtensions}\n {disabled}\n {maxSize}\n {removelabel}\n {errorLabels}\n on:file-removed={deleteFile}\n />\n {/if}\n {#if uploadedFiles.length > 0}\n <ResultFile\n files={uploadedFiles}\n {allowedExtensions}\n {disabled}\n {maxSize}\n {removelabel}\n {errorLabels}\n on:file-removed={deleteUploadedFile}\n />\n {/if}\n</div>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/all-settings';\n @import '@mozaic-ds/styles/components/c.file-uploader';\n</style>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;+CA8JuB,GAAU,CAAA,EAAA,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAKpB,GAAa,CAAA,CAAA,CAAA;;;;;;;;;uDAMH,GAAkB,CAAA,EAAA,CAAA,CAAA,CAAA;;;;;;;;;;;;mFAN5B,GAAa,CAAA,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAbnB,CAAA,IAAA,SAAA,wBAAA,GAAgB,iBAAI,GAAK,CAAA,CAAA,CAAA,cAAI,GAAK,CAAC,CAAA,CAAA,CAAA,MAAM,GAAG,CAAC,IAAA,iBAAA,CAAA,GAAA,CAAA,CAAA;mCAW7C,GAAa,CAAA,CAAA,CAAA,CAAC,MAAM,GAAG,CAAC,IAAA,eAAA,CAAA,GAAA,CAAA,CAAA;;;;;;;;;uBAdxB,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA;;;;;;;;;;;;;+BA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AAE,CAAA;AACvB,EAAA,YAAY,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC,MAAM,CAAA,CAAA;;;AAGvC,CAAA,SAAA,kBAAkB,CAAC,CAAc,EAAA;AAClC,EAAA,MAAA,KAAK,GAAG,eAAe,CAAC,aAAa,EAAE,CAAC,CAAC,MAAM,CAAA,CAAA;AACrD,EAAA,YAAA,CAAA,CAAA,EAAA,aAAa,GAAG,KAAK,CAAA,CAAA;AACrB,EAAA,YAAY,CAAC,QAAQ,CAAC,uBAAuB,EAAE,CAAC,CAAC,MAAM,CAAA,CAAA;;;;;GAQnB,IAAI,GAAA,OAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;GA/GzC,YAAA,CAAA,EAAA,EAAE,iBAAiB,GAAG,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAA,GAAA,EAAA,CAAA,CAAA;;;;GACtE,YAAA,CAAA,CAAA,EAAE,aAAa,GAAG,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAA,GAAA,EAAA,CAAA,CAAA;;;;;;AAE3D,oBAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAA,CAAA;;;;GACzC,YAAA,CAAA,EAAA,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAA,GAAA,EAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"FileUploader.js","sources":["../../../src/components/fileuploader/FileUploader.svelte"],"sourcesContent":["<svelte:options tag={null} />\n\n<script lang=\"ts\">\n // @ts-nocheck\n import { EventHandler } from '../../utilities/EventHandler';\n import ResultFile from './ResultFile.nested.svelte';\n\n export let id: string;\n export let label: string;\n export let accept: string;\n export let multiple = true;\n export let allowedextensions: string;\n export let maxsize: number;\n export let displayfileslist = false;\n export let disabled = false;\n export let removelabel = 'Remove';\n export let uploadedfiles: string;\n export let errorlabels: string;\n export let stateless: false;\n\n let files: FileList;\n let root: HTMLElement;\n let eventHandler = new EventHandler();\n\n $: allowedExtensions = allowedextensions ? JSON.parse(allowedextensions) : [];\n $: uploadedFiles = uploadedfiles ? JSON.parse(uploadedfiles) : [];\n $: files;\n $: maxSize = maxsize ? maxsize : undefined;\n $: errorLabels = errorlabels ? JSON.parse(errorlabels) : [];\n\n function checkFileSize(fileSize: number): boolean {\n const fileSizeMB = fileSize / 1024 / 1024; // in MB\n if (maxSize && fileSizeMB > maxSize) {\n return false; // invalid\n }\n\n return true; // valid\n }\n function checkFileExtension(fileName: string): boolean {\n if (allowedExtensions && allowedExtensions.length > 0) {\n const extension: string = fileName.slice(\n ((fileName.lastIndexOf('.') - 1) >>> 0) + 2,\n );\n if (allowedExtensions && !allowedExtensions.includes(String(extension))) {\n return false; // invalid\n }\n }\n\n return true; // valid\n }\n\n function checkFileStatus(file: File): boolean {\n const validExtension = allowedExtensions\n ? checkFileExtension(file.name)\n : true;\n const validSize = checkFileSize(file.size);\n\n if (!validExtension || !validSize) {\n return false; // invalid\n }\n\n return true; // valid\n }\n function handleChange(e: Event): void {\n const target = e.target as HTMLInputElement;\n files = target.files as FileList;\n displayfileslist = true;\n const invalidFiles: Array = [];\n const fileList = [...files];\n fileList.forEach((file, index) => {\n const fileName = file.name;\n const fileSize = file.size;\n const validExtension = checkFileExtension(fileName);\n const validSize = checkFileSize(fileSize);\n let errorType = '';\n\n if (!validExtension) {\n errorType = 'invalid-extension';\n }\n\n if (!validSize) {\n errorType = 'invalid-size';\n }\n\n if (!validExtension || !validSize) {\n invalidFiles.push({\n index: index,\n fileName: fileName,\n fileSize: fileSize,\n errorType: errorType,\n });\n }\n });\n\n if (invalidFiles.length > 0) {\n eventHandler.dispatch('invalid-files', invalidFiles);\n }\n eventHandler.dispatch('change', files);\n if (stateless) {\n const fileuploader = root.querySelector(\n '.mc-fileuploader__input',\n ) as HTMLInputElement;\n fileuploader.value = '';\n }\n }\n\n function removeFromArray(fileList: FileList, value: File): FileList {\n const array = Array.from(fileList);\n const idx = array.indexOf(value);\n if (idx !== -1) {\n array.splice(idx, 1);\n }\n return array as FileList;\n }\n\n function deleteFile(e: CustomEvent): void {\n files = removeFromArray(files, e.detail);\n const fileuploader = root.querySelector(\n '.mc-fileuploader__input',\n ) as HTMLInputElement;\n fileuploader.value = '';\n eventHandler.dispatch('file-removed', e.detail);\n }\n\n function deleteUploadedFile(e: CustomEvent): void {\n const files = removeFromArray(uploadedFiles, e.detail);\n uploadedFiles = files;\n eventHandler.dispatch('uploaded-file-removed', e.detail);\n }\n\n function hasInvalidFiles(e: CustomEvent): void {\n eventHandler.dispatch('invalid-files', e.detail);\n }\n</script>\n\n<div class=\"mc-fileuploader\" bind:this={root}>\n <input\n {id}\n type=\"file\"\n class=\"mc-fileuploader__input\"\n {accept}\n {multiple}\n {disabled}\n on:change={handleChange}\n />\n <label for={id} class=\"mc-fileuploader__label\">\n <span class=\"mc-fileuploader__label--center\">\n {label}\n </span>\n </label>\n {#if displayfileslist && files && files.length > 0}\n <ResultFile\n {files}\n {allowedExtensions}\n {disabled}\n {maxSize}\n {removelabel}\n {errorLabels}\n on:file-removed={deleteFile}\n />\n {/if}\n {#if uploadedFiles.length > 0}\n <ResultFile\n files={uploadedFiles}\n {allowedExtensions}\n {disabled}\n {maxSize}\n {removelabel}\n {errorLabels}\n on:file-removed={deleteUploadedFile}\n />\n {/if}\n</div>\n\n<style lang=\"scss\">\n @import '@mozaic-ds/styles/settings-tools/all-settings';\n @import '@mozaic-ds/styles/components/c.file-uploader';\n</style>\n"],"names":["ctx","if_block0","length","create_if_block_1","create_if_block","insert","target","div","anchor","append","input","label_1","span","removeFromArray","fileList","value","array","Array","from","idx","indexOf","splice","files","root","id","$$props","label","accept","multiple","allowedextensions","maxsize","displayfileslist","disabled","removelabel","uploadedfiles","errorlabels","stateless","eventHandler","EventHandler","$$invalidate","allowedExtensions","JSON","parse","uploadedFiles","maxSize","undefined","errorLabels","e","invalidFiles","forEach","file","index","fileName","name","fileSize","size","validExtension","extension","slice","lastIndexOf","includes","String","checkFileExtension","validSize","checkFileSize","errorType","push","dispatch","querySelector","detail","$$value"],"mappings":"icA8JuBA,EAAU,sXAKpBA,EAAa,kHAMHA,EAAkB,oFAN5BA,EAAa,qRAbnBC,EAAAD,MAAoBA,EAAK,IAAIA,EAAM,GAAAE,OAAS,GAACC,EAAAH,KAW7CA,EAAa,GAACE,OAAS,GAACE,EAAAJ,yEAdxBA,EAAK,8NAFEA,EAAE,iFAVhBK,EAqCKC,EAAAC,EAAAC,GApCHC,EAQCF,EAAAG,UACDD,EAIOF,EAAAI,GAHLF,EAEME,EAAAC,uFALKZ,EAAY,wJAIpBA,EAAK,yBAFEA,EAAE,IAKTA,MAAoBA,EAAK,IAAIA,EAAM,GAAAE,OAAS,iGAW5CF,EAAa,GAACE,OAAS,mNAvDnBW,EAAgBC,EAAoBC,GACrC,MAAAC,EAAQC,MAAMC,KAAKJ,GACnBK,EAAMH,EAAMI,QAAQL,UACb,IAATI,GACFH,EAAMK,OAAOF,EAAK,GAEbH,gCA5FLM,EACAC,MAdOC,GAAUC,SACVC,GAAaD,UACbE,GAAcF,GACdG,SAAAA,GAAW,GAAIH,qBACfI,GAAyBJ,WACzBK,GAAeL,GACfM,iBAAAA,GAAmB,GAAKN,GACxBO,SAAAA,GAAW,GAAKP,GAChBQ,YAAAA,EAAc,UAAQR,iBACtBS,GAAqBT,eACrBU,GAAmBV,aACnBW,GAAgBX,EAIvBY,MAAmBC,wfAEtBC,EAAA,GAAEC,EAAoBX,EAAoBY,KAAKC,MAAMb,GAAiB,uBACtEU,EAAA,EAAEI,EAAgBT,EAAgB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