ngwr 16.3.0 → 16.4.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 (142) hide show
  1. package/carousel/styles/_index.scss +53 -1
  2. package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
  3. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  4. package/fesm2022/ngwr-carousel-testing.mjs +24 -1
  5. package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
  6. package/fesm2022/ngwr-carousel.mjs +67 -4
  7. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  8. package/fesm2022/ngwr-cascader.mjs +10 -23
  9. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  10. package/fesm2022/ngwr-context-menu.mjs +16 -1
  11. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  12. package/fesm2022/ngwr-dropdown.mjs +18 -4
  13. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  14. package/fesm2022/ngwr-file-upload.mjs +7 -3
  15. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  16. package/fesm2022/ngwr-graph-testing.mjs +27 -0
  17. package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
  18. package/fesm2022/ngwr-graph.mjs +568 -7
  19. package/fesm2022/ngwr-graph.mjs.map +1 -1
  20. package/fesm2022/ngwr-i18n-ar.mjs +8 -4
  21. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  22. package/fesm2022/ngwr-i18n-cs.mjs +8 -4
  23. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  24. package/fesm2022/ngwr-i18n-de.mjs +8 -4
  25. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  26. package/fesm2022/ngwr-i18n-en.mjs +8 -4
  27. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  28. package/fesm2022/ngwr-i18n-es.mjs +8 -4
  29. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  30. package/fesm2022/ngwr-i18n-fr.mjs +8 -4
  31. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  32. package/fesm2022/ngwr-i18n-he.mjs +8 -4
  33. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  34. package/fesm2022/ngwr-i18n-hi.mjs +8 -4
  35. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  36. package/fesm2022/ngwr-i18n-id.mjs +8 -4
  37. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  38. package/fesm2022/ngwr-i18n-it.mjs +8 -4
  39. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  40. package/fesm2022/ngwr-i18n-ja.mjs +8 -4
  41. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  42. package/fesm2022/ngwr-i18n-ko.mjs +8 -4
  43. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  44. package/fesm2022/ngwr-i18n-nl.mjs +8 -4
  45. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  46. package/fesm2022/ngwr-i18n-pl.mjs +8 -4
  47. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  48. package/fesm2022/ngwr-i18n-pt.mjs +8 -4
  49. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  50. package/fesm2022/ngwr-i18n-ru.mjs +8 -4
  51. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  52. package/fesm2022/ngwr-i18n-sv.mjs +8 -4
  53. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  54. package/fesm2022/ngwr-i18n-tr.mjs +8 -4
  55. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  56. package/fesm2022/ngwr-i18n-uk.mjs +8 -4
  57. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  58. package/fesm2022/ngwr-i18n-vi.mjs +8 -4
  59. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  60. package/fesm2022/ngwr-i18n-zh-tw.mjs +8 -4
  61. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  62. package/fesm2022/ngwr-i18n-zh.mjs +8 -4
  63. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  64. package/fesm2022/ngwr-lightbox.mjs +2 -2
  65. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  66. package/fesm2022/ngwr-list.mjs +2 -2
  67. package/fesm2022/ngwr-list.mjs.map +1 -1
  68. package/fesm2022/ngwr-pagination.mjs +1 -0
  69. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  70. package/fesm2022/ngwr-schema-form.mjs +1 -0
  71. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  72. package/fesm2022/ngwr-select.mjs +100 -3
  73. package/fesm2022/ngwr-select.mjs.map +1 -1
  74. package/fesm2022/ngwr-sortable-list.mjs +2 -2
  75. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  76. package/fesm2022/ngwr-table-testing.mjs +71 -3
  77. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  78. package/fesm2022/ngwr-table.mjs +171 -11
  79. package/fesm2022/ngwr-table.mjs.map +1 -1
  80. package/fesm2022/ngwr-tour-testing.mjs +13 -1
  81. package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
  82. package/fesm2022/ngwr-tour.mjs +13 -9
  83. package/fesm2022/ngwr-tour.mjs.map +1 -1
  84. package/fesm2022/ngwr-tree.mjs +12 -1
  85. package/fesm2022/ngwr-tree.mjs.map +1 -1
  86. package/fesm2022/ngwr-utils.mjs +64 -1
  87. package/fesm2022/ngwr-utils.mjs.map +1 -1
  88. package/fesm2022/ngwr-version.mjs +1 -1
  89. package/fesm2022/ngwr-version.mjs.map +1 -1
  90. package/graph/styles/_index.scss +87 -0
  91. package/i18n/ar.json +8 -4
  92. package/i18n/cs.json +8 -4
  93. package/i18n/de.json +8 -4
  94. package/i18n/en.json +8 -4
  95. package/i18n/es.json +8 -4
  96. package/i18n/fr.json +8 -4
  97. package/i18n/he.json +8 -4
  98. package/i18n/hi.json +8 -4
  99. package/i18n/id.json +8 -4
  100. package/i18n/it.json +8 -4
  101. package/i18n/ja.json +8 -4
  102. package/i18n/ko.json +8 -4
  103. package/i18n/nl.json +8 -4
  104. package/i18n/pl.json +8 -4
  105. package/i18n/pt.json +8 -4
  106. package/i18n/ru.json +8 -4
  107. package/i18n/sv.json +8 -4
  108. package/i18n/tr.json +8 -4
  109. package/i18n/uk.json +8 -4
  110. package/i18n/vi.json +8 -4
  111. package/i18n/zh-TW.json +8 -4
  112. package/i18n/zh.json +8 -4
  113. package/llms-full.txt +4 -4
  114. package/llms.txt +57 -24
  115. package/package.json +1 -1
  116. package/schematics/collection.json +5 -0
  117. package/schematics/eject/index.js +158 -0
  118. package/schematics/eject/schema.js +8 -0
  119. package/schematics/eject/schema.json +24 -0
  120. package/schematics/eject/source.js +295 -0
  121. package/schematics/use/symbol-map.json +1 -0
  122. package/select/styles/_index.scss +13 -0
  123. package/skills/ngwr/SKILL.md +30 -3
  124. package/skills/ngwr/references/catalog.md +1 -1
  125. package/table/styles/_index.scss +24 -0
  126. package/theme/styles/_focus.scss +11 -1
  127. package/types/ngwr-carousel-testing.d.ts +27 -6
  128. package/types/ngwr-carousel.d.ts +42 -6
  129. package/types/ngwr-cascader.d.ts +3 -5
  130. package/types/ngwr-context-menu.d.ts +2 -0
  131. package/types/ngwr-dropdown.d.ts +2 -0
  132. package/types/ngwr-file-upload.d.ts +8 -2
  133. package/types/ngwr-graph-testing.d.ts +28 -0
  134. package/types/ngwr-graph.d.ts +247 -91
  135. package/types/ngwr-select.d.ts +37 -0
  136. package/types/ngwr-table-testing.d.ts +52 -1
  137. package/types/ngwr-table.d.ts +101 -9
  138. package/types/ngwr-tour-testing.d.ts +10 -0
  139. package/types/ngwr-tour.d.ts +11 -2
  140. package/types/ngwr-tree.d.ts +2 -0
  141. package/types/ngwr-utils.d.ts +79 -1
  142. package/types/ngwr-version.d.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-list.mjs","names":[],"sources":["../../../projects/lib/list/list.ts","../../../projects/lib/list/list-item.ts","../../../projects/lib/list/list-item.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 { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\n/**\n * Generic list container. Renders `<ul role=\"list\">` with optional\n * borders, dividers between items, and dense (compact) padding. Project\n * `<wr-list-item>` children — they pick up the container's settings\n * through CSS cascade, no DI needed.\n *\n * @example\n * ```html\n * <wr-list bordered dividers>\n * <wr-list-item>\n * <wr-icon ngProjectAs=\"[wrListItemLeading]\" name=\"folder\" />\n * Reports\n * <span ngProjectAs=\"[wrListItemTrailing]\">12</span>\n * </wr-list-item>\n * <wr-list-item interactive (click)=\"open(item)\">\n * Click anywhere on this row\n * </wr-list-item>\n * </wr-list>\n * ```\n *\n * @see https://ngwr.dev/reference/components/list\n */\n@Component({\n selector: 'wr-list',\n // The label goes on the `<ul role=\"list\">`, not on the host. `<wr-list>` is a\n // role-less generic element, and ARIA 1.2 prohibits `aria-label` on one — so\n // the attribute was legal-looking, axe-reportable (`aria-prohibited-attr`)\n // and, worse, silent: the list it was written for stayed nameless, and a page\n // with three of them announced three identical unnamed lists.\n template: '<ul class=\"wr-list__items\" role=\"list\" [attr.aria-label]=\"ariaLabel() || null\"><ng-content /></ul>',\n styleUrl: './list.scss',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-list',\n '[class]': 'classes()',\n },\n})\nexport class WrList {\n /** Wrap the list in a card-style border + radius. @default false */\n readonly bordered = input(false, { transform: coerceBooleanProperty });\n\n /** Draw a thin divider between items. @default false */\n readonly dividers = input(false, { transform: coerceBooleanProperty });\n\n /** Use compact padding on every item. @default false */\n readonly dense = input(false, { transform: coerceBooleanProperty });\n\n /** Optional accessible label for the list. */\n readonly ariaLabel = input<string>('');\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n if (this.bordered()) parts.push('wr-list--bordered');\n if (this.dividers()) parts.push('wr-list--dividers');\n if (this.dense()) parts.push('wr-list--dense');\n return parts.join(' ');\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 { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Row inside `<wr-list>`. Three projection slots:\n *\n * - `[wrListItemLeading]` — icon, avatar, status dot, etc.\n * - default — main label / body\n * - `[wrListItemTrailing]` — meta value, action button, chevron\n *\n * Set `interactive` to get hover and cursor styles, a tab stop, and Enter /\n * Space activation. The role stays `listitem`: the row lives inside a\n * `<ul role=\"list\">`, where a `button` or `option` child role would break the\n * structure the container promises. That means an interactive row ANNOUNCES as\n * a list item rather than as a control — deliberate, but worth knowing when the\n * whole row is the only way to reach an action. Where the action needs to be\n * announced as one, project a real button into `[wrListItemTrailing]`.\n *\n * @example\n * ```html\n * <wr-list-item>Plain row</wr-list-item>\n *\n * <wr-list-item interactive (click)=\"onPick(item)\">\n * <wr-icon ngProjectAs=\"[wrListItemLeading]\" name=\"folder\" />\n * Reports\n * <span ngProjectAs=\"[wrListItemTrailing]\">12</span>\n * </wr-list-item>\n * ```\n */\n@Component({\n selector: 'wr-list-item',\n templateUrl: './list-item.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-list__item',\n '[class]': 'classes()',\n role: 'listitem',\n '[attr.tabindex]': 'interactive() ? \"0\" : null',\n '[attr.aria-disabled]': 'disabled() || null',\n '(keydown.enter)': 'onActivate($event)',\n '(keydown.space)': 'onActivate($event)',\n },\n})\nexport class WrListItem {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('list');\n }\n\n /** Adds hover / cursor styles + keyboard activation. @default false */\n readonly interactive = input(false, { transform: coerceBooleanProperty });\n\n /** Visual disabled state. Suppresses hover + keyboard activation. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n if (this.interactive()) parts.push('wr-list__item--interactive');\n if (this.disabled()) parts.push('wr-list__item--disabled');\n return parts.join(' ');\n });\n\n protected onActivate(event: Event): void {\n if (!this.interactive() || this.disabled()) return;\n event.preventDefault();\n (event.currentTarget as HTMLElement).click();\n }\n}\n","<span class=\"wr-list__leading\"><ng-content select=\"[wrListItemLeading]\" /></span>\n<span class=\"wr-list__body\"><ng-content /></span>\n<span class=\"wr-list__trailing\"><ng-content select=\"[wrListItemTrailing]\" /></span>\n"],"mappings":";;;;;;;;;;AA+CA,IAAa,SAAb,MAAa,OAAM;CAER,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAG1D,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAG1D,QAAQ,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,QAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAGvD,YAAY,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAEnB,UAAU,eAAc;EACzC,MAAM,QAAkB,CAAA;EACxB,IAAI,KAAK,SAAQ,GAAI,MAAM,KAAK,mBAAmB;EACnD,IAAI,KAAK,SAAQ,GAAI,MAAM,KAAK,mBAAmB;EACnD,IAAI,KAAK,MAAK,GAAI,MAAM,KAAK,gBAAgB;EAC7C,OAAO,MAAM,KAAK,GAAG;CACvB,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAnBS,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA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;IACX,MAAM;IACN,mBAAmB;IACnB,wBAAwB;IACxB,mBAAmB;IACnB,mBAAmB;GACpB;GAAA,UAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"ngwr-list.mjs","names":[],"sources":["../../../projects/lib/list/list.ts","../../../projects/lib/list/list-item.ts","../../../projects/lib/list/list-item.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 { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\n/**\n * Generic list container. Renders `<ul role=\"list\">` with optional\n * borders, dividers between items, and dense (compact) padding. Project\n * `<wr-list-item>` children — they pick up the container's settings\n * through CSS cascade, no DI needed.\n *\n * @example\n * ```html\n * <wr-list bordered dividers>\n * <wr-list-item>\n * <wr-icon ngProjectAs=\"[wrListItemLeading]\" name=\"folder\" />\n * Reports\n * <span ngProjectAs=\"[wrListItemTrailing]\">12</span>\n * </wr-list-item>\n * <wr-list-item interactive (click)=\"open(item)\">\n * Click anywhere on this row\n * </wr-list-item>\n * </wr-list>\n * ```\n *\n * @see https://ngwr.dev/reference/components/list\n */\n@Component({\n selector: 'wr-list',\n // The label goes on the `<ul role=\"list\">`, not on the host. `<wr-list>` is a\n // role-less generic element, and ARIA 1.2 prohibits `aria-label` on one — so\n // the attribute was legal-looking, axe-reportable (`aria-prohibited-attr`)\n // and, worse, silent: the list it was written for stayed nameless, and a page\n // with three of them announced three identical unnamed lists.\n template: '<ul class=\"wr-list__items\" role=\"list\" [attr.aria-label]=\"ariaLabel() || null\"><ng-content /></ul>',\n styleUrl: './list.scss',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-list',\n '[class]': 'classes()',\n },\n})\nexport class WrList {\n /** Wrap the list in a card-style border + radius. @default false */\n readonly bordered = input(false, { transform: coerceBooleanProperty });\n\n /** Draw a thin divider between items. @default false */\n readonly dividers = input(false, { transform: coerceBooleanProperty });\n\n /** Use compact padding on every item. @default false */\n readonly dense = input(false, { transform: coerceBooleanProperty });\n\n /** Optional accessible label for the list. */\n readonly ariaLabel = input<string>('');\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n if (this.bordered()) parts.push('wr-list--bordered');\n if (this.dividers()) parts.push('wr-list--dividers');\n if (this.dense()) parts.push('wr-list--dense');\n return parts.join(' ');\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 { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Row inside `<wr-list>`. Three projection slots:\n *\n * - `[wrListItemLeading]` — icon, avatar, status dot, etc.\n * - default — main label / body\n * - `[wrListItemTrailing]` — meta value, action button, chevron\n *\n * Set `interactive` to get hover and cursor styles, a tab stop, and Enter /\n * Space activation. The role stays `listitem`: the row lives inside a\n * `<ul role=\"list\">`, where a `button` or `option` child role would break the\n * structure the container promises. That means an interactive row ANNOUNCES as\n * a list item rather than as a control — deliberate, but worth knowing when the\n * whole row is the only way to reach an action. Where the action needs to be\n * announced as one, project a real button into `[wrListItemTrailing]`.\n *\n * @example\n * ```html\n * <wr-list-item>Plain row</wr-list-item>\n *\n * <wr-list-item interactive (click)=\"onPick(item)\">\n * <wr-icon ngProjectAs=\"[wrListItemLeading]\" name=\"folder\" />\n * Reports\n * <span ngProjectAs=\"[wrListItemTrailing]\">12</span>\n * </wr-list-item>\n * ```\n */\n@Component({\n selector: 'wr-list-item',\n templateUrl: './list-item.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-list__item',\n '[class]': 'classes()',\n role: 'listitem',\n '[attr.tabindex]': 'interactive() ? \"0\" : null',\n '[attr.aria-disabled]': 'disabled() || null',\n '(keydown.enter)': 'onActivate($event)',\n '(keydown.space)': 'onActivate($event)',\n },\n})\nexport class WrListItem {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('list');\n }\n\n /** Adds hover / cursor styles + keyboard activation. @default false */\n readonly interactive = input(false, { transform: coerceBooleanProperty });\n\n /** Visual disabled state. Suppresses hover + keyboard activation. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n if (this.interactive()) parts.push('wr-list__item--interactive');\n if (this.disabled()) parts.push('wr-list__item--disabled');\n return parts.join(' ');\n });\n\n protected onActivate(event: Event): void {\n if (!this.interactive() || this.disabled()) return;\n event.preventDefault();\n (event.currentTarget as HTMLElement).click();\n }\n}\n","<span class=\"wr-list__leading\"><ng-content select=\"[wrListItemLeading]\" /></span>\n<span class=\"wr-list__body\"><ng-content /></span>\n<span class=\"wr-list__trailing\"><ng-content select=\"[wrListItemTrailing]\" /></span>\n"],"mappings":";;;;;;;;;;AA+CA,IAAa,SAAb,MAAa,OAAM;CAER,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAG1D,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAG1D,QAAQ,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,QAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAGvD,YAAY,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAEnB,UAAU,eAAc;EACzC,MAAM,QAAkB,CAAA;EACxB,IAAI,KAAK,SAAQ,GAAI,MAAM,KAAK,mBAAmB;EACnD,IAAI,KAAK,SAAQ,GAAI,MAAM,KAAK,mBAAmB;EACnD,IAAI,KAAK,MAAK,GAAI,MAAM,KAAK,gBAAgB;EAC7C,OA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SAAA;CAAA,UAAA;CAAA,MAAA;CAAU,YAAA,CAAA;EAdtB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAc,eAET,kBAAkB;GAAI,MAC/B;IACJ,OAAO;IACP,WAAW;IACX,MAAM;IACN,mBAAmB;IACnB,wBAAwB;IACxB,mBAAmB;IACnB,mBAAmB;GACpB;GAAA,UAAA;EAAA,CAAA"}
@@ -321,6 +321,7 @@ var WrPagination = class WrPagination {
321
321
  "loadErrorText",
322
322
  "retryable",
323
323
  "retryText",
324
+ "resultsText",
324
325
  "loading",
325
326
  "separators",
326
327
  "allowDuplicates",
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-pagination.mjs","names":[],"sources":["../../../projects/lib/pagination/pagination.ts","../../../projects/lib/pagination/pagination.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 { Component, LOCALE_ID, ViewEncapsulation, computed, effect, inject, input, model } from '@angular/core';\n\nimport { WrButton } from 'ngwr/button';\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { WrOption, WrSelect } from 'ngwr/select';\nimport { wrNumAttr, wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrPaginationAlign, WrPaginationShape, WrPaginationSize } from './types';\n\nconst ELLIPSIS = '…' as const;\ntype PageEntry = number | typeof ELLIPSIS;\n\n/**\n * Numbered page navigator with optional total / page-size controls.\n *\n * Two-way binds `page` and `pageSize` via signal `model()` inputs.\n *\n * @example\n * ```html\n * <wr-pagination\n * [total]=\"120\"\n * [(page)]=\"page\"\n * [(pageSize)]=\"size\"\n * showTotal\n * showSizeChanger\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/pagination\n */\n@Component({\n selector: 'wr-pagination',\n templateUrl: './pagination.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-pagination', '[class]': 'classes()', role: 'navigation', '[attr.aria-label]': 'navLabel()' },\n imports: [WrButton, WrSelect, WrOption],\n})\nexport class WrPagination {\n /**\n * Currently displayed page (1-based). Two-way bindable.\n *\n * `page` rather than `currentPage` since v14, so this and `<wr-table>` — which\n * renders one of these in its own footer — spell the two concepts they share\n * one way each. It also names the output: a `model()` called `X` forces\n * `(XChange)`, so the old name produced `(currentPageChange)` against the\n * table's `(pageChange)`.\n */\n readonly page = model<number>(1);\n\n /** Items per page. Two-way bindable. */\n readonly pageSize = model<number>(10);\n\n /** Total item count across all pages. */\n readonly total = input(0, { transform: wrNumAttr(0) });\n\n /** Options shown in the page-size dropdown. */\n readonly pageSizeOptions = input<readonly number[]>([10, 20, 50, 100]);\n\n /** Render the page-size dropdown. @default false */\n readonly showSizeChanger = input(false, { transform: coerceBooleanProperty });\n\n /** Render the \"X–Y of Z\" total label. @default false */\n readonly showTotal = input(false, { transform: coerceBooleanProperty });\n\n /** Horizontal alignment. @default 'start' */\n readonly align = input<WrPaginationAlign>('start');\n\n /** Size variant — cascades to every internal button. @default 'sm' */\n readonly size = input<WrPaginationSize>('sm');\n\n /** Cell corner treatment. @default 'rounded' */\n readonly shape = input<WrPaginationShape>('rounded');\n\n /** Disable interaction. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Collapse to a compact `‹ page / total ›` pager when the control's own box\n * is too narrow for the full numbered strip (a container query on its own\n * width, not the viewport). @default false\n */\n readonly responsive = input(false, { transform: coerceBooleanProperty });\n\n /** Previous-page button aria-label. Falls back to `pagination.prev`. */\n readonly prevLabel = input<string | null>(null);\n\n /** Next-page button aria-label. Falls back to `pagination.next`. */\n readonly nextLabel = input<string | null>(null);\n\n /** \"Items per page\" label. Falls back to `pagination.itemsPerPage`. */\n readonly itemsPerPageLabel = input<string | null>(null);\n\n /** Accessible name for the `role=\"navigation\"` host. Falls back to `pagination.label`. */\n readonly label = input<string | null>(null);\n\n /** Resolved labels. */\n protected readonly resolvedPrev = useI18nText(this.prevLabel, 'pagination.prev', 'Previous page');\n protected readonly resolvedNext = useI18nText(this.nextLabel, 'pagination.next', 'Next page');\n protected readonly resolvedItemsPerPage = useI18nText(\n this.itemsPerPageLabel,\n 'pagination.itemsPerPage',\n 'Items per page'\n );\n\n /**\n * Page-size option text — interpolates `{{size}}`. Was the template literal\n * `{{ option }} / page`, which no catalog could reach, so a Russian UI read\n * \"25 / page\".\n */\n protected readonly perPage = useI18nFormatter('pagination.perPage', '{{size}} / page');\n\n /** Per-page-button aria-label — interpolates `{{page}}`. */\n protected readonly goToPage = useI18nFormatter('pagination.goToPage', 'Go to page {{page}}');\n\n /** The nav landmark's own accessible name — was a hardcoded English literal. */\n protected readonly navLabel = useI18nText(this.label, 'pagination.label', 'Pagination');\n\n /** Internal: total page count. */\n /**\n * A page size that is not a positive number yields ONE page, not `Infinity`.\n *\n * `pageSize` is a `model()`, so Angular offers no `transform` to coerce it and\n * whatever the host writes arrives raw. At 0 the division is `Infinity`,\n * `Math.max(1, …)` keeps it, and the item list below pushes `total` as the\n * last page — so the strip rendered a clickable cell reading \"Infinity\", and\n * clicking it locked the tab. `NaN` (a `pageSize` bound to an emptied number\n * field) came through untouched for the same reason.\n *\n * One page is the honest answer: a size of zero describes no paging at all.\n * Note this is about `pageSize` and does NOT touch the recorded contract\n * about `total` — pagination still refuses to pull the page DOWN while\n * `total` is at or below zero, because 0 is ambiguous with \"still loading\".\n */\n private readonly usablePageSize = computed(() => {\n const size = this.pageSize();\n if (Number.isFinite(size) && size >= 1) return size;\n // Everything on one page. Deliberately not `Infinity`, which gives the\n // right page COUNT by accident and then puts `Infinity` in the range label\n // the moment `page` is above 1.\n return Math.max(1, this.total());\n });\n\n protected readonly totalPages = computed(() => Math.max(1, Math.ceil(this.total() / this.usablePageSize())));\n\n /**\n * Internal: where the previous arrow goes. Clamped to the end of the valid\n * range rather than being a plain `page() - 1`, because the page can\n * legitimately sit past that end while `total` is 0 (see the guard effect).\n * From page 5 of one page, `goTo(4)` is refused as out of range, so the arrow\n * was enabled and did nothing — and under `responsive` on a narrow box the\n * numbered cells are hidden by a container query, which left no way back at\n * all. `Math.min` only ever moves the target INWARD, so `goTo`'s own\n * past-the-end refusal keeps working as the backstop it is.\n */\n protected readonly prevPage = computed(() => Math.min(this.page() - 1, this.totalPages()));\n\n /**\n * Internal: the \"1–10 of 235\" line, as ONE catalog template.\n *\n * It used to be `` `${start}-${end} ${of} ${total}` ``, which localised the\n * word in the middle and nothing else: the ASCII hyphen between the bounds and\n * the operand order were both frozen in TypeScript, so ja-JP and ar-SA got\n * English word order and no language could change the range separator. The\n * three numbers go through `Intl.NumberFormat` for the same reason the total\n * beside them does — a five-figure total needs the locale's grouping, and\n * ar-SA needs its own digits.\n *\n * The `ofLabel` input is gone with it: an input for the middle word is the\n * concatenation, re-offered as API.\n */\n protected readonly rangeLabel = computed(() => {\n // The same guarded size, or the range label reads \"1 – NaN of 100\".\n const size = this.usablePageSize();\n const start = this.total() === 0 ? 0 : (this.page() - 1) * size + 1;\n const end = Math.min(this.page() * size, this.total());\n return this.rangeText({\n from: this.number(start),\n to: this.number(end),\n total: this.number(this.total()),\n });\n });\n\n /** Internal: the compact pager's `1 / 24`, likewise a catalog template. */\n protected readonly compactLabel = computed(() =>\n this.compactText({ current: this.number(this.page()), total: this.number(this.totalPages()) })\n );\n\n private readonly rangeText = useI18nFormatter('pagination.range', '{{from}}–{{to}} of {{total}}');\n private readonly compactText = useI18nFormatter('pagination.compact', '{{current}} / {{total}}');\n\n private readonly locale = inject(LOCALE_ID);\n\n /**\n * Grouped per `LOCALE_ID`. Only the range and the compact pager go through\n * this — a page NUMBER on a button is an identifier, and `1,024` on a button\n * reads as two things.\n */\n private number(value: number): string {\n return new Intl.NumberFormat(this.locale).format(value);\n }\n\n /**\n * Internal: page list with ellipses. Window of 7 visible page slots.\n *\n * 1 … 5 6 [7] 8 9 … 20\n */\n protected readonly pages = computed<readonly PageEntry[]>(() => {\n const total = this.totalPages();\n const current = this.page();\n\n if (total <= 7) {\n return Array.from({ length: total }, (_, i) => i + 1);\n }\n\n const items: PageEntry[] = [1];\n if (current > 4) items.push(ELLIPSIS);\n\n let start: number;\n let end: number;\n if (current <= 4) {\n start = 2;\n end = 5;\n } else if (current >= total - 3) {\n start = total - 4;\n end = total - 1;\n } else {\n start = current - 2;\n end = current + 2;\n }\n\n for (let i = start; i <= end; i++) items.push(i);\n if (current < total - 3) items.push(ELLIPSIS);\n if (end !== total) items.push(total);\n\n return items;\n });\n\n protected readonly ellipsis = ELLIPSIS;\n\n protected readonly classes = computed(() => {\n const parts = [`wr-pagination--${this.align()}`, `wr-pagination--${this.size()}`, `wr-pagination--${this.shape()}`];\n if (this.disabled()) parts.push('wr-pagination--disabled');\n if (this.responsive()) parts.push('wr-pagination--responsive');\n return parts.join(' ');\n });\n\n protected isCurrent(page: number): boolean {\n return this.page() === page;\n }\n\n protected goTo(page: number | typeof ELLIPSIS): void {\n if (typeof page !== 'number') return;\n if (this.disabled() || page < 1 || page > this.totalPages() || page === this.page()) return;\n this.page.set(page);\n }\n\n /**\n * `wr-select` carries an `unknown` value by design, so the size arrives\n * untyped and is narrowed here. It used to arrive as `any` through\n * `[ngModel]`, which hid the coercion rather than removing the need for it.\n */\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('pagination');\n // `page` is a plain `model` — a `model()` takes no transform — so a\n // shrinking `total` and a host `[(page)]` write both land in it\n // unchecked. The guard used to read and write the page inside `untracked()`\n // and pull DOWNWARDS only, so it fired when `total` / `pageSize` moved and\n // never when the host wrote: past the end no cell carries `aria-current`,\n // the arrow at that end stays enabled and inert (`goTo` refuses the step\n // rather than correcting the stored page), and below 1 `rangeLabel()` counts\n // backwards (\"-9-0 of 120\"). Two-sided and tracked, the same shape\n // `wr-stepper` and `wr-carousel` use for their own host-owned `model()`.\n //\n // Only the UPPER bound is conditional. A `total` at or below 0 is the one\n // value where pulling the page down is destructive rather than cosmetic:\n // there is no `loading` input, so 0 is genuinely ambiguous between \"the\n // list is empty\" and \"the page is still in flight\", and the second is the\n // ordinary state of a server-paged host — Angular's `resource` drops its\n // value whenever the params change, and a params function returning an\n // object literal is never reference-equal, so `total` reads 0 between the\n // click and the response. `totalPages()` is 1 there, so the guard pulled\n // every page above the first back to 1 and emitted a `pageChange`\n // the host could not tell from a click: the pager could not leave page 1,\n // and each click cost two events. A negative `total` is folded into the\n // same branch because it is as meaningless as a zero one.\n //\n // The LOWER bound is unconditional, and gating it on `total` was a mistake\n // in the first cut of this fix: no value of `total` makes page 0 correct,\n // and while it was skipped a host write of -3 survived — `rangeLabel()`\n // guards `start` for an empty total and not `end`, so it read \"0--30 of 0\",\n // and the compact pager read \"-3 / 1\". It is written as one expression\n // rather than an early return so the effect depends on `page()` and\n // `total()` on every run, whichever branch decides the result.\n //\n // What IS still given up while `total` is 0 and the held page is past the\n // first: no cell carries `aria-current`, because `pages` renders the single\n // page and that is not the page the host holds. `rangeLabel()` is not in\n // that list — it already special-cases an empty total and reads \"0-0 of 0\".\n // Nor are the arrows: they compare against the RANGE rather than its ends\n // (see the template), so past the end next renders disabled and prev stays\n // enabled and steps back INTO range via `prevPage`. That is a change from\n // the \"enabled and inert\" behaviour described above, which this component\n // used to accept at both ends.\n effect(() => {\n const page = this.page();\n const floored = Math.max(1, page);\n const clamped = this.total() <= 0 ? floored : Math.min(floored, this.totalPages());\n if (clamped !== page) this.page.set(clamped);\n });\n }\n\n protected onSizeChange(size: unknown): void {\n const next = Number(size);\n if (this.disabled() || !Number.isFinite(next) || next <= 0 || next === this.pageSize()) return;\n // The size and nothing else. This used to clamp the page against the new\n // size too, and it read a value that was already superseded: `pageSize.set`\n // emits `pageSizeChange` synchronously, so by the following statement the\n // host has run its own policy — most tables reset to the first page — and\n // that write has not reached the model yet, it arrives on the next binding\n // pass. So the clamp computed a cap from the PRE-change page and wrote the\n // result over the host's decision: from page 6 at size 10, choosing 25\n // emitted `pageChange(5)` on top of the host's reset to 1, which the\n // host cannot tell from a navigation, and a second request went out. The\n // guard effect in the constructor takes it over and runs once the bindings\n // have settled, so it clamps the page the host actually wants.\n //\n // For a SETTLED `total` that is the whole story. For the server-paged host\n // this fix exists for it is not: the size change invalidates the payload\n // too, so `total` reads 0 and the guard returns early. Measured, from page\n // 6 at size 10 choosing 25 with a host that does not reset — in flight:\n // `navigations []`, page 6, total 0; after settle: `navigations [5]`, page\n // 5. So a non-resetting host issues one doomed request for a page that no\n // longer exists and is corrected only when the answer lands. That is an\n // accepted cost of refusing to write back from transient state, not\n // something the guard covers.\n this.pageSize.set(next);\n }\n}\n","<div class=\"wr-pagination__inner\">\n @if (showTotal()) {\n <span class=\"wr-pagination__total\">{{ rangeLabel() }}</span>\n }\n\n <div class=\"wr-pagination__nav\">\n <!--\n `wr-pagination__nav-btn` exists so the stylesheet can mirror the arrow\n glyph under `dir=\"rtl\"`. A class rather than `:first-child` /\n `:last-child` on the row: those two positions do hold today — which is why\n the `--square` end caps use them — but only while the prev button, the\n compact label and the next button all stay unconditional and in this\n order. A mirror keyed to position would follow a reorder, or land on a\n page cell, without a word.\n\n The two `[disabled]` bindings compare against the RANGE (`<= 1`,\n `>= totalPages()`) rather than for equality with its ends. While `total`\n is 0 the guard effect stops enforcing the upper bound, so the page can\n legitimately sit past `totalPages()` — and `=== totalPages()` reported\n next as enabled there while `goTo` refused the step. Prev is still\n enabled in that state, correctly: `prevPage()` walks it back into range.\n -->\n <wr-btn\n class=\"wr-pagination__nav-btn\"\n [size]=\"size()\"\n outlined\n [attr.aria-label]=\"resolvedPrev()\"\n [disabled]=\"disabled() || page() <= 1\"\n (click)=\"goTo(prevPage())\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m12 19-7-7 7-7\" />\n <path d=\"M19 12H5\" />\n </svg>\n </wr-btn>\n\n <!-- Tracked by page, not by slot: the window slides on every move, and the\n focused button has to stay the page it was. The two ellipses are\n different items, and the leading one is always the second entry. -->\n @for (page of pages(); track page === ellipsis ? ($index === 1 ? 'before' : 'after') : page) {\n @if (page === ellipsis) {\n <span class=\"wr-pagination__ellipsis\">{{ ellipsis }}</span>\n } @else {\n <wr-btn\n class=\"wr-pagination__page\"\n [size]=\"size()\"\n [outlined]=\"!isCurrent(page)\"\n [color]=\"isCurrent(page) ? 'primary' : null\"\n [attr.aria-current]=\"isCurrent(page) ? 'page' : null\"\n [attr.aria-label]=\"goToPage({ page })\"\n [disabled]=\"disabled()\"\n (click)=\"goTo(page)\"\n >\n {{ page }}\n </wr-btn>\n }\n }\n\n <!-- Compact pager — shown only in responsive mode on a narrow box (CSS). Not\n `aria-hidden`: `display: none` already keeps whichever of the two is\n hidden out of the accessibility tree, and on a narrow box this label is\n the only position on screen. -->\n <span class=\"wr-pagination__current\">{{ compactLabel() }}</span>\n\n <wr-btn\n class=\"wr-pagination__nav-btn\"\n [size]=\"size()\"\n outlined\n [attr.aria-label]=\"resolvedNext()\"\n [disabled]=\"disabled() || page() >= totalPages()\"\n (click)=\"goTo(page() + 1)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M5 12h14\" />\n <path d=\"m12 5 7 7-7 7\" />\n </svg>\n </wr-btn>\n </div>\n\n @if (showSizeChanger()) {\n <!--\n `ariaLabel`, not `[attr.aria-label]`: `<wr-select>`'s host carries no role,\n so an attribute there names nothing and never reaches the `role=\"combobox\"`\n button inside — the size changer announced itself as the catalog's generic\n \"Select\".\n -->\n <wr-select\n class=\"wr-pagination__size\"\n [ariaLabel]=\"resolvedItemsPerPage()\"\n [size]=\"size()\"\n [disabled]=\"disabled()\"\n [value]=\"pageSize()\"\n (valueChange)=\"onSizeChange($event)\"\n >\n @for (option of pageSizeOptions(); track option) {\n <wr-option [value]=\"option\">{{ perPage({ size: option }) }}</wr-option>\n }\n </wr-select>\n }\n</div>\n"],"mappings":";;;;;;;;;;;;;AAiBA,MAAM,WAAW;AA4BjB,IAAa,eAAb,MAAa,aAAY;CAUd,OAAO,MAAc,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAGvB,WAAW,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAG5B,QAAQ,MAAM,GAAC;EAAA,GAAA,YAAA,EAAA,WAAA,QAAA,+BAAA,CAAA;EAAI,WAAW,UAAU,CAAC;CAAC,CAAA;CAG1C,kBAAkB,MAAyB;EAAC;EAAI;EAAI;EAAI;CAAG,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,kBAAA,CAAA,+BAAA,CAAA,CAAA;CAG7D,kBAAkB,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,kBAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAGjE,YAAY,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,YAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAG3D,QAAQ,MAAyB,SAAQ,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAGzC,OAAO,MAAwB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAGpC,QAAQ,MAAyB,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAG3C,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAO1D,aAA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MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAe,eAEV,kBAAkB;GAAI,MAC/B;IAAE,OAAO;IAAiB,WAAW;IAAa,MAAM;IAAc,qBAAqB;GAAY;GAAE,SACtG;IAAC;IAAU;IAAU;GAAQ;GAAC,UAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"ngwr-pagination.mjs","names":[],"sources":["../../../projects/lib/pagination/pagination.ts","../../../projects/lib/pagination/pagination.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 { Component, LOCALE_ID, ViewEncapsulation, computed, effect, inject, input, model } from '@angular/core';\n\nimport { WrButton } from 'ngwr/button';\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { WrOption, WrSelect } from 'ngwr/select';\nimport { wrNumAttr, wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrPaginationAlign, WrPaginationShape, WrPaginationSize } from './types';\n\nconst ELLIPSIS = '…' as const;\ntype PageEntry = number | typeof ELLIPSIS;\n\n/**\n * Numbered page navigator with optional total / page-size controls.\n *\n * Two-way binds `page` and `pageSize` via signal `model()` inputs.\n *\n * @example\n * ```html\n * <wr-pagination\n * [total]=\"120\"\n * [(page)]=\"page\"\n * [(pageSize)]=\"size\"\n * showTotal\n * showSizeChanger\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/pagination\n */\n@Component({\n selector: 'wr-pagination',\n templateUrl: './pagination.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-pagination', '[class]': 'classes()', role: 'navigation', '[attr.aria-label]': 'navLabel()' },\n imports: [WrButton, WrSelect, WrOption],\n})\nexport class WrPagination {\n /**\n * Currently displayed page (1-based). Two-way bindable.\n *\n * `page` rather than `currentPage` since v14, so this and `<wr-table>` — which\n * renders one of these in its own footer — spell the two concepts they share\n * one way each. It also names the output: a `model()` called `X` forces\n * `(XChange)`, so the old name produced `(currentPageChange)` against the\n * table's `(pageChange)`.\n */\n readonly page = model<number>(1);\n\n /** Items per page. Two-way bindable. */\n readonly pageSize = model<number>(10);\n\n /** Total item count across all pages. */\n readonly total = input(0, { transform: wrNumAttr(0) });\n\n /** Options shown in the page-size dropdown. */\n readonly pageSizeOptions = input<readonly number[]>([10, 20, 50, 100]);\n\n /** Render the page-size dropdown. @default false */\n readonly showSizeChanger = input(false, { transform: coerceBooleanProperty });\n\n /** Render the \"X–Y of Z\" total label. @default false */\n readonly showTotal = input(false, { transform: coerceBooleanProperty });\n\n /** Horizontal alignment. @default 'start' */\n readonly align = input<WrPaginationAlign>('start');\n\n /** Size variant — cascades to every internal button. @default 'sm' */\n readonly size = input<WrPaginationSize>('sm');\n\n /** Cell corner treatment. @default 'rounded' */\n readonly shape = input<WrPaginationShape>('rounded');\n\n /** Disable interaction. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Collapse to a compact `‹ page / total ›` pager when the control's own box\n * is too narrow for the full numbered strip (a container query on its own\n * width, not the viewport). @default false\n */\n readonly responsive = input(false, { transform: coerceBooleanProperty });\n\n /** Previous-page button aria-label. Falls back to `pagination.prev`. */\n readonly prevLabel = input<string | null>(null);\n\n /** Next-page button aria-label. Falls back to `pagination.next`. */\n readonly nextLabel = input<string | null>(null);\n\n /** \"Items per page\" label. Falls back to `pagination.itemsPerPage`. */\n readonly itemsPerPageLabel = input<string | null>(null);\n\n /** Accessible name for the `role=\"navigation\"` host. Falls back to `pagination.label`. */\n readonly label = input<string | null>(null);\n\n /** Resolved labels. */\n protected readonly resolvedPrev = useI18nText(this.prevLabel, 'pagination.prev', 'Previous page');\n protected readonly resolvedNext = useI18nText(this.nextLabel, 'pagination.next', 'Next page');\n protected readonly resolvedItemsPerPage = useI18nText(\n this.itemsPerPageLabel,\n 'pagination.itemsPerPage',\n 'Items per page'\n );\n\n /**\n * Page-size option text — interpolates `{{size}}`. Was the template literal\n * `{{ option }} / page`, which no catalog could reach, so a Russian UI read\n * \"25 / page\".\n */\n protected readonly perPage = useI18nFormatter('pagination.perPage', '{{size}} / page');\n\n /** Per-page-button aria-label — interpolates `{{page}}`. */\n protected readonly goToPage = useI18nFormatter('pagination.goToPage', 'Go to page {{page}}');\n\n /** The nav landmark's own accessible name — was a hardcoded English literal. */\n protected readonly navLabel = useI18nText(this.label, 'pagination.label', 'Pagination');\n\n /** Internal: total page count. */\n /**\n * A page size that is not a positive number yields ONE page, not `Infinity`.\n *\n * `pageSize` is a `model()`, so Angular offers no `transform` to coerce it and\n * whatever the host writes arrives raw. At 0 the division is `Infinity`,\n * `Math.max(1, …)` keeps it, and the item list below pushes `total` as the\n * last page — so the strip rendered a clickable cell reading \"Infinity\", and\n * clicking it locked the tab. `NaN` (a `pageSize` bound to an emptied number\n * field) came through untouched for the same reason.\n *\n * One page is the honest answer: a size of zero describes no paging at all.\n * Note this is about `pageSize` and does NOT touch the recorded contract\n * about `total` — pagination still refuses to pull the page DOWN while\n * `total` is at or below zero, because 0 is ambiguous with \"still loading\".\n */\n private readonly usablePageSize = computed(() => {\n const size = this.pageSize();\n if (Number.isFinite(size) && size >= 1) return size;\n // Everything on one page. Deliberately not `Infinity`, which gives the\n // right page COUNT by accident and then puts `Infinity` in the range label\n // the moment `page` is above 1.\n return Math.max(1, this.total());\n });\n\n protected readonly totalPages = computed(() => Math.max(1, Math.ceil(this.total() / this.usablePageSize())));\n\n /**\n * Internal: where the previous arrow goes. Clamped to the end of the valid\n * range rather than being a plain `page() - 1`, because the page can\n * legitimately sit past that end while `total` is 0 (see the guard effect).\n * From page 5 of one page, `goTo(4)` is refused as out of range, so the arrow\n * was enabled and did nothing — and under `responsive` on a narrow box the\n * numbered cells are hidden by a container query, which left no way back at\n * all. `Math.min` only ever moves the target INWARD, so `goTo`'s own\n * past-the-end refusal keeps working as the backstop it is.\n */\n protected readonly prevPage = computed(() => Math.min(this.page() - 1, this.totalPages()));\n\n /**\n * Internal: the \"1–10 of 235\" line, as ONE catalog template.\n *\n * It used to be `` `${start}-${end} ${of} ${total}` ``, which localised the\n * word in the middle and nothing else: the ASCII hyphen between the bounds and\n * the operand order were both frozen in TypeScript, so ja-JP and ar-SA got\n * English word order and no language could change the range separator. The\n * three numbers go through `Intl.NumberFormat` for the same reason the total\n * beside them does — a five-figure total needs the locale's grouping, and\n * ar-SA needs its own digits.\n *\n * The `ofLabel` input is gone with it: an input for the middle word is the\n * concatenation, re-offered as API.\n */\n protected readonly rangeLabel = computed(() => {\n // The same guarded size, or the range label reads \"1 – NaN of 100\".\n const size = this.usablePageSize();\n const start = this.total() === 0 ? 0 : (this.page() - 1) * size + 1;\n const end = Math.min(this.page() * size, this.total());\n return this.rangeText({\n from: this.number(start),\n to: this.number(end),\n total: this.number(this.total()),\n });\n });\n\n /** Internal: the compact pager's `1 / 24`, likewise a catalog template. */\n protected readonly compactLabel = computed(() =>\n this.compactText({ current: this.number(this.page()), total: this.number(this.totalPages()) })\n );\n\n private readonly rangeText = useI18nFormatter('pagination.range', '{{from}}–{{to}} of {{total}}');\n private readonly compactText = useI18nFormatter('pagination.compact', '{{current}} / {{total}}');\n\n private readonly locale = inject(LOCALE_ID);\n\n /**\n * Grouped per `LOCALE_ID`. Only the range and the compact pager go through\n * this — a page NUMBER on a button is an identifier, and `1,024` on a button\n * reads as two things.\n */\n private number(value: number): string {\n return new Intl.NumberFormat(this.locale).format(value);\n }\n\n /**\n * Internal: page list with ellipses. Window of 7 visible page slots.\n *\n * 1 … 5 6 [7] 8 9 … 20\n */\n protected readonly pages = computed<readonly PageEntry[]>(() => {\n const total = this.totalPages();\n const current = this.page();\n\n if (total <= 7) {\n return Array.from({ length: total }, (_, i) => i + 1);\n }\n\n const items: PageEntry[] = [1];\n if (current > 4) items.push(ELLIPSIS);\n\n let start: number;\n let end: number;\n if (current <= 4) {\n start = 2;\n end = 5;\n } else if (current >= total - 3) {\n start = total - 4;\n end = total - 1;\n } else {\n start = current - 2;\n end = current + 2;\n }\n\n for (let i = start; i <= end; i++) items.push(i);\n if (current < total - 3) items.push(ELLIPSIS);\n if (end !== total) items.push(total);\n\n return items;\n });\n\n protected readonly ellipsis = ELLIPSIS;\n\n protected readonly classes = computed(() => {\n const parts = [`wr-pagination--${this.align()}`, `wr-pagination--${this.size()}`, `wr-pagination--${this.shape()}`];\n if (this.disabled()) parts.push('wr-pagination--disabled');\n if (this.responsive()) parts.push('wr-pagination--responsive');\n return parts.join(' ');\n });\n\n protected isCurrent(page: number): boolean {\n return this.page() === page;\n }\n\n protected goTo(page: number | typeof ELLIPSIS): void {\n if (typeof page !== 'number') return;\n if (this.disabled() || page < 1 || page > this.totalPages() || page === this.page()) return;\n this.page.set(page);\n }\n\n /**\n * `wr-select` carries an `unknown` value by design, so the size arrives\n * untyped and is narrowed here. It used to arrive as `any` through\n * `[ngModel]`, which hid the coercion rather than removing the need for it.\n */\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('pagination');\n // `page` is a plain `model` — a `model()` takes no transform — so a\n // shrinking `total` and a host `[(page)]` write both land in it\n // unchecked. The guard used to read and write the page inside `untracked()`\n // and pull DOWNWARDS only, so it fired when `total` / `pageSize` moved and\n // never when the host wrote: past the end no cell carries `aria-current`,\n // the arrow at that end stays enabled and inert (`goTo` refuses the step\n // rather than correcting the stored page), and below 1 `rangeLabel()` counts\n // backwards (\"-9-0 of 120\"). Two-sided and tracked, the same shape\n // `wr-stepper` and `wr-carousel` use for their own host-owned `model()`.\n //\n // Only the UPPER bound is conditional. A `total` at or below 0 is the one\n // value where pulling the page down is destructive rather than cosmetic:\n // there is no `loading` input, so 0 is genuinely ambiguous between \"the\n // list is empty\" and \"the page is still in flight\", and the second is the\n // ordinary state of a server-paged host — Angular's `resource` drops its\n // value whenever the params change, and a params function returning an\n // object literal is never reference-equal, so `total` reads 0 between the\n // click and the response. `totalPages()` is 1 there, so the guard pulled\n // every page above the first back to 1 and emitted a `pageChange`\n // the host could not tell from a click: the pager could not leave page 1,\n // and each click cost two events. A negative `total` is folded into the\n // same branch because it is as meaningless as a zero one.\n //\n // The LOWER bound is unconditional, and gating it on `total` was a mistake\n // in the first cut of this fix: no value of `total` makes page 0 correct,\n // and while it was skipped a host write of -3 survived — `rangeLabel()`\n // guards `start` for an empty total and not `end`, so it read \"0--30 of 0\",\n // and the compact pager read \"-3 / 1\". It is written as one expression\n // rather than an early return so the effect depends on `page()` and\n // `total()` on every run, whichever branch decides the result.\n //\n // What IS still given up while `total` is 0 and the held page is past the\n // first: no cell carries `aria-current`, because `pages` renders the single\n // page and that is not the page the host holds. `rangeLabel()` is not in\n // that list — it already special-cases an empty total and reads \"0-0 of 0\".\n // Nor are the arrows: they compare against the RANGE rather than its ends\n // (see the template), so past the end next renders disabled and prev stays\n // enabled and steps back INTO range via `prevPage`. That is a change from\n // the \"enabled and inert\" behaviour described above, which this component\n // used to accept at both ends.\n effect(() => {\n const page = this.page();\n const floored = Math.max(1, page);\n const clamped = this.total() <= 0 ? floored : Math.min(floored, this.totalPages());\n if (clamped !== page) this.page.set(clamped);\n });\n }\n\n protected onSizeChange(size: unknown): void {\n const next = Number(size);\n if (this.disabled() || !Number.isFinite(next) || next <= 0 || next === this.pageSize()) return;\n // The size and nothing else. This used to clamp the page against the new\n // size too, and it read a value that was already superseded: `pageSize.set`\n // emits `pageSizeChange` synchronously, so by the following statement the\n // host has run its own policy — most tables reset to the first page — and\n // that write has not reached the model yet, it arrives on the next binding\n // pass. So the clamp computed a cap from the PRE-change page and wrote the\n // result over the host's decision: from page 6 at size 10, choosing 25\n // emitted `pageChange(5)` on top of the host's reset to 1, which the\n // host cannot tell from a navigation, and a second request went out. The\n // guard effect in the constructor takes it over and runs once the bindings\n // have settled, so it clamps the page the host actually wants.\n //\n // For a SETTLED `total` that is the whole story. For the server-paged host\n // this fix exists for it is not: the size change invalidates the payload\n // too, so `total` reads 0 and the guard returns early. Measured, from page\n // 6 at size 10 choosing 25 with a host that does not reset — in flight:\n // `navigations []`, page 6, total 0; after settle: `navigations [5]`, page\n // 5. So a non-resetting host issues one doomed request for a page that no\n // longer exists and is corrected only when the answer lands. That is an\n // accepted cost of refusing to write back from transient state, not\n // something the guard covers.\n this.pageSize.set(next);\n }\n}\n","<div class=\"wr-pagination__inner\">\n @if (showTotal()) {\n <span class=\"wr-pagination__total\">{{ rangeLabel() }}</span>\n }\n\n <div class=\"wr-pagination__nav\">\n <!--\n `wr-pagination__nav-btn` exists so the stylesheet can mirror the arrow\n glyph under `dir=\"rtl\"`. A class rather than `:first-child` /\n `:last-child` on the row: those two positions do hold today — which is why\n the `--square` end caps use them — but only while the prev button, the\n compact label and the next button all stay unconditional and in this\n order. A mirror keyed to position would follow a reorder, or land on a\n page cell, without a word.\n\n The two `[disabled]` bindings compare against the RANGE (`<= 1`,\n `>= totalPages()`) rather than for equality with its ends. While `total`\n is 0 the guard effect stops enforcing the upper bound, so the page can\n legitimately sit past `totalPages()` — and `=== totalPages()` reported\n next as enabled there while `goTo` refused the step. Prev is still\n enabled in that state, correctly: `prevPage()` walks it back into range.\n -->\n <wr-btn\n class=\"wr-pagination__nav-btn\"\n [size]=\"size()\"\n outlined\n [attr.aria-label]=\"resolvedPrev()\"\n [disabled]=\"disabled() || page() <= 1\"\n (click)=\"goTo(prevPage())\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m12 19-7-7 7-7\" />\n <path d=\"M19 12H5\" />\n </svg>\n </wr-btn>\n\n <!-- Tracked by page, not by slot: the window slides on every move, and the\n focused button has to stay the page it was. The two ellipses are\n different items, and the leading one is always the second entry. -->\n @for (page of pages(); track page === ellipsis ? ($index === 1 ? 'before' : 'after') : page) {\n @if (page === ellipsis) {\n <span class=\"wr-pagination__ellipsis\">{{ ellipsis }}</span>\n } @else {\n <wr-btn\n class=\"wr-pagination__page\"\n [size]=\"size()\"\n [outlined]=\"!isCurrent(page)\"\n [color]=\"isCurrent(page) ? 'primary' : null\"\n [attr.aria-current]=\"isCurrent(page) ? 'page' : null\"\n [attr.aria-label]=\"goToPage({ page })\"\n [disabled]=\"disabled()\"\n (click)=\"goTo(page)\"\n >\n {{ page }}\n </wr-btn>\n }\n }\n\n <!-- Compact pager — shown only in responsive mode on a narrow box (CSS). Not\n `aria-hidden`: `display: none` already keeps whichever of the two is\n hidden out of the accessibility tree, and on a narrow box this label is\n the only position on screen. -->\n <span class=\"wr-pagination__current\">{{ compactLabel() }}</span>\n\n <wr-btn\n class=\"wr-pagination__nav-btn\"\n [size]=\"size()\"\n outlined\n [attr.aria-label]=\"resolvedNext()\"\n [disabled]=\"disabled() || page() >= totalPages()\"\n (click)=\"goTo(page() + 1)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M5 12h14\" />\n <path d=\"m12 5 7 7-7 7\" />\n </svg>\n </wr-btn>\n </div>\n\n @if (showSizeChanger()) {\n <!--\n `ariaLabel`, not `[attr.aria-label]`: `<wr-select>`'s host carries no role,\n so an attribute there names nothing and never reaches the `role=\"combobox\"`\n button inside — the size changer announced itself as the catalog's generic\n \"Select\".\n -->\n <wr-select\n class=\"wr-pagination__size\"\n [ariaLabel]=\"resolvedItemsPerPage()\"\n [size]=\"size()\"\n [disabled]=\"disabled()\"\n [value]=\"pageSize()\"\n (valueChange)=\"onSizeChange($event)\"\n >\n @for (option of pageSizeOptions(); track option) {\n <wr-option [value]=\"option\">{{ perPage({ size: option }) }}</wr-option>\n }\n </wr-select>\n }\n</div>\n"],"mappings":";;;;;;;;;;;;;AAiBA,MAA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 +645,7 @@ var WrSchemaForm = class WrSchemaForm {
645
645
  "loadErrorText",
646
646
  "retryable",
647
647
  "retryText",
648
+ "resultsText",
648
649
  "loading",
649
650
  "separators",
650
651
  "allowDuplicates",
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-schema-form.mjs","names":[],"sources":["../../../projects/lib/schema-form/array-state.ts","../../../projects/lib/schema-form/schema-form.ts","../../../projects/lib/schema-form/schema-form.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 { Directive, input } from '@angular/core';\nimport { NgControl, type ValidationErrors } from '@angular/forms';\nimport type { Field } from '@angular/forms/signals';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Hands an `array` field's own state to the `<wr-form-field>` around it.\n *\n * `<wr-form-field>` reads its errors off the `NgControl` in its content, which\n * `[formField]` provides for a control. A repeating group has no control, so\n * without this its own errors (`minLength`, a `validate` on the array) had\n * nowhere to show, and they would have needed a second copy of the rules for\n * where an error's words come from.\n *\n * @internal\n */\n@Directive({\n selector: '[wrSchemaFormArrayState]',\n providers: [{ provide: NgControl, useExisting: WrSchemaFormArrayState }],\n})\nexport class WrSchemaFormArrayState {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('schema-form');\n }\n\n readonly wrSchemaFormArrayState = input.required<Field<never>>();\n\n /** Not an `AbstractControl`, which is what tells the field to read the getters below. */\n readonly control = null;\n\n get touched(): boolean {\n return this.wrSchemaFormArrayState()().touched();\n }\n\n get dirty(): boolean {\n return this.wrSchemaFormArrayState()().dirty();\n }\n\n /** The array's OWN errors, keyed by kind. An item's errors show beside the item's control. */\n get errors(): ValidationErrors | null {\n const errors = this.wrSchemaFormArrayState()().errors();\n return errors.length ? Object.fromEntries(errors.map(error => [error.kind, error])) : 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 { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n Injector,\n type Signal,\n ViewEncapsulation,\n afterNextRender,\n computed,\n inject,\n input,\n isDevMode,\n} from '@angular/core';\nimport { FormField, type Field, type FieldState, type FieldTree, isFieldTree } from '@angular/forms/signals';\n\nimport { WrButton } from 'ngwr/button';\nimport { WrCheckbox } from 'ngwr/checkbox';\nimport { WrDatePicker, WrDateRangePicker } from 'ngwr/date-picker';\nimport { WrFileUpload } from 'ngwr/file-upload';\nimport { WR_FIELD, WrFormField, wrFieldLabel, type WrFieldSpec } from 'ngwr/form';\nimport { useI18nText } from 'ngwr/i18n';\nimport { WrInput } from 'ngwr/input';\nimport { WrInputNumber } from 'ngwr/input-number';\nimport { WrRadio, WrRadioGroup } from 'ngwr/radio';\nimport { WrRating } from 'ngwr/rating';\nimport { WrSegmented } from 'ngwr/segmented';\nimport { WrOption, WrSelect } from 'ngwr/select';\nimport { WrSlider } from 'ngwr/slider';\nimport { WrSwitch } from 'ngwr/switch';\nimport { WrTextarea } from 'ngwr/textarea';\nimport { wrNumAttr, wrCheckStyles } from 'ngwr/utils';\n\nimport { WrSchemaFormArrayState } from './array-state';\n\n/** One field the template draws, resolved once per schema change. */\ninterface WrRenderedField {\n readonly key: string;\n readonly field: Field<never>;\n readonly spec: WrFieldSpec;\n /** `spec.label`, or the key de-camel-cased. */\n readonly label: string;\n /**\n * The same text, or `''` for the two kinds that carry their own label inside\n * the control. Resolved here rather than in the template: a method call in a\n * template is re-run on every pass, and this is decided once per schema.\n */\n readonly labelAbove: string;\n /** `grid-column`, already clamped to the columns of the grid the field sits on. */\n readonly column: string;\n /** DOM id prefix for the parts of an `array` field. */\n readonly id: string;\n /** The item fields of an `array`, in order. Empty for every other kind. */\n readonly items: Signal<readonly FieldTree<object>[]>;\n}\n\n/** A run of fields drawn inside one `<fieldset>`. */\ninterface WrRenderedSection {\n readonly id: string;\n readonly title: string;\n readonly description: string;\n /** `grid-template-columns` of the section's own grid. */\n readonly template: string;\n readonly fields: WrRenderedField[];\n /** False while the schema hides every field in it: an empty fieldset announces a group of nothing. */\n readonly visible: Signal<boolean>;\n}\n\n/** One child of the form's grid: a field, or a section holding several. */\ninterface WrRenderedCell {\n readonly key: string;\n readonly field?: WrRenderedField;\n readonly section?: WrRenderedSection;\n}\n\nconst NO_ITEMS: Signal<readonly FieldTree<object>[]> = computed(() => []);\n\nlet uid = 0;\n\n/**\n * The two kinds that carry their own label. Everything else gets one above the\n * control, from `<wr-form-field>`.\n */\nconst SELF_LABELLING = new Set<WrFieldSpec['kind']>(['checkbox', 'switch']);\n\n/** What each kind writes into the model, for the dev-mode mismatch warning. */\nconst EXPECTED_TYPE: Partial<Record<WrFieldSpec['kind'], string>> = {\n input: 'string',\n textarea: 'string',\n number: 'number',\n multiselect: 'array',\n tags: 'array',\n checkbox: 'boolean',\n switch: 'boolean',\n slider: 'number',\n rating: 'number',\n array: 'array',\n};\n\n/** `typeof`, with the one distinction it does not make and three kinds depend on. */\nfunction typeOf(value: unknown): string {\n return Array.isArray(value) ? 'array' : typeof value;\n}\n\n/** The track list of a grid of `columns` equal columns. */\nfunction tracks(columns: number): string {\n return `repeat(${Math.max(1, Math.round(columns))}, minmax(0, 1fr))`;\n}\n\n/**\n * The first field of a group a keyboard can land on: described, not hidden and\n * not disabled, in the model's key order. A nested `array` is passed over, since\n * it has no control of its own to focus.\n */\nfunction firstControl(group: FieldTree<object>): Field<never> | null {\n for (const [, child] of group as unknown as Iterable<[string, unknown]>) {\n if (!isFieldTree(child)) continue;\n const state = (child as Field<never>)();\n const spec = state.metadata(WR_FIELD)?.();\n if (spec && spec.kind !== 'array' && !state.hidden() && !state.disabled()) return child as Field<never>;\n }\n return null;\n}\n\n/**\n * Warn when a group's described fields are about to be drawn by nothing.\n *\n * A field tree is iterated one level deep, so an object-valued field with no\n * `WR_FIELD` of its own is skipped exactly like an undescribed leaf — and its\n * children go with it. That is the right default (a model nests for reasons\n * that have nothing to do with a screen), but it is indistinguishable from a\n * half-drawn form: nothing is missing from the DOM, so nothing looks wrong.\n *\n * Describing the children and getting none of them is never intentional, so\n * that exact shape is what this reports. A group whose children carry no spec\n * either is silent, because it is a model detail this screen does not render.\n */\nfunction warnOnUndrawnGroup(key: string, group: unknown): void {\n // A field tree over a primitive is not iterable, and every undescribed leaf\n // arrives here — so the guard is what keeps this from throwing on the common\n // case rather than a defence against an exotic one.\n const subfields = (group as Partial<Iterable<[string, unknown]>>)[Symbol.iterator];\n if (typeof subfields !== 'function') return;\n // An array iterates its items, not `[key, field]` pairs.\n if (Array.isArray((group as Field<never>)().value())) return;\n\n let described = 0;\n for (const [, child] of group as Iterable<[string, unknown]>) {\n if (isFieldTree(child) && (child as Field<never>)().metadata(WR_FIELD)?.()) described++;\n }\n if (described === 0) return;\n\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] <wr-schema-form>: \"${key}\" is a group holding ${described} described ` +\n `field(s), and none of them are drawn — a field tree is walked one level deep. ` +\n `Draw the group with a second <wr-schema-form [field]=\"form.${key}\" />, or give ` +\n `\"${key}\" a WR_FIELD of its own if this screen is meant to skip it.`\n );\n}\n\n/**\n * Warn when a `kind` contradicts what the field actually holds.\n *\n * This is the one failure mode of the whole component that nothing else\n * reports: `kind` is a string on a metadata value, so TypeScript cannot hold it\n * against the field's own type, and a `kind: 'number'` on a `string` field\n * renders a `<wr-input-number>` that writes numbers into it forever. The runtime\n * value is the only evidence available, so an empty or nullish one says nothing\n * and is left alone.\n */\nfunction warnOnKindMismatch(f: WrRenderedField): void {\n const expected = EXPECTED_TYPE[f.spec.kind];\n const value = f.field().value();\n if (!expected || value === null || value === undefined || value === '') return;\n if (typeOf(value) === expected) return;\n\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] <wr-schema-form>: field \"${f.key}\" is described as kind '${f.spec.kind}', ` +\n `which writes a ${expected}, but the field holds a ${typeOf(value)}. ` +\n `The control will overwrite the model with the wrong type.`\n );\n}\n\n/**\n * A form drawn from a Signal Forms schema — one `<wr-form-field>`, one control\n * and one set of error messages per described field, laid out on a grid.\n *\n * The presentation rides on the SAME schema as the validation, through the\n * `WR_FIELD` metadata key from `ngwr/form`:\n *\n * ```ts\n * const profile = form(model, path => {\n * required(path.email, { message: 'Enter your email.' });\n * email(path.email, { message: 'That is not an email address.' });\n * metadata(path.email, WR_FIELD, () => ({ kind: 'input', type: 'email' }));\n * metadata(path.role, WR_FIELD, () => ({ kind: 'select', options: ROLES }));\n * });\n * ```\n * ```html\n * <wr-schema-form [field]=\"profile\" [columns]=\"2\" />\n * ```\n *\n * The error messages are the rules' own: each field's `<wr-form-field>` shows a\n * validator's `message`, else `validation.<key>` from the app's i18n catalog.\n * ngwr ships no error texts, so a rule with neither renders no message.\n *\n * **A field with no `WR_FIELD` metadata is skipped**, silently and on purpose: a\n * schema may describe more than one screen renders, and guessing a control from\n * a field's type would draw a `wr-switch` for every boolean flag in the model.\n * Order is the model's own key order.\n *\n * **`required`, `disabled`, `readonly` and `hidden` are NOT in the spec.** They\n * are Angular's own schema functions, `[formField]` already applies the first\n * three to the control, and this component reads `hidden()` to decide whether to\n * draw the field at all — which Angular's docs say a template has to do itself.\n * Re-declaring any of them here would be a second source of truth for state the\n * form already owns.\n *\n * **A section is a spec key, a repeating group is a kind.** Fields naming the\n * same `section` are drawn in one `<fieldset>` under its title. A field of\n * `kind: 'array'` over an array of objects draws one group per item, each a\n * `<wr-schema-form>` of its own, so the items' fields are described once with\n * `applyEach`. Add and Remove write the array, and `minLength` and `maxLength`\n * on it are the bounds they stop at.\n *\n * **Why its own entry point rather than `ngwr/form`.** Drawing every kind means\n * depending on every control, and `ngwr/form` is the layout primitive every\n * form imports — folding this in would put a date picker and a slider into the\n * bundle of an app that only wanted `<wr-form-field>`.\n *\n * @see https://ngwr.dev/reference/components/schema-form\n */\n@Component({\n selector: 'wr-schema-form',\n templateUrl: './schema-form.html',\n encapsulation: ViewEncapsulation.None,\n imports: [\n FormField,\n NgTemplateOutlet,\n WrButton,\n WrCheckbox,\n WrDatePicker,\n WrDateRangePicker,\n WrFileUpload,\n WrFormField,\n WrInput,\n WrInputNumber,\n WrOption,\n WrRadio,\n WrRadioGroup,\n WrRating,\n WrSchemaFormArrayState,\n WrSegmented,\n WrSelect,\n WrSlider,\n WrSwitch,\n WrTextarea,\n ],\n host: {\n class: 'wr-schema-form',\n '[style.grid-template-columns]': 'template()',\n },\n})\nexport class WrSchemaForm<T extends object> {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('schema-form');\n }\n\n // Generic, rather than `FieldTree<Record<string, unknown>>`, because a model\n // declared as an `interface` has no index signature and is not assignable to\n // that: every consumer would have had to declare their model as a type alias\n // just to bind it. `T extends object` still refuses a field tree over a\n // primitive, which has no subfields and would draw nothing.\n /**\n * The form to draw — the value `form()` returned, or any object-valued field\n * inside one.\n */\n readonly field = input.required<FieldTree<T>>();\n\n /**\n * Grid columns. A field spans one of them unless its spec says otherwise.\n * @default 1\n */\n readonly columns = input(1, { transform: wrNumAttr(1) });\n\n /** Text of the button that adds an item to a repeating group. Falls back to `common.add`. */\n readonly addLabel = input<string | null>(null);\n\n /** Text of the button that removes one item of a repeating group. Falls back to `common.remove`. */\n readonly removeLabel = input<string | null>(null);\n\n protected readonly resolvedAdd = useI18nText(this.addLabel, 'common.add', 'Add');\n protected readonly resolvedRemove = useI18nText(this.removeLabel, 'common.remove', 'Remove');\n\n private readonly injector = inject(Injector);\n private readonly uid = `wr-schema-form-${++uid}`;\n\n /**\n * The track list, written as a style rather than published as a\n * `--wr-schema-form-columns` hook: `columns` always has a value, so the\n * inline style would win over any declaration a consumer wrote and the hook\n * would be one nobody could use.\n */\n protected readonly template = computed(() => tracks(this.columns()));\n\n /**\n * The described fields, in the model's key order, with the fields of a\n * section gathered where its first field stands.\n *\n * A field tree over an object is iterable as `[key, field]` pairs, which is\n * the whole reason this component needs no field list of its own. `isFieldTree`\n * guards the pair: a model carrying a method or a non-field property would\n * otherwise be read as a field and answer `undefined` to everything.\n */\n protected readonly cells = computed<readonly WrRenderedCell[]>(() => {\n const columns = this.columns();\n const described: { key: string; field: Field<never>; spec: WrFieldSpec; title: string | null }[] = [];\n // What each section says about itself: the first field to state a member wins.\n const stated = new Map<string, { description?: string; columns?: number }>();\n\n for (const [key, child] of this.field() as unknown as Iterable<[string, unknown]>) {\n if (!isFieldTree(child)) continue;\n\n const field = child as Field<never>;\n const spec = field().metadata(WR_FIELD)?.();\n if (!spec) {\n if (isDevMode()) warnOnUndrawnGroup(key, child);\n continue;\n }\n\n const section = typeof spec.section === 'string' ? { title: spec.section } : spec.section;\n if (section) {\n const known = stated.get(section.title) ?? {};\n stated.set(section.title, {\n description: known.description ?? section.description,\n columns: known.columns ?? section.columns,\n });\n }\n described.push({ key, field, spec, title: section?.title ?? null });\n }\n\n const out: WrRenderedCell[] = [];\n const sections = new Map<string, WrRenderedSection>();\n const all: WrRenderedField[] = [];\n\n for (const { key, field, spec, title } of described) {\n const grid = title === null ? columns : Math.max(1, Math.round(stated.get(title)?.columns ?? columns));\n const label = spec.label ?? wrFieldLabel(key);\n const span = Math.min(Math.max(Math.round(spec.span ?? 1), 1), grid);\n const rendered: WrRenderedField = {\n key,\n field,\n spec,\n label,\n labelAbove: SELF_LABELLING.has(spec.kind) ? '' : label,\n column: `span ${span}`,\n id: `${this.uid}-${key}`,\n items:\n spec.kind === 'array'\n ? computed(() => {\n const value: unknown = field().value();\n const list = field as unknown as ArrayLike<FieldTree<object>>;\n return Array.isArray(value) ? value.map((_, index) => list[index]) : [];\n })\n : NO_ITEMS,\n };\n all.push(rendered);\n\n if (title === null) {\n out.push({ key, field: rendered });\n continue;\n }\n\n let section = sections.get(title);\n if (!section) {\n const fields: WrRenderedField[] = [];\n section = {\n id: `${this.uid}-section-${sections.size}`,\n title,\n description: stated.get(title)?.description ?? '',\n template: tracks(grid),\n fields,\n visible: computed(() => fields.some(each => !each.field().hidden())),\n };\n sections.set(title, section);\n out.push({ key: `section:${title}`, section });\n }\n section.fields.push(rendered);\n }\n\n if (isDevMode()) all.forEach(f => warnOnKindMismatch(f));\n return out;\n });\n\n /** Types the context of the cell template, which an outlet hands over untyped. */\n protected rendered(field: unknown): WrRenderedField {\n return field as WrRenderedField;\n }\n\n /** Whether a repeating group may take one more item: not past `maxLength`, and not disabled or read-only. */\n protected canAdd(f: WrRenderedField): boolean {\n const state = f.field();\n return !state.disabled() && !state.readonly() && f.items().length < (state.maxLength?.() ?? Infinity);\n }\n\n /** Whether a repeating group may lose an item: not under `minLength`, and not disabled or read-only. */\n protected canRemove(f: WrRenderedField): boolean {\n const state = f.field();\n return !state.disabled() && !state.readonly() && f.items().length > (state.minLength?.() ?? 0);\n }\n\n /**\n * What describes a repeating group: its own errors while it shows any, else\n * its hint. The ids are the ones `<wr-form-field>` derives from `controlId`,\n * and the condition is the one it shows errors on, so the reference never\n * names an element that is not drawn.\n */\n protected describedBy(f: WrRenderedField): string | null {\n const state = f.field();\n if ((state.touched() || state.dirty()) && state.errors().length) return `${f.id}-errors`;\n return f.spec.hint ? `${f.id}-hint` : null;\n }\n\n /** Append a new item and move focus into it. */\n protected add(f: WrRenderedField): void {\n const make = f.spec.item;\n if (!make || !this.canAdd(f)) return;\n\n const index = f.items().length;\n this.write(f, list => [...list, make()]);\n afterNextRender(() => this.focusItem(f, index), { injector: this.injector });\n }\n\n /**\n * Remove one item. Focus goes to the item that took its place, and from the\n * last one to the Add button, so it never falls back to the page.\n */\n protected remove(f: WrRenderedField, index: number, list: HTMLElement): void {\n if (!this.canRemove(f)) return;\n\n this.write(f, items => items.filter((_, each) => each !== index));\n afterNextRender(\n () => {\n const length = f.items().length;\n if (index < length) return this.focusItem(f, index);\n const add = list.querySelector<HTMLElement>(':scope > .wr-schema-form__add:not([disabled])');\n if (add) add.focus();\n else if (length) this.focusItem(f, length - 1);\n },\n { injector: this.injector }\n );\n }\n\n private write(f: WrRenderedField, change: (items: readonly unknown[]) => readonly unknown[]): void {\n const state = f.field() as unknown as FieldState<readonly unknown[]>;\n state.value.update(change);\n state.markAsDirty();\n // The array alone: a new item's fields are not touched because the list was.\n state.markAsTouched({ skipDescendants: true });\n }\n\n private focusItem(f: WrRenderedField, index: number): void {\n const item = f.items()[index];\n if (item) firstControl(item)?.().focusBoundControl();\n }\n}\n","<ng-template #cell let-drawn>\n @let f = rendered(drawn);\n @let state = f.field();\n\n <!-- Angular's `hidden()` does not hide anything on its own; the docs are\n explicit that the template has to honour it. -->\n @if (!state.hidden()) {\n @if (f.spec.kind === 'array') {\n <fieldset class=\"wr-schema-form__array\" [style.grid-column]=\"f.column\" [attr.aria-describedby]=\"describedBy(f)\">\n <legend class=\"wr-schema-form__legend\">\n {{ f.label }}\n @if (state.required()) {\n <span class=\"wr-form-field__required\" aria-hidden=\"true\">*</span>\n }\n </legend>\n <wr-form-field [hint]=\"f.spec.hint ?? ''\" [controlId]=\"f.id\">\n <div #list class=\"wr-schema-form__items\" [id]=\"`${f.id}-items`\" [wrSchemaFormArrayState]=\"f.field\">\n @for (item of f.items(); track item) {\n <div class=\"wr-schema-form__item\" role=\"group\" [attr.aria-labelledby]=\"`${f.id}-title-${$index}`\">\n <div class=\"wr-schema-form__item-head\">\n <span class=\"wr-schema-form__item-title\" [id]=\"`${f.id}-title-${$index}`\"\n >{{ f.spec.itemLabel ?? f.label }} {{ $index + 1 }}</span\n >\n <!-- Named by its own text and then the item's heading, so a\n list of five reads \"Remove Address 2\", not \"Remove\" five times. -->\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n class=\"wr-schema-form__remove\"\n [id]=\"`${f.id}-remove-${$index}`\"\n [attr.aria-labelledby]=\"`${f.id}-remove-${$index} ${f.id}-title-${$index}`\"\n [disabled]=\"!canRemove(f)\"\n (click)=\"remove(f, $index, list)\"\n >\n {{ resolvedRemove() }}\n </button>\n </div>\n <wr-schema-form\n [field]=\"item\"\n [columns]=\"f.spec.columns ?? 1\"\n [addLabel]=\"addLabel()\"\n [removeLabel]=\"removeLabel()\"\n />\n </div>\n }\n @if (f.spec.item) {\n <button wr-btn type=\"button\" class=\"wr-schema-form__add\" [disabled]=\"!canAdd(f)\" (click)=\"add(f)\">\n {{ resolvedAdd() }}\n </button>\n }\n </div>\n </wr-form-field>\n </fieldset>\n } @else {\n <div class=\"wr-schema-form__field\" [style.grid-column]=\"f.column\">\n <wr-form-field [label]=\"f.labelAbove\" [hint]=\"f.spec.hint ?? ''\" [required]=\"state.required()\">\n @switch (f.spec.kind) {\n @case ('textarea') {\n <wr-textarea [formField]=\"f.field\" [placeholder]=\"f.spec.placeholder ?? ''\" [ariaLabel]=\"f.label\" />\n }\n @case ('number') {\n <wr-input-number\n [formField]=\"f.field\"\n [placeholder]=\"f.spec.placeholder ?? ''\"\n [step]=\"f.spec.step ?? 1\"\n [ariaLabel]=\"f.label\"\n />\n }\n @case ('select') {\n <wr-select [formField]=\"f.field\" [placeholder]=\"f.spec.placeholder ?? null\" [ariaLabel]=\"f.label\">\n @for (option of f.spec.options ?? []; track option.value) {\n <wr-option [value]=\"option.value\" [disabled]=\"option.disabled ?? false\">{{ option.label }}</wr-option>\n }\n </wr-select>\n }\n @case ('multiselect') {\n <wr-select\n mode=\"multi\"\n [formField]=\"f.field\"\n [placeholder]=\"f.spec.placeholder ?? null\"\n [ariaLabel]=\"f.label\"\n >\n @for (option of f.spec.options ?? []; track option.value) {\n <wr-option [value]=\"option.value\" [disabled]=\"option.disabled ?? false\">{{ option.label }}</wr-option>\n }\n </wr-select>\n }\n @case ('tags') {\n <wr-select\n mode=\"tag\"\n [formField]=\"f.field\"\n [placeholder]=\"f.spec.placeholder ?? null\"\n [ariaLabel]=\"f.label\"\n />\n }\n @case ('checkbox') {\n <wr-checkbox [formField]=\"f.field\">{{ f.label }}</wr-checkbox>\n }\n @case ('switch') {\n <wr-switch [formField]=\"f.field\">{{ f.label }}</wr-switch>\n }\n @case ('radio') {\n <!-- `wr-radio-group` has no `ariaLabel` input, and needs none: its\n host is a `role=\"radiogroup\"`, where `aria-label` is legal. -->\n <wr-radio-group [formField]=\"f.field\" [attr.aria-label]=\"f.label\">\n @for (option of f.spec.options ?? []; track option.value) {\n <wr-radio [value]=\"option.value\" [disabled]=\"option.disabled ?? false\">{{ option.label }}</wr-radio>\n }\n </wr-radio-group>\n }\n @case ('segmented') {\n <wr-segmented [formField]=\"f.field\" [options]=\"f.spec.options ?? []\" />\n }\n @case ('date') {\n <wr-date-picker [formField]=\"f.field\" [placeholder]=\"f.spec.placeholder ?? ''\" [ariaLabel]=\"f.label\" />\n }\n @case ('daterange') {\n <!-- The picker names its two inputs \"Range start\" and \"Range end\";\n the group around them is what carries the field's own label. -->\n <wr-date-range-picker [formField]=\"f.field\" role=\"group\" [attr.aria-label]=\"f.label\" />\n }\n @case ('slider') {\n <wr-slider [formField]=\"f.field\" [step]=\"f.spec.step ?? 1\" [ariaLabel]=\"f.label\" />\n }\n @case ('rating') {\n <wr-rating [formField]=\"f.field\" [ariaLabel]=\"f.label\" />\n }\n @case ('file') {\n <wr-file-upload\n [formField]=\"f.field\"\n [multiple]=\"f.spec.multiple ?? false\"\n [accept]=\"f.spec.accept ?? ''\"\n />\n }\n @default {\n <input\n wrInput\n [formField]=\"f.field\"\n [type]=\"f.spec.type ?? 'text'\"\n [placeholder]=\"f.spec.placeholder ?? ''\"\n />\n }\n }\n </wr-form-field>\n </div>\n }\n }\n</ng-template>\n\n@for (c of cells(); track c.key) {\n @if (c.section; as section) {\n @if (section.visible()) {\n <fieldset\n class=\"wr-schema-form__section\"\n [attr.aria-describedby]=\"section.description ? `${section.id}-description` : null\"\n >\n <legend class=\"wr-schema-form__legend\">{{ section.title }}</legend>\n @if (section.description) {\n <p class=\"wr-schema-form__description\" [id]=\"`${section.id}-description`\">{{ section.description }}</p>\n }\n <div class=\"wr-schema-form__grid\" [style.grid-template-columns]=\"section.template\">\n @for (f of section.fields; track f.key) {\n <ng-container [ngTemplateOutlet]=\"cell\" [ngTemplate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A;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,SAAA,CAAA,eAAA,OAAA;GAAA;EAAA;EAAA,eAAA,GAAA,kBAAA;CAAA,CAAA;;AAOD,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAY,YAAA,CAAA;EA/BxB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAgB,eAEX,kBAAkB;GAAI,SAC5B;IACP;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACD;GAAA,MACK;IACJ,OAAO;IACP,iCAAiC;GAClC;GAAA,UAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"ngwr-schema-form.mjs","names":[],"sources":["../../../projects/lib/schema-form/array-state.ts","../../../projects/lib/schema-form/schema-form.ts","../../../projects/lib/schema-form/schema-form.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 { Directive, input } from '@angular/core';\nimport { NgControl, type ValidationErrors } from '@angular/forms';\nimport type { Field } from '@angular/forms/signals';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Hands an `array` field's own state to the `<wr-form-field>` around it.\n *\n * `<wr-form-field>` reads its errors off the `NgControl` in its content, which\n * `[formField]` provides for a control. A repeating group has no control, so\n * without this its own errors (`minLength`, a `validate` on the array) had\n * nowhere to show, and they would have needed a second copy of the rules for\n * where an error's words come from.\n *\n * @internal\n */\n@Directive({\n selector: '[wrSchemaFormArrayState]',\n providers: [{ provide: NgControl, useExisting: WrSchemaFormArrayState }],\n})\nexport class WrSchemaFormArrayState {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('schema-form');\n }\n\n readonly wrSchemaFormArrayState = input.required<Field<never>>();\n\n /** Not an `AbstractControl`, which is what tells the field to read the getters below. */\n readonly control = null;\n\n get touched(): boolean {\n return this.wrSchemaFormArrayState()().touched();\n }\n\n get dirty(): boolean {\n return this.wrSchemaFormArrayState()().dirty();\n }\n\n /** The array's OWN errors, keyed by kind. An item's errors show beside the item's control. */\n get errors(): ValidationErrors | null {\n const errors = this.wrSchemaFormArrayState()().errors();\n return errors.length ? Object.fromEntries(errors.map(error => [error.kind, error])) : 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 { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n Injector,\n type Signal,\n ViewEncapsulation,\n afterNextRender,\n computed,\n inject,\n input,\n isDevMode,\n} from '@angular/core';\nimport { FormField, type Field, type FieldState, type FieldTree, isFieldTree } from '@angular/forms/signals';\n\nimport { WrButton } from 'ngwr/button';\nimport { WrCheckbox } from 'ngwr/checkbox';\nimport { WrDatePicker, WrDateRangePicker } from 'ngwr/date-picker';\nimport { WrFileUpload } from 'ngwr/file-upload';\nimport { WR_FIELD, WrFormField, wrFieldLabel, type WrFieldSpec } from 'ngwr/form';\nimport { useI18nText } from 'ngwr/i18n';\nimport { WrInput } from 'ngwr/input';\nimport { WrInputNumber } from 'ngwr/input-number';\nimport { WrRadio, WrRadioGroup } from 'ngwr/radio';\nimport { WrRating } from 'ngwr/rating';\nimport { WrSegmented } from 'ngwr/segmented';\nimport { WrOption, WrSelect } from 'ngwr/select';\nimport { WrSlider } from 'ngwr/slider';\nimport { WrSwitch } from 'ngwr/switch';\nimport { WrTextarea } from 'ngwr/textarea';\nimport { wrNumAttr, wrCheckStyles } from 'ngwr/utils';\n\nimport { WrSchemaFormArrayState } from './array-state';\n\n/** One field the template draws, resolved once per schema change. */\ninterface WrRenderedField {\n readonly key: string;\n readonly field: Field<never>;\n readonly spec: WrFieldSpec;\n /** `spec.label`, or the key de-camel-cased. */\n readonly label: string;\n /**\n * The same text, or `''` for the two kinds that carry their own label inside\n * the control. Resolved here rather than in the template: a method call in a\n * template is re-run on every pass, and this is decided once per schema.\n */\n readonly labelAbove: string;\n /** `grid-column`, already clamped to the columns of the grid the field sits on. */\n readonly column: string;\n /** DOM id prefix for the parts of an `array` field. */\n readonly id: string;\n /** The item fields of an `array`, in order. Empty for every other kind. */\n readonly items: Signal<readonly FieldTree<object>[]>;\n}\n\n/** A run of fields drawn inside one `<fieldset>`. */\ninterface WrRenderedSection {\n readonly id: string;\n readonly title: string;\n readonly description: string;\n /** `grid-template-columns` of the section's own grid. */\n readonly template: string;\n readonly fields: WrRenderedField[];\n /** False while the schema hides every field in it: an empty fieldset announces a group of nothing. */\n readonly visible: Signal<boolean>;\n}\n\n/** One child of the form's grid: a field, or a section holding several. */\ninterface WrRenderedCell {\n readonly key: string;\n readonly field?: WrRenderedField;\n readonly section?: WrRenderedSection;\n}\n\nconst NO_ITEMS: Signal<readonly FieldTree<object>[]> = computed(() => []);\n\nlet uid = 0;\n\n/**\n * The two kinds that carry their own label. Everything else gets one above the\n * control, from `<wr-form-field>`.\n */\nconst SELF_LABELLING = new Set<WrFieldSpec['kind']>(['checkbox', 'switch']);\n\n/** What each kind writes into the model, for the dev-mode mismatch warning. */\nconst EXPECTED_TYPE: Partial<Record<WrFieldSpec['kind'], string>> = {\n input: 'string',\n textarea: 'string',\n number: 'number',\n multiselect: 'array',\n tags: 'array',\n checkbox: 'boolean',\n switch: 'boolean',\n slider: 'number',\n rating: 'number',\n array: 'array',\n};\n\n/** `typeof`, with the one distinction it does not make and three kinds depend on. */\nfunction typeOf(value: unknown): string {\n return Array.isArray(value) ? 'array' : typeof value;\n}\n\n/** The track list of a grid of `columns` equal columns. */\nfunction tracks(columns: number): string {\n return `repeat(${Math.max(1, Math.round(columns))}, minmax(0, 1fr))`;\n}\n\n/**\n * The first field of a group a keyboard can land on: described, not hidden and\n * not disabled, in the model's key order. A nested `array` is passed over, since\n * it has no control of its own to focus.\n */\nfunction firstControl(group: FieldTree<object>): Field<never> | null {\n for (const [, child] of group as unknown as Iterable<[string, unknown]>) {\n if (!isFieldTree(child)) continue;\n const state = (child as Field<never>)();\n const spec = state.metadata(WR_FIELD)?.();\n if (spec && spec.kind !== 'array' && !state.hidden() && !state.disabled()) return child as Field<never>;\n }\n return null;\n}\n\n/**\n * Warn when a group's described fields are about to be drawn by nothing.\n *\n * A field tree is iterated one level deep, so an object-valued field with no\n * `WR_FIELD` of its own is skipped exactly like an undescribed leaf — and its\n * children go with it. That is the right default (a model nests for reasons\n * that have nothing to do with a screen), but it is indistinguishable from a\n * half-drawn form: nothing is missing from the DOM, so nothing looks wrong.\n *\n * Describing the children and getting none of them is never intentional, so\n * that exact shape is what this reports. A group whose children carry no spec\n * either is silent, because it is a model detail this screen does not render.\n */\nfunction warnOnUndrawnGroup(key: string, group: unknown): void {\n // A field tree over a primitive is not iterable, and every undescribed leaf\n // arrives here — so the guard is what keeps this from throwing on the common\n // case rather than a defence against an exotic one.\n const subfields = (group as Partial<Iterable<[string, unknown]>>)[Symbol.iterator];\n if (typeof subfields !== 'function') return;\n // An array iterates its items, not `[key, field]` pairs.\n if (Array.isArray((group as Field<never>)().value())) return;\n\n let described = 0;\n for (const [, child] of group as Iterable<[string, unknown]>) {\n if (isFieldTree(child) && (child as Field<never>)().metadata(WR_FIELD)?.()) described++;\n }\n if (described === 0) return;\n\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] <wr-schema-form>: \"${key}\" is a group holding ${described} described ` +\n `field(s), and none of them are drawn — a field tree is walked one level deep. ` +\n `Draw the group with a second <wr-schema-form [field]=\"form.${key}\" />, or give ` +\n `\"${key}\" a WR_FIELD of its own if this screen is meant to skip it.`\n );\n}\n\n/**\n * Warn when a `kind` contradicts what the field actually holds.\n *\n * This is the one failure mode of the whole component that nothing else\n * reports: `kind` is a string on a metadata value, so TypeScript cannot hold it\n * against the field's own type, and a `kind: 'number'` on a `string` field\n * renders a `<wr-input-number>` that writes numbers into it forever. The runtime\n * value is the only evidence available, so an empty or nullish one says nothing\n * and is left alone.\n */\nfunction warnOnKindMismatch(f: WrRenderedField): void {\n const expected = EXPECTED_TYPE[f.spec.kind];\n const value = f.field().value();\n if (!expected || value === null || value === undefined || value === '') return;\n if (typeOf(value) === expected) return;\n\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] <wr-schema-form>: field \"${f.key}\" is described as kind '${f.spec.kind}', ` +\n `which writes a ${expected}, but the field holds a ${typeOf(value)}. ` +\n `The control will overwrite the model with the wrong type.`\n );\n}\n\n/**\n * A form drawn from a Signal Forms schema — one `<wr-form-field>`, one control\n * and one set of error messages per described field, laid out on a grid.\n *\n * The presentation rides on the SAME schema as the validation, through the\n * `WR_FIELD` metadata key from `ngwr/form`:\n *\n * ```ts\n * const profile = form(model, path => {\n * required(path.email, { message: 'Enter your email.' });\n * email(path.email, { message: 'That is not an email address.' });\n * metadata(path.email, WR_FIELD, () => ({ kind: 'input', type: 'email' }));\n * metadata(path.role, WR_FIELD, () => ({ kind: 'select', options: ROLES }));\n * });\n * ```\n * ```html\n * <wr-schema-form [field]=\"profile\" [columns]=\"2\" />\n * ```\n *\n * The error messages are the rules' own: each field's `<wr-form-field>` shows a\n * validator's `message`, else `validation.<key>` from the app's i18n catalog.\n * ngwr ships no error texts, so a rule with neither renders no message.\n *\n * **A field with no `WR_FIELD` metadata is skipped**, silently and on purpose: a\n * schema may describe more than one screen renders, and guessing a control from\n * a field's type would draw a `wr-switch` for every boolean flag in the model.\n * Order is the model's own key order.\n *\n * **`required`, `disabled`, `readonly` and `hidden` are NOT in the spec.** They\n * are Angular's own schema functions, `[formField]` already applies the first\n * three to the control, and this component reads `hidden()` to decide whether to\n * draw the field at all — which Angular's docs say a template has to do itself.\n * Re-declaring any of them here would be a second source of truth for state the\n * form already owns.\n *\n * **A section is a spec key, a repeating group is a kind.** Fields naming the\n * same `section` are drawn in one `<fieldset>` under its title. A field of\n * `kind: 'array'` over an array of objects draws one group per item, each a\n * `<wr-schema-form>` of its own, so the items' fields are described once with\n * `applyEach`. Add and Remove write the array, and `minLength` and `maxLength`\n * on it are the bounds they stop at.\n *\n * **Why its own entry point rather than `ngwr/form`.** Drawing every kind means\n * depending on every control, and `ngwr/form` is the layout primitive every\n * form imports — folding this in would put a date picker and a slider into the\n * bundle of an app that only wanted `<wr-form-field>`.\n *\n * @see https://ngwr.dev/reference/components/schema-form\n */\n@Component({\n selector: 'wr-schema-form',\n templateUrl: './schema-form.html',\n encapsulation: ViewEncapsulation.None,\n imports: [\n FormField,\n NgTemplateOutlet,\n WrButton,\n WrCheckbox,\n WrDatePicker,\n WrDateRangePicker,\n WrFileUpload,\n WrFormField,\n WrInput,\n WrInputNumber,\n WrOption,\n WrRadio,\n WrRadioGroup,\n WrRating,\n WrSchemaFormArrayState,\n WrSegmented,\n WrSelect,\n WrSlider,\n WrSwitch,\n WrTextarea,\n ],\n host: {\n class: 'wr-schema-form',\n '[style.grid-template-columns]': 'template()',\n },\n})\nexport class WrSchemaForm<T extends object> {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('schema-form');\n }\n\n // Generic, rather than `FieldTree<Record<string, unknown>>`, because a model\n // declared as an `interface` has no index signature and is not assignable to\n // that: every consumer would have had to declare their model as a type alias\n // just to bind it. `T extends object` still refuses a field tree over a\n // primitive, which has no subfields and would draw nothing.\n /**\n * The form to draw — the value `form()` returned, or any object-valued field\n * inside one.\n */\n readonly field = input.required<FieldTree<T>>();\n\n /**\n * Grid columns. A field spans one of them unless its spec says otherwise.\n * @default 1\n */\n readonly columns = input(1, { transform: wrNumAttr(1) });\n\n /** Text of the button that adds an item to a repeating group. Falls back to `common.add`. */\n readonly addLabel = input<string | null>(null);\n\n /** Text of the button that removes one item of a repeating group. Falls back to `common.remove`. */\n readonly removeLabel = input<string | null>(null);\n\n protected readonly resolvedAdd = useI18nText(this.addLabel, 'common.add', 'Add');\n protected readonly resolvedRemove = useI18nText(this.removeLabel, 'common.remove', 'Remove');\n\n private readonly injector = inject(Injector);\n private readonly uid = `wr-schema-form-${++uid}`;\n\n /**\n * The track list, written as a style rather than published as a\n * `--wr-schema-form-columns` hook: `columns` always has a value, so the\n * inline style would win over any declaration a consumer wrote and the hook\n * would be one nobody could use.\n */\n protected readonly template = computed(() => tracks(this.columns()));\n\n /**\n * The described fields, in the model's key order, with the fields of a\n * section gathered where its first field stands.\n *\n * A field tree over an object is iterable as `[key, field]` pairs, which is\n * the whole reason this component needs no field list of its own. `isFieldTree`\n * guards the pair: a model carrying a method or a non-field property would\n * otherwise be read as a field and answer `undefined` to everything.\n */\n protected readonly cells = computed<readonly WrRenderedCell[]>(() => {\n const columns = this.columns();\n const described: { key: string; field: Field<never>; spec: WrFieldSpec; title: string | null }[] = [];\n // What each section says about itself: the first field to state a member wins.\n const stated = new Map<string, { description?: string; columns?: number }>();\n\n for (const [key, child] of this.field() as unknown as Iterable<[string, unknown]>) {\n if (!isFieldTree(child)) continue;\n\n const field = child as Field<never>;\n const spec = field().metadata(WR_FIELD)?.();\n if (!spec) {\n if (isDevMode()) warnOnUndrawnGroup(key, child);\n continue;\n }\n\n const section = typeof spec.section === 'string' ? { title: spec.section } : spec.section;\n if (section) {\n const known = stated.get(section.title) ?? {};\n stated.set(section.title, {\n description: known.description ?? section.description,\n columns: known.columns ?? section.columns,\n });\n }\n described.push({ key, field, spec, title: section?.title ?? null });\n }\n\n const out: WrRenderedCell[] = [];\n const sections = new Map<string, WrRenderedSection>();\n const all: WrRenderedField[] = [];\n\n for (const { key, field, spec, title } of described) {\n const grid = title === null ? columns : Math.max(1, Math.round(stated.get(title)?.columns ?? columns));\n const label = spec.label ?? wrFieldLabel(key);\n const span = Math.min(Math.max(Math.round(spec.span ?? 1), 1), grid);\n const rendered: WrRenderedField = {\n key,\n field,\n spec,\n label,\n labelAbove: SELF_LABELLING.has(spec.kind) ? '' : label,\n column: `span ${span}`,\n id: `${this.uid}-${key}`,\n items:\n spec.kind === 'array'\n ? computed(() => {\n const value: unknown = field().value();\n const list = field as unknown as ArrayLike<FieldTree<object>>;\n return Array.isArray(value) ? value.map((_, index) => list[index]) : [];\n })\n : NO_ITEMS,\n };\n all.push(rendered);\n\n if (title === null) {\n out.push({ key, field: rendered });\n continue;\n }\n\n let section = sections.get(title);\n if (!section) {\n const fields: WrRenderedField[] = [];\n section = {\n id: `${this.uid}-section-${sections.size}`,\n title,\n description: stated.get(title)?.description ?? '',\n template: tracks(grid),\n fields,\n visible: computed(() => fields.some(each => !each.field().hidden())),\n };\n sections.set(title, section);\n out.push({ key: `section:${title}`, section });\n }\n section.fields.push(rendered);\n }\n\n if (isDevMode()) all.forEach(f => warnOnKindMismatch(f));\n return out;\n });\n\n /** Types the context of the cell template, which an outlet hands over untyped. */\n protected rendered(field: unknown): WrRenderedField {\n return field as WrRenderedField;\n }\n\n /** Whether a repeating group may take one more item: not past `maxLength`, and not disabled or read-only. */\n protected canAdd(f: WrRenderedField): boolean {\n const state = f.field();\n return !state.disabled() && !state.readonly() && f.items().length < (state.maxLength?.() ?? Infinity);\n }\n\n /** Whether a repeating group may lose an item: not under `minLength`, and not disabled or read-only. */\n protected canRemove(f: WrRenderedField): boolean {\n const state = f.field();\n return !state.disabled() && !state.readonly() && f.items().length > (state.minLength?.() ?? 0);\n }\n\n /**\n * What describes a repeating group: its own errors while it shows any, else\n * its hint. The ids are the ones `<wr-form-field>` derives from `controlId`,\n * and the condition is the one it shows errors on, so the reference never\n * names an element that is not drawn.\n */\n protected describedBy(f: WrRenderedField): string | null {\n const state = f.field();\n if ((state.touched() || state.dirty()) && state.errors().length) return `${f.id}-errors`;\n return f.spec.hint ? `${f.id}-hint` : null;\n }\n\n /** Append a new item and move focus into it. */\n protected add(f: WrRenderedField): void {\n const make = f.spec.item;\n if (!make || !this.canAdd(f)) return;\n\n const index = f.items().length;\n this.write(f, list => [...list, make()]);\n afterNextRender(() => this.focusItem(f, index), { injector: this.injector });\n }\n\n /**\n * Remove one item. Focus goes to the item that took its place, and from the\n * last one to the Add button, so it never falls back to the page.\n */\n protected remove(f: WrRenderedField, index: number, list: HTMLElement): void {\n if (!this.canRemove(f)) return;\n\n this.write(f, items => items.filter((_, each) => each !== index));\n afterNextRender(\n () => {\n const length = f.items().length;\n if (index < length) return this.focusItem(f, index);\n const add = list.querySelector<HTMLElement>(':scope > .wr-schema-form__add:not([disabled])');\n if (add) add.focus();\n else if (length) this.focusItem(f, length - 1);\n },\n { injector: this.injector }\n );\n }\n\n private write(f: WrRenderedField, change: (items: readonly unknown[]) => readonly unknown[]): void {\n const state = f.field() as unknown as FieldState<readonly unknown[]>;\n state.value.update(change);\n state.markAsDirty();\n // The array alone: a new item's fields are not touched because the list was.\n state.markAsTouched({ skipDescendants: true });\n }\n\n private focusItem(f: WrRenderedField, index: number): void {\n const item = f.items()[index];\n if (item) firstControl(item)?.().focusBoundControl();\n }\n}\n","<ng-template #cell let-drawn>\n @let f = rendered(drawn);\n @let state = f.field();\n\n <!-- Angular's `hidden()` does not hide anything on its own; the docs are\n explicit that the template has to honour it. -->\n @if (!state.hidden()) {\n @if (f.spec.kind === 'array') {\n <fieldset class=\"wr-schema-form__array\" [style.grid-column]=\"f.column\" [attr.aria-describedby]=\"describedBy(f)\">\n <legend class=\"wr-schema-form__legend\">\n {{ f.label }}\n @if (state.required()) {\n <span class=\"wr-form-field__required\" aria-hidden=\"true\">*</span>\n }\n </legend>\n <wr-form-field [hint]=\"f.spec.hint ?? ''\" [controlId]=\"f.id\">\n <div #list class=\"wr-schema-form__items\" [id]=\"`${f.id}-items`\" [wrSchemaFormArrayState]=\"f.field\">\n @for (item of f.items(); track item) {\n <div class=\"wr-schema-form__item\" role=\"group\" [attr.aria-labelledby]=\"`${f.id}-title-${$index}`\">\n <div class=\"wr-schema-form__item-head\">\n <span class=\"wr-schema-form__item-title\" [id]=\"`${f.id}-title-${$index}`\"\n >{{ f.spec.itemLabel ?? f.label }} {{ $index + 1 }}</span\n >\n <!-- Named by its own text and then the item's heading, so a\n list of five reads \"Remove Address 2\", not \"Remove\" five times. -->\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n class=\"wr-schema-form__remove\"\n [id]=\"`${f.id}-remove-${$index}`\"\n [attr.aria-labelledby]=\"`${f.id}-remove-${$index} ${f.id}-title-${$index}`\"\n [disabled]=\"!canRemove(f)\"\n (click)=\"remove(f, $index, list)\"\n >\n {{ resolvedRemove() }}\n </button>\n </div>\n <wr-schema-form\n [field]=\"item\"\n [columns]=\"f.spec.columns ?? 1\"\n [addLabel]=\"addLabel()\"\n [removeLabel]=\"removeLabel()\"\n />\n </div>\n }\n @if (f.spec.item) {\n <button wr-btn type=\"button\" class=\"wr-schema-form__add\" [disabled]=\"!canAdd(f)\" (click)=\"add(f)\">\n {{ resolvedAdd() }}\n </button>\n }\n </div>\n </wr-form-field>\n </fieldset>\n } @else {\n <div class=\"wr-schema-form__field\" [style.grid-column]=\"f.column\">\n <wr-form-field [label]=\"f.labelAbove\" [hint]=\"f.spec.hint ?? ''\" [required]=\"state.required()\">\n @switch (f.spec.kind) {\n @case ('textarea') {\n <wr-textarea [formField]=\"f.field\" [placeholder]=\"f.spec.placeholder ?? ''\" [ariaLabel]=\"f.label\" />\n }\n @case ('number') {\n <wr-input-number\n [formField]=\"f.field\"\n [placeholder]=\"f.spec.placeholder ?? ''\"\n [step]=\"f.spec.step ?? 1\"\n [ariaLabel]=\"f.label\"\n />\n }\n @case ('select') {\n <wr-select [formField]=\"f.field\" [placeholder]=\"f.spec.placeholder ?? null\" [ariaLabel]=\"f.label\">\n @for (option of f.spec.options ?? []; track option.value) {\n <wr-option [value]=\"option.value\" [disabled]=\"option.disabled ?? false\">{{ option.label }}</wr-option>\n }\n </wr-select>\n }\n @case ('multiselect') {\n <wr-select\n mode=\"multi\"\n [formField]=\"f.field\"\n [placeholder]=\"f.spec.placeholder ?? null\"\n [ariaLabel]=\"f.label\"\n >\n @for (option of f.spec.options ?? []; track option.value) {\n <wr-option [value]=\"option.value\" [disabled]=\"option.disabled ?? false\">{{ option.label }}</wr-option>\n }\n </wr-select>\n }\n @case ('tags') {\n <wr-select\n mode=\"tag\"\n [formField]=\"f.field\"\n [placeholder]=\"f.spec.placeholder ?? null\"\n [ariaLabel]=\"f.label\"\n />\n }\n @case ('checkbox') {\n <wr-checkbox [formField]=\"f.field\">{{ f.label }}</wr-checkbox>\n }\n @case ('switch') {\n <wr-switch [formField]=\"f.field\">{{ f.label }}</wr-switch>\n }\n @case ('radio') {\n <!-- `wr-radio-group` has no `ariaLabel` input, and needs none: its\n host is a `role=\"radiogroup\"`, where `aria-label` is legal. -->\n <wr-radio-group [formField]=\"f.field\" [attr.aria-label]=\"f.label\">\n @for (option of f.spec.options ?? []; track option.value) {\n <wr-radio [value]=\"option.value\" [disabled]=\"option.disabled ?? false\">{{ option.label }}</wr-radio>\n }\n </wr-radio-group>\n }\n @case ('segmented') {\n <wr-segmented [formField]=\"f.field\" [options]=\"f.spec.options ?? []\" />\n }\n @case ('date') {\n <wr-date-picker [formField]=\"f.field\" [placeholder]=\"f.spec.placeholder ?? ''\" [ariaLabel]=\"f.label\" />\n }\n @case ('daterange') {\n <!-- The picker names its two inputs \"Range start\" and \"Range end\";\n the group around them is what carries the field's own label. -->\n <wr-date-range-picker [formField]=\"f.field\" role=\"group\" [attr.aria-label]=\"f.label\" />\n }\n @case ('slider') {\n <wr-slider [formField]=\"f.field\" [step]=\"f.spec.step ?? 1\" [ariaLabel]=\"f.label\" />\n }\n @case ('rating') {\n <wr-rating [formField]=\"f.field\" [ariaLabel]=\"f.label\" />\n }\n @case ('file') {\n <wr-file-upload\n [formField]=\"f.field\"\n [multiple]=\"f.spec.multiple ?? false\"\n [accept]=\"f.spec.accept ?? ''\"\n />\n }\n @default {\n <input\n wrInput\n [formField]=\"f.field\"\n [type]=\"f.spec.type ?? 'text'\"\n [placeholder]=\"f.spec.placeholder ?? ''\"\n />\n }\n }\n </wr-form-field>\n </div>\n }\n }\n</ng-template>\n\n@for (c of cells(); track c.key) {\n @if (c.section; as section) {\n @if (section.visible()) {\n <fieldset\n class=\"wr-schema-form__section\"\n [attr.aria-describedby]=\"section.description ? `${section.id}-description` : null\"\n >\n <legend class=\"wr-schema-form__legend\">{{ section.title }}</legend>\n @if (section.description) {\n <p class=\"wr-schema-form__description\" [id]=\"`${section.id}-description`\">{{ section.description }}</p>\n }\n <div class=\"wr-schema-form__grid\" [style.grid-template-columns]=\"section.template\">\n @for (f of section.fields; track f.key) {\n <ng-container [ngTemplateOutlet]=\"cell\" [ngTemplateOutletContext]=\"{ $implicit: f }\" />\n }\n </div>\n </fieldset>\n }\n } @else {\n <ng-container [ngTemplateOutlet]=\"cell\" [ngTemplateOutletContext]=\"{ $implicit: c.field }\" />\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,IAAa,yBAAb,MAAa,uBAAsB;CACjC,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,aAAa;CAChF;CAES,yBAAyB,MAAM,SAAwB,GAAA,YAAA,CAAA,EAAA,WAAA,yBAAA,CAAA,+BAAA,CAAA,CAAA;CAGvD,UAAU;CAEnB,IAAI,UAAO;EACT,OAAO,KAAK,uBAAsB,CAAE,CAAA,CAAE,CAAC,QAAO;CAChD;CAEA,IAAI,QAAK;EACP,OAAO,KAAK,uBAAsB,CAAE,CAAA,CAAE,CAAC,MAAK;CAC9C;CAGA,IAAI,SAAM;EACR,MAAM,SAAS,KAAK,uBAAsB,CAAE,CAAA,CAAE,CAAC,OAAM;EACrD,OAAO,OAAO,SAAS,OAAO,YAAY,OAAO,KAAI,UAAS,CAAC,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI;CACxF;CAtBW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAsB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAtB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAsB,cA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