@siliconst/metaui 1.4.44 → 1.4.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/package.json +1 -1
  2. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost-dbg.js +24 -0
  3. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost-dbg.js.map +1 -1
  4. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.d.ts +24 -0
  5. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.d.ts.map +1 -1
  6. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.js +1 -1
  7. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.js.map +1 -1
  8. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost.ts +15 -1
  9. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost-dbg.js +34 -0
  10. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost-dbg.js.map +1 -1
  11. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.d.ts +34 -0
  12. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.d.ts.map +1 -1
  13. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.js +1 -1
  14. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.js.map +1 -1
  15. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost.ts +25 -1
  16. package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js +31 -1
  17. package/src/nz/co/siliconst/ui5/metaui/core/Engine-dbg.js.map +1 -1
  18. package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts +2 -0
  19. package/src/nz/co/siliconst/ui5/metaui/core/Engine.d.ts.map +1 -1
  20. package/src/nz/co/siliconst/ui5/metaui/core/Engine.js +1 -1
  21. package/src/nz/co/siliconst/ui5/metaui/core/Engine.js.map +1 -1
  22. package/src/nz/co/siliconst/ui5/metaui/core/Engine.ts +38 -0
  23. package/src/nz/co/siliconst/ui5/metaui/core/StateManager-dbg.js.map +1 -1
  24. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.js.map +1 -1
  25. package/src/nz/co/siliconst/ui5/metaui/core/StateManager.ts +1 -1
  26. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin-dbg.js.map +1 -1
  27. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.d.ts +1 -0
  28. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.d.ts.map +1 -1
  29. package/src/nz/co/siliconst/ui5/metaui/interfaces/IPlugin.ts +1 -0
  30. package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout-dbg.js +327 -67
  31. package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout-dbg.js.map +1 -1
  32. package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout.d.ts +57 -15
  33. package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout.d.ts.map +1 -1
  34. package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout.js +1 -1
  35. package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout.js.map +1 -1
  36. package/src/nz/co/siliconst/ui5/metaui/layouts/WizardLayout.ts +375 -65
  37. package/src/nz/co/siliconst/ui5/metaui/library-preload.js +5 -5
  38. package/src/nz/co/siliconst/ui5/metaui/library-preload.js.map +1 -1
  39. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin-dbg.js +10 -15
  40. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin-dbg.js.map +1 -1
  41. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.d.ts +4 -0
  42. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.d.ts.map +1 -1
  43. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.js +1 -1
  44. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.js.map +1 -1
  45. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.ts +10 -15
