commons-shared-web-ui 0.0.50 → 0.0.52
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 +14557 -0
- package/fesm2022/commons-shared-web-ui.mjs.map +1 -0
- package/index.d.ts +4534 -0
- package/package.json +34 -53
- package/src/lib/styles/utilities.scss +1 -0
- 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 -597
- package/documentation/form-components.md +0 -384
- 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 -2405
- package/documentation/smart-table.md +0 -1221
- package/documentation/snackbar.md +0 -118
- package/documentation/style-externalization.md +0 -88
- package/documentation/summary-card.md +0 -279
- package/ng-package.json +0 -28
- 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 -88
- 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/button-dropdown.theme.scss +0 -87
- 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 -41
- 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 -1196
- package/src/lib/modules/smart-form/components/form-field/form-field.component.scss +0 -2014
- package/src/lib/modules/smart-form/components/form-field/form-field.component.ts +0 -2525
- package/src/lib/modules/smart-form/components/form-section/form-section.component.html +0 -65
- 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 -131
- 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 -1124
- package/src/lib/modules/smart-form/index.ts +0 -10
- package/src/lib/modules/smart-form/models/form-schema.model.ts +0 -733
- package/src/lib/modules/smart-form/models/hierarchy-config.model.ts +0 -21
- 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 -65
- package/src/lib/modules/smart-form/smart-form.examples.ts +0 -1324
- package/src/lib/modules/smart-form/smart-form.module.ts +0 -36
- 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 -1128
- package/src/lib/modules/smart-table/models/table-config.model.ts +0 -207
- 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/shared-ui.module.ts +0 -44
- 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 -104
- package/tsconfig.lib.json +0 -15
|
@@ -1,395 +0,0 @@
|
|
|
1
|
-
.cc-modal-backdrop {
|
|
2
|
-
position: fixed;
|
|
3
|
-
top: 0;
|
|
4
|
-
left: 0;
|
|
5
|
-
right: 0;
|
|
6
|
-
bottom: 0;
|
|
7
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
8
|
-
display: flex;
|
|
9
|
-
align-items: center;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
z-index: 1000;
|
|
12
|
-
animation: fadeIn 0.2s ease-in-out;
|
|
13
|
-
|
|
14
|
-
&--side-panel {
|
|
15
|
-
align-items: stretch;
|
|
16
|
-
justify-content: flex-end;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.cc-modal-container {
|
|
21
|
-
background: var(--cc-modal-bg);
|
|
22
|
-
border-radius: var(--cc-modal-radius);
|
|
23
|
-
box-shadow: var(--cc-modal-shadow);
|
|
24
|
-
border: var(--cc-modal-border, none);
|
|
25
|
-
|
|
26
|
-
display: flex;
|
|
27
|
-
flex-direction: column;
|
|
28
|
-
max-height: 90vh;
|
|
29
|
-
max-width: 90vw;
|
|
30
|
-
animation: slideIn 0.3s ease-out;
|
|
31
|
-
overflow: hidden;
|
|
32
|
-
|
|
33
|
-
&.side-panel {
|
|
34
|
-
max-height: 100vh;
|
|
35
|
-
animation: slideInRight 0.3s ease-out;
|
|
36
|
-
z-index: 1001;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Header Styles
|
|
41
|
-
.modal-header {
|
|
42
|
-
display: flex;
|
|
43
|
-
align-items: center;
|
|
44
|
-
justify-content: space-between;
|
|
45
|
-
padding: var(--cc-modal-header-padding);
|
|
46
|
-
border-bottom: var(--cc-modal-header-border-bottom);
|
|
47
|
-
|
|
48
|
-
&__content {
|
|
49
|
-
display: flex;
|
|
50
|
-
align-items: center;
|
|
51
|
-
gap: 0.75rem; // 12px
|
|
52
|
-
flex: 1;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
&__icon {
|
|
56
|
-
display: flex;
|
|
57
|
-
align-items: center;
|
|
58
|
-
justify-content: center;
|
|
59
|
-
|
|
60
|
-
mat-icon {
|
|
61
|
-
font-size: var(--cc-modal-icon-size, 1.5rem);
|
|
62
|
-
width: var(--cc-modal-icon-size, 1.5rem);
|
|
63
|
-
height: var(--cc-modal-icon-size, 1.5rem);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
&__custom-icon {
|
|
68
|
-
width: var(--cc-modal-icon-size, 1.5rem);
|
|
69
|
-
height: var(--cc-modal-icon-size, 1.5rem);
|
|
70
|
-
object-fit: contain;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
&__title {
|
|
74
|
-
margin: 0;
|
|
75
|
-
font-size: var(--cc-modal-title-size);
|
|
76
|
-
font-weight: var(--cc-modal-title-weight);
|
|
77
|
-
line-height: 1.4;
|
|
78
|
-
color: var(--cc-modal-title-color);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
&__close {
|
|
82
|
-
background: none;
|
|
83
|
-
border: none;
|
|
84
|
-
padding: 0.25rem; // 4px
|
|
85
|
-
cursor: pointer;
|
|
86
|
-
color: #6B7280;
|
|
87
|
-
transition: color 0.2s;
|
|
88
|
-
display: flex;
|
|
89
|
-
align-items: center;
|
|
90
|
-
|
|
91
|
-
&:hover {
|
|
92
|
-
color: #111827;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
mat-icon {
|
|
96
|
-
font-size: var(--cc-modal-close-icon-size, 1.25rem);
|
|
97
|
-
width: var(--cc-modal-close-icon-size, 1.25rem);
|
|
98
|
-
height: var(--cc-modal-close-icon-size, 1.25rem);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
&__code-btn {
|
|
103
|
-
background: none;
|
|
104
|
-
border: none;
|
|
105
|
-
padding: 0.25rem;
|
|
106
|
-
margin-right: 0.5rem;
|
|
107
|
-
cursor: pointer;
|
|
108
|
-
color: #6B7280;
|
|
109
|
-
transition: all 0.2s;
|
|
110
|
-
display: flex;
|
|
111
|
-
align-items: center;
|
|
112
|
-
|
|
113
|
-
&:hover {
|
|
114
|
-
color: #EF4444;
|
|
115
|
-
transform: scale(1.1);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
mat-icon {
|
|
119
|
-
font-size: 1.15rem;
|
|
120
|
-
width: 1.15rem;
|
|
121
|
-
height: 1.15rem;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
&--dark {
|
|
126
|
-
background-color: var(--cc-modal-header-bg-dark, #262125);
|
|
127
|
-
border-bottom: none;
|
|
128
|
-
|
|
129
|
-
.modal-header__title {
|
|
130
|
-
color: var(--cc-modal-header-title-color-dark, #FFFFFF);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.modal-header__close {
|
|
134
|
-
color: var(--cc-modal-header-close-color-dark, rgba(255, 255, 255, 0.7));
|
|
135
|
-
|
|
136
|
-
&:hover {
|
|
137
|
-
color: #FFFFFF;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.modal-header__code-btn {
|
|
142
|
-
color: var(--cc-modal-header-code-btn-color-dark, rgba(255, 255, 255, 0.7));
|
|
143
|
-
|
|
144
|
-
&:hover {
|
|
145
|
-
color: #FFFFFF;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// Body Styles
|
|
152
|
-
.cc-modal-body {
|
|
153
|
-
padding: var(--cc-modal-body-padding);
|
|
154
|
-
overflow-y: auto;
|
|
155
|
-
flex: 1;
|
|
156
|
-
color: var(--cc-modal-body-color);
|
|
157
|
-
font-size: 0.875rem; // 14px
|
|
158
|
-
line-height: 1.6;
|
|
159
|
-
|
|
160
|
-
// Allow custom form fields, inputs, etc.
|
|
161
|
-
::ng-deep {
|
|
162
|
-
|
|
163
|
-
// Text inputs
|
|
164
|
-
input[type="text"],
|
|
165
|
-
textarea,
|
|
166
|
-
select {
|
|
167
|
-
width: 100%;
|
|
168
|
-
padding: var(--cc-modal-input-padding, 0.625rem 0.75rem);
|
|
169
|
-
border: 0.0625rem solid #D1D5DB; // 1px
|
|
170
|
-
border-radius: var(--cc-modal-input-radius, 0.375rem);
|
|
171
|
-
font-size: var(--cc-modal-input-font-size, 0.875rem);
|
|
172
|
-
transition: border-color 0.2s;
|
|
173
|
-
|
|
174
|
-
&:focus {
|
|
175
|
-
outline: none;
|
|
176
|
-
border-color: var(--cc-btn-primary-bg, #3b82f6);
|
|
177
|
-
box-shadow: 0 0 0 0.1875rem rgba(59, 130, 246, 0.1); // 3px
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
textarea {
|
|
182
|
-
resize: vertical;
|
|
183
|
-
min-height: var(--cc-modal-textarea-min-height, 6.25rem);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// Labels
|
|
187
|
-
label {
|
|
188
|
-
display: block;
|
|
189
|
-
margin-bottom: var(--cc-modal-label-margin-bottom, 0.5rem);
|
|
190
|
-
font-weight: 500;
|
|
191
|
-
color: var(--cc-modal-body-color);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
// Required indicator
|
|
195
|
-
// .required::after {
|
|
196
|
-
// content: ' *';
|
|
197
|
-
// color: #EF4444;
|
|
198
|
-
// }
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
// Footer Styles
|
|
203
|
-
.cc-modal-footer {
|
|
204
|
-
display: flex;
|
|
205
|
-
align-items: center;
|
|
206
|
-
justify-content: flex-end;
|
|
207
|
-
gap: 0.75rem; // 12px
|
|
208
|
-
padding: var(--cc-modal-footer-padding);
|
|
209
|
-
border-top: var(--cc-modal-footer-border-top);
|
|
210
|
-
background: var(--cc-modal-footer-bg);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
// Button Styles - Delegating to Standard Button Theme Variables
|
|
214
|
-
.cc-btn {
|
|
215
|
-
display: inline-flex;
|
|
216
|
-
align-items: center;
|
|
217
|
-
justify-content: center;
|
|
218
|
-
gap: 0.5rem; // 8px
|
|
219
|
-
padding: var(--cc-btn-padding, 0.5rem 1rem);
|
|
220
|
-
font-family: var(--cc-btn-font-family, inherit);
|
|
221
|
-
font-weight: var(--cc-btn-font-weight, 500);
|
|
222
|
-
font-size: var(--cc-btn-font-size, 0.875rem);
|
|
223
|
-
cursor: pointer;
|
|
224
|
-
transition: all 0.2s;
|
|
225
|
-
min-width: 5rem; // 80px
|
|
226
|
-
|
|
227
|
-
&:disabled {
|
|
228
|
-
opacity: var(--cc-btn-disabled-opacity, 0.6);
|
|
229
|
-
cursor: var(--cc-btn-disabled-cursor, not-allowed);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
// Secondary (Cancel) - Mapped to Secondary Button Theme
|
|
233
|
-
&-secondary {
|
|
234
|
-
background: var(--cc-btn-secondary-bg);
|
|
235
|
-
color: var(--cc-btn-secondary-color);
|
|
236
|
-
border: var(--cc-btn-secondary-border);
|
|
237
|
-
border-radius: var(--cc-btn-secondary-radius);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
// Primary - Mapped to Primary Button Theme
|
|
241
|
-
&-primary {
|
|
242
|
-
background: var(--cc-btn-primary-bg);
|
|
243
|
-
color: var(--cc-btn-primary-color);
|
|
244
|
-
border: var(--cc-btn-primary-border);
|
|
245
|
-
border-radius: var(--cc-btn-primary-radius);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
// Danger
|
|
249
|
-
&-danger {
|
|
250
|
-
background: var(--cc-btn-danger-bg);
|
|
251
|
-
color: var(--cc-btn-danger-color);
|
|
252
|
-
border: var(--cc-btn-danger-border);
|
|
253
|
-
border-radius: var(--cc-btn-danger-radius);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
// Warning
|
|
257
|
-
&-warning {
|
|
258
|
-
background: var(--cc-btn-warning-bg);
|
|
259
|
-
color: var(--cc-btn-warning-color);
|
|
260
|
-
border: var(--cc-btn-warning-border);
|
|
261
|
-
border-radius: var(--cc-btn-warning-radius);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
// Loading Spinner
|
|
266
|
-
.cc-btn-spinner {
|
|
267
|
-
width: var(--cc-modal-spinner-size, 1rem);
|
|
268
|
-
height: var(--cc-modal-spinner-size, 1rem);
|
|
269
|
-
border: 0.125rem solid rgba(255, 255, 255, 0.3); // 2px
|
|
270
|
-
border-top-color: #ffffff;
|
|
271
|
-
border-radius: 50%;
|
|
272
|
-
animation: spin 0.6s linear infinite;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
// Animations
|
|
276
|
-
@keyframes fadeIn {
|
|
277
|
-
from {
|
|
278
|
-
opacity: 0;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
to {
|
|
282
|
-
opacity: 1;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
@keyframes slideIn {
|
|
287
|
-
from {
|
|
288
|
-
transform: translateY(-1.25rem);
|
|
289
|
-
opacity: 0;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
to {
|
|
293
|
-
transform: translateY(0);
|
|
294
|
-
opacity: 1;
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
@keyframes slideInRight {
|
|
299
|
-
from {
|
|
300
|
-
transform: translateX(100%);
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
to {
|
|
304
|
-
transform: translateX(0);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
@keyframes spin {
|
|
309
|
-
to {
|
|
310
|
-
transform: rotate(360deg);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
// Responsive
|
|
315
|
-
@media (max-width: 40rem) {
|
|
316
|
-
|
|
317
|
-
// 640px
|
|
318
|
-
.cc-modal-container {
|
|
319
|
-
width: 95vw !important;
|
|
320
|
-
max-height: 95vh;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
.modal-header {
|
|
324
|
-
padding: 1rem;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
// 16px
|
|
328
|
-
.cc-modal-body {
|
|
329
|
-
padding: 1rem;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
// 16px
|
|
333
|
-
.cc-modal-footer {
|
|
334
|
-
padding: 0.75rem 1rem; // 12px 16px
|
|
335
|
-
flex-direction: column;
|
|
336
|
-
|
|
337
|
-
.cc-btn {
|
|
338
|
-
width: 100%;
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
// Modal mode — strips card-inside-card appearance from smart-form content
|
|
344
|
-
.cc-modal-body--form-mode {
|
|
345
|
-
padding: 0;
|
|
346
|
-
// min-height: 360px;
|
|
347
|
-
|
|
348
|
-
::ng-deep {
|
|
349
|
-
.smart-form-wrapper,
|
|
350
|
-
.smart-form-skeleton {
|
|
351
|
-
box-shadow: none !important;
|
|
352
|
-
border: none !important;
|
|
353
|
-
padding: 0 !important;
|
|
354
|
-
border-radius: 0 !important;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
// Disable the entry animation — translateY briefly causes the body to
|
|
358
|
-
// overflow and flash a scrollbar before settling
|
|
359
|
-
.smart-form-wrapper {
|
|
360
|
-
animation: none !important;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
// Replace the tall multi-section skeleton with a centred spinner that
|
|
364
|
-
// occupies the same 360px as the body so the modal never changes height
|
|
365
|
-
.smart-form-skeleton {
|
|
366
|
-
display: flex !important;
|
|
367
|
-
align-items: center !important;
|
|
368
|
-
justify-content: center !important;
|
|
369
|
-
min-height: 360px !important;
|
|
370
|
-
gap: 0 !important;
|
|
371
|
-
|
|
372
|
-
> * { display: none !important; }
|
|
373
|
-
|
|
374
|
-
&::after {
|
|
375
|
-
content: '';
|
|
376
|
-
display: block;
|
|
377
|
-
width: 28px;
|
|
378
|
-
height: 28px;
|
|
379
|
-
border: 3px solid #E5E7EB;
|
|
380
|
-
border-top-color: #6366F1;
|
|
381
|
-
border-radius: 50%;
|
|
382
|
-
animation: cc-modal-skeleton-spin 0.7s linear infinite;
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
.form-section-container {
|
|
387
|
-
box-shadow: none !important;
|
|
388
|
-
border: none !important;
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
@keyframes cc-modal-skeleton-spin {
|
|
394
|
-
to { transform: rotate(360deg); }
|
|
395
|
-
}
|
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Component,
|
|
3
|
-
Input,
|
|
4
|
-
Output,
|
|
5
|
-
EventEmitter,
|
|
6
|
-
OnInit,
|
|
7
|
-
OnDestroy,
|
|
8
|
-
HostListener
|
|
9
|
-
} from '@angular/core';
|
|
10
|
-
import { ConfirmationModalConfig } from '../../confirmation-modal.models';
|
|
11
|
-
|
|
12
|
-
@Component({
|
|
13
|
-
selector: 'cc-confirmation-modal',
|
|
14
|
-
templateUrl: './confirmation-modal.component.html',
|
|
15
|
-
styleUrls: ['./confirmation-modal.component.scss'],
|
|
16
|
-
standalone: false
|
|
17
|
-
})
|
|
18
|
-
export class ConfirmationModalComponent implements OnInit, OnDestroy {
|
|
19
|
-
@Input() config!: ConfirmationModalConfig;
|
|
20
|
-
@Input() isOpen = false;
|
|
21
|
-
@Input() confirmDisabled = false;
|
|
22
|
-
@Input() confirmLoading = false;
|
|
23
|
-
|
|
24
|
-
@Output() confirm = new EventEmitter<void>();
|
|
25
|
-
@Output() cancel = new EventEmitter<void>();
|
|
26
|
-
@Output() close = new EventEmitter<void>();
|
|
27
|
-
@Output() showCodeSnippet = new EventEmitter<void>();
|
|
28
|
-
|
|
29
|
-
// Default configuration
|
|
30
|
-
private defaultConfig: Partial<ConfirmationModalConfig> = {
|
|
31
|
-
headerTheme: 'dark', // Changed to dark as per new default requirement
|
|
32
|
-
width: '560px',
|
|
33
|
-
size: 'md',
|
|
34
|
-
type: 'modal',
|
|
35
|
-
panelPosition: 'right',
|
|
36
|
-
panelSpacing: '0px',
|
|
37
|
-
closeOnBackdrop: true,
|
|
38
|
-
closeOnEsc: true,
|
|
39
|
-
showCloseButton: true,
|
|
40
|
-
cancelButton: {
|
|
41
|
-
label: '',
|
|
42
|
-
show: true
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
mergedConfig!: ConfirmationModalConfig;
|
|
47
|
-
private previousActiveElement: HTMLElement | null = null;
|
|
48
|
-
private isSubmitting = false;
|
|
49
|
-
private _resetSubmittingTimer?: ReturnType<typeof setTimeout>;
|
|
50
|
-
|
|
51
|
-
ngOnInit(): void {
|
|
52
|
-
this.updateConfig();
|
|
53
|
-
// Store currently focused element
|
|
54
|
-
this.previousActiveElement = document.activeElement as HTMLElement;
|
|
55
|
-
|
|
56
|
-
// Prevent body scroll when modal is open
|
|
57
|
-
if (this.isOpen) {
|
|
58
|
-
this.toggleBodyScroll(true);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
ngOnChanges(): void {
|
|
63
|
-
this.updateConfig();
|
|
64
|
-
if (this.isOpen !== undefined) {
|
|
65
|
-
this.toggleBodyScroll(this.isOpen);
|
|
66
|
-
if (!this.isOpen) {
|
|
67
|
-
this.isSubmitting = false; // Reset submission guard when modal closes
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
// Reset submission guard when loading state finishes
|
|
71
|
-
if (this.isSubmitting && !this.confirmLoading && !this.mergedConfig.confirmButton.loading) {
|
|
72
|
-
this.isSubmitting = false;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
private updateConfig(): void {
|
|
77
|
-
if (!this.config) {
|
|
78
|
-
this.mergedConfig = { ...this.defaultConfig } as ConfirmationModalConfig;
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// Merge user config with defaults
|
|
83
|
-
this.mergedConfig = {
|
|
84
|
-
...this.defaultConfig,
|
|
85
|
-
...this.config,
|
|
86
|
-
cancelButton: {
|
|
87
|
-
...this.defaultConfig.cancelButton,
|
|
88
|
-
...this.config.cancelButton
|
|
89
|
-
},
|
|
90
|
-
confirmButton: {
|
|
91
|
-
...this.config.confirmButton
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
if (this.mergedConfig.confirmButton) {
|
|
96
|
-
// Logic handled by input/flag
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
ngOnDestroy(): void {
|
|
101
|
-
clearTimeout(this._resetSubmittingTimer);
|
|
102
|
-
|
|
103
|
-
// Restore body scroll
|
|
104
|
-
this.toggleBodyScroll(false);
|
|
105
|
-
|
|
106
|
-
// Restore focus to previous element
|
|
107
|
-
if (this.previousActiveElement) {
|
|
108
|
-
this.previousActiveElement.focus();
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
private toggleBodyScroll(disable: boolean): void {
|
|
113
|
-
if (disable) {
|
|
114
|
-
document.body.style.overflow = 'hidden';
|
|
115
|
-
} else {
|
|
116
|
-
document.body.style.overflow = '';
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
@HostListener('document:keydown.escape', ['$event'])
|
|
121
|
-
handleEscape(event: KeyboardEvent): void {
|
|
122
|
-
if (this.isOpen && this.mergedConfig.closeOnEsc) {
|
|
123
|
-
event.preventDefault();
|
|
124
|
-
this.onClose();
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
onBackdropClick(event: MouseEvent): void {
|
|
129
|
-
// Only close if clicking directly on backdrop, not modal content
|
|
130
|
-
if (
|
|
131
|
-
this.mergedConfig.closeOnBackdrop &&
|
|
132
|
-
event.target === event.currentTarget
|
|
133
|
-
) {
|
|
134
|
-
this.onClose();
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
onConfirm(): void {
|
|
139
|
-
const isDisabled = this.confirmDisabled || this.mergedConfig.confirmButton.disabled;
|
|
140
|
-
const isLoading = this.confirmLoading || this.mergedConfig.confirmButton.loading;
|
|
141
|
-
|
|
142
|
-
if (!isDisabled && !isLoading && !this.isSubmitting) {
|
|
143
|
-
this.isSubmitting = true;
|
|
144
|
-
this.confirm.emit();
|
|
145
|
-
// If the parent doesn't start loading within 300 ms (e.g. because client-side
|
|
146
|
-
// validation failed and no API call was made), reset the guard so the user
|
|
147
|
-
// can correct the form and try again.
|
|
148
|
-
clearTimeout(this._resetSubmittingTimer);
|
|
149
|
-
this._resetSubmittingTimer = setTimeout(() => {
|
|
150
|
-
if (!this.confirmLoading && !this.mergedConfig?.confirmButton?.loading) {
|
|
151
|
-
this.isSubmitting = false;
|
|
152
|
-
}
|
|
153
|
-
}, 300);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
onCancel(): void {
|
|
158
|
-
this.cancel.emit();
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
onClose(): void {
|
|
162
|
-
this.close.emit();
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
onShowCodeSnippet(): void {
|
|
166
|
-
this.showCodeSnippet.emit();
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
getModalWidth(): string {
|
|
170
|
-
if (this.mergedConfig.type === 'side-panel') {
|
|
171
|
-
return this.mergedConfig.panelWidth || this.mergedConfig.width || '400px';
|
|
172
|
-
}
|
|
173
|
-
if (this.mergedConfig.size) {
|
|
174
|
-
const sizeMap: Record<string, string> = {
|
|
175
|
-
sm: '400px',
|
|
176
|
-
md: '560px',
|
|
177
|
-
lg: '720px',
|
|
178
|
-
xl: '1200px'
|
|
179
|
-
};
|
|
180
|
-
return sizeMap[this.mergedConfig.size];
|
|
181
|
-
}
|
|
182
|
-
return this.mergedConfig.width || '560px';
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
getModalStyles(): any {
|
|
186
|
-
const styles: any = {};
|
|
187
|
-
const config = this.mergedConfig;
|
|
188
|
-
|
|
189
|
-
if (config.type === 'side-panel') {
|
|
190
|
-
const spacing = config.panelSpacing || '0px';
|
|
191
|
-
const pos = config.panelPosition || 'right';
|
|
192
|
-
|
|
193
|
-
// Set position and spacing
|
|
194
|
-
styles.position = 'fixed';
|
|
195
|
-
styles.top = spacing;
|
|
196
|
-
styles.bottom = spacing;
|
|
197
|
-
styles[pos] = spacing;
|
|
198
|
-
|
|
199
|
-
// Set dimensions
|
|
200
|
-
if (pos === 'left' || pos === 'right') {
|
|
201
|
-
styles.width = this.getModalWidth();
|
|
202
|
-
styles.height = config.panelHeight || `calc(100% - (${spacing} * 2))`;
|
|
203
|
-
} else {
|
|
204
|
-
styles.height = config.panelHeight || 'auto';
|
|
205
|
-
styles.width = config.panelWidth || `calc(100% - (${spacing} * 2))`;
|
|
206
|
-
styles.left = spacing;
|
|
207
|
-
styles.right = spacing;
|
|
208
|
-
if (pos === 'top') {
|
|
209
|
-
styles.bottom = 'auto';
|
|
210
|
-
} else {
|
|
211
|
-
styles.top = 'auto';
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
// Visual enhancements for panel
|
|
216
|
-
styles['border-radius'] = config.borderRadius || '12px';
|
|
217
|
-
styles['box-shadow'] = '0 10px 40px rgba(0,0,0,0.15)';
|
|
218
|
-
} else {
|
|
219
|
-
// Modal mode
|
|
220
|
-
styles.width = this.getModalWidth();
|
|
221
|
-
if (config.backgroundColor) styles['background-color'] = config.backgroundColor;
|
|
222
|
-
if (config.borderRadius) styles['border-radius'] = config.borderRadius;
|
|
223
|
-
if (config.padding) styles.padding = config.padding;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
return styles;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
getConfirmButtonClass(): string {
|
|
230
|
-
const typeMap: Record<string, string> = {
|
|
231
|
-
primary: 'cc-btn-primary',
|
|
232
|
-
danger: 'cc-btn-danger',
|
|
233
|
-
warning: 'cc-btn-warning'
|
|
234
|
-
};
|
|
235
|
-
const isLoading = this.confirmLoading || this.mergedConfig.confirmButton.loading;
|
|
236
|
-
return `cc-btn ${typeMap[this.mergedConfig.confirmButton.type]} ${isLoading ? 'cc-btn-loading' : ''}`;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
getHeaderClass(): string {
|
|
240
|
-
return `modal-header modal-header--${this.mergedConfig.headerTheme}`;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
resolveIconType(icon: any): 'material' | 'custom' | 'img' {
|
|
244
|
-
if (typeof icon === 'string') {
|
|
245
|
-
if (icon.includes('/') || icon.includes('.') || icon.startsWith('http')) {
|
|
246
|
-
return 'img';
|
|
247
|
-
}
|
|
248
|
-
return 'material';
|
|
249
|
-
}
|
|
250
|
-
if (icon && typeof icon === 'object') {
|
|
251
|
-
if (icon.type === 'custom' || (icon.value && (icon.value.includes('/') || icon.value.includes('.') || icon.value.startsWith('http')))) {
|
|
252
|
-
return 'custom';
|
|
253
|
-
}
|
|
254
|
-
return icon.type || 'material';
|
|
255
|
-
}
|
|
256
|
-
return 'material';
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
getIconValue(icon: any): string {
|
|
260
|
-
return typeof icon === 'string' ? icon : icon?.value;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
getIconColor(icon: any): string | undefined {
|
|
264
|
-
return typeof icon === 'object' ? icon.color : undefined;
|
|
265
|
-
}
|
|
266
|
-
}
|