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