siam-ui-utils 3.1.4 → 3.2.0
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/dist/CustomBootstrap.js +9 -2
- package/dist/CustomBootstrap.js.map +1 -1
- package/dist/copy-link/index.js +3 -3
- package/dist/copy-link/index.js.map +1 -1
- package/dist/custom-input/CustomInputCheckbox.js +30 -12
- package/dist/custom-input/CustomInputCheckbox.js.map +1 -1
- package/dist/custom-input/CustomInputCurrency.js +1 -1
- package/dist/custom-input/CustomInputCurrency.js.map +1 -1
- package/dist/custom-input/CustomInputFile.js +28 -19
- package/dist/custom-input/CustomInputFile.js.map +1 -1
- package/dist/custom-input/CustomInputRadio.js +31 -47
- package/dist/custom-input/CustomInputRadio.js.map +1 -1
- package/dist/custom-input/index.css +25 -167
- package/dist/drag-and-dropzone/config.js +52 -51
- package/dist/drag-and-dropzone/config.js.map +1 -1
- package/dist/drag-and-dropzone/index.css +271 -276
- package/dist/drag-and-dropzone/index.js +30 -16
- package/dist/drag-and-dropzone/index.js.map +1 -1
- package/dist/dropzone-uploader/styled/index.css +165 -348
- package/dist/dropzone-uploader/styled/index.js +71 -60
- package/dist/dropzone-uploader/styled/index.js.map +1 -1
- package/dist/react-notifications/NotificationManager.js +14 -0
- package/dist/react-notifications/NotificationManager.js.map +1 -0
- package/dist/react-notifications/index.js +2 -1
- package/dist/react-notifications/index.js.map +1 -1
- package/dist/select/custom-select/index.js +53 -1
- package/dist/select/custom-select/index.js.map +1 -1
- package/dist/select/multi-select/index.js +6 -3
- package/dist/select/multi-select/index.js.map +1 -1
- package/dist/select/multi-select/styled-component.js +1 -1
- package/dist/select/multi-select/styled-component.js.map +1 -1
- package/dist/tomar-foto/index.js +1 -1
- package/dist/tomar-foto/index.js.map +1 -1
- package/package.json +5 -4
- package/dist/_virtual/_commonjsHelpers.js +0 -7
- package/dist/_virtual/_commonjsHelpers.js.map +0 -1
- package/dist/_virtual/index.js +0 -8
- package/dist/_virtual/index.js.map +0 -1
- package/dist/_virtual/index2.js +0 -5
- package/dist/_virtual/index2.js.map +0 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Badge.js +0 -77
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Badge.js.map +0 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Button.js +0 -111
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Button.js.map +0 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/CloseButton.js +0 -106
- package/dist/node_modules/@neolution-ch/reactstrap/esm/CloseButton.js.map +0 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Col.js +0 -125
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Col.js.map +0 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/FormGroup.js +0 -75
- package/dist/node_modules/@neolution-ch/reactstrap/esm/FormGroup.js.map +0 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Input.js +0 -225
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Input.js.map +0 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Label.js +0 -122
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Label.js.map +0 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Row.js +0 -83
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Row.js.map +0 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/utils.js +0 -68
- package/dist/node_modules/@neolution-ch/reactstrap/esm/utils.js.map +0 -1
- package/dist/node_modules/classnames/index.js +0 -62
- package/dist/node_modules/classnames/index.js.map +0 -1
|
@@ -1,348 +1,165 @@
|
|
|
1
|
-
.dzu-dropzone {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
align-items: center;
|
|
5
|
-
width: 100%;
|
|
6
|
-
min-height: 120px;
|
|
7
|
-
overflow: scroll;
|
|
8
|
-
margin: 0 auto;
|
|
9
|
-
position: relative;
|
|
10
|
-
box-sizing: border-box;
|
|
11
|
-
transition: all .15s linear;
|
|
12
|
-
border: 2px solid #
|
|
13
|
-
border-radius: 4px;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.dzu-dropzoneActive {
|
|
17
|
-
background-color: #
|
|
18
|
-
border-color: #
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.dzu-dropzoneDisabled {
|
|
22
|
-
opacity: 0.5;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.dzu-dropzoneDisabled *:hover {
|
|
26
|
-
cursor: unset;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.dzu-input {
|
|
30
|
-
display: none;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.dzu-inputLabel {
|
|
34
|
-
display: flex;
|
|
35
|
-
justify-content: center;
|
|
36
|
-
align-items: center;
|
|
37
|
-
position: absolute;
|
|
38
|
-
top: 0;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
width:
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
background-color: #
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
overflow:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
display: flex;
|
|
167
|
-
flex-direction: row;
|
|
168
|
-
align-items: center;
|
|
169
|
-
justify-content: space-between;
|
|
170
|
-
position: relative;
|
|
171
|
-
width: 100px;
|
|
172
|
-
min-height: 60px;
|
|
173
|
-
z-index: 1;
|
|
174
|
-
border-bottom: 1px solid #ececec;
|
|
175
|
-
box-sizing: border-box;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.dropzone-upload-previewImage {
|
|
179
|
-
width: 60rem;
|
|
180
|
-
max-height: 60px;
|
|
181
|
-
max-width: 10rem;
|
|
182
|
-
border-radius: 4px;
|
|
183
|
-
padding-right: 1rem;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.dropzone-upload-delete-btn {
|
|
187
|
-
width: 2rem;
|
|
188
|
-
line-height: 1.5;
|
|
189
|
-
border: 0;
|
|
190
|
-
color: #ff0000;
|
|
191
|
-
background-color: #f8f8f8;
|
|
192
|
-
padding-right: 1rem;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.dropzone-upload-file-name-container {
|
|
196
|
-
position: relative;
|
|
197
|
-
display: inline-block;
|
|
198
|
-
max-width: 150px; /* Ajusta este valor para aumentar el ancho */
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
.dropzone-upload-file-name {
|
|
202
|
-
padding-right: 1rem;
|
|
203
|
-
white-space: nowrap;
|
|
204
|
-
overflow: hidden;
|
|
205
|
-
text-overflow: ellipsis;
|
|
206
|
-
max-width: 150px; /* Ajusta este valor para aumentar el ancho */
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
.dzu-dropzone {
|
|
210
|
-
display: flex;
|
|
211
|
-
flex-direction: column;
|
|
212
|
-
align-items: center;
|
|
213
|
-
width: 100%;
|
|
214
|
-
min-height: 120px;
|
|
215
|
-
overflow: scroll;
|
|
216
|
-
margin: 0 auto;
|
|
217
|
-
position: relative;
|
|
218
|
-
box-sizing: border-box;
|
|
219
|
-
transition: all 0.15s linear;
|
|
220
|
-
border: 2px solid #d9d9d9;
|
|
221
|
-
border-radius: 4px;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.dzu-dropzoneActive {
|
|
225
|
-
background-color: #deebff;
|
|
226
|
-
border-color: #2484ff;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
.dzu-dropzoneDisabled {
|
|
230
|
-
opacity: 0.5;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
.dzu-dropzoneDisabled *:hover {
|
|
234
|
-
cursor: unset;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
.dzu-input {
|
|
238
|
-
display: none;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
.dzu-inputLabel {
|
|
242
|
-
display: flex;
|
|
243
|
-
justify-content: center;
|
|
244
|
-
align-items: center;
|
|
245
|
-
position: absolute;
|
|
246
|
-
top: 0;
|
|
247
|
-
bottom: 0;
|
|
248
|
-
left: 0;
|
|
249
|
-
right: 0;
|
|
250
|
-
font-family: 'Helvetica', sans-serif;
|
|
251
|
-
font-size: 20px;
|
|
252
|
-
font-weight: 600;
|
|
253
|
-
color: #2484ff;
|
|
254
|
-
-moz-osx-font-smoothing: grayscale;
|
|
255
|
-
-webkit-font-smoothing: antialiased;
|
|
256
|
-
cursor: pointer;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
.dzu-inputLabelWithFiles {
|
|
260
|
-
display: flex;
|
|
261
|
-
justify-content: center;
|
|
262
|
-
align-items: center;
|
|
263
|
-
align-self: flex-start;
|
|
264
|
-
padding: 0 14px;
|
|
265
|
-
min-height: 32px;
|
|
266
|
-
background-color: #e6e6e6;
|
|
267
|
-
color: #2484ff;
|
|
268
|
-
border: none;
|
|
269
|
-
font-family: 'Helvetica', sans-serif;
|
|
270
|
-
border-radius: 4px;
|
|
271
|
-
font-size: 14px;
|
|
272
|
-
font-weight: 600;
|
|
273
|
-
margin-top: 20px;
|
|
274
|
-
margin-left: 3%;
|
|
275
|
-
-moz-osx-font-smoothing: grayscale;
|
|
276
|
-
-webkit-font-smoothing: antialiased;
|
|
277
|
-
cursor: pointer;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
.dzu-previewContainer {
|
|
281
|
-
padding: 40px 3%;
|
|
282
|
-
display: flex;
|
|
283
|
-
flex-direction: row;
|
|
284
|
-
align-items: center;
|
|
285
|
-
justify-content: space-between;
|
|
286
|
-
position: relative;
|
|
287
|
-
width: 100%;
|
|
288
|
-
min-height: 60px;
|
|
289
|
-
z-index: 1;
|
|
290
|
-
border-bottom: 1px solid #ececec;
|
|
291
|
-
box-sizing: border-box;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
.dzu-previewStatusContainer {
|
|
295
|
-
display: flex;
|
|
296
|
-
align-items: center;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
.dzu-previewFileName {
|
|
300
|
-
font-family: 'Helvetica', sans-serif;
|
|
301
|
-
font-size: 14px;
|
|
302
|
-
font-weight: 400;
|
|
303
|
-
color: #333333;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
.dzu-previewImage {
|
|
307
|
-
width: auto;
|
|
308
|
-
max-height: 40px;
|
|
309
|
-
max-width: 140px;
|
|
310
|
-
border-radius: 4px;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
.dzu-previewButton {
|
|
314
|
-
background-size: 14px 14px;
|
|
315
|
-
background-position: center;
|
|
316
|
-
background-repeat: no-repeat;
|
|
317
|
-
width: 14px;
|
|
318
|
-
height: 14px;
|
|
319
|
-
cursor: pointer;
|
|
320
|
-
opacity: 0.9;
|
|
321
|
-
margin: 0 0 2px 10px;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
.dzu-submitButtonContainer {
|
|
325
|
-
margin: 24px 0;
|
|
326
|
-
z-index: 1;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
.dzu-submitButton {
|
|
330
|
-
padding: 0 14px;
|
|
331
|
-
min-height: 32px;
|
|
332
|
-
background-color: #2484ff;
|
|
333
|
-
border: none;
|
|
334
|
-
border-radius: 4px;
|
|
335
|
-
font-family: 'Helvetica', sans-serif;
|
|
336
|
-
font-size: 14px;
|
|
337
|
-
font-weight: 600;
|
|
338
|
-
color: #fff;
|
|
339
|
-
-moz-osx-font-smoothing: grayscale;
|
|
340
|
-
-webkit-font-smoothing: antialiased;
|
|
341
|
-
cursor: pointer;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
.dzu-submitButton:disabled {
|
|
345
|
-
background-color: #e6e6e6;
|
|
346
|
-
color: #333333;
|
|
347
|
-
cursor: unset;
|
|
348
|
-
}
|
|
1
|
+
.dzu-dropzone {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
align-items: center;
|
|
5
|
+
width: 100%;
|
|
6
|
+
min-height: 120px;
|
|
7
|
+
overflow: scroll;
|
|
8
|
+
margin: 0 auto;
|
|
9
|
+
position: relative;
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
transition: all 0.15s linear;
|
|
12
|
+
border: 2px solid var(--dropzone-border, #D6D6D6);
|
|
13
|
+
border-radius: 4px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.dzu-dropzoneActive {
|
|
17
|
+
background-color: var(--dropzone-active-bg, #E6F1F1);
|
|
18
|
+
border-color: var(--dropzone-primary, #016E6C);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.dzu-dropzoneDisabled {
|
|
22
|
+
opacity: 0.5;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.dzu-dropzoneDisabled *:hover {
|
|
26
|
+
cursor: unset;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.dzu-input {
|
|
30
|
+
display: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.dzu-inputLabel {
|
|
34
|
+
display: flex;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
align-items: center;
|
|
37
|
+
position: absolute;
|
|
38
|
+
top: 0; bottom: 0; left: 0; right: 0;
|
|
39
|
+
font-size: 20px;
|
|
40
|
+
font-weight: 600;
|
|
41
|
+
color: var(--dropzone-primary, #016E6C);
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.dzu-inputLabelWithFiles {
|
|
46
|
+
display: flex;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
align-items: center;
|
|
49
|
+
align-self: flex-start;
|
|
50
|
+
padding: 0 14px;
|
|
51
|
+
min-height: 32px;
|
|
52
|
+
background-color: #E6E6E6;
|
|
53
|
+
color: var(--dropzone-primary, #016E6C);
|
|
54
|
+
border: none;
|
|
55
|
+
border-radius: 4px;
|
|
56
|
+
font-size: 14px;
|
|
57
|
+
font-weight: 600;
|
|
58
|
+
margin-top: 20px;
|
|
59
|
+
margin-left: 3%;
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.dzu-previewContainer {
|
|
64
|
+
padding: 40px 3%;
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-direction: row;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: space-between;
|
|
69
|
+
position: relative;
|
|
70
|
+
width: 100%;
|
|
71
|
+
min-height: 60px;
|
|
72
|
+
z-index: 1;
|
|
73
|
+
border-bottom: 1px solid #ECECEC;
|
|
74
|
+
box-sizing: border-box;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.dzu-previewStatusContainer {
|
|
78
|
+
display: flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.dzu-previewFileName {
|
|
83
|
+
font-size: 14px;
|
|
84
|
+
font-weight: 400;
|
|
85
|
+
color: #333333;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.dzu-previewImage {
|
|
89
|
+
width: auto;
|
|
90
|
+
max-height: 40px;
|
|
91
|
+
max-width: 140px;
|
|
92
|
+
border-radius: 4px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.dzu-previewButton {
|
|
96
|
+
background-size: 14px 14px;
|
|
97
|
+
background-position: center;
|
|
98
|
+
background-repeat: no-repeat;
|
|
99
|
+
width: 14px;
|
|
100
|
+
height: 14px;
|
|
101
|
+
cursor: pointer;
|
|
102
|
+
opacity: 0.9;
|
|
103
|
+
margin: 0 0 2px 10px;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.dzu-submitButtonContainer {
|
|
107
|
+
margin: 24px 0;
|
|
108
|
+
z-index: 1;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.dzu-submitButton {
|
|
112
|
+
padding: 0 14px;
|
|
113
|
+
min-height: 32px;
|
|
114
|
+
background-color: var(--dropzone-primary, #016E6C);
|
|
115
|
+
border: none;
|
|
116
|
+
border-radius: 4px;
|
|
117
|
+
font-size: 14px;
|
|
118
|
+
font-weight: 600;
|
|
119
|
+
color: #FFF;
|
|
120
|
+
cursor: pointer;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.dzu-submitButton:disabled {
|
|
124
|
+
background-color: #E6E6E6;
|
|
125
|
+
color: #333333;
|
|
126
|
+
cursor: unset;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.dropzone-upload-frame {
|
|
130
|
+
border: 0 !important;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.dropzone-upload-previewContainer {
|
|
134
|
+
display: flex;
|
|
135
|
+
flex-direction: row;
|
|
136
|
+
align-items: center;
|
|
137
|
+
justify-content: space-between;
|
|
138
|
+
position: relative;
|
|
139
|
+
width: 100px;
|
|
140
|
+
min-height: 60px;
|
|
141
|
+
z-index: 1;
|
|
142
|
+
border-bottom: 1px solid #ECECEC;
|
|
143
|
+
box-sizing: border-box;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.dropzone-upload-previewImage {
|
|
147
|
+
max-height: 60px;
|
|
148
|
+
max-width: 10rem;
|
|
149
|
+
border-radius: 4px;
|
|
150
|
+
padding-right: 1rem;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.dropzone-upload-file-name-container {
|
|
154
|
+
position: relative;
|
|
155
|
+
display: inline-block;
|
|
156
|
+
max-width: 150px;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.dropzone-upload-file-name {
|
|
160
|
+
padding-right: 1rem;
|
|
161
|
+
white-space: nowrap;
|
|
162
|
+
overflow: hidden;
|
|
163
|
+
text-overflow: ellipsis;
|
|
164
|
+
max-width: 150px;
|
|
165
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { getDroppedOrSelectedFiles } from "html5-file-selector";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import
|
|
3
|
+
import { useState, useRef } from "react";
|
|
4
|
+
import { useTheme } from "styled-components";
|
|
5
|
+
import { Button } from "siam-ui";
|
|
5
6
|
import { Dropzone } from "../../dropzone/index.js";
|
|
6
7
|
import "./index.css";
|
|
7
8
|
import { IconButtonSvg as _t } from "../../iconos/icon-button-svg.js";
|
|
@@ -18,19 +19,18 @@ const DropzoneUploaderStyled = ({
|
|
|
18
19
|
alert("El archivo supera el tamaño máximo");
|
|
19
20
|
}
|
|
20
21
|
}) => {
|
|
22
|
+
const theme = useTheme();
|
|
23
|
+
const primaryColor = theme?.colors?.primary?.base ?? "#016E6C";
|
|
24
|
+
const borderColor = theme?.colors?.neutral?.borderLight ?? "#D6D6D6";
|
|
25
|
+
const surfaceHover = theme?.colors?.primary?.surfaceHover ?? "#E6F1F1";
|
|
21
26
|
const [files, setFiles] = useState([]);
|
|
22
27
|
const handleChangeStatus = ({ file }, status) => {
|
|
23
28
|
if (status === "done") {
|
|
24
|
-
const filesTemp = files;
|
|
25
|
-
filesTemp.push(file);
|
|
29
|
+
const filesTemp = [...files, file];
|
|
26
30
|
setFiles(filesTemp);
|
|
27
31
|
onChangeFiles(filesTemp);
|
|
28
32
|
} else if (status === "removed") {
|
|
29
|
-
const filesTemp = files;
|
|
30
|
-
const index = filesTemp.indexOf(file);
|
|
31
|
-
if (index > -1) {
|
|
32
|
-
filesTemp.splice(index, 1);
|
|
33
|
-
}
|
|
33
|
+
const filesTemp = files.filter((f) => f !== file);
|
|
34
34
|
setFiles(filesTemp);
|
|
35
35
|
onChangeFiles(filesTemp);
|
|
36
36
|
}
|
|
@@ -74,74 +74,85 @@ const DropzoneUploaderStyled = ({
|
|
|
74
74
|
className: "dropzone-upload-previewImage mt-1",
|
|
75
75
|
src: meta.previewUrl,
|
|
76
76
|
alt: meta.name,
|
|
77
|
-
style: {
|
|
78
|
-
width: "110px",
|
|
79
|
-
height: "110px",
|
|
80
|
-
objectFit: "cover",
|
|
81
|
-
marginRight: "0.5rem"
|
|
82
|
-
}
|
|
77
|
+
style: { width: "110px", height: "110px", objectFit: "cover", marginRight: "0.5rem" }
|
|
83
78
|
}
|
|
84
79
|
),
|
|
85
80
|
/* @__PURE__ */ jsx("div", { className: "dropzone-upload-file-name-container", children: /* @__PURE__ */ jsx("p", { className: "dropzone-upload-file-name", title: meta.name, children: meta.name }) })
|
|
86
81
|
] }),
|
|
87
82
|
/* @__PURE__ */ jsx(
|
|
88
|
-
|
|
83
|
+
Button,
|
|
89
84
|
{
|
|
90
|
-
|
|
85
|
+
$variant: "transparent",
|
|
86
|
+
$size: "small",
|
|
91
87
|
onClick: remove,
|
|
92
|
-
|
|
88
|
+
style: { color: theme?.colors?.error?.base ?? "#FE4727", padding: "0 4px" },
|
|
89
|
+
children: /* @__PURE__ */ jsx(TrashIcon, { color: theme?.colors?.error?.base ?? "#FE4727" })
|
|
93
90
|
}
|
|
94
91
|
)
|
|
95
92
|
]
|
|
96
93
|
}
|
|
97
94
|
);
|
|
98
95
|
};
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
]
|
|
127
|
-
}
|
|
128
|
-
) });
|
|
96
|
+
const fileInputRef = useRef(null);
|
|
97
|
+
const InputComponent = ({ accept: accept2, onFiles, getFilesFromEvent: getFilesFromEvent2 }) => {
|
|
98
|
+
const text = totalFiles > 0 ? `${maxFiles - totalFiles} archivos más` : label;
|
|
99
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
100
|
+
/* @__PURE__ */ jsx(
|
|
101
|
+
Button,
|
|
102
|
+
{
|
|
103
|
+
$variant: "outline",
|
|
104
|
+
style: { width: "100%" },
|
|
105
|
+
onClick: () => fileInputRef.current?.click(),
|
|
106
|
+
children: text
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
/* @__PURE__ */ jsx(
|
|
110
|
+
"input",
|
|
111
|
+
{
|
|
112
|
+
ref: fileInputRef,
|
|
113
|
+
style: { display: "none" },
|
|
114
|
+
type: "file",
|
|
115
|
+
accept: accept2,
|
|
116
|
+
multiple: true,
|
|
117
|
+
onChange: (e) => {
|
|
118
|
+
getFilesFromEvent2(e).then((chosenFiles) => onFiles(chosenFiles));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
] });
|
|
129
123
|
};
|
|
130
|
-
return /* @__PURE__ */ jsx(
|
|
131
|
-
|
|
124
|
+
return /* @__PURE__ */ jsx(
|
|
125
|
+
"div",
|
|
132
126
|
{
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
127
|
+
className: classNames,
|
|
128
|
+
style: {
|
|
129
|
+
"--dropzone-primary": primaryColor,
|
|
130
|
+
"--dropzone-border": borderColor,
|
|
131
|
+
"--dropzone-active-bg": surfaceHover
|
|
132
|
+
},
|
|
133
|
+
children: /* @__PURE__ */ jsx(
|
|
134
|
+
Dropzone,
|
|
135
|
+
{
|
|
136
|
+
disableUpload: false,
|
|
137
|
+
maxFiles: totalFiles < maxFiles ? maxFiles : 0,
|
|
138
|
+
maxSize,
|
|
139
|
+
InputComponent,
|
|
140
|
+
PreviewComponent: CustomPreview,
|
|
141
|
+
classNames: { dropzone: "dropzone-upload-frame" },
|
|
142
|
+
onChangeStatus: handleChangeStatus,
|
|
143
|
+
getFilesFromEvent,
|
|
144
|
+
accept
|
|
145
|
+
}
|
|
146
|
+
)
|
|
142
147
|
}
|
|
143
|
-
)
|
|
148
|
+
);
|
|
144
149
|
};
|
|
150
|
+
const TrashIcon = ({ color }) => /* @__PURE__ */ jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
151
|
+
/* @__PURE__ */ jsx("polyline", { points: "3 6 5 6 21 6" }),
|
|
152
|
+
/* @__PURE__ */ jsx("path", { d: "M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6" }),
|
|
153
|
+
/* @__PURE__ */ jsx("path", { d: "M10 11v6M14 11v6" }),
|
|
154
|
+
/* @__PURE__ */ jsx("path", { d: "M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2" })
|
|
155
|
+
] });
|
|
145
156
|
export {
|
|
146
157
|
DropzoneUploaderStyled
|
|
147
158
|
};
|