@siliconst/metaui 1.4.13 → 1.4.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/package.json +1 -1
  2. package/src/nz/co/siliconst/ui5/metaui/controls/DynamicHost-dbg.js +50 -3
  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 +1 -1
  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 +57 -4
  9. package/src/nz/co/siliconst/ui5/metaui/controls/host/GeneratorHost-dbg.js +44 -2
  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 +4 -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 +51 -4
  16. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate-dbg.js +42 -5
  17. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate-dbg.js.map +1 -1
  18. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.d.ts +9 -2
  19. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.d.ts.map +1 -1
  20. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.js +1 -1
  21. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.js.map +1 -1
  22. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/DialogDelegate.ts +44 -5
  23. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate-dbg.js.map +1 -1
  24. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.js.map +1 -1
  25. package/src/nz/co/siliconst/ui5/metaui/controls/host/delegates/ValidationDelegate.ts +2 -2
  26. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry-dbg.js +1 -0
  27. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry-dbg.js.map +1 -1
  28. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.d.ts.map +1 -1
  29. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.js +1 -1
  30. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.js.map +1 -1
  31. package/src/nz/co/siliconst/ui5/metaui/core/PluginRegistry.ts +1 -0
  32. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry-dbg.js +47 -0
  33. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry-dbg.js.map +1 -0
  34. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry.d.ts +23 -0
  35. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry.d.ts.map +1 -0
  36. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry.js +2 -0
  37. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry.js.map +1 -0
  38. package/src/nz/co/siliconst/ui5/metaui/core/SchemaBuilderRegistry.ts +45 -0
  39. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js +17 -0
  40. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer-dbg.js.map +1 -1
  41. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.d.ts +10 -1
  42. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.d.ts.map +1 -1
  43. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.js +1 -1
  44. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.js.map +1 -1
  45. package/src/nz/co/siliconst/ui5/metaui/core/SchemaNormalizer.ts +19 -1
  46. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema-dbg.js.map +1 -1
  47. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts +7 -0
  48. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.d.ts.map +1 -1
  49. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchema.ts +9 -0
  50. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin-dbg.js +2 -0
  51. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin-dbg.js.map +1 -0
  52. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin.d.ts +23 -0
  53. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin.d.ts.map +1 -0
  54. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin.js +2 -0
  55. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin.js.map +1 -0
  56. package/src/nz/co/siliconst/ui5/metaui/interfaces/ISchemaBuilderPlugin.ts +23 -0
  57. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js +6 -1
  58. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout-dbg.js.map +1 -1
  59. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.d.ts.map +1 -1
  60. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js +1 -1
  61. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.js.map +1 -1
  62. package/src/nz/co/siliconst/ui5/metaui/layouts/FormLayout.ts +6 -1
  63. package/src/nz/co/siliconst/ui5/metaui/library-preload.js +29 -20
  64. package/src/nz/co/siliconst/ui5/metaui/library-preload.js.map +1 -1
  65. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin-dbg.js +3 -20
  66. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin-dbg.js.map +1 -1
  67. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.d.ts.map +1 -1
  68. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.js +1 -1
  69. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.js.map +1 -1
  70. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.ts +3 -3
  71. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin-dbg.js +1 -0
  72. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin-dbg.js.map +1 -1
  73. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.d.ts.map +1 -1
  74. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.js +1 -1
  75. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.js.map +1 -1
  76. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.ts +1 -0
  77. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin-dbg.js +1 -0
  78. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin-dbg.js.map +1 -1
  79. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.d.ts.map +1 -1
  80. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.js +1 -1
  81. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.js.map +1 -1
  82. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.ts +1 -0
  83. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin-dbg.js +1 -0
  84. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin-dbg.js.map +1 -1
  85. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.d.ts.map +1 -1
  86. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.js +1 -1
  87. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.js.map +1 -1
  88. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.ts +1 -0
  89. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin-dbg.js +1 -0
  90. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin-dbg.js.map +1 -1
  91. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.d.ts.map +1 -1
  92. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.js +1 -1
  93. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.js.map +1 -1
  94. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/DropdownPlugin.ts +1 -0
  95. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin-dbg.js +1 -0
  96. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin-dbg.js.map +1 -1
  97. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.d.ts.map +1 -1
  98. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.js +1 -1
  99. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.js.map +1 -1
  100. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/FileUploaderPlugin.ts +1 -0
  101. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin-dbg.js +1 -0
  102. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin-dbg.js.map +1 -1
  103. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin.d.ts.map +1 -1
  104. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin.js +1 -1
  105. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin.js.map +1 -1
  106. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MessageStripPlugin.ts +1 -0
  107. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin-dbg.js +30 -17
  108. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin-dbg.js.map +1 -1
  109. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.d.ts.map +1 -1
  110. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.js +1 -1
  111. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.js.map +1 -1
  112. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiInputPlugin.ts +33 -15
  113. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin-dbg.js +1 -0
  114. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin-dbg.js.map +1 -1
  115. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.d.ts.map +1 -1
  116. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.js +1 -1
  117. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.js.map +1 -1
  118. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/MultiSelectPlugin.ts +1 -0
  119. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin-dbg.js +35 -11
  120. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin-dbg.js.map +1 -1
  121. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.d.ts +4 -4
  122. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.d.ts.map +1 -1
  123. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.js +1 -1
  124. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.js.map +1 -1
  125. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/NumberPlugin.ts +38 -14
  126. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin-dbg.js +1 -0
  127. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin-dbg.js.map +1 -1
  128. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.d.ts.map +1 -1
  129. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.js +1 -1
  130. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.js.map +1 -1
  131. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/RatingIndicatorPlugin.ts +1 -0
  132. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin-dbg.js +1 -0
  133. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin-dbg.js.map +1 -1
  134. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.d.ts.map +1 -1
  135. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.js +1 -1
  136. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.js.map +1 -1
  137. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SliderPlugin.ts +1 -0
  138. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin-dbg.js +79 -0
  139. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin-dbg.js.map +1 -0
  140. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.d.ts +35 -0
  141. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.d.ts.map +1 -0
  142. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.js +2 -0
  143. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.js.map +1 -0
  144. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/StepInputPlugin.ts +80 -0
  145. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin-dbg.js +1 -0
  146. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin-dbg.js.map +1 -1
  147. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.d.ts.map +1 -1
  148. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.js +1 -1
  149. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.js.map +1 -1
  150. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/SwitchPlugin.ts +1 -0
  151. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin-dbg.js +1 -0
  152. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin-dbg.js.map +1 -1
  153. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.d.ts.map +1 -1
  154. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.js +1 -1
  155. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.js.map +1 -1
  156. package/src/nz/co/siliconst/ui5/metaui/plugins/controls/TimePlugin.ts +1 -0
  157. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder-dbg.js +226 -0
  158. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder-dbg.js.map +1 -0
  159. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder.d.ts +63 -0
  160. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder.d.ts.map +1 -0
  161. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder.js +2 -0
  162. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder.js.map +1 -0
  163. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerBuilder.ts +233 -0
  164. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver-dbg.js +43 -0
  165. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver-dbg.js.map +1 -0
  166. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver.d.ts +15 -0
  167. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver.d.ts.map +1 -0
  168. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver.js +2 -0
  169. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver.js.map +1 -0
  170. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerRefResolver.ts +37 -0
  171. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper-dbg.js +37 -0
  172. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper-dbg.js.map +1 -0
  173. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper.d.ts +18 -0
  174. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper.d.ts.map +1 -0
  175. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper.js +2 -0
  176. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper.js.map +1 -0
  177. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerTypeMapper.ts +28 -0
  178. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper-dbg.js +84 -0
  179. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper-dbg.js.map +1 -0
  180. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper.d.ts +27 -0
  181. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper.d.ts.map +1 -0
  182. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper.js +2 -0
  183. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper.js.map +1 -0
  184. package/src/nz/co/siliconst/ui5/metaui/swagger/SwaggerUIMapper.ts +80 -0
