crdx-components 1.0.0 → 1.0.1
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/crdx-components.mjs +1624 -0
- package/fesm2022/crdx-components.mjs.map +1 -0
- package/package.json +19 -14
- package/types/crdx-components.d.ts +749 -0
- package/.github/workflows/publish.yml +0 -38
- package/bun.lock +0 -491
- package/crdx-components-1.0.0.tgz +0 -0
- package/crdx-components-tokenized-components-1.0.1.tgz +0 -0
- package/ng-package.json +0 -12
- package/npm +0 -0
- package/src/index.ts +0 -45
- package/src/lib/components/breadcrumb/breadcrumb.component.css +0 -206
- package/src/lib/components/breadcrumb/breadcrumb.component.html +0 -15
- package/src/lib/components/breadcrumb/breadcrumb.component.ts +0 -47
- package/src/lib/components/button/button.css +0 -371
- package/src/lib/components/button/button.html +0 -187
- package/src/lib/components/button/button.ts +0 -103
- package/src/lib/components/card/card.css +0 -285
- package/src/lib/components/card/card.html +0 -69
- package/src/lib/components/card/card.ts +0 -93
- package/src/lib/components/checkbox/checkbox-showcase.component.css +0 -42
- package/src/lib/components/checkbox/checkbox-showcase.component.html +0 -36
- package/src/lib/components/checkbox/checkbox-showcase.component.ts +0 -13
- package/src/lib/components/checkbox/checkbox.css +0 -10
- package/src/lib/components/checkbox/checkbox.html +0 -13
- package/src/lib/components/checkbox/checkbox.ts +0 -64
- package/src/lib/components/circular-progress-stepper/circular-progress-stepper.css +0 -89
- package/src/lib/components/circular-progress-stepper/circular-progress-stepper.html +0 -23
- package/src/lib/components/circular-progress-stepper/circular-progress-stepper.ts +0 -40
- package/src/lib/components/dialogs/alert-modal/alert-modal.css +0 -118
- package/src/lib/components/dialogs/alert-modal/alert-modal.html +0 -29
- package/src/lib/components/dialogs/alert-modal/alert-modal.ts +0 -28
- package/src/lib/components/dialogs/confirm-modal/confirm-modal.css +0 -219
- package/src/lib/components/dialogs/confirm-modal/confirm-modal.html +0 -60
- package/src/lib/components/dialogs/confirm-modal/confirm-modal.store.ts +0 -139
- package/src/lib/components/dialogs/confirm-modal/confirm-modal.ts +0 -63
- package/src/lib/components/dialogs/container-custom/container-custom.css +0 -11
- package/src/lib/components/dialogs/container-custom/container-custom.html +0 -3
- package/src/lib/components/dialogs/container-custom/container-custom.ts +0 -37
- package/src/lib/components/dialogs/container-custom/custom-modal.state.ts +0 -57
- package/src/lib/components/dialogs/error-modal/error-modal.css +0 -53
- package/src/lib/components/dialogs/error-modal/error-modal.html +0 -17
- package/src/lib/components/dialogs/error-modal/error-modal.ts +0 -20
- package/src/lib/components/dialogs/side-modal/side-modal.css +0 -80
- package/src/lib/components/dialogs/side-modal/side-modal.html +0 -30
- package/src/lib/components/dialogs/side-modal/side-modal.state.ts +0 -78
- package/src/lib/components/dialogs/side-modal/side-modal.ts +0 -50
- package/src/lib/components/divider/divider.css +0 -24
- package/src/lib/components/divider/divider.html +0 -7
- package/src/lib/components/divider/divider.ts +0 -13
- package/src/lib/components/footer-actions/footer/footer-flow.store.ts +0 -30
- package/src/lib/components/footer-actions/footer/footer.html +0 -14
- package/src/lib/components/footer-actions/footer/footer.ts +0 -50
- package/src/lib/components/footer-actions/modal-footer-actions/modal-footer-actions.css +0 -44
- package/src/lib/components/footer-actions/modal-footer-actions/modal-footer-actions.html +0 -7
- package/src/lib/components/footer-actions/modal-footer-actions/modal-footer-actions.ts +0 -12
- package/src/lib/components/footer-actions/page-footer-actions/page-footer-actions.css +0 -31
- package/src/lib/components/footer-actions/page-footer-actions/page-footer-actions.html +0 -7
- package/src/lib/components/footer-actions/page-footer-actions/page-footer-actions.ts +0 -12
- package/src/lib/components/form-field/select-field.css +0 -178
- package/src/lib/components/form-field/select-field.html +0 -94
- package/src/lib/components/form-field/select-field.ts +0 -324
- package/src/lib/components/form-field/text-field.css +0 -41
- package/src/lib/components/form-field/text-field.html +0 -38
- package/src/lib/components/form-field/text-field.ts +0 -102
- package/src/lib/components/header/header.css +0 -142
- package/src/lib/components/header/header.html +0 -36
- package/src/lib/components/header/header.ts +0 -101
- package/src/lib/components/icon-button/icon-button.css +0 -445
- package/src/lib/components/icon-button/icon-button.html +0 -15
- package/src/lib/components/icon-button/icon-button.ts +0 -49
- package/src/lib/components/list-item/list-item.css +0 -122
- package/src/lib/components/list-item/list-item.html +0 -79
- package/src/lib/components/list-item/list-item.ts +0 -104
- package/src/lib/components/menu/menu.css +0 -39
- package/src/lib/components/menu/menu.html +0 -57
- package/src/lib/components/menu/menu.ts +0 -159
- package/src/lib/components/shared-table/shared-table-cell-template.directive.ts +0 -25
- package/src/lib/components/shared-table/shared-table.component.css +0 -223
- package/src/lib/components/shared-table/shared-table.component.html +0 -96
- package/src/lib/components/shared-table/shared-table.component.ts +0 -172
- package/src/lib/components/sidebar/sidebar.css +0 -234
- package/src/lib/components/sidebar/sidebar.html +0 -67
- package/src/lib/components/sidebar/sidebar.ts +0 -92
- package/src/lib/components/slide-toggle/slide-toggle.css +0 -0
- package/src/lib/components/slide-toggle/slide-toggle.html +0 -3
- package/src/lib/components/slide-toggle/slide-toggle.ts +0 -18
- package/src/lib/components/spinner/spinner.css +0 -9
- package/src/lib/components/spinner/spinner.html +0 -9
- package/src/lib/components/spinner/spinner.ts +0 -17
- package/src/lib/components/tooltip/tooltip.css +0 -32
- package/src/lib/components/tooltip/tooltip.html +0 -3
- package/src/lib/components/tooltip/tooltip.ts +0 -31
- package/src/lib/icons/register-icons.ts +0 -101
- package/src/lib/lib-ui/lib-ui.html +0 -1
- package/src/lib/lib-ui/lib-ui.scss +0 -0
- package/src/lib/lib-ui/lib-ui.ts +0 -9
- package/tsconfig.json +0 -30
- package/tsconfig.lib.json +0 -20
package/ng-package.json
DELETED
package/npm
DELETED
|
File without changes
|
package/src/index.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export * from './lib/lib-ui/lib-ui';
|
|
2
|
-
export * from './lib/icons/register-icons';
|
|
3
|
-
|
|
4
|
-
// Core data display/navigation.
|
|
5
|
-
export * from './lib/components/shared-table/shared-table.component';
|
|
6
|
-
export * from './lib/components/breadcrumb/breadcrumb.component';
|
|
7
|
-
export * from './lib/components/sidebar/sidebar';
|
|
8
|
-
export * from './lib/components/header/header';
|
|
9
|
-
|
|
10
|
-
// Inputs and selections.
|
|
11
|
-
export * from './lib/components/form-field/text-field';
|
|
12
|
-
export * from './lib/components/form-field/select-field';
|
|
13
|
-
export * from './lib/components/list-item/list-item';
|
|
14
|
-
export * from './lib/components/checkbox/checkbox';
|
|
15
|
-
export * from './lib/components/checkbox/checkbox-showcase.component';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated Prefer `lib-select-field` for new implementations.
|
|
19
|
-
* Kept for compatibility during migration window.
|
|
20
|
-
*/
|
|
21
|
-
export * from './lib/components/menu/menu';
|
|
22
|
-
|
|
23
|
-
// Actions and affordances.
|
|
24
|
-
export * from './lib/components/button/button';
|
|
25
|
-
export * from './lib/components/icon-button/icon-button';
|
|
26
|
-
export * from './lib/components/slide-toggle/slide-toggle';
|
|
27
|
-
export * from './lib/components/circular-progress-stepper/circular-progress-stepper';
|
|
28
|
-
export * from './lib/components/spinner/spinner';
|
|
29
|
-
export * from './lib/components/divider/divider';
|
|
30
|
-
export * from './lib/components/tooltip/tooltip';
|
|
31
|
-
export * from './lib/components/card/card';
|
|
32
|
-
|
|
33
|
-
// Dialogs and modal containers.
|
|
34
|
-
export * from './lib/components/dialogs/confirm-modal/confirm-modal';
|
|
35
|
-
export * from './lib/components/dialogs/confirm-modal/confirm-modal.store';
|
|
36
|
-
export * from './lib/components/dialogs/side-modal/side-modal';
|
|
37
|
-
export * from './lib/components/dialogs/side-modal/side-modal.state';
|
|
38
|
-
|
|
39
|
-
// Footer layouts.
|
|
40
|
-
export * from './lib/components/footer-actions/page-footer-actions/page-footer-actions';
|
|
41
|
-
export * from './lib/components/footer-actions/modal-footer-actions/modal-footer-actions';
|
|
42
|
-
export * from './lib/components/footer-actions/footer/footer';
|
|
43
|
-
export * from './lib/components/footer-actions/footer/footer-flow.store';
|
|
44
|
-
|
|
45
|
-
export const LIB_UI_STYLES_PATH = './lib/styles/index.scss';
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
.shared-breadcrumb {
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
gap: 0.5rem;
|
|
5
|
-
padding: 0;
|
|
6
|
-
color: var(
|
|
7
|
-
--breadcrumbs-label-enabled-breadcrumb-enabled-label-text-color,
|
|
8
|
-
var(--pallete-scheme-surface-on-surface-variant, #434749)
|
|
9
|
-
);
|
|
10
|
-
font-family: var(--breadcrumbs-label-enabled-breadcrumb-label-text-font, Heebo);
|
|
11
|
-
font-size: var(--breadcrumbs-label-enabled-breadcrumb-label-text-size, 14px);
|
|
12
|
-
font-style: normal;
|
|
13
|
-
font-weight: var(--breadcrumbs-label-enabled-breadcrumb-label-text-weight, 400);
|
|
14
|
-
line-height: calc(var(--breadcrumbs-label-enabled-breadcrumb-label-text-line-height, 20) * 1px);
|
|
15
|
-
letter-spacing: var(--breadcrumbs-label-enabled-breadcrumb-label-text-tracking, 0.25px);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.shared-breadcrumb__parent {
|
|
19
|
-
display: inline-flex;
|
|
20
|
-
align-items: center;
|
|
21
|
-
gap: 0.5rem;
|
|
22
|
-
border: none;
|
|
23
|
-
background: none;
|
|
24
|
-
padding: 0.625rem 0.75rem;
|
|
25
|
-
border-radius: 100px;
|
|
26
|
-
position: relative;
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
font: inherit;
|
|
29
|
-
font-weight: var(
|
|
30
|
-
--breadcrumbs-label-enabled-breadcrumb-label-text-weight,
|
|
31
|
-
400
|
|
32
|
-
);
|
|
33
|
-
color: inherit;
|
|
34
|
-
cursor: pointer;
|
|
35
|
-
transition: color 150ms ease, background-color 150ms ease;
|
|
36
|
-
/* Token ya contiene RGBA con alpha baked-in: usar directo, sin color-mix adicional. */
|
|
37
|
-
--breadcrumb-ripple-color: var(
|
|
38
|
-
--breadcrumbs-label-pressed-breadcrumb-pressed-ripple-color,
|
|
39
|
-
rgba(24, 28, 30, 0.08)
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.shared-breadcrumb__parent::after {
|
|
44
|
-
content: '';
|
|
45
|
-
position: absolute;
|
|
46
|
-
right: 0;
|
|
47
|
-
bottom: 0;
|
|
48
|
-
width: 48px;
|
|
49
|
-
height: 28px;
|
|
50
|
-
background-color: var(--breadcrumb-ripple-color);
|
|
51
|
-
-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='28' viewBox='0 0 48 28' fill='none'><path d='M48 3.12389V28H0C0 12.536 14.7249 0 32.8889 0C38.3368 0 43.4753 1.12771 48 3.12389Z' fill='black'/></svg>");
|
|
52
|
-
mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='28' viewBox='0 0 48 28' fill='none'><path d='M48 3.12389V28H0C0 12.536 14.7249 0 32.8889 0C38.3368 0 43.4753 1.12771 48 3.12389Z' fill='black'/></svg>");
|
|
53
|
-
-webkit-mask-repeat: no-repeat;
|
|
54
|
-
mask-repeat: no-repeat;
|
|
55
|
-
-webkit-mask-size: contain;
|
|
56
|
-
mask-size: contain;
|
|
57
|
-
opacity: 0;
|
|
58
|
-
pointer-events: none;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.shared-breadcrumb__parent:hover,
|
|
62
|
-
.shared-breadcrumb__parent:focus-visible {
|
|
63
|
-
color: var(
|
|
64
|
-
--breadcrumbs-label-hovered-breadcrumb-hovered-label-text-color,
|
|
65
|
-
var(--pallete-scheme-surface-on-surface, #181c1e)
|
|
66
|
-
);
|
|
67
|
-
background-color: var(
|
|
68
|
-
--breadcrumbs-label-hovered-breadcrumb-hovered-state-layer-color,
|
|
69
|
-
rgba(24, 28, 30, 0.08)
|
|
70
|
-
);
|
|
71
|
-
outline: none;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.shared-breadcrumb__parent:focus-visible {
|
|
75
|
-
outline: calc(
|
|
76
|
-
var(--breadcrumbs-label-focused-breadcrumb-focused-indicator-weight, 3) * 1px
|
|
77
|
-
)
|
|
78
|
-
solid var(--breadcrumbs-label-focused-breadcrumb-focused-indicator-color, #5b5f61);
|
|
79
|
-
outline-offset: 2px;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.shared-breadcrumb__parent:active {
|
|
83
|
-
color: var(
|
|
84
|
-
--breadcrumbs-label-pressed-breadcrumb-pressed-label-text-color,
|
|
85
|
-
var(--pallete-scheme-surface-on-surface, #181c1e)
|
|
86
|
-
);
|
|
87
|
-
background-color: var(
|
|
88
|
-
--breadcrumbs-label-pressed-breadcrumb-pressed-state-layer-color,
|
|
89
|
-
rgba(24, 28, 30, 0.1)
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.shared-breadcrumb__parent:active::after {
|
|
94
|
-
opacity: 1;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.shared-breadcrumb__separator {
|
|
98
|
-
display: inline-flex;
|
|
99
|
-
align-items: center;
|
|
100
|
-
color: var(--breadcrumbs-divider-breadcrumb-divider-color, #181c1e);
|
|
101
|
-
text-align: center;
|
|
102
|
-
font-family: var(--breadcrumbs-divider-breadcrumb-divider-text-font, Heebo);
|
|
103
|
-
font-size: var(--breadcrumbs-divider-breadcrumb-divider-text-size, 14px);
|
|
104
|
-
font-style: normal;
|
|
105
|
-
font-weight: var(--breadcrumbs-divider-breadcrumb-divider-text-weight, 400);
|
|
106
|
-
line-height: calc(var(--breadcrumbs-divider-breadcrumb-divider-text-line-height, 20) * 1px);
|
|
107
|
-
letter-spacing: var(--breadcrumbs-divider-breadcrumb-divider-text-tracking, 0.25px);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.shared-breadcrumb__current {
|
|
111
|
-
display: inline-flex;
|
|
112
|
-
align-items: center;
|
|
113
|
-
padding: 0.625rem 0.75rem;
|
|
114
|
-
gap: 0.5rem;
|
|
115
|
-
border-radius: 100px;
|
|
116
|
-
position: relative;
|
|
117
|
-
overflow: hidden;
|
|
118
|
-
cursor: pointer;
|
|
119
|
-
font-weight: var(
|
|
120
|
-
--breadcrumbs-label-selected-breadcrumb-selected-label-text-weight,
|
|
121
|
-
700
|
|
122
|
-
);
|
|
123
|
-
color: var(
|
|
124
|
-
--breadcrumbs-label-selected-breadcrumb-selected-label-hovered-text-color,
|
|
125
|
-
var(--pallete-scheme-surface-on-surface, #181c1e)
|
|
126
|
-
);
|
|
127
|
-
letter-spacing: var(--breadcrumbs-label-selected-breadcrumb-selected-label-text-tracking, 0.1px);
|
|
128
|
-
/* Token ya contiene RGBA con alpha baked-in: usar directo, sin color-mix adicional. */
|
|
129
|
-
--breadcrumb-ripple-color: var(
|
|
130
|
-
--breadcrumbs-label-pressed-breadcrumb-pressed-ripple-color,
|
|
131
|
-
rgba(24, 28, 30, 0.08)
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.shared-breadcrumb__current::after {
|
|
136
|
-
content: '';
|
|
137
|
-
position: absolute;
|
|
138
|
-
right: 0;
|
|
139
|
-
bottom: 0;
|
|
140
|
-
width: 48px;
|
|
141
|
-
height: 28px;
|
|
142
|
-
background-color: var(--breadcrumb-ripple-color);
|
|
143
|
-
-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='28' viewBox='0 0 48 28' fill='none'><path d='M48 3.12389V28H0C0 12.536 14.7249 0 32.8889 0C38.3368 0 43.4753 1.12771 48 3.12389Z' fill='black'/></svg>");
|
|
144
|
-
mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='28' viewBox='0 0 48 28' fill='none'><path d='M48 3.12389V28H0C0 12.536 14.7249 0 32.8889 0C38.3368 0 43.4753 1.12771 48 3.12389Z' fill='black'/></svg>");
|
|
145
|
-
-webkit-mask-repeat: no-repeat;
|
|
146
|
-
mask-repeat: no-repeat;
|
|
147
|
-
-webkit-mask-size: contain;
|
|
148
|
-
mask-size: contain;
|
|
149
|
-
opacity: 0;
|
|
150
|
-
pointer-events: none;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.shared-breadcrumb__current:hover,
|
|
154
|
-
.shared-breadcrumb__current:focus-visible {
|
|
155
|
-
background-color: var(
|
|
156
|
-
--breadcrumbs-label-hovered-breadcrumb-hovered-state-layer-color,
|
|
157
|
-
rgba(24, 28, 30, 0.08)
|
|
158
|
-
);
|
|
159
|
-
outline: none;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.shared-breadcrumb__current:active {
|
|
163
|
-
color: var(
|
|
164
|
-
--breadcrumbs-label-pressed-breadcrumb-pressed-label-text-color,
|
|
165
|
-
#181c1e
|
|
166
|
-
);
|
|
167
|
-
background-color: var(
|
|
168
|
-
--breadcrumbs-label-pressed-breadcrumb-pressed-state-layer-color,
|
|
169
|
-
rgba(24, 28, 30, 0.1)
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.shared-breadcrumb__current:active::after {
|
|
174
|
-
opacity: 1;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
.shared-breadcrumb__current-label {
|
|
178
|
-
position: relative;
|
|
179
|
-
z-index: 1;
|
|
180
|
-
text-align: center;
|
|
181
|
-
font-size: var(--breadcrumbs-label-enabled-breadcrumb-label-text-size, 14px);
|
|
182
|
-
font-style: normal;
|
|
183
|
-
line-height: calc(var(--breadcrumbs-label-enabled-breadcrumb-label-text-line-height, 20) * 1px);
|
|
184
|
-
letter-spacing: var(--breadcrumbs-label-enabled-breadcrumb-label-text-tracking, 0.25px);
|
|
185
|
-
font-weight: inherit;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
.shared-breadcrumb__parent-label {
|
|
189
|
-
position: relative;
|
|
190
|
-
z-index: 1;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
.shared-breadcrumb__current:active .shared-breadcrumb__current-label {
|
|
194
|
-
font-weight: var(
|
|
195
|
-
--breadcrumbs-label-enabled-breadcrumb-label-text-weight,
|
|
196
|
-
400
|
|
197
|
-
);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.shared-breadcrumb__current:hover .shared-breadcrumb__current-label,
|
|
201
|
-
.shared-breadcrumb__current:focus-visible .shared-breadcrumb__current-label {
|
|
202
|
-
font-weight: var(
|
|
203
|
-
--breadcrumbs-label-enabled-breadcrumb-label-text-weight,
|
|
204
|
-
400
|
|
205
|
-
);
|
|
206
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<nav class="shared-breadcrumb" *ngIf="currentLabel() || parentLabel()">
|
|
2
|
-
@if (parentLabel()) {
|
|
3
|
-
<button
|
|
4
|
-
type="button"
|
|
5
|
-
class="shared-breadcrumb__parent"
|
|
6
|
-
(click)="navigateToParent()"
|
|
7
|
-
>
|
|
8
|
-
<span class="shared-breadcrumb__parent-label">{{ parentLabel() }}</span>
|
|
9
|
-
</button>
|
|
10
|
-
<span class="shared-breadcrumb__separator">/</span>
|
|
11
|
-
}
|
|
12
|
-
<span class="shared-breadcrumb__current">
|
|
13
|
-
<span class="shared-breadcrumb__current-label">{{ currentLabel() }}</span>
|
|
14
|
-
</span>
|
|
15
|
-
</nav>
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { ChangeDetectionStrategy, Component, EventEmitter, OnInit, Output, inject, signal } from '@angular/core';
|
|
3
|
-
import { ActivatedRoute, Router } from '@angular/router';
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'lib-breadcrumb, shared-breadcrumb',
|
|
6
|
-
standalone: true,
|
|
7
|
-
imports: [CommonModule],
|
|
8
|
-
templateUrl: './breadcrumb.component.html',
|
|
9
|
-
styleUrl: './breadcrumb.component.css',
|
|
10
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11
|
-
})
|
|
12
|
-
export class SharedBreadcrumbComponent implements OnInit {
|
|
13
|
-
private readonly route = inject(ActivatedRoute, { optional: true });
|
|
14
|
-
private readonly router = inject(Router, { optional: true });
|
|
15
|
-
@Output() parentNavigate = new EventEmitter<string>();
|
|
16
|
-
|
|
17
|
-
readonly parentLabel = signal<string>('');
|
|
18
|
-
readonly parentUrl = signal<string>('');
|
|
19
|
-
readonly currentLabel = signal<string>('');
|
|
20
|
-
|
|
21
|
-
ngOnInit(): void {
|
|
22
|
-
const currentRoute = this.route;
|
|
23
|
-
if (!currentRoute) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const parentRoute = currentRoute.parent;
|
|
28
|
-
const parentData = parentRoute?.snapshot.data ?? {};
|
|
29
|
-
const currentData = currentRoute.snapshot.data ?? {};
|
|
30
|
-
|
|
31
|
-
const parentLabel = parentData['breadcrumb'] ?? currentData['parentBreadcrumb'] ?? '';
|
|
32
|
-
const parentUrl = parentData['url'] ?? currentData['parentUrl'] ?? '/';
|
|
33
|
-
const currentLabel = currentData['breadcrumb'] ?? '';
|
|
34
|
-
|
|
35
|
-
this.parentLabel.set(parentLabel);
|
|
36
|
-
this.parentUrl.set(parentUrl);
|
|
37
|
-
this.currentLabel.set(currentLabel);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
navigateToParent(): void {
|
|
41
|
-
const target = this.parentUrl();
|
|
42
|
-
if (target) {
|
|
43
|
-
this.parentNavigate.emit(target);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|