@sustaina/shared-ui 1.14.0 → 1.16.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 +43 -1
- package/dist/index.d.ts +43 -1
- package/dist/index.js +318 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +317 -25
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -214,6 +214,45 @@ function stripNullishObject(value) {
|
|
|
214
214
|
return {};
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
+
|
|
218
|
+
// src/utils/date.ts
|
|
219
|
+
var pad = (num) => String(num).padStart(2, "0");
|
|
220
|
+
function formatISODate(isoDate, format5 = "d/m/Y H:i") {
|
|
221
|
+
const date = new Date(isoDate);
|
|
222
|
+
if (isNaN(date.getTime())) {
|
|
223
|
+
return "Invalid Date";
|
|
224
|
+
}
|
|
225
|
+
const parts = {
|
|
226
|
+
d: pad(date.getDate()),
|
|
227
|
+
m: pad(date.getMonth() + 1),
|
|
228
|
+
Y: String(date.getFullYear()),
|
|
229
|
+
H: pad(date.getHours()),
|
|
230
|
+
i: pad(date.getMinutes()),
|
|
231
|
+
s: pad(date.getSeconds())
|
|
232
|
+
};
|
|
233
|
+
const tokenMap = {
|
|
234
|
+
// Day
|
|
235
|
+
d: "d",
|
|
236
|
+
DD: "d",
|
|
237
|
+
// Month
|
|
238
|
+
m: "m",
|
|
239
|
+
MM: "m",
|
|
240
|
+
// Year
|
|
241
|
+
Y: "Y",
|
|
242
|
+
// 'Y' and 'YYYY' will both map to the 4-digit year
|
|
243
|
+
YYYY: "Y",
|
|
244
|
+
// Hour
|
|
245
|
+
H: "H",
|
|
246
|
+
// Minute
|
|
247
|
+
i: "i",
|
|
248
|
+
// Second
|
|
249
|
+
s: "s"
|
|
250
|
+
};
|
|
251
|
+
return format5.replace(/YYYY|Y|MM|m|DD|d|H|i|s/g, (match) => {
|
|
252
|
+
const partKey = tokenMap[match];
|
|
253
|
+
return partKey ? parts[partKey] : match;
|
|
254
|
+
});
|
|
255
|
+
}
|
|
217
256
|
function cn(...args) {
|
|
218
257
|
return tailwindMerge.twMerge(clsx2.clsx(args));
|
|
219
258
|
}
|
|
@@ -848,7 +887,7 @@ function SelectTrigger({
|
|
|
848
887
|
"data-slot": "select-trigger",
|
|
849
888
|
"data-size": size,
|
|
850
889
|
className: cn(
|
|
851
|
-
"border-input data-
|
|
890
|
+
"border-input data-placeholder:text-gray-00 [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[state=open]:border-ring data-[state=open]:[&_svg]:text-foreground",
|
|
852
891
|
className
|
|
853
892
|
),
|
|
854
893
|
...props,
|
|
@@ -870,7 +909,7 @@ function SelectContent({
|
|
|
870
909
|
{
|
|
871
910
|
"data-slot": "select-content",
|
|
872
911
|
className: cn(
|
|
873
|
-
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-
|
|
912
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
|
|
874
913
|
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
875
914
|
className
|
|
876
915
|
),
|
|
@@ -883,7 +922,7 @@ function SelectContent({
|
|
|
883
922
|
{
|
|
884
923
|
className: cn(
|
|
885
924
|
"m-1",
|
|
886
|
-
position === "popper" && "h-
|
|
925
|
+
position === "popper" && "h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width) scroll-my-1"
|
|
887
926
|
),
|
|
888
927
|
children
|
|
889
928
|
}
|
|
@@ -913,7 +952,7 @@ function SelectItem({
|
|
|
913
952
|
{
|
|
914
953
|
"data-slot": "select-item",
|
|
915
954
|
className: cn(
|
|
916
|
-
"hover:bg-[#EAF5EE] hover:text-[#379A2A] [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-
|
|
955
|
+
"hover:bg-[#EAF5EE] hover:text-[#379A2A] [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 ",
|
|
917
956
|
className
|
|
918
957
|
),
|
|
919
958
|
...props,
|
|
@@ -1806,7 +1845,7 @@ var DatePicker2 = ({
|
|
|
1806
1845
|
value,
|
|
1807
1846
|
onChange,
|
|
1808
1847
|
onValueChange,
|
|
1809
|
-
placeholder:
|
|
1848
|
+
placeholder: placeholder2 = "DD/MM/YYYY",
|
|
1810
1849
|
allowClear = true,
|
|
1811
1850
|
displayFormatter,
|
|
1812
1851
|
valueFormatter,
|
|
@@ -1835,7 +1874,7 @@ var DatePicker2 = ({
|
|
|
1835
1874
|
const parsed = parser(value);
|
|
1836
1875
|
return parsed && dateFns.isValid(parsed) ? parsed : void 0;
|
|
1837
1876
|
}, [parser, value]);
|
|
1838
|
-
const buttonLabel = parsedValue ? labelFormatter(parsedValue) :
|
|
1877
|
+
const buttonLabel = parsedValue ? labelFormatter(parsedValue) : placeholder2;
|
|
1839
1878
|
const buttonAriaLabel = ariaLabel ?? (parsedValue ? `Change date, current selection ${labelFormatter(parsedValue)}` : "Open date picker");
|
|
1840
1879
|
const shouldShowClear = allowClear && !disabled && !!parsedValue;
|
|
1841
1880
|
const handleClose = React4__namespace.default.useCallback(() => setOpen(false), []);
|
|
@@ -1909,8 +1948,15 @@ var DatePicker2 = ({
|
|
|
1909
1948
|
)
|
|
1910
1949
|
] }) });
|
|
1911
1950
|
};
|
|
1912
|
-
|
|
1913
|
-
|
|
1951
|
+
|
|
1952
|
+
// src/components/advanceSearch/components/constants/index.ts
|
|
1953
|
+
var fallbackShortDateFormat = "DD/MM/YYYY";
|
|
1954
|
+
var ConditionDateInput = ({
|
|
1955
|
+
row,
|
|
1956
|
+
control,
|
|
1957
|
+
onClear,
|
|
1958
|
+
shortDateFormat = fallbackShortDateFormat
|
|
1959
|
+
}) => {
|
|
1914
1960
|
const isBetween = row.operator === "between";
|
|
1915
1961
|
const buildAriaLabel = (isEnd) => {
|
|
1916
1962
|
if (isEnd) return "Select end date";
|
|
@@ -1942,10 +1988,11 @@ var ConditionDateInput = ({ row, control, onClear }) => {
|
|
|
1942
1988
|
...field,
|
|
1943
1989
|
value: field.value || void 0,
|
|
1944
1990
|
onValueChange: handleValueChange,
|
|
1945
|
-
placeholder,
|
|
1991
|
+
placeholder: shortDateFormat,
|
|
1946
1992
|
ariaLabel: buildAriaLabel(options?.isEnd),
|
|
1947
1993
|
clearAriaLabel: buildClearLabel(options?.isEnd),
|
|
1948
1994
|
invalid: Boolean(fieldState.error),
|
|
1995
|
+
displayFormatter: (d) => formatISODate(d, shortDateFormat),
|
|
1949
1996
|
wrapperClassName: "min-w-0"
|
|
1950
1997
|
}
|
|
1951
1998
|
) }),
|
|
@@ -2229,7 +2276,7 @@ var MonthPicker2 = ({
|
|
|
2229
2276
|
value,
|
|
2230
2277
|
onChange,
|
|
2231
2278
|
onValueChange,
|
|
2232
|
-
placeholder:
|
|
2279
|
+
placeholder: placeholder2 = "MM/YYYY",
|
|
2233
2280
|
allowClear = true,
|
|
2234
2281
|
displayFormatter,
|
|
2235
2282
|
valueFormatter,
|
|
@@ -2261,7 +2308,7 @@ var MonthPicker2 = ({
|
|
|
2261
2308
|
}
|
|
2262
2309
|
return void 0;
|
|
2263
2310
|
}, [parser, value]);
|
|
2264
|
-
const buttonLabel = parsedValue ? labelFormatter(parsedValue) :
|
|
2311
|
+
const buttonLabel = parsedValue ? labelFormatter(parsedValue) : placeholder2;
|
|
2265
2312
|
const buttonAriaLabel = ariaLabel ?? (parsedValue ? `Change month, current selection ${labelFormatter(parsedValue)}` : "Open month picker");
|
|
2266
2313
|
const shouldShowClear = allowClear && !disabled && !!parsedValue;
|
|
2267
2314
|
const handleClose = React4__namespace.default.useCallback(() => setOpen(false), []);
|
|
@@ -2336,7 +2383,7 @@ var MonthPicker2 = ({
|
|
|
2336
2383
|
)
|
|
2337
2384
|
] }) });
|
|
2338
2385
|
};
|
|
2339
|
-
var
|
|
2386
|
+
var placeholder = "MM/YYYY";
|
|
2340
2387
|
var ConditionMonthInput = ({ row, control, onClear }) => {
|
|
2341
2388
|
const isBetween = row.operator === "between";
|
|
2342
2389
|
const buildAriaLabel = (isEnd) => {
|
|
@@ -2370,7 +2417,7 @@ var ConditionMonthInput = ({ row, control, onClear }) => {
|
|
|
2370
2417
|
...field,
|
|
2371
2418
|
value,
|
|
2372
2419
|
onValueChange: handleValueChange,
|
|
2373
|
-
placeholder
|
|
2420
|
+
placeholder,
|
|
2374
2421
|
ariaLabel: buildAriaLabel(options?.isEnd),
|
|
2375
2422
|
clearAriaLabel: buildClearLabel(options?.isEnd),
|
|
2376
2423
|
displayFormatter: (month) => dateFns.format(month, "MM/yyyy"),
|
|
@@ -2482,7 +2529,7 @@ var LookupSelect = ({
|
|
|
2482
2529
|
onChange,
|
|
2483
2530
|
onClear,
|
|
2484
2531
|
error,
|
|
2485
|
-
placeholder:
|
|
2532
|
+
placeholder: placeholder2,
|
|
2486
2533
|
maxTags = 10,
|
|
2487
2534
|
fetchSuggestions,
|
|
2488
2535
|
suggestionDebounce = 250,
|
|
@@ -2656,7 +2703,7 @@ var LookupSelect = ({
|
|
|
2656
2703
|
window.removeEventListener("scroll", handleReposition, true);
|
|
2657
2704
|
};
|
|
2658
2705
|
}, [dropdownPortalElement, isDropdownOpen, updateDropdownPosition]);
|
|
2659
|
-
const resolvedPlaceholder =
|
|
2706
|
+
const resolvedPlaceholder = placeholder2 ?? "Select";
|
|
2660
2707
|
const showDropdown = isDropdownOpen && !fetchError;
|
|
2661
2708
|
const dropdownContent = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-hidden rounded-md border border-gray-200 bg-white shadow-lg", children: loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2 text-sm text-inherit", children: loadingMessage }) : suggestions.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center px-3 py-4 text-sm text-inherit text-center", children: [
|
|
2662
2709
|
/* @__PURE__ */ jsxRuntime.jsx(not_found_default, { className: "w-full max-w-[80px] h-auto" }),
|
|
@@ -2849,7 +2896,13 @@ var ConditionJSONInput = ({
|
|
|
2849
2896
|
}
|
|
2850
2897
|
}
|
|
2851
2898
|
);
|
|
2852
|
-
var ConditionValue = ({
|
|
2899
|
+
var ConditionValue = ({
|
|
2900
|
+
row,
|
|
2901
|
+
fields,
|
|
2902
|
+
onClearValue,
|
|
2903
|
+
dropdownPortalId,
|
|
2904
|
+
shortDateFormat
|
|
2905
|
+
}) => {
|
|
2853
2906
|
const { control } = reactHookForm.useFormContext();
|
|
2854
2907
|
const fieldSchema = fields.find((f) => f.name === row.fieldName);
|
|
2855
2908
|
const fieldType = fieldSchema?.type ?? "text";
|
|
@@ -2858,7 +2911,15 @@ var ConditionValue = ({ row, fields, onClearValue, dropdownPortalId }) => {
|
|
|
2858
2911
|
return /* @__PURE__ */ jsxRuntime.jsx(ConditionNumberInput, { row, control, onClear: onClearValue });
|
|
2859
2912
|
case "date":
|
|
2860
2913
|
case "datetime":
|
|
2861
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2914
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2915
|
+
ConditionDateInput,
|
|
2916
|
+
{
|
|
2917
|
+
row,
|
|
2918
|
+
control,
|
|
2919
|
+
onClear: onClearValue,
|
|
2920
|
+
shortDateFormat
|
|
2921
|
+
}
|
|
2922
|
+
);
|
|
2862
2923
|
case "datemonth":
|
|
2863
2924
|
return /* @__PURE__ */ jsxRuntime.jsx(ConditionMonthInput, { row, control, onClear: onClearValue });
|
|
2864
2925
|
case "dropdown":
|
|
@@ -2937,7 +2998,8 @@ var AdvanceSearchRow = ({
|
|
|
2937
2998
|
onRemove,
|
|
2938
2999
|
onClearValue,
|
|
2939
3000
|
disableAdd,
|
|
2940
|
-
dropdownPortalId
|
|
3001
|
+
dropdownPortalId,
|
|
3002
|
+
shortDateFormat
|
|
2941
3003
|
}) => {
|
|
2942
3004
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-3 rounded-lg bg-white md:grid-cols-[minmax(150px,0.85fr)_minmax(140px,0.75fr)_minmax(260px,1fr)_auto] md:items-start", children: [
|
|
2943
3005
|
/* @__PURE__ */ jsxRuntime.jsx(FieldSelect, { row, fieldOptions, onChangeField }),
|
|
@@ -2956,7 +3018,8 @@ var AdvanceSearchRow = ({
|
|
|
2956
3018
|
row,
|
|
2957
3019
|
fields,
|
|
2958
3020
|
onClearValue,
|
|
2959
|
-
dropdownPortalId
|
|
3021
|
+
dropdownPortalId,
|
|
3022
|
+
shortDateFormat
|
|
2960
3023
|
}
|
|
2961
3024
|
),
|
|
2962
3025
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full", children: /* @__PURE__ */ jsxRuntime.jsx(AddRemoveButtons, { isFirst, onAdd, onRemove, disableAdd }) })
|
|
@@ -3378,7 +3441,8 @@ var AdvanceSearch = ({
|
|
|
3378
3441
|
iconColor = "#ffffff",
|
|
3379
3442
|
limitRows = 4,
|
|
3380
3443
|
onSearch,
|
|
3381
|
-
onClear
|
|
3444
|
+
onClear,
|
|
3445
|
+
shortDateFormat
|
|
3382
3446
|
}) => {
|
|
3383
3447
|
const fieldsData = React4.useMemo(() => {
|
|
3384
3448
|
if (fields.length === 0) throw new Error("fields cannot be an empty array");
|
|
@@ -3508,6 +3572,7 @@ var AdvanceSearch = ({
|
|
|
3508
3572
|
AdvanceSearchRow,
|
|
3509
3573
|
{
|
|
3510
3574
|
row,
|
|
3575
|
+
shortDateFormat,
|
|
3511
3576
|
isFirst: idx === 0,
|
|
3512
3577
|
fields: fieldsData,
|
|
3513
3578
|
fieldOptions,
|
|
@@ -5710,6 +5775,233 @@ var useGridSettingsStore = zustand.create(
|
|
|
5710
5775
|
})
|
|
5711
5776
|
);
|
|
5712
5777
|
var useGridSettingsStore_default = useGridSettingsStore;
|
|
5778
|
+
function LoadingOverlay({
|
|
5779
|
+
className,
|
|
5780
|
+
fullscreen = true,
|
|
5781
|
+
spinnerClassName,
|
|
5782
|
+
...props
|
|
5783
|
+
}) {
|
|
5784
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5785
|
+
"div",
|
|
5786
|
+
{
|
|
5787
|
+
"data-slot": "loading-overlay",
|
|
5788
|
+
className: cn(
|
|
5789
|
+
fullscreen ? "fixed z-100" : "absolute z-10",
|
|
5790
|
+
"inset-0 flex items-center justify-center transition-opacity duration-300",
|
|
5791
|
+
className
|
|
5792
|
+
),
|
|
5793
|
+
...props,
|
|
5794
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Spinner, { className: cn("size-50", spinnerClassName) })
|
|
5795
|
+
}
|
|
5796
|
+
);
|
|
5797
|
+
}
|
|
5798
|
+
var DEVICE_SIZES = [320, 420, 640, 768, 1024, 1280, 1536, 1920];
|
|
5799
|
+
var IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
|
|
5800
|
+
var defaultLoader = ({ src }) => src;
|
|
5801
|
+
function toNumber(value) {
|
|
5802
|
+
if (typeof value === "number") {
|
|
5803
|
+
return Number.isFinite(value) ? value : void 0;
|
|
5804
|
+
}
|
|
5805
|
+
if (typeof value === "string") {
|
|
5806
|
+
const parsed = parseInt(value, 10);
|
|
5807
|
+
return Number.isFinite(parsed) ? parsed : void 0;
|
|
5808
|
+
}
|
|
5809
|
+
return void 0;
|
|
5810
|
+
}
|
|
5811
|
+
function formatDimension(value) {
|
|
5812
|
+
if (typeof value === "number") {
|
|
5813
|
+
return `${value}px`;
|
|
5814
|
+
}
|
|
5815
|
+
return value;
|
|
5816
|
+
}
|
|
5817
|
+
function matchClosestSize(target) {
|
|
5818
|
+
for (const size of IMAGE_SIZES) {
|
|
5819
|
+
if (size >= target) {
|
|
5820
|
+
return size;
|
|
5821
|
+
}
|
|
5822
|
+
}
|
|
5823
|
+
return DEVICE_SIZES[DEVICE_SIZES.length - 1];
|
|
5824
|
+
}
|
|
5825
|
+
function getCandidateWidths({
|
|
5826
|
+
width,
|
|
5827
|
+
sizes,
|
|
5828
|
+
fill
|
|
5829
|
+
}) {
|
|
5830
|
+
if (fill || sizes) {
|
|
5831
|
+
return DEVICE_SIZES;
|
|
5832
|
+
}
|
|
5833
|
+
if (typeof width === "number" && width > 0) {
|
|
5834
|
+
const targets = /* @__PURE__ */ new Set([width, width * 2]);
|
|
5835
|
+
return Array.from(targets).map((target) => matchClosestSize(target)).sort((a, b) => a - b);
|
|
5836
|
+
}
|
|
5837
|
+
return DEVICE_SIZES;
|
|
5838
|
+
}
|
|
5839
|
+
var Image2 = React4__namespace.forwardRef(function Image3({
|
|
5840
|
+
src,
|
|
5841
|
+
alt,
|
|
5842
|
+
width,
|
|
5843
|
+
height,
|
|
5844
|
+
fill = false,
|
|
5845
|
+
sizes,
|
|
5846
|
+
quality = 75,
|
|
5847
|
+
priority = false,
|
|
5848
|
+
placeholder: placeholder2 = "empty",
|
|
5849
|
+
blurDataURL,
|
|
5850
|
+
loader = defaultLoader,
|
|
5851
|
+
unoptimized = false,
|
|
5852
|
+
wrapperClassName,
|
|
5853
|
+
className,
|
|
5854
|
+
objectFit,
|
|
5855
|
+
objectPosition,
|
|
5856
|
+
onLoadingComplete,
|
|
5857
|
+
style,
|
|
5858
|
+
...imgProps
|
|
5859
|
+
}, ref) {
|
|
5860
|
+
const {
|
|
5861
|
+
loading: loadingProp,
|
|
5862
|
+
fetchPriority: fetchPriorityProp,
|
|
5863
|
+
decoding: decodingProp,
|
|
5864
|
+
onLoad: onLoadProp,
|
|
5865
|
+
...restImgProps
|
|
5866
|
+
} = imgProps;
|
|
5867
|
+
const widthNumber = toNumber(width);
|
|
5868
|
+
const heightNumber = toNumber(height);
|
|
5869
|
+
React4__namespace.useEffect(() => {
|
|
5870
|
+
if (!fill && (!widthNumber || !heightNumber)) {
|
|
5871
|
+
console.warn(
|
|
5872
|
+
"[Image] When `fill` is false you should provide both `width` and `height` to prevent layout shifts."
|
|
5873
|
+
);
|
|
5874
|
+
}
|
|
5875
|
+
}, [fill, heightNumber, widthNumber]);
|
|
5876
|
+
const candidateWidths = React4__namespace.useMemo(
|
|
5877
|
+
() => getCandidateWidths({ width: widthNumber, sizes, fill }),
|
|
5878
|
+
[fill, sizes, widthNumber]
|
|
5879
|
+
);
|
|
5880
|
+
const largestWidth = candidateWidths[candidateWidths.length - 1] ?? widthNumber ?? DEVICE_SIZES[DEVICE_SIZES.length - 1];
|
|
5881
|
+
const computedSrc = React4__namespace.useMemo(() => {
|
|
5882
|
+
if (unoptimized) {
|
|
5883
|
+
return src;
|
|
5884
|
+
}
|
|
5885
|
+
return loader({ src, width: largestWidth, quality });
|
|
5886
|
+
}, [largestWidth, loader, quality, src, unoptimized]);
|
|
5887
|
+
const computedSrcSet = React4__namespace.useMemo(() => {
|
|
5888
|
+
if (unoptimized) {
|
|
5889
|
+
return void 0;
|
|
5890
|
+
}
|
|
5891
|
+
return candidateWidths.map((currentWidth) => `${loader({ src, width: currentWidth, quality })} ${currentWidth}w`).join(", ");
|
|
5892
|
+
}, [candidateWidths, loader, quality, src, unoptimized]);
|
|
5893
|
+
const sizesValue = sizes ?? (fill ? "100vw" : widthNumber ? `${widthNumber}px` : void 0);
|
|
5894
|
+
const [isLoaded, setIsLoaded] = React4__namespace.useState(false);
|
|
5895
|
+
const internalRef = React4__namespace.useRef(null);
|
|
5896
|
+
const setRefs = React4__namespace.useCallback(
|
|
5897
|
+
(node) => {
|
|
5898
|
+
internalRef.current = node;
|
|
5899
|
+
if (!ref) {
|
|
5900
|
+
return;
|
|
5901
|
+
}
|
|
5902
|
+
if (typeof ref === "function") {
|
|
5903
|
+
ref(node);
|
|
5904
|
+
} else {
|
|
5905
|
+
ref.current = node;
|
|
5906
|
+
}
|
|
5907
|
+
},
|
|
5908
|
+
[ref]
|
|
5909
|
+
);
|
|
5910
|
+
React4__namespace.useEffect(() => {
|
|
5911
|
+
const image = internalRef.current;
|
|
5912
|
+
if (!image) {
|
|
5913
|
+
return;
|
|
5914
|
+
}
|
|
5915
|
+
if (image.complete && image.naturalWidth > 0) {
|
|
5916
|
+
setIsLoaded(true);
|
|
5917
|
+
onLoadingComplete?.(image);
|
|
5918
|
+
} else {
|
|
5919
|
+
setIsLoaded(false);
|
|
5920
|
+
}
|
|
5921
|
+
}, [onLoadingComplete, src]);
|
|
5922
|
+
const handleLoad = React4__namespace.useCallback(
|
|
5923
|
+
(event) => {
|
|
5924
|
+
setIsLoaded(true);
|
|
5925
|
+
onLoadProp?.(event);
|
|
5926
|
+
onLoadingComplete?.(event.currentTarget);
|
|
5927
|
+
},
|
|
5928
|
+
[onLoadProp, onLoadingComplete]
|
|
5929
|
+
);
|
|
5930
|
+
const loading = priority ? "eager" : loadingProp ?? "lazy";
|
|
5931
|
+
const fetchPriority = priority ? "high" : fetchPriorityProp;
|
|
5932
|
+
const decoding = decodingProp ?? "async";
|
|
5933
|
+
const resolvedObjectFit = objectFit ?? (fill ? "cover" : void 0);
|
|
5934
|
+
const wrapperStyle = React4__namespace.useMemo(
|
|
5935
|
+
() => ({
|
|
5936
|
+
position: "relative",
|
|
5937
|
+
display: fill ? "block" : "inline-block",
|
|
5938
|
+
overflow: "hidden",
|
|
5939
|
+
width: fill ? "100%" : formatDimension(width) ?? void 0,
|
|
5940
|
+
height: fill ? "100%" : formatDimension(height) ?? void 0
|
|
5941
|
+
}),
|
|
5942
|
+
[fill, height, width]
|
|
5943
|
+
);
|
|
5944
|
+
const imageStyle = React4__namespace.useMemo(
|
|
5945
|
+
() => ({
|
|
5946
|
+
width: fill ? "100%" : formatDimension(width) ?? void 0,
|
|
5947
|
+
height: fill ? "100%" : formatDimension(height) ?? void 0,
|
|
5948
|
+
position: fill ? "absolute" : void 0,
|
|
5949
|
+
inset: fill ? 0 : void 0,
|
|
5950
|
+
objectFit: resolvedObjectFit,
|
|
5951
|
+
objectPosition,
|
|
5952
|
+
...style
|
|
5953
|
+
}),
|
|
5954
|
+
[fill, height, objectPosition, resolvedObjectFit, style, width]
|
|
5955
|
+
);
|
|
5956
|
+
const shouldShowLoadingOverlay = placeholder2 === "blur";
|
|
5957
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5958
|
+
"span",
|
|
5959
|
+
{
|
|
5960
|
+
"data-slot": "image",
|
|
5961
|
+
className: cn("relative overflow-hidden", fill ? "block" : "inline-block", wrapperClassName),
|
|
5962
|
+
style: wrapperStyle,
|
|
5963
|
+
children: [
|
|
5964
|
+
shouldShowLoadingOverlay && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5965
|
+
LoadingOverlay,
|
|
5966
|
+
{
|
|
5967
|
+
"aria-hidden": true,
|
|
5968
|
+
fullscreen: false,
|
|
5969
|
+
spinnerClassName: "size-6",
|
|
5970
|
+
className: cn(
|
|
5971
|
+
// "bg-white/75!",
|
|
5972
|
+
isLoaded ? "opacity-0 pointer-events-none" : "opacity-100"
|
|
5973
|
+
)
|
|
5974
|
+
}
|
|
5975
|
+
),
|
|
5976
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5977
|
+
"img",
|
|
5978
|
+
{
|
|
5979
|
+
ref: setRefs,
|
|
5980
|
+
className: cn(
|
|
5981
|
+
"block transition-opacity duration-300",
|
|
5982
|
+
fill && "absolute inset-0 size-full",
|
|
5983
|
+
shouldShowLoadingOverlay && !isLoaded ? "opacity-0" : "opacity-100",
|
|
5984
|
+
className
|
|
5985
|
+
),
|
|
5986
|
+
src: computedSrc,
|
|
5987
|
+
srcSet: computedSrcSet,
|
|
5988
|
+
sizes: sizesValue,
|
|
5989
|
+
width: fill ? void 0 : widthNumber,
|
|
5990
|
+
height: fill ? void 0 : heightNumber,
|
|
5991
|
+
alt,
|
|
5992
|
+
loading,
|
|
5993
|
+
fetchPriority,
|
|
5994
|
+
decoding,
|
|
5995
|
+
onLoad: handleLoad,
|
|
5996
|
+
style: imageStyle,
|
|
5997
|
+
...restImgProps
|
|
5998
|
+
}
|
|
5999
|
+
)
|
|
6000
|
+
]
|
|
6001
|
+
}
|
|
6002
|
+
);
|
|
6003
|
+
});
|
|
6004
|
+
Image2.displayName = "Image";
|
|
5713
6005
|
var ListTable = ({ onTableReady, children }) => {
|
|
5714
6006
|
React4__namespace.useEffect(() => {
|
|
5715
6007
|
if (onTableReady) {
|
|
@@ -6331,8 +6623,8 @@ function parseSerializedEditorState(raw) {
|
|
|
6331
6623
|
return void 0;
|
|
6332
6624
|
}
|
|
6333
6625
|
}
|
|
6334
|
-
function Placeholder({ placeholder:
|
|
6335
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: theme.placeholder, children:
|
|
6626
|
+
function Placeholder({ placeholder: placeholder2 }) {
|
|
6627
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: theme.placeholder, children: placeholder2 });
|
|
6336
6628
|
}
|
|
6337
6629
|
var initialToolbarState = {
|
|
6338
6630
|
isBold: false,
|
|
@@ -7233,7 +7525,7 @@ var RichText = React4.forwardRef(function RichText2({
|
|
|
7233
7525
|
defaultValue,
|
|
7234
7526
|
onChange,
|
|
7235
7527
|
onHtmlChange,
|
|
7236
|
-
placeholder:
|
|
7528
|
+
placeholder: placeholder2,
|
|
7237
7529
|
readOnly,
|
|
7238
7530
|
disabled,
|
|
7239
7531
|
editorClassName,
|
|
@@ -7321,7 +7613,7 @@ var RichText = React4.forwardRef(function RichText2({
|
|
|
7321
7613
|
)
|
|
7322
7614
|
}
|
|
7323
7615
|
),
|
|
7324
|
-
placeholder: /* @__PURE__ */ jsxRuntime.jsx(Placeholder, { placeholder:
|
|
7616
|
+
placeholder: /* @__PURE__ */ jsxRuntime.jsx(Placeholder, { placeholder: placeholder2 || "" }),
|
|
7325
7617
|
ErrorBoundary: LexicalErrorBoundary.LexicalErrorBoundary
|
|
7326
7618
|
}
|
|
7327
7619
|
),
|
|
@@ -8456,6 +8748,7 @@ exports.FormLabel = FormLabel;
|
|
|
8456
8748
|
exports.FormMessage = FormMessage;
|
|
8457
8749
|
exports.GridSettingsModal = GridSettingsModal_default;
|
|
8458
8750
|
exports.HeaderCell = HeaderCell_default;
|
|
8751
|
+
exports.Image = Image2;
|
|
8459
8752
|
exports.Input = Input;
|
|
8460
8753
|
exports.Label = Label2;
|
|
8461
8754
|
exports.List = List_default;
|
|
@@ -8543,6 +8836,7 @@ exports.buttonVariants = buttonVariants;
|
|
|
8543
8836
|
exports.cn = cn;
|
|
8544
8837
|
exports.compareAlphanumeric = compareAlphanumeric;
|
|
8545
8838
|
exports.debounce = debounce;
|
|
8839
|
+
exports.formatISODate = formatISODate;
|
|
8546
8840
|
exports.getDialogAlertControls = getDialogAlertControls;
|
|
8547
8841
|
exports.getDialogTemplates = getDialogTemplates;
|
|
8548
8842
|
exports.inputVariants = inputVariants;
|