@wirabyte/ui 1.0.0-beta.0 → 1.0.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 (252) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +6 -6
  3. package/avatar/avatar.component.d.ts +4 -2
  4. package/avatar/avatar.types.d.ts +3 -0
  5. package/breadcrumb/breadcrumb.component.d.ts +3 -1
  6. package/button/button.styles.d.ts +1 -1
  7. package/chat/chat.component.d.ts +118 -0
  8. package/chat/chat.module.d.ts +8 -0
  9. package/chat/chat.types.d.ts +64 -0
  10. package/chat/index.d.ts +5 -0
  11. package/chat/public-api.d.ts +3 -0
  12. package/config/options.d.ts +6 -0
  13. package/config/theme.service.d.ts +5 -0
  14. package/config/wu-config.service.d.ts +6 -0
  15. package/core/catalog.d.ts +6 -1
  16. package/core/overrides.d.ts +7 -0
  17. package/core/thai/locale.d.ts +47 -0
  18. package/datepicker/datepicker.component.d.ts +1 -1
  19. package/descriptions/descriptions.component.d.ts +56 -0
  20. package/descriptions/descriptions.module.d.ts +8 -0
  21. package/descriptions/index.d.ts +5 -0
  22. package/descriptions/public-api.d.ts +2 -0
  23. package/esm2020/accordion/accordion.component.mjs +4 -4
  24. package/esm2020/alert/alert-dialog.component.mjs +3 -3
  25. package/esm2020/avatar/avatar.component.mjs +10 -5
  26. package/esm2020/avatar/avatar.types.mjs +2 -2
  27. package/esm2020/breadcrumb/breadcrumb.component.mjs +5 -3
  28. package/esm2020/button/button.component.mjs +3 -3
  29. package/esm2020/button/button.styles.mjs +2 -2
  30. package/esm2020/card/card.component.mjs +8 -8
  31. package/esm2020/chat/chat.component.mjs +370 -0
  32. package/esm2020/chat/chat.module.mjs +17 -0
  33. package/esm2020/chat/chat.types.mjs +2 -0
  34. package/esm2020/chat/public-api.mjs +4 -0
  35. package/esm2020/chat/wirabyte-ui-chat.mjs +5 -0
  36. package/esm2020/config/options.mjs +1 -1
  37. package/esm2020/config/theme.service.mjs +35 -3
  38. package/esm2020/config/wu-config.service.mjs +9 -1
  39. package/esm2020/core/catalog.mjs +22 -2
  40. package/esm2020/core/families.mjs +43 -1
  41. package/esm2020/core/overrides.mjs +26 -1
  42. package/esm2020/core/thai/locale.mjs +67 -1
  43. package/esm2020/datepicker/datepicker.component.mjs +2 -2
  44. package/esm2020/descriptions/descriptions.component.mjs +112 -0
  45. package/esm2020/descriptions/descriptions.module.mjs +17 -0
  46. package/esm2020/descriptions/public-api.mjs +3 -0
  47. package/esm2020/descriptions/wirabyte-ui-descriptions.mjs +5 -0
  48. package/esm2020/dialog/dialog.component.mjs +3 -3
  49. package/esm2020/drawer/drawer.component.mjs +3 -3
  50. package/esm2020/emptystate/emptystate.component.mjs +3 -3
  51. package/esm2020/errorpage/errorpage.component.mjs +3 -3
  52. package/esm2020/fieldset/fieldset.component.mjs +4 -4
  53. package/esm2020/metergroup/metergroup.component.mjs +29 -5
  54. package/esm2020/metergroup/metergroup.types.mjs +1 -1
  55. package/esm2020/navbar/navbar.component.mjs +3 -3
  56. package/esm2020/panel/panel.component.mjs +6 -6
  57. package/esm2020/popover/popover.base.mjs +3 -3
  58. package/esm2020/result/result.component.mjs +3 -3
  59. package/esm2020/scheduler/public-api.mjs +4 -0
  60. package/esm2020/scheduler/scheduler.component.mjs +483 -0
  61. package/esm2020/scheduler/scheduler.module.mjs +17 -0
  62. package/esm2020/scheduler/scheduler.types.mjs +2 -0
  63. package/esm2020/scheduler/wirabyte-ui-scheduler.mjs +5 -0
  64. package/esm2020/selectbutton/selectbutton.component.mjs +23 -5
  65. package/esm2020/signaturepad/public-api.mjs +3 -0
  66. package/esm2020/signaturepad/signaturepad.component.mjs +289 -0
  67. package/esm2020/signaturepad/signaturepad.module.mjs +17 -0
  68. package/esm2020/signaturepad/wirabyte-ui-signaturepad.mjs +5 -0
  69. package/esm2020/stat/public-api.mjs +3 -0
  70. package/esm2020/stat/stat.component.mjs +128 -0
  71. package/esm2020/stat/stat.module.mjs +17 -0
  72. package/esm2020/stat/wirabyte-ui-stat.mjs +5 -0
  73. package/esm2020/table/table.celleditor.mjs +4 -4
  74. package/esm2020/tabs/tabs.component.mjs +3 -3
  75. package/esm2020/tag/tag.component.mjs +3 -3
  76. package/esm2020/textarea/textarea.directive.mjs +19 -1
  77. package/esm2020/thai/thai.pipes.mjs +2 -2
  78. package/esm2020/toolbar/toolbar.component.mjs +7 -7
  79. package/fesm2015/wirabyte-ui-accordion.mjs +3 -3
  80. package/fesm2015/wirabyte-ui-accordion.mjs.map +1 -1
  81. package/fesm2015/wirabyte-ui-alert.mjs +2 -2
  82. package/fesm2015/wirabyte-ui-alert.mjs.map +1 -1
  83. package/fesm2015/wirabyte-ui-avatar.mjs +11 -5
  84. package/fesm2015/wirabyte-ui-avatar.mjs.map +1 -1
  85. package/fesm2015/wirabyte-ui-breadcrumb.mjs +4 -2
  86. package/fesm2015/wirabyte-ui-breadcrumb.mjs.map +1 -1
  87. package/fesm2015/wirabyte-ui-button.mjs +3 -3
  88. package/fesm2015/wirabyte-ui-button.mjs.map +1 -1
  89. package/fesm2015/wirabyte-ui-card.mjs +7 -7
  90. package/fesm2015/wirabyte-ui-card.mjs.map +1 -1
  91. package/fesm2015/wirabyte-ui-chat.mjs +399 -0
  92. package/fesm2015/wirabyte-ui-chat.mjs.map +1 -0
  93. package/fesm2015/wirabyte-ui-config.mjs +42 -2
  94. package/fesm2015/wirabyte-ui-config.mjs.map +1 -1
  95. package/fesm2015/wirabyte-ui-core.mjs +147 -2
  96. package/fesm2015/wirabyte-ui-core.mjs.map +1 -1
  97. package/fesm2015/wirabyte-ui-datepicker.mjs +1 -1
  98. package/fesm2015/wirabyte-ui-datepicker.mjs.map +1 -1
  99. package/fesm2015/wirabyte-ui-descriptions.mjs +133 -0
  100. package/fesm2015/wirabyte-ui-descriptions.mjs.map +1 -0
  101. package/fesm2015/wirabyte-ui-dialog.mjs +2 -2
  102. package/fesm2015/wirabyte-ui-dialog.mjs.map +1 -1
  103. package/fesm2015/wirabyte-ui-drawer.mjs +2 -2
  104. package/fesm2015/wirabyte-ui-drawer.mjs.map +1 -1
  105. package/fesm2015/wirabyte-ui-emptystate.mjs +2 -2
  106. package/fesm2015/wirabyte-ui-emptystate.mjs.map +1 -1
  107. package/fesm2015/wirabyte-ui-errorpage.mjs +2 -2
  108. package/fesm2015/wirabyte-ui-errorpage.mjs.map +1 -1
  109. package/fesm2015/wirabyte-ui-fieldset.mjs +3 -3
  110. package/fesm2015/wirabyte-ui-fieldset.mjs.map +1 -1
  111. package/fesm2015/wirabyte-ui-metergroup.mjs +29 -4
  112. package/fesm2015/wirabyte-ui-metergroup.mjs.map +1 -1
  113. package/fesm2015/wirabyte-ui-navbar.mjs +2 -2
  114. package/fesm2015/wirabyte-ui-navbar.mjs.map +1 -1
  115. package/fesm2015/wirabyte-ui-panel.mjs +5 -5
  116. package/fesm2015/wirabyte-ui-panel.mjs.map +1 -1
  117. package/fesm2015/wirabyte-ui-popover.mjs +2 -2
  118. package/fesm2015/wirabyte-ui-popover.mjs.map +1 -1
  119. package/fesm2015/wirabyte-ui-result.mjs +2 -2
  120. package/fesm2015/wirabyte-ui-result.mjs.map +1 -1
  121. package/fesm2015/wirabyte-ui-scheduler.mjs +514 -0
  122. package/fesm2015/wirabyte-ui-scheduler.mjs.map +1 -0
  123. package/fesm2015/wirabyte-ui-selectbutton.mjs +22 -4
  124. package/fesm2015/wirabyte-ui-selectbutton.mjs.map +1 -1
  125. package/fesm2015/wirabyte-ui-signaturepad.mjs +313 -0
  126. package/fesm2015/wirabyte-ui-signaturepad.mjs.map +1 -0
  127. package/fesm2015/wirabyte-ui-stat.mjs +151 -0
  128. package/fesm2015/wirabyte-ui-stat.mjs.map +1 -0
  129. package/fesm2015/wirabyte-ui-table.mjs +3 -3
  130. package/fesm2015/wirabyte-ui-table.mjs.map +1 -1
  131. package/fesm2015/wirabyte-ui-tabs.mjs +2 -2
  132. package/fesm2015/wirabyte-ui-tabs.mjs.map +1 -1
  133. package/fesm2015/wirabyte-ui-tag.mjs +2 -2
  134. package/fesm2015/wirabyte-ui-tag.mjs.map +1 -1
  135. package/fesm2015/wirabyte-ui-textarea.mjs +18 -0
  136. package/fesm2015/wirabyte-ui-textarea.mjs.map +1 -1
  137. package/fesm2015/wirabyte-ui-thai.mjs +1 -1
  138. package/fesm2015/wirabyte-ui-thai.mjs.map +1 -1
  139. package/fesm2015/wirabyte-ui-toolbar.mjs +6 -6
  140. package/fesm2015/wirabyte-ui-toolbar.mjs.map +1 -1
  141. package/fesm2020/wirabyte-ui-accordion.mjs +3 -3
  142. package/fesm2020/wirabyte-ui-accordion.mjs.map +1 -1
  143. package/fesm2020/wirabyte-ui-alert.mjs +2 -2
  144. package/fesm2020/wirabyte-ui-alert.mjs.map +1 -1
  145. package/fesm2020/wirabyte-ui-avatar.mjs +11 -5
  146. package/fesm2020/wirabyte-ui-avatar.mjs.map +1 -1
  147. package/fesm2020/wirabyte-ui-breadcrumb.mjs +4 -2
  148. package/fesm2020/wirabyte-ui-breadcrumb.mjs.map +1 -1
  149. package/fesm2020/wirabyte-ui-button.mjs +3 -3
  150. package/fesm2020/wirabyte-ui-button.mjs.map +1 -1
  151. package/fesm2020/wirabyte-ui-card.mjs +7 -7
  152. package/fesm2020/wirabyte-ui-card.mjs.map +1 -1
  153. package/fesm2020/wirabyte-ui-chat.mjs +391 -0
  154. package/fesm2020/wirabyte-ui-chat.mjs.map +1 -0
  155. package/fesm2020/wirabyte-ui-config.mjs +42 -2
  156. package/fesm2020/wirabyte-ui-config.mjs.map +1 -1
  157. package/fesm2020/wirabyte-ui-core.mjs +155 -2
  158. package/fesm2020/wirabyte-ui-core.mjs.map +1 -1
  159. package/fesm2020/wirabyte-ui-datepicker.mjs +1 -1
  160. package/fesm2020/wirabyte-ui-datepicker.mjs.map +1 -1
  161. package/fesm2020/wirabyte-ui-descriptions.mjs +133 -0
  162. package/fesm2020/wirabyte-ui-descriptions.mjs.map +1 -0
  163. package/fesm2020/wirabyte-ui-dialog.mjs +2 -2
  164. package/fesm2020/wirabyte-ui-dialog.mjs.map +1 -1
  165. package/fesm2020/wirabyte-ui-drawer.mjs +2 -2
  166. package/fesm2020/wirabyte-ui-drawer.mjs.map +1 -1
  167. package/fesm2020/wirabyte-ui-emptystate.mjs +2 -2
  168. package/fesm2020/wirabyte-ui-emptystate.mjs.map +1 -1
  169. package/fesm2020/wirabyte-ui-errorpage.mjs +2 -2
  170. package/fesm2020/wirabyte-ui-errorpage.mjs.map +1 -1
  171. package/fesm2020/wirabyte-ui-fieldset.mjs +3 -3
  172. package/fesm2020/wirabyte-ui-fieldset.mjs.map +1 -1
  173. package/fesm2020/wirabyte-ui-metergroup.mjs +28 -4
  174. package/fesm2020/wirabyte-ui-metergroup.mjs.map +1 -1
  175. package/fesm2020/wirabyte-ui-navbar.mjs +2 -2
  176. package/fesm2020/wirabyte-ui-navbar.mjs.map +1 -1
  177. package/fesm2020/wirabyte-ui-panel.mjs +5 -5
  178. package/fesm2020/wirabyte-ui-panel.mjs.map +1 -1
  179. package/fesm2020/wirabyte-ui-popover.mjs +2 -2
  180. package/fesm2020/wirabyte-ui-popover.mjs.map +1 -1
  181. package/fesm2020/wirabyte-ui-result.mjs +2 -2
  182. package/fesm2020/wirabyte-ui-result.mjs.map +1 -1
  183. package/fesm2020/wirabyte-ui-scheduler.mjs +504 -0
  184. package/fesm2020/wirabyte-ui-scheduler.mjs.map +1 -0
  185. package/fesm2020/wirabyte-ui-selectbutton.mjs +22 -4
  186. package/fesm2020/wirabyte-ui-selectbutton.mjs.map +1 -1
  187. package/fesm2020/wirabyte-ui-signaturepad.mjs +310 -0
  188. package/fesm2020/wirabyte-ui-signaturepad.mjs.map +1 -0
  189. package/fesm2020/wirabyte-ui-stat.mjs +149 -0
  190. package/fesm2020/wirabyte-ui-stat.mjs.map +1 -0
  191. package/fesm2020/wirabyte-ui-table.mjs +3 -3
  192. package/fesm2020/wirabyte-ui-table.mjs.map +1 -1
  193. package/fesm2020/wirabyte-ui-tabs.mjs +2 -2
  194. package/fesm2020/wirabyte-ui-tabs.mjs.map +1 -1
  195. package/fesm2020/wirabyte-ui-tag.mjs +2 -2
  196. package/fesm2020/wirabyte-ui-tag.mjs.map +1 -1
  197. package/fesm2020/wirabyte-ui-textarea.mjs +18 -0
  198. package/fesm2020/wirabyte-ui-textarea.mjs.map +1 -1
  199. package/fesm2020/wirabyte-ui-thai.mjs +1 -1
  200. package/fesm2020/wirabyte-ui-thai.mjs.map +1 -1
  201. package/fesm2020/wirabyte-ui-toolbar.mjs +6 -6
  202. package/fesm2020/wirabyte-ui-toolbar.mjs.map +1 -1
  203. package/metergroup/metergroup.component.d.ts +16 -3
  204. package/metergroup/metergroup.types.d.ts +6 -0
  205. package/package.json +41 -1
  206. package/scheduler/index.d.ts +5 -0
  207. package/scheduler/public-api.d.ts +3 -0
  208. package/scheduler/scheduler.component.d.ts +143 -0
  209. package/scheduler/scheduler.module.d.ts +8 -0
  210. package/scheduler/scheduler.types.d.ts +46 -0
  211. package/schematics/core/catalog.cjs +22 -1
  212. package/schematics/core/families.cjs +42 -0
  213. package/schematics/core/overrides.cjs +25 -0
  214. package/schematics/core/thai/locale.cjs +66 -0
  215. package/schematics/ng-add/index.cjs +3 -1
  216. package/selectbutton/selectbutton.component.d.ts +12 -1
  217. package/signaturepad/index.d.ts +5 -0
  218. package/signaturepad/public-api.d.ts +2 -0
  219. package/signaturepad/signaturepad.component.d.ts +98 -0
  220. package/signaturepad/signaturepad.module.d.ts +8 -0
  221. package/stat/index.d.ts +5 -0
  222. package/stat/public-api.d.ts +2 -0
  223. package/stat/stat.component.d.ts +61 -0
  224. package/stat/stat.module.d.ts +8 -0
  225. package/textarea/textarea.directive.d.ts +2 -0
  226. package/theme/_data.scss +239 -7
  227. package/theme/_index.scss +29 -0
  228. package/themes/arun-blue/theme.css +30 -1
  229. package/themes/arun-green/theme.css +30 -1
  230. package/themes/arun-orange/theme.css +30 -1
  231. package/themes/arun-purple/theme.css +30 -1
  232. package/themes/md-dark-deeppurple/theme.css +30 -1
  233. package/themes/md-dark-indigo/theme.css +30 -1
  234. package/themes/md-light-deeppurple/theme.css +30 -1
  235. package/themes/md-light-indigo/theme.css +30 -1
  236. package/themes/ratri-blue/theme.css +30 -1
  237. package/themes/ratri-green/theme.css +30 -1
  238. package/themes/ratri-orange/theme.css +30 -1
  239. package/themes/ratri-purple/theme.css +30 -1
  240. package/themes/sayan-blue/theme.css +30 -1
  241. package/themes/sayan-green/theme.css +30 -1
  242. package/themes/sayan-orange/theme.css +30 -1
  243. package/themes/sayan-purple/theme.css +30 -1
  244. package/themes/sila-dark-blue/theme.css +30 -1
  245. package/themes/sila-dark-indigo/theme.css +30 -1
  246. package/themes/sila-dark-purple/theme.css +30 -1
  247. package/themes/sila-dark-teal/theme.css +30 -1
  248. package/themes/sila-light-blue/theme.css +30 -1
  249. package/themes/sila-light-indigo/theme.css +30 -1
  250. package/themes/sila-light-purple/theme.css +30 -1
  251. package/themes/sila-light-teal/theme.css +30 -1
  252. package/themes/sila-light-wira/theme.css +30 -1
