ngwr 10.0.0 → 10.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.
- package/README.md +9 -8
- package/action-sheet/styles/_index.scss +6 -1
- package/alert/styles/_index.scss +7 -3
- package/badge/styles/_index.scss +1 -1
- package/badge/styles/_tag.scss +2 -2
- package/border-glow/styles/_index.scss +5 -0
- package/breadcrumbs/styles/_index.scss +1 -1
- package/button/styles/_index.scss +6 -6
- 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 +1 -2
- package/drag-drop/styles/_index.scss +20 -7
- package/event-calendar/styles/_index.scss +284 -0
- package/falling-text/styles/_index.scss +5 -0
- 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 +31 -4
- 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-command-palette.mjs +7 -3
- package/fesm2022/ngwr-command-palette.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 +23 -6
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-descriptions.mjs +5 -4
- package/fesm2022/ngwr-descriptions.mjs.map +1 -1
- package/fesm2022/ngwr-drag-drop.mjs +2 -2
- package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +4 -0
- 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 +73 -5
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +73 -5
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +20 -2
- package/fesm2022/ngwr-i18n.mjs.map +1 -1
- package/fesm2022/ngwr-icon.mjs +5 -0
- 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-meter-group.mjs +14 -3
- package/fesm2022/ngwr-meter-group.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 +1 -1
- package/fesm2022/ngwr-pagination.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 +28 -8
- 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-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 +23 -6
- 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 +2 -2
- 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 +74 -6
- package/i18n/ru.json +74 -6
- package/icon/styles/_index.scss +5 -0
- package/keyboard/styles/_index.scss +5 -0
- package/llms-full.txt +123 -62
- package/llms.txt +29 -8
- package/loading-bar/styles/_index.scss +5 -0
- package/marquee/styles/_index.scss +7 -2
- package/overlay/styles/_index.scss +5 -0
- package/package.json +13 -1
- package/popover/styles/_index.scss +48 -12
- 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 +5 -2
- 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 +6 -177
- package/segmented/styles/_index.scss +1 -1
- package/select/styles/_index.scss +7 -3
- package/shiny-text/styles/_index.scss +5 -0
- package/sidebar/styles/_index.scss +3 -3
- package/speed-dial/styles/_index.scss +12 -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/stepper/styles/_index.scss +3 -3
- package/styles/_animations.scss +6 -0
- package/styles.scss +3 -0
- package/table/styles/_index.scss +100 -2
- package/tabs/styles/_index.scss +1 -1
- package/theme/styles/_colors.scss +65 -2
- package/theme/styles/_dark.scss +18 -6
- package/theme/styles/_focus.scss +2 -8
- 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 +12 -1
- package/types/ngwr-checkbox.d.ts +9 -1
- package/types/ngwr-command-palette.d.ts +4 -1
- package/types/ngwr-date-picker.d.ts +9 -1
- package/types/ngwr-density.d.ts +1 -1
- package/types/ngwr-divider.d.ts +1 -1
- 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 +15 -0
- 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-meter-group.d.ts +9 -1
- package/types/ngwr-page-header.d.ts +2 -2
- package/types/ngwr-pagination.d.ts +1 -1
- 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 +13 -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-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 +10 -2
- package/types/ngwr-validators.d.ts +62 -2
- package/types/ngwr-version.d.ts +2 -2
- package/typewriter/styles/_index.scss +5 -0
- package/typography/styles/_index.scss +5 -5
- package/virtual-scroll/styles/_index.scss +6 -1
- package/waves/styles/_index.scss +5 -0
package/llms.txt
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# ngwr
|
|
2
2
|
|
|
3
3
|
> Angular UI library — standalone, signals-first, zoneless, fully tree-shakable.
|
|
4
|
-
>
|
|
4
|
+
> 130 secondary entry points, 188 component and directive classes, built on
|
|
5
5
|
> `@angular/cdk` primitives. The only runtime dependency is `tslib`. Docs and
|
|
6
6
|
> live demos: https://ngwr.dev — source: https://github.com/thekhegay/ngwr
|
|
7
7
|
|
|
8
8
|
This file orients AI agents and LLMs that consume ngwr. For exact, current
|
|
9
9
|
component APIs, read the bundled TypeScript types
|
|
10
|
-
(`node_modules/ngwr/types/ngwr-<name>.d.ts`).
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
(`node_modules/ngwr/types/ngwr-<name>.d.ts`). ngwr.dev is prerendered, so
|
|
11
|
+
fetching a route returns real HTML you can read; the machine-readable resources
|
|
12
|
+
listed at the bottom are still the faster path for bulk API lookups.
|
|
13
13
|
|
|
14
14
|
## Install
|
|
15
15
|
|
|
@@ -52,10 +52,14 @@ Add from their entry points as needed:
|
|
|
52
52
|
- `provideWrDateAdapter(...)` — calendar + date-picker (`ngwr/date-adapter-fns`
|
|
53
53
|
or `ngwr/date-adapter-luxon`).
|
|
54
54
|
|
|
55
|
+
Injected rather than provided: `WrTour` (`ngwr/tour`) runs a guided onboarding
|
|
56
|
+
tour — `tour.start([{ target: '[data-tour="save"]', content: '…' }])` spotlights
|
|
57
|
+
one element at a time; a step whose target is missing is skipped, not floated.
|
|
58
|
+
|
|
55
59
|
## Schematics — let `ng` wire it
|
|
56
60
|
|
|
57
61
|
- `ng add ngwr` — installs peers, adds `@use 'ngwr'` to styles, prints provider setup.
|
|
58
|
-
- `ng g ngwr:use WrFoo src/app/x.ts` — adds the import + splices `WrFoo` into that
|
|
62
|
+
- `ng g ngwr:use WrFoo --path src/app/x.ts` — adds the import + splices `WrFoo` into that
|
|
59
63
|
component's `@Component` imports.
|
|
60
64
|
- `ng g ngwr:provider <overlay|icons|toast|i18n|date-adapter|density|theme|…>` —
|
|
61
65
|
adds the matching `provideWr*()` to bootstrap.
|
|
@@ -81,9 +85,11 @@ before writing your own. Full catalog: https://ngwr.dev/reference/components.
|
|
|
81
85
|
`wr-input-number`, `wr-input-otp`, `wr-date-picker` (date/time/datetime) and
|
|
82
86
|
`wr-date-range-picker` (both in ngwr/date-picker; the range value is
|
|
83
87
|
`[start, end]`, hence a separate component), `wr-file-upload`,
|
|
84
|
-
`wr-form-field`, `wr-color-picker
|
|
88
|
+
`wr-form-field`, `wr-color-picker`, `wr-transfer` (dual listbox; the value
|
|
89
|
+
is the RIGHT pane).
|
|
85
90
|
- **Data** — `wr-table` (column pin/resize/drag-reorder, row selection,
|
|
86
|
-
expandable rows, grouping,
|
|
91
|
+
expandable rows, grouping, tree rows (`childrenKey`), summary rows,
|
|
92
|
+
CSV export, virtualized body),
|
|
87
93
|
`wr-pagination`, `wr-tree`, `wr-virtual-scroll`, `wr-sortable-list`
|
|
88
94
|
(drag-to-reorder).
|
|
89
95
|
- **Feedback** — `wr-alert`, `wr-result`, `wr-empty`, `wr-skeleton`,
|
|
@@ -109,19 +115,34 @@ before writing your own. Full catalog: https://ngwr.dev/reference/components.
|
|
|
109
115
|
- **Icons** — register via `provideWrIcons`, render `<wr-icon name="check" />`.
|
|
110
116
|
- **i18n** — `{{ 'key' | wrT }}` (pipe from `ngwr/i18n`).
|
|
111
117
|
- **Theme** — CSS custom properties `--wr-color-*`, `--wr-border-radius-*`, … set
|
|
112
|
-
by `provideWrTheme()`.
|
|
118
|
+
by `provideWrTheme()`. Two contrast tokens per intent, easy to confuse:
|
|
119
|
+
`--wr-color-<intent>-contrast` is the label ON a filled intent;
|
|
120
|
+
`--wr-color-<intent>-ink` is the intent used AS text on a surface or its own
|
|
121
|
+
`-soft` tint. A bare `--wr-color-<intent>` as text fails WCAG AA in light. For
|
|
122
|
+
muted prose use `--wr-color-on-surface-muted`, not the `medium` intent.
|
|
113
123
|
- **Mobile** — overlays collapse to sheets (`provideWrResponsiveOverlays()`), a
|
|
114
124
|
`responsive` input reflows layout components, a `touch` density preset enlarges
|
|
115
125
|
controls, and `WrHaptics` (ngwr/platform) fires vibration feedback.
|
|
116
126
|
- **Large datasets** — `virtualScroll` is an opt-in input on `wr-table`,
|
|
117
127
|
`wr-tree` and `wr-select` (search mode), alongside the standalone
|
|
118
128
|
`wr-virtual-scroll` wrapper.
|
|
129
|
+
- **Scheduling** — `wr-event-calendar` covers month / week / day in one
|
|
130
|
+
component. `events` is an input the calendar never writes to: a drag emits
|
|
131
|
+
`eventChange` with the proposed start / end, and you apply it. Event `end` is
|
|
132
|
+
EXCLUSIVE. `editable` turns on drag and resize; `Alt` + arrows do the same
|
|
133
|
+
from the keyboard.
|
|
119
134
|
|
|
120
135
|
## Resources (machine-readable)
|
|
121
136
|
|
|
122
137
|
- This quick-ref: https://ngwr.dev/llms.txt
|
|
123
138
|
- Full reference (every entry point + selector + description):
|
|
124
139
|
https://ngwr.dev/llms-full.txt
|
|
140
|
+
- **One page as markdown — append `.md` to any docs URL.**
|
|
141
|
+
`https://ngwr.dev/reference/components/select` also serves
|
|
142
|
+
`https://ngwr.dev/reference/components/select.md`: the same page as markdown,
|
|
143
|
+
prose and code samples and API tables, without the site chrome. Prefer it over
|
|
144
|
+
`llms-full.txt` when you already know which component you need. Each HTML page
|
|
145
|
+
advertises its twin as `<link rel="alternate" type="text/markdown">`.
|
|
125
146
|
- All site URLs (for crawlers): https://ngwr.dev/sitemap.xml
|
|
126
147
|
- Source, README, per-component `.d.ts` types: https://github.com/thekhegay/ngwr
|
|
127
148
|
(installed at `node_modules/ngwr/types/ngwr-<name>.d.ts`; the package also
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
// Pull the whole theme so a standalone `@use 'ngwr/<name>'` brings in every
|
|
2
|
+
// design token this stylesheet references. Sass deduplicates `@use` per
|
|
3
|
+
// compilation, so the umbrella sheet still emits the theme only once.
|
|
4
|
+
@use '../../theme/styles' as theme;
|
|
5
|
+
|
|
1
6
|
.wr-loading-bar {
|
|
2
7
|
position: fixed;
|
|
3
8
|
top: 0;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
// Pull the whole theme so a standalone `@use 'ngwr/<name>'` brings in every
|
|
2
|
+
// design token this stylesheet references. Sass deduplicates `@use` per
|
|
3
|
+
// compilation, so the umbrella sheet still emits the theme only once.
|
|
4
|
+
@use '../../theme/styles' as theme;
|
|
5
|
+
|
|
1
6
|
// Endless marquee (reactbits LogoLoop port).
|
|
2
7
|
// Vars driven from component inputs:
|
|
3
8
|
// --wr-marquee-gap gap between items (px)
|
|
@@ -62,7 +67,7 @@
|
|
|
62
67
|
image-rendering: -webkit-optimize-contrast;
|
|
63
68
|
-webkit-user-drag: none;
|
|
64
69
|
pointer-events: none;
|
|
65
|
-
transition: transform
|
|
70
|
+
transition: transform var(--wr-duration-slow) var(--wr-ease-out);
|
|
66
71
|
}
|
|
67
72
|
|
|
68
73
|
&--scale-hover &__item {
|
|
@@ -76,7 +81,7 @@
|
|
|
76
81
|
}
|
|
77
82
|
|
|
78
83
|
&--scale-hover &__node {
|
|
79
|
-
transition: transform
|
|
84
|
+
transition: transform var(--wr-duration-slow) var(--wr-ease-out);
|
|
80
85
|
}
|
|
81
86
|
|
|
82
87
|
&__link {
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
// Pull the whole theme so a standalone `@use 'ngwr/<name>'` brings in every
|
|
2
|
+
// design token this stylesheet references. Sass deduplicates `@use` per
|
|
3
|
+
// compilation, so the umbrella sheet still emits the theme only once.
|
|
4
|
+
@use '../../theme/styles' as theme;
|
|
5
|
+
|
|
1
6
|
// Shared presentation styles for responsive (bottom-sheet) overlays.
|
|
2
7
|
// Added to a component's overlay panel (`wr-dialog-panel`,
|
|
3
8
|
// `wr-select-overlay`, …) when `provideWrResponsiveOverlays()` or a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngwr",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Signals-first Angular UI library: 100+ standalone, zoneless-ready components with native Signal Forms, SSR-safe rendering and CSS-variable theming.",
|
|
6
6
|
"author": "Roman Khegay <rk@garuna.dev> (https://garuna.dev)",
|
|
@@ -641,6 +641,10 @@
|
|
|
641
641
|
"types": "./types/ngwr-directives.d.ts",
|
|
642
642
|
"default": "./fesm2022/ngwr-directives.mjs"
|
|
643
643
|
},
|
|
644
|
+
"./event-calendar": {
|
|
645
|
+
"types": "./types/ngwr-event-calendar.d.ts",
|
|
646
|
+
"default": "./fesm2022/ngwr-event-calendar.mjs"
|
|
647
|
+
},
|
|
644
648
|
"./fuzzy-text": {
|
|
645
649
|
"types": "./types/ngwr-fuzzy-text.d.ts",
|
|
646
650
|
"default": "./fesm2022/ngwr-fuzzy-text.mjs"
|
|
@@ -693,6 +697,14 @@
|
|
|
693
697
|
"types": "./types/ngwr-storage.d.ts",
|
|
694
698
|
"default": "./fesm2022/ngwr-storage.mjs"
|
|
695
699
|
},
|
|
700
|
+
"./tour": {
|
|
701
|
+
"types": "./types/ngwr-tour.d.ts",
|
|
702
|
+
"default": "./fesm2022/ngwr-tour.mjs"
|
|
703
|
+
},
|
|
704
|
+
"./transfer": {
|
|
705
|
+
"types": "./types/ngwr-transfer.d.ts",
|
|
706
|
+
"default": "./fesm2022/ngwr-transfer.mjs"
|
|
707
|
+
},
|
|
696
708
|
"./utils": {
|
|
697
709
|
"types": "./types/ngwr-utils.d.ts",
|
|
698
710
|
"default": "./fesm2022/ngwr-utils.mjs"
|
|
@@ -20,18 +20,54 @@ $_arrow-inset: 0.625rem; // distance from the panel corner for the -start / -end
|
|
|
20
20
|
|
|
21
21
|
// edge = which side of the panel the arrow hangs off; align = where along that side.
|
|
22
22
|
$_arrow-placement: (
|
|
23
|
-
top: (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
top: (
|
|
24
|
+
bottom,
|
|
25
|
+
center,
|
|
26
|
+
),
|
|
27
|
+
top-start: (
|
|
28
|
+
bottom,
|
|
29
|
+
start,
|
|
30
|
+
),
|
|
31
|
+
top-end: (
|
|
32
|
+
bottom,
|
|
33
|
+
end,
|
|
34
|
+
),
|
|
35
|
+
bottom: (
|
|
36
|
+
top,
|
|
37
|
+
center,
|
|
38
|
+
),
|
|
39
|
+
bottom-start: (
|
|
40
|
+
top,
|
|
41
|
+
start,
|
|
42
|
+
),
|
|
43
|
+
bottom-end: (
|
|
44
|
+
top,
|
|
45
|
+
end,
|
|
46
|
+
),
|
|
47
|
+
left: (
|
|
48
|
+
right,
|
|
49
|
+
center,
|
|
50
|
+
),
|
|
51
|
+
left-start: (
|
|
52
|
+
right,
|
|
53
|
+
start,
|
|
54
|
+
),
|
|
55
|
+
left-end: (
|
|
56
|
+
right,
|
|
57
|
+
end,
|
|
58
|
+
),
|
|
59
|
+
right: (
|
|
60
|
+
left,
|
|
61
|
+
center,
|
|
62
|
+
),
|
|
63
|
+
right-start: (
|
|
64
|
+
left,
|
|
65
|
+
start,
|
|
66
|
+
),
|
|
67
|
+
right-end: (
|
|
68
|
+
left,
|
|
69
|
+
end,
|
|
70
|
+
),
|
|
35
71
|
);
|
|
36
72
|
|
|
37
73
|
/// Positions the arrow against `$edge`, offset outwards by `$pull`.
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
// Pull the whole theme so a standalone `@use 'ngwr/<name>'` brings in every
|
|
2
|
+
// design token this stylesheet references. Sass deduplicates `@use` per
|
|
3
|
+
// compilation, so the umbrella sheet still emits the theme only once.
|
|
4
|
+
@use '../../theme/styles' as theme;
|
|
5
|
+
|
|
1
6
|
.wr-pull-to-refresh {
|
|
2
7
|
display: block;
|
|
3
8
|
position: relative;
|
|
@@ -48,15 +48,15 @@
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
&--success &__icon {
|
|
51
|
-
color: var(--wr-color-success);
|
|
51
|
+
color: var(--wr-color-success-ink);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
&--warning &__icon {
|
|
55
|
-
color: var(--wr-color-warning);
|
|
55
|
+
color: var(--wr-color-warning-ink);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
&--error &__icon {
|
|
59
|
-
color: var(--wr-color-danger);
|
|
59
|
+
color: var(--wr-color-danger-ink);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
&--info &__icon {
|
|
@@ -9,27 +9,60 @@ 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
11
|
/**
|
|
12
|
-
* Curated
|
|
13
|
-
*
|
|
12
|
+
* Curated icon sets, as `<name used in templates>` → `<lucide export>`.
|
|
13
|
+
*
|
|
14
|
+
* These used to be bare identifiers imported straight from `ngwr/icon`, which
|
|
15
|
+
* never compiled: that entry point exports only `WrIcon`, `provideWrIcons` and
|
|
16
|
+
* `svgIcon`, never the icons themselves. Icons come from an adapter, so the
|
|
17
|
+
* generated file registers them through `lucideIcons()` — the same wiring
|
|
18
|
+
* `ng add ngwr` produces.
|
|
14
19
|
*/
|
|
15
20
|
const SETS = {
|
|
16
|
-
basic:
|
|
17
|
-
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
basic: {
|
|
22
|
+
checkmark: 'Check',
|
|
23
|
+
close: 'X',
|
|
24
|
+
add: 'Plus',
|
|
25
|
+
edit: 'Pencil',
|
|
26
|
+
trash: 'Trash2',
|
|
27
|
+
search: 'Search',
|
|
28
|
+
copy: 'Copy',
|
|
29
|
+
},
|
|
30
|
+
navigation: {
|
|
31
|
+
'chevron-down': 'ChevronDown',
|
|
32
|
+
'chevron-left': 'ChevronLeft',
|
|
33
|
+
'chevron-right': 'ChevronRight',
|
|
34
|
+
'chevron-up': 'ChevronUp',
|
|
35
|
+
'arrow-back': 'ArrowLeft',
|
|
36
|
+
'arrow-forward': 'ArrowRight',
|
|
37
|
+
'arrow-top': 'ArrowUp',
|
|
38
|
+
'arrow-bottom': 'ArrowDown',
|
|
39
|
+
menu: 'Menu',
|
|
40
|
+
'dots-horizontal': 'MoreHorizontal',
|
|
41
|
+
'dots-vertical': 'MoreVertical',
|
|
42
|
+
},
|
|
43
|
+
forms: {
|
|
44
|
+
eye: 'Eye',
|
|
45
|
+
'eye-off': 'EyeOff',
|
|
46
|
+
lock: 'Lock',
|
|
47
|
+
'lock-opened': 'LockOpen',
|
|
48
|
+
calendar: 'Calendar',
|
|
49
|
+
time: 'Clock',
|
|
50
|
+
filter: 'Filter',
|
|
51
|
+
checkmark: 'Check',
|
|
52
|
+
close: 'X',
|
|
53
|
+
},
|
|
54
|
+
feedback: {
|
|
55
|
+
alert: 'TriangleAlert',
|
|
56
|
+
'alert-circle': 'CircleAlert',
|
|
57
|
+
'info-circle': 'Info',
|
|
58
|
+
'checkmark-circle': 'CircleCheck',
|
|
59
|
+
'close-circle': 'CircleX',
|
|
60
|
+
warning: 'TriangleAlert',
|
|
61
|
+
bell: 'Bell',
|
|
62
|
+
},
|
|
32
63
|
};
|
|
64
|
+
/** Every icon this schematic knows how to map, merged across the curated sets. */
|
|
65
|
+
const KNOWN_ICONS = Object.values(SETS).reduce((acc, set) => ({ ...acc, ...set }), {});
|
|
33
66
|
/** Default fallback when neither `set` nor `icons` is supplied. */
|
|
34
67
|
const DEFAULT_SET = 'basic';
|
|
35
68
|
function iconSet(options) {
|
|
@@ -44,38 +77,54 @@ function iconSet(options) {
|
|
|
44
77
|
const dirPath = options.path ?? `${sourceRoot}/app`;
|
|
45
78
|
const fileName = (options.name ?? 'icons').replace(/\.ts$/, '');
|
|
46
79
|
const filePath = `${dirPath}/${fileName}.ts`;
|
|
47
|
-
// Build the deduped icon
|
|
48
|
-
const fromSet = options.set ? (SETS[options.set] ??
|
|
49
|
-
const
|
|
80
|
+
// Build the deduped icon map — set + explicit icons, or default fallback.
|
|
81
|
+
const fromSet = options.set ? (SETS[options.set] ?? {}) : {};
|
|
82
|
+
const requested = options.icons
|
|
50
83
|
? options.icons
|
|
51
84
|
.split(',')
|
|
52
85
|
.map(s => s.trim())
|
|
53
86
|
.filter(Boolean)
|
|
54
87
|
: [];
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
88
|
+
// schema.json promises unknown names are "flagged but not blocked" — actually do it.
|
|
89
|
+
const unknown = requested.filter(name => !(name in KNOWN_ICONS));
|
|
90
|
+
if (unknown.length > 0) {
|
|
91
|
+
context.logger.warn(`ngwr:icon-set: no lucide mapping for ${unknown.join(', ')} — skipped. ` +
|
|
92
|
+
`Known names: ${Object.keys(KNOWN_ICONS).sort().join(', ')}.`);
|
|
93
|
+
}
|
|
94
|
+
const picked = { ...fromSet };
|
|
95
|
+
for (const name of requested) {
|
|
96
|
+
if (name in KNOWN_ICONS)
|
|
97
|
+
picked[name] = KNOWN_ICONS[name];
|
|
98
|
+
}
|
|
99
|
+
if (Object.keys(picked).length === 0)
|
|
100
|
+
Object.assign(picked, SETS[DEFAULT_SET]);
|
|
58
101
|
if (tree.exists(filePath)) {
|
|
59
102
|
context.logger.warn(`ngwr: ${filePath} already exists — skipping. Pass --name to write a different file, or delete it first.`);
|
|
60
103
|
return tree;
|
|
61
104
|
}
|
|
62
105
|
const exportName = options.exportName ?? 'APP_ICONS';
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
tree.create(filePath, renderFile(importList, exportName, arrayList));
|
|
66
|
-
context.logger.info(`✓ Created ${filePath} with ${icons.length} icons.`);
|
|
106
|
+
tree.create(filePath, renderFile(picked, exportName));
|
|
107
|
+
context.logger.info(`✓ Created ${filePath} with ${Object.keys(picked).length} icons.`);
|
|
67
108
|
context.logger.info(printWiringHint(fileName, exportName));
|
|
68
109
|
return tree;
|
|
69
110
|
};
|
|
70
111
|
}
|
|
71
|
-
function renderFile(
|
|
112
|
+
function renderFile(icons, exportName) {
|
|
113
|
+
const names = Object.keys(icons);
|
|
114
|
+
// Two icon names can share one glyph (alert / warning), so the import list is
|
|
115
|
+
// deduped while the map keeps both keys.
|
|
116
|
+
const imports = [...new Set(names.map(n => icons[n]))].sort().join(', ');
|
|
117
|
+
const entries = names.map(n => ` '${n}': ${icons[n]},`).join('\n');
|
|
72
118
|
return `/**
|
|
73
119
|
* Tree-shaken ngwr icon set. Generated by \`ng g ngwr:icon-set\`.
|
|
74
120
|
* Edit freely — re-running with --name=<other> writes a separate file.
|
|
75
121
|
*/
|
|
76
|
-
import {
|
|
122
|
+
import { lucideIcons } from 'ngwr/icon/adapters/lucide';
|
|
123
|
+
import { ${imports} } from 'lucide';
|
|
77
124
|
|
|
78
|
-
export const ${exportName} =
|
|
125
|
+
export const ${exportName} = lucideIcons({
|
|
126
|
+
${entries}
|
|
127
|
+
});
|
|
79
128
|
`;
|
|
80
129
|
}
|
|
81
130
|
function printWiringHint(fileName, exportName) {
|
|
@@ -90,7 +139,4 @@ Next step — wire the set into bootstrap:
|
|
|
90
139
|
});
|
|
91
140
|
`;
|
|
92
141
|
}
|
|
93
|
-
function unique(list) {
|
|
94
|
-
return Array.from(new Set(list));
|
|
95
|
-
}
|
|
96
142
|
exports.default = iconSet;
|
|
@@ -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",
|
|
@@ -25,8 +25,11 @@ const BASE_PEERS = [
|
|
|
25
25
|
const DATE_ADAPTER_PEERS = {
|
|
26
26
|
none: [],
|
|
27
27
|
native: [],
|
|
28
|
-
|
|
29
|
-
|
|
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']],
|
|
30
33
|
};
|
|
31
34
|
/** Adapter classes named in the next-steps snippet for each choice. */
|
|
32
35
|
const DATE_ADAPTER_PROVIDER = {
|
|
@@ -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}],
|