@open-rlb/ng-bootstrap 3.3.19 → 3.3.21
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/README.md +63 -13
- package/fesm2022/open-rlb-ng-bootstrap.mjs +32 -2
- package/fesm2022/open-rlb-ng-bootstrap.mjs.map +1 -1
- package/package.json +19 -3
- package/schematics/collection.json +10 -0
- package/schematics/ng-add/files/rlb-starter.component.html.template +7 -0
- package/schematics/ng-add/files/rlb-starter.component.ts.template +25 -0
- package/schematics/ng-add/index.js +107 -0
- package/schematics/ng-add/schema.js +2 -0
- package/schematics/ng-add/schema.json +21 -0
- package/schematics/package.json +3 -0
- package/types/open-rlb-ng-bootstrap.d.ts +4 -1
package/README.md
CHANGED
|
@@ -1,24 +1,74 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @open-rlb/ng-bootstrap
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Angular 21 component library built on Bootstrap 5.3 (signals, OnPush), with timezone-aware
|
|
4
|
+
date handling via [`@open-rlb/date-tz`](https://www.npmjs.com/package/@open-rlb/date-tz).
|
|
4
5
|
|
|
5
|
-
##
|
|
6
|
+
## Installation
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
> Note: Don't forget to add `--project ng-bootstrap` or else it will be added to the default project in your `angular.json` file.
|
|
8
|
+
### Recommended — `ng add`
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
```bash
|
|
11
|
+
ng add @open-rlb/ng-bootstrap
|
|
12
|
+
```
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
The schematic will:
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
- install the required dependencies (`bootstrap`, `bootstrap-icons`, `@open-rlb/date-tz`,
|
|
17
|
+
`@ngx-translate/core`, `@angular/cdk`, and `@types/bootstrap`) at compatible versions;
|
|
18
|
+
- register the Bootstrap and Bootstrap Icons stylesheets in `angular.json`;
|
|
19
|
+
- add `provideRlbBootstrap()` to your application providers;
|
|
20
|
+
- scaffold a `RlbStarterComponent` (`src/app/rlb-starter/`) you can render to verify the setup
|
|
21
|
+
(pass `--skip-starter` to opt out).
|
|
22
|
+
|
|
23
|
+
### Manual
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install @open-rlb/ng-bootstrap
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
When installed this way, npm pulls the declared peer dependencies automatically (npm 7+).
|
|
30
|
+
Then register the providers and styles yourself:
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
// app.config.ts
|
|
34
|
+
import { provideRlbBootstrap } from '@open-rlb/ng-bootstrap';
|
|
15
35
|
|
|
16
|
-
|
|
36
|
+
export const appConfig: ApplicationConfig = {
|
|
37
|
+
providers: [provideRlbBootstrap()],
|
|
38
|
+
};
|
|
39
|
+
```
|
|
17
40
|
|
|
18
|
-
|
|
41
|
+
```jsonc
|
|
42
|
+
// angular.json → projects.<app>.architect.build.options.styles
|
|
43
|
+
"styles": [
|
|
44
|
+
"node_modules/bootstrap/dist/css/bootstrap.min.css",
|
|
45
|
+
"node_modules/bootstrap-icons/font/bootstrap-icons.css",
|
|
46
|
+
"src/styles.scss"
|
|
47
|
+
]
|
|
48
|
+
```
|
|
19
49
|
|
|
20
|
-
|
|
50
|
+
## Usage
|
|
21
51
|
|
|
22
|
-
|
|
52
|
+
```html
|
|
53
|
+
<rlb-card>
|
|
54
|
+
<rlb-card-header>Hello</rlb-card-header>
|
|
55
|
+
<rlb-card-body>
|
|
56
|
+
<button rlb-button color="primary">Click me</button>
|
|
57
|
+
</rlb-card-body>
|
|
58
|
+
</rlb-card>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Development
|
|
62
|
+
|
|
63
|
+
- `npm run lib:build` — builds the library **and** its `ng-add` schematics into `dist/rlb/ng-bootstrap`.
|
|
64
|
+
- `npm run lib:test:ng-add` — runs an isolated, in-memory check of the `ng-add` schematic
|
|
65
|
+
(requires a prior `lib:build`).
|
|
66
|
+
- `npm run lib:pack` — builds and packs a publishable tarball.
|
|
67
|
+
|
|
68
|
+
## Publishing
|
|
23
69
|
|
|
24
|
-
|
|
70
|
+
```bash
|
|
71
|
+
npm run lib:build
|
|
72
|
+
cd dist/rlb/ng-bootstrap
|
|
73
|
+
npm publish
|
|
74
|
+
```
|
|
@@ -5173,6 +5173,24 @@ class PaginationItemComponent {
|
|
|
5173
5173
|
this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), alias: 'disabled', transform: booleanAttribute });
|
|
5174
5174
|
this.active = input(false, { ...(ngDevMode ? { debugName: "active" } : /* istanbul ignore next */ {}), alias: 'active', transform: booleanAttribute });
|
|
5175
5175
|
this.cssClass = input('', { ...(ngDevMode ? { debugName: "cssClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
5176
|
+
this.itemClick = output();
|
|
5177
|
+
}
|
|
5178
|
+
onActivate(event) {
|
|
5179
|
+
if (this.disabled()) {
|
|
5180
|
+
event.preventDefault();
|
|
5181
|
+
return;
|
|
5182
|
+
}
|
|
5183
|
+
this.itemClick.emit();
|
|
5184
|
+
}
|
|
5185
|
+
onKeydown(event) {
|
|
5186
|
+
if (event.key !== 'Enter' && event.key !== ' ' && event.key !== 'Spacebar') {
|
|
5187
|
+
return;
|
|
5188
|
+
}
|
|
5189
|
+
event.preventDefault();
|
|
5190
|
+
if (this.disabled()) {
|
|
5191
|
+
return;
|
|
5192
|
+
}
|
|
5193
|
+
this.itemClick.emit();
|
|
5176
5194
|
}
|
|
5177
5195
|
ngOnInit() {
|
|
5178
5196
|
const templateView = this.viewContainerRef.createEmbeddedView(this.template());
|
|
@@ -5180,7 +5198,7 @@ class PaginationItemComponent {
|
|
|
5180
5198
|
this.viewContainerRef.element.nativeElement.remove();
|
|
5181
5199
|
}
|
|
5182
5200
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.16", ngImport: i0, type: PaginationItemComponent, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5183
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.16", type: PaginationItemComponent, isStandalone: true, selector: "rlb-pagination-item", inputs: { isIcon: { classPropertyName: "isIcon", publicName: "isIcon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "template", first: true, predicate: ["template"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
5201
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.16", type: PaginationItemComponent, isStandalone: true, selector: "rlb-pagination-item", inputs: { isIcon: { classPropertyName: "isIcon", publicName: "isIcon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, cssClass: { classPropertyName: "cssClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick" }, viewQueries: [{ propertyName: "template", first: true, predicate: ["template"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
5184
5202
|
<ng-template #template>
|
|
5185
5203
|
<li
|
|
5186
5204
|
class="page-item {{ cssClass() }}"
|
|
@@ -5189,7 +5207,13 @@ class PaginationItemComponent {
|
|
|
5189
5207
|
>
|
|
5190
5208
|
<a
|
|
5191
5209
|
class="page-link d-block"
|
|
5210
|
+
role="button"
|
|
5211
|
+
[attr.tabindex]="disabled() ? -1 : 0"
|
|
5212
|
+
[attr.aria-disabled]="disabled() ? true : null"
|
|
5213
|
+
[attr.aria-current]="active() ? 'page' : null"
|
|
5192
5214
|
[style.cursor]="disabled() ? 'default' : 'pointer'"
|
|
5215
|
+
(click)="onActivate($event)"
|
|
5216
|
+
(keydown)="onKeydown($event)"
|
|
5193
5217
|
>
|
|
5194
5218
|
<ng-container *ngTemplateOutlet="content"></ng-container>
|
|
5195
5219
|
</a>
|
|
@@ -5211,7 +5235,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
5211
5235
|
>
|
|
5212
5236
|
<a
|
|
5213
5237
|
class="page-link d-block"
|
|
5238
|
+
role="button"
|
|
5239
|
+
[attr.tabindex]="disabled() ? -1 : 0"
|
|
5240
|
+
[attr.aria-disabled]="disabled() ? true : null"
|
|
5241
|
+
[attr.aria-current]="active() ? 'page' : null"
|
|
5214
5242
|
[style.cursor]="disabled() ? 'default' : 'pointer'"
|
|
5243
|
+
(click)="onActivate($event)"
|
|
5244
|
+
(keydown)="onKeydown($event)"
|
|
5215
5245
|
>
|
|
5216
5246
|
<ng-container *ngTemplateOutlet="content"></ng-container>
|
|
5217
5247
|
</a>
|
|
@@ -5222,7 +5252,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
|
|
|
5222
5252
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
5223
5253
|
imports: [NgTemplateOutlet],
|
|
5224
5254
|
}]
|
|
5225
|
-
}], ctorParameters: () => [{ type: i0.ViewContainerRef }], propDecorators: { template: [{ type: i0.ViewChild, args: ['template', { isSignal: true }] }], isIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "isIcon", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: false }] }], cssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
5255
|
+
}], ctorParameters: () => [{ type: i0.ViewContainerRef }], propDecorators: { template: [{ type: i0.ViewChild, args: ['template', { isSignal: true }] }], isIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "isIcon", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: false }] }], cssClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }] } });
|
|
5226
5256
|
|
|
5227
5257
|
class PaginationComponent {
|
|
5228
5258
|
constructor(viewContainerRef) {
|