@acoustte-digital-services/digitalstore-controls-dev 0.8.1-dev.20260609125530 → 0.8.1-dev.20260615062630
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.js +26 -9
- package/dist/index.mjs +49 -32
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2494,15 +2494,17 @@ var CheckboxInput = (props) => {
|
|
|
2494
2494
|
value = true;
|
|
2495
2495
|
}
|
|
2496
2496
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react21.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "mb-1", children: [
|
|
2497
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2497
|
+
props?.attributes?.label && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
2498
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2499
|
+
"label",
|
|
2500
|
+
{
|
|
2501
|
+
htmlFor: props.name,
|
|
2502
|
+
className: "inline-block text-sm font-medium",
|
|
2503
|
+
children: props.attributes.label
|
|
2504
|
+
}
|
|
2505
|
+
),
|
|
2506
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "bg-error-weak", children: "*" })
|
|
2507
|
+
] }),
|
|
2506
2508
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2507
2509
|
"input",
|
|
2508
2510
|
{
|
|
@@ -6075,6 +6077,21 @@ var DataList = (props) => {
|
|
|
6075
6077
|
}
|
|
6076
6078
|
}
|
|
6077
6079
|
}, [props.dataset]);
|
|
6080
|
+
(0, import_react55.useEffect)(() => {
|
|
6081
|
+
if (!props.query?.["$filter"] || !props.filters) return;
|
|
6082
|
+
const filterQuery = props.query["$filter"];
|
|
6083
|
+
props.filters.forEach((filter) => {
|
|
6084
|
+
const regex = new RegExp(`${filter.name}\\s+eq\\s+'?([^']+)'?`);
|
|
6085
|
+
const match = filterQuery.match(regex);
|
|
6086
|
+
if (match) {
|
|
6087
|
+
dispatch({
|
|
6088
|
+
type: FORM_INPUT_UPDATE,
|
|
6089
|
+
name: filter.name,
|
|
6090
|
+
value: match[1]
|
|
6091
|
+
});
|
|
6092
|
+
}
|
|
6093
|
+
});
|
|
6094
|
+
}, [props.query, props.filters]);
|
|
6078
6095
|
function getNestedProperty2(obj, path) {
|
|
6079
6096
|
if (path.includes(".")) {
|
|
6080
6097
|
return path.split(".").reduce((prev, curr) => prev ? prev[curr] : null, obj);
|
package/dist/index.mjs
CHANGED
|
@@ -872,7 +872,7 @@ var NumberInput_default = NumberInput;
|
|
|
872
872
|
|
|
873
873
|
// src/components/controls/edit/CheckboxInput.tsx
|
|
874
874
|
import React19 from "react";
|
|
875
|
-
import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
875
|
+
import { Fragment, jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
876
876
|
var CheckboxInput = (props) => {
|
|
877
877
|
const textChangeHandler = (event) => {
|
|
878
878
|
let text = event.target.checked;
|
|
@@ -890,15 +890,17 @@ var CheckboxInput = (props) => {
|
|
|
890
890
|
value = true;
|
|
891
891
|
}
|
|
892
892
|
return /* @__PURE__ */ jsx20(React19.Fragment, { children: /* @__PURE__ */ jsxs12("div", { className: "mb-1", children: [
|
|
893
|
-
/* @__PURE__ */
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
893
|
+
props?.attributes?.label && /* @__PURE__ */ jsxs12(Fragment, { children: [
|
|
894
|
+
/* @__PURE__ */ jsx20(
|
|
895
|
+
"label",
|
|
896
|
+
{
|
|
897
|
+
htmlFor: props.name,
|
|
898
|
+
className: "inline-block text-sm font-medium",
|
|
899
|
+
children: props.attributes.label
|
|
900
|
+
}
|
|
901
|
+
),
|
|
902
|
+
props?.attributes?.label && props?.attributes?.required && /* @__PURE__ */ jsx20("span", { className: "bg-error-weak", children: "*" })
|
|
903
|
+
] }),
|
|
902
904
|
/* @__PURE__ */ jsx20(
|
|
903
905
|
"input",
|
|
904
906
|
{
|
|
@@ -1668,7 +1670,7 @@ import React28, { useEffect as useEffect7 } from "react";
|
|
|
1668
1670
|
|
|
1669
1671
|
// src/components/dataForm/Hyperlink.tsx
|
|
1670
1672
|
import Link from "next/link";
|
|
1671
|
-
import { Fragment, jsx as jsx29 } from "react/jsx-runtime";
|
|
1673
|
+
import { Fragment as Fragment2, jsx as jsx29 } from "react/jsx-runtime";
|
|
1672
1674
|
function Hyperlink(props) {
|
|
1673
1675
|
let linkClass = props.linkType ? buttonClasses.get(props.linkType) : buttonClasses.get("Link" /* Link */);
|
|
1674
1676
|
const target = props?.href?.startsWith("http") ? "_blank" : "_self";
|
|
@@ -1676,7 +1678,7 @@ function Hyperlink(props) {
|
|
|
1676
1678
|
if (target == "_blank") {
|
|
1677
1679
|
additionalProps.rel = "noopener noreferrer";
|
|
1678
1680
|
}
|
|
1679
|
-
return /* @__PURE__ */ jsx29(
|
|
1681
|
+
return /* @__PURE__ */ jsx29(Fragment2, { children: props.href ? /* @__PURE__ */ jsx29(
|
|
1680
1682
|
Link,
|
|
1681
1683
|
{
|
|
1682
1684
|
href: props.href,
|
|
@@ -2162,7 +2164,7 @@ var ImageNode_default = ImageNode;
|
|
|
2162
2164
|
|
|
2163
2165
|
// src/components/pageRenderingEngine/nodes/LinkNode.tsx
|
|
2164
2166
|
import dynamic4 from "next/dynamic";
|
|
2165
|
-
import { Fragment as
|
|
2167
|
+
import { Fragment as Fragment3, jsx as jsx40, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2166
2168
|
var LinkNodeButton = dynamic4(() => import("./LinkNodeButton-WDDPNYWI.mjs"), {
|
|
2167
2169
|
ssr: false
|
|
2168
2170
|
});
|
|
@@ -2215,7 +2217,7 @@ var LinkNode = (props) => {
|
|
|
2215
2217
|
const isButton = node.isButton === true;
|
|
2216
2218
|
const renderChildren = () => {
|
|
2217
2219
|
if (!node.children || node.children.length === 0) return null;
|
|
2218
|
-
return /* @__PURE__ */ jsx40(
|
|
2220
|
+
return /* @__PURE__ */ jsx40(Fragment3, { children: node.children.map((childNode, index) => {
|
|
2219
2221
|
const SelectedNode = NodeTypes2[childNode.type];
|
|
2220
2222
|
if (!SelectedNode) {
|
|
2221
2223
|
console.warn("Unknown node type:", childNode.type);
|
|
@@ -2438,7 +2440,7 @@ var DatafieldNode = (props) => {
|
|
|
2438
2440
|
var DatafieldNode_default = DatafieldNode;
|
|
2439
2441
|
|
|
2440
2442
|
// src/components/pageRenderingEngine/nodes/ParagraphNode.tsx
|
|
2441
|
-
import { Fragment as
|
|
2443
|
+
import { Fragment as Fragment4, jsx as jsx44, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2442
2444
|
var ParagraphNode = (props) => {
|
|
2443
2445
|
const NodeTypes2 = {
|
|
2444
2446
|
["text"]: TextNode_default,
|
|
@@ -2458,7 +2460,7 @@ var ParagraphNode = (props) => {
|
|
|
2458
2460
|
const isInlineOnlyParent = props.parentTag === "summary";
|
|
2459
2461
|
const hasChildren = props.node.children && props.node.children.length > 0;
|
|
2460
2462
|
if (isInlineOnlyParent) {
|
|
2461
|
-
return /* @__PURE__ */ jsx44(
|
|
2463
|
+
return /* @__PURE__ */ jsx44(Fragment4, { children: hasChildren && props.node.children.map((node, index) => {
|
|
2462
2464
|
const SelectedNode = NodeTypes2[node.type];
|
|
2463
2465
|
return /* @__PURE__ */ jsx44(React31.Fragment, { children: SelectedNode && /* @__PURE__ */ jsx44(
|
|
2464
2466
|
SelectedNode,
|
|
@@ -2493,7 +2495,7 @@ var ParagraphNode_default = ParagraphNode;
|
|
|
2493
2495
|
|
|
2494
2496
|
// src/components/pageRenderingEngine/nodes/HeadingNode.tsx
|
|
2495
2497
|
import React32 from "react";
|
|
2496
|
-
import { Fragment as
|
|
2498
|
+
import { Fragment as Fragment5, jsx as jsx45 } from "react/jsx-runtime";
|
|
2497
2499
|
var HeadingNode = (props) => {
|
|
2498
2500
|
const NodeTypes2 = {
|
|
2499
2501
|
["text"]: TextNode_default,
|
|
@@ -2509,7 +2511,7 @@ var HeadingNode = (props) => {
|
|
|
2509
2511
|
{
|
|
2510
2512
|
}
|
|
2511
2513
|
const formatClasses = FormatClass[props.node.format] || "";
|
|
2512
|
-
return /* @__PURE__ */ jsx45(
|
|
2514
|
+
return /* @__PURE__ */ jsx45(Fragment5, { children: React32.createElement(
|
|
2513
2515
|
HeadingTag,
|
|
2514
2516
|
{ className: formatClasses },
|
|
2515
2517
|
props.node.children && props.node.children.map((childNode, index) => {
|
|
@@ -2645,7 +2647,7 @@ var HorizontalRuleNode_default = HorizontalRuleNode;
|
|
|
2645
2647
|
|
|
2646
2648
|
// src/components/pageRenderingEngine/nodes/WidgetNode.tsx
|
|
2647
2649
|
import React37 from "react";
|
|
2648
|
-
import { Fragment as
|
|
2650
|
+
import { Fragment as Fragment6, jsx as jsx51 } from "react/jsx-runtime";
|
|
2649
2651
|
var WidgetNode = (props) => {
|
|
2650
2652
|
const getWidgetParameters = () => {
|
|
2651
2653
|
const widgetInputParameters = {
|
|
@@ -2709,7 +2711,7 @@ var WidgetNode = (props) => {
|
|
|
2709
2711
|
};
|
|
2710
2712
|
const widgetCode = props.node?.widgetCode;
|
|
2711
2713
|
if (!widgetCode) {
|
|
2712
|
-
return /* @__PURE__ */ jsx51(
|
|
2714
|
+
return /* @__PURE__ */ jsx51(Fragment6, { children: "Invalid widget" });
|
|
2713
2715
|
}
|
|
2714
2716
|
const widgetParams = getWidgetParameters();
|
|
2715
2717
|
const WidgetRenderer = props.widgetRenderer;
|
|
@@ -2886,7 +2888,7 @@ var EmbedNode_default = EmbedNode;
|
|
|
2886
2888
|
|
|
2887
2889
|
// src/components/Slider.tsx
|
|
2888
2890
|
import React39, { useState as useState6, useEffect as useEffect9, Children, cloneElement } from "react";
|
|
2889
|
-
import { Fragment as
|
|
2891
|
+
import { Fragment as Fragment7, jsx as jsx55, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2890
2892
|
var Slider = ({
|
|
2891
2893
|
children,
|
|
2892
2894
|
slidesToShow = 4,
|
|
@@ -3024,7 +3026,7 @@ var Slider = ({
|
|
|
3024
3026
|
children: slides
|
|
3025
3027
|
}
|
|
3026
3028
|
),
|
|
3027
|
-
show_arrows && /* @__PURE__ */ jsxs28(
|
|
3029
|
+
show_arrows && /* @__PURE__ */ jsxs28(Fragment7, { children: [
|
|
3028
3030
|
/* @__PURE__ */ jsx55(
|
|
3029
3031
|
ArrowButton,
|
|
3030
3032
|
{
|
|
@@ -3720,7 +3722,7 @@ var Pagination_default = Pagination;
|
|
|
3720
3722
|
|
|
3721
3723
|
// src/components/pageRenderingEngine/nodes/ImageGalleryNode.tsx
|
|
3722
3724
|
import dynamic7 from "next/dynamic";
|
|
3723
|
-
import { Fragment as
|
|
3725
|
+
import { Fragment as Fragment8, jsx as jsx58, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3724
3726
|
var HlsPlayer2 = dynamic7(() => import("./HlsPlayer-DZNDKG2P.mjs"), { ssr: false });
|
|
3725
3727
|
var deviceToMediaQuery = (device) => {
|
|
3726
3728
|
switch (device) {
|
|
@@ -3793,8 +3795,8 @@ var ImageGalleryNode = (props) => {
|
|
|
3793
3795
|
right: "justify-end"
|
|
3794
3796
|
};
|
|
3795
3797
|
const formatClasses = FormatClass[props.node.format || ""] || "";
|
|
3796
|
-
return /* @__PURE__ */ jsxs31(
|
|
3797
|
-
hlsSources.length > 0 && /* @__PURE__ */ jsx58(
|
|
3798
|
+
return /* @__PURE__ */ jsxs31(Fragment8, { children: [
|
|
3799
|
+
hlsSources.length > 0 && /* @__PURE__ */ jsx58(Fragment8, { children: /* @__PURE__ */ jsx58(
|
|
3798
3800
|
HlsPlayer2,
|
|
3799
3801
|
{
|
|
3800
3802
|
sources: hlsSources,
|
|
@@ -3809,7 +3811,7 @@ var ImageGalleryNode = (props) => {
|
|
|
3809
3811
|
styles: hlsStyles
|
|
3810
3812
|
}
|
|
3811
3813
|
) }),
|
|
3812
|
-
staticFallback && /* @__PURE__ */ jsx58(
|
|
3814
|
+
staticFallback && /* @__PURE__ */ jsx58(Fragment8, { children: /* @__PURE__ */ jsxs31("picture", { children: [
|
|
3813
3815
|
DEVICE_ORDER.map((deviceKey) => {
|
|
3814
3816
|
const match = staticSources.find((img) => img.device === deviceKey);
|
|
3815
3817
|
if (!match) return null;
|
|
@@ -4282,7 +4284,7 @@ var PageBodyRenderer_default = PageBodyRenderer;
|
|
|
4282
4284
|
|
|
4283
4285
|
// src/components/Toast.tsx
|
|
4284
4286
|
import { useState as useState8 } from "react";
|
|
4285
|
-
import { Fragment as
|
|
4287
|
+
import { Fragment as Fragment9, jsx as jsx61, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
4286
4288
|
var Toast = () => {
|
|
4287
4289
|
const [showToast, setShowToast] = useState8(false);
|
|
4288
4290
|
const [message, setMessage] = useState8("");
|
|
@@ -4325,7 +4327,7 @@ var Toast = () => {
|
|
|
4325
4327
|
const closeToast = () => {
|
|
4326
4328
|
setShowToast(false);
|
|
4327
4329
|
};
|
|
4328
|
-
return /* @__PURE__ */ jsx61(
|
|
4330
|
+
return /* @__PURE__ */ jsx61(Fragment9, { children: showToast && /* @__PURE__ */ jsx61("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__ */ jsxs33("div", { className: `w-full items-center flex justify-between p-3 rounded-md relative shadow border bg-${messageType}-soft`, children: [
|
|
4329
4331
|
/* @__PURE__ */ jsx61(
|
|
4330
4332
|
"span",
|
|
4331
4333
|
{
|
|
@@ -4445,7 +4447,7 @@ var ContentView = (props) => {
|
|
|
4445
4447
|
var ContentView_default = ContentView;
|
|
4446
4448
|
|
|
4447
4449
|
// src/components/dataForm/DataList.tsx
|
|
4448
|
-
import { Fragment as
|
|
4450
|
+
import { Fragment as Fragment10, jsx as jsx65, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
4449
4451
|
var DataList = (props) => {
|
|
4450
4452
|
const router = useRouter();
|
|
4451
4453
|
let builder = new OdataBuilder(props.path);
|
|
@@ -4463,6 +4465,21 @@ var DataList = (props) => {
|
|
|
4463
4465
|
}
|
|
4464
4466
|
}
|
|
4465
4467
|
}, [props.dataset]);
|
|
4468
|
+
useEffect10(() => {
|
|
4469
|
+
if (!props.query?.["$filter"] || !props.filters) return;
|
|
4470
|
+
const filterQuery = props.query["$filter"];
|
|
4471
|
+
props.filters.forEach((filter) => {
|
|
4472
|
+
const regex = new RegExp(`${filter.name}\\s+eq\\s+'?([^']+)'?`);
|
|
4473
|
+
const match = filterQuery.match(regex);
|
|
4474
|
+
if (match) {
|
|
4475
|
+
dispatch({
|
|
4476
|
+
type: FORM_INPUT_UPDATE,
|
|
4477
|
+
name: filter.name,
|
|
4478
|
+
value: match[1]
|
|
4479
|
+
});
|
|
4480
|
+
}
|
|
4481
|
+
});
|
|
4482
|
+
}, [props.query, props.filters]);
|
|
4466
4483
|
function getNestedProperty2(obj, path) {
|
|
4467
4484
|
if (path.includes(".")) {
|
|
4468
4485
|
return path.split(".").reduce((prev, curr) => prev ? prev[curr] : null, obj);
|
|
@@ -4537,7 +4554,7 @@ var DataList = (props) => {
|
|
|
4537
4554
|
const showFirstPages = activePageNumber <= 5;
|
|
4538
4555
|
const showLastPages = activePageNumber > pages - 5;
|
|
4539
4556
|
if (showFirstPages) {
|
|
4540
|
-
return /* @__PURE__ */ jsxs35(
|
|
4557
|
+
return /* @__PURE__ */ jsxs35(Fragment10, { children: [
|
|
4541
4558
|
Array.from({ length: 8 }, (_, index) => index + 1).map((page) => /* @__PURE__ */ jsx65(React46.Fragment, { children: activePageNumber !== page ? /* @__PURE__ */ jsx65(
|
|
4542
4559
|
Hyperlink,
|
|
4543
4560
|
{
|
|
@@ -4585,7 +4602,7 @@ var DataList = (props) => {
|
|
|
4585
4602
|
) })
|
|
4586
4603
|
] });
|
|
4587
4604
|
} else if (showLastPages) {
|
|
4588
|
-
return /* @__PURE__ */ jsxs35(
|
|
4605
|
+
return /* @__PURE__ */ jsxs35(Fragment10, { children: [
|
|
4589
4606
|
/* @__PURE__ */ jsx65(
|
|
4590
4607
|
Hyperlink,
|
|
4591
4608
|
{
|
|
@@ -4615,7 +4632,7 @@ var DataList = (props) => {
|
|
|
4615
4632
|
)
|
|
4616
4633
|
] });
|
|
4617
4634
|
} else {
|
|
4618
|
-
return /* @__PURE__ */ jsxs35(
|
|
4635
|
+
return /* @__PURE__ */ jsxs35(Fragment10, { children: [
|
|
4619
4636
|
/* @__PURE__ */ jsx65(
|
|
4620
4637
|
Hyperlink,
|
|
4621
4638
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acoustte-digital-services/digitalstore-controls-dev",
|
|
3
|
-
"version": "0.8.1-dev.
|
|
3
|
+
"version": "0.8.1-dev.20260615062630",
|
|
4
4
|
"description": "Reusable React components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@types/node": "^25.9.
|
|
25
|
+
"@types/node": "^25.9.3",
|
|
26
26
|
"@types/react": "^19",
|
|
27
27
|
"@types/react-dom": "^19",
|
|
28
28
|
"tsup": "^8.5.1",
|