cmat 0.0.111 → 0.0.112

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.
Files changed (256) hide show
  1. package/fesm2022/cmat-components-adapter.mjs +531 -536
  2. package/fesm2022/cmat-components-adapter.mjs.map +1 -1
  3. package/fesm2022/cmat-components-breadcrumb.mjs +521 -356
  4. package/fesm2022/cmat-components-breadcrumb.mjs.map +1 -1
  5. package/fesm2022/cmat-components-card.mjs +150 -42
  6. package/fesm2022/cmat-components-card.mjs.map +1 -1
  7. package/fesm2022/cmat-components-carousel.mjs +1120 -629
  8. package/fesm2022/cmat-components-carousel.mjs.map +1 -1
  9. package/fesm2022/cmat-components-cascade.mjs +861 -441
  10. package/fesm2022/cmat-components-cascade.mjs.map +1 -1
  11. package/fesm2022/cmat-components-chip-input.mjs +580 -335
  12. package/fesm2022/cmat-components-chip-input.mjs.map +1 -1
  13. package/fesm2022/cmat-components-code-editor.mjs +197 -105
  14. package/fesm2022/cmat-components-code-editor.mjs.map +1 -1
  15. package/fesm2022/cmat-components-color-picker.mjs +1762 -825
  16. package/fesm2022/cmat-components-color-picker.mjs.map +1 -1
  17. package/fesm2022/cmat-components-custom-formly.mjs +5196 -2531
  18. package/fesm2022/cmat-components-custom-formly.mjs.map +1 -1
  19. package/fesm2022/cmat-components-data-picker.mjs +1901 -1073
  20. package/fesm2022/cmat-components-data-picker.mjs.map +1 -1
  21. package/fesm2022/cmat-components-date-range.mjs +701 -456
  22. package/fesm2022/cmat-components-date-range.mjs.map +1 -1
  23. package/fesm2022/cmat-components-date-time-display.mjs +137 -30
  24. package/fesm2022/cmat-components-date-time-display.mjs.map +1 -1
  25. package/fesm2022/cmat-components-drawer.mjs +410 -258
  26. package/fesm2022/cmat-components-drawer.mjs.map +1 -1
  27. package/fesm2022/cmat-components-empty-state.mjs +201 -41
  28. package/fesm2022/cmat-components-empty-state.mjs.map +1 -1
  29. package/fesm2022/cmat-components-file-preview.mjs +198 -35
  30. package/fesm2022/cmat-components-file-preview.mjs.map +1 -1
  31. package/fesm2022/cmat-components-filter-toolbar.mjs +320 -72
  32. package/fesm2022/cmat-components-filter-toolbar.mjs.map +1 -1
  33. package/fesm2022/cmat-components-form-actions.mjs +102 -26
  34. package/fesm2022/cmat-components-form-actions.mjs.map +1 -1
  35. package/fesm2022/cmat-components-fullscreen.mjs +167 -47
  36. package/fesm2022/cmat-components-fullscreen.mjs.map +1 -1
  37. package/fesm2022/cmat-components-highlight.mjs +203 -112
  38. package/fesm2022/cmat-components-highlight.mjs.map +1 -1
  39. package/fesm2022/cmat-components-image-viewer.mjs +489 -215
  40. package/fesm2022/cmat-components-image-viewer.mjs.map +1 -1
  41. package/fesm2022/cmat-components-inline-loading.mjs +117 -27
  42. package/fesm2022/cmat-components-inline-loading.mjs.map +1 -1
  43. package/fesm2022/cmat-components-json-editor.mjs +276 -230
  44. package/fesm2022/cmat-components-json-editor.mjs.map +1 -1
  45. package/fesm2022/cmat-components-knob-input.mjs +615 -420
  46. package/fesm2022/cmat-components-knob-input.mjs.map +1 -1
  47. package/fesm2022/cmat-components-loading-overlay.mjs +53 -25
  48. package/fesm2022/cmat-components-loading-overlay.mjs.map +1 -1
  49. package/fesm2022/cmat-components-masonry.mjs +120 -40
  50. package/fesm2022/cmat-components-masonry.mjs.map +1 -1
  51. package/fesm2022/cmat-components-material-color-picker.mjs +332 -155
  52. package/fesm2022/cmat-components-material-color-picker.mjs.map +1 -1
  53. package/fesm2022/cmat-components-material-datetimepicker.mjs +4283 -2504
  54. package/fesm2022/cmat-components-material-datetimepicker.mjs.map +1 -1
  55. package/fesm2022/cmat-components-navigation.mjs +3080 -1404
  56. package/fesm2022/cmat-components-navigation.mjs.map +1 -1
  57. package/fesm2022/cmat-components-opt-input.mjs +540 -466
  58. package/fesm2022/cmat-components-opt-input.mjs.map +1 -1
  59. package/fesm2022/cmat-components-org-chart.mjs +528 -125
  60. package/fesm2022/cmat-components-org-chart.mjs.map +1 -1
  61. package/fesm2022/cmat-components-page-header.mjs +141 -32
  62. package/fesm2022/cmat-components-page-header.mjs.map +1 -1
  63. package/fesm2022/cmat-components-pagination.mjs +866 -534
  64. package/fesm2022/cmat-components-pagination.mjs.map +1 -1
  65. package/fesm2022/cmat-components-password-strength.mjs +873 -434
  66. package/fesm2022/cmat-components-password-strength.mjs.map +1 -1
  67. package/fesm2022/cmat-components-popover.mjs +1012 -731
  68. package/fesm2022/cmat-components-popover.mjs.map +1 -1
  69. package/fesm2022/cmat-components-progress-bar.mjs +98 -35
  70. package/fesm2022/cmat-components-progress-bar.mjs.map +1 -1
  71. package/fesm2022/cmat-components-qrcode.mjs +463 -287
  72. package/fesm2022/cmat-components-qrcode.mjs.map +1 -1
  73. package/fesm2022/cmat-components-rating.mjs +377 -203
  74. package/fesm2022/cmat-components-rating.mjs.map +1 -1
  75. package/fesm2022/cmat-components-rich-text-editor.mjs +153 -39
  76. package/fesm2022/cmat-components-rich-text-editor.mjs.map +1 -1
  77. package/fesm2022/cmat-components-select-search.mjs +926 -496
  78. package/fesm2022/cmat-components-select-search.mjs.map +1 -1
  79. package/fesm2022/cmat-components-select-table.mjs +1280 -842
  80. package/fesm2022/cmat-components-select-table.mjs.map +1 -1
  81. package/fesm2022/cmat-components-select-tree.mjs +998 -690
  82. package/fesm2022/cmat-components-select-tree.mjs.map +1 -1
  83. package/fesm2022/cmat-components-skeleton.mjs +143 -57
  84. package/fesm2022/cmat-components-skeleton.mjs.map +1 -1
  85. package/fesm2022/cmat-components-speed-dial.mjs +457 -303
  86. package/fesm2022/cmat-components-speed-dial.mjs.map +1 -1
  87. package/fesm2022/cmat-components-status-tag.mjs +136 -44
  88. package/fesm2022/cmat-components-status-tag.mjs.map +1 -1
  89. package/fesm2022/cmat-components-table-toolbar.mjs +120 -28
  90. package/fesm2022/cmat-components-table-toolbar.mjs.map +1 -1
  91. package/fesm2022/cmat-components-timeline.mjs +464 -168
  92. package/fesm2022/cmat-components-timeline.mjs.map +1 -1
  93. package/fesm2022/cmat-components-toast.mjs +346 -262
  94. package/fesm2022/cmat-components-toast.mjs.map +1 -1
  95. package/fesm2022/cmat-components-transfer-picker.mjs +1427 -593
  96. package/fesm2022/cmat-components-transfer-picker.mjs.map +1 -1
  97. package/fesm2022/cmat-components-treetable.mjs +372 -112
  98. package/fesm2022/cmat-components-treetable.mjs.map +1 -1
  99. package/fesm2022/cmat-components-upload.mjs +904 -410
  100. package/fesm2022/cmat-components-upload.mjs.map +1 -1
  101. package/fesm2022/cmat-components-x6-angular-shape.mjs +153 -170
  102. package/fesm2022/cmat-components-x6-angular-shape.mjs.map +1 -1
  103. package/fesm2022/cmat-directives-animate-on-scroll.mjs +220 -138
  104. package/fesm2022/cmat-directives-animate-on-scroll.mjs.map +1 -1
  105. package/fesm2022/cmat-directives-arrow-cursor.mjs +246 -193
  106. package/fesm2022/cmat-directives-arrow-cursor.mjs.map +1 -1
  107. package/fesm2022/cmat-directives-autofocus.mjs +43 -25
  108. package/fesm2022/cmat-directives-autofocus.mjs.map +1 -1
  109. package/fesm2022/cmat-directives-data-exporter.mjs +537 -338
  110. package/fesm2022/cmat-directives-data-exporter.mjs.map +1 -1
  111. package/fesm2022/cmat-directives-debounce.mjs +162 -76
  112. package/fesm2022/cmat-directives-debounce.mjs.map +1 -1
  113. package/fesm2022/cmat-directives-digit-only.mjs +457 -356
  114. package/fesm2022/cmat-directives-digit-only.mjs.map +1 -1
  115. package/fesm2022/cmat-directives-equal-validator.mjs +70 -53
  116. package/fesm2022/cmat-directives-equal-validator.mjs.map +1 -1
  117. package/fesm2022/cmat-directives-seamless-auto-scroll.mjs +180 -132
  118. package/fesm2022/cmat-directives-seamless-auto-scroll.mjs.map +1 -1
  119. package/fesm2022/cmat-lib-mock-api.mjs +207 -195
  120. package/fesm2022/cmat-lib-mock-api.mjs.map +1 -1
  121. package/fesm2022/cmat-pipes-bytes.mjs +50 -30
  122. package/fesm2022/cmat-pipes-bytes.mjs.map +1 -1
  123. package/fesm2022/cmat-pipes-date-format.mjs +41 -25
  124. package/fesm2022/cmat-pipes-date-format.mjs.map +1 -1
  125. package/fesm2022/cmat-pipes-find-by-key.mjs +44 -26
  126. package/fesm2022/cmat-pipes-find-by-key.mjs.map +1 -1
  127. package/fesm2022/cmat-pipes-group-by.mjs +50 -38
  128. package/fesm2022/cmat-pipes-group-by.mjs.map +1 -1
  129. package/fesm2022/cmat-pipes-keys.mjs +44 -31
  130. package/fesm2022/cmat-pipes-keys.mjs.map +1 -1
  131. package/fesm2022/cmat-pipes-secure.mjs +60 -49
  132. package/fesm2022/cmat-pipes-secure.mjs.map +1 -1
  133. package/fesm2022/cmat-pipes-uppercase.mjs +39 -22
  134. package/fesm2022/cmat-pipes-uppercase.mjs.map +1 -1
  135. package/fesm2022/cmat-reports.mjs +2751 -0
  136. package/fesm2022/cmat-reports.mjs.map +1 -0
  137. package/fesm2022/cmat-services-alert.mjs +249 -277
  138. package/fesm2022/cmat-services-alert.mjs.map +1 -1
  139. package/fesm2022/cmat-services-config.mjs +110 -81
  140. package/fesm2022/cmat-services-config.mjs.map +1 -1
  141. package/fesm2022/cmat-services-confirmation.mjs +184 -73
  142. package/fesm2022/cmat-services-confirmation.mjs.map +1 -1
  143. package/fesm2022/cmat-services-data.mjs +136 -125
  144. package/fesm2022/cmat-services-data.mjs.map +1 -1
  145. package/fesm2022/cmat-services-export-as.mjs +165 -183
  146. package/fesm2022/cmat-services-export-as.mjs.map +1 -1
  147. package/fesm2022/cmat-services-loading.mjs +116 -95
  148. package/fesm2022/cmat-services-loading.mjs.map +1 -1
  149. package/fesm2022/cmat-services-local-storage.mjs +75 -66
  150. package/fesm2022/cmat-services-local-storage.mjs.map +1 -1
  151. package/fesm2022/cmat-services-media-watcher.mjs +69 -64
  152. package/fesm2022/cmat-services-media-watcher.mjs.map +1 -1
  153. package/fesm2022/cmat-services-platform.mjs +48 -45
  154. package/fesm2022/cmat-services-platform.mjs.map +1 -1
  155. package/fesm2022/cmat-services-print.mjs +984 -1109
  156. package/fesm2022/cmat-services-print.mjs.map +1 -1
  157. package/fesm2022/cmat-services-splash-screen.mjs +53 -38
  158. package/fesm2022/cmat-services-splash-screen.mjs.map +1 -1
  159. package/fesm2022/cmat-services-title.mjs +57 -47
  160. package/fesm2022/cmat-services-title.mjs.map +1 -1
  161. package/fesm2022/cmat-services-translation.mjs +79 -68
  162. package/fesm2022/cmat-services-translation.mjs.map +1 -1
  163. package/fesm2022/cmat-services-utils.mjs +424 -517
  164. package/fesm2022/cmat-services-utils.mjs.map +1 -1
  165. package/fesm2022/cmat-validators.mjs +23 -33
  166. package/fesm2022/cmat-validators.mjs.map +1 -1
  167. package/fesm2022/cmat-version.mjs +12 -16
  168. package/fesm2022/cmat-version.mjs.map +1 -1
  169. package/fesm2022/cmat.mjs +39805 -22511
  170. package/fesm2022/cmat.mjs.map +1 -1
  171. package/package.json +5 -1
  172. package/types/cmat-components-adapter.d.ts +145 -156
  173. package/types/cmat-components-breadcrumb.d.ts +108 -86
  174. package/types/cmat-components-card.d.ts +34 -18
  175. package/types/cmat-components-carousel.d.ts +251 -134
  176. package/types/cmat-components-cascade.d.ts +158 -117
  177. package/types/cmat-components-chip-input.d.ts +105 -71
  178. package/types/cmat-components-code-editor.d.ts +59 -34
  179. package/types/cmat-components-color-picker.d.ts +378 -236
  180. package/types/cmat-components-custom-formly.d.ts +776 -814
  181. package/types/cmat-components-data-picker.d.ts +502 -360
  182. package/types/cmat-components-date-range.d.ts +106 -77
  183. package/types/cmat-components-date-time-display.d.ts +36 -13
  184. package/types/cmat-components-drawer.d.ts +91 -61
  185. package/types/cmat-components-empty-state.d.ts +47 -17
  186. package/types/cmat-components-file-preview.d.ts +42 -14
  187. package/types/cmat-components-filter-toolbar.d.ts +57 -25
  188. package/types/cmat-components-form-actions.d.ts +18 -10
  189. package/types/cmat-components-fullscreen.d.ts +21 -13
  190. package/types/cmat-components-highlight.d.ts +33 -26
  191. package/types/cmat-components-image-viewer.d.ts +119 -58
  192. package/types/cmat-components-inline-loading.d.ts +24 -11
  193. package/types/cmat-components-json-editor.d.ts +39 -28
  194. package/types/cmat-components-knob-input.d.ts +172 -101
  195. package/types/cmat-components-loading-overlay.d.ts +8 -11
  196. package/types/cmat-components-masonry.d.ts +27 -14
  197. package/types/cmat-components-material-color-picker.d.ts +56 -42
  198. package/types/cmat-components-material-datetimepicker.d.ts +817 -454
  199. package/types/cmat-components-navigation.d.ts +295 -221
  200. package/types/cmat-components-opt-input.d.ts +111 -90
  201. package/types/cmat-components-org-chart.d.ts +53 -35
  202. package/types/cmat-components-page-header.d.ts +37 -14
  203. package/types/cmat-components-pagination.d.ts +144 -107
  204. package/types/cmat-components-password-strength.d.ts +197 -86
  205. package/types/cmat-components-popover.d.ts +264 -166
  206. package/types/cmat-components-progress-bar.d.ts +17 -14
  207. package/types/cmat-components-qrcode.d.ts +111 -42
  208. package/types/cmat-components-rating.d.ts +105 -59
  209. package/types/cmat-components-rich-text-editor.d.ts +39 -16
  210. package/types/cmat-components-select-search.d.ts +195 -99
  211. package/types/cmat-components-select-table.d.ts +241 -142
  212. package/types/cmat-components-select-tree.d.ts +185 -118
  213. package/types/cmat-components-skeleton.d.ts +55 -32
  214. package/types/cmat-components-speed-dial.d.ts +86 -61
  215. package/types/cmat-components-status-tag.d.ts +42 -24
  216. package/types/cmat-components-table-toolbar.d.ts +30 -12
  217. package/types/cmat-components-timeline.d.ts +83 -51
  218. package/types/cmat-components-toast.d.ts +84 -85
  219. package/types/cmat-components-transfer-picker.d.ts +228 -181
  220. package/types/cmat-components-treetable.d.ts +63 -39
  221. package/types/cmat-components-upload.d.ts +205 -106
  222. package/types/cmat-components-x6-angular-shape.d.ts +29 -37
  223. package/types/cmat-directives-animate-on-scroll.d.ts +48 -30
  224. package/types/cmat-directives-arrow-cursor.d.ts +55 -35
  225. package/types/cmat-directives-autofocus.d.ts +8 -11
  226. package/types/cmat-directives-data-exporter.d.ts +71 -40
  227. package/types/cmat-directives-debounce.d.ts +31 -28
  228. package/types/cmat-directives-digit-only.d.ts +90 -53
  229. package/types/cmat-directives-equal-validator.d.ts +11 -14
  230. package/types/cmat-directives-seamless-auto-scroll.d.ts +42 -29
  231. package/types/cmat-lib-mock-api.d.ts +46 -55
  232. package/types/cmat-pipes-bytes.d.ts +7 -10
  233. package/types/cmat-pipes-date-format.d.ts +7 -10
  234. package/types/cmat-pipes-find-by-key.d.ts +8 -12
  235. package/types/cmat-pipes-group-by.d.ts +11 -15
  236. package/types/cmat-pipes-keys.d.ts +10 -13
  237. package/types/cmat-pipes-secure.d.ts +14 -17
  238. package/types/cmat-pipes-uppercase.d.ts +7 -10
  239. package/types/cmat-reports.d.ts +1131 -0
  240. package/types/cmat-services-alert.d.ts +80 -87
  241. package/types/cmat-services-config.d.ts +37 -43
  242. package/types/cmat-services-confirmation.d.ts +31 -37
  243. package/types/cmat-services-data.d.ts +18 -21
  244. package/types/cmat-services-export-as.d.ts +28 -33
  245. package/types/cmat-services-loading.d.ts +27 -31
  246. package/types/cmat-services-local-storage.d.ts +17 -21
  247. package/types/cmat-services-media-watcher.d.ts +14 -18
  248. package/types/cmat-services-platform.d.ts +8 -11
  249. package/types/cmat-services-print.d.ts +97 -102
  250. package/types/cmat-services-splash-screen.d.ts +11 -14
  251. package/types/cmat-services-title.d.ts +9 -12
  252. package/types/cmat-services-translation.d.ts +19 -22
  253. package/types/cmat-services-utils.d.ts +76 -80
  254. package/types/cmat-validators.d.ts +5 -8
  255. package/types/cmat-version.d.ts +8 -10
  256. package/types/cmat.d.ts +7551 -5204
