@siliconst/metaui 1.4.14 → 1.4.17
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/package.json +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate-dbg.js +28 -6
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.d.ts +3 -2
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.ts +30 -6
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry-dbg.js +1 -0
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.ts +1 -0
- package/src/nz/co/siliconst/ui5/metaui/library-preload.js +17 -16
- package/src/nz/co/siliconst/ui5/metaui/library-preload.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin-dbg.js +3 -20
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.ts +3 -3
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin-dbg.js +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.ts +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin-dbg.js +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.ts +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin-dbg.js +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.ts +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin-dbg.js +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.ts +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin-dbg.js +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.ts +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin-dbg.js +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin.ts +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin-dbg.js +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.ts +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin-dbg.js +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.ts +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin-dbg.js +35 -11
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.d.ts +4 -4
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.ts +38 -14
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin-dbg.js +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.ts +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin-dbg.js +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.ts +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin-dbg.js +79 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin-dbg.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.d.ts +35 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.d.ts.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.js +2 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.js.map +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.ts +80 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin-dbg.js +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.ts +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin-dbg.js +1 -0
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin-dbg.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.d.ts.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.js +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.js.map +1 -1
- package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.ts +1 -0
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
sap.ui.define(["sap/m/Dialog", "sap/m/Button", "../../../utils/Logger"], function (Dialog, Button, _____utils_Logger) {
|
|
1
|
+
sap.ui.define(["sap/m/Dialog", "sap/m/Button", "sap/m/BusyDialog", "../../../utils/Logger"], function (Dialog, Button, BusyDialog, _____utils_Logger) {
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
const Logger = _____utils_Logger["Logger"];
|
|
@@ -8,6 +8,7 @@ sap.ui.define(["sap/m/Dialog", "sap/m/Button", "../../../utils/Logger"], functio
|
|
|
8
8
|
class DialogDelegate {
|
|
9
9
|
activeDialog = null;
|
|
10
10
|
requestedWidth = "auto";
|
|
11
|
+
calculatedOptimalWidth = "auto";
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Initializes a new DialogDelegate to handle dialog-based rendering.
|
|
@@ -21,14 +22,33 @@ sap.ui.define(["sap/m/Dialog", "sap/m/Button", "../../../utils/Logger"], functio
|
|
|
21
22
|
* Dialog Modality: Opens the generated layout inside a sap.m.Dialog.
|
|
22
23
|
* Automatically wires up customizable submit (default: 'OK') and 'Cancel' buttons.
|
|
23
24
|
*/
|
|
24
|
-
openInDialog(title = "Form", submitButtonText = "OK", isGenerated, cancelButtonText = "Cancel", dialogWidth = "auto", parentView) {
|
|
25
|
-
// UI5 PURITY: Do not manually force generate() here.
|
|
26
|
-
// Opening the dialog mounts the host, natively firing onBeforeRendering() which triggers generation cleanly.
|
|
27
|
-
|
|
25
|
+
async openInDialog(title = "Form", submitButtonText = "OK", isGenerated, cancelButtonText = "Cancel", dialogWidth = "auto", parentView) {
|
|
28
26
|
this.requestedWidth = dialogWidth;
|
|
27
|
+
this.calculatedOptimalWidth = dialogWidth; // Default fallback
|
|
28
|
+
|
|
29
|
+
// Mask the complex asynchronous rendering to prevent visual snapping
|
|
30
|
+
const busyDialog = new BusyDialog({
|
|
31
|
+
text: "Building Form..."
|
|
32
|
+
});
|
|
33
|
+
busyDialog.open();
|
|
34
|
+
try {
|
|
35
|
+
// Force manual generation BEFORE mounting the dialog so the optimal width is perfectly calculated first
|
|
36
|
+
const genResult = this.host.generate();
|
|
37
|
+
if (genResult instanceof Promise) {
|
|
38
|
+
await genResult;
|
|
39
|
+
}
|
|
40
|
+
} catch (err) {
|
|
41
|
+
busyDialog.close();
|
|
42
|
+
Logger.error("[MetaUI] Catastrophic error during pre-generation of dialog content", err.message, "DialogDelegate");
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
busyDialog.close();
|
|
46
|
+
|
|
47
|
+
// The Engine heuristically updated `calculatedOptimalWidth` during `generate()`. Apply it on frame 1.
|
|
48
|
+
const finalWidth = this.requestedWidth === "auto" && this.calculatedOptimalWidth !== "auto" ? this.calculatedOptimalWidth : this.requestedWidth;
|
|
29
49
|
const dialog = new Dialog({
|
|
30
50
|
title: title,
|
|
31
|
-
contentWidth:
|
|
51
|
+
contentWidth: finalWidth,
|
|
32
52
|
content: [this.host],
|
|
33
53
|
// Mount host inside the dialog
|
|
34
54
|
beginButton: new Button({
|
|
@@ -72,6 +92,8 @@ sap.ui.define(["sap/m/Dialog", "sap/m/Button", "../../../utils/Logger"], functio
|
|
|
72
92
|
* Allows the Engine to retroactively expand the dialog once the schema is fully parsed.
|
|
73
93
|
*/
|
|
74
94
|
updateDialogWidthDynamically(optimalWidth) {
|
|
95
|
+
this.calculatedOptimalWidth = optimalWidth;
|
|
96
|
+
// Only dynamically stretch if the dialog is ALREADY open (e.g., hybrid inference late-loading)
|
|
75
97
|
if (this.activeDialog && this.requestedWidth === "auto" && optimalWidth !== "auto") {
|
|
76
98
|
this.activeDialog.setContentWidth(optimalWidth);
|
|
77
99
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogDelegate-dbg.js","names":["Logger","_____utils_Logger","DialogDelegate","activeDialog","requestedWidth","constructor","host","openInDialog","title","submitButtonText","isGenerated","cancelButtonText","dialogWidth","parentView","
|
|
1
|
+
{"version":3,"file":"DialogDelegate-dbg.js","names":["Logger","_____utils_Logger","DialogDelegate","activeDialog","requestedWidth","calculatedOptimalWidth","constructor","host","openInDialog","title","submitButtonText","isGenerated","cancelButtonText","dialogWidth","parentView","busyDialog","BusyDialog","text","open","genResult","generate","Promise","err","close","error","message","finalWidth","dialog","Dialog","contentWidth","content","beginButton","Button","type","press","success","triggerSubmit","fireEvent","fieldPath","endButton","afterClose","destroy","addDependent","updateDialogWidthDynamically","optimalWidth","setContentWidth","__exports","__esModule"],"sources":["DialogDelegate.ts"],"sourcesContent":["import Dialog from \"sap/m/Dialog\";\nimport Button from \"sap/m/Button\";\nimport Control from \"sap/ui/core/Control\";\nimport BusyDialog from \"sap/m/BusyDialog\";\nimport { Logger } from \"../../../utils/Logger\";\n\nexport interface IHostDialog {\n generate(): Promise<void> | void;\n triggerSubmit(): boolean;\n fireEvent(eventName: string, parameters?: Record<string, unknown>): this;\n}\n\n/**\n * Extracts all popup and dialog generation logic from the Host control.\n */\nexport class DialogDelegate {\n private host: IHostDialog & Control;\n private activeDialog: Dialog | null = null;\n private requestedWidth: string = \"auto\";\n private calculatedOptimalWidth: string = \"auto\";\n\n /**\n * Initializes a new DialogDelegate to handle dialog-based rendering.\n * @param host The parent DynamicHost or GeneratorHost control.\n */\n constructor(host: IHostDialog & Control) {\n this.host = host;\n }\n\n /**\n * Dialog Modality: Opens the generated layout inside a sap.m.Dialog.\n * Automatically wires up customizable submit (default: 'OK') and 'Cancel' buttons.\n */\n public async openInDialog(title: string = \"Form\", submitButtonText: string = \"OK\", isGenerated: boolean, cancelButtonText: string = \"Cancel\", dialogWidth: string = \"auto\", parentView?: Control): Promise<void> {\n this.requestedWidth = dialogWidth;\n this.calculatedOptimalWidth = dialogWidth; // Default fallback\n\n // Mask the complex asynchronous rendering to prevent visual snapping\n const busyDialog = new BusyDialog({ text: \"Building Form...\" });\n busyDialog.open();\n\n try {\n // Force manual generation BEFORE mounting the dialog so the optimal width is perfectly calculated first\n const genResult = this.host.generate();\n if (genResult instanceof Promise) {\n await genResult;\n }\n } catch (err) {\n busyDialog.close();\n Logger.error(\"[MetaUI] Catastrophic error during pre-generation of dialog content\", (err as Error).message, \"DialogDelegate\");\n return;\n }\n\n busyDialog.close();\n\n // The Engine heuristically updated `calculatedOptimalWidth` during `generate()`. Apply it on frame 1.\n const finalWidth = this.requestedWidth === \"auto\" && this.calculatedOptimalWidth !== \"auto\" ? this.calculatedOptimalWidth : this.requestedWidth;\n\n const dialog = new Dialog({\n title: title,\n contentWidth: finalWidth,\n content: [this.host], // Mount host inside the dialog\n beginButton: new Button({\n text: submitButtonText,\n type: \"Emphasized\",\n press: () => {\n try {\n const success = this.host.triggerSubmit();\n if (success) {\n dialog.close();\n }\n } catch (err) {\n Logger.error(\"[MetaUI] Catastrophic error during validation/submit pipeline\", (err as Error).message, \"DialogDelegate\");\n this.host.fireEvent(\"validationError\", { fieldPath: \"root\", message: (err as Error).message });\n }\n }\n }),\n endButton: new Button({\n text: cancelButtonText,\n press: () => {\n this.host.fireEvent(\"cancel\");\n dialog.close();\n }\n }),\n afterClose: () => {\n this.activeDialog = null;\n dialog.destroy();\n }\n });\n\n this.activeDialog = dialog;\n\n if (parentView && typeof parentView.addDependent === \"function\") {\n parentView.addDependent(dialog);\n }\n\n dialog.open();\n }\n\n /**\n * Allows the Engine to retroactively expand the dialog once the schema is fully parsed.\n */\n public updateDialogWidthDynamically(optimalWidth: string): void {\n this.calculatedOptimalWidth = optimalWidth;\n // Only dynamically stretch if the dialog is ALREADY open (e.g., hybrid inference late-loading)\n if (this.activeDialog && this.requestedWidth === \"auto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B,YAAY,CAACf,MAAM,CAAC;MACnC;MAEAA,MAAM,CAACT,IAAI,CAAC,CAAC;IACjB;;IAEA;AACJ;AACA;IACWyB,4BAA4BA,CAACC,YAAoB,EAAQ;MAC5D,IAAI,CAACvC,sBAAsB,GAAGuC,YAAY;MAC1C;MACA,IAAI,IAAI,CAACzC,YAAY,IAAI,IAAI,CAACC,cAAc,KAAK,MAAM,IAAIwC,YAAY,KAAK,MAAM,EAAE;QAChF,IAAI,CAACzC,YAAY,CAAC0C,eAAe,CAACD,YAAY,CAAC;MACnD;IACJ;EACJ;EAAC,IAAAE,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAA5C,cAAA,GAAAA,cAAA;EAAA,OAAA4C,SAAA;AAAA","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare module "nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate" {
|
|
2
2
|
import Control from "sap/ui/core/Control";
|
|
3
3
|
export interface IHostDialog {
|
|
4
|
-
generate(): void;
|
|
4
|
+
generate(): Promise<void> | void;
|
|
5
5
|
triggerSubmit(): boolean;
|
|
6
6
|
fireEvent(eventName: string, parameters?: Record<string, unknown>): this;
|
|
7
7
|
}
|
|
@@ -12,6 +12,7 @@ declare module "nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegat
|
|
|
12
12
|
private host;
|
|
13
13
|
private activeDialog;
|
|
14
14
|
private requestedWidth;
|
|
15
|
+
private calculatedOptimalWidth;
|
|
15
16
|
/**
|
|
16
17
|
* Initializes a new DialogDelegate to handle dialog-based rendering.
|
|
17
18
|
* @param host The parent DynamicHost or GeneratorHost control.
|
|
@@ -21,7 +22,7 @@ declare module "nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegat
|
|
|
21
22
|
* Dialog Modality: Opens the generated layout inside a sap.m.Dialog.
|
|
22
23
|
* Automatically wires up customizable submit (default: 'OK') and 'Cancel' buttons.
|
|
23
24
|
*/
|
|
24
|
-
openInDialog(title: string, submitButtonText: string, isGenerated: boolean, cancelButtonText?: string, dialogWidth?: string, parentView?: Control): void
|
|
25
|
+
openInDialog(title: string, submitButtonText: string, isGenerated: boolean, cancelButtonText?: string, dialogWidth?: string, parentView?: Control): Promise<void>;
|
|
25
26
|
/**
|
|
26
27
|
* Allows the Engine to retroactively expand the dialog once the schema is fully parsed.
|
|
27
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogDelegate.d.ts","sourceRoot":"../../../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,mEAAmE,CAAC;IAGnF,OAAO,OAAO,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"DialogDelegate.d.ts","sourceRoot":"../../../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,mEAAmE,CAAC;IAGnF,OAAO,OAAO,MAAM,qBAAqB,CAAC;IAI1C,UAAiB,WAAW;QACxB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;QACjC,aAAa,IAAI,OAAO,CAAC;QACzB,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;KAC5E;IAED;;OAEG;IACH,MAAa,cAAc;QACvB,OAAO,CAAC,IAAI,CAAwB;QACpC,OAAO,CAAC,YAAY,CAAuB;QAC3C,OAAO,CAAC,cAAc,CAAkB;QACxC,OAAO,CAAC,sBAAsB,CAAkB;QAEhD;;;WAGG;oBACS,IAAI,EAAE,WAAW,GAAG,OAAO;QAIvC;;;WAGG;QACU,YAAY,CAAC,KAAK,EAAE,MAAe,EAAE,gBAAgB,EAAE,MAAa,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,GAAE,MAAiB,EAAE,WAAW,GAAE,MAAe,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;QAkEhN;;WAEG;QACI,4BAA4B,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;KAOlE;CAEA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
sap.ui.define(["sap/m/Dialog","sap/m/Button","../../../utils/Logger"],function(t,e,i){"use strict";const o=
|
|
1
|
+
sap.ui.define(["sap/m/Dialog","sap/m/Button","sap/m/BusyDialog","../../../utils/Logger"],function(t,e,i,a){"use strict";const o=a["Logger"];class s{activeDialog=null;requestedWidth="auto";calculatedOptimalWidth="auto";constructor(t){this.host=t}async openInDialog(a="Form",s="OK",n,l="Cancel",r="auto",c){this.requestedWidth=r;this.calculatedOptimalWidth=r;const h=new i({text:"Building Form..."});h.open();try{const t=this.host.generate();if(t instanceof Promise){await t}}catch(t){h.close();o.error("[MetaUI] Catastrophic error during pre-generation of dialog content",t.message,"DialogDelegate");return}h.close();const d=this.requestedWidth==="auto"&&this.calculatedOptimalWidth!=="auto"?this.calculatedOptimalWidth:this.requestedWidth;const u=new t({title:a,contentWidth:d,content:[this.host],beginButton:new e({text:s,type:"Emphasized",press:()=>{try{const t=this.host.triggerSubmit();if(t){u.close()}}catch(t){o.error("[MetaUI] Catastrophic error during validation/submit pipeline",t.message,"DialogDelegate");this.host.fireEvent("validationError",{fieldPath:"root",message:t.message})}}}),endButton:new e({text:l,press:()=>{this.host.fireEvent("cancel");u.close()}}),afterClose:()=>{this.activeDialog=null;u.destroy()}});this.activeDialog=u;if(c&&typeof c.addDependent==="function"){c.addDependent(u)}u.open()}updateDialogWidthDynamically(t){this.calculatedOptimalWidth=t;if(this.activeDialog&&this.requestedWidth==="auto"&&t!=="auto"){this.activeDialog.setContentWidth(t)}}}var n={__esModule:true};n.DialogDelegate=s;return n});
|
|
2
2
|
//# sourceMappingURL=DialogDelegate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogDelegate.js","names":["Logger","_____utils_Logger","DialogDelegate","activeDialog","requestedWidth","constructor","host","this","openInDialog","title","submitButtonText","isGenerated","cancelButtonText","dialogWidth","parentView","
|
|
1
|
+
{"version":3,"file":"DialogDelegate.js","names":["Logger","_____utils_Logger","DialogDelegate","activeDialog","requestedWidth","calculatedOptimalWidth","constructor","host","this","openInDialog","title","submitButtonText","isGenerated","cancelButtonText","dialogWidth","parentView","busyDialog","BusyDialog","text","open","genResult","generate","Promise","err","close","error","message","finalWidth","dialog","Dialog","contentWidth","content","beginButton","Button","type","press","success","triggerSubmit","fireEvent","fieldPath","endButton","afterClose","destroy","addDependent","updateDialogWidthDynamically","optimalWidth","setContentWidth","__exports","__esModule"],"sources":["DialogDelegate.ts"],"sourcesContent":["import Dialog from \"sap/m/Dialog\";\nimport Button from \"sap/m/Button\";\nimport Control from \"sap/ui/core/Control\";\nimport BusyDialog from \"sap/m/BusyDialog\";\nimport { Logger } from \"../../../utils/Logger\";\n\nexport interface IHostDialog {\n generate(): Promise<void> | void;\n triggerSubmit(): boolean;\n fireEvent(eventName: string, parameters?: Record<string, unknown>): this;\n}\n\n/**\n * Extracts all popup and dialog generation logic from the Host control.\n */\nexport class DialogDelegate {\n private host: IHostDialog & Control;\n private activeDialog: Dialog | null = null;\n private requestedWidth: string = \"auto\";\n private calculatedOptimalWidth: string = \"auto\";\n\n /**\n * Initializes a new DialogDelegate to handle dialog-based rendering.\n * @param host The parent DynamicHost or GeneratorHost control.\n */\n constructor(host: IHostDialog & Control) {\n this.host = host;\n }\n\n /**\n * Dialog Modality: Opens the generated layout inside a sap.m.Dialog.\n * Automatically wires up customizable submit (default: 'OK') and 'Cancel' buttons.\n */\n public async openInDialog(title: string = \"Form\", submitButtonText: string = \"OK\", isGenerated: boolean, cancelButtonText: string = \"Cancel\", dialogWidth: string = \"auto\", parentView?: Control): Promise<void> {\n this.requestedWidth = dialogWidth;\n this.calculatedOptimalWidth = dialogWidth; // Default fallback\n\n // Mask the complex asynchronous rendering to prevent visual snapping\n const busyDialog = new BusyDialog({ text: \"Building Form...\" });\n busyDialog.open();\n\n try {\n // Force manual generation BEFORE mounting the dialog so the optimal width is perfectly calculated first\n const genResult = this.host.generate();\n if (genResult instanceof Promise) {\n await genResult;\n }\n } catch (err) {\n busyDialog.close();\n Logger.error(\"[MetaUI] Catastrophic error during pre-generation of dialog content\", (err as Error).message, \"DialogDelegate\");\n return;\n }\n\n busyDialog.close();\n\n // The Engine heuristically updated `calculatedOptimalWidth` during `generate()`. Apply it on frame 1.\n const finalWidth = this.requestedWidth === \"auto\" && this.calculatedOptimalWidth !== \"auto\" ? this.calculatedOptimalWidth : this.requestedWidth;\n\n const dialog = new Dialog({\n title: title,\n contentWidth: finalWidth,\n content: [this.host], // Mount host inside the dialog\n beginButton: new Button({\n text: submitButtonText,\n type: \"Emphasized\",\n press: () => {\n try {\n const success = this.host.triggerSubmit();\n if (success) {\n dialog.close();\n }\n } catch (err) {\n Logger.error(\"[MetaUI] Catastrophic error during validation/submit pipeline\", (err as Error).message, \"DialogDelegate\");\n this.host.fireEvent(\"validationError\", { fieldPath: \"root\", message: (err as Error).message });\n }\n }\n }),\n endButton: new Button({\n text: cancelButtonText,\n press: () => {\n this.host.fireEvent(\"cancel\");\n dialog.close();\n }\n }),\n afterClose: () => {\n this.activeDialog = null;\n dialog.destroy();\n }\n });\n\n this.activeDialog = dialog;\n\n if (parentView && typeof parentView.addDependent === \"function\") {\n parentView.addDependent(dialog);\n }\n\n dialog.open();\n }\n\n /**\n * Allows the Engine to retroactively expand the dialog once the schema is fully parsed.\n */\n public updateDialogWidthDynamically(optimalWidth: string): void {\n this.calculatedOptimalWidth = optimalWidth;\n // Only dynamically stretch if the dialog is ALREADY open (e.g., hybrid inference late-loading)\n if (this.activeDialog && this.requestedWidth === \"auto\" && optimalWidth !== \"auto\") {\n this.activeDialog.setContentWidth(optimalWidth);\n }\n }\n}\n"],"mappings":"8HAISA,EAAMC,EAA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ACX,CAKOyB,6BAA6BC,GAChCrC,KAAKH,uBAAyBwC,EAE9B,GAAIrC,KAAKL,cAAgBK,KAAKJ,iBAAmB,QAAUyC,IAAiB,OAAQ,CAChFrC,KAAKL,aAAa2C,gBAAgBD,EACtC,CACJ,EACH,IAAAE,EAAA,CAAAC,WAAA,MAAAD,EAAA7C,iBAAA,OAAA6C,CAAA","ignoreList":[]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import Dialog from "sap/m/Dialog";
|
|
2
2
|
import Button from "sap/m/Button";
|
|
3
3
|
import Control from "sap/ui/core/Control";
|
|
4
|
+
import BusyDialog from "sap/m/BusyDialog";
|
|
4
5
|
import { Logger } from "../../../utils/Logger";
|
|
5
6
|
|
|
6
7
|
export interface IHostDialog {
|
|
7
|
-
generate(): void;
|
|
8
|
+
generate(): Promise<void> | void;
|
|
8
9
|
triggerSubmit(): boolean;
|
|
9
10
|
fireEvent(eventName: string, parameters?: Record<string, unknown>): this;
|
|
10
11
|
}
|
|
@@ -16,6 +17,7 @@ export class DialogDelegate {
|
|
|
16
17
|
private host: IHostDialog & Control;
|
|
17
18
|
private activeDialog: Dialog | null = null;
|
|
18
19
|
private requestedWidth: string = "auto";
|
|
20
|
+
private calculatedOptimalWidth: string = "auto";
|
|
19
21
|
|
|
20
22
|
/**
|
|
21
23
|
* Initializes a new DialogDelegate to handle dialog-based rendering.
|
|
@@ -29,14 +31,34 @@ export class DialogDelegate {
|
|
|
29
31
|
* Dialog Modality: Opens the generated layout inside a sap.m.Dialog.
|
|
30
32
|
* Automatically wires up customizable submit (default: 'OK') and 'Cancel' buttons.
|
|
31
33
|
*/
|
|
32
|
-
public openInDialog(title: string = "Form", submitButtonText: string = "OK", isGenerated: boolean, cancelButtonText: string = "Cancel", dialogWidth: string = "auto", parentView?: Control): void {
|
|
33
|
-
// UI5 PURITY: Do not manually force generate() here.
|
|
34
|
-
// Opening the dialog mounts the host, natively firing onBeforeRendering() which triggers generation cleanly.
|
|
35
|
-
|
|
34
|
+
public async openInDialog(title: string = "Form", submitButtonText: string = "OK", isGenerated: boolean, cancelButtonText: string = "Cancel", dialogWidth: string = "auto", parentView?: Control): Promise<void> {
|
|
36
35
|
this.requestedWidth = dialogWidth;
|
|
36
|
+
this.calculatedOptimalWidth = dialogWidth; // Default fallback
|
|
37
|
+
|
|
38
|
+
// Mask the complex asynchronous rendering to prevent visual snapping
|
|
39
|
+
const busyDialog = new BusyDialog({ text: "Building Form..." });
|
|
40
|
+
busyDialog.open();
|
|
41
|
+
|
|
42
|
+
try {
|
|
43
|
+
// Force manual generation BEFORE mounting the dialog so the optimal width is perfectly calculated first
|
|
44
|
+
const genResult = this.host.generate();
|
|
45
|
+
if (genResult instanceof Promise) {
|
|
46
|
+
await genResult;
|
|
47
|
+
}
|
|
48
|
+
} catch (err) {
|
|
49
|
+
busyDialog.close();
|
|
50
|
+
Logger.error("[MetaUI] Catastrophic error during pre-generation of dialog content", (err as Error).message, "DialogDelegate");
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
busyDialog.close();
|
|
55
|
+
|
|
56
|
+
// The Engine heuristically updated `calculatedOptimalWidth` during `generate()`. Apply it on frame 1.
|
|
57
|
+
const finalWidth = this.requestedWidth === "auto" && this.calculatedOptimalWidth !== "auto" ? this.calculatedOptimalWidth : this.requestedWidth;
|
|
58
|
+
|
|
37
59
|
const dialog = new Dialog({
|
|
38
60
|
title: title,
|
|
39
|
-
contentWidth:
|
|
61
|
+
contentWidth: finalWidth,
|
|
40
62
|
content: [this.host], // Mount host inside the dialog
|
|
41
63
|
beginButton: new Button({
|
|
42
64
|
text: submitButtonText,
|
|
@@ -79,6 +101,8 @@ export class DialogDelegate {
|
|
|
79
101
|
* Allows the Engine to retroactively expand the dialog once the schema is fully parsed.
|
|
80
102
|
*/
|
|
81
103
|
public updateDialogWidthDynamically(optimalWidth: string): void {
|
|
104
|
+
this.calculatedOptimalWidth = optimalWidth;
|
|
105
|
+
// Only dynamically stretch if the dialog is ALREADY open (e.g., hybrid inference late-loading)
|
|
82
106
|
if (this.activeDialog && this.requestedWidth === "auto" && optimalWidth !== "auto") {
|
|
83
107
|
this.activeDialog.setContentWidth(optimalWidth);
|
|
84
108
|
}
|
|
@@ -27,6 +27,7 @@ sap.ui.define(["../utils/Logger"], function (___utils_Logger) {
|
|
|
27
27
|
this.registerPluginPath("string", "time", "nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin");
|
|
28
28
|
this.registerPluginPath("string", "datetime", "nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin");
|
|
29
29
|
this.registerPluginPath("boolean", "switch", "nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin");
|
|
30
|
+
this.registerPluginPath("number", "step", "nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin");
|
|
30
31
|
this.registerPluginPath("string", "select", "nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin");
|
|
31
32
|
this.registerPluginPath("string", "textArea", "nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin");
|
|
32
33
|
this.registerPluginPath("string", "codeEditor", "nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginRegistry-dbg.js","names":["Logger","___utils_Logger","PluginRegistry","fieldIndex","actionIndex","layoutIndex","activePromises","constructor","registerPluginPath","undefined","registerLayoutPath","getInstance","instance","type","widgetName","path","key","registerActionPath","actionName","strategy","getFieldPath","Error","getLayoutPath","getPathsToLoad","schema","pathsToLoad","Set","layoutStrategy","add","scanProperties","props","prop","ui","widget","e","msg","message","error","properties","items","preloadDependencies","promises","Array","from","map","Promise","resolve","reject","sap","require","Module","err","all","extractConstructor","default","keys","Object","getPlugin","PluginClass","getLayout","LayoutClass","__exports","__esModule"],"sources":["PluginRegistry.ts"],"sourcesContent":["/**\n * @file PluginRegistry.ts\n * @description Centralized hub for mapping UI5 controls to SAP schema data types.\n * Enforces the Registry Pattern to decouple the core engine from specific UI5 control implementations.\n * NOW WITH UNIVERSAL LAZY LOADING.\n */\n\nimport { IPlugin } from \"../interfaces/IPlugin\";\nimport { FieldType, ISchema, IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { Logger } from \"../utils/Logger\";\nimport { DefaultLayoutGenerator } from \"./DefaultLayoutGenerator\";\n\nexport class PluginRegistry {\n private static instance: PluginRegistry;\n \n private fieldIndex: Record<string, string> = {};\n private actionIndex: Record<string, string> = {};\n private layoutIndex: Record<string, string> = {};\n \n private activePromises: Record<string, Promise<unknown>> = {};\n\n private constructor() {\n // Core Mappings\n this.registerPluginPath(\"string\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin\");\n this.registerPluginPath(\"number\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin\");\n this.registerPluginPath(\"integer\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin\");\n this.registerPluginPath(\"date\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin\");\n this.registerPluginPath(\"boolean\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin\");\n this.registerPluginPath(\"array\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin\");\n this.registerPluginPath(\"object\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin\");\n\n // Widget Overrides\n this.registerPluginPath(\"string\", \"time\", \"nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin\");\n this.registerPluginPath(\"string\", \"datetime\", \"nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin\");\n this.registerPluginPath(\"boolean\", \"switch\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin\");\n this.registerPluginPath(\"string\", \"select\", \"nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin\");\n this.registerPluginPath(\"string\", \"textArea\", \"nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin\");\n this.registerPluginPath(\"string\", \"codeEditor\", \"nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin\");\n \n // Phase 1 Mappings\n this.registerPluginPath(\"string\", \"fileUploader\", \"nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin\");\n this.registerPluginPath(\"array\", \"multiSelect\", \"nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin\");\n this.registerPluginPath(\"array\", \"multiInput\", \"nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin\");\n this.registerPluginPath(\"number\", \"slider\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin\");\n this.registerPluginPath(\"number\", \"rating\", \"nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin\");\n this.registerPluginPath(\"string\", \"messageStrip\", \"nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin\");\n\n // Phase 5 Mappings (Hardware)\n this.registerPluginPath(\"string\", \"camera\", \"nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin\");\n this.registerPluginPath(\"string\", \"signature\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin\");\n this.registerPluginPath(\"object\", \"location\", \"nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin\");\n this.registerPluginPath(\"string\", \"scanner\", \"nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin\");\n this.registerPluginPath(\"string\", \"voiceInput\", \"nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin\");\n this.registerPluginPath(\"string\", \"richText\", \"nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin\");\n\n // Actions & Datasources\n this.registerPluginPath(\"string\", \"urlButton\", \"nz/co/siliconst/ui5/metaui/plugins/actions/UrlNavigationActionPlugin\");\n this.registerPluginPath(\"string\", \"submitButton\", \"nz/co/siliconst/ui5/metaui/plugins/actions/SubmitFormActionPlugin\");\n this.registerPluginPath(\"string\", \"odataSelect\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/ODataListBindingPlugin\");\n this.registerPluginPath(\"string\", \"remoteDropdown\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin\");\n this.registerPluginPath(\"string\", \"liveSearch\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin\");\n this.registerPluginPath(\"string\", \"remoteValueHelp\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin\");\n\n // Layouts\n this.registerLayoutPath(\"form\", \"nz/co/siliconst/ui5/metaui/layouts/FormLayout\");\n this.registerLayoutPath(\"table\", \"nz/co/siliconst/ui5/metaui/layouts/TableLayout\");\n this.registerLayoutPath(\"wizard\", \"nz/co/siliconst/ui5/metaui/layouts/WizardLayout\");\n this.registerLayoutPath(\"compact\", \"nz/co/siliconst/ui5/metaui/layouts/CompactLayout\");\n }\n\n public static getInstance(): PluginRegistry {\n if (!PluginRegistry.instance) {\n PluginRegistry.instance = new PluginRegistry();\n }\n return PluginRegistry.instance;\n }\n\n public registerPluginPath(type: FieldType, widgetName: string | undefined, path: string): void {\n const key = widgetName ? `${type}:${widgetName}` : type;\n this.fieldIndex[key] = path;\n }\n\n public registerActionPath(actionName: string, path: string): void {\n this.actionIndex[actionName] = path;\n }\n\n public registerLayoutPath(strategy: string, path: string): void {\n this.layoutIndex[strategy] = path;\n }\n\n private getFieldPath(type: FieldType, widgetName?: string): string {\n let path;\n if (widgetName) {\n path = this.fieldIndex[`${type}:${widgetName}`];\n }\n if (!path) {\n path = this.fieldIndex[type];\n }\n if (!path) {\n throw new Error(`No plugin path mapped for FieldType: ${type} (widget: ${widgetName})`);\n }\n return path;\n }\n\n private getLayoutPath(strategy: string): string {\n const path = this.layoutIndex[strategy];\n if (!path) {\n throw new Error(`No layout path mapped for strategy: ${strategy}`);\n }\n return path;\n }\n\n /**\n * Statically traverses the schema structure to identify all required plugins\n * and layouts without actually instantiating them.\n * \n * @param {ISchema} schema The root JSON schema payload to traverse\n * @returns {Set<string>} A distinct set of UI5 module paths required to render the schema\n */\n public getPathsToLoad(schema: ISchema): Set<string> {\n const pathsToLoad = new Set<string>();\n \n // 1. Gather layout strategy\n const strategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n pathsToLoad.add(this.getLayoutPath(strategy));\n\n // 2. Recursively gather field plugins\n const scanProperties = (props: Record<string, IPropertyMetadata>) => {\n for (const key in props) {\n const prop = props[key];\n try {\n pathsToLoad.add(this.getFieldPath(prop.type || \"string\", prop.ui?.widget));\n } catch (e) {\n const msg = `[MetaUI LazyLoad] Could not find mapped plugin for field ${key}: ${(e as Error).message}`;\n Logger.error(msg);\n throw new Error(msg);\n }\n if (prop.properties) scanProperties(prop.properties);\n if (prop.items && prop.items.properties) scanProperties(prop.items.properties);\n if (prop.items && prop.items.type) {\n try {\n pathsToLoad.add(this.getFieldPath(prop.items.type, prop.items.ui?.widget));\n } catch (e) {\n const msg = `[MetaUI LazyLoad] Could not find mapped plugin for array item type ${prop.items.type}: ${(e as Error).message}`;\n Logger.error(msg);\n throw new Error(msg);\n }\n }\n }\n };\n\n if (schema.properties) {\n scanProperties(schema.properties);\n } else if (schema.items && schema.items.properties) {\n scanProperties(schema.items.properties);\n }\n\n return pathsToLoad;\n }\n\n /**\n * Defers the generation of the UI until all required UI5 modules have been\n * downloaded asynchronously. Maintains a cache of active promises to prevent\n * redundant network requests for the same module.\n * \n * @param {ISchema} schema The root JSON schema payload to parse\n * @returns {Promise<void>} Resolves when all dependencies are securely in the UI5 require cache\n */\n public async preloadDependencies(schema: ISchema): Promise<void> {\n const pathsToLoad = this.getPathsToLoad(schema);\n\n // 3. Batch execute sap.ui.require via Promises\n const promises = Array.from(pathsToLoad).map(path => {\n if (!this.activePromises[path]) {\n this.activePromises[path] = new Promise((resolve, reject) => {\n sap.ui.require([path], \n (Module: unknown) => resolve(Module), \n (err: unknown) => {\n Logger.error(`Failed to lazy load module: ${path}`);\n // CRITICAL: Delete from cache so future attempts can retry the network request\n delete this.activePromises[path];\n reject(err);\n }\n );\n });\n }\n return this.activePromises[path];\n });\n\n await Promise.all(promises);\n }\n\n /**\n * Extracts a valid constructor from a dynamically required module.\n */\n private extractConstructor(Module: unknown): new () => IPlugin | ILayoutManager | null {\n if (!Module) return null;\n if (typeof Module === \"function\") return Module as any;\n if ((Module as any).default && typeof (Module as any).default === \"function\") return (Module as any).default;\n \n // Handle namespace exports (e.g. { FormLayout: class... })\n const keys = Object.keys(Module as object);\n for (const key of keys) {\n if (typeof (Module as any)[key] === \"function\") {\n return (Module as any)[key];\n }\n }\n return null;\n }\n\n /**\n * Instantiates the requested plugin for the given field type.\n */\n public getPlugin(type: FieldType, widgetName?: string): IPlugin {\n const path = this.getFieldPath(type, widgetName);\n const Module = sap.ui.require(path);\n const PluginClass = this.extractConstructor(Module);\n \n if (!PluginClass) {\n throw new Error(`[MetaUI Plugin Instantiation] Plugin ${path} was not preloaded or has no constructor!`);\n }\n \n return new PluginClass();\n }\n\n /**\n * Instantiates the requested layout manager for the given strategy.\n */\n public getLayout(strategy: string): ILayoutManager {\n const path = this.getLayoutPath(strategy);\n const Module = sap.ui.require(path);\n const LayoutClass = this.extractConstructor(Module);\n \n if (!LayoutClass) {\n throw new Error(`[MetaUI Layout Instantiation] Layout ${path} was not preloaded or has no constructor!`);\n }\n \n return new LayoutClass();\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;AACA;AACA;EALA,MAUSA,MAAM,GAAAC,eAAA;EAGR,MAAMC,cAAc,CAAC;IAGhBC,UAAU,GAA2B,CAAC,CAAC;IACvCC,WAAW,GAA2B,CAAC,CAAC;IACxCC,WAAW,GAA2B,CAAC,CAAC;IAExCC,cAAc,GAAqC,CAAC,CAAC;IAErDC,WAAWA,CAAA,EAAG;MAClB;MACA,IAAI,CAACC,kBAAkB,CAAC,QAAQ,EAAEC,SAAS,EAAE,0DAA0D,CA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AAQ,CAAC;MACzC,MAAM+B,MAAM,GAAGF,GAAG,CAAChB,EAAE,CAACiB,OAAO,CAAClC,IAAI,CAAC;MACnC,MAAM6C,WAAW,GAAG,IAAI,CAACP,kBAAkB,CAACH,MAAM,CAAC;MAEnD,IAAI,CAACU,WAAW,EAAE;QACd,MAAM,IAAIvC,KAAK,CAAC,wCAAwCN,IAAI,2CAA2C,CAAC;MAC5G;MAEA,OAAO,IAAI6C,WAAW,CAAC,CAAC;IAC5B;EACJ;EAAC,IAAAC,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAA3D,cAAA,GAAAA,cAAA;EAAA,OAAA2D,SAAA;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"PluginRegistry-dbg.js","names":["Logger","___utils_Logger","PluginRegistry","fieldIndex","actionIndex","layoutIndex","activePromises","constructor","registerPluginPath","undefined","registerLayoutPath","getInstance","instance","type","widgetName","path","key","registerActionPath","actionName","strategy","getFieldPath","Error","getLayoutPath","getPathsToLoad","schema","pathsToLoad","Set","layoutStrategy","add","scanProperties","props","prop","ui","widget","e","msg","message","error","properties","items","preloadDependencies","promises","Array","from","map","Promise","resolve","reject","sap","require","Module","err","all","extractConstructor","default","keys","Object","getPlugin","PluginClass","getLayout","LayoutClass","__exports","__esModule"],"sources":["PluginRegistry.ts"],"sourcesContent":["/**\n * @file PluginRegistry.ts\n * @description Centralized hub for mapping UI5 controls to SAP schema data types.\n * Enforces the Registry Pattern to decouple the core engine from specific UI5 control implementations.\n * NOW WITH UNIVERSAL LAZY LOADING.\n */\n\nimport { IPlugin } from \"../interfaces/IPlugin\";\nimport { FieldType, ISchema, IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { Logger } from \"../utils/Logger\";\nimport { DefaultLayoutGenerator } from \"./DefaultLayoutGenerator\";\n\nexport class PluginRegistry {\n private static instance: PluginRegistry;\n \n private fieldIndex: Record<string, string> = {};\n private actionIndex: Record<string, string> = {};\n private layoutIndex: Record<string, string> = {};\n \n private activePromises: Record<string, Promise<unknown>> = {};\n\n private constructor() {\n // Core Mappings\n this.registerPluginPath(\"string\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin\");\n this.registerPluginPath(\"number\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin\");\n this.registerPluginPath(\"integer\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin\");\n this.registerPluginPath(\"date\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin\");\n this.registerPluginPath(\"boolean\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin\");\n this.registerPluginPath(\"array\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin\");\n this.registerPluginPath(\"object\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin\");\n\n // Widget Overrides\n this.registerPluginPath(\"string\", \"time\", \"nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin\");\n this.registerPluginPath(\"string\", \"datetime\", \"nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin\");\n this.registerPluginPath(\"boolean\", \"switch\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin\");\n this.registerPluginPath(\"number\", \"step\", \"nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin\");\n this.registerPluginPath(\"string\", \"select\", \"nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin\");\n this.registerPluginPath(\"string\", \"textArea\", \"nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin\");\n this.registerPluginPath(\"string\", \"codeEditor\", \"nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin\");\n \n // Phase 1 Mappings\n this.registerPluginPath(\"string\", \"fileUploader\", \"nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin\");\n this.registerPluginPath(\"array\", \"multiSelect\", \"nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin\");\n this.registerPluginPath(\"array\", \"multiInput\", \"nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin\");\n this.registerPluginPath(\"number\", \"slider\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin\");\n this.registerPluginPath(\"number\", \"rating\", \"nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin\");\n this.registerPluginPath(\"string\", \"messageStrip\", \"nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin\");\n\n // Phase 5 Mappings (Hardware)\n this.registerPluginPath(\"string\", \"camera\", \"nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin\");\n this.registerPluginPath(\"string\", \"signature\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin\");\n this.registerPluginPath(\"object\", \"location\", \"nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin\");\n this.registerPluginPath(\"string\", \"scanner\", \"nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin\");\n this.registerPluginPath(\"string\", \"voiceInput\", \"nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin\");\n this.registerPluginPath(\"string\", \"richText\", \"nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin\");\n\n // Actions & Datasources\n this.registerPluginPath(\"string\", \"urlButton\", \"nz/co/siliconst/ui5/metaui/plugins/actions/UrlNavigationActionPlugin\");\n this.registerPluginPath(\"string\", \"submitButton\", \"nz/co/siliconst/ui5/metaui/plugins/actions/SubmitFormActionPlugin\");\n this.registerPluginPath(\"string\", \"odataSelect\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/ODataListBindingPlugin\");\n this.registerPluginPath(\"string\", \"remoteDropdown\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin\");\n this.registerPluginPath(\"string\", \"liveSearch\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin\");\n this.registerPluginPath(\"string\", \"remoteValueHelp\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin\");\n\n // Layouts\n this.registerLayoutPath(\"form\", \"nz/co/siliconst/ui5/metaui/layouts/FormLayout\");\n this.registerLayoutPath(\"table\", \"nz/co/siliconst/ui5/metaui/layouts/TableLayout\");\n this.registerLayoutPath(\"wizard\", \"nz/co/siliconst/ui5/metaui/layouts/WizardLayout\");\n this.registerLayoutPath(\"compact\", \"nz/co/siliconst/ui5/metaui/layouts/CompactLayout\");\n }\n\n public static getInstance(): PluginRegistry {\n if (!PluginRegistry.instance) {\n PluginRegistry.instance = new PluginRegistry();\n }\n return PluginRegistry.instance;\n }\n\n public registerPluginPath(type: FieldType, widgetName: string | undefined, path: string): void {\n const key = widgetName ? `${type}:${widgetName}` : type;\n this.fieldIndex[key] = path;\n }\n\n public registerActionPath(actionName: string, path: string): void {\n this.actionIndex[actionName] = path;\n }\n\n public registerLayoutPath(strategy: string, path: string): void {\n this.layoutIndex[strategy] = path;\n }\n\n private getFieldPath(type: FieldType, widgetName?: string): string {\n let path;\n if (widgetName) {\n path = this.fieldIndex[`${type}:${widgetName}`];\n }\n if (!path) {\n path = this.fieldIndex[type];\n }\n if (!path) {\n throw new Error(`No plugin path mapped for FieldType: ${type} (widget: ${widgetName})`);\n }\n return path;\n }\n\n private getLayoutPath(strategy: string): string {\n const path = this.layoutIndex[strategy];\n if (!path) {\n throw new Error(`No layout path mapped for strategy: ${strategy}`);\n }\n return path;\n }\n\n /**\n * Statically traverses the schema structure to identify all required plugins\n * and layouts without actually instantiating them.\n * \n * @param {ISchema} schema The root JSON schema payload to traverse\n * @returns {Set<string>} A distinct set of UI5 module paths required to render the schema\n */\n public getPathsToLoad(schema: ISchema): Set<string> {\n const pathsToLoad = new Set<string>();\n \n // 1. Gather layout strategy\n const strategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n pathsToLoad.add(this.getLayoutPath(strategy));\n\n // 2. Recursively gather field plugins\n const scanProperties = (props: Record<string, IPropertyMetadata>) => {\n for (const key in props) {\n const prop = props[key];\n try {\n pathsToLoad.add(this.getFieldPath(prop.type || \"string\", prop.ui?.widget));\n } catch (e) {\n const msg = `[MetaUI LazyLoad] Could not find mapped plugin for field ${key}: ${(e as Error).message}`;\n Logger.error(msg);\n throw new Error(msg);\n }\n if (prop.properties) scanProperties(prop.properties);\n if (prop.items && prop.items.properties) scanProperties(prop.items.properties);\n if (prop.items && prop.items.type) {\n try {\n pathsToLoad.add(this.getFieldPath(prop.items.type, prop.items.ui?.widget));\n } catch (e) {\n const msg = `[MetaUI LazyLoad] Could not find mapped plugin for array item type ${prop.items.type}: ${(e as Error).message}`;\n Logger.error(msg);\n throw new Error(msg);\n }\n }\n }\n };\n\n if (schema.properties) {\n scanProperties(schema.properties);\n } else if (schema.items && schema.items.properties) {\n scanProperties(schema.items.properties);\n }\n\n return pathsToLoad;\n }\n\n /**\n * Defers the generation of the UI until all required UI5 modules have been\n * downloaded asynchronously. Maintains a cache of active promises to prevent\n * redundant network requests for the same module.\n * \n * @param {ISchema} schema The root JSON schema payload to parse\n * @returns {Promise<void>} Resolves when all dependencies are securely in the UI5 require cache\n */\n public async preloadDependencies(schema: ISchema): Promise<void> {\n const pathsToLoad = this.getPathsToLoad(schema);\n\n // 3. Batch execute sap.ui.require via Promises\n const promises = Array.from(pathsToLoad).map(path => {\n if (!this.activePromises[path]) {\n this.activePromises[path] = new Promise((resolve, reject) => {\n sap.ui.require([path], \n (Module: unknown) => resolve(Module), \n (err: unknown) => {\n Logger.error(`Failed to lazy load module: ${path}`);\n // CRITICAL: Delete from cache so future attempts can retry the network request\n delete this.activePromises[path];\n reject(err);\n }\n );\n });\n }\n return this.activePromises[path];\n });\n\n await Promise.all(promises);\n }\n\n /**\n * Extracts a valid constructor from a dynamically required module.\n */\n private extractConstructor(Module: unknown): new () => IPlugin | ILayoutManager | null {\n if (!Module) return null;\n if (typeof Module === \"function\") return Module as any;\n if ((Module as any).default && typeof (Module as any).default === \"function\") return (Module as any).default;\n \n // Handle namespace exports (e.g. { FormLayout: class... })\n const keys = Object.keys(Module as object);\n for (const key of keys) {\n if (typeof (Module as any)[key] === \"function\") {\n return (Module as any)[key];\n }\n }\n return null;\n }\n\n /**\n * Instantiates the requested plugin for the given field type.\n */\n public getPlugin(type: FieldType, widgetName?: string): IPlugin {\n const path = this.getFieldPath(type, widgetName);\n const Module = sap.ui.require(path);\n const PluginClass = this.extractConstructor(Module);\n \n if (!PluginClass) {\n throw new Error(`[MetaUI Plugin Instantiation] Plugin ${path} was not preloaded or has no constructor!`);\n }\n \n return new PluginClass();\n }\n\n /**\n * Instantiates the requested layout manager for the given strategy.\n */\n public getLayout(strategy: string): ILayoutManager {\n const path = this.getLayoutPath(strategy);\n const Module = sap.ui.require(path);\n const LayoutClass = this.extractConstructor(Module);\n \n if (!LayoutClass) {\n throw new Error(`[MetaUI Layout Instantiation] Layout ${path} was not preloaded or has no constructor!`);\n }\n \n return new LayoutClass();\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;AACA;AACA;EALA,MAUSA,MAAM,GAAAC,eAAA;EAGR,MAAMC,cAAc,CAAC;IAGhBC,UAAU,GAA2B,CAAC,CAAC;IACvCC,WAAW,GAA2B,CAAC,CAAC;IACxCC,WAAW,GAA2B,CAAC,CAAC;IAExCC,cAAc,GAAqC,CAAC,CAAC;IAErDC,WAAWA,CAAA,EAAG;MAClB;MACA,IAAI,CAACC,kBAAkB,CAAC,QAAQ,EAAEC,SAAS,EAAE,0DAA0D,CAAC;MACxG,IAAI,CAACD,kBAAkB,CAAC,QAAQ,EAAEC,SAAS,EAAE,0DAA0D,CAAC;MACxG,IAAI,CAACD,kBAAkB,CAAC,SAAS,EAAEC,SAAS,EAAE,0DAA0D,CAAC;MACzG,IAAI,CAACD,kBAAkB,CAAC,MAAM,EAAEC,SAAS,EAAE,wDAAwD,CAAC;MACpG,IAAI,CAACD,kBAAkB,CAAC,SAAS,E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ACd,MAAM,IAAIvC,KAAK,CAAC,wCAAwCN,IAAI,2CAA2C,CAAC;MAC5G;MAEA,OAAO,IAAI6C,WAAW,CAAC,CAAC;IAC5B;EACJ;EAAC,IAAAC,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAA3D,cAAA,GAAAA,cAAA;EAAA,OAAA2D,SAAA;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginRegistry.d.ts","sourceRoot":"../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,gDAAgD,CAAC;IAChE;;;;;OAKG;IAEH,OAAO,EAAE,OAAO,EAAE,MAAM,+CAA+C,CAAC;IACxE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAqB,MAAM,+CAA+C,CAAC;IACtG,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;IAItF,MAAa,cAAc;QACvB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAiB;QAExC,OAAO,CAAC,UAAU,CAA8B;QAChD,OAAO,CAAC,WAAW,CAA8B;QACjD,OAAO,CAAC,WAAW,CAA8B;QAEjD,OAAO,CAAC,cAAc,CAAwC;QAE9D,OAAO;
|
|
1
|
+
{"version":3,"file":"PluginRegistry.d.ts","sourceRoot":"../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,gDAAgD,CAAC;IAChE;;;;;OAKG;IAEH,OAAO,EAAE,OAAO,EAAE,MAAM,+CAA+C,CAAC;IACxE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAqB,MAAM,+CAA+C,CAAC;IACtG,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;IAItF,MAAa,cAAc;QACvB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAiB;QAExC,OAAO,CAAC,UAAU,CAA8B;QAChD,OAAO,CAAC,WAAW,CAA8B;QACjD,OAAO,CAAC,WAAW,CAA8B;QAEjD,OAAO,CAAC,cAAc,CAAwC;QAE9D,OAAO;eAkDO,WAAW,IAAI,cAAc;QAOpC,kBAAkB,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;QAKvF,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;QAI1D,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;QAI/D,OAAO,CAAC,YAAY;QAcpB,OAAO,CAAC,aAAa;QAQrB;;;;;;WAMG;QACI,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC;QAyCnD;;;;;;;WAOG;QACU,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;QAwBhE;;WAEG;QACH,OAAO,CAAC,kBAAkB;QAe1B;;WAEG;QACI,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO;QAY/D;;WAEG;QACI,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc;KAWrD;CAEA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
sap.ui.define(["../utils/Logger"],function(i){"use strict";const t=i["Logger"];class e{fieldIndex={};actionIndex={};layoutIndex={};activePromises={};constructor(){this.registerPluginPath("string",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin");this.registerPluginPath("number",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin");this.registerPluginPath("integer",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin");this.registerPluginPath("date",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin");this.registerPluginPath("boolean",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin");this.registerPluginPath("array",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin");this.registerPluginPath("object",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin");this.registerPluginPath("string","time","nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin");this.registerPluginPath("string","datetime","nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin");this.registerPluginPath("boolean","switch","nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin");this.registerPluginPath("string","select","nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin");this.registerPluginPath("string","textArea","nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin");this.registerPluginPath("string","codeEditor","nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin");this.registerPluginPath("string","fileUploader","nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin");this.registerPluginPath("array","multiSelect","nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin");this.registerPluginPath("array","multiInput","nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin");this.registerPluginPath("number","slider","nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin");this.registerPluginPath("number","rating","nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin");this.registerPluginPath("string","messageStrip","nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin");this.registerPluginPath("string","camera","nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin");this.registerPluginPath("string","signature","nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin");this.registerPluginPath("object","location","nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin");this.registerPluginPath("string","scanner","nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin");this.registerPluginPath("string","voiceInput","nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin");this.registerPluginPath("string","richText","nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin");this.registerPluginPath("string","urlButton","nz/co/siliconst/ui5/metaui/plugins/actions/UrlNavigationActionPlugin");this.registerPluginPath("string","submitButton","nz/co/siliconst/ui5/metaui/plugins/actions/SubmitFormActionPlugin");this.registerPluginPath("string","odataSelect","nz/co/siliconst/ui5/metaui/plugins/datasources/ODataListBindingPlugin");this.registerPluginPath("string","remoteDropdown","nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin");this.registerPluginPath("string","liveSearch","nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin");this.registerPluginPath("string","remoteValueHelp","nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin");this.registerLayoutPath("form","nz/co/siliconst/ui5/metaui/layouts/FormLayout");this.registerLayoutPath("table","nz/co/siliconst/ui5/metaui/layouts/TableLayout");this.registerLayoutPath("wizard","nz/co/siliconst/ui5/metaui/layouts/WizardLayout");this.registerLayoutPath("compact","nz/co/siliconst/ui5/metaui/layouts/CompactLayout")}static getInstance(){if(!e.instance){e.instance=new e}return e.instance}registerPluginPath(i,t,e){const n=t?`${i}:${t}`:i;this.fieldIndex[n]=e}registerActionPath(i,t){this.actionIndex[i]=t}registerLayoutPath(i,t){this.layoutIndex[i]=t}getFieldPath(i,t){let e;if(t){e=this.fieldIndex[`${i}:${t}`]}if(!e){e=this.fieldIndex[i]}if(!e){throw new Error(`No plugin path mapped for FieldType: ${i} (widget: ${t})`)}return e}getLayoutPath(i){const t=this.layoutIndex[i];if(!t){throw new Error(`No layout path mapped for strategy: ${i}`)}return t}getPathsToLoad(i){const e=new Set;const n=i.layoutStrategy||(i.type==="array"?"table":"form");e.add(this.getLayoutPath(n));const s=i=>{for(const n in i){const r=i[n];try{e.add(this.getFieldPath(r.type||"string",r.ui?.widget))}catch(i){const e=`[MetaUI LazyLoad] Could not find mapped plugin for field ${n}: ${i.message}`;t.error(e);throw new Error(e)}if(r.properties)s(r.properties);if(r.items&&r.items.properties)s(r.items.properties);if(r.items&&r.items.type){try{e.add(this.getFieldPath(r.items.type,r.items.ui?.widget))}catch(i){const e=`[MetaUI LazyLoad] Could not find mapped plugin for array item type ${r.items.type}: ${i.message}`;t.error(e);throw new Error(e)}}}};if(i.properties){s(i.properties)}else if(i.items&&i.items.properties){s(i.items.properties)}return e}async preloadDependencies(i){const e=this.getPathsToLoad(i);const n=Array.from(e).map(i=>{if(!this.activePromises[i]){this.activePromises[i]=new Promise((e,n)=>{sap.ui.require([i],i=>e(i),e=>{t.error(`Failed to lazy load module: ${i}`);delete this.activePromises[i];n(e)})})}return this.activePromises[i]});await Promise.all(n)}extractConstructor(i){if(!i)return null;if(typeof i==="function")return i;if(i.default&&typeof i.default==="function")return i.default;const t=Object.keys(i);for(const e of t){if(typeof i[e]==="function"){return i[e]}}return null}getPlugin(i,t){const e=this.getFieldPath(i,t);const n=sap.ui.require(e);const s=this.extractConstructor(n);if(!s){throw new Error(`[MetaUI Plugin Instantiation] Plugin ${e} was not preloaded or has no constructor!`)}return new s}getLayout(i){const t=this.getLayoutPath(i);const e=sap.ui.require(t);const n=this.extractConstructor(e);if(!n){throw new Error(`[MetaUI Layout Instantiation] Layout ${t} was not preloaded or has no constructor!`)}return new n}}var n={__esModule:true};n.PluginRegistry=e;return n});
|
|
1
|
+
sap.ui.define(["../utils/Logger"],function(i){"use strict";const t=i["Logger"];class e{fieldIndex={};actionIndex={};layoutIndex={};activePromises={};constructor(){this.registerPluginPath("string",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin");this.registerPluginPath("number",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin");this.registerPluginPath("integer",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin");this.registerPluginPath("date",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin");this.registerPluginPath("boolean",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin");this.registerPluginPath("array",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin");this.registerPluginPath("object",undefined,"nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin");this.registerPluginPath("string","time","nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin");this.registerPluginPath("string","datetime","nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin");this.registerPluginPath("boolean","switch","nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin");this.registerPluginPath("number","step","nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin");this.registerPluginPath("string","select","nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin");this.registerPluginPath("string","textArea","nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin");this.registerPluginPath("string","codeEditor","nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin");this.registerPluginPath("string","fileUploader","nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin");this.registerPluginPath("array","multiSelect","nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin");this.registerPluginPath("array","multiInput","nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin");this.registerPluginPath("number","slider","nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin");this.registerPluginPath("number","rating","nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin");this.registerPluginPath("string","messageStrip","nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin");this.registerPluginPath("string","camera","nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin");this.registerPluginPath("string","signature","nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin");this.registerPluginPath("object","location","nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin");this.registerPluginPath("string","scanner","nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin");this.registerPluginPath("string","voiceInput","nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin");this.registerPluginPath("string","richText","nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin");this.registerPluginPath("string","urlButton","nz/co/siliconst/ui5/metaui/plugins/actions/UrlNavigationActionPlugin");this.registerPluginPath("string","submitButton","nz/co/siliconst/ui5/metaui/plugins/actions/SubmitFormActionPlugin");this.registerPluginPath("string","odataSelect","nz/co/siliconst/ui5/metaui/plugins/datasources/ODataListBindingPlugin");this.registerPluginPath("string","remoteDropdown","nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin");this.registerPluginPath("string","liveSearch","nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin");this.registerPluginPath("string","remoteValueHelp","nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin");this.registerLayoutPath("form","nz/co/siliconst/ui5/metaui/layouts/FormLayout");this.registerLayoutPath("table","nz/co/siliconst/ui5/metaui/layouts/TableLayout");this.registerLayoutPath("wizard","nz/co/siliconst/ui5/metaui/layouts/WizardLayout");this.registerLayoutPath("compact","nz/co/siliconst/ui5/metaui/layouts/CompactLayout")}static getInstance(){if(!e.instance){e.instance=new e}return e.instance}registerPluginPath(i,t,e){const n=t?`${i}:${t}`:i;this.fieldIndex[n]=e}registerActionPath(i,t){this.actionIndex[i]=t}registerLayoutPath(i,t){this.layoutIndex[i]=t}getFieldPath(i,t){let e;if(t){e=this.fieldIndex[`${i}:${t}`]}if(!e){e=this.fieldIndex[i]}if(!e){throw new Error(`No plugin path mapped for FieldType: ${i} (widget: ${t})`)}return e}getLayoutPath(i){const t=this.layoutIndex[i];if(!t){throw new Error(`No layout path mapped for strategy: ${i}`)}return t}getPathsToLoad(i){const e=new Set;const n=i.layoutStrategy||(i.type==="array"?"table":"form");e.add(this.getLayoutPath(n));const s=i=>{for(const n in i){const r=i[n];try{e.add(this.getFieldPath(r.type||"string",r.ui?.widget))}catch(i){const e=`[MetaUI LazyLoad] Could not find mapped plugin for field ${n}: ${i.message}`;t.error(e);throw new Error(e)}if(r.properties)s(r.properties);if(r.items&&r.items.properties)s(r.items.properties);if(r.items&&r.items.type){try{e.add(this.getFieldPath(r.items.type,r.items.ui?.widget))}catch(i){const e=`[MetaUI LazyLoad] Could not find mapped plugin for array item type ${r.items.type}: ${i.message}`;t.error(e);throw new Error(e)}}}};if(i.properties){s(i.properties)}else if(i.items&&i.items.properties){s(i.items.properties)}return e}async preloadDependencies(i){const e=this.getPathsToLoad(i);const n=Array.from(e).map(i=>{if(!this.activePromises[i]){this.activePromises[i]=new Promise((e,n)=>{sap.ui.require([i],i=>e(i),e=>{t.error(`Failed to lazy load module: ${i}`);delete this.activePromises[i];n(e)})})}return this.activePromises[i]});await Promise.all(n)}extractConstructor(i){if(!i)return null;if(typeof i==="function")return i;if(i.default&&typeof i.default==="function")return i.default;const t=Object.keys(i);for(const e of t){if(typeof i[e]==="function"){return i[e]}}return null}getPlugin(i,t){const e=this.getFieldPath(i,t);const n=sap.ui.require(e);const s=this.extractConstructor(n);if(!s){throw new Error(`[MetaUI Plugin Instantiation] Plugin ${e} was not preloaded or has no constructor!`)}return new s}getLayout(i){const t=this.getLayoutPath(i);const e=sap.ui.require(t);const n=this.extractConstructor(e);if(!n){throw new Error(`[MetaUI Layout Instantiation] Layout ${t} was not preloaded or has no constructor!`)}return new n}}var n={__esModule:true};n.PluginRegistry=e;return n});
|
|
2
2
|
//# sourceMappingURL=PluginRegistry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginRegistry.js","names":["Logger","___utils_Logger","PluginRegistry","fieldIndex","actionIndex","layoutIndex","activePromises","constructor","this","registerPluginPath","undefined","registerLayoutPath","getInstance","instance","type","widgetName","path","key","registerActionPath","actionName","strategy","getFieldPath","Error","getLayoutPath","getPathsToLoad","schema","pathsToLoad","Set","layoutStrategy","add","scanProperties","props","prop","ui","widget","e","msg","message","error","properties","items","preloadDependencies","promises","Array","from","map","Promise","resolve","reject","sap","require","Module","err","all","extractConstructor","default","keys","Object","getPlugin","PluginClass","getLayout","LayoutClass","__exports","__esModule"],"sources":["PluginRegistry.ts"],"sourcesContent":["/**\n * @file PluginRegistry.ts\n * @description Centralized hub for mapping UI5 controls to SAP schema data types.\n * Enforces the Registry Pattern to decouple the core engine from specific UI5 control implementations.\n * NOW WITH UNIVERSAL LAZY LOADING.\n */\n\nimport { IPlugin } from \"../interfaces/IPlugin\";\nimport { FieldType, ISchema, IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { Logger } from \"../utils/Logger\";\nimport { DefaultLayoutGenerator } from \"./DefaultLayoutGenerator\";\n\nexport class PluginRegistry {\n private static instance: PluginRegistry;\n \n private fieldIndex: Record<string, string> = {};\n private actionIndex: Record<string, string> = {};\n private layoutIndex: Record<string, string> = {};\n \n private activePromises: Record<string, Promise<unknown>> = {};\n\n private constructor() {\n // Core Mappings\n this.registerPluginPath(\"string\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin\");\n this.registerPluginPath(\"number\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin\");\n this.registerPluginPath(\"integer\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin\");\n this.registerPluginPath(\"date\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin\");\n this.registerPluginPath(\"boolean\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin\");\n this.registerPluginPath(\"array\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin\");\n this.registerPluginPath(\"object\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin\");\n\n // Widget Overrides\n this.registerPluginPath(\"string\", \"time\", \"nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin\");\n this.registerPluginPath(\"string\", \"datetime\", \"nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin\");\n this.registerPluginPath(\"boolean\", \"switch\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin\");\n this.registerPluginPath(\"string\", \"select\", \"nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin\");\n this.registerPluginPath(\"string\", \"textArea\", \"nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin\");\n this.registerPluginPath(\"string\", \"codeEditor\", \"nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin\");\n \n // Phase 1 Mappings\n this.registerPluginPath(\"string\", \"fileUploader\", \"nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin\");\n this.registerPluginPath(\"array\", \"multiSelect\", \"nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin\");\n this.registerPluginPath(\"array\", \"multiInput\", \"nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin\");\n this.registerPluginPath(\"number\", \"slider\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin\");\n this.registerPluginPath(\"number\", \"rating\", \"nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin\");\n this.registerPluginPath(\"string\", \"messageStrip\", \"nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin\");\n\n // Phase 5 Mappings (Hardware)\n this.registerPluginPath(\"string\", \"camera\", \"nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin\");\n this.registerPluginPath(\"string\", \"signature\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin\");\n this.registerPluginPath(\"object\", \"location\", \"nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin\");\n this.registerPluginPath(\"string\", \"scanner\", \"nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin\");\n this.registerPluginPath(\"string\", \"voiceInput\", \"nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin\");\n this.registerPluginPath(\"string\", \"richText\", \"nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin\");\n\n // Actions & Datasources\n this.registerPluginPath(\"string\", \"urlButton\", \"nz/co/siliconst/ui5/metaui/plugins/actions/UrlNavigationActionPlugin\");\n this.registerPluginPath(\"string\", \"submitButton\", \"nz/co/siliconst/ui5/metaui/plugins/actions/SubmitFormActionPlugin\");\n this.registerPluginPath(\"string\", \"odataSelect\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/ODataListBindingPlugin\");\n this.registerPluginPath(\"string\", \"remoteDropdown\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin\");\n this.registerPluginPath(\"string\", \"liveSearch\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin\");\n this.registerPluginPath(\"string\", \"remoteValueHelp\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin\");\n\n // Layouts\n this.registerLayoutPath(\"form\", \"nz/co/siliconst/ui5/metaui/layouts/FormLayout\");\n this.registerLayoutPath(\"table\", \"nz/co/siliconst/ui5/metaui/layouts/TableLayout\");\n this.registerLayoutPath(\"wizard\", \"nz/co/siliconst/ui5/metaui/layouts/WizardLayout\");\n this.registerLayoutPath(\"compact\", \"nz/co/siliconst/ui5/metaui/layouts/CompactLayout\");\n }\n\n public static getInstance(): PluginRegistry {\n if (!PluginRegistry.instance) {\n PluginRegistry.instance = new PluginRegistry();\n }\n return PluginRegistry.instance;\n }\n\n public registerPluginPath(type: FieldType, widgetName: string | undefined, path: string): void {\n const key = widgetName ? `${type}:${widgetName}` : type;\n this.fieldIndex[key] = path;\n }\n\n public registerActionPath(actionName: string, path: string): void {\n this.actionIndex[actionName] = path;\n }\n\n public registerLayoutPath(strategy: string, path: string): void {\n this.layoutIndex[strategy] = path;\n }\n\n private getFieldPath(type: FieldType, widgetName?: string): string {\n let path;\n if (widgetName) {\n path = this.fieldIndex[`${type}:${widgetName}`];\n }\n if (!path) {\n path = this.fieldIndex[type];\n }\n if (!path) {\n throw new Error(`No plugin path mapped for FieldType: ${type} (widget: ${widgetName})`);\n }\n return path;\n }\n\n private getLayoutPath(strategy: string): string {\n const path = this.layoutIndex[strategy];\n if (!path) {\n throw new Error(`No layout path mapped for strategy: ${strategy}`);\n }\n return path;\n }\n\n /**\n * Statically traverses the schema structure to identify all required plugins\n * and layouts without actually instantiating them.\n * \n * @param {ISchema} schema The root JSON schema payload to traverse\n * @returns {Set<string>} A distinct set of UI5 module paths required to render the schema\n */\n public getPathsToLoad(schema: ISchema): Set<string> {\n const pathsToLoad = new Set<string>();\n \n // 1. Gather layout strategy\n const strategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n pathsToLoad.add(this.getLayoutPath(strategy));\n\n // 2. Recursively gather field plugins\n const scanProperties = (props: Record<string, IPropertyMetadata>) => {\n for (const key in props) {\n const prop = props[key];\n try {\n pathsToLoad.add(this.getFieldPath(prop.type || \"string\", prop.ui?.widget));\n } catch (e) {\n const msg = `[MetaUI LazyLoad] Could not find mapped plugin for field ${key}: ${(e as Error).message}`;\n Logger.error(msg);\n throw new Error(msg);\n }\n if (prop.properties) scanProperties(prop.properties);\n if (prop.items && prop.items.properties) scanProperties(prop.items.properties);\n if (prop.items && prop.items.type) {\n try {\n pathsToLoad.add(this.getFieldPath(prop.items.type, prop.items.ui?.widget));\n } catch (e) {\n const msg = `[MetaUI LazyLoad] Could not find mapped plugin for array item type ${prop.items.type}: ${(e as Error).message}`;\n Logger.error(msg);\n throw new Error(msg);\n }\n }\n }\n };\n\n if (schema.properties) {\n scanProperties(schema.properties);\n } else if (schema.items && schema.items.properties) {\n scanProperties(schema.items.properties);\n }\n\n return pathsToLoad;\n }\n\n /**\n * Defers the generation of the UI until all required UI5 modules have been\n * downloaded asynchronously. Maintains a cache of active promises to prevent\n * redundant network requests for the same module.\n * \n * @param {ISchema} schema The root JSON schema payload to parse\n * @returns {Promise<void>} Resolves when all dependencies are securely in the UI5 require cache\n */\n public async preloadDependencies(schema: ISchema): Promise<void> {\n const pathsToLoad = this.getPathsToLoad(schema);\n\n // 3. Batch execute sap.ui.require via Promises\n const promises = Array.from(pathsToLoad).map(path => {\n if (!this.activePromises[path]) {\n this.activePromises[path] = new Promise((resolve, reject) => {\n sap.ui.require([path], \n (Module: unknown) => resolve(Module), \n (err: unknown) => {\n Logger.error(`Failed to lazy load module: ${path}`);\n // CRITICAL: Delete from cache so future attempts can retry the network request\n delete this.activePromises[path];\n reject(err);\n }\n );\n });\n }\n return this.activePromises[path];\n });\n\n await Promise.all(promises);\n }\n\n /**\n * Extracts a valid constructor from a dynamically required module.\n */\n private extractConstructor(Module: unknown): new () => IPlugin | ILayoutManager | null {\n if (!Module) return null;\n if (typeof Module === \"function\") return Module as any;\n if ((Module as any).default && typeof (Module as any).default === \"function\") return (Module as any).default;\n \n // Handle namespace exports (e.g. { FormLayout: class... })\n const keys = Object.keys(Module as object);\n for (const key of keys) {\n if (typeof (Module as any)[key] === \"function\") {\n return (Module as any)[key];\n }\n }\n return null;\n }\n\n /**\n * Instantiates the requested plugin for the given field type.\n */\n public getPlugin(type: FieldType, widgetName?: string): IPlugin {\n const path = this.getFieldPath(type, widgetName);\n const Module = sap.ui.require(path);\n const PluginClass = this.extractConstructor(Module);\n \n if (!PluginClass) {\n throw new Error(`[MetaUI Plugin Instantiation] Plugin ${path} was not preloaded or has no constructor!`);\n }\n \n return new PluginClass();\n }\n\n /**\n * Instantiates the requested layout manager for the given strategy.\n */\n public getLayout(strategy: string): ILayoutManager {\n const path = this.getLayoutPath(strategy);\n const Module = sap.ui.require(path);\n const LayoutClass = this.extractConstructor(Module);\n \n if (!LayoutClass) {\n throw new Error(`[MetaUI Layout Instantiation] Layout ${path} was not preloaded or has no constructor!`);\n }\n \n return new LayoutClass();\n }\n}\n"],"mappings":"2DAAA,MAUSA,EAAMC,EAAA,UAGR,MAAMC,EAGDC,WAAqC,CAAC,EACtCC,YAAsC,CAAC,EACvCC,YAAsC,CAAC,EAEvCC,eAAmD,CAAC,EAEpDC,cAEJC,KAAKC,mBAAmB,SAAUC,UAAW,4DAC7CF,KAAKC,mBAAmB,SAAUC,UAAW,4DAC7CF,KAAKC,mBAAmB,UAAWC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AGiB,QAAQlC,GAC9B,MAAM2C,EAAcnD,KAAK8C,mBAAmBH,GAE5C,IAAKQ,EAAa,CACd,MAAM,IAAIrC,MAAM,wCAAwCN,6CAC5D,CAEA,OAAO,IAAI2C,CACf,CAKOC,UAAUxC,GACb,MAAMJ,EAAOR,KAAKe,cAAcH,GAChC,MAAM+B,EAASF,IAAIhB,GAAGiB,QAAQlC,GAC9B,MAAM6C,EAAcrD,KAAK8C,mBAAmBH,GAE5C,IAAKU,EAAa,CACd,MAAM,IAAIvC,MAAM,wCAAwCN,6CAC5D,CAEA,OAAO,IAAI6C,CACf,EACH,IAAAC,EAAA,CAAAC,WAAA,MAAAD,EAAA5D,iBAAA,OAAA4D,CAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"PluginRegistry.js","names":["Logger","___utils_Logger","PluginRegistry","fieldIndex","actionIndex","layoutIndex","activePromises","constructor","this","registerPluginPath","undefined","registerLayoutPath","getInstance","instance","type","widgetName","path","key","registerActionPath","actionName","strategy","getFieldPath","Error","getLayoutPath","getPathsToLoad","schema","pathsToLoad","Set","layoutStrategy","add","scanProperties","props","prop","ui","widget","e","msg","message","error","properties","items","preloadDependencies","promises","Array","from","map","Promise","resolve","reject","sap","require","Module","err","all","extractConstructor","default","keys","Object","getPlugin","PluginClass","getLayout","LayoutClass","__exports","__esModule"],"sources":["PluginRegistry.ts"],"sourcesContent":["/**\n * @file PluginRegistry.ts\n * @description Centralized hub for mapping UI5 controls to SAP schema data types.\n * Enforces the Registry Pattern to decouple the core engine from specific UI5 control implementations.\n * NOW WITH UNIVERSAL LAZY LOADING.\n */\n\nimport { IPlugin } from \"../interfaces/IPlugin\";\nimport { FieldType, ISchema, IPropertyMetadata } from \"../interfaces/ISchema\";\nimport { ILayoutManager } from \"../interfaces/ILayoutManager\";\nimport { Logger } from \"../utils/Logger\";\nimport { DefaultLayoutGenerator } from \"./DefaultLayoutGenerator\";\n\nexport class PluginRegistry {\n private static instance: PluginRegistry;\n \n private fieldIndex: Record<string, string> = {};\n private actionIndex: Record<string, string> = {};\n private layoutIndex: Record<string, string> = {};\n \n private activePromises: Record<string, Promise<unknown>> = {};\n\n private constructor() {\n // Core Mappings\n this.registerPluginPath(\"string\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/StringPlugin\");\n this.registerPluginPath(\"number\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin\");\n this.registerPluginPath(\"integer\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin\");\n this.registerPluginPath(\"date\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin\");\n this.registerPluginPath(\"boolean\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin\");\n this.registerPluginPath(\"array\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/ArrayPlugin\");\n this.registerPluginPath(\"object\", undefined, \"nz/co/siliconst/ui5/metaui/plugins/controls/ObjectPlugin\");\n\n // Widget Overrides\n this.registerPluginPath(\"string\", \"time\", \"nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin\");\n this.registerPluginPath(\"string\", \"datetime\", \"nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin\");\n this.registerPluginPath(\"boolean\", \"switch\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin\");\n this.registerPluginPath(\"number\", \"step\", \"nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin\");\n this.registerPluginPath(\"string\", \"select\", \"nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin\");\n this.registerPluginPath(\"string\", \"textArea\", \"nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin\");\n this.registerPluginPath(\"string\", \"codeEditor\", \"nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin\");\n \n // Phase 1 Mappings\n this.registerPluginPath(\"string\", \"fileUploader\", \"nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin\");\n this.registerPluginPath(\"array\", \"multiSelect\", \"nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin\");\n this.registerPluginPath(\"array\", \"multiInput\", \"nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin\");\n this.registerPluginPath(\"number\", \"slider\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin\");\n this.registerPluginPath(\"number\", \"rating\", \"nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin\");\n this.registerPluginPath(\"string\", \"messageStrip\", \"nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin\");\n\n // Phase 5 Mappings (Hardware)\n this.registerPluginPath(\"string\", \"camera\", \"nz/co/siliconst/ui5/metaui/plugins/controls/CameraPlugin\");\n this.registerPluginPath(\"string\", \"signature\", \"nz/co/siliconst/ui5/metaui/plugins/controls/SignaturePlugin\");\n this.registerPluginPath(\"object\", \"location\", \"nz/co/siliconst/ui5/metaui/plugins/controls/GeolocationPlugin\");\n this.registerPluginPath(\"string\", \"scanner\", \"nz/co/siliconst/ui5/metaui/plugins/controls/BarcodeScannerPlugin\");\n this.registerPluginPath(\"string\", \"voiceInput\", \"nz/co/siliconst/ui5/metaui/plugins/controls/VoiceInputPlugin\");\n this.registerPluginPath(\"string\", \"richText\", \"nz/co/siliconst/ui5/metaui/plugins/controls/RichTextPlugin\");\n\n // Actions & Datasources\n this.registerPluginPath(\"string\", \"urlButton\", \"nz/co/siliconst/ui5/metaui/plugins/actions/UrlNavigationActionPlugin\");\n this.registerPluginPath(\"string\", \"submitButton\", \"nz/co/siliconst/ui5/metaui/plugins/actions/SubmitFormActionPlugin\");\n this.registerPluginPath(\"string\", \"odataSelect\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/ODataListBindingPlugin\");\n this.registerPluginPath(\"string\", \"remoteDropdown\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteDropdownPlugin\");\n this.registerPluginPath(\"string\", \"liveSearch\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/LiveSearchPlugin\");\n this.registerPluginPath(\"string\", \"remoteValueHelp\", \"nz/co/siliconst/ui5/metaui/plugins/datasources/RemoteValueHelpPlugin\");\n\n // Layouts\n this.registerLayoutPath(\"form\", \"nz/co/siliconst/ui5/metaui/layouts/FormLayout\");\n this.registerLayoutPath(\"table\", \"nz/co/siliconst/ui5/metaui/layouts/TableLayout\");\n this.registerLayoutPath(\"wizard\", \"nz/co/siliconst/ui5/metaui/layouts/WizardLayout\");\n this.registerLayoutPath(\"compact\", \"nz/co/siliconst/ui5/metaui/layouts/CompactLayout\");\n }\n\n public static getInstance(): PluginRegistry {\n if (!PluginRegistry.instance) {\n PluginRegistry.instance = new PluginRegistry();\n }\n return PluginRegistry.instance;\n }\n\n public registerPluginPath(type: FieldType, widgetName: string | undefined, path: string): void {\n const key = widgetName ? `${type}:${widgetName}` : type;\n this.fieldIndex[key] = path;\n }\n\n public registerActionPath(actionName: string, path: string): void {\n this.actionIndex[actionName] = path;\n }\n\n public registerLayoutPath(strategy: string, path: string): void {\n this.layoutIndex[strategy] = path;\n }\n\n private getFieldPath(type: FieldType, widgetName?: string): string {\n let path;\n if (widgetName) {\n path = this.fieldIndex[`${type}:${widgetName}`];\n }\n if (!path) {\n path = this.fieldIndex[type];\n }\n if (!path) {\n throw new Error(`No plugin path mapped for FieldType: ${type} (widget: ${widgetName})`);\n }\n return path;\n }\n\n private getLayoutPath(strategy: string): string {\n const path = this.layoutIndex[strategy];\n if (!path) {\n throw new Error(`No layout path mapped for strategy: ${strategy}`);\n }\n return path;\n }\n\n /**\n * Statically traverses the schema structure to identify all required plugins\n * and layouts without actually instantiating them.\n * \n * @param {ISchema} schema The root JSON schema payload to traverse\n * @returns {Set<string>} A distinct set of UI5 module paths required to render the schema\n */\n public getPathsToLoad(schema: ISchema): Set<string> {\n const pathsToLoad = new Set<string>();\n \n // 1. Gather layout strategy\n const strategy = schema.layoutStrategy || (schema.type === \"array\" ? \"table\" : \"form\");\n pathsToLoad.add(this.getLayoutPath(strategy));\n\n // 2. Recursively gather field plugins\n const scanProperties = (props: Record<string, IPropertyMetadata>) => {\n for (const key in props) {\n const prop = props[key];\n try {\n pathsToLoad.add(this.getFieldPath(prop.type || \"string\", prop.ui?.widget));\n } catch (e) {\n const msg = `[MetaUI LazyLoad] Could not find mapped plugin for field ${key}: ${(e as Error).message}`;\n Logger.error(msg);\n throw new Error(msg);\n }\n if (prop.properties) scanProperties(prop.properties);\n if (prop.items && prop.items.properties) scanProperties(prop.items.properties);\n if (prop.items && prop.items.type) {\n try {\n pathsToLoad.add(this.getFieldPath(prop.items.type, prop.items.ui?.widget));\n } catch (e) {\n const msg = `[MetaUI LazyLoad] Could not find mapped plugin for array item type ${prop.items.type}: ${(e as Error).message}`;\n Logger.error(msg);\n throw new Error(msg);\n }\n }\n }\n };\n\n if (schema.properties) {\n scanProperties(schema.properties);\n } else if (schema.items && schema.items.properties) {\n scanProperties(schema.items.properties);\n }\n\n return pathsToLoad;\n }\n\n /**\n * Defers the generation of the UI until all required UI5 modules have been\n * downloaded asynchronously. Maintains a cache of active promises to prevent\n * redundant network requests for the same module.\n * \n * @param {ISchema} schema The root JSON schema payload to parse\n * @returns {Promise<void>} Resolves when all dependencies are securely in the UI5 require cache\n */\n public async preloadDependencies(schema: ISchema): Promise<void> {\n const pathsToLoad = this.getPathsToLoad(schema);\n\n // 3. Batch execute sap.ui.require via Promises\n const promises = Array.from(pathsToLoad).map(path => {\n if (!this.activePromises[path]) {\n this.activePromises[path] = new Promise((resolve, reject) => {\n sap.ui.require([path], \n (Module: unknown) => resolve(Module), \n (err: unknown) => {\n Logger.error(`Failed to lazy load module: ${path}`);\n // CRITICAL: Delete from cache so future attempts can retry the network request\n delete this.activePromises[path];\n reject(err);\n }\n );\n });\n }\n return this.activePromises[path];\n });\n\n await Promise.all(promises);\n }\n\n /**\n * Extracts a valid constructor from a dynamically required module.\n */\n private extractConstructor(Module: unknown): new () => IPlugin | ILayoutManager | null {\n if (!Module) return null;\n if (typeof Module === \"function\") return Module as any;\n if ((Module as any).default && typeof (Module as any).default === \"function\") return (Module as any).default;\n \n // Handle namespace exports (e.g. { FormLayout: class... })\n const keys = Object.keys(Module as object);\n for (const key of keys) {\n if (typeof (Module as any)[key] === \"function\") {\n return (Module as any)[key];\n }\n }\n return null;\n }\n\n /**\n * Instantiates the requested plugin for the given field type.\n */\n public getPlugin(type: FieldType, widgetName?: string): IPlugin {\n const path = this.getFieldPath(type, widgetName);\n const Module = sap.ui.require(path);\n const PluginClass = this.extractConstructor(Module);\n \n if (!PluginClass) {\n throw new Error(`[MetaUI Plugin Instantiation] Plugin ${path} was not preloaded or has no constructor!`);\n }\n \n return new PluginClass();\n }\n\n /**\n * Instantiates the requested layout manager for the given strategy.\n */\n public getLayout(strategy: string): ILayoutManager {\n const path = this.getLayoutPath(strategy);\n const Module = sap.ui.require(path);\n const LayoutClass = this.extractConstructor(Module);\n \n if (!LayoutClass) {\n throw new Error(`[MetaUI Layout Instantiation] Layout ${path} was not preloaded or has no constructor!`);\n }\n \n return new LayoutClass();\n }\n}\n"],"mappings":"2DAAA,MAUSA,EAAMC,EAAA,UAGR,MAAMC,EAGDC,WAAqC,CAAC,EACtCC,YAAsC,CAAC,EACvCC,YAAsC,CAAC,EAEvCC,eAAmD,CAAC,EAEpDC,cAEJC,KAAKC,mBAAmB,SAAUC,UAAW,4DAC7CF,KAAKC,mBAAmB,SAAUC,UAAW,4DAC7CF,KAAKC,mBAAmB,UAAWC,UAAW,4DAC9CF,KAAKC,mBAAmB,OAAQC,UAAW,0DAC3CF,KAAKC,mBAAmB,UAAWC,UAAW,6DAC9CF,KAAKC,mBAAmB,QAASC,UAAW,2DAC5CF,KAAKC,mBAAmB,SAAUC,UAAW,4DAG7CF,KAAKC,mBAAmB,SAAU,OAAQ,0DAC1CD,KAAKC,mBAAmB,SAAU,WAAY,8DAC9CD,KAAKC,mBAAmB,UAAW,SAAU,4DAC7CD,KAAKC,mBAAmB,SAAU,OAAQ,+DAC1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AmBH,GAE5C,IAAKU,EAAa,CACd,MAAM,IAAIvC,MAAM,wCAAwCN,6CAC5D,CAEA,OAAO,IAAI6C,CACf,EACH,IAAAC,EAAA,CAAAC,WAAA,MAAAD,EAAA5D,iBAAA,OAAA4D,CAAA","ignoreList":[]}
|
|
@@ -34,6 +34,7 @@ export class PluginRegistry {
|
|
|
34
34
|
this.registerPluginPath("string", "time", "nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin");
|
|
35
35
|
this.registerPluginPath("string", "datetime", "nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin");
|
|
36
36
|
this.registerPluginPath("boolean", "switch", "nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin");
|
|
37
|
+
this.registerPluginPath("number", "step", "nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin");
|
|
37
38
|
this.registerPluginPath("string", "select", "nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin");
|
|
38
39
|
this.registerPluginPath("string", "textArea", "nz/co/siliconst/ui5/metaui/plugins/controls/TextAreaPlugin");
|
|
39
40
|
this.registerPluginPath("string", "codeEditor", "nz/co/siliconst/ui5/metaui/plugins/controls/CodeEditorPlugin");
|