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,202 @@
|
|
|
1
|
+
export interface TableOption {
|
|
2
|
+
label: string;
|
|
3
|
+
value: any;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface TableColumnSubField {
|
|
7
|
+
key: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
dataType: 'text' | 'number' | 'email' | 'select' | 'date';
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
editable?: boolean;
|
|
12
|
+
options?: TableOption[];
|
|
13
|
+
editConfig?: {
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
defaultValue?: any;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface TableColumn {
|
|
20
|
+
key: string;
|
|
21
|
+
label: string;
|
|
22
|
+
type: 'text' | 'number' | 'date' | 'custom' | 'html' | 'badge';
|
|
23
|
+
sortable?: boolean;
|
|
24
|
+
editable?: boolean;
|
|
25
|
+
dataType?: 'text' | 'number' | 'date' | 'email' | 'select';
|
|
26
|
+
options?: TableOption[]; // For select dataType
|
|
27
|
+
badgeConfig?: { [key: string]: 'success' | 'warning' | 'danger' | 'info' | 'neutral' }; // Map values to badge variants
|
|
28
|
+
width?: string;
|
|
29
|
+
cellClass?: string;
|
|
30
|
+
headerClass?: string;
|
|
31
|
+
sticky?: boolean;
|
|
32
|
+
labelPath?: string; // Path to fetch nested value (e.g. 'user.address.city')
|
|
33
|
+
emptyValue?: string; // Shown when the cell value is null, undefined, or empty string
|
|
34
|
+
dateFormat?: string; // Date format (e.g. 'short', 'medium', 'dd/MM/yyyy')
|
|
35
|
+
clickAction?: 'route' | 'callback';
|
|
36
|
+
clickRoute?: string; // Route pattern for redirection (e.g. '/users/:id')
|
|
37
|
+
subFields?: TableColumnSubField[]; // For columns displaying/editing multiple fields
|
|
38
|
+
editConfig?: {
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
defaultValue?: any;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface TableFilter {
|
|
45
|
+
key: string;
|
|
46
|
+
label: string;
|
|
47
|
+
type: 'select' | 'text' | 'date'; // Added type for future extension
|
|
48
|
+
options?: TableOption[];
|
|
49
|
+
apiUrl?: string;
|
|
50
|
+
apiMethod?: 'GET' | 'POST';
|
|
51
|
+
apiPayload?: any;
|
|
52
|
+
labelKey?: string;
|
|
53
|
+
valueKey?: string;
|
|
54
|
+
labelPath?: string;
|
|
55
|
+
valuePath?: string;
|
|
56
|
+
requestKey?: string;
|
|
57
|
+
dataPath?: string;
|
|
58
|
+
handling?: 'standard' | 'nested_string';
|
|
59
|
+
nestedStringConfig?: NestedStringConfig;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface TableActionItem {
|
|
63
|
+
label: string;
|
|
64
|
+
type: 'api' | 'callback' | 'route' | 'delete';
|
|
65
|
+
icon?: string;
|
|
66
|
+
apiUrl?: string;
|
|
67
|
+
apiMethod?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
68
|
+
route?: string;
|
|
69
|
+
confirmationNeeded?: boolean;
|
|
70
|
+
confirmationMessage?: string;
|
|
71
|
+
callback?: (row: any) => void;
|
|
72
|
+
/** Config for native 'delete' action type — drives the built-in confirmation modal */
|
|
73
|
+
deleteConfig?: {
|
|
74
|
+
apiUrl: string; // URL with :id placeholder e.g. 'gateway/service/api/v1/items/:id'
|
|
75
|
+
idField?: string; // Row field used as id (default: 'id')
|
|
76
|
+
modalTitle?: string;
|
|
77
|
+
modalMessage?: string;
|
|
78
|
+
confirmLabel?: string;
|
|
79
|
+
cancelLabel?: string;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface TableAction {
|
|
84
|
+
label: string;
|
|
85
|
+
type: 'api' | 'callback' | 'route' | 'edit' | 'dropdown';
|
|
86
|
+
icon?: string; // FontAwesome class or similar
|
|
87
|
+
btnVariant?: 'primary' | 'secondary' | 'outline' | 'danger' | 'warning' | 'success' | 'danger-outline'; // utilizing button variants
|
|
88
|
+
apiUrl?: string;
|
|
89
|
+
apiMethod?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
90
|
+
route?: string;
|
|
91
|
+
confirmationNeeded?: boolean;
|
|
92
|
+
confirmationMessage?: string;
|
|
93
|
+
callback?: (row: any) => void;
|
|
94
|
+
items?: TableActionItem[]; // For dropdown type
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface PaginationConfig {
|
|
98
|
+
enabled: boolean;
|
|
99
|
+
pageSize: number;
|
|
100
|
+
pageSizeOptions: number[];
|
|
101
|
+
totalCountConfig?: {
|
|
102
|
+
source: 'same' | 'separate';
|
|
103
|
+
apiUrl?: string;
|
|
104
|
+
responsePath?: string;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface TableTheme {
|
|
109
|
+
primaryColor?: string;
|
|
110
|
+
headerBg?: string;
|
|
111
|
+
headerColor?: string;
|
|
112
|
+
rowHoverBg?: string;
|
|
113
|
+
borderColor?: string;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface NestedStringConfig {
|
|
117
|
+
paramName: string;
|
|
118
|
+
baseValue?: string;
|
|
119
|
+
separator: string;
|
|
120
|
+
assignment: string;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface QueryParamsConfig {
|
|
124
|
+
pageKey?: string;
|
|
125
|
+
sizeKey?: string;
|
|
126
|
+
pageIndexOffset?: number; // e.g. -1 for 0-based index from 1-based UI
|
|
127
|
+
filterHandling?: 'standard' | 'nested_string';
|
|
128
|
+
nestedStringConfig?: NestedStringConfig;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface TableConfig {
|
|
132
|
+
columns: TableColumn[];
|
|
133
|
+
apiUrl?: string; // Optional when tableData is provided externally
|
|
134
|
+
apiMethod?: 'GET' | 'POST';
|
|
135
|
+
apiPayload?: any;
|
|
136
|
+
dataResponsePath?: string;
|
|
137
|
+
filters?: TableFilter[];
|
|
138
|
+
filterData?: { [key: string]: any[] };
|
|
139
|
+
pagination?: PaginationConfig;
|
|
140
|
+
actions?: TableAction[]; // Row level actions
|
|
141
|
+
topBarButtons?: TableAction[]; // Buttons above the table
|
|
142
|
+
sortBy?: string;
|
|
143
|
+
orderBy?: 'ASC' | 'DESC';
|
|
144
|
+
theme?: TableTheme;
|
|
145
|
+
requestParams?: Function;
|
|
146
|
+
selectable?: boolean; // Checkbox selection
|
|
147
|
+
queryParamsConfig?: QueryParamsConfig;
|
|
148
|
+
labels?: TableLabels;
|
|
149
|
+
searchConfig?: SearchConfig;
|
|
150
|
+
maxHeight?: string;
|
|
151
|
+
stickyHeader?: boolean;
|
|
152
|
+
|
|
153
|
+
stickyColumnCount?: number;
|
|
154
|
+
token?: string; // Full token string (e.g. "Bearer ...")
|
|
155
|
+
tokenHeader?: string; // Header key (default: "Authorization")
|
|
156
|
+
editingRowClass?: string; // Optional CSS class to apply to rows being edited
|
|
157
|
+
/** Fallback text for any cell whose value is null, undefined, or empty string.
|
|
158
|
+
* Overridden per-column via TableColumn.emptyValue. Library default: '-' */
|
|
159
|
+
emptyValue?: string;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export interface SearchConfig {
|
|
163
|
+
enabled: boolean;
|
|
164
|
+
searchKey?: string; // Query param key (default: 'search')
|
|
165
|
+
debounceTime?: number; // ms (default: 300)
|
|
166
|
+
handling?: 'standard' | 'nested_string'; // standard: ?search=term, nested_string: ?params=SEARCH_TERM=term
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface TableLabels {
|
|
170
|
+
searchPlaceholder?: string;
|
|
171
|
+
actionColumnHeader?: string;
|
|
172
|
+
noDataMessage?: string;
|
|
173
|
+
itemsPerPageLabel?: string;
|
|
174
|
+
defaultConfirmationMessage?: string;
|
|
175
|
+
saveLabel?: string;
|
|
176
|
+
cancelLabel?: string;
|
|
177
|
+
addLabel?: string;
|
|
178
|
+
/** Variant for the Add button (new row). Defaults to 'danger'. */
|
|
179
|
+
addButtonVariant?: 'primary' | 'secondary' | 'outline' | 'danger' | 'warning' | 'success' | 'danger-outline';
|
|
180
|
+
/** Variant for the Save button (edit row). Defaults to 'primary'. */
|
|
181
|
+
saveButtonVariant?: 'primary' | 'secondary' | 'outline' | 'danger' | 'warning' | 'success' | 'danger-outline';
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Emitted by the SmartTableComponent when operating in external-data mode
|
|
186
|
+
* (i.e. when [tableData] input is provided by the parent).
|
|
187
|
+
* The parent is responsible for fetching updated data based on this event
|
|
188
|
+
* and providing it back via [tableData] and [totalItemsCount].
|
|
189
|
+
*/
|
|
190
|
+
export interface TableDataChangeEvent {
|
|
191
|
+
page: number;
|
|
192
|
+
pageSize: number;
|
|
193
|
+
sortBy?: string;
|
|
194
|
+
orderBy?: 'ASC' | 'DESC';
|
|
195
|
+
searchTerm?: string;
|
|
196
|
+
filters?: { [key: string]: any };
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export interface TableRowSaveEvent {
|
|
200
|
+
row: any;
|
|
201
|
+
isNew: boolean;
|
|
202
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { FormsModule } from '@angular/forms';
|
|
4
|
+
import { SmartTableComponent } from './components/smart-table/smart-table.component';
|
|
5
|
+
import { PaginationModule } from '../pagination/pagination.module';
|
|
6
|
+
import { ButtonModule } from '../button/button.module';
|
|
7
|
+
import { MaterialModule } from '../material/material.module';
|
|
8
|
+
import { ConfirmationModalModule } from '../confirmation-modal/confirmation-modal.module';
|
|
9
|
+
import { SafeHtmlPipe } from './utils/safe-html.pipe';
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@NgModule({
|
|
13
|
+
declarations: [
|
|
14
|
+
SmartTableComponent,
|
|
15
|
+
SafeHtmlPipe
|
|
16
|
+
],
|
|
17
|
+
imports: [
|
|
18
|
+
CommonModule,
|
|
19
|
+
FormsModule,
|
|
20
|
+
PaginationModule,
|
|
21
|
+
ButtonModule,
|
|
22
|
+
MaterialModule,
|
|
23
|
+
ConfirmationModalModule
|
|
24
|
+
],
|
|
25
|
+
exports: [
|
|
26
|
+
SmartTableComponent
|
|
27
|
+
]
|
|
28
|
+
})
|
|
29
|
+
export class SmartTableModule { }
|
|
30
|
+
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use '../confirmation-modal/confirmation-modal.theme' as confirmation-modal;
|
|
3
|
+
|
|
4
|
+
// Default Smart Table Theme
|
|
5
|
+
$smart-table-theme-defaults: (
|
|
6
|
+
// Font & General
|
|
7
|
+
font-family: ('Roboto', sans-serif),
|
|
8
|
+
font-size: 14px,
|
|
9
|
+
text-color: #333333,
|
|
10
|
+
border-radius: 8px,
|
|
11
|
+
box-shadow: 0 2px 4px rgba(0,0,0,0.05),
|
|
12
|
+
|
|
13
|
+
// Table Structure
|
|
14
|
+
table-bg: #ffffff,
|
|
15
|
+
table-padding: 1rem,
|
|
16
|
+
cell-padding: 1rem,
|
|
17
|
+
|
|
18
|
+
// Borders
|
|
19
|
+
table-border: 1px solid #e0e0e0,
|
|
20
|
+
row-border: 1px solid #f0f0f0,
|
|
21
|
+
header-border: 1px solid #e0e0e0,
|
|
22
|
+
|
|
23
|
+
// Row Colors
|
|
24
|
+
row-bg: #ffffff,
|
|
25
|
+
row-hover-bg: #f9f9f9,
|
|
26
|
+
cell-hover-bg: #f0f0f0,
|
|
27
|
+
row-selected-bg: #f3e5f5,
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
// Header Styling
|
|
32
|
+
header-bg: #f5f5f5,
|
|
33
|
+
header-color: #333333,
|
|
34
|
+
header-font-weight: 500,
|
|
35
|
+
header-font-size: 14px,
|
|
36
|
+
header-transform: none, // uppercase, capitalize, etc.
|
|
37
|
+
|
|
38
|
+
// Toolbar
|
|
39
|
+
toolbar-bg: #ffffff,
|
|
40
|
+
toolbar-padding: 1rem,
|
|
41
|
+
toolbar-border-bottom: 1px solid #e0e0e0,
|
|
42
|
+
toolbar-gap: 1rem,
|
|
43
|
+
|
|
44
|
+
// Search Input
|
|
45
|
+
search-bg: #f5f5f5,
|
|
46
|
+
search-border: none,
|
|
47
|
+
search-radius: 8px,
|
|
48
|
+
search-padding: 0.5rem 0.5rem 0.5rem 2rem,
|
|
49
|
+
search-wrapper-padding: 0 0.875rem,
|
|
50
|
+
search-height: 36px,
|
|
51
|
+
search-min-width: 200px,
|
|
52
|
+
search-width: auto,
|
|
53
|
+
search-icon-color: #888,
|
|
54
|
+
search-placeholder-color: #999,
|
|
55
|
+
|
|
56
|
+
// Filter Dropdowns (custom dropdown, not native select)
|
|
57
|
+
filter-bg: #ffffff,
|
|
58
|
+
filter-border: 1px solid #e0e0e0,
|
|
59
|
+
filter-radius: 8px,
|
|
60
|
+
filter-padding: 0.5rem,
|
|
61
|
+
filter-trigger-padding: 0 0.75rem,
|
|
62
|
+
filter-height: 36px,
|
|
63
|
+
filter-font-size: 14px,
|
|
64
|
+
filter-color: #555,
|
|
65
|
+
filter-hover-bg: #fafafa,
|
|
66
|
+
filter-hover-border-color: #bbb,
|
|
67
|
+
filter-active-border-color: #999,
|
|
68
|
+
filter-selected-color: #222,
|
|
69
|
+
filter-selected-border-color: #333,
|
|
70
|
+
filter-chevron-color: #999,
|
|
71
|
+
// Filter panel (dropdown drawer)
|
|
72
|
+
filter-panel-bg: #ffffff,
|
|
73
|
+
filter-panel-border: 1px solid #ebebeb,
|
|
74
|
+
filter-panel-radius: 12px,
|
|
75
|
+
filter-panel-shadow: (0 8px 28px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06)),
|
|
76
|
+
filter-panel-min-width: 180px,
|
|
77
|
+
filter-panel-padding: 6px,
|
|
78
|
+
filter-option-padding: 8px 12px,
|
|
79
|
+
filter-option-radius: 7px,
|
|
80
|
+
filter-option-hover-bg: #f5f5f5,
|
|
81
|
+
filter-option-selected-bg: #f0f0f0,
|
|
82
|
+
filter-option-selected-color: #111,
|
|
83
|
+
|
|
84
|
+
// Checkbox
|
|
85
|
+
checkbox-color: #e63e30,
|
|
86
|
+
checkbox-size: 18px,
|
|
87
|
+
|
|
88
|
+
// Badges (Status)
|
|
89
|
+
badge-radius: 12px,
|
|
90
|
+
badge-padding: 4px 12px,
|
|
91
|
+
badge-font-size: 12px,
|
|
92
|
+
badge-font-weight: 500,
|
|
93
|
+
|
|
94
|
+
// Badge Variants (Backgrounds)
|
|
95
|
+
badge-success-bg: #e8f5e9,
|
|
96
|
+
badge-success-color: #2e7d32,
|
|
97
|
+
badge-warning-bg: #fff3e0,
|
|
98
|
+
badge-warning-color: #ef6c00,
|
|
99
|
+
badge-danger-bg: #ffebee,
|
|
100
|
+
badge-danger-color: #c62828,
|
|
101
|
+
badge-info-bg: #e3f2fd,
|
|
102
|
+
badge-info-color: #1565c0,
|
|
103
|
+
badge-neutral-bg: #f5f5f5,
|
|
104
|
+
badge-neutral-color: #616161,
|
|
105
|
+
|
|
106
|
+
// Pagination Container
|
|
107
|
+
pagination-padding: 1rem,
|
|
108
|
+
pagination-border-top: none,
|
|
109
|
+
|
|
110
|
+
// Frozen columns (checkbox col, first-data col, actions col)
|
|
111
|
+
frozen-col-bg: #f9f9f9,
|
|
112
|
+
|
|
113
|
+
// Actions column shadow (right-side pinned column)
|
|
114
|
+
actions-col-shadow: -4px 0 8px rgba(0, 0, 0, 0.06),
|
|
115
|
+
|
|
116
|
+
// Action circle (three-dot button)
|
|
117
|
+
action-circle-size: 32px,
|
|
118
|
+
|
|
119
|
+
// Row action dropdown menu
|
|
120
|
+
dropdown-min-width: 150px,
|
|
121
|
+
dropdown-bg: #ffffff,
|
|
122
|
+
dropdown-border: 1px solid #e0e0e0,
|
|
123
|
+
dropdown-radius: 8px,
|
|
124
|
+
dropdown-shadow: 0 8px 24px rgba(0, 0, 0, 0.12),
|
|
125
|
+
dropdown-padding: 4px,
|
|
126
|
+
dropdown-item-padding: 8px 12px,
|
|
127
|
+
dropdown-item-radius: 6px,
|
|
128
|
+
dropdown-item-hover-bg: #f5f5f5,
|
|
129
|
+
|
|
130
|
+
// Selection count strip
|
|
131
|
+
selection-strip-bg: #fafafa,
|
|
132
|
+
selection-strip-border: 1px solid rgba(0, 0, 0, 0.08),
|
|
133
|
+
selection-strip-padding: 0.45rem 1rem,
|
|
134
|
+
selection-count-color: #444,
|
|
135
|
+
selection-count-font-size: 13px,
|
|
136
|
+
selection-count-font-weight: 500,
|
|
137
|
+
|
|
138
|
+
// Action Menu (Kebab - optional implementation detail)
|
|
139
|
+
action-menu-bg: #ffffff,
|
|
140
|
+
action-menu-shadow: 0 4px 6px rgba(0,0,0,0.1),
|
|
141
|
+
|
|
142
|
+
// Loader
|
|
143
|
+
loader-color: #6200EE,
|
|
144
|
+
// Scrollbar
|
|
145
|
+
scrollbar-width: 8px,
|
|
146
|
+
scrollbar-height: 8px,
|
|
147
|
+
scrollbar-track-bg: #f1f1f1,
|
|
148
|
+
scrollbar-track-radius: 4px,
|
|
149
|
+
scrollbar-thumb-bg: #c1c1c1,
|
|
150
|
+
scrollbar-thumb-radius: 4px,
|
|
151
|
+
scrollbar-thumb-hover-bg: #a8a8a8,
|
|
152
|
+
|
|
153
|
+
// Sticky Columns
|
|
154
|
+
sticky-shadow: 2px 0 5px -2px rgba(0,0,0,0.1),
|
|
155
|
+
sticky-border-right: 1px solid rgba(0,0,0,0.05),
|
|
156
|
+
|
|
157
|
+
// Spinner
|
|
158
|
+
spinner-border-color: rgba(0, 0, 0, 0.1),
|
|
159
|
+
|
|
160
|
+
// No Data
|
|
161
|
+
no-data-color: #888888,
|
|
162
|
+
|
|
163
|
+
// Sort Icon
|
|
164
|
+
sort-icon-size: 0.8em,
|
|
165
|
+
|
|
166
|
+
// Inline inputs theme values
|
|
167
|
+
cell-input-border: 1px solid #dee2e6,
|
|
168
|
+
cell-input-focus-outline-color: #00bcd4,
|
|
169
|
+
cell-input-bg: #fcfcfc,
|
|
170
|
+
cell-select-bg: #fcfcfc
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
@mixin smart-table-theme($theme: ()) {
|
|
174
|
+
$theme: map.merge($smart-table-theme-defaults, $theme);
|
|
175
|
+
|
|
176
|
+
// --- General ---
|
|
177
|
+
--st-font-family: #{map.get($theme, font-family)};
|
|
178
|
+
--st-font-size: #{map.get($theme, font-size)};
|
|
179
|
+
--st-text-color: #{map.get($theme, text-color)};
|
|
180
|
+
--st-border-radius: #{map.get($theme, border-radius)};
|
|
181
|
+
--st-box-shadow: #{map.get($theme, box-shadow)};
|
|
182
|
+
|
|
183
|
+
// --- Table Layout ---
|
|
184
|
+
--st-table-bg: #{map.get($theme, table-bg)};
|
|
185
|
+
--st-table-padding: #{map.get($theme, table-padding)};
|
|
186
|
+
--st-cell-padding: #{map.get($theme, cell-padding)};
|
|
187
|
+
|
|
188
|
+
// --- Borders ---
|
|
189
|
+
--st-table-border: #{map.get($theme, table-border)};
|
|
190
|
+
--st-row-border: #{map.get($theme, row-border)};
|
|
191
|
+
|
|
192
|
+
// --- Rows ---
|
|
193
|
+
--st-row-bg: #{map.get($theme, row-bg)};
|
|
194
|
+
--st-row-hover-bg: #{map.get($theme, row-hover-bg)};
|
|
195
|
+
--st-cell-hover-bg: #{map.get($theme, cell-hover-bg)};
|
|
196
|
+
--st-row-selected-bg: #{map.get($theme, row-selected-bg)};
|
|
197
|
+
|
|
198
|
+
// --- Header ---
|
|
199
|
+
--st-header-bg: #{map.get($theme, header-bg)};
|
|
200
|
+
--st-header-color: #{map.get($theme, header-color)};
|
|
201
|
+
--st-header-weight: #{map.get($theme, header-font-weight)};
|
|
202
|
+
--st-header-size: #{map.get($theme, header-font-size)};
|
|
203
|
+
--st-header-transform: #{map.get($theme, header-transform)};
|
|
204
|
+
--st-header-border: #{map.get($theme, header-border)};
|
|
205
|
+
|
|
206
|
+
// --- Toolbar ---
|
|
207
|
+
--st-toolbar-bg: #{map.get($theme, toolbar-bg)};
|
|
208
|
+
--st-toolbar-padding: #{map.get($theme, toolbar-padding)};
|
|
209
|
+
--st-toolbar-border-bottom: #{map.get($theme, toolbar-border-bottom)};
|
|
210
|
+
--st-toolbar-gap: #{map.get($theme, toolbar-gap)};
|
|
211
|
+
|
|
212
|
+
// --- Search ---
|
|
213
|
+
--st-search-bg: #{map.get($theme, search-bg)};
|
|
214
|
+
--st-search-border: #{map.get($theme, search-border)};
|
|
215
|
+
--st-search-radius: #{map.get($theme, search-radius)};
|
|
216
|
+
--st-search-padding: #{map.get($theme, search-padding)};
|
|
217
|
+
--st-search-wrapper-padding: #{map.get($theme, search-wrapper-padding)};
|
|
218
|
+
--st-search-height: #{map.get($theme, search-height)};
|
|
219
|
+
--st-search-min-width: #{map.get($theme, search-min-width)};
|
|
220
|
+
--st-search-width: #{map.get($theme, search-width)};
|
|
221
|
+
--st-search-icon-color: #{map.get($theme, search-icon-color)};
|
|
222
|
+
--st-search-placeholder-color: #{map.get($theme, search-placeholder-color)};
|
|
223
|
+
|
|
224
|
+
// --- Filter ---
|
|
225
|
+
--st-filter-bg: #{map.get($theme, filter-bg)};
|
|
226
|
+
--st-filter-border: #{map.get($theme, filter-border)};
|
|
227
|
+
--st-filter-radius: #{map.get($theme, filter-radius)};
|
|
228
|
+
--st-filter-padding: #{map.get($theme, filter-padding)};
|
|
229
|
+
--st-filter-trigger-padding: #{map.get($theme, filter-trigger-padding)};
|
|
230
|
+
--st-filter-height: #{map.get($theme, filter-height)};
|
|
231
|
+
--st-filter-font-size: #{map.get($theme, filter-font-size)};
|
|
232
|
+
--st-filter-color: #{map.get($theme, filter-color)};
|
|
233
|
+
--st-filter-hover-bg: #{map.get($theme, filter-hover-bg)};
|
|
234
|
+
--st-filter-hover-border-color: #{map.get($theme, filter-hover-border-color)};
|
|
235
|
+
--st-filter-active-border-color: #{map.get($theme, filter-active-border-color)};
|
|
236
|
+
--st-filter-selected-color: #{map.get($theme, filter-selected-color)};
|
|
237
|
+
--st-filter-selected-border-color: #{map.get($theme, filter-selected-border-color)};
|
|
238
|
+
--st-filter-chevron-color: #{map.get($theme, filter-chevron-color)};
|
|
239
|
+
--st-filter-panel-bg: #{map.get($theme, filter-panel-bg)};
|
|
240
|
+
--st-filter-panel-border: #{map.get($theme, filter-panel-border)};
|
|
241
|
+
--st-filter-panel-radius: #{map.get($theme, filter-panel-radius)};
|
|
242
|
+
--st-filter-panel-shadow: #{map.get($theme, filter-panel-shadow)};
|
|
243
|
+
--st-filter-panel-min-width: #{map.get($theme, filter-panel-min-width)};
|
|
244
|
+
--st-filter-panel-padding: #{map.get($theme, filter-panel-padding)};
|
|
245
|
+
--st-filter-option-padding: #{map.get($theme, filter-option-padding)};
|
|
246
|
+
--st-filter-option-radius: #{map.get($theme, filter-option-radius)};
|
|
247
|
+
--st-filter-option-hover-bg: #{map.get($theme, filter-option-hover-bg)};
|
|
248
|
+
--st-filter-option-selected-bg: #{map.get($theme, filter-option-selected-bg)};
|
|
249
|
+
--st-filter-option-selected-color: #{map.get($theme, filter-option-selected-color)};
|
|
250
|
+
|
|
251
|
+
// --- Checkbox ---
|
|
252
|
+
--st-checkbox-color: #{map.get($theme, checkbox-color)};
|
|
253
|
+
--st-checkbox-size: #{map.get($theme, checkbox-size)};
|
|
254
|
+
|
|
255
|
+
// --- Badges ---
|
|
256
|
+
--st-badge-radius: #{map.get($theme, badge-radius)};
|
|
257
|
+
--st-badge-padding: #{map.get($theme, badge-padding)};
|
|
258
|
+
--st-badge-font-size: #{map.get($theme, badge-font-size)};
|
|
259
|
+
--st-badge-font-weight: #{map.get($theme, badge-font-weight)};
|
|
260
|
+
|
|
261
|
+
--st-badge-success-bg: #{map.get($theme, badge-success-bg)};
|
|
262
|
+
--st-badge-success-color: #{map.get($theme, badge-success-color)};
|
|
263
|
+
--st-badge-warning-bg: #{map.get($theme, badge-warning-bg)};
|
|
264
|
+
--st-badge-warning-color: #{map.get($theme, badge-warning-color)};
|
|
265
|
+
--st-badge-danger-bg: #{map.get($theme, badge-danger-bg)};
|
|
266
|
+
--st-badge-danger-color: #{map.get($theme, badge-danger-color)};
|
|
267
|
+
--st-badge-info-bg: #{map.get($theme, badge-info-bg)};
|
|
268
|
+
--st-badge-info-color: #{map.get($theme, badge-info-color)};
|
|
269
|
+
--st-badge-neutral-bg: #{map.get($theme, badge-neutral-bg)};
|
|
270
|
+
--st-badge-neutral-color: #{map.get($theme, badge-neutral-color)};
|
|
271
|
+
|
|
272
|
+
// --- Pagination ---
|
|
273
|
+
--st-pagination-padding: #{map.get($theme, pagination-padding)};
|
|
274
|
+
--st-pagination-border-top: #{map.get($theme, pagination-border-top)};
|
|
275
|
+
|
|
276
|
+
// --- Loader ---
|
|
277
|
+
--st-loader-color: #{map.get($theme, loader-color)};
|
|
278
|
+
|
|
279
|
+
// --- Scrollbar ---
|
|
280
|
+
--st-scrollbar-width: #{map.get($theme, scrollbar-width)};
|
|
281
|
+
--st-scrollbar-height: #{map.get($theme, scrollbar-height)};
|
|
282
|
+
--st-scrollbar-track-bg: #{map.get($theme, scrollbar-track-bg)};
|
|
283
|
+
--st-scrollbar-track-radius: #{map.get($theme, scrollbar-track-radius)};
|
|
284
|
+
--st-scrollbar-thumb-bg: #{map.get($theme, scrollbar-thumb-bg)};
|
|
285
|
+
--st-scrollbar-thumb-radius: #{map.get($theme, scrollbar-thumb-radius)};
|
|
286
|
+
--st-scrollbar-thumb-hover-bg: #{map.get($theme, scrollbar-thumb-hover-bg)};
|
|
287
|
+
|
|
288
|
+
// --- Sticky Columns ---
|
|
289
|
+
--st-sticky-shadow: #{map.get($theme, sticky-shadow)};
|
|
290
|
+
--st-sticky-border-right: #{map.get($theme, sticky-border-right)};
|
|
291
|
+
|
|
292
|
+
// --- Spinner ---
|
|
293
|
+
--st-spinner-border-color: #{map.get($theme, spinner-border-color)};
|
|
294
|
+
|
|
295
|
+
// --- No Data ---
|
|
296
|
+
--st-no-data-color: #{map.get($theme, no-data-color)};
|
|
297
|
+
|
|
298
|
+
// --- Misc ---
|
|
299
|
+
--st-sort-icon-size: #{map.get($theme, sort-icon-size)};
|
|
300
|
+
|
|
301
|
+
// --- Frozen Columns ---
|
|
302
|
+
--st-frozen-col-bg: #{map.get($theme, frozen-col-bg)};
|
|
303
|
+
--st-actions-col-shadow: #{map.get($theme, actions-col-shadow)};
|
|
304
|
+
|
|
305
|
+
// --- Action Circle ---
|
|
306
|
+
--st-action-circle-size: #{map.get($theme, action-circle-size)};
|
|
307
|
+
|
|
308
|
+
// --- Row Action Dropdown ---
|
|
309
|
+
--st-dropdown-min-width: #{map.get($theme, dropdown-min-width)};
|
|
310
|
+
--st-dropdown-bg: #{map.get($theme, dropdown-bg)};
|
|
311
|
+
--st-dropdown-border: #{map.get($theme, dropdown-border)};
|
|
312
|
+
--st-dropdown-radius: #{map.get($theme, dropdown-radius)};
|
|
313
|
+
--st-dropdown-shadow: #{map.get($theme, dropdown-shadow)};
|
|
314
|
+
--st-dropdown-padding: #{map.get($theme, dropdown-padding)};
|
|
315
|
+
--st-dropdown-item-padding: #{map.get($theme, dropdown-item-padding)};
|
|
316
|
+
--st-dropdown-item-radius: #{map.get($theme, dropdown-item-radius)};
|
|
317
|
+
--st-dropdown-item-hover-bg: #{map.get($theme, dropdown-item-hover-bg)};
|
|
318
|
+
|
|
319
|
+
// --- Selection Strip ---
|
|
320
|
+
--st-selection-strip-bg: #{map.get($theme, selection-strip-bg)};
|
|
321
|
+
--st-selection-strip-border: #{map.get($theme, selection-strip-border)};
|
|
322
|
+
--st-selection-strip-padding: #{map.get($theme, selection-strip-padding)};
|
|
323
|
+
--st-selection-count-color: #{map.get($theme, selection-count-color)};
|
|
324
|
+
--st-selection-count-font-size: #{map.get($theme, selection-count-font-size)};
|
|
325
|
+
--st-selection-count-font-weight: #{map.get($theme, selection-count-font-weight)};
|
|
326
|
+
|
|
327
|
+
// --- Inline Edit Controls ---
|
|
328
|
+
--st-cell-input-border: #{map.get($theme, cell-input-border)};
|
|
329
|
+
--st-cell-input-focus-outline-color: #{map.get($theme, cell-input-focus-outline-color)};
|
|
330
|
+
--st-cell-input-bg: #{map.get($theme, cell-input-bg)};
|
|
331
|
+
--st-cell-select-bg: #{map.get($theme, cell-select-bg)};
|
|
332
|
+
|
|
333
|
+
// --- Confirmation Modal (bundled so delete modal renders correctly) ---
|
|
334
|
+
@include confirmation-modal.confirmation-modal-theme();
|
|
335
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Pipe, PipeTransform, SecurityContext } from '@angular/core';
|
|
2
|
+
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Sanitizes and bypasses Angular's DomSanitizer security for HTML content.
|
|
6
|
+
* Prevents execution of unsafe scripts/attributes while allowing safe rendering of formatting tags in [innerHTML].
|
|
7
|
+
*/
|
|
8
|
+
@Pipe({
|
|
9
|
+
name: 'safeHtml',
|
|
10
|
+
standalone: false
|
|
11
|
+
})
|
|
12
|
+
export class SafeHtmlPipe implements PipeTransform {
|
|
13
|
+
constructor(private sanitizer: DomSanitizer) { }
|
|
14
|
+
|
|
15
|
+
transform(value: string): SafeHtml | null {
|
|
16
|
+
if (!value) {
|
|
17
|
+
return '';
|
|
18
|
+
}
|
|
19
|
+
const cleaned = this.sanitizer.sanitize(SecurityContext.HTML, value);
|
|
20
|
+
return this.sanitizer.bypassSecurityTrustHtml(cleaned || '');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function appendBaseUrlRecursively(obj: any, baseURL: string): void {
|
|
2
|
+
if (obj && typeof obj === 'object') {
|
|
3
|
+
if (obj.apiUrl && typeof obj.apiUrl === 'string' && !obj.apiUrl.startsWith('http://') && !obj.apiUrl.startsWith('https://')) {
|
|
4
|
+
let finalApiUrl = obj.apiUrl;
|
|
5
|
+
if (baseURL.endsWith('/') && finalApiUrl.startsWith('/')) {
|
|
6
|
+
finalApiUrl = finalApiUrl.substring(1);
|
|
7
|
+
} else if (!baseURL.endsWith('/') && !finalApiUrl.startsWith('/')) {
|
|
8
|
+
finalApiUrl = '/' + finalApiUrl;
|
|
9
|
+
}
|
|
10
|
+
obj.apiUrl = baseURL + finalApiUrl;
|
|
11
|
+
}
|
|
12
|
+
for (const key in obj) {
|
|
13
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
14
|
+
appendBaseUrlRecursively(obj[key], baseURL);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<div class="cc-snackbar-container" [ngClass]="variantClass">
|
|
2
|
+
<div class="cc-snackbar-icon">
|
|
3
|
+
<!-- Success Icon -->
|
|
4
|
+
<svg *ngIf="data.variant === 'success'" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
5
|
+
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
|
|
6
|
+
<polyline points="22 4 12 14.01 9 11.01"></polyline>
|
|
7
|
+
</svg>
|
|
8
|
+
|
|
9
|
+
<!-- Error Icon -->
|
|
10
|
+
<svg *ngIf="data.variant === 'error'" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
11
|
+
<circle cx="12" cy="12" r="10"></circle>
|
|
12
|
+
<line x1="15" y1="9" x2="9" y2="15"></line>
|
|
13
|
+
<line x1="9" y1="9" x2="15" y2="15"></line>
|
|
14
|
+
</svg>
|
|
15
|
+
|
|
16
|
+
<!-- Warning Icon -->
|
|
17
|
+
<svg *ngIf="data.variant === 'warning'" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
18
|
+
<path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path>
|
|
19
|
+
<line x1="12" y1="9" x2="12" y2="13"></line>
|
|
20
|
+
<line x1="12" y1="17" x2="12.01" y2="17"></line>
|
|
21
|
+
</svg>
|
|
22
|
+
|
|
23
|
+
<!-- Info Icon -->
|
|
24
|
+
<svg *ngIf="data.variant === 'info' || !data.variant" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
25
|
+
<circle cx="12" cy="12" r="10"></circle>
|
|
26
|
+
<line x1="12" y1="16" x2="12" y2="12"></line>
|
|
27
|
+
<line x1="12" y1="8" x2="12.01" y2="8"></line>
|
|
28
|
+
</svg>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div class="cc-snackbar-message">
|
|
32
|
+
{{ data.message }}
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<button *ngIf="data.showCloseButton" class="cc-snackbar-close" (click)="snackBarRef.dismiss()">
|
|
36
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
37
|
+
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
38
|
+
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
39
|
+
</svg>
|
|
40
|
+
</button>
|
|
41
|
+
</div>
|