ngwr 9.1.0 → 10.1.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 (276) hide show
  1. package/README.md +23 -8
  2. package/action-sheet/styles/_index.scss +6 -1
  3. package/badge/styles/_index.scss +17 -7
  4. package/badge/styles/_tag.scss +12 -3
  5. package/border-glow/styles/_index.scss +5 -0
  6. package/button/styles/_index.scss +48 -1
  7. package/calendar/styles/_index.scss +9 -1
  8. package/circular-text/styles/_index.scss +6 -1
  9. package/density/styles/_index.scss +3 -1
  10. package/dialog/styles/_index.scss +66 -2
  11. package/drag-drop/styles/_index.scss +20 -7
  12. package/drawer/styles/_index.scss +61 -1
  13. package/event-calendar/styles/_index.scss +284 -0
  14. package/falling-text/styles/_index.scss +5 -0
  15. package/fesm2022/ngwr-action-sheet.mjs +1 -1
  16. package/fesm2022/ngwr-action-sheet.mjs.map +1 -1
  17. package/fesm2022/ngwr-alert.mjs +8 -3
  18. package/fesm2022/ngwr-alert.mjs.map +1 -1
  19. package/fesm2022/ngwr-back-top.mjs +6 -4
  20. package/fesm2022/ngwr-back-top.mjs.map +1 -1
  21. package/fesm2022/ngwr-border-glow.mjs +12 -9
  22. package/fesm2022/ngwr-border-glow.mjs.map +1 -1
  23. package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
  24. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  25. package/fesm2022/ngwr-calendar.mjs +5 -3
  26. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  27. package/fesm2022/ngwr-card.mjs +2 -2
  28. package/fesm2022/ngwr-card.mjs.map +1 -1
  29. package/fesm2022/ngwr-carousel.mjs +17 -4
  30. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  31. package/fesm2022/ngwr-cascader.mjs +35 -7
  32. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  33. package/fesm2022/ngwr-checkbox.mjs +12 -3
  34. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  35. package/fesm2022/ngwr-circular-text.mjs +2 -2
  36. package/fesm2022/ngwr-circular-text.mjs.map +1 -1
  37. package/fesm2022/ngwr-color-picker.mjs +6 -5
  38. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  39. package/fesm2022/ngwr-command-palette.mjs +7 -3
  40. package/fesm2022/ngwr-command-palette.mjs.map +1 -1
  41. package/fesm2022/ngwr-context-menu.mjs +7 -7
  42. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  43. package/fesm2022/ngwr-counter.mjs +9 -1
  44. package/fesm2022/ngwr-counter.mjs.map +1 -1
  45. package/fesm2022/ngwr-date-picker.mjs +37 -15
  46. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  47. package/fesm2022/ngwr-density.mjs +10 -2
  48. package/fesm2022/ngwr-density.mjs.map +1 -1
  49. package/fesm2022/ngwr-descriptions.mjs +5 -4
  50. package/fesm2022/ngwr-descriptions.mjs.map +1 -1
  51. package/fesm2022/ngwr-dialog.mjs +10 -1
  52. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  53. package/fesm2022/ngwr-drag-drop.mjs +2 -2
  54. package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
  55. package/fesm2022/ngwr-drawer.mjs +37 -16
  56. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  57. package/fesm2022/ngwr-dropdown.mjs +8 -3
  58. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  59. package/fesm2022/ngwr-event-calendar.mjs +723 -0
  60. package/fesm2022/ngwr-event-calendar.mjs.map +1 -0
  61. package/fesm2022/ngwr-falling-text.mjs +2 -2
  62. package/fesm2022/ngwr-falling-text.mjs.map +1 -1
  63. package/fesm2022/ngwr-file-upload.mjs +2 -2
  64. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  65. package/fesm2022/ngwr-form.mjs +258 -42
  66. package/fesm2022/ngwr-form.mjs.map +1 -1
  67. package/fesm2022/ngwr-fuzzy-text.mjs +15 -1
  68. package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
  69. package/fesm2022/ngwr-gauge.mjs +8 -3
  70. package/fesm2022/ngwr-gauge.mjs.map +1 -1
  71. package/fesm2022/ngwr-glitch-text.mjs +2 -2
  72. package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
  73. package/fesm2022/ngwr-gradient-text.mjs +2 -2
  74. package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
  75. package/fesm2022/ngwr-i18n-en.mjs +89 -5
  76. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  77. package/fesm2022/ngwr-i18n-ru.mjs +90 -5
  78. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  79. package/fesm2022/ngwr-i18n.mjs +94 -3
  80. package/fesm2022/ngwr-i18n.mjs.map +1 -1
  81. package/fesm2022/ngwr-icon.mjs +79 -35
  82. package/fesm2022/ngwr-icon.mjs.map +1 -1
  83. package/fesm2022/ngwr-input-number.mjs +19 -3
  84. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  85. package/fesm2022/ngwr-input.mjs +48 -6
  86. package/fesm2022/ngwr-input.mjs.map +1 -1
  87. package/fesm2022/ngwr-knob.mjs +8 -3
  88. package/fesm2022/ngwr-knob.mjs.map +1 -1
  89. package/fesm2022/ngwr-lightbox.mjs +32 -3
  90. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  91. package/fesm2022/ngwr-line-chart.mjs +3 -3
  92. package/fesm2022/ngwr-line-chart.mjs.map +1 -1
  93. package/fesm2022/ngwr-list.mjs +2 -2
  94. package/fesm2022/ngwr-list.mjs.map +1 -1
  95. package/fesm2022/ngwr-loading-bar.mjs +2 -2
  96. package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
  97. package/fesm2022/ngwr-marquee.mjs +2 -2
  98. package/fesm2022/ngwr-marquee.mjs.map +1 -1
  99. package/fesm2022/ngwr-media.mjs +3 -0
  100. package/fesm2022/ngwr-media.mjs.map +1 -1
  101. package/fesm2022/ngwr-mention.mjs +166 -10
  102. package/fesm2022/ngwr-mention.mjs.map +1 -1
  103. package/fesm2022/ngwr-meter-group.mjs +14 -3
  104. package/fesm2022/ngwr-meter-group.mjs.map +1 -1
  105. package/fesm2022/ngwr-overlay.mjs +173 -3
  106. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  107. package/fesm2022/ngwr-page-header.mjs +2 -2
  108. package/fesm2022/ngwr-page-header.mjs.map +1 -1
  109. package/fesm2022/ngwr-pagination.mjs +17 -4
  110. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  111. package/fesm2022/ngwr-popconfirm.mjs +4 -3
  112. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  113. package/fesm2022/ngwr-popover.mjs +10 -3
  114. package/fesm2022/ngwr-popover.mjs.map +1 -1
  115. package/fesm2022/ngwr-progress.mjs +8 -2
  116. package/fesm2022/ngwr-progress.mjs.map +1 -1
  117. package/fesm2022/ngwr-qr.mjs.map +1 -1
  118. package/fesm2022/ngwr-rating.mjs +6 -4
  119. package/fesm2022/ngwr-rating.mjs.map +1 -1
  120. package/fesm2022/ngwr-result.mjs +19 -12
  121. package/fesm2022/ngwr-result.mjs.map +1 -1
  122. package/fesm2022/ngwr-segmented.mjs +2 -2
  123. package/fesm2022/ngwr-segmented.mjs.map +1 -1
  124. package/fesm2022/ngwr-select.mjs +40 -13
  125. package/fesm2022/ngwr-select.mjs.map +1 -1
  126. package/fesm2022/ngwr-shiny-text.mjs +4 -6
  127. package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
  128. package/fesm2022/ngwr-speed-dial.mjs +11 -3
  129. package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
  130. package/fesm2022/ngwr-spotlight-card.mjs +2 -2
  131. package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
  132. package/fesm2022/ngwr-squircle.mjs +1 -1
  133. package/fesm2022/ngwr-squircle.mjs.map +1 -1
  134. package/fesm2022/ngwr-star-border.mjs +2 -2
  135. package/fesm2022/ngwr-star-border.mjs.map +1 -1
  136. package/fesm2022/ngwr-switch.mjs +10 -3
  137. package/fesm2022/ngwr-switch.mjs.map +1 -1
  138. package/fesm2022/ngwr-table.mjs +233 -19
  139. package/fesm2022/ngwr-table.mjs.map +1 -1
  140. package/fesm2022/ngwr-tabs.mjs +21 -4
  141. package/fesm2022/ngwr-tabs.mjs.map +1 -1
  142. package/fesm2022/ngwr-textarea.mjs +20 -4
  143. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  144. package/fesm2022/ngwr-theme.mjs +13 -3
  145. package/fesm2022/ngwr-theme.mjs.map +1 -1
  146. package/fesm2022/ngwr-tilt-card.mjs +2 -2
  147. package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
  148. package/fesm2022/ngwr-toolbar.mjs +2 -2
  149. package/fesm2022/ngwr-toolbar.mjs.map +1 -1
  150. package/fesm2022/ngwr-tour.mjs +264 -0
  151. package/fesm2022/ngwr-tour.mjs.map +1 -0
  152. package/fesm2022/ngwr-transfer.mjs +184 -0
  153. package/fesm2022/ngwr-transfer.mjs.map +1 -0
  154. package/fesm2022/ngwr-tree.mjs +27 -9
  155. package/fesm2022/ngwr-tree.mjs.map +1 -1
  156. package/fesm2022/ngwr-typewriter.mjs +2 -2
  157. package/fesm2022/ngwr-typewriter.mjs.map +1 -1
  158. package/fesm2022/ngwr-validators.mjs +118 -2
  159. package/fesm2022/ngwr-validators.mjs.map +1 -1
  160. package/fesm2022/ngwr-version.mjs +2 -2
  161. package/fesm2022/ngwr-version.mjs.map +1 -1
  162. package/fesm2022/ngwr-virtual-scroll.mjs +2 -2
  163. package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
  164. package/fesm2022/ngwr-waves.mjs +25 -3
  165. package/fesm2022/ngwr-waves.mjs.map +1 -1
  166. package/form/styles/_index.scss +8 -4
  167. package/glitch-text/styles/_index.scss +5 -0
  168. package/gradient-text/styles/_index.scss +5 -0
  169. package/i18n/en.json +233 -0
  170. package/i18n/ru.json +233 -0
  171. package/icon/styles/_index.scss +15 -1
  172. package/input/styles/_index.scss +16 -0
  173. package/input-number/styles/_index.scss +8 -1
  174. package/keyboard/styles/_index.scss +15 -3
  175. package/llms-full.txt +124 -63
  176. package/llms.txt +29 -8
  177. package/loading-bar/styles/_index.scss +5 -0
  178. package/marquee/styles/_index.scss +7 -2
  179. package/mention/styles/_index.scss +23 -0
  180. package/overlay/styles/_index.scss +5 -0
  181. package/package.json +15 -1
  182. package/pagination/styles/_index.scss +12 -0
  183. package/popover/styles/_index.scss +165 -45
  184. package/pull-to-refresh/styles/_index.scss +5 -0
  185. package/result/styles/_index.scss +3 -3
  186. package/schematics/icon-set/index.js +80 -34
  187. package/schematics/icon-set/schema.json +8 -3
  188. package/schematics/ng-add/index.js +23 -6
  189. package/schematics/package.json +3 -0
  190. package/schematics/page/templates.js +17 -21
  191. package/schematics/provider/index.js +31 -13
  192. package/schematics/provider/schema.json +40 -24
  193. package/schematics/use/index.js +5 -1
  194. package/schematics/use/schema.json +8 -3
  195. package/schematics/use/symbol-map.json +7 -176
  196. package/segmented/styles/_index.scss +1 -1
  197. package/select/styles/_index.scss +20 -3
  198. package/shiny-text/styles/_index.scss +5 -0
  199. package/speed-dial/styles/_index.scss +12 -1
  200. package/splitter/styles/_index.scss +7 -1
  201. package/spotlight-card/styles/_index.scss +5 -0
  202. package/squircle/styles/_index.scss +5 -0
  203. package/star-border/styles/_index.scss +5 -0
  204. package/statistic/styles/_index.scss +2 -2
  205. package/styles/_animations.scss +6 -0
  206. package/styles.scss +3 -0
  207. package/table/styles/_index.scss +128 -12
  208. package/theme/styles/_box-model.scss +29 -0
  209. package/theme/styles/_colors.scss +116 -15
  210. package/theme/styles/_dark.scss +65 -7
  211. package/theme/styles/_focus.scss +2 -8
  212. package/theme/styles/_index.scss +1 -0
  213. package/tilt-card/styles/_index.scss +5 -0
  214. package/toast/styles/_index.scss +6 -3
  215. package/tour/styles/_index.scss +63 -0
  216. package/transfer/styles/_index.scss +105 -0
  217. package/types/ngwr-alert.d.ts +4 -1
  218. package/types/ngwr-avatar.d.ts +1 -1
  219. package/types/ngwr-back-top.d.ts +3 -2
  220. package/types/ngwr-badge.d.ts +1 -1
  221. package/types/ngwr-border-glow.d.ts +0 -1
  222. package/types/ngwr-carousel.d.ts +10 -1
  223. package/types/ngwr-cascader.d.ts +13 -1
  224. package/types/ngwr-checkbox.d.ts +9 -1
  225. package/types/ngwr-color-picker.d.ts +1 -0
  226. package/types/ngwr-command-palette.d.ts +4 -1
  227. package/types/ngwr-context-menu.d.ts +1 -0
  228. package/types/ngwr-date-picker.d.ts +14 -4
  229. package/types/ngwr-density.d.ts +9 -2
  230. package/types/ngwr-dialog.d.ts +9 -0
  231. package/types/ngwr-divider.d.ts +1 -1
  232. package/types/ngwr-drawer.d.ts +20 -4
  233. package/types/ngwr-dropdown.d.ts +1 -0
  234. package/types/ngwr-event-calendar.d.ts +358 -0
  235. package/types/ngwr-form.d.ts +177 -20
  236. package/types/ngwr-fuzzy-text.d.ts +8 -0
  237. package/types/ngwr-gauge.d.ts +4 -1
  238. package/types/ngwr-i18n.d.ts +80 -2
  239. package/types/ngwr-icon.d.ts +11 -19
  240. package/types/ngwr-input-number.d.ts +8 -1
  241. package/types/ngwr-input.d.ts +50 -20
  242. package/types/ngwr-knob.d.ts +4 -1
  243. package/types/ngwr-lightbox.d.ts +7 -1
  244. package/types/ngwr-line-chart.d.ts +1 -1
  245. package/types/ngwr-media.d.ts +1 -1
  246. package/types/ngwr-mention.d.ts +45 -1
  247. package/types/ngwr-meter-group.d.ts +9 -1
  248. package/types/ngwr-overlay.d.ts +80 -2
  249. package/types/ngwr-page-header.d.ts +2 -2
  250. package/types/ngwr-pagination.d.ts +15 -2
  251. package/types/ngwr-popconfirm.d.ts +1 -0
  252. package/types/ngwr-popover.d.ts +1 -0
  253. package/types/ngwr-progress.d.ts +4 -1
  254. package/types/ngwr-rating.d.ts +3 -2
  255. package/types/ngwr-result.d.ts +12 -6
  256. package/types/ngwr-segmented.d.ts +6 -0
  257. package/types/ngwr-select.d.ts +19 -7
  258. package/types/ngwr-shiny-text.d.ts +2 -4
  259. package/types/ngwr-speed-dial.d.ts +7 -1
  260. package/types/ngwr-squircle.d.ts +1 -1
  261. package/types/ngwr-switch.d.ts +7 -1
  262. package/types/ngwr-table.d.ts +126 -6
  263. package/types/ngwr-tabs.d.ts +1 -4
  264. package/types/ngwr-textarea.d.ts +8 -1
  265. package/types/ngwr-theme.d.ts +8 -1
  266. package/types/ngwr-toolbar.d.ts +2 -2
  267. package/types/ngwr-tour.d.ts +132 -0
  268. package/types/ngwr-transfer.d.ts +118 -0
  269. package/types/ngwr-tree.d.ts +11 -2
  270. package/types/ngwr-validators.d.ts +62 -2
  271. package/types/ngwr-version.d.ts +2 -2
  272. package/types/ngwr-waves.d.ts +10 -0
  273. package/typewriter/styles/_index.scss +5 -0
  274. package/typography/styles/_index.scss +3 -3
  275. package/virtual-scroll/styles/_index.scss +6 -1
  276. package/waves/styles/_index.scss +26 -0
