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,38 @@
|
|
|
1
|
+
import { defineHandbook } from '../handbook'
|
|
2
|
+
|
|
3
|
+
export default defineHandbook({
|
|
4
|
+
"name": "AppleDivider",
|
|
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": "label",
|
|
15
|
+
"type": "string",
|
|
16
|
+
"default": "undefined",
|
|
17
|
+
"description": "分隔文字和可访问名称;default 插槽可替代可见文字。"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "vertical",
|
|
21
|
+
"type": "boolean",
|
|
22
|
+
"default": "false",
|
|
23
|
+
"description": "使用竖向分隔线,设置 aria-orientation=vertical;布局高度由外层决定。"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"events": [],
|
|
27
|
+
"slots": [
|
|
28
|
+
{
|
|
29
|
+
"name": "default",
|
|
30
|
+
"type": "() => VNode[](无 slot props)",
|
|
31
|
+
"description": "替代可见分隔文字。"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"methods": [],
|
|
35
|
+
"notes": [
|
|
36
|
+
"使用真实内容与可访问名称;交互控件可通过 Tab 和原生键盘方式操作,动效遵循外层偏好。"
|
|
37
|
+
]
|
|
38
|
+
})
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { defineHandbook } from '../handbook'
|
|
2
|
+
|
|
3
|
+
export default defineHandbook({
|
|
4
|
+
"name": "AppleDrawer",
|
|
5
|
+
"source": "src/components/overlays.ts",
|
|
6
|
+
"props": [
|
|
7
|
+
{
|
|
8
|
+
"name": "modelValue",
|
|
9
|
+
"type": "boolean",
|
|
10
|
+
"default": "false",
|
|
11
|
+
"description": "是否打开。使用 v-model 接收关闭操作的 false。"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "title",
|
|
15
|
+
"type": "string",
|
|
16
|
+
"default": "\"\"",
|
|
17
|
+
"description": "标题文字。"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "message",
|
|
21
|
+
"type": "string",
|
|
22
|
+
"default": "\"\"",
|
|
23
|
+
"description": "正文文字;提供 default 插槽时以插槽内容为准。"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "ariaLabel",
|
|
27
|
+
"type": "string",
|
|
28
|
+
"default": "\"对话框\"",
|
|
29
|
+
"description": "没有 title 时用于对话框的可访问名称。"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "persistent",
|
|
33
|
+
"type": "boolean",
|
|
34
|
+
"default": "false",
|
|
35
|
+
"description": "阻止 Escape 和背景点击关闭;显式关闭、确认和取消仍可使用。"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "loading",
|
|
39
|
+
"type": "boolean",
|
|
40
|
+
"default": "false",
|
|
41
|
+
"description": "阻止所有交互关闭、确认和取消,显示忙碌状态。"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "closeOnConfirm",
|
|
45
|
+
"type": "boolean",
|
|
46
|
+
"default": "true",
|
|
47
|
+
"description": "确认后自动关闭。异步保存时可设 false,由应用控制 loading 和 modelValue。"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "confirmText",
|
|
51
|
+
"type": "string",
|
|
52
|
+
"default": "\"确定\"",
|
|
53
|
+
"description": "确认按钮文字,空字符串隐藏按钮。"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "cancelText",
|
|
57
|
+
"type": "string",
|
|
58
|
+
"default": "\"取消\"",
|
|
59
|
+
"description": "取消按钮文字,空字符串隐藏按钮。"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "showFooter",
|
|
63
|
+
"type": "boolean",
|
|
64
|
+
"default": "false",
|
|
65
|
+
"description": "显示默认操作区;自定义 footer 插槽始终可以显示。Dialog 默认 true,Drawer/Sheet 默认 false。"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "closable",
|
|
69
|
+
"type": "boolean",
|
|
70
|
+
"default": "true",
|
|
71
|
+
"description": "显示关闭按钮。"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "width",
|
|
75
|
+
"type": "string | number",
|
|
76
|
+
"default": "440",
|
|
77
|
+
"description": "宽度。数字按 px,字符串作为 CSS 尺寸;仍受可用空间约束。"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "placement",
|
|
81
|
+
"type": "'left' | 'right' | 'bottom'",
|
|
82
|
+
"default": "\"right\"",
|
|
83
|
+
"description": "抽屉方向为 left、right、bottom;Sheet 默认 bottom。Dialog 不使用方向来改变其居中布局。"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "tone",
|
|
87
|
+
"type": "string",
|
|
88
|
+
"default": "\"default\"",
|
|
89
|
+
"description": "语义色;danger 使用危险确认按钮。"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "motion",
|
|
93
|
+
"type": "'inherit' | 'auto' | 'full' | 'reduced' | 'none'",
|
|
94
|
+
"default": "\"inherit\"",
|
|
95
|
+
"description": "局部动效偏好。inherit 跟随外层;全局与系统的减少动效设置仍是上限。"
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
"events": [
|
|
99
|
+
{
|
|
100
|
+
"name": "update:modelValue",
|
|
101
|
+
"type": "(value: boolean) => void",
|
|
102
|
+
"description": "交互更新时发出新模型值;可使用 v-model 接收。"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "close",
|
|
106
|
+
"type": "(value: unknown, reason: 'escape' | 'backdrop' | 'cancel' | 'confirm' | 'close') => void",
|
|
107
|
+
"description": "交互关闭时发出结果和原因;确认 true,取消 false,直接关闭通常 undefined。外部直接设置 modelValue=false 不会主动发出 close。"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "confirm",
|
|
111
|
+
"type": "(value: true) => void",
|
|
112
|
+
"description": "点击确认时触发;closeOnConfirm=true 时随后关闭。"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"name": "cancel",
|
|
116
|
+
"type": "(value: false) => void",
|
|
117
|
+
"description": "点击取消时触发,随后关闭。"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "open",
|
|
121
|
+
"type": "() => void",
|
|
122
|
+
"description": "面板挂载并注册焦点与层级管理后触发。"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"name": "after-close",
|
|
126
|
+
"type": "() => void",
|
|
127
|
+
"description": "退出动效完成并释放层级状态后触发。"
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"slots": [
|
|
131
|
+
{
|
|
132
|
+
"name": "title",
|
|
133
|
+
"type": "() => VNode[](无 slot props)",
|
|
134
|
+
"description": "替代标题内容;仍应通过 title 或 ariaLabel 提供对话框名称。"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"name": "default",
|
|
138
|
+
"type": "({ close: (value?: unknown) => void }) => VNode[]",
|
|
139
|
+
"description": "对话框正文,替代 message;调用 close(value) 交回结果。"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"name": "footer",
|
|
143
|
+
"type": "({ close: (value?: unknown) => void, confirm: () => void, cancel: () => void }) => VNode[]",
|
|
144
|
+
"description": "替代默认按钮区;即使 showFooter=false 也会显示。"
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
"methods": [],
|
|
148
|
+
"notes": [
|
|
149
|
+
"使用真实内容与可访问名称;交互控件可通过 Tab 和原生键盘方式操作,动效遵循外层偏好。"
|
|
150
|
+
]
|
|
151
|
+
})
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { defineHandbook } from '../handbook'
|
|
2
|
+
|
|
3
|
+
export default defineHandbook({
|
|
4
|
+
"name": "AppleEmpty",
|
|
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": "\"这里还没有内容\"",
|
|
17
|
+
"description": "标题文字。"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "description",
|
|
21
|
+
"type": "string",
|
|
22
|
+
"default": "\"\"",
|
|
23
|
+
"description": "补充说明文字。"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"events": [],
|
|
27
|
+
"slots": [
|
|
28
|
+
{
|
|
29
|
+
"name": "icon",
|
|
30
|
+
"type": "() => VNode[](无 slot props)",
|
|
31
|
+
"description": "替代默认空状态图标。"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "default",
|
|
35
|
+
"type": "() => VNode[](无 slot props)",
|
|
36
|
+
"description": "标题与说明后的附加内容或操作。"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"methods": [],
|
|
40
|
+
"notes": [
|
|
41
|
+
"使用真实内容与可访问名称;交互控件可通过 Tab 和原生键盘方式操作,动效遵循外层偏好。"
|
|
42
|
+
]
|
|
43
|
+
})
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { defineHandbook } from '../handbook'
|
|
2
|
+
|
|
3
|
+
export default defineHandbook({
|
|
4
|
+
"name": "AppleFloatingGroup",
|
|
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": "backTop",
|
|
15
|
+
"type": "boolean",
|
|
16
|
+
"default": "true",
|
|
17
|
+
"description": "在组内最后放置回到顶部按钮。"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "target",
|
|
21
|
+
"type": "string",
|
|
22
|
+
"default": "\"\"",
|
|
23
|
+
"description": "滚动容器的 CSS 选择器。空字符串使用 window;目标应在组件挂载时已存在。"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "threshold",
|
|
27
|
+
"type": "number",
|
|
28
|
+
"default": "300",
|
|
29
|
+
"description": "传给内置 BackTop 的滚动显示阈值,单位 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": "附加操作,排列在内置回顶按钮前。"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"methods": [],
|
|
47
|
+
"notes": [
|
|
48
|
+
"默认固定右下并考虑安全区,回顶按钮排在附加操作之后。示例滚动容器用于体验 threshold。",
|
|
49
|
+
"与 Navibar 同为 z-index 70;图片预览时隐藏,退出开始时执行 FadeInLeft,遵循全局和局部动效设置。组内回顶按钮使用不透明背景。"
|
|
50
|
+
]
|
|
51
|
+
})
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { defineHandbook } from '../handbook'
|
|
2
|
+
|
|
3
|
+
export default defineHandbook({
|
|
4
|
+
"name": "AppleFormField",
|
|
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": "将 default 插槽的 disabled 设为 true;字段容器本身不代替内部控件执行禁用。"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "required",
|
|
39
|
+
"type": "boolean",
|
|
40
|
+
"default": "false",
|
|
41
|
+
"description": "显示必填星号,并通过插槽传递 required;需绑定到实际输入。"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "motion",
|
|
45
|
+
"type": "'inherit' | 'auto' | 'full' | 'reduced' | 'none'",
|
|
46
|
+
"default": "\"inherit\"",
|
|
47
|
+
"description": "局部动效偏好。inherit 跟随外层;全局与系统的减少动效设置仍是上限。"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "for",
|
|
51
|
+
"type": "string",
|
|
52
|
+
"default": "undefined",
|
|
53
|
+
"description": "自定义输入的 id,省略时自动生成。需将 default 插槽属性绑定到实际输入以关联标签与说明。"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"events": [],
|
|
57
|
+
"slots": [
|
|
58
|
+
{
|
|
59
|
+
"name": "default",
|
|
60
|
+
"type": "({ id: string, disabled: boolean, required: boolean, 'aria-label'?: string, 'aria-labelledby'?: string, 'aria-invalid': boolean, 'aria-describedby'?: string }) => VNode[]",
|
|
61
|
+
"description": "将 slot props 用 v-bind 绑定到实际输入,才能传递禁用、必填和标签/提示关联。"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"methods": [],
|
|
65
|
+
"notes": [
|
|
66
|
+
"容器只提供字段关联属性,不会自动改写插槽内容;务必将插槽参数绑定到自定义输入。",
|
|
67
|
+
"字段名称、帮助和错误文字只用于说明。直接操作控件;原生 name、autocomplete 等属性需按实际输入类型使用。"
|
|
68
|
+
]
|
|
69
|
+
})
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { defineHandbook } from '../handbook'
|
|
2
|
+
|
|
3
|
+
export default defineHandbook({
|
|
4
|
+
"name": "AppleForm",
|
|
5
|
+
"source": "src/components/forms.ts",
|
|
6
|
+
"props": [
|
|
7
|
+
{
|
|
8
|
+
"name": "disabled",
|
|
9
|
+
"type": "boolean",
|
|
10
|
+
"default": "false",
|
|
11
|
+
"description": "禁用 fieldset 内的字段并阻止提交。"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "loading",
|
|
15
|
+
"type": "boolean",
|
|
16
|
+
"default": "false",
|
|
17
|
+
"description": "与内部异步校验状态合并,禁用 fieldset 内所有字段并阻止再次提交。"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "validator",
|
|
21
|
+
"type": "(data: FormData) => boolean | string | Promise<boolean | string>",
|
|
22
|
+
"default": "undefined",
|
|
23
|
+
"description": "函数 (data: FormData) => boolean | string | Promise<boolean | string>。原生校验通过后执行,仅 true 表示成功;字符串作为错误,false 使用默认错误。"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "motion",
|
|
27
|
+
"type": "'inherit' | 'auto' | 'full' | 'reduced' | 'none'",
|
|
28
|
+
"default": "\"inherit\"",
|
|
29
|
+
"description": "局部动效偏好。inherit 跟随外层;全局与系统的减少动效设置仍是上限。"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"events": [
|
|
33
|
+
{
|
|
34
|
+
"name": "submit",
|
|
35
|
+
"type": "(data: FormData) => void",
|
|
36
|
+
"description": "原生约束和自定义校验通过后发出表单数据;不会自动发送网络请求。"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "invalid",
|
|
40
|
+
"type": "(error: { type: 'native' | 'custom'; message?: string }) => void",
|
|
41
|
+
"description": "原生校验失败时 type=native;自定义返回失败或抛错时 type=custom 并带 message。"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "reset",
|
|
45
|
+
"type": "() => void",
|
|
46
|
+
"description": "原生表单重置时触发。需要在应用内同步重置 Vue model。"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"slots": [
|
|
50
|
+
{
|
|
51
|
+
"name": "default",
|
|
52
|
+
"type": "({ loading: boolean }) => VNode[]",
|
|
53
|
+
"description": "表单字段与操作,loading 合并外部 loading 和内部校验状态。"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"methods": [
|
|
57
|
+
{
|
|
58
|
+
"name": "validate()",
|
|
59
|
+
"type": "() => Promise<boolean>",
|
|
60
|
+
"description": "执行原生及自定义校验,返回是否通过;不会发出 submit。"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "submit()",
|
|
64
|
+
"type": "() => Promise<void>",
|
|
65
|
+
"description": "在可用状态下执行校验,通过后发出 submit(FormData)。"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "reset()",
|
|
69
|
+
"type": "() => void",
|
|
70
|
+
"description": "调用原生 form.reset() 并触发 reset;父组件应同步重置 Vue model。"
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"notes": [
|
|
74
|
+
"FormData 只包含有 name 的可提交字段。reset 重置浏览器字段,不会替应用重置所有 Vue model。"
|
|
75
|
+
]
|
|
76
|
+
})
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineHandbook } from '../handbook'
|
|
2
|
+
|
|
3
|
+
export default defineHandbook({
|
|
4
|
+
"name": "AppleGrid",
|
|
5
|
+
"source": "src/components/foundation.ts",
|
|
6
|
+
"props": [
|
|
7
|
+
{
|
|
8
|
+
"name": "min",
|
|
9
|
+
"type": "number",
|
|
10
|
+
"default": "240",
|
|
11
|
+
"description": "每列最小设计宽度,单位 px;空间不足时收缩到容器宽度,列数自动适应。"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "gap",
|
|
15
|
+
"type": "number",
|
|
16
|
+
"default": "20",
|
|
17
|
+
"description": "网格间距,单位 px。"
|
|
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,122 @@
|
|
|
1
|
+
import { defineHandbook } from '../handbook'
|
|
2
|
+
|
|
3
|
+
export default defineHandbook({
|
|
4
|
+
"name": "AppleImage",
|
|
5
|
+
"source": "src/components/foundation.ts",
|
|
6
|
+
"props": [
|
|
7
|
+
{
|
|
8
|
+
"name": "motion",
|
|
9
|
+
"type": "'inherit' | 'auto' | 'full' | 'reduced' | 'none'",
|
|
10
|
+
"default": "\"inherit\"",
|
|
11
|
+
"description": "局部动效偏好。inherit 跟随外层;全局与系统的减少动效设置仍是上限。"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "preview",
|
|
15
|
+
"type": "boolean",
|
|
16
|
+
"default": "true",
|
|
17
|
+
"description": "点击有效图片进入内置放大预览;关闭后仍能使用图片组和轮播。"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "gallery",
|
|
21
|
+
"type": "AppleImageItem | (string | AppleImageItem)[]",
|
|
22
|
+
"default": "[]",
|
|
23
|
+
"description": "单个图片对象或字符串/对象数组。对象:{ src?, alt?, title?, width?, height?, label?, value?, description? }。普通图片忽略无 src 的空项;carousel 可用无 src 的自定义内容。顶层没有 src/alt props。"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "carousel",
|
|
27
|
+
"type": "boolean",
|
|
28
|
+
"default": "false",
|
|
29
|
+
"description": "轮播模式,强制 compact 布局,并启用 item 插槽和标题说明。"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "autoplay",
|
|
33
|
+
"type": "boolean",
|
|
34
|
+
"default": "true",
|
|
35
|
+
"description": "carousel 模式自动循环播放;悬浮、聚焦、预览、拖动、页面隐藏或禁用时暂停。"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "interval",
|
|
39
|
+
"type": "number",
|
|
40
|
+
"default": "5000",
|
|
41
|
+
"description": "carousel 自动播放间隔,单位毫秒,默认每 5 秒切换一张图片。"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "disabled",
|
|
45
|
+
"type": "boolean",
|
|
46
|
+
"default": "false",
|
|
47
|
+
"description": "禁用打开预览、翻页、拖动及图片组键盘操作。"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "label",
|
|
51
|
+
"type": "string",
|
|
52
|
+
"default": "\"图片轮播\"",
|
|
53
|
+
"description": "控件名称或区域的可访问名称。无可见名称时应提供 aria-label。"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "galleryLayout",
|
|
57
|
+
"type": "'compact' | 'tiled' | 'tiled-wrap'",
|
|
58
|
+
"default": "\"compact\"",
|
|
59
|
+
"description": "compact 为分页图片条,tiled 为横向平铺,tiled-wrap 为换行平铺。"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "galleryShape",
|
|
63
|
+
"type": "'natural' | 'square'",
|
|
64
|
+
"default": "\"natural\"",
|
|
65
|
+
"description": "natural 保留各图片比例,square 强制正方形并居中裁剪。"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "index",
|
|
69
|
+
"type": "number",
|
|
70
|
+
"default": "0",
|
|
71
|
+
"description": "当前图片索引,从 0 开始,可用 v-model:index。非有限值归零,越界值截取到有效范围。"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "squared",
|
|
75
|
+
"type": "boolean",
|
|
76
|
+
"default": "false",
|
|
77
|
+
"description": "强制 1:1,覆盖 aspectRatio、galleryShape 和 fit;也作用于图片组。"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "aspectRatio",
|
|
81
|
+
"type": "string | number",
|
|
82
|
+
"default": "\"4/3\"",
|
|
83
|
+
"description": "单图或 compact 视口的 CSS aspect-ratio 值,例如 4/3、1;不是图片像素尺寸。"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "fit",
|
|
87
|
+
"type": "'contain' | 'cover'",
|
|
88
|
+
"default": "\"cover\"",
|
|
89
|
+
"description": "contain 完整显示,cover 填满裁剪;正方形模式始终使用 cover。"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"events": [
|
|
93
|
+
{
|
|
94
|
+
"name": "update:index",
|
|
95
|
+
"type": "(value: number) => void",
|
|
96
|
+
"description": "交互更新 index 时发出新值;可使用对应的命名 v-model 接收。"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "change",
|
|
100
|
+
"type": "(value: number) => void",
|
|
101
|
+
"description": "图片组或预览索引改变时发出从 0 开始的索引。"
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
"slots": [
|
|
105
|
+
{
|
|
106
|
+
"name": "item",
|
|
107
|
+
"type": "({ item: AppleImageItem, index: number, active: boolean }) => VNode[]",
|
|
108
|
+
"description": "仅 carousel=true 时替代整个轮播项;提供无图片内容时不会打开图片预览。"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "caption",
|
|
112
|
+
"type": "() => VNode[](无 slot props)",
|
|
113
|
+
"description": "figure 的 figcaption 说明文字。"
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
"methods": [],
|
|
117
|
+
"notes": [
|
|
118
|
+
"图片数组不接受顶层 src/alt;描述应放在 gallery 对象内。预览由组件内部管理,没有独立公开 Viewer 组件。",
|
|
119
|
+
"图片组支持方向键、Home/End、拖动和分页;无效或加载失败的图片不会打开预览。横屏缩略图左右按钮在悬浮时淡入、移开时淡出,遵循 --apple-fast 和 --apple-ease;竖屏隐藏左右箭头、关闭及缩放按钮。",
|
|
120
|
+
"所有设备使用统一预览交互,平滑滚轮、缩放、旋转、翻页和进退场支持动画打断与叠加;底部胶囊依次为左旋转、缩小、可选名称、放大、右旋转,每次旋转 90°。"
|
|
121
|
+
]
|
|
122
|
+
})
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { defineHandbook } from '../handbook'
|
|
2
|
+
|
|
3
|
+
export default defineHandbook({
|
|
4
|
+
"name": "AppleInfiniteScroll",
|
|
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": "loading",
|
|
15
|
+
"type": "boolean",
|
|
16
|
+
"default": "false",
|
|
17
|
+
"description": "外部加载状态;从 true 变为 false 时释放等待并重新观察。"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "error",
|
|
21
|
+
"type": "boolean | string",
|
|
22
|
+
"default": "false",
|
|
23
|
+
"description": "true 显示默认错误,字符串显示指定错误;错误时不自动加载,提供重试按钮。"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "finished",
|
|
27
|
+
"type": "boolean",
|
|
28
|
+
"default": "false",
|
|
29
|
+
"description": "已加载完毕;为 true 时停止自动加载并显示 finishedText。"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "disabled",
|
|
33
|
+
"type": "boolean",
|
|
34
|
+
"default": "false",
|
|
35
|
+
"description": "禁用控件的交互。选项自身的 disabled 仍然独立生效。"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "distance",
|
|
39
|
+
"type": "number",
|
|
40
|
+
"default": "120",
|
|
41
|
+
"description": "IntersectionObserver 的 rootMargin 预加载距离,单位 px,创建时使用,负数按 0。"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "finishedText",
|
|
45
|
+
"type": "string",
|
|
46
|
+
"default": "\"已经到底了\"",
|
|
47
|
+
"description": "finished 为 true 时的文字。"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"events": [
|
|
51
|
+
{
|
|
52
|
+
"name": "load",
|
|
53
|
+
"type": "(done: () => void) => void",
|
|
54
|
+
"description": "观察到加载区或点击“加载更多”时触发;完成后调用 done(),或让 loading 从 true 变为 false。"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "retry",
|
|
58
|
+
"type": "(done: () => void) => void",
|
|
59
|
+
"description": "点击重试时触发;完成后释放等待,错误和 finished 状态由应用更新。"
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"slots": [
|
|
63
|
+
{
|
|
64
|
+
"name": "default",
|
|
65
|
+
"type": "() => VNode[](无 slot props)",
|
|
66
|
+
"description": "已加载的列表内容。"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"methods": [],
|
|
70
|
+
"notes": [
|
|
71
|
+
"完成后释放等待;示例自动执行 done() 并在第三批结束,以避免观察器无限加载。distance 在观察器创建时读取。"
|
|
72
|
+
]
|
|
73
|
+
})
|