niuma-ui 1.0.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/CHANGELOG.md +29 -0
- package/LICENSE +202 -0
- package/NOTICE +25 -0
- package/README.en.md +99 -0
- package/README.md +161 -0
- package/package.json +106 -0
- package/src/__tests__/RsBadge.spec.ts +40 -0
- package/src/__tests__/RsBreadcrumb.spec.ts +172 -0
- package/src/__tests__/RsButton.spec.ts +108 -0
- package/src/__tests__/RsCalendarGrid.spec.ts +82 -0
- package/src/__tests__/RsCard.spec.ts +97 -0
- package/src/__tests__/RsCheckbox.spec.ts +36 -0
- package/src/__tests__/RsCodeEditor.spec.ts +111 -0
- package/src/__tests__/RsConfirmDialog.spec.ts +158 -0
- package/src/__tests__/RsContainer.spec.ts +89 -0
- package/src/__tests__/RsContextMenu.spec.ts +118 -0
- package/src/__tests__/RsDatePicker.spec.ts +88 -0
- package/src/__tests__/RsDateTimePicker.spec.ts +69 -0
- package/src/__tests__/RsDialog.spec.ts +404 -0
- package/src/__tests__/RsDrawer.spec.ts +145 -0
- package/src/__tests__/RsDropdown.spec.ts +135 -0
- package/src/__tests__/RsEmpty.spec.ts +99 -0
- package/src/__tests__/RsForm.spec.ts +173 -0
- package/src/__tests__/RsIcon.spec.ts +244 -0
- package/src/__tests__/RsInput.spec.ts +269 -0
- package/src/__tests__/RsInputNumber.spec.ts +118 -0
- package/src/__tests__/RsLabel.spec.ts +106 -0
- package/src/__tests__/RsLink.spec.ts +49 -0
- package/src/__tests__/RsLoading.spec.ts +84 -0
- package/src/__tests__/RsMarkdown.spec.ts +143 -0
- package/src/__tests__/RsMenu.spec.ts +119 -0
- package/src/__tests__/RsNewComponents.spec.ts +17 -0
- package/src/__tests__/RsPagination.spec.ts +158 -0
- package/src/__tests__/RsPopover.spec.ts +126 -0
- package/src/__tests__/RsScrollbar.spec.ts +53 -0
- package/src/__tests__/RsSelect.spec.ts +291 -0
- package/src/__tests__/RsSidebar.spec.ts +119 -0
- package/src/__tests__/RsSplitPane.spec.ts +177 -0
- package/src/__tests__/RsStatCard.spec.ts +79 -0
- package/src/__tests__/RsSteps.spec.ts +125 -0
- package/src/__tests__/RsTable.perf.spec.ts +103 -0
- package/src/__tests__/RsTable.spec.ts +1135 -0
- package/src/__tests__/RsTabs.spec.ts +328 -0
- package/src/__tests__/RsTerminal.spec.ts +218 -0
- package/src/__tests__/RsTimePicker.spec.ts +77 -0
- package/src/__tests__/RsToaster.spec.ts +95 -0
- package/src/__tests__/RsToolbar.spec.ts +75 -0
- package/src/__tests__/RsTooltip.spec.ts +111 -0
- package/src/__tests__/RsTree.spec.ts +572 -0
- package/src/__tests__/RsUpload.spec.ts +160 -0
- package/src/__tests__/RsVirtualList.spec.ts +77 -0
- package/src/__tests__/date-picker-utils.spec.ts +70 -0
- package/src/__tests__/dialog-viewport.spec.ts +38 -0
- package/src/__tests__/iso-local-datetime.spec.ts +58 -0
- package/src/__tests__/rs-clipboard.spec.ts +142 -0
- package/src/__tests__/setup.ts +12 -0
- package/src/__tests__/split-pane-utils.spec.ts +136 -0
- package/src/__tests__/table-drag.spec.ts +35 -0
- package/src/__tests__/table-edit-utils.spec.ts +194 -0
- package/src/__tests__/table-utils.spec.ts +286 -0
- package/src/__tests__/theme.spec.ts +22 -0
- package/src/__tests__/tree-utils.spec.ts +234 -0
- package/src/__tests__/useTableCellTooltip.spec.ts +101 -0
- package/src/components/RsAvatar.vue +115 -0
- package/src/components/RsBadge.vue +59 -0
- package/src/components/RsBreadcrumb.vue +65 -0
- package/src/components/RsBreadcrumbItems.vue +36 -0
- package/src/components/RsButton.vue +393 -0
- package/src/components/RsCalendarGrid.vue +284 -0
- package/src/components/RsCard.vue +237 -0
- package/src/components/RsCheckbox.vue +189 -0
- package/src/components/RsCodeBlock.vue +278 -0
- package/src/components/RsCodeEditor.vue +597 -0
- package/src/components/RsConfigProvider.vue +92 -0
- package/src/components/RsConfirmDialog.vue +178 -0
- package/src/components/RsContainer.vue +235 -0
- package/src/components/RsContextMenu.vue +238 -0
- package/src/components/RsContextMenuItems.vue +77 -0
- package/src/components/RsDatePicker.vue +756 -0
- package/src/components/RsDateTimePicker.vue +42 -0
- package/src/components/RsDialog.vue +486 -0
- package/src/components/RsDrawer.vue +175 -0
- package/src/components/RsDropdown.vue +252 -0
- package/src/components/RsDropdownItems.vue +90 -0
- package/src/components/RsEmpty.vue +107 -0
- package/src/components/RsForm.vue +131 -0
- package/src/components/RsIcon.vue +104 -0
- package/src/components/RsInput.vue +1101 -0
- package/src/components/RsInputNumber.vue +532 -0
- package/src/components/RsLabel.vue +54 -0
- package/src/components/RsLink.vue +106 -0
- package/src/components/RsLoading.vue +171 -0
- package/src/components/RsMarkdown.vue +329 -0
- package/src/components/RsMenu.vue +256 -0
- package/src/components/RsMenuItems.vue +125 -0
- package/src/components/RsMonacoEditor.vue +541 -0
- package/src/components/RsPagination.vue +184 -0
- package/src/components/RsPopover.vue +77 -0
- package/src/components/RsProseEditor.vue +160 -0
- package/src/components/RsScrollbar.vue +171 -0
- package/src/components/RsSelect.vue +1045 -0
- package/src/components/RsSidebar.vue +121 -0
- package/src/components/RsSidebarGroup.vue +32 -0
- package/src/components/RsSidebarItem.vue +72 -0
- package/src/components/RsSplitPane.vue +619 -0
- package/src/components/RsStatCard.vue +85 -0
- package/src/components/RsSteps.vue +138 -0
- package/src/components/RsTable.vue +2664 -0
- package/src/components/RsTableColgroup.vue +17 -0
- package/src/components/RsTableHeaderRow.vue +30 -0
- package/src/components/RsTabs.vue +951 -0
- package/src/components/RsTerminal.vue +697 -0
- package/src/components/RsTimePicker.vue +554 -0
- package/src/components/RsTimePickerColumns.vue +226 -0
- package/src/components/RsToaster.vue +396 -0
- package/src/components/RsToolbar.vue +135 -0
- package/src/components/RsTooltip.vue +142 -0
- package/src/components/RsTooltipProvider.vue +20 -0
- package/src/components/RsTree.vue +1248 -0
- package/src/components/RsUpload.vue +279 -0
- package/src/components/RsVirtualList.vue +217 -0
- package/src/components/avatar-utils.ts +19 -0
- package/src/components/breadcrumb-utils.ts +19 -0
- package/src/components/class-utils.ts +29 -0
- package/src/components/code-editor-utils.ts +106 -0
- package/src/components/code-mirror-completion.ts +40 -0
- package/src/components/code-mirror-diagnostics.ts +52 -0
- package/src/components/code-mirror-ghost.ts +158 -0
- package/src/components/code-mirror-inline-edit.ts +55 -0
- package/src/components/code-mirror-intel.ts +81 -0
- package/src/components/code-mirror-lang.ts +128 -0
- package/src/components/context-menu-utils.ts +20 -0
- package/src/components/date-picker-utils.ts +284 -0
- package/src/components/date-range-validation.ts +29 -0
- package/src/components/date-validation.ts +38 -0
- package/src/components/dialog-viewport.ts +48 -0
- package/src/components/dialog-window.ts +253 -0
- package/src/components/dropdown-utils.ts +31 -0
- package/src/components/form-utils.ts +77 -0
- package/src/components/input-number-utils.ts +128 -0
- package/src/components/input-rules.ts +84 -0
- package/src/components/loading-utils.ts +8 -0
- package/src/components/markdown-utils.ts +126 -0
- package/src/components/menu-utils.ts +48 -0
- package/src/components/overlay-utils.ts +47 -0
- package/src/components/pagination-utils.ts +38 -0
- package/src/components/popover-utils.ts +8 -0
- package/src/components/reka.ts +106 -0
- package/src/components/resolve-radius.ts +22 -0
- package/src/components/resolve-size.ts +29 -0
- package/src/components/scrollbar-utils.ts +10 -0
- package/src/components/select-utils.ts +72 -0
- package/src/components/split-pane-utils.ts +187 -0
- package/src/components/steps-utils.ts +22 -0
- package/src/components/table/RsTableBodyRow.vue +287 -0
- package/src/components/table/RsTableCell.vue +239 -0
- package/src/components/table/RsTableCellContent.ts +18 -0
- package/src/components/table/RsTableCellEditor.vue +351 -0
- package/src/components/table/RsTableEditGutter.vue +54 -0
- package/src/components/table/RsTableHeaderFilter.vue +107 -0
- package/src/components/table/RsTableRowStatus.vue +69 -0
- package/src/components/table/rs-table.css +1141 -0
- package/src/components/table/table-context-menu.ts +53 -0
- package/src/components/table/table-edit-utils.ts +496 -0
- package/src/components/table/table-keys.ts +12 -0
- package/src/components/table-drag.ts +215 -0
- package/src/components/table-utils.ts +950 -0
- package/src/components/tabs-utils.ts +107 -0
- package/src/components/terminal-utils.ts +301 -0
- package/src/components/terminal-wheel.ts +49 -0
- package/src/components/time-picker-utils.ts +167 -0
- package/src/components/time-range-validation.ts +23 -0
- package/src/components/time-validation.ts +20 -0
- package/src/components/tree-utils.ts +518 -0
- package/src/components/upload-utils.ts +55 -0
- package/src/components/virtual-list-utils.ts +17 -0
- package/src/composables/useClickOutside.ts +22 -0
- package/src/composables/useRsConfig.ts +91 -0
- package/src/composables/useRsI18n.ts +22 -0
- package/src/composables/useRsTabsNav.ts +187 -0
- package/src/composables/useRsToast.ts +48 -0
- package/src/composables/useTableCellTooltip.ts +239 -0
- package/src/composables/useTableEdit.ts +271 -0
- package/src/composables/useTableRowHighlight.ts +50 -0
- package/src/dev/vite-codemirror-deps.ts +20 -0
- package/src/icons/custom/api.ts +54 -0
- package/src/icons/custom/clickhouse.ts +52 -0
- package/src/icons/custom/dameng.ts +83 -0
- package/src/icons/custom/ftp.ts +61 -0
- package/src/icons/custom/kingbase.ts +52 -0
- package/src/icons/custom/mongodb.ts +50 -0
- package/src/icons/custom/mysql.ts +51 -0
- package/src/icons/custom/oracle.ts +52 -0
- package/src/icons/custom/redis.ts +51 -0
- package/src/icons/custom/sqlite.ts +50 -0
- package/src/icons/custom/sqlserver.ts +52 -0
- package/src/icons/custom/vastbase.ts +57 -0
- package/src/icons/lucide.ts +78 -0
- package/src/icons/registry.ts +35 -0
- package/src/index.ts +425 -0
- package/src/lib/iso-local-datetime.ts +152 -0
- package/src/lib/rs-dayjs.ts +56 -0
- package/src/locale/messages.ts +362 -0
- package/src/locale/types.ts +5 -0
- package/src/monaco/debug-decorations.css +20 -0
- package/src/monaco/debug-decorations.ts +70 -0
- package/src/monaco/index.ts +22 -0
- package/src/monaco/languages/index.ts +21 -0
- package/src/monaco/languages/mongodb-shell.ts +125 -0
- package/src/monaco/languages/types.ts +55 -0
- package/src/monaco/setup.ts +101 -0
- package/src/styles.css +1040 -0
- package/src/theme/apply.ts +12 -0
- package/src/theme/brand.example.css +37 -0
- package/src/theme/presets.ts +69 -0
- package/src/theme/types.ts +81 -0
- package/src/utils/rs-clipboard.ts +272 -0
- package/src/vite-env.d.ts +7 -0
- package/vite-plugins/monaco-zh-nls.ts +101 -0
- package/vite-plugins/silence-antlr-parse-console.ts +29 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import RsSteps from '../components/RsSteps.vue'
|
|
4
|
+
import { isStepSeparatorCompleted, resolveStepStatus } from '../components/steps-utils'
|
|
5
|
+
|
|
6
|
+
const items = [
|
|
7
|
+
{ value: 'a', title: '步骤 A', description: '描述 A' },
|
|
8
|
+
{ value: 'b', title: '步骤 B' },
|
|
9
|
+
{ value: 'c', title: '步骤 C' },
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
describe('steps-utils', () => {
|
|
13
|
+
it('resolveStepStatus derives finish/process/wait from active index', () => {
|
|
14
|
+
expect(resolveStepStatus(0, 1)).toBe('finish')
|
|
15
|
+
expect(resolveStepStatus(1, 1)).toBe('process')
|
|
16
|
+
expect(resolveStepStatus(2, 1)).toBe('wait')
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
it('resolveStepStatus prefers explicit status', () => {
|
|
20
|
+
expect(resolveStepStatus(1, 0, 'error')).toBe('error')
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
it('isStepSeparatorCompleted is true only for finish', () => {
|
|
24
|
+
expect(isStepSeparatorCompleted('finish')).toBe(true)
|
|
25
|
+
expect(isStepSeparatorCompleted('process')).toBe(false)
|
|
26
|
+
})
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
describe('RsSteps', () => {
|
|
30
|
+
it('renders all step titles and descriptions', () => {
|
|
31
|
+
const wrapper = mount(RsSteps, {
|
|
32
|
+
props: { items, modelValue: 'b' },
|
|
33
|
+
})
|
|
34
|
+
expect(wrapper.text()).toContain('步骤 A')
|
|
35
|
+
expect(wrapper.text()).toContain('描述 A')
|
|
36
|
+
expect(wrapper.text()).toContain('步骤 B')
|
|
37
|
+
expect(wrapper.text()).toContain('步骤 C')
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
it('applies auto-derived status classes', () => {
|
|
41
|
+
const wrapper = mount(RsSteps, {
|
|
42
|
+
props: { items, modelValue: 'b' },
|
|
43
|
+
})
|
|
44
|
+
const stepItems = wrapper.findAll('.rs-steps__item')
|
|
45
|
+
expect(stepItems[0]?.classes()).toContain('rs-steps__item--finish')
|
|
46
|
+
expect(stepItems[1]?.classes()).toContain('rs-steps__item--process')
|
|
47
|
+
expect(stepItems[2]?.classes()).toContain('rs-steps__item--wait')
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
it('applies explicit status when provided', () => {
|
|
51
|
+
const wrapper = mount(RsSteps, {
|
|
52
|
+
props: {
|
|
53
|
+
items: [
|
|
54
|
+
{ value: 'a', title: 'A', status: 'finish' as const },
|
|
55
|
+
{ value: 'b', title: 'B', status: 'error' as const },
|
|
56
|
+
],
|
|
57
|
+
modelValue: 'a',
|
|
58
|
+
},
|
|
59
|
+
})
|
|
60
|
+
const stepItems = wrapper.findAll('.rs-steps__item')
|
|
61
|
+
expect(stepItems[1]?.classes()).toContain('rs-steps__item--error')
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
it('renders horizontal layout and md size by default', () => {
|
|
65
|
+
const wrapper = mount(RsSteps, {
|
|
66
|
+
props: { items, modelValue: 'a' },
|
|
67
|
+
})
|
|
68
|
+
expect(wrapper.find('.rs-steps').classes()).toContain('rs-steps--horizontal')
|
|
69
|
+
expect(wrapper.find('.rs-steps').classes()).toContain('rs-steps--md')
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
it('renders vertical and sm modifiers', () => {
|
|
73
|
+
const wrapper = mount(RsSteps, {
|
|
74
|
+
props: { items, modelValue: 'a', orientation: 'vertical', size: 'sm' },
|
|
75
|
+
})
|
|
76
|
+
expect(wrapper.find('.rs-steps').classes()).toContain('rs-steps--vertical')
|
|
77
|
+
expect(wrapper.find('.rs-steps').classes()).toContain('rs-steps--sm')
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
it('renders separators between items but not after the last', () => {
|
|
81
|
+
const wrapper = mount(RsSteps, {
|
|
82
|
+
props: { items, modelValue: 'a' },
|
|
83
|
+
})
|
|
84
|
+
expect(wrapper.findAll('.rs-steps__separator')).toHaveLength(items.length - 1)
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
it('disables triggers when not clickable', () => {
|
|
88
|
+
const wrapper = mount(RsSteps, {
|
|
89
|
+
props: { items, modelValue: 'a' },
|
|
90
|
+
})
|
|
91
|
+
wrapper.findAll('.rs-steps__trigger').forEach((trigger) => {
|
|
92
|
+
expect((trigger.element as HTMLButtonElement).disabled).toBe(true)
|
|
93
|
+
})
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
it('updates model when a clickable step is selected', async () => {
|
|
97
|
+
const wrapper = mount(RsSteps, {
|
|
98
|
+
props: { items, modelValue: 'a', clickable: true },
|
|
99
|
+
})
|
|
100
|
+
await wrapper.findAll('.rs-steps__trigger')[1]?.trigger('click')
|
|
101
|
+
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual(['b'])
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
it('does not update model when disabled step is clicked', async () => {
|
|
105
|
+
const wrapper = mount(RsSteps, {
|
|
106
|
+
props: {
|
|
107
|
+
items: [
|
|
108
|
+
{ value: 'a', title: 'A' },
|
|
109
|
+
{ value: 'b', title: 'B', disabled: true },
|
|
110
|
+
],
|
|
111
|
+
modelValue: 'a',
|
|
112
|
+
clickable: true,
|
|
113
|
+
},
|
|
114
|
+
})
|
|
115
|
+
await wrapper.findAll('.rs-steps__trigger')[1]?.trigger('click')
|
|
116
|
+
expect(wrapper.emitted('update:modelValue')).toBeUndefined()
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
it('falls back to first step when model value is unknown', () => {
|
|
120
|
+
const wrapper = mount(RsSteps, {
|
|
121
|
+
props: { items, modelValue: 'missing' },
|
|
122
|
+
})
|
|
123
|
+
expect(wrapper.findAll('.rs-steps__item')[0]?.classes()).toContain('rs-steps__item--process')
|
|
124
|
+
})
|
|
125
|
+
})
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils'
|
|
2
|
+
import { describe, expect, it } from 'vitest'
|
|
3
|
+
import RsTable from '../components/RsTable.vue'
|
|
4
|
+
|
|
5
|
+
function makeRows(count: number) {
|
|
6
|
+
return Array.from({ length: count }, (_, i) => ({
|
|
7
|
+
id: String(i),
|
|
8
|
+
name: `row-${i}`,
|
|
9
|
+
count: i % 100,
|
|
10
|
+
status: i % 2 === 0 ? 'ok' : 'wait',
|
|
11
|
+
}))
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const columns = [
|
|
15
|
+
{ key: 'name', title: '名称', width: 120 },
|
|
16
|
+
{ key: 'count', title: '数量', width: 80, align: 'right' as const },
|
|
17
|
+
{ key: 'status', title: '状态', width: 80 },
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
const editableColumns = [
|
|
21
|
+
{ key: 'name', title: '名称', width: 120, editable: true },
|
|
22
|
+
{ key: 'count', title: '数量', width: 80, align: 'right' as const, editable: true, valueType: 'number' as const },
|
|
23
|
+
{
|
|
24
|
+
key: 'status',
|
|
25
|
+
title: '状态',
|
|
26
|
+
width: 100,
|
|
27
|
+
editable: true,
|
|
28
|
+
valueType: 'select' as const,
|
|
29
|
+
editorOptions: {
|
|
30
|
+
options: [
|
|
31
|
+
{ value: 'ok', label: 'OK' },
|
|
32
|
+
{ value: 'wait', label: 'Wait' },
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
describe('RsTable performance baselines', () => {
|
|
39
|
+
it('mounts 3000 readonly rows within budget', () => {
|
|
40
|
+
const data = makeRows(3000)
|
|
41
|
+
const started = performance.now()
|
|
42
|
+
const wrapper = mount(RsTable, {
|
|
43
|
+
props: {
|
|
44
|
+
columns,
|
|
45
|
+
data,
|
|
46
|
+
rowKey: 'id',
|
|
47
|
+
virtual: true,
|
|
48
|
+
height: 480,
|
|
49
|
+
},
|
|
50
|
+
})
|
|
51
|
+
const elapsed = performance.now() - started
|
|
52
|
+
expect(wrapper.find('.rs-table').exists()).toBe(true)
|
|
53
|
+
// jsdom 下偏松:主要防止回归爆炸(本机通常远低于此)
|
|
54
|
+
expect(elapsed).toBeLessThan(8000)
|
|
55
|
+
wrapper.unmount()
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
it('editable flag does not explode mount cost vs readonly', () => {
|
|
59
|
+
const data = makeRows(2000)
|
|
60
|
+
const readonlyStart = performance.now()
|
|
61
|
+
const readonlyWrapper = mount(RsTable, {
|
|
62
|
+
props: { columns, data, rowKey: 'id', virtual: true, height: 480 },
|
|
63
|
+
})
|
|
64
|
+
const readonlyElapsed = performance.now() - readonlyStart
|
|
65
|
+
readonlyWrapper.unmount()
|
|
66
|
+
|
|
67
|
+
const editableStart = performance.now()
|
|
68
|
+
const editableWrapper = mount(RsTable, {
|
|
69
|
+
props: {
|
|
70
|
+
columns: editableColumns,
|
|
71
|
+
data,
|
|
72
|
+
rowKey: 'id',
|
|
73
|
+
editable: true,
|
|
74
|
+
virtual: true,
|
|
75
|
+
height: 480,
|
|
76
|
+
},
|
|
77
|
+
})
|
|
78
|
+
const editableElapsed = performance.now() - editableStart
|
|
79
|
+
// 编辑关闭时不挂编辑器,成本应接近只读(允许一定抖动)
|
|
80
|
+
expect(editableElapsed).toBeLessThan(readonlyElapsed * 3 + 2000)
|
|
81
|
+
expect(editableWrapper.find('.rs-table-cell-editor').exists()).toBe(false)
|
|
82
|
+
editableWrapper.unmount()
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
it('opening one editor keeps editor count at 1', async () => {
|
|
86
|
+
const data = makeRows(500)
|
|
87
|
+
const wrapper = mount(RsTable, {
|
|
88
|
+
props: {
|
|
89
|
+
columns: editableColumns,
|
|
90
|
+
data,
|
|
91
|
+
rowKey: 'id',
|
|
92
|
+
editable: true,
|
|
93
|
+
virtual: true,
|
|
94
|
+
height: 480,
|
|
95
|
+
},
|
|
96
|
+
})
|
|
97
|
+
const cells = wrapper.findAll('.rs-table__cell-body--editable')
|
|
98
|
+
expect(cells.length).toBeGreaterThan(0)
|
|
99
|
+
await cells[0]!.trigger('dblclick')
|
|
100
|
+
expect(wrapper.findAll('.rs-table-cell-editor')).toHaveLength(1)
|
|
101
|
+
wrapper.unmount()
|
|
102
|
+
})
|
|
103
|
+
})
|