@@ -8,12 +8,17 @@
8
8
  "type": "string",
9
9
  "default": "icons",
10
10
  "description": "Output file name (without extension).",
11
- "$default": { "$source": "argv", "index": 0 }
11
+ "$default": {
12
+ "$source": "argv",
13
+ "index": 0
14
+ }
12
15
  },
13
16
  "project": {
14
17
  "type": "string",
15
18
  "description": "Target Angular project. Defaults to the workspace default project.",
16
- "$default": { "$source": "projectName" }
19
+ "$default": {
20
+ "$source": "projectName"
21
+ }
17
22
  },
18
23
  "path": {
19
24
  "type": "string",
@@ -27,7 +32,7 @@
27
32
  },
28
33
  "icons": {
29
34
  "type": "string",
30
- "description": "Comma-separated list of ngwr icon names (e.g. `plus,trash,checkmark`). Unknown names are flagged but not blocked."
35
+ "description": "Comma-separated icon names from the curated sets (e.g. `add,trash,checkmark`). Names with no lucide mapping are reported and skipped."
31
36
  },
32
37
  "exportName": {
33
38
  "type": "string",
@@ -10,14 +10,26 @@ const schematics_1 = require("@angular-devkit/schematics");
10
10
  const tasks_1 = require("@angular-devkit/schematics/tasks");
11
11
  const dependencies_1 = require("@schematics/angular/utility/dependencies");
12
12
  const workspace_1 = require("@schematics/angular/utility/workspace");
13
- /** Base peers, regardless of prompt answers. */
14
- const BASE_PEERS = [['@angular/cdk', '>=22.0.0']];
13
+ /**
14
+ * Base peers, regardless of prompt answers.
15
+ *
16
+ * `lucide` is here because the bootstrap snippet this schematic prints registers
17
+ * icons through the lucide adapter — leaving it out made the very first snippet
18
+ * a consumer pastes fail to resolve.
19
+ */
20
+ const BASE_PEERS = [
21
+ ['@angular/cdk', '>=22.0.0'],
22
+ ['lucide', '>=1.0.0'],
23
+ ];
15
24
  /** Extra peers contributed by the `dateAdapter` choice. */
16
25
  const DATE_ADAPTER_PEERS = {
17
26
  none: [],
18
27
  native: [],
19
- 'date-fns': [['date-fns', '>=3.0.0 || >=4.0.0']],
20
- luxon: [['luxon', '>=3.0.0']],
28
+ // Keep these identical to `peerDependencies` in projects/lib/package.json.
29
+ // They had drifted to `>=` unions, which reduce to an uncapped `>=3.0.0` and
30
+ // would happily install a future major the library does not support.
31
+ 'date-fns': [['date-fns', '^3.0.0 || ^4.0.0']],
32
+ luxon: [['luxon', '^3.0.0']],
21
33
  };
22
34
  /** Adapter classes named in the next-steps snippet for each choice. */
23
35
  const DATE_ADAPTER_PROVIDER = {
@@ -121,11 +133,16 @@ function printNextSteps(options, context) {
121
133
  const adapter = options.dateAdapter ?? 'none';
122
134
  const density = options.density ?? 'none';
123
135
  const theme = options.theme ?? 'none';
136
+ // `ngwr/icon` exports only WrIcon / provideWrIcons / svgIcon — there are no
137
+ // bare icon exports, so the old `{ plus, trash }` import did not compile.
138
+ // Icons come from an adapter (lucide / feather) or from svgIcon().
124
139
  const imports = [
125
140
  "import { provideWrOverlay } from 'ngwr/overlay';",
126
- "import { provideWrIcons, plus, trash } from 'ngwr/icon';",
141
+ "import { provideWrIcons } from 'ngwr/icon';",
142
+ "import { lucideIcons } from 'ngwr/icon/adapters/lucide';",
143
+ "import { Plus, Trash2 } from 'lucide';",
127
144
  ];
128
- const providers = ['provideWrOverlay()', 'provideWrIcons([plus, trash])'];
145
+ const providers = ['provideWrOverlay()', 'provideWrIcons(lucideIcons({ plus: Plus, trash: Trash2 }))'];
129
146
  const adapterCall = DATE_ADAPTER_PROVIDER[adapter];
130
147
  if (adapterCall) {
131
148
  imports.push("import { provideWrDateAdapter } from 'ngwr/date-adapter';");
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -23,14 +23,14 @@ function renderForm(dashName, pascalName) {
23
23
  import { FormsModule } from '@angular/forms';
24
24
 
25
25
  import { WrButton } from 'ngwr/button';
26
- import { WrFormField, WrLabel, WrErrorMessage } from 'ngwr/form';
26
+ import { WrFormField } from 'ngwr/form';
27
27
  import { WrInput } from 'ngwr/input';
28
28
 
29
29
  @Component({
30
30
  selector: 'app-${dashName}',
31
31
  templateUrl: './${dashName}.html',
32
32
  styleUrl: './${dashName}.scss',
33
- imports: [FormsModule, WrButton, WrFormField, WrLabel, WrErrorMessage, WrInput],
33
+ imports: [FormsModule, WrButton, WrFormField, WrInput],
34
34
  })
35
35
  export default class ${pascalName} {
36
36
  protected readonly name = signal('');
@@ -53,13 +53,11 @@ export default class ${pascalName} {
53
53
  const html = `<form class="${dashName}" (ngSubmit)="onSubmit()">
54
54
  <h1>${titleCase(pascalName)}</h1>
55
55
 
56
- <wr-form-field>
57
- <wr-label>Name</wr-label>
56
+ <wr-form-field label="Name" required>
58
57
  <input wrInput [(ngModel)]="name" name="name" required />
59
58
  </wr-form-field>
60
59
 
61
- <wr-form-field>
62
- <wr-label>Email</wr-label>
60
+ <wr-form-field label="Email" required>
63
61
  <input wrInput type="email" [(ngModel)]="email" name="email" required />
64
62
  </wr-form-field>
65
63
 
@@ -83,6 +81,7 @@ function renderTable(dashName, pascalName) {
83
81
  const ts = `import { Component, signal } from '@angular/core';
84
82
 
85
83
  import { WrTable } from 'ngwr/table';
84
+ import type { WrTableColumns } from 'ngwr/table';
86
85
  import { WrPagination } from 'ngwr/pagination';
87
86
 
88
87
  interface Row {
@@ -98,7 +97,11 @@ interface Row {
98
97
  imports: [WrTable, WrPagination],
99
98
  })
100
99
  export default class ${pascalName} {
101
- protected readonly columns = ['id', 'name', 'status'] as const;
100
+ protected readonly columns: WrTableColumns = {
101
+ id: { title: 'ID' },
102
+ name: { title: 'Name', sortable: true },
103
+ status: { title: 'Status' },
104
+ };
102
105
 
103
106
  protected readonly rows = signal<readonly Row[]>([
104
107
  { id: 1, name: 'Alpha', status: 'active' },
@@ -114,11 +117,11 @@ export default class ${pascalName} {
114
117
  const html = `<section class="${dashName}">
115
118
  <h1>${titleCase(pascalName)}</h1>
116
119
 
117
- <wr-table [data]="rows()" [columns]="columns" />
120
+ <wr-table [columns]="columns" [items]="rows()" />
118
121
 
119
122
  <wr-pagination
120
- [(page)]="page"
121
- [pageSize]="pageSize()"
123
+ [(currentPage)]="page"
124
+ [(pageSize)]="pageSize"
122
125
  [total]="total()"
123
126
  />
124
127
  </section>
@@ -137,13 +140,12 @@ function renderDashboard(dashName, pascalName) {
137
140
 
138
141
  import { WrCard } from 'ngwr/card';
139
142
  import { WrStatistic } from 'ngwr/statistic';
140
- import { WrCountUp } from 'ngwr/counter';
141
143
 
142
144
  @Component({
143
145
  selector: 'app-${dashName}',
144
146
  templateUrl: './${dashName}.html',
145
147
  styleUrl: './${dashName}.scss',
146
- imports: [WrCard, WrStatistic, WrCountUp],
148
+ imports: [WrCard, WrStatistic],
147
149
  })
148
150
  export default class ${pascalName} {
149
151
  protected readonly users = signal(1284);
@@ -156,21 +158,15 @@ export default class ${pascalName} {
156
158
 
157
159
  <div class="${dashName}__grid">
158
160
  <wr-card>
159
- <wr-statistic title="Users">
160
- <wr-count-up [to]="users()" />
161
- </wr-statistic>
161
+ <wr-statistic label="Users" [value]="users()" />
162
162
  </wr-card>
163
163
 
164
164
  <wr-card>
165
- <wr-statistic title="Revenue" prefix="$">
166
- <wr-count-up [to]="revenue()" />
167
- </wr-statistic>
165
+ <wr-statistic label="Revenue" prefix="$" [value]="revenue()" />
168
166
  </wr-card>
169
167
 
170
168
  <wr-card>
171
- <wr-statistic title="Active">
172
- <wr-count-up [to]="active()" />
173
- </wr-statistic>
169
+ <wr-statistic label="Active" [value]="active()" />
174
170
  </wr-card>
175
171
  </div>
176
172
  </section>
@@ -8,15 +8,30 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  const schematics_1 = require("@angular-devkit/schematics");
10
10
  const workspace_1 = require("@schematics/angular/utility/workspace");
11
+ // Every entry here has to name a factory that `ngwr` actually exports, with a
12
+ // call that type-checks. `ngwr/loading-bar` and `ngwr/cookie` used to be listed
13
+ // too, but neither ships a provider — they expose the injectable services
14
+ // `WrLoadingBar` / `WrCookie` and need no bootstrap wiring at all, so offering
15
+ // to splice a provider for them only ever produced code that would not compile.
11
16
  const PROVIDERS = {
12
17
  overlay: { subpath: 'ngwr/overlay', factory: 'provideWrOverlay', call: 'provideWrOverlay()' },
13
18
  icons: {
19
+ // `ngwr/icon` exports only WrIcon / provideWrIcons / svgIcon — there are no
20
+ // bare icon exports. Icons come from an adapter, exactly as `ng add` wires them.
14
21
  subpath: 'ngwr/icon',
15
22
  factory: 'provideWrIcons',
16
- call: 'provideWrIcons([plus, trash])',
17
- extras: [['plus, trash', 'ngwr/icon']],
23
+ call: 'provideWrIcons(lucideIcons({ plus: Plus, trash: Trash2 }))',
24
+ extras: [
25
+ ['lucideIcons', 'ngwr/icon/adapters/lucide'],
26
+ ['Plus, Trash2', 'lucide'],
27
+ ],
28
+ },
29
+ // `provideWrToastConfig` takes a required config object, so the call cannot be bare.
30
+ toast: {
31
+ subpath: 'ngwr/toast',
32
+ factory: 'provideWrToastConfig',
33
+ call: 'provideWrToastConfig({})',
18
34
  },
19
- toast: { subpath: 'ngwr/toast', factory: 'provideWrToast', call: 'provideWrToast()' },
20
35
  i18n: { subpath: 'ngwr/i18n', factory: 'provideWrI18n', call: 'provideWrI18n()' },
21
36
  'date-adapter': {
22
37
  subpath: 'ngwr/date-adapter',
@@ -24,12 +39,6 @@ const PROVIDERS = {
24
39
  call: 'provideWrDateAdapter()',
25
40
  },
26
41
  density: { subpath: 'ngwr/density', factory: 'provideWrDensity', call: 'provideWrDensity()' },
27
- 'loading-bar': {
28
- subpath: 'ngwr/loading-bar',
29
- factory: 'provideWrLoadingBar',
30
- call: 'provideWrLoadingBar()',
31
- },
32
- cookie: { subpath: 'ngwr/cookie', factory: 'provideWrCookie', call: 'provideWrCookie()' },
33
42
  storage: { subpath: 'ngwr/storage', factory: 'provideWrStorage', call: 'provideWrStorage()' },
34
43
  theme: { subpath: 'ngwr/theme', factory: 'provideWrTheme', call: 'provideWrTheme()' },
35
44
  };
@@ -46,9 +55,11 @@ function provider(options) {
46
55
  const original = tree.readText(filePath);
47
56
  let next = original;
48
57
  next = ensureImport(next, spec.factory, spec.subpath);
49
- if (options.name === 'icons') {
50
- next = ensureImport(next, 'plus', 'ngwr/icon');
51
- next = ensureImport(next, 'trash', 'ngwr/icon');
58
+ // Drive the extra imports off `extras` rather than special-casing a provider
59
+ // name here: the two used to drift apart, and the hard-coded branch was
60
+ // emitting icon names that `ngwr/icon` has never exported.
61
+ for (const [symbols, subpath] of spec.extras ?? []) {
62
+ next = ensureImport(next, symbols, subpath);
52
63
  }
53
64
  next = ensureProviderCall(next, spec.call);
54
65
  if (next === original) {
@@ -113,10 +124,17 @@ function escapeRegExp(value) {
113
124
  return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
114
125
  }
115
126
  function printSnippet(spec) {
127
+ // This runs when no bootstrap file could be resolved, so the snippet is all the
128
+ // user gets — it has to include `extras`, or the printed code references symbols
129
+ // it never imports. That was exactly the gap `extras` was declared to close.
130
+ const imports = [
131
+ ` import { ${spec.factory} } from '${spec.subpath}';`,
132
+ ...(spec.extras ?? []).map(([symbols, subpath]) => ` import { ${symbols} } from '${subpath}';`),
133
+ ].join('\n');
116
134
  return `
117
135
  ngwr:provider — copy this into your bootstrap:
118
136
 
119
- import { ${spec.factory} } from '${spec.subpath}';
137
+ ${imports}
120
138
 
121
139
  bootstrapApplication(AppComponent, {
122
140
  providers: [/* …, */ ${spec.call}],
@@ -6,34 +6,48 @@
6
6
  "properties": {
7
7
  "name": {
8
8
  "type": "string",
9
- "enum": [
10
- "overlay",
11
- "icons",
12
- "toast",
13
- "i18n",
14
- "date-adapter",
15
- "density",
16
- "loading-bar",
17
- "cookie",
18
- "storage",
19
- "theme"
20
- ],
9
+ "enum": ["overlay", "icons", "toast", "i18n", "date-adapter", "density", "storage", "theme"],
21
10
  "description": "Provider to add.",
22
- "$default": { "$source": "argv", "index": 0 },
11
+ "$default": {
12
+ "$source": "argv",
13
+ "index": 0
14
+ },
23
15
  "x-prompt": {
24
16
  "message": "Which provider?",
25
17
  "type": "list",
26
18
  "items": [
27
- { "value": "overlay", "label": "overlay — required for every overlay-backed component" },
28
- { "value": "icons", "label": "icons — register a tree-shaken icon set" },
29
- { "value": "toast", "label": "toast — global toast service" },
30
- { "value": "i18n", "label": "i18n — Transloco-class translation core" },
31
- { "value": "date-adapter", "label": "date-adapter — calendar / date-picker plumbing" },
32
- { "value": "density", "label": "density — sm / md / lg scale" },
33
- { "value": "loading-bar", "label": "loading-bar — router-aware progress bar" },
34
- { "value": "cookie", "label": "cookie — wr cookie service" },
35
- { "value": "storage", "label": "storage — swappable engine + TTL" },
36
- { "value": "theme", "label": "theme — light/dark/auto mode" }
19
+ {
20
+ "value": "overlay",
21
+ "label": "overlay — required for every overlay-backed component"
22
+ },
23
+ {
24
+ "value": "icons",
25
+ "label": "icons — register a tree-shaken icon set"
26
+ },
27
+ {
28
+ "value": "toast",
29
+ "label": "toast — global toast service"
30
+ },
31
+ {
32
+ "value": "i18n",
33
+ "label": "i18n — Transloco-class translation core"
34
+ },
35
+ {
36
+ "value": "date-adapter",
37
+ "label": "date-adapter — calendar / date-picker plumbing"
38
+ },
39
+ {
40
+ "value": "density",
41
+ "label": "density — sm / md / lg scale"
42
+ },
43
+ {
44
+ "value": "storage",
45
+ "label": "storage — swappable engine + TTL"
46
+ },
47
+ {
48
+ "value": "theme",
49
+ "label": "theme — light/dark/auto mode"
50
+ }
37
51
  ]
38
52
  }
39
53
  },
@@ -45,7 +59,9 @@
45
59
  "project": {
46
60
  "type": "string",
47
61
  "description": "Target Angular project.",
48
- "$default": { "$source": "projectName" }
62
+ "$default": {
63
+ "$source": "projectName"
64
+ }
49
65
  }
50
66
  },
51
67
  "required": ["name"]
@@ -15,7 +15,11 @@ const SYMBOL_MAP = require('./symbol-map.json');
15
15
  * Add `import { WrFoo } from 'ngwr/<subpath>';` to the given component
16
16
  * file and splice `WrFoo` into the `@Component({ imports: [...] })`
17
17
  * array. Saves the subpath-lookup dance for newcomers — `ng g ngwr:use
18
- * WrButton src/app/my-page.ts`.
18
+ * WrButton --path src/app/my-page.ts`.
19
+ *
20
+ * Only `symbol` is positional (see schema.json); `path` is a named option, so
21
+ * the bare `ng g ngwr:use WrButton src/app/my-page.ts` form fails with
22
+ * `Unknown argument`.
19
23
  *
20
24
  * Regex-based on purpose to avoid pulling in the TS compiler as a runtime
21
25
  * dep. Covers the common standalone-component shape; an unusual file
@@ -7,18 +7,23 @@
7
7
  "symbol": {
8
8
  "type": "string",
9
9
  "description": "Class name to import — e.g. `WrButton`, `WrSelect`, `WrFormField`.",
10
- "$default": { "$source": "argv", "index": 0 },
10
+ "$default": {
11
+ "$source": "argv",
12
+ "index": 0
13
+ },
11
14
  "x-prompt": "Class name to import (e.g. WrButton)?"
12
15
  },
13
16
  "path": {
14
17
  "type": "string",
15
18
  "format": "path",
16
- "description": "Component file to edit. When omitted, uses the file passed via argv[1] or prompts."
19
+ "description": "Component file to edit. Named option, not positional. When omitted, the schematic prints a copy-pasteable snippet instead of editing a file."
17
20
  },
18
21
  "project": {
19
22
  "type": "string",
20
23
  "description": "Target Angular project. Defaults to the workspace default.",
21
- "$default": { "$source": "projectName" }
24
+ "$default": {
25
+ "$source": "projectName"
26
+ }
22
27
  }
23
28
  },
24
29
  "required": ["symbol"]