@opentiny/vue-docs 2.2.2 → 2.2.4

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 (58) hide show
  1. package/demos/pc/app/anchor/change.spec.ts +1 -2
  2. package/demos/pc/app/anchor/is-affix.spec.ts +4 -3
  3. package/demos/pc/app/anchor/set-container.spec.ts +7 -7
  4. package/demos/pc/app/anchor/webdoc/anchor.js +17 -16
  5. package/demos/pc/app/button/basic-usage-composition-api.vue +1 -1
  6. package/demos/pc/app/button/basic-usage.vue +1 -1
  7. package/demos/pc/app/button/dynamic-disabled-composition-api.vue +0 -1
  8. package/demos/pc/app/button/dynamic-disabled.spec.js +3 -0
  9. package/demos/pc/app/button/dynamic-disabled.vue +0 -1
  10. package/demos/pc/app/button/icon-composition-api.vue +2 -1
  11. package/demos/pc/app/button/icon.vue +2 -1
  12. package/demos/pc/app/credit-card-form/webdoc/credit-card-form.js +4 -0
  13. package/demos/pc/app/grid/data-source/static-data-composition-api.vue +1 -1
  14. package/demos/pc/app/grid/expand/expand-config-composition-api.vue +1 -1
  15. package/demos/pc/app/grid/filter/simple-date-filter.spec.ts +2 -20
  16. package/demos/pc/app/grid/operation-column/selection-config-composition-api.vue +1 -1
  17. package/demos/pc/app/grid/operation-column/selection-config.vue +2 -3
  18. package/demos/pc/app/grid/slot/editor-slot-composition-api.vue +1 -1
  19. package/demos/pc/app/grid/slot/header-slot-composition-api.vue +4 -1
  20. package/demos/pc/app/grid/slot/header-slot.vue +2 -1
  21. package/demos/pc/app/icon/basic-usage.spec.js +8 -1
  22. package/demos/pc/app/icon/iconGroups.js +195 -195
  23. package/demos/pc/app/icon/list.spec.js +10 -5
  24. package/demos/pc/app/icon/show-title.spec.ts +8 -0
  25. package/demos/pc/app/layout/gutter-composition-api.vue +11 -0
  26. package/demos/pc/app/layout/gutter.spec.ts +3 -0
  27. package/demos/pc/app/layout/gutter.vue +11 -0
  28. package/demos/pc/app/layout/webdoc/layout.js +14 -3
  29. package/demos/pc/app/qr-code/webdoc/qr-code.js +6 -0
  30. package/demos/pc/app/rich-text-editor/webdoc/rich-text-editor.js +3 -0
  31. package/demos/pc/app/select/copy-multi.spec.ts +15 -6
  32. package/demos/pc/app/select/is-drop-inherit-width.spec.ts +2 -3
  33. package/demos/pc/app/select/nest-grid-composition-api.vue +3 -1
  34. package/demos/pc/app/select/optimization.spec.ts +1 -0
  35. package/demos/pc/app/slide-bar/webdoc/slide-bar.js +4 -0
  36. package/demos/pc/app/tabs/tabs-draggable.spec.ts +8 -8
  37. package/demos/pc/app/tag/closable.spec.ts +1 -1
  38. package/demos/pc/app/tag/color3.spec.ts +1 -1
  39. package/demos/pc/app/tag/content.spec.ts +2 -2
  40. package/demos/pc/app/tag/create.spec.ts +3 -3
  41. package/demos/pc/app/tag/disabled.spec.ts +1 -1
  42. package/demos/pc/app/tag/effect.spec.ts +4 -3
  43. package/demos/pc/app/watermark/webdoc/watermark.js +6 -0
  44. package/demos/pc/app/wizard/btn-events-composition-api.vue +5 -5
  45. package/demos/pc/app/wizard/btn-events.spec.ts +63 -0
  46. package/demos/pc/app/wizard/btn-events.vue +5 -5
  47. package/demos/pc/app/wizard/page-guide.spec.ts +6 -6
  48. package/demos/pc/app/wizard/slot-step-button.spec.ts +1 -1
  49. package/demos/pc/app/wizard/time-line-flow.spec.ts +5 -5
  50. package/demos/pc/menus.js +43 -5
  51. package/demos/pc/webdoc/changelog.md +521 -305
  52. package/demos/pc/webdoc/installation-en.md +11 -6
  53. package/demos/pc/webdoc/installation.md +14 -8
  54. package/package.json +6 -6
  55. package/playground/App.vue +2 -2
  56. package/src/App.vue +2 -0
  57. package/src/tools/useBulletin.jsx +43 -0
  58. package/src/views/components/VersionTip.vue +9 -2