@@ -56,6 +56,13 @@ sap.ui.define(["../../core/PipelineManager", "sap/ui/core/library", "../../utils
56
56
  this.isEditable = editable;
57
57
  }
58
58
 
59
+ /**
60
+ * Retrieves the human-readable label for the field from its metadata.
61
+ */
62
+ getFieldLabel() {
63
+ return this.metadata?.ui?.label || this.fieldKey;
64
+ }
65
+
59
66
  /**
60
67
  * Injects the global MessageManager context into the plugin.
61
68
  * @param useMessageManager True if the MessageManager is handling validation visual states.
@@ -299,13 +306,7 @@ sap.ui.define(["../../core/PipelineManager", "sap/ui/core/library", "../../utils
299
306
  ctrl.setEditable(!metadata.ui.readOnly);
300
307
  }
301
308
  if (metadata.ui?.visibleOn) {
302
- const ExpressionBuilder = sap.ui.require("nz/co/siliconst/ui5/metaui/utils/ExpressionBuilder")?.ExpressionBuilder;
303
- let expr = "";
304
- if (ExpressionBuilder) {
305
- expr = ExpressionBuilder.build(metadata.ui.visibleOn, this.fieldKey, modelName);
306
- } else {
307
- expr = `{= ${metadata.ui.visibleOn.replace(/\$root\./g, `${modelName}>/`).replace(/\./g, '/')} }`;
308
- }
309
+ const expr = `{= ${metadata.ui.visibleOn.replace(/\$root\./g, `${modelName}>/`).replace(/\./g, '/')} }`;
309
310
  control.bindProperty("visible", {
310
311
  parts: [{
311
312
  path: "meta>/"
@@ -315,17 +316,11 @@ sap.ui.define(["../../core/PipelineManager", "sap/ui/core/library", "../../utils
315
316
  control.bindProperty("visible", expr);
316
317
  }
317
318
  if (metadata.ui?.enabledOn && typeof ctrl.setEnabled === "function") {
318
- const ExpressionBuilder = sap.ui.require("nz/co/siliconst/ui5/metaui/utils/ExpressionBuilder")?.ExpressionBuilder;
319
- let expr = "";
320
- if (ExpressionBuilder) {
321
- expr = ExpressionBuilder.build(metadata.ui.enabledOn, this.fieldKey, modelName);
322
- } else {
323
- expr = `{= ${metadata.ui.enabledOn.replace(/\$root\./g, `${modelName}>/`).replace(/\./g, '/')} }`;
324
- }
319
+ const expr = `{= ${metadata.ui.enabledOn.replace(/\$root\./g, `${modelName}>/`).replace(/\./g, '/')} }`;
325
320
  control.bindProperty("enabled", expr);
326
321
  }
327
322
  if (metadata.ui?.controlProps) {
328
- console.error(`[DEBUG MetaUI] controlProps found for ${this.fieldKey}`, metadata.ui.controlProps);
323
+ Logger.debug(`[BasePlugin] controlProps found for ${this.fieldKey}: ` + JSON.stringify(metadata.ui.controlProps), "BasePlugin");
329
324
  const targetControl = this.mainControl || control;
330
325
  const target = targetControl;
331
326
  if (typeof target.getMetadata === "function") {
@@ -1 +1 @@
1
- {"version":3,"file":"BasePlugin-dbg.js","names":["GlobalPipeline","____core_PipelineManager","Logger","____utils_Logger","BasePlugin","control","BLOCKED_PROPS","metadata","fieldKey","modelName","isEditable","useMessageManager","policyInvalidMessage","setEditable","editable","setUseMessageManager","generateStableId","engineScopeId","bindingPath","undefined","safePath","replace","generateBindingInfo","typeInstance","additionalOptions","path","model","type","validate","isValid","getVisible","errorMessage","validatorsToRun","argsMap","maxLength","isRequired","_isDynamicallyRequired","required","push","minLength","pattern","minimum","maximum","min","max","format","ui","validators","v","name","args","length","val","getValue","result","executeValidation","fieldLabel","label","setVisualValidationState","ctrl","setValueState","coreLibrary","ValueState","None","Error","setValueStateText","applyError","clearError","applyVisibility","isVisible","setVisible","applyRequired","setRequired","applyEditable","setEnabled","onStateChange","newMetadata","applyState","applyCommonDirectives","readOnly","visibleOn","ExpressionBuilder","sap","require","expr","build","bindProperty","parts","formatter","enabledOn","controlProps","console","error","targetControl","mainControl","target","getMetadata","targetMeta","settings","propName","propValue","Object","entries","includes","warn","hasAggregation","hasEvent","startsWith","endsWith","injectedValue","applySettings","err","getName","message","destroy","__exports","__esModule"],"sources":["BasePlugin.ts"],"sourcesContent":["/**\n * @file BasePlugin.ts\n * @description Abstract foundation for all MetaUI plugins, enforcing lifecycle hooks for v2 Schema.\n */\n\nimport { IPlugin } from \"../../interfaces/IPlugin\";\nimport { IPropertyMetadata } from \"../../interfaces/ISchema\";\nimport Control from \"sap/ui/core/Control\";\nimport { GlobalPipeline } from \"../../core/PipelineManager\";\nimport * as coreLibrary from \"sap/ui/core/library\";\nimport { Logger } from \"../../utils/Logger\";\n\n/**\n * Abstract class representing a standard MetaUI Plugin.\n * Enforces the required rendering, state extraction, and validation contracts.\n * \n * @abstract\n * @public\n */\nexport abstract class BasePlugin implements IPlugin {\n /** The instantiated UI5 control for this plugin. */\n protected control: Control | null = null;\n\n /** Explicit reference to the core data widget when this plugin is wrapped in a layout. */\n protected mainControl?: Control;\n\n /** Properties strictly protected by the Sandbox engine. */\n protected BLOCKED_PROPS = [\"value\", \"text\", \"selectedKey\", \"selected\", \"dateValue\", \"editable\", \"enabled\", \"visible\", \"valueState\", \"valueStateText\", \"items\", \"content\", \"pages\", \"formElements\", \"change\", \"press\", \"select\", \"submit\"];\n\n /** The metadata schema defining the field rules. */\n protected metadata: IPropertyMetadata | null = null;\n\n /** The internal JSON path of the field relative to its parent payload. */\n protected fieldKey: string = \"\";\n\n /** The UI5 JSONModel name used for absolute binding paths. */\n protected modelName: string = \"meta\";\n\n /** Indicates if the engine is enforcing an editable mode. */\n protected isEditable: boolean = true;\n\n /** Indicates if the plugin should delegate visual validation to the MessageManager. */\n protected useMessageManager: boolean = false;\n\n /** Internal callback provided by GeneratorHost to signal validation/data changes upwards */\n protected onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void;\n\n /** \n * Tracks explicitly forced invalid states pushed down from the PolicyEngine.\n * When populated, this error takes absolute precedence over static SchemaValidator rules.\n */\n protected policyInvalidMessage: string | null = null;\n\n /** Transient state tracking for PBRE required evaluations to prevent schema clobbering */\n protected _isDynamicallyRequired?: boolean;\n\n /**\n * Injects the global editable mode context into the plugin before rendering.\n * @param editable True if the plugin should render in editable mode.\n */\n public setEditable(editable: boolean): void {\n this.isEditable = editable;\n }\n\n /**\n * Injects the global MessageManager context into the plugin.\n * @param useMessageManager True if the MessageManager is handling validation visual states.\n */\n public setUseMessageManager(useMessageManager: boolean): void {\n this.useMessageManager = useMessageManager;\n }\n\n /**\n * Instantiates the raw UI5 control and binds it to the model.\n * \n * @param fieldMetadata The JSON Schema for the field.\n * @param bindingPath The JSON path to bind to.\n * @param modelName The UI5 model name.\n * @param engineScopeId The deterministic scope ID provided by the Engine to prevent cloning collisions.\n * @param onChange The callback fired natively when a field value blur/change occurs.\n * @returns {Control} The generated UI5 control.\n */\n public abstract render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName?: string, engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void, model?: unknown): Control;\n\n /**\n * Generates a deterministic, globally unique ID for this control.\n * Prefixes the sanitized binding path with the Engine's scoped ID.\n */\n protected generateStableId(engineScopeId: string | undefined, bindingPath: string): string | undefined {\n if (!engineScopeId) return undefined;\n // Strip leading slash and replace internal slashes with hyphens\n const safePath = bindingPath.replace(/^\\//, '').replace(/\\//g, '-');\n return `${engineScopeId}--${safePath}`;\n }\n\n /**\n * Extracts the current raw value from the underlying UI5 control.\n */\n protected abstract getValue(): unknown;\n\n /**\n * Generates a standardized programmatic binding configuration object.\n * Ensures perfect architectural consistency across all plugins instead of relying on string parsing.\n * \n * @param bindingPath The relative or absolute path.\n * @param modelName The target model name.\n * @param typeInstance An optional UI5 Type instance (e.g. Integer, Float).\n * @param additionalOptions Optional extra configurations (e.g. formatOptions, constraints).\n * @returns A configuration object ready to be assigned to 'value', 'text', 'state', etc.\n */\n protected generateBindingInfo(bindingPath: string, modelName: string, typeInstance?: unknown, additionalOptions?: Record<string, unknown>): any {\n return {\n path: bindingPath,\n model: modelName,\n ...(typeInstance ? { type: typeInstance } : {}),\n ...(additionalOptions || {})\n };\n }\n\n /**\n * Universal pipeline validation.\n */\n public validate(): import(\"../../interfaces/IPlugin\").IPluginValidationResult {\n if (!this.control || !this.metadata) return { isValid: true };\n\n // Skip validation for hidden fields (e.g. hidden by ConditionEngine visibleOn)\n if (typeof (this.control as Control).getVisible === \"function\") {\n if (!(this.control as Control).getVisible()) {\n return { isValid: true };\n }\n }\n\n if (this.policyInvalidMessage) {\n return { isValid: false, errorMessage: this.policyInvalidMessage, fieldKey: this.fieldKey };\n }\n\n const validatorsToRun: string[] = [];\n const argsMap: Record<string, unknown> = {\n \"maxLength\": this.metadata.maxLength\n };\n\n const isRequired = this._isDynamicallyRequired !== undefined ? this._isDynamicallyRequired : this.metadata.required;\n if (isRequired) {\n validatorsToRun.push(\"required\");\n }\n if (this.metadata.maxLength) validatorsToRun.push(\"maxLength\");\n if (this.metadata.minLength) {\n validatorsToRun.push(\"minLength\");\n argsMap[\"minLength\"] = this.metadata.minLength;\n }\n if (this.metadata.pattern) {\n validatorsToRun.push(\"pattern\");\n argsMap[\"pattern\"] = this.metadata.pattern;\n }\n if (this.metadata.minimum !== undefined || this.metadata.maximum !== undefined) {\n validatorsToRun.push(\"range\");\n argsMap[\"range\"] = { min: this.metadata.minimum, max: this.metadata.maximum };\n }\n\n const format = this.metadata.ui?.format;\n if (format === \"email\" || format === \"url\" || format === \"iban\") {\n validatorsToRun.push(format);\n }\n\n if (this.metadata.ui?.validators) {\n for (const v of this.metadata.ui.validators) {\n if (typeof v === \"string\") {\n validatorsToRun.push(v);\n } else if (v && v.name) {\n validatorsToRun.push(v.name);\n if (v.args !== undefined) {\n argsMap[v.name] = v.args;\n }\n }\n }\n }\n\n if (validatorsToRun.length === 0) {\n return { isValid: true, errorMessage: undefined, fieldKey: this.fieldKey };\n }\n\n const val = this.getValue();\n const result = GlobalPipeline.executeValidation(val, validatorsToRun, argsMap);\n return { isValid: result.isValid, errorMessage: result.errorMessage, fieldKey: this.fieldKey, fieldLabel: this.metadata?.ui?.label };\n }\n\n /**\n * Natively manipulates the UI5 control's valueState if the control supports it.\n * Uses reflection to safely apply styles without crashing on structural controls.\n */\n public setVisualValidationState(isValid: boolean, errorMessage?: string): void {\n if (!this.control) return;\n\n\n // Use reflection to check if the control supports ValueState (e.g. sap.m.Input does, sap.m.Text does not)\n type StateControl = {\n setValueState?: (state: string) => void;\n setValueStateText?: (text: string) => void;\n };\n const ctrl = this.control as unknown as StateControl;\n if (typeof ctrl.setValueState === \"function\") {\n ctrl.setValueState(isValid ? coreLibrary.ValueState.None : coreLibrary.ValueState.Error);\n\n if (typeof ctrl.setValueStateText === \"function\") {\n ctrl.setValueStateText(isValid ? \"\" : (errorMessage || \"\"));\n }\n } else {\n // Quietly ignore. Controls like sap.m.Text natively do not support value states, which is completely valid.\n }\n }\n\n\n\n // --- IPluginStateReceiver Implementation for PBRE ---\n\n /**\n * Natively applies a forced error state from the PolicyEngine.\n * Per MetaUI Architecture Rule 12, this explicitly forces the visual state red \n * independently of the MessageManager auto-sync.\n * \n * @param errorMessage The custom error message to display.\n */\n public applyError(errorMessage: string): void {\n this.policyInvalidMessage = errorMessage;\n this.setVisualValidationState(false, errorMessage);\n }\n\n /**\n * Clears a previously forced error state.\n * Restores the visual boundary to standard (non-error) formatting.\n */\n public clearError(): void {\n this.policyInvalidMessage = null;\n this.setVisualValidationState(true);\n }\n\n /**\n * Dynamically manipulates the visibility state of the control based on PolicyEngine directives.\n * \n * @param isVisible True to display the control, false to hide it.\n */\n public applyVisibility(isVisible: boolean): void {\n const ctrl = this.control as unknown as { setVisible?: (b: boolean) => void };\n if (ctrl && typeof ctrl.setVisible === \"function\") {\n ctrl.setVisible(isVisible);\n }\n }\n\n /**\n * Dynamically alters the mandatory status of the field.\n * Updates internal transient state to ensure the `validate()` pipeline enforces the change,\n * and natively triggers the UI5 required indicator (asterisk) if supported,\n * without permanently corrupting the shared global schema definition.\n * \n * @param isRequired True to make the field mandatory, false to make it optional.\n */\n public applyRequired(isRequired: boolean): void {\n this._isDynamicallyRequired = isRequired;\n const ctrl = this.control as unknown as { setRequired?: (b: boolean) => void };\n if (ctrl && typeof ctrl.setRequired === \"function\") {\n ctrl.setRequired(isRequired);\n }\n }\n\n /**\n * Dynamically alters the editability of the field.\n * Falls back to `setEnabled` if the control is structural rather than purely input-driven.\n * \n * @param isEditable True to allow user input, false to lock it.\n */\n public applyEditable(isEditable: boolean): void {\n const ctrl = this.control as unknown as { setEditable?: (b: boolean) => void, setEnabled?: (b: boolean) => void };\n if (ctrl && typeof ctrl.setEditable === \"function\") {\n ctrl.setEditable(isEditable);\n } else if (ctrl && typeof ctrl.setEnabled === \"function\") {\n ctrl.setEnabled(isEditable);\n }\n }\n\n /**\n * Executes when the condition engine pushes new schema metadata to this field (e.g. readOnly changing).\n * @param newMetadata The mutated schema metadata.\n */\n public onStateChange(newMetadata: IPropertyMetadata): void {\n this.metadata = newMetadata;\n this.applyState();\n }\n\n /**\n * Abstract hook for the plugin to apply state changes to its specific UI5 control (e.g. placeholders, labels).\n */\n protected abstract applyState(): void;\n\n /**\n * Helper to apply common UI directives (like readOnly, visibleOn) directly to any control.\n */\n protected applyCommonDirectives(control: Control, metadata: IPropertyMetadata, modelName: string = \"meta\"): void {\n const ctrl = control as unknown as { setEditable?: (b: boolean) => void, setEnabled?: (b: boolean) => void };\n if (metadata.ui?.readOnly !== undefined && typeof ctrl.setEditable === \"function\") {\n ctrl.setEditable(!metadata.ui.readOnly);\n }\n\n if (metadata.ui?.visibleOn) {\n const ExpressionBuilder = sap.ui.require(\"nz/co/siliconst/ui5/metaui/utils/ExpressionBuilder\")?.ExpressionBuilder;\n let expr = \"\";\n if (ExpressionBuilder) {\n expr = ExpressionBuilder.build(metadata.ui.visibleOn, this.fieldKey, modelName);\n } else {\n expr = `{= ${metadata.ui.visibleOn.replace(/\\$root\\./g, `${modelName}>/`).replace(/\\./g, '/')} }`;\n }\n control.bindProperty(\"visible\", { parts: [{ path: \"meta>/\" }], formatter: () => false });\n control.bindProperty(\"visible\", expr);\n }\n\n if (metadata.ui?.enabledOn && typeof ctrl.setEnabled === \"function\") {\n const ExpressionBuilder = sap.ui.require(\"nz/co/siliconst/ui5/metaui/utils/ExpressionBuilder\")?.ExpressionBuilder;\n let expr = \"\";\n if (ExpressionBuilder) {\n expr = ExpressionBuilder.build(metadata.ui.enabledOn, this.fieldKey, modelName);\n } else {\n expr = `{= ${metadata.ui.enabledOn.replace(/\\$root\\./g, `${modelName}>/`).replace(/\\./g, '/')} }`;\n }\n control.bindProperty(\"enabled\", expr);\n }\n\n if (metadata.ui?.controlProps) {\n console.error(`[DEBUG MetaUI] controlProps found for ${this.fieldKey}`, metadata.ui.controlProps);\n const targetControl = this.mainControl || control;\n const target = targetControl as unknown as {\n getMetadata?: () => { getName(): string },\n applySettings?: (settings: Record<string, any>) => void,\n setProperty?: (p: string, v: unknown) => void,\n bindProperty?: (p: string, v: string) => void\n };\n\n if (typeof target.getMetadata === \"function\") {\n const targetMeta = target.getMetadata();\n const settings: Record<string, any> = {};\n for (const [propName, propValue] of Object.entries(metadata.ui.controlProps)) {\n if (this.BLOCKED_PROPS.includes(propName)) {\n Logger.warn(`[BasePlugin] Cannot apply controlProps '${propName}' for field '${this.fieldKey}' - ILLEGAL OVERRIDE (Property is protected by sandbox)`);\n continue;\n }\n \n // Natively block any aggregations or events to prevent sandbox escapes\n if (typeof (targetMeta as any).hasAggregation === \"function\" && (targetMeta as any).hasAggregation(propName)) {\n Logger.warn(`[BasePlugin] Cannot apply controlProps '${propName}' for field '${this.fieldKey}' - ILLEGAL OVERRIDE (Cannot hijack aggregations)`);\n continue;\n }\n \n if (typeof (targetMeta as any).hasEvent === \"function\" && (targetMeta as any).hasEvent(propName)) {\n Logger.warn(`[BasePlugin] Cannot apply controlProps '${propName}' for field '${this.fieldKey}' - ILLEGAL OVERRIDE (Cannot hijack events)`);\n continue;\n }\n\n if (typeof propValue === \"string\" && propValue.startsWith(\"{\") && propValue.endsWith(\"}\")) {\n // The JSON payloads often hardcode 'metaui>' in raw expression bindings, \n // but the Engine dynamically generates model names like 'metaUI_Host1'. \n // We must inject the actual modelName dynamically into the expression string.\n const injectedValue = propValue.replace(/metaui>/g, `${modelName}>`);\n settings[propName] = injectedValue;\n } else {\n settings[propName] = propValue;\n }\n }\n\n try {\n const target = targetControl as unknown as { applySettings?: (s: Record<string, any>) => void };\n if (typeof target.applySettings === \"function\") {\n target.applySettings(settings);\n }\n } catch (err: unknown) {\n Logger.warn(`[BasePlugin] Failed to apply controlProps for field '${this.fieldKey}' on control ${targetMeta.getName()}: ${(err as Error).message}`);\n }\n }\n }\n }\n\n\n\n /**\n * Natively destroys the instantiated UI5 control to prevent memory leaks.\n * Can be overridden by subclasses if they manage secondary controls or custom models.\n */\n public destroy(): void {\n if (this.control && typeof this.control.destroy === \"function\") {\n this.control.destroy();\n this.control = null;\n }\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;EAHA,MAQSA,cAAc,GAAAC,wBAAA;EAAA,MAEdC,MAAM,GAAAC,gBAAA;EAEf;AACA;AACA;AACA;AACA;AACA;AACA;EACO,MAAeC,UAAU,CAAoB;IAChD;IACUC,OAAO,GAAmB,IAAI;;IAExC;;IAGA;IACUC,aAAa,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,gBAAgB,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC;;IAEzO;IACUC,QAAQ,GAA6B,IAAI;;IAEnD;IACUC,QAAQ,GAAW,EAAE;;IAE/B;IACUC,SAAS,GAAW,MAAM;;IAEpC;IACUC,UAAU,GAAY,IAAI;;IAEpC;IACUC,iBAAiB,GAAY,KAAK;;IAE5C;;IAGA;AACJ;AACA;AACA;IACcC,oBAAoB,GAAkB,IAAI;;IAEpD;;IAGA;AACJ;AACA;AACA;IACWC,WAAWA,CAACC,QAAiB,EAAQ;MACxC,IAAI,CAACJ,UAAU,GAAGI,QAAQ;IAC9B;;IAEA;AACJ;AACA;AACA;IACWC,oBAAoBA,CAACJ,iB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A;cACA;cACA,MAAMC,aAAa,GAAGT,SAAS,CAAC/E,OAAO,CAAC,UAAU,EAAE,GAAGZ,SAAS,GAAG,CAAC;cACpEyF,QAAQ,CAACC,QAAQ,CAAC,GAAGU,aAAa;YACtC,CAAC,MAAM;cACHX,QAAQ,CAACC,QAAQ,CAAC,GAAGC,SAAS;YAClC;UACJ;UAEA,IAAI;YACA,MAAML,MAAM,GAAGF,aAAgF;YAC/F,IAAI,OAAOE,MAAM,CAACe,aAAa,KAAK,UAAU,EAAE;cAC5Cf,MAAM,CAACe,aAAa,CAACZ,QAAQ,CAAC;YAClC;UACJ,CAAC,CAAC,OAAOa,GAAY,EAAE;YACnB7G,MAAM,CAACsG,IAAI,CAAC,wDAAwD,IAAI,CAAChG,QAAQ,gBAAgByF,UAAU,CAACe,OAAO,CAAC,CAAC,KAAMD,GAAG,CAAWE,OAAO,EAAE,CAAC;UACvJ;QACJ;MACJ;IACJ;;IAIA;AACJ;AACA;AACA;IACWC,OAAOA,CAAA,EAAS;MACnB,IAAI,IAAI,CAAC7G,OAAO,IAAI,OAAO,IAAI,CAACA,OAAO,CAAC6G,OAAO,KAAK,UAAU,EAAE;QAC5D,IAAI,CAAC7G,OAAO,CAAC6G,OAAO,CAAC,CAAC;QACtB,IAAI,CAAC7G,OAAO,GAAG,IAAI;MACvB;IACJ;EACJ;EAAC,IAAA8G,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAA/G,UAAA,GAAAA,UAAA;EAAA,OAAA+G,SAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"BasePlugin-dbg.js","names":["GlobalPipeline","____core_PipelineManager","Logger","____utils_Logger","BasePlugin","control","BLOCKED_PROPS","metadata","fieldKey","modelName","isEditable","useMessageManager","policyInvalidMessage","setEditable","editable","getFieldLabel","ui","label","setUseMessageManager","generateStableId","engineScopeId","bindingPath","undefined","safePath","replace","generateBindingInfo","typeInstance","additionalOptions","path","model","type","validate","isValid","getVisible","errorMessage","validatorsToRun","argsMap","maxLength","isRequired","_isDynamicallyRequired","required","push","minLength","pattern","minimum","maximum","min","max","format","validators","v","name","args","length","val","getValue","result","executeValidation","fieldLabel","setVisualValidationState","ctrl","setValueState","coreLibrary","ValueState","None","Error","setValueStateText","applyError","clearError","applyVisibility","isVisible","setVisible","applyRequired","setRequired","applyEditable","setEnabled","onStateChange","newMetadata","applyState","applyCommonDirectives","readOnly","visibleOn","expr","bindProperty","parts","formatter","enabledOn","controlProps","debug","JSON","stringify","targetControl","mainControl","target","getMetadata","targetMeta","settings","propName","propValue","Object","entries","includes","warn","hasAggregation","hasEvent","startsWith","endsWith","injectedValue","applySettings","err","getName","message","destroy","__exports","__esModule"],"sources":["BasePlugin.ts"],"sourcesContent":["/**\n * @file BasePlugin.ts\n * @description Abstract foundation for all MetaUI plugins, enforcing lifecycle hooks for v2 Schema.\n */\n\nimport { IPlugin } from \"../../interfaces/IPlugin\";\nimport { IPropertyMetadata } from \"../../interfaces/ISchema\";\nimport Control from \"sap/ui/core/Control\";\nimport { GlobalPipeline } from \"../../core/PipelineManager\";\nimport * as coreLibrary from \"sap/ui/core/library\";\nimport { Logger } from \"../../utils/Logger\";\n\n/**\n * Abstract class representing a standard MetaUI Plugin.\n * Enforces the required rendering, state extraction, and validation contracts.\n * \n * @abstract\n * @public\n */\nexport abstract class BasePlugin implements IPlugin {\n /** The instantiated UI5 control for this plugin. */\n protected control: Control | null = null;\n\n /** Explicit reference to the core data widget when this plugin is wrapped in a layout. */\n protected mainControl?: Control;\n\n /** Properties strictly protected by the Sandbox engine. */\n protected BLOCKED_PROPS = [\"value\", \"text\", \"selectedKey\", \"selected\", \"dateValue\", \"editable\", \"enabled\", \"visible\", \"valueState\", \"valueStateText\", \"items\", \"content\", \"pages\", \"formElements\", \"change\", \"press\", \"select\", \"submit\"];\n\n /** The metadata schema defining the field rules. */\n protected metadata: IPropertyMetadata | null = null;\n\n /** The internal JSON path of the field relative to its parent payload. */\n protected fieldKey: string = \"\";\n\n /** The UI5 JSONModel name used for absolute binding paths. */\n protected modelName: string = \"meta\";\n\n /** Indicates if the engine is enforcing an editable mode. */\n protected isEditable: boolean = true;\n\n /** Indicates if the plugin should delegate visual validation to the MessageManager. */\n protected useMessageManager: boolean = false;\n\n /** Internal callback provided by GeneratorHost to signal validation/data changes upwards */\n protected onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void;\n\n /** \n * Tracks explicitly forced invalid states pushed down from the PolicyEngine.\n * When populated, this error takes absolute precedence over static SchemaValidator rules.\n */\n protected policyInvalidMessage: string | null = null;\n\n /** Transient state tracking for PBRE required evaluations to prevent schema clobbering */\n protected _isDynamicallyRequired?: boolean;\n\n /**\n * Injects the global editable mode context into the plugin before rendering.\n * @param editable True if the plugin should render in editable mode.\n */\n public setEditable(editable: boolean): void {\n this.isEditable = editable;\n }\n\n /**\n * Retrieves the human-readable label for the field from its metadata.\n */\n public getFieldLabel(): string | undefined {\n return this.metadata?.ui?.label || this.fieldKey;\n }\n\n /**\n * Injects the global MessageManager context into the plugin.\n * @param useMessageManager True if the MessageManager is handling validation visual states.\n */\n public setUseMessageManager(useMessageManager: boolean): void {\n this.useMessageManager = useMessageManager;\n }\n\n /**\n * Instantiates the raw UI5 control and binds it to the model.\n * \n * @param fieldMetadata The JSON Schema for the field.\n * @param bindingPath The JSON path to bind to.\n * @param modelName The UI5 model name.\n * @param engineScopeId The deterministic scope ID provided by the Engine to prevent cloning collisions.\n * @param onChange The callback fired natively when a field value blur/change occurs.\n * @returns {Control} The generated UI5 control.\n */\n public abstract render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName?: string, engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void, model?: unknown): Control;\n\n /**\n * Generates a deterministic, globally unique ID for this control.\n * Prefixes the sanitized binding path with the Engine's scoped ID.\n */\n protected generateStableId(engineScopeId: string | undefined, bindingPath: string): string | undefined {\n if (!engineScopeId) return undefined;\n // Strip leading slash and replace internal slashes with hyphens\n const safePath = bindingPath.replace(/^\\//, '').replace(/\\//g, '-');\n return `${engineScopeId}--${safePath}`;\n }\n\n /**\n * Extracts the current raw value from the underlying UI5 control.\n */\n protected abstract getValue(): unknown;\n\n /**\n * Generates a standardized programmatic binding configuration object.\n * Ensures perfect architectural consistency across all plugins instead of relying on string parsing.\n * \n * @param bindingPath The relative or absolute path.\n * @param modelName The target model name.\n * @param typeInstance An optional UI5 Type instance (e.g. Integer, Float).\n * @param additionalOptions Optional extra configurations (e.g. formatOptions, constraints).\n * @returns A configuration object ready to be assigned to 'value', 'text', 'state', etc.\n */\n protected generateBindingInfo(bindingPath: string, modelName: string, typeInstance?: unknown, additionalOptions?: Record<string, unknown>): any {\n return {\n path: bindingPath,\n model: modelName,\n ...(typeInstance ? { type: typeInstance } : {}),\n ...(additionalOptions || {})\n };\n }\n\n /**\n * Universal pipeline validation.\n */\n public validate(): import(\"../../interfaces/IPlugin\").IPluginValidationResult {\n if (!this.control || !this.metadata) return { isValid: true };\n\n // Skip validation for hidden fields (e.g. hidden by ConditionEngine visibleOn)\n if (typeof (this.control as Control).getVisible === \"function\") {\n if (!(this.control as Control).getVisible()) {\n return { isValid: true };\n }\n }\n\n if (this.policyInvalidMessage) {\n return { isValid: false, errorMessage: this.policyInvalidMessage, fieldKey: this.fieldKey };\n }\n\n const validatorsToRun: string[] = [];\n const argsMap: Record<string, unknown> = {\n \"maxLength\": this.metadata.maxLength\n };\n\n const isRequired = this._isDynamicallyRequired !== undefined ? this._isDynamicallyRequired : this.metadata.required;\n if (isRequired) {\n validatorsToRun.push(\"required\");\n }\n if (this.metadata.maxLength) validatorsToRun.push(\"maxLength\");\n if (this.metadata.minLength) {\n validatorsToRun.push(\"minLength\");\n argsMap[\"minLength\"] = this.metadata.minLength;\n }\n if (this.metadata.pattern) {\n validatorsToRun.push(\"pattern\");\n argsMap[\"pattern\"] = this.metadata.pattern;\n }\n if (this.metadata.minimum !== undefined || this.metadata.maximum !== undefined) {\n validatorsToRun.push(\"range\");\n argsMap[\"range\"] = { min: this.metadata.minimum, max: this.metadata.maximum };\n }\n\n const format = this.metadata.ui?.format;\n if (format === \"email\" || format === \"url\" || format === \"iban\") {\n validatorsToRun.push(format);\n }\n\n if (this.metadata.ui?.validators) {\n for (const v of this.metadata.ui.validators) {\n if (typeof v === \"string\") {\n validatorsToRun.push(v);\n } else if (v && v.name) {\n validatorsToRun.push(v.name);\n if (v.args !== undefined) {\n argsMap[v.name] = v.args;\n }\n }\n }\n }\n\n if (validatorsToRun.length === 0) {\n return { isValid: true, errorMessage: undefined, fieldKey: this.fieldKey };\n }\n\n const val = this.getValue();\n const result = GlobalPipeline.executeValidation(val, validatorsToRun, argsMap);\n return { isValid: result.isValid, errorMessage: result.errorMessage, fieldKey: this.fieldKey, fieldLabel: this.metadata?.ui?.label };\n }\n\n /**\n * Natively manipulates the UI5 control's valueState if the control supports it.\n * Uses reflection to safely apply styles without crashing on structural controls.\n */\n public setVisualValidationState(isValid: boolean, errorMessage?: string): void {\n if (!this.control) return;\n\n\n // Use reflection to check if the control supports ValueState (e.g. sap.m.Input does, sap.m.Text does not)\n type StateControl = {\n setValueState?: (state: string) => void;\n setValueStateText?: (text: string) => void;\n };\n const ctrl = this.control as unknown as StateControl;\n if (typeof ctrl.setValueState === \"function\") {\n ctrl.setValueState(isValid ? coreLibrary.ValueState.None : coreLibrary.ValueState.Error);\n\n if (typeof ctrl.setValueStateText === \"function\") {\n ctrl.setValueStateText(isValid ? \"\" : (errorMessage || \"\"));\n }\n } else {\n // Quietly ignore. Controls like sap.m.Text natively do not support value states, which is completely valid.\n }\n }\n\n\n\n // --- IPluginStateReceiver Implementation for PBRE ---\n\n /**\n * Natively applies a forced error state from the PolicyEngine.\n * Per MetaUI Architecture Rule 12, this explicitly forces the visual state red \n * independently of the MessageManager auto-sync.\n * \n * @param errorMessage The custom error message to display.\n */\n public applyError(errorMessage: string): void {\n this.policyInvalidMessage = errorMessage;\n this.setVisualValidationState(false, errorMessage);\n }\n\n /**\n * Clears a previously forced error state.\n * Restores the visual boundary to standard (non-error) formatting.\n */\n public clearError(): void {\n this.policyInvalidMessage = null;\n this.setVisualValidationState(true);\n }\n\n /**\n * Dynamically manipulates the visibility state of the control based on PolicyEngine directives.\n * \n * @param isVisible True to display the control, false to hide it.\n */\n public applyVisibility(isVisible: boolean): void {\n const ctrl = this.control as unknown as { setVisible?: (b: boolean) => void };\n if (ctrl && typeof ctrl.setVisible === \"function\") {\n ctrl.setVisible(isVisible);\n }\n }\n\n /**\n * Dynamically alters the mandatory status of the field.\n * Updates internal transient state to ensure the `validate()` pipeline enforces the change,\n * and natively triggers the UI5 required indicator (asterisk) if supported,\n * without permanently corrupting the shared global schema definition.\n * \n * @param isRequired True to make the field mandatory, false to make it optional.\n */\n public applyRequired(isRequired: boolean): void {\n this._isDynamicallyRequired = isRequired;\n const ctrl = this.control as unknown as { setRequired?: (b: boolean) => void };\n if (ctrl && typeof ctrl.setRequired === \"function\") {\n ctrl.setRequired(isRequired);\n }\n }\n\n /**\n * Dynamically alters the editability of the field.\n * Falls back to `setEnabled` if the control is structural rather than purely input-driven.\n * \n * @param isEditable True to allow user input, false to lock it.\n */\n public applyEditable(isEditable: boolean): void {\n const ctrl = this.control as unknown as { setEditable?: (b: boolean) => void, setEnabled?: (b: boolean) => void };\n if (ctrl && typeof ctrl.setEditable === \"function\") {\n ctrl.setEditable(isEditable);\n } else if (ctrl && typeof ctrl.setEnabled === \"function\") {\n ctrl.setEnabled(isEditable);\n }\n }\n\n /**\n * Executes when the condition engine pushes new schema metadata to this field (e.g. readOnly changing).\n * @param newMetadata The mutated schema metadata.\n */\n public onStateChange(newMetadata: IPropertyMetadata): void {\n this.metadata = newMetadata;\n this.applyState();\n }\n\n /**\n * Abstract hook for the plugin to apply state changes to its specific UI5 control (e.g. placeholders, labels).\n */\n protected abstract applyState(): void;\n\n /**\n * Helper to apply common UI directives (like readOnly, visibleOn) directly to any control.\n */\n protected applyCommonDirectives(control: Control, metadata: IPropertyMetadata, modelName: string = \"meta\"): void {\n const ctrl = control as unknown as { setEditable?: (b: boolean) => void, setEnabled?: (b: boolean) => void };\n if (metadata.ui?.readOnly !== undefined && typeof ctrl.setEditable === \"function\") {\n ctrl.setEditable(!metadata.ui.readOnly);\n }\n\n if (metadata.ui?.visibleOn) {\n const expr = `{= ${metadata.ui.visibleOn.replace(/\\$root\\./g, `${modelName}>/`).replace(/\\./g, '/')} }`;\n control.bindProperty(\"visible\", { parts: [{ path: \"meta>/\" }], formatter: () => false });\n control.bindProperty(\"visible\", expr);\n }\n\n if (metadata.ui?.enabledOn && typeof ctrl.setEnabled === \"function\") {\n const expr = `{= ${metadata.ui.enabledOn.replace(/\\$root\\./g, `${modelName}>/`).replace(/\\./g, '/')} }`;\n control.bindProperty(\"enabled\", expr);\n }\n\n if (metadata.ui?.controlProps) {\n Logger.debug(`[BasePlugin] controlProps found for ${this.fieldKey}: ` + JSON.stringify(metadata.ui.controlProps), \"BasePlugin\");\n const targetControl = this.mainControl || control;\n const target = targetControl as unknown as {\n getMetadata?: () => { getName(): string },\n applySettings?: (settings: Record<string, any>) => void,\n setProperty?: (p: string, v: unknown) => void,\n bindProperty?: (p: string, v: string) => void\n };\n\n if (typeof target.getMetadata === \"function\") {\n const targetMeta = target.getMetadata();\n const settings: Record<string, any> = {};\n for (const [propName, propValue] of Object.entries(metadata.ui.controlProps)) {\n if (this.BLOCKED_PROPS.includes(propName)) {\n Logger.warn(`[BasePlugin] Cannot apply controlProps '${propName}' for field '${this.fieldKey}' - ILLEGAL OVERRIDE (Property is protected by sandbox)`);\n continue;\n }\n \n // Natively block any aggregations or events to prevent sandbox escapes\n if (typeof (targetMeta as any).hasAggregation === \"function\" && (targetMeta as any).hasAggregation(propName)) {\n Logger.warn(`[BasePlugin] Cannot apply controlProps '${propName}' for field '${this.fieldKey}' - ILLEGAL OVERRIDE (Cannot hijack aggregations)`);\n continue;\n }\n \n if (typeof (targetMeta as any).hasEvent === \"function\" && (targetMeta as any).hasEvent(propName)) {\n Logger.warn(`[BasePlugin] Cannot apply controlProps '${propName}' for field '${this.fieldKey}' - ILLEGAL OVERRIDE (Cannot hijack events)`);\n continue;\n }\n\n if (typeof propValue === \"string\" && propValue.startsWith(\"{\") && propValue.endsWith(\"}\")) {\n // The JSON payloads often hardcode 'metaui>' in raw expression bindings, \n // but the Engine dynamically generates model names like 'metaUI_Host1'. \n // We must inject the actual modelName dynamically into the expression string.\n const injectedValue = propValue.replace(/metaui>/g, `${modelName}>`);\n settings[propName] = injectedValue;\n } else {\n settings[propName] = propValue;\n }\n }\n\n try {\n const target = targetControl as unknown as { applySettings?: (s: Record<string, any>) => void };\n if (typeof target.applySettings === \"function\") {\n target.applySettings(settings);\n }\n } catch (err: unknown) {\n Logger.warn(`[BasePlugin] Failed to apply controlProps for field '${this.fieldKey}' on control ${targetMeta.getName()}: ${(err as Error).message}`);\n }\n }\n }\n }\n\n\n\n /**\n * Natively destroys the instantiated UI5 control to prevent memory leaks.\n * Can be overridden by subclasses if they manage secondary controls or custom models.\n */\n public destroy(): void {\n if (this.control && typeof this.control.destroy === \"function\") {\n this.control.destroy();\n this.control = null;\n }\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;EAHA,MAQSA,cAAc,GAAAC,wBAAA;EAAA,MAEdC,MAAM,GAAAC,gBAAA;EAEf;AACA;AACA;AACA;AACA;AACA;AACA;EACO,MAAeC,UAAU,CAAoB;IAChD;IACUC,OAAO,GAAmB,IAAI;;IAExC;;IAGA;IACUC,aAAa,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,gBAAgB,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC;;IAEzO;IACUC,QAAQ,GAA6B,IAAI;;IAEnD;IACUC,QAAQ,GAAW,E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ACC,QAAQ,CAAC,GAAGU,aAAa;YACtC,CAAC,MAAM;cACHX,QAAQ,CAACC,QAAQ,CAAC,GAAGC,SAAS;YAClC;UACJ;UAEA,IAAI;YACA,MAAML,MAAM,GAAGF,aAAgF;YAC/F,IAAI,OAAOE,MAAM,CAACe,aAAa,KAAK,UAAU,EAAE;cAC5Cf,MAAM,CAACe,aAAa,CAACZ,QAAQ,CAAC;YAClC;UACJ,CAAC,CAAC,OAAOa,GAAY,EAAE;YACnB3G,MAAM,CAACoG,IAAI,CAAC,wDAAwD,IAAI,CAAC9F,QAAQ,gBAAgBuF,UAAU,CAACe,OAAO,CAAC,CAAC,KAAMD,GAAG,CAAWE,OAAO,EAAE,CAAC;UACvJ;QACJ;MACJ;IACJ;;IAIA;AACJ;AACA;AACA;IACWC,OAAOA,CAAA,EAAS;MACnB,IAAI,IAAI,CAAC3G,OAAO,IAAI,OAAO,IAAI,CAACA,OAAO,CAAC2G,OAAO,KAAK,UAAU,EAAE;QAC5D,IAAI,CAAC3G,OAAO,CAAC2G,OAAO,CAAC,CAAC;QACtB,IAAI,CAAC3G,OAAO,GAAG,IAAI;MACvB;IACJ;EACJ;EAAC,IAAA4G,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAA7G,UAAA,GAAAA,UAAA;EAAA,OAAA6G,SAAA;AAAA","ignoreList":[]}
@@ -44,6 +44,10 @@ declare module "nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin" {
44
44
  * @param editable True if the plugin should render in editable mode.
45
45
  */
46
46
  setEditable(editable: boolean): void;
47
+ /**
48
+ * Retrieves the human-readable label for the field from its metadata.
49
+ */
50
+ getFieldLabel(): string | undefined;
47
51
  /**
48
52
  * Injects the global MessageManager context into the plugin.
49
53
  * @param useMessageManager True if the MessageManager is handling validation visual states.
@@ -1 +1 @@
1
- {"version":3,"file":"BasePlugin.d.ts","sourceRoot":"../../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.ts"],"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,GAAG,IAAI;QAyB9E;;;;;;WAMG;QACI,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;QAK7C;;;WAGG;QACI,UAAU,IAAI,IAAI;QAKzB;;;;WAIG;QACI,eAAe,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI;QAOhD;;;;;;;WAOG;QACI,aAAa,CAAC,UAAU,EAAE,OAAO,GAAG,IAAI;QAQ/C;;;;;WAKG;QACI,aAAa,CAAC,UAAU,EAAE,OAAO,GAAG,IAAI;QAS/C;;;WAGG;QACI,aAAa,CAAC,WAAW,EAAE,iBAAiB,GAAG,IAAI;QAK1D;;WAEG;QACH,SAAS,CAAC,QAAQ,CAAC,UAAU,IAAI,IAAI;QAErC;;WAEG;QACH,SAAS,CAAC,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,SAAS,GAAE,MAAe,GAAG,IAAI;QAwEhH;;;WAGG;QACI,OAAO,IAAI,IAAI;KAMzB;CAEA"}
@@ -1,2 +1,2 @@
1
- sap.ui.define(["../../core/PipelineManager","sap/ui/core/library","../../utils/Logger"],function(e,t,i){"use strict";const a=e["GlobalPipeline"];const s=i["Logger"];class n{control=null;BLOCKED_PROPS=["value","text","selectedKey","selected","dateValue","editable","enabled","visible","valueState","valueStateText","items","content","pages","formElements","change","press","select","submit"];metadata=null;fieldKey="";modelName="meta";isEditable=true;useMessageManager=false;policyInvalidMessage=null;setEditable(e){this.isEditable=e}setUseMessageManager(e){this.useMessageManager=e}generateStableId(e,t){if(!e)return undefined;const i=t.replace(/^\//,"").replace(/\//g,"-");return`${e}--${i}`}generateBindingInfo(e,t,i,a){return{path:e,model:t,...i?{type:i}:{},...a||{}}}validate(){if(!this.control||!this.metadata)return{isValid:true};if(typeof this.control.getVisible==="function"){if(!this.control.getVisible()){return{isValid:true}}}if(this.policyInvalidMessage){return{isValid:false,errorMessage:this.policyInvalidMessage,fieldKey:this.fieldKey}}const e=[];const t={maxLength:this.metadata.maxLength};const i=this._isDynamicallyRequired!==undefined?this._isDynamicallyRequired:this.metadata.required;if(i){e.push("required")}if(this.metadata.maxLength)e.push("maxLength");if(this.metadata.minLength){e.push("minLength");t["minLength"]=this.metadata.minLength}if(this.metadata.pattern){e.push("pattern");t["pattern"]=this.metadata.pattern}if(this.metadata.minimum!==undefined||this.metadata.maximum!==undefined){e.push("range");t["range"]={min:this.metadata.minimum,max:this.metadata.maximum}}const s=this.metadata.ui?.format;if(s==="email"||s==="url"||s==="iban"){e.push(s)}if(this.metadata.ui?.validators){for(const i of this.metadata.ui.validators){if(typeof i==="string"){e.push(i)}else if(i&&i.name){e.push(i.name);if(i.args!==undefined){t[i.name]=i.args}}}}if(e.length===0){return{isValid:true,errorMessage:undefined,fieldKey:this.fieldKey}}const n=this.getValue();const l=a.executeValidation(n,e,t);return{isValid:l.isValid,errorMessage:l.errorMessage,fieldKey:this.fieldKey,fieldLabel:this.metadata?.ui?.label}}setVisualValidationState(e,i){if(!this.control)return;const a=this.control;if(typeof a.setValueState==="function"){a.setValueState(e?t.ValueState.None:t.ValueState.Error);if(typeof a.setValueStateText==="function"){a.setValueStateText(e?"":i||"")}}else{}}applyError(e){this.policyInvalidMessage=e;this.setVisualValidationState(false,e)}clearError(){this.policyInvalidMessage=null;this.setVisualValidationState(true)}applyVisibility(e){const t=this.control;if(t&&typeof t.setVisible==="function"){t.setVisible(e)}}applyRequired(e){this._isDynamicallyRequired=e;const t=this.control;if(t&&typeof t.setRequired==="function"){t.setRequired(e)}}applyEditable(e){const t=this.control;if(t&&typeof t.setEditable==="function"){t.setEditable(e)}else if(t&&typeof t.setEnabled==="function"){t.setEnabled(e)}}onStateChange(e){this.metadata=e;this.applyState()}applyCommonDirectives(e,t,i="meta"){const a=e;if(t.ui?.readOnly!==undefined&&typeof a.setEditable==="function"){a.setEditable(!t.ui.readOnly)}if(t.ui?.visibleOn){const a=sap.ui.require("nz/co/siliconst/ui5/metaui/utils/ExpressionBuilder")?.ExpressionBuilder;let s="";if(a){s=a.build(t.ui.visibleOn,this.fieldKey,i)}else{s=`{= ${t.ui.visibleOn.replace(/\$root\./g,`${i}>/`).replace(/\./g,"/")} }`}e.bindProperty("visible",{parts:[{path:"meta>/"}],formatter:()=>false});e.bindProperty("visible",s)}if(t.ui?.enabledOn&&typeof a.setEnabled==="function"){const a=sap.ui.require("nz/co/siliconst/ui5/metaui/utils/ExpressionBuilder")?.ExpressionBuilder;let s="";if(a){s=a.build(t.ui.enabledOn,this.fieldKey,i)}else{s=`{= ${t.ui.enabledOn.replace(/\$root\./g,`${i}>/`).replace(/\./g,"/")} }`}e.bindProperty("enabled",s)}if(t.ui?.controlProps){console.error(`[DEBUG MetaUI] controlProps found for ${this.fieldKey}`,t.ui.controlProps);const a=this.mainControl||e;const n=a;if(typeof n.getMetadata==="function"){const e=n.getMetadata();const l={};for(const[a,n]of Object.entries(t.ui.controlProps)){if(this.BLOCKED_PROPS.includes(a)){s.warn(`[BasePlugin] Cannot apply controlProps '${a}' for field '${this.fieldKey}' - ILLEGAL OVERRIDE (Property is protected by sandbox)`);continue}if(typeof e.hasAggregation==="function"&&e.hasAggregation(a)){s.warn(`[BasePlugin] Cannot apply controlProps '${a}' for field '${this.fieldKey}' - ILLEGAL OVERRIDE (Cannot hijack aggregations)`);continue}if(typeof e.hasEvent==="function"&&e.hasEvent(a)){s.warn(`[BasePlugin] Cannot apply controlProps '${a}' for field '${this.fieldKey}' - ILLEGAL OVERRIDE (Cannot hijack events)`);continue}if(typeof n==="string"&&n.startsWith("{")&&n.endsWith("}")){const e=n.replace(/metaui>/g,`${i}>`);l[a]=e}else{l[a]=n}}try{const e=a;if(typeof e.applySettings==="function"){e.applySettings(l)}}catch(t){s.warn(`[BasePlugin] Failed to apply controlProps for field '${this.fieldKey}' on control ${e.getName()}: ${t.message}`)}}}}destroy(){if(this.control&&typeof this.control.destroy==="function"){this.control.destroy();this.control=null}}}var l={__esModule:true};l.BasePlugin=n;return l});
1
+ sap.ui.define(["../../core/PipelineManager","sap/ui/core/library","../../utils/Logger"],function(e,t,i){"use strict";const a=e["GlobalPipeline"];const n=i["Logger"];class s{control=null;BLOCKED_PROPS=["value","text","selectedKey","selected","dateValue","editable","enabled","visible","valueState","valueStateText","items","content","pages","formElements","change","press","select","submit"];metadata=null;fieldKey="";modelName="meta";isEditable=true;useMessageManager=false;policyInvalidMessage=null;setEditable(e){this.isEditable=e}getFieldLabel(){return this.metadata?.ui?.label||this.fieldKey}setUseMessageManager(e){this.useMessageManager=e}generateStableId(e,t){if(!e)return undefined;const i=t.replace(/^\//,"").replace(/\//g,"-");return`${e}--${i}`}generateBindingInfo(e,t,i,a){return{path:e,model:t,...i?{type:i}:{},...a||{}}}validate(){if(!this.control||!this.metadata)return{isValid:true};if(typeof this.control.getVisible==="function"){if(!this.control.getVisible()){return{isValid:true}}}if(this.policyInvalidMessage){return{isValid:false,errorMessage:this.policyInvalidMessage,fieldKey:this.fieldKey}}const e=[];const t={maxLength:this.metadata.maxLength};const i=this._isDynamicallyRequired!==undefined?this._isDynamicallyRequired:this.metadata.required;if(i){e.push("required")}if(this.metadata.maxLength)e.push("maxLength");if(this.metadata.minLength){e.push("minLength");t["minLength"]=this.metadata.minLength}if(this.metadata.pattern){e.push("pattern");t["pattern"]=this.metadata.pattern}if(this.metadata.minimum!==undefined||this.metadata.maximum!==undefined){e.push("range");t["range"]={min:this.metadata.minimum,max:this.metadata.maximum}}const n=this.metadata.ui?.format;if(n==="email"||n==="url"||n==="iban"){e.push(n)}if(this.metadata.ui?.validators){for(const i of this.metadata.ui.validators){if(typeof i==="string"){e.push(i)}else if(i&&i.name){e.push(i.name);if(i.args!==undefined){t[i.name]=i.args}}}}if(e.length===0){return{isValid:true,errorMessage:undefined,fieldKey:this.fieldKey}}const s=this.getValue();const l=a.executeValidation(s,e,t);return{isValid:l.isValid,errorMessage:l.errorMessage,fieldKey:this.fieldKey,fieldLabel:this.metadata?.ui?.label}}setVisualValidationState(e,i){if(!this.control)return;const a=this.control;if(typeof a.setValueState==="function"){a.setValueState(e?t.ValueState.None:t.ValueState.Error);if(typeof a.setValueStateText==="function"){a.setValueStateText(e?"":i||"")}}else{}}applyError(e){this.policyInvalidMessage=e;this.setVisualValidationState(false,e)}clearError(){this.policyInvalidMessage=null;this.setVisualValidationState(true)}applyVisibility(e){const t=this.control;if(t&&typeof t.setVisible==="function"){t.setVisible(e)}}applyRequired(e){this._isDynamicallyRequired=e;const t=this.control;if(t&&typeof t.setRequired==="function"){t.setRequired(e)}}applyEditable(e){const t=this.control;if(t&&typeof t.setEditable==="function"){t.setEditable(e)}else if(t&&typeof t.setEnabled==="function"){t.setEnabled(e)}}onStateChange(e){this.metadata=e;this.applyState()}applyCommonDirectives(e,t,i="meta"){const a=e;if(t.ui?.readOnly!==undefined&&typeof a.setEditable==="function"){a.setEditable(!t.ui.readOnly)}if(t.ui?.visibleOn){const a=`{= ${t.ui.visibleOn.replace(/\$root\./g,`${i}>/`).replace(/\./g,"/")} }`;e.bindProperty("visible",{parts:[{path:"meta>/"}],formatter:()=>false});e.bindProperty("visible",a)}if(t.ui?.enabledOn&&typeof a.setEnabled==="function"){const a=`{= ${t.ui.enabledOn.replace(/\$root\./g,`${i}>/`).replace(/\./g,"/")} }`;e.bindProperty("enabled",a)}if(t.ui?.controlProps){n.debug(`[BasePlugin] controlProps found for ${this.fieldKey}: `+JSON.stringify(t.ui.controlProps),"BasePlugin");const a=this.mainControl||e;const s=a;if(typeof s.getMetadata==="function"){const e=s.getMetadata();const l={};for(const[a,s]of Object.entries(t.ui.controlProps)){if(this.BLOCKED_PROPS.includes(a)){n.warn(`[BasePlugin] Cannot apply controlProps '${a}' for field '${this.fieldKey}' - ILLEGAL OVERRIDE (Property is protected by sandbox)`);continue}if(typeof e.hasAggregation==="function"&&e.hasAggregation(a)){n.warn(`[BasePlugin] Cannot apply controlProps '${a}' for field '${this.fieldKey}' - ILLEGAL OVERRIDE (Cannot hijack aggregations)`);continue}if(typeof e.hasEvent==="function"&&e.hasEvent(a)){n.warn(`[BasePlugin] Cannot apply controlProps '${a}' for field '${this.fieldKey}' - ILLEGAL OVERRIDE (Cannot hijack events)`);continue}if(typeof s==="string"&&s.startsWith("{")&&s.endsWith("}")){const e=s.replace(/metaui>/g,`${i}>`);l[a]=e}else{l[a]=s}}try{const e=a;if(typeof e.applySettings==="function"){e.applySettings(l)}}catch(t){n.warn(`[BasePlugin] Failed to apply controlProps for field '${this.fieldKey}' on control ${e.getName()}: ${t.message}`)}}}}destroy(){if(this.control&&typeof this.control.destroy==="function"){this.control.destroy();this.control=null}}}var l={__esModule:true};l.BasePlugin=s;return l});
2
2
  //# sourceMappingURL=BasePlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BasePlugin.js","names":["GlobalPipeline","____core_PipelineManager","Logger","____utils_Logger","BasePlugin","control","BLOCKED_PROPS","metadata","fieldKey","modelName","isEditable","useMessageManager","policyInvalidMessage","setEditable","editable","this","setUseMessageManager","generateStableId","engineScopeId","bindingPath","undefined","safePath","replace","generateBindingInfo","typeInstance","additionalOptions","path","model","type","validate","isValid","getVisible","errorMessage","validatorsToRun","argsMap","maxLength","isRequired","_isDynamicallyRequired","required","push","minLength","pattern","minimum","maximum","min","max","format","ui","validators","v","name","args","length","val","getValue","result","executeValidation","fieldLabel","label","setVisualValidationState","ctrl","setValueState","coreLibrary","ValueState","None","Error","setValueStateText","applyError","clearError","applyVisibility","isVisible","setVisible","applyRequired","setRequired","applyEditable","setEnabled","onStateChange","newMetadata","applyState","applyCommonDirectives","readOnly","visibleOn","ExpressionBuilder","sap","require","expr","build","bindProperty","parts","formatter","enabledOn","controlProps","console","error","targetControl","mainControl","target","getMetadata","targetMeta","settings","propName","propValue","Object","entries","includes","warn","hasAggregation","hasEvent","startsWith","endsWith","injectedValue","applySettings","err","getName","message","destroy","__exports","__esModule"],"sources":["BasePlugin.ts"],"sourcesContent":["/**\n * @file BasePlugin.ts\n * @description Abstract foundation for all MetaUI plugins, enforcing lifecycle hooks for v2 Schema.\n */\n\nimport { IPlugin } from \"../../interfaces/IPlugin\";\nimport { IPropertyMetadata } from \"../../interfaces/ISchema\";\nimport Control from \"sap/ui/core/Control\";\nimport { GlobalPipeline } from \"../../core/PipelineManager\";\nimport * as coreLibrary from \"sap/ui/core/library\";\nimport { Logger } from \"../../utils/Logger\";\n\n/**\n * Abstract class representing a standard MetaUI Plugin.\n * Enforces the required rendering, state extraction, and validation contracts.\n * \n * @abstract\n * @public\n */\nexport abstract class BasePlugin implements IPlugin {\n /** The instantiated UI5 control for this plugin. */\n protected control: Control | null = null;\n\n /** Explicit reference to the core data widget when this plugin is wrapped in a layout. */\n protected mainControl?: Control;\n\n /** Properties strictly protected by the Sandbox engine. */\n protected BLOCKED_PROPS = [\"value\", \"text\", \"selectedKey\", \"selected\", \"dateValue\", \"editable\", \"enabled\", \"visible\", \"valueState\", \"valueStateText\", \"items\", \"content\", \"pages\", \"formElements\", \"change\", \"press\", \"select\", \"submit\"];\n\n /** The metadata schema defining the field rules. */\n protected metadata: IPropertyMetadata | null = null;\n\n /** The internal JSON path of the field relative to its parent payload. */\n protected fieldKey: string = \"\";\n\n /** The UI5 JSONModel name used for absolute binding paths. */\n protected modelName: string = \"meta\";\n\n /** Indicates if the engine is enforcing an editable mode. */\n protected isEditable: boolean = true;\n\n /** Indicates if the plugin should delegate visual validation to the MessageManager. */\n protected useMessageManager: boolean = false;\n\n /** Internal callback provided by GeneratorHost to signal validation/data changes upwards */\n protected onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void;\n\n /** \n * Tracks explicitly forced invalid states pushed down from the PolicyEngine.\n * When populated, this error takes absolute precedence over static SchemaValidator rules.\n */\n protected policyInvalidMessage: string | null = null;\n\n /** Transient state tracking for PBRE required evaluations to prevent schema clobbering */\n protected _isDynamicallyRequired?: boolean;\n\n /**\n * Injects the global editable mode context into the plugin before rendering.\n * @param editable True if the plugin should render in editable mode.\n */\n public setEditable(editable: boolean): void {\n this.isEditable = editable;\n }\n\n /**\n * Injects the global MessageManager context into the plugin.\n * @param useMessageManager True if the MessageManager is handling validation visual states.\n */\n public setUseMessageManager(useMessageManager: boolean): void {\n this.useMessageManager = useMessageManager;\n }\n\n /**\n * Instantiates the raw UI5 control and binds it to the model.\n * \n * @param fieldMetadata The JSON Schema for the field.\n * @param bindingPath The JSON path to bind to.\n * @param modelName The UI5 model name.\n * @param engineScopeId The deterministic scope ID provided by the Engine to prevent cloning collisions.\n * @param onChange The callback fired natively when a field value blur/change occurs.\n * @returns {Control} The generated UI5 control.\n */\n public abstract render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName?: string, engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void, model?: unknown): Control;\n\n /**\n * Generates a deterministic, globally unique ID for this control.\n * Prefixes the sanitized binding path with the Engine's scoped ID.\n */\n protected generateStableId(engineScopeId: string | undefined, bindingPath: string): string | undefined {\n if (!engineScopeId) return undefined;\n // Strip leading slash and replace internal slashes with hyphens\n const safePath = bindingPath.replace(/^\\//, '').replace(/\\//g, '-');\n return `${engineScopeId}--${safePath}`;\n }\n\n /**\n * Extracts the current raw value from the underlying UI5 control.\n */\n protected abstract getValue(): unknown;\n\n /**\n * Generates a standardized programmatic binding configuration object.\n * Ensures perfect architectural consistency across all plugins instead of relying on string parsing.\n * \n * @param bindingPath The relative or absolute path.\n * @param modelName The target model name.\n * @param typeInstance An optional UI5 Type instance (e.g. Integer, Float).\n * @param additionalOptions Optional extra configurations (e.g. formatOptions, constraints).\n * @returns A configuration object ready to be assigned to 'value', 'text', 'state', etc.\n */\n protected generateBindingInfo(bindingPath: string, modelName: string, typeInstance?: unknown, additionalOptions?: Record<string, unknown>): any {\n return {\n path: bindingPath,\n model: modelName,\n ...(typeInstance ? { type: typeInstance } : {}),\n ...(additionalOptions || {})\n };\n }\n\n /**\n * Universal pipeline validation.\n */\n public validate(): import(\"../../interfaces/IPlugin\").IPluginValidationResult {\n if (!this.control || !this.metadata) return { isValid: true };\n\n // Skip validation for hidden fields (e.g. hidden by ConditionEngine visibleOn)\n if (typeof (this.control as Control).getVisible === \"function\") {\n if (!(this.control as Control).getVisible()) {\n return { isValid: true };\n }\n }\n\n if (this.policyInvalidMessage) {\n return { isValid: false, errorMessage: this.policyInvalidMessage, fieldKey: this.fieldKey };\n }\n\n const validatorsToRun: string[] = [];\n const argsMap: Record<string, unknown> = {\n \"maxLength\": this.metadata.maxLength\n };\n\n const isRequired = this._isDynamicallyRequired !== undefined ? this._isDynamicallyRequired : this.metadata.required;\n if (isRequired) {\n validatorsToRun.push(\"required\");\n }\n if (this.metadata.maxLength) validatorsToRun.push(\"maxLength\");\n if (this.metadata.minLength) {\n validatorsToRun.push(\"minLength\");\n argsMap[\"minLength\"] = this.metadata.minLength;\n }\n if (this.metadata.pattern) {\n validatorsToRun.push(\"pattern\");\n argsMap[\"pattern\"] = this.metadata.pattern;\n }\n if (this.metadata.minimum !== undefined || this.metadata.maximum !== undefined) {\n validatorsToRun.push(\"range\");\n argsMap[\"range\"] = { min: this.metadata.minimum, max: this.metadata.maximum };\n }\n\n const format = this.metadata.ui?.format;\n if (format === \"email\" || format === \"url\" || format === \"iban\") {\n validatorsToRun.push(format);\n }\n\n if (this.metadata.ui?.validators) {\n for (const v of this.metadata.ui.validators) {\n if (typeof v === \"string\") {\n validatorsToRun.push(v);\n } else if (v && v.name) {\n validatorsToRun.push(v.name);\n if (v.args !== undefined) {\n argsMap[v.name] = v.args;\n }\n }\n }\n }\n\n if (validatorsToRun.length === 0) {\n return { isValid: true, errorMessage: undefined, fieldKey: this.fieldKey };\n }\n\n const val = this.getValue();\n const result = GlobalPipeline.executeValidation(val, validatorsToRun, argsMap);\n return { isValid: result.isValid, errorMessage: result.errorMessage, fieldKey: this.fieldKey, fieldLabel: this.metadata?.ui?.label };\n }\n\n /**\n * Natively manipulates the UI5 control's valueState if the control supports it.\n * Uses reflection to safely apply styles without crashing on structural controls.\n */\n public setVisualValidationState(isValid: boolean, errorMessage?: string): void {\n if (!this.control) return;\n\n\n // Use reflection to check if the control supports ValueState (e.g. sap.m.Input does, sap.m.Text does not)\n type StateControl = {\n setValueState?: (state: string) => void;\n setValueStateText?: (text: string) => void;\n };\n const ctrl = this.control as unknown as StateControl;\n if (typeof ctrl.setValueState === \"function\") {\n ctrl.setValueState(isValid ? coreLibrary.ValueState.None : coreLibrary.ValueState.Error);\n\n if (typeof ctrl.setValueStateText === \"function\") {\n ctrl.setValueStateText(isValid ? \"\" : (errorMessage || \"\"));\n }\n } else {\n // Quietly ignore. Controls like sap.m.Text natively do not support value states, which is completely valid.\n }\n }\n\n\n\n // --- IPluginStateReceiver Implementation for PBRE ---\n\n /**\n * Natively applies a forced error state from the PolicyEngine.\n * Per MetaUI Architecture Rule 12, this explicitly forces the visual state red \n * independently of the MessageManager auto-sync.\n * \n * @param errorMessage The custom error message to display.\n */\n public applyError(errorMessage: string): void {\n this.policyInvalidMessage = errorMessage;\n this.setVisualValidationState(false, errorMessage);\n }\n\n /**\n * Clears a previously forced error state.\n * Restores the visual boundary to standard (non-error) formatting.\n */\n public clearError(): void {\n this.policyInvalidMessage = null;\n this.setVisualValidationState(true);\n }\n\n /**\n * Dynamically manipulates the visibility state of the control based on PolicyEngine directives.\n * \n * @param isVisible True to display the control, false to hide it.\n */\n public applyVisibility(isVisible: boolean): void {\n const ctrl = this.control as unknown as { setVisible?: (b: boolean) => void };\n if (ctrl && typeof ctrl.setVisible === \"function\") {\n ctrl.setVisible(isVisible);\n }\n }\n\n /**\n * Dynamically alters the mandatory status of the field.\n * Updates internal transient state to ensure the `validate()` pipeline enforces the change,\n * and natively triggers the UI5 required indicator (asterisk) if supported,\n * without permanently corrupting the shared global schema definition.\n * \n * @param isRequired True to make the field mandatory, false to make it optional.\n */\n public applyRequired(isRequired: boolean): void {\n this._isDynamicallyRequired = isRequired;\n const ctrl = this.control as unknown as { setRequired?: (b: boolean) => void };\n if (ctrl && typeof ctrl.setRequired === \"function\") {\n ctrl.setRequired(isRequired);\n }\n }\n\n /**\n * Dynamically alters the editability of the field.\n * Falls back to `setEnabled` if the control is structural rather than purely input-driven.\n * \n * @param isEditable True to allow user input, false to lock it.\n */\n public applyEditable(isEditable: boolean): void {\n const ctrl = this.control as unknown as { setEditable?: (b: boolean) => void, setEnabled?: (b: boolean) => void };\n if (ctrl && typeof ctrl.setEditable === \"function\") {\n ctrl.setEditable(isEditable);\n } else if (ctrl && typeof ctrl.setEnabled === \"function\") {\n ctrl.setEnabled(isEditable);\n }\n }\n\n /**\n * Executes when the condition engine pushes new schema metadata to this field (e.g. readOnly changing).\n * @param newMetadata The mutated schema metadata.\n */\n public onStateChange(newMetadata: IPropertyMetadata): void {\n this.metadata = newMetadata;\n this.applyState();\n }\n\n /**\n * Abstract hook for the plugin to apply state changes to its specific UI5 control (e.g. placeholders, labels).\n */\n protected abstract applyState(): void;\n\n /**\n * Helper to apply common UI directives (like readOnly, visibleOn) directly to any control.\n */\n protected applyCommonDirectives(control: Control, metadata: IPropertyMetadata, modelName: string = \"meta\"): void {\n const ctrl = control as unknown as { setEditable?: (b: boolean) => void, setEnabled?: (b: boolean) => void };\n if (metadata.ui?.readOnly !== undefined && typeof ctrl.setEditable === \"function\") {\n ctrl.setEditable(!metadata.ui.readOnly);\n }\n\n if (metadata.ui?.visibleOn) {\n const ExpressionBuilder = sap.ui.require(\"nz/co/siliconst/ui5/metaui/utils/ExpressionBuilder\")?.ExpressionBuilder;\n let expr = \"\";\n if (ExpressionBuilder) {\n expr = ExpressionBuilder.build(metadata.ui.visibleOn, this.fieldKey, modelName);\n } else {\n expr = `{= ${metadata.ui.visibleOn.replace(/\\$root\\./g, `${modelName}>/`).replace(/\\./g, '/')} }`;\n }\n control.bindProperty(\"visible\", { parts: [{ path: \"meta>/\" }], formatter: () => false });\n control.bindProperty(\"visible\", expr);\n }\n\n if (metadata.ui?.enabledOn && typeof ctrl.setEnabled === \"function\") {\n const ExpressionBuilder = sap.ui.require(\"nz/co/siliconst/ui5/metaui/utils/ExpressionBuilder\")?.ExpressionBuilder;\n let expr = \"\";\n if (ExpressionBuilder) {\n expr = ExpressionBuilder.build(metadata.ui.enabledOn, this.fieldKey, modelName);\n } else {\n expr = `{= ${metadata.ui.enabledOn.replace(/\\$root\\./g, `${modelName}>/`).replace(/\\./g, '/')} }`;\n }\n control.bindProperty(\"enabled\", expr);\n }\n\n if (metadata.ui?.controlProps) {\n console.error(`[DEBUG MetaUI] controlProps found for ${this.fieldKey}`, metadata.ui.controlProps);\n const targetControl = this.mainControl || control;\n const target = targetControl as unknown as {\n getMetadata?: () => { getName(): string },\n applySettings?: (settings: Record<string, any>) => void,\n setProperty?: (p: string, v: unknown) => void,\n bindProperty?: (p: string, v: string) => void\n };\n\n if (typeof target.getMetadata === \"function\") {\n const targetMeta = target.getMetadata();\n const settings: Record<string, any> = {};\n for (const [propName, propValue] of Object.entries(metadata.ui.controlProps)) {\n if (this.BLOCKED_PROPS.includes(propName)) {\n Logger.warn(`[BasePlugin] Cannot apply controlProps '${propName}' for field '${this.fieldKey}' - ILLEGAL OVERRIDE (Property is protected by sandbox)`);\n continue;\n }\n \n // Natively block any aggregations or events to prevent sandbox escapes\n if (typeof (targetMeta as any).hasAggregation === \"function\" && (targetMeta as any).hasAggregation(propName)) {\n Logger.warn(`[BasePlugin] Cannot apply controlProps '${propName}' for field '${this.fieldKey}' - ILLEGAL OVERRIDE (Cannot hijack aggregations)`);\n continue;\n }\n \n if (typeof (targetMeta as any).hasEvent === \"function\" && (targetMeta as any).hasEvent(propName)) {\n Logger.warn(`[BasePlugin] Cannot apply controlProps '${propName}' for field '${this.fieldKey}' - ILLEGAL OVERRIDE (Cannot hijack events)`);\n continue;\n }\n\n if (typeof propValue === \"string\" && propValue.startsWith(\"{\") && propValue.endsWith(\"}\")) {\n // The JSON payloads often hardcode 'metaui>' in raw expression bindings, \n // but the Engine dynamically generates model names like 'metaUI_Host1'. \n // We must inject the actual modelName dynamically into the expression string.\n const injectedValue = propValue.replace(/metaui>/g, `${modelName}>`);\n settings[propName] = injectedValue;\n } else {\n settings[propName] = propValue;\n }\n }\n\n try {\n const target = targetControl as unknown as { applySettings?: (s: Record<string, any>) => void };\n if (typeof target.applySettings === \"function\") {\n target.applySettings(settings);\n }\n } catch (err: unknown) {\n Logger.warn(`[BasePlugin] Failed to apply controlProps for field '${this.fieldKey}' on control ${targetMeta.getName()}: ${(err as Error).message}`);\n }\n }\n }\n }\n\n\n\n /**\n * Natively destroys the instantiated UI5 control to prevent memory leaks.\n * Can be overridden by subclasses if they manage secondary controls or custom models.\n */\n public destroy(): void {\n if (this.control && typeof this.control.destroy === \"function\") {\n this.control.destroy();\n this.control = null;\n }\n }\n}\n"],"mappings":"qHAAA,MAQSA,EAAcC,EAAA,wBAEdC,EAAMC,EAAA,UASR,MAAeC,EAERC,QAA0B,KAM1BC,cAAgB,CAAC,QAAS,OAAQ,cAAe,WAAY,YAAa,WAAY,UAAW,UAAW,aAAc,iBAAkB,QAAS,UAAW,QAAS,eAAgB,SAAU,QAAS,SAAU,UAGtNC,SAAqC,KAGrCC,SAAmB,GAGnBC,UAAoB,OAGpBC,WAAsB,KAGtBC,kBAA6B,MAS7BC,qBAAsC,KASzCC,YAAYC,GACfC,KAAKL,WAAaI,CACtB,CAMOE,qBAAqBL,GACxBI,KAAKJ,kBAAoBA,CAC7B,CAkBUM,iBAAiBC,EAAmCC,GAC1D,IAAKD,EAAe,OAAOE,UAE3B,MAAMC,EAAWF,EAAYG,QAAQ,MAAO,IAAIA,QAAQ,MAAO,KAC/D,MAAO,GAAGJ,MAAkBG,GAChC,CAiBUE,oBAAoBJ,EAAqBV,EAAmBe,EAAwBC,GAC1F,MAAO,CACHC,KAAMP,EACNQ,MAAOlB,KACHe,EAAe,CAAEI,KAAMJ,GAAiB,CAAC,KACzCC,GAAqB,CAAC,EAElC,CAKOI,WACH,IAAKd,KAAKV,UAAYU,KAAKR,SAAU,MAAO,CAAEuB,QAAS,MAGvD,UAAYf,KAAKV,QAAoB0B,aAAe,WAAY,CAC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AAgB,WAAY,CAC1C,MAAMC,EAAaF,EAAOC,cAC1B,MAAME,EAAgC,CAAC,EACvC,IAAK,MAAOC,EAAUC,KAAcC,OAAOC,QAAQhG,EAASwC,GAAG4C,cAAe,CAC1E,GAAI5E,KAAKT,cAAckG,SAASJ,GAAW,CACvClG,EAAOuG,KAAK,2CAA2CL,iBAAwBrF,KAAKP,mEACpF,QACJ,CAGA,UAAY0F,EAAmBQ,iBAAmB,YAAeR,EAAmBQ,eAAeN,GAAW,CAC1GlG,EAAOuG,KAAK,2CAA2CL,iBAAwBrF,KAAKP,6DACpF,QACJ,CAEA,UAAY0F,EAAmBS,WAAa,YAAeT,EAAmBS,SAASP,GAAW,CAC9FlG,EAAOuG,KAAK,2CAA2CL,iBAAwBrF,KAAKP,uDACpF,QACJ,CAEA,UAAW6F,IAAc,UAAYA,EAAUO,WAAW,MAAQP,EAAUQ,SAAS,KAAM,CAIvF,MAAMC,EAAgBT,EAAU/E,QAAQ,WAAY,GAAGb,MACvD0F,EAASC,GAAYU,CACzB,KAAO,CACHX,EAASC,GAAYC,CACzB,CACJ,CAEA,IACI,MAAML,EAASF,EACf,UAAWE,EAAOe,gBAAkB,WAAY,CAC5Cf,EAAOe,cAAcZ,EACzB,CACJ,CAAE,MAAOa,GACL9G,EAAOuG,KAAK,wDAAwD1F,KAAKP,wBAAwB0F,EAAWe,cAAeD,EAAcE,UAC7I,CACJ,CACJ,CACJ,CAQOC,UACH,GAAIpG,KAAKV,gBAAkBU,KAAKV,QAAQ8G,UAAY,WAAY,CAC5DpG,KAAKV,QAAQ8G,UACbpG,KAAKV,QAAU,IACnB,CACJ,EACH,IAAA+G,EAAA,CAAAC,WAAA,MAAAD,EAAAhH,aAAA,OAAAgH,CAAA","ignoreList":[]}
