create-dwy 0.19.0 → 0.20.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/CHANGELOG.md +21 -0
- package/package.json +1 -1
- package/src/cli-help.js +28 -2
- package/src/prompt-style.js +82 -0
- package/src/searchable-select.js +12 -29
- package/src/sync-all.js +95 -583
- package/src/sync-codex.js +14 -7
- package/src/sync-opencode.js +8 -22
- package/src/sync.js +60 -149
- package/src/tab-multiselect.js +21 -64
- package/templates/ai-tools/CHANGELOG.md +195 -0
- package/templates/ai-tools/CLAUDE.md +39 -58
- package/templates/ai-tools/VERSION +1 -1
- package/templates/ai-tools/hooks/Git/pre-git-commit-ai-signature-check.sh +5 -4
- package/templates/ai-tools/rules/Android/dwy-android-core.md +147 -13
- package/templates/ai-tools/rules/Android/dwy-android-layering.md +142 -0
- package/templates/ai-tools/rules/Android/dwy-android-mvp.md +55 -0
- package/templates/ai-tools/rules/Android/dwy-android-support-only.md +2 -0
- package/templates/ai-tools/rules/Docker/dwy-docker.md +23 -1
- package/templates/ai-tools/rules/Flutter/dwy-flutter-core.md +2 -0
- package/templates/ai-tools/rules/Flutter/dwy-flutter-testing.md +1 -1
- package/templates/ai-tools/rules/HarmonyOS/dwy-arkts-ui-build.md +12 -8
- package/templates/ai-tools/rules/Python/dwy-python-backend.md +4 -43
- package/templates/ai-tools/rules/Python/dwy-python-base-lib.md +1 -1
- package/templates/ai-tools/rules/Python/dwy-python-layering.md +169 -0
- package/templates/ai-tools/rules/Vue/dwy-vue-core.md +11 -49
- package/templates/ai-tools/rules/Vue/dwy-vue-layering.md +153 -0
- package/templates/ai-tools/rules/iOS/dwy-apple-layering.md +133 -0
- package/templates/ai-tools/rules/iOS/dwy-swift-core.md +2 -0
- package/templates/ai-tools/rules//345/274/200/345/217/221/346/265/201/347/250/213/dwy-code-craft.md +83 -0
- package/templates/ai-tools/rules//345/274/200/345/217/221/346/265/201/347/250/213/dwy-dependency-freshness.md +27 -66
- package/templates/ai-tools/rules//345/274/200/345/217/221/346/265/201/347/250/213/dwy-git-commit.md +8 -219
- package/templates/ai-tools/rules//345/274/200/345/217/221/346/265/201/347/250/213/dwy-oss-commercial-license.md +27 -123
- package/templates/ai-tools/rules//345/274/200/345/217/221/346/265/201/347/250/213/dwy-prod-branch.md +31 -0
- package/templates/ai-tools/rules//346/225/260/346/215/256/345/272/223/dwy-postgres.md +17 -10
- package/templates/ai-tools/rules//346/225/260/346/215/256/345/272/223/dwy-redis.md +6 -3
- package/templates/ai-tools/skills/Docker/dwy-deploy-first/SKILL.md +14 -14
- package/templates/ai-tools/skills/Docker/dwy-deploy-first/references/chapter-01-mirrors.md +2 -2
- package/templates/ai-tools/skills/Docker/dwy-docker/SKILL.md +21 -13
- package/templates/ai-tools/skills/Docker/dwy-docker/references/ask-templates.md +13 -12
- package/templates/ai-tools/skills/Docker/dwy-docker/references/templates.md +3 -1
- package/templates/ai-tools/skills/Docker/dwy-docker/references/version-rules.md +10 -6
- package/templates/ai-tools/skills/Docker/dwy-docker/scripts/query_dockerhub.py +21 -6
- package/templates/ai-tools/skills/Docker/dwy-docker/scripts/scan_images.sh +2 -2
- package/templates/ai-tools/skills/Docker/dwy-mirror-source/SKILL.md +44 -30
- package/templates/ai-tools/skills/Docker/dwy-mirror-source/references/dockerfile-snippets.md +2 -0
- package/templates/ai-tools/skills/Docker/dwy-mirror-source/references/mirror-providers.md +8 -8
- package/templates/ai-tools/skills/Docker/dwy-mirror-source/scripts/apply_mirrors.py +14 -1
- package/templates/ai-tools/skills/Docker/dwy-mirror-source/scripts/check_mirrors.py +4 -0
- package/templates/ai-tools/skills/DolphinDB/dwy-dolphindb/SKILL.md +8 -6
- package/templates/ai-tools/skills/DolphinDB/dwy-dolphindb/references/digest/python-sdk.md +3 -3
- package/templates/ai-tools/skills/DolphinDB/dwy-dolphindb/references/digest/stream-engine.md +2 -2
- package/templates/ai-tools/skills/DolphinDB/dwy-dolphindb/references/review-rules/anti-patterns.md +3 -1
- package/templates/ai-tools/skills/DolphinDB/dwy-dolphindb/references/review-rules/change-checklist.md +4 -4
- package/templates/ai-tools/skills/DolphinDB/dwy-dolphindb/references/review-rules/lethal-violations.md +5 -5
- package/templates/ai-tools/skills/DolphinDB/dwy-dolphindb/references/review-rules/perf-baselines.md +5 -5
- package/templates/ai-tools/skills/Python/dwy-eapi/SKILL.md +59 -200
- package/templates/ai-tools/skills/Python/dwy-eapi/shared/anticorruption.md +13 -0
- package/templates/ai-tools/skills/Python/dwy-eapi/shared/layering.md +5 -0
- package/templates/ai-tools/skills/Python/dwy-eapi/shared/response-envelope.md +20 -0
- package/templates/ai-tools/skills/Python/dwy-eapi/shared/timezone.md +7 -0
- package/templates/ai-tools/skills/Python/dwy-eapi/v0/breaking.md +15 -0
- package/templates/ai-tools/skills/Python/dwy-eapi/v0/email-canonical.md +43 -0
- package/templates/ai-tools/skills/Python/dwy-eapi/v0/index.md +103 -0
- package/templates/ai-tools/skills/Python/dwy-eapi/v0/providers-email.md +49 -0
- package/templates/ai-tools/skills/Python/dwy-eapi/versions.yml +13 -0
- package/templates/ai-tools/skills/Vue/dwy-eui/SKILL.md +62 -306
- package/templates/ai-tools/skills/Vue/dwy-eui/references/eui-design-guide.md +8 -1
- package/templates/ai-tools/skills/Vue/dwy-eui/references/eui-integration-guide.md +0 -31
- package/templates/ai-tools/skills/Vue/dwy-eui/shared/config-theme.md +8 -0
- package/templates/ai-tools/skills/Vue/dwy-eui/shared/form.md +6 -0
- package/templates/ai-tools/skills/Vue/dwy-eui/shared/overlay.md +6 -0
- package/templates/ai-tools/skills/Vue/dwy-eui/shared/reka.md +5 -0
- package/templates/ai-tools/skills/Vue/dwy-eui/v1/index.md +8 -0
- package/templates/ai-tools/skills/Vue/dwy-eui/v2/breaking.md +14 -0
- package/templates/ai-tools/skills/Vue/dwy-eui/v2/index.md +55 -0
- package/templates/ai-tools/skills/Vue/dwy-eui/v2/lookup.md +29 -0
- package/templates/ai-tools/skills/Vue/dwy-eui/versions.yml +12 -0
- package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-architecture/SKILL.md +11 -14
- package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-product-launcher/references/state-and-contract.md +1 -1
- package/templates/ai-tools/skills//344/272/247/345/223/2010/345/210/2601/dwy-prototype/SKILL.md +1 -1
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-github-action-publish/SKILL.md +32 -15
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-github-action-publish/references/electron-release-workflow-template.yml +3 -1
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-github-action-publish/references/release-workflow-template.yml +8 -5
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-ios-app-store-release/SKILL.md +1 -1
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-ios-app-store-release/assets/appstore-submission.yaml +1 -1
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-ios-app-store-release/references/aso.md +2 -0
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-ios-app-store-release/references/in-app-purchase-review.md +1 -1
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/SKILL.md +4 -3
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/android.md +1 -1
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/backend-deploy.md +1 -1
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/changelog.md +45 -27
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/frontend-deploy.md +1 -1
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/generic-release.md +1 -1
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/git-tag.md +1 -1
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/harmony.md +1 -1
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-publish/references/ios.md +1 -1
- package/templates/ai-tools/skills//345/217/221/345/270/203/345/217/221/347/211/210/dwy-semver/SKILL.md +8 -0
- package/templates/ai-tools/skills//345/256/211/345/205/250/dwy-deploy-audit/SKILL.md +7 -7
- package/templates/ai-tools/skills//345/256/211/345/205/250/dwy-deploy-audit/references/checks-runtime.md +63 -59
- package/templates/ai-tools/skills//345/256/211/345/205/250/dwy-deploy-audit/scripts/check_base.sh +10 -1
- package/templates/ai-tools/skills//345/256/211/345/205/250/dwy-deploy-audit/scripts/check_capacity.sh +21 -23
- package/templates/ai-tools/skills//345/256/211/345/205/250/dwy-deploy-audit/scripts/check_db.sh +9 -1
- package/templates/ai-tools/skills//345/256/211/345/205/250/dwy-deploy-audit/scripts/check_docker.sh +20 -24
- package/templates/ai-tools/skills//345/256/211/345/205/250/dwy-deploy-audit/scripts/check_logs.sh +3 -3
- package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/dwy-doubao-tts/SKILL.md +4 -2
- package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/dwy-doubao-tts/references/api.md +1 -1
- package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/dwy-doubao-tts/scripts/synthesize.py +1 -0
- package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/media-platform-packaging/SKILL.md +7 -5
- package/templates/ai-tools/skills//350/207/252/345/252/222/344/275/223/media-platform-packaging/references/platform-copy-examples.md +5 -3
- package/templates/ai-tools/skills//351/200/232/347/224/250/dwy-dependency-choice/SKILL.md +140 -0
- package/templates/ai-tools/skills//351/200/232/347/224/250/dwy-git-commit/SKILL.md +113 -0
- package/templates/ai-tools/skills//351/200/232/347/224/250/dwy-shared/SKILL.md +16 -13
- package/templates/ai-tools/skills//351/200/232/347/224/250/dwy-whiteboard-prototype/SKILL.md +1 -1
- package/src/sync-packs.js +0 -223
- package/src/sync-scene.js +0 -178
- package/templates/ai-tools/rules//345/274/200/345/217/221/346/265/201/347/250/213/dwy-tdd-development.md +0 -115
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# create-dwy
|
|
2
2
|
|
|
3
|
+
## 0.20.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 同步流程简化为 Skills → Rules → 全局/当前项目 → 平台 → 确认。按实际分类逐项勾选,无回退;移除动作、初始化、同步范围、技术栈包和场景包菜单。
|
|
8
|
+
- 全局同步整套配置到 Claude Code、Codex、OpenCode 用户目录,保留个人规则和设置;Cursor 只提供项目规则同步。
|
|
9
|
+
- 最终确认列出更新和删除的托管项;取消不写配置,不清理未选择的平台。旧同步记录沿用已选条目。
|
|
10
|
+
- Hooks 按支持的平台自动同步;Commands 停用,保留已有命令文件。
|
|
11
|
+
- 启动展示 dwy 品牌;列表只展示勾选框和名称,移除重复类型标签。
|
|
12
|
+
- `dwy --help` 补充同步步骤、交互按键、常见用法及平台支持说明。
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 0.19.1
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 上下移动时当前条目用指针 + 反底标出。原先只靠 dim,已勾选或 JetBrains 终端里看不出光标。
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
3
24
|
## 0.19.0
|
|
4
25
|
|
|
5
26
|
### Minor Changes
|
package/package.json
CHANGED
package/src/cli-help.js
CHANGED
|
@@ -13,12 +13,38 @@ export function buildHelpText(version) {
|
|
|
13
13
|
return [
|
|
14
14
|
`dwy ${version}`,
|
|
15
15
|
'',
|
|
16
|
-
'
|
|
17
|
-
' dwy
|
|
16
|
+
'用法:',
|
|
17
|
+
' dwy 选择 Skills / Rules,再同步到全局或项目',
|
|
18
18
|
' dwy sync 同上',
|
|
19
19
|
' dwy upgrade 把 dwy 升级到 npm 最新正式版',
|
|
20
20
|
' dwy --help 显示本说明',
|
|
21
21
|
' dwy --version 显示版本',
|
|
22
22
|
'',
|
|
23
|
+
'同步步骤:',
|
|
24
|
+
' 1. 选择 Skills,再选择 Rules;按分类逐项勾选。',
|
|
25
|
+
' 2. 选择当前项目或全局,再选择要同步的平台。',
|
|
26
|
+
' 3. 查看更新、删除项,确认后才写入;取消不写文件。',
|
|
27
|
+
' Hooks 按平台自动同步,无需选择;Commands 不参与同步。',
|
|
28
|
+
'',
|
|
29
|
+
'交互按键:',
|
|
30
|
+
' Skills / Rules:←/→ 切分类,↑/↓ 移动,Space 勾选,a 全选/清空当前分类。',
|
|
31
|
+
' 位置 / 平台:↑/↓ 移动;平台用 Space 勾选,可输入关键字筛选。',
|
|
32
|
+
' Enter 确认当前步骤,Esc 或 Ctrl+C 取消。',
|
|
33
|
+
'',
|
|
34
|
+
'常见用法:',
|
|
35
|
+
' 同步当前项目:cd your-project 后执行 dwy,在位置步骤选择「当前项目」。',
|
|
36
|
+
' 同步全局配置:任意目录执行 dwy,在位置步骤选择「全局」。',
|
|
37
|
+
' 更新或调整配置:再次执行 dwy sync,检查勾选项,再确认同步。',
|
|
38
|
+
' 更新 CLI:dwy upgrade(全局安装时可用;更新后执行 dwy --version 查看版本)。',
|
|
39
|
+
' 首次安装:npm install -g create-dwy@latest',
|
|
40
|
+
'',
|
|
41
|
+
'平台支持:',
|
|
42
|
+
' Claude Code / Codex:项目或全局的 Skills、Rules、Hooks。',
|
|
43
|
+
' OpenCode:项目或全局的 Skills、Rules;当前不支持 Hooks。',
|
|
44
|
+
' Cursor:仅项目 Rules;全局规则在 Cursor 设置中管理。',
|
|
45
|
+
'',
|
|
46
|
+
'同步仅处理所选位置和平台;取消已勾选的托管项会在确认后删除。',
|
|
47
|
+
'更新 CLI 只升级工具;本地配置需再执行 dwy sync 更新。',
|
|
48
|
+
'',
|
|
23
49
|
].join('\n')
|
|
24
50
|
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI 列表行聚焦样式。
|
|
3
|
+
* 只靠 dim 在 JetBrains / 部分终端看不出光标;已勾选时勾选框又全是绿块。
|
|
4
|
+
* 指针字符不依赖颜色,反底在支持 ANSI 的终端再加强。
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { styleText } from 'node:util'
|
|
8
|
+
import process from 'node:process'
|
|
9
|
+
|
|
10
|
+
/** 是否支持 unicode 符号(与 clack prompts 判定一致) */
|
|
11
|
+
function isUnicodeSupported() {
|
|
12
|
+
if (process.platform !== 'win32') {
|
|
13
|
+
return process.env.TERM !== 'linux'
|
|
14
|
+
}
|
|
15
|
+
return Boolean(process.env.CI)
|
|
16
|
+
|| Boolean(process.env.WT_SESSION)
|
|
17
|
+
|| Boolean(process.env.TERMINUS_SUBLIME)
|
|
18
|
+
|| process.env.ConEmuTask === '{cmd::Cmder}'
|
|
19
|
+
|| process.env.TERM_PROGRAM === 'Terminus-Sublime'
|
|
20
|
+
|| process.env.TERM_PROGRAM === 'vscode'
|
|
21
|
+
|| process.env.TERM === 'xterm-256color'
|
|
22
|
+
|| process.env.TERM === 'alacritty'
|
|
23
|
+
|| process.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm'
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const unicode = isUnicodeSupported()
|
|
27
|
+
const unicodeOr = (c, fallback) => (unicode ? c : fallback)
|
|
28
|
+
|
|
29
|
+
/** 光标指针。无 unicode 时用 ASCII,保证去 ANSI 后仍能看出聚焦行。 */
|
|
30
|
+
const S_POINTER = unicodeOr('›', '>')
|
|
31
|
+
const S_RADIO_ACTIVE = unicodeOr('●', '>')
|
|
32
|
+
const S_RADIO_INACTIVE = unicodeOr('○', ' ')
|
|
33
|
+
const S_CHECKBOX_ACTIVE = unicodeOr('◻', '[•]')
|
|
34
|
+
const S_CHECKBOX_SELECTED = unicodeOr('◼', '[+]')
|
|
35
|
+
const S_CHECKBOX_INACTIVE = unicodeOr('◻', '[ ]')
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 聚焦文案:反底芯片。无色终端退回原文字,靠指针区分。
|
|
39
|
+
*
|
|
40
|
+
* @param {string} label
|
|
41
|
+
* @param {boolean} active
|
|
42
|
+
*/
|
|
43
|
+
function formatLabel(label, active) {
|
|
44
|
+
if (active) return styleText(['bgCyan', 'black'], ` ${label} `)
|
|
45
|
+
return styleText('dim', label)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 多选一行。
|
|
50
|
+
* selected=已勾;active=当前光标。disabled 时不响应聚焦样式。
|
|
51
|
+
*
|
|
52
|
+
* @param {{ label: string, selected?: boolean, active?: boolean, prefix?: string, disabled?: boolean }} opts
|
|
53
|
+
*/
|
|
54
|
+
export function formatCheckboxRow({ label, selected = false, active = false, prefix = '', disabled = false }) {
|
|
55
|
+
const prefixPart = prefix ? `${prefix} ` : ''
|
|
56
|
+
if (disabled) {
|
|
57
|
+
return ` ${styleText('dim', S_CHECKBOX_INACTIVE)} ${prefixPart}${styleText(['strikethrough', 'dim'], label)}`
|
|
58
|
+
}
|
|
59
|
+
const pointer = active ? styleText('cyan', S_POINTER) : ' '
|
|
60
|
+
const box = selected
|
|
61
|
+
? styleText('green', S_CHECKBOX_SELECTED)
|
|
62
|
+
: active
|
|
63
|
+
? styleText('cyan', S_CHECKBOX_ACTIVE)
|
|
64
|
+
: styleText('dim', S_CHECKBOX_INACTIVE)
|
|
65
|
+
return `${pointer} ${box} ${prefixPart}${formatLabel(label, active)}`
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 单选一行。disabled 画删除线,不画指针。
|
|
70
|
+
*
|
|
71
|
+
* @param {{ label: string, active?: boolean, disabled?: boolean }} opts
|
|
72
|
+
*/
|
|
73
|
+
export function formatRadioRow({ label, active = false, disabled = false }) {
|
|
74
|
+
if (disabled) {
|
|
75
|
+
return ` ${styleText('gray', S_RADIO_INACTIVE)} ${styleText(['strikethrough', 'gray'], label)}`
|
|
76
|
+
}
|
|
77
|
+
const pointer = active ? styleText('cyan', S_POINTER) : ' '
|
|
78
|
+
const radio = active
|
|
79
|
+
? styleText('green', S_RADIO_ACTIVE)
|
|
80
|
+
: styleText('dim', S_RADIO_INACTIVE)
|
|
81
|
+
return `${pointer} ${radio} ${formatLabel(label, active)}`
|
|
82
|
+
}
|
package/src/searchable-select.js
CHANGED
|
@@ -8,6 +8,7 @@ import { AutocompletePrompt, getColumns, settings } from '@clack/core'
|
|
|
8
8
|
import { limitOptions } from '@clack/prompts'
|
|
9
9
|
import { styleText } from 'node:util'
|
|
10
10
|
import process from 'node:process'
|
|
11
|
+
import { formatCheckboxRow, formatRadioRow } from './prompt-style.js'
|
|
11
12
|
|
|
12
13
|
/** 是否支持 unicode 符号(与 clack prompts 判定一致) */
|
|
13
14
|
function isUnicodeSupported() {
|
|
@@ -34,10 +35,6 @@ const S_STEP_ERROR = unicodeOr('▲', 'x')
|
|
|
34
35
|
const S_STEP_SUBMIT = unicodeOr('◇', 'o')
|
|
35
36
|
const S_BAR = unicodeOr('│', '|')
|
|
36
37
|
const S_BAR_END = unicodeOr('└', '—')
|
|
37
|
-
const S_RADIO_ACTIVE = unicodeOr('●', '>')
|
|
38
|
-
const S_RADIO_INACTIVE = unicodeOr('○', ' ')
|
|
39
|
-
const S_CHECKBOX_SELECTED = unicodeOr('◼', '[+]')
|
|
40
|
-
const S_CHECKBOX_INACTIVE = unicodeOr('◻', '[ ]')
|
|
41
38
|
|
|
42
39
|
/** 底部说明区固定行数,避免列表高度随描述长短跳动 */
|
|
43
40
|
const DESC_PANEL_LINES = 3
|
|
@@ -256,21 +253,12 @@ export function searchableMultiselect(opts) {
|
|
|
256
253
|
maxItems: opts.maxItems,
|
|
257
254
|
output: opts.output,
|
|
258
255
|
rowPadding: header.length + footer.length,
|
|
259
|
-
style: (opt, active) => {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
if (opt.disabled) {
|
|
266
|
-
return `${styleText('dim', S_CHECKBOX_INACTIVE)} ${styleText(['strikethrough', 'dim'], label)}`
|
|
267
|
-
}
|
|
268
|
-
// 聚焦也不拼 hint,描述只在底部公共区
|
|
269
|
-
if (active) {
|
|
270
|
-
return `${box} ${label}`
|
|
271
|
-
}
|
|
272
|
-
return `${box} ${styleText('dim', label)}`
|
|
273
|
-
},
|
|
256
|
+
style: (opt, active) => formatCheckboxRow({
|
|
257
|
+
label: optionLabel(opt),
|
|
258
|
+
selected: this.selectedValues.includes(opt.value),
|
|
259
|
+
active,
|
|
260
|
+
disabled: opt.disabled,
|
|
261
|
+
}),
|
|
274
262
|
})
|
|
275
263
|
|
|
276
264
|
return [
|
|
@@ -396,16 +384,11 @@ export function searchableSelect(opts) {
|
|
|
396
384
|
output: opts.output,
|
|
397
385
|
columnPadding: withGuide ? 3 : 0,
|
|
398
386
|
rowPadding: header.length + footer.length,
|
|
399
|
-
style: (opt, active) => {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
if (active) {
|
|
405
|
-
return `${styleText('green', S_RADIO_ACTIVE)} ${label}`
|
|
406
|
-
}
|
|
407
|
-
return `${styleText('dim', S_RADIO_INACTIVE)} ${styleText('dim', label)}`
|
|
408
|
-
},
|
|
387
|
+
style: (opt, active) => formatRadioRow({
|
|
388
|
+
label: optionLabel(opt),
|
|
389
|
+
active,
|
|
390
|
+
disabled: opt.disabled,
|
|
391
|
+
}),
|
|
409
392
|
})
|
|
410
393
|
|
|
411
394
|
return [
|