@@ -1,441 +1,880 @@
1
- import * as i0 from '@angular/core';
2
- import { input, output, ChangeDetectionStrategy, ViewEncapsulation, Component, signal, computed, effect, untracked } from '@angular/core';
3
- import * as i1 from '@angular/material/button';
4
- import { MatButtonModule } from '@angular/material/button';
5
- import * as i2 from '@angular/material/core';
6
- import { MatRippleModule } from '@angular/material/core';
7
- import * as i3 from '@angular/material/icon';
8
- import { MatIconModule } from '@angular/material/icon';
9
- import { FormControl, Validators } from '@angular/forms';
10
- import * as i1$1 from '@angular/material/progress-bar';
11
- import { MatProgressBarModule } from '@angular/material/progress-bar';
12
- import * as i1$2 from '@angular/material/card';
13
- import { MatCardModule } from '@angular/material/card';
14
-
15
- class CmatPassToggleVisibilityComponent {
16
- constructor() {
17
- this.isVisible = input(false, /* @ts-ignore */
18
- ...(ngDevMode ? [{ debugName: "isVisible" }] : /* istanbul ignore next */ []));
19
- this.isVisibleChange = output();
20
- this.tabindex = input(/* @ts-ignore */
21
- ...(ngDevMode ? [undefined, { debugName: "tabindex" }] : /* istanbul ignore next */ []));
22
- this._type = 'text';
23
- }
24
- get type() {
25
- return this.isVisible() ? 'text' : 'password';
26
- }
27
- toggleVisibility() {
28
- const newValue = !this.isVisible();
29
- this.isVisibleChange.emit(newValue);
30
- }
31
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatPassToggleVisibilityComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
32
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.2.0", type: CmatPassToggleVisibilityComponent, isStandalone: true, selector: "cmat-pass-toggle-visibility", inputs: { isVisible: { classPropertyName: "isVisible", publicName: "isVisible", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isVisibleChange: "isVisibleChange" }, exportAs: ["cmatPassToggleVisibility"], ngImport: i0, template: "<button type=\"button\" class=\"matIconButton cdk-focused cdk-mouse-focused\" matIconButton \r\n matRipple [matRippleCentered]=\"true\" [attr.tabindex]=\"tabindex() ? tabindex() : null\" (click)=\"toggleVisibility()\">\r\n <mat-icon svgIcon=\"{{isVisible() ? 'mat_outline:visibility' : 'mat_outline:visibility_off' }}\"></mat-icon>\r\n</button>\r\n", dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatRippleModule }, { kind: "directive", type: i2.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
33
- }
34
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatPassToggleVisibilityComponent, decorators: [{
35
- type: Component,
36
- args: [{ selector: 'cmat-pass-toggle-visibility', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'cmatPassToggleVisibility', imports: [MatButtonModule, MatRippleModule, MatIconModule], template: "<button type=\"button\" class=\"matIconButton cdk-focused cdk-mouse-focused\" matIconButton \r\n matRipple [matRippleCentered]=\"true\" [attr.tabindex]=\"tabindex() ? tabindex() : null\" (click)=\"toggleVisibility()\">\r\n <mat-icon svgIcon=\"{{isVisible() ? 'mat_outline:visibility' : 'mat_outline:visibility_off' }}\"></mat-icon>\r\n</button>\r\n" }]
37
- }], propDecorators: { isVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "isVisible", required: false }] }], isVisibleChange: [{ type: i0.Output, args: ["isVisibleChange"] }], tabindex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabindex", required: false }] }] } });
38
-
39
- /* eslint-disable @typescript-eslint/naming-convention */
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, effect, input, output, signal, untracked } from "@angular/core";
3
+ import * as i1$2 from "@angular/material/button";
4
+ import { MatButtonModule } from "@angular/material/button";
5
+ import * as i2 from "@angular/material/core";
6
+ import { MatRippleModule } from "@angular/material/core";
7
+ import * as i3 from "@angular/material/icon";
8
+ import { MatIconModule } from "@angular/material/icon";
9
+ import { FormControl, Validators } from "@angular/forms";
10
+ import * as i1$1 from "@angular/material/progress-bar";
11
+ import { MatProgressBarModule } from "@angular/material/progress-bar";
12
+ import * as i1 from "@angular/material/card";
13
+ import { MatCardModule } from "@angular/material/card";
14
+ var CmatPassToggleVisibilityComponent = class CmatPassToggleVisibilityComponent {
15
+ constructor() {
16
+ this.isVisible = input(false, ...ngDevMode ? [{ debugName: "isVisible" }] : /* istanbul ignore next */ []);
17
+ this.isVisibleChange = output();
18
+ this.tabindex = input(...ngDevMode ? [void 0, { debugName: "tabindex" }] : /* istanbul ignore next */ []);
19
+ this._type = "text";
20
+ }
21
+ get type() {
22
+ return this.isVisible() ? "text" : "password";
23
+ }
24
+ toggleVisibility() {
25
+ const newValue = !this.isVisible();
26
+ this.isVisibleChange.emit(newValue);
27
+ }
28
+ static {
29
+ this.ɵfac = i0.ɵɵngDeclareFactory({
30
+ minVersion: "12.0.0",
31
+ version: "22.2.3",
32
+ ngImport: i0,
33
+ type: CmatPassToggleVisibilityComponent,
34
+ deps: [],
35
+ target: i0.ɵɵFactoryTarget.Component
36
+ });
37
+ }
38
+ static {
39
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
40
+ minVersion: "17.1.0",
41
+ version: "22.2.3",
42
+ type: CmatPassToggleVisibilityComponent,
43
+ isStandalone: true,
44
+ selector: "cmat-pass-toggle-visibility",
45
+ inputs: {
46
+ isVisible: {
47
+ classPropertyName: "isVisible",
48
+ publicName: "isVisible",
49
+ isSignal: true,
50
+ isRequired: false,
51
+ transformFunction: null
52
+ },
53
+ tabindex: {
54
+ classPropertyName: "tabindex",
55
+ publicName: "tabindex",
56
+ isSignal: true,
57
+ isRequired: false,
58
+ transformFunction: null
59
+ }
60
+ },
61
+ outputs: { isVisibleChange: "isVisibleChange" },
62
+ exportAs: ["cmatPassToggleVisibility"],
63
+ ngImport: i0,
64
+ template: "<button type=\"button\" class=\"matIconButton cdk-focused cdk-mouse-focused\" matIconButton \r\n matRipple [matRippleCentered]=\"true\" [attr.tabindex]=\"tabindex() ? tabindex() : null\" (click)=\"toggleVisibility()\">\r\n <mat-icon svgIcon=\"{{isVisible() ? 'mat_outline:visibility' : 'mat_outline:visibility_off' }}\"></mat-icon>\r\n</button>\r\n",
65
+ dependencies: [
66
+ {
67
+ kind: "ngmodule",
68
+ type: MatButtonModule
69
+ },
70
+ {
71
+ kind: "component",
72
+ type: i1$2.MatIconButton,
73
+ selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
74
+ exportAs: ["matButton", "matAnchor"]
75
+ },
76
+ {
77
+ kind: "ngmodule",
78
+ type: MatRippleModule
79
+ },
80
+ {
81
+ kind: "directive",
82
+ type: i2.MatRipple,
83
+ selector: "[mat-ripple], [matRipple]",
84
+ inputs: [
85
+ "matRippleColor",
86
+ "matRippleUnbounded",
87
+ "matRippleCentered",
88
+ "matRippleRadius",
89
+ "matRippleAnimation",
90
+ "matRippleDisabled",
91
+ "matRippleTrigger"
92
+ ],
93
+ exportAs: ["matRipple"]
94
+ },
95
+ {
96
+ kind: "ngmodule",
97
+ type: MatIconModule
98
+ },
99
+ {
100
+ kind: "component",
101
+ type: i3.MatIcon,
102
+ selector: "mat-icon",
103
+ inputs: [
104
+ "color",
105
+ "inline",
106
+ "svgIcon",
107
+ "fontSet",
108
+ "fontIcon"
109
+ ],
110
+ exportAs: ["matIcon"]
111
+ }
112
+ ],
113
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
114
+ encapsulation: i0.ViewEncapsulation.None
115
+ });
116
+ }
117
+ };
118
+ i0.ɵɵngDeclareClassMetadata({
119
+ minVersion: "12.0.0",
120
+ version: "22.2.3",
121
+ ngImport: i0,
122
+ type: CmatPassToggleVisibilityComponent,
123
+ decorators: [{
124
+ type: Component,
125
+ args: [{
126
+ selector: "cmat-pass-toggle-visibility",
127
+ encapsulation: ViewEncapsulation.None,
128
+ changeDetection: ChangeDetectionStrategy.OnPush,
129
+ exportAs: "cmatPassToggleVisibility",
130
+ imports: [
131
+ MatButtonModule,
132
+ MatRippleModule,
133
+ MatIconModule
134
+ ],
135
+ template: "<button type=\"button\" class=\"matIconButton cdk-focused cdk-mouse-focused\" matIconButton \r\n matRipple [matRippleCentered]=\"true\" [attr.tabindex]=\"tabindex() ? tabindex() : null\" (click)=\"toggleVisibility()\">\r\n <mat-icon svgIcon=\"{{isVisible() ? 'mat_outline:visibility' : 'mat_outline:visibility_off' }}\"></mat-icon>\r\n</button>\r\n"
136
+ }]
137
+ }],
138
+ propDecorators: {
139
+ isVisible: [{
140
+ type: i0.Input,
141
+ args: [{
142
+ isSignal: true,
143
+ alias: "isVisible",
144
+ required: false
145
+ }]
146
+ }],
147
+ isVisibleChange: [{
148
+ type: i0.Output,
149
+ args: ["isVisibleChange"]
150
+ }],
151
+ tabindex: [{
152
+ type: i0.Input,
153
+ args: [{
154
+ isSignal: true,
155
+ alias: "tabindex",
156
+ required: false
157
+ }]
158
+ }]
159
+ }
160
+ });
40
161
  var Colors;
