commons-shared-web-ui 0.0.55 → 0.0.57
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 +15897 -0
- package/fesm2022/commons-shared-web-ui.mjs.map +1 -0
- package/index.d.ts +4916 -0
- package/package.json +34 -53
- package/src/lib/modules/button/button.theme.scss +4 -4
- 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 -2765
- 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/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 -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/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 -1330
- package/src/lib/modules/smart-form/components/form-field/form-field.component.scss +0 -2112
- package/src/lib/modules/smart-form/components/form-field/form-field.component.ts +0 -3006
- 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 -1131
- package/src/lib/modules/smart-form/index.ts +0 -10
- package/src/lib/modules/smart-form/models/form-schema.model.ts +0 -793
- 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 -67
- package/src/lib/modules/smart-form/smart-form.examples.ts +0 -1324
- package/src/lib/modules/smart-form/smart-form.module.ts +0 -38
- 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 -213
- 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,34 +0,0 @@
|
|
|
1
|
-
<nav
|
|
2
|
-
class="cc-nav"
|
|
3
|
-
[ngClass]="[variant, orientation]"
|
|
4
|
-
[ngStyle]="computedStyles"
|
|
5
|
-
role="tablist"
|
|
6
|
-
[attr.aria-orientation]="orientation">
|
|
7
|
-
|
|
8
|
-
<button
|
|
9
|
-
*ngFor="let item of items; trackBy: trackById"
|
|
10
|
-
class="cc-nav-item"
|
|
11
|
-
[class.active]="item.id === activeId"
|
|
12
|
-
[class.disabled]="item.disabled"
|
|
13
|
-
[disabled]="item.disabled"
|
|
14
|
-
role="tab"
|
|
15
|
-
[attr.aria-selected]="item.id === activeId"
|
|
16
|
-
[attr.aria-disabled]="item.disabled || null"
|
|
17
|
-
(click)="onItemClick(item)">
|
|
18
|
-
|
|
19
|
-
<!-- Icon (optional) -->
|
|
20
|
-
<span *ngIf="item.icon" class="cc-nav-item-icon">
|
|
21
|
-
<i [ngClass]="item.icon"></i>
|
|
22
|
-
</span>
|
|
23
|
-
|
|
24
|
-
<!-- Label -->
|
|
25
|
-
<span class="cc-nav-item-label">{{ item.label }}</span>
|
|
26
|
-
|
|
27
|
-
<!-- Badge (optional) -->
|
|
28
|
-
<span *ngIf="item.badge != null" class="cc-nav-item-badge">
|
|
29
|
-
{{ item.badge }}
|
|
30
|
-
</span>
|
|
31
|
-
|
|
32
|
-
</button>
|
|
33
|
-
|
|
34
|
-
</nav>
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
.cc-nav {
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
background-color: var(--cc-nav-container-bg);
|
|
5
|
-
padding: var(--cc-nav-container-padding);
|
|
6
|
-
border-radius: var(--cc-nav-container-radius);
|
|
7
|
-
border: var(--cc-nav-container-border);
|
|
8
|
-
gap: var(--cc-nav-container-gap);
|
|
9
|
-
font-family: var(--cc-nav-font-family);
|
|
10
|
-
font-size: var(--cc-nav-font-size);
|
|
11
|
-
box-sizing: border-box;
|
|
12
|
-
width: 100%;
|
|
13
|
-
|
|
14
|
-
/* ========================
|
|
15
|
-
Orientation
|
|
16
|
-
======================== */
|
|
17
|
-
&.horizontal {
|
|
18
|
-
flex-direction: row;
|
|
19
|
-
overflow-x: auto;
|
|
20
|
-
|
|
21
|
-
/* Hide scrollbar but keep scroll functionality */
|
|
22
|
-
-ms-overflow-style: none;
|
|
23
|
-
scrollbar-width: none;
|
|
24
|
-
|
|
25
|
-
&::-webkit-scrollbar {
|
|
26
|
-
display: none;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&.vertical {
|
|
31
|
-
flex-direction: column;
|
|
32
|
-
align-items: stretch;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/* ========================
|
|
36
|
-
Nav Item (Default State)
|
|
37
|
-
======================== */
|
|
38
|
-
.cc-nav-item {
|
|
39
|
-
display: inline-flex;
|
|
40
|
-
align-items: center;
|
|
41
|
-
gap: 6px;
|
|
42
|
-
padding: var(--cc-nav-item-padding);
|
|
43
|
-
border-radius: var(--cc-nav-item-radius);
|
|
44
|
-
border: var(--cc-nav-item-border);
|
|
45
|
-
background-color: var(--cc-nav-item-bg);
|
|
46
|
-
color: var(--cc-nav-item-color);
|
|
47
|
-
font-family: inherit;
|
|
48
|
-
font-size: inherit;
|
|
49
|
-
font-weight: var(--cc-nav-font-weight);
|
|
50
|
-
cursor: pointer;
|
|
51
|
-
white-space: nowrap;
|
|
52
|
-
user-select: none;
|
|
53
|
-
transition: all 0.2s ease;
|
|
54
|
-
position: relative;
|
|
55
|
-
outline: none;
|
|
56
|
-
margin-right: 0.3rem;
|
|
57
|
-
|
|
58
|
-
/* Hover */
|
|
59
|
-
&:hover:not(:disabled):not(.active) {
|
|
60
|
-
background-color: var(--cc-nav-item-hover-bg);
|
|
61
|
-
color: var(--cc-nav-item-hover-color);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/* Active */
|
|
65
|
-
&.active {
|
|
66
|
-
background-color: var(--cc-nav-item-active-bg);
|
|
67
|
-
color: var(--cc-nav-item-active-color);
|
|
68
|
-
font-weight: var(--cc-nav-item-active-font-weight);
|
|
69
|
-
box-shadow: var(--cc-nav-item-active-shadow);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/* Disabled */
|
|
73
|
-
&:disabled,
|
|
74
|
-
&.disabled {
|
|
75
|
-
opacity: var(--cc-nav-disabled-opacity);
|
|
76
|
-
cursor: not-allowed;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/* Icon */
|
|
80
|
-
.cc-nav-item-icon {
|
|
81
|
-
display: inline-flex;
|
|
82
|
-
align-items: center;
|
|
83
|
-
font-size: 1.1em;
|
|
84
|
-
line-height: 1;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/* Badge */
|
|
88
|
-
.cc-nav-item-badge {
|
|
89
|
-
display: inline-flex;
|
|
90
|
-
align-items: center;
|
|
91
|
-
justify-content: center;
|
|
92
|
-
min-width: var(--cc-nav-badge-size);
|
|
93
|
-
height: var(--cc-nav-badge-size);
|
|
94
|
-
border-radius: 50%;
|
|
95
|
-
background-color: var(--cc-nav-badge-bg);
|
|
96
|
-
color: var(--cc-nav-badge-color);
|
|
97
|
-
font-size: var(--cc-nav-badge-font-size);
|
|
98
|
-
font-weight: var(--cc-nav-badge-font-weight, 600);
|
|
99
|
-
padding: 0 4px;
|
|
100
|
-
line-height: 1;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/* ========================
|
|
105
|
-
Variant: filled (default)
|
|
106
|
-
======================== */
|
|
107
|
-
&.filled {
|
|
108
|
-
.cc-nav-item.active {
|
|
109
|
-
border-bottom: var(--cc-nav-item-active-border-width) solid var(--cc-nav-item-active-border-color);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/* ========================
|
|
114
|
-
Variant: underline
|
|
115
|
-
======================== */
|
|
116
|
-
&.underline {
|
|
117
|
-
background-color: transparent;
|
|
118
|
-
border-radius: 0;
|
|
119
|
-
padding: 0;
|
|
120
|
-
border-bottom: 1px solid #e0e0e0;
|
|
121
|
-
|
|
122
|
-
.cc-nav-item {
|
|
123
|
-
background-color: transparent;
|
|
124
|
-
border-radius: 0;
|
|
125
|
-
border: none;
|
|
126
|
-
border-bottom: var(--cc-nav-item-active-border-width) solid transparent;
|
|
127
|
-
box-shadow: none;
|
|
128
|
-
|
|
129
|
-
&:hover:not(:disabled):not(.active) {
|
|
130
|
-
background-color: transparent;
|
|
131
|
-
border-bottom-color: #ccc;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
&.active {
|
|
135
|
-
background-color: transparent;
|
|
136
|
-
border-bottom-color: var(--cc-nav-item-active-border-color);
|
|
137
|
-
box-shadow: none;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/* ========================
|
|
143
|
-
Variant: pills
|
|
144
|
-
======================== */
|
|
145
|
-
&.pills {
|
|
146
|
-
background-color: transparent;
|
|
147
|
-
padding: 0;
|
|
148
|
-
|
|
149
|
-
.cc-nav-item {
|
|
150
|
-
border-radius: 999px;
|
|
151
|
-
|
|
152
|
-
&.active {
|
|
153
|
-
border-radius: 999px;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/* ========================
|
|
159
|
-
Mobile Responsiveness
|
|
160
|
-
======================== */
|
|
161
|
-
@media (max-width: 600px) {
|
|
162
|
-
&.horizontal {
|
|
163
|
-
gap: 2px;
|
|
164
|
-
|
|
165
|
-
.cc-nav-item {
|
|
166
|
-
padding: 6px 12px;
|
|
167
|
-
font-size: 13px;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { Component, EventEmitter, Input, Output, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
-
import { NAV_VARIANT_DEFAULT, NAV_ORIENTATION_DEFAULT } from '../../../../utils/constants';
|
|
3
|
-
import { NavStyleConfig } from '../../nav.models';
|
|
4
|
-
|
|
5
|
-
export interface NavItem {
|
|
6
|
-
id: string | number;
|
|
7
|
-
label: string;
|
|
8
|
-
icon?: string;
|
|
9
|
-
badge?: string | number;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@Component({
|
|
14
|
-
selector: 'lib-nav',
|
|
15
|
-
templateUrl: './nav.component.html',
|
|
16
|
-
styleUrls: ['./nav.component.scss'],
|
|
17
|
-
standalone: false
|
|
18
|
-
})
|
|
19
|
-
export class NavComponent implements OnChanges {
|
|
20
|
-
@Input() items: NavItem[] = [];
|
|
21
|
-
@Input() activeId: string | number | null = null;
|
|
22
|
-
@Input() variant: 'filled' | 'underline' | 'pills' = NAV_VARIANT_DEFAULT;
|
|
23
|
-
@Input() orientation: 'horizontal' | 'vertical' = NAV_ORIENTATION_DEFAULT;
|
|
24
|
-
@Input() styleConfig: NavStyleConfig = {};
|
|
25
|
-
|
|
26
|
-
@Output() selectionChange = new EventEmitter<NavItem>();
|
|
27
|
-
|
|
28
|
-
ngOnChanges(changes: SimpleChanges): void {
|
|
29
|
-
if (changes['styleConfig']) {
|
|
30
|
-
console.log(' [NavComponent] styleConfig changed:', this.styleConfig);
|
|
31
|
-
console.log(' [NavComponent] computedStyles:', this.computedStyles);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
get computedStyles(): { [key: string]: string | undefined } {
|
|
36
|
-
const c = this.styleConfig;
|
|
37
|
-
return {
|
|
38
|
-
// Container (direct CSS)
|
|
39
|
-
'width': c.width,
|
|
40
|
-
'box-shadow': c.boxShadow,
|
|
41
|
-
|
|
42
|
-
// Container (CSS Variables)
|
|
43
|
-
'--cc-nav-container-bg': c.backgroundColor,
|
|
44
|
-
'--cc-nav-container-radius': c.borderRadius,
|
|
45
|
-
'--cc-nav-container-border': c.border,
|
|
46
|
-
'--cc-nav-container-padding': c.padding,
|
|
47
|
-
'--cc-nav-container-gap': c.gap,
|
|
48
|
-
|
|
49
|
-
// Item (CSS Variables)
|
|
50
|
-
'--cc-nav-font-size': c.fontSize,
|
|
51
|
-
'--cc-nav-font-weight': c.fontWeight,
|
|
52
|
-
'--cc-nav-item-color': c.itemColor,
|
|
53
|
-
'--cc-nav-item-radius': c.itemRadius,
|
|
54
|
-
'--cc-nav-item-padding': c.itemPadding,
|
|
55
|
-
|
|
56
|
-
// Active Item (CSS Variables)
|
|
57
|
-
'--cc-nav-item-active-bg': c.activeItemBg,
|
|
58
|
-
'--cc-nav-item-active-color': c.activeItemColor,
|
|
59
|
-
'--cc-nav-item-active-font-weight': c.activeItemFontWeight,
|
|
60
|
-
'--cc-nav-item-active-border-color': c.activeItemBorderColor,
|
|
61
|
-
|
|
62
|
-
// Hover Item (CSS Variables)
|
|
63
|
-
'--cc-nav-item-hover-bg': c.hoverItemBg,
|
|
64
|
-
'--cc-nav-item-hover-color': c.hoverItemColor,
|
|
65
|
-
|
|
66
|
-
// Badge (CSS Variables)
|
|
67
|
-
'--cc-nav-badge-bg': c.badgeBg,
|
|
68
|
-
'--cc-nav-badge-color': c.badgeColor,
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
onItemClick(item: NavItem): void {
|
|
73
|
-
if (item.disabled) return;
|
|
74
|
-
if (item.id === this.activeId) return;
|
|
75
|
-
|
|
76
|
-
this.selectionChange.emit(item);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
trackById(index: number, item: NavItem): string | number {
|
|
80
|
-
return item.id;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export interface NavStyleConfig {
|
|
2
|
-
// Container
|
|
3
|
-
width?: string;
|
|
4
|
-
backgroundColor?: string;
|
|
5
|
-
borderRadius?: string;
|
|
6
|
-
border?: string;
|
|
7
|
-
padding?: string;
|
|
8
|
-
gap?: string;
|
|
9
|
-
boxShadow?: string;
|
|
10
|
-
|
|
11
|
-
// Item
|
|
12
|
-
itemColor?: string;
|
|
13
|
-
itemRadius?: string;
|
|
14
|
-
itemPadding?: string;
|
|
15
|
-
fontSize?: string;
|
|
16
|
-
fontWeight?: string;
|
|
17
|
-
|
|
18
|
-
// Active Item
|
|
19
|
-
activeItemBg?: string;
|
|
20
|
-
activeItemColor?: string;
|
|
21
|
-
activeItemFontWeight?: string;
|
|
22
|
-
activeItemBorderColor?: string;
|
|
23
|
-
|
|
24
|
-
// Hover Item
|
|
25
|
-
hoverItemBg?: string;
|
|
26
|
-
hoverItemColor?: string;
|
|
27
|
-
|
|
28
|
-
// Badge
|
|
29
|
-
badgeBg?: string;
|
|
30
|
-
badgeColor?: string;
|
|
31
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { NavComponent } from './components/nav/nav.component';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@NgModule({
|
|
7
|
-
declarations: [
|
|
8
|
-
NavComponent
|
|
9
|
-
],
|
|
10
|
-
imports: [
|
|
11
|
-
CommonModule
|
|
12
|
-
],
|
|
13
|
-
exports: [
|
|
14
|
-
NavComponent
|
|
15
|
-
]
|
|
16
|
-
})
|
|
17
|
-
export class NavModule { }
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
<div class="cc-pagination" [ngClass]="theme">
|
|
2
|
-
<!-- Left Side: Items Info & Per Page -->
|
|
3
|
-
<div class="pagination-left" *ngIf="pageSizeOptions.length > 1 || totalItems > 0">
|
|
4
|
-
<span class="items-info">
|
|
5
|
-
{{ startItem }}-{{ endItem }} {{ labels.of }} {{ totalItems }} {{ labels.items }}
|
|
6
|
-
</span>
|
|
7
|
-
|
|
8
|
-
<div class="per-page-selector" *ngIf="pageSizeOptions.length > 1">
|
|
9
|
-
<div class="select-wrapper">
|
|
10
|
-
<select (change)="onItemsPerPageChange($event)">
|
|
11
|
-
<option *ngFor="let option of pageSizeOptions" [value]="option" [selected]="option === itemsPerPage">
|
|
12
|
-
{{ option }}
|
|
13
|
-
</option>
|
|
14
|
-
</select>
|
|
15
|
-
<span class="select-arrow"></span>
|
|
16
|
-
</div>
|
|
17
|
-
<span class="per-page-label">{{ labels.perPage }}</span>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
<!-- Right Side: Page Controls -->
|
|
22
|
-
<div class="pagination-right">
|
|
23
|
-
<button
|
|
24
|
-
class="page-btn prev-btn"
|
|
25
|
-
[disabled]="currentPage === 1"
|
|
26
|
-
(click)="prevPage()"
|
|
27
|
-
aria-label="Previous Page">
|
|
28
|
-
<span class="icon">‹</span>
|
|
29
|
-
</button>
|
|
30
|
-
|
|
31
|
-
<div class="page-numbers">
|
|
32
|
-
<ng-container *ngFor="let page of pages">
|
|
33
|
-
<button
|
|
34
|
-
*ngIf="page !== '...'"
|
|
35
|
-
class="page-btn number-btn"
|
|
36
|
-
[class.active]="page === currentPage"
|
|
37
|
-
(click)="onPageChange(page)">
|
|
38
|
-
{{ page }}
|
|
39
|
-
</button>
|
|
40
|
-
<span *ngIf="page === '...'" class="ellipsis">...</span>
|
|
41
|
-
</ng-container>
|
|
42
|
-
</div>
|
|
43
|
-
|
|
44
|
-
<button
|
|
45
|
-
class="page-btn next-btn"
|
|
46
|
-
[disabled]="currentPage === totalPages || totalPages === 0"
|
|
47
|
-
(click)="nextPage()"
|
|
48
|
-
aria-label="Next Page">
|
|
49
|
-
<span class="icon">›</span>
|
|
50
|
-
</button>
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
.cc-pagination {
|
|
2
|
-
display: flex;
|
|
3
|
-
justify-content: space-between;
|
|
4
|
-
align-items: center;
|
|
5
|
-
padding: 1rem;
|
|
6
|
-
font-family: var(--cc-pagination-font-family);
|
|
7
|
-
color: var(--cc-pagination-text-color);
|
|
8
|
-
font-size: var(--cc-pagination-font-size);
|
|
9
|
-
flex-wrap: wrap;
|
|
10
|
-
gap: 1rem;
|
|
11
|
-
width: 100%;
|
|
12
|
-
box-sizing: border-box;
|
|
13
|
-
|
|
14
|
-
/* Left Side: Items Info & Per Page */
|
|
15
|
-
.pagination-left {
|
|
16
|
-
display: flex;
|
|
17
|
-
align-items: center;
|
|
18
|
-
gap: 1.5rem;
|
|
19
|
-
flex-wrap: wrap;
|
|
20
|
-
|
|
21
|
-
.items-info {
|
|
22
|
-
white-space: nowrap;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.per-page-selector {
|
|
26
|
-
display: flex;
|
|
27
|
-
align-items: center;
|
|
28
|
-
gap: 0.5rem;
|
|
29
|
-
|
|
30
|
-
.select-wrapper {
|
|
31
|
-
position: relative;
|
|
32
|
-
display: inline-block;
|
|
33
|
-
|
|
34
|
-
select {
|
|
35
|
-
appearance: none;
|
|
36
|
-
background-color: var(--cc-pagination-select-bg);
|
|
37
|
-
border: var(--cc-pagination-select-border);
|
|
38
|
-
border-radius: var(--cc-pagination-select-radius);
|
|
39
|
-
padding: var(--cc-pagination-select-padding);
|
|
40
|
-
padding-right: 2rem; /* Space for arrow */
|
|
41
|
-
color: var(--cc-pagination-select-text-color);
|
|
42
|
-
font-family: inherit;
|
|
43
|
-
font-size: inherit;
|
|
44
|
-
cursor: pointer;
|
|
45
|
-
min-width: 60px;
|
|
46
|
-
|
|
47
|
-
&:focus {
|
|
48
|
-
outline: none;
|
|
49
|
-
box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/* Custom Arrow */
|
|
54
|
-
&::after {
|
|
55
|
-
content: '▼';
|
|
56
|
-
position: absolute;
|
|
57
|
-
right: 10px;
|
|
58
|
-
top: 50%;
|
|
59
|
-
transform: translateY(-50%);
|
|
60
|
-
font-size: 0.7em;
|
|
61
|
-
color: var(--cc-pagination-select-arrow-color);
|
|
62
|
-
pointer-events: none;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.per-page-label {
|
|
67
|
-
white-space: nowrap;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/* Right Side: Page Controls */
|
|
73
|
-
.pagination-right {
|
|
74
|
-
display: flex;
|
|
75
|
-
align-items: center;
|
|
76
|
-
gap: 0.5rem;
|
|
77
|
-
flex-wrap: wrap;
|
|
78
|
-
|
|
79
|
-
.page-btn {
|
|
80
|
-
display: flex;
|
|
81
|
-
align-items: center;
|
|
82
|
-
justify-content: center;
|
|
83
|
-
min-width: var(--cc-pagination-btn-size);
|
|
84
|
-
height: var(--cc-pagination-btn-size);
|
|
85
|
-
background-color: var(--cc-pagination-btn-bg);
|
|
86
|
-
border: var(--cc-pagination-btn-border);
|
|
87
|
-
border-radius: var(--cc-pagination-btn-radius);
|
|
88
|
-
color: var(--cc-pagination-btn-text-color);
|
|
89
|
-
font-family: inherit;
|
|
90
|
-
cursor: pointer;
|
|
91
|
-
transition: all 0.2s ease;
|
|
92
|
-
padding: 0 0.5rem;
|
|
93
|
-
user-select: none;
|
|
94
|
-
|
|
95
|
-
&:hover:not(:disabled) {
|
|
96
|
-
background-color: var(--cc-pagination-btn-hover-bg);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
&:disabled {
|
|
100
|
-
opacity: var(--cc-pagination-disabled-opacity);
|
|
101
|
-
background-color: var(--cc-pagination-disabled-bg);
|
|
102
|
-
cursor: not-allowed;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
&.active {
|
|
106
|
-
background-color: var(--cc-pagination-btn-active-bg);
|
|
107
|
-
border: var(--cc-pagination-btn-active-border);
|
|
108
|
-
color: var(--cc-pagination-btn-active-text);
|
|
109
|
-
font-weight: bold;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.icon {
|
|
113
|
-
font-size: 1.2em;
|
|
114
|
-
line-height: 1;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.page-numbers {
|
|
119
|
-
display: flex;
|
|
120
|
-
gap: 0.5rem;
|
|
121
|
-
flex-wrap: wrap; // Allow numbers to wrap on very small screens if needed
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.ellipsis {
|
|
125
|
-
display: flex;
|
|
126
|
-
align-items: center;
|
|
127
|
-
justify-content: center;
|
|
128
|
-
color: var(--cc-pagination-text-color);
|
|
129
|
-
width: 20px;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/* Mobile Responsiveness */
|
|
134
|
-
@media (max-width: 600px) {
|
|
135
|
-
flex-direction: column;
|
|
136
|
-
align-items: center;
|
|
137
|
-
gap: 1.5rem;
|
|
138
|
-
|
|
139
|
-
.pagination-left {
|
|
140
|
-
width: 100%;
|
|
141
|
-
justify-content: space-between;
|
|
142
|
-
order: 2; // Move controls below numbers on mobile if desired, or keep generic flow
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.pagination-right {
|
|
146
|
-
width: 100%;
|
|
147
|
-
justify-content: center;
|
|
148
|
-
order: 1; // Show page numbers first on mobile? Usually keep order or stack.
|
|
149
|
-
|
|
150
|
-
.page-numbers {
|
|
151
|
-
justify-content: center;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
|
|
2
|
-
import { DEFAULT_ITEMS_PER_PAGE, DEFAULT_PAGE_SIZE_OPTIONS, PAGINATION_THEME_DEFAULT } from '../../../../utils/constants';
|
|
3
|
-
|
|
4
|
-
export interface PaginationLabels {
|
|
5
|
-
items: string;
|
|
6
|
-
of: string;
|
|
7
|
-
perPage: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
@Component({
|
|
11
|
-
selector: 'lib-pagination',
|
|
12
|
-
templateUrl: './pagination.component.html',
|
|
13
|
-
styleUrls: ['./pagination.component.scss'],
|
|
14
|
-
standalone: false
|
|
15
|
-
})
|
|
16
|
-
export class PaginationComponent implements OnInit, OnChanges {
|
|
17
|
-
@Input() totalItems: number = 0;
|
|
18
|
-
@Input() itemsPerPage: number = DEFAULT_ITEMS_PER_PAGE;
|
|
19
|
-
@Input() currentPage: number = 1;
|
|
20
|
-
@Input() pageSizeOptions: number[] = DEFAULT_PAGE_SIZE_OPTIONS;
|
|
21
|
-
@Input() theme: 'theme-1' | 'theme-2' = PAGINATION_THEME_DEFAULT;
|
|
22
|
-
@Input() labels: PaginationLabels = {
|
|
23
|
-
items: 'items',
|
|
24
|
-
of: 'of',
|
|
25
|
-
perPage: 'Per Page'
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
@Output() pageChange = new EventEmitter<number>();
|
|
29
|
-
@Output() itemsPerPageChange = new EventEmitter<number>();
|
|
30
|
-
|
|
31
|
-
totalPages: number = 0;
|
|
32
|
-
pages: (number | string)[] = [];
|
|
33
|
-
startItem: number = 0;
|
|
34
|
-
endItem: number = 0;
|
|
35
|
-
|
|
36
|
-
constructor() { }
|
|
37
|
-
|
|
38
|
-
ngOnInit(): void {
|
|
39
|
-
this.calculatePagination();
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
ngOnChanges(changes: SimpleChanges): void {
|
|
43
|
-
if (changes['totalItems'] || changes['itemsPerPage'] || changes['currentPage']) {
|
|
44
|
-
this.calculatePagination();
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
calculatePagination(): void {
|
|
49
|
-
this.totalPages = Math.ceil(this.totalItems / this.itemsPerPage);
|
|
50
|
-
|
|
51
|
-
// Ensure current page is valid
|
|
52
|
-
if (this.currentPage < 1) {
|
|
53
|
-
this.currentPage = 1;
|
|
54
|
-
} else if (this.currentPage > this.totalPages && this.totalPages > 0) {
|
|
55
|
-
this.currentPage = this.totalPages;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
this.startItem = (this.currentPage - 1) * this.itemsPerPage + 1;
|
|
59
|
-
this.endItem = Math.min(this.currentPage * this.itemsPerPage, this.totalItems);
|
|
60
|
-
|
|
61
|
-
if (this.totalItems === 0) {
|
|
62
|
-
this.startItem = 0;
|
|
63
|
-
this.endItem = 0;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
this.pages = this.getVisiblePages(this.currentPage, this.totalPages);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
getVisiblePages(current: number, total: number): (number | string)[] {
|
|
70
|
-
if (total <= 7) {
|
|
71
|
-
return Array.from({ length: total }, (_, i) => i + 1);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (current <= 4) {
|
|
75
|
-
return [1, 2, 3, 4, 5, '...', total];
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (current >= total - 3) {
|
|
79
|
-
return [1, '...', total - 4, total - 3, total - 2, total - 1, total];
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return [1, '...', current - 1, current, current + 1, '...', total];
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
onPageChange(page: number | string): void {
|
|
86
|
-
if (typeof page === 'string') return;
|
|
87
|
-
if (page < 1 || page > this.totalPages || page === this.currentPage) return;
|
|
88
|
-
|
|
89
|
-
this.pageChange.emit(page);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
onItemsPerPageChange(event: Event): void {
|
|
93
|
-
const target = event.target as HTMLSelectElement;
|
|
94
|
-
const newSize = Number(target.value);
|
|
95
|
-
this.itemsPerPageChange.emit(newSize);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
nextPage(): void {
|
|
99
|
-
if (this.currentPage < this.totalPages) {
|
|
100
|
-
this.onPageChange(this.currentPage + 1);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
prevPage(): void {
|
|
105
|
-
if (this.currentPage > 1) {
|
|
106
|
-
this.onPageChange(this.currentPage - 1);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { NgModule } from '@angular/core';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { PaginationComponent } from './components/pagination/pagination.component';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@NgModule({
|
|
7
|
-
declarations: [
|
|
8
|
-
PaginationComponent
|
|
9
|
-
],
|
|
10
|
-
imports: [
|
|
11
|
-
CommonModule
|
|
12
|
-
],
|
|
13
|
-
exports: [
|
|
14
|
-
PaginationComponent
|
|
15
|
-
]
|
|
16
|
-
})
|
|
17
|
-
export class PaginationModule { }
|