@syncfusion/ej2-form-renderer 34.2.2

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 (214) hide show
  1. package/README.md +60 -0
  2. package/common.d.ts +4 -0
  3. package/common.js +4 -0
  4. package/dist/ej2-form-renderer.umd.min.js +11 -0
  5. package/dist/ej2-form-renderer.umd.min.js.map +1 -0
  6. package/dist/es6/ej2-form-renderer.es2015.js +6787 -0
  7. package/dist/es6/ej2-form-renderer.es2015.js.map +1 -0
  8. package/dist/es6/ej2-form-renderer.es5.js +7055 -0
  9. package/dist/es6/ej2-form-renderer.es5.js.map +1 -0
  10. package/dist/global/ej2-form-renderer.min.js +11 -0
  11. package/dist/global/ej2-form-renderer.min.js.map +1 -0
  12. package/dist/global/index.d.ts +14 -0
  13. package/form-renderer.d.ts +4 -0
  14. package/form-renderer.js +4 -0
  15. package/index.d.ts +4 -0
  16. package/index.js +4 -0
  17. package/license +10 -0
  18. package/package.json +41 -0
  19. package/src/common/checkbox-group.d.ts +55 -0
  20. package/src/common/checkbox-group.js +241 -0
  21. package/src/common/conditional-rule-engine.d.ts +241 -0
  22. package/src/common/conditional-rule-engine.js +505 -0
  23. package/src/common/custom-validation-engine.d.ts +57 -0
  24. package/src/common/custom-validation-engine.js +152 -0
  25. package/src/common/datagrid-component.d.ts +156 -0
  26. package/src/common/datagrid-component.js +410 -0
  27. package/src/common/expressions/dependency-tracker.d.ts +29 -0
  28. package/src/common/expressions/dependency-tracker.js +137 -0
  29. package/src/common/expressions/expression-engine.d.ts +94 -0
  30. package/src/common/expressions/expression-engine.js +514 -0
  31. package/src/common/expressions/expression-parser.d.ts +40 -0
  32. package/src/common/expressions/expression-parser.js +270 -0
  33. package/src/common/expressions/grid-expressions.d.ts +24 -0
  34. package/src/common/expressions/grid-expressions.js +92 -0
  35. package/src/common/expressions/index.d.ts +4 -0
  36. package/src/common/expressions/index.js +4 -0
  37. package/src/common/index.d.ts +10 -0
  38. package/src/common/index.js +10 -0
  39. package/src/common/json-converter.d.ts +945 -0
  40. package/src/common/json-converter.js +1110 -0
  41. package/src/common/minmax-rule-engine.d.ts +105 -0
  42. package/src/common/minmax-rule-engine.js +380 -0
  43. package/src/common/option-fetcher.d.ts +30 -0
  44. package/src/common/option-fetcher.js +139 -0
  45. package/src/common/parser.d.ts +98 -0
  46. package/src/common/parser.js +788 -0
  47. package/src/common/static-html-renderer.d.ts +45 -0
  48. package/src/common/static-html-renderer.js +77 -0
  49. package/src/common/utils.d.ts +116 -0
  50. package/src/common/utils.js +484 -0
  51. package/src/form-renderer/form-renderer-model.d.ts +65 -0
  52. package/src/form-renderer/form-renderer.d.ts +425 -0
  53. package/src/form-renderer/form-renderer.js +2277 -0
  54. package/src/form-renderer/index.d.ts +6 -0
  55. package/src/form-renderer/index.js +5 -0
  56. package/src/form-renderer/render-form-field.d.ts +31 -0
  57. package/src/form-renderer/render-form-field.js +816 -0
  58. package/src/form-renderer/types/form-schema.d.ts +452 -0
  59. package/src/form-renderer/types/form-schema.js +32 -0
  60. package/src/global.js +1 -0
  61. package/src/index.d.ts +4 -0
  62. package/src/index.js +4 -0
  63. package/styles/bds-lite.css +599 -0
  64. package/styles/bds-lite.scss +2 -0
  65. package/styles/bds.css +599 -0
  66. package/styles/bds.scss +2 -0
  67. package/styles/bootstrap-dark-lite.css +608 -0
  68. package/styles/bootstrap-dark-lite.scss +2 -0
  69. package/styles/bootstrap-dark.css +608 -0
  70. package/styles/bootstrap-dark.scss +2 -0
  71. package/styles/bootstrap-lite.css +595 -0
  72. package/styles/bootstrap-lite.scss +2 -0
  73. package/styles/bootstrap.css +595 -0
  74. package/styles/bootstrap.scss +2 -0
  75. package/styles/bootstrap4-lite.css +595 -0
  76. package/styles/bootstrap4-lite.scss +2 -0
  77. package/styles/bootstrap4.css +595 -0
  78. package/styles/bootstrap4.scss +2 -0
  79. package/styles/bootstrap5-dark-lite.css +595 -0
  80. package/styles/bootstrap5-dark-lite.scss +2 -0
  81. package/styles/bootstrap5-dark.css +595 -0
  82. package/styles/bootstrap5-dark.scss +2 -0
  83. package/styles/bootstrap5-lite.css +595 -0
  84. package/styles/bootstrap5-lite.scss +2 -0
  85. package/styles/bootstrap5.3-lite.css +679 -0
  86. package/styles/bootstrap5.3-lite.scss +2 -0
  87. package/styles/bootstrap5.3.css +679 -0
  88. package/styles/bootstrap5.3.scss +2 -0
  89. package/styles/bootstrap5.css +595 -0
  90. package/styles/bootstrap5.scss +2 -0
  91. package/styles/fabric-dark-lite.css +608 -0
  92. package/styles/fabric-dark-lite.scss +2 -0
  93. package/styles/fabric-dark.css +608 -0
  94. package/styles/fabric-dark.scss +2 -0
  95. package/styles/fabric-lite.css +595 -0
  96. package/styles/fabric-lite.scss +2 -0
  97. package/styles/fabric.css +595 -0
  98. package/styles/fabric.scss +2 -0
  99. package/styles/fluent-dark-lite.css +595 -0
  100. package/styles/fluent-dark-lite.scss +2 -0
  101. package/styles/fluent-dark.css +595 -0
  102. package/styles/fluent-dark.scss +2 -0
  103. package/styles/fluent-lite.css +595 -0
  104. package/styles/fluent-lite.scss +2 -0
  105. package/styles/fluent.css +595 -0
  106. package/styles/fluent.scss +2 -0
  107. package/styles/fluent2-lite.css +681 -0
  108. package/styles/fluent2-lite.scss +2 -0
  109. package/styles/fluent2.css +681 -0
  110. package/styles/fluent2.scss +2 -0
  111. package/styles/form-renderer/_all.scss +2 -0
  112. package/styles/form-renderer/_bds-definition.scss +8 -0
  113. package/styles/form-renderer/_bootstrap-dark-definition.scss +8 -0
  114. package/styles/form-renderer/_bootstrap-definition.scss +8 -0
  115. package/styles/form-renderer/_bootstrap4-definition.scss +8 -0
  116. package/styles/form-renderer/_bootstrap5-dark-definition.scss +8 -0
  117. package/styles/form-renderer/_bootstrap5-definition.scss +8 -0
  118. package/styles/form-renderer/_bootstrap5.3-definition.scss +8 -0
  119. package/styles/form-renderer/_fabric-dark-definition.scss +8 -0
  120. package/styles/form-renderer/_fabric-definition.scss +8 -0
  121. package/styles/form-renderer/_fluent-dark-definition.scss +8 -0
  122. package/styles/form-renderer/_fluent-definition.scss +8 -0
  123. package/styles/form-renderer/_fluent2-definition.scss +8 -0
  124. package/styles/form-renderer/_highcontrast-definition.scss +8 -0
  125. package/styles/form-renderer/_highcontrast-light-definition.scss +8 -0
  126. package/styles/form-renderer/_layout.scss +480 -0
  127. package/styles/form-renderer/_material-dark-definition.scss +8 -0
  128. package/styles/form-renderer/_material-definition.scss +8 -0
  129. package/styles/form-renderer/_material3-dark-definition.scss +8 -0
  130. package/styles/form-renderer/_material3-definition.scss +8 -0
  131. package/styles/form-renderer/_mixin.scss +26 -0
  132. package/styles/form-renderer/_tailwind-dark-definition.scss +8 -0
  133. package/styles/form-renderer/_tailwind-definition.scss +8 -0
  134. package/styles/form-renderer/_tailwind3-definition.scss +8 -0
  135. package/styles/form-renderer/_theme.scss +69 -0
  136. package/styles/form-renderer/_variables.scss +2 -0
  137. package/styles/form-renderer/bds.css +599 -0
  138. package/styles/form-renderer/bds.scss +2 -0
  139. package/styles/form-renderer/bootstrap-dark.css +608 -0
  140. package/styles/form-renderer/bootstrap-dark.scss +2 -0
  141. package/styles/form-renderer/bootstrap.css +595 -0
  142. package/styles/form-renderer/bootstrap.scss +2 -0
  143. package/styles/form-renderer/bootstrap4.css +595 -0
  144. package/styles/form-renderer/bootstrap4.scss +2 -0
  145. package/styles/form-renderer/bootstrap5-dark.css +595 -0
  146. package/styles/form-renderer/bootstrap5-dark.scss +2 -0
  147. package/styles/form-renderer/bootstrap5.3.css +679 -0
  148. package/styles/form-renderer/bootstrap5.3.scss +2 -0
  149. package/styles/form-renderer/bootstrap5.css +595 -0
  150. package/styles/form-renderer/bootstrap5.scss +2 -0
  151. package/styles/form-renderer/fabric-dark.css +608 -0
  152. package/styles/form-renderer/fabric-dark.scss +2 -0
  153. package/styles/form-renderer/fabric.css +595 -0
  154. package/styles/form-renderer/fabric.scss +2 -0
  155. package/styles/form-renderer/fluent-dark.css +595 -0
  156. package/styles/form-renderer/fluent-dark.scss +2 -0
  157. package/styles/form-renderer/fluent.css +595 -0
  158. package/styles/form-renderer/fluent.scss +2 -0
  159. package/styles/form-renderer/fluent2.css +681 -0
  160. package/styles/form-renderer/fluent2.scss +2 -0
  161. package/styles/form-renderer/highcontrast-light.css +595 -0
  162. package/styles/form-renderer/highcontrast-light.scss +2 -0
  163. package/styles/form-renderer/highcontrast.css +608 -0
  164. package/styles/form-renderer/highcontrast.scss +2 -0
  165. package/styles/form-renderer/material-dark.css +608 -0
  166. package/styles/form-renderer/material-dark.scss +2 -0
  167. package/styles/form-renderer/material.css +595 -0
  168. package/styles/form-renderer/material.scss +2 -0
  169. package/styles/form-renderer/material3-dark.css +677 -0
  170. package/styles/form-renderer/material3-dark.scss +2 -0
  171. package/styles/form-renderer/material3.css +679 -0
  172. package/styles/form-renderer/material3.scss +2 -0
  173. package/styles/form-renderer/tailwind-dark.css +595 -0
  174. package/styles/form-renderer/tailwind-dark.scss +2 -0
  175. package/styles/form-renderer/tailwind.css +595 -0
  176. package/styles/form-renderer/tailwind.scss +2 -0
  177. package/styles/form-renderer/tailwind3.css +669 -0
  178. package/styles/form-renderer/tailwind3.scss +2 -0
  179. package/styles/highcontrast-light-lite.css +595 -0
  180. package/styles/highcontrast-light-lite.scss +2 -0
  181. package/styles/highcontrast-light.css +595 -0
  182. package/styles/highcontrast-light.scss +2 -0
  183. package/styles/highcontrast-lite.css +608 -0
  184. package/styles/highcontrast-lite.scss +2 -0
  185. package/styles/highcontrast.css +608 -0
  186. package/styles/highcontrast.scss +2 -0
  187. package/styles/material-dark-lite.css +608 -0
  188. package/styles/material-dark-lite.scss +2 -0
  189. package/styles/material-dark.css +608 -0
  190. package/styles/material-dark.scss +2 -0
  191. package/styles/material-lite.css +595 -0
  192. package/styles/material-lite.scss +2 -0
  193. package/styles/material.css +595 -0
  194. package/styles/material.scss +2 -0
  195. package/styles/material3-dark-lite.css +677 -0
  196. package/styles/material3-dark-lite.scss +2 -0
  197. package/styles/material3-dark.css +677 -0
  198. package/styles/material3-dark.scss +2 -0
  199. package/styles/material3-lite.css +679 -0
  200. package/styles/material3-lite.scss +2 -0
  201. package/styles/material3.css +679 -0
  202. package/styles/material3.scss +2 -0
  203. package/styles/tailwind-dark-lite.css +595 -0
  204. package/styles/tailwind-dark-lite.scss +2 -0
  205. package/styles/tailwind-dark.css +595 -0
  206. package/styles/tailwind-dark.scss +2 -0
  207. package/styles/tailwind-lite.css +595 -0
  208. package/styles/tailwind-lite.scss +2 -0
  209. package/styles/tailwind.css +595 -0
  210. package/styles/tailwind.scss +2 -0
  211. package/styles/tailwind3-lite.css +669 -0
  212. package/styles/tailwind3-lite.scss +2 -0
  213. package/styles/tailwind3.css +669 -0
  214. package/styles/tailwind3.scss +2 -0
