@dugararchit/cdk 0.0.0-dugararchit

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 (206) hide show
  1. package/_index.scss +8 -0
  2. package/a11y/_index.import.scss +2 -0
  3. package/a11y/_index.scss +102 -0
  4. package/a11y/a11y-prebuilt.scss +3 -0
  5. package/fesm2022/stagefright5-cdk-a11y.mjs +2381 -0
  6. package/fesm2022/stagefright5-cdk-a11y.mjs.map +1 -0
  7. package/fesm2022/stagefright5-cdk-accordion.mjs +267 -0
  8. package/fesm2022/stagefright5-cdk-accordion.mjs.map +1 -0
  9. package/fesm2022/stagefright5-cdk-bidi.mjs +185 -0
  10. package/fesm2022/stagefright5-cdk-bidi.mjs.map +1 -0
  11. package/fesm2022/stagefright5-cdk-clipboard.mjs +250 -0
  12. package/fesm2022/stagefright5-cdk-clipboard.mjs.map +1 -0
  13. package/fesm2022/stagefright5-cdk-coercion.mjs +128 -0
  14. package/fesm2022/stagefright5-cdk-coercion.mjs.map +1 -0
  15. package/fesm2022/stagefright5-cdk-collections.mjs +472 -0
  16. package/fesm2022/stagefright5-cdk-collections.mjs.map +1 -0
  17. package/fesm2022/stagefright5-cdk-drag-drop.mjs +3690 -0
  18. package/fesm2022/stagefright5-cdk-drag-drop.mjs.map +1 -0
  19. package/fesm2022/stagefright5-cdk-keycodes.mjs +159 -0
  20. package/fesm2022/stagefright5-cdk-keycodes.mjs.map +1 -0
  21. package/fesm2022/stagefright5-cdk-layout.mjs +246 -0
  22. package/fesm2022/stagefright5-cdk-layout.mjs.map +1 -0
  23. package/fesm2022/stagefright5-cdk-observers.mjs +203 -0
  24. package/fesm2022/stagefright5-cdk-observers.mjs.map +1 -0
  25. package/fesm2022/stagefright5-cdk-overlay.mjs +3033 -0
  26. package/fesm2022/stagefright5-cdk-overlay.mjs.map +1 -0
  27. package/fesm2022/stagefright5-cdk-platform.mjs +375 -0
  28. package/fesm2022/stagefright5-cdk-platform.mjs.map +1 -0
  29. package/fesm2022/stagefright5-cdk-portal.mjs +672 -0
  30. package/fesm2022/stagefright5-cdk-portal.mjs.map +1 -0
  31. package/fesm2022/stagefright5-cdk-scrolling.mjs +1399 -0
  32. package/fesm2022/stagefright5-cdk-scrolling.mjs.map +1 -0
  33. package/fesm2022/stagefright5-cdk-stepper.mjs +624 -0
  34. package/fesm2022/stagefright5-cdk-stepper.mjs.map +1 -0
  35. package/fesm2022/stagefright5-cdk-table.mjs +2346 -0
  36. package/fesm2022/stagefright5-cdk-table.mjs.map +1 -0
  37. package/fesm2022/stagefright5-cdk-testing-protractor.mjs +324 -0
  38. package/fesm2022/stagefright5-cdk-testing-protractor.mjs.map +1 -0
  39. package/fesm2022/stagefright5-cdk-testing-selenium-webdriver.mjs +364 -0
  40. package/fesm2022/stagefright5-cdk-testing-selenium-webdriver.mjs.map +1 -0
  41. package/fesm2022/stagefright5-cdk-testing-testbed.mjs +806 -0
  42. package/fesm2022/stagefright5-cdk-testing-testbed.mjs.map +1 -0
  43. package/fesm2022/stagefright5-cdk-testing.mjs +740 -0
  44. package/fesm2022/stagefright5-cdk-testing.mjs.map +1 -0
  45. package/fesm2022/stagefright5-cdk-text-field.mjs +453 -0
  46. package/fesm2022/stagefright5-cdk-text-field.mjs.map +1 -0
  47. package/fesm2022/stagefright5-cdk-tree.mjs +945 -0
  48. package/fesm2022/stagefright5-cdk-tree.mjs.map +1 -0
  49. package/fesm2022/stagefright5-cdk.mjs +26 -0
  50. package/fesm2022/stagefright5-cdk.mjs.map +1 -0
  51. package/overlay/_index-deprecated.scss +13 -0
  52. package/overlay/_index.import.scss +13 -0
  53. package/overlay/_index.scss +148 -0
  54. package/overlay/overlay-prebuilt.scss +3 -0
  55. package/package.json +159 -0
  56. package/schematics/ng-update/test-cases/misc/global-stylesheets-test.scss +3 -0
  57. package/schematics/schematics/BUILD.bazel +104 -0
  58. package/schematics/schematics/README.md +4 -0
  59. package/schematics/schematics/collection.json +18 -0
  60. package/schematics/schematics/index.ts +22 -0
  61. package/schematics/schematics/migration.json +50 -0
  62. package/schematics/schematics/ng-add/index.spec.ts +50 -0
  63. package/schematics/schematics/ng-add/index.ts +39 -0
  64. package/schematics/schematics/ng-add/package-config.ts +62 -0
  65. package/schematics/schematics/ng-add/schema.json +16 -0
  66. package/schematics/schematics/ng-add/schema.ts +12 -0
  67. package/schematics/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template +53 -0
  68. package/schematics/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template +17 -0
  69. package/schematics/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template +29 -0
  70. package/schematics/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.ts.template +43 -0
  71. package/schematics/schematics/ng-generate/drag-drop/index.spec.ts +205 -0
  72. package/schematics/schematics/ng-generate/drag-drop/index.ts +35 -0
  73. package/schematics/schematics/ng-generate/drag-drop/schema.json +93 -0
  74. package/schematics/schematics/ng-generate/drag-drop/schema.ts +11 -0
  75. package/schematics/schematics/ng-update/data/attribute-selectors.ts +29 -0
  76. package/schematics/schematics/ng-update/data/class-names.ts +50 -0
  77. package/schematics/schematics/ng-update/data/constructor-checks.ts +75 -0
  78. package/schematics/schematics/ng-update/data/css-selectors.ts +33 -0
  79. package/schematics/schematics/ng-update/data/element-selectors.ts +21 -0
  80. package/schematics/schematics/ng-update/data/index.ts +18 -0
  81. package/schematics/schematics/ng-update/data/input-names.ts +118 -0
  82. package/schematics/schematics/ng-update/data/method-call-checks.ts +63 -0
  83. package/schematics/schematics/ng-update/data/output-names.ts +42 -0
  84. package/schematics/schematics/ng-update/data/property-names.ts +151 -0
  85. package/schematics/schematics/ng-update/data/symbol-removal.ts +22 -0
  86. package/schematics/schematics/ng-update/devkit-file-system.ts +87 -0
  87. package/schematics/schematics/ng-update/devkit-migration-rule.ts +185 -0
  88. package/schematics/schematics/ng-update/devkit-migration.ts +47 -0
  89. package/schematics/schematics/ng-update/find-stylesheets.ts +43 -0
  90. package/schematics/schematics/ng-update/html-parsing/angular.ts +49 -0
  91. package/schematics/schematics/ng-update/html-parsing/elements.ts +66 -0
  92. package/schematics/schematics/ng-update/index.ts +113 -0
  93. package/schematics/schematics/ng-update/migrations/attribute-selectors.ts +83 -0
  94. package/schematics/schematics/ng-update/migrations/class-inheritance.ts +63 -0
  95. package/schematics/schematics/ng-update/migrations/class-names.ts +107 -0
  96. package/schematics/schematics/ng-update/migrations/constructor-signature.ts +170 -0
  97. package/schematics/schematics/ng-update/migrations/css-selectors.ts +83 -0
  98. package/schematics/schematics/ng-update/migrations/element-selectors.ts +75 -0
  99. package/schematics/schematics/ng-update/migrations/input-names.ts +83 -0
  100. package/schematics/schematics/ng-update/migrations/method-call-arguments.ts +70 -0
  101. package/schematics/schematics/ng-update/migrations/misc-template.ts +36 -0
  102. package/schematics/schematics/ng-update/migrations/output-names.ts +61 -0
  103. package/schematics/schematics/ng-update/migrations/property-names.ts +61 -0
  104. package/schematics/schematics/ng-update/migrations/symbol-removal.ts +51 -0
  105. package/schematics/schematics/ng-update/migrations/tilde-import-v13/tilde-import-migration.ts +40 -0
  106. package/schematics/schematics/ng-update/public-api.ts +18 -0
  107. package/schematics/schematics/ng-update/test-cases/index.spec.ts +18 -0
  108. package/schematics/schematics/ng-update/test-cases/misc/external-resource-resolution.spec.ts +32 -0
  109. package/schematics/schematics/ng-update/test-cases/misc/external-resource-resolution_input.ts +22 -0
  110. package/schematics/schematics/ng-update/test-cases/misc/global-stylesheets-test.scss +3 -0
  111. package/schematics/schematics/ng-update/test-cases/misc/global-stylesheets.spec.ts +50 -0
  112. package/schematics/schematics/ng-update/test-cases/misc/global-stylesheets_input.ts +8 -0
  113. package/schematics/schematics/ng-update/test-cases/misc/method-call-checks.spec.ts +20 -0
  114. package/schematics/schematics/ng-update/test-cases/misc/method-call-checks_input.ts +18 -0
  115. package/schematics/schematics/ng-update/test-cases/misc/module-resolution.spec.ts +27 -0
  116. package/schematics/schematics/ng-update/test-cases/v13/misc/tilde-import-v13.spec.ts +149 -0
  117. package/schematics/schematics/ng-update/test-cases/v6/attribute-selectors_expected_output.ts +36 -0
  118. package/schematics/schematics/ng-update/test-cases/v6/attribute-selectors_input.ts +36 -0
  119. package/schematics/schematics/ng-update/test-cases/v6/class-names_expected_output.ts +8 -0
  120. package/schematics/schematics/ng-update/test-cases/v6/class-names_input.ts +8 -0
  121. package/schematics/schematics/ng-update/test-cases/v6/input-names_expected_output.ts +22 -0
  122. package/schematics/schematics/ng-update/test-cases/v6/input-names_input.ts +22 -0
  123. package/schematics/schematics/ng-update/test-cases/v6/property-names_expected_output.ts +64 -0
  124. package/schematics/schematics/ng-update/test-cases/v6/property-names_input.ts +64 -0
  125. package/schematics/schematics/ng-update/test-cases/v7/property-names_expected_output.ts +28 -0
  126. package/schematics/schematics/ng-update/test-cases/v7/property-names_input.ts +28 -0
  127. package/schematics/schematics/ng-update/typescript/base-types.ts +22 -0
  128. package/schematics/schematics/ng-update/typescript/imports.ts +54 -0
  129. package/schematics/schematics/ng-update/typescript/literal.ts +32 -0
  130. package/schematics/schematics/ng-update/typescript/module-specifiers.ts +39 -0
  131. package/schematics/schematics/ng-update/update-schematic.md +209 -0
  132. package/schematics/schematics/ng-update/upgrade-data.ts +79 -0
  133. package/schematics/schematics/paths.ts +15 -0
  134. package/schematics/schematics/testing/BUILD.bazel +27 -0
  135. package/schematics/schematics/testing/file-content.ts +20 -0
  136. package/schematics/schematics/testing/index.ts +14 -0
  137. package/schematics/schematics/testing/post-scheduled-tasks.ts +45 -0
  138. package/schematics/schematics/testing/resolve-bazel-path.ts +46 -0
  139. package/schematics/schematics/testing/test-app.ts +21 -0
  140. package/schematics/schematics/testing/test-case-setup.ts +236 -0
  141. package/schematics/schematics/testing/test-library.ts +21 -0
  142. package/schematics/schematics/testing/test-project.ts +40 -0
  143. package/schematics/schematics/testing/tsconfig.json +7 -0
  144. package/schematics/schematics/tsconfig.json +28 -0
  145. package/schematics/schematics/update-tool/BUILD.bazel +19 -0
  146. package/schematics/schematics/update-tool/component-resource-collector.ts +195 -0
  147. package/schematics/schematics/update-tool/file-system.ts +78 -0
  148. package/schematics/schematics/update-tool/index.ts +191 -0
  149. package/schematics/schematics/update-tool/logger.ts +23 -0
  150. package/schematics/schematics/update-tool/migration.ts +88 -0
  151. package/schematics/schematics/update-tool/public-api.ts +16 -0
  152. package/schematics/schematics/update-tool/target-version.ts +31 -0
  153. package/schematics/schematics/update-tool/tsconfig.json +7 -0
  154. package/schematics/schematics/update-tool/update-recorder.ts +14 -0
  155. package/schematics/schematics/update-tool/utils/decorators.ts +54 -0
  156. package/schematics/schematics/update-tool/utils/functions.ts +18 -0
  157. package/schematics/schematics/update-tool/utils/imports.ts +128 -0
  158. package/schematics/schematics/update-tool/utils/line-mappings.ts +84 -0
  159. package/schematics/schematics/update-tool/utils/parse-tsconfig.ts +25 -0
  160. package/schematics/schematics/update-tool/utils/property-name.ts +28 -0
  161. package/schematics/schematics/update-tool/utils/virtual-host.ts +116 -0
  162. package/schematics/schematics/update-tool/version-changes.ts +49 -0
  163. package/schematics/schematics/utils/ast/ng-module-imports.spec.ts +43 -0
  164. package/schematics/schematics/utils/ast/ng-module-imports.ts +102 -0
  165. package/schematics/schematics/utils/ast.ts +88 -0
  166. package/schematics/schematics/utils/build-component.ts +252 -0
  167. package/schematics/schematics/utils/get-project.ts +27 -0
  168. package/schematics/schematics/utils/html-manipulation.ts +105 -0
  169. package/schematics/schematics/utils/index.ts +19 -0
  170. package/schematics/schematics/utils/parse5-element.ts +34 -0
  171. package/schematics/schematics/utils/project-index-file.ts +21 -0
  172. package/schematics/schematics/utils/project-main-file.ts +26 -0
  173. package/schematics/schematics/utils/project-style-file.ts +53 -0
  174. package/schematics/schematics/utils/project-targets.ts +43 -0
  175. package/schematics/schematics/utils/project-tsconfig-paths.spec.ts +91 -0
  176. package/schematics/schematics/utils/project-tsconfig-paths.ts +49 -0
  177. package/schematics/schematics/utils/schematic-options.ts +65 -0
  178. package/schematics/schematics/utils/vendored-ast-utils/index.ts +599 -0
  179. package/scrolling/virtual-scroll-viewport.scss +87 -0
  180. package/table/table.scss +3 -0
  181. package/text-field/_index.import.scss +2 -0
  182. package/text-field/_index.scss +89 -0
  183. package/text-field/text-field-prebuilt.scss +4 -0
  184. package/types/stagefright5-cdk-a11y.d.ts +1160 -0
  185. package/types/stagefright5-cdk-accordion.d.ts +95 -0
  186. package/types/stagefright5-cdk-bidi.d.ts +95 -0
  187. package/types/stagefright5-cdk-clipboard.d.ts +116 -0
  188. package/types/stagefright5-cdk-coercion.d.ts +101 -0
  189. package/types/stagefright5-cdk-collections.d.ts +405 -0
  190. package/types/stagefright5-cdk-drag-drop.d.ts +1471 -0
  191. package/types/stagefright5-cdk-keycodes.d.ts +142 -0
  192. package/types/stagefright5-cdk-layout.d.ts +96 -0
  193. package/types/stagefright5-cdk-observers.d.ts +91 -0
  194. package/types/stagefright5-cdk-overlay.d.ts +1258 -0
  195. package/types/stagefright5-cdk-platform.d.ts +130 -0
  196. package/types/stagefright5-cdk-portal.d.ts +327 -0
  197. package/types/stagefright5-cdk-scrolling.d.ts +631 -0
  198. package/types/stagefright5-cdk-stepper.d.ts +302 -0
  199. package/types/stagefright5-cdk-table.d.ts +1128 -0
  200. package/types/stagefright5-cdk-testing-protractor.d.ts +146 -0
  201. package/types/stagefright5-cdk-testing-selenium-webdriver.d.ts +161 -0
  202. package/types/stagefright5-cdk-testing-testbed.d.ts +168 -0
  203. package/types/stagefright5-cdk-testing.d.ts +735 -0
  204. package/types/stagefright5-cdk-text-field.d.ts +171 -0
  205. package/types/stagefright5-cdk-tree.d.ts +522 -0
  206. package/types/stagefright5-cdk.d.ts +14 -0
