@bicharts/chart-host 0.5.86 → 0.5.87

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.
@@ -0,0 +1,30 @@
1
+ /** Which vocabulary a source format string is written in. See the header note - this is stated
2
+ * by the host that owns the format, never inferred from the string. */
3
+ export type SourceFormatDialect = "excel" | "dotnet";
4
+ /** A host's per-column source formats. The dialect is carried WITH the map rather than passed
5
+ * beside it, so a caller cannot supply one without the other. */
6
+ export interface SourceFormats {
7
+ dialect: SourceFormatDialect;
8
+ /** Keyed by column name, which is the key the payload's columns already carry. Absent or
9
+ * blank for a column with no source format - a computed column, a CSV, a text date whose
10
+ * own text IS its formatting. */
11
+ byColumn: Record<string, string>;
12
+ }
13
+ export interface SourceDateOptions {
14
+ /** The source's own format string for this column, if it has one. */
15
+ format?: string | null;
16
+ /** Which vocabulary `format` is written in. Ignored when `format` is absent. */
17
+ dialect?: SourceFormatDialect;
18
+ /** BCP-47 tag, for month and weekday names and for the locale fallback. */
19
+ culture?: string;
20
+ }
21
+ /**
22
+ * Render a temporal payload value for a reader, or NULL when the value is not a date at all.
23
+ *
24
+ * Null rather than a best-effort string, so a caller can fall through to whatever it did before
25
+ * without this file having an opinion about non-dates. Accepts a `Date` (what a host holds before
26
+ * the payload is built) and an ISO string (what the payload carries after it).
27
+ */
28
+ export declare function formatSourceDate(raw: any, opts?: SourceDateOptions): string | null;
29
+ /** Convenience for a caller holding a `SourceFormats` map and a column name. */
30
+ export declare function formatSourceDateFor(raw: any, columnName: string, formats: SourceFormats | null | undefined, culture?: string): string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bicharts/chart-host",
3
- "version": "0.5.86",
3
+ "version": "0.5.87",
4
4
  "description": "Run a BIC-generated D3 chart in any web host: compiles the generated render() function, applies the shared option defaults, resolves mark clicks (through tooltip overlays), owns the selection affordance, and translates row indices between cross-filtered charts. The same contract the BIC Power BI visual implements, minus Power BI. React bindings at @bicharts/chart-host/react.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",