@@ -1 +1 @@
1
- {"version":3,"file":"wirabyte-ui-errorpage.mjs","sources":["../../lib/errorpage/errorpage.component.ts","../../lib/errorpage/errorpage.component.html","../../lib/errorpage/errorpage.module.ts","../../lib/errorpage/wirabyte-ui-errorpage.ts"],"sourcesContent":["import { DOCUMENT, NgFor, NgIf, NgSwitch, NgSwitchCase, NgSwitchDefault } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, EventEmitter, inject, Input, OnDestroy, Output, ViewEncapsulation } from '@angular/core';\nimport { ɵassertSupportedAngular, ɵrefreshOnTranslation, ɵWU_SKIP_VERSION_CHECK, WuConfig } from '@wirabyte/ui/config';\nimport { httpErrorActions, httpErrorCode, httpErrorKind, httpErrorTextKey, TH_LOCALE, WuErrorAction, WuErrorKind } from '@wirabyte/ui/core';\n\nexport type { WuErrorAction, WuErrorKind };\n\n/** `'formal'` (default): a clean, plain page. `'kawaii'`: a little character holding up the code, and friendlier words. */\nexport type WuErrorPageLook = 'formal' | 'kawaii';\n\n/** `(action)`: a built-in button was pressed. `originalEvent.preventDefault()` stops its own step (to route instead). */\nexport interface WuErrorPageActionEvent {\n action: WuErrorAction;\n originalEvent: Event;\n}\n\n/** The formal look's picture per kind: a 24 × 24 stroked icon. */\nconst ICONS: Record<WuErrorKind, string> = {\n request: 'M7 3h7l5 5v13H7ZM14 3v5h5M10 13l4 4M14 13l-4 4',\n auth: 'M10 3a4 4 0 1 1 0 8 4 4 0 0 1 0-8ZM3 21v-1a6 6 0 0 1 9-5.2M16 15v-1.5a2 2 0 1 1 4 0V15M14.5 15h7v5.5h-7Z',\n forbidden: 'M12 3l7 3v6c0 4.5-3 7.5-7 9-4-1.5-7-4.5-7-9V6ZM9.5 12v-1.5a2.5 2.5 0 0 1 5 0V12M8.5 12h7v4.5h-7Z',\n missing: 'M10.5 3a7.5 7.5 0 1 1 0 15 7.5 7.5 0 0 1 0-15ZM21 21l-5.2-5.2M8.5 8.5l4 4M12.5 8.5l-4 4',\n time: 'M12 3a9 9 0 1 1 0 18 9 9 0 0 1 0-18ZM12 7v5l3.5 2',\n busy: 'M4 16a8 8 0 1 1 16 0M12 16l4.5-5M3 20h18',\n server: 'M4 4h16v6H4ZM4 14h9v6H4ZM8 7h.01M8 17h.01M18.5 13.5l3 6h-6ZM18.5 16v1.2',\n gateway: 'M9 3v4M15 3v4M7 7h10v4a5 5 0 0 1-10 0ZM12 16v5M3 3l18 18',\n down: 'M14.7 6.3a4 4 0 0 0-5.4 5.4L3 18l3 3 6.3-6.3a4 4 0 0 0 5.4-5.4l-2.6 2.6-2.4-.6-.6-2.4Z',\n};\n\n/**\n * A page for an error status, ready to use: `<wu-error-page code=\"404\"></wu-error-page>` or `look=\"kawaii\"`. Any 4xx /\n * 5xx code works: the common ones (400, 401, 403, 404, 405, 408, 409, 410, 413, 415, 422, 429, 500, 501, 502, 503, 504)\n * have their own words in Thai and English, the rest read as a client or server error. The buttons fit the code (sign\n * in for 401, try again for timeouts and 5xx, back and home otherwise); `[actions]` picks them, `(action)` hears them,\n * elements marked `wuErrorAction` join them, and anything else inside goes in a box under them. `reference` shows an\n * error id people can quote to support. `fullPage` fills the screen (a route's page).\n */\n@Component({\n selector: 'wu-error-page, wu-errorPage',\n standalone: true,\n imports: [NgFor, NgIf, NgSwitch, NgSwitchCase, NgSwitchDefault],\n templateUrl: './errorpage.component.html',\n styleUrls: ['./errorpage.css'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n // `title` is an input here: keep it off the host so the page gets no browser tooltip.\n host: { class: 'wu-error-page-host', '[attr.title]': 'null' },\n})\nexport class WuErrorPage implements OnDestroy {\n /** The HTTP status, 400–599 (`'404'` or `404`). Anything else shows 500. */\n @Input() set code(v: number | string | null | undefined) {\n this._code = httpErrorCode(v);\n }\n get code(): number {\n return this._code;\n }\n /** `'formal'` (default) or `'kawaii'`. */\n @Input() set look(v: WuErrorPageLook | string | null | undefined) {\n this._look = v === 'kawaii' ? 'kawaii' : 'formal';\n }\n get look(): WuErrorPageLook {\n return this._look;\n }\n /** Default: the locale's words for the code (kawaii: for its kind). */\n @Input() title?: string | null;\n @Input() description?: string | null;\n /** An error or request id to quote to support, shown small under the buttons. */\n @Input() reference?: string | null;\n /** Built-in buttons, the main one first: `['retry', 'home']`; `false` for none. Default: what fits the code. */\n @Input() actions?: WuErrorAction[] | boolean | string | null;\n /** Where the home button goes. Default `'/'`. */\n @Input() homeLink: string | null = '/';\n /** Where the sign-in button goes (401). Default `'/login'`. */\n @Input() signInLink: string | null = '/login';\n /** Fill the screen's height, centred (the page of a route). */\n @Input() set fullPage(v: boolean | string | null | undefined) {\n this._full = v === '' || v === true || v === 'true';\n }\n get fullPage(): boolean {\n return this._full;\n }\n /** The title's heading level. Default 1. */\n @Input() headingLevel: number | string = 1;\n @Input() styleClass?: string | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Input() style?: Record<string, any> | string | null;\n\n /** A built-in button was pressed (before its own step; `originalEvent.preventDefault()` stops that). */\n @Output() action = new EventEmitter<WuErrorPageActionEvent>();\n\n private _code = 404;\n private _look: WuErrorPageLook = 'formal';\n private _full = false;\n private readonly config = inject(WuConfig);\n private readonly doc = inject(DOCUMENT);\n private readonly i18n = ɵrefreshOnTranslation();\n\n constructor() {\n ɵassertSupportedAngular(inject(ɵWU_SKIP_VERSION_CHECK, { optional: true }));\n }\n\n ngOnDestroy(): void {\n this.i18n.unsubscribe();\n }\n\n // ---------- what the template reads ----------\n\n get kawaii(): boolean {\n return this._look === 'kawaii';\n }\n get kind(): WuErrorKind {\n return httpErrorKind(this._code);\n }\n get icon(): string {\n return ICONS[this.kind];\n }\n /** The locale's words (an app's own translation without them falls back to Thai). */\n get words(): (typeof TH_LOCALE)['errorPage'] {\n return this.config.translation.errorPage ?? TH_LOCALE.errorPage;\n }\n private get text(): { title: string; description: string } {\n const w = this.words;\n return this.kawaii ? w.kawaii[this.kind] : w.codes[httpErrorTextKey(this._code, w.codes)];\n }\n get titleText(): string {\n return this.title ?? this.text?.title ?? '';\n }\n get descriptionText(): string {\n return this.description ?? this.text?.description ?? '';\n }\n get buttons(): { action: WuErrorAction; label: string; href: string | null }[] {\n const own = this.actions;\n if (own === false || own === 'false') return [];\n const list = Array.isArray(own) ? own : httpErrorActions(this._code);\n const w = this.words;\n return list\n .filter((a) => (a === 'home' ? this.homeLink !== null : a === 'signIn' ? this.signInLink !== null : true))\n .map((a) => ({\n action: a,\n label: a === 'home' ? w.home : a === 'back' ? w.back : a === 'retry' ? w.retry : w.signIn,\n href: a === 'home' ? this.homeLink : a === 'signIn' ? this.signInLink : null,\n }));\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get rootStyle(): Record<string, any> | null {\n return this.style && typeof this.style === 'object' ? this.style : null;\n }\n\n /** A button: tell the app, then (unless it said no) follow the link, go back or reload. */\n run(action: WuErrorAction, event: Event): void {\n this.action.emit({ action, originalEvent: event });\n if (event.defaultPrevented) return;\n const win = this.doc.defaultView;\n if (!win) return;\n if (action === 'back') {\n event.preventDefault();\n if (win.history.length > 1) win.history.back();\n else win.location.assign(this.homeLink || '/');\n } else if (action === 'retry') {\n event.preventDefault();\n win.location.reload();\n }\n }\n}\n","<div\n class=\"wu-error-page\"\n [class]=\"styleClass || ''\"\n [class.wu-error-page-kawaii]=\"kawaii\"\n [class.wu-error-page-formal]=\"!kawaii\"\n [class.wu-error-page-full]=\"fullPage\"\n [style]=\"rootStyle\"\n [attr.data-code]=\"code\"\n [attr.data-kind]=\"kind\"\n>\n <div class=\"wu-ep-art\" aria-hidden=\"true\">\n <ng-container *ngIf=\"!kawaii; else cute\">\n <span class=\"wu-ep-badge\">\n <svg viewBox=\"0 0 24 24\" focusable=\"false\"><path [attr.d]=\"icon\"></path></svg>\n </span>\n <span class=\"wu-ep-label\">{{ words.error }}</span>\n <span class=\"wu-ep-code\">{{ code }}</span>\n </ng-container>\n <ng-template #cute>\n <svg class=\"wu-ep-mascot\" viewBox=\"0 0 260 220\" focusable=\"false\">\n <path class=\"wu-ep-k-blob\" d=\"M44 118C38 62 86 24 138 28s94 42 88 96-50 76-100 74S50 172 44 118Z\"></path>\n <path class=\"wu-ep-k-spark\" d=\"M44 43Q44 52 53 52Q44 52 44 61Q44 52 35 52Q44 52 44 43Z\"></path>\n <path class=\"wu-ep-k-spark wu-ep-k-spark-2\" d=\"M222 143Q222 150 229 150Q222 150 222 157Q222 150 215 150Q222 150 222 143Z\"></path>\n <path class=\"wu-ep-k-spark wu-ep-k-spark-3\" d=\"M210 32Q210 38 216 38Q210 38 210 44Q210 38 204 38Q210 38 210 32Z\"></path>\n <path class=\"wu-ep-k-spark wu-ep-k-spark-2\" d=\"M34 162Q34 168 40 168Q34 168 34 174Q34 168 28 168Q34 168 34 162Z\"></path>\n <ellipse class=\"wu-ep-k-shadow\" cx=\"130\" cy=\"204\" rx=\"58\" ry=\"7\"></ellipse>\n <g class=\"wu-ep-k-bob\">\n <path class=\"wu-ep-k-body\" d=\"M88 96 92 64 116 84ZM172 96 168 64 144 84Z\"></path>\n <path class=\"wu-ep-k-blush\" d=\"M95 88 97 72 109 83ZM165 88 163 72 151 83Z\"></path>\n <path class=\"wu-ep-k-body\" d=\"M66 150C66 104 96 76 130 76s64 28 64 74c0 26-28 36-64 36s-64-10-64-36Z\"></path>\n <ellipse class=\"wu-ep-k-blush\" cx=\"100\" cy=\"134\" rx=\"9\" ry=\"5.5\"></ellipse>\n <ellipse class=\"wu-ep-k-blush\" cx=\"160\" cy=\"134\" rx=\"9\" ry=\"5.5\"></ellipse>\n <ng-container [ngSwitch]=\"kind\">\n <g *ngSwitchCase=\"'server'\" class=\"wu-ep-k-line\">\n <path d=\"M110 118m-1.5 0a1.5 1.5 0 1 1 3 0a3 3 0 1 1-6 0a4.5 4.5 0 1 1 9 0a6 6 0 1 1-12 0\"></path>\n <path d=\"M150 118m-1.5 0a1.5 1.5 0 1 1 3 0a3 3 0 1 1-6 0a4.5 4.5 0 1 1 9 0a6 6 0 1 1-12 0\"></path>\n </g>\n <g *ngSwitchCase=\"'down'\" class=\"wu-ep-k-line\">\n <path d=\"M102 119q8 7 16 0M142 119q8 7 16 0\"></path>\n </g>\n <g *ngSwitchCase=\"'time'\" class=\"wu-ep-k-line\">\n <path d=\"M102 119q8 7 16 0M142 119q8 7 16 0\"></path>\n </g>\n <g *ngSwitchCase=\"'busy'\" class=\"wu-ep-k-line\">\n <path d=\"M104 112l9 6-9 6M156 112l-9 6 9 6\"></path>\n </g>\n <g *ngSwitchDefault class=\"wu-ep-k-eyes\">\n <circle class=\"wu-ep-k-ink\" cx=\"110\" cy=\"118\" r=\"6.5\"></circle>\n <circle class=\"wu-ep-k-ink\" cx=\"150\" cy=\"118\" r=\"6.5\"></circle>\n <circle class=\"wu-ep-k-shine\" cx=\"112.5\" cy=\"115.5\" r=\"2.2\"></circle>\n <circle class=\"wu-ep-k-shine\" cx=\"152.5\" cy=\"115.5\" r=\"2.2\"></circle>\n </g>\n </ng-container>\n <ng-container [ngSwitch]=\"kind\">\n <circle *ngSwitchCase=\"'missing'\" class=\"wu-ep-k-ink\" cx=\"130\" cy=\"137\" r=\"4\"></circle>\n <circle *ngSwitchCase=\"'time'\" class=\"wu-ep-k-ink\" cx=\"130\" cy=\"137\" r=\"3.5\"></circle>\n <path *ngSwitchCase=\"'server'\" class=\"wu-ep-k-line\" d=\"M120 137q5-5 10 0t10 0\"></path>\n <path *ngSwitchCase=\"'gateway'\" class=\"wu-ep-k-line\" d=\"M120 137q5-5 10 0t10 0\"></path>\n <path *ngSwitchCase=\"'forbidden'\" class=\"wu-ep-k-line\" d=\"M123 137h14\"></path>\n <path *ngSwitchCase=\"'busy'\" class=\"wu-ep-k-ink\" d=\"M123 133q7 12 14 0Z\"></path>\n <path *ngSwitchCase=\"'down'\" class=\"wu-ep-k-line\" d=\"M125 136q5 4 10 0\"></path>\n <path *ngSwitchDefault class=\"wu-ep-k-line\" d=\"M122 134q4 5 8 0q4 5 8 0\"></path>\n </ng-container>\n <rect class=\"wu-ep-k-sign\" x=\"90\" y=\"146\" width=\"80\" height=\"40\" rx=\"12\"></rect>\n <text class=\"wu-ep-k-code\" x=\"130\" y=\"174\" text-anchor=\"middle\">{{ code }}</text>\n <circle class=\"wu-ep-k-body\" cx=\"92\" cy=\"158\" r=\"8\"></circle>\n <circle class=\"wu-ep-k-body\" cx=\"168\" cy=\"158\" r=\"8\"></circle>\n <ng-container [ngSwitch]=\"kind\">\n <g *ngSwitchCase=\"'missing'\">\n <circle class=\"wu-ep-k-bubble\" cx=\"206\" cy=\"72\" r=\"17\"></circle>\n <text class=\"wu-ep-k-mark\" x=\"206\" y=\"80\" text-anchor=\"middle\">?</text>\n </g>\n <g *ngSwitchCase=\"'request'\">\n <circle class=\"wu-ep-k-bubble\" cx=\"206\" cy=\"72\" r=\"17\"></circle>\n <text class=\"wu-ep-k-mark\" x=\"206\" y=\"80\" text-anchor=\"middle\">!</text>\n </g>\n <g *ngSwitchCase=\"'auth'\">\n <rect class=\"wu-ep-k-bubble\" x=\"186\" y=\"58\" width=\"38\" height=\"28\" rx=\"6\"></rect>\n <circle class=\"wu-ep-k-blush\" cx=\"197\" cy=\"69\" r=\"4.5\"></circle>\n <path class=\"wu-ep-k-line wu-ep-k-thin\" d=\"M206 67h12M206 75h8\"></path>\n </g>\n <g *ngSwitchCase=\"'forbidden'\">\n <path class=\"wu-ep-k-line wu-ep-k-thin\" d=\"M101 105l14 5M159 105l-14 5\"></path>\n <path class=\"wu-ep-k-line\" d=\"M198 74v-6a8 8 0 0 1 16 0v6\"></path>\n <rect class=\"wu-ep-k-sign wu-ep-k-outline\" x=\"191\" y=\"72\" width=\"30\" height=\"24\" rx=\"6\"></rect>\n <circle class=\"wu-ep-k-shine\" cx=\"206\" cy=\"83\" r=\"3.2\"></circle>\n </g>\n <g *ngSwitchCase=\"'time'\">\n <circle class=\"wu-ep-k-bubble\" cx=\"206\" cy=\"70\" r=\"17\"></circle>\n <path class=\"wu-ep-k-line wu-ep-k-thin\" d=\"M206 70v-9M206 70l6 4\"></path>\n </g>\n <g *ngSwitchCase=\"'busy'\">\n <path class=\"wu-ep-k-drop\" d=\"M188 86c4 6 6 9 6 12a6 6 0 0 1-12 0c0-3 2-6 6-12Z\"></path>\n <path class=\"wu-ep-k-drop wu-ep-k-drop-2\" d=\"M70 98c3 4.5 4.5 7 4.5 9a4.5 4.5 0 0 1-9 0c0-2 1.5-4.5 4.5-9Z\"></path>\n </g>\n <g *ngSwitchCase=\"'server'\" class=\"wu-ep-k-orbit\">\n <path class=\"wu-ep-k-spark\" d=\"M98 56Q98 62 104 62Q98 62 98 68Q98 62 92 62Q98 62 98 56Z\"></path>\n <path class=\"wu-ep-k-spark\" d=\"M162 52Q162 58 168 58Q162 58 162 64Q162 58 156 58Q162 58 162 52Z\"></path>\n <path class=\"wu-ep-k-spark\" d=\"M130 40Q130 45 135 45Q130 45 130 50Q130 45 125 45Q130 45 130 40Z\"></path>\n </g>\n <g *ngSwitchCase=\"'gateway'\">\n <path class=\"wu-ep-k-line\" d=\"M176 156c22-4 26-34 20-52\"></path>\n <rect class=\"wu-ep-k-sign wu-ep-k-outline\" x=\"186\" y=\"86\" width=\"22\" height=\"18\" rx=\"5\"></rect>\n <path class=\"wu-ep-k-line\" d=\"M192 86v-8M202 86v-8\"></path>\n </g>\n <g *ngSwitchCase=\"'down'\" class=\"wu-ep-k-snore\">\n <text class=\"wu-ep-k-mark\" x=\"196\" y=\"78\">Z</text>\n <text class=\"wu-ep-k-mark wu-ep-k-small\" x=\"214\" y=\"58\">z</text>\n </g>\n </ng-container>\n </g>\n </svg>\n </ng-template>\n </div>\n <div class=\"wu-ep-title\" role=\"heading\" [attr.aria-level]=\"headingLevel\">{{ titleText }}</div>\n <p *ngIf=\"descriptionText\" class=\"wu-ep-description\">{{ descriptionText }}</p>\n <div class=\"wu-ep-actions\">\n <ng-container *ngFor=\"let b of buttons; let first = first\">\n <a *ngIf=\"b.href !== null; else plain\" class=\"wu-ep-button\" [class.wu-ep-button-main]=\"first\" [attr.href]=\"b.href\" [attr.data-action]=\"b.action\" (click)=\"run(b.action, $event)\">{{ b.label }}</a>\n <ng-template #plain>\n <button type=\"button\" class=\"wu-ep-button\" [class.wu-ep-button-main]=\"first\" [attr.data-action]=\"b.action\" (click)=\"run(b.action, $event)\">{{ b.label }}</button>\n </ng-template>\n </ng-container>\n <ng-content select=\"[wuErrorAction]\"></ng-content>\n </div>\n <p *ngIf=\"reference\" class=\"wu-ep-reference\">\n {{ words.reference }} <code>{{ reference }}</code>\n </p>\n <div class=\"wu-ep-content\"><ng-content></ng-content></div>\n</div>\n","import { NgModule } from '@angular/core';\nimport { WuErrorPage } from './errorpage.component';\n\n/** For NgModule apps. Standalone apps can import `WuErrorPage` directly. */\n@NgModule({\n imports: [WuErrorPage],\n exports: [WuErrorPage],\n})\nexport class WuErrorPageModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAgBA;AACA,MAAM,K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B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,WAAW,CAAC;oBACtB,OAAO,EAAE,CAAC,WAAW,CAAC;AACvB,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
1
+ {"version":3,"file":"wirabyte-ui-errorpage.mjs","sources":["../../lib/errorpage/errorpage.component.ts","../../lib/errorpage/errorpage.component.html","../../lib/errorpage/errorpage.module.ts","../../lib/errorpage/wirabyte-ui-errorpage.ts"],"sourcesContent":["import { DOCUMENT, NgFor, NgIf, NgSwitch, NgSwitchCase, NgSwitchDefault } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, EventEmitter, inject, Input, OnDestroy, Output, ViewEncapsulation } from '@angular/core';\nimport { ɵassertSupportedAngular, ɵrefreshOnTranslation, ɵWU_SKIP_VERSION_CHECK, WuConfig } from '@wirabyte/ui/config';\nimport { httpErrorActions, httpErrorCode, httpErrorKind, httpErrorTextKey, TH_LOCALE, WuErrorAction, WuErrorKind } from '@wirabyte/ui/core';\n\nexport type { WuErrorAction, WuErrorKind };\n\n/** `'formal'` (default): a clean, plain page. `'kawaii'`: a little character holding up the code, and friendlier words. */\nexport type WuErrorPageLook = 'formal' | 'kawaii';\n\n/** `(action)`: a built-in button was pressed. `originalEvent.preventDefault()` stops its own step (to route instead). */\nexport interface WuErrorPageActionEvent {\n action: WuErrorAction;\n originalEvent: Event;\n}\n\n/** The formal look's picture per kind: a 24 × 24 stroked icon. */\nconst ICONS: Record<WuErrorKind, string> = {\n request: 'M7 3h7l5 5v13H7ZM14 3v5h5M10 13l4 4M14 13l-4 4',\n auth: 'M10 3a4 4 0 1 1 0 8 4 4 0 0 1 0-8ZM3 21v-1a6 6 0 0 1 9-5.2M16 15v-1.5a2 2 0 1 1 4 0V15M14.5 15h7v5.5h-7Z',\n forbidden: 'M12 3l7 3v6c0 4.5-3 7.5-7 9-4-1.5-7-4.5-7-9V6ZM9.5 12v-1.5a2.5 2.5 0 0 1 5 0V12M8.5 12h7v4.5h-7Z',\n missing: 'M10.5 3a7.5 7.5 0 1 1 0 15 7.5 7.5 0 0 1 0-15ZM21 21l-5.2-5.2M8.5 8.5l4 4M12.5 8.5l-4 4',\n time: 'M12 3a9 9 0 1 1 0 18 9 9 0 0 1 0-18ZM12 7v5l3.5 2',\n busy: 'M4 16a8 8 0 1 1 16 0M12 16l4.5-5M3 20h18',\n server: 'M4 4h16v6H4ZM4 14h9v6H4ZM8 7h.01M8 17h.01M18.5 13.5l3 6h-6ZM18.5 16v1.2',\n gateway: 'M9 3v4M15 3v4M7 7h10v4a5 5 0 0 1-10 0ZM12 16v5M3 3l18 18',\n down: 'M14.7 6.3a4 4 0 0 0-5.4 5.4L3 18l3 3 6.3-6.3a4 4 0 0 0 5.4-5.4l-2.6 2.6-2.4-.6-.6-2.4Z',\n};\n\n/**\n * A page for an error status, ready to use: `<wu-error-page code=\"404\"></wu-error-page>` or `look=\"kawaii\"`. Any 4xx /\n * 5xx code works: the common ones (400, 401, 403, 404, 405, 408, 409, 410, 413, 415, 422, 429, 500, 501, 502, 503, 504)\n * have their own words in Thai and English, the rest read as a client or server error. The buttons fit the code (sign\n * in for 401, try again for timeouts and 5xx, back and home otherwise); `[actions]` picks them, `(action)` hears them,\n * elements marked `wuErrorAction` join them, and anything else inside goes in a box under them. `reference` shows an\n * error id people can quote to support. `fullPage` fills the screen (a route's page).\n */\n@Component({\n selector: 'wu-error-page, wu-errorPage',\n standalone: true,\n imports: [NgFor, NgIf, NgSwitch, NgSwitchCase, NgSwitchDefault],\n templateUrl: './errorpage.component.html',\n styleUrls: ['./errorpage.css'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n // `title` is an input here: keep it off the host so the page gets no browser tooltip.\n host: { class: 'wu-error-page-host', '[attr.title]': 'null' },\n})\nexport class WuErrorPage implements OnDestroy {\n /** The HTTP status, 400–599 (`'404'` or `404`). Anything else shows 500. */\n @Input() set code(v: number | string | null | undefined) {\n this._code = httpErrorCode(v);\n }\n get code(): number {\n return this._code;\n }\n /** `'formal'` (default) or `'kawaii'`. */\n @Input() set look(v: WuErrorPageLook | string | null | undefined) {\n this._look = v === 'kawaii' ? 'kawaii' : 'formal';\n }\n get look(): WuErrorPageLook {\n return this._look;\n }\n /** Default: the locale's words for the code (kawaii: for its kind). */\n @Input() title?: string | null;\n @Input() description?: string | null;\n /** An error or request id to quote to support, shown small under the buttons. */\n @Input() reference?: string | null;\n /** Built-in buttons, the main one first: `['retry', 'home']`; `false` for none. Default: what fits the code. */\n @Input() actions?: WuErrorAction[] | boolean | string | null;\n /** Where the home button goes. Default `'/'`. */\n @Input() homeLink: string | null = '/';\n /** Where the sign-in button goes (401). Default `'/login'`. */\n @Input() signInLink: string | null = '/login';\n /** Fill the screen's height, centred (the page of a route). */\n @Input() set fullPage(v: boolean | string | null | undefined) {\n this._full = v === '' || v === true || v === 'true';\n }\n get fullPage(): boolean {\n return this._full;\n }\n /** The title's heading level. Default 1. */\n @Input() headingLevel: number | string = 1;\n @Input() styleClass?: string | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Input() style?: Record<string, any> | string | null;\n\n /** A built-in button was pressed (before its own step; `originalEvent.preventDefault()` stops that). */\n @Output() action = new EventEmitter<WuErrorPageActionEvent>();\n\n private _code = 404;\n private _look: WuErrorPageLook = 'formal';\n private _full = false;\n private readonly config = inject(WuConfig);\n private readonly doc = inject(DOCUMENT);\n private readonly i18n = ɵrefreshOnTranslation();\n\n constructor() {\n ɵassertSupportedAngular(inject(ɵWU_SKIP_VERSION_CHECK, { optional: true }));\n }\n\n ngOnDestroy(): void {\n this.i18n.unsubscribe();\n }\n\n // ---------- what the template reads ----------\n\n get kawaii(): boolean {\n return this._look === 'kawaii';\n }\n get kind(): WuErrorKind {\n return httpErrorKind(this._code);\n }\n get icon(): string {\n return ICONS[this.kind];\n }\n /** The locale's words (an app's own translation without them falls back to Thai). */\n get words(): (typeof TH_LOCALE)['errorPage'] {\n return this.config.translation.errorPage ?? TH_LOCALE.errorPage;\n }\n private get text(): { title: string; description: string } {\n const w = this.words;\n return this.kawaii ? w.kawaii[this.kind] : w.codes[httpErrorTextKey(this._code, w.codes)];\n }\n get titleText(): string {\n return this.title ?? this.text?.title ?? '';\n }\n get descriptionText(): string {\n return this.description ?? this.text?.description ?? '';\n }\n get buttons(): { action: WuErrorAction; label: string; href: string | null }[] {\n const own = this.actions;\n if (own === false || own === 'false') return [];\n const list = Array.isArray(own) ? own : httpErrorActions(this._code);\n const w = this.words;\n return list\n .filter((a) => (a === 'home' ? this.homeLink !== null : a === 'signIn' ? this.signInLink !== null : true))\n .map((a) => ({\n action: a,\n label: a === 'home' ? w.home : a === 'back' ? w.back : a === 'retry' ? w.retry : w.signIn,\n href: a === 'home' ? this.homeLink : a === 'signIn' ? this.signInLink : null,\n }));\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get rootStyle(): Record<string, any> | null {\n return this.style && typeof this.style === 'object' ? this.style : null;\n }\n\n /** A button: tell the app, then (unless it said no) follow the link, go back or reload. */\n run(action: WuErrorAction, event: Event): void {\n this.action.emit({ action, originalEvent: event });\n if (event.defaultPrevented) return;\n const win = this.doc.defaultView;\n if (!win) return;\n if (action === 'back') {\n event.preventDefault();\n if (win.history.length > 1) win.history.back();\n else win.location.assign(this.homeLink || '/');\n } else if (action === 'retry') {\n event.preventDefault();\n win.location.reload();\n }\n }\n}\n","<div\n class=\"wu-error-page\"\n [class]=\"styleClass || ''\"\n [class.wu-error-page-kawaii]=\"kawaii\"\n [class.wu-error-page-formal]=\"!kawaii\"\n [class.wu-error-page-full]=\"fullPage\"\n [style]=\"rootStyle\"\n [attr.data-code]=\"code\"\n [attr.data-kind]=\"kind\"\n>\n <div class=\"wu-ep-art\" aria-hidden=\"true\">\n <ng-container *ngIf=\"!kawaii; else cute\">\n <span class=\"wu-ep-badge\">\n <svg viewBox=\"0 0 24 24\" focusable=\"false\"><path [attr.d]=\"icon\"></path></svg>\n </span>\n <span class=\"wu-ep-label\">{{ words.error }}</span>\n <span class=\"wu-ep-code\">{{ code }}</span>\n </ng-container>\n <ng-template #cute>\n <svg class=\"wu-ep-mascot\" viewBox=\"0 0 260 220\" focusable=\"false\">\n <path class=\"wu-ep-k-blob\" d=\"M44 118C38 62 86 24 138 28s94 42 88 96-50 76-100 74S50 172 44 118Z\"></path>\n <path class=\"wu-ep-k-spark\" d=\"M44 43Q44 52 53 52Q44 52 44 61Q44 52 35 52Q44 52 44 43Z\"></path>\n <path class=\"wu-ep-k-spark wu-ep-k-spark-2\" d=\"M222 143Q222 150 229 150Q222 150 222 157Q222 150 215 150Q222 150 222 143Z\"></path>\n <path class=\"wu-ep-k-spark wu-ep-k-spark-3\" d=\"M210 32Q210 38 216 38Q210 38 210 44Q210 38 204 38Q210 38 210 32Z\"></path>\n <path class=\"wu-ep-k-spark wu-ep-k-spark-2\" d=\"M34 162Q34 168 40 168Q34 168 34 174Q34 168 28 168Q34 168 34 162Z\"></path>\n <ellipse class=\"wu-ep-k-shadow\" cx=\"130\" cy=\"204\" rx=\"58\" ry=\"7\"></ellipse>\n <g class=\"wu-ep-k-bob\">\n <path class=\"wu-ep-k-body\" d=\"M88 96 92 64 116 84ZM172 96 168 64 144 84Z\"></path>\n <path class=\"wu-ep-k-blush\" d=\"M95 88 97 72 109 83ZM165 88 163 72 151 83Z\"></path>\n <path class=\"wu-ep-k-body\" d=\"M66 150C66 104 96 76 130 76s64 28 64 74c0 26-28 36-64 36s-64-10-64-36Z\"></path>\n <ellipse class=\"wu-ep-k-blush\" cx=\"100\" cy=\"134\" rx=\"9\" ry=\"5.5\"></ellipse>\n <ellipse class=\"wu-ep-k-blush\" cx=\"160\" cy=\"134\" rx=\"9\" ry=\"5.5\"></ellipse>\n <ng-container [ngSwitch]=\"kind\">\n <g *ngSwitchCase=\"'server'\" class=\"wu-ep-k-line\">\n <path d=\"M110 118m-1.5 0a1.5 1.5 0 1 1 3 0a3 3 0 1 1-6 0a4.5 4.5 0 1 1 9 0a6 6 0 1 1-12 0\"></path>\n <path d=\"M150 118m-1.5 0a1.5 1.5 0 1 1 3 0a3 3 0 1 1-6 0a4.5 4.5 0 1 1 9 0a6 6 0 1 1-12 0\"></path>\n </g>\n <g *ngSwitchCase=\"'down'\" class=\"wu-ep-k-line\">\n <path d=\"M102 119q8 7 16 0M142 119q8 7 16 0\"></path>\n </g>\n <g *ngSwitchCase=\"'time'\" class=\"wu-ep-k-line\">\n <path d=\"M102 119q8 7 16 0M142 119q8 7 16 0\"></path>\n </g>\n <g *ngSwitchCase=\"'busy'\" class=\"wu-ep-k-line\">\n <path d=\"M104 112l9 6-9 6M156 112l-9 6 9 6\"></path>\n </g>\n <g *ngSwitchDefault class=\"wu-ep-k-eyes\">\n <circle class=\"wu-ep-k-ink\" cx=\"110\" cy=\"118\" r=\"6.5\"></circle>\n <circle class=\"wu-ep-k-ink\" cx=\"150\" cy=\"118\" r=\"6.5\"></circle>\n <circle class=\"wu-ep-k-shine\" cx=\"112.5\" cy=\"115.5\" r=\"2.2\"></circle>\n <circle class=\"wu-ep-k-shine\" cx=\"152.5\" cy=\"115.5\" r=\"2.2\"></circle>\n </g>\n </ng-container>\n <ng-container [ngSwitch]=\"kind\">\n <circle *ngSwitchCase=\"'missing'\" class=\"wu-ep-k-ink\" cx=\"130\" cy=\"137\" r=\"4\"></circle>\n <circle *ngSwitchCase=\"'time'\" class=\"wu-ep-k-ink\" cx=\"130\" cy=\"137\" r=\"3.5\"></circle>\n <path *ngSwitchCase=\"'server'\" class=\"wu-ep-k-line\" d=\"M120 137q5-5 10 0t10 0\"></path>\n <path *ngSwitchCase=\"'gateway'\" class=\"wu-ep-k-line\" d=\"M120 137q5-5 10 0t10 0\"></path>\n <path *ngSwitchCase=\"'forbidden'\" class=\"wu-ep-k-line\" d=\"M123 137h14\"></path>\n <path *ngSwitchCase=\"'busy'\" class=\"wu-ep-k-ink\" d=\"M123 133q7 12 14 0Z\"></path>\n <path *ngSwitchCase=\"'down'\" class=\"wu-ep-k-line\" d=\"M125 136q5 4 10 0\"></path>\n <path *ngSwitchDefault class=\"wu-ep-k-line\" d=\"M122 134q4 5 8 0q4 5 8 0\"></path>\n </ng-container>\n <rect class=\"wu-ep-k-sign\" x=\"90\" y=\"146\" width=\"80\" height=\"40\" rx=\"12\"></rect>\n <text class=\"wu-ep-k-code\" x=\"130\" y=\"174\" text-anchor=\"middle\">{{ code }}</text>\n <circle class=\"wu-ep-k-body\" cx=\"92\" cy=\"158\" r=\"8\"></circle>\n <circle class=\"wu-ep-k-body\" cx=\"168\" cy=\"158\" r=\"8\"></circle>\n <ng-container [ngSwitch]=\"kind\">\n <g *ngSwitchCase=\"'missing'\">\n <circle class=\"wu-ep-k-bubble\" cx=\"206\" cy=\"72\" r=\"17\"></circle>\n <text class=\"wu-ep-k-mark\" x=\"206\" y=\"80\" text-anchor=\"middle\">?</text>\n </g>\n <g *ngSwitchCase=\"'request'\">\n <circle class=\"wu-ep-k-bubble\" cx=\"206\" cy=\"72\" r=\"17\"></circle>\n <text class=\"wu-ep-k-mark\" x=\"206\" y=\"80\" text-anchor=\"middle\">!</text>\n </g>\n <g *ngSwitchCase=\"'auth'\">\n <rect class=\"wu-ep-k-bubble\" x=\"186\" y=\"58\" width=\"38\" height=\"28\" rx=\"6\"></rect>\n <circle class=\"wu-ep-k-blush\" cx=\"197\" cy=\"69\" r=\"4.5\"></circle>\n <path class=\"wu-ep-k-line wu-ep-k-thin\" d=\"M206 67h12M206 75h8\"></path>\n </g>\n <g *ngSwitchCase=\"'forbidden'\">\n <path class=\"wu-ep-k-line wu-ep-k-thin\" d=\"M101 105l14 5M159 105l-14 5\"></path>\n <path class=\"wu-ep-k-line\" d=\"M198 74v-6a8 8 0 0 1 16 0v6\"></path>\n <rect class=\"wu-ep-k-sign wu-ep-k-outline\" x=\"191\" y=\"72\" width=\"30\" height=\"24\" rx=\"6\"></rect>\n <circle class=\"wu-ep-k-shine\" cx=\"206\" cy=\"83\" r=\"3.2\"></circle>\n </g>\n <g *ngSwitchCase=\"'time'\">\n <circle class=\"wu-ep-k-bubble\" cx=\"206\" cy=\"70\" r=\"17\"></circle>\n <path class=\"wu-ep-k-line wu-ep-k-thin\" d=\"M206 70v-9M206 70l6 4\"></path>\n </g>\n <g *ngSwitchCase=\"'busy'\">\n <path class=\"wu-ep-k-drop\" d=\"M188 86c4 6 6 9 6 12a6 6 0 0 1-12 0c0-3 2-6 6-12Z\"></path>\n <path class=\"wu-ep-k-drop wu-ep-k-drop-2\" d=\"M70 98c3 4.5 4.5 7 4.5 9a4.5 4.5 0 0 1-9 0c0-2 1.5-4.5 4.5-9Z\"></path>\n </g>\n <g *ngSwitchCase=\"'server'\" class=\"wu-ep-k-orbit\">\n <path class=\"wu-ep-k-spark\" d=\"M98 56Q98 62 104 62Q98 62 98 68Q98 62 92 62Q98 62 98 56Z\"></path>\n <path class=\"wu-ep-k-spark\" d=\"M162 52Q162 58 168 58Q162 58 162 64Q162 58 156 58Q162 58 162 52Z\"></path>\n <path class=\"wu-ep-k-spark\" d=\"M130 40Q130 45 135 45Q130 45 130 50Q130 45 125 45Q130 45 130 40Z\"></path>\n </g>\n <g *ngSwitchCase=\"'gateway'\">\n <path class=\"wu-ep-k-line\" d=\"M176 156c22-4 26-34 20-52\"></path>\n <rect class=\"wu-ep-k-sign wu-ep-k-outline\" x=\"186\" y=\"86\" width=\"22\" height=\"18\" rx=\"5\"></rect>\n <path class=\"wu-ep-k-line\" d=\"M192 86v-8M202 86v-8\"></path>\n </g>\n <g *ngSwitchCase=\"'down'\" class=\"wu-ep-k-snore\">\n <text class=\"wu-ep-k-mark\" x=\"196\" y=\"78\">Z</text>\n <text class=\"wu-ep-k-mark wu-ep-k-small\" x=\"214\" y=\"58\">z</text>\n </g>\n </ng-container>\n </g>\n </svg>\n </ng-template>\n </div>\n <div class=\"wu-ep-title\" role=\"heading\" [attr.aria-level]=\"headingLevel\">{{ titleText }}</div>\n <p *ngIf=\"descriptionText\" class=\"wu-ep-description\">{{ descriptionText }}</p>\n <div class=\"wu-ep-actions\">\n <ng-container *ngFor=\"let b of buttons; let first = first\">\n <a *ngIf=\"b.href !== null; else plain\" class=\"wu-ep-button\" [class.wu-ep-button-main]=\"first\" [attr.href]=\"b.href\" [attr.data-action]=\"b.action\" (click)=\"run(b.action, $event)\">{{ b.label }}</a>\n <ng-template #plain>\n <button type=\"button\" class=\"wu-ep-button\" [class.wu-ep-button-main]=\"first\" [attr.data-action]=\"b.action\" (click)=\"run(b.action, $event)\">{{ b.label }}</button>\n </ng-template>\n </ng-container>\n <ng-content select=\"[wuErrorAction]\"></ng-content>\n </div>\n <p *ngIf=\"reference\" class=\"wu-ep-reference\">\n {{ words.reference }} <code>{{ reference }}</code>\n </p>\n <div class=\"wu-ep-content\"><ng-content></ng-content></div>\n</div>\n","import { NgModule } from '@angular/core';\nimport { WuErrorPage } from './errorpage.component';\n\n/** For NgModule apps. Standalone apps can import `WuErrorPage` directly. */\n@NgModule({\n imports: [WuErrorPage],\n exports: [WuErrorPage],\n})\nexport class WuErrorPageModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAgBA;AACA,MAAM,KAAK,GAAgC;AACzC,IAAA,OAAO,EAAE,gDAAgD;AACzD,IAAA,IAAI,EAAE,0GAA0G;AAChH,IAAA,SAAS,EAAE,kGAAkG;AAC7G,IAAA,OAAO,EAAE,yFAAyF;AAClG,IAAA,IAAI,EAAE,mDAAmD;AACzD,IAAA,IAAI,EAAE,0CAA0C;AAChD,IAAA,MAAM,EAAE,yEAAyE;AACjF,IAAA,OAAO,EAAE,0DAA0D;AACnE,IAAA,IAAI,EAAE,wFAAwF;CAC/F,CAAC;AAEF;;;;;;;AAOG;MAYU,WAAW,CAAA;;IAEtB,IAAa,IAAI,CAAC,CAAqC,EAAA;AACrD,QAAA,IAAI,CAAC,KAAK,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;KAC/B;AACD,IAAA,IAAI,IAAI,GAAA;QAC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AAhB,KAAK;gBAEG,UAAU,EAAA,CAAA;sBAAlB,KAAK;gBAEO,QAAQ,EAAA,CAAA;sBAApB,KAAK;gBAOG,YAAY,EAAA,CAAA;sBAApB,KAAK;gBACG,UAAU,EAAA,CAAA;sBAAlB,KAAK;gBAEG,KAAK,EAAA,CAAA;sBAAb,KAAK;gBAGI,MAAM,EAAA,CAAA;sBAAf,MAAM;;;AErFT;MAKa,iBAAiB,CAAA;;+GAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;gHAAjB,iBAAiB,EAAA,OAAA,EAAA,CAHlB,WAAW,CAAA,EAAA,OAAA,EAAA,CACX,WAAW,CAAA,EAAA,CAAA,CAAA;AAEV,iBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YAHlB,WAAW,CAAA,EAAA,CAAA,CAAA;4FAGV,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,WAAW,CAAC;oBACtB,OAAO,EAAE,CAAC,WAAW,CAAC;AACvB,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
@@ -47,16 +47,16 @@ class WuFieldset {
47
47
  }
48
48
  }
49
49
  WuFieldset.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WuFieldset, deps: [], target: i0.ɵɵFactoryTarget.Component });
50
- WuFieldset.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: WuFieldset, isStandalone: true, selector: "wu-fieldset", inputs: { legend: "legend", toggleable: "toggleable", collapsed: "collapsed", styleClass: "styleClass", style: "style" }, outputs: { collapsedChange: "collapsedChange", onToggle: "onToggle" }, queries: [{ propertyName: "headerRef", first: true, predicate: ["header"], descendants: true, read: TemplateRef }, { propertyName: "slotTemplates", predicate: WuTemplate }], ngImport: i0, template: "<fieldset [class]=\"classes\" [style]=\"rootStyle\">\n <legend class=\"wu-fieldset-legend p-fieldset-legend\">\n <button\n *ngIf=\"toggleable; else plainLegend\"\n type=\"button\"\n class=\"wu-fieldset-toggle\"\n [attr.aria-expanded]=\"!isCollapsed\"\n [attr.aria-controls]=\"contentId\"\n (click)=\"toggle()\"\n >\n <svg *ngIf=\"isCollapsed\" class=\"p-fieldset-toggler\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" aria-hidden=\"true\"><path d=\"M8 3v10M3 8h10\"></path></svg>\n <svg *ngIf=\"!isCollapsed\" class=\"p-fieldset-toggler\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" aria-hidden=\"true\"><path d=\"M3 8h10\"></path></svg>\n <span class=\"p-fieldset-legend-text\"><ng-container *ngIf=\"headerTemplate; else legendText\"><ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container></ng-container></span>\n </button>\n <ng-template #plainLegend>\n <span class=\"wu-fieldset-legend-label p-fieldset-legend-text\"><ng-container *ngIf=\"headerTemplate; else legendText\"><ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container></ng-container></span>\n </ng-template>\n </legend>\n <div class=\"wu-fieldset-content-container p-toggleable-content\" [id]=\"contentId\" [attr.inert]=\"isCollapsed ? '' : null\">\n <div class=\"wu-fieldset-content-inner\">\n <div class=\"wu-fieldset-content p-fieldset-content\"><ng-content></ng-content></div>\n </div>\n </div>\n</fieldset>\n<ng-template #legendText>{{ legend }}</ng-template>\n", styles: ["@layer wiraui.components{wu-fieldset{display:block}.wu-fieldset{min-width:0;margin:0;padding:0 var(--wu-fieldset-padding) var(--wu-fieldset-padding);border:1px solid var(--wu-border);border-radius:var(--wu-fieldset-radius);background:var(--wu-card-bg);color:var(--wu-text);font-family:var(--wu-font-family);font-size:var(--wu-font-size);line-height:var(--wu-line-height)}.wu-fieldset-legend{max-width:100%;margin-inline:calc(var(--wu-fieldset-legend-padding-x) * -.5);padding:0;border:var(--wu-fieldset-legend-border-width) solid var(--wu-border);border-radius:var(--wu-fieldset-radius);background:var(--wu-fieldset-legend-bg);color:var(--wu-fieldset-legend-color);font-weight:var(--wu-fieldset-legend-weight)}.wu-fieldset-legend-label{display:block;padding:var(--wu-fieldset-legend-padding-y) var(--wu-fieldset-legend-padding-x)}.wu-fieldset-toggle{display:flex;align-items:center;gap:.5rem;width:100%;padding:var(--wu-fieldset-legend-padding-y) var(--wu-fieldset-legend-padding-x);border:0;border-radius:inherit;background:transparent;color:inherit;font:inherit;cursor:pointer;transition:background-color var(--wu-transition)}.wu-fieldset-toggle:hover{background:var(--wu-hover-bg)}.wu-fieldset-toggle:focus-visible{outline:var(--wu-control-focus-outline);outline-offset:var(--wu-control-focus-offset);box-shadow:var(--wu-control-focus-shadow)}.wu-fieldset-toggle svg{flex:none;width:.75rem;height:.75rem}.wu-fieldset-content-container{display:grid;grid-template-rows:1fr;transition:grid-template-rows var(--wu-transition) ease}.wu-fieldset-collapsed .wu-fieldset-content-container{grid-template-rows:0fr}.wu-fieldset-content-inner{min-height:0;overflow:hidden}.wu-fieldset-content{padding-top:calc(var(--wu-fieldset-padding) / 2)}@media (prefers-reduced-motion: reduce){.wu-fieldset-content-container{transition:none}}}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
50
+ WuFieldset.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: WuFieldset, isStandalone: true, selector: "wu-fieldset", inputs: { legend: "legend", toggleable: "toggleable", collapsed: "collapsed", styleClass: "styleClass", style: "style" }, outputs: { collapsedChange: "collapsedChange", onToggle: "onToggle" }, queries: [{ propertyName: "headerRef", first: true, predicate: ["header"], read: TemplateRef }, { propertyName: "slotTemplates", predicate: WuTemplate }], ngImport: i0, template: "<fieldset [class]=\"classes\" [style]=\"rootStyle\">\n <legend class=\"wu-fieldset-legend p-fieldset-legend\">\n <button\n *ngIf=\"toggleable; else plainLegend\"\n type=\"button\"\n class=\"wu-fieldset-toggle\"\n [attr.aria-expanded]=\"!isCollapsed\"\n [attr.aria-controls]=\"contentId\"\n (click)=\"toggle()\"\n >\n <svg *ngIf=\"isCollapsed\" class=\"p-fieldset-toggler\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" aria-hidden=\"true\"><path d=\"M8 3v10M3 8h10\"></path></svg>\n <svg *ngIf=\"!isCollapsed\" class=\"p-fieldset-toggler\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" aria-hidden=\"true\"><path d=\"M3 8h10\"></path></svg>\n <span class=\"p-fieldset-legend-text\"><ng-container *ngIf=\"headerTemplate; else legendText\"><ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container></ng-container></span>\n </button>\n <ng-template #plainLegend>\n <span class=\"wu-fieldset-legend-label p-fieldset-legend-text\"><ng-container *ngIf=\"headerTemplate; else legendText\"><ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container></ng-container></span>\n </ng-template>\n </legend>\n <div class=\"wu-fieldset-content-container p-toggleable-content\" [id]=\"contentId\" [attr.inert]=\"isCollapsed ? '' : null\">\n <div class=\"wu-fieldset-content-inner\">\n <div class=\"wu-fieldset-content p-fieldset-content\"><ng-content></ng-content></div>\n </div>\n </div>\n</fieldset>\n<ng-template #legendText>{{ legend }}</ng-template>\n", styles: ["@layer wiraui.components{wu-fieldset{display:block}.wu-fieldset{min-width:0;margin:0;padding:0 var(--wu-fieldset-padding) var(--wu-fieldset-padding);border:1px solid var(--wu-border);border-radius:var(--wu-fieldset-radius);background:var(--wu-card-bg);color:var(--wu-text);font-family:var(--wu-font-family);font-size:var(--wu-font-size);line-height:var(--wu-line-height)}.wu-fieldset-legend{max-width:100%;margin-inline:calc(var(--wu-fieldset-legend-padding-x) * -.5);padding:0;border:var(--wu-fieldset-legend-border-width) solid var(--wu-border);border-radius:var(--wu-fieldset-radius);background:var(--wu-fieldset-legend-bg);color:var(--wu-fieldset-legend-color);font-weight:var(--wu-fieldset-legend-weight)}.wu-fieldset-legend-label{font-family:var(--wu-heading-font-family);display:block;padding:var(--wu-fieldset-legend-padding-y) var(--wu-fieldset-legend-padding-x)}.wu-fieldset-toggle{display:flex;align-items:center;gap:.5rem;width:100%;padding:var(--wu-fieldset-legend-padding-y) var(--wu-fieldset-legend-padding-x);border:0;border-radius:inherit;background:transparent;color:inherit;font:inherit;cursor:pointer;transition:background-color var(--wu-transition)}.wu-fieldset-toggle:hover{background:var(--wu-hover-bg)}.wu-fieldset-toggle:focus-visible{outline:var(--wu-control-focus-outline);outline-offset:var(--wu-control-focus-offset);box-shadow:var(--wu-control-focus-shadow)}.wu-fieldset-toggle svg{flex:none;width:.75rem;height:.75rem}.wu-fieldset-content-container{display:grid;grid-template-rows:1fr;transition:grid-template-rows var(--wu-transition) ease}.wu-fieldset-collapsed .wu-fieldset-content-container{grid-template-rows:0fr}.wu-fieldset-content-inner{min-height:0;overflow:hidden}.wu-fieldset-content{padding-top:calc(var(--wu-fieldset-padding) / 2)}@media (prefers-reduced-motion: reduce){.wu-fieldset-content-container{transition:none}}}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
51
51
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WuFieldset, decorators: [{
52
52
  type: Component,
53
- args: [{ selector: 'wu-fieldset', standalone: true, imports: [NgIf, NgTemplateOutlet], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<fieldset [class]=\"classes\" [style]=\"rootStyle\">\n <legend class=\"wu-fieldset-legend p-fieldset-legend\">\n <button\n *ngIf=\"toggleable; else plainLegend\"\n type=\"button\"\n class=\"wu-fieldset-toggle\"\n [attr.aria-expanded]=\"!isCollapsed\"\n [attr.aria-controls]=\"contentId\"\n (click)=\"toggle()\"\n >\n <svg *ngIf=\"isCollapsed\" class=\"p-fieldset-toggler\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" aria-hidden=\"true\"><path d=\"M8 3v10M3 8h10\"></path></svg>\n <svg *ngIf=\"!isCollapsed\" class=\"p-fieldset-toggler\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" aria-hidden=\"true\"><path d=\"M3 8h10\"></path></svg>\n <span class=\"p-fieldset-legend-text\"><ng-container *ngIf=\"headerTemplate; else legendText\"><ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container></ng-container></span>\n </button>\n <ng-template #plainLegend>\n <span class=\"wu-fieldset-legend-label p-fieldset-legend-text\"><ng-container *ngIf=\"headerTemplate; else legendText\"><ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container></ng-container></span>\n </ng-template>\n </legend>\n <div class=\"wu-fieldset-content-container p-toggleable-content\" [id]=\"contentId\" [attr.inert]=\"isCollapsed ? '' : null\">\n <div class=\"wu-fieldset-content-inner\">\n <div class=\"wu-fieldset-content p-fieldset-content\"><ng-content></ng-content></div>\n </div>\n </div>\n</fieldset>\n<ng-template #legendText>{{ legend }}</ng-template>\n", styles: ["@layer wiraui.components{wu-fieldset{display:block}.wu-fieldset{min-width:0;margin:0;padding:0 var(--wu-fieldset-padding) var(--wu-fieldset-padding);border:1px solid var(--wu-border);border-radius:var(--wu-fieldset-radius);background:var(--wu-card-bg);color:var(--wu-text);font-family:var(--wu-font-family);font-size:var(--wu-font-size);line-height:var(--wu-line-height)}.wu-fieldset-legend{max-width:100%;margin-inline:calc(var(--wu-fieldset-legend-padding-x) * -.5);padding:0;border:var(--wu-fieldset-legend-border-width) solid var(--wu-border);border-radius:var(--wu-fieldset-radius);background:var(--wu-fieldset-legend-bg);color:var(--wu-fieldset-legend-color);font-weight:var(--wu-fieldset-legend-weight)}.wu-fieldset-legend-label{display:block;padding:var(--wu-fieldset-legend-padding-y) var(--wu-fieldset-legend-padding-x)}.wu-fieldset-toggle{display:flex;align-items:center;gap:.5rem;width:100%;padding:var(--wu-fieldset-legend-padding-y) var(--wu-fieldset-legend-padding-x);border:0;border-radius:inherit;background:transparent;color:inherit;font:inherit;cursor:pointer;transition:background-color var(--wu-transition)}.wu-fieldset-toggle:hover{background:var(--wu-hover-bg)}.wu-fieldset-toggle:focus-visible{outline:var(--wu-control-focus-outline);outline-offset:var(--wu-control-focus-offset);box-shadow:var(--wu-control-focus-shadow)}.wu-fieldset-toggle svg{flex:none;width:.75rem;height:.75rem}.wu-fieldset-content-container{display:grid;grid-template-rows:1fr;transition:grid-template-rows var(--wu-transition) ease}.wu-fieldset-collapsed .wu-fieldset-content-container{grid-template-rows:0fr}.wu-fieldset-content-inner{min-height:0;overflow:hidden}.wu-fieldset-content{padding-top:calc(var(--wu-fieldset-padding) / 2)}@media (prefers-reduced-motion: reduce){.wu-fieldset-content-container{transition:none}}}\n"] }]
53
+ args: [{ selector: 'wu-fieldset', standalone: true, imports: [NgIf, NgTemplateOutlet], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<fieldset [class]=\"classes\" [style]=\"rootStyle\">\n <legend class=\"wu-fieldset-legend p-fieldset-legend\">\n <button\n *ngIf=\"toggleable; else plainLegend\"\n type=\"button\"\n class=\"wu-fieldset-toggle\"\n [attr.aria-expanded]=\"!isCollapsed\"\n [attr.aria-controls]=\"contentId\"\n (click)=\"toggle()\"\n >\n <svg *ngIf=\"isCollapsed\" class=\"p-fieldset-toggler\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" aria-hidden=\"true\"><path d=\"M8 3v10M3 8h10\"></path></svg>\n <svg *ngIf=\"!isCollapsed\" class=\"p-fieldset-toggler\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" aria-hidden=\"true\"><path d=\"M3 8h10\"></path></svg>\n <span class=\"p-fieldset-legend-text\"><ng-container *ngIf=\"headerTemplate; else legendText\"><ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container></ng-container></span>\n </button>\n <ng-template #plainLegend>\n <span class=\"wu-fieldset-legend-label p-fieldset-legend-text\"><ng-container *ngIf=\"headerTemplate; else legendText\"><ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container></ng-container></span>\n </ng-template>\n </legend>\n <div class=\"wu-fieldset-content-container p-toggleable-content\" [id]=\"contentId\" [attr.inert]=\"isCollapsed ? '' : null\">\n <div class=\"wu-fieldset-content-inner\">\n <div class=\"wu-fieldset-content p-fieldset-content\"><ng-content></ng-content></div>\n </div>\n </div>\n</fieldset>\n<ng-template #legendText>{{ legend }}</ng-template>\n", styles: ["@layer wiraui.components{wu-fieldset{display:block}.wu-fieldset{min-width:0;margin:0;padding:0 var(--wu-fieldset-padding) var(--wu-fieldset-padding);border:1px solid var(--wu-border);border-radius:var(--wu-fieldset-radius);background:var(--wu-card-bg);color:var(--wu-text);font-family:var(--wu-font-family);font-size:var(--wu-font-size);line-height:var(--wu-line-height)}.wu-fieldset-legend{max-width:100%;margin-inline:calc(var(--wu-fieldset-legend-padding-x) * -.5);padding:0;border:var(--wu-fieldset-legend-border-width) solid var(--wu-border);border-radius:var(--wu-fieldset-radius);background:var(--wu-fieldset-legend-bg);color:var(--wu-fieldset-legend-color);font-weight:var(--wu-fieldset-legend-weight)}.wu-fieldset-legend-label{font-family:var(--wu-heading-font-family);display:block;padding:var(--wu-fieldset-legend-padding-y) var(--wu-fieldset-legend-padding-x)}.wu-fieldset-toggle{display:flex;align-items:center;gap:.5rem;width:100%;padding:var(--wu-fieldset-legend-padding-y) var(--wu-fieldset-legend-padding-x);border:0;border-radius:inherit;background:transparent;color:inherit;font:inherit;cursor:pointer;transition:background-color var(--wu-transition)}.wu-fieldset-toggle:hover{background:var(--wu-hover-bg)}.wu-fieldset-toggle:focus-visible{outline:var(--wu-control-focus-outline);outline-offset:var(--wu-control-focus-offset);box-shadow:var(--wu-control-focus-shadow)}.wu-fieldset-toggle svg{flex:none;width:.75rem;height:.75rem}.wu-fieldset-content-container{display:grid;grid-template-rows:1fr;transition:grid-template-rows var(--wu-transition) ease}.wu-fieldset-collapsed .wu-fieldset-content-container{grid-template-rows:0fr}.wu-fieldset-content-inner{min-height:0;overflow:hidden}.wu-fieldset-content{padding-top:calc(var(--wu-fieldset-padding) / 2)}@media (prefers-reduced-motion: reduce){.wu-fieldset-content-container{transition:none}}}\n"] }]
54
54
  }], ctorParameters: function () { return []; }, propDecorators: { slotTemplates: [{
55
55
  type: ContentChildren,
56
56
  args: [WuTemplate]
57
57
  }], headerRef: [{
58
58
  type: ContentChild,
59
- args: ['header', { read: TemplateRef }]
59
+ args: ['header', { read: TemplateRef, descendants: false }]
60
60
  }], legend: [{
61
61
  type: Input
62
62
  }], toggleable: [{
@@ -1 +1 @@
1
- {"version":3,"file":"wirabyte-ui-fieldset.mjs","sources":["../../lib/fieldset/fieldset.component.ts","../../lib/fieldset/fieldset.component.html","../../lib/fieldset/fieldset.module.ts","../../lib/fieldset/wirabyte-ui-fieldset.ts"],"sourcesContent":["import { NgIf, NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n ContentChildren,\n EventEmitter,\n inject,\n Input,\n Output,\n QueryList,\n TemplateRef,\n ViewEncapsulation,\n} from '@angular/core';\nimport { ɵassertSupportedAngular, ɵfindTemplate, ɵtoBool, ɵuniqueId, ɵWU_SKIP_VERSION_CHECK, WuTemplate } from '@wirabyte/ui/config';\n\n/** A real <fieldset> with a legend, optionally collapsible: `<wu-fieldset legend=\"ที่อยู่\" toggleable [(collapsed)]=\"closed\">`. */\n@Component({\n selector: 'wu-fieldset',\n standalone: true,\n imports: [NgIf, NgTemplateOutlet],\n templateUrl: './fieldset.component.html',\n styleUrls: ['./fieldset.css'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class WuFieldset {\n @ContentChildren(WuTemplate) protected slotTemplates?: QueryList<WuTemplate>;\n @ContentChild('header', { read: TemplateRef }) protected headerRef?: TemplateRef<unknown>;\n get headerTemplate(): TemplateRef<unknown> | null {\n return this.headerRef || ɵfindTemplate(this.slotTemplates, 'header');\n }\n @Input() legend?: string;\n @Input() set toggleable(v: unknown) { this._toggleable = ɵtoBool(v); }\n get toggleable(): boolean { return this._toggleable; }\n /** Two-way: `[(collapsed)]`. */\n @Input() set collapsed(v: unknown) { this._collapsed = ɵtoBool(v); }\n get collapsed(): boolean { return this._collapsed; }\n\n @Output() readonly collapsedChange = new EventEmitter<boolean>();\n @Output() readonly onToggle = new EventEmitter<{ collapsed: boolean }>();\n\n readonly contentId = ɵuniqueId('wu-fieldset-content');\n private _toggleable = false;\n private _collapsed = false;\n\n constructor() {\n ɵassertSupportedAngular(inject(ɵWU_SKIP_VERSION_CHECK, { optional: true }));\n }\n\n get isCollapsed(): boolean {\n return this._toggleable && this._collapsed;\n }\n\n /** Classes for the root element, as before (`styleClass=\"w-full\"`). */\n @Input() styleClass?: string | null;\n /** Inline styles for the root element, as an object: `[style]=\"{ width: '20rem' }\"`. */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Input() style?: Record<string, any> | string | null;\n /** The `style` object for the root (a plain style attribute already styles the host). */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get rootStyle(): Record<string, any> | null {\n return this.style && typeof this.style === 'object' ? this.style : null;\n }\n get classes(): string {\n return [this.baseClasses, this.styleClass].filter(Boolean).join(' ');\n }\n get baseClasses(): string {\n const c = ['wu-fieldset', 'p-fieldset', 'p-component'];\n if (this._toggleable) c.push('wu-fieldset-toggleable', 'p-fieldset-toggleable');\n if (this.isCollapsed) c.push('wu-fieldset-collapsed');\n return c.join(' ');\n }\n\n toggle(): void {\n this._collapsed = !this.isCollapsed;\n this.collapsedChange.emit(this._collapsed);\n this.onToggle.emit({ collapsed: this._collapsed });\n }\n}\n","<fieldset [class]=\"classes\" [style]=\"rootStyle\">\n <legend class=\"wu-fieldset-legend p-fieldset-legend\">\n <button\n *ngIf=\"toggleable; else plainLegend\"\n type=\"button\"\n class=\"wu-fieldset-toggle\"\n [attr.aria-expanded]=\"!isCollapsed\"\n [attr.aria-controls]=\"contentId\"\n (click)=\"toggle()\"\n >\n <svg *ngIf=\"isCollapsed\" class=\"p-fieldset-toggler\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" aria-hidden=\"true\"><path d=\"M8 3v10M3 8h10\"></path></svg>\n <svg *ngIf=\"!isCollapsed\" class=\"p-fieldset-toggler\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" aria-hidden=\"true\"><path d=\"M3 8h10\"></path></svg>\n <span class=\"p-fieldset-legend-text\"><ng-container *ngIf=\"headerTemplate; else legendText\"><ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container></ng-container></span>\n </button>\n <ng-template #plainLegend>\n <span class=\"wu-fieldset-legend-label p-fieldset-legend-text\"><ng-container *ngIf=\"headerTemplate; else legendText\"><ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container></ng-container></span>\n </ng-template>\n </legend>\n <div class=\"wu-fieldset-content-container p-toggleable-content\" [id]=\"contentId\" [attr.inert]=\"isCollapsed ? '' : null\">\n <div class=\"wu-fieldset-content-inner\">\n <div class=\"wu-fieldset-content p-fieldset-content\"><ng-content></ng-content></div>\n </div>\n </div>\n</fieldset>\n<ng-template #legendText>{{ legend }}</ng-template>\n","import { NgModule } from '@angular/core';\nimport { WuTemplate } from '@wirabyte/ui/config';\nimport { WuFieldset } from './fieldset.component';\n\n/** For NgModule apps. Standalone apps can import `WuFieldset` directly. */\n@NgModule({\n imports: [WuFieldset, WuTemplate],\n exports: [WuFieldset, WuTemplate],\n})\nexport class WuFieldsetModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAgBA;MAUa,UAAU,CAAA;AAGrB,IAAA,IAAI,cAAc,GAAA;AAChB,QAAA,OAAO,IAAI,CAAC,SAAS,IAAI,aAAa,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;KACtE;AAED,IAAA,IAAa,UAAU,CAAC,CAAU,EAAA,EAAI,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;IACtE,IAAI,UAAU,KAAc,OAAO,IAAI,CAAC,WAAW,CAAC,EAAE;;AAEtD,IAAA,IAAa,SAAS,CAAC,CAAU,EAAA,EAAI,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE;IACpE,IAAI,SAAS,KAAc,OAAO,IAAI,CAAC,UAAU,CAAC,EAAE;AASpD,IAAA,WAAA,GAAA;AAPmB,QAAA,IAAA,CAAA,eAAe,GAAG,IAAI,YAAY,EAAW,CAAC;AAC9C,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,YA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AAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAHjB,UAAU,CAAA,EAAA,CAAA,CAAA;4FAGT,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;AACjC,oBAAA,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;AAClC,iBAAA,CAAA;;;ACRD;;AAEG;;;;"}
1
+ {"version":3,"file":"wirabyte-ui-fieldset.mjs","sources":["../../lib/fieldset/fieldset.component.ts","../../lib/fieldset/fieldset.component.html","../../lib/fieldset/fieldset.module.ts","../../lib/fieldset/wirabyte-ui-fieldset.ts"],"sourcesContent":["import { NgIf, NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n ContentChildren,\n EventEmitter,\n inject,\n Input,\n Output,\n QueryList,\n TemplateRef,\n ViewEncapsulation,\n} from '@angular/core';\nimport { ɵassertSupportedAngular, ɵfindTemplate, ɵtoBool, ɵuniqueId, ɵWU_SKIP_VERSION_CHECK, WuTemplate } from '@wirabyte/ui/config';\n\n/** A real <fieldset> with a legend, optionally collapsible: `<wu-fieldset legend=\"ที่อยู่\" toggleable [(collapsed)]=\"closed\">`. */\n@Component({\n selector: 'wu-fieldset',\n standalone: true,\n imports: [NgIf, NgTemplateOutlet],\n templateUrl: './fieldset.component.html',\n styleUrls: ['./fieldset.css'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class WuFieldset {\n @ContentChildren(WuTemplate) protected slotTemplates?: QueryList<WuTemplate>;\n @ContentChild('header', { read: TemplateRef, descendants: false }) protected headerRef?: TemplateRef<unknown>;\n get headerTemplate(): TemplateRef<unknown> | null {\n return this.headerRef || ɵfindTemplate(this.slotTemplates, 'header');\n }\n @Input() legend?: string;\n @Input() set toggleable(v: unknown) { this._toggleable = ɵtoBool(v); }\n get toggleable(): boolean { return this._toggleable; }\n /** Two-way: `[(collapsed)]`. */\n @Input() set collapsed(v: unknown) { this._collapsed = ɵtoBool(v); }\n get collapsed(): boolean { return this._collapsed; }\n\n @Output() readonly collapsedChange = new EventEmitter<boolean>();\n @Output() readonly onToggle = new EventEmitter<{ collapsed: boolean }>();\n\n readonly contentId = ɵuniqueId('wu-fieldset-content');\n private _toggleable = false;\n private _collapsed = false;\n\n constructor() {\n ɵassertSupportedAngular(inject(ɵWU_SKIP_VERSION_CHECK, { optional: true }));\n }\n\n get isCollapsed(): boolean {\n return this._toggleable && this._collapsed;\n }\n\n /** Classes for the root element, as before (`styleClass=\"w-full\"`). */\n @Input() styleClass?: string | null;\n /** Inline styles for the root element, as an object: `[style]=\"{ width: '20rem' }\"`. */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Input() style?: Record<string, any> | string | null;\n /** The `style` object for the root (a plain style attribute already styles the host). */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get rootStyle(): Record<string, any> | null {\n return this.style && typeof this.style === 'object' ? this.style : null;\n }\n get classes(): string {\n return [this.baseClasses, this.styleClass].filter(Boolean).join(' ');\n }\n get baseClasses(): string {\n const c = ['wu-fieldset', 'p-fieldset', 'p-component'];\n if (this._toggleable) c.push('wu-fieldset-toggleable', 'p-fieldset-toggleable');\n if (this.isCollapsed) c.push('wu-fieldset-collapsed');\n return c.join(' ');\n }\n\n toggle(): void {\n this._collapsed = !this.isCollapsed;\n this.collapsedChange.emit(this._collapsed);\n this.onToggle.emit({ collapsed: this._collapsed });\n }\n}\n","<fieldset [class]=\"classes\" [style]=\"rootStyle\">\n <legend class=\"wu-fieldset-legend p-fieldset-legend\">\n <button\n *ngIf=\"toggleable; else plainLegend\"\n type=\"button\"\n class=\"wu-fieldset-toggle\"\n [attr.aria-expanded]=\"!isCollapsed\"\n [attr.aria-controls]=\"contentId\"\n (click)=\"toggle()\"\n >\n <svg *ngIf=\"isCollapsed\" class=\"p-fieldset-toggler\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" aria-hidden=\"true\"><path d=\"M8 3v10M3 8h10\"></path></svg>\n <svg *ngIf=\"!isCollapsed\" class=\"p-fieldset-toggler\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" aria-hidden=\"true\"><path d=\"M3 8h10\"></path></svg>\n <span class=\"p-fieldset-legend-text\"><ng-container *ngIf=\"headerTemplate; else legendText\"><ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container></ng-container></span>\n </button>\n <ng-template #plainLegend>\n <span class=\"wu-fieldset-legend-label p-fieldset-legend-text\"><ng-container *ngIf=\"headerTemplate; else legendText\"><ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container></ng-container></span>\n </ng-template>\n </legend>\n <div class=\"wu-fieldset-content-container p-toggleable-content\" [id]=\"contentId\" [attr.inert]=\"isCollapsed ? '' : null\">\n <div class=\"wu-fieldset-content-inner\">\n <div class=\"wu-fieldset-content p-fieldset-content\"><ng-content></ng-content></div>\n </div>\n </div>\n</fieldset>\n<ng-template #legendText>{{ legend }}</ng-template>\n","import { NgModule } from '@angular/core';\nimport { WuTemplate } from '@wirabyte/ui/config';\nimport { WuFieldset } from './fieldset.component';\n\n/** For NgModule apps. Standalone apps can import `WuFieldset` directly. */\n@NgModule({\n imports: [WuFieldset, WuTemplate],\n exports: [WuFieldset, WuTemplate],\n})\nexport class WuFieldsetModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAgBA;MAUa,UAAU,CAAA;AAGrB,IAAA,IAAI,cAAc,GAAA;AAChB,QAAA,OAAO,IAAI,CAAC,SAAS,IAAI,aAAa,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;KACtE;AAED,IAAA,IAAa,UAAU,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AAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAhB,gBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAHjB,UAAU,EAAE,UAAU,CACtB,EAAA,OAAA,EAAA,CAAA,UAAU,EAAE,UAAU,CAAA,EAAA,CAAA,CAAA;AAErB,gBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAHjB,UAAU,CAAA,EAAA,CAAA,CAAA;4FAGT,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAJ5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;AACjC,oBAAA,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;AAClC,iBAAA,CAAA;;;ACRD;;AAEG;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { NgIf, NgFor, NgTemplateOutlet } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { TemplateRef, inject, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, ContentChild, ContentChildren, NgModule } from '@angular/core';
4
- import { ɵtoBool, ɵassertSupportedAngular, ɵWU_SKIP_VERSION_CHECK, ɵfindTemplate, WuTemplate } from '@wirabyte/ui/config';
3
+ import { TemplateRef, EventEmitter, inject, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, Output, ContentChild, ContentChildren, NgModule } from '@angular/core';
4
+ import { ɵtoBool, WuConfig, ɵassertSupportedAngular, ɵWU_SKIP_VERSION_CHECK, ɵfindTemplate, WuTemplate } from '@wirabyte/ui/config';
5
5
 
6
6
  const PALETTE = ['primary', 'info', 'success', 'warn', 'danger', 'help'];
7
7
  /** The item's colour, or the theme colour for its place. */
@@ -59,6 +59,12 @@ class WuMeterGroup {
59
59
  /** Fill from the other end: right to left, or (vertical) bottom to top. */
60
60
  set reverse(v) { this._reverse = ɵtoBool(v); }
61
61
  get reverse() { return this._reverse; }
62
+ /** Each legend item shows its value too: `เปิด 12 (24%)`. */
63
+ set showValue(v) { this._showValue = ɵtoBool(v); }
64
+ get showValue() { return this._showValue; }
65
+ /** Legend items become buttons that emit `(onItemClick)`, e.g. to open the list for that status. */
66
+ set clickable(v) { this._clickable = ɵtoBool(v); }
67
+ get clickable() { return this._clickable; }
62
68
  /** The `style` object for the root (a plain style attribute already styles the host). */
63
69
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
64
70
  get rootStyle() {
@@ -71,13 +77,25 @@ class WuMeterGroup {
71
77
  this.labelPosition = 'end';
72
78
  /** Legend items in a row or a column. */
73
79
  this.labelOrientation = 'horizontal';
80
+ this.onItemClick = new EventEmitter();
74
81
  this.parts = ɵmeterParts([], 0, 100);
75
82
  this.groupContext = { $implicit: [], totalPercent: 0, percentages: [] };
76
83
  this._value = [];
77
84
  this._min = 0;
78
85
  this._max = 100;
86
+ this._showValue = false;
87
+ this._clickable = false;
88
+ this.config = inject(WuConfig);
79
89
  ɵassertSupportedAngular(inject(ɵWU_SKIP_VERSION_CHECK, { optional: true }));
80
90
  }
91
+ /** The legend text of one item. */
92
+ labelText(item, percent) {
93
+ const value = this._showValue ? ' ' + Number(item.value).toLocaleString(this.config.translation.code === 'th' ? 'th-TH' : 'en-US') : '';
94
+ return `${item.label ?? ''}${value} (${percent}%)`;
95
+ }
96
+ itemClick(event, item, index) {
97
+ this.onItemClick.emit({ originalEvent: event, item, index });
98
+ }
81
99
  /** `<ng-template pTemplate="label" let-value let-totalPercent="totalPercent" let-percentages="percentages">`: the whole legend. */
82
100
  get labelTemplate() {
83
101
  return template(this.labelRef) || ɵfindTemplate(this.templates, 'label');
@@ -126,10 +144,10 @@ class WuMeterGroup {
126
144
  }
127
145
  }
128
146
  WuMeterGroup.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WuMeterGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
129
- WuMeterGroup.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: WuMeterGroup, isStandalone: true, selector: "wu-metergroup, wu-meterGroup, wu-meter-group", inputs: { value: "value", min: "min", max: "max", orientation: "orientation", reverse: "reverse", labelPosition: "labelPosition", labelOrientation: "labelOrientation", styleClass: "styleClass", style: "style", ariaLabel: "ariaLabel" }, queries: [{ propertyName: "labelRef", first: true, predicate: ["label"] }, { propertyName: "meterRef", first: true, predicate: ["meter"] }, { propertyName: "startRef", first: true, predicate: ["start"] }, { propertyName: "endRef", first: true, predicate: ["end"] }, { propertyName: "iconRef", first: true, predicate: ["icon"] }, { propertyName: "templates", predicate: WuTemplate }], ngImport: i0, template: "<div\n [class]=\"classes\"\n [style]=\"rootStyle\"\n role=\"meter\"\n [attr.aria-valuemin]=\"min\"\n [attr.aria-valuemax]=\"max\"\n [attr.aria-valuenow]=\"parts.totalPercent\"\n [attr.aria-label]=\"ariaLabel || null\"\n>\n <ng-container *ngIf=\"labelPosition === 'start'\">\n <ng-container *ngTemplateOutlet=\"legend\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"startTemplate\">\n <ng-container *ngTemplateOutlet=\"startTemplate; context: groupContext\"></ng-container>\n </ng-container>\n <div class=\"wu-metergroup-meters p-metergroup-meters\">\n <ng-container *ngFor=\"let item of parts.items; let i = index\">\n <ng-container *ngIf=\"meterTemplate; else plainMeter\">\n <ng-container *ngTemplateOutlet=\"meterTemplate; context: meterContext(i)\"></ng-container>\n </ng-container>\n <ng-template #plainMeter>\n <span\n class=\"wu-metergroup-meter p-metergroup-meter\"\n [style.background]=\"parts.colors[i]\"\n [style.width]=\"orientation === 'horizontal' ? parts.sizes[i] : null\"\n [style.height]=\"orientation === 'vertical' ? parts.sizes[i] : null\"\n ></span>\n </ng-template>\n </ng-container>\n </div>\n <ng-container *ngIf=\"endTemplate\">\n <ng-container *ngTemplateOutlet=\"endTemplate; context: groupContext\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"labelPosition === 'end'\">\n <ng-container *ngTemplateOutlet=\"legend\"></ng-container>\n </ng-container>\n</div>\n\n<ng-template #legend>\n <ng-container *ngIf=\"labelTemplate; else plainLegend\">\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: groupContext\"></ng-container>\n </ng-container>\n <ng-template #plainLegend>\n <ol [class]=\"labelClasses\">\n <li *ngFor=\"let item of parts.items; let i = index\" class=\"wu-metergroup-label p-metergroup-label\">\n <ng-container *ngIf=\"iconTemplate; else plainIcon\">\n <ng-container *ngTemplateOutlet=\"iconTemplate; context: { $implicit: item, icon: item.icon }\"></ng-container>\n </ng-container>\n <ng-template #plainIcon>\n <i\n *ngIf=\"item.icon; else marker\"\n [class]=\"'wu-metergroup-label-icon p-metergroup-label-icon ' + item.icon\"\n [style.color]=\"parts.colors[i]\"\n aria-hidden=\"true\"\n ></i>\n <ng-template #marker>\n <span class=\"wu-metergroup-label-marker p-metergroup-label-marker\" [style.background]=\"parts.colors[i]\"></span>\n </ng-template>\n </ng-template>\n <span class=\"wu-metergroup-label-text p-metergroup-label-text\">{{ item.label }} ({{ parts.percentages[i] }}%)</span>\n </li>\n </ol>\n </ng-template>\n</ng-template>\n", styles: ["@layer wiraui.components{:is(wu-metergroup,wu-meter-group){display:block}.wu-metergroup{display:flex;gap:var(--wu-metergroup-gap);color:var(--wu-text);font-family:var(--wu-font-family);font-size:var(--wu-font-size);line-height:var(--wu-line-height)}.wu-metergroup-meters{display:flex;overflow:hidden;border-radius:var(--wu-metergroup-radius);background:var(--wu-metergroup-bg)}.wu-metergroup-meter{flex:none;display:block;border:0;transition:width var(--wu-transition),height var(--wu-transition)}.wu-metergroup-labels{display:flex;flex-wrap:wrap;margin:0;padding:0;list-style:none}.wu-metergroup-labels-horizontal{gap:.5rem var(--wu-metergroup-gap)}.wu-metergroup-labels-vertical{flex-direction:column;gap:.5rem}.wu-metergroup-label{display:inline-flex;align-items:center;gap:.5rem}.wu-metergroup-label-marker{flex:none;display:inline-flex;width:.5rem;height:.5rem;border-radius:50%}.wu-metergroup-label-icon{flex:none;width:1rem;font-size:1rem;line-height:1;text-align:center}.wu-metergroup-horizontal{flex-direction:column}.wu-metergroup-horizontal .wu-metergroup-meters{height:var(--wu-metergroup-size)}:is(wu-metergroup,wu-meter-group):has(> .wu-metergroup-vertical){height:100%}.wu-metergroup-vertical{flex-direction:row;height:100%}.wu-metergroup-vertical .wu-metergroup-meters{flex-direction:column;width:var(--wu-metergroup-size);height:100%}.wu-metergroup-reverse.wu-metergroup-horizontal .wu-metergroup-meters{flex-direction:row-reverse}.wu-metergroup-reverse.wu-metergroup-vertical .wu-metergroup-meters{flex-direction:column-reverse}@media (prefers-reduced-motion: reduce){.wu-metergroup-meter{transition:none}}}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
147
+ WuMeterGroup.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: WuMeterGroup, isStandalone: true, selector: "wu-metergroup, wu-meterGroup, wu-meter-group", inputs: { value: "value", min: "min", max: "max", orientation: "orientation", reverse: "reverse", labelPosition: "labelPosition", labelOrientation: "labelOrientation", showValue: "showValue", clickable: "clickable", styleClass: "styleClass", style: "style", ariaLabel: "ariaLabel" }, outputs: { onItemClick: "onItemClick" }, queries: [{ propertyName: "labelRef", first: true, predicate: ["label"] }, { propertyName: "meterRef", first: true, predicate: ["meter"] }, { propertyName: "startRef", first: true, predicate: ["start"] }, { propertyName: "endRef", first: true, predicate: ["end"] }, { propertyName: "iconRef", first: true, predicate: ["icon"] }, { propertyName: "templates", predicate: WuTemplate }], ngImport: i0, template: "<div\n [class]=\"classes\"\n [style]=\"rootStyle\"\n role=\"meter\"\n [attr.aria-valuemin]=\"min\"\n [attr.aria-valuemax]=\"max\"\n [attr.aria-valuenow]=\"parts.totalPercent\"\n [attr.aria-label]=\"ariaLabel || null\"\n>\n <ng-container *ngIf=\"labelPosition === 'start'\">\n <ng-container *ngTemplateOutlet=\"legend\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"startTemplate\">\n <ng-container *ngTemplateOutlet=\"startTemplate; context: groupContext\"></ng-container>\n </ng-container>\n <div class=\"wu-metergroup-meters p-metergroup-meters\">\n <ng-container *ngFor=\"let item of parts.items; let i = index\">\n <ng-container *ngIf=\"meterTemplate; else plainMeter\">\n <ng-container *ngTemplateOutlet=\"meterTemplate; context: meterContext(i)\"></ng-container>\n </ng-container>\n <ng-template #plainMeter>\n <span\n class=\"wu-metergroup-meter p-metergroup-meter\"\n [style.background]=\"parts.colors[i]\"\n [style.width]=\"orientation === 'horizontal' ? parts.sizes[i] : null\"\n [style.height]=\"orientation === 'vertical' ? parts.sizes[i] : null\"\n ></span>\n </ng-template>\n </ng-container>\n </div>\n <ng-container *ngIf=\"endTemplate\">\n <ng-container *ngTemplateOutlet=\"endTemplate; context: groupContext\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"labelPosition === 'end'\">\n <ng-container *ngTemplateOutlet=\"legend\"></ng-container>\n </ng-container>\n</div>\n\n<ng-template #legend>\n <ng-container *ngIf=\"labelTemplate; else plainLegend\">\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: groupContext\"></ng-container>\n </ng-container>\n <ng-template #plainLegend>\n <ol [class]=\"labelClasses\">\n <li *ngFor=\"let item of parts.items; let i = index\" class=\"wu-metergroup-label p-metergroup-label\">\n <button *ngIf=\"clickable; else still\" type=\"button\" class=\"wu-metergroup-label-button\" (click)=\"itemClick($event, item, i)\">\n <ng-container *ngTemplateOutlet=\"labelContent; context: { $implicit: item, i: i }\"></ng-container>\n </button>\n <ng-template #still>\n <ng-container *ngTemplateOutlet=\"labelContent; context: { $implicit: item, i: i }\"></ng-container>\n </ng-template>\n </li>\n </ol>\n </ng-template>\n</ng-template>\n\n<ng-template #labelContent let-item let-i=\"i\">\n <ng-container *ngIf=\"iconTemplate; else plainIcon\">\n <ng-container *ngTemplateOutlet=\"iconTemplate; context: { $implicit: item, icon: item.icon }\"></ng-container>\n </ng-container>\n <ng-template #plainIcon>\n <i\n *ngIf=\"item.icon; else marker\"\n [class]=\"'wu-metergroup-label-icon p-metergroup-label-icon ' + item.icon\"\n [style.color]=\"parts.colors[i]\"\n aria-hidden=\"true\"\n ></i>\n <ng-template #marker>\n <span class=\"wu-metergroup-label-marker p-metergroup-label-marker\" [style.background]=\"parts.colors[i]\"></span>\n </ng-template>\n </ng-template>\n <span class=\"wu-metergroup-label-text p-metergroup-label-text\">{{ labelText(item, parts.percentages[i]) }}</span>\n</ng-template>\n", styles: ["@layer wiraui.components{:is(wu-metergroup,wu-meter-group){display:block}.wu-metergroup{display:flex;gap:var(--wu-metergroup-gap);color:var(--wu-text);font-family:var(--wu-font-family);font-size:var(--wu-font-size);line-height:var(--wu-line-height)}.wu-metergroup-meters{display:flex;overflow:hidden;border-radius:var(--wu-metergroup-radius);background:var(--wu-metergroup-bg)}.wu-metergroup-meter{flex:none;display:block;border:0;transition:width var(--wu-transition),height var(--wu-transition)}.wu-metergroup-labels{display:flex;flex-wrap:wrap;margin:0;padding:0;list-style:none}.wu-metergroup-labels-horizontal{gap:.5rem var(--wu-metergroup-gap)}.wu-metergroup-labels-vertical{flex-direction:column;gap:.5rem}.wu-metergroup-label{display:inline-flex;align-items:center;gap:.5rem}.wu-metergroup-label-button{display:inline-flex;align-items:center;gap:inherit;margin:0;padding:.125rem .25rem;border:0;border-radius:var(--wu-radius-sm);background:transparent;color:inherit;font:inherit;cursor:pointer}.wu-metergroup-label-button:hover{background:var(--wu-hover-bg)}.wu-metergroup-label-button:focus-visible{outline:var(--wu-control-focus-outline);outline-offset:var(--wu-control-focus-offset);box-shadow:var(--wu-control-focus-shadow)}.wu-metergroup-label-marker{flex:none;display:inline-flex;width:.5rem;height:.5rem;border-radius:50%}.wu-metergroup-label-icon{flex:none;width:1rem;font-size:1rem;line-height:1;text-align:center}.wu-metergroup-horizontal{flex-direction:column}.wu-metergroup-horizontal .wu-metergroup-meters{height:var(--wu-metergroup-size)}:is(wu-metergroup,wu-meter-group):has(> .wu-metergroup-vertical){height:100%}.wu-metergroup-vertical{flex-direction:row;height:100%}.wu-metergroup-vertical .wu-metergroup-meters{flex-direction:column;width:var(--wu-metergroup-size);height:100%}.wu-metergroup-reverse.wu-metergroup-horizontal .wu-metergroup-meters{flex-direction:row-reverse}.wu-metergroup-reverse.wu-metergroup-vertical .wu-metergroup-meters{flex-direction:column-reverse}@media (prefers-reduced-motion: reduce){.wu-metergroup-meter{transition:none}}@media (pointer: coarse){.wu-metergroup-label-button{min-height:24px}}}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
130
148
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: WuMeterGroup, decorators: [{
131
149
  type: Component,
132
- args: [{ selector: 'wu-metergroup, wu-meterGroup, wu-meter-group', standalone: true, imports: [NgIf, NgFor, NgTemplateOutlet], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n [class]=\"classes\"\n [style]=\"rootStyle\"\n role=\"meter\"\n [attr.aria-valuemin]=\"min\"\n [attr.aria-valuemax]=\"max\"\n [attr.aria-valuenow]=\"parts.totalPercent\"\n [attr.aria-label]=\"ariaLabel || null\"\n>\n <ng-container *ngIf=\"labelPosition === 'start'\">\n <ng-container *ngTemplateOutlet=\"legend\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"startTemplate\">\n <ng-container *ngTemplateOutlet=\"startTemplate; context: groupContext\"></ng-container>\n </ng-container>\n <div class=\"wu-metergroup-meters p-metergroup-meters\">\n <ng-container *ngFor=\"let item of parts.items; let i = index\">\n <ng-container *ngIf=\"meterTemplate; else plainMeter\">\n <ng-container *ngTemplateOutlet=\"meterTemplate; context: meterContext(i)\"></ng-container>\n </ng-container>\n <ng-template #plainMeter>\n <span\n class=\"wu-metergroup-meter p-metergroup-meter\"\n [style.background]=\"parts.colors[i]\"\n [style.width]=\"orientation === 'horizontal' ? parts.sizes[i] : null\"\n [style.height]=\"orientation === 'vertical' ? parts.sizes[i] : null\"\n ></span>\n </ng-template>\n </ng-container>\n </div>\n <ng-container *ngIf=\"endTemplate\">\n <ng-container *ngTemplateOutlet=\"endTemplate; context: groupContext\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"labelPosition === 'end'\">\n <ng-container *ngTemplateOutlet=\"legend\"></ng-container>\n </ng-container>\n</div>\n\n<ng-template #legend>\n <ng-container *ngIf=\"labelTemplate; else plainLegend\">\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: groupContext\"></ng-container>\n </ng-container>\n <ng-template #plainLegend>\n <ol [class]=\"labelClasses\">\n <li *ngFor=\"let item of parts.items; let i = index\" class=\"wu-metergroup-label p-metergroup-label\">\n <ng-container *ngIf=\"iconTemplate; else plainIcon\">\n <ng-container *ngTemplateOutlet=\"iconTemplate; context: { $implicit: item, icon: item.icon }\"></ng-container>\n </ng-container>\n <ng-template #plainIcon>\n <i\n *ngIf=\"item.icon; else marker\"\n [class]=\"'wu-metergroup-label-icon p-metergroup-label-icon ' + item.icon\"\n [style.color]=\"parts.colors[i]\"\n aria-hidden=\"true\"\n ></i>\n <ng-template #marker>\n <span class=\"wu-metergroup-label-marker p-metergroup-label-marker\" [style.background]=\"parts.colors[i]\"></span>\n </ng-template>\n </ng-template>\n <span class=\"wu-metergroup-label-text p-metergroup-label-text\">{{ item.label }} ({{ parts.percentages[i] }}%)</span>\n </li>\n </ol>\n </ng-template>\n</ng-template>\n", styles: ["@layer wiraui.components{:is(wu-metergroup,wu-meter-group){display:block}.wu-metergroup{display:flex;gap:var(--wu-metergroup-gap);color:var(--wu-text);font-family:var(--wu-font-family);font-size:var(--wu-font-size);line-height:var(--wu-line-height)}.wu-metergroup-meters{display:flex;overflow:hidden;border-radius:var(--wu-metergroup-radius);background:var(--wu-metergroup-bg)}.wu-metergroup-meter{flex:none;display:block;border:0;transition:width var(--wu-transition),height var(--wu-transition)}.wu-metergroup-labels{display:flex;flex-wrap:wrap;margin:0;padding:0;list-style:none}.wu-metergroup-labels-horizontal{gap:.5rem var(--wu-metergroup-gap)}.wu-metergroup-labels-vertical{flex-direction:column;gap:.5rem}.wu-metergroup-label{display:inline-flex;align-items:center;gap:.5rem}.wu-metergroup-label-marker{flex:none;display:inline-flex;width:.5rem;height:.5rem;border-radius:50%}.wu-metergroup-label-icon{flex:none;width:1rem;font-size:1rem;line-height:1;text-align:center}.wu-metergroup-horizontal{flex-direction:column}.wu-metergroup-horizontal .wu-metergroup-meters{height:var(--wu-metergroup-size)}:is(wu-metergroup,wu-meter-group):has(> .wu-metergroup-vertical){height:100%}.wu-metergroup-vertical{flex-direction:row;height:100%}.wu-metergroup-vertical .wu-metergroup-meters{flex-direction:column;width:var(--wu-metergroup-size);height:100%}.wu-metergroup-reverse.wu-metergroup-horizontal .wu-metergroup-meters{flex-direction:row-reverse}.wu-metergroup-reverse.wu-metergroup-vertical .wu-metergroup-meters{flex-direction:column-reverse}@media (prefers-reduced-motion: reduce){.wu-metergroup-meter{transition:none}}}\n"] }]
150
+ args: [{ selector: 'wu-metergroup, wu-meterGroup, wu-meter-group', standalone: true, imports: [NgIf, NgFor, NgTemplateOutlet], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n [class]=\"classes\"\n [style]=\"rootStyle\"\n role=\"meter\"\n [attr.aria-valuemin]=\"min\"\n [attr.aria-valuemax]=\"max\"\n [attr.aria-valuenow]=\"parts.totalPercent\"\n [attr.aria-label]=\"ariaLabel || null\"\n>\n <ng-container *ngIf=\"labelPosition === 'start'\">\n <ng-container *ngTemplateOutlet=\"legend\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"startTemplate\">\n <ng-container *ngTemplateOutlet=\"startTemplate; context: groupContext\"></ng-container>\n </ng-container>\n <div class=\"wu-metergroup-meters p-metergroup-meters\">\n <ng-container *ngFor=\"let item of parts.items; let i = index\">\n <ng-container *ngIf=\"meterTemplate; else plainMeter\">\n <ng-container *ngTemplateOutlet=\"meterTemplate; context: meterContext(i)\"></ng-container>\n </ng-container>\n <ng-template #plainMeter>\n <span\n class=\"wu-metergroup-meter p-metergroup-meter\"\n [style.background]=\"parts.colors[i]\"\n [style.width]=\"orientation === 'horizontal' ? parts.sizes[i] : null\"\n [style.height]=\"orientation === 'vertical' ? parts.sizes[i] : null\"\n ></span>\n </ng-template>\n </ng-container>\n </div>\n <ng-container *ngIf=\"endTemplate\">\n <ng-container *ngTemplateOutlet=\"endTemplate; context: groupContext\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"labelPosition === 'end'\">\n <ng-container *ngTemplateOutlet=\"legend\"></ng-container>\n </ng-container>\n</div>\n\n<ng-template #legend>\n <ng-container *ngIf=\"labelTemplate; else plainLegend\">\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: groupContext\"></ng-container>\n </ng-container>\n <ng-template #plainLegend>\n <ol [class]=\"labelClasses\">\n <li *ngFor=\"let item of parts.items; let i = index\" class=\"wu-metergroup-label p-metergroup-label\">\n <button *ngIf=\"clickable; else still\" type=\"button\" class=\"wu-metergroup-label-button\" (click)=\"itemClick($event, item, i)\">\n <ng-container *ngTemplateOutlet=\"labelContent; context: { $implicit: item, i: i }\"></ng-container>\n </button>\n <ng-template #still>\n <ng-container *ngTemplateOutlet=\"labelContent; context: { $implicit: item, i: i }\"></ng-container>\n </ng-template>\n </li>\n </ol>\n </ng-template>\n</ng-template>\n\n<ng-template #labelContent let-item let-i=\"i\">\n <ng-container *ngIf=\"iconTemplate; else plainIcon\">\n <ng-container *ngTemplateOutlet=\"iconTemplate; context: { $implicit: item, icon: item.icon }\"></ng-container>\n </ng-container>\n <ng-template #plainIcon>\n <i\n *ngIf=\"item.icon; else marker\"\n [class]=\"'wu-metergroup-label-icon p-metergroup-label-icon ' + item.icon\"\n [style.color]=\"parts.colors[i]\"\n aria-hidden=\"true\"\n ></i>\n <ng-template #marker>\n <span class=\"wu-metergroup-label-marker p-metergroup-label-marker\" [style.background]=\"parts.colors[i]\"></span>\n </ng-template>\n </ng-template>\n <span class=\"wu-metergroup-label-text p-metergroup-label-text\">{{ labelText(item, parts.percentages[i]) }}</span>\n</ng-template>\n", styles: ["@layer wiraui.components{:is(wu-metergroup,wu-meter-group){display:block}.wu-metergroup{display:flex;gap:var(--wu-metergroup-gap);color:var(--wu-text);font-family:var(--wu-font-family);font-size:var(--wu-font-size);line-height:var(--wu-line-height)}.wu-metergroup-meters{display:flex;overflow:hidden;border-radius:var(--wu-metergroup-radius);background:var(--wu-metergroup-bg)}.wu-metergroup-meter{flex:none;display:block;border:0;transition:width var(--wu-transition),height var(--wu-transition)}.wu-metergroup-labels{display:flex;flex-wrap:wrap;margin:0;padding:0;list-style:none}.wu-metergroup-labels-horizontal{gap:.5rem var(--wu-metergroup-gap)}.wu-metergroup-labels-vertical{flex-direction:column;gap:.5rem}.wu-metergroup-label{display:inline-flex;align-items:center;gap:.5rem}.wu-metergroup-label-button{display:inline-flex;align-items:center;gap:inherit;margin:0;padding:.125rem .25rem;border:0;border-radius:var(--wu-radius-sm);background:transparent;color:inherit;font:inherit;cursor:pointer}.wu-metergroup-label-button:hover{background:var(--wu-hover-bg)}.wu-metergroup-label-button:focus-visible{outline:var(--wu-control-focus-outline);outline-offset:var(--wu-control-focus-offset);box-shadow:var(--wu-control-focus-shadow)}.wu-metergroup-label-marker{flex:none;display:inline-flex;width:.5rem;height:.5rem;border-radius:50%}.wu-metergroup-label-icon{flex:none;width:1rem;font-size:1rem;line-height:1;text-align:center}.wu-metergroup-horizontal{flex-direction:column}.wu-metergroup-horizontal .wu-metergroup-meters{height:var(--wu-metergroup-size)}:is(wu-metergroup,wu-meter-group):has(> .wu-metergroup-vertical){height:100%}.wu-metergroup-vertical{flex-direction:row;height:100%}.wu-metergroup-vertical .wu-metergroup-meters{flex-direction:column;width:var(--wu-metergroup-size);height:100%}.wu-metergroup-reverse.wu-metergroup-horizontal .wu-metergroup-meters{flex-direction:row-reverse}.wu-metergroup-reverse.wu-metergroup-vertical .wu-metergroup-meters{flex-direction:column-reverse}@media (prefers-reduced-motion: reduce){.wu-metergroup-meter{transition:none}}@media (pointer: coarse){.wu-metergroup-label-button{min-height:24px}}}\n"] }]
133
151
  }], ctorParameters: function () { return []; }, propDecorators: { value: [{
134
152
  type: Input
135
153
  }], min: [{
@@ -144,6 +162,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
144
162
  type: Input
145
163
  }], labelOrientation: [{
146
164
  type: Input
165
+ }], showValue: [{
166
+ type: Input
167
+ }], clickable: [{
168
+ type: Input
169
+ }], onItemClick: [{
170
+ type: Output
147
171
  }], styleClass: [{
148
172
  type: Input
149
173
  }], style: [{
@@ -1 +1 @@
1
- {"version":3,"file":"wirabyte-ui-metergroup.mjs","sources":["../../lib/metergroup/metergroup.types.ts","../../lib/metergroup/metergroup.component.ts","../../lib/metergroup/metergroup.component.html","../../lib/metergroup/metergroup.module.ts","../../lib/metergroup/wirabyte-ui-metergroup.ts"],"sourcesContent":["/** One part of the meter: `{ label: 'รูปภาพ', value: 24, color: '#34d399', icon: 'pi pi-image' }`. */\nexport interface WuMeterItem {\n label?: string;\n value: number;\n /** Any CSS colour. Default: the theme's primary, info, success, warn, danger and help colours in turn. */\n color?: string;\n /** Icon class shown in the legend instead of the colour dot. */\n icon?: string;\n}\n\nexport type WuMeterOrientation = 'horizontal' | 'vertical';\nexport type WuMeterLabelPosition = 'start' | 'end';\n\n/** Context of the `label`, `start` and `end` templates. */\nexport interface WuMeterGroupContext {\n $implicit: WuMeterItem[];\n /** Sum of all values as 0–100 of the range. */\n totalPercent: number;\n /** Each item as 0–100 of the range, rounded. */\n percentages: number[];\n}\n\n/** Context of the `meter` template (one bar segment). */\nexport interface WuMeterContext {\n $implicit: WuMeterItem;\n index: number;\n orientation: WuMeterOrientation;\n /** Classes the built-in segment carries. */\n class: string;\n /** Width (horizontal) or height (vertical) of the segment, e.g. `24%`. */\n size: string;\n totalPercent: number;\n}\n\nconst PALETTE = ['primary', 'info', 'success', 'warn', 'danger', 'help'];\n\n/** The item's colour, or the theme colour for its place. */\nexport function ɵmeterColor(item: WuMeterItem, index: number): string {\n return item.color || `var(--wu-${PALETTE[index % PALETTE.length]}-color)`;\n}\n\n/** `value` as 0–100 of the min–max range (not rounded: segment sizes). */\nexport function ɵmeterShare(value: number, min: number, max: number): number {\n const span = max - min;\n if (!(span > 0)) return 0;\n return Math.max(0, Math.min(100, ((Number(value) - min) / span) * 100)) || 0;\n}\n\n/** The parts a meter group shows, worked out once per change. */\nexport function ɵmeterParts(items: WuMeterItem[] | null | undefined, min: number, max: number) {\n const list = items || [];\n const shares = list.map((i) => ɵmeterShare(i.value, min, max));\n const total = ɵmeterShare(\n list.reduce((sum, i) => sum + (Number(i.value) || 0), 0),\n min,\n max,\n );\n return {\n items: list,\n sizes: shares.map((s) => `${s}%`),\n percentages: shares.map((s) => Math.round(s)),\n colors: list.map((i, n) => ɵmeterColor(i, n)),\n totalPercent: Math.round(total),\n };\n}\n","import { NgFor, NgIf, NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n ContentChildren,\n inject,\n Input,\n QueryList,\n TemplateRef,\n ViewEncapsulation,\n} from '@angular/core';\nimport { ɵassertSupportedAngular, ɵfindTemplate, ɵtoBool, ɵWU_SKIP_VERSION_CHECK, WuTemplate } from '@wirabyte/ui/config';\nimport {\n ɵmeterParts,\n WuMeterContext,\n WuMeterGroupContext,\n WuMeterItem,\n WuMeterLabelPosition,\n WuMeterOrientation,\n} from './metergroup.types';\n\nconst template = (v: unknown): TemplateRef<unknown> | null => (v instanceof TemplateRef ? v : null);\ntype Parts = ReturnType<typeof ɵmeterParts>;\n\n/**\n * Several values on one bar, with a legend: `<wu-metergroup [value]=\"[{ label: 'รูปภาพ', value: 24 }, …]\">`.\n * Values are read against `min`–`max` (0–100 by default).\n */\n@Component({\n selector: 'wu-metergroup, wu-meterGroup, wu-meter-group',\n standalone: true,\n imports: [NgIf, NgFor, NgTemplateOutlet],\n templateUrl: './metergroup.component.html',\n styleUrls: ['./metergroup.css'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class WuMeterGroup {\n @Input() set value(v: WuMeterItem[] | null | undefined) {\n this._value = v || [];\n this.refresh();\n }\n get value(): WuMeterItem[] {\n return this._value;\n }\n @Input() set min(v: unknown) {\n this._min = Number(v) || 0;\n this.refresh();\n }\n get min(): number {\n return this._min;\n }\n @Input() set max(v: unknown) {\n this._max = v === undefined || v === null || v === '' ? 100 : Number(v);\n this.refresh();\n }\n get max(): number {\n return this._max;\n }\n @Input() orientation: WuMeterOrientation = 'horizontal';\n /** Fill from the other end: right to left, or (vertical) bottom to top. */\n @Input() set reverse(v: unknown) { this._reverse = ɵtoBool(v); }\n get reverse(): boolean { return this._reverse; }\n private _reverse = false;\n /** Legend before or after the bar. */\n @Input() labelPosition: WuMeterLabelPosition = 'end';\n /** Legend items in a row or a column. */\n @Input() labelOrientation: WuMeterOrientation = 'horizontal';\n @Input() styleClass?: string;\n /** Inline styles for the root element, as an object: `[style]=\"{ width: '20rem' }\"`. */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Input() style?: Record<string, any> | string | null;\n /** The `style` object for the root (a plain style attribute already styles the host). */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get rootStyle(): Record<string, any> | null {\n return this.style && typeof this.style === 'object' ? this.style : null;\n }\n @Input() ariaLabel?: string;\n\n @ContentChild('label', { descendants: false }) private labelRef?: unknown;\n @ContentChild('meter', { descendants: false }) private meterRef?: unknown;\n @ContentChild('start', { descendants: false }) private startRef?: unknown;\n @ContentChild('end', { descendants: false }) private endRef?: unknown;\n @ContentChild('icon', { descendants: false }) private iconRef?: unknown;\n @ContentChildren(WuTemplate) private templates?: QueryList<WuTemplate>;\n\n parts: Parts = ɵmeterParts([], 0, 100);\n groupContext: WuMeterGroupContext = { $implicit: [], totalPercent: 0, percentages: [] };\n private _value: WuMeterItem[] = [];\n private _min = 0;\n private _max = 100;\n\n constructor() {\n ɵassertSupportedAngular(inject(ɵWU_SKIP_VERSION_CHECK, { optional: true }));\n }\n\n /** `<ng-template pTemplate=\"label\" let-value let-totalPercent=\"totalPercent\" let-percentages=\"percentages\">`: the whole legend. */\n get labelTemplate(): TemplateRef<unknown> | null {\n return template(this.labelRef) || ɵfindTemplate(this.templates, 'label');\n }\n /** `<ng-template pTemplate=\"meter\" let-item let-size=\"size\" let-class=\"class\">`: one segment. */\n get meterTemplate(): TemplateRef<unknown> | null {\n return template(this.meterRef) || ɵfindTemplate(this.templates, 'meter');\n }\n /** `<ng-template pTemplate=\"start\">` / `\"end\"`: content before or after the bar. */\n get startTemplate(): TemplateRef<unknown> | null {\n return template(this.startRef) || ɵfindTemplate(this.templates, 'start');\n }\n get endTemplate(): TemplateRef<unknown> | null {\n return template(this.endRef) || ɵfindTemplate(this.templates, 'end');\n }\n /** `<ng-template pTemplate=\"icon\" let-item>`: the marker of one legend item. */\n get iconTemplate(): TemplateRef<unknown> | null {\n return template(this.iconRef) || ɵfindTemplate(this.templates, 'icon');\n }\n\n get classes(): string {\n const o = this.orientation;\n const c = ['wu-metergroup', 'p-metergroup', 'p-component', `wu-metergroup-${o}`, `p-metergroup-${o}`];\n if (this._reverse) c.push('wu-metergroup-reverse');\n if (this.styleClass) c.push(this.styleClass);\n return c.join(' ');\n }\n get labelClasses(): string {\n const o = this.labelOrientation;\n return `wu-metergroup-labels wu-metergroup-labels-${o} p-metergroup-labels p-metergroup-labels-${o}`;\n }\n\n meterContext(index: number): WuMeterContext {\n return {\n $implicit: this.parts.items[index],\n index,\n orientation: this.orientation,\n class: 'wu-metergroup-meter p-metergroup-meter',\n size: this.parts.sizes[index],\n totalPercent: this.parts.totalPercent,\n };\n }\n\n private refresh(): void {\n this.parts = ɵmeterParts(this._value, this._min, this._max);\n this.groupContext = { $implicit: this.parts.items, totalPercent: this.parts.totalPercent, percentages: this.parts.percentages };\n }\n}\n","<div\n [class]=\"classes\"\n [style]=\"rootStyle\"\n role=\"meter\"\n [attr.aria-valuemin]=\"min\"\n [attr.aria-valuemax]=\"max\"\n [attr.aria-valuenow]=\"parts.totalPercent\"\n [attr.aria-label]=\"ariaLabel || null\"\n>\n <ng-container *ngIf=\"labelPosition === 'start'\">\n <ng-container *ngTemplateOutlet=\"legend\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"startTemplate\">\n <ng-container *ngTemplateOutlet=\"startTemplate; context: groupContext\"></ng-container>\n </ng-container>\n <div class=\"wu-metergroup-meters p-metergroup-meters\">\n <ng-container *ngFor=\"let item of parts.items; let i = index\">\n <ng-container *ngIf=\"meterTemplate; else plainMeter\">\n <ng-container *ngTemplateOutlet=\"meterTemplate; context: meterContext(i)\"></ng-container>\n </ng-container>\n <ng-template #plainMeter>\n <span\n class=\"wu-metergroup-meter p-metergroup-meter\"\n [style.background]=\"parts.colors[i]\"\n [style.width]=\"orientation === 'horizontal' ? parts.sizes[i] : null\"\n [style.height]=\"orientation === 'vertical' ? parts.sizes[i] : null\"\n ></span>\n </ng-template>\n </ng-container>\n </div>\n <ng-container *ngIf=\"endTemplate\">\n <ng-container *ngTemplateOutlet=\"endTemplate; context: groupContext\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"labelPosition === 'end'\">\n <ng-container *ngTemplateOutlet=\"legend\"></ng-container>\n </ng-container>\n</div>\n\n<ng-template #legend>\n <ng-container *ngIf=\"labelTemplate; else plainLegend\">\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: groupContext\"></ng-container>\n </ng-container>\n <ng-template #plainLegend>\n <ol [class]=\"labelClasses\">\n <li *ngFor=\"let item of parts.items; let i = index\" class=\"wu-metergroup-label p-metergroup-label\">\n <ng-container *ngIf=\"iconTemplate; else plainIcon\">\n <ng-container *ngTemplateOutlet=\"iconTemplate; context: { $implicit: item, icon: item.icon }\"></ng-container>\n </ng-container>\n <ng-template #plainIcon>\n <i\n *ngIf=\"item.icon; else marker\"\n [class]=\"'wu-metergroup-label-icon p-metergroup-label-icon ' + item.icon\"\n [style.color]=\"parts.colors[i]\"\n aria-hidden=\"true\"\n ></i>\n <ng-template #marker>\n <span class=\"wu-metergroup-label-marker p-metergroup-label-marker\" [style.background]=\"parts.colors[i]\"></span>\n </ng-template>\n </ng-template>\n <span class=\"wu-metergroup-label-text p-metergroup-label-text\">{{ item.label }} ({{ parts.percentages[i] }}%)</span>\n </li>\n </ol>\n </ng-template>\n</ng-template>\n","import { NgModule } from '@angular/core';\nimport { WuMeterGroup } from './metergroup.component';\n\n/** For NgModule apps. Standalone apps can import `WuMeterGroup` directly. */\n@NgModule({\n imports: [WuMeterGroup],\n exports: [WuMeterGroup],\n})\nexport class WuMeterGroupModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n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AAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;iHAAlB,kBAAkB,EAAA,OAAA,EAAA,CAHnB,YAAY,CAAA,EAAA,OAAA,EAAA,CACZ,YAAY,CAAA,EAAA,CAAA,CAAA;AAEX,kBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YAHnB,YAAY,CAAA,EAAA,CAAA,CAAA;4FAGX,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,YAAY,CAAC;AACxB,iBAAA,CAAA;;;ACPD;;AAEG;;;;"}
1
+ {"version":3,"file":"wirabyte-ui-metergroup.mjs","sources":["../../lib/metergroup/metergroup.types.ts","../../lib/metergroup/metergroup.component.ts","../../lib/metergroup/metergroup.component.html","../../lib/metergroup/metergroup.module.ts","../../lib/metergroup/wirabyte-ui-metergroup.ts"],"sourcesContent":["/** One part of the meter: `{ label: 'รูปภาพ', value: 24, color: '#34d399', icon: 'pi pi-image' }`. */\nexport interface WuMeterItem {\n label?: string;\n value: number;\n /** Any CSS colour. Default: the theme's primary, info, success, warn, danger and help colours in turn. */\n color?: string;\n /** Icon class shown in the legend instead of the colour dot. */\n icon?: string;\n}\n\n/** `(onItemClick)` of a clickable legend: the item, its place in `value`, and the click. */\nexport interface WuMeterItemClickEvent {\n originalEvent: Event;\n item: WuMeterItem;\n index: number;\n}\n\nexport type WuMeterOrientation = 'horizontal' | 'vertical';\nexport type WuMeterLabelPosition = 'start' | 'end';\n\n/** Context of the `label`, `start` and `end` templates. */\nexport interface WuMeterGroupContext {\n $implicit: WuMeterItem[];\n /** Sum of all values as 0–100 of the range. */\n totalPercent: number;\n /** Each item as 0–100 of the range, rounded. */\n percentages: number[];\n}\n\n/** Context of the `meter` template (one bar segment). */\nexport interface WuMeterContext {\n $implicit: WuMeterItem;\n index: number;\n orientation: WuMeterOrientation;\n /** Classes the built-in segment carries. */\n class: string;\n /** Width (horizontal) or height (vertical) of the segment, e.g. `24%`. */\n size: string;\n totalPercent: number;\n}\n\nconst PALETTE = ['primary', 'info', 'success', 'warn', 'danger', 'help'];\n\n/** The item's colour, or the theme colour for its place. */\nexport function ɵmeterColor(item: WuMeterItem, index: number): string {\n return item.color || `var(--wu-${PALETTE[index % PALETTE.length]}-color)`;\n}\n\n/** `value` as 0–100 of the min–max range (not rounded: segment sizes). */\nexport function ɵmeterShare(value: number, min: number, max: number): number {\n const span = max - min;\n if (!(span > 0)) return 0;\n return Math.max(0, Math.min(100, ((Number(value) - min) / span) * 100)) || 0;\n}\n\n/** The parts a meter group shows, worked out once per change. */\nexport function ɵmeterParts(items: WuMeterItem[] | null | undefined, min: number, max: number) {\n const list = items || [];\n const shares = list.map((i) => ɵmeterShare(i.value, min, max));\n const total = ɵmeterShare(\n list.reduce((sum, i) => sum + (Number(i.value) || 0), 0),\n min,\n max,\n );\n return {\n items: list,\n sizes: shares.map((s) => `${s}%`),\n percentages: shares.map((s) => Math.round(s)),\n colors: list.map((i, n) => ɵmeterColor(i, n)),\n totalPercent: Math.round(total),\n };\n}\n","import { NgFor, NgIf, NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n ContentChildren,\n EventEmitter,\n inject,\n Input,\n Output,\n QueryList,\n TemplateRef,\n ViewEncapsulation,\n} from '@angular/core';\nimport { WuConfig, ɵassertSupportedAngular, ɵfindTemplate, ɵtoBool, ɵWU_SKIP_VERSION_CHECK, WuTemplate } from '@wirabyte/ui/config';\nimport {\n ɵmeterParts,\n WuMeterContext,\n WuMeterGroupContext,\n WuMeterItem,\n WuMeterItemClickEvent,\n WuMeterLabelPosition,\n WuMeterOrientation,\n} from './metergroup.types';\n\nconst template = (v: unknown): TemplateRef<unknown> | null => (v instanceof TemplateRef ? v : null);\ntype Parts = ReturnType<typeof ɵmeterParts>;\n\n/**\n * Several values on one bar, with a legend: `<wu-metergroup [value]=\"[{ label: 'รูปภาพ', value: 24 }, …]\">`.\n * Values are read against `min`–`max` (0–100 by default).\n */\n@Component({\n selector: 'wu-metergroup, wu-meterGroup, wu-meter-group',\n standalone: true,\n imports: [NgIf, NgFor, NgTemplateOutlet],\n templateUrl: './metergroup.component.html',\n styleUrls: ['./metergroup.css'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class WuMeterGroup {\n @Input() set value(v: WuMeterItem[] | null | undefined) {\n this._value = v || [];\n this.refresh();\n }\n get value(): WuMeterItem[] {\n return this._value;\n }\n @Input() set min(v: unknown) {\n this._min = Number(v) || 0;\n this.refresh();\n }\n get min(): number {\n return this._min;\n }\n @Input() set max(v: unknown) {\n this._max = v === undefined || v === null || v === '' ? 100 : Number(v);\n this.refresh();\n }\n get max(): number {\n return this._max;\n }\n @Input() orientation: WuMeterOrientation = 'horizontal';\n /** Fill from the other end: right to left, or (vertical) bottom to top. */\n @Input() set reverse(v: unknown) { this._reverse = ɵtoBool(v); }\n get reverse(): boolean { return this._reverse; }\n private _reverse = false;\n /** Legend before or after the bar. */\n @Input() labelPosition: WuMeterLabelPosition = 'end';\n /** Legend items in a row or a column. */\n @Input() labelOrientation: WuMeterOrientation = 'horizontal';\n /** Each legend item shows its value too: `เปิด 12 (24%)`. */\n @Input() set showValue(v: unknown) { this._showValue = ɵtoBool(v); }\n get showValue(): boolean { return this._showValue; }\n /** Legend items become buttons that emit `(onItemClick)`, e.g. to open the list for that status. */\n @Input() set clickable(v: unknown) { this._clickable = ɵtoBool(v); }\n get clickable(): boolean { return this._clickable; }\n @Output() readonly onItemClick = new EventEmitter<WuMeterItemClickEvent>();\n @Input() styleClass?: string;\n /** Inline styles for the root element, as an object: `[style]=\"{ width: '20rem' }\"`. */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n @Input() style?: Record<string, any> | string | null;\n /** The `style` object for the root (a plain style attribute already styles the host). */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get rootStyle(): Record<string, any> | null {\n return this.style && typeof this.style === 'object' ? this.style : null;\n }\n @Input() ariaLabel?: string;\n\n @ContentChild('label', { descendants: false }) private labelRef?: unknown;\n @ContentChild('meter', { descendants: false }) private meterRef?: unknown;\n @ContentChild('start', { descendants: false }) private startRef?: unknown;\n @ContentChild('end', { descendants: false }) private endRef?: unknown;\n @ContentChild('icon', { descendants: false }) private iconRef?: unknown;\n @ContentChildren(WuTemplate) private templates?: QueryList<WuTemplate>;\n\n parts: Parts = ɵmeterParts([], 0, 100);\n groupContext: WuMeterGroupContext = { $implicit: [], totalPercent: 0, percentages: [] };\n private _value: WuMeterItem[] = [];\n private _min = 0;\n private _max = 100;\n private _showValue = false;\n private _clickable = false;\n\n private readonly config = inject(WuConfig);\n\n constructor() {\n ɵassertSupportedAngular(inject(ɵWU_SKIP_VERSION_CHECK, { optional: true }));\n }\n\n /** The legend text of one item. */\n labelText(item: WuMeterItem, percent: number): string {\n const value = this._showValue ? ' ' + Number(item.value).toLocaleString(this.config.translation.code === 'th' ? 'th-TH' : 'en-US') : '';\n return `${item.label ?? ''}${value} (${percent}%)`;\n }\n\n itemClick(event: Event, item: WuMeterItem, index: number): void {\n this.onItemClick.emit({ originalEvent: event, item, index });\n }\n\n /** `<ng-template pTemplate=\"label\" let-value let-totalPercent=\"totalPercent\" let-percentages=\"percentages\">`: the whole legend. */\n get labelTemplate(): TemplateRef<unknown> | null {\n return template(this.labelRef) || ɵfindTemplate(this.templates, 'label');\n }\n /** `<ng-template pTemplate=\"meter\" let-item let-size=\"size\" let-class=\"class\">`: one segment. */\n get meterTemplate(): TemplateRef<unknown> | null {\n return template(this.meterRef) || ɵfindTemplate(this.templates, 'meter');\n }\n /** `<ng-template pTemplate=\"start\">` / `\"end\"`: content before or after the bar. */\n get startTemplate(): TemplateRef<unknown> | null {\n return template(this.startRef) || ɵfindTemplate(this.templates, 'start');\n }\n get endTemplate(): TemplateRef<unknown> | null {\n return template(this.endRef) || ɵfindTemplate(this.templates, 'end');\n }\n /** `<ng-template pTemplate=\"icon\" let-item>`: the marker of one legend item. */\n get iconTemplate(): TemplateRef<unknown> | null {\n return template(this.iconRef) || ɵfindTemplate(this.templates, 'icon');\n }\n\n get classes(): string {\n const o = this.orientation;\n const c = ['wu-metergroup', 'p-metergroup', 'p-component', `wu-metergroup-${o}`, `p-metergroup-${o}`];\n if (this._reverse) c.push('wu-metergroup-reverse');\n if (this.styleClass) c.push(this.styleClass);\n return c.join(' ');\n }\n get labelClasses(): string {\n const o = this.labelOrientation;\n return `wu-metergroup-labels wu-metergroup-labels-${o} p-metergroup-labels p-metergroup-labels-${o}`;\n }\n\n meterContext(index: number): WuMeterContext {\n return {\n $implicit: this.parts.items[index],\n index,\n orientation: this.orientation,\n class: 'wu-metergroup-meter p-metergroup-meter',\n size: this.parts.sizes[index],\n totalPercent: this.parts.totalPercent,\n };\n }\n\n private refresh(): void {\n this.parts = ɵmeterParts(this._value, this._min, this._max);\n this.groupContext = { $implicit: this.parts.items, totalPercent: this.parts.totalPercent, percentages: this.parts.percentages };\n }\n}\n","<div\n [class]=\"classes\"\n [style]=\"rootStyle\"\n role=\"meter\"\n [attr.aria-valuemin]=\"min\"\n [attr.aria-valuemax]=\"max\"\n [attr.aria-valuenow]=\"parts.totalPercent\"\n [attr.aria-label]=\"ariaLabel || null\"\n>\n <ng-container *ngIf=\"labelPosition === 'start'\">\n <ng-container *ngTemplateOutlet=\"legend\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"startTemplate\">\n <ng-container *ngTemplateOutlet=\"startTemplate; context: groupContext\"></ng-container>\n </ng-container>\n <div class=\"wu-metergroup-meters p-metergroup-meters\">\n <ng-container *ngFor=\"let item of parts.items; let i = index\">\n <ng-container *ngIf=\"meterTemplate; else plainMeter\">\n <ng-container *ngTemplateOutlet=\"meterTemplate; context: meterContext(i)\"></ng-container>\n </ng-container>\n <ng-template #plainMeter>\n <span\n class=\"wu-metergroup-meter p-metergroup-meter\"\n [style.background]=\"parts.colors[i]\"\n [style.width]=\"orientation === 'horizontal' ? parts.sizes[i] : null\"\n [style.height]=\"orientation === 'vertical' ? parts.sizes[i] : null\"\n ></span>\n </ng-template>\n </ng-container>\n </div>\n <ng-container *ngIf=\"endTemplate\">\n <ng-container *ngTemplateOutlet=\"endTemplate; context: groupContext\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"labelPosition === 'end'\">\n <ng-container *ngTemplateOutlet=\"legend\"></ng-container>\n </ng-container>\n</div>\n\n<ng-template #legend>\n <ng-container *ngIf=\"labelTemplate; else plainLegend\">\n <ng-container *ngTemplateOutlet=\"labelTemplate; context: groupContext\"></ng-container>\n </ng-container>\n <ng-template #plainLegend>\n <ol [class]=\"labelClasses\">\n <li *ngFor=\"let item of parts.items; let i = index\" class=\"wu-metergroup-label p-metergroup-label\">\n <button *ngIf=\"clickable; else still\" type=\"button\" class=\"wu-metergroup-label-button\" (click)=\"itemClick($event, item, i)\">\n <ng-container *ngTemplateOutlet=\"labelContent; context: { $implicit: item, i: i }\"></ng-container>\n </button>\n <ng-template #still>\n <ng-container *ngTemplateOutlet=\"labelContent; context: { $implicit: item, i: i }\"></ng-container>\n </ng-template>\n </li>\n </ol>\n </ng-template>\n</ng-template>\n\n<ng-template #labelContent let-item let-i=\"i\">\n <ng-container *ngIf=\"iconTemplate; else plainIcon\">\n <ng-container *ngTemplateOutlet=\"iconTemplate; context: { $implicit: item, icon: item.icon }\"></ng-container>\n </ng-container>\n <ng-template #plainIcon>\n <i\n *ngIf=\"item.icon; else marker\"\n [class]=\"'wu-metergroup-label-icon p-metergroup-label-icon ' + item.icon\"\n [style.color]=\"parts.colors[i]\"\n aria-hidden=\"true\"\n ></i>\n <ng-template #marker>\n <span class=\"wu-metergroup-label-marker p-metergroup-label-marker\" [style.background]=\"parts.colors[i]\"></span>\n </ng-template>\n </ng-template>\n <span class=\"wu-metergroup-label-text p-metergroup-label-text\">{{ labelText(item, parts.percentages[i]) }}</span>\n</ng-template>\n","import { NgModule } from '@angular/core';\nimport { WuMeterGroup } from './metergroup.component';\n\n/** For NgModule apps. Standalone apps can import `WuMeterGroup` directly. */\n@NgModule({\n imports: [WuMeterGroup],\n exports: [WuMeterGroup],\n})\nexport class WuMeterGroupModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAyCA,MAAM,OAAO,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAEzE;AACgB,SAAA,WAAW,CAAC,IAAiB,EAAE,KAAa,EAAA;AAC1D,IAAA,OAAO,IAAI,CAAC,KAAK,IAAI,YAAY,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC;AAC5E,CAAC;AAED;SACgB,WAAW,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,EAAA;AACjE,IAAA,MAAM,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC;AACvB,IAAA,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC;AAAE,QAAA,OAAO,CAAC,CAAC;AAC1B,IAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,IAAI,IAAI,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;AAC/E,CAAC;AAED;SACgB,WAAW,CAAC,KAAuC,EAAE,GAAW,EAAE,GAAW,EAAA;AAC3F,IAAA,MAAM,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;IACzB,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,KAAK,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