@opentiny/vue-docs 3.26.7 → 3.27.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 (169) hide show
  1. package/demos/apis/base-select.js +13 -0
  2. package/demos/apis/calendar-view.js +12 -0
  3. package/demos/apis/color-picker.js +16 -0
  4. package/demos/apis/color-select-panel.js +14 -0
  5. package/demos/apis/config-provider.js +2 -1
  6. package/demos/apis/date-picker.js +52 -0
  7. package/demos/apis/dialog-box.js +16 -4
  8. package/demos/apis/drawer.js +22 -0
  9. package/demos/apis/exception.js +43 -27
  10. package/demos/apis/grid.js +38 -3
  11. package/demos/apis/guide.js +14 -0
  12. package/demos/apis/pager.js +3 -3
  13. package/demos/apis/query-builder.js +346 -1
  14. package/demos/apis/select.js +41 -0
  15. package/demos/apis/space.js +99 -0
  16. package/demos/apis/steps.js +15 -0
  17. package/demos/apis/time-picker.js +28 -0
  18. package/demos/apis/time-select.js +30 -0
  19. package/demos/apis/tree-menu.js +14 -0
  20. package/demos/mobile-first/app/calendar-view/basic-usage.vue +1 -1
  21. package/demos/mobile-first/app/exception/webdoc/exception.js +4 -4
  22. package/demos/mobile-first/app/load-list/webdoc/load-list.en.md +1 -1
  23. package/demos/mobile-first/app/space/basic-usage-composition-api.vue +41 -0
  24. package/demos/mobile-first/app/space/basic-usage.spec.ts +37 -0
  25. package/demos/mobile-first/app/space/basic-usage.vue +37 -0
  26. package/demos/mobile-first/app/space/space-align-composition-api.vue +37 -0
  27. package/demos/mobile-first/app/space/space-align.spec.ts +24 -0
  28. package/demos/mobile-first/app/space/space-align.vue +37 -0
  29. package/demos/mobile-first/app/space/space-direction-composition-api.vue +32 -0
  30. package/demos/mobile-first/app/space/space-direction.spec.ts +17 -0
  31. package/demos/mobile-first/app/space/space-direction.vue +32 -0
  32. package/demos/mobile-first/app/space/space-justify-composition-api.vue +44 -0
  33. package/demos/mobile-first/app/space/space-justify.spec.ts +18 -0
  34. package/demos/mobile-first/app/space/space-justify.vue +39 -0
  35. package/demos/mobile-first/app/space/space-order-composition-api.vue +14 -0
  36. package/demos/mobile-first/app/space/space-order.spec.ts +13 -0
  37. package/demos/mobile-first/app/space/space-order.vue +14 -0
  38. package/demos/mobile-first/app/space/space-size-composition-api.vue +39 -0
  39. package/demos/mobile-first/app/space/space-size.spec.ts +37 -0
  40. package/demos/mobile-first/app/space/space-size.vue +39 -0
  41. package/demos/mobile-first/app/space/space-wrap-composition-api.vue +31 -0
  42. package/demos/mobile-first/app/space/space-wrap.spec.ts +25 -0
  43. package/demos/mobile-first/app/space/space-wrap.vue +31 -0
  44. package/demos/mobile-first/app/space/webdoc/space.cn.md +9 -0
  45. package/demos/mobile-first/app/space/webdoc/space.en.md +9 -0
  46. package/demos/mobile-first/app/space/webdoc/space.js +98 -0
  47. package/demos/mobile-first/menus.js +3 -1
  48. package/demos/pc/app/calendar-view/basic-usage-composition-api.vue +1 -1
  49. package/demos/pc/app/calendar-view/basic-usage.vue +1 -1
  50. package/demos/pc/app/carousel/webdoc/carousel.js +2 -1
  51. package/demos/pc/app/color-picker/linear-gradient-composition-api.vue +20 -0
  52. package/demos/pc/app/color-picker/linear-gradient.spec.ts +10 -0
  53. package/demos/pc/app/color-picker/linear-gradient.vue +28 -0
  54. package/demos/pc/app/color-picker/webdoc/color-picker.js +27 -0
  55. package/demos/pc/app/color-select-panel/linear-gradient-composition-api.vue +38 -0
  56. package/demos/pc/app/color-select-panel/linear-gradient.spec.ts +71 -0
  57. package/demos/pc/app/color-select-panel/linear-gradient.vue +45 -0
  58. package/demos/pc/app/color-select-panel/webdoc/color-select-panel.js +12 -0
  59. package/demos/pc/app/config-provider/webdoc/config-provider.js +2 -1
  60. package/demos/pc/app/date-panel/basic-usage.vue +19 -8
  61. package/demos/pc/app/date-panel/custom-weeks.vue +19 -9
  62. package/demos/pc/app/date-panel/disabled-date.vue +29 -19
  63. package/demos/pc/app/date-panel/event.vue +38 -31
  64. package/demos/pc/app/date-panel/format.vue +15 -5
  65. package/demos/pc/app/date-panel/readonly.vue +19 -8
  66. package/demos/pc/app/date-panel/shortcuts.vue +182 -176
  67. package/demos/pc/app/date-panel/unlink-panels.vue +15 -5
  68. package/demos/pc/app/date-picker/now-composition-api.vue +4 -1
  69. package/demos/pc/app/date-picker/now.vue +6 -2
  70. package/demos/pc/app/date-picker/slot-composition-api.vue +112 -0
  71. package/demos/pc/app/date-picker/slot.spec.ts +41 -0
  72. package/demos/pc/app/date-picker/slot.vue +119 -0
  73. package/demos/pc/app/date-picker/webdoc/date-picker.js +12 -0
  74. package/demos/pc/app/dialog-box/before-close-composition-api.vue +65 -0
  75. package/demos/pc/app/dialog-box/before-close.spec.ts +6 -0
  76. package/demos/pc/app/dialog-box/before-close.vue +71 -0
  77. package/demos/pc/app/dialog-box/webdoc/dialog-box.js +16 -0
  78. package/demos/pc/app/dialog-select/nest-tree-single.spec.ts +4 -7
  79. package/demos/pc/app/drawer/webdoc/drawer.js +2 -1
  80. package/demos/pc/app/exception/basic-usage-composition-api.vue +15 -0
  81. package/demos/pc/app/exception/basic-usage.vue +21 -0
  82. package/demos/pc/app/exception/button-text-composition-api.vue +13 -0
  83. package/demos/pc/app/exception/button-text.vue +21 -0
  84. package/demos/pc/app/exception/component-page-composition-api.vue +44 -0
  85. package/demos/pc/app/exception/component-page.vue +55 -0
  86. package/demos/pc/app/exception/page-empty-composition-api.vue +7 -0
  87. package/demos/pc/app/exception/page-empty.vue +13 -0
  88. package/demos/pc/app/exception/slot-composition-api.vue +29 -0
  89. package/demos/pc/app/exception/slot.vue +23 -0
  90. package/demos/pc/app/exception/sub-message-composition-api.vue +7 -0
  91. package/demos/pc/app/exception/sub-message.vue +13 -0
  92. package/demos/pc/app/exception/webdoc/exception.cn.md +5 -0
  93. package/demos/pc/app/exception/webdoc/exception.en.md +5 -0
  94. package/demos/pc/app/exception/webdoc/exception.js +84 -0
  95. package/demos/pc/app/grid/custom/default-customs-composition-api.vue +66 -0
  96. package/demos/pc/app/grid/custom/default-customs.spec.ts +9 -0
  97. package/demos/pc/app/grid/custom/default-customs.vue +75 -0
  98. package/demos/pc/app/grid/mouse-keyboard/mouse-config-hover-composition-api.vue +70 -0
  99. package/demos/pc/app/grid/mouse-keyboard/mouse-config-hover.vue +79 -0
  100. package/demos/pc/app/grid/validation/highlight-error-composition-api.vue +183 -0
  101. package/demos/pc/app/grid/validation/highlight-error.vue +192 -0
  102. package/demos/pc/app/grid/webdoc/grid-custom.js +11 -0
  103. package/demos/pc/app/grid/webdoc/grid-editor.js +2 -2
  104. package/demos/pc/app/grid/webdoc/grid-mouse-keyboard.js +9 -0
  105. package/demos/pc/app/grid/webdoc/grid-validation.js +9 -0
  106. package/demos/pc/app/guide/mask-composition-api.vue +31 -0
  107. package/demos/pc/app/guide/mask.spec.ts +13 -0
  108. package/demos/pc/app/guide/mask.vue +41 -0
  109. package/demos/pc/app/guide/webdoc/guide.js +12 -0
  110. package/demos/pc/app/input/resize.spec.ts +1 -1
  111. package/demos/pc/app/notify/manual-close-composition-api.vue +9 -11
  112. package/demos/pc/app/notify/manual-close.spec.ts +1 -1
  113. package/demos/pc/app/notify/manual-close.vue +9 -11
  114. package/demos/pc/app/notify/verticalOffset.spec.ts +3 -1
  115. package/demos/pc/app/query-builder/handle.vue +558 -0
  116. package/demos/pc/app/query-builder/limit.vue +555 -0
  117. package/demos/pc/app/query-builder/webdoc/query-builder.js +29 -1
  118. package/demos/pc/app/radio/dynamic-disable.vue +1 -1
  119. package/demos/pc/app/space/basic-usage-composition-api.vue +41 -0
  120. package/demos/pc/app/space/basic-usage.spec.ts +37 -0
  121. package/demos/pc/app/space/basic-usage.vue +37 -0
  122. package/demos/pc/app/space/space-align-composition-api.vue +37 -0
  123. package/demos/pc/app/space/space-align.spec.ts +24 -0
  124. package/demos/pc/app/space/space-align.vue +37 -0
  125. package/demos/pc/app/space/space-direction-composition-api.vue +32 -0
  126. package/demos/pc/app/space/space-direction.spec.ts +17 -0
  127. package/demos/pc/app/space/space-direction.vue +32 -0
  128. package/demos/pc/app/space/space-justify-composition-api.vue +44 -0
  129. package/demos/pc/app/space/space-justify.spec.ts +18 -0
  130. package/demos/pc/app/space/space-justify.vue +39 -0
  131. package/demos/pc/app/space/space-order-composition-api.vue +14 -0
  132. package/demos/pc/app/space/space-order.spec.ts +13 -0
  133. package/demos/pc/app/space/space-order.vue +14 -0
  134. package/demos/pc/app/space/space-size-composition-api.vue +39 -0
  135. package/demos/pc/app/space/space-size.spec.ts +37 -0
  136. package/demos/pc/app/space/space-size.vue +39 -0
  137. package/demos/pc/app/space/space-wrap-composition-api.vue +31 -0
  138. package/demos/pc/app/space/space-wrap.spec.ts +25 -0
  139. package/demos/pc/app/space/space-wrap.vue +31 -0
  140. package/demos/pc/app/space/webdoc/space.cn.md +9 -0
  141. package/demos/pc/app/space/webdoc/space.en.md +9 -0
  142. package/demos/pc/app/space/webdoc/space.js +98 -0
  143. package/demos/pc/app/steps/slot-icon-composition-api.vue +46 -0
  144. package/demos/pc/app/steps/slot-icon.vue +54 -0
  145. package/demos/pc/app/steps/webdoc/steps.js +12 -0
  146. package/demos/pc/app/tree-menu/events-composition-api.vue +4 -0
  147. package/demos/pc/app/tree-menu/events.vue +4 -0
  148. package/demos/pc/app/tree-menu/webdoc/tree-menu.js +2 -2
  149. package/demos/pc/app/tree-menu/with-icon-composition-api.vue +149 -24
  150. package/demos/pc/app/tree-menu/with-icon.spec.ts +1 -1
  151. package/demos/pc/app/tree-menu/with-icon.vue +149 -24
  152. package/demos/pc/menus.js +16 -0
  153. package/demos/pc/webdoc/changelog.md +209 -177
  154. package/env/.env.saas +1 -1
  155. package/env/.env.saaspages +9 -0
  156. package/package.json +20 -19
  157. package/playground/App.vue +2 -2
  158. package/src/App.vue +2 -1
  159. package/src/components/anchor.vue +20 -74
  160. package/src/const.ts +2 -0
  161. package/src/main.js +2 -5
  162. package/src/menus.js +2 -1
  163. package/src/tools/docsearch.js +3 -2
  164. package/src/tools/useTemplateMode.js +2 -1
  165. package/src/tools/useTheme.js +2 -2
  166. package/src/views/components-doc/cmp-config.js +2 -1
  167. package/src/views/components-doc/common.vue +76 -12
  168. /package/demos/pc/app/user/{nodata-text-composition-api.vue → no-data-text-composition-api.vue} +0 -0
  169. /package/demos/pc/app/user/{nodata-text.vue → no-data-text.vue} +0 -0
