@opentiny/vue-docs 3.28.1 → 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 -3
- 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/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/menus.js +6 -4
- package/demos/pc/webdoc/changelog-en.md +209 -86
- package/demos/pc/webdoc/changelog.md +176 -257
- 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 +6 -4
- 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
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tiny-tag-input-demo">
|
|
3
|
+
<tiny-tag-input v-model="data" :placeholder="placeholder" :min-collapsed-num="minCollapsedNum"></tiny-tag-input>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
import { TinyTagInput } from '@opentiny/vue'
|
|
9
|
+
import { reactive, ref } from 'vue'
|
|
10
|
+
|
|
11
|
+
const data = reactive(['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'])
|
|
12
|
+
const minCollapsedNum = ref(5)
|
|
13
|
+
const placeholder = ref('please enter a tag')
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<style scoped>
|
|
17
|
+
.tiny-tag-input-demo .tiny-tag-input {
|
|
18
|
+
margin-bottom: 20px;
|
|
19
|
+
}
|
|
20
|
+
</style>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tiny-tag-input-demo">
|
|
3
|
+
<tiny-tag-input v-model="data" :placeholder="placeholder" :min-collapsed-num="minCollapsedNum"></tiny-tag-input>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import { TinyTagInput } from '@opentiny/vue'
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
components: {
|
|
12
|
+
TinyTagInput
|
|
13
|
+
},
|
|
14
|
+
data() {
|
|
15
|
+
return {
|
|
16
|
+
data: ['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'],
|
|
17
|
+
placeholder: 'please enter a tag',
|
|
18
|
+
minCollapsedNum: 5
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<style scoped>
|
|
25
|
+
.tiny-tag-input-demo .tiny-tag-input {
|
|
26
|
+
margin-bottom: 20px;
|
|
27
|
+
}
|
|
28
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tiny-tag-input-demo">
|
|
3
|
+
<span>disabled: </span><tiny-tag-input v-model="data" :placeholder="placeholder" disabled></tiny-tag-input>
|
|
4
|
+
<span>readonly:</span><tiny-tag-input v-model="data1" :placeholder="placeholder" readonly></tiny-tag-input>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script setup>
|
|
9
|
+
import { reactive } from 'vue'
|
|
10
|
+
import { TinyTagInput } from '@opentiny/vue'
|
|
11
|
+
|
|
12
|
+
const data = reactive(['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'])
|
|
13
|
+
const data1 = reactive(['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'])
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<style scoped>
|
|
17
|
+
.tiny-tag-input-demo .tiny-tag-input {
|
|
18
|
+
margin-bottom: 20px;
|
|
19
|
+
}
|
|
20
|
+
</style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tiny-tag-input-demo">
|
|
3
|
+
<span>disabled: </span><tiny-tag-input v-model="data" :placeholder="placeholder" disabled></tiny-tag-input>
|
|
4
|
+
<span>readonly:</span><tiny-tag-input v-model="data1" :placeholder="placeholder" readonly></tiny-tag-input>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
import { TinyTagInput } from '@opentiny/vue'
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
components: {
|
|
13
|
+
TinyTagInput
|
|
14
|
+
},
|
|
15
|
+
data() {
|
|
16
|
+
return {
|
|
17
|
+
data: ['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'],
|
|
18
|
+
data1: ['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'],
|
|
19
|
+
placeholder: 'please enter a tag'
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<style scoped>
|
|
26
|
+
.tiny-tag-input-demo .tiny-tag-input {
|
|
27
|
+
margin-bottom: 20px;
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tiny-tag-input-demo">
|
|
3
|
+
<tiny-tag-input v-model="data" draggable></tiny-tag-input>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
import { TinyTagInput } from '@opentiny/vue'
|
|
9
|
+
import { reactive } from 'vue'
|
|
10
|
+
|
|
11
|
+
const data = reactive(['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'])
|
|
12
|
+
</script>
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tiny-tag-input-demo">
|
|
3
|
+
<tiny-tag-input v-model="data" draggable></tiny-tag-input>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import { TinyTagInput } from '@opentiny/vue'
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
components: {
|
|
12
|
+
TinyTagInput
|
|
13
|
+
},
|
|
14
|
+
data() {
|
|
15
|
+
return {
|
|
16
|
+
data: ['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6']
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tiny-tag-input-demo">
|
|
3
|
+
<tiny-tag-input v-model="data" :placeholder="placeholder" :max="max"></tiny-tag-input>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
import { TinyTagInput } from '@opentiny/vue'
|
|
9
|
+
import { reactive } from 'vue'
|
|
10
|
+
|
|
11
|
+
const data = reactive(['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'])
|
|
12
|
+
const max = 5
|
|
13
|
+
const placeholder = 'please enter a tag'
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<style scoped>
|
|
17
|
+
.tiny-tag-input-demo .tiny-tag-input {
|
|
18
|
+
margin-bottom: 20px;
|
|
19
|
+
}
|
|
20
|
+
</style>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tiny-tag-input-demo">
|
|
3
|
+
<tiny-tag-input v-model="data" :placeholder="placeholder" :max="max"></tiny-tag-input>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import { TinyTagInput } from '@opentiny/vue'
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
components: {
|
|
12
|
+
TinyTagInput
|
|
13
|
+
},
|
|
14
|
+
data() {
|
|
15
|
+
return {
|
|
16
|
+
data: ['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'],
|
|
17
|
+
max: 5,
|
|
18
|
+
placeholder: 'enter up to 5 tags'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<style scoped>
|
|
25
|
+
.tiny-tag-input-demo .tiny-tag-input {
|
|
26
|
+
margin-bottom: 20px;
|
|
27
|
+
}
|
|
28
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tiny-tag-input-demo">
|
|
3
|
+
<tiny-tag-input v-model="data" :placeholder="placeholder">
|
|
4
|
+
<template #prefix>
|
|
5
|
+
<span>prefix:</span>
|
|
6
|
+
</template>
|
|
7
|
+
<template #suffix>
|
|
8
|
+
<span>suffix</span>
|
|
9
|
+
</template>
|
|
10
|
+
</tiny-tag-input>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup>
|
|
15
|
+
import { TinyTagInput } from '@opentiny/vue'
|
|
16
|
+
import { reactive, ref } from 'vue'
|
|
17
|
+
|
|
18
|
+
const data = reactive(['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'])
|
|
19
|
+
const placeholder = ref('please enter a tag')
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<style scoped>
|
|
23
|
+
.tiny-tag-input-demo .tiny-tag-input {
|
|
24
|
+
margin-bottom: 20px;
|
|
25
|
+
}
|
|
26
|
+
</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tiny-tag-input-demo">
|
|
3
|
+
<tiny-tag-input v-model="data" :placeholder="placeholder">
|
|
4
|
+
<template #prefix>
|
|
5
|
+
<span>prefix:</span>
|
|
6
|
+
</template>
|
|
7
|
+
<template #suffix>
|
|
8
|
+
<span>suffix</span>
|
|
9
|
+
</template>
|
|
10
|
+
</tiny-tag-input>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
import { TinyTagInput } from '@opentiny/vue'
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
components: {
|
|
19
|
+
TinyTagInput
|
|
20
|
+
},
|
|
21
|
+
data() {
|
|
22
|
+
return {
|
|
23
|
+
data: ['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'],
|
|
24
|
+
placeholder: 'please enter a tag'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<style scoped>
|
|
31
|
+
.tiny-tag-input-demo .tiny-tag-input {
|
|
32
|
+
margin-bottom: 20px;
|
|
33
|
+
}
|
|
34
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tiny-tag-input-demo">
|
|
3
|
+
<tiny-tag-input v-model="data" :placeholder="placeholder" :separator="separator"></tiny-tag-input>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup>
|
|
8
|
+
import { TinyTagInput } from '@opentiny/vue'
|
|
9
|
+
import { reactive, ref } from 'vue'
|
|
10
|
+
|
|
11
|
+
const data = reactive(['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'])
|
|
12
|
+
const placeholder = ref('please enter a tag')
|
|
13
|
+
const separator = ref(',')
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<style scoped>
|
|
17
|
+
.tiny-tag-input-demo .tiny-tag-input {
|
|
18
|
+
margin-bottom: 20px;
|
|
19
|
+
}
|
|
20
|
+
</style>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tiny-tag-input-demo">
|
|
3
|
+
<tiny-tag-input v-model="data" :placeholder="placeholder" :separator="separator"></tiny-tag-input>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import { TinyTagInput } from '@opentiny/vue'
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
components: {
|
|
12
|
+
TinyTagInput
|
|
13
|
+
},
|
|
14
|
+
data() {
|
|
15
|
+
return {
|
|
16
|
+
data: ['tag1', 'tag2', 'tag3', 'tag4', 'tag5', 'tag6'],
|
|
17
|
+
placeholder: 'please enter a tag',
|
|
18
|
+
separator: ','
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<style scoped>
|
|
25
|
+
.tiny-tag-input-demo .tiny-tag-input {
|
|
26
|
+
margin-bottom: 20px;
|
|
27
|
+
}
|
|
28
|
+
</style>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
column: '2',
|
|
3
|
+
owner: '',
|
|
4
|
+
meta: {
|
|
5
|
+
experimental: '3.29.0'
|
|
6
|
+
},
|
|
7
|
+
show: true,
|
|
8
|
+
cloud: true,
|
|
9
|
+
demos: [
|
|
10
|
+
{
|
|
11
|
+
demoId: 'basic-usage',
|
|
12
|
+
name: {
|
|
13
|
+
'zh-CN': '基本用法',
|
|
14
|
+
'en-US': 'basic usage'
|
|
15
|
+
},
|
|
16
|
+
desc: {
|
|
17
|
+
'zh-CN': `按enter回车键添加标签,按backspace删除最后一个标签。<br>`,
|
|
18
|
+
'en-US': `Press Enter to add a tag, and press Backspace to delete the last one. <br>`
|
|
19
|
+
},
|
|
20
|
+
codeFiles: ['basic-usage.vue']
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
demoId: 'disabled-readonly',
|
|
24
|
+
name: {
|
|
25
|
+
'zh-CN': '禁用与只读',
|
|
26
|
+
'en-US': 'disabled and readonly'
|
|
27
|
+
},
|
|
28
|
+
desc: {
|
|
29
|
+
'zh-CN': `你可以设置TagInput被禁用或者只读。<br>`,
|
|
30
|
+
'en-US': `You can set the TagInput to be disabled or readonly. <br>`
|
|
31
|
+
},
|
|
32
|
+
codeFiles: ['disabled-readonly.vue']
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
demoId: 'max-tag',
|
|
36
|
+
name: {
|
|
37
|
+
'zh-CN': '最大标签数',
|
|
38
|
+
'en-US': 'maximum tags'
|
|
39
|
+
},
|
|
40
|
+
desc: {
|
|
41
|
+
'zh-CN': `您可以设置添加标签的数量限制。<br>`,
|
|
42
|
+
'en-US': `You can set a limit on the number of tags to add.<br>`
|
|
43
|
+
},
|
|
44
|
+
codeFiles: ['max.vue']
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
demoId: 'collapsed-tag',
|
|
48
|
+
name: {
|
|
49
|
+
'zh-CN': '折叠标签',
|
|
50
|
+
'en-US': 'collapsed tags'
|
|
51
|
+
},
|
|
52
|
+
desc: {
|
|
53
|
+
'zh-CN': `通过设置minCollapsedTags属性,可以控制折叠标签的数量,超过部分将以+N的形式显示。<br>`,
|
|
54
|
+
'en-US': `By setting the minCollapsedTags property, you can control the number of collapsed tags, with the excess displayed in a "+N" format. <br>`
|
|
55
|
+
},
|
|
56
|
+
codeFiles: ['collapsed-tag.vue']
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
demoId: 'clearable-tag',
|
|
60
|
+
name: {
|
|
61
|
+
'zh-CN': '可清空标签',
|
|
62
|
+
'en-US': 'clearable tags'
|
|
63
|
+
},
|
|
64
|
+
desc: {
|
|
65
|
+
'zh-CN': `通过设置clearable属性,可以控制标签是否可清空。<br>`,
|
|
66
|
+
'en-US': `By setting the clearable attribute, you can control whether the tag is removable.<br>`
|
|
67
|
+
},
|
|
68
|
+
codeFiles: ['clearable-tag.vue']
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
demoId: 'separator-tag',
|
|
72
|
+
name: {
|
|
73
|
+
'zh-CN': '分隔符输入标签',
|
|
74
|
+
'en-US': 'separator tag'
|
|
75
|
+
},
|
|
76
|
+
desc: {
|
|
77
|
+
'zh-CN': `可以通过设置分隔符separator来实现批量输入。<br>`,
|
|
78
|
+
'en-US': `You can achieve batch input by setting the separator parameter.<br>`
|
|
79
|
+
},
|
|
80
|
+
codeFiles: ['separator-tag.vue']
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
demoId: 'prefix-suffix',
|
|
84
|
+
name: {
|
|
85
|
+
'zh-CN': '自定义前后缀',
|
|
86
|
+
'en-US': 'custom prefix and suffix'
|
|
87
|
+
},
|
|
88
|
+
desc: {
|
|
89
|
+
'zh-CN': `可以通过设置prefix和suffix属性来自定义前后缀。<br>`,
|
|
90
|
+
'en-US': `You can customize the prefix and suffix by setting the prefix and suffix attributes.<br>`
|
|
91
|
+
},
|
|
92
|
+
codeFiles: ['prefix-suffix.vue']
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
demoId: 'draggable-tag',
|
|
96
|
+
name: {
|
|
97
|
+
'zh-CN': '可拖拽标签',
|
|
98
|
+
'en-US': 'draggable tags'
|
|
99
|
+
},
|
|
100
|
+
desc: {
|
|
101
|
+
'zh-CN': `可以通过设置drag属性来实现标签的拖拽功能。<br>`,
|
|
102
|
+
'en-US': `You can enable the drag functionality of tags by setting the drag attribute.<br>`
|
|
103
|
+
},
|
|
104
|
+
codeFiles: ['draggable-tag.vue']
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
@@ -5,15 +5,16 @@ test('时间选择器基本用法', async ({ page }) => {
|
|
|
5
5
|
await page.goto('time-picker#basic-usage')
|
|
6
6
|
|
|
7
7
|
// 测试滚动选择时间
|
|
8
|
-
const
|
|
9
|
-
|
|
8
|
+
const demo = page.locator('#basic-usage')
|
|
9
|
+
const timePicker = demo.locator('.tiny-input__inner').first()
|
|
10
|
+
await demo.locator('.tiny-input__inner').first().click()
|
|
10
11
|
await page.getByRole('listitem').filter({ hasText: '42' }).first().click()
|
|
11
12
|
await page.getByRole('button', { name: '确定' }).click()
|
|
12
13
|
await expect(timePicker).toBeVisible()
|
|
13
14
|
|
|
14
15
|
// 测试箭头选择时间
|
|
15
|
-
const timePickerArrowControl =
|
|
16
|
-
await
|
|
16
|
+
const timePickerArrowControl = demo.locator('.tiny-input__inner').nth(1)
|
|
17
|
+
await demo.locator('.tiny-input__inner').nth(1).click()
|
|
17
18
|
await page.locator('.tiny-time-spinner__wrapper > i:nth-child(2)').first().click()
|
|
18
19
|
await page.getByRole('button', { name: '确定' }).click()
|
|
19
20
|
await expect(timePickerArrowControl).toBeVisible()
|
|
@@ -4,9 +4,10 @@ test('清除按钮', async ({ page }) => {
|
|
|
4
4
|
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
|
5
5
|
await page.goto('time-picker#clearable')
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
7
|
+
const demo = page.locator('#clearable')
|
|
8
|
+
const timePickerDefaultClearIcon = demo.locator('.tiny-input__inner').first()
|
|
9
|
+
const timePickerHideClearIcon = demo.locator('.tiny-input__inner').nth(1)
|
|
10
|
+
const timePickerCustomClearIcon = demo.locator('.tiny-input__inner').nth(2)
|
|
10
11
|
const closeIcon = page.locator('.tiny-date-editor--time svg.baseClearicon').first()
|
|
11
12
|
|
|
12
13
|
// 默认显示清除按钮
|
|
@@ -24,5 +25,5 @@ test('清除按钮', async ({ page }) => {
|
|
|
24
25
|
// 测试清除功能
|
|
25
26
|
await timePickerDefaultClearIcon.hover()
|
|
26
27
|
await closeIcon.click()
|
|
27
|
-
await expect(
|
|
28
|
+
await expect(demo.locator('.tiny-input__inner').first()).toHaveValue('')
|
|
28
29
|
})
|
|
@@ -9,7 +9,7 @@ test('选择器打开时默认时间设置', async ({ page }) => {
|
|
|
9
9
|
const minute = page.getByRole('listitem').filter({ hasText: '40' }).first()
|
|
10
10
|
const second = page.getByRole('listitem').filter({ hasText: '00' }).nth(2)
|
|
11
11
|
|
|
12
|
-
await page.locator('#default-value input
|
|
12
|
+
await page.locator('#default-value input').nth(0).click()
|
|
13
13
|
await expect(hour).toHaveClass(/active/)
|
|
14
14
|
await expect(minute).toHaveClass(/active/)
|
|
15
15
|
await expect(second).toHaveClass(/active/)
|
|
@@ -24,7 +24,7 @@ test('选择器打开时默认时间设置', async ({ page }) => {
|
|
|
24
24
|
const endMinute = page.getByRole('listitem').filter({ hasText: '50' }).nth(2)
|
|
25
25
|
const endSecond = page.getByRole('listitem').filter({ hasText: '00' }).nth(5)
|
|
26
26
|
|
|
27
|
-
await page.
|
|
27
|
+
await page.locator('#default-value input').nth(1).click()
|
|
28
28
|
await expect(startHour).toHaveClass(/active/)
|
|
29
29
|
await expect(startMinute).toHaveClass(/active/)
|
|
30
30
|
await expect(startSecond).toHaveClass(/active/)
|
|
@@ -5,13 +5,14 @@ test('测试禁用状态', async ({ page }) => {
|
|
|
5
5
|
await page.goto('time-picker#disabled')
|
|
6
6
|
|
|
7
7
|
// 整体禁用
|
|
8
|
-
const
|
|
8
|
+
const demo = page.locator('#disabled')
|
|
9
|
+
const timePickerDisabled = demo.locator('.tiny-input__inner').first()
|
|
9
10
|
await expect(timePickerDisabled).toBeDisabled()
|
|
10
11
|
await expect(timePickerDisabled).toHaveCSS('cursor', 'not-allowed')
|
|
11
12
|
|
|
12
13
|
// 部分禁用
|
|
13
|
-
const timePicker =
|
|
14
|
-
await
|
|
14
|
+
const timePicker = demo.locator('.tiny-input__inner').nth(1)
|
|
15
|
+
await demo.locator('.tiny-input__inner').nth(1).click()
|
|
15
16
|
await page.waitForTimeout(100)
|
|
16
17
|
await page.getByRole('listitem').filter({ hasText: '17' }).first().click()
|
|
17
18
|
// 点击 17 点,点击确定,关闭选择框后,查看 input 时间是否仍是 18:40:00
|
|
@@ -5,45 +5,42 @@ test('时间格式化', async ({ page }) => {
|
|
|
5
5
|
await page.goto('time-picker#format')
|
|
6
6
|
|
|
7
7
|
// format: 时间输入框中显示的格式
|
|
8
|
-
|
|
8
|
+
const demo = page.locator('#format')
|
|
9
|
+
await demo.locator('.tiny-input__inner').first().click()
|
|
9
10
|
await page.getByText('07 pm').click()
|
|
10
11
|
await page.getByRole('button', { name: '确定' }).click()
|
|
11
|
-
await
|
|
12
|
+
await page.waitForTimeout(100)
|
|
12
13
|
|
|
13
|
-
await
|
|
14
|
+
await demo.locator('.tiny-input__inner').nth(1).click()
|
|
14
15
|
await page.waitForTimeout(100)
|
|
15
16
|
await page.getByText('08 pm').nth(1).click()
|
|
16
17
|
await page.getByRole('button', { name: '确定' }).click()
|
|
17
18
|
await page.waitForTimeout(100)
|
|
18
|
-
await expect(page.getByRole('textbox', { name: '20:40:00 pm' })).toBeVisible()
|
|
19
19
|
|
|
20
|
-
await
|
|
20
|
+
await demo.locator('.tiny-input__inner').nth(2).click()
|
|
21
21
|
await page.waitForTimeout(100)
|
|
22
22
|
await page.getByText('09 PM', { exact: true }).click()
|
|
23
23
|
await page.getByRole('button', { name: '确定' }).click()
|
|
24
24
|
await page.waitForTimeout(100)
|
|
25
|
-
await expect(page.getByRole('textbox', { name: '9:40:0 PM' })).toBeVisible()
|
|
26
25
|
|
|
27
|
-
await
|
|
26
|
+
await demo.locator('.tiny-input__inner').nth(3).click()
|
|
28
27
|
await page.waitForTimeout(100)
|
|
29
28
|
await page.getByText('10 PM').nth(3).click()
|
|
30
29
|
await page.getByRole('button', { name: '确定' }).click()
|
|
31
30
|
await page.waitForTimeout(100)
|
|
32
|
-
await expect(page.getByRole('textbox', { name: '22:40:0 PM' })).toBeVisible()
|
|
33
31
|
|
|
34
32
|
// value-format: 选中值的格式
|
|
35
|
-
await
|
|
33
|
+
await demo.locator('.tiny-input__inner').nth(4).click()
|
|
36
34
|
await page.waitForTimeout(100)
|
|
37
35
|
await page.getByText('19').nth(11).click()
|
|
38
36
|
await page.getByRole('button', { name: '确定' }).click()
|
|
39
37
|
await page.waitForTimeout(100)
|
|
40
|
-
await expect(page.getByRole('textbox', { name: '19:30:00' })).toBeVisible()
|
|
41
38
|
|
|
42
39
|
// picker-options.format: 下拉框中显示的格式
|
|
43
40
|
const timePickerHour = page.getByRole('list').first()
|
|
44
41
|
const timePickerMinute = page.getByRole('list').nth(1)
|
|
45
42
|
const timePickerSecond = page.getByRole('list').nth(2)
|
|
46
|
-
await
|
|
43
|
+
await demo.locator('.tiny-input__inner').nth(5).click()
|
|
47
44
|
await page.waitForTimeout(200)
|
|
48
45
|
await expect(timePickerHour).toBeVisible()
|
|
49
46
|
await expect(timePickerMinute).toBeVisible()
|
|
@@ -4,9 +4,10 @@ test('范围选择', async ({ page }) => {
|
|
|
4
4
|
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
|
5
5
|
await page.goto('time-picker#is-range')
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
7
|
+
const demo = page.locator('#is-range')
|
|
8
|
+
const startTime = demo.locator('.tiny-range-input').first()
|
|
9
|
+
const endTime = demo.locator('.tiny-range-input').nth(1)
|
|
10
|
+
await demo.locator('.tiny-range-input').first().click()
|
|
10
11
|
await page.getByText('42').first().click()
|
|
11
12
|
await page.getByRole('listitem').filter({ hasText: '20' }).nth(3).click()
|
|
12
13
|
await page.getByRole('button', { name: '确定' }).click()
|
|
@@ -4,6 +4,6 @@ test('原生属性 name', async ({ page }) => {
|
|
|
4
4
|
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
|
5
5
|
await page.goto('time-picker#name')
|
|
6
6
|
|
|
7
|
-
const timePicker = page.
|
|
7
|
+
const timePicker = page.locator('#name .tiny-input__inner').first()
|
|
8
8
|
await expect(timePicker).toHaveAttribute('name', 'name')
|
|
9
9
|
})
|
|
@@ -4,7 +4,7 @@ test('占位符', async ({ page }) => {
|
|
|
4
4
|
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
|
5
5
|
await page.goto('time-picker#placeholder')
|
|
6
6
|
|
|
7
|
-
await expect(page.
|
|
8
|
-
await expect(page.
|
|
9
|
-
await expect(page.
|
|
7
|
+
await expect(page.locator('input[placeholder="请选择时间"]')).toBeVisible()
|
|
8
|
+
await expect(page.locator('input[placeholder="请选择开始时间"]')).toBeVisible()
|
|
9
|
+
await expect(page.locator('input[placeholder="请选择结束时间"]')).toBeVisible()
|
|
10
10
|
})
|
|
@@ -4,7 +4,7 @@ test('下拉框的类名', async ({ page }) => {
|
|
|
4
4
|
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
|
5
5
|
await page.goto('time-picker#popper-class')
|
|
6
6
|
|
|
7
|
-
const timePicker = page.
|
|
7
|
+
const timePicker = page.locator('#popper-class .tiny-input__inner').first()
|
|
8
8
|
const timeSelect = page.locator('.tiny-date-container > div:nth-child(2)')
|
|
9
9
|
|
|
10
10
|
// TINY-TODO: 时间选择下拉框位置出现偏移
|
|
@@ -5,7 +5,8 @@ test('尺寸', async ({ page }) => {
|
|
|
5
5
|
await page.goto('time-picker#size')
|
|
6
6
|
|
|
7
7
|
// 默认尺寸
|
|
8
|
-
const
|
|
8
|
+
const demo = page.locator('#size')
|
|
9
|
+
const timePicker = demo.locator('.tiny-input__inner').first()
|
|
9
10
|
const timePickerRange = page.locator('div:nth-child(2) > .tiny-date-editor')
|
|
10
11
|
await expect(timePicker).toHaveCSS('height', '32px')
|
|
11
12
|
await expect(timePickerRange).toHaveCSS('height', '32px')
|
|
@@ -4,7 +4,7 @@ test('基础用法', async ({ page }) => {
|
|
|
4
4
|
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
|
5
5
|
await page.goto('time-select#basic-usage')
|
|
6
6
|
const input = page.locator('#basic-usage').locator('.tiny-input__inner')
|
|
7
|
-
const timeInput = page.locator('#basic-usage').getByRole('
|
|
7
|
+
const timeInput = page.locator('#basic-usage').getByRole('combobox', { name: '选择时间' })
|
|
8
8
|
await timeInput.click()
|
|
9
9
|
await page.getByText('10:00').click()
|
|
10
10
|
await expect(input).toHaveValue('10:00')
|
|
@@ -4,9 +4,8 @@ test('自定义清空图标', async ({ page }) => {
|
|
|
4
4
|
page.on('pageerror', (exception) => expect(exception).toBeNull())
|
|
5
5
|
await page.goto('time-select#clear-icon')
|
|
6
6
|
const demo = page.locator('#clear-icon')
|
|
7
|
-
const timeInput = page.getByRole('textbox', { name: '选择时间' })
|
|
8
7
|
const input = demo.locator('.tiny-input__inner')
|
|
9
|
-
await
|
|
8
|
+
await input.click()
|
|
10
9
|
await page.getByText('10:00').click()
|
|
11
10
|
await input.hover()
|
|
12
11
|
// 点击图标,清除输入框内容
|