@seanyeh77/ui 0.19.0 → 0.21.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.
@@ -90,6 +90,11 @@ const I18N = {
90
90
  到: "to",
91
91
  "{label}({inferred})": "{label} ({inferred})",
92
92
  調整面板寬度: "Resize the panel",
93
+ 調整架構圖高度: "Resize the diagram height",
94
+ "調整「{name}」欄寬": "Resize the column {name}",
95
+ 放大表格: "Enlarge the table",
96
+ 表格: "Table",
97
+ "{n} px": "{n} px",
93
98
  "主要區域 {a} px,面板 {b} px": "Main area {a} px, panel {b} px",
94
99
  "repo 外": "outside the repo",
95
100
  詳細: "Details",
@@ -490,4 +495,4 @@ const sameDay = (a, b) => !!a && !!b && a.getFullYear() === b.getFullYear() && a
490
495
  const dayAdd = (d, n) => new Date(d.getFullYear(), d.getMonth(), d.getDate() + n);
491
496
  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 };
492
497
 
493
- //# sourceMappingURL=format-entry-madGv9m_.js.map
498
+ //# sourceMappingURL=format-entry-B2vEJCCf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-entry-B2vEJCCf.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 放棄: '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 '新增「{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 '找到 {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 '{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 隱藏密碼: '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 '(說明)': ' (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 const [unit, div, maxDec] = a >= 1e8 ? (['億', 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 currencyDisplay: '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 if (b < 1048576) return number(b === 0 ? 0 : Math.max(1, Math.round(b / 1024))) + ' KB';\n if (b < 1073741824) return number(b / 1048576, 1) + ' MB';\n return number(b / 1073741824, 1) + ' GB';\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 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,SAAS;EACT,UAAU;EACV,WAAW;EACX,IAAI;EACJ,IAAI;EACJ,OAAO;EACP,IAAI;EACJ,aAAa;EACb,YAAY;EACZ,eAAe;EACf,eAAe;EACf,kBAAkB;EAClB,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;EACL,KAAK;EACL,gBAAgB;EAChB,YAAY;EACZ,cAAc;EACd,mBAAmB;EACnB,aAAa;EACb,KAAK;EACL,WAAW;EACX,WAAW;EACX,KAAK;EACL,MAAM;EACN,UAAU;EACV,UAAU;EACV,KAAK;EACL,KAAK;EACL,kBAAkB;EAClB,6BAA6B;EAC7B,YAAY;EACZ,gBAAgB;EAChB,sBAAsB;EACtB,MAAM;EACN,GAAG;EACH,OAAO;EAEP,KAAK;EACL,KAAK;EACL,KAAK;EACL,qBAAqB;EACrB,wBAAwB;EACxB,GAAG;EACH,uBAAuB;EACvB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MAAa,SAAS;CACpB;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.js CHANGED
@@ -1 +1 @@
1
- export { c as addMessages, i as format, l as setLocale, u as t } from "./format-entry-madGv9m_.js";
1
+ export { c as addMessages, i as format, l as setLocale, u as t } from "./format-entry-B2vEJCCf.js";
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ declare const PH: {
12
12
  readonly 'arrows-clockwise': '<path d="M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"/>';
13
13
  readonly 'arrows-in-line-vertical': '<path d="M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM122.34,101.66a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0-11.32-11.32L136,76.69V16a8,8,0,0,0-16,0V76.69L101.66,58.34A8,8,0,0,0,90.34,69.66Zm11.32,52.68a8,8,0,0,0-11.32,0l-32,32a8,8,0,0,0,11.32,11.32L120,179.31V240a8,8,0,0,0,16,0V179.31l18.34,18.35a8,8,0,0,0,11.32-11.32Z"/>';
14
14
  readonly 'arrows-out-line-vertical': '<path d="M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM101.66,53.66,120,35.31V96a8,8,0,0,0,16,0V35.31l18.34,18.35a8,8,0,0,0,11.32-11.32l-32-32a8,8,0,0,0-11.32,0l-32,32a8,8,0,0,0,11.32,11.32Zm52.68,148.68L136,220.69V160a8,8,0,0,0-16,0v60.69l-18.34-18.35a8,8,0,0,0-11.32,11.32l32,32a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0-11.32-11.32Z"/>';
15
+ readonly 'corners-out': '<path d="M216,48V88a8,8,0,0,1-16,0V56H168a8,8,0,0,1,0-16h40A8,8,0,0,1,216,48ZM88,200H56V168a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H88a8,8,0,0,0,0-16Zm120-40a8,8,0,0,0-8,8v32H168a8,8,0,0,0,0,16h40a8,8,0,0,0,8-8V168A8,8,0,0,0,208,160ZM88,40H48a8,8,0,0,0-8,8V88a8,8,0,0,0,16,0V56H88a8,8,0,0,0,0-16Z"/>';
15
16
  readonly bell: '<path d="M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216ZM48,184c7.7-13.24,16-43.92,16-80a64,64,0,1,1,128,0c0,36.05,8.28,66.73,16,80Z"/>';
16
17
  readonly 'calendar-blank': '<path d="M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Z"/>';
17
18
  readonly 'caret-down': '<path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"/>';
@@ -950,15 +951,24 @@ interface SectionProps {
950
951
  * the caret left of the title turns when it opens (260 ms, none with reduced motion). */
951
952
  export declare function Section(p: SectionProps): React.JSX.Element;
952
953
  interface SectionGroupProps {
953
- /** Sections. 「全部展開」「全部收合」 sit above them on the right, each with an icon; the one that would change nothing
954
- * is disabled. */
954
+ /** Sections. One icon button above them on the right opens them all, or closes them all once all are open
955
+ * (「全部展開」「全部收合」 as its tooltip and name). */
955
956
  children?: React.ReactNode;
956
- /** More controls on the same row, left of the two buttons. */
957
+ /** More controls on the same row, left of the button. */
957
958
  actions?: React.ReactNode;
959
+ /** false: no row above the sections; put <SectionGroupToggle /> where you want it, such as the card's title row next
960
+ * to its other icon buttons. It must be inside the SectionGroup. Default true. */
961
+ bar?: boolean;
958
962
  className?: string;
959
963
  }
960
- /** A run of Sections with 「全部展開」 and 「全部收合」 above them. */
961
- export declare function SectionGroup({ children, actions, className }: SectionGroupProps): React.JSX.Element;
964
+ /** A run of Sections with one 「全部展開/全部收合」 icon button. */
965
+ export declare function SectionGroup({ children, actions, bar, className }: SectionGroupProps): React.JSX.Element;
966
+ interface SectionGroupToggleProps {
967
+ className?: string;
968
+ }
969
+ /** GB: the 「全部展開/全部收合」 icon button of the SectionGroup around it, for a place of your own (with bar={false}).
970
+ * Opens every section while any is closed, else closes them all; its tooltip and name say which. */
971
+ export declare function SectionGroupToggle({ className }: SectionGroupToggleProps): React.JSX.Element | null;
962
972
  interface KpiCardProps {
963
973
  /** What is measured: 「本月營收」. */
964
974
  label: string;
@@ -1076,6 +1086,12 @@ interface LayerGraphProps {
1076
1086
  /** The 「圖/清單」 switch above the diagram; the list shows every box and line as text, also for screen readers.
1077
1087
  * false hides the switch. */
1078
1088
  listView?: boolean;
1089
+ /** HC: a handle under the diagram to drag its height, like SplitPane's divider. Down: the layers move apart (the gaps
1090
+ * between them grow), so lines and their labels have more room. Up past the drawn height: the diagram scrolls up and
1091
+ * down inside a shorter frame. ↑↓ 16 px, Enter or a double-click goes back. Default false. */
1092
+ resizable?: boolean;
1093
+ /** Remembers the dragged height in localStorage under this name (ui-lg-height:<name>). */
1094
+ heightKey?: string;
1079
1095
  /** Controls of the page on the same row as 「圖/清單」, at its left, such as the page's own 「依元件/依檔案」 Tabs,
1080
1096
  * so two switches do not sit on two rows. */
1081
1097
  toolbar?: React.ReactNode;
@@ -1667,4 +1683,4 @@ export declare const MOTION: {
1667
1683
  /** Says text to screen readers through the page's polite live region, without moving focus: 「顯示 6 筆」.
1668
1684
  * A second call before the first is read replaces it. */
1669
1685
  export declare function announce(text: string): void;
1670
- export { type AccentPickerProps, type ActionBarAction, type ActionBarProps, type AlertProps, type AlertTone, type AppShellProps, type BadgeProps, type BadgeStatus, type BarChartProps, type BarDatum, type BreadcrumbItem, type BreadcrumbProps, type ButtonProps, type CalendarProps, type CardProps, type CheckboxProps, type CodeLanguage, type CodeTextProps, type CodeViewHandle, type CodeViewProps, type CommandPaletteProps, type CountUnit, type CustomIcon, type DangerConfirm, type DangerZoneProps, type DataTableColumn, type DataTableFilter, type DataTableProps, type DataTableView, type DatePickerProps, type DateRange, type DateRangePickerProps, type DayState, type Decimals, type DetailListItem, type DetailListProps, type DialogProps, type DrawerProps, type EmptyStateProps, type ErrorPageProps, type FileUploadProps, type FilterOption, type FilterValue, type FormGridProps, type GraphLegendItem, type GraphLegendProps, type GridProps, type IconButtonProps, type IconName, type IconProps, type IconSource, type InlineCodeProps, type KpiCardProps, type LayerGraphEdge, type LayerGraphNode, type LayerGraphProps, type LineChartProps, type LineSeries, type LoadingBarProps, type LoginCardProps, type MarkdownProps, type MenuItem, type MenuProps, type MobileTab, type MobileTabBarProps, type MultiSelectOption, type MultiSelectProps, type NavItem, type NavSection, type NotificationBellProps, type NotificationItem, type OnRef, type PageProps, type PaletteItem, type PopoverProps, type ProgressBarProps, type ProgressRingProps, type ProjectOption, type ProjectStatus, type ProjectSwitcherProps, type RadioGroupProps, type RadioOption, type RangeValue, type RefHref, type Row, type RowKey, type SearchFieldProps, type SectionGroupProps, type SectionProps, type SelectOption, type SelectProps, type SettingsCategory, type SettingsLayoutProps, type SettingsSectionProps, type SideNavProps, type SkeletonProps, type SplitPaneProps, type SuggestionProps, type SwitchProps, type TabItem, type TabsProps, type TagProps, type TermProps, type TextAreaProps, type TextFieldProps, type ThemePickerProps, type ThemeSetting, type ToastProps, type Token, type TokenClass, type Tokenizer, type TooltipProps, type TopBarProps, type Total, type TourProps, type TourStep, type TreeListProps, type TreeNode, type UploadFile, addMessages, format, setLocale, tr as t };
1686
+ export { type AccentPickerProps, type ActionBarAction, type ActionBarProps, type AlertProps, type AlertTone, type AppShellProps, type BadgeProps, type BadgeStatus, type BarChartProps, type BarDatum, type BreadcrumbItem, type BreadcrumbProps, type ButtonProps, type CalendarProps, type CardProps, type CheckboxProps, type CodeLanguage, type CodeTextProps, type CodeViewHandle, type CodeViewProps, type CommandPaletteProps, type CountUnit, type CustomIcon, type DangerConfirm, type DangerZoneProps, type DataTableColumn, type DataTableFilter, type DataTableProps, type DataTableView, type DatePickerProps, type DateRange, type DateRangePickerProps, type DayState, type Decimals, type DetailListItem, type DetailListProps, type DialogProps, type DrawerProps, type EmptyStateProps, type ErrorPageProps, type FileUploadProps, type FilterOption, type FilterValue, type FormGridProps, type GraphLegendItem, type GraphLegendProps, type GridProps, type IconButtonProps, type IconName, type IconProps, type IconSource, type InlineCodeProps, type KpiCardProps, type LayerGraphEdge, type LayerGraphNode, type LayerGraphProps, type LineChartProps, type LineSeries, type LoadingBarProps, type LoginCardProps, type MarkdownProps, type MenuItem, type MenuProps, type MobileTab, type MobileTabBarProps, type MultiSelectOption, type MultiSelectProps, type NavItem, type NavSection, type NotificationBellProps, type NotificationItem, type OnRef, type PageProps, type PaletteItem, type PopoverProps, type ProgressBarProps, type ProgressRingProps, type ProjectOption, type ProjectStatus, type ProjectSwitcherProps, type RadioGroupProps, type RadioOption, type RangeValue, type RefHref, type Row, type RowKey, type SearchFieldProps, type SectionGroupProps, type SectionGroupToggleProps, type SectionProps, type SelectOption, type SelectProps, type SettingsCategory, type SettingsLayoutProps, type SettingsSectionProps, type SideNavProps, type SkeletonProps, type SplitPaneProps, type SuggestionProps, type SwitchProps, type TabItem, type TabsProps, type TagProps, type TermProps, type TextAreaProps, type TextFieldProps, type ThemePickerProps, type ThemeSetting, type ToastProps, type Token, type TokenClass, type Tokenizer, type TooltipProps, type TopBarProps, type Total, type TourProps, type TourStep, type TreeListProps, type TreeNode, type UploadFile, addMessages, format, setLocale, tr as t };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { a as parseDate, c as addMessages, d as unitFor, i as format, l as setLocale, n as fileSize, o as sameDay, r as fmtDate, s as I18N, t as dayAdd, u as tr } from "./format-entry-madGv9m_.js";
2
+ import { a as parseDate, c as addMessages, d as unitFor, i as format, l as setLocale, n as fileSize, o as sameDay, r as fmtDate, s as I18N, t as dayAdd, u as tr } from "./format-entry-B2vEJCCf.js";
3
3
  import * as React from "react";
4
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
5
  import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
@@ -21,6 +21,7 @@ const PH = {
21
21
  "arrows-clockwise": "<path d=\"M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z\"/>",
22
22
  "arrows-in-line-vertical": "<path d=\"M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM122.34,101.66a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0-11.32-11.32L136,76.69V16a8,8,0,0,0-16,0V76.69L101.66,58.34A8,8,0,0,0,90.34,69.66Zm11.32,52.68a8,8,0,0,0-11.32,0l-32,32a8,8,0,0,0,11.32,11.32L120,179.31V240a8,8,0,0,0,16,0V179.31l18.34,18.35a8,8,0,0,0,11.32-11.32Z\"/>",
23
23
  "arrows-out-line-vertical": "<path d=\"M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM101.66,53.66,120,35.31V96a8,8,0,0,0,16,0V35.31l18.34,18.35a8,8,0,0,0,11.32-11.32l-32-32a8,8,0,0,0-11.32,0l-32,32a8,8,0,0,0,11.32,11.32Zm52.68,148.68L136,220.69V160a8,8,0,0,0-16,0v60.69l-18.34-18.35a8,8,0,0,0-11.32,11.32l32,32a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0-11.32-11.32Z\"/>",
24
+ "corners-out": "<path d=\"M216,48V88a8,8,0,0,1-16,0V56H168a8,8,0,0,1,0-16h40A8,8,0,0,1,216,48ZM88,200H56V168a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H88a8,8,0,0,0,0-16Zm120-40a8,8,0,0,0-8,8v32H168a8,8,0,0,0,0,16h40a8,8,0,0,0,8-8V168A8,8,0,0,0,208,160ZM88,40H48a8,8,0,0,0-8,8V88a8,8,0,0,0,16,0V56H88a8,8,0,0,0,0-16Z\"/>",
24
25
  bell: "<path d=\"M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216ZM48,184c7.7-13.24,16-43.92,16-80a64,64,0,1,1,128,0c0,36.05,8.28,66.73,16,80Z\"/>",
25
26
  "calendar-blank": "<path d=\"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Z\"/>",
26
27
  "caret-down": "<path d=\"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z\"/>",
@@ -116,6 +117,7 @@ const PH_FILL = {
116
117
  "arrows-clockwise": "<path d=\"M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1-5.66-13.66L180.65,72a79.48,79.48,0,0,0-54.72-22.09h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27,96,96,0,0,1,192,60.7l18.36-18.36A8,8,0,0,1,224,48ZM186.41,183.29A80,80,0,0,1,75.35,184l18.31-18.31A8,8,0,0,0,88,152H40a8,8,0,0,0-8,8v48a8,8,0,0,0,13.66,5.66L64,195.3a95.42,95.42,0,0,0,66,26.76h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z\"/>",
117
118
  "arrows-in-line-vertical": "<path d=\"M90.34,69.66A8,8,0,0,1,96,56h24V16a8,8,0,0,1,16,0V56h24a8,8,0,0,1,5.66,13.66l-32,32a8,8,0,0,1-11.32,0Zm43.32,84.68a8,8,0,0,0-11.32,0l-32,32A8,8,0,0,0,96,200h24v40a8,8,0,0,0,16,0V200h24a8,8,0,0,0,5.66-13.66ZM216,120H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Z\"/>",
118
119
  "arrows-out-line-vertical": "<path d=\"M88.61,51.06a8,8,0,0,1,1.73-8.72l32-32a8,8,0,0,1,11.32,0l32,32A8,8,0,0,1,160,56H136V96a8,8,0,0,1-16,0V56H96A8,8,0,0,1,88.61,51.06ZM216,120H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm-56,80H136V160a8,8,0,0,0-16,0v40H96a8,8,0,0,0-5.66,13.66l32,32a8,8,0,0,0,11.32,0l32-32A8,8,0,0,0,160,200Z\"/>",
120
+ "corners-out": "<path d=\"M93.66,202.34A8,8,0,0,1,88,216H48a8,8,0,0,1-8-8V168a8,8,0,0,1,13.66-5.66ZM88,40H48a8,8,0,0,0-8,8V88a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,88,40ZM211.06,160.61a8,8,0,0,0-8.72,1.73l-40,40A8,8,0,0,0,168,216h40a8,8,0,0,0,8-8V168A8,8,0,0,0,211.06,160.61ZM208,40H168a8,8,0,0,0-5.66,13.66l40,40A8,8,0,0,0,216,88V48A8,8,0,0,0,208,40Z\"/>",
119
121
  bell: "<path d=\"M221.8,175.94C216.25,166.38,208,139.33,208,104a80,80,0,1,0-160,0c0,35.34-8.26,62.38-13.81,71.94A16,16,0,0,0,48,200H88.81a40,40,0,0,0,78.38,0H208a16,16,0,0,0,13.8-24.06ZM128,216a24,24,0,0,1-22.62-16h45.24A24,24,0,0,1,128,216Z\"/>",
120
122
  "calendar-blank": "<path d=\"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z\"/>",
121
123
  "caret-down": "<path d=\"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z\"/>",
@@ -5170,23 +5172,13 @@ function Markdown(p) {
5170
5172
  const a = b.align[j] ?? (numeric[j] ? "right" : null);
5171
5173
  return a ? { textAlign: a } : void 0;
5172
5174
  };
5173
- return /* @__PURE__ */ jsx("div", {
5174
- className: "ui-md-table-wrap",
5175
- tabIndex: 0,
5176
- role: "region",
5177
- "aria-label": b.head.join("、"),
5178
- children: /* @__PURE__ */ jsxs("table", {
5179
- className: "ui-md-table",
5180
- children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: b.head.map((h, j) => /* @__PURE__ */ jsx("th", {
5181
- style: align(j),
5182
- children: inline(h, c)
5183
- }, j)) }) }), /* @__PURE__ */ jsx("tbody", { children: b.rows.map((r, ri) => /* @__PURE__ */ jsx("tr", { children: Array.from({ length: n }, (_, j) => /* @__PURE__ */ jsx("td", {
5184
- className: numeric[j] ? "is-num" : void 0,
5185
- style: align(j),
5186
- "data-label": plain(b.head[j] ?? ""),
5187
- children: inline(r[j] ?? "", c)
5188
- }, j)) }, ri)) })]
5189
- })
5175
+ return /* @__PURE__ */ jsx(MdTable, {
5176
+ label: b.head.map(plain).join("、"),
5177
+ heads: b.head.map((h) => inline(h, c)),
5178
+ headText: b.head.map(plain),
5179
+ rows: b.rows.map((r) => Array.from({ length: n }, (_, j) => inline(r[j] ?? "", c))),
5180
+ numeric,
5181
+ align
5190
5182
  }, c.k());
5191
5183
  }
5192
5184
  }
@@ -5237,6 +5229,134 @@ function MdDetails({ summary, children }) {
5237
5229
  })]
