ngwr 5.0.3 → 6.1.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/alert/index.d.ts +30 -3
- package/avatar/index.d.ts +30 -5
- package/button/index.d.ts +43 -3
- package/cdk/index.d.ts +22 -3
- package/cdk/rxjs/index.d.ts +38 -3
- package/cdk/types/index.d.ts +25 -3
- package/cdk/utils/index.d.ts +12 -3
- package/checkbox/index.d.ts +29 -3
- package/dialog/index.d.ts +191 -3
- package/divider/index.d.ts +16 -5
- package/dropdown/index.d.ts +68 -0
- package/dropdown/styles/_index.scss +91 -0
- package/dropdown/styles/vars.scss +18 -0
- package/fesm2022/ngwr-alert.mjs +8 -28
- package/fesm2022/ngwr-alert.mjs.map +1 -1
- package/fesm2022/ngwr-avatar.mjs +8 -28
- package/fesm2022/ngwr-avatar.mjs.map +1 -1
- package/fesm2022/ngwr-button.mjs +10 -31
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-cdk.mjs +9 -4
- package/fesm2022/ngwr-cdk.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox.mjs +7 -26
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-dialog.mjs +135 -159
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-divider.mjs +5 -19
- package/fesm2022/ngwr-divider.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +315 -0
- package/fesm2022/ngwr-dropdown.mjs.map +1 -0
- package/fesm2022/ngwr-form.mjs +8 -29
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-icon.mjs +11 -32
- package/fesm2022/ngwr-icon.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +12 -32
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +125 -0
- package/fesm2022/ngwr-pagination.mjs.map +1 -0
- package/fesm2022/ngwr-pipes.mjs +5 -25
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +6 -25
- package/fesm2022/ngwr-progress.mjs.map +1 -1
- package/fesm2022/ngwr-qr.mjs +15 -37
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +405 -0
- package/fesm2022/ngwr-select.mjs.map +1 -0
- package/fesm2022/ngwr-skeleton.mjs +5 -19
- package/fesm2022/ngwr-skeleton.mjs.map +1 -1
- package/fesm2022/ngwr-spinner.mjs +16 -28
- package/fesm2022/ngwr-spinner.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +258 -0
- package/fesm2022/ngwr-table.mjs.map +1 -0
- package/fesm2022/ngwr-tag.mjs +7 -21
- package/fesm2022/ngwr-tag.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +8 -27
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/form/index.d.ts +26 -3
- package/icon/index.d.ts +828 -3
- package/index.d.ts +2 -5
- package/input/index.d.ts +41 -3
- package/package.json +35 -7
- package/pagination/index.d.ts +34 -0
- package/pagination/styles/_index.scss +60 -0
- package/pagination/styles/vars.scss +14 -0
- package/pipes/index.d.ts +15 -3
- package/progress/index.d.ts +13 -5
- package/qr/index.d.ts +127 -5
- package/select/index.d.ts +121 -0
- package/select/styles/_index.scss +237 -0
- package/select/styles/vars.scss +32 -0
- package/skeleton/index.d.ts +13 -2
- package/spinner/index.d.ts +23 -2
- package/spinner/styles/_index.scss +10 -3
- package/styles.scss +4 -0
- package/table/index.d.ts +101 -0
- package/table/styles/_index.scss +4 -0
- package/table/styles/table-filter.scss +202 -0
- package/table/styles/table-sort.scss +47 -0
- package/table/styles/table.scss +232 -0
- package/table/styles/vars.scss +21 -0
- package/tag/index.d.ts +24 -5
- package/textarea/index.d.ts +44 -4
- package/alert/alert-type.d.ts +0 -7
- package/alert/alert.component.d.ts +0 -21
- package/alert/alert.module.d.ts +0 -7
- package/alert/public-api.d.ts +0 -9
- package/avatar/avatar.component.d.ts +0 -27
- package/avatar/avatar.module.d.ts +0 -7
- package/avatar/public-api.d.ts +0 -8
- package/button/button-group.component.d.ts +0 -12
- package/button/button.component.d.ts +0 -31
- package/button/button.module.d.ts +0 -8
- package/button/public-api.d.ts +0 -9
- package/cdk/base.directive.d.ts +0 -15
- package/cdk/public-api.d.ts +0 -7
- package/cdk/rxjs/is-array.d.ts +0 -8
- package/cdk/rxjs/is-defined.d.ts +0 -8
- package/cdk/rxjs/is-not-empty-array.d.ts +0 -8
- package/cdk/rxjs/is-observable.d.ts +0 -9
- package/cdk/rxjs/public-api.d.ts +0 -10
- package/cdk/types/maybe.d.ts +0 -7
- package/cdk/types/public-api.d.ts +0 -9
- package/cdk/types/safe-any.d.ts +0 -7
- package/cdk/types/theme-color.d.ts +0 -8
- package/cdk/utils/generate-random-id.d.ts +0 -12
- package/cdk/utils/public-api.d.ts +0 -7
- package/checkbox/checkbox.component.d.ts +0 -28
- package/checkbox/checkbox.module.d.ts +0 -7
- package/checkbox/public-api.d.ts +0 -8
- package/dialog/dialog-animations.d.ts +0 -22
- package/dialog/dialog-base.directive.d.ts +0 -40
- package/dialog/dialog-close.directive.d.ts +0 -9
- package/dialog/dialog-content.directive.d.ts +0 -6
- package/dialog/dialog-data.token.d.ts +0 -8
- package/dialog/dialog-footer.directive.d.ts +0 -8
- package/dialog/dialog-options.d.ts +0 -19
- package/dialog/dialog-ref.d.ts +0 -26
- package/dialog/dialog-title.directive.d.ts +0 -6
- package/dialog/dialog.component.d.ts +0 -28
- package/dialog/dialog.module.d.ts +0 -11
- package/dialog/dialog.service.d.ts +0 -28
- package/dialog/public-api.d.ts +0 -18
- package/divider/divider.component.d.ts +0 -13
- package/divider/divider.module.d.ts +0 -7
- package/divider/public-api.d.ts +0 -8
- package/form/form-error.component.d.ts +0 -11
- package/form/form-item.component.d.ts +0 -14
- package/form/form.module.d.ts +0 -8
- package/form/public-api.d.ts +0 -9
- package/icon/icon.component.d.ts +0 -24
- package/icon/icon.module.d.ts +0 -7
- package/icon/icon.service.d.ts +0 -23
- package/icon/icons.d.ts +0 -770
- package/icon/provide-wr-icons.d.ts +0 -9
- package/icon/public-api.d.ts +0 -11
- package/input/input-types.d.ts +0 -1
- package/input/input.component.d.ts +0 -38
- package/input/input.module.d.ts +0 -7
- package/input/public-api.d.ts +0 -9
- package/pipes/new-array.pipe.d.ts +0 -13
- package/pipes/pipes.module.d.ts +0 -7
- package/pipes/public-api.d.ts +0 -8
- package/progress/progress.component.d.ts +0 -10
- package/progress/progress.module.d.ts +0 -7
- package/progress/public-api.d.ts +0 -8
- package/public-api.d.ts +0 -2
- package/qr/generator.d.ts +0 -7
- package/qr/public-api.d.ts +0 -8
- package/qr/qr.component.d.ts +0 -31
- package/qr/qr.module.d.ts +0 -7
- package/qr/qrcodegen.d.ts +0 -94
- package/skeleton/skeleton.component.d.ts +0 -10
- package/skeleton/skeleton.module.d.ts +0 -7
- package/spinner/spinner.component.d.ts +0 -11
- package/spinner/spinner.module.d.ts +0 -7
- package/tag/public-api.d.ts +0 -8
- package/tag/tag.component.d.ts +0 -21
- package/tag/tag.module.d.ts +0 -7
- package/textarea/public-api.d.ts +0 -8
- package/textarea/textarea.component.d.ts +0 -44
- package/textarea/textarea.module.d.ts +0 -7
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--wr-dropdown-bg: var(--wr-color-white);
|
|
3
|
+
--wr-dropdown-border-color: var(--wr-color-light-lighter);
|
|
4
|
+
--wr-dropdown-border-radius: 0.375rem;
|
|
5
|
+
--wr-dropdown-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
6
|
+
--wr-dropdown-padding: 4px 0;
|
|
7
|
+
--wr-dropdown-min-width: 160px;
|
|
8
|
+
|
|
9
|
+
--wr-dropdown-item-height: 32px;
|
|
10
|
+
--wr-dropdown-item-padding: 0 16px;
|
|
11
|
+
--wr-dropdown-item-color: var(--wr-color-dark);
|
|
12
|
+
--wr-dropdown-item-hover-bg: rgba(var(--wr-color-light-rgb), 0.2);
|
|
13
|
+
--wr-dropdown-item-active-bg: var(--wr-color-light-lighter);
|
|
14
|
+
--wr-dropdown-item-disabled-color: var(--wr-color-medium);
|
|
15
|
+
--wr-dropdown-item-gap: 16px;
|
|
16
|
+
--wr-dropdown-item-icon-size: 16px;
|
|
17
|
+
--wr-dropdown-item-font-size: 14px;
|
|
18
|
+
}
|
package/fesm2022/ngwr-alert.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, booleanAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding
|
|
3
|
-
import
|
|
4
|
-
import { provideWrIcons, close, WrIconModule } from 'ngwr/icon';
|
|
2
|
+
import { signal, booleanAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding } from '@angular/core';
|
|
3
|
+
import { provideWrIcons, close, WrIconComponent } from 'ngwr/icon';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* @license
|
|
@@ -26,7 +25,7 @@ class WrAlertComponent {
|
|
|
26
25
|
constructor() {
|
|
27
26
|
this.type = 'info';
|
|
28
27
|
this.closeable = false;
|
|
29
|
-
this.isClosed = signal(false);
|
|
28
|
+
this.isClosed = signal(false, ...(ngDevMode ? [{ debugName: "isClosed" }] : []));
|
|
30
29
|
}
|
|
31
30
|
get elClasses() {
|
|
32
31
|
return {
|
|
@@ -39,12 +38,12 @@ class WrAlertComponent {
|
|
|
39
38
|
onClose() {
|
|
40
39
|
this.isClosed.set(true);
|
|
41
40
|
}
|
|
42
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
43
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
41
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: WrAlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
42
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: WrAlertComponent, isStandalone: true, selector: "wr-alert", inputs: { title: "title", message: "message", type: "type", closeable: ["closeable", "closeable", booleanAttribute] }, host: { properties: { "class": "this.elClasses" } }, providers: [provideWrIcons([close])], ngImport: i0, template: "@if (!isClosed()) {\n <div class=\"wr-alert__wrapper\">\n <div class=\"wr-alert__body\">\n <p class=\"wr-alert__title\">{{ title }}</p>\n @if (message) {\n <p class=\"wr-alert__message\">{{ message }}</p>\n }\n </div>\n\n @if (closeable) {\n <div class=\"wr-alert-close\">\n <wr-icon name=\"close\" (click)=\"onClose()\"></wr-icon>\n </div>\n }\n </div>\n}\n", dependencies: [{ kind: "component", type: WrIconComponent, selector: "wr-icon", inputs: ["name"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
44
43
|
}
|
|
45
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: WrAlertComponent, decorators: [{
|
|
46
45
|
type: Component,
|
|
47
|
-
args: [{ selector: 'wr-alert', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
|
|
46
|
+
args: [{ selector: 'wr-alert', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [WrIconComponent], providers: [provideWrIcons([close])], template: "@if (!isClosed()) {\n <div class=\"wr-alert__wrapper\">\n <div class=\"wr-alert__body\">\n <p class=\"wr-alert__title\">{{ title }}</p>\n @if (message) {\n <p class=\"wr-alert__message\">{{ message }}</p>\n }\n </div>\n\n @if (closeable) {\n <div class=\"wr-alert-close\">\n <wr-icon name=\"close\" (click)=\"onClose()\"></wr-icon>\n </div>\n }\n </div>\n}\n" }]
|
|
48
47
|
}], propDecorators: { title: [{
|
|
49
48
|
type: Input,
|
|
50
49
|
args: [{ required: true }]
|
|
@@ -60,25 +59,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
|
|
|
60
59
|
args: ['class']
|
|
61
60
|
}] } });
|
|
62
61
|
|
|
63
|
-
/**
|
|
64
|
-
* @license
|
|
65
|
-
*
|
|
66
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
67
|
-
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
68
|
-
*/
|
|
69
|
-
class WrAlertModule {
|
|
70
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrAlertModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
71
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.3", ngImport: i0, type: WrAlertModule, imports: [WrAlertComponent], exports: [WrAlertComponent] }); }
|
|
72
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrAlertModule, imports: [WrAlertComponent] }); }
|
|
73
|
-
}
|
|
74
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrAlertModule, decorators: [{
|
|
75
|
-
type: NgModule,
|
|
76
|
-
args: [{
|
|
77
|
-
imports: [WrAlertComponent],
|
|
78
|
-
exports: [WrAlertComponent],
|
|
79
|
-
}]
|
|
80
|
-
}] });
|
|
81
|
-
|
|
82
62
|
/**
|
|
83
63
|
* @license
|
|
84
64
|
*
|
|
@@ -90,5 +70,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
|
|
|
90
70
|
* Generated bundle index. Do not edit.
|
|
91
71
|
*/
|
|
92
72
|
|
|
93
|
-
export { WrAlertComponent
|
|
73
|
+
export { WrAlertComponent };
|
|
94
74
|
//# sourceMappingURL=ngwr-alert.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-alert.mjs","sources":["../../../projects/lib/alert/alert-type.ts","../../../projects/lib/alert/alert.component.ts","../../../projects/lib/alert/alert.component.html","../../../projects/lib/alert/
|
|
1
|
+
{"version":3,"file":"ngwr-alert.mjs","sources":["../../../projects/lib/alert/alert-type.ts","../../../projects/lib/alert/alert.component.ts","../../../projects/lib/alert/alert.component.html","../../../projects/lib/alert/public-api.ts","../../../projects/lib/alert/ngwr-alert.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport type WrAlertType = 'info' | 'success' | 'warning' | 'danger';\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n Input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { SafeAny } from 'ngwr/cdk/types';\nimport { provideWrIcons, close, WrIconComponent } from 'ngwr/icon';\n\nimport { WrAlertType } from './alert-type';\n\n/**\n * NGWR alert component.\n * Closeable component for feedback.\n *\n * {@tutorial} [How to use wr-alert]{@link http://ngwr.dev/docs/components/alert}\n */\n@Component({\n selector: 'wr-alert',\n templateUrl: './alert.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [WrIconComponent],\n providers: [provideWrIcons([close])],\n})\nexport class WrAlertComponent {\n @Input({ required: true }) title!: string;\n @Input() message?: string;\n @Input() type: WrAlertType = 'info';\n @Input({ transform: booleanAttribute }) closeable = false;\n\n protected readonly isClosed = signal(false);\n\n @HostBinding('class')\n get elClasses(): SafeAny {\n return {\n 'wr-alert': true,\n 'wr-alert--success': this.type === 'success',\n 'wr-alert--warning': this.type === 'warning',\n 'wr-alert--danger': this.type === 'danger',\n };\n }\n\n onClose(): void {\n this.isClosed.set(true);\n }\n}\n","@if (!isClosed()) {\n <div class=\"wr-alert__wrapper\">\n <div class=\"wr-alert__body\">\n <p class=\"wr-alert__title\">{{ title }}</p>\n @if (message) {\n <p class=\"wr-alert__message\">{{ message }}</p>\n }\n </div>\n\n @if (closeable) {\n <div class=\"wr-alert-close\">\n <wr-icon name=\"close\" (click)=\"onClose()\"></wr-icon>\n </div>\n }\n </div>\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport * from './alert-type';\nexport * from './alert.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;;;;AAKG;;ACLH;;;;;AAKG;AAiBH;;;;;AAKG;MASU,gBAAgB,CAAA;AAR7B,IAAA,WAAA,GAAA;QAWW,IAAI,CAAA,IAAA,GAAgB,MAAM;QACK,IAAS,CAAA,SAAA,GAAG,KAAK;AAEtC,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,KAAK,oDAAC;AAe5C;AAbC,IAAA,IACI,SAAS,GAAA;QACX,OAAO;AACL,YAAA,UAAU,EAAE,IAAI;AAChB,YAAA,mBAAmB,EAAE,IAAI,CAAC,IAAI,KAAK,SAAS;AAC5C,YAAA,mBAAmB,EAAE,IAAI,CAAC,IAAI,KAAK,SAAS;AAC5C,YAAA,kBAAkB,EAAE,IAAI,CAAC,IAAI,KAAK,QAAQ;SAC3C;;IAGH,OAAO,GAAA;AACL,QAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;;+GAnBd,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAA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ar.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { NgOptimizedImage } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, ChangeDetectorRef, ElementRef, signal, booleanAttribute, numberAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding
|
|
4
|
-
import
|
|
5
|
-
import { WrSpinnerModule } from 'ngwr/spinner';
|
|
3
|
+
import { inject, ChangeDetectorRef, ElementRef, signal, booleanAttribute, numberAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding } from '@angular/core';
|
|
4
|
+
import { WrSpinnerComponent } from 'ngwr/spinner';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* @license
|
|
@@ -21,7 +20,7 @@ class WrAvatarComponent {
|
|
|
21
20
|
this.cdr = inject(ChangeDetectorRef);
|
|
22
21
|
this.elRef = inject(ElementRef);
|
|
23
22
|
this.remSize = 16;
|
|
24
|
-
this.isImgLoaded = signal(false);
|
|
23
|
+
this.isImgLoaded = signal(false, ...(ngDevMode ? [{ debugName: "isImgLoaded" }] : []));
|
|
25
24
|
this.rounded = false;
|
|
26
25
|
this._size = 6 * this.remSize;
|
|
27
26
|
this.remSize = this.calcRemToPx();
|
|
@@ -50,12 +49,12 @@ class WrAvatarComponent {
|
|
|
50
49
|
height: `${this.size}px`,
|
|
51
50
|
};
|
|
52
51
|
}
|
|
53
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
54
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
52
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: WrAvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
53
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: WrAvatarComponent, isStandalone: true, selector: "wr-avatar", inputs: { url: "url", alt: "alt", rounded: ["rounded", "rounded", booleanAttribute], size: ["size", "size", numberAttribute] }, host: { properties: { "class": "this.elClasses", "style": "this.elStyles" } }, ngImport: i0, template: "<ng-content />\n\n<!--\n img need to be wrapped with @if\n to check is url set\n to trigger (load) listener\n-->\n@if (url) {\n <img\n class=\"wr-avatar__img\"\n [ngSrc]=\"url\"\n (load)=\"isImgLoaded.set(true)\"\n [width]=\"size\"\n [height]=\"size\"\n [alt]=\"alt\"\n priority\n />\n}\n\n@if (!isImgLoaded()) {\n <wr-spinner class=\"wr-avatar__spin\" />\n}\n", dependencies: [{ kind: "directive", type: NgOptimizedImage, selector: "img[ngSrc]", inputs: ["ngSrc", "ngSrcset", "sizes", "width", "height", "decoding", "loading", "priority", "loaderParams", "disableOptimizedSrcset", "fill", "placeholder", "placeholderConfig", "src", "srcset"] }, { kind: "component", type: WrSpinnerComponent, selector: "wr-spinner", inputs: ["size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
55
54
|
}
|
|
56
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
55
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: WrAvatarComponent, decorators: [{
|
|
57
56
|
type: Component,
|
|
58
|
-
args: [{ selector: 'wr-avatar', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [NgOptimizedImage,
|
|
57
|
+
args: [{ selector: 'wr-avatar', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [NgOptimizedImage, WrSpinnerComponent], template: "<ng-content />\n\n<!--\n img need to be wrapped with @if\n to check is url set\n to trigger (load) listener\n-->\n@if (url) {\n <img\n class=\"wr-avatar__img\"\n [ngSrc]=\"url\"\n (load)=\"isImgLoaded.set(true)\"\n [width]=\"size\"\n [height]=\"size\"\n [alt]=\"alt\"\n priority\n />\n}\n\n@if (!isImgLoaded()) {\n <wr-spinner class=\"wr-avatar__spin\" />\n}\n" }]
|
|
59
58
|
}], ctorParameters: () => [], propDecorators: { url: [{
|
|
60
59
|
type: Input,
|
|
61
60
|
args: [{ required: true }]
|
|
@@ -76,25 +75,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
|
|
|
76
75
|
args: ['style']
|
|
77
76
|
}] } });
|
|
78
77
|
|
|
79
|
-
/**
|
|
80
|
-
* @license
|
|
81
|
-
*
|
|
82
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
83
|
-
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
84
|
-
*/
|
|
85
|
-
class WrAvatarModule {
|
|
86
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrAvatarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
87
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.3", ngImport: i0, type: WrAvatarModule, imports: [WrAvatarComponent], exports: [WrAvatarComponent] }); }
|
|
88
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrAvatarModule, imports: [WrAvatarComponent] }); }
|
|
89
|
-
}
|
|
90
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrAvatarModule, decorators: [{
|
|
91
|
-
type: NgModule,
|
|
92
|
-
args: [{
|
|
93
|
-
imports: [WrAvatarComponent],
|
|
94
|
-
exports: [WrAvatarComponent],
|
|
95
|
-
}]
|
|
96
|
-
}] });
|
|
97
|
-
|
|
98
78
|
/**
|
|
99
79
|
* @license
|
|
100
80
|
*
|
|
@@ -106,5 +86,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
|
|
|
106
86
|
* Generated bundle index. Do not edit.
|
|
107
87
|
*/
|
|
108
88
|
|
|
109
|
-
export { WrAvatarComponent
|
|
89
|
+
export { WrAvatarComponent };
|
|
110
90
|
//# sourceMappingURL=ngwr-avatar.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-avatar.mjs","sources":["../../../projects/lib/avatar/avatar.component.ts","../../../projects/lib/avatar/avatar.component.html","../../../projects/lib/avatar/
|
|
1
|
+
{"version":3,"file":"ngwr-avatar.mjs","sources":["../../../projects/lib/avatar/avatar.component.ts","../../../projects/lib/avatar/avatar.component.html","../../../projects/lib/avatar/public-api.ts","../../../projects/lib/avatar/ngwr-avatar.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { NgOptimizedImage } from '@angular/common';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n HostBinding,\n inject,\n Input,\n numberAttribute,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { SafeAny } from 'ngwr/cdk/types';\nimport { WrSpinnerComponent } from 'ngwr/spinner';\n\n@Component({\n selector: 'wr-avatar',\n templateUrl: './avatar.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [NgOptimizedImage, WrSpinnerComponent],\n})\nexport class WrAvatarComponent {\n readonly cdr = inject(ChangeDetectorRef);\n readonly elRef = inject(ElementRef);\n readonly remSize: number = 16;\n\n readonly isImgLoaded = signal(false);\n\n private calcRemToPx(): number {\n const nativeElement = this.elRef?.nativeElement as HTMLElement;\n const style = nativeElement?.ownerDocument?.documentElement;\n const fontSize = getComputedStyle(style)?.fontSize;\n return Number(fontSize) || 16;\n }\n\n constructor() {\n this.remSize = this.calcRemToPx();\n }\n\n @Input({ required: true }) url!: string;\n @Input({ required: true }) alt!: string;\n @Input({ transform: booleanAttribute }) rounded = false;\n\n /**\n * Width and height in rem\n * @example size=\"6\" transforms to 6 * remSize (16 by default)\n */\n @Input({ transform: numberAttribute })\n get size(): number {\n return this._size;\n }\n set size(value: number | string) {\n this._size = Number(value) * this.remSize;\n this.cdr.markForCheck();\n }\n private _size: number = 6 * this.remSize;\n\n @HostBinding('class')\n get elClasses(): SafeAny {\n return {\n 'wr-avatar': true,\n 'wr-avatar--rounded': this.rounded,\n 'wr-avatar--loaded': this.isImgLoaded(),\n };\n }\n\n @HostBinding('style')\n get elStyles(): SafeAny {\n return {\n width: `${this.size}px`,\n height: `${this.size}px`,\n };\n }\n}\n","<ng-content />\n\n<!--\n img need to be wrapped with @if\n to check is url set\n to trigger (load) listener\n-->\n@if (url) {\n <img\n class=\"wr-avatar__img\"\n [ngSrc]=\"url\"\n (load)=\"isImgLoaded.set(true)\"\n [width]=\"size\"\n [height]=\"size\"\n [alt]=\"alt\"\n priority\n />\n}\n\n@if (!isImgLoaded()) {\n <wr-spinner class=\"wr-avatar__spin\" />\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport * from './avatar.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;MA2BU,iBAAiB,CAAA;IAOpB,WAAW,GAAA;AACjB,QAAA,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,EAAE,aAA4B;AAC9D,QAAA,MAAM,KAAK,GAAG,aAAa,EAAE,aAAa,EAAE,eAAe;QAC3D,MAAM,QAAQ,GAAG,gBAAgB,CAAC,KAAK,CAAC,EAAE,QAAQ;AAClD,QAAA,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;;AAG/B,IAAA,WAAA,GAAA;AAbS,QAAA,IAAA,CAAA,GAAG,GAA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AAEG;;;;"}
|
package/fesm2022/ngwr-button.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { booleanAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding
|
|
2
|
+
import { booleanAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding } from '@angular/core';
|
|
3
3
|
import { WrIconComponent } from 'ngwr/icon';
|
|
4
|
-
import
|
|
5
|
-
import { WrSpinnerModule } from 'ngwr/spinner';
|
|
4
|
+
import { WrSpinnerComponent } from 'ngwr/spinner';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* @license
|
|
@@ -53,12 +52,12 @@ class WrButtonComponent {
|
|
|
53
52
|
'wr-btn--loading--disabled': this.loading && this.isDisabledWhenLoading,
|
|
54
53
|
};
|
|
55
54
|
}
|
|
56
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
57
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
55
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: WrButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
56
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: WrButtonComponent, isStandalone: true, selector: "wr-btn, button[wr-btn], a[wr-btn]", inputs: { color: "color", size: "size", icon: "icon", iconPosition: "iconPosition", disabled: ["disabled", "disabled", booleanAttribute], outlined: ["outlined", "outlined", booleanAttribute], rounded: ["rounded", "rounded", booleanAttribute], block: ["block", "block", booleanAttribute], loading: ["loading", "loading", booleanAttribute], isDisabledWhenLoading: ["isDisabledWhenLoading", "isDisabledWhenLoading", booleanAttribute] }, host: { properties: { "attr.disabled": "this.nativeDisabled", "class": "this.elClasses" } }, ngImport: i0, template: "@if (loading) {\n <wr-spinner class=\"wr-btn__spin\" />\n}\n@if (icon) {\n <wr-icon class=\"wr-btn__icon\" [name]=\"icon\" />\n}\n<span class=\"wr-btn__text\">\n <ng-content />\n</span>\n", dependencies: [{ kind: "component", type: WrIconComponent, selector: "wr-icon", inputs: ["name"] }, { kind: "component", type: WrSpinnerComponent, selector: "wr-spinner", inputs: ["size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
58
57
|
}
|
|
59
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
58
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: WrButtonComponent, decorators: [{
|
|
60
59
|
type: Component,
|
|
61
|
-
args: [{ selector: 'wr-btn, button[wr-btn], a[wr-btn]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [WrIconComponent,
|
|
60
|
+
args: [{ selector: 'wr-btn, button[wr-btn], a[wr-btn]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [WrIconComponent, WrSpinnerComponent], template: "@if (loading) {\n <wr-spinner class=\"wr-btn__spin\" />\n}\n@if (icon) {\n <wr-icon class=\"wr-btn__icon\" [name]=\"icon\" />\n}\n<span class=\"wr-btn__text\">\n <ng-content />\n</span>\n" }]
|
|
62
61
|
}], propDecorators: { color: [{
|
|
63
62
|
type: Input
|
|
64
63
|
}], size: [{
|
|
@@ -110,13 +109,12 @@ class WrButtonGroupComponent {
|
|
|
110
109
|
'wr-btn-group': true,
|
|
111
110
|
};
|
|
112
111
|
}
|
|
113
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
114
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
112
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: WrButtonGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
113
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.10", type: WrButtonGroupComponent, isStandalone: true, selector: "wr-btn-group", host: { properties: { "class": "this.classes" } }, ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
115
114
|
}
|
|
116
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: WrButtonGroupComponent, decorators: [{
|
|
117
116
|
type: Component,
|
|
118
117
|
args: [{
|
|
119
|
-
standalone: true,
|
|
120
118
|
selector: 'wr-btn-group',
|
|
121
119
|
template: '<ng-content />',
|
|
122
120
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -127,25 +125,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
|
|
|
127
125
|
args: ['class']
|
|
128
126
|
}] } });
|
|
129
127
|
|
|
130
|
-
/**
|
|
131
|
-
* @license
|
|
132
|
-
*
|
|
133
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
134
|
-
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
135
|
-
*/
|
|
136
|
-
class WrButtonModule {
|
|
137
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
138
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.3", ngImport: i0, type: WrButtonModule, imports: [WrButtonComponent, WrButtonGroupComponent], exports: [WrButtonComponent, WrButtonGroupComponent] }); }
|
|
139
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrButtonModule, imports: [WrButtonComponent] }); }
|
|
140
|
-
}
|
|
141
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrButtonModule, decorators: [{
|
|
142
|
-
type: NgModule,
|
|
143
|
-
args: [{
|
|
144
|
-
imports: [WrButtonComponent, WrButtonGroupComponent],
|
|
145
|
-
exports: [WrButtonComponent, WrButtonGroupComponent],
|
|
146
|
-
}]
|
|
147
|
-
}] });
|
|
148
|
-
|
|
149
128
|
/**
|
|
150
129
|
* @license
|
|
151
130
|
*
|
|
@@ -157,5 +136,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
|
|
|
157
136
|
* Generated bundle index. Do not edit.
|
|
158
137
|
*/
|
|
159
138
|
|
|
160
|
-
export { WrButtonComponent, WrButtonGroupComponent
|
|
139
|
+
export { WrButtonComponent, WrButtonGroupComponent };
|
|
161
140
|
//# sourceMappingURL=ngwr-button.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-button.mjs","sources":["../../../projects/lib/button/button.component.ts","../../../projects/lib/button/button.component.html","../../../projects/lib/button/button-group.component.ts","../../../projects/lib/button/
|
|
1
|
+
{"version":3,"file":"ngwr-button.mjs","sources":["../../../projects/lib/button/button.component.ts","../../../projects/lib/button/button.component.html","../../../projects/lib/button/button-group.component.ts","../../../projects/lib/button/public-api.ts","../../../projects/lib/button/ngwr-button.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n Input,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { SafeAny, WrThemeColor } from 'ngwr/cdk/types';\nimport { WrIconComponent, wrIconName } from 'ngwr/icon';\nimport { WrSpinnerComponent } from 'ngwr/spinner';\n\n/**\n * NGWR button component.\n * Trigger an operation or perform an action.\n *\n * {@tutorial} [How to use wr-btn]{@link http://ngwr.dev/docs/components/button}\n */\n@Component({\n selector: 'wr-btn, button[wr-btn], a[wr-btn]',\n templateUrl: './button.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [WrIconComponent, WrSpinnerComponent],\n})\nexport class WrButtonComponent {\n @Input() color?: WrThemeColor | null;\n @Input() size: 'default' | 'small' = 'default';\n @Input() icon: wrIconName | null = null;\n @Input() iconPosition: 'start' | 'end' = 'start';\n @Input({ transform: booleanAttribute }) disabled = false;\n @Input({ transform: booleanAttribute }) outlined = false;\n @Input({ transform: booleanAttribute }) rounded = false;\n @Input({ transform: booleanAttribute }) block = false;\n @Input({ transform: booleanAttribute }) loading = false;\n @Input({ transform: booleanAttribute }) isDisabledWhenLoading = true;\n\n @HostBinding('attr.disabled')\n get nativeDisabled(): '' | null {\n return this.disabled ? '' : null;\n }\n\n @HostBinding('class')\n get elClasses(): SafeAny {\n return {\n 'wr-btn': true,\n 'wr-btn--color-primary': this.color === 'primary',\n 'wr-btn--color-secondary': this.color === 'secondary',\n 'wr-btn--color-success': this.color === 'success',\n 'wr-btn--color-warning': this.color === 'warning',\n 'wr-btn--color-danger': this.color === 'danger',\n 'wr-btn--color-light': this.color === 'light',\n 'wr-btn--color-medium': this.color === 'medium',\n 'wr-btn--color-dark': this.color === 'dark',\n 'wr-btn--small': this.size === 'small',\n 'wr-btn--block': this.block,\n 'wr-btn--rounded': this.rounded,\n 'wr-btn--icon': this.icon,\n 'wr-btn--icon-start': this.icon && this.iconPosition === 'start',\n 'wr-btn--icon-end': this.icon && this.iconPosition === 'end',\n 'wr-btn--outlined': this.outlined,\n 'wr-btn--loading': this.loading,\n 'wr-btn--loading--disabled': this.loading && this.isDisabledWhenLoading,\n };\n }\n}\n","@if (loading) {\n <wr-spinner class=\"wr-btn__spin\" />\n}\n@if (icon) {\n <wr-icon class=\"wr-btn__icon\" [name]=\"icon\" />\n}\n<span class=\"wr-btn__text\">\n <ng-content />\n</span>\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ChangeDetectionStrategy, Component, HostBinding, ViewEncapsulation } from '@angular/core';\n\nimport { SafeAny } from 'ngwr/cdk/types';\n\n/**\n * NGWR button group.\n *\n * {@tutorial} [How to use wr-btn-group]{@link http://ngwr.dev/docs/components/button-group}\n */\n@Component({\n selector: 'wr-btn-group',\n template: '<ng-content />',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class WrButtonGroupComponent {\n @HostBinding('class')\n get classes(): SafeAny {\n return {\n 'wr-btn-group': true,\n };\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport * from './button.component';\nexport * from './button-group.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;AAeH;;;;;AAKG;MAQU,iBAAiB,CAAA;AAP9B,IAAA,WAAA,GAAA;QASW,IAAI,CAAA,IAAA,GAAwB,SAAS;QACrC,IAAI,CAAA,IAAA,GAAsB,IAAI;QAC9B,IAAY,CAAA,YAAA,GAAoB,OAAO;QACR,IAAQ,CAAA,QAAA,GAAG,KAAK;QAChB,IAAQ,CAAA,QAAA,GAAG,KAAK;QAChB,IAAO,CAAA,OAAA,GAAG,KAAK;QACf,IAAK,CAAA,KAAA,GAAG,KAAK;QACb,IAAO,CAAA,OAAA,GAAG,KAAK;QACf,IAAqB,CAAA,qBAAA,GAAG,IAAI;AA8BrE;AA5BC,IAAA,IACI,cAAc,GAAA;QAChB,OAAO,IAAI,C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ef, Directive } from '@angular/core';
|
|
3
3
|
import { Subject } from 'rxjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -10,16 +10,21 @@ import { Subject } from 'rxjs';
|
|
|
10
10
|
*/
|
|
11
11
|
class WrAbstractBase {
|
|
12
12
|
constructor() {
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated use destroyRef$ instead
|
|
15
|
+
* @protected
|
|
16
|
+
*/
|
|
13
17
|
this.destroyed$ = new Subject();
|
|
18
|
+
this.destroyRef$ = inject(DestroyRef);
|
|
14
19
|
}
|
|
15
20
|
ngOnDestroy() {
|
|
16
21
|
this.destroyed$.next();
|
|
17
22
|
this.destroyed$.complete();
|
|
18
23
|
}
|
|
19
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
20
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
24
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: WrAbstractBase, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
25
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.10", type: WrAbstractBase, isStandalone: true, ngImport: i0 }); }
|
|
21
26
|
}
|
|
22
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: WrAbstractBase, decorators: [{
|
|
23
28
|
type: Directive,
|
|
24
29
|
args: [{
|
|
25
30
|
standalone: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-cdk.mjs","sources":["../../../projects/lib/cdk/base.directive.ts","../../../projects/lib/cdk/public-api.ts","../../../projects/lib/cdk/ngwr-cdk.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive, OnDestroy } from '@angular/core';\n\nimport { Subject } from 'rxjs';\n\n@Directive({\n standalone: true,\n})\nexport abstract class WrAbstractBase implements OnDestroy {\n protected readonly destroyed$: Subject<void> = new Subject<void>();\n\n ngOnDestroy(): void {\n this.destroyed$.next();\n this.destroyed$.complete();\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport * from './base.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;;;;AAKG;MASmB,cAAc,CAAA;AAHpC,IAAA,WAAA,GAAA;
|
|
1
|
+
{"version":3,"file":"ngwr-cdk.mjs","sources":["../../../projects/lib/cdk/base.directive.ts","../../../projects/lib/cdk/public-api.ts","../../../projects/lib/cdk/ngwr-cdk.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { DestroyRef, Directive, inject, OnDestroy } from '@angular/core';\n\nimport { Subject } from 'rxjs';\n\n@Directive({\n standalone: true,\n})\nexport abstract class WrAbstractBase implements OnDestroy {\n /**\n * @deprecated use destroyRef$ instead\n * @protected\n */\n protected readonly destroyed$: Subject<void> = new Subject<void>();\n protected readonly destroyRef$ = inject(DestroyRef);\n\n ngOnDestroy(): void {\n this.destroyed$.next();\n this.destroyed$.complete();\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport * from './base.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;;;;AAKG;MASmB,cAAc,CAAA;AAHpC,IAAA,WAAA,GAAA;AAIE;;;AAGG;AACgB,QAAA,IAAA,CAAA,UAAU,GAAkB,IAAI,OAAO,EAAQ;AAC/C,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AAMpD;IAJC,WAAW,GAAA;AACT,QAAA,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;AACtB,QAAA,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE;;+GAVR,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAHnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACbD;;;;;AAKG;;ACLH;;AAEG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { signal, inject, ChangeDetectorRef, forwardRef, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding
|
|
3
|
+
import { signal, inject, ChangeDetectorRef, forwardRef, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding } from '@angular/core';
|
|
4
4
|
import * as i1 from '@angular/forms';
|
|
5
5
|
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
6
6
|
import { noop } from 'rxjs';
|
|
@@ -24,9 +24,9 @@ class WrCheckboxComponent extends WrAbstractBase {
|
|
|
24
24
|
super(...arguments);
|
|
25
25
|
this.id = generateRandomId();
|
|
26
26
|
this.icon = null;
|
|
27
|
-
this.inputValue = signal(null);
|
|
27
|
+
this.inputValue = signal(null, ...(ngDevMode ? [{ debugName: "inputValue" }] : []));
|
|
28
28
|
this.cdr = inject(ChangeDetectorRef);
|
|
29
|
-
this.isDisabled = signal(false);
|
|
29
|
+
this.isDisabled = signal(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
30
30
|
this.onChange = noop;
|
|
31
31
|
this.onTouched = noop;
|
|
32
32
|
}
|
|
@@ -54,8 +54,8 @@ class WrCheckboxComponent extends WrAbstractBase {
|
|
|
54
54
|
this.inputValue.set(value);
|
|
55
55
|
this.cdr.markForCheck();
|
|
56
56
|
}
|
|
57
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
58
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
57
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: WrCheckboxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
58
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: WrCheckboxComponent, isStandalone: true, selector: "wr-checkbox", inputs: { id: "id", icon: "icon" }, host: { properties: { "class": "this.elClasses", "attr.disabled": "this.nativeDisabled" } }, providers: [
|
|
59
59
|
{
|
|
60
60
|
provide: NG_VALUE_ACCESSOR,
|
|
61
61
|
// eslint-disable-next-line @angular-eslint/no-forward-ref
|
|
@@ -64,7 +64,7 @@ class WrCheckboxComponent extends WrAbstractBase {
|
|
|
64
64
|
},
|
|
65
65
|
], usesInheritance: true, ngImport: i0, template: "<label class=\"wr-checkbox__wrapper\" [for]=\"id\">\n <input\n class=\"wr-checkbox__input\"\n type=\"checkbox\"\n [id]=\"id\"\n [disabled]=\"isDisabled()\"\n [ngModel]=\"inputValue()\"\n (ngModelChange)=\"writeValue($event)\"\n />\n @if (icon) {\n <wr-icon class=\"wr-checkbox__icon\" [name]=\"icon\" />\n } @else {\n <div class=\"wr-checkbox-inner\">\n <div class=\"wr-checkbox-inner__mark\"></div>\n </div>\n }\n <ng-content />\n</label>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: WrIconComponent, selector: "wr-icon", inputs: ["name"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
66
66
|
}
|
|
67
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
67
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: WrCheckboxComponent, decorators: [{
|
|
68
68
|
type: Component,
|
|
69
69
|
args: [{ selector: 'wr-checkbox', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [FormsModule, WrIconComponent], providers: [
|
|
70
70
|
{
|
|
@@ -86,25 +86,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
|
|
|
86
86
|
args: ['attr.disabled']
|
|
87
87
|
}] } });
|
|
88
88
|
|
|
89
|
-
/**
|
|
90
|
-
* @license
|
|
91
|
-
*
|
|
92
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
93
|
-
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
94
|
-
*/
|
|
95
|
-
class WrCheckboxModule {
|
|
96
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
97
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.3", ngImport: i0, type: WrCheckboxModule, imports: [WrCheckboxComponent], exports: [WrCheckboxComponent] }); }
|
|
98
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrCheckboxModule, imports: [WrCheckboxComponent] }); }
|
|
99
|
-
}
|
|
100
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrCheckboxModule, decorators: [{
|
|
101
|
-
type: NgModule,
|
|
102
|
-
args: [{
|
|
103
|
-
imports: [WrCheckboxComponent],
|
|
104
|
-
exports: [WrCheckboxComponent],
|
|
105
|
-
}]
|
|
106
|
-
}] });
|
|
107
|
-
|
|
108
89
|
/**
|
|
109
90
|
* @license
|
|
110
91
|
*
|
|
@@ -116,5 +97,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
|
|
|
116
97
|
* Generated bundle index. Do not edit.
|
|
117
98
|
*/
|
|
118
99
|
|
|
119
|
-
export { WrCheckboxComponent
|
|
100
|
+
export { WrCheckboxComponent };
|
|
120
101
|
//# sourceMappingURL=ngwr-checkbox.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-checkbox.mjs","sources":["../../../projects/lib/checkbox/checkbox.component.ts","../../../projects/lib/checkbox/checkbox.component.html","../../../projects/lib/checkbox/
|
|
1
|
+
{"version":3,"file":"ngwr-checkbox.mjs","sources":["../../../projects/lib/checkbox/checkbox.component.ts","../../../projects/lib/checkbox/checkbox.component.html","../../../projects/lib/checkbox/public-api.ts","../../../projects/lib/checkbox/ngwr-checkbox.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n forwardRef,\n HostBinding,\n inject,\n Input,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport { noop } from 'rxjs';\n\nimport { WrAbstractBase } from 'ngwr/cdk';\nimport { SafeAny } from 'ngwr/cdk/types';\nimport { generateRandomId } from 'ngwr/cdk/utils';\nimport { WrIconComponent, wrIconName } from 'ngwr/icon';\n\n/**\n * NGWR checkbox component.\n *\n * {@tutorial} [How to use wr-checkbox]{@link http://ngwr.dev/docs/components/checkbox}\n */\n@Component({\n selector: 'wr-checkbox',\n templateUrl: './checkbox.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [FormsModule, WrIconComponent],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n // eslint-disable-next-line @angular-eslint/no-forward-ref\n useExisting: forwardRef(() => WrCheckboxComponent),\n multi: true,\n },\n ],\n})\nexport class WrCheckboxComponent extends WrAbstractBase implements ControlValueAccessor {\n @Input() id: string = generateRandomId();\n @Input() icon: wrIconName | null = null;\n\n @HostBinding('class')\n get elClasses(): SafeAny {\n return {\n 'wr-checkbox': true,\n 'wr-checkbox--checked': this.inputValue(),\n };\n }\n\n @HostBinding('attr.disabled')\n get nativeDisabled(): '' | null {\n return this.isDisabled() ? '' : null;\n }\n\n protected readonly inputValue = signal<boolean | null>(null);\n protected value?: boolean;\n\n private readonly cdr = inject(ChangeDetectorRef);\n protected readonly isDisabled = signal(false);\n\n onChange: (value: boolean) => void = noop;\n onTouched: () => void = noop;\n\n registerOnChange(fn: (value: boolean) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.isDisabled.set(coerceBooleanProperty(isDisabled));\n }\n\n writeValue(value: boolean): void {\n this.value = value;\n this.onChange(value);\n this.inputValue.set(value);\n this.cdr.markForCheck();\n }\n}\n","<label class=\"wr-checkbox__wrapper\" [for]=\"id\">\n <input\n class=\"wr-checkbox__input\"\n type=\"checkbox\"\n [id]=\"id\"\n [disabled]=\"isDisabled()\"\n [ngModel]=\"inputValue()\"\n (ngModelChange)=\"writeValue($event)\"\n />\n @if (icon) {\n <wr-icon class=\"wr-checkbox__icon\" [name]=\"icon\" />\n } @else {\n <div class=\"wr-checkbox-inner\">\n <div class=\"wr-checkbox-inner__mark\"></div>\n </div>\n }\n <ng-content />\n</label>\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nexport * from './checkbox.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;;;;AAKG;AAuBH;;;;AAIG;AAgBG,MAAO,mBAAoB,SAAQ,cAAc,CAAA;AAfvD,IAAA,WAAA,GAAA;;QAgBW,IAAE,CAAA,EAAA,GAAW,gBAAgB,EAAE;QAC/B,IAAI,CAAA,IAAA,GAAsB,IAAI;AAepB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAiB,IAAI,sDAAC;AAG3C,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC7B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,KAAK,sDAAC;QAE7C,IAAQ,CAAA,QAAA,GAA6B,IAAI;QACzC,IAAS,CAAA,SAAA,GAAe,IAAI;AAoB7B;AAxCC,IAAA,IACI,SAAS,GAAA;QACX,OAAO;AACL,YAAA,aAAa,EAAE,IAAI;AACnB,YAAA,sBAAsB,EAAE,IAAI,CAAC,UAAU,EAAE;SAC1C;;AAGH,IAAA,IACI,cAAc,GAAA;AAChB,QAAA,OAAO,IAAI,CAAC,UAAU,EAAE,GAAG,EAAE,GAAG,IAAI;;AAYtC,IAAA,gBAAgB,CAAC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