@@ -1,28 +1,12 @@
1
- sap.ui.define(["../../core/PipelineManager", "sap/ui/core/library"], function (____core_PipelineManager, coreLibrary) {
1
+ sap.ui.define(["../../core/PipelineManager", "sap/ui/core/library", "../../utils/Logger"], function (____core_PipelineManager, coreLibrary, ____utils_Logger) {
2
2
  "use strict";
3
3
 
4
- function __ui5_require_async(path) {
5
- return new Promise(function (resolve, reject) {
6
- sap.ui.require([path], function (module) {
7
- if (!(module && module.__esModule)) {
8
- module = module === null || !(typeof module === "object" && path.endsWith("/library")) ? {
9
- default: module
10
- } : module;
11
- Object.defineProperty(module, "__esModule", {
12
- value: true
13
- });
14
- }
15
- resolve(module);
16
- }, function (err) {
17
- reject(err);
18
- });
19
- });
20
- }
21
4
  /**
22
5
  * @file BasePlugin.ts
23
6
  * @description Abstract foundation for all MetaUI plugins, enforcing lifecycle hooks for v2 Schema.
24
7
  */
25
8
  const GlobalPipeline = ____core_PipelineManager["GlobalPipeline"];
9
+ const Logger = ____utils_Logger["Logger"];
26
10
  /**
27
11
  * Abstract class representing a standard MetaUI Plugin.
28
12
  * Enforces the required rendering, state extraction, and validation contracts.
@@ -170,7 +154,6 @@ sap.ui.define(["../../core/PipelineManager", "sap/ui/core/library"], function (_
170
154
  */
171
155
  setVisualValidationState(isValid, errorMessage) {
172
156
  if (!this.control) return;
173
- __ui5_require_async("../../utils/Logger").then(m => m.Logger.error("[MetaUI]", `setVisualValidationState called on plugin: ${this.fieldKey}, isValid: ${isValid}`, "BasePlugin"));
174
157
 
175
158
  // Use reflection to check if the control supports ValueState (e.g. sap.m.Input does, sap.m.Text does not)
176
159
  if (typeof this.control.setValueState === "function") {
@@ -179,7 +162,7 @@ sap.ui.define(["../../core/PipelineManager", "sap/ui/core/library"], function (_
179
162
  this.control.setValueStateText(isValid ? "" : errorMessage || "");
180
163
  }
181
164
  } else {
182
- __ui5_require_async("../../utils/Logger").then(m => m.Logger.error("[MetaUI]", `Plugin ${this.fieldKey} has no setValueState function!`, "BasePlugin"));
165
+ Logger.error("[MetaUI]", `Plugin ${this.fieldKey} has no setValueState function!`, "BasePlugin");
183
166
  }
184
167
  }
185
168
 
@@ -1 +1 @@
1
- {"version":3,"file":"BasePlugin-dbg.js","names":["GlobalPipeline","____core_PipelineManager","BasePlugin","control","metadata","fieldKey","modelName","isEditable","useMessageManager","setEditable","editable","setUseMessageManager","generateStableId","engineScopeId","bindingPath","undefined","safePath","replace","validate","isValid","getVisible","validatorsToRun","argsMap","maxLength","required","push","minLength","pattern","minimum","maximum","min","max","format","ui","validators","v","name","args","length","errorMessage","val","getValue","result","executeValidation","setVisualValidationState","__ui5_require_async","then","m","Logger","error","setValueState","coreLibrary","ValueState","None","Error","setValueStateText","validateAndApplyVisualState","onStateChange","newMetadata","applyState","applyCommonDirectives","readOnly","visibleOn","ExpressionBuilder","sap","require","expr","build","bindProperty","parts","path","formatter","enabledOn","setEnabled","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 coreLibrary from \"sap/ui/core/library\";\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 /** 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 * 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) => void): 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 * 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 const validatorsToRun: string[] = [];\n const argsMap: Record<string, unknown> = {\n \"maxLength\": this.metadata.maxLength\n };\n\n if (this.metadata.required) {\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 };\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 import(\"../../utils/Logger\").then(m => m.Logger.error(\"[MetaUI]\", `setVisualValidationState called on plugin: ${this.fieldKey}, isValid: ${isValid}`, \"BasePlugin\"));\n\n // Use reflection to check if the control supports ValueState (e.g. sap.m.Input does, sap.m.Text does not)\n if (typeof (this.control as any).setValueState === \"function\") {\n (this.control as any).setValueState(isValid ? coreLibrary.ValueState.None : coreLibrary.ValueState.Error);\n \n if (typeof (this.control as any).setValueStateText === \"function\") {\n (this.control as any).setValueStateText(isValid ? \"\" : (errorMessage || \"\"));\n }\n } else {\n import(\"../../utils/Logger\").then(m => m.Logger.error(\"[MetaUI]\", `Plugin ${this.fieldKey} has no setValueState function!`, \"BasePlugin\"));\n }\n }\n\n /**\n * Wraps standard validation and immediately applies the visual state.\n * Ideal for 'change' events to instantly turn fields red on blur.\n */\n protected validateAndApplyVisualState(): import(\"../../interfaces/IPlugin\").IPluginValidationResult {\n const result = this.validate();\n this.setVisualValidationState(result.isValid, result.errorMessage);\n return result;\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 if (metadata.ui?.readOnly !== undefined && typeof control.setEditable === \"function\") {\n control.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 control.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\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;EAGvB;AACA;AACA;AACA;AACA;AACA;AACA;EACO,MAAeC,UAAU,CAAoB;IAChD;IACUC,OAAO,GAAmB,IAAI;;IAExC;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;IACWC,WAAWA,CAACC,QAAiB,EAAQ;MACxC,IAAI,CAACH,UAAU,GAAGG,QAAQ;IAC9B;;IAEA;AACJ;AACA;AACA;IACWC,oBAAoBA,CAACH,iBAA0B,EAAQ;MAC1D,IAAI,CAACA,iBAAiB,GAAGA,iBAAiB;IAC9C;;IAEA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;IAGI;AACJ;AACA;AACA;IACcI,gBAAgBA,CAACC,aAAiC,EAAEC,WAAmB,EAAsB;MACnG,IAAI,CAACD,aAAa,EAAE,OAAOE,SAAS;MACpC;MACA,MAAMC,QAAQ,GAAGF,WAAW,CAACG,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAACA,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;MACnE,OAAO,GAAGJ,aAAa,KAAKG,QAAQ,EAAE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AC6B,EAAE,EAAEuC,SAAS,IAAI,OAAOrE,OAAO,CAACsE,UAAU,KAAK,UAAU,EAAE;QACpE,MAAMV,iBAAiB,GAAGC,GAAG,CAAC/B,EAAE,CAACgC,OAAO,CAAC,oDAAoD,CAAC,EAAEF,iBAAiB;QACjH,IAAIG,IAAI,GAAG,EAAE;QACb,IAAIH,iBAAiB,EAAE;UACnBG,IAAI,GAAGH,iBAAiB,CAACI,KAAK,CAAC/D,QAAQ,CAAC6B,EAAE,CAACuC,SAAS,EAAE,IAAI,CAACnE,QAAQ,EAAEC,SAAS,CAAC;QACnF,CAAC,MAAM;UACH4D,IAAI,GAAG,MAAM9D,QAAQ,CAAC6B,EAAE,CAACuC,SAAS,CAACvD,OAAO,CAAC,WAAW,EAAE,GAAGX,SAAS,IAAI,CAAC,CAACW,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI;QACrG;QACAd,OAAO,CAACiE,YAAY,CAAC,SAAS,EAAEF,IAAI,CAAC;MACzC;IACJ;;IAIA;AACJ;AACA;AACA;IACWQ,OAAOA,CAAA,EAAS;MACnB,IAAI,IAAI,CAACvE,OAAO,IAAI,OAAO,IAAI,CAACA,OAAO,CAACuE,OAAO,KAAK,UAAU,EAAE;QAC5D,IAAI,CAACvE,OAAO,CAACuE,OAAO,CAAC,CAAC;QACtB,IAAI,CAACvE,OAAO,GAAG,IAAI;MACvB;IACJ;EACJ;EAAC,IAAAwE,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAAzE,UAAA,GAAAA,UAAA;EAAA,OAAAyE,SAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"BasePlugin-dbg.js","names":["GlobalPipeline","____core_PipelineManager","Logger","____utils_Logger","BasePlugin","control","metadata","fieldKey","modelName","isEditable","useMessageManager","setEditable","editable","setUseMessageManager","generateStableId","engineScopeId","bindingPath","undefined","safePath","replace","validate","isValid","getVisible","validatorsToRun","argsMap","maxLength","required","push","minLength","pattern","minimum","maximum","min","max","format","ui","validators","v","name","args","length","errorMessage","val","getValue","result","executeValidation","setVisualValidationState","setValueState","coreLibrary","ValueState","None","Error","setValueStateText","error","validateAndApplyVisualState","onStateChange","newMetadata","applyState","applyCommonDirectives","readOnly","visibleOn","ExpressionBuilder","sap","require","expr","build","bindProperty","parts","path","formatter","enabledOn","setEnabled","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 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 /** 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 * 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) => void): 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 * 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 const validatorsToRun: string[] = [];\n const argsMap: Record<string, unknown> = {\n \"maxLength\": this.metadata.maxLength\n };\n\n if (this.metadata.required) {\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 };\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 if (typeof (this.control as any).setValueState === \"function\") {\n (this.control as any).setValueState(isValid ? coreLibrary.ValueState.None : coreLibrary.ValueState.Error);\n \n if (typeof (this.control as any).setValueStateText === \"function\") {\n (this.control as any).setValueStateText(isValid ? \"\" : (errorMessage || \"\"));\n }\n } else {\n Logger.error(\"[MetaUI]\", `Plugin ${this.fieldKey} has no setValueState function!`, \"BasePlugin\");\n }\n }\n\n /**\n * Wraps standard validation and immediately applies the visual state.\n * Ideal for 'change' events to instantly turn fields red on blur.\n */\n protected validateAndApplyVisualState(): import(\"../../interfaces/IPlugin\").IPluginValidationResult {\n const result = this.validate();\n this.setVisualValidationState(result.isValid, result.errorMessage);\n return result;\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 if (metadata.ui?.readOnly !== undefined && typeof control.setEditable === \"function\") {\n control.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 control.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\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;IA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AACmE,OAAO,KAAK,UAAU,EAAE;QAC5D,IAAI,CAACnE,OAAO,CAACmE,OAAO,CAAC,CAAC;QACtB,IAAI,CAACnE,OAAO,GAAG,IAAI;MACvB;IACJ;EACJ;EAAC,IAAAoE,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAArE,UAAA,GAAAA,UAAA;EAAA,OAAAqE,SAAA;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"BasePlugin.d.ts","sourceRoot":"../../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/plugins/controls/BasePlugin.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,wDAAwD,CAAC;IACxE;;;OAGG;IAEH,OAAO,EAAE,OAAO,EAAE,MAAM,+CAA+C,CAAC;IACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;IAClF,OAAO,OAAO,MAAM,qBAAqB,CAAC;IAI1C;;;;;;OAMG;IACH,eAAsB,UAAW,YAAW,OAAO;QAC/C,oDAAoD;QACpD,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAQ;QAEzC,oDAAoD;QACpD,SAAS,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAQ;QAEpD,0EAA0E;QAC1E,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAM;QAEhC,8DAA8D;QAC9D,SAAS,CAAC,SAAS,EAAE,MAAM,CAAU;QAErC,6DAA6D;QAC7D,SAAS,CAAC,UAAU,EAAE,OAAO,CAAQ;QAErC,uFAAuF;QACvF,SAAS,CAAC,iBAAiB,EAAE,OAAO,CAAS;QAE7C,4FAA4F;QAC5F,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;QAE9G;;;WAGG;QACI,WAAW,CAAC,QAAQ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,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;QAOtG;;WAEG;QACH,SAAS,CAAC,QAAQ,CAAC,QAAQ,IAAI,OAAO;QAEtC;;WAEG;QACI,QAAQ,IAAI,OAAO,+CAA+C,EAAE,uBAAuB;QA2DlG;;;WAGG;QACI,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI;QAgB9E;;;WAGG;QACH,SAAS,CAAC,2BAA2B,IAAI,OAAO,+CAA+C,EAAE,uBAAuB;QAMxH;;;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;QA+BhH;;;WAGG;QACI,OAAO,IAAI,IAAI;KAMzB;CAEA"}
@@ -1,2 +1,2 @@
1
- sap.ui.define(["../../core/PipelineManager","sap/ui/core/library"],function(e,t){"use strict";function i(e){return new Promise(function(t,i){sap.ui.require([e],function(i){if(!(i&&i.__esModule)){i=i===null||!(typeof i==="object"&&e.endsWith("/library"))?{default:i}:i;Object.defineProperty(i,"__esModule",{value:true})}t(i)},function(e){i(e)})})}const a=e["GlobalPipeline"];class s{control=null;metadata=null;fieldKey="";modelName="meta";isEditable=true;useMessageManager=false;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}`}validate(){if(!this.control||!this.metadata)return{isValid:true};if(typeof this.control.getVisible==="function"){if(!this.control.getVisible()){return{isValid:true}}}const e=[];const t={maxLength:this.metadata.maxLength};if(this.metadata.required){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 i=this.metadata.ui?.format;if(i==="email"||i==="url"||i==="iban"){e.push(i)}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 n=a.executeValidation(s,e,t);return{isValid:n.isValid,errorMessage:n.errorMessage,fieldKey:this.fieldKey}}setVisualValidationState(e,a){if(!this.control)return;i("../../utils/Logger").then(t=>t.Logger.error("[MetaUI]",`setVisualValidationState called on plugin: ${this.fieldKey}, isValid: ${e}`,"BasePlugin"));if(typeof this.control.setValueState==="function"){this.control.setValueState(e?t.ValueState.None:t.ValueState.Error);if(typeof this.control.setValueStateText==="function"){this.control.setValueStateText(e?"":a||"")}}else{i("../../utils/Logger").then(e=>e.Logger.error("[MetaUI]",`Plugin ${this.fieldKey} has no setValueState function!`,"BasePlugin"))}}validateAndApplyVisualState(){const e=this.validate();this.setVisualValidationState(e.isValid,e.errorMessage);return e}onStateChange(e){this.metadata=e;this.applyState()}applyCommonDirectives(e,t,i="meta"){if(t.ui?.readOnly!==undefined&&typeof e.setEditable==="function"){e.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 e.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)}}destroy(){if(this.control&&typeof this.control.destroy==="function"){this.control.destroy();this.control=null}}}var n={__esModule:true};n.BasePlugin=s;return n});
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;metadata=null;fieldKey="";modelName="meta";isEditable=true;useMessageManager=false;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}`}validate(){if(!this.control||!this.metadata)return{isValid:true};if(typeof this.control.getVisible==="function"){if(!this.control.getVisible()){return{isValid:true}}}const e=[];const t={maxLength:this.metadata.maxLength};if(this.metadata.required){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 i=this.metadata.ui?.format;if(i==="email"||i==="url"||i==="iban"){e.push(i)}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 n=a.executeValidation(s,e,t);return{isValid:n.isValid,errorMessage:n.errorMessage,fieldKey:this.fieldKey}}setVisualValidationState(e,i){if(!this.control)return;if(typeof this.control.setValueState==="function"){this.control.setValueState(e?t.ValueState.None:t.ValueState.Error);if(typeof this.control.setValueStateText==="function"){this.control.setValueStateText(e?"":i||"")}}else{s.error("[MetaUI]",`Plugin ${this.fieldKey} has no setValueState function!`,"BasePlugin")}}validateAndApplyVisualState(){const e=this.validate();this.setVisualValidationState(e.isValid,e.errorMessage);return e}onStateChange(e){this.metadata=e;this.applyState()}applyCommonDirectives(e,t,i="meta"){if(t.ui?.readOnly!==undefined&&typeof e.setEditable==="function"){e.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 e.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)}}destroy(){if(this.control&&typeof this.control.destroy==="function"){this.control.destroy();this.control=null}}}var r={__esModule:true};r.BasePlugin=n;return r});
2
2
  //# sourceMappingURL=BasePlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BasePlugin.js","names":["GlobalPipeline","____core_PipelineManager","BasePlugin","control","metadata","fieldKey","modelName","isEditable","useMessageManager","setEditable","editable","this","setUseMessageManager","generateStableId","engineScopeId","bindingPath","undefined","safePath","replace","validate","isValid","getVisible","validatorsToRun","argsMap","maxLength","required","push","minLength","pattern","minimum","maximum","min","max","format","ui","validators","v","name","args","length","errorMessage","val","getValue","result","executeValidation","setVisualValidationState","__ui5_require_async","then","m","Logger","error","setValueState","coreLibrary","ValueState","None","Error","setValueStateText","validateAndApplyVisualState","onStateChange","newMetadata","applyState","applyCommonDirectives","readOnly","visibleOn","ExpressionBuilder","sap","require","expr","build","bindProperty","parts","path","formatter","enabledOn","setEnabled","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 coreLibrary from \"sap/ui/core/library\";\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 /** 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 * 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) => void): 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 * 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 const validatorsToRun: string[] = [];\n const argsMap: Record<string, unknown> = {\n \"maxLength\": this.metadata.maxLength\n };\n\n if (this.metadata.required) {\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 };\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 import(\"../../utils/Logger\").then(m => m.Logger.error(\"[MetaUI]\", `setVisualValidationState called on plugin: ${this.fieldKey}, isValid: ${isValid}`, \"BasePlugin\"));\n\n // Use reflection to check if the control supports ValueState (e.g. sap.m.Input does, sap.m.Text does not)\n if (typeof (this.control as any).setValueState === \"function\") {\n (this.control as any).setValueState(isValid ? coreLibrary.ValueState.None : coreLibrary.ValueState.Error);\n \n if (typeof (this.control as any).setValueStateText === \"function\") {\n (this.control as any).setValueStateText(isValid ? \"\" : (errorMessage || \"\"));\n }\n } else {\n import(\"../../utils/Logger\").then(m => m.Logger.error(\"[MetaUI]\", `Plugin ${this.fieldKey} has no setValueState function!`, \"BasePlugin\"));\n }\n }\n\n /**\n * Wraps standard validation and immediately applies the visual state.\n * Ideal for 'change' events to instantly turn fields red on blur.\n */\n protected validateAndApplyVisualState(): import(\"../../interfaces/IPlugin\").IPluginValidationResult {\n const result = this.validate();\n this.setVisualValidationState(result.isValid, result.errorMessage);\n return result;\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 if (metadata.ui?.readOnly !== undefined && typeof control.setEditable === \"function\") {\n control.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 control.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\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":"0VAAA,MAQSA,EAAcC,EAAA,kBAUhB,MAAeC,EAERC,QAA0B,KAG1BC,SAAqC,KAGrCC,SAAmB,GAGnBC,UAAoB,OAGpBC,WAAsB,KAGtBC,kBAA6B,MAShCC,YAA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AgB,WAAY,CAClFN,EAAQM,aAAaL,EAAS8B,GAAG4B,SACrC,CAEA,GAAI1D,EAAS8B,IAAI6B,UAAW,CACxB,MAAMC,EAAoBC,IAAI/B,GAAGgC,QAAQ,uDAAuDF,kBAChG,IAAIG,EAAO,GACX,GAAIH,EAAmB,CACnBG,EAAOH,EAAkBI,MAAMhE,EAAS8B,GAAG6B,UAAWpD,KAAKN,SAAUC,EACzE,KAAO,CACH6D,EAAO,MAAM/D,EAAS8B,GAAG6B,UAAU7C,QAAQ,YAAa,GAAGZ,OAAeY,QAAQ,MAAO,QAC7F,CACAf,EAAQkE,aAAa,UAAW,CAAEC,MAAO,CAAC,CAAEC,KAAM,WAAaC,UAAWA,IAAM,QAChFrE,EAAQkE,aAAa,UAAWF,EACpC,CAEA,GAAI/D,EAAS8B,IAAIuC,kBAAoBtE,EAAQuE,aAAe,WAAY,CACpE,MAAMV,EAAoBC,IAAI/B,GAAGgC,QAAQ,uDAAuDF,kBAChG,IAAIG,EAAO,GACX,GAAIH,EAAmB,CACnBG,EAAOH,EAAkBI,MAAMhE,EAAS8B,GAAGuC,UAAW9D,KAAKN,SAAUC,EACzE,KAAO,CACH6D,EAAO,MAAM/D,EAAS8B,GAAGuC,UAAUvD,QAAQ,YAAa,GAAGZ,OAAeY,QAAQ,MAAO,QAC7F,CACAf,EAAQkE,aAAa,UAAWF,EACpC,CACJ,CAQOQ,UACH,GAAIhE,KAAKR,gBAAkBQ,KAAKR,QAAQwE,UAAY,WAAY,CAC5DhE,KAAKR,QAAQwE,UACbhE,KAAKR,QAAU,IACnB,CACJ,EACH,IAAAyE,EAAA,CAAAC,WAAA,MAAAD,EAAA1E,aAAA,OAAA0E,CAAA","ignoreList":[]}
1
+ {"version":3,"file":"BasePlugin.js","names":["GlobalPipeline","____core_PipelineManager","Logger","____utils_Logger","BasePlugin","control","metadata","fieldKey","modelName","isEditable","useMessageManager","setEditable","editable","this","setUseMessageManager","generateStableId","engineScopeId","bindingPath","undefined","safePath","replace","validate","isValid","getVisible","validatorsToRun","argsMap","maxLength","required","push","minLength","pattern","minimum","maximum","min","max","format","ui","validators","v","name","args","length","errorMessage","val","getValue","result","executeValidation","setVisualValidationState","setValueState","coreLibrary","ValueState","None","Error","setValueStateText","error","validateAndApplyVisualState","onStateChange","newMetadata","applyState","applyCommonDirectives","readOnly","visibleOn","ExpressionBuilder","sap","require","expr","build","bindProperty","parts","path","formatter","enabledOn","setEnabled","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 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 /** 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 * 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) => void): 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 * 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 const validatorsToRun: string[] = [];\n const argsMap: Record<string, unknown> = {\n \"maxLength\": this.metadata.maxLength\n };\n\n if (this.metadata.required) {\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 };\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 if (typeof (this.control as any).setValueState === \"function\") {\n (this.control as any).setValueState(isValid ? coreLibrary.ValueState.None : coreLibrary.ValueState.Error);\n \n if (typeof (this.control as any).setValueStateText === \"function\") {\n (this.control as any).setValueStateText(isValid ? \"\" : (errorMessage || \"\"));\n }\n } else {\n Logger.error(\"[MetaUI]\", `Plugin ${this.fieldKey} has no setValueState function!`, \"BasePlugin\");\n }\n }\n\n /**\n * Wraps standard validation and immediately applies the visual state.\n * Ideal for 'change' events to instantly turn fields red on blur.\n */\n protected validateAndApplyVisualState(): import(\"../../interfaces/IPlugin\").IPluginValidationResult {\n const result = this.validate();\n this.setVisualValidationState(result.isValid, result.errorMessage);\n return result;\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 if (metadata.ui?.readOnly !== undefined && typeof control.setEditable === \"function\") {\n control.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 control.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\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,KAG1BC,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,CAEA,GAAItD,EAAS8B,IAAIyB,UAAW,CACxB,MAAMC,EAAoBC,IAAI3B,GAAG4B,QAAQ,uDAAuDF,kBAChG,IAAIG,EAAO,GACX,GAAIH,EAAmB,CACnBG,EAAOH,EAAkBI,MAAM5D,EAAS8B,GAAGyB,UAAWhD,KAAKN,SAAUC,EACzE,KAAO,CACHyD,EAAO,MAAM3D,EAAS8B,GAAGyB,UAAUzC,QAAQ,YAAa,GAAGZ,OAAeY,QAAQ,MAAO,QAC7F,CACAf,EAAQ8D,aAAa,UAAW,CAAEC,MAAO,CAAC,CAAEC,KAAM,WAAaC,UAAWA,IAAM,QAChFjE,EAAQ8D,aAAa,UAAWF,EACpC,CAEA,GAAI3D,EAAS8B,IAAImC,kBAAoBlE,EAAQmE,aAAe,WAAY,CACpE,MAAMV,EAAoBC,IAAI3B,GAAG4B,QAAQ,uDAAuDF,kBAChG,IAAIG,EAAO,GACX,GAAIH,EAAmB,CACnBG,EAAOH,EAAkBI,MAAM5D,EAAS8B,GAAGmC,UAAW1D,KAAKN,SAAUC,EACzE,KAAO,CACHyD,EAAO,MAAM3D,EAAS8B,GAAGmC,UAAUnD,QAAQ,YAAa,GAAGZ,OAAeY,QAAQ,MAAO,QAC7F,CACAf,EAAQ8D,aAAa,UAAWF,EACpC,CACJ,CAQOQ,UACH,GAAI5D,KAAKR,gBAAkBQ,KAAKR,QAAQoE,UAAY,WAAY,CAC5D5D,KAAKR,QAAQoE,UACb5D,KAAKR,QAAU,IACnB,CACJ,EACH,IAAAqE,EAAA,CAAAC,WAAA,MAAAD,EAAAtE,aAAA,OAAAsE,CAAA","ignoreList":[]}
@@ -8,6 +8,7 @@ import { IPropertyMetadata } from "../../interfaces/ISchema";
8
8
  import Control from "sap/ui/core/Control";
9
9
  import { GlobalPipeline } from "../../core/PipelineManager";
10
10
  import coreLibrary from "sap/ui/core/library";
11
+ import { Logger } from "../../utils/Logger";
11
12
 
12
13
  /**
13
14
  * Abstract class representing a standard MetaUI Plugin.
@@ -151,8 +152,7 @@ export abstract class BasePlugin implements IPlugin {
151
152
  public setVisualValidationState(isValid: boolean, errorMessage?: string): void {
152
153
  if (!this.control) return;
153
154
 
154
- import("../../utils/Logger").then(m => m.Logger.error("[MetaUI]", `setVisualValidationState called on plugin: ${this.fieldKey}, isValid: ${isValid}`, "BasePlugin"));
155
-
155
+
156
156
  // Use reflection to check if the control supports ValueState (e.g. sap.m.Input does, sap.m.Text does not)
157
157
  if (typeof (this.control as any).setValueState === "function") {
158
158
  (this.control as any).setValueState(isValid ? coreLibrary.ValueState.None : coreLibrary.ValueState.Error);
@@ -161,7 +161,7 @@ export abstract class BasePlugin implements IPlugin {
161
161
  (this.control as any).setValueStateText(isValid ? "" : (errorMessage || ""));
162
162
  }
163
163
  } else {
164
- import("../../utils/Logger").then(m => m.Logger.error("[MetaUI]", `Plugin ${this.fieldKey} has no setValueState function!`, "BasePlugin"));
164
+ Logger.error("[MetaUI]", `Plugin ${this.fieldKey} has no setValueState function!`, "BasePlugin");
165
165
  }
166
166
  }
167
167
 
@@ -24,6 +24,7 @@ sap.ui.define(["./BasePlugin", "sap/m/CheckBox", "sap/m/Text"], function (___Bas
24
24
  render(fieldMetadata, bindingPath, modelName = "meta", engineScopeId, onChange) {
25
25
  this.onChange = onChange;
26
26
  this.metadata = fieldMetadata;
27
+ this.fieldKey = bindingPath.startsWith('/') ? bindingPath.substring(1) : bindingPath;
27
28
  if (!this.isEditable) {
28
29
  this.control = new TextControl({
29
30
  id: this.generateStableId(engineScopeId, bindingPath),
@@ -1 +1 @@
1
- {"version":3,"file":"BooleanPlugin-dbg.js","names":["BasePlugin","___BasePlugin","BooleanPlugin","render","fieldMetadata","bindingPath","modelName","engineScopeId","onChange","metadata","isEditable","control","TextControl","id","generateStableId","text","path","formatter","val","applyCommonDirectives","CheckBox","selected","enabled","ui","readOnly","select","oEvent","getParameter","result","validateAndApplyVisualState","isValid","fieldKey","getValue","getSelected","applyState","setEnabled","__exports","__esModule"],"sources":["BooleanPlugin.ts"],"sourcesContent":["/**\n * @file BooleanPlugin.ts\n * @description Renders a sap.m.Switch for boolean states.\n */\n\nimport { BasePlugin } from \"./BasePlugin\";\nimport { IPropertyMetadata } from \"../../interfaces/ISchema\";\nimport CheckBox from \"sap/m/CheckBox\";\nimport Control from \"sap/ui/core/Control\";\nimport TextControl from \"sap/m/Text\";\n\n/**\n * Handles rendering logic for toggleable booleans using `sap.m.CheckBox`.\n * \n * @namespace nz.co.siliconst.ui5.metaui.plugins.controls\n * @public\n */\nexport class BooleanPlugin extends BasePlugin {\n /**\n * Renders a `sap.m.CheckBox` component for boolean evaluation.\n * \n * @param fieldMetadata The specific JSON schema properties for this field.\n * @param bindingPath The JSON path bound to this control.\n * @param modelName The UI5 JSONModel name.\n * @returns {Control} The configured CheckBox control.\n */\n public render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName: string = \"meta\", engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string) => void): Control {\n this.onChange = onChange;\n this.metadata = fieldMetadata;\n \n if (!this.isEditable) {\n \n this.control = new TextControl({\n id: this.generateStableId(engineScopeId, bindingPath),\n text: {\n path: `${modelName}>${bindingPath}`,\n formatter: (val: boolean) => val ? \"Yes\" : \"No\"\n }\n });\n this.applyCommonDirectives(this.control, fieldMetadata, modelName);\n return this.control as Control;\n }\n\n this.control = new CheckBox({\n id: this.generateStableId(engineScopeId, bindingPath),\n selected: `{${modelName}>${bindingPath}}`,\n enabled: !fieldMetadata.ui?.readOnly,\n select: (oEvent: sap.ui.base.Event) => {\n const val = oEvent.getParameter(\"selected\");\n const result = this.validateAndApplyVisualState();\n if (this.onChange) {\n this.onChange(result.isValid, this.fieldKey);\n }\n }\n });\n\n this.applyCommonDirectives(this.control, fieldMetadata, modelName);\n\n return this.control as Control;\n }\n\n /**\n * Retrieves the current boolean state.\n * @returns {boolean} The selected state.\n */\n protected getValue(): unknown {\n return this.control ? (this.control as CheckBox).getSelected() : false;\n }\n\n /**\n * Applies dynamic read-only state.\n */\n protected applyState(): void {\n if (this.control && this.metadata) {\n if (!this.isEditable) return;\n (this.control as CheckBox).setEnabled(!this.metadata.ui?.readOnly);\n }\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;EAHA,MAKSA,UAAU,GAAAC,aAAA;EAMnB;AACA;AACA;AACA;AACA;AACA;EACO,MAAMC,aAAa,SAASF,UAAU,CAAC;IAC1C;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;IACWG,MAAMA,CAACC,aAAgC,EAAGC,WAAmB,EAAGC,SAAiB,GAAG,MAAM,EAAEC,aAAsB,EAAEC,QAAwD,EAAW;MAC1L,IAAI,CAACA,QAAQ,GAAGA,QAAQ;MACxB,IAAI,CAACC,QAAQ,GAAGL,aAAa;MAE7B,IAAI,CAAC,IAAI,CAACM,UAAU,EAAE;QAElB,IAAI,CAACC,OAAO,GAAG,IAAIC,WAAW,CAAC;UAC3BC,EAAE,EAAE,IAAI,CAACC,gBAAgB,CAACP,aAAa,EAAEF,WAAW,CAAC;UACrDU,IAAI,EAAE;YACFC,IAAI,EAAE,GAAGV,SAAS,IAAID,WAAW,EAAE;YACnCY,SAAS,EAAGC,GAAY,IAAKA,GAAG,GAAG,KAAK,GAAG;UAC/C;QACJ,CAAC,CAAC;QACF,IAAI,CAACC,qBAAqB,CAAC,IAAI,CAACR,OAAO,EAAEP,aAAa,EAAEE,SAAS,CAAC;QAClE,OAAO,IAAI,CAACK,OAAO;MACvB;MAEA,IAAI,CAACA,OAAO,GAAG,IAAIS,QAAQ,CAAC;QACxBP,EAAE,EAAE,IAAI,CAACC,gBAAgB,CAACP,aAAa,EAAEF,WAAW,CAAC;QACrDgB,QAAQ,EAAE,IAAIf,SAAS,IAAID,WAAW,GAAG;QACzCiB,OAAO,EAAE,CAAClB,aAAa,CAACmB,EAAE,EAAEC,QAAQ;QACpCC,MAAM,EAAGC,MAAyB,IAAK;UACnC,MAAMR,GAAG,GAAGQ,MAAM,CAACC,YAAY,CAAC,UAAU,CAAC;UAC3C,MAAMC,MAAM,GAAG,IAAI,CAACC,2BAA2B,CAAC,CAAC;UACjD,IAAI,IAAI,CAACrB,QAAQ,EAAE;YACf,IAAI,CAACA,QAAQ,CAACoB,MAAM,CAACE,OAAO,EAAE,IAAI,CAACC,QAAQ,CAAC;UAChD;QACJ;MACJ,CAAC,CAAC;MAEF,IAAI,CAACZ,qBAAqB,CAAC,IAAI,CAACR,OAAO,EAAEP,aAAa,EAAEE,SAAS,CAAC;MAElE,OAAO,IAAI,CAACK,OAAO;IACvB;;IAEA;AACJ;AACA;AACA;IACcqB,QAAQA,CAAA,EAAY;MAC1B,OAAO,IAAI,CAACrB,OAAO,GAAI,IAAI,CAACA,OAAO,CAAcsB,WAAW,CAAC,CAAC,GAAG,KAAK;IAC1E;;IAEA;AACJ;AACA;IACcC,UAAUA,CAAA,EAAS;MACzB,IAAI,IAAI,CAACvB,OAAO,IAAI,IAAI,CAACF,QAAQ,EAAE;QAC/B,IAAI,CAAC,IAAI,CAACC,UAAU,EAAE;QACrB,IAAI,CAACC,OAAO,CAAcwB,UAAU,CAAC,CAAC,IAAI,CAAC1B,QAAQ,CAACc,EAAE,EAAEC,QAAQ,CAAC;MACtE;IACJ;EACJ;EAAC,IAAAY,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAAlC,aAAA,GAAAA,aAAA;EAAA,OAAAkC,SAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"BooleanPlugin-dbg.js","names":["BasePlugin","___BasePlugin","BooleanPlugin","render","fieldMetadata","bindingPath","modelName","engineScopeId","onChange","metadata","fieldKey","startsWith","substring","isEditable","control","TextControl","id","generateStableId","text","path","formatter","val","applyCommonDirectives","CheckBox","selected","enabled","ui","readOnly","select","oEvent","getParameter","result","validateAndApplyVisualState","isValid","getValue","getSelected","applyState","setEnabled","__exports","__esModule"],"sources":["BooleanPlugin.ts"],"sourcesContent":["/**\n * @file BooleanPlugin.ts\n * @description Renders a sap.m.Switch for boolean states.\n */\n\nimport { BasePlugin } from \"./BasePlugin\";\nimport { IPropertyMetadata } from \"../../interfaces/ISchema\";\nimport CheckBox from \"sap/m/CheckBox\";\nimport Control from \"sap/ui/core/Control\";\nimport TextControl from \"sap/m/Text\";\n\n/**\n * Handles rendering logic for toggleable booleans using `sap.m.CheckBox`.\n * \n * @namespace nz.co.siliconst.ui5.metaui.plugins.controls\n * @public\n */\nexport class BooleanPlugin extends BasePlugin {\n /**\n * Renders a `sap.m.CheckBox` component for boolean evaluation.\n * \n * @param fieldMetadata The specific JSON schema properties for this field.\n * @param bindingPath The JSON path bound to this control.\n * @param modelName The UI5 JSONModel name.\n * @returns {Control} The configured CheckBox control.\n */\n public render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName: string = \"meta\", engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string) => void): Control {\n this.onChange = onChange;\n this.metadata = fieldMetadata;\n this.fieldKey = bindingPath.startsWith('/') ? bindingPath.substring(1) : bindingPath;\n \n if (!this.isEditable) {\n \n this.control = new TextControl({\n id: this.generateStableId(engineScopeId, bindingPath),\n text: {\n path: `${modelName}>${bindingPath}`,\n formatter: (val: boolean) => val ? \"Yes\" : \"No\"\n }\n });\n this.applyCommonDirectives(this.control, fieldMetadata, modelName);\n return this.control as Control;\n }\n\n this.control = new CheckBox({\n id: this.generateStableId(engineScopeId, bindingPath),\n selected: `{${modelName}>${bindingPath}}`,\n enabled: !fieldMetadata.ui?.readOnly,\n select: (oEvent: sap.ui.base.Event) => {\n const val = oEvent.getParameter(\"selected\");\n const result = this.validateAndApplyVisualState();\n if (this.onChange) {\n this.onChange(result.isValid, this.fieldKey);\n }\n }\n });\n\n this.applyCommonDirectives(this.control, fieldMetadata, modelName);\n\n return this.control as Control;\n }\n\n /**\n * Retrieves the current boolean state.\n * @returns {boolean} The selected state.\n */\n protected getValue(): unknown {\n return this.control ? (this.control as CheckBox).getSelected() : false;\n }\n\n /**\n * Applies dynamic read-only state.\n */\n protected applyState(): void {\n if (this.control && this.metadata) {\n if (!this.isEditable) return;\n (this.control as CheckBox).setEnabled(!this.metadata.ui?.readOnly);\n }\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;EAHA,MAKSA,UAAU,GAAAC,aAAA;EAMnB;AACA;AACA;AACA;AACA;AACA;EACO,MAAMC,aAAa,SAASF,UAAU,CAAC;IAC1C;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;IACWG,MAAMA,CAACC,aAAgC,EAAGC,WAAmB,EAAGC,SAAiB,GAAG,MAAM,EAAEC,aAAsB,EAAEC,QAAwD,EAAW;MAC1L,IAAI,CAACA,QAAQ,GAAGA,QAAQ;MACxB,IAAI,CAACC,QAAQ,GAAGL,aAAa;MAC7B,IAAI,CAACM,QAAQ,GAAGL,WAAW,CAACM,UAAU,CAAC,GAAG,CAAC,GAAGN,WAAW,CAACO,SAAS,CAAC,CAAC,CAAC,GAAGP,WAAW;MAEpF,IAAI,CAAC,IAAI,CAACQ,UAAU,EAAE;QAElB,IAAI,CAACC,OAAO,GAAG,IAAIC,WAAW,CAAC;UAC3BC,EAAE,EAAE,IAAI,CAACC,gBAAgB,CAACV,aAAa,EAAEF,WAAW,CAAC;UACrDa,IAAI,EAAE;YACFC,IAAI,EAAE,GAAGb,SAAS,IAAID,WAAW,EAAE;YACnCe,SAAS,EAAGC,GAAY,IAAKA,GAAG,GAAG,KAAK,GAAG;UAC/C;QACJ,CAAC,CAAC;QACF,IAAI,CAACC,qBAAqB,CAAC,IAAI,CAACR,OAAO,EAAEV,aAAa,EAAEE,SAAS,CAAC;QAClE,OAAO,IAAI,CAACQ,OAAO;MACvB;MAEA,IAAI,CAACA,OAAO,GAAG,IAAIS,QAAQ,CAAC;QACxBP,EAAE,EAAE,IAAI,CAACC,gBAAgB,CAACV,aAAa,EAAEF,WAAW,CAAC;QACrDmB,QAAQ,EAAE,IAAIlB,SAAS,IAAID,WAAW,GAAG;QACzCoB,OAAO,EAAE,CAACrB,aAAa,CAACsB,EAAE,EAAEC,QAAQ;QACpCC,MAAM,EAAGC,MAAyB,IAAK;UACnC,MAAMR,GAAG,GAAGQ,MAAM,CAACC,YAAY,CAAC,UAAU,CAAC;UAC3C,MAAMC,MAAM,GAAG,IAAI,CAACC,2BAA2B,CAAC,CAAC;UACjD,IAAI,IAAI,CAACxB,QAAQ,EAAE;YACf,IAAI,CAACA,QAAQ,CAACuB,MAAM,CAACE,OAAO,EAAE,IAAI,CAACvB,QAAQ,CAAC;UAChD;QACJ;MACJ,CAAC,CAAC;MAEF,IAAI,CAACY,qBAAqB,CAAC,IAAI,CAACR,OAAO,EAAEV,aAAa,EAAEE,SAAS,CAAC;MAElE,OAAO,IAAI,CAACQ,OAAO;IACvB;;IAEA;AACJ;AACA;AACA;IACcoB,QAAQA,CAAA,EAAY;MAC1B,OAAO,IAAI,CAACpB,OAAO,GAAI,IAAI,CAACA,OAAO,CAAcqB,WAAW,CAAC,CAAC,GAAG,KAAK;IAC1E;;IAEA;AACJ;AACA;IACcC,UAAUA,CAAA,EAAS;MACzB,IAAI,IAAI,CAACtB,OAAO,IAAI,IAAI,CAACL,QAAQ,EAAE;QAC/B,IAAI,CAAC,IAAI,CAACI,UAAU,EAAE;QACrB,IAAI,CAACC,OAAO,CAAcuB,UAAU,CAAC,CAAC,IAAI,CAAC5B,QAAQ,CAACiB,EAAE,EAAEC,QAAQ,CAAC;MACtE;IACJ;EACJ;EAAC,IAAAW,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAApC,aAAA,GAAAA,aAAA;EAAA,OAAAoC,SAAA;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"BooleanPlugin.d.ts","sourceRoot":"../../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,2DAA2D,CAAC;IAC3E;;;OAGG;IAEH,OAAO,EAAE,UAAU,EAAE,MAAM,wDAAwD,CAAC;IACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;IAElF,OAAO,OAAO,MAAM,qBAAqB,CAAC;IAG1C;;;;;OAKG;IACH,MAAa,aAAc,SAAQ,UAAU;QACzC;;;;;;;WAOG;QACI,MAAM,CAAC,aAAa,EAAE,iBAAiB,EAAG,WAAW,EAAE,MAAM,EAAG,SAAS,GAAE,MAAe,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO;QAmC7L;;;WAGG;QACH,SAAS,CAAC,QAAQ,IAAI,OAAO;QAI7B;;WAEG;QACH,SAAS,CAAC,UAAU,IAAI,IAAI;KAM/B;CAEA"}
1
+ {"version":3,"file":"BooleanPlugin.d.ts","sourceRoot":"../../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/plugins/controls/BooleanPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,2DAA2D,CAAC;IAC3E;;;OAGG;IAEH,OAAO,EAAE,UAAU,EAAE,MAAM,wDAAwD,CAAC;IACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;IAElF,OAAO,OAAO,MAAM,qBAAqB,CAAC;IAG1C;;;;;OAKG;IACH,MAAa,aAAc,SAAQ,UAAU;QACzC;;;;;;;WAOG;QACI,MAAM,CAAC,aAAa,EAAE,iBAAiB,EAAG,WAAW,EAAE,MAAM,EAAG,SAAS,GAAE,MAAe,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO;QAoC7L;;;WAGG;QACH,SAAS,CAAC,QAAQ,IAAI,OAAO;QAI7B;;WAEG;QACH,SAAS,CAAC,UAAU,IAAI,IAAI;KAM/B;CAEA"}
@@ -1,2 +1,2 @@
1
- sap.ui.define(["./BasePlugin","sap/m/CheckBox","sap/m/Text"],function(t,e,i){"use strict";const s=t["BasePlugin"];class a extends s{render(t,s,a="meta",n,l){this.onChange=l;this.metadata=t;if(!this.isEditable){this.control=new i({id:this.generateStableId(n,s),text:{path:`${a}>${s}`,formatter:t=>t?"Yes":"No"}});this.applyCommonDirectives(this.control,t,a);return this.control}this.control=new e({id:this.generateStableId(n,s),selected:`{${a}>${s}}`,enabled:!t.ui?.readOnly,select:t=>{const e=t.getParameter("selected");const i=this.validateAndApplyVisualState();if(this.onChange){this.onChange(i.isValid,this.fieldKey)}}});this.applyCommonDirectives(this.control,t,a);return this.control}getValue(){return this.control?this.control.getSelected():false}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;this.control.setEnabled(!this.metadata.ui?.readOnly)}}}var n={__esModule:true};n.BooleanPlugin=a;return n});
1
+ sap.ui.define(["./BasePlugin","sap/m/CheckBox","sap/m/Text"],function(t,e,i){"use strict";const s=t["BasePlugin"];class a extends s{render(t,s,a="meta",n,l){this.onChange=l;this.metadata=t;this.fieldKey=s.startsWith("/")?s.substring(1):s;if(!this.isEditable){this.control=new i({id:this.generateStableId(n,s),text:{path:`${a}>${s}`,formatter:t=>t?"Yes":"No"}});this.applyCommonDirectives(this.control,t,a);return this.control}this.control=new e({id:this.generateStableId(n,s),selected:`{${a}>${s}}`,enabled:!t.ui?.readOnly,select:t=>{const e=t.getParameter("selected");const i=this.validateAndApplyVisualState();if(this.onChange){this.onChange(i.isValid,this.fieldKey)}}});this.applyCommonDirectives(this.control,t,a);return this.control}getValue(){return this.control?this.control.getSelected():false}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;this.control.setEnabled(!this.metadata.ui?.readOnly)}}}var n={__esModule:true};n.BooleanPlugin=a;return n});
2
2
  //# sourceMappingURL=BooleanPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BooleanPlugin.js","names":["BasePlugin","___BasePlugin","BooleanPlugin","render","fieldMetadata","bindingPath","modelName","engineScopeId","onChange","this","metadata","isEditable","control","TextControl","id","generateStableId","text","path","formatter","val","applyCommonDirectives","CheckBox","selected","enabled","ui","readOnly","select","oEvent","getParameter","result","validateAndApplyVisualState","isValid","fieldKey","getValue","getSelected","applyState","setEnabled","__exports","__esModule"],"sources":["BooleanPlugin.ts"],"sourcesContent":["/**\n * @file BooleanPlugin.ts\n * @description Renders a sap.m.Switch for boolean states.\n */\n\nimport { BasePlugin } from \"./BasePlugin\";\nimport { IPropertyMetadata } from \"../../interfaces/ISchema\";\nimport CheckBox from \"sap/m/CheckBox\";\nimport Control from \"sap/ui/core/Control\";\nimport TextControl from \"sap/m/Text\";\n\n/**\n * Handles rendering logic for toggleable booleans using `sap.m.CheckBox`.\n * \n * @namespace nz.co.siliconst.ui5.metaui.plugins.controls\n * @public\n */\nexport class BooleanPlugin extends BasePlugin {\n /**\n * Renders a `sap.m.CheckBox` component for boolean evaluation.\n * \n * @param fieldMetadata The specific JSON schema properties for this field.\n * @param bindingPath The JSON path bound to this control.\n * @param modelName The UI5 JSONModel name.\n * @returns {Control} The configured CheckBox control.\n */\n public render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName: string = \"meta\", engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string) => void): Control {\n this.onChange = onChange;\n this.metadata = fieldMetadata;\n \n if (!this.isEditable) {\n \n this.control = new TextControl({\n id: this.generateStableId(engineScopeId, bindingPath),\n text: {\n path: `${modelName}>${bindingPath}`,\n formatter: (val: boolean) => val ? \"Yes\" : \"No\"\n }\n });\n this.applyCommonDirectives(this.control, fieldMetadata, modelName);\n return this.control as Control;\n }\n\n this.control = new CheckBox({\n id: this.generateStableId(engineScopeId, bindingPath),\n selected: `{${modelName}>${bindingPath}}`,\n enabled: !fieldMetadata.ui?.readOnly,\n select: (oEvent: sap.ui.base.Event) => {\n const val = oEvent.getParameter(\"selected\");\n const result = this.validateAndApplyVisualState();\n if (this.onChange) {\n this.onChange(result.isValid, this.fieldKey);\n }\n }\n });\n\n this.applyCommonDirectives(this.control, fieldMetadata, modelName);\n\n return this.control as Control;\n }\n\n /**\n * Retrieves the current boolean state.\n * @returns {boolean} The selected state.\n */\n protected getValue(): unknown {\n return this.control ? (this.control as CheckBox).getSelected() : false;\n }\n\n /**\n * Applies dynamic read-only state.\n */\n protected applyState(): void {\n if (this.control && this.metadata) {\n if (!this.isEditable) return;\n (this.control as CheckBox).setEnabled(!this.metadata.ui?.readOnly);\n }\n }\n}\n"],"mappings":"0FAAA,MAKSA,EAAUC,EAAA,cAYZ,MAAMC,UAAsBF,EASxBG,OAAOC,EAAmCC,EAAsBC,EAAoB,OAAQC,EAAwBC,GACvHC,KAAKD,SAAWA,EAChBC,KAAKC,SAAWN,EAEhB,IAAKK,KAAKE,WAAY,CAElBF,KAAKG,QAAU,IAAIC,EAAY,CAC3BC,GAAIL,KAAKM,iBAAiBR,EAAeF,GACzCW,KAAM,CACFC,KAAM,GAAGX,KAAaD,IACtBa,UAAYC,GAAiBA,EAAM,MAAQ,QAGnDV,KAAKW,sBAAsBX,KAAKG,QAASR,EAAeE,GACxD,OAAOG,KAAKG,OAChB,CAEAH,KAAKG,QAAU,IAAIS,EAAS,CACxBP,GAAIL,KAAKM,iBAAiBR,EAAeF,GACzCiB,SAAU,IAAIhB,KAAaD,KAC3BkB,SAAUnB,EAAcoB,IAAIC,SAC5BC,OAASC,IACL,MAAMR,EAAMQ,EAAOC,aAAa,YAChC,MAAMC,EAASpB,KAAKqB,8BACpB,GAAIrB,KAAKD,SAAU,CACfC,KAAKD,SAASqB,EAAOE,QAAStB,KAAKuB,SACvC,KAIRvB,KAAKW,sBAAsBX,KAAKG,QAASR,EAAeE,GAExD,OAAOG,KAAKG,OAChB,CAMUqB,WACN,OAAOxB,KAAKG,QAAWH,KAAKG,QAAqBsB,cAAgB,KACrE,CAKUC,aACN,GAAI1B,KAAKG,SAAWH,KAAKC,SAAU,CAC/B,IAAKD,KAAKE,WAAY,OACrBF,KAAKG,QAAqBwB,YAAY3B,KAAKC,SAASc,IAAIC,SAC7D,CACJ,EACH,IAAAY,EAAA,CAAAC,WAAA,MAAAD,EAAAnC,gBAAA,OAAAmC,CAAA","ignoreList":[]}
1
+ {"version":3,"file":"BooleanPlugin.js","names":["BasePlugin","___BasePlugin","BooleanPlugin","render","fieldMetadata","bindingPath","modelName","engineScopeId","onChange","this","metadata","fieldKey","startsWith","substring","isEditable","control","TextControl","id","generateStableId","text","path","formatter","val","applyCommonDirectives","CheckBox","selected","enabled","ui","readOnly","select","oEvent","getParameter","result","validateAndApplyVisualState","isValid","getValue","getSelected","applyState","setEnabled","__exports","__esModule"],"sources":["BooleanPlugin.ts"],"sourcesContent":["/**\n * @file BooleanPlugin.ts\n * @description Renders a sap.m.Switch for boolean states.\n */\n\nimport { BasePlugin } from \"./BasePlugin\";\nimport { IPropertyMetadata } from \"../../interfaces/ISchema\";\nimport CheckBox from \"sap/m/CheckBox\";\nimport Control from \"sap/ui/core/Control\";\nimport TextControl from \"sap/m/Text\";\n\n/**\n * Handles rendering logic for toggleable booleans using `sap.m.CheckBox`.\n * \n * @namespace nz.co.siliconst.ui5.metaui.plugins.controls\n * @public\n */\nexport class BooleanPlugin extends BasePlugin {\n /**\n * Renders a `sap.m.CheckBox` component for boolean evaluation.\n * \n * @param fieldMetadata The specific JSON schema properties for this field.\n * @param bindingPath The JSON path bound to this control.\n * @param modelName The UI5 JSONModel name.\n * @returns {Control} The configured CheckBox control.\n */\n public render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName: string = \"meta\", engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string) => void): Control {\n this.onChange = onChange;\n this.metadata = fieldMetadata;\n this.fieldKey = bindingPath.startsWith('/') ? bindingPath.substring(1) : bindingPath;\n \n if (!this.isEditable) {\n \n this.control = new TextControl({\n id: this.generateStableId(engineScopeId, bindingPath),\n text: {\n path: `${modelName}>${bindingPath}`,\n formatter: (val: boolean) => val ? \"Yes\" : \"No\"\n }\n });\n this.applyCommonDirectives(this.control, fieldMetadata, modelName);\n return this.control as Control;\n }\n\n this.control = new CheckBox({\n id: this.generateStableId(engineScopeId, bindingPath),\n selected: `{${modelName}>${bindingPath}}`,\n enabled: !fieldMetadata.ui?.readOnly,\n select: (oEvent: sap.ui.base.Event) => {\n const val = oEvent.getParameter(\"selected\");\n const result = this.validateAndApplyVisualState();\n if (this.onChange) {\n this.onChange(result.isValid, this.fieldKey);\n }\n }\n });\n\n this.applyCommonDirectives(this.control, fieldMetadata, modelName);\n\n return this.control as Control;\n }\n\n /**\n * Retrieves the current boolean state.\n * @returns {boolean} The selected state.\n */\n protected getValue(): unknown {\n return this.control ? (this.control as CheckBox).getSelected() : false;\n }\n\n /**\n * Applies dynamic read-only state.\n */\n protected applyState(): void {\n if (this.control && this.metadata) {\n if (!this.isEditable) return;\n (this.control as CheckBox).setEnabled(!this.metadata.ui?.readOnly);\n }\n }\n}\n"],"mappings":"0FAAA,MAKSA,EAAUC,EAAA,cAYZ,MAAMC,UAAsBF,EASxBG,OAAOC,EAAmCC,EAAsBC,EAAoB,OAAQC,EAAwBC,GACvHC,KAAKD,SAAWA,EAChBC,KAAKC,SAAWN,EAChBK,KAAKE,SAAWN,EAAYO,WAAW,KAAOP,EAAYQ,UAAU,GAAKR,EAEzE,IAAKI,KAAKK,WAAY,CAElBL,KAAKM,QAAU,IAAIC,EAAY,CAC3BC,GAAIR,KAAKS,iBAAiBX,EAAeF,GACzCc,KAAM,CACFC,KAAM,GAAGd,KAAaD,IACtBgB,UAAYC,GAAiBA,EAAM,MAAQ,QAGnDb,KAAKc,sBAAsBd,KAAKM,QAASX,EAAeE,GACxD,OAAOG,KAAKM,OAChB,CAEAN,KAAKM,QAAU,IAAIS,EAAS,CACxBP,GAAIR,KAAKS,iBAAiBX,EAAeF,GACzCoB,SAAU,IAAInB,KAAaD,KAC3BqB,SAAUtB,EAAcuB,IAAIC,SAC5BC,OAASC,IACL,MAAMR,EAAMQ,EAAOC,aAAa,YAChC,MAAMC,EAASvB,KAAKwB,8BACpB,GAAIxB,KAAKD,SAAU,CACfC,KAAKD,SAASwB,EAAOE,QAASzB,KAAKE,SACvC,KAIRF,KAAKc,sBAAsBd,KAAKM,QAASX,EAAeE,GAExD,OAAOG,KAAKM,OAChB,CAMUoB,WACN,OAAO1B,KAAKM,QAAWN,KAAKM,QAAqBqB,cAAgB,KACrE,CAKUC,aACN,GAAI5B,KAAKM,SAAWN,KAAKC,SAAU,CAC/B,IAAKD,KAAKK,WAAY,OACrBL,KAAKM,QAAqBuB,YAAY7B,KAAKC,SAASiB,IAAIC,SAC7D,CACJ,EACH,IAAAW,EAAA,CAAAC,WAAA,MAAAD,EAAArC,gBAAA,OAAAqC,CAAA","ignoreList":[]}
@@ -27,6 +27,7 @@ export class BooleanPlugin extends BasePlugin {
27
27
  public render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName: string = "meta", engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string) => void): Control {
28
28
  this.onChange = onChange;
29
29
  this.metadata = fieldMetadata;
30
+ this.fieldKey = bindingPath.startsWith('/') ? bindingPath.substring(1) : bindingPath;
30
31
 
31
32
  if (!this.isEditable) {
32
33
 
@@ -23,6 +23,7 @@ sap.ui.define(["./BasePlugin", "sap/m/DatePicker", "sap/m/Text"], function (___B
23
23
  render(fieldMetadata, bindingPath, modelName = "meta", engineScopeId, onChange) {
24
24
  this.onChange = onChange;
25
25
  this.metadata = fieldMetadata;
26
+ this.fieldKey = bindingPath.startsWith('/') ? bindingPath.substring(1) : bindingPath;
26
27
  if (!this.isEditable) {
27
28
  this.control = new TextControl({
28
29
  id: this.generateStableId(engineScopeId, bindingPath),
@@ -1 +1 @@
1
- {"version":3,"file":"DatePlugin-dbg.js","names":["BasePlugin","___BasePlugin","DatePlugin","render","fieldMetadata","bindingPath","modelName","engineScopeId","onChange","metadata","isEditable","control","TextControl","id","generateStableId","text","path","type","formatOptions","source","pattern","applyCommonDirectives","DatePicker","value","displayFormat","editable","ui","readOnly","required","change","oEvent","val","getParameter","result","validateAndApplyVisualState","isValid","fieldKey","getValue","applyState","dp","setEditable","setRequired","__exports","__esModule"],"sources":["DatePlugin.ts"],"sourcesContent":["/**\n * @file DatePlugin.ts\n * @description Renders a sap.m.DatePicker natively bound to ISO date strings.\n */\n\nimport { BasePlugin } from \"./BasePlugin\";\nimport { IPropertyMetadata } from \"../../interfaces/ISchema\";\nimport DatePicker from \"sap/m/DatePicker\";\nimport Control from \"sap/ui/core/Control\";\nimport TextControl from \"sap/m/Text\";\n\n/**\n * Handles rendering logic for Date strings.\n */\nexport class DatePlugin extends BasePlugin {\n /**\n * Renders a `sap.m.DatePicker` component.\n * \n * @param fieldMetadata The specific JSON schema properties for this field.\n * @param bindingPath The JSON path bound to this control.\n * @param modelName The UI5 JSONModel name.\n * @param engineScopeId The deterministic scope ID.\n * @param onChange The callback fired on value change.\n * @returns {Control} The configured DatePicker control.\n */\n public render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName: string = \"meta\", engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string) => void): Control {\n this.onChange = onChange;\n this.metadata = fieldMetadata;\n \n if (!this.isEditable) {\n \n this.control = new TextControl({\n id: this.generateStableId(engineScopeId, bindingPath),\n text: {\n path: `${modelName}>${bindingPath}`,\n type: \"sap.ui.model.type.Date\",\n formatOptions: {\n source: { pattern: \"yyyy-MM-dd\" },\n pattern: \"yyyy-MM-dd\"\n }\n }\n });\n this.applyCommonDirectives(this.control, fieldMetadata, modelName);\n return this.control as Control;\n }\n\n this.control = new DatePicker({\n id: this.generateStableId(engineScopeId, bindingPath),\n value: {\n path: `${modelName}>${bindingPath}`,\n type: \"sap.ui.model.type.Date\",\n formatOptions: {\n source: { pattern: \"yyyy-MM-dd\" },\n pattern: \"yyyy-MM-dd\"\n }\n },\n displayFormat: \"long\",\n editable: !fieldMetadata.ui?.readOnly,\n required: fieldMetadata.required,\n change: (oEvent: sap.ui.base.Event) => {\n const val = oEvent.getParameter(\"value\");\n const result = this.validateAndApplyVisualState();\n if (this.onChange) {\n this.onChange(result.isValid, this.fieldKey);\n }\n }\n });\n\n return this.control as Control;\n }\n\n /**\n * Retrieves the current date string.\n * @returns {unknown} The date value.\n */\n protected getValue(): unknown {\n return this.control ? (this.control as DatePicker).getValue() : null;\n }\n\n /**\n * Applies dynamic read-only state.\n */\n protected applyState(): void {\n if (this.control && this.metadata) {\n if (!this.isEditable) return;\n const dp = this.control as DatePicker;\n dp.setEditable(!this.metadata.ui?.readOnly);\n dp.setRequired(this.metadata.required);\n }\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;EAHA,MAKSA,UAAU,GAAAC,aAAA;EAMnB;AACA;AACA;EACO,MAAMC,UAAU,SAASF,UAAU,CAAC;IACvC;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACWG,MAAMA,CAACC,aAAgC,EAAGC,WAAmB,EAAGC,SAAiB,GAAG,MAAM,EAAEC,aAAsB,EAAEC,QAAwD,EAAW;MAC1L,IAAI,CAACA,QAAQ,GAAGA,QAAQ;MACxB,IAAI,CAACC,QAAQ,GAAGL,aAAa;MAE7B,IAAI,CAAC,IAAI,CAACM,UAAU,EAAE;QAElB,IAAI,CAACC,OAAO,GAAG,IAAIC,WAAW,CAAC;UAC3BC,EAAE,EAAE,IAAI,CAACC,gBAAgB,CAACP,aAAa,EAAEF,WAAW,CAAC;UACrDU,IAAI,EAAE;YACFC,IAAI,EAAE,GAAGV,SAAS,IAAID,WAAW,EAAE;YACnCY,IAAI,EAAE,wBAAwB;YAC9BC,aAAa,EAAE;cACXC,MAAM,EAAE;gBAAEC,OAAO,EAAE;cAAa,CAAC;cACjCA,OAAO,EAAE;YACb;UACJ;QACJ,CAAC,CAAC;QACF,IAAI,CAACC,qBAAqB,CAAC,IAAI,CAACV,OAAO,EAAEP,aAAa,EAAEE,SAAS,CAAC;QAClE,OAAO,IAAI,CAACK,OAAO;MACvB;MAEA,IAAI,CAACA,OAAO,GAAG,IAAIW,UAAU,CAAC;QAC1BT,EAAE,EAAE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QAAQ,CAAC;MAC1C;IACJ;EACJ;EAAC,IAAAc,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAAxC,UAAA,GAAAA,UAAA;EAAA,OAAAwC,SAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"DatePlugin-dbg.js","names":["BasePlugin","___BasePlugin","DatePlugin","render","fieldMetadata","bindingPath","modelName","engineScopeId","onChange","metadata","fieldKey","startsWith","substring","isEditable","control","TextControl","id","generateStableId","text","path","type","formatOptions","source","pattern","applyCommonDirectives","DatePicker","value","displayFormat","editable","ui","readOnly","required","change","oEvent","val","getParameter","result","validateAndApplyVisualState","isValid","getValue","applyState","dp","setEditable","setRequired","__exports","__esModule"],"sources":["DatePlugin.ts"],"sourcesContent":["/**\n * @file DatePlugin.ts\n * @description Renders a sap.m.DatePicker natively bound to ISO date strings.\n */\n\nimport { BasePlugin } from \"./BasePlugin\";\nimport { IPropertyMetadata } from \"../../interfaces/ISchema\";\nimport DatePicker from \"sap/m/DatePicker\";\nimport Control from \"sap/ui/core/Control\";\nimport TextControl from \"sap/m/Text\";\n\n/**\n * Handles rendering logic for Date strings.\n */\nexport class DatePlugin extends BasePlugin {\n /**\n * Renders a `sap.m.DatePicker` component.\n * \n * @param fieldMetadata The specific JSON schema properties for this field.\n * @param bindingPath The JSON path bound to this control.\n * @param modelName The UI5 JSONModel name.\n * @param engineScopeId The deterministic scope ID.\n * @param onChange The callback fired on value change.\n * @returns {Control} The configured DatePicker control.\n */\n public render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName: string = \"meta\", engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string) => void): Control {\n this.onChange = onChange;\n this.metadata = fieldMetadata;\n this.fieldKey = bindingPath.startsWith('/') ? bindingPath.substring(1) : bindingPath;\n \n if (!this.isEditable) {\n \n this.control = new TextControl({\n id: this.generateStableId(engineScopeId, bindingPath),\n text: {\n path: `${modelName}>${bindingPath}`,\n type: \"sap.ui.model.type.Date\",\n formatOptions: {\n source: { pattern: \"yyyy-MM-dd\" },\n pattern: \"yyyy-MM-dd\"\n }\n }\n });\n this.applyCommonDirectives(this.control, fieldMetadata, modelName);\n return this.control as Control;\n }\n\n this.control = new DatePicker({\n id: this.generateStableId(engineScopeId, bindingPath),\n value: {\n path: `${modelName}>${bindingPath}`,\n type: \"sap.ui.model.type.Date\",\n formatOptions: {\n source: { pattern: \"yyyy-MM-dd\" },\n pattern: \"yyyy-MM-dd\"\n }\n },\n displayFormat: \"long\",\n editable: !fieldMetadata.ui?.readOnly,\n required: fieldMetadata.required,\n change: (oEvent: sap.ui.base.Event) => {\n const val = oEvent.getParameter(\"value\");\n const result = this.validateAndApplyVisualState();\n if (this.onChange) {\n this.onChange(result.isValid, this.fieldKey);\n }\n }\n });\n\n return this.control as Control;\n }\n\n /**\n * Retrieves the current date string.\n * @returns {unknown} The date value.\n */\n protected getValue(): unknown {\n return this.control ? (this.control as DatePicker).getValue() : null;\n }\n\n /**\n * Applies dynamic read-only state.\n */\n protected applyState(): void {\n if (this.control && this.metadata) {\n if (!this.isEditable) return;\n const dp = this.control as DatePicker;\n dp.setEditable(!this.metadata.ui?.readOnly);\n dp.setRequired(this.metadata.required);\n }\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;EAHA,MAKSA,UAAU,GAAAC,aAAA;EAMnB;AACA;AACA;EACO,MAAMC,UAAU,SAASF,UAAU,CAAC;IACvC;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACWG,MAAMA,CAACC,aAAgC,EAAGC,WAAmB,EAAGC,SAAiB,GAAG,MAAM,EAAEC,aAAsB,EAAEC,QAAwD,EAAW;MAC1L,IAAI,CAACA,QAAQ,GAAGA,QAAQ;MACxB,IAAI,CAACC,QAAQ,GAAGL,aAAa;MAC7B,IAAI,CAACM,QAAQ,GAAGL,WAAW,CAACM,UAAU,CAAC,GAAG,CAAC,GAAGN,WAAW,CAACO,SAAS,CAAC,CAAC,CAAC,GAAGP,WAAW;MAEpF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;QACJ;MACJ,CAAC,CAAC;MAEF,OAAO,IAAI,CAACI,OAAO;IACvB;;IAEA;AACJ;AACA;AACA;IACcyB,QAAQA,CAAA,EAAY;MAC1B,OAAO,IAAI,CAACzB,OAAO,GAAI,IAAI,CAACA,OAAO,CAAgByB,QAAQ,CAAC,CAAC,GAAG,IAAI;IACxE;;IAEA;AACJ;AACA;IACcC,UAAUA,CAAA,EAAS;MACzB,IAAI,IAAI,CAAC1B,OAAO,IAAI,IAAI,CAACL,QAAQ,EAAE;QAC/B,IAAI,CAAC,IAAI,CAACI,UAAU,EAAE;QACtB,MAAM4B,EAAE,GAAG,IAAI,CAAC3B,OAAqB;QACrC2B,EAAE,CAACC,WAAW,CAAC,CAAC,IAAI,CAACjC,QAAQ,CAACoB,EAAE,EAAEC,QAAQ,CAAC;QAC3CW,EAAE,CAACE,WAAW,CAAC,IAAI,CAAClC,QAAQ,CAACsB,QAAQ,CAAC;MAC1C;IACJ;EACJ;EAAC,IAAAa,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAA1C,UAAA,GAAAA,UAAA;EAAA,OAAA0C,SAAA;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"DatePlugin.d.ts","sourceRoot":"../../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,wDAAwD,CAAC;IACxE;;;OAGG;IAEH,OAAO,EAAE,UAAU,EAAE,MAAM,wDAAwD,CAAC;IACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;IAElF,OAAO,OAAO,MAAM,qBAAqB,CAAC;IAG1C;;OAEG;IACH,MAAa,UAAW,SAAQ,UAAU;QACtC;;;;;;;;;WASG;QACI,MAAM,CAAC,aAAa,EAAE,iBAAiB,EAAG,WAAW,EAAE,MAAM,EAAG,SAAS,GAAE,MAAe,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO;QA8C7L;;;WAGG;QACH,SAAS,CAAC,QAAQ,IAAI,OAAO;QAI7B;;WAEG;QACH,SAAS,CAAC,UAAU,IAAI,IAAI;KAQ/B;CAEA"}
1
+ {"version":3,"file":"DatePlugin.d.ts","sourceRoot":"../../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/plugins/controls/DatePlugin.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,wDAAwD,CAAC;IACxE;;;OAGG;IAEH,OAAO,EAAE,UAAU,EAAE,MAAM,wDAAwD,CAAC;IACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;IAElF,OAAO,OAAO,MAAM,qBAAqB,CAAC;IAG1C;;OAEG;IACH,MAAa,UAAW,SAAQ,UAAU;QACtC;;;;;;;;;WASG;QACI,MAAM,CAAC,aAAa,EAAE,iBAAiB,EAAG,WAAW,EAAE,MAAM,EAAG,SAAS,GAAE,MAAe,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO;QA+C7L;;;WAGG;QACH,SAAS,CAAC,QAAQ,IAAI,OAAO;QAI7B;;WAEG;QACH,SAAS,CAAC,UAAU,IAAI,IAAI;KAQ/B;CAEA"}
@@ -1,2 +1,2 @@
1
- sap.ui.define(["./BasePlugin","sap/m/DatePicker","sap/m/Text"],function(t,e,a){"use strict";const i=t["BasePlugin"];class s extends i{render(t,i,s="meta",n,r){this.onChange=r;this.metadata=t;if(!this.isEditable){this.control=new a({id:this.generateStableId(n,i),text:{path:`${s}>${i}`,type:"sap.ui.model.type.Date",formatOptions:{source:{pattern:"yyyy-MM-dd"},pattern:"yyyy-MM-dd"}}});this.applyCommonDirectives(this.control,t,s);return this.control}this.control=new e({id:this.generateStableId(n,i),value:{path:`${s}>${i}`,type:"sap.ui.model.type.Date",formatOptions:{source:{pattern:"yyyy-MM-dd"},pattern:"yyyy-MM-dd"}},displayFormat:"long",editable:!t.ui?.readOnly,required:t.required,change:t=>{const e=t.getParameter("value");const a=this.validateAndApplyVisualState();if(this.onChange){this.onChange(a.isValid,this.fieldKey)}}});return this.control}getValue(){return this.control?this.control.getValue():null}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;const t=this.control;t.setEditable(!this.metadata.ui?.readOnly);t.setRequired(this.metadata.required)}}}var n={__esModule:true};n.DatePlugin=s;return n});
1
+ sap.ui.define(["./BasePlugin","sap/m/DatePicker","sap/m/Text"],function(t,e,a){"use strict";const i=t["BasePlugin"];class s extends i{render(t,i,s="meta",n,r){this.onChange=r;this.metadata=t;this.fieldKey=i.startsWith("/")?i.substring(1):i;if(!this.isEditable){this.control=new a({id:this.generateStableId(n,i),text:{path:`${s}>${i}`,type:"sap.ui.model.type.Date",formatOptions:{source:{pattern:"yyyy-MM-dd"},pattern:"yyyy-MM-dd"}}});this.applyCommonDirectives(this.control,t,s);return this.control}this.control=new e({id:this.generateStableId(n,i),value:{path:`${s}>${i}`,type:"sap.ui.model.type.Date",formatOptions:{source:{pattern:"yyyy-MM-dd"},pattern:"yyyy-MM-dd"}},displayFormat:"long",editable:!t.ui?.readOnly,required:t.required,change:t=>{const e=t.getParameter("value");const a=this.validateAndApplyVisualState();if(this.onChange){this.onChange(a.isValid,this.fieldKey)}}});return this.control}getValue(){return this.control?this.control.getValue():null}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;const t=this.control;t.setEditable(!this.metadata.ui?.readOnly);t.setRequired(this.metadata.required)}}}var n={__esModule:true};n.DatePlugin=s;return n});
2
2
  //# sourceMappingURL=DatePlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DatePlugin.js","names":["BasePlugin","___BasePlugin","DatePlugin","render","fieldMetadata","bindingPath","modelName","engineScopeId","onChange","this","metadata","isEditable","control","TextControl","id","generateStableId","text","path","type","formatOptions","source","pattern","applyCommonDirectives","DatePicker","value","displayFormat","editable","ui","readOnly","required","change","oEvent","val","getParameter","result","validateAndApplyVisualState","isValid","fieldKey","getValue","applyState","dp","setEditable","setRequired","__exports","__esModule"],"sources":["DatePlugin.ts"],"sourcesContent":["/**\n * @file DatePlugin.ts\n * @description Renders a sap.m.DatePicker natively bound to ISO date strings.\n */\n\nimport { BasePlugin } from \"./BasePlugin\";\nimport { IPropertyMetadata } from \"../../interfaces/ISchema\";\nimport DatePicker from \"sap/m/DatePicker\";\nimport Control from \"sap/ui/core/Control\";\nimport TextControl from \"sap/m/Text\";\n\n/**\n * Handles rendering logic for Date strings.\n */\nexport class DatePlugin extends BasePlugin {\n /**\n * Renders a `sap.m.DatePicker` component.\n * \n * @param fieldMetadata The specific JSON schema properties for this field.\n * @param bindingPath The JSON path bound to this control.\n * @param modelName The UI5 JSONModel name.\n * @param engineScopeId The deterministic scope ID.\n * @param onChange The callback fired on value change.\n * @returns {Control} The configured DatePicker control.\n */\n public render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName: string = \"meta\", engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string) => void): Control {\n this.onChange = onChange;\n this.metadata = fieldMetadata;\n \n if (!this.isEditable) {\n \n this.control = new TextControl({\n id: this.generateStableId(engineScopeId, bindingPath),\n text: {\n path: `${modelName}>${bindingPath}`,\n type: \"sap.ui.model.type.Date\",\n formatOptions: {\n source: { pattern: \"yyyy-MM-dd\" },\n pattern: \"yyyy-MM-dd\"\n }\n }\n });\n this.applyCommonDirectives(this.control, fieldMetadata, modelName);\n return this.control as Control;\n }\n\n this.control = new DatePicker({\n id: this.generateStableId(engineScopeId, bindingPath),\n value: {\n path: `${modelName}>${bindingPath}`,\n type: \"sap.ui.model.type.Date\",\n formatOptions: {\n source: { pattern: \"yyyy-MM-dd\" },\n pattern: \"yyyy-MM-dd\"\n }\n },\n displayFormat: \"long\",\n editable: !fieldMetadata.ui?.readOnly,\n required: fieldMetadata.required,\n change: (oEvent: sap.ui.base.Event) => {\n const val = oEvent.getParameter(\"value\");\n const result = this.validateAndApplyVisualState();\n if (this.onChange) {\n this.onChange(result.isValid, this.fieldKey);\n }\n }\n });\n\n return this.control as Control;\n }\n\n /**\n * Retrieves the current date string.\n * @returns {unknown} The date value.\n */\n protected getValue(): unknown {\n return this.control ? (this.control as DatePicker).getValue() : null;\n }\n\n /**\n * Applies dynamic read-only state.\n */\n protected applyState(): void {\n if (this.control && this.metadata) {\n if (!this.isEditable) return;\n const dp = this.control as DatePicker;\n dp.setEditable(!this.metadata.ui?.readOnly);\n dp.setRequired(this.metadata.required);\n }\n }\n}\n"],"mappings":"4FAAA,MAKSA,EAAUC,EAAA,cASZ,MAAMC,UAAmBF,EAWrBG,OAAOC,EAAmCC,EAAsBC,EAAoB,OAAQC,EAAwBC,GACvHC,KAAKD,SAAWA,EAChBC,KAAKC,SAAWN,EAEhB,IAAKK,KAAKE,WAAY,CAElBF,KAAKG,QAAU,IAAIC,EAAY,CAC3BC,GAAIL,KAAKM,iBAAiBR,EAAeF,GACzCW,KAAM,CACFC,KAAM,GAAGX,KAAaD,IACtBa,KAAM,yBACNC,cAAe,CACXC,OAAQ,CAAEC,QAAS,cACnBA,QAAS,iBAIrBZ,KAAKa,sBAAsBb,KAAKG,QAASR,EAAeE,GACxD,OAAOG,KAAKG,OAChB,CAEAH,KAAKG,QAAU,IAAIW,EAAW,CAC1BT,GAAIL,KAAKM,iBAAiBR,EAAeF,GACzCmB,MAAO,CACHP,KAAM,GAAGX,KAAaD,IACtBa,KAAM,yBACNC,cAAe,CACXC,OAAQ,CAAEC,QAAS,cACnBA,QAAS,eAGjBI,cAAe,OACfC,UAAWtB,EAAcuB,IAAIC,SAC7BC,SAAUzB,EAAcyB,SACxBC,OAASC,IACL,MAAMC,EAAMD,EAAOE,aAAa,SAChC,MAAMC,EAASzB,KAAK0B,8BACpB,GAAI1B,KAAKD,SAAU,CACfC,KAAKD,SAAS0B,EAAOE,QAAS3B,KAAK4B,SACvC,KAIR,OAAO5B,KAAKG,OAChB,CAMU0B,WACN,OAAO7B,KAAKG,QAAWH,KAAKG,QAAuB0B,WAAa,IACpE,CAKUC,aACN,GAAI9B,KAAKG,SAAWH,KAAKC,SAAU,CAC/B,IAAKD,KAAKE,WAAY,OACtB,MAAM6B,EAAK/B,KAAKG,QAChB4B,EAAGC,aAAahC,KAAKC,SAASiB,IAAIC,UAClCY,EAAGE,YAAYjC,KAAKC,SAASmB,SACjC,CACJ,EACH,IAAAc,EAAA,CAAAC,WAAA,MAAAD,EAAAzC,aAAA,OAAAyC,CAAA","ignoreList":[]}
1
+ {"version":3,"file":"DatePlugin.js","names":["BasePlugin","___BasePlugin","DatePlugin","render","fieldMetadata","bindingPath","modelName","engineScopeId","onChange","this","metadata","fieldKey","startsWith","substring","isEditable","control","TextControl","id","generateStableId","text","path","type","formatOptions","source","pattern","applyCommonDirectives","DatePicker","value","displayFormat","editable","ui","readOnly","required","change","oEvent","val","getParameter","result","validateAndApplyVisualState","isValid","getValue","applyState","dp","setEditable","setRequired","__exports","__esModule"],"sources":["DatePlugin.ts"],"sourcesContent":["/**\n * @file DatePlugin.ts\n * @description Renders a sap.m.DatePicker natively bound to ISO date strings.\n */\n\nimport { BasePlugin } from \"./BasePlugin\";\nimport { IPropertyMetadata } from \"../../interfaces/ISchema\";\nimport DatePicker from \"sap/m/DatePicker\";\nimport Control from \"sap/ui/core/Control\";\nimport TextControl from \"sap/m/Text\";\n\n/**\n * Handles rendering logic for Date strings.\n */\nexport class DatePlugin extends BasePlugin {\n /**\n * Renders a `sap.m.DatePicker` component.\n * \n * @param fieldMetadata The specific JSON schema properties for this field.\n * @param bindingPath The JSON path bound to this control.\n * @param modelName The UI5 JSONModel name.\n * @param engineScopeId The deterministic scope ID.\n * @param onChange The callback fired on value change.\n * @returns {Control} The configured DatePicker control.\n */\n public render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName: string = \"meta\", engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string) => void): Control {\n this.onChange = onChange;\n this.metadata = fieldMetadata;\n this.fieldKey = bindingPath.startsWith('/') ? bindingPath.substring(1) : bindingPath;\n \n if (!this.isEditable) {\n \n this.control = new TextControl({\n id: this.generateStableId(engineScopeId, bindingPath),\n text: {\n path: `${modelName}>${bindingPath}`,\n type: \"sap.ui.model.type.Date\",\n formatOptions: {\n source: { pattern: \"yyyy-MM-dd\" },\n pattern: \"yyyy-MM-dd\"\n }\n }\n });\n this.applyCommonDirectives(this.control, fieldMetadata, modelName);\n return this.control as Control;\n }\n\n this.control = new DatePicker({\n id: this.generateStableId(engineScopeId, bindingPath),\n value: {\n path: `${modelName}>${bindingPath}`,\n type: \"sap.ui.model.type.Date\",\n formatOptions: {\n source: { pattern: \"yyyy-MM-dd\" },\n pattern: \"yyyy-MM-dd\"\n }\n },\n displayFormat: \"long\",\n editable: !fieldMetadata.ui?.readOnly,\n required: fieldMetadata.required,\n change: (oEvent: sap.ui.base.Event) => {\n const val = oEvent.getParameter(\"value\");\n const result = this.validateAndApplyVisualState();\n if (this.onChange) {\n this.onChange(result.isValid, this.fieldKey);\n }\n }\n });\n\n return this.control as Control;\n }\n\n /**\n * Retrieves the current date string.\n * @returns {unknown} The date value.\n */\n protected getValue(): unknown {\n return this.control ? (this.control as DatePicker).getValue() : null;\n }\n\n /**\n * Applies dynamic read-only state.\n */\n protected applyState(): void {\n if (this.control && this.metadata) {\n if (!this.isEditable) return;\n const dp = this.control as DatePicker;\n dp.setEditable(!this.metadata.ui?.readOnly);\n dp.setRequired(this.metadata.required);\n }\n }\n}\n"],"mappings":"4FAAA,MAKSA,EAAUC,EAAA,cASZ,MAAMC,UAAmBF,EAWrBG,OAAOC,EAAmCC,EAAsBC,EAAoB,OAAQC,EAAwBC,GACvHC,KAAKD,SAAWA,EAChBC,KAAKC,SAAWN,EAChBK,KAAKE,SAAWN,EAAYO,WAAW,KAAOP,EAAYQ,UAAU,GAAKR,EAEzE,IAAKI,KAAKK,WAAY,CAElBL,KAAKM,QAAU,IAAIC,EAAY,CAC3BC,GAAIR,KAAKS,iBAAiBX,EAAeF,GACzCc,KAAM,CACFC,KAAM,GAAGd,KAAaD,IACtBgB,KAAM,yBACNC,cAAe,CACXC,OAAQ,CAAEC,QAAS,cACnBA,QAAS,iBAIrBf,KAAKgB,sBAAsBhB,KAAKM,QAASX,EAAeE,GACxD,OAAOG,KAAKM,OAChB,CAEAN,KAAKM,QAAU,IAAIW,EAAW,CAC1BT,GAAIR,KAAKS,iBAAiBX,EAAeF,GACzCsB,MAAO,CACHP,KAAM,GAAGd,KAAaD,IACtBgB,KAAM,yBACNC,cAAe,CACXC,OAAQ,CAAEC,QAAS,cACnBA,QAAS,eAGjBI,cAAe,OACfC,UAAWzB,EAAc0B,IAAIC,SAC7BC,SAAU5B,EAAc4B,SACxBC,OAASC,IACL,MAAMC,EAAMD,EAAOE,aAAa,SAChC,MAAMC,EAAS5B,KAAK6B,8BACpB,GAAI7B,KAAKD,SAAU,CACfC,KAAKD,SAAS6B,EAAOE,QAAS9B,KAAKE,SACvC,KAIR,OAAOF,KAAKM,OAChB,CAMUyB,WACN,OAAO/B,KAAKM,QAAWN,KAAKM,QAAuByB,WAAa,IACpE,CAKUC,aACN,GAAIhC,KAAKM,SAAWN,KAAKC,SAAU,CAC/B,IAAKD,KAAKK,WAAY,OACtB,MAAM4B,EAAKjC,KAAKM,QAChB2B,EAAGC,aAAalC,KAAKC,SAASoB,IAAIC,UAClCW,EAAGE,YAAYnC,KAAKC,SAASsB,SACjC,CACJ,EACH,IAAAa,EAAA,CAAAC,WAAA,MAAAD,EAAA3C,aAAA,OAAA2C,CAAA","ignoreList":[]}
@@ -26,6 +26,7 @@ export class DatePlugin extends BasePlugin {
26
26
  public render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName: string = "meta", engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string) => void): Control {
27
27
  this.onChange = onChange;
28
28
  this.metadata = fieldMetadata;
29
+ this.fieldKey = bindingPath.startsWith('/') ? bindingPath.substring(1) : bindingPath;
29
30
 
30
31
  if (!this.isEditable) {
31
32
 
@@ -23,6 +23,7 @@ sap.ui.define(["./BasePlugin", "sap/m/DateTimePicker", "sap/m/Text"], function (
23
23
  render(fieldMetadata, bindingPath, modelName = "meta", engineScopeId, onChange) {
24
24
  this.onChange = onChange;
25
25
  this.metadata = fieldMetadata;
26
+ this.fieldKey = bindingPath.startsWith('/') ? bindingPath.substring(1) : bindingPath;
26
27
  if (!this.isEditable) {
27
28
  this.control = new TextControl({
28
29
  id: this.generateStableId(engineScopeId, bindingPath),
@@ -1 +1 @@
1
- {"version":3,"file":"DateTimePlugin-dbg.js","names":["BasePlugin","___BasePlugin","DateTimePlugin","render","fieldMetadata","bindingPath","modelName","engineScopeId","onChange","metadata","isEditable","control","TextControl","id","generateStableId","text","path","type","formatOptions","source","pattern","applyCommonDirectives","DateTimePicker","value","editable","ui","readOnly","required","change","oEvent","val","getParameter","result","validateAndApplyVisualState","isValid","fieldKey","getValue","applyState","input","setEditable","setRequired","__exports","__esModule"],"sources":["DateTimePlugin.ts"],"sourcesContent":["/**\n * @file DateTimePlugin.ts\n * @description Handles rendering logic for DateTime strings (timestamps).\n */\n\nimport { BasePlugin } from \"./BasePlugin\";\nimport { IPropertyMetadata } from \"../../interfaces/ISchema\";\nimport DateTimePicker from \"sap/m/DateTimePicker\";\nimport Control from \"sap/ui/core/Control\";\nimport TextControl from \"sap/m/Text\";\n\n/**\n * Handles rendering and logic for timestamps/datetime inputs.\n */\nexport class DateTimePlugin extends BasePlugin {\n /**\n * Renders a `sap.m.DateTimePicker` component.\n * \n * @param fieldMetadata The specific JSON schema properties for this field.\n * @param bindingPath The JSON path bound to this control.\n * @param modelName The UI5 JSONModel name.\n * @param engineScopeId The deterministic scope ID.\n * @param onChange The callback fired on value change.\n * @returns {Control} The configured DateTimePicker control.\n */\n public render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName: string = \"meta\", engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string) => void): Control {\n this.onChange = onChange;\n this.metadata = fieldMetadata;\n \n if (!this.isEditable) {\n \n this.control = new TextControl({\n id: this.generateStableId(engineScopeId, bindingPath),\n text: {\n path: `${modelName}>${bindingPath}`,\n type: \"sap.ui.model.type.DateTime\",\n formatOptions: {\n source: { pattern: \"yyyy-MM-dd'T'HH:mm:ss'Z'\" },\n pattern: \"yyyy-MM-dd'T'HH:mm:ss'Z'\"\n }\n }\n });\n this.applyCommonDirectives(this.control, fieldMetadata, modelName);\n return this.control as Control;\n }\n\n this.control = new DateTimePicker({\n id: this.generateStableId(engineScopeId, bindingPath),\n value: {\n path: `${modelName}>${bindingPath}`,\n type: \"sap.ui.model.type.DateTime\",\n formatOptions: {\n source: { pattern: \"yyyy-MM-dd'T'HH:mm:ss'Z'\" },\n pattern: \"yyyy-MM-dd'T'HH:mm:ss'Z'\"\n }\n },\n editable: !fieldMetadata.ui?.readOnly,\n required: fieldMetadata.required,\n change: (oEvent: sap.ui.base.Event) => {\n const val = oEvent.getParameter(\"value\");\n const result = this.validateAndApplyVisualState();\n if (this.onChange) {\n this.onChange(result.isValid, this.fieldKey);\n }\n }\n });\n\n this.applyCommonDirectives(this.control, fieldMetadata, modelName);\n\n return this.control as Control;\n }\n\n /**\n * Retrieves the current datetime string.\n * @returns {unknown} The datetime value.\n */\n protected getValue(): unknown {\n return this.control ? (this.control as DateTimePicker).getValue() : null;\n }\n\n /**\n * Applies dynamic read-only state.\n */\n protected applyState(): void {\n if (this.control && this.metadata) {\n if (!this.isEditable) return;\n const input = this.control as DateTimePicker;\n input.setEditable(!this.metadata.ui?.readOnly);\n input.setRequired(this.metadata.required);\n }\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;EAHA,MAKSA,UAAU,GAAAC,aAAA;EAMnB;AACA;AACA;EACO,MAAMC,cAAc,SAASF,UAAU,CAAC;IAC3C;AACJ;AACA;AACA;AACA;AACA;AACA;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C,MAAM,GAAG,IAAI,CAACC,2BAA2B,CAAC,CAAC;UACjD,IAAI,IAAI,CAACzB,QAAQ,EAAE;YACf,IAAI,CAACA,QAAQ,CAACwB,MAAM,CAACE,OAAO,EAAE,IAAI,CAACC,QAAQ,CAAC;UAChD;QACJ;MACJ,CAAC,CAAC;MAEF,IAAI,CAACd,qBAAqB,CAAC,IAAI,CAACV,OAAO,EAAEP,aAAa,EAAEE,SAAS,CAAC;MAElE,OAAO,IAAI,CAACK,OAAO;IACvB;;IAEA;AACJ;AACA;AACA;IACcyB,QAAQA,CAAA,EAAY;MAC1B,OAAO,IAAI,CAACzB,OAAO,GAAI,IAAI,CAACA,OAAO,CAAoByB,QAAQ,CAAC,CAAC,GAAG,IAAI;IAC5E;;IAEA;AACJ;AACA;IACcC,UAAUA,CAAA,EAAS;MACzB,IAAI,IAAI,CAAC1B,OAAO,IAAI,IAAI,CAACF,QAAQ,EAAE;QAC/B,IAAI,CAAC,IAAI,CAACC,UAAU,EAAE;QACtB,MAAM4B,KAAK,GAAG,IAAI,CAAC3B,OAAyB;QAC5C2B,KAAK,CAACC,WAAW,CAAC,CAAC,IAAI,CAAC9B,QAAQ,CAACgB,EAAE,EAAEC,QAAQ,CAAC;QAC9CY,KAAK,CAACE,WAAW,CAAC,IAAI,CAAC/B,QAAQ,CAACkB,QAAQ,CAAC;MAC7C;IACJ;EACJ;EAAC,IAAAc,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAAvC,cAAA,GAAAA,cAAA;EAAA,OAAAuC,SAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"DateTimePlugin-dbg.js","names":["BasePlugin","___BasePlugin","DateTimePlugin","render","fieldMetadata","bindingPath","modelName","engineScopeId","onChange","metadata","fieldKey","startsWith","substring","isEditable","control","TextControl","id","generateStableId","text","path","type","formatOptions","source","pattern","applyCommonDirectives","DateTimePicker","value","editable","ui","readOnly","required","change","oEvent","val","getParameter","result","validateAndApplyVisualState","isValid","getValue","applyState","input","setEditable","setRequired","__exports","__esModule"],"sources":["DateTimePlugin.ts"],"sourcesContent":["/**\n * @file DateTimePlugin.ts\n * @description Handles rendering logic for DateTime strings (timestamps).\n */\n\nimport { BasePlugin } from \"./BasePlugin\";\nimport { IPropertyMetadata } from \"../../interfaces/ISchema\";\nimport DateTimePicker from \"sap/m/DateTimePicker\";\nimport Control from \"sap/ui/core/Control\";\nimport TextControl from \"sap/m/Text\";\n\n/**\n * Handles rendering and logic for timestamps/datetime inputs.\n */\nexport class DateTimePlugin extends BasePlugin {\n /**\n * Renders a `sap.m.DateTimePicker` component.\n * \n * @param fieldMetadata The specific JSON schema properties for this field.\n * @param bindingPath The JSON path bound to this control.\n * @param modelName The UI5 JSONModel name.\n * @param engineScopeId The deterministic scope ID.\n * @param onChange The callback fired on value change.\n * @returns {Control} The configured DateTimePicker control.\n */\n public render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName: string = \"meta\", engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string) => void): Control {\n this.onChange = onChange;\n this.metadata = fieldMetadata;\n this.fieldKey = bindingPath.startsWith('/') ? bindingPath.substring(1) : bindingPath;\n \n if (!this.isEditable) {\n \n this.control = new TextControl({\n id: this.generateStableId(engineScopeId, bindingPath),\n text: {\n path: `${modelName}>${bindingPath}`,\n type: \"sap.ui.model.type.DateTime\",\n formatOptions: {\n source: { pattern: \"yyyy-MM-dd'T'HH:mm:ss'Z'\" },\n pattern: \"yyyy-MM-dd'T'HH:mm:ss'Z'\"\n }\n }\n });\n this.applyCommonDirectives(this.control, fieldMetadata, modelName);\n return this.control as Control;\n }\n\n this.control = new DateTimePicker({\n id: this.generateStableId(engineScopeId, bindingPath),\n value: {\n path: `${modelName}>${bindingPath}`,\n type: \"sap.ui.model.type.DateTime\",\n formatOptions: {\n source: { pattern: \"yyyy-MM-dd'T'HH:mm:ss'Z'\" },\n pattern: \"yyyy-MM-dd'T'HH:mm:ss'Z'\"\n }\n },\n editable: !fieldMetadata.ui?.readOnly,\n required: fieldMetadata.required,\n change: (oEvent: sap.ui.base.Event) => {\n const val = oEvent.getParameter(\"value\");\n const result = this.validateAndApplyVisualState();\n if (this.onChange) {\n this.onChange(result.isValid, this.fieldKey);\n }\n }\n });\n\n this.applyCommonDirectives(this.control, fieldMetadata, modelName);\n\n return this.control as Control;\n }\n\n /**\n * Retrieves the current datetime string.\n * @returns {unknown} The datetime value.\n */\n protected getValue(): unknown {\n return this.control ? (this.control as DateTimePicker).getValue() : null;\n }\n\n /**\n * Applies dynamic read-only state.\n */\n protected applyState(): void {\n if (this.control && this.metadata) {\n if (!this.isEditable) return;\n const input = this.control as DateTimePicker;\n input.setEditable(!this.metadata.ui?.readOnly);\n input.setRequired(this.metadata.required);\n }\n }\n}\n"],"mappings":";;;EAAA;AACA;AACA;AACA;EAHA,MAKSA,UAAU,GAAAC,aAAA;EAMnB;AACA;AACA;EACO,MAAMC,cAAc,SAASF,UAAU,CAAC;IAC3C;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACWG,MAAMA,CAACC,aAAgC,EAAGC,WAAmB,EAAGC,SAAiB,GAAG,MAAM,EAAEC,aAAsB,EAAEC,QAAwD,EAAW;MAC1L,IAAI,CAACA,QAAQ,GAAGA,QAAQ;MACxB,IAAI,CAACC,QAAQ,GAAGL,aAAa;MAC7B,IAAI,CAACM,QAAQ,GAAGL,WAAW,CAACM,UAAU,CAAC,GAAG,CAAC,GAAGN,WAAW,CAACO,SAAS,CAAC,CAAC,CAAC,GAAGP,WAAW;MAEpF,IAAI,CAAC,IAAI,CAACQ,UAAU,EAAE;QAElB,IAAI,CAACC,OAAO,GAAG,IAAIC,WAAW,CAAC;UAC3BC,EAAE,EAAE,IAAI,CAACC,gBAAgB,CAACV,aAAa,EAAEF,WAAW,CAAC;UACrDa,IAAI,EAAE;YACFC,IAAI,EAAE,GAAGb,SAAS,IAAID,WAAW,EAAE;YACnCe,IAAI,EAAE,4BAA4B;YAClCC,aAAa,EAAE;cACXC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EA;AACJ;AACA;IACcC,UAAUA,CAAA,EAAS;MACzB,IAAI,IAAI,CAACzB,OAAO,IAAI,IAAI,CAACL,QAAQ,EAAE;QAC/B,IAAI,CAAC,IAAI,CAACI,UAAU,EAAE;QACtB,MAAM2B,KAAK,GAAG,IAAI,CAAC1B,OAAyB;QAC5C0B,KAAK,CAACC,WAAW,CAAC,CAAC,IAAI,CAAChC,QAAQ,CAACmB,EAAE,EAAEC,QAAQ,CAAC;QAC9CW,KAAK,CAACE,WAAW,CAAC,IAAI,CAACjC,QAAQ,CAACqB,QAAQ,CAAC;MAC7C;IACJ;EACJ;EAAC,IAAAa,SAAA;IAAAC,UAAA;EAAA;EAAAD,SAAA,CAAAzC,cAAA,GAAAA,cAAA;EAAA,OAAAyC,SAAA;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"DateTimePlugin.d.ts","sourceRoot":"../../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,4DAA4D,CAAC;IAC5E;;;OAGG;IAEH,OAAO,EAAE,UAAU,EAAE,MAAM,wDAAwD,CAAC;IACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;IAElF,OAAO,OAAO,MAAM,qBAAqB,CAAC;IAG1C;;OAEG;IACH,MAAa,cAAe,SAAQ,UAAU;QAC1C;;;;;;;;;WASG;QACI,MAAM,CAAC,aAAa,EAAE,iBAAiB,EAAG,WAAW,EAAE,MAAM,EAAG,SAAS,GAAE,MAAe,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO;QA+C7L;;;WAGG;QACH,SAAS,CAAC,QAAQ,IAAI,OAAO;QAI7B;;WAEG;QACH,SAAS,CAAC,UAAU,IAAI,IAAI;KAQ/B;CAEA"}
1
+ {"version":3,"file":"DateTimePlugin.d.ts","sourceRoot":"../../../../../../../../..","sources":["src/nz/co/siliconst/ui5/metaui/plugins/controls/DateTimePlugin.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,4DAA4D,CAAC;IAC5E;;;OAGG;IAEH,OAAO,EAAE,UAAU,EAAE,MAAM,wDAAwD,CAAC;IACpF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;IAElF,OAAO,OAAO,MAAM,qBAAqB,CAAC;IAG1C;;OAEG;IACH,MAAa,cAAe,SAAQ,UAAU;QAC1C;;;;;;;;;WASG;QACI,MAAM,CAAC,aAAa,EAAE,iBAAiB,EAAG,WAAW,EAAE,MAAM,EAAG,SAAS,GAAE,MAAe,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO;QAgD7L;;;WAGG;QACH,SAAS,CAAC,QAAQ,IAAI,OAAO;QAI7B;;WAEG;QACH,SAAS,CAAC,UAAU,IAAI,IAAI;KAQ/B;CAEA"}
@@ -1,2 +1,2 @@
1
- sap.ui.define(["./BasePlugin","sap/m/DateTimePicker","sap/m/Text"],function(t,e,i){"use strict";const a=t["BasePlugin"];class s extends a{render(t,a,s="meta",n,r){this.onChange=r;this.metadata=t;if(!this.isEditable){this.control=new i({id:this.generateStableId(n,a),text:{path:`${s}>${a}`,type:"sap.ui.model.type.DateTime",formatOptions:{source:{pattern:"yyyy-MM-dd'T'HH:mm:ss'Z'"},pattern:"yyyy-MM-dd'T'HH:mm:ss'Z'"}}});this.applyCommonDirectives(this.control,t,s);return this.control}this.control=new e({id:this.generateStableId(n,a),value:{path:`${s}>${a}`,type:"sap.ui.model.type.DateTime",formatOptions:{source:{pattern:"yyyy-MM-dd'T'HH:mm:ss'Z'"},pattern:"yyyy-MM-dd'T'HH:mm:ss'Z'"}},editable:!t.ui?.readOnly,required:t.required,change:t=>{const e=t.getParameter("value");const i=this.validateAndApplyVisualState();if(this.onChange){this.onChange(i.isValid,this.fieldKey)}}});this.applyCommonDirectives(this.control,t,s);return this.control}getValue(){return this.control?this.control.getValue():null}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;const t=this.control;t.setEditable(!this.metadata.ui?.readOnly);t.setRequired(this.metadata.required)}}}var n={__esModule:true};n.DateTimePlugin=s;return n});
1
+ sap.ui.define(["./BasePlugin","sap/m/DateTimePicker","sap/m/Text"],function(t,e,i){"use strict";const s=t["BasePlugin"];class a extends s{render(t,s,a="meta",n,r){this.onChange=r;this.metadata=t;this.fieldKey=s.startsWith("/")?s.substring(1):s;if(!this.isEditable){this.control=new i({id:this.generateStableId(n,s),text:{path:`${a}>${s}`,type:"sap.ui.model.type.DateTime",formatOptions:{source:{pattern:"yyyy-MM-dd'T'HH:mm:ss'Z'"},pattern:"yyyy-MM-dd'T'HH:mm:ss'Z'"}}});this.applyCommonDirectives(this.control,t,a);return this.control}this.control=new e({id:this.generateStableId(n,s),value:{path:`${a}>${s}`,type:"sap.ui.model.type.DateTime",formatOptions:{source:{pattern:"yyyy-MM-dd'T'HH:mm:ss'Z'"},pattern:"yyyy-MM-dd'T'HH:mm:ss'Z'"}},editable:!t.ui?.readOnly,required:t.required,change:t=>{const e=t.getParameter("value");const i=this.validateAndApplyVisualState();if(this.onChange){this.onChange(i.isValid,this.fieldKey)}}});this.applyCommonDirectives(this.control,t,a);return this.control}getValue(){return this.control?this.control.getValue():null}applyState(){if(this.control&&this.metadata){if(!this.isEditable)return;const t=this.control;t.setEditable(!this.metadata.ui?.readOnly);t.setRequired(this.metadata.required)}}}var n={__esModule:true};n.DateTimePlugin=a;return n});
2
2
  //# sourceMappingURL=DateTimePlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DateTimePlugin.js","names":["BasePlugin","___BasePlugin","DateTimePlugin","render","fieldMetadata","bindingPath","modelName","engineScopeId","onChange","this","metadata","isEditable","control","TextControl","id","generateStableId","text","path","type","formatOptions","source","pattern","applyCommonDirectives","DateTimePicker","value","editable","ui","readOnly","required","change","oEvent","val","getParameter","result","validateAndApplyVisualState","isValid","fieldKey","getValue","applyState","input","setEditable","setRequired","__exports","__esModule"],"sources":["DateTimePlugin.ts"],"sourcesContent":["/**\n * @file DateTimePlugin.ts\n * @description Handles rendering logic for DateTime strings (timestamps).\n */\n\nimport { BasePlugin } from \"./BasePlugin\";\nimport { IPropertyMetadata } from \"../../interfaces/ISchema\";\nimport DateTimePicker from \"sap/m/DateTimePicker\";\nimport Control from \"sap/ui/core/Control\";\nimport TextControl from \"sap/m/Text\";\n\n/**\n * Handles rendering and logic for timestamps/datetime inputs.\n */\nexport class DateTimePlugin extends BasePlugin {\n /**\n * Renders a `sap.m.DateTimePicker` component.\n * \n * @param fieldMetadata The specific JSON schema properties for this field.\n * @param bindingPath The JSON path bound to this control.\n * @param modelName The UI5 JSONModel name.\n * @param engineScopeId The deterministic scope ID.\n * @param onChange The callback fired on value change.\n * @returns {Control} The configured DateTimePicker control.\n */\n public render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName: string = \"meta\", engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string) => void): Control {\n this.onChange = onChange;\n this.metadata = fieldMetadata;\n \n if (!this.isEditable) {\n \n this.control = new TextControl({\n id: this.generateStableId(engineScopeId, bindingPath),\n text: {\n path: `${modelName}>${bindingPath}`,\n type: \"sap.ui.model.type.DateTime\",\n formatOptions: {\n source: { pattern: \"yyyy-MM-dd'T'HH:mm:ss'Z'\" },\n pattern: \"yyyy-MM-dd'T'HH:mm:ss'Z'\"\n }\n }\n });\n this.applyCommonDirectives(this.control, fieldMetadata, modelName);\n return this.control as Control;\n }\n\n this.control = new DateTimePicker({\n id: this.generateStableId(engineScopeId, bindingPath),\n value: {\n path: `${modelName}>${bindingPath}`,\n type: \"sap.ui.model.type.DateTime\",\n formatOptions: {\n source: { pattern: \"yyyy-MM-dd'T'HH:mm:ss'Z'\" },\n pattern: \"yyyy-MM-dd'T'HH:mm:ss'Z'\"\n }\n },\n editable: !fieldMetadata.ui?.readOnly,\n required: fieldMetadata.required,\n change: (oEvent: sap.ui.base.Event) => {\n const val = oEvent.getParameter(\"value\");\n const result = this.validateAndApplyVisualState();\n if (this.onChange) {\n this.onChange(result.isValid, this.fieldKey);\n }\n }\n });\n\n this.applyCommonDirectives(this.control, fieldMetadata, modelName);\n\n return this.control as Control;\n }\n\n /**\n * Retrieves the current datetime string.\n * @returns {unknown} The datetime value.\n */\n protected getValue(): unknown {\n return this.control ? (this.control as DateTimePicker).getValue() : null;\n }\n\n /**\n * Applies dynamic read-only state.\n */\n protected applyState(): void {\n if (this.control && this.metadata) {\n if (!this.isEditable) return;\n const input = this.control as DateTimePicker;\n input.setEditable(!this.metadata.ui?.readOnly);\n input.setRequired(this.metadata.required);\n }\n }\n}\n"],"mappings":"gGAAA,MAKSA,EAAUC,EAAA,cASZ,MAAMC,UAAuBF,EAWzBG,OAAOC,EAAmCC,EAAsBC,EAAoB,OAAQC,EAAwBC,GACvHC,KAAKD,SAAWA,EAChBC,KAAKC,SAAWN,EAEhB,IAAKK,KAAKE,WAAY,CAElBF,KAAKG,QAAU,IAAIC,EAAY,CAC3BC,GAAIL,KAAKM,iBAAiBR,EAAeF,GACzCW,KAAM,CACFC,KAAM,GAAGX,KAAaD,IACtBa,KAAM,6BACNC,cAAe,CACXC,OAAQ,CAAEC,QAAS,4BACnBA,QAAS,+BAIrBZ,KAAKa,sBAAsBb,KAAKG,QAASR,EAAeE,GACxD,OAAOG,KAAKG,OAChB,CAEAH,KAAKG,QAAU,IAAIW,EAAe,CAC9BT,GAAIL,KAAKM,iBAAiBR,EAAeF,GACzCmB,MAAO,CACHP,KAAM,GAAGX,KAAaD,IACtBa,KAAM,6BACNC,cAAe,CACXC,OAAQ,CAAEC,QAAS,4BACnBA,QAAS,6BAGjBI,UAAWrB,EAAcsB,IAAIC,SAC7BC,SAAUxB,EAAcwB,SACxBC,OAASC,IACL,MAAMC,EAAMD,EAAOE,aAAa,SAChC,MAAMC,EAASxB,KAAKyB,8BACpB,GAAIzB,KAAKD,SAAU,CACfC,KAAKD,SAASyB,EAAOE,QAAS1B,KAAK2B,SACvC,KAIR3B,KAAKa,sBAAsBb,KAAKG,QAASR,EAAeE,GAExD,OAAOG,KAAKG,OAChB,CAMUyB,WACN,OAAO5B,KAAKG,QAAWH,KAAKG,QAA2ByB,WAAa,IACxE,CAKUC,aACN,GAAI7B,KAAKG,SAAWH,KAAKC,SAAU,CAC/B,IAAKD,KAAKE,WAAY,OACtB,MAAM4B,EAAQ9B,KAAKG,QACnB2B,EAAMC,aAAa/B,KAAKC,SAASgB,IAAIC,UACrCY,EAAME,YAAYhC,KAAKC,SAASkB,SACpC,CACJ,EACH,IAAAc,EAAA,CAAAC,WAAA,MAAAD,EAAAxC,iBAAA,OAAAwC,CAAA","ignoreList":[]}
1
+ {"version":3,"file":"DateTimePlugin.js","names":["BasePlugin","___BasePlugin","DateTimePlugin","render","fieldMetadata","bindingPath","modelName","engineScopeId","onChange","this","metadata","fieldKey","startsWith","substring","isEditable","control","TextControl","id","generateStableId","text","path","type","formatOptions","source","pattern","applyCommonDirectives","DateTimePicker","value","editable","ui","readOnly","required","change","oEvent","val","getParameter","result","validateAndApplyVisualState","isValid","getValue","applyState","input","setEditable","setRequired","__exports","__esModule"],"sources":["DateTimePlugin.ts"],"sourcesContent":["/**\n * @file DateTimePlugin.ts\n * @description Handles rendering logic for DateTime strings (timestamps).\n */\n\nimport { BasePlugin } from \"./BasePlugin\";\nimport { IPropertyMetadata } from \"../../interfaces/ISchema\";\nimport DateTimePicker from \"sap/m/DateTimePicker\";\nimport Control from \"sap/ui/core/Control\";\nimport TextControl from \"sap/m/Text\";\n\n/**\n * Handles rendering and logic for timestamps/datetime inputs.\n */\nexport class DateTimePlugin extends BasePlugin {\n /**\n * Renders a `sap.m.DateTimePicker` component.\n * \n * @param fieldMetadata The specific JSON schema properties for this field.\n * @param bindingPath The JSON path bound to this control.\n * @param modelName The UI5 JSONModel name.\n * @param engineScopeId The deterministic scope ID.\n * @param onChange The callback fired on value change.\n * @returns {Control} The configured DateTimePicker control.\n */\n public render(fieldMetadata: IPropertyMetadata, bindingPath: string, modelName: string = \"meta\", engineScopeId?: string, onChange?: (isValid: boolean, fieldKey?: string) => void): Control {\n this.onChange = onChange;\n this.metadata = fieldMetadata;\n this.fieldKey = bindingPath.startsWith('/') ? bindingPath.substring(1) : bindingPath;\n \n if (!this.isEditable) {\n \n this.control = new TextControl({\n id: this.generateStableId(engineScopeId, bindingPath),\n text: {\n path: `${modelName}>${bindingPath}`,\n type: \"sap.ui.model.type.DateTime\",\n formatOptions: {\n source: { pattern: \"yyyy-MM-dd'T'HH:mm:ss'Z'\" },\n pattern: \"yyyy-MM-dd'T'HH:mm:ss'Z'\"\n }\n }\n });\n this.applyCommonDirectives(this.control, fieldMetadata, modelName);\n return this.control as Control;\n }\n\n this.control = new DateTimePicker({\n id: this.generateStableId(engineScopeId, bindingPath),\n value: {\n path: `${modelName}>${bindingPath}`,\n type: \"sap.ui.model.type.DateTime\",\n formatOptions: {\n source: { pattern: \"yyyy-MM-dd'T'HH:mm:ss'Z'\" },\n pattern: \"yyyy-MM-dd'T'HH:mm:ss'Z'\"\n }\n },\n editable: !fieldMetadata.ui?.readOnly,\n required: fieldMetadata.required,\n change: (oEvent: sap.ui.base.Event) => {\n const val = oEvent.getParameter(\"value\");\n const result = this.validateAndApplyVisualState();\n if (this.onChange) {\n this.onChange(result.isValid, this.fieldKey);\n }\n }\n });\n\n this.applyCommonDirectives(this.control, fieldMetadata, modelName);\n\n return this.control as Control;\n }\n\n /**\n * Retrieves the current datetime string.\n * @returns {unknown} The datetime value.\n */\n protected getValue(): unknown {\n return this.control ? (this.control as DateTimePicker).getValue() : null;\n }\n\n /**\n * Applies dynamic read-only state.\n */\n protected applyState(): void {\n if (this.control && this.metadata) {\n if (!this.isEditable) return;\n const input = this.control as DateTimePicker;\n input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