@yoozsoft/yoozsoft-ng 5.3.5 → 7.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/README.md +143 -24
- package/assets/js/UTIF.js-master/LICENSE +21 -21
- package/assets/js/UTIF.js-master/README.md +72 -72
- package/assets/js/UTIF.js-master/UTIF.js +1762 -1762
- package/assets/js/UTIF.js-master/package-lock.json +13 -13
- package/assets/js/UTIF.js-master/package.json +24 -0
- package/assets/styles/components/_ys-navbar.scss +22 -0
- package/assets/styles/components/_ys-pagination.scss +10 -0
- package/assets/styles/{ys-layout.scss → utilities/ys-layout.scss} +1 -1
- package/assets/styles/ys-styles.scss +2 -0
- package/autocomplete/package.json +4 -0
- package/date/package.json +4 -0
- package/datepicker/package.json +4 -0
- package/dropdown/package.json +4 -0
- package/fesm2022/yoozsoft-yoozsoft-ng-autocomplete.mjs +257 -197
- package/fesm2022/yoozsoft-yoozsoft-ng-autocomplete.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-date.mjs +562 -0
- package/fesm2022/yoozsoft-yoozsoft-ng-date.mjs.map +1 -0
- package/fesm2022/yoozsoft-yoozsoft-ng-datepicker.mjs +600 -837
- package/fesm2022/yoozsoft-yoozsoft-ng-datepicker.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-dropdown.mjs +161 -151
- package/fesm2022/yoozsoft-yoozsoft-ng-dropdown.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-file-upload.mjs +93 -103
- package/fesm2022/yoozsoft-yoozsoft-ng-file-upload.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-footer.mjs +16 -21
- package/fesm2022/yoozsoft-yoozsoft-ng-footer.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-loading.mjs +20 -24
- package/fesm2022/yoozsoft-yoozsoft-ng-loading.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-navbar.mjs +60 -76
- package/fesm2022/yoozsoft-yoozsoft-ng-navbar.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-overlay.mjs +11 -15
- package/fesm2022/yoozsoft-yoozsoft-ng-overlay.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-pagination.mjs +61 -55
- package/fesm2022/yoozsoft-yoozsoft-ng-pagination.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-password-strength.mjs +142 -130
- package/fesm2022/yoozsoft-yoozsoft-ng-password-strength.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-pipes.mjs +44 -0
- package/fesm2022/yoozsoft-yoozsoft-ng-pipes.mjs.map +1 -0
- package/fesm2022/yoozsoft-yoozsoft-ng-progress.mjs +51 -34
- package/fesm2022/yoozsoft-yoozsoft-ng-progress.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-rating.mjs +155 -0
- package/fesm2022/yoozsoft-yoozsoft-ng-rating.mjs.map +1 -0
- package/fesm2022/yoozsoft-yoozsoft-ng-select.mjs +78 -80
- package/fesm2022/yoozsoft-yoozsoft-ng-select.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-sidebar.mjs +99 -99
- package/fesm2022/yoozsoft-yoozsoft-ng-sidebar.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-table.mjs +316 -0
- package/fesm2022/yoozsoft-yoozsoft-ng-table.mjs.map +1 -0
- package/fesm2022/yoozsoft-yoozsoft-ng-tiff-viewer.mjs +128 -114
- package/fesm2022/yoozsoft-yoozsoft-ng-tiff-viewer.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-toast.mjs +112 -62
- package/fesm2022/yoozsoft-yoozsoft-ng-toast.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-validators.mjs +37 -0
- package/fesm2022/yoozsoft-yoozsoft-ng-validators.mjs.map +1 -0
- package/fesm2022/yoozsoft-yoozsoft-ng.mjs.map +1 -1
- package/file-upload/package.json +4 -0
- package/footer/package.json +4 -0
- package/loading/package.json +4 -0
- package/navbar/package.json +4 -0
- package/overlay/package.json +4 -0
- package/package.json +61 -38
- package/pagination/package.json +4 -0
- package/password-strength/package.json +4 -0
- package/pipes/package.json +4 -0
- package/progress/package.json +4 -0
- package/rating/package.json +4 -0
- package/select/package.json +4 -0
- package/sidebar/package.json +4 -0
- package/table/package.json +4 -0
- package/tiff-viewer/package.json +4 -0
- package/toast/package.json +4 -0
- package/types/yoozsoft-yoozsoft-ng-autocomplete.d.ts +79 -0
- package/types/yoozsoft-yoozsoft-ng-date.d.ts +118 -0
- package/types/yoozsoft-yoozsoft-ng-datepicker.d.ts +120 -0
- package/types/yoozsoft-yoozsoft-ng-dropdown.d.ts +76 -0
- package/types/yoozsoft-yoozsoft-ng-file-upload.d.ts +75 -0
- package/types/yoozsoft-yoozsoft-ng-footer.d.ts +26 -0
- package/types/yoozsoft-yoozsoft-ng-loading.d.ts +14 -0
- package/types/yoozsoft-yoozsoft-ng-navbar.d.ts +60 -0
- package/types/yoozsoft-yoozsoft-ng-overlay.d.ts +10 -0
- package/types/yoozsoft-yoozsoft-ng-pagination.d.ts +31 -0
- package/types/yoozsoft-yoozsoft-ng-password-strength.d.ts +73 -0
- package/types/yoozsoft-yoozsoft-ng-pipes.d.ts +11 -0
- package/types/yoozsoft-yoozsoft-ng-progress.d.ts +31 -0
- package/types/yoozsoft-yoozsoft-ng-rating.d.ts +56 -0
- package/types/yoozsoft-yoozsoft-ng-select.d.ts +43 -0
- package/types/yoozsoft-yoozsoft-ng-sidebar.d.ts +69 -0
- package/types/yoozsoft-yoozsoft-ng-table.d.ts +137 -0
- package/types/yoozsoft-yoozsoft-ng-tiff-viewer.d.ts +53 -0
- package/types/yoozsoft-yoozsoft-ng-toast.d.ts +66 -0
- package/types/yoozsoft-yoozsoft-ng-validators.d.ts +5 -0
- package/validators/package.json +4 -0
- package/autocomplete/index.d.ts +0 -71
- package/datepicker/index.d.ts +0 -291
- package/directives/index.d.ts +0 -17
- package/dropdown/index.d.ts +0 -62
- package/fesm2022/yoozsoft-yoozsoft-ng-directives.mjs +0 -57
- package/fesm2022/yoozsoft-yoozsoft-ng-directives.mjs.map +0 -1
- package/file-upload/index.d.ts +0 -72
- package/footer/index.d.ts +0 -25
- package/loading/index.d.ts +0 -13
- package/navbar/index.d.ts +0 -56
- package/overlay/index.d.ts +0 -11
- package/pagination/index.d.ts +0 -29
- package/password-strength/index.d.ts +0 -84
- package/progress/index.d.ts +0 -28
- package/select/index.d.ts +0 -39
- package/sidebar/index.d.ts +0 -94
- package/tiff-viewer/index.d.ts +0 -52
- package/toast/index.d.ts +0 -53
- /package/assets/styles/{ys-preloader-9.scss → preloaders/ys-preloader-9.scss} +0 -0
- /package/assets/styles/{ys-preloader.scss → preloaders/ys-preloader.scss} +0 -0
- /package/{index.d.ts → types/yoozsoft-yoozsoft-ng.d.ts} +0 -0
|
@@ -1,69 +1,75 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, model, output, computed, effect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
4
|
import { FormsModule } from '@angular/forms';
|
|
5
5
|
import { NgbPagination } from '@ng-bootstrap/ng-bootstrap';
|
|
6
6
|
|
|
7
|
-
class
|
|
8
|
-
rowsPerPage = [10, 25, 50]
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
class YsPagination {
|
|
8
|
+
rowsPerPage = input([10, 25, 50], /* @ts-ignore */
|
|
9
|
+
...(ngDevMode ? [{ debugName: "rowsPerPage" }] : /* istanbul ignore next */ []));
|
|
10
|
+
pageReport = input(true, /* @ts-ignore */
|
|
11
|
+
...(ngDevMode ? [{ debugName: "pageReport" }] : /* istanbul ignore next */ []));
|
|
12
|
+
pageReportTemplate = input('Showing {first} to {last} of {totalRecords} items', /* @ts-ignore */
|
|
13
|
+
...(ngDevMode ? [{ debugName: "pageReportTemplate" }] : /* istanbul ignore next */ []));
|
|
14
|
+
ellipses = input(false, /* @ts-ignore */
|
|
15
|
+
...(ngDevMode ? [{ debugName: "ellipses" }] : /* istanbul ignore next */ []));
|
|
16
|
+
boundaryLinks = input(true, /* @ts-ignore */
|
|
17
|
+
...(ngDevMode ? [{ debugName: "boundaryLinks" }] : /* istanbul ignore next */ []));
|
|
18
|
+
maxSize = input(5, /* @ts-ignore */
|
|
19
|
+
...(ngDevMode ? [{ debugName: "maxSize" }] : /* istanbul ignore next */ []));
|
|
20
|
+
rotate = input(true, /* @ts-ignore */
|
|
21
|
+
...(ngDevMode ? [{ debugName: "rotate" }] : /* istanbul ignore next */ []));
|
|
22
|
+
page = model(1, /* @ts-ignore */
|
|
23
|
+
...(ngDevMode ? [{ debugName: "page" }] : /* istanbul ignore next */ []));
|
|
24
|
+
pageSizeSelection = input(true, /* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "pageSizeSelection" }] : /* istanbul ignore next */ []));
|
|
26
|
+
pageSize = model(10, /* @ts-ignore */
|
|
27
|
+
...(ngDevMode ? [{ debugName: "pageSize" }] : /* istanbul ignore next */ []));
|
|
28
|
+
collectionSize = input(0, /* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "collectionSize" }] : /* istanbul ignore next */ []));
|
|
30
|
+
pageChanged = output();
|
|
31
|
+
firstIndex = computed(() => (this.page() - 1) * this.pageSize(), /* @ts-ignore */
|
|
32
|
+
...(ngDevMode ? [{ debugName: "firstIndex" }] : /* istanbul ignore next */ []));
|
|
33
|
+
lastIndex = computed(() => Math.min(this.firstIndex() + this.pageSize(), this.collectionSize()), /* @ts-ignore */
|
|
34
|
+
...(ngDevMode ? [{ debugName: "lastIndex" }] : /* istanbul ignore next */ []));
|
|
35
|
+
totalPages = computed(() => Math.ceil(this.collectionSize() / this.pageSize()) || 1, /* @ts-ignore */
|
|
36
|
+
...(ngDevMode ? [{ debugName: "totalPages" }] : /* istanbul ignore next */ []));
|
|
37
|
+
firstRecord = computed(() => (this.collectionSize() === 0 ? 0 : this.firstIndex() + 1), /* @ts-ignore */
|
|
38
|
+
...(ngDevMode ? [{ debugName: "firstRecord" }] : /* istanbul ignore next */ []));
|
|
39
|
+
pageReportText = computed(() => this.pageReportTemplate()
|
|
40
|
+
.replace('{first}', this.firstRecord() + '')
|
|
41
|
+
.replace('{last}', this.lastIndex() + '')
|
|
42
|
+
.replace('{totalRecords}', this.collectionSize() + ''), /* @ts-ignore */
|
|
43
|
+
...(ngDevMode ? [{ debugName: "pageReportText" }] : /* istanbul ignore next */ []));
|
|
44
|
+
constructor() {
|
|
45
|
+
effect(() => {
|
|
46
|
+
if (!this.rowsPerPage().includes(this.pageSize())) {
|
|
47
|
+
this.pageSize.set(this.rowsPerPage()[0] ?? 10);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
24
50
|
}
|
|
25
51
|
changePage(page) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
52
|
+
this.page.set(page);
|
|
53
|
+
this.pageChanged.emit({
|
|
54
|
+
page,
|
|
55
|
+
pageSize: this.pageSize(),
|
|
56
|
+
});
|
|
30
57
|
}
|
|
31
58
|
changePageSize(size) {
|
|
32
|
-
this.pageSize
|
|
33
|
-
this.page
|
|
34
|
-
this.
|
|
59
|
+
this.pageSize.set(+size);
|
|
60
|
+
this.page.set(1);
|
|
61
|
+
this.pageChanged.emit({
|
|
62
|
+
page: 1,
|
|
63
|
+
pageSize: size,
|
|
64
|
+
});
|
|
35
65
|
}
|
|
36
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
37
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
66
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: YsPagination, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
67
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: YsPagination, isStandalone: true, selector: "ys-pagination", inputs: { rowsPerPage: { classPropertyName: "rowsPerPage", publicName: "rowsPerPage", isSignal: true, isRequired: false, transformFunction: null }, pageReport: { classPropertyName: "pageReport", publicName: "pageReport", isSignal: true, isRequired: false, transformFunction: null }, pageReportTemplate: { classPropertyName: "pageReportTemplate", publicName: "pageReportTemplate", isSignal: true, isRequired: false, transformFunction: null }, ellipses: { classPropertyName: "ellipses", publicName: "ellipses", isSignal: true, isRequired: false, transformFunction: null }, boundaryLinks: { classPropertyName: "boundaryLinks", publicName: "boundaryLinks", isSignal: true, isRequired: false, transformFunction: null }, maxSize: { classPropertyName: "maxSize", publicName: "maxSize", isSignal: true, isRequired: false, transformFunction: null }, rotate: { classPropertyName: "rotate", publicName: "rotate", isSignal: true, isRequired: false, transformFunction: null }, page: { classPropertyName: "page", publicName: "page", isSignal: true, isRequired: false, transformFunction: null }, pageSizeSelection: { classPropertyName: "pageSizeSelection", publicName: "pageSizeSelection", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, collectionSize: { classPropertyName: "collectionSize", publicName: "collectionSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { page: "pageChange", pageSize: "pageSizeChange", pageChanged: "pageChanged" }, ngImport: i0, template: "<div class=\"ys-pagination d-flex flex-wrap justify-content-center justify-content-sm-between align-items-center gap-2\">\n\n <!-- \u0635\u0641\u062D\u0647\u200C\u0628\u0646\u062F\u06CC -->\n <ngb-pagination [collectionSize]=\"collectionSize()\" [page]=\"page()\" [pageSize]=\"pageSize()\" [maxSize]=\"maxSize()\"\n [rotate]=\"rotate()\" [ellipses]=\"ellipses()\" [boundaryLinks]=\"boundaryLinks()\"\n (pageChange)=\"changePage($event)\" />\n\n <!-- \u0627\u0646\u062A\u062E\u0627\u0628 \u062A\u0639\u062F\u0627\u062F \u062F\u0631 \u0647\u0631 \u0635\u0641\u062D\u0647 -->\n @if(pageSizeSelection()){\n <select class=\"pagination-select form-select form-select-sm w-auto me-auto\" [ngModel]=\"pageSize()\"\n (ngModelChange)=\"changePageSize($event)\" id=\"pagination\">\n @for (rows of rowsPerPage(); track rows) {\n <option [value]=\"rows\">{{ rows }}</option>\n }\n </select>\n }\n\n <!-- \u06AF\u0632\u0627\u0631\u0634 -->\n @if(pageReport()){\n <small class=\"pagination-report text-muted ms-auto\">\n {{ pageReportText() }}\n </small>\n }\n\n</div>", styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple]):not([ngNoCva])[formControlName],select:not([multiple]):not([ngNoCva])[formControl],select:not([multiple]):not([ngNoCva])[ngModel]", inputs: ["compareWith"] }, { 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: NgbPagination, selector: "ngb-pagination", inputs: ["disabled", "boundaryLinks", "directionLinks", "ellipses", "rotate", "collectionSize", "maxSize", "page", "pageSize", "size"], outputs: ["pageChange"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
38
68
|
}
|
|
39
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: YsPagination, decorators: [{
|
|
40
70
|
type: Component,
|
|
41
|
-
args: [{ selector: 'ys-pagination', imports: [FormsModule, NgbPagination], template: "<div class=\"ys-pagination d-flex flex-wrap justify-content-center justify-content-sm-between align-items-center gap-2\">\
|
|
42
|
-
}], propDecorators: { rowsPerPage: [{
|
|
43
|
-
type: Input
|
|
44
|
-
}], pageReport: [{
|
|
45
|
-
type: Input
|
|
46
|
-
}], pageReportTemplate: [{
|
|
47
|
-
type: Input
|
|
48
|
-
}], ellipses: [{
|
|
49
|
-
type: Input
|
|
50
|
-
}], boundaryLinks: [{
|
|
51
|
-
type: Input
|
|
52
|
-
}], maxSize: [{
|
|
53
|
-
type: Input
|
|
54
|
-
}], rotate: [{
|
|
55
|
-
type: Input
|
|
56
|
-
}], page: [{
|
|
57
|
-
type: Input
|
|
58
|
-
}], pageSizeSelection: [{
|
|
59
|
-
type: Input
|
|
60
|
-
}], pageSize: [{
|
|
61
|
-
type: Input
|
|
62
|
-
}], collectionSize: [{
|
|
63
|
-
type: Input
|
|
64
|
-
}], pageChange: [{
|
|
65
|
-
type: Output
|
|
66
|
-
}] } });
|
|
71
|
+
args: [{ selector: 'ys-pagination', imports: [FormsModule, NgbPagination], changeDetection: ChangeDetectionStrategy.Eager, template: "<div class=\"ys-pagination d-flex flex-wrap justify-content-center justify-content-sm-between align-items-center gap-2\">\n\n <!-- \u0635\u0641\u062D\u0647\u200C\u0628\u0646\u062F\u06CC -->\n <ngb-pagination [collectionSize]=\"collectionSize()\" [page]=\"page()\" [pageSize]=\"pageSize()\" [maxSize]=\"maxSize()\"\n [rotate]=\"rotate()\" [ellipses]=\"ellipses()\" [boundaryLinks]=\"boundaryLinks()\"\n (pageChange)=\"changePage($event)\" />\n\n <!-- \u0627\u0646\u062A\u062E\u0627\u0628 \u062A\u0639\u062F\u0627\u062F \u062F\u0631 \u0647\u0631 \u0635\u0641\u062D\u0647 -->\n @if(pageSizeSelection()){\n <select class=\"pagination-select form-select form-select-sm w-auto me-auto\" [ngModel]=\"pageSize()\"\n (ngModelChange)=\"changePageSize($event)\" id=\"pagination\">\n @for (rows of rowsPerPage(); track rows) {\n <option [value]=\"rows\">{{ rows }}</option>\n }\n </select>\n }\n\n <!-- \u06AF\u0632\u0627\u0631\u0634 -->\n @if(pageReport()){\n <small class=\"pagination-report text-muted ms-auto\">\n {{ pageReportText() }}\n </small>\n }\n\n</div>" }]
|
|
72
|
+
}], ctorParameters: () => [], propDecorators: { rowsPerPage: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowsPerPage", required: false }] }], pageReport: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageReport", required: false }] }], pageReportTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageReportTemplate", required: false }] }], ellipses: [{ type: i0.Input, args: [{ isSignal: true, alias: "ellipses", required: false }] }], boundaryLinks: [{ type: i0.Input, args: [{ isSignal: true, alias: "boundaryLinks", required: false }] }], maxSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSize", required: false }] }], rotate: [{ type: i0.Input, args: [{ isSignal: true, alias: "rotate", required: false }] }], page: [{ type: i0.Input, args: [{ isSignal: true, alias: "page", required: false }] }, { type: i0.Output, args: ["pageChange"] }], pageSizeSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeSelection", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }, { type: i0.Output, args: ["pageSizeChange"] }], collectionSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "collectionSize", required: false }] }], pageChanged: [{ type: i0.Output, args: ["pageChanged"] }] } });
|
|
67
73
|
|
|
68
74
|
/*
|
|
69
75
|
* Public API Surface of ys-pagination
|
|
@@ -73,5 +79,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
|
|
|
73
79
|
* Generated bundle index. Do not edit.
|
|
74
80
|
*/
|
|
75
81
|
|
|
76
|
-
export {
|
|
82
|
+
export { YsPagination };
|
|
77
83
|
//# sourceMappingURL=yoozsoft-yoozsoft-ng-pagination.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yoozsoft-yoozsoft-ng-pagination.mjs","sources":["../../../../projects/yoozsoft/yoozsoft-ng/pagination/src/ys-pagination/ys-pagination.
|
|
1
|
+
{"version":3,"file":"yoozsoft-yoozsoft-ng-pagination.mjs","sources":["../../../../projects/yoozsoft/yoozsoft-ng/pagination/src/ys-pagination/ys-pagination.ts","../../../../projects/yoozsoft/yoozsoft-ng/pagination/src/ys-pagination/ys-pagination.html","../../../../projects/yoozsoft/yoozsoft-ng/pagination/public-api.ts","../../../../projects/yoozsoft/yoozsoft-ng/pagination/yoozsoft-yoozsoft-ng-pagination.ts"],"sourcesContent":["import {\r\n Component,\r\n computed,\r\n effect,\r\n input,\r\n model,\r\n output,\r\n ChangeDetectionStrategy,\r\n} from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { NgbPagination } from '@ng-bootstrap/ng-bootstrap';\r\n\r\n@Component({\r\n selector: 'ys-pagination',\r\n imports: [FormsModule, NgbPagination],\r\n templateUrl: './ys-pagination.html',\r\n changeDetection: ChangeDetectionStrategy.Eager,\r\n styleUrl: './ys-pagination.scss',\r\n})\r\nexport class YsPagination {\r\n rowsPerPage = input<number[]>([10, 25, 50]);\r\n pageReport = input(true);\r\n pageReportTemplate = input<string>('Showing {first} to {last} of {totalRecords} items');\r\n ellipses = input<boolean>(false);\r\n boundaryLinks = input<boolean>(true);\r\n maxSize = input<number>(5);\r\n rotate = input<boolean>(true);\r\n\r\n page = model<number>(1);\r\n pageSizeSelection = input<boolean>(true);\r\n pageSize = model<number>(10);\r\n collectionSize = input<number>(0);\r\n\r\n pageChanged = output<{ page: number; pageSize: number }>();\r\n\r\n readonly firstIndex = computed<number>(() => (this.page() - 1) * this.pageSize());\r\n\r\n readonly lastIndex = computed<number>(() =>\r\n Math.min(this.firstIndex() + this.pageSize(), this.collectionSize()),\r\n );\r\n\r\n readonly totalPages = computed<number>(\r\n () => Math.ceil(this.collectionSize() / this.pageSize()) || 1,\r\n );\r\n\r\n readonly firstRecord = computed(() => (this.collectionSize() === 0 ? 0 : this.firstIndex() + 1));\r\n\r\n readonly pageReportText = computed(() =>\r\n this.pageReportTemplate()\r\n .replace('{first}', this.firstRecord() + '')\r\n .replace('{last}', this.lastIndex() + '')\r\n .replace('{totalRecords}', this.collectionSize() + ''),\r\n );\r\n\r\n constructor() {\r\n effect(() => {\r\n if (!this.rowsPerPage().includes(this.pageSize())) {\r\n this.pageSize.set(this.rowsPerPage()[0] ?? 10);\r\n }\r\n });\r\n }\r\n\r\n changePage(page: number): void {\r\n this.page.set(page);\r\n\r\n this.pageChanged.emit({\r\n page,\r\n pageSize: this.pageSize(),\r\n });\r\n }\r\n\r\n changePageSize(size: number): void {\r\n this.pageSize.set(+size);\r\n this.page.set(1);\r\n\r\n this.pageChanged.emit({\r\n page: 1,\r\n pageSize: size,\r\n });\r\n }\r\n}\r\n","<div class=\"ys-pagination d-flex flex-wrap justify-content-center justify-content-sm-between align-items-center gap-2\">\n\n <!-- صفحهبندی -->\n <ngb-pagination [collectionSize]=\"collectionSize()\" [page]=\"page()\" [pageSize]=\"pageSize()\" [maxSize]=\"maxSize()\"\n [rotate]=\"rotate()\" [ellipses]=\"ellipses()\" [boundaryLinks]=\"boundaryLinks()\"\n (pageChange)=\"changePage($event)\" />\n\n <!-- انتخاب تعداد در هر صفحه -->\n @if(pageSizeSelection()){\n <select class=\"pagination-select form-select form-select-sm w-auto me-auto\" [ngModel]=\"pageSize()\"\n (ngModelChange)=\"changePageSize($event)\" id=\"pagination\">\n @for (rows of rowsPerPage(); track rows) {\n <option [value]=\"rows\">{{ rows }}</option>\n }\n </select>\n }\n\n <!-- گزارش -->\n @if(pageReport()){\n <small class=\"pagination-report text-muted ms-auto\">\n {{ pageReportText() }}\n </small>\n }\n\n</div>","/*\r\n * Public API Surface of ys-pagination\r\n */\r\n\r\nexport * from './src/ys-pagination/ys-pagination';\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAmBa,YAAY,CAAA;IACvB,WAAW,GAAG,KAAK,CAAW,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;oFAAC;IAC3C,UAAU,GAAG,KAAK,CAAC,IAAI;mFAAC;IACxB,kBAAkB,GAAG,KAAK,CAAS,mDAAmD;2FAAC;IACvF,QAAQ,GAAG,KAAK,CAAU,KAAK;iFAAC;IAChC,aAAa,GAAG,KAAK,CAAU,IAAI;sFAAC;IACpC,OAAO,GAAG,KAAK,CAAS,CAAC;gFAAC;IAC1B,MAAM,GAAG,KAAK,CAAU,IAAI;+EAAC;IAE7B,IAAI,GAAG,KAAK,CAAS,CAAC;6EAAC;IACvB,iBAAiB,GAAG,KAAK,CAAU,IAAI;0FAAC;IACxC,QAAQ,GAAG,KAAK,CAAS,EAAE;iFAAC;IAC5B,cAAc,GAAG,KAAK,CAAS,CAAC;uFAAC;IAEjC,WAAW,GAAG,MAAM,EAAsC;AAEjD,IAAA,UAAU,GAAG,QAAQ,CAAS,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE;mFAAC;IAExE,SAAS,GAAG,QAAQ,CAAS,MACpC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC;kFACrE;IAEQ,UAAU,GAAG,QAAQ,CAC5B,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC;mFAC9D;IAEQ,WAAW,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,GAAG,C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e,EAAA,OAAA,EAChB,CAAC,WAAW,EAAE,aAAa,CAAC,EAAA,eAAA,EAEpB,uBAAuB,CAAC,KAAK,EAAA,QAAA,EAAA,onCAAA,EAAA;;;AEhBhD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -1,156 +1,168 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, signal, computed, effect, ChangeDetectionStrategy, Component, inject, ViewContainerRef, Injector, Directive } from '@angular/core';
|
|
3
|
+
import { Validators, NgControl } from '@angular/forms';
|
|
3
4
|
import { NgClass } from '@angular/common';
|
|
4
|
-
import * as i1 from '@angular/forms';
|
|
5
|
-
import { Validators } from '@angular/forms';
|
|
6
5
|
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
6
|
+
const STRONG_PASSWORD_REGX = /^(?=[^A-Z]*[A-Z])(?=[^a-z]*[a-z])(?=\D*\d)(?=.*[!@#$%^&*]).{8,}$/;
|
|
7
|
+
const UPPERCASE_REGEX = /^.*[A-Z]/;
|
|
8
|
+
const LOWERCASE_REGEX = /^.*[a-z]/;
|
|
9
|
+
const DIGIT_REGX = /^.*[0-9].*/;
|
|
10
|
+
const NON_ALPHANUMERIC_REGX = /^.*[!@#$%^&*]/;
|
|
12
11
|
// export const MinLength8Regx: RegExp = /^.{8,}/;
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
required
|
|
16
|
-
uppercase
|
|
17
|
-
lowercase
|
|
18
|
-
digit
|
|
19
|
-
nonAlphanumeric
|
|
20
|
-
minLength
|
|
21
|
-
|
|
22
|
-
this.required = options?.required == undefined ? 'Please enter a valid password.' : options?.required;
|
|
23
|
-
this.uppercase = options?.uppercase == undefined ? 'At least one uppercase letter.' : options?.uppercase;
|
|
24
|
-
this.lowercase = options?.lowercase == undefined ? 'At least one lowercase letter.' : options?.lowercase;
|
|
25
|
-
this.digit = options?.digit == undefined ? 'At least one digit.' : options?.digit;
|
|
26
|
-
this.nonAlphanumeric = options?.nonAlphanumeric == undefined ? 'At least one special character (e.g., !, @, #, $).' : options?.nonAlphanumeric;
|
|
27
|
-
this.minLength = options?.minLength == undefined ? 'At least 8 characters long.' : options?.minLength;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
13
|
+
const DEFAULT_FEEDBACK = {
|
|
14
|
+
required: 'Please enter a valid password.',
|
|
15
|
+
uppercase: 'At least one uppercase letter.',
|
|
16
|
+
lowercase: 'At least one lowercase letter.',
|
|
17
|
+
digit: 'At least one digit.',
|
|
18
|
+
nonAlphanumeric: 'At least one special character (e.g., !, @, #, $).',
|
|
19
|
+
minLength: 'At least 8 characters long.',
|
|
20
|
+
};
|
|
30
21
|
|
|
31
|
-
|
|
32
|
-
requireUppercase
|
|
33
|
-
requireLowercase
|
|
34
|
-
requireDigit
|
|
35
|
-
requireNonAlphanumeric
|
|
36
|
-
requiredMinLength
|
|
37
|
-
|
|
38
|
-
this.requireUppercase = options?.requireUppercase == undefined ? true : options?.requireUppercase;
|
|
39
|
-
this.requireLowercase = options?.requireLowercase == undefined ? true : options?.requireLowercase;
|
|
40
|
-
this.requireDigit = options?.requireDigit == undefined ? true : options?.requireDigit;
|
|
41
|
-
this.requireNonAlphanumeric = options?.requireNonAlphanumeric == undefined ? true : options?.requireNonAlphanumeric;
|
|
42
|
-
this.requiredMinLength = options?.requiredMinLength == undefined ? 8 : options?.requiredMinLength;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
22
|
+
const DEFAULT_OPTIONS = {
|
|
23
|
+
requireUppercase: true,
|
|
24
|
+
requireLowercase: true,
|
|
25
|
+
requireDigit: true,
|
|
26
|
+
requireNonAlphanumeric: true,
|
|
27
|
+
requiredMinLength: 8,
|
|
28
|
+
};
|
|
45
29
|
|
|
46
|
-
class
|
|
47
|
-
passwordHelp = null;
|
|
48
|
-
displayFeedback = true;
|
|
49
|
-
feedback = new StrengthValidationFeedback();
|
|
30
|
+
class YsPasswordStrength {
|
|
50
31
|
minLengthRegx = new RegExp('');
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
get strengthMeter() {
|
|
32
|
+
passwordHelp = input(null, /* @ts-ignore */
|
|
33
|
+
...(ngDevMode ? [{ debugName: "passwordHelp" }] : /* istanbul ignore next */ []));
|
|
34
|
+
displayFeedback = input(true, /* @ts-ignore */
|
|
35
|
+
...(ngDevMode ? [{ debugName: "displayFeedback" }] : /* istanbul ignore next */ []));
|
|
36
|
+
feedback = input({}, /* @ts-ignore */
|
|
37
|
+
...(ngDevMode ? [{ debugName: "feedback" }] : /* istanbul ignore next */ []));
|
|
38
|
+
control = input(/* @ts-ignore */
|
|
39
|
+
...(ngDevMode ? [undefined, { debugName: "control" }] : /* istanbul ignore next */ []));
|
|
40
|
+
passwordValue = signal('', /* @ts-ignore */
|
|
41
|
+
...(ngDevMode ? [{ debugName: "passwordValue" }] : /* istanbul ignore next */ []));
|
|
42
|
+
hasUppercase = computed(() => UPPERCASE_REGEX.test(this.passwordValue()), /* @ts-ignore */
|
|
43
|
+
...(ngDevMode ? [{ debugName: "hasUppercase" }] : /* istanbul ignore next */ []));
|
|
44
|
+
hasLowercase = computed(() => LOWERCASE_REGEX.test(this.passwordValue()), /* @ts-ignore */
|
|
45
|
+
...(ngDevMode ? [{ debugName: "hasLowercase" }] : /* istanbul ignore next */ []));
|
|
46
|
+
hasDigit = computed(() => DIGIT_REGX.test(this.passwordValue()), /* @ts-ignore */
|
|
47
|
+
...(ngDevMode ? [{ debugName: "hasDigit" }] : /* istanbul ignore next */ []));
|
|
48
|
+
hasNonAlphanumeric = computed(() => NON_ALPHANUMERIC_REGX.test(this.passwordValue()), /* @ts-ignore */
|
|
49
|
+
...(ngDevMode ? [{ debugName: "hasNonAlphanumeric" }] : /* istanbul ignore next */ []));
|
|
50
|
+
hasMinLength = computed(() => this.minLengthRegx.test(this.passwordValue()), /* @ts-ignore */
|
|
51
|
+
...(ngDevMode ? [{ debugName: "hasMinLength" }] : /* istanbul ignore next */ []));
|
|
52
|
+
strengthMeter = computed(() => {
|
|
73
53
|
let strength = -1;
|
|
74
|
-
if (this.
|
|
54
|
+
if (this.mergedOptions().requireUppercase && this.hasUppercase())
|
|
75
55
|
strength += 1;
|
|
76
|
-
if (this.
|
|
56
|
+
if (this.mergedOptions().requireLowercase && this.hasLowercase())
|
|
77
57
|
strength += 1;
|
|
78
|
-
if (this.
|
|
58
|
+
if (this.mergedOptions().requireDigit && this.hasDigit())
|
|
79
59
|
strength += 1;
|
|
80
|
-
if (this.
|
|
60
|
+
if (this.mergedOptions().requireNonAlphanumeric && this.hasNonAlphanumeric())
|
|
81
61
|
strength += 1;
|
|
82
|
-
if (this.
|
|
62
|
+
if (this.mergedOptions().requiredMinLength && this.hasMinLength())
|
|
83
63
|
strength += 1;
|
|
84
|
-
return strength + (5 - this.requiredOptionsLength);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
64
|
+
return strength + (5 - this.requiredOptionsLength());
|
|
65
|
+
}, /* @ts-ignore */
|
|
66
|
+
...(ngDevMode ? [{ debugName: "strengthMeter" }] : /* istanbul ignore next */ []));
|
|
67
|
+
strengthStyleClass = computed(() => {
|
|
68
|
+
return this.strengthMeter() == 4
|
|
69
|
+
? 'green'
|
|
70
|
+
: this.strengthMeter() == 3
|
|
71
|
+
? 'yellow'
|
|
72
|
+
: this.strengthMeter() == 2
|
|
73
|
+
? 'orange'
|
|
74
|
+
: this.strengthMeter() == 1
|
|
75
|
+
? 'red'
|
|
76
|
+
: this.strengthMeter() == 0
|
|
77
|
+
? 'pink'
|
|
78
|
+
: '';
|
|
79
|
+
}, /* @ts-ignore */
|
|
80
|
+
...(ngDevMode ? [{ debugName: "strengthStyleClass" }] : /* istanbul ignore next */ []));
|
|
81
|
+
requiredOptionsLength = computed(() => Object.values(this.mergedOptions()).filter(Boolean).length, /* @ts-ignore */
|
|
82
|
+
...(ngDevMode ? [{ debugName: "requiredOptionsLength" }] : /* istanbul ignore next */ []));
|
|
83
|
+
mergedOptions = computed(() => ({
|
|
84
|
+
...DEFAULT_OPTIONS,
|
|
85
|
+
...(this.control()?.options ?? {}),
|
|
86
|
+
}), /* @ts-ignore */
|
|
87
|
+
...(ngDevMode ? [{ debugName: "mergedOptions" }] : /* istanbul ignore next */ []));
|
|
88
|
+
mergedFeedback = computed(() => ({
|
|
89
|
+
...DEFAULT_FEEDBACK,
|
|
90
|
+
...this.feedback(),
|
|
91
|
+
}), /* @ts-ignore */
|
|
92
|
+
...(ngDevMode ? [{ debugName: "mergedFeedback" }] : /* istanbul ignore next */ []));
|
|
93
|
+
constructor() {
|
|
94
|
+
effect((onCleanup) => {
|
|
95
|
+
const control = this.control();
|
|
96
|
+
if (!control?.formControl)
|
|
97
|
+
return;
|
|
98
|
+
this.passwordValue.set(control.formControl.value ?? '');
|
|
99
|
+
const sub = control.formControl.valueChanges.subscribe((value) => {
|
|
100
|
+
this.passwordValue.set(value ?? '');
|
|
101
|
+
});
|
|
102
|
+
onCleanup(() => sub.unsubscribe());
|
|
103
|
+
// control.options ??= { ...DEFAULT_OPTIONS };
|
|
104
|
+
const strongPasswordRegex = new RegExp(`${this.mergedOptions().requireUppercase ? '^(?=[^A-Z]*[A-Z])' : ''}${this.mergedOptions().requireLowercase ? '(?=[^a-z]*[a-z])' : ''}${this.mergedOptions().requireDigit ? '(?=\\D*\\d)' : ''}${this.mergedOptions().requireNonAlphanumeric ? '(?=.*[!@#$%^&*])' : ''}.{${this.mergedOptions().requiredMinLength},}$`);
|
|
105
|
+
this.minLengthRegx = new RegExp(`.{${this.mergedOptions().requiredMinLength},}$`);
|
|
106
|
+
control.formControl?.setValidators([
|
|
107
|
+
Validators.required,
|
|
108
|
+
Validators.pattern(strongPasswordRegex),
|
|
109
|
+
]);
|
|
110
|
+
control.formControl?.updateValueAndValidity();
|
|
111
|
+
});
|
|
93
112
|
}
|
|
94
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
95
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
113
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: YsPasswordStrength, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
114
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: YsPasswordStrength, isStandalone: true, selector: "ys-password-strength", inputs: { passwordHelp: { classPropertyName: "passwordHelp", publicName: "passwordHelp", isSignal: true, isRequired: false, transformFunction: null }, displayFeedback: { classPropertyName: "displayFeedback", publicName: "displayFeedback", isSignal: true, isRequired: false, transformFunction: null }, feedback: { classPropertyName: "feedback", publicName: "feedback", isSignal: true, isRequired: false, transformFunction: null }, control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (control()) {\n<div class=\"password-strength\">\n <div class=\"d-flex flex-row mt-1\">\n\n @if (this.requiredOptionsLength() > 4) {\n <hr class=\"rounded-start rounded-end me-1\" [ngClass]=\" (strengthMeter() >= 0) ? strengthStyleClass() : 'gray'\"\n [style.width.%]=\"[100 / requiredOptionsLength()]\">\n }\n\n @if (this.requiredOptionsLength() > 3) {\n <hr class=\"rounded-start rounded-end me-1\" [ngClass]=\"(strengthMeter() >= 1) ? strengthStyleClass() : 'gray'\"\n [style.width.%]=\"[100 / requiredOptionsLength()]\">\n }\n\n @if (this.requiredOptionsLength() > 2) {\n <hr class=\"rounded-start rounded-end me-1\" [ngClass]=\"(strengthMeter() >= 2) ? strengthStyleClass() : 'gray'\"\n [style.width.%]=\"[100 / requiredOptionsLength()]\">\n }\n\n @if (this.requiredOptionsLength() > 1) {\n <hr class=\"rounded-start rounded-end me-1\" [ngClass]=\"(strengthMeter() >= 3) ? strengthStyleClass() : 'gray'\"\n [style.width.%]=\"[100 / requiredOptionsLength()]\">\n }\n\n @if (this.requiredOptionsLength() > 0) {\n <hr class=\"rounded-start rounded-end\" [ngClass]=\"(strengthMeter() >= 4) ? strengthStyleClass() : 'gray'\"\n [style.width.%]=\"[100 / requiredOptionsLength()]\">\n }\n\n </div>\n\n @if (passwordHelp()) {\n\n <small id=\"passwordHelp\" class=\"form-text text-muted\">{{passwordHelp()}}</small>\n\n }\n\n @if (displayFeedback() && control()?.formControl?.errors?.['pattern'] && (control()?.formControl?.touched ||\n control()?.formControl?.dirty)) {\n\n <div class=\"invalid-feedback d-grid \">\n\n @if (mergedOptions().requireUppercase && mergedFeedback().uppercase) {\n <span [ngClass]=\"{'text-success': hasUppercase()}\">{{mergedFeedback().uppercase}}</span>\n }\n\n @if (mergedOptions().requireLowercase && mergedFeedback().lowercase) {\n <span [ngClass]=\"{'text-success': hasLowercase()}\">{{mergedFeedback().lowercase}}</span>\n }\n\n @if (mergedOptions().requireDigit && mergedFeedback().digit) {\n <span [ngClass]=\"{'text-success': hasDigit()}\">{{mergedFeedback().digit}}</span>\n }\n\n @if (mergedOptions().requireNonAlphanumeric && mergedFeedback().nonAlphanumeric) {\n <span [ngClass]=\"{'text-success': hasNonAlphanumeric()}\">{{mergedFeedback().nonAlphanumeric}}</span>\n }\n\n @if (mergedOptions().requiredMinLength && mergedFeedback().minLength) {\n <span [ngClass]=\"{'text-success': hasMinLength()}\">{{mergedFeedback().minLength}}</span>\n\n }\n\n </div>\n\n }\n\n @if (control()?.formControl?.errors?.['required'] && (control()?.formControl?.touched ||\n control()?.formControl?.dirty)) {\n\n <div class=\"invalid-feedback d-grid \">\n {{mergedFeedback().required}}\n </div>\n\n }\n\n</div>\n\n}\n\n@if (!control()) {\n\n<div>\n Password strength control is undefined.\n</div>\n\n}", styles: [".is-invalid ys-password-strength~.invalid-feedback{display:block}.password-strength hr{border-top:3px solid;margin:0;opacity:.75!important}.password-strength .gray{color:var(--bs-gray-300)}.password-strength .pink{color:var(--bs-pink)}.password-strength .red{color:var(--bs-red)}.password-strength .orange{color:var(--bs-orange)}.password-strength .yellow{color:var(--bs-yellow)}.password-strength .green{color:var(--bs-green)}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
96
115
|
}
|
|
97
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: YsPasswordStrength, decorators: [{
|
|
98
117
|
type: Component,
|
|
99
|
-
args: [{ selector: 'ys-password-strength', imports: [NgClass], template: "@if (control) {\
|
|
100
|
-
}], propDecorators: { passwordHelp: [{
|
|
101
|
-
type: Input
|
|
102
|
-
}], displayFeedback: [{
|
|
103
|
-
type: Input
|
|
104
|
-
}], feedback: [{
|
|
105
|
-
type: Input
|
|
106
|
-
}], control: [{
|
|
107
|
-
type: Input
|
|
108
|
-
}] } });
|
|
118
|
+
args: [{ selector: 'ys-password-strength', imports: [NgClass], changeDetection: ChangeDetectionStrategy.Eager, template: "@if (control()) {\n<div class=\"password-strength\">\n <div class=\"d-flex flex-row mt-1\">\n\n @if (this.requiredOptionsLength() > 4) {\n <hr class=\"rounded-start rounded-end me-1\" [ngClass]=\" (strengthMeter() >= 0) ? strengthStyleClass() : 'gray'\"\n [style.width.%]=\"[100 / requiredOptionsLength()]\">\n }\n\n @if (this.requiredOptionsLength() > 3) {\n <hr class=\"rounded-start rounded-end me-1\" [ngClass]=\"(strengthMeter() >= 1) ? strengthStyleClass() : 'gray'\"\n [style.width.%]=\"[100 / requiredOptionsLength()]\">\n }\n\n @if (this.requiredOptionsLength() > 2) {\n <hr class=\"rounded-start rounded-end me-1\" [ngClass]=\"(strengthMeter() >= 2) ? strengthStyleClass() : 'gray'\"\n [style.width.%]=\"[100 / requiredOptionsLength()]\">\n }\n\n @if (this.requiredOptionsLength() > 1) {\n <hr class=\"rounded-start rounded-end me-1\" [ngClass]=\"(strengthMeter() >= 3) ? strengthStyleClass() : 'gray'\"\n [style.width.%]=\"[100 / requiredOptionsLength()]\">\n }\n\n @if (this.requiredOptionsLength() > 0) {\n <hr class=\"rounded-start rounded-end\" [ngClass]=\"(strengthMeter() >= 4) ? strengthStyleClass() : 'gray'\"\n [style.width.%]=\"[100 / requiredOptionsLength()]\">\n }\n\n </div>\n\n @if (passwordHelp()) {\n\n <small id=\"passwordHelp\" class=\"form-text text-muted\">{{passwordHelp()}}</small>\n\n }\n\n @if (displayFeedback() && control()?.formControl?.errors?.['pattern'] && (control()?.formControl?.touched ||\n control()?.formControl?.dirty)) {\n\n <div class=\"invalid-feedback d-grid \">\n\n @if (mergedOptions().requireUppercase && mergedFeedback().uppercase) {\n <span [ngClass]=\"{'text-success': hasUppercase()}\">{{mergedFeedback().uppercase}}</span>\n }\n\n @if (mergedOptions().requireLowercase && mergedFeedback().lowercase) {\n <span [ngClass]=\"{'text-success': hasLowercase()}\">{{mergedFeedback().lowercase}}</span>\n }\n\n @if (mergedOptions().requireDigit && mergedFeedback().digit) {\n <span [ngClass]=\"{'text-success': hasDigit()}\">{{mergedFeedback().digit}}</span>\n }\n\n @if (mergedOptions().requireNonAlphanumeric && mergedFeedback().nonAlphanumeric) {\n <span [ngClass]=\"{'text-success': hasNonAlphanumeric()}\">{{mergedFeedback().nonAlphanumeric}}</span>\n }\n\n @if (mergedOptions().requiredMinLength && mergedFeedback().minLength) {\n <span [ngClass]=\"{'text-success': hasMinLength()}\">{{mergedFeedback().minLength}}</span>\n\n }\n\n </div>\n\n }\n\n @if (control()?.formControl?.errors?.['required'] && (control()?.formControl?.touched ||\n control()?.formControl?.dirty)) {\n\n <div class=\"invalid-feedback d-grid \">\n {{mergedFeedback().required}}\n </div>\n\n }\n\n</div>\n\n}\n\n@if (!control()) {\n\n<div>\n Password strength control is undefined.\n</div>\n\n}", styles: [".is-invalid ys-password-strength~.invalid-feedback{display:block}.password-strength hr{border-top:3px solid;margin:0;opacity:.75!important}.password-strength .gray{color:var(--bs-gray-300)}.password-strength .pink{color:var(--bs-pink)}.password-strength .red{color:var(--bs-red)}.password-strength .orange{color:var(--bs-orange)}.password-strength .yellow{color:var(--bs-yellow)}.password-strength .green{color:var(--bs-green)}\n"] }]
|
|
119
|
+
}], ctorParameters: () => [], propDecorators: { passwordHelp: [{ type: i0.Input, args: [{ isSignal: true, alias: "passwordHelp", required: false }] }], displayFeedback: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayFeedback", required: false }] }], feedback: [{ type: i0.Input, args: [{ isSignal: true, alias: "feedback", required: false }] }], control: [{ type: i0.Input, args: [{ isSignal: true, alias: "control", required: false }] }] } });
|
|
109
120
|
|
|
110
121
|
class YsPasswordStrengthDirective {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
122
|
+
viewContainerRef = inject(ViewContainerRef);
|
|
123
|
+
injector = inject(Injector);
|
|
124
|
+
control = inject(NgControl, {
|
|
125
|
+
self: true
|
|
126
|
+
});
|
|
127
|
+
componentRef = this.viewContainerRef.createComponent(YsPasswordStrength, {
|
|
128
|
+
injector: this.injector
|
|
129
|
+
});
|
|
130
|
+
passwordHelp = input(null, /* @ts-ignore */
|
|
131
|
+
...(ngDevMode ? [{ debugName: "passwordHelp" }] : /* istanbul ignore next */ []));
|
|
132
|
+
displayFeedback = input(true, /* @ts-ignore */
|
|
133
|
+
...(ngDevMode ? [{ debugName: "displayFeedback" }] : /* istanbul ignore next */ []));
|
|
134
|
+
feedback = input({}, /* @ts-ignore */
|
|
135
|
+
...(ngDevMode ? [{ debugName: "feedback" }] : /* istanbul ignore next */ []));
|
|
136
|
+
options = input({}, /* @ts-ignore */
|
|
137
|
+
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
138
|
+
mergedOptions = computed(() => ({
|
|
139
|
+
...DEFAULT_OPTIONS,
|
|
140
|
+
...this.options()
|
|
141
|
+
}), /* @ts-ignore */
|
|
142
|
+
...(ngDevMode ? [{ debugName: "mergedOptions" }] : /* istanbul ignore next */ []));
|
|
143
|
+
mergedFeedback = computed(() => ({
|
|
144
|
+
...DEFAULT_FEEDBACK,
|
|
145
|
+
...this.feedback()
|
|
146
|
+
}), /* @ts-ignore */
|
|
147
|
+
...(ngDevMode ? [{ debugName: "mergedFeedback" }] : /* istanbul ignore next */ []));
|
|
148
|
+
constructor() {
|
|
149
|
+
effect(() => {
|
|
150
|
+
const formControl = this.control.control;
|
|
151
|
+
this.componentRef.setInput('passwordHelp', this.passwordHelp());
|
|
152
|
+
this.componentRef.setInput('displayFeedback', this.displayFeedback());
|
|
153
|
+
this.componentRef.setInput('feedback', this.mergedFeedback());
|
|
154
|
+
this.componentRef.setInput('control', { formControl: formControl, options: this.mergedOptions() });
|
|
155
|
+
});
|
|
136
156
|
}
|
|
137
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
138
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
157
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: YsPasswordStrengthDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
158
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.7", type: YsPasswordStrengthDirective, isStandalone: true, selector: "[ysPasswordStrength]", inputs: { passwordHelp: { classPropertyName: "passwordHelp", publicName: "passwordHelp", isSignal: true, isRequired: false, transformFunction: null }, displayFeedback: { classPropertyName: "displayFeedback", publicName: "displayFeedback", isSignal: true, isRequired: false, transformFunction: null }, feedback: { classPropertyName: "feedback", publicName: "feedback", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
139
159
|
}
|
|
140
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
160
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: YsPasswordStrengthDirective, decorators: [{
|
|
141
161
|
type: Directive,
|
|
142
162
|
args: [{
|
|
143
|
-
selector: '[ysPasswordStrength]'
|
|
163
|
+
selector: '[ysPasswordStrength]',
|
|
144
164
|
}]
|
|
145
|
-
}], ctorParameters: () => [{ type: i0.
|
|
146
|
-
type: Input
|
|
147
|
-
}], displayFeedback: [{
|
|
148
|
-
type: Input
|
|
149
|
-
}], feedback: [{
|
|
150
|
-
type: Input
|
|
151
|
-
}], options: [{
|
|
152
|
-
type: Input
|
|
153
|
-
}] } });
|
|
165
|
+
}], ctorParameters: () => [], propDecorators: { passwordHelp: [{ type: i0.Input, args: [{ isSignal: true, alias: "passwordHelp", required: false }] }], displayFeedback: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayFeedback", required: false }] }], feedback: [{ type: i0.Input, args: [{ isSignal: true, alias: "feedback", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }] } });
|
|
154
166
|
|
|
155
167
|
/*
|
|
156
168
|
* Public API Surface of ys-password-strength
|
|
@@ -160,5 +172,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
|
|
|
160
172
|
* Generated bundle index. Do not edit.
|
|
161
173
|
*/
|
|
162
174
|
|
|
163
|
-
export {
|
|
175
|
+
export { DEFAULT_FEEDBACK, DEFAULT_OPTIONS, DIGIT_REGX, LOWERCASE_REGEX, NON_ALPHANUMERIC_REGX, STRONG_PASSWORD_REGX, UPPERCASE_REGEX, YsPasswordStrength, YsPasswordStrengthDirective };
|
|
164
176
|
//# sourceMappingURL=yoozsoft-yoozsoft-ng-password-strength.mjs.map
|