@ramesesinc/platform-core 0.1.6 → 0.1.9

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.
Files changed (90) hide show
  1. package/dist/components/action/LookupPage.js +9 -31
  2. package/dist/components/action/ViewPage.d.ts +2 -0
  3. package/dist/components/action/ViewPage.js +25 -31
  4. package/dist/components/common/UIComponent.js +4 -3
  5. package/dist/components/index.d.ts +3 -0
  6. package/dist/components/index.js +1 -0
  7. package/dist/components/table/DataList.js +2 -2
  8. package/dist/components/view/PopupView.d.ts +13 -0
  9. package/dist/components/view/PopupView.js +25 -20
  10. package/dist/core/DataContext.d.ts +7 -4
  11. package/dist/core/DataContext.js +16 -4
  12. package/dist/core/Page.js +25 -26
  13. package/dist/core/PageCache.js +7 -7
  14. package/dist/core/PageContext.js +17 -7
  15. package/dist/core/PageViewContext.d.ts +13 -1
  16. package/dist/core/PageViewContext.js +75 -2
  17. package/dist/core/PopupContext.d.ts +49 -0
  18. package/dist/core/PopupContext.js +380 -0
  19. package/dist/core/RowContext.js +1 -1
  20. package/dist/core/WindowContext.d.ts +15 -0
  21. package/dist/core/WindowContext.js +28 -0
  22. package/dist/core/index.d.ts +17 -0
  23. package/dist/core/index.js +1 -0
  24. package/dist/index.css +25 -7
  25. package/dist/lib/utils/BeanUtils.js +7 -7
  26. package/dist/templates/DataListTemplate.js +7 -2
  27. package/dist/templates/ExplorerTemplate.js +1 -1
  28. package/package.json +5 -5
  29. package/dist/components/action/AlertMessage.tsx +0 -38
  30. package/dist/components/action/Button.tsx +0 -230
  31. package/dist/components/action/CancelEdit.tsx +0 -40
  32. package/dist/components/action/DeleteData.tsx +0 -73
  33. package/dist/components/action/Edit.tsx +0 -40
  34. package/dist/components/action/LookupPage.tsx +0 -113
  35. package/dist/components/action/ProcessRunner.tsx +0 -337
  36. package/dist/components/action/Refresh.tsx +0 -35
  37. package/dist/components/action/SaveData.tsx +0 -74
  38. package/dist/components/action/SelectData.tsx +0 -47
  39. package/dist/components/action/Undo.tsx +0 -50
  40. package/dist/components/action/UpdateData.tsx +0 -49
  41. package/dist/components/action/UpdateState.tsx +0 -40
  42. package/dist/components/action/ViewBackPage.tsx +0 -46
  43. package/dist/components/action/ViewPage.tsx +0 -141
  44. package/dist/components/common/UIComponent.tsx +0 -86
  45. package/dist/components/common/UIInput.tsx +0 -49
  46. package/dist/components/common/UIMenu.tsx +0 -91
  47. package/dist/components/index.ts +0 -51
  48. package/dist/components/input/CodeEditor.tsx +0 -188
  49. package/dist/components/input/DateField.tsx +0 -274
  50. package/dist/components/input/DayPicker.tsx +0 -5
  51. package/dist/components/input/HtmlCode.tsx +0 -203
  52. package/dist/components/input/JsonCode.tsx +0 -205
  53. package/dist/components/input/MonthPicker.tsx +0 -5
  54. package/dist/components/input/ScriptCode.tsx +0 -195
  55. package/dist/components/input/Select.tsx +0 -78
  56. package/dist/components/input/SqlCode.tsx +0 -162
  57. package/dist/components/input/StringDecision.tsx +0 -64
  58. package/dist/components/input/Text.tsx +0 -57
  59. package/dist/components/input/YearPicker.tsx +0 -81
  60. package/dist/components/list/IconMenu.tsx +0 -115
  61. package/dist/components/list/TabMenu.tsx +0 -127
  62. package/dist/components/list/TreeMenu.tsx +0 -279
  63. package/dist/components/list/TxnTaskList.tsx +0 -198
  64. package/dist/components/output/Label.tsx +0 -50
  65. package/dist/components/table/DataList.tsx +0 -820
  66. package/dist/components/table/DataTable.tsx +0 -572
  67. package/dist/components/table/ListHandler.ts +0 -276
  68. package/dist/components/table/TableContext.tsx +0 -122
  69. package/dist/components/view/ComponentView.tsx +0 -102
  70. package/dist/components/view/FilterView.tsx +0 -21
  71. package/dist/components/view/HtmlForm.tsx +0 -176
  72. package/dist/components/view/HtmlView.tsx +0 -98
  73. package/dist/components/view/IFrameView.tsx +0 -48
  74. package/dist/components/view/Modal.tsx +0 -72
  75. package/dist/components/view/PageView.tsx +0 -131
  76. package/dist/components/view/PopupView.tsx +0 -160
  77. package/dist/components/view/RootView.tsx +0 -109
  78. package/dist/components/view/WizardView.tsx +0 -48
  79. package/dist/lib/layouts/BorderLayout.tsx +0 -31
  80. package/dist/lib/layouts/CardLayout.tsx +0 -73
  81. package/dist/lib/layouts/CenterLayout.tsx +0 -20
  82. package/dist/lib/layouts/GridLayout.tsx +0 -20
  83. package/dist/lib/layouts/HPanel.tsx +0 -31
  84. package/dist/lib/layouts/HorizontalLayout.tsx +0 -29
  85. package/dist/lib/layouts/MainLayout.tsx +0 -16
  86. package/dist/lib/layouts/PageLayout.tsx +0 -29
  87. package/dist/lib/layouts/VPanel.tsx +0 -27
  88. package/dist/lib/layouts/XLayout.tsx +0 -29
  89. package/dist/lib/layouts/YLayout.tsx +0 -29
  90. package/dist/lib/layouts/index.ts +0 -13
