@besaitech/ng-design-system 0.0.66 → 0.0.68
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 +28 -2
- package/charts/index.d.ts +1257 -0
- package/fesm2022/besaitech-ng-design-system-charts.mjs +6149 -0
- package/fesm2022/besaitech-ng-design-system-charts.mjs.map +1 -0
- package/fesm2022/besaitech-ng-design-system.mjs +9268 -14141
- package/fesm2022/besaitech-ng-design-system.mjs.map +1 -1
- package/index.d.ts +389 -1219
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -180,6 +180,7 @@ Import names are the `Sl…` classes; the markup selectors are `sds-…`.
|
|
|
180
180
|
| `SdsSelect` | `<sds-select>` | CVA single-select dropdown |
|
|
181
181
|
| `SdsMultiSelect` | `<sds-multi-select>` | CVA multi-select with chips; `(opened)` / `(closed)` (emits the selection) |
|
|
182
182
|
| `SdsDatePicker` / `SdsCalendar` | `<sds-date-picker>` / `<sds-calendar>` | CVA date field + popover calendar (`date-utils` helpers) |
|
|
183
|
+
| `SdsDateRangePicker` / `SdsRangeCalendar` | `<sds-date-range-picker>` / `<sds-range-calendar>` | Range field: presets column + two-month range calendar, pending until Apply; `[(value)]` is an `SdsDateRange \| null` (`{ start, end }`, end inclusive); `(presetSelect)` emits the preset id; helpers `sdsLastDays(n)`, `sdsLastMonths(n)`, `formatDateRange()` |
|
|
183
184
|
| `SdsPhoneInput` | `<sds-phone-input>` | CVA phone field with country selector (`phone-countries`) |
|
|
184
185
|
| `SdsIcon` | `<sds-icon>` | Inline-SVG icon; `name`, `size`, `strokeWidth`, `filled` |
|
|
185
186
|
| `SdsAvatar` | `<sds-avatar>` | Image, initials or `fallbackIcon` + status dot; `shape` (circle·rounded·square), `decorative`; broken image falls back |
|
|
@@ -204,13 +205,26 @@ Import names are the `Sl…` classes; the markup selectors are `sds-…`.
|
|
|
204
205
|
| `SdsSidebar` + `SdsNavGroup` + `SdsNavItem` | `<sds-sidebar>` … | Collapsible nav rail; collapse state via root-provided `SidebarStore`; items render `routerLink` or `<button>` |
|
|
205
206
|
|
|
206
207
|
**Charts** (D3 does the maths, Angular renders the SVG, so they are OnPush, SSR-safe and themed by tokens)
|
|
208
|
+
— a **secondary entry point**, `@besaitech/ng-design-system/charts`:
|
|
209
|
+
|
|
210
|
+
```ts
|
|
211
|
+
import { SdsLineChart, SdsKpi, SdsChartSeries } from '@besaitech/ng-design-system/charts'; // components + chart data types
|
|
212
|
+
import { provideSdsCharts, SdsChartLabels } from '@besaitech/ng-design-system'; // config + strings (root)
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
The root entry is ONE module: whatever an app uses from it anywhere — even on a lazy route — lands in
|
|
216
|
+
the app's initial chunk. Keeping the charts (and d3) in their own entry lets the bundler leave them in
|
|
217
|
+
the lazy chunk of the page that draws them. The configuration (`provideSdsCharts`, `SDS_CHART_CONFIG`,
|
|
218
|
+
`SdsChartConfig`, `SdsChartLabels`, `SDS_CHART_LABELS_EN` and the label text types) stays in the root —
|
|
219
|
+
it is tiny and d3-free — so `app.config` can provide it eagerly without pulling the charts in. Since
|
|
220
|
+
0.0.68 the root no longer re-exports the chart components or chart types.
|
|
207
221
|
|
|
208
222
|
| Component | Selector | Notes |
|
|
209
223
|
| --- | --- | --- |
|
|
210
224
|
| `SdsLineChart` | `<sds-line-chart>` | Time / numeric / category x; multi-series, `area`, `stack` (stacked · percent), `curve`, log `yScale`, `annotations`, dashed forecast series, `endLabels`, crosshair tooltip |
|
|
211
225
|
| `SdsBarChart` | `<sds-bar-chart>` | `orientation`, `stack`, negatives, `showValues`, `sort`, `barColor`, `highlight`, combo `type: 'line'` series |
|
|
212
226
|
| `SdsScatterChart` | `<sds-scatter-chart>` | `x`/`y`, bubble `size`, `group`, `trendline`, log/time axes, nearest-point hover |
|
|
213
|
-
| `SdsDonutChart` | `<sds-donut-chart>` | Donut · pie · `half`; tail folds into "
|
|
227
|
+
| `SdsDonutChart` | `<sds-donut-chart>` | Donut · pie · `half`; tail folds into "Other" past `maxSlices`; centre total / hovered slice (`centerLabel=""` hides the centre readout) |
|
|
214
228
|
| `SdsHeatmap` | `<sds-heatmap>` | Two categorical dims × a measure; `scheme` sequential · diverging, `showValues` |
|
|
215
229
|
| `SdsTreemap` | `<sds-treemap>` | Nested `{ name, value?, children? }`; branch colours, click-to-zoom breadcrumb |
|
|
216
230
|
| `SdsSparkline` | `<sds-sparkline>` | Word-sized line · area · bar; `band`, `reference`, `showMinMax` |
|
|
@@ -223,9 +237,21 @@ keyboard-navigable tooltip, a data-table twin (`tableToggle`), `loading` / empty
|
|
|
223
237
|
(override any slot in your preset). Set app-wide defaults once:
|
|
224
238
|
|
|
225
239
|
```ts
|
|
226
|
-
providers: [provideSdsCharts({ locale: 'fr-FR'
|
|
240
|
+
providers: [provideSdsCharts({ locale: 'fr-FR', labels: CHART_LABELS_FR })]
|
|
241
|
+
// or, switching live with the app language (both functions are read inside computed()s):
|
|
242
|
+
providers: [provideSdsCharts({ locale: () => lang(), labels: () => chartLabelsFor(lang()) })]
|
|
227
243
|
```
|
|
228
244
|
|
|
245
|
+
**Chart strings.** Every built-in string — empty state, table toggle and headers, tooltip rows, the
|
|
246
|
+
spoken summaries, role descriptions, the KPI's change sentence — is an `SdsChartLabels` key with an
|
|
247
|
+
English default (`SDS_CHART_LABELS_EN`). Translate them once through `provideSdsCharts({ labels })`
|
|
248
|
+
(a `Partial<SdsChartLabels>`, merged over the English defaults); parameterised ones are functions
|
|
249
|
+
(`sliceCount(n)`, `gridSize(rows, columns)`, `labelValue(label, value)`, `zoomedTo(path)`,
|
|
250
|
+
`versus(y, x)`, `sparklineSummary({ label, first, last, min, max, count })`,
|
|
251
|
+
`kpiChange({ direction, delta, period, good })`, …). Per-chart inputs (`emptyText`, `otherLabel`,
|
|
252
|
+
`centerLabel`, `valueLabel`, `rootLabel`, `sizeLabel`) still win for one chart; left unset (`null`)
|
|
253
|
+
they fall back to the configured labels.
|
|
254
|
+
|
|
229
255
|
```html
|
|
230
256
|
<sds-line-chart
|
|
231
257
|
heading="Admissions"
|