@ngb-bootstrap/core 0.0.0 → 0.1.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/NOTICE +18 -0
- package/README.md +26 -0
- package/fesm2022/ngb-bootstrap-core-alert.mjs +154 -0
- package/fesm2022/ngb-bootstrap-core-alert.mjs.map +1 -0
- package/fesm2022/ngb-bootstrap-core-badge.mjs +100 -0
- package/fesm2022/ngb-bootstrap-core-badge.mjs.map +1 -0
- package/fesm2022/ngb-bootstrap-core-breadcrumb.mjs +135 -0
- package/fesm2022/ngb-bootstrap-core-breadcrumb.mjs.map +1 -0
- package/fesm2022/ngb-bootstrap-core-button.mjs +513 -0
- package/fesm2022/ngb-bootstrap-core-button.mjs.map +1 -0
- package/fesm2022/ngb-bootstrap-core-card.mjs +540 -0
- package/fesm2022/ngb-bootstrap-core-card.mjs.map +1 -0
- package/fesm2022/ngb-bootstrap-core-cdk.mjs +282 -0
- package/fesm2022/ngb-bootstrap-core-cdk.mjs.map +1 -0
- package/fesm2022/ngb-bootstrap-core-checkbox.mjs +165 -0
- package/fesm2022/ngb-bootstrap-core-checkbox.mjs.map +1 -0
- package/fesm2022/ngb-bootstrap-core-chips.mjs +512 -0
- package/fesm2022/ngb-bootstrap-core-chips.mjs.map +1 -0
- package/fesm2022/ngb-bootstrap-core-floating-label.mjs +83 -0
- package/fesm2022/ngb-bootstrap-core-floating-label.mjs.map +1 -0
- package/fesm2022/ngb-bootstrap-core-footer.mjs +48 -0
- package/fesm2022/ngb-bootstrap-core-footer.mjs.map +1 -0
- package/fesm2022/ngb-bootstrap-core-icon.mjs +243 -0
- package/fesm2022/ngb-bootstrap-core-icon.mjs.map +1 -0
- package/fesm2022/ngb-bootstrap-core-input.mjs +540 -0
- package/fesm2022/ngb-bootstrap-core-input.mjs.map +1 -0
- package/fesm2022/ngb-bootstrap-core-layout.mjs +272 -0
- package/fesm2022/ngb-bootstrap-core-layout.mjs.map +1 -0
- package/fesm2022/ngb-bootstrap-core-navbar.mjs +150 -0
- package/fesm2022/ngb-bootstrap-core-navbar.mjs.map +1 -0
- package/fesm2022/ngb-bootstrap-core-radio.mjs +279 -0
- package/fesm2022/ngb-bootstrap-core-radio.mjs.map +1 -0
- package/fesm2022/ngb-bootstrap-core-sidebar.mjs +425 -0
- package/fesm2022/ngb-bootstrap-core-sidebar.mjs.map +1 -0
- package/fesm2022/ngb-bootstrap-core-spinner.mjs +126 -0
- package/fesm2022/ngb-bootstrap-core-spinner.mjs.map +1 -0
- package/fesm2022/ngb-bootstrap-core-switch.mjs +147 -0
- package/fesm2022/ngb-bootstrap-core-switch.mjs.map +1 -0
- package/fesm2022/ngb-bootstrap-core.mjs +69 -0
- package/fesm2022/ngb-bootstrap-core.mjs.map +1 -0
- package/ngb-bootstrap.css +827 -0
- package/package.json +118 -4
- package/styles/_breadcrumb.scss +9 -0
- package/styles/_button.scss +14 -0
- package/styles/_card.scss +86 -0
- package/styles/_chip.scss +10 -0
- package/styles/_choice.scss +14 -0
- package/styles/_contrast.scss +23 -0
- package/styles/_icon.scss +62 -0
- package/styles/_index.scss +33 -0
- package/styles/_input.scss +9 -0
- package/styles/_layout.scss +602 -0
- package/styles/_overlay.scss +14 -0
- package/styles/_tokens.scss +29 -0
- package/styles/_typography.scss +77 -0
- package/styles/ngb-bootstrap.scss +2 -0
- package/types/ngb-bootstrap-core-alert.d.ts +65 -0
- package/types/ngb-bootstrap-core-badge.d.ts +38 -0
- package/types/ngb-bootstrap-core-breadcrumb.d.ts +32 -0
- package/types/ngb-bootstrap-core-button.d.ts +177 -0
- package/types/ngb-bootstrap-core-card.d.ts +154 -0
- package/types/ngb-bootstrap-core-cdk.d.ts +165 -0
- package/types/ngb-bootstrap-core-checkbox.d.ts +53 -0
- package/types/ngb-bootstrap-core-chips.d.ts +170 -0
- package/types/ngb-bootstrap-core-floating-label.d.ts +22 -0
- package/types/ngb-bootstrap-core-footer.d.ts +16 -0
- package/types/ngb-bootstrap-core-icon.d.ts +99 -0
- package/types/ngb-bootstrap-core-input.d.ts +208 -0
- package/types/ngb-bootstrap-core-layout.d.ts +102 -0
- package/types/ngb-bootstrap-core-navbar.d.ts +33 -0
- package/types/ngb-bootstrap-core-radio.d.ts +96 -0
- package/types/ngb-bootstrap-core-sidebar.d.ts +62 -0
- package/types/ngb-bootstrap-core-spinner.d.ts +49 -0
- package/types/ngb-bootstrap-core-switch.d.ts +44 -0
- package/types/ngb-bootstrap-core.d.ts +82 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component } from "@angular/core";
|
|
3
|
+
var NgbFooter = class NgbFooter {
|
|
4
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
5
|
+
minVersion: "12.0.0",
|
|
6
|
+
version: "22.2.3",
|
|
7
|
+
ngImport: i0,
|
|
8
|
+
type: NgbFooter,
|
|
9
|
+
deps: [],
|
|
10
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
11
|
+
});
|
|
12
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
13
|
+
minVersion: "14.0.0",
|
|
14
|
+
version: "22.2.3",
|
|
15
|
+
type: NgbFooter,
|
|
16
|
+
isStandalone: true,
|
|
17
|
+
selector: "ngb-footer",
|
|
18
|
+
host: {
|
|
19
|
+
attributes: { "role": "contentinfo" },
|
|
20
|
+
classAttribute: "ngb-footer"
|
|
21
|
+
},
|
|
22
|
+
ngImport: i0,
|
|
23
|
+
template: "<ng-content />",
|
|
24
|
+
isInline: true,
|
|
25
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
29
|
+
minVersion: "12.0.0",
|
|
30
|
+
version: "22.2.3",
|
|
31
|
+
ngImport: i0,
|
|
32
|
+
type: NgbFooter,
|
|
33
|
+
decorators: [{
|
|
34
|
+
type: Component,
|
|
35
|
+
args: [{
|
|
36
|
+
selector: "ngb-footer",
|
|
37
|
+
template: "<ng-content />",
|
|
38
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
39
|
+
host: {
|
|
40
|
+
class: "ngb-footer",
|
|
41
|
+
role: "contentinfo"
|
|
42
|
+
}
|
|
43
|
+
}]
|
|
44
|
+
}]
|
|
45
|
+
});
|
|
46
|
+
export { NgbFooter };
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=ngb-bootstrap-core-footer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngb-bootstrap-core-footer.mjs","names":[],"sources":["../../../../projects/core/footer/footer.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\n\n/**\n * Page footer in the Taiga UI docs style: small secondary text, laid out as a wrapping row. Inside\n * `<ngb-layout-content>` it is its own panel below the content; elsewhere it has a top divider.\n *\n * ```html\n * <ngb-footer>\n * <span>© 2026 My app</span>\n * <nav aria-label=\"Footer\"><a href=\"…\">GitHub</a></nav>\n * </ngb-footer>\n * ```\n */\n@Component({\n selector: 'ngb-footer',\n template: '<ng-content />',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'ngb-footer', role: 'contentinfo' },\n})\nexport class NgbFooter {}\n"],"mappings":";;AAmBA,IAAa,YAAb,MAAa,UAAS;CAAT,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAS,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAT,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAS,cAAA;EAAA,UAAA;EAAA,MAAA;GAAA,YAAA,EAAA,QAAA,cAAA;GAAA,gBAAA;EAAA;EAAA,UAAA;EAAA,UAJV;EAAgB,UAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAIf,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAS,YAAA,CAAA;EANrB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,UAAU;GACV,iBAAiB,wBAAwB;GACzC,MAAM;IAAE,OAAO;IAAc,MAAM;GAAa;EACjD,CAAA"}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, Injectable, InjectionToken, computed, inject, input, isDevMode, makeEnvironmentProviders, provideEnvironmentInitializer, signal } from "@angular/core";
|
|
3
|
+
import { DomSanitizer } from "@angular/platform-browser";
|
|
4
|
+
const NGB_ICON_DEFAULT_CONFIG = {
|
|
5
|
+
theme: "outline",
|
|
6
|
+
flipInRtl: true
|
|
7
|
+
};
|
|
8
|
+
const NGB_ICON_CONFIG = new InjectionToken("NGB_ICON_CONFIG", {
|
|
9
|
+
providedIn: "root",
|
|
10
|
+
factory: () => NGB_ICON_DEFAULT_CONFIG
|
|
11
|
+
});
|
|
12
|
+
function provideNgbIconConfig(config) {
|
|
13
|
+
return makeEnvironmentProviders([{
|
|
14
|
+
provide: NGB_ICON_CONFIG,
|
|
15
|
+
useValue: {
|
|
16
|
+
...NGB_ICON_DEFAULT_CONFIG,
|
|
17
|
+
...config
|
|
18
|
+
}
|
|
19
|
+
}]);
|
|
20
|
+
}
|
|
21
|
+
var NgbIconRegistry = class NgbIconRegistry {
|
|
22
|
+
icons = signal(/* @__PURE__ */ new Map(), ...ngDevMode ? [{ debugName: "icons" }] : /* istanbul ignore next */ []);
|
|
23
|
+
warned = /* @__PURE__ */ new Set();
|
|
24
|
+
register(icons) {
|
|
25
|
+
this.icons.update((current) => {
|
|
26
|
+
const next = new Map(current);
|
|
27
|
+
for (const icon of icons) next.set(icon.name, icon);
|
|
28
|
+
return next;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
get(name) {
|
|
32
|
+
const icon = this.icons().get(name);
|
|
33
|
+
if (!icon && isDevMode() && !this.warned.has(name)) {
|
|
34
|
+
this.warned.add(name);
|
|
35
|
+
console.warn(`[ngb-icon] "${name}" is not registered. Add it with provideNgbIcons([...]) or use [icon].`);
|
|
36
|
+
}
|
|
37
|
+
return icon;
|
|
38
|
+
}
|
|
39
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
40
|
+
minVersion: "12.0.0",
|
|
41
|
+
version: "22.2.3",
|
|
42
|
+
ngImport: i0,
|
|
43
|
+
type: NgbIconRegistry,
|
|
44
|
+
deps: [],
|
|
45
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
46
|
+
});
|
|
47
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
48
|
+
minVersion: "12.0.0",
|
|
49
|
+
version: "22.2.3",
|
|
50
|
+
ngImport: i0,
|
|
51
|
+
type: NgbIconRegistry,
|
|
52
|
+
providedIn: "root"
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
56
|
+
minVersion: "12.0.0",
|
|
57
|
+
version: "22.2.3",
|
|
58
|
+
ngImport: i0,
|
|
59
|
+
type: NgbIconRegistry,
|
|
60
|
+
decorators: [{
|
|
61
|
+
type: Injectable,
|
|
62
|
+
args: [{ providedIn: "root" }]
|
|
63
|
+
}]
|
|
64
|
+
});
|
|
65
|
+
function provideNgbIcons(icons) {
|
|
66
|
+
return makeEnvironmentProviders([provideEnvironmentInitializer(() => inject(NgbIconRegistry).register(icons))]);
|
|
67
|
+
}
|
|
68
|
+
let nextId = 0;
|
|
69
|
+
var NgbIcon = class NgbIcon {
|
|
70
|
+
registry = inject(NgbIconRegistry);
|
|
71
|
+
config = inject(NGB_ICON_CONFIG);
|
|
72
|
+
sanitizer = inject(DomSanitizer);
|
|
73
|
+
id = `ngb-icon-${nextId++}`;
|
|
74
|
+
name = input(...ngDevMode ? [void 0, { debugName: "name" }] : /* istanbul ignore next */ []);
|
|
75
|
+
icon = input(...ngDevMode ? [void 0, { debugName: "icon" }] : /* istanbul ignore next */ []);
|
|
76
|
+
theme = input(this.config.theme, ...ngDevMode ? [{ debugName: "theme" }] : /* istanbul ignore next */ []);
|
|
77
|
+
size = input(...ngDevMode ? [void 0, { debugName: "size" }] : /* istanbul ignore next */ []);
|
|
78
|
+
strokeWidth = input(...ngDevMode ? [void 0, { debugName: "strokeWidth" }] : /* istanbul ignore next */ []);
|
|
79
|
+
label = input(...ngDevMode ? [void 0, { debugName: "label" }] : /* istanbul ignore next */ []);
|
|
80
|
+
definition = computed(() => {
|
|
81
|
+
const icon = this.icon();
|
|
82
|
+
if (icon) return icon;
|
|
83
|
+
const name = this.name();
|
|
84
|
+
return name ? this.registry.get(name) : void 0;
|
|
85
|
+
}, ...ngDevMode ? [{ debugName: "definition" }] : /* istanbul ignore next */ []);
|
|
86
|
+
classes = computed(() => {
|
|
87
|
+
const flip = this.config.flipInRtl && this.definition()?.rtl;
|
|
88
|
+
return `ngb-icon ngb-icon-${this.theme()}${flip ? " ngb-icon-rtl" : ""}`;
|
|
89
|
+
}, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
90
|
+
svg = computed(() => {
|
|
91
|
+
let svg = this.definition()?.svg ?? "";
|
|
92
|
+
if (svg.includes(" id=\"")) svg = svg.replace(/(id="|url\(#|href="#)([^")]+)/g, `$1$2-${this.id}`);
|
|
93
|
+
return this.sanitizer.bypassSecurityTrustHtml(svg);
|
|
94
|
+
}, ...ngDevMode ? [{ debugName: "svg" }] : /* istanbul ignore next */ []);
|
|
95
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
96
|
+
minVersion: "12.0.0",
|
|
97
|
+
version: "22.2.3",
|
|
98
|
+
ngImport: i0,
|
|
99
|
+
type: NgbIcon,
|
|
100
|
+
deps: [],
|
|
101
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
102
|
+
});
|
|
103
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
104
|
+
minVersion: "17.1.0",
|
|
105
|
+
version: "22.2.3",
|
|
106
|
+
type: NgbIcon,
|
|
107
|
+
isStandalone: true,
|
|
108
|
+
selector: "ngb-icon",
|
|
109
|
+
inputs: {
|
|
110
|
+
name: {
|
|
111
|
+
classPropertyName: "name",
|
|
112
|
+
publicName: "name",
|
|
113
|
+
isSignal: true,
|
|
114
|
+
isRequired: false,
|
|
115
|
+
transformFunction: null
|
|
116
|
+
},
|
|
117
|
+
icon: {
|
|
118
|
+
classPropertyName: "icon",
|
|
119
|
+
publicName: "icon",
|
|
120
|
+
isSignal: true,
|
|
121
|
+
isRequired: false,
|
|
122
|
+
transformFunction: null
|
|
123
|
+
},
|
|
124
|
+
theme: {
|
|
125
|
+
classPropertyName: "theme",
|
|
126
|
+
publicName: "theme",
|
|
127
|
+
isSignal: true,
|
|
128
|
+
isRequired: false,
|
|
129
|
+
transformFunction: null
|
|
130
|
+
},
|
|
131
|
+
size: {
|
|
132
|
+
classPropertyName: "size",
|
|
133
|
+
publicName: "size",
|
|
134
|
+
isSignal: true,
|
|
135
|
+
isRequired: false,
|
|
136
|
+
transformFunction: null
|
|
137
|
+
},
|
|
138
|
+
strokeWidth: {
|
|
139
|
+
classPropertyName: "strokeWidth",
|
|
140
|
+
publicName: "strokeWidth",
|
|
141
|
+
isSignal: true,
|
|
142
|
+
isRequired: false,
|
|
143
|
+
transformFunction: null
|
|
144
|
+
},
|
|
145
|
+
label: {
|
|
146
|
+
classPropertyName: "label",
|
|
147
|
+
publicName: "label",
|
|
148
|
+
isSignal: true,
|
|
149
|
+
isRequired: false,
|
|
150
|
+
transformFunction: null
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
host: { properties: {
|
|
154
|
+
"class": "classes()",
|
|
155
|
+
"innerHTML": "svg()",
|
|
156
|
+
"style.--ngb-icon-size": "size()",
|
|
157
|
+
"style.--ngb-icon-stroke-width": "strokeWidth()",
|
|
158
|
+
"attr.role": "label() ? \"img\" : null",
|
|
159
|
+
"attr.aria-label": "label() || null",
|
|
160
|
+
"attr.aria-hidden": "label() ? null : \"true\""
|
|
161
|
+
} },
|
|
162
|
+
ngImport: i0,
|
|
163
|
+
template: "",
|
|
164
|
+
isInline: true,
|
|
165
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
169
|
+
minVersion: "12.0.0",
|
|
170
|
+
version: "22.2.3",
|
|
171
|
+
ngImport: i0,
|
|
172
|
+
type: NgbIcon,
|
|
173
|
+
decorators: [{
|
|
174
|
+
type: Component,
|
|
175
|
+
args: [{
|
|
176
|
+
selector: "ngb-icon",
|
|
177
|
+
template: "",
|
|
178
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
179
|
+
host: {
|
|
180
|
+
"[class]": "classes()",
|
|
181
|
+
"[innerHTML]": "svg()",
|
|
182
|
+
"[style.--ngb-icon-size]": "size()",
|
|
183
|
+
"[style.--ngb-icon-stroke-width]": "strokeWidth()",
|
|
184
|
+
"[attr.role]": "label() ? \"img\" : null",
|
|
185
|
+
"[attr.aria-label]": "label() || null",
|
|
186
|
+
"[attr.aria-hidden]": "label() ? null : \"true\""
|
|
187
|
+
}
|
|
188
|
+
}]
|
|
189
|
+
}],
|
|
190
|
+
propDecorators: {
|
|
191
|
+
name: [{
|
|
192
|
+
type: i0.Input,
|
|
193
|
+
args: [{
|
|
194
|
+
isSignal: true,
|
|
195
|
+
alias: "name",
|
|
196
|
+
required: false
|
|
197
|
+
}]
|
|
198
|
+
}],
|
|
199
|
+
icon: [{
|
|
200
|
+
type: i0.Input,
|
|
201
|
+
args: [{
|
|
202
|
+
isSignal: true,
|
|
203
|
+
alias: "icon",
|
|
204
|
+
required: false
|
|
205
|
+
}]
|
|
206
|
+
}],
|
|
207
|
+
theme: [{
|
|
208
|
+
type: i0.Input,
|
|
209
|
+
args: [{
|
|
210
|
+
isSignal: true,
|
|
211
|
+
alias: "theme",
|
|
212
|
+
required: false
|
|
213
|
+
}]
|
|
214
|
+
}],
|
|
215
|
+
size: [{
|
|
216
|
+
type: i0.Input,
|
|
217
|
+
args: [{
|
|
218
|
+
isSignal: true,
|
|
219
|
+
alias: "size",
|
|
220
|
+
required: false
|
|
221
|
+
}]
|
|
222
|
+
}],
|
|
223
|
+
strokeWidth: [{
|
|
224
|
+
type: i0.Input,
|
|
225
|
+
args: [{
|
|
226
|
+
isSignal: true,
|
|
227
|
+
alias: "strokeWidth",
|
|
228
|
+
required: false
|
|
229
|
+
}]
|
|
230
|
+
}],
|
|
231
|
+
label: [{
|
|
232
|
+
type: i0.Input,
|
|
233
|
+
args: [{
|
|
234
|
+
isSignal: true,
|
|
235
|
+
alias: "label",
|
|
236
|
+
required: false
|
|
237
|
+
}]
|
|
238
|
+
}]
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
export { NGB_ICON_CONFIG, NGB_ICON_DEFAULT_CONFIG, NgbIcon, NgbIconRegistry, provideNgbIconConfig, provideNgbIcons };
|
|
242
|
+
|
|
243
|
+
//# sourceMappingURL=ngb-bootstrap-core-icon.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngb-bootstrap-core-icon.mjs","names":[],"sources":["../../../../projects/core/icon/icon-registry.ts","../../../../projects/core/icon/icon.ts"],"sourcesContent":["import {\n EnvironmentProviders,\n Injectable,\n InjectionToken,\n isDevMode,\n makeEnvironmentProviders,\n inject,\n provideEnvironmentInitializer,\n signal,\n} from '@angular/core';\nimport type { NgbIconDefinition, NgbIconTheme } from '@ngb-bootstrap/icons';\n\n/** Defaults for every `<ngb-icon>`. */\nexport interface NgbIconConfig {\n /** IconPark theme. */\n theme: NgbIconTheme;\n /** Mirror icons IconPark marks as directional when they sit in a right-to-left layout. */\n flipInRtl: boolean;\n}\n\nexport const NGB_ICON_DEFAULT_CONFIG: NgbIconConfig = {\n theme: 'outline',\n flipInRtl: true,\n};\n\nexport const NGB_ICON_CONFIG = new InjectionToken<NgbIconConfig>('NGB_ICON_CONFIG', {\n providedIn: 'root',\n factory: () => NGB_ICON_DEFAULT_CONFIG,\n});\n\n/** Overrides `<ngb-icon>` defaults. */\nexport function provideNgbIconConfig(config: Partial<NgbIconConfig>): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: NGB_ICON_CONFIG, useValue: { ...NGB_ICON_DEFAULT_CONFIG, ...config } },\n ]);\n}\n\n/** Icons that `<ngb-icon name=\"…\">` can render, keyed by name. */\n@Injectable({ providedIn: 'root' })\nexport class NgbIconRegistry {\n private readonly icons = signal<ReadonlyMap<string, NgbIconDefinition>>(new Map());\n private readonly warned = new Set<string>();\n\n /** Adds icons. A later registration with the same name replaces the earlier one. */\n register(icons: readonly NgbIconDefinition[]): void {\n this.icons.update((current) => {\n const next = new Map(current);\n for (const icon of icons) next.set(icon.name, icon);\n return next;\n });\n }\n\n /** Looks up an icon. Unknown names return `undefined` and log a warning in dev mode. */\n get(name: string): NgbIconDefinition | undefined {\n const icon = this.icons().get(name);\n if (!icon && isDevMode() && !this.warned.has(name)) {\n this.warned.add(name);\n console.warn(\n `[ngb-icon] \"${name}\" is not registered. Add it with provideNgbIcons([...]) or use [icon].`,\n );\n }\n return icon;\n }\n}\n\n/**\n * Registers the icons an app (or a lazy route) uses with `<ngb-icon name=\"…\">`.\n * Accepts IconPark icons from `@ngb-bootstrap/icons` and an app's own `{ name, svg }` definitions.\n *\n * ```ts\n * import { ngbIconHome, ngbIconSearch } from '@ngb-bootstrap/icons';\n * bootstrapApplication(App, { providers: [provideNgbIcons([ngbIconHome, ngbIconSearch])] });\n * ```\n */\nexport function provideNgbIcons(icons: readonly NgbIconDefinition[]): EnvironmentProviders {\n return makeEnvironmentProviders([\n provideEnvironmentInitializer(() => inject(NgbIconRegistry).register(icons)),\n ]);\n}\n","import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport type { NgbIconDefinition, NgbIconName, NgbIconTheme } from '@ngb-bootstrap/icons';\nimport { NGB_ICON_CONFIG, NgbIconRegistry } from './icon-registry';\n\nlet nextId = 0;\n\n/**\n * SVG icon from `@ngb-bootstrap/icons` (IconPark) or the app's own registered SVGs.\n * Decorative by default (`aria-hidden`); set `label` when the icon carries meaning on its own.\n *\n * ```html\n * <ngb-icon name=\"home\" theme=\"two-tone\" size=\"1.25rem\" />\n * <ngb-icon [icon]=\"ngbIconSearch\" label=\"Search\" />\n * ```\n */\n@Component({\n selector: 'ngb-icon',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'classes()',\n '[innerHTML]': 'svg()',\n '[style.--ngb-icon-size]': 'size()',\n '[style.--ngb-icon-stroke-width]': 'strokeWidth()',\n '[attr.role]': 'label() ? \"img\" : null',\n '[attr.aria-label]': 'label() || null',\n '[attr.aria-hidden]': 'label() ? null : \"true\"',\n },\n})\nexport class NgbIcon {\n private readonly registry = inject(NgbIconRegistry);\n private readonly config = inject(NGB_ICON_CONFIG);\n private readonly sanitizer = inject(DomSanitizer);\n private readonly id = `ngb-icon-${nextId++}`;\n\n /** Name of a registered icon (see `provideNgbIcons`). */\n readonly name = input<NgbIconName | (string & {})>();\n /** Icon definition to render directly, without registering it. Takes precedence over `name`. */\n readonly icon = input<NgbIconDefinition>();\n /** `outline` (default), `filled`, `two-tone` or `multi-color`. */\n readonly theme = input<NgbIconTheme>(this.config.theme);\n /** Any CSS length, e.g. `1.5rem`. Defaults to `1em`, the surrounding font size. */\n readonly size = input<string>();\n /** Stroke width on IconPark's 48-unit grid. Defaults to 4. */\n readonly strokeWidth = input<number>();\n /** Accessible name. Without it the icon is hidden from assistive technology. */\n readonly label = input<string>();\n\n private readonly definition = computed(() => {\n const icon = this.icon();\n if (icon) return icon;\n const name = this.name();\n return name ? this.registry.get(name) : undefined;\n });\n\n protected readonly classes = computed(() => {\n const flip = this.config.flipInRtl && this.definition()?.rtl;\n return `ngb-icon ngb-icon-${this.theme()}${flip ? ' ngb-icon-rtl' : ''}`;\n });\n\n protected readonly svg = computed<SafeHtml>(() => {\n let svg = this.definition()?.svg ?? '';\n // Clip-path and mask ids must be unique per instance, or icons on one page share them.\n if (svg.includes(' id=\"')) {\n svg = svg.replace(/(id=\"|url\\(#|href=\"#)([^\")]+)/g, `$1$2-${this.id}`);\n }\n // Icon SVGs come from the package or the app's own registrations, never from user input.\n return this.sanitizer.bypassSecurityTrustHtml(svg);\n });\n}\n"],"mappings":";;;AAoBA,MAAa,0BAAyC;CACpD,OAAO;CACP,WAAW;AACZ;AAED,MAAa,kBAAkB,IAAI,eAA8B,mBAAmB;CAClF,YAAY;CACZ,eAAe;AAChB,CAAA;AAGD,SAAgB,qBAAqB,QAA8B;CACjE,OAAO,yBAAyB,CAC9B;EAAE,SAAS;EAAiB,UAAU;GAAE,GAAG;GAAyB,GAAG;EAAM;CAAE,CAChF,CAAA;AACH;AAIA,IAAa,kBAAb,MAAa,gBAAe;CACT,QAAQ,uBAA+C,IAAI,IAAG,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CACjE,yBAAS,IAAI,IAAG;CAGjC,SAAS,OAAmC;EAC1C,KAAK,MAAM,QAAQ,YAAW;GAC5B,MAAM,OAAO,IAAI,IAAI,OAAO;GAC5B,KAAK,MAAM,QAAQ,OAAO,KAAK,IAAI,KAAK,MAAM,IAAI;GAClD,OAAO;EACT,CAAC;CACH;CAGA,IAAI,MAAY;EACd,MAAM,OAAO,KAAK,MAAK,CAAE,CAAC,IAAI,IAAI;EAClC,IAAI,CAAC,QAAQ,UAAS,KAAM,CAAC,KAAK,OAAO,IAAI,IAAI,GAAG;GAClD,KAAK,OAAO,IAAI,IAAI;GACpB,QAAQ,KACN,eAAe,KAAI,uEAAwE;EAE/F;EACA,OAAO;CACT;CAvBW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAA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