@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,147 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, input } from "@angular/core";
|
|
3
|
+
import { NgbValueAccessor, ngbId, provideNgbValueAccessor } from "@ngb-bootstrap/core/cdk";
|
|
4
|
+
var NgbSwitch = class NgbSwitch extends NgbValueAccessor {
|
|
5
|
+
id = ngbId("ngb-switch");
|
|
6
|
+
hintId = `${this.id}-hint`;
|
|
7
|
+
hint = input(...ngDevMode ? [void 0, { debugName: "hint" }] : /* istanbul ignore next */ []);
|
|
8
|
+
color = input(...ngDevMode ? [void 0, { debugName: "color" }] : /* istanbul ignore next */ []);
|
|
9
|
+
size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
10
|
+
classes = computed(() => {
|
|
11
|
+
const classes = ["switch"];
|
|
12
|
+
if (this.color()) classes.push(`theme-${this.color()}`);
|
|
13
|
+
if (this.size() !== "md") classes.push(`switch-${this.size()}`);
|
|
14
|
+
return classes.join(" ");
|
|
15
|
+
}, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
16
|
+
toggle(event) {
|
|
17
|
+
this.setValue(event.target.checked);
|
|
18
|
+
}
|
|
19
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
20
|
+
minVersion: "12.0.0",
|
|
21
|
+
version: "22.2.3",
|
|
22
|
+
ngImport: i0,
|
|
23
|
+
type: NgbSwitch,
|
|
24
|
+
deps: null,
|
|
25
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
26
|
+
});
|
|
27
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
28
|
+
minVersion: "17.0.0",
|
|
29
|
+
version: "22.2.3",
|
|
30
|
+
type: NgbSwitch,
|
|
31
|
+
isStandalone: true,
|
|
32
|
+
selector: "ngb-switch",
|
|
33
|
+
inputs: {
|
|
34
|
+
hint: {
|
|
35
|
+
classPropertyName: "hint",
|
|
36
|
+
publicName: "hint",
|
|
37
|
+
isSignal: true,
|
|
38
|
+
isRequired: false,
|
|
39
|
+
transformFunction: null
|
|
40
|
+
},
|
|
41
|
+
color: {
|
|
42
|
+
classPropertyName: "color",
|
|
43
|
+
publicName: "color",
|
|
44
|
+
isSignal: true,
|
|
45
|
+
isRequired: false,
|
|
46
|
+
transformFunction: null
|
|
47
|
+
},
|
|
48
|
+
size: {
|
|
49
|
+
classPropertyName: "size",
|
|
50
|
+
publicName: "size",
|
|
51
|
+
isSignal: true,
|
|
52
|
+
isRequired: false,
|
|
53
|
+
transformFunction: null
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
host: { classAttribute: "form-field" },
|
|
57
|
+
providers: [provideNgbValueAccessor(() => NgbSwitch)],
|
|
58
|
+
usesInheritance: true,
|
|
59
|
+
ngImport: i0,
|
|
60
|
+
template: `
|
|
61
|
+
<span [class]="classes()">
|
|
62
|
+
<input
|
|
63
|
+
type="checkbox"
|
|
64
|
+
role="switch"
|
|
65
|
+
[id]="id"
|
|
66
|
+
[class.is-invalid]="isInvalid()"
|
|
67
|
+
[checked]="!!value()"
|
|
68
|
+
[disabled]="isDisabled()"
|
|
69
|
+
[attr.aria-invalid]="isInvalid() ? 'true' : null"
|
|
70
|
+
[attr.aria-describedby]="hint() ? hintId : null"
|
|
71
|
+
(change)="toggle($event)"
|
|
72
|
+
(blur)="markTouched()"
|
|
73
|
+
/>
|
|
74
|
+
</span>
|
|
75
|
+
<label [for]="id"><ng-content /></label>
|
|
76
|
+
@if (hint()) {
|
|
77
|
+
<div class="form-text" [id]="hintId">{{ hint() }}</div>
|
|
78
|
+
}
|
|
79
|
+
`,
|
|
80
|
+
isInline: true,
|
|
81
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
85
|
+
minVersion: "12.0.0",
|
|
86
|
+
version: "22.2.3",
|
|
87
|
+
ngImport: i0,
|
|
88
|
+
type: NgbSwitch,
|
|
89
|
+
decorators: [{
|
|
90
|
+
type: Component,
|
|
91
|
+
args: [{
|
|
92
|
+
selector: "ngb-switch",
|
|
93
|
+
providers: [provideNgbValueAccessor(() => NgbSwitch)],
|
|
94
|
+
template: `
|
|
95
|
+
<span [class]="classes()">
|
|
96
|
+
<input
|
|
97
|
+
type="checkbox"
|
|
98
|
+
role="switch"
|
|
99
|
+
[id]="id"
|
|
100
|
+
[class.is-invalid]="isInvalid()"
|
|
101
|
+
[checked]="!!value()"
|
|
102
|
+
[disabled]="isDisabled()"
|
|
103
|
+
[attr.aria-invalid]="isInvalid() ? 'true' : null"
|
|
104
|
+
[attr.aria-describedby]="hint() ? hintId : null"
|
|
105
|
+
(change)="toggle($event)"
|
|
106
|
+
(blur)="markTouched()"
|
|
107
|
+
/>
|
|
108
|
+
</span>
|
|
109
|
+
<label [for]="id"><ng-content /></label>
|
|
110
|
+
@if (hint()) {
|
|
111
|
+
<div class="form-text" [id]="hintId">{{ hint() }}</div>
|
|
112
|
+
}
|
|
113
|
+
`,
|
|
114
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
115
|
+
host: { class: "form-field" }
|
|
116
|
+
}]
|
|
117
|
+
}],
|
|
118
|
+
propDecorators: {
|
|
119
|
+
hint: [{
|
|
120
|
+
type: i0.Input,
|
|
121
|
+
args: [{
|
|
122
|
+
isSignal: true,
|
|
123
|
+
alias: "hint",
|
|
124
|
+
required: false
|
|
125
|
+
}]
|
|
126
|
+
}],
|
|
127
|
+
color: [{
|
|
128
|
+
type: i0.Input,
|
|
129
|
+
args: [{
|
|
130
|
+
isSignal: true,
|
|
131
|
+
alias: "color",
|
|
132
|
+
required: false
|
|
133
|
+
}]
|
|
134
|
+
}],
|
|
135
|
+
size: [{
|
|
136
|
+
type: i0.Input,
|
|
137
|
+
args: [{
|
|
138
|
+
isSignal: true,
|
|
139
|
+
alias: "size",
|
|
140
|
+
required: false
|
|
141
|
+
}]
|
|
142
|
+
}]
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
export { NgbSwitch };
|
|
146
|
+
|
|
147
|
+
//# sourceMappingURL=ngb-bootstrap-core-switch.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngb-bootstrap-core-switch.mjs","names":[],"sources":["../../../../projects/core/switch/switch.ts"],"sourcesContent":["// API adapted from Taiga UI (Apache-2.0), see NOTICE.\nimport { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { NgbThemeColor } from '@ngb-bootstrap/core';\nimport { NgbValueAccessor, ngbId, provideNgbValueAccessor } from '@ngb-bootstrap/core/cdk';\n\nexport type NgbSwitchSize = 'sm' | 'md' | 'lg';\n\n/**\n * Switch built on Bootstrap 6 `.switch` over a native `<input type=\"checkbox\" role=\"switch\">`.\n * The projected content is the label. The model is `value` (`true` / `false`), the same name\n * every ngb form control uses.\n *\n * ```html\n * <ngb-switch [(value)]=\"notifications\" hint=\"Sent by email.\">Notifications</ngb-switch>\n * <ngb-switch formControlName=\"darkMode\">Dark mode</ngb-switch>\n * ```\n */\n@Component({\n selector: 'ngb-switch',\n providers: [provideNgbValueAccessor(() => NgbSwitch)],\n template: `\n <span [class]=\"classes()\">\n <input\n type=\"checkbox\"\n role=\"switch\"\n [id]=\"id\"\n [class.is-invalid]=\"isInvalid()\"\n [checked]=\"!!value()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n [attr.aria-describedby]=\"hint() ? hintId : null\"\n (change)=\"toggle($event)\"\n (blur)=\"markTouched()\"\n />\n </span>\n <label [for]=\"id\"><ng-content /></label>\n @if (hint()) {\n <div class=\"form-text\" [id]=\"hintId\">{{ hint() }}</div>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'form-field' },\n})\nexport class NgbSwitch extends NgbValueAccessor<boolean> {\n protected readonly id = ngbId('ngb-switch');\n protected readonly hintId = `${this.id}-hint`;\n\n /** Description shown under the label and linked with `aria-describedby`. */\n readonly hint = input<string>();\n /** Theme colour (Bootstrap `.theme-*`). Defaults to the control colour. */\n readonly color = input<NgbThemeColor>();\n /** `sm`, `md` (default) or `lg`. */\n readonly size = input<NgbSwitchSize>('md');\n\n protected readonly classes = computed(() => {\n const classes = ['switch'];\n if (this.color()) classes.push(`theme-${this.color()}`);\n if (this.size() !== 'md') classes.push(`switch-${this.size()}`);\n return classes.join(' ');\n });\n\n protected toggle(event: Event): void {\n this.setValue((event.target as HTMLInputElement).checked);\n }\n}\n"],"mappings":";;;AA2CA,IAAa,YAAb,MAAa,kBAAkB,iBAAyB;CACnC,KAAK,MAAM,YAAY;CACvB,SAAS,GAAG,KAAK,GAAE;CAG7B,OAAO,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAEtB,QAAQ,MAAsB,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAE9B,OAAO,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAEvB,UAAU,eAAc;EACzC,MAAM,UAAU,CAAC,QAAQ;EACzB,IAAI,KAAK,MAAK,GAAI,QAAQ,KAAK,SAAS,KAAK,MAAK,GAAI;EACtD,IAAI,KAAK,KAAI,MAAO,MAAM,QAAQ,KAAK,UAAU,KAAK,KAAI,GAAI;EAC9D,O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4
|
+
clear: "Clear",
|
|
5
|
+
loading: "Loading…",
|
|
6
|
+
expand: "Show more",
|
|
7
|
+
collapse: "Show less",
|
|
8
|
+
chip: { remove: "Remove {label}" },
|
|
9
|
+
pagination: {
|
|
10
|
+
first: "First",
|
|
11
|
+
previous: "Previous",
|
|
12
|
+
next: "Next",
|
|
13
|
+
last: "Last",
|
|
14
|
+
page: "Page {page}"
|
|
15
|
+
},
|
|
16
|
+
datepicker: {
|
|
17
|
+
previousMonth: "Previous month",
|
|
18
|
+
nextMonth: "Next month",
|
|
19
|
+
selectMonth: "Select month",
|
|
20
|
+
selectYear: "Select year"
|
|
21
|
+
},
|
|
22
|
+
file: {
|
|
23
|
+
browse: "Browse",
|
|
24
|
+
noFileChosen: "No file chosen"
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const NGB_I18N = new InjectionToken("NGB_I18N", {
|
|
28
|
+
providedIn: "root",
|
|
29
|
+
factory: () => NGB_DEFAULT_I18N
|
|
30
|
+
});
|
|
31
|
+
function mergeNgbI18n(overrides = {}) {
|
|
32
|
+
const merged = { ...NGB_DEFAULT_I18N };
|
|
33
|
+
for (const [key, value] of Object.entries(overrides)) {
|
|
34
|
+
if (value === void 0) continue;
|
|
35
|
+
const base = NGB_DEFAULT_I18N[key];
|
|
36
|
+
merged[key] = typeof value === "object" ? {
|
|
37
|
+
...base,
|
|
38
|
+
...value
|
|
39
|
+
} : value;
|
|
40
|
+
}
|
|
41
|
+
return merged;
|
|
42
|
+
}
|
|
43
|
+
function provideNgbI18n(overrides) {
|
|
44
|
+
return makeEnvironmentProviders([{
|
|
45
|
+
provide: NGB_I18N,
|
|
46
|
+
useValue: mergeNgbI18n(overrides)
|
|
47
|
+
}]);
|
|
48
|
+
}
|
|
49
|
+
const NGB_DEFAULT_CONFIG = { animation: true };
|
|
50
|
+
const NGB_CONFIG = new InjectionToken("NGB_CONFIG", {
|
|
51
|
+
providedIn: "root",
|
|
52
|
+
factory: () => NGB_DEFAULT_CONFIG
|
|
53
|
+
});
|
|
54
|
+
function provideNgb(options = {}) {
|
|
55
|
+
const { i18n, ...config } = options;
|
|
56
|
+
return makeEnvironmentProviders([{
|
|
57
|
+
provide: NGB_CONFIG,
|
|
58
|
+
useValue: {
|
|
59
|
+
...NGB_DEFAULT_CONFIG,
|
|
60
|
+
...config
|
|
61
|
+
}
|
|
62
|
+
}, ...i18n ? [{
|
|
63
|
+
provide: NGB_I18N,
|
|
64
|
+
useValue: mergeNgbI18n(i18n)
|
|
65
|
+
}] : []]);
|
|
66
|
+
}
|
|
67
|
+
export { NGB_CONFIG, NGB_DEFAULT_CONFIG, NGB_DEFAULT_I18N, NGB_I18N, mergeNgbI18n, provideNgb, provideNgbI18n };
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=ngb-bootstrap-core.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngb-bootstrap-core.mjs","names":[],"sources":["../../../../projects/core/src/i18n.ts","../../../../projects/core/src/config.ts"],"sourcesContent":["import { EnvironmentProviders, InjectionToken, makeEnvironmentProviders } from '@angular/core';\n\n/**\n * Translatable strings used by the components. Values may contain `{name}` placeholders,\n * which the component that uses them fills in (e.g. `{page}` in `pagination.page`).\n */\nexport interface NgbI18n {\n /** Accessible label of close buttons (alerts, modals, drawers, toasts). */\n close: string;\n /** Accessible label of the clear button of text inputs. */\n clear: string;\n /** Accessible label of loading indicators (spinner, loading buttons). */\n loading: string;\n /** Accessible name of the toggle of a collapsed collapsible card. */\n expand: string;\n /** Accessible name of the toggle of an expanded collapsible card. */\n collapse: string;\n /** Strings of the Chips component. */\n chip: {\n /** Accessible name of the remove button. `{label}` is the chip's text. */\n remove: string;\n };\n /** Reserved for the Pagination component. */\n pagination: {\n first: string;\n previous: string;\n next: string;\n last: string;\n page: string;\n };\n /** Reserved for the Datepicker component. */\n datepicker: {\n previousMonth: string;\n nextMonth: string;\n selectMonth: string;\n selectYear: string;\n };\n /** Reserved for the File input component. */\n file: {\n browse: string;\n noFileChosen: string;\n };\n}\n\n/** Same shape as {@link NgbI18n}, with every key optional at every level. */\nexport type NgbI18nOverrides = {\n [K in keyof NgbI18n]?: NgbI18n[K] extends string ? string : Partial<NgbI18n[K]>;\n};\n\n/** English strings, used when nothing else is provided. */\nexport const NGB_DEFAULT_I18N: NgbI18n = {\n close: 'Close',\n clear: 'Clear',\n loading: 'Loading…',\n expand: 'Show more',\n collapse: 'Show less',\n chip: {\n remove: 'Remove {label}',\n },\n pagination: {\n first: 'First',\n previous: 'Previous',\n next: 'Next',\n last: 'Last',\n page: 'Page {page}',\n },\n datepicker: {\n previousMonth: 'Previous month',\n nextMonth: 'Next month',\n selectMonth: 'Select month',\n selectYear: 'Select year',\n },\n file: {\n browse: 'Browse',\n noFileChosen: 'No file chosen',\n },\n};\n\n/** Injects the active strings. Defaults to English. */\nexport const NGB_I18N = new InjectionToken<NgbI18n>('NGB_I18N', {\n providedIn: 'root',\n factory: () => NGB_DEFAULT_I18N,\n});\n\n/** Merges overrides onto the English defaults (one level deep, matching {@link NgbI18n}). */\nexport function mergeNgbI18n(overrides: NgbI18nOverrides = {}): NgbI18n {\n const merged: Record<string, unknown> = { ...NGB_DEFAULT_I18N };\n for (const [key, value] of Object.entries(overrides)) {\n if (value === undefined) continue;\n const base = (NGB_DEFAULT_I18N as unknown as Record<string, unknown>)[key];\n merged[key] = typeof value === 'object' ? { ...(base as object), ...value } : value;\n }\n return merged as unknown as NgbI18n;\n}\n\n/**\n * Overrides some or all library strings. Also available as `provideNgb({ i18n })`.\n *\n * ```ts\n * providers: [provideNgbI18n({ close: 'Fermer', loading: 'Chargement…' })]\n * ```\n */\nexport function provideNgbI18n(overrides: NgbI18nOverrides): EnvironmentProviders {\n return makeEnvironmentProviders([{ provide: NGB_I18N, useValue: mergeNgbI18n(overrides) }]);\n}\n","import { EnvironmentProviders, InjectionToken, makeEnvironmentProviders } from '@angular/core';\nimport { NGB_I18N, NgbI18nOverrides, mergeNgbI18n } from './i18n';\n\n/** Library-wide defaults. Each component also exposes its own config token. */\nexport interface NgbConfig {\n /** Disable all component animations (e.g. for tests or reduced-motion apps). */\n animation: boolean;\n}\n\n/** Options accepted by {@link provideNgb}: the config plus translated strings. */\nexport interface NgbOptions extends Partial<NgbConfig> {\n /** Override library strings (see `NgbI18n`). */\n i18n?: NgbI18nOverrides;\n}\n\nexport const NGB_DEFAULT_CONFIG: NgbConfig = {\n animation: true,\n};\n\nexport const NGB_CONFIG = new InjectionToken<NgbConfig>('NGB_CONFIG', {\n providedIn: 'root',\n factory: () => NGB_DEFAULT_CONFIG,\n});\n\n/**\n * Registers library-wide configuration.\n *\n * ```ts\n * bootstrapApplication(App, {\n * providers: [provideNgb({ animation: false, i18n: { close: 'Fermer' } })],\n * });\n * ```\n */\nexport function provideNgb(options: NgbOptions = {}): EnvironmentProviders {\n const { i18n, ...config } = options;\n return makeEnvironmentProviders([\n { provide: NGB_CONFIG, useValue: { ...NGB_DEFAULT_CONFIG, ...config } },\n ...(i18n ? [{ provide: NGB_I18N, useValue: mergeNgbI18n(i18n) }] : []),\n ]);\n}\n"],"mappings":";AAkDA,MAAa,mBAA4B;CACvC,OAAO;CACP,OAAO;CACP,SAAS;CACT,QAAQ;CACR,UAAU;CACV,MAAM,EACJ,QAAQ,iBACT;CACD,YAAY;EACV,OAAO;EACP,UAAU;EACV,MAAM;EACN,MAAM;EACN,MAAM;CACP;CACD,YAAY;EACV,eAAe;EACf,WAAW;EACX,aAAa;EACb,YAAY;CACb;CACD,MAAM;EACJ,QAAQ;EACR,cAAc;CACf;AACF;AAGD,MAAa,WAAW,IAAI,eAAwB,YAAY;CAC9D,YAAY;CACZ,eAAe;AAChB,CAAA;AAGD,SAAgB,aAAa,YAA8B,CAAA,GAAE;CAC3D,MAAM,SAAkC,EAAE,GAAG,iBAAgB;CAC7D,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,SAAS,GAAG;EACpD,IAAI,UAAU,QAAW;EACzB,MAAM,OAAQ,i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