@plitzi/sdk-elements 0.32.4 → 0.32.6
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/CHANGELOG.md +30 -0
- package/dist/Element/ElementContext.d.ts +1 -0
- package/dist/Element/hocs/withElement.mjs +5 -3
- package/dist/Element/hooks/useElementDataSource.mjs +6 -1
- package/dist/Element/hooks/useElementState.mjs +1 -1
- package/dist/Element/hooks/useRootElementInteractions.mjs +29 -29
- package/dist/dataSource/getSourcesByElementId.mjs +1 -1
- package/dist/elements/advanced/Reference/Reference.mjs +2 -0
- package/dist/elements/form/Form/Form.mjs +77 -75
- package/dist/elements/form/FormControl/FormControl.mjs +1 -1
- package/dist/elements/internal/Page/Page.mjs +12 -11
- package/dist/elements/provider/ApiContainer/ApiContainer.mjs +70 -68
- package/dist/elements/provider/CollectionContainer/CollectionContainer.mjs +35 -32
- package/dist/elements/structure/DialogContainer/DialogContainer.mjs +93 -91
- package/dist/elements/structure/List/modes/ListControlled/ListControlled.mjs +28 -26
- package/dist/elements/structure/List/modes/ListControlled/ListControlledItem.mjs +23 -21
- package/dist/elements/structure/ModalContainer/ModalContainer.mjs +72 -70
- package/package.json +15 -15
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
import e from "../../../../../Element/ReplicaProvider.mjs";
|
|
2
2
|
import { useId as t, useMemo as n } from "react";
|
|
3
3
|
import { StoreProvider as r } from "@plitzi/nexus/react";
|
|
4
|
-
import {
|
|
5
|
-
import o from "
|
|
4
|
+
import { emptyObject as i } from "@plitzi/sdk-shared/helpers/utils";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import s from "clsx";
|
|
6
7
|
//#region src/elements/structure/List/modes/ListControlled/ListControlledItem.tsx
|
|
7
|
-
var
|
|
8
|
-
let
|
|
8
|
+
var c = ({ children: c, className: l = "", isTemplate: u = !1, itemCount: d = 0, record: f, source: p = "" }) => {
|
|
9
|
+
let m = t(), h = n(() => p ? { runtime: { sources: { [p]: {
|
|
10
|
+
item: f,
|
|
11
|
+
index: `${d}`
|
|
12
|
+
} } } } : i, [
|
|
13
|
+
p,
|
|
14
|
+
f,
|
|
15
|
+
d
|
|
16
|
+
]), g = /* @__PURE__ */ a(e, { children: /* @__PURE__ */ a(r, {
|
|
9
17
|
inherit: "live",
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} } } }), [
|
|
15
|
-
f,
|
|
16
|
-
d,
|
|
17
|
-
u
|
|
18
|
-
]),
|
|
19
|
-
children: s
|
|
18
|
+
name: `Row:${p}`,
|
|
19
|
+
segment: m,
|
|
20
|
+
value: h,
|
|
21
|
+
children: c
|
|
20
22
|
}) });
|
|
21
|
-
return
|
|
22
|
-
className:
|
|
23
|
-
children: [/* @__PURE__ */
|
|
23
|
+
return u ? /* @__PURE__ */ o("div", {
|
|
24
|
+
className: s("plitzi-component__controlled-list-item", l),
|
|
25
|
+
children: [/* @__PURE__ */ a("div", {
|
|
24
26
|
className: "controlled-list-item__counter",
|
|
25
|
-
children: `List Item - ${
|
|
26
|
-
}),
|
|
27
|
-
}) :
|
|
27
|
+
children: `List Item - ${d}`
|
|
28
|
+
}), g]
|
|
29
|
+
}) : g;
|
|
28
30
|
};
|
|
29
31
|
//#endregion
|
|
30
|
-
export {
|
|
32
|
+
export { c as default };
|
|
@@ -4,49 +4,50 @@ import n from "../../../Element/hocs/withElement.mjs";
|
|
|
4
4
|
import { use as r, useCallback as i, useEffect as a, useMemo as o, useState as s } from "react";
|
|
5
5
|
import c from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
|
|
6
6
|
import { StoreProvider as l } from "@plitzi/nexus/react";
|
|
7
|
-
import {
|
|
8
|
-
import { jsx as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
7
|
+
import { emptyObject as u, getPathsFromObeject as d } from "@plitzi/sdk-shared/helpers/utils";
|
|
8
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
9
|
+
import m from "clsx";
|
|
10
|
+
import h from "@plitzi/sdk-shared/dataSource/helpers/getSourceName";
|
|
11
|
+
import g from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
|
|
11
12
|
//#region src/elements/structure/ModalContainer/ModalContainer.tsx
|
|
12
|
-
var
|
|
13
|
-
let { id:
|
|
13
|
+
var _ = ({ ref: n, className: _ = "", children: v, title: y = "Modal Header", autoHideAfterClick: b = !0 }) => {
|
|
14
|
+
let { id: x, idRef: S, definition: { styleSelectors: C, label: w = "Modal" }, elementState: T, setElementState: E } = e(), D = h("modalContainer", { idRef: S }), { contexts: { InteractionsContext: O } } = c(), { interactionsManager: k } = r(O), [A, j] = s({}), M = i((e) => {
|
|
14
15
|
let { metadata: t } = e;
|
|
15
|
-
if (t && typeof t == "object")
|
|
16
|
+
if (t && typeof t == "object") j(t);
|
|
16
17
|
else if (typeof t == "string") try {
|
|
17
|
-
|
|
18
|
+
j(JSON.parse(t));
|
|
18
19
|
} catch {
|
|
19
|
-
|
|
20
|
+
j({ content: t });
|
|
20
21
|
}
|
|
21
|
-
else
|
|
22
|
-
|
|
22
|
+
else j(typeof t == "boolean" || typeof t == "number" ? { content: t } : {});
|
|
23
|
+
E((e) => ({
|
|
23
24
|
...e,
|
|
24
25
|
visibility: !0
|
|
25
26
|
}));
|
|
26
|
-
}, [
|
|
27
|
-
|
|
27
|
+
}, [E, j]), N = i(() => {
|
|
28
|
+
k.interactionTrigger(S, "onModalClose", { metadata: A }), j({}), E((e) => ({
|
|
28
29
|
...e,
|
|
29
30
|
visibility: !1
|
|
30
31
|
}));
|
|
31
32
|
}, [
|
|
32
|
-
|
|
33
|
-
C,
|
|
34
|
-
D,
|
|
33
|
+
k,
|
|
35
34
|
E,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
j,
|
|
36
|
+
A,
|
|
37
|
+
S
|
|
38
|
+
]), P = i(() => {
|
|
39
|
+
b && (k.interactionTrigger(S, "onModalClose", { metadata: A }), j({}), E((e) => ({
|
|
39
40
|
...e,
|
|
40
41
|
visibility: !1
|
|
41
42
|
})));
|
|
42
43
|
}, [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
C,
|
|
46
|
-
D,
|
|
44
|
+
k,
|
|
45
|
+
b,
|
|
47
46
|
E,
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
j,
|
|
48
|
+
A,
|
|
49
|
+
S
|
|
50
|
+
]), F = o(() => ({
|
|
50
51
|
onModalOpen: {
|
|
51
52
|
action: "onModalOpen",
|
|
52
53
|
title: "On Modal Open",
|
|
@@ -64,12 +65,12 @@ var h = ({ ref: n, className: h = "", children: g, title: _ = "Modal Header", au
|
|
|
64
65
|
preview: {},
|
|
65
66
|
params: {}
|
|
66
67
|
}
|
|
67
|
-
}), []),
|
|
68
|
+
}), []), I = o(() => ({
|
|
68
69
|
openModal: {
|
|
69
70
|
action: "openModal",
|
|
70
|
-
title: `Open ${
|
|
71
|
+
title: `Open ${w}`,
|
|
71
72
|
type: "callback",
|
|
72
|
-
callback:
|
|
73
|
+
callback: M,
|
|
73
74
|
params: { metadata: {
|
|
74
75
|
type: "text",
|
|
75
76
|
defaultValue: ""
|
|
@@ -78,26 +79,26 @@ var h = ({ ref: n, className: h = "", children: g, title: _ = "Modal Header", au
|
|
|
78
79
|
},
|
|
79
80
|
closeModal: {
|
|
80
81
|
action: "closeModal",
|
|
81
|
-
title: `Close ${
|
|
82
|
+
title: `Close ${w}`,
|
|
82
83
|
type: "callback",
|
|
83
|
-
callback:
|
|
84
|
+
callback: N,
|
|
84
85
|
params: {},
|
|
85
86
|
preview: {}
|
|
86
87
|
}
|
|
87
88
|
}), [
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
N,
|
|
90
|
+
M,
|
|
91
|
+
w
|
|
91
92
|
]);
|
|
92
93
|
a(() => {
|
|
93
|
-
|
|
94
|
+
T.visibility !== !1 && k.interactionTrigger(S, "onModalOpen", { metadata: A });
|
|
94
95
|
}, [
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
S,
|
|
97
|
+
k,
|
|
98
|
+
A,
|
|
99
|
+
T.visibility
|
|
99
100
|
]);
|
|
100
|
-
let
|
|
101
|
+
let L = i(() => d(A).reduce((e, t) => {
|
|
101
102
|
let n = t.split(".");
|
|
102
103
|
return n.length > 1 ? [...e, {
|
|
103
104
|
path: t,
|
|
@@ -106,44 +107,45 @@ var h = ({ ref: n, className: h = "", children: g, title: _ = "Modal Header", au
|
|
|
106
107
|
path: t,
|
|
107
108
|
name: n[n.length - 1]
|
|
108
109
|
}];
|
|
109
|
-
}, []), [
|
|
110
|
-
|
|
111
|
-
id:
|
|
112
|
-
source:
|
|
113
|
-
name:
|
|
114
|
-
fields:
|
|
110
|
+
}, []), [A]);
|
|
111
|
+
g({
|
|
112
|
+
id: x,
|
|
113
|
+
source: D,
|
|
114
|
+
name: w || `Modal - ${x}`,
|
|
115
|
+
fields: L
|
|
115
116
|
});
|
|
116
|
-
let
|
|
117
|
-
return /* @__PURE__ */
|
|
117
|
+
let R = o(() => D ? { runtime: { sources: { [D]: A } } } : u, [D, A]);
|
|
118
|
+
return /* @__PURE__ */ p(t, {
|
|
118
119
|
ref: n,
|
|
119
|
-
className:
|
|
120
|
-
interactionTriggers:
|
|
121
|
-
interactionCallbacks:
|
|
122
|
-
children: [/* @__PURE__ */
|
|
123
|
-
className:
|
|
124
|
-
onClick:
|
|
125
|
-
}), /* @__PURE__ */
|
|
126
|
-
className:
|
|
127
|
-
children: [/* @__PURE__ */
|
|
128
|
-
className:
|
|
129
|
-
children: [/* @__PURE__ */
|
|
130
|
-
className:
|
|
131
|
-
children:
|
|
132
|
-
}), /* @__PURE__ */
|
|
133
|
-
className:
|
|
120
|
+
className: m("plitzi-component__modal-container", _),
|
|
121
|
+
interactionTriggers: F,
|
|
122
|
+
interactionCallbacks: I,
|
|
123
|
+
children: [/* @__PURE__ */ f("div", {
|
|
124
|
+
className: m("modal-container__background", C.backgroundContainer),
|
|
125
|
+
onClick: P
|
|
126
|
+
}), /* @__PURE__ */ p("div", {
|
|
127
|
+
className: m("modal-container__root", C.rootContainer),
|
|
128
|
+
children: [/* @__PURE__ */ p("div", {
|
|
129
|
+
className: m("modal-container__header", C.headerContainer),
|
|
130
|
+
children: [/* @__PURE__ */ f("div", {
|
|
131
|
+
className: m("modal-container__header__title", C.headerTitle),
|
|
132
|
+
children: y || "Modal Header"
|
|
133
|
+
}), /* @__PURE__ */ f("i", {
|
|
134
|
+
className: m("fa-solid fa-xmark", C.headerCloseButton),
|
|
134
135
|
title: "Close",
|
|
135
|
-
onClick:
|
|
136
|
+
onClick: N
|
|
136
137
|
})]
|
|
137
|
-
}), /* @__PURE__ */
|
|
138
|
-
className:
|
|
139
|
-
children: /* @__PURE__ */
|
|
138
|
+
}), /* @__PURE__ */ f("div", {
|
|
139
|
+
className: m("modal-container__body", C.bodyContainer),
|
|
140
|
+
children: /* @__PURE__ */ f(l, {
|
|
140
141
|
inherit: "live",
|
|
141
|
-
|
|
142
|
-
|
|
142
|
+
name: `Modal:${x}`,
|
|
143
|
+
value: R,
|
|
144
|
+
children: v
|
|
143
145
|
})
|
|
144
146
|
})]
|
|
145
147
|
})]
|
|
146
148
|
});
|
|
147
|
-
},
|
|
149
|
+
}, v = n(_);
|
|
148
150
|
//#endregion
|
|
149
|
-
export {
|
|
151
|
+
export { _ as ModalContainer, v as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/sdk-elements",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.6",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -772,27 +772,27 @@
|
|
|
772
772
|
"type": "module",
|
|
773
773
|
"sideEffects": false,
|
|
774
774
|
"dependencies": {
|
|
775
|
-
"@plitzi/nexus": "0.32.
|
|
776
|
-
"@plitzi/plitzi-ui": "^1.6.
|
|
777
|
-
"@plitzi/sdk-auth": "0.32.
|
|
778
|
-
"@plitzi/sdk-dev-tools": "0.32.
|
|
779
|
-
"@plitzi/sdk-event-bridge": "0.32.
|
|
780
|
-
"@plitzi/sdk-interactions": "0.32.
|
|
781
|
-
"@plitzi/sdk-navigation": "0.32.
|
|
782
|
-
"@plitzi/sdk-schema": "0.32.
|
|
783
|
-
"@plitzi/sdk-shared": "0.32.
|
|
775
|
+
"@plitzi/nexus": "0.32.6",
|
|
776
|
+
"@plitzi/plitzi-ui": "^1.6.17",
|
|
777
|
+
"@plitzi/sdk-auth": "0.32.6",
|
|
778
|
+
"@plitzi/sdk-dev-tools": "0.32.6",
|
|
779
|
+
"@plitzi/sdk-event-bridge": "0.32.6",
|
|
780
|
+
"@plitzi/sdk-interactions": "0.32.6",
|
|
781
|
+
"@plitzi/sdk-navigation": "0.32.6",
|
|
782
|
+
"@plitzi/sdk-schema": "0.32.6",
|
|
783
|
+
"@plitzi/sdk-shared": "0.32.6",
|
|
784
784
|
"clsx": "^2.1.1",
|
|
785
|
-
"immer": "^11.1.
|
|
785
|
+
"immer": "^11.1.15"
|
|
786
786
|
},
|
|
787
787
|
"peerDependencies": {
|
|
788
788
|
"react": "^19",
|
|
789
789
|
"react-dom": "^19"
|
|
790
790
|
},
|
|
791
791
|
"devDependencies": {
|
|
792
|
-
"eslint": "^9.39.
|
|
793
|
-
"react": "^19.2.
|
|
792
|
+
"eslint": "^9.39.5",
|
|
793
|
+
"react": "^19.2.8",
|
|
794
794
|
"typescript": "^6.0.3",
|
|
795
|
-
"vite": "^8.
|
|
796
|
-
"vitest": "^4.1.
|
|
795
|
+
"vite": "^8.1.5",
|
|
796
|
+
"vitest": "^4.1.10"
|
|
797
797
|
}
|
|
798
798
|
}
|