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.
Files changed (130) hide show
  1. package/README.md +1 -1
  2. package/THIRD_PARTY_LICENSES.txt +23 -0
  3. package/dist/apptify.css +1 -1
  4. package/dist/apptify.js +2395 -2451
  5. package/dist/components/AppleCard.vue.d.ts +1 -1
  6. package/dist/components/content.d.ts +81 -20
  7. package/dist/components/forms.d.ts +2 -2
  8. package/dist/components/foundation.d.ts +133 -11
  9. package/dist/components/mobile-image-viewer.d.ts +35 -12
  10. package/dist/components/navibar.d.ts +2 -2
  11. package/dist/components/overlays.d.ts +10 -59
  12. package/dist/components/scrollbar.d.ts +88 -0
  13. package/dist/components/speed-dial.d.ts +157 -0
  14. package/dist/core/context.d.ts +11 -0
  15. package/dist/core/device.d.ts +2 -0
  16. package/dist/core/image-gallery-motion.d.ts +2 -1
  17. package/dist/core/image-motion.d.ts +1 -1
  18. package/dist/core/layers.d.ts +1 -0
  19. package/dist/core/motion-driver.d.ts +40 -0
  20. package/dist/core/motion.d.ts +1 -1
  21. package/dist/core/ripple.d.ts +16 -0
  22. package/dist/core/scroll-motion.d.ts +6 -0
  23. package/dist/core/scrollbar.d.ts +14 -0
  24. package/dist/core/speed-dial.d.ts +21 -0
  25. package/dist/index.d.ts +237 -26
  26. package/docs/COMPONENTS.md +10 -6
  27. package/package.json +5 -7
  28. package/templates/playground/README.md +1 -1
  29. package/templates/playground/package.json +1 -2
  30. package/templates/playground/source-snapshot.json +299 -66
  31. package/templates/playground/src/App.vue +1 -0
  32. package/templates/playground/src/ComponentDemo.vue +30 -21
  33. package/templates/playground/src/catalog.ts +70 -65
  34. package/templates/playground/src/components/ComponentIndex.vue +10 -14
  35. package/templates/playground/src/components/MasonryFeed.vue +52 -0
  36. package/templates/playground/src/components/UserMenu.vue +1 -1
  37. package/templates/playground/src/components/forbidden-paper-scene.vue +367 -0
  38. package/templates/playground/src/components/forbidden-paper-story.ts +233 -0
  39. package/templates/playground/src/editor/ComponentPlayground.vue +89 -0
  40. package/templates/playground/src/editor/ConfigurableEditor.vue +1 -1
  41. package/templates/playground/src/editor/apple-input-source.ts +1 -1
  42. package/templates/playground/src/editor/component-metadata.ts +72 -0
  43. package/templates/playground/src/editor/component-playground.ts +162 -0
  44. package/templates/playground/src/editor/contract.ts +1 -1
  45. package/templates/playground/src/editor/documents.ts +11 -2
  46. package/templates/playground/src/editor/handbook.ts +22 -0
  47. package/templates/playground/src/editor/handbooks/apple-accordion.ts +66 -0
  48. package/templates/playground/src/editor/handbooks/apple-action-sheet.ts +72 -0
  49. package/templates/playground/src/editor/handbooks/apple-alert.ts +67 -0
  50. package/templates/playground/src/editor/handbooks/apple-aside.ts +32 -0
  51. package/templates/playground/src/editor/handbooks/apple-auto-size.ts +32 -0
  52. package/templates/playground/src/editor/handbooks/apple-autocomplete.ts +114 -0
  53. package/templates/playground/src/editor/handbooks/apple-avatar-group.ts +50 -0
  54. package/templates/playground/src/editor/handbooks/apple-avatar.ts +56 -0
  55. package/templates/playground/src/editor/handbooks/apple-back-top.ts +62 -0
  56. package/templates/playground/src/editor/handbooks/apple-badge.ts +62 -0
  57. package/templates/playground/src/editor/handbooks/apple-breadcrumbs.ts +38 -0
  58. package/templates/playground/src/editor/handbooks/apple-button.ts +92 -0
  59. package/templates/playground/src/editor/handbooks/apple-card.ts +112 -0
  60. package/templates/playground/src/editor/handbooks/apple-cascader.ts +102 -0
  61. package/templates/playground/src/editor/handbooks/apple-checkbox.ts +85 -0
  62. package/templates/playground/src/editor/handbooks/apple-color-picker.ts +79 -0
  63. package/templates/playground/src/editor/handbooks/apple-container.ts +26 -0
  64. package/templates/playground/src/editor/handbooks/apple-date-picker.ts +104 -0
  65. package/templates/playground/src/editor/handbooks/apple-dialog.ts +151 -0
  66. package/templates/playground/src/editor/handbooks/apple-divider.ts +38 -0
  67. package/templates/playground/src/editor/handbooks/apple-drawer.ts +151 -0
  68. package/templates/playground/src/editor/handbooks/apple-empty.ts +43 -0
  69. package/templates/playground/src/editor/handbooks/apple-floating-group.ts +51 -0
  70. package/templates/playground/src/editor/handbooks/apple-form-field.ts +69 -0
  71. package/templates/playground/src/editor/handbooks/apple-form.ts +76 -0
  72. package/templates/playground/src/editor/handbooks/apple-grid.ts +32 -0
  73. package/templates/playground/src/editor/handbooks/apple-image.ts +122 -0
  74. package/templates/playground/src/editor/handbooks/apple-infinite-scroll.ts +73 -0
  75. package/templates/playground/src/editor/handbooks/apple-link.ts +68 -0
  76. package/templates/playground/src/editor/handbooks/apple-list.ts +67 -0
  77. package/templates/playground/src/editor/handbooks/apple-menu.ts +72 -0
  78. package/templates/playground/src/editor/handbooks/apple-navibar.ts +100 -0
  79. package/templates/playground/src/editor/handbooks/apple-otp-input.ts +108 -0
  80. package/templates/playground/src/editor/handbooks/apple-overlay-host.ts +13 -0
  81. package/templates/playground/src/editor/handbooks/apple-pagination.ts +61 -0
  82. package/templates/playground/src/editor/handbooks/apple-popover.ts +112 -0
  83. package/templates/playground/src/editor/handbooks/apple-progress.ts +56 -0
  84. package/templates/playground/src/editor/handbooks/apple-provider.ts +32 -0
  85. package/templates/playground/src/editor/handbooks/apple-pull-refresh.ts +61 -0
  86. package/templates/playground/src/editor/handbooks/apple-radio-group.ts +91 -0
  87. package/templates/playground/src/editor/handbooks/apple-rate.ts +97 -0
  88. package/templates/playground/src/editor/handbooks/apple-scroll-bar.ts +15 -0
  89. package/templates/playground/src/editor/handbooks/apple-search.ts +49 -0
  90. package/templates/playground/src/editor/handbooks/apple-segmented-control.ts +85 -0
  91. package/templates/playground/src/editor/handbooks/apple-select.ts +91 -0
  92. package/templates/playground/src/editor/handbooks/apple-sheet.ts +151 -0
  93. package/templates/playground/src/editor/handbooks/apple-skeleton.ts +74 -0
  94. package/templates/playground/src/editor/handbooks/apple-slider.ts +103 -0
  95. package/templates/playground/src/editor/handbooks/apple-snackbar.ts +89 -0
  96. package/templates/playground/src/editor/handbooks/apple-speed-dial-item.ts +16 -0
  97. package/templates/playground/src/editor/handbooks/apple-speed-dial.ts +13 -0
  98. package/templates/playground/src/editor/handbooks/apple-spinner.ts +38 -0
  99. package/templates/playground/src/editor/handbooks/apple-stack.ts +44 -0
  100. package/templates/playground/src/editor/handbooks/apple-statistic.ts +69 -0
  101. package/templates/playground/src/editor/handbooks/apple-stepper.ts +91 -0
  102. package/templates/playground/src/editor/handbooks/apple-steps.ts +61 -0
  103. package/templates/playground/src/editor/handbooks/apple-switch.ts +79 -0
  104. package/templates/playground/src/editor/handbooks/apple-tab-bar.ts +66 -0
  105. package/templates/playground/src/editor/handbooks/apple-table.ts +176 -0
  106. package/templates/playground/src/editor/handbooks/apple-tabs.ts +72 -0
  107. package/templates/playground/src/editor/handbooks/apple-tag.ts +56 -0
  108. package/templates/playground/src/editor/handbooks/apple-textarea.ts +109 -0
  109. package/templates/playground/src/editor/handbooks/apple-timeline.ts +44 -0
  110. package/templates/playground/src/editor/handbooks/apple-tooltip.ts +45 -0
  111. package/templates/playground/src/editor/handbooks/apple-transition.ts +44 -0
  112. package/templates/playground/src/editor/handbooks/apple-tree.ts +84 -0
  113. package/templates/playground/src/editor/handbooks/apple-upload.ts +126 -0
  114. package/templates/playground/src/editor/playground-examples.ts +105 -0
  115. package/templates/playground/src/images.ts +3 -0
  116. package/templates/playground/src/router/index.ts +19 -2
  117. package/templates/playground/src/style.css +4 -4
  118. package/templates/playground/src/views/403.vue +65 -0
  119. package/templates/playground/src/views/component-docs/[component].vue +11 -14
  120. package/templates/playground/src/views/components.vue +11 -41
  121. package/templates/playground/src/views/index.vue +3 -1
  122. package/templates/playground/src/views/settings.vue +5 -2
  123. package/tooling/create-playground.mjs +2 -2
  124. package/tooling/prepare-playground.mjs +3 -3
  125. package/tooling/test-create-apptify.mjs +3 -1
  126. package/tooling/test-playground-package.mjs +10 -0
  127. package/dist/components/gallery-scrollbar.d.ts +0 -46
  128. package/dist/core/desktop-image-enter.d.ts +0 -6
  129. package/dist/core/desktop-image-return.d.ts +0 -1
  130. package/templates/playground/src/components/DirectoryDialog.vue +0 -20
