@opentiny/vue-docs 2.0.3 → 2.0.5

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.
@@ -28,7 +28,7 @@ export default {
28
28
  'en-US':
29
29
  'Data consists of indicators and dimensions. Dimension refers to data attributes, and indicator refers to quantitative measurement standards.'
30
30
  },
31
- 'demoId': 'chart/attributes-demo#props-demo10'
31
+ 'demoId': 'chart-attributes-demo#props-demo10'
32
32
  },
33
33
  {
34
34
  'name': 'settings ',
@@ -45,42 +45,42 @@ export default {
45
45
  'type': 'String',
46
46
  'defaultValue': '该属性的默认值为 auto',
47
47
  'desc': { 'zh-CN': '设置图表容器的宽度。', 'en-US': 'Set the width of the chart container.' },
48
- 'demoId': 'chart/attributes-demo#props-demo10'
48
+ 'demoId': 'chart-attributes-demo#props-demo10'
49
49
  },
50
50
  {
51
51
  'name': 'height',
52
52
  'type': 'String',
53
53
  'defaultValue': '该属性的默认值为 400px',
54
54
  'desc': { 'zh-CN': '设置图表容器的高度。', 'en-US': 'Set the height of the chart container.' },
55
- 'demoId': 'chart/attributes-demo#props-demo10'
55
+ 'demoId': 'chart-attributes-demo#props-demo10'
56
56
  },
57
57
  {
58
58
  'name': 'events',
59
59
  'type': 'Object',
60
60
  'defaultValue': '',
61
61
  'desc': { 'zh-CN': '事件绑定', 'en-US': 'Event binding' },
62
- 'demoId': 'chart/events#events-base'
62
+ 'demoId': 'chart-events#events-base'
63
63
  },
64
64
  {
65
65
  'name': 'init-options',
66
66
  'type': 'Object',
67
67
  'defaultValue': '',
68
68
  'desc': { 'zh-CN': 'init 附加参数', 'en-US': 'Init Additional Parameters' },
69
- 'demoId': 'chart/attributes-demo#props-demo10'
69
+ 'demoId': 'chart-attributes-demo#props-demo10'
70
70
  },
71
71
  {
72
72
  'name': 'tooltip-visible',
73
73
  'type': 'Boolean',
74
74
  'defaultValue': '该属性的默认值为 true',
75
75
  'desc': { 'zh-CN': '是否显示提示框', 'en-US': 'Display dialog box' },
76
- 'demoId': 'chart/attributes-demo#props-demo10'
76
+ 'demoId': 'chart-attributes-demo#props-demo10'
77
77
  },
78
78
  {
79
79
  'name': 'legend-visible',
80
80
  'type': 'Boolean',
81
81
  'defaultValue': '该属性的默认值为 true',
82
82
  'desc': { 'zh-CN': '是否显示图例', 'en-US': 'Display legend' },
83
- 'demoId': 'chart/attributes-demo#props-demo10'
83
+ 'demoId': 'chart-attributes-demo#props-demo10'
84
84
  },
85
85
  {
86
86
  'name': 'theme',
@@ -110,21 +110,21 @@ export default {
110
110
  'zh-CN': '是否处理生成图表时的宽度问题',
111
111
  'en-US': 'Do you want to process the width issue when generating charts?'
112
112
  },
113
- 'demoId': 'chart/events#events-base'
113
+ 'demoId': 'chart-events#events-base'
114
114
  },
115
115
  {
116
116
  'name': 'width-change-delay',
117
117
  'type': 'Number',
118
118
  'defaultValue': '该属性的默认值为 300',
119
119
  'desc': { 'zh-CN': '容器宽度变化的延迟', 'en-US': 'Container width change delay' },
120
- 'demoId': 'chart/question#question-base'
120
+ 'demoId': 'chart-question#question-base'
121
121
  },
122
122
  {
123
123
  'name': 'resizeable',
124
124
  'type': 'Boolean',
125
125
  'defaultValue': '该属性的默认值为 true',
126
126
  'desc': { 'zh-CN': '是否处理窗口 resize 事件', 'en-US': 'Whether to process the window resize event' },
127
- 'demoId': 'chart/question#question-base'
127
+ 'demoId': 'chart-question#question-base'
128
128
  },
129
129
  {
130
130
  'name': 'cancel-resize-check',
@@ -134,14 +134,14 @@ export default {
134
134
  'zh-CN': '是否禁用 resize 时的容器检测',
135
135
  'en-US': 'Whether to disable container detection during resize'
136
136
  },
137
- 'demoId': 'chart/question#question-base'
137
+ 'demoId': 'chart-question#question-base'
138
138
  },
139
139
  {
140
140
  'name': 'resize-delay',
141
141
  'type': 'Number',
142
142
  'defaultValue': '该属性的默认值为 200',
143
143
  'desc': { 'zh-CN': '窗口 resize 事件回调的延迟', 'en-US': 'Delay of the window resize event callback' },
144
- 'demoId': 'chart/attributes-demo#props-demo10'
144
+ 'demoId': 'chart-attributes-demo#props-demo10'
145
145
  },
146
146
  {
147
147
  'name': 'change-delay',
@@ -151,7 +151,7 @@ export default {
151
151
  'zh-CN': '属性修改触发图表重绘回调的延迟',
152
152
  'en-US': 'Delay for triggering chart redrawing callback after attribute modification'
153
153
  },
154
- 'demoId': 'chart/question#question-base'
154
+ 'demoId': 'chart-question#question-base'
155
155
  },
156
156
  {
157
157
  'name': 'set-option-opts',
@@ -2,22 +2,75 @@
2
2
 
3
3
  ## v2.10.0/v3.10.0
4
4
 
5
- ### Other Changes
5
+ `2023/08/14`
6
+
7
+ ### Exciting New Features 🎉
8
+
9
+ * feat(pop-editor): 当编辑框弹出时添加自定义事件 fix #268 by @yuanningning in https://github.com/opentiny/tiny-vue/pull/315
10
+ * feat(ip-address): 更改ipAddress组件的IPv6类型 close #272 by @yuanningning in https://github.com/opentiny/tiny-vue/pull/337
11
+ * feat(filter-panel): 新增过滤器面板组件
12
+ * feat(dialog-select): 新增 DialogSelect 组件
13
+ * feat(infinite-scroll): 新增 InfiniteScroll 无限滚动组件
14
+ * feat(tag-group): 新增 TagGroup 标签组组件
15
+ * feat(docs): 官网添加示例composition-api写法,支持切换composition-api和option-api
16
+ * feat(docs): 组件demo支持playground
17
+ * feat(grid): 表格增加快捷筛选面板,可以支持多选框筛选和日期筛选 ,同时支持用户配置默认筛选项
18
+ * feat(grid): 表格排序按钮默认为x-design最新规范图标
19
+ * feat(grid): 表格提示现在支持自定义tooltip内容显示,支持字符串或者jsx
20
+ * feat(tree-menu): TreeMenu新增设置与获取当前选中节点的方法
21
+ * feat(tree-menu): 树形菜单新增可折叠特性
22
+ * feat(tree): Tree新增连接线设置
23
+ * feat(timeline-item): 新增timeline-item组件
24
+ * feat(modal): modal支持配置底部按钮props与文字
25
+ * feat(button-group): 按钮组新增单个disabled特性
26
+ * feat(alert): 新增close插槽,实现外部控制显示或隐藏
27
+ * feat(alert): 组件图标取消垂直居中,采用固定定位
28
+ * feat(time-picker): 支持设置步长 `step`
29
+ * feat(date-picker): 增加 label 内置功能 `label`
30
+ * feat(date-picker): 支持设置时间选择的步长 `step`
31
+ * feat(date-picker): 支持显示周次 `show-week-number`
32
+ * feat(date-picker): 支持过滤器模式 `shape="filter"`
33
+ * feat(date-picker): 支持年份多选和年份范围选择 `type="years" | type="yearrange"`
34
+ * feat(date-picker): 支持某日起始/某日为止功能 `type: 'startFrom'`
6
35
 
7
- - fix: 主题变量 token 命名变更,默认按钮最小宽度 --ti-button-size-normal-mini-width 改为 --ti-button-size-normal-min-width
8
- - fix: 主题变量 token 命名变更,超大按钮最小宽度 --ti-button-size-large-mini-width 改为 --ti-button-size-large-min-width
9
- - fix: 主题变量 token 命名变更,中等按钮最小宽度 --ti-button-size-medium-mini-width 改为 --ti-button-size-medium-min-width
10
- - fix: 主题变量 token 命名变更,小尺寸按钮最小宽度 --ti-button-size-small-mini-width 改为 --ti-button-size-small-min-width
11
- - fix: 主题变量 token 命名变更,迷你尺寸按钮最小宽度 --ti-button-size-mini-mini-width 改为 --ti-button-size-mini-min-width
12
- - fix: 主题变量 token 命名变更, 默认按钮悬浮背景色 --ti-button-normal-hover-background-color 改为 --ti-button-normal-hover-bg-color
13
- - fix: 主题变量 token 命名变更,默认按钮点击瞬间背景色 --ti-button-normal-active-background-color 改为 --ti-button-normal-active-bg-color
14
- - fix: 主题变量 token 命名变更,禁用类默认按钮背景色 --ti-button-normal-disabled-background-color 改为 --ti-button-normal-disabled-bg-color
15
- - fix: 主题变量 token 命名变更,文字按钮图标填充色 --ti-button-text-svg-fill 改为 --ti-button-text-svg-fill-color
16
- - fix: 主题变量 token 命名变更,文字按钮图标悬浮填充色 --ti-button-text-svg-hover-fill 改为 --ti-button-text-svg-hover-fill-color
17
- - fix: 主题变量 token 命名变更,文字按钮禁用时图标填充色 --ti-button-text-svg-fill-disabled 改为 --ti-button-text-svg-disabled-fill-color
18
- - fix: 主题变量 token 命名变更,分页上一页和下一页图标填充色 --ti-pager-btn-svg-color 改为 --ti-pager-btn-svg-fill-color
19
- - fix: 主题变量 token 命名变更,文字按钮禁用时图标填充色 --ti-pager-total-svg-color 改为 --ti-pager-total-svg-fill-color
20
- - fix: 主题变量 token 命名变更,IP 地址输入框图标尺寸 --ti-ip-address-icon-width 改为 --ti-ip-address-icon-size
36
+ ### Bug Fixes 🐛
37
+ * fix(numeric): 修复当前值+Step>max时不能取max的问题 by @Huangyilin19 in https://github.com/opentiny/tiny-vue/pull/297
38
+ * fix(grid): 修复了列冻结且没有滚动条时表格组件中的异常样式 by @zzcr in https://github.com/opentiny/tiny-vue/pull/298
39
+ * fix(button): 修复了朴素按钮图标禁用颜色的问题 by @gimmyhehe in https://github.com/opentiny/tiny-vue/pull/299
40
+ * fix(grid): 修复了表过滤器面板的错误样式,修复了webpack本地环境下ResizeWatch接口的警告问题 by @zzcr in https://github.com/opentiny/tiny-vue/pull/305
41
+ * fix(theme): 从容器、布局中删除样式 by @shenjunjian in https://github.com/opentiny/tiny-vue/pull/306
42
+ * fix(vue-theme): 在文本区域组件中修复 `@apply` by @shenjunjian in https://github.com/opentiny/tiny-vue/pull/319
43
+ * fix(input): 修复了禁用的输入在表单错误中不生效的问题 by @gimmyhehe in https://github.com/opentiny/tiny-vue/pull/322
44
+ * fix(checkbox): 修复了复选框标签为0时不显示错误的问题 by @gimmyhehe in https://github.com/opentiny/tiny-vue/pull/331
45
+ * fix(select): 修复了计算选择组件的高度和错误创建项目的问题 by @MomoPoppy in https://github.com/opentiny/tiny-vue/pull/358
46
+ * fix(carousel): 将箭头圆宽度调整为28px by @lyx-jay in https://github.com/opentiny/tiny-vue/pull/376
47
+ * fix(drawer): 蒙版消失的速度比内容更快 by @lyx-jay in https://github.com/opentiny/tiny-vue/pull/375
48
+ * fix(badge): 修复显示重复内容的问题 by @lyx-jay in https://github.com/opentiny/tiny-vue/pull/382
49
+ * fix: 修复了执行 pnpm build:ui vue 命令时的ts声明错误 by @kagol in https://github.com/opentiny/tiny-vue/pull/386
50
+ * fix(grid): 修复表格冻结列在x-design规范显示异常问题
51
+ * fix(grid): 修复表格冻结列在表格有纵向滚动条时
52
+ * fix(grid):修复表格fetchdata情况下,表格数据被处理两次问题
53
+ * fix(tree): 修复isEmpty属性在节点数据变化后没响应变化的问题
54
+ * fix(button-group): XDesign主题朴素按钮字体颜色修复
55
+ * fix(input): 修复input在表单禁用状态时不生效bug
56
+ * fix(popover): 避免初始加载时,触发的hide事件
57
+ * fix(dialog-box): 不在body上增加class,可以避免引起的页面抖动
58
+ * fix(tabs): 取消初始化赋值,修复超出页签栏显示问题,优化更多弹出框
59
+ * fix(icons): 优化图标部分的自定义宽度和颜色
60
+ * fix(theme): 取消主题切换后自动刷新页面
61
+ * fix(anchor): 修复锚点异步获取数据导致监听bug,增加切换动画效果
62
+ * fix(dropdown): 修复设置箭头显示不生效
63
+ * fix(select): 修复组件初始化创建条目的场景,同时设置option 和value,有匹配项却自动创建的问题
64
+ * fix(select): 修复 select 组件多选多行时input框高度计算有误的问题
65
+ * fix(popEditor): 编辑框关闭时先隐藏了内容的问题
66
+
67
+ ### Other Changes
68
+ * perf(tooltip): Tooltip 组件性能优化 by @shenjunjian in https://github.com/opentiny/tiny-vue/pull/368
69
+ * chore(row): 恢复演示示例中的样式 by @shenjunjian in https://github.com/opentiny/tiny-vue/pull/311
70
+ * feat(pnpm-lock): 添加 pnpm-lock.ymal 文件 by @zzcr in https://github.com/opentiny/tiny-vue/pull/320
71
+ * feat(button): 完善单元测试 by @chenqifeng66 in https://github.com/opentiny/tiny-vue/pull/364
72
+ * test(alert): 增加 Alert 组件单元测试 by @Zz-ZzzZ in https://github.com/opentiny/tiny-vue/pull/369
73
+ * docs(tag): 增加标签灵活用法,超出隐藏,显示title示例
21
74
 
22
75
  ## v2.9.0/v3.9.0
23
76
 
package/index.html CHANGED
@@ -11,6 +11,7 @@
11
11
  <script type="module">
12
12
  window.PUBLIC_URL = import.meta.env.BASE_URL
13
13
  window.DEPLOY_URL = ''
14
+ window.process = {env:{}}
14
15
  </script>
15
16
  </head>
16
17
 
@@ -18,35 +18,11 @@ import md_anchor from 'markdown-it-anchor'
18
18
 
19
19
  export const MdExt = [md_emoji, md_sub, md_sup, md_mark]
20
20
 
21
- // 自定义container
22
- function createContainer(klass) {
23
- return [
24
- md_container,
25
- klass,
26
- {
27
- render(tokens, idx) {
28
- const token = tokens[idx]
29
- const info = token.info.trim().slice(klass.length).trim() || ''
30
- if (token.nesting === 1) {
31
- return `<div class="${klass} custom-block"><p class="custom-block-title">${info}</p>\n`
32
- } else {
33
- return `</div>\n`
34
- }
35
- }
36
- }
37
- ]
38
- }
39
-
40
21
  export function mdInstall(md) {
41
- md.use(md_prism, { plugins: ['line-highlight'] })
42
- .use(...createContainer('tip'))
43
- .use(...createContainer('info'))
44
- .use(...createContainer('warning'))
45
- .use(...createContainer('danger'))
46
- .use(md_anchor, {
47
- permalink: true,
48
- permalinkBefore: true,
49
- permalinkSymbol: '',
50
- slugify: (s) => encodeURIComponent(s)
51
- })
22
+ md.use(md_prism, { plugins: ['line-highlight'] }).use(md_anchor, {
23
+ permalink: true,
24
+ permalinkBefore: true,
25
+ permalinkSymbol: '',
26
+ slugify: (s) => encodeURIComponent(s)
27
+ })
52
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/vue-docs",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "dependencies": {
5
5
  "@unocss/reset": "0.38.2",
6
6
  "@vue/repl": "^2.5.5",
@@ -16,15 +16,15 @@
16
16
  "@playwright/test": "^1.29.2",
17
17
  "sortablejs": "1.15.0",
18
18
  "@opentiny/vue-repl": "^1.0.2",
19
- "@opentiny/vue": "~3.10.0",
20
19
  "@opentiny/vue-common": "~3.10.0",
21
- "@opentiny/vue-design-aurora": "~3.10.0",
20
+ "@opentiny/vue": "~3.10.0",
22
21
  "@opentiny/vue-icon": "~3.10.0",
22
+ "@opentiny/vue-theme-saas": "~3.10.0",
23
+ "@opentiny/vue-design-aurora": "~3.10.0",
23
24
  "@opentiny/vue-design-smb": "~3.10.0",
24
- "@opentiny/vue-vite-import": "~1.1.5",
25
25
  "@opentiny/vue-theme": "~3.10.0",
26
26
  "@opentiny/vue-theme-mobile": "~3.10.0",
27
- "@opentiny/vue-theme-saas": "~3.10.0"
27
+ "@opentiny/vue-vite-import": "~1.1.5"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/markdown-it": "^12.2.3",
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import { reactive, ref } from 'vue'
2
+ import { onMounted, reactive, ref } from 'vue'
3
3
  import { Repl, useStore, File } from '@opentiny/vue-repl'
4
4
  import '@opentiny/vue-repl/dist/style.css'
5
5
  import Monaco from '@vue/repl/monaco-editor'
@@ -22,7 +22,8 @@ const createImportMap = (version) => {
22
22
  '@opentiny/vue': `${cdnHost}/@opentiny/vue@${version}/runtime/tiny-vue.mjs`,
23
23
  '@opentiny/vue-icon': `${cdnHost}/@opentiny/vue@${version}/runtime/tiny-vue-icon.mjs`,
24
24
  '@opentiny/vue-locale': `${cdnHost}/@opentiny/vue@${version}/runtime/tiny-vue-locale.mjs`,
25
- '@opentiny/vue-common': `${cdnHost}/@opentiny/vue@${version}/runtime/tiny-vue-common.mjs`
25
+ '@opentiny/vue-common': `${cdnHost}/@opentiny/vue@${version}/runtime/tiny-vue-common.mjs`,
26
+ 'sortablejs': `${cdnHost}/sortablejs@1.15.0/modular/sortable.esm.js`
26
27
  }
27
28
  }
28
29
  }
@@ -63,19 +64,18 @@ const state = reactive({
63
64
 
64
65
  function versionChange(version) {
65
66
  const importMap = createImportMap(version)
66
- store.setImportMap(importMap)
67
+ store.state.files['import-map.json'] = new File('', JSON.stringify(importMap))
67
68
 
68
- const iframeWin = document.querySelector('iframe').contentWindow
69
- const styleDom = iframeWin.document.getElementById('tiny-theme')
70
- if (styleDom) {
71
- styleDom.href = `${cdnHost}/@opentiny/vue-theme@${version}/index.css`
72
- } else {
69
+ setTimeout(() => {
70
+ if (!document.querySelector('iframe')) return
71
+
72
+ const iframeWin = document.querySelector('iframe').contentWindow
73
73
  const link = iframeWin.document.createElement('link')
74
74
  link.id = 'tiny-theme'
75
75
  link.rel = 'stylesheet'
76
76
  link.href = `${cdnHost}/@opentiny/vue-theme@${version}/index.css`
77
77
  iframeWin.document.head.append(link)
78
- }
78
+ }, 300)
79
79
  }
80
80
 
81
81
  function getDemoName(name, apiMode) {
@@ -89,7 +89,7 @@ const getDemoCode = async ({ cmpId, fileName, apiMode }) => {
89
89
  .then((code) => {
90
90
  return code
91
91
  })
92
- .catch((error) => {
92
+ .catch(() => {
93
93
  return `${demoName}示例资源不存在,请检查文件名是否正确?`
94
94
  })
95
95
 
@@ -104,23 +104,25 @@ const loadFileCode = async ({ cmpId, fileName, apiMode }) => {
104
104
  versionChange(latestVersion)
105
105
  }
106
106
 
107
- // 初始加载,有分享则加载分享,否则加载默认版本的默认文件
108
- if (shareData.length === 2) {
109
- versionChange(shareData[0])
110
- } else {
111
- const searchObj = new URLSearchParams(location.search)
112
- const fileName = searchObj.get('fileName')
113
- const cmpId = searchObj.get('cmpId')
114
- const apiMode = searchObj.get('apiMode')
115
- if (fileName && cmpId && apiMode) {
116
- loadFileCode({ cmpId, fileName, apiMode })
107
+ onMounted(() => {
108
+ // 初始加载,有分享则加载分享,否则加载默认版本的默认文件
109
+ if (shareData.length === 2) {
110
+ versionChange(shareData[0])
111
+ } else {
112
+ const searchObj = new URLSearchParams(location.search)
113
+ const fileName = searchObj.get('fileName')
114
+ const cmpId = searchObj.get('cmpId')
115
+ const apiMode = searchObj.get('apiMode')
116
+ if (fileName && cmpId && apiMode) {
117
+ loadFileCode({ cmpId, fileName, apiMode })
118
+ }
117
119
  }
118
- }
120
+ })
119
121
 
120
122
  // 分享功能
121
123
  function share() {
122
- const hash = store.serialize().slice(1)
123
- const shareUrl = location.origin + '/tiny-vue/playground.html#' + state.selectVersion + '|' + hash
124
+ const hash = store.serialize()
125
+ const shareUrl = location.origin + '/tiny-vue/playground#' + state.selectVersion + '|' + hash
124
126
 
125
127
  navigator.clipboard.writeText(shareUrl)
126
128
  Notify({
@@ -59,7 +59,7 @@
59
59
  <tbody>
60
60
  <tr v-for="row in oneApiArr" :key="row.name">
61
61
  <td>
62
- <a v-if="row.demoId" :href="`#${row.demoId}`">{{ row.name }}</a>
62
+ <a v-if="row.demoId" @click="jumpToDemo(row.demoId)">{{ row.name }}</a>
63
63
  <span v-else>{{ row.name }}</span>
64
64
  </td>
65
65
  <td v-if="!key.includes('slots')"><span class="route-anchor" v-html="row.type"></span></td>
@@ -254,6 +254,13 @@ const handleApiAnchor = (ev) => {
254
254
  const fn = {
255
255
  copyText: (text) => {
256
256
  navigator.clipboard.writeText(text)
257
+ },
258
+ jumpToDemo: (demoId) => {
259
+ if (demoId.startsWith('chart') || demoId.startsWith('grid')) {
260
+ router.push(demoId)
261
+ } else {
262
+ router.push(`#${demoId}`)
263
+ }
257
264
  }
258
265
  }
259
266
 
package/vite.config.js CHANGED
@@ -51,9 +51,6 @@ export default defineConfig((config) => {
51
51
  }),
52
52
  Unocss(UnoCssConfig)
53
53
  ],
54
- define: {
55
- 'process.env': {}
56
- },
57
54
  optimizeDeps: getOptimizeDeps(3),
58
55
  build: {
59
56
  rollupOptions: {