ngwr 16.0.0 → 16.2.0

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 (295) hide show
  1. package/badge/styles/_tag.scss +8 -4
  2. package/button/styles/_index.scss +13 -7
  3. package/cascader/styles/_rules.scss +4 -2
  4. package/checkbox/styles/_index.scss +4 -2
  5. package/date-picker/styles/_index.scss +95 -3
  6. package/date-stamp/styles/_index.scss +38 -0
  7. package/dialog/styles/_index.scss +38 -0
  8. package/dropdown/styles/_index.scss +37 -1
  9. package/fesm2022/internal-CVLvP9b_.mjs +33 -0
  10. package/fesm2022/internal-CVLvP9b_.mjs.map +1 -0
  11. package/fesm2022/ngwr-alert.mjs +11 -7
  12. package/fesm2022/ngwr-alert.mjs.map +1 -1
  13. package/fesm2022/ngwr-avatar.mjs +11 -7
  14. package/fesm2022/ngwr-avatar.mjs.map +1 -1
  15. package/fesm2022/ngwr-back-top.mjs +10 -6
  16. package/fesm2022/ngwr-back-top.mjs.map +1 -1
  17. package/fesm2022/ngwr-badge.mjs +18 -6
  18. package/fesm2022/ngwr-badge.mjs.map +1 -1
  19. package/fesm2022/ngwr-burger.mjs +9 -6
  20. package/fesm2022/ngwr-burger.mjs.map +1 -1
  21. package/fesm2022/ngwr-button.mjs +8 -4
  22. package/fesm2022/ngwr-button.mjs.map +1 -1
  23. package/fesm2022/ngwr-calendar.mjs +19 -8
  24. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  25. package/fesm2022/ngwr-card.mjs +9 -5
  26. package/fesm2022/ngwr-card.mjs.map +1 -1
  27. package/fesm2022/ngwr-cascader.mjs +11 -5
  28. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  29. package/fesm2022/ngwr-charts-calendar-heatmap.mjs +5 -2
  30. package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
  31. package/fesm2022/ngwr-checkbox.mjs +10 -6
  32. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  33. package/fesm2022/ngwr-clipboard.mjs +2 -1
  34. package/fesm2022/ngwr-clipboard.mjs.map +1 -1
  35. package/fesm2022/ngwr-collapse.mjs +9 -5
  36. package/fesm2022/ngwr-collapse.mjs.map +1 -1
  37. package/fesm2022/ngwr-color-picker.mjs +4 -2
  38. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  39. package/fesm2022/ngwr-comment.mjs +13 -7
  40. package/fesm2022/ngwr-comment.mjs.map +1 -1
  41. package/fesm2022/ngwr-compare.mjs +9 -3
  42. package/fesm2022/ngwr-compare.mjs.map +1 -1
  43. package/fesm2022/ngwr-context-menu.mjs +4 -2
  44. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  45. package/fesm2022/ngwr-copy-value.mjs +11 -6
  46. package/fesm2022/ngwr-copy-value.mjs.map +1 -1
  47. package/fesm2022/ngwr-date-picker-testing.mjs +18 -0
  48. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  49. package/fesm2022/ngwr-date-picker.mjs +238 -38
  50. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  51. package/fesm2022/ngwr-date-stamp-testing.mjs +34 -0
  52. package/fesm2022/ngwr-date-stamp-testing.mjs.map +1 -0
  53. package/fesm2022/ngwr-date-stamp.mjs +213 -0
  54. package/fesm2022/ngwr-date-stamp.mjs.map +1 -0
  55. package/fesm2022/ngwr-date.mjs +364 -54
  56. package/fesm2022/ngwr-date.mjs.map +1 -1
  57. package/fesm2022/ngwr-descriptions.mjs +9 -5
  58. package/fesm2022/ngwr-descriptions.mjs.map +1 -1
  59. package/fesm2022/ngwr-dialog-testing.mjs +23 -2
  60. package/fesm2022/ngwr-dialog-testing.mjs.map +1 -1
  61. package/fesm2022/ngwr-dialog.mjs +45 -16
  62. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  63. package/fesm2022/ngwr-directives.mjs +102 -11
  64. package/fesm2022/ngwr-directives.mjs.map +1 -1
  65. package/fesm2022/ngwr-divider.mjs +4 -2
  66. package/fesm2022/ngwr-divider.mjs.map +1 -1
  67. package/fesm2022/ngwr-drawer.mjs +29 -3
  68. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  69. package/fesm2022/ngwr-dropdown-testing.mjs +38 -3
  70. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
  71. package/fesm2022/ngwr-dropdown.mjs +362 -26
  72. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  73. package/fesm2022/ngwr-editor.mjs +5 -2
  74. package/fesm2022/ngwr-editor.mjs.map +1 -1
  75. package/fesm2022/ngwr-event-calendar.mjs +4 -2
  76. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  77. package/fesm2022/ngwr-file-upload.mjs +9 -3
  78. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  79. package/fesm2022/ngwr-form.mjs +18 -6
  80. package/fesm2022/ngwr-form.mjs.map +1 -1
  81. package/fesm2022/ngwr-i18n-ar.mjs +9 -2
  82. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  83. package/fesm2022/ngwr-i18n-cs.mjs +9 -2
  84. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  85. package/fesm2022/ngwr-i18n-de.mjs +9 -2
  86. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  87. package/fesm2022/ngwr-i18n-en.mjs +9 -2
  88. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  89. package/fesm2022/ngwr-i18n-es.mjs +9 -2
  90. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  91. package/fesm2022/ngwr-i18n-fr.mjs +9 -2
  92. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  93. package/fesm2022/ngwr-i18n-he.mjs +9 -2
  94. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  95. package/fesm2022/ngwr-i18n-hi.mjs +9 -2
  96. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  97. package/fesm2022/ngwr-i18n-id.mjs +9 -2
  98. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  99. package/fesm2022/ngwr-i18n-it.mjs +9 -2
  100. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  101. package/fesm2022/ngwr-i18n-ja.mjs +9 -2
  102. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  103. package/fesm2022/ngwr-i18n-ko.mjs +9 -2
  104. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  105. package/fesm2022/ngwr-i18n-nl.mjs +9 -2
  106. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  107. package/fesm2022/ngwr-i18n-pl.mjs +9 -2
  108. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  109. package/fesm2022/ngwr-i18n-pt.mjs +9 -2
  110. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  111. package/fesm2022/ngwr-i18n-ru.mjs +9 -2
  112. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  113. package/fesm2022/ngwr-i18n-sv.mjs +9 -2
  114. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  115. package/fesm2022/ngwr-i18n-tr.mjs +9 -2
  116. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  117. package/fesm2022/ngwr-i18n-uk.mjs +9 -2
  118. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  119. package/fesm2022/ngwr-i18n-vi.mjs +9 -2
  120. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  121. package/fesm2022/ngwr-i18n-zh-tw.mjs +9 -2
  122. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  123. package/fesm2022/ngwr-i18n-zh.mjs +9 -2
  124. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  125. package/fesm2022/ngwr-i18n.mjs +34 -8
  126. package/fesm2022/ngwr-i18n.mjs.map +1 -1
  127. package/fesm2022/ngwr-input-number.mjs +9 -3
  128. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  129. package/fesm2022/ngwr-input-otp.mjs +4 -2
  130. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  131. package/fesm2022/ngwr-input.mjs +20 -10
  132. package/fesm2022/ngwr-input.mjs.map +1 -1
  133. package/fesm2022/ngwr-keyboard.mjs +9 -3
  134. package/fesm2022/ngwr-keyboard.mjs.map +1 -1
  135. package/fesm2022/ngwr-knob.mjs +9 -3
  136. package/fesm2022/ngwr-knob.mjs.map +1 -1
  137. package/fesm2022/ngwr-layout.mjs +13 -5
  138. package/fesm2022/ngwr-layout.mjs.map +1 -1
  139. package/fesm2022/ngwr-lightbox-testing.mjs +26 -0
  140. package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -1
  141. package/fesm2022/ngwr-lightbox.mjs +255 -15
  142. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  143. package/fesm2022/ngwr-list.mjs +13 -5
  144. package/fesm2022/ngwr-list.mjs.map +1 -1
  145. package/fesm2022/ngwr-load-state.mjs +9 -5
  146. package/fesm2022/ngwr-load-state.mjs.map +1 -1
  147. package/fesm2022/ngwr-overlay.mjs +84 -1
  148. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  149. package/fesm2022/ngwr-pagination.mjs +3 -2
  150. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  151. package/fesm2022/ngwr-pipes.mjs +47 -9
  152. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  153. package/fesm2022/ngwr-popover.mjs +93 -4
  154. package/fesm2022/ngwr-popover.mjs.map +1 -1
  155. package/fesm2022/ngwr-progress.mjs +4 -2
  156. package/fesm2022/ngwr-progress.mjs.map +1 -1
  157. package/fesm2022/ngwr-radio.mjs +9 -5
  158. package/fesm2022/ngwr-radio.mjs.map +1 -1
  159. package/fesm2022/ngwr-rating.mjs +9 -3
  160. package/fesm2022/ngwr-rating.mjs.map +1 -1
  161. package/fesm2022/ngwr-resizable.mjs +503 -0
  162. package/fesm2022/ngwr-resizable.mjs.map +1 -0
  163. package/fesm2022/ngwr-result.mjs +9 -5
  164. package/fesm2022/ngwr-result.mjs.map +1 -1
  165. package/fesm2022/ngwr-schema-form.mjs +3 -0
  166. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  167. package/fesm2022/ngwr-segmented.mjs +4 -2
  168. package/fesm2022/ngwr-segmented.mjs.map +1 -1
  169. package/fesm2022/ngwr-select.mjs +13 -5
  170. package/fesm2022/ngwr-select.mjs.map +1 -1
  171. package/fesm2022/ngwr-skeleton.mjs +4 -2
  172. package/fesm2022/ngwr-skeleton.mjs.map +1 -1
  173. package/fesm2022/ngwr-slider-testing.mjs +17 -0
  174. package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
  175. package/fesm2022/ngwr-slider.mjs +91 -13
  176. package/fesm2022/ngwr-slider.mjs.map +1 -1
  177. package/fesm2022/ngwr-sortable-list-testing.mjs +103 -0
  178. package/fesm2022/ngwr-sortable-list-testing.mjs.map +1 -0
  179. package/fesm2022/ngwr-sortable-list.mjs +257 -53
  180. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  181. package/fesm2022/ngwr-speed-dial.mjs +4 -2
  182. package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
  183. package/fesm2022/ngwr-spinner.mjs +4 -2
  184. package/fesm2022/ngwr-spinner.mjs.map +1 -1
  185. package/fesm2022/ngwr-splitter.mjs +17 -21
  186. package/fesm2022/ngwr-splitter.mjs.map +1 -1
  187. package/fesm2022/ngwr-stepper.mjs +9 -3
  188. package/fesm2022/ngwr-stepper.mjs.map +1 -1
  189. package/fesm2022/ngwr-switch.mjs +9 -5
  190. package/fesm2022/ngwr-switch.mjs.map +1 -1
  191. package/fesm2022/ngwr-table-testing.mjs +5 -1
  192. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  193. package/fesm2022/ngwr-table.mjs +167 -10
  194. package/fesm2022/ngwr-table.mjs.map +1 -1
  195. package/fesm2022/ngwr-textarea.mjs +9 -3
  196. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  197. package/fesm2022/ngwr-timeline.mjs +18 -8
  198. package/fesm2022/ngwr-timeline.mjs.map +1 -1
  199. package/fesm2022/ngwr-toast-testing.mjs +6 -1
  200. package/fesm2022/ngwr-toast-testing.mjs.map +1 -1
  201. package/fesm2022/ngwr-toast.mjs +529 -104
  202. package/fesm2022/ngwr-toast.mjs.map +1 -1
  203. package/fesm2022/ngwr-transfer.mjs +4 -2
  204. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  205. package/fesm2022/ngwr-tree.mjs +4 -2
  206. package/fesm2022/ngwr-tree.mjs.map +1 -1
  207. package/fesm2022/ngwr-typography.mjs +9 -3
  208. package/fesm2022/ngwr-typography.mjs.map +1 -1
  209. package/fesm2022/ngwr-utils-router.mjs +18 -2
  210. package/fesm2022/ngwr-utils-router.mjs.map +1 -1
  211. package/fesm2022/ngwr-utils.mjs +9 -2
  212. package/fesm2022/ngwr-utils.mjs.map +1 -1
  213. package/fesm2022/ngwr-version.mjs +1 -1
  214. package/fesm2022/ngwr-version.mjs.map +1 -1
  215. package/fesm2022/ngwr-window.mjs +7 -4
  216. package/fesm2022/ngwr-window.mjs.map +1 -1
  217. package/fesm2022/ngwr.mjs.map +1 -1
  218. package/i18n/ar.json +13 -2
  219. package/i18n/cs.json +13 -2
  220. package/i18n/de.json +13 -2
  221. package/i18n/en.json +13 -2
  222. package/i18n/es.json +13 -2
  223. package/i18n/fr.json +13 -2
  224. package/i18n/he.json +13 -2
  225. package/i18n/hi.json +13 -2
  226. package/i18n/id.json +13 -2
  227. package/i18n/it.json +13 -2
  228. package/i18n/ja.json +13 -2
  229. package/i18n/ko.json +13 -2
  230. package/i18n/nl.json +13 -2
  231. package/i18n/pl.json +13 -2
  232. package/i18n/pt.json +13 -2
  233. package/i18n/ru.json +13 -2
  234. package/i18n/sv.json +13 -2
  235. package/i18n/tr.json +13 -2
  236. package/i18n/uk.json +13 -2
  237. package/i18n/vi.json +13 -2
  238. package/i18n/zh-TW.json +13 -2
  239. package/i18n/zh.json +13 -2
  240. package/input/styles/_index.scss +10 -5
  241. package/input-number/styles/_index.scss +6 -3
  242. package/input-otp/styles/_index.scss +4 -2
  243. package/lightbox/styles/_rules.scss +96 -0
  244. package/llms-full.txt +40 -17
  245. package/llms.txt +20 -4
  246. package/package.json +19 -1
  247. package/radio/styles/_index.scss +4 -2
  248. package/resizable/styles/_index.scss +154 -0
  249. package/schematics/use/rule.js +1 -0
  250. package/schematics/use/symbol-map.json +5 -0
  251. package/select/styles/_index.scss +6 -3
  252. package/skills/ngwr/SKILL.md +1 -1
  253. package/skills/ngwr/references/catalog.md +6 -2
  254. package/skills/ngwr/references/setup.md +3 -0
  255. package/slider/styles/_index.scss +106 -0
  256. package/sortable-list/styles/_rules.scss +23 -1
  257. package/switch/styles/_index.scss +4 -2
  258. package/table/styles/_index.scss +53 -0
  259. package/textarea/styles/_index.scss +4 -2
  260. package/theme/styles/_motion.scss +6 -0
  261. package/toast/styles/_index.scss +19 -0
  262. package/types/ngwr-burger.d.ts +0 -1
  263. package/types/ngwr-calendar.d.ts +7 -0
  264. package/types/ngwr-charts-calendar-heatmap.d.ts +2 -1
  265. package/types/ngwr-clipboard.d.ts +7 -0
  266. package/types/ngwr-date-picker-testing.d.ts +17 -0
  267. package/types/ngwr-date-picker.d.ts +88 -4
  268. package/types/ngwr-date-stamp-testing.d.ts +47 -0
  269. package/types/ngwr-date-stamp.d.ts +127 -0
  270. package/types/ngwr-date.d.ts +251 -37
  271. package/types/ngwr-dialog-testing.d.ts +10 -0
  272. package/types/ngwr-dialog.d.ts +72 -4
  273. package/types/ngwr-directives.d.ts +36 -1
  274. package/types/ngwr-drawer.d.ts +21 -0
  275. package/types/ngwr-dropdown-testing.d.ts +53 -5
  276. package/types/ngwr-dropdown.d.ts +100 -0
  277. package/types/ngwr-i18n.d.ts +44 -14
  278. package/types/ngwr-lightbox-testing.d.ts +27 -0
  279. package/types/ngwr-lightbox.d.ts +71 -6
  280. package/types/ngwr-overlay.d.ts +36 -0
  281. package/types/ngwr-pipes.d.ts +48 -13
  282. package/types/ngwr-popover.d.ts +39 -1
  283. package/types/ngwr-resizable.d.ts +228 -0
  284. package/types/ngwr-slider-testing.d.ts +8 -1
  285. package/types/ngwr-slider.d.ts +89 -3
  286. package/types/ngwr-sortable-list-testing.d.ts +79 -0
  287. package/types/ngwr-sortable-list.d.ts +113 -10
  288. package/types/ngwr-table-testing.d.ts +3 -1
  289. package/types/ngwr-table.d.ts +120 -4
  290. package/types/ngwr-toast-testing.d.ts +12 -1
  291. package/types/ngwr-toast.d.ts +215 -18
  292. package/types/ngwr-utils-router.d.ts +22 -0
  293. package/types/ngwr-utils.d.ts +8 -1
  294. package/types/ngwr-version.d.ts +1 -1
  295. package/types/ngwr.d.ts +1 -0
