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
package/fesm2022/ngwr-input.mjs
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { signal, inject, ChangeDetectorRef, booleanAttribute, forwardRef, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding
|
|
3
|
+
import { signal, inject, ChangeDetectorRef, booleanAttribute, 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';
|
|
7
7
|
import { WrAbstractBase } from 'ngwr/cdk';
|
|
8
|
-
import
|
|
9
|
-
import { provideWrIcons, eye, eyeOff, WrIconModule } from 'ngwr/icon';
|
|
8
|
+
import { provideWrIcons, eye, eyeOff, WrIconComponent } from 'ngwr/icon';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* @license
|
|
@@ -29,11 +28,11 @@ class WrInputComponent extends WrAbstractBase {
|
|
|
29
28
|
this.passwordIcons = false;
|
|
30
29
|
this.readonly = false;
|
|
31
30
|
this.type = 'text';
|
|
32
|
-
this.inputValue = signal(null);
|
|
31
|
+
this.inputValue = signal(null, ...(ngDevMode ? [{ debugName: "inputValue" }] : []));
|
|
33
32
|
this.cdr = inject(ChangeDetectorRef);
|
|
34
|
-
this.eyeOn = signal(true);
|
|
35
|
-
this.isFocused = signal(false);
|
|
36
|
-
this.isDisabled = signal(false);
|
|
33
|
+
this.eyeOn = signal(true, ...(ngDevMode ? [{ debugName: "eyeOn" }] : []));
|
|
34
|
+
this.isFocused = signal(false, ...(ngDevMode ? [{ debugName: "isFocused" }] : []));
|
|
35
|
+
this.isDisabled = signal(false, ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
37
36
|
this.onChange = noop;
|
|
38
37
|
this.onTouch = noop;
|
|
39
38
|
}
|
|
@@ -73,8 +72,8 @@ class WrInputComponent extends WrAbstractBase {
|
|
|
73
72
|
this.eyeOn.set(true);
|
|
74
73
|
}
|
|
75
74
|
}
|
|
76
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
77
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
75
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: WrInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
76
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: WrInputComponent, isStandalone: true, selector: "wr-input", inputs: { placeholder: "placeholder", prefix: "prefix", suffix: "suffix", rounded: ["rounded", "rounded", booleanAttribute], passwordIcons: ["passwordIcons", "passwordIcons", booleanAttribute], readonly: ["readonly", "readonly", booleanAttribute], type: "type" }, host: { properties: { "class": "this.elClasses" } }, providers: [
|
|
78
77
|
provideWrIcons([eye, eyeOff]),
|
|
79
78
|
{
|
|
80
79
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -82,11 +81,11 @@ class WrInputComponent extends WrAbstractBase {
|
|
|
82
81
|
useExisting: forwardRef(() => WrInputComponent),
|
|
83
82
|
multi: true,
|
|
84
83
|
},
|
|
85
|
-
], usesInheritance: true, ngImport: i0, template: "@if (prefix) {\n <div class=\"wr-input-prefix\">\n <span class=\"wr-input-prefix__text\">{{ prefix }}</span>\n </div>\n}\n\n<input\n class=\"wr-input__native\"\n [type]=\"type\"\n [placeholder]=\"placeholder\"\n [readonly]=\"readonly\"\n [disabled]=\"isDisabled()\"\n [ngModel]=\"inputValue()\"\n (ngModelChange)=\"writeValue($event)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n/>\n\n@if (passwordIcons) {\n <div class=\"wr-input-icon\" [class.wr-input-icon--disabled]=\"isDisabled()\" (click)=\"onPasswordVisibilityChange()\">\n <wr-icon class=\"wr-input-icon__icon\" [name]=\"eyeOn() ? 'eye' : 'eye-off'\" />\n </div>\n}\n\n@if (suffix) {\n <div class=\"wr-input-suffix\">\n <span class=\"wr-input-suffix__text\">{{ suffix }}</span>\n </div>\n}\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { 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: "
|
|
84
|
+
], usesInheritance: true, ngImport: i0, template: "@if (prefix) {\n <div class=\"wr-input-prefix\">\n <span class=\"wr-input-prefix__text\">{{ prefix }}</span>\n </div>\n}\n\n<input\n class=\"wr-input__native\"\n [type]=\"type\"\n [placeholder]=\"placeholder\"\n [readonly]=\"readonly\"\n [disabled]=\"isDisabled()\"\n [ngModel]=\"inputValue()\"\n (ngModelChange)=\"writeValue($event)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n/>\n\n@if (passwordIcons) {\n <div class=\"wr-input-icon\" [class.wr-input-icon--disabled]=\"isDisabled()\" (click)=\"onPasswordVisibilityChange()\">\n <wr-icon class=\"wr-input-icon__icon\" [name]=\"eyeOn() ? 'eye' : 'eye-off'\" />\n </div>\n}\n\n@if (suffix) {\n <div class=\"wr-input-suffix\">\n <span class=\"wr-input-suffix__text\">{{ suffix }}</span>\n </div>\n}\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { 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 }); }
|
|
86
85
|
}
|
|
87
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
86
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: WrInputComponent, decorators: [{
|
|
88
87
|
type: Component,
|
|
89
|
-
args: [{ selector: 'wr-input', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [FormsModule,
|
|
88
|
+
args: [{ selector: 'wr-input', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [FormsModule, WrIconComponent], providers: [
|
|
90
89
|
provideWrIcons([eye, eyeOff]),
|
|
91
90
|
{
|
|
92
91
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -117,25 +116,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
|
|
|
117
116
|
args: ['class']
|
|
118
117
|
}] } });
|
|
119
118
|
|
|
120
|
-
/**
|
|
121
|
-
* @license
|
|
122
|
-
*
|
|
123
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
124
|
-
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
125
|
-
*/
|
|
126
|
-
class WrInputModule {
|
|
127
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
128
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.3", ngImport: i0, type: WrInputModule, imports: [WrInputComponent], exports: [WrInputComponent] }); }
|
|
129
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrInputModule, imports: [WrInputComponent] }); }
|
|
130
|
-
}
|
|
131
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrInputModule, decorators: [{
|
|
132
|
-
type: NgModule,
|
|
133
|
-
args: [{
|
|
134
|
-
imports: [WrInputComponent],
|
|
135
|
-
exports: [WrInputComponent],
|
|
136
|
-
}]
|
|
137
|
-
}] });
|
|
138
|
-
|
|
139
119
|
/**
|
|
140
120
|
* @license
|
|
141
121
|
*
|
|
@@ -147,5 +127,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
|
|
|
147
127
|
* Generated bundle index. Do not edit.
|
|
148
128
|
*/
|
|
149
129
|
|
|
150
|
-
export { WrInputComponent
|
|
130
|
+
export { WrInputComponent };
|
|
151
131
|
//# sourceMappingURL=ngwr-input.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-input.mjs","sources":["../../../projects/lib/input/input.component.ts","../../../projects/lib/input/input.component.html","../../../projects/lib/input/
|
|
1
|
+
{"version":3,"file":"ngwr-input.mjs","sources":["../../../projects/lib/input/input.component.ts","../../../projects/lib/input/input.component.html","../../../projects/lib/input/public-api.ts","../../../projects/lib/input/ngwr-input.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 booleanAttribute,\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 { provideWrIcons, eye, eyeOff, WrIconComponent } from 'ngwr/icon';\n\nimport { WrInputType } from './input-types';\n\n/**\n * NGWR input component.\n *\n * {@tutorial} [How to use wr-alert]{@link http://ngwr.dev/docs/components/input}\n */\n@Component({\n selector: 'wr-input',\n templateUrl: './input.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [FormsModule, WrIconComponent],\n providers: [\n provideWrIcons([eye, eyeOff]),\n {\n provide: NG_VALUE_ACCESSOR,\n // eslint-disable-next-line @angular-eslint/no-forward-ref\n useExisting: forwardRef(() => WrInputComponent),\n multi: true,\n },\n ],\n})\nexport class WrInputComponent extends WrAbstractBase implements ControlValueAccessor {\n @Input() placeholder = '';\n @Input() prefix: string | null = null;\n @Input() suffix: string | null = null;\n @Input({ transform: booleanAttribute }) rounded = false;\n @Input({ transform: booleanAttribute }) passwordIcons = false;\n @Input({ transform: booleanAttribute }) readonly = false;\n @Input() type: WrInputType = 'text';\n\n @HostBinding('class')\n get elClasses(): SafeAny {\n return {\n 'wr-input': true,\n 'wr-input--rounded': this.rounded,\n 'wr-input--has-prefix': this.prefix,\n 'wr-input--has-suffix': this.suffix,\n 'wr-input--password': this.passwordIcons,\n 'wr-input--disabled': this.isDisabled(),\n 'wr-input--focused': this.isFocused(),\n };\n }\n\n protected readonly inputValue = signal<string | null>(null);\n\n protected value?: string;\n\n private readonly cdr = inject(ChangeDetectorRef);\n protected readonly eyeOn = signal(true);\n protected readonly isFocused = signal(false);\n protected readonly isDisabled = signal(false);\n\n onChange: (value: string) => void = noop;\n onTouch: () => void = noop;\n\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouch = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.isDisabled.set(coerceBooleanProperty(isDisabled));\n }\n\n writeValue(value: string): void {\n this.value = value;\n this.onChange(value);\n this.inputValue.set(value);\n this.cdr.markForCheck();\n }\n\n onPasswordVisibilityChange(): void {\n if (this.type === 'password') {\n this.type = 'text';\n this.eyeOn.set(false);\n } else {\n this.type = 'password';\n this.eyeOn.set(true);\n }\n }\n}\n","@if (prefix) {\n <div class=\"wr-input-prefix\">\n <span class=\"wr-input-prefix__text\">{{ prefix }}</span>\n </div>\n}\n\n<input\n class=\"wr-input__native\"\n [type]=\"type\"\n [placeholder]=\"placeholder\"\n [readonly]=\"readonly\"\n [disabled]=\"isDisabled()\"\n [ngModel]=\"inputValue()\"\n (ngModelChange)=\"writeValue($event)\"\n (focus)=\"isFocused.set(true)\"\n (blur)=\"isFocused.set(false)\"\n/>\n\n@if (passwordIcons) {\n <div class=\"wr-input-icon\" [class.wr-input-icon--disabled]=\"isDisabled()\" (click)=\"onPasswordVisibilityChange()\">\n <wr-icon class=\"wr-input-icon__icon\" [name]=\"eyeOn() ? 'eye' : 'eye-off'\" />\n </div>\n}\n\n@if (suffix) {\n <div class=\"wr-input-suffix\">\n <span class=\"wr-input-suffix__text\">{{ suffix }}</span>\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 './input-types';\nexport * from './input.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;AAKG;AAyBH;;;;AAIG;AAiBG,MAAO,gBAAiB,SAAQ,cAAc,CAAA;AAhBpD,IAAA,WAAA,GAAA;;QAiBW,IAAW,CAAA,WAAA,GAAG,EAAE;QAChB,IAAM,CAAA,MAAA,GAAkB,IAAI;QAC5B,IAAM,CAAA,MAAA,GAAkB,IAAI;QACG,IAAO,CAAA,OAAA,GAAG,KAAK;QACf,IAAa,CAAA,aAAA,GAAG,KAAK;QACrB,IAAQ,CAAA,QAAA,GAAG,KAAK;QAC/C,IAAI,CAAA,IAAA,GAAgB,MAAM;AAehB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAgB,IAAI,sDAAC;AAI1C,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC7B,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,IAAI,iDAAC;AACpB,QAAA,IAAA,CAAA,SAAS,G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
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { model, input, numberAttribute, booleanAttribute, computed, Component, ChangeDetectionStrategy, ViewEncapsulation, HostBinding } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { FormsModule } from '@angular/forms';
|
|
5
|
+
import { WrButtonComponent } from 'ngwr/button';
|
|
6
|
+
import { provideWrIcons, arrowBack, arrowForward } from 'ngwr/icon';
|
|
7
|
+
import { WrSelectComponent, WrOptionComponent } from 'ngwr/select';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @license
|
|
11
|
+
*
|
|
12
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
13
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @license
|
|
18
|
+
*
|
|
19
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
20
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
21
|
+
*/
|
|
22
|
+
class WrPaginationComponent {
|
|
23
|
+
constructor() {
|
|
24
|
+
this.currentPage = model(1, ...(ngDevMode ? [{ debugName: "currentPage" }] : []));
|
|
25
|
+
this.total = input(0, ...(ngDevMode ? [{ debugName: "total", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
26
|
+
this.pageSize = model(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
|
|
27
|
+
this.pageSizeOptions = input([10, 20, 50, 100], ...(ngDevMode ? [{ debugName: "pageSizeOptions" }] : []));
|
|
28
|
+
this.showSizeChanger = input(false, ...(ngDevMode ? [{ debugName: "showSizeChanger", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
29
|
+
this.showTotal = input(false, ...(ngDevMode ? [{ debugName: "showTotal", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
30
|
+
this.position = input('start', ...(ngDevMode ? [{ debugName: "position" }] : []));
|
|
31
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
32
|
+
this.ofLabel = input('of', ...(ngDevMode ? [{ debugName: "ofLabel" }] : []));
|
|
33
|
+
this.String = String;
|
|
34
|
+
this.totalPages = computed(() => Math.ceil(this.total() / this.pageSize()), ...(ngDevMode ? [{ debugName: "totalPages" }] : []));
|
|
35
|
+
this.currentRange = computed(() => {
|
|
36
|
+
const start = (this.currentPage() - 1) * this.pageSize() + 1;
|
|
37
|
+
const end = Math.min(this.currentPage() * this.pageSize(), this.total());
|
|
38
|
+
return `${start}-${end} ${this.ofLabel()} ${this.total()}`;
|
|
39
|
+
}, ...(ngDevMode ? [{ debugName: "currentRange" }] : []));
|
|
40
|
+
this.pages = computed(() => {
|
|
41
|
+
const total = this.totalPages();
|
|
42
|
+
const current = this.currentPage();
|
|
43
|
+
const items = [];
|
|
44
|
+
if (total <= 7) {
|
|
45
|
+
return Array.from({ length: total }, (_, i) => i + 1);
|
|
46
|
+
}
|
|
47
|
+
items.push(1);
|
|
48
|
+
if (current > 4) {
|
|
49
|
+
items.push('...');
|
|
50
|
+
}
|
|
51
|
+
let start;
|
|
52
|
+
let end;
|
|
53
|
+
if (current <= 4) {
|
|
54
|
+
start = 2;
|
|
55
|
+
end = 5;
|
|
56
|
+
}
|
|
57
|
+
else if (current >= total - 3) {
|
|
58
|
+
start = total - 4;
|
|
59
|
+
end = total - 1;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
start = current - 2;
|
|
63
|
+
end = current + 2;
|
|
64
|
+
}
|
|
65
|
+
for (let i = start; i <= end; i++) {
|
|
66
|
+
items.push(i);
|
|
67
|
+
}
|
|
68
|
+
if (current < total - 3) {
|
|
69
|
+
items.push('...');
|
|
70
|
+
}
|
|
71
|
+
if (end !== total) {
|
|
72
|
+
items.push(total);
|
|
73
|
+
}
|
|
74
|
+
return items;
|
|
75
|
+
}, ...(ngDevMode ? [{ debugName: "pages" }] : []));
|
|
76
|
+
}
|
|
77
|
+
get hostClasses() {
|
|
78
|
+
return {
|
|
79
|
+
'wr-pagination': true,
|
|
80
|
+
'wr-pagination--disabled': this.disabled(),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
isCurrentPage(page) {
|
|
84
|
+
return this.currentPage() === page;
|
|
85
|
+
}
|
|
86
|
+
onPageChange(page) {
|
|
87
|
+
if (this.disabled() || page === this.currentPage() || page < 1 || page > this.totalPages()) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
this.currentPage.set(page);
|
|
91
|
+
}
|
|
92
|
+
onPageSizeChange(size) {
|
|
93
|
+
if (this.disabled() || size === this.pageSize()) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
this.pageSize.set(size);
|
|
97
|
+
const newTotalPages = Math.ceil(this.total() / size);
|
|
98
|
+
if (this.currentPage() > newTotalPages) {
|
|
99
|
+
this.onPageChange(newTotalPages);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: WrPaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
103
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: WrPaginationComponent, isStandalone: true, selector: "wr-pagination", inputs: { currentPage: { classPropertyName: "currentPage", publicName: "currentPage", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, showSizeChanger: { classPropertyName: "showSizeChanger", publicName: "showSizeChanger", isSignal: true, isRequired: false, transformFunction: null }, showTotal: { classPropertyName: "showTotal", publicName: "showTotal", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ofLabel: { classPropertyName: "ofLabel", publicName: "ofLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { currentPage: "currentPageChange", pageSize: "pageSizeChange" }, host: { properties: { "class": "this.hostClasses" } }, providers: [provideWrIcons([arrowBack, arrowForward])], ngImport: i0, template: "<div class=\"wr-pagination-container\" [class]=\"'wr-pagination--' + position()\">\n @if (showTotal()) {\n <span class=\"wr-pagination-total\">\n {{ currentRange() }}\n </span>\n }\n\n <div class=\"wr-pagination-items\">\n <wr-btn\n outlined\n [disabled]=\"disabled() || currentPage() === 1\"\n (click)=\"onPageChange(currentPage() - 1)\"\n icon=\"arrow-back\"\n ></wr-btn>\n\n @for (page of pages(); track page) {\n @if (page === '...') {\n <span class=\"wr-pagination-ellipsis\">...</span>\n } @else {\n <wr-btn\n [outlined]=\"!isCurrentPage(page)\"\n [color]=\"isCurrentPage(page) ? 'primary' : 'medium'\"\n [disabled]=\"disabled()\"\n (click)=\"onPageChange(page)\"\n >\n {{ page }}\n </wr-btn>\n }\n }\n\n <wr-btn\n outlined\n [disabled]=\"disabled() || currentPage() === totalPages()\"\n (click)=\"onPageChange(currentPage() + 1)\"\n icon=\"arrow-forward\"\n ></wr-btn>\n </div>\n\n @if (showSizeChanger()) {\n <wr-select [disabled]=\"disabled()\" [ngModel]=\"pageSize()\" (ngModelChange)=\"onPageSizeChange($event)\">\n @for (option of pageSizeOptions(); track option) {\n <wr-option [value]=\"option\" [label]=\"String(option)\"></wr-option>\n }\n </wr-select>\n }\n</div>\n", dependencies: [{ kind: "component", type: WrButtonComponent, selector: "wr-btn, button[wr-btn], a[wr-btn]", inputs: ["color", "size", "icon", "iconPosition", "disabled", "outlined", "rounded", "block", "loading", "isDisabledWhenLoading"] }, { kind: "component", type: WrSelectComponent, selector: "wr-select", inputs: ["placeholder", "noItemsLabel", "multiple", "searchable", "clearable", "maxMultipleCount", "disabled"] }, { kind: "component", type: WrOptionComponent, selector: "wr-option", inputs: ["value", "label", "disabled"] }, { kind: "ngmodule", type: FormsModule }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
104
|
+
}
|
|
105
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: WrPaginationComponent, decorators: [{
|
|
106
|
+
type: Component,
|
|
107
|
+
args: [{ selector: 'wr-pagination', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [WrButtonComponent, WrSelectComponent, WrOptionComponent, FormsModule], providers: [provideWrIcons([arrowBack, arrowForward])], template: "<div class=\"wr-pagination-container\" [class]=\"'wr-pagination--' + position()\">\n @if (showTotal()) {\n <span class=\"wr-pagination-total\">\n {{ currentRange() }}\n </span>\n }\n\n <div class=\"wr-pagination-items\">\n <wr-btn\n outlined\n [disabled]=\"disabled() || currentPage() === 1\"\n (click)=\"onPageChange(currentPage() - 1)\"\n icon=\"arrow-back\"\n ></wr-btn>\n\n @for (page of pages(); track page) {\n @if (page === '...') {\n <span class=\"wr-pagination-ellipsis\">...</span>\n } @else {\n <wr-btn\n [outlined]=\"!isCurrentPage(page)\"\n [color]=\"isCurrentPage(page) ? 'primary' : 'medium'\"\n [disabled]=\"disabled()\"\n (click)=\"onPageChange(page)\"\n >\n {{ page }}\n </wr-btn>\n }\n }\n\n <wr-btn\n outlined\n [disabled]=\"disabled() || currentPage() === totalPages()\"\n (click)=\"onPageChange(currentPage() + 1)\"\n icon=\"arrow-forward\"\n ></wr-btn>\n </div>\n\n @if (showSizeChanger()) {\n <wr-select [disabled]=\"disabled()\" [ngModel]=\"pageSize()\" (ngModelChange)=\"onPageSizeChange($event)\">\n @for (option of pageSizeOptions(); track option) {\n <wr-option [value]=\"option\" [label]=\"String(option)\"></wr-option>\n }\n </wr-select>\n }\n</div>\n" }]
|
|
108
|
+
}], propDecorators: { currentPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentPage", required: false }] }, { type: i0.Output, args: ["currentPageChange"] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }, { type: i0.Output, args: ["pageSizeChange"] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], showSizeChanger: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSizeChanger", required: false }] }], showTotal: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTotal", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], ofLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ofLabel", required: false }] }], hostClasses: [{
|
|
109
|
+
type: HostBinding,
|
|
110
|
+
args: ['class']
|
|
111
|
+
}] } });
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @license
|
|
115
|
+
*
|
|
116
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
117
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
118
|
+
*/
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Generated bundle index. Do not edit.
|
|
122
|
+
*/
|
|
123
|
+
|
|
124
|
+
export { WrPaginationComponent };
|
|
125
|
+
//# sourceMappingURL=ngwr-pagination.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngwr-pagination.mjs","sources":["../../../projects/lib/pagination/pagination.types.ts","../../../projects/lib/pagination/pagination.component.ts","../../../projects/lib/pagination/pagination.component.html","../../../projects/lib/pagination/public-api.ts","../../../projects/lib/pagination/ngwr-pagination.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 WrPaginationPosition = 'start' | 'center' | 'end';\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 ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n input,\n model,\n numberAttribute,\n HostBinding,\n} from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n\nimport { WrButtonComponent } from 'ngwr/button';\nimport { provideWrIcons, arrowBack, arrowForward } from 'ngwr/icon';\nimport { WrOptionComponent, WrSelectComponent } from 'ngwr/select';\n\nimport { WrPaginationPosition } from './pagination.types';\n\n@Component({\n selector: 'wr-pagination',\n templateUrl: './pagination.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [WrButtonComponent, WrSelectComponent, WrOptionComponent, FormsModule],\n providers: [provideWrIcons([arrowBack, arrowForward])],\n})\nexport class WrPaginationComponent {\n currentPage = model<number>(1);\n total = input<number, unknown>(0, { transform: numberAttribute });\n pageSize = model<number>(10);\n pageSizeOptions = input<number[]>([10, 20, 50, 100]);\n showSizeChanger = input<boolean, unknown>(false, { transform: booleanAttribute });\n showTotal = input<boolean, unknown>(false, { transform: booleanAttribute });\n position = input<WrPaginationPosition>('start');\n disabled = input<boolean, unknown>(false, { transform: booleanAttribute });\n ofLabel = input<string>('of');\n\n @HostBinding('class')\n get hostClasses(): Record<string, boolean> {\n return {\n 'wr-pagination': true,\n 'wr-pagination--disabled': this.disabled(),\n };\n }\n\n protected readonly String = String;\n\n protected readonly totalPages = computed(() => Math.ceil(this.total() / this.pageSize()));\n\n protected readonly currentRange = computed(() => {\n const start = (this.currentPage() - 1) * this.pageSize() + 1;\n const end = Math.min(this.currentPage() * this.pageSize(), this.total());\n return `${start}-${end} ${this.ofLabel()} ${this.total()}`;\n });\n\n protected readonly pages = computed(() => {\n const total = this.totalPages();\n const current = this.currentPage();\n const items: (number | '...')[] = [];\n\n if (total <= 7) {\n return Array.from({ length: total }, (_, i) => i + 1);\n }\n\n items.push(1);\n\n if (current > 4) {\n items.push('...');\n }\n\n let start: number;\n let end: number;\n\n if (current <= 4) {\n start = 2;\n end = 5;\n } else if (current >= total - 3) {\n start = total - 4;\n end = total - 1;\n } else {\n start = current - 2;\n end = current + 2;\n }\n\n for (let i = start; i <= end; i++) {\n items.push(i);\n }\n\n if (current < total - 3) {\n items.push('...');\n }\n\n if (end !== total) {\n items.push(total);\n }\n\n return items;\n });\n\n protected isCurrentPage(page: number): boolean {\n return this.currentPage() === page;\n }\n\n protected onPageChange(page: number): void {\n if (this.disabled() || page === this.currentPage() || page < 1 || page > this.totalPages()) {\n return;\n }\n\n this.currentPage.set(page);\n }\n\n protected onPageSizeChange(size: number): void {\n if (this.disabled() || size === this.pageSize()) {\n return;\n }\n\n this.pageSize.set(size);\n\n const newTotalPages = Math.ceil(this.total() / size);\n if (this.currentPage() > newTotalPages) {\n this.onPageChange(newTotalPages);\n }\n }\n}\n","<div class=\"wr-pagination-container\" [class]=\"'wr-pagination--' + position()\">\n @if (showTotal()) {\n <span class=\"wr-pagination-total\">\n {{ currentRange() }}\n </span>\n }\n\n <div class=\"wr-pagination-items\">\n <wr-btn\n outlined\n [disabled]=\"disabled() || currentPage() === 1\"\n (click)=\"onPageChange(currentPage() - 1)\"\n icon=\"arrow-back\"\n ></wr-btn>\n\n @for (page of pages(); track page) {\n @if (page === '...') {\n <span class=\"wr-pagination-ellipsis\">...</span>\n } @else {\n <wr-btn\n [outlined]=\"!isCurrentPage(page)\"\n [color]=\"isCurrentPage(page) ? 'primary' : 'medium'\"\n [disabled]=\"disabled()\"\n (click)=\"onPageChange(page)\"\n >\n {{ page }}\n </wr-btn>\n }\n }\n\n <wr-btn\n outlined\n [disabled]=\"disabled() || currentPage() === totalPages()\"\n (click)=\"onPageChange(currentPage() + 1)\"\n icon=\"arrow-forward\"\n ></wr-btn>\n </div>\n\n @if (showSizeChanger()) {\n <wr-select [disabled]=\"disabled()\" [ngModel]=\"pageSize()\" (ngModelChange)=\"onPageSizeChange($event)\">\n @for (option of pageSizeOptions(); track option) {\n <wr-option [value]=\"option\" [label]=\"String(option)\"></wr-option>\n }\n </wr-select>\n }\n</div>\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 './pagination.types';\nexport * from './pagination.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;AAKG;;ACLH;;;;;AAKG;MA6BU,qBAAqB,CAAA;AARlC,IAAA,WAAA,GAAA;AASE,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAS,CAAC,uDAAC;AAC9B,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAkB,CAAC,yCAAI,SAAS,EAAE,eAAe,EAAA,CAAA,GAAA,CAA5B,EAAE,SAAS,EAAE,eAAe,EAAE,GAAC;AACjE,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAS,EAAE,oDAAC;AAC5B,QAAA,IAAA,CAAA,eAAe,GAAG,KAAK,CAAW,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,2DAAC;AACpD,QAAA,IAAA,CAAA,eAAe,GAAG,KAAK,CAAmB,KAAK,mDAAI,SAAS,EAAE,gBAAgB,EAAA,CAAA,GAAA,CAA7B,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAC;AACjF,QAAA,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AuB,CAAC,MAAM,EAChC,aAAA,EAAA,iBAAiB,CAAC,IAAI,EAC5B,OAAA,EAAA,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,WAAW,CAAC,EACpE,SAAA,EAAA,CAAC,cAAc,CAAC,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,EAAA,QAAA,EAAA,01CAAA,EAAA;;sBAarD,WAAW;uBAAC,OAAO;;;AE7CtB;;;;;AAKG;;ACLH;;AAEG;;;;"}
|
package/fesm2022/ngwr-pipes.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Pipe
|
|
2
|
+
import { Pipe } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
@@ -11,36 +11,16 @@ class NewArrayPipe {
|
|
|
11
11
|
transform(arrayLength) {
|
|
12
12
|
return new Array(arrayLength);
|
|
13
13
|
}
|
|
14
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
15
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
14
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NewArrayPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
15
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.10", ngImport: i0, type: NewArrayPipe, isStandalone: true, name: "newArray" }); }
|
|
16
16
|
}
|
|
17
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: NewArrayPipe, decorators: [{
|
|
18
18
|
type: Pipe,
|
|
19
19
|
args: [{
|
|
20
|
-
standalone: true,
|
|
21
20
|
name: 'newArray',
|
|
22
21
|
}]
|
|
23
22
|
}] });
|
|
24
23
|
|
|
25
|
-
/**
|
|
26
|
-
* @license
|
|
27
|
-
*
|
|
28
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
29
|
-
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
30
|
-
*/
|
|
31
|
-
class WrPipesModule {
|
|
32
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrPipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
33
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.3", ngImport: i0, type: WrPipesModule, imports: [NewArrayPipe], exports: [NewArrayPipe] }); }
|
|
34
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrPipesModule }); }
|
|
35
|
-
}
|
|
36
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrPipesModule, decorators: [{
|
|
37
|
-
type: NgModule,
|
|
38
|
-
args: [{
|
|
39
|
-
imports: [NewArrayPipe],
|
|
40
|
-
exports: [NewArrayPipe],
|
|
41
|
-
}]
|
|
42
|
-
}] });
|
|
43
|
-
|
|
44
24
|
/**
|
|
45
25
|
* @license
|
|
46
26
|
*
|
|
@@ -52,5 +32,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
|
|
|
52
32
|
* Generated bundle index. Do not edit.
|
|
53
33
|
*/
|
|
54
34
|
|
|
55
|
-
export { NewArrayPipe
|
|
35
|
+
export { NewArrayPipe };
|
|
56
36
|
//# sourceMappingURL=ngwr-pipes.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-pipes.mjs","sources":["../../../projects/lib/pipes/new-array.pipe.ts","../../../projects/lib/pipes/
|
|
1
|
+
{"version":3,"file":"ngwr-pipes.mjs","sources":["../../../projects/lib/pipes/new-array.pipe.ts","../../../projects/lib/pipes/public-api.ts","../../../projects/lib/pipes/ngwr-pipes.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 { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'newArray',\n})\nexport class NewArrayPipe implements PipeTransform {\n transform(arrayLength: number): number[] {\n return new Array(arrayLength);\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 './new-array.pipe';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAA;;;;;AAKG;MAOU,YAAY,CAAA;AACvB,IAAA,SAAS,CAAC,WAAmB,EAAA;AAC3B,QAAA,OAAO,IAAI,KAAK,CAAC,WAAW,CAAC;;+GAFpB,YAAY,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;6GAAZ,YAAY,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,UAAA,EAAA,CAAA,CAAA;;4FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBAHxB,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,UAAU;AACjB,iBAAA;;;ACXD;;;;;AAKG;;ACLH;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { numberAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding
|
|
2
|
+
import { numberAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, HostBinding } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
@@ -25,12 +25,12 @@ class WrProgressComponent {
|
|
|
25
25
|
'wr-progress--color-dark': this.color === 'dark',
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
29
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "
|
|
28
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: WrProgressComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
29
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "20.3.10", type: WrProgressComponent, isStandalone: true, selector: "wr-progress", inputs: { color: "color", percent: ["percent", "percent", numberAttribute] }, host: { properties: { "class": "this.elClasses" } }, ngImport: i0, template: "<div class=\"wr-progress__bg\" [style.width.%]=\"percent\"></div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
30
30
|
}
|
|
31
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
31
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: WrProgressComponent, decorators: [{
|
|
32
32
|
type: Component,
|
|
33
|
-
args: [{
|
|
33
|
+
args: [{ selector: 'wr-progress', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"wr-progress__bg\" [style.width.%]=\"percent\"></div>\n" }]
|
|
34
34
|
}], propDecorators: { color: [{
|
|
35
35
|
type: Input
|
|
36
36
|
}], percent: [{
|
|
@@ -41,25 +41,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
|
|
|
41
41
|
args: ['class']
|
|
42
42
|
}] } });
|
|
43
43
|
|
|
44
|
-
/**
|
|
45
|
-
* @license
|
|
46
|
-
*
|
|
47
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
48
|
-
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
49
|
-
*/
|
|
50
|
-
class WrProgressModule {
|
|
51
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrProgressModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
52
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.3", ngImport: i0, type: WrProgressModule, imports: [WrProgressComponent], exports: [WrProgressComponent] }); }
|
|
53
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrProgressModule }); }
|
|
54
|
-
}
|
|
55
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrProgressModule, decorators: [{
|
|
56
|
-
type: NgModule,
|
|
57
|
-
args: [{
|
|
58
|
-
imports: [WrProgressComponent],
|
|
59
|
-
exports: [WrProgressComponent],
|
|
60
|
-
}]
|
|
61
|
-
}] });
|
|
62
|
-
|
|
63
44
|
/**
|
|
64
45
|
* @license
|
|
65
46
|
*
|
|
@@ -71,5 +52,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
|
|
|
71
52
|
* Generated bundle index. Do not edit.
|
|
72
53
|
*/
|
|
73
54
|
|
|
74
|
-
export { WrProgressComponent
|
|
55
|
+
export { WrProgressComponent };
|
|
75
56
|
//# sourceMappingURL=ngwr-progress.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-progress.mjs","sources":["../../../projects/lib/progress/progress.component.ts","../../../projects/lib/progress/progress.component.html","../../../projects/lib/progress/
|
|
1
|
+
{"version":3,"file":"ngwr-progress.mjs","sources":["../../../projects/lib/progress/progress.component.ts","../../../projects/lib/progress/progress.component.html","../../../projects/lib/progress/public-api.ts","../../../projects/lib/progress/ngwr-progress.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 ChangeDetectionStrategy,\n Component,\n HostBinding,\n Input,\n numberAttribute,\n ViewEncapsulation,\n} from '@angular/core';\n\nimport { SafeAny, WrThemeColor } from 'ngwr/cdk/types';\n\n@Component({\n selector: 'wr-progress',\n templateUrl: './progress.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class WrProgressComponent {\n @Input() color: WrThemeColor | null = null;\n @Input({ transform: numberAttribute }) percent = 0;\n\n @HostBinding('class')\n get elClasses(): SafeAny {\n return {\n 'wr-progress': true,\n 'wr-progress--color-primary': this.color === 'primary',\n 'wr-progress--color-secondary': this.color === 'secondary',\n 'wr-progress--color-success': this.color === 'success',\n 'wr-progress--color-warning': this.color === 'warning',\n 'wr-progress--color-danger': this.color === 'danger',\n 'wr-progress--color-light': this.color === 'light',\n 'wr-progress--color-medium': this.color === 'medium',\n 'wr-progress--color-dark': this.color === 'dark',\n };\n }\n}\n","<div class=\"wr-progress__bg\" [style.width.%]=\"percent\"></div>\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 './progress.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAA;;;;;AAKG;MAmBU,mBAAmB,CAAA;AANhC,IAAA,WAAA,GAAA;QAOW,IAAK,CAAA,KAAA,GAAwB,IAAI;QACH,IAAO,CAAA,OAAA,GAAG,CAAC;AAgBnD;AAdC,IAAA,IACI,SAAS,GAAA;QACX,OAAO;AACL,YAAA,aAAa,EAAE,IAAI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AS,EAAE,eAAe,EAAE;;sBAEpC,WAAW;uBAAC,OAAO;;;AE5BtB;;;;;AAKG;;ACLH;;AAEG;;;;"}
|
package/fesm2022/ngwr-qr.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isPlatformBrowser } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, PLATFORM_ID, ElementRef, signal, numberAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, HostBinding, ViewChild, Input
|
|
3
|
+
import { inject, PLATFORM_ID, ElementRef, signal, numberAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, HostBinding, ViewChild, Input } from '@angular/core';
|
|
4
4
|
import { WrAbstractBase } from 'ngwr/cdk';
|
|
5
5
|
import { WrIconService } from 'ngwr/icon';
|
|
6
6
|
|
|
@@ -819,11 +819,11 @@ var qrcodegen;
|
|
|
819
819
|
})(qrcodegen || (qrcodegen = {}));
|
|
820
820
|
/*---- Public helper enumeration ----*/
|
|
821
821
|
(function (qrcodegen) {
|
|
822
|
-
|
|
822
|
+
/*
|
|
823
|
+
* The error correction level in a QR Code symbol. Immutable.
|
|
824
|
+
*/
|
|
825
|
+
let QrCode;
|
|
823
826
|
(function (QrCode) {
|
|
824
|
-
/*
|
|
825
|
-
* The error correction level in a QR Code symbol. Immutable.
|
|
826
|
-
*/
|
|
827
827
|
class Ecc {
|
|
828
828
|
/*-- Constants --*/
|
|
829
829
|
static { this.LOW = new Ecc(0, 1); } // The QR Code can tolerate about 7% erroneous codewords
|
|
@@ -842,14 +842,11 @@ var qrcodegen;
|
|
|
842
842
|
}
|
|
843
843
|
QrCode.Ecc = Ecc;
|
|
844
844
|
})(QrCode = qrcodegen.QrCode || (qrcodegen.QrCode = {}));
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
845
|
+
/*
|
|
846
|
+
* Describes how a segment's data bits are interpreted. Immutable.
|
|
847
|
+
*/
|
|
848
|
+
let QrSegment;
|
|
849
849
|
(function (QrSegment) {
|
|
850
|
-
/*
|
|
851
|
-
* Describes how a segment's data bits are interpreted. Immutable.
|
|
852
|
-
*/
|
|
853
850
|
class Mode {
|
|
854
851
|
/*-- Constants --*/
|
|
855
852
|
static { this.NUMERIC = new Mode(0x1, [10, 12, 14]); }
|
|
@@ -981,7 +978,7 @@ class WrQrComponent extends WrAbstractBase {
|
|
|
981
978
|
this.pid = inject(PLATFORM_ID);
|
|
982
979
|
this.elRef = inject(ElementRef);
|
|
983
980
|
this.wrIconService = inject(WrIconService);
|
|
984
|
-
this.isBrowser = signal(true);
|
|
981
|
+
this.isBrowser = signal(true, ...(ngDevMode ? [{ debugName: "isBrowser" }] : []));
|
|
985
982
|
}
|
|
986
983
|
ngOnChanges(changes) {
|
|
987
984
|
const { value, level, padding, color, bgColor, size, icon, iconSize } = changes;
|
|
@@ -1012,12 +1009,12 @@ class WrQrComponent extends WrAbstractBase {
|
|
|
1012
1009
|
drawCanvas(this.canvas.nativeElement, plotQRCodeData(this.value, this.level), this.size, 10, this.padding, this.color, this.bgColor, this.iconSize, icon);
|
|
1013
1010
|
}
|
|
1014
1011
|
}
|
|
1015
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1016
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1012
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: WrQrComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1013
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: WrQrComponent, isStandalone: true, selector: "wr-qr", inputs: { value: "value", level: "level", padding: ["padding", "padding", numberAttribute], color: "color", bgColor: "bgColor", size: ["size", "size", numberAttribute], icon: "icon", iconSize: ["iconSize", "iconSize", numberAttribute] }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "canvas", first: true, predicate: ["canvas"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "@if (isBrowser()) {\n <canvas #canvas></canvas>\n}\n", changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1017
1014
|
}
|
|
1018
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1015
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: WrQrComponent, decorators: [{
|
|
1019
1016
|
type: Component,
|
|
1020
|
-
args: [{
|
|
1017
|
+
args: [{ selector: 'wr-qr', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "@if (isBrowser()) {\n <canvas #canvas></canvas>\n}\n" }]
|
|
1021
1018
|
}], propDecorators: { class: [{
|
|
1022
1019
|
type: HostBinding
|
|
1023
1020
|
}], canvas: [{
|
|
@@ -1045,25 +1042,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
|
|
|
1045
1042
|
args: [{ transform: numberAttribute }]
|
|
1046
1043
|
}] } });
|
|
1047
1044
|
|
|
1048
|
-
/**
|
|
1049
|
-
* @license
|
|
1050
|
-
*
|
|
1051
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
1052
|
-
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
1053
|
-
*/
|
|
1054
|
-
class WrQrModule {
|
|
1055
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrQrModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1056
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.3", ngImport: i0, type: WrQrModule, imports: [WrQrComponent], exports: [WrQrComponent] }); }
|
|
1057
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrQrModule }); }
|
|
1058
|
-
}
|
|
1059
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: WrQrModule, decorators: [{
|
|
1060
|
-
type: NgModule,
|
|
1061
|
-
args: [{
|
|
1062
|
-
imports: [WrQrComponent],
|
|
1063
|
-
exports: [WrQrComponent],
|
|
1064
|
-
}]
|
|
1065
|
-
}] });
|
|
1066
|
-
|
|
1067
1045
|
/**
|
|
1068
1046
|
* @license
|
|
1069
1047
|
*
|
|
@@ -1075,5 +1053,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
|
|
|
1075
1053
|
* Generated bundle index. Do not edit.
|
|
1076
1054
|
*/
|
|
1077
1055
|
|
|
1078
|
-
export { WrQrComponent
|
|
1056
|
+
export { WrQrComponent };
|
|
1079
1057
|
//# sourceMappingURL=ngwr-qr.mjs.map
|