dsh-plugin-core 0.34.0 → 0.35.1
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/adv/session/SessionViewModal.d.ts +20 -2
- package/dist/adv/session/SessionViewModal.d.ts.map +1 -1
- package/dist/adv/session/SessionViewModal.js +186 -73
- package/dist/adv/session/SessionViewModal.js.map +1 -1
- package/dist/adv/session/faces.d.ts +30 -7
- package/dist/adv/session/faces.d.ts.map +1 -1
- package/dist/adv/session/index.d.ts +1 -0
- package/dist/adv/session/index.d.ts.map +1 -1
- package/dist/adv/session/index.js +1 -0
- package/dist/adv/session/index.js.map +1 -1
- package/dist/adv/session/mirror/BashRow.d.ts.map +1 -1
- package/dist/adv/session/mirror/BashRow.js +11 -2
- package/dist/adv/session/mirror/BashRow.js.map +1 -1
- package/dist/adv/session/mirror/ChatView.d.ts +8 -0
- package/dist/adv/session/mirror/ChatView.d.ts.map +1 -1
- package/dist/adv/session/mirror/ChatView.js +8 -0
- package/dist/adv/session/mirror/ChatView.js.map +1 -1
- package/dist/adv/session/mirror/ContextBody.d.ts +24 -0
- package/dist/adv/session/mirror/ContextBody.d.ts.map +1 -0
- package/dist/adv/session/mirror/ContextBody.js +249 -0
- package/dist/adv/session/mirror/ContextBody.js.map +1 -0
- package/dist/adv/session/mirror/ContextInjectionRow.d.ts +21 -1
- package/dist/adv/session/mirror/ContextInjectionRow.d.ts.map +1 -1
- package/dist/adv/session/mirror/ContextInjectionRow.js +57 -29
- package/dist/adv/session/mirror/ContextInjectionRow.js.map +1 -1
- package/dist/adv/session/mirror/GenericCommandCard.d.ts +20 -0
- package/dist/adv/session/mirror/GenericCommandCard.d.ts.map +1 -1
- package/dist/adv/session/mirror/GenericCommandCard.js +89 -27
- package/dist/adv/session/mirror/GenericCommandCard.js.map +1 -1
- package/dist/adv/session/mirror/MessageIconActions.js +1 -1
- package/dist/adv/session/mirror/MessageIconActions.js.map +1 -1
- package/dist/adv/session/mirror/MessageImage.d.ts +23 -0
- package/dist/adv/session/mirror/MessageImage.d.ts.map +1 -0
- package/dist/adv/session/mirror/MessageImage.js +107 -0
- package/dist/adv/session/mirror/MessageImage.js.map +1 -0
- package/dist/adv/session/mirror/MessageItem.d.ts +11 -0
- package/dist/adv/session/mirror/MessageItem.d.ts.map +1 -1
- package/dist/adv/session/mirror/MessageItem.js +12 -2
- package/dist/adv/session/mirror/MessageItem.js.map +1 -1
- package/dist/adv/session/official-classes.d.ts +2 -0
- package/dist/adv/session/official-classes.d.ts.map +1 -1
- package/dist/adv/session/official-classes.js +3 -0
- package/dist/adv/session/official-classes.js.map +1 -1
- package/dist/adv/session/open-session-view.d.ts +6 -1
- package/dist/adv/session/open-session-view.d.ts.map +1 -1
- package/dist/adv/session/open-session-view.js +8 -0
- package/dist/adv/session/open-session-view.js.map +1 -1
- package/dist/adv/session/session-css.generated.d.ts +1 -1
- package/dist/adv/session/session-css.generated.d.ts.map +1 -1
- package/dist/adv/session/session-css.generated.js +1 -1
- package/dist/adv/session/session-css.generated.js.map +1 -1
- package/dist/design/tokens-css.generated.d.ts +1 -1
- package/dist/design/tokens-css.generated.d.ts.map +1 -1
- package/dist/design/tokens-css.generated.js +1 -1
- package/dist/design/tokens-css.generated.js.map +1 -1
- package/dist/ui/feedback/Modal.d.ts +7 -0
- package/dist/ui/feedback/Modal.d.ts.map +1 -1
- package/dist/ui/feedback/Modal.js +2 -0
- package/dist/ui/feedback/Modal.js.map +1 -1
- package/dist/ui/infra/overlay-css.generated.d.ts +1 -1
- package/dist/ui/infra/overlay-css.generated.d.ts.map +1 -1
- package/dist/ui/infra/overlay-css.generated.js +1 -1
- package/dist/ui/infra/overlay-css.generated.js.map +1 -1
- package/dist/ui/infra/overlay.d.ts +7 -0
- package/dist/ui/infra/overlay.d.ts.map +1 -1
- package/dist/ui/infra/overlay.js +6 -1
- package/dist/ui/infra/overlay.js.map +1 -1
- package/dist/ui/infra/panel-css.generated.d.ts +1 -1
- package/dist/ui/infra/panel-css.generated.d.ts.map +1 -1
- package/dist/ui/infra/panel-css.generated.js +1 -1
- package/dist/ui/infra/panel-css.generated.js.map +1 -1
- package/dist/ui/inputs/DateTimePicker.d.ts.map +1 -1
- package/dist/ui/inputs/DateTimePicker.js +3 -2
- package/dist/ui/inputs/DateTimePicker.js.map +1 -1
- package/dist/ui/inputs/Picker.d.ts.map +1 -1
- package/dist/ui/inputs/Picker.js +5 -3
- package/dist/ui/inputs/Picker.js.map +1 -1
- package/dist/ui/inputs/datetime-css.generated.d.ts +1 -1
- package/dist/ui/inputs/datetime-css.generated.d.ts.map +1 -1
- package/dist/ui/inputs/datetime-css.generated.js +1 -1
- package/dist/ui/inputs/datetime-css.generated.js.map +1 -1
- package/dist/ui/inputs/picker-css.generated.d.ts +1 -1
- package/dist/ui/inputs/picker-css.generated.d.ts.map +1 -1
- package/dist/ui/inputs/picker-css.generated.js +1 -1
- package/dist/ui/inputs/picker-css.generated.js.map +1 -1
- package/dist/ui/layout/PanelDock.d.ts.map +1 -1
- package/dist/ui/layout/PanelDock.js +38 -16
- package/dist/ui/layout/PanelDock.js.map +1 -1
- package/dist/ui/layout/panel-dock-css.generated.d.ts +1 -1
- package/dist/ui/layout/panel-dock-css.generated.d.ts.map +1 -1
- package/dist/ui/layout/panel-dock-css.generated.js +1 -1
- package/dist/ui/layout/panel-dock-css.generated.js.map +1 -1
- package/dist/utils/i18n.d.ts +2 -2
- package/dist/utils/i18n.d.ts.map +1 -1
- package/dist/utils/i18n.js +54 -0
- package/dist/utils/i18n.js.map +1 -1
- package/docs/design/external/dsh-host.md +22 -0
- package/docs/design/style.md +38 -10
- package/docs/help/session.doc.ts +19 -2
- package/docs/help/session.md +19 -2
- package/docs/help/ui.doc.ts +5 -5
- package/docs/help/ui.md +5 -5
- package/package.json +1 -1
package/docs/help/ui.doc.ts
CHANGED
|
@@ -383,8 +383,8 @@ const doc: DocTopic = {
|
|
|
383
383
|
en: 'Picker: single/multiple selection, cap, search, grouping, empty state — self-drawn. Keyboard: Esc closes, ↑↓ move the cursor, Enter selects. Logic reusable standalone: `toGroups` / `filterGroups` / `toggleValue`.',
|
|
384
384
|
},
|
|
385
385
|
{
|
|
386
|
-
zh: '首屏分页:`limit`
|
|
387
|
-
en: 'First-page paging: `limit` slices by **option count** across groups; "Show more"
|
|
386
|
+
zh: '首屏分页:`limit` 按**选项条数**跨组切片,列表末尾「显示更多」(跟在最后一条后,像多一条选项)每点一次再追加 `limit` 条;搜索结果走同一套分页,换搜索词或重新展开都回到首屏。不传 `limit` 就是全量渲染。`PickerOption.keywords` 是可选的单个字符串(调用方自己拼),只和 `label` 拼起来参与大小写不敏感子串匹配,**绝不渲染**——适合任务 UUID 这种「用户能贴、但不该显示」的搜索词。纯逻辑另可单用 `sliceGroups`。',
|
|
387
|
+
en: 'First-page paging: `limit` slices by **option count** across groups; "Show more" rendered as the last row of the list appends another `limit` each click. Search results use the same paging and reset to the first page on a new query or reopen. No `limit` means render everything. `PickerOption.keywords` is an optional single string (joined by the caller) that participates in case-insensitive substring matching together with `label` but is **never rendered** — for search terms like a task UUID that users paste but should not see. `sliceGroups` is also exported as pure logic.',
|
|
388
388
|
},
|
|
389
389
|
{
|
|
390
390
|
zh: 'WorkspacePicker:数据自带的领域选择器。在插件 apply 里调一次 `connectHost(ctx)`,组件即订阅官方 `workspaces` 快照。未接线 = 空态,不编造数据。',
|
|
@@ -405,7 +405,7 @@ const doc: DocTopic = {
|
|
|
405
405
|
{ name: 'mode', type: "'single' | 'multiple'", def: "'single'", desc: { zh: '—', en: '—' } },
|
|
406
406
|
{ name: 'max', type: 'number', def: '—', desc: { zh: '多选上限;到上限其余项置灰 + 提示(不静默截断)', en: 'Multiple-select cap; at cap others grey out + a hint (no silent truncation)' } },
|
|
407
407
|
{ name: 'searchable', type: 'boolean', def: "'false'", desc: { zh: '显示搜索框;展开菜单时自动聚焦搜索框', en: 'Shows a search box; auto-focuses it when the menu opens' } },
|
|
408
|
-
{ name: 'limit', type: 'number', def: '—', desc: { zh: '
|
|
408
|
+
{ name: 'limit', type: 'number', def: '—', desc: { zh: '首屏显示的选项条数(跨组计);列表末尾「显示更多」每次再追加同样条数,搜索结果同样分页。不传 = 全量', en: 'Options shown on the first page (counted across groups); "Show more" appends the same amount each click, search results included. Omitted = all' } },
|
|
409
409
|
{ name: 'options[].keywords', type: 'string', def: '—', desc: { zh: '只参与搜索、不渲染的额外关键词(单个字符串,调用方自行拼接)', en: 'Extra search-only keyword, never rendered (one string, joined by the caller)' } },
|
|
410
410
|
{ name: 'align', type: "'left' | 'center'", def: "'left'", desc: { zh: '触发器文字对齐', en: 'Trigger text alignment' } },
|
|
411
411
|
{ name: 'clearable', type: 'boolean', def: "'false'", desc: { zh: '单选时列表顶部多一项「不选」', en: 'In single mode, adds a "none" item at the top of the list' } },
|
|
@@ -532,8 +532,8 @@ const doc: DocTopic = {
|
|
|
532
532
|
en: 'The popup shares Picker’s mechanics (floating-ui layer, edge flip, outside-click close, no mask): two end boxes + two independent calendars (left = start, right = end, each picks its own, no span marking) + per-end hour/minute/second steppers (▲▼, direct typing, ↑↓ keys — no clicking through 60 minutes; **time never requires picking a date first** — on confirm, no date means no data emitted). Quick button: "Today" at day precision (date only), "Now" when hours/minutes/seconds are on (sets date + time together, editable afterwards). Draft state; onChange only on confirm; Esc / outside = discard. Calendar keys: arrows move, PageUp/Down change month, Home/End jump to month bounds, Enter selects. When end precedes start, confirm greys out with a hint.',
|
|
533
533
|
},
|
|
534
534
|
{
|
|
535
|
-
zh: '`presets` 只在 range 生效:弹层拆成左区(两个端框 + 两块日历,同宽、上下对齐)与右侧一整列快捷按钮(从端框那行竖排到日历底部,一条竖线隔开,按钮多了自己滚)。**列宽固定容下英文缩写最长那档**(中文两字居中),列高严格等于左侧日历区,档位多了只在列内滚动、不把弹层撑高;按钮文字居中。快捷按钮(`size="sm"`)与两个端框(`size="md"`)**都复用核心 `Button`**(选中态走 `color` 轴),不另写皮肤、圆角与全站一致;`label` 由调用方给,给 `{ zh, en }` 双语对象即随 `setLocale` 自动切换(核心不内置文案)。`expr` 用 Grafana / Elasticsearch 的 date math 子集——`now/d` 今天、`now-1d/d` 昨天、`now/w` 本周、`now-1w/w` 上周、`now/M` 本月、`now-1M/M` 上月、`now/Q` 本季度、`now-1Q/Q` 上季度、`now/y` 今年、`now-1y/y` 去年(`Q` 季、`M` 月、`m` 分),`expr: null`
|
|
536
|
-
en: '`presets` applies to range only: the popup splits into a left zone (two end boxes + two calendars, same width and aligned) and one full-height shortcut column on the right (runs from the end-box row down past the calendars, separated by a vertical rule, scrolls when crowded). **Column width is fixed to fit the longest short English label** (two Chinese characters sit centered), its height exactly matches the left calendar zone, and extra items scroll inside the column without growing the popup; button text is centered. Shortcut buttons (`size="sm"`) and both end boxes (`size="md"`) **reuse the core `Button`** (active via the `color` axis) — no local skin, corner radius matches the rest of the kit; labels come from the caller, and a `{ zh, en }` object switches with `setLocale` (no built-in copy). `expr` uses the Grafana / Elasticsearch date math subset — `now/d` today, `now-1d/d` yesterday, `now/w` this week, `now-1w/w` last week, `now/M` this month, `now-1M/M` last month, `now/Q` this quarter, `now-1Q/Q` last quarter, `now/y` this year, `now-1y/y` last year (`Q` quarter, `M` month, `m` minute); `expr: null` clears both ends. A click
|
|
535
|
+
zh: '`presets` 只在 range 生效:弹层拆成左区(两个端框 + 两块日历,同宽、上下对齐)与右侧一整列快捷按钮(从端框那行竖排到日历底部,一条竖线隔开,按钮多了自己滚)。**列宽固定容下英文缩写最长那档**(中文两字居中),列高严格等于左侧日历区,档位多了只在列内滚动、不把弹层撑高;按钮文字居中。快捷按钮(`size="sm"`)与两个端框(`size="md"`)**都复用核心 `Button`**(选中态走 `color` 轴),不另写皮肤、圆角与全站一致;`label` 由调用方给,给 `{ zh, en }` 双语对象即随 `setLocale` 自动切换(核心不内置文案)。`expr` 用 Grafana / Elasticsearch 的 date math 子集——`now/d` 今天、`now-1d/d` 昨天、`now/w` 本周、`now-1w/w` 上周、`now/M` 本月、`now-1M/M` 上月、`now/Q` 本季度、`now-1Q/Q` 上季度、`now/y` 今年、`now-1y/y` 去年(`Q` 季、`M` 月、`m` 分),`expr: null` 即清空起止。点一下只把两端填进弹层草稿、面板不关,当场看得见两端与日历一起变;**点「确定」才 onChange**(不点确定,外面那个触发器不变)。选中态只按当前起止与各项算出的起止逐一比对:撞上就亮,一个没撞上就整排不亮(不显示「自定义」);每次渲染按当天重算,不用记状态。',
|
|
536
|
+
en: '`presets` applies to range only: the popup splits into a left zone (two end boxes + two calendars, same width and aligned) and one full-height shortcut column on the right (runs from the end-box row down past the calendars, separated by a vertical rule, scrolls when crowded). **Column width is fixed to fit the longest short English label** (two Chinese characters sit centered), its height exactly matches the left calendar zone, and extra items scroll inside the column without growing the popup; button text is centered. Shortcut buttons (`size="sm"`) and both end boxes (`size="md"`) **reuse the core `Button`** (active via the `color` axis) — no local skin, corner radius matches the rest of the kit; labels come from the caller, and a `{ zh, en }` object switches with `setLocale` (no built-in copy). `expr` uses the Grafana / Elasticsearch date math subset — `now/d` today, `now-1d/d` yesterday, `now/w` this week, `now-1w/w` last week, `now/M` this month, `now-1M/M` last month, `now/Q` this quarter, `now-1Q/Q` last quarter, `now/y` this year, `now-1y/y` last year (`Q` quarter, `M` month, `m` minute); `expr: null` clears both ends. A click only fills the draft inside the popup and keeps it open, so both ends and the calendars visibly jump together; **`onChange` fires on Confirm** (dismiss without confirming and the trigger stays as it was). The active state is pure value comparison against each preset’s resolved range: matches light up, no match leaves the whole column unlit (no "Custom" item). Ranges are recomputed against the current day on every render; no state is kept.',
|
|
537
537
|
},
|
|
538
538
|
{
|
|
539
539
|
zh: '`value` 永远只放具体日期:短词只是「怎么算出这两个日期」的配方,不进值(与 Ant Design `presets` / MUI X `shortcuts` 同口径),因此不存在「这是时间点还是相对表达式」的字符串歧义。`width` 覆盖**整个触发器**(数字按 px、字符串按 CSS 长度原样),直接盖掉按 precision 写死的默认宽,核心不换算;两个日期区仍平分,过窄自动省略。不传 `presets` 就没有右侧快捷列与竖线;不传 `width` 时触发器仍按 precision 走默认宽。两个端框现已统一到核心 `Button` 皮肤,range 弹层外观与全站一致。',
|
package/docs/help/ui.md
CHANGED
|
@@ -94,9 +94,9 @@ Picker:单 / 多选、上限、搜索、分组、空态,自绘。键盘:Es
|
|
|
94
94
|
|
|
95
95
|
> EN: Picker: single/multiple selection, cap, search, grouping, empty state — self-drawn. Keyboard: Esc closes, ↑↓ move the cursor, Enter selects. Logic reusable standalone: `toGroups` / `filterGroups` / `toggleValue`.
|
|
96
96
|
|
|
97
|
-
首屏分页:`limit`
|
|
97
|
+
首屏分页:`limit` 按**选项条数**跨组切片,列表末尾「显示更多」(跟在最后一条后,像多一条选项)每点一次再追加 `limit` 条;搜索结果走同一套分页,换搜索词或重新展开都回到首屏。不传 `limit` 就是全量渲染。`PickerOption.keywords` 是可选的单个字符串(调用方自己拼),只和 `label` 拼起来参与大小写不敏感子串匹配,**绝不渲染**——适合任务 UUID 这种「用户能贴、但不该显示」的搜索词。纯逻辑另可单用 `sliceGroups`。
|
|
98
98
|
|
|
99
|
-
> EN: First-page paging: `limit` slices by **option count** across groups; "Show more"
|
|
99
|
+
> EN: First-page paging: `limit` slices by **option count** across groups; "Show more" rendered as the last row of the list appends another `limit` each click. Search results use the same paging and reset to the first page on a new query or reopen. No `limit` means render everything. `PickerOption.keywords` is an optional single string (joined by the caller) that participates in case-insensitive substring matching together with `label` but is **never rendered** — for search terms like a task UUID that users paste but should not see. `sliceGroups` is also exported as pure logic.
|
|
100
100
|
|
|
101
101
|
WorkspacePicker:数据自带的领域选择器。在插件 apply 里调一次 `connectHost(ctx)`,组件即订阅官方 `workspaces` 快照。未接线 = 空态,不编造数据。
|
|
102
102
|
|
|
@@ -114,7 +114,7 @@ ModelPicker:数据自带,`variant` 为 `grouped`(默认)/ `cascade`;`o
|
|
|
114
114
|
| `mode` | `'single' \| 'multiple'` | 'single' | — | — |
|
|
115
115
|
| `max` | `number` | — | 多选上限;到上限其余项置灰 + 提示(不静默截断) | Multiple-select cap; at cap others grey out + a hint (no silent truncation) |
|
|
116
116
|
| `searchable` | `boolean` | 'false' | 显示搜索框;展开菜单时自动聚焦搜索框 | Shows a search box; auto-focuses it when the menu opens |
|
|
117
|
-
| `limit` | `number` | — |
|
|
117
|
+
| `limit` | `number` | — | 首屏显示的选项条数(跨组计);列表末尾「显示更多」每次再追加同样条数,搜索结果同样分页。不传 = 全量 | Options shown on the first page (counted across groups); "Show more" appends the same amount each click, search results included. Omitted = all |
|
|
118
118
|
| `options[].keywords` | `string` | — | 只参与搜索、不渲染的额外关键词(单个字符串,调用方自行拼接) | Extra search-only keyword, never rendered (one string, joined by the caller) |
|
|
119
119
|
| `align` | `'left' \| 'center'` | 'left' | 触发器文字对齐 | Trigger text alignment |
|
|
120
120
|
| `clearable` | `boolean` | 'false' | 单选时列表顶部多一项「不选」 | In single mode, adds a "none" item at the top of the list |
|
|
@@ -273,9 +273,9 @@ h(InputGroup, {
|
|
|
273
273
|
|
|
274
274
|
> EN: The popup shares Picker’s mechanics (floating-ui layer, edge flip, outside-click close, no mask): two end boxes + two independent calendars (left = start, right = end, each picks its own, no span marking) + per-end hour/minute/second steppers (▲▼, direct typing, ↑↓ keys — no clicking through 60 minutes; **time never requires picking a date first** — on confirm, no date means no data emitted). Quick button: "Today" at day precision (date only), "Now" when hours/minutes/seconds are on (sets date + time together, editable afterwards). Draft state; onChange only on confirm; Esc / outside = discard. Calendar keys: arrows move, PageUp/Down change month, Home/End jump to month bounds, Enter selects. When end precedes start, confirm greys out with a hint.
|
|
275
275
|
|
|
276
|
-
`presets` 只在 range 生效:弹层拆成左区(两个端框 + 两块日历,同宽、上下对齐)与右侧一整列快捷按钮(从端框那行竖排到日历底部,一条竖线隔开,按钮多了自己滚)。**列宽固定容下英文缩写最长那档**(中文两字居中),列高严格等于左侧日历区,档位多了只在列内滚动、不把弹层撑高;按钮文字居中。快捷按钮(`size="sm"`)与两个端框(`size="md"`)**都复用核心 `Button`**(选中态走 `color` 轴),不另写皮肤、圆角与全站一致;`label` 由调用方给,给 `{ zh, en }` 双语对象即随 `setLocale` 自动切换(核心不内置文案)。`expr` 用 Grafana / Elasticsearch 的 date math 子集——`now/d` 今天、`now-1d/d` 昨天、`now/w` 本周、`now-1w/w` 上周、`now/M` 本月、`now-1M/M` 上月、`now/Q` 本季度、`now-1Q/Q` 上季度、`now/y` 今年、`now-1y/y` 去年(`Q` 季、`M` 月、`m` 分),`expr: null`
|
|
276
|
+
`presets` 只在 range 生效:弹层拆成左区(两个端框 + 两块日历,同宽、上下对齐)与右侧一整列快捷按钮(从端框那行竖排到日历底部,一条竖线隔开,按钮多了自己滚)。**列宽固定容下英文缩写最长那档**(中文两字居中),列高严格等于左侧日历区,档位多了只在列内滚动、不把弹层撑高;按钮文字居中。快捷按钮(`size="sm"`)与两个端框(`size="md"`)**都复用核心 `Button`**(选中态走 `color` 轴),不另写皮肤、圆角与全站一致;`label` 由调用方给,给 `{ zh, en }` 双语对象即随 `setLocale` 自动切换(核心不内置文案)。`expr` 用 Grafana / Elasticsearch 的 date math 子集——`now/d` 今天、`now-1d/d` 昨天、`now/w` 本周、`now-1w/w` 上周、`now/M` 本月、`now-1M/M` 上月、`now/Q` 本季度、`now-1Q/Q` 上季度、`now/y` 今年、`now-1y/y` 去年(`Q` 季、`M` 月、`m` 分),`expr: null` 即清空起止。点一下只把两端填进弹层草稿、面板不关,当场看得见两端与日历一起变;**点「确定」才 onChange**(不点确定,外面那个触发器不变)。选中态只按当前起止与各项算出的起止逐一比对:撞上就亮,一个没撞上就整排不亮(不显示「自定义」);每次渲染按当天重算,不用记状态。
|
|
277
277
|
|
|
278
|
-
> EN: `presets` applies to range only: the popup splits into a left zone (two end boxes + two calendars, same width and aligned) and one full-height shortcut column on the right (runs from the end-box row down past the calendars, separated by a vertical rule, scrolls when crowded). **Column width is fixed to fit the longest short English label** (two Chinese characters sit centered), its height exactly matches the left calendar zone, and extra items scroll inside the column without growing the popup; button text is centered. Shortcut buttons (`size="sm"`) and both end boxes (`size="md"`) **reuse the core `Button`** (active via the `color` axis) — no local skin, corner radius matches the rest of the kit; labels come from the caller, and a `{ zh, en }` object switches with `setLocale` (no built-in copy). `expr` uses the Grafana / Elasticsearch date math subset — `now/d` today, `now-1d/d` yesterday, `now/w` this week, `now-1w/w` last week, `now/M` this month, `now-1M/M` last month, `now/Q` this quarter, `now-1Q/Q` last quarter, `now/y` this year, `now-1y/y` last year (`Q` quarter, `M` month, `m` minute); `expr: null` clears both ends. A click
|
|
278
|
+
> EN: `presets` applies to range only: the popup splits into a left zone (two end boxes + two calendars, same width and aligned) and one full-height shortcut column on the right (runs from the end-box row down past the calendars, separated by a vertical rule, scrolls when crowded). **Column width is fixed to fit the longest short English label** (two Chinese characters sit centered), its height exactly matches the left calendar zone, and extra items scroll inside the column without growing the popup; button text is centered. Shortcut buttons (`size="sm"`) and both end boxes (`size="md"`) **reuse the core `Button`** (active via the `color` axis) — no local skin, corner radius matches the rest of the kit; labels come from the caller, and a `{ zh, en }` object switches with `setLocale` (no built-in copy). `expr` uses the Grafana / Elasticsearch date math subset — `now/d` today, `now-1d/d` yesterday, `now/w` this week, `now-1w/w` last week, `now/M` this month, `now-1M/M` last month, `now/Q` this quarter, `now-1Q/Q` last quarter, `now/y` this year, `now-1y/y` last year (`Q` quarter, `M` month, `m` minute); `expr: null` clears both ends. A click only fills the draft inside the popup and keeps it open, so both ends and the calendars visibly jump together; **`onChange` fires on Confirm** (dismiss without confirming and the trigger stays as it was). The active state is pure value comparison against each preset’s resolved range: matches light up, no match leaves the whole column unlit (no "Custom" item). Ranges are recomputed against the current day on every render; no state is kept.
|
|
279
279
|
|
|
280
280
|
`value` 永远只放具体日期:短词只是「怎么算出这两个日期」的配方,不进值(与 Ant Design `presets` / MUI X `shortcuts` 同口径),因此不存在「这是时间点还是相对表达式」的字符串歧义。`width` 覆盖**整个触发器**(数字按 px、字符串按 CSS 长度原样),直接盖掉按 precision 写死的默认宽,核心不换算;两个日期区仍平分,过窄自动省略。不传 `presets` 就没有右侧快捷列与竖线;不传 `width` 时触发器仍按 precision 走默认宽。两个端框现已统一到核心 `Button` 皮肤,range 弹层外观与全站一致。
|
|
281
281
|
|
package/package.json
CHANGED