commons-shared-web-ui 0.0.62 → 0.0.64
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/fesm2022/commons-shared-web-ui.mjs +16368 -0
- package/fesm2022/commons-shared-web-ui.mjs.map +1 -0
- package/index.d.ts +5077 -0
- package/package.json +34 -53
- package/.claude/settings.local.json +0 -10
- package/documentation/alert.md +0 -123
- package/documentation/button-dropdown.md +0 -126
- package/documentation/button.md +0 -184
- package/documentation/cards-usage-guidelines.md +0 -131
- package/documentation/configurable-form.md +0 -605
- package/documentation/confirmation-modal.md +0 -250
- package/documentation/filter-sidebar.md +0 -178
- package/documentation/filter-table-selector.md +0 -228
- package/documentation/form-builder.md +0 -599
- package/documentation/form-components.md +0 -384
- package/documentation/form-field-configuration.md +0 -250
- package/documentation/nav.md +0 -427
- package/documentation/pagination.md +0 -181
- package/documentation/side-nav-documentation.md +0 -169
- package/documentation/smart-form.md +0 -2819
- package/documentation/smart-table.md +0 -1297
- package/documentation/snackbar.md +0 -118
- package/documentation/style-externalization.md +0 -88
- package/documentation/summary-card.md +0 -279
- package/documentation/table-column-configuration.md +0 -221
- package/documentation/time-picker.md +0 -274
- package/ng-package.json +0 -30
- package/src/lib/modules/alert/alert.models.ts +0 -6
- package/src/lib/modules/alert/alert.module.ts +0 -16
- package/src/lib/modules/alert/components/alert/alert.component.html +0 -27
- package/src/lib/modules/alert/components/alert/alert.component.scss +0 -92
- package/src/lib/modules/alert/components/alert/alert.component.ts +0 -81
- package/src/lib/modules/button/button.models.ts +0 -13
- package/src/lib/modules/button/button.module.ts +0 -16
- package/src/lib/modules/button/components/button/button.component.html +0 -22
- package/src/lib/modules/button/components/button/button.component.scss +0 -92
- package/src/lib/modules/button/components/button/button.component.ts +0 -67
- package/src/lib/modules/button-dropdown/button-dropdown.models.ts +0 -26
- package/src/lib/modules/button-dropdown/button-dropdown.module.ts +0 -22
- package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.html +0 -41
- package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.scss +0 -135
- package/src/lib/modules/button-dropdown/components/button-dropdown/button-dropdown.component.ts +0 -160
- package/src/lib/modules/configurable-form/component/configurable-form.component.html +0 -294
- package/src/lib/modules/configurable-form/component/configurable-form.component.scss +0 -503
- package/src/lib/modules/configurable-form/component/configurable-form.component.ts +0 -628
- package/src/lib/modules/configurable-form/configurable-form.examples.ts +0 -154
- package/src/lib/modules/configurable-form/configurable-form.model.ts +0 -131
- package/src/lib/modules/configurable-form/configurable-form.module.ts +0 -19
- package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.html +0 -77
- package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.scss +0 -395
- package/src/lib/modules/confirmation-modal/components/confirmation-modal/confirmation-modal.component.ts +0 -266
- package/src/lib/modules/confirmation-modal/confirmation-modal.models.ts +0 -71
- package/src/lib/modules/confirmation-modal/confirmation-modal.module.ts +0 -20
- package/src/lib/modules/filter/components/filter/filter.component.html +0 -131
- package/src/lib/modules/filter/components/filter/filter.component.scss +0 -245
- package/src/lib/modules/filter/components/filter/filter.component.ts +0 -216
- package/src/lib/modules/filter/filter.models.ts +0 -88
- package/src/lib/modules/filter/filter.module.ts +0 -24
- package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.html +0 -112
- package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.scss +0 -186
- package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.ts +0 -163
- package/src/lib/modules/filter-sidebar/filter-sidebar.models.ts +0 -95
- package/src/lib/modules/filter-sidebar/filter-sidebar.module.ts +0 -24
- package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.html +0 -73
- package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.scss +0 -321
- package/src/lib/modules/filter-table-selector/components/filter-table-selector/filter-table-selector.component.ts +0 -361
- package/src/lib/modules/filter-table-selector/filter-table-selector.models.ts +0 -91
- package/src/lib/modules/filter-table-selector/filter-table-selector.module.ts +0 -22
- package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.html +0 -63
- package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.scss +0 -496
- package/src/lib/modules/form-builder/components/field-configurator/configurator-config-panel/configurator-config-panel.component.ts +0 -445
- package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.html +0 -75
- package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.scss +0 -210
- package/src/lib/modules/form-builder/components/field-configurator/configurator-tree/configurator-tree.component.ts +0 -55
- package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.html +0 -25
- package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.scss +0 -82
- package/src/lib/modules/form-builder/components/field-configurator/field-configurator.component.ts +0 -95
- package/src/lib/modules/form-builder/components/field-selection/field-selection.component.html +0 -20
- package/src/lib/modules/form-builder/components/field-selection/field-selection.component.scss +0 -37
- package/src/lib/modules/form-builder/components/field-selection/field-selection.component.ts +0 -94
- package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.html +0 -46
- package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.scss +0 -102
- package/src/lib/modules/form-builder/components/field-selection/group-node/group-node.component.ts +0 -50
- package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.html +0 -35
- package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.scss +0 -67
- package/src/lib/modules/form-builder/components/field-selection/selection-field-node/selection-field-node.component.ts +0 -34
- package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.html +0 -68
- package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.scss +0 -113
- package/src/lib/modules/form-builder/components/field-selection/selection-section-node/selection-section-node.component.ts +0 -74
- package/src/lib/modules/form-builder/configs/field-type-schema.map.ts +0 -533
- package/src/lib/modules/form-builder/form-builder.module.ts +0 -36
- package/src/lib/modules/form-builder/index.ts +0 -9
- package/src/lib/modules/form-builder/models/builder.models.ts +0 -7
- package/src/lib/modules/form-builder/models/field-configurator.models.ts +0 -38
- package/src/lib/modules/form-builder/models/field-selection.models.ts +0 -51
- package/src/lib/modules/form-builder/services/field-configurator.service.ts +0 -258
- package/src/lib/modules/form-builder/services/field-selection.service.ts +0 -299
- package/src/lib/modules/form-builder/services/form-schema-tree.service.ts +0 -670
- package/src/lib/modules/form-builder/tokens/builder.tokens.ts +0 -10
- package/src/lib/modules/form-builder/utils/constants.ts +0 -43
- package/src/lib/modules/form-components/components/checkbox/checkbox.component.html +0 -29
- package/src/lib/modules/form-components/components/checkbox/checkbox.component.scss +0 -111
- package/src/lib/modules/form-components/components/checkbox/checkbox.component.ts +0 -207
- package/src/lib/modules/form-components/components/checkbox/checkbox.models.ts +0 -35
- package/src/lib/modules/form-components/components/datepicker/datepicker.component.html +0 -42
- package/src/lib/modules/form-components/components/datepicker/datepicker.component.scss +0 -115
- package/src/lib/modules/form-components/components/datepicker/datepicker.component.ts +0 -267
- package/src/lib/modules/form-components/components/datepicker/datepicker.models.ts +0 -45
- package/src/lib/modules/form-components/components/dropdown/dropdown.component.html +0 -74
- package/src/lib/modules/form-components/components/dropdown/dropdown.component.scss +0 -252
- package/src/lib/modules/form-components/components/dropdown/dropdown.component.ts +0 -377
- package/src/lib/modules/form-components/components/dropdown/dropdown.models.ts +0 -53
- package/src/lib/modules/form-components/components/input/input.component.html +0 -51
- package/src/lib/modules/form-components/components/input/input.component.scss +0 -128
- package/src/lib/modules/form-components/components/input/input.component.ts +0 -250
- package/src/lib/modules/form-components/components/input/input.models.ts +0 -55
- package/src/lib/modules/form-components/components/radio/radio.component.html +0 -22
- package/src/lib/modules/form-components/components/radio/radio.component.scss +0 -107
- package/src/lib/modules/form-components/components/radio/radio.component.ts +0 -181
- package/src/lib/modules/form-components/components/radio/radio.models.ts +0 -39
- package/src/lib/modules/form-components/components/search/search.component.html +0 -15
- package/src/lib/modules/form-components/components/search/search.component.scss +0 -87
- package/src/lib/modules/form-components/components/search/search.component.ts +0 -213
- package/src/lib/modules/form-components/components/search/search.models.ts +0 -40
- package/src/lib/modules/form-components/components/toggle/toggle.component.html +0 -15
- package/src/lib/modules/form-components/components/toggle/toggle.component.scss +0 -81
- package/src/lib/modules/form-components/components/toggle/toggle.component.ts +0 -166
- package/src/lib/modules/form-components/components/toggle/toggle.models.ts +0 -27
- package/src/lib/modules/form-components/directives/click-outside.directive.ts +0 -22
- package/src/lib/modules/form-components/form-components.module.ts +0 -42
- package/src/lib/modules/form-field-configuration/components/_ffc-controls.scss +0 -89
- package/src/lib/modules/form-field-configuration/components/config-field-node/config-field-node.component.html +0 -68
- package/src/lib/modules/form-field-configuration/components/config-field-node/config-field-node.component.scss +0 -73
- package/src/lib/modules/form-field-configuration/components/config-field-node/config-field-node.component.ts +0 -34
- package/src/lib/modules/form-field-configuration/components/config-section-node/config-section-node.component.html +0 -78
- package/src/lib/modules/form-field-configuration/components/config-section-node/config-section-node.component.scss +0 -83
- package/src/lib/modules/form-field-configuration/components/config-section-node/config-section-node.component.ts +0 -94
- package/src/lib/modules/form-field-configuration/components/form-field-configuration/form-field-configuration.component.html +0 -38
- package/src/lib/modules/form-field-configuration/components/form-field-configuration/form-field-configuration.component.scss +0 -42
- package/src/lib/modules/form-field-configuration/components/form-field-configuration/form-field-configuration.component.ts +0 -92
- package/src/lib/modules/form-field-configuration/form-field-configuration.module.ts +0 -23
- package/src/lib/modules/form-field-configuration/index.ts +0 -7
- package/src/lib/modules/form-field-configuration/models/field-configuration.models.ts +0 -62
- package/src/lib/modules/form-field-configuration/services/config-schema-tree.service.ts +0 -159
- package/src/lib/modules/form-field-configuration/services/field-configuration.service.ts +0 -228
- package/src/lib/modules/material/material.module.ts +0 -94
- package/src/lib/modules/nav/components/nav/nav.component.html +0 -34
- package/src/lib/modules/nav/components/nav/nav.component.scss +0 -171
- package/src/lib/modules/nav/components/nav/nav.component.ts +0 -82
- package/src/lib/modules/nav/nav.models.ts +0 -31
- package/src/lib/modules/nav/nav.module.ts +0 -17
- package/src/lib/modules/pagination/components/pagination/pagination.component.html +0 -52
- package/src/lib/modules/pagination/components/pagination/pagination.component.scss +0 -155
- package/src/lib/modules/pagination/components/pagination/pagination.component.ts +0 -109
- package/src/lib/modules/pagination/pagination.module.ts +0 -17
- package/src/lib/modules/side-nav/components/side-nav/side-nav.component.html +0 -56
- package/src/lib/modules/side-nav/components/side-nav/side-nav.component.scss +0 -342
- package/src/lib/modules/side-nav/components/side-nav/side-nav.component.ts +0 -135
- package/src/lib/modules/side-nav/side-nav.models.ts +0 -38
- package/src/lib/modules/side-nav/side-nav.module.ts +0 -16
- package/src/lib/modules/smart-form/components/form-field/form-field.component.html +0 -1379
- package/src/lib/modules/smart-form/components/form-field/form-field.component.scss +0 -2255
- package/src/lib/modules/smart-form/components/form-field/form-field.component.ts +0 -3174
- package/src/lib/modules/smart-form/components/form-section/form-section.component.html +0 -67
- package/src/lib/modules/smart-form/components/form-section/form-section.component.scss +0 -209
- package/src/lib/modules/smart-form/components/form-section/form-section.component.ts +0 -142
- package/src/lib/modules/smart-form/components/smart-form/smart-form.component.html +0 -253
- package/src/lib/modules/smart-form/components/smart-form/smart-form.component.scss +0 -689
- package/src/lib/modules/smart-form/components/smart-form/smart-form.component.ts +0 -1134
- package/src/lib/modules/smart-form/index.ts +0 -10
- package/src/lib/modules/smart-form/models/form-schema.model.ts +0 -803
- package/src/lib/modules/smart-form/models/hierarchy-config.model.ts +0 -22
- package/src/lib/modules/smart-form/services/expression.service.ts +0 -75
- package/src/lib/modules/smart-form/services/smart-form-controller.service.ts +0 -67
- package/src/lib/modules/smart-form/smart-form.examples.ts +0 -1324
- package/src/lib/modules/smart-form/smart-form.module.ts +0 -40
- package/src/lib/modules/smart-form/utils/translation.utils.ts +0 -82
- package/src/lib/modules/smart-form/utils/trusted-url.pipe.ts +0 -25
- package/src/lib/modules/smart-form/utils/validation.utils.ts +0 -98
- package/src/lib/modules/smart-table/components/smart-table/smart-table.component.html +0 -283
- package/src/lib/modules/smart-table/components/smart-table/smart-table.component.scss +0 -685
- package/src/lib/modules/smart-table/components/smart-table/smart-table.component.ts +0 -1219
- package/src/lib/modules/smart-table/models/table-config.model.ts +0 -247
- package/src/lib/modules/smart-table/smart-table.module.ts +0 -30
- package/src/lib/modules/smart-table/utils/safe-html.pipe.ts +0 -28
- package/src/lib/modules/smart-table/utils/smart-table.utils.ts +0 -18
- package/src/lib/modules/snackbar/components/snackbar.component.html +0 -41
- package/src/lib/modules/snackbar/components/snackbar.component.scss +0 -99
- package/src/lib/modules/snackbar/components/snackbar.component.ts +0 -18
- package/src/lib/modules/snackbar/models/snackbar.models.ts +0 -10
- package/src/lib/modules/snackbar/services/snackbar.service.ts +0 -40
- package/src/lib/modules/snackbar/snackbar.module.ts +0 -11
- package/src/lib/modules/summary-card/components/summary-card/summary-card.component.html +0 -47
- package/src/lib/modules/summary-card/components/summary-card/summary-card.component.scss +0 -199
- package/src/lib/modules/summary-card/components/summary-card/summary-card.component.ts +0 -126
- package/src/lib/modules/summary-card/summary-card.module.ts +0 -18
- package/src/lib/modules/table-column-configuration/components/_tcc-controls.scss +0 -53
- package/src/lib/modules/table-column-configuration/components/config-column-node/config-column-node.component.html +0 -47
- package/src/lib/modules/table-column-configuration/components/config-column-node/config-column-node.component.scss +0 -50
- package/src/lib/modules/table-column-configuration/components/config-column-node/config-column-node.component.ts +0 -33
- package/src/lib/modules/table-column-configuration/components/table-column-configuration/table-column-configuration.component.html +0 -30
- package/src/lib/modules/table-column-configuration/components/table-column-configuration/table-column-configuration.component.scss +0 -36
- package/src/lib/modules/table-column-configuration/components/table-column-configuration/table-column-configuration.component.ts +0 -78
- package/src/lib/modules/table-column-configuration/index.ts +0 -5
- package/src/lib/modules/table-column-configuration/models/table-column-configuration.models.ts +0 -20
- package/src/lib/modules/table-column-configuration/services/table-column-configuration.service.ts +0 -77
- package/src/lib/modules/table-column-configuration/table-column-configuration.module.ts +0 -21
- package/src/lib/modules/time-picker/components/time-picker/time-picker.component.html +0 -37
- package/src/lib/modules/time-picker/components/time-picker/time-picker.component.scss +0 -102
- package/src/lib/modules/time-picker/components/time-picker/time-picker.component.ts +0 -178
- package/src/lib/modules/time-picker/components/time-wheel-panel/time-wheel-panel.component.html +0 -78
- package/src/lib/modules/time-picker/components/time-wheel-panel/time-wheel-panel.component.scss +0 -226
- package/src/lib/modules/time-picker/components/time-wheel-panel/time-wheel-panel.component.ts +0 -595
- package/src/lib/modules/time-picker/models/time-picker.models.ts +0 -49
- package/src/lib/modules/time-picker/time-picker.module.ts +0 -23
- package/src/lib/shared-ui.module.ts +0 -55
- package/src/lib/utils/constants.ts +0 -11
- package/src/lib/utils/storage.utils.ts +0 -37
- package/src/lib/utils/string.utils.ts +0 -23
- package/src/lib/utils/translation.utils.ts +0 -87
- package/src/public-api.ts +0 -127
- package/tsconfig.lib.json +0 -15
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { InputConfig } from '../form-components/components/input/input.models';
|
|
2
|
-
import { DropdownConfig } from '../form-components/components/dropdown/dropdown.models';
|
|
3
|
-
import { CheckboxConfig } from '../form-components/components/checkbox/checkbox.models';
|
|
4
|
-
import { RadioConfig } from '../form-components/components/radio/radio.models';
|
|
5
|
-
import { ToggleConfig } from '../form-components/components/toggle/toggle.models';
|
|
6
|
-
import { DatePickerConfig } from '../form-components/components/datepicker/datepicker.models';
|
|
7
|
-
import { FilterSearchConfig } from '../form-components/components/search/search.models';
|
|
8
|
-
import { FilterItemType } from '../filter-sidebar/filter-sidebar.models';
|
|
9
|
-
|
|
10
|
-
// Reuse the same item structure as sidebar for consistency
|
|
11
|
-
export interface TableFilterItem {
|
|
12
|
-
key?: string;
|
|
13
|
-
type: FilterItemType;
|
|
14
|
-
label?: string;
|
|
15
|
-
visible?: boolean;
|
|
16
|
-
|
|
17
|
-
// Component Configs
|
|
18
|
-
inputConfig?: InputConfig;
|
|
19
|
-
dropdownConfig?: DropdownConfig;
|
|
20
|
-
checkboxConfig?: CheckboxConfig;
|
|
21
|
-
radioConfig?: RadioConfig;
|
|
22
|
-
toggleConfig?: ToggleConfig;
|
|
23
|
-
datepickerConfig?: DatePickerConfig;
|
|
24
|
-
searchConfig?: FilterSearchConfig;
|
|
25
|
-
|
|
26
|
-
// Layout / Grouping
|
|
27
|
-
children?: TableFilterItem[];
|
|
28
|
-
expanded?: boolean;
|
|
29
|
-
|
|
30
|
-
// Customization
|
|
31
|
-
styles?: { [key: string]: string };
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface TableFilterConfig {
|
|
35
|
-
items: TableFilterItem[];
|
|
36
|
-
|
|
37
|
-
// Global Filter Styling
|
|
38
|
-
styles?: {
|
|
39
|
-
width?: string;
|
|
40
|
-
padding?: string;
|
|
41
|
-
gap?: string;
|
|
42
|
-
backgroundColor?: string;
|
|
43
|
-
borderRadius?: string;
|
|
44
|
-
headerHeight?: string;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
columns?: TableFilterColumn[];
|
|
48
|
-
|
|
49
|
-
settings?: {
|
|
50
|
-
persistent?: boolean;
|
|
51
|
-
collapsible?: boolean;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
// Actions visibility
|
|
55
|
-
actions?: {
|
|
56
|
-
clear?: { visible?: boolean; label?: string; };
|
|
57
|
-
apply?: { visible?: boolean; label?: string; };
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export interface TableFilterColumn {
|
|
62
|
-
id: string;
|
|
63
|
-
label: string;
|
|
64
|
-
visible: boolean;
|
|
65
|
-
filterable?: boolean;
|
|
66
|
-
filterOptions?: any[]; // Legacy or simple options
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface TableFilterLabels {
|
|
70
|
-
filterBtn: string;
|
|
71
|
-
clear: string;
|
|
72
|
-
apply: string;
|
|
73
|
-
search: string;
|
|
74
|
-
columns: string; // Tab label
|
|
75
|
-
showAll: string;
|
|
76
|
-
hideAll: string;
|
|
77
|
-
items?: string;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export interface TableFilterOutput {
|
|
81
|
-
[key: string]: any;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export interface TableFilterChangeEvent {
|
|
85
|
-
key: string;
|
|
86
|
-
value: any;
|
|
87
|
-
allFilters: TableFilterOutput;
|
|
88
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
-
|
|
5
|
-
import { ButtonModule } from '../button/button.module';
|
|
6
|
-
import { FormComponentsModule } from '../form-components/form-components.module';
|
|
7
|
-
import { FilterComponent } from './components/filter/filter.component';
|
|
8
|
-
|
|
9
|
-
@NgModule({
|
|
10
|
-
declarations: [
|
|
11
|
-
FilterComponent
|
|
12
|
-
],
|
|
13
|
-
imports: [
|
|
14
|
-
CommonModule,
|
|
15
|
-
FormsModule,
|
|
16
|
-
ReactiveFormsModule,
|
|
17
|
-
ButtonModule,
|
|
18
|
-
FormComponentsModule
|
|
19
|
-
],
|
|
20
|
-
exports: [
|
|
21
|
-
FilterComponent
|
|
22
|
-
]
|
|
23
|
-
})
|
|
24
|
-
export class FilterModule { }
|
package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.html
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
<div class="cc-filter-sidebar" [ngStyle]="sidebarStyles" [class.collapsed]="isCollapsed">
|
|
2
|
-
|
|
3
|
-
<!-- Header -->
|
|
4
|
-
<div class="cc-filter-header" *ngIf="config.header?.visible !== false">
|
|
5
|
-
<div class="cc-header-content">
|
|
6
|
-
<span class="cc-header-title" *ngIf="config.header?.title">
|
|
7
|
-
<span *ngIf="config.header?.icon" [class]="config.header?.icon" class="cc-header-icon material-icons">
|
|
8
|
-
<!-- {{config.header?.icon }} -->
|
|
9
|
-
</span>
|
|
10
|
-
{{ config.header?.title }}
|
|
11
|
-
</span>
|
|
12
|
-
<ng-content select="[header-actions]"></ng-content>
|
|
13
|
-
</div>
|
|
14
|
-
<button type="button" *ngIf="config.settings?.collapsible" (click)="toggleCollapse()" class="cc-icon-btn"
|
|
15
|
-
[attr.aria-label]="isCollapsed ? config.labels?.expandAriaLabel : config.labels?.collapseAriaLabel">
|
|
16
|
-
<span class="material-icons">{{ isCollapsed ? 'menu_open' : 'menu' }}</span>
|
|
17
|
-
</button>
|
|
18
|
-
<button type="button" *ngIf="config.header?.showClose && !isCollapsed" (click)="onClose()"
|
|
19
|
-
class="cc-icon-btn cc-close-btn" [attr.aria-label]="config.labels?.closeAriaLabel">
|
|
20
|
-
<span class="material-icons">close</span>
|
|
21
|
-
</button>
|
|
22
|
-
<!-- Code snippet debug (optional) -->
|
|
23
|
-
<button type="button" *ngIf="config.settings?.showCodeSnippet" (click)="onShowCodeSnippet()" class="cc-icon-btn"
|
|
24
|
-
[attr.aria-label]="config.labels?.codeSnippetAriaLabel">
|
|
25
|
-
<span class="material-icons">code</span>
|
|
26
|
-
</button>
|
|
27
|
-
</div>
|
|
28
|
-
|
|
29
|
-
<!-- Content (Scrollable) -->
|
|
30
|
-
<div class="cc-filter-content" [class.hidden]="isCollapsed">
|
|
31
|
-
<ng-container *ngFor="let item of config.items; trackBy: trackByFn">
|
|
32
|
-
<ng-container *ngTemplateOutlet="itemTemplate; context: { item: item }"></ng-container>
|
|
33
|
-
</ng-container>
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
<!-- Footer -->
|
|
37
|
-
<div class="cc-filter-footer" *ngIf="config.footer?.visible !== false && !isCollapsed">
|
|
38
|
-
<lib-button variant="outline" color="warn" class="cc-btn-clear"
|
|
39
|
-
*ngIf="config.footer?.clearButton?.visible !== false" (click)="clearFilters()">
|
|
40
|
-
{{ config.footer?.clearButton?.label }}
|
|
41
|
-
</lib-button>
|
|
42
|
-
<lib-button variant="primary" color="warn" class="cc-btn-apply"
|
|
43
|
-
*ngIf="config.footer?.applyButton?.visible !== false" [disabled]="config.footer?.applyButton?.disabled ?? false"
|
|
44
|
-
(click)="applyFilters()">
|
|
45
|
-
{{ config.footer?.applyButton?.label }}
|
|
46
|
-
</lib-button>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
|
|
50
|
-
<!-- Recursive Template for Items -->
|
|
51
|
-
<ng-template #itemTemplate let-item="item">
|
|
52
|
-
<div class="cc-filter-item" [ngClass]="['type-' + item.type]"
|
|
53
|
-
[style.display]="item.visible === false ? 'none' : 'block'" [ngStyle]="item.styles">
|
|
54
|
-
|
|
55
|
-
<ng-container [ngSwitch]="item.type">
|
|
56
|
-
|
|
57
|
-
<!-- Input -->
|
|
58
|
-
<lib-input *ngSwitchCase="'input'" [config]="item.inputConfig" [label]="item.label"
|
|
59
|
-
[ngModel]="filters[item.key]" (valueChange)="onValueChange(item.key, $event)">
|
|
60
|
-
</lib-input>
|
|
61
|
-
|
|
62
|
-
<!-- Dropdown -->
|
|
63
|
-
<lib-dropdown *ngSwitchCase="'dropdown'" [config]="item.dropdownConfig" [label]="item.label"
|
|
64
|
-
[ngModel]="filters[item.key]" (selectionChange)="onValueChange(item.key, $event)">
|
|
65
|
-
</lib-dropdown>
|
|
66
|
-
|
|
67
|
-
<!-- Checkbox -->
|
|
68
|
-
<lib-checkbox *ngSwitchCase="'checkbox'" [config]="item.checkboxConfig" [label]="item.label"
|
|
69
|
-
[checked]="!!filters[item.key]" (checkedChange)="onValueChange(item.key, $event)">
|
|
70
|
-
</lib-checkbox>
|
|
71
|
-
|
|
72
|
-
<!-- Radio -->
|
|
73
|
-
<lib-radio *ngSwitchCase="'radio'" [config]="item.radioConfig" [label]="item.label"
|
|
74
|
-
[ngModel]="filters[item.key]" (selectionChange)="onValueChange(item.key, $event)">
|
|
75
|
-
</lib-radio>
|
|
76
|
-
|
|
77
|
-
<!-- Toggle -->
|
|
78
|
-
<lib-toggle *ngSwitchCase="'toggle'" [config]="item.toggleConfig" [label]="item.label"
|
|
79
|
-
[checked]="filters[item.key]" (toggleChange)="onValueChange(item.key, $event)">
|
|
80
|
-
</lib-toggle>
|
|
81
|
-
|
|
82
|
-
<!-- Datepicker -->
|
|
83
|
-
<lib-datepicker *ngSwitchCase="'datepicker'" [config]="item.datepickerConfig" [label]="item.label"
|
|
84
|
-
[ngModel]="filters[item.key]" (dateChange)="onValueChange(item.key, $event)">
|
|
85
|
-
</lib-datepicker>
|
|
86
|
-
|
|
87
|
-
<!-- Search -->
|
|
88
|
-
<lib-search *ngSwitchCase="'active-search'" [config]="item.searchConfig" [label]="item.label"
|
|
89
|
-
[ngModel]="filters[item.key]" (search)="onValueChange(item.key, $event)">
|
|
90
|
-
</lib-search>
|
|
91
|
-
|
|
92
|
-
<!-- Group / Accordion -->
|
|
93
|
-
<div *ngSwitchCase="'group'" class="cc-accordion-item" [class.expanded]="item.expanded">
|
|
94
|
-
<button type="button" class="cc-accordion-header" (click)="item.expanded = !item.expanded">
|
|
95
|
-
<span class="cc-accordion-title">{{ item.label }}</span>
|
|
96
|
-
<span class="material-icons cc-accordion-icon">{{ item.expanded ? 'expand_less' : 'expand_more'
|
|
97
|
-
}}</span>
|
|
98
|
-
</button>
|
|
99
|
-
|
|
100
|
-
<div class="cc-accordion-body" *ngIf="item.expanded">
|
|
101
|
-
<ng-container *ngFor="let child of item.children; trackBy: trackByFn">
|
|
102
|
-
<ng-container *ngTemplateOutlet="itemTemplate; context: { item: child }"></ng-container>
|
|
103
|
-
</ng-container>
|
|
104
|
-
</div>
|
|
105
|
-
</div>
|
|
106
|
-
|
|
107
|
-
<!-- Custom Divider -->
|
|
108
|
-
<div *ngSwitchCase="'divider'" class="cc-filter-divider"></div>
|
|
109
|
-
|
|
110
|
-
</ng-container>
|
|
111
|
-
</div>
|
|
112
|
-
</ng-template>
|
package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.scss
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
@use '../../filter-sidebar.theme' as theme;
|
|
2
|
-
|
|
3
|
-
:host {
|
|
4
|
-
display: block;
|
|
5
|
-
height: 100%;
|
|
6
|
-
|
|
7
|
-
@include theme.filter-sidebar-theme();
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.cc-filter-sidebar {
|
|
11
|
-
display: flex;
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
height: 100%;
|
|
14
|
-
width: var(--cc-filter-sidebar-width, 280px);
|
|
15
|
-
background-color: var(--cc-filter-sidebar-bg, #FEFEFE);
|
|
16
|
-
padding: var(--cc-filter-sidebar-padding, 1.5rem);
|
|
17
|
-
box-sizing: border-box;
|
|
18
|
-
overflow: hidden;
|
|
19
|
-
border-radius: var(--cc-filter-sidebar-border-radius, 0);
|
|
20
|
-
transition: width 0.3s ease, padding 0.3s ease;
|
|
21
|
-
|
|
22
|
-
&.collapsed {
|
|
23
|
-
width: 60px !important;
|
|
24
|
-
padding: 1.5rem 0.5rem;
|
|
25
|
-
|
|
26
|
-
.cc-filter-header {
|
|
27
|
-
justify-content: center;
|
|
28
|
-
margin-bottom: 0;
|
|
29
|
-
|
|
30
|
-
.cc-header-content {
|
|
31
|
-
display: none;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.cc-close-btn {
|
|
35
|
-
display: none;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.cc-filter-content {
|
|
40
|
-
display: none;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.cc-filter-header {
|
|
46
|
-
display: flex;
|
|
47
|
-
align-items: center;
|
|
48
|
-
justify-content: space-between;
|
|
49
|
-
min-height: var(--cc-filter-header-height, 3rem);
|
|
50
|
-
margin-bottom: 1rem;
|
|
51
|
-
flex-shrink: 0;
|
|
52
|
-
|
|
53
|
-
.cc-header-content {
|
|
54
|
-
display: flex;
|
|
55
|
-
align-items: center;
|
|
56
|
-
gap: 0.5rem;
|
|
57
|
-
flex: 1;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.cc-header-title {
|
|
61
|
-
font-size: var(--cc-filter-header-title-size, 1.125rem);
|
|
62
|
-
font-weight: var(--cc-filter-header-title-weight, 500);
|
|
63
|
-
color: var(--cc-filter-header-title-color, #202124);
|
|
64
|
-
display: flex;
|
|
65
|
-
align-items: center;
|
|
66
|
-
gap: 0.5rem;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.cc-filter-content {
|
|
71
|
-
flex: 1;
|
|
72
|
-
overflow-y: auto;
|
|
73
|
-
display: flex;
|
|
74
|
-
flex-direction: column;
|
|
75
|
-
gap: var(--cc-filter-sidebar-gap, 1.5rem);
|
|
76
|
-
padding-right: 0.25rem; // Space for scrollbar
|
|
77
|
-
|
|
78
|
-
// Custom Scrollbar
|
|
79
|
-
&::-webkit-scrollbar {
|
|
80
|
-
width: 6px;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
&::-webkit-scrollbar-thumb {
|
|
84
|
-
background-color: #E0E0E0;
|
|
85
|
-
border-radius: 3px;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.cc-filter-item {}
|
|
90
|
-
|
|
91
|
-
// Accordion overrides
|
|
92
|
-
.cc-accordion-item {
|
|
93
|
-
border-bottom: 1px solid #E0E0E0;
|
|
94
|
-
|
|
95
|
-
&:last-child {
|
|
96
|
-
border-bottom: none;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.cc-accordion-header {
|
|
100
|
-
display: flex;
|
|
101
|
-
align-items: center;
|
|
102
|
-
justify-content: space-between;
|
|
103
|
-
width: 100%;
|
|
104
|
-
padding: 0.75rem 0;
|
|
105
|
-
background: none;
|
|
106
|
-
border: none;
|
|
107
|
-
cursor: pointer;
|
|
108
|
-
text-align: left;
|
|
109
|
-
outline: none;
|
|
110
|
-
|
|
111
|
-
.cc-accordion-title {
|
|
112
|
-
font-size: 0.875rem;
|
|
113
|
-
font-weight: 500;
|
|
114
|
-
color: #202124;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.cc-accordion-icon {
|
|
118
|
-
color: #5F6368;
|
|
119
|
-
transition: transform 0.2s;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.cc-accordion-body {
|
|
124
|
-
padding: 0 0 1rem 0;
|
|
125
|
-
display: flex;
|
|
126
|
-
flex-direction: column;
|
|
127
|
-
gap: 1rem;
|
|
128
|
-
animation: slideDown 0.2s ease-out;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
@keyframes slideDown {
|
|
133
|
-
from {
|
|
134
|
-
opacity: 0;
|
|
135
|
-
transform: translateY(-5px);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
to {
|
|
139
|
-
opacity: 1;
|
|
140
|
-
transform: translateY(0);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.cc-group-content {
|
|
145
|
-
display: flex;
|
|
146
|
-
flex-direction: column;
|
|
147
|
-
gap: 1rem;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.cc-filter-divider {
|
|
151
|
-
height: 1px;
|
|
152
|
-
background-color: #E0E0E0;
|
|
153
|
-
margin: 0.5rem 0;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.cc-filter-footer {
|
|
157
|
-
display: flex;
|
|
158
|
-
gap: var(--cc-filter-footer-gap, 1rem);
|
|
159
|
-
padding: var(--cc-filter-footer-padding, 1rem 0 0 0);
|
|
160
|
-
margin-top: auto;
|
|
161
|
-
flex-shrink: 0;
|
|
162
|
-
|
|
163
|
-
button {
|
|
164
|
-
flex: 1;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.cc-icon-btn {
|
|
169
|
-
background: none;
|
|
170
|
-
border: none;
|
|
171
|
-
cursor: pointer;
|
|
172
|
-
color: #5F6368;
|
|
173
|
-
padding: 0.5rem;
|
|
174
|
-
border-radius: 50%;
|
|
175
|
-
display: flex;
|
|
176
|
-
align-items: center;
|
|
177
|
-
justify-content: center;
|
|
178
|
-
|
|
179
|
-
&:hover {
|
|
180
|
-
background-color: rgba(0, 0, 0, 0.04);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.cc-close-btn {
|
|
185
|
-
margin-right: -0.5rem;
|
|
186
|
-
}
|
package/src/lib/modules/filter-sidebar/components/filter-sidebar/filter-sidebar.component.ts
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { Component, EventEmitter, Input, OnInit, Output, forwardRef } from '@angular/core';
|
|
2
|
-
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
3
|
-
import { Router, ActivatedRoute } from '@angular/router';
|
|
4
|
-
import { FilterSidebarChangeEvent, FilterSidebarConfig, FilterSidebarOutput, FilterItem } from '../../filter-sidebar.models';
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'lib-filter-sidebar',
|
|
8
|
-
templateUrl: './filter-sidebar.component.html',
|
|
9
|
-
styleUrls: ['./filter-sidebar.component.scss'],
|
|
10
|
-
standalone: false,
|
|
11
|
-
providers: [
|
|
12
|
-
{
|
|
13
|
-
provide: NG_VALUE_ACCESSOR,
|
|
14
|
-
useExisting: forwardRef(() => FilterSidebarComponent),
|
|
15
|
-
multi: true
|
|
16
|
-
}
|
|
17
|
-
]
|
|
18
|
-
})
|
|
19
|
-
export class FilterSidebarComponent implements OnInit, ControlValueAccessor {
|
|
20
|
-
@Input() config!: FilterSidebarConfig;
|
|
21
|
-
@Input() initialFilters: FilterSidebarOutput = {};
|
|
22
|
-
|
|
23
|
-
@Output() filterChange = new EventEmitter<FilterSidebarChangeEvent>();
|
|
24
|
-
@Output() filterApply = new EventEmitter<FilterSidebarOutput>();
|
|
25
|
-
@Output() filterClear = new EventEmitter<void>();
|
|
26
|
-
@Output() showCodeSnippet = new EventEmitter<void>();
|
|
27
|
-
@Output() close = new EventEmitter<void>();
|
|
28
|
-
|
|
29
|
-
filters: FilterSidebarOutput = {};
|
|
30
|
-
|
|
31
|
-
// ControlValueAccessor callbacks
|
|
32
|
-
onChange: any = () => { };
|
|
33
|
-
onTouched: any = () => { };
|
|
34
|
-
|
|
35
|
-
isCollapsed = false;
|
|
36
|
-
|
|
37
|
-
toggleCollapse(): void {
|
|
38
|
-
this.isCollapsed = !this.isCollapsed;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
constructor(
|
|
42
|
-
private router: Router,
|
|
43
|
-
private route: ActivatedRoute
|
|
44
|
-
) { }
|
|
45
|
-
|
|
46
|
-
ngOnInit(): void {
|
|
47
|
-
if (this.initialFilters) {
|
|
48
|
-
this.filters = { ...this.initialFilters };
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Initialize from URL query params if persistent
|
|
52
|
-
if (this.config.settings?.persistent !== false) {
|
|
53
|
-
this.route.queryParams.subscribe(params => {
|
|
54
|
-
if (Object.keys(params).length > 0) {
|
|
55
|
-
// Start with existing filters to preserve defaults not in URL
|
|
56
|
-
const newFilters = { ...this.filters };
|
|
57
|
-
|
|
58
|
-
Object.keys(params).forEach(key => {
|
|
59
|
-
// Try to parse arrays or numbers if possible, otherwise string
|
|
60
|
-
// This is a naive implementation, ideally config should dictate type
|
|
61
|
-
const val = params[key];
|
|
62
|
-
// If comma separated and looked like array? For now keep simple
|
|
63
|
-
newFilters[key] = val;
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
this.filters = newFilters;
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// ControlValueAccessor Implementation
|
|
73
|
-
writeValue(value: any): void {
|
|
74
|
-
if (value) {
|
|
75
|
-
this.filters = { ...value };
|
|
76
|
-
} else {
|
|
77
|
-
this.filters = {};
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
registerOnChange(fn: any): void {
|
|
82
|
-
this.onChange = fn;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
registerOnTouched(fn: any): void {
|
|
86
|
-
this.onTouched = fn;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// Component Logic
|
|
90
|
-
onValueChange(key: string | undefined, value: any): void {
|
|
91
|
-
if (!key) return;
|
|
92
|
-
|
|
93
|
-
this.filters[key] = value;
|
|
94
|
-
this.notifyChanges(key, value);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
private notifyChanges(key: string, value: any): void {
|
|
98
|
-
this.onChange(this.filters);
|
|
99
|
-
|
|
100
|
-
// Update URL if persistent
|
|
101
|
-
if (this.config.settings?.persistent !== false) {
|
|
102
|
-
this.updateUrl();
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
this.filterChange.emit({
|
|
106
|
-
key,
|
|
107
|
-
value,
|
|
108
|
-
allFilters: this.filters
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
private updateUrl(): void {
|
|
113
|
-
this.router.navigate([], {
|
|
114
|
-
relativeTo: this.route,
|
|
115
|
-
queryParams: this.filters,
|
|
116
|
-
queryParamsHandling: 'merge',
|
|
117
|
-
replaceUrl: true
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
applyFilters(): void {
|
|
122
|
-
this.filterApply.emit(this.filters);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
clearFilters(): void {
|
|
126
|
-
this.filters = {};
|
|
127
|
-
this.onChange(this.filters);
|
|
128
|
-
|
|
129
|
-
if (this.config.settings?.persistent !== false) {
|
|
130
|
-
this.router.navigate([], {
|
|
131
|
-
relativeTo: this.route,
|
|
132
|
-
queryParams: {},
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
this.filterClear.emit();
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
onClose(): void {
|
|
140
|
-
this.close.emit();
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
onShowCodeSnippet(): void {
|
|
144
|
-
this.showCodeSnippet.emit();
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
get sidebarStyles(): { [key: string]: string } {
|
|
148
|
-
const styles: { [key: string]: string } = {};
|
|
149
|
-
if (this.config?.styles) {
|
|
150
|
-
if (this.config.styles.width) styles['--cc-filter-sidebar-width'] = this.config.styles.width;
|
|
151
|
-
if (this.config.styles.padding) styles['--cc-filter-sidebar-padding'] = this.config.styles.padding;
|
|
152
|
-
if (this.config.styles.gap) styles['--cc-filter-sidebar-gap'] = this.config.styles.gap;
|
|
153
|
-
if (this.config.styles.backgroundColor) styles['--cc-filter-sidebar-bg'] = this.config.styles.backgroundColor;
|
|
154
|
-
if (this.config.styles.headerHeight) styles['--cc-filter-header-height'] = this.config.styles.headerHeight;
|
|
155
|
-
if (this.config.styles.borderRadius) styles['--cc-filter-sidebar-border-radius'] = this.config.styles.borderRadius;
|
|
156
|
-
}
|
|
157
|
-
return styles;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
trackByFn(index: number, item: FilterItem): any {
|
|
161
|
-
return item.key || index;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { InputConfig } from '../form-components/components/input/input.models';
|
|
2
|
-
import { DropdownConfig } from '../form-components/components/dropdown/dropdown.models';
|
|
3
|
-
import { CheckboxConfig } from '../form-components/components/checkbox/checkbox.models';
|
|
4
|
-
import { RadioConfig } from '../form-components/components/radio/radio.models';
|
|
5
|
-
import { ToggleConfig } from '../form-components/components/toggle/toggle.models';
|
|
6
|
-
import { DatePickerConfig } from '../form-components/components/datepicker/datepicker.models';
|
|
7
|
-
import { FilterSearchConfig } from '../form-components/components/search/search.models';
|
|
8
|
-
|
|
9
|
-
export type FilterItemType = 'input' | 'dropdown' | 'checkbox' | 'radio' | 'toggle' | 'datepicker' | 'active-search' | 'group' | 'custom' | 'divider';
|
|
10
|
-
|
|
11
|
-
export interface FilterItem {
|
|
12
|
-
key?: string; // Optional for dividers or purely layout groups
|
|
13
|
-
type: FilterItemType;
|
|
14
|
-
label?: string;
|
|
15
|
-
visible?: boolean;
|
|
16
|
-
|
|
17
|
-
// Component Configs
|
|
18
|
-
inputConfig?: InputConfig;
|
|
19
|
-
dropdownConfig?: DropdownConfig;
|
|
20
|
-
checkboxConfig?: CheckboxConfig;
|
|
21
|
-
radioConfig?: RadioConfig;
|
|
22
|
-
toggleConfig?: ToggleConfig;
|
|
23
|
-
datepickerConfig?: DatePickerConfig;
|
|
24
|
-
searchConfig?: FilterSearchConfig;
|
|
25
|
-
|
|
26
|
-
// Layout / Grouping
|
|
27
|
-
children?: FilterItem[]; // For groups/accordions
|
|
28
|
-
expanded?: boolean; // For accordions
|
|
29
|
-
|
|
30
|
-
// Customization
|
|
31
|
-
styles?: { [key: string]: string }; // Container styles override
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface FilterSidebarConfig {
|
|
35
|
-
items: FilterItem[];
|
|
36
|
-
|
|
37
|
-
// Global Sidebar Styling
|
|
38
|
-
styles?: {
|
|
39
|
-
width?: string;
|
|
40
|
-
padding?: string;
|
|
41
|
-
gap?: string;
|
|
42
|
-
backgroundColor?: string;
|
|
43
|
-
headerHeight?: string;
|
|
44
|
-
borderRadius?: string;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
header?: {
|
|
48
|
-
title?: string;
|
|
49
|
-
icon?: string;
|
|
50
|
-
visible?: boolean;
|
|
51
|
-
showClose?: boolean;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
footer?: {
|
|
55
|
-
visible?: boolean;
|
|
56
|
-
applyButton?: {
|
|
57
|
-
label?: string;
|
|
58
|
-
visible?: boolean;
|
|
59
|
-
disabled?: boolean;
|
|
60
|
-
};
|
|
61
|
-
clearButton?: {
|
|
62
|
-
label?: string;
|
|
63
|
-
visible?: boolean;
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
settings?: {
|
|
68
|
-
collapsible?: boolean; // If the whole sidebar is collapsible
|
|
69
|
-
persistent?: boolean; // URL sync
|
|
70
|
-
showCodeSnippet?: boolean;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
// i18n Labels
|
|
74
|
-
labels?: {
|
|
75
|
-
collapseAriaLabel?: string;
|
|
76
|
-
expandAriaLabel?: string;
|
|
77
|
-
closeAriaLabel?: string;
|
|
78
|
-
codeSnippetAriaLabel?: string;
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export interface FilterSidebarOutput {
|
|
83
|
-
[key: string]: any;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export interface FilterSidebarChangeEvent {
|
|
87
|
-
key: string;
|
|
88
|
-
value: any;
|
|
89
|
-
allFilters: FilterSidebarOutput;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// Backward compatibility aliases
|
|
93
|
-
export type FilterConfig = FilterSidebarConfig;
|
|
94
|
-
export type FilterChangeEvent = FilterSidebarChangeEvent;
|
|
95
|
-
export type FilterOutput = FilterSidebarOutput;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
-
|
|
5
|
-
import { FilterSidebarComponent } from './components/filter-sidebar/filter-sidebar.component';
|
|
6
|
-
import { FormComponentsModule } from '../form-components/form-components.module';
|
|
7
|
-
import { ButtonModule } from '../button/button.module';
|
|
8
|
-
|
|
9
|
-
@NgModule({
|
|
10
|
-
declarations: [
|
|
11
|
-
FilterSidebarComponent
|
|
12
|
-
],
|
|
13
|
-
imports: [
|
|
14
|
-
CommonModule,
|
|
15
|
-
FormsModule,
|
|
16
|
-
ReactiveFormsModule,
|
|
17
|
-
FormComponentsModule,
|
|
18
|
-
ButtonModule
|
|
19
|
-
],
|
|
20
|
-
exports: [
|
|
21
|
-
FilterSidebarComponent
|
|
22
|
-
]
|
|
23
|
-
})
|
|
24
|
-
export class FilterSidebarModule { }
|