@plitzi/sdk-elements 0.32.5 → 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 +15 -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/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 +14 -14
|
@@ -10,74 +10,75 @@ import { StoreProvider as d } from "@plitzi/nexus/react";
|
|
|
10
10
|
import { emptyObject as f, getPathsFromObeject as p } from "@plitzi/sdk-shared/helpers/utils";
|
|
11
11
|
import { jsx as m } from "react/jsx-runtime";
|
|
12
12
|
import h from "clsx";
|
|
13
|
-
import g from "@plitzi/sdk-shared/dataSource/
|
|
14
|
-
import
|
|
13
|
+
import g from "@plitzi/sdk-shared/dataSource/helpers/getSourceName";
|
|
14
|
+
import _ from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
|
|
15
|
+
import { QueryBuilderEvaluator as v } from "@plitzi/plitzi-ui/QueryBuilder";
|
|
15
16
|
//#region src/elements/provider/ApiContainer/ApiContainer.tsx
|
|
16
|
-
var
|
|
17
|
-
let { id:
|
|
18
|
-
if (!
|
|
17
|
+
var y = ({ ref: r, className: y = "", children: b, query: x = "", method: S = "get", accessToken: C = "", when: w = f, headers: T = f, mockData: E = "{}", subType: D = "div", credentials: O = "same-origin" }) => {
|
|
18
|
+
let { id: k, idRef: A, definition: { label: j = "Api Container" } } = e(), M = g("apiContainer", { idRef: A }), { settings: { previewMode: N, debugMode: P }, contexts: { NavigationContext: F, InteractionsContext: I } } = c(), { interactionsManager: L } = i(I), { routeParams: R, queryParams: z } = i(F), B = s(() => {
|
|
19
|
+
if (!x) return "";
|
|
19
20
|
try {
|
|
20
21
|
let e = {
|
|
21
|
-
...
|
|
22
|
-
...
|
|
22
|
+
...z,
|
|
23
|
+
...R
|
|
23
24
|
};
|
|
24
|
-
|
|
25
|
+
P && [...x.matchAll(/{{([ ]+|)(?<token>[a-zA-Z0-9-_:*/]+)([ ]+|)}}/gim)].forEach(({ groups: t }) => {
|
|
25
26
|
let n = t?.token.trim();
|
|
26
27
|
(!n || !l(e, n)) && console.log(`Token ${n} is required`);
|
|
27
28
|
});
|
|
28
|
-
let t = u(
|
|
29
|
-
return typeof t == "string" ? t :
|
|
29
|
+
let t = u(x, e, !0);
|
|
30
|
+
return typeof t == "string" ? t : x;
|
|
30
31
|
} catch (e) {
|
|
31
32
|
console.error(e.message);
|
|
32
33
|
}
|
|
33
34
|
return "";
|
|
34
35
|
}, [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
]),
|
|
40
|
-
...
|
|
41
|
-
Authorization: `Bearer ${
|
|
42
|
-
} :
|
|
43
|
-
...
|
|
44
|
-
...
|
|
45
|
-
})) || !
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
]), { isLoading:
|
|
53
|
-
url:
|
|
54
|
-
method:
|
|
55
|
-
credentials:
|
|
56
|
-
mock:
|
|
57
|
-
customHeaders:
|
|
58
|
-
enabled:
|
|
36
|
+
x,
|
|
37
|
+
z,
|
|
38
|
+
R,
|
|
39
|
+
P
|
|
40
|
+
]), V = s(() => C ? {
|
|
41
|
+
...T,
|
|
42
|
+
Authorization: `Bearer ${C}`
|
|
43
|
+
} : T, [T, C]), H = s(() => !!(N && B && (w === f || v(w, {
|
|
44
|
+
...R,
|
|
45
|
+
...z
|
|
46
|
+
})) || !N && (B || E && E !== "{}" && E !== f)), [
|
|
47
|
+
N,
|
|
48
|
+
B,
|
|
49
|
+
w,
|
|
50
|
+
R,
|
|
51
|
+
z,
|
|
52
|
+
E
|
|
53
|
+
]), { isLoading: U, data: W, refetch: G, isSuccess: K, isError: q } = n({
|
|
54
|
+
url: B,
|
|
55
|
+
method: S,
|
|
56
|
+
credentials: O,
|
|
57
|
+
mock: N ? void 0 : E,
|
|
58
|
+
customHeaders: V,
|
|
59
|
+
enabled: H
|
|
59
60
|
});
|
|
60
61
|
o(() => {
|
|
61
|
-
|
|
62
|
-
url:
|
|
63
|
-
method:
|
|
64
|
-
...
|
|
65
|
-
}) :
|
|
66
|
-
url:
|
|
67
|
-
method:
|
|
68
|
-
...
|
|
62
|
+
U || !A || (K ? L.interactionTrigger(A, "onApiSuccess", {
|
|
63
|
+
url: B,
|
|
64
|
+
method: S,
|
|
65
|
+
...W
|
|
66
|
+
}) : q && L.interactionTrigger(A, "onApiError", {
|
|
67
|
+
url: B,
|
|
68
|
+
method: S,
|
|
69
|
+
...W
|
|
69
70
|
}));
|
|
70
71
|
}, [
|
|
71
|
-
V,
|
|
72
|
-
O,
|
|
73
|
-
P,
|
|
74
72
|
W,
|
|
75
|
-
|
|
73
|
+
A,
|
|
74
|
+
L,
|
|
75
|
+
q,
|
|
76
76
|
U,
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
K,
|
|
78
|
+
S,
|
|
79
|
+
B
|
|
79
80
|
]);
|
|
80
|
-
let
|
|
81
|
+
let J = a(() => p(W).reduce((e, t) => {
|
|
81
82
|
let n = t.split(".");
|
|
82
83
|
return n.length > 1 ? [...e, {
|
|
83
84
|
path: t,
|
|
@@ -86,21 +87,21 @@ var v = ({ ref: r, className: v = "", children: y, query: b = "", method: x = "g
|
|
|
86
87
|
path: t,
|
|
87
88
|
name: n[n.length - 1]
|
|
88
89
|
}];
|
|
89
|
-
}, []), [
|
|
90
|
-
|
|
91
|
-
id:
|
|
92
|
-
source:
|
|
93
|
-
name:
|
|
94
|
-
fields:
|
|
90
|
+
}, []), [W]);
|
|
91
|
+
_({
|
|
92
|
+
id: k,
|
|
93
|
+
source: M,
|
|
94
|
+
name: j || `API - ${k}`,
|
|
95
|
+
fields: J
|
|
95
96
|
});
|
|
96
|
-
let
|
|
97
|
+
let Y = s(() => ({ performQuery: {
|
|
97
98
|
action: "performQuery",
|
|
98
|
-
title: `Perform Query ${
|
|
99
|
+
title: `Perform Query ${j}`,
|
|
99
100
|
type: "callback",
|
|
100
|
-
callback:
|
|
101
|
+
callback: G,
|
|
101
102
|
preview: {},
|
|
102
103
|
params: {}
|
|
103
|
-
} }), [
|
|
104
|
+
} }), [j, G]), X = s(() => ({
|
|
104
105
|
onApiError: {
|
|
105
106
|
action: "onApiError",
|
|
106
107
|
title: "On Api Error",
|
|
@@ -125,19 +126,20 @@ var v = ({ ref: r, className: v = "", children: y, query: b = "", method: x = "g
|
|
|
125
126
|
data: ""
|
|
126
127
|
}
|
|
127
128
|
}
|
|
128
|
-
}), []),
|
|
129
|
+
}), []), Z = s(() => M ? { runtime: { sources: { [M]: W } } } : f, [W, M]);
|
|
129
130
|
return /* @__PURE__ */ m(t, {
|
|
130
131
|
ref: r,
|
|
131
|
-
tag:
|
|
132
|
-
className: h("plitzi-component__api-container",
|
|
133
|
-
interactionTriggers:
|
|
134
|
-
interactionCallbacks:
|
|
132
|
+
tag: D,
|
|
133
|
+
className: h("plitzi-component__api-container", y),
|
|
134
|
+
interactionTriggers: X,
|
|
135
|
+
interactionCallbacks: Y,
|
|
135
136
|
children: /* @__PURE__ */ m(d, {
|
|
136
137
|
inherit: "live",
|
|
137
|
-
|
|
138
|
-
|
|
138
|
+
name: `Api:${k}`,
|
|
139
|
+
value: Z,
|
|
140
|
+
children: !U && b
|
|
139
141
|
})
|
|
140
142
|
});
|
|
141
|
-
},
|
|
143
|
+
}, b = r(y);
|
|
142
144
|
//#endregion
|
|
143
|
-
export {
|
|
145
|
+
export { y as ApiContainer, b as default };
|
|
@@ -5,20 +5,22 @@ import r from "../../../Element/hocs/withElement.mjs";
|
|
|
5
5
|
import { useCallback as i, useMemo as a } from "react";
|
|
6
6
|
import o from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
|
|
7
7
|
import { StoreProvider as s } from "@plitzi/nexus/react";
|
|
8
|
-
import {
|
|
9
|
-
import u from "
|
|
10
|
-
import d from "
|
|
8
|
+
import { emptyObject as c } from "@plitzi/sdk-shared/helpers/utils";
|
|
9
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
|
+
import d from "clsx";
|
|
11
|
+
import f from "@plitzi/sdk-shared/dataSource/helpers/getSourceName";
|
|
12
|
+
import p from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
|
|
11
13
|
//#region src/elements/provider/CollectionContainer/CollectionContainer.tsx
|
|
12
|
-
var
|
|
13
|
-
let { id:
|
|
14
|
-
source:
|
|
15
|
-
limit:
|
|
16
|
-
query:
|
|
17
|
-
singleRecord:
|
|
18
|
-
previewMode:
|
|
19
|
-
}),
|
|
14
|
+
var m = ({ ref: r, className: m = "", source: h = "", children: g, limit: _ = "10", query: v, singleRecord: y = !1 }) => {
|
|
15
|
+
let { id: b, idRef: x, definition: { label: S = "Collection Container" } } = e(), C = f("collectionContainer", { idRef: x }), { settings: { previewMode: w } } = o(), { loading: T, collection: E, fetch: D } = n({
|
|
16
|
+
source: h,
|
|
17
|
+
limit: _,
|
|
18
|
+
query: v,
|
|
19
|
+
singleRecord: y,
|
|
20
|
+
previewMode: w
|
|
21
|
+
}), O = i(() => {
|
|
20
22
|
let e = [];
|
|
21
|
-
return
|
|
23
|
+
return E ? (y || e.push({
|
|
22
24
|
path: "records",
|
|
23
25
|
name: "Records"
|
|
24
26
|
}), e.push({
|
|
@@ -27,40 +29,41 @@ var f = ({ ref: r, className: f = "", source: p = "", children: m, limit: h = "1
|
|
|
27
29
|
}), e.push({
|
|
28
30
|
path: "record.status",
|
|
29
31
|
name: "Record Status"
|
|
30
|
-
}), Object.values(
|
|
32
|
+
}), Object.values(E.fields).forEach((t) => {
|
|
31
33
|
e.push({
|
|
32
34
|
path: `record.values.${t.machineName}`,
|
|
33
35
|
name: `Record Field - ${t.name}`
|
|
34
36
|
});
|
|
35
37
|
}), e) : [];
|
|
36
|
-
}, [
|
|
37
|
-
|
|
38
|
-
id:
|
|
39
|
-
source:
|
|
40
|
-
name:
|
|
41
|
-
fields:
|
|
38
|
+
}, [E, y]);
|
|
39
|
+
p({
|
|
40
|
+
id: b,
|
|
41
|
+
source: C,
|
|
42
|
+
name: S || `Collection - ${E?.name || b}`,
|
|
43
|
+
fields: O
|
|
42
44
|
});
|
|
43
|
-
let
|
|
45
|
+
let k = a(() => ({ performQuery: {
|
|
44
46
|
action: "performQuery",
|
|
45
|
-
title: `Refresh ${
|
|
47
|
+
title: `Refresh ${S}`,
|
|
46
48
|
type: "callback",
|
|
47
|
-
callback:
|
|
49
|
+
callback: D,
|
|
48
50
|
preview: {},
|
|
49
51
|
params: {}
|
|
50
|
-
} }), [
|
|
51
|
-
if (!(!
|
|
52
|
+
} }), [D, S]), A = a(() => C ? { runtime: { sources: { [C]: E } } } : c, [E, C]);
|
|
53
|
+
if (!(!E && w)) return /* @__PURE__ */ u(t, {
|
|
52
54
|
ref: r,
|
|
53
|
-
interactionCallbacks:
|
|
54
|
-
className:
|
|
55
|
-
children: [!
|
|
55
|
+
interactionCallbacks: k,
|
|
56
|
+
className: d("plitzi-component__collection-container", m, { "collection-container--context-empty": !E }),
|
|
57
|
+
children: [!E && /* @__PURE__ */ l("div", {
|
|
56
58
|
className: "collection-container__message",
|
|
57
59
|
children: "Source Not Selected"
|
|
58
|
-
}),
|
|
60
|
+
}), E && !T && /* @__PURE__ */ l(s, {
|
|
59
61
|
inherit: "live",
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
name: `Collection:${b}`,
|
|
63
|
+
value: A,
|
|
64
|
+
children: g
|
|
62
65
|
})]
|
|
63
66
|
});
|
|
64
|
-
},
|
|
67
|
+
}, h = r(m);
|
|
65
68
|
//#endregion
|
|
66
|
-
export {
|
|
69
|
+
export { m as CollectionContainer, h as default };
|
|
@@ -4,71 +4,72 @@ 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/DialogContainer/DialogContainer.tsx
|
|
12
|
-
var
|
|
13
|
-
let { id:
|
|
13
|
+
var _ = ({ ref: n, className: _ = "", children: v, headerLabel: y = "Dialog Header", acceptButtonLabel: b = "Accept", acceptButtonLabelLoading: x = "Loading...", rejectButtonLabel: S = "Cancel", autoHideAfterClick: C = !0 }) => {
|
|
14
|
+
let { id: w, idRef: T, setElementState: E, definition: { styleSelectors: D, label: O = "Dialog" }, elementState: k } = e(), A = h("dialogContainer", { idRef: T }), { contexts: { InteractionsContext: j } } = c(), { interactionsManager: M } = r(j), [N, P] = s({}), [F, I] = s(!1), L = i((e) => {
|
|
14
15
|
let { metadata: t } = e;
|
|
15
|
-
if (t && typeof t == "object")
|
|
16
|
+
if (t && typeof t == "object") P(t);
|
|
16
17
|
else if (typeof t == "string") try {
|
|
17
|
-
|
|
18
|
+
P(JSON.parse(t));
|
|
18
19
|
} catch {
|
|
19
|
-
|
|
20
|
+
P({ content: t });
|
|
20
21
|
}
|
|
21
|
-
else
|
|
22
|
-
|
|
22
|
+
else P(typeof t == "boolean" || typeof t == "number" ? { content: t } : {});
|
|
23
|
+
E((e) => ({
|
|
23
24
|
...e,
|
|
24
25
|
visibility: !0
|
|
25
26
|
}));
|
|
26
|
-
}, [
|
|
27
|
-
|
|
27
|
+
}, [E, P]), R = i(() => {
|
|
28
|
+
M.interactionTrigger(T, "onDialogClose", { metadata: N }), P({}), E((e) => ({
|
|
28
29
|
...e,
|
|
29
30
|
visibility: !1
|
|
30
31
|
}));
|
|
31
32
|
}, [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
]),
|
|
38
|
-
|
|
33
|
+
M,
|
|
34
|
+
E,
|
|
35
|
+
P,
|
|
36
|
+
N,
|
|
37
|
+
T
|
|
38
|
+
]), z = i(() => {
|
|
39
|
+
C && (M.interactionTrigger(T, "onDialogClose", { metadata: N }), P({}), E((e) => ({
|
|
39
40
|
...e,
|
|
40
41
|
visibility: !1
|
|
41
42
|
})));
|
|
42
43
|
}, [
|
|
43
|
-
|
|
44
|
-
x,
|
|
44
|
+
M,
|
|
45
45
|
C,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
E,
|
|
47
|
+
P,
|
|
48
|
+
N,
|
|
49
|
+
T
|
|
49
50
|
]);
|
|
50
51
|
i(async () => {
|
|
51
|
-
|
|
52
|
+
I(!0), await M.interactionTrigger(T, "onDialogAccept", { metadata: N }), I(!1), E((e) => ({
|
|
52
53
|
...e,
|
|
53
54
|
visibility: !1
|
|
54
55
|
}));
|
|
55
56
|
}, [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
M,
|
|
58
|
+
T,
|
|
59
|
+
N,
|
|
60
|
+
E
|
|
60
61
|
]), i(async () => {
|
|
61
|
-
|
|
62
|
+
I(!0), await M.interactionTrigger(T, "onDialogReject", { metadata: N }), I(!1), E((e) => ({
|
|
62
63
|
...e,
|
|
63
64
|
visibility: !1
|
|
64
65
|
}));
|
|
65
66
|
}, [
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
M,
|
|
68
|
+
T,
|
|
69
|
+
N,
|
|
70
|
+
E
|
|
70
71
|
]);
|
|
71
|
-
let
|
|
72
|
+
let B = o(() => ({
|
|
72
73
|
onDialogAccept: {
|
|
73
74
|
action: "onDialogAccept",
|
|
74
75
|
title: "On Dialog Accept",
|
|
@@ -109,12 +110,12 @@ var h = ({ ref: n, className: h = "", children: g, headerLabel: _ = "Dialog Head
|
|
|
109
110
|
} },
|
|
110
111
|
preview: { metadata: "" }
|
|
111
112
|
}
|
|
112
|
-
}), []),
|
|
113
|
+
}), []), V = o(() => ({
|
|
113
114
|
openDialog: {
|
|
114
115
|
action: "openDialog",
|
|
115
|
-
title: `Open ${
|
|
116
|
+
title: `Open ${O}`,
|
|
116
117
|
type: "callback",
|
|
117
|
-
callback:
|
|
118
|
+
callback: L,
|
|
118
119
|
params: { metadata: {
|
|
119
120
|
type: "text",
|
|
120
121
|
defaultValue: ""
|
|
@@ -123,26 +124,26 @@ var h = ({ ref: n, className: h = "", children: g, headerLabel: _ = "Dialog Head
|
|
|
123
124
|
},
|
|
124
125
|
closeDialog: {
|
|
125
126
|
action: "closeDialog",
|
|
126
|
-
title: `Close ${
|
|
127
|
+
title: `Close ${O}`,
|
|
127
128
|
type: "callback",
|
|
128
|
-
callback:
|
|
129
|
+
callback: R,
|
|
129
130
|
preview: {},
|
|
130
131
|
params: {}
|
|
131
132
|
}
|
|
132
133
|
}), [
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
R,
|
|
135
|
+
L,
|
|
136
|
+
O
|
|
136
137
|
]);
|
|
137
138
|
a(() => {
|
|
138
|
-
|
|
139
|
+
k.visibility !== !1 && M.interactionTrigger(T, "onDialogOpen", { metadata: N });
|
|
139
140
|
}, [
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
T,
|
|
142
|
+
M,
|
|
143
|
+
N,
|
|
144
|
+
k.visibility
|
|
144
145
|
]);
|
|
145
|
-
let
|
|
146
|
+
let H = i(() => typeof N == "object" ? d(N).reduce((e, t) => {
|
|
146
147
|
let n = t.split(".");
|
|
147
148
|
return n.length > 1 ? [...e, {
|
|
148
149
|
path: t,
|
|
@@ -151,64 +152,65 @@ var h = ({ ref: n, className: h = "", children: g, headerLabel: _ = "Dialog Head
|
|
|
151
152
|
path: t,
|
|
152
153
|
name: n[n.length - 1]
|
|
153
154
|
}];
|
|
154
|
-
}, []) : [], [
|
|
155
|
-
|
|
156
|
-
id:
|
|
157
|
-
source:
|
|
158
|
-
name:
|
|
159
|
-
fields:
|
|
155
|
+
}, []) : [], [N]);
|
|
156
|
+
g({
|
|
157
|
+
id: w,
|
|
158
|
+
source: A,
|
|
159
|
+
name: O || `Dialog - ${w}`,
|
|
160
|
+
fields: H
|
|
160
161
|
});
|
|
161
|
-
let
|
|
162
|
-
return /* @__PURE__ */
|
|
162
|
+
let U = o(() => A ? { runtime: { sources: { [A]: N } } } : u, [A, N]);
|
|
163
|
+
return /* @__PURE__ */ p(t, {
|
|
163
164
|
ref: n,
|
|
164
|
-
className:
|
|
165
|
-
interactionTriggers:
|
|
166
|
-
interactionCallbacks:
|
|
167
|
-
children: [/* @__PURE__ */
|
|
168
|
-
className:
|
|
169
|
-
onClick:
|
|
170
|
-
}), /* @__PURE__ */
|
|
171
|
-
className:
|
|
165
|
+
className: m("plitzi-component__dialog-container", _),
|
|
166
|
+
interactionTriggers: B,
|
|
167
|
+
interactionCallbacks: V,
|
|
168
|
+
children: [/* @__PURE__ */ f("div", {
|
|
169
|
+
className: m("dialog-container__background", D.backgroundContainer),
|
|
170
|
+
onClick: z
|
|
171
|
+
}), /* @__PURE__ */ p("div", {
|
|
172
|
+
className: m("dialog-container__root", D.rootContainer),
|
|
172
173
|
children: [
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
-
className:
|
|
175
|
-
children: [/* @__PURE__ */
|
|
176
|
-
className:
|
|
177
|
-
children:
|
|
178
|
-
}), /* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ p("div", {
|
|
175
|
+
className: m("dialog-container__header", D.headerContainer),
|
|
176
|
+
children: [/* @__PURE__ */ f("div", {
|
|
177
|
+
className: m("dialog-container__header__title", D.headerTitle),
|
|
178
|
+
children: y || "Dialog Header"
|
|
179
|
+
}), /* @__PURE__ */ f("i", {
|
|
179
180
|
className: "fa-solid fa-xmark",
|
|
180
181
|
title: "Close",
|
|
181
182
|
onClick: void 0
|
|
182
183
|
})]
|
|
183
184
|
}),
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
-
className:
|
|
186
|
-
children: /* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ f("div", {
|
|
186
|
+
className: m("dialog-container__body", D.body),
|
|
187
|
+
children: /* @__PURE__ */ f(l, {
|
|
187
188
|
inherit: "live",
|
|
188
|
-
|
|
189
|
-
|
|
189
|
+
name: `Dialog:${w}`,
|
|
190
|
+
value: U,
|
|
191
|
+
children: v
|
|
190
192
|
})
|
|
191
193
|
}),
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
-
className:
|
|
194
|
-
children: [/* @__PURE__ */
|
|
195
|
-
className:
|
|
194
|
+
/* @__PURE__ */ p("div", {
|
|
195
|
+
className: m("dialog-container__footer", D.footerContainer),
|
|
196
|
+
children: [/* @__PURE__ */ p("button", {
|
|
197
|
+
className: m("footer__button button--accept", D.acceptButton),
|
|
196
198
|
onClick: void 0,
|
|
197
|
-
disabled:
|
|
198
|
-
children: [
|
|
199
|
+
disabled: F,
|
|
200
|
+
children: [F && /* @__PURE__ */ p("div", {
|
|
199
201
|
className: "button--accept__container",
|
|
200
|
-
children: [/* @__PURE__ */
|
|
201
|
-
}), !
|
|
202
|
-
}), /* @__PURE__ */
|
|
203
|
-
className:
|
|
202
|
+
children: [/* @__PURE__ */ f("i", { className: "fa-solid fa-rotate fa-spin" }), x]
|
|
203
|
+
}), !F && b]
|
|
204
|
+
}), /* @__PURE__ */ f("button", {
|
|
205
|
+
className: m("footer__button button--cancel", D.cancelButton),
|
|
204
206
|
onClick: void 0,
|
|
205
|
-
disabled:
|
|
206
|
-
children:
|
|
207
|
+
disabled: F,
|
|
208
|
+
children: S
|
|
207
209
|
})]
|
|
208
210
|
})
|
|
209
211
|
]
|
|
210
212
|
})]
|
|
211
213
|
});
|
|
212
|
-
},
|
|
214
|
+
}, v = n(_);
|
|
213
215
|
//#endregion
|
|
214
|
-
export {
|
|
216
|
+
export { _ as DialogContainer, v as default };
|
|
@@ -5,48 +5,50 @@ import { useCallback as r, useMemo as i } from "react";
|
|
|
5
5
|
import a from "@plitzi/sdk-shared/hooks/usePlitziServiceContext";
|
|
6
6
|
import { get as o } from "@plitzi/plitzi-ui/helpers";
|
|
7
7
|
import { StoreProvider as s } from "@plitzi/nexus/react";
|
|
8
|
-
import {
|
|
9
|
-
import { jsx as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
8
|
+
import { emptyObject as c, getPathsFromObeject as l } from "@plitzi/sdk-shared/helpers/utils";
|
|
9
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
10
|
+
import f from "clsx";
|
|
11
|
+
import p from "@plitzi/sdk-shared/dataSource/helpers/getSourceName";
|
|
12
|
+
import m from "@plitzi/sdk-shared/dataSource/hooks/useRegisterSource";
|
|
12
13
|
//#region src/elements/structure/List/modes/ListControlled/ListControlled.tsx
|
|
13
|
-
var
|
|
14
|
-
let { id:
|
|
15
|
-
item: o(
|
|
14
|
+
var h = ({ ref: h, className: g = "", children: _, items: v = [] }) => {
|
|
15
|
+
let { id: y, idRef: b, definition: { label: x } } = e(), S = p("list", { idRef: b }), { settings: { previewMode: C } } = a(), w = i(() => Array.isArray(v) ? v : [], [v]), T = r(() => l({
|
|
16
|
+
item: o(w, "0", {}),
|
|
16
17
|
index: "0"
|
|
17
18
|
}).reduce((e, t) => [...e, {
|
|
18
19
|
path: t,
|
|
19
20
|
name: t
|
|
20
|
-
}], []), [
|
|
21
|
-
return
|
|
22
|
-
id:
|
|
23
|
-
source:
|
|
24
|
-
name:
|
|
25
|
-
fields:
|
|
26
|
-
}), /* @__PURE__ */
|
|
27
|
-
ref:
|
|
28
|
-
className:
|
|
29
|
-
children: [/* @__PURE__ */
|
|
21
|
+
}], []), [w]), E = i(() => S ? { runtime: { sources: { [S]: { items: w } } } } : c, [S, w]);
|
|
22
|
+
return m({
|
|
23
|
+
id: y,
|
|
24
|
+
source: S,
|
|
25
|
+
name: x || `List - ${y}`,
|
|
26
|
+
fields: T
|
|
27
|
+
}), /* @__PURE__ */ d(t, {
|
|
28
|
+
ref: h,
|
|
29
|
+
className: f("plitzi-component__controlled-list", g, { "controlled-list--build-mode": !C }),
|
|
30
|
+
children: [/* @__PURE__ */ u(s, {
|
|
30
31
|
inherit: "live",
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
name: `List:${y}`,
|
|
33
|
+
value: E,
|
|
34
|
+
children: w.map((e, t) => !_ || Array.isArray(_) && _.length === 0 ? /* @__PURE__ */ u("div", {
|
|
33
35
|
className: "plitzi-component__controlled-list-item controlled-list--empty",
|
|
34
|
-
children: /* @__PURE__ */
|
|
36
|
+
children: /* @__PURE__ */ u("div", {
|
|
35
37
|
className: "controlled-list-item__counter",
|
|
36
38
|
children: `List Item - ${t + 1}`
|
|
37
39
|
})
|
|
38
|
-
}, t) : /* @__PURE__ */
|
|
40
|
+
}, t) : /* @__PURE__ */ u(n, {
|
|
39
41
|
itemCount: t + 1,
|
|
40
|
-
isTemplate: t !== 0 && !
|
|
42
|
+
isTemplate: t !== 0 && !C,
|
|
41
43
|
record: e,
|
|
42
|
-
source:
|
|
43
|
-
children:
|
|
44
|
+
source: S,
|
|
45
|
+
children: _
|
|
44
46
|
}, t))
|
|
45
|
-
}), !
|
|
47
|
+
}), !C && w.length === 0 && /* @__PURE__ */ u("div", {
|
|
46
48
|
className: "controlled-list controlled-list--empty",
|
|
47
49
|
children: "This list does not contain any items"
|
|
48
50
|
})]
|
|
49
51
|
});
|
|
50
52
|
};
|
|
51
53
|
//#endregion
|
|
52
|
-
export {
|
|
54
|
+
export { h as default };
|