Skip to content

Commit fe52808

Browse files
committed
Merge branch 'refactor-mobile-site' of github.com:opentiny/tiny-vue into refactor-mobile-site
2 parents 18c6c4d + 92b0c75 commit fe52808

File tree

1,435 files changed

+4403
-22490
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,435 files changed

+4403
-22490
lines changed

.github/workflows/auto-all-publish.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,14 @@ jobs:
6767
- name: Run Build ThemeMobile
6868
run: pnpm build:themeMobile
6969

70+
- name: Run Build Utils
71+
run: pnpm build:utils
72+
7073
- name: Run Build Runtime
7174
run: pnpm build:runtime
7275

7376
- name: Publish Vue3 And Vue2 components
74-
run: pnpm pub:all
77+
run: pnpm pub:all && pnpm pub:utils
7578
env:
7679
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
7780

.github/workflows/dispatch-all-publish-alpha.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,16 @@ jobs:
7979
- name: Run Build ThemeMobile
8080
run: pnpm build:themeMobile
8181

82+
- name: Run Build Utils
83+
run: pnpm build:utils
84+
8285
- name: Run Build Runtime
8386
run: pnpm build:runtime
8487

8588
- name: Run Release alpha
8689
run: pnpm release:alpha
8790

8891
- name: Publish Vue3 And Vue2 components
89-
run: pnpm pub:all && pnpm pub:site
92+
run: pnpm pub:all && pnpm pub:utils && pnpm pub:site
9093
env:
9194
NODE_AUTH_TOKEN: ${{ secrets.NPM_OPENTINY_VUE_TOKEN }}

