@shoprenter/sr-styleguide 1.0.0 → 1.2.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/README.md +138 -18
- package/dist/demo/src/demo_bootstrap_js.css +26 -26
- package/dist/demo/src/demo_bootstrap_js.js +1 -1
- package/dist/demo/src/index.html +1 -1
- package/dist/stylesheet/sr-styleguide.css +6 -6
- package/package.json +4 -5
- package/src/components/app-containers/SrModule/SrModule.scss +1 -1
- package/src/components/app-containers/SrModule/SrModule.vue +19 -8
- package/src/components/app-containers/SrPage/SrPage.vue +19 -16
- package/src/components/app-containers/scope.js +12 -0
- package/src/components/breadcrumbs/SrBreadcrumbs/SrBreadcrumbs.scss +47 -0
- package/src/components/breadcrumbs/SrBreadcrumbs/SrBreadcrumbs.vue +46 -0
- package/src/components/breadcrumbs/tests/SrBreadcrumbs.spec.js +109 -0
- package/src/components/form/SrFormDivider/SrFormDivider.scss +4 -0
- package/src/components/form/SrFormDivider/SrFormDivider.vue +9 -0
- package/src/components/form/SrFormRow/SrFormRow.scss +21 -21
- package/src/components/form/SrFormRow/SrFormRow.vue +3 -2
- package/src/components/inputs/SrCheckbox/SrCheckbox.vue +13 -1
- package/src/components/inputs/SrCheckbox/tests/SrCheckbox.spec.js +39 -0
- package/src/components/inputs/SrDatePicker/SrDatePicker.vue +4 -1
- package/src/components/inputs/SrMultiCheckbox/BaseMultiCheckbox.vue +43 -0
- package/src/components/inputs/SrMultiCheckbox/SrMultiCheckbox.vue +10 -55
- package/src/components/inputs/SrMultiCheckbox/SrSimpleMultiCheckbox.vue +52 -0
- package/src/components/inputs/SrMultiCheckbox/mixin/SrMultiCheckboxMixin.js +26 -0
- package/src/components/inputs/SrMultiCheckbox/tests/SrMultiCheckbox.spec.js +49 -43
- package/src/components/inputs/SrMultiCheckbox/tests/SrSimpleMultiCheckbox.spec.js +104 -0
- package/src/components/inputs/SrRadio/SrRadioGroup.vue +7 -1
- package/src/components/inputs/SrRadio/tests/SrRadioGroup.spec.js +38 -0
- package/src/components/inputs/SrSelect/SrSelect.vue +8 -1
- package/src/components/inputs/SrSwitch/SrSwitch.vue +0 -1
- package/src/components/inputs/SrTextarea/SrTextarea.vue +20 -0
- package/src/components/layouts/slim/SrSlimHeading/SrSlimHeading.scss +9 -0
- package/src/components/layouts/slim/SrSlimHeading/SrSlimHeading.vue +2 -2
- package/src/components/layouts/slim/SrSlimLayout/SrSlimLayout.scss +12 -0
- package/src/components/layouts/slim/SrSlimLayout/SrSlimLayout.vue +8 -0
- package/src/components/layouts/standard/SrStandardLayout/SrStandardLayout.scss +4 -0
- package/src/components/layouts/standard/SrStandardLayout/SrStandardLayout.vue +21 -0
- package/src/components/pagination/SrPagination/SrPagination.scss +36 -0
- package/src/components/tables/SrSimpleTableFilterTd/SrSimpleTableFilterTd.vue +27 -0
- package/src/components/tabs/SrTabsItems/SrTabsItems.vue +1 -1
- package/src/plugins/component-library/index.js +4 -2
- package/src/plugins/component-library/library/SrBreadcrumbs.js +7 -0
- package/src/plugins/component-library/library/{SrFormRow.js → SrForm.js} +2 -0
- package/src/plugins/component-library/library/SrInputs.js +4 -0
- package/src/plugins/component-library/library/SrLayouts.js +4 -0
- package/src/plugins/component-library/library/SrPagination.js +1 -1
- package/src/plugins/component-library/library/SrTables.js +2 -1
- package/src/plugins/vuetify/preset/icons/index.js +4 -0
- package/src/plugins/vuetify/preset/locale/sr-en.js +2 -1
- package/src/plugins/vuetify/preset/locale/sr-hu.js +2 -1
- package/src/plugins/vuetify/preset/style/scss/_admin-menu.scss +0 -14
- package/src/plugins/vuetify/preset/style/scss/_components.scss +0 -12
- package/src/plugins/vuetify/preset/style/scss/_new-style.scss +0 -7
- package/src/plugins/vuetify/preset/style/scss/components/_input.scss +1 -32
- package/src/plugins/vuetify/preset/style/scss/components/_select.scss +0 -61
- package/src/plugins/vuetify/preset/style/scss/components/_table.scss +5 -39
- package/src/plugins/vuetify/preset/variables.scss +2 -2
- package/src/plugins/vuetify/preset/style/scss/_layout.scss +0 -140
- package/src/plugins/vuetify/preset/style/scss/_pages.scss +0 -5
- package/src/plugins/vuetify/preset/style/scss/_utility.scss +0 -14
- package/src/plugins/vuetify/preset/style/scss/components/_actionbar.scss +0 -31
- package/src/plugins/vuetify/preset/style/scss/components/_block.scss +0 -12
- package/src/plugins/vuetify/preset/style/scss/components/_breadcrumb.scss +0 -37
- package/src/plugins/vuetify/preset/style/scss/components/_copy-to-clipboard.scss +0 -16
- package/src/plugins/vuetify/preset/style/scss/components/_dialog.scss +0 -61
- package/src/plugins/vuetify/preset/style/scss/components/_icons.scss +0 -21
- package/src/plugins/vuetify/preset/style/scss/components/_pagination.scss +0 -36
- package/src/plugins/vuetify/preset/style/scss/components/_quantity-range-input.scss +0 -93
- package/src/plugins/vuetify/preset/style/scss/components/_select-all-plus.scss +0 -5
- package/src/plugins/vuetify/preset/style/scss/components/_simple-card.scss +0 -97
- package/src/plugins/vuetify/preset/style/scss/components/_sticky-header.scss +0 -41
- package/src/plugins/vuetify/preset/style/scss/pages/_apps.scss +0 -99
- package/src/plugins/vuetify/preset/style/scss/pages/_campaign.scss +0 -30
- package/src/plugins/vuetify/preset/style/scss/pages/_order-list.scss +0 -498
- package/src/plugins/vuetify/preset/style/scss/pages/_order-preview.scss +0 -83
- package/src/plugins/vuetify/preset/style/scss/pages/_product-list.scss +0 -286
- /package/src/components/pagination/{SrPagination.vue → SrPagination/SrPagination.vue} +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const MultiCheckboxMixin = {
|
|
2
|
+
methods: {
|
|
3
|
+
async selectAllCheckboxes () {
|
|
4
|
+
const wrapper = this.$refs.checkboxWrapper
|
|
5
|
+
const checkboxes = wrapper.querySelectorAll('input[type="checkbox"]')
|
|
6
|
+
for (const cb of checkboxes) {
|
|
7
|
+
if (cb.getAttribute('aria-checked') !== 'true') {
|
|
8
|
+
cb.click()
|
|
9
|
+
await this.$nextTick()
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
this.$emit('select-all')
|
|
13
|
+
},
|
|
14
|
+
async unSelectAllCheckboxes () {
|
|
15
|
+
const wrapper = this.$refs.checkboxWrapper
|
|
16
|
+
const checkboxes = wrapper.querySelectorAll('input[type="checkbox"]')
|
|
17
|
+
for (const cb of checkboxes) {
|
|
18
|
+
if (cb.getAttribute('aria-checked') === 'true') {
|
|
19
|
+
cb.click()
|
|
20
|
+
await this.$nextTick()
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
this.$emit('unselect-all')
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,81 +1,87 @@
|
|
|
1
1
|
import { mount } from '@vue/test-utils'
|
|
2
2
|
import SrMultiCheckbox from '../SrMultiCheckbox.vue'
|
|
3
3
|
|
|
4
|
-
describe('SrMultiCheckbox
|
|
4
|
+
describe('SrMultiCheckbox', () => {
|
|
5
5
|
let vuetify
|
|
6
6
|
|
|
7
7
|
beforeEach(() => {
|
|
8
8
|
vuetify = createVuetify()
|
|
9
9
|
})
|
|
10
10
|
|
|
11
|
-
it('
|
|
11
|
+
it('displays loading state when loading is true', () => {
|
|
12
12
|
const wrapper = mount(SrMultiCheckbox, {
|
|
13
13
|
vuetify,
|
|
14
|
-
propsData: { loading: true }
|
|
14
|
+
propsData: { loading: true },
|
|
15
|
+
slots: { default: '<div class="test-slot">Content</div>' },
|
|
16
|
+
stubs: ['v-progress-circular', 'sr-primary-button']
|
|
15
17
|
})
|
|
16
|
-
expect(wrapper.find('
|
|
17
|
-
expect(wrapper.find('slot').exists()).toBe(false)
|
|
18
|
+
expect(wrapper.find('v-progress-circular-stub').exists()).toBe(true)
|
|
19
|
+
expect(wrapper.find('.test-slot').exists()).toBe(false)
|
|
18
20
|
})
|
|
19
21
|
|
|
20
|
-
it('
|
|
22
|
+
it('displays default slot content when loading is false', () => {
|
|
21
23
|
const wrapper = mount(SrMultiCheckbox, {
|
|
22
24
|
vuetify,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
propsData: { loading: false }
|
|
25
|
+
propsData: { loading: false },
|
|
26
|
+
slots: { default: '<div class="test-slot">Content</div>' },
|
|
27
|
+
stubs: ['v-progress-circular', 'sr-primary-button']
|
|
27
28
|
})
|
|
28
|
-
expect(wrapper.find('.slot
|
|
29
|
+
expect(wrapper.find('.test-slot').exists()).toBe(true)
|
|
30
|
+
expect(wrapper.find('v-progress-circular-stub').exists()).toBe(false)
|
|
29
31
|
})
|
|
30
32
|
|
|
31
|
-
it('
|
|
33
|
+
it('emits select-all event when selectAllCheckboxes is called', async () => {
|
|
32
34
|
const wrapper = mount(SrMultiCheckbox, {
|
|
33
35
|
vuetify,
|
|
34
36
|
propsData: { loading: false },
|
|
35
|
-
slots: {
|
|
36
|
-
|
|
37
|
-
<div>
|
|
38
|
-
<input type="checkbox" aria-checked="false" />
|
|
39
|
-
<input type="checkbox" aria-checked="true" />
|
|
40
|
-
</div>`
|
|
41
|
-
}
|
|
37
|
+
slots: { default: '<input type="checkbox" aria-checked="false" />' },
|
|
38
|
+
stubs: ['v-progress-circular', 'sr-primary-button']
|
|
42
39
|
})
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
const container = document.createElement('div')
|
|
41
|
+
const checkbox = document.createElement('input')
|
|
42
|
+
checkbox.setAttribute('type', 'checkbox')
|
|
43
|
+
checkbox.setAttribute('aria-checked', 'false')
|
|
44
|
+
checkbox.click = jest.fn()
|
|
45
|
+
container.appendChild(checkbox)
|
|
46
|
+
const baseWrapper = wrapper.findComponent({ name: 'BaseMultiCheckbox' })
|
|
47
|
+
baseWrapper.vm.$refs.checkboxWrapper = container
|
|
48
|
+
await baseWrapper.vm.selectAllCheckboxes()
|
|
49
|
+
expect(checkbox.click).toHaveBeenCalled()
|
|
49
50
|
expect(wrapper.emitted()['select-all']).toBeTruthy()
|
|
50
51
|
})
|
|
51
52
|
|
|
52
|
-
it('
|
|
53
|
+
it('emits unselect-all event when unSelectAllCheckboxes is called', async () => {
|
|
53
54
|
const wrapper = mount(SrMultiCheckbox, {
|
|
54
55
|
vuetify,
|
|
55
56
|
propsData: { loading: false },
|
|
56
|
-
slots: {
|
|
57
|
-
|
|
58
|
-
<div>
|
|
59
|
-
<input type="checkbox" aria-checked="true" />
|
|
60
|
-
<input type="checkbox" aria-checked="false" />
|
|
61
|
-
</div>`
|
|
62
|
-
}
|
|
57
|
+
slots: { default: '<input type="checkbox" aria-checked="true" />' },
|
|
58
|
+
stubs: ['v-progress-circular', 'sr-primary-button']
|
|
63
59
|
})
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
60
|
+
const container = document.createElement('div')
|
|
61
|
+
const checkbox = document.createElement('input')
|
|
62
|
+
checkbox.setAttribute('type', 'checkbox')
|
|
63
|
+
checkbox.setAttribute('aria-checked', 'true')
|
|
64
|
+
checkbox.click = jest.fn()
|
|
65
|
+
container.appendChild(checkbox)
|
|
66
|
+
const baseWrapper = wrapper.findComponent({ name: 'BaseMultiCheckbox' })
|
|
67
|
+
baseWrapper.vm.$refs.checkboxWrapper = container
|
|
68
|
+
await baseWrapper.vm.unSelectAllCheckboxes()
|
|
69
|
+
expect(checkbox.click).toHaveBeenCalled()
|
|
70
70
|
expect(wrapper.emitted()['unselect-all']).toBeTruthy()
|
|
71
71
|
})
|
|
72
72
|
|
|
73
|
-
it('
|
|
73
|
+
it('does not emit events if there are no checkboxes', async () => {
|
|
74
74
|
const wrapper = mount(SrMultiCheckbox, {
|
|
75
75
|
vuetify,
|
|
76
|
-
propsData: { loading: false }
|
|
76
|
+
propsData: { loading: false },
|
|
77
|
+
slots: { default: '' },
|
|
78
|
+
stubs: ['v-progress-circular', 'sr-primary-button']
|
|
77
79
|
})
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
+
const baseWrapper = wrapper.findComponent({ name: 'BaseMultiCheckbox' })
|
|
81
|
+
baseWrapper.vm.$refs.checkboxWrapper = document.createElement('div')
|
|
82
|
+
await baseWrapper.vm.selectAllCheckboxes()
|
|
83
|
+
await baseWrapper.vm.unSelectAllCheckboxes()
|
|
84
|
+
expect(wrapper.emitted()['select-all']).toEqual([[]])
|
|
85
|
+
expect(wrapper.emitted()['unselect-all']).toEqual([[]])
|
|
80
86
|
})
|
|
81
87
|
})
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils'
|
|
2
|
+
import SrSimpleMultiCheckbox from '../SrSimpleMultiCheckbox.vue'
|
|
3
|
+
|
|
4
|
+
describe('SrSimpleMultiCheckbox', () => {
|
|
5
|
+
let vuetify
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
vuetify = createVuetify()
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
it('displays loading state when loading is true', () => {
|
|
12
|
+
const wrapper = mount(SrSimpleMultiCheckbox, {
|
|
13
|
+
vuetify,
|
|
14
|
+
propsData: { loading: true, value: [], multiCheckboxOptions: [] },
|
|
15
|
+
stubs: ['v-progress-circular', 'sr-primary-button', 'sr-array-checkbox']
|
|
16
|
+
})
|
|
17
|
+
expect(wrapper.find('v-progress-circular-stub').exists()).toBe(true)
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
it('displays sr-array-checkbox components when loading is false', () => {
|
|
21
|
+
const options = [
|
|
22
|
+
{ value: '1', label: 'Option 1' },
|
|
23
|
+
{ value: '2', label: 'Option 2' }
|
|
24
|
+
]
|
|
25
|
+
const wrapper = mount(SrSimpleMultiCheckbox, {
|
|
26
|
+
vuetify,
|
|
27
|
+
propsData: { loading: false, value: [], multiCheckboxOptions: options },
|
|
28
|
+
stubs: ['v-progress-circular', 'sr-primary-button', 'sr-array-checkbox']
|
|
29
|
+
})
|
|
30
|
+
const checkboxComponents = wrapper.findAll('sr-array-checkbox-stub')
|
|
31
|
+
expect(checkboxComponents.length).toBe(options.length)
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
it('emits input event when modelValue changes', async () => {
|
|
35
|
+
const options = [
|
|
36
|
+
{ value: '1', label: 'Option 1' },
|
|
37
|
+
{ value: '2', label: 'Option 2' }
|
|
38
|
+
]
|
|
39
|
+
const wrapper = mount(SrSimpleMultiCheckbox, {
|
|
40
|
+
vuetify,
|
|
41
|
+
propsData: { loading: false, value: [], multiCheckboxOptions: options },
|
|
42
|
+
stubs: ['v-progress-circular', 'sr-primary-button', 'sr-array-checkbox']
|
|
43
|
+
})
|
|
44
|
+
wrapper.vm.modelValue = ['1']
|
|
45
|
+
await wrapper.vm.$nextTick()
|
|
46
|
+
expect(wrapper.emitted().input).toBeTruthy()
|
|
47
|
+
expect(wrapper.emitted().input[0]).toEqual([['1']])
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
it('emits select-all event when selectAllCheckboxes is called', async () => {
|
|
51
|
+
const options = [{ value: '1', label: 'Option 1' }]
|
|
52
|
+
const wrapper = mount(SrSimpleMultiCheckbox, {
|
|
53
|
+
vuetify,
|
|
54
|
+
propsData: { loading: false, value: [], multiCheckboxOptions: options },
|
|
55
|
+
stubs: ['v-progress-circular', 'sr-primary-button', 'sr-array-checkbox']
|
|
56
|
+
})
|
|
57
|
+
const container = document.createElement('div')
|
|
58
|
+
const checkbox = document.createElement('input')
|
|
59
|
+
checkbox.setAttribute('type', 'checkbox')
|
|
60
|
+
checkbox.setAttribute('aria-checked', 'false')
|
|
61
|
+
checkbox.click = jest.fn()
|
|
62
|
+
container.appendChild(checkbox)
|
|
63
|
+
const baseWrapper = wrapper.findComponent({ name: 'BaseMultiCheckbox' })
|
|
64
|
+
baseWrapper.vm.$refs.checkboxWrapper = container
|
|
65
|
+
await baseWrapper.vm.selectAllCheckboxes()
|
|
66
|
+
expect(checkbox.click).toHaveBeenCalled()
|
|
67
|
+
expect(wrapper.emitted()['select-all']).toBeTruthy()
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
it('emits unselect-all event when unSelectAllCheckboxes is called', async () => {
|
|
71
|
+
const options = [{ value: '1', label: 'Option 1' }]
|
|
72
|
+
const wrapper = mount(SrSimpleMultiCheckbox, {
|
|
73
|
+
vuetify,
|
|
74
|
+
propsData: { loading: false, value: ['1'], multiCheckboxOptions: options },
|
|
75
|
+
stubs: ['v-progress-circular', 'sr-primary-button', 'sr-array-checkbox']
|
|
76
|
+
})
|
|
77
|
+
const container = document.createElement('div')
|
|
78
|
+
const checkbox = document.createElement('input')
|
|
79
|
+
checkbox.setAttribute('type', 'checkbox')
|
|
80
|
+
checkbox.setAttribute('aria-checked', 'true')
|
|
81
|
+
checkbox.click = jest.fn()
|
|
82
|
+
container.appendChild(checkbox)
|
|
83
|
+
const baseWrapper = wrapper.findComponent({ name: 'BaseMultiCheckbox' })
|
|
84
|
+
baseWrapper.vm.$refs.checkboxWrapper = container
|
|
85
|
+
await baseWrapper.vm.unSelectAllCheckboxes()
|
|
86
|
+
expect(checkbox.click).toHaveBeenCalled()
|
|
87
|
+
expect(wrapper.emitted()['unselect-all']).toBeTruthy()
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
it('handles empty checkbox container gracefully', async () => {
|
|
91
|
+
const options = [{ value: '1', label: 'Option 1' }]
|
|
92
|
+
const wrapper = mount(SrSimpleMultiCheckbox, {
|
|
93
|
+
vuetify,
|
|
94
|
+
propsData: { loading: false, value: ['1'], multiCheckboxOptions: options },
|
|
95
|
+
stubs: ['v-progress-circular', 'sr-primary-button', 'sr-array-checkbox']
|
|
96
|
+
})
|
|
97
|
+
const baseWrapper = wrapper.findComponent({ name: 'BaseMultiCheckbox' })
|
|
98
|
+
baseWrapper.vm.$refs.checkboxWrapper = document.createElement('div')
|
|
99
|
+
await baseWrapper.vm.selectAllCheckboxes()
|
|
100
|
+
await baseWrapper.vm.unSelectAllCheckboxes()
|
|
101
|
+
expect(wrapper.emitted()['select-all']).toEqual([[]])
|
|
102
|
+
expect(wrapper.emitted()['unselect-all']).toEqual([[]])
|
|
103
|
+
})
|
|
104
|
+
})
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
<v-radio-group
|
|
3
3
|
v-bind="$attrs"
|
|
4
4
|
v-on="$listeners"
|
|
5
|
+
@change="updateValue"
|
|
5
6
|
>
|
|
6
7
|
<slot></slot>
|
|
7
8
|
</v-radio-group>
|
|
@@ -10,6 +11,11 @@
|
|
|
10
11
|
<script>
|
|
11
12
|
export default {
|
|
12
13
|
name: 'SrRadioGroup',
|
|
13
|
-
inheritAttrs: false
|
|
14
|
+
inheritAttrs: false,
|
|
15
|
+
methods: {
|
|
16
|
+
updateValue (newValue) {
|
|
17
|
+
this.$emit('input', newValue)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
14
20
|
}
|
|
15
21
|
</script>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils'
|
|
2
|
+
import SrRadioGroup from '../SrRadioGroup.vue'
|
|
3
|
+
|
|
4
|
+
describe('SrRadioGroup', () => {
|
|
5
|
+
let vuetify
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
vuetify = createVuetify()
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
it('renders slot content', () => {
|
|
12
|
+
const slotContent = '<div class="slot-test">Test Slot</div>'
|
|
13
|
+
const wrapper = mount(SrRadioGroup, {
|
|
14
|
+
vuetify,
|
|
15
|
+
slots: { default: slotContent }
|
|
16
|
+
})
|
|
17
|
+
expect(wrapper.html()).toContain('Test Slot')
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
it('passes attributes', () => {
|
|
21
|
+
const wrapper = mount(SrRadioGroup, {
|
|
22
|
+
vuetify,
|
|
23
|
+
attrs: { 'data-test': 'test-attribute' }
|
|
24
|
+
})
|
|
25
|
+
expect(wrapper.html()).toContain('data-test="test-attribute"')
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
it('emits input event with v-model when value changes', async () => {
|
|
29
|
+
const wrapper = mount(SrRadioGroup, {
|
|
30
|
+
vuetify
|
|
31
|
+
})
|
|
32
|
+
const radioGroup = wrapper.findComponent({ name: 'v-radio-group' })
|
|
33
|
+
radioGroup.vm.$emit('change', 'new value')
|
|
34
|
+
await wrapper.vm.$nextTick()
|
|
35
|
+
expect(wrapper.emitted().input).toBeTruthy()
|
|
36
|
+
expect(wrapper.emitted().input[0]).toEqual(['new value'])
|
|
37
|
+
})
|
|
38
|
+
})
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
<v-select
|
|
3
3
|
v-bind="$attrs"
|
|
4
4
|
v-on="$listeners"
|
|
5
|
+
:placeholder="placeholder || $vuetify.lang.t('$vuetify.pleaseSelect')"
|
|
5
6
|
menu-props="offset-y"
|
|
6
7
|
clearable
|
|
7
8
|
dense hide-details outlined
|
|
@@ -18,6 +19,12 @@
|
|
|
18
19
|
<script>
|
|
19
20
|
export default {
|
|
20
21
|
name: 'SrSelect',
|
|
21
|
-
inheritAttrs: false
|
|
22
|
+
inheritAttrs: false,
|
|
23
|
+
props: {
|
|
24
|
+
placeholder: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: null
|
|
27
|
+
}
|
|
28
|
+
}
|
|
22
29
|
}
|
|
23
30
|
</script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-textarea
|
|
3
|
+
class="sr-textarea"
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
v-on="$listeners"
|
|
6
|
+
dense
|
|
7
|
+
outlined
|
|
8
|
+
persistent-hint
|
|
9
|
+
clearable
|
|
10
|
+
auto-grow
|
|
11
|
+
row-height="1"
|
|
12
|
+
/>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
export default {
|
|
17
|
+
name: 'SrTextarea',
|
|
18
|
+
inheritAttrs: false
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@import "../../../../plugins/vuetify/preset/style/scss/mixins/breakpoints";
|
|
2
|
+
|
|
3
|
+
.page-layout--slim {
|
|
4
|
+
margin: 0 auto 70px auto;
|
|
5
|
+
padding: 0 30px;
|
|
6
|
+
@include media-breakpoint-up(sm) {
|
|
7
|
+
max-width: $container-slim-width-sm;
|
|
8
|
+
}
|
|
9
|
+
@include media-breakpoint-up(md) {
|
|
10
|
+
max-width: $container-slim-width;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="page-layout--base page-layout--standard">
|
|
3
|
+
<div>
|
|
4
|
+
<div class="breadcrumb-container">
|
|
5
|
+
<sr-breadcrumbs />
|
|
6
|
+
</div>
|
|
7
|
+
<div class="help-btn-container">
|
|
8
|
+
<sr-help-button />
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
<slot></slot>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
name: 'SrStandardLayout',
|
|
19
|
+
props: ['title']
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
.admin-pagination .row {
|
|
2
|
+
flex-direction: row-reverse;
|
|
3
|
+
align-items: center;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.admin-pagination-results {
|
|
7
|
+
font-size: 13px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.admin-pagination-results__label {
|
|
11
|
+
display: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.admin-pagination-pages {
|
|
15
|
+
.v-pagination {
|
|
16
|
+
justify-content: flex-end;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.v-pagination__navigation,
|
|
20
|
+
.v-pagination__item--active,
|
|
21
|
+
.v-pagination__item {
|
|
22
|
+
background: transparent !important;
|
|
23
|
+
box-shadow: none;
|
|
24
|
+
border-radius: 0;
|
|
25
|
+
outline: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.v-pagination__item {
|
|
29
|
+
color: var(--sr-dark-grey) !important;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.v-pagination__item--active {
|
|
33
|
+
color: var(--sr-black) !important;
|
|
34
|
+
font-weight: bold;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<td
|
|
3
|
+
class="sr-simple-table-filter-td"
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
v-on="$listeners"
|
|
6
|
+
:style="{ maxWidth: maxWidth, minWidth: minWidth }"
|
|
7
|
+
>
|
|
8
|
+
<slot/>
|
|
9
|
+
</td>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
export default {
|
|
14
|
+
name: 'SrSimpleTableFilterTd',
|
|
15
|
+
inheritAttrs: false,
|
|
16
|
+
props: {
|
|
17
|
+
maxWidth: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: '150px'
|
|
20
|
+
},
|
|
21
|
+
minWidth: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: null
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import SrIcons from './library/SrIcons'
|
|
2
2
|
import SrButtons from './library/SrButtons'
|
|
3
3
|
import SrInputs from './library/SrInputs'
|
|
4
|
-
import
|
|
4
|
+
import SrForm from './library/SrForm'
|
|
5
5
|
import SrLayouts from './library/SrLayouts'
|
|
6
6
|
import SrTables from './library/SrTables'
|
|
7
7
|
import SrPagination from './library/SrPagination'
|
|
@@ -9,13 +9,14 @@ import SrAppContainers from './library/SrAppContainers'
|
|
|
9
9
|
import SrAlerts from './library/SrAlerts'
|
|
10
10
|
import SrMilestoneIndicators from './library/SrMilestoneIndicators'
|
|
11
11
|
import SrTabs from './library/SrTabs'
|
|
12
|
+
import SrBreadcrumbs from './library/SrBreadcrumbs'
|
|
12
13
|
|
|
13
14
|
export default {
|
|
14
15
|
install (Vue, options = {}) {
|
|
15
16
|
Vue.use(SrIcons)
|
|
16
17
|
Vue.use(SrButtons)
|
|
17
18
|
Vue.use(SrInputs)
|
|
18
|
-
Vue.use(
|
|
19
|
+
Vue.use(SrForm)
|
|
19
20
|
Vue.use(SrLayouts)
|
|
20
21
|
Vue.use(SrTables)
|
|
21
22
|
Vue.use(SrAlerts)
|
|
@@ -23,5 +24,6 @@ export default {
|
|
|
23
24
|
Vue.use(SrAppContainers)
|
|
24
25
|
Vue.use(SrMilestoneIndicators)
|
|
25
26
|
Vue.use(SrTabs)
|
|
27
|
+
Vue.use(SrBreadcrumbs)
|
|
26
28
|
}
|
|
27
29
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import SrFormRow from '../../../components/form/SrFormRow/SrFormRow.vue'
|
|
2
|
+
import SrFormDivider from '../../../components/form/SrFormDivider/SrFormDivider.vue'
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
install (Vue, options = {}) {
|
|
5
6
|
Vue.component('SrFormRow', SrFormRow)
|
|
7
|
+
Vue.component('SrFormDivider', SrFormDivider)
|
|
6
8
|
}
|
|
7
9
|
}
|
|
@@ -7,6 +7,8 @@ import SrRadio from '../../../components/inputs/SrRadio/SrRadio.vue'
|
|
|
7
7
|
import SrRadioGroup from '../../../components/inputs/SrRadio/SrRadioGroup.vue'
|
|
8
8
|
import SrDatePicker from '../../../components/inputs/SrDatePicker/SrDatePicker.vue'
|
|
9
9
|
import SrMultiCheckbox from '../../../components/inputs/SrMultiCheckbox/SrMultiCheckbox.vue'
|
|
10
|
+
import SrSimpleMultiCheckbox from '../../../components/inputs/SrMultiCheckbox/SrSimpleMultiCheckbox.vue'
|
|
11
|
+
import SrTextarea from '../../../components/inputs/SrTextarea/SrTextarea.vue'
|
|
10
12
|
|
|
11
13
|
export default {
|
|
12
14
|
install (Vue, options = {}) {
|
|
@@ -15,9 +17,11 @@ export default {
|
|
|
15
17
|
Vue.component('SrCheckbox', SrCheckbox)
|
|
16
18
|
Vue.component('SrArrayCheckbox', SrArrayCheckbox)
|
|
17
19
|
Vue.component('SrMultiCheckbox', SrMultiCheckbox)
|
|
20
|
+
Vue.component('SrSimpleMultiCheckbox', SrSimpleMultiCheckbox)
|
|
18
21
|
Vue.component('SrSwitch', SrSwitch)
|
|
19
22
|
Vue.component('SrRadio', SrRadio)
|
|
20
23
|
Vue.component('SrRadioGroup', SrRadioGroup)
|
|
21
24
|
Vue.component('SrDatePicker', SrDatePicker)
|
|
25
|
+
Vue.component('SrTextarea', SrTextarea)
|
|
22
26
|
}
|
|
23
27
|
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import SrSlimLayout from '../../../components/layouts/slim/SrSlimLayout/SrSlimLayout.vue'
|
|
2
2
|
import SrSlimHeading from '../../../components/layouts/slim/SrSlimHeading/SrSlimHeading.vue'
|
|
3
3
|
import SrSlimContent from '../../../components/layouts/slim/SrSlimContent/SrSlimContent.vue'
|
|
4
|
+
import SrStandardLayout from '../../../components/layouts/standard/SrStandardLayout/SrStandardLayout.vue'
|
|
4
5
|
|
|
5
6
|
export default {
|
|
6
7
|
install (Vue, options = {}) {
|
|
7
8
|
Vue.component('SrSlimLayout', SrSlimLayout)
|
|
9
|
+
Vue.component('SrStandardLayout', SrStandardLayout)
|
|
8
10
|
Vue.component('SrSlimHeading', SrSlimHeading)
|
|
11
|
+
Vue.component('SrHeading', SrSlimHeading)
|
|
9
12
|
Vue.component('SrSlimContent', SrSlimContent)
|
|
13
|
+
Vue.component('SrContent', SrSlimContent)
|
|
10
14
|
}
|
|
11
15
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import SrSimpleTable from '../../../components/tables/SrSimpleTable/SrSimpleTable.vue'
|
|
2
|
-
|
|
2
|
+
import SrSimpleTableFilterTd from '../../../components/tables/SrSimpleTableFilterTd/SrSimpleTableFilterTd.vue'
|
|
3
3
|
export default {
|
|
4
4
|
install (Vue, options = {}) {
|
|
5
5
|
Vue.component('SrSimpleTable', SrSimpleTable)
|
|
6
|
+
Vue.component('SrSimpleTableFilterTd', SrSimpleTableFilterTd)
|
|
6
7
|
}
|
|
7
8
|
}
|
|
@@ -34,6 +34,7 @@ import SearchCloseIcon from './components/SearchCloseIcon.vue'
|
|
|
34
34
|
import InvoiceStornoIcon from './components/InvoiceStornoIcon.vue'
|
|
35
35
|
import InvoiceIcon from './components/InvoiceIcon.vue'
|
|
36
36
|
import NextIcon from './components/NextIcon.vue'
|
|
37
|
+
import EditIcon from './components/EditIcon.vue'
|
|
37
38
|
|
|
38
39
|
export default {
|
|
39
40
|
iconfont: 'mdi',
|
|
@@ -151,6 +152,9 @@ export default {
|
|
|
151
152
|
},
|
|
152
153
|
next: {
|
|
153
154
|
component: NextIcon
|
|
155
|
+
},
|
|
156
|
+
edit: {
|
|
157
|
+
component: EditIcon
|
|
154
158
|
}
|
|
155
159
|
}
|
|
156
160
|
}
|