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,250 @@
|
|
|
1
|
+
# Confirmation Modal Component
|
|
2
|
+
|
|
3
|
+
The `ConfirmationModalComponent` is a flexible dialog component used for confirming actions, displaying alerts, or presenting custom content with a consistent design.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
To install the latest version of the `commons-shared-web-ui` library, run the following command:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install commons-shared-web-ui@latest
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
1. Import `ConfirmationModalModule` in your feature module:
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { ConfirmationModalModule } from "commons-shared-web-ui";
|
|
17
|
+
|
|
18
|
+
@NgModule({
|
|
19
|
+
imports: [ConfirmationModalModule],
|
|
20
|
+
})
|
|
21
|
+
export class FeatureModule {}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
2. Include the theme mixin in your global styles:
|
|
25
|
+
|
|
26
|
+
```scss
|
|
27
|
+
@use "commons-shared-web-ui/lib/modules/confirmation-modal/confirmation-modal.theme"
|
|
28
|
+
as modal;
|
|
29
|
+
|
|
30
|
+
:root {
|
|
31
|
+
@include modal.confirmation-modal-theme();
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
37
|
+
Use the component in your template and control its visibility via the `isOpen` input.
|
|
38
|
+
|
|
39
|
+
```html
|
|
40
|
+
<cc-confirmation-modal
|
|
41
|
+
[isOpen]="isModalOpen"
|
|
42
|
+
[config]="modalConfig"
|
|
43
|
+
(confirm)="onConfirm()"
|
|
44
|
+
(cancel)="onCancel()"
|
|
45
|
+
(close)="onClose()"
|
|
46
|
+
>
|
|
47
|
+
<!-- Optional: Project custom content here -->
|
|
48
|
+
<p>This action cannot be undone.</p>
|
|
49
|
+
</cc-confirmation-modal>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Configuration (`ConfirmationModalConfig`)
|
|
53
|
+
|
|
54
|
+
The appearance and behavior are controlled via the `config` input.
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
import { ConfirmationModalConfig } from "commons-shared-web-ui";
|
|
58
|
+
|
|
59
|
+
modalConfig: ConfirmationModalConfig = {
|
|
60
|
+
title: "Delete Item?",
|
|
61
|
+
headerTheme: "dark", // 'light' | 'dark'
|
|
62
|
+
confirmButton: {
|
|
63
|
+
label: "Delete",
|
|
64
|
+
type: "danger",
|
|
65
|
+
},
|
|
66
|
+
cancelButton: {
|
|
67
|
+
label: "Cancel",
|
|
68
|
+
show: true,
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## API Reference
|
|
74
|
+
|
|
75
|
+
### Inputs
|
|
76
|
+
|
|
77
|
+
| `isOpen` | `boolean` | `false` | Controls the visibility of the modal. |
|
|
78
|
+
| `config` | `ConfirmationModalConfig` | - | Configuration object for the modal. |
|
|
79
|
+
| `confirmDisabled` | `boolean` | `false` | Direct override to disable the confirm button (useful for file uploads). |
|
|
80
|
+
| `confirmLoading` | `boolean` | `false` | Direct override to show loading on the confirm button (shows a spinner). |
|
|
81
|
+
|
|
82
|
+
### Outputs
|
|
83
|
+
|
|
84
|
+
| Output | Type | Description |
|
|
85
|
+
| --------- | -------------------- | ----------------------------------------------------------------------------- |
|
|
86
|
+
| `confirm` | `EventEmitter<void>` | Emitted when the confirm button is clicked. |
|
|
87
|
+
| `cancel` | `EventEmitter<void>` | Emitted when the cancel button is clicked. |
|
|
88
|
+
| `close` | `EventEmitter<void>` | Emitted when the modal is closed (via backdrop, escape key, or close button). |
|
|
89
|
+
| `showCodeSnippet` | `EventEmitter<void>` | Emitted when the code snippet button is clicked. |
|
|
90
|
+
|
|
91
|
+
### ConfirmationModalConfig Interface
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
export interface ConfirmationModalConfig {
|
|
95
|
+
// Header
|
|
96
|
+
title: string;
|
|
97
|
+
headerTheme?: "light" | "dark";
|
|
98
|
+
icon?: string | {
|
|
99
|
+
type: "material" | "custom";
|
|
100
|
+
value: string;
|
|
101
|
+
color?: string;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// Modal appearance
|
|
105
|
+
width?: string;
|
|
106
|
+
size?: "sm" | "md" | "lg" | "xl"; // sm: 400px, md: 560px, lg: 720px, xl: 1200px
|
|
107
|
+
customClass?: string;
|
|
108
|
+
type?: "modal" | "side-panel";
|
|
109
|
+
panelPosition?: "left" | "right" | "top" | "bottom";
|
|
110
|
+
panelSpacing?: string;
|
|
111
|
+
panelWidth?: string;
|
|
112
|
+
panelHeight?: string;
|
|
113
|
+
|
|
114
|
+
// Style Overrides (Direct inputs)
|
|
115
|
+
backgroundColor?: string;
|
|
116
|
+
borderRadius?: string;
|
|
117
|
+
borderTopLeftRadius?: string;
|
|
118
|
+
borderTopRightRadius?: string;
|
|
119
|
+
borderBottomLeftRadius?: string;
|
|
120
|
+
borderBottomRightRadius?: string;
|
|
121
|
+
padding?: string;
|
|
122
|
+
headerBackgroundColor?: string;
|
|
123
|
+
headerTextColor?: string;
|
|
124
|
+
headerBorderBottom?: string;
|
|
125
|
+
bodyTextColor?: string;
|
|
126
|
+
footerBackgroundColor?: string;
|
|
127
|
+
footerBorderTop?: string;
|
|
128
|
+
|
|
129
|
+
// Buttons
|
|
130
|
+
confirmButton: {
|
|
131
|
+
label: string;
|
|
132
|
+
type: "primary" | "danger" | "warning";
|
|
133
|
+
disabled?: boolean;
|
|
134
|
+
loading?: boolean;
|
|
135
|
+
};
|
|
136
|
+
cancelButton?: {
|
|
137
|
+
label?: string;
|
|
138
|
+
show?: boolean;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
// Custom Footer
|
|
142
|
+
customFooter?: boolean; // Set to true to replace default buttons with custom footer content
|
|
143
|
+
|
|
144
|
+
// Body layout
|
|
145
|
+
formMode?: boolean; // Set to true when projecting a lib-smart-form — removes body padding and enforces 360px min-height with skeleton spinner
|
|
146
|
+
|
|
147
|
+
// Behavior
|
|
148
|
+
closeOnBackdrop?: boolean;
|
|
149
|
+
closeOnEsc?: boolean;
|
|
150
|
+
showCloseButton?: boolean;
|
|
151
|
+
showCodeSnippetButton?: boolean;
|
|
152
|
+
|
|
153
|
+
// Accessibility
|
|
154
|
+
ariaLabel?: string;
|
|
155
|
+
ariaDescribedBy?: string;
|
|
156
|
+
|
|
157
|
+
// i18n Labels
|
|
158
|
+
labels?: {
|
|
159
|
+
closeAriaLabel?: string;
|
|
160
|
+
codeSnippetAriaLabel?: string;
|
|
161
|
+
codeSnippetTitle?: string;
|
|
162
|
+
iconAltText?: string;
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Configuration Key Reference
|
|
168
|
+
|
|
169
|
+
The `confirmation-modal-theme` mixin accepts a map with the following optional keys.
|
|
170
|
+
|
|
171
|
+
| Key | Default | Description |
|
|
172
|
+
| ------------------- | ----------------------------- | ------------------------------- |
|
|
173
|
+
| **bg** | `#FFFFFF` | Background color of the modal. |
|
|
174
|
+
| **radius** | `0.75rem` | Border radius (12px). |
|
|
175
|
+
| **shadow** | `0 4px 24px rgba(0,0,0,0.15)` | Box shadow of the modal. |
|
|
176
|
+
| **title-font-size** | `1.25rem` | Font size of the title (20px). |
|
|
177
|
+
| **title-color** | `#111827` | Text color of the title. |
|
|
178
|
+
| **body-padding** | `1.5rem` | Padding for the body (24px). |
|
|
179
|
+
| **footer-bg** | `#F9FAFB` | Background color of the footer. |
|
|
180
|
+
| **footer-padding** | `1rem 1.5rem` | Padding for the footer. |
|
|
181
|
+
| **body-padding** | `1.5rem` | Body padding when `formMode` is not set. |
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Usage & Examples
|
|
186
|
+
|
|
187
|
+
### 1. Basic Confirmation
|
|
188
|
+
|
|
189
|
+
```typescript
|
|
190
|
+
modalConfig: ConfirmationModalConfig = {
|
|
191
|
+
title: "Delete User?",
|
|
192
|
+
confirmButton: { label: "Delete", type: "danger" },
|
|
193
|
+
cancelButton: { label: "Cancel", show: true },
|
|
194
|
+
};
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### 2. Smart Form in Modal (`formMode`)
|
|
198
|
+
|
|
199
|
+
When projecting a `lib-smart-form`, set `formMode: true` in the config. This applies zero body padding and a 360 px minimum height so the modal stays stable while the form skeleton loads.
|
|
200
|
+
|
|
201
|
+
```typescript
|
|
202
|
+
formModalConfig: ConfirmationModalConfig = {
|
|
203
|
+
title: "Edit Student",
|
|
204
|
+
formMode: true,
|
|
205
|
+
confirmButton: { label: "Save", type: "primary" },
|
|
206
|
+
cancelButton: { label: "Cancel", show: true },
|
|
207
|
+
};
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
```html
|
|
211
|
+
<cc-confirmation-modal [isOpen]="isFormOpen" [config]="formModalConfig">
|
|
212
|
+
<lib-smart-form [formId]="formId" (formSubmit)="onSubmit($event)" />
|
|
213
|
+
</cc-confirmation-modal>
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
> **Note:** Without `formMode: true`, the modal body uses the default `1.5rem` padding and natural content height — correct for plain text confirmations. Only set `formMode: true` when a `lib-smart-form` is projected.
|
|
217
|
+
|
|
218
|
+
### 3. Dark Header (Premium Design)
|
|
219
|
+
|
|
220
|
+
```typescript
|
|
221
|
+
modalConfig: ConfirmationModalConfig = {
|
|
222
|
+
title: "Create Project",
|
|
223
|
+
headerTheme: "dark", // Native support for dark header
|
|
224
|
+
confirmButton: { label: "Continue", type: "primary" },
|
|
225
|
+
};
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### 4. Side Panel Mode
|
|
229
|
+
|
|
230
|
+
The component can also act as a sliding side panel. You can configure its position and spacing from the viewport edges.
|
|
231
|
+
|
|
232
|
+
```typescript
|
|
233
|
+
sidePanelConfig: ConfirmationModalConfig = {
|
|
234
|
+
title: "Filters",
|
|
235
|
+
type: "side-panel",
|
|
236
|
+
panelPosition: "right",
|
|
237
|
+
panelSpacing: "16px",
|
|
238
|
+
panelWidth: "400px",
|
|
239
|
+
confirmButton: { label: "Apply Filters", type: "primary" },
|
|
240
|
+
cancelButton: { label: "Reset", show: true }
|
|
241
|
+
};
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
```html
|
|
245
|
+
<cc-confirmation-modal [isOpen]="isPanelOpen" [config]="sidePanelConfig">
|
|
246
|
+
<div class="panel-content">
|
|
247
|
+
<!-- Panel specific content -->
|
|
248
|
+
</div>
|
|
249
|
+
</cc-confirmation-modal>
|
|
250
|
+
```
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# Filter Sidebar Component
|
|
2
|
+
|
|
3
|
+
A configuration-driven sidebar component for filtering lists and tables. It supports advanced configuration, form integration via `ControlValueAccessor`, and granular event handling.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Dynamic Configuration**: Fully driven by a JSON configuration object.
|
|
8
|
+
- **Form Integration**: Implements `ControlValueAccessor` for usage with `[(ngModel)]` or `[formControl]`.
|
|
9
|
+
- **Multiple Input Types**: Supports `select`, `accordion` (multi-select checkboxes), `checkbox-group`, and `radio-group`.
|
|
10
|
+
- **Tabs Support**: Configurable top-level tabs for switching contexts.
|
|
11
|
+
- **Granular Events**: Emits changes per filter, on apply, and on clear.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
To install the latest version of the `commons-shared-web-ui` library, run the following command:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install commons-shared-web-ui@latest
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
1. Import `FilterSidebarModule` in your feature module:
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import { FilterSidebarModule } from "commons-shared-web-ui";
|
|
25
|
+
|
|
26
|
+
@NgModule({
|
|
27
|
+
imports: [FilterSidebarModule],
|
|
28
|
+
})
|
|
29
|
+
export class FeatureModule {}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
### Basic Usage
|
|
35
|
+
|
|
36
|
+
```html
|
|
37
|
+
<lib-filter-sidebar
|
|
38
|
+
[config]="filterConfig"
|
|
39
|
+
[(ngModel)]="currentFilters"
|
|
40
|
+
(filterApply)="onApply($event)"
|
|
41
|
+
>
|
|
42
|
+
</lib-filter-sidebar>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Configuration Example
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import { FilterConfig } from "commons-shared-web-ui";
|
|
49
|
+
|
|
50
|
+
const filterConfig: FilterConfig = {
|
|
51
|
+
tabs: {
|
|
52
|
+
items: [
|
|
53
|
+
{
|
|
54
|
+
id: "existing",
|
|
55
|
+
label: "Invite Existing User",
|
|
56
|
+
icon: "fa-regular fa-user",
|
|
57
|
+
},
|
|
58
|
+
{ id: "new", label: "Invite New User", icon: "fa-solid fa-user-plus" },
|
|
59
|
+
],
|
|
60
|
+
defaultActive: "existing",
|
|
61
|
+
},
|
|
62
|
+
sections: [
|
|
63
|
+
{
|
|
64
|
+
type: "select",
|
|
65
|
+
key: "beneficiaryType",
|
|
66
|
+
title: "Beneficiary Type",
|
|
67
|
+
placeholder: "Select Type",
|
|
68
|
+
options: [
|
|
69
|
+
{ label: "Parents", value: "parents" },
|
|
70
|
+
{ label: "Students", value: "students" },
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
type: "accordion",
|
|
75
|
+
key: "gender",
|
|
76
|
+
title: "Gender",
|
|
77
|
+
multi: true, // Checkboxes inside accordion
|
|
78
|
+
options: [
|
|
79
|
+
{ label: "Male", value: "male" },
|
|
80
|
+
{ label: "Female", value: "female" },
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
actions: {
|
|
85
|
+
apply: { label: "Apply Filter" },
|
|
86
|
+
clear: { label: "Clear Filter" },
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Configuration Key Reference
|
|
92
|
+
|
|
93
|
+
The `filter-sidebar-theme` mixin accepts a map with the following optional keys.
|
|
94
|
+
|
|
95
|
+
| Key | Default | Description |
|
|
96
|
+
| ------------------------- | --------- | -------------------------------- |
|
|
97
|
+
| **bg-color** | `#ffffff` | Sidebar background color. |
|
|
98
|
+
| **border-color** | `#E5E7EB` | Sidebar border color. |
|
|
99
|
+
| **width** | `300px` | Sidebar width. |
|
|
100
|
+
| **tab-active-bg** | `#FEF2F2` | Background of active tab. |
|
|
101
|
+
| **tab-active-color** | `#EF4444` | Text color of active tab. |
|
|
102
|
+
| **section-title-color** | `#374151` | Default section title color. |
|
|
103
|
+
| **accordion-title-color** | `#111827` | Accordion header text color. |
|
|
104
|
+
| **footer-bg** | `#ffffff` | Actions footer background color. |
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Usage & Examples
|
|
109
|
+
|
|
110
|
+
### 1. Complex Sections Example
|
|
111
|
+
|
|
112
|
+
```typescript
|
|
113
|
+
sections: [
|
|
114
|
+
{
|
|
115
|
+
type: "select",
|
|
116
|
+
key: "category",
|
|
117
|
+
title: "Project Category",
|
|
118
|
+
options: [
|
|
119
|
+
{ label: "Web", value: "web" },
|
|
120
|
+
{ label: "Mobile", value: "mobile" },
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
type: "accordion",
|
|
125
|
+
key: "tags",
|
|
126
|
+
title: "Popular Tags",
|
|
127
|
+
multi: true,
|
|
128
|
+
options: [
|
|
129
|
+
{ label: "Angular", value: "angular" },
|
|
130
|
+
{ label: "Sass", value: "sass" },
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
type: "radio-group",
|
|
135
|
+
key: "status",
|
|
136
|
+
title: "Project Status",
|
|
137
|
+
options: [
|
|
138
|
+
{ label: "Active", value: "active" },
|
|
139
|
+
{ label: "Archived", value: "archived" },
|
|
140
|
+
],
|
|
141
|
+
},
|
|
142
|
+
];
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### 2. Tabs Integration
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
tabs: {
|
|
149
|
+
items: [
|
|
150
|
+
{ id: 'filters', label: 'Filters', icon: 'fa-solid fa-filter' },
|
|
151
|
+
{ id: 'presets', label: 'Saved Presets', icon: 'fa-regular fa-star' }
|
|
152
|
+
],
|
|
153
|
+
defaultActive: 'filters'
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## API Reference
|
|
158
|
+
|
|
159
|
+
### Inputs
|
|
160
|
+
|
|
161
|
+
| Input | Type | Description |
|
|
162
|
+
| ---------------- | -------------- | --------------------- |
|
|
163
|
+
| `config` | `FilterConfig` | Structure definition. |
|
|
164
|
+
| `initialFilters` | `FilterOutput` | Initial values. |
|
|
165
|
+
|
|
166
|
+
### FilterConfig Interface
|
|
167
|
+
|
|
168
|
+
```typescript
|
|
169
|
+
export interface FilterConfig {
|
|
170
|
+
tabs?: { items: FilterTab[]; defaultActive?: string };
|
|
171
|
+
sections: FilterSection[];
|
|
172
|
+
actions?: {
|
|
173
|
+
apply?: { label?: string; visible?: boolean };
|
|
174
|
+
clear?: { label?: string; visible?: boolean };
|
|
175
|
+
};
|
|
176
|
+
settings?: { collapsible?: boolean };
|
|
177
|
+
}
|
|
178
|
+
```
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# Filter Table Selector Component Documentation
|
|
2
|
+
|
|
3
|
+
The `FilterTableSelectorComponent` is a composite, configuration-driven component designed for complex selection workflows. It combines a powerful left-hand filter panel (powered by `SmartForm`) with a right-hand data table (powered by `SmartTable`).
|
|
4
|
+
|
|
5
|
+
It is ideal for scenarios like "Add Beneficiaries", "Select Staff", or "Assign Assets" where users need to search and filter through large datasets before making one or more selections.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Split-Pane Layout**: Side-by-side filter form and data table for an efficient selection experience.
|
|
10
|
+
- **Dynamic Filtering**: Filters are defined via standard `SmartForm` JSON schemas, supporting dropdowns, multi-selects, and dependencies.
|
|
11
|
+
- **Cross-Page Selection**: Tracks selected items across multiple pages of pagination.
|
|
12
|
+
- **Configurable Selection**: Supports both Single Select (Radio) and Multi Select (Checkbox) modes.
|
|
13
|
+
- **i18n Ready**: All labels, placeholders, and headers are resolved via provided translation maps.
|
|
14
|
+
- **Pre-selection Support**: Automatically checks rows that were previously selected.
|
|
15
|
+
- **Responsive**: Adapts to mobile views with a toggleable filter panel.
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
The component is part of the `FilterTableSelectorModule`.
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import { FilterTableSelectorModule } from "@campus-cloud/shared-ui";
|
|
23
|
+
|
|
24
|
+
@NgModule({
|
|
25
|
+
imports: [
|
|
26
|
+
FilterTableSelectorModule,
|
|
27
|
+
// ...
|
|
28
|
+
],
|
|
29
|
+
})
|
|
30
|
+
export class MyFeatureModule {}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Basic Usage
|
|
34
|
+
|
|
35
|
+
1. **Define Configuration**: Create a `FilterTableSelectorConfig` object.
|
|
36
|
+
2. **Provide Labels**: Pass a flat i18n map for translating all keys in the config.
|
|
37
|
+
3. **Handle Events**: Listen to `onSubmit` to get the array of selected row objects.
|
|
38
|
+
|
|
39
|
+
### Template
|
|
40
|
+
```html
|
|
41
|
+
<lib-filter-table-selector
|
|
42
|
+
[config]="selectorConfig"
|
|
43
|
+
[labels]="labels"
|
|
44
|
+
[preSelectedRows]="alreadySelectedItems"
|
|
45
|
+
(onSubmit)="handleSelection($event)"
|
|
46
|
+
(onCancel)="closeModal()"
|
|
47
|
+
>
|
|
48
|
+
</lib-filter-table-selector>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Component
|
|
52
|
+
```typescript
|
|
53
|
+
import { FilterTableSelectorConfig } from "@campus-cloud/shared-ui";
|
|
54
|
+
|
|
55
|
+
export class MyComponent {
|
|
56
|
+
labels = {
|
|
57
|
+
'MY_MODULE.TITLE': 'Select Participants',
|
|
58
|
+
'MY_MODULE.APPLY': 'Apply Filters',
|
|
59
|
+
'MY_MODULE.COLUMN.NAME': 'Full Name',
|
|
60
|
+
// ...
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
selectorConfig: FilterTableSelectorConfig = {
|
|
64
|
+
title: 'MY_MODULE.TITLE',
|
|
65
|
+
filterConfig: {
|
|
66
|
+
smartFormConfig: { /* SmartForm JSON Schema */ },
|
|
67
|
+
filterParamMapping: [
|
|
68
|
+
{ formFieldName: 'gender', apiParamKey: 'genderCode' }
|
|
69
|
+
],
|
|
70
|
+
applyFilterLabel: 'MY_MODULE.APPLY'
|
|
71
|
+
},
|
|
72
|
+
tableConfig: {
|
|
73
|
+
apiUrl: 'gateway/my-service/api/v1/items',
|
|
74
|
+
columns: [
|
|
75
|
+
{ key: 'fullName', label: 'MY_MODULE.COLUMN.NAME', type: 'text' }
|
|
76
|
+
],
|
|
77
|
+
pagination: { enabled: true }
|
|
78
|
+
},
|
|
79
|
+
selectionConfig: {
|
|
80
|
+
multiSelect: true,
|
|
81
|
+
selectionCountLabel: 'SELECTED: {selected} of {total}',
|
|
82
|
+
submitButtonLabel: 'Add Selected',
|
|
83
|
+
cancelButtonLabel: 'Cancel'
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
handleSelection(selectedRows: any[]) {
|
|
88
|
+
console.log('Selected items:', selectedRows);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Configuration Reference
|
|
94
|
+
|
|
95
|
+
### FilterTableSelectorConfig
|
|
96
|
+
|
|
97
|
+
| Property | Type | Description |
|
|
98
|
+
| :--- | :--- | :--- |
|
|
99
|
+
| `title` | `string` | i18n key for the component header. |
|
|
100
|
+
| `filterConfig` | `FilterPanelConfig` | Configuration for the left-hand filter panel. |
|
|
101
|
+
| `tableConfig` | `FilterTableConfig` | Configuration for the right-hand table. |
|
|
102
|
+
| `selectionConfig` | `SelectionConfig` | Labels and behavior for selection and buttons. |
|
|
103
|
+
|
|
104
|
+
### FilterPanelConfig
|
|
105
|
+
|
|
106
|
+
| Property | Type | Description |
|
|
107
|
+
| :--- | :--- | :--- |
|
|
108
|
+
| `smartFormConfig` | `FormSchema` | Full `SmartForm` JSON schema. |
|
|
109
|
+
| `filterParamMapping` | `FilterParamMap[]` | Maps form field names to API query parameters. |
|
|
110
|
+
| `defaultValues` | `Record<string, any>` | (Optional) Values pre-filled in the form and applied to the initial table load. |
|
|
111
|
+
| `disabledFields` | `string[]` | (Optional) Fields to render as read-only. Their values are preserved on Clear Filter. |
|
|
112
|
+
| `applyFilterLabel` | `string` | i18n key for the "Apply" button. |
|
|
113
|
+
| `clearFilterLabel` | `string` | i18n key for the "Clear" button. |
|
|
114
|
+
|
|
115
|
+
### FilterParamMap
|
|
116
|
+
|
|
117
|
+
| Property | Type | Description |
|
|
118
|
+
| :--- | :--- | :--- |
|
|
119
|
+
| `formFieldName` | `string` | Field name in the SmartForm schema. |
|
|
120
|
+
| `apiParamKey` | `string` | Query parameter key to append to the Table API URL. |
|
|
121
|
+
|
|
122
|
+
### SelectionConfig
|
|
123
|
+
|
|
124
|
+
| Property | Type | Description |
|
|
125
|
+
| :--- | :--- | :--- |
|
|
126
|
+
| `multiSelect` | `boolean` | Enable checkbox (true) or radio (false) selection. |
|
|
127
|
+
| `selectionCountLabel`| `string` | i18n key for the counter text. Supports `{selected}` and `{total}` placeholders. |
|
|
128
|
+
| `submitButtonLabel` | `string` | i18n key for the primary action button. |
|
|
129
|
+
| `cancelButtonLabel` | `string` | i18n key for the secondary action button. |
|
|
130
|
+
|
|
131
|
+
## Inputs & Outputs
|
|
132
|
+
|
|
133
|
+
### Inputs
|
|
134
|
+
|
|
135
|
+
| Input | Type | Description |
|
|
136
|
+
| :--- | :--- | : :--- |
|
|
137
|
+
| `[config]` | `FilterTableSelectorConfig` | (Required) The main configuration object. |
|
|
138
|
+
| `[labels]` | `Record<string, string>` | (Required) Translation map for all i18n keys used in the config. |
|
|
139
|
+
| `[preSelectedRows]`| `any[]` | (Optional) Array of row objects to be pre-checked on load. |
|
|
140
|
+
|
|
141
|
+
### Outputs
|
|
142
|
+
|
|
143
|
+
| Output | Description | Payload |
|
|
144
|
+
| :--- | :--- | :--- |
|
|
145
|
+
| `(onSubmit)` | Emitted when the primary button is clicked. | `any[]` (Array of selected row objects) |
|
|
146
|
+
| `(onCancel)` | Emitted when the secondary button is clicked. | `void` |
|
|
147
|
+
|
|
148
|
+
## Filtering Logic
|
|
149
|
+
|
|
150
|
+
1. When the component initializes, it builds query parameters from `filterConfig.defaultValues`.
|
|
151
|
+
2. The Table API URL is updated: `baseUrl?param1=val1¶m2=val2...`.
|
|
152
|
+
3. When the user clicks "Apply Filter", the component reads the current `SmartForm` values and maps them using `filterParamMapping`.
|
|
153
|
+
4. If a field contains an array (e.g., from a multi-select dropdown), it is automatically converted to a comma-separated string for the API.
|
|
154
|
+
5. The table is reloaded with the new URL.
|
|
155
|
+
|
|
156
|
+
## Examples
|
|
157
|
+
|
|
158
|
+
### 1. Invite Participants Selector
|
|
159
|
+
|
|
160
|
+
This example demonstrates a typical setup for a selection modal with geographic filters.
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
this.config = {
|
|
164
|
+
title: 'EVENT.ADD_CANDIDATES',
|
|
165
|
+
filterConfig: {
|
|
166
|
+
smartFormConfig: {
|
|
167
|
+
entityType: 'FILTER',
|
|
168
|
+
sectionConfig: {
|
|
169
|
+
children: [
|
|
170
|
+
{
|
|
171
|
+
name: 'gender',
|
|
172
|
+
label: 'COMMON.GENDER',
|
|
173
|
+
type: 'DROPDOWN',
|
|
174
|
+
subType: 'MULTI',
|
|
175
|
+
optionConfig: {
|
|
176
|
+
apiUrl: 'gateway/mdm/genders',
|
|
177
|
+
labelPath: 'name',
|
|
178
|
+
valuePath: 'code',
|
|
179
|
+
dataPath: 'data'
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
filterParamMapping: [
|
|
186
|
+
{ formFieldName: 'gender', apiParamKey: 'genderCodes' }
|
|
187
|
+
],
|
|
188
|
+
applyFilterLabel: 'COMMON.APPLY',
|
|
189
|
+
clearFilterLabel: 'COMMON.CLEAR'
|
|
190
|
+
},
|
|
191
|
+
tableConfig: {
|
|
192
|
+
apiUrl: 'gateway/search/users',
|
|
193
|
+
columns: [
|
|
194
|
+
{ key: 'fullName', label: 'COMMON.NAME', type: 'text' },
|
|
195
|
+
{ key: 'email', label: 'COMMON.EMAIL', type: 'text' }
|
|
196
|
+
],
|
|
197
|
+
pagination: { enabled: true }
|
|
198
|
+
},
|
|
199
|
+
selectionConfig: {
|
|
200
|
+
multiSelect: true,
|
|
201
|
+
selectionCountLabel: 'COMMON.SELECTED_COUNT', // e.g. "{selected} selected"
|
|
202
|
+
submitButtonLabel: 'COMMON.ADD',
|
|
203
|
+
cancelButtonLabel: 'COMMON.CANCEL'
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Clear Filter Behavior
|
|
209
|
+
|
|
210
|
+
The "Clear Filter" button performs the following actions:
|
|
211
|
+
1. Resets all form fields to their values defined in `filterConfig.defaultValues`.
|
|
212
|
+
2. If a field is listed in `filterConfig.disabledFields`, its current value is preserved.
|
|
213
|
+
3. The `SmartForm` component is destroyed and re-initialized to ensure a clean state.
|
|
214
|
+
4. The table is automatically reloaded with the default parameters.
|
|
215
|
+
|
|
216
|
+
## Theming
|
|
217
|
+
|
|
218
|
+
The component uses standard CSS variables. It primarily inherits styles from the `SmartForm` and `SmartTable` components. You can customize the layout gaps and panel widths using the following variables in your `variables.scss`:
|
|
219
|
+
|
|
220
|
+
```scss
|
|
221
|
+
// Layout spacing
|
|
222
|
+
--fts-gap: 1.5rem;
|
|
223
|
+
--fts-filter-panel-width: 320px;
|
|
224
|
+
--fts-footer-padding: 1rem 1.5rem;
|
|
225
|
+
|
|
226
|
+
// Mobile specific
|
|
227
|
+
--fts-mobile-breakpoint: 768px;
|
|
228
|
+
```
|