.github/workflows/dispatch-renderless-theme-publish-alpha.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
components:
88
description: |
99
输入需要打包的模块名称,多个以英文逗号分隔,
10-
例如: `theme,renderless,runtime,docs`
10+
例如: `theme,renderless,runtime,docs,utils`
1111
required: true
1212
type: string
1313
concurrency:
@@ -25,8 +25,9 @@ jobs:
2525
script: |
2626
const branchName = `${{ github.ref_name }}`
2727
const moduleName = `${{ inputs.components }}`
28+
const validModuleNames = ['theme', 'renderless', 'runtime', 'docs','utils']
2829
29-
if (!moduleName.includes('theme') && !moduleName.includes('renderless') && !moduleName.includes('docs') && !moduleName.includes('runtime')) {
30+
if (!validModuleNames.some(name => moduleName.includes(name))) {
3031
throw new Error('请输入正确的包名称')
3132
}
3233
@@ -80,6 +81,10 @@ jobs:
8081
if: contains(inputs.components, 'runtime') == true
8182
run: pnpm build:runtime
8283

84+
- name: Run Build Utils
85+
if: contains(inputs.components, 'utils') == true
86+
run: pnpm build:utils
87+
8388
- name: Run Release alpha
8489
run: pnpm release:alpha -u
8590

@@ -89,6 +94,13 @@ jobs:
8994
env:
9095
NODE_AUTH_TOKEN: ${{ secrets.NPM_OPENTINY_VUE_TOKEN }}
9196

97+
- name: Publish Utils
98+
if: contains(inputs.components, 'utils') == true
99+
run: |
100+
pnpm pub:utils
101+
env:
102+
NODE_AUTH_TOKEN: ${{ secrets.NPM_OPENTINY_VUE_TOKEN }}
103+
92104
- name: Publish Docs
93105
if: contains(inputs.components, 'docs') == true
94106
run: |

examples/nuxt/playground/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,19 @@
1616
},
1717
"devDependencies": {
1818
"@opentiny-internal/unplugin-virtual-template": "workspace:*",
19+
"@opentiny/utils": "workspace:~",
1920
"@opentiny/vue": "workspace:~",
2021
"@opentiny/vue-common": "workspace:~",
22+
"@opentiny/vue-directive": "workspace:~",
23+
"@opentiny/vue-hooks": "workspace:~",
2124
"@opentiny/vue-icon": "workspace:~",
2225
"@opentiny/vue-locale": "workspace:~",
2326
"@opentiny/vue-renderless": "workspace:~",
2427
"@opentiny/vue-theme": "workspace:~",
2528
"@opentiny/vue-theme-mobile": "workspace:~",
26-
"@opentiny/vue-vite-import": "workspace:~",
29+
"@opentiny/vue-vite-import": "~1.2.0",
2730
"@tiptap/vue-3": "^2.1.0",
2831
"@vitejs/plugin-vue-jsx": "^3.0.0",
29-
"js-sha256": "^0.9.0",
3032
"onigasm": "^2.2.5",
3133
"postcss": "^8.4.16",
3234
"typescript": "^5.0.0",

examples/nuxt/playground/pages/InfiniteScroll.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</template>
66

77
<script setup lang="ts">
8-
import InfiniteScroll from '@opentiny/vue-renderless/common/deps/infinite-scroll'
8+
import { InfiniteScroll } from '@opentiny/vue-directive'
99
import { ref } from 'vue'
1010
1111
const count = ref(0)
Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
export default {
2+
mode: ['pc'],
3+
apis: [
4+
{
5+
name: 'date-panel',
6+
type: 'component',
7+
props: [
8+
{
9+
name: 'disabled-date',
10+
type: 'function',
11+
defaultValue: '',
12+
desc: {
13+
'zh-CN': '配置部分禁用',
14+
'en-US': 'Configuration section disabled.'
15+
},
16+
mode: ['pc'],
17+
pcDemo: 'disabled-date'
18+
},
19+
{
20+
name: 'format',
21+
type: 'string',
22+
defaultValue: "'yyyy-MM-dd'",
23+
desc: {
24+
'zh-CN': '面板选中日期格式',
25+
'en-US': 'Select date format on the panel.'
26+
},
27+
mode: ['pc'],
28+
pcDemo: 'format'
29+
},
30+
{
31+
name: 'v-model/modelValue',
32+
type: 'date | string | number',
33+
defaultValue: '',
34+
desc: {
35+
'zh-CN': '绑定值',
36+
'en-US': 'Set the initial value of the calendar component. ;Bound Value.'
37+
},
38+
mode: ['pc'],
39+
pcDemo: 'basic-usage'
40+
},
41+
{
42+
name: 'popper-class',
43+
type: 'string',
44+
defaultValue: '',
45+
desc: {
46+
'zh-CN': '为 DatePicker 面板添加的 class 类名',
47+
'en-US': 'Class name added for DatePanel.'
48+
},
49+
mode: ['pc'],
50+
pcDemo: 'custom-suffix-icon'
51+
},
52+
{
53+
name: 'readonly',
54+
type: 'boolean',
55+
defaultValue: 'false',
56+
desc: {
57+
'zh-CN': '设置日历组件是否只读',
58+
'en-US': 'Set panel component is read-only.'
59+
},
60+
mode: ['pc'],
61+
pcDemo: 'readonly'
62+
},
63+
{
64+
name: 'show-week-number',
65+
type: 'boolean',
66+
defaultValue: 'false',
67+
desc: {
68+
'zh-CN': '是否展示周次序号',
69+
'en-US': 'Display week number.'
70+
},
71+
mode: ['pc'],
72+
pcDemo: 'custom-weeks'
73+
},
74+
{
75+
name: 'format-weeks',
76+
type: '(customWeeks: number, weekFirstDays: string[]) => string',
77+
defaultValue: '',
78+
desc: {
79+
'zh-CN':
80+
'格式化周次序号,该回调函数有两个参数,customWeeks 用来获取自定义周次的序号,weekFirstDays 用来获取每周次中的首个日期',
81+
'en-US':
82+
'Format the week number, this callback function has two parameters: customWeeks is used to obtain the custom week number, and weekFirstDays is used to obtain the first date in the week number'
83+
},
84+
mode: ['pc'],
85+
pcDemo: 'custom-weeks'
86+
},
87+
{
88+
name: 'first-day-of-week',
89+
type: 'number',
90+
defaultValue: '7',
91+
desc: {
92+
'zh-CN': '设置每周的第一天是星期几,默认值是7,也就是星期天',
93+
'en-US':
94+
'Set the first day of each week as the day of the week, with a default value of 7, which is Sunday.'
95+
},
96+
mode: ['pc'],
97+
pcDemo: 'custom-weeks'
98+
}
99+
],
100+
events: [
101+
{
102+
name: 'select-change',
103+
type: '(value: string) => void',
104+
desc: {
105+
'zh-CN': '用户确认选定的值时触发',
106+
'en-US': 'This event is triggered when the user confirms the selected value.'
107+
},
108+
mode: ['pc'],
109+
pcDemo: 'event'
110+
}
111+
],
112+
format: [
113+
{
114+
name: 'a',
115+
desc: {
116+
'zh-CN': 'am/pm',
117+
'en-US': ''
118+
},
119+
mode: ['pc'],
120+
pcDemo: ''
121+
},
122+
{
123+
name: 'A',
124+
desc: {
125+
'zh-CN': 'AM/PM',
126+
'en-US': ''
127+
},
128+
mode: ['pc'],
129+
pcDemo: ''
130+
},
131+
{
132+
name: 'd',
133+
desc: {
134+
'zh-CN': '日,不补0',
135+
'en-US': ''
136+
},
137+
mode: ['pc']
138+
},
139+
{
140+
name: 'dd',
141+
desc: {
142+
'zh-CN': '日',
143+
'en-US': ''
144+
},
145+
mode: ['pc']
146+
},
147+
{
148+
name: 'M',
149+
desc: {
150+
'zh-CN': '月,不补0',
151+
'en-US': ''
152+
},
153+
mode: ['pc']
154+
},
155+
{
156+
name: 'MM',
157+
desc: {
158+
'zh-CN': '月',
159+
'en-US': ''
160+
},
161+
mode: ['pc']
162+
},
163+
{
164+
name: 'W',
165+
desc: {
166+
'zh-CN': '周,不补0',
167+
'en-US': ''
168+
},
169+
mode: ['pc']
170+
},
171+
{
172+
name: 'WW',
173+
desc: {
174+
'zh-CN': '周',
175+
'en-US': ''
176+
},
177+
mode: ['pc']
178+
},
179+
{
180+
name: 'yyyy',
181+
desc: {
182+
'zh-CN': '年',
183+
'en-US': ''
184+
},
185+
mode: ['pc']
186+
}
187+
]
188+
}
189+
],
190+
types: [
191+
{
192+
name: 'IPickerOptions',
193+
type: 'interface',
194+
code: `
195+
interface IPickerOptions {
196+
// 每周的第一天是星期几,默认值是7,也就是星期天
197+
firstDayOfWeek: number
198+
// 实现部分禁用,此时只能选择一部分日期
199+
disabledDate: (time: Date) => boolean
200+
// 选中日期后执行的回调,需要与 daterange 或 datetimerange 类型配合使用才生效
201+
onPick: (range: { minDate: Date, maxDate: Date }) => void
202+
// 快捷选项
203+
shortcuts: {
204+
text: string
205+
onClick: (picker: { $emit: (type: string, date: Date) => void }) => void
206+
type: 'startFrom' | 'EndAt'
207+
startDate: Date
208+
endDate: Date
209+
}[]
210+
}
211+
`
212+
},
213+
{
214+
name: 'IType',
215+
type: 'type',
216+
code: `
217+
type IType = 'date' | 'dates' | 'daterange' | 'datetime' | 'datetimerange' | 'week' | 'month' | 'monthrange' | 'quarter' | 'year' | 'years' | 'yearrange'
218+
`
219+
}
220+
]
221+
}

examples/sites/demos/apis/grid.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2490,24 +2490,12 @@ export default {
24902490
defaultValue: '',
24912491
desc: {
24922492
'zh-CN':
2493-
'表格校验函数,如果指定 row 或 rows 则校验指定一行或多行,否则校验整个表格。该回调函数会在校验结束后被调用,并传入两个参数:(是否校验成功,最近一列未通过校验的字段)。若不传入回调函数,则会返回一个 promise',
2493+
'表格校验函数,如果指定 row 或 rows 则校验指定一行或多行,否则校验整个表格。该回调函数会在校验结束后被调用,并传入两个参数:(是否校验成功,最近一列未通过校验的字段)。若不传入回调函数,则会返回一个 promise, 校验成功返回 true (3.22.0新增),校验失败返回错误信息对象',
24942494
'en-US':
24952495
'Table verification function. If a row or rows is specified, the specified row or multiple rows are verified. Otherwise, the entire table is verified. This callback function is called after the verification is complete and the following parameters are transferred: (Whether the verification is successful. The fields in the latest column fail the verification.) If no callback function is passed in, a promise is returned'
24962496
},
24972497
mode: ['pc', 'mobile-first'],
24982498
pcDemo: 'grid-validation#validation-before-submit-validation'
2499-
},
2500-
{
2501-
name: 'validate(rows, callback)',
2502-
type: '',
2503-
defaultValue: '',
2504-
desc: {
2505-
'zh-CN':
2506-
'表格校验函数,如果指定 row 或 rows 则校验指定一行或多行,否则校验整个表格。该回调函数会在校验结束后被调用,并传入两个参数:(是否校验成功,最近一列未通过校验的字段)。若不传入回调函数,则会返回一个 promise',
2507-
'en-US': ''
2508-
},
2509-
mode: ['mobile-first'],
2510-
mfDemo: ''
25112499
}
25122500
],
25132501
slots: [

examples/sites/demos/apis/modal.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,12 +315,16 @@ export default {
315315
{
316316
name: 'show-close',
317317
type: 'boolean',
318-
defaultValue: '',
318+
defaultValue: 'true',
319319
desc: {
320320
'zh-CN': '是否显示关闭按钮,默认值为 true',
321321
'en-US': ''
322322
},
323-
mode: ['mobile-first'],
323+
meta: {
324+
stable: '3.22.0'
325+
},
326+
mode: ['pc', 'mobile-first'],
327+
pcDemo: 'modal-other',
324328
mfDemo: ''
325329
},
326330
{

examples/sites/demos/mobile-first/app/select/memoize-usage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<script>
1717
import { TinySelect, TinyOption } from '@opentiny/vue'
18-
import Memorize from '@opentiny/vue-renderless/common/deps/memorize'
18+
import { Memorize } from '@opentiny/utils'
1919
2020
const MemorizeInstance = new Memorize({ key: 'test456' })
2121

0 commit comments

Comments
 (0)