ngwr 16.0.0 → 16.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (295) hide show
  1. package/badge/styles/_tag.scss +8 -4
  2. package/button/styles/_index.scss +13 -7
  3. package/cascader/styles/_rules.scss +4 -2
  4. package/checkbox/styles/_index.scss +4 -2
  5. package/date-picker/styles/_index.scss +95 -3
  6. package/date-stamp/styles/_index.scss +38 -0
  7. package/dialog/styles/_index.scss +38 -0
  8. package/dropdown/styles/_index.scss +37 -1
  9. package/fesm2022/internal-CVLvP9b_.mjs +33 -0
  10. package/fesm2022/internal-CVLvP9b_.mjs.map +1 -0
  11. package/fesm2022/ngwr-alert.mjs +11 -7
  12. package/fesm2022/ngwr-alert.mjs.map +1 -1
  13. package/fesm2022/ngwr-avatar.mjs +11 -7
  14. package/fesm2022/ngwr-avatar.mjs.map +1 -1
  15. package/fesm2022/ngwr-back-top.mjs +10 -6
  16. package/fesm2022/ngwr-back-top.mjs.map +1 -1
  17. package/fesm2022/ngwr-badge.mjs +18 -6
  18. package/fesm2022/ngwr-badge.mjs.map +1 -1
  19. package/fesm2022/ngwr-burger.mjs +9 -6
  20. package/fesm2022/ngwr-burger.mjs.map +1 -1
  21. package/fesm2022/ngwr-button.mjs +8 -4
  22. package/fesm2022/ngwr-button.mjs.map +1 -1
  23. package/fesm2022/ngwr-calendar.mjs +19 -8
  24. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  25. package/fesm2022/ngwr-card.mjs +9 -5
  26. package/fesm2022/ngwr-card.mjs.map +1 -1
  27. package/fesm2022/ngwr-cascader.mjs +11 -5
  28. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  29. package/fesm2022/ngwr-charts-calendar-heatmap.mjs +5 -2
  30. package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
  31. package/fesm2022/ngwr-checkbox.mjs +10 -6
  32. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  33. package/fesm2022/ngwr-clipboard.mjs +2 -1
  34. package/fesm2022/ngwr-clipboard.mjs.map +1 -1
  35. package/fesm2022/ngwr-collapse.mjs +9 -5
  36. package/fesm2022/ngwr-collapse.mjs.map +1 -1
  37. package/fesm2022/ngwr-color-picker.mjs +4 -2
  38. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  39. package/fesm2022/ngwr-comment.mjs +13 -7
  40. package/fesm2022/ngwr-comment.mjs.map +1 -1
  41. package/fesm2022/ngwr-compare.mjs +9 -3
  42. package/fesm2022/ngwr-compare.mjs.map +1 -1
  43. package/fesm2022/ngwr-context-menu.mjs +4 -2
  44. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  45. package/fesm2022/ngwr-copy-value.mjs +11 -6
  46. package/fesm2022/ngwr-copy-value.mjs.map +1 -1
  47. package/fesm2022/ngwr-date-picker-testing.mjs +18 -0
  48. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  49. package/fesm2022/ngwr-date-picker.mjs +238 -38
  50. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  51. package/fesm2022/ngwr-date-stamp-testing.mjs +34 -0
  52. package/fesm2022/ngwr-date-stamp-testing.mjs.map +1 -0
  53. package/fesm2022/ngwr-date-stamp.mjs +213 -0
  54. package/fesm2022/ngwr-date-stamp.mjs.map +1 -0
  55. package/fesm2022/ngwr-date.mjs +364 -54
  56. package/fesm2022/ngwr-date.mjs.map +1 -1
  57. package/fesm2022/ngwr-descriptions.mjs +9 -5
  58. package/fesm2022/ngwr-descriptions.mjs.map +1 -1
  59. package/fesm2022/ngwr-dialog-testing.mjs +23 -2
  60. package/fesm2022/ngwr-dialog-testing.mjs.map +1 -1
  61. package/fesm2022/ngwr-dialog.mjs +45 -16
  62. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  63. package/fesm2022/ngwr-directives.mjs +102 -11
  64. package/fesm2022/ngwr-directives.mjs.map +1 -1
  65. package/fesm2022/ngwr-divider.mjs +4 -2
  66. package/fesm2022/ngwr-divider.mjs.map +1 -1
  67. package/fesm2022/ngwr-drawer.mjs +29 -3
  68. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  69. package/fesm2022/ngwr-dropdown-testing.mjs +38 -3
  70. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
  71. package/fesm2022/ngwr-dropdown.mjs +362 -26
  72. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  73. package/fesm2022/ngwr-editor.mjs +5 -2
  74. package/fesm2022/ngwr-editor.mjs.map +1 -1
  75. package/fesm2022/ngwr-event-calendar.mjs +4 -2
  76. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  77. package/fesm2022/ngwr-file-upload.mjs +9 -3
  78. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  79. package/fesm2022/ngwr-form.mjs +18 -6
  80. package/fesm2022/ngwr-form.mjs.map +1 -1
  81. package/fesm2022/ngwr-i18n-ar.mjs +9 -2
  82. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  83. package/fesm2022/ngwr-i18n-cs.mjs +9 -2
  84. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  85. package/fesm2022/ngwr-i18n-de.mjs +9 -2
  86. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  87. package/fesm2022/ngwr-i18n-en.mjs +9 -2
  88. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  89. package/fesm2022/ngwr-i18n-es.mjs +9 -2
  90. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  91. package/fesm2022/ngwr-i18n-fr.mjs +9 -2
  92. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  93. package/fesm2022/ngwr-i18n-he.mjs +9 -2
  94. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  95. package/fesm2022/ngwr-i18n-hi.mjs +9 -2
  96. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  97. package/fesm2022/ngwr-i18n-id.mjs +9 -2
  98. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  99. package/fesm2022/ngwr-i18n-it.mjs +9 -2
  100. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  101. package/fesm2022/ngwr-i18n-ja.mjs +9 -2
  102. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  103. package/fesm2022/ngwr-i18n-ko.mjs +9 -2
  104. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  105. package/fesm2022/ngwr-i18n-nl.mjs +9 -2
  106. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  107. package/fesm2022/ngwr-i18n-pl.mjs +9 -2
  108. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  109. package/fesm2022/ngwr-i18n-pt.mjs +9 -2
  110. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  111. package/fesm2022/ngwr-i18n-ru.mjs +9 -2
  112. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  113. package/fesm2022/ngwr-i18n-sv.mjs +9 -2
  114. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  115. package/fesm2022/ngwr-i18n-tr.mjs +9 -2
  116. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  117. package/fesm2022/ngwr-i18n-uk.mjs +9 -2
  118. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  119. package/fesm2022/ngwr-i18n-vi.mjs +9 -2
  120. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  121. package/fesm2022/ngwr-i18n-zh-tw.mjs +9 -2
  122. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  123. package/fesm2022/ngwr-i18n-zh.mjs +9 -2
  124. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  125. package/fesm2022/ngwr-i18n.mjs +34 -8
  126. package/fesm2022/ngwr-i18n.mjs.map +1 -1
  127. package/fesm2022/ngwr-input-number.mjs +9 -3
  128. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  129. package/fesm2022/ngwr-input-otp.mjs +4 -2
  130. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  131. package/fesm2022/ngwr-input.mjs +20 -10
  132. package/fesm2022/ngwr-input.mjs.map +1 -1
  133. package/fesm2022/ngwr-keyboard.mjs +9 -3
  134. package/fesm2022/ngwr-keyboard.mjs.map +1 -1
  135. package/fesm2022/ngwr-knob.mjs +9 -3
  136. package/fesm2022/ngwr-knob.mjs.map +1 -1
  137. package/fesm2022/ngwr-layout.mjs +13 -5
  138. package/fesm2022/ngwr-layout.mjs.map +1 -1
  139. package/fesm2022/ngwr-lightbox-testing.mjs +26 -0
  140. package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -1
  141. package/fesm2022/ngwr-lightbox.mjs +255 -15
  142. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  143. package/fesm2022/ngwr-list.mjs +13 -5
  144. package/fesm2022/ngwr-list.mjs.map +1 -1
  145. package/fesm2022/ngwr-load-state.mjs +9 -5
  146. package/fesm2022/ngwr-load-state.mjs.map +1 -1
  147. package/fesm2022/ngwr-overlay.mjs +84 -1
  148. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  149. package/fesm2022/ngwr-pagination.mjs +3 -2
  150. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  151. package/fesm2022/ngwr-pipes.mjs +47 -9
  152. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  153. package/fesm2022/ngwr-popover.mjs +93 -4
  154. package/fesm2022/ngwr-popover.mjs.map +1 -1
  155. package/fesm2022/ngwr-progress.mjs +4 -2
  156. package/fesm2022/ngwr-progress.mjs.map +1 -1
  157. package/fesm2022/ngwr-radio.mjs +9 -5
  158. package/fesm2022/ngwr-radio.mjs.map +1 -1
  159. package/fesm2022/ngwr-rating.mjs +9 -3
  160. package/fesm2022/ngwr-rating.mjs.map +1 -1
  161. package/fesm2022/ngwr-resizable.mjs +503 -0
  162. package/fesm2022/ngwr-resizable.mjs.map +1 -0
  163. package/fesm2022/ngwr-result.mjs +9 -5
  164. package/fesm2022/ngwr-result.mjs.map +1 -1
  165. package/fesm2022/ngwr-schema-form.mjs +3 -0
  166. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  167. package/fesm2022/ngwr-segmented.mjs +4 -2
  168. package/fesm2022/ngwr-segmented.mjs.map +1 -1
  169. package/fesm2022/ngwr-select.mjs +13 -5
  170. package/fesm2022/ngwr-select.mjs.map +1 -1
  171. package/fesm2022/ngwr-skeleton.mjs +4 -2
  172. package/fesm2022/ngwr-skeleton.mjs.map +1 -1
  173. package/fesm2022/ngwr-slider-testing.mjs +17 -0
  174. package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
  175. package/fesm2022/ngwr-slider.mjs +91 -13
  176. package/fesm2022/ngwr-slider.mjs.map +1 -1
  177. package/fesm2022/ngwr-sortable-list-testing.mjs +103 -0
  178. package/fesm2022/ngwr-sortable-list-testing.mjs.map +1 -0
  179. package/fesm2022/ngwr-sortable-list.mjs +257 -53
  180. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  181. package/fesm2022/ngwr-speed-dial.mjs +4 -2
  182. package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
  183. package/fesm2022/ngwr-spinner.mjs +4 -2
  184. package/fesm2022/ngwr-spinner.mjs.map +1 -1
  185. package/fesm2022/ngwr-splitter.mjs +17 -21
  186. package/fesm2022/ngwr-splitter.mjs.map +1 -1
  187. package/fesm2022/ngwr-stepper.mjs +9 -3
  188. package/fesm2022/ngwr-stepper.mjs.map +1 -1
  189. package/fesm2022/ngwr-switch.mjs +9 -5
  190. package/fesm2022/ngwr-switch.mjs.map +1 -1
  191. package/fesm2022/ngwr-table-testing.mjs +5 -1
  192. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  193. package/fesm2022/ngwr-table.mjs +167 -10
  194. package/fesm2022/ngwr-table.mjs.map +1 -1
  195. package/fesm2022/ngwr-textarea.mjs +9 -3
  196. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  197. package/fesm2022/ngwr-timeline.mjs +18 -8
  198. package/fesm2022/ngwr-timeline.mjs.map +1 -1
  199. package/fesm2022/ngwr-toast-testing.mjs +6 -1
  200. package/fesm2022/ngwr-toast-testing.mjs.map +1 -1
  201. package/fesm2022/ngwr-toast.mjs +529 -104
  202. package/fesm2022/ngwr-toast.mjs.map +1 -1
  203. package/fesm2022/ngwr-transfer.mjs +4 -2
  204. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  205. package/fesm2022/ngwr-tree.mjs +4 -2
  206. package/fesm2022/ngwr-tree.mjs.map +1 -1
  207. package/fesm2022/ngwr-typography.mjs +9 -3
  208. package/fesm2022/ngwr-typography.mjs.map +1 -1
  209. package/fesm2022/ngwr-utils-router.mjs +18 -2
  210. package/fesm2022/ngwr-utils-router.mjs.map +1 -1
  211. package/fesm2022/ngwr-utils.mjs +9 -2
  212. package/fesm2022/ngwr-utils.mjs.map +1 -1
  213. package/fesm2022/ngwr-version.mjs +1 -1
  214. package/fesm2022/ngwr-version.mjs.map +1 -1
  215. package/fesm2022/ngwr-window.mjs +7 -4
  216. package/fesm2022/ngwr-window.mjs.map +1 -1
  217. package/fesm2022/ngwr.mjs.map +1 -1
  218. package/i18n/ar.json +13 -2
  219. package/i18n/cs.json +13 -2
  220. package/i18n/de.json +13 -2
  221. package/i18n/en.json +13 -2
  222. package/i18n/es.json +13 -2
  223. package/i18n/fr.json +13 -2
  224. package/i18n/he.json +13 -2
  225. package/i18n/hi.json +13 -2
  226. package/i18n/id.json +13 -2
  227. package/i18n/it.json +13 -2
  228. package/i18n/ja.json +13 -2
  229. package/i18n/ko.json +13 -2
  230. package/i18n/nl.json +13 -2
  231. package/i18n/pl.json +13 -2
  232. package/i18n/pt.json +13 -2
  233. package/i18n/ru.json +13 -2
  234. package/i18n/sv.json +13 -2
  235. package/i18n/tr.json +13 -2
  236. package/i18n/uk.json +13 -2
  237. package/i18n/vi.json +13 -2
  238. package/i18n/zh-TW.json +13 -2
  239. package/i18n/zh.json +13 -2
  240. package/input/styles/_index.scss +10 -5
  241. package/input-number/styles/_index.scss +6 -3
  242. package/input-otp/styles/_index.scss +4 -2
  243. package/lightbox/styles/_rules.scss +96 -0
  244. package/llms-full.txt +40 -17
  245. package/llms.txt +20 -4
  246. package/package.json +19 -1
  247. package/radio/styles/_index.scss +4 -2
  248. package/resizable/styles/_index.scss +154 -0
  249. package/schematics/use/rule.js +1 -0
  250. package/schematics/use/symbol-map.json +5 -0
  251. package/select/styles/_index.scss +6 -3
  252. package/skills/ngwr/SKILL.md +1 -1
  253. package/skills/ngwr/references/catalog.md +6 -2
  254. package/skills/ngwr/references/setup.md +3 -0
  255. package/slider/styles/_index.scss +106 -0
  256. package/sortable-list/styles/_rules.scss +23 -1
  257. package/switch/styles/_index.scss +4 -2
  258. package/table/styles/_index.scss +53 -0
  259. package/textarea/styles/_index.scss +4 -2
  260. package/theme/styles/_motion.scss +6 -0
  261. package/toast/styles/_index.scss +19 -0
  262. package/types/ngwr-burger.d.ts +0 -1
  263. package/types/ngwr-calendar.d.ts +7 -0
  264. package/types/ngwr-charts-calendar-heatmap.d.ts +2 -1
  265. package/types/ngwr-clipboard.d.ts +7 -0
  266. package/types/ngwr-date-picker-testing.d.ts +17 -0
  267. package/types/ngwr-date-picker.d.ts +88 -4
  268. package/types/ngwr-date-stamp-testing.d.ts +47 -0
  269. package/types/ngwr-date-stamp.d.ts +127 -0
  270. package/types/ngwr-date.d.ts +251 -37
  271. package/types/ngwr-dialog-testing.d.ts +10 -0
  272. package/types/ngwr-dialog.d.ts +72 -4
  273. package/types/ngwr-directives.d.ts +36 -1
  274. package/types/ngwr-drawer.d.ts +21 -0
  275. package/types/ngwr-dropdown-testing.d.ts +53 -5
  276. package/types/ngwr-dropdown.d.ts +100 -0
  277. package/types/ngwr-i18n.d.ts +44 -14
  278. package/types/ngwr-lightbox-testing.d.ts +27 -0
  279. package/types/ngwr-lightbox.d.ts +71 -6
  280. package/types/ngwr-overlay.d.ts +36 -0
  281. package/types/ngwr-pipes.d.ts +48 -13
  282. package/types/ngwr-popover.d.ts +39 -1
  283. package/types/ngwr-resizable.d.ts +228 -0
  284. package/types/ngwr-slider-testing.d.ts +8 -1
  285. package/types/ngwr-slider.d.ts +89 -3
  286. package/types/ngwr-sortable-list-testing.d.ts +79 -0
  287. package/types/ngwr-sortable-list.d.ts +113 -10
  288. package/types/ngwr-table-testing.d.ts +3 -1
  289. package/types/ngwr-table.d.ts +120 -4
  290. package/types/ngwr-toast-testing.d.ts +12 -1
  291. package/types/ngwr-toast.d.ts +215 -18
  292. package/types/ngwr-utils-router.d.ts +22 -0
  293. package/types/ngwr-utils.d.ts +8 -1
  294. package/types/ngwr-version.d.ts +1 -1
  295. package/types/ngwr.d.ts +1 -0