1
+ {"version":3,"file":"BasePlugin.js","names":["GlobalPipeline","____core_PipelineManager","Logger","____utils_Logger","BasePlugin","control","BLOCKED_PROPS","metadata","fieldKey","modelName","isEditable","useMessageManager","policyInvalidMessage","setEditable","editable","this","getFieldLabel","ui","label","setUseMessageManager","generateStableId","engineScopeId","bindingPath","undefined","safePath","replace","generateBindingInfo","typeInstance","additionalOptions","path","model","type","validate","isValid","getVisible","errorMessage","validatorsToRun","argsMap","maxLength","isRequired","_isDynamicallyRequired","required","push","minLength","pattern","minimum","maximum","min","max","format","validators","v","name","args","length","val","getValue","result","executeValidation","fieldLabel","setVisualValidationState","ctrl","setValueState","coreLibrary","ValueState","None","Error","setValueStateText","applyError","clearError","applyVisibility","isVisible","setVisible","applyRequired","setRequired","applyEditable","setEnabled","onStateChange","newMetadata","applyState","applyCommonDirectives","readOnly","visibleOn","expr","bindProperty","parts","formatter","enabledOn","controlProps","debug","JSON","stringify","targetControl","mainControl","target","getMetadata","targetMeta","settings","propName","propValue","Object","entries","includes","warn","hasAggregation","hasEvent","startsWith","endsWith","injectedValue","applySettings","err","getName","message","destroy","__exports","__esModule"],"sources":["BasePlugin.ts"],"sourcesContent":["/**\n * @file BasePlugin.ts\n * @description Abstract foundation for all MetaUI plugins, enforcing lifecycle hooks for v2 Schema.\n */\n\nimport { IPlugin } from \"../../interfaces/IPlugin\";\nimport { IPropertyMetadata } from \"../../interfaces/ISchema\";\nimport Control from \"sap/ui/core/Control\";\nimport { GlobalPipeline } from \"../../core/PipelineManager\";\nimport * as coreLibrary from \"sap/ui/core/library\";\nimport { Logger } from \"../../utils/Logger\";\n\n/**\n * Abstract class representing a standard MetaUI Plugin.\n * Enforces the required rendering, state extraction, and validation contracts.\n * \n * @abstract\n * @public\n */\nexport abstract class BasePlugin implements IPlugin {\n /** The instantiated UI5 control for this plugin. */\n protected control: Control | null = null;\n\n /** Explicit reference to the core data widget when this plugin is wrapped in a layout. */\n protected mainControl?: Control;\n\n /** Properties strictly protected by the Sandbox engine. */\n protected BLOCKED_PROPS = [\"value\", \"text\", \"selectedKey\", \"selected\", \"dateValue\", \"editable\", \"enabled\", \"visible\", \"valueState\", \"valueStateText\", \"items\", \"content\", \"pages\", \"formElements\", \"change\", \"press\", \"select\", \"submit\"];\n\n /** The metadata schema defining the field rules. */\n protected metadata: IPropertyMetadata | null = null;\n\n /** The internal JSON path of the field relative to its parent payload. */\n protected fieldKey: string = \"\";\n\n /** The UI5 JSONModel name used for absolute binding paths. */\n protected modelName: string = \"meta\";\n\n /** Indicates if the engine is enforcing an editable mode. */\n protected isEditable: boolean = true;\n\n /** Indicates if the plugin should delegate visual validation to the MessageManager. */\n protected useMessageManager: boolean = false;\n\n /** Internal callback provided by GeneratorHost to signal validation/data changes upwards */\n protected onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void;\n\n /** \n * Tracks explicitly forced invalid states pushed down from the PolicyEngine.\n * When populated, this error takes absolute precedence over static SchemaValidator rules.\n */\n protected policyInvalidMessage: string | null = null;\n\n /** Transient state tracking for PBRE required evaluations to prevent schema clobbering */\n protected _isDynamicallyRequired?: boolean;\n\n /**\n * Injects the global editable mode context into the plugin before rendering.\n * @param editable True if the plugin should render in editable mode.\n */\n public setEditable(editable: boolean): void {\n this.isEditable = editable;\n }\n\n /**\n * Retrieves the human-readable label for the field from its metadata.\n */\n public getFieldLabel(): string | undefined {\n return this.metadata?.ui?.label || this.fieldKey;\n }\n\n /**\n * Injects the global MessageManager context into the plugin.\n * @param useMessageManager True if the MessageManager is handling validation visual states.\n */\n public setUseMessageManager(useMessageManager: boolean): void {\n this.useMessageManager = useMessageManager;\n }\n\n /**\n * Instantiates the raw UI5 control and binds it to the model.\n * \n * @param fieldMetadata The JSON Schema for the field.\n * @param bindingPath The JSON path to bind to.\n * @param modelName The UI5 model name.\n * @param engineScopeId The deterministic scope ID provided by the Engine to prevent cloning collisions.\n * @param onChange The callback fired natively when a field value blur/change occurs.\n * @returns {Control} The generated UI5 control.\n */\n public abstract render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName?: string, engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string, errorMessage?: string, controlId?: string) => void, model?: unknown): Control;\n\n /**\n * Generates a deterministic, globally unique ID for this control.\n * Prefixes the sanitized binding path with the Engine's scoped ID.\n */\n protected generateStableId(engineScopeId: string | undefined, bindingPath: string): string | undefined {\n if (!engineScopeId) return undefined;\n // Strip leading slash and replace internal slashes with hyphens\n const safePath = bindingPath.replace(/^\\//, '').replace(/\\//g, '-');\n return `${engineScopeId}--${safePath}`;\n }\n\n /**\n * Extracts the current raw value from the underlying UI5 control.\n */\n protected abstract getValue(): unknown;\n\n /**\n * Generates a standardized programmatic binding configuration object.\n * Ensures perfect architectural consistency across all plugins instead of relying on string parsing.\n * \n * @param bindingPath The relative or absolute path.\n * @param modelName The target model name.\n * @param typeInstance An optional UI5 Type instance (e.g. Integer, Float).\n * @param additionalOptions Optional extra configurations (e.g. formatOptions, constraints).\n * @returns A configuration object ready to be assigned to 'value', 'text', 'state', etc.\n */\n protected generateBindingInfo(bindingPath: string, modelName: string, typeInstance?: unknown, additionalOptions?: Record<string, unknown>): any {\n return {\n path: bindingPath,\n model: modelName,\n ...(typeInstance ? { type: typeInstance } : {}),\n ...(additionalOptions || {})\n };\n }\n\n /**\n * Universal pipeline validation.\n */\n public validate(): import(\"../../interfaces/IPlugin\").IPluginValidationResult {\n if (!this.control || !this.metadata) return { isValid: true };\n\n // Skip validation for hidden fields (e.g. hidden by ConditionEngine visibleOn)\n if (typeof (this.control as Control).getVisible === \"function\") {\n if (!(this.control as Control).getVisible()) {\n return { isValid: true };\n }\n }\n\n if (this.policyInvalidMessage) {\n return { isValid: false, errorMessage: this.policyInvalidMessage, fieldKey: this.fieldKey };\n }\n\n const validatorsToRun: string[] = [];\n const argsMap: Record<string, unknown> = {\n \"maxLength\": this.metadata.maxLength\n };\n\n const isRequired = this._isDynamicallyRequired !== undefined ? this._isDynamicallyRequired : this.metadata.required;\n if (isRequired) {\n validatorsToRun.push(\"required\");\n }\n if (this.metadata.maxLength) validatorsToRun.push(\"maxLength\");\n if (this.metadata.minLength) {\n validatorsToRun.push(\"minLength\");\n argsMap[\"minLength\"] = this.metadata.minLength;\n }\n if (this.metadata.pattern) {\n validatorsToRun.push(\"pattern\");\n argsMap[\"pattern\"] = this.metadata.pattern;\n }\n if (this.metadata.minimum !== undefined || this.metadata.maximum !== undefined) {\n validatorsToRun.push(\"range\");\n argsMap[\"range\"] = { min: this.metadata.minimum, max: this.metadata.maximum };\n }\n\n const format = this.metadata.ui?.format;\n if (format === \"email\" || format === \"url\" || format === \"iban\") {\n validatorsToRun.push(format);\n }\n\n if (this.metadata.ui?.validators) {\n for (const v of this.metadata.ui.validators) {\n if (typeof v === \"string\") {\n validatorsToRun.push(v);\n } else if (v && v.name) {\n validatorsToRun.push(v.name);\n if (v.args !== undefined) {\n argsMap[v.name] = v.args;\n }\n }\n }\n }\n\n if (validatorsToRun.length === 0) {\n return { isValid: true, errorMessage: undefined, fieldKey: this.fieldKey };\n }\n\n const val = this.getValue();\n const result = GlobalPipeline.executeValidation(val, validatorsToRun, argsMap);\n return { isValid: result.isValid, errorMessage: result.errorMessage, fieldKey: this.fieldKey, fieldLabel: this.metadata?.ui?.label };\n }\n\n /**\n * Natively manipulates the UI5 control's valueState if the control supports it.\n * Uses reflection to safely apply styles without crashing on structural controls.\n */\n public setVisualValidationState(isValid: boolean, errorMessage?: string): void {\n if (!this.control) return;\n\n\n // Use reflection to check if the control supports ValueState (e.g. sap.m.Input does, sap.m.Text does not)\n type StateControl = {\n setValueState?: (state: string) => void;\n setValueStateText?: (text: string) => void;\n };\n const ctrl = this.control as unknown as StateControl;\n if (typeof ctrl.setValueState === \"function\") {\n ctrl.setValueState(isValid ? coreLibrary.ValueState.None : coreLibrary.ValueState.Error);\n\n if (typeof ctrl.setValueStateText === \"function\") {\n ctrl.setValueStateText(isValid ? \"\" : (errorMessage || \"\"));\n }\n } else {\n // Quietly ignore. Controls like sap.m.Text natively do not support value states, which is completely valid.\n }\n }\n\n\n\n // --- IPluginStateReceiver Implementation for PBRE ---\n\n /**\n * Natively applies a forced error state from the PolicyEngine.\n * Per MetaUI Architecture Rule 12, this explicitly forces the visual state red \n * independently of the MessageManager auto-sync.\n * \n * @param errorMessage The custom error message to display.\n */\n public applyError(errorMessage: string): void {\n this.policyInvalidMessage = errorMessage;\n this.setVisualValidationState(false, errorMessage);\n }\n\n /**\n * Clears a previously forced error state.\n * Restores the visual boundary to standard (non-error) formatting.\n */\n public clearError(): void {\n this.policyInvalidMessage = null;\n this.setVisualValidationState(true);\n }\n\n /**\n * Dynamically manipulates the visibility state of the control based on PolicyEngine directives.\n * \n * @param isVisible True to display the control, false to hide it.\n */\n public applyVisibility(isVisible: boolean): void {\n const ctrl = this.control as unknown as { setVisible?: (b: boolean) => void };\n if (ctrl && typeof ctrl.setVisible === \"function\") {\n ctrl.setVisible(isVisible);\n }\n }\n\n /**\n * Dynamically alters the mandatory status of the field.\n * Updates internal transient state to ensure the `validate()` pipeline enforces the change,\n * and natively triggers the UI5 required indicator (asterisk) if supported,\n * without permanently corrupting the shared global schema definition.\n * \n * @param isRequired True to make the field mandatory, false to make it optional.\n */\n public applyRequired(isRequired: boolean): void {\n this._isDynamicallyRequired = isRequired;\n const ctrl = this.control as unknown as { setRequired?: (b: boolean) => void };\n if (ctrl && typeof ctrl.setRequired === \"function\") {\n ctrl.setRequired(isRequired);\n }\n }\n\n /**\n * Dynamically alters the editability of the field.\n * Falls back to `setEnabled` if the control is structural rather than purely input-driven.\n * \n * @param isEditable True to allow user input, false to lock it.\n */\n public applyEditable(isEditable: boolean): void {\n const ctrl = this.control as unknown as { setEditable?: (b: boolean) => void, setEnabled?: (b: boolean) => void };\n if (ctrl && typeof ctrl.setEditable === \"function\") {\n ctrl.setEditable(isEditable);\n } else if (ctrl && typeof ctrl.setEnabled === \"function\") {\n ctrl.setEnabled(isEditable);\n }\n }\n\n /**\n * Executes when the condition engine pushes new schema metadata to this field (e.g. readOnly changing).\n * @param newMetadata The mutated schema metadata.\n */\n public onStateChange(newMetadata: IPropertyMetadata): void {\n this.metadata = newMetadata;\n this.applyState();\n }\n\n /**\n * Abstract hook for the plugin to apply state changes to its specific UI5 control (e.g. placeholders, labels).\n */\n protected abstract applyState(): void;\n\n /**\n * Helper to apply common UI directives (like readOnly, visibleOn) directly to any control.\n */\n protected applyCommonDirectives(control: Control, metadata: IPropertyMetadata, modelName: string = \"meta\"): void {\n const ctrl = control as unknown as { setEditable?: (b: boolean) => void, setEnabled?: (b: boolean) => void };\n if (metadata.ui?.readOnly !== undefined && typeof ctrl.setEditable === \"function\") {\n ctrl.setEditable(!metadata.ui.readOnly);\n }\n\n if (metadata.ui?.visibleOn) {\n const expr = `{= ${metadata.ui.visibleOn.replace(/\\$root\\./g, `${modelName}>/`).replace(/\\./g, '/')} }`;\n control.bindProperty(\"visible\", { parts: [{ path: \"meta>/\" }], formatter: () => false });\n control.bindProperty(\"visible\", expr);\n }\n\n if (metadata.ui?.enabledOn && typeof ctrl.setEnabled === \"function\") {\n const expr = `{= ${metadata.ui.enabledOn.replace(/\\$root\\./g, `${modelName}>/`).replace(/\\./g, '/')} }`;\n control.bindProperty(\"enabled\", expr);\n }\n\n if (metadata.ui?.controlProps) {\n Logger.debug(`[BasePlugin] controlProps found for ${this.fieldKey}: ` + JSON.stringify(metadata.ui.controlProps), \"BasePlugin\");\n const targetControl = this.mainControl || control;\n const target = targetControl as unknown as {\n getMetadata?: () => { getName(): string },\n applySettings?: (settings: Record<string, any>) => void,\n setProperty?: (p: string, v: unknown) => void,\n bindProperty?: (p: string, v: string) => void\n };\n\n if (typeof target.getMetadata === \"function\") {\n const targetMeta = target.getMetadata();\n const settings: Record<string, any> = {};\n for (const [propName, propValue] of Object.entries(metadata.ui.controlProps)) {\n if (this.BLOCKED_PROPS.includes(propName)) {\n Logger.warn(`[BasePlugin] Cannot apply controlProps '${propName}' for field '${this.fieldKey}' - ILLEGAL OVERRIDE (Property is protected by sandbox)`);\n continue;\n }\n \n // Natively block any aggregations or events to prevent sandbox escapes\n if (typeof (targetMeta as any).hasAggregation === \"function\" && (targetMeta as any).hasAggregation(propName)) {\n Logger.warn(`[BasePlugin] Cannot apply controlProps '${propName}' for field '${this.fieldKey}' - ILLEGAL OVERRIDE (Cannot hijack aggregations)`);\n continue;\n }\n \n if (typeof (targetMeta as any).hasEvent === \"function\" && (targetMeta as any).hasEvent(propName)) {\n Logger.warn(`[BasePlugin] Cannot apply controlProps '${propName}' for field '${this.fieldKey}' - ILLEGAL OVERRIDE (Cannot hijack events)`);\n continue;\n }\n\n if (typeof propValue === \"string\" && propValue.startsWith(\"{\") && propValue.endsWith(\"}\")) {\n // The JSON payloads often hardcode 'metaui>' in raw expression bindings, \n // but the Engine dynamically generates model names like 'metaUI_Host1'. \n // We must inject the actual modelName dynamically into the expression string.\n const injectedValue = propValue.replace(/metaui>/g, `${modelName}>`);\n settings[propName] = injectedValue;\n } else {\n settings[propName] = propValue;\n }\n }\n\n try {\n const target = targetControl as unknown as { applySettings?: (s: Record<string, any>) => void };\n if (typeof target.applySettings === \"function\") {\n target.applySettings(settings);\n }\n } catch (err: unknown) {\n Logger.warn(`[BasePlugin] Failed to apply controlProps for field '${this.fieldKey}' on control ${targetMeta.getName()}: ${(err as Error).message}`);\n }\n }\n }\n }\n\n\n\n /**\n * Natively destroys the instantiated UI5 control to prevent memory leaks.\n * Can be overridden by subclasses if they manage secondary controls or custom models.\n */\n public destroy(): void {\n if (this.control && typeof this.control.destroy === \"function\") {\n this.control.destroy();\n this.control = null;\n }\n }\n}\n"],"mappings":"qHAAA,MAQSA,EAAcC,EAAA,wBAEdC,EAAMC,EAAA,UASR,MAAeC,EAERC,QAA0B,KAM1BC,cAAgB,CAAC,QAAS,OAAQ,cAAe,WAAY,YAAa,WAAY,UAAW,UAAW,aAAc,iBAAkB,QAAS,UAAW,QAAS,eAAgB,SAAU,QAAS,SAAU,UAGtNC,SAAqC,KAGrCC,SAAmB,GAGnBC,UAAoB,OAGpBC,WAAsB,KAGtBC,kBAA6B,MAS7BC,qBAAsC,KASzCC,YAAYC,GACfC,KAAKL,WAAaI,CACtB,CAKOE,gBACH,OAAOD,KAAKR,UAA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AA,OAAA8G,CAAA","ignoreList":[]}
@@ -62,6 +62,13 @@ export abstract class BasePlugin implements IPlugin {
62
62
  this.isEditable = editable;
63
63
  }