5238
5230
  });
5239
5231
  }
5232
+ const MIN_COL = 48;
5233
+ /** A Markdown table: column borders in the header drag (TA); the corner button shows the whole table in a wide dialog
5234
+ * (TB). Under 480 px every row is a card instead, without either. */
5235
+ function MdTable(p) {
5236
+ const [widths, setWidths] = React.useState(null);
5237
+ const [big, setBig] = React.useState(false);
5238
+ const [dragging, setDragging] = React.useState(-1);
5239
+ const [measured, setMeasured] = React.useState([]);
5240
+ const table = React.useRef(null);
5241
+ const drag = React.useRef(null);
5242
+ const measure = React.useCallback(() => [...table.current?.querySelectorAll("thead th") ?? []].map((th) => Math.ceil(th.getBoundingClientRect().width)), []);
5243
+ React.useLayoutEffect(() => {
5244
+ const el = table.current;
5245
+ if (!el) return;
5246
+ const update = () => {
5247
+ const m = measure();
5248
+ setMeasured((old) => old.length === m.length && old.every((v, i) => v === m[i]) ? old : m);
5249
+ };
5250
+ update();
5251
+ const ro = new ResizeObserver(update);
5252
+ ro.observe(el);
5253
+ return () => ro.disconnect();
5254
+ }, [measure]);
5255
+ const widen = (j, base, to) => {
5256
+ const next = base.slice();
5257
+ next[j] = Math.max(MIN_COL, Math.round(to));
5258
+ setWidths(next);
5259
+ };
5260
+ const body = (resize) => /* @__PURE__ */ jsxs("table", {
5261
+ ref: resize ? table : void 0,
5262
+ className: "ui-md-table",
5263
+ style: resize && widths ? {
5264
+ width: widths.reduce((a, b) => a + b, 0),
5265
+ tableLayout: "fixed",
5266
+ minWidth: 0
5267
+ } : void 0,
5268
+ children: [
5269
+ resize && widths ? /* @__PURE__ */ jsx("colgroup", { children: widths.map((w, j) => /* @__PURE__ */ jsx("col", { style: { width: w } }, j)) }) : null,
5270
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: p.heads.map((h, j) => /* @__PURE__ */ jsxs("th", {
5271
+ style: p.align(j),
5272
+ children: [h, resize ? /* @__PURE__ */ jsx("span", {
5273
+ className: cx("ui-md-col-resize", dragging === j && "is-dragging"),
5274
+ role: "separator",
5275
+ "aria-orientation": "vertical",
5276
+ "aria-label": tr("調整「{name}」欄寬", { name: p.headText[j] }),
5277
+ "aria-valuenow": widths?.[j] ?? measured[j] ?? 0,
5278
+ "aria-valuemin": MIN_COL,
5279
+ tabIndex: 0,
5280
+ onPointerDown: (e) => {
5281
+ if (e.button !== 0) return;
5282
+ e.preventDefault();
5283
+ e.currentTarget.setPointerCapture(e.pointerId);
5284
+ drag.current = {
5285
+ j,
5286
+ x: e.clientX,
5287
+ base: widths ?? measure()
5288
+ };
5289
+ setDragging(j);
5290
+ },
5291
+ onPointerMove: (e) => {
5292
+ const d = drag.current;
5293
+ if (d) widen(d.j, d.base, d.base[d.j] + e.clientX - d.x);
5294
+ },
5295
+ onPointerUp: () => {
5296
+ drag.current = null;
5297
+ setDragging(-1);
5298
+ },
5299
+ onPointerCancel: () => {
5300
+ drag.current = null;
5301
+ setDragging(-1);
5302
+ },
5303
+ onDoubleClick: () => setWidths(null),
5304
+ onKeyDown: (e) => {
5305
+ if (e.altKey || e.metaKey || e.ctrlKey) return;
5306
+ if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
5307
+ e.preventDefault();
5308
+ const base = widths ?? measure();
5309
+ widen(j, base, base[j] + (e.key === "ArrowRight" ? 16 : -16));
5310
+ } else if (e.key === "Enter") {
5311
+ e.preventDefault();
5312
+ setWidths(null);
5313
+ }
5314
+ }
5315
+ }) : null]
5316
+ }, j)) }) }),
5317
+ /* @__PURE__ */ jsx("tbody", { children: p.rows.map((r, ri) => /* @__PURE__ */ jsx("tr", { children: r.map((cell, j) => /* @__PURE__ */ jsx("td", {
5318
+ className: p.numeric[j] ? "is-num" : void 0,
5319
+ style: p.align(j),
5320
+ "data-label": p.headText[j],
5321
+ children: cell
5322
+ }, j)) }, ri)) })
5323
+ ]
5324
+ });
5325
+ return /* @__PURE__ */ jsxs("div", {
5326
+ className: cx("ui-md-tablebox", dragging >= 0 && "is-resizing"),
5327
+ children: [
5328
+ /* @__PURE__ */ jsx("div", {
5329
+ className: "ui-md-table-tools",
5330
+ children: /* @__PURE__ */ jsx(IconButton, {
5331
+ className: "ui-md-table-big",
5332
+ icon: "corners-out",
5333
+ label: tr("放大表格"),
5334
+ onClick: () => setBig(true)
5335
+ })
5336
+ }),
5337
+ /* @__PURE__ */ jsx("div", {
5338
+ className: "ui-md-table-wrap",
5339
+ tabIndex: 0,
5340
+ role: "region",
5341
+ "aria-label": p.label,
5342
+ children: body(true)
5343
+ }),
5344
+ big ? /* @__PURE__ */ jsx(Dialog, {
5345
+ open: true,
5346
+ onClose: () => setBig(false),
5347
+ title: tr("表格"),
5348
+ className: "ui-md-table-dialog",
5349
+ children: /* @__PURE__ */ jsx("div", {
5350
+ className: "ui-md ui-md-table-wrap",
5351
+ tabIndex: 0,
5352
+ role: "region",
5353
+ "aria-label": p.label,
5354
+ children: body(false)
5355
+ })
5356
+ }) : null
5357
+ ]
5358
+ });
5359
+ }
5240
5360
  // src/components/Section/Section.tsx
