@clyrex-digital/clyrex-controls-dev 0.8.1-dev.20261013062551 → 0.8.1-dev.20261013114908
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-LTCRGB3L.mjs +130 -0
- package/dist/MediaAccordionNodeClient-W5FT2BK4.mjs +132 -0
- package/dist/index.js +707 -471
- package/dist/index.mjs +259 -159
- package/dist/server.js +506 -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,161 @@ 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-clip": props.node.buttonBackgroundClipText ? "text" : "border-box",
|
|
6035
|
+
"--story-inactive-button-background": props.node.buttonInactiveBackgroundColor || "var(--neutral)",
|
|
6036
|
+
"--story-inactive-button-text": props.node.buttonInactiveTextColor || "var(--neutral-text-base)"
|
|
6037
|
+
},
|
|
6038
|
+
children: [
|
|
6039
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("style", { children: `
|
|
6040
|
+
.story-accordion { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(260px,1fr); gap:20px; align-items:stretch; width:100%; padding:16px; border-radius:14px; background:var(--neutral); }
|
|
6041
|
+
.story-accordion__media { position:relative; min-height:320px; overflow:hidden; border-radius:10px; background:var(--neutral-border); }
|
|
6042
|
+
.story-accordion__media > * { display:block; width:100%; height:100%; min-height:320px; }
|
|
6043
|
+
.story-accordion__media-image, .story-accordion__media-video { object-fit:cover; }
|
|
6044
|
+
.story-accordion__list { display:flex; flex-direction:column; justify-content:center; gap:10px; min-width:0; }
|
|
6045
|
+
.story-accordion__item { width:100%; min-height:54px; padding:12px 16px; border:1px solid var(--neutral-border); border-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; }
|
|
6046
|
+
.story-accordion__item:hover { border-color:var(--primary-action-fill); }
|
|
6047
|
+
.story-accordion__item[aria-pressed="true"] { border-color:transparent; background:var(--story-button-background); color:var(--story-button-text); background-clip:var(--story-button-clip); -webkit-background-clip:var(--story-button-clip); }
|
|
6048
|
+
.story-accordion__item.is-inactive.is-custom { background:var(--story-inactive-button-background); color:var(--story-inactive-button-text); }
|
|
6049
|
+
.story-accordion__item:focus-visible { outline:3px solid var(--primary-action-fill); outline-offset:2px; }
|
|
6050
|
+
@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; } }
|
|
6051
|
+
` }),
|
|
6052
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "story-accordion__media", children: activeItem ? renderMedia(activeItem) : null }),
|
|
6053
|
+
/* @__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)(
|
|
6054
|
+
"button",
|
|
6055
|
+
{
|
|
6056
|
+
type: "button",
|
|
6057
|
+
className: `story-accordion__item ${index === activeIndex ? "is-active" : "is-inactive"} ${props.node.buttonInactiveStyleEnabled && index !== activeIndex ? "is-custom" : ""}`,
|
|
6058
|
+
"aria-pressed": index === activeIndex,
|
|
6059
|
+
style: index !== activeIndex && props.node.buttonInactiveStyleEnabled ? {
|
|
6060
|
+
background: props.node.buttonInactiveBackgroundColor || "var(--neutral)",
|
|
6061
|
+
color: props.node.buttonInactiveTextColor || "var(--neutral-text-base)"
|
|
6062
|
+
} : void 0,
|
|
6063
|
+
onClick: () => setActiveIndex(index),
|
|
6064
|
+
children: item.title
|
|
6065
|
+
},
|
|
6066
|
+
item.id || `${item.title}-${index}`
|
|
6067
|
+
)) })
|
|
6068
|
+
]
|
|
6069
|
+
}
|
|
6070
|
+
);
|
|
6071
|
+
};
|
|
6072
|
+
MediaAccordionNodeClient_default = MediaAccordionNodeClient;
|
|
6073
|
+
}
|
|
6074
|
+
});
|
|
6075
|
+
|
|
5941
6076
|
// src/components/Pagination.tsx
|
|
5942
6077
|
var Pagination_exports = {};
|
|
5943
6078
|
__export(Pagination_exports, {
|
|
5944
6079
|
default: () => Pagination_default
|
|
5945
6080
|
});
|
|
5946
|
-
var
|
|
6081
|
+
var import_react60, import_jsx_runtime89, Pagination, Pagination_default;
|
|
5947
6082
|
var init_Pagination = __esm({
|
|
5948
6083
|
"src/components/Pagination.tsx"() {
|
|
5949
6084
|
"use strict";
|
|
5950
6085
|
"use client";
|
|
5951
|
-
|
|
6086
|
+
import_react60 = require("react");
|
|
5952
6087
|
init_OdataBuilder();
|
|
5953
6088
|
init_Icon();
|
|
5954
6089
|
init_StyleTypes();
|
|
5955
6090
|
init_InputControlType();
|
|
5956
6091
|
init_Hyperlink();
|
|
5957
|
-
|
|
6092
|
+
import_jsx_runtime89 = require("react/jsx-runtime");
|
|
5958
6093
|
Pagination = (props) => {
|
|
5959
6094
|
const { dataset, path, query, showPageSizeSelector = false, showJumpToPage = false } = props;
|
|
5960
|
-
const builder = (0,
|
|
6095
|
+
const builder = (0, import_react60.useMemo)(() => {
|
|
5961
6096
|
const b = new OdataBuilder(path);
|
|
5962
6097
|
if (query) b.setQuery(query);
|
|
5963
6098
|
return b;
|
|
@@ -5998,7 +6133,7 @@ var init_Pagination = __esm({
|
|
|
5998
6133
|
return range;
|
|
5999
6134
|
};
|
|
6000
6135
|
const paginationRange = getPaginationRange();
|
|
6001
|
-
const PageButton = ({ page, children }) => /* @__PURE__ */ (0,
|
|
6136
|
+
const PageButton = ({ page, children }) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
6002
6137
|
Hyperlink,
|
|
6003
6138
|
{
|
|
6004
6139
|
linkType: "Link" /* Link */,
|
|
@@ -6013,9 +6148,9 @@ var init_Pagination = __esm({
|
|
|
6013
6148
|
);
|
|
6014
6149
|
const NavigationButton = ({ page, disabled, children }) => {
|
|
6015
6150
|
if (disabled) {
|
|
6016
|
-
return /* @__PURE__ */ (0,
|
|
6151
|
+
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
6152
|
}
|
|
6018
|
-
return /* @__PURE__ */ (0,
|
|
6153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
6019
6154
|
Hyperlink,
|
|
6020
6155
|
{
|
|
6021
6156
|
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 +6160,35 @@ var init_Pagination = __esm({
|
|
|
6025
6160
|
);
|
|
6026
6161
|
};
|
|
6027
6162
|
if (totalPages <= 1 && totalItems === 0) return null;
|
|
6028
|
-
return /* @__PURE__ */ (0,
|
|
6029
|
-
/* @__PURE__ */ (0,
|
|
6030
|
-
/* @__PURE__ */ (0,
|
|
6163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "py-6 border-t mt-6", children: [
|
|
6164
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "flex flex-col sm:flex-row items-center justify-between gap-4", children: [
|
|
6165
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "text-sm", children: [
|
|
6031
6166
|
"Showing ",
|
|
6032
|
-
/* @__PURE__ */ (0,
|
|
6167
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("span", { className: "font-semibold", children: [
|
|
6033
6168
|
startItem,
|
|
6034
6169
|
"-",
|
|
6035
6170
|
endItem
|
|
6036
6171
|
] }),
|
|
6037
6172
|
" ",
|
|
6038
6173
|
"out of ",
|
|
6039
|
-
/* @__PURE__ */ (0,
|
|
6174
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "font-semibold", children: totalItems.toLocaleString() }),
|
|
6040
6175
|
" results"
|
|
6041
6176
|
] }),
|
|
6042
|
-
totalPages > 1 && /* @__PURE__ */ (0,
|
|
6043
|
-
/* @__PURE__ */ (0,
|
|
6177
|
+
totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "flex items-center space-x-1", children: [
|
|
6178
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
6044
6179
|
NavigationButton,
|
|
6045
6180
|
{
|
|
6046
6181
|
page: activePageNumber - 1,
|
|
6047
6182
|
disabled: activePageNumber === 1,
|
|
6048
6183
|
children: [
|
|
6049
|
-
/* @__PURE__ */ (0,
|
|
6050
|
-
/* @__PURE__ */ (0,
|
|
6184
|
+
/* @__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" }) }),
|
|
6185
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "text-sm", children: "Prev" })
|
|
6051
6186
|
]
|
|
6052
6187
|
}
|
|
6053
6188
|
),
|
|
6054
6189
|
paginationRange.map((item, index) => {
|
|
6055
6190
|
if (item === "...") {
|
|
6056
|
-
return /* @__PURE__ */ (0,
|
|
6191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
6057
6192
|
"span",
|
|
6058
6193
|
{
|
|
6059
6194
|
className: "min-w-[20px] md:min-w-[40px] h-10 flex items-center justify-center text-gray-500",
|
|
@@ -6063,23 +6198,23 @@ var init_Pagination = __esm({
|
|
|
6063
6198
|
);
|
|
6064
6199
|
}
|
|
6065
6200
|
const page = item;
|
|
6066
|
-
return /* @__PURE__ */ (0,
|
|
6201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(PageButton, { page, children: page }, page);
|
|
6067
6202
|
}),
|
|
6068
|
-
/* @__PURE__ */ (0,
|
|
6203
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
6069
6204
|
NavigationButton,
|
|
6070
6205
|
{
|
|
6071
6206
|
page: activePageNumber + 1,
|
|
6072
6207
|
disabled: activePageNumber === totalPages,
|
|
6073
6208
|
children: [
|
|
6074
|
-
/* @__PURE__ */ (0,
|
|
6075
|
-
/* @__PURE__ */ (0,
|
|
6209
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "text-sm", children: "Next" }),
|
|
6210
|
+
/* @__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
6211
|
]
|
|
6077
6212
|
}
|
|
6078
6213
|
)
|
|
6079
6214
|
] }),
|
|
6080
|
-
showJumpToPage && totalPages > 5 && /* @__PURE__ */ (0,
|
|
6081
|
-
/* @__PURE__ */ (0,
|
|
6082
|
-
/* @__PURE__ */ (0,
|
|
6215
|
+
showJumpToPage && totalPages > 5 && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "flex items-center space-x-2", children: [
|
|
6216
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "text-sm", children: "Go to:" }),
|
|
6217
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
6083
6218
|
"input",
|
|
6084
6219
|
{
|
|
6085
6220
|
type: "number",
|
|
@@ -6100,9 +6235,9 @@ var init_Pagination = __esm({
|
|
|
6100
6235
|
) })
|
|
6101
6236
|
] })
|
|
6102
6237
|
] }),
|
|
6103
|
-
showPageSizeSelector && /* @__PURE__ */ (0,
|
|
6104
|
-
/* @__PURE__ */ (0,
|
|
6105
|
-
/* @__PURE__ */ (0,
|
|
6238
|
+
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: [
|
|
6239
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "text-sm", children: "Show:" }),
|
|
6240
|
+
/* @__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
6241
|
Hyperlink,
|
|
6107
6242
|
{
|
|
6108
6243
|
className: `
|
|
@@ -6114,7 +6249,7 @@ var init_Pagination = __esm({
|
|
|
6114
6249
|
},
|
|
6115
6250
|
size
|
|
6116
6251
|
)) }),
|
|
6117
|
-
/* @__PURE__ */ (0,
|
|
6252
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "text-sm", children: "per page" })
|
|
6118
6253
|
] }) })
|
|
6119
6254
|
] });
|
|
6120
6255
|
};
|
|
@@ -6127,16 +6262,16 @@ var DataBindingControls_exports = {};
|
|
|
6127
6262
|
__export(DataBindingControls_exports, {
|
|
6128
6263
|
default: () => DataBindingControls_default
|
|
6129
6264
|
});
|
|
6130
|
-
var
|
|
6265
|
+
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
6266
|
var init_DataBindingControls = __esm({
|
|
6132
6267
|
"src/components/pageRenderingEngine/nodes/DataBindingControls.tsx"() {
|
|
6133
6268
|
"use strict";
|
|
6134
6269
|
"use client";
|
|
6135
|
-
|
|
6270
|
+
import_react61 = require("react");
|
|
6136
6271
|
import_navigation = require("next/navigation");
|
|
6137
6272
|
init_Button();
|
|
6138
6273
|
init_StyleTypes();
|
|
6139
|
-
|
|
6274
|
+
import_jsx_runtime90 = require("react/jsx-runtime");
|
|
6140
6275
|
humanize = (value) => value.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").trim();
|
|
6141
6276
|
escapeODataString = (value) => value.replace(/'/g, "''");
|
|
6142
6277
|
parseFacetSelections = (filter) => {
|
|
@@ -6159,7 +6294,7 @@ var init_DataBindingControls = __esm({
|
|
|
6159
6294
|
}
|
|
6160
6295
|
return trimmedValue;
|
|
6161
6296
|
};
|
|
6162
|
-
SearchIcon = ({ className = "" }) => /* @__PURE__ */ (0,
|
|
6297
|
+
SearchIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6163
6298
|
"svg",
|
|
6164
6299
|
{
|
|
6165
6300
|
"aria-hidden": "true",
|
|
@@ -6169,12 +6304,12 @@ var init_DataBindingControls = __esm({
|
|
|
6169
6304
|
stroke: "currentColor",
|
|
6170
6305
|
strokeWidth: "2",
|
|
6171
6306
|
children: [
|
|
6172
|
-
/* @__PURE__ */ (0,
|
|
6173
|
-
/* @__PURE__ */ (0,
|
|
6307
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("circle", { cx: "11", cy: "11", r: "7" }),
|
|
6308
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("path", { strokeLinecap: "round", d: "m20 20-4-4" })
|
|
6174
6309
|
]
|
|
6175
6310
|
}
|
|
6176
6311
|
);
|
|
6177
|
-
ResetIcon = ({ className = "" }) => /* @__PURE__ */ (0,
|
|
6312
|
+
ResetIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6178
6313
|
"svg",
|
|
6179
6314
|
{
|
|
6180
6315
|
"aria-hidden": "true",
|
|
@@ -6184,8 +6319,8 @@ var init_DataBindingControls = __esm({
|
|
|
6184
6319
|
stroke: "currentColor",
|
|
6185
6320
|
strokeWidth: "2",
|
|
6186
6321
|
children: [
|
|
6187
|
-
/* @__PURE__ */ (0,
|
|
6188
|
-
/* @__PURE__ */ (0,
|
|
6322
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 4v6h6" }),
|
|
6323
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6189
6324
|
"path",
|
|
6190
6325
|
{
|
|
6191
6326
|
strokeLinecap: "round",
|
|
@@ -6196,7 +6331,7 @@ var init_DataBindingControls = __esm({
|
|
|
6196
6331
|
]
|
|
6197
6332
|
}
|
|
6198
6333
|
);
|
|
6199
|
-
FilterSlidersIcon = ({ className = "" }) => /* @__PURE__ */ (0,
|
|
6334
|
+
FilterSlidersIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6200
6335
|
"svg",
|
|
6201
6336
|
{
|
|
6202
6337
|
"aria-hidden": "true",
|
|
@@ -6206,14 +6341,14 @@ var init_DataBindingControls = __esm({
|
|
|
6206
6341
|
stroke: "currentColor",
|
|
6207
6342
|
strokeWidth: "2",
|
|
6208
6343
|
children: [
|
|
6209
|
-
/* @__PURE__ */ (0,
|
|
6210
|
-
/* @__PURE__ */ (0,
|
|
6211
|
-
/* @__PURE__ */ (0,
|
|
6212
|
-
/* @__PURE__ */ (0,
|
|
6344
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 4h18M3 12h18M3 20h18" }),
|
|
6345
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("circle", { cx: "8", cy: "4", r: "2", fill: "currentColor" }),
|
|
6346
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("circle", { cx: "16", cy: "12", r: "2", fill: "currentColor" }),
|
|
6347
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("circle", { cx: "10", cy: "20", r: "2", fill: "currentColor" })
|
|
6213
6348
|
]
|
|
6214
6349
|
}
|
|
6215
6350
|
);
|
|
6216
|
-
ChevronDownIcon = ({ className = "" }) => /* @__PURE__ */ (0,
|
|
6351
|
+
ChevronDownIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6217
6352
|
"svg",
|
|
6218
6353
|
{
|
|
6219
6354
|
"aria-hidden": "true",
|
|
@@ -6222,10 +6357,10 @@ var init_DataBindingControls = __esm({
|
|
|
6222
6357
|
viewBox: "0 0 24 24",
|
|
6223
6358
|
stroke: "currentColor",
|
|
6224
6359
|
strokeWidth: "2",
|
|
6225
|
-
children: /* @__PURE__ */ (0,
|
|
6360
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m19 9-7 7-7-7" })
|
|
6226
6361
|
}
|
|
6227
6362
|
);
|
|
6228
|
-
CheckIcon = ({ className = "" }) => /* @__PURE__ */ (0,
|
|
6363
|
+
CheckIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6229
6364
|
"svg",
|
|
6230
6365
|
{
|
|
6231
6366
|
"aria-hidden": "true",
|
|
@@ -6234,10 +6369,10 @@ var init_DataBindingControls = __esm({
|
|
|
6234
6369
|
viewBox: "0 0 24 24",
|
|
6235
6370
|
stroke: "currentColor",
|
|
6236
6371
|
strokeWidth: "2.5",
|
|
6237
|
-
children: /* @__PURE__ */ (0,
|
|
6372
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" })
|
|
6238
6373
|
}
|
|
6239
6374
|
);
|
|
6240
|
-
CloseIcon = ({ className = "" }) => /* @__PURE__ */ (0,
|
|
6375
|
+
CloseIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6241
6376
|
"svg",
|
|
6242
6377
|
{
|
|
6243
6378
|
"aria-hidden": "true",
|
|
@@ -6246,10 +6381,10 @@ var init_DataBindingControls = __esm({
|
|
|
6246
6381
|
viewBox: "0 0 24 24",
|
|
6247
6382
|
stroke: "currentColor",
|
|
6248
6383
|
strokeWidth: "2",
|
|
6249
|
-
children: /* @__PURE__ */ (0,
|
|
6384
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
|
|
6250
6385
|
}
|
|
6251
6386
|
);
|
|
6252
|
-
MapPinIcon = ({ className = "" }) => /* @__PURE__ */ (0,
|
|
6387
|
+
MapPinIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6253
6388
|
"svg",
|
|
6254
6389
|
{
|
|
6255
6390
|
"aria-hidden": "true",
|
|
@@ -6259,7 +6394,7 @@ var init_DataBindingControls = __esm({
|
|
|
6259
6394
|
stroke: "currentColor",
|
|
6260
6395
|
strokeWidth: "2",
|
|
6261
6396
|
children: [
|
|
6262
|
-
/* @__PURE__ */ (0,
|
|
6397
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6263
6398
|
"path",
|
|
6264
6399
|
{
|
|
6265
6400
|
strokeLinecap: "round",
|
|
@@ -6267,7 +6402,7 @@ var init_DataBindingControls = __esm({
|
|
|
6267
6402
|
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
6403
|
}
|
|
6269
6404
|
),
|
|
6270
|
-
/* @__PURE__ */ (0,
|
|
6405
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6271
6406
|
"path",
|
|
6272
6407
|
{
|
|
6273
6408
|
strokeLinecap: "round",
|
|
@@ -6278,7 +6413,7 @@ var init_DataBindingControls = __esm({
|
|
|
6278
6413
|
]
|
|
6279
6414
|
}
|
|
6280
6415
|
);
|
|
6281
|
-
BriefcaseIcon = ({ className = "" }) => /* @__PURE__ */ (0,
|
|
6416
|
+
BriefcaseIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6282
6417
|
"svg",
|
|
6283
6418
|
{
|
|
6284
6419
|
"aria-hidden": "true",
|
|
@@ -6287,7 +6422,7 @@ var init_DataBindingControls = __esm({
|
|
|
6287
6422
|
viewBox: "0 0 24 24",
|
|
6288
6423
|
stroke: "currentColor",
|
|
6289
6424
|
strokeWidth: "2",
|
|
6290
|
-
children: /* @__PURE__ */ (0,
|
|
6425
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6291
6426
|
"path",
|
|
6292
6427
|
{
|
|
6293
6428
|
strokeLinecap: "round",
|
|
@@ -6297,7 +6432,7 @@ var init_DataBindingControls = __esm({
|
|
|
6297
6432
|
)
|
|
6298
6433
|
}
|
|
6299
6434
|
);
|
|
6300
|
-
FileTextIcon = ({ className = "" }) => /* @__PURE__ */ (0,
|
|
6435
|
+
FileTextIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6301
6436
|
"svg",
|
|
6302
6437
|
{
|
|
6303
6438
|
"aria-hidden": "true",
|
|
@@ -6306,7 +6441,7 @@ var init_DataBindingControls = __esm({
|
|
|
6306
6441
|
viewBox: "0 0 24 24",
|
|
6307
6442
|
stroke: "currentColor",
|
|
6308
6443
|
strokeWidth: "2",
|
|
6309
|
-
children: /* @__PURE__ */ (0,
|
|
6444
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6310
6445
|
"path",
|
|
6311
6446
|
{
|
|
6312
6447
|
strokeLinecap: "round",
|
|
@@ -6316,7 +6451,7 @@ var init_DataBindingControls = __esm({
|
|
|
6316
6451
|
)
|
|
6317
6452
|
}
|
|
6318
6453
|
);
|
|
6319
|
-
TagIcon = ({ className = "" }) => /* @__PURE__ */ (0,
|
|
6454
|
+
TagIcon = ({ className = "" }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6320
6455
|
"svg",
|
|
6321
6456
|
{
|
|
6322
6457
|
"aria-hidden": "true",
|
|
@@ -6325,7 +6460,7 @@ var init_DataBindingControls = __esm({
|
|
|
6325
6460
|
viewBox: "0 0 24 24",
|
|
6326
6461
|
stroke: "currentColor",
|
|
6327
6462
|
strokeWidth: "2",
|
|
6328
|
-
children: /* @__PURE__ */ (0,
|
|
6463
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6329
6464
|
"path",
|
|
6330
6465
|
{
|
|
6331
6466
|
strokeLinecap: "round",
|
|
@@ -6338,15 +6473,15 @@ var init_DataBindingControls = __esm({
|
|
|
6338
6473
|
getCategoryIcon = (category) => {
|
|
6339
6474
|
const lower = category.toLowerCase();
|
|
6340
6475
|
if (lower.includes("location") || lower.includes("city") || lower.includes("country") || lower.includes("state") || lower.includes("address")) {
|
|
6341
|
-
return /* @__PURE__ */ (0,
|
|
6476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(MapPinIcon, { className: "h-4 w-4" });
|
|
6342
6477
|
}
|
|
6343
6478
|
if (lower.includes("type") || lower.includes("work") || lower.includes("employment") || lower.includes("experience")) {
|
|
6344
|
-
return /* @__PURE__ */ (0,
|
|
6479
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(BriefcaseIcon, { className: "h-4 w-4" });
|
|
6345
6480
|
}
|
|
6346
6481
|
if (lower.includes("department") || lower.includes("category") || lower.includes("role") || lower.includes("industry")) {
|
|
6347
|
-
return /* @__PURE__ */ (0,
|
|
6482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(FileTextIcon, { className: "h-4 w-4" });
|
|
6348
6483
|
}
|
|
6349
|
-
return /* @__PURE__ */ (0,
|
|
6484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(TagIcon, { className: "h-4 w-4" });
|
|
6350
6485
|
};
|
|
6351
6486
|
normalizeSortOption = (option) => {
|
|
6352
6487
|
const direction = option.direction.trim();
|
|
@@ -6368,13 +6503,13 @@ var init_DataBindingControls = __esm({
|
|
|
6368
6503
|
}) => {
|
|
6369
6504
|
const router = (0, import_navigation.useRouter)();
|
|
6370
6505
|
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,
|
|
6506
|
+
const [collapsedCategories, setCollapsedCategories] = (0, import_react61.useState)({});
|
|
6507
|
+
const [isSortOpen, setIsSortOpen] = (0, import_react61.useState)(false);
|
|
6508
|
+
const [isMobileFiltersOpen, setIsMobileFiltersOpen] = (0, import_react61.useState)(false);
|
|
6509
|
+
const [facetCategorySearch, setFacetCategorySearch] = (0, import_react61.useState)({});
|
|
6510
|
+
const desktopSortDropdownRef = (0, import_react61.useRef)(null);
|
|
6511
|
+
const mobileSortDropdownRef = (0, import_react61.useRef)(null);
|
|
6512
|
+
(0, import_react61.useEffect)(() => {
|
|
6378
6513
|
const handleClickOutside = (event) => {
|
|
6379
6514
|
const target = event.target;
|
|
6380
6515
|
const clickedInsideDesktop = desktopSortDropdownRef.current?.contains(target);
|
|
@@ -6400,15 +6535,15 @@ var init_DataBindingControls = __esm({
|
|
|
6400
6535
|
const currentSearch = parseODataSearch(
|
|
6401
6536
|
searchParamsSearch !== void 0 && searchParamsSearch !== null ? searchParamsSearch : query?.["$search"]
|
|
6402
6537
|
);
|
|
6403
|
-
const [searchText, setSearchText] = (0,
|
|
6404
|
-
(0,
|
|
6538
|
+
const [searchText, setSearchText] = (0, import_react61.useState)(currentSearch);
|
|
6539
|
+
(0, import_react61.useEffect)(() => {
|
|
6405
6540
|
setSearchText(currentSearch);
|
|
6406
6541
|
}, [currentSearch]);
|
|
6407
|
-
const selectedFacetValues = (0,
|
|
6542
|
+
const selectedFacetValues = (0, import_react61.useMemo)(
|
|
6408
6543
|
() => parseFacetSelections(currentFilter),
|
|
6409
6544
|
[currentFilter]
|
|
6410
6545
|
);
|
|
6411
|
-
(0,
|
|
6546
|
+
(0, import_react61.useEffect)(() => {
|
|
6412
6547
|
if (isMobileFiltersOpen) {
|
|
6413
6548
|
document.body.style.overflow = "hidden";
|
|
6414
6549
|
} else {
|
|
@@ -6418,7 +6553,7 @@ var init_DataBindingControls = __esm({
|
|
|
6418
6553
|
document.body.style.overflow = "";
|
|
6419
6554
|
};
|
|
6420
6555
|
}, [isMobileFiltersOpen]);
|
|
6421
|
-
const activeFacets = (0,
|
|
6556
|
+
const activeFacets = (0, import_react61.useMemo)(() => {
|
|
6422
6557
|
const facetMap = /* @__PURE__ */ new Map();
|
|
6423
6558
|
if (facets) {
|
|
6424
6559
|
Object.entries(facets).forEach(([field, values]) => {
|
|
@@ -6443,11 +6578,11 @@ var init_DataBindingControls = __esm({
|
|
|
6443
6578
|
});
|
|
6444
6579
|
return Array.from(facetMap.entries());
|
|
6445
6580
|
}, [facets, selectedFacetValues]);
|
|
6446
|
-
const normalizedSortOptions = (0,
|
|
6581
|
+
const normalizedSortOptions = (0, import_react61.useMemo)(
|
|
6447
6582
|
() => (sortOptions ?? []).filter((option) => option?.name && option?.direction).map(normalizeSortOption).filter((option) => option.value),
|
|
6448
6583
|
[sortOptions]
|
|
6449
6584
|
);
|
|
6450
|
-
const selectedSortOption = (0,
|
|
6585
|
+
const selectedSortOption = (0, import_react61.useMemo)(() => {
|
|
6451
6586
|
if (!normalizedSortOptions.length) return null;
|
|
6452
6587
|
const trimmedCurrentSort = currentSort.trim().toLowerCase();
|
|
6453
6588
|
if (!trimmedCurrentSort) return normalizedSortOptions[0];
|
|
@@ -6456,7 +6591,7 @@ var init_DataBindingControls = __esm({
|
|
|
6456
6591
|
) || normalizedSortOptions[0];
|
|
6457
6592
|
}, [normalizedSortOptions, currentSort]);
|
|
6458
6593
|
const selectedSortLabel = selectedSortOption?.label || "";
|
|
6459
|
-
const getQueryUrl = (0,
|
|
6594
|
+
const getQueryUrl = (0, import_react61.useCallback)(
|
|
6460
6595
|
(updates) => {
|
|
6461
6596
|
const initialParams = searchParams ? searchParams.toString() : "";
|
|
6462
6597
|
const params = new URLSearchParams(initialParams || query || {});
|
|
@@ -6474,7 +6609,7 @@ var init_DataBindingControls = __esm({
|
|
|
6474
6609
|
},
|
|
6475
6610
|
[path, query, searchParams]
|
|
6476
6611
|
);
|
|
6477
|
-
const navigateWithoutReload = (0,
|
|
6612
|
+
const navigateWithoutReload = (0, import_react61.useCallback)(
|
|
6478
6613
|
(url) => {
|
|
6479
6614
|
if (typeof window !== "undefined") {
|
|
6480
6615
|
const targetUrl = new URL(url, window.location.origin);
|
|
@@ -6486,7 +6621,7 @@ var init_DataBindingControls = __esm({
|
|
|
6486
6621
|
},
|
|
6487
6622
|
[router]
|
|
6488
6623
|
);
|
|
6489
|
-
const handleSelectSort = (0,
|
|
6624
|
+
const handleSelectSort = (0, import_react61.useCallback)(
|
|
6490
6625
|
(sortValue) => {
|
|
6491
6626
|
setIsSortOpen(false);
|
|
6492
6627
|
navigateWithoutReload(
|
|
@@ -6526,7 +6661,7 @@ var init_DataBindingControls = __esm({
|
|
|
6526
6661
|
})
|
|
6527
6662
|
);
|
|
6528
6663
|
};
|
|
6529
|
-
const handleSearch = (0,
|
|
6664
|
+
const handleSearch = (0, import_react61.useCallback)(async () => {
|
|
6530
6665
|
const trimmedSearchText = searchText.trim();
|
|
6531
6666
|
if (trimmedSearchText === currentSearch.trim()) {
|
|
6532
6667
|
return { isSuccessful: true };
|
|
@@ -6538,7 +6673,7 @@ var init_DataBindingControls = __esm({
|
|
|
6538
6673
|
);
|
|
6539
6674
|
return { isSuccessful: true };
|
|
6540
6675
|
}, [currentSearch, getQueryUrl, navigateWithoutReload, searchText]);
|
|
6541
|
-
const handleClearAll = (0,
|
|
6676
|
+
const handleClearAll = (0, import_react61.useCallback)(async () => {
|
|
6542
6677
|
navigateWithoutReload(
|
|
6543
6678
|
getQueryUrl({
|
|
6544
6679
|
$filter: void 0,
|
|
@@ -6561,9 +6696,9 @@ var init_DataBindingControls = __esm({
|
|
|
6561
6696
|
if (!shouldShowToolbar && !shouldShowFacets) {
|
|
6562
6697
|
return null;
|
|
6563
6698
|
}
|
|
6564
|
-
const renderFacetItems = (field, values) => /* @__PURE__ */ (0,
|
|
6699
|
+
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
6700
|
const isSelected = selectedFacetValues.get(field) === facet.value;
|
|
6566
|
-
return /* @__PURE__ */ (0,
|
|
6701
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6567
6702
|
"button",
|
|
6568
6703
|
{
|
|
6569
6704
|
type: "button",
|
|
@@ -6571,17 +6706,17 @@ var init_DataBindingControls = __esm({
|
|
|
6571
6706
|
"aria-pressed": isSelected,
|
|
6572
6707
|
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
6708
|
children: [
|
|
6574
|
-
/* @__PURE__ */ (0,
|
|
6575
|
-
/* @__PURE__ */ (0,
|
|
6709
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex min-w-0 items-center gap-2.5", children: [
|
|
6710
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6576
6711
|
"span",
|
|
6577
6712
|
{
|
|
6578
6713
|
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,
|
|
6714
|
+
children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(CheckIcon, { className: "h-3 w-3" })
|
|
6580
6715
|
}
|
|
6581
6716
|
),
|
|
6582
|
-
/* @__PURE__ */ (0,
|
|
6717
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "leading-snug break-words", children: facet.value })
|
|
6583
6718
|
] }),
|
|
6584
|
-
/* @__PURE__ */ (0,
|
|
6719
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6585
6720
|
"span",
|
|
6586
6721
|
{
|
|
6587
6722
|
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 +6728,14 @@ var init_DataBindingControls = __esm({
|
|
|
6593
6728
|
`${field}-${facet.value}`
|
|
6594
6729
|
);
|
|
6595
6730
|
}) });
|
|
6596
|
-
return /* @__PURE__ */ (0,
|
|
6731
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6597
6732
|
"div",
|
|
6598
6733
|
{
|
|
6599
6734
|
className: mode === "toolbar" ? "my-4 sm:my-6" : "flex flex-col rounded-md border border-neutral-soft bg-default p-4 shadow-sm",
|
|
6600
6735
|
children: [
|
|
6601
|
-
shouldShowToolbar && /* @__PURE__ */ (0,
|
|
6602
|
-
/* @__PURE__ */ (0,
|
|
6603
|
-
showSearchBar && /* @__PURE__ */ (0,
|
|
6736
|
+
shouldShowToolbar && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
6737
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "hidden lg:flex lg:items-center lg:justify-between lg:gap-4", children: [
|
|
6738
|
+
showSearchBar && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6604
6739
|
"form",
|
|
6605
6740
|
{
|
|
6606
6741
|
role: "search",
|
|
@@ -6610,9 +6745,9 @@ var init_DataBindingControls = __esm({
|
|
|
6610
6745
|
void handleSearch();
|
|
6611
6746
|
},
|
|
6612
6747
|
children: [
|
|
6613
|
-
/* @__PURE__ */ (0,
|
|
6614
|
-
/* @__PURE__ */ (0,
|
|
6615
|
-
/* @__PURE__ */ (0,
|
|
6748
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "relative min-w-0 flex-1", children: [
|
|
6749
|
+
/* @__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" }),
|
|
6750
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6616
6751
|
"input",
|
|
6617
6752
|
{
|
|
6618
6753
|
type: "text",
|
|
@@ -6624,23 +6759,23 @@ var init_DataBindingControls = __esm({
|
|
|
6624
6759
|
}
|
|
6625
6760
|
)
|
|
6626
6761
|
] }),
|
|
6627
|
-
/* @__PURE__ */ (0,
|
|
6762
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6628
6763
|
Button_default,
|
|
6629
6764
|
{
|
|
6630
6765
|
ButtonType: "Primary" /* Solid */,
|
|
6631
6766
|
onClick: handleSearch,
|
|
6632
6767
|
className: "!h-10 !rounded-md !px-5 !py-0 flex items-center justify-center gap-1.5 shrink-0",
|
|
6633
6768
|
children: [
|
|
6634
|
-
/* @__PURE__ */ (0,
|
|
6635
|
-
/* @__PURE__ */ (0,
|
|
6769
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(SearchIcon, { className: "h-4 w-4" }),
|
|
6770
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { children: "Search" })
|
|
6636
6771
|
]
|
|
6637
6772
|
}
|
|
6638
6773
|
)
|
|
6639
6774
|
]
|
|
6640
6775
|
}
|
|
6641
6776
|
),
|
|
6642
|
-
hasSortControls && /* @__PURE__ */ (0,
|
|
6643
|
-
/* @__PURE__ */ (0,
|
|
6777
|
+
hasSortControls && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "relative shrink-0", ref: desktopSortDropdownRef, children: [
|
|
6778
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6644
6779
|
"button",
|
|
6645
6780
|
{
|
|
6646
6781
|
type: "button",
|
|
@@ -6648,11 +6783,11 @@ var init_DataBindingControls = __esm({
|
|
|
6648
6783
|
"aria-expanded": isSortOpen,
|
|
6649
6784
|
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
6785
|
children: [
|
|
6651
|
-
/* @__PURE__ */ (0,
|
|
6652
|
-
/* @__PURE__ */ (0,
|
|
6653
|
-
/* @__PURE__ */ (0,
|
|
6786
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("span", { className: "whitespace-nowrap", children: [
|
|
6787
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "opacity-70", children: "Sort by: " }),
|
|
6788
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "font-semibold", children: selectedSortLabel })
|
|
6654
6789
|
] }),
|
|
6655
|
-
/* @__PURE__ */ (0,
|
|
6790
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6656
6791
|
ChevronDownIcon,
|
|
6657
6792
|
{
|
|
6658
6793
|
className: `h-4 w-4 shrink-0 transition-transform duration-200 ${isSortOpen ? "rotate-180" : ""}`
|
|
@@ -6661,17 +6796,17 @@ var init_DataBindingControls = __esm({
|
|
|
6661
6796
|
]
|
|
6662
6797
|
}
|
|
6663
6798
|
),
|
|
6664
|
-
isSortOpen && /* @__PURE__ */ (0,
|
|
6799
|
+
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
6800
|
const isSelected = selectedSortOption?.value === option.value;
|
|
6666
|
-
return /* @__PURE__ */ (0,
|
|
6801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6667
6802
|
"button",
|
|
6668
6803
|
{
|
|
6669
6804
|
type: "button",
|
|
6670
6805
|
onClick: () => handleSelectSort(option.value),
|
|
6671
6806
|
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
6807
|
children: [
|
|
6673
|
-
/* @__PURE__ */ (0,
|
|
6674
|
-
isSelected && /* @__PURE__ */ (0,
|
|
6808
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "whitespace-nowrap", children: option.label }),
|
|
6809
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(CheckIcon, { className: "h-4 w-4 shrink-0" })
|
|
6675
6810
|
]
|
|
6676
6811
|
},
|
|
6677
6812
|
option.value
|
|
@@ -6679,8 +6814,8 @@ var init_DataBindingControls = __esm({
|
|
|
6679
6814
|
}) })
|
|
6680
6815
|
] })
|
|
6681
6816
|
] }),
|
|
6682
|
-
/* @__PURE__ */ (0,
|
|
6683
|
-
showSearchBar && /* @__PURE__ */ (0,
|
|
6817
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex flex-col gap-2.5 lg:hidden", children: [
|
|
6818
|
+
showSearchBar && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6684
6819
|
"form",
|
|
6685
6820
|
{
|
|
6686
6821
|
role: "search",
|
|
@@ -6690,8 +6825,8 @@ var init_DataBindingControls = __esm({
|
|
|
6690
6825
|
void handleSearch();
|
|
6691
6826
|
},
|
|
6692
6827
|
children: [
|
|
6693
|
-
/* @__PURE__ */ (0,
|
|
6694
|
-
/* @__PURE__ */ (0,
|
|
6828
|
+
/* @__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" }),
|
|
6829
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6695
6830
|
"input",
|
|
6696
6831
|
{
|
|
6697
6832
|
type: "text",
|
|
@@ -6705,28 +6840,28 @@ var init_DataBindingControls = __esm({
|
|
|
6705
6840
|
]
|
|
6706
6841
|
}
|
|
6707
6842
|
),
|
|
6708
|
-
/* @__PURE__ */ (0,
|
|
6709
|
-
showFacets && /* @__PURE__ */ (0,
|
|
6843
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex items-center justify-between gap-2.5 pt-0.5", children: [
|
|
6844
|
+
showFacets && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6710
6845
|
"button",
|
|
6711
6846
|
{
|
|
6712
6847
|
type: "button",
|
|
6713
6848
|
onClick: () => setIsMobileFiltersOpen(true),
|
|
6714
6849
|
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
6850
|
children: [
|
|
6716
|
-
/* @__PURE__ */ (0,
|
|
6717
|
-
/* @__PURE__ */ (0,
|
|
6851
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(FilterSlidersIcon, { className: "h-4 w-4" }),
|
|
6852
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("span", { children: [
|
|
6718
6853
|
"Filters",
|
|
6719
6854
|
selectedFacetCount > 0 ? ` (${selectedFacetCount})` : ""
|
|
6720
6855
|
] }),
|
|
6721
|
-
selectedFacetCount > 0 && /* @__PURE__ */ (0,
|
|
6722
|
-
/* @__PURE__ */ (0,
|
|
6723
|
-
/* @__PURE__ */ (0,
|
|
6856
|
+
selectedFacetCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("span", { className: "relative flex h-2 w-2", children: [
|
|
6857
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "animate-ping absolute inline-flex h-full w-full rounded-full bg-primary-base opacity-75" }),
|
|
6858
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "relative inline-flex rounded-full h-2 w-2 bg-primary-base" })
|
|
6724
6859
|
] })
|
|
6725
6860
|
]
|
|
6726
6861
|
}
|
|
6727
6862
|
),
|
|
6728
|
-
hasSortControls && /* @__PURE__ */ (0,
|
|
6729
|
-
/* @__PURE__ */ (0,
|
|
6863
|
+
hasSortControls && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "relative shrink-0 ml-auto", ref: mobileSortDropdownRef, children: [
|
|
6864
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6730
6865
|
"button",
|
|
6731
6866
|
{
|
|
6732
6867
|
type: "button",
|
|
@@ -6734,8 +6869,8 @@ var init_DataBindingControls = __esm({
|
|
|
6734
6869
|
"aria-expanded": isSortOpen,
|
|
6735
6870
|
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
6871
|
children: [
|
|
6737
|
-
/* @__PURE__ */ (0,
|
|
6738
|
-
/* @__PURE__ */ (0,
|
|
6872
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "whitespace-nowrap font-medium", children: selectedSortLabel }),
|
|
6873
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6739
6874
|
ChevronDownIcon,
|
|
6740
6875
|
{
|
|
6741
6876
|
className: `h-4 w-4 shrink-0 transition-transform duration-200 ${isSortOpen ? "rotate-180" : ""}`
|
|
@@ -6744,17 +6879,17 @@ var init_DataBindingControls = __esm({
|
|
|
6744
6879
|
]
|
|
6745
6880
|
}
|
|
6746
6881
|
),
|
|
6747
|
-
isSortOpen && /* @__PURE__ */ (0,
|
|
6882
|
+
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
6883
|
const isSelected = selectedSortOption?.value === option.value;
|
|
6749
|
-
return /* @__PURE__ */ (0,
|
|
6884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6750
6885
|
"button",
|
|
6751
6886
|
{
|
|
6752
6887
|
type: "button",
|
|
6753
6888
|
onClick: () => handleSelectSort(option.value),
|
|
6754
6889
|
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
6890
|
children: [
|
|
6756
|
-
/* @__PURE__ */ (0,
|
|
6757
|
-
isSelected && /* @__PURE__ */ (0,
|
|
6891
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "whitespace-nowrap", children: option.label }),
|
|
6892
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(CheckIcon, { className: "h-4 w-4 shrink-0" })
|
|
6758
6893
|
]
|
|
6759
6894
|
},
|
|
6760
6895
|
option.value
|
|
@@ -6762,8 +6897,8 @@ var init_DataBindingControls = __esm({
|
|
|
6762
6897
|
}) })
|
|
6763
6898
|
] })
|
|
6764
6899
|
] }),
|
|
6765
|
-
selectedFacetCount > 0 && /* @__PURE__ */ (0,
|
|
6766
|
-
Array.from(selectedFacetValues.entries()).map(([field, value]) => /* @__PURE__ */ (0,
|
|
6900
|
+
selectedFacetCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5 pt-1", children: [
|
|
6901
|
+
Array.from(selectedFacetValues.entries()).map(([field, value]) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6767
6902
|
"button",
|
|
6768
6903
|
{
|
|
6769
6904
|
type: "button",
|
|
@@ -6771,13 +6906,13 @@ var init_DataBindingControls = __esm({
|
|
|
6771
6906
|
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
6907
|
title: `Remove filter: ${value}`,
|
|
6773
6908
|
children: [
|
|
6774
|
-
/* @__PURE__ */ (0,
|
|
6775
|
-
/* @__PURE__ */ (0,
|
|
6909
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "font-medium truncate max-w-[140px]", children: value }),
|
|
6910
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(CloseIcon, { className: "h-3 w-3 shrink-0 opacity-60 group-hover:opacity-100" })
|
|
6776
6911
|
]
|
|
6777
6912
|
},
|
|
6778
6913
|
`mobile-chip-${field}`
|
|
6779
6914
|
)),
|
|
6780
|
-
/* @__PURE__ */ (0,
|
|
6915
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6781
6916
|
"button",
|
|
6782
6917
|
{
|
|
6783
6918
|
type: "button",
|
|
@@ -6788,8 +6923,8 @@ var init_DataBindingControls = __esm({
|
|
|
6788
6923
|
)
|
|
6789
6924
|
] })
|
|
6790
6925
|
] }),
|
|
6791
|
-
isMobileFiltersOpen && /* @__PURE__ */ (0,
|
|
6792
|
-
/* @__PURE__ */ (0,
|
|
6926
|
+
isMobileFiltersOpen && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "fixed inset-0 z-50 flex flex-col justify-end lg:hidden", children: [
|
|
6927
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6793
6928
|
"div",
|
|
6794
6929
|
{
|
|
6795
6930
|
className: "fixed inset-0 bg-neutral-stronger/60 backdrop-blur-xs transition-opacity duration-300",
|
|
@@ -6797,12 +6932,12 @@ var init_DataBindingControls = __esm({
|
|
|
6797
6932
|
"aria-hidden": "true"
|
|
6798
6933
|
}
|
|
6799
6934
|
),
|
|
6800
|
-
/* @__PURE__ */ (0,
|
|
6801
|
-
/* @__PURE__ */ (0,
|
|
6802
|
-
/* @__PURE__ */ (0,
|
|
6803
|
-
/* @__PURE__ */ (0,
|
|
6804
|
-
/* @__PURE__ */ (0,
|
|
6805
|
-
selectedFacetCount > 0 && /* @__PURE__ */ (0,
|
|
6935
|
+
/* @__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: [
|
|
6936
|
+
/* @__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" }) }),
|
|
6937
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex items-center justify-between px-5 py-3 border-b border-neutral-soft", children: [
|
|
6938
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("h2", { className: "text-lg font-bold tracking-tight", children: "Filters" }),
|
|
6939
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
6940
|
+
selectedFacetCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6806
6941
|
"button",
|
|
6807
6942
|
{
|
|
6808
6943
|
type: "button",
|
|
@@ -6811,38 +6946,38 @@ var init_DataBindingControls = __esm({
|
|
|
6811
6946
|
children: "Clear all"
|
|
6812
6947
|
}
|
|
6813
6948
|
),
|
|
6814
|
-
/* @__PURE__ */ (0,
|
|
6949
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6815
6950
|
"button",
|
|
6816
6951
|
{
|
|
6817
6952
|
type: "button",
|
|
6818
6953
|
onClick: () => setIsMobileFiltersOpen(false),
|
|
6819
6954
|
className: "p-1 rounded-full hover:bg-neutral-weak transition-colors cursor-pointer",
|
|
6820
6955
|
"aria-label": "Close filters",
|
|
6821
|
-
children: /* @__PURE__ */ (0,
|
|
6956
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(CloseIcon, { className: "h-5 w-5 opacity-70" })
|
|
6822
6957
|
}
|
|
6823
6958
|
)
|
|
6824
6959
|
] })
|
|
6825
6960
|
] }),
|
|
6826
|
-
/* @__PURE__ */ (0,
|
|
6961
|
+
/* @__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
6962
|
const isOpen = !collapsedCategories[field];
|
|
6828
6963
|
const selectedValue = selectedFacetValues.get(field);
|
|
6829
6964
|
const categorySearch = facetCategorySearch[field]?.toLowerCase() || "";
|
|
6830
6965
|
const filteredValues = categorySearch ? values.filter((v) => v.value.toLowerCase().includes(categorySearch)) : values;
|
|
6831
|
-
return /* @__PURE__ */ (0,
|
|
6832
|
-
/* @__PURE__ */ (0,
|
|
6966
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "pt-3 first:pt-0", children: [
|
|
6967
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6833
6968
|
"button",
|
|
6834
6969
|
{
|
|
6835
6970
|
type: "button",
|
|
6836
6971
|
onClick: () => toggleCategory(field),
|
|
6837
6972
|
className: "flex w-full cursor-pointer items-center justify-between rounded-md py-2 text-left transition-colors",
|
|
6838
6973
|
children: [
|
|
6839
|
-
/* @__PURE__ */ (0,
|
|
6840
|
-
/* @__PURE__ */ (0,
|
|
6841
|
-
/* @__PURE__ */ (0,
|
|
6974
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex items-center gap-2.5", children: [
|
|
6975
|
+
/* @__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) }),
|
|
6976
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "font-semibold text-sm", children: humanize(field) })
|
|
6842
6977
|
] }),
|
|
6843
|
-
/* @__PURE__ */ (0,
|
|
6844
|
-
selectedValue && /* @__PURE__ */ (0,
|
|
6845
|
-
/* @__PURE__ */ (0,
|
|
6978
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
6979
|
+
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" }),
|
|
6980
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6846
6981
|
ChevronDownIcon,
|
|
6847
6982
|
{
|
|
6848
6983
|
className: `h-4 w-4 transition-transform duration-200 ${isOpen ? "rotate-180" : ""}`
|
|
@@ -6852,10 +6987,10 @@ var init_DataBindingControls = __esm({
|
|
|
6852
6987
|
]
|
|
6853
6988
|
}
|
|
6854
6989
|
),
|
|
6855
|
-
isOpen && /* @__PURE__ */ (0,
|
|
6856
|
-
values.length > 5 && /* @__PURE__ */ (0,
|
|
6857
|
-
/* @__PURE__ */ (0,
|
|
6858
|
-
/* @__PURE__ */ (0,
|
|
6990
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "pt-2 pb-1 pl-1 pr-1 space-y-1.5", children: [
|
|
6991
|
+
values.length > 5 && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "relative mb-2", children: [
|
|
6992
|
+
/* @__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" }),
|
|
6993
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6859
6994
|
"input",
|
|
6860
6995
|
{
|
|
6861
6996
|
type: "text",
|
|
@@ -6869,9 +7004,9 @@ var init_DataBindingControls = __esm({
|
|
|
6869
7004
|
}
|
|
6870
7005
|
)
|
|
6871
7006
|
] }),
|
|
6872
|
-
filteredValues.length === 0 ? /* @__PURE__ */ (0,
|
|
7007
|
+
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
7008
|
const isChecked = selectedValue === facet.value;
|
|
6874
|
-
return /* @__PURE__ */ (0,
|
|
7009
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6875
7010
|
"button",
|
|
6876
7011
|
{
|
|
6877
7012
|
type: "button",
|
|
@@ -6881,17 +7016,17 @@ var init_DataBindingControls = __esm({
|
|
|
6881
7016
|
"aria-pressed": isChecked,
|
|
6882
7017
|
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
7018
|
children: [
|
|
6884
|
-
/* @__PURE__ */ (0,
|
|
6885
|
-
/* @__PURE__ */ (0,
|
|
7019
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex min-w-0 items-center gap-3", children: [
|
|
7020
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6886
7021
|
"span",
|
|
6887
7022
|
{
|
|
6888
7023
|
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,
|
|
7024
|
+
children: isChecked && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(CheckIcon, { className: "h-3.5 w-3.5" })
|
|
6890
7025
|
}
|
|
6891
7026
|
),
|
|
6892
|
-
/* @__PURE__ */ (0,
|
|
7027
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "leading-snug break-words", children: facet.value })
|
|
6893
7028
|
] }),
|
|
6894
|
-
/* @__PURE__ */ (0,
|
|
7029
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "shrink-0 text-xs opacity-60 ml-2", children: facet.count })
|
|
6895
7030
|
]
|
|
6896
7031
|
},
|
|
6897
7032
|
`drawer-${field}-${facet.value}`
|
|
@@ -6900,8 +7035,8 @@ var init_DataBindingControls = __esm({
|
|
|
6900
7035
|
] })
|
|
6901
7036
|
] }, `drawer-cat-${field}`);
|
|
6902
7037
|
}) }),
|
|
6903
|
-
/* @__PURE__ */ (0,
|
|
6904
|
-
/* @__PURE__ */ (0,
|
|
7038
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex items-center gap-3 border-t border-neutral-soft bg-default p-4", children: [
|
|
7039
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6905
7040
|
"button",
|
|
6906
7041
|
{
|
|
6907
7042
|
type: "button",
|
|
@@ -6910,7 +7045,7 @@ var init_DataBindingControls = __esm({
|
|
|
6910
7045
|
children: "Close"
|
|
6911
7046
|
}
|
|
6912
7047
|
),
|
|
6913
|
-
/* @__PURE__ */ (0,
|
|
7048
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6914
7049
|
"button",
|
|
6915
7050
|
{
|
|
6916
7051
|
type: "button",
|
|
@@ -6926,14 +7061,14 @@ var init_DataBindingControls = __esm({
|
|
|
6926
7061
|
] })
|
|
6927
7062
|
] })
|
|
6928
7063
|
] }),
|
|
6929
|
-
shouldShowFacets && /* @__PURE__ */ (0,
|
|
6930
|
-
/* @__PURE__ */ (0,
|
|
6931
|
-
/* @__PURE__ */ (0,
|
|
6932
|
-
/* @__PURE__ */ (0,
|
|
6933
|
-
/* @__PURE__ */ (0,
|
|
6934
|
-
selectedFacetCount > 0 && /* @__PURE__ */ (0,
|
|
7064
|
+
shouldShowFacets && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
7065
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex items-center justify-between border-b border-neutral-soft pb-3", children: [
|
|
7066
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
7067
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(FilterSlidersIcon, { className: "h-4 w-4" }),
|
|
7068
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("h2", { className: "text-base font-semibold tracking-tight", children: "Filters" }),
|
|
7069
|
+
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
7070
|
] }),
|
|
6936
|
-
hasActiveFiltersOrSort && /* @__PURE__ */ (0,
|
|
7071
|
+
hasActiveFiltersOrSort && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6937
7072
|
"button",
|
|
6938
7073
|
{
|
|
6939
7074
|
type: "button",
|
|
@@ -6941,13 +7076,13 @@ var init_DataBindingControls = __esm({
|
|
|
6941
7076
|
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
7077
|
"aria-label": "Clear all filters and sorting",
|
|
6943
7078
|
children: [
|
|
6944
|
-
/* @__PURE__ */ (0,
|
|
6945
|
-
/* @__PURE__ */ (0,
|
|
7079
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(ResetIcon, { className: "h-3.5 w-3.5 transition-transform duration-200 group-hover:-rotate-45" }),
|
|
7080
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { children: "Clear all" })
|
|
6946
7081
|
]
|
|
6947
7082
|
}
|
|
6948
7083
|
)
|
|
6949
7084
|
] }),
|
|
6950
|
-
selectedFacetCount > 0 && /* @__PURE__ */ (0,
|
|
7085
|
+
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
7086
|
"button",
|
|
6952
7087
|
{
|
|
6953
7088
|
type: "button",
|
|
@@ -6955,35 +7090,35 @@ var init_DataBindingControls = __esm({
|
|
|
6955
7090
|
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
7091
|
title: `Remove filter: ${value}`,
|
|
6957
7092
|
children: [
|
|
6958
|
-
/* @__PURE__ */ (0,
|
|
6959
|
-
/* @__PURE__ */ (0,
|
|
7093
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "font-medium truncate max-w-[150px]", children: value }),
|
|
7094
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(CloseIcon, { className: "h-3.5 w-3.5 shrink-0 opacity-60 group-hover:opacity-100" })
|
|
6960
7095
|
]
|
|
6961
7096
|
},
|
|
6962
7097
|
`chip-${field}`
|
|
6963
7098
|
)) }),
|
|
6964
|
-
activeFacets.length === 1 && /* @__PURE__ */ (0,
|
|
6965
|
-
/* @__PURE__ */ (0,
|
|
7099
|
+
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: [
|
|
7100
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "px-1 pb-2 font-medium text-sm", children: humanize(activeFacets[0][0]) }),
|
|
6966
7101
|
renderFacetItems(activeFacets[0][0], activeFacets[0][1])
|
|
6967
7102
|
] }) }),
|
|
6968
|
-
activeFacets.length > 1 && /* @__PURE__ */ (0,
|
|
7103
|
+
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
7104
|
const isOpen = !collapsedCategories[field];
|
|
6970
|
-
return /* @__PURE__ */ (0,
|
|
7105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6971
7106
|
"div",
|
|
6972
7107
|
{
|
|
6973
7108
|
className: "py-2 first:pt-0 last:pb-0",
|
|
6974
7109
|
children: [
|
|
6975
|
-
/* @__PURE__ */ (0,
|
|
7110
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
6976
7111
|
"button",
|
|
6977
7112
|
{
|
|
6978
7113
|
type: "button",
|
|
6979
7114
|
onClick: () => toggleCategory(field),
|
|
6980
7115
|
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
7116
|
children: [
|
|
6982
|
-
/* @__PURE__ */ (0,
|
|
6983
|
-
/* @__PURE__ */ (0,
|
|
6984
|
-
/* @__PURE__ */ (0,
|
|
7117
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
7118
|
+
/* @__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) }),
|
|
7119
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { children: humanize(field) })
|
|
6985
7120
|
] }),
|
|
6986
|
-
/* @__PURE__ */ (0,
|
|
7121
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
6987
7122
|
ChevronDownIcon,
|
|
6988
7123
|
{
|
|
6989
7124
|
className: `h-4 w-4 transition-transform duration-200 ease-out ${isOpen ? "rotate-180" : ""}`
|
|
@@ -6992,7 +7127,7 @@ var init_DataBindingControls = __esm({
|
|
|
6992
7127
|
]
|
|
6993
7128
|
}
|
|
6994
7129
|
),
|
|
6995
|
-
isOpen && /* @__PURE__ */ (0,
|
|
7130
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "pt-1", children: renderFacetItems(field, values) })
|
|
6996
7131
|
]
|
|
6997
7132
|
},
|
|
6998
7133
|
field
|
|
@@ -7012,13 +7147,13 @@ var Slider_exports = {};
|
|
|
7012
7147
|
__export(Slider_exports, {
|
|
7013
7148
|
default: () => Slider_default
|
|
7014
7149
|
});
|
|
7015
|
-
var
|
|
7150
|
+
var import_react62, import_jsx_runtime91, Slider, ArrowButton, ProgressPill, Slider_default;
|
|
7016
7151
|
var init_Slider = __esm({
|
|
7017
7152
|
"src/components/Slider.tsx"() {
|
|
7018
7153
|
"use strict";
|
|
7019
7154
|
"use client";
|
|
7020
|
-
|
|
7021
|
-
|
|
7155
|
+
import_react62 = __toESM(require("react"));
|
|
7156
|
+
import_jsx_runtime91 = require("react/jsx-runtime");
|
|
7022
7157
|
Slider = ({
|
|
7023
7158
|
children,
|
|
7024
7159
|
columns,
|
|
@@ -7039,17 +7174,17 @@ var init_Slider = __esm({
|
|
|
7039
7174
|
progressPosition = "bottom",
|
|
7040
7175
|
scrollByColumns = false
|
|
7041
7176
|
}) => {
|
|
7042
|
-
const [currentSlide, setCurrentSlide] = (0,
|
|
7043
|
-
const [transition, setTransition] = (0,
|
|
7177
|
+
const [currentSlide, setCurrentSlide] = (0, import_react62.useState)(0);
|
|
7178
|
+
const [transition, setTransition] = (0, import_react62.useState)(true);
|
|
7044
7179
|
const initialSlidesToShow = slidesToShow ?? columns ?? 4;
|
|
7045
|
-
const [slidesToShowState, setSlidesToShowState] = (0,
|
|
7180
|
+
const [slidesToShowState, setSlidesToShowState] = (0, import_react62.useState)(
|
|
7046
7181
|
typeof initialSlidesToShow === "number" ? initialSlidesToShow : initialSlidesToShow.large
|
|
7047
7182
|
);
|
|
7048
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
7049
|
-
const trackRef = (0,
|
|
7183
|
+
const [isPlaying, setIsPlaying] = (0, import_react62.useState)(autoplay);
|
|
7184
|
+
const trackRef = (0, import_react62.useRef)(null);
|
|
7050
7185
|
console.log("trackRef:", trackRef);
|
|
7051
|
-
const [videoProgress, setVideoProgress] = (0,
|
|
7052
|
-
(0,
|
|
7186
|
+
const [videoProgress, setVideoProgress] = (0, import_react62.useState)(null);
|
|
7187
|
+
(0, import_react62.useEffect)(() => {
|
|
7053
7188
|
if (typeof initialSlidesToShow === "number") {
|
|
7054
7189
|
setSlidesToShowState(initialSlidesToShow);
|
|
7055
7190
|
return;
|
|
@@ -7067,7 +7202,7 @@ var init_Slider = __esm({
|
|
|
7067
7202
|
window.addEventListener("resize", handleResize);
|
|
7068
7203
|
return () => window.removeEventListener("resize", handleResize);
|
|
7069
7204
|
}, [initialSlidesToShow]);
|
|
7070
|
-
(0,
|
|
7205
|
+
(0, import_react62.useEffect)(() => {
|
|
7071
7206
|
if (!autoplay) return;
|
|
7072
7207
|
const activeSlideElement = trackRef.current?.children[currentSlide];
|
|
7073
7208
|
const videoElement = activeSlideElement?.querySelector("video");
|
|
@@ -7112,7 +7247,7 @@ var init_Slider = __esm({
|
|
|
7112
7247
|
}, autoplay_speed);
|
|
7113
7248
|
return () => clearInterval(timer);
|
|
7114
7249
|
}, [autoplay, autoplay_speed, currentSlide, isPlaying]);
|
|
7115
|
-
const totalSlides =
|
|
7250
|
+
const totalSlides = import_react62.Children.count(children);
|
|
7116
7251
|
const numColumns = columns ?? slidesToShowState;
|
|
7117
7252
|
const slideWidthPercentage = (() => {
|
|
7118
7253
|
if (typeof lastColPercentage !== "number") {
|
|
@@ -7178,24 +7313,24 @@ var init_Slider = __esm({
|
|
|
7178
7313
|
}
|
|
7179
7314
|
};
|
|
7180
7315
|
const translateX = -currentSlide * slideWidthPercentage;
|
|
7181
|
-
const slides =
|
|
7182
|
-
if (!
|
|
7316
|
+
const slides = import_react62.Children.map(children, (child, index) => {
|
|
7317
|
+
if (!import_react62.default.isValidElement(child)) return null;
|
|
7183
7318
|
const childProps = child.props;
|
|
7184
7319
|
const mergedClassName = `${childProps.className ?? ""} w-full`.trim();
|
|
7185
|
-
return /* @__PURE__ */ (0,
|
|
7320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
7186
7321
|
"div",
|
|
7187
7322
|
{
|
|
7188
7323
|
className: `flex-none ${scaleOnHover ? "group hover:z-50" : ""} relative`,
|
|
7189
7324
|
style: { width: `calc(${slideWidthPercentage}%)`, paddingRight: gap },
|
|
7190
|
-
children: (0,
|
|
7325
|
+
children: (0, import_react62.cloneElement)(child, {
|
|
7191
7326
|
className: mergedClassName
|
|
7192
7327
|
})
|
|
7193
7328
|
},
|
|
7194
7329
|
index
|
|
7195
7330
|
);
|
|
7196
7331
|
});
|
|
7197
|
-
return /* @__PURE__ */ (0,
|
|
7198
|
-
show_dots && progressPosition === "top" && /* @__PURE__ */ (0,
|
|
7332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "w-full", children: [
|
|
7333
|
+
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
7334
|
ProgressPill,
|
|
7200
7335
|
{
|
|
7201
7336
|
active: index === currentStepIndex,
|
|
@@ -7211,14 +7346,14 @@ var init_Slider = __esm({
|
|
|
7211
7346
|
},
|
|
7212
7347
|
index
|
|
7213
7348
|
)) }),
|
|
7214
|
-
/* @__PURE__ */ (0,
|
|
7349
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(
|
|
7215
7350
|
"div",
|
|
7216
7351
|
{
|
|
7217
7352
|
className: `relative w-full overflow-hidden ${className}`,
|
|
7218
7353
|
onMouseEnter: handleMouseEnter,
|
|
7219
7354
|
onMouseLeave: handleMouseLeave,
|
|
7220
7355
|
children: [
|
|
7221
|
-
/* @__PURE__ */ (0,
|
|
7356
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
7222
7357
|
"div",
|
|
7223
7358
|
{
|
|
7224
7359
|
ref: trackRef,
|
|
@@ -7230,32 +7365,32 @@ var init_Slider = __esm({
|
|
|
7230
7365
|
children: slides
|
|
7231
7366
|
}
|
|
7232
7367
|
),
|
|
7233
|
-
show_arrows && /* @__PURE__ */ (0,
|
|
7234
|
-
/* @__PURE__ */ (0,
|
|
7368
|
+
show_arrows && /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_jsx_runtime91.Fragment, { children: [
|
|
7369
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
7235
7370
|
ArrowButton,
|
|
7236
7371
|
{
|
|
7237
7372
|
direction: "left",
|
|
7238
7373
|
onClick: prevSlide,
|
|
7239
7374
|
visible: infinite_scroll || currentSlide > 0,
|
|
7240
7375
|
className: arrowClassName,
|
|
7241
|
-
children: /* @__PURE__ */ (0,
|
|
7376
|
+
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
7377
|
}
|
|
7243
7378
|
),
|
|
7244
|
-
/* @__PURE__ */ (0,
|
|
7379
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
7245
7380
|
ArrowButton,
|
|
7246
7381
|
{
|
|
7247
7382
|
direction: "right",
|
|
7248
7383
|
onClick: nextSlide,
|
|
7249
7384
|
visible: infinite_scroll || currentSlide < maxSlide,
|
|
7250
7385
|
className: arrowClassName,
|
|
7251
|
-
children: /* @__PURE__ */ (0,
|
|
7386
|
+
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
7387
|
}
|
|
7253
7388
|
)
|
|
7254
7389
|
] })
|
|
7255
7390
|
]
|
|
7256
7391
|
}
|
|
7257
7392
|
),
|
|
7258
|
-
show_dots && progressPosition !== "top" && /* @__PURE__ */ (0,
|
|
7393
|
+
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
7394
|
ProgressPill,
|
|
7260
7395
|
{
|
|
7261
7396
|
active: index === currentStepIndex,
|
|
@@ -7279,7 +7414,7 @@ var init_Slider = __esm({
|
|
|
7279
7414
|
visible,
|
|
7280
7415
|
children,
|
|
7281
7416
|
className = ""
|
|
7282
|
-
}) => /* @__PURE__ */ (0,
|
|
7417
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
7283
7418
|
"button",
|
|
7284
7419
|
{
|
|
7285
7420
|
className: `
|
|
@@ -7305,13 +7440,13 @@ var init_Slider = __esm({
|
|
|
7305
7440
|
currentStep,
|
|
7306
7441
|
customProgress = null
|
|
7307
7442
|
}) => {
|
|
7308
|
-
const [progress, setProgress] = (0,
|
|
7309
|
-
(0,
|
|
7443
|
+
const [progress, setProgress] = (0, import_react62.useState)(0);
|
|
7444
|
+
(0, import_react62.useEffect)(() => {
|
|
7310
7445
|
if (active) {
|
|
7311
7446
|
setProgress(0);
|
|
7312
7447
|
}
|
|
7313
7448
|
}, [active, index]);
|
|
7314
|
-
(0,
|
|
7449
|
+
(0, import_react62.useEffect)(() => {
|
|
7315
7450
|
if (!active || !isPlaying || customProgress !== null) {
|
|
7316
7451
|
if (!active) {
|
|
7317
7452
|
setProgress(0);
|
|
@@ -7364,7 +7499,7 @@ var init_Slider = __esm({
|
|
|
7364
7499
|
const renderProgressBar = () => {
|
|
7365
7500
|
if (style === "modern" && isActive) {
|
|
7366
7501
|
const displayProgress = customProgress ?? progress;
|
|
7367
|
-
return /* @__PURE__ */ (0,
|
|
7502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
7368
7503
|
"div",
|
|
7369
7504
|
{
|
|
7370
7505
|
className: `absolute top-0 left-0 h-full rounded-full ${activeClassName || "bg-white"} transition-all duration-50 ease-linear`,
|
|
@@ -7374,7 +7509,7 @@ var init_Slider = __esm({
|
|
|
7374
7509
|
}
|
|
7375
7510
|
return null;
|
|
7376
7511
|
};
|
|
7377
|
-
return /* @__PURE__ */ (0,
|
|
7512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
7378
7513
|
"button",
|
|
7379
7514
|
{
|
|
7380
7515
|
className: `${baseClasses} ${getStyleClasses()}`,
|
|
@@ -7856,7 +7991,7 @@ var InputControl_default = InputControl2;
|
|
|
7856
7991
|
init_InputControlType();
|
|
7857
7992
|
|
|
7858
7993
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
7859
|
-
var
|
|
7994
|
+
var import_react64 = __toESM(require("react"));
|
|
7860
7995
|
|
|
7861
7996
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
7862
7997
|
var import_react49 = __toESM(require("react"));
|
|
@@ -8656,8 +8791,8 @@ var WidgetNode = (props) => {
|
|
|
8656
8791
|
var WidgetNode_default = WidgetNode;
|
|
8657
8792
|
|
|
8658
8793
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
8659
|
-
var
|
|
8660
|
-
var
|
|
8794
|
+
var import_dynamic17 = __toESM(require("next/dynamic"));
|
|
8795
|
+
var import_react63 = __toESM(require("react"));
|
|
8661
8796
|
|
|
8662
8797
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
8663
8798
|
var import_dynamic12 = __toESM(require("next/dynamic"));
|
|
@@ -9846,13 +9981,112 @@ var GoogleMapNode = (props) => {
|
|
|
9846
9981
|
};
|
|
9847
9982
|
var GoogleMapNode_default = GoogleMapNode;
|
|
9848
9983
|
|
|
9984
|
+
// src/components/pageRenderingEngine/nodes/MediaAccordionNode.tsx
|
|
9985
|
+
var import_dynamic16 = __toESM(require("next/dynamic"));
|
|
9986
|
+
init_ServiceClient();
|
|
9987
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
9988
|
+
var MediaAccordionNodeClient2 = (0, import_dynamic16.default)(
|
|
9989
|
+
() => Promise.resolve().then(() => (init_MediaAccordionNodeClient(), MediaAccordionNodeClient_exports)),
|
|
9990
|
+
{ ssr: false }
|
|
9991
|
+
);
|
|
9992
|
+
var getNestedValue6 = (value, path) => path.split(".").reduce((current, key) => {
|
|
9993
|
+
if (!current || typeof current !== "object") return void 0;
|
|
9994
|
+
return current[key];
|
|
9995
|
+
}, value);
|
|
9996
|
+
var getAssetUrl = (value) => {
|
|
9997
|
+
if (typeof value === "string") {
|
|
9998
|
+
const trimmed = value.trim();
|
|
9999
|
+
if (!trimmed) return {};
|
|
10000
|
+
try {
|
|
10001
|
+
return getAssetUrl(JSON.parse(trimmed));
|
|
10002
|
+
} catch {
|
|
10003
|
+
return { url: trimmed };
|
|
10004
|
+
}
|
|
10005
|
+
}
|
|
10006
|
+
if (Array.isArray(value)) {
|
|
10007
|
+
const image = value.find(
|
|
10008
|
+
(entry) => entry && typeof entry === "object" && "assetUrl" in entry
|
|
10009
|
+
);
|
|
10010
|
+
return getAssetUrl(image);
|
|
10011
|
+
}
|
|
10012
|
+
if (value && typeof value === "object") {
|
|
10013
|
+
const asset = value;
|
|
10014
|
+
return {
|
|
10015
|
+
url: typeof asset.assetUrl === "string" ? asset.assetUrl : void 0,
|
|
10016
|
+
posterUrl: typeof asset.posterUrl === "string" ? asset.posterUrl : void 0
|
|
10017
|
+
};
|
|
10018
|
+
}
|
|
10019
|
+
return {};
|
|
10020
|
+
};
|
|
10021
|
+
var fetchStoryItems = async (node, apiBaseUrl, session, routeParameters) => {
|
|
10022
|
+
const dataSource = node.dataSource?.trim();
|
|
10023
|
+
if (!dataSource) return void 0;
|
|
10024
|
+
const endpoint = dataSource.replace(
|
|
10025
|
+
/\{(\w+)\}/g,
|
|
10026
|
+
(placeholder, key) => routeParameters?.[key] == null ? placeholder : String(routeParameters[key])
|
|
10027
|
+
);
|
|
10028
|
+
try {
|
|
10029
|
+
const response = await new ServiceClient_default(apiBaseUrl, session).get(endpoint);
|
|
10030
|
+
if (!response?.isSuccessful) {
|
|
10031
|
+
console.error(
|
|
10032
|
+
"Story accordion API request failed:",
|
|
10033
|
+
response?.message || endpoint
|
|
10034
|
+
);
|
|
10035
|
+
return void 0;
|
|
10036
|
+
}
|
|
10037
|
+
const result = response.result;
|
|
10038
|
+
const records = Array.isArray(result) ? result : node.responseType === "object" && result ? [result] : [];
|
|
10039
|
+
return records.flatMap((record, index) => {
|
|
10040
|
+
const title = getNestedValue6(record, node.titleField || "title");
|
|
10041
|
+
const mappedMedia = getAssetUrl(
|
|
10042
|
+
getNestedValue6(record, node.mediaUrlField || "mediaUrl")
|
|
10043
|
+
);
|
|
10044
|
+
const explicitPoster = node.posterUrlField ? getAssetUrl(getNestedValue6(record, node.posterUrlField)).url : void 0;
|
|
10045
|
+
const mediaUrl = mappedMedia.url;
|
|
10046
|
+
if (!mediaUrl) return [];
|
|
10047
|
+
const typeValue = node.mediaTypeField ? getNestedValue6(record, node.mediaTypeField) : void 0;
|
|
10048
|
+
const mediaType = typeof typeValue === "string" ? typeValue.toLowerCase() === "video" ? "video" : "image" : /\.(mp4|webm|ogv|m3u8)(?:$|[?#])/i.test(mediaUrl) ? "video" : "image";
|
|
10049
|
+
return [
|
|
10050
|
+
{
|
|
10051
|
+
id: `api-story-${index}`,
|
|
10052
|
+
title: typeof title === "string" || typeof title === "number" ? String(title) : `Story ${index + 1}`,
|
|
10053
|
+
mediaUrl,
|
|
10054
|
+
posterUrl: explicitPoster || mappedMedia.posterUrl,
|
|
10055
|
+
mediaType
|
|
10056
|
+
}
|
|
10057
|
+
];
|
|
10058
|
+
});
|
|
10059
|
+
} catch (error) {
|
|
10060
|
+
console.error("Story accordion API request failed:", error);
|
|
10061
|
+
return void 0;
|
|
10062
|
+
}
|
|
10063
|
+
};
|
|
10064
|
+
var MediaAccordionNode = async (props) => {
|
|
10065
|
+
const apiItems = await fetchStoryItems(
|
|
10066
|
+
props.node,
|
|
10067
|
+
props.apiBaseUrl,
|
|
10068
|
+
props.session,
|
|
10069
|
+
props.routeParameters
|
|
10070
|
+
);
|
|
10071
|
+
const node = apiItems ? { ...props.node, items: apiItems } : props.node;
|
|
10072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
10073
|
+
MediaAccordionNodeClient2,
|
|
10074
|
+
{
|
|
10075
|
+
node,
|
|
10076
|
+
apiBaseUrl: props.apiBaseUrl,
|
|
10077
|
+
assetBaseUrl: props.assetBaseUrl
|
|
10078
|
+
}
|
|
10079
|
+
);
|
|
10080
|
+
};
|
|
10081
|
+
var MediaAccordionNode_default = MediaAccordionNode;
|
|
10082
|
+
|
|
9849
10083
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
9850
|
-
var
|
|
9851
|
-
var Pagination2 = (0,
|
|
9852
|
-
var DataBindingControls2 = (0,
|
|
10084
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
10085
|
+
var Pagination2 = (0, import_dynamic17.default)(() => Promise.resolve().then(() => (init_Pagination(), Pagination_exports)), { ssr: true });
|
|
10086
|
+
var DataBindingControls2 = (0, import_dynamic17.default)(() => Promise.resolve().then(() => (init_DataBindingControls(), DataBindingControls_exports)), {
|
|
9853
10087
|
ssr: true
|
|
9854
10088
|
});
|
|
9855
|
-
var Slider2 = (0,
|
|
10089
|
+
var Slider2 = (0, import_dynamic17.default)(() => Promise.resolve().then(() => (init_Slider(), Slider_exports)), {
|
|
9856
10090
|
ssr: false
|
|
9857
10091
|
});
|
|
9858
10092
|
function toCamelCase(str) {
|
|
@@ -9873,7 +10107,7 @@ function convertKeysToCamelCase(obj) {
|
|
|
9873
10107
|
Object.entries(obj).filter(([_, value]) => value !== "" && value !== void 0).map(([key, value]) => [toCamelCase(key), convertKeysToCamelCase(value)])
|
|
9874
10108
|
);
|
|
9875
10109
|
}
|
|
9876
|
-
var
|
|
10110
|
+
var getNestedValue7 = (obj, path) => {
|
|
9877
10111
|
if (!obj || !path) return void 0;
|
|
9878
10112
|
return path.split(".").reduce((current, key) => {
|
|
9879
10113
|
{
|
|
@@ -9918,7 +10152,7 @@ function generateCompleteBackgroundString(layers, apiBaseUrl, dataItem) {
|
|
|
9918
10152
|
const imageValue = layer.value;
|
|
9919
10153
|
let assetUrl = imageValue.assetUrl || "";
|
|
9920
10154
|
if (layer.datafield && dataItem) {
|
|
9921
|
-
const fieldValue =
|
|
10155
|
+
const fieldValue = getNestedValue7(dataItem, layer.datafield);
|
|
9922
10156
|
const resolvedAssetUrl = resolveAssetUrl(fieldValue, layer.tag);
|
|
9923
10157
|
if (resolvedAssetUrl) {
|
|
9924
10158
|
assetUrl = resolvedAssetUrl;
|
|
@@ -10043,7 +10277,8 @@ var DivContainer = async (props) => {
|
|
|
10043
10277
|
"svg-icon": SVGIconNode_default,
|
|
10044
10278
|
document: DocumentNode_default,
|
|
10045
10279
|
"google-map": GoogleMapNode_default,
|
|
10046
|
-
counter: CounterNode_default
|
|
10280
|
+
counter: CounterNode_default,
|
|
10281
|
+
"story-accordion": MediaAccordionNode_default
|
|
10047
10282
|
};
|
|
10048
10283
|
const styles = props.node.cssProperties;
|
|
10049
10284
|
const mobileStyles = props.node.mobileCssProperties;
|
|
@@ -10120,7 +10355,7 @@ var DivContainer = async (props) => {
|
|
|
10120
10355
|
response = await serviceClient.get(endpoint);
|
|
10121
10356
|
result = response?.result;
|
|
10122
10357
|
if (dataBindingProperties.childCollectionName && props.dataitem) {
|
|
10123
|
-
childCollectionData =
|
|
10358
|
+
childCollectionData = getNestedValue7(
|
|
10124
10359
|
props.dataitem,
|
|
10125
10360
|
dataBindingProperties.childCollectionName
|
|
10126
10361
|
);
|
|
@@ -10142,7 +10377,7 @@ var DivContainer = async (props) => {
|
|
|
10142
10377
|
}
|
|
10143
10378
|
const SelectedNode = NodeTypes2[node.type];
|
|
10144
10379
|
if (!SelectedNode) return null;
|
|
10145
|
-
return /* @__PURE__ */ (0,
|
|
10380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_react63.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
10146
10381
|
SelectedNode,
|
|
10147
10382
|
{
|
|
10148
10383
|
node,
|
|
@@ -10247,7 +10482,7 @@ var DivContainer = async (props) => {
|
|
|
10247
10482
|
item,
|
|
10248
10483
|
idx,
|
|
10249
10484
|
props.href ? void 0 : item?.links?.view
|
|
10250
|
-
)?.map((child, i) => /* @__PURE__ */ (0,
|
|
10485
|
+
)?.map((child, i) => /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_react63.default.Fragment, { children: child }, i)) : renderChildren2(props.node.children, props, item, idx)
|
|
10251
10486
|
);
|
|
10252
10487
|
}
|
|
10253
10488
|
return props.node.children.flatMap((node, childIndex) => {
|
|
@@ -10258,7 +10493,7 @@ var DivContainer = async (props) => {
|
|
|
10258
10493
|
let repeatItems = null;
|
|
10259
10494
|
const childCollectionName = node?.dataBinding?.childCollectionName;
|
|
10260
10495
|
if (childCollectionName && props.dataitem) {
|
|
10261
|
-
const nestedCollection =
|
|
10496
|
+
const nestedCollection = getNestedValue7(
|
|
10262
10497
|
props.dataitem,
|
|
10263
10498
|
childCollectionName
|
|
10264
10499
|
);
|
|
@@ -10365,17 +10600,17 @@ var DivContainer = async (props) => {
|
|
|
10365
10600
|
dataBindingProperties?.showFacets || dataBindingProperties?.showSortOptions || dataBindingProperties?.showSearchBar
|
|
10366
10601
|
);
|
|
10367
10602
|
const WrapperComponent = Wrapper;
|
|
10368
|
-
const renderedContainer = /* @__PURE__ */ (0,
|
|
10603
|
+
const renderedContainer = /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
10369
10604
|
WrapperComponent,
|
|
10370
10605
|
{
|
|
10371
10606
|
id: guid,
|
|
10372
10607
|
style: combinedStyles,
|
|
10373
10608
|
className: classNames || void 0,
|
|
10374
10609
|
...wrapperProps,
|
|
10375
|
-
children: shouldShowNoDataMessage ? hasActiveFilter ? /* @__PURE__ */ (0,
|
|
10610
|
+
children: shouldShowNoDataMessage ? hasActiveFilter ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(NoFilterResultsFound_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(NoDataFound_default, {}) : renderContainerChildren()
|
|
10376
10611
|
}
|
|
10377
10612
|
);
|
|
10378
|
-
const paginationControl = dataBindingProperties?.enablePagination ? /* @__PURE__ */ (0,
|
|
10613
|
+
const paginationControl = dataBindingProperties?.enablePagination ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
10379
10614
|
Pagination2,
|
|
10380
10615
|
{
|
|
10381
10616
|
path: props.path,
|
|
@@ -10383,15 +10618,15 @@ var DivContainer = async (props) => {
|
|
|
10383
10618
|
dataset: response
|
|
10384
10619
|
}
|
|
10385
10620
|
) : null;
|
|
10386
|
-
return /* @__PURE__ */ (0,
|
|
10387
|
-
/* @__PURE__ */ (0,
|
|
10621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_react63.default.Fragment, { children: [
|
|
10622
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
10388
10623
|
"style",
|
|
10389
10624
|
{
|
|
10390
10625
|
dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS }
|
|
10391
10626
|
}
|
|
10392
10627
|
),
|
|
10393
|
-
showDataBindingControls ? /* @__PURE__ */ (0,
|
|
10394
|
-
/* @__PURE__ */ (0,
|
|
10628
|
+
showDataBindingControls ? /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_react63.default.Fragment, { children: [
|
|
10629
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
10395
10630
|
DataBindingControls2,
|
|
10396
10631
|
{
|
|
10397
10632
|
mode: "toolbar",
|
|
@@ -10404,16 +10639,16 @@ var DivContainer = async (props) => {
|
|
|
10404
10639
|
showSearchBar: dataBindingProperties?.showSearchBar
|
|
10405
10640
|
}
|
|
10406
10641
|
),
|
|
10407
|
-
/* @__PURE__ */ (0,
|
|
10642
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
|
|
10408
10643
|
"div",
|
|
10409
10644
|
{
|
|
10410
10645
|
className: dataBindingProperties?.showFacets ? "grid items-start gap-6 lg:grid-cols-[minmax(0,1fr)_18rem]" : void 0,
|
|
10411
10646
|
children: [
|
|
10412
|
-
/* @__PURE__ */ (0,
|
|
10647
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: "min-w-0", children: [
|
|
10413
10648
|
renderedContainer,
|
|
10414
10649
|
paginationControl
|
|
10415
10650
|
] }),
|
|
10416
|
-
dataBindingProperties?.showFacets && /* @__PURE__ */ (0,
|
|
10651
|
+
dataBindingProperties?.showFacets && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("aside", { className: "hidden lg:block", children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
10417
10652
|
DataBindingControls2,
|
|
10418
10653
|
{
|
|
10419
10654
|
mode: "facets",
|
|
@@ -10426,16 +10661,16 @@ var DivContainer = async (props) => {
|
|
|
10426
10661
|
]
|
|
10427
10662
|
}
|
|
10428
10663
|
)
|
|
10429
|
-
] }) : /* @__PURE__ */ (0,
|
|
10664
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_react63.default.Fragment, { children: [
|
|
10430
10665
|
renderedContainer,
|
|
10431
|
-
paginationControl && /* @__PURE__ */ (0,
|
|
10666
|
+
paginationControl && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { children: paginationControl })
|
|
10432
10667
|
] })
|
|
10433
10668
|
] });
|
|
10434
10669
|
};
|
|
10435
10670
|
var DivContainer_default = DivContainer;
|
|
10436
10671
|
|
|
10437
10672
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
10438
|
-
var
|
|
10673
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
10439
10674
|
var NodeTypes = {
|
|
10440
10675
|
["paragraph"]: ParagraphNode_default,
|
|
10441
10676
|
["heading"]: HeadingNode_default,
|
|
@@ -10452,7 +10687,8 @@ var NodeTypes = {
|
|
|
10452
10687
|
["embed"]: EmbedNode_default,
|
|
10453
10688
|
["document"]: DocumentNode_default,
|
|
10454
10689
|
["google-map"]: GoogleMapNode_default,
|
|
10455
|
-
["counter"]: CounterNode_default
|
|
10690
|
+
["counter"]: CounterNode_default,
|
|
10691
|
+
["story-accordion"]: MediaAccordionNode_default
|
|
10456
10692
|
};
|
|
10457
10693
|
var PageBodyRenderer = (props) => {
|
|
10458
10694
|
let pageBodyTree;
|
|
@@ -10474,14 +10710,14 @@ var PageBodyRenderer = (props) => {
|
|
|
10474
10710
|
}
|
|
10475
10711
|
return true;
|
|
10476
10712
|
};
|
|
10477
|
-
return /* @__PURE__ */ (0,
|
|
10713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react64.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
10478
10714
|
{
|
|
10479
10715
|
}
|
|
10480
10716
|
const SelectedNode = NodeTypes[node.type];
|
|
10481
10717
|
if (!shouldRenderNode(node)) {
|
|
10482
10718
|
return null;
|
|
10483
10719
|
}
|
|
10484
|
-
return /* @__PURE__ */ (0,
|
|
10720
|
+
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
10721
|
SelectedNode,
|
|
10486
10722
|
{
|
|
10487
10723
|
node,
|
|
@@ -10497,7 +10733,7 @@ var PageBodyRenderer = (props) => {
|
|
|
10497
10733
|
device: props.device,
|
|
10498
10734
|
widgetRenderer: props.widgetRenderer
|
|
10499
10735
|
}
|
|
10500
|
-
) }) : /* @__PURE__ */ (0,
|
|
10736
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react64.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
10501
10737
|
SelectedNode,
|
|
10502
10738
|
{
|
|
10503
10739
|
node,
|
|
@@ -10518,10 +10754,10 @@ var PageBodyRenderer = (props) => {
|
|
|
10518
10754
|
var PageBodyRenderer_default = PageBodyRenderer;
|
|
10519
10755
|
|
|
10520
10756
|
// src/components/pageRenderingEngine/EnterAnimationHydrator.tsx
|
|
10521
|
-
var
|
|
10757
|
+
var import_react65 = require("react");
|
|
10522
10758
|
var ENTER_ANIMATION_SELECTOR = ".enter-animation";
|
|
10523
10759
|
function EnterAnimationHydrator() {
|
|
10524
|
-
(0,
|
|
10760
|
+
(0, import_react65.useEffect)(() => {
|
|
10525
10761
|
let observer;
|
|
10526
10762
|
const observedElements = /* @__PURE__ */ new WeakSet();
|
|
10527
10763
|
const revealAnimatedElements = () => {
|
|
@@ -10566,22 +10802,22 @@ function EnterAnimationHydrator() {
|
|
|
10566
10802
|
}
|
|
10567
10803
|
|
|
10568
10804
|
// src/components/Toast.tsx
|
|
10569
|
-
var
|
|
10805
|
+
var import_react66 = require("react");
|
|
10570
10806
|
init_ToastService();
|
|
10571
|
-
var
|
|
10807
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
10572
10808
|
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,
|
|
10809
|
+
const [showToast, setShowToast] = (0, import_react66.useState)(false);
|
|
10810
|
+
const [message, setMessage] = (0, import_react66.useState)("");
|
|
10811
|
+
const [messageType, setMessageType] = (0, import_react66.useState)("error");
|
|
10812
|
+
const timeoutRef = (0, import_react66.useRef)(null);
|
|
10813
|
+
const closeToast = (0, import_react66.useCallback)(() => {
|
|
10578
10814
|
if (timeoutRef.current) {
|
|
10579
10815
|
clearTimeout(timeoutRef.current);
|
|
10580
10816
|
timeoutRef.current = null;
|
|
10581
10817
|
}
|
|
10582
10818
|
setShowToast(false);
|
|
10583
10819
|
}, []);
|
|
10584
|
-
const showMessage = (0,
|
|
10820
|
+
const showMessage = (0, import_react66.useCallback)((message2, messageType2) => {
|
|
10585
10821
|
if (timeoutRef.current) {
|
|
10586
10822
|
clearTimeout(timeoutRef.current);
|
|
10587
10823
|
}
|
|
@@ -10593,7 +10829,7 @@ var Toast = () => {
|
|
|
10593
10829
|
timeoutRef.current = null;
|
|
10594
10830
|
}, 4e3);
|
|
10595
10831
|
}, []);
|
|
10596
|
-
(0,
|
|
10832
|
+
(0, import_react66.useEffect)(() => {
|
|
10597
10833
|
ToastService_default.initialize(showMessage, closeToast);
|
|
10598
10834
|
return () => {
|
|
10599
10835
|
closeToast();
|
|
@@ -10602,8 +10838,8 @@ var Toast = () => {
|
|
|
10602
10838
|
});
|
|
10603
10839
|
};
|
|
10604
10840
|
}, [closeToast, showMessage]);
|
|
10605
|
-
return /* @__PURE__ */ (0,
|
|
10606
|
-
/* @__PURE__ */ (0,
|
|
10841
|
+
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: [
|
|
10842
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
10607
10843
|
"span",
|
|
10608
10844
|
{
|
|
10609
10845
|
className: "font-medium text-inherit text-sm",
|
|
@@ -10611,7 +10847,7 @@ var Toast = () => {
|
|
|
10611
10847
|
children: message
|
|
10612
10848
|
}
|
|
10613
10849
|
),
|
|
10614
|
-
/* @__PURE__ */ (0,
|
|
10850
|
+
/* @__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
10851
|
"svg",
|
|
10616
10852
|
{
|
|
10617
10853
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -10619,7 +10855,7 @@ var Toast = () => {
|
|
|
10619
10855
|
fill: "none",
|
|
10620
10856
|
viewBox: "0 0 24 24",
|
|
10621
10857
|
stroke: "currentColor",
|
|
10622
|
-
children: /* @__PURE__ */ (0,
|
|
10858
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M6 18L18 6M6 6l12 12" })
|
|
10623
10859
|
}
|
|
10624
10860
|
) })
|
|
10625
10861
|
] }) }) });
|
|
@@ -10649,7 +10885,7 @@ init_RadioInput();
|
|
|
10649
10885
|
// src/components/NavigationTabsV2.tsx
|
|
10650
10886
|
var import_link3 = __toESM(require("next/link"));
|
|
10651
10887
|
var import_navigation2 = require("next/navigation");
|
|
10652
|
-
var
|
|
10888
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
10653
10889
|
function resolveRoutePlaceholders(route, params) {
|
|
10654
10890
|
return route.replace(/\{([^}]+)\}/g, (match, key) => {
|
|
10655
10891
|
const value = params[key];
|
|
@@ -10674,8 +10910,8 @@ var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
|
10674
10910
|
isActive: tab.isActive
|
|
10675
10911
|
})) || [];
|
|
10676
10912
|
if (mappedTabs.length === 0) return null;
|
|
10677
|
-
return /* @__PURE__ */ (0,
|
|
10678
|
-
return /* @__PURE__ */ (0,
|
|
10913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: "flex border-b bg-white rounded-t mb-3", children: mappedTabs.map(({ tabTitle, landingPageUrl, isActive }) => {
|
|
10914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_link3.default, { href: landingPageUrl, className: "-mb-px", children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
10679
10915
|
"div",
|
|
10680
10916
|
{
|
|
10681
10917
|
className: `text-sm font-medium border-b-2 px-6 py-2 transition
|
|
@@ -10688,14 +10924,14 @@ var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
|
10688
10924
|
var NavigationTabsV2_default = NavigationTabsV2;
|
|
10689
10925
|
|
|
10690
10926
|
// src/components/dataForm/DataList.tsx
|
|
10691
|
-
var
|
|
10927
|
+
var import_react69 = __toESM(require("react"));
|
|
10692
10928
|
var import_navigation3 = require("next/navigation");
|
|
10693
10929
|
|
|
10694
10930
|
// src/components/dataForm/NoContentView.tsx
|
|
10695
|
-
var
|
|
10696
|
-
var
|
|
10931
|
+
var import_react67 = __toESM(require("react"));
|
|
10932
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
10697
10933
|
var NoContentView = (props) => {
|
|
10698
|
-
return /* @__PURE__ */ (0,
|
|
10934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_react67.default.Fragment, { children: props.isDataFound === false && props.children });
|
|
10699
10935
|
};
|
|
10700
10936
|
var NoContentView_default = NoContentView;
|
|
10701
10937
|
|
|
@@ -10703,39 +10939,39 @@ var NoContentView_default = NoContentView;
|
|
|
10703
10939
|
init_InputControlType();
|
|
10704
10940
|
|
|
10705
10941
|
// src/components/dataForm/ContentView.tsx
|
|
10706
|
-
var
|
|
10707
|
-
var
|
|
10942
|
+
var import_react68 = __toESM(require("react"));
|
|
10943
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
10708
10944
|
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,
|
|
10945
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsxs)(import_react68.default.Fragment, { children: [
|
|
10946
|
+
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: [
|
|
10947
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
10948
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
10949
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "ml-2", children: [
|
|
10950
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
|
|
10951
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
|
|
10716
10952
|
] })
|
|
10717
10953
|
] }),
|
|
10718
|
-
/* @__PURE__ */ (0,
|
|
10719
|
-
/* @__PURE__ */ (0,
|
|
10720
|
-
/* @__PURE__ */ (0,
|
|
10721
|
-
/* @__PURE__ */ (0,
|
|
10722
|
-
/* @__PURE__ */ (0,
|
|
10723
|
-
/* @__PURE__ */ (0,
|
|
10724
|
-
/* @__PURE__ */ (0,
|
|
10954
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
|
|
10955
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "animate-pulse", children: [
|
|
10956
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
10957
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
10958
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
10959
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
10960
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
10725
10961
|
] }),
|
|
10726
|
-
/* @__PURE__ */ (0,
|
|
10727
|
-
/* @__PURE__ */ (0,
|
|
10728
|
-
/* @__PURE__ */ (0,
|
|
10729
|
-
/* @__PURE__ */ (0,
|
|
10730
|
-
/* @__PURE__ */ (0,
|
|
10731
|
-
/* @__PURE__ */ (0,
|
|
10962
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "animate-pulse", children: [
|
|
10963
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
10964
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
10965
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
10966
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
10967
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
10732
10968
|
] }),
|
|
10733
|
-
/* @__PURE__ */ (0,
|
|
10734
|
-
/* @__PURE__ */ (0,
|
|
10735
|
-
/* @__PURE__ */ (0,
|
|
10736
|
-
/* @__PURE__ */ (0,
|
|
10737
|
-
/* @__PURE__ */ (0,
|
|
10738
|
-
/* @__PURE__ */ (0,
|
|
10969
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsxs)("div", { className: "animate-pulse", children: [
|
|
10970
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
10971
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
10972
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
10973
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
10974
|
+
/* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
10739
10975
|
] })
|
|
10740
10976
|
] })
|
|
10741
10977
|
] }) }),
|
|
@@ -10795,7 +11031,7 @@ function FormReducer(state, action) {
|
|
|
10795
11031
|
var FormReducer_default = FormReducer;
|
|
10796
11032
|
|
|
10797
11033
|
// src/components/dataForm/DataList.tsx
|
|
10798
|
-
var
|
|
11034
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
10799
11035
|
var DataList = (props) => {
|
|
10800
11036
|
const router = (0, import_navigation3.useRouter)();
|
|
10801
11037
|
let builder = new OdataBuilder(props.path);
|
|
@@ -10803,12 +11039,12 @@ var DataList = (props) => {
|
|
|
10803
11039
|
let activePageNumber = 0;
|
|
10804
11040
|
let pages = 0;
|
|
10805
11041
|
console.log(props.addLinkText);
|
|
10806
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
10807
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
10808
|
-
(0,
|
|
11042
|
+
const [isDataFound, setIsDataFound] = (0, import_react69.useState)(null);
|
|
11043
|
+
const [searchTerm, setSearchTerm] = (0, import_react69.useState)(props.query?.searchTerm ?? "");
|
|
11044
|
+
(0, import_react69.useEffect)(() => {
|
|
10809
11045
|
setSearchTerm(props.query?.searchTerm ?? "");
|
|
10810
11046
|
}, [props.query?.searchTerm]);
|
|
10811
|
-
(0,
|
|
11047
|
+
(0, import_react69.useEffect)(() => {
|
|
10812
11048
|
if (props?.dataset) {
|
|
10813
11049
|
if (props?.dataset.result && props.dataset.result.length > 0) {
|
|
10814
11050
|
setIsDataFound(true);
|
|
@@ -10817,7 +11053,7 @@ var DataList = (props) => {
|
|
|
10817
11053
|
}
|
|
10818
11054
|
}
|
|
10819
11055
|
}, [props.dataset]);
|
|
10820
|
-
(0,
|
|
11056
|
+
(0, import_react69.useEffect)(() => {
|
|
10821
11057
|
if (!props.query?.["$filter"] || !props.filters) return;
|
|
10822
11058
|
const filterQuery = props.query["$filter"];
|
|
10823
11059
|
props.filters.forEach((filter) => {
|
|
@@ -10836,7 +11072,7 @@ var DataList = (props) => {
|
|
|
10836
11072
|
if (path.includes(".")) {
|
|
10837
11073
|
return path.split(".").reduce((prev, curr) => prev ? prev[curr] : null, obj);
|
|
10838
11074
|
} else if (Array.isArray(obj[path])) {
|
|
10839
|
-
return obj[path].map((item, index) => /* @__PURE__ */ (0,
|
|
11075
|
+
return obj[path].map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { children: item }, index));
|
|
10840
11076
|
} else {
|
|
10841
11077
|
return obj[path];
|
|
10842
11078
|
}
|
|
@@ -10845,11 +11081,11 @@ var DataList = (props) => {
|
|
|
10845
11081
|
inputValues: {},
|
|
10846
11082
|
lastPropertyChanged: ""
|
|
10847
11083
|
};
|
|
10848
|
-
const [formState, dispatch] = (0,
|
|
11084
|
+
const [formState, dispatch] = (0, import_react69.useReducer)(FormReducer_default, initialState);
|
|
10849
11085
|
const getSearchableColumns = () => {
|
|
10850
11086
|
return props.columns?.filter((c) => c.isSearchable)?.map((c) => c.name)?.join(",");
|
|
10851
11087
|
};
|
|
10852
|
-
const handleFilterChange = (0,
|
|
11088
|
+
const handleFilterChange = (0, import_react69.useCallback)(
|
|
10853
11089
|
(updatedValues) => {
|
|
10854
11090
|
dispatch({
|
|
10855
11091
|
type: FORM_INPUT_UPDATE,
|
|
@@ -10880,7 +11116,7 @@ var DataList = (props) => {
|
|
|
10880
11116
|
},
|
|
10881
11117
|
[dispatch, props, router]
|
|
10882
11118
|
);
|
|
10883
|
-
(0,
|
|
11119
|
+
(0, import_react69.useEffect)(() => {
|
|
10884
11120
|
if (!props.columns.some((col) => col.isSearchable)) {
|
|
10885
11121
|
return;
|
|
10886
11122
|
}
|
|
@@ -10918,30 +11154,30 @@ var DataList = (props) => {
|
|
|
10918
11154
|
const renderPageNumbers = () => {
|
|
10919
11155
|
if (pages <= 10) {
|
|
10920
11156
|
return Array.from({ length: pages }, (_, index) => index + 1).map(
|
|
10921
|
-
(page) => /* @__PURE__ */ (0,
|
|
11157
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_react69.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
10922
11158
|
Hyperlink,
|
|
10923
11159
|
{
|
|
10924
11160
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
10925
11161
|
href: builder.getNewPageUrl(page),
|
|
10926
11162
|
children: page
|
|
10927
11163
|
}
|
|
10928
|
-
) : /* @__PURE__ */ (0,
|
|
11164
|
+
) : /* @__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
11165
|
);
|
|
10930
11166
|
} else {
|
|
10931
11167
|
const showFirstPages = activePageNumber <= 5;
|
|
10932
11168
|
const showLastPages = activePageNumber > pages - 5;
|
|
10933
11169
|
if (showFirstPages) {
|
|
10934
|
-
return /* @__PURE__ */ (0,
|
|
10935
|
-
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0,
|
|
11170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(import_jsx_runtime98.Fragment, { children: [
|
|
11171
|
+
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
11172
|
Hyperlink,
|
|
10937
11173
|
{
|
|
10938
11174
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
10939
11175
|
href: builder.getNewPageUrl(page),
|
|
10940
11176
|
children: page
|
|
10941
11177
|
}
|
|
10942
|
-
) : /* @__PURE__ */ (0,
|
|
10943
|
-
/* @__PURE__ */ (0,
|
|
10944
|
-
/* @__PURE__ */ (0,
|
|
11178
|
+
) : /* @__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)),
|
|
11179
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
11180
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
10945
11181
|
Hyperlink,
|
|
10946
11182
|
{
|
|
10947
11183
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -10949,7 +11185,7 @@ var DataList = (props) => {
|
|
|
10949
11185
|
children: pages - 1
|
|
10950
11186
|
}
|
|
10951
11187
|
),
|
|
10952
|
-
/* @__PURE__ */ (0,
|
|
11188
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
10953
11189
|
Hyperlink,
|
|
10954
11190
|
{
|
|
10955
11191
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -10957,7 +11193,7 @@ var DataList = (props) => {
|
|
|
10957
11193
|
children: pages
|
|
10958
11194
|
}
|
|
10959
11195
|
),
|
|
10960
|
-
/* @__PURE__ */ (0,
|
|
11196
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "relative inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
10961
11197
|
"select",
|
|
10962
11198
|
{
|
|
10963
11199
|
className: " py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -10969,18 +11205,18 @@ var DataList = (props) => {
|
|
|
10969
11205
|
}
|
|
10970
11206
|
},
|
|
10971
11207
|
children: [
|
|
10972
|
-
/* @__PURE__ */ (0,
|
|
11208
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("option", { className: "", value: "", children: "Jump to" }),
|
|
10973
11209
|
Array.from(
|
|
10974
11210
|
{ length: Math.max(0, pages - 10) },
|
|
10975
11211
|
(_, index) => index + 9
|
|
10976
|
-
).map((page) => /* @__PURE__ */ (0,
|
|
11212
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("option", { value: page, children: page }, page))
|
|
10977
11213
|
]
|
|
10978
11214
|
}
|
|
10979
11215
|
) })
|
|
10980
11216
|
] });
|
|
10981
11217
|
} else if (showLastPages) {
|
|
10982
|
-
return /* @__PURE__ */ (0,
|
|
10983
|
-
/* @__PURE__ */ (0,
|
|
11218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(import_jsx_runtime98.Fragment, { children: [
|
|
11219
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
10984
11220
|
Hyperlink,
|
|
10985
11221
|
{
|
|
10986
11222
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -10988,7 +11224,7 @@ var DataList = (props) => {
|
|
|
10988
11224
|
children: "1"
|
|
10989
11225
|
}
|
|
10990
11226
|
),
|
|
10991
|
-
/* @__PURE__ */ (0,
|
|
11227
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
10992
11228
|
Hyperlink,
|
|
10993
11229
|
{
|
|
10994
11230
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -10996,21 +11232,21 @@ var DataList = (props) => {
|
|
|
10996
11232
|
children: "2"
|
|
10997
11233
|
}
|
|
10998
11234
|
),
|
|
10999
|
-
/* @__PURE__ */ (0,
|
|
11235
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
11000
11236
|
Array.from({ length: 8 }, (_, index) => pages - 7 + index).map(
|
|
11001
|
-
(page) => /* @__PURE__ */ (0,
|
|
11237
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_react69.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11002
11238
|
Hyperlink,
|
|
11003
11239
|
{
|
|
11004
11240
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
11005
11241
|
href: builder.getNewPageUrl(page),
|
|
11006
11242
|
children: page
|
|
11007
11243
|
}
|
|
11008
|
-
) : /* @__PURE__ */ (0,
|
|
11244
|
+
) : /* @__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
11245
|
)
|
|
11010
11246
|
] });
|
|
11011
11247
|
} else {
|
|
11012
|
-
return /* @__PURE__ */ (0,
|
|
11013
|
-
/* @__PURE__ */ (0,
|
|
11248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(import_jsx_runtime98.Fragment, { children: [
|
|
11249
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11014
11250
|
Hyperlink,
|
|
11015
11251
|
{
|
|
11016
11252
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -11018,7 +11254,7 @@ var DataList = (props) => {
|
|
|
11018
11254
|
children: "1"
|
|
11019
11255
|
}
|
|
11020
11256
|
),
|
|
11021
|
-
/* @__PURE__ */ (0,
|
|
11257
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11022
11258
|
Hyperlink,
|
|
11023
11259
|
{
|
|
11024
11260
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -11026,20 +11262,20 @@ var DataList = (props) => {
|
|
|
11026
11262
|
children: "2"
|
|
11027
11263
|
}
|
|
11028
11264
|
),
|
|
11029
|
-
/* @__PURE__ */ (0,
|
|
11265
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
11030
11266
|
Array.from(
|
|
11031
11267
|
{ length: 5 },
|
|
11032
11268
|
(_, index) => activePageNumber - 2 + index
|
|
11033
|
-
).map((page) => /* @__PURE__ */ (0,
|
|
11269
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_react69.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11034
11270
|
Hyperlink,
|
|
11035
11271
|
{
|
|
11036
11272
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
11037
11273
|
href: builder.getNewPageUrl(page),
|
|
11038
11274
|
children: page
|
|
11039
11275
|
}
|
|
11040
|
-
) : /* @__PURE__ */ (0,
|
|
11041
|
-
/* @__PURE__ */ (0,
|
|
11042
|
-
/* @__PURE__ */ (0,
|
|
11276
|
+
) : /* @__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)),
|
|
11277
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
11278
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11043
11279
|
Hyperlink,
|
|
11044
11280
|
{
|
|
11045
11281
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -11047,7 +11283,7 @@ var DataList = (props) => {
|
|
|
11047
11283
|
children: pages - 1
|
|
11048
11284
|
}
|
|
11049
11285
|
),
|
|
11050
|
-
/* @__PURE__ */ (0,
|
|
11286
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11051
11287
|
Hyperlink,
|
|
11052
11288
|
{
|
|
11053
11289
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -11055,7 +11291,7 @@ var DataList = (props) => {
|
|
|
11055
11291
|
children: pages
|
|
11056
11292
|
}
|
|
11057
11293
|
),
|
|
11058
|
-
/* @__PURE__ */ (0,
|
|
11294
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "relative inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
11059
11295
|
"select",
|
|
11060
11296
|
{
|
|
11061
11297
|
className: "px-2 py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -11067,8 +11303,8 @@ var DataList = (props) => {
|
|
|
11067
11303
|
}
|
|
11068
11304
|
},
|
|
11069
11305
|
children: [
|
|
11070
|
-
/* @__PURE__ */ (0,
|
|
11071
|
-
Array.from({ length: pages - 4 }, (_, index) => index + 3).filter((page) => page > 2 && page < pages - 1).map((page) => /* @__PURE__ */ (0,
|
|
11306
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("option", { value: "", children: "Jump to" }),
|
|
11307
|
+
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
11308
|
]
|
|
11073
11309
|
}
|
|
11074
11310
|
) })
|
|
@@ -11076,16 +11312,16 @@ var DataList = (props) => {
|
|
|
11076
11312
|
}
|
|
11077
11313
|
}
|
|
11078
11314
|
};
|
|
11079
|
-
return /* @__PURE__ */ (0,
|
|
11080
|
-
/* @__PURE__ */ (0,
|
|
11081
|
-
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0,
|
|
11315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(import_react69.default.Fragment, { children: [
|
|
11316
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(ContentView_default, { isDataFound, children: [
|
|
11317
|
+
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
11082
11318
|
"div",
|
|
11083
11319
|
{
|
|
11084
11320
|
className: `flex justify-between items-center bg-white pl-6 pr-2 h-14 mb-3 shadow-sm rounded-md sticky top-0`,
|
|
11085
11321
|
children: [
|
|
11086
|
-
props.title ? /* @__PURE__ */ (0,
|
|
11087
|
-
/* @__PURE__ */ (0,
|
|
11088
|
-
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0,
|
|
11322
|
+
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", {}),
|
|
11323
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
11324
|
+
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11089
11325
|
InputControl_default,
|
|
11090
11326
|
{
|
|
11091
11327
|
name: "Search_input",
|
|
@@ -11098,7 +11334,7 @@ var DataList = (props) => {
|
|
|
11098
11334
|
}
|
|
11099
11335
|
}
|
|
11100
11336
|
),
|
|
11101
|
-
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0,
|
|
11337
|
+
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11102
11338
|
InputControl_default,
|
|
11103
11339
|
{
|
|
11104
11340
|
name: filter.name,
|
|
@@ -11113,15 +11349,15 @@ var DataList = (props) => {
|
|
|
11113
11349
|
},
|
|
11114
11350
|
filter.name
|
|
11115
11351
|
)),
|
|
11116
|
-
props.addLinkHref && /* @__PURE__ */ (0,
|
|
11352
|
+
props.addLinkHref && /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
11117
11353
|
Hyperlink,
|
|
11118
11354
|
{
|
|
11119
11355
|
className: "gap-1",
|
|
11120
11356
|
linkType: "Primary" /* Solid */,
|
|
11121
11357
|
href: props.addLinkHref,
|
|
11122
11358
|
children: [
|
|
11123
|
-
/* @__PURE__ */ (0,
|
|
11124
|
-
/* @__PURE__ */ (0,
|
|
11359
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Icon_default, { name: "plus", className: "w-4 h-4" }),
|
|
11360
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "text-sm font-medium", children: props.addLinkText || "Add New" })
|
|
11125
11361
|
]
|
|
11126
11362
|
}
|
|
11127
11363
|
)
|
|
@@ -11129,8 +11365,8 @@ var DataList = (props) => {
|
|
|
11129
11365
|
]
|
|
11130
11366
|
}
|
|
11131
11367
|
),
|
|
11132
|
-
/* @__PURE__ */ (0,
|
|
11133
|
-
/* @__PURE__ */ (0,
|
|
11368
|
+
/* @__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: [
|
|
11369
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("thead", { className: "bg-gray-50 sticky top-0", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("tr", { children: [
|
|
11134
11370
|
props?.columns?.map((column) => {
|
|
11135
11371
|
let url = builder.getNewOrderByUrl(column.name);
|
|
11136
11372
|
let icon = "chevronUpDown";
|
|
@@ -11141,18 +11377,18 @@ var DataList = (props) => {
|
|
|
11141
11377
|
icon = "chevronUp";
|
|
11142
11378
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
11143
11379
|
}
|
|
11144
|
-
return /* @__PURE__ */ (0,
|
|
11380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11145
11381
|
"th",
|
|
11146
11382
|
{
|
|
11147
11383
|
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,
|
|
11384
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11149
11385
|
Hyperlink,
|
|
11150
11386
|
{
|
|
11151
11387
|
href: column.enableSorting ? url : void 0,
|
|
11152
11388
|
className: "!text-neutral-contrast ",
|
|
11153
|
-
children: /* @__PURE__ */ (0,
|
|
11154
|
-
/* @__PURE__ */ (0,
|
|
11155
|
-
column.enableSorting && /* @__PURE__ */ (0,
|
|
11389
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("span", { className: "flex items-center space-x-1", children: [
|
|
11390
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "text-black", children: column.label }),
|
|
11391
|
+
column.enableSorting && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Icon_default, { className: "w-4 h-4", name: icon })
|
|
11156
11392
|
] })
|
|
11157
11393
|
}
|
|
11158
11394
|
)
|
|
@@ -11160,25 +11396,25 @@ var DataList = (props) => {
|
|
|
11160
11396
|
column.name
|
|
11161
11397
|
);
|
|
11162
11398
|
}),
|
|
11163
|
-
props.onQuickView && /* @__PURE__ */ (0,
|
|
11399
|
+
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
11400
|
] }) }),
|
|
11165
|
-
/* @__PURE__ */ (0,
|
|
11401
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("tbody", { className: "divide-y divide-gray-200 ", children: props.dataset?.result?.map((dataitem, index) => {
|
|
11166
11402
|
let validityClass = "";
|
|
11167
11403
|
if (props.recordValidityColumnName && getNestedProperty2(dataitem, props.recordValidityColumnName) == false) {
|
|
11168
11404
|
validityClass = "bg-alert-200";
|
|
11169
11405
|
}
|
|
11170
|
-
return /* @__PURE__ */ (0,
|
|
11406
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("tr", { className: validityClass, children: [
|
|
11171
11407
|
props?.columns?.map((column, colindex) => {
|
|
11172
|
-
return /* @__PURE__ */ (0,
|
|
11408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_react69.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11173
11409
|
"td",
|
|
11174
11410
|
{
|
|
11175
11411
|
className: "px-6 py-2 whitespace-normal " + (column.controlType == ViewControlTypes_default.money ? "" : ""),
|
|
11176
|
-
children: column.addhref === true ? /* @__PURE__ */ (0,
|
|
11412
|
+
children: column.addhref === true ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11177
11413
|
Hyperlink,
|
|
11178
11414
|
{
|
|
11179
11415
|
className: "",
|
|
11180
11416
|
href: `https://${dataitem[column.name]}`,
|
|
11181
|
-
children: /* @__PURE__ */ (0,
|
|
11417
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11182
11418
|
ViewControl_default,
|
|
11183
11419
|
{
|
|
11184
11420
|
controlType: column.controlType,
|
|
@@ -11191,11 +11427,11 @@ var DataList = (props) => {
|
|
|
11191
11427
|
}
|
|
11192
11428
|
)
|
|
11193
11429
|
}
|
|
11194
|
-
) : column.showAsLink ? /* @__PURE__ */ (0,
|
|
11430
|
+
) : column.showAsLink ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11195
11431
|
Hyperlink,
|
|
11196
11432
|
{
|
|
11197
11433
|
href: props.path + dataitem[props.columns[0].name] + "/" + (dataitem.linkUrlSegment ?? column.linkUrlSegment),
|
|
11198
|
-
children: /* @__PURE__ */ (0,
|
|
11434
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11199
11435
|
ViewControl_default,
|
|
11200
11436
|
{
|
|
11201
11437
|
controlType: column.controlType,
|
|
@@ -11205,7 +11441,7 @@ var DataList = (props) => {
|
|
|
11205
11441
|
}
|
|
11206
11442
|
)
|
|
11207
11443
|
}
|
|
11208
|
-
) : /* @__PURE__ */ (0,
|
|
11444
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11209
11445
|
ViewControl_default,
|
|
11210
11446
|
{
|
|
11211
11447
|
controlType: column.controlType,
|
|
@@ -11217,7 +11453,7 @@ var DataList = (props) => {
|
|
|
11217
11453
|
}
|
|
11218
11454
|
) }, colindex);
|
|
11219
11455
|
}),
|
|
11220
|
-
props.onQuickView && /* @__PURE__ */ (0,
|
|
11456
|
+
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
11457
|
"button",
|
|
11222
11458
|
{
|
|
11223
11459
|
type: "button",
|
|
@@ -11227,7 +11463,7 @@ var DataList = (props) => {
|
|
|
11227
11463
|
},
|
|
11228
11464
|
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
11465
|
children: [
|
|
11230
|
-
/* @__PURE__ */ (0,
|
|
11466
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
11231
11467
|
"svg",
|
|
11232
11468
|
{
|
|
11233
11469
|
className: "w-3.5 h-3.5",
|
|
@@ -11238,22 +11474,22 @@ var DataList = (props) => {
|
|
|
11238
11474
|
strokeLinecap: "round",
|
|
11239
11475
|
strokeLinejoin: "round",
|
|
11240
11476
|
children: [
|
|
11241
|
-
/* @__PURE__ */ (0,
|
|
11242
|
-
/* @__PURE__ */ (0,
|
|
11477
|
+
/* @__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" }),
|
|
11478
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("circle", { cx: "12", cy: "12", r: "3" })
|
|
11243
11479
|
]
|
|
11244
11480
|
}
|
|
11245
11481
|
),
|
|
11246
|
-
/* @__PURE__ */ (0,
|
|
11482
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { children: props.quickViewLabel || "Quick View" })
|
|
11247
11483
|
]
|
|
11248
11484
|
}
|
|
11249
11485
|
) })
|
|
11250
11486
|
] }, index);
|
|
11251
11487
|
}) })
|
|
11252
11488
|
] }) }),
|
|
11253
|
-
/* @__PURE__ */ (0,
|
|
11254
|
-
/* @__PURE__ */ (0,
|
|
11255
|
-
/* @__PURE__ */ (0,
|
|
11256
|
-
activePageNumber > 1 && /* @__PURE__ */ (0,
|
|
11489
|
+
/* @__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: [
|
|
11490
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "text-gray-700", children: label }),
|
|
11491
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "flex space-x-2 items-center", children: [
|
|
11492
|
+
activePageNumber > 1 && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11257
11493
|
Hyperlink,
|
|
11258
11494
|
{
|
|
11259
11495
|
className: "px-3 py-1 rounded-l-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -11261,9 +11497,9 @@ var DataList = (props) => {
|
|
|
11261
11497
|
children: "Prev"
|
|
11262
11498
|
}
|
|
11263
11499
|
),
|
|
11264
|
-
activePageNumber <= 1 && /* @__PURE__ */ (0,
|
|
11500
|
+
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
11501
|
renderPageNumbers(),
|
|
11266
|
-
activePageNumber < pages && /* @__PURE__ */ (0,
|
|
11502
|
+
activePageNumber < pages && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11267
11503
|
Hyperlink,
|
|
11268
11504
|
{
|
|
11269
11505
|
className: "px-3 py-1 rounded-r-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -11271,19 +11507,19 @@ var DataList = (props) => {
|
|
|
11271
11507
|
children: "Next"
|
|
11272
11508
|
}
|
|
11273
11509
|
),
|
|
11274
|
-
activePageNumber >= pages && /* @__PURE__ */ (0,
|
|
11510
|
+
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
11511
|
] })
|
|
11276
11512
|
] }) })
|
|
11277
11513
|
] }),
|
|
11278
|
-
/* @__PURE__ */ (0,
|
|
11279
|
-
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0,
|
|
11514
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(NoContentView_default, { isDataFound, children: [
|
|
11515
|
+
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
11280
11516
|
"div",
|
|
11281
11517
|
{
|
|
11282
11518
|
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
11519
|
children: [
|
|
11284
|
-
props.title ? /* @__PURE__ */ (0,
|
|
11285
|
-
/* @__PURE__ */ (0,
|
|
11286
|
-
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0,
|
|
11520
|
+
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", {}),
|
|
11521
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
11522
|
+
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11287
11523
|
InputControl_default,
|
|
11288
11524
|
{
|
|
11289
11525
|
name: "Search_input",
|
|
@@ -11296,7 +11532,7 @@ var DataList = (props) => {
|
|
|
11296
11532
|
}
|
|
11297
11533
|
}
|
|
11298
11534
|
),
|
|
11299
|
-
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0,
|
|
11535
|
+
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11300
11536
|
InputControl_default,
|
|
11301
11537
|
{
|
|
11302
11538
|
name: filter.name,
|
|
@@ -11311,15 +11547,15 @@ var DataList = (props) => {
|
|
|
11311
11547
|
},
|
|
11312
11548
|
filter.name
|
|
11313
11549
|
)),
|
|
11314
|
-
props.addLinkHref && /* @__PURE__ */ (0,
|
|
11550
|
+
props.addLinkHref && /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
11315
11551
|
Hyperlink,
|
|
11316
11552
|
{
|
|
11317
11553
|
className: "gap-1",
|
|
11318
11554
|
linkType: "Primary" /* Solid */,
|
|
11319
11555
|
href: props.addLinkHref,
|
|
11320
11556
|
children: [
|
|
11321
|
-
/* @__PURE__ */ (0,
|
|
11322
|
-
/* @__PURE__ */ (0,
|
|
11557
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Icon_default, { name: "plus", className: "w-4 h-4" }),
|
|
11558
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { className: "text-sm font-medium", children: props.addLinkText || "Add New" })
|
|
11323
11559
|
]
|
|
11324
11560
|
}
|
|
11325
11561
|
)
|
|
@@ -11327,8 +11563,8 @@ var DataList = (props) => {
|
|
|
11327
11563
|
]
|
|
11328
11564
|
}
|
|
11329
11565
|
),
|
|
11330
|
-
/* @__PURE__ */ (0,
|
|
11331
|
-
/* @__PURE__ */ (0,
|
|
11566
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "flex-grow overflow-y-auto justify-end bg-white rounded shadow h-[75vh]", children: [
|
|
11567
|
+
/* @__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
11568
|
let url = builder.getNewOrderByUrl(column.name);
|
|
11333
11569
|
let icon = "chevronUpDown";
|
|
11334
11570
|
if (orderBy.includes(`${column.name} desc`)) {
|
|
@@ -11338,18 +11574,18 @@ var DataList = (props) => {
|
|
|
11338
11574
|
icon = "chevronUp";
|
|
11339
11575
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
11340
11576
|
}
|
|
11341
|
-
return /* @__PURE__ */ (0,
|
|
11577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11342
11578
|
"th",
|
|
11343
11579
|
{
|
|
11344
11580
|
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,
|
|
11581
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
11346
11582
|
Hyperlink,
|
|
11347
11583
|
{
|
|
11348
11584
|
href: column.enableSorting ? url : void 0,
|
|
11349
11585
|
className: "text-body-950",
|
|
11350
|
-
children: /* @__PURE__ */ (0,
|
|
11351
|
-
/* @__PURE__ */ (0,
|
|
11352
|
-
column.enableSorting && /* @__PURE__ */ (0,
|
|
11586
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("span", { className: "flex items-center space-x-1", children: [
|
|
11587
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)("span", { children: column.label }),
|
|
11588
|
+
column.enableSorting && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Icon_default, { className: "w-4 h-4", name: icon })
|
|
11353
11589
|
] })
|
|
11354
11590
|
}
|
|
11355
11591
|
)
|
|
@@ -11357,7 +11593,7 @@ var DataList = (props) => {
|
|
|
11357
11593
|
column.name
|
|
11358
11594
|
);
|
|
11359
11595
|
}) }) }) }) }),
|
|
11360
|
-
/* @__PURE__ */ (0,
|
|
11596
|
+
/* @__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
11597
|
] })
|
|
11362
11598
|
] })
|
|
11363
11599
|
] });
|
|
@@ -11365,12 +11601,12 @@ var DataList = (props) => {
|
|
|
11365
11601
|
var DataList_default = DataList;
|
|
11366
11602
|
|
|
11367
11603
|
// src/components/dataForm/DataListRenderer.tsx
|
|
11368
|
-
var
|
|
11604
|
+
var import_react70 = __toESM(require("react"));
|
|
11369
11605
|
init_ServiceClient();
|
|
11370
11606
|
init_OdataBuilder();
|
|
11371
11607
|
init_SelectWithSearchInput();
|
|
11372
11608
|
var import_navigation4 = require("next/navigation");
|
|
11373
|
-
var
|
|
11609
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
11374
11610
|
var viewControlMap = {
|
|
11375
11611
|
number: ViewControlTypes.number,
|
|
11376
11612
|
lineText: ViewControlTypes.lineText,
|
|
@@ -11425,14 +11661,14 @@ var DataListRenderer = ({
|
|
|
11425
11661
|
widgetProps
|
|
11426
11662
|
}) => {
|
|
11427
11663
|
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,
|
|
11664
|
+
const [columns, setColumns] = (0, import_react70.useState)([]);
|
|
11665
|
+
const [dataset, setDataset] = (0, import_react70.useState)();
|
|
11666
|
+
const [filter, setFilters] = (0, import_react70.useState)([]);
|
|
11667
|
+
const [addLinkHref, setAddLinkHref] = (0, import_react70.useState)("");
|
|
11668
|
+
const [addLinkText, setAddLinkText] = (0, import_react70.useState)("");
|
|
11669
|
+
const [serviceRoute, setServiceRoute] = (0, import_react70.useState)("");
|
|
11434
11670
|
const pathname = (0, import_navigation4.usePathname)();
|
|
11435
|
-
(0,
|
|
11671
|
+
(0, import_react70.useEffect)(() => {
|
|
11436
11672
|
if (!formDefinition) return;
|
|
11437
11673
|
setColumns(mapApiToColumns(formDefinition));
|
|
11438
11674
|
setFilters(mapApiToFilters(formDefinition));
|
|
@@ -11445,7 +11681,7 @@ var DataListRenderer = ({
|
|
|
11445
11681
|
setAddLinkHref(resolvedAddLinkHref);
|
|
11446
11682
|
setAddLinkText(formDefinition?.siteFormDataList?.addLinkText ?? "");
|
|
11447
11683
|
}, [formDefinition, params]);
|
|
11448
|
-
(0,
|
|
11684
|
+
(0, import_react70.useEffect)(() => {
|
|
11449
11685
|
const fetchData = async () => {
|
|
11450
11686
|
if (!serviceRoute) return;
|
|
11451
11687
|
const resolvedRoute = resolveRoutePlaceholders2(serviceRoute, params);
|
|
@@ -11465,13 +11701,13 @@ var DataListRenderer = ({
|
|
|
11465
11701
|
isActive: landingPageUrl === pathname
|
|
11466
11702
|
};
|
|
11467
11703
|
});
|
|
11468
|
-
return /* @__PURE__ */ (0,
|
|
11704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(import_react70.default.Fragment, { children: [
|
|
11469
11705
|
resolvedTabs.length > 0 && // <NavigationTabsV2
|
|
11470
11706
|
// tabs={resolvedTabs}
|
|
11471
11707
|
// params={(widgetProps?.params ?? params) as Record<string, any>}
|
|
11472
11708
|
// />
|
|
11473
|
-
/* @__PURE__ */ (0,
|
|
11474
|
-
/* @__PURE__ */ (0,
|
|
11709
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(NavigationTabsV2_default, { tabs, params: widgetProps.params }),
|
|
11710
|
+
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
11475
11711
|
DataList_default,
|
|
11476
11712
|
{
|
|
11477
11713
|
addLinkHref,
|
|
@@ -11493,13 +11729,13 @@ var DataListRenderer_default = DataListRenderer;
|
|
|
11493
11729
|
init_InputControlType();
|
|
11494
11730
|
|
|
11495
11731
|
// src/components/dataForm/DataForm.tsx
|
|
11496
|
-
var
|
|
11732
|
+
var import_react72 = __toESM(require("react"));
|
|
11497
11733
|
init_Icon();
|
|
11498
11734
|
init_Button();
|
|
11499
11735
|
init_StyleTypes();
|
|
11500
11736
|
|
|
11501
11737
|
// src/components/dataForm/DataFormChildSection.tsx
|
|
11502
|
-
var
|
|
11738
|
+
var import_react71 = __toESM(require("react"));
|
|
11503
11739
|
|
|
11504
11740
|
// src/components/dataForm/StyleTypes.tsx
|
|
11505
11741
|
var StyleTypes2 = /* @__PURE__ */ ((StyleTypes3) => {
|
|
@@ -11526,7 +11762,7 @@ var FORM_CHILD_ONE_TO_ONE_UPDATE = "FORM_CHILD_ONE_TO_ONE_UPDATE";
|
|
|
11526
11762
|
var FORM_CHILD_ROW_ADD = "FORM_CHILD_ROW_ADD";
|
|
11527
11763
|
|
|
11528
11764
|
// src/components/dataForm/DataFormChildSection.tsx
|
|
11529
|
-
var
|
|
11765
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
11530
11766
|
var DataFormChildSection = (props) => {
|
|
11531
11767
|
const { section } = props;
|
|
11532
11768
|
const isOneToOne = section.relationshipType === "one-to-one";
|
|
@@ -11538,7 +11774,7 @@ var DataFormChildSection = (props) => {
|
|
|
11538
11774
|
return childItems.map((item, originalIndex) => ({ item, originalIndex })).filter((x) => !x.item.isDeleted) || [];
|
|
11539
11775
|
};
|
|
11540
11776
|
const childItemsToRender = getChildItemsForRendering();
|
|
11541
|
-
const handleChildInputChange = (0,
|
|
11777
|
+
const handleChildInputChange = (0, import_react71.useCallback)(
|
|
11542
11778
|
(updatedValues) => {
|
|
11543
11779
|
if (isOneToOne) {
|
|
11544
11780
|
props.callback({
|
|
@@ -11565,7 +11801,7 @@ var DataFormChildSection = (props) => {
|
|
|
11565
11801
|
},
|
|
11566
11802
|
[props, isOneToOne, childItemsToRender]
|
|
11567
11803
|
);
|
|
11568
|
-
const onAddRow = (0,
|
|
11804
|
+
const onAddRow = (0, import_react71.useCallback)(() => {
|
|
11569
11805
|
props.callback({
|
|
11570
11806
|
sectionName: props.section.name,
|
|
11571
11807
|
actionType: FORM_CHILD_ROW_ADD,
|
|
@@ -11574,7 +11810,7 @@ var DataFormChildSection = (props) => {
|
|
|
11574
11810
|
rowIndex: -1
|
|
11575
11811
|
});
|
|
11576
11812
|
}, [props]);
|
|
11577
|
-
const onDeleteRow = (0,
|
|
11813
|
+
const onDeleteRow = (0, import_react71.useCallback)(
|
|
11578
11814
|
(filteredIndex) => {
|
|
11579
11815
|
const visibleItem = childItemsToRender[filteredIndex];
|
|
11580
11816
|
if (visibleItem) {
|
|
@@ -11594,14 +11830,14 @@ var DataFormChildSection = (props) => {
|
|
|
11594
11830
|
childItemsToRender,
|
|
11595
11831
|
allChildItems: childItems
|
|
11596
11832
|
});
|
|
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,
|
|
11833
|
+
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: [
|
|
11834
|
+
section.sectionTitle && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "mb-4 text-lg font-medium text-body-950", children: section.sectionTitle }),
|
|
11835
|
+
/* @__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: [
|
|
11836
|
+
/* @__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: [
|
|
11837
|
+
(!isOneToOne || childItemsToRender.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("thead", { className: "", children: section.sectionRows.map((sectionRow, sectionRowIndex) => {
|
|
11838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("tr", { className: "", children: [
|
|
11603
11839
|
sectionRow.elements.map((field, index) => {
|
|
11604
|
-
return /* @__PURE__ */ (0,
|
|
11840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
11605
11841
|
"th",
|
|
11606
11842
|
{
|
|
11607
11843
|
className: "py-3 font-normal text-left",
|
|
@@ -11610,21 +11846,21 @@ var DataFormChildSection = (props) => {
|
|
|
11610
11846
|
field.name
|
|
11611
11847
|
);
|
|
11612
11848
|
}),
|
|
11613
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */ (0,
|
|
11849
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("th", { className: "py-3 font-normal text-left", children: "Actions" })
|
|
11614
11850
|
] }, sectionRowIndex);
|
|
11615
11851
|
}) }),
|
|
11616
|
-
/* @__PURE__ */ (0,
|
|
11852
|
+
/* @__PURE__ */ (0, import_jsx_runtime100.jsx)("tbody", { className: "divide-y divide-gray-200", children: childItemsToRender.map((visibleItem, filteredIndex) => {
|
|
11617
11853
|
const { item, originalIndex } = visibleItem;
|
|
11618
11854
|
const rowKey = originalIndex;
|
|
11619
|
-
return /* @__PURE__ */ (0,
|
|
11855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_react71.default.Fragment, { children: section.sectionRows.map(
|
|
11620
11856
|
(sectionRow, sectionRowIndex) => {
|
|
11621
|
-
return /* @__PURE__ */ (0,
|
|
11857
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
|
|
11622
11858
|
"tr",
|
|
11623
11859
|
{
|
|
11624
11860
|
className: "",
|
|
11625
11861
|
children: [
|
|
11626
11862
|
sectionRow.elements.map((field, index) => {
|
|
11627
|
-
return /* @__PURE__ */ (0,
|
|
11863
|
+
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
11864
|
InputControl_default,
|
|
11629
11865
|
{
|
|
11630
11866
|
index: filteredIndex,
|
|
@@ -11644,7 +11880,7 @@ var DataFormChildSection = (props) => {
|
|
|
11644
11880
|
}
|
|
11645
11881
|
) }) }) }, field.name);
|
|
11646
11882
|
}),
|
|
11647
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */ (0,
|
|
11883
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
11648
11884
|
ClientButton_default,
|
|
11649
11885
|
{
|
|
11650
11886
|
ButtonType: StyleTypes2.Hollow,
|
|
@@ -11653,7 +11889,7 @@ var DataFormChildSection = (props) => {
|
|
|
11653
11889
|
},
|
|
11654
11890
|
dataRole: "delete",
|
|
11655
11891
|
tabIndex: -1,
|
|
11656
|
-
children: /* @__PURE__ */ (0,
|
|
11892
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
11657
11893
|
Icon_default,
|
|
11658
11894
|
{
|
|
11659
11895
|
className: "w-4 h-4",
|
|
@@ -11670,7 +11906,7 @@ var DataFormChildSection = (props) => {
|
|
|
11670
11906
|
) }, rowKey);
|
|
11671
11907
|
}) })
|
|
11672
11908
|
] }) }),
|
|
11673
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */ (0,
|
|
11909
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "ml-1", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
|
|
11674
11910
|
ClientButton_default,
|
|
11675
11911
|
{
|
|
11676
11912
|
ButtonType: "Link" /* Link */,
|
|
@@ -11685,9 +11921,9 @@ var DataFormChildSection = (props) => {
|
|
|
11685
11921
|
var DataFormChildSection_default = DataFormChildSection;
|
|
11686
11922
|
|
|
11687
11923
|
// src/components/dataForm/DataForm.tsx
|
|
11688
|
-
var
|
|
11924
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
11689
11925
|
var DataForm = (props) => {
|
|
11690
|
-
const formRef = (0,
|
|
11926
|
+
const formRef = (0, import_react72.useRef)(null);
|
|
11691
11927
|
console.log(props.dataItem, "dssads");
|
|
11692
11928
|
const initialState = {
|
|
11693
11929
|
inputValues: {},
|
|
@@ -11696,9 +11932,9 @@ var DataForm = (props) => {
|
|
|
11696
11932
|
const childInitialState = {
|
|
11697
11933
|
inputValues: []
|
|
11698
11934
|
};
|
|
11699
|
-
const [formState, dispatch] = (0,
|
|
11935
|
+
const [formState, dispatch] = (0, import_react72.useReducer)(FormReducer_default, initialState);
|
|
11700
11936
|
console.log(props.sections, "sections");
|
|
11701
|
-
const clearHiddenChildSections = (0,
|
|
11937
|
+
const clearHiddenChildSections = (0, import_react72.useCallback)(
|
|
11702
11938
|
(changedProperty, newValues) => {
|
|
11703
11939
|
if (!props.sections) return;
|
|
11704
11940
|
const allChildSections = [];
|
|
@@ -11736,7 +11972,7 @@ var DataForm = (props) => {
|
|
|
11736
11972
|
},
|
|
11737
11973
|
[props.sections, formState.inputValues]
|
|
11738
11974
|
);
|
|
11739
|
-
const handleInputChange = (0,
|
|
11975
|
+
const handleInputChange = (0, import_react72.useCallback)(
|
|
11740
11976
|
async (updatedValues) => {
|
|
11741
11977
|
dispatch({
|
|
11742
11978
|
type: FORM_INPUT_UPDATE,
|
|
@@ -11751,7 +11987,7 @@ var DataForm = (props) => {
|
|
|
11751
11987
|
},
|
|
11752
11988
|
[dispatch, formState.inputValues, clearHiddenChildSections]
|
|
11753
11989
|
);
|
|
11754
|
-
const fetchData = (0,
|
|
11990
|
+
const fetchData = (0, import_react72.useCallback)(async () => {
|
|
11755
11991
|
if (!props.rules) return;
|
|
11756
11992
|
if (Object.keys(formState.inputValues).length === 0) {
|
|
11757
11993
|
return;
|
|
@@ -11782,7 +12018,7 @@ var DataForm = (props) => {
|
|
|
11782
12018
|
console.error("Error fetching data:", error);
|
|
11783
12019
|
}
|
|
11784
12020
|
}, [formState.lastPropertyChanged, formState.inputValues]);
|
|
11785
|
-
(0,
|
|
12021
|
+
(0, import_react72.useEffect)(() => {
|
|
11786
12022
|
fetchData();
|
|
11787
12023
|
}, [formState.inputValues, formState.lastPropertyChanged]);
|
|
11788
12024
|
function replacePlaceholders(template, context, params) {
|
|
@@ -11802,7 +12038,7 @@ var DataForm = (props) => {
|
|
|
11802
12038
|
}
|
|
11803
12039
|
);
|
|
11804
12040
|
}
|
|
11805
|
-
const handleChildSectionChangeCallback = (0,
|
|
12041
|
+
const handleChildSectionChangeCallback = (0, import_react72.useCallback)(
|
|
11806
12042
|
(params) => {
|
|
11807
12043
|
dispatch({
|
|
11808
12044
|
type: params.actionType,
|
|
@@ -11847,7 +12083,7 @@ var DataForm = (props) => {
|
|
|
11847
12083
|
});
|
|
11848
12084
|
return cloned;
|
|
11849
12085
|
}
|
|
11850
|
-
const onClick = (0,
|
|
12086
|
+
const onClick = (0, import_react72.useCallback)(async () => {
|
|
11851
12087
|
if (props.onClick) {
|
|
11852
12088
|
const isEdit = props.dataItem && Object.keys(props.dataItem).length > 0;
|
|
11853
12089
|
const normalizedValues = normalizeChildSections(
|
|
@@ -11863,21 +12099,21 @@ var DataForm = (props) => {
|
|
|
11863
12099
|
return { isSuccessful: true };
|
|
11864
12100
|
}
|
|
11865
12101
|
}, [formState, props]);
|
|
11866
|
-
const handleAdditionalOnClick = (0,
|
|
12102
|
+
const handleAdditionalOnClick = (0, import_react72.useCallback)(async () => {
|
|
11867
12103
|
if (props.additionalActions?.onClick) {
|
|
11868
12104
|
return await props.additionalActions.onClick(formState);
|
|
11869
12105
|
} else {
|
|
11870
12106
|
return { isSuccessful: true, message: "Action completed successfully" };
|
|
11871
12107
|
}
|
|
11872
12108
|
}, [formState, props]);
|
|
11873
|
-
const onDelete = (0,
|
|
12109
|
+
const onDelete = (0, import_react72.useCallback)(async () => {
|
|
11874
12110
|
if (props.onDelete) {
|
|
11875
12111
|
return await props.onDelete(formState);
|
|
11876
12112
|
} else {
|
|
11877
12113
|
return { isSuccessful: true };
|
|
11878
12114
|
}
|
|
11879
12115
|
}, [formState, props]);
|
|
11880
|
-
(0,
|
|
12116
|
+
(0, import_react72.useEffect)(() => {
|
|
11881
12117
|
if (props.dataItem) {
|
|
11882
12118
|
dispatch({
|
|
11883
12119
|
type: FORM_INITIAL_UPDATE,
|
|
@@ -11905,19 +12141,19 @@ var DataForm = (props) => {
|
|
|
11905
12141
|
return false;
|
|
11906
12142
|
}
|
|
11907
12143
|
}
|
|
11908
|
-
return /* @__PURE__ */ (0,
|
|
11909
|
-
props.title && /* @__PURE__ */ (0,
|
|
12144
|
+
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: [
|
|
12145
|
+
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
12146
|
"div",
|
|
11911
12147
|
{
|
|
11912
12148
|
className: "inline-flex items-center gap-2 cursor-pointer",
|
|
11913
12149
|
onClick: () => window.history.back(),
|
|
11914
12150
|
children: [
|
|
11915
|
-
/* @__PURE__ */ (0,
|
|
11916
|
-
/* @__PURE__ */ (0,
|
|
12151
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Icon_default, { name: "chevronLeft", className: "w-4 h-4 text-primary-800" }),
|
|
12152
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("h2", { className: "text-lg font-semibold text-primary-800", children: props.title })
|
|
11917
12153
|
]
|
|
11918
12154
|
}
|
|
11919
12155
|
) }),
|
|
11920
|
-
/* @__PURE__ */ (0,
|
|
12156
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
11921
12157
|
"form",
|
|
11922
12158
|
{
|
|
11923
12159
|
className: "group space-y-6 pb-6 overflow-y-auto",
|
|
@@ -11938,8 +12174,8 @@ var DataForm = (props) => {
|
|
|
11938
12174
|
}
|
|
11939
12175
|
}
|
|
11940
12176
|
},
|
|
11941
|
-
children: /* @__PURE__ */ (0,
|
|
11942
|
-
return /* @__PURE__ */ (0,
|
|
12177
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "flex flex-col gap-6", children: props.sections?.map((section, sectionIndex) => {
|
|
12178
|
+
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
12179
|
section.sectionRows?.map(
|
|
11944
12180
|
(sectionRow, sectionRowIndex) => {
|
|
11945
12181
|
const elementsCount = sectionRow.elements.length;
|
|
@@ -11950,14 +12186,14 @@ var DataForm = (props) => {
|
|
|
11950
12186
|
sectionRow.visible
|
|
11951
12187
|
);
|
|
11952
12188
|
}
|
|
11953
|
-
return /* @__PURE__ */ (0,
|
|
11954
|
-
return /* @__PURE__ */ (0,
|
|
12189
|
+
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) => {
|
|
12190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(
|
|
11955
12191
|
"div",
|
|
11956
12192
|
{
|
|
11957
12193
|
className: sectionRow.grow ? "grow" : "",
|
|
11958
12194
|
children: [
|
|
11959
|
-
/* @__PURE__ */ (0,
|
|
11960
|
-
/* @__PURE__ */ (0,
|
|
12195
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { children: field.controlType }),
|
|
12196
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
11961
12197
|
InputControl_default,
|
|
11962
12198
|
{
|
|
11963
12199
|
name: field.name,
|
|
@@ -11987,12 +12223,12 @@ var DataForm = (props) => {
|
|
|
11987
12223
|
}) }) }, sectionRowIndex);
|
|
11988
12224
|
}
|
|
11989
12225
|
),
|
|
11990
|
-
/* @__PURE__ */ (0,
|
|
12226
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { children: section.childSections?.map(
|
|
11991
12227
|
(childSection, childSectionIndex) => {
|
|
11992
|
-
return /* @__PURE__ */ (0,
|
|
12228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { children: childSection.name && evalutateCondition(
|
|
11993
12229
|
formState.inputValues,
|
|
11994
12230
|
childSection.visible
|
|
11995
|
-
) && /* @__PURE__ */ (0,
|
|
12231
|
+
) && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
11996
12232
|
DataFormChildSection_default,
|
|
11997
12233
|
{
|
|
11998
12234
|
section: childSection,
|
|
@@ -12007,8 +12243,8 @@ var DataForm = (props) => {
|
|
|
12007
12243
|
}) })
|
|
12008
12244
|
}
|
|
12009
12245
|
),
|
|
12010
|
-
/* @__PURE__ */ (0,
|
|
12011
|
-
/* @__PURE__ */ (0,
|
|
12246
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "flex px-6 py-3 mt-2 mb-2 justify-end items-center gap-5", children: [
|
|
12247
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { children: props.additionalActions && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
12012
12248
|
Button_default,
|
|
12013
12249
|
{
|
|
12014
12250
|
ButtonType: "PrimaryHollow" /* Hollow */,
|
|
@@ -12016,7 +12252,7 @@ var DataForm = (props) => {
|
|
|
12016
12252
|
children: props.additionalActions.title
|
|
12017
12253
|
}
|
|
12018
12254
|
) }),
|
|
12019
|
-
/* @__PURE__ */ (0,
|
|
12255
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { children: props.onDelete && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
12020
12256
|
Button_default,
|
|
12021
12257
|
{
|
|
12022
12258
|
ButtonType: "PrimaryHollow" /* Hollow */,
|
|
@@ -12027,7 +12263,7 @@ var DataForm = (props) => {
|
|
|
12027
12263
|
children: "Delete"
|
|
12028
12264
|
}
|
|
12029
12265
|
) }),
|
|
12030
|
-
/* @__PURE__ */ (0,
|
|
12266
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { children: props.onClick && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
12031
12267
|
Button_default,
|
|
12032
12268
|
{
|
|
12033
12269
|
onValidate,
|
|
@@ -12045,7 +12281,7 @@ var DataForm_default = DataForm;
|
|
|
12045
12281
|
|
|
12046
12282
|
// src/components/dataForm/DataFormRenderer.tsx
|
|
12047
12283
|
init_ServiceClient();
|
|
12048
|
-
var
|
|
12284
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
12049
12285
|
function getAction(actions, code) {
|
|
12050
12286
|
return actions?.find((a) => a.actionCode === code);
|
|
12051
12287
|
}
|
|
@@ -12071,9 +12307,9 @@ var DataFormRenderer = ({
|
|
|
12071
12307
|
"Delete"
|
|
12072
12308
|
);
|
|
12073
12309
|
const hasDataItem = dataItem && Object.keys(dataItem).length > 0;
|
|
12074
|
-
return /* @__PURE__ */ (0,
|
|
12075
|
-
widgetProps && /* @__PURE__ */ (0,
|
|
12076
|
-
/* @__PURE__ */ (0,
|
|
12310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "flex-grow flex flex-col", children: [
|
|
12311
|
+
widgetProps && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(NavigationTabsV2_default, { tabs, params: widgetProps.params }),
|
|
12312
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
12077
12313
|
DataForm_default,
|
|
12078
12314
|
{
|
|
12079
12315
|
title: !isAddPage ? "Edit " + formDefinition.formTitle + "- v2" : "Add " + formDefinition.formTitle + "- v2",
|