@@ -0,0 +1,9 @@
1
+ # 1、声明一个变量
2
+ VITE_CONTEXT=/tiny-vue-saas-web-doc/
3
+ VITE_BUILD_TARGET='inner'
4
+ VITE_TINY_THEME='saas'
5
+ # 官网应用类型:pc / mobile / mobile-first
6
+ VITE_APP_MODE='pc'
7
+
8
+ VITE_APP_BUILD_BASE_URL='/tiny-vue-saas-web-doc/'
9
+ VITE_PLAYGROUND_URL=/playground.html
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@opentiny/vue-docs",
3
3
  "type": "module",
4
- "version": "3.26.7",
4
+ "version": "3.27.0",
5
5
  "license": "MIT",
6
6
  "dependencies": {
7
7
  "@docsearch/css": "^3.8.0",
@@ -27,24 +27,24 @@
27
27
  "vue-i18n": "~9.14.3",
28
28
  "vue-router": "4.1.5",
29
29
  "zod": "^3.24.4",
30
- "@opentiny/utils": "~3.26.0",
31
- "@opentiny/vue": "~3.26.0",
32
- "@opentiny/vue-common": "~3.26.0",
33
- "@opentiny/vue-design-aurora": "~3.26.0",
34
- "@opentiny/vue-design-saas": "~3.26.0",
35
- "@opentiny/vue-design-smb": "~3.26.0",
36
- "@opentiny/vue-directive": "~3.26.0",
37
- "@opentiny/vue-hooks": "~3.26.0",
38
- "@opentiny/vue-flowchart": "~3.26.0",
39
- "@opentiny/vue-huicharts": "~3.26.0",
40
- "@opentiny/vue-icon-multicolor": "~3.26.0",
41
- "@opentiny/vue-icon": "~3.26.0",
42
- "@opentiny/vue-locale": "~3.26.0",
43
- "@opentiny/vue-icon-saas": "~3.26.0",
44
- "@opentiny/vue-modal": "~3.26.0",
45
- "@opentiny/vue-renderless": "~3.26.0",
46
- "@opentiny/vue-theme": "~3.26.0",
47
- "@opentiny/vue-theme-saas": "~3.26.2"
30
+ "@opentiny/utils": "~3.27.0",
31
+ "@opentiny/vue-common": "~3.27.0",
32
+ "@opentiny/vue": "~3.27.0",
33
+ "@opentiny/vue-design-aurora": "~3.27.0",
34
+ "@opentiny/vue-design-saas": "~3.27.0",
35
+ "@opentiny/vue-design-smb": "~3.27.0",
36
+ "@opentiny/vue-directive": "~3.27.0",
37
+ "@opentiny/vue-flowchart": "~3.27.0",
38
+ "@opentiny/vue-hooks": "~3.27.0",
39
+ "@opentiny/vue-huicharts": "~3.27.0",
40
+ "@opentiny/vue-icon-multicolor": "~3.27.0",
41
+ "@opentiny/vue-locale": "~3.27.0",
42
+ "@opentiny/vue-icon-saas": "~3.27.0",
43
+ "@opentiny/vue-icon": "~3.27.0",
44
+ "@opentiny/vue-modal": "~3.27.0",
45
+ "@opentiny/vue-renderless": "~3.27.0",
46
+ "@opentiny/vue-theme": "~3.27.0",
47
+ "@opentiny/vue-theme-saas": "~3.27.0"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@playwright/test": "~1.49.0",
@@ -99,6 +99,7 @@
99
99
  "build:saas:open": "vite build --mode saasopen",
100
100
  "build:saas:prod": "vite build --mode saasprod",
101
101
  "build": "vite build --mode pages && cp cp-component-md.sh ./dist",
102
+ "build:saas": "vite build --mode saaspages && cp cp-component-md.sh ./dist",
102
103
  "build:mobile:page": "vite build --mode mobilepages && cp cp-component-md.sh ./dist",
103
104
  "build:visualizer": "vite build --mode visualizer",
104
105
  "build:open": "vite build --mode open",
@@ -11,7 +11,7 @@ import logoUrl from './assets/opentiny-logo.svg?url'
11
11
  import GitHub from './icons/Github.vue'
12
12
  import Share from './icons/Share.vue'
13
13
 
14
- const VERSION = 'tiny-vue-version-3.26'
14
+ const VERSION = 'tiny-vue-version-3.27'
15
15
  const NOTIFY_KEY = 'tiny-vue-playground-notify'
16
16
  const LAYOUT = 'playground-layout'
17
17
  const LAYOUT_REVERSE = 'playground-layout-reverse'
@@ -23,7 +23,7 @@ const isMobileFirst = tinyMode === 'mobile-first'
23
23
  const isSaas = tinyTheme === 'saas'
24
24
  const isPreview = searchObj.get('openMode') === 'preview' // 是否多端弹窗预览
25
25
 
26
- const versions = ['3.26', '3.25', '3.24']
26
+ const versions = ['3.27', '3.26', '3.25']
27
27
  const getVersion = () => {
28
28
  if (isPreview) {
29
29
  return versions[0]
package/src/App.vue CHANGED
@@ -14,6 +14,7 @@
14
14
  import { onMounted, provide, ref } from 'vue'
15
15
  import { TinyConfigProvider, TinyModal } from '@opentiny/vue'
16
16
  import { iconClose } from '@opentiny/vue-icon'
17
+ import { isSaas } from './const'
17
18
 
18
19
  import useTheme from './tools/useTheme'
19
20
 
@@ -24,7 +25,7 @@ const tinyIconClose = iconClose()
24
25
  onMounted(() => {
25
26
  // 加载header
26
27
  const common = new window.TDCommon(['#header'], {
27
- allowDarkTheme: true,
28
+ allowDarkTheme: !isSaas,
28
29
  searchConfig: {
29
30
  show: true
30
31
  },
@@ -1,39 +1,37 @@
1
1
  <template>
2
- <div v-if="links.length" class="cmp-page-anchor catalog">
3
- <tiny-anchor
4
- id="anchor"
5
- :tiny_mode="theme === 'saas' ? 'pc' : 'mobile-first'"
6
- :offset-top="56"
7
- :links="links"
8
- :is-affix="props.anchorAffix"
9
- :type="theme === 'saas' ? 'line' : 'dot'"
10
- container-id="#doc-layout-scroller"
11
- @link-click="handleAnchorClick"
12
- >
13
- </tiny-anchor>
14
- </div>
2
+ <tiny-anchor
3
+ id="anchor"
4
+ v-if="links.length"
5
+ :tiny_mode="isSaas ? 'pc' : 'mobile-first'"
6
+ :offset-top="56"
7
+ :links="links"
8
+ :is-affix="props.anchorAffix"
9
+ :type="isSaas ? 'line' : 'dot'"
10
+ container-id="#doc-layout-scroller"
11
+ @link-click="handleAnchorClick"
12
+ >
13
+ </tiny-anchor>
15
14
  </template>
16
15
 
17
16
  <script setup lang="ts">
18
17
  import { computed } from 'vue'
19
18
  import { TinyAnchor } from '@opentiny/vue'
19
+ import { isSaas } from '../const'
20
20
 
21
21
  const props = defineProps({ anchorAffix: {}, currentJson: {}, activeTab: {}, langKey: {}, apiTypes: {} })
22
22
 
23
23
  const emit = defineEmits(['link-click'])
24
24
 
25
- const theme = import.meta.env.VITE_TINY_THEME
26
-
27
25
  // 实例锚点
28
- const demoAnchorLinks = computed(() => {
29
- const links =
30
- props.currentJson?.demos?.map((demo) => ({
26
+ const demoAnchorLinks = computed(() =>
27
+ (props.currentJson?.demos || [])
28
+ .filter((demo) => (isSaas ? !demo.hideSaas : true))
29
+ .map((demo) => ({
31
30
  key: demo.demoId,
32
31
  title: demo.name[props.langKey],
33
32
  link: `#${demo.demoId}`
34
- })) || []
35
- return links
36
- })
33
+ }))
34
+ )
37
35
 
38
36
  // 组件API锚点
39
37
  const apiAnchorLinks = computed(() => {
@@ -69,56 +67,4 @@ const handleAnchorClick = (...args) => {
69
67
  }
70
68
  </script>
71
69
 
72
- <style scoped lang="less">
73
- .cmp-page-anchor {
74
- :deep(.tiny-anchor__affix) {
75
- top: unset !important;
76
- overflow-y: auto;
77
- overflow-x: hidden;
78
- max-height: calc(100vh - 300px);
79
- }
80
-
81
- :deep(.tiny-anchor-link) {
82
- font-size: 12px;
83
-
84
- a {
85
- display: block;
86
- overflow: hidden;
87
- white-space: nowrap;
88
- text-overflow: ellipsis;
89
- }
90
- }
91
- }
92
-
93
- .catalog {
94
- flex: none;
95
- width: 200px;
96
- height: calc(100vh - 280px);
97
- padding-top: 16px;
98
- overflow: hidden;
99
-
100
- .tiny-anchor__dot {
101
- max-height: calc(100vh - 300px);
102
- width: 200px;
103
-
104
- :deep(.tiny-anchor) {
105
- --ti-anchor-width: auto;
106
- background-color: transparent;
107
- }
108
- }
109
- }
110
-
111
- .catalog:hover {
112
- overflow-y: auto;
113
- }
114
-
115
- .catalog::-webkit-scrollbar {
116
- width: 10px;
117
- background-color: #f5f5f5;
118
- }
119
-
120
- .catalog::-webkit-scrollbar-thumb {
121
- border-radius: 10px;
122
- background-color: #c1c1c1;
123
- }
124
- </style>
70
+ <style scoped lang="less"></style>
package/src/const.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import { tinyOldTheme, tinyAuroraTheme, tinyDarkTheme } from '@opentiny/vue-theme/theme-tool'
2
2
 
3
+ export const isSaas = import.meta.env.VITE_TINY_THEME === 'saas'
4
+
3
5
  // localStorage中保存语言的key
4
6
  export const LANG_KEY = '_lang'
5
7
  // localStorage中保存语言的value
package/src/main.js CHANGED
@@ -20,7 +20,7 @@ import { i18n } from './i18n/index'
20
20
  import { router } from './router'
21
21
  import App from './App.vue'
22
22
  import { appData } from './tools'
23
- import { ZH_CN_LANG, EN_US_LANG, LANG_PATH_MAP, ES_LA_LANG, PT_BR_LANG } from './const'
23
+ import { ZH_CN_LANG, EN_US_LANG, LANG_PATH_MAP, ES_LA_LANG, PT_BR_LANG, isSaas } from './const'
24
24
  import demoConfig from '@demos/config.js'
25
25
 
26
26
  import hljs from 'highlight.js/lib/core'
@@ -38,9 +38,6 @@ import { t } from '@opentiny/vue-locale'
38
38
  import { registerMcpConfig, customDesignConfig } from '@opentiny/vue-common'
39
39
  import { twMerge } from 'tailwind-merge'
40
40
 
41
- const envTarget = import.meta.env.VITE_BUILD_TARGET || 'open'
42
- const isSaas = import.meta.env.VITE_TINY_THEME === 'saas'
43
-
44
41
  // 适配层集成twMerge能力
45
42
  if (isSaas) {
46
43
  customDesignConfig.twMerge = twMerge
@@ -94,7 +91,7 @@ app.config.performance = true
94
91
  // 注入全局的saas主题变量
95
92
  app.config.globalProperties.tiny_theme = { value: import.meta.env.VITE_TINY_THEME }
96
93
 
97
- if (import.meta.env.VITE_TINY_THEME === 'saas') {
94
+ if (isSaas) {
98
95
  import('./tailwind.css')
99
96
  }
100
97
  // 注册TinyVue组件mcp配置
package/src/menus.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { docMenus, cmpMenus } from '@menu/menus.js'
2
2
  import { appData, $split } from './tools'
3
+ import { isSaas } from './const'
3
4
 
4
5
  /**
5
6
  * 聚合doc / cmp 两个页面的所有菜单.
@@ -27,7 +28,7 @@ function genMenus() {
27
28
  ]
28
29
 
29
30
  // 使用指南只在DEV下生效
30
- const isShowDoc = import.meta.env.DEV || import.meta.env.VITE_TINY_THEME === 'saas'
31
+ const isShowDoc = import.meta.env.DEV || isSaas
31
32
  const docOptions = isShowDoc
32
33
  ? docMenus.map((menu) => ({
33
34
  ...menu,
@@ -1,5 +1,6 @@
1
+ import { isSaas } from '../const'
2
+
1
3
  const OPEN_TINY_URL = 'https://opentiny.design'
2
- const isSaas = import.meta.env.VITE_TINY_THEME === 'saas'
3
4
 
4
5
  export const doSearchEverySite = () => {
5
6
  window.handleGlobalSearchData = (resolve) => {
@@ -9,7 +10,7 @@ export const doSearchEverySite = () => {
9
10
  }
10
11
 
11
12
  if (isSaas) {
12
- data.content = data.content.replaceAll('/tiny-vue/', '/tiny-vue-saas/')
13
+ data.content = data.content.replace('/tiny-vue/', '/tiny-vue-saas/')
13
14
  }
14
15
 
15
16
  resolve(data)
@@ -3,11 +3,12 @@ import { router } from '@/router.js'
3
3
  import { getAllComponents } from '@/menus'
4
4
  import demoConfig from '@demos/config.js'
5
5
  import { staticDemoPath } from '../views/components-doc/cmp-config'
6
+ import { isSaas } from '../const'
6
7
 
7
8
  const allMenus = getAllComponents()
8
9
 
9
10
  const templateModeState = reactive({
10
- isSaas: import.meta.env.VITE_TINY_THEME === 'saas',
11
+ isSaas,
11
12
  modeList: [],
12
13
  mode: null
13
14
  })
@@ -4,7 +4,7 @@ import designSaasConfig from '@opentiny/vue-design-saas'
4
4
  import designSMBConfig from '@opentiny/vue-design-smb'
5
5
  import { router } from '@/router'
6
6
  import { appData } from './appData'
7
- import { CURRENT_THEME_KEY, DEFAULT_THEME, AURORA_THEME, OLD_THEME, themeToolValuesMap } from '../const'
7
+ import { CURRENT_THEME_KEY, DEFAULT_THEME, AURORA_THEME, OLD_THEME, themeToolValuesMap, isSaas } from '../const'
8
8
  import glaciers from '@/assets/images/glaciers.png'
9
9
  import glaciersIcon from '@/assets/images/glaciers-icon.png'
10
10
 
@@ -51,7 +51,7 @@ watch(
51
51
  )
52
52
 
53
53
  const designConfig = computed(() => {
54
- if (import.meta.env.VITE_TINY_THEME === 'saas') {
54
+ if (isSaas) {
55
55
  return designSaasConfig
56
56
  }
57
57
  if (router.currentRoute.value.params.theme === 'smb-theme') {
@@ -1,6 +1,7 @@
1
+ import { isSaas } from '../../const'
2
+
1
3
  // 批量导入vue组件示例文件, 进行vue组件示例的渲染
2
4
  const vueFiles = import.meta.glob(`@demos/app/**/*.vue`)
3
- const isSaas = import.meta.env.VITE_TINY_THEME === 'saas'
4
5
  const mobileFirstVueFiles = isSaas ? import.meta.glob(`../../../demos/mobile-first/app/**/*.vue`) : null
5
6
  // 所有demo组件实例
6
7
  const vueComponents = Object.create(null)
@@ -75,16 +75,18 @@
75
75
  </div>
76
76
 
77
77
  <!-- demo与api目录锚点 -->
78
- <aside-anchor
79
- v-if="state.activeTab === 'demos' || state.activeTab === 'api'"
80
- :active-tab="state.activeTab"
81
- :current-json="state.currJson"
82
- :anchor-affix="state.anchorAffix"
83
- :api-types="state.currApiTypes"
84
- :lang-key="state.langKey"
85
- :key="anchorRefreshKey"
86
- @link-click="handleAnchorClick"
87
- ></aside-anchor>
78
+ <div class="cmp-page-anchor catalog">
79
+ <aside-anchor
80
+ v-if="state.activeTab === 'demos' || state.activeTab === 'api'"
81
+ :active-tab="state.activeTab"
82
+ :current-json="state.currJson"
83
+ :anchor-affix="state.anchorAffix"
84
+ :api-types="state.currApiTypes"
85
+ :lang-key="state.langKey"
86
+ :key="anchorRefreshKey"
87
+ @link-click="handleAnchorClick"
88
+ ></aside-anchor>
89
+ </div>
88
90
  </div>
89
91
 
90
92
  <div v-if="state.currJson.owner" class="ti-abs ti-right24 ti-top24" @click="copyText(state.currJson.owner)">
@@ -112,6 +114,7 @@ import DesignToken from '../../components/design-token.vue'
112
114
  import McpDocs from '../../components/mcp-docs.vue'
113
115
  import useTasksFinish from '../../composable/useTasksFinish'
114
116
  import list from '@opentiny/vue-theme/token'
117
+ import { isSaas } from '../../const'
115
118
  import { getTinyVueMcpConfig } from '@opentiny/tiny-vue-mcp'
116
119
  import { camelize, capitalize } from '@vue/shared'
117
120
 
@@ -205,7 +208,7 @@ const parseApiData = () => {
205
208
  for (const apiType of Object.keys(apiGroup)) {
206
209
  if (Array.isArray(apiGroup[apiType]) && apiGroup[apiType].length) {
207
210
  const apiArr = apiGroup[apiType].map((i) => {
208
- const { name, type, defaultValue, desc, demoId, typeAnchorName, linkTo, meta, versionTipOption } = i
211
+ const { name, type, defaultValue, desc, demoId, typeAnchorName, linkTo, meta, versionTipOption, hideSaas } = i
209
212
  const item = {
210
213
  name,
211
214
  type,
@@ -215,7 +218,8 @@ const parseApiData = () => {
215
218
  meta,
216
219
  versionTipOption,
217
220
  typeAnchorName: '',
218
- linkTo
221
+ linkTo,
222
+ hideSaas
219
223
  }
220
224
  if (typeAnchorName) {
221
225
  item.typeAnchorName = `${typeAnchorName?.includes('#') ? '' : '#'}${typeAnchorName}`
@@ -231,6 +235,15 @@ const parseApiData = () => {
231
235
 
232
236
  tableData[apiGroup.name] = apiDisplay
233
237
  }
238
+
239
+ // 当环境变量为tiny-vue-saas时
240
+ if (isSaas) {
241
+ for (const group of Object.keys(tableData)) {
242
+ for (const apiType of Object.keys(tableData[group])) {
243
+ tableData[group][apiType] = tableData[group][apiType].filter((item) => !item.hideSaas)
244
+ }
245
+ }
246
+ }
234
247
  state.tableData = tableData
235
248
  }
236
249
 
@@ -526,6 +539,57 @@ defineExpose({ loadPage })
526
539
  overflow: visible;
527
540
  }
528
541
  }
542
+ .cmp-page-anchor {
543
+ :deep(.tiny-anchor__affix) {
544
+ top: unset !important;
545
+ overflow-y: auto;
546
+ overflow-x: hidden;
547
+ max-height: calc(100vh - 300px);
548
+ }
549
+
550
+ :deep(.tiny-anchor-link) {
551
+ font-size: 12px;
552
+
553
+ a {
554
+ display: block;
555
+ overflow: hidden;
556
+ white-space: nowrap;
557
+ text-overflow: ellipsis;
558
+ }
559
+ }
560
+ }
561
+
562
+ .catalog {
563
+ flex: none;
564
+ width: 200px;
565
+ height: calc(100vh - 280px);
566
+ padding-top: 16px;
567
+ overflow: hidden;
568
+
569
+ .tiny-anchor__dot {
570
+ max-height: calc(100vh - 300px);
571
+ width: 200px;
572
+
573
+ :deep(.tiny-anchor) {
574
+ --ti-anchor-width: auto;
575
+ background-color: transparent;
576
+ }
577
+ }
578
+ }
579
+
580
+ .catalog:hover {
581
+ overflow-y: auto;
582
+ }
583
+
584
+ .catalog::-webkit-scrollbar {
585
+ width: 10px;
586
+ background-color: #f5f5f5;
587
+ }
588
+
589
+ .catalog::-webkit-scrollbar-thumb {
590
+ border-radius: 10px;
591
+ background-color: #c1c1c1;
592
+ }
529
593
  }
530
594
 
531
595
  .one-demo-col2 {