5241
5361
  const Group = React.createContext(null);
5242
5362
  const MOVE_MS = 260;
@@ -5390,9 +5510,9 @@ function Section(p) {
5390
5510
  })]
5391
5511
  });
5392
5512
  }
5393
- /** A run of Sections with 「全部展開」 and 「全部收合」 above them. */
5394
- function SectionGroup({ children, actions, className }) {
5395
- const [all, setAll] = React.useState({
5513
+ /** A run of Sections with one 「全部展開/全部收合」 icon button. */
5514
+ function SectionGroup({ children, actions, bar = true, className }) {
5515
+ const [all, setAllState] = React.useState({
5396
5516
  n: 0,
5397
5517
  open: false
5398
5518
  });
@@ -5406,40 +5526,45 @@ function SectionGroup({ children, actions, className }) {
5406
5526
  };
5407
5527
  });
5408
5528
  }, []);
5529
+ const setAll = React.useCallback((open) => setAllState((a) => ({
5530
+ n: a.n + 1,
5531
+ open
5532
+ })), []);
5533
+ const vals = Object.values(states);
5534
+ const anyClosed = vals.length === 0 || vals.some((v) => !v);
5409
5535
  const ctx = React.useMemo(() => ({
5410
5536
  all,
5411
- report
5412
- }), [all, report]);
5413
- const vals = Object.values(states);
5414
- return /* @__PURE__ */ jsxs("div", {
5415
- className: cx("ui-sec-group", className),
5416
- children: [/* @__PURE__ */ jsxs("div", {
5417
- className: "ui-sec-bar",
5418
- children: [
5419
- actions ?? null,
5420
- /* @__PURE__ */ jsx(Button, {
5421
- icon: "arrows-out-line-vertical",
5422
- disabled: vals.length > 0 && vals.every(Boolean),
5423
- onClick: () => setAll((a) => ({
5424
- n: a.n + 1,
5425
- open: true
5426
- })),
5427
- children: tr("全部展開")
5428
- }),
5429
- /* @__PURE__ */ jsx(Button, {
5430
- icon: "arrows-in-line-vertical",
5431
- disabled: !vals.some(Boolean),
5432
- onClick: () => setAll((a) => ({
5433
- n: a.n + 1,
5434
- open: false
5435
- })),
5436
- children: tr("全部收合")
5437
- })
5438
- ]
5439
- }), /* @__PURE__ */ jsx(Group.Provider, {
5440
- value: ctx,
5441
- children
5442
- })]
5537
+ report,
5538
+ anyClosed,
5539
+ setAll
5540
+ }), [
5541
+ all,
5542
+ report,
5543
+ anyClosed,
5544
+ setAll
5545
+ ]);
5546
+ return /* @__PURE__ */ jsx(Group.Provider, {
5547
+ value: ctx,
5548
+ children: /* @__PURE__ */ jsxs("div", {
5549
+ className: cx("ui-sec-group", className),
5550
+ children: [bar ? /* @__PURE__ */ jsxs("div", {
5551
+ className: "ui-sec-bar",
5552
+ children: [actions ?? null, /* @__PURE__ */ jsx(SectionGroupToggle, {})]
5553
+ }) : null, children]
5554
+ })
5555
+ });
5556
+ }
5557
+ /** GB: the 「全部展開/全部收合」 icon button of the SectionGroup around it, for a place of your own (with bar={false}).
5558
+ * Opens every section while any is closed, else closes them all; its tooltip and name say which. */
5559
+ function SectionGroupToggle({ className }) {
5560
+ const g = React.useContext(Group);
5561
+ if (!g) return null;
5562
+ const open = g.anyClosed;
5563
+ return /* @__PURE__ */ jsx(IconButton, {
5564
+ className: cx("ui-sec-toggle", className),
5565
+ icon: open ? "arrows-out-line-vertical" : "arrows-in-line-vertical",
5566
+ label: open ? tr("全部展開") : tr("全部收合"),
5567
+ onClick: () => g.setAll(open)
5443
5568
  });
5444
5569
  }
