@clyrex-digital/clyrex-controls-dev 0.8.1-dev.20260818060820 → 0.8.1-dev.20260824072352
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 +616 -311
- package/dist/index.mjs +101 -54
- package/dist/server.d.mts +17 -6
- package/dist/server.d.ts +17 -6
- package/dist/server.js +2717 -298
- package/dist/server.mjs +86 -52
- 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()}`,
|
|
@@ -5171,18 +5430,12 @@ var ViewControl = (props) => {
|
|
|
5171
5430
|
};
|
|
5172
5431
|
var ViewControl_default = ViewControl;
|
|
5173
5432
|
|
|
5174
|
-
// src/components/controls/edit/InputControl.tsx
|
|
5175
|
-
var import_dynamic5 = __toESM(require("next/dynamic"));
|
|
5176
|
-
var InputControl2 = (0, import_dynamic5.default)(() => Promise.resolve().then(() => (init_InputControlClient(), InputControlClient_exports)), {
|
|
5177
|
-
ssr: false
|
|
5178
|
-
});
|
|
5179
|
-
var InputControl_default = InputControl2;
|
|
5180
|
-
|
|
5181
5433
|
// src/index.ts
|
|
5434
|
+
init_InputControl();
|
|
5182
5435
|
init_InputControlType();
|
|
5183
5436
|
|
|
5184
5437
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
5185
|
-
var
|
|
5438
|
+
var import_react58 = __toESM(require("react"));
|
|
5186
5439
|
|
|
5187
5440
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
5188
5441
|
var import_react44 = __toESM(require("react"));
|
|
@@ -5956,7 +6209,7 @@ var WidgetNode_default = WidgetNode;
|
|
|
5956
6209
|
|
|
5957
6210
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
5958
6211
|
var import_dynamic12 = __toESM(require("next/dynamic"));
|
|
5959
|
-
var
|
|
6212
|
+
var import_react57 = __toESM(require("react"));
|
|
5960
6213
|
|
|
5961
6214
|
// src/components/pageRenderingEngine/nodes/EmbedNode.tsx
|
|
5962
6215
|
var import_dynamic9 = __toESM(require("next/dynamic"));
|
|
@@ -7071,8 +7324,11 @@ var GoogleMapNode = (props) => {
|
|
|
7071
7324
|
var GoogleMapNode_default = GoogleMapNode;
|
|
7072
7325
|
|
|
7073
7326
|
// src/components/pageRenderingEngine/nodes/DivContainer.tsx
|
|
7074
|
-
var
|
|
7327
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
7075
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
|
+
});
|
|
7076
7332
|
var Slider2 = (0, import_dynamic12.default)(() => Promise.resolve().then(() => (init_Slider(), Slider_exports)), {
|
|
7077
7333
|
ssr: false
|
|
7078
7334
|
});
|
|
@@ -7327,7 +7583,7 @@ var DivContainer = async (props) => {
|
|
|
7327
7583
|
response = await serviceClient.get(endpoint);
|
|
7328
7584
|
result = response?.result;
|
|
7329
7585
|
if (dataBindingProperties.showNoResultsMessage && (result === void 0 || result.length == 0)) {
|
|
7330
|
-
return /* @__PURE__ */ (0,
|
|
7586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(NoDataFound_default, {});
|
|
7331
7587
|
}
|
|
7332
7588
|
if (dataBindingProperties.childCollectionName && props.dataitem) {
|
|
7333
7589
|
childCollectionData = getNestedValue6(
|
|
@@ -7347,7 +7603,7 @@ var DivContainer = async (props) => {
|
|
|
7347
7603
|
}
|
|
7348
7604
|
const SelectedNode = NodeTypes2[node.type];
|
|
7349
7605
|
if (!SelectedNode) return null;
|
|
7350
|
-
return /* @__PURE__ */ (0,
|
|
7606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_react57.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7351
7607
|
SelectedNode,
|
|
7352
7608
|
{
|
|
7353
7609
|
node,
|
|
@@ -7480,45 +7736,91 @@ var DivContainer = async (props) => {
|
|
|
7480
7736
|
noLinkColor && "no-link-color",
|
|
7481
7737
|
!!props.node.enterAnimation && "enter-animation"
|
|
7482
7738
|
].filter(Boolean).join(" ");
|
|
7483
|
-
|
|
7484
|
-
|
|
7739
|
+
const showDataBindingControls = Boolean(
|
|
7740
|
+
dataBindingProperties?.showFacets || dataBindingProperties?.showSortOptions || dataBindingProperties?.showSearchBar
|
|
7741
|
+
);
|
|
7742
|
+
const WrapperComponent = Wrapper;
|
|
7743
|
+
const renderedContainer = /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7744
|
+
WrapperComponent,
|
|
7745
|
+
{
|
|
7746
|
+
id: guid,
|
|
7747
|
+
style: combinedStyles,
|
|
7748
|
+
className: classNames || void 0,
|
|
7749
|
+
...wrapperProps,
|
|
7750
|
+
children: dataToRender.map(
|
|
7751
|
+
(item, idx) => item?.links?.view && renderLink ? renderChildren(
|
|
7752
|
+
props.node.children,
|
|
7753
|
+
props,
|
|
7754
|
+
item,
|
|
7755
|
+
idx,
|
|
7756
|
+
props.href ? void 0 : item?.links?.view
|
|
7757
|
+
)?.map((child, i) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_react57.default.Fragment, { children: child }, i)) : renderChildren(props.node.children, props, item, idx)
|
|
7758
|
+
)
|
|
7759
|
+
}
|
|
7760
|
+
);
|
|
7761
|
+
const paginationControl = dataBindingProperties?.enablePagination ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7762
|
+
Pagination2,
|
|
7763
|
+
{
|
|
7764
|
+
path: props.path,
|
|
7765
|
+
query: props.query,
|
|
7766
|
+
dataset: response
|
|
7767
|
+
}
|
|
7768
|
+
) : null;
|
|
7769
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_react57.default.Fragment, { children: [
|
|
7770
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7485
7771
|
"style",
|
|
7486
7772
|
{
|
|
7487
7773
|
dangerouslySetInnerHTML: { __html: cssResult.css + animationCSS }
|
|
7488
7774
|
}
|
|
7489
7775
|
),
|
|
7490
|
-
/* @__PURE__ */ (0,
|
|
7491
|
-
|
|
7492
|
-
|
|
7493
|
-
|
|
7494
|
-
|
|
7495
|
-
|
|
7496
|
-
|
|
7497
|
-
|
|
7498
|
-
|
|
7499
|
-
|
|
7500
|
-
|
|
7501
|
-
|
|
7502
|
-
|
|
7503
|
-
|
|
7504
|
-
|
|
7505
|
-
|
|
7506
|
-
|
|
7507
|
-
|
|
7508
|
-
|
|
7509
|
-
|
|
7510
|
-
|
|
7511
|
-
|
|
7512
|
-
|
|
7513
|
-
|
|
7514
|
-
|
|
7515
|
-
|
|
7776
|
+
showDataBindingControls ? /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_react57.default.Fragment, { children: [
|
|
7777
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7778
|
+
DataBindingControls2,
|
|
7779
|
+
{
|
|
7780
|
+
mode: "toolbar",
|
|
7781
|
+
path: props.path,
|
|
7782
|
+
query: props.query,
|
|
7783
|
+
facets: response?.facets,
|
|
7784
|
+
sortOptions: response?.sortOptions,
|
|
7785
|
+
showSortOptions: dataBindingProperties?.showSortOptions,
|
|
7786
|
+
showSearchBar: dataBindingProperties?.showSearchBar
|
|
7787
|
+
}
|
|
7788
|
+
),
|
|
7789
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
7790
|
+
"div",
|
|
7791
|
+
{
|
|
7792
|
+
className: dataBindingProperties?.showFacets ? "grid items-start gap-6 lg:grid-cols-[minmax(0,1fr)_18rem]" : void 0,
|
|
7793
|
+
children: [
|
|
7794
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "min-w-0", children: [
|
|
7795
|
+
renderedContainer,
|
|
7796
|
+
paginationControl
|
|
7797
|
+
] }),
|
|
7798
|
+
dataBindingProperties?.showFacets && /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("aside", { className: "border bg-default p-3 lg:sticky lg:top-[90px] lg:self-start", children: [
|
|
7799
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("h2", { className: "mb-2 text-lg font-semibold", children: "Filters" }),
|
|
7800
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7801
|
+
DataBindingControls2,
|
|
7802
|
+
{
|
|
7803
|
+
mode: "facets",
|
|
7804
|
+
path: props.path,
|
|
7805
|
+
query: props.query,
|
|
7806
|
+
facets: response?.facets,
|
|
7807
|
+
showFacets: dataBindingProperties.showFacets
|
|
7808
|
+
}
|
|
7809
|
+
)
|
|
7810
|
+
] })
|
|
7811
|
+
]
|
|
7812
|
+
}
|
|
7813
|
+
)
|
|
7814
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_react57.default.Fragment, { children: [
|
|
7815
|
+
renderedContainer,
|
|
7816
|
+
paginationControl && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { children: paginationControl })
|
|
7817
|
+
] })
|
|
7516
7818
|
] });
|
|
7517
7819
|
};
|
|
7518
7820
|
var DivContainer_default = DivContainer;
|
|
7519
7821
|
|
|
7520
7822
|
// src/components/pageRenderingEngine/PageBodyRenderer.tsx
|
|
7521
|
-
var
|
|
7823
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
7522
7824
|
var NodeTypes = {
|
|
7523
7825
|
["paragraph"]: ParagraphNode_default,
|
|
7524
7826
|
["heading"]: HeadingNode_default,
|
|
@@ -7556,14 +7858,14 @@ var PageBodyRenderer = (props) => {
|
|
|
7556
7858
|
}
|
|
7557
7859
|
return true;
|
|
7558
7860
|
};
|
|
7559
|
-
return /* @__PURE__ */ (0,
|
|
7861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_react58.default.Fragment, { children: rootNode && rootNode?.children?.map((node, index) => {
|
|
7560
7862
|
{
|
|
7561
7863
|
}
|
|
7562
7864
|
const SelectedNode = NodeTypes[node.type];
|
|
7563
7865
|
if (!shouldRenderNode(node)) {
|
|
7564
7866
|
return null;
|
|
7565
7867
|
}
|
|
7566
|
-
return /* @__PURE__ */ (0,
|
|
7868
|
+
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)(
|
|
7567
7869
|
SelectedNode,
|
|
7568
7870
|
{
|
|
7569
7871
|
node,
|
|
@@ -7579,7 +7881,7 @@ var PageBodyRenderer = (props) => {
|
|
|
7579
7881
|
device: props.device,
|
|
7580
7882
|
widgetRenderer: props.widgetRenderer
|
|
7581
7883
|
}
|
|
7582
|
-
) }) : /* @__PURE__ */ (0,
|
|
7884
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_react58.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7583
7885
|
SelectedNode,
|
|
7584
7886
|
{
|
|
7585
7887
|
node,
|
|
@@ -7600,10 +7902,10 @@ var PageBodyRenderer = (props) => {
|
|
|
7600
7902
|
var PageBodyRenderer_default = PageBodyRenderer;
|
|
7601
7903
|
|
|
7602
7904
|
// src/components/pageRenderingEngine/EnterAnimationHydrator.tsx
|
|
7603
|
-
var
|
|
7905
|
+
var import_react59 = require("react");
|
|
7604
7906
|
var ENTER_ANIMATION_SELECTOR = ".enter-animation";
|
|
7605
7907
|
function EnterAnimationHydrator() {
|
|
7606
|
-
(0,
|
|
7908
|
+
(0, import_react59.useEffect)(() => {
|
|
7607
7909
|
let observer;
|
|
7608
7910
|
const observedElements = /* @__PURE__ */ new WeakSet();
|
|
7609
7911
|
const revealAnimatedElements = () => {
|
|
@@ -7648,22 +7950,22 @@ function EnterAnimationHydrator() {
|
|
|
7648
7950
|
}
|
|
7649
7951
|
|
|
7650
7952
|
// src/components/Toast.tsx
|
|
7651
|
-
var
|
|
7953
|
+
var import_react60 = require("react");
|
|
7652
7954
|
init_ToastService();
|
|
7653
|
-
var
|
|
7955
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
7654
7956
|
var Toast = () => {
|
|
7655
|
-
const [showToast, setShowToast] = (0,
|
|
7656
|
-
const [message, setMessage] = (0,
|
|
7657
|
-
const [messageType, setMessageType] = (0,
|
|
7658
|
-
const timeoutRef = (0,
|
|
7659
|
-
const closeToast = (0,
|
|
7957
|
+
const [showToast, setShowToast] = (0, import_react60.useState)(false);
|
|
7958
|
+
const [message, setMessage] = (0, import_react60.useState)("");
|
|
7959
|
+
const [messageType, setMessageType] = (0, import_react60.useState)("error");
|
|
7960
|
+
const timeoutRef = (0, import_react60.useRef)(null);
|
|
7961
|
+
const closeToast = (0, import_react60.useCallback)(() => {
|
|
7660
7962
|
if (timeoutRef.current) {
|
|
7661
7963
|
clearTimeout(timeoutRef.current);
|
|
7662
7964
|
timeoutRef.current = null;
|
|
7663
7965
|
}
|
|
7664
7966
|
setShowToast(false);
|
|
7665
7967
|
}, []);
|
|
7666
|
-
const showMessage = (0,
|
|
7968
|
+
const showMessage = (0, import_react60.useCallback)((message2, messageType2) => {
|
|
7667
7969
|
if (timeoutRef.current) {
|
|
7668
7970
|
clearTimeout(timeoutRef.current);
|
|
7669
7971
|
}
|
|
@@ -7675,7 +7977,7 @@ var Toast = () => {
|
|
|
7675
7977
|
timeoutRef.current = null;
|
|
7676
7978
|
}, 4e3);
|
|
7677
7979
|
}, []);
|
|
7678
|
-
(0,
|
|
7980
|
+
(0, import_react60.useEffect)(() => {
|
|
7679
7981
|
ToastService_default.initialize(showMessage, closeToast);
|
|
7680
7982
|
return () => {
|
|
7681
7983
|
closeToast();
|
|
@@ -7684,8 +7986,8 @@ var Toast = () => {
|
|
|
7684
7986
|
});
|
|
7685
7987
|
};
|
|
7686
7988
|
}, [closeToast, showMessage]);
|
|
7687
|
-
return /* @__PURE__ */ (0,
|
|
7688
|
-
/* @__PURE__ */ (0,
|
|
7989
|
+
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: [
|
|
7990
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
7689
7991
|
"span",
|
|
7690
7992
|
{
|
|
7691
7993
|
className: "font-medium text-inherit text-sm",
|
|
@@ -7693,7 +7995,7 @@ var Toast = () => {
|
|
|
7693
7995
|
children: message
|
|
7694
7996
|
}
|
|
7695
7997
|
),
|
|
7696
|
-
/* @__PURE__ */ (0,
|
|
7998
|
+
/* @__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)(
|
|
7697
7999
|
"svg",
|
|
7698
8000
|
{
|
|
7699
8001
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7701,7 +8003,7 @@ var Toast = () => {
|
|
|
7701
8003
|
fill: "none",
|
|
7702
8004
|
viewBox: "0 0 24 24",
|
|
7703
8005
|
stroke: "currentColor",
|
|
7704
|
-
children: /* @__PURE__ */ (0,
|
|
8006
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M6 18L18 6M6 6l12 12" })
|
|
7705
8007
|
}
|
|
7706
8008
|
) })
|
|
7707
8009
|
] }) }) });
|
|
@@ -7731,8 +8033,8 @@ init_Switcher();
|
|
|
7731
8033
|
|
|
7732
8034
|
// src/components/NavigationTabsV2.tsx
|
|
7733
8035
|
var import_link3 = __toESM(require("next/link"));
|
|
7734
|
-
var
|
|
7735
|
-
var
|
|
8036
|
+
var import_navigation2 = require("next/navigation");
|
|
8037
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
7736
8038
|
function resolveRoutePlaceholders(route, params) {
|
|
7737
8039
|
return route.replace(/\{([^}]+)\}/g, (match, key) => {
|
|
7738
8040
|
const value = params[key];
|
|
@@ -7744,7 +8046,7 @@ function resolveRoutePlaceholders(route, params) {
|
|
|
7744
8046
|
});
|
|
7745
8047
|
}
|
|
7746
8048
|
var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
7747
|
-
const pathname = (0,
|
|
8049
|
+
const pathname = (0, import_navigation2.usePathname)();
|
|
7748
8050
|
const shouldHideTabs = pathname?.includes("/add");
|
|
7749
8051
|
if (shouldHideTabs) return null;
|
|
7750
8052
|
const mappedTabs = tabs?.sort((a, b) => a.displayOrder - b.displayOrder)?.map((tab) => ({
|
|
@@ -7757,8 +8059,8 @@ var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
|
7757
8059
|
isActive: tab.isActive
|
|
7758
8060
|
})) || [];
|
|
7759
8061
|
if (mappedTabs.length === 0) return null;
|
|
7760
|
-
return /* @__PURE__ */ (0,
|
|
7761
|
-
return /* @__PURE__ */ (0,
|
|
8062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "flex border-b bg-white rounded-t mb-3", children: mappedTabs.map(({ tabTitle, landingPageUrl, isActive }) => {
|
|
8063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_link3.default, { href: landingPageUrl, className: "-mb-px", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
7762
8064
|
"div",
|
|
7763
8065
|
{
|
|
7764
8066
|
className: `text-sm font-medium border-b-2 px-6 py-2 transition
|
|
@@ -7771,14 +8073,15 @@ var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
|
7771
8073
|
var NavigationTabsV2_default = NavigationTabsV2;
|
|
7772
8074
|
|
|
7773
8075
|
// src/components/dataForm/DataList.tsx
|
|
7774
|
-
var
|
|
7775
|
-
|
|
8076
|
+
var import_react63 = __toESM(require("react"));
|
|
8077
|
+
init_InputControl();
|
|
8078
|
+
var import_navigation3 = require("next/navigation");
|
|
7776
8079
|
|
|
7777
8080
|
// src/components/dataForm/NoContentView.tsx
|
|
7778
|
-
var
|
|
7779
|
-
var
|
|
8081
|
+
var import_react61 = __toESM(require("react"));
|
|
8082
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
7780
8083
|
var NoContentView = (props) => {
|
|
7781
|
-
return /* @__PURE__ */ (0,
|
|
8084
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_react61.default.Fragment, { children: props.isDataFound === false && props.children });
|
|
7782
8085
|
};
|
|
7783
8086
|
var NoContentView_default = NoContentView;
|
|
7784
8087
|
|
|
@@ -7786,39 +8089,39 @@ var NoContentView_default = NoContentView;
|
|
|
7786
8089
|
init_InputControlType();
|
|
7787
8090
|
|
|
7788
8091
|
// src/components/dataForm/ContentView.tsx
|
|
7789
|
-
var
|
|
7790
|
-
var
|
|
8092
|
+
var import_react62 = __toESM(require("react"));
|
|
8093
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
7791
8094
|
var ContentView = (props) => {
|
|
7792
|
-
return /* @__PURE__ */ (0,
|
|
7793
|
-
props.isDataFound == null && /* @__PURE__ */ (0,
|
|
7794
|
-
/* @__PURE__ */ (0,
|
|
7795
|
-
/* @__PURE__ */ (0,
|
|
7796
|
-
/* @__PURE__ */ (0,
|
|
7797
|
-
/* @__PURE__ */ (0,
|
|
7798
|
-
/* @__PURE__ */ (0,
|
|
8095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(import_react62.default.Fragment, { children: [
|
|
8096
|
+
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: [
|
|
8097
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
8098
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
8099
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "ml-2", children: [
|
|
8100
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 h-3 w-16 animate-pulse" }),
|
|
8101
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 h-2 w-12 animate-pulse" })
|
|
7799
8102
|
] })
|
|
7800
8103
|
] }),
|
|
7801
|
-
/* @__PURE__ */ (0,
|
|
7802
|
-
/* @__PURE__ */ (0,
|
|
7803
|
-
/* @__PURE__ */ (0,
|
|
7804
|
-
/* @__PURE__ */ (0,
|
|
7805
|
-
/* @__PURE__ */ (0,
|
|
7806
|
-
/* @__PURE__ */ (0,
|
|
7807
|
-
/* @__PURE__ */ (0,
|
|
8104
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "grid grid-cols-3 gap-4 mt-6", children: [
|
|
8105
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "animate-pulse", children: [
|
|
8106
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
8107
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
8108
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
8109
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
8110
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
7808
8111
|
] }),
|
|
7809
|
-
/* @__PURE__ */ (0,
|
|
7810
|
-
/* @__PURE__ */ (0,
|
|
7811
|
-
/* @__PURE__ */ (0,
|
|
7812
|
-
/* @__PURE__ */ (0,
|
|
7813
|
-
/* @__PURE__ */ (0,
|
|
7814
|
-
/* @__PURE__ */ (0,
|
|
8112
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "animate-pulse", children: [
|
|
8113
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
8114
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
8115
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
8116
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
8117
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
7815
8118
|
] }),
|
|
7816
|
-
/* @__PURE__ */ (0,
|
|
7817
|
-
/* @__PURE__ */ (0,
|
|
7818
|
-
/* @__PURE__ */ (0,
|
|
7819
|
-
/* @__PURE__ */ (0,
|
|
7820
|
-
/* @__PURE__ */ (0,
|
|
7821
|
-
/* @__PURE__ */ (0,
|
|
8119
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "animate-pulse", children: [
|
|
8120
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-12 mb-2" }),
|
|
8121
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-24 mb-2" }),
|
|
8122
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-32 mb-2" }),
|
|
8123
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-16 mb-2" }),
|
|
8124
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "bg-gray-300 rounded-full h-3 w-28 mb-2" })
|
|
7822
8125
|
] })
|
|
7823
8126
|
] })
|
|
7824
8127
|
] }) }),
|
|
@@ -7878,17 +8181,17 @@ function FormReducer(state, action) {
|
|
|
7878
8181
|
var FormReducer_default = FormReducer;
|
|
7879
8182
|
|
|
7880
8183
|
// src/components/dataForm/DataList.tsx
|
|
7881
|
-
var
|
|
8184
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
7882
8185
|
var DataList = (props) => {
|
|
7883
|
-
const router = (0,
|
|
8186
|
+
const router = (0, import_navigation3.useRouter)();
|
|
7884
8187
|
let builder = new OdataBuilder(props.path);
|
|
7885
8188
|
let orderBy = "";
|
|
7886
8189
|
let activePageNumber = 0;
|
|
7887
8190
|
let pages = 0;
|
|
7888
8191
|
console.log(props.addLinkText);
|
|
7889
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
7890
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
7891
|
-
(0,
|
|
8192
|
+
const [isDataFound, setIsDataFound] = (0, import_react63.useState)(null);
|
|
8193
|
+
const [searchTerm, setSearchTerm] = (0, import_react63.useState)(props.query?.searchTerm ?? "");
|
|
8194
|
+
(0, import_react63.useEffect)(() => {
|
|
7892
8195
|
if (props?.dataset) {
|
|
7893
8196
|
if (props?.dataset.result && props.dataset.result.length > 0) {
|
|
7894
8197
|
setIsDataFound(true);
|
|
@@ -7897,7 +8200,7 @@ var DataList = (props) => {
|
|
|
7897
8200
|
}
|
|
7898
8201
|
}
|
|
7899
8202
|
}, [props.dataset]);
|
|
7900
|
-
(0,
|
|
8203
|
+
(0, import_react63.useEffect)(() => {
|
|
7901
8204
|
if (!props.query?.["$filter"] || !props.filters) return;
|
|
7902
8205
|
const filterQuery = props.query["$filter"];
|
|
7903
8206
|
props.filters.forEach((filter) => {
|
|
@@ -7916,7 +8219,7 @@ var DataList = (props) => {
|
|
|
7916
8219
|
if (path.includes(".")) {
|
|
7917
8220
|
return path.split(".").reduce((prev, curr) => prev ? prev[curr] : null, obj);
|
|
7918
8221
|
} else if (Array.isArray(obj[path])) {
|
|
7919
|
-
return obj[path].map((item, index) => /* @__PURE__ */ (0,
|
|
8222
|
+
return obj[path].map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { children: item }, index));
|
|
7920
8223
|
} else {
|
|
7921
8224
|
return obj[path];
|
|
7922
8225
|
}
|
|
@@ -7925,11 +8228,11 @@ var DataList = (props) => {
|
|
|
7925
8228
|
inputValues: {},
|
|
7926
8229
|
lastPropertyChanged: ""
|
|
7927
8230
|
};
|
|
7928
|
-
const [formState, dispatch] = (0,
|
|
8231
|
+
const [formState, dispatch] = (0, import_react63.useReducer)(FormReducer_default, initialState);
|
|
7929
8232
|
const getSearchableColumns = () => {
|
|
7930
8233
|
return props.columns?.filter((c) => c.isSearchable)?.map((c) => c.name)?.join(",");
|
|
7931
8234
|
};
|
|
7932
|
-
const handleFilterChange = (0,
|
|
8235
|
+
const handleFilterChange = (0, import_react63.useCallback)(
|
|
7933
8236
|
(updatedValues) => {
|
|
7934
8237
|
dispatch({
|
|
7935
8238
|
type: FORM_INPUT_UPDATE,
|
|
@@ -7960,7 +8263,7 @@ var DataList = (props) => {
|
|
|
7960
8263
|
},
|
|
7961
8264
|
[dispatch, props, router]
|
|
7962
8265
|
);
|
|
7963
|
-
(0,
|
|
8266
|
+
(0, import_react63.useEffect)(() => {
|
|
7964
8267
|
if (!props.columns.some((col) => col.isSearchable)) {
|
|
7965
8268
|
return;
|
|
7966
8269
|
}
|
|
@@ -7995,30 +8298,30 @@ var DataList = (props) => {
|
|
|
7995
8298
|
const renderPageNumbers = () => {
|
|
7996
8299
|
if (pages <= 10) {
|
|
7997
8300
|
return Array.from({ length: pages }, (_, index) => index + 1).map(
|
|
7998
|
-
(page) => /* @__PURE__ */ (0,
|
|
8301
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react63.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
7999
8302
|
Hyperlink,
|
|
8000
8303
|
{
|
|
8001
8304
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
8002
8305
|
href: builder.getNewPageUrl(page),
|
|
8003
8306
|
children: page
|
|
8004
8307
|
}
|
|
8005
|
-
) : /* @__PURE__ */ (0,
|
|
8308
|
+
) : /* @__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)
|
|
8006
8309
|
);
|
|
8007
8310
|
} else {
|
|
8008
8311
|
const showFirstPages = activePageNumber <= 5;
|
|
8009
8312
|
const showLastPages = activePageNumber > pages - 5;
|
|
8010
8313
|
if (showFirstPages) {
|
|
8011
|
-
return /* @__PURE__ */ (0,
|
|
8012
|
-
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0,
|
|
8314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_jsx_runtime85.Fragment, { children: [
|
|
8315
|
+
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)(
|
|
8013
8316
|
Hyperlink,
|
|
8014
8317
|
{
|
|
8015
8318
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
8016
8319
|
href: builder.getNewPageUrl(page),
|
|
8017
8320
|
children: page
|
|
8018
8321
|
}
|
|
8019
|
-
) : /* @__PURE__ */ (0,
|
|
8020
|
-
/* @__PURE__ */ (0,
|
|
8021
|
-
/* @__PURE__ */ (0,
|
|
8322
|
+
) : /* @__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)),
|
|
8323
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
8324
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8022
8325
|
Hyperlink,
|
|
8023
8326
|
{
|
|
8024
8327
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -8026,7 +8329,7 @@ var DataList = (props) => {
|
|
|
8026
8329
|
children: pages - 1
|
|
8027
8330
|
}
|
|
8028
8331
|
),
|
|
8029
|
-
/* @__PURE__ */ (0,
|
|
8332
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8030
8333
|
Hyperlink,
|
|
8031
8334
|
{
|
|
8032
8335
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -8034,7 +8337,7 @@ var DataList = (props) => {
|
|
|
8034
8337
|
children: pages
|
|
8035
8338
|
}
|
|
8036
8339
|
),
|
|
8037
|
-
/* @__PURE__ */ (0,
|
|
8340
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "relative inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
8038
8341
|
"select",
|
|
8039
8342
|
{
|
|
8040
8343
|
className: " py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -8046,18 +8349,18 @@ var DataList = (props) => {
|
|
|
8046
8349
|
}
|
|
8047
8350
|
},
|
|
8048
8351
|
children: [
|
|
8049
|
-
/* @__PURE__ */ (0,
|
|
8352
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("option", { className: "", value: "", children: "Jump to" }),
|
|
8050
8353
|
Array.from(
|
|
8051
8354
|
{ length: Math.max(0, pages - 10) },
|
|
8052
8355
|
(_, index) => index + 9
|
|
8053
|
-
).map((page) => /* @__PURE__ */ (0,
|
|
8356
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("option", { value: page, children: page }, page))
|
|
8054
8357
|
]
|
|
8055
8358
|
}
|
|
8056
8359
|
) })
|
|
8057
8360
|
] });
|
|
8058
8361
|
} else if (showLastPages) {
|
|
8059
|
-
return /* @__PURE__ */ (0,
|
|
8060
|
-
/* @__PURE__ */ (0,
|
|
8362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_jsx_runtime85.Fragment, { children: [
|
|
8363
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8061
8364
|
Hyperlink,
|
|
8062
8365
|
{
|
|
8063
8366
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -8065,7 +8368,7 @@ var DataList = (props) => {
|
|
|
8065
8368
|
children: "1"
|
|
8066
8369
|
}
|
|
8067
8370
|
),
|
|
8068
|
-
/* @__PURE__ */ (0,
|
|
8371
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8069
8372
|
Hyperlink,
|
|
8070
8373
|
{
|
|
8071
8374
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -8073,21 +8376,21 @@ var DataList = (props) => {
|
|
|
8073
8376
|
children: "2"
|
|
8074
8377
|
}
|
|
8075
8378
|
),
|
|
8076
|
-
/* @__PURE__ */ (0,
|
|
8379
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
8077
8380
|
Array.from({ length: 8 }, (_, index) => pages - 7 + index).map(
|
|
8078
|
-
(page) => /* @__PURE__ */ (0,
|
|
8381
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react63.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8079
8382
|
Hyperlink,
|
|
8080
8383
|
{
|
|
8081
8384
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
8082
8385
|
href: builder.getNewPageUrl(page),
|
|
8083
8386
|
children: page
|
|
8084
8387
|
}
|
|
8085
|
-
) : /* @__PURE__ */ (0,
|
|
8388
|
+
) : /* @__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)
|
|
8086
8389
|
)
|
|
8087
8390
|
] });
|
|
8088
8391
|
} else {
|
|
8089
|
-
return /* @__PURE__ */ (0,
|
|
8090
|
-
/* @__PURE__ */ (0,
|
|
8392
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_jsx_runtime85.Fragment, { children: [
|
|
8393
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8091
8394
|
Hyperlink,
|
|
8092
8395
|
{
|
|
8093
8396
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -8095,7 +8398,7 @@ var DataList = (props) => {
|
|
|
8095
8398
|
children: "1"
|
|
8096
8399
|
}
|
|
8097
8400
|
),
|
|
8098
|
-
/* @__PURE__ */ (0,
|
|
8401
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8099
8402
|
Hyperlink,
|
|
8100
8403
|
{
|
|
8101
8404
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -8103,20 +8406,20 @@ var DataList = (props) => {
|
|
|
8103
8406
|
children: "2"
|
|
8104
8407
|
}
|
|
8105
8408
|
),
|
|
8106
|
-
/* @__PURE__ */ (0,
|
|
8409
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
8107
8410
|
Array.from(
|
|
8108
8411
|
{ length: 5 },
|
|
8109
8412
|
(_, index) => activePageNumber - 2 + index
|
|
8110
|
-
).map((page) => /* @__PURE__ */ (0,
|
|
8413
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react63.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8111
8414
|
Hyperlink,
|
|
8112
8415
|
{
|
|
8113
8416
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
8114
8417
|
href: builder.getNewPageUrl(page),
|
|
8115
8418
|
children: page
|
|
8116
8419
|
}
|
|
8117
|
-
) : /* @__PURE__ */ (0,
|
|
8118
|
-
/* @__PURE__ */ (0,
|
|
8119
|
-
/* @__PURE__ */ (0,
|
|
8420
|
+
) : /* @__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)),
|
|
8421
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
8422
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8120
8423
|
Hyperlink,
|
|
8121
8424
|
{
|
|
8122
8425
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -8124,7 +8427,7 @@ var DataList = (props) => {
|
|
|
8124
8427
|
children: pages - 1
|
|
8125
8428
|
}
|
|
8126
8429
|
),
|
|
8127
|
-
/* @__PURE__ */ (0,
|
|
8430
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8128
8431
|
Hyperlink,
|
|
8129
8432
|
{
|
|
8130
8433
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -8132,7 +8435,7 @@ var DataList = (props) => {
|
|
|
8132
8435
|
children: pages
|
|
8133
8436
|
}
|
|
8134
8437
|
),
|
|
8135
|
-
/* @__PURE__ */ (0,
|
|
8438
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "relative inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
8136
8439
|
"select",
|
|
8137
8440
|
{
|
|
8138
8441
|
className: "px-2 py-1 border border-gray-300 bg-white text-gray-700 appearance-none rounded-none",
|
|
@@ -8144,8 +8447,8 @@ var DataList = (props) => {
|
|
|
8144
8447
|
}
|
|
8145
8448
|
},
|
|
8146
8449
|
children: [
|
|
8147
|
-
/* @__PURE__ */ (0,
|
|
8148
|
-
Array.from({ length: pages - 4 }, (_, index) => index + 3).filter((page) => page > 2 && page < pages - 1).map((page) => /* @__PURE__ */ (0,
|
|
8450
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("option", { value: "", children: "Jump to" }),
|
|
8451
|
+
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))
|
|
8149
8452
|
]
|
|
8150
8453
|
}
|
|
8151
8454
|
) })
|
|
@@ -8153,16 +8456,16 @@ var DataList = (props) => {
|
|
|
8153
8456
|
}
|
|
8154
8457
|
}
|
|
8155
8458
|
};
|
|
8156
|
-
return /* @__PURE__ */ (0,
|
|
8157
|
-
/* @__PURE__ */ (0,
|
|
8158
|
-
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0,
|
|
8459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(import_react63.default.Fragment, { children: [
|
|
8460
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(ContentView_default, { isDataFound, children: [
|
|
8461
|
+
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
8159
8462
|
"div",
|
|
8160
8463
|
{
|
|
8161
8464
|
className: `flex justify-between items-center bg-white pl-6 pr-2 h-14 mb-3 shadow-sm rounded-md sticky top-0`,
|
|
8162
8465
|
children: [
|
|
8163
|
-
props.title ? /* @__PURE__ */ (0,
|
|
8164
|
-
/* @__PURE__ */ (0,
|
|
8165
|
-
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0,
|
|
8466
|
+
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", {}),
|
|
8467
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
8468
|
+
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8166
8469
|
InputControl_default,
|
|
8167
8470
|
{
|
|
8168
8471
|
name: "Search_input",
|
|
@@ -8174,7 +8477,7 @@ var DataList = (props) => {
|
|
|
8174
8477
|
}
|
|
8175
8478
|
}
|
|
8176
8479
|
),
|
|
8177
|
-
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0,
|
|
8480
|
+
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8178
8481
|
InputControl_default,
|
|
8179
8482
|
{
|
|
8180
8483
|
name: filter.name,
|
|
@@ -8189,15 +8492,15 @@ var DataList = (props) => {
|
|
|
8189
8492
|
},
|
|
8190
8493
|
filter.name
|
|
8191
8494
|
)),
|
|
8192
|
-
props.addLinkHref && /* @__PURE__ */ (0,
|
|
8495
|
+
props.addLinkHref && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
8193
8496
|
Hyperlink,
|
|
8194
8497
|
{
|
|
8195
8498
|
className: "gap-1",
|
|
8196
8499
|
linkType: "Primary" /* Solid */,
|
|
8197
8500
|
href: props.addLinkHref,
|
|
8198
8501
|
children: [
|
|
8199
|
-
/* @__PURE__ */ (0,
|
|
8200
|
-
/* @__PURE__ */ (0,
|
|
8502
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Icon_default, { name: "plus", className: "w-4 h-4" }),
|
|
8503
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "text-sm font-medium", children: props.addLinkText || "Add New" })
|
|
8201
8504
|
]
|
|
8202
8505
|
}
|
|
8203
8506
|
)
|
|
@@ -8205,8 +8508,8 @@ var DataList = (props) => {
|
|
|
8205
8508
|
]
|
|
8206
8509
|
}
|
|
8207
8510
|
),
|
|
8208
|
-
/* @__PURE__ */ (0,
|
|
8209
|
-
/* @__PURE__ */ (0,
|
|
8511
|
+
/* @__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: [
|
|
8512
|
+
/* @__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) => {
|
|
8210
8513
|
let url = builder.getNewOrderByUrl(column.name);
|
|
8211
8514
|
let icon = "chevronUpDown";
|
|
8212
8515
|
if (orderBy.includes(`${column.name} desc`)) {
|
|
@@ -8216,18 +8519,18 @@ var DataList = (props) => {
|
|
|
8216
8519
|
icon = "chevronUp";
|
|
8217
8520
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
8218
8521
|
}
|
|
8219
|
-
return /* @__PURE__ */ (0,
|
|
8522
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8220
8523
|
"th",
|
|
8221
8524
|
{
|
|
8222
8525
|
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" : ""),
|
|
8223
|
-
children: /* @__PURE__ */ (0,
|
|
8526
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8224
8527
|
Hyperlink,
|
|
8225
8528
|
{
|
|
8226
8529
|
href: column.enableSorting ? url : void 0,
|
|
8227
8530
|
className: "!text-neutral-contrast ",
|
|
8228
|
-
children: /* @__PURE__ */ (0,
|
|
8229
|
-
/* @__PURE__ */ (0,
|
|
8230
|
-
column.enableSorting && /* @__PURE__ */ (0,
|
|
8531
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("span", { className: "flex items-center space-x-1", children: [
|
|
8532
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "text-black", children: column.label }),
|
|
8533
|
+
column.enableSorting && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Icon_default, { className: "w-4 h-4", name: icon })
|
|
8231
8534
|
] })
|
|
8232
8535
|
}
|
|
8233
8536
|
)
|
|
@@ -8235,22 +8538,22 @@ var DataList = (props) => {
|
|
|
8235
8538
|
column.name
|
|
8236
8539
|
);
|
|
8237
8540
|
}) }) }),
|
|
8238
|
-
/* @__PURE__ */ (0,
|
|
8541
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("tbody", { className: "divide-y divide-gray-200 ", children: props.dataset?.result?.map((dataitem, index) => {
|
|
8239
8542
|
let validityClass = "";
|
|
8240
8543
|
if (props.recordValidityColumnName && getNestedProperty2(dataitem, props.recordValidityColumnName) == false) {
|
|
8241
8544
|
validityClass = "bg-alert-200";
|
|
8242
8545
|
}
|
|
8243
|
-
return /* @__PURE__ */ (0,
|
|
8244
|
-
return /* @__PURE__ */ (0,
|
|
8546
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("tr", { className: validityClass, children: props?.columns?.map((column, colindex) => {
|
|
8547
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react63.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8245
8548
|
"td",
|
|
8246
8549
|
{
|
|
8247
8550
|
className: "px-6 py-2 whitespace-normal " + (column.controlType == ViewControlTypes_default.money ? "" : ""),
|
|
8248
|
-
children: column.addhref === true ? /* @__PURE__ */ (0,
|
|
8551
|
+
children: column.addhref === true ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8249
8552
|
Hyperlink,
|
|
8250
8553
|
{
|
|
8251
8554
|
className: "",
|
|
8252
8555
|
href: `https://${dataitem[column.name]}`,
|
|
8253
|
-
children: /* @__PURE__ */ (0,
|
|
8556
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8254
8557
|
ViewControl_default,
|
|
8255
8558
|
{
|
|
8256
8559
|
controlType: column.controlType,
|
|
@@ -8263,11 +8566,11 @@ var DataList = (props) => {
|
|
|
8263
8566
|
}
|
|
8264
8567
|
)
|
|
8265
8568
|
}
|
|
8266
|
-
) : column.showAsLink ? /* @__PURE__ */ (0,
|
|
8569
|
+
) : column.showAsLink ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8267
8570
|
Hyperlink,
|
|
8268
8571
|
{
|
|
8269
8572
|
href: props.path + dataitem[props.columns[0].name] + "/" + (dataitem.linkUrlSegment ?? column.linkUrlSegment),
|
|
8270
|
-
children: /* @__PURE__ */ (0,
|
|
8573
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8271
8574
|
ViewControl_default,
|
|
8272
8575
|
{
|
|
8273
8576
|
controlType: column.controlType,
|
|
@@ -8277,7 +8580,7 @@ var DataList = (props) => {
|
|
|
8277
8580
|
}
|
|
8278
8581
|
)
|
|
8279
8582
|
}
|
|
8280
|
-
) : /* @__PURE__ */ (0,
|
|
8583
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8281
8584
|
ViewControl_default,
|
|
8282
8585
|
{
|
|
8283
8586
|
controlType: column.controlType,
|
|
@@ -8291,10 +8594,10 @@ var DataList = (props) => {
|
|
|
8291
8594
|
}) }, index);
|
|
8292
8595
|
}) })
|
|
8293
8596
|
] }) }),
|
|
8294
|
-
/* @__PURE__ */ (0,
|
|
8295
|
-
/* @__PURE__ */ (0,
|
|
8296
|
-
/* @__PURE__ */ (0,
|
|
8297
|
-
activePageNumber > 1 && /* @__PURE__ */ (0,
|
|
8597
|
+
/* @__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: [
|
|
8598
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "text-gray-700", children: label }),
|
|
8599
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex space-x-2 items-center", children: [
|
|
8600
|
+
activePageNumber > 1 && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8298
8601
|
Hyperlink,
|
|
8299
8602
|
{
|
|
8300
8603
|
className: "px-3 py-1 rounded-l-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -8302,9 +8605,9 @@ var DataList = (props) => {
|
|
|
8302
8605
|
children: "Prev"
|
|
8303
8606
|
}
|
|
8304
8607
|
),
|
|
8305
|
-
activePageNumber <= 1 && /* @__PURE__ */ (0,
|
|
8608
|
+
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" }),
|
|
8306
8609
|
renderPageNumbers(),
|
|
8307
|
-
activePageNumber < pages && /* @__PURE__ */ (0,
|
|
8610
|
+
activePageNumber < pages && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8308
8611
|
Hyperlink,
|
|
8309
8612
|
{
|
|
8310
8613
|
className: "px-3 py-1 rounded-r-md border border-gray-300 bg-white text-gray-500 hover:bg-gray-200",
|
|
@@ -8312,19 +8615,19 @@ var DataList = (props) => {
|
|
|
8312
8615
|
children: "Next"
|
|
8313
8616
|
}
|
|
8314
8617
|
),
|
|
8315
|
-
activePageNumber >= pages && /* @__PURE__ */ (0,
|
|
8618
|
+
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" })
|
|
8316
8619
|
] })
|
|
8317
8620
|
] }) })
|
|
8318
8621
|
] }),
|
|
8319
|
-
/* @__PURE__ */ (0,
|
|
8320
|
-
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0,
|
|
8622
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(NoContentView_default, { isDataFound, children: [
|
|
8623
|
+
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
8321
8624
|
"div",
|
|
8322
8625
|
{
|
|
8323
8626
|
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`,
|
|
8324
8627
|
children: [
|
|
8325
|
-
props.title ? /* @__PURE__ */ (0,
|
|
8326
|
-
/* @__PURE__ */ (0,
|
|
8327
|
-
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0,
|
|
8628
|
+
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", {}),
|
|
8629
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
8630
|
+
props.columns.some((col) => col.isSearchable) && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8328
8631
|
InputControl_default,
|
|
8329
8632
|
{
|
|
8330
8633
|
name: "Search_input",
|
|
@@ -8336,7 +8639,7 @@ var DataList = (props) => {
|
|
|
8336
8639
|
}
|
|
8337
8640
|
}
|
|
8338
8641
|
),
|
|
8339
|
-
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0,
|
|
8642
|
+
props.filters && props.filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8340
8643
|
InputControl_default,
|
|
8341
8644
|
{
|
|
8342
8645
|
name: filter.name,
|
|
@@ -8351,15 +8654,15 @@ var DataList = (props) => {
|
|
|
8351
8654
|
},
|
|
8352
8655
|
filter.name
|
|
8353
8656
|
)),
|
|
8354
|
-
props.addLinkHref && /* @__PURE__ */ (0,
|
|
8657
|
+
props.addLinkHref && /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
8355
8658
|
Hyperlink,
|
|
8356
8659
|
{
|
|
8357
8660
|
className: "gap-1",
|
|
8358
8661
|
linkType: "Primary" /* Solid */,
|
|
8359
8662
|
href: props.addLinkHref,
|
|
8360
8663
|
children: [
|
|
8361
|
-
/* @__PURE__ */ (0,
|
|
8362
|
-
/* @__PURE__ */ (0,
|
|
8664
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Icon_default, { name: "plus", className: "w-4 h-4" }),
|
|
8665
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "text-sm font-medium", children: props.addLinkText || "Add New" })
|
|
8363
8666
|
]
|
|
8364
8667
|
}
|
|
8365
8668
|
)
|
|
@@ -8367,8 +8670,8 @@ var DataList = (props) => {
|
|
|
8367
8670
|
]
|
|
8368
8671
|
}
|
|
8369
8672
|
),
|
|
8370
|
-
/* @__PURE__ */ (0,
|
|
8371
|
-
/* @__PURE__ */ (0,
|
|
8673
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex-grow overflow-y-auto justify-end bg-white rounded shadow h-[75vh]", children: [
|
|
8674
|
+
/* @__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) => {
|
|
8372
8675
|
let url = builder.getNewOrderByUrl(column.name);
|
|
8373
8676
|
let icon = "chevronUpDown";
|
|
8374
8677
|
if (orderBy.includes(`${column.name} desc`)) {
|
|
@@ -8378,18 +8681,18 @@ var DataList = (props) => {
|
|
|
8378
8681
|
icon = "chevronUp";
|
|
8379
8682
|
url = builder.getNewOrderByUrl(column.name + " desc");
|
|
8380
8683
|
}
|
|
8381
|
-
return /* @__PURE__ */ (0,
|
|
8684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8382
8685
|
"th",
|
|
8383
8686
|
{
|
|
8384
8687
|
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" : ""),
|
|
8385
|
-
children: /* @__PURE__ */ (0,
|
|
8688
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8386
8689
|
Hyperlink,
|
|
8387
8690
|
{
|
|
8388
8691
|
href: column.enableSorting ? url : void 0,
|
|
8389
8692
|
className: "text-body-950",
|
|
8390
|
-
children: /* @__PURE__ */ (0,
|
|
8391
|
-
/* @__PURE__ */ (0,
|
|
8392
|
-
column.enableSorting && /* @__PURE__ */ (0,
|
|
8693
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("span", { className: "flex items-center space-x-1", children: [
|
|
8694
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { children: column.label }),
|
|
8695
|
+
column.enableSorting && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Icon_default, { className: "w-4 h-4", name: icon })
|
|
8393
8696
|
] })
|
|
8394
8697
|
}
|
|
8395
8698
|
)
|
|
@@ -8397,7 +8700,7 @@ var DataList = (props) => {
|
|
|
8397
8700
|
column.name
|
|
8398
8701
|
);
|
|
8399
8702
|
}) }) }) }) }),
|
|
8400
|
-
/* @__PURE__ */ (0,
|
|
8703
|
+
/* @__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." })
|
|
8401
8704
|
] })
|
|
8402
8705
|
] })
|
|
8403
8706
|
] });
|
|
@@ -8405,12 +8708,12 @@ var DataList = (props) => {
|
|
|
8405
8708
|
var DataList_default = DataList;
|
|
8406
8709
|
|
|
8407
8710
|
// src/components/dataForm/DataListRenderer.tsx
|
|
8408
|
-
var
|
|
8711
|
+
var import_react64 = __toESM(require("react"));
|
|
8409
8712
|
init_ServiceClient();
|
|
8410
8713
|
init_OdataBuilder();
|
|
8411
8714
|
init_SelectWithSearchInput();
|
|
8412
|
-
var
|
|
8413
|
-
var
|
|
8715
|
+
var import_navigation4 = require("next/navigation");
|
|
8716
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
8414
8717
|
var viewControlMap = {
|
|
8415
8718
|
number: ViewControlTypes.number,
|
|
8416
8719
|
lineText: ViewControlTypes.lineText,
|
|
@@ -8465,14 +8768,14 @@ var DataListRenderer = ({
|
|
|
8465
8768
|
widgetProps
|
|
8466
8769
|
}) => {
|
|
8467
8770
|
const serviceClient = new ServiceClient_default(apiBaseUrl, session);
|
|
8468
|
-
const [columns, setColumns] = (0,
|
|
8469
|
-
const [dataset, setDataset] = (0,
|
|
8470
|
-
const [filter, setFilters] = (0,
|
|
8471
|
-
const [addLinkHref, setAddLinkHref] = (0,
|
|
8472
|
-
const [addLinkText, setAddLinkText] = (0,
|
|
8473
|
-
const [serviceRoute, setServiceRoute] = (0,
|
|
8474
|
-
const pathname = (0,
|
|
8475
|
-
(0,
|
|
8771
|
+
const [columns, setColumns] = (0, import_react64.useState)([]);
|
|
8772
|
+
const [dataset, setDataset] = (0, import_react64.useState)();
|
|
8773
|
+
const [filter, setFilters] = (0, import_react64.useState)([]);
|
|
8774
|
+
const [addLinkHref, setAddLinkHref] = (0, import_react64.useState)("");
|
|
8775
|
+
const [addLinkText, setAddLinkText] = (0, import_react64.useState)("");
|
|
8776
|
+
const [serviceRoute, setServiceRoute] = (0, import_react64.useState)("");
|
|
8777
|
+
const pathname = (0, import_navigation4.usePathname)();
|
|
8778
|
+
(0, import_react64.useEffect)(() => {
|
|
8476
8779
|
if (!formDefinition) return;
|
|
8477
8780
|
setColumns(mapApiToColumns(formDefinition));
|
|
8478
8781
|
setFilters(mapApiToFilters(formDefinition));
|
|
@@ -8485,7 +8788,7 @@ var DataListRenderer = ({
|
|
|
8485
8788
|
setAddLinkHref(resolvedAddLinkHref);
|
|
8486
8789
|
setAddLinkText(formDefinition?.siteFormDataList?.addLinkText ?? "");
|
|
8487
8790
|
}, [formDefinition, params]);
|
|
8488
|
-
(0,
|
|
8791
|
+
(0, import_react64.useEffect)(() => {
|
|
8489
8792
|
const fetchData = async () => {
|
|
8490
8793
|
if (!serviceRoute) return;
|
|
8491
8794
|
const resolvedRoute = resolveRoutePlaceholders2(serviceRoute, params);
|
|
@@ -8505,13 +8808,13 @@ var DataListRenderer = ({
|
|
|
8505
8808
|
isActive: landingPageUrl === pathname
|
|
8506
8809
|
};
|
|
8507
8810
|
});
|
|
8508
|
-
return /* @__PURE__ */ (0,
|
|
8811
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_react64.default.Fragment, { children: [
|
|
8509
8812
|
resolvedTabs.length > 0 && // <NavigationTabsV2
|
|
8510
8813
|
// tabs={resolvedTabs}
|
|
8511
8814
|
// params={(widgetProps?.params ?? params) as Record<string, any>}
|
|
8512
8815
|
// />
|
|
8513
|
-
/* @__PURE__ */ (0,
|
|
8514
|
-
/* @__PURE__ */ (0,
|
|
8816
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(NavigationTabsV2_default, { tabs, params: widgetProps.params }),
|
|
8817
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
8515
8818
|
DataList_default,
|
|
8516
8819
|
{
|
|
8517
8820
|
addLinkHref,
|
|
@@ -8533,13 +8836,15 @@ var DataListRenderer_default = DataListRenderer;
|
|
|
8533
8836
|
init_InputControlType();
|
|
8534
8837
|
|
|
8535
8838
|
// src/components/dataForm/DataForm.tsx
|
|
8536
|
-
var
|
|
8839
|
+
var import_react66 = __toESM(require("react"));
|
|
8840
|
+
init_InputControl();
|
|
8537
8841
|
init_Icon();
|
|
8538
8842
|
init_Button();
|
|
8539
8843
|
init_StyleTypes();
|
|
8540
8844
|
|
|
8541
8845
|
// src/components/dataForm/DataFormChildSection.tsx
|
|
8542
|
-
var
|
|
8846
|
+
var import_react65 = __toESM(require("react"));
|
|
8847
|
+
init_InputControl();
|
|
8543
8848
|
|
|
8544
8849
|
// src/components/dataForm/StyleTypes.tsx
|
|
8545
8850
|
var StyleTypes2 = /* @__PURE__ */ ((StyleTypes3) => {
|
|
@@ -8566,7 +8871,7 @@ var FORM_CHILD_ONE_TO_ONE_UPDATE = "FORM_CHILD_ONE_TO_ONE_UPDATE";
|
|
|
8566
8871
|
var FORM_CHILD_ROW_ADD = "FORM_CHILD_ROW_ADD";
|
|
8567
8872
|
|
|
8568
8873
|
// src/components/dataForm/DataFormChildSection.tsx
|
|
8569
|
-
var
|
|
8874
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
8570
8875
|
var DataFormChildSection = (props) => {
|
|
8571
8876
|
const { section } = props;
|
|
8572
8877
|
const isOneToOne = section.relationshipType === "one-to-one";
|
|
@@ -8578,7 +8883,7 @@ var DataFormChildSection = (props) => {
|
|
|
8578
8883
|
return childItems.map((item, originalIndex) => ({ item, originalIndex })).filter((x) => !x.item.isDeleted) || [];
|
|
8579
8884
|
};
|
|
8580
8885
|
const childItemsToRender = getChildItemsForRendering();
|
|
8581
|
-
const handleChildInputChange = (0,
|
|
8886
|
+
const handleChildInputChange = (0, import_react65.useCallback)(
|
|
8582
8887
|
(updatedValues) => {
|
|
8583
8888
|
if (isOneToOne) {
|
|
8584
8889
|
props.callback({
|
|
@@ -8605,7 +8910,7 @@ var DataFormChildSection = (props) => {
|
|
|
8605
8910
|
},
|
|
8606
8911
|
[props, isOneToOne, childItemsToRender]
|
|
8607
8912
|
);
|
|
8608
|
-
const onAddRow = (0,
|
|
8913
|
+
const onAddRow = (0, import_react65.useCallback)(() => {
|
|
8609
8914
|
props.callback({
|
|
8610
8915
|
sectionName: props.section.name,
|
|
8611
8916
|
actionType: FORM_CHILD_ROW_ADD,
|
|
@@ -8614,7 +8919,7 @@ var DataFormChildSection = (props) => {
|
|
|
8614
8919
|
rowIndex: -1
|
|
8615
8920
|
});
|
|
8616
8921
|
}, [props]);
|
|
8617
|
-
const onDeleteRow = (0,
|
|
8922
|
+
const onDeleteRow = (0, import_react65.useCallback)(
|
|
8618
8923
|
(filteredIndex) => {
|
|
8619
8924
|
const visibleItem = childItemsToRender[filteredIndex];
|
|
8620
8925
|
if (visibleItem) {
|
|
@@ -8634,14 +8939,14 @@ var DataFormChildSection = (props) => {
|
|
|
8634
8939
|
childItemsToRender,
|
|
8635
8940
|
allChildItems: childItems
|
|
8636
8941
|
});
|
|
8637
|
-
return /* @__PURE__ */ (0,
|
|
8638
|
-
section.sectionTitle && /* @__PURE__ */ (0,
|
|
8639
|
-
/* @__PURE__ */ (0,
|
|
8640
|
-
/* @__PURE__ */ (0,
|
|
8641
|
-
(!isOneToOne || childItemsToRender.length > 0) && /* @__PURE__ */ (0,
|
|
8642
|
-
return /* @__PURE__ */ (0,
|
|
8942
|
+
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: [
|
|
8943
|
+
section.sectionTitle && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "mb-4 text-lg font-medium text-body-950", children: section.sectionTitle }),
|
|
8944
|
+
/* @__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: [
|
|
8945
|
+
/* @__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: [
|
|
8946
|
+
(!isOneToOne || childItemsToRender.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("thead", { className: "", children: section.sectionRows.map((sectionRow, sectionRowIndex) => {
|
|
8947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("tr", { className: "", children: [
|
|
8643
8948
|
sectionRow.elements.map((field, index) => {
|
|
8644
|
-
return /* @__PURE__ */ (0,
|
|
8949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
8645
8950
|
"th",
|
|
8646
8951
|
{
|
|
8647
8952
|
className: "py-3 font-normal text-left",
|
|
@@ -8650,21 +8955,21 @@ var DataFormChildSection = (props) => {
|
|
|
8650
8955
|
field.name
|
|
8651
8956
|
);
|
|
8652
8957
|
}),
|
|
8653
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */ (0,
|
|
8958
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("th", { className: "py-3 font-normal text-left", children: "Actions" })
|
|
8654
8959
|
] }, sectionRowIndex);
|
|
8655
8960
|
}) }),
|
|
8656
|
-
/* @__PURE__ */ (0,
|
|
8961
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("tbody", { className: "divide-y divide-gray-200", children: childItemsToRender.map((visibleItem, filteredIndex) => {
|
|
8657
8962
|
const { item, originalIndex } = visibleItem;
|
|
8658
8963
|
const rowKey = originalIndex;
|
|
8659
|
-
return /* @__PURE__ */ (0,
|
|
8964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react65.default.Fragment, { children: section.sectionRows.map(
|
|
8660
8965
|
(sectionRow, sectionRowIndex) => {
|
|
8661
|
-
return /* @__PURE__ */ (0,
|
|
8966
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
8662
8967
|
"tr",
|
|
8663
8968
|
{
|
|
8664
8969
|
className: "",
|
|
8665
8970
|
children: [
|
|
8666
8971
|
sectionRow.elements.map((field, index) => {
|
|
8667
|
-
return /* @__PURE__ */ (0,
|
|
8972
|
+
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)(
|
|
8668
8973
|
InputControl_default,
|
|
8669
8974
|
{
|
|
8670
8975
|
index: filteredIndex,
|
|
@@ -8684,7 +8989,7 @@ var DataFormChildSection = (props) => {
|
|
|
8684
8989
|
}
|
|
8685
8990
|
) }) }) }, field.name);
|
|
8686
8991
|
}),
|
|
8687
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */ (0,
|
|
8992
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
8688
8993
|
ClientButton_default,
|
|
8689
8994
|
{
|
|
8690
8995
|
ButtonType: StyleTypes2.Hollow,
|
|
@@ -8693,7 +8998,7 @@ var DataFormChildSection = (props) => {
|
|
|
8693
8998
|
},
|
|
8694
8999
|
dataRole: "delete",
|
|
8695
9000
|
tabIndex: -1,
|
|
8696
|
-
children: /* @__PURE__ */ (0,
|
|
9001
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
8697
9002
|
Icon_default,
|
|
8698
9003
|
{
|
|
8699
9004
|
className: "w-4 h-4",
|
|
@@ -8710,7 +9015,7 @@ var DataFormChildSection = (props) => {
|
|
|
8710
9015
|
) }, rowKey);
|
|
8711
9016
|
}) })
|
|
8712
9017
|
] }) }),
|
|
8713
|
-
!section.readonly && !isOneToOne && /* @__PURE__ */ (0,
|
|
9018
|
+
!section.readonly && !isOneToOne && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "ml-1", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
8714
9019
|
ClientButton_default,
|
|
8715
9020
|
{
|
|
8716
9021
|
ButtonType: "Link" /* Link */,
|
|
@@ -8725,9 +9030,9 @@ var DataFormChildSection = (props) => {
|
|
|
8725
9030
|
var DataFormChildSection_default = DataFormChildSection;
|
|
8726
9031
|
|
|
8727
9032
|
// src/components/dataForm/DataForm.tsx
|
|
8728
|
-
var
|
|
9033
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
8729
9034
|
var DataForm = (props) => {
|
|
8730
|
-
const formRef = (0,
|
|
9035
|
+
const formRef = (0, import_react66.useRef)(null);
|
|
8731
9036
|
console.log(props.dataItem, "dssads");
|
|
8732
9037
|
const initialState = {
|
|
8733
9038
|
inputValues: {},
|
|
@@ -8736,9 +9041,9 @@ var DataForm = (props) => {
|
|
|
8736
9041
|
const childInitialState = {
|
|
8737
9042
|
inputValues: []
|
|
8738
9043
|
};
|
|
8739
|
-
const [formState, dispatch] = (0,
|
|
9044
|
+
const [formState, dispatch] = (0, import_react66.useReducer)(FormReducer_default, initialState);
|
|
8740
9045
|
console.log(props.sections, "sections");
|
|
8741
|
-
const clearHiddenChildSections = (0,
|
|
9046
|
+
const clearHiddenChildSections = (0, import_react66.useCallback)(
|
|
8742
9047
|
(changedProperty, newValues) => {
|
|
8743
9048
|
if (!props.sections) return;
|
|
8744
9049
|
const allChildSections = [];
|
|
@@ -8776,7 +9081,7 @@ var DataForm = (props) => {
|
|
|
8776
9081
|
},
|
|
8777
9082
|
[props.sections, formState.inputValues]
|
|
8778
9083
|
);
|
|
8779
|
-
const handleInputChange = (0,
|
|
9084
|
+
const handleInputChange = (0, import_react66.useCallback)(
|
|
8780
9085
|
async (updatedValues) => {
|
|
8781
9086
|
dispatch({
|
|
8782
9087
|
type: FORM_INPUT_UPDATE,
|
|
@@ -8791,7 +9096,7 @@ var DataForm = (props) => {
|
|
|
8791
9096
|
},
|
|
8792
9097
|
[dispatch, formState.inputValues, clearHiddenChildSections]
|
|
8793
9098
|
);
|
|
8794
|
-
const fetchData = (0,
|
|
9099
|
+
const fetchData = (0, import_react66.useCallback)(async () => {
|
|
8795
9100
|
if (!props.rules) return;
|
|
8796
9101
|
if (Object.keys(formState.inputValues).length === 0) {
|
|
8797
9102
|
return;
|
|
@@ -8822,7 +9127,7 @@ var DataForm = (props) => {
|
|
|
8822
9127
|
console.error("Error fetching data:", error);
|
|
8823
9128
|
}
|
|
8824
9129
|
}, [formState.lastPropertyChanged, formState.inputValues]);
|
|
8825
|
-
(0,
|
|
9130
|
+
(0, import_react66.useEffect)(() => {
|
|
8826
9131
|
fetchData();
|
|
8827
9132
|
}, [formState.inputValues, formState.lastPropertyChanged]);
|
|
8828
9133
|
function replacePlaceholders(template, context, params) {
|
|
@@ -8842,7 +9147,7 @@ var DataForm = (props) => {
|
|
|
8842
9147
|
}
|
|
8843
9148
|
);
|
|
8844
9149
|
}
|
|
8845
|
-
const handleChildSectionChangeCallback = (0,
|
|
9150
|
+
const handleChildSectionChangeCallback = (0, import_react66.useCallback)(
|
|
8846
9151
|
(params) => {
|
|
8847
9152
|
dispatch({
|
|
8848
9153
|
type: params.actionType,
|
|
@@ -8887,7 +9192,7 @@ var DataForm = (props) => {
|
|
|
8887
9192
|
});
|
|
8888
9193
|
return cloned;
|
|
8889
9194
|
}
|
|
8890
|
-
const onClick = (0,
|
|
9195
|
+
const onClick = (0, import_react66.useCallback)(async () => {
|
|
8891
9196
|
if (props.onClick) {
|
|
8892
9197
|
const isEdit = props.dataItem && Object.keys(props.dataItem).length > 0;
|
|
8893
9198
|
const normalizedValues = normalizeChildSections(
|
|
@@ -8903,21 +9208,21 @@ var DataForm = (props) => {
|
|
|
8903
9208
|
return { isSuccessful: true };
|
|
8904
9209
|
}
|
|
8905
9210
|
}, [formState, props]);
|
|
8906
|
-
const handleAdditionalOnClick = (0,
|
|
9211
|
+
const handleAdditionalOnClick = (0, import_react66.useCallback)(async () => {
|
|
8907
9212
|
if (props.additionalActions?.onClick) {
|
|
8908
9213
|
return await props.additionalActions.onClick(formState);
|
|
8909
9214
|
} else {
|
|
8910
9215
|
return { isSuccessful: true, message: "Action completed successfully" };
|
|
8911
9216
|
}
|
|
8912
9217
|
}, [formState, props]);
|
|
8913
|
-
const onDelete = (0,
|
|
9218
|
+
const onDelete = (0, import_react66.useCallback)(async () => {
|
|
8914
9219
|
if (props.onDelete) {
|
|
8915
9220
|
return await props.onDelete(formState);
|
|
8916
9221
|
} else {
|
|
8917
9222
|
return { isSuccessful: true };
|
|
8918
9223
|
}
|
|
8919
9224
|
}, [formState, props]);
|
|
8920
|
-
(0,
|
|
9225
|
+
(0, import_react66.useEffect)(() => {
|
|
8921
9226
|
if (props.dataItem) {
|
|
8922
9227
|
dispatch({
|
|
8923
9228
|
type: FORM_INITIAL_UPDATE,
|
|
@@ -8945,19 +9250,19 @@ var DataForm = (props) => {
|
|
|
8945
9250
|
return false;
|
|
8946
9251
|
}
|
|
8947
9252
|
}
|
|
8948
|
-
return /* @__PURE__ */ (0,
|
|
8949
|
-
props.title && /* @__PURE__ */ (0,
|
|
9253
|
+
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: [
|
|
9254
|
+
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)(
|
|
8950
9255
|
"div",
|
|
8951
9256
|
{
|
|
8952
9257
|
className: "inline-flex items-center gap-2 cursor-pointer",
|
|
8953
9258
|
onClick: () => window.history.back(),
|
|
8954
9259
|
children: [
|
|
8955
|
-
/* @__PURE__ */ (0,
|
|
8956
|
-
/* @__PURE__ */ (0,
|
|
9260
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Icon_default, { name: "chevronLeft", className: "w-4 h-4 text-primary-800" }),
|
|
9261
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("h2", { className: "text-lg font-semibold text-primary-800", children: props.title })
|
|
8957
9262
|
]
|
|
8958
9263
|
}
|
|
8959
9264
|
) }),
|
|
8960
|
-
/* @__PURE__ */ (0,
|
|
9265
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
8961
9266
|
"form",
|
|
8962
9267
|
{
|
|
8963
9268
|
className: "group space-y-6 pb-6 overflow-y-auto",
|
|
@@ -8978,8 +9283,8 @@ var DataForm = (props) => {
|
|
|
8978
9283
|
}
|
|
8979
9284
|
}
|
|
8980
9285
|
},
|
|
8981
|
-
children: /* @__PURE__ */ (0,
|
|
8982
|
-
return /* @__PURE__ */ (0,
|
|
9286
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "flex flex-col gap-6", children: props.sections?.map((section, sectionIndex) => {
|
|
9287
|
+
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: [
|
|
8983
9288
|
section.sectionRows?.map(
|
|
8984
9289
|
(sectionRow, sectionRowIndex) => {
|
|
8985
9290
|
const elementsCount = sectionRow.elements.length;
|
|
@@ -8990,14 +9295,14 @@ var DataForm = (props) => {
|
|
|
8990
9295
|
sectionRow.visible
|
|
8991
9296
|
);
|
|
8992
9297
|
}
|
|
8993
|
-
return /* @__PURE__ */ (0,
|
|
8994
|
-
return /* @__PURE__ */ (0,
|
|
9298
|
+
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) => {
|
|
9299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(
|
|
8995
9300
|
"div",
|
|
8996
9301
|
{
|
|
8997
9302
|
className: sectionRow.grow ? "grow" : "",
|
|
8998
9303
|
children: [
|
|
8999
|
-
/* @__PURE__ */ (0,
|
|
9000
|
-
/* @__PURE__ */ (0,
|
|
9304
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { children: field.controlType }),
|
|
9305
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
9001
9306
|
InputControl_default,
|
|
9002
9307
|
{
|
|
9003
9308
|
name: field.name,
|
|
@@ -9027,12 +9332,12 @@ var DataForm = (props) => {
|
|
|
9027
9332
|
}) }) }, sectionRowIndex);
|
|
9028
9333
|
}
|
|
9029
9334
|
),
|
|
9030
|
-
/* @__PURE__ */ (0,
|
|
9335
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { children: section.childSections?.map(
|
|
9031
9336
|
(childSection, childSectionIndex) => {
|
|
9032
|
-
return /* @__PURE__ */ (0,
|
|
9337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { children: childSection.name && evalutateCondition(
|
|
9033
9338
|
formState.inputValues,
|
|
9034
9339
|
childSection.visible
|
|
9035
|
-
) && /* @__PURE__ */ (0,
|
|
9340
|
+
) && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
9036
9341
|
DataFormChildSection_default,
|
|
9037
9342
|
{
|
|
9038
9343
|
section: childSection,
|
|
@@ -9047,8 +9352,8 @@ var DataForm = (props) => {
|
|
|
9047
9352
|
}) })
|
|
9048
9353
|
}
|
|
9049
9354
|
),
|
|
9050
|
-
/* @__PURE__ */ (0,
|
|
9051
|
-
/* @__PURE__ */ (0,
|
|
9355
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "flex px-6 py-3 mt-2 mb-2 justify-end items-center gap-5", children: [
|
|
9356
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { children: props.additionalActions && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
9052
9357
|
Button_default,
|
|
9053
9358
|
{
|
|
9054
9359
|
ButtonType: "PrimaryHollow" /* Hollow */,
|
|
@@ -9056,7 +9361,7 @@ var DataForm = (props) => {
|
|
|
9056
9361
|
children: props.additionalActions.title
|
|
9057
9362
|
}
|
|
9058
9363
|
) }),
|
|
9059
|
-
/* @__PURE__ */ (0,
|
|
9364
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { children: props.onDelete && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
9060
9365
|
Button_default,
|
|
9061
9366
|
{
|
|
9062
9367
|
ButtonType: "PrimaryHollow" /* Hollow */,
|
|
@@ -9067,7 +9372,7 @@ var DataForm = (props) => {
|
|
|
9067
9372
|
children: "Delete"
|
|
9068
9373
|
}
|
|
9069
9374
|
) }),
|
|
9070
|
-
/* @__PURE__ */ (0,
|
|
9375
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { children: props.onClick && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
9071
9376
|
Button_default,
|
|
9072
9377
|
{
|
|
9073
9378
|
onValidate,
|
|
@@ -9085,7 +9390,7 @@ var DataForm_default = DataForm;
|
|
|
9085
9390
|
|
|
9086
9391
|
// src/components/dataForm/DataFormRenderer.tsx
|
|
9087
9392
|
init_ServiceClient();
|
|
9088
|
-
var
|
|
9393
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
9089
9394
|
function getAction(actions, code) {
|
|
9090
9395
|
return actions?.find((a) => a.actionCode === code);
|
|
9091
9396
|
}
|
|
@@ -9111,9 +9416,9 @@ var DataFormRenderer = ({
|
|
|
9111
9416
|
"Delete"
|
|
9112
9417
|
);
|
|
9113
9418
|
const hasDataItem = dataItem && Object.keys(dataItem).length > 0;
|
|
9114
|
-
return /* @__PURE__ */ (0,
|
|
9115
|
-
widgetProps && /* @__PURE__ */ (0,
|
|
9116
|
-
/* @__PURE__ */ (0,
|
|
9419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "flex-grow flex flex-col", children: [
|
|
9420
|
+
widgetProps && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(NavigationTabsV2_default, { tabs, params: widgetProps.params }),
|
|
9421
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
9117
9422
|
DataForm_default,
|
|
9118
9423
|
{
|
|
9119
9424
|
title: !isAddPage ? "Edit " + formDefinition.formTitle + "- v2" : "Add " + formDefinition.formTitle + "- v2",
|