@@ -0,0 +1,503 @@
1
+ import { n as wrEndSeparatorDrag, r as wrSeparatorKeyMove, t as wrBeginSeparatorDrag } from "./internal-CVLvP9b_.mjs";
2
+ import * as i0 from "@angular/core";
3
+ import { DOCUMENT, DestroyRef, Directive, ElementRef, Renderer2, afterNextRender, computed, effect, inject, input, model, output, signal, untracked } from "@angular/core";
4
+ import { coerceBooleanProperty, coerceNumberProperty } from "@angular/cdk/coercion";
5
+ import { wrCheckStyles, wrClamp } from "ngwr/utils";
6
+ import { useI18nText } from "ngwr/i18n";
7
+ import { Directionality } from "@angular/cdk/bidi";
8
+ import { WrStorage } from "ngwr/storage";
9
+ /**
10
+ * @license
11
+ *
12
+ * Use of this source code is governed by an MIT-style license that can be
13
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
14
+ */
15
+ const PERCENT = /^(-?\d+(?:\.\d+)?)%$/;
16
+ function toLimit(value) {
17
+ if (typeof value === "number") return Number.isFinite(value) ? value : null;
18
+ if (typeof value !== "string") return null;
19
+ const text = value.trim();
20
+ if (PERCENT.test(text)) return text;
21
+ const px = Number.parseFloat(text);
22
+ return Number.isFinite(px) ? px : null;
23
+ }
24
+ function toSize(value) {
25
+ if (value === null || value === void 0 || value === "") return null;
26
+ const px = Number(value);
27
+ return Number.isFinite(px) ? px : null;
28
+ }
29
+ function storageKey(key) {
30
+ return `wr:resizable:${key}`;
31
+ }
32
+ var WrResizable = class WrResizable {
33
+ edge = input("end", ...ngDevMode ? [{ debugName: "edge" }] : /* istanbul ignore next */ []);
34
+ size = model(null, ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
35
+ minSize = input(0, {
36
+ ...ngDevMode ? { debugName: "minSize" } : /* istanbul ignore next */ {},
37
+ transform: toLimit
38
+ });
39
+ maxSize = input("100%", {
40
+ ...ngDevMode ? { debugName: "maxSize" } : /* istanbul ignore next */ {},
41
+ transform: toLimit
42
+ });
43
+ defaultSize = input(null, {
44
+ ...ngDevMode ? { debugName: "defaultSize" } : /* istanbul ignore next */ {},
45
+ transform: toSize
46
+ });
47
+ step = input(10, {
48
+ ...ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {},
49
+ transform: (v) => coerceNumberProperty(v, 10)
50
+ });
51
+ persistKey = input(null, ...ngDevMode ? [{ debugName: "persistKey" }] : /* istanbul ignore next */ []);
52
+ collapsed = input(false, {
53
+ ...ngDevMode ? { debugName: "collapsed" } : /* istanbul ignore next */ {},
54
+ transform: coerceBooleanProperty
55
+ });
56
+ disabled = input(false, {
57
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
58
+ transform: coerceBooleanProperty
59
+ });
60
+ resizeLabel = input(null, ...ngDevMode ? [{ debugName: "resizeLabel" }] : /* istanbul ignore next */ []);
61
+ resizing = output();
62
+ resolvedLabel = useI18nText(this.resizeLabel, "resizable.handle", "Resize");
63
+ host = inject(ElementRef).nativeElement;
64
+ renderer = inject(Renderer2);
65
+ doc = inject(DOCUMENT);
66
+ destroyRef = inject(DestroyRef);
67
+ storage = inject(WrStorage);
68
+ dir = inject(Directionality, { optional: true });
69
+ handle = signal(null, ...ngDevMode ? [{ debugName: "handle" }] : /* istanbul ignore next */ []);
70
+ draft = signal(null, ...ngDevMode ? [{ debugName: "draft" }] : /* istanbul ignore next */ []);
71
+ parentExtent = signal(null, ...ngDevMode ? [{ debugName: "parentExtent" }] : /* istanbul ignore next */ []);
72
+ measured = signal(null, ...ngDevMode ? [{ debugName: "measured" }] : /* istanbul ignore next */ []);
73
+ drag = null;
74
+ origin = null;
75
+ originRead = false;
76
+ axis = computed(() => this.edge() === "start" || this.edge() === "end" ? "inline" : "block", ...ngDevMode ? [{ debugName: "axis" }] : /* istanbul ignore next */ []);
77
+ min = computed(() => this.resolve(this.minSize()) ?? 0, ...ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []);
78
+ max = computed(() => this.resolve(this.maxSize()) ?? Number.POSITIVE_INFINITY, ...ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []);
79
+ current = computed(() => {
80
+ const size = this.draft() ?? this.size();
81
+ return size === null ? null : this.clamp(size);
82
+ }, ...ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []);
83
+ shown = computed(() => this.collapsed() ? 0 : this.current(), ...ngDevMode ? [{ debugName: "shown" }] : /* istanbul ignore next */ []);
84
+ inactive = computed(() => this.disabled() || this.collapsed(), ...ngDevMode ? [{ debugName: "inactive" }] : /* istanbul ignore next */ []);
85
+ classes = computed(() => {
86
+ const parts = [`wr-resizable--${this.edge()}`];
87
+ if (this.collapsed()) parts.push("wr-resizable--collapsed");
88
+ if (this.disabled()) parts.push("wr-resizable--disabled");
89
+ if (this.draft() !== null) parts.push("wr-resizable--resizing");
90
+ return parts.join(" ");
91
+ }, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
92
+ constructor() {
93
+ if (typeof ngDevMode === "undefined" || ngDevMode) wrCheckStyles("resizable");
94
+ effect(() => {
95
+ const key = this.persistKey();
96
+ untracked(() => {
97
+ if (!this.originRead) {
98
+ this.originRead = true;
99
+ this.origin = this.size();
100
+ }
101
+ if (!key) return;
102
+ const saved = this.storage.get(storageKey(key));
103
+ if (typeof saved === "number" && Number.isFinite(saved) && saved >= 0) this.size.set(saved);
104
+ });
105
+ });
106
+ effect(() => this.syncHandle());
107
+ effect(() => {
108
+ this.axis();
109
+ if (this.handle()) untracked(() => this.remeasure());
110
+ });
111
+ afterNextRender(() => this.mount());
112
+ this.destroyRef.onDestroy(() => {
113
+ this.drag?.release();
114
+ this.drag = null;
115
+ });
116
+ }
117
+ mount() {
118
+ const { host, renderer } = this;
119
+ if (this.doc.defaultView?.getComputedStyle(host).position === "static") renderer.setStyle(host, "position", "relative");
120
+ const handle = renderer.createElement("div");
121
+ renderer.addClass(handle, "wr-resizable__handle");
122
+ renderer.setAttribute(handle, "role", "separator");
123
+ const grip = renderer.createElement("span");
124
+ renderer.addClass(grip, "wr-resizable__grip");
125
+ renderer.setAttribute(grip, "aria-hidden", "true");
126
+ renderer.appendChild(handle, grip);
127
+ renderer.appendChild(host, handle);
128
+ const stop = [
129
+ renderer.listen(handle, "pointerdown", (e) => this.onPointerDown(e)),
130
+ renderer.listen(handle, "pointermove", (e) => this.onPointerMove(e)),
131
+ renderer.listen(handle, "pointerup", (e) => this.onPointerUp(e)),
132
+ renderer.listen(handle, "pointercancel", (e) => this.onPointerUp(e)),
133
+ renderer.listen(handle, "lostpointercapture", () => this.endDrag()),
134
+ renderer.listen(handle, "keydown", (e) => this.onKeydown(e)),
135
+ renderer.listen(handle, "dblclick", () => this.onReset())
136
+ ];
137
+ const parent = host.parentElement;
138
+ const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(() => this.remeasure());
139
+ observer?.observe(host);
140
+ if (parent) observer?.observe(parent);
141
+ this.remeasure();
142
+ this.handle.set(handle);
143
+ this.destroyRef.onDestroy(() => {
144
+ observer?.disconnect();
145
+ for (const off of stop) off();
146
+ renderer.removeChild(host, handle);
147
+ });
148
+ }
149
+ syncHandle() {
150
+ const handle = this.handle();
151
+ if (!handle) return;
152
+ const inactive = this.inactive();
153
+ const now = this.collapsed() ? 0 : this.current() ?? this.measured();
154
+ const max = this.max();
155
+ this.attr(handle, "aria-label", this.resolvedLabel());
156
+ this.attr(handle, "aria-orientation", this.axis() === "inline" ? "vertical" : "horizontal");
157
+ this.attr(handle, "aria-valuenow", now === null ? null : `${Math.round(now)}`);
158
+ this.attr(handle, "aria-valuemin", `${Math.round(this.min())}`);
159
+ this.attr(handle, "aria-valuemax", Number.isFinite(max) ? `${Math.round(max)}` : null);
160
+ this.attr(handle, "aria-disabled", inactive ? "true" : null);
161
+ this.attr(handle, "tabindex", inactive ? "-1" : "0");
162
+ }
163
+ attr(el, name, value) {
164
+ if (value === null) this.renderer.removeAttribute(el, name);
165
+ else this.renderer.setAttribute(el, name, value);
166
+ }
167
+ onPointerDown(event) {
168
+ if (this.inactive() || this.drag) return;
169
+ if (!wrBeginSeparatorDrag(event)) return;
170
+ this.measureParent();
171
+ const inline = this.axis() === "inline";
172
+ this.drag = {
173
+ origin: inline ? event.clientX : event.clientY,
174
+ start: this.current() ?? this.measure(),
175
+ sign: this.growSign(),
176
+ release: this.lockPage(inline ? "col-resize" : "row-resize")
177
+ };
178
+ }
179
+ onPointerMove(event) {
180
+ const drag = this.drag;
181
+ if (!drag) return;
182
+ const travel = (this.axis() === "inline" ? event.clientX : event.clientY) - drag.origin;
183
+ const next = Math.round(this.clamp(drag.start + drag.sign * travel));
184
+ if (next === this.draft()) return;
185
+ this.draft.set(next);
186
+ this.resizing.emit(next);
187
+ }
188
+ onPointerUp(event) {
189
+ if (!this.drag) return;
190
+ wrEndSeparatorDrag(event);
191
+ this.endDrag();
192
+ }
193
+ endDrag() {
194
+ const drag = this.drag;
195
+ if (!drag) return;
196
+ this.drag = null;
197
+ drag.release();
198
+ const size = this.draft();
199
+ this.draft.set(null);
200
+ if (size !== null) this.commit(size);
201
+ }
202
+ lockPage(cursor) {
203
+ const style = this.doc.documentElement.style;
204
+ const before = [
205
+ "user-select",
206
+ "-webkit-user-select",
207
+ "cursor"
208
+ ].map((name) => [
209
+ name,
210
+ style.getPropertyValue(name),
211
+ style.getPropertyPriority(name)
212
+ ]);
213
+ style.setProperty("user-select", "none");
214
+ style.setProperty("-webkit-user-select", "none");
215
+ style.setProperty("cursor", cursor);
216
+ return () => {
217
+ for (const [name, value, priority] of before) if (value) style.setProperty(name, value, priority);
218
+ else style.removeProperty(name);
219
+ };
220
+ }
221
+ onKeydown(event) {
222
+ if (this.inactive()) return;
223
+ if (event.key === "Enter") {
224
+ event.preventDefault();
225
+ this.onReset();
226
+ return;
227
+ }
228
+ const move = wrSeparatorKeyMove(event, this.axis(), this.isRtl());
229
+ if (move === null) return;
230
+ event.preventDefault();
231
+ this.measureParent();
232
+ let next;
233
+ if (move === "min") next = this.min();
234
+ else if (move === "max") next = this.max();
235
+ else {
236
+ const grow = this.edge() === "end" || this.edge() === "bottom" ? move : -move;
237
+ next = (this.current() ?? this.measure()) + grow * this.step() * (event.shiftKey ? 10 : 1);
238
+ }
239
+ if (Number.isFinite(next)) this.commit(Math.round(this.clamp(next)));
240
+ }
241
+ onReset() {
242
+ if (this.inactive()) return;
243
+ this.measureParent();
244
+ const target = this.defaultSize() ?? this.origin;
245
+ this.commit(target === null ? null : Math.round(this.clamp(target)));
246
+ }
247
+ commit(size) {
248
+ this.size.set(size);
249
+ const key = this.persistKey();
250
+ if (!key) return;
251
+ if (size === null) this.storage.remove(storageKey(key));
252
+ else this.storage.set(storageKey(key), size);
253
+ }
254
+ clamp(size) {
255
+ return wrClamp(size, this.min(), this.max());
256
+ }
257
+ resolve(limit) {
258
+ if (limit === null || typeof limit === "number") return limit;
259
+ const extent = this.parentExtent();
260
+ return extent ? extent * Number.parseFloat(limit) / 100 : null;
261
+ }
262
+ growSign() {
263
+ switch (this.edge()) {
264
+ case "end": return this.isRtl() ? -1 : 1;
265
+ case "start": return this.isRtl() ? 1 : -1;
266
+ case "top": return -1;
267
+ case "bottom": return 1;
268
+ }
269
+ }
270
+ isRtl() {
271
+ return this.dir?.value === "rtl";
272
+ }
273
+ measure() {
274
+ const inline = this.axis() === "inline";
275
+ const style = this.doc.defaultView?.getComputedStyle(this.host);
276
+ const computedSize = Number.parseFloat((inline ? style?.width : style?.height) ?? "");
277
+ if (Number.isFinite(computedSize)) return computedSize;
278
+ const rect = this.host.getBoundingClientRect();
279
+ return inline ? rect.width : rect.height;
280
+ }
281
+ remeasure() {
282
+ this.measureParent();
283
+ this.measured.set(this.measure());
284
+ }
285
+ measureParent() {
286
+ const parent = this.host.parentElement;
287
+ if (!parent) return;
288
+ this.parentExtent.set(this.axis() === "inline" ? parent.clientWidth : parent.clientHeight);
289
+ }
290
+ static ɵfac = i0.ɵɵngDeclareFactory({
291
+ minVersion: "12.0.0",
292
+ version: "22.2.5",
293
+ ngImport: i0,
294
+ type: WrResizable,
295
+ deps: [],
296
+ target: i0.ɵɵFactoryTarget.Directive
297
+ });
298
+ static ɵdir = i0.ɵɵngDeclareDirective({
299
+ minVersion: "17.1.0",
300
+ version: "22.2.5",
301
+ type: WrResizable,
302
+ isStandalone: true,
303
+ selector: "[wrResizable]",
304
+ inputs: {
305
+ edge: {
306
+ classPropertyName: "edge",
307
+ publicName: "edge",
308
+ isSignal: true,
309
+ isRequired: false,
310
+ transformFunction: null
311
+ },
312
+ size: {
313
+ classPropertyName: "size",
314
+ publicName: "size",
315
+ isSignal: true,
316
+ isRequired: false,
317
+ transformFunction: null
318
+ },
319
+ minSize: {
320
+ classPropertyName: "minSize",
321
+ publicName: "minSize",
322
+ isSignal: true,
323
+ isRequired: false,
324
+ transformFunction: null
325
+ },
326
+ maxSize: {
327
+ classPropertyName: "maxSize",
328
+ publicName: "maxSize",
329
+ isSignal: true,
330
+ isRequired: false,
331
+ transformFunction: null
332
+ },
333
+ defaultSize: {
334
+ classPropertyName: "defaultSize",
335
+ publicName: "defaultSize",
336
+ isSignal: true,
337
+ isRequired: false,
338
+ transformFunction: null
339
+ },
340
+ step: {
341
+ classPropertyName: "step",
342
+ publicName: "step",
343
+ isSignal: true,
344
+ isRequired: false,
345
+ transformFunction: null
346
+ },
347
+ persistKey: {
348
+ classPropertyName: "persistKey",
349
+ publicName: "persistKey",
350
+ isSignal: true,
351
+ isRequired: false,
352
+ transformFunction: null
353
+ },
354
+ collapsed: {
355
+ classPropertyName: "collapsed",
356
+ publicName: "collapsed",
357
+ isSignal: true,
358
+ isRequired: false,
359
+ transformFunction: null
360
+ },
361
+ disabled: {
362
+ classPropertyName: "disabled",
363
+ publicName: "disabled",
364
+ isSignal: true,
365
+ isRequired: false,
366
+ transformFunction: null
367
+ },
368
+ resizeLabel: {
369
+ classPropertyName: "resizeLabel",
370
+ publicName: "resizeLabel",
371
+ isSignal: true,
372
+ isRequired: false,
373
+ transformFunction: null
374
+ }
375
+ },
376
+ outputs: {
377
+ size: "sizeChange",
378
+ resizing: "resizing"
379
+ },
380
+ host: {
381
+ properties: {
382
+ "class": "classes()",
383
+ "style.width.px": "axis() === \"inline\" ? shown() : null",
384
+ "style.height.px": "axis() === \"block\" ? shown() : null"
385
+ },
386
+ classAttribute: "wr-resizable"
387
+ },
388
+ exportAs: ["wrResizable"],
389
+ ngImport: i0
390
+ });
391
+ };
392
+ i0.ɵɵngDeclareClassMetadata({
393
+ minVersion: "12.0.0",
394
+ version: "22.2.5",
395
+ ngImport: i0,
396
+ type: WrResizable,
397
+ decorators: [{
398
+ type: Directive,
399
+ args: [{
400
+ selector: "[wrResizable]",
401
+ exportAs: "wrResizable",
402
+ host: {
403
+ class: "wr-resizable",
404
+ "[class]": "classes()",
405
+ "[style.width.px]": "axis() === \"inline\" ? shown() : null",
406
+ "[style.height.px]": "axis() === \"block\" ? shown() : null"
407
+ }
408
+ }]
409
+ }],
410
+ ctorParameters: () => [],
411
+ propDecorators: {
412
+ edge: [{
413
+ type: i0.Input,
414
+ args: [{
415
+ isSignal: true,
416
+ alias: "edge",
417
+ required: false
418
+ }]
419
+ }],
420
+ size: [{
421
+ type: i0.Input,
422
+ args: [{
423
+ isSignal: true,
424
+ alias: "size",
425
+ required: false
426
+ }]
427
+ }, {
428
+ type: i0.Output,
429
+ args: ["sizeChange"]
430
+ }],
431
+ minSize: [{
432
+ type: i0.Input,
433
+ args: [{
434
+ isSignal: true,
435
+ alias: "minSize",
436
+ required: false
437
+ }]
438
+ }],
439
+ maxSize: [{
440
+ type: i0.Input,
441
+ args: [{
442
+ isSignal: true,
443
+ alias: "maxSize",
444
+ required: false
445
+ }]
446
+ }],
447
+ defaultSize: [{
448
+ type: i0.Input,
449
+ args: [{
450
+ isSignal: true,
451
+ alias: "defaultSize",
452
+ required: false
453
+ }]
454
+ }],
455
+ step: [{
456
+ type: i0.Input,
457
+ args: [{
458
+ isSignal: true,
459
+ alias: "step",
460
+ required: false
461
+ }]
462
+ }],
463
+ persistKey: [{
464
+ type: i0.Input,
465
+ args: [{
466
+ isSignal: true,
467
+ alias: "persistKey",
468
+ required: false
469
+ }]
470
+ }],
471
+ collapsed: [{
472
+ type: i0.Input,
473
+ args: [{
474
+ isSignal: true,
475
+ alias: "collapsed",
476
+ required: false
477
+ }]
478
+ }],
479
+ disabled: [{
480
+ type: i0.Input,
481
+ args: [{
482
+ isSignal: true,
483
+ alias: "disabled",
484
+ required: false
485
+ }]
486
+ }],
487
+ resizeLabel: [{
488
+ type: i0.Input,
489
+ args: [{
490
+ isSignal: true,
491
+ alias: "resizeLabel",
492
+ required: false
493
+ }]
494
+ }],
495
+ resizing: [{
496
+ type: i0.Output,
497
+ args: ["resizing"]
498
+ }]
499
+ }
500
+ });
501
+ export { WrResizable };
502
+
503
+ //# sourceMappingURL=ngwr-resizable.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngwr-resizable.mjs","names":[],"sources":["../../../projects/lib/resizable/resizable.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n DOCUMENT,\n DestroyRef,\n Directive,\n ElementRef,\n Renderer2,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n} from '@angular/core';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { WrStorage } from 'ngwr/storage';\nimport { wrCheckStyles, wrClamp } from 'ngwr/utils';\n\nimport { wrBeginSeparatorDrag, wrEndSeparatorDrag, wrSeparatorKeyMove } from '../splitter/internal';\n\nimport type { WrResizableEdge, WrResizableLimit } from './types';\n\nconst PERCENT = /^(-?\\d+(?:\\.\\d+)?)%$/;\n\n/** A bound limit as pixels, a percentage, or `null` for none. Anything unreadable is no limit. */\nfunction toLimit(value: unknown): WrResizableLimit | null {\n if (typeof value === 'number') return Number.isFinite(value) ? value : null;\n if (typeof value !== 'string') return null;\n const text = value.trim();\n if (PERCENT.test(text)) return text as WrResizableLimit;\n const px = Number.parseFloat(text);\n return Number.isFinite(px) ? px : null;\n}\n\n/** A bound size in pixels, or `null` for unset. */\nfunction toSize(value: unknown): number | null {\n if (value === null || value === undefined || value === '') return null;\n const px = Number(value);\n return Number.isFinite(px) ? px : null;\n}\n\n/** Namespaced key under `WrStorage`, which adds the app's own prefix. */\nfunction storageKey(key: string): string {\n return `wr:resizable:${key}`;\n}\n\n/** The drag in progress: what it started from, and how to give the page back. */\ninterface Drag {\n /** The pointer's coordinate on the drag's axis at the press. */\n readonly origin: number;\n /** The element's size at the press. */\n readonly start: number;\n /** `1` when moving toward higher coordinates grows the element, `-1` when it shrinks it. */\n readonly sign: 1 | -1;\n /** Puts back the root's `user-select` and `cursor`. */\n readonly release: () => void;\n}\n\n/**\n * Lets one element be resized by dragging one of its edges. It writes the\n * element's own `width` (`start` / `end`) or `height` (`top` / `bottom`) in\n * pixels and touches nothing else, so the element can lie over other content.\n * To share space between two panes, use `wr-splitter`.\n *\n * The handle is an element the directive adds inside the host, over the edge.\n * It needs a positioning context: a host whose computed `position` is `static`\n * is given `position: relative`.\n *\n * @example\n * ```html\n * <aside wrResizable [(size)]=\"width\" minSize=\"240\" maxSize=\"60%\" persistKey=\"side-panel\">…</aside>\n *\n * <footer wrResizable edge=\"top\" [collapsed]=\"!open()\">…</footer>\n * ```\n *\n * @see https://ngwr.dev/reference/components/resizable\n */\n@Directive({\n selector: '[wrResizable]',\n exportAs: 'wrResizable',\n host: {\n class: 'wr-resizable',\n '[class]': 'classes()',\n '[style.width.px]': 'axis() === \"inline\" ? shown() : null',\n '[style.height.px]': 'axis() === \"block\" ? shown() : null',\n },\n})\nexport class WrResizable {\n /**\n * The edge that drags. `start` and `end` resize the width and mirror under\n * RTL; `top` and `bottom` resize the height.\n * @default 'end'\n */\n readonly edge = input<WrResizableEdge>('end');\n\n /**\n * The size in pixels. Two-way bindable. `null` means not set yet: the\n * element keeps the size its CSS gives it until the first resize.\n * `sizeChange` fires when a drag is released, on each key and on a reset,\n * never during a drag: bind `resizing` for that.\n * @default null\n */\n readonly size = model<number | null>(null);\n\n /**\n * Smallest size: pixels, or a percentage of the parent's matching dimension\n * (`'20%'`). `null` for none.\n * @default 0\n */\n readonly minSize = input<WrResizableLimit | null, unknown>(0, { transform: toLimit });\n\n /**\n * Largest size: pixels, or a percentage of the parent's matching dimension.\n * `null` for none.\n * @default '100%'\n */\n readonly maxSize = input<WrResizableLimit | null, unknown>('100%', { transform: toLimit });\n\n /**\n * The size Enter and a double click on the handle go back to. `null` goes\n * back to what the element started with: the `size` bound at creation, or its\n * CSS size when there was none.\n * @default null\n */\n readonly defaultSize = input<number | null, unknown>(null, { transform: toSize });\n\n /** Pixels an arrow key moves the edge. Shift moves it ten times as far. @default 10 */\n readonly step = input(10, { transform: (v: unknown): number => coerceNumberProperty(v, 10) });\n\n /**\n * Saves the size under this key through `WrStorage` (which adds the app's\n * prefix) when a resize ends, and restores it on creation.\n * @default null\n */\n readonly persistKey = input<string | null>(null);\n\n /**\n * Shrinks the element to zero and hides the handle. `size` is left alone, so\n * the element is back at its size when this turns off.\n * @default false\n */\n readonly collapsed = input(false, { transform: coerceBooleanProperty });\n\n /** Keeps the size and stops the handle. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Accessible name of the handle. A focusable `role=\"separator\"` is an\n * interactive widget, so it needs one. Falls back to `resizable.handle`.\n * @default null\n */\n readonly resizeLabel = input<string | null>(null);\n\n /** The size in pixels on every move of a drag, before `sizeChange` settles it on release. */\n readonly resizing = output<number>();\n\n private readonly resolvedLabel = useI18nText(this.resizeLabel, 'resizable.handle', 'Resize');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly renderer = inject(Renderer2);\n private readonly doc = inject(DOCUMENT);\n private readonly destroyRef = inject(DestroyRef);\n private readonly storage = inject(WrStorage);\n // Optional on purpose: `Directionality` is root-provided, so a consumer never has to\n // supply it, and a bare `TestBed` does not either.\n private readonly dir = inject(Directionality, { optional: true });\n\n /** The handle, once the browser has rendered the host. Never on the server. */\n private readonly handle = signal<HTMLElement | null>(null);\n /** The size a drag in progress has reached. The model takes it on release. */\n private readonly draft = signal<number | null>(null);\n /** The parent's inner size on the resize axis, which percentages are of. */\n private readonly parentExtent = signal<number | null>(null);\n /** The host's rendered size, for `aria-valuenow` while `size` is `null`. */\n private readonly measured = signal<number | null>(null);\n\n private drag: Drag | null = null;\n /** What a reset goes back to without `defaultSize`: the model as it was created. */\n private origin: number | null = null;\n private originRead = false;\n\n protected readonly axis = computed<'inline' | 'block'>(() =>\n this.edge() === 'start' || this.edge() === 'end' ? 'inline' : 'block'\n );\n\n private readonly min = computed(() => this.resolve(this.minSize()) ?? 0);\n private readonly max = computed(() => this.resolve(this.maxSize()) ?? Number.POSITIVE_INFINITY);\n\n /**\n * The size in force, clamped at the point of use and not in the model: a\n * percentage limit moves with the parent, and a window narrowed for a moment\n * must not cost the user the width they chose.\n */\n private readonly current = computed(() => {\n const size = this.draft() ?? this.size();\n return size === null ? null : this.clamp(size);\n });\n\n /** What the host's inline style carries: nothing until a size is set. */\n protected readonly shown = computed(() => (this.collapsed() ? 0 : this.current()));\n\n private readonly inactive = computed(() => this.disabled() || this.collapsed());\n\n protected readonly classes = computed(() => {\n const parts = [`wr-resizable--${this.edge()}`];\n if (this.collapsed()) parts.push('wr-resizable--collapsed');\n if (this.disabled()) parts.push('wr-resizable--disabled');\n if (this.draft() !== null) parts.push('wr-resizable--resizing');\n return parts.join(' ');\n });\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('resizable');\n\n // Restore before the first paint of the size. The model as it was created is\n // read first: that, not the restored size, is what a reset goes back to.\n effect(() => {\n const key = this.persistKey();\n untracked(() => {\n if (!this.originRead) {\n this.originRead = true;\n this.origin = this.size();\n }\n if (!key) return;\n const saved = this.storage.get<unknown>(storageKey(key));\n if (typeof saved === 'number' && Number.isFinite(saved) && saved >= 0) this.size.set(saved);\n });\n });\n\n effect(() => this.syncHandle());\n\n // The other axis has another parent dimension and another rendered size.\n effect(() => {\n this.axis();\n if (this.handle()) untracked(() => this.remeasure());\n });\n\n afterNextRender(() => this.mount());\n\n this.destroyRef.onDestroy(() => {\n this.drag?.release();\n this.drag = null;\n });\n }\n\n // Handle\n\n /** Browser only: the handle, its listeners and the two size observers. */\n private mount(): void {\n const { host, renderer } = this;\n const view = this.doc.defaultView;\n // The handle is positioned against the host, so a static host would send it\n // to whichever ancestor is positioned. Any other position is left as it is.\n if (view?.getComputedStyle(host).position === 'static') renderer.setStyle(host, 'position', 'relative');\n\n const handle = renderer.createElement('div') as HTMLElement;\n renderer.addClass(handle, 'wr-resizable__handle');\n renderer.setAttribute(handle, 'role', 'separator');\n const grip = renderer.createElement('span') as HTMLElement;\n renderer.addClass(grip, 'wr-resizable__grip');\n renderer.setAttribute(grip, 'aria-hidden', 'true');\n renderer.appendChild(handle, grip);\n renderer.appendChild(host, handle);\n\n const stop = [\n renderer.listen(handle, 'pointerdown', (e: PointerEvent) => this.onPointerDown(e)),\n renderer.listen(handle, 'pointermove', (e: PointerEvent) => this.onPointerMove(e)),\n renderer.listen(handle, 'pointerup', (e: PointerEvent) => this.onPointerUp(e)),\n renderer.listen(handle, 'pointercancel', (e: PointerEvent) => this.onPointerUp(e)),\n // The capture can go without a `pointerup`: the handle leaves the DOM, the\n // browser takes the gesture, the window loses the pointer. The page must\n // not stay unselectable under a `col-resize` cursor.\n renderer.listen(handle, 'lostpointercapture', () => this.endDrag()),\n renderer.listen(handle, 'keydown', (e: KeyboardEvent) => this.onKeydown(e)),\n renderer.listen(handle, 'dblclick', () => this.onReset()),\n ];\n\n const parent = host.parentElement;\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(() => this.remeasure());\n observer?.observe(host);\n if (parent) observer?.observe(parent);\n this.remeasure();\n\n this.handle.set(handle);\n this.destroyRef.onDestroy(() => {\n observer?.disconnect();\n for (const off of stop) off();\n renderer.removeChild(host, handle);\n });\n }\n\n /** Everything the handle says about itself, rewritten when a signal behind it moves. */\n private syncHandle(): void {\n const handle = this.handle();\n if (!handle) return;\n const inactive = this.inactive();\n const now = this.collapsed() ? 0 : (this.current() ?? this.measured());\n const max = this.max();\n this.attr(handle, 'aria-label', this.resolvedLabel());\n // The separator stands across the axis it moves along.\n this.attr(handle, 'aria-orientation', this.axis() === 'inline' ? 'vertical' : 'horizontal');\n this.attr(handle, 'aria-valuenow', now === null ? null : `${Math.round(now)}`);\n this.attr(handle, 'aria-valuemin', `${Math.round(this.min())}`);\n this.attr(handle, 'aria-valuemax', Number.isFinite(max) ? `${Math.round(max)}` : null);\n this.attr(handle, 'aria-disabled', inactive ? 'true' : null);\n this.attr(handle, 'tabindex', inactive ? '-1' : '0');\n }\n\n private attr(el: HTMLElement, name: string, value: string | null): void {\n if (value === null) this.renderer.removeAttribute(el, name);\n else this.renderer.setAttribute(el, name, value);\n }\n\n // Drag\n\n private onPointerDown(event: PointerEvent): void {\n if (this.inactive() || this.drag) return;\n if (!wrBeginSeparatorDrag(event)) return;\n this.measureParent();\n const inline = this.axis() === 'inline';\n this.drag = {\n origin: inline ? event.clientX : event.clientY,\n start: this.current() ?? this.measure(),\n sign: this.growSign(),\n release: this.lockPage(inline ? 'col-resize' : 'row-resize'),\n };\n }\n\n private onPointerMove(event: PointerEvent): void {\n const drag = this.drag;\n if (!drag) return;\n const travel = (this.axis() === 'inline' ? event.clientX : event.clientY) - drag.origin;\n // Whole pixels: the size reaches `aria-valuenow`, the model and storage.\n const next = Math.round(this.clamp(drag.start + drag.sign * travel));\n if (next === this.draft()) return;\n this.draft.set(next);\n this.resizing.emit(next);\n }\n\n private onPointerUp(event: PointerEvent): void {\n if (!this.drag) return;\n wrEndSeparatorDrag(event);\n this.endDrag();\n }\n\n /** Idempotent: releasing the capture fires `lostpointercapture`, which lands here again. */\n private endDrag(): void {\n const drag = this.drag;\n if (!drag) return;\n this.drag = null;\n drag.release();\n const size = this.draft();\n this.draft.set(null);\n // A press that never moved leaves the model alone, so a click on the handle\n // does not freeze a CSS size into pixels.\n if (size !== null) this.commit(size);\n }\n\n /**\n * No text selection and one cursor for the whole page while the drag runs,\n * on the root element so the rest of the time selection inside the element\n * works as usual. Returns the undo, which puts back what was inline before.\n */\n private lockPage(cursor: string): () => void {\n const style = this.doc.documentElement.style;\n const before = ['user-select', '-webkit-user-select', 'cursor'].map(\n name => [name, style.getPropertyValue(name), style.getPropertyPriority(name)] as const\n );\n style.setProperty('user-select', 'none');\n style.setProperty('-webkit-user-select', 'none');\n style.setProperty('cursor', cursor);\n return () => {\n for (const [name, value, priority] of before) {\n if (value) style.setProperty(name, value, priority);\n else style.removeProperty(name);\n }\n };\n }\n\n // Keyboard\n\n private onKeydown(event: KeyboardEvent): void {\n if (this.inactive()) return;\n if (event.key === 'Enter') {\n event.preventDefault();\n this.onReset();\n return;\n }\n const move = wrSeparatorKeyMove(event, this.axis(), this.isRtl());\n if (move === null) return;\n event.preventDefault();\n this.measureParent();\n let next: number;\n if (move === 'min') next = this.min();\n else if (move === 'max') next = this.max();\n else {\n // `move` is a step along the axis, toward higher coordinates when positive;\n // the `start` and `top` edges grow the element the other way.\n const grow = this.edge() === 'end' || this.edge() === 'bottom' ? move : -move;\n next = (this.current() ?? this.measure()) + grow * this.step() * (event.shiftKey ? 10 : 1);\n }\n // End with no maximum has nowhere to go.\n if (Number.isFinite(next)) this.commit(Math.round(this.clamp(next)));\n }\n\n private onReset(): void {\n if (this.inactive()) return;\n this.measureParent();\n const target = this.defaultSize() ?? this.origin;\n this.commit(target === null ? null : Math.round(this.clamp(target)));\n }\n\n // State\n\n /** A size the user settled on: into the model, and into storage when there is a key. */\n private commit(size: number | null): void {\n this.size.set(size);\n const key = this.persistKey();\n if (!key) return;\n if (size === null) this.storage.remove(storageKey(key));\n else this.storage.set(storageKey(key), size);\n }\n\n private clamp(size: number): number {\n return wrClamp(size, this.min(), this.max());\n }\n\n private resolve(limit: WrResizableLimit | null): number | null {\n if (limit === null || typeof limit === 'number') return limit;\n const extent = this.parentExtent();\n // A parent that cannot be measured (not rendered yet, `display: contents`)\n // limits nothing, rather than clamping the element to zero.\n return extent ? (extent * Number.parseFloat(limit)) / 100 : null;\n }\n\n /**\n * `1` when dragging toward higher coordinates grows the element. Read per\n * gesture rather than cached, like the splitter: nothing rendered depends on\n * the direction, since the handle sits on a logical edge.\n */\n private growSign(): 1 | -1 {\n switch (this.edge()) {\n case 'end':\n return this.isRtl() ? -1 : 1;\n case 'start':\n return this.isRtl() ? 1 : -1;\n case 'top':\n return -1;\n case 'bottom':\n return 1;\n }\n }\n\n private isRtl(): boolean {\n return this.dir?.value === 'rtl';\n }\n\n /**\n * The host's size as its `width` / `height` property means it, so writing the\n * number back changes nothing whatever the `box-sizing`. The computed value\n * is that; the rect is the fallback where there is no computed size.\n */\n private measure(): number {\n const inline = this.axis() === 'inline';\n const style = this.doc.defaultView?.getComputedStyle(this.host);\n const computedSize = Number.parseFloat((inline ? style?.width : style?.height) ?? '');\n if (Number.isFinite(computedSize)) return computedSize;\n const rect = this.host.getBoundingClientRect();\n return inline ? rect.width : rect.height;\n }\n\n private remeasure(): void {\n this.measureParent();\n this.measured.set(this.measure());\n }\n\n private measureParent(): void {\n const parent = this.host.parentElement;\n if (!parent) return;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] : /* istanbul ignore next */ []);
16
16
  description = input("", ...ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []);
17
17
  status = input("info", ...ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []);
18
- classes = computed(() => `wr-result wr-result--${this.status()}`, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
18
+ classes = computed(() => `wr-result--${this.status()}`, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
19
19
  static ɵfac = i0.ɵɵngDeclareFactory({
20
20
  minVersion: "12.0.0",
21
21
  version: "22.2.5",
@@ -53,10 +53,13 @@ var WrResult = class WrResult {
53
53
  transformFunction: null
54
54
  }
55
55
  },
56
- host: { properties: {
57
- "class": "classes()",
58
- "attr.title": "null"
59
- } },
56
+ host: {
57
+ properties: {
58
+ "class": "classes()",
59
+ "attr.title": "null"
60
+ },
61
+ classAttribute: "wr-result"
62
+ },
60
63
  ngImport: i0,
61
64
  template: "<div class=\"wr-result__icon\" aria-hidden=\"true\">\n @switch (status()) {\n @case ('success') {\n <svg width=\"64\" height=\"64\" viewBox=\"0 0 64 64\">\n <circle cx=\"32\" cy=\"32\" r=\"28\" fill=\"currentColor\" opacity=\"0.12\" />\n <path\n d=\"M20 32 L28 40 L44 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n }\n <!-- A TRIANGLE, and the shape is the point twice over. Warning used to sit\n in the same circle as info holding a near-identical exclamation mark —\n the two paths differed by 2 user units, which is under 2px at the\n rendered size — and `warning` against `info` is a hue difference the\n palette cannot widen. It also brings this component into line with\n `wr-alert`, which has drawn warning as a triangle all along; the two\n disagreeing about what a warning looks like was its own small defect. -->\n @case ('warning') {\n <svg width=\"64\" height=\"64\" viewBox=\"0 0 64 64\">\n <path d=\"M32 8 L60 54 L4 54 Z\" fill=\"currentColor\" opacity=\"0.12\" />\n <path\n d=\"M32 26 L32 40 M32 47 L32 49\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3.5\"\n stroke-linecap=\"round\"\n />\n </svg>\n }\n @case ('error') {\n <svg width=\"64\" height=\"64\" viewBox=\"0 0 64 64\">\n <circle cx=\"32\" cy=\"32\" r=\"28\" fill=\"currentColor\" opacity=\"0.12\" />\n <path\n d=\"M22 22 L42 42 M42 22 L22 42\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3\"\n stroke-linecap=\"round\"\n />\n </svg>\n }\n @case ('empty') {\n <svg width=\"72\" height=\"56\" viewBox=\"0 0 72 56\">\n <rect x=\"6\" y=\"14\" width=\"60\" height=\"36\" rx=\"4\" fill=\"currentColor\" opacity=\"0.12\" />\n <path d=\"M6 26 L36 26 L40 20 L66 20\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" />\n </svg>\n }\n @default {\n <svg width=\"64\" height=\"64\" viewBox=\"0 0 64 64\">\n <circle cx=\"32\" cy=\"32\" r=\"28\" fill=\"currentColor\" opacity=\"0.12\" />\n <path\n d=\"M32 18 L32 20 M32 28 L32 46\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"3.5\"\n stroke-linecap=\"round\"\n />\n </svg>\n }\n }\n</div>\n\n@if (title()) {\n <h2 class=\"wr-result__title\">{{ title() }}</h2>\n}\n@if (description()) {\n <p class=\"wr-result__description\">{{ description() }}</p>\n}\n\n<div class=\"wr-result__extra\">\n <ng-content select=\"[wrResultExtra]\" />\n</div>\n",
62
65
  encapsulation: i0.ViewEncapsulation.None
@@ -73,6 +76,7 @@ i0.ɵɵngDeclareClassMetadata({
73
76
  selector: "wr-result",
74
77
  encapsulation: ViewEncapsulation.None,
75
78
  host: {
79
+ class: "wr-result",
76
80
  "[class]": "classes()",
77
81
  "[attr.title]": "null"
78
82
  },