@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260713105440 → 0.8.1-dev.20260713110639
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/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +107 -59
- package/dist/index.mjs +61 -12
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -191,6 +191,8 @@ interface PageBodyRendererProps {
|
|
|
191
191
|
}
|
|
192
192
|
declare const PageBodyRenderer: (props: PageBodyRendererProps) => React__default.JSX.Element;
|
|
193
193
|
|
|
194
|
+
declare function EnterAnimationHydrator(): null;
|
|
195
|
+
|
|
194
196
|
declare const Toast: () => React__default.JSX.Element;
|
|
195
197
|
|
|
196
198
|
declare class ToastService {
|
|
@@ -451,4 +453,4 @@ interface DataFormRendererProps {
|
|
|
451
453
|
}
|
|
452
454
|
declare const DataFormRenderer: ({ formDefinition, dataItem, params, tabs, apiBaseUrl, session, widgetProps, onSave, onDelete, onCancelAdd, isAddPage, entityId, }: DataFormRendererProps) => React.JSX.Element | null;
|
|
453
455
|
|
|
454
|
-
export { type ActionResponse$1 as ActionResponse, BooleanSelect, Button, CheckboxInput, ColorInput, DataFormRenderer, DataList, DataListRenderer, DateTimeInput, EmailInput, InputControl, type InputControlProps, InputControlType, LineTextInput, MoneyInput, MultilineTextInput, NavigationTabsV2, NumberInput, OtpInput, PageBodyRenderer, PercentageInput, PhoneInput, StyleTypes, TimeInput, Toast, ToastService, ViewControl, type ViewControlProps, ViewControlTypes };
|
|
456
|
+
export { type ActionResponse$1 as ActionResponse, BooleanSelect, Button, CheckboxInput, ColorInput, DataFormRenderer, DataList, DataListRenderer, DateTimeInput, EmailInput, EnterAnimationHydrator, InputControl, type InputControlProps, InputControlType, LineTextInput, MoneyInput, MultilineTextInput, NavigationTabsV2, NumberInput, OtpInput, PageBodyRenderer, PercentageInput, PhoneInput, StyleTypes, TimeInput, Toast, ToastService, ViewControl, type ViewControlProps, ViewControlTypes };
|
package/dist/index.d.ts
CHANGED
|
@@ -191,6 +191,8 @@ interface PageBodyRendererProps {
|
|
|
191
191
|
}
|
|
192
192
|
declare const PageBodyRenderer: (props: PageBodyRendererProps) => React__default.JSX.Element;
|
|
193
193
|
|
|
194
|
+
declare function EnterAnimationHydrator(): null;
|
|
195
|
+
|
|
194
196
|
declare const Toast: () => React__default.JSX.Element;
|
|
195
197
|
|
|
196
198
|
declare class ToastService {
|
|
@@ -451,4 +453,4 @@ interface DataFormRendererProps {
|
|
|
451
453
|
}
|
|
452
454
|
declare const DataFormRenderer: ({ formDefinition, dataItem, params, tabs, apiBaseUrl, session, widgetProps, onSave, onDelete, onCancelAdd, isAddPage, entityId, }: DataFormRendererProps) => React.JSX.Element | null;
|
|
453
455
|
|
|
454
|
-
export { type ActionResponse$1 as ActionResponse, BooleanSelect, Button, CheckboxInput, ColorInput, DataFormRenderer, DataList, DataListRenderer, DateTimeInput, EmailInput, InputControl, type InputControlProps, InputControlType, LineTextInput, MoneyInput, MultilineTextInput, NavigationTabsV2, NumberInput, OtpInput, PageBodyRenderer, PercentageInput, PhoneInput, StyleTypes, TimeInput, Toast, ToastService, ViewControl, type ViewControlProps, ViewControlTypes };
|
|
456
|
+
export { type ActionResponse$1 as ActionResponse, BooleanSelect, Button, CheckboxInput, ColorInput, DataFormRenderer, DataList, DataListRenderer, DateTimeInput, EmailInput, EnterAnimationHydrator, InputControl, type InputControlProps, InputControlType, LineTextInput, MoneyInput, MultilineTextInput, NavigationTabsV2, NumberInput, OtpInput, PageBodyRenderer, PercentageInput, PhoneInput, StyleTypes, TimeInput, Toast, ToastService, ViewControl, type ViewControlProps, ViewControlTypes };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
1
|
"use strict";
|
|
4
2
|
var __create = Object.create;
|
|
5
3
|
var __defProp = Object.defineProperty;
|
|
@@ -4139,6 +4137,7 @@ __export(index_exports, {
|
|
|
4139
4137
|
DataListRenderer: () => DataListRenderer_default,
|
|
4140
4138
|
DateTimeInput: () => DateTimeInput_default,
|
|
4141
4139
|
EmailInput: () => EmailInput_default,
|
|
4140
|
+
EnterAnimationHydrator: () => EnterAnimationHydrator,
|
|
4142
4141
|
InputControl: () => InputControl_default,
|
|
4143
4142
|
InputControlType: () => InputControlType_default,
|
|
4144
4143
|
LineTextInput: () => LineTextInput_default,
|
|
@@ -6883,23 +6882,71 @@ var PageBodyRenderer = (props) => {
|
|
|
6883
6882
|
};
|
|
6884
6883
|
var PageBodyRenderer_default = PageBodyRenderer;
|
|
6885
6884
|
|
|
6886
|
-
// src/components/
|
|
6885
|
+
// src/components/pageRenderingEngine/EnterAnimationHydrator.tsx
|
|
6887
6886
|
var import_react54 = require("react");
|
|
6887
|
+
var ENTER_ANIMATION_SELECTOR = ".enter-animation";
|
|
6888
|
+
function EnterAnimationHydrator() {
|
|
6889
|
+
(0, import_react54.useEffect)(() => {
|
|
6890
|
+
let observer;
|
|
6891
|
+
const observedElements = /* @__PURE__ */ new WeakSet();
|
|
6892
|
+
const revealAnimatedElements = () => {
|
|
6893
|
+
const animatedElements = document.querySelectorAll(ENTER_ANIMATION_SELECTOR);
|
|
6894
|
+
if (!("IntersectionObserver" in window)) {
|
|
6895
|
+
animatedElements.forEach((element) => {
|
|
6896
|
+
element.classList.add("visible");
|
|
6897
|
+
});
|
|
6898
|
+
return;
|
|
6899
|
+
}
|
|
6900
|
+
observer ?? (observer = new IntersectionObserver(
|
|
6901
|
+
(entries) => {
|
|
6902
|
+
entries.forEach((entry) => {
|
|
6903
|
+
if (entry.isIntersecting) {
|
|
6904
|
+
entry.target.classList.add("visible");
|
|
6905
|
+
observer?.unobserve(entry.target);
|
|
6906
|
+
}
|
|
6907
|
+
});
|
|
6908
|
+
},
|
|
6909
|
+
{ threshold: 0.1 }
|
|
6910
|
+
));
|
|
6911
|
+
animatedElements.forEach((element) => {
|
|
6912
|
+
if (element.classList.contains("visible") || observedElements.has(element)) {
|
|
6913
|
+
return;
|
|
6914
|
+
}
|
|
6915
|
+
observedElements.add(element);
|
|
6916
|
+
observer?.observe(element);
|
|
6917
|
+
});
|
|
6918
|
+
};
|
|
6919
|
+
revealAnimatedElements();
|
|
6920
|
+
const mutationObserver = new MutationObserver(revealAnimatedElements);
|
|
6921
|
+
mutationObserver.observe(document.body, {
|
|
6922
|
+
childList: true,
|
|
6923
|
+
subtree: true
|
|
6924
|
+
});
|
|
6925
|
+
return () => {
|
|
6926
|
+
mutationObserver.disconnect();
|
|
6927
|
+
observer?.disconnect();
|
|
6928
|
+
};
|
|
6929
|
+
}, []);
|
|
6930
|
+
return null;
|
|
6931
|
+
}
|
|
6932
|
+
|
|
6933
|
+
// src/components/Toast.tsx
|
|
6934
|
+
var import_react55 = require("react");
|
|
6888
6935
|
init_ToastService();
|
|
6889
6936
|
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
6890
6937
|
var Toast = () => {
|
|
6891
|
-
const [showToast, setShowToast] = (0,
|
|
6892
|
-
const [message, setMessage] = (0,
|
|
6893
|
-
const [messageType, setMessageType] = (0,
|
|
6894
|
-
const timeoutRef = (0,
|
|
6895
|
-
const closeToast = (0,
|
|
6938
|
+
const [showToast, setShowToast] = (0, import_react55.useState)(false);
|
|
6939
|
+
const [message, setMessage] = (0, import_react55.useState)("");
|
|
6940
|
+
const [messageType, setMessageType] = (0, import_react55.useState)("error");
|
|
6941
|
+
const timeoutRef = (0, import_react55.useRef)(null);
|
|
6942
|
+
const closeToast = (0, import_react55.useCallback)(() => {
|
|
6896
6943
|
if (timeoutRef.current) {
|
|
6897
6944
|
clearTimeout(timeoutRef.current);
|
|
6898
6945
|
timeoutRef.current = null;
|
|
6899
6946
|
}
|
|
6900
6947
|
setShowToast(false);
|
|
6901
6948
|
}, []);
|
|
6902
|
-
const showMessage = (0,
|
|
6949
|
+
const showMessage = (0, import_react55.useCallback)((message2, messageType2) => {
|
|
6903
6950
|
if (timeoutRef.current) {
|
|
6904
6951
|
clearTimeout(timeoutRef.current);
|
|
6905
6952
|
}
|
|
@@ -6911,7 +6958,7 @@ var Toast = () => {
|
|
|
6911
6958
|
timeoutRef.current = null;
|
|
6912
6959
|
}, 4e3);
|
|
6913
6960
|
}, []);
|
|
6914
|
-
(0,
|
|
6961
|
+
(0, import_react55.useEffect)(() => {
|
|
6915
6962
|
ToastService_default.initialize(showMessage, closeToast);
|
|
6916
6963
|
return () => {
|
|
6917
6964
|
closeToast();
|
|
@@ -7003,14 +7050,14 @@ var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
|
7003
7050
|
var NavigationTabsV2_default = NavigationTabsV2;
|
|
7004
7051
|
|
|
7005
7052
|
// src/components/dataForm/DataList.tsx
|
|
7006
|
-
var
|
|
7053
|
+
var import_react58 = __toESM(require("react"));
|
|
7007
7054
|
var import_navigation2 = require("next/navigation");
|
|
7008
7055
|
|
|
7009
7056
|
// src/components/dataForm/NoContentView.tsx
|
|
7010
|
-
var
|
|
7057
|
+
var import_react56 = __toESM(require("react"));
|
|
7011
7058
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
7012
7059
|
var NoContentView = (props) => {
|
|
7013
|
-
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
7060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_react56.default.Fragment, { children: props.isDataFound === false && props.children });
|
|
7014
7061
|
};
|
|
7015
7062
|
var NoContentView_default = NoContentView;
|
|
7016
7063
|
|
|
@@ -7018,10 +7065,10 @@ var NoContentView_default = NoContentView;
|
|
|
7018
7065
|
init_InputControlType();
|
|
7019
7066
|
|
|
7020
7067
|
// src/components/dataForm/ContentView.tsx
|
|
7021
|
-
var
|
|
7068
|
+
var import_react57 = __toESM(require("react"));
|
|
7022
7069
|
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
7023
7070
|
var ContentView = (props) => {
|
|
7024
|
-
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
7071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_react57.default.Fragment, { children: [
|
|
7025
7072
|
props.isDataFound == null && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "bg-gray-200 rounded-md p-4 animate-pulse", children: [
|
|
7026
7073
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "flex items-center mb-4", children: [
|
|
7027
7074
|
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "bg-gray-300 h-8 w-8 rounded-full animate-pulse" }),
|
|
@@ -7118,9 +7165,9 @@ var DataList = (props) => {
|
|
|
7118
7165
|
let activePageNumber = 0;
|
|
7119
7166
|
let pages = 0;
|
|
7120
7167
|
console.log(props.addLinkText);
|
|
7121
|
-
const [isDataFound, setIsDataFound] = (0,
|
|
7122
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
7123
|
-
(0,
|
|
7168
|
+
const [isDataFound, setIsDataFound] = (0, import_react58.useState)(null);
|
|
7169
|
+
const [searchTerm, setSearchTerm] = (0, import_react58.useState)(props.query?.searchTerm ?? "");
|
|
7170
|
+
(0, import_react58.useEffect)(() => {
|
|
7124
7171
|
if (props?.dataset) {
|
|
7125
7172
|
if (props?.dataset.result && props.dataset.result.length > 0) {
|
|
7126
7173
|
setIsDataFound(true);
|
|
@@ -7129,7 +7176,7 @@ var DataList = (props) => {
|
|
|
7129
7176
|
}
|
|
7130
7177
|
}
|
|
7131
7178
|
}, [props.dataset]);
|
|
7132
|
-
(0,
|
|
7179
|
+
(0, import_react58.useEffect)(() => {
|
|
7133
7180
|
if (!props.query?.["$filter"] || !props.filters) return;
|
|
7134
7181
|
const filterQuery = props.query["$filter"];
|
|
7135
7182
|
props.filters.forEach((filter) => {
|
|
@@ -7157,11 +7204,11 @@ var DataList = (props) => {
|
|
|
7157
7204
|
inputValues: {},
|
|
7158
7205
|
lastPropertyChanged: ""
|
|
7159
7206
|
};
|
|
7160
|
-
const [formState, dispatch] = (0,
|
|
7207
|
+
const [formState, dispatch] = (0, import_react58.useReducer)(FormReducer_default, initialState);
|
|
7161
7208
|
const getSearchableColumns = () => {
|
|
7162
7209
|
return props.columns?.filter((c) => c.isSearchable)?.map((c) => c.name)?.join(",");
|
|
7163
7210
|
};
|
|
7164
|
-
const handleFilterChange = (0,
|
|
7211
|
+
const handleFilterChange = (0, import_react58.useCallback)(
|
|
7165
7212
|
(updatedValues) => {
|
|
7166
7213
|
dispatch({
|
|
7167
7214
|
type: FORM_INPUT_UPDATE,
|
|
@@ -7192,7 +7239,7 @@ var DataList = (props) => {
|
|
|
7192
7239
|
},
|
|
7193
7240
|
[dispatch, props, router]
|
|
7194
7241
|
);
|
|
7195
|
-
(0,
|
|
7242
|
+
(0, import_react58.useEffect)(() => {
|
|
7196
7243
|
if (!props.columns.some((col) => col.isSearchable)) {
|
|
7197
7244
|
return;
|
|
7198
7245
|
}
|
|
@@ -7227,7 +7274,7 @@ var DataList = (props) => {
|
|
|
7227
7274
|
const renderPageNumbers = () => {
|
|
7228
7275
|
if (pages <= 10) {
|
|
7229
7276
|
return Array.from({ length: pages }, (_, index) => index + 1).map(
|
|
7230
|
-
(page) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7277
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react58.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7231
7278
|
Hyperlink,
|
|
7232
7279
|
{
|
|
7233
7280
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -7241,7 +7288,7 @@ var DataList = (props) => {
|
|
|
7241
7288
|
const showLastPages = activePageNumber > pages - 5;
|
|
7242
7289
|
if (showFirstPages) {
|
|
7243
7290
|
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
7244
|
-
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7291
|
+
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react58.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7245
7292
|
Hyperlink,
|
|
7246
7293
|
{
|
|
7247
7294
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -7307,7 +7354,7 @@ var DataList = (props) => {
|
|
|
7307
7354
|
),
|
|
7308
7355
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "px-2 py-1", children: "..." }),
|
|
7309
7356
|
Array.from({ length: 8 }, (_, index) => pages - 7 + index).map(
|
|
7310
|
-
(page) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7357
|
+
(page) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react58.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7311
7358
|
Hyperlink,
|
|
7312
7359
|
{
|
|
7313
7360
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -7339,7 +7386,7 @@ var DataList = (props) => {
|
|
|
7339
7386
|
Array.from(
|
|
7340
7387
|
{ length: 5 },
|
|
7341
7388
|
(_, index) => activePageNumber - 2 + index
|
|
7342
|
-
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7389
|
+
).map((page) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react58.default.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7343
7390
|
Hyperlink,
|
|
7344
7391
|
{
|
|
7345
7392
|
className: "px-3 py-1 border-t border-b border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -7385,7 +7432,7 @@ var DataList = (props) => {
|
|
|
7385
7432
|
}
|
|
7386
7433
|
}
|
|
7387
7434
|
};
|
|
7388
|
-
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
7435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_react58.default.Fragment, { children: [
|
|
7389
7436
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(ContentView_default, { isDataFound, children: [
|
|
7390
7437
|
(props.title || props.filters || props.addLinkHref) && /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
7391
7438
|
"div",
|
|
@@ -7475,7 +7522,7 @@ var DataList = (props) => {
|
|
|
7475
7522
|
}
|
|
7476
7523
|
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("tr", { className: validityClass, children: props?.columns?.map((column, colindex) => {
|
|
7477
7524
|
console.log("column", column);
|
|
7478
|
-
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react58.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7479
7526
|
"td",
|
|
7480
7527
|
{
|
|
7481
7528
|
className: "px-6 py-2 whitespace-normal " + (column.controlType == ViewControlTypes_default.money ? "" : ""),
|
|
@@ -7639,7 +7686,7 @@ var DataList = (props) => {
|
|
|
7639
7686
|
var DataList_default = DataList;
|
|
7640
7687
|
|
|
7641
7688
|
// src/components/dataForm/DataListRenderer.tsx
|
|
7642
|
-
var
|
|
7689
|
+
var import_react59 = __toESM(require("react"));
|
|
7643
7690
|
init_ServiceClient();
|
|
7644
7691
|
init_OdataBuilder();
|
|
7645
7692
|
init_SelectWithSearchInput();
|
|
@@ -7699,14 +7746,14 @@ var DataListRenderer = ({
|
|
|
7699
7746
|
widgetProps
|
|
7700
7747
|
}) => {
|
|
7701
7748
|
const serviceClient = new ServiceClient_default(apiBaseUrl, session);
|
|
7702
|
-
const [columns, setColumns] = (0,
|
|
7703
|
-
const [dataset, setDataset] = (0,
|
|
7704
|
-
const [filter, setFilters] = (0,
|
|
7705
|
-
const [addLinkHref, setAddLinkHref] = (0,
|
|
7706
|
-
const [addLinkText, setAddLinkText] = (0,
|
|
7707
|
-
const [serviceRoute, setServiceRoute] = (0,
|
|
7749
|
+
const [columns, setColumns] = (0, import_react59.useState)([]);
|
|
7750
|
+
const [dataset, setDataset] = (0, import_react59.useState)();
|
|
7751
|
+
const [filter, setFilters] = (0, import_react59.useState)([]);
|
|
7752
|
+
const [addLinkHref, setAddLinkHref] = (0, import_react59.useState)("");
|
|
7753
|
+
const [addLinkText, setAddLinkText] = (0, import_react59.useState)("");
|
|
7754
|
+
const [serviceRoute, setServiceRoute] = (0, import_react59.useState)("");
|
|
7708
7755
|
const pathname = (0, import_navigation3.usePathname)();
|
|
7709
|
-
(0,
|
|
7756
|
+
(0, import_react59.useEffect)(() => {
|
|
7710
7757
|
if (!formDefinition) return;
|
|
7711
7758
|
setColumns(mapApiToColumns(formDefinition));
|
|
7712
7759
|
setFilters(mapApiToFilters(formDefinition));
|
|
@@ -7719,7 +7766,7 @@ var DataListRenderer = ({
|
|
|
7719
7766
|
setAddLinkHref(resolvedAddLinkHref);
|
|
7720
7767
|
setAddLinkText(formDefinition?.siteFormDataList?.addLinkText ?? "");
|
|
7721
7768
|
}, [formDefinition, params]);
|
|
7722
|
-
(0,
|
|
7769
|
+
(0, import_react59.useEffect)(() => {
|
|
7723
7770
|
const fetchData = async () => {
|
|
7724
7771
|
if (!serviceRoute) return;
|
|
7725
7772
|
const resolvedRoute = resolveRoutePlaceholders2(serviceRoute, params);
|
|
@@ -7739,7 +7786,7 @@ var DataListRenderer = ({
|
|
|
7739
7786
|
isActive: landingPageUrl === pathname
|
|
7740
7787
|
};
|
|
7741
7788
|
});
|
|
7742
|
-
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
7789
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_react59.default.Fragment, { children: [
|
|
7743
7790
|
resolvedTabs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
7744
7791
|
NavigationTabsV2_default,
|
|
7745
7792
|
{
|
|
@@ -7769,13 +7816,13 @@ var DataListRenderer_default = DataListRenderer;
|
|
|
7769
7816
|
init_InputControlType();
|
|
7770
7817
|
|
|
7771
7818
|
// src/components/dataForm/DataForm.tsx
|
|
7772
|
-
var
|
|
7819
|
+
var import_react61 = __toESM(require("react"));
|
|
7773
7820
|
init_Icon();
|
|
7774
7821
|
init_Button();
|
|
7775
7822
|
init_StyleTypes();
|
|
7776
7823
|
|
|
7777
7824
|
// src/components/dataForm/DataFormChildSection.tsx
|
|
7778
|
-
var
|
|
7825
|
+
var import_react60 = __toESM(require("react"));
|
|
7779
7826
|
|
|
7780
7827
|
// src/components/dataForm/StyleTypes.tsx
|
|
7781
7828
|
var StyleTypes2 = /* @__PURE__ */ ((StyleTypes3) => {
|
|
@@ -7814,7 +7861,7 @@ var DataFormChildSection = (props) => {
|
|
|
7814
7861
|
return childItems.map((item, originalIndex) => ({ item, originalIndex })).filter((x) => !x.item.isDeleted) || [];
|
|
7815
7862
|
};
|
|
7816
7863
|
const childItemsToRender = getChildItemsForRendering();
|
|
7817
|
-
const handleChildInputChange = (0,
|
|
7864
|
+
const handleChildInputChange = (0, import_react60.useCallback)(
|
|
7818
7865
|
(updatedValues) => {
|
|
7819
7866
|
if (isOneToOne) {
|
|
7820
7867
|
props.callback({
|
|
@@ -7841,7 +7888,7 @@ var DataFormChildSection = (props) => {
|
|
|
7841
7888
|
},
|
|
7842
7889
|
[props, isOneToOne, childItemsToRender]
|
|
7843
7890
|
);
|
|
7844
|
-
const onAddRow = (0,
|
|
7891
|
+
const onAddRow = (0, import_react60.useCallback)(() => {
|
|
7845
7892
|
props.callback({
|
|
7846
7893
|
sectionName: props.section.name,
|
|
7847
7894
|
actionType: FORM_CHILD_ROW_ADD,
|
|
@@ -7850,7 +7897,7 @@ var DataFormChildSection = (props) => {
|
|
|
7850
7897
|
rowIndex: -1
|
|
7851
7898
|
});
|
|
7852
7899
|
}, [props]);
|
|
7853
|
-
const onDeleteRow = (0,
|
|
7900
|
+
const onDeleteRow = (0, import_react60.useCallback)(
|
|
7854
7901
|
(filteredIndex) => {
|
|
7855
7902
|
const visibleItem = childItemsToRender[filteredIndex];
|
|
7856
7903
|
if (visibleItem) {
|
|
@@ -7870,7 +7917,7 @@ var DataFormChildSection = (props) => {
|
|
|
7870
7917
|
childItemsToRender,
|
|
7871
7918
|
allChildItems: childItems
|
|
7872
7919
|
});
|
|
7873
|
-
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7920
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_react60.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "rounded border-neutral-200 border px-6 py-4 mb-2", children: [
|
|
7874
7921
|
section.sectionTitle && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "mb-4 text-lg font-medium text-body-950", children: section.sectionTitle }),
|
|
7875
7922
|
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "flex-grow flex flex-col justify-between overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex flex-col justify-between gap-2", children: [
|
|
7876
7923
|
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("table", { className: "w-full border-separate divide-y divide-gray-200", children: [
|
|
@@ -7892,7 +7939,7 @@ var DataFormChildSection = (props) => {
|
|
|
7892
7939
|
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("tbody", { className: "divide-y divide-gray-200", children: childItemsToRender.map((visibleItem, filteredIndex) => {
|
|
7893
7940
|
const { item, originalIndex } = visibleItem;
|
|
7894
7941
|
const rowKey = originalIndex;
|
|
7895
|
-
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_react60.default.Fragment, { children: section.sectionRows.map(
|
|
7896
7943
|
(sectionRow, sectionRowIndex) => {
|
|
7897
7944
|
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
|
|
7898
7945
|
"tr",
|
|
@@ -7963,7 +8010,7 @@ var DataFormChildSection_default = DataFormChildSection;
|
|
|
7963
8010
|
// src/components/dataForm/DataForm.tsx
|
|
7964
8011
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
7965
8012
|
var DataForm = (props) => {
|
|
7966
|
-
const formRef = (0,
|
|
8013
|
+
const formRef = (0, import_react61.useRef)(null);
|
|
7967
8014
|
console.log(props.dataItem, "dssads");
|
|
7968
8015
|
const initialState = {
|
|
7969
8016
|
inputValues: {},
|
|
@@ -7972,9 +8019,9 @@ var DataForm = (props) => {
|
|
|
7972
8019
|
const childInitialState = {
|
|
7973
8020
|
inputValues: []
|
|
7974
8021
|
};
|
|
7975
|
-
const [formState, dispatch] = (0,
|
|
8022
|
+
const [formState, dispatch] = (0, import_react61.useReducer)(FormReducer_default, initialState);
|
|
7976
8023
|
console.log(props.sections, "sections");
|
|
7977
|
-
const clearHiddenChildSections = (0,
|
|
8024
|
+
const clearHiddenChildSections = (0, import_react61.useCallback)(
|
|
7978
8025
|
(changedProperty, newValues) => {
|
|
7979
8026
|
if (!props.sections) return;
|
|
7980
8027
|
const allChildSections = [];
|
|
@@ -8012,7 +8059,7 @@ var DataForm = (props) => {
|
|
|
8012
8059
|
},
|
|
8013
8060
|
[props.sections, formState.inputValues]
|
|
8014
8061
|
);
|
|
8015
|
-
const handleInputChange = (0,
|
|
8062
|
+
const handleInputChange = (0, import_react61.useCallback)(
|
|
8016
8063
|
async (updatedValues) => {
|
|
8017
8064
|
dispatch({
|
|
8018
8065
|
type: FORM_INPUT_UPDATE,
|
|
@@ -8027,7 +8074,7 @@ var DataForm = (props) => {
|
|
|
8027
8074
|
},
|
|
8028
8075
|
[dispatch, formState.inputValues, clearHiddenChildSections]
|
|
8029
8076
|
);
|
|
8030
|
-
const fetchData = (0,
|
|
8077
|
+
const fetchData = (0, import_react61.useCallback)(async () => {
|
|
8031
8078
|
if (!props.rules) return;
|
|
8032
8079
|
if (Object.keys(formState.inputValues).length === 0) {
|
|
8033
8080
|
return;
|
|
@@ -8058,7 +8105,7 @@ var DataForm = (props) => {
|
|
|
8058
8105
|
console.error("Error fetching data:", error);
|
|
8059
8106
|
}
|
|
8060
8107
|
}, [formState.lastPropertyChanged, formState.inputValues]);
|
|
8061
|
-
(0,
|
|
8108
|
+
(0, import_react61.useEffect)(() => {
|
|
8062
8109
|
fetchData();
|
|
8063
8110
|
}, [formState.inputValues, formState.lastPropertyChanged]);
|
|
8064
8111
|
function replacePlaceholders(template, context, params) {
|
|
@@ -8078,7 +8125,7 @@ var DataForm = (props) => {
|
|
|
8078
8125
|
}
|
|
8079
8126
|
);
|
|
8080
8127
|
}
|
|
8081
|
-
const handleChildSectionChangeCallback = (0,
|
|
8128
|
+
const handleChildSectionChangeCallback = (0, import_react61.useCallback)(
|
|
8082
8129
|
(params) => {
|
|
8083
8130
|
dispatch({
|
|
8084
8131
|
type: params.actionType,
|
|
@@ -8123,7 +8170,7 @@ var DataForm = (props) => {
|
|
|
8123
8170
|
});
|
|
8124
8171
|
return cloned;
|
|
8125
8172
|
}
|
|
8126
|
-
const onClick = (0,
|
|
8173
|
+
const onClick = (0, import_react61.useCallback)(async () => {
|
|
8127
8174
|
if (props.onClick) {
|
|
8128
8175
|
const isEdit = props.dataItem && Object.keys(props.dataItem).length > 0;
|
|
8129
8176
|
const normalizedValues = normalizeChildSections(
|
|
@@ -8139,21 +8186,21 @@ var DataForm = (props) => {
|
|
|
8139
8186
|
return { isSuccessful: true };
|
|
8140
8187
|
}
|
|
8141
8188
|
}, [formState, props]);
|
|
8142
|
-
const handleAdditionalOnClick = (0,
|
|
8189
|
+
const handleAdditionalOnClick = (0, import_react61.useCallback)(async () => {
|
|
8143
8190
|
if (props.additionalActions?.onClick) {
|
|
8144
8191
|
return await props.additionalActions.onClick(formState);
|
|
8145
8192
|
} else {
|
|
8146
8193
|
return { isSuccessful: true, message: "Action completed successfully" };
|
|
8147
8194
|
}
|
|
8148
8195
|
}, [formState, props]);
|
|
8149
|
-
const onDelete = (0,
|
|
8196
|
+
const onDelete = (0, import_react61.useCallback)(async () => {
|
|
8150
8197
|
if (props.onDelete) {
|
|
8151
8198
|
return await props.onDelete(formState);
|
|
8152
8199
|
} else {
|
|
8153
8200
|
return { isSuccessful: true };
|
|
8154
8201
|
}
|
|
8155
8202
|
}, [formState, props]);
|
|
8156
|
-
(0,
|
|
8203
|
+
(0, import_react61.useEffect)(() => {
|
|
8157
8204
|
if (props.dataItem) {
|
|
8158
8205
|
dispatch({
|
|
8159
8206
|
type: FORM_INITIAL_UPDATE,
|
|
@@ -8181,7 +8228,7 @@ var DataForm = (props) => {
|
|
|
8181
8228
|
return false;
|
|
8182
8229
|
}
|
|
8183
8230
|
}
|
|
8184
|
-
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
8231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react61.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "flex-grow flex flex-col", children: [
|
|
8185
8232
|
props.title && /* @__PURE__ */ (0, import_jsx_runtime81.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_runtime81.jsxs)(
|
|
8186
8233
|
"div",
|
|
8187
8234
|
{
|
|
@@ -8215,7 +8262,7 @@ var DataForm = (props) => {
|
|
|
8215
8262
|
}
|
|
8216
8263
|
},
|
|
8217
8264
|
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "flex flex-col gap-6", children: props.sections?.map((section, sectionIndex) => {
|
|
8218
|
-
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
8265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react61.default.Fragment, { children: !section.isChildSection && /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: " rounded-b-lg bg-white shadow border-neutral-200 border px-8 py-6 ", children: [
|
|
8219
8266
|
section.sectionRows?.map(
|
|
8220
8267
|
(sectionRow, sectionRowIndex) => {
|
|
8221
8268
|
const elementsCount = sectionRow.elements.length;
|
|
@@ -8226,7 +8273,7 @@ var DataForm = (props) => {
|
|
|
8226
8273
|
sectionRow.visible
|
|
8227
8274
|
);
|
|
8228
8275
|
}
|
|
8229
|
-
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
8276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_react61.default.Fragment, { children: isVisible && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "lg:flex gap-14 flex-1 mb-4 ", children: sectionRow.elements.map((field, index) => {
|
|
8230
8277
|
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
8231
8278
|
"div",
|
|
8232
8279
|
{
|
|
@@ -8379,6 +8426,7 @@ var DataFormRenderer_default = DataFormRenderer;
|
|
|
8379
8426
|
DataListRenderer,
|
|
8380
8427
|
DateTimeInput,
|
|
8381
8428
|
EmailInput,
|
|
8429
|
+
EnterAnimationHydrator,
|
|
8382
8430
|
InputControl,
|
|
8383
8431
|
InputControlType,
|
|
8384
8432
|
LineTextInput,
|
package/dist/index.mjs
CHANGED
|
@@ -2743,8 +2743,56 @@ var PageBodyRenderer = (props) => {
|
|
|
2743
2743
|
};
|
|
2744
2744
|
var PageBodyRenderer_default = PageBodyRenderer;
|
|
2745
2745
|
|
|
2746
|
+
// src/components/pageRenderingEngine/EnterAnimationHydrator.tsx
|
|
2747
|
+
import { useEffect } from "react";
|
|
2748
|
+
var ENTER_ANIMATION_SELECTOR = ".enter-animation";
|
|
2749
|
+
function EnterAnimationHydrator() {
|
|
2750
|
+
useEffect(() => {
|
|
2751
|
+
let observer;
|
|
2752
|
+
const observedElements = /* @__PURE__ */ new WeakSet();
|
|
2753
|
+
const revealAnimatedElements = () => {
|
|
2754
|
+
const animatedElements = document.querySelectorAll(ENTER_ANIMATION_SELECTOR);
|
|
2755
|
+
if (!("IntersectionObserver" in window)) {
|
|
2756
|
+
animatedElements.forEach((element) => {
|
|
2757
|
+
element.classList.add("visible");
|
|
2758
|
+
});
|
|
2759
|
+
return;
|
|
2760
|
+
}
|
|
2761
|
+
observer ?? (observer = new IntersectionObserver(
|
|
2762
|
+
(entries) => {
|
|
2763
|
+
entries.forEach((entry) => {
|
|
2764
|
+
if (entry.isIntersecting) {
|
|
2765
|
+
entry.target.classList.add("visible");
|
|
2766
|
+
observer?.unobserve(entry.target);
|
|
2767
|
+
}
|
|
2768
|
+
});
|
|
2769
|
+
},
|
|
2770
|
+
{ threshold: 0.1 }
|
|
2771
|
+
));
|
|
2772
|
+
animatedElements.forEach((element) => {
|
|
2773
|
+
if (element.classList.contains("visible") || observedElements.has(element)) {
|
|
2774
|
+
return;
|
|
2775
|
+
}
|
|
2776
|
+
observedElements.add(element);
|
|
2777
|
+
observer?.observe(element);
|
|
2778
|
+
});
|
|
2779
|
+
};
|
|
2780
|
+
revealAnimatedElements();
|
|
2781
|
+
const mutationObserver = new MutationObserver(revealAnimatedElements);
|
|
2782
|
+
mutationObserver.observe(document.body, {
|
|
2783
|
+
childList: true,
|
|
2784
|
+
subtree: true
|
|
2785
|
+
});
|
|
2786
|
+
return () => {
|
|
2787
|
+
mutationObserver.disconnect();
|
|
2788
|
+
observer?.disconnect();
|
|
2789
|
+
};
|
|
2790
|
+
}, []);
|
|
2791
|
+
return null;
|
|
2792
|
+
}
|
|
2793
|
+
|
|
2746
2794
|
// src/components/Toast.tsx
|
|
2747
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2795
|
+
import { useCallback, useEffect as useEffect2, useRef, useState } from "react";
|
|
2748
2796
|
import { Fragment as Fragment7, jsx as jsx36, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2749
2797
|
var Toast = () => {
|
|
2750
2798
|
const [showToast, setShowToast] = useState(false);
|
|
@@ -2770,7 +2818,7 @@ var Toast = () => {
|
|
|
2770
2818
|
timeoutRef.current = null;
|
|
2771
2819
|
}, 4e3);
|
|
2772
2820
|
}, []);
|
|
2773
|
-
|
|
2821
|
+
useEffect2(() => {
|
|
2774
2822
|
ToastService_default.initialize(showMessage, closeToast);
|
|
2775
2823
|
return () => {
|
|
2776
2824
|
closeToast();
|
|
@@ -2845,7 +2893,7 @@ var NavigationTabsV2 = ({ tabs, params = {} }) => {
|
|
|
2845
2893
|
var NavigationTabsV2_default = NavigationTabsV2;
|
|
2846
2894
|
|
|
2847
2895
|
// src/components/dataForm/DataList.tsx
|
|
2848
|
-
import React27, { useEffect as
|
|
2896
|
+
import React27, { useEffect as useEffect3, useState as useState2, useCallback as useCallback2, useReducer } from "react";
|
|
2849
2897
|
import { useRouter } from "next/navigation";
|
|
2850
2898
|
|
|
2851
2899
|
// src/components/dataForm/NoContentView.tsx
|
|
@@ -2953,7 +3001,7 @@ var DataList = (props) => {
|
|
|
2953
3001
|
console.log(props.addLinkText);
|
|
2954
3002
|
const [isDataFound, setIsDataFound] = useState2(null);
|
|
2955
3003
|
const [searchTerm, setSearchTerm] = useState2(props.query?.searchTerm ?? "");
|
|
2956
|
-
|
|
3004
|
+
useEffect3(() => {
|
|
2957
3005
|
if (props?.dataset) {
|
|
2958
3006
|
if (props?.dataset.result && props.dataset.result.length > 0) {
|
|
2959
3007
|
setIsDataFound(true);
|
|
@@ -2962,7 +3010,7 @@ var DataList = (props) => {
|
|
|
2962
3010
|
}
|
|
2963
3011
|
}
|
|
2964
3012
|
}, [props.dataset]);
|
|
2965
|
-
|
|
3013
|
+
useEffect3(() => {
|
|
2966
3014
|
if (!props.query?.["$filter"] || !props.filters) return;
|
|
2967
3015
|
const filterQuery = props.query["$filter"];
|
|
2968
3016
|
props.filters.forEach((filter) => {
|
|
@@ -3025,7 +3073,7 @@ var DataList = (props) => {
|
|
|
3025
3073
|
},
|
|
3026
3074
|
[dispatch, props, router]
|
|
3027
3075
|
);
|
|
3028
|
-
|
|
3076
|
+
useEffect3(() => {
|
|
3029
3077
|
if (!props.columns.some((col) => col.isSearchable)) {
|
|
3030
3078
|
return;
|
|
3031
3079
|
}
|
|
@@ -3472,7 +3520,7 @@ var DataList = (props) => {
|
|
|
3472
3520
|
var DataList_default = DataList;
|
|
3473
3521
|
|
|
3474
3522
|
// src/components/dataForm/DataListRenderer.tsx
|
|
3475
|
-
import React28, { useState as useState3, useEffect as
|
|
3523
|
+
import React28, { useState as useState3, useEffect as useEffect4 } from "react";
|
|
3476
3524
|
import { usePathname as usePathname2 } from "next/navigation";
|
|
3477
3525
|
import { jsx as jsx41, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3478
3526
|
var viewControlMap = {
|
|
@@ -3536,7 +3584,7 @@ var DataListRenderer = ({
|
|
|
3536
3584
|
const [addLinkText, setAddLinkText] = useState3("");
|
|
3537
3585
|
const [serviceRoute, setServiceRoute] = useState3("");
|
|
3538
3586
|
const pathname = usePathname2();
|
|
3539
|
-
|
|
3587
|
+
useEffect4(() => {
|
|
3540
3588
|
if (!formDefinition) return;
|
|
3541
3589
|
setColumns(mapApiToColumns(formDefinition));
|
|
3542
3590
|
setFilters(mapApiToFilters(formDefinition));
|
|
@@ -3549,7 +3597,7 @@ var DataListRenderer = ({
|
|
|
3549
3597
|
setAddLinkHref(resolvedAddLinkHref);
|
|
3550
3598
|
setAddLinkText(formDefinition?.siteFormDataList?.addLinkText ?? "");
|
|
3551
3599
|
}, [formDefinition, params]);
|
|
3552
|
-
|
|
3600
|
+
useEffect4(() => {
|
|
3553
3601
|
const fetchData = async () => {
|
|
3554
3602
|
if (!serviceRoute) return;
|
|
3555
3603
|
const resolvedRoute = resolveRoutePlaceholders2(serviceRoute, params);
|
|
@@ -3596,7 +3644,7 @@ var DataListRenderer = ({
|
|
|
3596
3644
|
var DataListRenderer_default = DataListRenderer;
|
|
3597
3645
|
|
|
3598
3646
|
// src/components/dataForm/DataForm.tsx
|
|
3599
|
-
import React30, { useCallback as useCallback4, useEffect as
|
|
3647
|
+
import React30, { useCallback as useCallback4, useEffect as useEffect5, useReducer as useReducer2, useRef as useRef2 } from "react";
|
|
3600
3648
|
|
|
3601
3649
|
// src/components/dataForm/DataFormChildSection.tsx
|
|
3602
3650
|
import React29, { useCallback as useCallback3 } from "react";
|
|
@@ -3878,7 +3926,7 @@ var DataForm = (props) => {
|
|
|
3878
3926
|
console.error("Error fetching data:", error);
|
|
3879
3927
|
}
|
|
3880
3928
|
}, [formState.lastPropertyChanged, formState.inputValues]);
|
|
3881
|
-
|
|
3929
|
+
useEffect5(() => {
|
|
3882
3930
|
fetchData();
|
|
3883
3931
|
}, [formState.inputValues, formState.lastPropertyChanged]);
|
|
3884
3932
|
function replacePlaceholders(template, context, params) {
|
|
@@ -3973,7 +4021,7 @@ var DataForm = (props) => {
|
|
|
3973
4021
|
return { isSuccessful: true };
|
|
3974
4022
|
}
|
|
3975
4023
|
}, [formState, props]);
|
|
3976
|
-
|
|
4024
|
+
useEffect5(() => {
|
|
3977
4025
|
if (props.dataItem) {
|
|
3978
4026
|
dispatch({
|
|
3979
4027
|
type: FORM_INITIAL_UPDATE,
|
|
@@ -4197,6 +4245,7 @@ export {
|
|
|
4197
4245
|
DataListRenderer_default as DataListRenderer,
|
|
4198
4246
|
DateTimeInput_default as DateTimeInput,
|
|
4199
4247
|
EmailInput_default as EmailInput,
|
|
4248
|
+
EnterAnimationHydrator,
|
|
4200
4249
|
InputControl_default as InputControl,
|
|
4201
4250
|
InputControlType_default as InputControlType,
|
|
4202
4251
|
LineTextInput_default as LineTextInput,
|
package/package.json
CHANGED