@@ -0,0 +1,32 @@
1
+ import { defineHandbook } from '../handbook'
2
+
3
+ export default defineHandbook({
4
+ "name": "AppleProvider",
5
+ "source": "src/components/foundation.ts",
6
+ "props": [
7
+ {
8
+ "name": "theme",
9
+ "type": "string",
10
+ "default": "undefined",
11
+ "description": "局部主题名称:light、dark、graphite、rose、system,或已注册主题。省略时继承父上下文。"
12
+ },
13
+ {
14
+ "name": "motion",
15
+ "type": "'auto' | 'full' | 'reduced' | 'none'",
16
+ "default": "undefined",
17
+ "description": "局部上下文的动效模式。省略时继承父上下文;仅接受 auto、full、reduced、none。"
18
+ }
19
+ ],
20
+ "events": [],
21
+ "slots": [
22
+ {
23
+ "name": "default",
24
+ "type": "() => VNode[](无 slot props)",
25
+ "description": "处于局部主题和上下文中的内容。Provider 已包含 OverlayHost。"
26
+ }
27
+ ],
28
+ "methods": [],
29
+ "notes": [
30
+ "嵌套 Provider 可使用局部主题和动效上下文;glass 与 ripple 偏好仍与父上下文共享。Provider 已自动挂载 OverlayHost,无需再放一个。"
31
+ ]
32
+ })
@@ -0,0 +1,61 @@
1
+ import { defineHandbook } from '../handbook'
2
+
3
+ export default defineHandbook({
4
+ "name": "ApplePullRefresh",
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": "modelValue",
15
+ "type": "boolean",
16
+ "default": "false",
17
+ "description": "刷新状态。交互开始更新为 true,调用 refresh 事件的 done() 或改为 false 结束。"
18
+ },
19
+ {
20
+ "name": "disabled",
21
+ "type": "boolean",
22
+ "default": "false",
23
+ "description": "禁用控件的交互。选项自身的 disabled 仍然独立生效。"
24
+ },
25
+ {
26
+ "name": "threshold",
27
+ "type": "number",
28
+ "default": "72",
29
+ "description": "经过阻尼处理后的下拉触发距离,单位 px,实际至少 1。仅滚动顶部开始的单指竖向手势参与。"
30
+ },
31
+ {
32
+ "name": "label",
33
+ "type": "string",
34
+ "default": "\"刷新内容\"",
35
+ "description": "控件名称或区域的可访问名称。无可见名称时应提供 aria-label。"
36
+ }
37
+ ],
38
+ "events": [
39
+ {
40
+ "name": "update:modelValue",
41
+ "type": "(value: boolean) => void",
42
+ "description": "交互更新时发出新模型值;可使用 v-model 接收。"
43
+ },
44
+ {
45
+ "name": "refresh",
46
+ "type": "(done: () => void) => void",
47
+ "description": "开始刷新时触发。任务完成后调用 done(),或将模型改为 false。"
48
+ }
49
+ ],
50
+ "slots": [
51
+ {
52
+ "name": "default",
53
+ "type": "({ refresh: () => void, refreshing: boolean }) => VNode[]",
54
+ "description": "需要刷新的内容,也可使用 refresh 手动开始。"
55
+ }
56
+ ],
57
+ "methods": [],
58
+ "notes": [
59
+ "任务完成后必须调用 done() 或将模型设为 false。除了顶部触摸下拉,还提供可用键盘操作的刷新按钮。"
60
+ ]
61
+ })
@@ -0,0 +1,91 @@
1
+ import { defineHandbook } from '../handbook'
2
+
3
+ export default defineHandbook({
4
+ "name": "AppleRadioGroup",
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": "当前值。使用 v-model 同步组件发出的 update:modelValue。"
60
+ },
61
+ {
62
+ "name": "inline",
63
+ "type": "boolean",
64
+ "default": "false",
65
+ "description": "将原生单选按钮横向排列。"
66
+ },
67
+ {
68
+ "name": "name",
69
+ "type": "string",
70
+ "default": "undefined",
71
+ "description": "原生 radio 组名称,省略时自动生成;表单提交时使用此名称。"
72
+ }
73
+ ],
74
+ "events": [
75
+ {
76
+ "name": "update:modelValue",
77
+ "type": "(value: string | number | null) => void",
78
+ "description": "交互更新时发出新模型值;可使用 v-model 接收。"
79
+ },
80
+ {
81
+ "name": "change",
82
+ "type": "(value: string | number | null) => void",
83
+ "description": "用户提交选择或调整时发出当前值;直接从父组件赋值不会主动发出此事件。"
84
+ }
85
+ ],
86
+ "slots": [],
87
+ "methods": [],
88
+ "notes": [
89
+ "字段名称、帮助和错误文字只用于说明。直接操作控件;原生 name、autocomplete 等属性需按实际输入类型使用。"
90
+ ]
91
+ })
@@ -0,0 +1,97 @@
1
+ import { defineHandbook } from '../handbook'
2
+
3
+ export default defineHandbook({
4
+ "name": "AppleRate",
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": "modelValue",
51
+ "type": "number",
52
+ "default": "0",
53
+ "description": "整数星级,0 表示未评分;不支持半星。"
54
+ },
55
+ {
56
+ "name": "max",
57
+ "type": "number",
58
+ "default": "5",
59
+ "description": "星星数量,渲染限制为 1–10,应用也应使用该范围。"
60
+ },
61
+ {
62
+ "name": "readonly",
63
+ "type": "boolean",
64
+ "default": "false",
65
+ "description": "只展示,禁止交互更新并移出 Tab 顺序;与 disabled 独立。"
66
+ },
67
+ {
68
+ "name": "allowClear",
69
+ "type": "boolean",
70
+ "default": "true",
71
+ "description": "再次点击当前星级时清为 0;不会改变键盘方向键的整数步进规则。"
72
+ },
73
+ {
74
+ "name": "name",
75
+ "type": "string",
76
+ "default": "undefined",
77
+ "description": "HTML 表单字段名;设置后才会在 FormData 中包含此字段。"
78
+ }
79
+ ],
80
+ "events": [
81
+ {
82
+ "name": "update:modelValue",
83
+ "type": "(value: number) => void",
84
+ "description": "交互更新时发出新模型值;可使用 v-model 接收。"
85
+ },
86
+ {
87
+ "name": "change",
88
+ "type": "(value: number) => void",
89
+ "description": "用户提交选择或调整时发出当前值;直接从父组件赋值不会主动发出此事件。"
90
+ }
91
+ ],
92
+ "slots": [],
93
+ "methods": [],
94
+ "notes": [
95
+ "字段名称、帮助和错误文字只用于说明。直接操作控件;原生 name、autocomplete 等属性需按实际输入类型使用。"
96
+ ]
97
+ })
@@ -0,0 +1,15 @@
1
+ import { defineHandbook } from '../handbook'
2
+
3
+ export default defineHandbook({
4
+ name: 'AppleScrollBar', source: 'src/components/scrollbar.ts',
5
+ props: [
6
+ { name: 'target', type: 'string | HTMLElement | (() => HTMLElement | undefined)', default: '""', description: 'CSS 选择器、元素或返回元素的函数;空值自动接管当前文档的滚动容器。' },
7
+ { name: 'axis', type: "'both' | 'horizontal' | 'vertical'", default: '"both"', description: '指定目标时显示的滚动方向。' },
8
+ { name: 'label', type: 'string', default: '""', description: '滚动条的可访问名称,默认从目标名称生成。' },
9
+ { name: 'controls', type: 'string', default: '""', description: '目标元素 ID;未提供时使用或生成目标 ID。' },
10
+ ],
11
+ events: [{ name: 'interaction', type: '() => void', description: '拖动、点击轨道、键盘或滚轮操作时触发。' }],
12
+ slots: [],
13
+ methods: [{ name: 'refresh()', type: '() => void', description: '重新测量目标及滚动位置。尺寸、内容和滚动变化默认自动同步。' }],
14
+ notes: ['AppleProvider 默认启用全局接管,无需逐个包裹内容。滚动条使用 fixed,不占布局空间;z-index 取 max(80, 目标及祖先层级),弹窗内留在所属弹层上下文。', '原本主动隐藏滚动条的轮播、标签栏与日期滚轮保持原有交互;data-apple-scrollbar-ignore 可排除指定容器。'],
15
+ })
@@ -0,0 +1,49 @@
1
+ import { defineHandbook } from '../handbook'
2
+
3
+ export default defineHandbook({
4
+ "name": "AppleSearch",
5
+ "source": "src/components/foundation.ts",
6
+ "props": [
7
+ {
8
+ "name": "modelValue",
9
+ "type": "string",
10
+ "default": "\"\"",
11
+ "description": "搜索框的文字;输入和清空均返回字符串。"
12
+ },
13
+ {
14
+ "name": "placeholder",
15
+ "type": "string",
16
+ "default": "\"搜索\"",
17
+ "description": "尚未填写或选择时显示的占位文字,不能替代字段名称。"
18
+ },
19
+ {
20
+ "name": "label",
21
+ "type": "string",
22
+ "default": "\"搜索\"",
23
+ "description": "控件名称或区域的可访问名称。无可见名称时应提供 aria-label。"
24
+ },
25
+ {
26
+ "name": "disabled",
27
+ "type": "boolean",
28
+ "default": "false",
29
+ "description": "禁用输入和清空按钮。"
30
+ }
31
+ ],
32
+ "events": [
33
+ {
34
+ "name": "update:modelValue",
35
+ "type": "(value: string) => void",
36
+ "description": "交互更新时发出新模型值;可使用 v-model 接收。"
37
+ },
38
+ {
39
+ "name": "search",
40
+ "type": "(value: string) => void",
41
+ "description": "按 Enter 时发出当前查询文字;不会自动请求或过滤数据。"
42
+ }
43
+ ],
44
+ "slots": [],
45
+ "methods": [],
46
+ "notes": [
47
+ "使用真实内容与可访问名称;交互控件可通过 Tab 和原生键盘方式操作,动效遵循外层偏好。"
48
+ ]
49
+ })
@@ -0,0 +1,85 @@
1
+ import { defineHandbook } from '../handbook'
2
+
3
+ export default defineHandbook({
4
+ "name": "AppleSegmentedControl",
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 }[]。这是 radio 控件,不包含内容面板。"
54
+ },
55
+ {
56
+ "name": "modelValue",
57
+ "type": "string | number | null",
58
+ "default": "null",
59
+ "description": "当前值。使用 v-model 同步组件发出的 update:modelValue。"
60
+ },
61
+ {
62
+ "name": "name",
63
+ "type": "string",
64
+ "default": "undefined",
65
+ "description": "原生 radio 组名称;省略时自动生成。"
66
+ }
67
+ ],
68
+ "events": [
69
+ {
70
+ "name": "update:modelValue",
71
+ "type": "(value: string | number | null) => void",
72
+ "description": "交互更新时发出新模型值;可使用 v-model 接收。"
73
+ },
74
+ {
75
+ "name": "change",
76
+ "type": "(value: string | number | null) => void",
77
+ "description": "用户提交选择或调整时发出当前值;直接从父组件赋值不会主动发出此事件。"
78
+ }
79
+ ],
80
+ "slots": [],
81
+ "methods": [],
82
+ "notes": [
83
+ "字段名称、帮助和错误文字只用于说明。直接操作控件;原生 name、autocomplete 等属性需按实际输入类型使用。"
84
+ ]
85
+ })
@@ -0,0 +1,91 @@
1
+ import { defineHandbook } from '../handbook'
2
+
3
+ export default defineHandbook({
4
+ "name": "AppleSelect",
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 }[]。disabled 选项不能选择;required 时必须选中有效且未禁用的选项。"
54
+ },
55
+ {
56
+ "name": "modelValue",
57
+ "type": "string | number | null",
58
+ "default": "null",
59
+ "description": "选中选项的 value;可为字符串、数字或 null,不会强制转为字符串。"
60
+ },
61
+ {
62
+ "name": "placeholder",
63
+ "type": "string",
64
+ "default": "\"请选择\"",
65
+ "description": "尚未填写或选择时显示的占位文字,不能替代字段名称。"
66
+ }
67
+ ],
68
+ "events": [
69
+ {
70
+ "name": "update:modelValue",
71
+ "type": "(value: string | number | null) => void",
72
+ "description": "交互更新时发出新模型值;可使用 v-model 接收。"
73
+ },
74
+ {
75
+ "name": "change",
76
+ "type": "(value: string | number | null) => void",
77
+ "description": "用户提交选择或调整时发出当前值;直接从父组件赋值不会主动发出此事件。"
78
+ }
79
+ ],
80
+ "slots": [],
81
+ "methods": [
82
+ {
83
+ "name": "focus()",
84
+ "type": "() => void",
85
+ "description": "通过组件 ref 将焦点移到输入或选择触发元素;禁用时无法聚焦。"
86
+ }
87
+ ],
88
+ "notes": [
89
+ "字段名称、帮助和错误文字只用于说明。直接操作控件;原生 name、autocomplete 等属性需按实际输入类型使用。"
90
+ ]
91
+ })
@@ -0,0 +1,151 @@
1
+ import { defineHandbook } from '../handbook'
2
+
3
+ export default defineHandbook({
4
+ "name": "AppleSheet",
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": "\"bottom\"",
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
+ })