41
- (function (Colors) {
42
- Colors["primary"] = "primary";
43
- Colors["accent"] = "accent";
44
- Colors["warn"] = "warn";
162
+ (function(Colors) {
163
+ Colors["primary"] = "primary";
164
+ Colors["accent"] = "accent";
165
+ Colors["warn"] = "warn";
45
166
  })(Colors || (Colors = {}));
46
167
  var Criteria;
47
- (function (Criteria) {
48
- Criteria["at_least_eight_chars"] = "minChar";
49
- Criteria["at_least_one_lower_case_char"] = "lowerCase";
50
- Criteria["at_least_one_upper_case_char"] = "upperCase";
51
- Criteria["at_least_one_digit_char"] = "digit";
52
- Criteria["at_least_one_special_char"] = " specialChar";
53
- Criteria["at_custom_chars"] = "customChars";
168
+ (function(Criteria) {
169
+ Criteria["at_least_eight_chars"] = "minChar";
170
+ Criteria["at_least_one_lower_case_char"] = "lowerCase";
171
+ Criteria["at_least_one_upper_case_char"] = "upperCase";
172
+ Criteria["at_least_one_digit_char"] = "digit";
173
+ Criteria["at_least_one_special_char"] = " specialChar";
174
+ Criteria["at_custom_chars"] = "customChars";
54
175
  })(Criteria || (Criteria = {}));
55
-
56
- class CmatPasswordStrengthValidator {
57
- isUndefinedOrEmpty(control) {
58
- const value = typeof control.value === 'string' ? control.value : '';
59
- if (!value || value.length === 0) {
60
- return void 0;
61
- }
62
- }
63
- validate(criteria, regex) {
64
- return (control) => {
65
- this.isUndefinedOrEmpty(control);
66
- const value = typeof control.value === 'string' ? control.value : '';
67
- if (!regex.test(value)) {
68
- const failed = {};
69
- failed[criteria] = {
70
- actualValue: value,
71
- requiredPattern: regex
72
- };
73
- return failed;
74
- }
75
- return null;
76
- };
77
- }
78
- confirm(password) {
79
- return (control) => {
80
- this.isUndefinedOrEmpty(control);
81
- const value = typeof control.value === 'string' ? control.value : '';
82
- if (value !== password) {
83
- return {
84
- notConfirmed: {
85
- password: password,
86
- passwordConfirmation: value
87
- }
88
- };
89
- }
90
- return null;
91
- };
92
- }
93
- }
94
-
95
- // eslint-disable-next-line @typescript-eslint/naming-convention
176
+ var CmatPasswordStrengthValidator = class {
177
+ isUndefinedOrEmpty(control) {
178
+ const value = typeof control.value === "string" ? control.value : "";
179
+ if (!value || value.length === 0) return;
180
+ }
181
+ validate(criteria, regex) {
182
+ return (control) => {
183
+ this.isUndefinedOrEmpty(control);
184
+ const value = typeof control.value === "string" ? control.value : "";
185
+ if (!regex.test(value)) {
186
+ const failed = {};
187
+ failed[criteria] = {
188
+ actualValue: value,
189
+ requiredPattern: regex
190
+ };
191
+ return failed;
192
+ }
193
+ return null;
194
+ };
195
+ }
196
+ confirm(password) {
197
+ return (control) => {
198
+ this.isUndefinedOrEmpty(control);
199
+ const value = typeof control.value === "string" ? control.value : "";
200
+ if (value !== password) return { notConfirmed: {
201
+ password,
202
+ passwordConfirmation: value
203
+ } };
204
+ return null;
205
+ };
206
+ }
207
+ };
96
208
  const RegExpValidator = {
97
- 'lowerCase': RegExp(/^(?=.*?[a-z])/),
98
- 'upperCase': RegExp(/^(?=.*?[A-Z])/),
99
- 'digit': RegExp(/^(?=.*?[0-9])/),
100
- 'specialChar': RegExp(/^(?=.*?[" !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"])/),
209
+ "lowerCase": RegExp(/^(?=.*?[a-z])/),
210
+ "upperCase": RegExp(/^(?=.*?[A-Z])/),
211
+ "digit": RegExp(/^(?=.*?[0-9])/),
212
+ "specialChar": RegExp(/^(?=.*?[" !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"])/)
101
213
  };
102
-
103
- class CmatPasswordStrengthComponent {
104
- constructor() {
105
- this.password = input('', /* @ts-ignore */
106
- ...(ngDevMode ? [{ debugName: "password" }] : /* istanbul ignore next */ []));
107
- this.externalError = input(false, /* @ts-ignore */
108
- ...(ngDevMode ? [{ debugName: "externalError" }] : /* istanbul ignore next */ []));
109
- this.enableLengthRule = input(true, /* @ts-ignore */
110
- ...(ngDevMode ? [{ debugName: "enableLengthRule" }] : /* istanbul ignore next */ []));
111
- this.enableLowerCaseLetterRule = input(true, /* @ts-ignore */
112
- ...(ngDevMode ? [{ debugName: "enableLowerCaseLetterRule" }] : /* istanbul ignore next */ []));
113
- this.enableUpperCaseLetterRule = input(true, /* @ts-ignore */
114
- ...(ngDevMode ? [{ debugName: "enableUpperCaseLetterRule" }] : /* istanbul ignore next */ []));
115
- this.enableDigitRule = input(true, /* @ts-ignore */
116
- ...(ngDevMode ? [{ debugName: "enableDigitRule" }] : /* istanbul ignore next */ []));
117
- this.enableSpecialCharRule = input(true, /* @ts-ignore */
118
- ...(ngDevMode ? [{ debugName: "enableSpecialCharRule" }] : /* istanbul ignore next */ []));
119
- this.min = input(8, /* @ts-ignore */
120
- ...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
121
- this.max = input(30, /* @ts-ignore */
122
- ...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
123
- this.customValidator = input(/* @ts-ignore */
124
- ...(ngDevMode ? [undefined, { debugName: "customValidator" }] : /* istanbul ignore next */ []));
125
- this.warnThreshold = input(21, /* @ts-ignore */
126
- ...(ngDevMode ? [{ debugName: "warnThreshold" }] : /* istanbul ignore next */ []));
127
- this.accentThreshold = input(81, /* @ts-ignore */
128
- ...(ngDevMode ? [{ debugName: "accentThreshold" }] : /* istanbul ignore next */ []));
129
- this.strengthChanged = output();
130
- this.criteriaMap = signal(new Map(), /* @ts-ignore */
131
- ...(ngDevMode ? [{ debugName: "criteriaMap" }] : /* istanbul ignore next */ []));
132
- this.containAtLeastMinChars = signal(false, /* @ts-ignore */
133
- ...(ngDevMode ? [{ debugName: "containAtLeastMinChars" }] : /* istanbul ignore next */ []));
134
- this.containAtLeastOneLowerCaseLetter = signal(false, /* @ts-ignore */
135
- ...(ngDevMode ? [{ debugName: "containAtLeastOneLowerCaseLetter" }] : /* istanbul ignore next */ []));
136
- this.containAtLeastOneUpperCaseLetter = signal(false, /* @ts-ignore */
137
- ...(ngDevMode ? [{ debugName: "containAtLeastOneUpperCaseLetter" }] : /* istanbul ignore next */ []));
138
- this.containAtLeastOneDigit = signal(false, /* @ts-ignore */
139
- ...(ngDevMode ? [{ debugName: "containAtLeastOneDigit" }] : /* istanbul ignore next */ []));
140
- this.containAtLeastOneSpecialChar = signal(false, /* @ts-ignore */
141
- ...(ngDevMode ? [{ debugName: "containAtLeastOneSpecialChar" }] : /* istanbul ignore next */ []));
142
- this.containAtCustomChars = signal(false, /* @ts-ignore */
143
- ...(ngDevMode ? [{ debugName: "containAtCustomChars" }] : /* istanbul ignore next */ []));
144
- this.passwordFormControl = new FormControl();
145
- this.passwordConfirmationFormControl = new FormControl();
146
- this.validatorsArray = signal([], /* @ts-ignore */
147
- ...(ngDevMode ? [{ debugName: "validatorsArray" }] : /* istanbul ignore next */ []));
148
- this.validators = signal(null, /* @ts-ignore */
149
- ...(ngDevMode ? [{ debugName: "validators" }] : /* istanbul ignore next */ []));
150
- this.strength = computed(() => this._strength() || 0, /* @ts-ignore */
151
- ...(ngDevMode ? [{ debugName: "strength" }] : /* istanbul ignore next */ []));
152
- this.color = computed(() => this._color(), /* @ts-ignore */
153
- ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
154
- this.cmatPasswordStrengthValidator = new CmatPasswordStrengthValidator();
155
- this._strength = signal(0, /* @ts-ignore */
156
- ...(ngDevMode ? [{ debugName: "_strength" }] : /* istanbul ignore next */ []));
157
- this._color = signal('warn', /* @ts-ignore */
158
- ...(ngDevMode ? [{ debugName: "_color" }] : /* istanbul ignore next */ []));
159
- this._isProcessingEffect = false;
160
- // 初始化时设置一次验证器
161
- this.setRulesAndValidators();
162
- effect(() => {
163
- if (this._isProcessingEffect) {
164
- return;
165
- }
166
- const pwd = this.password();
167
- untracked(() => {
168
- // 密码为空时重置
169
- if (!pwd || pwd.length === 0) {
170
- this.reset();
171
- return;
172
- }
173
- // 密码存在时计算强度(不重建验证器)
174
- this.calculatePasswordStrength(false);
175
- });
176
- });
177
- effect(() => {
178
- if (this._isProcessingEffect) {
179
- return;
180
- }
181
- const extError = this.externalError();
182
- if (extError) {
183
- this._color.set(Colors.warn);
184
- }
185
- });
186
- // 监听配置变化,重新构建验证器
187
- effect(() => {
188
- if (this._isProcessingEffect) {
189
- return;
190
- }
191
- // 读取所有配置项,任何一项变化都会触发此 effect
192
- this.enableLengthRule();
193
- this.enableLowerCaseLetterRule();
194
- this.enableUpperCaseLetterRule();
195
- this.enableDigitRule();
196
- this.enableSpecialCharRule();
197
- this.min();
198
- this.max();
199
- this.customValidator();
200
- untracked(() => {
201
- // 配置变化时重新构建验证器
202
- this.setRulesAndValidators();
203
- // 如果当前有密码,重新计算强度
204
- const pwd = this.password();
205
- if (pwd && pwd.length > 0) {
206
- this.calculatePasswordStrength(false);
207
- }
208
- });
209
- });
210
- }
211
- parseCustomValidatorsRegex() {
212
- const validator = this.customValidator();
213
- if (validator instanceof RegExp) {
214
- return validator;
215
- }
216
- else {
217
- return RegExp(validator);
218
- }
219
- }
220
- setRulesAndValidators() {
221
- this.validatorsArray.set([]);
222
- this.criteriaMap.set(new Map());
223
- this.passwordConfirmationFormControl
224
- .setValidators(Validators.compose([
225
- Validators.required, this.cmatPasswordStrengthValidator.confirm(this.password())
226
- ]));
227
- const validators = [Validators.required];
228
- if (this.enableLengthRule()) {
229
- this.criteriaMap().set(Criteria.at_least_eight_chars, RegExp(`^.{${this.min()},${this.max()}}$`));
230
- validators.push(Validators.minLength(this.min()));
231
- validators.push(Validators.maxLength(this.max()));
232
- }
233
- if (this.enableLowerCaseLetterRule()) {
234
- this.criteriaMap().set(Criteria.at_least_one_lower_case_char, RegExpValidator.lowerCase);
235
- validators.push(Validators.pattern(RegExpValidator.lowerCase));
236
- }
237
- if (this.enableUpperCaseLetterRule()) {
238
- this.criteriaMap().set(Criteria.at_least_one_upper_case_char, RegExpValidator.upperCase);
239
- validators.push(Validators.pattern(RegExpValidator.upperCase));
240
- }
241
- if (this.enableDigitRule()) {
242
- this.criteriaMap().set(Criteria.at_least_one_digit_char, RegExpValidator.digit);
243
- validators.push(Validators.pattern(RegExpValidator.digit));
244
- }
245
- if (this.enableSpecialCharRule()) {
246
- this.criteriaMap().set(Criteria.at_least_one_special_char, RegExpValidator.specialChar);
247
- validators.push(Validators.pattern(RegExpValidator.specialChar));
248
- }
249
- if (this.customValidator()) {
250
- this.criteriaMap().set(Criteria.at_custom_chars, this.parseCustomValidatorsRegex());
251
- validators.push(Validators.pattern(this.parseCustomValidatorsRegex()));
252
- }
253
- this.criteriaMap().forEach((value, key) => {
254
- validators.push(this.cmatPasswordStrengthValidator.validate(key, value));
255
- });
256
- this.passwordFormControl.setValidators(Validators.compose([...validators]));
257
- this.validatorsArray.set(validators);
258
- this.validators.set(Validators.compose([...validators]));
259
- }
260
- calculatePasswordStrength(rebuildValidators = false) {
261
- try {
262
- this._isProcessingEffect = true;
263
- // 如果需要重建验证器(仅在配置变化时)
264
- if (rebuildValidators) {
265
- this.setRulesAndValidators();
266
- }
267
- const requirements = [];
268
- const unit = 100 / this.criteriaMap().size;
269
- requirements.push(this.enableLengthRule() ? this._containAtLeastMinChars() : false, this.enableLowerCaseLetterRule() ? this._containAtLeastOneLowerCaseLetter() : false, this.enableUpperCaseLetterRule() ? this._containAtLeastOneUpperCaseLetter() : false, this.enableDigitRule() ? this._containAtLeastOneDigit() : false, this.enableSpecialCharRule() ? this._containAtLeastOneSpecialChar() : false, this.customValidator() ? this._containCustomChars() : false);
270
- this._strength.set(requirements.filter(v => v).length * unit);
271
- this.strengthChanged.emit(this.strength());
272
- const currentStrength = this._strength();
273
- if (currentStrength < this.warnThreshold()) {
274
- this._color.set(Colors.warn);
275
- }
276
- else if (currentStrength < this.accentThreshold()) {
277
- this._color.set(Colors.accent);
278
- }
279
- else {
280
- this._color.set(Colors.primary);
281
- }
282
- }
283
- finally {
284
- this._isProcessingEffect = false;
285
- }
286
- }
287
- reset() {
288
- try {
289
- this._isProcessingEffect = true;
290
- this._strength.set(0);
291
- this.containAtLeastMinChars.set(false);
292
- this.containAtLeastOneLowerCaseLetter.set(false);
293
- this.containAtLeastOneUpperCaseLetter.set(false);
294
- this.containAtLeastOneDigit.set(false);
295
- this.containAtCustomChars.set(false);
296
- this.containAtLeastOneSpecialChar.set(false);
297
- this._color.set(Colors.warn);
298
- this.strengthChanged.emit(this.strength());
299
- }
300
- finally {
301
- this._isProcessingEffect = false;
302
- }
303
- }
304
- _containAtLeastMinChars() {
305
- const result = this.password().length >= this.min();
306
- this.containAtLeastMinChars.set(result);
307
- return result;
308
- }
309
- _containAtLeastOneLowerCaseLetter() {
310
- const result = this.criteriaMap()
311
- .get(Criteria.at_least_one_lower_case_char)?.test(this.password());
312
- this.containAtLeastOneLowerCaseLetter.set(result);
313
- return result ?? false;
314
- }
315
- _containAtLeastOneUpperCaseLetter() {
316
- const result = this.criteriaMap()
317
- .get(Criteria.at_least_one_upper_case_char)?.test(this.password());
318
- this.containAtLeastOneUpperCaseLetter.set(result);
319
- return result ?? false;
320
- }
321
- _containAtLeastOneDigit() {
322
- const result = this.criteriaMap()
323
- .get(Criteria.at_least_one_digit_char)?.test(this.password());
324
- this.containAtLeastOneDigit.set(result);
325
- return result ?? false;
326
- }
327
- _containAtLeastOneSpecialChar() {
328
- const result = this.criteriaMap()
329
- .get(Criteria.at_least_one_special_char)?.test(this.password());
330
- this.containAtLeastOneSpecialChar.set(result);
331
- return result ?? false;
332
- }
333
- _containCustomChars() {
334
- const result = this.criteriaMap()
335
- .get(Criteria.at_custom_chars)?.test(this.password());
336
- this.containAtCustomChars.set(result);
337
- return result ?? false;
338
- }
339
- _checkPassword() {
340
- this.calculatePasswordStrength();
341
- this.passwordConfirmationFormControl.updateValueAndValidity();
342
- }
343
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatPasswordStrengthComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
344
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.2.0", type: CmatPasswordStrengthComponent, isStandalone: true, selector: "cmat-password-strength", inputs: { password: { classPropertyName: "password", publicName: "password", isSignal: true, isRequired: false, transformFunction: null }, externalError: { classPropertyName: "externalError", publicName: "externalError", isSignal: true, isRequired: false, transformFunction: null }, enableLengthRule: { classPropertyName: "enableLengthRule", publicName: "enableLengthRule", isSignal: true, isRequired: false, transformFunction: null }, enableLowerCaseLetterRule: { classPropertyName: "enableLowerCaseLetterRule", publicName: "enableLowerCaseLetterRule", isSignal: true, isRequired: false, transformFunction: null }, enableUpperCaseLetterRule: { classPropertyName: "enableUpperCaseLetterRule", publicName: "enableUpperCaseLetterRule", isSignal: true, isRequired: false, transformFunction: null }, enableDigitRule: { classPropertyName: "enableDigitRule", publicName: "enableDigitRule", isSignal: true, isRequired: false, transformFunction: null }, enableSpecialCharRule: { classPropertyName: "enableSpecialCharRule", publicName: "enableSpecialCharRule", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, customValidator: { classPropertyName: "customValidator", publicName: "customValidator", isSignal: true, isRequired: false, transformFunction: null }, warnThreshold: { classPropertyName: "warnThreshold", publicName: "warnThreshold", isSignal: true, isRequired: false, transformFunction: null }, accentThreshold: { classPropertyName: "accentThreshold", publicName: "accentThreshold", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { strengthChanged: "strengthChanged" }, exportAs: ["cmatPasswordStrength"], ngImport: i0, template: "<mat-progress-bar mode=\"determinate\" [color]=\"color()\" [value]=\"strength()\"></mat-progress-bar>", dependencies: [{ kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i1$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
345
- }
346
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatPasswordStrengthComponent, decorators: [{
347
- type: Component,
348
- args: [{ selector: 'cmat-password-strength', exportAs: 'cmatPasswordStrength', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatProgressBarModule], template: "<mat-progress-bar mode=\"determinate\" [color]=\"color()\" [value]=\"strength()\"></mat-progress-bar>" }]
349
- }], ctorParameters: () => [], propDecorators: { password: [{ type: i0.Input, args: [{ isSignal: true, alias: "password", required: false }] }], externalError: [{ type: i0.Input, args: [{ isSignal: true, alias: "externalError", required: false }] }], enableLengthRule: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableLengthRule", required: false }] }], enableLowerCaseLetterRule: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableLowerCaseLetterRule", required: false }] }], enableUpperCaseLetterRule: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableUpperCaseLetterRule", required: false }] }], enableDigitRule: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableDigitRule", required: false }] }], enableSpecialCharRule: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableSpecialCharRule", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], customValidator: [{ type: i0.Input, args: [{ isSignal: true, alias: "customValidator", required: false }] }], warnThreshold: [{ type: i0.Input, args: [{ isSignal: true, alias: "warnThreshold", required: false }] }], accentThreshold: [{ type: i0.Input, args: [{ isSignal: true, alias: "accentThreshold", required: false }] }], strengthChanged: [{ type: i0.Output, args: ["strengthChanged"] }] } });
350
-
351
- class CmatPasswordStrengthInfoComponent {
352
- constructor() {
353
- this.passwordComponent = input.required(/* @ts-ignore */
354
- ...(ngDevMode ? [{ debugName: "passwordComponent" }] : /* istanbul ignore next */ []));
355
- this.enableScoreInfo = input(false, /* @ts-ignore */
356
- ...(ngDevMode ? [{ debugName: "enableScoreInfo" }] : /* istanbul ignore next */ []));
357
- this.lowerCaseCriteriaMsg = input('包含至少一个小写字母', /* @ts-ignore */
358
- ...(ngDevMode ? [{ debugName: "lowerCaseCriteriaMsg" }] : /* istanbul ignore next */ []));
359
- this.upperCaseCriteriaMsg = input('包含至少一个大写字母', /* @ts-ignore */
360
- ...(ngDevMode ? [{ debugName: "upperCaseCriteriaMsg" }] : /* istanbul ignore next */ []));
361
- this.digitsCriteriaMsg = input('包含至少一个数字', /* @ts-ignore */
362
- ...(ngDevMode ? [{ debugName: "digitsCriteriaMsg" }] : /* istanbul ignore next */ []));
363
- this.specialCharsCriteriaMsg = input('包含至少一个特殊字符', /* @ts-ignore */
364
- ...(ngDevMode ? [{ debugName: "specialCharsCriteriaMsg" }] : /* istanbul ignore next */ []));
365
- this.customCharsCriteriaMsg = input('包含至少一个传统字符', /* @ts-ignore */
366
- ...(ngDevMode ? [{ debugName: "customCharsCriteriaMsg" }] : /* istanbul ignore next */ []));
367
- this.minCharsCriteriaMsg = input(/* @ts-ignore */
368
- ...(ngDevMode ? [undefined, { debugName: "minCharsCriteriaMsg" }] : /* istanbul ignore next */ []));
369
- this.pageLoaded = signal(false, /* @ts-ignore */
370
- ...(ngDevMode ? [{ debugName: "pageLoaded" }] : /* istanbul ignore next */ []));
371
- setTimeout(() => {
372
- this.pageLoaded.set(true);
373
- }, 100);
374
- }
375
- getMinCharsMsg() {
376
- return this.minCharsCriteriaMsg() ?? `包含至少 ${this.passwordComponent().min()} 个字符`;
377
- }
378
- getEnterIndex(itemType) {
379
- const enabledItems = [];
380
- if (this.passwordComponent().enableLowerCaseLetterRule()) {
381
- enabledItems.push('lowerCase');
382
- }
383
- if (this.passwordComponent().enableUpperCaseLetterRule()) {
384
- enabledItems.push('upperCase');
385
- }
386
- if (this.passwordComponent().enableDigitRule()) {
387
- enabledItems.push('digit');
388
- }
389
- if (this.passwordComponent().enableSpecialCharRule()) {
390
- enabledItems.push('specialChar');
391
- }
392
- if (this.passwordComponent().enableLengthRule()) {
393
- enabledItems.push('length');
394
- }
395
- if (this.passwordComponent().customValidator()) {
396
- enabledItems.push('custom');
397
- }
398
- if (this.enableScoreInfo()) {
399
- enabledItems.push('score');
400
- }
401
- return enabledItems.findIndex(i => i === itemType);
402
- }
403
- getLeaveIndex(itemType) {
404
- const enabledItems = [];
405
- if (this.passwordComponent().enableLowerCaseLetterRule()) {
406
- enabledItems.push('lowerCase');
407
- }
408
- if (this.passwordComponent().enableUpperCaseLetterRule()) {
409
- enabledItems.push('upperCase');
410
- }
411
- if (this.passwordComponent().enableDigitRule()) {
412
- enabledItems.push('digit');
413
- }
414
- if (this.passwordComponent().enableSpecialCharRule()) {
415
- enabledItems.push('specialChar');
416
- }
417
- if (this.passwordComponent().enableLengthRule()) {
418
- enabledItems.push('length');
419
- }
420
- if (this.passwordComponent().customValidator()) {
421
- enabledItems.push('custom');
422
- }
423
- if (this.enableScoreInfo()) {
424
- enabledItems.push('score');
425
- }
426
- return enabledItems.length - enabledItems.findIndex(j => j === itemType) - 1;
427
- }
428
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatPasswordStrengthInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
429
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.0", type: CmatPasswordStrengthInfoComponent, isStandalone: true, selector: "cmat-password-strength-info", inputs: { passwordComponent: { classPropertyName: "passwordComponent", publicName: "passwordComponent", isSignal: true, isRequired: true, transformFunction: null }, enableScoreInfo: { classPropertyName: "enableScoreInfo", publicName: "enableScoreInfo", isSignal: true, isRequired: false, transformFunction: null }, lowerCaseCriteriaMsg: { classPropertyName: "lowerCaseCriteriaMsg", publicName: "lowerCaseCriteriaMsg", isSignal: true, isRequired: false, transformFunction: null }, upperCaseCriteriaMsg: { classPropertyName: "upperCaseCriteriaMsg", publicName: "upperCaseCriteriaMsg", isSignal: true, isRequired: false, transformFunction: null }, digitsCriteriaMsg: { classPropertyName: "digitsCriteriaMsg", publicName: "digitsCriteriaMsg", isSignal: true, isRequired: false, transformFunction: null }, specialCharsCriteriaMsg: { classPropertyName: "specialCharsCriteriaMsg", publicName: "specialCharsCriteriaMsg", isSignal: true, isRequired: false, transformFunction: null }, customCharsCriteriaMsg: { classPropertyName: "customCharsCriteriaMsg", publicName: "customCharsCriteriaMsg", isSignal: true, isRequired: false, transformFunction: null }, minCharsCriteriaMsg: { classPropertyName: "minCharsCriteriaMsg", publicName: "minCharsCriteriaMsg", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["cmatPasswordStrengthInfo"], ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n<mat-card class=\"info-card\">\r\n <mat-card-content>\r\n @if (passwordComponent().enableLowerCaseLetterRule()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('lowerCase')\" [style.--leave-item-index]=\"getLeaveIndex('lowerCase')\">\r\n @if (passwordComponent().containAtLeastOneLowerCaseLetter()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{lowerCaseCriteriaMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (passwordComponent().enableUpperCaseLetterRule()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('upperCase')\" [style.--leave-item-index]=\"getLeaveIndex('upperCase')\">\r\n @if (passwordComponent().containAtLeastOneUpperCaseLetter()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{upperCaseCriteriaMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (passwordComponent().enableDigitRule()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('digit')\" [style.--leave-item-index]=\"getLeaveIndex('digit')\">\r\n @if (passwordComponent().containAtLeastOneDigit()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{digitsCriteriaMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (passwordComponent().enableSpecialCharRule()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('specialChar')\"\r\n [style.--leave-item-index]=\"getLeaveIndex('specialChar')\">\r\n @if (passwordComponent().containAtLeastOneSpecialChar()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{specialCharsCriteriaMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (passwordComponent().enableLengthRule()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('length')\" [style.--leave-item-index]=\"getLeaveIndex('length')\">\r\n @if (passwordComponent().containAtLeastMinChars()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{getMinCharsMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (passwordComponent().customValidator()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('custom')\" [style.--leave-item-index]=\"getLeaveIndex('custom')\">\r\n @if (passwordComponent().containAtCustomChars()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{customCharsCriteriaMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (enableScoreInfo()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('score')\" [style.--leave-item-index]=\"getLeaveIndex('score')\">\r\n @if (passwordComponent().strength() === 100) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>\u5BC6\u7801\u5F3A\u5EA6= {{passwordComponent().strength()}} %100</span>\r\n </div>\r\n }\r\n\r\n </mat-card-content>\r\n<!-- eslint-enable @angular-eslint/template/no-inline-styles -->\r\n</mat-card>\r\n", styles: ["cmat-password-strength-info{margin-top:20px}cmat-password-strength-info .mat-mdc-card{display:flex;flex-direction:row;flex:1 1 0%;margin:.5rem;box-sizing:border-box;place-content:stretch;align-items:stretch}cmat-password-strength-info .mat-mdc-card .mat-mdc-card-content{display:flex;flex-direction:column;box-sizing:border-box;max-width:100%;place-content:stretch;align-items:stretch}cmat-password-strength-info .mat-mdc-card .mat-mdc-card-content .mat-icon{margin-right:1rem}cmat-password-strength-info .mat-mdc-card .mat-mdc-card-content .info-row{display:flex;flex-direction:row;box-sizing:border-box;align-items:center}cmat-password-strength-info .info-card .info-row.info-row-enter{transition-property:opacity,transform;transition-delay:calc(.3s * var(--enter-item-index, 0));transition-duration:1s;transition-timing-function:cubic-bezier(.8,-.6,.2,1.5)}@starting-style{cmat-password-strength-info .info-card .info-row.info-row-enter{transform:scale(.5);opacity:0}}cmat-password-strength-info .info-card .info-row.info-row-leave{transition-property:opacity,transform,height;transition-delay:calc(.3s * var(--leave-item-index, 0));transition-duration:1s;transition-timing-function:cubic-bezier(.8,-.6,.2,1.5);opacity:0;transform:scale(.5);height:0;margin:0}@starting-style{cmat-password-strength-info .info-card .info-row.info-row-leave{transform:scale(1);opacity:1;height:inherit}}cmat-password-strength-info .shake-info-animation{animation:shake 1s}cmat-password-strength-info .flip-in-x-animation{backface-visibility:visible;animation:flipInX 1s ease-in}cmat-password-strength-info .flip-in-y-animation{backface-visibility:visible;animation:flipInY 1s ease-in}@keyframes shake{0%{transform:translateZ(0)}10%{transform:translate3d(-10px,0,0)}20%{transform:translate3d(10px,0,0)}30%{transform:translate3d(-10px,0,0)}40%{transform:translate3d(10px,0,0)}50%{transform:translate3d(-10px,0,0)}60%{transform:translate3d(10px,0,0)}70%{transform:translate3d(-10px,0,0)}80%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-10px,0,0)}to{transform:translateZ(0)}}@keyframes flipInX{0%{opacity:0;transform:perspective(400px) rotateX(90deg)}40%{opacity:1;transform:perspective(400px) rotateX(-20deg)}60%{transform:perspective(400px) rotateX(10deg)}80%{transform:perspective(400px) rotateX(-5deg)}to{opacity:1;transform:perspective(400px) rotate3d(0,0,0,0)}}@keyframes flipInY{0%{opacity:0;transform:perspective(400px) rotateY(90deg)}40%{opacity:1;transform:perspective(400px) rotateY(-20deg)}60%{transform:perspective(400px) rotateY(10deg)}80%{transform:perspective(400px) rotateY(-5deg)}to{opacity:1;transform:perspective(400px) rotate3d(0,0,0,0)}}\n"], dependencies: [{ kind: "ngmodule", type: MatCardModule }, { kind: "component", type: i1$2.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i1$2.MatCardContent, selector: "mat-card-content" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], encapsulation: i0.ViewEncapsulation.None }); }
430
- }
431
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: CmatPasswordStrengthInfoComponent, decorators: [{
432
- type: Component,
433
- args: [{ selector: 'cmat-password-strength-info', exportAs: 'cmatPasswordStrengthInfo', encapsulation: ViewEncapsulation.None, imports: [MatCardModule, MatIconModule], template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n<mat-card class=\"info-card\">\r\n <mat-card-content>\r\n @if (passwordComponent().enableLowerCaseLetterRule()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('lowerCase')\" [style.--leave-item-index]=\"getLeaveIndex('lowerCase')\">\r\n @if (passwordComponent().containAtLeastOneLowerCaseLetter()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{lowerCaseCriteriaMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (passwordComponent().enableUpperCaseLetterRule()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('upperCase')\" [style.--leave-item-index]=\"getLeaveIndex('upperCase')\">\r\n @if (passwordComponent().containAtLeastOneUpperCaseLetter()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{upperCaseCriteriaMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (passwordComponent().enableDigitRule()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('digit')\" [style.--leave-item-index]=\"getLeaveIndex('digit')\">\r\n @if (passwordComponent().containAtLeastOneDigit()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{digitsCriteriaMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (passwordComponent().enableSpecialCharRule()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('specialChar')\"\r\n [style.--leave-item-index]=\"getLeaveIndex('specialChar')\">\r\n @if (passwordComponent().containAtLeastOneSpecialChar()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{specialCharsCriteriaMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (passwordComponent().enableLengthRule()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('length')\" [style.--leave-item-index]=\"getLeaveIndex('length')\">\r\n @if (passwordComponent().containAtLeastMinChars()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{getMinCharsMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (passwordComponent().customValidator()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('custom')\" [style.--leave-item-index]=\"getLeaveIndex('custom')\">\r\n @if (passwordComponent().containAtCustomChars()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{customCharsCriteriaMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (enableScoreInfo()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('score')\" [style.--leave-item-index]=\"getLeaveIndex('score')\">\r\n @if (passwordComponent().strength() === 100) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>\u5BC6\u7801\u5F3A\u5EA6= {{passwordComponent().strength()}} %100</span>\r\n </div>\r\n }\r\n\r\n </mat-card-content>\r\n<!-- eslint-enable @angular-eslint/template/no-inline-styles -->\r\n</mat-card>\r\n", styles: ["cmat-password-strength-info{margin-top:20px}cmat-password-strength-info .mat-mdc-card{display:flex;flex-direction:row;flex:1 1 0%;margin:.5rem;box-sizing:border-box;place-content:stretch;align-items:stretch}cmat-password-strength-info .mat-mdc-card .mat-mdc-card-content{display:flex;flex-direction:column;box-sizing:border-box;max-width:100%;place-content:stretch;align-items:stretch}cmat-password-strength-info .mat-mdc-card .mat-mdc-card-content .mat-icon{margin-right:1rem}cmat-password-strength-info .mat-mdc-card .mat-mdc-card-content .info-row{display:flex;flex-direction:row;box-sizing:border-box;align-items:center}cmat-password-strength-info .info-card .info-row.info-row-enter{transition-property:opacity,transform;transition-delay:calc(.3s * var(--enter-item-index, 0));transition-duration:1s;transition-timing-function:cubic-bezier(.8,-.6,.2,1.5)}@starting-style{cmat-password-strength-info .info-card .info-row.info-row-enter{transform:scale(.5);opacity:0}}cmat-password-strength-info .info-card .info-row.info-row-leave{transition-property:opacity,transform,height;transition-delay:calc(.3s * var(--leave-item-index, 0));transition-duration:1s;transition-timing-function:cubic-bezier(.8,-.6,.2,1.5);opacity:0;transform:scale(.5);height:0;margin:0}@starting-style{cmat-password-strength-info .info-card .info-row.info-row-leave{transform:scale(1);opacity:1;height:inherit}}cmat-password-strength-info .shake-info-animation{animation:shake 1s}cmat-password-strength-info .flip-in-x-animation{backface-visibility:visible;animation:flipInX 1s ease-in}cmat-password-strength-info .flip-in-y-animation{backface-visibility:visible;animation:flipInY 1s ease-in}@keyframes shake{0%{transform:translateZ(0)}10%{transform:translate3d(-10px,0,0)}20%{transform:translate3d(10px,0,0)}30%{transform:translate3d(-10px,0,0)}40%{transform:translate3d(10px,0,0)}50%{transform:translate3d(-10px,0,0)}60%{transform:translate3d(10px,0,0)}70%{transform:translate3d(-10px,0,0)}80%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-10px,0,0)}to{transform:translateZ(0)}}@keyframes flipInX{0%{opacity:0;transform:perspective(400px) rotateX(90deg)}40%{opacity:1;transform:perspective(400px) rotateX(-20deg)}60%{transform:perspective(400px) rotateX(10deg)}80%{transform:perspective(400px) rotateX(-5deg)}to{opacity:1;transform:perspective(400px) rotate3d(0,0,0,0)}}@keyframes flipInY{0%{opacity:0;transform:perspective(400px) rotateY(90deg)}40%{opacity:1;transform:perspective(400px) rotateY(-20deg)}60%{transform:perspective(400px) rotateY(10deg)}80%{transform:perspective(400px) rotateY(-5deg)}to{opacity:1;transform:perspective(400px) rotate3d(0,0,0,0)}}\n"] }]
434
- }], ctorParameters: () => [], propDecorators: { passwordComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "passwordComponent", required: true }] }], enableScoreInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableScoreInfo", required: false }] }], lowerCaseCriteriaMsg: [{ type: i0.Input, args: [{ isSignal: true, alias: "lowerCaseCriteriaMsg", required: false }] }], upperCaseCriteriaMsg: [{ type: i0.Input, args: [{ isSignal: true, alias: "upperCaseCriteriaMsg", required: false }] }], digitsCriteriaMsg: [{ type: i0.Input, args: [{ isSignal: true, alias: "digitsCriteriaMsg", required: false }] }], specialCharsCriteriaMsg: [{ type: i0.Input, args: [{ isSignal: true, alias: "specialCharsCriteriaMsg", required: false }] }], customCharsCriteriaMsg: [{ type: i0.Input, args: [{ isSignal: true, alias: "customCharsCriteriaMsg", required: false }] }], minCharsCriteriaMsg: [{ type: i0.Input, args: [{ isSignal: true, alias: "minCharsCriteriaMsg", required: false }] }] } });
435
-
436
- /**
437
- * Generated bundle index. Do not edit.
438
- */
439
-
214
+ var CmatPasswordStrengthComponent = class CmatPasswordStrengthComponent {
215
+ constructor() {
216
+ this.password = input("", ...ngDevMode ? [{ debugName: "password" }] : /* istanbul ignore next */ []);
217
+ this.externalError = input(false, ...ngDevMode ? [{ debugName: "externalError" }] : /* istanbul ignore next */ []);
218
+ this.enableLengthRule = input(true, ...ngDevMode ? [{ debugName: "enableLengthRule" }] : /* istanbul ignore next */ []);
219
+ this.enableLowerCaseLetterRule = input(true, ...ngDevMode ? [{ debugName: "enableLowerCaseLetterRule" }] : /* istanbul ignore next */ []);
220
+ this.enableUpperCaseLetterRule = input(true, ...ngDevMode ? [{ debugName: "enableUpperCaseLetterRule" }] : /* istanbul ignore next */ []);
221
+ this.enableDigitRule = input(true, ...ngDevMode ? [{ debugName: "enableDigitRule" }] : /* istanbul ignore next */ []);
222
+ this.enableSpecialCharRule = input(true, ...ngDevMode ? [{ debugName: "enableSpecialCharRule" }] : /* istanbul ignore next */ []);
223
+ this.min = input(8, ...ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []);
224
+ this.max = input(30, ...ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []);
225
+ this.customValidator = input(...ngDevMode ? [void 0, { debugName: "customValidator" }] : /* istanbul ignore next */ []);
226
+ this.warnThreshold = input(21, ...ngDevMode ? [{ debugName: "warnThreshold" }] : /* istanbul ignore next */ []);
227
+ this.accentThreshold = input(81, ...ngDevMode ? [{ debugName: "accentThreshold" }] : /* istanbul ignore next */ []);
228
+ this.strengthChanged = output();
229
+ this.criteriaMap = signal(/* @__PURE__ */ new Map(), ...ngDevMode ? [{ debugName: "criteriaMap" }] : /* istanbul ignore next */ []);
230
+ this.containAtLeastMinChars = signal(false, ...ngDevMode ? [{ debugName: "containAtLeastMinChars" }] : /* istanbul ignore next */ []);
231
+ this.containAtLeastOneLowerCaseLetter = signal(false, ...ngDevMode ? [{ debugName: "containAtLeastOneLowerCaseLetter" }] : /* istanbul ignore next */ []);
232
+ this.containAtLeastOneUpperCaseLetter = signal(false, ...ngDevMode ? [{ debugName: "containAtLeastOneUpperCaseLetter" }] : /* istanbul ignore next */ []);
233
+ this.containAtLeastOneDigit = signal(false, ...ngDevMode ? [{ debugName: "containAtLeastOneDigit" }] : /* istanbul ignore next */ []);
234
+ this.containAtLeastOneSpecialChar = signal(false, ...ngDevMode ? [{ debugName: "containAtLeastOneSpecialChar" }] : /* istanbul ignore next */ []);
235
+ this.containAtCustomChars = signal(false, ...ngDevMode ? [{ debugName: "containAtCustomChars" }] : /* istanbul ignore next */ []);
236
+ this.passwordFormControl = new FormControl();
237
+ this.passwordConfirmationFormControl = new FormControl();
238
+ this.validatorsArray = signal([], ...ngDevMode ? [{ debugName: "validatorsArray" }] : /* istanbul ignore next */ []);
239
+ this.validators = signal(null, ...ngDevMode ? [{ debugName: "validators" }] : /* istanbul ignore next */ []);
240
+ this.strength = computed(() => this._strength() || 0, ...ngDevMode ? [{ debugName: "strength" }] : /* istanbul ignore next */ []);
241
+ this.color = computed(() => this._color(), ...ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []);
242
+ this.cmatPasswordStrengthValidator = new CmatPasswordStrengthValidator();
243
+ this._strength = signal(0, ...ngDevMode ? [{ debugName: "_strength" }] : /* istanbul ignore next */ []);
244
+ this._color = signal("warn", ...ngDevMode ? [{ debugName: "_color" }] : /* istanbul ignore next */ []);
245
+ this._isProcessingEffect = false;
246
+ this.setRulesAndValidators();
247
+ effect(() => {
248
+ if (this._isProcessingEffect) return;
249
+ const pwd = this.password();
250
+ untracked(() => {
251
+ if (!pwd || pwd.length === 0) {
252
+ this.reset();
253
+ return;
254
+ }
255
+ this.calculatePasswordStrength(false);
256
+ });
257
+ });
258
+ effect(() => {
259
+ if (this._isProcessingEffect) return;
260
+ if (this.externalError()) this._color.set(Colors.warn);
261
+ });
262
+ effect(() => {
263
+ if (this._isProcessingEffect) return;
264
+ this.enableLengthRule();
265
+ this.enableLowerCaseLetterRule();
266
+ this.enableUpperCaseLetterRule();
267
+ this.enableDigitRule();
268
+ this.enableSpecialCharRule();
269
+ this.min();
270
+ this.max();
271
+ this.customValidator();
272
+ untracked(() => {
273
+ this.setRulesAndValidators();
274
+ const pwd = this.password();
275
+ if (pwd && pwd.length > 0) this.calculatePasswordStrength(false);
276
+ });
277
+ });
278
+ }
279
+ parseCustomValidatorsRegex() {
280
+ const validator = this.customValidator();
281
+ if (validator instanceof RegExp) return validator;
282
+ else return RegExp(validator);
283
+ }
284
+ setRulesAndValidators() {
285
+ this.validatorsArray.set([]);
286
+ this.criteriaMap.set(/* @__PURE__ */ new Map());
287
+ this.passwordConfirmationFormControl.setValidators(Validators.compose([Validators.required, this.cmatPasswordStrengthValidator.confirm(this.password())]));
288
+ const validators = [Validators.required];
289
+ if (this.enableLengthRule()) {
290
+ this.criteriaMap().set(Criteria.at_least_eight_chars, RegExp(`^.{${this.min()},${this.max()}}$`));
291
+ validators.push(Validators.minLength(this.min()));
292
+ validators.push(Validators.maxLength(this.max()));
293
+ }
294
+ if (this.enableLowerCaseLetterRule()) {
295
+ this.criteriaMap().set(Criteria.at_least_one_lower_case_char, RegExpValidator.lowerCase);
296
+ validators.push(Validators.pattern(RegExpValidator.lowerCase));
297
+ }
298
+ if (this.enableUpperCaseLetterRule()) {
299
+ this.criteriaMap().set(Criteria.at_least_one_upper_case_char, RegExpValidator.upperCase);
300
+ validators.push(Validators.pattern(RegExpValidator.upperCase));
301
+ }
302
+ if (this.enableDigitRule()) {
303
+ this.criteriaMap().set(Criteria.at_least_one_digit_char, RegExpValidator.digit);
304
+ validators.push(Validators.pattern(RegExpValidator.digit));
305
+ }
306
+ if (this.enableSpecialCharRule()) {
307
+ this.criteriaMap().set(Criteria.at_least_one_special_char, RegExpValidator.specialChar);
308
+ validators.push(Validators.pattern(RegExpValidator.specialChar));
309
+ }
310
+ if (this.customValidator()) {
311
+ this.criteriaMap().set(Criteria.at_custom_chars, this.parseCustomValidatorsRegex());
312
+ validators.push(Validators.pattern(this.parseCustomValidatorsRegex()));
313
+ }
314
+ this.criteriaMap().forEach((value, key) => {
315
+ validators.push(this.cmatPasswordStrengthValidator.validate(key, value));
316
+ });
317
+ this.passwordFormControl.setValidators(Validators.compose([...validators]));
318
+ this.validatorsArray.set(validators);
319
+ this.validators.set(Validators.compose([...validators]));
320
+ }
321
+ calculatePasswordStrength(rebuildValidators = false) {
322
+ try {
323
+ this._isProcessingEffect = true;
324
+ if (rebuildValidators) this.setRulesAndValidators();
325
+ const requirements = [];
326
+ const unit = 100 / this.criteriaMap().size;
327
+ requirements.push(this.enableLengthRule() ? this._containAtLeastMinChars() : false, this.enableLowerCaseLetterRule() ? this._containAtLeastOneLowerCaseLetter() : false, this.enableUpperCaseLetterRule() ? this._containAtLeastOneUpperCaseLetter() : false, this.enableDigitRule() ? this._containAtLeastOneDigit() : false, this.enableSpecialCharRule() ? this._containAtLeastOneSpecialChar() : false, this.customValidator() ? this._containCustomChars() : false);
328
+ this._strength.set(requirements.filter((v) => v).length * unit);
329
+ this.strengthChanged.emit(this.strength());
330
+ const currentStrength = this._strength();
331
+ if (currentStrength < this.warnThreshold()) this._color.set(Colors.warn);
332
+ else if (currentStrength < this.accentThreshold()) this._color.set(Colors.accent);
333
+ else this._color.set(Colors.primary);
334
+ } finally {
335
+ this._isProcessingEffect = false;
336
+ }
337
+ }
338
+ reset() {
339
+ try {
340
+ this._isProcessingEffect = true;
341
+ this._strength.set(0);
342
+ this.containAtLeastMinChars.set(false);
343
+ this.containAtLeastOneLowerCaseLetter.set(false);
344
+ this.containAtLeastOneUpperCaseLetter.set(false);
345
+ this.containAtLeastOneDigit.set(false);
346
+ this.containAtCustomChars.set(false);
347
+ this.containAtLeastOneSpecialChar.set(false);
348
+ this._color.set(Colors.warn);
349
+ this.strengthChanged.emit(this.strength());
350
+ } finally {
351
+ this._isProcessingEffect = false;
352
+ }
353
+ }
354
+ _containAtLeastMinChars() {
355
+ const result = this.password().length >= this.min();
356
+ this.containAtLeastMinChars.set(result);
357
+ return result;
358
+ }
359
+ _containAtLeastOneLowerCaseLetter() {
360
+ const result = this.criteriaMap().get(Criteria.at_least_one_lower_case_char)?.test(this.password());
361
+ this.containAtLeastOneLowerCaseLetter.set(result);
362
+ return result ?? false;
363
+ }
364
+ _containAtLeastOneUpperCaseLetter() {
365
+ const result = this.criteriaMap().get(Criteria.at_least_one_upper_case_char)?.test(this.password());
366
+ this.containAtLeastOneUpperCaseLetter.set(result);
367
+ return result ?? false;
368
+ }
369
+ _containAtLeastOneDigit() {
370
+ const result = this.criteriaMap().get(Criteria.at_least_one_digit_char)?.test(this.password());
371
+ this.containAtLeastOneDigit.set(result);
372
+ return result ?? false;
373
+ }
374
+ _containAtLeastOneSpecialChar() {
375
+ const result = this.criteriaMap().get(Criteria.at_least_one_special_char)?.test(this.password());
376
+ this.containAtLeastOneSpecialChar.set(result);
377
+ return result ?? false;
378
+ }
379
+ _containCustomChars() {
380
+ const result = this.criteriaMap().get(Criteria.at_custom_chars)?.test(this.password());
381
+ this.containAtCustomChars.set(result);
382
+ return result ?? false;
383
+ }
384
+ _checkPassword() {
385
+ this.calculatePasswordStrength();
386
+ this.passwordConfirmationFormControl.updateValueAndValidity();
387
+ }
388
+ static {
389
+ this.ɵfac = i0.ɵɵngDeclareFactory({
390
+ minVersion: "12.0.0",
391
+ version: "22.2.3",
392
+ ngImport: i0,
393
+ type: CmatPasswordStrengthComponent,
394
+ deps: [],
395
+ target: i0.ɵɵFactoryTarget.Component
396
+ });
397
+ }
398
+ static {
399
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
400
+ minVersion: "17.1.0",
401
+ version: "22.2.3",
402
+ type: CmatPasswordStrengthComponent,
403
+ isStandalone: true,
404
+ selector: "cmat-password-strength",
405
+ inputs: {
406
+ password: {
407
+ classPropertyName: "password",
408
+ publicName: "password",
409
+ isSignal: true,
410
+ isRequired: false,
411
+ transformFunction: null
412
+ },
413
+ externalError: {
414
+ classPropertyName: "externalError",
415
+ publicName: "externalError",
416
+ isSignal: true,
417
+ isRequired: false,
418
+ transformFunction: null
419
+ },
420
+ enableLengthRule: {
421
+ classPropertyName: "enableLengthRule",
422
+ publicName: "enableLengthRule",
423
+ isSignal: true,
424
+ isRequired: false,
425
+ transformFunction: null
426
+ },
427
+ enableLowerCaseLetterRule: {
428
+ classPropertyName: "enableLowerCaseLetterRule",
429
+ publicName: "enableLowerCaseLetterRule",
430
+ isSignal: true,
431
+ isRequired: false,
432
+ transformFunction: null
433
+ },
434
+ enableUpperCaseLetterRule: {
435
+ classPropertyName: "enableUpperCaseLetterRule",
436
+ publicName: "enableUpperCaseLetterRule",
437
+ isSignal: true,
438
+ isRequired: false,
439
+ transformFunction: null
440
+ },
441
+ enableDigitRule: {
442
+ classPropertyName: "enableDigitRule",
443
+ publicName: "enableDigitRule",
444
+ isSignal: true,
445
+ isRequired: false,
446
+ transformFunction: null
447
+ },
448
+ enableSpecialCharRule: {
449
+ classPropertyName: "enableSpecialCharRule",
450
+ publicName: "enableSpecialCharRule",
451
+ isSignal: true,
452
+ isRequired: false,
453
+ transformFunction: null
454
+ },
455
+ min: {
456
+ classPropertyName: "min",
457
+ publicName: "min",
458
+ isSignal: true,
459
+ isRequired: false,
460
+ transformFunction: null
461
+ },
462
+ max: {
463
+ classPropertyName: "max",
464
+ publicName: "max",
465
+ isSignal: true,
466
+ isRequired: false,
467
+ transformFunction: null
468
+ },
469
+ customValidator: {
470
+ classPropertyName: "customValidator",
471
+ publicName: "customValidator",
472
+ isSignal: true,
473
+ isRequired: false,
474
+ transformFunction: null
475
+ },
476
+ warnThreshold: {
477
+ classPropertyName: "warnThreshold",
478
+ publicName: "warnThreshold",
479
+ isSignal: true,
480
+ isRequired: false,
481
+ transformFunction: null
482
+ },
483
+ accentThreshold: {
484
+ classPropertyName: "accentThreshold",
485
+ publicName: "accentThreshold",
486
+ isSignal: true,
487
+ isRequired: false,
488
+ transformFunction: null
489
+ }
490
+ },
491
+ outputs: { strengthChanged: "strengthChanged" },
492
+ exportAs: ["cmatPasswordStrength"],
493
+ ngImport: i0,
494
+ template: "<mat-progress-bar mode=\"determinate\" [color]=\"color()\" [value]=\"strength()\"></mat-progress-bar>",
495
+ dependencies: [{
496
+ kind: "ngmodule",
497
+ type: MatProgressBarModule
498
+ }, {
499
+ kind: "component",
500
+ type: i1$1.MatProgressBar,
501
+ selector: "mat-progress-bar",
502
+ inputs: [
503
+ "color",
504
+ "value",
505
+ "bufferValue",
506
+ "mode"
507
+ ],
508
+ outputs: ["animationEnd"],
509
+ exportAs: ["matProgressBar"]
510
+ }],
511
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
512
+ encapsulation: i0.ViewEncapsulation.None
513
+ });
514
+ }
515
+ };
516
+ i0.ɵɵngDeclareClassMetadata({
517
+ minVersion: "12.0.0",
518
+ version: "22.2.3",
519
+ ngImport: i0,
520
+ type: CmatPasswordStrengthComponent,
521
+ decorators: [{
522
+ type: Component,
523
+ args: [{
524
+ selector: "cmat-password-strength",
525
+ exportAs: "cmatPasswordStrength",
526
+ encapsulation: ViewEncapsulation.None,
527
+ changeDetection: ChangeDetectionStrategy.OnPush,
528
+ imports: [MatProgressBarModule],
529
+ template: "<mat-progress-bar mode=\"determinate\" [color]=\"color()\" [value]=\"strength()\"></mat-progress-bar>"
530
+ }]
531
+ }],
532
+ ctorParameters: () => [],
533
+ propDecorators: {
534
+ password: [{
535
+ type: i0.Input,
536
+ args: [{
537
+ isSignal: true,
538
+ alias: "password",
539
+ required: false
540
+ }]
541
+ }],
542
+ externalError: [{
543
+ type: i0.Input,
544
+ args: [{
545
+ isSignal: true,
546
+ alias: "externalError",
547
+ required: false
548
+ }]
549
+ }],
550
+ enableLengthRule: [{
551
+ type: i0.Input,
552
+ args: [{
553
+ isSignal: true,
554
+ alias: "enableLengthRule",
555
+ required: false
556
+ }]
557
+ }],
558
+ enableLowerCaseLetterRule: [{
559
+ type: i0.Input,
560
+ args: [{
561
+ isSignal: true,
562
+ alias: "enableLowerCaseLetterRule",
563
+ required: false
564
+ }]
565
+ }],
566
+ enableUpperCaseLetterRule: [{
567
+ type: i0.Input,
568
+ args: [{
569
+ isSignal: true,
570
+ alias: "enableUpperCaseLetterRule",
571
+ required: false
572
+ }]
573
+ }],
574
+ enableDigitRule: [{
575
+ type: i0.Input,
576
+ args: [{
577
+ isSignal: true,
578
+ alias: "enableDigitRule",
579
+ required: false
580
+ }]
581
+ }],
582
+ enableSpecialCharRule: [{
583
+ type: i0.Input,
584
+ args: [{
585
+ isSignal: true,
586
+ alias: "enableSpecialCharRule",
587
+ required: false
588
+ }]
589
+ }],
590
+ min: [{
591
+ type: i0.Input,
592
+ args: [{
593
+ isSignal: true,
594
+ alias: "min",
595
+ required: false
596
+ }]
597
+ }],
598
+ max: [{
599
+ type: i0.Input,
600
+ args: [{
601
+ isSignal: true,
602
+ alias: "max",
603
+ required: false
604
+ }]
605
+ }],
606
+ customValidator: [{
607
+ type: i0.Input,
608
+ args: [{
609
+ isSignal: true,
610
+ alias: "customValidator",
611
+ required: false
612
+ }]
613
+ }],
614
+ warnThreshold: [{
615
+ type: i0.Input,
616
+ args: [{
617
+ isSignal: true,
618
+ alias: "warnThreshold",
619
+ required: false
620
+ }]
621
+ }],
622
+ accentThreshold: [{
623
+ type: i0.Input,
624
+ args: [{
625
+ isSignal: true,
626
+ alias: "accentThreshold",
627
+ required: false
628
+ }]
629
+ }],
630
+ strengthChanged: [{
631
+ type: i0.Output,
632
+ args: ["strengthChanged"]
633
+ }]
634
+ }
635
+ });
636
+ var CmatPasswordStrengthInfoComponent = class CmatPasswordStrengthInfoComponent {
637
+ constructor() {
638
+ this.passwordComponent = input.required(...ngDevMode ? [{ debugName: "passwordComponent" }] : /* istanbul ignore next */ []);
639
+ this.enableScoreInfo = input(false, ...ngDevMode ? [{ debugName: "enableScoreInfo" }] : /* istanbul ignore next */ []);
640
+ this.lowerCaseCriteriaMsg = input("包含至少一个小写字母", ...ngDevMode ? [{ debugName: "lowerCaseCriteriaMsg" }] : /* istanbul ignore next */ []);
641
+ this.upperCaseCriteriaMsg = input("包含至少一个大写字母", ...ngDevMode ? [{ debugName: "upperCaseCriteriaMsg" }] : /* istanbul ignore next */ []);
642
+ this.digitsCriteriaMsg = input("包含至少一个数字", ...ngDevMode ? [{ debugName: "digitsCriteriaMsg" }] : /* istanbul ignore next */ []);
643
+ this.specialCharsCriteriaMsg = input("包含至少一个特殊字符", ...ngDevMode ? [{ debugName: "specialCharsCriteriaMsg" }] : /* istanbul ignore next */ []);
644
+ this.customCharsCriteriaMsg = input("包含至少一个传统字符", ...ngDevMode ? [{ debugName: "customCharsCriteriaMsg" }] : /* istanbul ignore next */ []);
645
+ this.minCharsCriteriaMsg = input(...ngDevMode ? [void 0, { debugName: "minCharsCriteriaMsg" }] : /* istanbul ignore next */ []);
646
+ this.pageLoaded = signal(false, ...ngDevMode ? [{ debugName: "pageLoaded" }] : /* istanbul ignore next */ []);
647
+ setTimeout(() => {
648
+ this.pageLoaded.set(true);
649
+ }, 100);
650
+ }
651
+ getMinCharsMsg() {
652
+ return this.minCharsCriteriaMsg() ?? `包含至少 ${this.passwordComponent().min()} 个字符`;
653
+ }
654
+ getEnterIndex(itemType) {
655
+ const enabledItems = [];
656
+ if (this.passwordComponent().enableLowerCaseLetterRule()) enabledItems.push("lowerCase");
657
+ if (this.passwordComponent().enableUpperCaseLetterRule()) enabledItems.push("upperCase");
658
+ if (this.passwordComponent().enableDigitRule()) enabledItems.push("digit");
659
+ if (this.passwordComponent().enableSpecialCharRule()) enabledItems.push("specialChar");
660
+ if (this.passwordComponent().enableLengthRule()) enabledItems.push("length");
661
+ if (this.passwordComponent().customValidator()) enabledItems.push("custom");
662
+ if (this.enableScoreInfo()) enabledItems.push("score");
663
+ return enabledItems.findIndex((i) => i === itemType);
664
+ }
665
+ getLeaveIndex(itemType) {
666
+ const enabledItems = [];
667
+ if (this.passwordComponent().enableLowerCaseLetterRule()) enabledItems.push("lowerCase");
668
+ if (this.passwordComponent().enableUpperCaseLetterRule()) enabledItems.push("upperCase");
669
+ if (this.passwordComponent().enableDigitRule()) enabledItems.push("digit");
670
+ if (this.passwordComponent().enableSpecialCharRule()) enabledItems.push("specialChar");
671
+ if (this.passwordComponent().enableLengthRule()) enabledItems.push("length");
672
+ if (this.passwordComponent().customValidator()) enabledItems.push("custom");
673
+ if (this.enableScoreInfo()) enabledItems.push("score");
674
+ return enabledItems.length - enabledItems.findIndex((j) => j === itemType) - 1;
675
+ }
676
+ static {
677
+ this.ɵfac = i0.ɵɵngDeclareFactory({
678
+ minVersion: "12.0.0",
679
+ version: "22.2.3",
680
+ ngImport: i0,
681
+ type: CmatPasswordStrengthInfoComponent,
682
+ deps: [],
683
+ target: i0.ɵɵFactoryTarget.Component
684
+ });
685
+ }
686
+ static {
687
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
688
+ minVersion: "17.0.0",
689
+ version: "22.2.3",
690
+ type: CmatPasswordStrengthInfoComponent,
691
+ isStandalone: true,
692
+ selector: "cmat-password-strength-info",
693
+ inputs: {
694
+ passwordComponent: {
695
+ classPropertyName: "passwordComponent",
696
+ publicName: "passwordComponent",
697
+ isSignal: true,
698
+ isRequired: true,
699
+ transformFunction: null
700
+ },
701
+ enableScoreInfo: {
702
+ classPropertyName: "enableScoreInfo",
703
+ publicName: "enableScoreInfo",
704
+ isSignal: true,
705
+ isRequired: false,
706
+ transformFunction: null
707
+ },
708
+ lowerCaseCriteriaMsg: {
709
+ classPropertyName: "lowerCaseCriteriaMsg",
710
+ publicName: "lowerCaseCriteriaMsg",
711
+ isSignal: true,
712
+ isRequired: false,
713
+ transformFunction: null
714
+ },
715
+ upperCaseCriteriaMsg: {
716
+ classPropertyName: "upperCaseCriteriaMsg",
717
+ publicName: "upperCaseCriteriaMsg",
718
+ isSignal: true,
719
+ isRequired: false,
720
+ transformFunction: null
721
+ },
722
+ digitsCriteriaMsg: {
723
+ classPropertyName: "digitsCriteriaMsg",
724
+ publicName: "digitsCriteriaMsg",
725
+ isSignal: true,
726
+ isRequired: false,
727
+ transformFunction: null
728
+ },
729
+ specialCharsCriteriaMsg: {
730
+ classPropertyName: "specialCharsCriteriaMsg",
731
+ publicName: "specialCharsCriteriaMsg",
732
+ isSignal: true,
733
+ isRequired: false,
734
+ transformFunction: null
735
+ },
736
+ customCharsCriteriaMsg: {
737
+ classPropertyName: "customCharsCriteriaMsg",
738
+ publicName: "customCharsCriteriaMsg",
739
+ isSignal: true,
740
+ isRequired: false,
741
+ transformFunction: null
742
+ },
743
+ minCharsCriteriaMsg: {
744
+ classPropertyName: "minCharsCriteriaMsg",
745
+ publicName: "minCharsCriteriaMsg",
746
+ isSignal: true,
747
+ isRequired: false,
748
+ transformFunction: null
749
+ }
750
+ },
751
+ exportAs: ["cmatPasswordStrengthInfo"],
752
+ ngImport: i0,
753
+ template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n<mat-card class=\"info-card\">\r\n <mat-card-content>\r\n @if (passwordComponent().enableLowerCaseLetterRule()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('lowerCase')\" [style.--leave-item-index]=\"getLeaveIndex('lowerCase')\">\r\n @if (passwordComponent().containAtLeastOneLowerCaseLetter()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{lowerCaseCriteriaMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (passwordComponent().enableUpperCaseLetterRule()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('upperCase')\" [style.--leave-item-index]=\"getLeaveIndex('upperCase')\">\r\n @if (passwordComponent().containAtLeastOneUpperCaseLetter()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{upperCaseCriteriaMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (passwordComponent().enableDigitRule()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('digit')\" [style.--leave-item-index]=\"getLeaveIndex('digit')\">\r\n @if (passwordComponent().containAtLeastOneDigit()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{digitsCriteriaMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (passwordComponent().enableSpecialCharRule()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('specialChar')\"\r\n [style.--leave-item-index]=\"getLeaveIndex('specialChar')\">\r\n @if (passwordComponent().containAtLeastOneSpecialChar()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{specialCharsCriteriaMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (passwordComponent().enableLengthRule()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('length')\" [style.--leave-item-index]=\"getLeaveIndex('length')\">\r\n @if (passwordComponent().containAtLeastMinChars()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{getMinCharsMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (passwordComponent().customValidator()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('custom')\" [style.--leave-item-index]=\"getLeaveIndex('custom')\">\r\n @if (passwordComponent().containAtCustomChars()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{customCharsCriteriaMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (enableScoreInfo()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('score')\" [style.--leave-item-index]=\"getLeaveIndex('score')\">\r\n @if (passwordComponent().strength() === 100) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>密码强度= {{passwordComponent().strength()}} %100</span>\r\n </div>\r\n }\r\n\r\n </mat-card-content>\r\n<!-- eslint-enable @angular-eslint/template/no-inline-styles -->\r\n</mat-card>\r\n",
754
+ styles: ["cmat-password-strength-info{margin-top:20px}cmat-password-strength-info .mat-mdc-card{display:flex;flex-direction:row;flex:1 1 0%;margin:.5rem;box-sizing:border-box;place-content:stretch;align-items:stretch}cmat-password-strength-info .mat-mdc-card .mat-mdc-card-content{display:flex;flex-direction:column;box-sizing:border-box;max-width:100%;place-content:stretch;align-items:stretch}cmat-password-strength-info .mat-mdc-card .mat-mdc-card-content .mat-icon{margin-right:1rem}cmat-password-strength-info .mat-mdc-card .mat-mdc-card-content .info-row{display:flex;flex-direction:row;box-sizing:border-box;align-items:center}cmat-password-strength-info .info-card .info-row.info-row-enter{transition-property:opacity,transform;transition-delay:calc(.3s * var(--enter-item-index, 0));transition-duration:1s;transition-timing-function:cubic-bezier(.8,-.6,.2,1.5)}@starting-style{cmat-password-strength-info .info-card .info-row.info-row-enter{transform:scale(.5);opacity:0}}cmat-password-strength-info .info-card .info-row.info-row-leave{transition-property:opacity,transform,height;transition-delay:calc(.3s * var(--leave-item-index, 0));transition-duration:1s;transition-timing-function:cubic-bezier(.8,-.6,.2,1.5);opacity:0;transform:scale(.5);height:0;margin:0}@starting-style{cmat-password-strength-info .info-card .info-row.info-row-leave{transform:scale(1);opacity:1;height:inherit}}cmat-password-strength-info .shake-info-animation{animation:shake 1s}cmat-password-strength-info .flip-in-x-animation{backface-visibility:visible;animation:flipInX 1s ease-in}cmat-password-strength-info .flip-in-y-animation{backface-visibility:visible;animation:flipInY 1s ease-in}@keyframes shake{0%{transform:translateZ(0)}10%{transform:translate3d(-10px,0,0)}20%{transform:translate3d(10px,0,0)}30%{transform:translate3d(-10px,0,0)}40%{transform:translate3d(10px,0,0)}50%{transform:translate3d(-10px,0,0)}60%{transform:translate3d(10px,0,0)}70%{transform:translate3d(-10px,0,0)}80%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-10px,0,0)}to{transform:translateZ(0)}}@keyframes flipInX{0%{opacity:0;transform:perspective(400px) rotateX(90deg)}40%{opacity:1;transform:perspective(400px) rotateX(-20deg)}60%{transform:perspective(400px) rotateX(10deg)}80%{transform:perspective(400px) rotateX(-5deg)}to{opacity:1;transform:perspective(400px) rotate3d(0,0,0,0)}}@keyframes flipInY{0%{opacity:0;transform:perspective(400px) rotateY(90deg)}40%{opacity:1;transform:perspective(400px) rotateY(-20deg)}60%{transform:perspective(400px) rotateY(10deg)}80%{transform:perspective(400px) rotateY(-5deg)}to{opacity:1;transform:perspective(400px) rotate3d(0,0,0,0)}}\n"],
755
+ dependencies: [
756
+ {
757
+ kind: "ngmodule",
758
+ type: MatCardModule
759
+ },
760
+ {
761
+ kind: "component",
762
+ type: i1.MatCard,
763
+ selector: "mat-card",
764
+ inputs: ["appearance"],
765
+ exportAs: ["matCard"]
766
+ },
767
+ {
768
+ kind: "directive",
769
+ type: i1.MatCardContent,
770
+ selector: "mat-card-content"
771
+ },
772
+ {
773
+ kind: "ngmodule",
774
+ type: MatIconModule
775
+ },
776
+ {
777
+ kind: "component",
778
+ type: i3.MatIcon,
779
+ selector: "mat-icon",
780
+ inputs: [
781
+ "color",
782
+ "inline",
783
+ "svgIcon",
784
+ "fontSet",
785
+ "fontIcon"
786
+ ],
787
+ exportAs: ["matIcon"]
788
+ }
789
+ ],
790
+ encapsulation: i0.ViewEncapsulation.None
791
+ });
792
+ }
793
+ };
794
+ i0.ɵɵngDeclareClassMetadata({
795
+ minVersion: "12.0.0",
796
+ version: "22.2.3",
797
+ ngImport: i0,
798
+ type: CmatPasswordStrengthInfoComponent,
799
+ decorators: [{
800
+ type: Component,
801
+ args: [{
802
+ selector: "cmat-password-strength-info",
803
+ exportAs: "cmatPasswordStrengthInfo",
804
+ encapsulation: ViewEncapsulation.None,
805
+ imports: [MatCardModule, MatIconModule],
806
+ template: "<!-- eslint-disable @angular-eslint/template/no-inline-styles -->\r\n<mat-card class=\"info-card\">\r\n <mat-card-content>\r\n @if (passwordComponent().enableLowerCaseLetterRule()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('lowerCase')\" [style.--leave-item-index]=\"getLeaveIndex('lowerCase')\">\r\n @if (passwordComponent().containAtLeastOneLowerCaseLetter()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{lowerCaseCriteriaMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (passwordComponent().enableUpperCaseLetterRule()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('upperCase')\" [style.--leave-item-index]=\"getLeaveIndex('upperCase')\">\r\n @if (passwordComponent().containAtLeastOneUpperCaseLetter()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{upperCaseCriteriaMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (passwordComponent().enableDigitRule()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('digit')\" [style.--leave-item-index]=\"getLeaveIndex('digit')\">\r\n @if (passwordComponent().containAtLeastOneDigit()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{digitsCriteriaMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (passwordComponent().enableSpecialCharRule()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('specialChar')\"\r\n [style.--leave-item-index]=\"getLeaveIndex('specialChar')\">\r\n @if (passwordComponent().containAtLeastOneSpecialChar()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{specialCharsCriteriaMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (passwordComponent().enableLengthRule()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('length')\" [style.--leave-item-index]=\"getLeaveIndex('length')\">\r\n @if (passwordComponent().containAtLeastMinChars()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{getMinCharsMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (passwordComponent().customValidator()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('custom')\" [style.--leave-item-index]=\"getLeaveIndex('custom')\">\r\n @if (passwordComponent().containAtCustomChars()) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>{{customCharsCriteriaMsg()}}</span>\r\n </div>\r\n }\r\n\r\n @if (enableScoreInfo()) {\r\n <div class=\"info-row info-row-enter\" animate.leave=\"info-row-leave\"\r\n [style.--enter-item-index]=\"getEnterIndex('score')\" [style.--leave-item-index]=\"getLeaveIndex('score')\">\r\n @if (passwordComponent().strength() === 100) {\r\n <mat-icon animate.enter=\"flip-in-x-animation\" color=\"primary\" svgIcon=\"mat_outline:done\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n } @else {\r\n <mat-icon animate.enter=\"shake-info-animation\" color=\"warn\" svgIcon=\"mat_outline:error\" [class.animate-none]=\"!pageLoaded()\"></mat-icon>\r\n }\r\n <span>密码强度= {{passwordComponent().strength()}} %100</span>\r\n </div>\r\n }\r\n\r\n </mat-card-content>\r\n<!-- eslint-enable @angular-eslint/template/no-inline-styles -->\r\n</mat-card>\r\n",
807
+ styles: ["cmat-password-strength-info{margin-top:20px}cmat-password-strength-info .mat-mdc-card{display:flex;flex-direction:row;flex:1 1 0%;margin:.5rem;box-sizing:border-box;place-content:stretch;align-items:stretch}cmat-password-strength-info .mat-mdc-card .mat-mdc-card-content{display:flex;flex-direction:column;box-sizing:border-box;max-width:100%;place-content:stretch;align-items:stretch}cmat-password-strength-info .mat-mdc-card .mat-mdc-card-content .mat-icon{margin-right:1rem}cmat-password-strength-info .mat-mdc-card .mat-mdc-card-content .info-row{display:flex;flex-direction:row;box-sizing:border-box;align-items:center}cmat-password-strength-info .info-card .info-row.info-row-enter{transition-property:opacity,transform;transition-delay:calc(.3s * var(--enter-item-index, 0));transition-duration:1s;transition-timing-function:cubic-bezier(.8,-.6,.2,1.5)}@starting-style{cmat-password-strength-info .info-card .info-row.info-row-enter{transform:scale(.5);opacity:0}}cmat-password-strength-info .info-card .info-row.info-row-leave{transition-property:opacity,transform,height;transition-delay:calc(.3s * var(--leave-item-index, 0));transition-duration:1s;transition-timing-function:cubic-bezier(.8,-.6,.2,1.5);opacity:0;transform:scale(.5);height:0;margin:0}@starting-style{cmat-password-strength-info .info-card .info-row.info-row-leave{transform:scale(1);opacity:1;height:inherit}}cmat-password-strength-info .shake-info-animation{animation:shake 1s}cmat-password-strength-info .flip-in-x-animation{backface-visibility:visible;animation:flipInX 1s ease-in}cmat-password-strength-info .flip-in-y-animation{backface-visibility:visible;animation:flipInY 1s ease-in}@keyframes shake{0%{transform:translateZ(0)}10%{transform:translate3d(-10px,0,0)}20%{transform:translate3d(10px,0,0)}30%{transform:translate3d(-10px,0,0)}40%{transform:translate3d(10px,0,0)}50%{transform:translate3d(-10px,0,0)}60%{transform:translate3d(10px,0,0)}70%{transform:translate3d(-10px,0,0)}80%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-10px,0,0)}to{transform:translateZ(0)}}@keyframes flipInX{0%{opacity:0;transform:perspective(400px) rotateX(90deg)}40%{opacity:1;transform:perspective(400px) rotateX(-20deg)}60%{transform:perspective(400px) rotateX(10deg)}80%{transform:perspective(400px) rotateX(-5deg)}to{opacity:1;transform:perspective(400px) rotate3d(0,0,0,0)}}@keyframes flipInY{0%{opacity:0;transform:perspective(400px) rotateY(90deg)}40%{opacity:1;transform:perspective(400px) rotateY(-20deg)}60%{transform:perspective(400px) rotateY(10deg)}80%{transform:perspective(400px) rotateY(-5deg)}to{opacity:1;transform:perspective(400px) rotate3d(0,0,0,0)}}\n"]
808
+ }]
809
+ }],
810
+ ctorParameters: () => [],
811
+ propDecorators: {
812
+ passwordComponent: [{
813
+ type: i0.Input,
814
+ args: [{
815
+ isSignal: true,
816
+ alias: "passwordComponent",
817
+ required: true
818
+ }]
819
+ }],
820
+ enableScoreInfo: [{
821
+ type: i0.Input,
822
+ args: [{
823
+ isSignal: true,
824
+ alias: "enableScoreInfo",
825
+ required: false
826
+ }]
827
+ }],
828
+ lowerCaseCriteriaMsg: [{
829
+ type: i0.Input,
830
+ args: [{
831
+ isSignal: true,
832
+ alias: "lowerCaseCriteriaMsg",
833
+ required: false
834
+ }]
835
+ }],
836
+ upperCaseCriteriaMsg: [{
837
+ type: i0.Input,
838
+ args: [{
839
+ isSignal: true,
840
+ alias: "upperCaseCriteriaMsg",
841
+ required: false
842
+ }]
843
+ }],
844
+ digitsCriteriaMsg: [{
845
+ type: i0.Input,
846
+ args: [{
847
+ isSignal: true,
848
+ alias: "digitsCriteriaMsg",
849
+ required: false
850
+ }]
851
+ }],
852
+ specialCharsCriteriaMsg: [{
853
+ type: i0.Input,
854
+ args: [{
855
+ isSignal: true,
856
+ alias: "specialCharsCriteriaMsg",
857
+ required: false
858
+ }]
859
+ }],
860
+ customCharsCriteriaMsg: [{
861
+ type: i0.Input,
862
+ args: [{
863
+ isSignal: true,
864
+ alias: "customCharsCriteriaMsg",
865
+ required: false
866
+ }]
867
+ }],
868
+ minCharsCriteriaMsg: [{
869
+ type: i0.Input,
870
+ args: [{
871
+ isSignal: true,
872
+ alias: "minCharsCriteriaMsg",
873
+ required: false
874
+ }]
875
+ }]
876
+ }
877
+ });
440
878
  export { CmatPassToggleVisibilityComponent, CmatPasswordStrengthComponent, CmatPasswordStrengthInfoComponent };
441
- //# sourceMappingURL=cmat-components-password-strength.mjs.map
879
+
880
+ //# sourceMappingURL=cmat-components-password-strength.mjs.map