@opentiny/vue-docs 3.28.0 → 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 +31 -0
- package/demos/apis/dropdown.js +39 -1
- package/demos/apis/filter-panel.js +21 -1
- package/demos/apis/fluent-editor.js +30 -0
- package/demos/apis/form.js +11 -0
- package/demos/apis/fullscreen.js +10 -11
- package/demos/apis/grid.js +131 -16
- package/demos/apis/guide.js +14 -0
- package/demos/apis/link.js +11 -0
- package/demos/apis/message.js +48 -22
- package/demos/apis/modal.js +34 -31
- package/demos/apis/notify.js +13 -13
- package/demos/apis/rate.js +15 -0
- package/demos/apis/search-box.js +343 -0
- package/demos/apis/select.js +14 -2
- package/demos/apis/tag-input.js +182 -0
- 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/mobile-first/app/modal/webdoc/modal.js +2 -1
- package/demos/pc/app/alert/center.spec.ts +8 -0
- package/demos/pc/app/alert/custom-close.spec.ts +39 -9
- package/demos/pc/app/alert/icon.spec.ts +18 -7
- package/demos/pc/app/alert/show-icon.spec.ts +1 -1
- package/demos/pc/app/anchor/webdoc/anchor.js +1 -0
- 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/calendar-event.spec.ts +1 -1
- 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/cascader/filter-mode-composition-api.vue +2 -2
- package/demos/pc/app/checkbox/checked-composition-api.vue +3 -3
- package/demos/pc/app/checkbox/checked.vue +3 -3
- package/demos/pc/app/date-picker/align.spec.ts +10 -13
- package/demos/pc/app/date-picker/clear.spec.ts +3 -3
- package/demos/pc/app/date-picker/default-value.spec.ts +4 -4
- package/demos/pc/app/date-picker/events.spec.ts +2 -2
- package/demos/pc/app/date-picker/format.spec.ts +3 -3
- package/demos/pc/app/date-picker/now.spec.ts +4 -4
- package/demos/pc/app/date-picker/shortcuts.spec.ts +1 -1
- package/demos/pc/app/date-picker/slot.spec.ts +5 -5
- package/demos/pc/app/dialog-box/basic-usage.spec.ts +5 -5
- package/demos/pc/app/dialog-box/form-in-dialog.spec.ts +1 -2
- package/demos/pc/app/drawer/basic-usage.spec.ts +4 -3
- package/demos/pc/app/drawer/close-on-press-escape.spec.ts +4 -2
- 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/drawer/webdoc/drawer.js +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/dropdown/tip-composition-api.vue +5 -2
- package/demos/pc/app/dropdown/tip.vue +5 -2
- package/demos/pc/app/dropdown/webdoc/dropdown.js +2 -2
- package/demos/pc/app/filter-panel/size-composition-api.vue +58 -0
- package/demos/pc/app/filter-panel/size.spec.ts +23 -0
- package/demos/pc/app/filter-panel/size.vue +68 -0
- package/demos/pc/app/filter-panel/webdoc/filter-panel.js +13 -0
- 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/basic-usage.spec.ts +6 -4
- package/demos/pc/app/form/custom-validation-string-length-composition-api.vue +38 -0
- package/demos/pc/app/form/custom-validation-string-length.spec.ts +18 -0
- package/demos/pc/app/form/custom-validation-string-length.vue +28 -13
- 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-composition-api.vue +5 -1
- package/demos/pc/app/grid/filter/default-filter.spec.ts +1 -0
- package/demos/pc/app/grid/filter/default-filter.vue +4 -1
- 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/toolbar/custom-toolbar.spec.js +1 -1
- package/demos/pc/app/grid/webdoc/grid-filter.js +89 -40
- package/demos/pc/app/guide/show-close-composition-api.vue +77 -0
- package/demos/pc/app/guide/show-close.spec.ts +37 -0
- package/demos/pc/app/guide/show-close.vue +84 -0
- package/demos/pc/app/guide/webdoc/guide.js +12 -0
- package/demos/pc/app/icon/advance-icons.js +108 -2
- package/demos/pc/app/icon/advance-usage-composition-api.vue +26 -1
- package/demos/pc/app/icon/advance-usage.vue +27 -1
- package/demos/pc/app/icon/webdoc/icon.js +5 -3
- 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/message/basic-usage-composition-api.vue +48 -0
- package/demos/pc/app/message/basic-usage.spec.ts +27 -0
- package/demos/pc/app/message/basic-usage.vue +50 -0
- package/demos/pc/app/message/message-close-composition-api.vue +25 -0
- package/demos/pc/app/message/message-close.spec.ts +9 -0
- package/demos/pc/app/message/message-close.vue +32 -0
- package/demos/pc/app/message/message-duration-composition-api.vue +25 -0
- package/demos/pc/app/message/message-duration.spec.ts +9 -0
- package/demos/pc/app/message/message-duration.vue +32 -0
- package/demos/pc/app/message/prevent-duplicate-composition-api.vue +25 -0
- package/demos/pc/app/message/prevent-duplicate.spec.ts +9 -0
- package/demos/pc/app/message/prevent-duplicate.vue +32 -0
- package/demos/pc/app/message/webdoc/message.cn.md +7 -0
- package/demos/pc/app/message/webdoc/message.en.md +7 -0
- package/demos/pc/app/message/webdoc/message.js +56 -0
- package/demos/pc/app/modal/basic-usage.spec.ts +3 -3
- package/demos/pc/app/modal/modal-footer-composition-api.vue +3 -3
- package/demos/pc/app/modal/modal-footer.spec.ts +9 -4
- package/demos/pc/app/modal/modal-footer.vue +3 -3
- package/demos/pc/app/modal/modal-header.spec.ts +2 -2
- package/demos/pc/app/modal/modal-size.spec.ts +2 -2
- package/demos/pc/app/modal/status.spec.ts +22 -15
- package/demos/pc/app/nav-menu/overflow.spec.ts +1 -1
- package/demos/pc/app/popconfirm/custom-class.spec.ts +0 -1
- package/demos/pc/app/popconfirm/slot-message.spec.ts +10 -2
- package/demos/pc/app/popconfirm/trigger.spec.ts +16 -12
- package/demos/pc/app/popover/basic-usage.spec.js +3 -8
- package/demos/pc/app/popover/custom-popper.spec.js +2 -2
- package/demos/pc/app/popover/delay.spec.js +2 -2
- package/demos/pc/app/popover/disabled.spec.js +2 -2
- package/demos/pc/app/popover/events.spec.js +1 -1
- package/demos/pc/app/popover/ignore-boundaries.spec.js +2 -3
- package/demos/pc/app/popover/offset.spec.js +17 -31
- package/demos/pc/app/radio/dynamic-disable-composition-api.vue +3 -3
- package/demos/pc/app/radio/dynamic-disable.vue +2 -2
- package/demos/pc/app/rate/clearable-composition-api.vue +20 -0
- package/demos/pc/app/rate/clearable.spec.js +74 -0
- package/demos/pc/app/rate/clearable.vue +28 -0
- package/demos/pc/app/rate/webdoc/rate.js +12 -0
- package/demos/pc/app/search/events.spec.ts +1 -1
- package/demos/pc/app/search-box/append-to-body-composition-api.vue +300 -0
- package/demos/pc/app/search-box/append-to-body.vue +308 -0
- package/demos/pc/app/search-box/auto-match-composition-api.vue +162 -0
- package/demos/pc/app/search-box/auto-match.vue +170 -0
- package/demos/pc/app/search-box/basic-usage-composition-api.vue +269 -0
- package/demos/pc/app/search-box/basic-usage.vue +277 -0
- package/demos/pc/app/search-box/custom-panel-composition-api.vue +63 -0
- package/demos/pc/app/search-box/custom-panel.vue +72 -0
- package/demos/pc/app/search-box/default-field-composition-api.vue +163 -0
- package/demos/pc/app/search-box/default-field.vue +171 -0
- package/demos/pc/app/search-box/editable-composition-api.vue +311 -0
- package/demos/pc/app/search-box/editable.vue +320 -0
- package/demos/pc/app/search-box/empty-placeholder-composition-api.vue +162 -0
- package/demos/pc/app/search-box/empty-placeholder.vue +170 -0
- package/demos/pc/app/search-box/events-composition-api.vue +169 -0
- package/demos/pc/app/search-box/events.vue +173 -0
- package/demos/pc/app/search-box/group-key-composition-api.vue +257 -0
- package/demos/pc/app/search-box/group-key.vue +266 -0
- package/demos/pc/app/search-box/help-composition-api.vue +166 -0
- package/demos/pc/app/search-box/help.vue +175 -0
- package/demos/pc/app/search-box/id-map-key-composition-api.vue +131 -0
- package/demos/pc/app/search-box/id-map-key.vue +140 -0
- package/demos/pc/app/search-box/item-placeholder-composition-api.vue +119 -0
- package/demos/pc/app/search-box/item-placeholder.vue +127 -0
- package/demos/pc/app/search-box/max-length-composition-api.vue +29 -0
- package/demos/pc/app/search-box/max-length.vue +38 -0
- package/demos/pc/app/search-box/max-time-length-composition-api.vue +53 -0
- package/demos/pc/app/search-box/max-time-length.vue +62 -0
- package/demos/pc/app/search-box/merge-tag-composition-api.vue +59 -0
- package/demos/pc/app/search-box/merge-tag.vue +68 -0
- package/demos/pc/app/search-box/panel-max-height-composition-api.vue +162 -0
- package/demos/pc/app/search-box/panel-max-height.vue +170 -0
- package/demos/pc/app/search-box/potential-match-composition-api.vue +193 -0
- package/demos/pc/app/search-box/potential-match.vue +201 -0
- package/demos/pc/app/search-box/settings-composition-api.vue +163 -0
- package/demos/pc/app/search-box/settings.vue +171 -0
- package/demos/pc/app/search-box/size-composition-api.vue +162 -0
- package/demos/pc/app/search-box/size.vue +170 -0
- package/demos/pc/app/search-box/split-input-value-composition-api.vue +162 -0
- package/demos/pc/app/search-box/split-input-value.vue +170 -0
- package/demos/pc/app/search-box/suffix-icon-composition-api.vue +209 -0
- package/demos/pc/app/search-box/suffix-icon.vue +219 -0
- package/demos/pc/app/search-box/v-model-composition-api.vue +174 -0
- package/demos/pc/app/search-box/v-model.vue +182 -0
- package/demos/pc/app/search-box/webdoc/search-box.cn.md +7 -0
- package/demos/pc/app/search-box/webdoc/search-box.en.md +7 -0
- package/demos/pc/app/search-box/webdoc/search-box.js +257 -0
- 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/basic-usage.spec.ts +2 -2
- package/demos/pc/app/tabs/more-show-all.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/tabs/tooltip-composition-api.vue +1 -1
- 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/app/tag-input/basic-usage-composition-api.vue +29 -0
- package/demos/pc/app/tag-input/basic-usage.spec.ts +0 -0
- package/demos/pc/app/tag-input/basic-usage.vue +38 -0
- package/demos/pc/app/tag-input/clearable-tag-composition-api.vue +20 -0
- package/demos/pc/app/tag-input/clearable-tag.vue +27 -0
- package/demos/pc/app/tag-input/collapsed-tag-composition-api.vue +20 -0
- package/demos/pc/app/tag-input/collapsed-tag.vue +28 -0
- package/demos/pc/app/tag-input/disabled-readonly-composition-api.vue +20 -0
- package/demos/pc/app/tag-input/disabled-readonly.vue +29 -0
- package/demos/pc/app/tag-input/draggable-tag-composition-api.vue +12 -0
- package/demos/pc/app/tag-input/draggable-tag.spec.ts +0 -0
- package/demos/pc/app/tag-input/draggable-tag.vue +20 -0
- package/demos/pc/app/tag-input/max-composition-api.vue +20 -0
- package/demos/pc/app/tag-input/max.vue +28 -0
- package/demos/pc/app/tag-input/prefix-suffix-composition-api.vue +26 -0
- package/demos/pc/app/tag-input/prefix-suffix.vue +34 -0
- package/demos/pc/app/tag-input/separator-tag-composition-api.vue +20 -0
- package/demos/pc/app/tag-input/separator-tag.vue +28 -0
- package/demos/pc/app/tag-input/webdoc/tag-input.cn.md +7 -0
- package/demos/pc/app/tag-input/webdoc/tag-input.en.md +7 -0
- package/demos/pc/app/tag-input/webdoc/tag-input.js +107 -0
- package/demos/pc/app/time-picker/basic-usage.spec.ts +5 -4
- package/demos/pc/app/time-picker/clearable.spec.ts +5 -4
- package/demos/pc/app/time-picker/default-value.spec.ts +2 -2
- package/demos/pc/app/time-picker/disabled.spec.ts +4 -3
- package/demos/pc/app/time-picker/format.spec.ts +8 -11
- package/demos/pc/app/time-picker/is-range.spec.ts +4 -3
- package/demos/pc/app/time-picker/name.spec.ts +1 -1
- package/demos/pc/app/time-picker/placeholder.spec.ts +3 -3
- package/demos/pc/app/time-picker/popper-class.spec.ts +1 -1
- package/demos/pc/app/time-picker/size.spec.ts +2 -1
- package/demos/pc/app/time-select/basic-usage.spec.ts +1 -1
- package/demos/pc/app/time-select/clear-icon.spec.ts +1 -2
- package/demos/pc/app/time-select/focus.spec.ts +1 -1
- package/demos/pc/app/time-select/picker-options.spec.ts +2 -1
- package/demos/pc/app/time-select/range-placeholder.spec.ts +2 -2
- package/demos/pc/app/time-select/size-medium.spec.ts +3 -3
- package/demos/pc/app/tooltip/delay.spec.js +7 -9
- package/demos/pc/app/tooltip/offset.spec.js +0 -2
- package/demos/pc/app/tooltip/popper-options.spec.js +2 -1
- package/demos/pc/app/user-head/color-composition-api.vue +2 -1
- package/demos/pc/menus.js +6 -4
- package/demos/pc/webdoc/changelog-en.md +370 -176
- package/demos/pc/webdoc/changelog.md +177 -219
- 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/pc/webdoc/v3.28.0-release-article.md +943 -0
- package/demos/saas/menus.js +1 -0
- package/package.json +21 -20
- package/playground/App.vue +12 -6
- package/playground/shims/vue-search-box.mjs +154 -0
- package/public/static/css/mobile-dark-theme.css +1 -0
- package/src/i18n/index.js +1 -2
- package/src/main.js +8 -5
- package/src/style.css +5 -0
- package/src/views/components-doc/common.vue +0 -25
- package/src/views/components-doc/mobile.vue +49 -2
- package/vite.config.ts +3 -2
- package/vite.extend.ts +65 -0
- 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
|
@@ -3,36 +3,22 @@ import { test, expect } from '@playwright/test'
|
|
|
3
3
|
test('箭头偏移', async ({ page }) => {
|
|
4
4
|
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
|
5
5
|
await page.goto('popover#offset')
|
|
6
|
+
const demo = page.locator('#offset')
|
|
7
|
+
await demo
|
|
8
|
+
.locator('div')
|
|
9
|
+
.filter({ hasText: /^箭头偏移:0%箭头偏移示例$/ })
|
|
10
|
+
.getByRole('textbox')
|
|
11
|
+
.fill('50')
|
|
12
|
+
await expect(demo.getByRole('textbox').first()).toHaveValue('50')
|
|
13
|
+
const slider = await demo.locator('.tiny-slider__range').first()
|
|
14
|
+
await expect(slider).toHaveCSS('background-color', 'rgb(20, 118, 255)')
|
|
6
15
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
await expect(
|
|
15
|
-
let middle = await arrow.boundingBox()
|
|
16
|
-
await input1.fill('8')
|
|
17
|
-
await page.waitForTimeout(1000)
|
|
18
|
-
let left = await arrow.boundingBox()
|
|
19
|
-
await input1.fill('100')
|
|
20
|
-
await page.waitForTimeout(1000)
|
|
21
|
-
let right = await arrow.boundingBox()
|
|
22
|
-
|
|
23
|
-
expect(left.x < middle.x)
|
|
24
|
-
expect(middle.x < right.x)
|
|
25
|
-
|
|
26
|
-
// 面板偏移
|
|
27
|
-
await expect(panel).toBeVisible()
|
|
28
|
-
middle = await panel.boundingBox()
|
|
29
|
-
await input2.fill('-100')
|
|
30
|
-
await page.waitForTimeout(1000)
|
|
31
|
-
left = await panel.boundingBox()
|
|
32
|
-
await input2.fill('100')
|
|
33
|
-
await page.waitForTimeout(1000)
|
|
34
|
-
right = await panel.boundingBox()
|
|
35
|
-
|
|
36
|
-
expect(left.x < middle.x)
|
|
37
|
-
expect(middle.x < right.x)
|
|
16
|
+
await demo
|
|
17
|
+
.locator('div')
|
|
18
|
+
.filter({ hasText: /^面板偏移:0%面板偏移示例$/ })
|
|
19
|
+
.getByRole('textbox')
|
|
20
|
+
.fill('40')
|
|
21
|
+
await expect(demo.getByRole('textbox').nth(1)).toHaveValue('40')
|
|
22
|
+
const slider2 = page.locator('.popper__arrow').nth(1)
|
|
23
|
+
await expect(slider2).toHaveCSS('left', '100px')
|
|
38
24
|
})
|
|
@@ -24,11 +24,11 @@ import { TinyRadio, TinyRadioButton, TinyRadioGroup } from '@opentiny/vue'
|
|
|
24
24
|
|
|
25
25
|
const radio = ref('禁用')
|
|
26
26
|
const radio1 = ref('6')
|
|
27
|
-
const radio2 = ref('
|
|
27
|
+
const radio2 = ref('3')
|
|
28
28
|
const dataArr = ref([
|
|
29
|
-
{ lable: '
|
|
29
|
+
{ lable: '9', value: '备选项 1' },
|
|
30
30
|
{ lable: '6', value: '备选项 2' },
|
|
31
|
-
{ lable: '
|
|
31
|
+
{ lable: '3', value: '备选项 3' }
|
|
32
32
|
])
|
|
33
33
|
</script>
|
|
34
34
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="demo-rate">
|
|
3
|
+
<p>可清空的评分</p>
|
|
4
|
+
<tiny-rate v-model="rate1" :clearable="true" show-text></tiny-rate>
|
|
5
|
+
<p>当前值:{{ rate1 }}</p>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup>
|
|
10
|
+
import { ref } from 'vue'
|
|
11
|
+
import { TinyRate } from '@opentiny/vue'
|
|
12
|
+
|
|
13
|
+
const rate1 = ref(3)
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<style scoped>
|
|
17
|
+
.demo-rate {
|
|
18
|
+
padding: 20px;
|
|
19
|
+
}
|
|
20
|
+
</style>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { test, expect } from '@playwright/test'
|
|
2
|
+
|
|
3
|
+
test.describe('Rate Clearable 功能', () => {
|
|
4
|
+
test('点击已选中的星星可以清零', async ({ page }) => {
|
|
5
|
+
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
|
6
|
+
await page.goto('rate#clearable')
|
|
7
|
+
|
|
8
|
+
const icon = page.locator('.tiny-rate__star > .tiny-svg')
|
|
9
|
+
const text = page.locator('.tiny-rate .tiny-rate__text')
|
|
10
|
+
|
|
11
|
+
// Vue3中可能需要等待渲染
|
|
12
|
+
await page.waitForTimeout(100)
|
|
13
|
+
|
|
14
|
+
// 尝试多种可能的文本值
|
|
15
|
+
const initialText = await text.textContent()
|
|
16
|
+
expect(['一般', '中等', '普通'].includes(initialText)).toBeTruthy()
|
|
17
|
+
|
|
18
|
+
// 点击已选中的第3个星星
|
|
19
|
+
await icon.nth(2).click()
|
|
20
|
+
await page.waitForTimeout(100)
|
|
21
|
+
|
|
22
|
+
// Vue3可能显示为空字符串,也可能是其他值(如"未评分")
|
|
23
|
+
const clearedText = await text.textContent()
|
|
24
|
+
// 允许空字符串或"未评分"等文本
|
|
25
|
+
expect(clearedText === '' || clearedText.includes('未评分')).toBeTruthy()
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
test('未设置 clearable 时点击已选星星不会清零', async ({ page }) => {
|
|
29
|
+
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
|
30
|
+
await page.goto('rate#basic-usage')
|
|
31
|
+
|
|
32
|
+
const icon = page.locator('.tiny-rate__star > .tiny-svg')
|
|
33
|
+
const text = page.locator('.tiny-rate .tiny-rate__text')
|
|
34
|
+
|
|
35
|
+
await page.waitForTimeout(100)
|
|
36
|
+
|
|
37
|
+
// 使用更灵活的断言
|
|
38
|
+
const textBefore = await text.textContent()
|
|
39
|
+
await icon.nth(1).click()
|
|
40
|
+
await page.waitForTimeout(100)
|
|
41
|
+
const textAfter = await text.textContent()
|
|
42
|
+
|
|
43
|
+
// 文本应该保持不变
|
|
44
|
+
expect(textAfter).toBe(textBefore)
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
test('clearable 模式下点击其他星星正常选择', async ({ page }) => {
|
|
48
|
+
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
|
49
|
+
await page.goto('rate#clearable')
|
|
50
|
+
|
|
51
|
+
const icon = page.locator('.tiny-rate__star > .tiny-svg')
|
|
52
|
+
const text = page.locator('.tiny-rate .tiny-rate__text')
|
|
53
|
+
|
|
54
|
+
await page.waitForTimeout(100)
|
|
55
|
+
|
|
56
|
+
// 点击第1个星星
|
|
57
|
+
await icon.nth(0).click()
|
|
58
|
+
await page.waitForTimeout(100)
|
|
59
|
+
let currentText = await text.textContent()
|
|
60
|
+
expect(['很差', '非常差', '差'].some((t) => currentText.includes(t))).toBeTruthy()
|
|
61
|
+
|
|
62
|
+
// 再次点击第1个星星,应该清零
|
|
63
|
+
await icon.nth(0).click()
|
|
64
|
+
await page.waitForTimeout(100)
|
|
65
|
+
currentText = await text.textContent()
|
|
66
|
+
expect(currentText === '' || currentText.includes('未评分')).toBeTruthy()
|
|
67
|
+
|
|
68
|
+
// 点击第4个星星
|
|
69
|
+
await icon.nth(3).click()
|
|
70
|
+
await page.waitForTimeout(100)
|
|
71
|
+
currentText = await text.textContent()
|
|
72
|
+
expect(['好', '良好', '不错'].some((t) => currentText.includes(t))).toBeTruthy()
|
|
73
|
+
})
|
|
74
|
+
})
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="demo-rate">
|
|
3
|
+
<p>可清空的评分</p>
|
|
4
|
+
<tiny-rate v-model="rate1" :clearable="true" show-text></tiny-rate>
|
|
5
|
+
<p>当前值:{{ rate1 }}</p>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
import { TinyRate } from '@opentiny/vue'
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
components: {
|
|
14
|
+
TinyRate
|
|
15
|
+
},
|
|
16
|
+
data() {
|
|
17
|
+
return {
|
|
18
|
+
rate1: 3
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<style scoped>
|
|
25
|
+
.demo-rate {
|
|
26
|
+
padding: 20px;
|
|
27
|
+
}
|
|
28
|
+
</style>
|
|
@@ -203,6 +203,18 @@ export default {
|
|
|
203
203
|
},
|
|
204
204
|
codeFiles: ['threshold-value.vue']
|
|
205
205
|
},
|
|
206
|
+
{
|
|
207
|
+
demoId: 'clearable',
|
|
208
|
+
name: {
|
|
209
|
+
'zh-CN': '可清空',
|
|
210
|
+
'en-US': 'Clearable'
|
|
211
|
+
},
|
|
212
|
+
desc: {
|
|
213
|
+
'zh-CN': '<p>可通过 <code>clearable</code> 设置是否支持清空。</p>\n',
|
|
214
|
+
'en-US': '<p>You can use <code>clearable</code> to set whether to support clearing. </p>\n'
|
|
215
|
+
},
|
|
216
|
+
codeFiles: ['clearable.vue']
|
|
217
|
+
},
|
|
206
218
|
{
|
|
207
219
|
demoId: 'rate-events',
|
|
208
220
|
name: {
|
|
@@ -5,7 +5,7 @@ test('事件是否正常触发', async ({ page }) => {
|
|
|
5
5
|
await page.goto('search#events')
|
|
6
6
|
|
|
7
7
|
const modal = page.locator('.tiny-modal')
|
|
8
|
-
const input = page.
|
|
8
|
+
const input = page.getByRole('searchbox', { name: 'search' })
|
|
9
9
|
const button = page.locator('.tiny-search__input-btn > a').first()
|
|
10
10
|
|
|
11
11
|
await button.click()
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="demo-append-body">
|
|
3
|
+
<tiny-search-box
|
|
4
|
+
v-model="tags"
|
|
5
|
+
:items="items"
|
|
6
|
+
editable
|
|
7
|
+
panel-max-height="160px"
|
|
8
|
+
:append-to-body="false"
|
|
9
|
+
/>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup>
|
|
14
|
+
import { ref } from 'vue'
|
|
15
|
+
import TinySearchBox from '@opentiny/vue-search-box'
|
|
16
|
+
|
|
17
|
+
const tags = ref([])
|
|
18
|
+
const items = ref([
|
|
19
|
+
{
|
|
20
|
+
label: "名称",
|
|
21
|
+
field: "testName",
|
|
22
|
+
replace: true,
|
|
23
|
+
options: [
|
|
24
|
+
{
|
|
25
|
+
label: "ecs-1"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: "obs-2"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: "vpc-1"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
label: "evs-2"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: "tms-1"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
// 该种单选情况没有可选项。
|
|
43
|
+
label: "名称1",
|
|
44
|
+
field: "testName1"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: "可用地区",
|
|
48
|
+
field: "testRegion",
|
|
49
|
+
type: "checkbox",
|
|
50
|
+
options: [
|
|
51
|
+
{
|
|
52
|
+
label: "华南区",
|
|
53
|
+
id: "2-1"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
label: "华北区",
|
|
57
|
+
id: "2-2"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
label: "西北区",
|
|
61
|
+
id: "2-3"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: "西南区",
|
|
65
|
+
id: "2-4"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
label: "可用地区1",
|
|
71
|
+
field: "testRegion1",
|
|
72
|
+
type: "checkbox",
|
|
73
|
+
options: [
|
|
74
|
+
{
|
|
75
|
+
label: "华南区1",
|
|
76
|
+
id: "2-11",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
label: "华北区1",
|
|
80
|
+
id: "2-21"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
label: "西北区1",
|
|
84
|
+
id: "2-31"
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
label: "状态",
|
|
90
|
+
type: "checkbox",
|
|
91
|
+
field: "status",
|
|
92
|
+
options: [
|
|
93
|
+
{
|
|
94
|
+
label: "运行中"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
label: "已关机"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
label: "已注销"
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
label: "产品规格",
|
|
106
|
+
field: "product",
|
|
107
|
+
options: [
|
|
108
|
+
{
|
|
109
|
+
label: "1vCPUs"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
label: "2vCPUs"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
label: "3vCPUs"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
label: "2vGPUs"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
label: "3vGPUs"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
label: "4vGPUs"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
label: "5vGPUs"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
label: "6vGPUs"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
label: "7vGPUs"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
label: "8vGPUs"
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
label: "个人IP地址",
|
|
142
|
+
field: "ip",
|
|
143
|
+
// 单选此类可以设置此参数为true
|
|
144
|
+
replace: true,
|
|
145
|
+
options: [
|
|
146
|
+
{
|
|
147
|
+
label: "192.168.0.1"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
label: "192.168.0.2"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
label: "192.168.0.3"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
label: "192.168.0.4"
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
label: "实例ID",
|
|
162
|
+
field: "id",
|
|
163
|
+
options: [
|
|
164
|
+
{
|
|
165
|
+
label: "huaweiyun-ID",
|
|
166
|
+
allValues: false
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
label: "yunlingtuandui-ID"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
label: "tiny-vue-plus-search-box-ID"
|
|
173
|
+
}
|
|
174
|
+
]
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
label: "大小",
|
|
178
|
+
field: "size",
|
|
179
|
+
type: "numRange",
|
|
180
|
+
unit: "GB",
|
|
181
|
+
start: -1,
|
|
182
|
+
min: -1,
|
|
183
|
+
max: 20
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
label: "日期",
|
|
187
|
+
field: "date",
|
|
188
|
+
type: "dateRange",
|
|
189
|
+
format: "yyyy/MM/dd", // 默认格式
|
|
190
|
+
// 默认开始时间
|
|
191
|
+
start: new Date(),
|
|
192
|
+
// 默认结束时间
|
|
193
|
+
end: undefined,
|
|
194
|
+
// 最小时间
|
|
195
|
+
min: new Date(),
|
|
196
|
+
max: new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 30)
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
label: "时间日期",
|
|
200
|
+
field: "datetime",
|
|
201
|
+
type: "datetimeRange",
|
|
202
|
+
format: "yyyy/MM/dd HH:mm:ss", // 默认格式
|
|
203
|
+
// 默认开始时间
|
|
204
|
+
start: new Date(2024, 3, 10, 10, 23, 45),
|
|
205
|
+
// 默认结束时间
|
|
206
|
+
end: new Date(2024, 5, 25, 10, 25, 46),
|
|
207
|
+
// 最小时间
|
|
208
|
+
min: new Date(2024, 3, 5, 10, 5, 5),
|
|
209
|
+
max: undefined
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
label: "标签",
|
|
213
|
+
field: "testTag",
|
|
214
|
+
type: "map",
|
|
215
|
+
searchKeys: ["label", "id"],
|
|
216
|
+
options: [
|
|
217
|
+
{
|
|
218
|
+
label: "aaa",
|
|
219
|
+
id: "id-1",
|
|
220
|
+
allValues: false,
|
|
221
|
+
options: [
|
|
222
|
+
{
|
|
223
|
+
label: "空值",
|
|
224
|
+
id: "aaa-ddd"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
label: "所有值",
|
|
228
|
+
id: "aaa-eee"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
label: "123",
|
|
232
|
+
id: "aaa-fff"
|
|
233
|
+
},
|
|
234
|
+
],
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
label: "bbb",
|
|
238
|
+
id: "id-2",
|
|
239
|
+
options: [
|
|
240
|
+
{
|
|
241
|
+
label: "hhh",
|
|
242
|
+
id: "bbb-hhh"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
label: "iii",
|
|
246
|
+
id: "bbb-iii"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
label: "jjj",
|
|
250
|
+
id: "bbb-jjj"
|
|
251
|
+
},
|
|
252
|
+
],
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
label: "ccc",
|
|
256
|
+
id: "id-3",
|
|
257
|
+
options: [
|
|
258
|
+
{
|
|
259
|
+
label: "kkk",
|
|
260
|
+
id: "ccc-kkk"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
label: "lll",
|
|
264
|
+
id: "ccc-lll"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
label: "mmm",
|
|
268
|
+
id: "ccc-mmm"
|
|
269
|
+
}
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
]
|
|
273
|
+
}
|
|
274
|
+
])
|
|
275
|
+
</script>
|
|
276
|
+
|
|
277
|
+
<style scoped>
|
|
278
|
+
.demo-append-body {
|
|
279
|
+
display: flex;
|
|
280
|
+
flex-direction: column;
|
|
281
|
+
gap: 12px;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.demo-box {
|
|
285
|
+
padding: 12px;
|
|
286
|
+
border: 1px solid var(--vp-c-divider);
|
|
287
|
+
border-radius: 8px;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.demo-title {
|
|
291
|
+
margin-bottom: 8px;
|
|
292
|
+
font-size: 14px;
|
|
293
|
+
color: var(--vp-c-text-1);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.with-overflow {
|
|
297
|
+
max-width: 480px;
|
|
298
|
+
overflow: hidden;
|
|
299
|
+
}
|
|
300
|
+
</style>
|