apptify 0.6.1 → 0.7.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/README.md +1 -1
- package/THIRD_PARTY_LICENSES.txt +23 -0
- package/dist/apptify.css +1 -1
- package/dist/apptify.js +2395 -2451
- package/dist/components/AppleCard.vue.d.ts +1 -1
- package/dist/components/content.d.ts +81 -20
- package/dist/components/forms.d.ts +2 -2
- package/dist/components/foundation.d.ts +133 -11
- package/dist/components/mobile-image-viewer.d.ts +35 -12
- package/dist/components/navibar.d.ts +2 -2
- package/dist/components/overlays.d.ts +10 -59
- package/dist/components/scrollbar.d.ts +88 -0
- package/dist/components/speed-dial.d.ts +157 -0
- package/dist/core/context.d.ts +11 -0
- package/dist/core/device.d.ts +2 -0
- package/dist/core/image-gallery-motion.d.ts +2 -1
- package/dist/core/image-motion.d.ts +1 -1
- package/dist/core/layers.d.ts +1 -0
- package/dist/core/motion-driver.d.ts +40 -0
- package/dist/core/motion.d.ts +1 -1
- package/dist/core/ripple.d.ts +16 -0
- package/dist/core/scroll-motion.d.ts +6 -0
- package/dist/core/scrollbar.d.ts +14 -0
- package/dist/core/speed-dial.d.ts +21 -0
- package/dist/index.d.ts +237 -26
- package/docs/COMPONENTS.md +10 -6
- package/package.json +5 -7
- package/templates/playground/README.md +1 -1
- package/templates/playground/package.json +1 -2
- package/templates/playground/source-snapshot.json +299 -66
- package/templates/playground/src/App.vue +1 -0
- package/templates/playground/src/ComponentDemo.vue +30 -21
- package/templates/playground/src/catalog.ts +70 -65
- package/templates/playground/src/components/ComponentIndex.vue +10 -14
- package/templates/playground/src/components/MasonryFeed.vue +52 -0
- package/templates/playground/src/components/UserMenu.vue +1 -1
- package/templates/playground/src/components/forbidden-paper-scene.vue +367 -0
- package/templates/playground/src/components/forbidden-paper-story.ts +233 -0
- package/templates/playground/src/editor/ComponentPlayground.vue +89 -0
- package/templates/playground/src/editor/ConfigurableEditor.vue +1 -1
- package/templates/playground/src/editor/apple-input-source.ts +1 -1
- package/templates/playground/src/editor/component-metadata.ts +72 -0
- package/templates/playground/src/editor/component-playground.ts +162 -0
- package/templates/playground/src/editor/contract.ts +1 -1
- package/templates/playground/src/editor/documents.ts +11 -2
- package/templates/playground/src/editor/handbook.ts +22 -0
- package/templates/playground/src/editor/handbooks/apple-accordion.ts +66 -0
- package/templates/playground/src/editor/handbooks/apple-action-sheet.ts +72 -0
- package/templates/playground/src/editor/handbooks/apple-alert.ts +67 -0
- package/templates/playground/src/editor/handbooks/apple-aside.ts +32 -0
- package/templates/playground/src/editor/handbooks/apple-auto-size.ts +32 -0
- package/templates/playground/src/editor/handbooks/apple-autocomplete.ts +114 -0
- package/templates/playground/src/editor/handbooks/apple-avatar-group.ts +50 -0
- package/templates/playground/src/editor/handbooks/apple-avatar.ts +56 -0
- package/templates/playground/src/editor/handbooks/apple-back-top.ts +62 -0
- package/templates/playground/src/editor/handbooks/apple-badge.ts +62 -0
- package/templates/playground/src/editor/handbooks/apple-breadcrumbs.ts +38 -0
- package/templates/playground/src/editor/handbooks/apple-button.ts +92 -0
- package/templates/playground/src/editor/handbooks/apple-card.ts +112 -0
- package/templates/playground/src/editor/handbooks/apple-cascader.ts +102 -0
- package/templates/playground/src/editor/handbooks/apple-checkbox.ts +85 -0
- package/templates/playground/src/editor/handbooks/apple-color-picker.ts +79 -0
- package/templates/playground/src/editor/handbooks/apple-container.ts +26 -0
- package/templates/playground/src/editor/handbooks/apple-date-picker.ts +104 -0
- package/templates/playground/src/editor/handbooks/apple-dialog.ts +151 -0
- package/templates/playground/src/editor/handbooks/apple-divider.ts +38 -0
- package/templates/playground/src/editor/handbooks/apple-drawer.ts +151 -0
- package/templates/playground/src/editor/handbooks/apple-empty.ts +43 -0
- package/templates/playground/src/editor/handbooks/apple-floating-group.ts +51 -0
- package/templates/playground/src/editor/handbooks/apple-form-field.ts +69 -0
- package/templates/playground/src/editor/handbooks/apple-form.ts +76 -0
- package/templates/playground/src/editor/handbooks/apple-grid.ts +32 -0
- package/templates/playground/src/editor/handbooks/apple-image.ts +122 -0
- package/templates/playground/src/editor/handbooks/apple-infinite-scroll.ts +73 -0
- package/templates/playground/src/editor/handbooks/apple-link.ts +68 -0
- package/templates/playground/src/editor/handbooks/apple-list.ts +67 -0
- package/templates/playground/src/editor/handbooks/apple-menu.ts +72 -0
- package/templates/playground/src/editor/handbooks/apple-navibar.ts +100 -0
- package/templates/playground/src/editor/handbooks/apple-otp-input.ts +108 -0
- package/templates/playground/src/editor/handbooks/apple-overlay-host.ts +13 -0
- package/templates/playground/src/editor/handbooks/apple-pagination.ts +61 -0
- package/templates/playground/src/editor/handbooks/apple-popover.ts +112 -0
- package/templates/playground/src/editor/handbooks/apple-progress.ts +56 -0
- package/templates/playground/src/editor/handbooks/apple-provider.ts +32 -0
- package/templates/playground/src/editor/handbooks/apple-pull-refresh.ts +61 -0
- package/templates/playground/src/editor/handbooks/apple-radio-group.ts +91 -0
- package/templates/playground/src/editor/handbooks/apple-rate.ts +97 -0
- package/templates/playground/src/editor/handbooks/apple-scroll-bar.ts +15 -0
- package/templates/playground/src/editor/handbooks/apple-search.ts +49 -0
- package/templates/playground/src/editor/handbooks/apple-segmented-control.ts +85 -0
- package/templates/playground/src/editor/handbooks/apple-select.ts +91 -0
- package/templates/playground/src/editor/handbooks/apple-sheet.ts +151 -0
- package/templates/playground/src/editor/handbooks/apple-skeleton.ts +74 -0
- package/templates/playground/src/editor/handbooks/apple-slider.ts +103 -0
- package/templates/playground/src/editor/handbooks/apple-snackbar.ts +89 -0
- package/templates/playground/src/editor/handbooks/apple-speed-dial-item.ts +16 -0
- package/templates/playground/src/editor/handbooks/apple-speed-dial.ts +13 -0
- package/templates/playground/src/editor/handbooks/apple-spinner.ts +38 -0
- package/templates/playground/src/editor/handbooks/apple-stack.ts +44 -0
- package/templates/playground/src/editor/handbooks/apple-statistic.ts +69 -0
- package/templates/playground/src/editor/handbooks/apple-stepper.ts +91 -0
- package/templates/playground/src/editor/handbooks/apple-steps.ts +61 -0
- package/templates/playground/src/editor/handbooks/apple-switch.ts +79 -0
- package/templates/playground/src/editor/handbooks/apple-tab-bar.ts +66 -0
- package/templates/playground/src/editor/handbooks/apple-table.ts +176 -0
- package/templates/playground/src/editor/handbooks/apple-tabs.ts +72 -0
- package/templates/playground/src/editor/handbooks/apple-tag.ts +56 -0
- package/templates/playground/src/editor/handbooks/apple-textarea.ts +109 -0
- package/templates/playground/src/editor/handbooks/apple-timeline.ts +44 -0
- package/templates/playground/src/editor/handbooks/apple-tooltip.ts +45 -0
- package/templates/playground/src/editor/handbooks/apple-transition.ts +44 -0
- package/templates/playground/src/editor/handbooks/apple-tree.ts +84 -0
- package/templates/playground/src/editor/handbooks/apple-upload.ts +126 -0
- package/templates/playground/src/editor/playground-examples.ts +105 -0
- package/templates/playground/src/images.ts +3 -0
- package/templates/playground/src/router/index.ts +19 -2
- package/templates/playground/src/style.css +4 -4
- package/templates/playground/src/views/403.vue +65 -0
- package/templates/playground/src/views/component-docs/[component].vue +11 -14
- package/templates/playground/src/views/components.vue +11 -41
- package/templates/playground/src/views/index.vue +3 -1
- package/templates/playground/src/views/settings.vue +5 -2
- package/tooling/create-playground.mjs +2 -2
- package/tooling/prepare-playground.mjs +3 -3
- package/tooling/test-create-apptify.mjs +3 -1
- package/tooling/test-playground-package.mjs +10 -0
- package/dist/components/gallery-scrollbar.d.ts +0 -46
- package/dist/core/desktop-image-enter.d.ts +0 -6
- package/dist/core/desktop-image-return.d.ts +0 -1
- package/templates/playground/src/components/DirectoryDialog.vue +0 -20
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { defineHandbook } from '../handbook'
|
|
2
|
+
|
|
3
|
+
export default defineHandbook({
|
|
4
|
+
"name": "AppleAlert",
|
|
5
|
+
"source": "src/components/content.ts",
|
|
6
|
+
"props": [
|
|
7
|
+
{
|
|
8
|
+
"name": "motion",
|
|
9
|
+
"type": "'inherit' | 'auto' | 'full' | 'reduced' | 'none'",
|
|
10
|
+
"default": "\"inherit\"",
|
|
11
|
+
"description": "局部动效偏好。inherit 跟随外层;全局与系统的减少动效设置仍是上限。"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "title",
|
|
15
|
+
"type": "string",
|
|
16
|
+
"default": "undefined",
|
|
17
|
+
"description": "标题文字。"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "message",
|
|
21
|
+
"type": "string",
|
|
22
|
+
"default": "undefined",
|
|
23
|
+
"description": "正文文字;提供 default 插槽时以插槽内容为准。"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "tone",
|
|
27
|
+
"type": "'info' | 'success' | 'warning' | 'danger'",
|
|
28
|
+
"default": "\"info\"",
|
|
29
|
+
"description": "视觉语义颜色,不会自行触发业务操作。"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "closable",
|
|
33
|
+
"type": "boolean",
|
|
34
|
+
"default": "false",
|
|
35
|
+
"description": "显示关闭按钮。"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "modelValue",
|
|
39
|
+
"type": "boolean",
|
|
40
|
+
"default": "true",
|
|
41
|
+
"description": "是否显示,默认 true;关闭后更新为 false。"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"events": [
|
|
45
|
+
{
|
|
46
|
+
"name": "update:modelValue",
|
|
47
|
+
"type": "(value: boolean) => void",
|
|
48
|
+
"description": "交互更新时发出新模型值;可使用 v-model 接收。"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "close",
|
|
52
|
+
"type": "() => void",
|
|
53
|
+
"description": "点击关闭按钮时触发;此前已发出 update:modelValue(false)。"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"slots": [
|
|
57
|
+
{
|
|
58
|
+
"name": "default",
|
|
59
|
+
"type": "() => VNode[](无 slot props)",
|
|
60
|
+
"description": "替代 message 正文。"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"methods": [],
|
|
64
|
+
"notes": [
|
|
65
|
+
"使用真实内容与可访问名称;交互控件可通过 Tab 和原生键盘方式操作,动效遵循外层偏好。"
|
|
66
|
+
]
|
|
67
|
+
})
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineHandbook } from '../handbook'
|
|
2
|
+
|
|
3
|
+
export default defineHandbook({
|
|
4
|
+
"name": "AppleAside",
|
|
5
|
+
"source": "src/components/navibar.ts",
|
|
6
|
+
"props": [
|
|
7
|
+
{
|
|
8
|
+
"name": "motion",
|
|
9
|
+
"type": "'inherit' | 'auto' | 'full' | 'reduced' | 'none'",
|
|
10
|
+
"default": "\"inherit\"",
|
|
11
|
+
"description": "局部动效偏好。inherit 跟随外层;全局与系统的减少动效设置仍是上限。"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "hideOnPreview",
|
|
15
|
+
"type": "boolean",
|
|
16
|
+
"default": "true",
|
|
17
|
+
"description": "图片预览期间隐藏导航并禁止交互,同时保留原占位;退出预览时恢复。"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"events": [],
|
|
21
|
+
"slots": [
|
|
22
|
+
{
|
|
23
|
+
"name": "default",
|
|
24
|
+
"type": "() => VNode[](无 slot props)",
|
|
25
|
+
"description": "侧栏内容;布局由调用方提供。"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"methods": [],
|
|
29
|
+
"notes": [
|
|
30
|
+
"使用真实内容与可访问名称;交互控件可通过 Tab 和原生键盘方式操作,动效遵循外层偏好。"
|
|
31
|
+
]
|
|
32
|
+
})
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineHandbook } from '../handbook'
|
|
2
|
+
|
|
3
|
+
export default defineHandbook({
|
|
4
|
+
"name": "AppleAutoSize",
|
|
5
|
+
"source": "src/components/motion.ts",
|
|
6
|
+
"props": [
|
|
7
|
+
{
|
|
8
|
+
"name": "motion",
|
|
9
|
+
"type": "'inherit' | 'auto' | 'full' | 'reduced' | 'none'",
|
|
10
|
+
"default": "\"inherit\"",
|
|
11
|
+
"description": "局部动效偏好。inherit 跟随外层;全局与系统的减少动效设置仍是上限。"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "axis",
|
|
15
|
+
"type": "'height' | 'both'",
|
|
16
|
+
"default": "\"height\"",
|
|
17
|
+
"description": "height 动画调整高度,both 同时调整宽度与高度。使用 ResizeObserver 测量实际内容尺寸。"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"events": [],
|
|
21
|
+
"slots": [
|
|
22
|
+
{
|
|
23
|
+
"name": "default",
|
|
24
|
+
"type": "() => VNode[](无 slot props)",
|
|
25
|
+
"description": "尺寸变化的内容。"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"methods": [],
|
|
29
|
+
"notes": [
|
|
30
|
+
"使用真实内容与可访问名称;交互控件可通过 Tab 和原生键盘方式操作,动效遵循外层偏好。"
|
|
31
|
+
]
|
|
32
|
+
})
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { defineHandbook } from '../handbook'
|
|
2
|
+
|
|
3
|
+
export default defineHandbook({
|
|
4
|
+
"name": "AppleAutocomplete",
|
|
5
|
+
"source": "src/components/forms.ts",
|
|
6
|
+
"props": [
|
|
7
|
+
{
|
|
8
|
+
"name": "label",
|
|
9
|
+
"type": "string",
|
|
10
|
+
"default": "\"\"",
|
|
11
|
+
"description": "控件名称或区域的可访问名称。无可见名称时应提供 aria-label。"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "hint",
|
|
15
|
+
"type": "string",
|
|
16
|
+
"default": "\"\"",
|
|
17
|
+
"description": "字段帮助文字;error 非空时优先显示错误,帮助文字暂时隐藏。"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "error",
|
|
21
|
+
"type": "string",
|
|
22
|
+
"default": "\"\"",
|
|
23
|
+
"description": "显示字段错误和错误样式,不会自行执行校验或阻止表单提交。"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "disabled",
|
|
27
|
+
"type": "boolean",
|
|
28
|
+
"default": "false",
|
|
29
|
+
"description": "禁用控件的交互。选项自身的 disabled 仍然独立生效。"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "loading",
|
|
33
|
+
"type": "boolean",
|
|
34
|
+
"default": "false",
|
|
35
|
+
"description": "显示忙碌状态;表单控件在加载时禁止编辑或选择。"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "required",
|
|
39
|
+
"type": "boolean",
|
|
40
|
+
"default": "false",
|
|
41
|
+
"description": "为字段添加必填标记并传递必填约束;不会自动生成 error 文本。"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "motion",
|
|
45
|
+
"type": "'inherit' | 'auto' | 'full' | 'reduced' | 'none'",
|
|
46
|
+
"default": "\"inherit\"",
|
|
47
|
+
"description": "局部动效偏好。inherit 跟随外层;全局与系统的减少动效设置仍是上限。"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "items",
|
|
51
|
+
"type": "AppleOption[]",
|
|
52
|
+
"default": "[]",
|
|
53
|
+
"description": "单选选项数组:{ label: string; value: string | number; disabled?: boolean }[]。"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "modelValue",
|
|
57
|
+
"type": "string | number | null",
|
|
58
|
+
"default": "null",
|
|
59
|
+
"description": "选中选项的 value;开始输入查询时更新为 null。查询文字本身通过 search 事件提供。"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "placeholder",
|
|
63
|
+
"type": "string",
|
|
64
|
+
"default": "\"搜索或选择\"",
|
|
65
|
+
"description": "尚未填写或选择时显示的占位文字,不能替代字段名称。"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "emptyText",
|
|
69
|
+
"type": "string",
|
|
70
|
+
"default": "\"没有匹配的选项\"",
|
|
71
|
+
"description": "没有匹配项时显示的文字。"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "clearable",
|
|
75
|
+
"type": "boolean",
|
|
76
|
+
"default": "true",
|
|
77
|
+
"description": "选中值不为 null 时显示清空按钮;清空后 update:modelValue 和 change 都传 null。"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "filter",
|
|
81
|
+
"type": "(query: string, item: AppleOption) => boolean",
|
|
82
|
+
"default": "(query, item) => item.label.toLocaleLowerCase().includes(query.toLocaleLowerCase())",
|
|
83
|
+
"description": "过滤函数 (query, item) => boolean。默认按 label 进行不区分大小写的包含匹配。"
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"events": [
|
|
87
|
+
{
|
|
88
|
+
"name": "update:modelValue",
|
|
89
|
+
"type": "(value: string | number | null) => void",
|
|
90
|
+
"description": "交互更新时发出新模型值;可使用 v-model 接收。"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"name": "change",
|
|
94
|
+
"type": "(value: string | number | null) => void",
|
|
95
|
+
"description": "用户提交选择或调整时发出当前值;直接从父组件赋值不会主动发出此事件。"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "search",
|
|
99
|
+
"type": "(query: string) => void",
|
|
100
|
+
"description": "输入查询文字时发出;查询不是所选 value,选择选项不会发出 search。"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"slots": [],
|
|
104
|
+
"methods": [
|
|
105
|
+
{
|
|
106
|
+
"name": "focus()",
|
|
107
|
+
"type": "() => void",
|
|
108
|
+
"description": "通过组件 ref 将焦点移到输入或选择触发元素;禁用时无法聚焦。"
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
"notes": [
|
|
112
|
+
"字段名称、帮助和错误文字只用于说明。直接操作控件;原生 name、autocomplete 等属性需按实际输入类型使用。"
|
|
113
|
+
]
|
|
114
|
+
})
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineHandbook } from '../handbook'
|
|
2
|
+
|
|
3
|
+
export default defineHandbook({
|
|
4
|
+
"name": "AppleAvatarGroup",
|
|
5
|
+
"source": "src/components/content.ts",
|
|
6
|
+
"props": [
|
|
7
|
+
{
|
|
8
|
+
"name": "motion",
|
|
9
|
+
"type": "'inherit' | 'auto' | 'full' | 'reduced' | 'none'",
|
|
10
|
+
"default": "\"inherit\"",
|
|
11
|
+
"description": "局部动效偏好。inherit 跟随外层;全局与系统的减少动效设置仍是上限。"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "items",
|
|
15
|
+
"type": "AppleAvatarItem[]",
|
|
16
|
+
"default": "[]",
|
|
17
|
+
"description": "成员数组:{ name: string; src?: string; value?: string | number }[]。"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "max",
|
|
21
|
+
"type": "number",
|
|
22
|
+
"default": "4",
|
|
23
|
+
"description": "最多显示的头像数;超出显示 +N,负数按 0 处理。"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "size",
|
|
27
|
+
"type": "number",
|
|
28
|
+
"default": "36",
|
|
29
|
+
"description": "尺寸,数字按 px。"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "label",
|
|
33
|
+
"type": "string",
|
|
34
|
+
"default": "\"成员\"",
|
|
35
|
+
"description": "控件名称或区域的可访问名称。无可见名称时应提供 aria-label。"
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"events": [],
|
|
39
|
+
"slots": [
|
|
40
|
+
{
|
|
41
|
+
"name": "default",
|
|
42
|
+
"type": "() => VNode[](无 slot props)",
|
|
43
|
+
"description": "替代完整头像集合,包括默认的 +N。"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"methods": [],
|
|
47
|
+
"notes": [
|
|
48
|
+
"使用真实内容与可访问名称;交互控件可通过 Tab 和原生键盘方式操作,动效遵循外层偏好。"
|
|
49
|
+
]
|
|
50
|
+
})
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { defineHandbook } from '../handbook'
|
|
2
|
+
|
|
3
|
+
export default defineHandbook({
|
|
4
|
+
"name": "AppleAvatar",
|
|
5
|
+
"source": "src/components/content.ts",
|
|
6
|
+
"props": [
|
|
7
|
+
{
|
|
8
|
+
"name": "motion",
|
|
9
|
+
"type": "'inherit' | 'auto' | 'full' | 'reduced' | 'none'",
|
|
10
|
+
"default": "\"inherit\"",
|
|
11
|
+
"description": "局部动效偏好。inherit 跟随外层;全局与系统的减少动效设置仍是上限。"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "src",
|
|
15
|
+
"type": "string",
|
|
16
|
+
"default": "undefined",
|
|
17
|
+
"description": "图片地址;加载失败时使用回退内容。"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "name",
|
|
21
|
+
"type": "string",
|
|
22
|
+
"default": "\"用户\"",
|
|
23
|
+
"description": "图片的替代文字,也是失败或无 src 时的回退文字来源,取去除两端空白后的前两个字符。"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "size",
|
|
27
|
+
"type": "number",
|
|
28
|
+
"default": "40",
|
|
29
|
+
"description": "尺寸,数字按 px。"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "square",
|
|
33
|
+
"type": "boolean",
|
|
34
|
+
"default": "false",
|
|
35
|
+
"description": "使用方形头像样式。"
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"events": [
|
|
39
|
+
{
|
|
40
|
+
"name": "error",
|
|
41
|
+
"type": "(event: Event) => void",
|
|
42
|
+
"description": "头像图片加载失败时触发,并切换到插槽或姓名回退。"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"slots": [
|
|
46
|
+
{
|
|
47
|
+
"name": "default",
|
|
48
|
+
"type": "() => VNode[](无 slot props)",
|
|
49
|
+
"description": "无图片或加载失败时替代姓名回退文字。"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"methods": [],
|
|
53
|
+
"notes": [
|
|
54
|
+
"使用真实内容与可访问名称;交互控件可通过 Tab 和原生键盘方式操作,动效遵循外层偏好。"
|
|
55
|
+
]
|
|
56
|
+
})
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { defineHandbook } from '../handbook'
|
|
2
|
+
|
|
3
|
+
export default defineHandbook({
|
|
4
|
+
"name": "AppleBackTop",
|
|
5
|
+
"source": "src/components/content.ts",
|
|
6
|
+
"props": [
|
|
7
|
+
{
|
|
8
|
+
"name": "motion",
|
|
9
|
+
"type": "'inherit' | 'auto' | 'full' | 'reduced' | 'none'",
|
|
10
|
+
"default": "\"inherit\"",
|
|
11
|
+
"description": "局部动效偏好。inherit 跟随外层;全局与系统的减少动效设置仍是上限。"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "target",
|
|
15
|
+
"type": "string",
|
|
16
|
+
"default": "\"\"",
|
|
17
|
+
"description": "滚动容器的 CSS 选择器。空字符串使用 window;目标应在组件挂载时已存在。"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "threshold",
|
|
21
|
+
"type": "number",
|
|
22
|
+
"default": "300",
|
|
23
|
+
"description": "目标滚动位置达到此值后显示按钮,单位 px。"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "label",
|
|
27
|
+
"type": "string",
|
|
28
|
+
"default": "\"回到顶部\"",
|
|
29
|
+
"description": "控件名称或区域的可访问名称。无可见名称时应提供 aria-label。"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "disabled",
|
|
33
|
+
"type": "boolean",
|
|
34
|
+
"default": "false",
|
|
35
|
+
"description": "禁用控件的交互。选项自身的 disabled 仍然独立生效。"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "fixed",
|
|
39
|
+
"type": "boolean",
|
|
40
|
+
"default": "true",
|
|
41
|
+
"description": "固定右下角;嵌入 FloatingGroup 时由组负责定位。"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"events": [
|
|
45
|
+
{
|
|
46
|
+
"name": "click",
|
|
47
|
+
"type": "(event: MouseEvent) => void",
|
|
48
|
+
"description": "执行回到顶部时发出原生事件,动画遵循动效偏好。"
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"slots": [
|
|
52
|
+
{
|
|
53
|
+
"name": "default",
|
|
54
|
+
"type": "() => VNode[](无 slot props)",
|
|
55
|
+
"description": "替代默认向上箭头。"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"methods": [],
|
|
59
|
+
"notes": [
|
|
60
|
+
"示例使用可滚动容器演示阈值;target 为空时操作 window。目标在挂载时解析,更改目标后需要重新挂载组件。"
|
|
61
|
+
]
|
|
62
|
+
})
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { defineHandbook } from '../handbook'
|
|
2
|
+
|
|
3
|
+
export default defineHandbook({
|
|
4
|
+
"name": "AppleBadge",
|
|
5
|
+
"source": "src/components/content.ts",
|
|
6
|
+
"props": [
|
|
7
|
+
{
|
|
8
|
+
"name": "motion",
|
|
9
|
+
"type": "'inherit' | 'auto' | 'full' | 'reduced' | 'none'",
|
|
10
|
+
"default": "\"inherit\"",
|
|
11
|
+
"description": "局部动效偏好。inherit 跟随外层;全局与系统的减少动效设置仍是上限。"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "value",
|
|
15
|
+
"type": "string | number",
|
|
16
|
+
"default": "undefined",
|
|
17
|
+
"description": "徽标内容;数值 0 默认隐藏,字符串 \"0\" 仍显示。数字超过 max 时显示 max+。"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "max",
|
|
21
|
+
"type": "number",
|
|
22
|
+
"default": "99",
|
|
23
|
+
"description": "数字显示上限,仅对 number 类型 value 生效。"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "dot",
|
|
27
|
+
"type": "boolean",
|
|
28
|
+
"default": "false",
|
|
29
|
+
"description": "显示圆点并忽略 value 文字。"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "showZero",
|
|
33
|
+
"type": "boolean",
|
|
34
|
+
"default": "false",
|
|
35
|
+
"description": "value 为数字 0 时仍显示。"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "label",
|
|
39
|
+
"type": "string",
|
|
40
|
+
"default": "undefined",
|
|
41
|
+
"description": "徽标的可访问名称,省略时自动使用消息数量或“有新消息”。"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "tone",
|
|
45
|
+
"type": "string",
|
|
46
|
+
"default": "\"danger\"",
|
|
47
|
+
"description": "视觉语义颜色,不会自行触发业务操作。"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"events": [],
|
|
51
|
+
"slots": [
|
|
52
|
+
{
|
|
53
|
+
"name": "default",
|
|
54
|
+
"type": "() => VNode[](无 slot props)",
|
|
55
|
+
"description": "被标记的内容;无插槽时徽标独立显示。"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"methods": [],
|
|
59
|
+
"notes": [
|
|
60
|
+
"使用真实内容与可访问名称;交互控件可通过 Tab 和原生键盘方式操作,动效遵循外层偏好。"
|
|
61
|
+
]
|
|
62
|
+
})
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineHandbook } from '../handbook'
|
|
2
|
+
|
|
3
|
+
export default defineHandbook({
|
|
4
|
+
"name": "AppleBreadcrumbs",
|
|
5
|
+
"source": "src/components/content.ts",
|
|
6
|
+
"props": [
|
|
7
|
+
{
|
|
8
|
+
"name": "motion",
|
|
9
|
+
"type": "'inherit' | 'auto' | 'full' | 'reduced' | 'none'",
|
|
10
|
+
"default": "\"inherit\"",
|
|
11
|
+
"description": "局部动效偏好。inherit 跟随外层;全局与系统的减少动效设置仍是上限。"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "items",
|
|
15
|
+
"type": "AppleItem[]",
|
|
16
|
+
"default": "[]",
|
|
17
|
+
"description": "路径项:{ label: string; value: string | number; disabled?: boolean; description?: string; href?: string; content?: string }[]。最后一项始终显示为当前页文本;禁用项不生成可点击元素。"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "label",
|
|
21
|
+
"type": "string",
|
|
22
|
+
"default": "\"当前位置\"",
|
|
23
|
+
"description": "控件名称或区域的可访问名称。无可见名称时应提供 aria-label。"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"events": [
|
|
27
|
+
{
|
|
28
|
+
"name": "click",
|
|
29
|
+
"type": "(item: AppleItem, event: MouseEvent) => void",
|
|
30
|
+
"description": "点击可用的非末项时发出完整项和原生事件。接入 Router 时自行阻止默认导航。"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"slots": [],
|
|
34
|
+
"methods": [],
|
|
35
|
+
"notes": [
|
|
36
|
+
"使用真实内容与可访问名称;交互控件可通过 Tab 和原生键盘方式操作,动效遵循外层偏好。"
|
|
37
|
+
]
|
|
38
|
+
})
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { defineHandbook } from '../handbook'
|
|
2
|
+
|
|
3
|
+
export default defineHandbook({
|
|
4
|
+
"name": "AppleButton",
|
|
5
|
+
"source": "src/components/button.ts",
|
|
6
|
+
"props": [
|
|
7
|
+
{
|
|
8
|
+
"name": "motion",
|
|
9
|
+
"type": "'inherit' | 'auto' | 'full' | 'reduced' | 'none'",
|
|
10
|
+
"default": "\"inherit\"",
|
|
11
|
+
"description": "局部动效偏好。inherit 跟随外层;全局与系统的减少动效设置仍是上限。"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "variant",
|
|
15
|
+
"type": "'primary' | 'secondary' | 'outline' | 'danger'",
|
|
16
|
+
"default": "\"primary\"",
|
|
17
|
+
"description": "primary 为主要操作,secondary 和 outline 为描边按钮,danger 为危险操作。"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "size",
|
|
21
|
+
"type": "'small' | 'medium' | 'large'",
|
|
22
|
+
"default": "\"medium\"",
|
|
23
|
+
"description": "按钮尺寸:small、medium、large。"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "icon",
|
|
27
|
+
"type": "Component",
|
|
28
|
+
"default": "undefined",
|
|
29
|
+
"description": "Vue 图标组件,例如从 lucide-vue-next 导入的 Mail;不是图标名称字符串。"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "iconOnly",
|
|
33
|
+
"type": "boolean",
|
|
34
|
+
"default": "false",
|
|
35
|
+
"description": "紧凑的纯图标布局。用 label 为按钮提供可访问名称。"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "label",
|
|
39
|
+
"type": "string",
|
|
40
|
+
"default": "undefined",
|
|
41
|
+
"description": "按钮的可访问名称;iconOnly 时同时用作 title。"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "disabled",
|
|
45
|
+
"type": "boolean",
|
|
46
|
+
"default": "false",
|
|
47
|
+
"description": "禁用控件的交互。选项自身的 disabled 仍然独立生效。"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "loading",
|
|
51
|
+
"type": "boolean",
|
|
52
|
+
"default": "false",
|
|
53
|
+
"description": "显示加载图标并禁止点击;有 href 时也会退化为禁用的 button。"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "ripple",
|
|
57
|
+
"type": "boolean",
|
|
58
|
+
"default": "true",
|
|
59
|
+
"description": "启用点击波纹,同时受全局波纹和动效设置约束。"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "href",
|
|
63
|
+
"type": "string",
|
|
64
|
+
"default": "undefined",
|
|
65
|
+
"description": "非空且可用时渲染为 a;禁用或加载时渲染为 button,移除 href。"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "type",
|
|
69
|
+
"type": "'button' | 'submit' | 'reset'",
|
|
70
|
+
"default": "\"button\"",
|
|
71
|
+
"description": "原生按钮类型。仅在渲染为 button 时使用,默认 button,避免意外提交表单。"
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"events": [
|
|
75
|
+
{
|
|
76
|
+
"name": "click",
|
|
77
|
+
"type": "(event: MouseEvent) => void",
|
|
78
|
+
"description": "可用状态下点击时触发;href 模式不会自动阻止原生链接跳转。"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"slots": [
|
|
82
|
+
{
|
|
83
|
+
"name": "default",
|
|
84
|
+
"type": "() => VNode[](无 slot props)",
|
|
85
|
+
"description": "按钮文字;图标与加载指示由 props 控制。"
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"methods": [],
|
|
89
|
+
"notes": [
|
|
90
|
+
"使用真实内容与可访问名称;交互控件可通过 Tab 和原生键盘方式操作,动效遵循外层偏好。"
|
|
91
|
+
]
|
|
92
|
+
})
|