@clyrex-digital/clyrex-controls-dev 0.8.1-dev.20261013090602 → 0.8.1-dev.20261014075053
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/MediaAccordionNodeClient-NI5ZWLOR.mjs +144 -0
- package/dist/MediaAccordionNodeClient-ZVKS3IEH.mjs +142 -0
- package/dist/index.js +719 -471
- package/dist/index.mjs +259 -159
- package/dist/server.js +518 -270
- package/dist/server.mjs +124 -24
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3880,7 +3880,7 @@ var init_SelectWithSearchPanel = __esm({
|
|
|
3880
3880
|
const containerRef = (0, import_react38.useRef)(null);
|
|
3881
3881
|
const [isCreateOpen, setIsCreateOpen] = (0, import_react38.useState)(false);
|
|
3882
3882
|
const [formData, setFormData] = (0, import_react38.useState)({});
|
|
3883
|
-
const
|
|
3883
|
+
const getNestedValue8 = (obj, path) => {
|
|
3884
3884
|
return path.split(".").reduce((acc, key) => acc?.[key], obj);
|
|
3885
3885
|
};
|
|
3886
3886
|
(0, import_react38.useEffect)(() => {
|
|
@@ -3918,7 +3918,7 @@ var init_SelectWithSearchPanel = __esm({
|
|
|
3918
3918
|
props.dataSourceDependsOn
|
|
3919
3919
|
]);
|
|
3920
3920
|
const filteredItems = list?.filter((item) => {
|
|
3921
|
-
const value =
|
|
3921
|
+
const value = getNestedValue8(item, props.dataTextFieldName);
|
|
3922
3922
|
return value?.toLowerCase().includes(searchTerm?.toLowerCase());
|
|
3923
3923
|
});
|
|
3924
3924
|
const playBeep = () => {
|
|
@@ -3949,7 +3949,7 @@ var init_SelectWithSearchPanel = __esm({
|
|
|
3949
3949
|
}, [searchTerm]);
|
|
3950
3950
|
const handleSelect = (event, item) => {
|
|
3951
3951
|
event.preventDefault();
|
|
3952
|
-
setSearchTerm(
|
|
3952
|
+
setSearchTerm(getNestedValue8(item, props.dataTextFieldName));
|
|
3953
3953
|
if (props.callback) {
|
|
3954
3954
|
const val = {};
|
|
3955
3955
|
props.callback({
|
|
@@ -4110,7 +4110,7 @@ var init_SelectWithSearchPanel = __esm({
|
|
|
4110
4110
|
role: "option",
|
|
4111
4111
|
tabIndex: -1,
|
|
4112
4112
|
onMouseEnter: () => setHighlightedIndex(index),
|
|
4113
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children:
|
|
4113
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: getNestedValue8(item, props.dataTextFieldName) })
|
|
4114
4114
|
}
|
|
4115
4115
|
) }, item[props.dataKeyFieldName])) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "px-4 py-2 text-gray-500", children: "No results found" })
|
|
4116
4116
|
}
|
|
@@ -5227,7 +5227,7 @@ var init_LinkNodeButton = __esm({
|
|
|
5227
5227
|
const fieldNames = extractFieldNames(template);
|
|
5228
5228
|
if (responseData) {
|
|
5229
5229
|
fieldNames.forEach((fieldName) => {
|
|
5230
|
-
const value =
|
|
5230
|
+
const value = getNestedValue8(responseData, fieldName);
|
|
5231
5231
|
if (value !== void 0) {
|
|
5232
5232
|
const regex1 = new RegExp(`\\{${fieldName}\\}`, "g");
|
|
5233
5233
|
const regex2 = new RegExp(`\\{\\{${fieldName}\\}\\}`, "g");
|
|
@@ -5252,7 +5252,7 @@ var init_LinkNodeButton = __esm({
|
|
|
5252
5252
|
},
|
|
5253
5253
|
[props.routeParameters, dataitem, extractFieldNames]
|
|
5254
5254
|
);
|
|
5255
|
-
const
|
|
5255
|
+
const getNestedValue8 = (0, import_react46.useCallback)((obj, path) => {
|
|
5256
5256
|
if (!obj || !path) return void 0;
|
|
5257
5257
|
if (obj[path] !== void 0) {
|
|
5258
5258
|
return obj[path];
|
|
@@ -5305,15 +5305,15 @@ var init_LinkNodeButton = __esm({
|
|
|
5305
5305
|
console.log("Field names in redirect URL:", fieldNames);
|
|
5306
5306
|
const fieldValueMap = {};
|
|
5307
5307
|
fieldNames.forEach((fieldName) => {
|
|
5308
|
-
const value =
|
|
5308
|
+
const value = getNestedValue8(response, fieldName);
|
|
5309
5309
|
if (value !== void 0) {
|
|
5310
5310
|
fieldValueMap[fieldName] = String(value);
|
|
5311
5311
|
} else {
|
|
5312
|
-
const resultValue =
|
|
5312
|
+
const resultValue = getNestedValue8(response, `result.${fieldName}`);
|
|
5313
5313
|
if (resultValue !== void 0) {
|
|
5314
5314
|
fieldValueMap[fieldName] = String(resultValue);
|
|
5315
5315
|
} else {
|
|
5316
|
-
const dataValue =
|
|
5316
|
+
const dataValue = getNestedValue8(response, `data.${fieldName}`);
|
|
5317
5317
|
if (dataValue !== void 0) {
|
|
5318
5318
|
fieldValueMap[fieldName] = String(dataValue);
|
|
5319
5319
|
}
|
|
@@ -5372,7 +5372,7 @@ var init_LinkNodeButton = __esm({
|
|
|
5372
5372
|
node.reloadPageAfterSuccess,
|
|
5373
5373
|
replaceTemplateVariables,
|
|
5374
5374
|
extractFieldNames,
|
|
5375
|
-
|
|
5375
|
+
getNestedValue8,
|
|
5376
5376
|
props.apiBaseUrl,
|
|
5377
5377
|
props.session
|
|
5378
5378
|
]);
|
|
@@ -5938,26 +5938,173 @@ var init_OdataBuilder = __esm({
|
|
|
5938
5938
|
}
|
|
5939
5939
|
});
|
|
5940
5940
|
|
|
5941
|
+
// src/components/pageRenderingEngine/nodes/MediaAccordionNodeClient.tsx
|
|
5942
|
+
var MediaAccordionNodeClient_exports = {};
|
|
5943
|
+
__export(MediaAccordionNodeClient_exports, {
|
|
5944
|
+
default: () => MediaAccordionNodeClient_default
|
|
5945
|
+
});
|
|
5946
|
+
var import_react59, import_dynamic15, import_image, import_jsx_runtime87, HlsPlayer5, isHlsUrl, isVideoUrl, MediaAccordionNodeClient, MediaAccordionNodeClient_default;
|
|
5947
|
+
var init_MediaAccordionNodeClient = __esm({
|
|
5948
|
+
"src/components/pageRenderingEngine/nodes/MediaAccordionNodeClient.tsx"() {
|
|
5949
|
+
"use strict";
|
|
5950
|
+
"use client";
|
|
5951
|
+
import_react59 = require("react");
|
|
5952
|
+
import_dynamic15 = __toESM(require("next/dynamic"));
|
|
5953
|
+
import_image = __toESM(require("next/image"));
|
|
5954
|
+
init_AssetUtility();
|
|
5955
|
+
import_jsx_runtime87 = require("react/jsx-runtime");
|
|
5956
|
+
HlsPlayer5 = (0, import_dynamic15.default)(() => Promise.resolve().then(() => (init_HlsPlayer(), HlsPlayer_exports)), { ssr: false });
|
|
5957
|
+
isHlsUrl = (url) => /\.m3u8(?:$|[?#])/i.test(url);
|
|
5958
|
+
isVideoUrl = (url) => /\.(mp4|webm|ogv)(?:$|[?#])/i.test(url);
|
|
5959
|
+
MediaAccordionNodeClient = (props) => {
|
|
5960
|
+
const items = Array.isArray(props.node.items) ? props.node.items : [];
|
|
5961
|
+
const [activeIndex, setActiveIndex] = (0, import_react59.useState)(0);
|
|
5962
|
+
const activeItem = items[activeIndex] ?? items[0];
|
|
5963
|
+
const buttonBackground = props.node.buttonBackgroundLayers?.length ? props.node.buttonBackgroundLayers.slice(0, 1).map((layer) => {
|
|
5964
|
+
const colors = layer.value.colors.map((stop) => `color-mix(in srgb, ${stop.color}, transparent ${stop.transparency ?? 0}%) ${stop.position}%`).join(", ");
|
|
5965
|
+
return `linear-gradient(${layer.value.direction}deg, ${colors})`;
|
|
5966
|
+
}).filter(Boolean).join(", ") : props.node.buttonBackgroundGradient ? `linear-gradient(135deg, ${props.node.buttonGradientStart || "var(--primary-action-fill)"}, ${props.node.buttonGradientEnd || "var(--primary-action-fill)"})` : props.node.buttonBackgroundColor || "var(--primary-action-fill)";
|
|
5967
|
+
const assetBaseUrl = props.assetBaseUrl || `${props.apiBaseUrl}/digitalassets-management`;
|
|
5968
|
+
const resolveUrl = (url) => url ? AssetUtility_default.resolveUrl(assetBaseUrl, url) : void 0;
|
|
5969
|
+
const renderMedia = (item) => {
|
|
5970
|
+
const mediaUrl = resolveUrl(item.mediaUrl);
|
|
5971
|
+
const posterUrl = resolveUrl(item.posterUrl);
|
|
5972
|
+
if (!mediaUrl) return null;
|
|
5973
|
+
if (item.mediaType === "image") {
|
|
5974
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
5975
|
+
import_image.default,
|
|
5976
|
+
{
|
|
5977
|
+
className: "story-accordion__media-image",
|
|
5978
|
+
src: mediaUrl,
|
|
5979
|
+
alt: item.title,
|
|
5980
|
+
loading: "lazy",
|
|
5981
|
+
fill: true,
|
|
5982
|
+
sizes: "(max-width: 700px) 100vw, 60vw",
|
|
5983
|
+
unoptimized: true
|
|
5984
|
+
}
|
|
5985
|
+
);
|
|
5986
|
+
}
|
|
5987
|
+
if (isHlsUrl(mediaUrl)) {
|
|
5988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
5989
|
+
HlsPlayer5,
|
|
5990
|
+
{
|
|
5991
|
+
assetUrl: mediaUrl,
|
|
5992
|
+
posterUrl,
|
|
5993
|
+
showControls: true,
|
|
5994
|
+
apiBaseUrl: props.apiBaseUrl,
|
|
5995
|
+
session: ""
|
|
5996
|
+
}
|
|
5997
|
+
);
|
|
5998
|
+
}
|
|
5999
|
+
if (item.mediaType === "video" || isVideoUrl(mediaUrl)) {
|
|
6000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
6001
|
+
"video",
|
|
6002
|
+
{
|
|
6003
|
+
className: "story-accordion__media-video",
|
|
6004
|
+
src: mediaUrl,
|
|
6005
|
+
poster: posterUrl,
|
|
6006
|
+
controls: true,
|
|
6007
|
+
playsInline: true,
|
|
6008
|
+
preload: "metadata"
|
|
6009
|
+
}
|
|
6010
|
+
);
|
|
6011
|
+
}
|
|
6012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
6013
|
+
import_image.default,
|
|
6014
|
+
{
|
|
6015
|
+
className: "story-accordion__media-image",
|
|
6016
|
+
src: posterUrl || mediaUrl,
|
|
6017
|
+
alt: item.title,
|
|
6018
|
+
loading: "lazy",
|
|
6019
|
+
fill: true,
|
|
6020
|
+
sizes: "(max-width: 700px) 100vw, 60vw",
|
|
6021
|
+
unoptimized: true
|
|
6022
|
+
}
|
|
6023
|
+
);
|
|
6024
|
+
};
|
|
6025
|
+
if (items.length === 0) return null;
|
|
6026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
6027
|
+
"section",
|
|
6028
|
+
{
|
|
6029
|
+
className: "story-accordion",
|
|
6030
|
+
"aria-label": "Featured stories",
|
|
6031
|
+
style: {
|
|
6032
|
+
"--story-button-background": buttonBackground,
|
|
6033
|
+
"--story-button-text": props.node.buttonTextTransparency ? `color-mix(in srgb, ${props.node.buttonTextColor || "var(--primary-action-text)"}, transparent ${props.node.buttonTextTransparency}%)` : props.node.buttonTextColor || "var(--primary-action-text)",
|
|
6034
|
+
"--story-button-border": props.node.buttonBorderColor || "var(--neutral-border)",
|
|
6035
|
+
"--story-button-clip": props.node.buttonBackgroundClipText ? "text" : "border-box",
|
|
6036
|
+
"--story-inactive-button-background": props.node.buttonInactiveBackgroundColor || "var(--neutral)",
|
|
6037
|
+
"--story-inactive-button-text": props.node.buttonInactiveTextColor || "var(--neutral-text-base)",
|
|
6038
|
+
"--story-inactive-button-border": props.node.buttonInactiveBorderColor || "var(--neutral-border)",
|
|
6039
|
+
"--story-media-ratio": `${Math.min(3, Math.max(0.75, props.node.mediaColumnRatio ?? 1.45))}fr`,
|
|
6040
|
+
"--story-media-fit": ["cover", "contain", "fill", "none", "scale-down"].includes(props.node.mediaObjectFit || "") ? props.node.mediaObjectFit : "cover",
|
|
6041
|
+
"--story-button-padding": `${props.node.buttonPaddingTop ?? props.node.buttonPaddingAll ?? 12}px ${props.node.buttonPaddingRight ?? props.node.buttonPaddingAll ?? 16}px ${props.node.buttonPaddingBottom ?? props.node.buttonPaddingAll ?? 12}px ${props.node.buttonPaddingLeft ?? props.node.buttonPaddingAll ?? 16}px`,
|
|
6042
|
+
"--story-button-radius": `${Math.max(0, props.node.buttonBorderRadius ?? 9)}px`,
|
|
6043
|
+
"--story-button-border-width": `${Math.max(0, props.node.buttonBorderWidth ?? 1)}px`
|
|
6044
|
+
},
|
|
6045
|
+
children: [
|
|
6046
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("style", { children: `
|
|
6047
|
+
.story-accordion { display:grid; grid-template-columns:minmax(0,var(--story-media-ratio,1.45fr)) minmax(260px,1fr); gap:20px; align-items:stretch; width:100%; padding:16px; border-radius:14px; background:var(--neutral); }
|
|
6048
|
+
.story-accordion__media { position:relative; min-height:320px; overflow:hidden; border-radius:10px; background:var(--neutral-border); }
|
|
6049
|
+
.story-accordion__media > * { display:block; width:100%; height:100%; min-height:320px; }
|
|
6050
|
+
.story-accordion__media-image, .story-accordion__media-video { object-fit:var(--story-media-fit,cover); }
|
|
6051
|
+
.story-accordion__list { display:flex; flex-direction:column; justify-content:center; gap:10px; min-width:0; }
|
|
6052
|
+
.story-accordion__item { width:100%; min-height:54px; padding:var(--story-button-padding,12px 16px); border:var(--story-button-border-width,1px) solid var(--neutral-border); border-radius:var(--story-button-radius,9px); background:var(--neutral); color:var(--neutral-text-base); text-align:left; font:inherit; line-height:1.35; cursor:pointer; transition:background-color .18s ease,color .18s ease,border-color .18s ease; }
|
|
6053
|
+
.story-accordion__item:hover { border-color:var(--primary-action-fill); }
|
|
6054
|
+
.story-accordion__item[aria-pressed="true"] { border-color:var(--story-button-border,var(--neutral-border)); background:var(--story-button-background); color:var(--story-button-text); background-clip:var(--story-button-clip); -webkit-background-clip:var(--story-button-clip); }
|
|
6055
|
+
.story-accordion__item.is-inactive.is-custom { border-color:var(--story-inactive-button-border,var(--neutral-border)); background:var(--story-inactive-button-background); color:var(--story-inactive-button-text); }
|
|
6056
|
+
.story-accordion__item:focus-visible { outline:3px solid var(--primary-action-fill); outline-offset:2px; }
|
|
6057
|
+
@media(max-width:700px) { .story-accordion { grid-template-columns:minmax(0,1fr); gap:14px; padding:10px; } .story-accordion__media, .story-accordion__media > * { min-height:220px; } .story-accordion__list { gap:8px; } .story-accordion__item { min-height:48px; } }
|
|
6058
|
+
` }),
|
|
6059
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "story-accordion__media", children: activeItem ? renderMedia(activeItem) : null }),
|
|
6060
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "story-accordion__list", role: "group", "aria-label": "Choose a story", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
6061
|
+
"button",
|
|
6062
|
+
{
|
|
6063
|
+
type: "button",
|
|
6064
|
+
className: `story-accordion__item ${index === activeIndex ? "is-active" : "is-inactive"} ${props.node.buttonInactiveStyleEnabled && index !== activeIndex ? "is-custom" : ""}`,
|
|
6065
|
+
"aria-pressed": index === activeIndex,
|
|
6066
|
+
style: {
|
|
6067
|
+
borderWidth: `${Math.max(0, props.node.buttonBorderWidth ?? 1)}px`,
|
|
6068
|
+
borderStyle: "solid",
|
|
6069
|
+
borderColor: index === activeIndex || !props.node.buttonInactiveStyleEnabled ? props.node.buttonBorderColor || "var(--neutral-border)" : props.node.buttonInactiveBorderColor || "var(--neutral-border)",
|
|
6070
|
+
...index !== activeIndex && props.node.buttonInactiveStyleEnabled ? {
|
|
6071
|
+
background: props.node.buttonInactiveBackgroundColor || "var(--neutral)",
|
|
6072
|
+
color: props.node.buttonInactiveTextColor || "var(--neutral-text-base)"
|
|
6073
|
+
} : {}
|
|
6074
|
+
},
|
|
6075
|
+
onClick: () => setActiveIndex(index),
|
|
6076
|
+
children: item.title
|
|
6077
|
+
},
|
|
6078
|
+
item.id || `${item.title}-${index}`
|
|
6079
|
+
)) })
|
|
6080
|
+
]
|
|
6081
|
+
}
|
|
6082
|
+
);
|
|
6083
|
+
};
|
|
6084
|
+
MediaAccordionNodeClient_default = MediaAccordionNodeClient;
|
|
6085
|
+
}
|
|
6086
|
+
});
|
|
6087
|
+
|
|
5941
6088
|
// src/components/Pagination.tsx
|
|
5942
6089
|
var Pagination_exports = {};
|
|
5943
6090
|
__export(Pagination_exports, {
|
|
5944
6091
|
default: () => Pagination_default
|
|
5945
6092
|
});
|
|
5946
|
-
var
|
|
6093
|
+
var import_react60, import_jsx_runtime89, Pagination, Pagination_default;
|
|
5947
6094
|
var init_Pagination = __esm({
|
|
5948
6095
|
"src/components/Pagination.tsx"() {
|
|
5949
6096
|
"use strict";
|
|
5950
6097
|
"use client";
|
|
5951
|
-
|
|
6098
|
+
import_react60 = require("react");
|
|
5952
6099
|
init_OdataBuilder();
|
|
5953
6100
|
init_Icon();
|
|
5954
6101
|
init_StyleTypes();
|
|
5955
6102
|
init_InputControlType();
|
|
5956
6103
|
init_Hyperlink();
|
|
5957
|
-
|
|
6104
|
+
import_jsx_runtime89 = require("react/jsx-runtime");
|
|
5958
6105
|
Pagination = (props) => {
|
|
5959
6106
|
const { dataset, path, query, showPageSizeSelector = false, showJumpToPage = false } = props;
|
|
5960
|
-
const builder = (0,
|
|
6107
|
+
const builder = (0, import_react60.useMemo)(() => {
|
|
5961
6108
|
const b = new OdataBuilder(path);
|
|
5962
6109
|
if (query) b.setQuery(query);
|
|
5963
6110
|
return b;
|
|
@@ -5998,7 +6145,7 @@ var init_Pagination = __esm({
|
|
|
5998
6145
|
return range;
|
|
5999
6146
|
};
|
|
6000
6147
|
const paginationRange = getPaginationRange();
|
|
6001
|
-
const PageButton = ({ page, children }) => /* @__PURE__ */ (0,
|
|
6148
|
+
const PageButton = ({ page, children }) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
6002
6149
|
Hyperlink,
|
|
6003
6150
|
{
|
|
6004
6151
|
linkType: "Link" /* Link */,
|
|
@@ -6013,9 +6160,9 @@ var init_Pagination = __esm({
|
|
|
6013
6160
|
);
|
|
6014
6161
|
const NavigationButton = ({ page, disabled, children }) => {
|
|
6015
6162
|
if (disabled) {
|
|
6016
|
-
return /* @__PURE__ */ (0,
|
|
6163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center px-2 md:px-3 border bg-neutral-base cursor-not-allowed", children });
|
|
6017
6164
|
}
|
|
6018
|
-
return /* @__PURE__ */ (0,
|
|
6165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
6019
6166
|
Hyperlink,
|
|
6020
6167
|
{
|
|
6021
6168
|
className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center px-2 md:px-3 border transition-colors duration-150",
|
|
@@ -6025,35 +6172,35 @@ var init_Pagination = __esm({
|
|
|
6025
6172
|
);
|
|
6026
6173
|
};
|
|
6027
6174
|
if (totalPages <= 1 && totalItems === 0) return null;
|
|
6028
|
-
return /* @__PURE__ */ (0,
|
|
6029
|
-
/* @__PURE__ */ (0,
|
|
6030
|
-
/* @__PURE__ */ (0,
|
|
6175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "py-6 border-t mt-6", children: [
|
|
6176
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "flex flex-col sm:flex-row items-center justify-between gap-4", children: [
|
|
6177
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "text-sm", children: [
|
|
6031
6178
|
"Showing ",
|
|
6032
|
-
/* @__PURE__ */ (0,
|
|
6179
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("span", { className: "font-semibold", children: [
|
|
6033
6180
|
startItem,
|
|
6034
6181
|
"-",
|
|
6035
6182
|
endItem
|
|
6036
6183
|
] }),
|
|
6037
6184
|
" ",
|
|
6038
6185
|
"out of ",
|
|
6039
|
-
/* @__PURE__ */ (0,
|
|
6186
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "font-semibold", children: totalItems.toLocaleString() }),
|
|
6040
6187
|
" results"
|
|
6041
6188
|
] }),
|
|
6042
|
-
totalPages > 1 && /* @__PURE__ */ (0,
|
|
6043
|
-
/* @__PURE__ */ (0,
|
|
6189
|
+
totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "flex items-center space-x-1", children: [
|
|
6190
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
6044
6191
|
NavigationButton,
|
|
6045
6192
|
{
|
|
6046
6193
|
page: activePageNumber - 1,
|
|
6047
6194
|
disabled: activePageNumber === 1,
|
|
6048
6195
|
children: [
|
|
6049
|
-
/* @__PURE__ */ (0,
|
|
6050
|
-
/* @__PURE__ */ (0,
|
|
6196
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Icon_default, { name: "chevronLeft", className: "w-4 h-4 mr-1" }) }),
|
|
6197
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "text-sm", children: "Prev" })
|
|
6051
6198
|
]
|
|
6052
6199
|
}
|
|
6053
6200
|
),
|
|
6054
6201
|
paginationRange.map((item, index) => {
|
|
6055
6202
|
if (item === "...") {
|
|
6056
|
-
return /* @__PURE__ */ (0,
|
|
6203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
6057
6204
|
"span",
|
|
6058
6205
|
{
|
|
6059
6206
|
className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center text-gray-500",
|
|
@@ -6063,23 +6210,23 @@ var init_Pagination = __esm({
|
|
|
6063
6210
|
);
|
|
6064
6211
|
}
|
|
6065
6212
|
const page = item;
|
|
6066
|
-
return /* @__PURE__ */ (0,
|
|
6213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(PageButton, { page, children: page }, page);
|
|
6067
6214
|
}),
|
|
6068
|
-
/* @__PURE__ */ (0,
|
|
6215
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
6069
6216
|
NavigationButton,
|
|
6070
6217
|
{
|
|
6071
6218
|
page: activePageNumber + 1,
|
|
6072
6219
|
disabled: activePageNumber === totalPages,
|
|
6073
6220
|
children: [
|
|
6074
|
-
/* @__PURE__ */ (0,
|
|
6075
|
-
/* @__PURE__ */ (0,
|
|
6221
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "text-sm", children: "Next" }),
|
|
6222
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Icon_default, { name: "chevronRight", className: "w-4 h-4 ml-1" }) })
|
|
6076
6223
|
]
|
|
6077
6224
|
}
|
|
6078
6225
|
)
|
|
6079
6226
|
] }),
|
|
6080
|
-
showJumpToPage && totalPages > 5 && /* @__PURE__ */ (0,
|
|
6081
|
-
/* @__PURE__ */ (0,
|
|
6082
|
-
/* @__PURE__ */ (0,
|
|
6227
|
+
showJumpToPage && totalPages > 5 && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
6228
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "text-sm", children: "Go to:" }),
|
|
6229
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
6083
6230
|
"input",
|
|
6084
6231
|
{
|
|
6085
6232
|
type: "number",
|
|
@@ -6100,9 +6247,9 @@ var init_Pagination = __esm({
|
|
|
6100
6247
|
) })
|
|
6101
6248
|
] })
|
|
6102
6249
|
] }),
|
|
6103
|
-
showPageSizeSelector && /* @__PURE__ */ (0,
|
|
6104
|
-
/* @__PURE__ */ (0,
|
|
6105
|
-
/* @__PURE__ */ (0,
|
|
6250
|
+
showPageSizeSelector && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "mt-4 pt-4 border-t bg-default", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "flex items-center justify-center space-x-2", children: [
|
|
6251
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "text-sm", children: "Show:" }),
|
|
6252
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "flex space-x-1", children: [10, 25, 50, 100].map((size) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
6106
6253
|
Hyperlink,
|
|
6107
6254
|
{
|
|
6108
6255
|
className: `
|
|
@@ -6114,7 +6261,7 @@ var init_Pagination = __esm({
|
|
|
6114
6261
|
},
|
|
6115
6262
|
size
|
|
6116
6263
|
)) }),
|
|
6117
|
-
/* @__PURE__ */ (0,
|
|
6264
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "text-sm", children: "per page" })
|
|
6118
6265
|
] }) })
|
|
6119
6266
|
] });
|
|
6120
6267
|
};
|
|
@@ -6127,16 +6274,16 @@ var DataBindingControls_exports = {};
|
|
|
6127
6274
|
__export(DataBindingControls_exports, {
|
|
6128
6275
|
default: () => DataBindingControls_default
|
|
6129
6276
|
});
|
|
6130
|
-
var
|
|
6277
|
+
var import_react61, import_navigation, import_jsx_runtime90, humanize, escapeODataString, parseFacetSelections, buildFacetFilter, parseODataSearch, SearchIcon, ResetIcon, FilterSlidersIcon, ChevronDownIcon, CheckIcon, CloseIcon, MapPinIcon, BriefcaseIcon, FileTextIcon, TagIcon, getCategoryIcon, normalizeSortOption, DataBindingControls, DataBindingControls_default;
|
|
6131
6278
|
var init_DataBindingControls = __esm({
|
|
6132
6279
|
"src/components/pageRenderingEngine/nodes/DataBindingControls.tsx"() {
|
|
6133
6280
|
"use strict";
|
|
6134
6281
|
"use client";
|
|
6135
|
-
|
|
6282
|
+
import_react61 = require("react");
|
|
6136
6283
|
import_navigation = require("next/navigation");
|
|
6137
6284
|
init_Button();
|
|
6138
6285
|
init_StyleTypes();
|
|
6139
|
-
|
|
6286
|
+
import_jsx_runtime90 = require("react/jsx-runtime");
|
|
6140
6287
|
humanize = (value) => value.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").trim();
|
|
6141
6288
|
escapeODataString = (value) => value.replace(/'/g, "''");
|
|
6142
6289
|
parseFacetSelections = (filter) => {
|
|
@@ -6159,7 +6306,7 @@ var init_DataBindingControls = __esm({
|
|
|
6159
6306
|
}
|
|
6160
6307
|
return trimmedValue;
|
|
6161
6308
|
};
|
|
6162
|
-
SearchIcon = ({ className = "" }) => /* @__PURE__ */ (0,
|
|
6309
|
+
SearchIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6163
6310
|
"svg",
|
|
6164
6311
|
{
|
|
6165
6312
|
"aria-hidden": "true",
|
|
@@ -6169,12 +6316,12 @@ var init_DataBindingControls = __esm({
|
|
|
6169
6316
|
stroke: "currentColor",
|
|
6170
6317
|
strokeWidth: "2",
|
|
6171
6318
|
children: [
|
|
6172
|
-
/* @__PURE__ */ (0,
|
|
6173
|
-
/* @__PURE__ */ (0,
|
|
6319
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("circle", { cx: "11", cy: "11", r: "7" }),
|
|
6320
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("path", { strokeLinecap: "round", d: "m20 20-4-4" })
|
|
6174
6321
|
]
|
|
6175
6322
|
}
|
|
6176
6323
|
);
|
|
6177
|
-
ResetIcon = ({ className = "" }) => /* @__PURE__ */ (0,
|
|
6324
|
+
ResetIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6178
6325
|
"svg",
|
|
6179
6326
|
{
|
|
6180
6327
|
"aria-hidden": "true",
|
|
@@ -6184,8 +6331,8 @@ var init_DataBindingControls = __esm({
|
|
|
6184
6331
|
stroke: "currentColor",
|
|
6185
6332
|
strokeWidth: "2",
|
|
6186
6333
|
children: [
|
|
6187
|
-
/* @__PURE__ */ (0,
|
|
6188
|
-
/* @__PURE__ */ (0,
|
|
6334
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 4v6h6" }),
|
|
6335
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6189
6336
|
"path",
|
|
6190
6337
|
{
|
|
6191
6338
|
strokeLinecap: "round",
|
|
@@ -6196,7 +6343,7 @@ var init_DataBindingControls = __esm({
|
|
|
6196
6343
|
]
|
|
6197
6344
|
}
|
|
6198
6345
|
);
|
|
6199
|
-
FilterSlidersIcon = ({ className = "" }) => /* @__PURE__ */ (0,
|
|
6346
|
+
FilterSlidersIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6200
6347
|
"svg",
|
|
6201
6348
|
{
|
|
6202
6349
|
"aria-hidden": "true",
|
|
@@ -6206,14 +6353,14 @@ var init_DataBindingControls = __esm({
|
|
|
6206
6353
|
stroke: "currentColor",
|
|
6207
6354
|
strokeWidth: "2",
|
|
6208
6355
|
children: [
|
|
6209
|
-
/* @__PURE__ */ (0,
|
|
6210
|
-
/* @__PURE__ */ (0,
|
|
6211
|
-
/* @__PURE__ */ (0,
|
|
6212
|
-
/* @__PURE__ */ (0,
|
|
6356
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 4h18M3 12h18M3 20h18" }),
|
|
6357
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("circle", { cx: "8", cy: "4", r: "2", fill: "currentColor" }),
|
|
6358
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("circle", { cx: "16", cy: "12", r: "2", fill: "currentColor" }),
|
|
6359
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("circle", { cx: "10", cy: "20", r: "2", fill: "currentColor" })
|
|
6213
6360
|
]
|
|
6214
6361
|
}
|
|
6215
6362
|
);
|
|
6216
|
-
ChevronDownIcon = ({ className = "" }) => /* @__PURE__ */ (0,
|
|
6363
|
+
ChevronDownIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6217
6364
|
"svg",
|
|
6218
6365
|
{
|
|
6219
6366
|
"aria-hidden": "true",
|
|
@@ -6222,10 +6369,10 @@ var init_DataBindingControls = __esm({
|
|
|
6222
6369
|
viewBox: "0 0 24 24",
|
|
6223
6370
|
stroke: "currentColor",
|
|
6224
6371
|
strokeWidth: "2",
|
|
6225
|
-
children: /* @__PURE__ */ (0,
|
|
6372
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m19 9-7 7-7-7" })
|
|
6226
6373
|
}
|
|
6227
6374
|
);
|
|
6228
|
-
CheckIcon = ({ className = "" }) => /* @__PURE__ */ (0,
|
|
6375
|
+
CheckIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6229
6376
|
"svg",
|
|
6230
6377
|
{
|
|
6231
6378
|
"aria-hidden": "true",
|
|
@@ -6234,10 +6381,10 @@ var init_DataBindingControls = __esm({
|
|
|
6234
6381
|
viewBox: "0 0 24 24",
|
|
6235
6382
|
stroke: "currentColor",
|
|
6236
6383
|
strokeWidth: "2.5",
|
|
6237
|
-
children: /* @__PURE__ */ (0,
|
|
6384
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" })
|
|
6238
6385
|
}
|
|
6239
6386
|
);
|
|
6240
|
-
CloseIcon = ({ className = "" }) => /* @__PURE__ */ (0,
|
|
6387
|
+
CloseIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6241
6388
|
"svg",
|
|
6242
6389
|
{
|
|
6243
6390
|
"aria-hidden": "true",
|
|
@@ -6246,10 +6393,10 @@ var init_DataBindingControls = __esm({
|
|
|
6246
6393
|
viewBox: "0 0 24 24",
|
|
6247
6394
|
stroke: "currentColor",
|
|
6248
6395
|
strokeWidth: "2",
|
|
6249
|
-
children: /* @__PURE__ */ (0,
|
|
6396
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
6250
6397
|
}
|
|
6251
6398
|
);
|
|
6252
|
-
MapPinIcon = ({ className = "" }) => /* @__PURE__ */ (0,
|
|
6399
|
+
MapPinIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6253
6400
|
"svg",
|
|
6254
6401
|
{
|
|
6255
6402
|
"aria-hidden": "true",
|
|
@@ -6259,7 +6406,7 @@ var init_DataBindingControls = __esm({
|
|
|
6259
6406
|
stroke: "currentColor",
|
|
6260
6407
|
strokeWidth: "2",
|
|
6261
6408
|
children: [
|
|
6262
|
-
/* @__PURE__ */ (0,
|
|
6409
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6263
6410
|
"path",
|
|
6264
6411
|
{
|
|
6265
6412
|
strokeLinecap: "round",
|
|
@@ -6267,7 +6414,7 @@ var init_DataBindingControls = __esm({
|
|
|
6267
6414
|
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"
|
|
6268
6415
|
}
|
|
6269
6416
|
),
|
|
6270
|
-
/* @__PURE__ */ (0,
|
|
6417
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6271
6418
|
"path",
|
|
6272
6419
|
{
|
|
6273
6420
|
strokeLinecap: "round",
|
|
@@ -6278,7 +6425,7 @@ var init_DataBindingControls = __esm({
|
|
|
6278
6425
|
]
|
|
6279
6426
|
}
|
|
6280
6427
|
);
|
|
6281
|
-
BriefcaseIcon = ({ className = "" }) => /* @__PURE__ */ (0,
|
|
6428
|
+
BriefcaseIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6282
6429
|
"svg",
|
|
6283
6430
|
{
|
|
6284
6431
|
"aria-hidden": "true",
|
|
@@ -6287,7 +6434,7 @@ var init_DataBindingControls = __esm({
|
|
|
6287
6434
|
viewBox: "0 0 24 24",
|
|
6288
6435
|
stroke: "currentColor",
|
|
6289
6436
|
strokeWidth: "2",
|
|
6290
|
-
children: /* @__PURE__ */ (0,
|
|
6437
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6291
6438
|
"path",
|
|
6292
6439
|
{
|
|
6293
6440
|
strokeLinecap: "round",
|
|
@@ -6297,7 +6444,7 @@ var init_DataBindingControls = __esm({
|
|
|
6297
6444
|
)
|
|
6298
6445
|
}
|
|
6299
6446
|
);
|
|
6300
|
-
FileTextIcon = ({ className = "" }) => /* @__PURE__ */ (0,
|
|
6447
|
+
FileTextIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6301
6448
|
"svg",
|
|
6302
6449
|
{
|
|
6303
6450
|
"aria-hidden": "true",
|
|
@@ -6306,7 +6453,7 @@ var init_DataBindingControls = __esm({
|
|
|
6306
6453
|
viewBox: "0 0 24 24",
|
|
6307
6454
|
stroke: "currentColor",
|
|
6308
6455
|
strokeWidth: "2",
|
|
6309
|
-
children: /* @__PURE__ */ (0,
|
|
6456
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6310
6457
|
"path",
|
|
6311
6458
|
{
|
|
6312
6459
|
strokeLinecap: "round",
|
|
@@ -6316,7 +6463,7 @@ var init_DataBindingControls = __esm({
|
|
|
6316
6463
|
)
|
|
6317
6464
|
}
|
|
6318
6465
|
);
|
|
6319
|
-
TagIcon = ({ className = "" }) => /* @__PURE__ */ (0,
|
|
6466
|
+
TagIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6320
6467
|
"svg",
|
|
6321
6468
|
{
|
|
6322
6469
|
"aria-hidden": "true",
|
|
@@ -6325,7 +6472,7 @@ var init_DataBindingControls = __esm({
|
|
|
6325
6472
|
viewBox: "0 0 24 24",
|
|
6326
6473
|
stroke: "currentColor",
|
|
6327
6474
|
strokeWidth: "2",
|
|
6328
|
-
children: /* @__PURE__ */ (0,
|
|
6475
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6329
6476
|
"path",
|
|
6330
6477
|
{
|
|
6331
6478
|
strokeLinecap: "round",
|
|
@@ -6338,15 +6485,15 @@ var init_DataBindingControls = __esm({
|
|
|
6338
6485
|
getCategoryIcon = (category) => {
|
|
6339
6486
|
const lower = category.toLowerCase();
|
|
6340
6487
|
if (lower.includes("location") || lower.includes("city") || lower.includes("country") || lower.includes("state") || lower.includes("address")) {
|
|
6341
|
-
return /* @__PURE__ */ (0,
|
|
6488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(MapPinIcon, { className: "h-4 w-4" });
|
|
6342
6489
|
}
|
|
6343
6490
|
if (lower.includes("type") || lower.includes("work") || lower.includes("employment") || lower.includes("experience")) {
|
|
6344
|
-
return /* @__PURE__ */ (0,
|
|
6491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(BriefcaseIcon, { className: "h-4 w-4" });
|
|
6345
6492
|
}
|
|
6346
6493
|
if (lower.includes("department") || lower.includes("category") || lower.includes("role") || lower.includes("industry")) {
|
|
6347
|
-
return /* @__PURE__ */ (0,
|
|
6494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(FileTextIcon, { className: "h-4 w-4" });
|
|
6348
6495
|
}
|
|
6349
|
-
return /* @__PURE__ */ (0,
|
|
6496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(TagIcon, { className: "h-4 w-4" });
|
|
6350
6497
|
};
|
|
6351
6498
|
normalizeSortOption = (option) => {
|
|
6352
6499
|
const direction = option.direction.trim();
|
|
@@ -6368,13 +6515,13 @@ var init_DataBindingControls = __esm({
|
|
|
6368
6515
|
}) => {
|
|
6369
6516
|
const router = (0, import_navigation.useRouter)();
|
|
6370
6517
|
const searchParams = (0, import_navigation.useSearchParams)();
|
|
6371
|
-
const [collapsedCategories, setCollapsedCategories] = (0,
|
|
6372
|
-
const [isSortOpen, setIsSortOpen] = (0,
|
|
6373
|
-
const [isMobileFiltersOpen, setIsMobileFiltersOpen] = (0,
|
|
6374
|
-
const [facetCategorySearch, setFacetCategorySearch] = (0,
|
|
6375
|
-
const desktopSortDropdownRef = (0,
|
|
6376
|
-
const mobileSortDropdownRef = (0,
|
|
6377
|
-
(0,
|
|
6518
|
+
const [collapsedCategories, setCollapsedCategories] = (0, import_react61.useState)({});
|
|
6519
|
+
const [isSortOpen, setIsSortOpen] = (0, import_react61.useState)(false);
|
|
6520
|
+
const [isMobileFiltersOpen, setIsMobileFiltersOpen] = (0, import_react61.useState)(false);
|
|
6521
|
+
const [facetCategorySearch, setFacetCategorySearch] = (0, import_react61.useState)({});
|
|
6522
|
+
const desktopSortDropdownRef = (0, import_react61.useRef)(null);
|
|
6523
|
+
const mobileSortDropdownRef = (0, import_react61.useRef)(null);
|
|
6524
|
+
(0, import_react61.useEffect)(() => {
|
|
6378
6525
|
const handleClickOutside = (event) => {
|
|
6379
6526
|
const target = event.target;
|
|
6380
6527
|
const clickedInsideDesktop = desktopSortDropdownRef.current?.contains(target);
|
|
@@ -6400,15 +6547,15 @@ var init_DataBindingControls = __esm({
|
|
|
6400
6547
|
const currentSearch = parseODataSearch(
|
|
6401
6548
|
searchParamsSearch !== void 0 && searchParamsSearch !== null ? searchParamsSearch : query?.["$search"]
|
|
6402
6549
|
);
|
|
6403
|
-
const [searchText, setSearchText] = (0,
|
|
6404
|
-
(0,
|
|
6550
|
+
const [searchText, setSearchText] = (0, import_react61.useState)(currentSearch);
|
|
6551
|
+
(0, import_react61.useEffect)(() => {
|
|
6405
6552
|
setSearchText(currentSearch);
|
|
6406
6553
|
}, [currentSearch]);
|
|
6407
|
-
const selectedFacetValues = (0,
|
|
6554
|
+
const selectedFacetValues = (0, import_react61.useMemo)(
|
|
6408
6555
|
() => parseFacetSelections(currentFilter),
|
|
6409
6556
|
[currentFilter]
|
|
6410
6557
|
);
|
|
6411
|
-
(0,
|
|
6558
|
+
(0, import_react61.useEffect)(() => {
|
|
6412
6559
|
if (isMobileFiltersOpen) {
|
|
6413
6560
|
document.body.style.overflow = "hidden";
|
|
6414
6561
|
} else {
|
|
@@ -6418,7 +6565,7 @@ var init_DataBindingControls = __esm({
|
|
|
6418
6565
|
document.body.style.overflow = "";
|
|
6419
6566
|
};
|
|
6420
6567
|
}, [isMobileFiltersOpen]);
|
|
6421
|
-
const activeFacets = (0,
|
|
6568
|
+
const activeFacets = (0, import_react61.useMemo)(() => {
|
|
6422
6569
|
const facetMap = /* @__PURE__ */ new Map();
|
|
6423
6570
|
if (facets) {
|
|
6424
6571
|
Object.entries(facets).forEach(([field, values]) => {
|
|
@@ -6443,11 +6590,11 @@ var init_DataBindingControls = __esm({
|
|
|
6443
6590
|
});
|
|
6444
6591
|
return Array.from(facetMap.entries());
|
|
6445
6592
|
}, [facets, selectedFacetValues]);
|
|
6446
|
-
const normalizedSortOptions = (0,
|
|
6593
|
+
const normalizedSortOptions = (0, import_react61.useMemo)(
|
|
6447
6594
|
() => (sortOptions ?? []).filter((option) => option?.name && option?.direction).map(normalizeSortOption).filter((option) => option.value),
|
|
6448
6595
|
[sortOptions]
|
|
6449
6596
|
);
|
|
6450
|
-
const selectedSortOption = (0,
|
|
6597
|
+
const selectedSortOption = (0, import_react61.useMemo)(() => {
|
|
6451
6598
|
if (!normalizedSortOptions.length) return null;
|
|
6452
6599
|
const trimmedCurrentSort = currentSort.trim().toLowerCase();
|
|
6453
6600
|
if (!trimmedCurrentSort) return normalizedSortOptions[0];
|
|
@@ -6456,7 +6603,7 @@ var init_DataBindingControls = __esm({
|
|
|
6456
6603
|
) || normalizedSortOptions[0];
|
|
6457
6604
|
}, [normalizedSortOptions, currentSort]);
|
|
6458
6605
|
const selectedSortLabel = selectedSortOption?.label || "";
|
|
6459
|
-
const getQueryUrl = (0,
|
|
6606
|
+
const getQueryUrl = (0, import_react61.useCallback)(
|
|
6460
6607
|
(updates) => {
|
|
6461
6608
|
const initialParams = searchParams ? searchParams.toString() : "";
|
|
6462
6609
|
const params = new URLSearchParams(initialParams || query || {});
|
|
@@ -6474,7 +6621,7 @@ var init_DataBindingControls = __esm({
|
|
|
6474
6621
|
},
|
|
6475
6622
|
[path, query, searchParams]
|
|
6476
6623
|
);
|
|
6477
|
-
const navigateWithoutReload = (0,
|
|
6624
|
+
const navigateWithoutReload = (0, import_react61.useCallback)(
|
|
6478
6625
|
(url) => {
|
|
6479
6626
|
if (typeof window !== "undefined") {
|
|
6480
6627
|
const targetUrl = new URL(url, window.location.origin);
|
|
@@ -6486,7 +6633,7 @@ var init_DataBindingControls = __esm({
|
|
|
6486
6633
|
},
|
|
6487
6634
|
[router]
|
|
6488
6635
|
);
|
|
6489
|
-
const handleSelectSort = (0,
|
|
6636
|
+
const handleSelectSort = (0, import_react61.useCallback)(
|
|
6490
6637
|
(sortValue) => {
|
|
6491
6638
|
setIsSortOpen(false);
|
|
6492
6639
|
navigateWithoutReload(
|
|
@@ -6526,7 +6673,7 @@ var init_DataBindingControls = __esm({
|
|
|
6526
6673
|
})
|
|
6527
6674
|
);
|
|
6528
6675
|
};
|
|
6529
|
-
const handleSearch = (0,
|
|
6676
|
+
const handleSearch = (0, import_react61.useCallback)(async () => {
|
|
6530
6677
|
const trimmedSearchText = searchText.trim();
|
|
6531
6678
|
if (trimmedSearchText === currentSearch.trim()) {
|
|
6532
6679
|
return { isSuccessful: true };
|
|
@@ -6538,7 +6685,7 @@ var init_DataBindingControls = __esm({
|
|
|
6538
6685
|
);
|
|
6539
6686
|
return { isSuccessful: true };
|
|
6540
6687
|
}, [currentSearch, getQueryUrl, navigateWithoutReload, searchText]);
|
|
6541
|
-
const handleClearAll = (0,
|
|
6688
|
+
const handleClearAll = (0, import_react61.useCallback)(async () => {
|
|
6542
6689
|
navigateWithoutReload(
|
|
6543
6690
|
getQueryUrl({
|
|
6544
6691
|
$filter: void 0,
|
|
@@ -6561,9 +6708,9 @@ var init_DataBindingControls = __esm({
|
|
|
6561
6708
|
if (!shouldShowToolbar && !shouldShowFacets) {
|
|
6562
6709
|
return null;
|
|
6563
6710
|
}
|
|
6564
|
-
const renderFacetItems = (field, values) => /* @__PURE__ */ (0,
|
|
6711
|
+
const renderFacetItems = (field, values) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "flex flex-col gap-1 pt-1 pb-1", children: values.map((facet) => {
|
|
6565
6712
|
const isSelected = selectedFacetValues.get(field) === facet.value;
|
|
6566
|
-
return /* @__PURE__ */ (0,
|
|
6713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6567
6714
|
"button",
|
|
6568
6715
|
{
|
|
6569
6716
|
type: "button",
|
|
@@ -6571,17 +6718,17 @@ var init_DataBindingControls = __esm({
|
|
|
6571
6718
|
"aria-pressed": isSelected,
|
|
6572
6719
|
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"}`,
|
|
6573
6720
|
children: [
|
|
6574
|
-
/* @__PURE__ */ (0,
|
|
6575
|
-
/* @__PURE__ */ (0,
|
|
6721
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex min-w-0 items-center gap-2.5", children: [
|
|
6722
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6576
6723
|
"span",
|
|
6577
6724
|
{
|
|
6578
6725
|
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"}`,
|
|
6579
|
-
children: isSelected && /* @__PURE__ */ (0,
|
|
6726
|
+
children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(CheckIcon, { className: "h-3 w-3" })
|
|
6580
6727
|
}
|
|
6581
6728
|
),
|
|
6582
|
-
/* @__PURE__ */ (0,
|
|
6729
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "leading-snug break-words", children: facet.value })
|
|
6583
6730
|
] }),
|
|
6584
|
-
/* @__PURE__ */ (0,
|
|
6731
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6585
6732
|
"span",
|
|
6586
6733
|
{
|
|
6587
6734
|
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"}`,
|
|
@@ -6593,14 +6740,14 @@ var init_DataBindingControls = __esm({
|
|
|
6593
6740
|
`${field}-${facet.value}`
|
|
6594
6741
|
);
|
|
6595
6742
|
}) });
|
|
6596
|
-
return /* @__PURE__ */ (0,
|
|
6743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6597
6744
|
"div",
|
|
6598
6745
|
{
|
|
6599
6746
|
className: mode === "toolbar" ? "my-4 sm:my-6" : "flex flex-col rounded-md border border-neutral-soft bg-default p-4 shadow-sm",
|
|
6600
6747
|
children: [
|
|
6601
|
-
shouldShowToolbar && /* @__PURE__ */ (0,
|
|
6602
|
-
/* @__PURE__ */ (0,
|
|
6603
|
-
showSearchBar && /* @__PURE__ */ (0,
|
|
6748
|
+
shouldShowToolbar && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
6749
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "hidden lg:flex lg:items-center lg:justify-between lg:gap-4", children: [
|
|
6750
|
+
showSearchBar && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6604
6751
|
"form",
|
|
6605
6752
|
{
|
|
6606
6753
|
role: "search",
|
|
@@ -6610,9 +6757,9 @@ var init_DataBindingControls = __esm({
|
|
|
6610
6757
|
void handleSearch();
|
|
6611
6758
|
},
|
|
6612
6759
|
children: [
|
|
6613
|
-
/* @__PURE__ */ (0,
|
|
6614
|
-
/* @__PURE__ */ (0,
|
|
6615
|
-
/* @__PURE__ */ (0,
|
|
6760
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "relative min-w-0 flex-1", children: [
|
|
6761
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.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" }),
|
|
6762
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6616
6763
|
"input",
|
|
6617
6764
|
{
|
|
6618
6765
|
type: "text",
|
|
@@ -6624,23 +6771,23 @@ var init_DataBindingControls = __esm({
|
|
|
6624
6771
|
}
|
|
6625
6772
|
)
|
|
6626
6773
|
] }),
|
|
6627
|
-
/* @__PURE__ */ (0,
|
|
6774
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6628
6775
|
Button_default,
|
|
6629
6776
|
{
|
|
6630
6777
|
ButtonType: "Primary" /* Solid */,
|
|
6631
6778
|
onClick: handleSearch,
|
|
6632
6779
|
className: "!h-10 !rounded-md !px-5 !py-0 flex items-center justify-center gap-1.5 shrink-0",
|
|
6633
6780
|
children: [
|
|
6634
|
-
/* @__PURE__ */ (0,
|
|
6635
|
-
/* @__PURE__ */ (0,
|
|
6781
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(SearchIcon, { className: "h-4 w-4" }),
|
|
6782
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { children: "Search" })
|
|
6636
6783
|
]
|
|
6637
6784
|
}
|
|
6638
6785
|
)
|
|
6639
6786
|
]
|
|
6640
6787
|
}
|
|
6641
6788
|
),
|
|
6642
|
-
hasSortControls && /* @__PURE__ */ (0,
|
|
6643
|
-
/* @__PURE__ */ (0,
|
|
6789
|
+
hasSortControls && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "relative shrink-0", ref: desktopSortDropdownRef, children: [
|
|
6790
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6644
6791
|
"button",
|
|
6645
6792
|
{
|
|
6646
6793
|
type: "button",
|
|
@@ -6648,11 +6795,11 @@ var init_DataBindingControls = __esm({
|
|
|
6648
6795
|
"aria-expanded": isSortOpen,
|
|
6649
6796
|
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",
|
|
6650
6797
|
children: [
|
|
6651
|
-
/* @__PURE__ */ (0,
|
|
6652
|
-
/* @__PURE__ */ (0,
|
|
6653
|
-
/* @__PURE__ */ (0,
|
|
6798
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("span", { className: "whitespace-nowrap", children: [
|
|
6799
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "opacity-70", children: "Sort by: " }),
|
|
6800
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "font-semibold", children: selectedSortLabel })
|
|
6654
6801
|
] }),
|
|
6655
|
-
/* @__PURE__ */ (0,
|
|
6802
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6656
6803
|
ChevronDownIcon,
|
|
6657
6804
|
{
|
|
6658
6805
|
className: `h-4 w-4 shrink-0 transition-transform duration-200 ${isSortOpen ? "rotate-180" : ""}`
|
|
@@ -6661,17 +6808,17 @@ var init_DataBindingControls = __esm({
|
|
|
6661
6808
|
]
|
|
6662
6809
|
}
|
|
6663
6810
|
),
|
|
6664
|
-
isSortOpen && /* @__PURE__ */ (0,
|
|
6811
|
+
isSortOpen && /* @__PURE__ */ (0, import_jsx_runtime90.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) => {
|
|
6665
6812
|
const isSelected = selectedSortOption?.value === option.value;
|
|
6666
|
-
return /* @__PURE__ */ (0,
|
|
6813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6667
6814
|
"button",
|
|
6668
6815
|
{
|
|
6669
6816
|
type: "button",
|
|
6670
6817
|
onClick: () => handleSelectSort(option.value),
|
|
6671
6818
|
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"}`,
|
|
6672
6819
|
children: [
|
|
6673
|
-
/* @__PURE__ */ (0,
|
|
6674
|
-
isSelected && /* @__PURE__ */ (0,
|
|
6820
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "whitespace-nowrap", children: option.label }),
|
|
6821
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(CheckIcon, { className: "h-4 w-4 shrink-0" })
|
|
6675
6822
|
]
|
|
6676
6823
|
},
|
|
6677
6824
|
option.value
|
|
@@ -6679,8 +6826,8 @@ var init_DataBindingControls = __esm({
|
|
|
6679
6826
|
}) })
|
|
6680
6827
|
] })
|
|
6681
6828
|
] }),
|
|
6682
|
-
/* @__PURE__ */ (0,
|
|
6683
|
-
showSearchBar && /* @__PURE__ */ (0,
|
|
6829
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex flex-col gap-2.5 lg:hidden", children: [
|
|
6830
|
+
showSearchBar && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6684
6831
|
"form",
|
|
6685
6832
|
{
|
|
6686
6833
|
role: "search",
|
|
@@ -6690,8 +6837,8 @@ var init_DataBindingControls = __esm({
|
|
|
6690
6837
|
void handleSearch();
|
|
6691
6838
|
},
|
|
6692
6839
|
children: [
|
|
6693
|
-
/* @__PURE__ */ (0,
|
|
6694
|
-
/* @__PURE__ */ (0,
|
|
6840
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.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" }),
|
|
6841
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6695
6842
|
"input",
|
|
6696
6843
|
{
|
|
6697
6844
|
type: "text",
|
|
@@ -6705,28 +6852,28 @@ var init_DataBindingControls = __esm({
|
|
|
6705
6852
|
]
|
|
6706
6853
|
}
|
|
6707
6854
|
),
|
|
6708
|
-
/* @__PURE__ */ (0,
|
|
6709
|
-
showFacets && /* @__PURE__ */ (0,
|
|
6855
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex items-center justify-between gap-2.5 pt-0.5", children: [
|
|
6856
|
+
showFacets && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6710
6857
|
"button",
|
|
6711
6858
|
{
|
|
6712
6859
|
type: "button",
|
|
6713
6860
|
onClick: () => setIsMobileFiltersOpen(true),
|
|
6714
6861
|
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",
|
|
6715
6862
|
children: [
|
|
6716
|
-
/* @__PURE__ */ (0,
|
|
6717
|
-
/* @__PURE__ */ (0,
|
|
6863
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(FilterSlidersIcon, { className: "h-4 w-4" }),
|
|
6864
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("span", { children: [
|
|
6718
6865
|
"Filters",
|
|
6719
6866
|
selectedFacetCount > 0 ? ` (${selectedFacetCount})` : ""
|
|
6720
6867
|
] }),
|
|
6721
|
-
selectedFacetCount > 0 && /* @__PURE__ */ (0,
|
|
6722
|
-
/* @__PURE__ */ (0,
|
|
6723
|
-
/* @__PURE__ */ (0,
|
|
6868
|
+
selectedFacetCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("span", { className: "relative flex h-2 w-2", children: [
|
|
6869
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "animate-ping absolute inline-flex h-full w-full rounded-full bg-primary-base opacity-75" }),
|
|
6870
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "relative inline-flex rounded-full h-2 w-2 bg-primary-base" })
|
|
6724
6871
|
] })
|
|
6725
6872
|
]
|
|
6726
6873
|
}
|
|
6727
6874
|
),
|
|
6728
|
-
hasSortControls && /* @__PURE__ */ (0,
|
|
6729
|
-
/* @__PURE__ */ (0,
|
|
6875
|
+
hasSortControls && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "relative shrink-0 ml-auto", ref: mobileSortDropdownRef, children: [
|
|
6876
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6730
6877
|
"button",
|
|
6731
6878
|
{
|
|
6732
6879
|
type: "button",
|
|
@@ -6734,8 +6881,8 @@ var init_DataBindingControls = __esm({
|
|
|
6734
6881
|
"aria-expanded": isSortOpen,
|
|
6735
6882
|
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",
|
|
6736
6883
|
children: [
|
|
6737
|
-
/* @__PURE__ */ (0,
|
|
6738
|
-
/* @__PURE__ */ (0,
|
|
6884
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "whitespace-nowrap font-medium", children: selectedSortLabel }),
|
|
6885
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6739
6886
|
ChevronDownIcon,
|
|
6740
6887
|
{
|
|
6741
6888
|
className: `h-4 w-4 shrink-0 transition-transform duration-200 ${isSortOpen ? "rotate-180" : ""}`
|
|
@@ -6744,17 +6891,17 @@ var init_DataBindingControls = __esm({
|
|
|
6744
6891
|
]
|
|
6745
6892
|
}
|
|
6746
6893
|
),
|
|
6747
|
-
isSortOpen && /* @__PURE__ */ (0,
|
|
6894
|
+
isSortOpen && /* @__PURE__ */ (0, import_jsx_runtime90.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) => {
|
|
6748
6895
|
const isSelected = selectedSortOption?.value === option.value;
|
|
6749
|
-
return /* @__PURE__ */ (0,
|
|
6896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6750
6897
|
"button",
|
|
6751
6898
|
{
|
|
6752
6899
|
type: "button",
|
|
6753
6900
|
onClick: () => handleSelectSort(option.value),
|
|
6754
6901
|
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"}`,
|
|
6755
6902
|
children: [
|
|
6756
|
-
/* @__PURE__ */ (0,
|
|
6757
|
-
isSelected && /* @__PURE__ */ (0,
|
|
6903
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "whitespace-nowrap", children: option.label }),
|
|
6904
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(CheckIcon, { className: "h-4 w-4 shrink-0" })
|
|
6758
6905
|
]
|
|
6759
6906
|
},
|
|
6760
6907
|
option.value
|
|
@@ -6762,8 +6909,8 @@ var init_DataBindingControls = __esm({
|
|
|
6762
6909
|
}) })
|
|
6763
6910
|
] })
|
|
6764
6911
|
] }),
|
|
6765
|
-
selectedFacetCount > 0 && /* @__PURE__ */ (0,
|
|
6766
|
-
Array.from(selectedFacetValues.entries()).map(([field, value]) => /* @__PURE__ */ (0,
|
|
6912
|
+
selectedFacetCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5 pt-1", children: [
|
|
6913
|
+
Array.from(selectedFacetValues.entries()).map(([field, value]) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6767
6914
|
"button",
|
|
6768
6915
|
{
|
|
6769
6916
|
type: "button",
|
|
@@ -6771,13 +6918,13 @@ var init_DataBindingControls = __esm({
|
|
|
6771
6918
|
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",
|
|
6772
6919
|
title: `Remove filter: ${value}`,
|
|
6773
6920
|
children: [
|
|
6774
|
-
/* @__PURE__ */ (0,
|
|
6775
|
-
/* @__PURE__ */ (0,
|
|
6921
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "font-medium truncate max-w-[140px]", children: value }),
|
|
6922
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(CloseIcon, { className: "h-3 w-3 shrink-0 opacity-60 group-hover:opacity-100" })
|
|
6776
6923
|
]
|
|
6777
6924
|
},
|
|
6778
6925
|
`mobile-chip-${field}`
|
|
6779
6926
|
)),
|
|
6780
|
-
/* @__PURE__ */ (0,
|
|
6927
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6781
6928
|
"button",
|
|
6782
6929
|
{
|
|
6783
6930
|
type: "button",
|
|
@@ -6788,8 +6935,8 @@ var init_DataBindingControls = __esm({
|
|
|
6788
6935
|
)
|
|
6789
6936
|
] })
|
|
6790
6937
|
] }),
|
|
6791
|
-
isMobileFiltersOpen && /* @__PURE__ */ (0,
|
|
6792
|
-
/* @__PURE__ */ (0,
|
|
6938
|
+
isMobileFiltersOpen && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "fixed inset-0 z-50 flex flex-col justify-end lg:hidden", children: [
|
|
6939
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6793
6940
|
"div",
|
|
6794
6941
|
{
|
|
6795
6942
|
className: "fixed inset-0 bg-neutral-stronger/60 backdrop-blur-xs transition-opacity duration-300",
|
|
@@ -6797,12 +6944,12 @@ var init_DataBindingControls = __esm({
|
|
|
6797
6944
|
"aria-hidden": "true"
|
|
6798
6945
|
}
|
|
6799
6946
|
),
|
|
6800
|
-
/* @__PURE__ */ (0,
|
|
6801
|
-
/* @__PURE__ */ (0,
|
|
6802
|
-
/* @__PURE__ */ (0,
|
|
6803
|
-
/* @__PURE__ */ (0,
|
|
6804
|
-
/* @__PURE__ */ (0,
|
|
6805
|
-
selectedFacetCount > 0 && /* @__PURE__ */ (0,
|
|
6947
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.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: [
|
|
6948
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "pt-2.5 pb-1", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "mx-auto h-1.5 w-12 rounded-full bg-neutral-soft" }) }),
|
|
6949
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex items-center justify-between px-5 py-3 border-b border-neutral-soft", children: [
|
|
6950
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("h2", { className: "text-lg font-bold tracking-tight", children: "Filters" }),
|
|
6951
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
6952
|
+
selectedFacetCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6806
6953
|
"button",
|
|
6807
6954
|
{
|
|
6808
6955
|
type: "button",
|
|
@@ -6811,38 +6958,38 @@ var init_DataBindingControls = __esm({
|
|
|
6811
6958
|
children: "Clear all"
|
|
6812
6959
|
}
|
|
6813
6960
|
),
|
|
6814
|
-
/* @__PURE__ */ (0,
|
|
6961
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6815
6962
|
"button",
|
|
6816
6963
|
{
|
|
6817
6964
|
type: "button",
|
|
6818
6965
|
onClick: () => setIsMobileFiltersOpen(false),
|
|
6819
6966
|
className: "p-1 rounded-full hover:bg-neutral-weak transition-colors cursor-pointer",
|
|
6820
6967
|
"aria-label": "Close filters",
|
|
6821
|
-
children: /* @__PURE__ */ (0,
|
|
6968
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(CloseIcon, { className: "h-5 w-5 opacity-70" })
|
|
6822
6969
|
}
|
|
6823
6970
|
)
|
|
6824
6971
|
] })
|
|
6825
6972
|
] }),
|
|
6826
|
-
/* @__PURE__ */ (0,
|
|
6973
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.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]) => {
|
|
6827
6974
|
const isOpen = !collapsedCategories[field];
|
|
6828
6975
|
const selectedValue = selectedFacetValues.get(field);
|
|
6829
6976
|
const categorySearch = facetCategorySearch[field]?.toLowerCase() || "";
|
|
6830
6977
|
const filteredValues = categorySearch ? values.filter((v) => v.value.toLowerCase().includes(categorySearch)) : values;
|
|
6831
|
-
return /* @__PURE__ */ (0,
|
|
6832
|
-
/* @__PURE__ */ (0,
|
|
6978
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "pt-3 first:pt-0", children: [
|
|
6979
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6833
6980
|
"button",
|
|
6834
6981
|
{
|
|
6835
6982
|
type: "button",
|
|
6836
6983
|
onClick: () => toggleCategory(field),
|
|
6837
6984
|
className: "flex w-full cursor-pointer items-center justify-between rounded-md py-2 text-left transition-colors",
|
|
6838
6985
|
children: [
|
|
6839
|
-
/* @__PURE__ */ (0,
|
|
6840
|
-
/* @__PURE__ */ (0,
|
|
6841
|
-
/* @__PURE__ */ (0,
|
|
6986
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex items-center gap-2.5", children: [
|
|
6987
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.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) }),
|
|
6988
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "font-semibold text-sm", children: humanize(field) })
|
|
6842
6989
|
] }),
|
|
6843
|
-
/* @__PURE__ */ (0,
|
|
6844
|
-
selectedValue && /* @__PURE__ */ (0,
|
|
6845
|
-
/* @__PURE__ */ (0,
|
|
6990
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
6991
|
+
selectedValue && /* @__PURE__ */ (0, import_jsx_runtime90.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" }),
|
|
6992
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6846
6993
|
ChevronDownIcon,
|
|
6847
6994
|
{
|
|
6848
6995
|
className: `h-4 w-4 transition-transform duration-200 ${isOpen ? "rotate-180" : ""}`
|
|
@@ -6852,10 +6999,10 @@ var init_DataBindingControls = __esm({
|
|
|
6852
6999
|
]
|
|
6853
7000
|
}
|
|
6854
7001
|
),
|
|
6855
|
-
isOpen && /* @__PURE__ */ (0,
|
|
6856
|
-
values.length > 5 && /* @__PURE__ */ (0,
|
|
6857
|
-
/* @__PURE__ */ (0,
|
|
6858
|
-
/* @__PURE__ */ (0,
|
|
7002
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "pt-2 pb-1 pl-1 pr-1 space-y-1.5", children: [
|
|
7003
|
+
values.length > 5 && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "relative mb-2", children: [
|
|
7004
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(SearchIcon, { className: "pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 opacity-50" }),
|
|
7005
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6859
7006
|
"input",
|
|
6860
7007
|
{
|
|
6861
7008
|
type: "text",
|
|
@@ -6869,9 +7016,9 @@ var init_DataBindingControls = __esm({
|
|
|
6869
7016
|
}
|
|
6870
7017
|
)
|
|
6871
7018
|
] }),
|
|
6872
|
-
filteredValues.length === 0 ? /* @__PURE__ */ (0,
|
|
7019
|
+
filteredValues.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "py-2 text-center text-xs opacity-60", children: "No matching options" }) : filteredValues.map((facet) => {
|
|
6873
7020
|
const isChecked = selectedValue === facet.value;
|
|
6874
|
-
return /* @__PURE__ */ (0,
|
|
7021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6875
7022
|
"button",
|
|
6876
7023
|
{
|
|
6877
7024
|
type: "button",
|
|
@@ -6881,17 +7028,17 @@ var init_DataBindingControls = __esm({
|
|
|
6881
7028
|
"aria-pressed": isChecked,
|
|
6882
7029
|
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"}`,
|
|
6883
7030
|
children: [
|
|
6884
|
-
/* @__PURE__ */ (0,
|
|
6885
|
-
/* @__PURE__ */ (0,
|
|
7031
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
7032
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6886
7033
|
"span",
|
|
6887
7034
|
{
|
|
6888
7035
|
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"}`,
|
|
6889
|
-
children: isChecked && /* @__PURE__ */ (0,
|
|
7036
|
+
children: isChecked && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(CheckIcon, { className: "h-3.5 w-3.5" })
|
|
6890
7037
|
}
|
|
6891
7038
|
),
|
|
6892
|
-
/* @__PURE__ */ (0,
|
|
7039
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "leading-snug break-words", children: facet.value })
|
|
6893
7040
|
] }),
|
|
6894
|
-
/* @__PURE__ */ (0,
|
|
7041
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "shrink-0 text-xs opacity-60 ml-2", children: facet.count })
|
|
6895
7042
|
]
|
|
6896
7043
|
},
|
|
6897
7044
|
`drawer-${field}-${facet.value}`
|
|
@@ -6900,8 +7047,8 @@ var init_DataBindingControls = __esm({
|
|
|
6900
7047
|
] })
|
|
6901
7048
|
] }, `drawer-cat-${field}`);
|
|
6902
7049
|
}) }),
|
|
6903
|
-
/* @__PURE__ */ (0,
|
|
6904
|
-
/* @__PURE__ */ (0,
|
|
7050
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex items-center gap-3 border-t border-neutral-soft bg-default p-4", children: [
|
|
7051
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6905
7052
|
"button",
|
|
6906
7053
|
{
|
|
6907
7054
|
type: "button",
|
|
@@ -6910,7 +7057,7 @@ var init_DataBindingControls = __esm({
|
|
|
6910
7057
|
children: "Close"
|
|
6911
7058
|
}
|
|
6912
7059
|
),
|
|
6913
|
-
/* @__PURE__ */ (0,
|
|
7060
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6914
7061
|
"button",
|
|
6915
7062
|
{
|
|
6916
7063
|
type: "button",
|
|
@@ -6926,14 +7073,14 @@ var init_DataBindingControls = __esm({
|
|
|
6926
7073
|
] })
|
|
6927
7074
|
] })
|
|
6928
7075
|
] }),
|
|
6929
|
-
shouldShowFacets && /* @__PURE__ */ (0,
|
|
6930
|
-
/* @__PURE__ */ (0,
|
|
6931
|
-
/* @__PURE__ */ (0,
|
|
6932
|
-
/* @__PURE__ */ (0,
|
|
6933
|
-
/* @__PURE__ */ (0,
|
|
6934
|
-
selectedFacetCount > 0 && /* @__PURE__ */ (0,
|
|
7076
|
+
shouldShowFacets && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
7077
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex items-center justify-between border-b border-neutral-soft pb-3", children: [
|
|
7078
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
7079
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(FilterSlidersIcon, { className: "h-4 w-4" }),
|
|
7080
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("h2", { className: "text-base font-semibold tracking-tight", children: "Filters" }),
|
|
7081
|
+
selectedFacetCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "flex h-5 items-center justify-center rounded-full bg-primary-base px-2 text-xs font-semibold", children: selectedFacetCount })
|
|
6935
7082
|
] }),
|
|
6936
|
-
hasActiveFiltersOrSort && /* @__PURE__ */ (0,
|
|
7083
|
+
hasActiveFiltersOrSort && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6937
7084
|
"button",
|
|
6938
7085
|
{
|
|
6939
7086
|
type: "button",
|
|
@@ -6941,13 +7088,13 @@ var init_DataBindingControls = __esm({
|
|
|
6941
7088
|
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",
|
|
6942
7089
|
"aria-label": "Clear all filters and sorting",
|
|
6943
7090
|
children: [
|
|
6944
|
-
/* @__PURE__ */ (0,
|
|
6945
|
-
/* @__PURE__ */ (0,
|
|
7091
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(ResetIcon, { className: "h-3.5 w-3.5 transition-transform duration-200 group-hover:-rotate-45" }),
|
|
7092
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { children: "Clear all" })
|
|
6946
7093
|
]
|
|
6947
7094
|
}
|
|
6948
7095
|
)
|
|
6949
7096
|
] }),
|
|
6950
|
-
selectedFacetCount > 0 && /* @__PURE__ */ (0,
|
|
7097
|
+
selectedFacetCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime90.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_runtime90.jsxs)(
|
|
6951
7098
|
"button",
|
|
6952
7099
|
{
|
|
6953
7100
|
type: "button",
|
|
@@ -6955,35 +7102,35 @@ var init_DataBindingControls = __esm({
|
|
|
6955
7102
|
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",
|
|
6956
7103
|
title: `Remove filter: ${value}`,
|
|
6957
7104
|
children: [
|
|
6958
|
-
/* @__PURE__ */ (0,
|
|
6959
|
-
/* @__PURE__ */ (0,
|
|
7105
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "font-medium truncate max-w-[150px]", children: value }),
|
|
7106
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(CloseIcon, { className: "h-3.5 w-3.5 shrink-0 opacity-60 group-hover:opacity-100" })
|
|
6960
7107
|
]
|
|
6961
7108
|
},
|
|
6962
7109
|
`chip-${field}`
|
|
6963
7110
|
)) }),
|
|
6964
|
-
activeFacets.length === 1 && /* @__PURE__ */ (0,
|
|
6965
|
-
/* @__PURE__ */ (0,
|
|
7111
|
+
activeFacets.length === 1 && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("nav", { "aria-label": `${humanize(activeFacets[0][0])} filters`, children: /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "py-1", children: [
|
|
7112
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "px-1 pb-2 font-medium text-sm", children: humanize(activeFacets[0][0]) }),
|
|
6966
7113
|
renderFacetItems(activeFacets[0][0], activeFacets[0][1])
|
|
6967
7114
|
] }) }),
|
|
6968
|
-
activeFacets.length > 1 && /* @__PURE__ */ (0,
|
|
7115
|
+
activeFacets.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "flex flex-col divide-y divide-neutral-soft", children: activeFacets.map(([field, values]) => {
|
|
6969
7116
|
const isOpen = !collapsedCategories[field];
|
|
6970
|
-
return /* @__PURE__ */ (0,
|
|
7117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6971
7118
|
"div",
|
|
6972
7119
|
{
|
|
6973
7120
|
className: "py-2 first:pt-0 last:pb-0",
|
|
6974
7121
|
children: [
|
|
6975
|
-
/* @__PURE__ */ (0,
|
|
7122
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6976
7123
|
"button",
|
|
6977
7124
|
{
|
|
6978
7125
|
type: "button",
|
|
6979
7126
|
onClick: () => toggleCategory(field),
|
|
6980
7127
|
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",
|
|
6981
7128
|
children: [
|
|
6982
|
-
/* @__PURE__ */ (0,
|
|
6983
|
-
/* @__PURE__ */ (0,
|
|
6984
|
-
/* @__PURE__ */ (0,
|
|
7129
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
7130
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.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) }),
|
|
7131
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { children: humanize(field) })
|
|
6985
7132
|
] }),
|
|
6986
|
-
/* @__PURE__ */ (0,
|
|
7133
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6987
7134
|
ChevronDownIcon,
|
|
6988
7135
|
{
|
|
6989
7136
|
className: `h-4 w-4 transition-transform duration-200 ease-out ${isOpen ? "rotate-180" : ""}`
|
|
@@ -6992,7 +7139,7 @@ var init_DataBindingControls = __esm({
|
|
|
6992
7139
|
]
|
|
6993
7140
|
}
|
|
6994
7141
|
),
|
|
6995
|
-
isOpen && /* @__PURE__ */ (0,
|
|
7142
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "pt-1", children: renderFacetItems(field, values) })
|
|
6996
7143
|
]
|
|
6997
7144
|
},
|
|
6998
7145
|
field
|
|
@@ -7012,13 +7159,13 @@ var Slider_exports = {};
|
|
|
7012
7159
|
__export(Slider_exports, {
|
|
7013
7160
|
default: () => Slider_default
|
|
7014
7161
|
});
|
|
7015
|
-
var
|
|
7162
|
+
var import_react62, import_jsx_runtime91, Slider, ArrowButton, ProgressPill, Slider_default;
|
|
7016
7163
|
var init_Slider = __esm({
|
|
7017
7164
|
"src/components/Slider.tsx"() {
|
|
7018
7165
|
"use strict";
|
|
7019
7166
|
"use client";
|
|
7020
|
-
|
|
7021
|
-
|
|
7167
|
+
import_react62 = __toESM(require("react"));
|
|
7168
|
+
import_jsx_runtime91 = require("react/jsx-runtime");
|
|
7022
7169
|
Slider = ({
|
|
7023
7170
|
children,
|
|
7024
7171
|
columns,
|
|
@@ -7039,17 +7186,17 @@ var init_Slider = __esm({
|
|
|
7039
7186
|
progressPosition = "bottom",
|
|
7040
7187
|
scrollByColumns = false
|
|
7041
7188
|
}) => {
|
|
7042
|
-
const [currentSlide, setCurrentSlide] = (0,
|
|
7043
|
-
const [transition, setTransition] = (0,
|
|
7189
|
+
const [currentSlide, setCurrentSlide] = (0, import_react62.useState)(0);
|
|
7190
|
+
const [transition, setTransition] = (0, import_react62.useState)(true);
|
|
7044
7191
|
const initialSlidesToShow = slidesToShow ?? columns ?? 4;
|
|
7045
|
-
const [slidesToShowState, setSlidesToShowState] = (0,
|
|
7192
|
+
const [slidesToShowState, setSlidesToShowState] = (0, import_react62.useState)(
|
|
7046
7193
|
typeof initialSlidesToShow === "number" ? initialSlidesToShow : initialSlidesToShow.large
|
|
7047
7194
|
);
|
|
7048
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
7049
|
-
const trackRef = (0,
|
|
7195
|
+
const [isPlaying, setIsPlaying] = (0, import_react62.useState)(autoplay);
|
|
7196
|
+
const trackRef = (0, import_react62.useRef)(null);
|
|
7050
7197
|
console.log("trackRef:", trackRef);
|
|
7051
|
-
const [videoProgress, setVideoProgress] = (0,
|
|
7052
|
-
(0,
|
|
7198
|
+
const [videoProgress, setVideoProgress] = (0, import_react62.useState)(null);
|
|
7199
|
+
(0, import_react62.useEffect)(() => {
|
|
7053
7200
|
if (typeof initialSlidesToShow === "number") {
|
|
7054
7201
|
setSlidesToShowState(initialSlidesToShow);
|
|
7055
7202
|
return;
|
|
@@ -7067,7 +7214,7 @@ var init_Slider = __esm({
|
|
|
7067
7214
|
window.addEventListener("resize", handleResize);
|
|
7068
7215
|
return () => window.removeEventListener("resize", handleResize);
|
|
7069
7216
|
}, [initialSlidesToShow]);
|
|
7070
|
-
(0,
|
|
7217
|
+
(0, import_react62.useEffect)(() => {
|
|
7071
7218
|
if (!autoplay) return;
|
|
7072
7219
|
const activeSlideElement = trackRef.current?.children[currentSlide];
|
|
7073
7220
|
const videoElement = activeSlideElement?.querySelector("video");
|
|
@@ -7112,7 +7259,7 @@ var init_Slider = __esm({
|
|
|
7112
7259
|
}, autoplay_speed);
|
|
7113
7260
|
return () => clearInterval(timer);
|
|
7114
7261
|
}, [autoplay, autoplay_speed, currentSlide, isPlaying]);
|
|
7115
|
-
const totalSlides =
|
|
7262
|
+
const totalSlides = import_react62.Children.count(children);
|
|
7116
7263
|
const numColumns = columns ?? slidesToShowState;
|
|
7117
7264
|
const slideWidthPercentage = (() => {
|
|
7118
7265
|
if (typeof lastColPercentage !== "number") {
|
|
@@ -7178,24 +7325,24 @@ var init_Slider = __esm({
|
|
|
7178
7325
|
}
|
|
7179
7326
|
};
|
|
7180
7327
|
const translateX = -currentSlide * slideWidthPercentage;
|
|
7181
|
-
const slides =
|
|
7182
|
-
if (!
|
|
7328
|
+
const slides = import_react62.Children.map(children, (child, index) => {
|
|
7329
|
+
if (!import_react62.default.isValidElement(child)) return null;
|
|
7183
7330
|
const childProps = child.props;
|
|
7184
7331
|
const mergedClassName = `${childProps.className ?? ""} w-full`.trim();
|
|
7185
|
-
return /* @__PURE__ */ (0,
|
|
7332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
7186
7333
|
"div",
|
|
7187
7334
|
{
|
|
7188
7335
|
className: `flex-none ${scaleOnHover ? "group hover:z-50" : ""} relative`,
|
|
7189
7336
|
style: { width: `calc(${slideWidthPercentage}%)`, paddingRight: gap },
|
|
7190
|
-
children: (0,
|
|
7337
|
+
children: (0, import_react62.cloneElement)(child, {
|
|
7191
7338
|
className: mergedClassName
|
|
7192
7339
|
})
|
|
7193
7340
|
},
|
|
7194
7341
|
index
|
|
7195
7342
|
);
|
|
7196
7343
|
});
|
|
7197
|
-
return /* @__PURE__ */ (0,
|
|
7198
|
-
show_dots && progressPosition === "top" && /* @__PURE__ */ (0,
|
|
7344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "w-full", children: [
|
|
7345
|
+
show_dots && progressPosition === "top" && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "flex justify-center space-x-1.5 mb-4", children: slidePositions.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
7199
7346
|
ProgressPill,
|
|
7200
7347
|
{
|
|
7201
7348
|
active: index === currentStepIndex,
|
|
@@ -7211,14 +7358,14 @@ var init_Slider = __esm({
|
|
|
7211
7358
|
},
|
|
7212
7359
|
index
|
|
7213
7360
|
)) }),
|
|
7214
|
-
/* @__PURE__ */ (0,
|
|
7361
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(
|
|
7215
7362
|
"div",
|
|
7216
7363
|
{
|
|
7217
7364
|
className: `relative w-full overflow-hidden ${className}`,
|
|
7218
7365
|
onMouseEnter: handleMouseEnter,
|
|
7219
7366
|
onMouseLeave: handleMouseLeave,
|
|
7220
7367
|
children: [
|
|
7221
|
-
/* @__PURE__ */ (0,
|
|
7368
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
7222
7369
|
"div",
|
|
7223
7370
|
{
|
|
7224
7371
|
ref: trackRef,
|
|
@@ -7230,32 +7377,32 @@ var init_Slider = __esm({
|
|
|
7230
7377
|
children: slides
|
|
7231
7378
|
}
|
|
7232
7379
|
),
|
|
7233
|
-
show_arrows && /* @__PURE__ */ (0,
|
|
7234
|
-
/* @__PURE__ */ (0,
|
|
7380
|
+
show_arrows && /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_jsx_runtime91.Fragment, { children: [
|
|
7381
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
7235
7382
|
ArrowButton,
|
|
7236
7383
|
{
|
|
7237
7384
|
direction: "left",
|
|
7238
7385
|
onClick: prevSlide,
|
|
7239
7386
|
visible: infinite_scroll || currentSlide > 0,
|
|
7240
7387
|
className: arrowClassName,
|
|
7241
|
-
children: /* @__PURE__ */ (0,
|
|
7388
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.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_runtime91.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 19.5 8.25 12l7.5-7.5" }) })
|
|
7242
7389
|
}
|
|
7243
7390
|
),
|
|
7244
|
-
/* @__PURE__ */ (0,
|
|
7391
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
7245
7392
|
ArrowButton,
|
|
7246
7393
|
{
|
|
7247
7394
|
direction: "right",
|
|
7248
7395
|
onClick: nextSlide,
|
|
7249
7396
|
visible: infinite_scroll || currentSlide < maxSlide,
|
|
7250
7397
|
className: arrowClassName,
|
|
7251
|
-
children: /* @__PURE__ */ (0,
|
|
7398
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.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_runtime91.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m8.25 4.5 7.5 7.5-7.5 7.5" }) })
|
|
7252
7399
|
}
|
|
7253
7400
|
)
|
|
7254
7401
|
] })
|
|
7255
7402
|
]
|
|
7256
7403
|
}
|
|
7257
7404
|
),
|
|
7258
|
-
show_dots && progressPosition !== "top" && /* @__PURE__ */ (0,
|
|
7405
|
+
show_dots && progressPosition !== "top" && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "flex justify-center space-x-1.5 mt-5", children: slidePositions.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
7259
7406
|
ProgressPill,
|
|
7260
7407
|
{
|
|
7261
7408
|
active: index === currentStepIndex,
|
|
@@ -7279,7 +7426,7 @@ var init_Slider = __esm({
|
|
|
7279
7426
|
visible,
|
|
7280
7427
|
children,
|
|
7281
7428
|
className = ""
|
|
7282
|
-
}) => /* @__PURE__ */ (0,
|
|
7429
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
7283
7430
|
"button",
|
|
7284
7431
|
{
|
|
7285
7432
|
className: `
|
|
@@ -7305,13 +7452,13 @@ var init_Slider = __esm({
|
|
|
7305
7452
|
currentStep,
|
|
7306
7453
|
customProgress = null
|
|
7307
7454
|
}) => {
|
|
7308
|
-
const [progress, setProgress] = (0,
|
|
7309
|
-
(0,
|
|
7455
|
+
const [progress, setProgress] = (0, import_react62.useState)(0);
|
|
7456
|
+
(0, import_react62.useEffect)(() => {
|
|
7310
7457
|
if (active) {
|
|
7311
7458
|
setProgress(0);
|
|
7312
7459
|
}
|
|
7313
7460
|
}, [active, index]);
|
|
7314
|
-
(0,
|
|
7461
|
+
(0, import_react62.useEffect)(() => {
|
|
7315
7462
|
if (!active || !isPlaying || customProgress !== null) {
|
|
7316
7463
|
if (!active) {
|
|
7317
7464
|
setProgress(0);
|
|
@@ -7364,7 +7511,7 @@ var init_Slider = __esm({
|
|
|
7364
7511
|
const renderProgressBar = () => {
|
|
7365
7512
|
if (style === "modern" && isActive) {
|
|
7366
7513
|
const displayProgress = customProgress ?? progress;
|
|
7367
|
-
return /* @__PURE__ */ (0,
|
|
7514
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
7368
7515
|
"div",
|
|
7369
7516
|
{
|
|
7370
7517
|
className: `absolute top-0 left-0 h-full rounded-full ${activeClassName || "bg-white"} transition-all duration-50 ease-linear`,
|
|
@@ -7374,7 +7521,7 @@ var init_Slider = __esm({
|
|
|
7374
7521
|
}
|
|
7375
7522
|
return null;
|
|
7376
7523
|
};
|
|
7377
|
-
return /* @__PURE__ */ (0,
|
|
7524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
7378
7525
|
"button",
|
|
7379
7526
|
{
|
|
7380
7527
|
className: `${baseClasses} ${getStyleClasses()}`,
|
|
@@ -7856,7 +8003,7 @@ var InputControl_default = InputControl2;
|
|
|
7856
8003
|
init_InputControlType();
|
|
7857
8004
|
|
|
7858
8005
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
7859
|
-
var
|
|
8006
|
+
var import_react64 = __toESM(require("react"));
|
|
7860
8007
|
|
|
7861
8008
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
7862
8009
|
var import_react49 = __toESM(require("react"));
|
|
@@ -8656,8 +8803,8 @@ var WidgetNode = (props) => {
|
|
|
8656
8803
|
var WidgetNode_default = WidgetNode;
|
|
8657
8804
|
|
|
8658
8805
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
8659
|
-
var
|
|
8660
|
-
var
|
|
8806
|
+
var import_dynamic17 = __toESM(require("next/dynamic"));
|
|
8807
|
+
var import_react63 = __toESM(require("react"));
|
|
8661
8808
|
|
|
8662
8809
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
8663
8810
|
var import_dynamic12 = __toESM(require("next/dynamic"));
|
|
@@ -9846,13 +9993,112 @@ var GoogleMapNode = (props) => {
|
|
|
9846
9993
|
};
|
|
9847
9994
|
var GoogleMapNode_default = GoogleMapNode;
|
|
9848
9995
|
|
|
9996
|
+
// src/components/pageRenderingEngine/nodes/MediaAccordionNode.tsx
|
|
9997
|
+
var import_dynamic16 = __toESM(require("next/dynamic"));
|
|
9998
|
+
init_ServiceClient();
|
|
9999
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
10000
|
+
var MediaAccordionNodeClient2 = (0, import_dynamic16.default)(
|
|
10001
|
+
() => Promise.resolve().then(() => (init_MediaAccordionNodeClient(), MediaAccordionNodeClient_exports)),
|
|
10002
|
+
{ ssr: false }
|
|
10003
|
+
);
|
|
10004
|
+
var getNestedValue6 = (value, path) => path.split(".").reduce((current, key) => {
|
|
10005
|
+
if (!current || typeof current !== "object") return void 0;
|
|
10006
|
+
return current[key];
|
|
10007
|
+
}, value);
|
|
10008
|
+
var getAssetUrl = (value) => {
|
|
10009
|
+
if (typeof value === "string") {
|
|
10010
|
+
const trimmed = value.trim();
|
|
10011
|
+
if (!trimmed) return {};
|
|
10012
|
+
try {
|
|
10013
|
+
return getAssetUrl(JSON.parse(trimmed));
|
|
10014
|
+
} catch {
|
|
10015
|
+
return { url: trimmed };
|
|
10016
|
+
}
|
|
10017
|
+
}
|
|
10018
|
+
if (Array.isArray(value)) {
|
|
10019
|
+
const image = value.find(
|
|
10020
|
+
(entry) => entry && typeof entry === "object" && "assetUrl" in entry
|
|
10021
|
+
);
|
|
10022
|
+
return getAssetUrl(image);
|
|
10023
|
+
}
|
|
10024
|
+
if (value && typeof value === "object") {
|
|
10025
|
+
const asset = value;
|
|
10026
|
+
return {
|
|
10027
|
+
url: typeof asset.assetUrl === "string" ? asset.assetUrl : void 0,
|
|
10028
|
+
posterUrl: typeof asset.posterUrl === "string" ? asset.posterUrl : void 0
|
|
10029
|
+
};
|
|
10030
|
+
}
|
|
10031
|
+
return {};
|
|
10032
|
+
};
|
|
10033
|
+
var fetchStoryItems = async (node, apiBaseUrl, session, routeParameters) => {
|
|
10034
|
+
const dataSource = node.dataSource?.trim();
|
|
10035
|
+
if (!dataSource) return void 0;
|
|
10036
|
+
const endpoint = dataSource.replace(
|
|
10037
|
+
/\{(\w+)\}/g,
|
|
10038
|
+
(placeholder, key) => routeParameters?.[key] == null ? placeholder : String(routeParameters[key])
|
|
10039
|
+
);
|
|
10040
|
+
try {
|
|
10041
|
+
const response = await new ServiceClient_default(apiBaseUrl, session).get(endpoint);
|
|
10042
|
+
if (!response?.isSuccessful) {
|
|
10043
|
+
console.error(
|
|
10044
|
+
"Story accordion API request failed:",
|
|
10045
|
+
response?.message || endpoint
|
|
10046
|
+
);
|
|
10047
|
+
return void 0;
|
|
10048
|
+
}
|
|
10049
|
+
const result = response.result;
|
|
10050
|
+
const records = Array.isArray(result) ? result : [];
|
|
10051
|
+
return records.flatMap((record, index) => {
|
|
10052
|
+
const title = getNestedValue6(record, node.titleField || "title");
|
|
10053
|
+
const mappedMedia = getAssetUrl(
|
|
10054
|
+
getNestedValue6(record, node.mediaUrlField || "mediaUrl")
|
|
10055
|
+
);
|
|
10056
|
+
const explicitPoster = node.posterUrlField ? getAssetUrl(getNestedValue6(record, node.posterUrlField)).url : void 0;
|
|
10057
|
+
const mediaUrl = mappedMedia.url;
|
|
10058
|
+
if (!mediaUrl) return [];
|
|
10059
|
+
const typeValue = node.mediaTypeField ? getNestedValue6(record, node.mediaTypeField) : void 0;
|
|
10060
|
+
const mediaType = typeof typeValue === "string" ? typeValue.toLowerCase() === "video" ? "video" : "image" : /\.(mp4|webm|ogv|m3u8)(?:$|[?#])/i.test(mediaUrl) ? "video" : "image";
|
|
10061
|
+
return [
|
|
10062
|
+
{
|
|
10063
|
+
id: `api-story-${index}`,
|
|
10064
|
+
title: typeof title === "string" || typeof title === "number" ? String(title) : `Story ${index + 1}`,
|
|
10065
|
+
mediaUrl,
|
|
10066
|
+
posterUrl: explicitPoster || mappedMedia.posterUrl,
|
|
10067
|
+
mediaType
|
|
10068
|
+
}
|
|
10069
|
+
];
|
|
10070
|
+
});
|
|
10071
|
+
} catch (error) {
|
|
10072
|
+
console.error("Story accordion API request failed:", error);
|
|
10073
|
+
return void 0;
|
|
10074
|
+
}
|
|
10075
|
+
};
|
|
10076
|
+
var MediaAccordionNode = async (props) => {
|
|
10077
|
+
const apiItems = await fetchStoryItems(
|
|
10078
|
+
props.node,
|
|
10079
|
+
props.apiBaseUrl,
|
|
10080
|
+
props.session,
|
|
10081
|
+
props.routeParameters
|
|
10082
|
+
);
|
|
10083
|
+
const node = apiItems ? { ...props.node, items: apiItems } : props.node;
|
|
10084
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
10085
|
+
MediaAccordionNodeClient2,
|
|
10086
|
+
{
|
|
10087
|
+
node,
|
|
10088
|
+
apiBaseUrl: props.apiBaseUrl,
|
|
10089
|
+
assetBaseUrl: props.assetBaseUrl
|
|
10090
|
+
}
|
|
10091
|
+
);
|
|
10092
|
+
};
|
|
10093
|
+
var MediaAccordionNode_default = MediaAccordionNode;
|
|
10094
|
+
|
|
9849
10095
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
9850
|
-
var
|
|
9851
|
-
var Pagination2 = (0,
|
|
9852
|
-
var DataBindingControls2 = (0,
|
|
10096
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
10097
|
+
var Pagination2 = (0, import_dynamic17.default)(() => Promise.resolve().then(() => (init_Pagination(), Pagination_exports)), { ssr: true });
|
|
10098
|
+
var DataBindingControls2 = (0, import_dynamic17.default)(() => Promise.resolve().then(() => (init_DataBindingControls(), DataBindingControls_exports)), {
|
|
9853
10099
|
ssr: true
|
|
9854
10100
|
});
|
|
9855
|
-
var Slider2 = (0,
|
|
10101
|
+
var Slider2 = (0, import_dynamic17.default)(() => Promise.resolve().then(() => (init_Slider(), Slider_exports)), {
|
|
9856
10102
|
ssr: false
|
|
9857
10103
|
});
|
|
9858
10104
|
function toCamelCase(str) {
|
|
@@ -9873,7 +10119,7 @@ function convertKeysToCamelCase(obj) {
|
|
|
9873
10119
|
Object.entries(obj).filter(([_, value]) => value !== "" && value !== void 0).map(([key, value]) => [toCamelCase(key), convertKeysToCamelCase(value)])
|
|
9874
10120
|
);
|
|
9875
10121
|
}
|
|
9876
|
-
var
|
|
10122
|
+
var getNestedValue7 = (obj, path) => {
|
|
9877
10123
|
if (!obj || !path) return void 0;
|
|
9878
10124
|
return path.split(".").reduce((current, key) => {
|
|
9879
10125
|
{
|
|
@@ -9918,7 +10164,7 @@ function generateCompleteBackgroundString(layers, apiBaseUrl, dataItem) {
|
|
|
9918
10164
|
const imageValue = layer.value;
|
|
9919
10165
|
let assetUrl = imageValue.assetUrl || "";
|
|
9920
10166
|
if (layer.datafield && dataItem) {
|
|
9921
|
-
const fieldValue =
|
|
10167
|
+
const fieldValue = getNestedValue7(dataItem, layer.datafield);
|
|
9922
10168
|
const resolvedAssetUrl = resolveAssetUrl(fieldValue, layer.tag);
|
|
9923
10169
|
if (resolvedAssetUrl) {
|
|
9924
10170
|
assetUrl = resolvedAssetUrl;
|
|
@@ -10043,7 +10289,8 @@ var DivContainer = async (props) => {
|
|
|
10043
10289
|
"svg-icon": SVGIconNode_default,
|
|
10044
10290
|
document: DocumentNode_default,
|
|
10045
10291
|
"google-map": GoogleMapNode_default,
|
|
10046
|
-
counter: CounterNode_default
|
|
10292
|
+
counter: CounterNode_default,
|
|
10293
|
+
"story-accordion": MediaAccordionNode_default
|
|
10047
10294
|
};
|
|
10048
10295
|
const styles = props.node.cssProperties;
|
|
10049
10296
|
const mobileStyles = props.node.mobileCssProperties;
|
|
@@ -10120,7 +10367,7 @@ var DivContainer = async (props) => {
|
|
|
10120
10367
|
response = await serviceClient.get(endpoint);
|
|
10121
10368
|
result = response?.result;
|
|
10122
10369
|
if (dataBindingProperties.childCollectionName && props.dataitem) {
|
|
10123
|
-
childCollectionData =
|
|
10370
|
+
childCollectionData = getNestedValue7(
|
|
10124
10371
|
props.dataitem,
|
|
10125
10372
|
dataBindingProperties.childCollectionName
|
|
10126
10373
|
);
|
|
@@ -10142,7 +10389,7 @@ var DivContainer = async (props) => {
|
|
|
10142
10389
|
}
|
|
10143
10390
|
const SelectedNode = NodeTypes2[node.type];
|
|
10144
10391
|
if (!SelectedNode) return null;
|
|
10145
|
-
return /* @__PURE__ */ (0,
|
|
10392
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_react63.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
10146
10393
|
SelectedNode,
|
|
10147
10394
|
{
|
|
10148
10395
|
node,
|
|
@@ -10247,7 +10494,7 @@ var DivContainer = async (props) => {
|
|
|
10247
10494
|
item,
|
|
10248
10495
|
idx,
|
|
10249
10496
|
props.href ? void 0 : item?.links?.view
|
|
10250
|
-
)?.map((child, i) => /* @__PURE__ */ (0,
|
|
10497
|
+
)?.map((child, i) => /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_react63.default.Fragment, { children: child }, i)) : renderChildren2(props.node.children, props, item, idx)
|
|
10251
10498
|
);
|
|
10252
10499
|
}
|
|
10253
10500
|
return props.node.children.flatMap((node, childIndex) => {
|
|
@@ -10258,7 +10505,7 @@ var DivContainer = async (props) => {
|
|
|
10258
10505
|
let repeatItems = null;
|
|
10259
10506
|
const childCollectionName = node?.dataBinding?.childCollectionName;
|
|
10260
10507
|
if (childCollectionName && props.dataitem) {
|
|
10261
|
-
const nestedCollection =
|
|
10508
|
+
const nestedCollection = getNestedValue7(
|
|
10262
10509
|
props.dataitem,
|
|
10263
10510
|
childCollectionName
|
|
10264
10511
|
);
|
|
@@ -10365,17 +10612,17 @@ var DivContainer = async (props) => {
|
|
|
10365
10612
|
dataBindingProperties?.showFacets || dataBindingProperties?.showSortOptions || dataBindingProperties?.showSearchBar
|
|
10366
10613
|
);
|
|
10367
10614
|
const WrapperComponent = Wrapper;
|
|
10368
|
-
const renderedContainer = /* @__PURE__ */ (0,
|
|
10615
|
+
const renderedContainer = /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
10369
10616
|
WrapperComponent,
|
|
10370
10617
|
{
|
|
10371
10618
|
id: guid,
|
|
10372
10619
|
style: combinedStyles,
|
|
10373
10620
|
className: classNames || void 0,
|
|
10374
10621
|
...wrapperProps,
|
|
10375
|
-
children: shouldShowNoDataMessage ? hasActiveFilter ? /* @__PURE__ */ (0,
|
|
10622
|
+
children: shouldShowNoDataMessage ? hasActiveFilter ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(NoFilterResultsFound_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(NoDataFound_default, {}) : renderContainerChildren()
|
|
10376
10623
|
}
|
|
10377
10624
|
);
|
|
10378
|
-
const paginationControl = dataBindingProperties?.enablePagination ? /* @__PURE__ */ (0,
|
|
10625
|
+
const paginationControl = dataBindingProperties?.enablePagination ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
10379
10626
|
Pagination2,
|
|
10380
10627
|
{
|
|
10381
10628
|
path: props.path,
|
|
@@ -10383,15 +10630,15 @@ var DivContainer = async (props) => {
|
|
|
10383
10630
|
dataset: response
|
|
10384
10631
|
}
|
|
10385
10632
|
) : null;
|
|
10386
|
-
return /* @__PURE__ */ (0,
|
|
10387
|
-
/* @__PURE__ */ (0,
|
|
10633
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_react63.default.Fragment, { children: [
|
|
10634
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
10388
10635
|
"style",
|
|
10389
10636
|
{
|
|
10390
10637
|
dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS }
|
|
10391
10638
|
}
|
|
10392
10639
|
),
|
|
10393
|
-
showDataBindingControls ? /* @__PURE__ */ (0,
|
|
10394
|
-
/* @__PURE__ */ (0,
|
|
10640
|
+
showDataBindingControls ? /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_react63.default.Fragment, { children: [
|
|
10641
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
10395
10642
|
DataBindingControls2,
|
|
10396
10643
|
{
|
|
10397
10644
|
mode: "toolbar",
|
|
@@ -10404,16 +10651,16 @@ var DivContainer = async (props) => {
|
|
|
10404
10651
|
showSearchBar: dataBindingProperties?.showSearchBar
|
|
10405
10652
|
}
|
|
10406
10653
|
),
|
|
10407
|
-
/* @__PURE__ */ (0,
|
|
10654
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
|
|
10408
10655
|
"div",
|
|
10409
10656
|
{
|
|
10410
10657
|
className: dataBindingProperties?.showFacets ? "grid items-start gap-6 lg:grid-cols-[minmax(0,1fr)_18rem]" : void 0,
|
|
10411
10658
|
children: [
|
|
10412
|
-
/* @__PURE__ */ (0,
|
|
10659
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "min-w-0", children: [
|
|
10413
10660
|
renderedContainer,
|
|
10414
10661
|
paginationControl
|
|
10415
10662
|
] }),
|
|
10416
|
-
dataBindingProperties?.showFacets && /* @__PURE__ */ (0,
|
|
10663
|
+
dataBindingProperties?.showFacets && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("aside", { className: "hidden lg:block", children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
10417
10664
|
DataBindingControls2,
|
|
10418
10665
|
{
|
|
10419
10666
|
mode: "facets",
|
|
@@ -10426,16 +10673,16 @@ var DivContainer = async (props) => {
|
|
|
10426
10673
|
]
|
|
10427
10674
|
}
|
|
10428
10675
|
)
|
|
10429
|
-
] }) : /* @__PURE__ */ (0,
|
|
10676
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_react63.default.Fragment, { children: [
|
|
10430
10677
|
renderedContainer,
|
|
10431
|
-
paginationControl && /* @__PURE__ */ (0,
|
|
10678
|
+
paginationControl && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { children: paginationControl })
|
|
10432
10679
|
] })
|
|
10433
10680
|
] });
|
|
10434
10681
|
};
|
|
10435
10682
|
var DivContainer_default = DivContainer;
|
|
10436
10683
|
|
|
10437
10684
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
10438
|
-
var
|
|
10685
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
10439
10686
|
var NodeTypes = {
|
|
10440
10687
|
["paragraph"]: ParagraphNode_default,
|
|
10441
10688
|
["heading"]: HeadingNode_default,
|
|
@@ -10452,7 +10699,8 @@ var NodeTypes = {
|
|
|
10452
10699
|
["embed"]: EmbedNode_default,
|
|
10453
10700
|
["document"]: DocumentNode_default,
|
|
10454
10701
|
["google-map"]: GoogleMapNode_default,
|
|
10455
|
-
["counter"]: CounterNode_default
|
|
10702
|
+
["counter"]: CounterNode_default,
|
|
10703
|
+
["story-accordion"]: MediaAccordionNode_default
|
|
10456
10704
|
};
|
|
10457
10705
|
var PageBodyRenderer = (props) => {
|
|
10458
10706
|
let pageBodyTree;
|
|
@@ -10474,14 +10722,14 @@ var PageBodyRenderer = (props) => {
|
|
|
10474
10722
|
}
|
|
10475
10723
|
return true;
|
|
10476
10724
|
};
|
|
10477
|
-
return /* @__PURE__ */ (0,
|
|
10725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react64.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
10478
10726
|
{
|
|
10479
10727
|
}
|
|
10480
10728
|
const SelectedNode = NodeTypes[node.type];
|
|
10481
10729
|
if (!shouldRenderNode(node)) {
|
|
10482
10730
|
return null;
|
|
10483
10731
|
}
|
|
10484
|
-
return /* @__PURE__ */ (0,
|
|
10732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react64.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react64.default.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react64.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
10485
10733
|
SelectedNode,
|
|
10486
10734
|
{
|
|
10487
10735
|
node,
|
|
@@ -10497,7 +10745,7 @@ var PageBodyRenderer = (props) => {
|
|
|
10497
10745
|
device: props.device,
|
|
10498
10746
|
widgetRenderer: props.widgetRenderer
|
|
10499
10747
|
}
|
|
10500
|
-
) }) : /* @__PURE__ */ (0,
|
|
10748
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react64.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
10501
10749
|
SelectedNode,
|
|
10502
10750
|
{
|
|
10503
10751
|
node,
|
|
@@ -10518,10 +10766,10 @@ var PageBodyRenderer = (props) => {
|
|
|
10518
10766
|
var PageBodyRenderer_default = PageBodyRenderer;
|
|
10519
10767
|
|
|
10520
10768
|
// src/components/pageRenderingEngine/EnterAnimationHydrator.tsx
|
|
10521
|
-
var
|
|
10769
|
+
var import_react65 = require("react");
|
|
10522
10770
|
var ENTER_ANIMATION_SELECTOR = ".enter-animation";
|
|
10523
10771
|
function EnterAnimationHydrator() {
|
|
10524
|
-
(0,
|
|
10772
|
+
(0, import_react65.useEffect)(() => {
|
|
10525
10773
|
let observer;
|
|
10526
10774
|
const observedElements = /* @__PURE__ */ new WeakSet();
|
|
10527
10775
|
const revealAnimatedElements = () => {
|
|
@@ -10566,22 +10814,22 @@ function EnterAnimationHydrator() {
|
|
|
10566
10814
|
}
|
|
10567
10815
|
|
|
10568
10816
|
// src/components/Toast.tsx
|
|
10569
|
-
var
|
|
10817
|
+
var import_react66 = require("react");
|
|
10570
10818
|
init_ToastService();
|
|
10571
|
-
var
|
|
10819
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
10572
10820
|
var Toast = () => {
|
|
10573
|
-
const [showToast, setShowToast] = (0,
|
|
10574
|
-
const [message, setMessage] = (0,
|
|
10575
|
-
const [messageType, setMessageType] = (0,
|
|
10576
|
-
const timeoutRef = (0,
|
|
10577
|
-
const closeToast = (0,
|
|
10821
|
+
const [showToast, setShowToast] = (0, import_react66.useState)(false);
|
|
10822
|
+
const [message, setMessage] = (0, import_react66.useState)("");
|
|
10823
|
+
const [messageType, setMessageType] = (0, import_react66.useState)("error");
|
|
10824
|
+
const timeoutRef = (0, import_react66.useRef)(null);
|
|
10825
|
+
const closeToast = (0, import_react66.useCallback)(() => {
|
|
10578
10826
|
if (timeoutRef.current) {
|
|
10579
10827
|
clearTimeout(timeoutRef.current);
|
|
10580
10828
|
timeoutRef.current = null;
|
|
10581
10829
|
}
|
|
10582
10830
|
setShowToast(false);
|
|
10583
10831
|
}, []);
|
|
10584
|
-
const showMessage = (0,
|
|
10832
|
+
const showMessage = (0, import_react66.useCallback)((message2, messageType2) => {
|
|
10585
10833
|
if (timeoutRef.current) {
|
|
10586
10834
|
clearTimeout(timeoutRef.current);
|
|
10587
10835
|
}
|
|
@@ -10593,7 +10841,7 @@ var Toast = () => {
|
|
|
10593
10841
|
timeoutRef.current = null;
|
|
10594
10842
|
}, 4e3);
|
|
10595
10843
|
}, []);
|
|
10596
|
-
(0,
|
|
10844
|
+
(0, import_react66.useEffect)(() => {
|
|
10597
10845
|
ToastService_default.initialize(showMessage, closeToast);
|
|
10598
10846
|
return () => {
|
|
10599
10847
|
closeToast();
|
|
@@ -10602,8 +10850,8 @@ var Toast = () => {
|
|
|
10602
10850
|
});
|
|
10603
10851
|
};
|
|
10604
10852
|
}, [closeToast, showMessage]);
|
|
10605
|
-
return /* @__PURE__ */ (0,
|
|
10606
|
-
/* @__PURE__ */ (0,
|
|
10853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_jsx_runtime94.Fragment, { children: showToast && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: "fixed top-2 flex justify-center w-[calc(100%-2rem)] sm:w-1/2 max-w-xl left-1/2 -translate-x-1/2", style: { zIndex: 1e3 }, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: `w-full items-center flex justify-between p-3 pr-8 rounded-md relative shadow border bg-${messageType}-soft`, children: [
|
|
10854
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
10607
10855
|
"span",
|
|
10608
10856
|
{
|
|
10609
10857
|
className: "font-medium text-inherit text-sm",
|
|
@@ -10611,7 +10859,7 @@ var Toast = () => {
|
|
|
10611
10859
|
children: message
|
|
10612
10860
|
}
|
|
10613
10861
|
),
|
|
10614
|
-
/* @__PURE__ */ (0,
|
|
10862
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("button", { className: "absolute right-2 top-2 ml-2 focus:outline-none", onClick: closeToast, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
10615
10863
|
"svg",
|
|
10616
10864
|
{
|
|
10617
10865
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -10619,7 +10867,7 @@ var Toast = () => {
|
|
|
10619
10867
|
fill: "none",
|
|
10620
10868
|
viewBox: "0 0 24 24",
|
|
10621
10869
|
stroke: "currentColor",
|
|
10622
|
-
children: /* @__PURE__ */ (0,
|
|
10870
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M6 18L18 6M6 6l12 12" })
|
|
10623
10871
|
}
|
|
10624
10872
|
) })
|
|
10625
10873
|
] }) }) });
|
|
@@ -10649,7 +10897,7 @@ init_RadioInput();
|
|
|
10649
10897
|
// src/components/NavigationTabsV2.tsx
|
|
10650
10898
|
var import_link3 = __toESM(require("next/link"));
|
|
10651
10899
|
var import_navigation2 = require("next/navigation");
|
|
10652
|
-
var
|
|
10900
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
10653
10901
|
function resolveRoutePlaceholders(route, params) {
|
|
10654
10902
|
return route.replace(/\{([^}]+)\}/g, (match, key) => {
|
|
10655
10903
|
const value = params[key];
|
|
@@ -10674,8 +10922,8 @@ var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
|
10674
10922
|
isActive: tab.isActive
|
|
10675
10923
|
})) || [];
|
|
10676
10924
|
if (mappedTabs.length === 0) return null;
|
|
10677
|
-
return /* @__PURE__ */ (0,
|
|
10678
|
-
return /* @__PURE__ */ (0,
|
|
10925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: "flex border-b bg-white rounded-t mb-3", children: mappedTabs.map(({ tabTitle, landingPageUrl, isActive }) => {
|
|
10926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_link3.default, { href: landingPageUrl, className: "-mb-px", children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
10679
10927
|
"div",
|
|
10680
10928
|
{
|
|
10681
10929
|
className: `text-sm font-medium border-b-2 px-6 py-2 transition
|
|
@@ -10688,14 +10936,14 @@ var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
|
10688
10936
|
var NavigationTabsV2_default = NavigationTabsV2;
|
|
10689
10937
|
|
|
10690
10938
|
// src/components/dataForm/DataList.tsx
|
|
10691
|
-
var
|
|
10939
|
+
var import_react69 = __toESM(require("react"));
|
|
10692
10940
|
var import_navigation3 = require("next/navigation");
|
|
10693
10941
|
|
|
10694
10942
|
// src/components/dataForm/NoContentView.tsx
|
|
10695
|
-
var
|
|
10696
|
-
var
|
|
10943
|
+
var import_react67 = __toESM(require("react"));
|
|
10944
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
10697
10945
|
var NoContentView = (props) => {
|
|
10698
|
-
return /* @__PURE__ */ (0,
|
|
10946
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_react67.default.Fragment, { children: props.isDataFound === false && props.children });
|
|
10699
10947
|
};
|
|
10700
10948
|
var NoContentView_default = NoContentView;
|
|
10701
10949
|
|
|
@@ -10703,39 +10951,39 @@ var NoContentView_default = NoContentView;
|
|
|
10703
10951
|
init_InputControlType();
|
|
10704
10952
|
|
|
10705
10953
|
// src/components/dataForm/ContentView.tsx
|
|
10706
|
-
var
|
|
10707
|
-
var
|
|
10954
|
+
var import_react68 = __toESM(require("react"));
|
|
10955
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
10708
10956
|
var ContentView = (props) => {
|
|
10709
|
-
return /* @__PURE__ */ (0,
|
|
10710
|
-
props.isDataFound == null && /* @__PURE__ */ (0,
|
|
10711
|
-
/* @__PURE__ */ (0,
|
|
10712
|
-
/* @__PURE__ */ (0,
|
|
10713
|
-
/* @__PURE__ */ (0,
|
|
10714
|
-
/* @__PURE__ */ (0,
|
|
10715
|
-
/* @__PURE__ */ (0,
|
|
10957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(import_react68.default.Fragment, { children: [
|
|
10958
|
+
props.isDataFound == null && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
10959
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
10960
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
10961
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "ml-2", children: [
|
|
10962
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
|
|
10963
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
|
|
10716
10964
|
] })
|
|
10717
10965
|
] }),
|
|
10718
|
-
/* @__PURE__ */ (0,
|
|
10719
|
-
/* @__PURE__ */ (0,
|
|
10720
|
-
/* @__PURE__ */ (0,
|
|
10721
|
-
/* @__PURE__ */ (0,
|
|
10722
|
-
/* @__PURE__ */ (0,
|
|
10723
|
-
/* @__PURE__ */ (0,
|
|
10724
|
-
/* @__PURE__ */ (0,
|
|
10966
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
|
|
10967
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "animate-pulse", children: [
|
|
10968
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
10969
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
10970
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
10971
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
10972
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
10725
10973
|
] }),
|
|
10726
|
-
/* @__PURE__ */ (0,
|
|
10727
|
-
/* @__PURE__ */ (0,
|
|
10728
|
-
/* @__PURE__ */ (0,
|
|
10729
|
-
/* @__PURE__ */ (0,
|
|
10730
|
-
/* @__PURE__ */ (0,
|
|
10731
|
-
/* @__PURE__ */ (0,
|
|
10974
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "animate-pulse", children: [
|
|
10975
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
10976
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
10977
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
10978
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
10979
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
10732
10980
|
] }),
|
|
10733
|
-
/* @__PURE__ */ (0,
|
|
10734
|
-
/* @__PURE__ */ (0,
|
|
10735
|
-
/* @__PURE__ */ (0,
|
|
10736
|
-
/* @__PURE__ */ (0,
|
|
10737
|
-
/* @__PURE__ */ (0,
|
|
10738
|
-
/* @__PURE__ */ (0,
|
|
10981
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "animate-pulse", children: [
|
|
10982
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
10983
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
10984
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
10985
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
10986
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
10739
10987
|
] })
|
|
10740
10988
|
] })
|
|
10741
10989
|
] }) }),
|
|
@@ -10795,7 +11043,7 @@ function FormReducer(state, action) {
|
|
|
10795
11043
|
var FormReducer_default = FormReducer;
|
|
10796
11044
|
|
|
10797
11045
|
// src/components/dataForm/DataList.tsx
|
|
10798
|
-
var
|
|
11046
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
10799
11047
|
var DataList = (props) => {
|
|
10800
11048
|
const router = (0, import_navigation3.useRouter)();
|
|
10801
11049
|
let builder = new OdataBuilder(props.path);
|
|
@@ -10803,12 +11051,12 @@ var DataList = (props) => {
|
|
|
10803
11051
|
let activePageNumber = 0;
|
|
10804
11052
|
let pages = 0;
|
|
10805
11053
|
console.log(props.addLinkText);
|
|
10806
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
10807
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
10808
|
-
(0,
|
|
11054
|
+
const [isDataFound, setIsDataFound] = (0, import_react69.useState)(null);
|
|
11055
|
+
const [searchTerm, setSearchTerm] = (0, import_react69.useState)(props.query?.searchTerm ?? "");
|
|
11056
|
+
(0, import_react69.useEffect)(() => {
|
|
10809
11057
|
setSearchTerm(props.query?.searchTerm ?? "");
|
|
10810
11058
|
}, [props.query?.searchTerm]);
|
|
10811
|
-
(0,
|
|
11059
|
+
(0, import_react69.useEffect)(() => {
|
|
10812
11060
|
if (props?.dataset) {
|
|
10813
11061
|
if (props?.dataset.result && props.dataset.result.length > 0) {
|
|
10814
11062
|
setIsDataFound(true);
|
|
@@ -10817,7 +11065,7 @@ var DataList = (props) => {
|
|
|
10817
11065
|
}
|
|
10818
11066
|
}
|
|
10819
11067
|
}, [props.dataset]);
|
|
10820
|
-
(0,
|
|
11068
|
+
(0, import_react69.useEffect)(() => {
|
|
10821
11069
|
if (!props.query?.["$filter"] || !props.filters) return;
|
|
10822
11070
|
const filterQuery = props.query["$filter"];
|
|
10823
11071
|
props.filters.forEach((filter) => {
|
|
@@ -10836,7 +11084,7 @@ var DataList = (props) => {
|
|
|
10836
11084
|
if (path.includes(".")) {
|
|
10837
11085
|
return path.split(".").reduce((prev, curr) => prev ? prev[curr] : null, obj);
|
|
10838
11086
|
} else if (Array.isArray(obj[path])) {
|
|
10839
|
-
return obj[path].map((item, index) => /* @__PURE__ */ (0,
|
|
11087
|
+
return obj[path].map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { children: item }, index));
|
|
10840
11088
|
} else {
|
|
10841
11089
|
return obj[path];
|
|
10842
11090
|
}
|
|
@@ -10845,11 +11093,11 @@ var DataList = (props) => {
|
|
|
10845
11093
|
inputValues: {},
|
|
10846
11094
|
lastPropertyChanged: ""
|
|
10847
11095
|
};
|
|
10848
|
-
const [formState, dispatch] = (0,
|
|
11096
|
+
const [formState, dispatch] = (0, import_react69.useReducer)(FormReducer_default, initialState);
|
|
10849
11097
|
const getSearchableColumns = () => {
|
|
10850
11098
|
return props.columns?.filter((c) => c.isSearchable)?.map((c) => c.name)?.join(",");
|
|
10851
11099
|
};
|
|
10852
|
-
const handleFilterChange = (0,
|
|
11100
|
+
const handleFilterChange = (0, import_react69.useCallback)(
|
|
10853
11101
|
(updatedValues) => {
|
|
10854
11102
|
dispatch({
|
|
10855
11103
|
type: FORM_INPUT_UPDATE,
|
|
@@ -10880,7 +11128,7 @@ var DataList = (props) => {
|
|
|
10880
11128
|
},
|
|
10881
11129
|
[dispatch, props, router]
|
|
10882
11130
|
);
|
|
10883
|
-
(0,
|
|
11131
|
+
(0, import_react69.useEffect)(() => {
|
|
10884
11132
|
if (!props.columns.some((col) => col.isSearchable)) {
|
|
10885
11133
|
return;
|
|
10886
11134
|
}
|
|
@@ -10918,30 +11166,30 @@ var DataList = (props) => {
|
|
|
10918
11166
|
const renderPageNumbers = () => {
|
|
10919
11167
|
if (pages <= 10) {
|
|
10920
11168
|
return Array.from({ length: pages }, (_, index) => index + 1).map(
|
|
10921
|
-
(page) => /* @__PURE__ */ (0,
|
|
11169
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_react69.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
10922
11170
|
Hyperlink,
|
|
10923
11171
|
{
|
|
10924
11172
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
10925
11173
|
href: builder.getNewPageUrl(page),
|
|
10926
11174
|
children: page
|
|
10927
11175
|
}
|
|
10928
|
-
) : /* @__PURE__ */ (0,
|
|
11176
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary-base", children: page }) }, page)
|
|
10929
11177
|
);
|
|
10930
11178
|
} else {
|
|
10931
11179
|
const showFirstPages = activePageNumber <= 5;
|
|
10932
11180
|
const showLastPages = activePageNumber > pages - 5;
|
|
10933
11181
|
if (showFirstPages) {
|
|
10934
|
-
return /* @__PURE__ */ (0,
|
|
10935
|
-
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0,
|
|
11182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(import_jsx_runtime98.Fragment, { children: [
|
|
11183
|
+
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_react69.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
10936
11184
|
Hyperlink,
|
|
10937
11185
|
{
|
|
10938
11186
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
10939
11187
|
href: builder.getNewPageUrl(page),
|
|
10940
11188
|
children: page
|
|
10941
11189
|
}
|
|
10942
|
-
) : /* @__PURE__ */ (0,
|
|
10943
|
-
/* @__PURE__ */ (0,
|
|
10944
|
-
/* @__PURE__ */ (0,
|
|
11190
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary-base", children: page }) }, page)),
|
|
11191
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
11192
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
10945
11193
|
Hyperlink,
|
|
10946
11194
|
{
|
|
10947
11195
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -10949,7 +11197,7 @@ var DataList = (props) => {
|
|
|
10949
11197
|
children: pages - 1
|
|
10950
11198
|
}
|
|
10951
11199
|
),
|
|
10952
|
-
/* @__PURE__ */ (0,
|
|
11200
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
10953
11201
|
Hyperlink,
|
|
10954
11202
|
{
|
|
10955
11203
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -10957,7 +11205,7 @@ var DataList = (props) => {
|
|
|
10957
11205
|
children: pages
|
|
10958
11206
|
}
|
|
10959
11207
|
),
|
|
10960
|
-
/* @__PURE__ */ (0,
|
|
11208
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "relative inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
10961
11209
|
"select",
|
|
10962
11210
|
{
|
|
10963
11211
|
className: " py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -10969,18 +11217,18 @@ var DataList = (props) => {
|
|
|
10969
11217
|
}
|
|
10970
11218
|
},
|
|
10971
11219
|
children: [
|
|
10972
|
-
/* @__PURE__ */ (0,
|
|
11220
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("option", { className: "", value: "", children: "Jump to" }),
|
|
10973
11221
|
Array.from(
|
|
10974
11222
|
{ length: Math.max(0, pages - 10) },
|
|
10975
11223
|
(_, index) => index + 9
|
|
10976
|
-
).map((page) => /* @__PURE__ */ (0,
|
|
11224
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("option", { value: page, children: page }, page))
|
|
10977
11225
|
]
|
|
10978
11226
|
}
|
|
10979
11227
|
) })
|
|
10980
11228
|
] });
|
|
10981
11229
|
} else if (showLastPages) {
|
|
10982
|
-
return /* @__PURE__ */ (0,
|
|
10983
|
-
/* @__PURE__ */ (0,
|
|
11230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(import_jsx_runtime98.Fragment, { children: [
|
|
11231
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
10984
11232
|
Hyperlink,
|
|
10985
11233
|
{
|
|
10986
11234
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -10988,7 +11236,7 @@ var DataList = (props) => {
|
|
|
10988
11236
|
children: "1"
|
|
10989
11237
|
}
|
|
10990
11238
|
),
|
|
10991
|
-
/* @__PURE__ */ (0,
|
|
11239
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
10992
11240
|
Hyperlink,
|
|
10993
11241
|
{
|
|
10994
11242
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -10996,21 +11244,21 @@ var DataList = (props) => {
|
|
|
10996
11244
|
children: "2"
|
|
10997
11245
|
}
|
|
10998
11246
|
),
|
|
10999
|
-
/* @__PURE__ */ (0,
|
|
11247
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
11000
11248
|
Array.from({ length: 8 }, (_, index) => pages - 7 + index).map(
|
|
11001
|
-
(page) => /* @__PURE__ */ (0,
|
|
11249
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_react69.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11002
11250
|
Hyperlink,
|
|
11003
11251
|
{
|
|
11004
11252
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
11005
11253
|
href: builder.getNewPageUrl(page),
|
|
11006
11254
|
children: page
|
|
11007
11255
|
}
|
|
11008
|
-
) : /* @__PURE__ */ (0,
|
|
11256
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary-base", children: page }) }, page)
|
|
11009
11257
|
)
|
|
11010
11258
|
] });
|
|
11011
11259
|
} else {
|
|
11012
|
-
return /* @__PURE__ */ (0,
|
|
11013
|
-
/* @__PURE__ */ (0,
|
|
11260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(import_jsx_runtime98.Fragment, { children: [
|
|
11261
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11014
11262
|
Hyperlink,
|
|
11015
11263
|
{
|
|
11016
11264
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -11018,7 +11266,7 @@ var DataList = (props) => {
|
|
|
11018
11266
|
children: "1"
|
|
11019
11267
|
}
|
|
11020
11268
|
),
|
|
11021
|
-
/* @__PURE__ */ (0,
|
|
11269
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11022
11270
|
Hyperlink,
|
|
11023
11271
|
{
|
|
11024
11272
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -11026,20 +11274,20 @@ var DataList = (props) => {
|
|
|
11026
11274
|
children: "2"
|
|
11027
11275
|
}
|
|
11028
11276
|
),
|
|
11029
|
-
/* @__PURE__ */ (0,
|
|
11277
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
11030
11278
|
Array.from(
|
|
11031
11279
|
{ length: 5 },
|
|
11032
11280
|
(_, index) => activePageNumber - 2 + index
|
|
11033
|
-
).map((page) => /* @__PURE__ */ (0,
|
|
11281
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_react69.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11034
11282
|
Hyperlink,
|
|
11035
11283
|
{
|
|
11036
11284
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
11037
11285
|
href: builder.getNewPageUrl(page),
|
|
11038
11286
|
children: page
|
|
11039
11287
|
}
|
|
11040
|
-
) : /* @__PURE__ */ (0,
|
|
11041
|
-
/* @__PURE__ */ (0,
|
|
11042
|
-
/* @__PURE__ */ (0,
|
|
11288
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary-base", children: page }) }, page)),
|
|
11289
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
11290
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11043
11291
|
Hyperlink,
|
|
11044
11292
|
{
|
|
11045
11293
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -11047,7 +11295,7 @@ var DataList = (props) => {
|
|
|
11047
11295
|
children: pages - 1
|
|
11048
11296
|
}
|
|
11049
11297
|
),
|
|
11050
|
-
/* @__PURE__ */ (0,
|
|
11298
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11051
11299
|
Hyperlink,
|
|
11052
11300
|
{
|
|
11053
11301
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -11055,7 +11303,7 @@ var DataList = (props) => {
|
|
|
11055
11303
|
children: pages
|
|
11056
11304
|
}
|
|
11057
11305
|
),
|
|
11058
|
-
/* @__PURE__ */ (0,
|
|
11306
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "relative inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
11059
11307
|
"select",
|
|
11060
11308
|
{
|
|
11061
11309
|
className: "px-2 py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -11067,8 +11315,8 @@ var DataList = (props) => {
|
|
|
11067
11315
|
}
|
|
11068
11316
|
},
|
|
11069
11317
|
children: [
|
|
11070
|
-
/* @__PURE__ */ (0,
|
|
11071
|
-
Array.from({ length: pages - 4 }, (_, index) => index + 3).filter((page) => page > 2 && page < pages - 1).map((page) => /* @__PURE__ */ (0,
|
|
11318
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("option", { value: "", children: "Jump to" }),
|
|
11319
|
+
Array.from({ length: pages - 4 }, (_, index) => index + 3).filter((page) => page > 2 && page < pages - 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("option", { value: page, children: page }, page))
|
|
11072
11320
|
]
|
|
11073
11321
|
}
|
|
11074
11322
|
) })
|
|
@@ -11076,16 +11324,16 @@ var DataList = (props) => {
|
|
|
11076
11324
|
}
|
|
11077
11325
|
}
|
|
11078
11326
|
};
|
|
11079
|
-
return /* @__PURE__ */ (0,
|
|
11080
|
-
/* @__PURE__ */ (0,
|
|
11081
|
-
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0,
|
|
11327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(import_react69.default.Fragment, { children: [
|
|
11328
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(ContentView_default, { isDataFound, children: [
|
|
11329
|
+
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
11082
11330
|
"div",
|
|
11083
11331
|
{
|
|
11084
11332
|
className: `flex justify-between items-center bg-white pl-6 pr-2 h-14 mb-3 shadow-sm rounded-md sticky top-0`,
|
|
11085
11333
|
children: [
|
|
11086
|
-
props.title ? /* @__PURE__ */ (0,
|
|
11087
|
-
/* @__PURE__ */ (0,
|
|
11088
|
-
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0,
|
|
11334
|
+
props.title ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "inline-flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("h2", { className: "text-lg font-semibold text-black-800", children: props.title }) }) : /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", {}),
|
|
11335
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
11336
|
+
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11089
11337
|
InputControl_default,
|
|
11090
11338
|
{
|
|
11091
11339
|
name: "Search_input",
|
|
@@ -11098,7 +11346,7 @@ var DataList = (props) => {
|
|
|
11098
11346
|
}
|
|
11099
11347
|
}
|
|
11100
11348
|
),
|
|
11101
|
-
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0,
|
|
11349
|
+
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11102
11350
|
InputControl_default,
|
|
11103
11351
|
{
|
|
11104
11352
|
name: filter.name,
|
|
@@ -11113,15 +11361,15 @@ var DataList = (props) => {
|
|
|
11113
11361
|
},
|
|
11114
11362
|
filter.name
|
|
11115
11363
|
)),
|
|
11116
|
-
props.addLinkHref && /* @__PURE__ */ (0,
|
|
11364
|
+
props.addLinkHref && /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
11117
11365
|
Hyperlink,
|
|
11118
11366
|
{
|
|
11119
11367
|
className: "gap-1",
|
|
11120
11368
|
linkType: "Primary" /* Solid */,
|
|
11121
11369
|
href: props.addLinkHref,
|
|
11122
11370
|
children: [
|
|
11123
|
-
/* @__PURE__ */ (0,
|
|
11124
|
-
/* @__PURE__ */ (0,
|
|
11371
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Icon_default, { name: "plus", className: "w-4 h-4" }),
|
|
11372
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "text-sm font-medium", children: props.addLinkText || "Add New" })
|
|
11125
11373
|
]
|
|
11126
11374
|
}
|
|
11127
11375
|
)
|
|
@@ -11129,8 +11377,8 @@ var DataList = (props) => {
|
|
|
11129
11377
|
]
|
|
11130
11378
|
}
|
|
11131
11379
|
),
|
|
11132
|
-
/* @__PURE__ */ (0,
|
|
11133
|
-
/* @__PURE__ */ (0,
|
|
11380
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "flex-1 overflow-y-auto justify-end bg-white rounded shadow h-[calc(100vh-14rem)]", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("table", { className: "w-full divide-y divide-gray-200", children: [
|
|
11381
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("thead", { className: "bg-gray-50 sticky top-0", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("tr", { children: [
|
|
11134
11382
|
props?.columns?.map((column) => {
|
|
11135
11383
|
let url = builder.getNewOrderByUrl(column.name);
|
|
11136
11384
|
let icon = "chevronUpDown";
|
|
@@ -11141,18 +11389,18 @@ var DataList = (props) => {
|
|
|
11141
11389
|
icon = "chevronUp";
|
|
11142
11390
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
11143
11391
|
}
|
|
11144
|
-
return /* @__PURE__ */ (0,
|
|
11392
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11145
11393
|
"th",
|
|
11146
11394
|
{
|
|
11147
11395
|
className: "px-6 py-3 text-left font-medium bg-neutral-soft " + (column.enableSorting ? "cursor-pointer " : "") + column.width + (column.controlType == ViewControlTypes_default.money ? " text-right" : ""),
|
|
11148
|
-
children: /* @__PURE__ */ (0,
|
|
11396
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11149
11397
|
Hyperlink,
|
|
11150
11398
|
{
|
|
11151
11399
|
href: column.enableSorting ? url : void 0,
|
|
11152
11400
|
className: "!text-neutral-contrast ",
|
|
11153
|
-
children: /* @__PURE__ */ (0,
|
|
11154
|
-
/* @__PURE__ */ (0,
|
|
11155
|
-
column.enableSorting && /* @__PURE__ */ (0,
|
|
11401
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("span", { className: "flex items-center space-x-1", children: [
|
|
11402
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "text-black", children: column.label }),
|
|
11403
|
+
column.enableSorting && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Icon_default, { className: "w-4 h-4", name: icon })
|
|
11156
11404
|
] })
|
|
11157
11405
|
}
|
|
11158
11406
|
)
|
|
@@ -11160,25 +11408,25 @@ var DataList = (props) => {
|
|
|
11160
11408
|
column.name
|
|
11161
11409
|
);
|
|
11162
11410
|
}),
|
|
11163
|
-
props.onQuickView && /* @__PURE__ */ (0,
|
|
11411
|
+
props.onQuickView && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("th", { className: "px-6 py-3 text-right font-medium bg-neutral-soft w-32 text-black", children: "Action" })
|
|
11164
11412
|
] }) }),
|
|
11165
|
-
/* @__PURE__ */ (0,
|
|
11413
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("tbody", { className: "divide-y divide-gray-200 ", children: props.dataset?.result?.map((dataitem, index) => {
|
|
11166
11414
|
let validityClass = "";
|
|
11167
11415
|
if (props.recordValidityColumnName && getNestedProperty2(dataitem, props.recordValidityColumnName) == false) {
|
|
11168
11416
|
validityClass = "bg-alert-200";
|
|
11169
11417
|
}
|
|
11170
|
-
return /* @__PURE__ */ (0,
|
|
11418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("tr", { className: validityClass, children: [
|
|
11171
11419
|
props?.columns?.map((column, colindex) => {
|
|
11172
|
-
return /* @__PURE__ */ (0,
|
|
11420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_react69.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11173
11421
|
"td",
|
|
11174
11422
|
{
|
|
11175
11423
|
className: "px-6 py-2 whitespace-normal " + (column.controlType == ViewControlTypes_default.money ? "" : ""),
|
|
11176
|
-
children: column.addhref === true ? /* @__PURE__ */ (0,
|
|
11424
|
+
children: column.addhref === true ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11177
11425
|
Hyperlink,
|
|
11178
11426
|
{
|
|
11179
11427
|
className: "",
|
|
11180
11428
|
href: `https://${dataitem[column.name]}`,
|
|
11181
|
-
children: /* @__PURE__ */ (0,
|
|
11429
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11182
11430
|
ViewControl_default,
|
|
11183
11431
|
{
|
|
11184
11432
|
controlType: column.controlType,
|
|
@@ -11191,11 +11439,11 @@ var DataList = (props) => {
|
|
|
11191
11439
|
}
|
|
11192
11440
|
)
|
|
11193
11441
|
}
|
|
11194
|
-
) : column.showAsLink ? /* @__PURE__ */ (0,
|
|
11442
|
+
) : column.showAsLink ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11195
11443
|
Hyperlink,
|
|
11196
11444
|
{
|
|
11197
11445
|
href: props.path + dataitem[props.columns[0].name] + "/" + (dataitem.linkUrlSegment ?? column.linkUrlSegment),
|
|
11198
|
-
children: /* @__PURE__ */ (0,
|
|
11446
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11199
11447
|
ViewControl_default,
|
|
11200
11448
|
{
|
|
11201
11449
|
controlType: column.controlType,
|
|
@@ -11205,7 +11453,7 @@ var DataList = (props) => {
|
|
|
11205
11453
|
}
|
|
11206
11454
|
)
|
|
11207
11455
|
}
|
|
11208
|
-
) : /* @__PURE__ */ (0,
|
|
11456
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11209
11457
|
ViewControl_default,
|
|
11210
11458
|
{
|
|
11211
11459
|
controlType: column.controlType,
|
|
@@ -11217,7 +11465,7 @@ var DataList = (props) => {
|
|
|
11217
11465
|
}
|
|
11218
11466
|
) }, colindex);
|
|
11219
11467
|
}),
|
|
11220
|
-
props.onQuickView && /* @__PURE__ */ (0,
|
|
11468
|
+
props.onQuickView && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("td", { className: "px-6 py-2 text-right whitespace-nowrap", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
11221
11469
|
"button",
|
|
11222
11470
|
{
|
|
11223
11471
|
type: "button",
|
|
@@ -11227,7 +11475,7 @@ var DataList = (props) => {
|
|
|
11227
11475
|
},
|
|
11228
11476
|
className: "inline-flex items-center gap-1.5 px-3 py-1 text-xs font-semibold rounded-md border border-neutral-300 bg-white hover:bg-neutral-100 text-neutral-800 transition-colors shadow-xs",
|
|
11229
11477
|
children: [
|
|
11230
|
-
/* @__PURE__ */ (0,
|
|
11478
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
11231
11479
|
"svg",
|
|
11232
11480
|
{
|
|
11233
11481
|
className: "w-3.5 h-3.5",
|
|
@@ -11238,22 +11486,22 @@ var DataList = (props) => {
|
|
|
11238
11486
|
strokeLinecap: "round",
|
|
11239
11487
|
strokeLinejoin: "round",
|
|
11240
11488
|
children: [
|
|
11241
|
-
/* @__PURE__ */ (0,
|
|
11242
|
-
/* @__PURE__ */ (0,
|
|
11489
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }),
|
|
11490
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("circle", { cx: "12", cy: "12", r: "3" })
|
|
11243
11491
|
]
|
|
11244
11492
|
}
|
|
11245
11493
|
),
|
|
11246
|
-
/* @__PURE__ */ (0,
|
|
11494
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { children: props.quickViewLabel || "Quick View" })
|
|
11247
11495
|
]
|
|
11248
11496
|
}
|
|
11249
11497
|
) })
|
|
11250
11498
|
] }, index);
|
|
11251
11499
|
}) })
|
|
11252
11500
|
] }) }),
|
|
11253
|
-
/* @__PURE__ */ (0,
|
|
11254
|
-
/* @__PURE__ */ (0,
|
|
11255
|
-
/* @__PURE__ */ (0,
|
|
11256
|
-
activePageNumber > 1 && /* @__PURE__ */ (0,
|
|
11501
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "pt-4 border-t border-t-gray-50 sticky bottom-0 h-11 mt-2 ", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
11502
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "text-gray-700", children: label }),
|
|
11503
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "flex space-x-2 items-center", children: [
|
|
11504
|
+
activePageNumber > 1 && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11257
11505
|
Hyperlink,
|
|
11258
11506
|
{
|
|
11259
11507
|
className: "px-3 py-1 rounded-l-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -11261,9 +11509,9 @@ var DataList = (props) => {
|
|
|
11261
11509
|
children: "Prev"
|
|
11262
11510
|
}
|
|
11263
11511
|
),
|
|
11264
|
-
activePageNumber <= 1 && /* @__PURE__ */ (0,
|
|
11512
|
+
activePageNumber <= 1 && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "px-3 py-1 rounded-l-md border border-gray-300 bg-gray-200 text-gray-500 hover:bg-gray-200", children: "Prev" }),
|
|
11265
11513
|
renderPageNumbers(),
|
|
11266
|
-
activePageNumber < pages && /* @__PURE__ */ (0,
|
|
11514
|
+
activePageNumber < pages && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11267
11515
|
Hyperlink,
|
|
11268
11516
|
{
|
|
11269
11517
|
className: "px-3 py-1 rounded-r-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -11271,19 +11519,19 @@ var DataList = (props) => {
|
|
|
11271
11519
|
children: "Next"
|
|
11272
11520
|
}
|
|
11273
11521
|
),
|
|
11274
|
-
activePageNumber >= pages && /* @__PURE__ */ (0,
|
|
11522
|
+
activePageNumber >= pages && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "px-3 py-1 rounded-r-md border border-gray-300 bg-gray-200 text-gray-500", children: "Next" })
|
|
11275
11523
|
] })
|
|
11276
11524
|
] }) })
|
|
11277
11525
|
] }),
|
|
11278
|
-
/* @__PURE__ */ (0,
|
|
11279
|
-
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0,
|
|
11526
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(NoContentView_default, { isDataFound, children: [
|
|
11527
|
+
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
11280
11528
|
"div",
|
|
11281
11529
|
{
|
|
11282
11530
|
className: `flex justify-between items-center bg-white pl-6 pr-2 h-14 mb-3 shadow-sm rounded-md border-b border-neutral-200`,
|
|
11283
11531
|
children: [
|
|
11284
|
-
props.title ? /* @__PURE__ */ (0,
|
|
11285
|
-
/* @__PURE__ */ (0,
|
|
11286
|
-
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0,
|
|
11532
|
+
props.title ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "inline-flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("h2", { className: "text-lg font-semibold text-black", children: props.title }) }) : /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", {}),
|
|
11533
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
11534
|
+
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11287
11535
|
InputControl_default,
|
|
11288
11536
|
{
|
|
11289
11537
|
name: "Search_input",
|
|
@@ -11296,7 +11544,7 @@ var DataList = (props) => {
|
|
|
11296
11544
|
}
|
|
11297
11545
|
}
|
|
11298
11546
|
),
|
|
11299
|
-
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0,
|
|
11547
|
+
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11300
11548
|
InputControl_default,
|
|
11301
11549
|
{
|
|
11302
11550
|
name: filter.name,
|
|
@@ -11311,15 +11559,15 @@ var DataList = (props) => {
|
|
|
11311
11559
|
},
|
|
11312
11560
|
filter.name
|
|
11313
11561
|
)),
|
|
11314
|
-
props.addLinkHref && /* @__PURE__ */ (0,
|
|
11562
|
+
props.addLinkHref && /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
11315
11563
|
Hyperlink,
|
|
11316
11564
|
{
|
|
11317
11565
|
className: "gap-1",
|
|
11318
11566
|
linkType: "Primary" /* Solid */,
|
|
11319
11567
|
href: props.addLinkHref,
|
|
11320
11568
|
children: [
|
|
11321
|
-
/* @__PURE__ */ (0,
|
|
11322
|
-
/* @__PURE__ */ (0,
|
|
11569
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Icon_default, { name: "plus", className: "w-4 h-4" }),
|
|
11570
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "text-sm font-medium", children: props.addLinkText || "Add New" })
|
|
11323
11571
|
]
|
|
11324
11572
|
}
|
|
11325
11573
|
)
|
|
@@ -11327,8 +11575,8 @@ var DataList = (props) => {
|
|
|
11327
11575
|
]
|
|
11328
11576
|
}
|
|
11329
11577
|
),
|
|
11330
|
-
/* @__PURE__ */ (0,
|
|
11331
|
-
/* @__PURE__ */ (0,
|
|
11578
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "flex-grow overflow-y-auto justify-end bg-white rounded shadow h-[75vh]", children: [
|
|
11579
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("table", { className: "w-full divide-y divide-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("thead", { className: "bg-gray-50", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("tr", { children: props?.columns?.map((column) => {
|
|
11332
11580
|
let url = builder.getNewOrderByUrl(column.name);
|
|
11333
11581
|
let icon = "chevronUpDown";
|
|
11334
11582
|
if (orderBy.includes(`${column.name} desc`)) {
|
|
@@ -11338,18 +11586,18 @@ var DataList = (props) => {
|
|
|
11338
11586
|
icon = "chevronUp";
|
|
11339
11587
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
11340
11588
|
}
|
|
11341
|
-
return /* @__PURE__ */ (0,
|
|
11589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11342
11590
|
"th",
|
|
11343
11591
|
{
|
|
11344
11592
|
className: "px-6 py-3 text-left font-medium bg-neutral-soft " + (column.enableSorting ? "cursor-pointer " : "") + column.width + (column.controlType == ViewControlTypes_default.money ? " text-right" : ""),
|
|
11345
|
-
children: /* @__PURE__ */ (0,
|
|
11593
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11346
11594
|
Hyperlink,
|
|
11347
11595
|
{
|
|
11348
11596
|
href: column.enableSorting ? url : void 0,
|
|
11349
11597
|
className: "text-body-950",
|
|
11350
|
-
children: /* @__PURE__ */ (0,
|
|
11351
|
-
/* @__PURE__ */ (0,
|
|
11352
|
-
column.enableSorting && /* @__PURE__ */ (0,
|
|
11598
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("span", { className: "flex items-center space-x-1", children: [
|
|
11599
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { children: column.label }),
|
|
11600
|
+
column.enableSorting && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Icon_default, { className: "w-4 h-4", name: icon })
|
|
11353
11601
|
] })
|
|
11354
11602
|
}
|
|
11355
11603
|
)
|
|
@@ -11357,7 +11605,7 @@ var DataList = (props) => {
|
|
|
11357
11605
|
column.name
|
|
11358
11606
|
);
|
|
11359
11607
|
}) }) }) }) }),
|
|
11360
|
-
/* @__PURE__ */ (0,
|
|
11608
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "w-full text-center bg-transparent pt-5", children: "There are no entries in the table at the moment." })
|
|
11361
11609
|
] })
|
|
11362
11610
|
] })
|
|
11363
11611
|
] });
|
|
@@ -11365,12 +11613,12 @@ var DataList = (props) => {
|
|
|
11365
11613
|
var DataList_default = DataList;
|
|
11366
11614
|
|
|
11367
11615
|
// src/components/dataForm/DataListRenderer.tsx
|
|
11368
|
-
var
|
|
11616
|
+
var import_react70 = __toESM(require("react"));
|
|
11369
11617
|
init_ServiceClient();
|
|
11370
11618
|
init_OdataBuilder();
|
|
11371
11619
|
init_SelectWithSearchInput();
|
|
11372
11620
|
var import_navigation4 = require("next/navigation");
|
|
11373
|
-
var
|
|
11621
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
11374
11622
|
var viewControlMap = {
|
|
11375
11623
|
number: ViewControlTypes.number,
|
|
11376
11624
|
lineText: ViewControlTypes.lineText,
|
|
@@ -11425,14 +11673,14 @@ var DataListRenderer = ({
|
|
|
11425
11673
|
widgetProps
|
|
11426
11674
|
}) => {
|
|
11427
11675
|
const serviceClient = new ServiceClient_default(apiBaseUrl, session);
|
|
11428
|
-
const [columns, setColumns] = (0,
|
|
11429
|
-
const [dataset, setDataset] = (0,
|
|
11430
|
-
const [filter, setFilters] = (0,
|
|
11431
|
-
const [addLinkHref, setAddLinkHref] = (0,
|
|
11432
|
-
const [addLinkText, setAddLinkText] = (0,
|
|
11433
|
-
const [serviceRoute, setServiceRoute] = (0,
|
|
11676
|
+
const [columns, setColumns] = (0, import_react70.useState)([]);
|
|
11677
|
+
const [dataset, setDataset] = (0, import_react70.useState)();
|
|
11678
|
+
const [filter, setFilters] = (0, import_react70.useState)([]);
|
|
11679
|
+
const [addLinkHref, setAddLinkHref] = (0, import_react70.useState)("");
|
|
11680
|
+
const [addLinkText, setAddLinkText] = (0, import_react70.useState)("");
|
|
11681
|
+
const [serviceRoute, setServiceRoute] = (0, import_react70.useState)("");
|
|
11434
11682
|
const pathname = (0, import_navigation4.usePathname)();
|
|
11435
|
-
(0,
|
|
11683
|
+
(0, import_react70.useEffect)(() => {
|
|
11436
11684
|
if (!formDefinition) return;
|
|
11437
11685
|
setColumns(mapApiToColumns(formDefinition));
|
|
11438
11686
|
setFilters(mapApiToFilters(formDefinition));
|
|
@@ -11445,7 +11693,7 @@ var DataListRenderer = ({
|
|
|
11445
11693
|
setAddLinkHref(resolvedAddLinkHref);
|
|
11446
11694
|
setAddLinkText(formDefinition?.siteFormDataList?.addLinkText ?? "");
|
|
11447
11695
|
}, [formDefinition, params]);
|
|
11448
|
-
(0,
|
|
11696
|
+
(0, import_react70.useEffect)(() => {
|
|
11449
11697
|
const fetchData = async () => {
|
|
11450
11698
|
if (!serviceRoute) return;
|
|
11451
11699
|
const resolvedRoute = resolveRoutePlaceholders2(serviceRoute, params);
|
|
@@ -11465,13 +11713,13 @@ var DataListRenderer = ({
|
|
|
11465
11713
|
isActive: landingPageUrl === pathname
|
|
11466
11714
|
};
|
|
11467
11715
|
});
|
|
11468
|
-
return /* @__PURE__ */ (0,
|
|
11716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(import_react70.default.Fragment, { children: [
|
|
11469
11717
|
resolvedTabs.length > 0 && // <NavigationTabsV2
|
|
11470
11718
|
// tabs={resolvedTabs}
|
|
11471
11719
|
// params={(widgetProps?.params ?? params) as Record<string, any>}
|
|
11472
11720
|
// />
|
|
11473
|
-
/* @__PURE__ */ (0,
|
|
11474
|
-
/* @__PURE__ */ (0,
|
|
11721
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(NavigationTabsV2_default, { tabs, params: widgetProps.params }),
|
|
11722
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
11475
11723
|
DataList_default,
|
|
11476
11724
|
{
|
|
11477
11725
|
addLinkHref,
|
|
@@ -11493,13 +11741,13 @@ var DataListRenderer_default = DataListRenderer;
|
|
|
11493
11741
|
init_InputControlType();
|
|
11494
11742
|
|
|
11495
11743
|
// src/components/dataForm/DataForm.tsx
|
|
11496
|
-
var
|
|
11744
|
+
var import_react72 = __toESM(require("react"));
|
|
11497
11745
|
init_Icon();
|
|
11498
11746
|
init_Button();
|
|
11499
11747
|
init_StyleTypes();
|
|
11500
11748
|
|
|
11501
11749
|
// src/components/dataForm/DataFormChildSection.tsx
|
|
11502
|
-
var
|
|
11750
|
+
var import_react71 = __toESM(require("react"));
|
|
11503
11751
|
|
|
11504
11752
|
// src/components/dataForm/StyleTypes.tsx
|
|
11505
11753
|
var StyleTypes2 = /* @__PURE__ */ ((StyleTypes3) => {
|
|
@@ -11526,7 +11774,7 @@ var FORM_CHILD_ONE_TO_ONE_UPDATE = "FORM_CHILD_ONE_TO_ONE_UPDATE";
|
|
|
11526
11774
|
var FORM_CHILD_ROW_ADD = "FORM_CHILD_ROW_ADD";
|
|
11527
11775
|
|
|
11528
11776
|
// src/components/dataForm/DataFormChildSection.tsx
|
|
11529
|
-
var
|
|
11777
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
11530
11778
|
var DataFormChildSection = (props) => {
|
|
11531
11779
|
const { section } = props;
|
|
11532
11780
|
const isOneToOne = section.relationshipType === "one-to-one";
|
|
@@ -11538,7 +11786,7 @@ var DataFormChildSection = (props) => {
|
|
|
11538
11786
|
return childItems.map((item, originalIndex) => ({ item, originalIndex })).filter((x) => !x.item.isDeleted) || [];
|
|
11539
11787
|
};
|
|
11540
11788
|
const childItemsToRender = getChildItemsForRendering();
|
|
11541
|
-
const handleChildInputChange = (0,
|
|
11789
|
+
const handleChildInputChange = (0, import_react71.useCallback)(
|
|
11542
11790
|
(updatedValues) => {
|
|
11543
11791
|
if (isOneToOne) {
|
|
11544
11792
|
props.callback({
|
|
@@ -11565,7 +11813,7 @@ var DataFormChildSection = (props) => {
|
|
|
11565
11813
|
},
|
|
11566
11814
|
[props, isOneToOne, childItemsToRender]
|
|
11567
11815
|
);
|
|
11568
|
-
const onAddRow = (0,
|
|
11816
|
+
const onAddRow = (0, import_react71.useCallback)(() => {
|
|
11569
11817
|
props.callback({
|
|
11570
11818
|
sectionName: props.section.name,
|
|
11571
11819
|
actionType: FORM_CHILD_ROW_ADD,
|
|
@@ -11574,7 +11822,7 @@ var DataFormChildSection = (props) => {
|
|
|
11574
11822
|
rowIndex: -1
|
|
11575
11823
|
});
|
|
11576
11824
|
}, [props]);
|
|
11577
|
-
const onDeleteRow = (0,
|
|
11825
|
+
const onDeleteRow = (0, import_react71.useCallback)(
|
|
11578
11826
|
(filteredIndex) => {
|
|
11579
11827
|
const visibleItem = childItemsToRender[filteredIndex];
|
|
11580
11828
|
if (visibleItem) {
|
|
@@ -11594,14 +11842,14 @@ var DataFormChildSection = (props) => {
|
|
|
11594
11842
|
childItemsToRender,
|
|
11595
11843
|
allChildItems: childItems
|
|
11596
11844
|
});
|
|
11597
|
-
return /* @__PURE__ */ (0,
|
|
11598
|
-
section.sectionTitle && /* @__PURE__ */ (0,
|
|
11599
|
-
/* @__PURE__ */ (0,
|
|
11600
|
-
/* @__PURE__ */ (0,
|
|
11601
|
-
(!isOneToOne || childItemsToRender.length > 0) && /* @__PURE__ */ (0,
|
|
11602
|
-
return /* @__PURE__ */ (0,
|
|
11845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_react71.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "rounded border-neutral-200 border px-6 py-4 mb-2", children: [
|
|
11846
|
+
section.sectionTitle && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "mb-4 text-lg font-medium text-body-950", children: section.sectionTitle }),
|
|
11847
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "flex-grow flex flex-col justify-between overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "flex flex-col justify-between gap-2", children: [
|
|
11848
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("table", { className: "w-full border-separate divide-y divide-gray-200", children: [
|
|
11849
|
+
(!isOneToOne || childItemsToRender.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("thead", { className: "", children: section.sectionRows.map((sectionRow, sectionRowIndex) => {
|
|
11850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("tr", { className: "", children: [
|
|
11603
11851
|
sectionRow.elements.map((field, index) => {
|
|
11604
|
-
return /* @__PURE__ */ (0,
|
|
11852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
11605
11853
|
"th",
|
|
11606
11854
|
{
|
|
11607
11855
|
className: "py-3 font-normal text-left",
|
|
@@ -11610,21 +11858,21 @@ var DataFormChildSection = (props) => {
|
|
|
11610
11858
|
field.name
|
|
11611
11859
|
);
|
|
11612
11860
|
}),
|
|
11613
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */ (0,
|
|
11861
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("th", { className: "py-3 font-normal text-left", children: "Actions" })
|
|
11614
11862
|
] }, sectionRowIndex);
|
|
11615
11863
|
}) }),
|
|
11616
|
-
/* @__PURE__ */ (0,
|
|
11864
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("tbody", { className: "divide-y divide-gray-200", children: childItemsToRender.map((visibleItem, filteredIndex) => {
|
|
11617
11865
|
const { item, originalIndex } = visibleItem;
|
|
11618
11866
|
const rowKey = originalIndex;
|
|
11619
|
-
return /* @__PURE__ */ (0,
|
|
11867
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_react71.default.Fragment, { children: section.sectionRows.map(
|
|
11620
11868
|
(sectionRow, sectionRowIndex) => {
|
|
11621
|
-
return /* @__PURE__ */ (0,
|
|
11869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
|
|
11622
11870
|
"tr",
|
|
11623
11871
|
{
|
|
11624
11872
|
className: "",
|
|
11625
11873
|
children: [
|
|
11626
11874
|
sectionRow.elements.map((field, index) => {
|
|
11627
|
-
return /* @__PURE__ */ (0,
|
|
11875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "w-11/12", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
11628
11876
|
InputControl_default,
|
|
11629
11877
|
{
|
|
11630
11878
|
index: filteredIndex,
|
|
@@ -11644,7 +11892,7 @@ var DataFormChildSection = (props) => {
|
|
|
11644
11892
|
}
|
|
11645
11893
|
) }) }) }, field.name);
|
|
11646
11894
|
}),
|
|
11647
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */ (0,
|
|
11895
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
11648
11896
|
ClientButton_default,
|
|
11649
11897
|
{
|
|
11650
11898
|
ButtonType: StyleTypes2.Hollow,
|
|
@@ -11653,7 +11901,7 @@ var DataFormChildSection = (props) => {
|
|
|
11653
11901
|
},
|
|
11654
11902
|
dataRole: "delete",
|
|
11655
11903
|
tabIndex: -1,
|
|
11656
|
-
children: /* @__PURE__ */ (0,
|
|
11904
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
11657
11905
|
Icon_default,
|
|
11658
11906
|
{
|
|
11659
11907
|
className: "w-4 h-4",
|
|
@@ -11670,7 +11918,7 @@ var DataFormChildSection = (props) => {
|
|
|
11670
11918
|
) }, rowKey);
|
|
11671
11919
|
}) })
|
|
11672
11920
|
] }) }),
|
|
11673
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */ (0,
|
|
11921
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "ml-1", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
11674
11922
|
ClientButton_default,
|
|
11675
11923
|
{
|
|
11676
11924
|
ButtonType: "Link" /* Link */,
|
|
@@ -11685,9 +11933,9 @@ var DataFormChildSection = (props) => {
|
|
|
11685
11933
|
var DataFormChildSection_default = DataFormChildSection;
|
|
11686
11934
|
|
|
11687
11935
|
// src/components/dataForm/DataForm.tsx
|
|
11688
|
-
var
|
|
11936
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
11689
11937
|
var DataForm = (props) => {
|
|
11690
|
-
const formRef = (0,
|
|
11938
|
+
const formRef = (0, import_react72.useRef)(null);
|
|
11691
11939
|
console.log(props.dataItem, "dssads");
|
|
11692
11940
|
const initialState = {
|
|
11693
11941
|
inputValues: {},
|
|
@@ -11696,9 +11944,9 @@ var DataForm = (props) => {
|
|
|
11696
11944
|
const childInitialState = {
|
|
11697
11945
|
inputValues: []
|
|
11698
11946
|
};
|
|
11699
|
-
const [formState, dispatch] = (0,
|
|
11947
|
+
const [formState, dispatch] = (0, import_react72.useReducer)(FormReducer_default, initialState);
|
|
11700
11948
|
console.log(props.sections, "sections");
|
|
11701
|
-
const clearHiddenChildSections = (0,
|
|
11949
|
+
const clearHiddenChildSections = (0, import_react72.useCallback)(
|
|
11702
11950
|
(changedProperty, newValues) => {
|
|
11703
11951
|
if (!props.sections) return;
|
|
11704
11952
|
const allChildSections = [];
|
|
@@ -11736,7 +11984,7 @@ var DataForm = (props) => {
|
|
|
11736
11984
|
},
|
|
11737
11985
|
[props.sections, formState.inputValues]
|
|
11738
11986
|
);
|
|
11739
|
-
const handleInputChange = (0,
|
|
11987
|
+
const handleInputChange = (0, import_react72.useCallback)(
|
|
11740
11988
|
async (updatedValues) => {
|
|
11741
11989
|
dispatch({
|
|
11742
11990
|
type: FORM_INPUT_UPDATE,
|
|
@@ -11751,7 +11999,7 @@ var DataForm = (props) => {
|
|
|
11751
11999
|
},
|
|
11752
12000
|
[dispatch, formState.inputValues, clearHiddenChildSections]
|
|
11753
12001
|
);
|
|
11754
|
-
const fetchData = (0,
|
|
12002
|
+
const fetchData = (0, import_react72.useCallback)(async () => {
|
|
11755
12003
|
if (!props.rules) return;
|
|
11756
12004
|
if (Object.keys(formState.inputValues).length === 0) {
|
|
11757
12005
|
return;
|
|
@@ -11782,7 +12030,7 @@ var DataForm = (props) => {
|
|
|
11782
12030
|
console.error("Error fetching data:", error);
|
|
11783
12031
|
}
|
|
11784
12032
|
}, [formState.lastPropertyChanged, formState.inputValues]);
|
|
11785
|
-
(0,
|
|
12033
|
+
(0, import_react72.useEffect)(() => {
|
|
11786
12034
|
fetchData();
|
|
11787
12035
|
}, [formState.inputValues, formState.lastPropertyChanged]);
|
|
11788
12036
|
function replacePlaceholders(template, context, params) {
|
|
@@ -11802,7 +12050,7 @@ var DataForm = (props) => {
|
|
|
11802
12050
|
}
|
|
11803
12051
|
);
|
|
11804
12052
|
}
|
|
11805
|
-
const handleChildSectionChangeCallback = (0,
|
|
12053
|
+
const handleChildSectionChangeCallback = (0, import_react72.useCallback)(
|
|
11806
12054
|
(params) => {
|
|
11807
12055
|
dispatch({
|
|
11808
12056
|
type: params.actionType,
|
|
@@ -11847,7 +12095,7 @@ var DataForm = (props) => {
|
|
|
11847
12095
|
});
|
|
11848
12096
|
return cloned;
|
|
11849
12097
|
}
|
|
11850
|
-
const onClick = (0,
|
|
12098
|
+
const onClick = (0, import_react72.useCallback)(async () => {
|
|
11851
12099
|
if (props.onClick) {
|
|
11852
12100
|
const isEdit = props.dataItem && Object.keys(props.dataItem).length > 0;
|
|
11853
12101
|
const normalizedValues = normalizeChildSections(
|
|
@@ -11863,21 +12111,21 @@ var DataForm = (props) => {
|
|
|
11863
12111
|
return { isSuccessful: true };
|
|
11864
12112
|
}
|
|
11865
12113
|
}, [formState, props]);
|
|
11866
|
-
const handleAdditionalOnClick = (0,
|
|
12114
|
+
const handleAdditionalOnClick = (0, import_react72.useCallback)(async () => {
|
|
11867
12115
|
if (props.additionalActions?.onClick) {
|
|
11868
12116
|
return await props.additionalActions.onClick(formState);
|
|
11869
12117
|
} else {
|
|
11870
12118
|
return { isSuccessful: true, message: "Action completed successfully" };
|
|
11871
12119
|
}
|
|
11872
12120
|
}, [formState, props]);
|
|
11873
|
-
const onDelete = (0,
|
|
12121
|
+
const onDelete = (0, import_react72.useCallback)(async () => {
|
|
11874
12122
|
if (props.onDelete) {
|
|
11875
12123
|
return await props.onDelete(formState);
|
|
11876
12124
|
} else {
|
|
11877
12125
|
return { isSuccessful: true };
|
|
11878
12126
|
}
|
|
11879
12127
|
}, [formState, props]);
|
|
11880
|
-
(0,
|
|
12128
|
+
(0, import_react72.useEffect)(() => {
|
|
11881
12129
|
if (props.dataItem) {
|
|
11882
12130
|
dispatch({
|
|
11883
12131
|
type: FORM_INITIAL_UPDATE,
|
|
@@ -11905,19 +12153,19 @@ var DataForm = (props) => {
|
|
|
11905
12153
|
return false;
|
|
11906
12154
|
}
|
|
11907
12155
|
}
|
|
11908
|
-
return /* @__PURE__ */ (0,
|
|
11909
|
-
props.title && /* @__PURE__ */ (0,
|
|
12156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_react72.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "flex-grow flex flex-col", children: [
|
|
12157
|
+
props.title && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "inline-flex items-center gap-2 px-6 py-3 border border-neutral-200 bg-white shadow-sm rounded-t-md", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(
|
|
11910
12158
|
"div",
|
|
11911
12159
|
{
|
|
11912
12160
|
className: "inline-flex items-center gap-2 cursor-pointer",
|
|
11913
12161
|
onClick: () => window.history.back(),
|
|
11914
12162
|
children: [
|
|
11915
|
-
/* @__PURE__ */ (0,
|
|
11916
|
-
/* @__PURE__ */ (0,
|
|
12163
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Icon_default, { name: "chevronLeft", className: "w-4 h-4 text-primary-800" }),
|
|
12164
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("h2", { className: "text-lg font-semibold text-primary-800", children: props.title })
|
|
11917
12165
|
]
|
|
11918
12166
|
}
|
|
11919
12167
|
) }),
|
|
11920
|
-
/* @__PURE__ */ (0,
|
|
12168
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
11921
12169
|
"form",
|
|
11922
12170
|
{
|
|
11923
12171
|
className: "group space-y-6 pb-6 overflow-y-auto",
|
|
@@ -11938,8 +12186,8 @@ var DataForm = (props) => {
|
|
|
11938
12186
|
}
|
|
11939
12187
|
}
|
|
11940
12188
|
},
|
|
11941
|
-
children: /* @__PURE__ */ (0,
|
|
11942
|
-
return /* @__PURE__ */ (0,
|
|
12189
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "flex flex-col gap-6", children: props.sections?.map((section, sectionIndex) => {
|
|
12190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_react72.default.Fragment, { children: !section.isChildSection && /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: " rounded-b-lg bg-white shadow border-neutral-200 border px-8 py-6 ", children: [
|
|
11943
12191
|
section.sectionRows?.map(
|
|
11944
12192
|
(sectionRow, sectionRowIndex) => {
|
|
11945
12193
|
const elementsCount = sectionRow.elements.length;
|
|
@@ -11950,14 +12198,14 @@ var DataForm = (props) => {
|
|
|
11950
12198
|
sectionRow.visible
|
|
11951
12199
|
);
|
|
11952
12200
|
}
|
|
11953
|
-
return /* @__PURE__ */ (0,
|
|
11954
|
-
return /* @__PURE__ */ (0,
|
|
12201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_react72.default.Fragment, { children: isVisible && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "lg:flex gap-14 flex-1 mb-4 ", children: sectionRow.elements.map((field, index) => {
|
|
12202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(
|
|
11955
12203
|
"div",
|
|
11956
12204
|
{
|
|
11957
12205
|
className: sectionRow.grow ? "grow" : "",
|
|
11958
12206
|
children: [
|
|
11959
|
-
/* @__PURE__ */ (0,
|
|
11960
|
-
/* @__PURE__ */ (0,
|
|
12207
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { children: field.controlType }),
|
|
12208
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
11961
12209
|
InputControl_default,
|
|
11962
12210
|
{
|
|
11963
12211
|
name: field.name,
|
|
@@ -11987,12 +12235,12 @@ var DataForm = (props) => {
|
|
|
11987
12235
|
}) }) }, sectionRowIndex);
|
|
11988
12236
|
}
|
|
11989
12237
|
),
|
|
11990
|
-
/* @__PURE__ */ (0,
|
|
12238
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { children: section.childSections?.map(
|
|
11991
12239
|
(childSection, childSectionIndex) => {
|
|
11992
|
-
return /* @__PURE__ */ (0,
|
|
12240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { children: childSection.name && evalutateCondition(
|
|
11993
12241
|
formState.inputValues,
|
|
11994
12242
|
childSection.visible
|
|
11995
|
-
) && /* @__PURE__ */ (0,
|
|
12243
|
+
) && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
11996
12244
|
DataFormChildSection_default,
|
|
11997
12245
|
{
|
|
11998
12246
|
section: childSection,
|
|
@@ -12007,8 +12255,8 @@ var DataForm = (props) => {
|
|
|
12007
12255
|
}) })
|
|
12008
12256
|
}
|
|
12009
12257
|
),
|
|
12010
|
-
/* @__PURE__ */ (0,
|
|
12011
|
-
/* @__PURE__ */ (0,
|
|
12258
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "flex px-6 py-3 mt-2 mb-2 justify-end items-center gap-5", children: [
|
|
12259
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { children: props.additionalActions && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
12012
12260
|
Button_default,
|
|
12013
12261
|
{
|
|
12014
12262
|
ButtonType: "PrimaryHollow" /* Hollow */,
|
|
@@ -12016,7 +12264,7 @@ var DataForm = (props) => {
|
|
|
12016
12264
|
children: props.additionalActions.title
|
|
12017
12265
|
}
|
|
12018
12266
|
) }),
|
|
12019
|
-
/* @__PURE__ */ (0,
|
|
12267
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { children: props.onDelete && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
12020
12268
|
Button_default,
|
|
12021
12269
|
{
|
|
12022
12270
|
ButtonType: "PrimaryHollow" /* Hollow */,
|
|
@@ -12027,7 +12275,7 @@ var DataForm = (props) => {
|
|
|
12027
12275
|
children: "Delete"
|
|
12028
12276
|
}
|
|
12029
12277
|
) }),
|
|
12030
|
-
/* @__PURE__ */ (0,
|
|
12278
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { children: props.onClick && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
12031
12279
|
Button_default,
|
|
12032
12280
|
{
|
|
12033
12281
|
onValidate,
|
|
@@ -12045,7 +12293,7 @@ var DataForm_default = DataForm;
|
|
|
12045
12293
|
|
|
12046
12294
|
// src/components/dataForm/DataFormRenderer.tsx
|
|
12047
12295
|
init_ServiceClient();
|
|
12048
|
-
var
|
|
12296
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
12049
12297
|
function getAction(actions, code) {
|
|
12050
12298
|
return actions?.find((a) => a.actionCode === code);
|
|
12051
12299
|
}
|
|
@@ -12071,9 +12319,9 @@ var DataFormRenderer = ({
|
|
|
12071
12319
|
"Delete"
|
|
12072
12320
|
);
|
|
12073
12321
|
const hasDataItem = dataItem && Object.keys(dataItem).length > 0;
|
|
12074
|
-
return /* @__PURE__ */ (0,
|
|
12075
|
-
widgetProps && /* @__PURE__ */ (0,
|
|
12076
|
-
/* @__PURE__ */ (0,
|
|
12322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "flex-grow flex flex-col", children: [
|
|
12323
|
+
widgetProps && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(NavigationTabsV2_default, { tabs, params: widgetProps.params }),
|
|
12324
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
12077
12325
|
DataForm_default,
|
|
12078
12326
|
{
|
|
12079
12327
|
title: !isAddPage ? "Edit " + formDefinition.formTitle + "- v2" : "Add " + formDefinition.formTitle + "- v2",
|