@seanyeh77/ui 0.39.0 → 0.41.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/dist/bundle.js +19 -19
- package/dist/bundle.js.map +1 -1
- package/dist/{format-entry-BJI8MU2K.d.ts → format-entry-CgMBtkni.d.ts} +4 -0
- package/dist/{format-entry-C7iBqN3J.js → format-entry-CyChe8bk.js} +24 -6
- package/dist/format-entry-CyChe8bk.js.map +1 -0
- package/dist/format.d.ts +1 -1
- package/dist/format.js +1 -1
- package/dist/index.d.ts +64 -26
- package/dist/index.js +1152 -519
- package/dist/index.js.map +1 -1
- package/dist/styles.css +900 -683
- package/dist/tokens.css +74 -19
- package/docs/AccentPicker.md +17 -2
- package/docs/ActionBar.md +6 -4
- package/docs/AiMark.md +12 -6
- package/docs/Alert.md +17 -5
- package/docs/AppShell.md +20 -11
- package/docs/Badge.md +20 -9
- package/docs/BarChart.md +21 -3
- package/docs/Breadcrumb.md +9 -4
- package/docs/Button.md +18 -8
- package/docs/Calendar.md +10 -5
- package/docs/Card.md +17 -9
- package/docs/Checkbox.md +15 -4
- package/docs/CodeView.md +16 -13
- package/docs/CommandPalette.md +18 -10
- package/docs/ConsoleLayout.md +25 -3
- package/docs/DangerZone.md +9 -3
- package/docs/DataColors.md +11 -4
- package/docs/DataTable.md +77 -28
- package/docs/DatePicker.md +16 -2
- package/docs/DateRangePicker.md +13 -1
- package/docs/DetailList.md +17 -12
- package/docs/Dialog.md +11 -6
- package/docs/Drawer.md +13 -7
- package/docs/EmptyState.md +13 -1
- package/docs/ErrorPage.md +6 -0
- package/docs/EventTimeline.md +11 -5
- package/docs/FileUpload.md +21 -5
- package/docs/FormGrid.md +11 -2
- package/docs/Format.md +19 -1
- package/docs/Graph.md +17 -2
- package/docs/Grid.md +13 -4
- package/docs/IconButton.md +16 -13
- package/docs/InlineCode.md +18 -8
- package/docs/KpiCard.md +21 -7
- package/docs/LayerGraph.md +36 -23
- package/docs/LineChart.md +22 -1
- package/docs/LoadingBar.md +7 -1
- package/docs/LoginCard.md +19 -3
- package/docs/Markdown.md +18 -2
- package/docs/Menu.md +13 -7
- package/docs/Meter.md +12 -5
- package/docs/MobileTabBar.md +18 -2
- package/docs/MultiSelect.md +13 -3
- package/docs/NotificationBell.md +13 -3
- package/docs/Popover.md +12 -2
- package/docs/ProgressBar.md +8 -2
- package/docs/ProgressRing.md +8 -2
- package/docs/ProjectSwitcher.md +15 -9
- package/docs/RadioGroup.md +21 -3
- package/docs/SearchField.md +8 -2
- package/docs/Section.md +16 -4
- package/docs/SegmentedControl.md +21 -19
- package/docs/Select.md +16 -1
- package/docs/SettingsLayout.md +19 -4
- package/docs/SideNav.md +20 -2
- package/docs/Skeleton.md +7 -1
- package/docs/SplitPane.md +7 -1
- package/docs/StatusBand.md +12 -6
- package/docs/Suggestion.md +12 -5
- package/docs/Switch.md +15 -2
- package/docs/Tabs.md +25 -6
- package/docs/Tag.md +16 -12
- package/docs/Term.md +18 -1
- package/docs/TextArea.md +12 -1
- package/docs/TextField.md +15 -5
- package/docs/ThemePicker.md +16 -4
- package/docs/TimeControl.md +10 -5
- package/docs/Toast.md +13 -3
- package/docs/Tooltip.md +17 -5
- package/docs/TopBar.md +16 -3
- package/docs/Tour.md +25 -1
- package/docs/TreeList.md +16 -9
- package/docs/Workbench.md +12 -6
- package/docs/ZoneMap.md +17 -9
- package/docs/code.md +28 -0
- package/docs/data.md +45 -0
- package/docs/forms.md +29 -0
- package/docs/guidelines.md +56 -307
- package/docs/layout.md +24 -4
- package/docs/monitoring.md +30 -0
- package/docs/motion.md +1 -1
- package/docs/theme.md +104 -0
- package/package.json +3 -3
- package/dist/format-entry-C7iBqN3J.js.map +0 -1
|
@@ -31,6 +31,9 @@ declare function money(v: number, o?: {
|
|
|
31
31
|
}): string;
|
|
32
32
|
/** Bytes to 「186 KB」「54.9 MB」「1.2 GB」. */
|
|
33
33
|
declare function fileSize(b: number | null | undefined): string;
|
|
34
|
+
/** Seconds as a clock-style length: under 1 h 「46:42」「1:30」 (minutes not zero-padded), 1 h or more 「1:54:49」.
|
|
35
|
+
* Rounded to the second. Negative, NaN or missing: 「—」. */
|
|
36
|
+
declare function duration(seconds: number | null | undefined): string;
|
|
34
37
|
/** Shortens a path: keeps the first segment and the last two, 「src/…/hooks/ops.c:58」. */
|
|
35
38
|
declare function path(p: string | null | undefined, o?: {
|
|
36
39
|
head?: number;
|
|
@@ -57,6 +60,7 @@ declare const format: {
|
|
|
57
60
|
compact: typeof compact;
|
|
58
61
|
money: typeof money;
|
|
59
62
|
fileSize: typeof fileSize;
|
|
63
|
+
duration: typeof duration;
|
|
60
64
|
path: typeof path;
|
|
61
65
|
fraction: typeof fraction;
|
|
62
66
|
fractionLabel: typeof fractionLabel;
|
|
@@ -31,7 +31,7 @@ const I18N = {
|
|
|
31
31
|
"已選 {n} 筆": "{n} selected",
|
|
32
32
|
帳號: "Username",
|
|
33
33
|
強調色: "Accent color",
|
|
34
|
-
|
|
34
|
+
忘記密碼: "Forgot password",
|
|
35
35
|
找不到符合的選項: "No matching options",
|
|
36
36
|
"拖放檔案,或 ": "Drop files here, or ",
|
|
37
37
|
搜尋: "Search",
|
|
@@ -54,6 +54,13 @@ const I18N = {
|
|
|
54
54
|
全螢幕: "Full screen",
|
|
55
55
|
離開全螢幕: "Exit full screen",
|
|
56
56
|
側欄: "Side panel",
|
|
57
|
+
更多表格操作: "More table actions",
|
|
58
|
+
還原預設: "Restore defaults",
|
|
59
|
+
已還原預設的欄位與欄寬: "Columns and widths restored to defaults",
|
|
60
|
+
套用的篩選: "Applied filters",
|
|
61
|
+
"移除篩選:{name}": "Remove filter: {name}",
|
|
62
|
+
"篩選,已套用 {n} 個條件": "Filter, {n} conditions applied",
|
|
63
|
+
"{name}:{value}": "{name}: {value}",
|
|
57
64
|
時間控制: "Time control",
|
|
58
65
|
沒有事件: "No events",
|
|
59
66
|
人工: "Manual",
|
|
@@ -446,7 +453,7 @@ function compact(v, like) {
|
|
|
446
453
|
if (Math.abs(ref) < 1e4) return number(v);
|
|
447
454
|
if (/^zh/i.test(I18N.locale)) {
|
|
448
455
|
const a = Math.abs(ref);
|
|
449
|
-
const [unit, div, maxDec] = a >=
|
|
456
|
+
const [unit, div, maxDec] = Math.round(a / 1e3) >= 1e5 ? [
|
|
450
457
|
"億",
|
|
451
458
|
1e8,
|
|
452
459
|
2
|
|
@@ -504,7 +511,7 @@ function money(v, o = {}) {
|
|
|
504
511
|
return new Intl.NumberFormat(I18N.locale, {
|
|
505
512
|
style: "currency",
|
|
506
513
|
currency: cur,
|
|
507
|
-
currencyDisplay: "narrowSymbol",
|
|
514
|
+
currencyDisplay: cur === "TWD" ? "symbol" : "narrowSymbol",
|
|
508
515
|
minimumFractionDigits: 0,
|
|
509
516
|
maximumFractionDigits: cur === "TWD" || cur === "JPY" ? 0 : 2
|
|
510
517
|
}).format(v);
|
|
@@ -512,10 +519,20 @@ function money(v, o = {}) {
|
|
|
512
519
|
/** Bytes to 「186 KB」「54.9 MB」「1.2 GB」. */
|
|
513
520
|
function fileSize(b) {
|
|
514
521
|
if (b == null || Number.isNaN(b)) return "";
|
|
515
|
-
if (b <
|
|
516
|
-
if (b <
|
|
522
|
+
if (Math.round(b / 1024) < 1024) return number(b === 0 ? 0 : Math.max(1, Math.round(b / 1024))) + " KB";
|
|
523
|
+
if (Math.round(b / 1048576 * 10) < 10240) return number(b / 1048576, 1) + " MB";
|
|
517
524
|
return number(b / 1073741824, 1) + " GB";
|
|
518
525
|
}
|
|
526
|
+
/** Seconds as a clock-style length: under 1 h 「46:42」「1:30」 (minutes not zero-padded), 1 h or more 「1:54:49」.
|
|
527
|
+
* Rounded to the second. Negative, NaN or missing: 「—」. */
|
|
528
|
+
function duration(seconds) {
|
|
529
|
+
if (seconds == null || Number.isNaN(seconds) || seconds < 0 || !Number.isFinite(seconds)) return "—";
|
|
530
|
+
const t = Math.round(seconds);
|
|
531
|
+
const h = Math.floor(t / 3600);
|
|
532
|
+
const m = Math.floor(t % 3600 / 60);
|
|
533
|
+
const s = t % 60;
|
|
534
|
+
return h ? `${h}:${pad2(m)}:${pad2(s)}` : `${m}:${pad2(s)}`;
|
|
535
|
+
}
|
|
519
536
|
/** Shortens a path: keeps the first segment and the last two, 「src/…/hooks/ops.c:58」. */
|
|
520
537
|
function path(p, o = {}) {
|
|
521
538
|
const head = o.head ?? 1;
|
|
@@ -556,6 +573,7 @@ const format = {
|
|
|
556
573
|
compact,
|
|
557
574
|
money,
|
|
558
575
|
fileSize,
|
|
576
|
+
duration,
|
|
559
577
|
path,
|
|
560
578
|
fraction,
|
|
561
579
|
fractionLabel
|
|
@@ -571,4 +589,4 @@ const sameDay = (a, b) => !!a && !!b && a.getFullYear() === b.getFullYear() && a
|
|
|
571
589
|
const dayAdd = (d, n) => new Date(d.getFullYear(), d.getMonth(), d.getDate() + n);
|
|
572
590
|
export { parseDate as a, addMessages as c, unitFor as d, format as i, setLocale as l, fileSize as n, sameDay as o, fmtDate as r, I18N as s, dayAdd as t, tr as u };
|
|
573
591
|
|
|
574
|
-
//# sourceMappingURL=format-entry-
|
|
592
|
+
//# sourceMappingURL=format-entry-CyChe8bk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-entry-CyChe8bk.js","names":[],"sources":["../src/i18n.ts","../src/format.ts"],"sourcesContent":["/* ---------- i18n and formats ----------\n Every built-in string is the zh-TW text passed through tr(); other languages come from UI.addMessages().\n Dates and numbers go through UI.format, which uses Intl for the current locale. The zh-TW rules are the\n ones the design system chose; other locales use their own conventions from Intl. */\ninterface I18nState {\n locale: string;\n currency: string;\n messages: Record<string, Record<string, string>>;\n}\n\nexport const I18N: I18nState = {\n locale: 'zh-TW',\n currency: 'TWD',\n messages: {\n en: {\n 'Email 或帳號': 'Email or username',\n '{label}:{a} 到 {b}': '{label}: {a} to {b}',\n '{n} 個百分點': '{n} pts',\n 上一頁: 'Previous page',\n 上個月: 'Previous month',\n '上傳失敗,請再試一次。': 'Upload failed. Try again.',\n 下一頁: 'Next page',\n 下個月: 'Next month',\n 主要導覽: 'Main navigation',\n 主題: 'Theme',\n 今天: 'Today',\n 全選: 'Select all',\n 全部: 'All',\n 全部標為已讀: 'Mark all as read',\n '共 {n} 筆': '{n} items',\n 分頁: 'Pagination',\n 刪除: 'Delete',\n 危險操作: 'Danger zone',\n 取消選取: 'Clear selection',\n '可以直接輸入,例如 2026/11/14': 'Type a date, e.g. 2026/11/14',\n 回上一頁: 'Go back',\n 回首頁: 'Go home',\n '完成 ✓': 'Done ✓',\n 密碼: 'Password',\n 展開側邊欄: 'Expand sidebar',\n '已選 {n} 筆': '{n} selected',\n 帳號: 'Username',\n 強調色: 'Accent color',\n 忘記密碼: 'Forgot password',\n 找不到符合的選項: 'No matching options',\n '拖放檔案,或 ': 'Drop files here, or ',\n 搜尋: 'Search',\n 操作: 'Actions',\n 收合側邊欄: 'Collapse sidebar',\n 釘選側邊欄: 'Pin sidebar',\n 取消釘選: 'Unpin sidebar',\n 放棄: 'Discard',\n '放棄未儲存的變更?': 'Discard unsaved changes?',\n '{label}?': '{label}?',\n '{name} 上傳進度': 'Upload progress of {name}',\n 左右方向鍵查看每一項的數值: 'Use ← and → to read each value',\n 左右方向鍵查看每一個時間點的數值: 'Use ← and → to read each point',\n 左右方向鍵移動播放頭: 'Use ← and → to move the playhead',\n 現在: 'Now',\n 預測: 'Forecast',\n 回到現在: 'Back to now',\n 回放: 'Replay',\n 停止回放: 'Stop replay',\n 全螢幕: 'Full screen',\n 離開全螢幕: 'Exit full screen',\n 側欄: 'Side panel',\n 更多表格操作: 'More table actions',\n 還原預設: 'Restore defaults',\n 已還原預設的欄位與欄寬: 'Columns and widths restored to defaults',\n 套用的篩選: 'Applied filters',\n '移除篩選:{name}': 'Remove filter: {name}',\n '篩選,已套用 {n} 個條件': 'Filter, {n} conditions applied',\n '{name}:{value}': '{name}: {value}',\n 時間控制: 'Time control',\n 沒有事件: 'No events',\n 人工: 'Manual',\n 切換: 'Switch',\n 告警: 'Alert',\n '{v}({t})': '{v} ({t})',\n 這段時間沒有資料: 'No data for this period',\n 沒有資料: 'No data',\n 差: 'Difference',\n 正常: 'Normal',\n '⚠ 注意': '⚠ Watch',\n '⚠ 超過上限': '⚠ Over limit',\n '注意 {v}': 'Watch {v}',\n '上限 {v}': 'Limit {v}',\n '新增「{q}」': 'Add “{q}”',\n '日期格式不正確,請寫成 2026/11/14': 'Invalid date. Use 2026/11/14.',\n 更多操作: 'More actions',\n 更多: 'More',\n 左右滑動: 'Scroll sideways',\n 跳到主要內容: 'Skip to main content',\n 說明: 'Explain',\n 開啟導覽: 'Open navigation',\n 顯示方式: 'View',\n 顯示線上文字: 'Show line labels',\n 線上文字: 'Line labels',\n 圖: 'Diagram',\n 清單: 'List',\n 項目: 'Items',\n 關係: 'Relations',\n 已展開: 'Expanded',\n 已收合: 'Collapsed',\n '已展開,{n} 個子項目': 'Expanded, {n} items',\n '顯示 {n} 筆': 'Showing {n} rows',\n 排序: 'Sort',\n '排序:{list}': 'Sort: {list}',\n 由小到大: 'ascending',\n 由大到小: 'descending',\n '依 {list} 排序': 'Sorted by {list}',\n ',再依 ': ', then by ',\n '、': ', ',\n 已還原原本的順序: 'Back to the original order',\n '{name},第 {n} 排序,{dir}': '{name}, sort level {n}, {dir}',\n '「{name}」第 {n} 排序;按 Alt+↑ ↓ 調整順序': '{name}, sort level {n}. Alt+Up or Down moves it',\n '「{name}」的方向': 'Direction of {name}',\n '移除「{name}」排序': 'Remove the sort by {name}',\n '照資料原本的順序。': 'In the original order.',\n '再依…': 'Then by…',\n '排序依據…': 'Sort by…',\n 再依哪一欄: 'Then by which column',\n 依哪一欄排序: 'Sort by which column',\n '最多 {n} 層排序。': 'Up to {n} sort levels.',\n '找到 {n} 筆結果': '{n} results',\n '第 {a} 步,共 {b} 步': 'Step {a} of {b}',\n '說明 {name}': 'Explain {name}',\n 程式碼: 'Code',\n '第 {n} 行': 'Line {n}',\n '第 {n} 層': 'Level {n}',\n 第一行: 'First line',\n 最後一行: 'Last line',\n '上 20 行': '20 lines up',\n '下 20 行': '20 lines down',\n 上一段: 'Previous section',\n 下一段: 'Next section',\n '上一行/下一行': 'Previous / next line',\n '上一個/下一個連結': 'Previous / next link',\n '上一個/下一個名詞': 'Previous / next term',\n '上一個/下一個連結或名詞': 'Previous / next link or term',\n 回到這一行: 'Back to the line',\n 開啟: 'Open',\n '{name},第 {n} 行': '{name}, line {n}',\n '顯示 {n} 筆,另有 {m} 筆,請輸入更長的字': 'Showing {n}, {m} more: type more to narrow it down',\n '縮排 {n} 格': 'indented {n} spaces',\n '縮排 {n} 個 tab': 'indented {n} tabs',\n '縮排 {a} 個 tab、{b} 格': 'indented {a} tabs and {b} spaces',\n 向右捲動: 'Scroll right',\n 筆: 'rows',\n '1 筆': '1 row',\n // Separators: full-width in Chinese, ASCII and a space in English.\n ',': ', ',\n ':': ': ',\n '。': '. ',\n '來自 {from},{label}': 'From {from}, {label}',\n '{from} 到 {to},{what}': '{from} to {to}, {what}',\n 到: 'to',\n '{label}({inferred})': '{label} ({inferred})',\n 調整面板寬度: 'Resize the panel',\n 調整架構圖高度: 'Resize the diagram height',\n '調整「{name}」欄寬': 'Resize the column {name}',\n 放大表格: 'Enlarge the table',\n 表格: 'Table',\n '{n} px': '{n} px',\n '主要區域 {a} px,面板 {b} px': 'Main area {a} px, panel {b} px',\n 'repo 外': 'outside the repo',\n 詳細: 'Details',\n '展開 {name}': 'Expand {name}',\n '收合 {name}': 'Collapse {name}',\n 字: 'characters',\n 'C 語言': 'C',\n 程式語言: 'Language',\n 全部頁面: 'All pages',\n '最近 30 天': 'Last 30 days',\n '最近 7 天': 'Last 7 days',\n 期間: 'Period',\n 未讀: 'Unread',\n 本月: 'This month',\n 沒有符合的資料: 'No matching data',\n 沒有通知: 'No notifications',\n 清除: 'Clear',\n 清除搜尋: 'Clear search',\n 登入: 'Sign in',\n 發生錯誤: 'Something went wrong',\n '移除 {name}': 'Remove {name}',\n '第 {a}–{b} 筆,共 {n} 筆': '{a}–{b} of {n}',\n 繼續編輯: 'Keep editing',\n '自訂強調色(色碼)': 'Custom accent color (hex)',\n '色碼格式不正確,例如 #2457d6': 'Invalid hex, e.g. #2457d6',\n 設定分類: 'Settings sections',\n 請輸入密碼: 'Enter your password',\n 請輸入帳號: 'Enter your username',\n 請選擇: 'Select',\n 路徑: 'Breadcrumb',\n 較上週: 'vs last week',\n 載入中: 'Loading',\n '輸入 # 加 6 碼': 'Enter # and 6 digits',\n 通知: 'Notifications',\n '通知,{n} 則未讀': 'Notifications, {n} unread',\n '選取第 {n} 筆': 'Select row {n}',\n 選擇日期: 'Choose date',\n 選擇期間: 'Choose period',\n 選擇檔案: 'choose files',\n 重試: 'Retry',\n 開啟日曆: 'Open calendar',\n 關閉: 'Close',\n '關閉後,剛才的修改不會保留。': 'If you close now, your changes will be lost.',\n 關閉提示: 'Dismiss',\n 鍵盤操作: 'Keyboard',\n 顯示或關閉這份說明: 'Show or hide this list',\n 檔案總管: 'Explorer',\n 右側欄: 'Side bar',\n 下方面板: 'Panel',\n 有新內容: 'New content',\n '更多分頁({n} 個)': 'More tabs ({n})',\n '更多 {n}': '{n} more',\n 位置不變: 'Same place',\n 放開以排在這裡: 'Drop to place it here',\n '放開以移到{region}': 'Drop to move to the {region}',\n '把目前分頁移到{region}': 'Move this tab to the {region}',\n '收合{region}': 'Hide the {region}',\n '關閉{region}': 'Close the {region}',\n '{region}寬度': '{region} width',\n '{region}高度': '{region} height',\n 面板高度: 'Panel height',\n 面板分頁: 'Panel tabs',\n 目前分頁往左移: 'Move this tab left',\n 目前分頁往右移: 'Move this tab right',\n 收起面板: 'Hide the panel',\n 編輯器: 'Editor',\n 開始: 'Start',\n 'AI 說明': 'AI note',\n 'AI 撰寫': 'AI-written',\n '({v})': ' ({v})',\n 隱藏密碼: 'Hide password',\n 顯示密碼: 'Show password',\n '(今天)': ' (today)',\n 伺服器暫時無法回應: 'The server is not responding',\n 找不到這個頁面: 'Page not found',\n 沒有權限查看這個頁面: 'You do not have access to this page',\n '網址可能打錯了,或這個頁面已經移除。': 'The address may be wrong, or the page has been removed.',\n '這個問題已經記錄下來,請稍後重新整理再試。': 'The problem has been logged. Refresh the page later.',\n '請向管理員申請權限,或切換成有權限的帳號。': 'Ask an admin for access, or switch to an account that has it.',\n 自動: 'Auto',\n 淺色: 'Light',\n 深色: 'Dark',\n 藍: 'Blue',\n 靛: 'Indigo',\n 紫: 'Purple',\n 桃紅: 'Pink',\n 紅: 'Red',\n 橘: 'Orange',\n 綠: 'Green',\n 青: 'Teal',\n 草稿: 'Draft',\n 進行中: 'In progress',\n 審核中: 'In review',\n 完成: 'Done',\n 失敗: 'Failed',\n 檢視: 'Views',\n '{n} / {total} 筆': '{n} / {total}',\n '{n} / {total} {unit}': '{n} / {total} {unit}',\n '{n} / {total}': '{n} / {total}',\n '{total} {unit}中的 {n} {unit}': '{n} of {total} {unit}',\n '{total} 中的 {n}': '{n} of {total}',\n 欄位: 'Columns',\n 顯示的欄位: 'Visible columns',\n 清除篩選: 'Clear filters',\n 清除全部: 'Clear all',\n 篩選: 'Filter',\n 最低: 'Min',\n 最高: 'Max',\n '合計 {n} 筆': 'Total: {n}',\n 平均: 'Avg',\n '選取 {name}': 'Select {name}',\n '{n} 個新': '{n} new',\n '{n} 個檔案': '{n} files',\n '下載 {name}': 'Download {name}',\n '已選 {n} 個檔案': '{n} files selected',\n '共 {size}': '{size} total',\n 清除選取: 'Clear selection',\n 下載: 'Download',\n 全部展開: 'Expand all',\n 全部收合: 'Collapse all',\n 這裡還沒有檔案: 'No files here yet',\n 顯示全部: 'Show all',\n 收合: 'Show less',\n 依狀態篩選: 'Filter by status',\n 展開: 'Expand',\n 沒有項目: 'Nothing here',\n 即時: 'Live',\n 已過期: 'Stale',\n 離線: 'Offline',\n 切換專案: 'Switch project',\n '切換專案,目前是 {name}': 'Switch project, now {name}',\n 推測: 'Inferred',\n '{n} 個項目': '{n} items',\n '1 個項目': '1 item',\n '{a} 個項目使用,共 {b} 次': 'Used {b} times by {a} items',\n 共用項目: 'Shared',\n 次數越多線越粗: 'Thicker lines mean more often',\n 架構圖: 'Architecture',\n '{n} 次': '{n} calls',\n '1 次': '1 call',\n 原始碼: 'Source',\n '顯示全部 {n} 行': 'Show all {n} lines',\n '只顯示第 {n} 行前後': 'Show only around line {n}',\n '無法載入 {name} 的子項目': 'Could not load the children of {name}',\n '找不到符合「{q}」的結果': 'No results for “{q}”',\n 輸入名稱開始搜尋: 'Type a name to search',\n 搜尋中: 'Searching',\n 搜尋結果: 'Search results',\n 最近開啟: 'Recently opened',\n 選擇: 'Select',\n 打開: 'Open',\n 取消: 'Cancel',\n 略過: 'Skip',\n 上一步: 'Back',\n 下一步: 'Next',\n 建議修正: 'Suggested fix',\n 複製修正: 'Copy fix',\n 已複製: 'Copied',\n 複製程式碼: 'Copy code',\n '原本:': 'Before: ',\n '改成:': 'After: ',\n 關閉說明: 'Close explanation',\n ',有說明': ', has an explanation',\n '(說明)': ' (explain)',\n '搜尋({k})': 'Search ({k})',\n 確定的關係: 'Confirmed',\n 推測的關係: 'Inferred',\n 專案宣告的關係: 'Declared by the project',\n 宣告: 'Declared',\n 外部項目: 'External',\n },\n },\n};\n\nfunction msgsFor(loc: string): Record<string, string> | null {\n return I18N.messages[loc] || I18N.messages[loc.split('-')[0]] || null;\n}\n\n/** Translates a built-in zh-TW string into the current locale; {name} placeholders take vars. */\nexport function tr(key: string, vars?: Record<string, string | number>): string {\n // zh-TW (and zh-Hant) is the source text; other Chinese locales (zh-CN) use the messages an app adds for them.\n const m = isZhTW() ? null : msgsFor(I18N.locale);\n const out = m?.[key] ?? key;\n return vars ? out.replace(/\\{(\\w+)\\}/g, (a, k: string) => (vars[k] !== undefined ? String(vars[k]) : a)) : out;\n}\n\n/** A count's unit: a function gets the count (for plurals, 「1 row」「2 rows」); a string goes through tr(), and for 1\n * the message 「1 <unit>」 is used when the locale has one (「1 筆」 → 「1 row」), without the number. */\nexport type CountUnit = string | ((n: number) => string);\nexport function unitFor(unit: CountUnit | undefined, n: number): string {\n if (!unit) return '';\n if (typeof unit === 'function') return unit(n);\n if (n === 1) {\n const one = tr('1 ' + unit);\n if (one !== '1 ' + unit) return one.replace(/^1\\s*/, '');\n }\n return tr(unit);\n}\n\n/** Switches the interface language and, optionally, the currency used by format.money. */\nexport function setLocale(locale: string, opts?: { currency?: string }): void {\n I18N.locale = locale || 'zh-TW';\n if (opts?.currency) I18N.currency = opts.currency;\n if (typeof document !== 'undefined') document.documentElement.setAttribute('lang', I18N.locale);\n}\n\n/** Adds or overrides translations for a locale. Keys are the zh-TW strings. */\nexport function addMessages(locale: string, dict: Record<string, string>): void {\n I18N.messages[locale] = { ...I18N.messages[locale], ...dict };\n}\n\nexport const isZhTW = (): boolean => /^zh-(TW|Hant)/i.test(I18N.locale);\n","import { I18N, isZhTW, tr } from './i18n';\n\n/* Dates and numbers for the current locale (setLocale). zh-TW follows the design system's rules\n (2026/11/04(三), 24-hour clock, NT$ 1,280, 萬 and 億 in KPI cards); other locales use Intl's conventions. */\n\nexport type Decimals = number | 'money' | 'percent' | 'size' | 'count';\n\nconst DECIMALS = { money: 0, percent: 1, size: 1, count: 0 } as const;\n\nconst pad2 = (n: number): string => String(n).padStart(2, '0');\n\nfunction locale(): string {\n return I18N.locale;\n}\n\n/** zh-TW: 2026/11/04(三). Other locales: their short date with weekday. */\nfunction date(d: Date | null | undefined, o: { weekday?: boolean; long?: boolean } = {}): string {\n if (!d) return '';\n const wd = o.weekday !== false;\n if (o.long) return new Intl.DateTimeFormat(I18N.locale, { year: 'numeric', month: 'long', day: 'numeric', weekday: wd ? 'long' : undefined }).format(d);\n if (isZhTW()) return fmtDate(d) + (wd ? `(${new Intl.DateTimeFormat('zh-TW', { weekday: 'narrow' }).format(d)})` : '');\n return new Intl.DateTimeFormat(I18N.locale, { year: 'numeric', month: '2-digit', day: '2-digit', weekday: wd ? 'short' : undefined }).format(d);\n}\n\n/** zh-TW: 24-hour 15:57. Other locales: their own clock. */\nfunction time(d: Date | null | undefined): string {\n if (!d) return '';\n return new Intl.DateTimeFormat(\n I18N.locale,\n isZhTW() ? { hour: '2-digit', minute: '2-digit', hourCycle: 'h23' } : { hour: 'numeric', minute: '2-digit' },\n ).format(d);\n}\n\nfunction dateTime(d: Date | null | undefined, o?: { weekday?: boolean }): string {\n return d ? `${date(d, o)} ${time(d)}` : '';\n}\n\n/** Within 7 days: 「2 小時前」、「昨天」. Older: full date and time. Pass now to test. */\nfunction relative(d: Date | null | undefined, now: Date = new Date()): string {\n if (!d) return '';\n const s = (now.getTime() - d.getTime()) / 1000;\n if (s < 0 || s >= 604800) return dateTime(d);\n const rt = new Intl.RelativeTimeFormat(I18N.locale, { numeric: 'auto' });\n if (s < 60) return rt.format(0, 'second');\n if (s < 3600) return rt.format(-Math.floor(s / 60), 'minute');\n if (s < 86400) return rt.format(-Math.floor(s / 3600), 'hour');\n return rt.format(-Math.floor(s / 86400), 'day');\n}\n\nfunction month(d: Date): string {\n return new Intl.DateTimeFormat(I18N.locale, { year: 'numeric', month: 'long' }).format(d);\n}\n\n/** Week starts on Sunday for zh-TW; other locales use Intl's week info when the browser has it. */\nfunction firstDay(): number {\n if (isZhTW()) return 0;\n try {\n const l = new Intl.Locale(I18N.locale) as Intl.Locale & { getWeekInfo?: () => { firstDay: number }; weekInfo?: { firstDay: number } };\n const w = l.getWeekInfo ? l.getWeekInfo() : l.weekInfo;\n if (w?.firstDay) return w.firstDay % 7;\n } catch {\n /* older browsers have no week info */\n }\n return 0;\n}\n\n/** Narrow weekday names, starting from firstDay(). */\nfunction weekdays(): string[] {\n const fd = firstDay();\n const f = new Intl.DateTimeFormat(I18N.locale, { weekday: 'narrow' });\n // 2026/11/01 is a Sunday.\n return Array.from({ length: 7 }, (_, i) => f.format(new Date(2026, 10, 1 + ((fd + i) % 7))));\n}\n\n/** Decimals by unit: money 0, percent 1, size 1, count 0; pass a number to force it. */\nfunction number(v: number, dec?: Decimals): string {\n const dd = typeof dec === 'number' ? dec : dec ? DECIMALS[dec] : 0;\n return new Intl.NumberFormat(I18N.locale, { minimumFractionDigits: dd, maximumFractionDigits: dd }).format(v);\n}\n\nfunction percent(v: number, dec = 1): string {\n return new Intl.NumberFormat(I18N.locale, { style: 'percent', minimumFractionDigits: dec, maximumFractionDigits: dec }).format(v / 100);\n}\n\n/** Only KPI cards abbreviate: 1,284 萬 in zh-TW (萬、億), 12.8M in English.\n * like: format v with the unit and decimals that `like` gets, so a counting KPI keeps its width. */\nfunction compact(v: number, like?: number): string {\n const ref = like ?? v;\n if (Math.abs(ref) < 1e4) return number(v);\n if (/^zh/i.test(I18N.locale)) {\n const a = Math.abs(ref);\n // 99,999,999 rounds to 10,000.0 萬: write it as 1 億.\n const [unit, div, maxDec] = Math.round(a / 1e3) >= 1e5 ? (['億', 1e8, 2] as const) : (['萬', 1e4, 1] as const);\n const finalStr = new Intl.NumberFormat(I18N.locale, { maximumFractionDigits: maxDec }).format(a / div);\n const sign = v < 0 ? '-' : '';\n if (like === undefined) return `${sign}${finalStr} ${unit}`;\n const digits = (finalStr.split('.')[1] || '').length;\n return `${sign}${new Intl.NumberFormat(I18N.locale, { minimumFractionDigits: digits, maximumFractionDigits: digits }).format(Math.abs(v) / div)} ${unit}`;\n }\n const nf = new Intl.NumberFormat(I18N.locale, { notation: 'compact', maximumFractionDigits: 1 });\n if (like === undefined) return nf.format(v);\n const parts = nf.formatToParts(ref);\n let num = '';\n let dec = '';\n for (const pt of parts) {\n if (pt.type === 'integer') num += pt.value;\n if (pt.type === 'fraction') {\n num += '.' + pt.value;\n dec = pt.value;\n }\n }\n const mant = parseFloat(num) || 1;\n const scale = 10 ** Math.round(Math.log10(Math.abs(ref) / mant));\n const inner = new Intl.NumberFormat(I18N.locale, { minimumFractionDigits: dec.length, maximumFractionDigits: dec.length }).format(Math.abs(v) / scale);\n let done = false;\n const body = parts\n .map((pt) => {\n if (pt.type === 'integer' || pt.type === 'group' || pt.type === 'decimal' || pt.type === 'fraction') {\n if (done) return '';\n done = true;\n return inner;\n }\n return pt.value;\n })\n .join('');\n return (v < 0 && ref >= 0 ? '-' : '') + body;\n}\n\n/** zh-TW with TWD: NT$ 1,280, negatives -NT$ 1,280. Other locales and currencies: Intl's own symbol and order. */\nfunction money(v: number, o: { currency?: string; compact?: boolean; like?: number } = {}): string {\n const cur = o.currency || I18N.currency;\n const body = o.compact ? compact(Math.abs(v), o.like !== undefined ? Math.abs(o.like) : undefined) : number(Math.abs(v), 'money');\n if (isZhTW() && cur === 'TWD') return `${v < 0 ? '-' : ''}NT$ ${body}`;\n if (o.compact) return `${v < 0 ? '-' : ''}${body} ${cur}`;\n return new Intl.NumberFormat(I18N.locale, {\n style: 'currency',\n currency: cur,\n // narrowSymbol writes TWD as a bare 「$」, which reads as dollars: keep 「NT$」 (docs: 英文介面顯示 NT$486,000).\n currencyDisplay: cur === 'TWD' ? 'symbol' : 'narrowSymbol',\n minimumFractionDigits: 0,\n maximumFractionDigits: cur === 'TWD' || cur === 'JPY' ? 0 : 2,\n }).format(v);\n}\n\n/** Bytes to 「186 KB」「54.9 MB」「1.2 GB」. */\nexport function fileSize(b: number | null | undefined): string {\n if (b == null || Number.isNaN(b)) return '';\n // An empty file is 0 KB; anything else at least 1 KB.\n // Compare after rounding: 1,048,500 bytes rounds to 1,024 KB, so it is written 「1.0 MB」.\n if (Math.round(b / 1024) < 1024) return number(b === 0 ? 0 : Math.max(1, Math.round(b / 1024))) + ' KB';\n if (Math.round((b / 1048576) * 10) < 10240) return number(b / 1048576, 1) + ' MB';\n return number(b / 1073741824, 1) + ' GB';\n}\n\n/** Seconds as a clock-style length: under 1 h 「46:42」「1:30」 (minutes not zero-padded), 1 h or more 「1:54:49」.\n * Rounded to the second. Negative, NaN or missing: 「—」. */\nfunction duration(seconds: number | null | undefined): string {\n if (seconds == null || Number.isNaN(seconds) || seconds < 0 || !Number.isFinite(seconds)) return '—';\n const t = Math.round(seconds);\n const h = Math.floor(t / 3600);\n const m = Math.floor((t % 3600) / 60);\n const s = t % 60;\n return h ? `${h}:${pad2(m)}:${pad2(s)}` : `${m}:${pad2(s)}`;\n}\n\n/** Shortens a path: keeps the first segment and the last two, 「src/…/hooks/ops.c:58」. */\nfunction path(p: string | null | undefined, o: { head?: number; tail?: number } = {}): string {\n const head = o.head ?? 1;\n const tail = o.tail ?? 2;\n const parts = String(p ?? '').split('/');\n return parts.length > head + tail ? `${parts.slice(0, head).join('/')}/…/${parts.slice(-tail).join('/')}` : String(p ?? '');\n}\n\n/** A part of a whole, as shown: 「1 / 1 個」「6 / 6 筆」, or 「1 / 5」 without a unit. Give screen readers\n * `fractionLabel` with it: they read the slash as 「斜線」. */\nfunction fraction(n: number, total: number, unit?: string): string {\n return tr(unit ? '{n} / {total} {unit}' : '{n} / {total}', { n: number(n), total: number(total), unit: unit ?? '' });\n}\n\n/** The same fraction as read aloud: 「1 個中的 1 個」「6 筆中的 6 筆」, or 「5 中的 1」 without a unit (English:\n * 「1 of 1」). For `aria-label`, or for visually hidden text beside the shown fraction. */\nfunction fractionLabel(n: number, total: number, unit?: string): string {\n return tr(unit ? '{total} {unit}中的 {n} {unit}' : '{total} 中的 {n}', { n: number(n), total: number(total), unit: unit ?? '' });\n}\n\n/** Every date, number, amount, size and path shown in the UI goes through these. */\nexport const format = {\n locale,\n date,\n time,\n dateTime,\n relative,\n month,\n weekdays,\n firstDay,\n number,\n percent,\n compact,\n money,\n fileSize,\n duration,\n path,\n fraction,\n fractionLabel,\n};\n\n/* Calendar helpers (local dates, no time). */\nexport const fmtDate = (d: Date | null | undefined): string => (d ? `${d.getFullYear()}/${pad2(d.getMonth() + 1)}/${pad2(d.getDate())}` : '');\n\nexport function parseDate(s: string | null | undefined): Date | null {\n const m = /^(\\d{4})\\/(\\d{1,2})\\/(\\d{1,2})$/.exec(s || '');\n if (!m) return null;\n const d = new Date(+m[1], +m[2] - 1, +m[3]);\n return d.getMonth() === +m[2] - 1 ? d : null;\n}\n\nexport const sameDay = (a: Date | null | undefined, b: Date | null | undefined): boolean =>\n !!a && !!b && a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();\n\nexport const dayAdd = (d: Date, n: number): Date => new Date(d.getFullYear(), d.getMonth(), d.getDate() + n);\n"],"mappings":";AAUA,MAAa,OAAkB;CAC7B,QAAQ;CACR,UAAU;CACV,UAAU,EACR,IAAI;EACF,aAAa;EACb,qBAAqB;EACrB,YAAY;EACZ,KAAK;EACL,KAAK;EACL,eAAe;EACf,KAAK;EACL,KAAK;EACL,MAAM;EACN,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,QAAQ;EACR,WAAW;EACX,IAAI;EACJ,IAAI;EACJ,MAAM;EACN,MAAM;EACN,wBAAwB;EACxB,MAAM;EACN,KAAK;EACL,QAAQ;EACR,IAAI;EACJ,OAAO;EACP,YAAY;EACZ,IAAI;EACJ,KAAK;EACL,MAAM;EACN,UAAU;EACV,WAAW;EACX,IAAI;EACJ,IAAI;EACJ,OAAO;EACP,OAAO;EACP,MAAM;EACN,IAAI;EACJ,aAAa;EACb,YAAY;EACZ,eAAe;EACf,eAAe;EACf,kBAAkB;EAClB,YAAY;EACZ,IAAI;EACJ,IAAI;EACJ,MAAM;EACN,IAAI;EACJ,MAAM;EACN,KAAK;EACL,OAAO;EACP,IAAI;EACJ,QAAQ;EACR,MAAM;EACN,aAAa;EACb,OAAO;EACP,eAAe;EACf,kBAAkB;EAClB,kBAAkB;EAClB,MAAM;EACN,MAAM;EACN,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,YAAY;EACZ,UAAU;EACV,MAAM;EACN,GAAG;EACH,IAAI;EACJ,QAAQ;EACR,UAAU;EACV,UAAU;EACV,UAAU;EACV,WAAW;EACX,0BAA0B;EAC1B,MAAM;EACN,IAAI;EACJ,MAAM;EACN,QAAQ;EACR,IAAI;EACJ,MAAM;EACN,MAAM;EACN,QAAQ;EACR,MAAM;EACN,GAAG;EACH,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,KAAK;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AAG,MAAM,QAAQ;CAAG,CAAC;AACrH;;;AAIA,SAAS,cAAc,GAAW,OAAe,MAAuB;CACtE,OAAO,GAAG,OAAO,gCAAgC,kBAAkB;EAAE,GAAG,OAAO,CAAC;EAAG,OAAO,OAAO,KAAK;EAAG,MAAM,QAAQ;CAAG,CAAC;AAC7H;;AAGA,MAAa,SAAS;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAGA,MAAa,WAAW,MAAwC,IAAI,GAAG,EAAE,YAAY,EAAE,GAAG,KAAK,EAAE,SAAS,IAAI,CAAC,EAAE,GAAG,KAAK,EAAE,QAAQ,CAAC,MAAM;AAE1I,SAAgB,UAAU,GAA2C;CACnE,MAAM,IAAI,kCAAkC,KAAK,KAAK,EAAE;CACxD,IAAI,CAAC,GAAG,OAAO;CACf,MAAM,IAAI,IAAI,KAAK,CAAC,EAAE,IAAI,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,EAAE;CAC1C,OAAO,EAAE,SAAS,MAAM,CAAC,EAAE,KAAK,IAAI,IAAI;AAC1C;AAEA,MAAa,WAAW,GAA4B,MAClD,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,YAAY,MAAM,EAAE,YAAY,KAAK,EAAE,SAAS,MAAM,EAAE,SAAS,KAAK,EAAE,QAAQ,MAAM,EAAE,QAAQ;AAElH,MAAa,UAAU,GAAS,MAAoB,IAAI,KAAK,EAAE,YAAY,GAAG,EAAE,SAAS,GAAG,EAAE,QAAQ,IAAI,CAAC"}
|
package/dist/format.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as Decimals, i as tr, n as addMessages, o as format, r as setLocale, t as CountUnit } from "./format-entry-
|
|
1
|
+
import { a as Decimals, i as tr, n as addMessages, o as format, r as setLocale, t as CountUnit } from "./format-entry-CgMBtkni.js";
|
|
2
2
|
export { type CountUnit, type Decimals, addMessages, format, setLocale, tr as t };
|
package/dist/format.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { c as addMessages, i as format, l as setLocale, u as t } from "./format-entry-
|
|
1
|
+
export { c as addMessages, i as format, l as setLocale, u as t } from "./format-entry-CyChe8bk.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as Decimals, i as tr, n as addMessages, o as format, r as setLocale, t as CountUnit } from "./format-entry-
|
|
1
|
+
import { a as Decimals, i as tr, n as addMessages, o as format, r as setLocale, t as CountUnit } from "./format-entry-CgMBtkni.js";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const PH: {
|
|
4
4
|
readonly archive: '<path d="M224,48H32A16,16,0,0,0,16,64V88a16,16,0,0,0,16,16v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V104a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM208,192H48V104H208ZM224,88H32V64H224V88ZM96,136a8,8,0,0,1,8-8h48a8,8,0,0,1,0,16H104A8,8,0,0,1,96,136Z"/>';
|
|
@@ -264,7 +264,8 @@ interface AppShellProps {
|
|
|
264
264
|
* The top bar hides while scrolling down and returns when scrolling up. */
|
|
265
265
|
export declare function AppShell({ nav, value, onNavigate, brand, title, breadcrumb, onSearch, actions, children, tabLabels, defaultPinned, className }: AppShellProps): React.JSX.Element;
|
|
266
266
|
interface GridProps {
|
|
267
|
-
/** Columns from 1280 px.
|
|
267
|
+
/** Columns from 1280 px. 960–1279 px: 4 becomes 2, 6 becomes 3, 1, 2 and 3 stay. 600–959 px: 2 (1 stays 1).
|
|
268
|
+
* Under 600 px: 1. Default 3. */
|
|
268
269
|
columns?: 1 | 2 | 3 | 4 | 6;
|
|
269
270
|
children: React.ReactNode;
|
|
270
271
|
className?: string;
|
|
@@ -307,8 +308,9 @@ interface DangerConfirm {
|
|
|
307
308
|
confirmLabel?: string;
|
|
308
309
|
}
|
|
309
310
|
type ButtonProps = (ButtonBase & {
|
|
310
|
-
/** primary: the one main action of a section. secondary (default): everything else.
|
|
311
|
-
|
|
311
|
+
/** primary: the one main action of a section (solid). secondary (default): everything else (outline). quiet:
|
|
312
|
+
* low-emphasis and toolbar actions, text only with no border, a gray background on hover. */
|
|
313
|
+
variant?: 'primary' | 'secondary' | 'quiet';
|
|
312
314
|
}) | (ButtonBase & {
|
|
313
315
|
/** Destructive. Must be confirmed: pass `confirm`, or `confirmed` when this button is itself inside the confirm Dialog. */
|
|
314
316
|
variant: 'danger';
|
|
@@ -686,12 +688,20 @@ interface ColumnBase<R extends Row> {
|
|
|
686
688
|
sortable?: boolean;
|
|
687
689
|
/** What to sort by when it is not the field itself. */
|
|
688
690
|
sortValue?: (row: R) => number | string;
|
|
691
|
+
/** Least width (px), for any column. It does not change which column takes the room left: the first text column
|
|
692
|
+
* still does, with or without a width. */
|
|
689
693
|
width?: number;
|
|
694
|
+
/** Takes a share of the room left (like fr). Default: the first text column and long columns take it (1); numbers,
|
|
695
|
+
* units, dates, durations, status Badges and other short text hug their content (0). */
|
|
690
696
|
grow?: number;
|
|
691
|
-
/** money: NT$ 1,280. date: 2026/11/04(三). relative: 「2 小時前」 within a week
|
|
692
|
-
|
|
697
|
+
/** money: NT$ 1,280. date: 2026/11/04(三). relative: 「2 小時前」 within a week, the full date on hover. percent:
|
|
698
|
+
* 1 decimal, no % sign: add unit: '%'. duration: seconds as 46:42 or 1:54:49, right-aligned, sorted by the number. */
|
|
699
|
+
format?: 'money' | 'date' | 'datetime' | 'relative' | 'percent' | 'duration';
|
|
693
700
|
currency?: string;
|
|
694
701
|
decimals?: number;
|
|
702
|
+
/** A second line under the cell's text: smaller, muted, one line cut with …. Search finds its text; phone cards show
|
|
703
|
+
* it. E.g. the reason an import failed, or 「匯入中 42%」 for a running one. Rows grow only when a column has it. */
|
|
704
|
+
secondary?: (row: R) => React.ReactNode;
|
|
695
705
|
/** The text search matches for this column. */
|
|
696
706
|
searchText?: (row: R) => string;
|
|
697
707
|
/** Place on phone cards: title row left, title row right, or hidden. Default: the first column is the title. */
|
|
@@ -791,6 +801,16 @@ interface DataTableProps<R extends Row = Record<string, unknown>> {
|
|
|
791
801
|
label?: string;
|
|
792
802
|
options: FilterOption[];
|
|
793
803
|
};
|
|
804
|
+
/** 「/」 focuses this table's search field when focus is not in a text field (no Ctrl, Alt or ⌘). Only the first
|
|
805
|
+
* table on the page with a search field takes it; it shows a small 「/」 in the empty field on desktop. Default true. */
|
|
806
|
+
searchShortcut?: boolean;
|
|
807
|
+
/** Each row's page: the first cell's text becomes a link to it, and a click anywhere else on the row (not on its own
|
|
808
|
+
* links, buttons or checkbox, nor a click that ends a text selection) opens it. Like a link, Ctrl, ⌘ or Shift + click
|
|
809
|
+
* and a middle click open it in a new tab. */
|
|
810
|
+
rowHref?: (row: R) => string;
|
|
811
|
+
/** With rowHref: called instead of following the link on a plain click (on the row or its first cell's link), so an
|
|
812
|
+
* app router can push the route. Ctrl, ⌘, Shift and middle clicks still open the href in a new tab. */
|
|
813
|
+
onRowOpen?: (row: R, event: React.MouseEvent) => void;
|
|
794
814
|
/** Write search and filters into the URL. Default true. */
|
|
795
815
|
urlSync?: boolean;
|
|
796
816
|
/** Prefix of the URL parameters when a page has several tables. */
|
|
@@ -810,17 +830,17 @@ interface DataTableProps<R extends Row = Record<string, unknown>> {
|
|
|
810
830
|
totals?: Partial<Record<string, Total<R>>>;
|
|
811
831
|
/** Keep the first column visible while scrolling sideways. */
|
|
812
832
|
stickyFirst?: boolean;
|
|
813
|
-
/** 「欄位」 menu to hide columns. Default true. */
|
|
833
|
+
/** 「欄位」 in the 「⋯」 menu, to hide columns. Default true. */
|
|
814
834
|
columnMenu?: boolean;
|
|
815
|
-
/** Remembers the column widths readers drag (the borders in the header)
|
|
816
|
-
* (ui-dt-width:<widthKey>). Without it
|
|
817
|
-
* clear them: they are the reader's own. */
|
|
835
|
+
/** Remembers the column widths readers drag (the borders in the header) and the columns they hide or show, in
|
|
836
|
+
* localStorage under this name (ui-dt-width:<widthKey>, ui-dt-cols:<widthKey>). Without it they go back to the
|
|
837
|
+
* defaults when the page reloads. resetKey does not clear them: they are the reader's own; 「欄位」 → 「還原預設」 does. */
|
|
818
838
|
widthKey?: string;
|
|
819
|
-
/**
|
|
820
|
-
*
|
|
839
|
+
/** 「放大表格」 in the 「⋯」 menu: the whole table, with its search, filters, sort and pages, in a dialog up to
|
|
840
|
+
* 1200 px wide. A click on a link inside closes the dialog. Not on phones. Default true. */
|
|
821
841
|
zoom?: boolean;
|
|
822
|
-
/**
|
|
823
|
-
*
|
|
842
|
+
/** 「複製成 Markdown」 in the 「⋯」 menu: every row the search and filters keep (all pages), in the shown columns and
|
|
843
|
+
* order; each cell is the column's fullText, else its searchText, else its value. Default true. */
|
|
824
844
|
copy?: boolean;
|
|
825
845
|
/** Your own text for 「複製成 Markdown」, from the same rows (all pages, sorted). */
|
|
826
846
|
copyText?: (rows: R[]) => string;
|
|
@@ -839,10 +859,13 @@ interface DatePickerProps {
|
|
|
839
859
|
/** Default 「可以直接輸入,例如 2026/11/14」. */
|
|
840
860
|
hint?: string;
|
|
841
861
|
required?: boolean;
|
|
862
|
+
/** An error from your own check (「請選擇開始日期」): the cause and the fix. Red border, the warning icon and this line
|
|
863
|
+
* under the field, announced when it appears. A date typed in the wrong format gets its own error. */
|
|
864
|
+
error?: string;
|
|
842
865
|
className?: string;
|
|
843
866
|
}
|
|
844
867
|
/** A date field: type YYYY/MM/DD, or pick from the calendar button's month grid. */
|
|
845
|
-
export declare function DatePicker({ label, value, onChange, hint, required, className }: DatePickerProps): React.JSX.Element;
|
|
868
|
+
export declare function DatePicker({ label, value, onChange, hint, required, error, className }: DatePickerProps): React.JSX.Element;
|
|
846
869
|
type DateRange = [Date, Date];
|
|
847
870
|
interface DateRangePickerProps {
|
|
848
871
|
label?: string;
|
|
@@ -1171,6 +1194,8 @@ export declare function KpiCard(props: KpiCardProps): React.JSX.Element;
|
|
|
1171
1194
|
interface LayerGraphNode {
|
|
1172
1195
|
id: string;
|
|
1173
1196
|
name?: string;
|
|
1197
|
+
/** The name is code (a path, a file, a module): Geist Mono. Default: the text font, for names in words (「被追蹤的程式」). */
|
|
1198
|
+
code?: boolean;
|
|
1174
1199
|
/** 0 is the top layer. */
|
|
1175
1200
|
layer?: number;
|
|
1176
1201
|
/** How big it is (functions, files, endpoints): drawn as the size bar. */
|
|
@@ -1432,13 +1457,16 @@ interface Zone {
|
|
|
1432
1457
|
}
|
|
1433
1458
|
interface ZoneMapProps {
|
|
1434
1459
|
zones: Zone[];
|
|
1435
|
-
/** What the map shows, for screen readers, e.g.
|
|
1460
|
+
/** What the map shows, for screen readers, e.g. 「設施分區」. */
|
|
1436
1461
|
label: string;
|
|
1437
1462
|
/** Columns of the grid. Default 4. Where a zone would be narrower than 150 px (phones), fewer columns are used and
|
|
1438
1463
|
* `area` placements are dropped, so zones flow in order. */
|
|
1439
1464
|
columns?: number;
|
|
1440
|
-
/** Height of one grid row in px. Default 120. */
|
|
1465
|
+
/** Height of one grid row in px. Default 120. With `fill`, the least height of a row. */
|
|
1441
1466
|
rowHeight?: number;
|
|
1467
|
+
/** Rows grow to fill the height the map is given (in ConsoleLayout's main view, or any flex column), never below
|
|
1468
|
+
* `rowHeight`. */
|
|
1469
|
+
fill?: boolean;
|
|
1442
1470
|
/** The heat scale's range for zones without a fill. Default 20 to 30. */
|
|
1443
1471
|
min?: number;
|
|
1444
1472
|
max?: number;
|
|
@@ -1446,7 +1474,7 @@ interface ZoneMapProps {
|
|
|
1446
1474
|
onSelect?: (zone: Zone) => void;
|
|
1447
1475
|
className?: string;
|
|
1448
1476
|
}
|
|
1449
|
-
export declare function ZoneMap({ zones, label, columns, rowHeight, min, max, selectedId, onSelect, className }: ZoneMapProps): React.JSX.Element;
|
|
1477
|
+
export declare function ZoneMap({ zones, label, columns, rowHeight, fill, min, max, selectedId, onSelect, className }: ZoneMapProps): React.JSX.Element;
|
|
1450
1478
|
type EventKind = 'alert' | 'switch' | 'ai' | 'manual';
|
|
1451
1479
|
interface TimelineEvent {
|
|
1452
1480
|
id?: string;
|
|
@@ -1477,7 +1505,7 @@ interface ConsoleExtra {
|
|
|
1477
1505
|
node: React.ReactNode;
|
|
1478
1506
|
}
|
|
1479
1507
|
interface ConsoleLayoutProps {
|
|
1480
|
-
/** The product or screen name, the page's only heading:
|
|
1508
|
+
/** The product or screen name, the page's only heading: 「設施監控」. */
|
|
1481
1509
|
title: string;
|
|
1482
1510
|
/** Right after the title: `<Tag variant="demo">示範資料</Tag>`. Same size and color as the text around it. */
|
|
1483
1511
|
tags?: React.ReactNode;
|
|
@@ -1622,10 +1650,13 @@ interface MultiSelectProps {
|
|
|
1622
1650
|
placeholder?: string;
|
|
1623
1651
|
/** Default 「找不到符合的選項」. */
|
|
1624
1652
|
emptyText?: string;
|
|
1653
|
+
/** The cause and the fix (「至少選一個標籤」). Red border, the warning icon and this line under the field, announced when
|
|
1654
|
+
* it appears. */
|
|
1655
|
+
error?: string;
|
|
1625
1656
|
className?: string;
|
|
1626
1657
|
}
|
|
1627
1658
|
/** Pick several options: chips inside the field, type to filter, Backspace removes the last chip. */
|
|
1628
|
-
export declare function MultiSelect({ label, options, value, onChange, creatable, maxChips, placeholder, emptyText, className }: MultiSelectProps): React.JSX.Element;
|
|
1659
|
+
export declare function MultiSelect({ label, options, value, onChange, creatable, maxChips, placeholder, emptyText, error, className }: MultiSelectProps): React.JSX.Element;
|
|
1629
1660
|
interface NotificationItem {
|
|
1630
1661
|
id: string | number;
|
|
1631
1662
|
title: string;
|
|
@@ -1754,6 +1785,9 @@ interface SelectProps<V extends string = string> {
|
|
|
1754
1785
|
/** Red asterisk after the label. */
|
|
1755
1786
|
required?: boolean;
|
|
1756
1787
|
disabled?: boolean;
|
|
1788
|
+
/** The cause and the fix (「請選擇部門」). Red border, the warning icon and this line under the field, announced when it
|
|
1789
|
+
* appears. */
|
|
1790
|
+
error?: string;
|
|
1757
1791
|
/** Form field name; the value is submitted with the form. */
|
|
1758
1792
|
name?: string;
|
|
1759
1793
|
className?: string;
|
|
@@ -1918,9 +1952,12 @@ interface TextAreaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaEl
|
|
|
1918
1952
|
/** Shown as a counter. Default 200. */
|
|
1919
1953
|
maxLength?: number;
|
|
1920
1954
|
required?: boolean;
|
|
1955
|
+
/** The cause and the fix (「請寫下退款原因」). Red border, the warning icon and this line in place of the hint, announced
|
|
1956
|
+
* when it appears. Set it when the field is left or the form is sent. */
|
|
1957
|
+
error?: string;
|
|
1921
1958
|
}
|
|
1922
1959
|
/** Multi-line text that grows up to 8 lines, with a character counter. */
|
|
1923
|
-
export declare function TextArea({ label, hint, value, onChange, maxLength, className, id, required, ...native }: TextAreaProps): React.JSX.Element;
|
|
1960
|
+
export declare function TextArea({ label, hint, error, value, onChange, maxLength, className, id, required, ...native }: TextAreaProps): React.JSX.Element;
|
|
1924
1961
|
interface TextFieldProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
1925
1962
|
/** Above the field, always visible. Never only a placeholder. */
|
|
1926
1963
|
label: string;
|
|
@@ -1928,7 +1965,8 @@ interface TextFieldProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
|
1928
1965
|
required?: boolean;
|
|
1929
1966
|
/** One short line under the field. */
|
|
1930
1967
|
hint?: string;
|
|
1931
|
-
/** The cause and the fix: 「日期格式不正確,請寫成 2026/11/14」. Turns the border red.
|
|
1968
|
+
/** The cause and the fix: 「日期格式不正確,請寫成 2026/11/14」. Turns the border red and is announced when it appears.
|
|
1969
|
+
* Set it when the field is left (blur) or the form is sent, not on every key; clear it as soon as the value is right. */
|
|
1932
1970
|
error?: string;
|
|
1933
1971
|
ref?: React.Ref<HTMLInputElement>;
|
|
1934
1972
|
}
|
|
@@ -1937,7 +1975,7 @@ export declare function TextField({ label, hint, error, id, className, required,
|
|
|
1937
1975
|
type ThemeSetting = 'auto' | 'light' | 'dark';
|
|
1938
1976
|
/** Switches the theme on <html data-theme> and remembers it. */
|
|
1939
1977
|
export declare function setTheme(t: ThemeSetting): void;
|
|
1940
|
-
/** Derives every accent token from one color (自訂強調色的換算 in docs/
|
|
1978
|
+
/** Derives every accent token from one color (自訂強調色的換算 in docs/theme.md).
|
|
1941
1979
|
* Returns false for anything but #rrggbb. quiet: apply without storing. */
|
|
1942
1980
|
export declare function setAccent(hex: string, quiet?: boolean): boolean;
|
|
1943
1981
|
/** Applies the stored theme and accent; call once when the page starts. */
|
|
@@ -1977,8 +2015,8 @@ export declare function Toast({ children, actionLabel, onAction }: ToastProps):
|
|
|
1977
2015
|
interface TooltipProps {
|
|
1978
2016
|
/** Short text, also announced as the trigger's description. Never the only place important information lives. */
|
|
1979
2017
|
label: string;
|
|
1980
|
-
/** Preferred side; flips when there is no room. Default 'top'. */
|
|
1981
|
-
side?: 'top' | 'bottom';
|
|
2018
|
+
/** Preferred side; flips when there is no room. 'right' for controls at a sidebar's edge. Default 'top'. */
|
|
2019
|
+
side?: 'top' | 'bottom' | 'right';
|
|
1982
2020
|
/** One focusable element that accepts a ref (a button, IconButton, Button, a link). */
|
|
1983
2021
|
children: React.ReactElement;
|
|
1984
2022
|
/** false: the label only repeats the trigger's own name (an IconButton's aria-label), so it is not added as its description. Default true. */
|
|
@@ -2177,7 +2215,7 @@ interface WorkbenchLayout {
|
|
|
2177
2215
|
size: Record<WorkbenchRegion, number>;
|
|
2178
2216
|
}
|
|
2179
2217
|
interface WorkbenchProps {
|
|
2180
|
-
/** Names the stored layout: one per page, such as '
|
|
2218
|
+
/** Names the stored layout: one per page, such as 'app'. */
|
|
2181
2219
|
id: string;
|
|
2182
2220
|
/** Product at the top left. The name is hidden on phones; the mark stays. */
|
|
2183
2221
|
brand?: {
|