5445
5570
  // src/components/KpiCard/KpiCard.tsx
@@ -5601,6 +5726,66 @@ function textWidth(text, size, code) {
5601
5726
  return c.measureText(text).width;
5602
5727
  }
5603
5728
  const TAG_KEEP = 8;
5729
+ const MIN_FRAME = 160;
5730
+ const MAX_EXTRA = 200;
5731
+ /** HC: the bar under the diagram: drag it, ↑↓ 16 px, Enter or a double-click back to the drawn height. */
5732
+ function HeightHandle(p) {
5733
+ const [dragging, setDragging] = React.useState(false);
5734
+ const from = React.useRef(null);
5735
+ return /* @__PURE__ */ jsx("div", {
5736
+ className: cx("ui-lg-resize", dragging && "is-dragging"),
5737
+ role: "separator",
5738
+ "aria-orientation": "horizontal",
5739
+ "aria-label": tr("調整架構圖高度"),
5740
+ "aria-valuenow": p.value,
5741
+ "aria-valuemin": p.min,
5742
+ "aria-valuemax": p.max,
5743
+ "aria-valuetext": tr("{n} px", { n: p.value }),
5744
+ tabIndex: 0,
5745
+ onPointerDown: (e) => {
5746
+ if (e.button !== 0) return;
5747
+ e.preventDefault();
5748
+ e.currentTarget.setPointerCapture(e.pointerId);
5749
+ from.current = {
5750
+ y: e.clientY,
5751
+ d: p.start()
5752
+ };
5753
+ setDragging(true);
5754
+ },
5755
+ onPointerMove: (e) => {
5756
+ if (!from.current) return;
5757
+ p.onDrag(from.current.d + e.clientY - from.current.y);
5758
+ },
5759
+ onPointerUp: () => {
5760
+ from.current = null;
5761
+ setDragging(false);
5762
+ },
5763
+ onPointerCancel: () => {
5764
+ from.current = null;
5765
+ setDragging(false);
5766
+ },
5767
+ onDoubleClick: p.onReset,
5768
+ onKeyDown: (e) => {
5769
+ if (e.altKey || e.metaKey || e.ctrlKey) return;
5770
+ if (e.key === "ArrowUp" || e.key === "ArrowDown") {
5771
+ e.preventDefault();
5772
+ p.onKey(e.key === "ArrowUp" ? -16 : 16);
5773
+ } else if (e.key === "Enter") {
5774
+ e.preventDefault();
5775
+ p.onReset();
5776
+ }
5777
+ },
5778
+ children: /* @__PURE__ */ jsxs("span", {
5779
+ className: "ui-lg-resize-grip",
5780
+ "aria-hidden": "true",
5781
+ children: [
5782
+ /* @__PURE__ */ jsx("i", {}),
5783
+ /* @__PURE__ */ jsx("i", {}),
5784
+ /* @__PURE__ */ jsx("i", {})
5785
+ ]
5786
+ })
5787
+ });
5788
+ }
5604
5789
  function labelWidth(text) {
5605
5790
  const parts = text.split(SPLIT).filter(Boolean);
5606
5791
  if (measure === void 0) measure = document.createElement("canvas").getContext("2d");
@@ -5704,6 +5889,22 @@ function LayerGraph(p) {
5704
5889
  const fitted = fit && fit.at === avail ? fit : null;
5705
5890
  const NW = fitted?.nw ?? (p.nodeWidth || 200);
5706
5891
  const GAP = 56;
5892
+ const [dh, setDhState] = React.useState(() => {
5893
+ if (!p.resizable || !p.heightKey) return 0;
5894
+ try {
5895
+ const v = Number(localStorage.getItem("ui-lg-height:" + p.heightKey));
5896
+ return Number.isFinite(v) ? v : 0;
5897
+ } catch {
5898
+ return 0;
5899
+ }
5900
+ });
5901
+ const setDh = React.useCallback((v) => {
5902
+ setDhState(v);
5903
+ if (!p.heightKey) return;
5904
+ try {
5905
+ localStorage.setItem("ui-lg-height:" + p.heightKey, String(Math.round(v)));
5906
+ } catch {}
5907
+ }, [p.heightKey]);
5707
5908
  const spreadKey = avail + "#" + p.nodes.map((n) => n.id).join("|") + "#" + p.edges.map((e) => e.from + ">" + e.to + ":" + (e.label ?? "")).join("|");
5708
5909
  const [spreadAt, setSpread] = React.useState({
5709
5910
  key: "",
@@ -5739,7 +5940,9 @@ function LayerGraph(p) {
5739
5940
  const layers = [...byLayer.keys()].sort((a, b) => a - b);
5740
5941
  const cols = Math.max(1, ...layers.map((l) => byLayer.get(l)?.length ?? 0));
5741
5942
  let W = 32 + cols * NW + (cols - 1) * COL;
5742
- const gaps = layers.map(() => GAP);
5943
+ const between = Math.max(0, layers.length - 1);
5944
+ const extra = p.resizable && dh > 0 && between ? Math.min(MAX_EXTRA, dh / scale / between) : 0;
5945
+ const gaps = layers.map((_, k) => GAP + (k < between ? extra : 0));
5743
5946
  let H = 0;
5744
5947
  const pos = {};
5745
5948
  const layerIndex = {};
@@ -6958,6 +7161,10 @@ function LayerGraph(p) {
6958
7161
  spread,
6959
7162
  spreadKey
6960
7163
  ]);
7164
+ const drawnH = H * scale;
7165
+ const naturalH = drawnH - Math.max(0, dh);
7166
+ const frameH = p.resizable && dh < 0 ? Math.max(Math.min(MIN_FRAME, naturalH), naturalH + dh) : null;
7167
+ const dragTo = (v) => Math.max(Math.min(MIN_FRAME, naturalH) - naturalH, Math.min(v, between ? MAX_EXTRA * between * scale : 0));
6961
7168
  return /* @__PURE__ */ jsxs("div", {
6962
7169
  className: cx("ui-graph ui-lg", p.className),
6963
7170
  children: [
@@ -7004,9 +7211,10 @@ function LayerGraph(p) {
7004
7211
  /* @__PURE__ */ jsx("div", {
7005
7212
  className: cx("ui-lg-scroller", scrollMore && "has-more", showList && "is-hidden"),
7006
7213
  children: /* @__PURE__ */ jsx("div", {
7007
- className: "ui-lg-scroll",
7214
+ className: cx("ui-lg-scroll", frameH != null && "is-framed"),
7008
7215
  ref: scrollRef,
7009
7216
  onScroll: onScrollKeep,
7217
+ style: frameH != null ? { height: frameH } : void 0,
7010
7218
  children: /* @__PURE__ */ jsxs("div", {
7011
7219
  className: "ui-lg-canvas",
7012
7220
  style: scale === 1 ? {
@@ -7054,6 +7262,15 @@ function LayerGraph(p) {
7054
7262
  })
7055
7263
  })
7056
7264
  }),
7265
+ p.resizable && !showList ? /* @__PURE__ */ jsx(HeightHandle, {
7266
+ value: Math.round(drawnH + Math.min(0, dh)),
7267
+ min: Math.round(Math.min(MIN_FRAME, drawnH)),
7268
+ max: Math.round(drawnH - Math.max(0, dh) + MAX_EXTRA * between * scale),
7269
+ onDrag: (d) => setDh(dragTo(d)),
7270
+ onKey: (step) => setDh(dragTo(dh + step)),
7271
+ onReset: () => setDh(0),
7272
+ start: () => dh
7273
+ }) : null,
7057
7274
  showList ? null : /* @__PURE__ */ jsx(ScrollHint, {
7058
7275
  show: overflows,
7059
7276
  done: scrolled
@@ -9191,6 +9408,6 @@ function TreeList(p) {
9191
9408
  })]
9192
9409
  });
9193
9410
  }
9194
- export { AccentPicker, ActionBar, Alert, AppShell, Badge, BarChart, Breadcrumb, Button, Calendar, Card, Checkbox, CodeText, CodeView, CommandPalette, DangerZone, DataTable, DatePicker, DateRangePicker, DetailList, Dialog, Drawer, EmptyState, ErrorPage, FileUpload, FormGrid, GraphDefs, GraphLegend, Grid, Icon, IconButton, InlineCode, KpiCard, LayerGraph, LineChart, LoadingBar, LoginCard, MOTION, Markdown, Menu, MobileTabBar, MultiSelect, NotificationBell, Page, Popover, ProgressBar, ProgressRing, ProjectSwitcher, RadioGroup, SearchField, Section, SectionGroup, Select, SettingsLayout, SettingsSection, SideNav, Skeleton, SplitPane, Suggestion, Switch, Tabs, Tag, Term, TextArea, TextField, ThemePicker, Toast, Tooltip, TopBar, Tour, TreeList, addMessages, announce, focusMain, format, icons, initTheme, isCodeRef, safeHref, setAccent, setLocale, setTheme, tr as t, useTour };
9411
+ export { AccentPicker, ActionBar, Alert, AppShell, Badge, BarChart, Breadcrumb, Button, Calendar, Card, Checkbox, CodeText, CodeView, CommandPalette, DangerZone, DataTable, DatePicker, DateRangePicker, DetailList, Dialog, Drawer, EmptyState, ErrorPage, FileUpload, FormGrid, GraphDefs, GraphLegend, Grid, Icon, IconButton, InlineCode, KpiCard, LayerGraph, LineChart, LoadingBar, LoginCard, MOTION, Markdown, Menu, MobileTabBar, MultiSelect, NotificationBell, Page, Popover, ProgressBar, ProgressRing, ProjectSwitcher, RadioGroup, SearchField, Section, SectionGroup, SectionGroupToggle, Select, SettingsLayout, SettingsSection, SideNav, Skeleton, SplitPane, Suggestion, Switch, Tabs, Tag, Term, TextArea, TextField, ThemePicker, Toast, Tooltip, TopBar, Tour, TreeList, addMessages, announce, focusMain, format, icons, initTheme, isCodeRef, safeHref, setAccent, setLocale, setTheme, tr as t, useTour };
9195
9412
 
9196
9413
  //# sourceMappingURL=index.js.map