@clyrex-digital/clyrex-controls-dev 0.8.1-dev.20260810100746 → 0.8.1-dev.20260824062326
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DataBindingControls-QZ7ES2AS.mjs +205 -0
- package/dist/DataBindingControls-XCAIDMDC.mjs +209 -0
- package/dist/{InputControlClient-XR37ZIQ2.mjs → InputControlClient-4M2BZXQO.mjs} +5 -3
- package/dist/InputControlClient-AORN4DRF.mjs +1921 -0
- package/dist/{LinkNodeButton-AOEDCCL7.mjs → LinkNodeButton-BEAX4I4C.mjs} +1 -1
- package/dist/LinkNodeButton-IT2CELKO.mjs +225 -0
- package/dist/{Pagination-YKNCYVXV.mjs → Pagination-GL6B4MNO.mjs} +5 -3
- package/dist/{Pagination-6OFACRMQ.mjs → Pagination-ZQO3EUKB.mjs} +27 -71
- package/dist/chunk-2R26M6CK.mjs +30 -0
- package/dist/{chunk-KL2YKXXS.mjs → chunk-4P4HO663.mjs} +30 -6
- package/dist/chunk-4R7F7LBL.mjs +36 -0
- package/dist/chunk-6PW2RLUJ.mjs +52 -0
- package/dist/chunk-E4VOFO5Q.mjs +39 -0
- package/dist/{chunk-YDPISYMP.mjs → chunk-GCG4OYDJ.mjs} +0 -34
- package/dist/{chunk-65QPOTZ4.mjs → chunk-GJOJX2O3.mjs} +1 -1
- package/dist/chunk-GKI42H4B.mjs +13 -0
- package/dist/{chunk-TVL6KVD5.mjs → chunk-Q46GMD3P.mjs} +31 -37
- package/dist/chunk-RHVNJMS4.mjs +251 -0
- package/dist/{chunk-WEV5U33G.mjs → chunk-TKDSRAM6.mjs} +36 -20
- package/dist/chunk-TQ6BXQ3A.mjs +24 -0
- package/dist/{chunk-3GWLDT7C.mjs → chunk-WXZMRMRS.mjs} +36 -20
- package/dist/index.d.mts +17 -6
- package/dist/index.d.ts +17 -6
- package/dist/index.js +600 -316
- package/dist/index.mjs +85 -59
- package/dist/server.d.mts +17 -6
- package/dist/server.d.ts +17 -6
- package/dist/server.js +2701 -301
- package/dist/server.mjs +70 -55
- package/package.json +1 -1
- package/dist/LinkNodeButton-KZRNRJRI.mjs +0 -467
package/dist/index.js
CHANGED
|
@@ -3432,6 +3432,19 @@ var init_InputControlClient = __esm({
|
|
|
3432
3432
|
}
|
|
3433
3433
|
});
|
|
3434
3434
|
|
|
3435
|
+
// src/components/controls/edit/InputControl.tsx
|
|
3436
|
+
var import_dynamic5, InputControl2, InputControl_default;
|
|
3437
|
+
var init_InputControl = __esm({
|
|
3438
|
+
"src/components/controls/edit/InputControl.tsx"() {
|
|
3439
|
+
"use strict";
|
|
3440
|
+
import_dynamic5 = __toESM(require("next/dynamic"));
|
|
3441
|
+
InputControl2 = (0, import_dynamic5.default)(() => Promise.resolve().then(() => (init_InputControlClient(), InputControlClient_exports)), {
|
|
3442
|
+
ssr: false
|
|
3443
|
+
});
|
|
3444
|
+
InputControl_default = InputControl2;
|
|
3445
|
+
}
|
|
3446
|
+
});
|
|
3447
|
+
|
|
3435
3448
|
// src/clients/CacheManage.tsx
|
|
3436
3449
|
var import_node_cache, CacheManager;
|
|
3437
3450
|
var init_CacheManage = __esm({
|
|
@@ -3468,7 +3481,7 @@ var init_CacheManage = __esm({
|
|
|
3468
3481
|
});
|
|
3469
3482
|
|
|
3470
3483
|
// src/clients/ServiceClient.tsx
|
|
3471
|
-
var ServerApiError, ServiceClient, ServiceClient_default;
|
|
3484
|
+
var ServerApiError, _ServiceClient, ServiceClient, ServiceClient_default;
|
|
3472
3485
|
var init_ServiceClient = __esm({
|
|
3473
3486
|
"src/clients/ServiceClient.tsx"() {
|
|
3474
3487
|
"use strict";
|
|
@@ -3481,7 +3494,7 @@ var init_ServiceClient = __esm({
|
|
|
3481
3494
|
this.data.isSuccessful = false;
|
|
3482
3495
|
}
|
|
3483
3496
|
};
|
|
3484
|
-
|
|
3497
|
+
_ServiceClient = class _ServiceClient {
|
|
3485
3498
|
constructor(apiBaseUrl, session) {
|
|
3486
3499
|
this.cacheManager = CacheManager.getInstance();
|
|
3487
3500
|
this.baseUrl = apiBaseUrl;
|
|
@@ -3524,28 +3537,42 @@ var init_ServiceClient = __esm({
|
|
|
3524
3537
|
if (cachedData) {
|
|
3525
3538
|
return cachedData;
|
|
3526
3539
|
}
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
const apiErrorData = await response.json();
|
|
3531
|
-
throw new ServerApiError(apiErrorData, response.status);
|
|
3532
|
-
}
|
|
3533
|
-
const cacheControl = response.headers.get("Cache-Control");
|
|
3534
|
-
let revalidate = null;
|
|
3535
|
-
if (cacheControl) {
|
|
3536
|
-
const maxAgeMatch = cacheControl.match(/max-age=(\d+)/);
|
|
3537
|
-
if (maxAgeMatch && maxAgeMatch[1]) {
|
|
3538
|
-
const maxAge = parseInt(maxAgeMatch[1], 10);
|
|
3539
|
-
revalidate = maxAge * 1e3;
|
|
3540
|
-
}
|
|
3540
|
+
const existingRequest = _ServiceClient.inFlightGetRequests.get(cacheKey);
|
|
3541
|
+
if (existingRequest) {
|
|
3542
|
+
return existingRequest;
|
|
3541
3543
|
}
|
|
3542
|
-
const
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3544
|
+
const request = (async () => {
|
|
3545
|
+
console.log("*****************CALLING API:", cacheKey, (/* @__PURE__ */ new Date()).toISOString());
|
|
3546
|
+
const response = await fetch(fullPath, { headers: config.headers });
|
|
3547
|
+
if (!response.ok) {
|
|
3548
|
+
const apiErrorData = await response.json();
|
|
3549
|
+
throw new ServerApiError(apiErrorData, response.status);
|
|
3550
|
+
}
|
|
3551
|
+
const cacheControl = response.headers.get("Cache-Control");
|
|
3552
|
+
let revalidate = null;
|
|
3553
|
+
if (cacheControl) {
|
|
3554
|
+
const maxAgeMatch = cacheControl.match(/max-age=(\d+)/);
|
|
3555
|
+
if (maxAgeMatch && maxAgeMatch[1]) {
|
|
3556
|
+
const maxAge = parseInt(maxAgeMatch[1], 10);
|
|
3557
|
+
revalidate = maxAge * 1e3;
|
|
3558
|
+
}
|
|
3559
|
+
}
|
|
3560
|
+
const data = await response.json();
|
|
3561
|
+
data.isSuccessful = true;
|
|
3562
|
+
if (revalidate !== null && revalidate > 0) {
|
|
3563
|
+
console.log("revalidate............I am caching:" + revalidate);
|
|
3564
|
+
this.cacheManager.set(cacheKey, data, revalidate);
|
|
3565
|
+
}
|
|
3566
|
+
return data;
|
|
3567
|
+
})();
|
|
3568
|
+
_ServiceClient.inFlightGetRequests.set(cacheKey, request);
|
|
3569
|
+
try {
|
|
3570
|
+
return await request;
|
|
3571
|
+
} finally {
|
|
3572
|
+
if (_ServiceClient.inFlightGetRequests.get(cacheKey) === request) {
|
|
3573
|
+
_ServiceClient.inFlightGetRequests.delete(cacheKey);
|
|
3574
|
+
}
|
|
3547
3575
|
}
|
|
3548
|
-
return data;
|
|
3549
3576
|
}
|
|
3550
3577
|
// private async refreshToken(): Promise<void> {
|
|
3551
3578
|
// console.log("*******************calling refresh token***********************");
|
|
@@ -3642,6 +3669,8 @@ var init_ServiceClient = __esm({
|
|
|
3642
3669
|
}
|
|
3643
3670
|
}
|
|
3644
3671
|
};
|
|
3672
|
+
_ServiceClient.inFlightGetRequests = /* @__PURE__ */ new Map();
|
|
3673
|
+
ServiceClient = _ServiceClient;
|
|
3645
3674
|
ServiceClient_default = ServiceClient;
|
|
3646
3675
|
}
|
|
3647
3676
|
});
|
|
@@ -4094,6 +4123,12 @@ var init_OdataBuilder = __esm({
|
|
|
4094
4123
|
if (key == "searchCols") {
|
|
4095
4124
|
this.searchCols = odata[key];
|
|
4096
4125
|
}
|
|
4126
|
+
if (key == "filter") {
|
|
4127
|
+
this.apiFilter = odata[key];
|
|
4128
|
+
}
|
|
4129
|
+
if (key == "orderBy") {
|
|
4130
|
+
this.apiOrderBy = odata[key];
|
|
4131
|
+
}
|
|
4097
4132
|
}
|
|
4098
4133
|
}
|
|
4099
4134
|
}
|
|
@@ -4120,6 +4155,12 @@ var init_OdataBuilder = __esm({
|
|
|
4120
4155
|
if (obj?.["searchCols"] && obj["searchCols"].trim() !== "") {
|
|
4121
4156
|
queryString += `&searchCols=${encodeURIComponent(obj["searchCols"])}`;
|
|
4122
4157
|
}
|
|
4158
|
+
if (obj?.["filter"] && obj["filter"].trim() !== "") {
|
|
4159
|
+
queryString += `&filter=${encodeURIComponent(obj["filter"])}`;
|
|
4160
|
+
}
|
|
4161
|
+
if (obj?.["orderBy"] && obj["orderBy"].trim() !== "") {
|
|
4162
|
+
queryString += `&orderBy=${encodeURIComponent(obj["orderBy"])}`;
|
|
4163
|
+
}
|
|
4123
4164
|
if (obj) {
|
|
4124
4165
|
if (obj["$filter"] && obj["$filter"] !== null && obj["$filter"] !== "") {
|
|
4125
4166
|
queryString = queryString + `&$filter=${encodeURIComponent(obj["$filter"])}`;
|
|
@@ -4167,6 +4208,18 @@ var init_OdataBuilder = __esm({
|
|
|
4167
4208
|
}
|
|
4168
4209
|
return pageNumber;
|
|
4169
4210
|
}
|
|
4211
|
+
appendApiQueryParameters(url) {
|
|
4212
|
+
if (this.searchTerm) {
|
|
4213
|
+
url += `&searchTerm=${encodeURIComponent(this.searchTerm)}`;
|
|
4214
|
+
}
|
|
4215
|
+
if (this.apiFilter) {
|
|
4216
|
+
url += `&filter=${encodeURIComponent(this.apiFilter)}`;
|
|
4217
|
+
}
|
|
4218
|
+
if (this.apiOrderBy) {
|
|
4219
|
+
url += `&orderBy=${encodeURIComponent(this.apiOrderBy)}`;
|
|
4220
|
+
}
|
|
4221
|
+
return url;
|
|
4222
|
+
}
|
|
4170
4223
|
getUrl() {
|
|
4171
4224
|
let url = `${this.baseUrl}?$skip=${this.skip}&$top=${this.top}&$count=true`;
|
|
4172
4225
|
if (this.filterBy !== null && this.filterBy !== "") {
|
|
@@ -4182,7 +4235,7 @@ var init_OdataBuilder = __esm({
|
|
|
4182
4235
|
url += `&searchCols=${encodeURIComponent(this.searchCols)}`;
|
|
4183
4236
|
}
|
|
4184
4237
|
console.log(url);
|
|
4185
|
-
return url;
|
|
4238
|
+
return this.appendApiQueryParameters(url);
|
|
4186
4239
|
}
|
|
4187
4240
|
getNewOrderByUrl(orderBy) {
|
|
4188
4241
|
let url = `${this.baseUrl}?$skip=${0}&$top=${this.top}&$count=true`;
|
|
@@ -4196,7 +4249,7 @@ var init_OdataBuilder = __esm({
|
|
|
4196
4249
|
url += `&searchCols=${encodeURIComponent(this.searchCols)}`;
|
|
4197
4250
|
}
|
|
4198
4251
|
url = url + `&$orderby=${encodeURIComponent(orderBy)}`;
|
|
4199
|
-
return url;
|
|
4252
|
+
return this.appendApiQueryParameters(url);
|
|
4200
4253
|
}
|
|
4201
4254
|
getNewFilterUrl(filterBy) {
|
|
4202
4255
|
let url = `${this.baseUrl}?$skip=${0}&$top=${this.top}&$count=true`;
|
|
@@ -4212,7 +4265,7 @@ var init_OdataBuilder = __esm({
|
|
|
4212
4265
|
if (this.searchCols) {
|
|
4213
4266
|
url += `&searchCols=${encodeURIComponent(this.searchCols)}`;
|
|
4214
4267
|
}
|
|
4215
|
-
return url;
|
|
4268
|
+
return this.appendApiQueryParameters(url);
|
|
4216
4269
|
}
|
|
4217
4270
|
getNewPageUrl(page) {
|
|
4218
4271
|
let skip = page * Constants.pagesize - Constants.pagesize;
|
|
@@ -4229,7 +4282,7 @@ var init_OdataBuilder = __esm({
|
|
|
4229
4282
|
if (this.searchCols) {
|
|
4230
4283
|
url += `&searchCols=${encodeURIComponent(this.searchCols)}`;
|
|
4231
4284
|
}
|
|
4232
|
-
return url;
|
|
4285
|
+
return this.appendApiQueryParameters(url);
|
|
4233
4286
|
}
|
|
4234
4287
|
getNewPageSizeUrl(pageSize) {
|
|
4235
4288
|
const currentPage = this.getPageNumber(
|
|
@@ -4243,7 +4296,7 @@ var init_OdataBuilder = __esm({
|
|
|
4243
4296
|
if (this.orderBy !== null && this.orderBy !== "") {
|
|
4244
4297
|
url = url + `&$orderby=${encodeURIComponent(this.orderBy)}`;
|
|
4245
4298
|
}
|
|
4246
|
-
return url;
|
|
4299
|
+
return this.appendApiQueryParameters(url);
|
|
4247
4300
|
}
|
|
4248
4301
|
getOrderBy() {
|
|
4249
4302
|
return this.orderBy;
|
|
@@ -4436,18 +4489,224 @@ var init_Pagination = __esm({
|
|
|
4436
4489
|
}
|
|
4437
4490
|
});
|
|
4438
4491
|
|
|
4492
|
+
// src/components/pageRenderingEngine/nodes/DataBindingControls.tsx
|
|
4493
|
+
var DataBindingControls_exports = {};
|
|
4494
|
+
__export(DataBindingControls_exports, {
|
|
4495
|
+
default: () => DataBindingControls_default
|
|
4496
|
+
});
|
|
4497
|
+
var import_react55, import_navigation, import_jsx_runtime77, humanize, escapeODataString, normalizeSortOption, DUMMY_FACETS, DUMMY_SORT_OPTIONS, DataBindingControls, DataBindingControls_default;
|
|
4498
|
+
var init_DataBindingControls = __esm({
|
|
4499
|
+
"src/components/pageRenderingEngine/nodes/DataBindingControls.tsx"() {
|
|
4500
|
+
"use strict";
|
|
4501
|
+
"use client";
|
|
4502
|
+
import_react55 = require("react");
|
|
4503
|
+
import_navigation = require("next/navigation");
|
|
4504
|
+
init_InputControl();
|
|
4505
|
+
init_InputControlType();
|
|
4506
|
+
import_jsx_runtime77 = require("react/jsx-runtime");
|
|
4507
|
+
humanize = (value) => value.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").trim();
|
|
4508
|
+
escapeODataString = (value) => value.replace(/'/g, "''");
|
|
4509
|
+
normalizeSortOption = (option) => {
|
|
4510
|
+
const direction = option.direction.trim();
|
|
4511
|
+
return {
|
|
4512
|
+
label: option.title || humanize(option.name),
|
|
4513
|
+
value: [option.name, direction].filter(Boolean).join(" ")
|
|
4514
|
+
};
|
|
4515
|
+
};
|
|
4516
|
+
DUMMY_FACETS = {
|
|
4517
|
+
CategoryTitle: [
|
|
4518
|
+
{ value: "Career Readiness", count: 2 },
|
|
4519
|
+
{ value: "Student Learning", count: 2 }
|
|
4520
|
+
],
|
|
4521
|
+
Author: [
|
|
4522
|
+
{ value: "John Smith", count: 2 },
|
|
4523
|
+
{ value: "Sarah Jones", count: 1 },
|
|
4524
|
+
{ value: "Emily Brown", count: 1 }
|
|
4525
|
+
]
|
|
4526
|
+
};
|
|
4527
|
+
DUMMY_SORT_OPTIONS = [
|
|
4528
|
+
{ name: "createdDate", title: "Newest First", direction: "desc" },
|
|
4529
|
+
{ name: "createdDate", title: "Oldest First", direction: "asc" },
|
|
4530
|
+
{ name: "title", title: "Title A-Z", direction: "asc" },
|
|
4531
|
+
{ name: "title", title: "Title Z-A", direction: "desc" }
|
|
4532
|
+
];
|
|
4533
|
+
DataBindingControls = ({
|
|
4534
|
+
path,
|
|
4535
|
+
query,
|
|
4536
|
+
facets,
|
|
4537
|
+
sortOptions,
|
|
4538
|
+
showFacets,
|
|
4539
|
+
showSortOptions,
|
|
4540
|
+
showSearchBar,
|
|
4541
|
+
mode = "toolbar"
|
|
4542
|
+
}) => {
|
|
4543
|
+
const router = (0, import_navigation.useRouter)();
|
|
4544
|
+
const apiFacetGroups = Object.entries(facets ?? {}).filter(
|
|
4545
|
+
([, values]) => Array.isArray(values) && values.length > 0
|
|
4546
|
+
);
|
|
4547
|
+
const facetGroups = apiFacetGroups.length > 0 ? apiFacetGroups : Object.entries(DUMMY_FACETS);
|
|
4548
|
+
const apiSortOptions = (sortOptions ?? []).filter(
|
|
4549
|
+
(option) => option?.name && option?.direction
|
|
4550
|
+
);
|
|
4551
|
+
const resolvedSortOptions = apiSortOptions.length > 0 ? apiSortOptions : DUMMY_SORT_OPTIONS;
|
|
4552
|
+
const normalizedSortOptions = resolvedSortOptions.map(normalizeSortOption).filter((option) => option.value);
|
|
4553
|
+
const currentFilter = query?.["$filter"] ?? query?.filter ?? "";
|
|
4554
|
+
const currentSort = query?.["$orderby"] ?? query?.orderBy ?? "";
|
|
4555
|
+
const currentSearch = query?.searchTerm ?? query?.searchText ?? "";
|
|
4556
|
+
const [searchText, setSearchText] = (0, import_react55.useState)(currentSearch);
|
|
4557
|
+
const lastNavigationUrl = (0, import_react55.useRef)(null);
|
|
4558
|
+
(0, import_react55.useEffect)(() => {
|
|
4559
|
+
setSearchText(currentSearch);
|
|
4560
|
+
}, [currentSearch]);
|
|
4561
|
+
const getQueryUrl = (0, import_react55.useCallback)(
|
|
4562
|
+
(updates) => {
|
|
4563
|
+
const params = new URLSearchParams(query ?? {});
|
|
4564
|
+
Object.entries(updates).forEach(([key, value]) => {
|
|
4565
|
+
if (value) {
|
|
4566
|
+
params.set(key, value);
|
|
4567
|
+
} else {
|
|
4568
|
+
params.delete(key);
|
|
4569
|
+
}
|
|
4570
|
+
});
|
|
4571
|
+
params.delete("$skip");
|
|
4572
|
+
params.delete("skip");
|
|
4573
|
+
const queryString = params.toString();
|
|
4574
|
+
return queryString ? `${path}?${queryString}` : path;
|
|
4575
|
+
},
|
|
4576
|
+
[path, query]
|
|
4577
|
+
);
|
|
4578
|
+
const getFacetUrl = (field, value) => getQueryUrl({
|
|
4579
|
+
$filter: value ? `${field} eq '${escapeODataString(value)}'` : void 0,
|
|
4580
|
+
filter: void 0
|
|
4581
|
+
});
|
|
4582
|
+
const navigateWithoutReload = (0, import_react55.useCallback)(
|
|
4583
|
+
(url) => {
|
|
4584
|
+
if (lastNavigationUrl.current === url) {
|
|
4585
|
+
return;
|
|
4586
|
+
}
|
|
4587
|
+
if (typeof window !== "undefined") {
|
|
4588
|
+
const targetUrl = new URL(url, window.location.origin);
|
|
4589
|
+
if (targetUrl.pathname === window.location.pathname && targetUrl.search === window.location.search) {
|
|
4590
|
+
return;
|
|
4591
|
+
}
|
|
4592
|
+
}
|
|
4593
|
+
lastNavigationUrl.current = url;
|
|
4594
|
+
router.push(url, { scroll: false });
|
|
4595
|
+
},
|
|
4596
|
+
[router]
|
|
4597
|
+
);
|
|
4598
|
+
(0, import_react55.useEffect)(() => {
|
|
4599
|
+
const trimmedSearchText = searchText.trim();
|
|
4600
|
+
if (trimmedSearchText === currentSearch.trim()) {
|
|
4601
|
+
return;
|
|
4602
|
+
}
|
|
4603
|
+
const timeout = window.setTimeout(() => {
|
|
4604
|
+
navigateWithoutReload(
|
|
4605
|
+
getQueryUrl({
|
|
4606
|
+
searchTerm: trimmedSearchText || void 0,
|
|
4607
|
+
searchText: void 0
|
|
4608
|
+
})
|
|
4609
|
+
);
|
|
4610
|
+
}, 500);
|
|
4611
|
+
return () => window.clearTimeout(timeout);
|
|
4612
|
+
}, [currentSearch, getQueryUrl, navigateWithoutReload, searchText]);
|
|
4613
|
+
const hasFacetControls = showFacets && facetGroups.length > 0;
|
|
4614
|
+
const hasSortControls = showSortOptions && normalizedSortOptions.length > 0;
|
|
4615
|
+
const shouldShowToolbar = mode === "toolbar" && (showSearchBar || hasSortControls);
|
|
4616
|
+
const shouldShowFacets = mode === "facets" && hasFacetControls;
|
|
4617
|
+
if (!shouldShowToolbar && !shouldShowFacets) {
|
|
4618
|
+
return null;
|
|
4619
|
+
}
|
|
4620
|
+
const renderFacetLinks = (field, values, stacked = false) => /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: stacked ? "flex flex-col gap-1" : "flex flex-wrap gap-2", children: [
|
|
4621
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4622
|
+
"button",
|
|
4623
|
+
{
|
|
4624
|
+
type: "button",
|
|
4625
|
+
onClick: () => navigateWithoutReload(getFacetUrl(field)),
|
|
4626
|
+
"aria-pressed": !currentFilter,
|
|
4627
|
+
className: `px-3 py-2 text-left text-sm ${stacked ? "w-full" : "border"} ${currentFilter ? "" : "bg-primary-base font-semibold"}`,
|
|
4628
|
+
children: "All"
|
|
4629
|
+
}
|
|
4630
|
+
),
|
|
4631
|
+
values.map((facet) => {
|
|
4632
|
+
const filter = `${field} eq '${escapeODataString(facet.value)}'`;
|
|
4633
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
4634
|
+
"button",
|
|
4635
|
+
{
|
|
4636
|
+
type: "button",
|
|
4637
|
+
onClick: () => navigateWithoutReload(getFacetUrl(field, facet.value)),
|
|
4638
|
+
"aria-pressed": currentFilter === filter,
|
|
4639
|
+
className: `px-3 py-2 text-left text-sm ${stacked ? "w-full" : "border"} ${currentFilter === filter ? "bg-primary-base font-semibold" : ""}`,
|
|
4640
|
+
children: [
|
|
4641
|
+
facet.value,
|
|
4642
|
+
" (",
|
|
4643
|
+
facet.count,
|
|
4644
|
+
")"
|
|
4645
|
+
]
|
|
4646
|
+
},
|
|
4647
|
+
`${field}-${facet.value}`
|
|
4648
|
+
);
|
|
4649
|
+
})
|
|
4650
|
+
] });
|
|
4651
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: mode === "toolbar" ? "mb-6" : "flex flex-col gap-2", children: [
|
|
4652
|
+
shouldShowToolbar && /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "flex flex-col gap-3 md:flex-row md:items-center md:justify-between", children: [
|
|
4653
|
+
showSearchBar && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "w-full max-w-xl", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4654
|
+
InputControl_default,
|
|
4655
|
+
{
|
|
4656
|
+
name: "searchText",
|
|
4657
|
+
controlType: InputControlType_default.lineTextInput,
|
|
4658
|
+
value: searchText,
|
|
4659
|
+
callback: (updatedValues) => setSearchText(updatedValues.value),
|
|
4660
|
+
attributes: { placeholder: "Search" },
|
|
4661
|
+
inputClasses: "!mt-0"
|
|
4662
|
+
}
|
|
4663
|
+
) }),
|
|
4664
|
+
hasSortControls && /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "flex items-center gap-2 text-sm", children: [
|
|
4665
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { className: "font-medium", children: "Sort by" }),
|
|
4666
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
4667
|
+
InputControl_default,
|
|
4668
|
+
{
|
|
4669
|
+
name: "sortOptions",
|
|
4670
|
+
controlType: InputControlType_default.select,
|
|
4671
|
+
value: currentSort,
|
|
4672
|
+
dataset: normalizedSortOptions,
|
|
4673
|
+
dataKeyFieldName: "value",
|
|
4674
|
+
dataTextFieldName: "label",
|
|
4675
|
+
callback: (updatedValues) => navigateWithoutReload(
|
|
4676
|
+
getQueryUrl({
|
|
4677
|
+
$orderby: updatedValues.value || void 0,
|
|
4678
|
+
orderBy: void 0
|
|
4679
|
+
})
|
|
4680
|
+
),
|
|
4681
|
+
attributes: { placeholder: "Default" },
|
|
4682
|
+
inputClasses: "!mt-0 min-w-44"
|
|
4683
|
+
}
|
|
4684
|
+
)
|
|
4685
|
+
] })
|
|
4686
|
+
] }),
|
|
4687
|
+
shouldShowFacets && facetGroups.length === 1 && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("nav", { "aria-label": `${humanize(facetGroups[0][0])} filters`, children: renderFacetLinks(facetGroups[0][0], facetGroups[0][1]) }),
|
|
4688
|
+
shouldShowFacets && facetGroups.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "flex flex-col gap-2", children: facetGroups.map(([field, values]) => /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("details", { className: "border-b", open: true, children: [
|
|
4689
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("summary", { className: "cursor-pointer font-semibold", children: humanize(field) }),
|
|
4690
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "p-2", children: renderFacetLinks(field, values, true) })
|
|
4691
|
+
] }, field)) })
|
|
4692
|
+
] });
|
|
4693
|
+
};
|
|
4694
|
+
DataBindingControls_default = DataBindingControls;
|
|
4695
|
+
}
|
|
4696
|
+
});
|
|
4697
|
+
|
|
4439
4698
|
// src/components/Slider.tsx
|
|
4440
4699
|
var Slider_exports = {};
|
|
4441
4700
|
__export(Slider_exports, {
|
|
4442
4701
|
default: () => Slider_default
|
|
4443
4702
|
});
|
|
4444
|
-
var
|
|
4703
|
+
var import_react56, import_jsx_runtime78, Slider, ArrowButton, ProgressPill, Slider_default;
|
|
4445
4704
|
var init_Slider = __esm({
|
|
4446
4705
|
"src/components/Slider.tsx"() {
|
|
4447
4706
|
"use strict";
|
|
4448
4707
|
"use client";
|
|
4449
|
-
|
|
4450
|
-
|
|
4708
|
+
import_react56 = __toESM(require("react"));
|
|
4709
|
+
import_jsx_runtime78 = require("react/jsx-runtime");
|
|
4451
4710
|
Slider = ({
|
|
4452
4711
|
children,
|
|
4453
4712
|
slidesToShow = 4,
|
|
@@ -4465,13 +4724,13 @@ var init_Slider = __esm({
|
|
|
4465
4724
|
pillStyle = "cumulative",
|
|
4466
4725
|
progressPosition = "bottom"
|
|
4467
4726
|
}) => {
|
|
4468
|
-
const [currentSlide, setCurrentSlide] = (0,
|
|
4469
|
-
const [transition, setTransition] = (0,
|
|
4470
|
-
const [slidesToShowState, setSlidesToShowState] = (0,
|
|
4727
|
+
const [currentSlide, setCurrentSlide] = (0, import_react56.useState)(0);
|
|
4728
|
+
const [transition, setTransition] = (0, import_react56.useState)(true);
|
|
4729
|
+
const [slidesToShowState, setSlidesToShowState] = (0, import_react56.useState)(
|
|
4471
4730
|
typeof slidesToShow === "number" ? slidesToShow : slidesToShow.large
|
|
4472
4731
|
);
|
|
4473
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
4474
|
-
(0,
|
|
4732
|
+
const [isPlaying, setIsPlaying] = (0, import_react56.useState)(autoplay);
|
|
4733
|
+
(0, import_react56.useEffect)(() => {
|
|
4475
4734
|
if (typeof slidesToShow === "number") return;
|
|
4476
4735
|
const handleResize = () => {
|
|
4477
4736
|
if (window.innerWidth >= 1024) {
|
|
@@ -4486,7 +4745,7 @@ var init_Slider = __esm({
|
|
|
4486
4745
|
window.addEventListener("resize", handleResize);
|
|
4487
4746
|
return () => window.removeEventListener("resize", handleResize);
|
|
4488
4747
|
}, [slidesToShow]);
|
|
4489
|
-
(0,
|
|
4748
|
+
(0, import_react56.useEffect)(() => {
|
|
4490
4749
|
if (!autoplay) return;
|
|
4491
4750
|
const timer = setInterval(() => {
|
|
4492
4751
|
if (isPlaying) {
|
|
@@ -4495,7 +4754,7 @@ var init_Slider = __esm({
|
|
|
4495
4754
|
}, autoplay_speed);
|
|
4496
4755
|
return () => clearInterval(timer);
|
|
4497
4756
|
}, [autoplay, autoplay_speed, currentSlide, isPlaying]);
|
|
4498
|
-
const totalSlides =
|
|
4757
|
+
const totalSlides = import_react56.Children.count(children);
|
|
4499
4758
|
const maxSlide = totalSlides - slidesToShowState;
|
|
4500
4759
|
const nextSlide = () => {
|
|
4501
4760
|
if (currentSlide >= maxSlide) {
|
|
@@ -4540,16 +4799,16 @@ var init_Slider = __esm({
|
|
|
4540
4799
|
}
|
|
4541
4800
|
};
|
|
4542
4801
|
const translateX = -currentSlide * (100 / slidesToShowState);
|
|
4543
|
-
const slides =
|
|
4544
|
-
if (!
|
|
4802
|
+
const slides = import_react56.Children.map(children, (child, index) => {
|
|
4803
|
+
if (!import_react56.default.isValidElement(child)) return null;
|
|
4545
4804
|
const childProps = child.props;
|
|
4546
4805
|
const mergedClassName = `${childProps.className ?? ""} w-full`.trim();
|
|
4547
|
-
return /* @__PURE__ */ (0,
|
|
4806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4548
4807
|
"div",
|
|
4549
4808
|
{
|
|
4550
4809
|
className: `flex-none ${scaleOnHover ? "group hover:z-50" : ""} relative`,
|
|
4551
4810
|
style: { width: `calc(${100 / slidesToShowState}%)`, paddingRight: gap },
|
|
4552
|
-
children: (0,
|
|
4811
|
+
children: (0, import_react56.cloneElement)(child, {
|
|
4553
4812
|
className: mergedClassName
|
|
4554
4813
|
})
|
|
4555
4814
|
},
|
|
@@ -4567,14 +4826,14 @@ var init_Slider = __esm({
|
|
|
4567
4826
|
return "bottom-4";
|
|
4568
4827
|
}
|
|
4569
4828
|
};
|
|
4570
|
-
return /* @__PURE__ */ (0,
|
|
4829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
4571
4830
|
"div",
|
|
4572
4831
|
{
|
|
4573
4832
|
className: `relative w-full overflow-hidden ${className}`,
|
|
4574
4833
|
onMouseEnter: handleMouseEnter,
|
|
4575
4834
|
onMouseLeave: handleMouseLeave,
|
|
4576
4835
|
children: [
|
|
4577
|
-
/* @__PURE__ */ (0,
|
|
4836
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4578
4837
|
"div",
|
|
4579
4838
|
{
|
|
4580
4839
|
className: "flex h-full",
|
|
@@ -4585,18 +4844,18 @@ var init_Slider = __esm({
|
|
|
4585
4844
|
children: slides
|
|
4586
4845
|
}
|
|
4587
4846
|
),
|
|
4588
|
-
show_arrows && /* @__PURE__ */ (0,
|
|
4589
|
-
/* @__PURE__ */ (0,
|
|
4847
|
+
show_arrows && /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
4848
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4590
4849
|
ArrowButton,
|
|
4591
4850
|
{
|
|
4592
4851
|
direction: "left",
|
|
4593
4852
|
onClick: prevSlide,
|
|
4594
4853
|
visible: infinite_scroll || currentSlide > 0,
|
|
4595
4854
|
className: arrowClassName,
|
|
4596
|
-
children: /* @__PURE__ */ (0,
|
|
4855
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.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_runtime78.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 19.5 8.25 12l7.5-7.5" }) })
|
|
4597
4856
|
}
|
|
4598
4857
|
),
|
|
4599
|
-
/* @__PURE__ */ (0,
|
|
4858
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
4600
4859
|
ArrowButton,
|
|
4601
4860
|
{
|
|
4602
4861
|
direction: "right",
|
|
@@ -4604,13 +4863,13 @@ var init_Slider = __esm({
|
|
|
4604
4863
|
visible: infinite_scroll || currentSlide < maxSlide,
|
|
4605
4864
|
className: arrowClassName,
|
|
4606
4865
|
children: [
|
|
4607
|
-
/* @__PURE__ */ (0,
|
|
4866
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.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_runtime78.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "m8.25 4.5 7.5 7.5-7.5 7.5" }) }),
|
|
4608
4867
|
" "
|
|
4609
4868
|
]
|
|
4610
4869
|
}
|
|
4611
4870
|
)
|
|
4612
4871
|
] }),
|
|
4613
|
-
show_dots && /* @__PURE__ */ (0,
|
|
4872
|
+
show_dots && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: `absolute left-1/2 -translate-x-1/2 flex justify-center space-x-1.5 ${getProgressPositionClass()}`, children: Array.from({ length: totalSlides }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4614
4873
|
ProgressPill,
|
|
4615
4874
|
{
|
|
4616
4875
|
active: index === currentSlide,
|
|
@@ -4636,7 +4895,7 @@ var init_Slider = __esm({
|
|
|
4636
4895
|
visible,
|
|
4637
4896
|
children,
|
|
4638
4897
|
className = ""
|
|
4639
|
-
}) => /* @__PURE__ */ (0,
|
|
4898
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4640
4899
|
"button",
|
|
4641
4900
|
{
|
|
4642
4901
|
className: `
|
|
@@ -4662,13 +4921,13 @@ var init_Slider = __esm({
|
|
|
4662
4921
|
currentSlide,
|
|
4663
4922
|
totalSlides
|
|
4664
4923
|
}) => {
|
|
4665
|
-
const [progress, setProgress] = (0,
|
|
4666
|
-
(0,
|
|
4924
|
+
const [progress, setProgress] = (0, import_react56.useState)(0);
|
|
4925
|
+
(0, import_react56.useEffect)(() => {
|
|
4667
4926
|
if (active) {
|
|
4668
4927
|
setProgress(0);
|
|
4669
4928
|
}
|
|
4670
4929
|
}, [active, index]);
|
|
4671
|
-
(0,
|
|
4930
|
+
(0, import_react56.useEffect)(() => {
|
|
4672
4931
|
if (!active || !isPlaying) {
|
|
4673
4932
|
if (!active) {
|
|
4674
4933
|
setProgress(0);
|
|
@@ -4723,7 +4982,7 @@ var init_Slider = __esm({
|
|
|
4723
4982
|
const renderProgressBar = () => {
|
|
4724
4983
|
if (style === "modern" && isActive || style === "cumulative" && shouldShowProgress) {
|
|
4725
4984
|
const displayProgress = style === "cumulative" && isFilled ? 100 : progress;
|
|
4726
|
-
return /* @__PURE__ */ (0,
|
|
4985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4727
4986
|
"div",
|
|
4728
4987
|
{
|
|
4729
4988
|
className: `absolute top-0 left-0 h-full rounded-full ${style === "cumulative" && isFilled ? activeClassName || "bg-white" : activeClassName || "bg-white"} transition-all duration-50 ease-linear`,
|
|
@@ -4735,7 +4994,7 @@ var init_Slider = __esm({
|
|
|
4735
4994
|
};
|
|
4736
4995
|
const renderCumulativeFill = () => {
|
|
4737
4996
|
if (style === "cumulative" && isFilled && !isActive) {
|
|
4738
|
-
return /* @__PURE__ */ (0,
|
|
4997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
4739
4998
|
"div",
|
|
4740
4999
|
{
|
|
4741
5000
|
className: `absolute top-0 left-0 h-full rounded-full ${activeClassName || "bg-white"} transition-all duration-300`,
|
|
@@ -4745,7 +5004,7 @@ var init_Slider = __esm({
|
|
|
4745
5004
|
}
|
|
4746
5005
|
return null;
|
|
4747
5006
|
};
|
|
4748
|
-
return /* @__PURE__ */ (0,
|
|
5007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
4749
5008
|
"button",
|
|
4750
5009
|
{
|
|
4751
5010
|
className: `${baseClasses} ${getStyleClasses()}`,
|
|
@@ -4852,12 +5111,6 @@ var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
|
4852
5111
|
var BooleanView = (props) => {
|
|
4853
5112
|
const { value, customProps } = props;
|
|
4854
5113
|
const showOnlyTrueIcon = customProps?.showOnlyTrueIcon;
|
|
4855
|
-
console.log("BooleanView Debug:", {
|
|
4856
|
-
value,
|
|
4857
|
-
type: typeof value,
|
|
4858
|
-
customProps,
|
|
4859
|
-
showOnlyTrueIcon
|
|
4860
|
-
});
|
|
4861
5114
|
const booleanValue = (() => {
|
|
4862
5115
|
if (typeof value === "boolean") return value;
|
|
4863
5116
|
if (typeof value === "string") {
|
|
@@ -4977,7 +5230,6 @@ var MediaAsset = (props) => {
|
|
|
4977
5230
|
if (props.value != void 0 && props.value != null && props.value != "") {
|
|
4978
5231
|
try {
|
|
4979
5232
|
assets = JSON.parse(props.value);
|
|
4980
|
-
console.log("Parsed Assets: ", assets);
|
|
4981
5233
|
} catch (error) {
|
|
4982
5234
|
console.error("Error parsing assets:", error);
|
|
4983
5235
|
}
|
|
@@ -5178,18 +5430,12 @@ var ViewControl = (props) => {
|
|
|
5178
5430
|
};
|
|
5179
5431
|
var ViewControl_default = ViewControl;
|
|
5180
5432
|
|
|
5181
|
-
// src/components/controls/edit/InputControl.tsx
|
|
5182
|
-
var import_dynamic5 = __toESM(require("next/dynamic"));
|
|
5183
|
-
var InputControl2 = (0, import_dynamic5.default)(() => Promise.resolve().then(() => (init_InputControlClient(), InputControlClient_exports)), {
|
|
5184
|
-
ssr: false
|
|
5185
|
-
});
|
|
5186
|
-
var InputControl_default = InputControl2;
|
|
5187
|
-
|
|
5188
5433
|
// src/index.ts
|
|
5434
|
+
init_InputControl();
|
|
5189
5435
|
init_InputControlType();
|
|
5190
5436
|
|
|
5191
5437
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
5192
|
-
var
|
|
5438
|
+
var import_react58 = __toESM(require("react"));
|
|
5193
5439
|
|
|
5194
5440
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
5195
5441
|
var import_react44 = __toESM(require("react"));
|
|
@@ -5963,7 +6209,7 @@ var WidgetNode_default = WidgetNode;
|
|
|
5963
6209
|
|
|
5964
6210
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
5965
6211
|
var import_dynamic12 = __toESM(require("next/dynamic"));
|
|
5966
|
-
var
|
|
6212
|
+
var import_react57 = __toESM(require("react"));
|
|
5967
6213
|
|
|
5968
6214
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
5969
6215
|
var import_dynamic9 = __toESM(require("next/dynamic"));
|
|
@@ -6926,7 +7172,6 @@ var getFileDetails = (url) => {
|
|
|
6926
7172
|
var DocumentNode = (props) => {
|
|
6927
7173
|
console.log("DocumentNode rendered");
|
|
6928
7174
|
console.log("props", props);
|
|
6929
|
-
console.log("dataitem", props.dataitem);
|
|
6930
7175
|
console.log("node", props.node);
|
|
6931
7176
|
let documents = [];
|
|
6932
7177
|
if (props.dataitem && props.node.documentKey) {
|
|
@@ -7079,8 +7324,11 @@ var GoogleMapNode = (props) => {
|
|
|
7079
7324
|
var GoogleMapNode_default = GoogleMapNode;
|
|
7080
7325
|
|
|
7081
7326
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
7082
|
-
var
|
|
7327
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
7083
7328
|
var Pagination2 = (0, import_dynamic12.default)(() => Promise.resolve().then(() => (init_Pagination(), Pagination_exports)), { ssr: true });
|
|
7329
|
+
var DataBindingControls2 = (0, import_dynamic12.default)(() => Promise.resolve().then(() => (init_DataBindingControls(), DataBindingControls_exports)), {
|
|
7330
|
+
ssr: true
|
|
7331
|
+
});
|
|
7084
7332
|
var Slider2 = (0, import_dynamic12.default)(() => Promise.resolve().then(() => (init_Slider(), Slider_exports)), {
|
|
7085
7333
|
ssr: false
|
|
7086
7334
|
});
|
|
@@ -7335,7 +7583,7 @@ var DivContainer = async (props) => {
|
|
|
7335
7583
|
response = await serviceClient.get(endpoint);
|
|
7336
7584
|
result = response?.result;
|
|
7337
7585
|
if (dataBindingProperties.showNoResultsMessage && (result === void 0 || result.length == 0)) {
|
|
7338
|
-
return /* @__PURE__ */ (0,
|
|
7586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(NoDataFound_default, {});
|
|
7339
7587
|
}
|
|
7340
7588
|
if (dataBindingProperties.childCollectionName && props.dataitem) {
|
|
7341
7589
|
childCollectionData = getNestedValue6(
|
|
@@ -7355,7 +7603,7 @@ var DivContainer = async (props) => {
|
|
|
7355
7603
|
}
|
|
7356
7604
|
const SelectedNode = NodeTypes2[node.type];
|
|
7357
7605
|
if (!SelectedNode) return null;
|
|
7358
|
-
return /* @__PURE__ */ (0,
|
|
7606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_react57.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7359
7607
|
SelectedNode,
|
|
7360
7608
|
{
|
|
7361
7609
|
node,
|
|
@@ -7488,45 +7736,80 @@ var DivContainer = async (props) => {
|
|
|
7488
7736
|
noLinkColor && "no-link-color",
|
|
7489
7737
|
!!props.node.enterAnimation && "enter-animation"
|
|
7490
7738
|
].filter(Boolean).join(" ");
|
|
7491
|
-
return /* @__PURE__ */ (0,
|
|
7492
|
-
/* @__PURE__ */ (0,
|
|
7739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_react57.default.Fragment, { children: [
|
|
7740
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7493
7741
|
"style",
|
|
7494
7742
|
{
|
|
7495
7743
|
dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS }
|
|
7496
7744
|
}
|
|
7497
7745
|
),
|
|
7498
|
-
/* @__PURE__ */ (0,
|
|
7499
|
-
|
|
7746
|
+
dataBindingProperties && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7747
|
+
DataBindingControls2,
|
|
7500
7748
|
{
|
|
7501
|
-
|
|
7502
|
-
|
|
7503
|
-
|
|
7504
|
-
|
|
7505
|
-
|
|
7506
|
-
|
|
7507
|
-
|
|
7508
|
-
props,
|
|
7509
|
-
item,
|
|
7510
|
-
idx,
|
|
7511
|
-
props.href ? void 0 : item?.links?.view
|
|
7512
|
-
)?.map((child, i) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react56.default.Fragment, { children: child }, i)) : renderChildren(props.node.children, props, item, idx)
|
|
7513
|
-
)
|
|
7749
|
+
mode: "toolbar",
|
|
7750
|
+
path: props.path,
|
|
7751
|
+
query: props.query,
|
|
7752
|
+
facets: response?.facets,
|
|
7753
|
+
sortOptions: response?.sortOptions,
|
|
7754
|
+
showSortOptions: dataBindingProperties.showSortOptions,
|
|
7755
|
+
showSearchBar: dataBindingProperties.showSearchBar
|
|
7514
7756
|
}
|
|
7515
7757
|
),
|
|
7516
|
-
|
|
7517
|
-
|
|
7758
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
7759
|
+
"div",
|
|
7518
7760
|
{
|
|
7519
|
-
|
|
7520
|
-
|
|
7521
|
-
|
|
7761
|
+
className: dataBindingProperties?.showFacets ? "grid items-start gap-6 lg:grid-cols-[minmax(0,1fr)_18rem]" : void 0,
|
|
7762
|
+
children: [
|
|
7763
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "min-w-0", children: [
|
|
7764
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7765
|
+
Wrapper,
|
|
7766
|
+
{
|
|
7767
|
+
id: guid,
|
|
7768
|
+
style: combinedStyles,
|
|
7769
|
+
className: classNames || void 0,
|
|
7770
|
+
...wrapperProps,
|
|
7771
|
+
children: dataToRender.map(
|
|
7772
|
+
(item, idx) => item?.links?.view && renderLink ? renderChildren(
|
|
7773
|
+
props.node.children,
|
|
7774
|
+
props,
|
|
7775
|
+
item,
|
|
7776
|
+
idx,
|
|
7777
|
+
props.href ? void 0 : item?.links?.view
|
|
7778
|
+
)?.map((child, i) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_react57.default.Fragment, { children: child }, i)) : renderChildren(props.node.children, props, item, idx)
|
|
7779
|
+
)
|
|
7780
|
+
}
|
|
7781
|
+
),
|
|
7782
|
+
dataBindingProperties && props.node.dataBinding.enablePagination && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7783
|
+
Pagination2,
|
|
7784
|
+
{
|
|
7785
|
+
path: props.path,
|
|
7786
|
+
query: props.query,
|
|
7787
|
+
dataset: response
|
|
7788
|
+
}
|
|
7789
|
+
)
|
|
7790
|
+
] }),
|
|
7791
|
+
dataBindingProperties?.showFacets && /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("aside", { className: "border bg-default p-3 lg:sticky lg:top-[90px] lg:self-start", children: [
|
|
7792
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("h2", { className: "mb-2 text-lg font-semibold", children: "Filters" }),
|
|
7793
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7794
|
+
DataBindingControls2,
|
|
7795
|
+
{
|
|
7796
|
+
mode: "facets",
|
|
7797
|
+
path: props.path,
|
|
7798
|
+
query: props.query,
|
|
7799
|
+
facets: response?.facets,
|
|
7800
|
+
showFacets: dataBindingProperties.showFacets
|
|
7801
|
+
}
|
|
7802
|
+
)
|
|
7803
|
+
] })
|
|
7804
|
+
]
|
|
7522
7805
|
}
|
|
7523
|
-
)
|
|
7806
|
+
)
|
|
7524
7807
|
] });
|
|
7525
7808
|
};
|
|
7526
7809
|
var DivContainer_default = DivContainer;
|
|
7527
7810
|
|
|
7528
7811
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
7529
|
-
var
|
|
7812
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
7530
7813
|
var NodeTypes = {
|
|
7531
7814
|
["paragraph"]: ParagraphNode_default,
|
|
7532
7815
|
["heading"]: HeadingNode_default,
|
|
@@ -7564,14 +7847,14 @@ var PageBodyRenderer = (props) => {
|
|
|
7564
7847
|
}
|
|
7565
7848
|
return true;
|
|
7566
7849
|
};
|
|
7567
|
-
return /* @__PURE__ */ (0,
|
|
7850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_react58.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
7568
7851
|
{
|
|
7569
7852
|
}
|
|
7570
7853
|
const SelectedNode = NodeTypes[node.type];
|
|
7571
7854
|
if (!shouldRenderNode(node)) {
|
|
7572
7855
|
return null;
|
|
7573
7856
|
}
|
|
7574
|
-
return /* @__PURE__ */ (0,
|
|
7857
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_react58.default.Fragment, { children: SelectedNode && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_react58.default.Fragment, { children: node.type == "layout-container" ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_react58.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7575
7858
|
SelectedNode,
|
|
7576
7859
|
{
|
|
7577
7860
|
node,
|
|
@@ -7587,7 +7870,7 @@ var PageBodyRenderer = (props) => {
|
|
|
7587
7870
|
device: props.device,
|
|
7588
7871
|
widgetRenderer: props.widgetRenderer
|
|
7589
7872
|
}
|
|
7590
|
-
) }) : /* @__PURE__ */ (0,
|
|
7873
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_react58.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7591
7874
|
SelectedNode,
|
|
7592
7875
|
{
|
|
7593
7876
|
node,
|
|
@@ -7608,10 +7891,10 @@ var PageBodyRenderer = (props) => {
|
|
|
7608
7891
|
var PageBodyRenderer_default = PageBodyRenderer;
|
|
7609
7892
|
|
|
7610
7893
|
// src/components/pageRenderingEngine/EnterAnimationHydrator.tsx
|
|
7611
|
-
var
|
|
7894
|
+
var import_react59 = require("react");
|
|
7612
7895
|
var ENTER_ANIMATION_SELECTOR = ".enter-animation";
|
|
7613
7896
|
function EnterAnimationHydrator() {
|
|
7614
|
-
(0,
|
|
7897
|
+
(0, import_react59.useEffect)(() => {
|
|
7615
7898
|
let observer;
|
|
7616
7899
|
const observedElements = /* @__PURE__ */ new WeakSet();
|
|
7617
7900
|
const revealAnimatedElements = () => {
|
|
@@ -7656,22 +7939,22 @@ function EnterAnimationHydrator() {
|
|
|
7656
7939
|
}
|
|
7657
7940
|
|
|
7658
7941
|
// src/components/Toast.tsx
|
|
7659
|
-
var
|
|
7942
|
+
var import_react60 = require("react");
|
|
7660
7943
|
init_ToastService();
|
|
7661
|
-
var
|
|
7944
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
7662
7945
|
var Toast = () => {
|
|
7663
|
-
const [showToast, setShowToast] = (0,
|
|
7664
|
-
const [message, setMessage] = (0,
|
|
7665
|
-
const [messageType, setMessageType] = (0,
|
|
7666
|
-
const timeoutRef = (0,
|
|
7667
|
-
const closeToast = (0,
|
|
7946
|
+
const [showToast, setShowToast] = (0, import_react60.useState)(false);
|
|
7947
|
+
const [message, setMessage] = (0, import_react60.useState)("");
|
|
7948
|
+
const [messageType, setMessageType] = (0, import_react60.useState)("error");
|
|
7949
|
+
const timeoutRef = (0, import_react60.useRef)(null);
|
|
7950
|
+
const closeToast = (0, import_react60.useCallback)(() => {
|
|
7668
7951
|
if (timeoutRef.current) {
|
|
7669
7952
|
clearTimeout(timeoutRef.current);
|
|
7670
7953
|
timeoutRef.current = null;
|
|
7671
7954
|
}
|
|
7672
7955
|
setShowToast(false);
|
|
7673
7956
|
}, []);
|
|
7674
|
-
const showMessage = (0,
|
|
7957
|
+
const showMessage = (0, import_react60.useCallback)((message2, messageType2) => {
|
|
7675
7958
|
if (timeoutRef.current) {
|
|
7676
7959
|
clearTimeout(timeoutRef.current);
|
|
7677
7960
|
}
|
|
@@ -7683,7 +7966,7 @@ var Toast = () => {
|
|
|
7683
7966
|
timeoutRef.current = null;
|
|
7684
7967
|
}, 4e3);
|
|
7685
7968
|
}, []);
|
|
7686
|
-
(0,
|
|
7969
|
+
(0, import_react60.useEffect)(() => {
|
|
7687
7970
|
ToastService_default.initialize(showMessage, closeToast);
|
|
7688
7971
|
return () => {
|
|
7689
7972
|
closeToast();
|
|
@@ -7692,8 +7975,8 @@ var Toast = () => {
|
|
|
7692
7975
|
});
|
|
7693
7976
|
};
|
|
7694
7977
|
}, [closeToast, showMessage]);
|
|
7695
|
-
return /* @__PURE__ */ (0,
|
|
7696
|
-
/* @__PURE__ */ (0,
|
|
7978
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_jsx_runtime81.Fragment, { children: showToast && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "fixed top-2 flex justify-center w-1/2 max-w-xl left-1/2 -translate-x-1/2", style: { zIndex: 1e3 }, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: `w-full items-center flex justify-between p-3 rounded-md relative shadow border bg-${messageType}-soft`, children: [
|
|
7979
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
7697
7980
|
"span",
|
|
7698
7981
|
{
|
|
7699
7982
|
className: "font-medium text-inherit text-sm",
|
|
@@ -7701,7 +7984,7 @@ var Toast = () => {
|
|
|
7701
7984
|
children: message
|
|
7702
7985
|
}
|
|
7703
7986
|
),
|
|
7704
|
-
/* @__PURE__ */ (0,
|
|
7987
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("button", { className: "absolute right-2 top-2 ml-2 focus:outline-none", onClick: closeToast, children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
7705
7988
|
"svg",
|
|
7706
7989
|
{
|
|
7707
7990
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7709,7 +7992,7 @@ var Toast = () => {
|
|
|
7709
7992
|
fill: "none",
|
|
7710
7993
|
viewBox: "0 0 24 24",
|
|
7711
7994
|
stroke: "currentColor",
|
|
7712
|
-
children: /* @__PURE__ */ (0,
|
|
7995
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M6 18L18 6M6 6l12 12" })
|
|
7713
7996
|
}
|
|
7714
7997
|
) })
|
|
7715
7998
|
] }) }) });
|
|
@@ -7739,8 +8022,8 @@ init_Switcher();
|
|
|
7739
8022
|
|
|
7740
8023
|
// src/components/NavigationTabsV2.tsx
|
|
7741
8024
|
var import_link3 = __toESM(require("next/link"));
|
|
7742
|
-
var
|
|
7743
|
-
var
|
|
8025
|
+
var import_navigation2 = require("next/navigation");
|
|
8026
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
7744
8027
|
function resolveRoutePlaceholders(route, params) {
|
|
7745
8028
|
return route.replace(/\{([^}]+)\}/g, (match, key) => {
|
|
7746
8029
|
const value = params[key];
|
|
@@ -7752,7 +8035,7 @@ function resolveRoutePlaceholders(route, params) {
|
|
|
7752
8035
|
});
|
|
7753
8036
|
}
|
|
7754
8037
|
var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
7755
|
-
const pathname = (0,
|
|
8038
|
+
const pathname = (0, import_navigation2.usePathname)();
|
|
7756
8039
|
const shouldHideTabs = pathname?.includes("/add");
|
|
7757
8040
|
if (shouldHideTabs) return null;
|
|
7758
8041
|
const mappedTabs = tabs?.sort((a, b) => a.displayOrder - b.displayOrder)?.map((tab) => ({
|
|
@@ -7765,8 +8048,8 @@ var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
|
7765
8048
|
isActive: tab.isActive
|
|
7766
8049
|
})) || [];
|
|
7767
8050
|
if (mappedTabs.length === 0) return null;
|
|
7768
|
-
return /* @__PURE__ */ (0,
|
|
7769
|
-
return /* @__PURE__ */ (0,
|
|
8051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "flex border-b bg-white rounded-t mb-3", children: mappedTabs.map(({ tabTitle, landingPageUrl, isActive }) => {
|
|
8052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_link3.default, { href: landingPageUrl, className: "-mb-px", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
7770
8053
|
"div",
|
|
7771
8054
|
{
|
|
7772
8055
|
className: `text-sm font-medium border-b-2 px-6 py-2 transition
|
|
@@ -7779,14 +8062,15 @@ var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
|
7779
8062
|
var NavigationTabsV2_default = NavigationTabsV2;
|
|
7780
8063
|
|
|
7781
8064
|
// src/components/dataForm/DataList.tsx
|
|
7782
|
-
var
|
|
7783
|
-
|
|
8065
|
+
var import_react63 = __toESM(require("react"));
|
|
8066
|
+
init_InputControl();
|
|
8067
|
+
var import_navigation3 = require("next/navigation");
|
|
7784
8068
|
|
|
7785
8069
|
// src/components/dataForm/NoContentView.tsx
|
|
7786
|
-
var
|
|
7787
|
-
var
|
|
8070
|
+
var import_react61 = __toESM(require("react"));
|
|
8071
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
7788
8072
|
var NoContentView = (props) => {
|
|
7789
|
-
return /* @__PURE__ */ (0,
|
|
8073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_react61.default.Fragment, { children: props.isDataFound === false && props.children });
|
|
7790
8074
|
};
|
|
7791
8075
|
var NoContentView_default = NoContentView;
|
|
7792
8076
|
|
|
@@ -7794,39 +8078,39 @@ var NoContentView_default = NoContentView;
|
|
|
7794
8078
|
init_InputControlType();
|
|
7795
8079
|
|
|
7796
8080
|
// src/components/dataForm/ContentView.tsx
|
|
7797
|
-
var
|
|
7798
|
-
var
|
|
8081
|
+
var import_react62 = __toESM(require("react"));
|
|
8082
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
7799
8083
|
var ContentView = (props) => {
|
|
7800
|
-
return /* @__PURE__ */ (0,
|
|
7801
|
-
props.isDataFound == null && /* @__PURE__ */ (0,
|
|
7802
|
-
/* @__PURE__ */ (0,
|
|
7803
|
-
/* @__PURE__ */ (0,
|
|
7804
|
-
/* @__PURE__ */ (0,
|
|
7805
|
-
/* @__PURE__ */ (0,
|
|
7806
|
-
/* @__PURE__ */ (0,
|
|
8084
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(import_react62.default.Fragment, { children: [
|
|
8085
|
+
props.isDataFound == null && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
8086
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
8087
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
8088
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "ml-2", children: [
|
|
8089
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
|
|
8090
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
|
|
7807
8091
|
] })
|
|
7808
8092
|
] }),
|
|
7809
|
-
/* @__PURE__ */ (0,
|
|
7810
|
-
/* @__PURE__ */ (0,
|
|
7811
|
-
/* @__PURE__ */ (0,
|
|
7812
|
-
/* @__PURE__ */ (0,
|
|
7813
|
-
/* @__PURE__ */ (0,
|
|
7814
|
-
/* @__PURE__ */ (0,
|
|
7815
|
-
/* @__PURE__ */ (0,
|
|
8093
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
|
|
8094
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "animate-pulse", children: [
|
|
8095
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
8096
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
8097
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
8098
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
8099
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
7816
8100
|
] }),
|
|
7817
|
-
/* @__PURE__ */ (0,
|
|
7818
|
-
/* @__PURE__ */ (0,
|
|
7819
|
-
/* @__PURE__ */ (0,
|
|
7820
|
-
/* @__PURE__ */ (0,
|
|
7821
|
-
/* @__PURE__ */ (0,
|
|
7822
|
-
/* @__PURE__ */ (0,
|
|
8101
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "animate-pulse", children: [
|
|
8102
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
8103
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
8104
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
8105
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
8106
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
7823
8107
|
] }),
|
|
7824
|
-
/* @__PURE__ */ (0,
|
|
7825
|
-
/* @__PURE__ */ (0,
|
|
7826
|
-
/* @__PURE__ */ (0,
|
|
7827
|
-
/* @__PURE__ */ (0,
|
|
7828
|
-
/* @__PURE__ */ (0,
|
|
7829
|
-
/* @__PURE__ */ (0,
|
|
8108
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "animate-pulse", children: [
|
|
8109
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
8110
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
8111
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
8112
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
8113
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
7830
8114
|
] })
|
|
7831
8115
|
] })
|
|
7832
8116
|
] }) }),
|
|
@@ -7886,17 +8170,17 @@ function FormReducer(state, action) {
|
|
|
7886
8170
|
var FormReducer_default = FormReducer;
|
|
7887
8171
|
|
|
7888
8172
|
// src/components/dataForm/DataList.tsx
|
|
7889
|
-
var
|
|
8173
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
7890
8174
|
var DataList = (props) => {
|
|
7891
|
-
const router = (0,
|
|
8175
|
+
const router = (0, import_navigation3.useRouter)();
|
|
7892
8176
|
let builder = new OdataBuilder(props.path);
|
|
7893
8177
|
let orderBy = "";
|
|
7894
8178
|
let activePageNumber = 0;
|
|
7895
8179
|
let pages = 0;
|
|
7896
8180
|
console.log(props.addLinkText);
|
|
7897
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
7898
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
7899
|
-
(0,
|
|
8181
|
+
const [isDataFound, setIsDataFound] = (0, import_react63.useState)(null);
|
|
8182
|
+
const [searchTerm, setSearchTerm] = (0, import_react63.useState)(props.query?.searchTerm ?? "");
|
|
8183
|
+
(0, import_react63.useEffect)(() => {
|
|
7900
8184
|
if (props?.dataset) {
|
|
7901
8185
|
if (props?.dataset.result && props.dataset.result.length > 0) {
|
|
7902
8186
|
setIsDataFound(true);
|
|
@@ -7905,7 +8189,7 @@ var DataList = (props) => {
|
|
|
7905
8189
|
}
|
|
7906
8190
|
}
|
|
7907
8191
|
}, [props.dataset]);
|
|
7908
|
-
(0,
|
|
8192
|
+
(0, import_react63.useEffect)(() => {
|
|
7909
8193
|
if (!props.query?.["$filter"] || !props.filters) return;
|
|
7910
8194
|
const filterQuery = props.query["$filter"];
|
|
7911
8195
|
props.filters.forEach((filter) => {
|
|
@@ -7924,7 +8208,7 @@ var DataList = (props) => {
|
|
|
7924
8208
|
if (path.includes(".")) {
|
|
7925
8209
|
return path.split(".").reduce((prev, curr) => prev ? prev[curr] : null, obj);
|
|
7926
8210
|
} else if (Array.isArray(obj[path])) {
|
|
7927
|
-
return obj[path].map((item, index) => /* @__PURE__ */ (0,
|
|
8211
|
+
return obj[path].map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { children: item }, index));
|
|
7928
8212
|
} else {
|
|
7929
8213
|
return obj[path];
|
|
7930
8214
|
}
|
|
@@ -7933,11 +8217,11 @@ var DataList = (props) => {
|
|
|
7933
8217
|
inputValues: {},
|
|
7934
8218
|
lastPropertyChanged: ""
|
|
7935
8219
|
};
|
|
7936
|
-
const [formState, dispatch] = (0,
|
|
8220
|
+
const [formState, dispatch] = (0, import_react63.useReducer)(FormReducer_default, initialState);
|
|
7937
8221
|
const getSearchableColumns = () => {
|
|
7938
8222
|
return props.columns?.filter((c) => c.isSearchable)?.map((c) => c.name)?.join(",");
|
|
7939
8223
|
};
|
|
7940
|
-
const handleFilterChange = (0,
|
|
8224
|
+
const handleFilterChange = (0, import_react63.useCallback)(
|
|
7941
8225
|
(updatedValues) => {
|
|
7942
8226
|
dispatch({
|
|
7943
8227
|
type: FORM_INPUT_UPDATE,
|
|
@@ -7968,7 +8252,7 @@ var DataList = (props) => {
|
|
|
7968
8252
|
},
|
|
7969
8253
|
[dispatch, props, router]
|
|
7970
8254
|
);
|
|
7971
|
-
(0,
|
|
8255
|
+
(0, import_react63.useEffect)(() => {
|
|
7972
8256
|
if (!props.columns.some((col) => col.isSearchable)) {
|
|
7973
8257
|
return;
|
|
7974
8258
|
}
|
|
@@ -8003,30 +8287,30 @@ var DataList = (props) => {
|
|
|
8003
8287
|
const renderPageNumbers = () => {
|
|
8004
8288
|
if (pages <= 10) {
|
|
8005
8289
|
return Array.from({ length: pages }, (_, index) => index + 1).map(
|
|
8006
|
-
(page) => /* @__PURE__ */ (0,
|
|
8290
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react63.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8007
8291
|
Hyperlink,
|
|
8008
8292
|
{
|
|
8009
8293
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
8010
8294
|
href: builder.getNewPageUrl(page),
|
|
8011
8295
|
children: page
|
|
8012
8296
|
}
|
|
8013
|
-
) : /* @__PURE__ */ (0,
|
|
8297
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary-base", children: page }) }, page)
|
|
8014
8298
|
);
|
|
8015
8299
|
} else {
|
|
8016
8300
|
const showFirstPages = activePageNumber <= 5;
|
|
8017
8301
|
const showLastPages = activePageNumber > pages - 5;
|
|
8018
8302
|
if (showFirstPages) {
|
|
8019
|
-
return /* @__PURE__ */ (0,
|
|
8020
|
-
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0,
|
|
8303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_jsx_runtime85.Fragment, { children: [
|
|
8304
|
+
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react63.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8021
8305
|
Hyperlink,
|
|
8022
8306
|
{
|
|
8023
8307
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
8024
8308
|
href: builder.getNewPageUrl(page),
|
|
8025
8309
|
children: page
|
|
8026
8310
|
}
|
|
8027
|
-
) : /* @__PURE__ */ (0,
|
|
8028
|
-
/* @__PURE__ */ (0,
|
|
8029
|
-
/* @__PURE__ */ (0,
|
|
8311
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary-base", children: page }) }, page)),
|
|
8312
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
8313
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8030
8314
|
Hyperlink,
|
|
8031
8315
|
{
|
|
8032
8316
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -8034,7 +8318,7 @@ var DataList = (props) => {
|
|
|
8034
8318
|
children: pages - 1
|
|
8035
8319
|
}
|
|
8036
8320
|
),
|
|
8037
|
-
/* @__PURE__ */ (0,
|
|
8321
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8038
8322
|
Hyperlink,
|
|
8039
8323
|
{
|
|
8040
8324
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -8042,7 +8326,7 @@ var DataList = (props) => {
|
|
|
8042
8326
|
children: pages
|
|
8043
8327
|
}
|
|
8044
8328
|
),
|
|
8045
|
-
/* @__PURE__ */ (0,
|
|
8329
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "relative inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
8046
8330
|
"select",
|
|
8047
8331
|
{
|
|
8048
8332
|
className: " py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -8054,18 +8338,18 @@ var DataList = (props) => {
|
|
|
8054
8338
|
}
|
|
8055
8339
|
},
|
|
8056
8340
|
children: [
|
|
8057
|
-
/* @__PURE__ */ (0,
|
|
8341
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("option", { className: "", value: "", children: "Jump to" }),
|
|
8058
8342
|
Array.from(
|
|
8059
8343
|
{ length: Math.max(0, pages - 10) },
|
|
8060
8344
|
(_, index) => index + 9
|
|
8061
|
-
).map((page) => /* @__PURE__ */ (0,
|
|
8345
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("option", { value: page, children: page }, page))
|
|
8062
8346
|
]
|
|
8063
8347
|
}
|
|
8064
8348
|
) })
|
|
8065
8349
|
] });
|
|
8066
8350
|
} else if (showLastPages) {
|
|
8067
|
-
return /* @__PURE__ */ (0,
|
|
8068
|
-
/* @__PURE__ */ (0,
|
|
8351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_jsx_runtime85.Fragment, { children: [
|
|
8352
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8069
8353
|
Hyperlink,
|
|
8070
8354
|
{
|
|
8071
8355
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -8073,7 +8357,7 @@ var DataList = (props) => {
|
|
|
8073
8357
|
children: "1"
|
|
8074
8358
|
}
|
|
8075
8359
|
),
|
|
8076
|
-
/* @__PURE__ */ (0,
|
|
8360
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8077
8361
|
Hyperlink,
|
|
8078
8362
|
{
|
|
8079
8363
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -8081,21 +8365,21 @@ var DataList = (props) => {
|
|
|
8081
8365
|
children: "2"
|
|
8082
8366
|
}
|
|
8083
8367
|
),
|
|
8084
|
-
/* @__PURE__ */ (0,
|
|
8368
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
8085
8369
|
Array.from({ length: 8 }, (_, index) => pages - 7 + index).map(
|
|
8086
|
-
(page) => /* @__PURE__ */ (0,
|
|
8370
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react63.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8087
8371
|
Hyperlink,
|
|
8088
8372
|
{
|
|
8089
8373
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
8090
8374
|
href: builder.getNewPageUrl(page),
|
|
8091
8375
|
children: page
|
|
8092
8376
|
}
|
|
8093
|
-
) : /* @__PURE__ */ (0,
|
|
8377
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary-base", children: page }) }, page)
|
|
8094
8378
|
)
|
|
8095
8379
|
] });
|
|
8096
8380
|
} else {
|
|
8097
|
-
return /* @__PURE__ */ (0,
|
|
8098
|
-
/* @__PURE__ */ (0,
|
|
8381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_jsx_runtime85.Fragment, { children: [
|
|
8382
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8099
8383
|
Hyperlink,
|
|
8100
8384
|
{
|
|
8101
8385
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -8103,7 +8387,7 @@ var DataList = (props) => {
|
|
|
8103
8387
|
children: "1"
|
|
8104
8388
|
}
|
|
8105
8389
|
),
|
|
8106
|
-
/* @__PURE__ */ (0,
|
|
8390
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8107
8391
|
Hyperlink,
|
|
8108
8392
|
{
|
|
8109
8393
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -8111,20 +8395,20 @@ var DataList = (props) => {
|
|
|
8111
8395
|
children: "2"
|
|
8112
8396
|
}
|
|
8113
8397
|
),
|
|
8114
|
-
/* @__PURE__ */ (0,
|
|
8398
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
8115
8399
|
Array.from(
|
|
8116
8400
|
{ length: 5 },
|
|
8117
8401
|
(_, index) => activePageNumber - 2 + index
|
|
8118
|
-
).map((page) => /* @__PURE__ */ (0,
|
|
8402
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react63.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8119
8403
|
Hyperlink,
|
|
8120
8404
|
{
|
|
8121
8405
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
8122
8406
|
href: builder.getNewPageUrl(page),
|
|
8123
8407
|
children: page
|
|
8124
8408
|
}
|
|
8125
|
-
) : /* @__PURE__ */ (0,
|
|
8126
|
-
/* @__PURE__ */ (0,
|
|
8127
|
-
/* @__PURE__ */ (0,
|
|
8409
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "px-3 py-1 border-t border-b border-gray-300 bg-primary-base", children: page }) }, page)),
|
|
8410
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
8411
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8128
8412
|
Hyperlink,
|
|
8129
8413
|
{
|
|
8130
8414
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -8132,7 +8416,7 @@ var DataList = (props) => {
|
|
|
8132
8416
|
children: pages - 1
|
|
8133
8417
|
}
|
|
8134
8418
|
),
|
|
8135
|
-
/* @__PURE__ */ (0,
|
|
8419
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8136
8420
|
Hyperlink,
|
|
8137
8421
|
{
|
|
8138
8422
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -8140,7 +8424,7 @@ var DataList = (props) => {
|
|
|
8140
8424
|
children: pages
|
|
8141
8425
|
}
|
|
8142
8426
|
),
|
|
8143
|
-
/* @__PURE__ */ (0,
|
|
8427
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "relative inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
8144
8428
|
"select",
|
|
8145
8429
|
{
|
|
8146
8430
|
className: "px-2 py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -8152,8 +8436,8 @@ var DataList = (props) => {
|
|
|
8152
8436
|
}
|
|
8153
8437
|
},
|
|
8154
8438
|
children: [
|
|
8155
|
-
/* @__PURE__ */ (0,
|
|
8156
|
-
Array.from({ length: pages - 4 }, (_, index) => index + 3).filter((page) => page > 2 && page < pages - 1).map((page) => /* @__PURE__ */ (0,
|
|
8439
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("option", { value: "", children: "Jump to" }),
|
|
8440
|
+
Array.from({ length: pages - 4 }, (_, index) => index + 3).filter((page) => page > 2 && page < pages - 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("option", { value: page, children: page }, page))
|
|
8157
8441
|
]
|
|
8158
8442
|
}
|
|
8159
8443
|
) })
|
|
@@ -8161,16 +8445,16 @@ var DataList = (props) => {
|
|
|
8161
8445
|
}
|
|
8162
8446
|
}
|
|
8163
8447
|
};
|
|
8164
|
-
return /* @__PURE__ */ (0,
|
|
8165
|
-
/* @__PURE__ */ (0,
|
|
8166
|
-
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0,
|
|
8448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_react63.default.Fragment, { children: [
|
|
8449
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(ContentView_default, { isDataFound, children: [
|
|
8450
|
+
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
8167
8451
|
"div",
|
|
8168
8452
|
{
|
|
8169
8453
|
className: `flex justify-between items-center bg-white pl-6 pr-2 h-14 mb-3 shadow-sm rounded-md sticky top-0`,
|
|
8170
8454
|
children: [
|
|
8171
|
-
props.title ? /* @__PURE__ */ (0,
|
|
8172
|
-
/* @__PURE__ */ (0,
|
|
8173
|
-
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0,
|
|
8455
|
+
props.title ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "inline-flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("h2", { className: "text-lg font-semibold text-black-800", children: props.title }) }) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", {}),
|
|
8456
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
8457
|
+
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8174
8458
|
InputControl_default,
|
|
8175
8459
|
{
|
|
8176
8460
|
name: "Search_input",
|
|
@@ -8182,7 +8466,7 @@ var DataList = (props) => {
|
|
|
8182
8466
|
}
|
|
8183
8467
|
}
|
|
8184
8468
|
),
|
|
8185
|
-
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0,
|
|
8469
|
+
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8186
8470
|
InputControl_default,
|
|
8187
8471
|
{
|
|
8188
8472
|
name: filter.name,
|
|
@@ -8197,15 +8481,15 @@ var DataList = (props) => {
|
|
|
8197
8481
|
},
|
|
8198
8482
|
filter.name
|
|
8199
8483
|
)),
|
|
8200
|
-
props.addLinkHref && /* @__PURE__ */ (0,
|
|
8484
|
+
props.addLinkHref && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
8201
8485
|
Hyperlink,
|
|
8202
8486
|
{
|
|
8203
8487
|
className: "gap-1",
|
|
8204
8488
|
linkType: "Primary" /* Solid */,
|
|
8205
8489
|
href: props.addLinkHref,
|
|
8206
8490
|
children: [
|
|
8207
|
-
/* @__PURE__ */ (0,
|
|
8208
|
-
/* @__PURE__ */ (0,
|
|
8491
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Icon_default, { name: "plus", className: "w-4 h-4" }),
|
|
8492
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "text-sm font-medium", children: props.addLinkText || "Add New" })
|
|
8209
8493
|
]
|
|
8210
8494
|
}
|
|
8211
8495
|
)
|
|
@@ -8213,8 +8497,8 @@ var DataList = (props) => {
|
|
|
8213
8497
|
]
|
|
8214
8498
|
}
|
|
8215
8499
|
),
|
|
8216
|
-
/* @__PURE__ */ (0,
|
|
8217
|
-
/* @__PURE__ */ (0,
|
|
8500
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "flex-1 overflow-y-auto justify-end bg-white rounded shadow h-[calc(100vh-14rem)]", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("table", { className: "w-full divide-y divide-gray-200", children: [
|
|
8501
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("thead", { className: "bg-gray-50 sticky top-0", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("tr", { children: props?.columns?.map((column) => {
|
|
8218
8502
|
let url = builder.getNewOrderByUrl(column.name);
|
|
8219
8503
|
let icon = "chevronUpDown";
|
|
8220
8504
|
if (orderBy.includes(`${column.name} desc`)) {
|
|
@@ -8224,18 +8508,18 @@ var DataList = (props) => {
|
|
|
8224
8508
|
icon = "chevronUp";
|
|
8225
8509
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
8226
8510
|
}
|
|
8227
|
-
return /* @__PURE__ */ (0,
|
|
8511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8228
8512
|
"th",
|
|
8229
8513
|
{
|
|
8230
8514
|
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" : ""),
|
|
8231
|
-
children: /* @__PURE__ */ (0,
|
|
8515
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8232
8516
|
Hyperlink,
|
|
8233
8517
|
{
|
|
8234
8518
|
href: column.enableSorting ? url : void 0,
|
|
8235
8519
|
className: "!text-neutral-contrast ",
|
|
8236
|
-
children: /* @__PURE__ */ (0,
|
|
8237
|
-
/* @__PURE__ */ (0,
|
|
8238
|
-
column.enableSorting && /* @__PURE__ */ (0,
|
|
8520
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("span", { className: "flex items-center space-x-1", children: [
|
|
8521
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "text-black", children: column.label }),
|
|
8522
|
+
column.enableSorting && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Icon_default, { className: "w-4 h-4", name: icon })
|
|
8239
8523
|
] })
|
|
8240
8524
|
}
|
|
8241
8525
|
)
|
|
@@ -8243,24 +8527,22 @@ var DataList = (props) => {
|
|
|
8243
8527
|
column.name
|
|
8244
8528
|
);
|
|
8245
8529
|
}) }) }),
|
|
8246
|
-
/* @__PURE__ */ (0,
|
|
8530
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("tbody", { className: "divide-y divide-gray-200 ", children: props.dataset?.result?.map((dataitem, index) => {
|
|
8247
8531
|
let validityClass = "";
|
|
8248
|
-
console.log("dataitem", dataitem);
|
|
8249
8532
|
if (props.recordValidityColumnName && getNestedProperty2(dataitem, props.recordValidityColumnName) == false) {
|
|
8250
8533
|
validityClass = "bg-alert-200";
|
|
8251
8534
|
}
|
|
8252
|
-
return /* @__PURE__ */ (0,
|
|
8253
|
-
|
|
8254
|
-
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_react62.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
8535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("tr", { className: validityClass, children: props?.columns?.map((column, colindex) => {
|
|
8536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react63.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8255
8537
|
"td",
|
|
8256
8538
|
{
|
|
8257
8539
|
className: "px-6 py-2 whitespace-normal " + (column.controlType == ViewControlTypes_default.money ? "" : ""),
|
|
8258
|
-
children: column.addhref === true ? /* @__PURE__ */ (0,
|
|
8540
|
+
children: column.addhref === true ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8259
8541
|
Hyperlink,
|
|
8260
8542
|
{
|
|
8261
8543
|
className: "",
|
|
8262
8544
|
href: `https://${dataitem[column.name]}`,
|
|
8263
|
-
children: /* @__PURE__ */ (0,
|
|
8545
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8264
8546
|
ViewControl_default,
|
|
8265
8547
|
{
|
|
8266
8548
|
controlType: column.controlType,
|
|
@@ -8273,11 +8555,11 @@ var DataList = (props) => {
|
|
|
8273
8555
|
}
|
|
8274
8556
|
)
|
|
8275
8557
|
}
|
|
8276
|
-
) : column.showAsLink ? /* @__PURE__ */ (0,
|
|
8558
|
+
) : column.showAsLink ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8277
8559
|
Hyperlink,
|
|
8278
8560
|
{
|
|
8279
8561
|
href: props.path + dataitem[props.columns[0].name] + "/" + (dataitem.linkUrlSegment ?? column.linkUrlSegment),
|
|
8280
|
-
children: /* @__PURE__ */ (0,
|
|
8562
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8281
8563
|
ViewControl_default,
|
|
8282
8564
|
{
|
|
8283
8565
|
controlType: column.controlType,
|
|
@@ -8287,7 +8569,7 @@ var DataList = (props) => {
|
|
|
8287
8569
|
}
|
|
8288
8570
|
)
|
|
8289
8571
|
}
|
|
8290
|
-
) : /* @__PURE__ */ (0,
|
|
8572
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8291
8573
|
ViewControl_default,
|
|
8292
8574
|
{
|
|
8293
8575
|
controlType: column.controlType,
|
|
@@ -8301,10 +8583,10 @@ var DataList = (props) => {
|
|
|
8301
8583
|
}) }, index);
|
|
8302
8584
|
}) })
|
|
8303
8585
|
] }) }),
|
|
8304
|
-
/* @__PURE__ */ (0,
|
|
8305
|
-
/* @__PURE__ */ (0,
|
|
8306
|
-
/* @__PURE__ */ (0,
|
|
8307
|
-
activePageNumber > 1 && /* @__PURE__ */ (0,
|
|
8586
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "pt-4 border-t border-t-gray-50 sticky bottom-0 h-11 mt-2 ", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
8587
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "text-gray-700", children: label }),
|
|
8588
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex space-x-2 items-center", children: [
|
|
8589
|
+
activePageNumber > 1 && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8308
8590
|
Hyperlink,
|
|
8309
8591
|
{
|
|
8310
8592
|
className: "px-3 py-1 rounded-l-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -8312,9 +8594,9 @@ var DataList = (props) => {
|
|
|
8312
8594
|
children: "Prev"
|
|
8313
8595
|
}
|
|
8314
8596
|
),
|
|
8315
|
-
activePageNumber <= 1 && /* @__PURE__ */ (0,
|
|
8597
|
+
activePageNumber <= 1 && /* @__PURE__ */ (0, import_jsx_runtime85.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" }),
|
|
8316
8598
|
renderPageNumbers(),
|
|
8317
|
-
activePageNumber < pages && /* @__PURE__ */ (0,
|
|
8599
|
+
activePageNumber < pages && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8318
8600
|
Hyperlink,
|
|
8319
8601
|
{
|
|
8320
8602
|
className: "px-3 py-1 rounded-r-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -8322,19 +8604,19 @@ var DataList = (props) => {
|
|
|
8322
8604
|
children: "Next"
|
|
8323
8605
|
}
|
|
8324
8606
|
),
|
|
8325
|
-
activePageNumber >= pages && /* @__PURE__ */ (0,
|
|
8607
|
+
activePageNumber >= pages && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "px-3 py-1 rounded-r-md border border-gray-300 bg-gray-200 text-gray-500", children: "Next" })
|
|
8326
8608
|
] })
|
|
8327
8609
|
] }) })
|
|
8328
8610
|
] }),
|
|
8329
|
-
/* @__PURE__ */ (0,
|
|
8330
|
-
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0,
|
|
8611
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(NoContentView_default, { isDataFound, children: [
|
|
8612
|
+
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
8331
8613
|
"div",
|
|
8332
8614
|
{
|
|
8333
8615
|
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`,
|
|
8334
8616
|
children: [
|
|
8335
|
-
props.title ? /* @__PURE__ */ (0,
|
|
8336
|
-
/* @__PURE__ */ (0,
|
|
8337
|
-
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0,
|
|
8617
|
+
props.title ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "inline-flex items-center gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("h2", { className: "text-lg font-semibold text-black", children: props.title }) }) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", {}),
|
|
8618
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
8619
|
+
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8338
8620
|
InputControl_default,
|
|
8339
8621
|
{
|
|
8340
8622
|
name: "Search_input",
|
|
@@ -8346,7 +8628,7 @@ var DataList = (props) => {
|
|
|
8346
8628
|
}
|
|
8347
8629
|
}
|
|
8348
8630
|
),
|
|
8349
|
-
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0,
|
|
8631
|
+
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8350
8632
|
InputControl_default,
|
|
8351
8633
|
{
|
|
8352
8634
|
name: filter.name,
|
|
@@ -8361,15 +8643,15 @@ var DataList = (props) => {
|
|
|
8361
8643
|
},
|
|
8362
8644
|
filter.name
|
|
8363
8645
|
)),
|
|
8364
|
-
props.addLinkHref && /* @__PURE__ */ (0,
|
|
8646
|
+
props.addLinkHref && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
8365
8647
|
Hyperlink,
|
|
8366
8648
|
{
|
|
8367
8649
|
className: "gap-1",
|
|
8368
8650
|
linkType: "Primary" /* Solid */,
|
|
8369
8651
|
href: props.addLinkHref,
|
|
8370
8652
|
children: [
|
|
8371
|
-
/* @__PURE__ */ (0,
|
|
8372
|
-
/* @__PURE__ */ (0,
|
|
8653
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Icon_default, { name: "plus", className: "w-4 h-4" }),
|
|
8654
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "text-sm font-medium", children: props.addLinkText || "Add New" })
|
|
8373
8655
|
]
|
|
8374
8656
|
}
|
|
8375
8657
|
)
|
|
@@ -8377,8 +8659,8 @@ var DataList = (props) => {
|
|
|
8377
8659
|
]
|
|
8378
8660
|
}
|
|
8379
8661
|
),
|
|
8380
|
-
/* @__PURE__ */ (0,
|
|
8381
|
-
/* @__PURE__ */ (0,
|
|
8662
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex-grow overflow-y-auto justify-end bg-white rounded shadow h-[75vh]", children: [
|
|
8663
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("table", { className: "w-full divide-y divide-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("thead", { className: "bg-gray-50", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("tr", { children: props?.columns?.map((column) => {
|
|
8382
8664
|
let url = builder.getNewOrderByUrl(column.name);
|
|
8383
8665
|
let icon = "chevronUpDown";
|
|
8384
8666
|
if (orderBy.includes(`${column.name} desc`)) {
|
|
@@ -8388,18 +8670,18 @@ var DataList = (props) => {
|
|
|
8388
8670
|
icon = "chevronUp";
|
|
8389
8671
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
8390
8672
|
}
|
|
8391
|
-
return /* @__PURE__ */ (0,
|
|
8673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8392
8674
|
"th",
|
|
8393
8675
|
{
|
|
8394
8676
|
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" : ""),
|
|
8395
|
-
children: /* @__PURE__ */ (0,
|
|
8677
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8396
8678
|
Hyperlink,
|
|
8397
8679
|
{
|
|
8398
8680
|
href: column.enableSorting ? url : void 0,
|
|
8399
8681
|
className: "text-body-950",
|
|
8400
|
-
children: /* @__PURE__ */ (0,
|
|
8401
|
-
/* @__PURE__ */ (0,
|
|
8402
|
-
column.enableSorting && /* @__PURE__ */ (0,
|
|
8682
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("span", { className: "flex items-center space-x-1", children: [
|
|
8683
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { children: column.label }),
|
|
8684
|
+
column.enableSorting && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Icon_default, { className: "w-4 h-4", name: icon })
|
|
8403
8685
|
] })
|
|
8404
8686
|
}
|
|
8405
8687
|
)
|
|
@@ -8407,7 +8689,7 @@ var DataList = (props) => {
|
|
|
8407
8689
|
column.name
|
|
8408
8690
|
);
|
|
8409
8691
|
}) }) }) }) }),
|
|
8410
|
-
/* @__PURE__ */ (0,
|
|
8692
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "w-full text-center bg-transparent pt-5", children: "There are no entries in the table at the moment." })
|
|
8411
8693
|
] })
|
|
8412
8694
|
] })
|
|
8413
8695
|
] });
|
|
@@ -8415,12 +8697,12 @@ var DataList = (props) => {
|
|
|
8415
8697
|
var DataList_default = DataList;
|
|
8416
8698
|
|
|
8417
8699
|
// src/components/dataForm/DataListRenderer.tsx
|
|
8418
|
-
var
|
|
8700
|
+
var import_react64 = __toESM(require("react"));
|
|
8419
8701
|
init_ServiceClient();
|
|
8420
8702
|
init_OdataBuilder();
|
|
8421
8703
|
init_SelectWithSearchInput();
|
|
8422
|
-
var
|
|
8423
|
-
var
|
|
8704
|
+
var import_navigation4 = require("next/navigation");
|
|
8705
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
8424
8706
|
var viewControlMap = {
|
|
8425
8707
|
number: ViewControlTypes.number,
|
|
8426
8708
|
lineText: ViewControlTypes.lineText,
|
|
@@ -8475,14 +8757,14 @@ var DataListRenderer = ({
|
|
|
8475
8757
|
widgetProps
|
|
8476
8758
|
}) => {
|
|
8477
8759
|
const serviceClient = new ServiceClient_default(apiBaseUrl, session);
|
|
8478
|
-
const [columns, setColumns] = (0,
|
|
8479
|
-
const [dataset, setDataset] = (0,
|
|
8480
|
-
const [filter, setFilters] = (0,
|
|
8481
|
-
const [addLinkHref, setAddLinkHref] = (0,
|
|
8482
|
-
const [addLinkText, setAddLinkText] = (0,
|
|
8483
|
-
const [serviceRoute, setServiceRoute] = (0,
|
|
8484
|
-
const pathname = (0,
|
|
8485
|
-
(0,
|
|
8760
|
+
const [columns, setColumns] = (0, import_react64.useState)([]);
|
|
8761
|
+
const [dataset, setDataset] = (0, import_react64.useState)();
|
|
8762
|
+
const [filter, setFilters] = (0, import_react64.useState)([]);
|
|
8763
|
+
const [addLinkHref, setAddLinkHref] = (0, import_react64.useState)("");
|
|
8764
|
+
const [addLinkText, setAddLinkText] = (0, import_react64.useState)("");
|
|
8765
|
+
const [serviceRoute, setServiceRoute] = (0, import_react64.useState)("");
|
|
8766
|
+
const pathname = (0, import_navigation4.usePathname)();
|
|
8767
|
+
(0, import_react64.useEffect)(() => {
|
|
8486
8768
|
if (!formDefinition) return;
|
|
8487
8769
|
setColumns(mapApiToColumns(formDefinition));
|
|
8488
8770
|
setFilters(mapApiToFilters(formDefinition));
|
|
@@ -8495,7 +8777,7 @@ var DataListRenderer = ({
|
|
|
8495
8777
|
setAddLinkHref(resolvedAddLinkHref);
|
|
8496
8778
|
setAddLinkText(formDefinition?.siteFormDataList?.addLinkText ?? "");
|
|
8497
8779
|
}, [formDefinition, params]);
|
|
8498
|
-
(0,
|
|
8780
|
+
(0, import_react64.useEffect)(() => {
|
|
8499
8781
|
const fetchData = async () => {
|
|
8500
8782
|
if (!serviceRoute) return;
|
|
8501
8783
|
const resolvedRoute = resolveRoutePlaceholders2(serviceRoute, params);
|
|
@@ -8515,13 +8797,13 @@ var DataListRenderer = ({
|
|
|
8515
8797
|
isActive: landingPageUrl === pathname
|
|
8516
8798
|
};
|
|
8517
8799
|
});
|
|
8518
|
-
return /* @__PURE__ */ (0,
|
|
8800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_react64.default.Fragment, { children: [
|
|
8519
8801
|
resolvedTabs.length > 0 && // <NavigationTabsV2
|
|
8520
8802
|
// tabs={resolvedTabs}
|
|
8521
8803
|
// params={(widgetProps?.params ?? params) as Record<string, any>}
|
|
8522
8804
|
// />
|
|
8523
|
-
/* @__PURE__ */ (0,
|
|
8524
|
-
/* @__PURE__ */ (0,
|
|
8805
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(NavigationTabsV2_default, { tabs, params: widgetProps.params }),
|
|
8806
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
8525
8807
|
DataList_default,
|
|
8526
8808
|
{
|
|
8527
8809
|
addLinkHref,
|
|
@@ -8543,13 +8825,15 @@ var DataListRenderer_default = DataListRenderer;
|
|
|
8543
8825
|
init_InputControlType();
|
|
8544
8826
|
|
|
8545
8827
|
// src/components/dataForm/DataForm.tsx
|
|
8546
|
-
var
|
|
8828
|
+
var import_react66 = __toESM(require("react"));
|
|
8829
|
+
init_InputControl();
|
|
8547
8830
|
init_Icon();
|
|
8548
8831
|
init_Button();
|
|
8549
8832
|
init_StyleTypes();
|
|
8550
8833
|
|
|
8551
8834
|
// src/components/dataForm/DataFormChildSection.tsx
|
|
8552
|
-
var
|
|
8835
|
+
var import_react65 = __toESM(require("react"));
|
|
8836
|
+
init_InputControl();
|
|
8553
8837
|
|
|
8554
8838
|
// src/components/dataForm/StyleTypes.tsx
|
|
8555
8839
|
var StyleTypes2 = /* @__PURE__ */ ((StyleTypes3) => {
|
|
@@ -8576,7 +8860,7 @@ var FORM_CHILD_ONE_TO_ONE_UPDATE = "FORM_CHILD_ONE_TO_ONE_UPDATE";
|
|
|
8576
8860
|
var FORM_CHILD_ROW_ADD = "FORM_CHILD_ROW_ADD";
|
|
8577
8861
|
|
|
8578
8862
|
// src/components/dataForm/DataFormChildSection.tsx
|
|
8579
|
-
var
|
|
8863
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
8580
8864
|
var DataFormChildSection = (props) => {
|
|
8581
8865
|
const { section } = props;
|
|
8582
8866
|
const isOneToOne = section.relationshipType === "one-to-one";
|
|
@@ -8588,7 +8872,7 @@ var DataFormChildSection = (props) => {
|
|
|
8588
8872
|
return childItems.map((item, originalIndex) => ({ item, originalIndex })).filter((x) => !x.item.isDeleted) || [];
|
|
8589
8873
|
};
|
|
8590
8874
|
const childItemsToRender = getChildItemsForRendering();
|
|
8591
|
-
const handleChildInputChange = (0,
|
|
8875
|
+
const handleChildInputChange = (0, import_react65.useCallback)(
|
|
8592
8876
|
(updatedValues) => {
|
|
8593
8877
|
if (isOneToOne) {
|
|
8594
8878
|
props.callback({
|
|
@@ -8615,7 +8899,7 @@ var DataFormChildSection = (props) => {
|
|
|
8615
8899
|
},
|
|
8616
8900
|
[props, isOneToOne, childItemsToRender]
|
|
8617
8901
|
);
|
|
8618
|
-
const onAddRow = (0,
|
|
8902
|
+
const onAddRow = (0, import_react65.useCallback)(() => {
|
|
8619
8903
|
props.callback({
|
|
8620
8904
|
sectionName: props.section.name,
|
|
8621
8905
|
actionType: FORM_CHILD_ROW_ADD,
|
|
@@ -8624,7 +8908,7 @@ var DataFormChildSection = (props) => {
|
|
|
8624
8908
|
rowIndex: -1
|
|
8625
8909
|
});
|
|
8626
8910
|
}, [props]);
|
|
8627
|
-
const onDeleteRow = (0,
|
|
8911
|
+
const onDeleteRow = (0, import_react65.useCallback)(
|
|
8628
8912
|
(filteredIndex) => {
|
|
8629
8913
|
const visibleItem = childItemsToRender[filteredIndex];
|
|
8630
8914
|
if (visibleItem) {
|
|
@@ -8644,14 +8928,14 @@ var DataFormChildSection = (props) => {
|
|
|
8644
8928
|
childItemsToRender,
|
|
8645
8929
|
allChildItems: childItems
|
|
8646
8930
|
});
|
|
8647
|
-
return /* @__PURE__ */ (0,
|
|
8648
|
-
section.sectionTitle && /* @__PURE__ */ (0,
|
|
8649
|
-
/* @__PURE__ */ (0,
|
|
8650
|
-
/* @__PURE__ */ (0,
|
|
8651
|
-
(!isOneToOne || childItemsToRender.length > 0) && /* @__PURE__ */ (0,
|
|
8652
|
-
return /* @__PURE__ */ (0,
|
|
8931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react65.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "rounded border-neutral-200 border px-6 py-4 mb-2", children: [
|
|
8932
|
+
section.sectionTitle && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "mb-4 text-lg font-medium text-body-950", children: section.sectionTitle }),
|
|
8933
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "flex-grow flex flex-col justify-between overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex flex-col justify-between gap-2", children: [
|
|
8934
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("table", { className: "w-full border-separate divide-y divide-gray-200", children: [
|
|
8935
|
+
(!isOneToOne || childItemsToRender.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("thead", { className: "", children: section.sectionRows.map((sectionRow, sectionRowIndex) => {
|
|
8936
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("tr", { className: "", children: [
|
|
8653
8937
|
sectionRow.elements.map((field, index) => {
|
|
8654
|
-
return /* @__PURE__ */ (0,
|
|
8938
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
8655
8939
|
"th",
|
|
8656
8940
|
{
|
|
8657
8941
|
className: "py-3 font-normal text-left",
|
|
@@ -8660,21 +8944,21 @@ var DataFormChildSection = (props) => {
|
|
|
8660
8944
|
field.name
|
|
8661
8945
|
);
|
|
8662
8946
|
}),
|
|
8663
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */ (0,
|
|
8947
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("th", { className: "py-3 font-normal text-left", children: "Actions" })
|
|
8664
8948
|
] }, sectionRowIndex);
|
|
8665
8949
|
}) }),
|
|
8666
|
-
/* @__PURE__ */ (0,
|
|
8950
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("tbody", { className: "divide-y divide-gray-200", children: childItemsToRender.map((visibleItem, filteredIndex) => {
|
|
8667
8951
|
const { item, originalIndex } = visibleItem;
|
|
8668
8952
|
const rowKey = originalIndex;
|
|
8669
|
-
return /* @__PURE__ */ (0,
|
|
8953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react65.default.Fragment, { children: section.sectionRows.map(
|
|
8670
8954
|
(sectionRow, sectionRowIndex) => {
|
|
8671
|
-
return /* @__PURE__ */ (0,
|
|
8955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
8672
8956
|
"tr",
|
|
8673
8957
|
{
|
|
8674
8958
|
className: "",
|
|
8675
8959
|
children: [
|
|
8676
8960
|
sectionRow.elements.map((field, index) => {
|
|
8677
|
-
return /* @__PURE__ */ (0,
|
|
8961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "w-11/12", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
8678
8962
|
InputControl_default,
|
|
8679
8963
|
{
|
|
8680
8964
|
index: filteredIndex,
|
|
@@ -8694,7 +8978,7 @@ var DataFormChildSection = (props) => {
|
|
|
8694
8978
|
}
|
|
8695
8979
|
) }) }) }, field.name);
|
|
8696
8980
|
}),
|
|
8697
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */ (0,
|
|
8981
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
8698
8982
|
ClientButton_default,
|
|
8699
8983
|
{
|
|
8700
8984
|
ButtonType: StyleTypes2.Hollow,
|
|
@@ -8703,7 +8987,7 @@ var DataFormChildSection = (props) => {
|
|
|
8703
8987
|
},
|
|
8704
8988
|
dataRole: "delete",
|
|
8705
8989
|
tabIndex: -1,
|
|
8706
|
-
children: /* @__PURE__ */ (0,
|
|
8990
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
8707
8991
|
Icon_default,
|
|
8708
8992
|
{
|
|
8709
8993
|
className: "w-4 h-4",
|
|
@@ -8720,7 +9004,7 @@ var DataFormChildSection = (props) => {
|
|
|
8720
9004
|
) }, rowKey);
|
|
8721
9005
|
}) })
|
|
8722
9006
|
] }) }),
|
|
8723
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */ (0,
|
|
9007
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "ml-1", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
8724
9008
|
ClientButton_default,
|
|
8725
9009
|
{
|
|
8726
9010
|
ButtonType: "Link" /* Link */,
|
|
@@ -8735,9 +9019,9 @@ var DataFormChildSection = (props) => {
|
|
|
8735
9019
|
var DataFormChildSection_default = DataFormChildSection;
|
|
8736
9020
|
|
|
8737
9021
|
// src/components/dataForm/DataForm.tsx
|
|
8738
|
-
var
|
|
9022
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
8739
9023
|
var DataForm = (props) => {
|
|
8740
|
-
const formRef = (0,
|
|
9024
|
+
const formRef = (0, import_react66.useRef)(null);
|
|
8741
9025
|
console.log(props.dataItem, "dssads");
|
|
8742
9026
|
const initialState = {
|
|
8743
9027
|
inputValues: {},
|
|
@@ -8746,9 +9030,9 @@ var DataForm = (props) => {
|
|
|
8746
9030
|
const childInitialState = {
|
|
8747
9031
|
inputValues: []
|
|
8748
9032
|
};
|
|
8749
|
-
const [formState, dispatch] = (0,
|
|
9033
|
+
const [formState, dispatch] = (0, import_react66.useReducer)(FormReducer_default, initialState);
|
|
8750
9034
|
console.log(props.sections, "sections");
|
|
8751
|
-
const clearHiddenChildSections = (0,
|
|
9035
|
+
const clearHiddenChildSections = (0, import_react66.useCallback)(
|
|
8752
9036
|
(changedProperty, newValues) => {
|
|
8753
9037
|
if (!props.sections) return;
|
|
8754
9038
|
const allChildSections = [];
|
|
@@ -8786,7 +9070,7 @@ var DataForm = (props) => {
|
|
|
8786
9070
|
},
|
|
8787
9071
|
[props.sections, formState.inputValues]
|
|
8788
9072
|
);
|
|
8789
|
-
const handleInputChange = (0,
|
|
9073
|
+
const handleInputChange = (0, import_react66.useCallback)(
|
|
8790
9074
|
async (updatedValues) => {
|
|
8791
9075
|
dispatch({
|
|
8792
9076
|
type: FORM_INPUT_UPDATE,
|
|
@@ -8801,7 +9085,7 @@ var DataForm = (props) => {
|
|
|
8801
9085
|
},
|
|
8802
9086
|
[dispatch, formState.inputValues, clearHiddenChildSections]
|
|
8803
9087
|
);
|
|
8804
|
-
const fetchData = (0,
|
|
9088
|
+
const fetchData = (0, import_react66.useCallback)(async () => {
|
|
8805
9089
|
if (!props.rules) return;
|
|
8806
9090
|
if (Object.keys(formState.inputValues).length === 0) {
|
|
8807
9091
|
return;
|
|
@@ -8832,7 +9116,7 @@ var DataForm = (props) => {
|
|
|
8832
9116
|
console.error("Error fetching data:", error);
|
|
8833
9117
|
}
|
|
8834
9118
|
}, [formState.lastPropertyChanged, formState.inputValues]);
|
|
8835
|
-
(0,
|
|
9119
|
+
(0, import_react66.useEffect)(() => {
|
|
8836
9120
|
fetchData();
|
|
8837
9121
|
}, [formState.inputValues, formState.lastPropertyChanged]);
|
|
8838
9122
|
function replacePlaceholders(template, context, params) {
|
|
@@ -8852,7 +9136,7 @@ var DataForm = (props) => {
|
|
|
8852
9136
|
}
|
|
8853
9137
|
);
|
|
8854
9138
|
}
|
|
8855
|
-
const handleChildSectionChangeCallback = (0,
|
|
9139
|
+
const handleChildSectionChangeCallback = (0, import_react66.useCallback)(
|
|
8856
9140
|
(params) => {
|
|
8857
9141
|
dispatch({
|
|
8858
9142
|
type: params.actionType,
|
|
@@ -8897,7 +9181,7 @@ var DataForm = (props) => {
|
|
|
8897
9181
|
});
|
|
8898
9182
|
return cloned;
|
|
8899
9183
|
}
|
|
8900
|
-
const onClick = (0,
|
|
9184
|
+
const onClick = (0, import_react66.useCallback)(async () => {
|
|
8901
9185
|
if (props.onClick) {
|
|
8902
9186
|
const isEdit = props.dataItem && Object.keys(props.dataItem).length > 0;
|
|
8903
9187
|
const normalizedValues = normalizeChildSections(
|
|
@@ -8913,21 +9197,21 @@ var DataForm = (props) => {
|
|
|
8913
9197
|
return { isSuccessful: true };
|
|
8914
9198
|
}
|
|
8915
9199
|
}, [formState, props]);
|
|
8916
|
-
const handleAdditionalOnClick = (0,
|
|
9200
|
+
const handleAdditionalOnClick = (0, import_react66.useCallback)(async () => {
|
|
8917
9201
|
if (props.additionalActions?.onClick) {
|
|
8918
9202
|
return await props.additionalActions.onClick(formState);
|
|
8919
9203
|
} else {
|
|
8920
9204
|
return { isSuccessful: true, message: "Action completed successfully" };
|
|
8921
9205
|
}
|
|
8922
9206
|
}, [formState, props]);
|
|
8923
|
-
const onDelete = (0,
|
|
9207
|
+
const onDelete = (0, import_react66.useCallback)(async () => {
|
|
8924
9208
|
if (props.onDelete) {
|
|
8925
9209
|
return await props.onDelete(formState);
|
|
8926
9210
|
} else {
|
|
8927
9211
|
return { isSuccessful: true };
|
|
8928
9212
|
}
|
|
8929
9213
|
}, [formState, props]);
|
|
8930
|
-
(0,
|
|
9214
|
+
(0, import_react66.useEffect)(() => {
|
|
8931
9215
|
if (props.dataItem) {
|
|
8932
9216
|
dispatch({
|
|
8933
9217
|
type: FORM_INITIAL_UPDATE,
|
|
@@ -8955,19 +9239,19 @@ var DataForm = (props) => {
|
|
|
8955
9239
|
return false;
|
|
8956
9240
|
}
|
|
8957
9241
|
}
|
|
8958
|
-
return /* @__PURE__ */ (0,
|
|
8959
|
-
props.title && /* @__PURE__ */ (0,
|
|
9242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react66.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "flex-grow flex flex-col", children: [
|
|
9243
|
+
props.title && /* @__PURE__ */ (0, import_jsx_runtime88.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_runtime88.jsxs)(
|
|
8960
9244
|
"div",
|
|
8961
9245
|
{
|
|
8962
9246
|
className: "inline-flex items-center gap-2 cursor-pointer",
|
|
8963
9247
|
onClick: () => window.history.back(),
|
|
8964
9248
|
children: [
|
|
8965
|
-
/* @__PURE__ */ (0,
|
|
8966
|
-
/* @__PURE__ */ (0,
|
|
9249
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Icon_default, { name: "chevronLeft", className: "w-4 h-4 text-primary-800" }),
|
|
9250
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("h2", { className: "text-lg font-semibold text-primary-800", children: props.title })
|
|
8967
9251
|
]
|
|
8968
9252
|
}
|
|
8969
9253
|
) }),
|
|
8970
|
-
/* @__PURE__ */ (0,
|
|
9254
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
8971
9255
|
"form",
|
|
8972
9256
|
{
|
|
8973
9257
|
className: "group space-y-6 pb-6 overflow-y-auto",
|
|
@@ -8988,8 +9272,8 @@ var DataForm = (props) => {
|
|
|
8988
9272
|
}
|
|
8989
9273
|
}
|
|
8990
9274
|
},
|
|
8991
|
-
children: /* @__PURE__ */ (0,
|
|
8992
|
-
return /* @__PURE__ */ (0,
|
|
9275
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "flex flex-col gap-6", children: props.sections?.map((section, sectionIndex) => {
|
|
9276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react66.default.Fragment, { children: !section.isChildSection && /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: " rounded-b-lg bg-white shadow border-neutral-200 border px-8 py-6 ", children: [
|
|
8993
9277
|
section.sectionRows?.map(
|
|
8994
9278
|
(sectionRow, sectionRowIndex) => {
|
|
8995
9279
|
const elementsCount = sectionRow.elements.length;
|
|
@@ -9000,14 +9284,14 @@ var DataForm = (props) => {
|
|
|
9000
9284
|
sectionRow.visible
|
|
9001
9285
|
);
|
|
9002
9286
|
}
|
|
9003
|
-
return /* @__PURE__ */ (0,
|
|
9004
|
-
return /* @__PURE__ */ (0,
|
|
9287
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react66.default.Fragment, { children: isVisible && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "lg:flex gap-14 flex-1 mb-4 ", children: sectionRow.elements.map((field, index) => {
|
|
9288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(
|
|
9005
9289
|
"div",
|
|
9006
9290
|
{
|
|
9007
9291
|
className: sectionRow.grow ? "grow" : "",
|
|
9008
9292
|
children: [
|
|
9009
|
-
/* @__PURE__ */ (0,
|
|
9010
|
-
/* @__PURE__ */ (0,
|
|
9293
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { children: field.controlType }),
|
|
9294
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
9011
9295
|
InputControl_default,
|
|
9012
9296
|
{
|
|
9013
9297
|
name: field.name,
|
|
@@ -9037,12 +9321,12 @@ var DataForm = (props) => {
|
|
|
9037
9321
|
}) }) }, sectionRowIndex);
|
|
9038
9322
|
}
|
|
9039
9323
|
),
|
|
9040
|
-
/* @__PURE__ */ (0,
|
|
9324
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { children: section.childSections?.map(
|
|
9041
9325
|
(childSection, childSectionIndex) => {
|
|
9042
|
-
return /* @__PURE__ */ (0,
|
|
9326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { children: childSection.name && evalutateCondition(
|
|
9043
9327
|
formState.inputValues,
|
|
9044
9328
|
childSection.visible
|
|
9045
|
-
) && /* @__PURE__ */ (0,
|
|
9329
|
+
) && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
9046
9330
|
DataFormChildSection_default,
|
|
9047
9331
|
{
|
|
9048
9332
|
section: childSection,
|
|
@@ -9057,8 +9341,8 @@ var DataForm = (props) => {
|
|
|
9057
9341
|
}) })
|
|
9058
9342
|
}
|
|
9059
9343
|
),
|
|
9060
|
-
/* @__PURE__ */ (0,
|
|
9061
|
-
/* @__PURE__ */ (0,
|
|
9344
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "flex px-6 py-3 mt-2 mb-2 justify-end items-center gap-5", children: [
|
|
9345
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { children: props.additionalActions && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
9062
9346
|
Button_default,
|
|
9063
9347
|
{
|
|
9064
9348
|
ButtonType: "PrimaryHollow" /* Hollow */,
|
|
@@ -9066,7 +9350,7 @@ var DataForm = (props) => {
|
|
|
9066
9350
|
children: props.additionalActions.title
|
|
9067
9351
|
}
|
|
9068
9352
|
) }),
|
|
9069
|
-
/* @__PURE__ */ (0,
|
|
9353
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { children: props.onDelete && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
9070
9354
|
Button_default,
|
|
9071
9355
|
{
|
|
9072
9356
|
ButtonType: "PrimaryHollow" /* Hollow */,
|
|
@@ -9077,7 +9361,7 @@ var DataForm = (props) => {
|
|
|
9077
9361
|
children: "Delete"
|
|
9078
9362
|
}
|
|
9079
9363
|
) }),
|
|
9080
|
-
/* @__PURE__ */ (0,
|
|
9364
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { children: props.onClick && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
9081
9365
|
Button_default,
|
|
9082
9366
|
{
|
|
9083
9367
|
onValidate,
|
|
@@ -9095,7 +9379,7 @@ var DataForm_default = DataForm;
|
|
|
9095
9379
|
|
|
9096
9380
|
// src/components/dataForm/DataFormRenderer.tsx
|
|
9097
9381
|
init_ServiceClient();
|
|
9098
|
-
var
|
|
9382
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
9099
9383
|
function getAction(actions, code) {
|
|
9100
9384
|
return actions?.find((a) => a.actionCode === code);
|
|
9101
9385
|
}
|
|
@@ -9121,9 +9405,9 @@ var DataFormRenderer = ({
|
|
|
9121
9405
|
"Delete"
|
|
9122
9406
|
);
|
|
9123
9407
|
const hasDataItem = dataItem && Object.keys(dataItem).length > 0;
|
|
9124
|
-
return /* @__PURE__ */ (0,
|
|
9125
|
-
widgetProps && /* @__PURE__ */ (0,
|
|
9126
|
-
/* @__PURE__ */ (0,
|
|
9408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "flex-grow flex flex-col", children: [
|
|
9409
|
+
widgetProps && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(NavigationTabsV2_default, { tabs, params: widgetProps.params }),
|
|
9410
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
9127
9411
|
DataForm_default,
|
|
9128
9412
|
{
|
|
9129
9413
|
title: !isAddPage ? "Edit " + formDefinition.formTitle + "- v2" : "Add " + formDefinition.formTitle + "- v2",
|