@ramesesinc/platform-core 0.1.8 → 0.1.10
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/components/action/LookupPage.d.ts +2 -1
- package/dist/components/action/LookupPage.js +4 -3
- package/dist/components/action/Play.d.ts +6 -0
- package/dist/components/action/Play.js +40 -0
- package/dist/components/action/ProgressBar.d.ts +8 -0
- package/dist/components/action/ProgressBar.js +146 -0
- package/dist/components/action/ViewPage.d.ts +2 -1
- package/dist/components/action/ViewPage.js +19 -9
- package/dist/components/common/UIMenu.js +4 -3
- package/dist/components/index.d.ts +7 -1
- package/dist/components/index.js +5 -1
- package/dist/components/input/Combo.d.ts +21 -0
- package/dist/components/input/Combo.js +137 -0
- package/dist/components/input/DateField.js +7 -14
- package/dist/components/input/Text.d.ts +5 -0
- package/dist/components/input/Text.js +42 -7
- package/dist/components/list/EditableMenu.d.ts +2 -0
- package/dist/components/list/EditableMenu.js +128 -0
- package/dist/components/list/TabMenu.js +2 -2
- package/dist/components/list/TreeMenu.js +17 -12
- package/dist/components/table/DataList.d.ts +1 -1
- package/dist/components/table/DataList.js +49 -24
- package/dist/components/table/DataTable.d.ts +2 -0
- package/dist/components/table/DataTable.js +31 -22
- package/dist/components/view/FilterView.js +1 -1
- package/dist/components/view/HtmlForm.js +12 -9
- package/dist/components/view/PageView.js +36 -9
- package/dist/components/view/RootView.js +16 -16
- package/dist/core/AuthContext.js +1 -1
- package/dist/core/Page.js +2 -4
- package/dist/core/PageCache.d.ts +0 -2
- package/dist/core/PageCache.js +3 -8
- package/dist/core/PageContext.js +12 -0
- package/dist/core/PageViewContext.d.ts +8 -2
- package/dist/core/PageViewContext.js +129 -75
- package/dist/core/Panel.js +31 -9
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -0
- package/dist/index.css +79 -0
- package/dist/layouts/CardLayout.d.ts +2 -2
- package/dist/layouts/CardLayout.js +3 -4
- package/dist/layouts/HPanel.d.ts +2 -2
- package/dist/layouts/HPanel.js +1 -2
- package/dist/layouts/VPanel.d.ts +2 -2
- package/dist/layouts/VPanel.js +1 -2
- package/dist/layouts/index.d.ts +2 -3
- package/dist/layouts/index.js +2 -3
- package/dist/lib/utils/ExprUtil.js +18 -29
- package/dist/lib/utils/ResourceLoader.js +19 -7
- package/dist/lib/utils/SectionProvider.js +1 -1
- package/dist/lib/utils/initResourceLoader.d.ts +2 -0
- package/dist/lib/utils/initResourceLoader.js +64 -95
- package/dist/lib/utils/nunjucks.d.ts +2 -0
- package/dist/lib/utils/nunjucks.js +8 -0
- package/dist/templates/CrudFormTemplate.js +2 -3
- package/dist/templates/DataListTemplate.js +1 -1
- package/dist/templates/WizardTemplate.js +3 -1
- package/package.json +1 -1
- package/dist/components/input/Select.d.ts +0 -14
- package/dist/components/input/Select.js +0 -40
|
@@ -17,13 +17,18 @@ const PageViewContext = createContext({
|
|
|
17
17
|
getSelectedPage: () => null,
|
|
18
18
|
pushPage: () => { },
|
|
19
19
|
popPage: () => { },
|
|
20
|
-
setSelectedPage: () => { },
|
|
21
20
|
hasBackPage: () => false,
|
|
22
21
|
isStandalone: () => false,
|
|
23
22
|
hasSelectionHandling: () => false,
|
|
24
23
|
setSelectionHandling: () => null,
|
|
25
24
|
getOriginalLocationInfo: () => null,
|
|
26
25
|
getEventHandler: () => null,
|
|
26
|
+
getUrl: () => "",
|
|
27
|
+
getPage: () => "",
|
|
28
|
+
getParams: () => ({}),
|
|
29
|
+
getSubPaths: () => [],
|
|
30
|
+
isRootView: () => false,
|
|
31
|
+
getPageChainInfo: () => ({ path: "", base: "", page: "", options: {}, params: {} }),
|
|
27
32
|
});
|
|
28
33
|
const usePageViewUI = () => {
|
|
29
34
|
const propsRef = useRef({});
|
|
@@ -49,7 +54,7 @@ const usePageViewUI = () => {
|
|
|
49
54
|
handler(e);
|
|
50
55
|
}
|
|
51
56
|
catch (err) {
|
|
52
|
-
// do nothing: let the handler handle its own error
|
|
57
|
+
// do nothing: let the handler handle its own error
|
|
53
58
|
}
|
|
54
59
|
});
|
|
55
60
|
};
|
|
@@ -57,13 +62,13 @@ const usePageViewUI = () => {
|
|
|
57
62
|
if (name == null)
|
|
58
63
|
return;
|
|
59
64
|
propsRef.current[name] = value;
|
|
60
|
-
if (String(autoPublish) ===
|
|
65
|
+
if (String(autoPublish) === "true") {
|
|
61
66
|
notifyChange(name, value);
|
|
62
67
|
}
|
|
63
68
|
};
|
|
64
69
|
const get = (name) => {
|
|
65
70
|
var _a;
|
|
66
|
-
const value = name == null ? null : (_a = propsRef.current[name]) !== null && _a !== void 0 ? _a : null;
|
|
71
|
+
const value = name == null ? null : ((_a = propsRef.current[name]) !== null && _a !== void 0 ? _a : null);
|
|
67
72
|
return value;
|
|
68
73
|
};
|
|
69
74
|
const getTitle = () => {
|
|
@@ -114,33 +119,42 @@ export const PageViewProvider = ({ paths, handle, children, prefix = "page", eve
|
|
|
114
119
|
paths.push(hash);
|
|
115
120
|
}
|
|
116
121
|
let [, ...anchors] = hash.split("#");
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
122
|
+
if (prefix === "root") {
|
|
123
|
+
// root level - no hash in base
|
|
124
|
+
// console.log("root finalBasePaths[0]", finalBasePaths[0]);
|
|
125
|
+
result.base = finalBasePaths[0]; // just pathname + query, no hash
|
|
126
|
+
result.path = finalBasePaths[0];
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
// child levels - include anchors up to current paths level
|
|
130
|
+
anchors = anchors.slice(0, -1);
|
|
131
|
+
if (anchors.length > 0) {
|
|
132
|
+
finalBasePaths.push("#" + anchors.join("#"));
|
|
133
|
+
}
|
|
134
|
+
result.base = finalBasePaths.join("");
|
|
135
|
+
result.path = paths.join("");
|
|
120
136
|
}
|
|
121
|
-
result.base = finalBasePaths.join("");
|
|
122
|
-
result.path = paths.join("");
|
|
123
137
|
return result;
|
|
124
138
|
}
|
|
125
139
|
catch (err) {
|
|
126
140
|
console.log("Error getting path location info:", err);
|
|
127
141
|
return result;
|
|
128
142
|
}
|
|
129
|
-
}, []);
|
|
143
|
+
}, [prefix]);
|
|
130
144
|
const originalLocInfo = useMemo(() => {
|
|
145
|
+
var _a;
|
|
131
146
|
const [, selectedPath] = paths;
|
|
132
147
|
const standalone = isStandalone();
|
|
133
|
-
const chainInfo = {
|
|
148
|
+
const chainInfo = { path: "", base: "", page: "", options: {}, params: {} };
|
|
134
149
|
if (standalone) {
|
|
135
150
|
chainInfo.path = selectedPath !== null && selectedPath !== void 0 ? selectedPath : "";
|
|
136
151
|
chainInfo.page = chainInfo.path;
|
|
137
152
|
}
|
|
138
153
|
else {
|
|
139
|
-
const loc = getLocationInfo();
|
|
154
|
+
const loc = (_a = getLocationInfo()) !== null && _a !== void 0 ? _a : { root: "", path: "", base: "" };
|
|
140
155
|
chainInfo.base = loc.base;
|
|
141
156
|
chainInfo.path = [loc.path, selectedPath].filter(Boolean).join("#");
|
|
142
157
|
}
|
|
143
|
-
// console.log("pageview original loc info ", chainInfo);
|
|
144
158
|
return chainInfo;
|
|
145
159
|
}, [paths, handle]);
|
|
146
160
|
const [pageChain, setPageChain] = useState(() => {
|
|
@@ -172,18 +186,6 @@ export const PageViewProvider = ({ paths, handle, children, prefix = "page", eve
|
|
|
172
186
|
const standalone = isStandalone();
|
|
173
187
|
// console.log("pageChain changed", uuid, standalone, pageChain);
|
|
174
188
|
}, [pageChain]);
|
|
175
|
-
const setSelectedPage = (page) => {
|
|
176
|
-
const chainInfo = pageChain.current;
|
|
177
|
-
const newChainInfo = Object.assign(Object.assign({}, chainInfo), { page });
|
|
178
|
-
if (page == null || page === "") {
|
|
179
|
-
// do nothing
|
|
180
|
-
}
|
|
181
|
-
else {
|
|
182
|
-
newChainInfo.path = newChainInfo.base + "#" + page;
|
|
183
|
-
newChainInfo.page = page;
|
|
184
|
-
}
|
|
185
|
-
pageChain.current = newChainInfo;
|
|
186
|
-
};
|
|
187
189
|
const setPage = (page, options = {}) => {
|
|
188
190
|
var _a;
|
|
189
191
|
if (page == null || page.trim() === "") {
|
|
@@ -191,26 +193,30 @@ export const PageViewProvider = ({ paths, handle, children, prefix = "page", eve
|
|
|
191
193
|
}
|
|
192
194
|
const standalone = isStandalone();
|
|
193
195
|
const pageOptions = options !== null && options !== void 0 ? options : {};
|
|
194
|
-
const { mode = "
|
|
195
|
-
const locInfo = getLocationInfo();
|
|
196
|
+
const { mode = "self" } = pageOptions;
|
|
196
197
|
const { current: currentChain, previous: previousChain } = pageChain;
|
|
197
|
-
const newChainInfo = { path: "", base: "", page: "", options: pageOptions };
|
|
198
|
+
const newChainInfo = { path: "", base: "", page: "", options: pageOptions, params: {} };
|
|
198
199
|
const newPageChain = { current: newChainInfo, previous: null };
|
|
199
|
-
// console.log("setPage mode => ", { page, pageOptions });
|
|
200
200
|
if (mode != null && mode === "window") {
|
|
201
|
+
if (!uuid.startsWith("root")) {
|
|
202
|
+
parentContext === null || parentContext === void 0 ? void 0 : parentContext.setPage(page, options);
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
const locInfo = getLocationInfo();
|
|
201
206
|
newChainInfo.page = page;
|
|
202
207
|
newChainInfo.base = locInfo.root;
|
|
203
208
|
newChainInfo.path = locInfo.root + "/" + page;
|
|
204
209
|
newPageChain.previous = { current: currentChain, previous: previousChain };
|
|
205
210
|
}
|
|
206
211
|
else {
|
|
212
|
+
const currentUrl = getUrl();
|
|
207
213
|
newChainInfo.page = page;
|
|
208
|
-
newChainInfo.base =
|
|
209
|
-
newChainInfo.path = [
|
|
214
|
+
newChainInfo.base = currentUrl;
|
|
215
|
+
newChainInfo.path = [currentUrl, page].filter(Boolean).join("#");
|
|
210
216
|
}
|
|
211
217
|
setPageChain((prev) => (Object.assign({}, newPageChain)));
|
|
212
218
|
if (!standalone) {
|
|
213
|
-
// console.log("setPage push state => ", { newChainInfo });
|
|
219
|
+
// console.log("setPage push state => ", { newChainInfo });
|
|
214
220
|
history.pushState(null, "", newChainInfo.path);
|
|
215
221
|
}
|
|
216
222
|
(_a = handleRef.current) === null || _a === void 0 ? void 0 : _a.renderPage(page);
|
|
@@ -220,15 +226,21 @@ export const PageViewProvider = ({ paths, handle, children, prefix = "page", eve
|
|
|
220
226
|
if (page == null)
|
|
221
227
|
return;
|
|
222
228
|
const standalone = isStandalone();
|
|
223
|
-
// console.log("pushPage (pageChain)", uuid, prefix, pageChain, standalone, parentContext);
|
|
224
229
|
const { current: chainInfo, previous: prevChain } = pageChain;
|
|
225
|
-
if (
|
|
226
|
-
|
|
230
|
+
if (prefix === "root") {
|
|
231
|
+
setPage(page, { mode: "window" });
|
|
232
|
+
return;
|
|
227
233
|
}
|
|
234
|
+
// if (standalone && (chainInfo.path == null || chainInfo.path === "")) {
|
|
235
|
+
// Object.assign(chainInfo, { path: paths[0], base: "", page: paths[0] });
|
|
236
|
+
// }
|
|
237
|
+
const loc = getLocationInfo();
|
|
228
238
|
const newChainInfo = {
|
|
229
|
-
path: [
|
|
230
|
-
base:
|
|
239
|
+
path: [loc.base, page].filter(Boolean).join("#"),
|
|
240
|
+
base: loc.base,
|
|
231
241
|
page: page,
|
|
242
|
+
options: {},
|
|
243
|
+
params: {},
|
|
232
244
|
};
|
|
233
245
|
const newPageChain = {
|
|
234
246
|
current: newChainInfo,
|
|
@@ -241,53 +253,57 @@ export const PageViewProvider = ({ paths, handle, children, prefix = "page", eve
|
|
|
241
253
|
(_a = handleRef.current) === null || _a === void 0 ? void 0 : _a.renderPage(page);
|
|
242
254
|
};
|
|
243
255
|
const popPage = () => {
|
|
244
|
-
var _a, _b
|
|
245
|
-
// console.log("popPage (pageChain)", uuid, prefix, JSON.stringify(pageChain));
|
|
256
|
+
var _a, _b;
|
|
246
257
|
const { previous: prevChain } = pageChain;
|
|
247
|
-
if (prevChain == null)
|
|
258
|
+
if (prevChain == null)
|
|
248
259
|
return;
|
|
249
|
-
}
|
|
250
260
|
const standalone = isStandalone();
|
|
251
261
|
const current = (_a = prevChain === null || prevChain === void 0 ? void 0 : prevChain.current) !== null && _a !== void 0 ? _a : {};
|
|
252
262
|
const { path, options = {} } = current;
|
|
253
|
-
if (path == null || path === "")
|
|
263
|
+
if (path == null || path === "")
|
|
254
264
|
return;
|
|
255
|
-
|
|
256
|
-
// extract page from path
|
|
257
|
-
let page = "";
|
|
258
|
-
if (prefix === "root") {
|
|
259
|
-
let newPath = path.split("#")[0].split("?")[0];
|
|
260
|
-
const idx = newPath.lastIndexOf("/");
|
|
261
|
-
if (idx >= 0) {
|
|
262
|
-
newPath = path.substring(idx + 1);
|
|
263
|
-
// newPath = newPath.substring(idx + 1);
|
|
264
|
-
}
|
|
265
|
-
page = newPath;
|
|
266
|
-
// console.log("popPage 1.3", uuid, page);
|
|
267
|
-
}
|
|
268
|
-
else {
|
|
269
|
-
const [, ...anchors] = path.split("#");
|
|
270
|
-
page = (_b = anchors.at(-1)) !== null && _b !== void 0 ? _b : "";
|
|
271
|
-
// console.log("popPage 1.4", uuid, "page:", page, "path:", path);
|
|
272
|
-
if (page === "") {
|
|
273
|
-
// page = path;
|
|
274
|
-
const withoutHash = path.split("#")[0];
|
|
275
|
-
const idx = withoutHash.lastIndexOf("/");
|
|
276
|
-
if (idx >= 0) {
|
|
277
|
-
page = withoutHash.substring(idx + 1);
|
|
278
|
-
}
|
|
279
|
-
else {
|
|
280
|
-
page = path;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
}
|
|
265
|
+
const loc = getLocationInfo();
|
|
284
266
|
const newPageChain = Object.assign({}, prevChain);
|
|
285
267
|
setPageChain(newPageChain);
|
|
286
268
|
if (!standalone) {
|
|
287
|
-
history.pushState(null, "", path);
|
|
269
|
+
history.pushState(null, "", newPageChain.current.path);
|
|
288
270
|
}
|
|
289
|
-
|
|
290
|
-
|
|
271
|
+
(_b = handleRef.current) === null || _b === void 0 ? void 0 : _b.renderPage(newPageChain.current.page);
|
|
272
|
+
// // extract page from path
|
|
273
|
+
// let page = "";
|
|
274
|
+
// if (prefix === "root") {
|
|
275
|
+
// let newPath = path.split("#")[0].split("?")[0];
|
|
276
|
+
// const idx = newPath.lastIndexOf("/");
|
|
277
|
+
// if (idx >= 0) {
|
|
278
|
+
// newPath = path.substring(idx + 1);
|
|
279
|
+
// }
|
|
280
|
+
// page = newPath;
|
|
281
|
+
// } else {
|
|
282
|
+
// const loc = getLocationInfo();
|
|
283
|
+
// // pop means go back to previous loc.base (one less anchor)
|
|
284
|
+
// const [, ...anchors] = loc.base.split("#");
|
|
285
|
+
// anchors.pop(); // remove last anchor
|
|
286
|
+
// page = anchors.at(-1) ?? "";
|
|
287
|
+
// if (page === "") {
|
|
288
|
+
// const withoutHash = path.split("#")[0];
|
|
289
|
+
// const idx = withoutHash.lastIndexOf("/");
|
|
290
|
+
// if (idx >= 0) {
|
|
291
|
+
// page = withoutHash.substring(idx + 1);
|
|
292
|
+
// } else {
|
|
293
|
+
// page = path;
|
|
294
|
+
// }
|
|
295
|
+
// }
|
|
296
|
+
// }
|
|
297
|
+
// const newPageChain = { ...prevChain } as PageChain;
|
|
298
|
+
// setPageChain(newPageChain);
|
|
299
|
+
// if (!standalone) {
|
|
300
|
+
// const loc = getLocationInfo();
|
|
301
|
+
// const [, ...anchors] = loc.base.split("#");
|
|
302
|
+
// anchors.pop();
|
|
303
|
+
// const newPath = [loc.base.split("#")[0], ...anchors].filter(Boolean).join("#");
|
|
304
|
+
// history.pushState(null, "", newPath);
|
|
305
|
+
// }
|
|
306
|
+
// handleRef.current?.renderPage(page);
|
|
291
307
|
};
|
|
292
308
|
const hasBackPage = () => {
|
|
293
309
|
const { previous } = pageChain;
|
|
@@ -296,6 +312,35 @@ export const PageViewProvider = ({ paths, handle, children, prefix = "page", eve
|
|
|
296
312
|
const { path } = previous.current;
|
|
297
313
|
return path != null && path !== "";
|
|
298
314
|
};
|
|
315
|
+
const getUrl = () => {
|
|
316
|
+
var _a, _b;
|
|
317
|
+
if (prefix === "root") {
|
|
318
|
+
const loc = getLocationInfo();
|
|
319
|
+
return loc.root + "/" + paths[0];
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
const parentPath = (_b = (_a = parentContext === null || parentContext === void 0 ? void 0 : parentContext.paths) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : "";
|
|
323
|
+
const [currentPath] = paths;
|
|
324
|
+
return [parentPath, currentPath].filter(Boolean).join("#");
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
const getSubPaths = () => {
|
|
328
|
+
const [, ...subPaths] = paths !== null && paths !== void 0 ? paths : [];
|
|
329
|
+
return subPaths;
|
|
330
|
+
};
|
|
331
|
+
const getPage = () => {
|
|
332
|
+
var _a, _b;
|
|
333
|
+
return (_b = (_a = pageChain.current) === null || _a === void 0 ? void 0 : _a.page) !== null && _b !== void 0 ? _b : "";
|
|
334
|
+
};
|
|
335
|
+
const getParams = () => {
|
|
336
|
+
const url = getUrl();
|
|
337
|
+
const urlParams = new URLSearchParams(url.split("?")[1]);
|
|
338
|
+
const params = {};
|
|
339
|
+
urlParams.forEach((value, key) => {
|
|
340
|
+
params[key] = value;
|
|
341
|
+
});
|
|
342
|
+
return params;
|
|
343
|
+
};
|
|
299
344
|
const getInfo = () => {
|
|
300
345
|
var _a;
|
|
301
346
|
return {
|
|
@@ -307,6 +352,10 @@ export const PageViewProvider = ({ paths, handle, children, prefix = "page", eve
|
|
|
307
352
|
previous: (_a = pageChain.previous) === null || _a === void 0 ? void 0 : _a.current,
|
|
308
353
|
};
|
|
309
354
|
};
|
|
355
|
+
const getPageChainInfo = () => {
|
|
356
|
+
var _a;
|
|
357
|
+
return (_a = pageChain.current) !== null && _a !== void 0 ? _a : { path: "", base: "", page: "", options: {}, params: {} };
|
|
358
|
+
};
|
|
310
359
|
const ui = usePageViewUI();
|
|
311
360
|
const values = {
|
|
312
361
|
parentContext,
|
|
@@ -320,7 +369,6 @@ export const PageViewProvider = ({ paths, handle, children, prefix = "page", eve
|
|
|
320
369
|
titleRef.current = title;
|
|
321
370
|
},
|
|
322
371
|
setPage,
|
|
323
|
-
setSelectedPage,
|
|
324
372
|
getSelectedPage: () => {
|
|
325
373
|
const { current } = pageChain;
|
|
326
374
|
return current === null || current === void 0 ? void 0 : current.path;
|
|
@@ -335,6 +383,12 @@ export const PageViewProvider = ({ paths, handle, children, prefix = "page", eve
|
|
|
335
383
|
getEventHandler: () => {
|
|
336
384
|
return eventHandler !== null && eventHandler !== void 0 ? eventHandler : {};
|
|
337
385
|
},
|
|
386
|
+
isRootView: () => { var _a; return (_a = uuid === null || uuid === void 0 ? void 0 : uuid.startsWith("root")) !== null && _a !== void 0 ? _a : false; },
|
|
387
|
+
getUrl,
|
|
388
|
+
getPage,
|
|
389
|
+
getParams,
|
|
390
|
+
getSubPaths,
|
|
391
|
+
getPageChainInfo,
|
|
338
392
|
};
|
|
339
393
|
useEffect(() => {
|
|
340
394
|
const idx = contextStack.length;
|
package/dist/core/Panel.js
CHANGED
|
@@ -12,27 +12,49 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { DynamicComponent } from "./DynamicComponent";
|
|
14
14
|
const Panel = ({ content, orientation = "vertical", styles = {}, className = "" }) => {
|
|
15
|
-
if (content ==
|
|
15
|
+
if (content == null)
|
|
16
16
|
return null;
|
|
17
|
-
}
|
|
18
17
|
return (_jsx("div", { className: className, style: styles, children: renderContent(content, orientation) }));
|
|
19
18
|
};
|
|
20
19
|
const renderContent = (content, orientation = "vertical") => {
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
if (content == null)
|
|
21
|
+
return null;
|
|
22
|
+
// ── 1. Outer array: vertical column of rows / standalone items ──────────
|
|
23
23
|
if (Array.isArray(content)) {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
return (_jsx("div", { style: { display: "flex", flexDirection: "column", gap: 12, width: "100%" }, children: content.map((item, i) => {
|
|
25
|
+
// ── 2. Nested array = one horizontal row ────────────────────────
|
|
26
|
+
if (Array.isArray(item)) {
|
|
27
|
+
return (_jsx("div", { style: {
|
|
28
|
+
display: "flex",
|
|
29
|
+
flexDirection: "row",
|
|
30
|
+
gap: 12,
|
|
31
|
+
width: "100%",
|
|
32
|
+
flexWrap: "wrap",
|
|
33
|
+
alignItems: "flex-start",
|
|
34
|
+
justifyContent: "flex-start", // ← keeps items packed left
|
|
35
|
+
}, children: item.map((cell, j) => {
|
|
36
|
+
var _a, _b;
|
|
37
|
+
const isFullWidth = ((_a = cell === null || cell === void 0 ? void 0 : cell.attr) === null || _a === void 0 ? void 0 : _a.fullWidth) === true;
|
|
38
|
+
const isStretch = ((_b = cell === null || cell === void 0 ? void 0 : cell.attr) === null || _b === void 0 ? void 0 : _b.stretch) === true; // ← opt-in stretch
|
|
39
|
+
return (_jsx("div", { style: {
|
|
40
|
+
flex: isFullWidth ? "0 0 100%" : isStretch ? "1 1 0" : "0 0 auto",
|
|
41
|
+
minWidth: 0,
|
|
42
|
+
}, children: renderContent(cell, "vertical") }, j));
|
|
43
|
+
}) }, i));
|
|
44
|
+
}
|
|
45
|
+
// ── 3. Standalone object = full-width row ───────────────────────
|
|
46
|
+
return (_jsx("div", { style: { width: "100%" }, children: renderContent(item, "vertical") }, i));
|
|
47
|
+
}) }));
|
|
26
48
|
}
|
|
27
|
-
//
|
|
49
|
+
// ── 4. Object with `component` → DynamicComponent ──────────────────────
|
|
28
50
|
if (content && typeof content === "object" && content.component) {
|
|
29
51
|
const { component, attr } = content;
|
|
30
52
|
return _jsx(DynamicComponent, { config: { component, attr } });
|
|
31
53
|
}
|
|
32
|
-
//
|
|
54
|
+
// ── 5. Object without `component` → nested Panel ───────────────────────
|
|
33
55
|
if (content && typeof content === "object") {
|
|
34
56
|
const { elements, styles, className, orientation: innerOrientation } = content, rest = __rest(content, ["elements", "styles", "className", "orientation"]);
|
|
35
|
-
return (_jsx(Panel, { content: elements
|
|
57
|
+
return (_jsx(Panel, { content: elements !== null && elements !== void 0 ? elements : null, orientation: innerOrientation !== null && innerOrientation !== void 0 ? innerOrientation : orientation, styles: Object.assign(Object.assign({}, styles), rest), className: className !== null && className !== void 0 ? className : "" }));
|
|
36
58
|
}
|
|
37
59
|
return null;
|
|
38
60
|
};
|
package/dist/core/index.d.ts
CHANGED
package/dist/core/index.js
CHANGED
package/dist/index.css
CHANGED
|
@@ -618,6 +618,9 @@ video {
|
|
|
618
618
|
max-width: 1536px;
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
|
+
.pointer-events-none {
|
|
622
|
+
pointer-events: none;
|
|
623
|
+
}
|
|
621
624
|
.\!visible {
|
|
622
625
|
visibility: visible !important;
|
|
623
626
|
}
|
|
@@ -654,12 +657,18 @@ video {
|
|
|
654
657
|
.right-2 {
|
|
655
658
|
right: 0.5rem;
|
|
656
659
|
}
|
|
660
|
+
.right-3 {
|
|
661
|
+
right: 0.75rem;
|
|
662
|
+
}
|
|
657
663
|
.right-4 {
|
|
658
664
|
right: 1rem;
|
|
659
665
|
}
|
|
660
666
|
.top-0 {
|
|
661
667
|
top: 0px;
|
|
662
668
|
}
|
|
669
|
+
.top-1\/2 {
|
|
670
|
+
top: 50%;
|
|
671
|
+
}
|
|
663
672
|
.top-2 {
|
|
664
673
|
top: 0.5rem;
|
|
665
674
|
}
|
|
@@ -684,6 +693,10 @@ video {
|
|
|
684
693
|
.m-0 {
|
|
685
694
|
margin: 0px;
|
|
686
695
|
}
|
|
696
|
+
.my-2 {
|
|
697
|
+
margin-top: 0.5rem;
|
|
698
|
+
margin-bottom: 0.5rem;
|
|
699
|
+
}
|
|
687
700
|
.mb-2 {
|
|
688
701
|
margin-bottom: 0.5rem;
|
|
689
702
|
}
|
|
@@ -693,6 +706,9 @@ video {
|
|
|
693
706
|
.ml-2 {
|
|
694
707
|
margin-left: 0.5rem;
|
|
695
708
|
}
|
|
709
|
+
.mr-2 {
|
|
710
|
+
margin-right: 0.5rem;
|
|
711
|
+
}
|
|
696
712
|
.mt-0\.5 {
|
|
697
713
|
margin-top: 0.125rem;
|
|
698
714
|
}
|
|
@@ -912,6 +928,10 @@ video {
|
|
|
912
928
|
.flex-shrink-0 {
|
|
913
929
|
flex-shrink: 0;
|
|
914
930
|
}
|
|
931
|
+
.-translate-y-1\/2 {
|
|
932
|
+
--tw-translate-y: -50%;
|
|
933
|
+
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
934
|
+
}
|
|
915
935
|
.rotate-180 {
|
|
916
936
|
--tw-rotate: 180deg;
|
|
917
937
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
@@ -945,6 +965,9 @@ video {
|
|
|
945
965
|
.cursor-default {
|
|
946
966
|
cursor: default;
|
|
947
967
|
}
|
|
968
|
+
.cursor-grab {
|
|
969
|
+
cursor: grab;
|
|
970
|
+
}
|
|
948
971
|
.cursor-not-allowed {
|
|
949
972
|
cursor: not-allowed;
|
|
950
973
|
}
|
|
@@ -1061,6 +1084,9 @@ video {
|
|
|
1061
1084
|
.rounded-none {
|
|
1062
1085
|
border-radius: 0px;
|
|
1063
1086
|
}
|
|
1087
|
+
.rounded-sm {
|
|
1088
|
+
border-radius: 0.125rem;
|
|
1089
|
+
}
|
|
1064
1090
|
.rounded-xl {
|
|
1065
1091
|
border-radius: 0.75rem;
|
|
1066
1092
|
}
|
|
@@ -1088,6 +1114,9 @@ video {
|
|
|
1088
1114
|
.border-t {
|
|
1089
1115
|
border-top-width: 1px;
|
|
1090
1116
|
}
|
|
1117
|
+
.border-none {
|
|
1118
|
+
border-style: none;
|
|
1119
|
+
}
|
|
1091
1120
|
.border-blue-500 {
|
|
1092
1121
|
--tw-border-opacity: 1;
|
|
1093
1122
|
border-color: rgb(59 130 246 / var(--tw-border-opacity, 1));
|
|
@@ -1288,12 +1317,21 @@ video {
|
|
|
1288
1317
|
.pl-1 {
|
|
1289
1318
|
padding-left: 0.25rem;
|
|
1290
1319
|
}
|
|
1320
|
+
.pl-4 {
|
|
1321
|
+
padding-left: 1rem;
|
|
1322
|
+
}
|
|
1323
|
+
.pr-10 {
|
|
1324
|
+
padding-right: 2.5rem;
|
|
1325
|
+
}
|
|
1291
1326
|
.pr-4 {
|
|
1292
1327
|
padding-right: 1rem;
|
|
1293
1328
|
}
|
|
1294
1329
|
.pt-1 {
|
|
1295
1330
|
padding-top: 0.25rem;
|
|
1296
1331
|
}
|
|
1332
|
+
.text-left {
|
|
1333
|
+
text-align: left;
|
|
1334
|
+
}
|
|
1297
1335
|
.text-center {
|
|
1298
1336
|
text-align: center;
|
|
1299
1337
|
}
|
|
@@ -1353,6 +1391,9 @@ video {
|
|
|
1353
1391
|
.uppercase {
|
|
1354
1392
|
text-transform: uppercase;
|
|
1355
1393
|
}
|
|
1394
|
+
.capitalize {
|
|
1395
|
+
text-transform: capitalize;
|
|
1396
|
+
}
|
|
1356
1397
|
.tabular-nums {
|
|
1357
1398
|
--tw-numeric-spacing: tabular-nums;
|
|
1358
1399
|
font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
|
|
@@ -1372,6 +1413,10 @@ video {
|
|
|
1372
1413
|
.\!text-black\/80 {
|
|
1373
1414
|
color: rgb(0 0 0 / 0.8) !important;
|
|
1374
1415
|
}
|
|
1416
|
+
.text-black {
|
|
1417
|
+
--tw-text-opacity: 1;
|
|
1418
|
+
color: rgb(0 0 0 / var(--tw-text-opacity, 1));
|
|
1419
|
+
}
|
|
1375
1420
|
.text-blue-50 {
|
|
1376
1421
|
--tw-text-opacity: 1;
|
|
1377
1422
|
color: rgb(239 246 255 / var(--tw-text-opacity, 1));
|
|
@@ -1412,6 +1457,10 @@ video {
|
|
|
1412
1457
|
--tw-text-opacity: 1;
|
|
1413
1458
|
color: rgb(17 24 39 / var(--tw-text-opacity, 1));
|
|
1414
1459
|
}
|
|
1460
|
+
.text-green-500 {
|
|
1461
|
+
--tw-text-opacity: 1;
|
|
1462
|
+
color: rgb(34 197 94 / var(--tw-text-opacity, 1));
|
|
1463
|
+
}
|
|
1415
1464
|
.text-red-500 {
|
|
1416
1465
|
--tw-text-opacity: 1;
|
|
1417
1466
|
color: rgb(239 68 68 / var(--tw-text-opacity, 1));
|
|
@@ -1424,6 +1473,10 @@ video {
|
|
|
1424
1473
|
--tw-text-opacity: 1;
|
|
1425
1474
|
color: rgb(255 255 255 / var(--tw-text-opacity, 1));
|
|
1426
1475
|
}
|
|
1476
|
+
.text-yellow-500 {
|
|
1477
|
+
--tw-text-opacity: 1;
|
|
1478
|
+
color: rgb(234 179 8 / var(--tw-text-opacity, 1));
|
|
1479
|
+
}
|
|
1427
1480
|
.text-yellow-700 {
|
|
1428
1481
|
--tw-text-opacity: 1;
|
|
1429
1482
|
color: rgb(161 98 7 / var(--tw-text-opacity, 1));
|
|
@@ -1451,6 +1504,11 @@ video {
|
|
|
1451
1504
|
--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);
|
|
1452
1505
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
1453
1506
|
}
|
|
1507
|
+
.shadow-none {
|
|
1508
|
+
--tw-shadow: 0 0 #0000;
|
|
1509
|
+
--tw-shadow-colored: 0 0 #0000;
|
|
1510
|
+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
1511
|
+
}
|
|
1454
1512
|
.shadow-sm {
|
|
1455
1513
|
--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
1456
1514
|
--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);
|
|
@@ -1497,6 +1555,11 @@ video {
|
|
|
1497
1555
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
1498
1556
|
transition-duration: 150ms;
|
|
1499
1557
|
}
|
|
1558
|
+
.transition-opacity {
|
|
1559
|
+
transition-property: opacity;
|
|
1560
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
1561
|
+
transition-duration: 150ms;
|
|
1562
|
+
}
|
|
1500
1563
|
.transition-transform {
|
|
1501
1564
|
transition-property: transform;
|
|
1502
1565
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
@@ -1595,6 +1658,9 @@ video {
|
|
|
1595
1658
|
.hover\:underline:hover {
|
|
1596
1659
|
text-decoration-line: underline;
|
|
1597
1660
|
}
|
|
1661
|
+
.hover\:opacity-70:hover {
|
|
1662
|
+
opacity: 0.7;
|
|
1663
|
+
}
|
|
1598
1664
|
.focus\:border-blue-500:focus {
|
|
1599
1665
|
--tw-border-opacity: 1;
|
|
1600
1666
|
border-color: rgb(59 130 246 / var(--tw-border-opacity, 1));
|
|
@@ -1603,6 +1669,10 @@ video {
|
|
|
1603
1669
|
--tw-bg-opacity: 1;
|
|
1604
1670
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
|
|
1605
1671
|
}
|
|
1672
|
+
.focus\:bg-yellow-50:focus {
|
|
1673
|
+
--tw-bg-opacity: 1;
|
|
1674
|
+
background-color: rgb(254 252 232 / var(--tw-bg-opacity, 1));
|
|
1675
|
+
}
|
|
1606
1676
|
.focus\:shadow-none:focus {
|
|
1607
1677
|
--tw-shadow: 0 0 #0000;
|
|
1608
1678
|
--tw-shadow-colored: 0 0 #0000;
|
|
@@ -1617,11 +1687,20 @@ video {
|
|
|
1617
1687
|
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
1618
1688
|
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
1619
1689
|
}
|
|
1690
|
+
.focus\:ring-1:focus {
|
|
1691
|
+
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
1692
|
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
1693
|
+
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
1694
|
+
}
|
|
1620
1695
|
.focus\:ring-2:focus {
|
|
1621
1696
|
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
1622
1697
|
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
1623
1698
|
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
1624
1699
|
}
|
|
1700
|
+
.focus\:ring-blue-400:focus {
|
|
1701
|
+
--tw-ring-opacity: 1;
|
|
1702
|
+
--tw-ring-color: rgb(96 165 250 / var(--tw-ring-opacity, 1));
|
|
1703
|
+
}
|
|
1625
1704
|
.focus\:ring-blue-500:focus {
|
|
1626
1705
|
--tw-ring-opacity: 1;
|
|
1627
1706
|
--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity, 1));
|
|
@@ -23,5 +23,5 @@ type CardLayoutProps = {
|
|
|
23
23
|
children: ReactNode;
|
|
24
24
|
value: string;
|
|
25
25
|
};
|
|
26
|
-
declare const CardLayout: ({ ref, layoutid, className, children, value }: CardLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
export
|
|
26
|
+
export declare const CardLayout: ({ ref, layoutid, className, children, value }: CardLayoutProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -7,8 +7,8 @@ import React, { Suspense } from "react";
|
|
|
7
7
|
export function Card(_props) {
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
10
|
-
const CardLayout = ({ ref, layoutid, className, children, value =
|
|
11
|
-
const preferredLayoutId = (layoutid !== null && layoutid !== void 0 ? layoutid :
|
|
10
|
+
export const CardLayout = ({ ref, layoutid, className, children, value = 'default' }) => {
|
|
11
|
+
const preferredLayoutId = ((layoutid !== null && layoutid !== void 0 ? layoutid : '') ? layoutid : 'cardlayout');
|
|
12
12
|
// Extract only <Card> children
|
|
13
13
|
const cards = React.Children.toArray(children).filter((child) => React.isValidElement(child) && child.type === Card);
|
|
14
14
|
const activeCard = cards.find((c) => c.props.name === value);
|
|
@@ -28,9 +28,8 @@ const CardLayout = ({ ref, layoutid, className, children, value = "default" }) =
|
|
|
28
28
|
throw Error(result);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
}
|
|
31
|
+
}
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
return (_jsx("div", { className: `${preferredLayoutId}-container ${className !== null && className !== void 0 ? className : ""} flex flex-col h-full`, children: _jsx(Suspense, { fallback: _jsx("div", { children: "Loading..." }), children: activeCard ? activeCard.props.element : null }) }));
|
|
35
35
|
};
|
|
36
|
-
export default CardLayout;
|
package/dist/layouts/HPanel.d.ts
CHANGED