@datametria/vue-components 2.2.0 → 2.3.1
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/README.md +25 -7
- package/dist/index.es.js +3378 -2148
- package/dist/index.umd.js +9 -9
- package/dist/src/components/DatametriaAutocomplete.vue.d.ts +14 -17
- package/dist/src/components/DatametriaBreadcrumb.vue.d.ts +39 -7
- package/dist/src/components/DatametriaCheckbox.vue.d.ts +35 -6
- package/dist/src/components/DatametriaCheckboxGroup.vue.d.ts +30 -0
- package/dist/src/components/DatametriaDataTable.vue.d.ts +64 -0
- package/dist/src/components/DatametriaDatePicker.vue.d.ts +15 -37
- package/dist/src/components/DatametriaDialog.vue.d.ts +71 -0
- package/dist/src/components/DatametriaEmpty.vue.d.ts +30 -0
- package/dist/src/components/DatametriaFloatingBar.vue.d.ts +2 -2
- package/dist/src/components/DatametriaForm.vue.d.ts +40 -0
- package/dist/src/components/DatametriaFormItem.vue.d.ts +28 -0
- package/dist/src/components/DatametriaGrid.vue.d.ts +1 -1
- package/dist/src/components/DatametriaInput.vue.d.ts +69 -10
- package/dist/src/components/DatametriaMenu.vue.d.ts +3 -3
- package/dist/src/components/DatametriaNavbar.vue.d.ts +2 -2
- package/dist/src/components/DatametriaPagination.vue.d.ts +29 -0
- package/dist/src/components/DatametriaPopconfirm.vue.d.ts +43 -0
- package/dist/src/components/DatametriaProgress.vue.d.ts +33 -8
- package/dist/src/components/DatametriaRadio.vue.d.ts +25 -6
- package/dist/src/components/DatametriaRadioGroup.vue.d.ts +29 -0
- package/dist/src/components/DatametriaResult.vue.d.ts +30 -0
- package/dist/src/components/DatametriaSelect.vue.d.ts +16 -11
- package/dist/src/components/DatametriaSidebar.vue.d.ts +3 -3
- package/dist/src/components/DatametriaSlider.vue.d.ts +3 -3
- package/dist/src/components/DatametriaSortableTable.vue.d.ts +1 -1
- package/dist/src/components/DatametriaSteps.vue.d.ts +45 -0
- package/dist/src/components/DatametriaSwitch.vue.d.ts +9 -4
- package/dist/src/components/DatametriaTabPane.vue.d.ts +28 -0
- package/dist/src/components/DatametriaTextarea.vue.d.ts +27 -8
- package/dist/src/components/DatametriaTimePicker.vue.d.ts +17 -25
- package/dist/src/components/DatametriaToast.vue.d.ts +1 -1
- package/dist/src/components/DatametriaTooltip.vue.d.ts +1 -1
- package/dist/src/components/DatametriaTree.vue.d.ts +31 -0
- package/dist/src/components/DatametriaTreeNode.vue.d.ts +17 -0
- package/dist/src/components/DatametriaUpload.vue.d.ts +64 -0
- package/dist/src/index.d.ts +14 -0
- package/dist/vue-components.css +1 -1
- package/package.json +8 -10
- package/src/components/DatametriaAutocomplete.vue +155 -260
- package/src/components/DatametriaBreadcrumb.vue +66 -80
- package/src/components/DatametriaCheckbox.vue +150 -37
- package/src/components/DatametriaCheckboxGroup.vue +43 -0
- package/src/components/DatametriaDataTable.vue +304 -0
- package/src/components/DatametriaDatePicker.vue +238 -614
- package/src/components/DatametriaDialog.vue +295 -0
- package/src/components/DatametriaDropdown.vue +352 -0
- package/src/components/DatametriaEmpty.vue +153 -0
- package/src/components/DatametriaForm.vue +160 -0
- package/src/components/DatametriaFormItem.vue +181 -0
- package/src/components/DatametriaInput.vue +226 -63
- package/src/components/DatametriaPagination.vue +373 -0
- package/src/components/DatametriaPopconfirm.vue +236 -0
- package/src/components/DatametriaProgress.vue +176 -63
- package/src/components/DatametriaRadio.vue +83 -72
- package/src/components/DatametriaRadioGroup.vue +42 -0
- package/src/components/DatametriaResult.vue +133 -0
- package/src/components/DatametriaSelect.vue +172 -67
- package/src/components/DatametriaSortableTable.vue +35 -4
- package/src/components/DatametriaSteps.vue +314 -0
- package/src/components/DatametriaSwitch.vue +86 -80
- package/src/components/DatametriaTabPane.vue +82 -0
- package/src/components/DatametriaTextarea.vue +140 -100
- package/src/components/DatametriaTimePicker.vue +231 -214
- package/src/components/DatametriaTree.vue +124 -0
- package/src/components/DatametriaTreeNode.vue +174 -0
- package/src/components/DatametriaUpload.vue +365 -0
- package/src/index.ts +25 -11
- package/src/components/__tests__/DatametriaAutocomplete.test.ts +0 -180
- package/src/components/__tests__/DatametriaBreadcrumb.test.ts +0 -75
- package/src/components/__tests__/DatametriaCheckbox.test.ts +0 -47
- package/src/components/__tests__/DatametriaDatePicker.test.ts +0 -234
- package/src/components/__tests__/DatametriaProgress.test.ts +0 -90
- package/src/components/__tests__/DatametriaRadio.test.ts +0 -77
- package/src/components/__tests__/DatametriaSwitch.test.ts +0 -64
- package/src/components/__tests__/DatametriaTextarea.test.ts +0 -66
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest'
|
|
2
|
-
import { mount } from '@vue/test-utils'
|
|
3
|
-
import DatametriaRadio from '../DatametriaRadio.vue'
|
|
4
|
-
|
|
5
|
-
describe('DatametriaRadio', () => {
|
|
6
|
-
it('renders correctly', () => {
|
|
7
|
-
const wrapper = mount(DatametriaRadio, {
|
|
8
|
-
props: { value: 'option1' }
|
|
9
|
-
})
|
|
10
|
-
expect(wrapper.find('.dm-radio').exists()).toBe(true)
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
it('renders label when provided', () => {
|
|
14
|
-
const wrapper = mount(DatametriaRadio, {
|
|
15
|
-
props: { value: 'option1', label: 'Option 1' }
|
|
16
|
-
})
|
|
17
|
-
expect(wrapper.find('.dm-radio__text').text()).toBe('Option 1')
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
it('checks radio when modelValue matches value', () => {
|
|
21
|
-
const wrapper = mount(DatametriaRadio, {
|
|
22
|
-
props: { value: 'option1', modelValue: 'option1' }
|
|
23
|
-
})
|
|
24
|
-
expect((wrapper.find('input').element as HTMLInputElement).checked).toBe(true)
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
it('emits update:modelValue on change', async () => {
|
|
28
|
-
const wrapper = mount(DatametriaRadio, {
|
|
29
|
-
props: { value: 'option1' }
|
|
30
|
-
})
|
|
31
|
-
await wrapper.find('input').trigger('change')
|
|
32
|
-
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual(['option1'])
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
it('applies disabled state', () => {
|
|
36
|
-
const wrapper = mount(DatametriaRadio, {
|
|
37
|
-
props: { value: 'option1', disabled: true }
|
|
38
|
-
})
|
|
39
|
-
expect(wrapper.find('input').attributes('disabled')).toBeDefined()
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
it('does not emit when disabled', async () => {
|
|
43
|
-
const wrapper = mount(DatametriaRadio, {
|
|
44
|
-
props: { value: 'option1', disabled: true }
|
|
45
|
-
})
|
|
46
|
-
await wrapper.find('input').trigger('change')
|
|
47
|
-
expect(wrapper.emitted('update:modelValue')).toBeUndefined()
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
it('shows error message when provided', () => {
|
|
51
|
-
const wrapper = mount(DatametriaRadio, {
|
|
52
|
-
props: { value: 'option1', name: 'test', error: 'Error text' }
|
|
53
|
-
})
|
|
54
|
-
expect(wrapper.find('.dm-radio__error').text()).toBe('Error text')
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
it('applies name attribute', () => {
|
|
58
|
-
const wrapper = mount(DatametriaRadio, {
|
|
59
|
-
props: { value: 'option1', name: 'radio-group' }
|
|
60
|
-
})
|
|
61
|
-
expect(wrapper.find('input').attributes('name')).toBe('radio-group')
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
it('applies aria-label', () => {
|
|
65
|
-
const wrapper = mount(DatametriaRadio, {
|
|
66
|
-
props: { value: 'option1', ariaLabel: 'Select option' }
|
|
67
|
-
})
|
|
68
|
-
expect(wrapper.find('input').attributes('aria-label')).toBe('Select option')
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
it('uses CSS variables with fallbacks', () => {
|
|
72
|
-
const wrapper = mount(DatametriaRadio, {
|
|
73
|
-
props: { value: 'option1' }
|
|
74
|
-
})
|
|
75
|
-
expect(wrapper.html()).toContain('dm-radio')
|
|
76
|
-
})
|
|
77
|
-
})
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest'
|
|
2
|
-
import { mount } from '@vue/test-utils'
|
|
3
|
-
import DatametriaSwitch from '../DatametriaSwitch.vue'
|
|
4
|
-
|
|
5
|
-
describe('DatametriaSwitch', () => {
|
|
6
|
-
it('renders correctly', () => {
|
|
7
|
-
const wrapper = mount(DatametriaSwitch)
|
|
8
|
-
expect(wrapper.find('.dm-switch').exists()).toBe(true)
|
|
9
|
-
})
|
|
10
|
-
|
|
11
|
-
it('renders label when provided', () => {
|
|
12
|
-
const wrapper = mount(DatametriaSwitch, {
|
|
13
|
-
props: { label: 'Enable feature' }
|
|
14
|
-
})
|
|
15
|
-
expect(wrapper.find('.dm-switch__text').text()).toBe('Enable feature')
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
it('binds checked state correctly', () => {
|
|
19
|
-
const wrapper = mount(DatametriaSwitch, {
|
|
20
|
-
props: { modelValue: true }
|
|
21
|
-
})
|
|
22
|
-
expect((wrapper.find('input').element as HTMLInputElement).checked).toBe(true)
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
it('emits update:modelValue on change', async () => {
|
|
26
|
-
const wrapper = mount(DatametriaSwitch)
|
|
27
|
-
await wrapper.find('input').setValue(true)
|
|
28
|
-
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual([true])
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
it('applies disabled state', () => {
|
|
32
|
-
const wrapper = mount(DatametriaSwitch, {
|
|
33
|
-
props: { disabled: true }
|
|
34
|
-
})
|
|
35
|
-
expect(wrapper.find('input').attributes('disabled')).toBeDefined()
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
it('does not emit when disabled', async () => {
|
|
39
|
-
const wrapper = mount(DatametriaSwitch, {
|
|
40
|
-
props: { disabled: true }
|
|
41
|
-
})
|
|
42
|
-
await wrapper.find('input').trigger('change')
|
|
43
|
-
expect(wrapper.emitted('update:modelValue')).toBeUndefined()
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
it('shows error message', () => {
|
|
47
|
-
const wrapper = mount(DatametriaSwitch, {
|
|
48
|
-
props: { error: 'Error text' }
|
|
49
|
-
})
|
|
50
|
-
expect(wrapper.find('.dm-switch__error').text()).toBe('Error text')
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
it('applies aria-label', () => {
|
|
54
|
-
const wrapper = mount(DatametriaSwitch, {
|
|
55
|
-
props: { ariaLabel: 'Toggle feature' }
|
|
56
|
-
})
|
|
57
|
-
expect(wrapper.find('input').attributes('aria-label')).toBe('Toggle feature')
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
it('has role switch', () => {
|
|
61
|
-
const wrapper = mount(DatametriaSwitch)
|
|
62
|
-
expect(wrapper.find('input').attributes('role')).toBe('switch')
|
|
63
|
-
})
|
|
64
|
-
})
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest'
|
|
2
|
-
import { mount } from '@vue/test-utils'
|
|
3
|
-
import DatametriaTextarea from '../DatametriaTextarea.vue'
|
|
4
|
-
|
|
5
|
-
describe('DatametriaTextarea', () => {
|
|
6
|
-
it('renders correctly', () => {
|
|
7
|
-
const wrapper = mount(DatametriaTextarea)
|
|
8
|
-
expect(wrapper.find('.dm-textarea').exists()).toBe(true)
|
|
9
|
-
})
|
|
10
|
-
|
|
11
|
-
it('renders label when provided', () => {
|
|
12
|
-
const wrapper = mount(DatametriaTextarea, {
|
|
13
|
-
props: { label: 'Textarea Label' }
|
|
14
|
-
})
|
|
15
|
-
expect(wrapper.find('.dm-textarea__label').text()).toContain('Textarea Label')
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
it('shows required indicator', () => {
|
|
19
|
-
const wrapper = mount(DatametriaTextarea, {
|
|
20
|
-
props: { label: 'Test', required: true }
|
|
21
|
-
})
|
|
22
|
-
expect(wrapper.find('.dm-textarea__required').exists()).toBe(true)
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
it('binds modelValue correctly', () => {
|
|
26
|
-
const wrapper = mount(DatametriaTextarea, {
|
|
27
|
-
props: { modelValue: 'test value' }
|
|
28
|
-
})
|
|
29
|
-
expect((wrapper.find('textarea').element as HTMLTextAreaElement).value).toBe('test value')
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
it('emits update:modelValue on input', async () => {
|
|
33
|
-
const wrapper = mount(DatametriaTextarea)
|
|
34
|
-
await wrapper.find('textarea').setValue('new value')
|
|
35
|
-
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual(['new value'])
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
it('applies disabled state', () => {
|
|
39
|
-
const wrapper = mount(DatametriaTextarea, {
|
|
40
|
-
props: { disabled: true }
|
|
41
|
-
})
|
|
42
|
-
expect(wrapper.find('textarea').attributes('disabled')).toBeDefined()
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
it('shows error message', () => {
|
|
46
|
-
const wrapper = mount(DatametriaTextarea, {
|
|
47
|
-
props: { error: 'Error text' }
|
|
48
|
-
})
|
|
49
|
-
expect(wrapper.find('.dm-textarea__error').text()).toBe('Error text')
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
it('shows character counter when maxLength provided', () => {
|
|
53
|
-
const wrapper = mount(DatametriaTextarea, {
|
|
54
|
-
props: { maxLength: 100, modelValue: 'test' }
|
|
55
|
-
})
|
|
56
|
-
expect(wrapper.find('.dm-textarea__counter').exists()).toBe(true)
|
|
57
|
-
expect(wrapper.find('.dm-textarea__counter').text()).toContain('4/100')
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
it('applies custom rows', () => {
|
|
61
|
-
const wrapper = mount(DatametriaTextarea, {
|
|
62
|
-
props: { rows: 10 }
|
|
63
|
-
})
|
|
64
|
-
expect(wrapper.find('textarea').attributes('rows')).toBe('10')
|
|
65
|
-
})
|
|
66
|
-
})
|