64
64
 
65
+ /**
66
+ * Retrieves the human-readable label for the field from its metadata.
67
+ */
68
+ public getFieldLabel(): string | undefined {
69
+ return this.metadata?.ui?.label || this.fieldKey;
70
+ }
71
+
65
72
  /**
66
73
  * Injects the global MessageManager context into the plugin.
67
74
  * @param useMessageManager True if the MessageManager is handling validation visual states.
@@ -301,30 +308,18 @@ export abstract class BasePlugin implements IPlugin {
301
308
  }
302
309
 
303
310
  if (metadata.ui?.visibleOn) {
304
- const ExpressionBuilder = sap.ui.require("nz/co/siliconst/ui5/metaui/utils/ExpressionBuilder")?.ExpressionBuilder;
305
- let expr = "";
306
- if (ExpressionBuilder) {
307
- expr = ExpressionBuilder.build(metadata.ui.visibleOn, this.fieldKey, modelName);
308
- } else {
309
- expr = `{= ${metadata.ui.visibleOn.replace(/\$root\./g, `${modelName}>/`).replace(/\./g, '/')} }`;
310
- }
311
+ const expr = `{= ${metadata.ui.visibleOn.replace(/\$root\./g, `${modelName}>/`).replace(/\./g, '/')} }`;
311
312
  control.bindProperty("visible", { parts: [{ path: "meta>/" }], formatter: () => false });
312
313
  control.bindProperty("visible", expr);
313
314
  }
314
315
 
315
316
  if (metadata.ui?.enabledOn && typeof ctrl.setEnabled === "function") {
316
- const ExpressionBuilder = sap.ui.require("nz/co/siliconst/ui5/metaui/utils/ExpressionBuilder")?.ExpressionBuilder;
317
- let expr = "";
318
- if (ExpressionBuilder) {
319
- expr = ExpressionBuilder.build(metadata.ui.enabledOn, this.fieldKey, modelName);
320
- } else {
321
- expr = `{= ${metadata.ui.enabledOn.replace(/\$root\./g, `${modelName}>/`).replace(/\./g, '/')} }`;
322
- }
317
+ const expr = `{= ${metadata.ui.enabledOn.replace(/\$root\./g, `${modelName}>/`).replace(/\./g, '/')} }`;
323
318
  control.bindProperty("enabled", expr);
324
319
  }
325
320
 
326
321
  if (metadata.ui?.controlProps) {
327
- console.error(`[DEBUG MetaUI] controlProps found for ${this.fieldKey}`, metadata.ui.controlProps);
322
+ Logger.debug(`[BasePlugin] controlProps found for ${this.fieldKey}: ` + JSON.stringify(metadata.ui.controlProps), "BasePlugin");
328
323
  const targetControl = this.mainControl || control;
329
324
  const target = targetControl as unknown as {
330
325
  getMetadata?: () => { getName(): string },