@@ -47,9 +47,14 @@ export default defineConfig({
47
47
  })
48
48
  ```
49
49
 
50
+ <div class="tip custom-block">
51
+ <br>
52
+ <p> To avoid the uncertainty associated with monthly (minor) upgrades of <code> @opentiny/vue </code>, it is recommended to use ~ before relying on the version number of the package in <code> package.json </code> in your project.
53
+ For example, <code>"@opentiny/vue": "~3.12.0</code>. </p>
54
+ </div>
50
55
  ### Import through CDN
51
56
 
52
- In order to experience TinyVue components faster, you can also import TinyVue directly into the HTML page through CDN.
57
+ In order to experience TinyVue components faster, you can also import TinyVue directly into the HTML page through CDN,you are advised to write two valid version numbers as follows.
53
58
 
54
59
  ```html
55
60
  <head>
@@ -57,11 +62,11 @@ In order to experience TinyVue components faster, you can also import TinyVue di
57
62
  <script type="importmap">
58
63
  {
59
64
  "imports": {
60
- "vue": "https://unpkg.com/vue@3.2.45/dist/vue.esm-browser.js",
61
- "@opentiny/vue": "https://unpkg.com/@opentiny/vue@3.9.1/runtime/tiny-vue.mjs",
62
- "@opentiny/vue-common": "https://unpkg.com/@opentiny/vue@3.9.1/runtime/tiny-vue-common.mjs",
63
- "@opentiny/vue-icon": "https://unpkg.com/@opentiny/vue@3.9.1/runtime/tiny-vue-icon.mjs",
64
- "@opentiny/vue-locale": "https://unpkg.com/@opentiny/vue@3.9.1/runtime/tiny-vue-locale.mjs"
65
+ "vue": "https://unpkg.com/vue@3.3/dist/vue.esm-browser.js",
66
+ "@opentiny/vue": "https://unpkg.com/@opentiny/vue@3.12/runtime/tiny-vue.mjs",
67
+ "@opentiny/vue-common": "https://unpkg.com/@opentiny/vue@3.12/runtime/tiny-vue-common.mjs",
68
+ "@opentiny/vue-icon": "https://unpkg.com/@opentiny/vue@3.12/runtime/tiny-vue-icon.mjs",
69
+ "@opentiny/vue-locale": "https://unpkg.com/@opentiny/vue@3.12/runtime/tiny-vue-locale.mjs"
65
70
  }
66
71
  }
67
72
  </script>
@@ -9,9 +9,9 @@
9
9
  | Vue2.x | @opentiny/vue@2.x |
10
10
  | Vue3.x | @opentiny/vue@3.x |
11
11
 
12
- **Vue2工程说明**
12
+ **Vue2 工程说明**
13
13
 
14
- 长期以来,TinyVue 都是只支持 Vue 2.6.14 版本。 从 TinyVue 2.11.0 开始,也支持 Vue 2.7+的工程了,请确保你安装了正确的Vue 2.x的依赖。
14
+ 长期以来,TinyVue 都是只支持 Vue 2.6.14 版本。 从 TinyVue 2.11.0 开始,也支持 Vue 2.7+的工程了,请确保你安装了正确的 Vue 2.x 的依赖。
15
15
 
16
16
  ### 全新项目配置
17
17
 
@@ -47,9 +47,15 @@ export default defineConfig({
47
47
  })
48
48
  ```
49
49
 
50
+ <div class="tip custom-block">
51
+ <br>
52
+ <p>为了避免<code> @opentiny/vue </code> 的月度版本(minor)升级带来的不确定因素,因此推荐在您的工程中的<code> package.json </code> 中依赖包的版本号前使用 ~,
53
+ 比如 <code>"@opentiny/vue": "~3.12.0</code>。</p>
54
+ </div>
55
+
50
56
  ### 通过 CDN 方式引入
51
57
 
52
- 为了更快地体验 TinyVue 的组件,你也可以通过 CDN 方式直接在 HTML 页面中引入 TinyVue
58
+ 为了更快地体验 TinyVue 的组件,你也可以通过 CDN 方式直接在 HTML 页面中引入 TinyVue, 建议版本号写 2 个有效版本数字即可,具体配置如下:
53
59
 
54
60
  ```html
