@opentinyvue/vue-docs 3.29.2 → 3.30.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.
- package/demos/apis/action-menu.js +22 -0
- package/demos/apis/alert.js +19 -22
- package/demos/apis/button-group.js +15 -0
- package/demos/apis/calendar-view.js +5 -5
- package/demos/apis/cascader-view.js +5 -5
- package/demos/apis/dialog-box.js +39 -38
- package/demos/apis/drawer.js +15 -0
- package/demos/apis/fluent-editor.js +30 -0
- package/demos/apis/fullscreen.js +10 -11
- package/demos/apis/grid.js +100 -17
- package/demos/apis/link.js +11 -0
- package/demos/apis/modal.js +32 -30
- package/demos/apis/notify.js +13 -13
- package/demos/apis/select.js +14 -2
- package/demos/apis/tree.js +23 -23
- package/demos/mobile-first/app/button-group/display-mode.vue +31 -0
- package/demos/mobile-first/app/button-group/webdoc/button-group.js +13 -0
- package/demos/mobile-first/app/calendar-view/webdoc/calendar-view.js +5 -4
- package/demos/pc/app/base-select/copy-multi.spec.ts +1 -1
- package/demos/pc/app/button-group/display-mode-composition-api.vue +23 -0
- package/demos/pc/app/button-group/display-mode.spec.ts +0 -0
- package/demos/pc/app/button-group/display-mode.vue +31 -0
- package/demos/pc/app/button-group/sup-composition-api.vue +1 -0
- package/demos/pc/app/button-group/sup.vue +1 -0
- package/demos/pc/app/button-group/webdoc/button-group.js +14 -0
- package/demos/pc/app/calendar-view/custom-day-bg-color.vue +10 -0
- package/demos/pc/app/calendar-view/webdoc/calendar-view.js +4 -4
- package/demos/pc/app/checkbox/checked-composition-api.vue +3 -3
- package/demos/pc/app/checkbox/checked.vue +3 -3
- package/demos/pc/app/drawer/basic-usage.spec.ts +4 -3
- package/demos/pc/app/drawer/placement.spec.ts +4 -4
- package/demos/pc/app/drawer/show-header.spec.ts +3 -2
- package/demos/pc/app/dropdown/show-icon-composition-api.vue +1 -1
- package/demos/pc/app/dropdown/show-icon.vue +1 -1
- package/demos/pc/app/flowchart/basic-usage-composition-api.vue +10 -260
- package/demos/pc/app/flowchart/basic-usage.spec.ts +2 -1
- package/demos/pc/app/flowchart/basic-usage.vue +4 -249
- package/demos/pc/app/flowchart/slots-composition-api.vue +182 -0
- package/demos/pc/app/flowchart/slots.spec.ts +24 -0
- package/demos/pc/app/flowchart/slots.vue +193 -0
- package/demos/pc/app/flowchart/webdoc/flowchart.js +14 -2
- package/demos/pc/app/form/group-form-composition-api.vue +2 -2
- package/demos/pc/app/form/group-form.vue +2 -2
- package/demos/pc/app/grid/filter/advanced-filter-composition-api.vue +1 -1
- package/demos/pc/app/grid/filter/advanced-filter.spec.js +1 -0
- package/demos/pc/app/grid/filter/advanced-filter.vue +1 -1
- package/demos/pc/app/grid/filter/custom-filter-composition-api.vue +46 -23
- package/demos/pc/app/grid/filter/custom-filter.spec.js +1 -1
- package/demos/pc/app/grid/filter/custom-filter.vue +47 -24
- package/demos/pc/app/grid/filter/default-filter.spec.ts +1 -0
- package/demos/pc/app/grid/filter/filter-label-value-composition-api.vue +71 -0
- package/demos/pc/app/grid/filter/filter-label-value.spec.ts +27 -0
- package/demos/pc/app/grid/filter/filter-label-value.vue +78 -0
- package/demos/pc/app/grid/filter/input-filter-custom-component-composition-api.vue +116 -0
- package/demos/pc/app/grid/filter/input-filter-custom-component.spec.ts +20 -0
- package/demos/pc/app/grid/filter/input-filter-custom-component.vue +126 -0
- package/demos/pc/app/grid/filter/layout-order-filter-composition-api.vue +114 -0
- package/demos/pc/app/grid/filter/layout-order-filter.spec.ts +31 -0
- package/demos/pc/app/grid/filter/layout-order-filter.vue +123 -0
- package/demos/pc/app/grid/webdoc/grid-filter.js +89 -41
- package/demos/pc/app/input/resize.spec.ts +2 -2
- package/demos/pc/app/link/custom-icon-composition-api.vue +1 -1
- package/demos/pc/app/link/custom-icon.vue +1 -1
- package/demos/pc/app/link/target-composition-api.vue +24 -0
- package/demos/pc/app/link/target.spec.ts +41 -0
- package/demos/pc/app/link/target.vue +30 -0
- package/demos/pc/app/link/webdoc/link.js +14 -0
- package/demos/pc/app/nav-menu/overflow.spec.ts +1 -1
- package/demos/pc/app/select/copy-multi.spec.ts +1 -1
- package/demos/pc/app/select-wrapper/copy-multi.spec.ts +2 -1
- package/demos/pc/app/tabs/tabs-events-close-composition-api.vue +8 -2
- package/demos/pc/app/tabs/tabs-events-close.vue +8 -2
- package/demos/pc/app/tag/basic-usage.spec.ts +1 -1
- package/demos/pc/app/tag/color-border.spec.ts +2 -2
- package/demos/pc/app/tag/max-width.spec.ts +1 -1
- package/demos/pc/app/tag/size.spec.ts +3 -3
- package/demos/pc/app/tag/slot-default.spec.ts +3 -3
- package/demos/pc/app/tag-group/basic-usage.spec.js +5 -5
- package/demos/pc/app/tag-group/tag-group-effect.spec.js +10 -10
- package/demos/pc/app/tag-group/tag-group-event.spec.js +1 -1
- package/demos/pc/menus.js +3 -3
- package/demos/pc/webdoc/changelog-en.md +121 -86
- package/demos/pc/webdoc/changelog.md +121 -86
- package/demos/pc/webdoc/develop-demo-en.md +13 -13
- package/demos/pc/webdoc/import-components.md +1 -1
- package/demos/pc/webdoc/introduce.md +2 -0
- package/demos/pc/webdoc/skills-en.md +107 -0
- package/demos/pc/webdoc/skills.md +107 -0
- package/demos/pc/webdoc/theme-en.md +82 -79
- package/demos/saas/menus.js +1 -0
- package/package.json +19 -20
- package/src/i18n/index.js +1 -2
- package/src/main.js +8 -5
- package/src/views/components-doc/common.vue +0 -25
- package/demos/pc/app/grid/webdoc/grid-ai-agent.js +0 -23
- package/demos/pc/webdoc/mcp-en.md +0 -101
- package/demos/pc/webdoc/mcp.md +0 -101
- package/src/components/mcp-docs.vue +0 -33
- package/src/composable/useTinyRemoter.ts +0 -176
|
@@ -6,20 +6,19 @@
|
|
|
6
6
|
</div>
|
|
7
7
|
</div>
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
A set of global CSS variables is defined in the TinyVue component library to unify theme styles, such as fonts, colors, spacing, and rounding values, and component-level CSS variables are also defined within each component. Starting with the <code> @opentiny/vue@3.19.0 </code> version, the overall style of the component library is changed to a new 'Opentiny Design' style, which is more suitable for enterprise-class and background management applications. If you want to use the OLD theme style, you can choose to continue using the historical version, or refer to the current document's <a href='#OLD theme configuration '>OLD theme configuration </a>.
|
|
9
|
+
A comprehensive set of global CSS variables is defined in the TinyVue component library to unify theme styles, including fonts, colors, spacing, and rounding values. Additionally, component-level CSS variables are defined within each individual component. Starting from version <code>@opentiny/vue@3.19.0</code>, the component library's overall style has been updated to the new 'Opentiny Design' style, which is specifically tailored for enterprise-class applications and backend management systems. If you prefer to use the legacy theme style, you can continue using the historical version or refer to the <a href='#old-theme-configuration'>OLD Theme Configuration</a> section in this document.
|
|
11
10
|
|
|
12
|
-
-
|
|
11
|
+
- Global CSS variables are located in the 'base' directory of the theme package: [base/vars.less](https://github.com/opentiny/tiny-vue/blob/dev/packages/theme/src/base/vars.less)
|
|
13
12
|
|
|
14
|
-
- Component-level
|
|
13
|
+
- Component-level CSS variables are defined in the theme root directory of each component, such as [button/vars.less](https://github.com/opentiny/tiny-vue/blob/dev/packages/theme/src/button/vars.less)
|
|
15
14
|
|
|
16
|
-
By
|
|
15
|
+
By examining the source code above, you can identify which component library styles can be customized.
|
|
17
16
|
|
|
18
|
-
## Custom
|
|
17
|
+
## Custom Theme
|
|
19
18
|
|
|
20
|
-
In
|
|
19
|
+
In your project, if you need to customize the theme style or override specific component styles, you can configure the project theme using the 'TinyThemeTool' class provided by the component library. We will continue to provide additional theme options for you to choose from in the future.
|
|
21
20
|
|
|
22
|
-
'ThemeData' is a custom theme data format that allows users to pass
|
|
21
|
+
'ThemeData' is a custom theme data format that allows users to pass overridden global CSS variables through the 'data' property and valid CSS rule blocks through the 'css' property.
|
|
23
22
|
|
|
24
23
|
```ts
|
|
25
24
|
interface ThemeData {
|
|
@@ -79,9 +78,9 @@ themeTool.changeTheme({
|
|
|
79
78
|
</div>
|
|
80
79
|
</div>
|
|
81
80
|
|
|
82
|
-
## Micro Frontends
|
|
81
|
+
## Micro Frontends Scenario
|
|
83
82
|
|
|
84
|
-
By default, the 'themeTool.changeTheme' method
|
|
83
|
+
By default, the 'themeTool.changeTheme' method mounts custom styles to the current 'document'. However, in micro frontend frameworks, there is typically a style isolation mechanism in place. For instance, an unbounded micro frontend may encapsulate child applications within a 'Web Component'. When customizing themes in such scenarios, you must mount the styles to the 'ShadowRoot' of the sub-application.
|
|
85
84
|
|
|
86
85
|
```ts
|
|
87
86
|
import TinyThemeTool from '@opentiny/vue-theme/theme-tool'
|
|
@@ -103,60 +102,60 @@ themeTool.changeTheme(
|
|
|
103
102
|
)
|
|
104
103
|
```
|
|
105
104
|
|
|
106
|
-
## OLD
|
|
105
|
+
## OLD Theme Configuration
|
|
107
106
|
|
|
108
|
-
We do not recommend that users continue
|
|
107
|
+
We do not recommend that users continue using the old theme. However, for legacy projects, we provide a set of old theme 'CSS variables' that users need to adapt in their projects.
|
|
109
108
|
|
|
110
109
|
```ts
|
|
111
110
|
import TinyThemeTool, { OldTheme } from '@opentiny/vue-theme/theme-tool'
|
|
112
111
|
|
|
113
112
|
const themeTool = new TinyThemeTool(OldTheme)
|
|
114
113
|
|
|
115
|
-
// themeTool.changeTheme(OldTheme) //
|
|
114
|
+
// themeTool.changeTheme(OldTheme) // Same effect as above
|
|
116
115
|
```
|
|
117
116
|
|
|
118
117
|
<div class="warning custom-block">
|
|
119
|
-
|
|
118
|
+
The old theme cannot 100% replicate all details of historical versions. If users experience significant impacts after upgrading, they can provide feedback to us. Alternatively, you can roll back to version <code>@opentiny/vue@3.18.0</code>, which we will continue to maintain for some time.
|
|
120
119
|
</div>
|
|
121
120
|
|
|
122
|
-
## Historical
|
|
121
|
+
## Historical Version Theme Configuration
|
|
123
122
|
|
|
124
123
|
<div class="danger custom-block">
|
|
125
|
-
|
|
124
|
+
This section of the documentation only supports theme customization for versions prior to <code>@opentiny/vue@3.18.0</code>
|
|
126
125
|
</div>
|
|
127
126
|
|
|
128
|
-
The `TinyVue`
|
|
127
|
+
The `TinyVue` component library utilizes `css` variables and defines a series of global/component style variables that you can adjust according to your specific requirements.
|
|
129
128
|
|
|
130
|
-
|
|
129
|
+
To view the theme-related variables, follow these steps:
|
|
131
130
|
|
|
132
131
|
Source code: [basic-var.less](https://github.com/opentiny/tiny-vue-theme/blob/main/src/base/basic-var.less)
|
|
133
132
|
|
|
134
|
-
Design
|
|
133
|
+
Design documentation: [Administrative interface specification design variables](https://rnd-think.huawei.com/think-home/designAnnotation)
|
|
135
134
|
|
|
136
|
-
Basic style variable `npm`
|
|
135
|
+
Basic style variable `npm` repository path: `@opentiny/vue-theme/theme`
|
|
137
136
|
|
|
138
|
-
### Using
|
|
137
|
+
### Using Predefined Themes and Dynamic Theme Switching
|
|
139
138
|
|
|
140
|
-
|
|
139
|
+
The official distribution currently offers 4 theme sets:
|
|
141
140
|
|
|
142
|
-
-Default Theme
|
|
143
|
-
-Infinity Theme `tinyInfinityTheme`
|
|
144
|
-
-Aurora Theme `tinyAuroraTheme`
|
|
145
|
-
-XDesign Theme `tinySmbTheme`
|
|
141
|
+
- Default Theme
|
|
142
|
+
- Infinity Theme `tinyInfinityTheme`
|
|
143
|
+
- Aurora Theme `tinyAuroraTheme`
|
|
144
|
+
- XDesign Theme `tinySmbTheme`
|
|
146
145
|
|
|
147
|
-
#### Using
|
|
146
|
+
#### Using Predefined Themes Through Alias [Currently supporting: Aurora theme and XDesign theme]
|
|
148
147
|
|
|
149
|
-
vue.config.js
|
|
148
|
+
**vue.config.js configuration:**
|
|
150
149
|
|
|
151
150
|
```js
|
|
152
151
|
chainWebpack: (config) => {
|
|
153
152
|
// XDesign Theme
|
|
154
153
|
config.resolve.alias.set('@opentiny/vue-theme', '@opentiny/vue-theme/smb-theme')
|
|
155
|
-
// Aurora Theme
|
|
154
|
+
// Aurora Theme: Replace all 'smb' characters in the above SMB theme with 'aurora'
|
|
156
155
|
}
|
|
157
156
|
```
|
|
158
157
|
|
|
159
|
-
vite.config.js
|
|
158
|
+
**vite.config.js configuration:**
|
|
160
159
|
|
|
161
160
|
```js
|
|
162
161
|
resolve: {
|
|
@@ -170,33 +169,34 @@ resolve: {
|
|
|
170
169
|
}
|
|
171
170
|
```
|
|
172
171
|
|
|
173
|
-
####
|
|
172
|
+
#### Theme Initialization and Dynamic Switching Implementation
|
|
173
|
+
|
|
174
|
+
Add the following code to your main.ts file:
|
|
174
175
|
|
|
175
176
|
```js
|
|
176
|
-
import TinyThemeTool from '
|
|
177
|
+
import TinyThemeTool from '@opentiny/vue-theme/theme-tool'
|
|
177
178
|
|
|
178
|
-
//
|
|
179
|
+
// Import Infinity theme
|
|
179
180
|
import { tinyInfinityTheme } from '@opentiny/vue-theme/theme'
|
|
180
181
|
|
|
181
|
-
// Initialize the
|
|
182
|
+
// Initialize the infinity theme
|
|
182
183
|
const theme = new TinyThemeTool(tinyInfinityTheme, 'tinyStyleSheetId')
|
|
183
184
|
|
|
184
|
-
//
|
|
185
|
+
// Custom theme data format
|
|
185
186
|
const tinyTestTheme = {
|
|
186
|
-
id: 'tiny-test-theme', // Unique
|
|
187
|
-
name: 'testTheme', // English name
|
|
188
|
-
cnName: 'Test
|
|
189
|
-
data: { 'ti-base-color': '#f2f2f3' } //
|
|
187
|
+
id: 'tiny-test-theme', // Unique theme identifier - each theme must have a unique ID
|
|
188
|
+
name: 'testTheme', // English theme name
|
|
189
|
+
cnName: 'Test Theme', // Chinese theme name
|
|
190
|
+
data: { 'ti-base-color': '#f2f2f3' } // Theme data
|
|
190
191
|
}
|
|
191
192
|
|
|
192
193
|
// Dynamic theme switching
|
|
193
|
-
|
|
194
194
|
theme.changeTheme(tinyTestTheme)
|
|
195
195
|
```
|
|
196
196
|
|
|
197
|
-
### Advanced
|
|
197
|
+
### Advanced Theme Customization Techniques
|
|
198
198
|
|
|
199
|
-
|
|
199
|
+
Define custom CSS variables at the global scope:
|
|
200
200
|
|
|
201
201
|
```css
|
|
202
202
|
:root {
|
|
@@ -204,7 +204,7 @@ Add a custom `css` variable under the global scope.
|
|
|
204
204
|
}
|
|
205
205
|
```
|
|
206
206
|
|
|
207
|
-
For performance
|
|
207
|
+
For better performance, it's recommended to define custom CSS variables under specific class names rather than at the global :root level:
|
|
208
208
|
|
|
209
209
|
```css
|
|
210
210
|
.tiny-test-class {
|
|
@@ -212,83 +212,86 @@ For performance reasons, it is more recommended that you add custom `css` variab
|
|
|
212
212
|
}
|
|
213
213
|
```
|
|
214
214
|
|
|
215
|
-
|
|
215
|
+
To customize a specific component, you can apply inline styles directly:
|
|
216
216
|
|
|
217
|
-
```
|
|
217
|
+
```html
|
|
218
218
|
<tiny-button style="--ti-base-color-white: #fefefe">Button</tiny-button>
|
|
219
219
|
```
|
|
220
220
|
|
|
221
|
-
|
|
221
|
+
To control CSS variables through JavaScript:
|
|
222
222
|
|
|
223
223
|
```js
|
|
224
224
|
const el = document.documentElement
|
|
225
225
|
|
|
226
|
-
//
|
|
226
|
+
// Retrieve CSS variable value
|
|
227
227
|
getComputedStyle(el).getPropertyValue('--ti-base-color-white')
|
|
228
228
|
|
|
229
|
-
// Set
|
|
229
|
+
// Set CSS variable value
|
|
230
230
|
el.style.setProperty('--ti-base-color-white', '#fefefe')
|
|
231
231
|
```
|
|
232
232
|
|
|
233
|
-
### Theme
|
|
234
|
-
|
|
235
|
-
Background: Because the `tiny-vue` needs to connect to the theme-based configuration system, the `tiny-vue` component library is later than the `3.5. 0` version, and the name of the customized variable is changed.
|
|
233
|
+
### Standardizing Theme Variables: Old vs New Variable Names
|
|
236
234
|
|
|
237
|
-
|
|
235
|
+
**Background**: As `tiny-vue` integrates with theme-based configuration systems, component library versions later than `3.5.0` have undergone variable name changes to standardize the naming convention.
|
|
238
236
|
|
|
239
|
-
|
|
237
|
+
For example:
|
|
240
238
|
|
|
241
|
-
|
|
239
|
+
- `--ti-base-color-selected-font-color` has been renamed to `--ti-base-color-selected-text-color`
|
|
240
|
+
- `--ti-alert-radius` has been renamed to `--ti-alert-border-radius`
|
|
242
241
|
|
|
243
|
-
|
|
242
|
+
When upgrading projects that use old CSS variables for styling, the new `tiny-vue` version may not recognize these variables. To address this, we provide a batch variable name replacement method. The process is as follows:
|
|
244
243
|
|
|
245
|
-
|
|
246
|
-
import { pubUrl } from '@/tools'
|
|
247
|
-
</script>
|
|
244
|
+
**Step 1**: Download the mapping table `newVars.json` and replacement script `replaceVar.js`.
|
|
248
245
|
|
|
249
|
-
|
|
246
|
+
[Download newVars.json](newVars.json) and [Download replaceVar.js](replaceVar.js)
|
|
250
247
|
|
|
251
|
-
Step 2
|
|
248
|
+
**Step 2**: Place both `newVars.json` and `replaceVar.js` in your project's root directory (at the same level as the src directory).
|
|
252
249
|
|
|
253
|
-
|
|
250
|
+
**Step 3**: Execute the following command in your project's root directory:
|
|
254
251
|
|
|
255
|
-
|
|
252
|
+
```bash
|
|
253
|
+
node replaceVar.js
|
|
254
|
+
```
|
|
256
255
|
|
|
257
|
-
|
|
256
|
+
**Handling Special Cases**: Manual replacement may be required for certain variables.
|
|
258
257
|
|
|
259
|
-
|
|
258
|
+
**Manual Replacement Background**: In the `newVars.json` mapping table, each `key` represents an old variable name and its corresponding `value` represents the new variable name. Some old variables like `--ti-button-padding` are classified as "special variables" because they are split into two or more new variables, making their `value` an array. In such cases, the script cannot perform automatic replacement, requiring manual intervention.
|
|
260
259
|
|
|
261
|
-
|
|
260
|
+
**Manual Replacement Process**:
|
|
262
261
|
|
|
263
|
-
|
|
262
|
+
1. Uncomment line 20 in the replaceVar.js file and re-run step 3. This will identify which variables require manual replacement (refer to the special variables table at the end of this document).
|
|
264
263
|
|
|
265
264
|
```js
|
|
266
|
-
|
|
265
|
+
console.log('Files requiring manual replacement:', statPath, 'Variables to replace:', key)
|
|
267
266
|
```
|
|
268
267
|
|
|
269
|
-
|
|
268
|
+
2. Based on the output file paths and variables, locate and modify the variables accordingly. The following examples cover all scenarios requiring manual replacement:
|
|
270
269
|
|
|
271
|
-
|
|
270
|
+
**General Cases**:
|
|
272
271
|
|
|
273
|
-
Example 1
|
|
272
|
+
**Example 1**: The special variables table shows that the old variable `--ti-button-padding` is split into 2 new variables: `--ti-button-padding-vertical` and `--ti-button-padding-horizontal`, representing vertical and horizontal padding respectively.
|
|
274
273
|
|
|
275
|
-
|
|
274
|
+
Original style: `padding: var(--ti-button-padding);`
|
|
275
|
+
Manual replacement: `padding: var(--ti-button-padding-vertical) var(--ti-button-padding-horizontal);`
|
|
276
276
|
|
|
277
|
-
Example 2
|
|
277
|
+
**Example 2**: The old variable `--ti-pager-primary-color` is split into 3 new variables: `--ti-pager-primary-bg-color`, `--ti-pager-primary-text-color`, and `--ti-pager-primary-border-color`, representing background color, text color, and border color respectively.
|
|
278
278
|
|
|
279
|
-
|
|
279
|
+
Original format: `--ti-pager-primary-color: red;`
|
|
280
|
+
Manual replacement: `--ti-pager-primary-bg-color: red; --ti-pager-primary-text-color: red; --ti-pager-primary-border-color: red;`
|
|
280
281
|
|
|
281
|
-
|
|
282
|
+
**Special Circumstances**:
|
|
282
283
|
|
|
283
|
-
Example 3
|
|
284
|
+
**Example 3**: Variables containing the `border` field require special handling. When split, they contain `border-weight` (border thickness), `border-style` (border style), and `border-color` (border color). For instance, `--tv-Tabs-item-active-border` splits into `--tv-Tabs-item-active-border-weight`, `--tv-Tabs-item-active-border-style`, and `--tv-Tabs-item-active-border-color`.
|
|
284
285
|
|
|
285
|
-
|
|
286
|
+
Original style: `--tv-Tabs-item-active-border: 1px solid red;`
|
|
287
|
+
Manual replacement: `--tv-Tabs-item-active-border-weight: 1px; --tv-Tabs-item-active-border-style: solid; --tv-Tabs-item-active-border-color: red;`
|
|
286
288
|
|
|
287
|
-
Example 4
|
|
289
|
+
**Example 4**: When a variable split from `--ti-radio-button-checked-hover-color` contains the `box-shadow` field, the `box-shadow` style must be written separately.
|
|
288
290
|
|
|
289
|
-
|
|
291
|
+
Original format: `--ti-radio-button-checked-hover-color: red`
|
|
292
|
+
Manual replacement: `--ti-radio-button-checked-hover-bg-color: red; --ti-radio-button-checked-hover-border-color: red; --ti-radio-button-checked-hover-box-shadow: -1px 0 0 0 red;` (The box-shadow value follows standard CSS syntax and can be customized.)
|
|
290
293
|
|
|
291
|
-
The mapping table of special variables is
|
|
294
|
+
The complete mapping table of special variables is provided below. The newVars.json file contains 48 special variables as shown in the following structure.
|
|
292
295
|
|
|
293
296
|
```json
|
|
294
297
|
{
|
package/demos/saas/menus.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentinyvue/vue-docs",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.30.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"devDependencies": {
|
|
7
7
|
"@playwright/test": "~1.49.0",
|
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
"@docsearch/css": "^3.8.0",
|
|
45
45
|
"@docsearch/js": "^3.8.0",
|
|
46
46
|
"@docsearch/react": "npm:@docsearch/css",
|
|
47
|
-
"@opentiny/tiny-vue-mcp": "^0.0.5",
|
|
48
47
|
"@opentiny/vue-repl": "^1.1.2",
|
|
49
48
|
"@opentiny/vue-search-box": "~3.28.4",
|
|
50
49
|
"@opentiny/vue-search-box-saas": "~3.28.4",
|
|
@@ -67,24 +66,24 @@
|
|
|
67
66
|
"vue-router": "4.1.5",
|
|
68
67
|
"zod": "^3.24.4",
|
|
69
68
|
"@opentiny-internal/unplugin-virtual-template": "~0.1.1-beta.0",
|
|
70
|
-
"@opentiny/utils": "
|
|
71
|
-
"@opentiny/vue": "~3.
|
|
72
|
-
"@opentiny/vue-common": "~3.
|
|
73
|
-
"@opentiny/vue-design-aurora": "~3.
|
|
74
|
-
"@opentiny/vue-design-saas": "~3.
|
|
75
|
-
"@opentiny/vue-design-smb": "~3.
|
|
76
|
-
"@opentiny/vue-directive": "~3.
|
|
77
|
-
"@opentiny/vue-
|
|
78
|
-
"@opentiny/vue-
|
|
79
|
-
"@opentiny/vue-huicharts": "~3.
|
|
80
|
-
"@opentiny/vue-icon": "~3.
|
|
81
|
-
"@opentiny/vue-icon-multicolor": "~3.
|
|
82
|
-
"@opentiny/vue-
|
|
83
|
-
"@opentiny/vue-
|
|
84
|
-
"@opentiny/vue-modal": "~3.
|
|
85
|
-
"@opentiny/vue-renderless": "~3.
|
|
86
|
-
"@opentiny/vue-theme": "~3.
|
|
87
|
-
"@opentiny/vue-theme-saas": "~3.
|
|
69
|
+
"@opentiny/utils": "npm:@opentinyvue/utils@~3.30.0",
|
|
70
|
+
"@opentiny/vue": "~3.30.0",
|
|
71
|
+
"@opentiny/vue-common": "~3.30.0",
|
|
72
|
+
"@opentiny/vue-design-aurora": "~3.30.0",
|
|
73
|
+
"@opentiny/vue-design-saas": "~3.30.0",
|
|
74
|
+
"@opentiny/vue-design-smb": "~3.30.0",
|
|
75
|
+
"@opentiny/vue-directive": "~3.30.0",
|
|
76
|
+
"@opentiny/vue-flowchart": "~3.30.0",
|
|
77
|
+
"@opentiny/vue-hooks": "npm:@opentinyvue/vue-hooks@~3.30.0",
|
|
78
|
+
"@opentiny/vue-huicharts": "~3.30.0",
|
|
79
|
+
"@opentiny/vue-icon": "~3.30.0",
|
|
80
|
+
"@opentiny/vue-icon-multicolor": "~3.30.0",
|
|
81
|
+
"@opentiny/vue-locale": "~3.30.0",
|
|
82
|
+
"@opentiny/vue-icon-saas": "~3.30.0",
|
|
83
|
+
"@opentiny/vue-modal": "~3.30.0",
|
|
84
|
+
"@opentiny/vue-renderless": "~3.30.0",
|
|
85
|
+
"@opentiny/vue-theme": "~3.30.0",
|
|
86
|
+
"@opentiny/vue-theme-saas": "~3.30.0"
|
|
88
87
|
},
|
|
89
88
|
"scripts": {
|
|
90
89
|
"start": "vite",
|
package/src/i18n/index.js
CHANGED
|
@@ -5,9 +5,8 @@ import zh from './zh.json'
|
|
|
5
5
|
import en from './en.json'
|
|
6
6
|
import esLA from './es.json'
|
|
7
7
|
import ptBR from './pt.json'
|
|
8
|
-
import { zhCN, enUS } from '@opentiny/tiny-vue-mcp'
|
|
9
8
|
|
|
10
|
-
const messages = { enUS: { ...en
|
|
9
|
+
const messages = { enUS: { ...en }, zhCN: { ...zh }, esLA: { ...esLA }, ptBR: { ...ptBR } }
|
|
11
10
|
|
|
12
11
|
const langMap = new Map([
|
|
13
12
|
['zhCN', 'zhCN'],
|
package/src/main.js
CHANGED
|
@@ -33,11 +33,16 @@ import '@docsearch/css'
|
|
|
33
33
|
import { doSearchEverySite } from './tools/docsearch'
|
|
34
34
|
import { getLocaleMode } from './tools/utils.js'
|
|
35
35
|
import '@opentiny/vue-theme/dark-theme-index.css'
|
|
36
|
-
|
|
37
|
-
import {
|
|
38
|
-
import { registerMcpConfig, customDesignConfig } from '@opentiny/vue-common'
|
|
36
|
+
|
|
37
|
+
import { customDesignConfig } from '@opentiny/vue-common'
|
|
39
38
|
import { twMerge } from 'tailwind-merge'
|
|
40
39
|
|
|
40
|
+
// 检测 navigator.webdriver(自动化标记),如果为 true 则说明当前环境是被自动化测试工具(如 Playwright)控制的
|
|
41
|
+
const isOpenPlaywright = navigator.webdriver
|
|
42
|
+
|
|
43
|
+
if (!isOpenPlaywright) {
|
|
44
|
+
import('@opentiny/vue-theme/responsive-index.less')
|
|
45
|
+
}
|
|
41
46
|
// 适配层集成twMerge能力
|
|
42
47
|
if (isSaas) {
|
|
43
48
|
customDesignConfig.twMerge = twMerge
|
|
@@ -94,8 +99,6 @@ app.config.globalProperties.tiny_theme = { value: import.meta.env.VITE_TINY_THEM
|
|
|
94
99
|
if (isSaas) {
|
|
95
100
|
import('./tailwind.css')
|
|
96
101
|
}
|
|
97
|
-
// 注册TinyVue组件mcp配置
|
|
98
|
-
registerMcpConfig(getTinyVueMcpConfig({ t }), createMcpTools)
|
|
99
102
|
|
|
100
103
|
app.use(router).use(i18n).use(createHead()) // 支持md修改title
|
|
101
104
|
|
|
@@ -74,9 +74,6 @@
|
|
|
74
74
|
<!-- 主题变量 -->
|
|
75
75
|
<design-token :name="state.cmpId" :tokenList="state.tokenList" />
|
|
76
76
|
</tiny-tab-item>
|
|
77
|
-
<tiny-tab-item v-if="mcpInfo.length > 0" title="MCP" name="MCP">
|
|
78
|
-
<McpDocs :data="mcpInfo" :name="capName" />
|
|
79
|
-
</tiny-tab-item>
|
|
80
77
|
</tiny-tabs>
|
|
81
78
|
|
|
82
79
|
<slot name="main-right" />
|
|
@@ -119,12 +116,9 @@ import ComponentHeader from '../../components/header.vue'
|
|
|
119
116
|
import ComponentContributor from '../../components/contributor.vue'
|
|
120
117
|
import ApiDocs from '../../components/api-docs.vue'
|
|
121
118
|
import DesignToken from '../../components/design-token.vue'
|
|
122
|
-
import McpDocs from '../../components/mcp-docs.vue'
|
|
123
119
|
import useTasksFinish from '../../composable/useTasksFinish'
|
|
124
120
|
import list from '@opentiny/vue-theme/token'
|
|
125
121
|
import { isSaas } from '../../const'
|
|
126
|
-
import { getTinyVueMcpConfig } from '@opentiny/tiny-vue-mcp'
|
|
127
|
-
import { camelize, capitalize } from '@vue/shared'
|
|
128
122
|
|
|
129
123
|
const props = defineProps({ loadData: {}, appMode: {}, demoKey: {} })
|
|
130
124
|
|
|
@@ -476,25 +470,6 @@ const handleAnchorClick = (e, data) => {
|
|
|
476
470
|
}
|
|
477
471
|
}
|
|
478
472
|
|
|
479
|
-
// MCP tab页签的数据
|
|
480
|
-
const mcpTools = getTinyVueMcpConfig({ t: null })
|
|
481
|
-
const capName = computed(() => capitalize(camelize(state.cmpId || '')))
|
|
482
|
-
|
|
483
|
-
const mcpInfo = computed(() => {
|
|
484
|
-
const schema = mcpTools.components[capName.value]?.paramsSchema
|
|
485
|
-
if (schema) {
|
|
486
|
-
return Object.keys(schema).map((name) => {
|
|
487
|
-
const item = schema[name]
|
|
488
|
-
return {
|
|
489
|
-
name,
|
|
490
|
-
param: item._def?.innerType?._def?.typeName || '',
|
|
491
|
-
desc: item._def?.description || ''
|
|
492
|
-
}
|
|
493
|
-
})
|
|
494
|
-
}
|
|
495
|
-
return []
|
|
496
|
-
})
|
|
497
|
-
|
|
498
473
|
defineExpose({ loadPage })
|
|
499
474
|
</script>
|
|
500
475
|
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
column: '1',
|
|
3
|
-
owner: '',
|
|
4
|
-
demos: [
|
|
5
|
-
{
|
|
6
|
-
demoId: 'grid-ai-agent',
|
|
7
|
-
name: { 'zh-CN': '表格智能体', 'en-US': 'grid agent' },
|
|
8
|
-
desc: {
|
|
9
|
-
'zh-CN': `表格智能体是表格组件面向 AI 领域的应用,提供了一个基于表格数据的智能体交互界面。用户可以通过自然语言与表格进行交互,智能体会根据表格内容和用户输入执行操作。<br>
|
|
10
|
-
目前表格智能体支持的操作包括:<br>
|
|
11
|
-
- 查询表格数据:用户可以输入自然语言查询表格中的数据,智能体会解析查询并返回结果,以及根据结果执行后续的操作。<br>
|
|
12
|
-
- 滚动到指定行:用户可以通过自然语言指令,将表格滚动到指定位置。<br>
|
|
13
|
-
- 选中表格数据:用户可以通过自然语言指令,选中表格数据。<br>
|
|
14
|
-
- 选中全部数据:用户可以通过自然语言指令,选中全部数据。<br>
|
|
15
|
-
|
|
16
|
-
通过属性 <code>tiny_mcp_config</code> 可以配置表格的业务意义以及传入<code>server</code>对象,详见示例。`,
|
|
17
|
-
'en-US': ``
|
|
18
|
-
},
|
|
19
|
-
codeFiles: ['ai-agent/basic-usage.vue']
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
apis: [{ name: 'grid-ai-agent', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
|
|
23
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
# TinyVue Intelligent Component Access Guide
|
|
2
|
-
|
|
3
|
-
TinyVue's intelligent components provide a complete intelligent solution, allowing your application to have AI conversation, voice interaction, and other capabilities. This guide will walk you through how to integrate TinyVue's intelligent components into your project.
|
|
4
|
-
|
|
5
|
-
## Install dependencies
|
|
6
|
-
|
|
7
|
-
First, you need to install the following core dependency packages:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install @opentiny/tiny-vue-mcp @opentiny/next-vue @opentiny/vue-common @opentiny/vue
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Access steps
|
|
14
|
-
|
|
15
|
-
### 1. Initialize MCP Configuration
|
|
16
|
-
|
|
17
|
-
Initialize MCP configuration in the application entry file (e.g., `main.js`):
|
|
18
|
-
|
|
19
|
-
```js
|
|
20
|
-
import { registerMcpConfig } from '@opentiny/vue-common'
|
|
21
|
-
import { createMcpTools, getTinyVueMcpConfig } from '@opentiny/tiny-vue-mcp'
|
|
22
|
-
|
|
23
|
-
// Register TinyVue component MCP configuration
|
|
24
|
-
registerMcpConfig(getTinyVueMcpConfig(), createMcpTools)
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### 2. Create NextClient Proxy Client
|
|
28
|
-
|
|
29
|
-
Create a NextClient proxy client in `App.vue` to establish real-time communication:
|
|
30
|
-
|
|
31
|
-
```html
|
|
32
|
-
<script setup lang="ts">
|
|
33
|
-
import { useNextClient } from '@opentiny/next-vue'
|
|
34
|
-
|
|
35
|
-
const { sessionId } = useNextClient({
|
|
36
|
-
clientInfo: {
|
|
37
|
-
name: 'your-app-name', // Application name
|
|
38
|
-
version: '1.0.0', // Application version
|
|
39
|
-
sessionId: 'your-session-id' // Optional, will be passed in by the backend if not provided; for debugging, you can use crypto.randomUUID() to generate a fixed one
|
|
40
|
-
},
|
|
41
|
-
proxyOptions: {
|
|
42
|
-
url: 'your-sse-url', // SSE service address
|
|
43
|
-
token: 'your-token' // Authentication token
|
|
44
|
-
}
|
|
45
|
-
})
|
|
46
|
-
</script>
|
|
47
|
-
|
|
48
|
-
<template>
|
|
49
|
-
<div>
|
|
50
|
-
<h1>NextClient Proxy Client</h1>
|
|
51
|
-
<p>Session ID: {{ sessionId }}</p>
|
|
52
|
-
</div>
|
|
53
|
-
</template>
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### 3. MCP Component Configuration
|
|
57
|
-
|
|
58
|
-
When using
|
|
59
|
-
|
|
60
|
-
```html
|
|
61
|
-
<script setup lang="ts">
|
|
62
|
-
import { useNextServer } from '@opentiny/next-vue'
|
|
63
|
-
|
|
64
|
-
const { server } = useNextServer({
|
|
65
|
-
serverInfo: { name: 'your-server-name', version: '1.0.0' }
|
|
66
|
-
})
|
|
67
|
-
</script>
|
|
68
|
-
|
|
69
|
-
<template>
|
|
70
|
-
<tiny-grid
|
|
71
|
-
:tiny_mcp_config="{
|
|
72
|
-
server,
|
|
73
|
-
business: {
|
|
74
|
-
id: 'your-business-id',
|
|
75
|
-
description: 'Business description'
|
|
76
|
-
}
|
|
77
|
-
}"
|
|
78
|
-
>
|
|
79
|
-
<!-- Table content -->
|
|
80
|
-
</tiny-grid>
|
|
81
|
-
</template>
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
## Notes
|
|
85
|
-
|
|
86
|
-
1. Ensure that the server supports SSE (Server-Sent Events) connections
|
|
87
|
-
2. It is recommended to use HTTPS in production environments
|
|
88
|
-
3. CORS needs to be correctly configured to support cross-origin requests
|
|
89
|
-
|
|
90
|
-
## Common issues
|
|
91
|
-
|
|
92
|
-
1. Session connection failed
|
|
93
|
-
|
|
94
|
-
- Check if the SSE service address is correct
|
|
95
|
-
- Confirm that the network connection is normal
|
|
96
|
-
- Verify that the authentication information is valid
|
|
97
|
-
|
|
98
|
-
2. AI conversation response is not available
|
|
99
|
-
- Check if the session is established normally
|
|
100
|
-
- Confirm that the prompt item configuration is correct
|
|
101
|
-
- Check if there are errors in the network request
|