@besaitech/ng-design-system 0.0.66 → 0.0.67

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 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 |
@@ -210,7 +211,7 @@ Import names are the `Sl…` classes; the markup selectors are `sds-…`.
210
211
  | `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
212
  | `SdsBarChart` | `<sds-bar-chart>` | `orientation`, `stack`, negatives, `showValues`, `sort`, `barColor`, `highlight`, combo `type: 'line'` series |
212
213
  | `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 "Autres" past `maxSlices`; centre total / hovered slice |
214
+ | `SdsDonutChart` | `<sds-donut-chart>` | Donut · pie · `half`; tail folds into "Other" past `maxSlices`; centre total / hovered slice (`centerLabel=""` hides the centre readout) |
214
215
  | `SdsHeatmap` | `<sds-heatmap>` | Two categorical dims × a measure; `scheme` sequential · diverging, `showValues` |
215
216
  | `SdsTreemap` | `<sds-treemap>` | Nested `{ name, value?, children? }`; branch colours, click-to-zoom breadcrumb |
216
217
  | `SdsSparkline` | `<sds-sparkline>` | Word-sized line · area · bar; `band`, `reference`, `showMinMax` |
@@ -223,9 +224,21 @@ keyboard-navigable tooltip, a data-table twin (`tableToggle`), `loading` / empty
223
224
  (override any slot in your preset). Set app-wide defaults once:
224
225
 
225
226
  ```ts
226
- providers: [provideSdsCharts({ locale: 'fr-FR' })] // or locale: () => translate.currentLang()
227
+ providers: [provideSdsCharts({ locale: 'fr-FR', labels: CHART_LABELS_FR })]
228
+ // or, switching live with the app language (both functions are read inside computed()s):
229
+ providers: [provideSdsCharts({ locale: () => lang(), labels: () => chartLabelsFor(lang()) })]
227
230
  ```
228
231
 
232
+ **Chart strings.** Every built-in string — empty state, table toggle and headers, tooltip rows, the
233
+ spoken summaries, role descriptions, the KPI's change sentence — is an `SdsChartLabels` key with an
234
+ English default (`SDS_CHART_LABELS_EN`). Translate them once through `provideSdsCharts({ labels })`
235
+ (a `Partial<SdsChartLabels>`, merged over the English defaults); parameterised ones are functions
236
+ (`sliceCount(n)`, `gridSize(rows, columns)`, `labelValue(label, value)`, `zoomedTo(path)`,
237
+ `versus(y, x)`, `sparklineSummary({ label, first, last, min, max, count })`,
238
+ `kpiChange({ direction, delta, period, good })`, …). Per-chart inputs (`emptyText`, `otherLabel`,
239
+ `centerLabel`, `valueLabel`, `rootLabel`, `sizeLabel`) still win for one chart; left unset (`null`)
240
+ they fall back to the configured labels.
241
+
229
242
  ```html
230
243
  <sds-line-chart
231
244
  heading="Admissions"