@ramesesinc/platform-core 0.1.9 → 0.1.11
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/DeleteData.d.ts +1 -0
- package/dist/components/action/DeleteData.js +16 -5
- 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 +3 -1
- package/dist/components/action/ViewPage.js +22 -10
- package/dist/components/common/UIMenu.d.ts +1 -0
- package/dist/components/common/UIMenu.js +5 -3
- package/dist/components/index.d.ts +4 -1
- package/dist/components/index.js +4 -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/input/YearPicker.js +3 -2
- 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 +35 -13
- package/dist/components/table/DataList.d.ts +1 -1
- package/dist/components/table/DataList.js +56 -29
- 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/HtmlView.js +1 -1
- package/dist/components/view/PageView.d.ts +1 -0
- package/dist/components/view/PageView.js +38 -11
- package/dist/components/view/PopupView.d.ts +1 -0
- package/dist/components/view/PopupView.js +4 -4
- package/dist/components/view/RootView.d.ts +1 -0
- package/dist/components/view/RootView.js +18 -18
- package/dist/components/view/WizardView.d.ts +1 -1
- package/dist/components/view/WizardView.js +7 -25
- package/dist/core/AuthContext.js +1 -1
- package/dist/core/DynamicComponent.d.ts +2 -1
- package/dist/core/DynamicComponent.js +24 -2
- package/dist/core/Page.d.ts +1 -0
- package/dist/core/Page.js +6 -5
- package/dist/core/PageCache.d.ts +0 -2
- package/dist/core/PageCache.js +3 -8
- package/dist/core/PageContext.d.ts +1 -0
- package/dist/core/PageContext.js +16 -2
- package/dist/core/PageViewContext.d.ts +8 -2
- package/dist/core/PageViewContext.js +155 -86
- package/dist/core/Panel.js +34 -12
- package/dist/core/StepHandler.d.ts +1 -1
- package/dist/core/StepHandler.js +58 -21
- package/dist/index.css +98 -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.d.ts +3 -0
- package/dist/templates/WizardTemplate.js +17 -10
- package/package.json +1 -1
- package/dist/components/input/Select.d.ts +0 -14
- package/dist/components/input/Select.js +0 -40
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,15 +693,28 @@ 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
|
}
|
|
703
|
+
.mb-3 {
|
|
704
|
+
margin-bottom: 0.75rem;
|
|
705
|
+
}
|
|
690
706
|
.mb-4 {
|
|
691
707
|
margin-bottom: 1rem;
|
|
692
708
|
}
|
|
709
|
+
.mb-6 {
|
|
710
|
+
margin-bottom: 1.5rem;
|
|
711
|
+
}
|
|
693
712
|
.ml-2 {
|
|
694
713
|
margin-left: 0.5rem;
|
|
695
714
|
}
|
|
715
|
+
.mr-2 {
|
|
716
|
+
margin-right: 0.5rem;
|
|
717
|
+
}
|
|
696
718
|
.mt-0\.5 {
|
|
697
719
|
margin-top: 0.125rem;
|
|
698
720
|
}
|
|
@@ -906,12 +928,22 @@ video {
|
|
|
906
928
|
.max-w-\[90vw\] {
|
|
907
929
|
max-width: 90vw;
|
|
908
930
|
}
|
|
931
|
+
.max-w-sm {
|
|
932
|
+
max-width: 24rem;
|
|
933
|
+
}
|
|
909
934
|
.flex-1 {
|
|
910
935
|
flex: 1 1 0%;
|
|
911
936
|
}
|
|
912
937
|
.flex-shrink-0 {
|
|
913
938
|
flex-shrink: 0;
|
|
914
939
|
}
|
|
940
|
+
.shrink-0 {
|
|
941
|
+
flex-shrink: 0;
|
|
942
|
+
}
|
|
943
|
+
.-translate-y-1\/2 {
|
|
944
|
+
--tw-translate-y: -50%;
|
|
945
|
+
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));
|
|
946
|
+
}
|
|
915
947
|
.rotate-180 {
|
|
916
948
|
--tw-rotate: 180deg;
|
|
917
949
|
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 +977,9 @@ video {
|
|
|
945
977
|
.cursor-default {
|
|
946
978
|
cursor: default;
|
|
947
979
|
}
|
|
980
|
+
.cursor-grab {
|
|
981
|
+
cursor: grab;
|
|
982
|
+
}
|
|
948
983
|
.cursor-not-allowed {
|
|
949
984
|
cursor: not-allowed;
|
|
950
985
|
}
|
|
@@ -1061,6 +1096,9 @@ video {
|
|
|
1061
1096
|
.rounded-none {
|
|
1062
1097
|
border-radius: 0px;
|
|
1063
1098
|
}
|
|
1099
|
+
.rounded-sm {
|
|
1100
|
+
border-radius: 0.125rem;
|
|
1101
|
+
}
|
|
1064
1102
|
.rounded-xl {
|
|
1065
1103
|
border-radius: 0.75rem;
|
|
1066
1104
|
}
|
|
@@ -1088,6 +1126,9 @@ video {
|
|
|
1088
1126
|
.border-t {
|
|
1089
1127
|
border-top-width: 1px;
|
|
1090
1128
|
}
|
|
1129
|
+
.border-none {
|
|
1130
|
+
border-style: none;
|
|
1131
|
+
}
|
|
1091
1132
|
.border-blue-500 {
|
|
1092
1133
|
--tw-border-opacity: 1;
|
|
1093
1134
|
border-color: rgb(59 130 246 / var(--tw-border-opacity, 1));
|
|
@@ -1219,6 +1260,9 @@ video {
|
|
|
1219
1260
|
.p-4 {
|
|
1220
1261
|
padding: 1rem;
|
|
1221
1262
|
}
|
|
1263
|
+
.p-6 {
|
|
1264
|
+
padding: 1.5rem;
|
|
1265
|
+
}
|
|
1222
1266
|
.\!px-3 {
|
|
1223
1267
|
padding-left: 0.75rem !important;
|
|
1224
1268
|
padding-right: 0.75rem !important;
|
|
@@ -1288,12 +1332,21 @@ video {
|
|
|
1288
1332
|
.pl-1 {
|
|
1289
1333
|
padding-left: 0.25rem;
|
|
1290
1334
|
}
|
|
1335
|
+
.pl-4 {
|
|
1336
|
+
padding-left: 1rem;
|
|
1337
|
+
}
|
|
1338
|
+
.pr-10 {
|
|
1339
|
+
padding-right: 2.5rem;
|
|
1340
|
+
}
|
|
1291
1341
|
.pr-4 {
|
|
1292
1342
|
padding-right: 1rem;
|
|
1293
1343
|
}
|
|
1294
1344
|
.pt-1 {
|
|
1295
1345
|
padding-top: 0.25rem;
|
|
1296
1346
|
}
|
|
1347
|
+
.text-left {
|
|
1348
|
+
text-align: left;
|
|
1349
|
+
}
|
|
1297
1350
|
.text-center {
|
|
1298
1351
|
text-align: center;
|
|
1299
1352
|
}
|
|
@@ -1353,6 +1406,9 @@ video {
|
|
|
1353
1406
|
.uppercase {
|
|
1354
1407
|
text-transform: uppercase;
|
|
1355
1408
|
}
|
|
1409
|
+
.capitalize {
|
|
1410
|
+
text-transform: capitalize;
|
|
1411
|
+
}
|
|
1356
1412
|
.tabular-nums {
|
|
1357
1413
|
--tw-numeric-spacing: tabular-nums;
|
|
1358
1414
|
font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
|
|
@@ -1372,6 +1428,10 @@ video {
|
|
|
1372
1428
|
.\!text-black\/80 {
|
|
1373
1429
|
color: rgb(0 0 0 / 0.8) !important;
|
|
1374
1430
|
}
|
|
1431
|
+
.text-black {
|
|
1432
|
+
--tw-text-opacity: 1;
|
|
1433
|
+
color: rgb(0 0 0 / var(--tw-text-opacity, 1));
|
|
1434
|
+
}
|
|
1375
1435
|
.text-blue-50 {
|
|
1376
1436
|
--tw-text-opacity: 1;
|
|
1377
1437
|
color: rgb(239 246 255 / var(--tw-text-opacity, 1));
|
|
@@ -1412,6 +1472,10 @@ video {
|
|
|
1412
1472
|
--tw-text-opacity: 1;
|
|
1413
1473
|
color: rgb(17 24 39 / var(--tw-text-opacity, 1));
|
|
1414
1474
|
}
|
|
1475
|
+
.text-green-500 {
|
|
1476
|
+
--tw-text-opacity: 1;
|
|
1477
|
+
color: rgb(34 197 94 / var(--tw-text-opacity, 1));
|
|
1478
|
+
}
|
|
1415
1479
|
.text-red-500 {
|
|
1416
1480
|
--tw-text-opacity: 1;
|
|
1417
1481
|
color: rgb(239 68 68 / var(--tw-text-opacity, 1));
|
|
@@ -1424,6 +1488,10 @@ video {
|
|
|
1424
1488
|
--tw-text-opacity: 1;
|
|
1425
1489
|
color: rgb(255 255 255 / var(--tw-text-opacity, 1));
|
|
1426
1490
|
}
|
|
1491
|
+
.text-yellow-500 {
|
|
1492
|
+
--tw-text-opacity: 1;
|
|
1493
|
+
color: rgb(234 179 8 / var(--tw-text-opacity, 1));
|
|
1494
|
+
}
|
|
1427
1495
|
.text-yellow-700 {
|
|
1428
1496
|
--tw-text-opacity: 1;
|
|
1429
1497
|
color: rgb(161 98 7 / var(--tw-text-opacity, 1));
|
|
@@ -1451,6 +1519,11 @@ video {
|
|
|
1451
1519
|
--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);
|
|
1452
1520
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
1453
1521
|
}
|
|
1522
|
+
.shadow-none {
|
|
1523
|
+
--tw-shadow: 0 0 #0000;
|
|
1524
|
+
--tw-shadow-colored: 0 0 #0000;
|
|
1525
|
+
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
1526
|
+
}
|
|
1454
1527
|
.shadow-sm {
|
|
1455
1528
|
--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
1456
1529
|
--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);
|
|
@@ -1497,6 +1570,11 @@ video {
|
|
|
1497
1570
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
1498
1571
|
transition-duration: 150ms;
|
|
1499
1572
|
}
|
|
1573
|
+
.transition-opacity {
|
|
1574
|
+
transition-property: opacity;
|
|
1575
|
+
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
1576
|
+
transition-duration: 150ms;
|
|
1577
|
+
}
|
|
1500
1578
|
.transition-transform {
|
|
1501
1579
|
transition-property: transform;
|
|
1502
1580
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
@@ -1568,6 +1646,10 @@ video {
|
|
|
1568
1646
|
--tw-bg-opacity: 1;
|
|
1569
1647
|
background-color: rgb(21 128 61 / var(--tw-bg-opacity, 1));
|
|
1570
1648
|
}
|
|
1649
|
+
.hover\:bg-red-600:hover {
|
|
1650
|
+
--tw-bg-opacity: 1;
|
|
1651
|
+
background-color: rgb(220 38 38 / var(--tw-bg-opacity, 1));
|
|
1652
|
+
}
|
|
1571
1653
|
.hover\:bg-red-700:hover {
|
|
1572
1654
|
--tw-bg-opacity: 1;
|
|
1573
1655
|
background-color: rgb(185 28 28 / var(--tw-bg-opacity, 1));
|
|
@@ -1595,6 +1677,9 @@ video {
|
|
|
1595
1677
|
.hover\:underline:hover {
|
|
1596
1678
|
text-decoration-line: underline;
|
|
1597
1679
|
}
|
|
1680
|
+
.hover\:opacity-70:hover {
|
|
1681
|
+
opacity: 0.7;
|
|
1682
|
+
}
|
|
1598
1683
|
.focus\:border-blue-500:focus {
|
|
1599
1684
|
--tw-border-opacity: 1;
|
|
1600
1685
|
border-color: rgb(59 130 246 / var(--tw-border-opacity, 1));
|
|
@@ -1603,6 +1688,10 @@ video {
|
|
|
1603
1688
|
--tw-bg-opacity: 1;
|
|
1604
1689
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
|
|
1605
1690
|
}
|
|
1691
|
+
.focus\:bg-yellow-50:focus {
|
|
1692
|
+
--tw-bg-opacity: 1;
|
|
1693
|
+
background-color: rgb(254 252 232 / var(--tw-bg-opacity, 1));
|
|
1694
|
+
}
|
|
1606
1695
|
.focus\:shadow-none:focus {
|
|
1607
1696
|
--tw-shadow: 0 0 #0000;
|
|
1608
1697
|
--tw-shadow-colored: 0 0 #0000;
|
|
@@ -1617,11 +1706,20 @@ video {
|
|
|
1617
1706
|
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
1618
1707
|
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
1619
1708
|
}
|
|
1709
|
+
.focus\:ring-1:focus {
|
|
1710
|
+
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
1711
|
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
1712
|
+
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
1713
|
+
}
|
|
1620
1714
|
.focus\:ring-2:focus {
|
|
1621
1715
|
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
1622
1716
|
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
1623
1717
|
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
1624
1718
|
}
|
|
1719
|
+
.focus\:ring-blue-400:focus {
|
|
1720
|
+
--tw-ring-opacity: 1;
|
|
1721
|
+
--tw-ring-color: rgb(96 165 250 / var(--tw-ring-opacity, 1));
|
|
1722
|
+
}
|
|
1625
1723
|
.focus\:ring-blue-500:focus {
|
|
1626
1724
|
--tw-ring-opacity: 1;
|
|
1627
1725
|
--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
package/dist/layouts/HPanel.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
const HPanel = ({ children, gap = 0, style, className, alignItems = "center", justifyContent = "flex-start" }) => {
|
|
3
|
+
export const HPanel = ({ children, gap = 0, style, className, alignItems = "center", justifyContent = "flex-start" }) => {
|
|
4
4
|
const panelStyle = Object.assign({ display: "flex", flexDirection: "row", gap: gap, alignItems,
|
|
5
5
|
justifyContent }, style);
|
|
6
6
|
return (_jsx("div", { style: panelStyle, className: className, children: children }));
|
|
7
7
|
};
|
|
8
|
-
export default HPanel;
|
package/dist/layouts/VPanel.d.ts
CHANGED
package/dist/layouts/VPanel.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
const VPanel = ({ children, gap = 0, style, className }) => {
|
|
3
|
+
export const VPanel = ({ children, gap = 0, style, className }) => {
|
|
4
4
|
const panelStyle = Object.assign({ display: "flex", flexDirection: "column", gap: gap }, style);
|
|
5
5
|
return (_jsx("div", { style: panelStyle, className: className, children: children }));
|
|
6
6
|
};
|
|
7
|
-
export default VPanel;
|
package/dist/layouts/index.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
export { default as BorderLayout } from "./BorderLayout";
|
|
2
2
|
export * from "./CardLayout";
|
|
3
|
-
export { default as CardLayout } from "./CardLayout";
|
|
4
3
|
export { default as CenterLayout } from "./CenterLayout";
|
|
5
4
|
export { default as GridLayout } from "./GridLayout";
|
|
6
5
|
export { default as HorizontalLayout } from "./HorizontalLayout";
|
|
7
|
-
export
|
|
6
|
+
export * from "./HPanel";
|
|
8
7
|
export { default as MainLayout } from "./MainLayout";
|
|
9
8
|
export { default as PageLayout } from "./PageLayout";
|
|
10
|
-
export
|
|
9
|
+
export * from "./VPanel";
|
|
11
10
|
export { default as XLayout } from "./XLayout";
|
|
12
11
|
export { default as YLayout } from "./YLayout";
|
package/dist/layouts/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
export { default as BorderLayout } from "./BorderLayout";
|
|
2
2
|
export * from "./CardLayout";
|
|
3
|
-
export { default as CardLayout } from "./CardLayout";
|
|
4
3
|
export { default as CenterLayout } from "./CenterLayout";
|
|
5
4
|
export { default as GridLayout } from "./GridLayout";
|
|
6
5
|
export { default as HorizontalLayout } from "./HorizontalLayout";
|
|
7
|
-
export
|
|
6
|
+
export * from "./HPanel";
|
|
8
7
|
export { default as MainLayout } from "./MainLayout";
|
|
9
8
|
export { default as PageLayout } from "./PageLayout";
|
|
10
|
-
export
|
|
9
|
+
export * from "./VPanel";
|
|
11
10
|
export { default as XLayout } from "./XLayout";
|
|
12
11
|
export { default as YLayout } from "./YLayout";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
1
|
+
import nunjucks from "nunjucks";
|
|
2
|
+
// Configure Nunjucks environment
|
|
3
|
+
// export const nunjucksEnv = new nunjucks.Environment(undefined, {
|
|
4
|
+
// autoescape: false, // IMPORTANT: you already control the source
|
|
5
|
+
// throwOnUndefined: false,
|
|
6
|
+
// trimBlocks: true,
|
|
7
|
+
// lstripBlocks: true,
|
|
8
|
+
// });
|
|
9
|
+
const nunjucksEnv = new nunjucks.Environment(null, {
|
|
10
|
+
autoescape: false,
|
|
11
|
+
tags: {
|
|
12
|
+
variableStart: "{{",
|
|
13
|
+
variableEnd: "}}",
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
16
|
/**
|
|
17
17
|
* Renders an expression template with the provided data
|
|
18
18
|
* @param expr - The expression template string
|
|
@@ -23,22 +23,11 @@ export const render = (expr, data) => {
|
|
|
23
23
|
if (!expr)
|
|
24
24
|
return "";
|
|
25
25
|
try {
|
|
26
|
-
|
|
26
|
+
//process basic nanjucks expression {{val}}
|
|
27
|
+
return nunjucksEnv.renderString(expr, data);
|
|
27
28
|
}
|
|
28
29
|
catch (error) {
|
|
29
30
|
console.error("Expression render error:", error);
|
|
30
|
-
return expr;
|
|
31
|
+
return expr; // Return original expression on error
|
|
31
32
|
}
|
|
32
33
|
};
|
|
33
|
-
// import Mustache from "mustache";
|
|
34
|
-
// // Disable HTML escaping since you control the source
|
|
35
|
-
// Mustache.escape = (text) => text;
|
|
36
|
-
// export const render = (expr: string, data: any): string => {
|
|
37
|
-
// if (!expr) return "";
|
|
38
|
-
// try {
|
|
39
|
-
// return Mustache.render(expr, data);
|
|
40
|
-
// } catch (error) {
|
|
41
|
-
// console.error("Expression render error:", error);
|
|
42
|
-
// return expr;
|
|
43
|
-
// }
|
|
44
|
-
// };
|
|
@@ -10,22 +10,34 @@ export class ResourceLoader {
|
|
|
10
10
|
}
|
|
11
11
|
static getTemplate(name, loaderKey = "default") {
|
|
12
12
|
const cacheKey = `${loaderKey}:${name}`;
|
|
13
|
-
if (this.cache[cacheKey])
|
|
13
|
+
if (this.cache[cacheKey]) {
|
|
14
14
|
return this.cache[cacheKey];
|
|
15
|
+
}
|
|
15
16
|
const loader = loaderKey === "default" ? this.defaultLoader : this.loaders[loaderKey];
|
|
16
17
|
if (!loader) {
|
|
18
|
+
console.error("No loader found for key:", loaderKey);
|
|
17
19
|
const Fallback = dynamic(() => Promise.resolve({
|
|
18
20
|
default: () => React.createElement("div", { style: { color: "red" } }, `No loader registered for "${loaderKey}"`),
|
|
19
21
|
}));
|
|
20
22
|
this.cache[cacheKey] = Fallback;
|
|
21
23
|
return Fallback;
|
|
22
24
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
try {
|
|
26
|
+
const Comp = loader(name);
|
|
27
|
+
// this is temporary it should be cloned
|
|
28
|
+
// if (loaderKey != "component") {
|
|
29
|
+
// this.cache[cacheKey] = Comp;
|
|
30
|
+
// }
|
|
31
|
+
return Comp;
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
console.error("Error in loader:", err);
|
|
35
|
+
const Fallback = dynamic(() => Promise.resolve({
|
|
36
|
+
default: () => React.createElement("div", { style: { color: "red" } }, `Error loading template "${name}": ${err instanceof Error ? err.message : String(err)}`),
|
|
37
|
+
}));
|
|
38
|
+
this.cache[cacheKey] = Fallback;
|
|
39
|
+
return Fallback;
|
|
40
|
+
}
|
|
29
41
|
}
|
|
30
42
|
// Convenience helpers
|
|
31
43
|
static getComponent(name) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { DynamicComponent } from "../../core/DynamicComponent";
|
|
3
|
-
import HPanel from "../../layouts/HPanel";
|
|
3
|
+
import { HPanel } from "../../layouts/HPanel";
|
|
4
4
|
export const SectionProvider = (attr = {}) => {
|
|
5
5
|
const sections = {};
|
|
6
6
|
return {
|
|
@@ -1,95 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
//
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
// {
|
|
66
|
-
// style: { color: "red", padding: "8px", border: "1px solid red" },
|
|
67
|
-
// },
|
|
68
|
-
// `Component "${name}" is not registered`,
|
|
69
|
-
// ),
|
|
70
|
-
// };
|
|
71
|
-
// });
|
|
72
|
-
// // const actionLoader = (name: string) =>
|
|
73
|
-
// // dynamic(async () => {
|
|
74
|
-
// // try {
|
|
75
|
-
// // // 1️⃣ local component
|
|
76
|
-
// // const mod = await import(`@/actions`);
|
|
77
|
-
// // return { default: mod[name as keyof typeof mod] };
|
|
78
|
-
// // } catch {
|
|
79
|
-
// // try {
|
|
80
|
-
// // // 2️⃣ package component
|
|
81
|
-
// // const pkg = await import("@ramesesinc/react-ui");
|
|
82
|
-
// // const Comp = (pkg as Record<string, any>)[name];
|
|
83
|
-
// // if (!Comp) throw new Error();
|
|
84
|
-
// // return { default: Comp };
|
|
85
|
-
// // } catch {
|
|
86
|
-
// // // 3️⃣ neither found → throw
|
|
87
|
-
// // throw new Error(`Component "${name}" not found in local components or "@ramesesinc/react-ui"`);
|
|
88
|
-
// // }
|
|
89
|
-
// // }
|
|
90
|
-
// // });
|
|
91
|
-
// /* ---------------- Register loaders ---------------- */
|
|
92
|
-
// ResourceLoader.setDefaultLoader(templateLoader);
|
|
93
|
-
// ResourceLoader.registerLoader("component", componentLoader);
|
|
94
|
-
// // ResourceLoader.registerLoader("action", actionLoader);
|
|
95
|
-
// export default ResourceLoader;
|
|
1
|
+
import dynamic from "next/dynamic";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { ResourceLoader } from "./ResourceLoader";
|
|
4
|
+
/* ======================== Shared ======================== */
|
|
5
|
+
const createLoaderRef = (localKey, localLoader) => {
|
|
6
|
+
const ref = { current: null };
|
|
7
|
+
return () => {
|
|
8
|
+
if (ref.current == null) {
|
|
9
|
+
const res = {};
|
|
10
|
+
if (process.env.NODE_ENV === "development") {
|
|
11
|
+
// console.log("process.env.NODE_ENV", process.env.NODE_ENV);
|
|
12
|
+
res[localKey] = localLoader;
|
|
13
|
+
}
|
|
14
|
+
// console.log("process.env.NODE_ENV", process.env.NODE_ENV);
|
|
15
|
+
res["@ramesesinc/platform-core"] = () => import("@ramesesinc/platform-core");
|
|
16
|
+
res["@ramesesinc/client"] = () => import("@ramesesinc/client");
|
|
17
|
+
ref.current = res;
|
|
18
|
+
}
|
|
19
|
+
return ref.current;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
const getTemplateLoaders = createLoaderRef("@/templates", () => import("@/templates"));
|
|
23
|
+
const getComponentLoaders = createLoaderRef("@/components", () => import("@/components"));
|
|
24
|
+
/* ======================== Template Loader ======================== */
|
|
25
|
+
const templateLoader = (name) => dynamic(async () => {
|
|
26
|
+
var _a;
|
|
27
|
+
for (const loader of Object.values(getTemplateLoaders())) {
|
|
28
|
+
try {
|
|
29
|
+
const mod = await loader();
|
|
30
|
+
const Temp = mod[name];
|
|
31
|
+
if (Temp) {
|
|
32
|
+
return { default: Temp, hasSelectionHandling: (_a = Temp.hasSelectionHandling) !== null && _a !== void 0 ? _a : false };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
console.log("template loader Error", name, err);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
default: () => React.createElement("div", { style: { color: "red", padding: "8px", border: "1px solid red" } }, `Template "${name}" is not registered`),
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
/* ======================== Component Loader ======================== */
|
|
44
|
+
const componentLoader = (name) => dynamic(async () => {
|
|
45
|
+
for (const loader of Object.values(getComponentLoaders())) {
|
|
46
|
+
try {
|
|
47
|
+
const mod = await loader();
|
|
48
|
+
const Comp = mod[name];
|
|
49
|
+
if (Comp) {
|
|
50
|
+
return { default: Comp };
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
console.log("component loader Error", name, err);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
default: () => React.createElement("div", { style: { color: "red", padding: "8px", border: "1px solid red" } }, `Component "${name}" is not registered`),
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
/* ---------------- Register loaders ---------------- */
|
|
62
|
+
ResourceLoader.setDefaultLoader(templateLoader);
|
|
63
|
+
ResourceLoader.registerLoader("component", componentLoader);
|
|
64
|
+
export default ResourceLoader;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import nunjucks from "nunjucks";
|
|
2
|
+
// Client-side only environment
|
|
3
|
+
export const nunjucksEnv = new nunjucks.Environment(undefined, {
|
|
4
|
+
autoescape: false, // IMPORTANT: you already control the source
|
|
5
|
+
throwOnUndefined: false,
|
|
6
|
+
trimBlocks: true,
|
|
7
|
+
lstripBlocks: true,
|
|
8
|
+
});
|