@@ -1,73 +0,0 @@
1
- import { UIControl } from "@ramesesinc/client";
2
- import React, { ReactElement, ReactNode, Suspense } from "react";
3
-
4
- export interface CardProps {
5
- name: string;
6
- element: ReactNode;
7
- }
8
- /**
9
- * Card is a declarative wrapper for CardLayout.
10
- * It does not render UI by itself, only provides data (name + element).
11
- */
12
- export function Card(_props: CardProps): null {
13
- return null;
14
- }
15
-
16
- type CardLayoutRefModel = {
17
- getName: () => string | null;
18
- getElement: () => ReactNode;
19
- validate: () => void;
20
- };
21
-
22
- export type CardLayoutRef = {
23
- current?: CardLayoutRefModel;
24
- };
25
-
26
- type CardLayoutProps = {
27
- ref?: CardLayoutRef;
28
- layoutid?: string;
29
- className?: string;
30
- children: ReactNode;
31
-
32
- value: string;
33
- };
34
-
35
- const CardLayout = ({ ref, layoutid, className, children, value = "default" }: CardLayoutProps) => {
36
- const preferredLayoutId = (layoutid ?? "") ? layoutid : "cardlayout";
37
-
38
- // Extract only <Card> children
39
- const cards: ReactElement<CardProps>[] = React.Children.toArray(children).filter(
40
- (child): child is ReactElement<CardProps> => React.isValidElement(child) && child.type === Card,
41
- );
42
-
43
- const activeCard = cards.find((c) => c.props.name === value);
44
-
45
- if (ref != null) {
46
- ref.current = {
47
- getName: () => (activeCard ? activeCard.props.name : null),
48
- getElement: () => (activeCard ? activeCard.props.element : null),
49
- validate: () => {
50
- if (activeCard == null || activeCard.props.element == null) {
51
- return;
52
- }
53
-
54
- const elem = activeCard.props.element;
55
- const props = (elem as ReactElement<UIControl>).props;
56
- if (props.binding != null) {
57
- const result = props.binding.validate();
58
- if (result != null) {
59
- throw Error(result);
60
- }
61
- }
62
- },
63
- };
64
- }
65
-
66
- return (
67
- <div className={`${preferredLayoutId}-container ${className ?? ""} flex flex-col h-full`}>
68
- <Suspense fallback={<div>Loading...</div>}>{activeCard ? activeCard.props.element : null}</Suspense>
69
- </div>
70
- );
71
- };
72
-
73
- export default CardLayout;
@@ -1,20 +0,0 @@
1
- import React, { ReactNode } from "react";
2
-
3
- type CenterLayoutProps = {
4
- layoutid?: string;
5
- className?: string;
6
- children?: ReactNode;
7
- };
8
-
9
- const CenterLayout = ({ layoutid, className, children }: CenterLayoutProps) => {
10
-
11
- const preferredLayoutId = ((layoutid ?? '') ? layoutid : 'pagelayout');
12
-
13
- return (
14
- <div className={`${preferredLayoutId}-container ${className ?? ''} flex items-center justify-center w-full h-full`}>
15
- {children}
16
- </div>
17
- );
18
- };
19
-
20
- export default CenterLayout;
@@ -1,20 +0,0 @@
1
- import React, { ReactNode } from "react";
2
-
3
- type GridLayoutProps = {
4
- className?: string;
5
- cols?: number;
6
- gap?: number;
7
-
8
- children?: ReactNode;
9
- }
10
-
11
- const GridLayout = ({ className, cols = 3, gap = 1, children }: GridLayoutProps) => {
12
-
13
- return (
14
- <div className={`${className ?? ''} grid gap-${gap}`} style={{gridTemplateColumns: `repeat(${cols}, 1fr)`}}>
15
- {children}
16
- </div>
17
- );
18
- };
19
-
20
- export default GridLayout;
@@ -1,31 +0,0 @@
1
- "use client";
2
-
3
- import React, { CSSProperties, ReactNode } from "react";
4
-
5
- interface HPanelProps {
6
- children?: ReactNode;
7
- gap?: number | string; // spacing between items
8
- style?: CSSProperties;
9
- className?: string;
10
- alignItems?: CSSProperties["alignItems"]; // flex alignment
11
- justifyContent?: CSSProperties["justifyContent"];
12
- }
13
-
14
- const HPanel: React.FC<HPanelProps> = ({ children, gap = 0, style, className, alignItems = "center", justifyContent = "flex-start" }) => {
15
- const panelStyle: CSSProperties = {
16
- display: "flex",
17
- flexDirection: "row",
18
- gap: gap,
19
- alignItems,
20
- justifyContent,
21
- ...style,
22
- };
23
-
24
- return (
25
- <div style={panelStyle} className={className}>
26
- {children}
27
- </div>
28
- );
29
- };
30
-
31
- export default HPanel;
@@ -1,29 +0,0 @@
1
- import React, { ReactNode } from "react";
2
-
3
- type HorizontalLayoutProps = {
4
- layoutid?: string;
5
- className?: string;
6
- gap?: number;
7
- left?: ReactNode;
8
- right?: ReactNode;
9
- children?: ReactNode;
10
- };
11
-
12
- const HorizontalLayout = ({ layoutid, className, gap = 0, left, right, children }: HorizontalLayoutProps) => {
13
-
14
- const preferredLayoutId = ((layoutid ?? '') ? layoutid : 'horizontallayout');
15
-
16
- return (
17
- <div className={`${preferredLayoutId}-container ${className ?? ""} flex flex-row h-full gap-${gap}`}>
18
- {left}
19
-
20
- <div className="flex-1">
21
- {children}
22
- </div>
23
-
24
- {right}
25
- </div>
26
- );
27
- };
28
-
29
- export default HorizontalLayout;
@@ -1,16 +0,0 @@
1
- // src/layouts/MainLayout.tsx
2
- import { ReactNode } from "react";
3
-
4
- interface MainLayoutProps {
5
- children: ReactNode;
6
- }
7
-
8
- export const MainLayout = ({ children }: MainLayoutProps) => {
9
- return (
10
- <div className="min-h-screen flex flex-col">
11
- <main className="flex-1">{children}</main>
12
- </div>
13
- );
14
- };
15
-
16
- export default MainLayout;
@@ -1,29 +0,0 @@
1
- import React, { ReactNode } from "react";
2
-
3
- type PageLayoutProps = {
4
- layoutid?: string;
5
- className?: string;
6
- gap?: number;
7
- header?: ReactNode;
8
- footer?: ReactNode;
9
- children?: ReactNode;
10
- };
11
-
12
- const PageLayout = ({ layoutid, className, gap = 0, header, footer, children }: PageLayoutProps) => {
13
-
14
- const preferredLayoutId = ((layoutid ?? '') ? layoutid : 'pagelayout');
15
-
16
- return (
17
- <div className={`${preferredLayoutId}-container ${className ?? ""} flex flex-col h-full gap-${gap}`}>
18
- {header}
19
-
20
- <div className="flex-1">
21
- {children}
22
- </div>
23
-
24
- {footer}
25
- </div>
26
- );
27
- };
28
-
29
- export default PageLayout;
@@ -1,27 +0,0 @@
1
- "use client";
2
-
3
- import React, { CSSProperties, ReactNode } from "react";
4
-
5
- interface VPanelProps {
6
- children?: ReactNode;
7
- gap?: number | string; // spacing between items
8
- style?: CSSProperties; // custom styles
9
- className?: string; // optional tailwind or other class
10
- }
11
-
12
- const VPanel: React.FC<VPanelProps> = ({ children, gap = 0, style, className }) => {
13
- const panelStyle: CSSProperties = {
14
- display: "flex",
15
- flexDirection: "column",
16
- gap: gap,
17
- ...style,
18
- };
19
-
20
- return (
21
- <div style={panelStyle} className={className}>
22
- {children}
23
- </div>
24
- );
25
- };
26
-
27
- export default VPanel;
@@ -1,29 +0,0 @@
1
- import React from "react";
2
-
3
- type XLayoutAlignment = "left" | "center" | "right";
4
-
5
- type XLayoutProps = {
6
- className?: string;
7
- gap?: number;
8
- align?: XLayoutAlignment;
9
- children?: React.ReactNode;
10
- };
11
-
12
- const XLayout: React.FC<XLayoutProps> = ({
13
- className,
14
- gap = 2,
15
- align = "left",
16
- children,
17
- }) => {
18
- let justifyClass = "justify-start"; // default = left
19
- if (align === "center") justifyClass = "justify-center";
20
- if (align === "right") justifyClass = "justify-end";
21
-
22
- return (
23
- <div className={`${className ?? ""} flex flex-row gap-${gap} ${justifyClass}`.trim()}>
24
- {children}
25
- </div>
26
- );
27
- };
28
-
29
- export default XLayout;
@@ -1,29 +0,0 @@
1
- import React from "react";
2
-
3
- type YLayoutAlignment = "top" | "center" | "bottom";
4
-
5
- type YLayoutProps = {
6
- className?: string;
7
- gap?: number;
8
- align?: YLayoutAlignment;
9
- children?: React.ReactNode;
10
- };
11
-
12
- const YLayout: React.FC<YLayoutProps> = ({
13
- className,
14
- gap = 2,
15
- align = "top",
16
- children,
17
- }) => {
18
- let justifyClass = "justify-start"; // default = left
19
- if (align === "center") justifyClass = "justify-center";
20
- if (align === "bottom") justifyClass = "justify-end";
21
-
22
- return (
23
- <div className={`${className ?? ""} flex flex-col gap-${gap} ${justifyClass}`.trim()}>
24
- {children}
25
- </div>
26
- );
27
- };
28
-
29
- export default YLayout;
@@ -1,13 +0,0 @@
1
- export { default as BorderLayout } from "./BorderLayout";
2
- export * from "./CardLayout";
3
- export { default as CardLayout } from "./CardLayout";
4
- export { default as CenterLayout } from "./CenterLayout";
5
- export { default as GridLayout } from "./GridLayout";
6
-
7
- export { default as HorizontalLayout } from "./HorizontalLayout";
8
- export { default as HPanel } from "./HPanel";
9
- export { default as MainLayout } from "./MainLayout";
10
- export { default as PageLayout } from "./PageLayout";
11
- export { default as VPanel } from "./VPanel";
12
- export { default as XLayout } from "./XLayout";
13
- export { default as YLayout } from "./YLayout";