@sustaina/shared-ui 1.23.1 → 1.25.0
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.d.mts +42 -10
- package/dist/index.d.ts +42 -10
- package/dist/index.js +290 -59
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +290 -60
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,6 @@ import { twMerge } from 'tailwind-merge';
|
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import * as React4 from 'react';
|
|
6
6
|
import React4__default, { forwardRef, useRef, useMemo, useCallback, isValidElement, useState, useEffect, useLayoutEffect, createElement } from 'react';
|
|
7
|
-
import { format, isValid, parseISO, isAfter, compareAsc, parse } from 'date-fns';
|
|
8
7
|
import { CircleX, CircleHelp, Undo, Redo, Bold, Italic, Underline, Strikethrough, Code, Pilcrow, Heading1, Heading2, Heading3, List as List$1, ListOrdered, Quote, CodeSquare, Link, Link2Off, Image as Image$1, AlignLeft, AlignCenter, AlignRight, XIcon, ChevronRight, CheckIcon, Triangle, CalendarIcon, X, Search, ChevronUp, ChevronDown, Minimize2, Maximize2, Plus, ChevronLeft, CircleUserRound, PanelLeftIcon, Bug, GripVertical, Info, CircleMinus, Minus } from 'lucide-react';
|
|
9
8
|
import { createPortal } from 'react-dom';
|
|
10
9
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
@@ -12,6 +11,7 @@ import { useForm, FormProvider, Controller, useFormContext, useFormState, useFie
|
|
|
12
11
|
import { Slot } from '@radix-ui/react-slot';
|
|
13
12
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
14
13
|
import { cva } from 'class-variance-authority';
|
|
14
|
+
import { format, isValid, parseISO, isAfter, compareAsc, parse } from 'date-fns';
|
|
15
15
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
16
16
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
17
17
|
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
@@ -57,6 +57,7 @@ import { $setBlocksType } from '@lexical/selection';
|
|
|
57
57
|
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
58
58
|
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
59
59
|
import Cropper from 'react-easy-crop';
|
|
60
|
+
import { NumericFormat } from 'react-number-format';
|
|
60
61
|
|
|
61
62
|
var __defProp = Object.defineProperty;
|
|
62
63
|
var __export = (target, all) => {
|
|
@@ -3420,6 +3421,66 @@ function getBuilder(fieldType) {
|
|
|
3420
3421
|
return new JSONBuilder();
|
|
3421
3422
|
}
|
|
3422
3423
|
}
|
|
3424
|
+
var FILTER_FIELD_MAP = {
|
|
3425
|
+
timezone: "timezoneId",
|
|
3426
|
+
decimalSeparator: "decimalSeparatorId",
|
|
3427
|
+
country: "countryId",
|
|
3428
|
+
currency: "currencyId"
|
|
3429
|
+
};
|
|
3430
|
+
function transformFilterKeys(obj, fieldMap = FILTER_FIELD_MAP) {
|
|
3431
|
+
if (Array.isArray(obj)) {
|
|
3432
|
+
return obj.map((item) => transformFilterKeys(item, fieldMap));
|
|
3433
|
+
}
|
|
3434
|
+
if (obj && typeof obj === "object") {
|
|
3435
|
+
const newObj = {};
|
|
3436
|
+
for (const key in obj) {
|
|
3437
|
+
const mappedKey = fieldMap[key] ?? key;
|
|
3438
|
+
newObj[mappedKey] = transformFilterKeys(obj[key], fieldMap);
|
|
3439
|
+
}
|
|
3440
|
+
return newObj;
|
|
3441
|
+
}
|
|
3442
|
+
return obj;
|
|
3443
|
+
}
|
|
3444
|
+
var sanitizeInput = (val) => {
|
|
3445
|
+
if (!val) return val;
|
|
3446
|
+
if (typeof val !== "string") return "__INVALID_TYPE__";
|
|
3447
|
+
if (val.includes("\n") || val.includes("\r") || /[\u2028\u2029]/u.test(val))
|
|
3448
|
+
return "__INVALID_NEWLINE__";
|
|
3449
|
+
if (/\\\\/.test(val)) return "__INVALID_ESCAPE__";
|
|
3450
|
+
if (/\\(n|t|r|b|f|u[0-9a-fA-F]{4})/.test(val)) return "__INVALID_ESCAPE__";
|
|
3451
|
+
if (/\p{Cf}/u.test(val)) return "__INVALID_UNICODE_WHITESPACE__";
|
|
3452
|
+
if (/[\u00A0\u1680\u180E\u202F\u205F\u3000]/u.test(val)) return "__INVALID_UNICODE_WHITESPACE__";
|
|
3453
|
+
const trimmed = val.trim();
|
|
3454
|
+
if (/^\{.*\}$/s.test(trimmed) || /^\[.*\]$/s.test(trimmed)) return "__INVALID_JSON_LITERAL__";
|
|
3455
|
+
if (/\\\{/.test(val) || /\\\}/.test(val)) return "__INVALID_JSON_ESCAPE__";
|
|
3456
|
+
if (/[%_*~^]/.test(trimmed)) return "__INVALID_WILDCARD__";
|
|
3457
|
+
if (/[%><={}\\[\]"']/u.test(trimmed)) return "__INVALID_CHAR__";
|
|
3458
|
+
if (/\p{Cc}/u.test(val)) return "__INVALID_CONTROL_CHAR__";
|
|
3459
|
+
return trimmed.replace(/\s+/g, " ");
|
|
3460
|
+
};
|
|
3461
|
+
var numericTypes = ["number", "integer", "decimal"];
|
|
3462
|
+
var dateTypes = ["date", "datemonth"];
|
|
3463
|
+
var validateByFieldType = (value, fieldType) => {
|
|
3464
|
+
if (!value) return { valid: true };
|
|
3465
|
+
if (numericTypes.includes(fieldType)) {
|
|
3466
|
+
if (!/^\d+(\.\d+)?$/.test(value)) {
|
|
3467
|
+
return { valid: false, message: "Please enter a valid number." };
|
|
3468
|
+
}
|
|
3469
|
+
}
|
|
3470
|
+
if (fieldType === "boolean") {
|
|
3471
|
+
if (!["true", "false"].includes(value.toLowerCase())) {
|
|
3472
|
+
return { valid: false, message: "Please enter a boolean value (true/false)." };
|
|
3473
|
+
}
|
|
3474
|
+
}
|
|
3475
|
+
if (dateTypes.includes(fieldType)) {
|
|
3476
|
+
const normalized = fieldType === "datemonth" ? `${value}-01` : value;
|
|
3477
|
+
const parsed = parseISO(normalized);
|
|
3478
|
+
if (!isValid(parsed)) {
|
|
3479
|
+
return { valid: false, message: "Invalid date format." };
|
|
3480
|
+
}
|
|
3481
|
+
}
|
|
3482
|
+
return { valid: true };
|
|
3483
|
+
};
|
|
3423
3484
|
var AdvanceSearch = ({
|
|
3424
3485
|
fields,
|
|
3425
3486
|
portalId,
|
|
@@ -3427,7 +3488,8 @@ var AdvanceSearch = ({
|
|
|
3427
3488
|
limitRows = 4,
|
|
3428
3489
|
onSearch,
|
|
3429
3490
|
onClear,
|
|
3430
|
-
shortDateFormat
|
|
3491
|
+
shortDateFormat,
|
|
3492
|
+
filterFieldMap = FILTER_FIELD_MAP
|
|
3431
3493
|
}) => {
|
|
3432
3494
|
const fieldsData = useMemo(() => {
|
|
3433
3495
|
if (fields.length === 0) throw new Error("fields cannot be an empty array");
|
|
@@ -3479,72 +3541,75 @@ var AdvanceSearch = ({
|
|
|
3479
3541
|
const onSubmit = useCallback(() => {
|
|
3480
3542
|
const operatorValidation = {};
|
|
3481
3543
|
rows.forEach((r) => {
|
|
3482
|
-
const
|
|
3483
|
-
if (!
|
|
3544
|
+
const ops = operatorsForField(r.fieldName);
|
|
3545
|
+
if (!ops.length || !ops.includes(r.operator))
|
|
3484
3546
|
operatorValidation[r.id] = "Please select an operator.";
|
|
3485
|
-
}
|
|
3486
3547
|
});
|
|
3487
3548
|
setOperatorErrors(operatorValidation);
|
|
3488
|
-
if (Object.keys(operatorValidation).length > 0)
|
|
3489
|
-
return;
|
|
3490
|
-
}
|
|
3549
|
+
if (Object.keys(operatorValidation).length > 0) return;
|
|
3491
3550
|
const currentValues = getValues();
|
|
3492
|
-
let
|
|
3493
|
-
const
|
|
3494
|
-
const
|
|
3495
|
-
const
|
|
3551
|
+
let hasError = false;
|
|
3552
|
+
const processedRows = rows.map((r) => {
|
|
3553
|
+
const startField = `value_${r.id}`;
|
|
3554
|
+
const endField = `value2_${r.id}`;
|
|
3555
|
+
let v1 = currentValues[startField] ?? "";
|
|
3556
|
+
let v2 = currentValues[endField] ?? "";
|
|
3557
|
+
const s1 = sanitizeInput(v1);
|
|
3558
|
+
if (s1?.startsWith("__INVALID")) {
|
|
3559
|
+
hasError = true;
|
|
3560
|
+
setError(startField, { type: "validate", message: "Invalid input." });
|
|
3561
|
+
return null;
|
|
3562
|
+
}
|
|
3563
|
+
v1 = s1 || "";
|
|
3564
|
+
const valid1 = validateByFieldType(v1, r.fieldType);
|
|
3565
|
+
if (!valid1.valid) {
|
|
3566
|
+
hasError = true;
|
|
3567
|
+
setError(startField, { type: "validate", message: valid1.message });
|
|
3568
|
+
return null;
|
|
3569
|
+
}
|
|
3496
3570
|
if (r.operator === "between") {
|
|
3497
|
-
const
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3571
|
+
const s2 = sanitizeInput(v2);
|
|
3572
|
+
if (s2?.startsWith("__INVALID")) {
|
|
3573
|
+
hasError = true;
|
|
3574
|
+
setError(endField, { type: "validate", message: "Invalid input." });
|
|
3575
|
+
return null;
|
|
3576
|
+
}
|
|
3577
|
+
v2 = s2 || "";
|
|
3578
|
+
const valid2 = validateByFieldType(v2, r.fieldType);
|
|
3579
|
+
if (!valid2.valid) {
|
|
3580
|
+
hasError = true;
|
|
3581
|
+
setError(endField, { type: "validate", message: valid2.message });
|
|
3582
|
+
return null;
|
|
3583
|
+
}
|
|
3584
|
+
if (v1 && v2 && ["date", "datemonth"].includes(r.fieldType)) {
|
|
3585
|
+
const d1 = parseRangeValue(v1, r.fieldType);
|
|
3586
|
+
const d2 = parseRangeValue(v2, r.fieldType);
|
|
3587
|
+
if (d1 && d2 && isAfter(d1, d2)) {
|
|
3588
|
+
hasError = true;
|
|
3589
|
+
setError(startField, { type: "validate", message: "Start value must be before end value." });
|
|
3590
|
+
setError(endField, { type: "validate", message: "End value must be after start value." });
|
|
3591
|
+
return null;
|
|
3514
3592
|
}
|
|
3515
3593
|
}
|
|
3516
|
-
return {
|
|
3517
|
-
...r,
|
|
3518
|
-
value: startValue ?? "",
|
|
3519
|
-
value2: endValue ?? ""
|
|
3520
|
-
};
|
|
3594
|
+
return { ...r, value: v1, value2: v2 };
|
|
3521
3595
|
}
|
|
3522
|
-
return {
|
|
3523
|
-
...r,
|
|
3524
|
-
value: startValue ?? ""
|
|
3525
|
-
};
|
|
3596
|
+
return { ...r, value: v1 };
|
|
3526
3597
|
});
|
|
3527
|
-
if (
|
|
3528
|
-
|
|
3529
|
-
}
|
|
3598
|
+
if (hasError) return;
|
|
3599
|
+
const cleanedRows = processedRows.filter(Boolean);
|
|
3530
3600
|
const param = {
|
|
3531
|
-
AND:
|
|
3532
|
-
const builder = getBuilder(r.fieldType);
|
|
3533
|
-
return builder.build(r);
|
|
3534
|
-
}).filter(Boolean)
|
|
3601
|
+
AND: cleanedRows.map((r) => getBuilder(r.fieldType).build(r)).filter(Boolean)
|
|
3535
3602
|
};
|
|
3536
|
-
if (onSearch)
|
|
3537
|
-
onSearch(param);
|
|
3538
|
-
}
|
|
3603
|
+
if (onSearch) onSearch(transformFilterKeys(param, filterFieldMap));
|
|
3539
3604
|
}, [
|
|
3540
|
-
|
|
3541
|
-
getValues,
|
|
3542
|
-
onSearch,
|
|
3605
|
+
rows,
|
|
3543
3606
|
operatorsForField,
|
|
3607
|
+
getValues,
|
|
3544
3608
|
parseRangeValue,
|
|
3545
|
-
rows,
|
|
3546
3609
|
setError,
|
|
3547
|
-
setOperatorErrors
|
|
3610
|
+
setOperatorErrors,
|
|
3611
|
+
filterFieldMap,
|
|
3612
|
+
onSearch
|
|
3548
3613
|
]);
|
|
3549
3614
|
return /* @__PURE__ */ jsx(
|
|
3550
3615
|
ExpandCollapse_default,
|
|
@@ -3582,9 +3647,7 @@ var AdvanceSearch = ({
|
|
|
3582
3647
|
unregister(`value_${row.id}`);
|
|
3583
3648
|
unregister(`value2_${row.id}`);
|
|
3584
3649
|
},
|
|
3585
|
-
onClearValue: (which) =>
|
|
3586
|
-
clearValue(row.id, which);
|
|
3587
|
-
},
|
|
3650
|
+
onClearValue: (which) => clearValue(row.id, which),
|
|
3588
3651
|
disableAdd: limitRows !== void 0 && rows.length >= limitRows
|
|
3589
3652
|
},
|
|
3590
3653
|
row.id
|
|
@@ -3609,7 +3672,7 @@ var AdvanceSearch = ({
|
|
|
3609
3672
|
Button,
|
|
3610
3673
|
{
|
|
3611
3674
|
type: "submit",
|
|
3612
|
-
className: "w-full bg-
|
|
3675
|
+
className: "w-full bg-sus-green-2 text-white hover:bg-[#2f7c21] md:w-auto md:min-w-[120px]",
|
|
3613
3676
|
"data-testid": "advsearch-btn-search",
|
|
3614
3677
|
children: "Search"
|
|
3615
3678
|
}
|
|
@@ -6546,8 +6609,8 @@ var GridSettingsModal = ({
|
|
|
6546
6609
|
}
|
|
6547
6610
|
}, [isOpen, currentColumns, form]);
|
|
6548
6611
|
const addColumn = async () => {
|
|
6549
|
-
const
|
|
6550
|
-
if (
|
|
6612
|
+
const isValid6 = await trigger("columns");
|
|
6613
|
+
if (isValid6) {
|
|
6551
6614
|
append({ id: "" });
|
|
6552
6615
|
requestAnimationFrame(() => {
|
|
6553
6616
|
const container = scrollRef.current;
|
|
@@ -9737,7 +9800,174 @@ var Truncated = ({ children, className, ellipsis = true, as = "p", style }) => {
|
|
|
9737
9800
|
);
|
|
9738
9801
|
};
|
|
9739
9802
|
var truncated_default = Truncated;
|
|
9803
|
+
var InputPrimitive2 = React4.forwardRef(
|
|
9804
|
+
({ className, type = "text", ...props }, ref) => {
|
|
9805
|
+
return /* @__PURE__ */ jsx(
|
|
9806
|
+
"input",
|
|
9807
|
+
{
|
|
9808
|
+
ref,
|
|
9809
|
+
type,
|
|
9810
|
+
className: cn(
|
|
9811
|
+
"placeholder:text-neutral-400 text-neutral-900 flex h-10 w-full min-w-0 items-center rounded-lg border bg-white px-4 text-sm transition-colors outline-none file:inline-flex file:h-7 file:rounded-md file:border-0 file:bg-transparent file:px-2 file:text-sm file:font-medium hover:border-neutral-500 focus-visible:border-neutral-900 focus-visible:ring-0 disabled:cursor-not-allowed disabled:bg-neutral-100 disabled:text-neutral-400 disabled:border-neutral-200 aria-invalid:border-destructive",
|
|
9812
|
+
className
|
|
9813
|
+
),
|
|
9814
|
+
...props
|
|
9815
|
+
}
|
|
9816
|
+
);
|
|
9817
|
+
}
|
|
9818
|
+
);
|
|
9819
|
+
InputPrimitive2.displayName = "InputPrimitive";
|
|
9820
|
+
var inputVariants2 = cva("", {
|
|
9821
|
+
variants: {
|
|
9822
|
+
controlSize: {
|
|
9823
|
+
sm: "h-9 rounded-md px-3 text-sm",
|
|
9824
|
+
md: "h-10 rounded-lg px-4 text-sm",
|
|
9825
|
+
lg: "h-12 rounded-xl px-5 text-base"
|
|
9826
|
+
},
|
|
9827
|
+
fullWidth: {
|
|
9828
|
+
true: "w-full",
|
|
9829
|
+
false: "w-auto"
|
|
9830
|
+
},
|
|
9831
|
+
appearance: {
|
|
9832
|
+
filled: "border-neutral-200 hover:border-neutral-500 focus-visible:border-neutral-900",
|
|
9833
|
+
unfilled: "bg-white border-neutral-300 hover:border-neutral-500 focus-visible:border-neutral-900"
|
|
9834
|
+
}
|
|
9835
|
+
},
|
|
9836
|
+
defaultVariants: {
|
|
9837
|
+
controlSize: "sm",
|
|
9838
|
+
fullWidth: true,
|
|
9839
|
+
appearance: "filled"
|
|
9840
|
+
}
|
|
9841
|
+
});
|
|
9842
|
+
var Input2 = React4.forwardRef(
|
|
9843
|
+
({
|
|
9844
|
+
className,
|
|
9845
|
+
wrapperClassName,
|
|
9846
|
+
controlSize,
|
|
9847
|
+
fullWidth,
|
|
9848
|
+
appearance,
|
|
9849
|
+
addonPrefix,
|
|
9850
|
+
addonPrefixProps,
|
|
9851
|
+
prefixInteractive,
|
|
9852
|
+
addonSuffix,
|
|
9853
|
+
addonSuffixProps,
|
|
9854
|
+
suffixInteractive,
|
|
9855
|
+
invalid,
|
|
9856
|
+
loading,
|
|
9857
|
+
loadingIcon,
|
|
9858
|
+
validationMessage,
|
|
9859
|
+
validationIcon,
|
|
9860
|
+
validationMessageProps,
|
|
9861
|
+
onValueChange,
|
|
9862
|
+
type = "text",
|
|
9863
|
+
...rest
|
|
9864
|
+
}, ref) => {
|
|
9865
|
+
const inputProps = rest;
|
|
9866
|
+
const hasPrefix = Boolean(addonPrefix);
|
|
9867
|
+
const hasSuffix = Boolean(addonSuffix) || loading;
|
|
9868
|
+
const isFullWidth = fullWidth ?? true;
|
|
9869
|
+
const {
|
|
9870
|
+
"aria-invalid": ariaInvalidProp,
|
|
9871
|
+
"aria-describedby": ariaDescribedByProp,
|
|
9872
|
+
onChange: onChangeProp
|
|
9873
|
+
} = rest;
|
|
9874
|
+
const ariaInvalid = invalid ?? ariaInvalidProp;
|
|
9875
|
+
const messageId = React4.useId();
|
|
9876
|
+
const handleChange = React4.useCallback(
|
|
9877
|
+
(event) => {
|
|
9878
|
+
onChangeProp?.(event);
|
|
9879
|
+
onValueChange?.(event.target.value);
|
|
9880
|
+
},
|
|
9881
|
+
[onChangeProp, onValueChange]
|
|
9882
|
+
);
|
|
9883
|
+
const resolvedAriaInvalid = typeof ariaInvalid === "string" ? ariaInvalid : ariaInvalid ? true : void 0;
|
|
9884
|
+
const describedBy = validationMessage ? [ariaDescribedByProp, messageId].filter(Boolean).join(" ") : ariaDescribedByProp;
|
|
9885
|
+
const controlWrapperClassName = cn(
|
|
9886
|
+
"relative inline-flex items-center",
|
|
9887
|
+
isFullWidth ? "w-full" : "w-fit",
|
|
9888
|
+
!validationMessage && wrapperClassName
|
|
9889
|
+
);
|
|
9890
|
+
const inputElement = /* @__PURE__ */ jsx(
|
|
9891
|
+
InputPrimitive2,
|
|
9892
|
+
{
|
|
9893
|
+
ref,
|
|
9894
|
+
type,
|
|
9895
|
+
"data-slot": "input",
|
|
9896
|
+
className: cn(
|
|
9897
|
+
inputVariants2({ controlSize, fullWidth: isFullWidth, appearance }),
|
|
9898
|
+
hasPrefix && "pl-10",
|
|
9899
|
+
hasSuffix && "pr-10",
|
|
9900
|
+
className
|
|
9901
|
+
),
|
|
9902
|
+
"aria-invalid": resolvedAriaInvalid,
|
|
9903
|
+
"aria-describedby": describedBy || void 0,
|
|
9904
|
+
onChange: handleChange,
|
|
9905
|
+
...inputProps
|
|
9906
|
+
}
|
|
9907
|
+
);
|
|
9908
|
+
if (!hasPrefix && !hasSuffix && !validationMessage) {
|
|
9909
|
+
return inputElement;
|
|
9910
|
+
}
|
|
9911
|
+
const { className: prefixClassName, ...prefixRest } = addonPrefixProps ?? {};
|
|
9912
|
+
const { className: suffixClassName, ...suffixRest } = addonSuffixProps ?? {};
|
|
9913
|
+
const { className: validationMessageClassName, ...validationMessageRest } = validationMessageProps ?? {};
|
|
9914
|
+
const suffixContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9915
|
+
addonSuffix,
|
|
9916
|
+
loading && (loadingIcon ?? /* @__PURE__ */ jsx(Spinner, { size: 16, variant: "muted" }))
|
|
9917
|
+
] });
|
|
9918
|
+
const inputWithAffixes = /* @__PURE__ */ jsxs("div", { "data-slot": "input-wrapper", className: controlWrapperClassName, children: [
|
|
9919
|
+
hasPrefix && /* @__PURE__ */ jsx(
|
|
9920
|
+
"span",
|
|
9921
|
+
{
|
|
9922
|
+
...prefixRest,
|
|
9923
|
+
className: cn(
|
|
9924
|
+
"absolute left-3 top-1/2 -translate-y-1/2 inline-flex items-center text-muted-foreground",
|
|
9925
|
+
!prefixInteractive && "pointer-events-none",
|
|
9926
|
+
prefixClassName
|
|
9927
|
+
),
|
|
9928
|
+
children: addonPrefix
|
|
9929
|
+
}
|
|
9930
|
+
),
|
|
9931
|
+
inputElement,
|
|
9932
|
+
hasSuffix && /* @__PURE__ */ jsx(
|
|
9933
|
+
"span",
|
|
9934
|
+
{
|
|
9935
|
+
...suffixRest,
|
|
9936
|
+
className: cn(
|
|
9937
|
+
"absolute right-3 top-1/2 -translate-y-1/2 inline-flex items-center gap-2 text-muted-foreground",
|
|
9938
|
+
!suffixInteractive && "pointer-events-none",
|
|
9939
|
+
suffixClassName
|
|
9940
|
+
),
|
|
9941
|
+
children: suffixContent
|
|
9942
|
+
}
|
|
9943
|
+
)
|
|
9944
|
+
] });
|
|
9945
|
+
if (!validationMessage) {
|
|
9946
|
+
return inputWithAffixes;
|
|
9947
|
+
}
|
|
9948
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-1", isFullWidth ? "w-full" : "w-fit", wrapperClassName), children: [
|
|
9949
|
+
inputWithAffixes,
|
|
9950
|
+
/* @__PURE__ */ jsxs(
|
|
9951
|
+
"p",
|
|
9952
|
+
{
|
|
9953
|
+
id: messageId,
|
|
9954
|
+
...validationMessageRest,
|
|
9955
|
+
className: cn("flex items-center gap-2 text-sm text-destructive", validationMessageClassName),
|
|
9956
|
+
children: [
|
|
9957
|
+
validationIcon ?? /* @__PURE__ */ jsx(CircleX, { className: "size-4" }),
|
|
9958
|
+
/* @__PURE__ */ jsx("span", { children: validationMessage })
|
|
9959
|
+
]
|
|
9960
|
+
}
|
|
9961
|
+
)
|
|
9962
|
+
] });
|
|
9963
|
+
}
|
|
9964
|
+
);
|
|
9965
|
+
Input2.displayName = "Input";
|
|
9966
|
+
var InputNumber = ({ customInputProps, ...props }) => {
|
|
9967
|
+
return /* @__PURE__ */ jsx(NumericFormat, { customInput: Input2, ...props, ...customInputProps });
|
|
9968
|
+
};
|
|
9969
|
+
var InputNumber_default = InputNumber;
|
|
9740
9970
|
|
|
9741
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AdvanceSearch_default as AdvanceSearch, arrow_default as ArrowIcon, Button, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, CropperModal, CropperModalError, DIALOG_ALERT_I18N_SUBNAMESPACE, DataTable_default as DataTable, DatePicker2 as DatePicker, Dialog, DialogAlert, DialogAlertProvider, DialogContent, DialogDescription, DialogFooter, DialogTitle, DialogTrigger, ErrorCompression, ErrorCreateCanvas, ErrorGeneratingBlob, ErrorInvalidSVG, ErrorSVGExceedSize, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormulaEditor, GridSettingsModal_default as GridSettingsModal, HeaderCell_default as HeaderCell, Image2 as Image, Input, Label2 as Label, List_default as List, container_default as ListContainer, header_default as ListHeader, table_default as ListTable, LookupSelect, MonthPicker2 as MonthPicker, navbar_default as Navbar, not_found_default as NotFoundIcon, Popover, PopoverAnchor, PopoverArrow, PopoverContent, PopoverTrigger, PreventPageLeave_default as PreventPageLeave, RadioGroupItem, RadioGroupRoot, RadioLabel, RichText, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator2 as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarLayout, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Spinner, calendar_default as SuiCalendarIcon, check_default as SuiCheckIcon, dots_vertical_default as SuiDotsVerticalIcon, empty_data_default as SuiEmptyDataIcon, expand_default as SuiExpandIcon, filter_default as SuiFilterIcon, setting_default as SuiSettingIcon, triangle_down_default as SuiTriangleDownIcon, warning_default as SuiWarningIcon, Switch, Textarea, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipTrigger, truncated_default as Truncated, ui_exports as UI, booleanToSelectValue, buildPrefixMap, buttonVariants, cn, compareAlphanumeric, debounce, defaultOperatorShortcuts, defaultOperators, formatISODate, getDialogAlertControls, getDialogTemplates, inputVariants, isDefined, isEmptyObject, isValidParentheses, mapTokensToOutput, parseFormula, parseFormulaToToken, selectValueToBoolean, spinnerVariants, splitOperators, stripNullishObject, throttle, tokenizeFormulaString, useFormField, useGridSettingsStore_default as useGridSettingsStore, useHover_default as useHover, useIntersectionObserver_default as useIntersectionObserver, useMediaQuery_default as useMediaQuery, usePreventPageLeave_default as usePreventPageLeave, usePreventPageLeaveStore_default as usePreventPageLeaveStore, useScreenSize_default as useScreenSize, useSidebar, useTruncated_default as useTruncated, validateTokenPrefixes };
|
|
9971
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AdvanceSearch_default as AdvanceSearch, arrow_default as ArrowIcon, Button, Checkbox, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, CropperModal, CropperModalError, DIALOG_ALERT_I18N_SUBNAMESPACE, DataTable_default as DataTable, DatePicker2 as DatePicker, Dialog, DialogAlert, DialogAlertProvider, DialogContent, DialogDescription, DialogFooter, DialogTitle, DialogTrigger, ErrorCompression, ErrorCreateCanvas, ErrorGeneratingBlob, ErrorInvalidSVG, ErrorSVGExceedSize, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormulaEditor, GridSettingsModal_default as GridSettingsModal, HeaderCell_default as HeaderCell, Image2 as Image, Input, InputNumber_default as InputNumber, Label2 as Label, List_default as List, container_default as ListContainer, header_default as ListHeader, table_default as ListTable, LookupSelect, MonthPicker2 as MonthPicker, navbar_default as Navbar, not_found_default as NotFoundIcon, Popover, PopoverAnchor, PopoverArrow, PopoverContent, PopoverTrigger, PreventPageLeave_default as PreventPageLeave, RadioGroupItem, RadioGroupRoot, RadioLabel, RichText, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator2 as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarLayout, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Spinner, calendar_default as SuiCalendarIcon, check_default as SuiCheckIcon, dots_vertical_default as SuiDotsVerticalIcon, empty_data_default as SuiEmptyDataIcon, expand_default as SuiExpandIcon, filter_default as SuiFilterIcon, setting_default as SuiSettingIcon, triangle_down_default as SuiTriangleDownIcon, warning_default as SuiWarningIcon, Switch, Textarea, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipTrigger, truncated_default as Truncated, ui_exports as UI, booleanToSelectValue, buildPrefixMap, buttonVariants, cn, compareAlphanumeric, debounce, defaultOperatorShortcuts, defaultOperators, formatISODate, getDialogAlertControls, getDialogTemplates, inputVariants, isDefined, isEmptyObject, isValidParentheses, mapTokensToOutput, parseFormula, parseFormulaToToken, selectValueToBoolean, spinnerVariants, splitOperators, stripNullishObject, throttle, tokenizeFormulaString, useFormField, useGridSettingsStore_default as useGridSettingsStore, useHover_default as useHover, useIntersectionObserver_default as useIntersectionObserver, useMediaQuery_default as useMediaQuery, usePreventPageLeave_default as usePreventPageLeave, usePreventPageLeaveStore_default as usePreventPageLeaveStore, useScreenSize_default as useScreenSize, useSidebar, useTruncated_default as useTruncated, validateTokenPrefixes };
|
|
9742
9972
|
//# sourceMappingURL=index.mjs.map
|
|
9743
9973
|
//# sourceMappingURL=index.mjs.map
|