55
61
  <head>
@@ -57,11 +63,11 @@ export default defineConfig({
57
63
  <script type="importmap">
58
64
  {
59
65
  "imports": {
60
- "vue": "https://unpkg.com/vue@3.2.45/dist/vue.esm-browser.js",
61
- "@opentiny/vue": "https://unpkg.com/@opentiny/vue@3.9.1/runtime/tiny-vue.mjs",
62
- "@opentiny/vue-common": "https://unpkg.com/@opentiny/vue@3.9.1/runtime/tiny-vue-common.mjs",
63
- "@opentiny/vue-icon": "https://unpkg.com/@opentiny/vue@3.9.1/runtime/tiny-vue-icon.mjs",
64
- "@opentiny/vue-locale": "https://unpkg.com/@opentiny/vue@3.9.1/runtime/tiny-vue-locale.mjs"
66
+ "vue": "https://unpkg.com/vue@3.3/dist/vue.esm-browser.js",
67
+ "@opentiny/vue": "https://unpkg.com/@opentiny/vue@3.12/runtime/tiny-vue.mjs",
68
+ "@opentiny/vue-common": "https://unpkg.com/@opentiny/vue@3.12/runtime/tiny-vue-common.mjs",
69
+ "@opentiny/vue-icon": "https://unpkg.com/@opentiny/vue@3.12/runtime/tiny-vue-icon.mjs",
70
+ "@opentiny/vue-locale": "https://unpkg.com/@opentiny/vue@3.12/runtime/tiny-vue-locale.mjs"
65
71
  }
66
72
  }
67
73
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/vue-docs",
3
- "version": "2.2.2",
3
+ "version": "2.2.4",
4
4
  "dependencies": {
5
5
  "@unocss/reset": "0.38.2",
6
6
  "@vue/repl": "^2.5.5",
@@ -17,15 +17,15 @@
17
17
  "sortablejs": "1.15.0",
18
18
  "@opentiny/vue-repl": "^1.1.0",
19
19
  "@opentiny/vue": "~3.12.0",
20
- "@opentiny/vue-common": "~3.12.0",
21
20
  "@opentiny/vue-icon": "~3.12.0",
22
- "@opentiny/vue-design-aurora": "~3.12.0",
23
- "@opentiny/vue-theme": "~3.12.0",
21
+ "@opentiny/vue-common": "~3.12.0",
22
+ "@opentiny/vue-icon-saas": "~3.12.0",
23
+ "@opentiny/vue-theme-mobile": "~3.12.0",
24
24
  "@opentiny/vue-design-smb": "~3.12.0",
25
+ "@opentiny/vue-design-aurora": "~3.12.0",
25
26
  "@opentiny/vue-vite-import": "~1.1.5",
26
- "@opentiny/vue-icon-saas": "~3.12.0",
27
27
  "@opentiny/vue-theme-saas": "~3.12.0",
28
- "@opentiny/vue-theme-mobile": "~3.12.0"
28
+ "@opentiny/vue-theme": "~3.12.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/markdown-it": "^12.2.3",
@@ -17,11 +17,11 @@ import logoUrl from './assets/opentiny-logo.svg?url'
17
17
  import GitHub from './icons/Github.vue'
18
18
  import Share from './icons/Share.vue'
19
19
 
20
- const VERSION = 'tiny-vue-version'
20
+ const VERSION = 'tiny-vue-version-3.12'
21
21
  const LAYOUT = 'playground-layout'
22
22
  const LAYOUT_REVERSE = 'playground-layout-reverse'
23
23
 
24
- const versions = ['3.11', '3.10', '3.9', '3.8']
24
+ const versions = ['3.12', '3.11', '3.10', '3.9', '3.8']
25
25
  const latestVersion = localStorage.getItem(VERSION) || versions[0]
26
26
  const cdnHost = localStorage.getItem('setting-cdn')
27
27
  const getRuntime = (version) => `${cdnHost}/@opentiny/vue@${version}/runtime/`
package/src/App.vue CHANGED
@@ -16,6 +16,7 @@ import { ConfigProvider, Modal } from '@opentiny/vue'
16
16
  import { iconClose } from '@opentiny/vue-icon'
17
17
  import { appData } from './tools'
18
18
  import useTheme from './tools/useTheme'
19
+ import { useBulletin } from './tools/useBulletin.jsx'
19
20
 
20
21
  export default defineComponent({
21
22
  name: 'AppVue',
@@ -42,6 +43,7 @@ export default defineComponent({
42
43
  common.renderHeader()
43
44
  })
44
45
  const { designConfig } = useTheme()
46
+ useBulletin()
45
47
 
46
48
  provide('showPreview', (url) => {
47
49
  previewUrl.value = url
@@ -0,0 +1,43 @@
1
+ import { $local } from './storage'
2
+ import { onMounted } from 'vue'
3
+ import { Modal } from '@opentiny/vue'
4
+
5
+ const bulletins = [
6
+ {
7
+ id: 'version-tip',
8
+ content: `为了避免 @opentiny/vue 的月度版本(minor)升级带来的不确定因素,所以推荐在您的工程中的 package.json 中依赖包的版本号前使用 ~,
9
+ 比如 "@opentiny/vue": "~3.12.0。`,
10
+ time: '2023-12-04'
11
+ }
12
+ ]
13
+ const bulletinKey = 'openttiny-last-bulletin'
14
+ /**
15
+ * 公告通知管理
16
+ * 1、记录历史所有的公告,以备记录,每次只显示第一条公告即可!
17
+ * 2、用户点击确认之后,不再弹出该公告
18
+ */
19
+ export function useBulletin() {
20
+ const lastBulletin = bulletins[0]
21
+ if (lastBulletin.id !== $local[bulletinKey]) {
22
+ onMounted(() => {
23
+ Modal.confirm({
24
+ title: '公告',
25
+ message: (<div style="font-size:16px;line-height:1.5;">
26
+ <div>尊敬的 TinyVue 用户:</div>
27
+ <p style="text-indent: 2em;" v-html={lastBulletin.content}>
28
+ </p>
29
+ <div style="text-align:right;margin-top:20px">TinyVue 团队</div>
30
+ <div style="text-align:right;">{ lastBulletin.time }</div>
31
+ </div>),
32
+ status: null,
33
+ width:'760',
34
+ confirmContent: '我知道了',
35
+ cancelContent: '关闭'
36
+ }).then((res) => {
37
+ if (res === 'confirm') {
38
+ $local[bulletinKey] = lastBulletin.id
39
+ }
40
+ })
41
+ })
42
+ }
43
+ }
@@ -136,11 +136,14 @@ export default defineComponent({
136
136
  return props.briefStage
137
137
  }
138
138
 
139
- return [STAGE.deprecated, STAGE.experimental].find(isInStage)
139
+ return [STAGE.removed, STAGE.deprecated, STAGE.stable, STAGE.experimental].find(isInStage)
140
140
  })
141
141
 
142
142
  const generateDes = (desMap: typeof cnDesMap) => {
143
- const isFilterExperimental = isInStage(STAGE.deprecated) || isInStage(STAGE.stable)
143
+ // 当前stable之后,不显示experimental的描述
144
+ const isFilterExperimental = [STAGE.removed, STAGE.deprecated, STAGE.stable].includes(currentStageComputed.value as STAGE)
145
+ // 当前deprecated之后,不显示stable的描述
146
+ const isFilterStable = [STAGE.removed, STAGE.deprecated].includes(currentStageComputed.value as STAGE)
144
147
 
145
148
  const goingStages = Object.entries(desMap).filter(([stage]) => {
146
149
  let isPicked = isInStage(stage as STAGE)
@@ -149,6 +152,10 @@ export default defineComponent({
149
152
  isPicked = isPicked && !isFilterExperimental
150
153
  }
151
154
 
155
+ if (stage === STAGE.stable) {
156
+ isPicked = isPicked && !isFilterStable
157
+ }
158
+
152
159
  return isPicked
153
160
  })
154
161