mayak-common-library 0.0.48 → 0.0.50
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/index.js +90 -77
- package/dist/index.mjs +90 -77
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -319,7 +319,6 @@ var SelectPro = ({
|
|
|
319
319
|
setOpen(!open);
|
|
320
320
|
};
|
|
321
321
|
const handleClose = () => {
|
|
322
|
-
if (isOpen) return;
|
|
323
322
|
setOpen(false);
|
|
324
323
|
setTimeout(() => {
|
|
325
324
|
setAnchorEl(null);
|
|
@@ -328,82 +327,96 @@ var SelectPro = ({
|
|
|
328
327
|
const childrenWithHandleChange = (0, import_react2.isValidElement)(children) ? (0, import_react2.cloneElement)(children, {
|
|
329
328
|
collapseParent: handleClose
|
|
330
329
|
}) : children;
|
|
331
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
import_material4.
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
import_material4.
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
331
|
+
import_material4.ClickAwayListener,
|
|
332
|
+
{
|
|
333
|
+
onClickAway: isOpen ? () => {
|
|
334
|
+
return;
|
|
335
|
+
} : handleClose,
|
|
336
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material4.Box, { width: fullWidth ? "100%" : "inherit", children: [
|
|
337
|
+
clickComponent ? (0, import_react2.cloneElement)(clickComponent, {
|
|
338
|
+
ref: btn,
|
|
339
|
+
onClick: isOpen ? () => {
|
|
340
|
+
return;
|
|
341
|
+
} : handleClick,
|
|
342
|
+
collapse: open
|
|
343
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
344
|
+
import_material4.Button,
|
|
345
|
+
{
|
|
346
|
+
ref: btn,
|
|
347
|
+
"aria-controls": open ? "basic-menu" : void 0,
|
|
348
|
+
"aria-haspopup": "true",
|
|
349
|
+
"aria-expanded": open ? "true" : void 0,
|
|
350
|
+
onClick: isOpen ? () => {
|
|
351
|
+
return;
|
|
352
|
+
} : handleClick,
|
|
353
|
+
disableRipple: true,
|
|
354
|
+
fullWidth: true,
|
|
355
|
+
sx: {
|
|
356
|
+
height: small ? "34px" : "38px",
|
|
357
|
+
padding: small ? "0 10px 0 6px" : "0 20px 0 19px"
|
|
358
|
+
},
|
|
359
|
+
className: `border rounded-none border-solid normal-case text-accent-dark hover:bg-white ${open ? "!border-transparent bg-white" : ""} ${colorBorder ? "border-accent-beige flex-row-reverse justify-end gap-x-2" : "justify-between border-accent-dark"}`,
|
|
360
|
+
children: [
|
|
361
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
362
|
+
import_material4.Typography,
|
|
363
|
+
{
|
|
364
|
+
width: "200px",
|
|
365
|
+
className: "text-sm leading-4 truncate text-left",
|
|
366
|
+
children: placeholder
|
|
367
|
+
}
|
|
368
|
+
),
|
|
369
|
+
colorBorder ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(search_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
370
|
+
dropdown_arrow_default,
|
|
371
|
+
{
|
|
372
|
+
style: {
|
|
373
|
+
transform: open ? "scaleY(-1)" : "scaleY(1)",
|
|
374
|
+
transition: "0.3s ease-in-out"
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
)
|
|
378
|
+
]
|
|
379
|
+
}
|
|
380
|
+
),
|
|
381
|
+
btn ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
382
|
+
import_material4.Paper,
|
|
383
|
+
{
|
|
384
|
+
sx: {
|
|
385
|
+
position: "absolute",
|
|
386
|
+
width: freeChildWidth ? "fit-content" : !fullContainerWidth && btn ? btn.offsetWidth : "100%",
|
|
387
|
+
left: fullContainerWidth ? 0 : "initial",
|
|
388
|
+
right: fullContainerWidth ? 0 : "initial",
|
|
389
|
+
top: overButton ? 0 : "initial"
|
|
390
|
+
},
|
|
391
|
+
className: `select ${open ? "select--open" : "select--close"} z-50 rounded-none shadow-none ${intermediateChild ? "mt-[1px]" : "m-0"}`,
|
|
392
|
+
children: [
|
|
393
|
+
intermediateChild ? intermediateChild : null,
|
|
394
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material4.Box, { className: `flex flex-col py-3 px-4 gap-2 shadow-sm`, children: [
|
|
395
|
+
overButton ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
396
|
+
IconButton_default,
|
|
397
|
+
{
|
|
398
|
+
className: "bg-accent-silver p-1 self-end absolute",
|
|
399
|
+
onClick: isOpen ? () => {
|
|
400
|
+
return;
|
|
401
|
+
} : handleClose,
|
|
402
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(close_default, {})
|
|
403
|
+
}
|
|
404
|
+
) : null,
|
|
405
|
+
childTitle ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
406
|
+
import_material4.Typography,
|
|
407
|
+
{
|
|
408
|
+
className: "text-sm font-normal text-accent-silver-2",
|
|
409
|
+
children: childTitle
|
|
410
|
+
}
|
|
411
|
+
) : null,
|
|
412
|
+
childrenWithHandleChange
|
|
413
|
+
] })
|
|
414
|
+
]
|
|
415
|
+
}
|
|
416
|
+
) : null
|
|
417
|
+
] })
|
|
418
|
+
}
|
|
419
|
+
);
|
|
407
420
|
};
|
|
408
421
|
var SelectPro_default = SelectPro;
|
|
409
422
|
|
package/dist/index.mjs
CHANGED
|
@@ -259,7 +259,6 @@ var SelectPro = ({
|
|
|
259
259
|
setOpen(!open);
|
|
260
260
|
};
|
|
261
261
|
const handleClose = () => {
|
|
262
|
-
if (isOpen) return;
|
|
263
262
|
setOpen(false);
|
|
264
263
|
setTimeout(() => {
|
|
265
264
|
setAnchorEl(null);
|
|
@@ -268,82 +267,96 @@ var SelectPro = ({
|
|
|
268
267
|
const childrenWithHandleChange = isValidElement(children) ? cloneElement(children, {
|
|
269
268
|
collapseParent: handleClose
|
|
270
269
|
}) : children;
|
|
271
|
-
return /* @__PURE__ */ jsx7(
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
270
|
+
return /* @__PURE__ */ jsx7(
|
|
271
|
+
ClickAwayListener,
|
|
272
|
+
{
|
|
273
|
+
onClickAway: isOpen ? () => {
|
|
274
|
+
return;
|
|
275
|
+
} : handleClose,
|
|
276
|
+
children: /* @__PURE__ */ jsxs3(Box, { width: fullWidth ? "100%" : "inherit", children: [
|
|
277
|
+
clickComponent ? cloneElement(clickComponent, {
|
|
278
|
+
ref: btn,
|
|
279
|
+
onClick: isOpen ? () => {
|
|
280
|
+
return;
|
|
281
|
+
} : handleClick,
|
|
282
|
+
collapse: open
|
|
283
|
+
}) : /* @__PURE__ */ jsxs3(
|
|
284
|
+
Button2,
|
|
285
|
+
{
|
|
286
|
+
ref: btn,
|
|
287
|
+
"aria-controls": open ? "basic-menu" : void 0,
|
|
288
|
+
"aria-haspopup": "true",
|
|
289
|
+
"aria-expanded": open ? "true" : void 0,
|
|
290
|
+
onClick: isOpen ? () => {
|
|
291
|
+
return;
|
|
292
|
+
} : handleClick,
|
|
293
|
+
disableRipple: true,
|
|
294
|
+
fullWidth: true,
|
|
295
|
+
sx: {
|
|
296
|
+
height: small ? "34px" : "38px",
|
|
297
|
+
padding: small ? "0 10px 0 6px" : "0 20px 0 19px"
|
|
298
|
+
},
|
|
299
|
+
className: `border rounded-none border-solid normal-case text-accent-dark hover:bg-white ${open ? "!border-transparent bg-white" : ""} ${colorBorder ? "border-accent-beige flex-row-reverse justify-end gap-x-2" : "justify-between border-accent-dark"}`,
|
|
300
|
+
children: [
|
|
301
|
+
/* @__PURE__ */ jsx7(
|
|
302
|
+
Typography2,
|
|
303
|
+
{
|
|
304
|
+
width: "200px",
|
|
305
|
+
className: "text-sm leading-4 truncate text-left",
|
|
306
|
+
children: placeholder
|
|
307
|
+
}
|
|
308
|
+
),
|
|
309
|
+
colorBorder ? /* @__PURE__ */ jsx7(search_default, {}) : /* @__PURE__ */ jsx7(
|
|
310
|
+
dropdown_arrow_default,
|
|
311
|
+
{
|
|
312
|
+
style: {
|
|
313
|
+
transform: open ? "scaleY(-1)" : "scaleY(1)",
|
|
314
|
+
transition: "0.3s ease-in-out"
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
)
|
|
318
|
+
]
|
|
319
|
+
}
|
|
320
|
+
),
|
|
321
|
+
btn ? /* @__PURE__ */ jsxs3(
|
|
322
|
+
Paper,
|
|
323
|
+
{
|
|
324
|
+
sx: {
|
|
325
|
+
position: "absolute",
|
|
326
|
+
width: freeChildWidth ? "fit-content" : !fullContainerWidth && btn ? btn.offsetWidth : "100%",
|
|
327
|
+
left: fullContainerWidth ? 0 : "initial",
|
|
328
|
+
right: fullContainerWidth ? 0 : "initial",
|
|
329
|
+
top: overButton ? 0 : "initial"
|
|
330
|
+
},
|
|
331
|
+
className: `select ${open ? "select--open" : "select--close"} z-50 rounded-none shadow-none ${intermediateChild ? "mt-[1px]" : "m-0"}`,
|
|
332
|
+
children: [
|
|
333
|
+
intermediateChild ? intermediateChild : null,
|
|
334
|
+
/* @__PURE__ */ jsxs3(Box, { className: `flex flex-col py-3 px-4 gap-2 shadow-sm`, children: [
|
|
335
|
+
overButton ? /* @__PURE__ */ jsx7(
|
|
336
|
+
IconButton_default,
|
|
337
|
+
{
|
|
338
|
+
className: "bg-accent-silver p-1 self-end absolute",
|
|
339
|
+
onClick: isOpen ? () => {
|
|
340
|
+
return;
|
|
341
|
+
} : handleClose,
|
|
342
|
+
children: /* @__PURE__ */ jsx7(close_default, {})
|
|
343
|
+
}
|
|
344
|
+
) : null,
|
|
345
|
+
childTitle ? /* @__PURE__ */ jsx7(
|
|
346
|
+
Typography2,
|
|
347
|
+
{
|
|
348
|
+
className: "text-sm font-normal text-accent-silver-2",
|
|
349
|
+
children: childTitle
|
|
350
|
+
}
|
|
351
|
+
) : null,
|
|
352
|
+
childrenWithHandleChange
|
|
353
|
+
] })
|
|
354
|
+
]
|
|
355
|
+
}
|
|
356
|
+
) : null
|
|
357
|
+
] })
|
|
358
|
+
}
|
|
359
|
+
);
|
|
347
360
|
};
|
|
348
361
|
var SelectPro_default = SelectPro;
|
|
349
362
|
|