nexaas-ui-components 1.0.17 → 1.0.19
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/README.md +75 -0
- package/dist/index.cjs +771 -190
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.cts +138 -10
- package/dist/index.d.ts +138 -10
- package/dist/index.js +703 -125
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var React4 = require('react');
|
|
3
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var
|
|
5
|
+
var clsx9 = require('clsx');
|
|
5
6
|
var datetime2 = require('@blueprintjs/datetime2');
|
|
6
|
-
var React2 = require('react');
|
|
7
7
|
var reactHookForm = require('react-hook-form');
|
|
8
8
|
var zustand = require('zustand');
|
|
9
9
|
var dateFns = require('date-fns');
|
|
@@ -39,45 +39,31 @@ function _interopNamespace(e) {
|
|
|
39
39
|
return Object.freeze(n);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
var
|
|
43
|
-
var
|
|
42
|
+
var React4__namespace = /*#__PURE__*/_interopNamespace(React4);
|
|
43
|
+
var clsx9__default = /*#__PURE__*/_interopDefault(clsx9);
|
|
44
44
|
var IntlCurrencyInputRaw__default = /*#__PURE__*/_interopDefault(IntlCurrencyInputRaw);
|
|
45
45
|
var lodashNamespace__namespace = /*#__PURE__*/_interopNamespace(lodashNamespace);
|
|
46
46
|
var InputMask__default = /*#__PURE__*/_interopDefault(InputMask);
|
|
47
47
|
var ReactModalNamespace__namespace = /*#__PURE__*/_interopNamespace(ReactModalNamespace);
|
|
48
48
|
var AsyncSelect__default = /*#__PURE__*/_interopDefault(AsyncSelect);
|
|
49
49
|
|
|
50
|
-
// src/
|
|
51
|
-
var SpinnerIcon = (props) => /* @__PURE__ */ jsxRuntime.
|
|
50
|
+
// src/components/Button.tsx
|
|
51
|
+
var SpinnerIcon = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
52
52
|
"svg",
|
|
53
53
|
{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
...props,
|
|
55
|
+
width: `${props.width || 33}`,
|
|
56
|
+
height: `${props.height || 33}`,
|
|
57
|
+
viewBox: "0 0 33 33",
|
|
57
58
|
fill: "none",
|
|
58
59
|
xmlns: "http://www.w3.org/2000/svg",
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
cy: "12",
|
|
67
|
-
r: "10",
|
|
68
|
-
stroke: "currentColor",
|
|
69
|
-
strokeWidth: "4"
|
|
70
|
-
}
|
|
71
|
-
),
|
|
72
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
73
|
-
"path",
|
|
74
|
-
{
|
|
75
|
-
className: "opacity-75",
|
|
76
|
-
fill: "currentColor",
|
|
77
|
-
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"
|
|
78
|
-
}
|
|
79
|
-
)
|
|
80
|
-
]
|
|
60
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
61
|
+
"path",
|
|
62
|
+
{
|
|
63
|
+
d: "M21.4671 32.1821C18.269 33.1951 14.8378 33.2061 11.6333 32.2137C8.42885 31.2213 5.6044 29.2729 3.53866 26.6297C1.47293 23.9866 0.264665 20.7751 0.0758752 17.4258C-0.112914 14.0765 0.726798 10.7495 2.48242 7.89096C4.23804 5.03242 6.82565 2.77896 9.89828 1.43272C12.9709 0.0864894 16.3817 -0.288163 19.6733 0.359002C22.9649 1.00617 25.98 2.64421 28.3142 5.0535C30.6485 7.46279 32.1903 10.5282 32.7331 13.8386L28.9102 14.4653C28.4953 11.9345 27.3165 9.59102 25.532 7.74911C23.7474 5.9072 21.4424 4.65491 18.926 4.16015C16.4095 3.66539 13.802 3.95181 11.4529 4.98101C9.10388 6.01021 7.12564 7.73299 5.78346 9.91835C4.44128 12.1037 3.79932 14.6472 3.94365 17.2077C4.08798 19.7683 5.01171 22.2235 6.59097 24.2442C8.17023 26.2649 10.3295 27.7544 12.7794 28.5132C15.2292 29.2719 17.8524 29.2634 20.2973 28.489L21.4671 32.1821Z",
|
|
64
|
+
fill: "#009EDB"
|
|
65
|
+
}
|
|
66
|
+
)
|
|
81
67
|
}
|
|
82
68
|
);
|
|
83
69
|
var sizes = {
|
|
@@ -130,9 +116,6 @@ var variants = {
|
|
|
130
116
|
blue: {
|
|
131
117
|
text: "shadow-button bg-blue-500 text-white text-bold"
|
|
132
118
|
},
|
|
133
|
-
link: {
|
|
134
|
-
text: "text-left text-blue-500 hover:text-blue-600 hover:underline active:text-blue-600 disabled:text-blue-500 disabled:no-underline shadow-none font-normal disabled:opacity-50"
|
|
135
|
-
},
|
|
136
119
|
iconSecondary: {
|
|
137
120
|
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"
|
|
138
121
|
},
|
|
@@ -165,6 +148,8 @@ var paddingConfig = {
|
|
|
165
148
|
var Button = ({
|
|
166
149
|
variant = "primary",
|
|
167
150
|
size = "lg",
|
|
151
|
+
hotkey,
|
|
152
|
+
hotkeyPosition = "bottom",
|
|
168
153
|
...props
|
|
169
154
|
}) => {
|
|
170
155
|
const applyGap = props.icon && props.children;
|
|
@@ -172,14 +157,47 @@ var Button = ({
|
|
|
172
157
|
const appliedSize = sizes[size];
|
|
173
158
|
const appliedPadding = props.icon ? paddingConfig[size].icon : paddingConfig[size].normal;
|
|
174
159
|
const gapText = applyGap ? "gap-[6px]" : "gap-0";
|
|
175
|
-
|
|
176
|
-
|
|
160
|
+
React4.useEffect(() => {
|
|
161
|
+
if (!hotkey || !props.onClick) return;
|
|
162
|
+
const handleKeyDown = (event) => {
|
|
163
|
+
var _a;
|
|
164
|
+
if (props.disabled || props.loading) return;
|
|
165
|
+
const keys = hotkey.toLowerCase().split("+").map((k) => k.trim());
|
|
166
|
+
const primaryKey = keys.pop();
|
|
167
|
+
if (!primaryKey) return;
|
|
168
|
+
const requiredCtrl = keys.includes("ctrl");
|
|
169
|
+
const requiredAlt = keys.includes("alt");
|
|
170
|
+
const requiredShift = keys.includes("shift");
|
|
171
|
+
const requiredMeta = keys.includes("meta") || keys.includes("cmd");
|
|
172
|
+
const match = event.key.toLowerCase() === primaryKey && event.ctrlKey === requiredCtrl && event.altKey === requiredAlt && event.shiftKey === requiredShift && event.metaKey === requiredMeta;
|
|
173
|
+
if (match) {
|
|
174
|
+
event.preventDefault();
|
|
175
|
+
(_a = props.onClick) == null ? void 0 : _a.call(props, event);
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
179
|
+
return () => {
|
|
180
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
181
|
+
};
|
|
182
|
+
}, [hotkey, props.onClick, props.disabled, props.loading]);
|
|
183
|
+
const hotkeyLabel = hotkey && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-p-sm font-normal", children: hotkey.toUpperCase() });
|
|
184
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
185
|
+
"div",
|
|
177
186
|
{
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
187
|
+
className: clsx9__default.default("inline-flex gap-[8px]", {
|
|
188
|
+
"flex-col items-center": hotkeyPosition === "top" || hotkeyPosition === "bottom",
|
|
189
|
+
"flex-row items-center": hotkeyPosition === "left" || hotkeyPosition === "right"
|
|
190
|
+
}),
|
|
191
|
+
children: [
|
|
192
|
+
hotkey && (hotkeyPosition === "top" || hotkeyPosition === "left") && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "var(--label)" }, className: "text-p-sm font-normal -mt-[5px]", children: hotkeyLabel }),
|
|
193
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
194
|
+
"button",
|
|
195
|
+
{
|
|
196
|
+
type: props.type,
|
|
197
|
+
id: "button-component",
|
|
198
|
+
...props,
|
|
199
|
+
disabled: props.disabled || props.loading,
|
|
200
|
+
className: `
|
|
183
201
|
${props.className}
|
|
184
202
|
${appliedVariant}
|
|
185
203
|
${appliedSize.text}
|
|
@@ -187,20 +205,193 @@ var Button = ({
|
|
|
187
205
|
${gapText}
|
|
188
206
|
whitespace-nowrap group rounded-lg font-bold disabled:shadow-none active:shadow-none flex items-center
|
|
189
207
|
`,
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
208
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
209
|
+
props.icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
210
|
+
"div",
|
|
211
|
+
{
|
|
212
|
+
className: `flex items-center justify-center ${appliedSize.icon}`,
|
|
213
|
+
children: props.icon && !props.loading ? props.icon : props.loadingIcon && props.loading ? props.loadingIcon : /* @__PURE__ */ jsxRuntime.jsx(SpinnerIcon, { className: "animate-spin" })
|
|
214
|
+
}
|
|
215
|
+
),
|
|
216
|
+
props.children,
|
|
217
|
+
props.dropdown && /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-angle-down text-[18px]" })
|
|
218
|
+
] })
|
|
196
219
|
}
|
|
197
220
|
),
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
221
|
+
hotkey && (hotkeyPosition === "bottom" || hotkeyPosition === "right") && /* @__PURE__ */ jsxRuntime.jsx(
|
|
222
|
+
"span",
|
|
223
|
+
{
|
|
224
|
+
style: { color: "var(--label)" },
|
|
225
|
+
className: "text-p-sm font-normal -mt-[5px]",
|
|
226
|
+
children: hotkeyLabel
|
|
227
|
+
}
|
|
228
|
+
)
|
|
229
|
+
]
|
|
201
230
|
}
|
|
202
231
|
);
|
|
203
232
|
};
|
|
233
|
+
var sizes2 = {
|
|
234
|
+
xxs: {
|
|
235
|
+
text: "min-h-[14px] max-h-[40px]"
|
|
236
|
+
},
|
|
237
|
+
xs: {
|
|
238
|
+
text: "h-[36px]"
|
|
239
|
+
},
|
|
240
|
+
sm: {
|
|
241
|
+
text: "h-[40px]"
|
|
242
|
+
},
|
|
243
|
+
md: {
|
|
244
|
+
text: "h-[46px]"
|
|
245
|
+
},
|
|
246
|
+
table: {
|
|
247
|
+
text: "h-8 w-8"
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
var variants2 = {
|
|
251
|
+
primary: {
|
|
252
|
+
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]"
|
|
253
|
+
},
|
|
254
|
+
secondary: {
|
|
255
|
+
text: "shadow-button bg-white border-[0.5px] border-paragraph text-dark-blue-600 hover:text-dark-blue-600 hover:bg-[#f5f5f5] active:bg-light-gray-100 disabled:text-dark-blue-400 disabled:bg-white disabled:border-[0.5px] disabled:border-dark-blue-400"
|
|
256
|
+
},
|
|
257
|
+
link: {
|
|
258
|
+
text: "text-blue-700 hover:text-blue-800 hover:underline active:text-blue-900 active:underline disabled:text-blue-700 disabled:no-underline shadow-none font-normal"
|
|
259
|
+
},
|
|
260
|
+
icon: {
|
|
261
|
+
text: "bg-white border-[0.5px] border-dark-blue-300 hover:bg-[#f5f5f5] active:bg-light-gray-100 hover:text-paragraph disabled:text-dark-blue-400 disabled:border-[0.5px] disabled:border-disabled disabled:bg-white disabled:opacity-50"
|
|
262
|
+
},
|
|
263
|
+
iconSecondary: {
|
|
264
|
+
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"
|
|
265
|
+
},
|
|
266
|
+
outline: {
|
|
267
|
+
text: "shadow-button bg-white border-[0.5px] border-rose-700 text-rose-700 hover:bg-[#f5f5f5] active:bg-light-gray-100 disabled:text-rose-700 disabled:bg-white disabled:border-[0.5px] disabled:border-rose-700 disabled:opacity-50"
|
|
268
|
+
},
|
|
269
|
+
dark: {
|
|
270
|
+
text: "shadow-button text-white hover:bg-[#f5f5f526] active:bg-[#0a0a0a40] disabled:opacity-50 disabled:bg-transparent"
|
|
271
|
+
},
|
|
272
|
+
dangerLight: {
|
|
273
|
+
text: "shadow-button text-dangerous-700 font-bold bg-white border-[0.5px] border-dangerous-700 hover:bg-dangerous-100 active:bg-dangerous-700 active:text-white disabled:opacity-50 disabled:bg-white disabled:text-dangerous-700"
|
|
274
|
+
},
|
|
275
|
+
danger: {
|
|
276
|
+
text: "shadow-button text-white bg-gradient-to-b from-danger-start to-danger-end hover:from-[#FD6363] hover:to-[#E34E4E] active:from-dangerous-800 active:to-dangerous-800 disabled:opacity-50 disabled:from-dangerous-700 disabled:to-dangerous-700"
|
|
277
|
+
},
|
|
278
|
+
success: {
|
|
279
|
+
text: "shadow-button text-white bg-gradient-to-b from-success-start to-success-end hover:from-[#3FF09B] hover:to-[#27C579] active:from-success-800 active:to-success-800 disabled:opacity-50 disabled:from-success-700 disabled:to-success-700"
|
|
280
|
+
},
|
|
281
|
+
warn: {
|
|
282
|
+
text: "shadow-button text-white bg-gradient-to-b from-warning-start to-warning-end hover:from-[#FEBD5D] hover:to-[#F4A42D] active:from-warning-800 active:to-warning-800 disabled:opacity-50 disabled:from-warning-700 disabled:to-warning-700"
|
|
283
|
+
},
|
|
284
|
+
blue: {
|
|
285
|
+
text: "shadow-button bg-blue-700 text-white text-bold"
|
|
286
|
+
},
|
|
287
|
+
filter: {
|
|
288
|
+
text: "shadow-button rounded-3xl border border-dark-blue-300 text-paragraph shadow-button hover:bg-light-gray-100 active:border active:border-blue-700 active:text-blue-700 active:bg-blue-100 focus:border focus:border-blue-700 focus:text-blue-700 focus:bg-blue-100"
|
|
289
|
+
},
|
|
290
|
+
filterActive: {
|
|
291
|
+
text: "shadow-button rounded-3xl border border-blue-700 text-blue-700 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"
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
var ButtonLink = React4.forwardRef(
|
|
295
|
+
({
|
|
296
|
+
size = "md",
|
|
297
|
+
icon,
|
|
298
|
+
padding = "px-3",
|
|
299
|
+
label,
|
|
300
|
+
disabled,
|
|
301
|
+
name,
|
|
302
|
+
target,
|
|
303
|
+
variant = "link",
|
|
304
|
+
className,
|
|
305
|
+
as: LinkComponent = "a",
|
|
306
|
+
hotkey,
|
|
307
|
+
hotkeyPosition = "bottom",
|
|
308
|
+
...props
|
|
309
|
+
}, ref) => {
|
|
310
|
+
var _a;
|
|
311
|
+
const applyGap = icon;
|
|
312
|
+
React4.useEffect(() => {
|
|
313
|
+
if (!hotkey) return;
|
|
314
|
+
const handleKeyDown = (event) => {
|
|
315
|
+
var _a2;
|
|
316
|
+
if (disabled) return;
|
|
317
|
+
const keys = hotkey.toLowerCase().split("+").map((k) => k.trim());
|
|
318
|
+
const primaryKey = keys.pop();
|
|
319
|
+
if (!primaryKey) return;
|
|
320
|
+
const requiredCtrl = keys.includes("ctrl");
|
|
321
|
+
const requiredAlt = keys.includes("alt");
|
|
322
|
+
const requiredShift = keys.includes("shift");
|
|
323
|
+
const requiredMeta = keys.includes("meta") || keys.includes("cmd");
|
|
324
|
+
const match = event.key.toLowerCase() === primaryKey && event.ctrlKey === requiredCtrl && event.altKey === requiredAlt && event.shiftKey === requiredShift && event.metaKey === requiredMeta;
|
|
325
|
+
if (match) {
|
|
326
|
+
event.preventDefault();
|
|
327
|
+
if (props.onClick) {
|
|
328
|
+
(_a2 = props.onClick) == null ? void 0 : _a2.call(props, event);
|
|
329
|
+
} else {
|
|
330
|
+
const linkElement = document.querySelector(`a[href="${props.href}"]`);
|
|
331
|
+
linkElement == null ? void 0 : linkElement.click();
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
336
|
+
return () => {
|
|
337
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
338
|
+
};
|
|
339
|
+
}, [hotkey, props.onClick, props.href, disabled]);
|
|
340
|
+
const hotkeyLabel = hotkey && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-p-sm font-normal", children: hotkey.toUpperCase() });
|
|
341
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
342
|
+
"div",
|
|
343
|
+
{
|
|
344
|
+
className: clsx9__default.default("inline-flex gap-[8px]", {
|
|
345
|
+
"flex-col items-center justify-center": hotkeyPosition === "top" || hotkeyPosition === "bottom",
|
|
346
|
+
"flex-row items-center justify-center": hotkeyPosition === "left" || hotkeyPosition === "right"
|
|
347
|
+
}),
|
|
348
|
+
children: [
|
|
349
|
+
hotkey && (hotkeyPosition === "top" || hotkeyPosition === "left") && /* @__PURE__ */ jsxRuntime.jsx(
|
|
350
|
+
"span",
|
|
351
|
+
{
|
|
352
|
+
style: { color: "var(--label)" },
|
|
353
|
+
className: "text-p-sm font-normal -mt-[5px]",
|
|
354
|
+
children: hotkeyLabel
|
|
355
|
+
}
|
|
356
|
+
),
|
|
357
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
358
|
+
LinkComponent,
|
|
359
|
+
{
|
|
360
|
+
ref,
|
|
361
|
+
className: clsx9__default.default(
|
|
362
|
+
{
|
|
363
|
+
[(_a = variants2[variant]) == null ? void 0 : _a.text]: true,
|
|
364
|
+
[sizes2[size].text]: true,
|
|
365
|
+
["pointer-events-none shadow-none text-label"]: disabled,
|
|
366
|
+
["px-2"]: variant !== "link"
|
|
367
|
+
},
|
|
368
|
+
`group rounded-lg font-bold active:shadow-none font-title flex items-center justify-start cursor-pointer
|
|
369
|
+
${applyGap ? "gap-2" : "gap-0"} ${className}
|
|
370
|
+
`
|
|
371
|
+
),
|
|
372
|
+
target,
|
|
373
|
+
...props,
|
|
374
|
+
download: name,
|
|
375
|
+
children: [
|
|
376
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[20px] flex items-center justify-center", children: icon }),
|
|
377
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "cursor-pointer line-clamp-2", children: label })
|
|
378
|
+
]
|
|
379
|
+
}
|
|
380
|
+
),
|
|
381
|
+
hotkey && (hotkeyPosition === "bottom" || hotkeyPosition === "right") && /* @__PURE__ */ jsxRuntime.jsx(
|
|
382
|
+
"span",
|
|
383
|
+
{
|
|
384
|
+
style: { color: "var(--label)" },
|
|
385
|
+
className: "text-p-sm font-normal -mt-[5px]",
|
|
386
|
+
children: hotkeyLabel
|
|
387
|
+
}
|
|
388
|
+
)
|
|
389
|
+
]
|
|
390
|
+
}
|
|
391
|
+
);
|
|
392
|
+
}
|
|
393
|
+
);
|
|
394
|
+
ButtonLink.displayName = "ButtonLink";
|
|
204
395
|
var Input = ({
|
|
205
396
|
label,
|
|
206
397
|
type,
|
|
@@ -251,7 +442,7 @@ var Input = ({
|
|
|
251
442
|
value,
|
|
252
443
|
defaultValue,
|
|
253
444
|
style: !label && placeholder && icon || icon ? inlineStyles.inputWithIcon : void 0,
|
|
254
|
-
className:
|
|
445
|
+
className: clsx9__default.default({
|
|
255
446
|
[styles.error]: hasError,
|
|
256
447
|
[styles.input]: true,
|
|
257
448
|
["pr-10"]: clearField,
|
|
@@ -272,14 +463,14 @@ var Input = ({
|
|
|
272
463
|
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
273
464
|
"div",
|
|
274
465
|
{
|
|
275
|
-
className:
|
|
466
|
+
className: clsx9__default.default(styles.icon, "flex justify-center items-center"),
|
|
276
467
|
children: icon
|
|
277
468
|
}
|
|
278
469
|
),
|
|
279
470
|
hideInput && /* @__PURE__ */ jsxRuntime.jsx(
|
|
280
471
|
"div",
|
|
281
472
|
{
|
|
282
|
-
className:
|
|
473
|
+
className: clsx9__default.default(
|
|
283
474
|
styles.rightIcon,
|
|
284
475
|
"flex justify-center items-center"
|
|
285
476
|
),
|
|
@@ -290,7 +481,7 @@ var Input = ({
|
|
|
290
481
|
"label",
|
|
291
482
|
{
|
|
292
483
|
style: icon ? inlineStyles.labelWithIcon : void 0,
|
|
293
|
-
className:
|
|
484
|
+
className: clsx9__default.default(
|
|
294
485
|
{
|
|
295
486
|
[styles.label]: true,
|
|
296
487
|
["left-2.5"]: !icon
|
|
@@ -307,7 +498,7 @@ var Input = ({
|
|
|
307
498
|
clearField && value && value !== "" && !disabled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
308
499
|
"i",
|
|
309
500
|
{
|
|
310
|
-
className:
|
|
501
|
+
className: clsx9__default.default(
|
|
311
502
|
{
|
|
312
503
|
[styles.clear]: true
|
|
313
504
|
},
|
|
@@ -433,7 +624,7 @@ var useFieldErrorsStore = zustand.create(
|
|
|
433
624
|
}))
|
|
434
625
|
})
|
|
435
626
|
);
|
|
436
|
-
var DatePickerInput =
|
|
627
|
+
var DatePickerInput = React4.forwardRef(
|
|
437
628
|
({
|
|
438
629
|
icon,
|
|
439
630
|
label,
|
|
@@ -454,12 +645,12 @@ var DatePickerInput = React2.forwardRef(
|
|
|
454
645
|
popoverOffset
|
|
455
646
|
}, ref) => {
|
|
456
647
|
var _a;
|
|
457
|
-
const [invalidDate, setInvalidDate] =
|
|
458
|
-
const [showCalendar, setShowCalendar] =
|
|
459
|
-
const [inputWidth, setInputWidth] =
|
|
460
|
-
const inputContainerRef =
|
|
648
|
+
const [invalidDate, setInvalidDate] = React4.useState(false);
|
|
649
|
+
const [showCalendar, setShowCalendar] = React4.useState(false);
|
|
650
|
+
const [inputWidth, setInputWidth] = React4.useState(0);
|
|
651
|
+
const inputContainerRef = React4.useRef(null);
|
|
461
652
|
const dateFnsFormat = "dd/MM/yyyy";
|
|
462
|
-
|
|
653
|
+
React4.useEffect(() => {
|
|
463
654
|
const updateWidth = () => {
|
|
464
655
|
if (inputContainerRef.current) {
|
|
465
656
|
setInputWidth(inputContainerRef.current.offsetWidth + 10);
|
|
@@ -512,7 +703,7 @@ var DatePickerInput = React2.forwardRef(
|
|
|
512
703
|
"div",
|
|
513
704
|
{
|
|
514
705
|
id: "icon",
|
|
515
|
-
className:
|
|
706
|
+
className: clsx9__default.default(
|
|
516
707
|
styles.icon,
|
|
517
708
|
"flex justify-center items-center text-[20px] bg-gray-100"
|
|
518
709
|
),
|
|
@@ -559,7 +750,7 @@ var DatePickerInput = React2.forwardRef(
|
|
|
559
750
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
560
751
|
"label",
|
|
561
752
|
{
|
|
562
|
-
className:
|
|
753
|
+
className: clsx9__default.default(
|
|
563
754
|
"pointer-events-none ",
|
|
564
755
|
styles.label,
|
|
565
756
|
`
|
|
@@ -576,7 +767,7 @@ var DatePickerInput = React2.forwardRef(
|
|
|
576
767
|
clearField && (field == null ? void 0 : field.value) && (field == null ? void 0 : field.value) !== "" && !disabled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
577
768
|
"i",
|
|
578
769
|
{
|
|
579
|
-
className:
|
|
770
|
+
className: clsx9__default.default(
|
|
580
771
|
{
|
|
581
772
|
[styles.clear]: true
|
|
582
773
|
},
|
|
@@ -611,7 +802,7 @@ var DatePickerInput = React2.forwardRef(
|
|
|
611
802
|
] });
|
|
612
803
|
}
|
|
613
804
|
);
|
|
614
|
-
var
|
|
805
|
+
var variants3 = {
|
|
615
806
|
success: "bg-success-100 text-success-600",
|
|
616
807
|
warning: "bg-warning-100 text-warning-600",
|
|
617
808
|
blue: "bg-blue-100 text-blue-500",
|
|
@@ -633,8 +824,8 @@ var Badge = ({
|
|
|
633
824
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
634
825
|
"span",
|
|
635
826
|
{
|
|
636
|
-
className:
|
|
637
|
-
{ [
|
|
827
|
+
className: clsx9__default.default(
|
|
828
|
+
{ [variants3[variant]]: (variant == null ? void 0 : variant.length) > 0 },
|
|
638
829
|
"py-1 px-2 text-p-md font-normal inline-flex items-center justify-center gap-1 rounded-full text-center",
|
|
639
830
|
className
|
|
640
831
|
),
|
|
@@ -908,7 +1099,7 @@ var Checkbox = ({
|
|
|
908
1099
|
id: registration ? registration.name : key,
|
|
909
1100
|
disabled,
|
|
910
1101
|
type: "checkbox",
|
|
911
|
-
className:
|
|
1102
|
+
className: clsx9__default.default(
|
|
912
1103
|
"disabled:hover:bg-neutral-100 disabled:cursor-default cursor-pointer h-[16px] w-[16px] rounded-[2.5px] border border-neutral-200 text-blue-500 focus:rounded-[4px] focus:border-[1.5px] focus:ring-blue-500 focus-visible:ring-blue-500 checked:after:text-blue-500 disabled:bg-neutral-100"
|
|
913
1104
|
)
|
|
914
1105
|
}
|
|
@@ -940,8 +1131,8 @@ var FilterCalendar = ({
|
|
|
940
1131
|
filterOpen: "rounded-3xl shadow-input border border-blue-500 bg-blue-100 text-blue-500",
|
|
941
1132
|
filterActive: "rounded-3xl border border-blue-500 text-blue-500 bg-blue-100 shadow-input hover:bg-blue-500 hover:text-white active:text-white active:bg-blue-600 active:border-blue-600"
|
|
942
1133
|
};
|
|
943
|
-
const [currentValue, setCurrentValue] =
|
|
944
|
-
const [calendarLabel, setCalendarLabel] =
|
|
1134
|
+
const [currentValue, setCurrentValue] = React4.useState([]);
|
|
1135
|
+
const [calendarLabel, setCalendarLabel] = React4.useState("");
|
|
945
1136
|
const isMobileSize = (window == null ? void 0 : window.innerWidth) < 768;
|
|
946
1137
|
const shorcuts = [
|
|
947
1138
|
{
|
|
@@ -1102,7 +1293,7 @@ var FilterCalendar = ({
|
|
|
1102
1293
|
]
|
|
1103
1294
|
}
|
|
1104
1295
|
];
|
|
1105
|
-
const [selectedShortcut, setSelectedShortcut] =
|
|
1296
|
+
const [selectedShortcut, setSelectedShortcut] = React4.useState(
|
|
1106
1297
|
defaultShortcut || shorcuts[0]
|
|
1107
1298
|
);
|
|
1108
1299
|
const calendar = /* @__PURE__ */ jsxRuntime.jsx("div", { id: "group-input-calendar", className: "relative", children: rangeCalendar ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1174,7 +1365,7 @@ var FilterCalendar = ({
|
|
|
1174
1365
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1175
1366
|
react.Popover,
|
|
1176
1367
|
{
|
|
1177
|
-
className:
|
|
1368
|
+
className: clsx9__default.default(
|
|
1178
1369
|
{ ["w-full"]: isMobileSize },
|
|
1179
1370
|
"relative text-paragraph"
|
|
1180
1371
|
),
|
|
@@ -1184,7 +1375,7 @@ var FilterCalendar = ({
|
|
|
1184
1375
|
/* @__PURE__ */ jsxRuntime.jsx(react$1.Float.Reference, { children: /* @__PURE__ */ jsxRuntime.jsx(react.PopoverButton, { as: "button", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1185
1376
|
"div",
|
|
1186
1377
|
{
|
|
1187
|
-
className:
|
|
1378
|
+
className: clsx9__default.default(
|
|
1188
1379
|
{
|
|
1189
1380
|
[style.filter]: !hasValue && !open,
|
|
1190
1381
|
[style.filterOpen]: open && !hasValue,
|
|
@@ -1196,7 +1387,7 @@ var FilterCalendar = ({
|
|
|
1196
1387
|
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1197
1388
|
"div",
|
|
1198
1389
|
{
|
|
1199
|
-
className:
|
|
1390
|
+
className: clsx9__default.default({
|
|
1200
1391
|
["text-label group-active:text-blue-500"]: !field.value && !open,
|
|
1201
1392
|
["text-blue-500"]: open && !field.value,
|
|
1202
1393
|
["text-blue-500 group-hover:text-white group-active:text-white"]: open && field.value
|
|
@@ -1207,7 +1398,7 @@ var FilterCalendar = ({
|
|
|
1207
1398
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1208
1399
|
"label",
|
|
1209
1400
|
{
|
|
1210
|
-
className:
|
|
1401
|
+
className: clsx9__default.default(
|
|
1211
1402
|
{
|
|
1212
1403
|
["text-paragraph group-active:text-blue-500"]: !field.value && !open,
|
|
1213
1404
|
["text-blue-500"]: open && !field.value,
|
|
@@ -1223,7 +1414,7 @@ var FilterCalendar = ({
|
|
|
1223
1414
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1224
1415
|
"i",
|
|
1225
1416
|
{
|
|
1226
|
-
className:
|
|
1417
|
+
className: clsx9__default.default(
|
|
1227
1418
|
{
|
|
1228
1419
|
["text-label group-active:text-blue-500"]: !field.value && !open,
|
|
1229
1420
|
["text-blue-500"]: open && !field.value,
|
|
@@ -1241,7 +1432,7 @@ var FilterCalendar = ({
|
|
|
1241
1432
|
setCurrentValue(field.value);
|
|
1242
1433
|
close();
|
|
1243
1434
|
};
|
|
1244
|
-
|
|
1435
|
+
React4.useEffect(() => {
|
|
1245
1436
|
setCurrentValue(field.value);
|
|
1246
1437
|
}, [open]);
|
|
1247
1438
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
@@ -1250,7 +1441,7 @@ var FilterCalendar = ({
|
|
|
1250
1441
|
onClear && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mr-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1251
1442
|
Button,
|
|
1252
1443
|
{
|
|
1253
|
-
variant: "
|
|
1444
|
+
variant: "secondary",
|
|
1254
1445
|
size: "xxs",
|
|
1255
1446
|
onClick: () => {
|
|
1256
1447
|
if (onClear) {
|
|
@@ -1317,7 +1508,7 @@ function InputSmall({
|
|
|
1317
1508
|
onClear,
|
|
1318
1509
|
collapsed
|
|
1319
1510
|
}) {
|
|
1320
|
-
const inputRef =
|
|
1511
|
+
const inputRef = React4.useRef(null);
|
|
1321
1512
|
const styles = {
|
|
1322
1513
|
input: `text-p-md text-paragraph w-full outline-none placeholder:text-label`,
|
|
1323
1514
|
icon: "text-label group-focus-within:text-neutral-600 m-[10px]",
|
|
@@ -1325,8 +1516,8 @@ function InputSmall({
|
|
|
1325
1516
|
clear: "pr-[5px] cursor-pointer text-label text-[16px]"
|
|
1326
1517
|
};
|
|
1327
1518
|
const elem = inputRef == null ? void 0 : inputRef.current;
|
|
1328
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
1329
|
-
icon && !searchOnClick && /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
1519
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx9__default.default(styles.wrapper), children: [
|
|
1520
|
+
icon && !searchOnClick && /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx9__default.default(styles.icon), children: icon }),
|
|
1330
1521
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1331
1522
|
"input",
|
|
1332
1523
|
{
|
|
@@ -1334,7 +1525,7 @@ function InputSmall({
|
|
|
1334
1525
|
...inputProps,
|
|
1335
1526
|
type: "search-text",
|
|
1336
1527
|
ref: inputRef,
|
|
1337
|
-
className:
|
|
1528
|
+
className: clsx9__default.default(
|
|
1338
1529
|
{
|
|
1339
1530
|
["pl-1"]: collapsed
|
|
1340
1531
|
},
|
|
@@ -1351,7 +1542,7 @@ function InputSmall({
|
|
|
1351
1542
|
clearField && value && !disabled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1352
1543
|
"i",
|
|
1353
1544
|
{
|
|
1354
|
-
className:
|
|
1545
|
+
className: clsx9__default.default(styles.clear, "uil uil-times"),
|
|
1355
1546
|
onClick: () => {
|
|
1356
1547
|
elem.value = "";
|
|
1357
1548
|
elem == null ? void 0 : elem.focus();
|
|
@@ -1366,7 +1557,7 @@ function InputSmall({
|
|
|
1366
1557
|
"button",
|
|
1367
1558
|
{
|
|
1368
1559
|
type: "button",
|
|
1369
|
-
className:
|
|
1560
|
+
className: clsx9__default.default({
|
|
1370
1561
|
["border-l border-input pl-1"]: clearField && value && !disabled,
|
|
1371
1562
|
["text-blue-500"]: !disabled,
|
|
1372
1563
|
["text-neutral-300"]: disabled,
|
|
@@ -1400,13 +1591,13 @@ var FilterOptions = ({
|
|
|
1400
1591
|
filterOpen: "rounded-3xl shadow-input border border-blue-500 bg-blue-100 text-blue-500",
|
|
1401
1592
|
filterActive: "rounded-3xl border border-blue-500 text-blue-500 bg-blue-100 shadow-input hover:bg-blue-500 hover:text-white active:text-white active:bg-blue-600 active:border-blue-600"
|
|
1402
1593
|
};
|
|
1403
|
-
const [currentValue, setCurrentValue] =
|
|
1404
|
-
const [data, setData] =
|
|
1405
|
-
const [filter, setFilter] =
|
|
1406
|
-
const [subFilter, setSubFilter] =
|
|
1594
|
+
const [currentValue, setCurrentValue] = React4.useState(isMulti ? [] : {});
|
|
1595
|
+
const [data, setData] = React4.useState(() => options);
|
|
1596
|
+
const [filter, setFilter] = React4.useState("");
|
|
1597
|
+
const [subFilter, setSubFilter] = React4.useState(
|
|
1407
1598
|
(subFilters == null ? void 0 : subFilters.length) > 0 ? subFilters[0].id : null
|
|
1408
1599
|
);
|
|
1409
|
-
const [loading, setLoading] =
|
|
1600
|
+
const [loading, setLoading] = React4.useState(false);
|
|
1410
1601
|
const search = async () => {
|
|
1411
1602
|
if ((filter == null ? void 0 : filter.length) > 0 || (options == null ? void 0 : options.length) > 0) {
|
|
1412
1603
|
if (fetch) {
|
|
@@ -1429,7 +1620,7 @@ var FilterOptions = ({
|
|
|
1429
1620
|
}
|
|
1430
1621
|
setLoading(false);
|
|
1431
1622
|
};
|
|
1432
|
-
|
|
1623
|
+
React4.useEffect(() => {
|
|
1433
1624
|
setLoading(true);
|
|
1434
1625
|
const timeout = setTimeout(() => {
|
|
1435
1626
|
search();
|
|
@@ -1442,11 +1633,11 @@ var FilterOptions = ({
|
|
|
1442
1633
|
{
|
|
1443
1634
|
disabled: option.disabled,
|
|
1444
1635
|
value: option,
|
|
1445
|
-
as:
|
|
1636
|
+
as: React4.Fragment,
|
|
1446
1637
|
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1447
1638
|
"div",
|
|
1448
1639
|
{
|
|
1449
|
-
className:
|
|
1640
|
+
className: clsx9__default.default(
|
|
1450
1641
|
"relative cursor-pointer outline-none select-none p-3 rounded-lg pr-9 text-paragraph mt-1 first:mt-0 overflow-hidden w-full",
|
|
1451
1642
|
{
|
|
1452
1643
|
["hover:bg-neutral-200"]: !option.disabled && !isSelected,
|
|
@@ -1458,7 +1649,7 @@ var FilterOptions = ({
|
|
|
1458
1649
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1459
1650
|
"span",
|
|
1460
1651
|
{
|
|
1461
|
-
className:
|
|
1652
|
+
className: clsx9__default.default(
|
|
1462
1653
|
{
|
|
1463
1654
|
["font-semibold text-white"]: isSelected
|
|
1464
1655
|
},
|
|
@@ -1470,7 +1661,7 @@ var FilterOptions = ({
|
|
|
1470
1661
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1471
1662
|
"span",
|
|
1472
1663
|
{
|
|
1473
|
-
className:
|
|
1664
|
+
className: clsx9__default.default(
|
|
1474
1665
|
{
|
|
1475
1666
|
["font-semibold text-white"]: isSelected
|
|
1476
1667
|
},
|
|
@@ -1482,7 +1673,7 @@ var FilterOptions = ({
|
|
|
1482
1673
|
isSelected ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1483
1674
|
"span",
|
|
1484
1675
|
{
|
|
1485
|
-
className:
|
|
1676
|
+
className: clsx9__default.default(
|
|
1486
1677
|
"absolute inset-y-0 text-white right-0 flex items-center pr-4"
|
|
1487
1678
|
),
|
|
1488
1679
|
children: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-check text-lg" })
|
|
@@ -1507,7 +1698,7 @@ var FilterOptions = ({
|
|
|
1507
1698
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1508
1699
|
react.Popover,
|
|
1509
1700
|
{
|
|
1510
|
-
className:
|
|
1701
|
+
className: clsx9__default.default(
|
|
1511
1702
|
{ ["w-full"]: isMobileSize },
|
|
1512
1703
|
"relative text-paragraph"
|
|
1513
1704
|
),
|
|
@@ -1517,7 +1708,7 @@ var FilterOptions = ({
|
|
|
1517
1708
|
/* @__PURE__ */ jsxRuntime.jsx(react$1.Float.Reference, { children: /* @__PURE__ */ jsxRuntime.jsx(react.PopoverButton, { as: "button", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1518
1709
|
"div",
|
|
1519
1710
|
{
|
|
1520
|
-
className:
|
|
1711
|
+
className: clsx9__default.default(
|
|
1521
1712
|
{
|
|
1522
1713
|
[style.filter]: !hasValue && !open,
|
|
1523
1714
|
[style.filterOpen]: open && !hasValue,
|
|
@@ -1529,7 +1720,7 @@ var FilterOptions = ({
|
|
|
1529
1720
|
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1530
1721
|
"div",
|
|
1531
1722
|
{
|
|
1532
|
-
className:
|
|
1723
|
+
className: clsx9__default.default({
|
|
1533
1724
|
["text-label group-active:text-blue-500"]: !field.value && !open,
|
|
1534
1725
|
["text-blue-500"]: open && !field.value,
|
|
1535
1726
|
["text-blue-500 group-hover:text-white group-active:text-white"]: open && field.value
|
|
@@ -1540,7 +1731,7 @@ var FilterOptions = ({
|
|
|
1540
1731
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1541
1732
|
"label",
|
|
1542
1733
|
{
|
|
1543
|
-
className:
|
|
1734
|
+
className: clsx9__default.default(
|
|
1544
1735
|
{
|
|
1545
1736
|
["text-paragraph group-active:text-blue-500"]: !field.value && !open,
|
|
1546
1737
|
["text-blue-500"]: open && !field.value,
|
|
@@ -1555,7 +1746,7 @@ var FilterOptions = ({
|
|
|
1555
1746
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1556
1747
|
"i",
|
|
1557
1748
|
{
|
|
1558
|
-
className:
|
|
1749
|
+
className: clsx9__default.default(
|
|
1559
1750
|
{
|
|
1560
1751
|
["text-label group-active:text-blue-500"]: !field.value && !open,
|
|
1561
1752
|
["text-blue-500"]: open && !field.value,
|
|
@@ -1573,7 +1764,7 @@ var FilterOptions = ({
|
|
|
1573
1764
|
setCurrentValue(field.value);
|
|
1574
1765
|
close();
|
|
1575
1766
|
};
|
|
1576
|
-
|
|
1767
|
+
React4.useEffect(() => {
|
|
1577
1768
|
setCurrentValue(field.value);
|
|
1578
1769
|
}, [open]);
|
|
1579
1770
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
@@ -1610,7 +1801,7 @@ var FilterOptions = ({
|
|
|
1610
1801
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1611
1802
|
"button",
|
|
1612
1803
|
{
|
|
1613
|
-
className:
|
|
1804
|
+
className: clsx9__default.default(
|
|
1614
1805
|
{
|
|
1615
1806
|
["bg-blue-500 text-white"]: active,
|
|
1616
1807
|
["text-paragraph"]: !active
|
|
@@ -1669,7 +1860,7 @@ var FilterOptions = ({
|
|
|
1669
1860
|
isMulti && onSelectAll && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-r pr-2 border-neutral-300", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1670
1861
|
Button,
|
|
1671
1862
|
{
|
|
1672
|
-
variant: "
|
|
1863
|
+
variant: "secondary",
|
|
1673
1864
|
size: "xxs",
|
|
1674
1865
|
onClick: () => {
|
|
1675
1866
|
onSelectAll();
|
|
@@ -1683,7 +1874,7 @@ var FilterOptions = ({
|
|
|
1683
1874
|
onClear && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mr-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1684
1875
|
Button,
|
|
1685
1876
|
{
|
|
1686
|
-
variant: "
|
|
1877
|
+
variant: "secondary",
|
|
1687
1878
|
size: "xxs",
|
|
1688
1879
|
onClick: () => {
|
|
1689
1880
|
if (onClear) {
|
|
@@ -1801,7 +1992,7 @@ function InputMoney({
|
|
|
1801
1992
|
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1802
1993
|
"div",
|
|
1803
1994
|
{
|
|
1804
|
-
className:
|
|
1995
|
+
className: clsx9__default.default(
|
|
1805
1996
|
styles.icon,
|
|
1806
1997
|
"flex justify-center items-center"
|
|
1807
1998
|
),
|
|
@@ -1815,7 +2006,7 @@ function InputMoney({
|
|
|
1815
2006
|
...inputProps,
|
|
1816
2007
|
...field,
|
|
1817
2008
|
type: "text",
|
|
1818
|
-
className:
|
|
2009
|
+
className: clsx9__default.default({
|
|
1819
2010
|
[styles.input]: true,
|
|
1820
2011
|
["pr-10"]: clearField,
|
|
1821
2012
|
["pr-2"]: !clearField,
|
|
@@ -1837,7 +2028,7 @@ function InputMoney({
|
|
|
1837
2028
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1838
2029
|
"label",
|
|
1839
2030
|
{
|
|
1840
|
-
className:
|
|
2031
|
+
className: clsx9__default.default(
|
|
1841
2032
|
{
|
|
1842
2033
|
[styles.label]: true,
|
|
1843
2034
|
["left-[46px]"]: icon,
|
|
@@ -1906,13 +2097,13 @@ function InputNumber({
|
|
|
1906
2097
|
buttonsWrapper: "absolute top-[7px] right-[10px] cursor-pointer text-label flex flex-col gap-[2px]",
|
|
1907
2098
|
button: "border-[0.5px] border-neutral-300 rounded shadow-input h-4 w-4 flex items-center justify-center"
|
|
1908
2099
|
};
|
|
1909
|
-
const [debouncedCount, setDebouncedCount] =
|
|
2100
|
+
const [debouncedCount, setDebouncedCount] = React4.useState(0);
|
|
1910
2101
|
const save = () => {
|
|
1911
2102
|
if (onBlur) {
|
|
1912
2103
|
onBlur(value);
|
|
1913
2104
|
}
|
|
1914
2105
|
};
|
|
1915
|
-
const updateCount =
|
|
2106
|
+
const updateCount = React4.useMemo(() => {
|
|
1916
2107
|
return debounce_default(() => {
|
|
1917
2108
|
save();
|
|
1918
2109
|
}, 1e3);
|
|
@@ -1947,7 +2138,7 @@ function InputNumber({
|
|
|
1947
2138
|
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1948
2139
|
"div",
|
|
1949
2140
|
{
|
|
1950
|
-
className:
|
|
2141
|
+
className: clsx9__default.default(
|
|
1951
2142
|
styles.icon,
|
|
1952
2143
|
"flex justify-center items-center"
|
|
1953
2144
|
),
|
|
@@ -1961,7 +2152,7 @@ function InputNumber({
|
|
|
1961
2152
|
type: "number",
|
|
1962
2153
|
autoComplete: "off",
|
|
1963
2154
|
id: name,
|
|
1964
|
-
className:
|
|
2155
|
+
className: clsx9__default.default({
|
|
1965
2156
|
[styles.input]: true,
|
|
1966
2157
|
["pr-10"]: clearField,
|
|
1967
2158
|
["pr-2"]: !clearField,
|
|
@@ -2012,7 +2203,7 @@ function InputNumber({
|
|
|
2012
2203
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2013
2204
|
"label",
|
|
2014
2205
|
{
|
|
2015
|
-
className:
|
|
2206
|
+
className: clsx9__default.default(
|
|
2016
2207
|
{
|
|
2017
2208
|
[styles.label]: true,
|
|
2018
2209
|
["left-[3.5rem]"]: icon,
|
|
@@ -2028,12 +2219,12 @@ function InputNumber({
|
|
|
2028
2219
|
}
|
|
2029
2220
|
)
|
|
2030
2221
|
] }),
|
|
2031
|
-
!hideArrows && /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
2222
|
+
!hideArrows && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx9__default.default([styles.buttonsWrapper]), children: [
|
|
2032
2223
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2033
2224
|
"button",
|
|
2034
2225
|
{
|
|
2035
2226
|
type: "button",
|
|
2036
|
-
className:
|
|
2227
|
+
className: clsx9__default.default([styles.button]),
|
|
2037
2228
|
disabled,
|
|
2038
2229
|
onClick: () => {
|
|
2039
2230
|
if (!maxValue || maxValue && Number(value2 || 0) + 1 <= maxValue) {
|
|
@@ -2047,7 +2238,7 @@ function InputNumber({
|
|
|
2047
2238
|
"button",
|
|
2048
2239
|
{
|
|
2049
2240
|
type: "button",
|
|
2050
|
-
className:
|
|
2241
|
+
className: clsx9__default.default([styles.button]),
|
|
2051
2242
|
disabled,
|
|
2052
2243
|
onClick: () => {
|
|
2053
2244
|
if (!maxValue || maxValue && Number(value2 === 0 ? 0 : Number(value2) - 1) <= maxValue) {
|
|
@@ -2137,7 +2328,7 @@ function InputPercentage({
|
|
|
2137
2328
|
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2138
2329
|
"div",
|
|
2139
2330
|
{
|
|
2140
|
-
className:
|
|
2331
|
+
className: clsx9__default.default(
|
|
2141
2332
|
styles.icon,
|
|
2142
2333
|
"flex justify-center items-center"
|
|
2143
2334
|
),
|
|
@@ -2151,7 +2342,7 @@ function InputPercentage({
|
|
|
2151
2342
|
...inputProps,
|
|
2152
2343
|
...field,
|
|
2153
2344
|
type: "text",
|
|
2154
|
-
className:
|
|
2345
|
+
className: clsx9__default.default({
|
|
2155
2346
|
[styles.input]: true,
|
|
2156
2347
|
["pr-10"]: clearField,
|
|
2157
2348
|
["pr-2"]: !clearField,
|
|
@@ -2169,7 +2360,7 @@ function InputPercentage({
|
|
|
2169
2360
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2170
2361
|
"label",
|
|
2171
2362
|
{
|
|
2172
|
-
className:
|
|
2363
|
+
className: clsx9__default.default(
|
|
2173
2364
|
{
|
|
2174
2365
|
[styles.label]: true,
|
|
2175
2366
|
["left-[3rem]"]: icon,
|
|
@@ -2217,7 +2408,7 @@ var MaskedInput = ({
|
|
|
2217
2408
|
defaultValue,
|
|
2218
2409
|
disabled
|
|
2219
2410
|
}) => {
|
|
2220
|
-
const ref =
|
|
2411
|
+
const ref = React4.useRef(null);
|
|
2221
2412
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2222
2413
|
reactHookForm.Controller,
|
|
2223
2414
|
{
|
|
@@ -2288,7 +2479,7 @@ var alertTypes = {
|
|
|
2288
2479
|
info: "text-blue-500",
|
|
2289
2480
|
primary: "text-rose-700"
|
|
2290
2481
|
};
|
|
2291
|
-
var
|
|
2482
|
+
var sizes3 = {
|
|
2292
2483
|
xs: "w-[350px]",
|
|
2293
2484
|
sm: "w-[662px]",
|
|
2294
2485
|
md: "w-[960px]",
|
|
@@ -2312,7 +2503,7 @@ var ModalDialog = ({
|
|
|
2312
2503
|
description,
|
|
2313
2504
|
children
|
|
2314
2505
|
}) => {
|
|
2315
|
-
const
|
|
2506
|
+
const customStyles3 = {
|
|
2316
2507
|
content: {
|
|
2317
2508
|
top: "50%",
|
|
2318
2509
|
left: "50%",
|
|
@@ -2330,7 +2521,7 @@ var ModalDialog = ({
|
|
|
2330
2521
|
zIndex: 9999
|
|
2331
2522
|
}
|
|
2332
2523
|
};
|
|
2333
|
-
const trigger = triggerButton ?
|
|
2524
|
+
const trigger = triggerButton ? React4.cloneElement(triggerButton, {
|
|
2334
2525
|
onClick: () => {
|
|
2335
2526
|
onOpen();
|
|
2336
2527
|
}
|
|
@@ -2343,12 +2534,12 @@ var ModalDialog = ({
|
|
|
2343
2534
|
ariaHideApp: false,
|
|
2344
2535
|
isOpen: open,
|
|
2345
2536
|
onRequestClose: onClose,
|
|
2346
|
-
style:
|
|
2537
|
+
style: customStyles3,
|
|
2347
2538
|
contentLabel: "Example Modal",
|
|
2348
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
2539
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx9__default.default(sizes3[size]), children: [
|
|
2349
2540
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pb-2 border-b border-b-neutral-200 flex items-center justify-between", children: [
|
|
2350
2541
|
/* @__PURE__ */ jsxRuntime.jsxs("h3", { className: "text-[24px] font-bold flex items-center gap-2", children: [
|
|
2351
|
-
alertType && /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
2542
|
+
alertType && /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx9__default.default([alertTypes[alertType]], "text-[30px]"), children: icon }),
|
|
2352
2543
|
title
|
|
2353
2544
|
] }),
|
|
2354
2545
|
/* @__PURE__ */ jsxRuntime.jsx("button", { onClick: onCancel, className: "text-neutral-500 text-[24px]", children: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "uil uil-times" }) })
|
|
@@ -2358,7 +2549,7 @@ var ModalDialog = ({
|
|
|
2358
2549
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2359
2550
|
"div",
|
|
2360
2551
|
{
|
|
2361
|
-
className:
|
|
2552
|
+
className: clsx9__default.default({
|
|
2362
2553
|
["flex-1"]: info
|
|
2363
2554
|
}),
|
|
2364
2555
|
children: info
|
|
@@ -2553,13 +2744,13 @@ var SelectField = ({
|
|
|
2553
2744
|
}) => {
|
|
2554
2745
|
var _a;
|
|
2555
2746
|
const { Option, DropdownIndicator, ClearIndicator, SingleValue } = reactSelect.components;
|
|
2556
|
-
const selectRef =
|
|
2557
|
-
const [inputValue, setInputValue] =
|
|
2558
|
-
const [loading, setLoading] =
|
|
2559
|
-
const [options, setOptions] =
|
|
2560
|
-
const [availableHeight, setAvailableHeight] =
|
|
2561
|
-
const [isFocused, setIsFocused] =
|
|
2562
|
-
|
|
2747
|
+
const selectRef = React4.useRef(null);
|
|
2748
|
+
const [inputValue, setInputValue] = React4.useState("");
|
|
2749
|
+
const [loading, setLoading] = React4.useState(false);
|
|
2750
|
+
const [options, setOptions] = React4.useState(() => optionsList || []);
|
|
2751
|
+
const [availableHeight, setAvailableHeight] = React4.useState(300);
|
|
2752
|
+
const [isFocused, setIsFocused] = React4.useState(false);
|
|
2753
|
+
React4.useEffect(() => {
|
|
2563
2754
|
const updateAvailableHeight = () => {
|
|
2564
2755
|
var _a2, _b;
|
|
2565
2756
|
if ((_a2 = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _a2.getBoundingClientRect) {
|
|
@@ -2607,7 +2798,7 @@ var SelectField = ({
|
|
|
2607
2798
|
const hasIcon = {
|
|
2608
2799
|
hasIcon: icon
|
|
2609
2800
|
};
|
|
2610
|
-
|
|
2801
|
+
React4.useEffect(() => {
|
|
2611
2802
|
setOptions(() => optionsList);
|
|
2612
2803
|
}, [optionsList]);
|
|
2613
2804
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2632,7 +2823,7 @@ var SelectField = ({
|
|
|
2632
2823
|
alignItems: "center",
|
|
2633
2824
|
justifyContent: "space-between"
|
|
2634
2825
|
},
|
|
2635
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
2826
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: clsx9__default.default("text-p-md focus:text-white"), children: props.data.label })
|
|
2636
2827
|
}
|
|
2637
2828
|
) });
|
|
2638
2829
|
};
|
|
@@ -2709,7 +2900,7 @@ var SelectField = ({
|
|
|
2709
2900
|
icon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2710
2901
|
"div",
|
|
2711
2902
|
{
|
|
2712
|
-
className:
|
|
2903
|
+
className: clsx9__default.default(
|
|
2713
2904
|
"z-[70] absolute bg-neutral-100 top-[1px] left-[1px] rounded-l-lg flex justify-center items-center h-[44px] w-[38px] text-[22px] text-dark-blue-600",
|
|
2714
2905
|
{
|
|
2715
2906
|
"text-blue-500": isFocused && hasIcon.hasIcon,
|
|
@@ -2761,7 +2952,7 @@ var SelectField = ({
|
|
|
2761
2952
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2762
2953
|
"span",
|
|
2763
2954
|
{
|
|
2764
|
-
className:
|
|
2955
|
+
className: clsx9__default.default(
|
|
2765
2956
|
"text-label text-sm left-2.5 cursor-pointer pointer-events-none absolute transition-all duration-200",
|
|
2766
2957
|
{
|
|
2767
2958
|
"scale-75 -translate-y-3": field.value || inputValue,
|
|
@@ -2796,6 +2987,393 @@ var SelectField = ({
|
|
|
2796
2987
|
var ValueContainer = ({ children, ...props }) => {
|
|
2797
2988
|
return /* @__PURE__ */ jsxRuntime.jsx(reactSelect.components.ValueContainer, { ...props, children });
|
|
2798
2989
|
};
|
|
2990
|
+
|
|
2991
|
+
// src/components/SelectFieldBip/SelectFieldBip.styles.tsx
|
|
2992
|
+
var customStyles2 = {
|
|
2993
|
+
indicatorSeparator: (provided, props) => {
|
|
2994
|
+
var _a;
|
|
2995
|
+
return {
|
|
2996
|
+
...provided,
|
|
2997
|
+
backgroundColor: props.hasValue && ((_a = provided == null ? void 0 : provided.selectProps) == null ? void 0 : _a.isSearchable) ? "var(--input)" : "transparent",
|
|
2998
|
+
padding: "0px"
|
|
2999
|
+
};
|
|
3000
|
+
},
|
|
3001
|
+
clearIndicator: (provided) => ({
|
|
3002
|
+
...provided,
|
|
3003
|
+
color: "var(--label)",
|
|
3004
|
+
":hover": {
|
|
3005
|
+
color: "var(--label)"
|
|
3006
|
+
}
|
|
3007
|
+
}),
|
|
3008
|
+
dropdownIndicator: (provided, state) => {
|
|
3009
|
+
var _a;
|
|
3010
|
+
return {
|
|
3011
|
+
...provided,
|
|
3012
|
+
color: "var(--paragraph)",
|
|
3013
|
+
transform: ((_a = state == null ? void 0 : state.selectProps) == null ? void 0 : _a.menuIsOpen) ? "rotate(180deg)" : "rotate(0)",
|
|
3014
|
+
":hover": {
|
|
3015
|
+
color: "var(--paragraph)"
|
|
3016
|
+
}
|
|
3017
|
+
};
|
|
3018
|
+
},
|
|
3019
|
+
input: (provided, state) => ({
|
|
3020
|
+
...provided,
|
|
3021
|
+
paddingLeft: state.selectProps.hasIcon ? "34px" : "0px",
|
|
3022
|
+
paddingTop: state.selectProps.hasLabel ? "10px" : "0px"
|
|
3023
|
+
}),
|
|
3024
|
+
menu: (provided) => ({
|
|
3025
|
+
...provided,
|
|
3026
|
+
marginTop: "4px",
|
|
3027
|
+
border: "1px solid var(--dark-blue-300)",
|
|
3028
|
+
boxShadow: "none",
|
|
3029
|
+
borderRadius: "8px",
|
|
3030
|
+
background: "white",
|
|
3031
|
+
zIndex: 60
|
|
3032
|
+
}),
|
|
3033
|
+
menuList: (provided) => ({
|
|
3034
|
+
...provided,
|
|
3035
|
+
padding: "0px 8px"
|
|
3036
|
+
}),
|
|
3037
|
+
singleValue: (base, state) => ({
|
|
3038
|
+
...base,
|
|
3039
|
+
paddingLeft: state.selectProps.hasIcon ? "34px" : "0px",
|
|
3040
|
+
paddingTop: state.selectProps.hasLabel ? "10px" : "0",
|
|
3041
|
+
color: state.data.value === "active" ? "#0EAF86" : "black",
|
|
3042
|
+
display: "flex"
|
|
3043
|
+
}),
|
|
3044
|
+
placeholder: (provided, state) => ({
|
|
3045
|
+
...provided,
|
|
3046
|
+
paddingLeft: state.selectProps.hasIcon ? "34px" : "0px"
|
|
3047
|
+
}),
|
|
3048
|
+
control: (provided, state) => ({
|
|
3049
|
+
...provided,
|
|
3050
|
+
cursor: "pointer",
|
|
3051
|
+
border: state.selectProps.hasError ? "1px solid var(--dangerous-700)" : state.menuIsOpen ? "1px solid var(--blue-700)" : "1px solid var(--dark-blue-300)",
|
|
3052
|
+
boxShadow: "none",
|
|
3053
|
+
outline: "none",
|
|
3054
|
+
borderRadius: "0.5rem",
|
|
3055
|
+
placeholder: " ",
|
|
3056
|
+
height: "46px",
|
|
3057
|
+
backgroundColor: state.isDisabled ? "var(--light-100)" : "white",
|
|
3058
|
+
":hover": {
|
|
3059
|
+
border: state.selectProps.hasError ? "1px solid var(--dangerous-700)" : state.menuIsOpen ? "1px solid var(--blue-700)" : "1px solid var(--dark-blue-300)"
|
|
3060
|
+
}
|
|
3061
|
+
}),
|
|
3062
|
+
multiValue: (provided) => ({
|
|
3063
|
+
...provided,
|
|
3064
|
+
borderRadius: "20px",
|
|
3065
|
+
backgroundColor: "var(--light-100)",
|
|
3066
|
+
padding: "0px 8px"
|
|
3067
|
+
}),
|
|
3068
|
+
multiValueLabel: (provided) => ({
|
|
3069
|
+
...provided,
|
|
3070
|
+
color: "var(--paragraph)"
|
|
3071
|
+
}),
|
|
3072
|
+
multiValueRemove: (provided) => ({
|
|
3073
|
+
...provided,
|
|
3074
|
+
color: "var(--dark-blue-400)",
|
|
3075
|
+
":hover": {
|
|
3076
|
+
color: "var(--dangerous-700)"
|
|
3077
|
+
}
|
|
3078
|
+
}),
|
|
3079
|
+
option: (provided, state) => {
|
|
3080
|
+
let color = state.isSelected ? "white" : (state == null ? void 0 : state.isDisabled) ? "var(--label)" : "var(--paragraph)";
|
|
3081
|
+
return {
|
|
3082
|
+
...provided,
|
|
3083
|
+
cursor: state.isDisabled ? "auto" : "pointer",
|
|
3084
|
+
pointerEvents: state.isDisabled ? "none" : "",
|
|
3085
|
+
borderRadius: "8px",
|
|
3086
|
+
margin: "4px 0px",
|
|
3087
|
+
padding: "10px 12px",
|
|
3088
|
+
backgroundColor: state.isSelected ? "var(--blue-700)" : "white",
|
|
3089
|
+
color,
|
|
3090
|
+
fontWeight: state.isSelected ? 700 : 400,
|
|
3091
|
+
"&:hover": {
|
|
3092
|
+
backgroundColor: state.isSelected ? "var(--blue-700)" : "var(--light-200)"
|
|
3093
|
+
},
|
|
3094
|
+
"&:active": {
|
|
3095
|
+
backgroundColor: "var(--blue-700)",
|
|
3096
|
+
color: "white !important",
|
|
3097
|
+
fontWeight: 700
|
|
3098
|
+
},
|
|
3099
|
+
"&:active i": {
|
|
3100
|
+
color: "white !important",
|
|
3101
|
+
fontWeight: 700
|
|
3102
|
+
},
|
|
3103
|
+
" i": {
|
|
3104
|
+
color: "white !important"
|
|
3105
|
+
}
|
|
3106
|
+
};
|
|
3107
|
+
},
|
|
3108
|
+
container: (provided) => ({
|
|
3109
|
+
...provided,
|
|
3110
|
+
border: "none",
|
|
3111
|
+
outline: "none",
|
|
3112
|
+
boxShadow: "none",
|
|
3113
|
+
padding: "none",
|
|
3114
|
+
margin: "none"
|
|
3115
|
+
})
|
|
3116
|
+
};
|
|
3117
|
+
var SelectFieldBip = ({
|
|
3118
|
+
name,
|
|
3119
|
+
label,
|
|
3120
|
+
error,
|
|
3121
|
+
defaultValue,
|
|
3122
|
+
control,
|
|
3123
|
+
placeholder,
|
|
3124
|
+
isSearchable = false,
|
|
3125
|
+
required,
|
|
3126
|
+
debounce: debounce2,
|
|
3127
|
+
filterOptions,
|
|
3128
|
+
disabled,
|
|
3129
|
+
onChangeValue,
|
|
3130
|
+
optionStyle,
|
|
3131
|
+
valueStyle,
|
|
3132
|
+
icon,
|
|
3133
|
+
onErrorBip,
|
|
3134
|
+
clearAfterSelect = true,
|
|
3135
|
+
messages = {
|
|
3136
|
+
searching: "Searching...",
|
|
3137
|
+
debounce: `Type at least {debounce} characters`,
|
|
3138
|
+
emptyMessage: "No options found",
|
|
3139
|
+
loading: "Loading..."
|
|
3140
|
+
}
|
|
3141
|
+
}) => {
|
|
3142
|
+
var _a;
|
|
3143
|
+
const { Option, SingleValue } = reactSelect.components;
|
|
3144
|
+
const selectRef = React4.useRef(null);
|
|
3145
|
+
const [inputValue, setInputValue] = React4.useState("");
|
|
3146
|
+
const [loading, setLoading] = React4.useState(false);
|
|
3147
|
+
const [cachedOptions, setCachedOptions] = React4.useState([]);
|
|
3148
|
+
const fetchOptions = async (value) => {
|
|
3149
|
+
if (isSearchable && filterOptions) {
|
|
3150
|
+
if (!debounce2 || debounce2 && value.length >= debounce2) {
|
|
3151
|
+
setLoading(true);
|
|
3152
|
+
const result = await filterOptions(value);
|
|
3153
|
+
setCachedOptions(result);
|
|
3154
|
+
setLoading(false);
|
|
3155
|
+
return result;
|
|
3156
|
+
}
|
|
3157
|
+
}
|
|
3158
|
+
return [];
|
|
3159
|
+
};
|
|
3160
|
+
const fieldValidation = useFieldErrorsStore((state) => state.field);
|
|
3161
|
+
const fieldValidationMessages = [
|
|
3162
|
+
(_a = fieldValidation[name]) == null ? void 0 : _a.message,
|
|
3163
|
+
error == null ? void 0 : error.message
|
|
3164
|
+
];
|
|
3165
|
+
const hasError = {
|
|
3166
|
+
hasError: fieldValidationMessages.some((item) => item !== void 0)
|
|
3167
|
+
};
|
|
3168
|
+
const hasLabel = {
|
|
3169
|
+
hasLabel: (label == null ? void 0 : label.length) > 0
|
|
3170
|
+
};
|
|
3171
|
+
const hasIcon = {
|
|
3172
|
+
hasIcon: icon
|
|
3173
|
+
};
|
|
3174
|
+
const iconStyle = `z-[70] absolute bg-neutral-100 h-[44px] top-[1px] left-[1px] rounded-l-lg flex justify-center items-center w-[38px] text-[22px] ${hasError.hasError ? "text-dangerous-500" : "text-label"}`;
|
|
3175
|
+
const debouncedFetchOptions = React4.useMemo(() => {
|
|
3176
|
+
return debounce_default((value, callback) => {
|
|
3177
|
+
fetchOptions(value).then(callback);
|
|
3178
|
+
}, 300);
|
|
3179
|
+
}, [filterOptions]);
|
|
3180
|
+
React4.useEffect(() => {
|
|
3181
|
+
return () => {
|
|
3182
|
+
debouncedFetchOptions.cancel();
|
|
3183
|
+
};
|
|
3184
|
+
}, [debouncedFetchOptions]);
|
|
3185
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3186
|
+
reactHookForm.Controller,
|
|
3187
|
+
{
|
|
3188
|
+
name,
|
|
3189
|
+
control,
|
|
3190
|
+
defaultValue,
|
|
3191
|
+
render: ({ field }) => {
|
|
3192
|
+
const CustomSingleValue = (props) => {
|
|
3193
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SingleValue, { ...props, children: valueStyle ? valueStyle(props == null ? void 0 : props.data) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3194
|
+
props.data.label,
|
|
3195
|
+
" "
|
|
3196
|
+
] }) });
|
|
3197
|
+
};
|
|
3198
|
+
const IconOption = (props) => {
|
|
3199
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Option, { ...props, children: optionStyle ? optionStyle(props == null ? void 0 : props.data) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
3200
|
+
"div",
|
|
3201
|
+
{
|
|
3202
|
+
style: {
|
|
3203
|
+
display: "flex",
|
|
3204
|
+
alignItems: "center",
|
|
3205
|
+
justifyContent: "space-between"
|
|
3206
|
+
},
|
|
3207
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: clsx9__default.default("text-p-md focus:text-white"), children: props.data.label })
|
|
3208
|
+
}
|
|
3209
|
+
) });
|
|
3210
|
+
};
|
|
3211
|
+
const LoadingMessage = (props) => {
|
|
3212
|
+
if (!debounce2 || debounce2 && inputValue.length >= debounce2) {
|
|
3213
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3214
|
+
"div",
|
|
3215
|
+
{
|
|
3216
|
+
...props.innerProps,
|
|
3217
|
+
className: "flex items-center gap-[6px] p-2",
|
|
3218
|
+
children: [
|
|
3219
|
+
/* @__PURE__ */ jsxRuntime.jsx(SpinnerIcon, { width: 16, height: 16, className: "animate-spin" }),
|
|
3220
|
+
messages.searching
|
|
3221
|
+
]
|
|
3222
|
+
}
|
|
3223
|
+
);
|
|
3224
|
+
} else if (debounce2 && inputValue.length < debounce2) {
|
|
3225
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2 text-dark-blue-300", children: messages.debounce.replace("{debounce}", String(debounce2)) });
|
|
3226
|
+
}
|
|
3227
|
+
};
|
|
3228
|
+
const NoOptionsMessage = (props) => {
|
|
3229
|
+
var _a2;
|
|
3230
|
+
if (inputValue.length == 0 && debounce2 > 0 || debounce2 > 0 && inputValue.length < debounce2) {
|
|
3231
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2 text-dark-blue-300", children: messages.debounce.replace("{debounce}", String(debounce2)) });
|
|
3232
|
+
} else if (inputValue.length > 0 && ((_a2 = props == null ? void 0 : props.options) == null ? void 0 : _a2.length) == 0) {
|
|
3233
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-2 text-dark-blue-300", children: messages.emptyMessage });
|
|
3234
|
+
}
|
|
3235
|
+
};
|
|
3236
|
+
const DropdownIndicatorCustom = (props) => {
|
|
3237
|
+
return null;
|
|
3238
|
+
};
|
|
3239
|
+
const handleKeyDown = async (event) => {
|
|
3240
|
+
var _a2;
|
|
3241
|
+
if (event.key === "Enter") {
|
|
3242
|
+
event.preventDefault();
|
|
3243
|
+
debouncedFetchOptions.cancel();
|
|
3244
|
+
const fetchedOptions = await fetchOptions(event.target.value);
|
|
3245
|
+
if ((fetchedOptions == null ? void 0 : fetchedOptions.length) > 0) {
|
|
3246
|
+
onChange(fetchedOptions[0]);
|
|
3247
|
+
setTimeout(() => {
|
|
3248
|
+
var _a3, _b, _c;
|
|
3249
|
+
setInputValue("");
|
|
3250
|
+
(_a3 = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _a3.clearValue();
|
|
3251
|
+
(_b = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _b.focus();
|
|
3252
|
+
(_c = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _c.onMenuClose();
|
|
3253
|
+
field.onChange(null);
|
|
3254
|
+
}, 10);
|
|
3255
|
+
} else {
|
|
3256
|
+
onErrorBip((_a2 = event == null ? void 0 : event.target) == null ? void 0 : _a2.value);
|
|
3257
|
+
selectRef.current.inputRef.select();
|
|
3258
|
+
selectRef.current.onMenuClose();
|
|
3259
|
+
}
|
|
3260
|
+
}
|
|
3261
|
+
};
|
|
3262
|
+
const handleInputChange = (value, actionMeta) => {
|
|
3263
|
+
if (actionMeta.action === "input-change") {
|
|
3264
|
+
setInputValue(value);
|
|
3265
|
+
}
|
|
3266
|
+
return value;
|
|
3267
|
+
};
|
|
3268
|
+
const onChange = async (value, action) => {
|
|
3269
|
+
var _a2, _b, _c, _d, _e;
|
|
3270
|
+
if (onChangeValue) onChangeValue(value);
|
|
3271
|
+
if ((action == null ? void 0 : action.action) === "select-option") {
|
|
3272
|
+
if (clearAfterSelect) {
|
|
3273
|
+
setInputValue("");
|
|
3274
|
+
(_a2 = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _a2.clearValue();
|
|
3275
|
+
(_b = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _b.onMenuClose();
|
|
3276
|
+
(_c = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _c.focus();
|
|
3277
|
+
field.onChange(null);
|
|
3278
|
+
} else {
|
|
3279
|
+
field.onChange(value);
|
|
3280
|
+
setInputValue("");
|
|
3281
|
+
(_d = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _d.onMenuClose();
|
|
3282
|
+
}
|
|
3283
|
+
}
|
|
3284
|
+
if (action === "clear-value") {
|
|
3285
|
+
setInputValue("");
|
|
3286
|
+
setCachedOptions([]);
|
|
3287
|
+
(_e = selectRef == null ? void 0 : selectRef.current) == null ? void 0 : _e.clearValue();
|
|
3288
|
+
field.onChange(null);
|
|
3289
|
+
}
|
|
3290
|
+
};
|
|
3291
|
+
const loadOptions = (value, callback) => {
|
|
3292
|
+
debouncedFetchOptions(value, callback);
|
|
3293
|
+
};
|
|
3294
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", id: "multiselect", children: [
|
|
3295
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: iconStyle, children: icon }),
|
|
3296
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3297
|
+
AsyncSelect__default.default,
|
|
3298
|
+
{
|
|
3299
|
+
onKeyDown: handleKeyDown,
|
|
3300
|
+
...field,
|
|
3301
|
+
...hasError,
|
|
3302
|
+
...hasLabel,
|
|
3303
|
+
...hasIcon,
|
|
3304
|
+
ref: selectRef,
|
|
3305
|
+
isDisabled: disabled,
|
|
3306
|
+
onBlur: () => handleInputChange("", {
|
|
3307
|
+
action: "input-change"
|
|
3308
|
+
}),
|
|
3309
|
+
loadingMessage: () => /* @__PURE__ */ jsxRuntime.jsx("div", { children: messages.loading }),
|
|
3310
|
+
isLoading: loading,
|
|
3311
|
+
loadOptions,
|
|
3312
|
+
defaultOptions: false,
|
|
3313
|
+
name: field.name,
|
|
3314
|
+
isClearable: false,
|
|
3315
|
+
styles: customStyles2,
|
|
3316
|
+
placeholder: placeholder || " ",
|
|
3317
|
+
isSearchable,
|
|
3318
|
+
tabSelectsValue: true,
|
|
3319
|
+
components: {
|
|
3320
|
+
SingleValue: CustomSingleValue,
|
|
3321
|
+
ValueContainer: ValueContainer2,
|
|
3322
|
+
Option: IconOption,
|
|
3323
|
+
LoadingIndicator: () => /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}),
|
|
3324
|
+
LoadingMessage,
|
|
3325
|
+
NoOptionsMessage,
|
|
3326
|
+
DropdownIndicator: DropdownIndicatorCustom
|
|
3327
|
+
},
|
|
3328
|
+
closeMenuOnSelect: false,
|
|
3329
|
+
blurInputOnSelect: true,
|
|
3330
|
+
hideSelectedOptions: false,
|
|
3331
|
+
onChange,
|
|
3332
|
+
inputValue,
|
|
3333
|
+
onInputChange: handleInputChange
|
|
3334
|
+
}
|
|
3335
|
+
),
|
|
3336
|
+
inputValue !== "" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3337
|
+
"i",
|
|
3338
|
+
{
|
|
3339
|
+
onClick: () => onChange(null, "clear-value"),
|
|
3340
|
+
className: "uil uil-times text-[18px] absolute right-2 top-[11px] cursor-pointer text-label"
|
|
3341
|
+
}
|
|
3342
|
+
),
|
|
3343
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3344
|
+
"span",
|
|
3345
|
+
{
|
|
3346
|
+
className: clsx9__default.default(
|
|
3347
|
+
"text-label text-sm left-2.5 cursor-pointer pointer-events-none",
|
|
3348
|
+
{
|
|
3349
|
+
[" scale-75 -translate-y-3 "]: field.value,
|
|
3350
|
+
["text-dangerous-700"]: hasError.hasError
|
|
3351
|
+
}
|
|
3352
|
+
),
|
|
3353
|
+
children: [
|
|
3354
|
+
label,
|
|
3355
|
+
required && label && /* @__PURE__ */ jsxRuntime.jsx("strong", { className: "text-dangerous-700", children: "\xA0*" })
|
|
3356
|
+
]
|
|
3357
|
+
}
|
|
3358
|
+
),
|
|
3359
|
+
fieldValidationMessages.map((message, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3360
|
+
"div",
|
|
3361
|
+
{
|
|
3362
|
+
className: "text-dangerous-700 text-xs mt-1 ml-[2px]",
|
|
3363
|
+
role: "alert",
|
|
3364
|
+
"aria-label": message,
|
|
3365
|
+
children: message
|
|
3366
|
+
},
|
|
3367
|
+
index
|
|
3368
|
+
))
|
|
3369
|
+
] });
|
|
3370
|
+
}
|
|
3371
|
+
}
|
|
3372
|
+
);
|
|
3373
|
+
};
|
|
3374
|
+
var ValueContainer2 = ({ children, ...props }) => {
|
|
3375
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactSelect.components.ValueContainer, { ...props, children });
|
|
3376
|
+
};
|
|
2799
3377
|
var Radio = ({
|
|
2800
3378
|
disabled,
|
|
2801
3379
|
control,
|
|
@@ -2922,22 +3500,22 @@ function PaginationSelect({
|
|
|
2922
3500
|
id: index,
|
|
2923
3501
|
name: index
|
|
2924
3502
|
}));
|
|
2925
|
-
const [pageSizeSelected, setPageSizeSelected] =
|
|
3503
|
+
const [pageSizeSelected, setPageSizeSelected] = React4.useState({
|
|
2926
3504
|
id: ((_a = JSON.parse(sessionStorage.getItem("pageSize"))) == null ? void 0 : _a.id) || 20,
|
|
2927
3505
|
name: ((_b = JSON.parse(sessionStorage.getItem("pageSize"))) == null ? void 0 : _b.name) || 20
|
|
2928
3506
|
});
|
|
2929
|
-
const [pageSelected, setPageSelected] =
|
|
3507
|
+
const [pageSelected, setPageSelected] = React4.useState({
|
|
2930
3508
|
id: ((_d = (_c = table == null ? void 0 : table.getState()) == null ? void 0 : _c.pagination) == null ? void 0 : _d.pageIndex) || 0,
|
|
2931
3509
|
name: ((_f = (_e = table == null ? void 0 : table.getState()) == null ? void 0 : _e.pagination) == null ? void 0 : _f.pageIndex) || 0
|
|
2932
3510
|
});
|
|
2933
|
-
const [pagesOptions, setPagesOptions] =
|
|
2934
|
-
const [pageSizesOptions, setPagesSizesOptions] =
|
|
3511
|
+
const [pagesOptions, setPagesOptions] = React4.useState(() => options);
|
|
3512
|
+
const [pageSizesOptions, setPagesSizesOptions] = React4.useState(
|
|
2935
3513
|
pageSizeOptions == null ? void 0 : pageSizeOptions.map((item) => ({
|
|
2936
3514
|
id: item,
|
|
2937
3515
|
name: item
|
|
2938
3516
|
}))
|
|
2939
3517
|
);
|
|
2940
|
-
const [query, setQuery] =
|
|
3518
|
+
const [query, setQuery] = React4.useState("");
|
|
2941
3519
|
const filter = () => {
|
|
2942
3520
|
let copy = [...options];
|
|
2943
3521
|
setPagesOptions(
|
|
@@ -2949,10 +3527,10 @@ function PaginationSelect({
|
|
|
2949
3527
|
const saveSessionStorage = (key, values) => {
|
|
2950
3528
|
sessionStorage.setItem(key, JSON.stringify(values));
|
|
2951
3529
|
};
|
|
2952
|
-
|
|
3530
|
+
React4.useEffect(() => {
|
|
2953
3531
|
filter();
|
|
2954
3532
|
}, [query]);
|
|
2955
|
-
|
|
3533
|
+
React4.useEffect(() => {
|
|
2956
3534
|
saveSessionStorage("pageSize", pageSizeSelected);
|
|
2957
3535
|
table.setPageSize(pageSizeSelected == null ? void 0 : pageSizeSelected.id);
|
|
2958
3536
|
table.setPageIndex(0);
|
|
@@ -2961,7 +3539,7 @@ function PaginationSelect({
|
|
|
2961
3539
|
name: 0
|
|
2962
3540
|
});
|
|
2963
3541
|
}, [pageSizeSelected]);
|
|
2964
|
-
|
|
3542
|
+
React4.useEffect(() => {
|
|
2965
3543
|
setPagesOptions(
|
|
2966
3544
|
pageCount ? [...Array(pageCount)].map((item, index) => ({
|
|
2967
3545
|
id: index,
|
|
@@ -2969,7 +3547,7 @@ function PaginationSelect({
|
|
|
2969
3547
|
})) : []
|
|
2970
3548
|
);
|
|
2971
3549
|
}, [table == null ? void 0 : table.getPageCount()]);
|
|
2972
|
-
|
|
3550
|
+
React4.useEffect(() => {
|
|
2973
3551
|
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
2974
3552
|
if (((_b2 = (_a2 = table == null ? void 0 : table.getState()) == null ? void 0 : _a2.pagination) == null ? void 0 : _b2.pageIndex) >= 0) {
|
|
2975
3553
|
setPageSelected({
|
|
@@ -2999,7 +3577,7 @@ function PaginationSelect({
|
|
|
2999
3577
|
react.Combobox.Option,
|
|
3000
3578
|
{
|
|
3001
3579
|
value: opt,
|
|
3002
|
-
className:
|
|
3580
|
+
className: clsx9__default.default(
|
|
3003
3581
|
"p-2 rounded-lg items-center justify-center cursor-pointer flex whitespace-nowrap no-underline ",
|
|
3004
3582
|
{
|
|
3005
3583
|
"bg-blue-500 hover:bg-blue-500 hover:text-[#FFFFFF] text-[#FFFFFF]": selected
|
|
@@ -3074,7 +3652,7 @@ function PaginationSelect({
|
|
|
3074
3652
|
react.Combobox.Option,
|
|
3075
3653
|
{
|
|
3076
3654
|
value: opt,
|
|
3077
|
-
className:
|
|
3655
|
+
className: clsx9__default.default(
|
|
3078
3656
|
"p-2 rounded-lg items-center justify-center cursor-pointer flex whitespace-nowrap no-underline ",
|
|
3079
3657
|
{
|
|
3080
3658
|
"bg-blue-500 hover:bg-blue-500 hover:text-[#FFFFFF] text-[#FFFFFF]": selected
|
|
@@ -3094,11 +3672,11 @@ function PaginationSelect({
|
|
|
3094
3672
|
] })
|
|
3095
3673
|
] });
|
|
3096
3674
|
}
|
|
3097
|
-
var Table =
|
|
3675
|
+
var Table = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3098
3676
|
"table",
|
|
3099
3677
|
{
|
|
3100
3678
|
ref,
|
|
3101
|
-
className:
|
|
3679
|
+
className: clsx9.clsx(
|
|
3102
3680
|
"table-scroll block text-left border-separate border-spacing-0 w-full",
|
|
3103
3681
|
className
|
|
3104
3682
|
),
|
|
@@ -3107,22 +3685,22 @@ var Table = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
3107
3685
|
}
|
|
3108
3686
|
));
|
|
3109
3687
|
Table.displayName = "Table";
|
|
3110
|
-
var TableHeader =
|
|
3688
|
+
var TableHeader = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3111
3689
|
"thead",
|
|
3112
3690
|
{
|
|
3113
3691
|
ref,
|
|
3114
|
-
className:
|
|
3692
|
+
className: clsx9.clsx("w-full sticky top-0 z-[90]", className),
|
|
3115
3693
|
...props
|
|
3116
3694
|
}
|
|
3117
3695
|
));
|
|
3118
3696
|
TableHeader.displayName = "TableHeader";
|
|
3119
|
-
var TableBody =
|
|
3697
|
+
var TableBody = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("tbody", { ref, className: clsx9.clsx(className), ...props }));
|
|
3120
3698
|
TableBody.displayName = "TableBody";
|
|
3121
|
-
var TableFooter =
|
|
3699
|
+
var TableFooter = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3122
3700
|
"div",
|
|
3123
3701
|
{
|
|
3124
3702
|
ref,
|
|
3125
|
-
className:
|
|
3703
|
+
className: clsx9.clsx(
|
|
3126
3704
|
" flex flex-col md:flex-row gap-2 md:gap-0 justify-between items-center py-4 px-6 bg-white w-full h-full border border-neutral-200 rounded-t-lg",
|
|
3127
3705
|
className
|
|
3128
3706
|
),
|
|
@@ -3130,13 +3708,13 @@ var TableFooter = React2__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
3130
3708
|
}
|
|
3131
3709
|
));
|
|
3132
3710
|
TableFooter.displayName = "TableFooter";
|
|
3133
|
-
var TableRow =
|
|
3711
|
+
var TableRow = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("tr", { ref, className: clsx9.clsx(className), ...props }));
|
|
3134
3712
|
TableRow.displayName = "TableRow";
|
|
3135
|
-
var TableHead =
|
|
3713
|
+
var TableHead = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3136
3714
|
"th",
|
|
3137
3715
|
{
|
|
3138
3716
|
ref,
|
|
3139
|
-
className:
|
|
3717
|
+
className: clsx9.clsx(
|
|
3140
3718
|
{
|
|
3141
3719
|
"hover:bg-neutral-100": props.sortable
|
|
3142
3720
|
},
|
|
@@ -3147,11 +3725,11 @@ var TableHead = React2__namespace.forwardRef(({ className, ...props }, ref) => /
|
|
|
3147
3725
|
}
|
|
3148
3726
|
));
|
|
3149
3727
|
TableHead.displayName = "TableHead";
|
|
3150
|
-
var TableCell =
|
|
3728
|
+
var TableCell = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3151
3729
|
"td",
|
|
3152
3730
|
{
|
|
3153
3731
|
ref,
|
|
3154
|
-
className:
|
|
3732
|
+
className: clsx9.clsx(
|
|
3155
3733
|
"align-middle h-[80px] border-b border-neutral-200 whitespace-nowrap py-4 px-5",
|
|
3156
3734
|
className
|
|
3157
3735
|
),
|
|
@@ -3159,11 +3737,11 @@ var TableCell = React2__namespace.forwardRef(({ className, ...props }, ref) => /
|
|
|
3159
3737
|
}
|
|
3160
3738
|
));
|
|
3161
3739
|
TableCell.displayName = "TableCell";
|
|
3162
|
-
var TableCaption =
|
|
3740
|
+
var TableCaption = React4__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3163
3741
|
"caption",
|
|
3164
3742
|
{
|
|
3165
3743
|
ref,
|
|
3166
|
-
className:
|
|
3744
|
+
className: clsx9.clsx("text-default mt-4 text-sm", className),
|
|
3167
3745
|
...props
|
|
3168
3746
|
}
|
|
3169
3747
|
));
|
|
@@ -3213,10 +3791,10 @@ function DataTablePagination({
|
|
|
3213
3791
|
(pageSizeOptions == null ? void 0 : pageSizeOptions.length) > 0 && /* @__PURE__ */ jsxRuntime.jsx(PaginationSelect, { table, pageSizeOptions }),
|
|
3214
3792
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col md:flex-row items-center justify-center md:justify-normal gap-2 md:gap-4", children: [
|
|
3215
3793
|
footer,
|
|
3216
|
-
selectAllOption && /* @__PURE__ */ jsxRuntime.jsx("div", { children: rowsSelected !== totalData ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "md:border-l border-gray-300 pl-4", children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { size: "xxs", onClick: onSelectAll, variant: "
|
|
3794
|
+
selectAllOption && /* @__PURE__ */ jsxRuntime.jsx("div", { children: rowsSelected !== totalData ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "md:border-l border-gray-300 pl-4", children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { size: "xxs", onClick: onSelectAll, variant: "secondary", children: [
|
|
3217
3795
|
"Selecionar todos os ",
|
|
3218
3796
|
totalData
|
|
3219
|
-
] }) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "md:border-l border-gray-300 pl-4", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "xxs", onClick: onRemoveAll, variant: "
|
|
3797
|
+
] }) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "md:border-l border-gray-300 pl-4", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { size: "xxs", onClick: onRemoveAll, variant: "secondary", children: "Desmarcar todos" }) }) })
|
|
3220
3798
|
] }),
|
|
3221
3799
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col md:flex-row items-center md:justify-end justify-center gap-2 flex-1", children: [
|
|
3222
3800
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-p-md text-paragraph mr-1", children: [
|
|
@@ -3272,7 +3850,7 @@ function DataTablePagination({
|
|
|
3272
3850
|
pagesArray.map((elem, index) => {
|
|
3273
3851
|
const checkPageIndexLimit = index <= limitPagePositive && index >= limitPageNegative;
|
|
3274
3852
|
const isSelectedPage = index === selectedPage;
|
|
3275
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3853
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React4.Fragment, { children: checkPageIndexLimit && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3276
3854
|
Button,
|
|
3277
3855
|
{
|
|
3278
3856
|
onClick: () => table.setPageIndex(index),
|
|
@@ -3382,22 +3960,22 @@ function DataTable({
|
|
|
3382
3960
|
onFinishFetch
|
|
3383
3961
|
}) {
|
|
3384
3962
|
var _a, _b, _c, _d, _e, _f;
|
|
3385
|
-
const tableRef =
|
|
3386
|
-
const [columnVisibility, setColumnVisibility] =
|
|
3387
|
-
const [columnFilters, setColumnFilters] =
|
|
3388
|
-
const [sorting, setSorting] =
|
|
3389
|
-
const [arrRowSelected, setArrRowSelected] =
|
|
3390
|
-
const [globalFilter, setGlobalFilter] =
|
|
3391
|
-
const [dataTable, setDataTable] =
|
|
3392
|
-
const [loading, setLoading] =
|
|
3393
|
-
const [expanded, setExpanded] =
|
|
3394
|
-
const [total, setTotal] =
|
|
3395
|
-
const [{ pageIndex, pageSize }, setPagination] =
|
|
3963
|
+
const tableRef = React4.useRef(null);
|
|
3964
|
+
const [columnVisibility, setColumnVisibility] = React4.useState({});
|
|
3965
|
+
const [columnFilters, setColumnFilters] = React4.useState([]);
|
|
3966
|
+
const [sorting, setSorting] = React4.useState([]);
|
|
3967
|
+
const [arrRowSelected, setArrRowSelected] = React4.useState([]);
|
|
3968
|
+
const [globalFilter, setGlobalFilter] = React4.useState("");
|
|
3969
|
+
const [dataTable, setDataTable] = React4.useState([]);
|
|
3970
|
+
const [loading, setLoading] = React4.useState(true);
|
|
3971
|
+
const [expanded, setExpanded] = React4.useState({});
|
|
3972
|
+
const [total, setTotal] = React4.useState(() => totalData);
|
|
3973
|
+
const [{ pageIndex, pageSize }, setPagination] = React4.useState({
|
|
3396
3974
|
pageIndex: 0,
|
|
3397
3975
|
pageSize: hidePagination ? 999999 : perPage ? perPage : 20
|
|
3398
3976
|
});
|
|
3399
|
-
const [paginationScroll, setPaginationScroll] =
|
|
3400
|
-
const pagination =
|
|
3977
|
+
const [paginationScroll, setPaginationScroll] = React4.useState();
|
|
3978
|
+
const pagination = React4.useMemo(
|
|
3401
3979
|
() => ({
|
|
3402
3980
|
pageIndex,
|
|
3403
3981
|
pageSize
|
|
@@ -3452,7 +4030,7 @@ function DataTable({
|
|
|
3452
4030
|
pageCount: Number(pageSize2)
|
|
3453
4031
|
};
|
|
3454
4032
|
};
|
|
3455
|
-
|
|
4033
|
+
React4.useEffect(() => {
|
|
3456
4034
|
if (!(tableContainerRef == null ? void 0 : tableContainerRef.current)) return;
|
|
3457
4035
|
const resizeObserver = new ResizeObserver(() => {
|
|
3458
4036
|
var _a2;
|
|
@@ -3461,12 +4039,12 @@ function DataTable({
|
|
|
3461
4039
|
resizeObserver.observe(tableContainerRef == null ? void 0 : tableContainerRef.current);
|
|
3462
4040
|
return () => resizeObserver.disconnect();
|
|
3463
4041
|
}, []);
|
|
3464
|
-
|
|
4042
|
+
React4.useEffect(() => {
|
|
3465
4043
|
if (fetchData || autoPagination) {
|
|
3466
4044
|
fetch();
|
|
3467
4045
|
}
|
|
3468
4046
|
}, [pageIndex, pageSize, sorting]);
|
|
3469
|
-
|
|
4047
|
+
React4.useEffect(() => {
|
|
3470
4048
|
if (totalData !== total) {
|
|
3471
4049
|
setPagination({
|
|
3472
4050
|
pageIndex: 0,
|
|
@@ -3475,7 +4053,7 @@ function DataTable({
|
|
|
3475
4053
|
setTotal(totalData);
|
|
3476
4054
|
}
|
|
3477
4055
|
}, [totalData]);
|
|
3478
|
-
|
|
4056
|
+
React4.useEffect(() => {
|
|
3479
4057
|
if (data) {
|
|
3480
4058
|
setDataTable(
|
|
3481
4059
|
() => autoPagination ? data.slice(0, pageSize) : data
|
|
@@ -3522,7 +4100,7 @@ function DataTable({
|
|
|
3522
4100
|
getRowStyles: rowClassName
|
|
3523
4101
|
}
|
|
3524
4102
|
});
|
|
3525
|
-
|
|
4103
|
+
React4.useEffect(() => {
|
|
3526
4104
|
if (enableRowSelection && rowSelection) {
|
|
3527
4105
|
setArrRowSelected(Object.keys(rowSelection));
|
|
3528
4106
|
}
|
|
@@ -3575,7 +4153,7 @@ function DataTable({
|
|
|
3575
4153
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
3576
4154
|
}
|
|
3577
4155
|
}
|
|
3578
|
-
|
|
4156
|
+
React4.useEffect(() => {
|
|
3579
4157
|
if (rowSelection && Object.keys(rowSelection).length == 0) {
|
|
3580
4158
|
const elements = document.getElementsByClassName("th-shadow");
|
|
3581
4159
|
Object.keys(elements).forEach((index) => {
|
|
@@ -3614,7 +4192,7 @@ function DataTable({
|
|
|
3614
4192
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3615
4193
|
"div",
|
|
3616
4194
|
{
|
|
3617
|
-
className:
|
|
4195
|
+
className: clsx9__default.default("w-full flex mt-4 flex-col justify-between", {
|
|
3618
4196
|
"flex-1": !hideTableData,
|
|
3619
4197
|
[tableClass]: tableClass
|
|
3620
4198
|
}),
|
|
@@ -3622,7 +4200,7 @@ function DataTable({
|
|
|
3622
4200
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3623
4201
|
Table,
|
|
3624
4202
|
{
|
|
3625
|
-
className:
|
|
4203
|
+
className: clsx9__default.default(
|
|
3626
4204
|
"w-full table_container z-20 overflow-x-scroll md:overflow-x-hidden"
|
|
3627
4205
|
),
|
|
3628
4206
|
onScroll,
|
|
@@ -3649,7 +4227,7 @@ function DataTable({
|
|
|
3649
4227
|
width: header.getSize()
|
|
3650
4228
|
},
|
|
3651
4229
|
scope: "col",
|
|
3652
|
-
className:
|
|
4230
|
+
className: clsx9__default.default(
|
|
3653
4231
|
{
|
|
3654
4232
|
"hover:bg-neutral-100 th-shadow cursor-pointer": header.column.getCanSort(),
|
|
3655
4233
|
["with-shadow"]: (arrRowSelected == null ? void 0 : arrRowSelected.length) == 0 && withShadow
|
|
@@ -3665,7 +4243,7 @@ function DataTable({
|
|
|
3665
4243
|
((_a2 = sorting[0]) == null ? void 0 : _a2.id) == header.column.id ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3666
4244
|
"i",
|
|
3667
4245
|
{
|
|
3668
|
-
className:
|
|
4246
|
+
className: clsx9__default.default(
|
|
3669
4247
|
{
|
|
3670
4248
|
["rotate-0"]: !((_b2 = sorting[0]) == null ? void 0 : _b2.desc),
|
|
3671
4249
|
["rotate-180"]: (_c2 = sorting[0]) == null ? void 0 : _c2.desc
|
|
@@ -3680,7 +4258,7 @@ function DataTable({
|
|
|
3680
4258
|
);
|
|
3681
4259
|
}) }, headerGroup.id + headerIndex + "header")) }),
|
|
3682
4260
|
/* @__PURE__ */ jsxRuntime.jsx(TableBody, { children: (_f = (_e = table == null ? void 0 : table.getRowModel()) == null ? void 0 : _e.rows) == null ? void 0 : _f.map((row, rowIndex) => {
|
|
3683
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4261
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React4__namespace.default.Fragment, { children: !row.original._destroy && /* @__PURE__ */ jsxRuntime.jsxs(React4__namespace.default.Fragment, { children: [
|
|
3684
4262
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3685
4263
|
TableRow,
|
|
3686
4264
|
{
|
|
@@ -3698,7 +4276,7 @@ function DataTable({
|
|
|
3698
4276
|
backgroundColor: backgroundColor ? backgroundColor : "",
|
|
3699
4277
|
...stylesRow(row)
|
|
3700
4278
|
},
|
|
3701
|
-
className:
|
|
4279
|
+
className: clsx9__default.default(
|
|
3702
4280
|
{
|
|
3703
4281
|
["hidden"]: cell.row.original._destroy,
|
|
3704
4282
|
["first:border-l last:border-r"]: borderFull,
|
|
@@ -3736,6 +4314,7 @@ function DataTable({
|
|
|
3736
4314
|
|
|
3737
4315
|
exports.Badge = Badge;
|
|
3738
4316
|
exports.Button = Button;
|
|
4317
|
+
exports.ButtonLink = ButtonLink;
|
|
3739
4318
|
exports.Calendar = Calendar;
|
|
3740
4319
|
exports.Checkbox = Checkbox;
|
|
3741
4320
|
exports.DataTable = DataTable;
|
|
@@ -3755,6 +4334,7 @@ exports.Popover = Popover3;
|
|
|
3755
4334
|
exports.Radio = Radio;
|
|
3756
4335
|
exports.RocketIcon = RocketIcon;
|
|
3757
4336
|
exports.SelectField = SelectField;
|
|
4337
|
+
exports.SelectFieldBip = SelectFieldBip;
|
|
3758
4338
|
exports.SpinnerIcon = SpinnerIcon;
|
|
3759
4339
|
exports.Table = Table;
|
|
3760
4340
|
exports.TableBody = TableBody;
|
|
@@ -3766,5 +4346,6 @@ exports.TableHeader = TableHeader;
|
|
|
3766
4346
|
exports.TableRow = TableRow;
|
|
3767
4347
|
exports.Toggle = Toggle;
|
|
3768
4348
|
exports.ValueContainer = ValueContainer;
|
|
4349
|
+
exports.sizes = sizes2;
|
|
3769
4350
|
//# sourceMappingURL=index.cjs.map
|
|
3770
4351
|
//# sourceMappingURL=index.cjs.map
|