@clyrex-digital/clyrex-controls-dev 0.8.1-dev.20260924115534 → 0.8.1-dev.20260926063530
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/DataBindingControls-VSLL4WV2.mjs +882 -0
- package/dist/DataBindingControls-Z2AHWFYX.mjs +880 -0
- package/dist/{InputControlClient-A3V5YRWH.mjs → InputControlClient-K6GXQEJD.mjs} +4 -6
- package/dist/{LinkNodeButton-WXAW3ZD6.mjs → LinkNodeButton-U6AJUMFA.mjs} +1 -1
- package/dist/{Pagination-STOHS3LO.mjs → Pagination-6R4XZLF6.mjs} +3 -5
- package/dist/{Pagination-V53JCR6P.mjs → Pagination-RMAXCIL7.mjs} +71 -27
- package/dist/{chunk-4WMSS6CE.mjs → chunk-3IMICDQR.mjs} +0 -1
- package/dist/{chunk-N57RANHY.mjs → chunk-LDS5ZLVG.mjs} +1 -1
- package/dist/{chunk-GCG4OYDJ.mjs → chunk-N3EYMPAJ.mjs} +31 -0
- package/dist/{chunk-I3ND2ZRE.mjs → chunk-Q4AFJYT5.mjs} +32 -2
- package/dist/{chunk-K6GGVJCI.mjs → chunk-RSUG2VPX.mjs} +1 -1
- package/dist/index.js +512 -113
- package/dist/index.mjs +30 -28
- package/dist/server.js +709 -2314
- package/dist/server.mjs +6 -9
- package/package.json +1 -1
- package/dist/DataBindingControls-5H5K5GVR.mjs +0 -477
- package/dist/DataBindingControls-G5TRSVEU.mjs +0 -481
- package/dist/InputControlClient-NHXG4QBU.mjs +0 -1836
- package/dist/chunk-2R26M6CK.mjs +0 -30
- package/dist/chunk-6PW2RLUJ.mjs +0 -52
- package/dist/chunk-F4DNLPFN.mjs +0 -36
- package/dist/chunk-HRDHAIZF.mjs +0 -33
- package/dist/chunk-XDTWUEVR.mjs +0 -13
package/dist/server.js
CHANGED
|
@@ -3145,37 +3145,13 @@ var init_IframeClient = __esm({
|
|
|
3145
3145
|
});
|
|
3146
3146
|
|
|
3147
3147
|
// src/components/controls/edit/InputControlType.tsx
|
|
3148
|
-
var Constants
|
|
3148
|
+
var Constants;
|
|
3149
3149
|
var init_InputControlType = __esm({
|
|
3150
3150
|
"src/components/controls/edit/InputControlType.tsx"() {
|
|
3151
3151
|
"use strict";
|
|
3152
3152
|
Constants = {
|
|
3153
3153
|
pagesize: 10
|
|
3154
3154
|
};
|
|
3155
|
-
InputControlType = {
|
|
3156
|
-
lineTextInput: "lineTextInput",
|
|
3157
|
-
multilineTextInput: "multilineTextInput",
|
|
3158
|
-
emailInput: "emailInput",
|
|
3159
|
-
numberInput: "numberInput",
|
|
3160
|
-
checkboxInput: "checkboxInput",
|
|
3161
|
-
moneyInput: "moneyInput",
|
|
3162
|
-
select: "select",
|
|
3163
|
-
percentageInput: "percentageInput",
|
|
3164
|
-
assetUpload: "assetUpload",
|
|
3165
|
-
phoneInput: "phoneInput",
|
|
3166
|
-
otpInput: "otpInput",
|
|
3167
|
-
datetimeInput: "datetimeInput",
|
|
3168
|
-
timeInput: "timeInput",
|
|
3169
|
-
colorInput: "colorInput",
|
|
3170
|
-
selectWithSearchInput: "selectWithSearchInput",
|
|
3171
|
-
selectWithSearchPanel: "selectWithSearchPanel",
|
|
3172
|
-
switchInput: "switchInput",
|
|
3173
|
-
dateInput: "dateInput",
|
|
3174
|
-
radioInput: "radioInput",
|
|
3175
|
-
videoInput: "videoInput",
|
|
3176
|
-
referenceInput: "referenceInput"
|
|
3177
|
-
};
|
|
3178
|
-
InputControlType_default = InputControlType;
|
|
3179
3155
|
}
|
|
3180
3156
|
});
|
|
3181
3157
|
|
|
@@ -3689,2129 +3665,237 @@ var init_Pagination = __esm({
|
|
|
3689
3665
|
}
|
|
3690
3666
|
});
|
|
3691
3667
|
|
|
3692
|
-
// src/components/
|
|
3693
|
-
var
|
|
3694
|
-
|
|
3695
|
-
|
|
3668
|
+
// src/components/pageRenderingEngine/nodes/DataBindingControls.tsx
|
|
3669
|
+
var DataBindingControls_exports = {};
|
|
3670
|
+
__export(DataBindingControls_exports, {
|
|
3671
|
+
default: () => DataBindingControls_default
|
|
3672
|
+
});
|
|
3673
|
+
var import_react39, import_navigation, import_jsx_runtime65, humanize, escapeODataString, parseFacetSelections, buildFacetFilter, parseODataSearch, SearchIcon, ResetIcon, FilterSlidersIcon, ChevronDownIcon, CheckIcon, CloseIcon, MapPinIcon, BriefcaseIcon, FileTextIcon, TagIcon, getCategoryIcon, normalizeSortOption, DataBindingControls, DataBindingControls_default;
|
|
3674
|
+
var init_DataBindingControls = __esm({
|
|
3675
|
+
"src/components/pageRenderingEngine/nodes/DataBindingControls.tsx"() {
|
|
3696
3676
|
"use strict";
|
|
3697
|
-
|
|
3677
|
+
"use client";
|
|
3678
|
+
import_react39 = require("react");
|
|
3679
|
+
import_navigation = require("next/navigation");
|
|
3680
|
+
init_Button();
|
|
3681
|
+
init_StyleTypes();
|
|
3698
3682
|
import_jsx_runtime65 = require("react/jsx-runtime");
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
groupKey: props.groupKey
|
|
3709
|
-
}
|
|
3710
|
-
);
|
|
3683
|
+
humanize = (value) => value.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").trim();
|
|
3684
|
+
escapeODataString = (value) => value.replace(/'/g, "''");
|
|
3685
|
+
parseFacetSelections = (filter) => {
|
|
3686
|
+
const selections = /* @__PURE__ */ new Map();
|
|
3687
|
+
if (!filter || !filter.trim()) return selections;
|
|
3688
|
+
const expression = /(?:^|[\s()]+(?:and[\s()]+)?)([\w./-]+)\s+eq\s+'((?:''|[^'])*)'/gi;
|
|
3689
|
+
for (const match of filter.matchAll(expression)) {
|
|
3690
|
+
if (match[1] && match[2] !== void 0) {
|
|
3691
|
+
selections.set(match[1].trim(), match[2].replace(/''/g, "'"));
|
|
3711
3692
|
}
|
|
3712
|
-
}
|
|
3713
|
-
|
|
3714
|
-
if (props.value !== void 0 && props.value !== null) {
|
|
3715
|
-
value = props.value;
|
|
3716
|
-
}
|
|
3717
|
-
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_react39.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("label", { className: "block mb-1", children: [
|
|
3718
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
3719
|
-
" ",
|
|
3720
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
3721
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3722
|
-
"textarea",
|
|
3723
|
-
{
|
|
3724
|
-
name: props.name,
|
|
3725
|
-
id: props.name,
|
|
3726
|
-
value,
|
|
3727
|
-
onChange: textChangeHandler,
|
|
3728
|
-
onBlur: props?.onBlur,
|
|
3729
|
-
rows: 4,
|
|
3730
|
-
required: props?.attributes?.required,
|
|
3731
|
-
placeholder: props?.attributes?.placeholder,
|
|
3732
|
-
maxLength: props?.attributes?.maxLength,
|
|
3733
|
-
disabled: props?.attributes?.readOnly,
|
|
3734
|
-
minLength: props?.attributes?.minLength,
|
|
3735
|
-
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm input"
|
|
3736
|
-
}
|
|
3737
|
-
),
|
|
3738
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
3739
|
-
] }) });
|
|
3693
|
+
}
|
|
3694
|
+
return selections;
|
|
3740
3695
|
};
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3696
|
+
buildFacetFilter = (selections) => Array.from(selections.entries()).map(([field, value]) => `${field} eq '${escapeODataString(value)}'`).join(" and ");
|
|
3697
|
+
parseODataSearch = (value) => {
|
|
3698
|
+
if (!value) return "";
|
|
3699
|
+
const trimmedValue = value.trim();
|
|
3700
|
+
if (trimmedValue.startsWith("'") && trimmedValue.endsWith("'")) {
|
|
3701
|
+
return trimmedValue.slice(1, -1).replace(/''/g, "'");
|
|
3702
|
+
}
|
|
3703
|
+
return trimmedValue;
|
|
3704
|
+
};
|
|
3705
|
+
SearchIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
3706
|
+
"svg",
|
|
3707
|
+
{
|
|
3708
|
+
"aria-hidden": "true",
|
|
3709
|
+
className,
|
|
3710
|
+
fill: "none",
|
|
3711
|
+
viewBox: "0 0 24 24",
|
|
3712
|
+
stroke: "currentColor",
|
|
3713
|
+
strokeWidth: "2",
|
|
3714
|
+
children: [
|
|
3715
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("circle", { cx: "11", cy: "11", r: "7" }),
|
|
3716
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("path", { strokeLinecap: "round", d: "m20 20-4-4" })
|
|
3717
|
+
]
|
|
3718
|
+
}
|
|
3719
|
+
);
|
|
3720
|
+
ResetIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
3721
|
+
"svg",
|
|
3722
|
+
{
|
|
3723
|
+
"aria-hidden": "true",
|
|
3724
|
+
className,
|
|
3725
|
+
fill: "none",
|
|
3726
|
+
viewBox: "0 0 24 24",
|
|
3727
|
+
stroke: "currentColor",
|
|
3728
|
+
strokeWidth: "2",
|
|
3729
|
+
children: [
|
|
3730
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 4v6h6" }),
|
|
3731
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3732
|
+
"path",
|
|
3757
3733
|
{
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
groupKey: props.groupKey
|
|
3734
|
+
strokeLinecap: "round",
|
|
3735
|
+
strokeLinejoin: "round",
|
|
3736
|
+
d: "M5.5 15a8 8 0 1 0 .6-7.8L4 10"
|
|
3762
3737
|
}
|
|
3763
|
-
)
|
|
3764
|
-
|
|
3765
|
-
};
|
|
3766
|
-
let value = "";
|
|
3767
|
-
if (props.value !== void 0 && props.value !== null) {
|
|
3768
|
-
value = props.value;
|
|
3769
|
-
}
|
|
3770
|
-
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react40.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("label", { className: "block", children: [
|
|
3771
|
-
props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-sm inline-block pb-1 font-medium ", children: props?.attributes?.label }),
|
|
3772
|
-
" ",
|
|
3773
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "bg-error-weak !bg-transparent", children: "*" }),
|
|
3774
|
-
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
3775
|
-
"input",
|
|
3776
|
-
{
|
|
3777
|
-
type: "text",
|
|
3778
|
-
name: props.name,
|
|
3779
|
-
id: props.name,
|
|
3780
|
-
value,
|
|
3781
|
-
onChange: textChangeHandler,
|
|
3782
|
-
onBlur: props?.onBlur,
|
|
3783
|
-
autoFocus: props?.attributes?.autoFocus,
|
|
3784
|
-
required: props?.attributes?.required,
|
|
3785
|
-
placeholder: props?.attributes?.placeholder,
|
|
3786
|
-
maxLength: props?.attributes?.maxLength,
|
|
3787
|
-
pattern: props?.attributes?.pattern,
|
|
3788
|
-
disabled: props?.attributes?.readOnly,
|
|
3789
|
-
minLength: props?.attributes?.minLength,
|
|
3790
|
-
className: `peer input mt-1 py-1.5 block w-full rounded shadow-sm transition-all duration-500 ease-in-out
|
|
3791
|
-
${props?.inputClasses ? props.inputClasses : ``}
|
|
3792
|
-
`
|
|
3793
|
-
}
|
|
3794
|
-
),
|
|
3795
|
-
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
3796
|
-
] }) });
|
|
3797
|
-
};
|
|
3798
|
-
LineTextInput_default = LineTextInput;
|
|
3799
|
-
}
|
|
3800
|
-
});
|
|
3801
|
-
|
|
3802
|
-
// src/components/controls/edit/MoneyInput.tsx
|
|
3803
|
-
var import_react41, import_jsx_runtime67, MoneyInput, MoneyInput_default;
|
|
3804
|
-
var init_MoneyInput = __esm({
|
|
3805
|
-
"src/components/controls/edit/MoneyInput.tsx"() {
|
|
3806
|
-
"use strict";
|
|
3807
|
-
import_react41 = __toESM(require("react"));
|
|
3808
|
-
import_jsx_runtime67 = require("react/jsx-runtime");
|
|
3809
|
-
MoneyInput = (props) => {
|
|
3810
|
-
const textChangeHandler = (event) => {
|
|
3811
|
-
const rawValue = event.target.value;
|
|
3812
|
-
const numericValue = parseFloat(rawValue);
|
|
3813
|
-
if (rawValue === "" || !isNaN(numericValue) && numericValue >= 0) {
|
|
3814
|
-
if (props.callback !== void 0) {
|
|
3815
|
-
props.callback({
|
|
3816
|
-
name: props.name,
|
|
3817
|
-
value: rawValue,
|
|
3818
|
-
index: props.index,
|
|
3819
|
-
groupKey: props.groupKey
|
|
3820
|
-
});
|
|
3821
|
-
}
|
|
3822
|
-
}
|
|
3823
|
-
};
|
|
3824
|
-
const handleWheel = (event) => {
|
|
3825
|
-
event.preventDefault();
|
|
3826
|
-
event.target.blur();
|
|
3827
|
-
};
|
|
3828
|
-
let value = "";
|
|
3829
|
-
if (props.value !== void 0 && props.value !== null) {
|
|
3830
|
-
value = props.value;
|
|
3738
|
+
)
|
|
3739
|
+
]
|
|
3831
3740
|
}
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
" ",
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
{
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3741
|
+
);
|
|
3742
|
+
FilterSlidersIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
3743
|
+
"svg",
|
|
3744
|
+
{
|
|
3745
|
+
"aria-hidden": "true",
|
|
3746
|
+
className,
|
|
3747
|
+
fill: "none",
|
|
3748
|
+
viewBox: "0 0 24 24",
|
|
3749
|
+
stroke: "currentColor",
|
|
3750
|
+
strokeWidth: "2",
|
|
3751
|
+
children: [
|
|
3752
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 4h18M3 12h18M3 20h18" }),
|
|
3753
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("circle", { cx: "8", cy: "4", r: "2", fill: "currentColor" }),
|
|
3754
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("circle", { cx: "16", cy: "12", r: "2", fill: "currentColor" }),
|
|
3755
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("circle", { cx: "10", cy: "20", r: "2", fill: "currentColor" })
|
|
3756
|
+
]
|
|
3757
|
+
}
|
|
3758
|
+
);
|
|
3759
|
+
ChevronDownIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3760
|
+
"svg",
|
|
3761
|
+
{
|
|
3762
|
+
"aria-hidden": "true",
|
|
3763
|
+
className,
|
|
3764
|
+
fill: "none",
|
|
3765
|
+
viewBox: "0 0 24 24",
|
|
3766
|
+
stroke: "currentColor",
|
|
3767
|
+
strokeWidth: "2",
|
|
3768
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m19 9-7 7-7-7" })
|
|
3769
|
+
}
|
|
3770
|
+
);
|
|
3771
|
+
CheckIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3772
|
+
"svg",
|
|
3773
|
+
{
|
|
3774
|
+
"aria-hidden": "true",
|
|
3775
|
+
className,
|
|
3776
|
+
fill: "none",
|
|
3777
|
+
viewBox: "0 0 24 24",
|
|
3778
|
+
stroke: "currentColor",
|
|
3779
|
+
strokeWidth: "2.5",
|
|
3780
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" })
|
|
3781
|
+
}
|
|
3782
|
+
);
|
|
3783
|
+
CloseIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3784
|
+
"svg",
|
|
3785
|
+
{
|
|
3786
|
+
"aria-hidden": "true",
|
|
3787
|
+
className,
|
|
3788
|
+
fill: "none",
|
|
3789
|
+
viewBox: "0 0 24 24",
|
|
3790
|
+
stroke: "currentColor",
|
|
3791
|
+
strokeWidth: "2",
|
|
3792
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
3793
|
+
}
|
|
3794
|
+
);
|
|
3795
|
+
MapPinIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
3796
|
+
"svg",
|
|
3797
|
+
{
|
|
3798
|
+
"aria-hidden": "true",
|
|
3799
|
+
className,
|
|
3800
|
+
fill: "none",
|
|
3801
|
+
viewBox: "0 0 24 24",
|
|
3802
|
+
stroke: "currentColor",
|
|
3803
|
+
strokeWidth: "2",
|
|
3804
|
+
children: [
|
|
3805
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3806
|
+
"path",
|
|
3807
|
+
{
|
|
3808
|
+
strokeLinecap: "round",
|
|
3809
|
+
strokeLinejoin: "round",
|
|
3810
|
+
d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"
|
|
3899
3811
|
}
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
});
|
|
3908
|
-
};
|
|
3909
|
-
const inputChangeHandler = (event) => {
|
|
3910
|
-
props.callback?.({
|
|
3911
|
-
name: props.name,
|
|
3912
|
-
value: event.target.value,
|
|
3913
|
-
index: props.index,
|
|
3914
|
-
groupKey: props.groupKey
|
|
3915
|
-
});
|
|
3916
|
-
};
|
|
3917
|
-
(0, import_react42.useEffect)(() => {
|
|
3918
|
-
async function fetchData() {
|
|
3919
|
-
if (props.dataset) {
|
|
3920
|
-
setList(props.dataset);
|
|
3921
|
-
return;
|
|
3922
|
-
}
|
|
3923
|
-
if (props.dataSource && props.serviceClient) {
|
|
3924
|
-
let dataSource = props.dataSource;
|
|
3925
|
-
let response;
|
|
3926
|
-
if (props.dataSourceDependsOn) {
|
|
3927
|
-
if (!props.dependentValue) {
|
|
3928
|
-
setList([]);
|
|
3929
|
-
return;
|
|
3930
|
-
}
|
|
3931
|
-
dataSource = dataSource.replace(
|
|
3932
|
-
`{${props.dataSourceDependsOn}}`,
|
|
3933
|
-
props.dependentValue
|
|
3934
|
-
);
|
|
3812
|
+
),
|
|
3813
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3814
|
+
"path",
|
|
3815
|
+
{
|
|
3816
|
+
strokeLinecap: "round",
|
|
3817
|
+
strokeLinejoin: "round",
|
|
3818
|
+
d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z"
|
|
3935
3819
|
}
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
props.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "text-sm font-medium inline-block pb-1", children: props.attributes?.label }),
|
|
3952
|
-
" ",
|
|
3953
|
-
props.attributes?.label && props.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
3954
|
-
list && list.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
3955
|
-
"input",
|
|
3820
|
+
)
|
|
3821
|
+
]
|
|
3822
|
+
}
|
|
3823
|
+
);
|
|
3824
|
+
BriefcaseIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3825
|
+
"svg",
|
|
3826
|
+
{
|
|
3827
|
+
"aria-hidden": "true",
|
|
3828
|
+
className,
|
|
3829
|
+
fill: "none",
|
|
3830
|
+
viewBox: "0 0 24 24",
|
|
3831
|
+
stroke: "currentColor",
|
|
3832
|
+
strokeWidth: "2",
|
|
3833
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3834
|
+
"path",
|
|
3956
3835
|
{
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
value,
|
|
3961
|
-
onChange: inputChangeHandler,
|
|
3962
|
-
required: props.attributes?.required,
|
|
3963
|
-
placeholder: props.attributes?.placeholder,
|
|
3964
|
-
maxLength: props.attributes?.maxLength,
|
|
3965
|
-
pattern: props.attributes?.pattern,
|
|
3966
|
-
disabled: props.attributes?.readOnly,
|
|
3967
|
-
minLength: props.attributes?.minLength,
|
|
3968
|
-
className: `peer input select mt-1 py-1.5 block w-full rounded shadow-sm ${props.inputClasses ?? ""}`
|
|
3836
|
+
strokeLinecap: "round",
|
|
3837
|
+
strokeLinejoin: "round",
|
|
3838
|
+
d: "M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
|
|
3969
3839
|
}
|
|
3970
|
-
)
|
|
3971
|
-
|
|
3972
|
-
|
|
3840
|
+
)
|
|
3841
|
+
}
|
|
3842
|
+
);
|
|
3843
|
+
FileTextIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3844
|
+
"svg",
|
|
3845
|
+
{
|
|
3846
|
+
"aria-hidden": "true",
|
|
3847
|
+
className,
|
|
3848
|
+
fill: "none",
|
|
3849
|
+
viewBox: "0 0 24 24",
|
|
3850
|
+
stroke: "currentColor",
|
|
3851
|
+
strokeWidth: "2",
|
|
3852
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3853
|
+
"path",
|
|
3973
3854
|
{
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
onChange: textChangeHandler,
|
|
3978
|
-
required: props.attributes?.required,
|
|
3979
|
-
disabled: props.attributes?.readOnly,
|
|
3980
|
-
className: `peer select py-1.5 block w-full text-black rounded border-gray-300 shadow-sm
|
|
3981
|
-
focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50
|
|
3982
|
-
disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none ${props.inputClasses ?? ""}`,
|
|
3983
|
-
children: [
|
|
3984
|
-
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("option", { value: "", children: props.attributes?.placeholder || "Select" }),
|
|
3985
|
-
list.map((item, index) => {
|
|
3986
|
-
const keyField = props.dataKeyFieldName;
|
|
3987
|
-
const textField = props.dataTextFieldName;
|
|
3988
|
-
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("option", { value: item[keyField], children: item[textField] }, index);
|
|
3989
|
-
})
|
|
3990
|
-
]
|
|
3991
|
-
}
|
|
3992
|
-
),
|
|
3993
|
-
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 text-alert text-sm", children: props.attributes?.errorMessage || "" })
|
|
3994
|
-
] });
|
|
3995
|
-
};
|
|
3996
|
-
Select_default = Select;
|
|
3997
|
-
}
|
|
3998
|
-
});
|
|
3999
|
-
|
|
4000
|
-
// src/components/controls/edit/PercentageInput.tsx
|
|
4001
|
-
var import_react43, import_jsx_runtime69, PercentageInput, PercentageInput_default;
|
|
4002
|
-
var init_PercentageInput = __esm({
|
|
4003
|
-
"src/components/controls/edit/PercentageInput.tsx"() {
|
|
4004
|
-
"use strict";
|
|
4005
|
-
import_react43 = __toESM(require("react"));
|
|
4006
|
-
import_jsx_runtime69 = require("react/jsx-runtime");
|
|
4007
|
-
PercentageInput = (props) => {
|
|
4008
|
-
const textChangeHandler = (event) => {
|
|
4009
|
-
const rawValue = event.target.value;
|
|
4010
|
-
const numericValue = parseFloat(rawValue);
|
|
4011
|
-
if (rawValue === "" || !isNaN(numericValue) && numericValue >= 0) {
|
|
4012
|
-
if (props.callback !== void 0) {
|
|
4013
|
-
props.callback({
|
|
4014
|
-
name: props.name,
|
|
4015
|
-
value: rawValue,
|
|
4016
|
-
index: props.index,
|
|
4017
|
-
groupKey: props.groupKey
|
|
4018
|
-
});
|
|
3855
|
+
strokeLinecap: "round",
|
|
3856
|
+
strokeLinejoin: "round",
|
|
3857
|
+
d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
|
|
4019
3858
|
}
|
|
4020
|
-
|
|
4021
|
-
};
|
|
4022
|
-
const handleWheel = (event) => {
|
|
4023
|
-
event.preventDefault();
|
|
4024
|
-
event.target.blur();
|
|
4025
|
-
};
|
|
4026
|
-
let value = "";
|
|
4027
|
-
if (props.value !== void 0 && props.value !== null) {
|
|
4028
|
-
value = props.value;
|
|
3859
|
+
)
|
|
4029
3860
|
}
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
" ",
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
3861
|
+
);
|
|
3862
|
+
TagIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3863
|
+
"svg",
|
|
3864
|
+
{
|
|
3865
|
+
"aria-hidden": "true",
|
|
3866
|
+
className,
|
|
3867
|
+
fill: "none",
|
|
3868
|
+
viewBox: "0 0 24 24",
|
|
3869
|
+
stroke: "currentColor",
|
|
3870
|
+
strokeWidth: "2",
|
|
3871
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3872
|
+
"path",
|
|
4041
3873
|
{
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
value,
|
|
4046
|
-
min: 0,
|
|
4047
|
-
onChange: textChangeHandler,
|
|
4048
|
-
onBlur: props?.onBlur,
|
|
4049
|
-
autoFocus: props?.attributes?.autoFocus,
|
|
4050
|
-
onKeyDown: preventNegative,
|
|
4051
|
-
onWheel: handleWheel,
|
|
4052
|
-
required: props?.attributes?.required,
|
|
4053
|
-
placeholder: props?.attributes?.placeholder,
|
|
4054
|
-
pattern: props?.attributes?.pattern,
|
|
4055
|
-
disabled: props?.attributes?.readOnly,
|
|
4056
|
-
max: "100",
|
|
4057
|
-
className: `peer input mt-1 py-1.5 block w-full rounded shadow-sm number-input transition-all duration-500 ease-in-out
|
|
4058
|
-
${props?.inputClasses ? props.inputClasses : ``}
|
|
4059
|
-
`
|
|
3874
|
+
strokeLinecap: "round",
|
|
3875
|
+
strokeLinejoin: "round",
|
|
3876
|
+
d: "M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"
|
|
4060
3877
|
}
|
|
4061
|
-
)
|
|
4062
|
-
|
|
4063
|
-
|
|
3878
|
+
)
|
|
3879
|
+
}
|
|
3880
|
+
);
|
|
3881
|
+
getCategoryIcon = (category) => {
|
|
3882
|
+
const lower = category.toLowerCase();
|
|
3883
|
+
if (lower.includes("location") || lower.includes("city") || lower.includes("country") || lower.includes("state") || lower.includes("address")) {
|
|
3884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(MapPinIcon, { className: "h-4 w-4" });
|
|
3885
|
+
}
|
|
3886
|
+
if (lower.includes("type") || lower.includes("work") || lower.includes("employment") || lower.includes("experience")) {
|
|
3887
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(BriefcaseIcon, { className: "h-4 w-4" });
|
|
3888
|
+
}
|
|
3889
|
+
if (lower.includes("department") || lower.includes("category") || lower.includes("role") || lower.includes("industry")) {
|
|
3890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(FileTextIcon, { className: "h-4 w-4" });
|
|
3891
|
+
}
|
|
3892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(TagIcon, { className: "h-4 w-4" });
|
|
4064
3893
|
};
|
|
4065
|
-
PercentageInput_default = PercentageInput;
|
|
4066
|
-
}
|
|
4067
|
-
});
|
|
4068
|
-
|
|
4069
|
-
// src/components/controls/edit/PhoneInput.tsx
|
|
4070
|
-
var import_react44, import_jsx_runtime70, PhoneInput, PhoneInput_default;
|
|
4071
|
-
var init_PhoneInput = __esm({
|
|
4072
|
-
"src/components/controls/edit/PhoneInput.tsx"() {
|
|
4073
|
-
"use strict";
|
|
4074
|
-
import_react44 = __toESM(require("react"));
|
|
4075
|
-
import_jsx_runtime70 = require("react/jsx-runtime");
|
|
4076
|
-
PhoneInput = (props) => {
|
|
4077
|
-
const textChangeHandler = (event) => {
|
|
4078
|
-
const text = event.target.value;
|
|
4079
|
-
if (props.callback !== void 0) {
|
|
4080
|
-
props.callback(
|
|
4081
|
-
{
|
|
4082
|
-
name: props.name,
|
|
4083
|
-
value: text,
|
|
4084
|
-
index: props.index,
|
|
4085
|
-
groupKey: props.groupKey
|
|
4086
|
-
}
|
|
4087
|
-
);
|
|
4088
|
-
}
|
|
4089
|
-
};
|
|
4090
|
-
let value = "";
|
|
4091
|
-
if (props.value !== void 0 && props.value !== null) {
|
|
4092
|
-
value = props.value;
|
|
4093
|
-
}
|
|
4094
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_react44.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("label", { className: "block mb-1", children: [
|
|
4095
|
-
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
4096
|
-
" ",
|
|
4097
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
4098
|
-
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex items-center rounded border ", children: [
|
|
4099
|
-
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { className: "px-3", children: props.prefix }),
|
|
4100
|
-
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
4101
|
-
"input",
|
|
4102
|
-
{
|
|
4103
|
-
type: "text",
|
|
4104
|
-
name: props.name,
|
|
4105
|
-
id: props.name,
|
|
4106
|
-
value,
|
|
4107
|
-
onChange: textChangeHandler,
|
|
4108
|
-
required: props?.attributes?.required,
|
|
4109
|
-
placeholder: props?.attributes?.placeholder,
|
|
4110
|
-
maxLength: props?.attributes?.maxLength,
|
|
4111
|
-
pattern: props?.attributes?.pattern,
|
|
4112
|
-
disabled: props?.attributes?.readOnly,
|
|
4113
|
-
minLength: props?.attributes?.minLength,
|
|
4114
|
-
className: "py-1.5 block w-full outline-none border-0 mr-0.5"
|
|
4115
|
-
}
|
|
4116
|
-
)
|
|
4117
|
-
] }),
|
|
4118
|
-
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
4119
|
-
] }) });
|
|
4120
|
-
};
|
|
4121
|
-
PhoneInput_default = PhoneInput;
|
|
4122
|
-
}
|
|
4123
|
-
});
|
|
4124
|
-
|
|
4125
|
-
// src/components/controls/edit/NumberInput.tsx
|
|
4126
|
-
var import_react45, import_jsx_runtime71, NumberInput, NumberInput_default;
|
|
4127
|
-
var init_NumberInput = __esm({
|
|
4128
|
-
"src/components/controls/edit/NumberInput.tsx"() {
|
|
4129
|
-
"use strict";
|
|
4130
|
-
import_react45 = __toESM(require("react"));
|
|
4131
|
-
import_jsx_runtime71 = require("react/jsx-runtime");
|
|
4132
|
-
NumberInput = (props) => {
|
|
4133
|
-
const textChangeHandler = (event) => {
|
|
4134
|
-
const text = event.target.value;
|
|
4135
|
-
if (props.callback !== void 0) {
|
|
4136
|
-
props.callback({
|
|
4137
|
-
name: props.name,
|
|
4138
|
-
value: text,
|
|
4139
|
-
index: props.index,
|
|
4140
|
-
groupKey: props.groupKey
|
|
4141
|
-
});
|
|
4142
|
-
}
|
|
4143
|
-
};
|
|
4144
|
-
const handleWheel = (event) => {
|
|
4145
|
-
event.preventDefault();
|
|
4146
|
-
event.target.blur();
|
|
4147
|
-
};
|
|
4148
|
-
let value = "";
|
|
4149
|
-
if (props.value !== void 0 && props.value !== null) {
|
|
4150
|
-
value = props.value;
|
|
4151
|
-
}
|
|
4152
|
-
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_react45.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("label", { className: "block", children: [
|
|
4153
|
-
props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "text-sm inline-block pb-1 font-medium ", children: props?.attributes?.label }),
|
|
4154
|
-
" ",
|
|
4155
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
4156
|
-
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
4157
|
-
"input",
|
|
4158
|
-
{
|
|
4159
|
-
type: "number",
|
|
4160
|
-
name: props.name,
|
|
4161
|
-
id: props.name,
|
|
4162
|
-
value,
|
|
4163
|
-
onChange: textChangeHandler,
|
|
4164
|
-
onWheel: handleWheel,
|
|
4165
|
-
onBlur: props?.onBlur,
|
|
4166
|
-
autoFocus: props?.attributes?.autoFocus,
|
|
4167
|
-
required: props?.attributes?.required,
|
|
4168
|
-
placeholder: props?.attributes?.placeholder,
|
|
4169
|
-
pattern: props?.attributes?.pattern,
|
|
4170
|
-
disabled: props?.attributes?.readOnly,
|
|
4171
|
-
max: props?.attributes?.maxValue,
|
|
4172
|
-
min: props?.attributes?.minValue,
|
|
4173
|
-
className: `peer input mt-1 py-1.5 block w-full rounded shadow-sm number-input transition-all duration-500 ease-in-out
|
|
4174
|
-
${props?.inputClasses ? props.inputClasses : ``}
|
|
4175
|
-
`
|
|
4176
|
-
}
|
|
4177
|
-
),
|
|
4178
|
-
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
4179
|
-
] }) });
|
|
4180
|
-
};
|
|
4181
|
-
NumberInput_default = NumberInput;
|
|
4182
|
-
}
|
|
4183
|
-
});
|
|
4184
|
-
|
|
4185
|
-
// src/components/controls/edit/CheckboxInput.tsx
|
|
4186
|
-
var import_react46, import_jsx_runtime72, CheckboxInput, CheckboxInput_default;
|
|
4187
|
-
var init_CheckboxInput = __esm({
|
|
4188
|
-
"src/components/controls/edit/CheckboxInput.tsx"() {
|
|
4189
|
-
"use strict";
|
|
4190
|
-
import_react46 = __toESM(require("react"));
|
|
4191
|
-
import_jsx_runtime72 = require("react/jsx-runtime");
|
|
4192
|
-
CheckboxInput = (props) => {
|
|
4193
|
-
const isReadOnly = props.attributes?.readOnly === true || props.attributes?.readOnly === "true" || props?.readOnly === true || props.disable === true || props.attributes?.disable === true || props.attributes?.disabled === true || props.attributes?.disabled === "true";
|
|
4194
|
-
const textChangeHandler = (event) => {
|
|
4195
|
-
if (isReadOnly) return;
|
|
4196
|
-
const text = event.target.checked;
|
|
4197
|
-
if (props.callback !== void 0) {
|
|
4198
|
-
props.callback({
|
|
4199
|
-
name: props.name,
|
|
4200
|
-
value: text,
|
|
4201
|
-
index: props.index,
|
|
4202
|
-
groupKey: props.groupKey
|
|
4203
|
-
});
|
|
4204
|
-
}
|
|
4205
|
-
};
|
|
4206
|
-
let value = false;
|
|
4207
|
-
if (props.value !== void 0 && props.value !== null && props.value !== "" && (props.value === true || props.value === "true" || props.value.toString().toLowerCase() === "true" || props.value === 1 || props.value === "1")) {
|
|
4208
|
-
value = true;
|
|
4209
|
-
}
|
|
4210
|
-
const customClasses = (props?.inputClasses || "").split(/\s+/).filter((c) => !/^(w-|h-|block|inline-block|py-|px-|p-)/.test(c)).join(" ");
|
|
4211
|
-
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_react46.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: `mb-1 ${isReadOnly ? "cursor-not-allowed" : ""}`, children: [
|
|
4212
|
-
props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_jsx_runtime72.Fragment, { children: [
|
|
4213
|
-
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
4214
|
-
"label",
|
|
4215
|
-
{
|
|
4216
|
-
htmlFor: props.name,
|
|
4217
|
-
className: "inline-block text-sm font-medium pb-1",
|
|
4218
|
-
children: props.attributes.label
|
|
4219
|
-
}
|
|
4220
|
-
),
|
|
4221
|
-
" ",
|
|
4222
|
-
props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "bg-error-weak", children: "*" })
|
|
4223
|
-
] }),
|
|
4224
|
-
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
4225
|
-
"input",
|
|
4226
|
-
{
|
|
4227
|
-
type: "checkbox",
|
|
4228
|
-
name: props.name,
|
|
4229
|
-
id: props.name,
|
|
4230
|
-
checked: value,
|
|
4231
|
-
onChange: textChangeHandler,
|
|
4232
|
-
onBlur: props?.onBlur,
|
|
4233
|
-
autoFocus: props?.attributes?.autoFocus,
|
|
4234
|
-
required: !isReadOnly && Boolean(props?.attributes?.required),
|
|
4235
|
-
placeholder: props?.attributes?.placeholder,
|
|
4236
|
-
maxLength: props?.attributes?.maxLength,
|
|
4237
|
-
pattern: props?.attributes?.pattern,
|
|
4238
|
-
disabled: isReadOnly,
|
|
4239
|
-
readOnly: isReadOnly,
|
|
4240
|
-
tabIndex: isReadOnly ? -1 : void 0,
|
|
4241
|
-
onClick: (e) => {
|
|
4242
|
-
if (isReadOnly) {
|
|
4243
|
-
e.preventDefault();
|
|
4244
|
-
e.stopPropagation();
|
|
4245
|
-
}
|
|
4246
|
-
},
|
|
4247
|
-
minLength: props?.attributes?.minLength,
|
|
4248
|
-
className: `peer mt-1 h-4 w-4 shrink-0 rounded shadow-sm transition-all duration-200 ${isReadOnly ? "cursor-not-allowed pointer-events-none" : "cursor-pointer"} ${customClasses}`
|
|
4249
|
-
}
|
|
4250
|
-
),
|
|
4251
|
-
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage || "" })
|
|
4252
|
-
] }) });
|
|
4253
|
-
};
|
|
4254
|
-
CheckboxInput_default = CheckboxInput;
|
|
4255
|
-
}
|
|
4256
|
-
});
|
|
4257
|
-
|
|
4258
|
-
// src/components/controls/edit/OtpInput.tsx
|
|
4259
|
-
var import_react47, import_jsx_runtime73, OtpInput, OtpInput_default;
|
|
4260
|
-
var init_OtpInput = __esm({
|
|
4261
|
-
"src/components/controls/edit/OtpInput.tsx"() {
|
|
4262
|
-
"use strict";
|
|
4263
|
-
import_react47 = __toESM(require("react"));
|
|
4264
|
-
import_jsx_runtime73 = require("react/jsx-runtime");
|
|
4265
|
-
OtpInput = (props) => {
|
|
4266
|
-
const textChangeHandler = (event) => {
|
|
4267
|
-
const text = event.target.value;
|
|
4268
|
-
if (props.callback !== void 0) {
|
|
4269
|
-
props.callback({
|
|
4270
|
-
name: props.name,
|
|
4271
|
-
value: text,
|
|
4272
|
-
index: props.index,
|
|
4273
|
-
groupKey: props.groupKey
|
|
4274
|
-
});
|
|
4275
|
-
}
|
|
4276
|
-
};
|
|
4277
|
-
const handleWheel = (event) => {
|
|
4278
|
-
event.preventDefault();
|
|
4279
|
-
};
|
|
4280
|
-
let value = "";
|
|
4281
|
-
if (props.value !== void 0 && props.value !== null) {
|
|
4282
|
-
value = props.value;
|
|
4283
|
-
}
|
|
4284
|
-
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_react47.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("label", { htmlFor: props.name, className: "block w-full", children: [
|
|
4285
|
-
props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "text-sm inline-block pb-1 font-medium ", children: props?.attributes?.label }),
|
|
4286
|
-
" ",
|
|
4287
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
4288
|
-
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
4289
|
-
"input",
|
|
4290
|
-
{
|
|
4291
|
-
type: "text",
|
|
4292
|
-
name: props.name,
|
|
4293
|
-
id: props.name,
|
|
4294
|
-
value,
|
|
4295
|
-
onChange: textChangeHandler,
|
|
4296
|
-
onBlur: props?.onBlur,
|
|
4297
|
-
autoComplete: "off",
|
|
4298
|
-
required: props?.attributes?.required,
|
|
4299
|
-
placeholder: props?.attributes?.placeholder,
|
|
4300
|
-
maxLength: 4,
|
|
4301
|
-
pattern: props?.attributes?.pattern,
|
|
4302
|
-
disabled: props?.attributes?.readOnly,
|
|
4303
|
-
minLength: props?.attributes?.minLength,
|
|
4304
|
-
autoFocus: props?.attributes?.autoFocus,
|
|
4305
|
-
onWheel: handleWheel,
|
|
4306
|
-
className: `peer input mt-1 py-1.5 block w-full rounded shadow-sm tracking-[1.25em] text-center transition-all duration-500 ease-in-out
|
|
4307
|
-
${props?.inputClasses ? props.inputClasses : ``}
|
|
4308
|
-
`
|
|
4309
|
-
}
|
|
4310
|
-
),
|
|
4311
|
-
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
4312
|
-
] }) });
|
|
4313
|
-
};
|
|
4314
|
-
OtpInput_default = OtpInput;
|
|
4315
|
-
}
|
|
4316
|
-
});
|
|
4317
|
-
|
|
4318
|
-
// src/components/controls/edit/DateTimeInput.tsx
|
|
4319
|
-
var import_react48, import_jsx_runtime74, DateTimeInput, DateTimeInput_default;
|
|
4320
|
-
var init_DateTimeInput = __esm({
|
|
4321
|
-
"src/components/controls/edit/DateTimeInput.tsx"() {
|
|
4322
|
-
"use strict";
|
|
4323
|
-
import_react48 = __toESM(require("react"));
|
|
4324
|
-
import_jsx_runtime74 = require("react/jsx-runtime");
|
|
4325
|
-
DateTimeInput = (props) => {
|
|
4326
|
-
const textChangeHandler = (event) => {
|
|
4327
|
-
const localDate = new Date(event.target.value);
|
|
4328
|
-
if (props.callback !== void 0) {
|
|
4329
|
-
const utcISOString = localDate.toISOString();
|
|
4330
|
-
props.callback({
|
|
4331
|
-
name: props.name,
|
|
4332
|
-
value: utcISOString,
|
|
4333
|
-
index: props.index,
|
|
4334
|
-
groupKey: props.groupKey
|
|
4335
|
-
});
|
|
4336
|
-
}
|
|
4337
|
-
};
|
|
4338
|
-
let value;
|
|
4339
|
-
let localvalue;
|
|
4340
|
-
let timeZoneAbbr;
|
|
4341
|
-
if (props.value !== void 0 && props.value !== null) {
|
|
4342
|
-
value = props.value;
|
|
4343
|
-
const now = /* @__PURE__ */ new Date();
|
|
4344
|
-
const offsetMinutes = now.getTimezoneOffset();
|
|
4345
|
-
const offsetMilliseconds = offsetMinutes * 60 * 1e3;
|
|
4346
|
-
const valDate = value.toString().includes("Z") ? new Date(value) : /* @__PURE__ */ new Date(value + "Z");
|
|
4347
|
-
const localDate = new Date(valDate.getTime() - offsetMilliseconds);
|
|
4348
|
-
timeZoneAbbr = now.toLocaleTimeString("en", { timeZoneName: "short" }).split(" ")[2];
|
|
4349
|
-
localvalue = localDate?.toISOString()?.slice(0, 16);
|
|
4350
|
-
}
|
|
4351
|
-
const handleKeyDown = (e) => {
|
|
4352
|
-
if (e.key === "Backspace") {
|
|
4353
|
-
e.preventDefault();
|
|
4354
|
-
}
|
|
4355
|
-
};
|
|
4356
|
-
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_react48.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("label", { className: "block mb-1", children: [
|
|
4357
|
-
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "text-sm font-medium ", children: props?.attributes?.label }),
|
|
4358
|
-
" ",
|
|
4359
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
4360
|
-
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4361
|
-
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
4362
|
-
"input",
|
|
4363
|
-
{
|
|
4364
|
-
type: "datetime-local",
|
|
4365
|
-
name: props.name,
|
|
4366
|
-
id: props.name,
|
|
4367
|
-
value: localvalue,
|
|
4368
|
-
onChange: textChangeHandler,
|
|
4369
|
-
onKeyDown: handleKeyDown,
|
|
4370
|
-
required: props?.attributes?.required,
|
|
4371
|
-
placeholder: props?.attributes?.placeholder,
|
|
4372
|
-
maxLength: props?.attributes?.maxLength,
|
|
4373
|
-
pattern: props?.attributes?.pattern,
|
|
4374
|
-
disabled: props?.attributes?.readOnly,
|
|
4375
|
-
minLength: props?.attributes?.minLength,
|
|
4376
|
-
className: "peer mt-1 py-1.5 block w-full rounded shadow-sm\n disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none\n "
|
|
4377
|
-
}
|
|
4378
|
-
),
|
|
4379
|
-
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { children: timeZoneAbbr })
|
|
4380
|
-
] }),
|
|
4381
|
-
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
4382
|
-
] }) });
|
|
4383
|
-
};
|
|
4384
|
-
DateTimeInput_default = DateTimeInput;
|
|
4385
|
-
}
|
|
4386
|
-
});
|
|
4387
|
-
|
|
4388
|
-
// src/components/controls/edit/ColorInput.tsx
|
|
4389
|
-
var import_react49, import_jsx_runtime75, DEFAULT_COLOR, isValidHex, normalizeColor, ColorInput, ColorInput_default;
|
|
4390
|
-
var init_ColorInput = __esm({
|
|
4391
|
-
"src/components/controls/edit/ColorInput.tsx"() {
|
|
4392
|
-
"use strict";
|
|
4393
|
-
import_react49 = __toESM(require("react"));
|
|
4394
|
-
import_jsx_runtime75 = require("react/jsx-runtime");
|
|
4395
|
-
DEFAULT_COLOR = "#3b82f6";
|
|
4396
|
-
isValidHex = (val) => typeof val === "string" && /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/.test(val.trim());
|
|
4397
|
-
normalizeColor = (val) => {
|
|
4398
|
-
if (isValidHex(val)) {
|
|
4399
|
-
return val.trim();
|
|
4400
|
-
}
|
|
4401
|
-
return DEFAULT_COLOR;
|
|
4402
|
-
};
|
|
4403
|
-
ColorInput = (props) => {
|
|
4404
|
-
const isReadOnly = props.attributes?.readOnly === true || props.attributes?.readOnly === "true" || props?.readOnly === true || props.disable === true || props.attributes?.disable === true || props.attributes?.disabled === true || props.attributes?.disabled === "true";
|
|
4405
|
-
const [color, setColor] = import_react49.default.useState(
|
|
4406
|
-
() => normalizeColor(props.value)
|
|
4407
|
-
);
|
|
4408
|
-
(0, import_react49.useEffect)(() => {
|
|
4409
|
-
const hasValue = props.value !== void 0 && props.value !== null && props.value !== "";
|
|
4410
|
-
if (!hasValue && props.callback && !isReadOnly) {
|
|
4411
|
-
props.callback({
|
|
4412
|
-
name: props.name,
|
|
4413
|
-
value: DEFAULT_COLOR,
|
|
4414
|
-
index: props.index,
|
|
4415
|
-
groupKey: props.groupKey
|
|
4416
|
-
});
|
|
4417
|
-
}
|
|
4418
|
-
}, [isReadOnly]);
|
|
4419
|
-
(0, import_react49.useEffect)(() => {
|
|
4420
|
-
if (props.value !== void 0 && props.value !== null && props.value !== "") {
|
|
4421
|
-
if (typeof props.value === "string") {
|
|
4422
|
-
setColor(normalizeColor(props.value));
|
|
4423
|
-
}
|
|
4424
|
-
}
|
|
4425
|
-
}, [props.value]);
|
|
4426
|
-
const handleColorChange = (event) => {
|
|
4427
|
-
if (isReadOnly) return;
|
|
4428
|
-
const newColor = event.target.value;
|
|
4429
|
-
setColor(newColor);
|
|
4430
|
-
if (props.callback) {
|
|
4431
|
-
props.callback({
|
|
4432
|
-
name: props.name,
|
|
4433
|
-
value: newColor,
|
|
4434
|
-
index: props.index,
|
|
4435
|
-
groupKey: props.groupKey
|
|
4436
|
-
});
|
|
4437
|
-
}
|
|
4438
|
-
};
|
|
4439
|
-
const displayColor = normalizeColor(color || props.value);
|
|
4440
|
-
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_react49.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("label", { className: `block ${isReadOnly ? "cursor-not-allowed" : ""}`, children: [
|
|
4441
|
-
props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "text-sm inline-block pb-1 font-medium ", children: props?.attributes?.label }),
|
|
4442
|
-
" ",
|
|
4443
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
4444
|
-
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
4445
|
-
"input",
|
|
4446
|
-
{
|
|
4447
|
-
type: "color",
|
|
4448
|
-
name: props.name,
|
|
4449
|
-
title: displayColor,
|
|
4450
|
-
id: props.name,
|
|
4451
|
-
value: displayColor,
|
|
4452
|
-
onChange: handleColorChange,
|
|
4453
|
-
onBlur: props?.onBlur,
|
|
4454
|
-
autoFocus: props?.attributes?.autoFocus,
|
|
4455
|
-
required: !isReadOnly && Boolean(props?.attributes?.required),
|
|
4456
|
-
disabled: isReadOnly,
|
|
4457
|
-
readOnly: isReadOnly,
|
|
4458
|
-
tabIndex: isReadOnly ? -1 : void 0,
|
|
4459
|
-
onClick: (e) => {
|
|
4460
|
-
if (isReadOnly) {
|
|
4461
|
-
e.preventDefault();
|
|
4462
|
-
e.stopPropagation();
|
|
4463
|
-
}
|
|
4464
|
-
},
|
|
4465
|
-
className: `peer block rounded ${isReadOnly ? "cursor-not-allowed pointer-events-none" : "cursor-pointer"} ${props?.inputClasses ? props.inputClasses : ""}`,
|
|
4466
|
-
style: {
|
|
4467
|
-
width: "78px",
|
|
4468
|
-
height: "33px",
|
|
4469
|
-
padding: 0,
|
|
4470
|
-
margin: 0,
|
|
4471
|
-
border: isReadOnly ? "1px solid var(--border, #e2e8f0)" : "1px solid #e2e8f0",
|
|
4472
|
-
borderRadius: "5px",
|
|
4473
|
-
overflow: "hidden",
|
|
4474
|
-
backgroundColor: isReadOnly ? "var(--bg-color, transparent)" : "transparent",
|
|
4475
|
-
appearance: "none",
|
|
4476
|
-
cursor: isReadOnly ? "not-allowed" : "pointer",
|
|
4477
|
-
pointerEvents: isReadOnly ? "none" : "auto"
|
|
4478
|
-
}
|
|
4479
|
-
}
|
|
4480
|
-
),
|
|
4481
|
-
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
4482
|
-
] }) });
|
|
4483
|
-
};
|
|
4484
|
-
ColorInput_default = ColorInput;
|
|
4485
|
-
}
|
|
4486
|
-
});
|
|
4487
|
-
|
|
4488
|
-
// src/components/controls/edit/SelectWithSearchInput.tsx
|
|
4489
|
-
var import_react50, import_jsx_runtime76, SelectWithSearchInput, SelectWithSearchInput_default;
|
|
4490
|
-
var init_SelectWithSearchInput = __esm({
|
|
4491
|
-
"src/components/controls/edit/SelectWithSearchInput.tsx"() {
|
|
4492
|
-
"use strict";
|
|
4493
|
-
"use client";
|
|
4494
|
-
import_react50 = __toESM(require("react"));
|
|
4495
|
-
import_jsx_runtime76 = require("react/jsx-runtime");
|
|
4496
|
-
SelectWithSearchInput = (props) => {
|
|
4497
|
-
const [isOpen, setIsOpen] = (0, import_react50.useState)(false);
|
|
4498
|
-
const [searchTerm, setSearchTerm] = (0, import_react50.useState)("");
|
|
4499
|
-
const [highlightedIndex, setHighlightedIndex] = (0, import_react50.useState)(-1);
|
|
4500
|
-
const [selectedItem, setSelectedItem] = (0, import_react50.useState)(
|
|
4501
|
-
null
|
|
4502
|
-
);
|
|
4503
|
-
const [list, setList] = (0, import_react50.useState)([]);
|
|
4504
|
-
const loadData = import_react50.default.useCallback(async () => {
|
|
4505
|
-
if (props.dataset) {
|
|
4506
|
-
setList(props.dataset);
|
|
4507
|
-
return;
|
|
4508
|
-
}
|
|
4509
|
-
if (props.dataSource && props.serviceClient) {
|
|
4510
|
-
let url = props.dataSource;
|
|
4511
|
-
if (props.dataSourceDependsOn && props.dependentValue) {
|
|
4512
|
-
url = url.replace(
|
|
4513
|
-
`{${props.dataSourceDependsOn}}`,
|
|
4514
|
-
props.dependentValue
|
|
4515
|
-
);
|
|
4516
|
-
}
|
|
4517
|
-
const response = await props.serviceClient.get(url);
|
|
4518
|
-
if (response?.result) {
|
|
4519
|
-
setList(response.result);
|
|
4520
|
-
}
|
|
4521
|
-
}
|
|
4522
|
-
}, [
|
|
4523
|
-
props.dataset,
|
|
4524
|
-
props.dataSource,
|
|
4525
|
-
props.serviceClient,
|
|
4526
|
-
props.dataSourceDependsOn,
|
|
4527
|
-
props.dependentValue
|
|
4528
|
-
]);
|
|
4529
|
-
(0, import_react50.useEffect)(() => {
|
|
4530
|
-
loadData();
|
|
4531
|
-
}, [loadData]);
|
|
4532
|
-
(0, import_react50.useEffect)(() => {
|
|
4533
|
-
if (props.value && list.length && props.dataKeyFieldName && props.dataTextFieldName) {
|
|
4534
|
-
const selected = list.find(
|
|
4535
|
-
(x) => String(x[props.dataKeyFieldName]) === String(props.value)
|
|
4536
|
-
);
|
|
4537
|
-
if (selected) {
|
|
4538
|
-
setSearchTerm(selected[props.dataTextFieldName]);
|
|
4539
|
-
setSelectedItem(selected);
|
|
4540
|
-
}
|
|
4541
|
-
}
|
|
4542
|
-
}, [props.value, list, props.dataKeyFieldName, props.dataTextFieldName]);
|
|
4543
|
-
const filteredItems = list.filter((item) => {
|
|
4544
|
-
const text = item[props.dataTextFieldName] ?? "";
|
|
4545
|
-
return text.toString().toLowerCase().includes(searchTerm.toLowerCase());
|
|
4546
|
-
});
|
|
4547
|
-
const handleSelect = (event, item) => {
|
|
4548
|
-
event.preventDefault();
|
|
4549
|
-
setSearchTerm(item[props.dataTextFieldName]);
|
|
4550
|
-
setSelectedItem(item);
|
|
4551
|
-
setIsOpen(false);
|
|
4552
|
-
setHighlightedIndex(-1);
|
|
4553
|
-
const selectedValue = item[props.dataKeyFieldName];
|
|
4554
|
-
if (props.onChange) {
|
|
4555
|
-
props.onChange(selectedValue);
|
|
4556
|
-
}
|
|
4557
|
-
if (props.callback) {
|
|
4558
|
-
props.callback({
|
|
4559
|
-
name: props.name,
|
|
4560
|
-
value: selectedValue,
|
|
4561
|
-
index: props.index,
|
|
4562
|
-
groupKey: props.groupKey
|
|
4563
|
-
});
|
|
4564
|
-
}
|
|
4565
|
-
};
|
|
4566
|
-
const handleKeyDown = (e) => {
|
|
4567
|
-
if (e.key === "ArrowDown") {
|
|
4568
|
-
setHighlightedIndex(
|
|
4569
|
-
(prev) => prev < filteredItems.length - 1 ? prev + 1 : 0
|
|
4570
|
-
);
|
|
4571
|
-
} else if (e.key === "ArrowUp") {
|
|
4572
|
-
setHighlightedIndex(
|
|
4573
|
-
(prev) => prev > 0 ? prev - 1 : filteredItems.length - 1
|
|
4574
|
-
);
|
|
4575
|
-
} else if (e.key === "Enter" && highlightedIndex >= 0) {
|
|
4576
|
-
handleSelect(e, filteredItems[highlightedIndex]);
|
|
4577
|
-
}
|
|
4578
|
-
};
|
|
4579
|
-
const dropdownRef = (0, import_react50.useRef)(null);
|
|
4580
|
-
(0, import_react50.useEffect)(() => {
|
|
4581
|
-
if (highlightedIndex >= 0 && dropdownRef.current) {
|
|
4582
|
-
const highlightedItem = dropdownRef.current.children[highlightedIndex];
|
|
4583
|
-
highlightedItem?.scrollIntoView({
|
|
4584
|
-
behavior: "smooth",
|
|
4585
|
-
block: "nearest"
|
|
4586
|
-
});
|
|
4587
|
-
}
|
|
4588
|
-
}, [highlightedIndex]);
|
|
4589
|
-
const isReadOnly = props.attributes?.readOnly || props.disable || props.attributes?.disable;
|
|
4590
|
-
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "relative", children: [
|
|
4591
|
-
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("label", { className: "pb-1", children: [
|
|
4592
|
-
props.attributes?.label,
|
|
4593
|
-
" ",
|
|
4594
|
-
props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "bg-error-weak", children: "*" })
|
|
4595
|
-
] }),
|
|
4596
|
-
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "relative", children: [
|
|
4597
|
-
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
4598
|
-
"input",
|
|
4599
|
-
{
|
|
4600
|
-
type: "text",
|
|
4601
|
-
name: props.name,
|
|
4602
|
-
id: props.name,
|
|
4603
|
-
value: searchTerm,
|
|
4604
|
-
onChange: (e) => {
|
|
4605
|
-
if (!isReadOnly) {
|
|
4606
|
-
setSearchTerm(e.target.value);
|
|
4607
|
-
setIsOpen(true);
|
|
4608
|
-
setHighlightedIndex(-1);
|
|
4609
|
-
}
|
|
4610
|
-
},
|
|
4611
|
-
onFocus: () => {
|
|
4612
|
-
if (!isReadOnly) {
|
|
4613
|
-
setIsOpen(true);
|
|
4614
|
-
}
|
|
4615
|
-
},
|
|
4616
|
-
onKeyDown: handleKeyDown,
|
|
4617
|
-
placeholder: props.attributes?.placeholder ?? "Search...",
|
|
4618
|
-
readOnly: isReadOnly,
|
|
4619
|
-
disabled: isReadOnly,
|
|
4620
|
-
required: props.attributes?.required,
|
|
4621
|
-
className: `peer mt-2 py-1.5 select block w-full text-black rounded border-gray-300 shadow-sm
|
|
4622
|
-
focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50
|
|
4623
|
-
disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none
|
|
4624
|
-
${isReadOnly ? "bg-neutral-soft opacity-50 cursor-not-allowed" : "bg-default"}
|
|
4625
|
-
`
|
|
4626
|
-
}
|
|
4627
|
-
),
|
|
4628
|
-
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
4629
|
-
"button",
|
|
4630
|
-
{
|
|
4631
|
-
type: "button",
|
|
4632
|
-
disabled: isReadOnly,
|
|
4633
|
-
onClick: () => {
|
|
4634
|
-
if (!isReadOnly) {
|
|
4635
|
-
setIsOpen(!isOpen);
|
|
4636
|
-
}
|
|
4637
|
-
},
|
|
4638
|
-
className: "absolute right-2 top-3 h-5 w-5 text-gray-500 focus:outline-none",
|
|
4639
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
4640
|
-
"svg",
|
|
4641
|
-
{
|
|
4642
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
4643
|
-
fill: "none",
|
|
4644
|
-
viewBox: "0 0 24 24",
|
|
4645
|
-
strokeWidth: 1.5,
|
|
4646
|
-
stroke: "currentColor",
|
|
4647
|
-
className: "w-full h-full",
|
|
4648
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
4649
|
-
"path",
|
|
4650
|
-
{
|
|
4651
|
-
strokeLinecap: "round",
|
|
4652
|
-
strokeLinejoin: "round",
|
|
4653
|
-
d: "M19.5 8.25l-7.5 7.5-7.5-7.5"
|
|
4654
|
-
}
|
|
4655
|
-
)
|
|
4656
|
-
}
|
|
4657
|
-
)
|
|
4658
|
-
}
|
|
4659
|
-
),
|
|
4660
|
-
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props.attributes?.errorMessage ?? "" })
|
|
4661
|
-
] }),
|
|
4662
|
-
!isReadOnly && isOpen && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
4663
|
-
"div",
|
|
4664
|
-
{
|
|
4665
|
-
ref: dropdownRef,
|
|
4666
|
-
className: "absolute z-10 w-full bg-default border border-gray-200 shadow-lg max-h-48 overflow-y-auto",
|
|
4667
|
-
children: filteredItems.length > 0 ? filteredItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
4668
|
-
"button",
|
|
4669
|
-
{
|
|
4670
|
-
onClick: (e) => handleSelect(e, item),
|
|
4671
|
-
className: `w-full px-4 py-2 flex items-center space-x-2 text-left ${index === highlightedIndex ? "bg-gray-200" : "hover:bg-gray-100"}`,
|
|
4672
|
-
role: "option",
|
|
4673
|
-
tabIndex: -1,
|
|
4674
|
-
onMouseEnter: () => setHighlightedIndex(index),
|
|
4675
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { children: item[props.dataTextFieldName] })
|
|
4676
|
-
},
|
|
4677
|
-
item[props.dataKeyFieldName]
|
|
4678
|
-
)) : /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "px-4 py-2 text-gray-500", children: "No results found" })
|
|
4679
|
-
}
|
|
4680
|
-
)
|
|
4681
|
-
] });
|
|
4682
|
-
};
|
|
4683
|
-
SelectWithSearchInput_default = SelectWithSearchInput;
|
|
4684
|
-
}
|
|
4685
|
-
});
|
|
4686
|
-
|
|
4687
|
-
// src/components/controls/edit/SelectWithSearchPanel.tsx
|
|
4688
|
-
var import_react51, import_jsx_runtime77, SelectWithSearchPanel, SelectWithSearchPanel_default;
|
|
4689
|
-
var init_SelectWithSearchPanel = __esm({
|
|
4690
|
-
"src/components/controls/edit/SelectWithSearchPanel.tsx"() {
|
|
4691
|
-
"use strict";
|
|
4692
|
-
"use client";
|
|
4693
|
-
init_Button();
|
|
4694
|
-
import_react51 = __toESM(require("react"));
|
|
4695
|
-
import_jsx_runtime77 = require("react/jsx-runtime");
|
|
4696
|
-
SelectWithSearchPanel = (props) => {
|
|
4697
|
-
const [isOpen, setIsOpen] = (0, import_react51.useState)(false);
|
|
4698
|
-
const [searchTerm, setSearchTerm] = (0, import_react51.useState)("");
|
|
4699
|
-
const [highlightedIndex, setHighlightedIndex] = (0, import_react51.useState)(0);
|
|
4700
|
-
const [list, setList] = (0, import_react51.useState)([]);
|
|
4701
|
-
const listRef = (0, import_react51.useRef)(null);
|
|
4702
|
-
const [isError, setIsError] = (0, import_react51.useState)(false);
|
|
4703
|
-
const containerRef = (0, import_react51.useRef)(null);
|
|
4704
|
-
const [isCreateOpen, setIsCreateOpen] = (0, import_react51.useState)(false);
|
|
4705
|
-
const [formData, setFormData] = (0, import_react51.useState)({});
|
|
4706
|
-
const getNestedValue7 = (obj, path) => {
|
|
4707
|
-
return path.split(".").reduce((acc, key) => acc?.[key], obj);
|
|
4708
|
-
};
|
|
4709
|
-
(0, import_react51.useEffect)(() => {
|
|
4710
|
-
const handleClickOutside = (event) => {
|
|
4711
|
-
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
4712
|
-
setIsOpen(false);
|
|
4713
|
-
}
|
|
4714
|
-
};
|
|
4715
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
4716
|
-
return () => {
|
|
4717
|
-
document.removeEventListener("mousedown", handleClickOutside);
|
|
4718
|
-
};
|
|
4719
|
-
}, []);
|
|
4720
|
-
(0, import_react51.useEffect)(() => {
|
|
4721
|
-
async function fetchData() {
|
|
4722
|
-
if (props.dataset) {
|
|
4723
|
-
setList(props.dataset);
|
|
4724
|
-
} else if (props.dataSource && props.serviceClient) {
|
|
4725
|
-
let dataSource = props.dataSource;
|
|
4726
|
-
if (props.dataSourceDependsOn && props.dependentValue) {
|
|
4727
|
-
dataSource = dataSource.replace(
|
|
4728
|
-
`{${props.dataSourceDependsOn}}`,
|
|
4729
|
-
props.dependentValue
|
|
4730
|
-
);
|
|
4731
|
-
}
|
|
4732
|
-
const response = await props.serviceClient.get(dataSource);
|
|
4733
|
-
if (response?.result) setList(response.result);
|
|
4734
|
-
}
|
|
4735
|
-
}
|
|
4736
|
-
fetchData();
|
|
4737
|
-
}, [
|
|
4738
|
-
props.dataSource,
|
|
4739
|
-
props.dependentValue,
|
|
4740
|
-
props.dataset,
|
|
4741
|
-
props.dataSourceDependsOn
|
|
4742
|
-
]);
|
|
4743
|
-
const filteredItems = list?.filter((item) => {
|
|
4744
|
-
const value = getNestedValue7(item, props.dataTextFieldName);
|
|
4745
|
-
return value?.toLowerCase().includes(searchTerm?.toLowerCase());
|
|
4746
|
-
});
|
|
4747
|
-
const playBeep = () => {
|
|
4748
|
-
const audioCtx = new (window.AudioContext || window.webkitAudioContext)();
|
|
4749
|
-
const oscillator = audioCtx.createOscillator();
|
|
4750
|
-
const gainNode = audioCtx.createGain();
|
|
4751
|
-
oscillator.type = "square";
|
|
4752
|
-
oscillator.frequency.setValueAtTime(300, audioCtx.currentTime);
|
|
4753
|
-
gainNode.gain.setValueAtTime(0.02, audioCtx.currentTime);
|
|
4754
|
-
oscillator.connect(gainNode);
|
|
4755
|
-
gainNode.connect(audioCtx.destination);
|
|
4756
|
-
oscillator.start();
|
|
4757
|
-
setTimeout(() => {
|
|
4758
|
-
oscillator.stop();
|
|
4759
|
-
audioCtx.close();
|
|
4760
|
-
}, 250);
|
|
4761
|
-
};
|
|
4762
|
-
(0, import_react51.useEffect)(() => {
|
|
4763
|
-
const filteredItems2 = list?.filter(
|
|
4764
|
-
(item) => item[props?.dataTextFieldName]?.toLowerCase().includes(searchTerm?.toLowerCase())
|
|
4765
|
-
);
|
|
4766
|
-
if (searchTerm.length > 0 && filteredItems2.length === 0) {
|
|
4767
|
-
playBeep();
|
|
4768
|
-
setIsError(true);
|
|
4769
|
-
} else {
|
|
4770
|
-
setIsError(false);
|
|
4771
|
-
}
|
|
4772
|
-
}, [searchTerm]);
|
|
4773
|
-
const handleSelect = (event, item) => {
|
|
4774
|
-
event.preventDefault();
|
|
4775
|
-
setSearchTerm(getNestedValue7(item, props.dataTextFieldName));
|
|
4776
|
-
if (props.callback) {
|
|
4777
|
-
const val = {};
|
|
4778
|
-
props.callback({
|
|
4779
|
-
name: props.name,
|
|
4780
|
-
value: item[props.dataKeyFieldName],
|
|
4781
|
-
index: props.index,
|
|
4782
|
-
groupKey: props.groupKey
|
|
4783
|
-
});
|
|
4784
|
-
}
|
|
4785
|
-
setHighlightedIndex(0);
|
|
4786
|
-
setIsOpen(false);
|
|
4787
|
-
};
|
|
4788
|
-
const handleKeyDown = (e) => {
|
|
4789
|
-
if (e.key === "Escape") {
|
|
4790
|
-
setIsOpen(false);
|
|
4791
|
-
setHighlightedIndex(-1);
|
|
4792
|
-
} else if (e.key === "ArrowDown") {
|
|
4793
|
-
e.preventDefault();
|
|
4794
|
-
setHighlightedIndex((prev) => {
|
|
4795
|
-
const nextIndex = prev < filteredItems.length - 1 ? prev + 1 : prev;
|
|
4796
|
-
scrollIntoView(nextIndex);
|
|
4797
|
-
return nextIndex;
|
|
4798
|
-
});
|
|
4799
|
-
} else if (e.key === "ArrowUp") {
|
|
4800
|
-
e.preventDefault();
|
|
4801
|
-
setHighlightedIndex((prev) => {
|
|
4802
|
-
const prevIndex = prev > 0 ? prev - 1 : prev;
|
|
4803
|
-
scrollIntoView(prevIndex);
|
|
4804
|
-
return prevIndex;
|
|
4805
|
-
});
|
|
4806
|
-
} else if (e.key === "Enter" && highlightedIndex >= 0) {
|
|
4807
|
-
handleSelect(e, filteredItems[highlightedIndex]);
|
|
4808
|
-
}
|
|
4809
|
-
};
|
|
4810
|
-
const scrollIntoView = (index) => {
|
|
4811
|
-
if (listRef.current) {
|
|
4812
|
-
const item = listRef.current.children[index];
|
|
4813
|
-
if (item) {
|
|
4814
|
-
item.scrollIntoView();
|
|
4815
|
-
}
|
|
4816
|
-
}
|
|
4817
|
-
};
|
|
4818
|
-
const textChangeHandler = (event) => {
|
|
4819
|
-
const newSearchTerm = event.target.value;
|
|
4820
|
-
setSearchTerm(newSearchTerm);
|
|
4821
|
-
setIsOpen(true);
|
|
4822
|
-
setHighlightedIndex(0);
|
|
4823
|
-
};
|
|
4824
|
-
const handleInputChange = (event, field) => {
|
|
4825
|
-
setFormData((prev) => ({ ...prev, [field]: event.target.value }));
|
|
4826
|
-
};
|
|
4827
|
-
const handleSaveModal = (0, import_react51.useCallback)(async () => {
|
|
4828
|
-
console.log("Form Data:", formData);
|
|
4829
|
-
return formData;
|
|
4830
|
-
}, []);
|
|
4831
|
-
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "relative", children: [
|
|
4832
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("label", { className: "text-sm mb-1 font-medium", children: [
|
|
4833
|
-
props.attributes?.label,
|
|
4834
|
-
" ",
|
|
4835
|
-
" ",
|
|
4836
|
-
props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { className: "bg-error-weak", children: "*" })
|
|
4837
|
-
] }),
|
|
4838
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { children: [
|
|
4839
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4840
|
-
"input",
|
|
4841
|
-
{
|
|
4842
|
-
type: "text",
|
|
4843
|
-
name: props.name,
|
|
4844
|
-
id: props.name,
|
|
4845
|
-
value: searchTerm,
|
|
4846
|
-
onChange: textChangeHandler,
|
|
4847
|
-
onFocus: () => setIsOpen(true),
|
|
4848
|
-
onKeyDown: handleKeyDown,
|
|
4849
|
-
placeholder: props.attributes?.placeholder,
|
|
4850
|
-
required: props.attributes?.required,
|
|
4851
|
-
className: `peer mt-1 py-1.5 block w-full text-black rounded border-gray-300 shadow-sm
|
|
4852
|
-
${isError ? "focus:border-red-300 focus:ring focus:ring-red-200 focus:ring-opacity-50" : "focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50"}
|
|
4853
|
-
disabled:bg-slate-50 disabled:text-slate-500 disabled:border-slate-200 disabled:shadow-none`
|
|
4854
|
-
}
|
|
4855
|
-
),
|
|
4856
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props.attributes?.errorMessage ?? "" })
|
|
4857
|
-
] }),
|
|
4858
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { ref: containerRef, children: isOpen && /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_react51.default.Fragment, { children: [
|
|
4859
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "fixed z-50 right-0 bg-white top-[62px] w-1/4 border-l border-gray-200", children: [
|
|
4860
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "flex flex-col p-2 bg-accent-950 text-white", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("h5", { className: "text-md text-white font-medium", children: [
|
|
4861
|
-
"Select a",
|
|
4862
|
-
" ",
|
|
4863
|
-
props.attributes?.label || props.attributes?.heading
|
|
4864
|
-
] }) }),
|
|
4865
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "flex justify-end px-4 border-b py-2 border-gray-200 h-10", children: props.createFields && props.createFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4866
|
-
"button",
|
|
4867
|
-
{
|
|
4868
|
-
type: "button",
|
|
4869
|
-
className: "text-primary hover:text-primary-800",
|
|
4870
|
-
onMouseDown: (e) => {
|
|
4871
|
-
e.preventDefault();
|
|
4872
|
-
setIsCreateOpen(true);
|
|
4873
|
-
},
|
|
4874
|
-
children: "Create"
|
|
4875
|
-
}
|
|
4876
|
-
) })
|
|
4877
|
-
] }),
|
|
4878
|
-
isCreateOpen && /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "fixed right-0 w-1/4 h-full top-[62px] bg-white shadow-lg border-l border-gray-200 z-50", children: [
|
|
4879
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "flex flex-col p-2 bg-accent-950", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("h5", { className: "text-md font-medium text-white", children: [
|
|
4880
|
-
"Create New ",
|
|
4881
|
-
props.attributes?.label
|
|
4882
|
-
] }) }),
|
|
4883
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "flex justify-end px-4 border-b py-2 border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4884
|
-
"button",
|
|
4885
|
-
{
|
|
4886
|
-
type: "button",
|
|
4887
|
-
onClick: () => setIsCreateOpen(false),
|
|
4888
|
-
className: "text-red-600 hover:text-red-800",
|
|
4889
|
-
children: "Close"
|
|
4890
|
-
}
|
|
4891
|
-
) }),
|
|
4892
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "p-4", children: [
|
|
4893
|
-
props.createFields?.map((field) => /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "mb-4", children: [
|
|
4894
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("label", { className: "text-sm mb-1 font-medium block", children: field.label }),
|
|
4895
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4896
|
-
"input",
|
|
4897
|
-
{
|
|
4898
|
-
type: field.type,
|
|
4899
|
-
value: formData[field.name] || "",
|
|
4900
|
-
onChange: (e) => handleInputChange(e, field.name),
|
|
4901
|
-
placeholder: field.placeholder,
|
|
4902
|
-
required: field.required,
|
|
4903
|
-
disabled: field.disabled,
|
|
4904
|
-
pattern: field.pattern,
|
|
4905
|
-
minLength: field.minLength,
|
|
4906
|
-
maxLength: field.maxLength,
|
|
4907
|
-
className: "peer mt-1 py-1.5 block w-full text-black rounded border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50"
|
|
4908
|
-
}
|
|
4909
|
-
)
|
|
4910
|
-
] }, field.name)),
|
|
4911
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(Button_default, { onClick: async () => {
|
|
4912
|
-
handleSaveModal();
|
|
4913
|
-
return { isSuccessful: true };
|
|
4914
|
-
}, className: "w-full", children: [
|
|
4915
|
-
"Save ",
|
|
4916
|
-
props.attributes?.label
|
|
4917
|
-
] })
|
|
4918
|
-
] })
|
|
4919
|
-
] }),
|
|
4920
|
-
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4921
|
-
"div",
|
|
4922
|
-
{
|
|
4923
|
-
ref: listRef,
|
|
4924
|
-
className: "fixed z-10 right-0 mt-[130px] top-0 w-1/4 bg-white border-l border-gray-200 shadow-lg overflow-y-auto",
|
|
4925
|
-
style: { height: "calc(100vh - 130px)" },
|
|
4926
|
-
children: filteredItems.length > 0 ? filteredItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4927
|
-
"button",
|
|
4928
|
-
{
|
|
4929
|
-
onClick: (e) => {
|
|
4930
|
-
handleSelect(e, item);
|
|
4931
|
-
},
|
|
4932
|
-
className: `w-full px-4 py-2 flex items-center space-x-2 text-left border-b border-gray-200 ${index === highlightedIndex ? "bg-gray-200" : "hover:bg-gray-100"}`,
|
|
4933
|
-
role: "option",
|
|
4934
|
-
tabIndex: -1,
|
|
4935
|
-
onMouseEnter: () => setHighlightedIndex(index),
|
|
4936
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { children: getNestedValue7(item, props.dataTextFieldName) })
|
|
4937
|
-
}
|
|
4938
|
-
) }, item[props.dataKeyFieldName])) : /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "px-4 py-2 text-gray-500", children: "No results found" })
|
|
4939
|
-
}
|
|
4940
|
-
)
|
|
4941
|
-
] }) })
|
|
4942
|
-
] });
|
|
4943
|
-
};
|
|
4944
|
-
SelectWithSearchPanel_default = SelectWithSearchPanel;
|
|
4945
|
-
}
|
|
4946
|
-
});
|
|
4947
|
-
|
|
4948
|
-
// src/components/controls/edit/EmailInput.tsx
|
|
4949
|
-
var import_react52, import_jsx_runtime78, EmailInput, EmailInput_default;
|
|
4950
|
-
var init_EmailInput = __esm({
|
|
4951
|
-
"src/components/controls/edit/EmailInput.tsx"() {
|
|
4952
|
-
"use strict";
|
|
4953
|
-
import_react52 = __toESM(require("react"));
|
|
4954
|
-
import_jsx_runtime78 = require("react/jsx-runtime");
|
|
4955
|
-
EmailInput = (props) => {
|
|
4956
|
-
const textChangeHandler = (event) => {
|
|
4957
|
-
const text = event.target.value;
|
|
4958
|
-
if (text) {
|
|
4959
|
-
const atIndex = text.indexOf("@");
|
|
4960
|
-
const dotIndex = text.indexOf(".", atIndex);
|
|
4961
|
-
if (dotIndex < atIndex || text.length - dotIndex <= 2) {
|
|
4962
|
-
event.target.setCustomValidity("invaild-value");
|
|
4963
|
-
} else {
|
|
4964
|
-
event.target.setCustomValidity("");
|
|
4965
|
-
}
|
|
4966
|
-
}
|
|
4967
|
-
if (props.callback !== void 0) {
|
|
4968
|
-
props.callback({
|
|
4969
|
-
name: props.name,
|
|
4970
|
-
value: text,
|
|
4971
|
-
index: props.index,
|
|
4972
|
-
groupKey: props.groupKey
|
|
4973
|
-
});
|
|
4974
|
-
}
|
|
4975
|
-
};
|
|
4976
|
-
let value = "";
|
|
4977
|
-
if (props.value !== void 0 && props.value !== null) {
|
|
4978
|
-
value = props.value;
|
|
4979
|
-
}
|
|
4980
|
-
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react52.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("label", { className: "block", children: [
|
|
4981
|
-
props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "text-sm inline-block pb-1 font-medium ", children: props?.attributes?.label }),
|
|
4982
|
-
" ",
|
|
4983
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
4984
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4985
|
-
"input",
|
|
4986
|
-
{
|
|
4987
|
-
type: "email",
|
|
4988
|
-
name: props.name,
|
|
4989
|
-
id: props.name,
|
|
4990
|
-
value,
|
|
4991
|
-
onChange: textChangeHandler,
|
|
4992
|
-
onBlur: props?.onBlur,
|
|
4993
|
-
autoFocus: props?.attributes?.autoFocus,
|
|
4994
|
-
required: props?.attributes?.required,
|
|
4995
|
-
placeholder: props?.attributes?.placeholder,
|
|
4996
|
-
maxLength: props?.attributes?.maxLength,
|
|
4997
|
-
pattern: props?.attributes?.pattern,
|
|
4998
|
-
disabled: props?.attributes?.readOnly,
|
|
4999
|
-
minLength: props?.attributes?.minLength,
|
|
5000
|
-
className: `peer input mt-1 py-1.5 block w-full rounded shadow-sm transition-all duration-500 ease-in-out
|
|
5001
|
-
${props?.inputClasses ? props.inputClasses : ``}
|
|
5002
|
-
`
|
|
5003
|
-
}
|
|
5004
|
-
),
|
|
5005
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ? props.attributes.errorMessage : "" })
|
|
5006
|
-
] }) });
|
|
5007
|
-
};
|
|
5008
|
-
EmailInput_default = EmailInput;
|
|
5009
|
-
}
|
|
5010
|
-
});
|
|
5011
|
-
|
|
5012
|
-
// src/components/controls/edit/TimeInput.tsx
|
|
5013
|
-
var import_react53, import_jsx_runtime79, TimeInput, TimeInput_default;
|
|
5014
|
-
var init_TimeInput = __esm({
|
|
5015
|
-
"src/components/controls/edit/TimeInput.tsx"() {
|
|
5016
|
-
"use strict";
|
|
5017
|
-
"use client";
|
|
5018
|
-
import_react53 = __toESM(require("react"));
|
|
5019
|
-
import_jsx_runtime79 = require("react/jsx-runtime");
|
|
5020
|
-
TimeInput = (props) => {
|
|
5021
|
-
const timeChangeHandler = (event) => {
|
|
5022
|
-
const timeValue = event.target.value;
|
|
5023
|
-
if (props.callback) {
|
|
5024
|
-
props.callback({
|
|
5025
|
-
name: props.name,
|
|
5026
|
-
value: timeValue,
|
|
5027
|
-
index: props.index,
|
|
5028
|
-
groupKey: props.groupKey
|
|
5029
|
-
});
|
|
5030
|
-
}
|
|
5031
|
-
};
|
|
5032
|
-
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_react53.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("label", { className: "block", children: [
|
|
5033
|
-
props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "text-sm inline-block pb-1 font-medium", children: props?.attributes?.label }),
|
|
5034
|
-
" ",
|
|
5035
|
-
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
5036
|
-
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
5037
|
-
"input",
|
|
5038
|
-
{
|
|
5039
|
-
type: "time",
|
|
5040
|
-
name: props.name,
|
|
5041
|
-
id: props.name,
|
|
5042
|
-
value: typeof props.value === "boolean" ? "" : props.value ?? "",
|
|
5043
|
-
onChange: timeChangeHandler,
|
|
5044
|
-
onBlur: props?.onBlur,
|
|
5045
|
-
autoFocus: props?.attributes?.autoFocus,
|
|
5046
|
-
required: props?.attributes?.required,
|
|
5047
|
-
disabled: props?.attributes?.readOnly,
|
|
5048
|
-
className: `peer input mt-1 py-1.5 block w-full rounded shadow-sm transition-all duration-500 ease-in-out
|
|
5049
|
-
${props?.inputClasses ? props.inputClasses : ``}
|
|
5050
|
-
`
|
|
5051
|
-
}
|
|
5052
|
-
) }),
|
|
5053
|
-
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props?.attributes?.errorMessage ?? "" })
|
|
5054
|
-
] }) });
|
|
5055
|
-
};
|
|
5056
|
-
TimeInput_default = TimeInput;
|
|
5057
|
-
}
|
|
5058
|
-
});
|
|
5059
|
-
|
|
5060
|
-
// src/components/controls/edit/AssetUpload.tsx
|
|
5061
|
-
var import_react54, import_jsx_runtime80, AssetUpload, AssetUpload_default;
|
|
5062
|
-
var init_AssetUpload = __esm({
|
|
5063
|
-
"src/components/controls/edit/AssetUpload.tsx"() {
|
|
5064
|
-
"use strict";
|
|
5065
|
-
"use client";
|
|
5066
|
-
import_react54 = __toESM(require("react"));
|
|
5067
|
-
init_ClientButton();
|
|
5068
|
-
init_StyleTypes();
|
|
5069
|
-
init_AssetUtility();
|
|
5070
|
-
init_Hyperlink();
|
|
5071
|
-
init_Icon();
|
|
5072
|
-
import_jsx_runtime80 = require("react/jsx-runtime");
|
|
5073
|
-
AssetUpload = (props) => {
|
|
5074
|
-
const isDisabled = props.attributes?.disable ?? false;
|
|
5075
|
-
let allValues = [];
|
|
5076
|
-
if (props.value !== void 0 && props.value !== null && props.value !== "") {
|
|
5077
|
-
try {
|
|
5078
|
-
allValues = JSON.parse(props.value.toString());
|
|
5079
|
-
} catch (error) {
|
|
5080
|
-
}
|
|
5081
|
-
}
|
|
5082
|
-
const getInitialTab = () => {
|
|
5083
|
-
if (allValues.length > 0) {
|
|
5084
|
-
const asset = allValues[0];
|
|
5085
|
-
if (asset.posterUrl) {
|
|
5086
|
-
return "video";
|
|
5087
|
-
} else if (asset.assetUrl) {
|
|
5088
|
-
return "image";
|
|
5089
|
-
}
|
|
5090
|
-
}
|
|
5091
|
-
return "image";
|
|
5092
|
-
};
|
|
5093
|
-
const [assetType, setAssetType] = import_react54.default.useState(getInitialTab);
|
|
5094
|
-
(0, import_react54.useEffect)(() => {
|
|
5095
|
-
setAssetType(getInitialTab());
|
|
5096
|
-
}, [props.value]);
|
|
5097
|
-
const assetUploadCallback = (newAsset) => {
|
|
5098
|
-
if (isDisabled) return;
|
|
5099
|
-
let updated = [];
|
|
5100
|
-
updated.push({
|
|
5101
|
-
assetUrl: newAsset.assetUrl,
|
|
5102
|
-
title: newAsset.title,
|
|
5103
|
-
posterUrl: newAsset.posterUrl,
|
|
5104
|
-
intrinsicHeight: newAsset.intrinsicHeight,
|
|
5105
|
-
intrinsicWidth: newAsset.intrinsicWidth
|
|
5106
|
-
});
|
|
5107
|
-
props.callback?.({
|
|
5108
|
-
name: props.name,
|
|
5109
|
-
value: JSON.stringify(updated),
|
|
5110
|
-
index: props.index,
|
|
5111
|
-
groupKey: props.groupKey
|
|
5112
|
-
});
|
|
5113
|
-
};
|
|
5114
|
-
const deleteFile = (index) => {
|
|
5115
|
-
if (isDisabled) return;
|
|
5116
|
-
let existingValue = [];
|
|
5117
|
-
if (props.value) {
|
|
5118
|
-
try {
|
|
5119
|
-
existingValue = JSON.parse(props.value.toString());
|
|
5120
|
-
} catch (error) {
|
|
5121
|
-
}
|
|
5122
|
-
}
|
|
5123
|
-
if (existingValue.length > index) {
|
|
5124
|
-
existingValue.splice(index, 1);
|
|
5125
|
-
props.callback?.({
|
|
5126
|
-
name: props.name,
|
|
5127
|
-
value: JSON.stringify(existingValue),
|
|
5128
|
-
index: props.index,
|
|
5129
|
-
groupKey: props.groupKey
|
|
5130
|
-
});
|
|
5131
|
-
}
|
|
5132
|
-
};
|
|
5133
|
-
const textChangeHandler = (index, event) => {
|
|
5134
|
-
if (isDisabled) return;
|
|
5135
|
-
let existingValue = [];
|
|
5136
|
-
if (props.value) {
|
|
5137
|
-
try {
|
|
5138
|
-
existingValue = JSON.parse(props.value.toString());
|
|
5139
|
-
} catch (error) {
|
|
5140
|
-
}
|
|
5141
|
-
}
|
|
5142
|
-
const text = event.target.value;
|
|
5143
|
-
if (existingValue.length > index) {
|
|
5144
|
-
const updatedArray = [...existingValue];
|
|
5145
|
-
updatedArray[index] = { ...updatedArray[index], title: text };
|
|
5146
|
-
props.callback?.({
|
|
5147
|
-
name: props.name,
|
|
5148
|
-
value: JSON.stringify(updatedArray),
|
|
5149
|
-
index: props.index,
|
|
5150
|
-
groupKey: props.groupKey
|
|
5151
|
-
});
|
|
5152
|
-
}
|
|
5153
|
-
};
|
|
5154
|
-
const getAssetType = (asset) => {
|
|
5155
|
-
if (asset.assetUrl?.endsWith(".m3u8") || asset.posterUrl) return "video";
|
|
5156
|
-
return "image";
|
|
5157
|
-
};
|
|
5158
|
-
const shouldShowDetails = () => {
|
|
5159
|
-
if (allValues.length === 0) return false;
|
|
5160
|
-
const asset = allValues[0];
|
|
5161
|
-
if (assetType === "video") {
|
|
5162
|
-
return Boolean(asset.posterUrl && asset.assetUrl && asset.assetUrl.endsWith(".m3u8"));
|
|
5163
|
-
}
|
|
5164
|
-
if (assetType === "image") {
|
|
5165
|
-
return Boolean(asset.assetUrl && !asset.assetUrl.endsWith(".m3u8"));
|
|
5166
|
-
}
|
|
5167
|
-
return false;
|
|
5168
|
-
};
|
|
5169
|
-
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_react54.default.Fragment, { children: [
|
|
5170
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("label", { className: "block mb-1", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "text-sm font-medium", children: props?.attributes?.label }) }),
|
|
5171
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex gap-6 bg-neutral-100 rounded p-2", children: [
|
|
5172
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
5173
|
-
ClientButton_default,
|
|
5174
|
-
{
|
|
5175
|
-
className: assetType === "image" ? "px-2 py-1 rounded bg-body-200 scale-95" : "text-neutral-700",
|
|
5176
|
-
ButtonType: "Link" /* Link */,
|
|
5177
|
-
onClick: () => setAssetType("image"),
|
|
5178
|
-
disabled: isDisabled,
|
|
5179
|
-
children: "Image Upload"
|
|
5180
|
-
}
|
|
5181
|
-
),
|
|
5182
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
5183
|
-
ClientButton_default,
|
|
5184
|
-
{
|
|
5185
|
-
className: assetType === "video" ? "bg-body-200 px-2 py-1 rounded-md scale-95" : "text-neutral-700",
|
|
5186
|
-
ButtonType: "Link" /* Link */,
|
|
5187
|
-
onClick: () => setAssetType("video"),
|
|
5188
|
-
disabled: isDisabled,
|
|
5189
|
-
children: "Video Upload"
|
|
5190
|
-
}
|
|
5191
|
-
)
|
|
5192
|
-
] }),
|
|
5193
|
-
shouldShowDetails() && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "relative mt-4 rounded-md p-4 border-2 border-dotted border-gray-300 bg-gray-50", children: [
|
|
5194
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "absolute -top-2.5 left-3 bg-primary-600 text-white text-xs px-2 py-0.5 rounded-full", children: getAssetType(allValues[0]) === "video" ? "Video" : "Image" }),
|
|
5195
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "flex flex-col gap-3", children: allValues.map((digitalAsset, index) => /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex justify-between items-start gap-5", children: [
|
|
5196
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "grid grid-cols-2 gap-x-8 gap-y-3 text-sm w-full", children: [
|
|
5197
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { children: [
|
|
5198
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("p", { className: "text-gray-500", children: "Title" }),
|
|
5199
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
5200
|
-
"input",
|
|
5201
|
-
{
|
|
5202
|
-
type: "text",
|
|
5203
|
-
value: digitalAsset.title,
|
|
5204
|
-
onChange: (event) => textChangeHandler(index, event),
|
|
5205
|
-
placeholder: "title",
|
|
5206
|
-
disabled: isDisabled,
|
|
5207
|
-
className: "w-full mt-1 py-1.5 block rounded border-gray-300 shadow-sm bg-white\n focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50\n disabled:bg-gray-100 disabled:text-gray-400 disabled:cursor-not-allowed"
|
|
5208
|
-
}
|
|
5209
|
-
)
|
|
5210
|
-
] }),
|
|
5211
|
-
digitalAsset.intrinsicWidth && digitalAsset.intrinsicHeight && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { children: [
|
|
5212
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("p", { className: "text-gray-500", children: "Resolution" }),
|
|
5213
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("p", { className: "font-medium text-gray-900 mt-3", children: [
|
|
5214
|
-
digitalAsset.intrinsicWidth,
|
|
5215
|
-
"\xD7",
|
|
5216
|
-
digitalAsset.intrinsicHeight
|
|
5217
|
-
] })
|
|
5218
|
-
] }),
|
|
5219
|
-
(digitalAsset.assetUrl || digitalAsset.posterUrl) && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { children: [
|
|
5220
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("p", { className: "text-gray-500", children: "Image / Poster" }),
|
|
5221
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex-shrink-0 flex flex-col gap-3 mt-1", children: [
|
|
5222
|
-
getAssetType(digitalAsset) === "video" && digitalAsset.posterUrl && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
5223
|
-
"img",
|
|
5224
|
-
{
|
|
5225
|
-
src: AssetUtility_default.resolveUrl(props.serviceClient?.baseUrl, digitalAsset.posterUrl),
|
|
5226
|
-
alt: digitalAsset.title || "Video poster",
|
|
5227
|
-
className: "w-32 h-auto object-cover rounded border p-1"
|
|
5228
|
-
}
|
|
5229
|
-
),
|
|
5230
|
-
getAssetType(digitalAsset) === "image" && digitalAsset.assetUrl && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
5231
|
-
"img",
|
|
5232
|
-
{
|
|
5233
|
-
src: AssetUtility_default.resolveUrl(props.serviceClient?.baseUrl, digitalAsset.assetUrl),
|
|
5234
|
-
alt: digitalAsset.title || "Uploaded image",
|
|
5235
|
-
className: "w-32 h-auto object-cover rounded border p-1"
|
|
5236
|
-
}
|
|
5237
|
-
)
|
|
5238
|
-
] })
|
|
5239
|
-
] }),
|
|
5240
|
-
digitalAsset.assetUrl?.endsWith(".m3u8") && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "col-span-2", children: [
|
|
5241
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("p", { className: "text-gray-500", children: "HLS Link" }),
|
|
5242
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
5243
|
-
Hyperlink,
|
|
5244
|
-
{
|
|
5245
|
-
href: digitalAsset.assetUrl,
|
|
5246
|
-
className: "text-primary-600 underline mt-1 break-all",
|
|
5247
|
-
title: digitalAsset.assetUrl,
|
|
5248
|
-
children: digitalAsset.assetUrl
|
|
5249
|
-
}
|
|
5250
|
-
)
|
|
5251
|
-
] })
|
|
5252
|
-
] }),
|
|
5253
|
-
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
5254
|
-
"span",
|
|
5255
|
-
{
|
|
5256
|
-
onClick: () => !isDisabled && deleteFile(index),
|
|
5257
|
-
className: isDisabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
5258
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Icon_default, { className: "w-4 h-4 text-primary", name: "delete" })
|
|
5259
|
-
}
|
|
5260
|
-
)
|
|
5261
|
-
] }, index)) })
|
|
5262
|
-
] })
|
|
5263
|
-
] });
|
|
5264
|
-
};
|
|
5265
|
-
AssetUpload_default = AssetUpload;
|
|
5266
|
-
}
|
|
5267
|
-
});
|
|
5268
|
-
|
|
5269
|
-
// src/components/controls/edit/SwitchInput.tsx
|
|
5270
|
-
var import_react55, import_jsx_runtime81, SwitchInput, SwitchInput_default;
|
|
5271
|
-
var init_SwitchInput = __esm({
|
|
5272
|
-
"src/components/controls/edit/SwitchInput.tsx"() {
|
|
5273
|
-
"use strict";
|
|
5274
|
-
import_react55 = __toESM(require("react"));
|
|
5275
|
-
import_jsx_runtime81 = require("react/jsx-runtime");
|
|
5276
|
-
SwitchInput = (props) => {
|
|
5277
|
-
const textChangeHandler = (event) => {
|
|
5278
|
-
let text = event.target.checked;
|
|
5279
|
-
if (props.callback !== void 0) {
|
|
5280
|
-
props.callback({
|
|
5281
|
-
name: props.name,
|
|
5282
|
-
value: text,
|
|
5283
|
-
index: props.index,
|
|
5284
|
-
groupKey: props.groupKey
|
|
5285
|
-
});
|
|
5286
|
-
}
|
|
5287
|
-
};
|
|
5288
|
-
let value = false;
|
|
5289
|
-
if (props.value != void 0 && props.value != null && props.value != "" && (props.value == "true" || props.value.toString() == "true")) {
|
|
5290
|
-
value = true;
|
|
5291
|
-
}
|
|
5292
|
-
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react55.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "relative flex items-start justify-between gap-4 py-3", children: [
|
|
5293
|
-
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "min-w-0", children: props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
5294
|
-
"label",
|
|
5295
|
-
{
|
|
5296
|
-
htmlFor: props.name,
|
|
5297
|
-
className: "inline-block text-sm font-semibold text-slate-800",
|
|
5298
|
-
children: [
|
|
5299
|
-
props.attributes.label,
|
|
5300
|
-
props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "bg-error-weak", children: "*" })
|
|
5301
|
-
]
|
|
5302
|
-
}
|
|
5303
|
-
) }),
|
|
5304
|
-
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
5305
|
-
"label",
|
|
5306
|
-
{
|
|
5307
|
-
htmlFor: props.name,
|
|
5308
|
-
className: "relative inline-flex shrink-0 cursor-pointer items-center peer-disabled:cursor-not-allowed",
|
|
5309
|
-
children: [
|
|
5310
|
-
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
5311
|
-
"input",
|
|
5312
|
-
{
|
|
5313
|
-
type: "checkbox",
|
|
5314
|
-
name: props.name,
|
|
5315
|
-
id: props.name,
|
|
5316
|
-
checked: value,
|
|
5317
|
-
onChange: textChangeHandler,
|
|
5318
|
-
required: props?.attributes?.required,
|
|
5319
|
-
disabled: props?.attributes?.readOnly,
|
|
5320
|
-
className: "peer sr-only"
|
|
5321
|
-
}
|
|
5322
|
-
),
|
|
5323
|
-
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
5324
|
-
"div",
|
|
5325
|
-
{
|
|
5326
|
-
className: "h-6 w-11 rounded-full bg-slate-200 shadow-inner\n transition-colors duration-200 ease-in-out\n peer-checked:bg-blue-600\n peer-focus-visible:ring-2 peer-focus-visible:ring-blue-300 peer-focus-visible:ring-offset-2\n peer-disabled:bg-slate-100"
|
|
5327
|
-
}
|
|
5328
|
-
),
|
|
5329
|
-
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
5330
|
-
"div",
|
|
5331
|
-
{
|
|
5332
|
-
className: "absolute left-0.5 top-0.5 h-5 w-5 rounded-full bg-default shadow\n transition-transform duration-200 ease-in-out\n peer-checked:translate-x-5\n peer-disabled:bg-slate-50"
|
|
5333
|
-
}
|
|
5334
|
-
),
|
|
5335
|
-
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block absolute left-0 top-full mt-1 w-max max-w-[220px] whitespace-normal bg-error-weak text-sm", children: props?.attributes?.errorMessage || "" })
|
|
5336
|
-
]
|
|
5337
|
-
}
|
|
5338
|
-
)
|
|
5339
|
-
] }) });
|
|
5340
|
-
};
|
|
5341
|
-
SwitchInput_default = SwitchInput;
|
|
5342
|
-
}
|
|
5343
|
-
});
|
|
5344
|
-
|
|
5345
|
-
// src/components/utilities/DateTimeUtility.tsx
|
|
5346
|
-
var DateTimeUtility, DateTimeUtility_default;
|
|
5347
|
-
var init_DateTimeUtility = __esm({
|
|
5348
|
-
"src/components/utilities/DateTimeUtility.tsx"() {
|
|
5349
|
-
"use strict";
|
|
5350
|
-
DateTimeUtility = class {
|
|
5351
|
-
constructor() {
|
|
5352
|
-
}
|
|
5353
|
-
static formatDate(date) {
|
|
5354
|
-
if (!date) {
|
|
5355
|
-
throw new Error("Invalid date");
|
|
5356
|
-
}
|
|
5357
|
-
const pad = (num) => num.toString().padStart(2, "0");
|
|
5358
|
-
const year = date.getFullYear();
|
|
5359
|
-
const month = pad(date.getMonth() + 1);
|
|
5360
|
-
const day = pad(date.getDate());
|
|
5361
|
-
const hours = pad(date.getHours());
|
|
5362
|
-
const minutes = pad(date.getMinutes());
|
|
5363
|
-
const seconds = pad(date.getSeconds());
|
|
5364
|
-
return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}`;
|
|
5365
|
-
}
|
|
5366
|
-
static getMonthShortNameCustom(month) {
|
|
5367
|
-
const monthNames = [
|
|
5368
|
-
"Jan",
|
|
5369
|
-
"Feb",
|
|
5370
|
-
"Mar",
|
|
5371
|
-
"Apr",
|
|
5372
|
-
"May",
|
|
5373
|
-
"Jun",
|
|
5374
|
-
"Jul",
|
|
5375
|
-
"Aug",
|
|
5376
|
-
"Sep",
|
|
5377
|
-
"Oct",
|
|
5378
|
-
"Nov",
|
|
5379
|
-
"Dec"
|
|
5380
|
-
];
|
|
5381
|
-
if (month < 1 || month > 12) {
|
|
5382
|
-
throw new Error(
|
|
5383
|
-
"Invalid month. Please provide a value between 1 and 12."
|
|
5384
|
-
);
|
|
5385
|
-
}
|
|
5386
|
-
return monthNames[month - 1];
|
|
5387
|
-
}
|
|
5388
|
-
static getCurrentWeekRange() {
|
|
5389
|
-
const today = /* @__PURE__ */ new Date();
|
|
5390
|
-
const day = today.getDay();
|
|
5391
|
-
const diffToMonday = (day === 0 ? -6 : 1) - day;
|
|
5392
|
-
const monday = new Date(today);
|
|
5393
|
-
monday.setDate(today.getDate() + diffToMonday);
|
|
5394
|
-
monday.setHours(0, 0, 0, 0);
|
|
5395
|
-
const sunday = new Date(monday);
|
|
5396
|
-
sunday.setDate(monday.getDate() + 6);
|
|
5397
|
-
sunday.setHours(23, 59, 59, 999);
|
|
5398
|
-
return { start: monday, end: sunday };
|
|
5399
|
-
}
|
|
5400
|
-
static getCurrentMonthRange() {
|
|
5401
|
-
const now = /* @__PURE__ */ new Date();
|
|
5402
|
-
const start = new Date(now.getFullYear(), now.getMonth(), 1);
|
|
5403
|
-
const end = new Date(now.getFullYear(), now.getMonth() + 1, 0);
|
|
5404
|
-
return { start, end };
|
|
5405
|
-
}
|
|
5406
|
-
static formatShortDate(date) {
|
|
5407
|
-
const day = date.getDate();
|
|
5408
|
-
const month = this.getMonthShortNameCustom(date.getMonth() + 1);
|
|
5409
|
-
return `${day} ${month}`;
|
|
5410
|
-
}
|
|
5411
|
-
static formatIndianCurrencyShort(value) {
|
|
5412
|
-
if (value >= 1e7) {
|
|
5413
|
-
return `${(value / 1e7).toFixed(2)} Cr`;
|
|
5414
|
-
} else if (value >= 1e5) {
|
|
5415
|
-
return `${(value / 1e5).toFixed(2)} L`;
|
|
5416
|
-
} else if (value >= 1e3) {
|
|
5417
|
-
return `${(value / 1e3).toFixed(2)} K`;
|
|
5418
|
-
} else {
|
|
5419
|
-
return `${value}`;
|
|
5420
|
-
}
|
|
5421
|
-
}
|
|
5422
|
-
};
|
|
5423
|
-
DateTimeUtility_default = DateTimeUtility;
|
|
5424
|
-
}
|
|
5425
|
-
});
|
|
5426
|
-
|
|
5427
|
-
// src/components/controls/edit/DateInput.tsx
|
|
5428
|
-
var import_react56, import_jsx_runtime82, DateInput, DateInput_default;
|
|
5429
|
-
var init_DateInput = __esm({
|
|
5430
|
-
"src/components/controls/edit/DateInput.tsx"() {
|
|
5431
|
-
"use strict";
|
|
5432
|
-
import_react56 = require("react");
|
|
5433
|
-
init_DateTimeUtility();
|
|
5434
|
-
import_jsx_runtime82 = require("react/jsx-runtime");
|
|
5435
|
-
DateInput = (props) => {
|
|
5436
|
-
const value = (0, import_react56.useMemo)(() => {
|
|
5437
|
-
if (props.value === void 0 || props.value === null || props.value === "") {
|
|
5438
|
-
return "";
|
|
5439
|
-
}
|
|
5440
|
-
try {
|
|
5441
|
-
const rawValue = String(props.value);
|
|
5442
|
-
const utcDate = new Date(rawValue.endsWith("Z") ? rawValue : `${rawValue}Z`);
|
|
5443
|
-
const localDate = new Date(
|
|
5444
|
-
utcDate.getTime() - utcDate.getTimezoneOffset() * 6e4
|
|
5445
|
-
);
|
|
5446
|
-
return localDate.toISOString().slice(0, 10);
|
|
5447
|
-
} catch {
|
|
5448
|
-
return String(props.value);
|
|
5449
|
-
}
|
|
5450
|
-
}, [props.value]);
|
|
5451
|
-
const changeHandler = (event) => {
|
|
5452
|
-
const dateValue = event.target.value;
|
|
5453
|
-
let callbackValue = dateValue;
|
|
5454
|
-
const parsedDate = new Date(dateValue);
|
|
5455
|
-
if (dateValue && !Number.isNaN(parsedDate.getTime())) {
|
|
5456
|
-
const adjustedDate = new Date(
|
|
5457
|
-
parsedDate.getTime() + 2 * parsedDate.getTimezoneOffset() * 6e4
|
|
5458
|
-
);
|
|
5459
|
-
callbackValue = DateTimeUtility_default.formatDate(adjustedDate);
|
|
5460
|
-
}
|
|
5461
|
-
props.callback?.({
|
|
5462
|
-
name: props.name,
|
|
5463
|
-
value: callbackValue,
|
|
5464
|
-
index: props.index,
|
|
5465
|
-
groupKey: props.groupKey
|
|
5466
|
-
});
|
|
5467
|
-
};
|
|
5468
|
-
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("label", { className: "block mb-1", children: [
|
|
5469
|
-
props.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "text-sm font-medium", children: props.attributes.label }),
|
|
5470
|
-
" ",
|
|
5471
|
-
props.attributes?.label && props.attributes.required && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "bg-error-weak", children: "*" }),
|
|
5472
|
-
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
5473
|
-
"input",
|
|
5474
|
-
{
|
|
5475
|
-
type: "date",
|
|
5476
|
-
name: props.name,
|
|
5477
|
-
id: props.name,
|
|
5478
|
-
value,
|
|
5479
|
-
onChange: changeHandler,
|
|
5480
|
-
required: props.attributes?.required,
|
|
5481
|
-
disabled: props.attributes?.readOnly,
|
|
5482
|
-
max: String(props.attributes?.maxValue ?? "9999-12-31"),
|
|
5483
|
-
className: `peer input mt-1 py-1.5 block w-full rounded shadow-sm ${props.inputClasses ?? ""}`
|
|
5484
|
-
}
|
|
5485
|
-
),
|
|
5486
|
-
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props.attributes?.errorMessage ?? "" })
|
|
5487
|
-
] });
|
|
5488
|
-
};
|
|
5489
|
-
DateInput_default = DateInput;
|
|
5490
|
-
}
|
|
5491
|
-
});
|
|
5492
|
-
|
|
5493
|
-
// src/components/controls/edit/RadioInput.tsx
|
|
5494
|
-
var import_react57, import_jsx_runtime83, RadioInput, RadioInput_default;
|
|
5495
|
-
var init_RadioInput = __esm({
|
|
5496
|
-
"src/components/controls/edit/RadioInput.tsx"() {
|
|
5497
|
-
"use strict";
|
|
5498
|
-
import_react57 = require("react");
|
|
5499
|
-
init_Icon();
|
|
5500
|
-
import_jsx_runtime83 = require("react/jsx-runtime");
|
|
5501
|
-
RadioInput = (props) => {
|
|
5502
|
-
const [list, setList] = (0, import_react57.useState)([]);
|
|
5503
|
-
(0, import_react57.useEffect)(() => {
|
|
5504
|
-
async function loadData() {
|
|
5505
|
-
if (props.dataset) {
|
|
5506
|
-
setList(props.dataset);
|
|
5507
|
-
return;
|
|
5508
|
-
}
|
|
5509
|
-
if (!props.dataSource || !props.serviceClient) {
|
|
5510
|
-
setList([]);
|
|
5511
|
-
return;
|
|
5512
|
-
}
|
|
5513
|
-
let dataSource = props.dataSource;
|
|
5514
|
-
if (props.dataSourceDependsOn) {
|
|
5515
|
-
if (!props.dependentValue) {
|
|
5516
|
-
setList([]);
|
|
5517
|
-
return;
|
|
5518
|
-
}
|
|
5519
|
-
dataSource = dataSource.replace(
|
|
5520
|
-
`{${props.dataSourceDependsOn}}`,
|
|
5521
|
-
props.dependentValue
|
|
5522
|
-
);
|
|
5523
|
-
}
|
|
5524
|
-
const response = await props.serviceClient.get(dataSource);
|
|
5525
|
-
setList(response.result ?? []);
|
|
5526
|
-
}
|
|
5527
|
-
loadData();
|
|
5528
|
-
}, [
|
|
5529
|
-
props.dataSource,
|
|
5530
|
-
props.dataSourceDependsOn,
|
|
5531
|
-
props.dataset,
|
|
5532
|
-
props.dependentValue,
|
|
5533
|
-
props.serviceClient
|
|
5534
|
-
]);
|
|
5535
|
-
const changeHandler = (event) => {
|
|
5536
|
-
if (!props.attributes?.readOnly) {
|
|
5537
|
-
props.callback?.({
|
|
5538
|
-
name: props.name,
|
|
5539
|
-
value: event.target.value,
|
|
5540
|
-
index: props.index,
|
|
5541
|
-
groupKey: props.groupKey
|
|
5542
|
-
});
|
|
5543
|
-
}
|
|
5544
|
-
};
|
|
5545
|
-
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "block", children: [
|
|
5546
|
-
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "text-sm font-medium", children: props.attributes?.label }),
|
|
5547
|
-
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: "flex flex-col gap-3", children: list.map((item, index) => {
|
|
5548
|
-
const itemValue = item[props.dataKeyFieldName];
|
|
5549
|
-
const isSelected = String(itemValue) === String(props.value ?? "");
|
|
5550
|
-
const isRecommended = props.dataRecommendedValue !== void 0 && String(itemValue) === String(props.dataRecommendedValue);
|
|
5551
|
-
const resultClassName = isSelected ? isRecommended ? "bg-success" : props.dataRecommendedValue ? "bg-alert" : "border-transparent" : "border-transparent";
|
|
5552
|
-
const iconName = isSelected && props.dataRecommendedValue ? isRecommended ? "checkCircle" : "xCircle" : void 0;
|
|
5553
|
-
const inputId = `${props.name}-${props.index ?? 0}-id-${index}`;
|
|
5554
|
-
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
|
|
5555
|
-
"div",
|
|
5556
|
-
{
|
|
5557
|
-
className: `font-normal flex items-center justify-between gap-4 cursor-pointer border rounded p-2 ${resultClassName}`,
|
|
5558
|
-
children: [
|
|
5559
|
-
/* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "flex gap-4 items-start", children: [
|
|
5560
|
-
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
5561
|
-
"input",
|
|
5562
|
-
{
|
|
5563
|
-
type: "radio",
|
|
5564
|
-
className: "form-radio mt-1.5 focus:outline-none",
|
|
5565
|
-
name: `${props.name}-${props.index ?? 0}`,
|
|
5566
|
-
id: inputId,
|
|
5567
|
-
value: itemValue,
|
|
5568
|
-
checked: isSelected,
|
|
5569
|
-
readOnly: props.attributes?.readOnly,
|
|
5570
|
-
onChange: changeHandler,
|
|
5571
|
-
required: props.attributes?.required
|
|
5572
|
-
}
|
|
5573
|
-
),
|
|
5574
|
-
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("label", { className: "text-body-950 pr-2", htmlFor: inputId, children: item[props.dataTextFieldName] })
|
|
5575
|
-
] }),
|
|
5576
|
-
iconName && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Icon_default, { className: "w-5 h-5 text-success", name: iconName })
|
|
5577
|
-
]
|
|
5578
|
-
},
|
|
5579
|
-
String(itemValue)
|
|
5580
|
-
);
|
|
5581
|
-
}) }),
|
|
5582
|
-
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("p", { className: "hidden group-[.validated]:peer-invalid:block mt-1 bg-error-weak text-sm", children: props.attributes?.errorMessage ?? "" })
|
|
5583
|
-
] });
|
|
5584
|
-
};
|
|
5585
|
-
RadioInput_default = RadioInput;
|
|
5586
|
-
}
|
|
5587
|
-
});
|
|
5588
|
-
|
|
5589
|
-
// src/components/controls/edit/ReferenceInput.tsx
|
|
5590
|
-
var import_jsx_runtime84, ReferenceInput, ReferenceInput_default;
|
|
5591
|
-
var init_ReferenceInput = __esm({
|
|
5592
|
-
"src/components/controls/edit/ReferenceInput.tsx"() {
|
|
5593
|
-
"use strict";
|
|
5594
|
-
init_SelectWithSearchInput();
|
|
5595
|
-
import_jsx_runtime84 = require("react/jsx-runtime");
|
|
5596
|
-
ReferenceInput = (props) => {
|
|
5597
|
-
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(SelectWithSearchInput_default, { ...props });
|
|
5598
|
-
};
|
|
5599
|
-
ReferenceInput_default = ReferenceInput;
|
|
5600
|
-
}
|
|
5601
|
-
});
|
|
5602
|
-
|
|
5603
|
-
// src/components/controls/edit/InputControlClient.tsx
|
|
5604
|
-
var InputControlClient_exports = {};
|
|
5605
|
-
__export(InputControlClient_exports, {
|
|
5606
|
-
default: () => InputControlClient_default
|
|
5607
|
-
});
|
|
5608
|
-
var import_react58, import_jsx_runtime85, InputControl, InputControlClient_default;
|
|
5609
|
-
var init_InputControlClient = __esm({
|
|
5610
|
-
"src/components/controls/edit/InputControlClient.tsx"() {
|
|
5611
|
-
"use strict";
|
|
5612
|
-
"use client";
|
|
5613
|
-
import_react58 = __toESM(require("react"));
|
|
5614
|
-
init_MultilineTextInput();
|
|
5615
|
-
init_LineTextInput();
|
|
5616
|
-
init_MoneyInput();
|
|
5617
|
-
init_InputControlType();
|
|
5618
|
-
init_Select();
|
|
5619
|
-
init_PercentageInput();
|
|
5620
|
-
init_PhoneInput();
|
|
5621
|
-
init_NumberInput();
|
|
5622
|
-
init_CheckboxInput();
|
|
5623
|
-
init_OtpInput();
|
|
5624
|
-
init_DateTimeInput();
|
|
5625
|
-
init_ColorInput();
|
|
5626
|
-
init_SelectWithSearchInput();
|
|
5627
|
-
init_SelectWithSearchPanel();
|
|
5628
|
-
init_EmailInput();
|
|
5629
|
-
init_TimeInput();
|
|
5630
|
-
init_AssetUpload();
|
|
5631
|
-
init_SwitchInput();
|
|
5632
|
-
init_DateInput();
|
|
5633
|
-
init_RadioInput();
|
|
5634
|
-
init_ReferenceInput();
|
|
5635
|
-
import_jsx_runtime85 = require("react/jsx-runtime");
|
|
5636
|
-
InputControl = import_react58.default.forwardRef(
|
|
5637
|
-
(props, ref) => {
|
|
5638
|
-
const ControlComponents = {
|
|
5639
|
-
[InputControlType_default.lineTextInput]: LineTextInput_default,
|
|
5640
|
-
[InputControlType_default.emailInput]: EmailInput_default,
|
|
5641
|
-
[InputControlType_default.multilineTextInput]: MultilineTextInput_default,
|
|
5642
|
-
[InputControlType_default.moneyInput]: MoneyInput_default,
|
|
5643
|
-
[InputControlType_default.select]: Select_default,
|
|
5644
|
-
[InputControlType_default.percentageInput]: PercentageInput_default,
|
|
5645
|
-
[InputControlType_default.phoneInput]: PhoneInput_default,
|
|
5646
|
-
[InputControlType_default.numberInput]: NumberInput_default,
|
|
5647
|
-
[InputControlType_default.checkboxInput]: CheckboxInput_default,
|
|
5648
|
-
[InputControlType_default.otpInput]: OtpInput_default,
|
|
5649
|
-
[InputControlType_default.datetimeInput]: DateTimeInput_default,
|
|
5650
|
-
[InputControlType_default.colorInput]: ColorInput_default,
|
|
5651
|
-
[InputControlType_default.selectWithSearchInput]: SelectWithSearchInput_default,
|
|
5652
|
-
[InputControlType_default.selectWithSearchPanel]: SelectWithSearchPanel_default,
|
|
5653
|
-
[InputControlType_default.timeInput]: TimeInput_default,
|
|
5654
|
-
[InputControlType_default.assetUpload]: AssetUpload_default,
|
|
5655
|
-
[InputControlType_default.switchInput]: SwitchInput_default,
|
|
5656
|
-
[InputControlType_default.dateInput]: DateInput_default,
|
|
5657
|
-
[InputControlType_default.radioInput]: RadioInput_default,
|
|
5658
|
-
[InputControlType_default.referenceInput]: ReferenceInput_default
|
|
5659
|
-
};
|
|
5660
|
-
const SelectedControlComponent = ControlComponents[props.controlType];
|
|
5661
|
-
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react58.default.Fragment, { children: SelectedControlComponent ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(SelectedControlComponent, { ...props }) : "Control not found:" + props.controlType });
|
|
5662
|
-
}
|
|
5663
|
-
);
|
|
5664
|
-
InputControl.displayName = "InputControl";
|
|
5665
|
-
InputControlClient_default = InputControl;
|
|
5666
|
-
}
|
|
5667
|
-
});
|
|
5668
|
-
|
|
5669
|
-
// src/components/controls/edit/InputControl.tsx
|
|
5670
|
-
var import_dynamic13, InputControl2, InputControl_default;
|
|
5671
|
-
var init_InputControl = __esm({
|
|
5672
|
-
"src/components/controls/edit/InputControl.tsx"() {
|
|
5673
|
-
"use strict";
|
|
5674
|
-
import_dynamic13 = __toESM(require("next/dynamic"));
|
|
5675
|
-
InputControl2 = (0, import_dynamic13.default)(() => Promise.resolve().then(() => (init_InputControlClient(), InputControlClient_exports)), {
|
|
5676
|
-
ssr: false
|
|
5677
|
-
});
|
|
5678
|
-
InputControl_default = InputControl2;
|
|
5679
|
-
}
|
|
5680
|
-
});
|
|
5681
|
-
|
|
5682
|
-
// src/components/pageRenderingEngine/nodes/DataBindingControls.tsx
|
|
5683
|
-
var DataBindingControls_exports = {};
|
|
5684
|
-
__export(DataBindingControls_exports, {
|
|
5685
|
-
default: () => DataBindingControls_default
|
|
5686
|
-
});
|
|
5687
|
-
var import_react59, import_navigation, import_jsx_runtime86, humanize, escapeODataString, parseFacetSelections, buildFacetFilter, parseODataSearch, SearchIcon, ResetIcon, FilterSlidersIcon, ChevronDownIcon, CheckIcon, CloseIcon, normalizeSortOption, DataBindingControls, DataBindingControls_default;
|
|
5688
|
-
var init_DataBindingControls = __esm({
|
|
5689
|
-
"src/components/pageRenderingEngine/nodes/DataBindingControls.tsx"() {
|
|
5690
|
-
"use strict";
|
|
5691
|
-
"use client";
|
|
5692
|
-
import_react59 = require("react");
|
|
5693
|
-
import_navigation = require("next/navigation");
|
|
5694
|
-
init_Button();
|
|
5695
|
-
init_InputControl();
|
|
5696
|
-
init_InputControlType();
|
|
5697
|
-
init_StyleTypes();
|
|
5698
|
-
import_jsx_runtime86 = require("react/jsx-runtime");
|
|
5699
|
-
humanize = (value) => value.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").trim();
|
|
5700
|
-
escapeODataString = (value) => value.replace(/'/g, "''");
|
|
5701
|
-
parseFacetSelections = (filter) => {
|
|
5702
|
-
const selections = /* @__PURE__ */ new Map();
|
|
5703
|
-
if (!filter || !filter.trim()) return selections;
|
|
5704
|
-
const expression = /(?:^|[\s()]+(?:and[\s()]+)?)([\w./-]+)\s+eq\s+'((?:''|[^'])*)'/gi;
|
|
5705
|
-
for (const match of filter.matchAll(expression)) {
|
|
5706
|
-
if (match[1] && match[2] !== void 0) {
|
|
5707
|
-
selections.set(match[1].trim(), match[2].replace(/''/g, "'"));
|
|
5708
|
-
}
|
|
5709
|
-
}
|
|
5710
|
-
return selections;
|
|
5711
|
-
};
|
|
5712
|
-
buildFacetFilter = (selections) => Array.from(selections.entries()).map(([field, value]) => `${field} eq '${escapeODataString(value)}'`).join(" and ");
|
|
5713
|
-
parseODataSearch = (value) => {
|
|
5714
|
-
if (!value) return "";
|
|
5715
|
-
const trimmedValue = value.trim();
|
|
5716
|
-
if (trimmedValue.startsWith("'") && trimmedValue.endsWith("'")) {
|
|
5717
|
-
return trimmedValue.slice(1, -1).replace(/''/g, "'");
|
|
5718
|
-
}
|
|
5719
|
-
return trimmedValue;
|
|
5720
|
-
};
|
|
5721
|
-
SearchIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
|
|
5722
|
-
"svg",
|
|
5723
|
-
{
|
|
5724
|
-
"aria-hidden": "true",
|
|
5725
|
-
className,
|
|
5726
|
-
fill: "none",
|
|
5727
|
-
viewBox: "0 0 24 24",
|
|
5728
|
-
stroke: "currentColor",
|
|
5729
|
-
strokeWidth: "2",
|
|
5730
|
-
children: [
|
|
5731
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("circle", { cx: "11", cy: "11", r: "7" }),
|
|
5732
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("path", { strokeLinecap: "round", d: "m20 20-4-4" })
|
|
5733
|
-
]
|
|
5734
|
-
}
|
|
5735
|
-
);
|
|
5736
|
-
ResetIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
|
|
5737
|
-
"svg",
|
|
5738
|
-
{
|
|
5739
|
-
"aria-hidden": "true",
|
|
5740
|
-
className,
|
|
5741
|
-
fill: "none",
|
|
5742
|
-
viewBox: "0 0 24 24",
|
|
5743
|
-
stroke: "currentColor",
|
|
5744
|
-
strokeWidth: "2",
|
|
5745
|
-
children: [
|
|
5746
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 4v6h6" }),
|
|
5747
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
5748
|
-
"path",
|
|
5749
|
-
{
|
|
5750
|
-
strokeLinecap: "round",
|
|
5751
|
-
strokeLinejoin: "round",
|
|
5752
|
-
d: "M5.5 15a8 8 0 1 0 .6-7.8L4 10"
|
|
5753
|
-
}
|
|
5754
|
-
)
|
|
5755
|
-
]
|
|
5756
|
-
}
|
|
5757
|
-
);
|
|
5758
|
-
FilterSlidersIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
|
|
5759
|
-
"svg",
|
|
5760
|
-
{
|
|
5761
|
-
"aria-hidden": "true",
|
|
5762
|
-
className,
|
|
5763
|
-
fill: "none",
|
|
5764
|
-
viewBox: "0 0 24 24",
|
|
5765
|
-
stroke: "currentColor",
|
|
5766
|
-
strokeWidth: "2",
|
|
5767
|
-
children: [
|
|
5768
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 4h18M3 12h18M3 20h18" }),
|
|
5769
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("circle", { cx: "8", cy: "4", r: "2", fill: "currentColor" }),
|
|
5770
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("circle", { cx: "16", cy: "12", r: "2", fill: "currentColor" }),
|
|
5771
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("circle", { cx: "10", cy: "20", r: "2", fill: "currentColor" })
|
|
5772
|
-
]
|
|
5773
|
-
}
|
|
5774
|
-
);
|
|
5775
|
-
ChevronDownIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
5776
|
-
"svg",
|
|
5777
|
-
{
|
|
5778
|
-
"aria-hidden": "true",
|
|
5779
|
-
className,
|
|
5780
|
-
fill: "none",
|
|
5781
|
-
viewBox: "0 0 24 24",
|
|
5782
|
-
stroke: "currentColor",
|
|
5783
|
-
strokeWidth: "2",
|
|
5784
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m19 9-7 7-7-7" })
|
|
5785
|
-
}
|
|
5786
|
-
);
|
|
5787
|
-
CheckIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
5788
|
-
"svg",
|
|
5789
|
-
{
|
|
5790
|
-
"aria-hidden": "true",
|
|
5791
|
-
className,
|
|
5792
|
-
fill: "none",
|
|
5793
|
-
viewBox: "0 0 24 24",
|
|
5794
|
-
stroke: "currentColor",
|
|
5795
|
-
strokeWidth: "2.5",
|
|
5796
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" })
|
|
5797
|
-
}
|
|
5798
|
-
);
|
|
5799
|
-
CloseIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
5800
|
-
"svg",
|
|
5801
|
-
{
|
|
5802
|
-
"aria-hidden": "true",
|
|
5803
|
-
className,
|
|
5804
|
-
fill: "none",
|
|
5805
|
-
viewBox: "0 0 24 24",
|
|
5806
|
-
stroke: "currentColor",
|
|
5807
|
-
strokeWidth: "2",
|
|
5808
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
5809
|
-
}
|
|
5810
|
-
);
|
|
5811
3894
|
normalizeSortOption = (option) => {
|
|
5812
3895
|
const direction = option.direction.trim();
|
|
3896
|
+
const title = option.title || humanize(option.name);
|
|
5813
3897
|
return {
|
|
5814
|
-
label:
|
|
3898
|
+
label: title,
|
|
5815
3899
|
value: [option.name, direction].filter(Boolean).join(" ")
|
|
5816
3900
|
};
|
|
5817
3901
|
};
|
|
@@ -5827,7 +3911,24 @@ var init_DataBindingControls = __esm({
|
|
|
5827
3911
|
}) => {
|
|
5828
3912
|
const router = (0, import_navigation.useRouter)();
|
|
5829
3913
|
const searchParams = (0, import_navigation.useSearchParams)();
|
|
5830
|
-
const [collapsedCategories, setCollapsedCategories] = (0,
|
|
3914
|
+
const [collapsedCategories, setCollapsedCategories] = (0, import_react39.useState)({});
|
|
3915
|
+
const [isSortOpen, setIsSortOpen] = (0, import_react39.useState)(false);
|
|
3916
|
+
const [isMobileFiltersOpen, setIsMobileFiltersOpen] = (0, import_react39.useState)(false);
|
|
3917
|
+
const [facetCategorySearch, setFacetCategorySearch] = (0, import_react39.useState)({});
|
|
3918
|
+
const desktopSortDropdownRef = (0, import_react39.useRef)(null);
|
|
3919
|
+
const mobileSortDropdownRef = (0, import_react39.useRef)(null);
|
|
3920
|
+
(0, import_react39.useEffect)(() => {
|
|
3921
|
+
const handleClickOutside = (event) => {
|
|
3922
|
+
const target = event.target;
|
|
3923
|
+
const clickedInsideDesktop = desktopSortDropdownRef.current?.contains(target);
|
|
3924
|
+
const clickedInsideMobile = mobileSortDropdownRef.current?.contains(target);
|
|
3925
|
+
if (!clickedInsideDesktop && !clickedInsideMobile) {
|
|
3926
|
+
setIsSortOpen(false);
|
|
3927
|
+
}
|
|
3928
|
+
};
|
|
3929
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
3930
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
3931
|
+
}, []);
|
|
5831
3932
|
const toggleCategory = (field) => {
|
|
5832
3933
|
setCollapsedCategories((prev) => ({
|
|
5833
3934
|
...prev,
|
|
@@ -5842,27 +3943,63 @@ var init_DataBindingControls = __esm({
|
|
|
5842
3943
|
const currentSearch = parseODataSearch(
|
|
5843
3944
|
searchParamsSearch !== void 0 && searchParamsSearch !== null ? searchParamsSearch : query?.["$search"]
|
|
5844
3945
|
);
|
|
5845
|
-
const [searchText, setSearchText] = (0,
|
|
5846
|
-
(0,
|
|
3946
|
+
const [searchText, setSearchText] = (0, import_react39.useState)(currentSearch);
|
|
3947
|
+
(0, import_react39.useEffect)(() => {
|
|
5847
3948
|
setSearchText(currentSearch);
|
|
5848
3949
|
}, [currentSearch]);
|
|
5849
|
-
const selectedFacetValues = (0,
|
|
3950
|
+
const selectedFacetValues = (0, import_react39.useMemo)(
|
|
5850
3951
|
() => parseFacetSelections(currentFilter),
|
|
5851
3952
|
[currentFilter]
|
|
5852
3953
|
);
|
|
5853
|
-
|
|
5854
|
-
if (
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
3954
|
+
(0, import_react39.useEffect)(() => {
|
|
3955
|
+
if (isMobileFiltersOpen) {
|
|
3956
|
+
document.body.style.overflow = "hidden";
|
|
3957
|
+
} else {
|
|
3958
|
+
document.body.style.overflow = "";
|
|
3959
|
+
}
|
|
3960
|
+
return () => {
|
|
3961
|
+
document.body.style.overflow = "";
|
|
3962
|
+
};
|
|
3963
|
+
}, [isMobileFiltersOpen]);
|
|
3964
|
+
const activeFacets = (0, import_react39.useMemo)(() => {
|
|
3965
|
+
const facetMap = /* @__PURE__ */ new Map();
|
|
3966
|
+
if (facets) {
|
|
3967
|
+
Object.entries(facets).forEach(([field, values]) => {
|
|
3968
|
+
if (!Array.isArray(values)) return;
|
|
3969
|
+
const filteredValues = values.filter(
|
|
3970
|
+
(item) => item.count > 0 || selectedFacetValues.get(field) === item.value
|
|
3971
|
+
);
|
|
3972
|
+
if (filteredValues.length > 0) {
|
|
3973
|
+
facetMap.set(field, filteredValues);
|
|
3974
|
+
}
|
|
3975
|
+
});
|
|
3976
|
+
}
|
|
3977
|
+
selectedFacetValues.forEach((val, field) => {
|
|
3978
|
+
if (!facetMap.has(field)) {
|
|
3979
|
+
facetMap.set(field, [{ value: val, count: 0 }]);
|
|
3980
|
+
} else {
|
|
3981
|
+
const existing = facetMap.get(field);
|
|
3982
|
+
if (!existing.some((item) => item.value === val)) {
|
|
3983
|
+
existing.push({ value: val, count: 0 });
|
|
3984
|
+
}
|
|
3985
|
+
}
|
|
3986
|
+
});
|
|
3987
|
+
return Array.from(facetMap.entries());
|
|
5863
3988
|
}, [facets, selectedFacetValues]);
|
|
5864
|
-
const normalizedSortOptions = (
|
|
5865
|
-
|
|
3989
|
+
const normalizedSortOptions = (0, import_react39.useMemo)(
|
|
3990
|
+
() => (sortOptions ?? []).filter((option) => option?.name && option?.direction).map(normalizeSortOption).filter((option) => option.value),
|
|
3991
|
+
[sortOptions]
|
|
3992
|
+
);
|
|
3993
|
+
const selectedSortOption = (0, import_react39.useMemo)(() => {
|
|
3994
|
+
if (!normalizedSortOptions.length) return null;
|
|
3995
|
+
const trimmedCurrentSort = currentSort.trim().toLowerCase();
|
|
3996
|
+
if (!trimmedCurrentSort) return normalizedSortOptions[0];
|
|
3997
|
+
return normalizedSortOptions.find(
|
|
3998
|
+
(opt) => opt.value.trim().toLowerCase() === trimmedCurrentSort
|
|
3999
|
+
) || normalizedSortOptions[0];
|
|
4000
|
+
}, [normalizedSortOptions, currentSort]);
|
|
4001
|
+
const selectedSortLabel = selectedSortOption?.label || "";
|
|
4002
|
+
const getQueryUrl = (0, import_react39.useCallback)(
|
|
5866
4003
|
(updates) => {
|
|
5867
4004
|
const initialParams = searchParams ? searchParams.toString() : "";
|
|
5868
4005
|
const params = new URLSearchParams(initialParams || query || {});
|
|
@@ -5875,18 +4012,16 @@ var init_DataBindingControls = __esm({
|
|
|
5875
4012
|
});
|
|
5876
4013
|
params.delete("$skip");
|
|
5877
4014
|
params.delete("skip");
|
|
5878
|
-
const queryString = Array.from(params.entries()).map(
|
|
5879
|
-
([key, value]) => key === "$filter" || key === "filter" ? `${key}=${encodeURIComponent(value)}` : `${key}=${value}`
|
|
5880
|
-
).join("&");
|
|
4015
|
+
const queryString = Array.from(params.entries()).map(([key, value]) => `${key}=${encodeURIComponent(value)}`).join("&");
|
|
5881
4016
|
return queryString ? `${path}?${queryString}` : path;
|
|
5882
4017
|
},
|
|
5883
4018
|
[path, query, searchParams]
|
|
5884
4019
|
);
|
|
5885
|
-
const navigateWithoutReload = (0,
|
|
4020
|
+
const navigateWithoutReload = (0, import_react39.useCallback)(
|
|
5886
4021
|
(url) => {
|
|
5887
4022
|
if (typeof window !== "undefined") {
|
|
5888
4023
|
const targetUrl = new URL(url, window.location.origin);
|
|
5889
|
-
if (targetUrl.pathname === window.location.pathname && targetUrl.search === window.location.search) {
|
|
4024
|
+
if (targetUrl.pathname === window.location.pathname && decodeURIComponent(targetUrl.search) === decodeURIComponent(window.location.search)) {
|
|
5890
4025
|
return;
|
|
5891
4026
|
}
|
|
5892
4027
|
}
|
|
@@ -5894,6 +4029,18 @@ var init_DataBindingControls = __esm({
|
|
|
5894
4029
|
},
|
|
5895
4030
|
[router]
|
|
5896
4031
|
);
|
|
4032
|
+
const handleSelectSort = (0, import_react39.useCallback)(
|
|
4033
|
+
(sortValue) => {
|
|
4034
|
+
setIsSortOpen(false);
|
|
4035
|
+
navigateWithoutReload(
|
|
4036
|
+
getQueryUrl({
|
|
4037
|
+
$orderby: sortValue || void 0,
|
|
4038
|
+
orderBy: void 0
|
|
4039
|
+
})
|
|
4040
|
+
);
|
|
4041
|
+
},
|
|
4042
|
+
[getQueryUrl, navigateWithoutReload]
|
|
4043
|
+
);
|
|
5897
4044
|
const getFacetUrl = (field, value) => {
|
|
5898
4045
|
const updatedSelections = new Map(selectedFacetValues);
|
|
5899
4046
|
if (value) {
|
|
@@ -5922,7 +4069,7 @@ var init_DataBindingControls = __esm({
|
|
|
5922
4069
|
})
|
|
5923
4070
|
);
|
|
5924
4071
|
};
|
|
5925
|
-
const handleSearch = (0,
|
|
4072
|
+
const handleSearch = (0, import_react39.useCallback)(async () => {
|
|
5926
4073
|
const trimmedSearchText = searchText.trim();
|
|
5927
4074
|
if (trimmedSearchText === currentSearch.trim()) {
|
|
5928
4075
|
return { isSuccessful: true };
|
|
@@ -5934,7 +4081,7 @@ var init_DataBindingControls = __esm({
|
|
|
5934
4081
|
);
|
|
5935
4082
|
return { isSuccessful: true };
|
|
5936
4083
|
}, [currentSearch, getQueryUrl, navigateWithoutReload, searchText]);
|
|
5937
|
-
const handleClearAll = (0,
|
|
4084
|
+
const handleClearAll = (0, import_react39.useCallback)(async () => {
|
|
5938
4085
|
navigateWithoutReload(
|
|
5939
4086
|
getQueryUrl({
|
|
5940
4087
|
$filter: void 0,
|
|
@@ -5945,39 +4092,39 @@ var init_DataBindingControls = __esm({
|
|
|
5945
4092
|
);
|
|
5946
4093
|
return { isSuccessful: true };
|
|
5947
4094
|
}, [getQueryUrl, navigateWithoutReload]);
|
|
5948
|
-
const hasFacetControls = showFacets && activeFacets.length > 0;
|
|
5949
|
-
const hasSortControls = showSortOptions && normalizedSortOptions.length > 0;
|
|
4095
|
+
const hasFacetControls = Boolean(showFacets && (activeFacets.length > 0 || selectedFacetValues.size > 0));
|
|
4096
|
+
const hasSortControls = Boolean(showSortOptions && normalizedSortOptions.length > 0);
|
|
5950
4097
|
const hasActiveFiltersOrSort = Boolean(
|
|
5951
4098
|
currentFilter.trim() || currentSort.trim()
|
|
5952
4099
|
);
|
|
5953
4100
|
const selectedFacetCount = selectedFacetValues.size;
|
|
5954
4101
|
const shouldShowToolbarClearAll = hasActiveFiltersOrSort && !hasFacetControls;
|
|
5955
|
-
const shouldShowToolbar = mode === "toolbar" && (showSearchBar || hasSortControls || shouldShowToolbarClearAll);
|
|
5956
|
-
const shouldShowFacets = mode === "facets" && hasFacetControls;
|
|
4102
|
+
const shouldShowToolbar = mode === "toolbar" && (showSearchBar || hasSortControls || showFacets || shouldShowToolbarClearAll);
|
|
4103
|
+
const shouldShowFacets = mode === "facets" && (hasFacetControls || showFacets && activeFacets.length > 0);
|
|
5957
4104
|
if (!shouldShowToolbar && !shouldShowFacets) {
|
|
5958
4105
|
return null;
|
|
5959
4106
|
}
|
|
5960
|
-
const renderFacetItems = (field, values) => /* @__PURE__ */ (0,
|
|
4107
|
+
const renderFacetItems = (field, values) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex flex-col gap-1 pt-1 pb-1", children: values.map((facet) => {
|
|
5961
4108
|
const isSelected = selectedFacetValues.get(field) === facet.value;
|
|
5962
|
-
return /* @__PURE__ */ (0,
|
|
4109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
5963
4110
|
"button",
|
|
5964
4111
|
{
|
|
5965
4112
|
type: "button",
|
|
5966
4113
|
onClick: () => navigateWithoutReload(getFacetUrl(field, facet.value)),
|
|
5967
4114
|
"aria-pressed": isSelected,
|
|
5968
|
-
className: `group flex w-full cursor-pointer items-center justify-between gap-2.5 rounded-md px-2 py-1.5 text-left text-sm transition-all duration-150 ease-out focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-base ${isSelected ? "bg-neutral-soft font-medium border " : "hover:bg-neutral-weak border border-transparent"}`,
|
|
4115
|
+
className: `group flex w-full cursor-pointer items-center justify-between gap-2.5 rounded-md px-2 py-1.5 text-left text-sm transition-all duration-150 ease-out focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-base ${isSelected ? "bg-neutral-soft font-medium border border-neutral-soft" : "hover:bg-neutral-weak border border-transparent"}`,
|
|
5969
4116
|
children: [
|
|
5970
|
-
/* @__PURE__ */ (0,
|
|
5971
|
-
/* @__PURE__ */ (0,
|
|
4117
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex min-w-0 items-center gap-2.5", children: [
|
|
4118
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5972
4119
|
"span",
|
|
5973
4120
|
{
|
|
5974
|
-
className: `flex h-4 w-4 shrink-0 items-center justify-center rounded-[3px] border transition-colors duration-150 ${isSelected ? "bg-primary-base border-primary-base" : " group-hover:border-neutral-strong bg-default"}`,
|
|
5975
|
-
children: isSelected && /* @__PURE__ */ (0,
|
|
4121
|
+
className: `flex h-4 w-4 shrink-0 items-center justify-center rounded-[3px] border transition-colors duration-150 ${isSelected ? "bg-primary-base border-primary-base" : " group-hover:border-neutral-strong bg-default border-neutral-soft"}`,
|
|
4122
|
+
children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(CheckIcon, { className: "h-3 w-3" })
|
|
5976
4123
|
}
|
|
5977
4124
|
),
|
|
5978
|
-
/* @__PURE__ */ (0,
|
|
4125
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "leading-snug break-words", children: facet.value })
|
|
5979
4126
|
] }),
|
|
5980
|
-
/* @__PURE__ */ (0,
|
|
4127
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
5981
4128
|
"span",
|
|
5982
4129
|
{
|
|
5983
4130
|
className: `shrink-0 rounded px-1.5 py-0.5 text-xs transition-colors ml-2 ${isSelected ? "bg-neutral-weak font-semibold" : "bg-neutral-weak font-normal"}`,
|
|
@@ -5989,102 +4136,347 @@ var init_DataBindingControls = __esm({
|
|
|
5989
4136
|
`${field}-${facet.value}`
|
|
5990
4137
|
);
|
|
5991
4138
|
}) });
|
|
5992
|
-
return /* @__PURE__ */ (0,
|
|
4139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
5993
4140
|
"div",
|
|
5994
4141
|
{
|
|
5995
|
-
className: mode === "toolbar" ? "my-6" : "flex flex-col rounded-md border
|
|
4142
|
+
className: mode === "toolbar" ? "my-4 sm:my-6" : "flex flex-col rounded-md border border-neutral-soft bg-default p-4 shadow-sm",
|
|
5996
4143
|
children: [
|
|
5997
|
-
shouldShowToolbar && /* @__PURE__ */ (0,
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
4144
|
+
shouldShowToolbar && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
4145
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "hidden lg:flex lg:items-center lg:justify-between lg:gap-4", children: [
|
|
4146
|
+
showSearchBar && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
4147
|
+
"form",
|
|
4148
|
+
{
|
|
4149
|
+
role: "search",
|
|
4150
|
+
className: "flex w-full items-center gap-2 md:min-w-0 md:flex-1",
|
|
4151
|
+
onSubmit: (event) => {
|
|
4152
|
+
event.preventDefault();
|
|
4153
|
+
void handleSearch();
|
|
4154
|
+
},
|
|
4155
|
+
children: [
|
|
4156
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "relative min-w-0 flex-1", children: [
|
|
4157
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SearchIcon, { className: "pointer-events-none absolute left-3.5 top-1/2 z-10 h-4 w-4 -translate-y-1/2 opacity-60" }),
|
|
4158
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4159
|
+
"input",
|
|
4160
|
+
{
|
|
4161
|
+
type: "text",
|
|
4162
|
+
name: "searchText",
|
|
4163
|
+
value: searchText,
|
|
4164
|
+
onChange: (e) => setSearchText(e.target.value),
|
|
4165
|
+
placeholder: "Search discussions, topics, or keywords...",
|
|
4166
|
+
className: "h-10 w-full rounded-md border border-neutral-soft bg-default py-2 pl-10 pr-4 text-sm shadow-sm transition-colors focus:border-primary-base focus:outline-none focus:ring-1 focus:ring-primary-base"
|
|
4167
|
+
}
|
|
4168
|
+
)
|
|
4169
|
+
] }),
|
|
4170
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
4171
|
+
Button_default,
|
|
6020
4172
|
{
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
inputClasses: "!mt-0 !rounded-md !py-3 !pl-11 !pr-4 !shadow-sm"
|
|
4173
|
+
ButtonType: "Primary" /* Solid */,
|
|
4174
|
+
onClick: handleSearch,
|
|
4175
|
+
className: "!h-10 !rounded-md !px-5 !py-0 flex items-center justify-center gap-1.5 shrink-0",
|
|
4176
|
+
children: [
|
|
4177
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SearchIcon, { className: "h-4 w-4" }),
|
|
4178
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { children: "Search" })
|
|
4179
|
+
]
|
|
6029
4180
|
}
|
|
6030
4181
|
)
|
|
6031
|
-
]
|
|
6032
|
-
|
|
6033
|
-
|
|
4182
|
+
]
|
|
4183
|
+
}
|
|
4184
|
+
),
|
|
4185
|
+
hasSortControls && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "relative shrink-0", ref: desktopSortDropdownRef, children: [
|
|
4186
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
4187
|
+
"button",
|
|
4188
|
+
{
|
|
4189
|
+
type: "button",
|
|
4190
|
+
onClick: () => setIsSortOpen((prev) => !prev),
|
|
4191
|
+
"aria-expanded": isSortOpen,
|
|
4192
|
+
className: "inline-flex h-10 items-center justify-between gap-2.5 rounded-md border border-neutral-soft bg-default px-3.5 text-sm font-normal shadow-sm transition-all hover:bg-neutral-weak focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-base cursor-pointer whitespace-nowrap",
|
|
4193
|
+
children: [
|
|
4194
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("span", { className: "whitespace-nowrap", children: [
|
|
4195
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "opacity-70", children: "Sort by: " }),
|
|
4196
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "font-semibold", children: selectedSortLabel })
|
|
4197
|
+
] }),
|
|
4198
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4199
|
+
ChevronDownIcon,
|
|
4200
|
+
{
|
|
4201
|
+
className: `h-4 w-4 shrink-0 transition-transform duration-200 ${isSortOpen ? "rotate-180" : ""}`
|
|
4202
|
+
}
|
|
4203
|
+
)
|
|
4204
|
+
]
|
|
4205
|
+
}
|
|
4206
|
+
),
|
|
4207
|
+
isSortOpen && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "absolute right-0 z-50 mt-1.5 w-max min-w-full max-h-80 overflow-y-auto rounded-md border border-neutral-soft bg-default p-1 shadow-lg", children: normalizedSortOptions.map((option) => {
|
|
4208
|
+
const isSelected = selectedSortOption?.value === option.value;
|
|
4209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
4210
|
+
"button",
|
|
6034
4211
|
{
|
|
6035
|
-
|
|
6036
|
-
onClick:
|
|
6037
|
-
className:
|
|
4212
|
+
type: "button",
|
|
4213
|
+
onClick: () => handleSelectSort(option.value),
|
|
4214
|
+
className: `flex w-full items-center justify-between gap-4 rounded-md px-3 py-1.5 text-left text-sm transition-colors cursor-pointer whitespace-nowrap ${isSelected ? "bg-primary-base font-semibold" : "hover:bg-neutral-soft font-normal"}`,
|
|
6038
4215
|
children: [
|
|
6039
|
-
/* @__PURE__ */ (0,
|
|
6040
|
-
/* @__PURE__ */ (0,
|
|
4216
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "whitespace-nowrap", children: option.label }),
|
|
4217
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(CheckIcon, { className: "h-4 w-4 shrink-0" })
|
|
6041
4218
|
]
|
|
6042
|
-
}
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
4219
|
+
},
|
|
4220
|
+
option.value
|
|
4221
|
+
);
|
|
4222
|
+
}) })
|
|
4223
|
+
] })
|
|
4224
|
+
] }),
|
|
4225
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col gap-2.5 lg:hidden", children: [
|
|
4226
|
+
showSearchBar && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
4227
|
+
"form",
|
|
6050
4228
|
{
|
|
6051
|
-
|
|
6052
|
-
className: "
|
|
6053
|
-
|
|
4229
|
+
role: "search",
|
|
4230
|
+
className: "relative w-full",
|
|
4231
|
+
onSubmit: (event) => {
|
|
4232
|
+
event.preventDefault();
|
|
4233
|
+
void handleSearch();
|
|
4234
|
+
},
|
|
4235
|
+
children: [
|
|
4236
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SearchIcon, { className: "pointer-events-none absolute left-3.5 top-1/2 z-10 h-4 w-4 -translate-y-1/2 opacity-50" }),
|
|
4237
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4238
|
+
"input",
|
|
4239
|
+
{
|
|
4240
|
+
type: "text",
|
|
4241
|
+
name: "searchTextMobile",
|
|
4242
|
+
value: searchText,
|
|
4243
|
+
onChange: (e) => setSearchText(e.target.value),
|
|
4244
|
+
placeholder: "Search jobs, skills, or keywords...",
|
|
4245
|
+
className: "h-11 w-full rounded-md border border-neutral-soft bg-default py-2.5 pl-10 pr-4 text-sm shadow-sm transition-colors focus:border-primary-base focus:outline-none focus:ring-1 focus:ring-primary-base"
|
|
4246
|
+
}
|
|
4247
|
+
)
|
|
4248
|
+
]
|
|
6054
4249
|
}
|
|
6055
4250
|
),
|
|
6056
|
-
/* @__PURE__ */ (0,
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
4251
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex items-center justify-between gap-2.5 pt-0.5", children: [
|
|
4252
|
+
showFacets && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
4253
|
+
"button",
|
|
4254
|
+
{
|
|
4255
|
+
type: "button",
|
|
4256
|
+
onClick: () => setIsMobileFiltersOpen(true),
|
|
4257
|
+
className: "inline-flex h-10 items-center justify-center gap-2 rounded-md border border-neutral-soft bg-default px-3.5 text-sm font-medium shadow-sm transition-all hover:bg-neutral-weak cursor-pointer active:scale-95",
|
|
4258
|
+
children: [
|
|
4259
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(FilterSlidersIcon, { className: "h-4 w-4" }),
|
|
4260
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("span", { children: [
|
|
4261
|
+
"Filters",
|
|
4262
|
+
selectedFacetCount > 0 ? ` (${selectedFacetCount})` : ""
|
|
4263
|
+
] }),
|
|
4264
|
+
selectedFacetCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("span", { className: "relative flex h-2 w-2", children: [
|
|
4265
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "animate-ping absolute inline-flex h-full w-full rounded-full bg-primary-base opacity-75" }),
|
|
4266
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "relative inline-flex rounded-full h-2 w-2 bg-primary-base" })
|
|
4267
|
+
] })
|
|
4268
|
+
]
|
|
4269
|
+
}
|
|
4270
|
+
),
|
|
4271
|
+
hasSortControls && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "relative shrink-0 ml-auto", ref: mobileSortDropdownRef, children: [
|
|
4272
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
4273
|
+
"button",
|
|
4274
|
+
{
|
|
4275
|
+
type: "button",
|
|
4276
|
+
onClick: () => setIsSortOpen((prev) => !prev),
|
|
4277
|
+
"aria-expanded": isSortOpen,
|
|
4278
|
+
className: "inline-flex h-10 items-center justify-between gap-2 rounded-md border border-neutral-soft bg-default px-3.5 text-sm font-medium shadow-sm transition-all hover:bg-neutral-weak cursor-pointer whitespace-nowrap",
|
|
4279
|
+
children: [
|
|
4280
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "whitespace-nowrap font-medium", children: selectedSortLabel }),
|
|
4281
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4282
|
+
ChevronDownIcon,
|
|
4283
|
+
{
|
|
4284
|
+
className: `h-4 w-4 shrink-0 transition-transform duration-200 ${isSortOpen ? "rotate-180" : ""}`
|
|
4285
|
+
}
|
|
4286
|
+
)
|
|
4287
|
+
]
|
|
4288
|
+
}
|
|
4289
|
+
),
|
|
4290
|
+
isSortOpen && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "absolute right-0 z-50 mt-1.5 w-max min-w-[160px] max-h-80 overflow-y-auto rounded-md border border-neutral-soft bg-default p-1 shadow-xl", children: normalizedSortOptions.map((option) => {
|
|
4291
|
+
const isSelected = selectedSortOption?.value === option.value;
|
|
4292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
4293
|
+
"button",
|
|
4294
|
+
{
|
|
4295
|
+
type: "button",
|
|
4296
|
+
onClick: () => handleSelectSort(option.value),
|
|
4297
|
+
className: `flex w-full items-center justify-between gap-3 rounded-md px-3 py-2 text-left text-sm transition-colors cursor-pointer whitespace-nowrap ${isSelected ? "bg-primary-base font-semibold" : "hover:bg-neutral-soft font-normal"}`,
|
|
4298
|
+
children: [
|
|
4299
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "whitespace-nowrap", children: option.label }),
|
|
4300
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(CheckIcon, { className: "h-4 w-4 shrink-0" })
|
|
4301
|
+
]
|
|
4302
|
+
},
|
|
4303
|
+
option.value
|
|
6072
4304
|
);
|
|
4305
|
+
}) })
|
|
4306
|
+
] })
|
|
4307
|
+
] }),
|
|
4308
|
+
selectedFacetCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5 pt-1", children: [
|
|
4309
|
+
Array.from(selectedFacetValues.entries()).map(([field, value]) => /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
4310
|
+
"button",
|
|
4311
|
+
{
|
|
4312
|
+
type: "button",
|
|
4313
|
+
onClick: () => clearFacetField(field),
|
|
4314
|
+
className: "group inline-flex max-w-full cursor-pointer items-center gap-1.5 rounded-md border border-neutral-soft bg-neutral-weak px-2.5 py-1 text-xs transition-colors hover:bg-neutral-soft",
|
|
4315
|
+
title: `Remove filter: ${value}`,
|
|
4316
|
+
children: [
|
|
4317
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "font-medium truncate max-w-[140px]", children: value }),
|
|
4318
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(CloseIcon, { className: "h-3 w-3 shrink-0 opacity-60 group-hover:opacity-100" })
|
|
4319
|
+
]
|
|
6073
4320
|
},
|
|
6074
|
-
|
|
6075
|
-
|
|
4321
|
+
`mobile-chip-${field}`
|
|
4322
|
+
)),
|
|
4323
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4324
|
+
"button",
|
|
4325
|
+
{
|
|
4326
|
+
type: "button",
|
|
4327
|
+
onClick: () => void handleClearAll(),
|
|
4328
|
+
className: "inline-flex cursor-pointer items-center rounded-md px-2 py-1 text-xs font-semibold underline underline-offset-2 hover:bg-neutral-weak transition-colors ml-auto",
|
|
4329
|
+
children: "Clear all"
|
|
4330
|
+
}
|
|
4331
|
+
)
|
|
4332
|
+
] })
|
|
4333
|
+
] }),
|
|
4334
|
+
isMobileFiltersOpen && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "fixed inset-0 z-50 flex flex-col justify-end lg:hidden", children: [
|
|
4335
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4336
|
+
"div",
|
|
4337
|
+
{
|
|
4338
|
+
className: "fixed inset-0 bg-neutral-stronger/60 backdrop-blur-xs transition-opacity duration-300",
|
|
4339
|
+
onClick: () => setIsMobileFiltersOpen(false),
|
|
4340
|
+
"aria-hidden": "true"
|
|
6076
4341
|
}
|
|
6077
|
-
)
|
|
4342
|
+
),
|
|
4343
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "relative z-10 flex h-[85vh] max-h-[85vh] w-full flex-col rounded-t-xl border-t border-neutral-soft bg-default shadow-2xl transition-transform duration-300 animate-in slide-in-from-bottom", children: [
|
|
4344
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "pt-2.5 pb-1", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "mx-auto h-1.5 w-12 rounded-full bg-neutral-soft" }) }),
|
|
4345
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex items-center justify-between px-5 py-3 border-b border-neutral-soft", children: [
|
|
4346
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("h2", { className: "text-lg font-bold tracking-tight", children: "Filters" }),
|
|
4347
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
4348
|
+
selectedFacetCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4349
|
+
"button",
|
|
4350
|
+
{
|
|
4351
|
+
type: "button",
|
|
4352
|
+
onClick: () => void handleClearAll(),
|
|
4353
|
+
className: "text-xs font-semibold cursor-pointer underline underline-offset-2 hover:opacity-80",
|
|
4354
|
+
children: "Clear all"
|
|
4355
|
+
}
|
|
4356
|
+
),
|
|
4357
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4358
|
+
"button",
|
|
4359
|
+
{
|
|
4360
|
+
type: "button",
|
|
4361
|
+
onClick: () => setIsMobileFiltersOpen(false),
|
|
4362
|
+
className: "p-1 rounded-full hover:bg-neutral-weak transition-colors cursor-pointer",
|
|
4363
|
+
"aria-label": "Close filters",
|
|
4364
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(CloseIcon, { className: "h-5 w-5 opacity-70" })
|
|
4365
|
+
}
|
|
4366
|
+
)
|
|
4367
|
+
] })
|
|
4368
|
+
] }),
|
|
4369
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex-1 overflow-y-auto px-5 py-3 space-y-3 divide-y divide-neutral-soft", children: activeFacets.map(([field, values]) => {
|
|
4370
|
+
const isOpen = !collapsedCategories[field];
|
|
4371
|
+
const selectedValue = selectedFacetValues.get(field);
|
|
4372
|
+
const categorySearch = facetCategorySearch[field]?.toLowerCase() || "";
|
|
4373
|
+
const filteredValues = categorySearch ? values.filter((v) => v.value.toLowerCase().includes(categorySearch)) : values;
|
|
4374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "pt-3 first:pt-0", children: [
|
|
4375
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
4376
|
+
"button",
|
|
4377
|
+
{
|
|
4378
|
+
type: "button",
|
|
4379
|
+
onClick: () => toggleCategory(field),
|
|
4380
|
+
className: "flex w-full cursor-pointer items-center justify-between rounded-md py-2 text-left transition-colors",
|
|
4381
|
+
children: [
|
|
4382
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex items-center gap-2.5", children: [
|
|
4383
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-neutral-soft bg-neutral-weak", children: getCategoryIcon(field) }),
|
|
4384
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "font-semibold text-sm", children: humanize(field) })
|
|
4385
|
+
] }),
|
|
4386
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4387
|
+
selectedValue && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-primary-base text-xs font-bold leading-none", children: "1" }),
|
|
4388
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4389
|
+
ChevronDownIcon,
|
|
4390
|
+
{
|
|
4391
|
+
className: `h-4 w-4 transition-transform duration-200 ${isOpen ? "rotate-180" : ""}`
|
|
4392
|
+
}
|
|
4393
|
+
)
|
|
4394
|
+
] })
|
|
4395
|
+
]
|
|
4396
|
+
}
|
|
4397
|
+
),
|
|
4398
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "pt-2 pb-1 pl-1 pr-1 space-y-1.5", children: [
|
|
4399
|
+
values.length > 5 && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "relative mb-2", children: [
|
|
4400
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SearchIcon, { className: "pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 opacity-50" }),
|
|
4401
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4402
|
+
"input",
|
|
4403
|
+
{
|
|
4404
|
+
type: "text",
|
|
4405
|
+
value: facetCategorySearch[field] || "",
|
|
4406
|
+
onChange: (e) => setFacetCategorySearch((prev) => ({
|
|
4407
|
+
...prev,
|
|
4408
|
+
[field]: e.target.value
|
|
4409
|
+
})),
|
|
4410
|
+
placeholder: `Search ${humanize(field).toLowerCase()}...`,
|
|
4411
|
+
className: "h-8.5 w-full rounded-md border border-neutral-soft bg-neutral-weak py-1 pl-8 pr-3 text-xs focus:border-primary-base focus:outline-none"
|
|
4412
|
+
}
|
|
4413
|
+
)
|
|
4414
|
+
] }),
|
|
4415
|
+
filteredValues.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "py-2 text-center text-xs opacity-60", children: "No matching options" }) : filteredValues.map((facet) => {
|
|
4416
|
+
const isChecked = selectedValue === facet.value;
|
|
4417
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
4418
|
+
"button",
|
|
4419
|
+
{
|
|
4420
|
+
type: "button",
|
|
4421
|
+
onClick: () => navigateWithoutReload(
|
|
4422
|
+
getFacetUrl(field, facet.value)
|
|
4423
|
+
),
|
|
4424
|
+
"aria-pressed": isChecked,
|
|
4425
|
+
className: `flex w-full cursor-pointer items-center justify-between gap-3 rounded-md px-2.5 py-2 text-left text-sm transition-colors ${isChecked ? "bg-neutral-soft font-medium" : "hover:bg-neutral-weak"}`,
|
|
4426
|
+
children: [
|
|
4427
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
4428
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4429
|
+
"span",
|
|
4430
|
+
{
|
|
4431
|
+
className: `flex h-5 w-5 shrink-0 items-center justify-center rounded-md border transition-colors ${isChecked ? "bg-primary-base border-primary-base" : "border-neutral-soft bg-default"}`,
|
|
4432
|
+
children: isChecked && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(CheckIcon, { className: "h-3.5 w-3.5" })
|
|
4433
|
+
}
|
|
4434
|
+
),
|
|
4435
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "leading-snug break-words", children: facet.value })
|
|
4436
|
+
] }),
|
|
4437
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "shrink-0 text-xs opacity-60 ml-2", children: facet.count })
|
|
4438
|
+
]
|
|
4439
|
+
},
|
|
4440
|
+
`drawer-${field}-${facet.value}`
|
|
4441
|
+
);
|
|
4442
|
+
})
|
|
4443
|
+
] })
|
|
4444
|
+
] }, `drawer-cat-${field}`);
|
|
4445
|
+
}) }),
|
|
4446
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex items-center gap-3 border-t border-neutral-soft bg-default p-4", children: [
|
|
4447
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4448
|
+
"button",
|
|
4449
|
+
{
|
|
4450
|
+
type: "button",
|
|
4451
|
+
onClick: () => setIsMobileFiltersOpen(false),
|
|
4452
|
+
className: "flex-1 h-11 rounded-md border border-neutral-soft bg-default text-sm font-medium transition-colors hover:bg-neutral-weak cursor-pointer flex items-center justify-center",
|
|
4453
|
+
children: "Close"
|
|
4454
|
+
}
|
|
4455
|
+
),
|
|
4456
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
4457
|
+
"button",
|
|
4458
|
+
{
|
|
4459
|
+
type: "button",
|
|
4460
|
+
onClick: () => setIsMobileFiltersOpen(false),
|
|
4461
|
+
className: "flex-1 h-11 rounded-md bg-primary-base text-sm font-semibold shadow-md transition-all hover:opacity-90 active:scale-98 cursor-pointer flex items-center justify-center",
|
|
4462
|
+
children: [
|
|
4463
|
+
"Apply Filters",
|
|
4464
|
+
selectedFacetCount > 0 ? ` (${selectedFacetCount})` : ""
|
|
4465
|
+
]
|
|
4466
|
+
}
|
|
4467
|
+
)
|
|
4468
|
+
] })
|
|
4469
|
+
] })
|
|
6078
4470
|
] })
|
|
6079
4471
|
] }),
|
|
6080
|
-
shouldShowFacets && /* @__PURE__ */ (0,
|
|
6081
|
-
/* @__PURE__ */ (0,
|
|
6082
|
-
/* @__PURE__ */ (0,
|
|
6083
|
-
/* @__PURE__ */ (0,
|
|
6084
|
-
/* @__PURE__ */ (0,
|
|
6085
|
-
selectedFacetCount > 0 && /* @__PURE__ */ (0,
|
|
4472
|
+
shouldShowFacets && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
4473
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex items-center justify-between border-b border-neutral-soft pb-3", children: [
|
|
4474
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4475
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(FilterSlidersIcon, { className: "h-4 w-4" }),
|
|
4476
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("h2", { className: "text-base font-semibold tracking-tight", children: "Filters" }),
|
|
4477
|
+
selectedFacetCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "flex h-5 items-center justify-center rounded-full bg-primary-base px-2 text-xs font-semibold", children: selectedFacetCount })
|
|
6086
4478
|
] }),
|
|
6087
|
-
hasActiveFiltersOrSort && /* @__PURE__ */ (0,
|
|
4479
|
+
hasActiveFiltersOrSort && /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
6088
4480
|
"button",
|
|
6089
4481
|
{
|
|
6090
4482
|
type: "button",
|
|
@@ -6092,46 +4484,49 @@ var init_DataBindingControls = __esm({
|
|
|
6092
4484
|
className: "group inline-flex cursor-pointer items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium transition-colors duration-150 hover:bg-neutral-soft focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-base",
|
|
6093
4485
|
"aria-label": "Clear all filters and sorting",
|
|
6094
4486
|
children: [
|
|
6095
|
-
/* @__PURE__ */ (0,
|
|
6096
|
-
/* @__PURE__ */ (0,
|
|
4487
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(ResetIcon, { className: "h-3.5 w-3.5 transition-transform duration-200 group-hover:-rotate-45" }),
|
|
4488
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { children: "Clear all" })
|
|
6097
4489
|
]
|
|
6098
4490
|
}
|
|
6099
4491
|
)
|
|
6100
4492
|
] }),
|
|
6101
|
-
selectedFacetCount > 0 && /* @__PURE__ */ (0,
|
|
4493
|
+
selectedFacetCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex flex-wrap gap-1.5 pb-2.5 border-b border-neutral-soft", children: Array.from(selectedFacetValues.entries()).map(([field, value]) => /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
6102
4494
|
"button",
|
|
6103
4495
|
{
|
|
6104
4496
|
type: "button",
|
|
6105
4497
|
onClick: () => clearFacetField(field),
|
|
6106
|
-
className: "group inline-flex max-w-full cursor-pointer items-center gap-1.5 rounded-md border bg-neutral-weak px-2.5 py-1 text-xs transition-colors hover:bg-neutral-soft",
|
|
4498
|
+
className: "group inline-flex max-w-full cursor-pointer items-center gap-1.5 rounded-md border border-neutral-soft bg-neutral-weak px-2.5 py-1 text-xs transition-colors hover:bg-neutral-soft",
|
|
6107
4499
|
title: `Remove filter: ${value}`,
|
|
6108
4500
|
children: [
|
|
6109
|
-
/* @__PURE__ */ (0,
|
|
6110
|
-
/* @__PURE__ */ (0,
|
|
4501
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "font-medium truncate max-w-[150px]", children: value }),
|
|
4502
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(CloseIcon, { className: "h-3.5 w-3.5 shrink-0 opacity-60 group-hover:opacity-100" })
|
|
6111
4503
|
]
|
|
6112
4504
|
},
|
|
6113
4505
|
`chip-${field}`
|
|
6114
4506
|
)) }),
|
|
6115
|
-
activeFacets.length === 1 && /* @__PURE__ */ (0,
|
|
6116
|
-
/* @__PURE__ */ (0,
|
|
4507
|
+
activeFacets.length === 1 && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("nav", { "aria-label": `${humanize(activeFacets[0][0])} filters`, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "py-1", children: [
|
|
4508
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "px-1 pb-2 font-medium text-sm", children: humanize(activeFacets[0][0]) }),
|
|
6117
4509
|
renderFacetItems(activeFacets[0][0], activeFacets[0][1])
|
|
6118
4510
|
] }) }),
|
|
6119
|
-
activeFacets.length > 1 && /* @__PURE__ */ (0,
|
|
4511
|
+
activeFacets.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex flex-col divide-y divide-neutral-soft", children: activeFacets.map(([field, values]) => {
|
|
6120
4512
|
const isOpen = !collapsedCategories[field];
|
|
6121
|
-
return /* @__PURE__ */ (0,
|
|
4513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
6122
4514
|
"div",
|
|
6123
4515
|
{
|
|
6124
4516
|
className: "py-2 first:pt-0 last:pb-0",
|
|
6125
4517
|
children: [
|
|
6126
|
-
/* @__PURE__ */ (0,
|
|
4518
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
6127
4519
|
"button",
|
|
6128
4520
|
{
|
|
6129
4521
|
type: "button",
|
|
6130
4522
|
onClick: () => toggleCategory(field),
|
|
6131
4523
|
className: "flex w-full cursor-pointer items-center justify-between rounded-md px-1.5 py-1.5 text-sm font-semibold transition-colors duration-150 hover:bg-neutral-weak focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary-base",
|
|
6132
4524
|
children: [
|
|
6133
|
-
/* @__PURE__ */ (0,
|
|
6134
|
-
|
|
4525
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4526
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded border border-neutral-soft bg-neutral-weak", children: getCategoryIcon(field) }),
|
|
4527
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("span", { children: humanize(field) })
|
|
4528
|
+
] }),
|
|
4529
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
6135
4530
|
ChevronDownIcon,
|
|
6136
4531
|
{
|
|
6137
4532
|
className: `h-4 w-4 transition-transform duration-200 ease-out ${isOpen ? "rotate-180" : ""}`
|
|
@@ -6140,7 +4535,7 @@ var init_DataBindingControls = __esm({
|
|
|
6140
4535
|
]
|
|
6141
4536
|
}
|
|
6142
4537
|
),
|
|
6143
|
-
isOpen && /* @__PURE__ */ (0,
|
|
4538
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "pt-1", children: renderFacetItems(field, values) })
|
|
6144
4539
|
]
|
|
6145
4540
|
},
|
|
6146
4541
|
field
|
|
@@ -6160,13 +4555,13 @@ var Slider_exports = {};
|
|
|
6160
4555
|
__export(Slider_exports, {
|
|
6161
4556
|
default: () => Slider_default
|
|
6162
4557
|
});
|
|
6163
|
-
var
|
|
4558
|
+
var import_react40, import_jsx_runtime66, Slider, ArrowButton, ProgressPill, Slider_default;
|
|
6164
4559
|
var init_Slider = __esm({
|
|
6165
4560
|
"src/components/Slider.tsx"() {
|
|
6166
4561
|
"use strict";
|
|
6167
4562
|
"use client";
|
|
6168
|
-
|
|
6169
|
-
|
|
4563
|
+
import_react40 = __toESM(require("react"));
|
|
4564
|
+
import_jsx_runtime66 = require("react/jsx-runtime");
|
|
6170
4565
|
Slider = ({
|
|
6171
4566
|
children,
|
|
6172
4567
|
columns,
|
|
@@ -6187,17 +4582,17 @@ var init_Slider = __esm({
|
|
|
6187
4582
|
progressPosition = "bottom",
|
|
6188
4583
|
scrollByColumns = false
|
|
6189
4584
|
}) => {
|
|
6190
|
-
const [currentSlide, setCurrentSlide] = (0,
|
|
6191
|
-
const [transition, setTransition] = (0,
|
|
4585
|
+
const [currentSlide, setCurrentSlide] = (0, import_react40.useState)(0);
|
|
4586
|
+
const [transition, setTransition] = (0, import_react40.useState)(true);
|
|
6192
4587
|
const initialSlidesToShow = slidesToShow ?? columns ?? 4;
|
|
6193
|
-
const [slidesToShowState, setSlidesToShowState] = (0,
|
|
4588
|
+
const [slidesToShowState, setSlidesToShowState] = (0, import_react40.useState)(
|
|
6194
4589
|
typeof initialSlidesToShow === "number" ? initialSlidesToShow : initialSlidesToShow.large
|
|
6195
4590
|
);
|
|
6196
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
6197
|
-
const trackRef = (0,
|
|
4591
|
+
const [isPlaying, setIsPlaying] = (0, import_react40.useState)(autoplay);
|
|
4592
|
+
const trackRef = (0, import_react40.useRef)(null);
|
|
6198
4593
|
console.log("trackRef:", trackRef);
|
|
6199
|
-
const [videoProgress, setVideoProgress] = (0,
|
|
6200
|
-
(0,
|
|
4594
|
+
const [videoProgress, setVideoProgress] = (0, import_react40.useState)(null);
|
|
4595
|
+
(0, import_react40.useEffect)(() => {
|
|
6201
4596
|
if (typeof initialSlidesToShow === "number") {
|
|
6202
4597
|
setSlidesToShowState(initialSlidesToShow);
|
|
6203
4598
|
return;
|
|
@@ -6215,7 +4610,7 @@ var init_Slider = __esm({
|
|
|
6215
4610
|
window.addEventListener("resize", handleResize);
|
|
6216
4611
|
return () => window.removeEventListener("resize", handleResize);
|
|
6217
4612
|
}, [initialSlidesToShow]);
|
|
6218
|
-
(0,
|
|
4613
|
+
(0, import_react40.useEffect)(() => {
|
|
6219
4614
|
if (!autoplay) return;
|
|
6220
4615
|
const activeSlideElement = trackRef.current?.children[currentSlide];
|
|
6221
4616
|
const videoElement = activeSlideElement?.querySelector("video");
|
|
@@ -6260,7 +4655,7 @@ var init_Slider = __esm({
|
|
|
6260
4655
|
}, autoplay_speed);
|
|
6261
4656
|
return () => clearInterval(timer);
|
|
6262
4657
|
}, [autoplay, autoplay_speed, currentSlide, isPlaying]);
|
|
6263
|
-
const totalSlides =
|
|
4658
|
+
const totalSlides = import_react40.Children.count(children);
|
|
6264
4659
|
const numColumns = columns ?? slidesToShowState;
|
|
6265
4660
|
const slideWidthPercentage = (() => {
|
|
6266
4661
|
if (typeof lastColPercentage !== "number") {
|
|
@@ -6320,24 +4715,24 @@ var init_Slider = __esm({
|
|
|
6320
4715
|
}
|
|
6321
4716
|
};
|
|
6322
4717
|
const translateX = -currentSlide * slideWidthPercentage;
|
|
6323
|
-
const slides =
|
|
6324
|
-
if (!
|
|
4718
|
+
const slides = import_react40.Children.map(children, (child, index) => {
|
|
4719
|
+
if (!import_react40.default.isValidElement(child)) return null;
|
|
6325
4720
|
const childProps = child.props;
|
|
6326
4721
|
const mergedClassName = `${childProps.className ?? ""} w-full`.trim();
|
|
6327
|
-
return /* @__PURE__ */ (0,
|
|
4722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6328
4723
|
"div",
|
|
6329
4724
|
{
|
|
6330
4725
|
className: `flex-none ${scaleOnHover ? "group hover:z-50" : ""} relative`,
|
|
6331
4726
|
style: { width: `calc(${slideWidthPercentage}%)`, paddingRight: gap },
|
|
6332
|
-
children: (0,
|
|
4727
|
+
children: (0, import_react40.cloneElement)(child, {
|
|
6333
4728
|
className: mergedClassName
|
|
6334
4729
|
})
|
|
6335
4730
|
},
|
|
6336
4731
|
index
|
|
6337
4732
|
);
|
|
6338
4733
|
});
|
|
6339
|
-
return /* @__PURE__ */ (0,
|
|
6340
|
-
show_dots && progressPosition === "top" && /* @__PURE__ */ (0,
|
|
4734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "w-full", children: [
|
|
4735
|
+
show_dots && progressPosition === "top" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "flex justify-center space-x-1.5 mb-4", children: Array.from({ length: totalSlides }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6341
4736
|
ProgressPill,
|
|
6342
4737
|
{
|
|
6343
4738
|
active: index === currentSlide,
|
|
@@ -6354,14 +4749,14 @@ var init_Slider = __esm({
|
|
|
6354
4749
|
},
|
|
6355
4750
|
index
|
|
6356
4751
|
)) }),
|
|
6357
|
-
/* @__PURE__ */ (0,
|
|
4752
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
6358
4753
|
"div",
|
|
6359
4754
|
{
|
|
6360
4755
|
className: `relative w-full overflow-hidden ${className}`,
|
|
6361
4756
|
onMouseEnter: handleMouseEnter,
|
|
6362
4757
|
onMouseLeave: handleMouseLeave,
|
|
6363
4758
|
children: [
|
|
6364
|
-
/* @__PURE__ */ (0,
|
|
4759
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6365
4760
|
"div",
|
|
6366
4761
|
{
|
|
6367
4762
|
ref: trackRef,
|
|
@@ -6373,32 +4768,32 @@ var init_Slider = __esm({
|
|
|
6373
4768
|
children: slides
|
|
6374
4769
|
}
|
|
6375
4770
|
),
|
|
6376
|
-
show_arrows && /* @__PURE__ */ (0,
|
|
6377
|
-
/* @__PURE__ */ (0,
|
|
4771
|
+
show_arrows && /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
|
|
4772
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6378
4773
|
ArrowButton,
|
|
6379
4774
|
{
|
|
6380
4775
|
direction: "left",
|
|
6381
4776
|
onClick: prevSlide,
|
|
6382
4777
|
visible: infinite_scroll || currentSlide > 0,
|
|
6383
4778
|
className: arrowClassName,
|
|
6384
|
-
children: /* @__PURE__ */ (0,
|
|
4779
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-6 h-6", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 19.5 8.25 12l7.5-7.5" }) })
|
|
6385
4780
|
}
|
|
6386
4781
|
),
|
|
6387
|
-
/* @__PURE__ */ (0,
|
|
4782
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6388
4783
|
ArrowButton,
|
|
6389
4784
|
{
|
|
6390
4785
|
direction: "right",
|
|
6391
4786
|
onClick: nextSlide,
|
|
6392
4787
|
visible: infinite_scroll || currentSlide < maxSlide,
|
|
6393
4788
|
className: arrowClassName,
|
|
6394
|
-
children: /* @__PURE__ */ (0,
|
|
4789
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-6 h-6", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m8.25 4.5 7.5 7.5-7.5 7.5" }) })
|
|
6395
4790
|
}
|
|
6396
4791
|
)
|
|
6397
4792
|
] })
|
|
6398
4793
|
]
|
|
6399
4794
|
}
|
|
6400
4795
|
),
|
|
6401
|
-
show_dots && progressPosition !== "top" && /* @__PURE__ */ (0,
|
|
4796
|
+
show_dots && progressPosition !== "top" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "flex justify-center space-x-1.5 mt-5", children: Array.from({ length: totalSlides }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6402
4797
|
ProgressPill,
|
|
6403
4798
|
{
|
|
6404
4799
|
active: index === currentSlide,
|
|
@@ -6423,7 +4818,7 @@ var init_Slider = __esm({
|
|
|
6423
4818
|
visible,
|
|
6424
4819
|
children,
|
|
6425
4820
|
className = ""
|
|
6426
|
-
}) => /* @__PURE__ */ (0,
|
|
4821
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6427
4822
|
"button",
|
|
6428
4823
|
{
|
|
6429
4824
|
className: `
|
|
@@ -6450,13 +4845,13 @@ var init_Slider = __esm({
|
|
|
6450
4845
|
totalSlides,
|
|
6451
4846
|
customProgress = null
|
|
6452
4847
|
}) => {
|
|
6453
|
-
const [progress, setProgress] = (0,
|
|
6454
|
-
(0,
|
|
4848
|
+
const [progress, setProgress] = (0, import_react40.useState)(0);
|
|
4849
|
+
(0, import_react40.useEffect)(() => {
|
|
6455
4850
|
if (active) {
|
|
6456
4851
|
setProgress(0);
|
|
6457
4852
|
}
|
|
6458
4853
|
}, [active, index]);
|
|
6459
|
-
(0,
|
|
4854
|
+
(0, import_react40.useEffect)(() => {
|
|
6460
4855
|
if (!active || !isPlaying || customProgress !== null) {
|
|
6461
4856
|
if (!active) {
|
|
6462
4857
|
setProgress(0);
|
|
@@ -6511,7 +4906,7 @@ var init_Slider = __esm({
|
|
|
6511
4906
|
const renderProgressBar = () => {
|
|
6512
4907
|
if (style === "modern" && isActive || style === "cumulative" && shouldShowProgress) {
|
|
6513
4908
|
const displayProgress = style === "cumulative" && isFilled ? 100 : customProgress !== null && customProgress !== void 0 ? customProgress : progress;
|
|
6514
|
-
return /* @__PURE__ */ (0,
|
|
4909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6515
4910
|
"div",
|
|
6516
4911
|
{
|
|
6517
4912
|
className: `absolute top-0 left-0 h-full rounded-full ${style === "cumulative" && isFilled ? activeClassName || "bg-white" : activeClassName || "bg-white"} transition-all duration-50 ease-linear`,
|
|
@@ -6523,7 +4918,7 @@ var init_Slider = __esm({
|
|
|
6523
4918
|
};
|
|
6524
4919
|
const renderCumulativeFill = () => {
|
|
6525
4920
|
if (style === "cumulative" && isFilled && !isActive) {
|
|
6526
|
-
return /* @__PURE__ */ (0,
|
|
4921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
6527
4922
|
"div",
|
|
6528
4923
|
{
|
|
6529
4924
|
className: `absolute top-0 left-0 h-full rounded-full ${activeClassName || "bg-white"} transition-all duration-300`,
|
|
@@ -6533,7 +4928,7 @@ var init_Slider = __esm({
|
|
|
6533
4928
|
}
|
|
6534
4929
|
return null;
|
|
6535
4930
|
};
|
|
6536
|
-
return /* @__PURE__ */ (0,
|
|
4931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
6537
4932
|
"button",
|
|
6538
4933
|
{
|
|
6539
4934
|
className: `${baseClasses} ${getStyleClasses()}`,
|
|
@@ -6561,7 +4956,7 @@ __export(server_exports, {
|
|
|
6561
4956
|
module.exports = __toCommonJS(server_exports);
|
|
6562
4957
|
|
|
6563
4958
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
6564
|
-
var
|
|
4959
|
+
var import_react42 = __toESM(require("react"));
|
|
6565
4960
|
|
|
6566
4961
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
6567
4962
|
var import_react28 = __toESM(require("react"));
|
|
@@ -7759,8 +6154,8 @@ var WidgetNode = (props) => {
|
|
|
7759
6154
|
var WidgetNode_default = WidgetNode;
|
|
7760
6155
|
|
|
7761
6156
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
7762
|
-
var
|
|
7763
|
-
var
|
|
6157
|
+
var import_dynamic13 = __toESM(require("next/dynamic"));
|
|
6158
|
+
var import_react41 = __toESM(require("react"));
|
|
7764
6159
|
|
|
7765
6160
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
7766
6161
|
var import_dynamic10 = __toESM(require("next/dynamic"));
|
|
@@ -8946,12 +7341,12 @@ var GoogleMapNode = (props) => {
|
|
|
8946
7341
|
var GoogleMapNode_default = GoogleMapNode;
|
|
8947
7342
|
|
|
8948
7343
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
8949
|
-
var
|
|
8950
|
-
var Pagination2 = (0,
|
|
8951
|
-
var DataBindingControls2 = (0,
|
|
7344
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
7345
|
+
var Pagination2 = (0, import_dynamic13.default)(() => Promise.resolve().then(() => (init_Pagination(), Pagination_exports)), { ssr: true });
|
|
7346
|
+
var DataBindingControls2 = (0, import_dynamic13.default)(() => Promise.resolve().then(() => (init_DataBindingControls(), DataBindingControls_exports)), {
|
|
8952
7347
|
ssr: true
|
|
8953
7348
|
});
|
|
8954
|
-
var Slider2 = (0,
|
|
7349
|
+
var Slider2 = (0, import_dynamic13.default)(() => Promise.resolve().then(() => (init_Slider(), Slider_exports)), {
|
|
8955
7350
|
ssr: false
|
|
8956
7351
|
});
|
|
8957
7352
|
function toCamelCase(str) {
|
|
@@ -9231,7 +7626,7 @@ var DivContainer = async (props) => {
|
|
|
9231
7626
|
}
|
|
9232
7627
|
const SelectedNode = NodeTypes2[node.type];
|
|
9233
7628
|
if (!SelectedNode) return null;
|
|
9234
|
-
return /* @__PURE__ */ (0,
|
|
7629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react41.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
9235
7630
|
SelectedNode,
|
|
9236
7631
|
{
|
|
9237
7632
|
node,
|
|
@@ -9323,7 +7718,7 @@ var DivContainer = async (props) => {
|
|
|
9323
7718
|
item,
|
|
9324
7719
|
idx,
|
|
9325
7720
|
props.href ? void 0 : item?.links?.view
|
|
9326
|
-
)?.map((child, i) => /* @__PURE__ */ (0,
|
|
7721
|
+
)?.map((child, i) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_react41.default.Fragment, { children: child }, i)) : renderChildren2(props.node.children, props, item, idx)
|
|
9327
7722
|
);
|
|
9328
7723
|
}
|
|
9329
7724
|
return props.node.children.flatMap((node, childIndex) => {
|
|
@@ -9441,17 +7836,17 @@ var DivContainer = async (props) => {
|
|
|
9441
7836
|
dataBindingProperties?.showFacets || dataBindingProperties?.showSortOptions || dataBindingProperties?.showSearchBar
|
|
9442
7837
|
);
|
|
9443
7838
|
const WrapperComponent = Wrapper;
|
|
9444
|
-
const renderedContainer = /* @__PURE__ */ (0,
|
|
7839
|
+
const renderedContainer = /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
9445
7840
|
WrapperComponent,
|
|
9446
7841
|
{
|
|
9447
7842
|
id: guid,
|
|
9448
7843
|
style: combinedStyles,
|
|
9449
7844
|
className: classNames || void 0,
|
|
9450
7845
|
...wrapperProps,
|
|
9451
|
-
children: shouldShowNoDataMessage ? hasActiveFilter ? /* @__PURE__ */ (0,
|
|
7846
|
+
children: shouldShowNoDataMessage ? hasActiveFilter ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(NoFilterResultsFound_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(NoDataFound_default, {}) : renderContainerChildren()
|
|
9452
7847
|
}
|
|
9453
7848
|
);
|
|
9454
|
-
const paginationControl = dataBindingProperties?.enablePagination ? /* @__PURE__ */ (0,
|
|
7849
|
+
const paginationControl = dataBindingProperties?.enablePagination ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
9455
7850
|
Pagination2,
|
|
9456
7851
|
{
|
|
9457
7852
|
path: props.path,
|
|
@@ -9459,15 +7854,15 @@ var DivContainer = async (props) => {
|
|
|
9459
7854
|
dataset: response
|
|
9460
7855
|
}
|
|
9461
7856
|
) : null;
|
|
9462
|
-
return /* @__PURE__ */ (0,
|
|
9463
|
-
/* @__PURE__ */ (0,
|
|
7857
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_react41.default.Fragment, { children: [
|
|
7858
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
9464
7859
|
"style",
|
|
9465
7860
|
{
|
|
9466
7861
|
dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS }
|
|
9467
7862
|
}
|
|
9468
7863
|
),
|
|
9469
|
-
showDataBindingControls ? /* @__PURE__ */ (0,
|
|
9470
|
-
/* @__PURE__ */ (0,
|
|
7864
|
+
showDataBindingControls ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_react41.default.Fragment, { children: [
|
|
7865
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
9471
7866
|
DataBindingControls2,
|
|
9472
7867
|
{
|
|
9473
7868
|
mode: "toolbar",
|
|
@@ -9480,16 +7875,16 @@ var DivContainer = async (props) => {
|
|
|
9480
7875
|
showSearchBar: dataBindingProperties?.showSearchBar
|
|
9481
7876
|
}
|
|
9482
7877
|
),
|
|
9483
|
-
/* @__PURE__ */ (0,
|
|
7878
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
9484
7879
|
"div",
|
|
9485
7880
|
{
|
|
9486
7881
|
className: dataBindingProperties?.showFacets ? "grid items-start gap-6 lg:grid-cols-[minmax(0,1fr)_18rem]" : void 0,
|
|
9487
7882
|
children: [
|
|
9488
|
-
/* @__PURE__ */ (0,
|
|
7883
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "min-w-0", children: [
|
|
9489
7884
|
renderedContainer,
|
|
9490
7885
|
paginationControl
|
|
9491
7886
|
] }),
|
|
9492
|
-
dataBindingProperties?.showFacets && /* @__PURE__ */ (0,
|
|
7887
|
+
dataBindingProperties?.showFacets && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("aside", { className: "hidden lg:block", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
9493
7888
|
DataBindingControls2,
|
|
9494
7889
|
{
|
|
9495
7890
|
mode: "facets",
|
|
@@ -9502,16 +7897,16 @@ var DivContainer = async (props) => {
|
|
|
9502
7897
|
]
|
|
9503
7898
|
}
|
|
9504
7899
|
)
|
|
9505
|
-
] }) : /* @__PURE__ */ (0,
|
|
7900
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_react41.default.Fragment, { children: [
|
|
9506
7901
|
renderedContainer,
|
|
9507
|
-
paginationControl && /* @__PURE__ */ (0,
|
|
7902
|
+
paginationControl && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { children: paginationControl })
|
|
9508
7903
|
] })
|
|
9509
7904
|
] });
|
|
9510
7905
|
};
|
|
9511
7906
|
var DivContainer_default = DivContainer;
|
|
9512
7907
|
|
|
9513
7908
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
9514
|
-
var
|
|
7909
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
9515
7910
|
var NodeTypes = {
|
|
9516
7911
|
["paragraph"]: ParagraphNode_default,
|
|
9517
7912
|
["heading"]: HeadingNode_default,
|
|
@@ -9549,14 +7944,14 @@ var PageBodyRenderer = (props) => {
|
|
|
9549
7944
|
}
|
|
9550
7945
|
return true;
|
|
9551
7946
|
};
|
|
9552
|
-
return /* @__PURE__ */ (0,
|
|
7947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react42.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
9553
7948
|
{
|
|
9554
7949
|
}
|
|
9555
7950
|
const SelectedNode = NodeTypes[node.type];
|
|
9556
7951
|
if (!shouldRenderNode(node)) {
|
|
9557
7952
|
return null;
|
|
9558
7953
|
}
|
|
9559
|
-
return /* @__PURE__ */ (0,
|
|
7954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react42.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react42.default.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react42.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
9560
7955
|
SelectedNode,
|
|
9561
7956
|
{
|
|
9562
7957
|
node,
|
|
@@ -9572,7 +7967,7 @@ var PageBodyRenderer = (props) => {
|
|
|
9572
7967
|
device: props.device,
|
|
9573
7968
|
widgetRenderer: props.widgetRenderer
|
|
9574
7969
|
}
|
|
9575
|
-
) }) : /* @__PURE__ */ (0,
|
|
7970
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_react42.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
9576
7971
|
SelectedNode,
|
|
9577
7972
|
{
|
|
9578
7973
|
node,
|