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.
- package/README.md +23 -8
- package/action-sheet/styles/_index.scss +6 -1
- package/badge/styles/_index.scss +17 -7
- package/badge/styles/_tag.scss +12 -3
- package/border-glow/styles/_index.scss +5 -0
- package/button/styles/_index.scss +48 -1
- package/calendar/styles/_index.scss +9 -1
- package/circular-text/styles/_index.scss +6 -1
- package/density/styles/_index.scss +3 -1
- package/dialog/styles/_index.scss +66 -2
- package/drag-drop/styles/_index.scss +20 -7
- package/drawer/styles/_index.scss +61 -1
- package/event-calendar/styles/_index.scss +284 -0
- package/falling-text/styles/_index.scss +5 -0
- package/fesm2022/ngwr-action-sheet.mjs +1 -1
- package/fesm2022/ngwr-action-sheet.mjs.map +1 -1
- package/fesm2022/ngwr-alert.mjs +8 -3
- package/fesm2022/ngwr-alert.mjs.map +1 -1
- package/fesm2022/ngwr-back-top.mjs +6 -4
- package/fesm2022/ngwr-back-top.mjs.map +1 -1
- package/fesm2022/ngwr-border-glow.mjs +12 -9
- package/fesm2022/ngwr-border-glow.mjs.map +1 -1
- package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +5 -3
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-card.mjs +2 -2
- package/fesm2022/ngwr-card.mjs.map +1 -1
- package/fesm2022/ngwr-carousel.mjs +17 -4
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +35 -7
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox.mjs +12 -3
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-circular-text.mjs +2 -2
- package/fesm2022/ngwr-circular-text.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +6 -5
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette.mjs +7 -3
- package/fesm2022/ngwr-command-palette.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +7 -7
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-counter.mjs +9 -1
- package/fesm2022/ngwr-counter.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +37 -15
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-density.mjs +10 -2
- package/fesm2022/ngwr-density.mjs.map +1 -1
- package/fesm2022/ngwr-descriptions.mjs +5 -4
- package/fesm2022/ngwr-descriptions.mjs.map +1 -1
- package/fesm2022/ngwr-dialog.mjs +10 -1
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-drag-drop.mjs +2 -2
- package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +37 -16
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +8 -3
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar.mjs +723 -0
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -0
- package/fesm2022/ngwr-falling-text.mjs +2 -2
- package/fesm2022/ngwr-falling-text.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +2 -2
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +258 -42
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-fuzzy-text.mjs +15 -1
- package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
- package/fesm2022/ngwr-gauge.mjs +8 -3
- package/fesm2022/ngwr-gauge.mjs.map +1 -1
- package/fesm2022/ngwr-glitch-text.mjs +2 -2
- package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
- package/fesm2022/ngwr-gradient-text.mjs +2 -2
- package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +89 -5
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +90 -5
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +94 -3
- package/fesm2022/ngwr-i18n.mjs.map +1 -1
- package/fesm2022/ngwr-icon.mjs +79 -35
- package/fesm2022/ngwr-icon.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +19 -3
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +48 -6
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-knob.mjs +8 -3
- package/fesm2022/ngwr-knob.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +32 -3
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-line-chart.mjs +3 -3
- package/fesm2022/ngwr-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +2 -2
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar.mjs +2 -2
- package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
- package/fesm2022/ngwr-marquee.mjs +2 -2
- package/fesm2022/ngwr-marquee.mjs.map +1 -1
- package/fesm2022/ngwr-media.mjs +3 -0
- package/fesm2022/ngwr-media.mjs.map +1 -1
- package/fesm2022/ngwr-mention.mjs +166 -10
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-meter-group.mjs +14 -3
- package/fesm2022/ngwr-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +173 -3
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-page-header.mjs +2 -2
- package/fesm2022/ngwr-page-header.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +17 -4
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm.mjs +4 -3
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +10 -3
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +8 -2
- package/fesm2022/ngwr-progress.mjs.map +1 -1
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-rating.mjs +6 -4
- package/fesm2022/ngwr-rating.mjs.map +1 -1
- package/fesm2022/ngwr-result.mjs +19 -12
- package/fesm2022/ngwr-result.mjs.map +1 -1
- package/fesm2022/ngwr-segmented.mjs +2 -2
- package/fesm2022/ngwr-segmented.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +40 -13
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-shiny-text.mjs +4 -6
- package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +11 -3
- package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
- package/fesm2022/ngwr-spotlight-card.mjs +2 -2
- package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
- package/fesm2022/ngwr-squircle.mjs +1 -1
- package/fesm2022/ngwr-squircle.mjs.map +1 -1
- package/fesm2022/ngwr-star-border.mjs +2 -2
- package/fesm2022/ngwr-star-border.mjs.map +1 -1
- package/fesm2022/ngwr-switch.mjs +10 -3
- package/fesm2022/ngwr-switch.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +233 -19
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +21 -4
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +20 -4
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-theme.mjs +13 -3
- package/fesm2022/ngwr-theme.mjs.map +1 -1
- package/fesm2022/ngwr-tilt-card.mjs +2 -2
- package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
- package/fesm2022/ngwr-toolbar.mjs +2 -2
- package/fesm2022/ngwr-toolbar.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +264 -0
- package/fesm2022/ngwr-tour.mjs.map +1 -0
- package/fesm2022/ngwr-transfer.mjs +184 -0
- package/fesm2022/ngwr-transfer.mjs.map +1 -0
- package/fesm2022/ngwr-tree.mjs +27 -9
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typewriter.mjs +2 -2
- package/fesm2022/ngwr-typewriter.mjs.map +1 -1
- package/fesm2022/ngwr-validators.mjs +118 -2
- package/fesm2022/ngwr-validators.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +2 -2
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-virtual-scroll.mjs +2 -2
- package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
- package/fesm2022/ngwr-waves.mjs +25 -3
- package/fesm2022/ngwr-waves.mjs.map +1 -1
- package/form/styles/_index.scss +8 -4
- package/glitch-text/styles/_index.scss +5 -0
- package/gradient-text/styles/_index.scss +5 -0
- package/i18n/en.json +233 -0
- package/i18n/ru.json +233 -0
- package/icon/styles/_index.scss +15 -1
- package/input/styles/_index.scss +16 -0
- package/input-number/styles/_index.scss +8 -1
- package/keyboard/styles/_index.scss +15 -3
- package/llms-full.txt +124 -63
- package/llms.txt +29 -8
- package/loading-bar/styles/_index.scss +5 -0
- package/marquee/styles/_index.scss +7 -2
- package/mention/styles/_index.scss +23 -0
- package/overlay/styles/_index.scss +5 -0
- package/package.json +15 -1
- package/pagination/styles/_index.scss +12 -0
- package/popover/styles/_index.scss +165 -45
- package/pull-to-refresh/styles/_index.scss +5 -0
- package/result/styles/_index.scss +3 -3
- package/schematics/icon-set/index.js +80 -34
- package/schematics/icon-set/schema.json +8 -3
- package/schematics/ng-add/index.js +23 -6
- package/schematics/package.json +3 -0
- package/schematics/page/templates.js +17 -21
- package/schematics/provider/index.js +31 -13
- package/schematics/provider/schema.json +40 -24
- package/schematics/use/index.js +5 -1
- package/schematics/use/schema.json +8 -3
- package/schematics/use/symbol-map.json +7 -176
- package/segmented/styles/_index.scss +1 -1
- package/select/styles/_index.scss +20 -3
- package/shiny-text/styles/_index.scss +5 -0
- package/speed-dial/styles/_index.scss +12 -1
- package/splitter/styles/_index.scss +7 -1
- package/spotlight-card/styles/_index.scss +5 -0
- package/squircle/styles/_index.scss +5 -0
- package/star-border/styles/_index.scss +5 -0
- package/statistic/styles/_index.scss +2 -2
- package/styles/_animations.scss +6 -0
- package/styles.scss +3 -0
- package/table/styles/_index.scss +128 -12
- package/theme/styles/_box-model.scss +29 -0
- package/theme/styles/_colors.scss +116 -15
- package/theme/styles/_dark.scss +65 -7
- package/theme/styles/_focus.scss +2 -8
- package/theme/styles/_index.scss +1 -0
- package/tilt-card/styles/_index.scss +5 -0
- package/toast/styles/_index.scss +6 -3
- package/tour/styles/_index.scss +63 -0
- package/transfer/styles/_index.scss +105 -0
- package/types/ngwr-alert.d.ts +4 -1
- package/types/ngwr-avatar.d.ts +1 -1
- package/types/ngwr-back-top.d.ts +3 -2
- package/types/ngwr-badge.d.ts +1 -1
- package/types/ngwr-border-glow.d.ts +0 -1
- package/types/ngwr-carousel.d.ts +10 -1
- package/types/ngwr-cascader.d.ts +13 -1
- package/types/ngwr-checkbox.d.ts +9 -1
- package/types/ngwr-color-picker.d.ts +1 -0
- package/types/ngwr-command-palette.d.ts +4 -1
- package/types/ngwr-context-menu.d.ts +1 -0
- package/types/ngwr-date-picker.d.ts +14 -4
- package/types/ngwr-density.d.ts +9 -2
- package/types/ngwr-dialog.d.ts +9 -0
- package/types/ngwr-divider.d.ts +1 -1
- package/types/ngwr-drawer.d.ts +20 -4
- package/types/ngwr-dropdown.d.ts +1 -0
- package/types/ngwr-event-calendar.d.ts +358 -0
- package/types/ngwr-form.d.ts +177 -20
- package/types/ngwr-fuzzy-text.d.ts +8 -0
- package/types/ngwr-gauge.d.ts +4 -1
- package/types/ngwr-i18n.d.ts +80 -2
- package/types/ngwr-icon.d.ts +11 -19
- package/types/ngwr-input-number.d.ts +8 -1
- package/types/ngwr-input.d.ts +50 -20
- package/types/ngwr-knob.d.ts +4 -1
- package/types/ngwr-lightbox.d.ts +7 -1
- package/types/ngwr-line-chart.d.ts +1 -1
- package/types/ngwr-media.d.ts +1 -1
- package/types/ngwr-mention.d.ts +45 -1
- package/types/ngwr-meter-group.d.ts +9 -1
- package/types/ngwr-overlay.d.ts +80 -2
- package/types/ngwr-page-header.d.ts +2 -2
- package/types/ngwr-pagination.d.ts +15 -2
- package/types/ngwr-popconfirm.d.ts +1 -0
- package/types/ngwr-popover.d.ts +1 -0
- package/types/ngwr-progress.d.ts +4 -1
- package/types/ngwr-rating.d.ts +3 -2
- package/types/ngwr-result.d.ts +12 -6
- package/types/ngwr-segmented.d.ts +6 -0
- package/types/ngwr-select.d.ts +19 -7
- package/types/ngwr-shiny-text.d.ts +2 -4
- package/types/ngwr-speed-dial.d.ts +7 -1
- package/types/ngwr-squircle.d.ts +1 -1
- package/types/ngwr-switch.d.ts +7 -1
- package/types/ngwr-table.d.ts +126 -6
- package/types/ngwr-tabs.d.ts +1 -4
- package/types/ngwr-textarea.d.ts +8 -1
- package/types/ngwr-theme.d.ts +8 -1
- package/types/ngwr-toolbar.d.ts +2 -2
- package/types/ngwr-tour.d.ts +132 -0
- package/types/ngwr-transfer.d.ts +118 -0
- package/types/ngwr-tree.d.ts +11 -2
- package/types/ngwr-validators.d.ts +62 -2
- package/types/ngwr-version.d.ts +2 -2
- package/types/ngwr-waves.d.ts +10 -0
- package/typewriter/styles/_index.scss +5 -0
- package/typography/styles/_index.scss +3 -3
- package/virtual-scroll/styles/_index.scss +6 -1
- 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": {
|
|
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": {
|
|
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
|
|
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
|
-
/**
|
|
14
|
-
|
|
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
|
-
|
|
20
|
-
|
|
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
|
|
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(
|
|
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';");
|
|
@@ -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
|
|
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,
|
|
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 =
|
|
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 [
|
|
120
|
+
<wr-table [columns]="columns" [items]="rows()" />
|
|
118
121
|
|
|
119
122
|
<wr-pagination
|
|
120
|
-
[(
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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(
|
|
17
|
-
extras: [
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
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": {
|
|
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
|
-
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
{
|
|
36
|
-
|
|
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": {
|
|
62
|
+
"$default": {
|
|
63
|
+
"$source": "projectName"
|
|
64
|
+
}
|
|
49
65
|
}
|
|
50
66
|
},
|
|
51
67
|
"required": ["name"]
|
package/schematics/use/index.js
CHANGED
|
@@ -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": {
|
|
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,
|
|
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": {
|
|
24
|
+
"$default": {
|
|
25
|
+
"$source": "projectName"
|
|
26
|
+
}
|
|
22
27
|
}
|
|
23
28
|
},
|
|
24
29
|
"required": ["symbol"]
|