@squadbase/vantage 0.6.2-dev1.9365dcd → 0.6.2-dev1.9d7130b
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/dist/{build-X5NVCQKT.js → build-U7GO26HR.js} +7 -7
- package/dist/{build-X5NVCQKT.js.map → build-U7GO26HR.js.map} +1 -1
- package/dist/{check-ZBIH422T.js → check-MRVAIHG5.js} +5 -5
- package/dist/{check-ZBIH422T.js.map → check-MRVAIHG5.js.map} +1 -1
- package/dist/chunk-2IAPIOPS.js +152 -0
- package/dist/chunk-2IAPIOPS.js.map +1 -0
- package/dist/chunk-3RJEOP3J.js +174 -0
- package/dist/chunk-3RJEOP3J.js.map +1 -0
- package/dist/{chunk-HKSVYMYJ.js → chunk-77CISBMG.js} +1049 -1387
- package/dist/chunk-77CISBMG.js.map +1 -0
- package/dist/{chunk-V3LF7BE7.js → chunk-ANZLVSEP.js} +4 -5
- package/dist/chunk-ANZLVSEP.js.map +1 -0
- package/dist/{chunk-XQUSGIDG.js → chunk-CKWPK4RO.js} +10 -3
- package/dist/chunk-CKWPK4RO.js.map +1 -0
- package/dist/chunk-EG4PX726.js +678 -0
- package/dist/chunk-EG4PX726.js.map +1 -0
- package/dist/{chunk-2N72FKLB.js → chunk-NZ5QIIG4.js} +33 -11
- package/dist/chunk-NZ5QIIG4.js.map +1 -0
- package/dist/{chunk-7DZGJQ3P.js → chunk-PJ4SPXHS.js} +23 -6
- package/dist/chunk-PJ4SPXHS.js.map +1 -0
- package/dist/{chunk-XPQSTZUU.js → chunk-QNOX7WLZ.js} +5 -4
- package/dist/chunk-QNOX7WLZ.js.map +1 -0
- package/dist/{chunk-PDOBHMUQ.js → chunk-ROHNXP7J.js} +72 -3
- package/dist/chunk-ROHNXP7J.js.map +1 -0
- package/dist/{chunk-CEXAQQ5W.js → chunk-S5MDTHH7.js} +180 -18
- package/dist/chunk-S5MDTHH7.js.map +1 -0
- package/dist/{chunk-2ICNHUG6.js → chunk-SDJTTMLK.js} +64 -7
- package/dist/chunk-SDJTTMLK.js.map +1 -0
- package/dist/{chunk-WAMZWZJB.js → chunk-SHZM3EXB.js} +19 -8
- package/dist/chunk-SHZM3EXB.js.map +1 -0
- package/dist/chunk-TRMHNMMZ.js +61 -0
- package/dist/chunk-TRMHNMMZ.js.map +1 -0
- package/dist/{chunk-JKLLFVEU.js → chunk-UWSQUHX6.js} +4 -99
- package/dist/chunk-UWSQUHX6.js.map +1 -0
- package/dist/cli.js +6 -6
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +8 -2
- package/dist/client/index.js.map +1 -1
- package/dist/components/index.d.ts +57 -273
- package/dist/components/index.js +6 -3
- package/dist/delta-text-CbrOaW83.d.ts +17 -0
- package/dist/{dev-4XEDTELV.js → dev-O42JFQ64.js} +7 -7
- package/dist/{dev-4XEDTELV.js.map → dev-O42JFQ64.js.map} +1 -1
- package/dist/doc/index.d.ts +215 -2
- package/dist/doc/index.js +422 -4
- package/dist/doc/index.js.map +1 -1
- package/dist/{doctor-5E2VEZPK.js → doctor-YD3XAAOT.js} +5 -5
- package/dist/{doctor-5E2VEZPK.js.map → doctor-YD3XAAOT.js.map} +1 -1
- package/dist/format-DihQkL1N.d.ts +249 -0
- package/dist/query/index.js +2 -2
- package/dist/{routes-3SGAFDMC.js → routes-PVKNT777.js} +4 -4
- package/dist/{routes-3SGAFDMC.js.map → routes-PVKNT777.js.map} +1 -1
- package/dist/slide/index.d.ts +272 -1
- package/dist/slide/index.js +1023 -2
- package/dist/slide/index.js.map +1 -1
- package/dist/table/index.js +9 -6
- package/dist/table/index.js.map +1 -1
- package/dist/ui/index.d.ts +5 -2
- package/dist/ui/index.js +6 -6
- package/dist/ui/index.js.map +1 -1
- package/dist/{upgrade-JHXZBGQS.js → upgrade-6DT7ADRP.js} +4 -4
- package/dist/{upgrade-JHXZBGQS.js.map → upgrade-6DT7ADRP.js.map} +1 -1
- package/dist/vite/index.js +3 -3
- package/docs/en/agent-skills.md +1 -1
- package/docs/en/changelog.md +2 -0
- package/docs/en/components.md +13 -2
- package/docs/en/doc/delta-text.md +40 -0
- package/docs/en/doc/doc-action-items.md +49 -0
- package/docs/en/doc/doc-callout.md +38 -0
- package/docs/en/doc/doc-data-table.md +60 -0
- package/docs/en/doc/doc-executive-summary.md +64 -0
- package/docs/en/doc/doc-figure.md +56 -0
- package/docs/en/doc/doc-key-findings.md +61 -0
- package/docs/en/doc/doc-kpi-scorecard.md +80 -0
- package/docs/en/doc/doc-notes-and-sources.md +43 -0
- package/docs/en/doc/doc-report-header.md +46 -0
- package/docs/en/pages-and-metadata.md +15 -0
- package/docs/en/parts/area-chart.md +99 -0
- package/docs/en/parts/bar-chart.md +91 -0
- package/docs/en/parts/bar-list.md +50 -0
- package/docs/en/parts/category-bar.md +37 -0
- package/docs/en/parts/chart-frame.md +39 -0
- package/docs/en/parts/delta.md +4 -3
- package/docs/en/parts/donut-chart.md +72 -0
- package/docs/en/parts/funnel-steps.md +2 -1
- package/docs/en/parts/heatmap.md +53 -0
- package/docs/en/parts/kpi-card.md +2 -1
- package/docs/en/parts/legend.md +35 -0
- package/docs/en/parts/line-chart.md +94 -0
- package/docs/en/parts/progress-circle.md +33 -0
- package/docs/en/parts/sample-data.md +39 -0
- package/docs/en/parts/scatter-chart.md +56 -0
- package/docs/en/parts/tracker.md +36 -0
- package/docs/en/parts/updated-at.md +30 -0
- package/docs/en/parts/waterfall-chart.md +56 -0
- package/docs/en/slide/slide-chart-full.md +48 -0
- package/docs/en/slide/slide-chart-insight.md +52 -0
- package/docs/en/slide/slide-columns.md +46 -0
- package/docs/en/slide/slide-comparison.md +68 -0
- package/docs/en/slide/slide-cover.md +39 -0
- package/docs/en/slide/slide-exec-summary.md +47 -0
- package/docs/en/slide/slide-heading.md +38 -0
- package/docs/en/slide/slide-kpi-grid.md +55 -0
- package/docs/en/slide/slide-kpi-hero.md +58 -0
- package/docs/en/slide/slide-next-actions.md +49 -0
- package/docs/en/slide/slide-scorecard-table.md +54 -0
- package/docs/en/slide/slide-section.md +44 -0
- package/docs/en/slide/slide-source-line.md +34 -0
- package/docs/en/ui/alert-dialog.md +42 -0
- package/docs/en/ui/avatar.md +31 -0
- package/docs/en/ui/combobox.md +74 -0
- package/docs/en/ui/drawer.md +41 -0
- package/docs/en/ui/empty.md +1 -1
- package/docs/en/ui/error-state.md +4 -3
- package/docs/en/ui/field.md +42 -0
- package/docs/en/ui/hover-card.md +21 -0
- package/docs/en/ui/kbd.md +17 -0
- package/docs/en/ui/loading.md +1 -1
- package/docs/en/ui/pagination.md +36 -0
- package/docs/en/ui/radio-group.md +21 -0
- package/docs/en/ui/toast.md +44 -0
- package/docs/en/ui/toggle-group.md +4 -3
- package/docs/index.json +857 -77
- package/docs/ja/agent-skills.md +1 -1
- package/docs/ja/changelog.md +2 -0
- package/docs/ja/components.md +12 -1
- package/docs/ja/doc/delta-text.md +40 -0
- package/docs/ja/doc/doc-action-items.md +49 -0
- package/docs/ja/doc/doc-callout.md +38 -0
- package/docs/ja/doc/doc-data-table.md +60 -0
- package/docs/ja/doc/doc-executive-summary.md +64 -0
- package/docs/ja/doc/doc-figure.md +56 -0
- package/docs/ja/doc/doc-key-findings.md +61 -0
- package/docs/ja/doc/doc-kpi-scorecard.md +80 -0
- package/docs/ja/doc/doc-notes-and-sources.md +43 -0
- package/docs/ja/doc/doc-report-header.md +46 -0
- package/docs/ja/page-types/slide.md +1 -0
- package/docs/ja/pages-and-metadata.md +15 -0
- package/docs/ja/parts/area-chart.md +49 -25
- package/docs/ja/parts/bar-chart.md +50 -24
- package/docs/ja/parts/bar-list.md +31 -8
- package/docs/ja/parts/chart-frame.md +36 -0
- package/docs/ja/parts/delta.md +5 -4
- package/docs/ja/parts/donut-chart.md +45 -26
- package/docs/ja/parts/funnel-steps.md +27 -8
- package/docs/ja/parts/heatmap.md +45 -0
- package/docs/ja/parts/kpi-card.md +2 -1
- package/docs/ja/parts/legend.md +36 -0
- package/docs/ja/parts/line-chart.md +48 -22
- package/docs/ja/parts/sample-data.md +61 -0
- package/docs/ja/parts/scatter-chart.md +69 -0
- package/docs/ja/parts/updated-at.md +27 -0
- package/docs/ja/parts/waterfall-chart.md +61 -0
- package/docs/ja/slide/slide-chart-full.md +48 -0
- package/docs/ja/slide/slide-chart-insight.md +52 -0
- package/docs/ja/slide/slide-columns.md +46 -0
- package/docs/ja/slide/slide-comparison.md +68 -0
- package/docs/ja/slide/slide-cover.md +39 -0
- package/docs/ja/slide/slide-exec-summary.md +47 -0
- package/docs/ja/slide/slide-heading.md +38 -0
- package/docs/ja/slide/slide-kpi-grid.md +55 -0
- package/docs/ja/slide/slide-kpi-hero.md +58 -0
- package/docs/ja/slide/slide-next-actions.md +49 -0
- package/docs/ja/slide/slide-scorecard-table.md +54 -0
- package/docs/ja/slide/slide-section.md +44 -0
- package/docs/ja/slide/slide-source-line.md +34 -0
- package/docs/ja/ui/empty.md +1 -1
- package/docs/ja/ui/error-state.md +4 -3
- package/docs/ja/ui/loading.md +1 -1
- package/docs/ja/ui/toggle-group.md +4 -3
- package/package.json +2 -2
- package/registry/ui/app-shell.tsx +138 -1
- package/registry/ui/area-chart.tsx +389 -104
- package/registry/ui/attention-list.tsx +177 -15
- package/registry/ui/bar-chart.tsx +386 -104
- package/registry/ui/bar-list.tsx +376 -94
- package/registry/ui/box-plot-chart.tsx +450 -116
- package/registry/ui/category-bar.tsx +292 -57
- package/registry/ui/chart-frame.tsx +301 -63
- package/registry/ui/data-table.tsx +229 -37
- package/registry/ui/date-range-picker.tsx +190 -36
- package/registry/ui/delta.tsx +181 -19
- package/registry/ui/donut-chart.tsx +385 -103
- package/registry/ui/echart.tsx +313 -58
- package/registry/ui/filter-bar.tsx +179 -20
- package/registry/ui/funnel-steps.tsx +354 -80
- package/registry/ui/heatmap.tsx +338 -71
- package/registry/ui/histogram-chart.tsx +440 -116
- package/registry/ui/kpi-card.tsx +254 -48
- package/registry/ui/legend.tsx +374 -93
- package/registry/ui/line-chart.tsx +389 -104
- package/registry/ui/multi-select.tsx +159 -9
- package/registry/ui/page-shell.tsx +148 -10
- package/registry/ui/paired-chart.tsx +394 -109
- package/registry/ui/progress-circle.tsx +205 -39
- package/registry/ui/sample-data.tsx +154 -10
- package/registry/ui/scatter-chart.tsx +436 -119
- package/registry/ui/searchable-select.tsx +145 -7
- package/registry/ui/slider.tsx +1 -1
- package/registry/ui/states.tsx +170 -13
- package/registry/ui/status-badge.tsx +201 -36
- package/registry/ui/tooltip.tsx +6 -2
- package/registry/ui/tracker.tsx +214 -42
- package/registry/ui/trend-indicator.tsx +151 -8
- package/registry/ui/updated-at.tsx +170 -16
- package/registry/ui/waterfall-chart.tsx +460 -121
- package/skills/vantage-add-feature/SKILL.md +5 -0
- package/skills/vantage-design/SKILL.md +54 -54
- package/skills/vantage-design/references/extract.md +26 -27
- package/skills/vantage-design/references/format.md +12 -172
- package/skills/vantage-design/references/presets.md +50 -110
- package/skills/vantage-pitfalls/SKILL.md +5 -0
- package/skills/vantage-slide/SKILL.md +54 -36
- package/templates/AGENTS.md +35 -18
- package/templates/agents/api.md +7 -0
- package/templates/agents/doc.md +48 -0
- package/templates/agents/page.md +59 -2
- package/templates/agents/slide.md +77 -3
- package/theme.css +23 -19
- package/dist/chunk-2ICNHUG6.js.map +0 -1
- package/dist/chunk-2N72FKLB.js.map +0 -1
- package/dist/chunk-7DZGJQ3P.js.map +0 -1
- package/dist/chunk-CEXAQQ5W.js.map +0 -1
- package/dist/chunk-HKSVYMYJ.js.map +0 -1
- package/dist/chunk-JKLLFVEU.js.map +0 -1
- package/dist/chunk-PDOBHMUQ.js.map +0 -1
- package/dist/chunk-V3LF7BE7.js.map +0 -1
- package/dist/chunk-WAMZWZJB.js.map +0 -1
- package/dist/chunk-XPQSTZUU.js.map +0 -1
- package/dist/chunk-XQUSGIDG.js.map +0 -1
|
@@ -4,6 +4,8 @@ import { HTMLAttributes, ReactNode, ComponentType, ElementType, Ref, ReactElemen
|
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
import { EChartsOption } from 'echarts';
|
|
6
6
|
export { EChartsOption } from 'echarts';
|
|
7
|
+
import { V as ValueFormat, a as DateStyle } from '../format-DihQkL1N.js';
|
|
8
|
+
export { D as DEFAULT_LOCALE, E as EMPTY_VALUE, F as FormatDateOptions, b as FormatKind, c as FormatValueOptions, M as MINUS_SIGN, f as formatDate, d as formatDateRange, e as formatDatesInText, g as formatDelta, h as formatKind, i as formatPoints, j as formatValue, t as toValueFormatter } from '../format-DihQkL1N.js';
|
|
7
9
|
import { RowData, ColumnDef, SortingState, OnChangeFn, ColumnFiltersState, PaginationState, RowSelectionState, VisibilityState, TableMeta, Table } from '@tanstack/react-table';
|
|
8
10
|
export { ColumnDef, ColumnFiltersState, PaginationState, RowSelectionState, SortingState, VisibilityState } from '@tanstack/react-table';
|
|
9
11
|
export { DateRange as RdpDateRange } from 'react-day-picker';
|
|
@@ -33,7 +35,7 @@ interface PageShellHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
33
35
|
updatedAtVariant?: UpdatedAtProps["variant"];
|
|
34
36
|
/** IANA time zone for the absolute time of `updatedAt`. Defaults to the runtime's zone. */
|
|
35
37
|
timeZone?: string;
|
|
36
|
-
/** Where the data comes from. Shown as a chip "出典:○○" on the second row. */
|
|
38
|
+
/** Where the data comes from. Shown as a chip "Source: ○○" (ja: "出典:○○") on the second row. */
|
|
37
39
|
source?: string;
|
|
38
40
|
/** The period the data covers. Shown as a chip "2026/9/23〜10/20" on the second row. */
|
|
39
41
|
period?: {
|
|
@@ -87,248 +89,6 @@ interface PageShellContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
87
89
|
}
|
|
88
90
|
declare const PageShellContent: React.ForwardRefExoticComponent<PageShellContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
89
91
|
|
|
90
|
-
/**
|
|
91
|
-
* Locale-aware number formatting shared by KPI cards, tables and charts. All
|
|
92
|
-
* shortening is delegated to `Intl.NumberFormat` (`notation: "compact"`); this
|
|
93
|
-
* module never hard-codes unit thresholds or unit strings.
|
|
94
|
-
*
|
|
95
|
-
* | `format` | input | ja-JP output |
|
|
96
|
-
* |--------------------------------------------|--------------|----------------|
|
|
97
|
-
* | `"compact"` (default) | `48_200_000` | `4,820万` |
|
|
98
|
-
* | `"number"` | `1234.567` | `1,234.57` |
|
|
99
|
-
* | `"currency"` (JPY, compact) | `48_200_000` | `¥4,820万` |
|
|
100
|
-
* | `{ type: "currency", notation: "standard" }` | `48_200_000` | `¥48,200,000` |
|
|
101
|
-
* | `{ type: "currency", currency: "USD" }` | `1234.5` | `$1,234.5` |
|
|
102
|
-
* | `"percent"` — pass a **ratio** | `0.124` | `12.4%` |
|
|
103
|
-
* | `{ type: "percent", digits: 0 }` | `0.124` | `12%` |
|
|
104
|
-
* | `"multiple"` | `1.5` | `1.5×` |
|
|
105
|
-
* | `{ type: "number", unit: "件" }` | `48_210` | `48,210件` |
|
|
106
|
-
* | `{ type: "compact", unit: "人" }` | `12_345` | `1.2万人` |
|
|
107
|
-
* | `"duration"` — pass **seconds** | `12_000` | `3時間20分` |
|
|
108
|
-
* | `{ type: "duration", durationUnit: "minute" }` | `2160` | `1.5日` |
|
|
109
|
-
*
|
|
110
|
-
* - `percent` takes a ratio (0.124 → 12.4%). Passing 12.4 renders 1,240%. The fraction
|
|
111
|
-
* digits are **fixed**, never trimmed (`PERCENT_DIGITS` = 1: 0.14 → "14.0%", never "14%"
|
|
112
|
-
* beside "11.9%"). Pass `digits` in the format to share another count across cards.
|
|
113
|
-
* - A minus sign is always U+2212 (`MINUS_SIGN`, "−1,234" / "−5.0%"), never the hyphen-minus.
|
|
114
|
-
* - `currency` defaults to JPY and to compact notation (万・億 in ja); pass
|
|
115
|
-
* `notation: "standard"` for every digit (tables, invoices). In ja-JP the yen
|
|
116
|
-
* sign is the half-width `¥`.
|
|
117
|
-
* - `unit` is a counter appended right after the number, with no space
|
|
118
|
-
* ("48,210件", "1.2万人"), for `number` / `compact` / `currency`. It is
|
|
119
|
-
* ignored for `percent` and `duration`, and for `multiple` it replaces the
|
|
120
|
-
* default `×` ("2.7倍"). Do not write it into a `valueFormatter` by hand.
|
|
121
|
-
* - Charts take the same `format` a KpiCard takes (`format="currency"`).
|
|
122
|
-
* `toValueFormatter(format)` turns it into a function for places that need
|
|
123
|
-
* one (a `valueFormatter`, table cells).
|
|
124
|
-
* - Missing values (null / undefined / NaN) render as `—` (`EMPTY_VALUE`).
|
|
125
|
-
* - Dates go through `formatDate` (`Intl.DateTimeFormat`): `"date"` → `2026/10/20`,
|
|
126
|
-
* `"datetime"` → `2026/10/20 14:30`, `"year-month"` → `2026年10月`, `"month"` → `10月`,
|
|
127
|
-
* `"year"` → `2026年`.
|
|
128
|
-
* - A period goes through `formatDateRange`: `2026/9/23〜10/20` (same year drops the end year),
|
|
129
|
-
* `2025/12/20〜2026/1/18` across years; month and day are not zero-padded.
|
|
130
|
-
*/
|
|
131
|
-
/**
|
|
132
|
-
* The kind of number a value is. Pick by what the number means, not by how
|
|
133
|
-
* long it is: `currency` for money, `percent` for a ratio, `multiple` for a
|
|
134
|
-
* factor ("1.5×"), `duration` for a length of time ("3時間20分"), `number` for
|
|
135
|
-
* exact counts in tables, `compact` (default) for large headline counts (万・億).
|
|
136
|
-
*/
|
|
137
|
-
type FormatKind = "number" | "compact" | "currency" | "percent" | "multiple" | "duration";
|
|
138
|
-
/** The unit a `duration` value is measured in. */
|
|
139
|
-
type DurationUnit = "second" | "minute" | "hour" | "day";
|
|
140
|
-
/**
|
|
141
|
-
* How to display a number: a `FormatKind` alone, or an object for digits,
|
|
142
|
-
* currency, notation and a counter. The same value is accepted by KpiCard,
|
|
143
|
-
* Delta, the charts (`format`) and `formatValue`.
|
|
144
|
-
*
|
|
145
|
-
* @example
|
|
146
|
-
* "currency" // ¥4,820万
|
|
147
|
-
* { type: "currency", notation: "standard" } // ¥48,200,000
|
|
148
|
-
* { type: "percent", digits: 1 } // 2.0%
|
|
149
|
-
* { type: "number", unit: "件" } // 48,210件
|
|
150
|
-
*/
|
|
151
|
-
type ValueFormat = FormatKind | {
|
|
152
|
-
type: FormatKind;
|
|
153
|
-
/** Fixed number of fraction digits. */
|
|
154
|
-
digits?: number;
|
|
155
|
-
/** ISO 4217 code for `currency`. Default `"JPY"`. */
|
|
156
|
-
currency?: string;
|
|
157
|
-
/** `currency` only: `"compact"` (default, 万・億) or `"standard"` (every digit). */
|
|
158
|
-
notation?: "compact" | "standard";
|
|
159
|
-
/** Counter appended after the number, e.g. `"件"`, `"人"`. Ignored for `percent` and `duration`. For `multiple` it replaces the default `×` (`"倍"` → `2.7倍`). */
|
|
160
|
-
unit?: string;
|
|
161
|
-
/** 値をこの数で割ってから整形する。例: `divisor: 100`(セント → ドル)。0 と非有限は無視。 */
|
|
162
|
-
divisor?: number;
|
|
163
|
-
/** `duration` only: the unit the value is in. Default `"second"`. Reads as "45秒" / "12分" / "3時間20分" / "1.5日" (`digits` sets the fraction digits of days). */
|
|
164
|
-
durationUnit?: DurationUnit;
|
|
165
|
-
};
|
|
166
|
-
/** Locale used when none is passed. Every function here takes a `locale` to override it. */
|
|
167
|
-
declare const DEFAULT_LOCALE = "ja-JP";
|
|
168
|
-
/** Shown in place of a missing value (null / undefined / NaN). */
|
|
169
|
-
declare const EMPTY_VALUE = "\u2014";
|
|
170
|
-
/** The minus sign every formatter writes (U+2212), so a negative never mixes with a hyphen-minus. */
|
|
171
|
-
declare const MINUS_SIGN = "\u2212";
|
|
172
|
-
/** Extra options for `formatValue`. */
|
|
173
|
-
interface FormatValueOptions {
|
|
174
|
-
/** `"auto"` (default) signs negatives only; `"exceptZero"` also writes `+` on positives (for differences). */
|
|
175
|
-
signDisplay?: "auto" | "exceptZero";
|
|
176
|
-
/** Round to this many significant digits (e.g. 3 for an estimate: 79,653,985 → 7,970万). */
|
|
177
|
-
significantDigits?: number;
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* The kind of a format, whether it was given as a string or an object. Use it
|
|
181
|
-
* to branch on the meaning of a metric (e.g. a `percent` metric compares in
|
|
182
|
-
* points) without unpacking `ValueFormat` yourself.
|
|
183
|
-
*
|
|
184
|
-
* @param format - The format as a KpiCard / chart takes it. `undefined` means the default.
|
|
185
|
-
* @returns The `FormatKind`; `"compact"` when `format` is omitted.
|
|
186
|
-
*
|
|
187
|
-
* @example
|
|
188
|
-
* formatKind("percent") // "percent"
|
|
189
|
-
* formatKind({ type: "currency", notation: "standard" }) // "currency"
|
|
190
|
-
* formatKind(undefined) // "compact"
|
|
191
|
-
*/
|
|
192
|
-
declare function formatKind(format: ValueFormat | undefined): FormatKind;
|
|
193
|
-
/**
|
|
194
|
-
* Format a number for display — KPI values, table cells, chart labels and
|
|
195
|
-
* sentences built from data (titles, summaries). See the table at the top of
|
|
196
|
-
* this module.
|
|
197
|
-
*
|
|
198
|
-
* @param value - The number. `null` / `undefined` / `NaN` render as `—`.
|
|
199
|
-
* For `percent`, a ratio (0.124 means 12.4%).
|
|
200
|
-
* @param format - How to display it. Default `"compact"`.
|
|
201
|
-
* @param locale - BCP 47 locale. Default `"ja-JP"`.
|
|
202
|
-
* @param options - `signDisplay` and `significantDigits` (rounding for estimates).
|
|
203
|
-
* @returns The display string. In ja-JP the yen sign is the half-width `¥`.
|
|
204
|
-
*
|
|
205
|
-
* @example
|
|
206
|
-
* formatValue(48_200_000, "currency") // "¥4,820万"
|
|
207
|
-
* formatValue(48_200_000, { type: "currency", notation: "standard" }) // "¥48,200,000"
|
|
208
|
-
* formatValue(0.021, "percent") // "2.1%"
|
|
209
|
-
* formatValue(0.124, "percent", "ja-JP", { signDisplay: "exceptZero" }) // "+12.4%"
|
|
210
|
-
* formatValue(79_653_985, "currency", "ja-JP", { significantDigits: 3 }) // "¥7,970万"
|
|
211
|
-
* formatValue(48_210, { type: "number", unit: "件" }) // "48,210件"
|
|
212
|
-
* formatValue(1.5, "multiple") // "1.5×"
|
|
213
|
-
* formatValue(null) // "—"
|
|
214
|
-
*/
|
|
215
|
-
declare function formatValue(value: number | null | undefined, format?: ValueFormat, locale?: string, options?: FormatValueOptions): string;
|
|
216
|
-
/**
|
|
217
|
-
* Like `formatValue`, but always signed (except zero) — for a difference
|
|
218
|
-
* between two values ("+¥530万", "−120件"). Use `formatPoints` instead for a
|
|
219
|
-
* difference between two rates.
|
|
220
|
-
*
|
|
221
|
-
* @param value - The difference (current − previous). Missing values render as `—`.
|
|
222
|
-
* @param format - Format of the metric itself. Default `"compact"`.
|
|
223
|
-
* @param locale - BCP 47 locale. Default `"ja-JP"`.
|
|
224
|
-
* @returns The signed display string; zero has no sign.
|
|
225
|
-
*
|
|
226
|
-
* @example
|
|
227
|
-
* formatDelta(5_300_000, "currency") // "+¥530万"
|
|
228
|
-
* formatDelta(-120, { type: "number", unit: "件" }) // "−120件"
|
|
229
|
-
* formatDelta(0.031, "percent") // "+3.1%"
|
|
230
|
-
* formatDelta(0, "currency") // "¥0"
|
|
231
|
-
*/
|
|
232
|
-
declare function formatDelta(value: number | null | undefined, format?: ValueFormat, locale?: string): string;
|
|
233
|
-
/**
|
|
234
|
-
* A difference between two rates in percentage points, always signed:
|
|
235
|
-
* `formatPoints(0.021 - 0.026)` → `"−0.5pt"`. Use it instead of a relative
|
|
236
|
-
* change for rate metrics (churn, conversion), where "−19.2%" reads as a drop
|
|
237
|
-
* of nineteen points. `signDisplay: "never"` drops the sign ("あと 0.5pt").
|
|
238
|
-
*
|
|
239
|
-
* @param difference - The difference of two **ratios** (0.021 − 0.026). Missing values render as `—`.
|
|
240
|
-
* @param locale - BCP 47 locale. Default `"ja-JP"`.
|
|
241
|
-
* @param options - `digits`: fixed fraction digits (default `PERCENT_DIGITS` = 1, so "0.0pt" / "+0.5pt"); `signDisplay`:
|
|
242
|
-
* `"exceptZero"` (default) or `"never"` when the sentence already says the direction.
|
|
243
|
-
* @returns The difference in points with the `pt` suffix.
|
|
244
|
-
*
|
|
245
|
-
* @example
|
|
246
|
-
* formatPoints(0.021 - 0.026) // "−0.5pt"
|
|
247
|
-
* formatPoints(0.031 - 0.026) // "+0.5pt"
|
|
248
|
-
* formatPoints(0.02 - 0.015, "ja-JP", { signDisplay: "never" }) // "0.5pt"(「目標まであと 0.5pt」)
|
|
249
|
-
*/
|
|
250
|
-
declare function formatPoints(difference: number | null | undefined, locale?: string, options?: {
|
|
251
|
-
digits?: number;
|
|
252
|
-
signDisplay?: "exceptZero" | "never";
|
|
253
|
-
}): string;
|
|
254
|
-
/**
|
|
255
|
-
* Binds a format and locale into a single-argument formatter, for a chart
|
|
256
|
-
* `valueFormatter` or a table cell: `valueFormatter={toValueFormatter("currency")}`.
|
|
257
|
-
* Prefer passing `format` to the chart directly; this is for APIs that only
|
|
258
|
-
* take a function.
|
|
259
|
-
*
|
|
260
|
-
* @param format - How to display each value. Default `"compact"`.
|
|
261
|
-
* @param locale - BCP 47 locale. Default `"ja-JP"`.
|
|
262
|
-
* @returns `(value) => string`, rendering missing values as `—`.
|
|
263
|
-
*
|
|
264
|
-
* @example
|
|
265
|
-
* const yen = toValueFormatter("currency")
|
|
266
|
-
* yen(48_200_000) // "¥4,820万"
|
|
267
|
-
* yen(null) // "—"
|
|
268
|
-
* const count = toValueFormatter({ type: "number", unit: "件" })
|
|
269
|
-
* count(48_210) // "48,210件"(表のセル)
|
|
270
|
-
*/
|
|
271
|
-
declare function toValueFormatter(format?: ValueFormat, locale?: string): (value: number | null | undefined) => string;
|
|
272
|
-
/**
|
|
273
|
-
* 日付の書式。何を表す日付かで選ぶ: 日単位は `"date"`、時刻まで要るなら `"datetime"`、
|
|
274
|
-
* 月次の集計は `"year-month"`(年をまたぐ軸)か `"month"`(同じ年の中の軸)、年次は `"year"`。
|
|
275
|
-
*/
|
|
276
|
-
type DateStyle = "date" | "datetime" | "month" | "year-month" | "year";
|
|
277
|
-
/** `formatDate` の追加オプション。 */
|
|
278
|
-
interface FormatDateOptions {
|
|
279
|
-
/**
|
|
280
|
-
* IANA のタイムゾーン名(例: `"Asia/Tokyo"`)。既定は実行環境のタイムゾーン。
|
|
281
|
-
* サーバーとブラウザで描画が食い違う(SSR)なら固定する。日付だけの文字列(`"2026-10-20"`)には効かず、常にその暦日のまま出す。
|
|
282
|
-
*/
|
|
283
|
-
timeZone?: string;
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* 日付を表示用の文字列にする。表のセル・タイトル・文に埋める日付に使い、`toLocaleString` や手組みの
|
|
287
|
-
* `getMonth() + 1` は使わない。
|
|
288
|
-
*
|
|
289
|
-
* @param value - `Date`、エポックミリ秒、または日付文字列(`"2026-10-20"`、ISO 8601)。`null` / `undefined` / 解釈できない値は `—`。
|
|
290
|
-
* @param style - 何を表す日付か。既定 `"date"`。
|
|
291
|
-
* @param locale - BCP 47 ロケール。既定 `"ja-JP"`。
|
|
292
|
-
* @param options - `timeZone`。
|
|
293
|
-
* @returns 表示文字列。
|
|
294
|
-
*
|
|
295
|
-
* @example
|
|
296
|
-
* formatDate("2026-10-20") // "2026/10/20"
|
|
297
|
-
* formatDate(new Date("2026-10-20T05:30:00Z"), "datetime", "ja-JP", { timeZone: "Asia/Tokyo" }) // "2026/10/20 14:30"
|
|
298
|
-
* formatDate("2026-10-01", "year-month") // "2026年10月"
|
|
299
|
-
* formatDate("2026-10-01", "month") // "10月"
|
|
300
|
-
* formatDate(null) // "—"
|
|
301
|
-
*/
|
|
302
|
-
declare function formatDate(value: Date | string | number | null | undefined, style?: DateStyle, locale?: string, options?: FormatDateOptions): string;
|
|
303
|
-
/** `formatDateRange` のオプション。 */
|
|
304
|
-
interface FormatDateRangeOptions extends FormatDateOptions {
|
|
305
|
-
/** BCP 47 ロケール。既定 `"ja-JP"`。 */
|
|
306
|
-
locale?: string;
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* 期間を「2026/9/23〜10/20」の形にする。同じ年なら終了側の年を省き、年をまたぐときは両方に付ける。
|
|
310
|
-
* 月日はゼロ詰めしない。区切りは日本語で「〜」、それ以外のロケールでは「 – 」。始まりと終わりが同じ日なら 1 日だけ出す。
|
|
311
|
-
*
|
|
312
|
-
* @param start - 期間の最初の日(`Date`、エポックミリ秒、日付文字列)。`"2026-09-23"` のような日付だけの文字列はその暦日のまま出す。
|
|
313
|
-
* @param end - 期間の最後の日。
|
|
314
|
-
* @param options - `locale` と `timeZone`。
|
|
315
|
-
* @returns 表示文字列。どちらかが解釈できなければ `—`。
|
|
316
|
-
*
|
|
317
|
-
* @example
|
|
318
|
-
* formatDateRange("2026-09-23", "2026-10-20") // "2026/9/23〜10/20"
|
|
319
|
-
* formatDateRange("2025-12-20", "2026-01-18") // "2025/12/20〜2026/1/18"
|
|
320
|
-
*/
|
|
321
|
-
declare function formatDateRange(start: Date | string | number | null | undefined, end: Date | string | number | null | undefined, options?: FormatDateRangeOptions): string;
|
|
322
|
-
/**
|
|
323
|
-
* 文中の ISO の年月・日付(`2023-04`、`2026-10-20`)を `formatDate` の書式に置き換える。期間や出典の注記のように、
|
|
324
|
-
* 利用者が文字列で渡す文に日付が混ざるときの表示用(`"2023-04 以降"` → `"2023年4月 以降"`)。日付でない数字は触らない。
|
|
325
|
-
*
|
|
326
|
-
* @param text - 日付を含みうる文。
|
|
327
|
-
* @param locale - BCP 47 ロケール。既定 `"ja-JP"`。
|
|
328
|
-
* @returns ISO の年月は `"year-month"`、年月日は `"date"` で整形した文。
|
|
329
|
-
*/
|
|
330
|
-
declare function formatDatesInText(text: string, locale?: string): string;
|
|
331
|
-
|
|
332
92
|
/**
|
|
333
93
|
* Shared data shapes for the composite dashboard components. Kept in one place
|
|
334
94
|
* so filters, metrics and date pickers agree on the same vocabulary.
|
|
@@ -772,9 +532,10 @@ declare const EChart: React.ForwardRefExoticComponent<EChartProps & React.RefAtt
|
|
|
772
532
|
* the baseline is a non-zero number; small moves inside the neutral band read
|
|
773
533
|
* as flat, and polarity decides whether up is good or bad.
|
|
774
534
|
*
|
|
775
|
-
* Labels
|
|
776
|
-
* a monthly KPI compares "
|
|
777
|
-
* "
|
|
535
|
+
* Labels come from the grain of the period, in the locale's language (`<html lang>` unless a
|
|
536
|
+
* `locale` is passed): a monthly KPI compares "vs. prior month" / "vs. same month last year"
|
|
537
|
+
* (ja: "前月比" / "前年同月比"), a quarterly one "前四半期比" / "前年同期比" in ja. Without a
|
|
538
|
+
* grain the label is the generic "vs. prior period" (ja: "前期比").
|
|
778
539
|
*
|
|
779
540
|
* A running total of a period still in progress (年初来・月初来 = YTD / MTD) sets
|
|
780
541
|
* `toDate: true`: a `prior-year` baseline is then the same stretch of the prior year,
|
|
@@ -815,18 +576,24 @@ type Comparison = (ComparisonBase & {
|
|
|
815
576
|
/** The badge's full name: `"昨日比"` / `"先週の同じ曜日比"`. The previous-actual line drops one trailing "比" ("昨日 617"). */
|
|
816
577
|
label: string;
|
|
817
578
|
});
|
|
818
|
-
/**
|
|
579
|
+
/**
|
|
580
|
+
* Labels used when the grain is unknown, in English (the fallback language). A `custom` comparison always brings
|
|
581
|
+
* its own `label`. The parts pick the language from `<html lang>` (`comparisonLabel`): ja reads "前期比" / "前年同期比" / "目標比".
|
|
582
|
+
*/
|
|
819
583
|
declare const COMPARISON_LABELS: Record<Exclude<ComparisonKind, "custom">, string>;
|
|
820
584
|
/**
|
|
821
|
-
* What the previous value is called: "
|
|
822
|
-
*
|
|
585
|
+
* What the previous value is called: "prior month" / "same month last year" / "target" (ja: "前月" / "前年同月" / "目標");
|
|
586
|
+
* with a `label`, that label minus its comparison word ("昨日比" → "昨日", "vs. yesterday" → "yesterday").
|
|
587
|
+
* `toDate` (a running total such as YTD) turns a `prior-year` baseline into "same period last year" (ja: "前年同期") whatever the grain.
|
|
588
|
+
* `locale` picks the language; default the page's (`<html lang>`).
|
|
823
589
|
*/
|
|
824
|
-
declare function comparisonBaseline(vs: ComparisonKind, grain?: PeriodGrain, label?: string, toDate?: boolean): string;
|
|
590
|
+
declare function comparisonBaseline(vs: ComparisonKind, grain?: PeriodGrain, label?: string, toDate?: boolean, locale?: string): string;
|
|
825
591
|
/**
|
|
826
|
-
* The comparison label: "前月比" for `("prior-period", "month")`, "
|
|
827
|
-
* A running total (`toDate`) against the prior year is "
|
|
592
|
+
* The comparison label: "vs. prior month" (ja: "前月比") for `("prior-period", "month")`, "vs. prior period" (ja: "前期比")
|
|
593
|
+
* without a grain; a given `label` as is. A running total (`toDate`) against the prior year is "vs. same period last year"
|
|
594
|
+
* (ja: "前年同期比"), not "vs. prior year" (ja: "前年比"). `locale` picks the language; default the page's (`<html lang>`).
|
|
828
595
|
*/
|
|
829
|
-
declare function comparisonLabel(vs: ComparisonKind, grain?: PeriodGrain, label?: string, toDate?: boolean): string;
|
|
596
|
+
declare function comparisonLabel(vs: ComparisonKind, grain?: PeriodGrain, label?: string, toDate?: boolean, locale?: string): string;
|
|
830
597
|
type DeltaDirection = "up" | "down" | "flat" | "none";
|
|
831
598
|
type DeltaSentiment = "positive" | "negative" | "neutral";
|
|
832
599
|
interface ComparisonResult {
|
|
@@ -845,6 +612,8 @@ interface ComparisonOptions {
|
|
|
845
612
|
polarity?: Polarity;
|
|
846
613
|
/** Absolute ratio below which the change reads as flat (0.01 = 1%). Default 0.01. */
|
|
847
614
|
neutralBand?: number;
|
|
615
|
+
/** Locale of the derived `label`. Default the page's (`<html lang>`). */
|
|
616
|
+
locale?: string;
|
|
848
617
|
}
|
|
849
618
|
declare function computeComparison(current: number | null | undefined, comparison: Comparison, options?: ComparisonOptions): ComparisonResult;
|
|
850
619
|
/**
|
|
@@ -2001,7 +1770,7 @@ interface DataTableExportProps {
|
|
|
2001
1770
|
* <DataTableExport scope="page" />
|
|
2002
1771
|
*/
|
|
2003
1772
|
scope?: CsvScope;
|
|
2004
|
-
/**
|
|
1773
|
+
/** ボタンの文言。既定はページの言語で `"CSV を書き出す"`(英語は `"Export CSV"`)。 */
|
|
2005
1774
|
children?: ReactNode;
|
|
2006
1775
|
className?: string;
|
|
2007
1776
|
}
|
|
@@ -2062,13 +1831,15 @@ declare function toCsv(header: string[], rows: CsvCell[][], options?: {
|
|
|
2062
1831
|
}): string;
|
|
2063
1832
|
/**
|
|
2064
1833
|
* 表の現在の状態から CSV を作る。行は画面と同じ並べ替え・絞り込み後の順、列は表示中の列のみ。
|
|
1834
|
+
* `"display"` の書式のロケールは `locale`(既定はページのロケール、`<html lang>`)。
|
|
2065
1835
|
*
|
|
2066
1836
|
* @example
|
|
2067
1837
|
* const csv = tableToCsv(table, { values: "raw", scope: "page" })
|
|
2068
1838
|
*/
|
|
2069
|
-
declare function tableToCsv<TData>(table: Table<TData>, { values, scope }?: {
|
|
1839
|
+
declare function tableToCsv<TData>(table: Table<TData>, { values, scope, locale: localeArg }?: {
|
|
2070
1840
|
values?: CsvValues;
|
|
2071
1841
|
scope?: CsvScope;
|
|
1842
|
+
locale?: string;
|
|
2072
1843
|
}): string;
|
|
2073
1844
|
/** toolbar に置く CSV 書き出しボタン。`useDataTable()` の table から画面と同じ順・同じ集合を書き出す。 */
|
|
2074
1845
|
declare function DataTableExport({ fileName, values, scope, children, className, }: DataTableExportProps): React.JSX.Element;
|
|
@@ -2127,7 +1898,7 @@ declare namespace FilterBarActiveChips {
|
|
|
2127
1898
|
var displayName: string;
|
|
2128
1899
|
}
|
|
2129
1900
|
interface FilterBarClearButtonProps {
|
|
2130
|
-
/** Override the button label. Defaults to "クリア". */
|
|
1901
|
+
/** Override the button label. Defaults to "Clear" (ja: "クリア"). */
|
|
2131
1902
|
label?: string;
|
|
2132
1903
|
className?: string;
|
|
2133
1904
|
}
|
|
@@ -2148,7 +1919,11 @@ declare namespace FilterBarPreset {
|
|
|
2148
1919
|
var displayName: string;
|
|
2149
1920
|
}
|
|
2150
1921
|
|
|
2151
|
-
/**
|
|
1922
|
+
/**
|
|
1923
|
+
* フォールバック(`en-US`:英語・1 月始まり・日曜始まり)のプリセット。DateRangePicker は `presets` を渡さなければ
|
|
1924
|
+
* ページのロケールからプリセットを作るので、これを渡す必要はない。`locale` / `fiscalYearStartMonth` を変えるなら
|
|
1925
|
+
* `createDatePresets` か DateRangePicker の同名 props。
|
|
1926
|
+
*/
|
|
2152
1927
|
declare const defaultPresets: PresetItem[];
|
|
2153
1928
|
interface DateRangePickerProps {
|
|
2154
1929
|
/**
|
|
@@ -2174,16 +1949,16 @@ interface DateRangePickerProps {
|
|
|
2174
1949
|
presets?: PresetItem[];
|
|
2175
1950
|
showPresets?: boolean;
|
|
2176
1951
|
/**
|
|
2177
|
-
*
|
|
2178
|
-
*
|
|
1952
|
+
* プリセットのラベル・日付の書式・カレンダーの月名と曜日・週の始まりのロケール。`ja*` なら日本語、それ以外は英語。
|
|
1953
|
+
* 既定はページのロケール(`<html lang>`、無ければ `"en-US"`)。
|
|
2179
1954
|
*
|
|
2180
1955
|
* @example
|
|
2181
1956
|
* <DateRangePicker locale="ja-JP" />
|
|
2182
1957
|
*/
|
|
2183
1958
|
locale?: string;
|
|
2184
1959
|
/**
|
|
2185
|
-
* 年度の開始月(1-12
|
|
2186
|
-
*
|
|
1960
|
+
* 年度の開始月(1-12)。「今年度」「前年度」と、年度基準の「今四半期」「前四半期」の区切りになる。
|
|
1961
|
+
* 既定はロケールで決まる(ja は `4`、それ以外は `1`)。範囲外・整数でない値はその既定として扱う。
|
|
2187
1962
|
*
|
|
2188
1963
|
* @example
|
|
2189
1964
|
* <DateRangePicker fiscalYearStartMonth={1} />
|
|
@@ -2311,8 +2086,9 @@ declare const RECORD_MIN_POINTS = 6;
|
|
|
2311
2086
|
/**
|
|
2312
2087
|
* The latest point is a record when it beats every earlier finite point:
|
|
2313
2088
|
* strictly highest for higher-is-better, strictly lowest for lower-is-better.
|
|
2089
|
+
* `locale` picks the language of `label` ("Highest in 12 months" / "過去 12 か月で最高"); default the page's (`<html lang>`).
|
|
2314
2090
|
*/
|
|
2315
|
-
declare function detectRecord(history: ReadonlyArray<number | null | undefined> | null | undefined, grain?: PeriodGrain, polarity?: Polarity): RecordInsight | null;
|
|
2091
|
+
declare function detectRecord(history: ReadonlyArray<number | null | undefined> | null | undefined, grain?: PeriodGrain, polarity?: Polarity, locale?: string): RecordInsight | null;
|
|
2316
2092
|
|
|
2317
2093
|
interface KpiCardSource {
|
|
2318
2094
|
/** Period the data covers (e.g. "2023-04 以降"). ISO year-months / dates in it are written by the card ("2023年4月 以降"). */
|
|
@@ -2337,11 +2113,11 @@ interface KpiCardProps extends Omit<ComponentProps<"div">, "children"> {
|
|
|
2337
2113
|
value: number | null | undefined;
|
|
2338
2114
|
/**
|
|
2339
2115
|
* Value format, also used for previous / target / remaining. Default `"compact"`.
|
|
2340
|
-
* `"currency"` is JPY in
|
|
2116
|
+
* `"currency"` is JPY in 万・億 on a ja page (USD in K・M・B otherwise); `"percent"` takes a ratio (0.021 → 2.1%) and
|
|
2341
2117
|
* switches the delta to points. See `formatValue` for the full table.
|
|
2342
2118
|
*/
|
|
2343
2119
|
format?: ValueFormat;
|
|
2344
|
-
/** Default `"
|
|
2120
|
+
/** Locale of the numbers and the built-in wording. Default: the page's (`<html lang>`, else `"en-US"`). */
|
|
2345
2121
|
locale?: string;
|
|
2346
2122
|
/**
|
|
2347
2123
|
* What the value is compared against; drives the delta (tier 3) and previous line (tier 4).
|
|
@@ -2361,7 +2137,9 @@ interface KpiCardProps extends Omit<ComponentProps<"div">, "children"> {
|
|
|
2361
2137
|
provisional?: boolean | {
|
|
2362
2138
|
label?: string;
|
|
2363
2139
|
};
|
|
2364
|
-
/**
|
|
2140
|
+
/** Which direction is good: `"up"` (default) or `"down"` (churn, error rate). Wins over `polarity`. */
|
|
2141
|
+
betterWhen?: "up" | "down";
|
|
2142
|
+
/** @deprecated Older name of `betterWhen` (`"higher-is-better"` / `"lower-is-better"`). `"neutral"` (never colours the change, skips the target and record logic) is only reachable here. `betterWhen` wins if both are given. */
|
|
2365
2143
|
polarity?: Polarity;
|
|
2366
2144
|
/** `"relative"` ("+12.4%"), `"points"` ("-0.5pt") or `"difference"` ("+¥530万", in `format`). Default: points for a `percent` format, else relative. */
|
|
2367
2145
|
change?: ChangeDisplay;
|
|
@@ -2374,7 +2152,7 @@ interface KpiCardProps extends Omit<ComponentProps<"div">, "children"> {
|
|
|
2374
2152
|
/**
|
|
2375
2153
|
* Target for the current period. Under the value it adds a 6px bar (actual, the pace
|
|
2376
2154
|
* projection, a tick at the target) and one line "目標の 49%・このペースなら 98%"
|
|
2377
|
-
* (the projection only while `period` is in progress). With `
|
|
2155
|
+
* (the projection only while `period` is in progress). With `betterWhen="down"`
|
|
2378
2156
|
* or a rate target (points) there is no bar: "目標 … まであと …" in the footer.
|
|
2379
2157
|
*/
|
|
2380
2158
|
target?: number;
|
|
@@ -2437,7 +2215,7 @@ interface KpiCardProps extends Omit<ComponentProps<"div">, "children"> {
|
|
|
2437
2215
|
*/
|
|
2438
2216
|
declare function fillKpiTemplate(template: string, values: Readonly<Record<string, string | null | undefined>>): string;
|
|
2439
2217
|
declare function fillKpiTemplate(template: string, values: Readonly<Record<string, string | null | undefined>>, fallback: string | null): string | null;
|
|
2440
|
-
declare function KpiCard({ label, value, format, locale, comparison: comparisonProp, comparisons, provisional, polarity, change, neutralBand, showPrevious, summary, target, targetLabel, targetDisplay, period, history, historyGrain, showHistory, source, updatedAt, updatedAtDisplay, timeZone, now, isLoading, size, className, ...props }: KpiCardProps): React.JSX.Element;
|
|
2218
|
+
declare function KpiCard({ label, value, format, locale: localeProp, comparison: comparisonProp, comparisons, provisional, betterWhen, polarity: polarityProp, change, neutralBand, showPrevious, summary, target, targetLabel, targetDisplay, period, history, historyGrain, showHistory, source, updatedAt, updatedAtDisplay, timeZone, now, isLoading, size, className, ...props }: KpiCardProps): React.JSX.Element;
|
|
2441
2219
|
|
|
2442
2220
|
declare const deltaVariants: (props?: ({
|
|
2443
2221
|
variant?: "inline" | "badge" | null | undefined;
|
|
@@ -2448,7 +2226,9 @@ interface DeltaProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children">,
|
|
|
2448
2226
|
value: number | null | undefined;
|
|
2449
2227
|
/** What the value is compared against. Required so the delta always carries its label. */
|
|
2450
2228
|
comparison: Comparison;
|
|
2451
|
-
/**
|
|
2229
|
+
/** Which direction is good: `"up"` (default) or `"down"` (churn, error rate). Wins over `polarity`. */
|
|
2230
|
+
betterWhen?: "up" | "down";
|
|
2231
|
+
/** @deprecated Older name of `betterWhen` (`"higher-is-better"` / `"lower-is-better"`); `"neutral"` is only reachable here. `betterWhen` wins if both are given. */
|
|
2452
2232
|
polarity?: Polarity;
|
|
2453
2233
|
/** Absolute ratio below which the change reads as flat (0.01 = 1%). Default 0.01. */
|
|
2454
2234
|
neutralBand?: number;
|
|
@@ -2464,7 +2244,7 @@ interface DeltaProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children">,
|
|
|
2464
2244
|
* 同じカード群で桁がばらつかないよう、全部に同じ値を渡す。未指定は 1 桁("+14.0%")。`"points"` は未指定のとき `format.digits` に従う。
|
|
2465
2245
|
*/
|
|
2466
2246
|
digits?: number;
|
|
2467
|
-
/** Locale for the change. Default `"
|
|
2247
|
+
/** Locale for the change and its label. Default: the page's (`<html lang>`, else `"en-US"`). */
|
|
2468
2248
|
locale?: string;
|
|
2469
2249
|
/** Show the comparison label ("前月比") after the change. Default true. */
|
|
2470
2250
|
showLabel?: boolean;
|
|
@@ -2507,7 +2287,11 @@ interface PlaceholderProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
2507
2287
|
}
|
|
2508
2288
|
declare const Placeholder: React.ForwardRefExoticComponent<PlaceholderProps & React.RefAttributes<HTMLSpanElement>>;
|
|
2509
2289
|
|
|
2510
|
-
|
|
2290
|
+
/**
|
|
2291
|
+
* The mark's wording in English (the fallback language). Without a `label`, the mark follows the page's
|
|
2292
|
+
* language (`<html lang>`): ja reads「見本の値」.
|
|
2293
|
+
*/
|
|
2294
|
+
declare const DEFAULT_SAMPLE_LABEL: string;
|
|
2511
2295
|
interface SampleState {
|
|
2512
2296
|
label: string;
|
|
2513
2297
|
}
|
|
@@ -2521,15 +2305,15 @@ declare function SampleClaim({ children }: {
|
|
|
2521
2305
|
children?: ReactNode;
|
|
2522
2306
|
}): React.JSX.Element;
|
|
2523
2307
|
interface SampleBadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
2524
|
-
/**
|
|
2308
|
+
/** 印の文言。既定はページの言語で「見本の値」(英語は "Sample data")。 */
|
|
2525
2309
|
label?: string;
|
|
2526
2310
|
}
|
|
2527
2311
|
declare function SampleBadge({ label, className, ...props }: SampleBadgeProps): React.JSX.Element;
|
|
2528
2312
|
interface SampleDataProps {
|
|
2529
|
-
/**
|
|
2313
|
+
/** 印の文言。既定はページの言語で「見本の値」(英語は "Sample data")。 */
|
|
2530
2314
|
label?: string;
|
|
2531
2315
|
children?: ReactNode;
|
|
2532
2316
|
}
|
|
2533
2317
|
declare function SampleData({ label, children }: SampleDataProps): React.JSX.Element;
|
|
2534
2318
|
|
|
2535
|
-
export { AppShell, type AppShellHeaderProps, type AppShellProps, type AppShellSidebarProps, AreaChart, type AreaChartProps, BarChart, type BarChartProps, BarList, type BarListItem, type BarListOptions, type BarListProps, type BarListSortOrder, COMPARISON_LABELS, CategoryBar, type CategoryBarMarker, type CategoryBarProps, type ChangeDisplay, type ChartActionsOptions, type ChartAnnotation, type ChartColor, type ChartColorToken, type ChartColors, type ChartCommonProps, type ChartComparison, type ChartEmptyState, type ChartEventPayload, type ChartForecast, type ChartForecastRow, ChartFrame, type ChartFrameProps, type ChartHighlight, type ChartRootAttributes, type ChartSeriesColor, type ChartSkeletonVariant, type ChartThreshold, type ChartTone, type Comparison, type ComparisonKind, type ComparisonOptions, type ComparisonResult,
|
|
2319
|
+
export { AppShell, type AppShellHeaderProps, type AppShellProps, type AppShellSidebarProps, AreaChart, type AreaChartProps, BarChart, type BarChartProps, BarList, type BarListItem, type BarListOptions, type BarListProps, type BarListSortOrder, COMPARISON_LABELS, CategoryBar, type CategoryBarMarker, type CategoryBarProps, type ChangeDisplay, type ChartActionsOptions, type ChartAnnotation, type ChartColor, type ChartColorToken, type ChartColors, type ChartCommonProps, type ChartComparison, type ChartEmptyState, type ChartEventPayload, type ChartForecast, type ChartForecastRow, ChartFrame, type ChartFrameProps, type ChartHighlight, type ChartRootAttributes, type ChartSeriesColor, type ChartSkeletonVariant, type ChartThreshold, type ChartTone, type Comparison, type ComparisonKind, type ComparisonOptions, type ComparisonResult, DEFAULT_SAMPLE_LABEL, DELTA_NOT_COMPARABLE, DashboardCard, DashboardCardAction, type DashboardCardActionProps, DashboardCardContent, type DashboardCardContentProps, DashboardCardDescription, type DashboardCardDescriptionProps, DashboardCardFooter, type DashboardCardFooterProps, DashboardCardHeader, type DashboardCardHeaderProps, DashboardCardPreset, type DashboardCardPresetProps, type DashboardCardProps, DashboardCardSkeleton, type DashboardCardSkeletonProps, DashboardCardTitle, type DashboardCardTitleProps, DataTable, DataTableColumnVisibility, type DataTableColumnVisibilityProps, DataTableContent, type DataTableContentProps, DataTableExport, type DataTableExportProps, DataTablePagination, type DataTablePaginationProps, DataTablePreset, type DataTablePresetProps, type DataTableProps, DataTableToolbar, type DataTableToolbarProps, type DateRange, DateRangePicker, type DateRangePickerProps, DateStyle, Delta, type DeltaDirection, type DeltaProps, type DeltaSentiment, DonutChart, type DonutChartOptions, type DonutChartProps, type DonutVariant, EChart, type EChartProps, FilterBar, FilterBarActiveChips, type FilterBarActiveChipsProps, FilterBarClearButton, type FilterBarClearButtonProps, FilterBarMultiSelect, type FilterBarMultiSelectProps, FilterBarPreset, type FilterBarPresetProps, type FilterBarProps, FilterBarSelect, type FilterBarSelectProps, type FilterConfig, type FilterOption, type FilterType, type FilterValues, type FunnelStep, FunnelSteps, type FunnelStepsProps, Heatmap, type HeatmapProps, type HistoryGrain, KpiCard, type KpiCardProps, type KpiCardSource, type KpiPeriod, Legend, type LegendProps, LineChart, type LineChartProps, type MetricItem, MetricUnit, type MetricUnitProps, MetricValue, type MetricValueProps, type MetricVariant, MultiSelect, type MultiSelectProps, type NavGroup, type NavItem, type NumericKeys, PageShell, PageShellActions, type PageShellActionsProps, PageShellContent, type PageShellContentProps, PageShellDescription, type PageShellDescriptionProps, PageShellHeader, PageShellHeaderEnd, type PageShellHeaderEndProps, type PageShellHeaderProps, PageShellHeading, type PageShellHeadingProps, PageShellMeta, type PageShellMetaProps, type PageShellProps, PageShellSummary, PageShellSummaryCard, type PageShellSummaryCardProps, type PageShellSummaryProps, PageShellTitle, type PageShellTitleProps, type PeriodGrain, Placeholder, type PlaceholderProps, type Polarity, type PresetItem, ProgressCircle, type ProgressCircleProps, RECORD_MIN_POINTS, type RecordInsight, SampleBadge, type SampleBadgeProps, SampleClaim, SampleData, type SampleDataProps, ScatterChart, type ScatterChartProps, type ScatterReferenceLine, SearchableSelect, type SearchableSelectProps, SectionHeader, type SectionHeaderProps, type SegmentOption, SegmentedControl, type SegmentedControlProps, type SelectOption, type SelectOptionGroup, type SelectOptions, Sparkline, type SparklineDataPoint, type SparklineProps, type SparklineVariant, StatusBadge, type StatusBadgeProps, type TargetProgress, Tracker, type TrackerBlock, type TrackerProps, type TrendDirection, TrendIndicator, type TrendIndicatorProps, UpdatedAt, type UpdatedAtProps, ValueFormat, type ValueFormatter, WaterfallChart, type WaterfallChartProps, type WaterfallMode, comparisonBaseline, comparisonLabel, computeComparison, computeTargetProgress, defaultChangeDisplay, defaultPresets, deltaVariants, detectRecord, fillKpiTemplate, flattenOptions, formatChange, formatChangeAmount, formatRelativeTime, funnelStepsVariants, inferPeriodGrain, isGroupedOptions, metricValueVariants, pageShellSummaryCardVariants, tableToCsv, toCsv, toneForValue, useDataTable, useResolvedChartColors, useSampleMark };
|
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
export { AppShell, AreaChart, BarChart, BarList, COMPARISON_LABELS, CategoryBar, ChartFrame,
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export { AppShell, AreaChart, BarChart, BarList, COMPARISON_LABELS, CategoryBar, ChartFrame, DEFAULT_SAMPLE_LABEL, DELTA_NOT_COMPARABLE, DashboardCard, DashboardCardAction, DashboardCardContent, DashboardCardDescription, DashboardCardFooter, DashboardCardHeader, DashboardCardPreset, DashboardCardSkeleton, DashboardCardTitle, DataTable, DataTableColumnVisibility, DataTableContent, DataTableExport, DataTablePagination, DataTablePreset, DataTableToolbar, DateRangePicker, Delta, DonutChart, FilterBar, FilterBarActiveChips, FilterBarClearButton, FilterBarMultiSelect, FilterBarPreset, FilterBarSelect, FunnelSteps, Heatmap, KpiCard, Legend, LineChart, MetricUnit, MetricValue, MultiSelect, PageShell, PageShellActions, PageShellContent, PageShellDescription, PageShellHeader, PageShellHeaderEnd, PageShellHeading, PageShellMeta, PageShellSummary, PageShellSummaryCard, PageShellTitle, Placeholder, ProgressCircle, RECORD_MIN_POINTS, SampleBadge, SampleClaim, SampleData, ScatterChart, SearchableSelect, SectionHeader, SegmentedControl, StatusBadge, Tracker, TrendIndicator, UpdatedAt, WaterfallChart, comparisonBaseline, comparisonLabel, computeComparison, computeTargetProgress, defaultChangeDisplay, defaultPresets, deltaVariants, detectRecord, fillKpiTemplate, flattenOptions, formatChange, formatChangeAmount, formatRelativeTime, funnelStepsVariants, inferPeriodGrain, isGroupedOptions, metricValueVariants, pageShellSummaryCardVariants, tableToCsv, toCsv, toneForValue, useDataTable, useSampleMark } from '../chunk-77CISBMG.js';
|
|
2
|
+
export { EChart, useResolvedChartColors } from '../chunk-EG4PX726.js';
|
|
3
|
+
export { Sparkline } from '../chunk-2IAPIOPS.js';
|
|
4
|
+
export { DEFAULT_LOCALE, EMPTY_VALUE, MINUS_SIGN, formatDate, formatDateRange, formatDatesInText, formatDelta, formatKind, formatPoints, formatValue, toValueFormatter } from '../chunk-3RJEOP3J.js';
|
|
5
|
+
import '../chunk-QNOX7WLZ.js';
|
|
6
|
+
import '../chunk-ROHNXP7J.js';
|
|
4
7
|
import '../chunk-U736PVHY.js';
|
|
5
8
|
//# sourceMappingURL=index.js.map
|
|
6
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { V as ValueFormat } from './format-DihQkL1N.js';
|
|
3
|
+
|
|
4
|
+
interface DeltaTextProps {
|
|
5
|
+
/** The change itself; its direction comes from the sign. `null` shows "—". */
|
|
6
|
+
value: number | null;
|
|
7
|
+
format?: ValueFormat;
|
|
8
|
+
/** Which way is good. Default `"up"`. */
|
|
9
|
+
betterWhen?: "up" | "down";
|
|
10
|
+
/** Name of the comparison, e.g. "前月比". Printed before the change; omit to print only the change. */
|
|
11
|
+
comparisonLabel?: string;
|
|
12
|
+
/** Locale of the value and the screen-reader text. Default the page's (`<html lang>`). */
|
|
13
|
+
locale?: string;
|
|
14
|
+
}
|
|
15
|
+
declare function DeltaText({ value, format, betterWhen, comparisonLabel, locale: localeProp }: DeltaTextProps): React.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { DeltaText as D, type DeltaTextProps as a };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { runDiagnostics } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import { vantagePlugin } from './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
1
|
+
import { runDiagnostics } from './chunk-PJ4SPXHS.js';
|
|
2
|
+
import './chunk-UWSQUHX6.js';
|
|
3
|
+
import { vantagePlugin } from './chunk-SDJTTMLK.js';
|
|
4
|
+
import './chunk-SHZM3EXB.js';
|
|
5
|
+
import './chunk-S5MDTHH7.js';
|
|
6
6
|
import { scanProject, timedAsync } from './chunk-RNTDBX6S.js';
|
|
7
7
|
import './chunk-46QI6GFC.js';
|
|
8
8
|
import './chunk-B7LLBNLV.js';
|
|
@@ -77,5 +77,5 @@ async function dev(root, args) {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
export { dev };
|
|
80
|
-
//# sourceMappingURL=dev-
|
|
81
|
-
//# sourceMappingURL=dev-
|
|
80
|
+
//# sourceMappingURL=dev-O42JFQ64.js.map
|
|
81
|
+
//# sourceMappingURL=dev-O42JFQ64.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/dev.ts"],"names":[],"mapp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EAAA,CAAG,UAAU,QAAQ,CAAA;AAC7B,EAAA,OAAA,CAAQ,EAAA,CAAG,WAAW,QAAQ,CAAA;AAG9B,EAAA,OAAO,IAAI,QAAgB,MAAM;AAAA,EAAC,CAAC,CAAA;AACrC","file":"dev-O42JFQ64.js","sourcesContent":["import { createServer, loadEnv } from \"vite\"\nimport { runDiagnostics } from \"../core/diagnostics\"\nimport { timedAsync } from \"../core/profile\"\nimport { scanProject } from \"../core/scan\"\nimport { vantagePlugin } from \"../vite/index\"\nimport {\n applyApiBaseUrlFlag,\n log,\n printDiagnostics,\n reportPortInUse,\n resolveDraftPreview,\n resolveHmrOverlay,\n resolveHostOptions,\n resolvePortOptions,\n type ParsedArgs,\n} from \"./util\"\n\n/** `vantage dev` — start the dev server with HMR and the optional API server. */\nexport async function dev(root: string, args: ParsedArgs): Promise<number> {\n const model = scanProject(root)\n const errors = runDiagnostics(root, model).filter((d) => d.severity === \"error\")\n if (errors.length) {\n printDiagnostics(errors)\n log.error(\"Fix the errors above before starting the dev server.\")\n return 1\n }\n\n const mode = \"development\"\n applyApiBaseUrlFlag(args)\n const env = { ...process.env, ...loadEnv(mode, root, \"\") }\n const ports = resolvePortOptions(args.flags, 5173)\n if (!ports.ok) {\n log.error(ports.error)\n return 1\n }\n const { port, strictPort } = ports\n const hosts = resolveHostOptions(args.flags)\n if (!hosts.ok) {\n log.error(hosts.error)\n return 1\n }\n const overlay = resolveHmrOverlay(args.flags)\n\n const server = await timedAsync(\"vite:createServer\", () =>\n createServer({\n configFile: false,\n root,\n mode,\n // The model was just scanned for diagnostics; hand it over so the plugin\n // does not walk the project again.\n plugins: [vantagePlugin({ root, env, model, draftPreview: resolveDraftPreview(args.flags) })],\n // `host` / `allowedHosts` are only present when asked for, and `hmr` is\n // left alone unless the overlay is being turned off, so Vite's own\n // defaults (host, port, protocol) keep applying.\n server: {\n port,\n strictPort,\n ...hosts.options,\n ...(overlay ? {} : { hmr: { overlay: false } }),\n },\n clearScreen: false,\n }),\n )\n\n try {\n await timedAsync(\"vite:listen\", () => server.listen())\n } catch (err) {\n await server.close().catch(() => {})\n if (reportPortInUse(err, port, strictPort)) return 1\n throw err\n }\n log.brand(\"dev server ready\")\n server.printUrls()\n if (model.hasServer) log.info(\" \" + \"server/api enabled\")\n\n const shutdown = async () => {\n await server.close()\n process.exit(0)\n }\n process.on(\"SIGINT\", shutdown)\n process.on(\"SIGTERM\", shutdown)\n\n // Keep the process alive; the listening server owns the lifecycle.\n return new Promise<number>(() => {})\n}\n"]}
|