@@ -0,0 +1,624 @@
1
+ import { FocusKeyManager } from '@dugararchit/cdk/a11y';
2
+ import { coerceBooleanProperty, coerceNumberProperty } from '@dugararchit/cdk/coercion';
3
+ import { hasModifierKey, SPACE, ENTER } from '@dugararchit/cdk/keycodes';
4
+ import { DOCUMENT } from '@angular/common';
5
+ import * as i0 from '@angular/core';
6
+ import { Directive, InjectionToken, EventEmitter, forwardRef, TemplateRef, Input, Output, ViewChild, ContentChild, Inject, Optional, ChangeDetectionStrategy, ViewEncapsulation, Component, QueryList, ContentChildren, NgModule } from '@angular/core';
7
+ import { _getFocusedElementPierceShadowDom } from '@dugararchit/cdk/platform';
8
+ import { Subject, of } from 'rxjs';
9
+ import { startWith, takeUntil } from 'rxjs/operators';
10
+ import * as i1 from '@dugararchit/cdk/bidi';
11
+ import { BidiModule } from '@dugararchit/cdk/bidi';
12
+
13
+ /**
14
+ * @license
15
+ * Copyright Google LLC All Rights Reserved.
16
+ *
17
+ * Use of this source code is governed by an MIT-style license that can be
18
+ * found in the LICENSE file at https://angular.io/license
19
+ */
20
+ class CdkStepHeader {
21
+ constructor(_elementRef) {
22
+ this._elementRef = _elementRef;
23
+ }
24
+ /** Focuses the step header. */
25
+ focus() {
26
+ this._elementRef.nativeElement.focus();
27
+ }
28
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: CdkStepHeader, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
29
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.11", type: CdkStepHeader, isStandalone: false, selector: "[cdkStepHeader]", host: { attributes: { "role": "tab" } }, ngImport: i0 }); }
30
+ }
31
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: CdkStepHeader, decorators: [{
32
+ type: Directive,
33
+ args: [{
34
+ standalone: false,
35
+ selector: '[cdkStepHeader]',
36
+ host: {
37
+ 'role': 'tab',
38
+ },
39
+ }]
40
+ }], ctorParameters: () => [{ type: i0.ElementRef }] });
41
+
42
+ /**
43
+ * @license
44
+ * Copyright Google LLC All Rights Reserved.
45
+ *
46
+ * Use of this source code is governed by an MIT-style license that can be
47
+ * found in the LICENSE file at https://angular.io/license
48
+ */
49
+ class CdkStepLabel {
50
+ constructor(/** @docs-private */ template) {
51
+ this.template = template;
52
+ }
53
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: CdkStepLabel, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }
54
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.11", type: CdkStepLabel, isStandalone: false, selector: "[cdkStepLabel]", ngImport: i0 }); }
55
+ }
56
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: CdkStepLabel, decorators: [{
57
+ type: Directive,
58
+ args: [{
59
+ standalone: false,
60
+ selector: '[cdkStepLabel]',
61
+ }]
62
+ }], ctorParameters: () => [{ type: i0.TemplateRef }] });
63
+
64
+ /**
65
+ * @license
66
+ * Copyright Google LLC All Rights Reserved.
67
+ *
68
+ * Use of this source code is governed by an MIT-style license that can be
69
+ * found in the LICENSE file at https://angular.io/license
70
+ */
71
+ /** Used to generate unique ID for each stepper component. */
72
+ let nextId = 0;
73
+ /** Change event emitted on selection changes. */
74
+ class StepperSelectionEvent {
75
+ }
76
+ /** Enum to represent the different states of the steps. */
77
+ const STEP_STATE = {
78
+ NUMBER: 'number',
79
+ EDIT: 'edit',
80
+ DONE: 'done',
81
+ ERROR: 'error',
82
+ };
83
+ /** InjectionToken that can be used to specify the global stepper options. */
84
+ const STEPPER_GLOBAL_OPTIONS = new InjectionToken('STEPPER_GLOBAL_OPTIONS');
85
+ class CdkStep {
86
+ /** Whether the user can return to this step once it has been marked as completed. */
87
+ get editable() {
88
+ return this._editable;
89
+ }
90
+ set editable(value) {
91
+ this._editable = coerceBooleanProperty(value);
92
+ }
93
+ /** Whether the completion of step is optional. */
94
+ get optional() {
95
+ return this._optional;
96
+ }
97
+ set optional(value) {
98
+ this._optional = coerceBooleanProperty(value);
99
+ }
100
+ /** Whether step is marked as completed. */
101
+ get completed() {
102
+ return this._completedOverride == null ? this._getDefaultCompleted() : this._completedOverride;
103
+ }
104
+ set completed(value) {
105
+ this._completedOverride = coerceBooleanProperty(value);
106
+ }
107
+ _getDefaultCompleted() {
108
+ return this.stepControl ? this.stepControl.valid && this.interacted : this.interacted;
109
+ }
110
+ /** Whether step has an error. */
111
+ get hasError() {
112
+ return this._customError == null ? this._getDefaultError() : this._customError;
113
+ }
114
+ set hasError(value) {
115
+ this._customError = coerceBooleanProperty(value);
116
+ }
117
+ _getDefaultError() {
118
+ return this.stepControl && this.stepControl.invalid && this.interacted;
119
+ }
120
+ constructor(_stepper, stepperOptions) {
121
+ this._stepper = _stepper;
122
+ /** Whether user has attempted to move away from the step. */
123
+ this.interacted = false;
124
+ /** Emits when the user has attempted to move away from the step. */
125
+ this.interactedStream = new EventEmitter();
126
+ this._editable = true;
127
+ this._optional = false;
128
+ this._completedOverride = null;
129
+ this._customError = null;
130
+ this._stepperOptions = stepperOptions ? stepperOptions : {};
131
+ this._displayDefaultIndicatorType = this._stepperOptions.displayDefaultIndicatorType !== false;
132
+ }
133
+ /** Selects this step component. */
134
+ select() {
135
+ this._stepper.selected = this;
136
+ }
137
+ /** Resets the step to its initial state. Note that this includes resetting form data. */
138
+ reset() {
139
+ this.interacted = false;
140
+ if (this._completedOverride != null) {
141
+ this._completedOverride = false;
142
+ }
143
+ if (this._customError != null) {
144
+ this._customError = false;
145
+ }
146
+ if (this.stepControl) {
147
+ this.stepControl.reset();
148
+ }
149
+ }
150
+ ngOnChanges() {
151
+ // Since basically all inputs of the MatStep get proxied through the view down to the
152
+ // underlying MatStepHeader, we have to make sure that change detection runs correctly.
153
+ this._stepper._stateChanged();
154
+ }
155
+ _markAsInteracted() {
156
+ if (!this.interacted) {
157
+ this.interacted = true;
158
+ this.interactedStream.emit(this);
159
+ }
160
+ }
161
+ /** Determines whether the error state can be shown. */
162
+ _showError() {
163
+ // We want to show the error state either if the user opted into/out of it using the
164
+ // global options, or if they've explicitly set it through the `hasError` input.
165
+ return this._stepperOptions.showError ?? this._customError != null;
166
+ }
167
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: CdkStep, deps: [{ token: forwardRef(() => CdkStepper) }, { token: STEPPER_GLOBAL_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
168
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.11", type: CdkStep, isStandalone: false, selector: "cdk-step", inputs: { stepControl: "stepControl", label: "label", errorMessage: "errorMessage", ariaLabel: ["aria-label", "ariaLabel"], ariaLabelledby: ["aria-labelledby", "ariaLabelledby"], state: "state", editable: "editable", optional: "optional", completed: "completed", hasError: "hasError" }, outputs: { interactedStream: "interacted" }, queries: [{ propertyName: "stepLabel", first: true, predicate: CdkStepLabel, descendants: true }], viewQueries: [{ propertyName: "content", first: true, predicate: TemplateRef, descendants: true, static: true }], exportAs: ["cdkStep"], usesOnChanges: true, ngImport: i0, template: '<ng-template><ng-content></ng-content></ng-template>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
169
+ }
170
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: CdkStep, decorators: [{
171
+ type: Component,
172
+ args: [{
173
+ standalone: false,
174
+ selector: 'cdk-step',
175
+ exportAs: 'cdkStep',
176
+ template: '<ng-template><ng-content></ng-content></ng-template>',
177
+ encapsulation: ViewEncapsulation.None,
178
+ changeDetection: ChangeDetectionStrategy.OnPush,
179
+ }]
180
+ }], ctorParameters: () => [{ type: CdkStepper, decorators: [{
181
+ type: Inject,
182
+ args: [forwardRef(() => CdkStepper)]
183
+ }] }, { type: undefined, decorators: [{
184
+ type: Optional
185
+ }, {
186
+ type: Inject,
187
+ args: [STEPPER_GLOBAL_OPTIONS]
188
+ }] }], propDecorators: { stepLabel: [{
189
+ type: ContentChild,
190
+ args: [CdkStepLabel]
191
+ }], content: [{
192
+ type: ViewChild,
193
+ args: [TemplateRef, { static: true }]
194
+ }], stepControl: [{
195
+ type: Input
196
+ }], interactedStream: [{
197
+ type: Output,
198
+ args: ['interacted']
199
+ }], label: [{
200
+ type: Input
201
+ }], errorMessage: [{
202
+ type: Input
203
+ }], ariaLabel: [{
204
+ type: Input,
205
+ args: ['aria-label']
206
+ }], ariaLabelledby: [{
207
+ type: Input,
208
+ args: ['aria-labelledby']
209
+ }], state: [{
210
+ type: Input
211
+ }], editable: [{
212
+ type: Input
213
+ }], optional: [{
214
+ type: Input
215
+ }], completed: [{
216
+ type: Input
217
+ }], hasError: [{
218
+ type: Input
219
+ }] } });
220
+ class CdkStepper {
221
+ /** Whether the validity of previous steps should be checked or not. */
222
+ get linear() {
223
+ return this._linear;
224
+ }
225
+ set linear(value) {
226
+ this._linear = coerceBooleanProperty(value);
227
+ }
228
+ /** The index of the selected step. */
229
+ get selectedIndex() {
230
+ return this._selectedIndex;
231
+ }
232
+ set selectedIndex(index) {
233
+ const newIndex = coerceNumberProperty(index);
234
+ if (this.steps && this._steps) {
235
+ // Ensure that the index can't be out of bounds.
236
+ if (!this._isValidIndex(newIndex) && (typeof ngDevMode === 'undefined' || ngDevMode)) {
237
+ throw Error('cdkStepper: Cannot assign out-of-bounds value to `selectedIndex`.');
238
+ }
239
+ this.selected?._markAsInteracted();
240
+ if (this._selectedIndex !== newIndex &&
241
+ !this._anyControlsInvalidOrPending(newIndex) &&
242
+ (newIndex >= this._selectedIndex || this.steps.toArray()[newIndex].editable)) {
243
+ this._updateSelectedItemIndex(newIndex);
244
+ }
245
+ }
246
+ else {
247
+ this._selectedIndex = newIndex;
248
+ }
249
+ }
250
+ /** The step that is selected. */
251
+ get selected() {
252
+ return this.steps ? this.steps.toArray()[this.selectedIndex] : undefined;
253
+ }
254
+ set selected(step) {
255
+ this.selectedIndex = step && this.steps ? this.steps.toArray().indexOf(step) : -1;
256
+ }
257
+ /** Orientation of the stepper. */
258
+ get orientation() {
259
+ return this._orientation;
260
+ }
261
+ set orientation(value) {
262
+ // This is a protected method so that `MatSteppter` can hook into it.
263
+ this._orientation = value;
264
+ if (this._keyManager) {
265
+ this._keyManager.withVerticalOrientation(value === 'vertical');
266
+ }
267
+ }
268
+ constructor(_dir, _changeDetectorRef, _elementRef,
269
+ /**
270
+ * @deprecated No longer in use, to be removed.
271
+ * @breaking-change 13.0.0
272
+ */
273
+ _document) {
274
+ this._dir = _dir;
275
+ this._changeDetectorRef = _changeDetectorRef;
276
+ this._elementRef = _elementRef;
277
+ /** Emits when the component is destroyed. */
278
+ this._destroyed = new Subject();
279
+ /** Steps that belong to the current stepper, excluding ones from nested steppers. */
280
+ this.steps = new QueryList();
281
+ /** List of step headers sorted based on their DOM order. */
282
+ this._sortedHeaders = new QueryList();
283
+ this._linear = false;
284
+ this._selectedIndex = 0;
285
+ /** Event emitted when the selected step has changed. */
286
+ this.selectionChange = new EventEmitter();
287
+ /**
288
+ * @deprecated To be turned into a private property. Use `orientation` instead.
289
+ * @breaking-change 13.0.0
290
+ */
291
+ this._orientation = 'horizontal';
292
+ this._groupId = nextId++;
293
+ }
294
+ ngAfterContentInit() {
295
+ this._steps.changes
296
+ .pipe(startWith(this._steps), takeUntil(this._destroyed))
297
+ .subscribe((steps) => {
298
+ this.steps.reset(steps.filter(step => step._stepper === this));
299
+ this.steps.notifyOnChanges();
300
+ });
301
+ }
302
+ ngAfterViewInit() {
303
+ // If the step headers are defined outside of the `ngFor` that renders the steps, like in the
304
+ // Material stepper, they won't appear in the `QueryList` in the same order as they're
305
+ // rendered in the DOM which will lead to incorrect keyboard navigation. We need to sort
306
+ // them manually to ensure that they're correct. Alternatively, we can change the Material
307
+ // template to inline the headers in the `ngFor`, but that'll result in a lot of
308
+ // code duplciation. See #23539.
309
+ this._stepHeader.changes
310
+ .pipe(startWith(this._stepHeader), takeUntil(this._destroyed))
311
+ .subscribe((headers) => {
312
+ this._sortedHeaders.reset(headers.toArray().sort((a, b) => {
313
+ const documentPosition = a._elementRef.nativeElement.compareDocumentPosition(b._elementRef.nativeElement);
314
+ // `compareDocumentPosition` returns a bitmask so we have to use a bitwise operator.
315
+ // https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
316
+ // tslint:disable-next-line:no-bitwise
317
+ return documentPosition & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
318
+ }));
319
+ this._sortedHeaders.notifyOnChanges();
320
+ });
321
+ // Note that while the step headers are content children by default, any components that
322
+ // extend this one might have them as view children. We initialize the keyboard handling in
323
+ // AfterViewInit so we're guaranteed for both view and content children to be defined.
324
+ this._keyManager = new FocusKeyManager(this._sortedHeaders)
325
+ .withWrap()
326
+ .withHomeAndEnd()
327
+ .withVerticalOrientation(this._orientation === 'vertical');
328
+ (this._dir ? this._dir.change : of())
329
+ .pipe(startWith(this._layoutDirection()), takeUntil(this._destroyed))
330
+ .subscribe(direction => this._keyManager.withHorizontalOrientation(direction));
331
+ this._keyManager.updateActiveItem(this._selectedIndex);
332
+ // No need to `takeUntil` here, because we're the ones destroying `steps`.
333
+ this.steps.changes.subscribe(() => {
334
+ if (!this.selected) {
335
+ this._selectedIndex = Math.max(this._selectedIndex - 1, 0);
336
+ }
337
+ });
338
+ // The logic which asserts that the selected index is within bounds doesn't run before the
339
+ // steps are initialized, because we don't how many steps there are yet so we may have an
340
+ // invalid index on init. If that's the case, auto-correct to the default so we don't throw.
341
+ if (!this._isValidIndex(this._selectedIndex)) {
342
+ this._selectedIndex = 0;
343
+ }
344
+ }
345
+ ngOnDestroy() {
346
+ this.steps.destroy();
347
+ this._sortedHeaders.destroy();
348
+ this._destroyed.next();
349
+ this._destroyed.complete();
350
+ }
351
+ /** Selects and focuses the next step in list. */
352
+ next() {
353
+ this.selectedIndex = Math.min(this._selectedIndex + 1, this.steps.length - 1);
354
+ }
355
+ /** Selects and focuses the previous step in list. */
356
+ previous() {
357
+ this.selectedIndex = Math.max(this._selectedIndex - 1, 0);
358
+ }
359
+ /** Resets the stepper to its initial state. Note that this includes clearing form data. */
360
+ reset() {
361
+ this._updateSelectedItemIndex(0);
362
+ this.steps.forEach(step => step.reset());
363
+ this._stateChanged();
364
+ }
365
+ /** Returns a unique id for each step label element. */
366
+ _getStepLabelId(i) {
367
+ return `cdk-step-label-${this._groupId}-${i}`;
368
+ }
369
+ /** Returns unique id for each step content element. */
370
+ _getStepContentId(i) {
371
+ return `cdk-step-content-${this._groupId}-${i}`;
372
+ }
373
+ /** Marks the component to be change detected. */
374
+ _stateChanged() {
375
+ this._changeDetectorRef.markForCheck();
376
+ }
377
+ /** Returns position state of the step with the given index. */
378
+ _getAnimationDirection(index) {
379
+ const position = index - this._selectedIndex;
380
+ if (position < 0) {
381
+ return this._layoutDirection() === 'rtl' ? 'next' : 'previous';
382
+ }
383
+ else if (position > 0) {
384
+ return this._layoutDirection() === 'rtl' ? 'previous' : 'next';
385
+ }
386
+ return 'current';
387
+ }
388
+ /** Returns the type of icon to be displayed. */
389
+ _getIndicatorType(index, state = STEP_STATE.NUMBER) {
390
+ const step = this.steps.toArray()[index];
391
+ const isCurrentStep = this._isCurrentStep(index);
392
+ return step._displayDefaultIndicatorType
393
+ ? this._getDefaultIndicatorLogic(step, isCurrentStep)
394
+ : this._getGuidelineLogic(step, isCurrentStep, state);
395
+ }
396
+ _getDefaultIndicatorLogic(step, isCurrentStep) {
397
+ if (step._showError() && step.hasError && !isCurrentStep) {
398
+ return STEP_STATE.ERROR;
399
+ }
400
+ else if (!step.completed || isCurrentStep) {
401
+ return STEP_STATE.NUMBER;
402
+ }
403
+ else {
404
+ return step.editable ? STEP_STATE.EDIT : STEP_STATE.DONE;
405
+ }
406
+ }
407
+ _getGuidelineLogic(step, isCurrentStep, state = STEP_STATE.NUMBER) {
408
+ if (step._showError() && step.hasError && !isCurrentStep) {
409
+ return STEP_STATE.ERROR;
410
+ }
411
+ else if (step.completed && !isCurrentStep) {
412
+ return STEP_STATE.DONE;
413
+ }
414
+ else if (step.completed && isCurrentStep) {
415
+ return state;
416
+ }
417
+ else if (step.editable && isCurrentStep) {
418
+ return STEP_STATE.EDIT;
419
+ }
420
+ else {
421
+ return state;
422
+ }
423
+ }
424
+ _isCurrentStep(index) {
425
+ return this._selectedIndex === index;
426
+ }
427
+ /** Returns the index of the currently-focused step header. */
428
+ _getFocusIndex() {
429
+ return this._keyManager ? this._keyManager.activeItemIndex : this._selectedIndex;
430
+ }
431
+ _updateSelectedItemIndex(newIndex) {
432
+ const stepsArray = this.steps.toArray();
433
+ this.selectionChange.emit({
434
+ selectedIndex: newIndex,
435
+ previouslySelectedIndex: this._selectedIndex,
436
+ selectedStep: stepsArray[newIndex],
437
+ previouslySelectedStep: stepsArray[this._selectedIndex],
438
+ });
439
+ // If focus is inside the stepper, move it to the next header, otherwise it may become
440
+ // lost when the active step content is hidden. We can't be more granular with the check
441
+ // (e.g. checking whether focus is inside the active step), because we don't have a
442
+ // reference to the elements that are rendering out the content.
443
+ this._containsFocus()
444
+ ? this._keyManager.setActiveItem(newIndex)
445
+ : this._keyManager.updateActiveItem(newIndex);
446
+ this._selectedIndex = newIndex;
447
+ this._stateChanged();
448
+ }
449
+ _onKeydown(event) {
450
+ const hasModifier = hasModifierKey(event);
451
+ const keyCode = event.keyCode;
452
+ const manager = this._keyManager;
453
+ if (manager.activeItemIndex != null &&
454
+ !hasModifier &&
455
+ (keyCode === SPACE || keyCode === ENTER)) {
456
+ this.selectedIndex = manager.activeItemIndex;
457
+ event.preventDefault();
458
+ }
459
+ else {
460
+ manager.onKeydown(event);
461
+ }
462
+ }
463
+ _anyControlsInvalidOrPending(index) {
464
+ if (this._linear && index >= 0) {
465
+ return this.steps
466
+ .toArray()
467
+ .slice(0, index)
468
+ .some(step => {
469
+ const control = step.stepControl;
470
+ const isIncomplete = control
471
+ ? control.invalid || control.pending || !step.interacted
472
+ : !step.completed;
473
+ return isIncomplete && !step.optional && !step._completedOverride;
474
+ });
475
+ }
476
+ return false;
477
+ }
478
+ _layoutDirection() {
479
+ return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
480
+ }
481
+ /** Checks whether the stepper contains the focused element. */
482
+ _containsFocus() {
483
+ const stepperElement = this._elementRef.nativeElement;
484
+ const focusedElement = _getFocusedElementPierceShadowDom();
485
+ return stepperElement === focusedElement || stepperElement.contains(focusedElement);
486
+ }
487
+ /** Checks whether the passed-in index is a valid step index. */
488
+ _isValidIndex(index) {
489
+ return index > -1 && (!this.steps || index < this.steps.length);
490
+ }
491
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: CdkStepper, deps: [{ token: i1.Directionality, optional: true }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive }); }
492
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.11", type: CdkStepper, isStandalone: false, selector: "[cdkStepper]", inputs: { linear: "linear", selectedIndex: "selectedIndex", selected: "selected", orientation: "orientation" }, outputs: { selectionChange: "selectionChange" }, queries: [{ propertyName: "_steps", predicate: CdkStep, descendants: true }, { propertyName: "_stepHeader", predicate: CdkStepHeader, descendants: true }], exportAs: ["cdkStepper"], ngImport: i0 }); }
493
+ }
494
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: CdkStepper, decorators: [{
495
+ type: Directive,
496
+ args: [{
497
+ standalone: false,
498
+ selector: '[cdkStepper]',
499
+ exportAs: 'cdkStepper',
500
+ }]
501
+ }], ctorParameters: () => [{ type: i1.Directionality, decorators: [{
502
+ type: Optional
503
+ }] }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: undefined, decorators: [{
504
+ type: Inject,
505
+ args: [DOCUMENT]
506
+ }] }], propDecorators: { _steps: [{
507
+ type: ContentChildren,
508
+ args: [CdkStep, { descendants: true }]
509
+ }], _stepHeader: [{
510
+ type: ContentChildren,
511
+ args: [CdkStepHeader, { descendants: true }]
512
+ }], linear: [{
513
+ type: Input
514
+ }], selectedIndex: [{
515
+ type: Input
516
+ }], selected: [{
517
+ type: Input
518
+ }], selectionChange: [{
519
+ type: Output
520
+ }], orientation: [{
521
+ type: Input
522
+ }] } });
523
+
524
+ /**
525
+ * @license
526
+ * Copyright Google LLC All Rights Reserved.
527
+ *
528
+ * Use of this source code is governed by an MIT-style license that can be
529
+ * found in the LICENSE file at https://angular.io/license
530
+ */
531
+ /** Button that moves to the next step in a stepper workflow. */
532
+ class CdkStepperNext {
533
+ constructor(_stepper) {
534
+ this._stepper = _stepper;
535
+ /** Type of the next button. Defaults to "submit" if not specified. */
536
+ this.type = 'submit';
537
+ }
538
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: CdkStepperNext, deps: [{ token: CdkStepper }], target: i0.ɵɵFactoryTarget.Directive }); }
539
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.11", type: CdkStepperNext, isStandalone: false, selector: "button[cdkStepperNext]", inputs: { type: "type" }, host: { listeners: { "click": "_stepper.next()" }, properties: { "type": "type" } }, ngImport: i0 }); }
540
+ }
541
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: CdkStepperNext, decorators: [{
542
+ type: Directive,
543
+ args: [{
544
+ standalone: false,
545
+ selector: 'button[cdkStepperNext]',
546
+ host: {
547
+ '[type]': 'type',
548
+ '(click)': '_stepper.next()',
549
+ },
550
+ }]
551
+ }], ctorParameters: () => [{ type: CdkStepper }], propDecorators: { type: [{
552
+ type: Input
553
+ }] } });
554
+ /** Button that moves to the previous step in a stepper workflow. */
555
+ class CdkStepperPrevious {
556
+ constructor(_stepper) {
557
+ this._stepper = _stepper;
558
+ /** Type of the previous button. Defaults to "button" if not specified. */
559
+ this.type = 'button';
560
+ }
561
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: CdkStepperPrevious, deps: [{ token: CdkStepper }], target: i0.ɵɵFactoryTarget.Directive }); }
562
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.11", type: CdkStepperPrevious, isStandalone: false, selector: "button[cdkStepperPrevious]", inputs: { type: "type" }, host: { listeners: { "click": "_stepper.previous()" }, properties: { "type": "type" } }, ngImport: i0 }); }
563
+ }
564
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: CdkStepperPrevious, decorators: [{
565
+ type: Directive,
566
+ args: [{
567
+ standalone: false,
568
+ selector: 'button[cdkStepperPrevious]',
569
+ host: {
570
+ '[type]': 'type',
571
+ '(click)': '_stepper.previous()',
572
+ },
573
+ }]
574
+ }], ctorParameters: () => [{ type: CdkStepper }], propDecorators: { type: [{
575
+ type: Input
576
+ }] } });
577
+
578
+ /**
579
+ * @license
580
+ * Copyright Google LLC All Rights Reserved.
581
+ *
582
+ * Use of this source code is governed by an MIT-style license that can be
583
+ * found in the LICENSE file at https://angular.io/license
584
+ */
585
+ class CdkStepperModule {
586
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: CdkStepperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
587
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.11", ngImport: i0, type: CdkStepperModule, declarations: [CdkStep,
588
+ CdkStepper,
589
+ CdkStepHeader,
590
+ CdkStepLabel,
591
+ CdkStepperNext,
592
+ CdkStepperPrevious], imports: [BidiModule], exports: [CdkStep, CdkStepper, CdkStepHeader, CdkStepLabel, CdkStepperNext, CdkStepperPrevious] }); }
593
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: CdkStepperModule, imports: [BidiModule] }); }
594
+ }
595
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: CdkStepperModule, decorators: [{
596
+ type: NgModule,
597
+ args: [{
598
+ imports: [BidiModule],
599
+ exports: [CdkStep, CdkStepper, CdkStepHeader, CdkStepLabel, CdkStepperNext, CdkStepperPrevious],
600
+ declarations: [
601
+ CdkStep,
602
+ CdkStepper,
603
+ CdkStepHeader,
604
+ CdkStepLabel,
605
+ CdkStepperNext,
606
+ CdkStepperPrevious,
607
+ ],
608
+ }]
609
+ }] });
610
+
611
+ /**
612
+ * @license
613
+ * Copyright Google LLC All Rights Reserved.
614
+ *
615
+ * Use of this source code is governed by an MIT-style license that can be
616
+ * found in the LICENSE file at https://angular.io/license
617
+ */
618
+
619
+ /**
620
+ * Generated bundle index. Do not edit.
621
+ */
622
+
623
+ export { CdkStep, CdkStepHeader, CdkStepLabel, CdkStepper, CdkStepperModule, CdkStepperNext, CdkStepperPrevious, STEPPER_GLOBAL_OPTIONS, STEP_STATE, StepperSelectionEvent };
624
+ //# sourceMappingURL=stagefright5-cdk-stepper.mjs.map