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,384 @@
|
|
|
1
|
+
# Form Components
|
|
2
|
+
|
|
3
|
+
The `FormComponentsModule` provides a set of customizable, theme-aware form components. All components support `ControlValueAccessor` for seamless integration with Angular Reactive and Template-driven forms.
|
|
4
|
+
|
|
5
|
+
## Module Import
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { FormComponentsModule } from 'commons-shared-web-ui';
|
|
9
|
+
|
|
10
|
+
@NgModule({
|
|
11
|
+
imports: [FormComponentsModule]
|
|
12
|
+
})
|
|
13
|
+
export class YourModule {}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Input (`lib-input`)
|
|
19
|
+
|
|
20
|
+
A text input field supporting multiple types (text, number, email, password, tel, url, textarea).
|
|
21
|
+
|
|
22
|
+
### Selector
|
|
23
|
+
`<lib-input>`
|
|
24
|
+
|
|
25
|
+
### Inputs
|
|
26
|
+
|
|
27
|
+
| Input | Type | Default | Description |
|
|
28
|
+
|-------|------|---------|-------------|
|
|
29
|
+
| `config` | `InputConfig` | — | Configuration object for all properties |
|
|
30
|
+
| `labels` | `InputLabels` | — | i18n labels |
|
|
31
|
+
| `type` | `InputType` | `'text'` | Input type: `text`, `number`, `email`, `password`, `tel`, `url`, `textarea` |
|
|
32
|
+
| `label` | `string` | `''` | Field label |
|
|
33
|
+
| `placeholder` | `string` | `''` | Placeholder text |
|
|
34
|
+
| `disabled` | `boolean` | `false` | Disabled state |
|
|
35
|
+
| `required` | `boolean` | `false` | Required state |
|
|
36
|
+
| `readonly` | `boolean` | `false` | Read-only state |
|
|
37
|
+
| `maxLength` | `number` | — | Maximum character length |
|
|
38
|
+
| `minLength` | `number` | — | Minimum character length |
|
|
39
|
+
| `min` | `number` | — | Minimum numeric value |
|
|
40
|
+
| `max` | `number` | — | Maximum numeric value |
|
|
41
|
+
| `pattern` | `string` | — | Validation pattern |
|
|
42
|
+
| `errorMessage` | `string` | — | Error message to display |
|
|
43
|
+
| `helperText` | `string` | — | Helper text below the field |
|
|
44
|
+
| `rows` | `number` | — | Rows for textarea type |
|
|
45
|
+
| `prefixIcon` | `string \| IconObject` | — | Icon before input |
|
|
46
|
+
| `suffixIcon` | `string \| IconObject` | — | Icon after input |
|
|
47
|
+
|
|
48
|
+
### Outputs
|
|
49
|
+
|
|
50
|
+
| Output | Type | Description |
|
|
51
|
+
|--------|------|-------------|
|
|
52
|
+
| `valueChange` | `EventEmitter<any>` | Emitted when value changes |
|
|
53
|
+
| `blur` | `EventEmitter<void>` | Emitted on blur |
|
|
54
|
+
| `focus` | `EventEmitter<void>` | Emitted on focus |
|
|
55
|
+
|
|
56
|
+
### Usage
|
|
57
|
+
|
|
58
|
+
```html
|
|
59
|
+
<lib-input
|
|
60
|
+
[config]="{ type: 'text', label: 'Name', placeholder: 'Enter your name', required: true }"
|
|
61
|
+
[labels]="{ label: 'Full Name', placeholder: 'Enter name' }"
|
|
62
|
+
(valueChange)="onNameChange($event)">
|
|
63
|
+
</lib-input>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Dropdown (`lib-dropdown`)
|
|
69
|
+
|
|
70
|
+
A select/dropdown component with single or multi-select, search, virtual scrolling, and keyboard navigation.
|
|
71
|
+
|
|
72
|
+
### Selector
|
|
73
|
+
`<lib-dropdown>`
|
|
74
|
+
|
|
75
|
+
### Inputs
|
|
76
|
+
|
|
77
|
+
| Input | Type | Default | Description |
|
|
78
|
+
|-------|------|---------|-------------|
|
|
79
|
+
| `config` | `DropdownConfig` | — | Configuration object |
|
|
80
|
+
| `labels` | `DropdownLabels` | — | i18n labels |
|
|
81
|
+
| `options` | `DropdownOption[]` | `[]` | Array of selectable options |
|
|
82
|
+
| `placeholder` | `string` | `''` | Placeholder text |
|
|
83
|
+
| `label` | `string` | `''` | Field label |
|
|
84
|
+
| `multiple` | `boolean` | `false` | Enable multi-select |
|
|
85
|
+
| `searchable` | `boolean` | `false` | Enable search filtering |
|
|
86
|
+
| `clearable` | `boolean` | `false` | Show clear button |
|
|
87
|
+
| `disabled` | `boolean` | `false` | Disabled state |
|
|
88
|
+
| `required` | `boolean` | `false` | Required state |
|
|
89
|
+
|
|
90
|
+
### `DropdownOption` Interface
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
interface DropdownOption {
|
|
94
|
+
value: any;
|
|
95
|
+
label: string;
|
|
96
|
+
disabled?: boolean;
|
|
97
|
+
icon?: string | { type: 'material' | 'fontawesome' | 'img'; value: string };
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Outputs
|
|
102
|
+
|
|
103
|
+
| Output | Type | Description |
|
|
104
|
+
|--------|------|-------------|
|
|
105
|
+
| `selectionChange` | `EventEmitter<any>` | Emitted on selection change |
|
|
106
|
+
|
|
107
|
+
### Usage
|
|
108
|
+
|
|
109
|
+
```html
|
|
110
|
+
<lib-dropdown
|
|
111
|
+
[config]="{ options: items, label: 'Country', searchable: true, clearable: true }"
|
|
112
|
+
[labels]="{ placeholder: 'Select a country', searchPlaceholder: 'Search...' }"
|
|
113
|
+
(selectionChange)="onCountryChange($event)">
|
|
114
|
+
</lib-dropdown>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Checkbox (`lib-checkbox`)
|
|
120
|
+
|
|
121
|
+
A checkbox component supporting single and group modes.
|
|
122
|
+
|
|
123
|
+
### Selector
|
|
124
|
+
`<lib-checkbox>`
|
|
125
|
+
|
|
126
|
+
### Inputs
|
|
127
|
+
|
|
128
|
+
| Input | Type | Default | Description |
|
|
129
|
+
|-------|------|---------|-------------|
|
|
130
|
+
| `config` | `CheckboxConfig` | — | Configuration object |
|
|
131
|
+
| `labels` | `CheckboxLabels` | — | i18n labels |
|
|
132
|
+
| `label` | `string` | `''` | Checkbox label |
|
|
133
|
+
| `checked` | `boolean` | `false` | Checked state |
|
|
134
|
+
| `disabled` | `boolean` | `false` | Disabled state |
|
|
135
|
+
| `required` | `boolean` | `false` | Required state |
|
|
136
|
+
| `indeterminate` | `boolean` | `false` | Indeterminate state |
|
|
137
|
+
| `options` | `CheckboxOption[]` | `[]` | Group options |
|
|
138
|
+
| `labelPosition` | `'before' \| 'after'` | `'after'` | Label position |
|
|
139
|
+
| `color` | `'primary' \| 'accent' \| 'warn'` | `'primary'` | Color theme |
|
|
140
|
+
|
|
141
|
+
### Outputs
|
|
142
|
+
|
|
143
|
+
| Output | Type | Description |
|
|
144
|
+
|--------|------|-------------|
|
|
145
|
+
| `change` | `EventEmitter<boolean>` | Emitted when checked state changes |
|
|
146
|
+
| `groupChange` | `EventEmitter<CheckboxOption[]>` | Emitted when group selection changes |
|
|
147
|
+
|
|
148
|
+
### Usage
|
|
149
|
+
|
|
150
|
+
```html
|
|
151
|
+
<!-- Single checkbox -->
|
|
152
|
+
<lib-checkbox
|
|
153
|
+
[config]="{ label: 'Accept Terms', required: true }"
|
|
154
|
+
(change)="onAccept($event)">
|
|
155
|
+
</lib-checkbox>
|
|
156
|
+
|
|
157
|
+
<!-- Checkbox group -->
|
|
158
|
+
<lib-checkbox
|
|
159
|
+
[config]="{ label: 'Select interests', options: interestOptions }"
|
|
160
|
+
(groupChange)="onInterestsChange($event)">
|
|
161
|
+
</lib-checkbox>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Radio (`lib-radio`)
|
|
167
|
+
|
|
168
|
+
A radio button group component.
|
|
169
|
+
|
|
170
|
+
### Selector
|
|
171
|
+
`<lib-radio>`
|
|
172
|
+
|
|
173
|
+
### Inputs
|
|
174
|
+
|
|
175
|
+
| Input | Type | Default | Description |
|
|
176
|
+
|-------|------|---------|-------------|
|
|
177
|
+
| `config` | `RadioConfig` | — | Configuration object |
|
|
178
|
+
| `labels` | `RadioLabels` | — | i18n labels |
|
|
179
|
+
| `options` | `RadioOption[]` | `[]` | Radio options |
|
|
180
|
+
| `label` | `string` | `''` | Group label |
|
|
181
|
+
| `value` | `any` | — | Selected value |
|
|
182
|
+
| `disabled` | `boolean` | `false` | Disabled state |
|
|
183
|
+
| `required` | `boolean` | `false` | Required state |
|
|
184
|
+
| `labelPosition` | `'before' \| 'after'` | `'after'` | Label position |
|
|
185
|
+
| `color` | `'primary' \| 'warning' \| 'danger' \| 'success' \| 'accent' \| 'warn' \| string` | `'primary'` | Radio theme color |
|
|
186
|
+
| `layout` | `'vertical' \| 'horizontal'` | `'vertical'` | Layout direction |
|
|
187
|
+
|
|
188
|
+
### `RadioOption` Interface
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
interface RadioOption {
|
|
192
|
+
value: any;
|
|
193
|
+
label: string;
|
|
194
|
+
disabled?: boolean;
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Outputs
|
|
199
|
+
|
|
200
|
+
| Output | Type | Description |
|
|
201
|
+
|--------|------|-------------|
|
|
202
|
+
| `selectionChange` | `EventEmitter<any>` | Emitted when selection changes |
|
|
203
|
+
|
|
204
|
+
### Usage
|
|
205
|
+
|
|
206
|
+
```html
|
|
207
|
+
<lib-radio
|
|
208
|
+
[config]="{ label: 'Gender', options: genderOptions, layout: 'horizontal' }"
|
|
209
|
+
[labels]="{ label: 'Select Gender' }"
|
|
210
|
+
(selectionChange)="onGenderChange($event)">
|
|
211
|
+
</lib-radio>
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Toggle (`lib-toggle`)
|
|
217
|
+
|
|
218
|
+
A slide toggle / switch component.
|
|
219
|
+
|
|
220
|
+
### Selector
|
|
221
|
+
`<lib-toggle>`
|
|
222
|
+
|
|
223
|
+
### Inputs
|
|
224
|
+
|
|
225
|
+
| Input | Type | Default | Description |
|
|
226
|
+
|-------|------|---------|-------------|
|
|
227
|
+
| `config` | `ToggleConfig` | — | Configuration object |
|
|
228
|
+
| `labels` | `ToggleLabels` | — | i18n labels |
|
|
229
|
+
| `label` | `string` | `''` | Toggle label |
|
|
230
|
+
| `checked` | `boolean` | `false` | Toggle state |
|
|
231
|
+
| `disabled` | `boolean` | `false` | Disabled state |
|
|
232
|
+
| `required` | `boolean` | `false` | Required state |
|
|
233
|
+
| `labelPosition` | `'before' \| 'after'` | `'after'` | Label position |
|
|
234
|
+
| `color` | `'primary' \| 'warning' \| 'danger' \| 'success' \| string` | `'primary'` | Track checked color |
|
|
235
|
+
| `uncheckedColor` | `string` | — | Unchecked track color |
|
|
236
|
+
| `checkedColor` | `string` | — | Checked track color |
|
|
237
|
+
| `thumbColor` | `string` | — | Thumb color |
|
|
238
|
+
| `toggleWidth` | `string` | — | Toggle width |
|
|
239
|
+
| `toggleHeight` | `string` | — | Toggle height |
|
|
240
|
+
|
|
241
|
+
### Outputs
|
|
242
|
+
|
|
243
|
+
| Output | Type | Description |
|
|
244
|
+
|--------|------|-------------|
|
|
245
|
+
| `change` | `EventEmitter<boolean>` | Emitted when toggled |
|
|
246
|
+
|
|
247
|
+
### Usage
|
|
248
|
+
|
|
249
|
+
```html
|
|
250
|
+
<lib-toggle
|
|
251
|
+
[config]="{ label: 'Dark Mode', checked: isDarkMode }"
|
|
252
|
+
(change)="onToggleDarkMode($event)">
|
|
253
|
+
</lib-toggle>
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## Datepicker (`lib-datepicker`)
|
|
259
|
+
|
|
260
|
+
A date picker component supporting single date and date range selection.
|
|
261
|
+
|
|
262
|
+
### Selector
|
|
263
|
+
`<lib-datepicker>`
|
|
264
|
+
|
|
265
|
+
### Inputs
|
|
266
|
+
|
|
267
|
+
| Input | Type | Default | Description |
|
|
268
|
+
|-------|------|---------|-------------|
|
|
269
|
+
| `config` | `DatePickerConfig` | — | Configuration object |
|
|
270
|
+
| `labels` | `DatepickerLabels` | — | i18n labels |
|
|
271
|
+
| `label` | `string` | `''` | Field label |
|
|
272
|
+
| `placeholder` | `string` | `''` | Placeholder text |
|
|
273
|
+
| `disabled` | `boolean` | `false` | Disabled state |
|
|
274
|
+
| `required` | `boolean` | `false` | Required state |
|
|
275
|
+
| `minDate` | `Date` | — | Minimum selectable date |
|
|
276
|
+
| `maxDate` | `Date` | — | Maximum selectable date |
|
|
277
|
+
| `isRange` | `boolean` | `false` | Enable date range mode |
|
|
278
|
+
|
|
279
|
+
### Outputs
|
|
280
|
+
|
|
281
|
+
| Output | Type | Description |
|
|
282
|
+
|--------|------|-------------|
|
|
283
|
+
| `dateChange` | `EventEmitter<Date>` | Emitted on single date change |
|
|
284
|
+
| `rangeChange` | `EventEmitter<{start: Date, end: Date}>` | Emitted on range change |
|
|
285
|
+
|
|
286
|
+
### Usage
|
|
287
|
+
|
|
288
|
+
```html
|
|
289
|
+
<!-- Single date -->
|
|
290
|
+
<lib-datepicker
|
|
291
|
+
[config]="{ label: 'Start Date', placeholder: 'Pick a date', required: true }"
|
|
292
|
+
(dateChange)="onDateChange($event)">
|
|
293
|
+
</lib-datepicker>
|
|
294
|
+
|
|
295
|
+
<!-- Date range -->
|
|
296
|
+
<lib-datepicker
|
|
297
|
+
[config]="{ label: 'Date Range', isRange: true }"
|
|
298
|
+
[labels]="{ startDateLabel: 'From', endDateLabel: 'To' }"
|
|
299
|
+
(rangeChange)="onRangeChange($event)">
|
|
300
|
+
</lib-datepicker>
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## Search (`lib-search`)
|
|
306
|
+
|
|
307
|
+
A search input with built-in debounce and clear button support.
|
|
308
|
+
|
|
309
|
+
### Selector
|
|
310
|
+
`<lib-search>`
|
|
311
|
+
|
|
312
|
+
### Inputs
|
|
313
|
+
|
|
314
|
+
| Input | Type | Default | Description |
|
|
315
|
+
|-------|------|---------|-------------|
|
|
316
|
+
| `config` | `FilterSearchConfig` | — | Configuration object |
|
|
317
|
+
| `labels` | `SearchLabels` | — | i18n labels |
|
|
318
|
+
| `placeholder` | `string` | `''` | Placeholder text |
|
|
319
|
+
| `label` | `string` | `''` | Field label |
|
|
320
|
+
| `disabled` | `boolean` | `false` | Disabled state |
|
|
321
|
+
| `debounceMs` | `number` | `300` | Debounce time in milliseconds |
|
|
322
|
+
| `clearable` | `boolean` | `true` | Show clear button |
|
|
323
|
+
|
|
324
|
+
### Outputs
|
|
325
|
+
|
|
326
|
+
| Output | Type | Description |
|
|
327
|
+
|--------|------|-------------|
|
|
328
|
+
| `search` | `EventEmitter<string>` | Emitted on search (debounced) |
|
|
329
|
+
| `clear` | `EventEmitter<void>` | Emitted when search is cleared |
|
|
330
|
+
|
|
331
|
+
### Usage
|
|
332
|
+
|
|
333
|
+
```html
|
|
334
|
+
<lib-search
|
|
335
|
+
[config]="{ placeholder: 'Search users...', debounceTime: 500, clearable: true }"
|
|
336
|
+
(search)="onSearch($event)"
|
|
337
|
+
(clear)="onClear()">
|
|
338
|
+
</lib-search>
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
343
|
+
## Theming
|
|
344
|
+
|
|
345
|
+
All form components support theming via CSS variables and SCSS mixins.
|
|
346
|
+
|
|
347
|
+
### SCSS Mixin Setup
|
|
348
|
+
|
|
349
|
+
Include the theme mixin in your application's global `styles.scss`:
|
|
350
|
+
|
|
351
|
+
```scss
|
|
352
|
+
@use 'commons-shared-web-ui/src/lib/modules/form-components/form-components.theme' as forms;
|
|
353
|
+
|
|
354
|
+
html, body {
|
|
355
|
+
@include forms.form-components-theme();
|
|
356
|
+
}
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### Customizing Theme
|
|
360
|
+
|
|
361
|
+
Pass a configuration map to override defaults:
|
|
362
|
+
|
|
363
|
+
```scss
|
|
364
|
+
@include forms.form-components-theme((
|
|
365
|
+
primary-color: #ff0000,
|
|
366
|
+
input-border-radius: 8px
|
|
367
|
+
));
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### Key CSS Variables
|
|
371
|
+
|
|
372
|
+
| Variable | Default | Description |
|
|
373
|
+
|----------|---------|-------------|
|
|
374
|
+
| `--cc-input-bg` | `#FEFEFE` | Input background color |
|
|
375
|
+
| `--cc-input-border-radius` | `0.4375rem` | Input border radius |
|
|
376
|
+
| `--cc-input-border-color` | `#BDC1C6` | Input border color |
|
|
377
|
+
| `--cc-input-focus-border-color` | `#1A73E8` | Focus border color |
|
|
378
|
+
| `--cc-dropdown-bg` | `#FEFEFE` | Dropdown background color |
|
|
379
|
+
| `--cc-dropdown-height` | `2.5rem` | Dropdown trigger height |
|
|
380
|
+
| `--cc-checkbox-checked-color` | `#1A73E8` | Checkbox checked color |
|
|
381
|
+
|
|
382
|
+
### Inline Style Overrides
|
|
383
|
+
|
|
384
|
+
All components accept style customization properties (`width`, `height`, `borderRadius`, `fontSize`, `backgroundColor`, `borderColor`, etc.) via their respective `config` objects. These are applied as inline styles with `!important` for precedence.
|