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
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
display: block;
|
|
3
|
-
height: 100%;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.sidebar {
|
|
7
|
-
position: relative;
|
|
8
|
-
display: flex;
|
|
9
|
-
flex-direction: column;
|
|
10
|
-
align-items: center;
|
|
11
|
-
width: calc(var(--navigation-rail-nav-rail-collapsed-nav-rail-collapsed-container-width, 96) * 1px);
|
|
12
|
-
min-width: calc(var(--navigation-rail-nav-rail-collapsed-nav-rail-collapsed-container-width, 96) * 1px);
|
|
13
|
-
height: 100%;
|
|
14
|
-
padding: calc(var(--navigation-rail-nav-rail-collapsed-nav-rail-collapsed-item-top-space, 44) * 1px) 0
|
|
15
|
-
calc(var(--navigation-rail-nav-rail-collapsed-nav-rail-collapsed-item-vertical-space, 4) * 1px);
|
|
16
|
-
box-sizing: border-box;
|
|
17
|
-
gap: calc(var(--navigation-rail-nav-rail-collapsed-nav-rail-collapsed-item-vertical-space, 4) * 1px);
|
|
18
|
-
background-color: var(--navigation-rail-nav-rail-collapsed-nav-rail-collapsed-container-color, #ebeef0);
|
|
19
|
-
border-radius: calc(var(--navigation-rail-nav-rail-collapsed-nav-rail-collapsed-container-shape, 0) * 1px);
|
|
20
|
-
color: var(--navigation-rail-nav-rail-item-vertical-nav-rail-item-vertical-text-color, #434749);
|
|
21
|
-
transition: width 280ms ease, min-width 280ms ease, padding 280ms ease;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.sidebar--show-labels {
|
|
25
|
-
align-items: stretch;
|
|
26
|
-
width: calc(var(--navigation-rail-nav-rail-expanded-nav-rail-expanded-container-width-minimum, 220) * 1px);
|
|
27
|
-
min-width: calc(var(--navigation-rail-nav-rail-expanded-nav-rail-expanded-container-width-minimum, 220) * 1px);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.sidebar__header,
|
|
31
|
-
.sidebar__footer {
|
|
32
|
-
display: flex;
|
|
33
|
-
justify-content: center;
|
|
34
|
-
padding-inline: calc(var(--navigation-rail-nav-rail-item-vertical-nav-rail-item-vertical-leading-space, 16) * 1px);
|
|
35
|
-
width: 100%;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.sidebar__header {
|
|
39
|
-
min-height: calc(var(--navigation-rail-nav-rail-item-common-nav-rail-item-header-space-minimum, 40) * 1px);
|
|
40
|
-
align-items: center;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.sidebar__header:empty,
|
|
44
|
-
.sidebar__footer:empty {
|
|
45
|
-
display: none;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.sidebar__nav {
|
|
49
|
-
flex: 1;
|
|
50
|
-
display: flex;
|
|
51
|
-
flex-direction: column;
|
|
52
|
-
width: 100%;
|
|
53
|
-
padding: 0 var(--padding-container-main, 16px) 0;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.sidebar__list {
|
|
57
|
-
list-style: none;
|
|
58
|
-
margin: 0;
|
|
59
|
-
padding: 0;
|
|
60
|
-
display: flex;
|
|
61
|
-
flex-direction: column;
|
|
62
|
-
align-items: center;
|
|
63
|
-
gap: calc(var(--navigation-rail-nav-rail-item-common-nav-rail-item-container-vertical-space, 6) * 1px);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.sidebar--show-labels .sidebar__list {
|
|
67
|
-
align-items: stretch;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.sidebar__item {
|
|
71
|
-
width: 100%;
|
|
72
|
-
display: flex;
|
|
73
|
-
align-items: center;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.sidebar--show-labels .sidebar__item {
|
|
77
|
-
justify-content: flex-start;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.sidebar__button {
|
|
81
|
-
position: relative;
|
|
82
|
-
display: flex;
|
|
83
|
-
justify-content: center;
|
|
84
|
-
width: auto;
|
|
85
|
-
max-width: 100%;
|
|
86
|
-
height: calc(var(--navigation-rail-nav-rail-item-common-nav-rail-item-container-height, 64) * 1px);
|
|
87
|
-
margin: 0;
|
|
88
|
-
padding-inline: 0;
|
|
89
|
-
padding-block: 0;
|
|
90
|
-
border: 0;
|
|
91
|
-
background: none;
|
|
92
|
-
cursor: pointer;
|
|
93
|
-
color: var(--navigation-rail-nav-rail-item-common-nav-rail-item-icon-color, #181c1e);
|
|
94
|
-
text-decoration: none;
|
|
95
|
-
transition:
|
|
96
|
-
color 180ms ease,
|
|
97
|
-
height 320ms ease,
|
|
98
|
-
max-width 320ms ease,
|
|
99
|
-
padding 320ms ease;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.sidebar__button--expanded {
|
|
103
|
-
align-self: center;
|
|
104
|
-
width: auto;
|
|
105
|
-
max-width: 100%;
|
|
106
|
-
height: calc(var(--navigation-rail-nav-rail-item-common-nav-rail-item-container-height, 64) * 1px);
|
|
107
|
-
justify-content: flex-start;
|
|
108
|
-
padding-inline: 0;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.sidebar__button:focus-visible {
|
|
112
|
-
outline: 2px solid var(--navigation-rail-nav-rail-item-common-nav-rail-item-focus-indicator, #5b5f61);
|
|
113
|
-
outline-offset: 4px;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.sidebar__button:disabled {
|
|
117
|
-
cursor: default;
|
|
118
|
-
opacity: 0.48;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.sidebar__active {
|
|
122
|
-
position: relative;
|
|
123
|
-
display: inline-flex;
|
|
124
|
-
align-items: center;
|
|
125
|
-
justify-content: center;
|
|
126
|
-
gap: calc(var(--navigation-rail-nav-rail-item-common-nav-rail-item-active-indicator-icon-label-space, 8) * 1px);
|
|
127
|
-
height: calc(var(--navigation-rail-nav-rail-item-vertical-nav-rail-item-vertical-active-indicator-height, 32) * 1px);
|
|
128
|
-
padding-inline: calc(var(--navigation-rail-nav-rail-item-common-nav-rail-item-active-indicator-leading-space, 16) * 1px)
|
|
129
|
-
calc(var(--navigation-rail-nav-rail-item-common-nav-rail-item-active-indicator-trailing-space, 16) * 1px);
|
|
130
|
-
border-radius: calc(var(--navigation-rail-nav-rail-item-common-nav-rail-item-active-indicator-shape, 1000) * 1px);
|
|
131
|
-
background-color: transparent;
|
|
132
|
-
transition:
|
|
133
|
-
background-color 180ms ease,
|
|
134
|
-
color 180ms ease,
|
|
135
|
-
gap 320ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
136
|
-
padding 320ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
137
|
-
width 320ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
138
|
-
max-width 320ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
139
|
-
max-width: calc(var(--navigation-rail-nav-rail-expanded-nav-rail-expanded-container-width-minimum, 220) * 1px);
|
|
140
|
-
overflow: hidden;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.sidebar__button--expanded .sidebar__active,
|
|
144
|
-
.sidebar__active--expanded {
|
|
145
|
-
width: auto;
|
|
146
|
-
max-width: 100%;
|
|
147
|
-
height: 100%;
|
|
148
|
-
align-items: center;
|
|
149
|
-
justify-content: flex-start;
|
|
150
|
-
padding-inline: calc(var(--navigation-rail-nav-rail-item-horizontal-nav-rail-item-horizontal-full-width-leading-space, 16) * 1px);
|
|
151
|
-
gap: calc(var(--navigation-rail-nav-rail-item-horizontal-nav-rail-item-horizontal-icon-label-space, 8) * 1px);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.sidebar__button:not(:disabled):hover .sidebar__active {
|
|
155
|
-
background-color: rgba(24, 28, 30, 0.08);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.sidebar__button:not(:disabled):active .sidebar__active {
|
|
159
|
-
background-color: rgba(24, 28, 30, 0.12);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.sidebar__button--selected .sidebar__active {
|
|
163
|
-
background-color: var(--navigation-rail-nav-rail-item-common-nav-rail-item-container-selected-color, #e42313);
|
|
164
|
-
color: var(--navigation-rail-nav-rail-item-common-nav-rail-item-icon-selected-color, #ffffff);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.sidebar__button--selected:not(:disabled):hover .sidebar__active {
|
|
168
|
-
background-color: rgba(228, 35, 19, 0.88);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.sidebar__button--selected:not(:disabled):active .sidebar__active {
|
|
172
|
-
background-color: rgba(228, 35, 19, 0.76);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.sidebar__icon {
|
|
176
|
-
display: flex;
|
|
177
|
-
align-items: center;
|
|
178
|
-
justify-content: center;
|
|
179
|
-
width: calc(var(--navigation-rail-nav-rail-item-common-nav-rail-item-icon-size, 24) * 1px);
|
|
180
|
-
height: calc(var(--navigation-rail-nav-rail-item-common-nav-rail-item-icon-size, 24) * 1px);
|
|
181
|
-
color: currentColor;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.sidebar__icon-svg,
|
|
185
|
-
.sidebar__icon-img {
|
|
186
|
-
width: 100%;
|
|
187
|
-
height: 100%;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.sidebar__icon-svg {
|
|
191
|
-
fill: currentColor;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
.sidebar__icon-img {
|
|
195
|
-
object-fit: contain;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.sidebar__label {
|
|
199
|
-
flex: 1 1 auto;
|
|
200
|
-
min-width: 0;
|
|
201
|
-
font-size: 0.8125rem;
|
|
202
|
-
font-weight: 600;
|
|
203
|
-
letter-spacing: 0.01em;
|
|
204
|
-
line-height: 1.2;
|
|
205
|
-
color: inherit;
|
|
206
|
-
white-space: nowrap;
|
|
207
|
-
overflow: hidden;
|
|
208
|
-
text-overflow: ellipsis;
|
|
209
|
-
max-width: 100%;
|
|
210
|
-
transition: opacity 200ms ease;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
.sidebar__accessory {
|
|
214
|
-
display: flex;
|
|
215
|
-
align-items: center;
|
|
216
|
-
justify-content: center;
|
|
217
|
-
width: 16px;
|
|
218
|
-
height: 16px;
|
|
219
|
-
margin-left: auto;
|
|
220
|
-
color: inherit;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
.sidebar__accessory-svg,
|
|
224
|
-
.sidebar__accessory-img {
|
|
225
|
-
width: 100%;
|
|
226
|
-
height: 100%;
|
|
227
|
-
fill: currentColor;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
.sidebar__footer {
|
|
231
|
-
margin-top: auto;
|
|
232
|
-
align-items: flex-end;
|
|
233
|
-
padding-bottom: calc(var(--navigation-rail-nav-rail-collapsed-nav-rail-collapsed-item-vertical-space, 4) * 1px);
|
|
234
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
<aside class="sidebar" role="navigation" aria-label="Navegación principal" [class.sidebar--show-labels]="hasLabels()">
|
|
2
|
-
<div class="sidebar__header">
|
|
3
|
-
<ng-content select="[sidebar-header]"></ng-content>
|
|
4
|
-
</div>
|
|
5
|
-
|
|
6
|
-
<nav class="sidebar__nav" aria-label="Secciones">
|
|
7
|
-
<ul class="sidebar__list">
|
|
8
|
-
@for (item of items(); track trackById($index, item)) {
|
|
9
|
-
<li
|
|
10
|
-
class="sidebar__item"
|
|
11
|
-
[class.sidebar__item--selected]="isSelected(item)"
|
|
12
|
-
[class.sidebar__item--disabled]="item.disabled"
|
|
13
|
-
>
|
|
14
|
-
<button
|
|
15
|
-
type="button"
|
|
16
|
-
class="sidebar__button"
|
|
17
|
-
[class.sidebar__button--expanded]="hasLabels()"
|
|
18
|
-
[class.sidebar__button--selected]="isSelected(item)"
|
|
19
|
-
[attr.aria-label]="item.ariaLabel ?? item.label"
|
|
20
|
-
[attr.aria-current]="isSelected(item) ? 'page' : null"
|
|
21
|
-
[attr.title]="shouldShowLabel(item) ? null : (item.ariaLabel || item.label)"
|
|
22
|
-
[disabled]="item.disabled"
|
|
23
|
-
(click)="onSelect(item)"
|
|
24
|
-
>
|
|
25
|
-
<span class="sidebar__active" [class.sidebar__active--expanded]="hasLabels()">
|
|
26
|
-
@if (iconRef(item); as iconSrc) {
|
|
27
|
-
<span class="sidebar__icon" aria-hidden="true">
|
|
28
|
-
<ng-container
|
|
29
|
-
[ngTemplateOutlet]="renderIcon"
|
|
30
|
-
[ngTemplateOutletContext]="{ $implicit: iconSrc, svgClass: 'sidebar__icon-svg', imgClass: 'sidebar__icon-img' }"
|
|
31
|
-
></ng-container>
|
|
32
|
-
</span>
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@if (shouldShowLabel(item)) {
|
|
36
|
-
<span class="sidebar__label">{{ item.label }}</span>
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
@if (accessoryRef(item); as accessorySrc) {
|
|
40
|
-
<span class="sidebar__accessory" aria-hidden="true">
|
|
41
|
-
<ng-container
|
|
42
|
-
[ngTemplateOutlet]="renderIcon"
|
|
43
|
-
[ngTemplateOutletContext]="{ $implicit: accessorySrc, svgClass: 'sidebar__accessory-svg', imgClass: 'sidebar__accessory-img' }"
|
|
44
|
-
></ng-container>
|
|
45
|
-
</span>
|
|
46
|
-
}
|
|
47
|
-
</span>
|
|
48
|
-
</button>
|
|
49
|
-
</li>
|
|
50
|
-
}
|
|
51
|
-
</ul>
|
|
52
|
-
</nav>
|
|
53
|
-
|
|
54
|
-
<div class="sidebar__footer">
|
|
55
|
-
<ng-content select="[sidebar-footer]"></ng-content>
|
|
56
|
-
</div>
|
|
57
|
-
|
|
58
|
-
<ng-template #renderIcon let-src let-svgClass="svgClass" let-imgClass="imgClass">
|
|
59
|
-
@if (isSprite(src)) {
|
|
60
|
-
<svg [attr.class]="svgClass">
|
|
61
|
-
<use [attr.href]="src"></use>
|
|
62
|
-
</svg>
|
|
63
|
-
} @else {
|
|
64
|
-
<img [attr.class]="imgClass" [src]="src" alt="" />
|
|
65
|
-
}
|
|
66
|
-
</ng-template>
|
|
67
|
-
</aside>
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, EventEmitter, Output, computed, input } from '@angular/core';
|
|
2
|
-
import { NgTemplateOutlet } from '@angular/common';
|
|
3
|
-
|
|
4
|
-
export interface SidebarNavItem {
|
|
5
|
-
id: string;
|
|
6
|
-
label: string;
|
|
7
|
-
icon: string;
|
|
8
|
-
iconPath?: string;
|
|
9
|
-
accessoryIcon?: string;
|
|
10
|
-
accessoryIconPath?: string;
|
|
11
|
-
ariaLabel?: string;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
@Component({
|
|
16
|
-
selector: 'lib-sidebar',
|
|
17
|
-
standalone: true,
|
|
18
|
-
imports: [NgTemplateOutlet],
|
|
19
|
-
templateUrl: './sidebar.html',
|
|
20
|
-
styleUrl: './sidebar.css',
|
|
21
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
22
|
-
})
|
|
23
|
-
export class SidebarComponent {
|
|
24
|
-
readonly items = input<readonly SidebarNavItem[]>([]);
|
|
25
|
-
readonly selectedId = input<string | null>(null);
|
|
26
|
-
readonly showLabels = input(true);
|
|
27
|
-
readonly spritePath = input('assets/icons/sprite.svg');
|
|
28
|
-
|
|
29
|
-
@Output() readonly itemSelected = new EventEmitter<SidebarNavItem>();
|
|
30
|
-
|
|
31
|
-
protected readonly hasLabels = computed(() => this.showLabels() && this.items().some(({ label }) => !!label));
|
|
32
|
-
|
|
33
|
-
protected onSelect(item: SidebarNavItem): void {
|
|
34
|
-
if (item.disabled) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
this.itemSelected.emit(item);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
protected isSelected(item: SidebarNavItem): boolean {
|
|
42
|
-
return item.id === this.selectedId();
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
protected trackById(_index: number, item: SidebarNavItem): string {
|
|
46
|
-
return item.id;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
protected iconHref(icon: string): string {
|
|
50
|
-
return `${this.spritePath()}#${icon}`;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
protected accessoryHref(accessoryIcon: string): string {
|
|
54
|
-
return `${this.spritePath()}#${accessoryIcon}`;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
protected iconRef(item: SidebarNavItem): string | null {
|
|
58
|
-
if (item.iconPath) {
|
|
59
|
-
return item.iconPath;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (item.icon) {
|
|
63
|
-
return this.iconHref(item.icon);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
protected accessoryRef(item: SidebarNavItem): string | null {
|
|
70
|
-
if (item.accessoryIconPath) {
|
|
71
|
-
return item.accessoryIconPath;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (item.accessoryIcon) {
|
|
75
|
-
return this.accessoryHref(item.accessoryIcon);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return null;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
protected isSprite(ref: string | null | undefined): ref is string {
|
|
82
|
-
return !!ref && ref.includes('#');
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
protected shouldShowLabel(item: SidebarNavItem): boolean {
|
|
86
|
-
if (!item.label) {
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return this.showLabels();
|
|
91
|
-
}
|
|
92
|
-
}
|
|
File without changes
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Component, input, output } from '@angular/core';
|
|
2
|
-
import { MatSlideToggleModule, MatSlideToggleChange } from '@angular/material/slide-toggle';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'lib-slide-toggle, slide-toggle',
|
|
6
|
-
standalone: true,
|
|
7
|
-
imports: [MatSlideToggleModule],
|
|
8
|
-
templateUrl: './slide-toggle.html',
|
|
9
|
-
styleUrl: './slide-toggle.css',
|
|
10
|
-
})
|
|
11
|
-
export class SlideToggle {
|
|
12
|
-
checked = input(false);
|
|
13
|
-
checkedChange = output<boolean>();
|
|
14
|
-
|
|
15
|
-
onChange(event: MatSlideToggleChange) {
|
|
16
|
-
this.checkedChange.emit(event.checked);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Component, input } from '@angular/core';
|
|
2
|
-
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'lib-spinner, spinner',
|
|
6
|
-
standalone: true,
|
|
7
|
-
imports: [MatProgressSpinnerModule],
|
|
8
|
-
templateUrl: './spinner.html',
|
|
9
|
-
styleUrl: './spinner.css',
|
|
10
|
-
})
|
|
11
|
-
export class LibSpinnerComponent {
|
|
12
|
-
diameter = input<number>(48);
|
|
13
|
-
strokeWidth = input<number>(4);
|
|
14
|
-
color = input<string>('var(--Rojo-400, #e30613)');
|
|
15
|
-
ariaLabel = input<string>('Cargando');
|
|
16
|
-
}
|
|
17
|
-
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
:host.ui-tooltip-host {
|
|
2
|
-
display: inline-flex;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.ui-tooltip {
|
|
6
|
-
display: inline-flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
justify-content: center;
|
|
9
|
-
min-height: 24px;
|
|
10
|
-
padding: 4px 8px;
|
|
11
|
-
border-radius: calc(var(--tooltips-plain-enabled-container-plain-tooltip-container-shape, 4) * 1px);
|
|
12
|
-
background: var(--tooltips-plain-enabled-container-plain-tooltip-container-color, #2d3133);
|
|
13
|
-
box-sizing: border-box;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.ui-tooltip__text {
|
|
17
|
-
color: var(--tooltips-plain-enabled-supporting-text-plain-tooltip-supporting-text-color, #eef1f3);
|
|
18
|
-
font-family: var(--tooltips-plain-enabled-supporting-text-plain-tooltip-supporting-text-font, 'Heebo'), sans-serif;
|
|
19
|
-
font-size: var(--tooltips-plain-enabled-supporting-text-plain-tooltip-supporting-text-size, 12px);
|
|
20
|
-
font-style: normal;
|
|
21
|
-
font-weight: var(--tooltips-plain-enabled-supporting-text-plain-tooltip-supporting-text-weight, 400);
|
|
22
|
-
line-height: calc(var(--tooltips-plain-enabled-supporting-text-plain-tooltip-supporting-text-line-height, 16) * 1px);
|
|
23
|
-
letter-spacing: var(--tooltips-plain-enabled-supporting-text-plain-tooltip-supporting-text-tracking, 0.4px);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.ui-tooltip--single-line .ui-tooltip__text {
|
|
27
|
-
white-space: nowrap;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.ui-tooltip--multi-line .ui-tooltip__text {
|
|
31
|
-
white-space: normal;
|
|
32
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
2
|
-
import { NgClass } from '@angular/common';
|
|
3
|
-
|
|
4
|
-
export type LibTooltipType = 'single-line' | 'multi-line';
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'lib-tooltip',
|
|
8
|
-
standalone: true,
|
|
9
|
-
imports: [NgClass],
|
|
10
|
-
templateUrl: './tooltip.html',
|
|
11
|
-
styleUrl: './tooltip.css',
|
|
12
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
13
|
-
host: {
|
|
14
|
-
'[class.ui-tooltip-host]': 'true',
|
|
15
|
-
},
|
|
16
|
-
})
|
|
17
|
-
export class LibTooltipComponent {
|
|
18
|
-
/** Texto del tooltip. */
|
|
19
|
-
text = input('Supporting text');
|
|
20
|
-
|
|
21
|
-
/** Variante del tooltip según Figma: single-line o multi-line. */
|
|
22
|
-
type = input<LibTooltipType>('single-line');
|
|
23
|
-
|
|
24
|
-
/** Ancho máximo opcional para controlar el wrap en multi-line (ej: "12.5rem", "200px"). */
|
|
25
|
-
maxWidth = input<string | null>(null);
|
|
26
|
-
|
|
27
|
-
readonly classes = computed(() => ({
|
|
28
|
-
'ui-tooltip--single-line': this.type() === 'single-line',
|
|
29
|
-
'ui-tooltip--multi-line': this.type() === 'multi-line',
|
|
30
|
-
}));
|
|
31
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { DomSanitizer } from '@angular/platform-browser';
|
|
2
|
-
import { MatIconRegistry } from '@angular/material/icon';
|
|
3
|
-
|
|
4
|
-
const DEFAULT_ICON_BASE_PATH = 'assets/icons';
|
|
5
|
-
|
|
6
|
-
const ICON_MENU_FILE = 'icon-menu.svg';
|
|
7
|
-
const LOGO_FILE = 'logo.svg';
|
|
8
|
-
const SMILEY_FILE = 'smiley.svg';
|
|
9
|
-
|
|
10
|
-
const ICON_FILE_MAP = Object.freeze({
|
|
11
|
-
CollapseMenu: ICON_MENU_FILE,
|
|
12
|
-
'collapse-menu': ICON_MENU_FILE,
|
|
13
|
-
'icon-menu': ICON_MENU_FILE,
|
|
14
|
-
|
|
15
|
-
logo: LOGO_FILE,
|
|
16
|
-
'credix-logo': LOGO_FILE,
|
|
17
|
-
smiley: SMILEY_FILE,
|
|
18
|
-
'error-circle': 'error-circle.svg',
|
|
19
|
-
'info-error': 'info-error.svg',
|
|
20
|
-
'configuration-countable': 'configuration-countable.svg',
|
|
21
|
-
edit: 'edit.svg',
|
|
22
|
-
'edit-table': 'edit-table.svg',
|
|
23
|
-
hub: 'hub.svg',
|
|
24
|
-
logout: 'logout.svg',
|
|
25
|
-
notifications: 'notifications.svg',
|
|
26
|
-
profile: 'profile.svg',
|
|
27
|
-
'profile-user-menu': 'profile-user-menu.svg',
|
|
28
|
-
visibility: 'visibility-eye.svg',
|
|
29
|
-
check: 'success-check_icon.svg',
|
|
30
|
-
'gif-icon-massive': 'gif-icon.svg',
|
|
31
|
-
'background-color-massive': 'background-color-massive.svg',
|
|
32
|
-
'content-edit-massive': 'trailing-icon.svg',
|
|
33
|
-
'edit-massive': 'edit-massive.svg',
|
|
34
|
-
'edit-massive-white': 'edit-white.svg',
|
|
35
|
-
'edit-gray': 'edit-gray.svg',
|
|
36
|
-
'check-update': 'check-update.svg',
|
|
37
|
-
'download-simple': 'download-simple.svg',
|
|
38
|
-
'download-file': 'download-file.svg',
|
|
39
|
-
'content-copy': 'content-copy.svg',
|
|
40
|
-
'add-create': 'add-create.svg',
|
|
41
|
-
'add-create-dark': 'add-create-dark.svg',
|
|
42
|
-
'add-create-dark-icon': 'add-create-dark-icon.svg',
|
|
43
|
-
'add-circle-filled': 'add_circle_filled.svg',
|
|
44
|
-
'add-circle-tonal': 'add_circle_tonal.svg',
|
|
45
|
-
'add-circle-outlined': 'add_circle_outline.svg',
|
|
46
|
-
'add-circle-elevated': 'add_circle_text.svg',
|
|
47
|
-
'add-circle-text': 'add_circle_text.svg',
|
|
48
|
-
} satisfies Record<string, string>);
|
|
49
|
-
|
|
50
|
-
function normalizeBasePath(basePath?: string): string {
|
|
51
|
-
const targetPath = basePath ?? DEFAULT_ICON_BASE_PATH;
|
|
52
|
-
|
|
53
|
-
if (/^(https?:)?\/\//.test(targetPath)) {
|
|
54
|
-
return targetPath.replace(/\/$/, '');
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return targetPath.replace(/\/$/, '');
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export type UiIconName = keyof typeof ICON_FILE_MAP;
|
|
61
|
-
|
|
62
|
-
export const UI_ICON_NAMES = Object.keys(ICON_FILE_MAP) as UiIconName[];
|
|
63
|
-
|
|
64
|
-
export interface RegisterUiIconOptions {
|
|
65
|
-
basePath?: string;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export function resolveUiIconResource(
|
|
69
|
-
iconName: UiIconName,
|
|
70
|
-
options?: RegisterUiIconOptions
|
|
71
|
-
): string {
|
|
72
|
-
const fileName = ICON_FILE_MAP[iconName];
|
|
73
|
-
|
|
74
|
-
if (!fileName) {
|
|
75
|
-
throw new Error(`Icon "${iconName}" is not registered in ICON_FILE_MAP.`);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return `${normalizeBasePath(options?.basePath)}/${fileName}`;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export function registerUiIcons(
|
|
82
|
-
registry: MatIconRegistry,
|
|
83
|
-
sanitizer: DomSanitizer,
|
|
84
|
-
icons: UiIconName[] = UI_ICON_NAMES,
|
|
85
|
-
options?: RegisterUiIconOptions
|
|
86
|
-
): void {
|
|
87
|
-
const basePath = normalizeBasePath(options?.basePath);
|
|
88
|
-
|
|
89
|
-
icons.forEach((iconName) => {
|
|
90
|
-
const fileName = ICON_FILE_MAP[iconName];
|
|
91
|
-
if (!fileName) {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const resourceUrl = `${basePath}/${fileName}`;
|
|
96
|
-
registry.addSvgIcon(
|
|
97
|
-
iconName,
|
|
98
|
-
sanitizer.bypassSecurityTrustResourceUrl(resourceUrl)
|
|
99
|
-
);
|
|
100
|
-
});
|
|
101
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<p>LibUi works!</p>
|
|
File without changes
|
package/src/lib/lib-ui/lib-ui.ts
DELETED
package/tsconfig.json
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "es2022",
|
|
4
|
-
"module": "preserve",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"strict": true,
|
|
7
|
-
"noImplicitOverride": true,
|
|
8
|
-
"noPropertyAccessFromIndexSignature": true,
|
|
9
|
-
"noImplicitReturns": true,
|
|
10
|
-
"noFallthroughCasesInSwitch": true,
|
|
11
|
-
"emitDecoratorMetadata": false,
|
|
12
|
-
"experimentalDecorators": true,
|
|
13
|
-
"useDefineForClassFields": false,
|
|
14
|
-
"forceConsistentCasingInFileNames": true,
|
|
15
|
-
"skipLibCheck": true,
|
|
16
|
-
"lib": ["es2022", "dom"]
|
|
17
|
-
},
|
|
18
|
-
"angularCompilerOptions": {
|
|
19
|
-
"enableI18nLegacyMessageIdFormat": false,
|
|
20
|
-
"strictInjectionParameters": true,
|
|
21
|
-
"strictInputAccessModifiers": true,
|
|
22
|
-
"strictTemplates": true,
|
|
23
|
-
"skipTemplateCodegen": true
|
|
24
|
-
},
|
|
25
|
-
"files": [],
|
|
26
|
-
"include": [],
|
|
27
|
-
"references": [
|
|
28
|
-
{ "path": "./tsconfig.lib.json" }
|
|
29
|
-
]
|
|
30
|
-
}
|