nexaas-ui-components 1.0.19 → 1.0.21
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.cjs +321 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.cts +63 -17
- package/dist/index.d.ts +63 -17
- package/dist/index.js +317 -20
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { DateInput3, DateRangePicker3, DatePicker3 } from '@blueprintjs/datetime
|
|
|
6
6
|
import { Controller } from 'react-hook-form';
|
|
7
7
|
import { create } from 'zustand';
|
|
8
8
|
import { parse, format, set, startOfWeek, endOfWeek, startOfMonth, endOfMonth, sub, subYears } from 'date-fns';
|
|
9
|
-
import { Switch, Popover, PopoverButton, PopoverPanel, Listbox, ListboxOptions, Combobox, ListboxOption } from '@headlessui/react';
|
|
9
|
+
import { Switch, Popover, PopoverButton, PopoverPanel, Listbox, ListboxOptions, Combobox, Transition, Menu as Menu$1, MenuButton, MenuItems, MenuItem, ListboxOption } from '@headlessui/react';
|
|
10
10
|
import { Float } from '@headlessui-float/react';
|
|
11
11
|
import IntlCurrencyInputRaw from 'react-intl-currency-input';
|
|
12
12
|
import * as lodashNamespace from 'lodash';
|
|
@@ -47,8 +47,8 @@ var sizes = {
|
|
|
47
47
|
icon: "text-[16px]"
|
|
48
48
|
},
|
|
49
49
|
sm: {
|
|
50
|
-
text: "h-[32px]",
|
|
51
|
-
icon: "text-[
|
|
50
|
+
text: "h-[32px] text-[12px]",
|
|
51
|
+
icon: "text-[12px]"
|
|
52
52
|
},
|
|
53
53
|
md: {
|
|
54
54
|
text: "h-[38px]",
|
|
@@ -64,16 +64,16 @@ var variants = {
|
|
|
64
64
|
text: "bg-gradient-to-b from-[#FF4D8B] to-[#DA3063] text-white shadow-[0_2px_6px_0_rgba(218,48,99,0.25)] hover:from-[#ff4d84] hover:to-[#df4573] active:from-[#ae264f] active:to-[#ae264f] disabled:opacity-50 disabled:shadow-none active:shadow-none disabled:hover:from-[#FF4D8B] disabled:hover:to-[#DA3063]"
|
|
65
65
|
},
|
|
66
66
|
secondary: {
|
|
67
|
-
text: "shadow-button bg-surface border-[0.5px] border-neutral-400 text-neutral-
|
|
67
|
+
text: "shadow-button bg-surface border-[0.5px] border-neutral-400 text-neutral-500 hover:bg-neutral-100 hover:text-neutral-600 active:text-neutral-600 active:shadow-none disabled:text-neutral-400 disabled:opacity-50"
|
|
68
68
|
},
|
|
69
69
|
icon: {
|
|
70
|
-
text: "shadow-button bg-white border-[0.5px] border-neutral-300 hover:bg-[#f5f5f5] active:bg-neutral-100 disabled:text-neutral-400 disabled:border-[0.5px] disabled:border-disabled disabled:bg-white disabled:opacity-50 active:shadow-none"
|
|
70
|
+
text: "shadow-button bg-white border-[0.5px] border-neutral-300 text-neutral-500 hover:bg-[#f5f5f5] hover:text-neutral-600 active:bg-neutral-100 active:text-neutral-600 disabled:text-neutral-400 disabled:border-[0.5px] disabled:border-disabled disabled:bg-white disabled:opacity-50 active:shadow-none"
|
|
71
71
|
},
|
|
72
72
|
outline: {
|
|
73
|
-
text: "shadow-button bg-surface border-[0.5px] border-rose-500 text-rose-500 hover:bg-rose-50 active:bg-rose-100
|
|
73
|
+
text: "shadow-button bg-surface border-[0.5px] border-rose-500 text-rose-500 hover:bg-rose-50 hover:text-rose-600 active:bg-rose-100 active:text-rose-600 disabled:bg-surface disabled:border-[0.5px] disabled:border-rose-700 disabled:opacity-50 active:shadow-none"
|
|
74
74
|
},
|
|
75
75
|
dangerOutline: {
|
|
76
|
-
text: "shadow-button text-dangerous-500 bg-surface border-[0.5px] border-dangerous-500 hover:bg-dangerous-100 active:bg-dangerous-500 active:text-white disabled:opacity-50 disabled:bg-white disabled:text-dangerous-500 active:shadow-none"
|
|
76
|
+
text: "shadow-button text-dangerous-500 bg-surface border-[0.5px] border-dangerous-500 hover:bg-dangerous-100 hover:text-dangerous-600 active:bg-dangerous-500 active:text-white disabled:opacity-50 disabled:bg-white disabled:text-dangerous-500 active:shadow-none"
|
|
77
77
|
},
|
|
78
78
|
danger: {
|
|
79
79
|
text: "shadow-button text-white bg-gradient-to-b from-danger-start to-danger-end hover:from-[#fe6464] hover:to-[#e24e4e] active:from-dangerous-600 active:to-dangerous-600 disabled:opacity-50 disabled:from-dangerous-500 disabled:to-dangerous-500 active:shadow-none"
|
|
@@ -85,13 +85,13 @@ var variants = {
|
|
|
85
85
|
text: "shadow-button text-white bg-gradient-to-b from-warning-start to-warning-end hover:from-[#febd5b] hover:to-[#f4a52e] active:from-warning-600 active:to-warning-600 disabled:opacity-50 disabled:from-warning-start disabled:to-warning-end active:shadow-none"
|
|
86
86
|
},
|
|
87
87
|
blue: {
|
|
88
|
-
text: "shadow-button bg-blue-500 text-white text-bold"
|
|
88
|
+
text: "shadow-button bg-blue-500 text-white hover:bg-blue-600 active:bg-blue-600 text-bold"
|
|
89
89
|
},
|
|
90
90
|
iconSecondary: {
|
|
91
91
|
text: "border-[1px] border-none text-white active:bg-[#0A0A0A40]/20 hover:bg-[#F5F5F526]/10 hover:text-white disabled:text-neutral-400 disabled:border-[0.5px] disabled:border-disabled disabled:bg-white disabled:opacity-50 active:shadow-none"
|
|
92
92
|
},
|
|
93
93
|
outlineIcon: {
|
|
94
|
-
text: "bg-white text-rose-500 hover:shadow-button active:bg-rose-500 active:text-white disabled:text-neutral-400
|
|
94
|
+
text: "bg-white text-rose-500 hover:shadow-button hover:text-rose-600 active:bg-rose-500 active:text-white disabled:text-neutral-400 disabled:border-disabled disabled:bg-white disabled:opacity-50 active:shadow-none"
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
97
|
var paddingConfig = {
|
|
@@ -160,7 +160,7 @@ var Button = ({
|
|
|
160
160
|
"flex-row items-center": hotkeyPosition === "left" || hotkeyPosition === "right"
|
|
161
161
|
}),
|
|
162
162
|
children: [
|
|
163
|
-
hotkey && (hotkeyPosition === "top" || hotkeyPosition === "left") && /* @__PURE__ */ jsx("span", { style: { color: "var(--label)" }, className: "text-p-sm font-normal
|
|
163
|
+
hotkey && (hotkeyPosition === "top" || hotkeyPosition === "left") && /* @__PURE__ */ jsx("span", { style: { color: "var(--label)" }, className: "text-p-sm font-normal", children: hotkeyLabel }),
|
|
164
164
|
/* @__PURE__ */ jsx(
|
|
165
165
|
"button",
|
|
166
166
|
{
|
|
@@ -193,7 +193,7 @@ var Button = ({
|
|
|
193
193
|
"span",
|
|
194
194
|
{
|
|
195
195
|
style: { color: "var(--label)" },
|
|
196
|
-
className: "text-p-sm font-normal
|
|
196
|
+
className: "text-p-sm font-normal",
|
|
197
197
|
children: hotkeyLabel
|
|
198
198
|
}
|
|
199
199
|
)
|
|
@@ -223,19 +223,19 @@ var variants2 = {
|
|
|
223
223
|
text: "shadow-button text-button-label bg-gradient-to-b hover:text-white from-rose-start to-rose-end active:bg-gradient-to-b active:from-rose-800 active:to-rose-800 disabled:bg-gradient-to-b disabled:from-rose-800 disabled:to-rose-800 disabled:opacity-50 hover:from-[#FD467F] hover:to-[#DF4573]"
|
|
224
224
|
},
|
|
225
225
|
secondary: {
|
|
226
|
-
text: "shadow-button bg-white border-[0.5px] border-paragraph text-
|
|
226
|
+
text: "shadow-button bg-white border-[0.5px] border-paragraph text-blue-500 hover:text-blue-600 hover:bg-[#f5f5f5] active:text-blue-600 active:bg-light-gray-100 disabled:text-dark-blue-400 disabled:bg-white disabled:border-[0.5px] disabled:border-dark-blue-400"
|
|
227
227
|
},
|
|
228
228
|
link: {
|
|
229
|
-
text: "text-blue-
|
|
229
|
+
text: "text-blue-500 hover:text-blue-600 hover:underline active:text-blue-600 active:underline disabled:text-blue-500 disabled:no-underline shadow-none font-normal"
|
|
230
230
|
},
|
|
231
231
|
icon: {
|
|
232
|
-
text: "bg-white border-[0.5px] border-dark-blue-300 hover:bg-[#f5f5f5] active:bg-light-gray-100
|
|
232
|
+
text: "bg-white border-[0.5px] border-dark-blue-300 text-blue-500 hover:text-blue-600 hover:bg-[#f5f5f5] active:text-blue-600 active:bg-light-gray-100 disabled:text-dark-blue-400 disabled:border-[0.5px] disabled:border-disabled disabled:bg-white disabled:opacity-50"
|
|
233
233
|
},
|
|
234
234
|
iconSecondary: {
|
|
235
235
|
text: "border-[1px] border-none text-white active:bg-[#0A0A0A40]/20 hover:bg-[#F5F5F526]/10 hover:text-white disabled:text-dark-blue-400 disabled:border-[0.5px] disabled:border-disabled disabled:bg-white disabled:opacity-50"
|
|
236
236
|
},
|
|
237
237
|
outline: {
|
|
238
|
-
text: "shadow-button bg-white border-[0.5px] border-rose-700 text-
|
|
238
|
+
text: "shadow-button bg-white border-[0.5px] border-rose-700 text-blue-500 hover:text-blue-600 hover:bg-[#f5f5f5] active:text-blue-600 active:bg-light-gray-100 disabled:text-rose-700 disabled:bg-white disabled:border-[0.5px] disabled:border-rose-700 disabled:opacity-50"
|
|
239
239
|
},
|
|
240
240
|
dark: {
|
|
241
241
|
text: "shadow-button text-white hover:bg-[#f5f5f526] active:bg-[#0a0a0a40] disabled:opacity-50 disabled:bg-transparent"
|
|
@@ -256,10 +256,10 @@ var variants2 = {
|
|
|
256
256
|
text: "shadow-button bg-blue-700 text-white text-bold"
|
|
257
257
|
},
|
|
258
258
|
filter: {
|
|
259
|
-
text: "shadow-button rounded-3xl border border-dark-blue-300 text-
|
|
259
|
+
text: "shadow-button rounded-3xl border border-dark-blue-300 text-blue-500 hover:text-blue-600 hover:bg-light-gray-100 active:border active:border-blue-700 active:text-blue-600 active:bg-blue-100 focus:border focus:border-blue-700 focus:text-blue-500 focus:bg-blue-100"
|
|
260
260
|
},
|
|
261
261
|
filterActive: {
|
|
262
|
-
text: "shadow-button rounded-3xl border border-blue-700 text-blue-
|
|
262
|
+
text: "shadow-button rounded-3xl border border-blue-700 text-blue-500 bg-blue-100 shadow-button hover:bg-blue-700 hover:text-white active:text-white active:bg-blue-900 active:border-blue-900 focus:text-white focus:bg-blue-900 focus:border-blue-900"
|
|
263
263
|
}
|
|
264
264
|
};
|
|
265
265
|
var ButtonLink = forwardRef(
|
|
@@ -321,7 +321,7 @@ var ButtonLink = forwardRef(
|
|
|
321
321
|
"span",
|
|
322
322
|
{
|
|
323
323
|
style: { color: "var(--label)" },
|
|
324
|
-
className: "text-p-sm font-normal
|
|
324
|
+
className: "text-p-sm font-normal",
|
|
325
325
|
children: hotkeyLabel
|
|
326
326
|
}
|
|
327
327
|
),
|
|
@@ -353,7 +353,7 @@ var ButtonLink = forwardRef(
|
|
|
353
353
|
"span",
|
|
354
354
|
{
|
|
355
355
|
style: { color: "var(--label)" },
|
|
356
|
-
className: "text-p-sm font-normal
|
|
356
|
+
className: "text-p-sm font-normal",
|
|
357
357
|
children: hotkeyLabel
|
|
358
358
|
}
|
|
359
359
|
)
|
|
@@ -4282,7 +4282,304 @@ function DataTable({
|
|
|
4282
4282
|
)
|
|
4283
4283
|
] });
|
|
4284
4284
|
}
|
|
4285
|
+
var Accordion = ({ title, children, open = false }) => {
|
|
4286
|
+
const [isOpen, setOpen] = useState(open);
|
|
4287
|
+
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
|
|
4288
|
+
"div",
|
|
4289
|
+
{
|
|
4290
|
+
className: clsx9(
|
|
4291
|
+
{
|
|
4292
|
+
["border-neutral-200"]: !isOpen,
|
|
4293
|
+
["border-rose-700"]: isOpen
|
|
4294
|
+
},
|
|
4295
|
+
"flex flex-col w-full px-3 py-2 shadow-input border rounded-lg"
|
|
4296
|
+
),
|
|
4297
|
+
children: [
|
|
4298
|
+
/* @__PURE__ */ jsxs(
|
|
4299
|
+
"button",
|
|
4300
|
+
{
|
|
4301
|
+
onClick: () => {
|
|
4302
|
+
setOpen((state) => !state);
|
|
4303
|
+
},
|
|
4304
|
+
type: "button",
|
|
4305
|
+
className: "flex items-center justify-between w-full ",
|
|
4306
|
+
children: [
|
|
4307
|
+
/* @__PURE__ */ jsx("span", { children: title }),
|
|
4308
|
+
/* @__PURE__ */ jsx(
|
|
4309
|
+
"i",
|
|
4310
|
+
{
|
|
4311
|
+
className: clsx9(
|
|
4312
|
+
{
|
|
4313
|
+
["transform rotate-[180deg]"]: isOpen
|
|
4314
|
+
},
|
|
4315
|
+
"duration-300 uil uil-angle-down text-[30px]"
|
|
4316
|
+
)
|
|
4317
|
+
}
|
|
4318
|
+
)
|
|
4319
|
+
]
|
|
4320
|
+
}
|
|
4321
|
+
),
|
|
4322
|
+
/* @__PURE__ */ jsx(
|
|
4323
|
+
Transition,
|
|
4324
|
+
{
|
|
4325
|
+
show: isOpen,
|
|
4326
|
+
enter: "ease-in duration-300",
|
|
4327
|
+
enterFrom: "opacity-0",
|
|
4328
|
+
enterTo: "opacity-100",
|
|
4329
|
+
leave: "ease-out duration-300",
|
|
4330
|
+
leaveFrom: "opacity-100",
|
|
4331
|
+
leaveTo: "opacity-0",
|
|
4332
|
+
children: /* @__PURE__ */ jsx(
|
|
4333
|
+
"div",
|
|
4334
|
+
{
|
|
4335
|
+
className: `${isOpen ? "flex opacity-100" : "hidden opacity-0"} overflow-auto table-scroll`,
|
|
4336
|
+
children
|
|
4337
|
+
}
|
|
4338
|
+
)
|
|
4339
|
+
}
|
|
4340
|
+
)
|
|
4341
|
+
]
|
|
4342
|
+
}
|
|
4343
|
+
) });
|
|
4344
|
+
};
|
|
4345
|
+
function CopyPopover({ children, valueToCopy }) {
|
|
4346
|
+
const [copied, setCopied] = useState(false);
|
|
4347
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
4348
|
+
"div",
|
|
4349
|
+
{
|
|
4350
|
+
className: "flex items-center gap-1",
|
|
4351
|
+
onClick: async () => {
|
|
4352
|
+
setCopied(true);
|
|
4353
|
+
navigator.clipboard.writeText(valueToCopy);
|
|
4354
|
+
},
|
|
4355
|
+
onMouseLeave: () => setTimeout(() => setCopied(false), 500),
|
|
4356
|
+
children: [
|
|
4357
|
+
/* @__PURE__ */ jsxs(
|
|
4358
|
+
"div",
|
|
4359
|
+
{
|
|
4360
|
+
className: "flex items-center gap-1",
|
|
4361
|
+
"data-tooltip-id": "copy-id",
|
|
4362
|
+
"data-tooltip-content": copied ? "Copiado" : "Copiar",
|
|
4363
|
+
"data-tooltip-place": "top",
|
|
4364
|
+
children: [
|
|
4365
|
+
/* @__PURE__ */ jsx(Popover3, { id: "copy-id" }),
|
|
4366
|
+
/* @__PURE__ */ jsx("div", { className: "text-neutral-400 text-xs", children })
|
|
4367
|
+
]
|
|
4368
|
+
}
|
|
4369
|
+
),
|
|
4370
|
+
/* @__PURE__ */ jsxs(
|
|
4371
|
+
"div",
|
|
4372
|
+
{
|
|
4373
|
+
"data-tooltip-id": "icon-id",
|
|
4374
|
+
"data-tooltip-content": copied ? "Copiado" : "Copiar",
|
|
4375
|
+
"data-tooltip-place": "top",
|
|
4376
|
+
children: [
|
|
4377
|
+
/* @__PURE__ */ jsx(Popover3, { id: "icon-id" }),
|
|
4378
|
+
/* @__PURE__ */ jsx("i", { className: "uil uil-copy text-base text-blue-500 cursor-pointer -mt-[1px]" })
|
|
4379
|
+
]
|
|
4380
|
+
}
|
|
4381
|
+
)
|
|
4382
|
+
]
|
|
4383
|
+
}
|
|
4384
|
+
) });
|
|
4385
|
+
}
|
|
4386
|
+
var Menu = ({ triggerElement, children, className }) => {
|
|
4387
|
+
return /* @__PURE__ */ jsxs(Menu$1, { as: "div", className: "relative h-full cursor-pointer", children: [
|
|
4388
|
+
/* @__PURE__ */ jsx(
|
|
4389
|
+
MenuButton,
|
|
4390
|
+
{
|
|
4391
|
+
as: "div",
|
|
4392
|
+
className: "flex rounded-full text-sm h-full w-full items-center",
|
|
4393
|
+
children: triggerElement
|
|
4394
|
+
}
|
|
4395
|
+
),
|
|
4396
|
+
/* @__PURE__ */ jsx(
|
|
4397
|
+
Transition,
|
|
4398
|
+
{
|
|
4399
|
+
as: Fragment$1,
|
|
4400
|
+
enter: "transition ease-out duration-200",
|
|
4401
|
+
enterFrom: "transform opacity-0 scale-95",
|
|
4402
|
+
enterTo: "transform opacity-100 scale-100",
|
|
4403
|
+
leave: "transition ease-in duration-75",
|
|
4404
|
+
leaveFrom: "transform opacity-100 scale-100",
|
|
4405
|
+
leaveTo: "transform opacity-0 scale-95",
|
|
4406
|
+
children: /* @__PURE__ */ jsx(
|
|
4407
|
+
MenuItems,
|
|
4408
|
+
{
|
|
4409
|
+
className: `border-[0.5px] mt-1 color-neutral-300 flex min-w-[200px] flex-col gap-y-2 p-3 absolute right-0 z-[999] rounded-lg shadow-[2px_4px_8px_rgba(57,60,77,0.1)] bg-white cursor-default ${className}`,
|
|
4410
|
+
children
|
|
4411
|
+
}
|
|
4412
|
+
)
|
|
4413
|
+
}
|
|
4414
|
+
)
|
|
4415
|
+
] });
|
|
4416
|
+
};
|
|
4417
|
+
var Item = ({ index, isActive, onClick, children }) => {
|
|
4418
|
+
return /* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsx(
|
|
4419
|
+
"div",
|
|
4420
|
+
{
|
|
4421
|
+
className: clsx9(
|
|
4422
|
+
"h-[36px] p-2 rounded-lg items-center cursor-pointer flex whitespace-nowrap no-underline ",
|
|
4423
|
+
{
|
|
4424
|
+
"bg-[#009EDB] hover:bg-[#009EDB] hover:text-[#FFFFFF] text-[#FFFFFF]": isActive
|
|
4425
|
+
},
|
|
4426
|
+
{
|
|
4427
|
+
"hover:bg-neutral-100 text-paragraph": !isActive
|
|
4428
|
+
}
|
|
4429
|
+
),
|
|
4430
|
+
tabIndex: index,
|
|
4431
|
+
role: "button",
|
|
4432
|
+
onClick,
|
|
4433
|
+
children: /* @__PURE__ */ jsx("div", { className: "flex gap-2 w-full items-center whitespace-nowrap", children })
|
|
4434
|
+
}
|
|
4435
|
+
) }, index);
|
|
4436
|
+
};
|
|
4437
|
+
var EditableButton = ({
|
|
4438
|
+
children,
|
|
4439
|
+
button,
|
|
4440
|
+
onClose
|
|
4441
|
+
}) => {
|
|
4442
|
+
const [showModal, setShowModal] = useState(false);
|
|
4443
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col relative", children: [
|
|
4444
|
+
/* @__PURE__ */ jsx(
|
|
4445
|
+
"div",
|
|
4446
|
+
{
|
|
4447
|
+
className: "group flex gap-[5px] items-center cursor-pointer",
|
|
4448
|
+
onClick: () => setShowModal(!showModal),
|
|
4449
|
+
children: button
|
|
4450
|
+
}
|
|
4451
|
+
),
|
|
4452
|
+
showModal && /* @__PURE__ */ jsxs("div", { className: "max-w-[294px] p-2 bg-white border border-neutral-300 top-14 absolute z-50 rounded-lg", children: [
|
|
4453
|
+
/* @__PURE__ */ jsx("div", { className: "pb-3", children }),
|
|
4454
|
+
/* @__PURE__ */ jsxs("div", { className: "pt-3 pb-1 border-t border-neutral-200 flex items-center justify-end gap-2", children: [
|
|
4455
|
+
/* @__PURE__ */ jsx(
|
|
4456
|
+
Button,
|
|
4457
|
+
{
|
|
4458
|
+
variant: "secondary",
|
|
4459
|
+
size: "sm",
|
|
4460
|
+
onClick: () => setShowModal(false),
|
|
4461
|
+
children: "Cancelar"
|
|
4462
|
+
}
|
|
4463
|
+
),
|
|
4464
|
+
/* @__PURE__ */ jsx(
|
|
4465
|
+
Button,
|
|
4466
|
+
{
|
|
4467
|
+
variant: "primary",
|
|
4468
|
+
size: "sm",
|
|
4469
|
+
onClick: () => {
|
|
4470
|
+
setShowModal(false);
|
|
4471
|
+
if (onClose) onClose();
|
|
4472
|
+
},
|
|
4473
|
+
children: "Aplicar"
|
|
4474
|
+
}
|
|
4475
|
+
)
|
|
4476
|
+
] })
|
|
4477
|
+
] })
|
|
4478
|
+
] });
|
|
4479
|
+
};
|
|
4480
|
+
var EditableText = ({
|
|
4481
|
+
control,
|
|
4482
|
+
name = "",
|
|
4483
|
+
emptyLabel,
|
|
4484
|
+
children,
|
|
4485
|
+
onApply,
|
|
4486
|
+
value,
|
|
4487
|
+
hideEditIcon,
|
|
4488
|
+
truncate
|
|
4489
|
+
}) => {
|
|
4490
|
+
const [showModal, setShowModal] = useState(false);
|
|
4491
|
+
const truncateText = (str, max, len) => {
|
|
4492
|
+
return str.length > max ? str.substring(0, len) + "..." : str;
|
|
4493
|
+
};
|
|
4494
|
+
return /* @__PURE__ */ jsx(
|
|
4495
|
+
Controller,
|
|
4496
|
+
{
|
|
4497
|
+
control,
|
|
4498
|
+
name,
|
|
4499
|
+
render: ({ field }) => {
|
|
4500
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col relative", children: [
|
|
4501
|
+
/* @__PURE__ */ jsxs(
|
|
4502
|
+
"div",
|
|
4503
|
+
{
|
|
4504
|
+
className: "group flex gap-[5px] items-baseline cursor-pointer z-[500]",
|
|
4505
|
+
onClick: () => setShowModal(!showModal),
|
|
4506
|
+
children: [
|
|
4507
|
+
value && field.value ? /* @__PURE__ */ jsx(Fragment, { children: truncate ? value(truncateText(field.value, 14, 12)) : value(field.value) }) : field.value ? /* @__PURE__ */ jsx(
|
|
4508
|
+
"label",
|
|
4509
|
+
{
|
|
4510
|
+
className: clsx9(
|
|
4511
|
+
{
|
|
4512
|
+
["text-label"]: !field.value,
|
|
4513
|
+
["text-paragraph"]: field.value
|
|
4514
|
+
},
|
|
4515
|
+
"text-p-md group-hover:underline group-hover:underline-offset-[3px] cursor-pointer decoration-blue-500"
|
|
4516
|
+
),
|
|
4517
|
+
children: "Preenchido"
|
|
4518
|
+
}
|
|
4519
|
+
) : /* @__PURE__ */ jsx(
|
|
4520
|
+
"label",
|
|
4521
|
+
{
|
|
4522
|
+
className: clsx9(
|
|
4523
|
+
{
|
|
4524
|
+
["text-label"]: !field.value,
|
|
4525
|
+
["text-paragraph"]: field.value
|
|
4526
|
+
},
|
|
4527
|
+
"text-p-md group-hover:underline group-hover:underline-offset-[3px] cursor-pointer decoration-blue-500"
|
|
4528
|
+
),
|
|
4529
|
+
children: emptyLabel ? emptyLabel : "N\xE3o informado"
|
|
4530
|
+
}
|
|
4531
|
+
),
|
|
4532
|
+
!hideEditIcon && /* @__PURE__ */ jsx(
|
|
4533
|
+
"i",
|
|
4534
|
+
{
|
|
4535
|
+
style: { fontSize: "14px" },
|
|
4536
|
+
className: "uil uil-pen text-sm text-blue-500"
|
|
4537
|
+
}
|
|
4538
|
+
)
|
|
4539
|
+
]
|
|
4540
|
+
}
|
|
4541
|
+
),
|
|
4542
|
+
showModal && /* @__PURE__ */ jsxs("div", { children: [
|
|
4543
|
+
/* @__PURE__ */ jsxs("div", { className: "w-[160px] md:w-[294px] p-2 bg-white border border-neutral-300 absolute z-[500] rounded-lg", children: [
|
|
4544
|
+
/* @__PURE__ */ jsx("div", { className: "pb-3 ", children }),
|
|
4545
|
+
/* @__PURE__ */ jsxs("div", { className: "pt-3 pb-1 border-t border-neutral-200 flex flex-col md:flex-row md:items-center md:justify-end gap-2", children: [
|
|
4546
|
+
/* @__PURE__ */ jsx(
|
|
4547
|
+
Button,
|
|
4548
|
+
{
|
|
4549
|
+
variant: "secondary",
|
|
4550
|
+
size: "sm",
|
|
4551
|
+
onClick: () => setShowModal(false),
|
|
4552
|
+
children: "Cancelar"
|
|
4553
|
+
}
|
|
4554
|
+
),
|
|
4555
|
+
/* @__PURE__ */ jsx(
|
|
4556
|
+
Button,
|
|
4557
|
+
{
|
|
4558
|
+
variant: "primary",
|
|
4559
|
+
size: "sm",
|
|
4560
|
+
onClick: () => {
|
|
4561
|
+
setShowModal(false);
|
|
4562
|
+
onApply && onApply();
|
|
4563
|
+
},
|
|
4564
|
+
children: "Salvar"
|
|
4565
|
+
}
|
|
4566
|
+
)
|
|
4567
|
+
] })
|
|
4568
|
+
] }),
|
|
4569
|
+
/* @__PURE__ */ jsx(
|
|
4570
|
+
"div",
|
|
4571
|
+
{
|
|
4572
|
+
className: "fixed top-0 bottom-0 left-0 right-0 z-40",
|
|
4573
|
+
onClick: () => setShowModal(false)
|
|
4574
|
+
}
|
|
4575
|
+
)
|
|
4576
|
+
] })
|
|
4577
|
+
] });
|
|
4578
|
+
}
|
|
4579
|
+
}
|
|
4580
|
+
);
|
|
4581
|
+
};
|
|
4285
4582
|
|
|
4286
|
-
export { Badge, Button, ButtonLink, Calendar, Checkbox, DataTable, DataTablePagination, DatePickerInput, FilterCalendar, FilterOptions, Input, InputMoney, InputNumber, InputPercentage, Logo, MaskedInput, ModalDialog, PaginationSelect, Popover3 as Popover, Radio, RocketIcon, SelectField, SelectFieldBip, SpinnerIcon, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Toggle, ValueContainer, sizes2 as sizes };
|
|
4583
|
+
export { Accordion, Badge, Button, ButtonLink, Calendar, Checkbox, CopyPopover, DataTable, DataTablePagination, DatePickerInput, EditableButton, EditableText, FilterCalendar, FilterOptions, Input, InputMoney, InputNumber, InputPercentage, Item, Logo, MaskedInput, Menu, ModalDialog, PaginationSelect, Popover3 as Popover, Radio, RocketIcon, SelectField, SelectFieldBip, SpinnerIcon, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Toggle, ValueContainer, sizes2 as sizes };
|
|
4287
4584
|
//# sourceMappingURL=index.js.map
|
|
4288
4585
|
//# sourceMappingURL=index.js.map
|