contentoh-components-library 21.6.44 → 21.6.46
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/components/organisms/VariantGroupModal/index.js +360 -0
- package/dist/components/organisms/VariantGroupModal/styles.js +55 -0
- package/dist/components/pages/ProviderProductEdition/index.js +385 -145
- package/dist/components/pages/RetailerProductEdition/index.js +467 -230
- package/dist/index.js +25 -12
- package/package.json +1 -1
- package/src/components/organisms/VariantGroupModal/index.js +252 -0
- package/src/components/organisms/VariantGroupModal/styles.js +254 -0
- package/src/components/pages/ProviderProductEdition/index.js +164 -0
- package/src/components/pages/RetailerProductEdition/index.js +156 -0
- package/src/index.js +1 -0
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.VariantGroupModal = void 0;
|
|
9
|
+
|
|
10
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
11
|
+
|
|
12
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
13
|
+
|
|
14
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/asyncToGenerator"));
|
|
15
|
+
|
|
16
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
17
|
+
|
|
18
|
+
var _react = require("react");
|
|
19
|
+
|
|
20
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
21
|
+
|
|
22
|
+
var _api = require("../LinkVariantsModal/api");
|
|
23
|
+
|
|
24
|
+
var _styles = require("./styles");
|
|
25
|
+
|
|
26
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
|
+
|
|
28
|
+
/*
|
|
29
|
+
Agrupar el producto como variante de otros.
|
|
30
|
+
|
|
31
|
+
Ojo con la palabra: esto NO es padre/hijo. Ahí hay jerarquía y herencia —un
|
|
32
|
+
padre baja valores a sus hijos—. Aquí no hay ninguna de las dos: los productos
|
|
33
|
+
de un grupo son "el mismo producto en otra presentación" y nada más. Comparten
|
|
34
|
+
un código en `article.variant_group` y ya. Por eso el modal no pregunta qué
|
|
35
|
+
heredar: no hay nada que heredar.
|
|
36
|
+
|
|
37
|
+
Dos formas de agrupar, y son la misma operación por debajo:
|
|
38
|
+
- elegir un grupo que ya existe
|
|
39
|
+
- teclear un código nuevo, que crea el grupo con este producto dentro
|
|
40
|
+
|
|
41
|
+
No hay tabla de grupos: un grupo existe mientras algún producto use su código.
|
|
42
|
+
Eso hace que una errata no falle, solo cree un grupo de un miembro — de ahí que
|
|
43
|
+
la lista de los existentes vaya PRIMERO y el campo de código nuevo después.
|
|
44
|
+
|
|
45
|
+
props (* requerido):
|
|
46
|
+
- *articleId: el producto que se va a agrupar
|
|
47
|
+
- articleName / articleUpc: para nombrarlo
|
|
48
|
+
- currentGroup: el grupo en el que ya está, si lo hay
|
|
49
|
+
- *token, endpoint
|
|
50
|
+
- *onClose, onSaved
|
|
51
|
+
*/
|
|
52
|
+
var VariantGroupModal = function VariantGroupModal(_ref) {
|
|
53
|
+
var articleId = _ref.articleId,
|
|
54
|
+
articleName = _ref.articleName,
|
|
55
|
+
articleUpc = _ref.articleUpc,
|
|
56
|
+
_ref$currentGroup = _ref.currentGroup,
|
|
57
|
+
currentGroup = _ref$currentGroup === void 0 ? null : _ref$currentGroup,
|
|
58
|
+
token = _ref.token,
|
|
59
|
+
_ref$endpoint = _ref.endpoint,
|
|
60
|
+
endpoint = _ref$endpoint === void 0 ? process.env.REACT_APP_VARIANTS_ENDPOINT : _ref$endpoint,
|
|
61
|
+
onClose = _ref.onClose,
|
|
62
|
+
onSaved = _ref.onSaved;
|
|
63
|
+
|
|
64
|
+
var _useState = (0, _react.useState)(""),
|
|
65
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
66
|
+
query = _useState2[0],
|
|
67
|
+
setQuery = _useState2[1];
|
|
68
|
+
|
|
69
|
+
var _useState3 = (0, _react.useState)([]),
|
|
70
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
71
|
+
groups = _useState4[0],
|
|
72
|
+
setGroups = _useState4[1];
|
|
73
|
+
|
|
74
|
+
var _useState5 = (0, _react.useState)(false),
|
|
75
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
76
|
+
loading = _useState6[0],
|
|
77
|
+
setLoading = _useState6[1];
|
|
78
|
+
|
|
79
|
+
var _useState7 = (0, _react.useState)(false),
|
|
80
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
81
|
+
saving = _useState8[0],
|
|
82
|
+
setSaving = _useState8[1];
|
|
83
|
+
|
|
84
|
+
var _useState9 = (0, _react.useState)(null),
|
|
85
|
+
_useState10 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
86
|
+
error = _useState10[0],
|
|
87
|
+
setError = _useState10[1]; // Qué eligió el usuario: un código de la lista, o el que está escribiendo.
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
var _useState11 = (0, _react.useState)(null),
|
|
91
|
+
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
92
|
+
selected = _useState12[0],
|
|
93
|
+
setSelected = _useState12[1];
|
|
94
|
+
|
|
95
|
+
var _useState13 = (0, _react.useState)(""),
|
|
96
|
+
_useState14 = (0, _slicedToArray2.default)(_useState13, 2),
|
|
97
|
+
nuevo = _useState14[0],
|
|
98
|
+
setNuevo = _useState14[1];
|
|
99
|
+
|
|
100
|
+
var request = (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
101
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(action, body) {
|
|
102
|
+
var res;
|
|
103
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
104
|
+
while (1) {
|
|
105
|
+
switch (_context.prev = _context.next) {
|
|
106
|
+
case 0:
|
|
107
|
+
_context.next = 2;
|
|
108
|
+
return _axios.default.post("".concat(endpoint, "/").concat(action), body, {
|
|
109
|
+
headers: {
|
|
110
|
+
Authorization: token
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
case 2:
|
|
115
|
+
res = _context.sent;
|
|
116
|
+
return _context.abrupt("return", (0, _api.readPayload)(res));
|
|
117
|
+
|
|
118
|
+
case 4:
|
|
119
|
+
case "end":
|
|
120
|
+
return _context.stop();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}, _callee);
|
|
124
|
+
}));
|
|
125
|
+
|
|
126
|
+
return function (_x, _x2) {
|
|
127
|
+
return _ref2.apply(this, arguments);
|
|
128
|
+
};
|
|
129
|
+
}(), [endpoint, token]);
|
|
130
|
+
var buscar = (0, _react.useCallback)( /*#__PURE__*/function () {
|
|
131
|
+
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(texto) {
|
|
132
|
+
var _data$groups, data;
|
|
133
|
+
|
|
134
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
135
|
+
while (1) {
|
|
136
|
+
switch (_context2.prev = _context2.next) {
|
|
137
|
+
case 0:
|
|
138
|
+
setLoading(true);
|
|
139
|
+
setError(null);
|
|
140
|
+
_context2.prev = 2;
|
|
141
|
+
_context2.next = 5;
|
|
142
|
+
return request("groups", {
|
|
143
|
+
articleId: articleId,
|
|
144
|
+
query: texto !== null && texto !== void 0 ? texto : ""
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
case 5:
|
|
148
|
+
data = _context2.sent;
|
|
149
|
+
setGroups((_data$groups = data.groups) !== null && _data$groups !== void 0 ? _data$groups : []);
|
|
150
|
+
_context2.next = 12;
|
|
151
|
+
break;
|
|
152
|
+
|
|
153
|
+
case 9:
|
|
154
|
+
_context2.prev = 9;
|
|
155
|
+
_context2.t0 = _context2["catch"](2);
|
|
156
|
+
setError(_context2.t0 instanceof _api.ApiError || (_context2.t0 === null || _context2.t0 === void 0 ? void 0 : _context2.t0.name) === "ApiError" ? _context2.t0.message : "No se pudieron cargar los grupos.");
|
|
157
|
+
|
|
158
|
+
case 12:
|
|
159
|
+
_context2.prev = 12;
|
|
160
|
+
setLoading(false);
|
|
161
|
+
return _context2.finish(12);
|
|
162
|
+
|
|
163
|
+
case 15:
|
|
164
|
+
case "end":
|
|
165
|
+
return _context2.stop();
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}, _callee2, null, [[2, 9, 12, 15]]);
|
|
169
|
+
}));
|
|
170
|
+
|
|
171
|
+
return function (_x3) {
|
|
172
|
+
return _ref3.apply(this, arguments);
|
|
173
|
+
};
|
|
174
|
+
}(), [request, articleId]); // Al abrir se listan los grupos que ya existen. Es lo que evita que el usuario
|
|
175
|
+
// teclee un código nuevo cuando en realidad quería sumarse a uno que ya está.
|
|
176
|
+
|
|
177
|
+
(0, _react.useEffect)(function () {
|
|
178
|
+
buscar(""); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
179
|
+
}, []);
|
|
180
|
+
/*
|
|
181
|
+
El código se normaliza igual que en el servidor —mayúsculas, sin espacios—
|
|
182
|
+
para que lo que se ve en el campo sea lo que se va a guardar. Si el front
|
|
183
|
+
mostrara "abc 1" y la base guardara "ABC-1", el usuario buscaría después su
|
|
184
|
+
grupo por el texto que creyó escribir y no lo encontraría.
|
|
185
|
+
*/
|
|
186
|
+
|
|
187
|
+
var normalizar = function normalizar(texto) {
|
|
188
|
+
return "".concat(texto !== null && texto !== void 0 ? texto : "").trim().replace(/\s+/g, "-").toUpperCase();
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
var codigoNuevo = normalizar(nuevo);
|
|
192
|
+
var codigoFinal = selected !== null && selected !== void 0 ? selected : codigoNuevo;
|
|
193
|
+
var esNuevo = !selected && !!codigoNuevo;
|
|
194
|
+
var yaEstaba = codigoFinal && codigoFinal === currentGroup;
|
|
195
|
+
|
|
196
|
+
var guardar = /*#__PURE__*/function () {
|
|
197
|
+
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
198
|
+
var _data$group, data;
|
|
199
|
+
|
|
200
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
201
|
+
while (1) {
|
|
202
|
+
switch (_context3.prev = _context3.next) {
|
|
203
|
+
case 0:
|
|
204
|
+
if (!(!codigoFinal || yaEstaba)) {
|
|
205
|
+
_context3.next = 2;
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
return _context3.abrupt("return");
|
|
210
|
+
|
|
211
|
+
case 2:
|
|
212
|
+
setSaving(true);
|
|
213
|
+
setError(null);
|
|
214
|
+
_context3.prev = 4;
|
|
215
|
+
_context3.next = 7;
|
|
216
|
+
return request("join", {
|
|
217
|
+
articleId: articleId,
|
|
218
|
+
code: codigoFinal
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
case 7:
|
|
222
|
+
data = _context3.sent;
|
|
223
|
+
onSaved === null || onSaved === void 0 ? void 0 : onSaved((0, _objectSpread2.default)((0, _objectSpread2.default)({}, data), {}, {
|
|
224
|
+
group: (_data$group = data.group) !== null && _data$group !== void 0 ? _data$group : codigoFinal
|
|
225
|
+
}));
|
|
226
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
227
|
+
_context3.next = 16;
|
|
228
|
+
break;
|
|
229
|
+
|
|
230
|
+
case 12:
|
|
231
|
+
_context3.prev = 12;
|
|
232
|
+
_context3.t0 = _context3["catch"](4);
|
|
233
|
+
setError(_context3.t0 instanceof _api.ApiError || (_context3.t0 === null || _context3.t0 === void 0 ? void 0 : _context3.t0.name) === "ApiError" ? _context3.t0.message : "No se pudo agrupar el producto. Intenta de nuevo.");
|
|
234
|
+
setSaving(false);
|
|
235
|
+
|
|
236
|
+
case 16:
|
|
237
|
+
case "end":
|
|
238
|
+
return _context3.stop();
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}, _callee3, null, [[4, 12]]);
|
|
242
|
+
}));
|
|
243
|
+
|
|
244
|
+
return function guardar() {
|
|
245
|
+
return _ref4.apply(this, arguments);
|
|
246
|
+
};
|
|
247
|
+
}();
|
|
248
|
+
|
|
249
|
+
var resumen = function resumen() {
|
|
250
|
+
if (yaEstaba) return "Este producto ya est\xE1 en \xAB".concat(codigoFinal, "\xBB.");
|
|
251
|
+
if (esNuevo) return "Se crear\xE1 el grupo \xAB".concat(codigoNuevo, "\xBB con este producto.");
|
|
252
|
+
if (selected) return "Se agregar\xE1 a \xAB".concat(selected, "\xBB.");
|
|
253
|
+
return "Elige un grupo o escribe un código nuevo.";
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Overlay, {
|
|
257
|
+
onClick: saving ? undefined : onClose,
|
|
258
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Panel, {
|
|
259
|
+
onClick: function onClick(event) {
|
|
260
|
+
return event.stopPropagation();
|
|
261
|
+
},
|
|
262
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Header, {
|
|
263
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
|
|
264
|
+
children: "Agrupar como variante"
|
|
265
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("p", {
|
|
266
|
+
children: [articleName || "Producto ".concat(articleId), articleUpc ? " \xB7 UPC ".concat(articleUpc) : "", currentGroup ? " \xB7 hoy en \xAB".concat(currentGroup, "\xBB") : ""]
|
|
267
|
+
})]
|
|
268
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Body, {
|
|
269
|
+
children: [error && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Message, {
|
|
270
|
+
className: "error",
|
|
271
|
+
children: error
|
|
272
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.SearchRow, {
|
|
273
|
+
onSubmit: function onSubmit(event) {
|
|
274
|
+
event.preventDefault();
|
|
275
|
+
buscar(query);
|
|
276
|
+
},
|
|
277
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
278
|
+
type: "text",
|
|
279
|
+
value: query,
|
|
280
|
+
placeholder: "Busca un grupo por su c\xF3digo",
|
|
281
|
+
onChange: function onChange(event) {
|
|
282
|
+
return setQuery(event.target.value);
|
|
283
|
+
}
|
|
284
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
285
|
+
type: "submit",
|
|
286
|
+
disabled: loading,
|
|
287
|
+
children: loading ? "Buscando…" : "Buscar"
|
|
288
|
+
})]
|
|
289
|
+
}), groups.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.List, {
|
|
290
|
+
children: groups.map(function (grupo) {
|
|
291
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
292
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("label", {
|
|
293
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
294
|
+
type: "radio",
|
|
295
|
+
name: "variant-group",
|
|
296
|
+
checked: selected === grupo.code,
|
|
297
|
+
onChange: function onChange() {
|
|
298
|
+
setSelected(grupo.code);
|
|
299
|
+
setNuevo("");
|
|
300
|
+
}
|
|
301
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
302
|
+
className: "codigo",
|
|
303
|
+
children: grupo.code
|
|
304
|
+
}), grupo.code === currentGroup ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
305
|
+
className: "actual",
|
|
306
|
+
children: "grupo actual"
|
|
307
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
308
|
+
className: "cuenta",
|
|
309
|
+
children: [grupo.products, " producto", grupo.products === 1 ? "" : "s"]
|
|
310
|
+
})]
|
|
311
|
+
})
|
|
312
|
+
}, grupo.code);
|
|
313
|
+
})
|
|
314
|
+
}), !loading && groups.length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.Message, {
|
|
315
|
+
children: query.trim() ? "Ningún grupo coincide con esa búsqueda." : "Todavía no hay grupos en esta compañía. Crea el primero abajo."
|
|
316
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.NewGroup, {
|
|
317
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
318
|
+
htmlFor: "nuevo-grupo",
|
|
319
|
+
children: "O crea un grupo nuevo"
|
|
320
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
321
|
+
id: "nuevo-grupo",
|
|
322
|
+
type: "text",
|
|
323
|
+
value: nuevo,
|
|
324
|
+
placeholder: "RELOJ-CASIO-A158",
|
|
325
|
+
maxLength: 50,
|
|
326
|
+
onChange: function onChange(event) {
|
|
327
|
+
setNuevo(event.target.value);
|
|
328
|
+
setSelected(null);
|
|
329
|
+
}
|
|
330
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
331
|
+
className: "ayuda",
|
|
332
|
+
children: "Letras, n\xFAmeros, guion y guion bajo. Se guarda en may\xFAsculas, as\xED que \xABabc-1\xBB y \xABABC-1\xBB son el mismo grupo."
|
|
333
|
+
})]
|
|
334
|
+
})]
|
|
335
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Footer, {
|
|
336
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
337
|
+
className: "resumen",
|
|
338
|
+
children: resumen()
|
|
339
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
340
|
+
className: "acciones",
|
|
341
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
342
|
+
type: "button",
|
|
343
|
+
className: "secondary",
|
|
344
|
+
onClick: onClose,
|
|
345
|
+
disabled: saving,
|
|
346
|
+
children: "Cancelar"
|
|
347
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
348
|
+
type: "button",
|
|
349
|
+
className: "primary",
|
|
350
|
+
onClick: guardar,
|
|
351
|
+
disabled: saving || !codigoFinal || yaEstaba,
|
|
352
|
+
children: saving ? "Guardando…" : "Aceptar"
|
|
353
|
+
})]
|
|
354
|
+
})]
|
|
355
|
+
})]
|
|
356
|
+
})
|
|
357
|
+
});
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
exports.VariantGroupModal = VariantGroupModal;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.SearchRow = exports.Panel = exports.Overlay = exports.NewGroup = exports.Message = exports.List = exports.Header = exports.Footer = exports.Body = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _variables = require("../../../global-files/variables");
|
|
15
|
+
|
|
16
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
17
|
+
|
|
18
|
+
var PINK = "#E13AA8";
|
|
19
|
+
var PINK_RGB = "225, 58, 168";
|
|
20
|
+
|
|
21
|
+
var Overlay = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: fixed;\n inset: 0;\n z-index: 1000;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: rgba(40, 31, 51, 0.4);\n"])));
|
|
22
|
+
|
|
23
|
+
exports.Overlay = Overlay;
|
|
24
|
+
|
|
25
|
+
var Panel = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n width: min(560px, 92vw);\n max-height: 86vh;\n border-radius: 10px;\n background-color: ", ";\n font-family: ", ";\n overflow: hidden;\n"])), _variables.GlobalColors.white, _variables.FontFamily.Raleway);
|
|
26
|
+
|
|
27
|
+
exports.Panel = Panel;
|
|
28
|
+
|
|
29
|
+
var Header = _styledComponents.default.div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n padding: 20px 24px 12px;\n\n h2 {\n margin: 0;\n font-family: ", ";\n font-size: 17px;\n color: ", ";\n }\n\n p {\n margin: 4px 0 0;\n font-size: 13px;\n line-height: 1.4;\n color: ", ";\n }\n"])), _variables.FontFamily.Raleway_700, _variables.GlobalColors.deep_gray, _variables.GlobalColors.gray);
|
|
30
|
+
|
|
31
|
+
exports.Header = Header;
|
|
32
|
+
|
|
33
|
+
var Body = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n padding: 4px 24px 12px;\n"])));
|
|
34
|
+
|
|
35
|
+
exports.Body = Body;
|
|
36
|
+
|
|
37
|
+
var SearchRow = _styledComponents.default.form(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n gap: 8px;\n margin-bottom: 12px;\n\n input {\n flex: 1;\n min-width: 0;\n height: 36px;\n padding: 0 12px;\n border: 1px solid ", ";\n border-radius: 6px;\n font-family: ", ";\n font-size: 13px;\n color: ", ";\n }\n\n input:focus {\n outline: none;\n border-color: ", ";\n }\n\n /*\n Estas reglas faltaban y el bot\xF3n se sal\xEDa del panel.\n\n Llevaba className=\"secondary\", pero esa clase solo est\xE1 definida dentro de\n Footer, as\xED que aqu\xED no aplicaba nada: sal\xEDa como un bot\xF3n crudo del\n navegador, sin altura ni ancho acotados. El flex-shrink es para que el texto\n no se parta cuando el campo de b\xFAsqueda se lleva el espacio.\n */\n button {\n flex-shrink: 0;\n height: 36px;\n padding: 0 18px;\n border: none;\n border-radius: 6px;\n background-color: ", ";\n color: ", ";\n font-family: ", ";\n font-size: 13px;\n cursor: pointer;\n }\n\n button:disabled {\n opacity: 0.5;\n cursor: default;\n }\n"])), _variables.GlobalColors.s2, _variables.FontFamily.Raleway, _variables.GlobalColors.deep_gray, PINK, PINK, _variables.GlobalColors.white, _variables.FontFamily.Raleway_600);
|
|
38
|
+
|
|
39
|
+
exports.SearchRow = SearchRow;
|
|
40
|
+
|
|
41
|
+
var List = _styledComponents.default.ul(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n margin: 0 0 12px;\n padding: 0;\n list-style: none;\n border: 1px solid ", ";\n border-radius: 6px;\n overflow: hidden;\n\n li + li {\n border-top: 1px solid ", ";\n }\n\n label {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 9px 12px;\n cursor: pointer;\n font-size: 13px;\n color: ", ";\n }\n\n label:hover {\n background-color: ", ";\n }\n\n input[type=\"radio\"] {\n accent-color: ", ";\n flex-shrink: 0;\n }\n\n .codigo {\n font-family: ", ";\n }\n\n .cuenta {\n margin-left: auto;\n font-size: 11px;\n color: ", ";\n white-space: nowrap;\n }\n\n /* El grupo en el que ya est\xE1 el producto: se marca para que no lo elija otra\n vez creyendo que hace algo. */\n .actual {\n margin-left: auto;\n font-size: 11px;\n font-style: italic;\n color: ", ";\n white-space: nowrap;\n }\n"])), _variables.GlobalColors.s2, _variables.GlobalColors.s2, _variables.GlobalColors.deep_gray, _variables.GlobalColors.s1, PINK, _variables.FontFamily.Raleway_600, _variables.GlobalColors.gray, PINK);
|
|
42
|
+
|
|
43
|
+
exports.List = List;
|
|
44
|
+
|
|
45
|
+
var NewGroup = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n padding: 12px;\n border: 1px dashed rgba(", ", 0.5);\n border-radius: 6px;\n background-color: rgba(", ", 0.04);\n\n label {\n display: block;\n margin-bottom: 6px;\n font-family: ", ";\n font-size: 12px;\n color: ", ";\n }\n\n input {\n width: 100%;\n height: 36px;\n padding: 0 12px;\n border: 1px solid ", ";\n border-radius: 6px;\n font-family: inherit;\n font-size: 13px;\n text-transform: uppercase;\n color: ", ";\n }\n\n input:focus {\n outline: none;\n border-color: ", ";\n }\n\n .ayuda {\n display: block;\n margin-top: 6px;\n font-size: 11px;\n line-height: 1.4;\n color: ", ";\n }\n"])), PINK_RGB, PINK_RGB, _variables.FontFamily.Raleway_600, _variables.GlobalColors.deep_gray, _variables.GlobalColors.s2, _variables.GlobalColors.deep_gray, PINK, _variables.GlobalColors.gray);
|
|
46
|
+
|
|
47
|
+
exports.NewGroup = NewGroup;
|
|
48
|
+
|
|
49
|
+
var Message = _styledComponents.default.p(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n margin: 0 0 12px;\n padding: 10px 12px;\n border-radius: 6px;\n font-size: 13px;\n line-height: 1.4;\n background-color: ", ";\n color: ", ";\n\n &.error {\n background-color: rgba(", ", 0.1);\n color: ", ";\n }\n"])), _variables.GlobalColors.s2, _variables.GlobalColors.deep_gray, PINK_RGB, PINK);
|
|
50
|
+
|
|
51
|
+
exports.Message = Message;
|
|
52
|
+
|
|
53
|
+
var Footer = _styledComponents.default.div(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n padding: 16px 24px;\n border-top: 1px solid ", ";\n\n .resumen {\n font-size: 12px;\n color: ", ";\n }\n\n .acciones {\n display: flex;\n gap: 10px;\n }\n\n button {\n height: 38px;\n padding: 0 16px;\n border-radius: 6px;\n cursor: pointer;\n font-family: ", ";\n font-size: 13px;\n }\n\n button:disabled {\n opacity: 0.5;\n cursor: default;\n }\n\n .secondary {\n border: 1px solid ", ";\n background: none;\n color: ", ";\n }\n\n .primary {\n border: 1px solid ", ";\n background-color: ", ";\n color: ", ";\n }\n"])), _variables.GlobalColors.s2, _variables.GlobalColors.gray, _variables.FontFamily.Raleway_600, _variables.GlobalColors.s2, _variables.GlobalColors.deep_gray, PINK, PINK, _variables.GlobalColors.white);
|
|
54
|
+
|
|
55
|
+
exports.Footer = Footer;
|