grav-svelte 0.0.93 → 0.0.97
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/Alerts/alertStyles.css +12 -0
- package/dist/CRUD/CrudFilters.css +193 -156
- package/dist/CRUD/CrudFilters.svelte +1 -1
- package/dist/CRUD/CrudWrapper.svelte +3 -0
- package/dist/CRUD/PaginationCRUD.css +3 -0
- package/dist/Inputs/InputFormBool.svelte +3 -0
- package/dist/Inputs/InputFormImage.svelte +6 -0
- package/dist/Modals/Grav_Modal.css +145 -133
- package/dist/Modals/Grav_Modal.svelte +145 -149
- package/package.json +1 -1
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
.alert-confirm-button {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
2
5
|
background-color: #10b981;
|
|
3
6
|
color: white;
|
|
4
7
|
font-weight: bold;
|
|
5
8
|
text-transform: uppercase;
|
|
6
9
|
font-size: 0.875rem;
|
|
7
10
|
padding: 0.75rem 1.5rem;
|
|
11
|
+
border: none;
|
|
8
12
|
border-radius: 0.25rem;
|
|
9
13
|
cursor: pointer;
|
|
10
14
|
transition: all 150ms ease-in-out;
|
|
@@ -18,12 +22,16 @@
|
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
.alert-cancel-button {
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
21
28
|
color: #EF4444;
|
|
22
29
|
background: transparent;
|
|
23
30
|
font-weight: bold;
|
|
24
31
|
text-transform: uppercase;
|
|
25
32
|
padding: 0.5rem 1.5rem;
|
|
26
33
|
font-size: 0.875rem;
|
|
34
|
+
border: none;
|
|
27
35
|
cursor: pointer;
|
|
28
36
|
transition: all 150ms ease-in-out;
|
|
29
37
|
}
|
|
@@ -33,6 +41,9 @@
|
|
|
33
41
|
}
|
|
34
42
|
|
|
35
43
|
.alert-error-button {
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
36
47
|
color: #EF4444;
|
|
37
48
|
background: transparent;
|
|
38
49
|
font-weight: bold;
|
|
@@ -40,6 +51,7 @@
|
|
|
40
51
|
cursor: pointer;
|
|
41
52
|
padding: 0.5rem 1.5rem;
|
|
42
53
|
font-size: 1rem;
|
|
54
|
+
border: none;
|
|
43
55
|
transition: all 150ms ease-in-out;
|
|
44
56
|
}
|
|
45
57
|
|
|
@@ -1,258 +1,295 @@
|
|
|
1
1
|
.crud-filters-container {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
border-radius: 0.5rem;
|
|
3
|
+
background-color: var(--grav-crud-color-bg);
|
|
4
|
+
width: fit-content;
|
|
5
|
+
padding: 0.5rem;
|
|
6
|
+
box-shadow: var(--grav-crud-box-shadow);
|
|
7
|
+
margin-bottom: 0.5rem;
|
|
8
|
+
padding-top: 0.7rem;
|
|
9
|
+
width: 100%;
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
@media (min-width: 640px) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
.crud-filters-container {
|
|
14
|
+
margin-bottom: 0.5rem;
|
|
15
|
+
margin-top: 0.25rem;
|
|
16
|
+
width: fit-content;
|
|
17
|
+
}
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
.filters-core {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
display: flex;
|
|
22
|
+
gap: 0.75rem;
|
|
23
|
+
padding: 0.5rem;
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
@media (max-width: 640px) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
.filters-core {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
gap: 0.75rem;
|
|
31
|
+
padding: 0;
|
|
32
|
+
}
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
.filters-header {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
gap: 0.75rem;
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
.filters-title {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
font-family: var(--grav-crud-title-font-family, "mundial", sans-serif);
|
|
43
|
+
font-weight: var(--grav-crud-title-font-weight, 700);
|
|
44
|
+
font-size: var(--grav-crud-title-font-size, 1.5rem);
|
|
45
|
+
line-height: var(--grav-crud-title-line-height, 1.25);
|
|
46
|
+
white-space: nowrap;
|
|
47
|
+
max-width: 100%;
|
|
48
|
+
color: var(--grav-crud-color-neutral);
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
.filters-actions {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
gap: 0.5rem;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.filters-controls .filters-actions {
|
|
58
|
+
justify-content: center;
|
|
59
|
+
margin-top: 0.5rem;
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
@media (min-width: 640px) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
.filters-controls .filters-actions {
|
|
64
|
+
margin-top: 0;
|
|
65
|
+
}
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
.filters-controls {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
|
|
72
|
+
margin-top: 0.5rem;
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
@media (min-width: 640px) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
.filters-controls {
|
|
77
|
+
margin-top: 0;
|
|
78
|
+
}
|
|
79
|
+
.filters-actions {
|
|
80
|
+
margin-right: 0.5rem;
|
|
81
|
+
}
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
.tooltip-container {
|
|
84
|
-
|
|
85
|
+
position: relative;
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
.tooltip {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
89
|
+
position: absolute;
|
|
90
|
+
z-index: 10000;
|
|
91
|
+
padding: 0.25rem;
|
|
92
|
+
color: white;
|
|
93
|
+
font-size: 0.75rem;
|
|
94
|
+
background-color: var(--grav-crud-color-icon-hover);
|
|
95
|
+
border-radius: var(--grav-crud-tooltip-border-radius, 0.25rem);
|
|
96
|
+
top: -1.25rem;
|
|
97
|
+
left: -2.5rem;
|
|
98
|
+
pointer-events: none;
|
|
98
99
|
}
|
|
99
100
|
|
|
100
101
|
.action-button {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
102
|
+
display: flex;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
align-items: center;
|
|
105
|
+
cursor: pointer;
|
|
106
|
+
border-width: var(--grav-crud-filter-border-width, 1.5px);
|
|
107
|
+
border-style: solid;
|
|
108
|
+
border-color: var(--grav-crud-color-neutral);
|
|
109
|
+
color: var(--grav-crud-color-neutral);
|
|
110
|
+
width: 3rem;
|
|
111
|
+
height: 2.5rem;
|
|
112
|
+
border-radius: var(--grav-crud-filter-border-radius, 0.5rem);
|
|
112
113
|
}
|
|
113
114
|
|
|
114
115
|
.filter-group {
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
display: inline-flex;
|
|
117
|
+
gap: 0.5rem;
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
@media (min-width: 640px) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
121
|
+
.filter-group {
|
|
122
|
+
padding: 0;
|
|
123
|
+
gap: 0.5rem;
|
|
124
|
+
margin-right: 0.5rem;
|
|
125
|
+
}
|
|
125
126
|
}
|
|
126
127
|
|
|
127
128
|
.filter-button {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
129
|
+
display: inline-flex;
|
|
130
|
+
align-items: center;
|
|
131
|
+
justify-content: center;
|
|
132
|
+
cursor: pointer;
|
|
133
|
+
height: 2.5rem;
|
|
134
|
+
font-family: var(--grav-crud-button-font-family, "mundial", sans-serif);
|
|
135
|
+
font-size: 1.1rem;
|
|
136
|
+
font-weight: var(--grav-crud-button-font-weight, 500);
|
|
137
|
+
line-height: var(--grav-crud-button-line-height, 1.5);
|
|
138
|
+
border-width: var(--grav-crud-filter-border-width, 1.5px);
|
|
139
|
+
border-style: solid;
|
|
140
|
+
border-color: var(--grav-crud-color-neutral);
|
|
141
|
+
color: var(--grav-crud-color-neutral);
|
|
142
|
+
border-radius: var(--grav-crud-filter-border-radius, 0.5rem);
|
|
143
|
+
padding: 0.75rem 1rem;
|
|
143
144
|
}
|
|
144
145
|
|
|
145
146
|
@media (min-width: 640px) {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
.filter-button {
|
|
148
|
+
padding: 0.75rem 1rem;
|
|
149
|
+
font-size: 1.2rem;
|
|
150
|
+
}
|
|
150
151
|
}
|
|
151
152
|
|
|
152
153
|
.filter-button-active {
|
|
153
|
-
|
|
154
|
-
|
|
154
|
+
background-color: var(--grav-crud-color-neutral);
|
|
155
|
+
color: var(--grav-crud-color-bg);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.filter-apply-button {
|
|
159
|
+
display: inline-flex;
|
|
160
|
+
align-items: center;
|
|
161
|
+
justify-content: center;
|
|
162
|
+
cursor: pointer;
|
|
163
|
+
height: 2.5rem;
|
|
164
|
+
font-family: var(--grav-crud-button-font-family, "mundial", sans-serif);
|
|
165
|
+
font-size: 1.1rem;
|
|
166
|
+
font-weight: var(--grav-crud-button-font-weight, 500);
|
|
167
|
+
line-height: var(--grav-crud-button-line-height, 1.5);
|
|
168
|
+
border-width: var(--grav-crud-filter-border-width, 1.5px);
|
|
169
|
+
border-style: solid;
|
|
170
|
+
border-radius: var(--grav-crud-filter-border-radius, 0.5rem);
|
|
171
|
+
padding: 0.75rem 1rem;
|
|
172
|
+
background-color: #6b7280;
|
|
173
|
+
color: white;
|
|
174
|
+
border-color: #6b7280;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.filter-apply-button:hover {
|
|
178
|
+
background-color: #4b5563;
|
|
179
|
+
border-color: #4b5563;
|
|
155
180
|
}
|
|
156
181
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
182
|
+
@media (min-width: 640px) {
|
|
183
|
+
.filter-apply-button {
|
|
184
|
+
padding: 0.75rem 1rem;
|
|
185
|
+
font-size: 1.2rem;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/* Botones de acción de filtros (Limpiar, Filtrar) - alineados a la derecha */
|
|
190
|
+
.crud-filters-container > .filters-actions {
|
|
191
|
+
justify-content: flex-end;
|
|
192
|
+
margin-top: 0.5rem;
|
|
161
193
|
}
|
|
162
194
|
|
|
163
195
|
.filter-button-middle {
|
|
164
|
-
|
|
196
|
+
border-radius: 0;
|
|
165
197
|
}
|
|
166
198
|
|
|
167
199
|
.filter-button-right {
|
|
168
|
-
|
|
200
|
+
border-radius: 0 var(--grav-crud-filter-border-radius, 0.5rem)
|
|
201
|
+
var(--grav-crud-filter-border-radius, 0.5rem) 0;
|
|
169
202
|
}
|
|
170
203
|
|
|
171
204
|
.page-size-input {
|
|
172
|
-
|
|
205
|
+
width: 8rem;
|
|
173
206
|
}
|
|
174
207
|
|
|
175
208
|
@media (min-width: 640px) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
209
|
+
.page-size-input {
|
|
210
|
+
width: 4rem;
|
|
211
|
+
}
|
|
179
212
|
}
|
|
180
213
|
|
|
181
214
|
.apply-filter-button {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
215
|
+
display: inline-flex;
|
|
216
|
+
height: 3rem;
|
|
217
|
+
cursor: pointer;
|
|
218
|
+
align-items: center;
|
|
219
|
+
padding: 0.75rem 1rem;
|
|
220
|
+
font-family: var(--grav-crud-button-font-family, "mundial", sans-serif);
|
|
221
|
+
font-size: var(--grav-crud-button-font-size, 0.875rem);
|
|
222
|
+
font-weight: var(--grav-crud-button-font-weight, 500);
|
|
223
|
+
line-height: var(--grav-crud-button-line-height, 1.5);
|
|
224
|
+
border-width: var(--grav-crud-filter-border-width, 1.5px);
|
|
225
|
+
border-style: solid;
|
|
226
|
+
border-color: var(--grav-crud-color-neutral);
|
|
227
|
+
color: var(--grav-crud-color-neutral);
|
|
228
|
+
border-radius: var(--grav-crud-filter-border-radius, 0.5rem);
|
|
196
229
|
}
|
|
197
230
|
|
|
198
231
|
@media (min-width: 640px) {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
232
|
+
.apply-filter-button {
|
|
233
|
+
padding: 0.75rem 1rem;
|
|
234
|
+
font-size: 0.875rem;
|
|
235
|
+
}
|
|
203
236
|
}
|
|
204
237
|
|
|
205
238
|
.filters-grid {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
239
|
+
display: grid;
|
|
240
|
+
grid-template-columns: repeat(1, 1fr);
|
|
241
|
+
gap: 0.2rem;
|
|
209
242
|
}
|
|
210
243
|
|
|
211
244
|
@media (min-width: 640px) {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
245
|
+
.filters-grid {
|
|
246
|
+
grid-template-columns: repeat(var(--grid-columns), 1fr);
|
|
247
|
+
gap: 0.8rem;
|
|
248
|
+
}
|
|
216
249
|
}
|
|
217
250
|
|
|
218
251
|
.filter-item {
|
|
219
|
-
|
|
220
|
-
|
|
252
|
+
position: relative;
|
|
253
|
+
margin: auto 0;
|
|
221
254
|
}
|
|
222
255
|
|
|
223
256
|
.filter-item-number {
|
|
224
|
-
|
|
257
|
+
z-index: 50;
|
|
225
258
|
}
|
|
226
259
|
|
|
227
260
|
.filter-item-datetime {
|
|
228
|
-
|
|
261
|
+
z-index: 50;
|
|
229
262
|
}
|
|
230
263
|
|
|
231
264
|
.filter-item-date {
|
|
232
|
-
|
|
265
|
+
z-index: 50;
|
|
233
266
|
}
|
|
234
267
|
|
|
235
268
|
.filter-item-bool {
|
|
236
|
-
|
|
269
|
+
margin: auto 0;
|
|
237
270
|
}
|
|
238
271
|
|
|
239
272
|
.loading-spinner {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
273
|
+
display: flex;
|
|
274
|
+
justify-content: center;
|
|
275
|
+
align-items: center;
|
|
276
|
+
min-height: 38px;
|
|
244
277
|
}
|
|
245
278
|
|
|
246
279
|
.spinner {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
280
|
+
width: 20px;
|
|
281
|
+
height: 20px;
|
|
282
|
+
border: 2px solid #f3f3f3;
|
|
283
|
+
border-top: 2px solid #3498db;
|
|
284
|
+
border-radius: 50%;
|
|
285
|
+
animation: spin 1s linear infinite;
|
|
253
286
|
}
|
|
254
287
|
|
|
255
288
|
@keyframes spin {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
289
|
+
0% {
|
|
290
|
+
transform: rotate(0deg);
|
|
291
|
+
}
|
|
292
|
+
100% {
|
|
293
|
+
transform: rotate(360deg);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
@@ -152,6 +152,9 @@
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
.load-button {
|
|
155
|
+
display: inline-flex;
|
|
156
|
+
align-items: center;
|
|
157
|
+
justify-content: center;
|
|
155
158
|
padding: 0.5rem 1rem;
|
|
156
159
|
border: var(--grav-crud-input-border-width) solid
|
|
157
160
|
var(--grav-crud-color-neutral);
|
|
@@ -179,6 +182,9 @@
|
|
|
179
182
|
}
|
|
180
183
|
|
|
181
184
|
.remove-button {
|
|
185
|
+
display: inline-flex;
|
|
186
|
+
align-items: center;
|
|
187
|
+
justify-content: center;
|
|
182
188
|
margin-top: 0.5rem;
|
|
183
189
|
padding: 0.5rem 1rem;
|
|
184
190
|
border: var(--grav-crud-input-border-width) solid #dc2626;
|
|
@@ -1,93 +1,96 @@
|
|
|
1
1
|
.modal-overlay {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
overflow-x: hidden;
|
|
3
|
+
overflow-y: auto;
|
|
4
|
+
position: fixed;
|
|
5
|
+
inset: 0;
|
|
6
|
+
z-index: 50;
|
|
7
|
+
outline: none;
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
align-items: center;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.modal-content {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
border: 0;
|
|
15
|
+
position: relative;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
background-color: white;
|
|
19
|
+
outline: none;
|
|
20
|
+
max-height: 90vh;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
border-radius: 1rem;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.modal-content.lg {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
width: 100%;
|
|
27
|
+
min-height: 100vh;
|
|
28
|
+
border-radius: 0;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
.modal-content.md {
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
width: 87.5%;
|
|
33
|
+
min-height: 80vh;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
@media (min-width: 640px) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
.modal-content.md {
|
|
38
|
+
width: 75%;
|
|
39
|
+
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.modal-content.sm {
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
width: 75%;
|
|
44
|
+
min-height: 60vh;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
@media (min-width: 640px) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
.modal-content.sm {
|
|
49
|
+
width: 33.333333%;
|
|
50
|
+
}
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.modal-content.xs {
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
width: 75%;
|
|
55
|
+
min-height: 40vh;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
@media (min-width: 640px) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
.modal-content.xs {
|
|
60
|
+
width: 25%;
|
|
61
|
+
}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
.modal-header {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: flex-start;
|
|
67
|
+
justify-content: space-between;
|
|
68
|
+
padding: 1rem;
|
|
69
|
+
border-bottom: 1px solid #e2e8f0;
|
|
70
|
+
border-top-left-radius: 0.25rem;
|
|
71
|
+
border-top-right-radius: 0.25rem;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
.modal-title {
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
font-size: 1.25rem;
|
|
76
|
+
font-weight: 600;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
.modal-close-button {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
80
|
+
display: inline-flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
justify-content: center;
|
|
83
|
+
padding: 0.25rem;
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
margin-left: auto;
|
|
86
|
+
background: transparent;
|
|
87
|
+
border: 0;
|
|
88
|
+
color: black;
|
|
89
|
+
float: right;
|
|
90
|
+
font-size: 1.5rem;
|
|
91
|
+
line-height: 1;
|
|
92
|
+
font-weight: 600;
|
|
93
|
+
outline: none;
|
|
91
94
|
}
|
|
92
95
|
|
|
93
96
|
.modal-close-button:hover {
|
|
@@ -96,126 +99,135 @@
|
|
|
96
99
|
}
|
|
97
100
|
|
|
98
101
|
.modal-close-icon {
|
|
99
|
-
|
|
100
|
-
|
|
102
|
+
height: 1.5rem;
|
|
103
|
+
width: 1.5rem;
|
|
101
104
|
}
|
|
102
105
|
|
|
103
106
|
.modal-loading {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
position: relative;
|
|
108
|
+
padding: 1.5rem;
|
|
109
|
+
flex: 1;
|
|
110
|
+
display: flex;
|
|
111
|
+
justify-content: center;
|
|
112
|
+
align-items: center;
|
|
110
113
|
}
|
|
111
114
|
|
|
112
115
|
.modal-loading-spinner {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
116
|
+
display: flex;
|
|
117
|
+
justify-content: center;
|
|
118
|
+
font-size: 2.25rem;
|
|
119
|
+
align-items: center;
|
|
117
120
|
}
|
|
118
121
|
|
|
119
122
|
.modal-loading-svg {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
animation: spin 1s linear infinite;
|
|
124
|
+
height: 2rem;
|
|
125
|
+
width: 2rem;
|
|
126
|
+
color: #10b981;
|
|
124
127
|
}
|
|
125
128
|
|
|
126
129
|
.modal-body {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
position: relative;
|
|
131
|
+
padding: 0.5rem;
|
|
132
|
+
flex: 1;
|
|
133
|
+
overflow-y: auto;
|
|
134
|
+
overflow-x: hidden;
|
|
132
135
|
}
|
|
133
136
|
|
|
134
137
|
@media (min-width: 640px) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
+
.modal-body {
|
|
139
|
+
padding: 1rem;
|
|
140
|
+
}
|
|
138
141
|
}
|
|
139
142
|
|
|
140
143
|
.modal-footer {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
144
|
+
display: flex;
|
|
145
|
+
align-items: center;
|
|
146
|
+
justify-content: flex-end;
|
|
147
|
+
padding: 0.75rem;
|
|
148
|
+
gap: 0.75rem;
|
|
149
|
+
border-top: 1px solid #e2e8f0;
|
|
147
150
|
}
|
|
148
151
|
|
|
149
152
|
.modal-save-button {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
153
|
+
display: inline-flex;
|
|
154
|
+
align-items: center;
|
|
155
|
+
justify-content: center;
|
|
156
|
+
background-color: #10b981;
|
|
157
|
+
cursor: pointer;
|
|
158
|
+
color: white;
|
|
159
|
+
font-weight: 700;
|
|
160
|
+
text-transform: uppercase;
|
|
161
|
+
font-size: 0.875rem;
|
|
162
|
+
padding: 0.75rem 1.5rem;
|
|
163
|
+
border: none;
|
|
164
|
+
border-radius: var(--grav-border-radius-md);
|
|
165
|
+
outline: none;
|
|
166
|
+
transition: all 0.15s ease-linear;
|
|
160
167
|
}
|
|
161
168
|
|
|
162
169
|
.modal-save-button:hover {
|
|
163
|
-
|
|
170
|
+
background-color: #059669;
|
|
164
171
|
}
|
|
165
172
|
|
|
166
173
|
.modal-save-button:active {
|
|
167
|
-
|
|
174
|
+
background-color: #059669;
|
|
168
175
|
}
|
|
169
176
|
|
|
170
177
|
.modal-save-button:disabled {
|
|
171
|
-
|
|
172
|
-
|
|
178
|
+
background-color: #6ee7b7;
|
|
179
|
+
cursor: not-allowed;
|
|
173
180
|
}
|
|
174
181
|
|
|
175
182
|
.modal-cancel-button {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
183
|
+
display: inline-flex;
|
|
184
|
+
align-items: center;
|
|
185
|
+
justify-content: center;
|
|
186
|
+
background-color: transparent;
|
|
187
|
+
cursor: pointer;
|
|
188
|
+
color: #ef4444;
|
|
189
|
+
font-weight: 700;
|
|
190
|
+
text-transform: uppercase;
|
|
191
|
+
font-size: 0.875rem;
|
|
192
|
+
padding: 0.75rem 1.5rem;
|
|
193
|
+
border: 1px solid #ef4444;
|
|
194
|
+
border-radius: var(--grav-border-radius-md);
|
|
195
|
+
outline: none;
|
|
196
|
+
transition: all 0.75s ease-linear;
|
|
186
197
|
}
|
|
187
198
|
|
|
188
199
|
.modal-cancel-button:hover {
|
|
189
|
-
|
|
190
|
-
|
|
200
|
+
color: #d13b3b;
|
|
201
|
+
border: 1px solid #d13b3b;
|
|
191
202
|
}
|
|
192
203
|
|
|
193
204
|
.modal-backdrop {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
205
|
+
opacity: 0.25;
|
|
206
|
+
position: fixed;
|
|
207
|
+
inset: 0;
|
|
208
|
+
z-index: 40;
|
|
209
|
+
background-color: black;
|
|
199
210
|
}
|
|
200
211
|
|
|
201
212
|
/* Modal-specific CSS variables for inputs */
|
|
202
213
|
.modal-content {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
214
|
+
/* Override CRUD variables for modal context */
|
|
215
|
+
--grav-crud-color-bg: #ffffff; /* White background for modal inputs */
|
|
216
|
+
--grav-crud-color-button: #fe6b91; /* Pink buttons */
|
|
217
|
+
--grav-crud-color-neutral: #313131; /* Black text for modal inputs */
|
|
218
|
+
--grav-crud-color-light: #f5f5f5; /* Light gray for hover states */
|
|
219
|
+
--grav-crud-color-border: #d1d5db; /* Gray borders */
|
|
220
|
+
--grav-crud-color-tooltip: #374151; /* Darker gray for tooltips */
|
|
221
|
+
--grav-crud-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1),
|
|
222
|
+
0 1px 2px 0 rgba(0, 0, 0, 0.06);
|
|
223
|
+
--grav-crud-input-border-width: 1px; /* Ensure border width is defined */
|
|
212
224
|
}
|
|
213
225
|
|
|
214
226
|
@keyframes spin {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
227
|
+
from {
|
|
228
|
+
transform: rotate(0deg);
|
|
229
|
+
}
|
|
230
|
+
to {
|
|
231
|
+
transform: rotate(360deg);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
@@ -1,170 +1,166 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
2
|
+
import "./Grav_Modal.css";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
// Define size type
|
|
5
|
+
type ModalSize = "lg" | "md" | "sm" | "xs";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
// Props interface
|
|
8
|
+
interface $$Props {
|
|
9
|
+
title?: string;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
onSave?: () => void;
|
|
12
|
+
saveButtonText?: string;
|
|
13
|
+
cancelButtonText?: string;
|
|
14
|
+
saveButtonDisabled?: boolean;
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
size?: ModalSize;
|
|
17
|
+
isVista?: boolean;
|
|
18
|
+
}
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
// Default props
|
|
21
|
+
export let title = "Modal Title";
|
|
22
|
+
export let onClose = () => {};
|
|
23
|
+
export let onSave = () => {};
|
|
24
|
+
export let saveButtonText = "Guardar";
|
|
25
|
+
export let cancelButtonText = "Cancelar";
|
|
26
|
+
export let saveButtonDisabled = false;
|
|
27
|
+
export let loading = false;
|
|
28
|
+
export let size: ModalSize = "lg";
|
|
29
|
+
export let isVista = false;
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
// Size classes mapping
|
|
32
|
+
const sizeClasses: Record<ModalSize, string> = {
|
|
33
|
+
lg: "w-full min-h-screen",
|
|
34
|
+
md: "sm:w-3/4 w-7/8 min-h-[80vh]",
|
|
35
|
+
sm: "sm:w-1/3 w-3/4 min-h-[60vh]",
|
|
36
|
+
xs: "sm:w-1/4 w-3/4 min-h-[40vh]",
|
|
37
|
+
};
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
// Get the current size class
|
|
40
|
+
$: currentSizeClass = sizeClasses[size];
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
// Handle keydown event
|
|
43
|
+
function handleKeydown(event: KeyboardEvent) {
|
|
44
|
+
const target = event.target as HTMLElement;
|
|
45
|
+
const isInputElement = target.tagName === "TEXTAREA";
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
47
|
+
if (
|
|
48
|
+
event.key === "Enter" &&
|
|
49
|
+
!saveButtonDisabled &&
|
|
50
|
+
!loading &&
|
|
51
|
+
!isInputElement
|
|
52
|
+
) {
|
|
53
|
+
event.preventDefault();
|
|
54
|
+
event.stopPropagation();
|
|
55
|
+
onSave();
|
|
56
|
+
} else if (event.key === "Escape") {
|
|
57
|
+
event.preventDefault();
|
|
58
|
+
event.stopPropagation();
|
|
59
|
+
onClose();
|
|
61
60
|
}
|
|
61
|
+
}
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
// Handle click to focus the modal
|
|
64
|
+
function handleClick(event: MouseEvent) {
|
|
65
|
+
const target = event.target as HTMLElement;
|
|
66
|
+
const currentTarget = event.currentTarget as HTMLElement;
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
68
|
+
// Only focus if clicking directly on the modal container
|
|
69
|
+
if (target === currentTarget) {
|
|
70
|
+
target.focus();
|
|
72
71
|
}
|
|
72
|
+
}
|
|
73
73
|
</script>
|
|
74
74
|
|
|
75
75
|
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
|
|
76
76
|
<div
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
class="modal-overlay"
|
|
78
|
+
on:keydown={handleKeydown}
|
|
79
|
+
on:click={handleClick}
|
|
80
|
+
tabindex="0"
|
|
81
81
|
>
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
82
|
+
<!--content-->
|
|
83
|
+
<div class="modal-content {size}">
|
|
84
|
+
<!-- Encabezado Modal -->
|
|
85
|
+
<div class="modal-header">
|
|
86
|
+
<h3 class="modal-title">
|
|
87
|
+
{title}
|
|
88
|
+
</h3>
|
|
89
|
+
<!-- Cerrar Modal -->
|
|
90
|
+
<button class="modal-close-button" on:click={onClose}>
|
|
91
|
+
<svg
|
|
92
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
93
|
+
class="modal-close-icon"
|
|
94
|
+
fill="none"
|
|
95
|
+
viewBox="0 0 24 24"
|
|
96
|
+
stroke="currentColor"
|
|
97
|
+
stroke-width="2"
|
|
98
|
+
>
|
|
99
|
+
<path
|
|
100
|
+
stroke-linecap="round"
|
|
101
|
+
stroke-linejoin="round"
|
|
102
|
+
d="M6 18L18 6M6 6l12 12"
|
|
103
|
+
/>
|
|
104
|
+
</svg>
|
|
105
|
+
</button>
|
|
106
|
+
<!-- /Cerrar Modal -->
|
|
107
|
+
</div>
|
|
108
|
+
<!-- Encabezado Modal -->
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
110
|
+
{#if loading}
|
|
111
|
+
<div class="modal-loading">
|
|
112
|
+
<div class="modal-loading-spinner">
|
|
113
|
+
<svg
|
|
114
|
+
class="modal-loading-svg"
|
|
115
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
116
|
+
fill="none"
|
|
117
|
+
viewBox="0 0 24 24"
|
|
118
|
+
>
|
|
119
|
+
<circle
|
|
120
|
+
class="opacity-25"
|
|
121
|
+
cx="12"
|
|
122
|
+
cy="12"
|
|
123
|
+
r="10"
|
|
124
|
+
stroke="currentColor"
|
|
125
|
+
stroke-width="4"
|
|
126
|
+
/>
|
|
127
|
+
<path
|
|
128
|
+
class="opacity-75"
|
|
129
|
+
fill="currentColor"
|
|
130
|
+
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
131
|
+
/>
|
|
132
|
+
</svg>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
{:else}
|
|
136
|
+
<!-- Cuerpo Modal -->
|
|
137
|
+
<div class="modal-body">
|
|
138
|
+
<slot />
|
|
139
|
+
</div>
|
|
140
|
+
<!-- /Cuerpo Modal -->
|
|
141
141
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
<!-- /Pie Modal -->
|
|
166
|
-
{/if}
|
|
167
|
-
{/if}
|
|
168
|
-
</div>
|
|
142
|
+
{#if !isVista}
|
|
143
|
+
<!-- Pie Modal -->
|
|
144
|
+
<div class="modal-footer">
|
|
145
|
+
<!-- Cerrar Modal -->
|
|
146
|
+
<button class="modal-cancel-button" type="button" on:click={onClose}>
|
|
147
|
+
{cancelButtonText}
|
|
148
|
+
</button>
|
|
149
|
+
<!-- /Cerrar Modal -->
|
|
150
|
+
<!-- Btn Guardar -->
|
|
151
|
+
<button
|
|
152
|
+
class="modal-save-button"
|
|
153
|
+
type="button"
|
|
154
|
+
on:click={onSave}
|
|
155
|
+
disabled={saveButtonDisabled}
|
|
156
|
+
>
|
|
157
|
+
{saveButtonText}
|
|
158
|
+
</button>
|
|
159
|
+
<!-- /Btn Guardar -->
|
|
160
|
+
</div>
|
|
161
|
+
<!-- /Pie Modal -->
|
|
162
|
+
{/if}
|
|
163
|
+
{/if}
|
|
164
|
+
</div>
|
|
169
165
|
</div>
|
|
170
166
|
<div class="modal-backdrop" />
|