@@ -29,7 +29,7 @@ var WrSwitch = class WrSwitch {
29
29
  touch = output();
30
30
  native = viewChild.required("native", ...ngDevMode ? [{ debugName: "native" }] : /* istanbul ignore next */ []);
31
31
  classes = computed(() => {
32
- const parts = ["wr-switch"];
32
+ const parts = [];
33
33
  const size = this.size();
34
34
  if (size !== "md") parts.push(`wr-switch--${size}`);
35
35
  if (this.checked()) parts.push("wr-switch--checked");
@@ -115,10 +115,13 @@ var WrSwitch = class WrSwitch {
115
115
  checked: "checkedChange",
116
116
  touch: "touch"
117
117
  },
118
- host: { properties: {
119
- "class": "classes()",
120
- "attr.id": "null"
121
- } },
118
+ host: {
119
+ properties: {
120
+ "class": "classes()",
121
+ "attr.id": "null"
122
+ },
123
+ classAttribute: "wr-switch"
124
+ },
122
125
  viewQueries: [{
123
126
  propertyName: "native",
124
127
  first: true,
@@ -142,6 +145,7 @@ i0.ɵɵngDeclareClassMetadata({
142
145
  selector: "wr-switch",
143
146
  encapsulation: ViewEncapsulation.None,
144
147
  host: {
148
+ class: "wr-switch",
145
149
  "[class]": "classes()",
146
150
  "[attr.id]": "null"
147
151
  },
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-switch.mjs","names":[],"sources":["../../../projects/lib/switch/switch.ts","../../../projects/lib/switch/switch.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n type ElementRef,\n ViewEncapsulation,\n computed,\n input,\n model,\n output,\n viewChild,\n} from '@angular/core';\nimport type { FormCheckboxControl } from '@angular/forms/signals';\n\nimport { useFormFieldAria } from 'ngwr/form';\nimport { wrRandomId, wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Boolean toggle with an iOS-style slider.\n *\n * A signal-forms native control: it implements `FormCheckboxControl`, so\n * `[formField]` binds straight to its `checked` model — no\n * `ControlValueAccessor` in between. `[(checked)]` works standalone.\n *\n * @example\n * ```html\n * <!-- signal forms -->\n * <wr-switch [formField]=\"form.notifications\">Notifications</wr-switch>\n *\n * <!-- standalone two-way binding -->\n * <wr-switch [(checked)]=\"enabled\">Notifications</wr-switch>\n * ```\n *\n * @see https://ngwr.dev/reference/components/switch\n */\nexport type WrSwitchSize = 'sm' | 'md' | 'lg';\n\n@Component({\n selector: 'wr-switch',\n templateUrl: './switch.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n '[class]': 'classes()',\n // The `id` input belongs to the native input, not to this element — a static\n // `id=\"x\"` would otherwise be written here too and leave the document with\n // two elements sharing it, which is what broke `<label for>`.\n '[attr.id]': 'null',\n },\n})\nexport class WrSwitch implements FormCheckboxControl {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('switch');\n }\n\n /**\n * Accessible name for a switch used WITHOUT projected text. The wrapping\n * `<label>` names the control whenever content is projected; with none, the\n * label is empty and the input has no name at all.\n */\n readonly ariaLabel = input<string | null>(null);\n\n /**\n * Stable id used to associate the native input with its label. Lands on the\n * inner `<input>`; the host never keeps it.\n */\n readonly id = input<string>(wrRandomId('wr-switch'));\n\n /**\n * Disable the switch. Bound automatically from the field's disabled state\n * when used with `[formField]`.\n *\n * @default false\n */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse edits while staying focusable and submittable. Bound automatically\n * from the field's readonly state when used with `[formField]`.\n *\n * A native checkbox ignores the `readonly` attribute, so this cancels the\n * click's activation behaviour instead — which covers Space too, since the key\n * arrives as a click — and mirrors the state as `aria-readonly`, which role\n * `switch` supports.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /** The surrounding `<wr-form-field>`'s error state. @internal */\n protected readonly fieldAria = useFormFieldAria();\n\n /** Control size — shares the `--wr-control-*` contract. @default 'md' */\n readonly size = input<WrSwitchSize>('md');\n\n /** On / off state. Bound by `[formField]`, or two-way via `[(checked)]`. */\n readonly checked = model<boolean>(false);\n\n /** Emitted on blur so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n private readonly native = viewChild.required<ElementRef<HTMLInputElement>>('native');\n\n protected readonly classes = computed(() => {\n const parts = ['wr-switch'];\n const size = this.size();\n if (size !== 'md') parts.push(`wr-switch--${size}`);\n if (this.checked()) parts.push('wr-switch--checked');\n if (this.disabled()) parts.push('wr-switch--disabled');\n else if (this.readonly()) parts.push('wr-switch--readonly');\n return parts.join(' ');\n });\n\n /**\n * Focus the switch — what Signal Forms calls to focus this control. The native\n * input takes it, since the host has no tab stop of its own; a disabled switch\n * refuses, as a disabled input always does.\n */\n focus(options?: FocusOptions): void {\n this.native().nativeElement.focus(options);\n }\n\n // Template handlers\n\n /**\n * Cancel the toggle while readonly. `change` never fires for a click whose\n * default was prevented, so this is the only guard the pointer and Space paths\n * need; `onInputChange` keeps its own for a synthetic `change`.\n */\n protected onInputClick(event: Event): void {\n if (this.readonly()) event.preventDefault();\n }\n\n protected onInputChange(event: Event): void {\n if (this.readonly()) {\n // A synthetic `change` cannot be prevented — put the DOM back instead.\n (event.target as HTMLInputElement).checked = this.checked();\n return;\n }\n this.checked.set((event.target as HTMLInputElement).checked);\n }\n\n protected onInputBlur(): void {\n this.touch.emit();\n }\n}\n","<label class=\"wr-switch__label\" [for]=\"id()\">\n <input\n #native\n class=\"wr-switch__input\"\n type=\"checkbox\"\n role=\"switch\"\n [id]=\"id()\"\n [attr.aria-label]=\"ariaLabel()\"\n [checked]=\"checked()\"\n [disabled]=\"disabled()\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n (click)=\"onInputClick($event)\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onInputBlur()\"\n />\n\n <span class=\"wr-switch__track\" aria-hidden=\"true\">\n <span class=\"wr-switch__thumb\"></span>\n </span>\n\n <span class=\"wr-switch__text\">\n <ng-content />\n </span>\n</label>\n"],"mappings":";;;;;;;;;;;AAuDA,IAAa,WAAb,MAAa,SAAQ;CACnB,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,QAAQ;CAC3E;CAOS,YAAY,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAMtC,KAAK,MAAc,WAAW,WAAW,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CAQ3C,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAa1D,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAGhD,YAAY,iBAAgB;CAGtC,OAAO,MAAoB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAGhC,UAAU,MAAe,OAAM,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAG/B,QAAQ,OAAM;CAEN,SAAS,UAAU,SAAuC,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,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CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,GAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,eAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,UAAQ,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"ngwr-switch.mjs","names":[],"sources":["../../../projects/lib/switch/switch.ts","../../../projects/lib/switch/switch.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n type ElementRef,\n ViewEncapsulation,\n computed,\n input,\n model,\n output,\n viewChild,\n} from '@angular/core';\nimport type { FormCheckboxControl } from '@angular/forms/signals';\n\nimport { useFormFieldAria } from 'ngwr/form';\nimport { wrRandomId, wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Boolean toggle with an iOS-style slider.\n *\n * A signal-forms native control: it implements `FormCheckboxControl`, so\n * `[formField]` binds straight to its `checked` model — no\n * `ControlValueAccessor` in between. `[(checked)]` works standalone.\n *\n * @example\n * ```html\n * <!-- signal forms -->\n * <wr-switch [formField]=\"form.notifications\">Notifications</wr-switch>\n *\n * <!-- standalone two-way binding -->\n * <wr-switch [(checked)]=\"enabled\">Notifications</wr-switch>\n * ```\n *\n * @see https://ngwr.dev/reference/components/switch\n */\nexport type WrSwitchSize = 'sm' | 'md' | 'lg';\n\n@Component({\n selector: 'wr-switch',\n templateUrl: './switch.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-switch',\n '[class]': 'classes()',\n // The `id` input belongs to the native input, not to this element — a static\n // `id=\"x\"` would otherwise be written here too and leave the document with\n // two elements sharing it, which is what broke `<label for>`.\n '[attr.id]': 'null',\n },\n})\nexport class WrSwitch implements FormCheckboxControl {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('switch');\n }\n\n /**\n * Accessible name for a switch used WITHOUT projected text. The wrapping\n * `<label>` names the control whenever content is projected; with none, the\n * label is empty and the input has no name at all.\n */\n readonly ariaLabel = input<string | null>(null);\n\n /**\n * Stable id used to associate the native input with its label. Lands on the\n * inner `<input>`; the host never keeps it.\n */\n readonly id = input<string>(wrRandomId('wr-switch'));\n\n /**\n * Disable the switch. Bound automatically from the field's disabled state\n * when used with `[formField]`.\n *\n * @default false\n */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse edits while staying focusable and submittable. Bound automatically\n * from the field's readonly state when used with `[formField]`.\n *\n * A native checkbox ignores the `readonly` attribute, so this cancels the\n * click's activation behaviour instead — which covers Space too, since the key\n * arrives as a click — and mirrors the state as `aria-readonly`, which role\n * `switch` supports.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /** The surrounding `<wr-form-field>`'s error state. @internal */\n protected readonly fieldAria = useFormFieldAria();\n\n /** Control size — shares the `--wr-control-*` contract. @default 'md' */\n readonly size = input<WrSwitchSize>('md');\n\n /** On / off state. Bound by `[formField]`, or two-way via `[(checked)]`. */\n readonly checked = model<boolean>(false);\n\n /** Emitted on blur so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n private readonly native = viewChild.required<ElementRef<HTMLInputElement>>('native');\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n const size = this.size();\n if (size !== 'md') parts.push(`wr-switch--${size}`);\n if (this.checked()) parts.push('wr-switch--checked');\n if (this.disabled()) parts.push('wr-switch--disabled');\n else if (this.readonly()) parts.push('wr-switch--readonly');\n return parts.join(' ');\n });\n\n /**\n * Focus the switch — what Signal Forms calls to focus this control. The native\n * input takes it, since the host has no tab stop of its own; a disabled switch\n * refuses, as a disabled input always does.\n */\n focus(options?: FocusOptions): void {\n this.native().nativeElement.focus(options);\n }\n\n // Template handlers\n\n /**\n * Cancel the toggle while readonly. `change` never fires for a click whose\n * default was prevented, so this is the only guard the pointer and Space paths\n * need; `onInputChange` keeps its own for a synthetic `change`.\n */\n protected onInputClick(event: Event): void {\n if (this.readonly()) event.preventDefault();\n }\n\n protected onInputChange(event: Event): void {\n if (this.readonly()) {\n // A synthetic `change` cannot be prevented — put the DOM back instead.\n (event.target as HTMLInputElement).checked = this.checked();\n return;\n }\n this.checked.set((event.target as HTMLInputElement).checked);\n }\n\n protected onInputBlur(): void {\n this.touch.emit();\n }\n}\n","<label class=\"wr-switch__label\" [for]=\"id()\">\n <input\n #native\n class=\"wr-switch__input\"\n type=\"checkbox\"\n role=\"switch\"\n [id]=\"id()\"\n [attr.aria-label]=\"ariaLabel()\"\n [checked]=\"checked()\"\n [disabled]=\"disabled()\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n (click)=\"onInputClick($event)\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onInputBlur()\"\n />\n\n <span class=\"wr-switch__track\" aria-hidden=\"true\">\n <span class=\"wr-switch__thumb\"></span>\n </span>\n\n <span class=\"wr-switch__text\">\n <ng-content />\n </span>\n</label>\n"],"mappings":";;;;;;;;;;;AAwDA,IAAa,WAAb,MAAa,SAAQ;CACnB,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,QAAQ;CAC3E;CAOS,YAAY,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAMtC,KAAK,MAAc,WAAW,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;GAAI,MAC/B;IACJ,OAAO;IACP,WAAW;IAIX,aAAa;GACd;GAAA,UAAA;EAAA,CAAA;CAqD0E,CAAA;CAAA,sBAAA,CAAA;CAAA,gBAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,IAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,GAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,eAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,UAAQ,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -174,7 +174,11 @@ var WrTableHarness = class WrTableHarness extends ComponentHarness {
174
174
  return (await this.host()).hasClass("wr-table--virtual");
175
175
  }
176
176
  async isLoading() {
177
- return await this.locatorForOptional(".wr-table__loading")() !== null;
177
+ return await (await this.host()).getAttribute("aria-busy") === "true";
178
+ }
179
+ async getLoadingForm() {
180
+ if (await this.locatorForOptional(".wr-table__loading")() !== null) return "overlay";
181
+ return await this.locatorForOptional(".wr-table__loading-bar")() !== null ? "bar" : null;
178
182
  }
179
183
  async getHeaderCells(filters = {}) {
180
184
  return this.locatorForAll(WrTableHeaderCellHarness.with(filters))();
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-table-testing.mjs","names":[],"sources":["../../../projects/lib/table/testing/wr-table-harness-text.ts","../../../projects/lib/table/testing/wr-table-cell-harness.ts","../../../projects/lib/table/testing/wr-table-header-cell-harness.ts","../../../projects/lib/table/testing/wr-table-row-harness.ts","../../../projects/lib/table/testing/wr-table-harness.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\n/**\n * Collapse the whitespace inside a table cell to what a user reads on one line.\n *\n * `TestElement.text()` only trims the ends, and a `<td>` is rarely one text node:\n * the tree column puts a toggle in front of the value, a `[wrTableExpand]` detail\n * cell holds whatever the consumer projected. The template's own indentation is\n * NOT the problem — Angular's default `preserveWhitespaces: false` drops\n * whitespace-only text nodes at compile time, so `'\\n Ada\\n'` never reaches\n * `textContent`. What does reach it is whitespace inside a VALUE (`'first\\n\\n\n * programmer'` out of a textarea or an API) and, in a consumer app compiled with\n * `preserveWhitespaces: true`, the indentation after all. Every run becomes one\n * space so a spec can assert the rendered line either way.\n */\nexport function wrTableHarnessText(text: string): string {\n return text.replace(/\\s+/g, ' ').trim();\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ContentContainerComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrTableCellHarnessFilters } from './types';\nimport { wrTableHarnessText } from './wr-table-harness-text';\n\n/**\n * Test harness for one data cell of a `<wr-table>` row.\n *\n * A CONTENT CONTAINER, because a cell is where a consumer's own components end\n * up: a `[wrTableCell]` template can render a `<wr-tag>`, a button, an input, and\n * `cell.getHarness(WrButtonHarness…)` resolves those INSIDE this cell — so the\n * \"Delete\" button of row 3 cannot be mistaken for the one in row 1.\n *\n * @example\n * ```ts\n * const [row] = await table.getRows({ cellText: 'Ada' });\n * const [status] = await row.getCells({ columnTitle: 'Status' });\n *\n * expect(await status.getText()).toBe('active');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrTableCellHarness extends ContentContainerComponentHarness {\n /**\n * Data cells only. The lead selection and expand cells carry the same\n * `.wr-table__td` class — they hold the row's controls, not its data — so a cell\n * list that swept them in would no longer line up with the header list.\n */\n static hostSelector = '.wr-table__td:not(.wr-table__td--select):not(.wr-table__td--expand)';\n\n /** Build a predicate that narrows the query. */\n static with(options: WrTableCellHarnessFilters = {}): HarnessPredicate<WrTableCellHarness> {\n return new HarnessPredicate(WrTableCellHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))\n .addOption('columnTitle', options.columnTitle, (harness, title) =>\n HarnessPredicate.stringMatches(harness.getColumnTitle(), title)\n );\n }\n\n /** The cell's text, with the template's indentation collapsed to single spaces. */\n async getText(): Promise<string> {\n return wrTableHarnessText(await (await this.host()).text());\n }\n\n /**\n * The title of the column this cell belongs to.\n *\n * Read from `data-label` — the attribute responsive card mode prints in front of\n * each value — because it is the only place a cell says which column it is in.\n * The column KEY is never in the DOM at all.\n */\n async getColumnTitle(): Promise<string | null> {\n return (await this.host()).getAttribute('data-label');\n }\n\n /** Which edge the cell's column is frozen against, or `null` when it scrolls. */\n async getPin(): Promise<'left' | 'right' | null> {\n const host = await this.host();\n if (await host.hasClass('wr-table__td--pin-left')) return 'left';\n if (await host.hasClass('wr-table__td--pin-right')) return 'right';\n return null;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrTableHeaderCellHarnessFilters } from './types';\n\n/**\n * Test harness for one column header of a `<wr-table>`.\n *\n * The selector deliberately skips the two LEAD headers — selection and expand —\n * which carry the same `.wr-table__th` class but hold a checkbox or nothing at\n * all. What is left lines up index-for-index with the data columns, so a header's\n * position is its column's position.\n *\n * Columns are addressed by their TITLE here and everywhere else in this harness\n * family, never by their `columns` key: the key never reaches the DOM. Only the\n * title does — in this header and in every cell's `data-label` — so it is the one\n * handle a spec and the rendered table share.\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrTableHeaderCellHarness extends ComponentHarness {\n static hostSelector = '.wr-table__th:not(.wr-table__th--select):not(.wr-table__th--expand)';\n\n /** Build a predicate that narrows the query. */\n static with(options: WrTableHeaderCellHarnessFilters = {}): HarnessPredicate<WrTableHeaderCellHarness> {\n return new HarnessPredicate(WrTableHeaderCellHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))\n .addOption('sortable', options.sortable, async (harness, sortable) => (await harness.isSortable()) === sortable);\n }\n\n /** The column title, trimmed. The sort and filter controls are not part of it. */\n async getText(): Promise<string> {\n return (await this.locatorFor('.wr-table__title')()).text();\n }\n\n /**\n * The direction this column announces, exactly as `aria-sort` puts it — or\n * `null` when the column does not sort.\n *\n * `null` is not \"unsorted\": a sortable column with no direction announces\n * `'none'`, and only a plain column omits the attribute entirely. Claiming\n * sortability a column does not have is the bug that distinction prevents.\n *\n * Only the PRIMARY sort key announces a direction (ARIA puts `aria-sort` on one\n * header at a time), so a secondary key of a multi-column sort answers\n * `'none'` here while its arrow says otherwise. Read that one through\n * {@link getSortIndicator} and {@link getSortOrder}.\n */\n async getSortDirection(): Promise<'ascending' | 'descending' | 'none' | null> {\n const sort = await (await this.host()).getAttribute('aria-sort');\n return sort as 'ascending' | 'descending' | 'none' | null;\n }\n\n /**\n * The direction the header's indicator DRAWS — `'ascending'`, `'descending'`,\n * or `null` while the column is not sorted (or does not sort at all).\n *\n * The drawn half of the sort state, and the only half a secondary key has:\n * read from the indicator's own `--asc` / `--desc` modifier, so it answers for\n * every sorted column, where {@link getSortDirection} answers for the primary\n * one alone.\n */\n async getSortIndicator(): Promise<'ascending' | 'descending' | null> {\n const indicator = await this.locatorForOptional('wr-table-sort')();\n if (!indicator) return null;\n if (await indicator.hasClass('wr-table-sort--asc')) return 'ascending';\n if (await indicator.hasClass('wr-table-sort--desc')) return 'descending';\n return null;\n }\n\n /**\n * This column's 1-based place in the sort, or `null` when it does not sort by\n * anything right now.\n *\n * Read from the number drawn after the indicator while several columns sort.\n * A lone sorted column draws no number — a \"1\" would say nothing its arrow does\n * not — so it answers `1` from its indicator alone, and that is the one case\n * this method infers rather than reads.\n */\n async getSortOrder(): Promise<number | null> {\n const badge = await this.locatorForOptional('.wr-table__sort-order')();\n if (badge) return Number.parseInt(await badge.text(), 10);\n return (await this.getSortIndicator()) === null ? null : 1;\n }\n\n /** Whether the column offers sorting at all. */\n async isSortable(): Promise<boolean> {\n return (await this.getSortDirection()) !== null;\n }\n\n /**\n * Advance the sort one step — none → ascending → descending → none, the cycle a\n * click on the indicator drives.\n *\n * Throws on a column with no sort control rather than doing nothing: the quiet\n * version of this leaves a spec asserting an unchanged direction and passing.\n */\n async sort(): Promise<void> {\n const button = await this.locatorForOptional('.wr-table__sort-btn')();\n if (!button) {\n throw new Error(\n `WrTableHeaderCellHarness.sort(): the \"${await this.getText()}\" column has no sort control — ` +\n 'its column definition needs `sortable: true`.'\n );\n }\n await button.click();\n }\n\n /** Whether the column offers a filter dropdown (its definition carries a NON-EMPTY `filterItems`). */\n async isFilterable(): Promise<boolean> {\n return (await this.locatorForOptional('wr-table-filter')()) !== null;\n }\n\n /** Which edge the column is frozen against, or `null` when it scrolls with the rest. */\n async getPin(): Promise<'left' | 'right' | null> {\n const host = await this.host();\n if (await host.hasClass('wr-table__th--pin-left')) return 'left';\n if (await host.hasClass('wr-table__th--pin-right')) return 'right';\n return null;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ContentContainerComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrTableCellHarnessFilters, WrTableRowHarnessFilters } from './types';\nimport { WrTableCellHarness } from './wr-table-cell-harness';\n\n/**\n * Test harness for one body row of a `<wr-table>` — flat, grouped or tree.\n *\n * Also a CONTENT CONTAINER, so `row.getHarness(WrButtonHarness…)` reaches the\n * consumer's own components anywhere in the row without leaving this row.\n *\n * @example\n * ```ts\n * const [ada] = await table.getRows({ cellText: 'Ada' });\n *\n * await ada.select();\n * await (await ada.getHarness(WrButtonHarness.with({ text: 'Edit' }))).click();\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrTableRowHarness extends ContentContainerComponentHarness {\n /**\n * `.wr-table__tr` is the DATA row and nothing else.\n *\n * Everything else a `<tbody>` can hold is a `<tr>` too: the group band\n * (`.wr-table__group-row`), its subtotal row, the detail row a `[wrTableExpand]`\n * template renders, the two virtual spacers, and the \"no data\" row. Querying\n * `tbody tr` would hand every one of those back as a row with no cells.\n */\n static hostSelector = '.wr-table__tr';\n\n /** Build a predicate that narrows the query. */\n static with(options: WrTableRowHarnessFilters = {}): HarnessPredicate<WrTableRowHarness> {\n return new HarnessPredicate(WrTableRowHarness, options)\n .addOption('cellText', options.cellText, async (harness, text) => {\n for (const cell of await harness.getCellTexts()) {\n if (await HarnessPredicate.stringMatches(cell, text)) return true;\n }\n return false;\n })\n .addOption('selected', options.selected, async (harness, selected) => (await harness.isSelected()) === selected)\n .addOption('expanded', options.expanded, async (harness, expanded) => (await harness.isExpanded()) === expanded)\n .addOption('level', options.level, async (harness, level) => (await harness.getLevel()) === level);\n }\n\n private readonly selectBox = this.locatorForOptional('.wr-table__td--select input.wr-checkbox__input');\n\n /**\n * The row's disclosure control, whichever of the two the table gave it: the lead\n * button of a `[wrTableExpand]` table, or the tree toggle inside the tree column.\n * The two never coexist — a tree row owns its own disclosure, so the component\n * refuses the pair.\n *\n * `button` in the tree selector is load-bearing. A leaf renders a `<span>` with\n * the same `.wr-table__tree-toggle` class purely to hold the indent, and taking\n * that for a control would report every leaf as expandable.\n */\n private readonly disclosure = this.locatorForOptional('.wr-table__expand-btn, button.wr-table__tree-toggle');\n\n /** The row's data cells, in DOM order. The lead control cells are not cells. */\n async getCells(filters: WrTableCellHarnessFilters = {}): Promise<WrTableCellHarness[]> {\n return this.locatorForAll(WrTableCellHarness.with(filters))();\n }\n\n /** The text of every data cell, in DOM order. */\n async getCellTexts(): Promise<string[]> {\n const cells = await this.getCells();\n return Promise.all(cells.map(cell => cell.getText()));\n }\n\n /**\n * Whether the row is selected.\n *\n * Read from the `--selected` modifier, which is what the row looks like and what\n * a consumer styles against. It also means a row is not \"selected\" while\n * `rowSelection` is off, however many keys the `selection` model holds — nothing\n * on screen says otherwise.\n */\n async isSelected(): Promise<boolean> {\n return (await this.host()).hasClass('wr-table__tr--selected');\n }\n\n /** Whether the row offers a selection checkbox at all. */\n async isSelectable(): Promise<boolean> {\n return (await this.selectBox()) !== null;\n }\n\n /** Flip the row's checkbox. Throws when the table has no selection column. */\n async toggleSelection(): Promise<void> {\n const box = await this.selectBox();\n if (!box) {\n throw new Error(\n 'WrTableRowHarness.toggleSelection(): this row has no checkbox — the table needs ' +\n \"`rowSelection` set to 'single' or 'multiple'.\"\n );\n }\n await box.click();\n }\n\n /** Select the row if it is not already selected. */\n async select(): Promise<void> {\n if (!(await this.isSelected())) await this.toggleSelection();\n }\n\n /** Deselect the row if it is selected. */\n async deselect(): Promise<void> {\n if (await this.isSelected()) await this.toggleSelection();\n }\n\n /**\n * Whether the row has something to open — a detail template's disclosure, or\n * children in a tree. A tree leaf answers `false`.\n */\n async isExpandable(): Promise<boolean> {\n return (await this.disclosure()) !== null;\n }\n\n /** Whether the row is open, from the disclosure's `aria-expanded`. */\n async isExpanded(): Promise<boolean> {\n const toggle = await this.disclosure();\n return toggle !== null && (await toggle.getAttribute('aria-expanded')) === 'true';\n }\n\n /** Open or close the row. Throws when it has nothing to open. */\n async toggleExpand(): Promise<void> {\n const toggle = await this.disclosure();\n if (!toggle) {\n throw new Error(\n 'WrTableRowHarness.toggleExpand(): this row has no disclosure control — a flat table needs a ' +\n '`[wrTableExpand]` template, and a tree row with no children is a leaf.'\n );\n }\n await toggle.click();\n }\n\n /**\n * The row's depth as the table announces it — 1-based `aria-level`, `null` in a\n * flat table, where depth is not a thing that exists.\n */\n async getLevel(): Promise<number | null> {\n return this.numericAttribute('aria-level');\n }\n\n /** The row's 1-based position among its siblings (`aria-posinset`), or `null` when flat. */\n async getPosInSet(): Promise<number | null> {\n return this.numericAttribute('aria-posinset');\n }\n\n /** How many rows are in the row's sibling set, itself included (`aria-setsize`); `null` when flat. */\n async getSetSize(): Promise<number | null> {\n return this.numericAttribute('aria-setsize');\n }\n\n /**\n * The row's 1-based index in the FULL dataset (`aria-rowindex`, header included),\n * or `null` when the table is not virtualized.\n *\n * Only a windowed table publishes it, and that is precisely when it matters: the\n * rows in the DOM are a slice, so their DOM order says nothing about where they\n * sit in the data.\n */\n async getRowIndex(): Promise<number | null> {\n return this.numericAttribute('aria-rowindex');\n }\n\n private async numericAttribute(name: string): Promise<number | null> {\n const value = await (await this.host()).getAttribute(name);\n return value === null ? null : Number.parseInt(value, 10);\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate, type TestElement } from '@angular/cdk/testing';\n\nimport type { WrTableHarnessFilters, WrTableHeaderCellHarnessFilters, WrTableRowHarnessFilters } from './types';\nimport { wrTableHarnessText } from './wr-table-harness-text';\nimport { WrTableHeaderCellHarness } from './wr-table-header-cell-harness';\nimport { WrTableRowHarness } from './wr-table-row-harness';\n\n/**\n * Test harness for `<wr-table>` — the root of a small family, since a table is a\n * tree and not one control: {@link WrTableHeaderCellHarness} for a column header,\n * {@link WrTableRowHarness} for a body row, and `WrTableCellHarness` for a cell.\n *\n * Columns are addressed by their header TITLE, never by their `columns` key: the\n * key never reaches the DOM.\n *\n * What this harness deliberately does NOT do:\n * - open a column's filter dropdown. The panel is a `wr-dropdown` in the overlay\n * container, and driving it belongs to a dropdown harness rather than this one;\n * {@link WrTableHeaderCellHarness.isFilterable} reports that a column offers one.\n * - scroll a virtualized body. See {@link getRows}.\n *\n * @example\n * ```ts\n * const table = await loader.getHarness(WrTableHarness);\n *\n * expect(await table.getHeaderTexts()).toEqual(['Name', 'Role']);\n * await table.sortByColumn('Name');\n * expect(await table.getSortDirection('Name')).toBe('ascending');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrTableHarness extends ComponentHarness {\n static hostSelector = 'wr-table';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrTableHarnessFilters = {}): HarnessPredicate<WrTableHarness> {\n return new HarnessPredicate(WrTableHarness, options)\n .addOption('columnTitle', options.columnTitle, async (harness, title) => {\n for (const header of await harness.getHeaderTexts()) {\n if (await HarnessPredicate.stringMatches(header, title)) return true;\n }\n return false;\n })\n .addOption('tree', options.tree, async (harness, tree) => (await harness.isTree()) === tree);\n }\n\n private readonly tableEl = this.locatorFor('table.wr-table__table');\n private readonly selectAllBox = this.locatorForOptional('.wr-table__th--select input.wr-checkbox__input');\n\n /**\n * The role the table announces.\n *\n * A flat table sets no `role` at all, so it announces the native `table` role —\n * NOT `grid`, which would promise cell-by-cell keyboard navigation it does not\n * implement. `childrenKey` turns it into a `treegrid`, and that role is the only\n * place the hierarchy exists for a screen-reader user: the indent is decoration.\n */\n async getRole(): Promise<'treegrid' | 'table'> {\n return (await (await this.tableEl()).getAttribute('role')) === 'treegrid' ? 'treegrid' : 'table';\n }\n\n /** Whether the rows are a hierarchy rather than a flat list. */\n async isTree(): Promise<boolean> {\n return (await this.getRole()) === 'treegrid';\n }\n\n /**\n * Whether the body is WINDOWED right now.\n *\n * Read from the host modifier rather than from the input, and that is the point:\n * `virtualScroll` is a request, not a promise. The table falls back to rendering\n * every row whenever the layout stops being uniform — grouping, a detail\n * template, responsive card mode, a visible pager, a tree — so this answers what\n * actually happened.\n */\n async isVirtual(): Promise<boolean> {\n return (await this.host()).hasClass('wr-table--virtual');\n }\n\n /** Whether the loading spinner is covering the table. */\n async isLoading(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-table__loading')()) !== null;\n }\n\n /** The column headers, in render order — which `columnOrder` and a drag can change. */\n async getHeaderCells(filters: WrTableHeaderCellHarnessFilters = {}): Promise<WrTableHeaderCellHarness[]> {\n return this.locatorForAll(WrTableHeaderCellHarness.with(filters))();\n }\n\n /**\n * The column titles, in render order.\n *\n * The selection and expand headers are not columns and are not here, so this\n * list stays as wide as every row from {@link getCellTexts}.\n */\n async getHeaderTexts(): Promise<string[]> {\n const headers = await this.getHeaderCells();\n return Promise.all(headers.map(header => header.getText()));\n }\n\n /**\n * The direction a column announces via `aria-sort`, or `null` when it does not\n * sort. Only the primary key of a multi-column sort announces one; see\n * {@link getSortIndicator} for the rest.\n */\n async getSortDirection(columnTitle: string): Promise<'ascending' | 'descending' | 'none' | null> {\n return (await this.headerCellFor(columnTitle)).getSortDirection();\n }\n\n /**\n * The direction a column's indicator draws, for every sorted column — a\n * secondary key included — or `null` when the column is not sorted.\n */\n async getSortIndicator(columnTitle: string): Promise<'ascending' | 'descending' | null> {\n return (await this.headerCellFor(columnTitle)).getSortIndicator();\n }\n\n /** A column's 1-based place in the sort (`1` is the primary key), or `null` when it is not sorted. */\n async getSortOrder(columnTitle: string): Promise<number | null> {\n return (await this.headerCellFor(columnTitle)).getSortOrder();\n }\n\n /**\n * Advance a column's sort one step — none → ascending → descending → none.\n *\n * Sorting is the host's job: `<wr-table>` publishes the intent through its `sort`\n * model and never reorders `items` itself, so a spec that expects the rows to\n * move has to sort the data the way the app does.\n */\n async sortByColumn(columnTitle: string): Promise<void> {\n await (await this.headerCellFor(columnTitle)).sort();\n }\n\n /**\n * The body rows currently rendered, in DOM order.\n *\n * \"Currently rendered\" is the whole caveat of a virtualized table: while\n * {@link isVirtual} is true the `<tbody>` holds only the window around the scroll\n * offset, padded by a spacer row at each end that still has rows to stand in for\n * (one of them, at the top or the bottom of the list), so this returns the\n * WINDOW — not the dataset.\n * {@link getAriaRowCount} is the total the table announces and\n * {@link WrTableRowHarness.getRowIndex} says where a row sits in it. Nothing here\n * scrolls that window on purpose: the viewport has no layout in a unit test, so a\n * `scrollTo` would silently do nothing. Reach for `WrTable.scrollToRow()` in a\n * real browser, or narrow the data instead.\n *\n * Group bands, per-group subtotals, detail rows and the \"no data\" row are not\n * rows and never appear here.\n */\n async getRows(filters: WrTableRowHarnessFilters = {}): Promise<WrTableRowHarness[]> {\n return this.locatorForAll(WrTableRowHarness.with(filters))();\n }\n\n /** The whole body as a matrix of cell text — one array per row, one entry per column. */\n async getCellTexts(): Promise<string[][]> {\n const rows = await this.getRows();\n return Promise.all(rows.map(row => row.getCellTexts()));\n }\n\n /**\n * The `<tfoot>` summary cells, one per column and `''` for a column with no\n * `summary`. Empty when no column defines one.\n *\n * The lead cells are dropped so this lines up with {@link getHeaderTexts}. A\n * per-group subtotal row is NOT here — it lives in the body, under its band.\n */\n async getFooterTexts(): Promise<string[]> {\n const cells = await this.locatorForAll('tfoot .wr-table__foot-cell:not(.wr-table__foot-cell--lead)')();\n return Promise.all(cells.map(async cell => wrTableHarnessText(await cell.text())));\n }\n\n /** The \"no data\" message, or `null` while the table has rows to show. */\n async getEmptyText(): Promise<string | null> {\n const empty = await this.locatorForOptional('.wr-table__empty')();\n return empty ? wrTableHarnessText(await empty.text()) : null;\n }\n\n /**\n * The row count the table announces (`aria-rowcount` — header and summary row\n * included), or `null` when it is not virtualized and every row is in the DOM.\n */\n async getAriaRowCount(): Promise<number | null> {\n const count = await (await this.tableEl()).getAttribute('aria-rowcount');\n return count === null ? null : Number.parseInt(count, 10);\n }\n\n /** Whether the header offers a select-all box — only `rowSelection=\"multiple\"` does. */\n async hasSelectAll(): Promise<boolean> {\n return (await this.selectAllBox()) !== null;\n }\n\n /** Whether every row in the select-all scope is selected — see {@link toggleSelectAll}. */\n async isAllSelected(): Promise<boolean> {\n return (await this.selectAllHost()).getProperty<boolean>('checked');\n }\n\n /**\n * Whether some rows are selected and others are not — the box's third state.\n *\n * `indeterminate` is a DOM PROPERTY, not an attribute: reading the attribute\n * reports `null` for a box that is visibly dashed.\n */\n async isPartiallySelected(): Promise<boolean> {\n return (await this.selectAllHost()).getProperty<boolean>('indeterminate');\n }\n\n /**\n * Click the select-all box, once.\n *\n * Under `selectAllScope=\"all\"` its scope is every page of `items`. Otherwise\n * its scope is the rows the table RENDERS — the current page, and a collapsed\n * group's rows are out because collapsing drops them from that list. A\n * virtualized table's off-window rows are IN, though: the window is a slice\n * taken after the list is built, so one click selects the whole dataset and not\n * just what is in the DOM. And the third state is worth knowing about before\n * asserting: while the selection is partial the box reads unchecked, so one\n * click selects everything rather than clearing it.\n */\n async toggleSelectAll(): Promise<void> {\n await (await this.selectAllHost()).click();\n }\n\n /**\n * The text of each open detail row, in row order.\n *\n * A detail row is a full-width `<tr>` NEXT TO the row it belongs to, not inside\n * it — which is why it is neither one of {@link getRows} nor one of a row's\n * cells.\n */\n async getDetailTexts(): Promise<string[]> {\n const details = await this.locatorForAll('.wr-table__detail')();\n return Promise.all(details.map(async detail => wrTableHarnessText(await detail.text())));\n }\n\n /**\n * The group band labels, in order.\n *\n * Empty when `groupBy` is off — and also when a `[wrTableGroupHeader]` template\n * replaced the built-in band, since the label is then the consumer's own markup.\n * Reach for that through {@link getRows}' siblings or your own component's\n * harness.\n */\n async getGroupLabels(): Promise<string[]> {\n const labels = await this.locatorForAll('.wr-table__group-label')();\n return Promise.all(labels.map(label => label.text()));\n }\n\n /** Whether the band with this label is collapsed. */\n async isGroupCollapsed(label: string): Promise<boolean> {\n const toggle = await this.groupToggleFor(label);\n return (await toggle.getAttribute('aria-expanded')) === 'false';\n }\n\n /** Collapse or expand the band with this label. */\n async toggleGroup(label: string): Promise<void> {\n await (await this.groupToggleFor(label)).click();\n }\n\n /** The header for a column title, or a failure that says which titles do exist. */\n private async headerCellFor(columnTitle: string): Promise<WrTableHeaderCellHarness> {\n const [header] = await this.getHeaderCells({ text: columnTitle });\n if (!header) {\n const titles = await this.getHeaderTexts();\n throw new Error(\n `WrTableHarness: no column headed \"${columnTitle}\". Columns are addressed by their title, ` +\n `not by their key — this table shows [${titles.join(', ')}].`\n );\n }\n return header;\n }\n\n /**\n * The collapse toggle of one band.\n *\n * Paired by index rather than by containment: both lists are emitted once per\n * band by the same loop, in the same order, and a `TestElement` cannot be\n * queried into.\n */\n private async groupToggleFor(label: string): Promise<TestElement> {\n const index = (await this.getGroupLabels()).indexOf(label);\n if (index < 0) {\n throw new Error(\n `WrTableHarness: no group band labelled \"${label}\" — is \\`groupBy\\` set, and is the band the ` +\n 'built-in one rather than a `[wrTableGroupHeader]` template?'\n );\n }\n return (await this.locatorForAll('.wr-table__group-toggle')())[index];\n }\n\n /** The select-all input, or a failure naming both reasons it is missing. */\n private async selectAllHost(): Promise<TestElement> {\n const box = await this.selectAllBox();\n if (!box) {\n throw new Error(\n 'WrTableHarness: this table has no select-all box — `rowSelection` is off, or it is ' +\n \"'single', which has no select-all by design.\"\n );\n }\n return box;\n }\n}\n"],"mappings":";;;;;;;AAoBA,SAAgB,mBAAmB,MAAY;CAC7C,OAAO,KAAK,QAAQ,QAAQ,GAAG,CAAC,CAAC,KAAI;AACvC;;;;;;;ACQA,IAAa,qBAAb,MAAa,2BAA2B,iCAAgC;CAMtE,OAAO,eAAe;CAGtB,OAAO,KAAK,UAAqC,CAAA,GAAE;EACjD,OAAO,IAAI,iBAAiB,oBAAoB,OAAO,CAAC,CACrD,UAAU,QAAQ,QAAQ,OAAO,SAAS,SAAS,iBAAiB,cAAc,QAAQ,QAAO,GAAI,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I;CACjE;CAGQ,MAAM,gBAAa;EACzB,MAAM,MAAM,MAAM,KAAK,aAAY;EACnC,IAAI,CAAC,KACH,MAAM,IAAI,MACR,iIACgD;EAGpD,OAAO;CACT"}
1
+ {"version":3,"file":"ngwr-table-testing.mjs","names":[],"sources":["../../../projects/lib/table/testing/wr-table-harness-text.ts","../../../projects/lib/table/testing/wr-table-cell-harness.ts","../../../projects/lib/table/testing/wr-table-header-cell-harness.ts","../../../projects/lib/table/testing/wr-table-row-harness.ts","../../../projects/lib/table/testing/wr-table-harness.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\n/**\n * Collapse the whitespace inside a table cell to what a user reads on one line.\n *\n * `TestElement.text()` only trims the ends, and a `<td>` is rarely one text node:\n * the tree column puts a toggle in front of the value, a `[wrTableExpand]` detail\n * cell holds whatever the consumer projected. The template's own indentation is\n * NOT the problem — Angular's default `preserveWhitespaces: false` drops\n * whitespace-only text nodes at compile time, so `'\\n Ada\\n'` never reaches\n * `textContent`. What does reach it is whitespace inside a VALUE (`'first\\n\\n\n * programmer'` out of a textarea or an API) and, in a consumer app compiled with\n * `preserveWhitespaces: true`, the indentation after all. Every run becomes one\n * space so a spec can assert the rendered line either way.\n */\nexport function wrTableHarnessText(text: string): string {\n return text.replace(/\\s+/g, ' ').trim();\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ContentContainerComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrTableCellHarnessFilters } from './types';\nimport { wrTableHarnessText } from './wr-table-harness-text';\n\n/**\n * Test harness for one data cell of a `<wr-table>` row.\n *\n * A CONTENT CONTAINER, because a cell is where a consumer's own components end\n * up: a `[wrTableCell]` template can render a `<wr-tag>`, a button, an input, and\n * `cell.getHarness(WrButtonHarness…)` resolves those INSIDE this cell — so the\n * \"Delete\" button of row 3 cannot be mistaken for the one in row 1.\n *\n * @example\n * ```ts\n * const [row] = await table.getRows({ cellText: 'Ada' });\n * const [status] = await row.getCells({ columnTitle: 'Status' });\n *\n * expect(await status.getText()).toBe('active');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrTableCellHarness extends ContentContainerComponentHarness {\n /**\n * Data cells only. The lead selection and expand cells carry the same\n * `.wr-table__td` class — they hold the row's controls, not its data — so a cell\n * list that swept them in would no longer line up with the header list.\n */\n static hostSelector = '.wr-table__td:not(.wr-table__td--select):not(.wr-table__td--expand)';\n\n /** Build a predicate that narrows the query. */\n static with(options: WrTableCellHarnessFilters = {}): HarnessPredicate<WrTableCellHarness> {\n return new HarnessPredicate(WrTableCellHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))\n .addOption('columnTitle', options.columnTitle, (harness, title) =>\n HarnessPredicate.stringMatches(harness.getColumnTitle(), title)\n );\n }\n\n /** The cell's text, with the template's indentation collapsed to single spaces. */\n async getText(): Promise<string> {\n return wrTableHarnessText(await (await this.host()).text());\n }\n\n /**\n * The title of the column this cell belongs to.\n *\n * Read from `data-label` — the attribute responsive card mode prints in front of\n * each value — because it is the only place a cell says which column it is in.\n * The column KEY is never in the DOM at all.\n */\n async getColumnTitle(): Promise<string | null> {\n return (await this.host()).getAttribute('data-label');\n }\n\n /** Which edge the cell's column is frozen against, or `null` when it scrolls. */\n async getPin(): Promise<'left' | 'right' | null> {\n const host = await this.host();\n if (await host.hasClass('wr-table__td--pin-left')) return 'left';\n if (await host.hasClass('wr-table__td--pin-right')) return 'right';\n return null;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrTableHeaderCellHarnessFilters } from './types';\n\n/**\n * Test harness for one column header of a `<wr-table>`.\n *\n * The selector deliberately skips the two LEAD headers — selection and expand —\n * which carry the same `.wr-table__th` class but hold a checkbox or nothing at\n * all. What is left lines up index-for-index with the data columns, so a header's\n * position is its column's position.\n *\n * Columns are addressed by their TITLE here and everywhere else in this harness\n * family, never by their `columns` key: the key never reaches the DOM. Only the\n * title does — in this header and in every cell's `data-label` — so it is the one\n * handle a spec and the rendered table share.\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrTableHeaderCellHarness extends ComponentHarness {\n static hostSelector = '.wr-table__th:not(.wr-table__th--select):not(.wr-table__th--expand)';\n\n /** Build a predicate that narrows the query. */\n static with(options: WrTableHeaderCellHarnessFilters = {}): HarnessPredicate<WrTableHeaderCellHarness> {\n return new HarnessPredicate(WrTableHeaderCellHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))\n .addOption('sortable', options.sortable, async (harness, sortable) => (await harness.isSortable()) === sortable);\n }\n\n /** The column title, trimmed. The sort and filter controls are not part of it. */\n async getText(): Promise<string> {\n return (await this.locatorFor('.wr-table__title')()).text();\n }\n\n /**\n * The direction this column announces, exactly as `aria-sort` puts it — or\n * `null` when the column does not sort.\n *\n * `null` is not \"unsorted\": a sortable column with no direction announces\n * `'none'`, and only a plain column omits the attribute entirely. Claiming\n * sortability a column does not have is the bug that distinction prevents.\n *\n * Only the PRIMARY sort key announces a direction (ARIA puts `aria-sort` on one\n * header at a time), so a secondary key of a multi-column sort answers\n * `'none'` here while its arrow says otherwise. Read that one through\n * {@link getSortIndicator} and {@link getSortOrder}.\n */\n async getSortDirection(): Promise<'ascending' | 'descending' | 'none' | null> {\n const sort = await (await this.host()).getAttribute('aria-sort');\n return sort as 'ascending' | 'descending' | 'none' | null;\n }\n\n /**\n * The direction the header's indicator DRAWS — `'ascending'`, `'descending'`,\n * or `null` while the column is not sorted (or does not sort at all).\n *\n * The drawn half of the sort state, and the only half a secondary key has:\n * read from the indicator's own `--asc` / `--desc` modifier, so it answers for\n * every sorted column, where {@link getSortDirection} answers for the primary\n * one alone.\n */\n async getSortIndicator(): Promise<'ascending' | 'descending' | null> {\n const indicator = await this.locatorForOptional('wr-table-sort')();\n if (!indicator) return null;\n if (await indicator.hasClass('wr-table-sort--asc')) return 'ascending';\n if (await indicator.hasClass('wr-table-sort--desc')) return 'descending';\n return null;\n }\n\n /**\n * This column's 1-based place in the sort, or `null` when it does not sort by\n * anything right now.\n *\n * Read from the number drawn after the indicator while several columns sort.\n * A lone sorted column draws no number — a \"1\" would say nothing its arrow does\n * not — so it answers `1` from its indicator alone, and that is the one case\n * this method infers rather than reads.\n */\n async getSortOrder(): Promise<number | null> {\n const badge = await this.locatorForOptional('.wr-table__sort-order')();\n if (badge) return Number.parseInt(await badge.text(), 10);\n return (await this.getSortIndicator()) === null ? null : 1;\n }\n\n /** Whether the column offers sorting at all. */\n async isSortable(): Promise<boolean> {\n return (await this.getSortDirection()) !== null;\n }\n\n /**\n * Advance the sort one step — none → ascending → descending → none, the cycle a\n * click on the indicator drives.\n *\n * Throws on a column with no sort control rather than doing nothing: the quiet\n * version of this leaves a spec asserting an unchanged direction and passing.\n */\n async sort(): Promise<void> {\n const button = await this.locatorForOptional('.wr-table__sort-btn')();\n if (!button) {\n throw new Error(\n `WrTableHeaderCellHarness.sort(): the \"${await this.getText()}\" column has no sort control — ` +\n 'its column definition needs `sortable: true`.'\n );\n }\n await button.click();\n }\n\n /** Whether the column offers a filter dropdown (its definition carries a NON-EMPTY `filterItems`). */\n async isFilterable(): Promise<boolean> {\n return (await this.locatorForOptional('wr-table-filter')()) !== null;\n }\n\n /** Which edge the column is frozen against, or `null` when it scrolls with the rest. */\n async getPin(): Promise<'left' | 'right' | null> {\n const host = await this.host();\n if (await host.hasClass('wr-table__th--pin-left')) return 'left';\n if (await host.hasClass('wr-table__th--pin-right')) return 'right';\n return null;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ContentContainerComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrTableCellHarnessFilters, WrTableRowHarnessFilters } from './types';\nimport { WrTableCellHarness } from './wr-table-cell-harness';\n\n/**\n * Test harness for one body row of a `<wr-table>` — flat, grouped or tree.\n *\n * Also a CONTENT CONTAINER, so `row.getHarness(WrButtonHarness…)` reaches the\n * consumer's own components anywhere in the row without leaving this row.\n *\n * @example\n * ```ts\n * const [ada] = await table.getRows({ cellText: 'Ada' });\n *\n * await ada.select();\n * await (await ada.getHarness(WrButtonHarness.with({ text: 'Edit' }))).click();\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrTableRowHarness extends ContentContainerComponentHarness {\n /**\n * `.wr-table__tr` is the DATA row and nothing else.\n *\n * Everything else a `<tbody>` can hold is a `<tr>` too: the group band\n * (`.wr-table__group-row`), its subtotal row, the detail row a `[wrTableExpand]`\n * template renders, the two virtual spacers, and the \"no data\" row. Querying\n * `tbody tr` would hand every one of those back as a row with no cells.\n */\n static hostSelector = '.wr-table__tr';\n\n /** Build a predicate that narrows the query. */\n static with(options: WrTableRowHarnessFilters = {}): HarnessPredicate<WrTableRowHarness> {\n return new HarnessPredicate(WrTableRowHarness, options)\n .addOption('cellText', options.cellText, async (harness, text) => {\n for (const cell of await harness.getCellTexts()) {\n if (await HarnessPredicate.stringMatches(cell, text)) return true;\n }\n return false;\n })\n .addOption('selected', options.selected, async (harness, selected) => (await harness.isSelected()) === selected)\n .addOption('expanded', options.expanded, async (harness, expanded) => (await harness.isExpanded()) === expanded)\n .addOption('level', options.level, async (harness, level) => (await harness.getLevel()) === level);\n }\n\n private readonly selectBox = this.locatorForOptional('.wr-table__td--select input.wr-checkbox__input');\n\n /**\n * The row's disclosure control, whichever of the two the table gave it: the lead\n * button of a `[wrTableExpand]` table, or the tree toggle inside the tree column.\n * The two never coexist — a tree row owns its own disclosure, so the component\n * refuses the pair.\n *\n * `button` in the tree selector is load-bearing. A leaf renders a `<span>` with\n * the same `.wr-table__tree-toggle` class purely to hold the indent, and taking\n * that for a control would report every leaf as expandable.\n */\n private readonly disclosure = this.locatorForOptional('.wr-table__expand-btn, button.wr-table__tree-toggle');\n\n /** The row's data cells, in DOM order. The lead control cells are not cells. */\n async getCells(filters: WrTableCellHarnessFilters = {}): Promise<WrTableCellHarness[]> {\n return this.locatorForAll(WrTableCellHarness.with(filters))();\n }\n\n /** The text of every data cell, in DOM order. */\n async getCellTexts(): Promise<string[]> {\n const cells = await this.getCells();\n return Promise.all(cells.map(cell => cell.getText()));\n }\n\n /**\n * Whether the row is selected.\n *\n * Read from the `--selected` modifier, which is what the row looks like and what\n * a consumer styles against. It also means a row is not \"selected\" while\n * `rowSelection` is off, however many keys the `selection` model holds — nothing\n * on screen says otherwise.\n */\n async isSelected(): Promise<boolean> {\n return (await this.host()).hasClass('wr-table__tr--selected');\n }\n\n /** Whether the row offers a selection checkbox at all. */\n async isSelectable(): Promise<boolean> {\n return (await this.selectBox()) !== null;\n }\n\n /** Flip the row's checkbox. Throws when the table has no selection column. */\n async toggleSelection(): Promise<void> {\n const box = await this.selectBox();\n if (!box) {\n throw new Error(\n 'WrTableRowHarness.toggleSelection(): this row has no checkbox — the table needs ' +\n \"`rowSelection` set to 'single' or 'multiple'.\"\n );\n }\n await box.click();\n }\n\n /** Select the row if it is not already selected. */\n async select(): Promise<void> {\n if (!(await this.isSelected())) await this.toggleSelection();\n }\n\n /** Deselect the row if it is selected. */\n async deselect(): Promise<void> {\n if (await this.isSelected()) await this.toggleSelection();\n }\n\n /**\n * Whether the row has something to open — a detail template's disclosure, or\n * children in a tree. A tree leaf answers `false`.\n */\n async isExpandable(): Promise<boolean> {\n return (await this.disclosure()) !== null;\n }\n\n /** Whether the row is open, from the disclosure's `aria-expanded`. */\n async isExpanded(): Promise<boolean> {\n const toggle = await this.disclosure();\n return toggle !== null && (await toggle.getAttribute('aria-expanded')) === 'true';\n }\n\n /** Open or close the row. Throws when it has nothing to open. */\n async toggleExpand(): Promise<void> {\n const toggle = await this.disclosure();\n if (!toggle) {\n throw new Error(\n 'WrTableRowHarness.toggleExpand(): this row has no disclosure control — a flat table needs a ' +\n '`[wrTableExpand]` template, and a tree row with no children is a leaf.'\n );\n }\n await toggle.click();\n }\n\n /**\n * The row's depth as the table announces it — 1-based `aria-level`, `null` in a\n * flat table, where depth is not a thing that exists.\n */\n async getLevel(): Promise<number | null> {\n return this.numericAttribute('aria-level');\n }\n\n /** The row's 1-based position among its siblings (`aria-posinset`), or `null` when flat. */\n async getPosInSet(): Promise<number | null> {\n return this.numericAttribute('aria-posinset');\n }\n\n /** How many rows are in the row's sibling set, itself included (`aria-setsize`); `null` when flat. */\n async getSetSize(): Promise<number | null> {\n return this.numericAttribute('aria-setsize');\n }\n\n /**\n * The row's 1-based index in the FULL dataset (`aria-rowindex`, header included),\n * or `null` when the table is not virtualized.\n *\n * Only a windowed table publishes it, and that is precisely when it matters: the\n * rows in the DOM are a slice, so their DOM order says nothing about where they\n * sit in the data.\n */\n async getRowIndex(): Promise<number | null> {\n return this.numericAttribute('aria-rowindex');\n }\n\n private async numericAttribute(name: string): Promise<number | null> {\n const value = await (await this.host()).getAttribute(name);\n return value === null ? null : Number.parseInt(value, 10);\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate, type TestElement } from '@angular/cdk/testing';\n\nimport type { WrTableHarnessFilters, WrTableHeaderCellHarnessFilters, WrTableRowHarnessFilters } from './types';\nimport { wrTableHarnessText } from './wr-table-harness-text';\nimport { WrTableHeaderCellHarness } from './wr-table-header-cell-harness';\nimport { WrTableRowHarness } from './wr-table-row-harness';\n\n/**\n * Test harness for `<wr-table>` — the root of a small family, since a table is a\n * tree and not one control: {@link WrTableHeaderCellHarness} for a column header,\n * {@link WrTableRowHarness} for a body row, and `WrTableCellHarness` for a cell.\n *\n * Columns are addressed by their header TITLE, never by their `columns` key: the\n * key never reaches the DOM.\n *\n * What this harness deliberately does NOT do:\n * - open a column's filter dropdown. The panel is a `wr-dropdown` in the overlay\n * container, and driving it belongs to a dropdown harness rather than this one;\n * {@link WrTableHeaderCellHarness.isFilterable} reports that a column offers one.\n * - scroll a virtualized body. See {@link getRows}.\n *\n * @example\n * ```ts\n * const table = await loader.getHarness(WrTableHarness);\n *\n * expect(await table.getHeaderTexts()).toEqual(['Name', 'Role']);\n * await table.sortByColumn('Name');\n * expect(await table.getSortDirection('Name')).toBe('ascending');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrTableHarness extends ComponentHarness {\n static hostSelector = 'wr-table';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrTableHarnessFilters = {}): HarnessPredicate<WrTableHarness> {\n return new HarnessPredicate(WrTableHarness, options)\n .addOption('columnTitle', options.columnTitle, async (harness, title) => {\n for (const header of await harness.getHeaderTexts()) {\n if (await HarnessPredicate.stringMatches(header, title)) return true;\n }\n return false;\n })\n .addOption('tree', options.tree, async (harness, tree) => (await harness.isTree()) === tree);\n }\n\n private readonly tableEl = this.locatorFor('table.wr-table__table');\n private readonly selectAllBox = this.locatorForOptional('.wr-table__th--select input.wr-checkbox__input');\n\n /**\n * The role the table announces.\n *\n * A flat table sets no `role` at all, so it announces the native `table` role —\n * NOT `grid`, which would promise cell-by-cell keyboard navigation it does not\n * implement. `childrenKey` turns it into a `treegrid`, and that role is the only\n * place the hierarchy exists for a screen-reader user: the indent is decoration.\n */\n async getRole(): Promise<'treegrid' | 'table'> {\n return (await (await this.tableEl()).getAttribute('role')) === 'treegrid' ? 'treegrid' : 'table';\n }\n\n /** Whether the rows are a hierarchy rather than a flat list. */\n async isTree(): Promise<boolean> {\n return (await this.getRole()) === 'treegrid';\n }\n\n /**\n * Whether the body is WINDOWED right now.\n *\n * Read from the host modifier rather than from the input, and that is the point:\n * `virtualScroll` is a request, not a promise. The table falls back to rendering\n * every row whenever the layout stops being uniform — grouping, a detail\n * template, responsive card mode, a visible pager, a tree — so this answers what\n * actually happened.\n */\n async isVirtual(): Promise<boolean> {\n return (await this.host()).hasClass('wr-table--virtual');\n }\n\n /** Whether the table is loading, as the overlay or as the bar: the host's `aria-busy`. */\n async isLoading(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-busy')) === 'true';\n }\n\n /** Which form `loading` takes: the overlay with the spinner, the bar, or `null` while idle. */\n async getLoadingForm(): Promise<'overlay' | 'bar' | null> {\n if ((await this.locatorForOptional('.wr-table__loading')()) !== null) return 'overlay';\n return (await this.locatorForOptional('.wr-table__loading-bar')()) !== null ? 'bar' : null;\n }\n\n /** The column headers, in render order — which `columnOrder` and a drag can change. */\n async getHeaderCells(filters: WrTableHeaderCellHarnessFilters = {}): Promise<WrTableHeaderCellHarness[]> {\n return this.locatorForAll(WrTableHeaderCellHarness.with(filters))();\n }\n\n /**\n * The column titles, in render order.\n *\n * The selection and expand headers are not columns and are not here, so this\n * list stays as wide as every row from {@link getCellTexts}.\n */\n async getHeaderTexts(): Promise<string[]> {\n const headers = await this.getHeaderCells();\n return Promise.all(headers.map(header => header.getText()));\n }\n\n /**\n * The direction a column announces via `aria-sort`, or `null` when it does not\n * sort. Only the primary key of a multi-column sort announces one; see\n * {@link getSortIndicator} for the rest.\n */\n async getSortDirection(columnTitle: string): Promise<'ascending' | 'descending' | 'none' | null> {\n return (await this.headerCellFor(columnTitle)).getSortDirection();\n }\n\n /**\n * The direction a column's indicator draws, for every sorted column — a\n * secondary key included — or `null` when the column is not sorted.\n */\n async getSortIndicator(columnTitle: string): Promise<'ascending' | 'descending' | null> {\n return (await this.headerCellFor(columnTitle)).getSortIndicator();\n }\n\n /** A column's 1-based place in the sort (`1` is the primary key), or `null` when it is not sorted. */\n async getSortOrder(columnTitle: string): Promise<number | null> {\n return (await this.headerCellFor(columnTitle)).getSortOrder();\n }\n\n /**\n * Advance a column's sort one step — none → ascending → descending → none.\n *\n * Sorting is the host's job: `<wr-table>` publishes the intent through its `sort`\n * model and never reorders `items` itself, so a spec that expects the rows to\n * move has to sort the data the way the app does.\n */\n async sortByColumn(columnTitle: string): Promise<void> {\n await (await this.headerCellFor(columnTitle)).sort();\n }\n\n /**\n * The body rows currently rendered, in DOM order.\n *\n * \"Currently rendered\" is the whole caveat of a virtualized table: while\n * {@link isVirtual} is true the `<tbody>` holds only the window around the scroll\n * offset, padded by a spacer row at each end that still has rows to stand in for\n * (one of them, at the top or the bottom of the list), so this returns the\n * WINDOW — not the dataset.\n * {@link getAriaRowCount} is the total the table announces and\n * {@link WrTableRowHarness.getRowIndex} says where a row sits in it. Nothing here\n * scrolls that window on purpose: the viewport has no layout in a unit test, so a\n * `scrollTo` would silently do nothing. Reach for `WrTable.scrollToRow()` in a\n * real browser, or narrow the data instead.\n *\n * Group bands, per-group subtotals, detail rows and the \"no data\" row are not\n * rows and never appear here.\n */\n async getRows(filters: WrTableRowHarnessFilters = {}): Promise<WrTableRowHarness[]> {\n return this.locatorForAll(WrTableRowHarness.with(filters))();\n }\n\n /** The whole body as a matrix of cell text — one array per row, one entry per column. */\n async getCellTexts(): Promise<string[][]> {\n const rows = await this.getRows();\n return Promise.all(rows.map(row => row.getCellTexts()));\n }\n\n /**\n * The `<tfoot>` summary cells, one per column and `''` for a column with no\n * `summary`. Empty when no column defines one.\n *\n * The lead cells are dropped so this lines up with {@link getHeaderTexts}. A\n * per-group subtotal row is NOT here — it lives in the body, under its band.\n */\n async getFooterTexts(): Promise<string[]> {\n const cells = await this.locatorForAll('tfoot .wr-table__foot-cell:not(.wr-table__foot-cell--lead)')();\n return Promise.all(cells.map(async cell => wrTableHarnessText(await cell.text())));\n }\n\n /** The \"no data\" message, or `null` while the table has rows to show. */\n async getEmptyText(): Promise<string | null> {\n const empty = await this.locatorForOptional('.wr-table__empty')();\n return empty ? wrTableHarnessText(await empty.text()) : null;\n }\n\n /**\n * The row count the table announces (`aria-rowcount` — header and summary row\n * included), or `null` when it is not virtualized and every row is in the DOM.\n */\n async getAriaRowCount(): Promise<number | null> {\n const count = await (await this.tableEl()).getAttribute('aria-rowcount');\n return count === null ? null : Number.parseInt(count, 10);\n }\n\n /** Whether the header offers a select-all box — only `rowSelection=\"multiple\"` does. */\n async hasSelectAll(): Promise<boolean> {\n return (await this.selectAllBox()) !== null;\n }\n\n /** Whether every row in the select-all scope is selected — see {@link toggleSelectAll}. */\n async isAllSelected(): Promise<boolean> {\n return (await this.selectAllHost()).getProperty<boolean>('checked');\n }\n\n /**\n * Whether some rows are selected and others are not — the box's third state.\n *\n * `indeterminate` is a DOM PROPERTY, not an attribute: reading the attribute\n * reports `null` for a box that is visibly dashed.\n */\n async isPartiallySelected(): Promise<boolean> {\n return (await this.selectAllHost()).getProperty<boolean>('indeterminate');\n }\n\n /**\n * Click the select-all box, once.\n *\n * Under `selectAllScope=\"all\"` its scope is every page of `items`. Otherwise\n * its scope is the rows the table RENDERS — the current page, and a collapsed\n * group's rows are out because collapsing drops them from that list. A\n * virtualized table's off-window rows are IN, though: the window is a slice\n * taken after the list is built, so one click selects the whole dataset and not\n * just what is in the DOM. And the third state is worth knowing about before\n * asserting: while the selection is partial the box reads unchecked, so one\n * click selects everything rather than clearing it.\n */\n async toggleSelectAll(): Promise<void> {\n await (await this.selectAllHost()).click();\n }\n\n /**\n * The text of each open detail row, in row order.\n *\n * A detail row is a full-width `<tr>` NEXT TO the row it belongs to, not inside\n * it — which is why it is neither one of {@link getRows} nor one of a row's\n * cells.\n */\n async getDetailTexts(): Promise<string[]> {\n const details = await this.locatorForAll('.wr-table__detail')();\n return Promise.all(details.map(async detail => wrTableHarnessText(await detail.text())));\n }\n\n /**\n * The group band labels, in order.\n *\n * Empty when `groupBy` is off — and also when a `[wrTableGroupHeader]` template\n * replaced the built-in band, since the label is then the consumer's own markup.\n * Reach for that through {@link getRows}' siblings or your own component's\n * harness.\n */\n async getGroupLabels(): Promise<string[]> {\n const labels = await this.locatorForAll('.wr-table__group-label')();\n return Promise.all(labels.map(label => label.text()));\n }\n\n /** Whether the band with this label is collapsed. */\n async isGroupCollapsed(label: string): Promise<boolean> {\n const toggle = await this.groupToggleFor(label);\n return (await toggle.getAttribute('aria-expanded')) === 'false';\n }\n\n /** Collapse or expand the band with this label. */\n async toggleGroup(label: string): Promise<void> {\n await (await this.groupToggleFor(label)).click();\n }\n\n /** The header for a column title, or a failure that says which titles do exist. */\n private async headerCellFor(columnTitle: string): Promise<WrTableHeaderCellHarness> {\n const [header] = await this.getHeaderCells({ text: columnTitle });\n if (!header) {\n const titles = await this.getHeaderTexts();\n throw new Error(\n `WrTableHarness: no column headed \"${columnTitle}\". Columns are addressed by their title, ` +\n `not by their key — this table shows [${titles.join(', ')}].`\n );\n }\n return header;\n }\n\n /**\n * The collapse toggle of one band.\n *\n * Paired by index rather than by containment: both lists are emitted once per\n * band by the same loop, in the same order, and a `TestElement` cannot be\n * queried into.\n */\n private async groupToggleFor(label: string): Promise<TestElement> {\n const index = (await this.getGroupLabels()).indexOf(label);\n if (index < 0) {\n throw new Error(\n `WrTableHarness: no group band labelled \"${label}\" — is \\`groupBy\\` set, and is the band the ` +\n 'built-in one rather than a `[wrTableGroupHeader]` template?'\n );\n }\n return (await this.locatorForAll('.wr-table__group-toggle')())[index];\n }\n\n /** The select-all input, or a failure naming both reasons it is missing. */\n private async selectAllHost(): Promise<TestElement> {\n const box = await this.selectAllBox();\n if (!box) {\n throw new Error(\n 'WrTableHarness: this table has no select-all box — `rowSelection` is off, or it is ' +\n \"'single', which has no select-all by design.\"\n );\n }\n return box;\n }\n}\n"],"mappings":";;;;;;;AAoBA,SAAgB,mBAAmB,MAAY;CAC7C,OAAO,KAAK,QAAQ,QAAQ,GAAG,CAAC,CAAC,KAAI;AACvC;;;;;;;ACQA,IAAa,qBAAb,MAAa,2BAA2B,iCAAgC;CAMtE,OAAO,eAAe;CAGtB,OAAO,KAAK,UAAqC,CAAA,GAAE;EACjD,OA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