platformcommons-web-lib 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/commons-shared-web-ui-1.0.0.tgz +0 -0
- package/documentation/alert.md +123 -0
- package/documentation/button-dropdown.md +126 -0
- package/documentation/button.md +184 -0
- package/documentation/cards-usage-guidelines.md +131 -0
- package/documentation/configurable-form.md +605 -0
- package/documentation/confirmation-modal.md +250 -0
- package/documentation/filter-sidebar.md +178 -0
- package/documentation/filter-table-selector.md +228 -0
- package/documentation/form-builder.md +597 -0
- package/documentation/form-components.md +384 -0
- package/documentation/nav.md +427 -0
- package/documentation/pagination.md +181 -0
- package/documentation/side-nav-documentation.md +169 -0
- package/documentation/smart-form.md +2177 -0
- package/documentation/smart-table.md +1198 -0
- package/documentation/snackbar.md +118 -0
- package/documentation/style-externalization.md +88 -0
- package/documentation/summary-card.md +279 -0
- package/ng-package.json +28 -0
- package/package.json +54 -0
- package/src/lib/modules/alert/alert.models.ts +6 -0
- package/src/lib/modules/alert/alert.module.ts +16 -0
- package/src/lib/modules/alert/alert.theme.scss +85 -0
- package/src/lib/modules/alert/components/alert/alert.component.html +27 -0
- package/src/lib/modules/alert/components/alert/alert.component.scss +92 -0
- package/src/lib/modules/alert/components/alert/alert.component.ts +81 -0
- package/src/lib/modules/button/button.models.ts +13 -0
- package/src/lib/modules/button/button.module.ts +16 -0
- package/src/lib/modules/button/button.theme.scss +121 -0
- package/src/lib/modules/button/components/button/button.component.html +22 -0
- package/src/lib/modules/button/components/button/button.component.scss +88 -0
- package/src/lib/modules/button/components/button/button.component.ts +67 -0
- package/src/lib/modules/button-dropdown/button-dropdown.models.ts +26 -0
- package/src/lib/modules/button-dropdown/button-dropdown.module.ts +22 -0
- package/src/lib/modules/button-dropdown/button-dropdown.theme.scss +87 -0
- package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.html +41 -0
- package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.scss +135 -0
- package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.ts +160 -0
- package/src/lib/modules/configurable-form/component/configurable-form.component.html +294 -0
- package/src/lib/modules/configurable-form/component/configurable-form.component.scss +503 -0
- package/src/lib/modules/configurable-form/component/configurable-form.component.ts +628 -0
- package/src/lib/modules/configurable-form/configurable-form.examples.ts +154 -0
- package/src/lib/modules/configurable-form/configurable-form.model.ts +131 -0
- package/src/lib/modules/configurable-form/configurable-form.module.ts +19 -0
- package/src/lib/modules/configurable-form/configurable-form.theme.scss +78 -0
- package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.html +77 -0
- package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.scss +395 -0
- package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.ts +266 -0
- package/src/lib/modules/confirmation-modal/confirmation-modal.models.ts +71 -0
- package/src/lib/modules/confirmation-modal/confirmation-modal.module.ts +20 -0
- package/src/lib/modules/confirmation-modal/confirmation-modal.theme.scss +87 -0
- package/src/lib/modules/filter/components/filter/filter.component.html +131 -0
- package/src/lib/modules/filter/components/filter/filter.component.scss +245 -0
- package/src/lib/modules/filter/components/filter/filter.component.ts +216 -0
- package/src/lib/modules/filter/filter.models.ts +88 -0
- package/src/lib/modules/filter/filter.module.ts +24 -0
- package/src/lib/modules/filter/filter.theme.scss +92 -0
- package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.html +112 -0
- package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.scss +186 -0
- package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.ts +163 -0
- package/src/lib/modules/filter-sidebar/filter-sidebar.models.ts +95 -0
- package/src/lib/modules/filter-sidebar/filter-sidebar.module.ts +24 -0
- package/src/lib/modules/filter-sidebar/filter-sidebar.theme.scss +38 -0
- package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.html +73 -0
- package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.scss +321 -0
- package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.ts +361 -0
- package/src/lib/modules/filter-table-selector/filter-table-selector.models.ts +91 -0
- package/src/lib/modules/filter-table-selector/filter-table-selector.module.ts +22 -0
- package/src/lib/modules/filter-table-selector/filter-table-selector.theme.scss +36 -0
- package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.html +63 -0
- package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.scss +496 -0
- package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.ts +445 -0
- package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.html +75 -0
- package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.scss +210 -0
- package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.ts +55 -0
- package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.html +25 -0
- package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.scss +82 -0
- package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.ts +95 -0
- package/src/lib/modules/form-builder/components/field-selection/field-selection.component.html +20 -0
- package/src/lib/modules/form-builder/components/field-selection/field-selection.component.scss +37 -0
- package/src/lib/modules/form-builder/components/field-selection/field-selection.component.ts +94 -0
- package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.html +46 -0
- package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.scss +102 -0
- package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.ts +50 -0
- package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.html +35 -0
- package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.scss +67 -0
- package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.ts +34 -0
- package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.html +68 -0
- package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.scss +113 -0
- package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.ts +74 -0
- package/src/lib/modules/form-builder/configs/field-type-schema.map.ts +533 -0
- package/src/lib/modules/form-builder/form-builder.module.ts +36 -0
- package/src/lib/modules/form-builder/form-builder.theme.scss +212 -0
- package/src/lib/modules/form-builder/index.ts +9 -0
- package/src/lib/modules/form-builder/models/builder.models.ts +7 -0
- package/src/lib/modules/form-builder/models/field-configurator.models.ts +38 -0
- package/src/lib/modules/form-builder/models/field-selection.models.ts +51 -0
- package/src/lib/modules/form-builder/services/field-configurator.service.ts +258 -0
- package/src/lib/modules/form-builder/services/field-selection.service.ts +300 -0
- package/src/lib/modules/form-builder/services/form-schema-tree.service.ts +652 -0
- package/src/lib/modules/form-builder/tokens/builder.tokens.ts +10 -0
- package/src/lib/modules/form-builder/utils/constants.ts +43 -0
- package/src/lib/modules/form-components/components/checkbox/_theme.scss +63 -0
- package/src/lib/modules/form-components/components/checkbox/checkbox.component.html +29 -0
- package/src/lib/modules/form-components/components/checkbox/checkbox.component.scss +111 -0
- package/src/lib/modules/form-components/components/checkbox/checkbox.component.ts +207 -0
- package/src/lib/modules/form-components/components/checkbox/checkbox.models.ts +35 -0
- package/src/lib/modules/form-components/components/datepicker/_theme.scss +82 -0
- package/src/lib/modules/form-components/components/datepicker/datepicker.component.html +42 -0
- package/src/lib/modules/form-components/components/datepicker/datepicker.component.scss +115 -0
- package/src/lib/modules/form-components/components/datepicker/datepicker.component.ts +267 -0
- package/src/lib/modules/form-components/components/datepicker/datepicker.models.ts +45 -0
- package/src/lib/modules/form-components/components/dropdown/_theme.scss +91 -0
- package/src/lib/modules/form-components/components/dropdown/dropdown.component.html +74 -0
- package/src/lib/modules/form-components/components/dropdown/dropdown.component.scss +252 -0
- package/src/lib/modules/form-components/components/dropdown/dropdown.component.ts +377 -0
- package/src/lib/modules/form-components/components/dropdown/dropdown.models.ts +53 -0
- package/src/lib/modules/form-components/components/input/_theme.scss +77 -0
- package/src/lib/modules/form-components/components/input/input.component.html +51 -0
- package/src/lib/modules/form-components/components/input/input.component.scss +128 -0
- package/src/lib/modules/form-components/components/input/input.component.ts +250 -0
- package/src/lib/modules/form-components/components/input/input.models.ts +55 -0
- package/src/lib/modules/form-components/components/radio/_theme.scss +61 -0
- package/src/lib/modules/form-components/components/radio/radio.component.html +22 -0
- package/src/lib/modules/form-components/components/radio/radio.component.scss +107 -0
- package/src/lib/modules/form-components/components/radio/radio.component.ts +181 -0
- package/src/lib/modules/form-components/components/radio/radio.models.ts +39 -0
- package/src/lib/modules/form-components/components/search/_theme.scss +73 -0
- package/src/lib/modules/form-components/components/search/search.component.html +15 -0
- package/src/lib/modules/form-components/components/search/search.component.scss +87 -0
- package/src/lib/modules/form-components/components/search/search.component.ts +213 -0
- package/src/lib/modules/form-components/components/search/search.models.ts +40 -0
- package/src/lib/modules/form-components/components/toggle/_theme.scss +45 -0
- package/src/lib/modules/form-components/components/toggle/toggle.component.html +15 -0
- package/src/lib/modules/form-components/components/toggle/toggle.component.scss +81 -0
- package/src/lib/modules/form-components/components/toggle/toggle.component.ts +166 -0
- package/src/lib/modules/form-components/components/toggle/toggle.models.ts +27 -0
- package/src/lib/modules/form-components/directives/click-outside.directive.ts +22 -0
- package/src/lib/modules/form-components/form-components.module.ts +41 -0
- package/src/lib/modules/form-components/form-components.theme.scss +25 -0
- package/src/lib/modules/material/material.module.ts +94 -0
- package/src/lib/modules/nav/components/nav/nav.component.html +34 -0
- package/src/lib/modules/nav/components/nav/nav.component.scss +171 -0
- package/src/lib/modules/nav/components/nav/nav.component.ts +82 -0
- package/src/lib/modules/nav/nav.models.ts +31 -0
- package/src/lib/modules/nav/nav.module.ts +17 -0
- package/src/lib/modules/nav/nav.theme.scss +86 -0
- package/src/lib/modules/pagination/components/pagination/pagination.component.html +52 -0
- package/src/lib/modules/pagination/components/pagination/pagination.component.scss +155 -0
- package/src/lib/modules/pagination/components/pagination/pagination.component.ts +109 -0
- package/src/lib/modules/pagination/pagination.module.ts +17 -0
- package/src/lib/modules/pagination/pagination.theme.scss +66 -0
- package/src/lib/modules/side-nav/components/side-nav/side-nav.component.html +56 -0
- package/src/lib/modules/side-nav/components/side-nav/side-nav.component.scss +342 -0
- package/src/lib/modules/side-nav/components/side-nav/side-nav.component.ts +135 -0
- package/src/lib/modules/side-nav/side-nav.models.ts +38 -0
- package/src/lib/modules/side-nav/side-nav.module.ts +16 -0
- package/src/lib/modules/side-nav/side-nav.theme.scss +111 -0
- package/src/lib/modules/smart-form/components/form-field/form-field.component.html +1109 -0
- package/src/lib/modules/smart-form/components/form-field/form-field.component.scss +1860 -0
- package/src/lib/modules/smart-form/components/form-field/form-field.component.ts +2232 -0
- package/src/lib/modules/smart-form/components/form-section/form-section.component.html +64 -0
- package/src/lib/modules/smart-form/components/form-section/form-section.component.scss +209 -0
- package/src/lib/modules/smart-form/components/form-section/form-section.component.ts +119 -0
- package/src/lib/modules/smart-form/components/smart-form/smart-form.component.html +253 -0
- package/src/lib/modules/smart-form/components/smart-form/smart-form.component.scss +689 -0
- package/src/lib/modules/smart-form/components/smart-form/smart-form.component.ts +1087 -0
- package/src/lib/modules/smart-form/index.ts +10 -0
- package/src/lib/modules/smart-form/models/form-schema.model.ts +700 -0
- package/src/lib/modules/smart-form/models/hierarchy-config.model.ts +21 -0
- package/src/lib/modules/smart-form/services/expression.service.ts +75 -0
- package/src/lib/modules/smart-form/services/smart-form-controller.service.ts +65 -0
- package/src/lib/modules/smart-form/smart-form.examples.ts +1324 -0
- package/src/lib/modules/smart-form/smart-form.module.ts +36 -0
- package/src/lib/modules/smart-form/smart-form.theme.scss +890 -0
- package/src/lib/modules/smart-form/utils/translation.utils.ts +82 -0
- package/src/lib/modules/smart-form/utils/trusted-url.pipe.ts +25 -0
- package/src/lib/modules/smart-form/utils/validation.utils.ts +98 -0
- package/src/lib/modules/smart-table/components/smart-table/smart-table.component.html +283 -0
- package/src/lib/modules/smart-table/components/smart-table/smart-table.component.scss +685 -0
- package/src/lib/modules/smart-table/components/smart-table/smart-table.component.ts +1118 -0
- package/src/lib/modules/smart-table/models/table-config.model.ts +202 -0
- package/src/lib/modules/smart-table/smart-table.module.ts +30 -0
- package/src/lib/modules/smart-table/smart-table.theme.scss +335 -0
- package/src/lib/modules/smart-table/utils/safe-html.pipe.ts +22 -0
- package/src/lib/modules/smart-table/utils/smart-table.utils.ts +18 -0
- package/src/lib/modules/snackbar/components/snackbar.component.html +41 -0
- package/src/lib/modules/snackbar/components/snackbar.component.scss +99 -0
- package/src/lib/modules/snackbar/components/snackbar.component.ts +18 -0
- package/src/lib/modules/snackbar/models/snackbar.models.ts +10 -0
- package/src/lib/modules/snackbar/services/snackbar.service.ts +40 -0
- package/src/lib/modules/snackbar/snackbar.module.ts +11 -0
- package/src/lib/modules/snackbar/snackbar.theme.scss +93 -0
- package/src/lib/modules/summary-card/components/summary-card/summary-card.component.html +47 -0
- package/src/lib/modules/summary-card/components/summary-card/summary-card.component.scss +199 -0
- package/src/lib/modules/summary-card/components/summary-card/summary-card.component.ts +126 -0
- package/src/lib/modules/summary-card/summary-card.module.ts +18 -0
- package/src/lib/modules/summary-card/summary-card.theme.scss +176 -0
- package/src/lib/shared-ui.module.ts +44 -0
- package/src/lib/styles/global.scss +152 -0
- package/src/lib/styles/utilities.scss +250 -0
- package/src/lib/utils/constants.ts +11 -0
- package/src/lib/utils/storage.utils.ts +37 -0
- package/src/lib/utils/string.utils.ts +23 -0
- package/src/lib/utils/translation.utils.ts +87 -0
- package/src/public-api.ts +104 -0
- package/tsconfig.lib.json +15 -0
|
@@ -0,0 +1,700 @@
|
|
|
1
|
+
import { ButtonVariant } from '../../button/button.models';
|
|
2
|
+
|
|
3
|
+
export interface FormSchema {
|
|
4
|
+
entityType: string;
|
|
5
|
+
label: string;
|
|
6
|
+
formType: 'SECTION' | 'STEPPER';
|
|
7
|
+
showTitle?: boolean;
|
|
8
|
+
showDescription?: boolean;
|
|
9
|
+
description?: string;
|
|
10
|
+
metadata?: { [key: string]: any };
|
|
11
|
+
/**
|
|
12
|
+
* When true, top-level GROUP children of sectionConfig are rendered as
|
|
13
|
+
* a horizontal stepper at the top, showing one section at a time.
|
|
14
|
+
* Navigate between sections via the Next/Previous buttons in the host app.
|
|
15
|
+
*/
|
|
16
|
+
sectionStepper?: boolean;
|
|
17
|
+
sectionConfig?: SectionConfig;
|
|
18
|
+
stepperConfig?: StepperConfig;
|
|
19
|
+
submitConfig?: SubmitConfig;
|
|
20
|
+
/**
|
|
21
|
+
* Configures the action bar shown at the bottom of the form.
|
|
22
|
+
* Supports Cancel, Save as Draft, and Submit buttons with flexible layout.
|
|
23
|
+
* If omitted, the default Submit (and stepper Prev/Next) behaviour is unchanged.
|
|
24
|
+
*/
|
|
25
|
+
actionBarConfig?: ActionBarConfig;
|
|
26
|
+
showActions?: boolean;
|
|
27
|
+
/** Full token string passed to all library API calls (e.g. "Bearer eyJ…") */
|
|
28
|
+
token?: string;
|
|
29
|
+
/** HTTP header name to use for the token (default: "Authorization") */
|
|
30
|
+
tokenHeader?: string;
|
|
31
|
+
/** Custom label keys for form actions */
|
|
32
|
+
labels?: FormLabels;
|
|
33
|
+
/** Config for form editing (GET to load, PATCH/PUT to submit) */
|
|
34
|
+
editConfig?: EditConfig;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface FormLabels {
|
|
38
|
+
nextLabel?: string;
|
|
39
|
+
submitLabel?: string;
|
|
40
|
+
previousLabel?: string;
|
|
41
|
+
addLabel?: string;
|
|
42
|
+
removeLabel?: string;
|
|
43
|
+
/** File upload error messages. Supports placeholders: {fileName}, {maxSizeMB}, {maxFiles} */
|
|
44
|
+
fileTypeError?: string;
|
|
45
|
+
fileSizeError?: string;
|
|
46
|
+
maxFilesError?: string;
|
|
47
|
+
fileUploadFailed?: string;
|
|
48
|
+
fileDeleteFailed?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface SubmitConfig {
|
|
52
|
+
apiUrl: string;
|
|
53
|
+
method?: 'POST' | 'PUT' | 'PATCH';
|
|
54
|
+
successMessage?: string;
|
|
55
|
+
errorMessage?: string;
|
|
56
|
+
redirectUrl?: string; // Redirect after success
|
|
57
|
+
extraPayload?: { [key: string]: any }; // Static extra fields for payload
|
|
58
|
+
snackbarConfig?: {
|
|
59
|
+
duration?: number;
|
|
60
|
+
horizontalPosition?: 'start' | 'center' | 'end' | 'left' | 'right';
|
|
61
|
+
verticalPosition?: 'top' | 'bottom';
|
|
62
|
+
showCloseButton?: boolean;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// ─── Action Bar ──────────────────────────────────────────────────────────────
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Describes what happens when an action bar button is clicked.
|
|
70
|
+
* One ActionConfig shape works for every button.
|
|
71
|
+
*/
|
|
72
|
+
export interface ActionConfig {
|
|
73
|
+
/**
|
|
74
|
+
* Action kind.
|
|
75
|
+
* 'submit' -> Validates and submits form using submitConfig/editConfig.
|
|
76
|
+
* 'draft' -> Saves form data without full validation.
|
|
77
|
+
* 'navigate' -> Navigates to redirectUrl.
|
|
78
|
+
* 'api' -> Fires an API call then optionally navigates.
|
|
79
|
+
* 'emit' -> Emits actionClick event for custom handling.
|
|
80
|
+
* 'next' -> Advances to next step (stepper only).
|
|
81
|
+
* 'prev' -> Goes back to previous step (stepper only).
|
|
82
|
+
*/
|
|
83
|
+
kind: 'submit' | 'draft' | 'navigate' | 'api' | 'emit' | 'next' | 'prev';
|
|
84
|
+
/** URL for 'navigate' or 'api' callbacks. */
|
|
85
|
+
redirectUrl?: string;
|
|
86
|
+
/** API endpoint for 'api' actions. */
|
|
87
|
+
apiUrl?: string;
|
|
88
|
+
/** HTTP method for 'api' actions. @default 'POST' */
|
|
89
|
+
method?: 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
90
|
+
/** Static extra payload merged into 'api' or 'draft' requests. */
|
|
91
|
+
extraPayload?: { [key: string]: any };
|
|
92
|
+
/** Snackbar messages for 'api' or 'submit'/'draft' actions. */
|
|
93
|
+
successMessage?: string;
|
|
94
|
+
errorMessage?: string;
|
|
95
|
+
snackbarConfig?: {
|
|
96
|
+
duration?: number;
|
|
97
|
+
horizontalPosition?: 'start' | 'center' | 'end' | 'left' | 'right';
|
|
98
|
+
verticalPosition?: 'top' | 'bottom';
|
|
99
|
+
showCloseButton?: boolean;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Button configuration focusing on visuals and layout.
|
|
105
|
+
* All logic is delegated to the 'action' property.
|
|
106
|
+
*/
|
|
107
|
+
export interface ActionButtonConfig {
|
|
108
|
+
/** Unique identifier for the button. */
|
|
109
|
+
id: string;
|
|
110
|
+
/** Label (i18n key or text). */
|
|
111
|
+
label?: string;
|
|
112
|
+
/** Button style variant. */
|
|
113
|
+
variant?: ButtonVariant | string;
|
|
114
|
+
/** Bar alignment. @default 'right' */
|
|
115
|
+
alignment?: 'left' | 'right';
|
|
116
|
+
/** Display order (lower = first). */
|
|
117
|
+
order?: number;
|
|
118
|
+
/** Visibility. @default false */
|
|
119
|
+
hidden?: boolean;
|
|
120
|
+
/** State. @default false */
|
|
121
|
+
disabled?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* When true and sectionStepper is active, this button is only visible
|
|
124
|
+
* on the last step. Use this for Submit buttons that should not appear
|
|
125
|
+
* on intermediate steps.
|
|
126
|
+
*/
|
|
127
|
+
showOnLastStepOnly?: boolean;
|
|
128
|
+
/** Action logic. */
|
|
129
|
+
action: ActionConfig;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Action bar configuration.
|
|
134
|
+
*/
|
|
135
|
+
export interface ActionBarConfig {
|
|
136
|
+
/** Flexibly ordered list of action buttons. */
|
|
137
|
+
buttons: ActionButtonConfig[];
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
export interface EditConfig {
|
|
142
|
+
loadApiUrl: string; // Custom GET API to load existing form data
|
|
143
|
+
submitApiUrl: string; // PATCH/PUT/POST API for updating
|
|
144
|
+
submitMethod?: 'PATCH' | 'PUT' | 'POST';
|
|
145
|
+
successMessage?: string;
|
|
146
|
+
errorMessage?: string;
|
|
147
|
+
redirectUrl?: string;
|
|
148
|
+
extraPayload?: { [key: string]: any };
|
|
149
|
+
snackbarConfig?: {
|
|
150
|
+
duration?: number;
|
|
151
|
+
horizontalPosition?: 'start' | 'center' | 'end' | 'left' | 'right';
|
|
152
|
+
verticalPosition?: 'top' | 'bottom';
|
|
153
|
+
showCloseButton?: boolean;
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface SectionConfig {
|
|
158
|
+
children: FieldConfig[];
|
|
159
|
+
allowMulti?: boolean;
|
|
160
|
+
name?: string;
|
|
161
|
+
label?: string;
|
|
162
|
+
/** Configuration for the card-based multi-save UI (FAQ style) */
|
|
163
|
+
multiSaveConfig?: MultiSaveConfig;
|
|
164
|
+
isEnabled?: boolean;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface MultiSaveConfig {
|
|
168
|
+
/** If TRUE, enable the Save/Cancel card-based flow for this repeater */
|
|
169
|
+
active?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* The name of the field to show as the main 'heading' in the collapsed card.
|
|
172
|
+
* Typically matches the question or name.
|
|
173
|
+
*/
|
|
174
|
+
summaryField?: string;
|
|
175
|
+
/**
|
|
176
|
+
* Optional name of the field to show as the sub-text in the collapsed card.
|
|
177
|
+
* Typically matches the answer or description.
|
|
178
|
+
*/
|
|
179
|
+
descriptionField?: string;
|
|
180
|
+
/**
|
|
181
|
+
* Custom label key for the 'Add' button. If omitted, defaults to
|
|
182
|
+
* '+ Add a [label]'.
|
|
183
|
+
*/
|
|
184
|
+
addLabel?: string;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface StepperConfig {
|
|
188
|
+
children: FieldConfig[];
|
|
189
|
+
showStep?: boolean;
|
|
190
|
+
isHorizontal?: boolean;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Describes a clickable action icon rendered as a suffix inside a TEXT_INPUT
|
|
195
|
+
* or NUMBER_INPUT field. Multiple icons can be shown side-by-side.
|
|
196
|
+
* When clicked, the field name and actionId are emitted via the
|
|
197
|
+
* SmartFormComponent's `suffixActionClick` output.
|
|
198
|
+
*/
|
|
199
|
+
export interface SuffixActionIcon {
|
|
200
|
+
/** Material icon name (e.g. 'edit', 'refresh', 'check', 'lock') */
|
|
201
|
+
icon: string;
|
|
202
|
+
/** Unique action identifier emitted on click (e.g. 'enable_edit', 'reset_code') */
|
|
203
|
+
actionId: string;
|
|
204
|
+
/** Optional tooltip shown on hover */
|
|
205
|
+
tooltip?: string;
|
|
206
|
+
/** Optional custom color override (e.g. '#16A34A' for a green check icon) */
|
|
207
|
+
color?: string;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export interface FieldConfig {
|
|
211
|
+
name?: string;
|
|
212
|
+
label?: string;
|
|
213
|
+
type: string;
|
|
214
|
+
subType?: string;
|
|
215
|
+
visible?: boolean;
|
|
216
|
+
visibilityExpression?: string;
|
|
217
|
+
isEnabled?: boolean;
|
|
218
|
+
required?: boolean;
|
|
219
|
+
disabled?: boolean;
|
|
220
|
+
defaultValue?: any;
|
|
221
|
+
placeholder?: string;
|
|
222
|
+
hint?: string;
|
|
223
|
+
/** Dot-notation path for nested payload mapping (e.g., 'status.code') */
|
|
224
|
+
payloadPath?: string;
|
|
225
|
+
/**
|
|
226
|
+
* Column span in a 12-column grid (1–12).
|
|
227
|
+
* Use this on any field or ROW to control its width.
|
|
228
|
+
* Examples: 3 = 25%, 4 = 33%, 6 = 50%, 12 = 100% (default).
|
|
229
|
+
* When a field is inside a ROW, the ROW children share space via colSpan.
|
|
230
|
+
* When a field is a direct section child (not inside a ROW), colSpan wraps
|
|
231
|
+
* it in the section-level 12-col grid automatically.
|
|
232
|
+
*/
|
|
233
|
+
colSpan?: number;
|
|
234
|
+
/** Custom CSS class for the field container */
|
|
235
|
+
className?: string;
|
|
236
|
+
/** Unit or symbol shown before the input */
|
|
237
|
+
prefix?: string;
|
|
238
|
+
/** Unit or symbol shown after the input (e.g. "%", "Students") */
|
|
239
|
+
suffix?: string;
|
|
240
|
+
/** Whether the field is read-only (shows lock icon) */
|
|
241
|
+
readonly?: boolean;
|
|
242
|
+
/**
|
|
243
|
+
* Clickable action icons rendered as suffixes inside the input.
|
|
244
|
+
* Ignored when `readonly` is true (the built-in lock icon takes precedence).
|
|
245
|
+
* Each icon emits a `suffixActionClick` event with `{ fieldName, actionId }`.
|
|
246
|
+
*/
|
|
247
|
+
suffixActionIcons?: SuffixActionIcon[];
|
|
248
|
+
sectionConfig?: SectionConfig;
|
|
249
|
+
/**
|
|
250
|
+
* Cross-field validation config for SUBFIELDS groups.
|
|
251
|
+
* Applied as a group-level validator on the nested FormGroup.
|
|
252
|
+
*/
|
|
253
|
+
onChange?: string;
|
|
254
|
+
onValidate?: string;
|
|
255
|
+
errorMessage?: string;
|
|
256
|
+
textConfig?: TextConfig;
|
|
257
|
+
emailConfig?: EmailConfig;
|
|
258
|
+
phoneConfig?: PhoneConfig;
|
|
259
|
+
numberConfig?: NumberConfig;
|
|
260
|
+
dateConfig?: DateConfig;
|
|
261
|
+
timeConfig?: TimeConfig;
|
|
262
|
+
optionConfig?: OptionConfig;
|
|
263
|
+
autocompleteConfig?: AutocompleteConfig;
|
|
264
|
+
generatedConfig?: GeneratedConfig;
|
|
265
|
+
rangeConfig?: RangeConfig;
|
|
266
|
+
attachmentConfig?: AttachmentConfig;
|
|
267
|
+
locationConfig?: LocationConfig;
|
|
268
|
+
ratingConfig?: RatingConfig;
|
|
269
|
+
richTextConfig?: RichTextConfig;
|
|
270
|
+
children?: FieldConfig[];
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export interface TextConfig {
|
|
274
|
+
length?: LengthConstraint;
|
|
275
|
+
pattern?: string;
|
|
276
|
+
patternMessage?: string;
|
|
277
|
+
inputType?: string;
|
|
278
|
+
/**
|
|
279
|
+
* Name of another field in the same FormGroup whose value must equal this
|
|
280
|
+
* field's value (e.g. "password" on a confirmPassword field).
|
|
281
|
+
* Validation runs bi-directionally: whichever field changes last triggers
|
|
282
|
+
* the check on the field that carries matchField config.
|
|
283
|
+
*/
|
|
284
|
+
matchField?: string;
|
|
285
|
+
showCharCount?: boolean;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export interface LengthConstraint {
|
|
289
|
+
min?: number;
|
|
290
|
+
max?: number;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export interface NumberConfig {
|
|
294
|
+
min?: number;
|
|
295
|
+
max?: number;
|
|
296
|
+
precision?: number;
|
|
297
|
+
step?: number;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export interface DateConfig {
|
|
301
|
+
allowFuture?: boolean;
|
|
302
|
+
/** When false, dates before today are disabled (today is the minimum). When true (default), all past dates are allowed. */
|
|
303
|
+
allowPast?: boolean;
|
|
304
|
+
minDate?: string;
|
|
305
|
+
maxDate?: string;
|
|
306
|
+
/** When true, the text input is readonly (picker-only, no keyboard entry). */
|
|
307
|
+
inputReadonly?: boolean;
|
|
308
|
+
/** Name of a sibling field whose value is used as the dynamic minimum date. */
|
|
309
|
+
minDateField?: string;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export interface TimeConfig {
|
|
313
|
+
/** Explicit minimum time in "HH:mm" 24-hour format (e.g. "09:00"). */
|
|
314
|
+
minTime?: string;
|
|
315
|
+
/** Explicit maximum time in "HH:mm" 24-hour format (e.g. "18:00"). */
|
|
316
|
+
maxTime?: string;
|
|
317
|
+
/** When true, the input is readonly. */
|
|
318
|
+
inputReadonly?: boolean;
|
|
319
|
+
/**
|
|
320
|
+
* Name of a sibling TIME field whose value is used as the dynamic minimum time.
|
|
321
|
+
* When the sibling changes, this field's minimum updates and any now-invalid
|
|
322
|
+
* value (earlier than the new minimum) is cleared. Mirrors DateConfig.minDateField.
|
|
323
|
+
*/
|
|
324
|
+
minTimeField?: string;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export interface OptionConfig {
|
|
328
|
+
optionClass?: string;
|
|
329
|
+
optionUrl?: string; // Legacy API URL
|
|
330
|
+
apiUrl?: string; // Preferred API URL
|
|
331
|
+
apiUrls?: string[]; // Multiple API URLs to merge
|
|
332
|
+
dataPath?: string; // Path to array in response (e.g. 'data.items')
|
|
333
|
+
labelPath?: string; // Path to label (e.g. 'name[0].text')
|
|
334
|
+
valuePath?: string; // Path to value (e.g. 'data.code')
|
|
335
|
+
dependencies?: { [queryParam: string]: string }; // Map query param to field name (e.g. { 'parentId': 'parentField' })
|
|
336
|
+
sortBy?: string; // Path to field to sort by (e.g. 'name.text')
|
|
337
|
+
sortDirection?: 'ASC' | 'DESC'; // Sort direction (default: 'ASC')
|
|
338
|
+
layout?: 'row' | 'column'; // Layout for options (default: 'row')
|
|
339
|
+
optionList?: OptionItem[];
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// ── Autocomplete Display Field ────────────────────────────────────────────────
|
|
343
|
+
|
|
344
|
+
export interface AutocompleteDisplayField {
|
|
345
|
+
/** Dot-notation path to the value in the API response item (e.g. 'login', 'contact.phone'). */
|
|
346
|
+
path: string;
|
|
347
|
+
/**
|
|
348
|
+
* How to render the value.
|
|
349
|
+
* Built-in: 'text' | 'email' | 'phone' | 'image'.
|
|
350
|
+
* Can be any string for custom logic/styling.
|
|
351
|
+
*/
|
|
352
|
+
type?: 'text' | 'email' | 'phone' | 'image' | string;
|
|
353
|
+
/** Optional Material Icon name to show (e.g. 'location_on', 'calendar_today', 'person'). */
|
|
354
|
+
icon?: string;
|
|
355
|
+
/** Optional label prefix shown before the value (e.g. 'Email: '). */
|
|
356
|
+
label?: string;
|
|
357
|
+
/** Custom CSS class to apply to this display item. */
|
|
358
|
+
className?: string;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// ── Autocomplete Config ───────────────────────────────────────────────────────
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Configuration specific to the AUTOCOMPLETE field type.
|
|
365
|
+
* For detailed documentation and examples, see documentation/smart-form.md.
|
|
366
|
+
*/
|
|
367
|
+
export interface AutocompleteConfig {
|
|
368
|
+
// ── HTTP Request Configuration ─────────────────────────────────────────
|
|
369
|
+
/** HTTP method for the options API. Defaults to 'GET'. */
|
|
370
|
+
method?: 'GET' | 'POST' | 'PUT' | 'PATCH';
|
|
371
|
+
/** Static request body sent with POST/PUT/PATCH requests. */
|
|
372
|
+
body?: any;
|
|
373
|
+
/** Static query parameters to append to the API URL on every request. */
|
|
374
|
+
queryParams?: { [key: string]: any };
|
|
375
|
+
/** Custom HTTP headers to send with the API request (e.g. Authorization, X-TENANT). */
|
|
376
|
+
headers?: { [key: string]: string };
|
|
377
|
+
|
|
378
|
+
// ── Label Building ────────────────────────────────────────────────────
|
|
379
|
+
/**
|
|
380
|
+
* Template string for building a composite label from multiple fields.
|
|
381
|
+
* Use {fieldName} placeholders. E.g. '{firstName} {lastName} ({login})'.
|
|
382
|
+
* Takes precedence over optionConfig.labelPath if both are set.
|
|
383
|
+
*/
|
|
384
|
+
labelTemplate?: string;
|
|
385
|
+
|
|
386
|
+
// ── Extra Fields Shown in the Dropdown Option ─────────────────────────
|
|
387
|
+
/**
|
|
388
|
+
* One or more extra fields to render below the main label inside each dropdown option.
|
|
389
|
+
*
|
|
390
|
+
* Accepts:
|
|
391
|
+
* - A plain string → treated as a single dot-notation path rendered as 'text'.
|
|
392
|
+
* Backward-compatible with the old `displayPath` string.
|
|
393
|
+
* - An array of AutocompleteDisplayField objects → full control over icon,
|
|
394
|
+
* type (text | email | phone | image), and optional label prefix.
|
|
395
|
+
*
|
|
396
|
+
* Examples:
|
|
397
|
+
* "displayFields": "login"
|
|
398
|
+
* "displayFields": [
|
|
399
|
+
* { "path": "login", "type": "email" },
|
|
400
|
+
* { "path": "phone", "type": "phone" },
|
|
401
|
+
* { "path": "photoUrl", "type": "image" }
|
|
402
|
+
* ]
|
|
403
|
+
*/
|
|
404
|
+
displayFields?: string | AutocompleteDisplayField[];
|
|
405
|
+
|
|
406
|
+
// ── Server-side Search ────────────────────────────────────────────────
|
|
407
|
+
/** Query parameter key appended to the URL when the user types (e.g. 'searchTerm', 'q'). */
|
|
408
|
+
searchParam?: string;
|
|
409
|
+
/** Alias for 'searchParam'. */
|
|
410
|
+
searchKey?: string;
|
|
411
|
+
/** Minimum characters to type before a server request fires (default: 1). */
|
|
412
|
+
searchMinLength?: number;
|
|
413
|
+
/** Debounce delay in ms before firing the search request (default: 300ms server-side, 150ms local). */
|
|
414
|
+
searchDebounce?: number;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
export interface EmailConfig {
|
|
418
|
+
defaultDomain?: string;
|
|
419
|
+
allowedDomains?: string[];
|
|
420
|
+
blockedDomains?: string[];
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
export interface PhoneConfig {
|
|
424
|
+
prefixCountryCode?: boolean;
|
|
425
|
+
defaultCountryCode?: string;
|
|
426
|
+
supportedCountryCodeLocale?: string[];
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
export interface OptionItem {
|
|
430
|
+
label: string;
|
|
431
|
+
code: any;
|
|
432
|
+
value?: any;
|
|
433
|
+
hint?: string; // Hint text for the option
|
|
434
|
+
colSpan?: number; // Grid column span
|
|
435
|
+
}
|
|
436
|
+
export interface GeneratedConfig {
|
|
437
|
+
formula: string;
|
|
438
|
+
variables?: string[];
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
export interface RangeConfig {
|
|
442
|
+
min?: number;
|
|
443
|
+
max?: number;
|
|
444
|
+
step?: number;
|
|
445
|
+
minDate?: string;
|
|
446
|
+
maxDate?: string;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Describes a single query-parameter for a parameterised API URL.
|
|
452
|
+
* Supports static values (baked into the JSON config) and dynamic values
|
|
453
|
+
* resolved at runtime from a context object via dot-notation `sourcePath`.
|
|
454
|
+
*
|
|
455
|
+
* Used inside `LibraryUploadConfig.params` to declaratively list all
|
|
456
|
+
* query params the library-image sync API needs.
|
|
457
|
+
*/
|
|
458
|
+
export interface ApiQueryParam {
|
|
459
|
+
/** The query-param key sent to the backend (e.g. 'entityType', 'completeUrl'). */
|
|
460
|
+
key: string;
|
|
461
|
+
/**
|
|
462
|
+
* A static value baked into the JSON config
|
|
463
|
+
* (e.g. 'ENTITY_TYPE.OPPORTUNITY_GALLERY').
|
|
464
|
+
* Leave unset when the value must be resolved dynamically at runtime.
|
|
465
|
+
*/
|
|
466
|
+
staticValue?: string;
|
|
467
|
+
/**
|
|
468
|
+
* A dot-notation path resolved against a runtime context object
|
|
469
|
+
* (e.g. 'libraryItem.url'). Takes precedence over `staticValue`
|
|
470
|
+
* when the context provides a non-null value.
|
|
471
|
+
*/
|
|
472
|
+
sourcePath?: string;
|
|
473
|
+
/**
|
|
474
|
+
* When true the HTTP request is aborted if this param cannot be resolved
|
|
475
|
+
* to a non-empty value.
|
|
476
|
+
*/
|
|
477
|
+
required?: boolean;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* Structured config for the library-image sync POST API.
|
|
482
|
+
* Declare each query param as an `ApiQueryParam` so the set can grow
|
|
483
|
+
* without any code changes.
|
|
484
|
+
*
|
|
485
|
+
* Example:
|
|
486
|
+
* {
|
|
487
|
+
* "baseUrl": "gateway/commons-opportunity-service/api/v1/attachments/upload-url",
|
|
488
|
+
* "params": [
|
|
489
|
+
* { "key": "entityType", "staticValue": "ENTITY_TYPE.OPPORTUNITY_GALLERY", "required": true },
|
|
490
|
+
* { "key": "completeUrl", "sourcePath": "libraryItem.url", "required": true }
|
|
491
|
+
* ]
|
|
492
|
+
* }
|
|
493
|
+
*/
|
|
494
|
+
export interface LibraryUploadConfig {
|
|
495
|
+
/** Base URL without any query string. */
|
|
496
|
+
baseUrl: string;
|
|
497
|
+
/**
|
|
498
|
+
* Declared query params. Static values are embedded in the config;
|
|
499
|
+
* dynamic values (e.g. `completeUrl`) are resolved at call time from
|
|
500
|
+
* a runtime context object using `sourcePath`.
|
|
501
|
+
*/
|
|
502
|
+
params?: ApiQueryParam[];
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* All library-image picker settings grouped under one roof.
|
|
507
|
+
* Used as the `libraryConfig` key inside `AttachmentConfig`.
|
|
508
|
+
*
|
|
509
|
+
* Example:
|
|
510
|
+
* {
|
|
511
|
+
* "apiUrl": "gateway/.../attachments/bulk/public?entityIds=1&entityType=...",
|
|
512
|
+
* "dataPath": "data",
|
|
513
|
+
* "urlPath": "completeURL",
|
|
514
|
+
* "idPath": "id",
|
|
515
|
+
* "uploadConfig": {
|
|
516
|
+
* "baseUrl": "gateway/.../attachments/upload-url",
|
|
517
|
+
* "params": [
|
|
518
|
+
* { "key": "entityType", "staticValue": "ENTITY_TYPE.OPPORTUNITY_GALLERY", "required": true },
|
|
519
|
+
* { "key": "completeUrl", "sourcePath": "libraryItem.url", "required": true }
|
|
520
|
+
* ]
|
|
521
|
+
* }
|
|
522
|
+
* }
|
|
523
|
+
*/
|
|
524
|
+
export interface LibraryConfig {
|
|
525
|
+
/** API endpoint (GET) to load the library image list. */
|
|
526
|
+
apiUrl: string;
|
|
527
|
+
/** Dot-notation path to the image array in the API response (e.g. 'data.items'). */
|
|
528
|
+
dataPath?: string;
|
|
529
|
+
/** Dot-notation path to the image URL within each item (e.g. 'completeURL'). */
|
|
530
|
+
urlPath?: string;
|
|
531
|
+
/** Dot-notation path to the image ID within each item (e.g. 'id'). */
|
|
532
|
+
idPath?: string;
|
|
533
|
+
/**
|
|
534
|
+
* Structured config for the library-image sync POST API.
|
|
535
|
+
* Declare each query param as an `ApiQueryParam` so the set can
|
|
536
|
+
* grow without any code changes.
|
|
537
|
+
*/
|
|
538
|
+
uploadConfig?: LibraryUploadConfig;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* Unified attachment / file-upload configuration.
|
|
543
|
+
* Used by FILE_UPLOAD fields for any kind of upload — images, documents, PDFs, etc.
|
|
544
|
+
*/
|
|
545
|
+
export interface AttachmentConfig {
|
|
546
|
+
/** Allow multiple file selection (default: false) */
|
|
547
|
+
multiple?: boolean;
|
|
548
|
+
/** Max number of files when multiple=true (default: 10) */
|
|
549
|
+
maxFiles?: number;
|
|
550
|
+
/** Max file size per file in MB (default: 10) */
|
|
551
|
+
maxSizeMB?: number;
|
|
552
|
+
/** Accepted MIME types or extensions, e.g. '.pdf,.jpg,image/*' */
|
|
553
|
+
accept?: string;
|
|
554
|
+
/** Human-readable hint shown in the drop zone, e.g. 'JPG, PNG, PDF (max 5 MB)' */
|
|
555
|
+
acceptLabel?: string;
|
|
556
|
+
/** Legacy: explicit list of allowed extensions (e.g. ['.pdf', '.jpg']) */
|
|
557
|
+
allowedExtensions?: string[];
|
|
558
|
+
/**
|
|
559
|
+
* API endpoint to upload the file to. When provided, the file is POSTed as
|
|
560
|
+
* multipart/form-data and the returned URL is stored as dataUrl instead of
|
|
561
|
+
* the base64 data URL produced by FileReader.
|
|
562
|
+
*/
|
|
563
|
+
uploadUrl?: string;
|
|
564
|
+
/**
|
|
565
|
+
* Entity type sent along with the upload request (e.g. 'ENTITY_TYPE.SESSION').
|
|
566
|
+
* Only relevant when uploadUrl is set.
|
|
567
|
+
*/
|
|
568
|
+
entityType?: string;
|
|
569
|
+
/**
|
|
570
|
+
* API endpoint to delete the file. Called when an uploaded file with an ID != 0 is removed.
|
|
571
|
+
*/
|
|
572
|
+
deleteUrl?: string;
|
|
573
|
+
/**
|
|
574
|
+
* All library-image picker settings (API, response paths, sync upload).
|
|
575
|
+
* Replaces the former flat `libraryApiUrl`, `libraryDataPath`,
|
|
576
|
+
* `libraryUrlPath`, `libraryIdPath`, and `libraryUploadConfig` fields.
|
|
577
|
+
*/
|
|
578
|
+
libraryConfig?: LibraryConfig;
|
|
579
|
+
/** Optional description shown in the left info panel for media upload */
|
|
580
|
+
description?: string;
|
|
581
|
+
/** Optional bullet-point feature lines shown in the left info panel for media upload */
|
|
582
|
+
features?: string[];
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
export interface LocationConfig {
|
|
586
|
+
/** Default active tab (e.g. 'VENUE', 'ONLINE', 'TBA'). Defaults to 'VENUE' when not provided. */
|
|
587
|
+
defaultTab?: string;
|
|
588
|
+
/** Allow multiple locations. Replaces the need for maxLocations. */
|
|
589
|
+
allowMulti?: boolean;
|
|
590
|
+
/** Maximum number of venue locations allowed. Defaults to 5 if allowMulti is true. */
|
|
591
|
+
maxLocations?: number;
|
|
592
|
+
/** Placeholder for the venue search input */
|
|
593
|
+
venuePlaceholder?: string;
|
|
594
|
+
/** Google Maps API Key – required for map rendering and autocomplete */
|
|
595
|
+
googleMapsApiKey?: string;
|
|
596
|
+
/** Height of the embedded Google Map. Defaults to '300px'. */
|
|
597
|
+
mapHeight?: string;
|
|
598
|
+
/** Default map center latitude when no locations are added (e.g., India: 20.5937) */
|
|
599
|
+
defaultLat?: number;
|
|
600
|
+
/** Default map center longitude when no locations are added (e.g., India: 78.9629) */
|
|
601
|
+
defaultLng?: number;
|
|
602
|
+
/** Default zoom level when no locations are added (e.g., 4) */
|
|
603
|
+
defaultZoom?: number;
|
|
604
|
+
/** Placeholder for the online event URL input */
|
|
605
|
+
onlinePlaceholder?: string;
|
|
606
|
+
/** Show map preview after locations are added (default: true) */
|
|
607
|
+
showMap?: boolean;
|
|
608
|
+
/** Whether the current location button is enabled inside venue tab */
|
|
609
|
+
enableCurrentLocation?: boolean;
|
|
610
|
+
/** @deprecated Use showMap instead */
|
|
611
|
+
enableMapPicker?: boolean;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
/** A single venue location picked from Google Places autocomplete. */
|
|
616
|
+
export interface LocationItem {
|
|
617
|
+
uuid?: string;
|
|
618
|
+
isActive?: boolean;
|
|
619
|
+
id?: number;
|
|
620
|
+
locationCode?: string;
|
|
621
|
+
latitude?: number;
|
|
622
|
+
longitude?: number;
|
|
623
|
+
address?: string;
|
|
624
|
+
name?: string;
|
|
625
|
+
cityLabel?: string;
|
|
626
|
+
stateLabel?: string;
|
|
627
|
+
countryLabel?: string;
|
|
628
|
+
placeId?: string;
|
|
629
|
+
type?: string;
|
|
630
|
+
|
|
631
|
+
/** Legacy field for UI binding */
|
|
632
|
+
description?: string;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* Value shape stored in the FormControl for a LOCATION field.
|
|
637
|
+
* `tab` indicates which mode is active.
|
|
638
|
+
*/
|
|
639
|
+
export interface LocationFieldValue {
|
|
640
|
+
/** Active location tab (e.g. 'VENUE', 'ONLINE', 'TBA'). Defaults to 'VENUE'. */
|
|
641
|
+
tab: string;
|
|
642
|
+
/** Array of venue locations (only valid when tab === 'VENUE') */
|
|
643
|
+
venues?: LocationItem[];
|
|
644
|
+
/** Event URL (only valid when tab === 'ONLINE') */
|
|
645
|
+
onlineUrl?: string;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
export interface RatingConfig {
|
|
649
|
+
maxRating?: number;
|
|
650
|
+
allowHalf?: boolean;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
export interface RichTextConfig {
|
|
654
|
+
height?: string;
|
|
655
|
+
placeholder?: string;
|
|
656
|
+
maxLength?: number;
|
|
657
|
+
showCharCount?: boolean;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
export interface ValidationResult {
|
|
661
|
+
isValid: boolean;
|
|
662
|
+
errorMessage?: string;
|
|
663
|
+
fieldErrors?: { [key: string]: string };
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
/** A single uploaded file entry stored in the control value array */
|
|
667
|
+
export interface UploadedFile {
|
|
668
|
+
id?: number;
|
|
669
|
+
name: string;
|
|
670
|
+
size: number;
|
|
671
|
+
type: string;
|
|
672
|
+
/** base64 data URL, remote URL returned by upload API, or object URL – used for preview */
|
|
673
|
+
dataUrl?: string;
|
|
674
|
+
/** Raw File handle */
|
|
675
|
+
file: File;
|
|
676
|
+
/** True while the file is being uploaded to the server via uploadUrl */
|
|
677
|
+
isUploading?: boolean;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
/**
|
|
681
|
+
* A single media item stored in the MEDIA_UPLOAD field value array.
|
|
682
|
+
* Can represent an uploaded image (from device or library) or a YouTube video.
|
|
683
|
+
*/
|
|
684
|
+
export interface MediaItem {
|
|
685
|
+
/** Server-assigned ID (for pre-filled items) */
|
|
686
|
+
id?: number;
|
|
687
|
+
/** Media type (e.g. 'image', 'youtube'). Defaults to 'image'. */
|
|
688
|
+
mediaType: string;
|
|
689
|
+
/** Remote URL of the image returned by the upload API, or the YouTube embed URL */
|
|
690
|
+
url: string;
|
|
691
|
+
/** Thumbnail URL (for YouTube previews) */
|
|
692
|
+
thumbnailUrl?: string;
|
|
693
|
+
/** MIME type returned by the upload API (e.g. 'image/png') */
|
|
694
|
+
mimeType?: string;
|
|
695
|
+
/** File name returned by the upload API */
|
|
696
|
+
fileName?: string;
|
|
697
|
+
/** True while the file is being uploaded */
|
|
698
|
+
isUploading?: boolean;
|
|
699
|
+
}
|
|
700
|
+
|