@@ -0,0 +1,45 @@
1
+ /**
2
+ * @private
3
+ * `StaticHtmlRenderer` is the Category C native reimplementation of
4
+ * `Common/StaticHtmlRenderer.tsx`.
5
+ *
6
+ * Renders raw HTML into a `div`. Calls `SanitizeHtmlHelper.sanitize`
7
+ * **only when** `enableHtmlSanitizer` is true; otherwise renders the raw
8
+ * content. Supports an optional `id`.
9
+ *
10
+ * Mirrors the React component's `useMemo([content])` memoization by
11
+ * recomputing the rendered string only when `content` changes — the host
12
+ * replaces the inner HTML directly via `update()`.
13
+ */
14
+ export declare class StaticHtmlRenderer {
15
+ private el;
16
+ private content;
17
+ private enableHtmlSanitizer;
18
+ private id?;
19
+ constructor(options: {
20
+ content: string;
21
+ id?: string;
22
+ enableHtmlSanitizer?: boolean;
23
+ target?: HTMLElement;
24
+ });
25
+ private resolveHtml;
26
+ /**
27
+ * Create and return the container element with the rendered HTML
28
+ * already injected. The caller appends the returned element to the DOM.
29
+ */
30
+ render(): HTMLElement;
31
+ /**
32
+ * Update the rendered content in-place (re-runs the sanitization /
33
+ * raw-pass-through). Used by the host when `content` changes.
34
+ */
35
+ update(content: string): void;
36
+ /**
37
+ * Return the live host element (or null before `render()`).
38
+ */
39
+ getElement(): HTMLElement | null;
40
+ /**
41
+ * @private
42
+ */
43
+ destroy(): void;
44
+ }
45
+ export default StaticHtmlRenderer;
@@ -0,0 +1,77 @@
1
+ import { isNullOrUndefined, SanitizeHtmlHelper } from '@syncfusion/ej2-base';
2
+ /**
3
+ * @private
4
+ * `StaticHtmlRenderer` is the Category C native reimplementation of
5
+ * `Common/StaticHtmlRenderer.tsx`.
6
+ *
7
+ * Renders raw HTML into a `div`. Calls `SanitizeHtmlHelper.sanitize`
8
+ * **only when** `enableHtmlSanitizer` is true; otherwise renders the raw
9
+ * content. Supports an optional `id`.
10
+ *
11
+ * Mirrors the React component's `useMemo([content])` memoization by
12
+ * recomputing the rendered string only when `content` changes — the host
13
+ * replaces the inner HTML directly via `update()`.
14
+ */
15
+ var StaticHtmlRenderer = /** @class */ (function () {
16
+ function StaticHtmlRenderer(options) {
17
+ this.content = options.content;
18
+ this.id = options.id;
19
+ this.enableHtmlSanitizer = isNullOrUndefined(options.enableHtmlSanitizer) ? true : options.enableHtmlSanitizer;
20
+ this.el = options.target || null;
21
+ }
22
+ StaticHtmlRenderer.prototype.resolveHtml = function (content) {
23
+ try {
24
+ if (this.enableHtmlSanitizer) {
25
+ return SanitizeHtmlHelper.sanitize(content);
26
+ }
27
+ return content;
28
+ }
29
+ catch (error) {
30
+ return '';
31
+ }
32
+ };
33
+ /**
34
+ * Create and return the container element with the rendered HTML
35
+ * already injected. The caller appends the returned element to the DOM.
36
+ */
37
+ StaticHtmlRenderer.prototype.render = function () {
38
+ var div = document.createElement('div');
39
+ if (this.id) {
40
+ div.id = this.id;
41
+ }
42
+ div.innerHTML = this.resolveHtml(this.content);
43
+ this.el = div;
44
+ return div;
45
+ };
46
+ /**
47
+ * Update the rendered content in-place (re-runs the sanitization /
48
+ * raw-pass-through). Used by the host when `content` changes.
49
+ */
50
+ StaticHtmlRenderer.prototype.update = function (content) {
51
+ this.content = content;
52
+ if (this.el) {
53
+ this.el.innerHTML = this.resolveHtml(this.content);
54
+ }
55
+ };
56
+ /**
57
+ * Return the live host element (or null before `render()`).
58
+ */
59
+ StaticHtmlRenderer.prototype.getElement = function () {
60
+ return this.el;
61
+ };
62
+ /**
63
+ * @private
64
+ */
65
+ StaticHtmlRenderer.prototype.destroy = function () {
66
+ if (this.el && this.el.parentNode) {
67
+ this.el.parentNode.removeChild(this.el);
68
+ }
69
+ this.el = null;
70
+ this.content = '';
71
+ this.enableHtmlSanitizer = false;
72
+ this.id = undefined;
73
+ };
74
+ return StaticHtmlRenderer;
75
+ }());
76
+ export { StaticHtmlRenderer };
77
+ export default StaticHtmlRenderer;
@@ -0,0 +1,116 @@
1
+ import { FormNode, ConditionRule } from '../form-renderer/types/form-schema';
2
+ import { DataManager, Query } from '@syncfusion/ej2-data';
3
+ /**
4
+ * @private
5
+ */
6
+ export declare const VALIDATION_REGEX: {
7
+ [key: string]: RegExp;
8
+ };
9
+ /**
10
+ * @private
11
+ */
12
+ export interface AvailableField {
13
+ name: string;
14
+ type: string;
15
+ format?: string;
16
+ }
17
+ /**
18
+ * Maps button style to Syncfusion CSS classes
19
+ * @param style - Button style ('primary' | 'flat' | 'information' | 'error' | 'success' | 'warning')
20
+ * @returns Space-separated CSS class string
21
+ * @private
22
+ */
23
+ export declare const mapButtonStyleToClass: (style?: string) => string;
24
+ /**
25
+ * Resolves button type to valid HTML button type
26
+ * @param type - Button type ('submit' | 'reset' | 'button')
27
+ * @returns Resolved button type
28
+ * @private
29
+ */
30
+ export declare const resolveButtonType: (type?: "button" | "reset" | "submit") => "button" | "reset" | "submit";
31
+ /**
32
+ * Maps button position to CSS justifyContent value
33
+ * @param position - Button position ('Left' | 'Right' | 'Center')
34
+ * @returns CSS justifyContent value
35
+ * @private
36
+ */
37
+ export declare const mapPositionToJustifyContent: (position?: string) => string;
38
+ /**
39
+ * @private
40
+ */
41
+ export declare function splitWidths(input: Array<number | null>): number[];
42
+ /**
43
+ * @private
44
+ */
45
+ export declare function extractAllDescendantIds(component: FormNode): string[];
46
+ /**
47
+ * @private
48
+ */
49
+ export declare function formatDateValues(component: FormNode, value: any): any;
50
+ /**
51
+ * @private
52
+ */
53
+ export declare const getComponentFromSchema: (id?: string, formSchema?: any) => any;
54
+ /**
55
+ * Helper function to get the appropriate adaptor instance
56
+ * @param adaptorType - Type of adaptor ('WebApiAdaptor' | 'UrlAdaptor' | 'ODataV4Adaptor')
57
+ * @returns Adaptor instance
58
+ * @private
59
+ */
60
+ export declare const getAdaptorInstance: (adaptorType?: string) => any;
61
+ /**
62
+ * Extracts data from a nested path using dot notation and array indices
63
+ * @param data - The data object or array
64
+ * @param path - Path to the data (e.g., 'results.items', '[0].data', 'response[0].values')
65
+ * @returns Extracted data or empty array
66
+ * @private
67
+ */
68
+ export declare const extractDataFromPath: (data: any, path?: string) => any;
69
+ /**
70
+ * @private
71
+ */
72
+ export declare const resolveFieldBinding: (value: any, formValues: Record<string, any>, components?: FormNode[]) => any;
73
+ /**
74
+ * @private
75
+ * (useFetchOptions is NOT located here — see ./option-fetcher.ts)
76
+ * (useFetchLookupOptions is NOT located here — see ./option-fetcher.ts)
77
+ */
78
+ export declare const resolveOptions: (options: any, fetchedOptions: string[], fetchedLookupDataSource?: any[]) => any[];
79
+ /**
80
+ * @private
81
+ */
82
+ export declare const collectAvailableFieldNames: (components: FormNode[]) => AvailableField[];
83
+ /**
84
+ * Resolve conditional data for a DataGrid component
85
+ * Evaluates all conditionalData rules and applies the first matching one
86
+ * Returns both dataSource and custom columns if defined
87
+ *
88
+ * @param conditions - Component conditions including conditional data rules
89
+ * @param formValues - Current form field values
90
+ * @returns Object with dataSource and columns, or undefined if no condition matches
91
+ * @private
92
+ */
93
+ export declare const resolveConditionalData: (conditions: ConditionRule, formValues: Record<string, any>) => {
94
+ dataSource?: any[];
95
+ columns?: any[];
96
+ };
97
+ /**
98
+ * Reads the current builder mode from the URL `mode` query parameter.
99
+ * @returns 'Simple' | 'Developer' | undefined if not present or invalid
100
+ * @private
101
+ */
102
+ export declare const getCurrentMode: () => "Simple" | "Developer";
103
+ /**
104
+ * Navigates to a URL while preserving the current `mode` query parameter.
105
+ * - If `mode` is already in target, it is kept as-is.
106
+ * - If `mode` is present in the current URL, it is appended to the target.
107
+ *
108
+ * @param target - Target path (may include existing query params), e.g. '/?sample=builder&formId=123'
109
+ * @private
110
+ */
111
+ export declare const navigateTo: (target: string) => void;
112
+ /**
113
+ * @private
114
+ */
115
+ export declare function sanitizeId(rawId: unknown, fallback?: string): string;
116
+ export { DataManager, Query };