@shoprenter/sr-styleguide 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/README.md +37 -0
- package/dist/demo/src/demo.js +1 -0
- package/dist/demo/src/demo_bootstrap_js.css +119 -0
- package/dist/demo/src/demo_bootstrap_js.js +2 -0
- package/dist/demo/src/demo_bootstrap_js.js.LICENSE.txt +3180 -0
- package/dist/demo/src/index.html +1 -0
- package/dist/demo/src/stylesheet.js +0 -0
- package/dist/stylesheet/sr-styleguide.css +34 -0
- package/package.json +61 -0
- package/src/components/alerts/SrErrorAlert.vue +18 -0
- package/src/components/alerts/SrInfoAlert.vue +18 -0
- package/src/components/alerts/SrSuccessAlert.vue +18 -0
- package/src/components/alerts/SrWarningAlert.vue +18 -0
- package/src/components/app-containers/SrModule/SrModule.scss +16 -0
- package/src/components/app-containers/SrModule/SrModule.vue +17 -0
- package/src/components/app-containers/SrPage/SrPage.vue +25 -0
- package/src/components/buttons/SrDeleteButton.vue +11 -0
- package/src/components/buttons/SrHelpButton.scss +9 -0
- package/src/components/buttons/SrHelpButton.vue +16 -0
- package/src/components/buttons/SrPrimaryButton.vue +11 -0
- package/src/components/buttons/tests/SrHelpButton.spec.js +36 -0
- package/src/components/form/SrFormRow/SrFormRow.scss +26 -0
- package/src/components/form/SrFormRow/SrFormRow.vue +44 -0
- package/src/components/icons/SrAddCircleOutlineIcon.vue +11 -0
- package/src/components/icons/SrArrowRightIcon.vue +11 -0
- package/src/components/icons/SrCalendarIcon.vue +11 -0
- package/src/components/icons/SrCheckboxIndeterminateIcon.vue +11 -0
- package/src/components/icons/SrCheckboxOffIcon.vue +11 -0
- package/src/components/icons/SrCheckboxOnIcon.vue +11 -0
- package/src/components/icons/SrCloseIcon.vue +11 -0
- package/src/components/icons/SrDuplicateIcon.vue +11 -0
- package/src/components/icons/SrEditIcon.vue +11 -0
- package/src/components/icons/SrErrorCircleOutlineIcon.vue +11 -0
- package/src/components/icons/SrErrorIcon.vue +11 -0
- package/src/components/icons/SrExportIcon.vue +11 -0
- package/src/components/icons/SrFileWithStarIcon.vue +11 -0
- package/src/components/icons/SrFilterIcon.vue +11 -0
- package/src/components/icons/SrFindIcon.vue +11 -0
- package/src/components/icons/SrHelpCircleOutlineIcon.vue +11 -0
- package/src/components/icons/SrImportIcon.vue +11 -0
- package/src/components/icons/SrInfoIcon.vue +11 -0
- package/src/components/icons/SrInformationIcon.vue +11 -0
- package/src/components/icons/SrInvoiceIcon.vue +11 -0
- package/src/components/icons/SrInvoiceStornoIcon.vue +11 -0
- package/src/components/icons/SrLightningIcon.vue +11 -0
- package/src/components/icons/SrMagnifyIcon.vue +11 -0
- package/src/components/icons/SrMailIcon.vue +11 -0
- package/src/components/icons/SrNextIcon.vue +11 -0
- package/src/components/icons/SrOpenInNewIcon.vue +11 -0
- package/src/components/icons/SrPackageIcon.vue +10 -0
- package/src/components/icons/SrPadlockOutlineIcon.vue +11 -0
- package/src/components/icons/SrPencilIcon.vue +11 -0
- package/src/components/icons/SrPrevIcon.vue +11 -0
- package/src/components/icons/SrRadioOff.vue +11 -0
- package/src/components/icons/SrRadioOn.vue +11 -0
- package/src/components/icons/SrSearchCloseIcon.vue +11 -0
- package/src/components/icons/SrSearchIcon.vue +11 -0
- package/src/components/icons/SrSettingIcon.vue +11 -0
- package/src/components/icons/SrSuccessCircleOutlineIcon.vue +11 -0
- package/src/components/icons/SrSuccessIcon.vue +11 -0
- package/src/components/icons/SrTrashIcon.vue +11 -0
- package/src/components/icons/SrWarningCircleOutlineIcon.vue +11 -0
- package/src/components/icons/flags/SrCroatiaFlag.vue +73 -0
- package/src/components/icons/flags/SrGermanyFlag.vue +23 -0
- package/src/components/icons/flags/SrHungaryFlag.vue +19 -0
- package/src/components/icons/flags/SrRomaniaFlag.vue +23 -0
- package/src/components/icons/flags/SrSerbiaFlag.vue +34 -0
- package/src/components/icons/flags/SrSloveniaFlag.vue +33 -0
- package/src/components/icons/flags/SrUnitedKingdomFlag.vue +42 -0
- package/src/components/inputs/SrCheckbox/SrArrayCheckbox.vue +34 -0
- package/src/components/inputs/SrCheckbox/SrCheckbox.vue +15 -0
- package/src/components/inputs/SrCheckbox/tests/SrArrayCheckbox.spec.js +73 -0
- package/src/components/inputs/SrDatePicker/SrDatePicker.vue +56 -0
- package/src/components/inputs/SrInputField/SrInputField.vue +17 -0
- package/src/components/inputs/SrMultiCheckbox/SrMultiCheckbox.scss +35 -0
- package/src/components/inputs/SrMultiCheckbox/SrMultiCheckbox.vue +68 -0
- package/src/components/inputs/SrMultiCheckbox/tests/SrMultiCheckbox.spec.js +81 -0
- package/src/components/inputs/SrRadio/SrRadio.vue +19 -0
- package/src/components/inputs/SrRadio/SrRadioGroup.vue +15 -0
- package/src/components/inputs/SrSelect/SrSelect.vue +23 -0
- package/src/components/inputs/SrSwitch/SrSwitch.vue +30 -0
- package/src/components/layouts/slim/SrSlimContent/SrSlimContent.vue +14 -0
- package/src/components/layouts/slim/SrSlimHeading/SrSlimHeading.vue +14 -0
- package/src/components/layouts/slim/SrSlimLayout/SrSlimLayout.vue +13 -0
- package/src/components/milestone-indicators/multi-step-progress-bar/SrMultiStepProgressBar/SrMultiStepProgressBar.scss +25 -0
- package/src/components/milestone-indicators/multi-step-progress-bar/SrMultiStepProgressBar/SrMultiStepProgressBar.vue +12 -0
- package/src/components/milestone-indicators/multi-step-progress-bar/SrProgressBarStep/SrProgressBarStep.scss +69 -0
- package/src/components/milestone-indicators/multi-step-progress-bar/SrProgressBarStep/SrProgressBarStep.vue +25 -0
- package/src/components/pagination/SrPagination.vue +57 -0
- package/src/components/tables/SrSimpleTable/SrSimpleTable.vue +11 -0
- package/src/components/tabs/SrLanguageTab/SrLanguageTab.scss +12 -0
- package/src/components/tabs/SrLanguageTab/SrLanguageTab.vue +26 -0
- package/src/components/tabs/SrLanguageTab/adminLanguages.js +64 -0
- package/src/components/tabs/SrTab/SrTab.scss +9 -0
- package/src/components/tabs/SrTab/SrTab.vue +15 -0
- package/src/components/tabs/SrTabItem/SrTabItem.vue +12 -0
- package/src/components/tabs/SrTabs/SrTabs.scss +5 -0
- package/src/components/tabs/SrTabs/SrTabs.vue +28 -0
- package/src/components/tabs/SrTabsItems/SrTabsItems.vue +12 -0
- package/src/index.js +2 -0
- package/src/plugins/component-library/index.js +27 -0
- package/src/plugins/component-library/library/SrAlerts.js +13 -0
- package/src/plugins/component-library/library/SrAppContainers.js +9 -0
- package/src/plugins/component-library/library/SrButtons.js +11 -0
- package/src/plugins/component-library/library/SrFormRow.js +7 -0
- package/src/plugins/component-library/library/SrIcons.js +98 -0
- package/src/plugins/component-library/library/SrInputs.js +23 -0
- package/src/plugins/component-library/library/SrLayouts.js +11 -0
- package/src/plugins/component-library/library/SrMilestoneIndicators.js +11 -0
- package/src/plugins/component-library/library/SrPagination.js +7 -0
- package/src/plugins/component-library/library/SrTables.js +7 -0
- package/src/plugins/component-library/library/SrTabs.js +15 -0
- package/src/plugins/vuetify/index.js +9 -0
- package/src/plugins/vuetify/preset/icons/components/AddCircleOutlineIcon.vue +11 -0
- package/src/plugins/vuetify/preset/icons/components/ArrowRightIcon.vue +11 -0
- package/src/plugins/vuetify/preset/icons/components/CalendarIcon.vue +27 -0
- package/src/plugins/vuetify/preset/icons/components/CheckboxIndeterminateIcon.vue +12 -0
- package/src/plugins/vuetify/preset/icons/components/CheckboxOffIcon.vue +11 -0
- package/src/plugins/vuetify/preset/icons/components/CheckboxOnIcon.vue +12 -0
- package/src/plugins/vuetify/preset/icons/components/CloseIcon.vue +12 -0
- package/src/plugins/vuetify/preset/icons/components/DuplicateIcon.vue +11 -0
- package/src/plugins/vuetify/preset/icons/components/EditIcon.vue +11 -0
- package/src/plugins/vuetify/preset/icons/components/ErrorCircleOutlineIcon.vue +13 -0
- package/src/plugins/vuetify/preset/icons/components/ErrorIcon.vue +12 -0
- package/src/plugins/vuetify/preset/icons/components/ExportIcon.vue +11 -0
- package/src/plugins/vuetify/preset/icons/components/FileWithStarIcon.vue +15 -0
- package/src/plugins/vuetify/preset/icons/components/FilterIcon.vue +11 -0
- package/src/plugins/vuetify/preset/icons/components/FindIcon.vue +11 -0
- package/src/plugins/vuetify/preset/icons/components/HelpCircleOutlineIcon.vue +11 -0
- package/src/plugins/vuetify/preset/icons/components/ImportIcon.vue +11 -0
- package/src/plugins/vuetify/preset/icons/components/InfoIcon.vue +11 -0
- package/src/plugins/vuetify/preset/icons/components/InformationIcon.vue +12 -0
- package/src/plugins/vuetify/preset/icons/components/InvoiceIcon.vue +13 -0
- package/src/plugins/vuetify/preset/icons/components/InvoiceStornoIcon.vue +13 -0
- package/src/plugins/vuetify/preset/icons/components/LightningIcon.vue +11 -0
- package/src/plugins/vuetify/preset/icons/components/MagnifyIcon.vue +11 -0
- package/src/plugins/vuetify/preset/icons/components/MailIcon.vue +11 -0
- package/src/plugins/vuetify/preset/icons/components/NextIcon.vue +11 -0
- package/src/plugins/vuetify/preset/icons/components/OpenInNewIcon.vue +11 -0
- package/src/plugins/vuetify/preset/icons/components/PackageIcon.vue +12 -0
- package/src/plugins/vuetify/preset/icons/components/PadlockOutlineIcon.vue +20 -0
- package/src/plugins/vuetify/preset/icons/components/PencilIcon.vue +11 -0
- package/src/plugins/vuetify/preset/icons/components/PrevIcon.vue +11 -0
- package/src/plugins/vuetify/preset/icons/components/RadioOff.vue +11 -0
- package/src/plugins/vuetify/preset/icons/components/RadioOn.vue +12 -0
- package/src/plugins/vuetify/preset/icons/components/SearchCloseIcon.vue +11 -0
- package/src/plugins/vuetify/preset/icons/components/SearchIcon.vue +11 -0
- package/src/plugins/vuetify/preset/icons/components/SettingIcon.vue +9 -0
- package/src/plugins/vuetify/preset/icons/components/SuccessCircleOutlineIcon.vue +13 -0
- package/src/plugins/vuetify/preset/icons/components/SuccessIcon.vue +11 -0
- package/src/plugins/vuetify/preset/icons/components/TrashIcon.vue +12 -0
- package/src/plugins/vuetify/preset/icons/components/WarningCircleOutlineIcon.vue +18 -0
- package/src/plugins/vuetify/preset/icons/index.js +156 -0
- package/src/plugins/vuetify/preset/index.js +27 -0
- package/src/plugins/vuetify/preset/locale/sr-en.js +10 -0
- package/src/plugins/vuetify/preset/locale/sr-hu.js +10 -0
- package/src/plugins/vuetify/preset/overrides.sass +7 -0
- package/src/plugins/vuetify/preset/style/css/root_variables.css +25 -0
- package/src/plugins/vuetify/preset/style/scss/_admin-menu.scss +24 -0
- package/src/plugins/vuetify/preset/style/scss/_components.scss +19 -0
- package/src/plugins/vuetify/preset/style/scss/_layout.scss +140 -0
- package/src/plugins/vuetify/preset/style/scss/_new-style.scss +80 -0
- package/src/plugins/vuetify/preset/style/scss/_pages.scss +5 -0
- package/src/plugins/vuetify/preset/style/scss/_scaffolding.scss +29 -0
- package/src/plugins/vuetify/preset/style/scss/_utility.scss +14 -0
- package/src/plugins/vuetify/preset/style/scss/_vuetify-rewrite.scss +4 -0
- package/src/plugins/vuetify/preset/style/scss/components/_actionbar.scss +31 -0
- package/src/plugins/vuetify/preset/style/scss/components/_block.scss +12 -0
- package/src/plugins/vuetify/preset/style/scss/components/_breadcrumb.scss +37 -0
- package/src/plugins/vuetify/preset/style/scss/components/_buttons.scss +71 -0
- package/src/plugins/vuetify/preset/style/scss/components/_cards.scss +61 -0
- package/src/plugins/vuetify/preset/style/scss/components/_copy-to-clipboard.scss +16 -0
- package/src/plugins/vuetify/preset/style/scss/components/_dialog.scss +61 -0
- package/src/plugins/vuetify/preset/style/scss/components/_icons.scss +21 -0
- package/src/plugins/vuetify/preset/style/scss/components/_input.scss +199 -0
- package/src/plugins/vuetify/preset/style/scss/components/_pagination.scss +36 -0
- package/src/plugins/vuetify/preset/style/scss/components/_quantity-range-input.scss +93 -0
- package/src/plugins/vuetify/preset/style/scss/components/_select-all-plus.scss +5 -0
- package/src/plugins/vuetify/preset/style/scss/components/_select.scss +92 -0
- package/src/plugins/vuetify/preset/style/scss/components/_simple-card.scss +97 -0
- package/src/plugins/vuetify/preset/style/scss/components/_sticky-header.scss +41 -0
- package/src/plugins/vuetify/preset/style/scss/components/_table.scss +94 -0
- package/src/plugins/vuetify/preset/style/scss/components/_tooltip.scss +3 -0
- package/src/plugins/vuetify/preset/style/scss/mixins/_breakpoints.scss +123 -0
- package/src/plugins/vuetify/preset/style/scss/pages/_apps.scss +99 -0
- package/src/plugins/vuetify/preset/style/scss/pages/_campaign.scss +30 -0
- package/src/plugins/vuetify/preset/style/scss/pages/_order-list.scss +498 -0
- package/src/plugins/vuetify/preset/style/scss/pages/_order-preview.scss +83 -0
- package/src/plugins/vuetify/preset/style/scss/pages/_product-list.scss +286 -0
- package/src/plugins/vuetify/preset/variables.scss +264 -0
- package/src/plugins/vuetify/vuetify.sass +95 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.sr-multi-checkbox {
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
.checkbox-container > .preloader-container {
|
|
5
|
+
display: flex;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
align-items: center;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.checkbox-container {
|
|
11
|
+
height: 100px;
|
|
12
|
+
width: 400px;
|
|
13
|
+
min-height: 100px;
|
|
14
|
+
min-width: 400px;
|
|
15
|
+
max-width: 600px;
|
|
16
|
+
max-height: 500px;
|
|
17
|
+
overflow-y: auto;
|
|
18
|
+
resize: both;
|
|
19
|
+
border-radius: 3px;
|
|
20
|
+
border: 1px solid var(--sr-pale-gray);
|
|
21
|
+
background-color: var(--sr-white);
|
|
22
|
+
padding: 0.2em 1em 1em 1em;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.multi-checkbox-actions {
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
margin-top: 1em;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.multi-checkbox-separator {
|
|
33
|
+
color: var(--sr-light-grey);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sr-multi-checkbox">
|
|
3
|
+
<div class="checkbox-container" ref="checkboxWrapper">
|
|
4
|
+
<template v-if="loading">
|
|
5
|
+
<div class="preloader-container">
|
|
6
|
+
<v-progress-circular
|
|
7
|
+
class="text-center"
|
|
8
|
+
color="primary"
|
|
9
|
+
indeterminate
|
|
10
|
+
size="38"
|
|
11
|
+
/>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
<template v-else>
|
|
15
|
+
<slot/>
|
|
16
|
+
</template>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="multi-checkbox-actions">
|
|
19
|
+
<sr-primary-button text data-test-id="selectAllCheckbox" @click="selectAllCheckboxes()">
|
|
20
|
+
{{ this.$vuetify.lang.t('$vuetify.selectAll') }}
|
|
21
|
+
</sr-primary-button>
|
|
22
|
+
<span class="multi-checkbox-separator">/</span>
|
|
23
|
+
<sr-primary-button text data-test-id="unSelectAllCheckbox" @click="unSelectAllCheckboxes()">
|
|
24
|
+
{{ this.$vuetify.lang.t('$vuetify.clearAll') }}
|
|
25
|
+
</sr-primary-button>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
<script>
|
|
30
|
+
export default {
|
|
31
|
+
name: 'SrMultiCheckbox',
|
|
32
|
+
props: {
|
|
33
|
+
loading: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
emits: ['select-all', 'unselect-all'],
|
|
39
|
+
methods: {
|
|
40
|
+
async selectAllCheckboxes () {
|
|
41
|
+
const wrapper = this.$refs.checkboxWrapper
|
|
42
|
+
const checkboxes = wrapper.querySelectorAll('input[type="checkbox"]')
|
|
43
|
+
|
|
44
|
+
for (const cb of checkboxes) {
|
|
45
|
+
if (cb.getAttribute('aria-checked') !== 'true') {
|
|
46
|
+
cb.click()
|
|
47
|
+
await this.$nextTick()
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
this.$emit('select-all')
|
|
52
|
+
},
|
|
53
|
+
async unSelectAllCheckboxes () {
|
|
54
|
+
const wrapper = this.$refs.checkboxWrapper
|
|
55
|
+
const checkboxes = wrapper.querySelectorAll('input[type="checkbox"]')
|
|
56
|
+
|
|
57
|
+
for (const cb of checkboxes) {
|
|
58
|
+
if (cb.getAttribute('aria-checked') === 'true') {
|
|
59
|
+
cb.click()
|
|
60
|
+
await this.$nextTick()
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
this.$emit('unselect-all')
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
</script>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils'
|
|
2
|
+
import SrMultiCheckbox from '../SrMultiCheckbox.vue'
|
|
3
|
+
|
|
4
|
+
describe('SrMultiCheckbox.vue', () => {
|
|
5
|
+
let vuetify
|
|
6
|
+
|
|
7
|
+
beforeEach(() => {
|
|
8
|
+
vuetify = createVuetify()
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
it('renders loading state with progress circular', () => {
|
|
12
|
+
const wrapper = mount(SrMultiCheckbox, {
|
|
13
|
+
vuetify,
|
|
14
|
+
propsData: { loading: true }
|
|
15
|
+
})
|
|
16
|
+
expect(wrapper.find('.v-progress-circular').exists()).toBe(true)
|
|
17
|
+
expect(wrapper.find('slot').exists()).toBe(false)
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
it('renders slot content when not loading', () => {
|
|
21
|
+
const wrapper = mount(SrMultiCheckbox, {
|
|
22
|
+
vuetify,
|
|
23
|
+
slots: {
|
|
24
|
+
default: '<div class="slot-content">Checkbox content</div>'
|
|
25
|
+
},
|
|
26
|
+
propsData: { loading: false }
|
|
27
|
+
})
|
|
28
|
+
expect(wrapper.find('.slot-content').exists()).toBe(true)
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
it('calls selectAllCheckboxes and emits event', async () => {
|
|
32
|
+
const wrapper = mount(SrMultiCheckbox, {
|
|
33
|
+
vuetify,
|
|
34
|
+
propsData: { loading: false },
|
|
35
|
+
slots: {
|
|
36
|
+
default: `
|
|
37
|
+
<div>
|
|
38
|
+
<input type="checkbox" aria-checked="false" />
|
|
39
|
+
<input type="checkbox" aria-checked="true" />
|
|
40
|
+
</div>`
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
const spy = jest.spyOn(wrapper.vm, 'selectAllCheckboxes')
|
|
45
|
+
await wrapper.find('[data-test-id="selectAllCheckbox"]').trigger('click')
|
|
46
|
+
expect(spy).toHaveBeenCalled()
|
|
47
|
+
|
|
48
|
+
await wrapper.vm.$nextTick()
|
|
49
|
+
expect(wrapper.emitted()['select-all']).toBeTruthy()
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
it('calls unSelectAllCheckboxes and emits event', async () => {
|
|
53
|
+
const wrapper = mount(SrMultiCheckbox, {
|
|
54
|
+
vuetify,
|
|
55
|
+
propsData: { loading: false },
|
|
56
|
+
slots: {
|
|
57
|
+
default: `
|
|
58
|
+
<div>
|
|
59
|
+
<input type="checkbox" aria-checked="true" />
|
|
60
|
+
<input type="checkbox" aria-checked="false" />
|
|
61
|
+
</div>`
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
const spy = jest.spyOn(wrapper.vm, 'unSelectAllCheckboxes')
|
|
66
|
+
await wrapper.find('[data-test-id="unSelectAllCheckbox"]').trigger('click')
|
|
67
|
+
expect(spy).toHaveBeenCalled()
|
|
68
|
+
|
|
69
|
+
await wrapper.vm.$nextTick()
|
|
70
|
+
expect(wrapper.emitted()['unselect-all']).toBeTruthy()
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
it('renders both action buttons', () => {
|
|
74
|
+
const wrapper = mount(SrMultiCheckbox, {
|
|
75
|
+
vuetify,
|
|
76
|
+
propsData: { loading: false }
|
|
77
|
+
})
|
|
78
|
+
const buttons = wrapper.findAllComponents({ name: 'sr-primary-button' })
|
|
79
|
+
expect(buttons.length).toBe(2)
|
|
80
|
+
})
|
|
81
|
+
})
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-radio
|
|
3
|
+
v-bind="$attrs"
|
|
4
|
+
v-on="$listeners"
|
|
5
|
+
:ripple="false"
|
|
6
|
+
color="primary"
|
|
7
|
+
>
|
|
8
|
+
<template v-slot:label>
|
|
9
|
+
<slot></slot>
|
|
10
|
+
</template>
|
|
11
|
+
</v-radio>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
export default {
|
|
16
|
+
name: 'SrRadio',
|
|
17
|
+
inheritAttrs: false
|
|
18
|
+
}
|
|
19
|
+
</script>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-select
|
|
3
|
+
v-bind="$attrs"
|
|
4
|
+
v-on="$listeners"
|
|
5
|
+
menu-props="offset-y"
|
|
6
|
+
clearable
|
|
7
|
+
dense hide-details outlined
|
|
8
|
+
>
|
|
9
|
+
<template #item="{item}">
|
|
10
|
+
<div v-html="item.text"></div>
|
|
11
|
+
</template>
|
|
12
|
+
<template #selection="{item}">
|
|
13
|
+
<div v-html="item.text"></div>
|
|
14
|
+
</template>
|
|
15
|
+
</v-select>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
export default {
|
|
20
|
+
name: 'SrSelect',
|
|
21
|
+
inheritAttrs: false
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-switch
|
|
3
|
+
:input-value="value"
|
|
4
|
+
:label="getLabel"
|
|
5
|
+
:ripple="false"
|
|
6
|
+
hide-details
|
|
7
|
+
inset
|
|
8
|
+
v-bind="$attrs"
|
|
9
|
+
v-on="$listeners"
|
|
10
|
+
@change="$emit('input', $event)"
|
|
11
|
+
/>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
export default {
|
|
16
|
+
name: 'SrSwitch',
|
|
17
|
+
inheritAttrs: false,
|
|
18
|
+
props: {
|
|
19
|
+
value: {
|
|
20
|
+
type: [Boolean, Number],
|
|
21
|
+
required: true
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
computed: {
|
|
25
|
+
getLabel () {
|
|
26
|
+
return this.value ? this.$vuetify.lang.t('$vuetify.yes') : this.$vuetify.lang.t('$vuetify.no')
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="d-flex w-100 justify-space-between mb-4">
|
|
3
|
+
<h1 class="text-h1">{{ title }}</h1>
|
|
4
|
+
<div>
|
|
5
|
+
<slot></slot>
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
<script>
|
|
10
|
+
export default {
|
|
11
|
+
name: 'SrSlimHeading',
|
|
12
|
+
props: ['title']
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
@import "../../../../../src/plugins/vuetify/preset/style/scss/mixins/breakpoints";
|
|
2
|
+
|
|
3
|
+
.sr-multi-step-progress-bar {
|
|
4
|
+
display: flex;
|
|
5
|
+
position: relative;
|
|
6
|
+
padding: 42px 0;
|
|
7
|
+
justify-content: space-between;
|
|
8
|
+
|
|
9
|
+
@include media-breakpoint-down(xs) {
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
padding-left: 20px;
|
|
12
|
+
padding-right: 20px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@include media-breakpoint-up(sm) {
|
|
16
|
+
&:before {
|
|
17
|
+
content: "";
|
|
18
|
+
height: 1px;
|
|
19
|
+
width: 100%;
|
|
20
|
+
background: var(--sr-light-grey);
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: 50%;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
@import "../../../../../src/plugins/vuetify/preset/style/scss/mixins/breakpoints";
|
|
2
|
+
|
|
3
|
+
.sr-progress-bar-step {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
background: var(--sr-bg-grey);
|
|
7
|
+
z-index: 1;
|
|
8
|
+
color: var(--sr-link-grey);
|
|
9
|
+
margin-top: 5px;
|
|
10
|
+
margin-bottom: 5px;
|
|
11
|
+
|
|
12
|
+
@include media-breakpoint-up(sm) {
|
|
13
|
+
margin: 0;
|
|
14
|
+
|
|
15
|
+
&:not(:first-child):not(:last-child) {
|
|
16
|
+
padding-left: 15px;
|
|
17
|
+
padding-right: 15px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&:first-child {
|
|
21
|
+
padding-right: 15px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:last-child {
|
|
25
|
+
padding-left: 15px;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&.active {
|
|
30
|
+
color: var(--sr-black);
|
|
31
|
+
font-weight: 500;
|
|
32
|
+
|
|
33
|
+
&:before {
|
|
34
|
+
background: #FFFFFF;
|
|
35
|
+
border: 4px solid var(--sr-primary);
|
|
36
|
+
box-shadow: 0 3px 10px rgba(110, 180, 0, 0.3);
|
|
37
|
+
border-radius: 33px;
|
|
38
|
+
|
|
39
|
+
@include media-breakpoint-up(sm) {
|
|
40
|
+
width: 30px;
|
|
41
|
+
flex: 0 0 30px;
|
|
42
|
+
height: 30px;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&.completed {
|
|
48
|
+
&:before {
|
|
49
|
+
background: var(--sr-primary);
|
|
50
|
+
border: 4px solid #FFFFFF;
|
|
51
|
+
box-sizing: border-box;
|
|
52
|
+
box-shadow: 0 3px 10px rgba(110, 180, 0, 0.3);
|
|
53
|
+
border-radius: 33px;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&:before {
|
|
58
|
+
content: "";
|
|
59
|
+
display: inline-block;
|
|
60
|
+
background: var(--sr-bg-grey);
|
|
61
|
+
border: 4px solid var(--sr-light-grey);
|
|
62
|
+
box-sizing: border-box;
|
|
63
|
+
border-radius: 30px;
|
|
64
|
+
width: 20px;
|
|
65
|
+
flex: 0 0 20px;
|
|
66
|
+
height: 20px;
|
|
67
|
+
margin-right: 10px;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sr-progress-bar-step"
|
|
3
|
+
:class="{completed: !active && completed, active: active}"
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
v-on="$listeners">
|
|
6
|
+
<slot />
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
export default {
|
|
12
|
+
name: 'SrProgressBarStep',
|
|
13
|
+
inheritAttrs: false,
|
|
14
|
+
props: {
|
|
15
|
+
completed: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: false
|
|
18
|
+
},
|
|
19
|
+
active: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: false
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
</script>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="admin-pagination">
|
|
3
|
+
<v-row>
|
|
4
|
+
<v-col :cols="6" sm="9" class="admin-pagination-pages">
|
|
5
|
+
<v-pagination v-if="pageLength > 1"
|
|
6
|
+
:total-visible="9"
|
|
7
|
+
:value="value"
|
|
8
|
+
@input="updateValue"
|
|
9
|
+
next-icon="mdi-chevron-right"
|
|
10
|
+
prev-icon="mdi-chevron-left"
|
|
11
|
+
:length="pageLength"/>
|
|
12
|
+
</v-col>
|
|
13
|
+
<v-col :cols="6" sm="3" class="admin-pagination-results">
|
|
14
|
+
{{pageInterval}} {{totalCount}}
|
|
15
|
+
</v-col>
|
|
16
|
+
</v-row>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
export default {
|
|
22
|
+
name: 'SrPagination',
|
|
23
|
+
props: {
|
|
24
|
+
value: {
|
|
25
|
+
type: Number
|
|
26
|
+
},
|
|
27
|
+
totalCount: {
|
|
28
|
+
type: Number,
|
|
29
|
+
required: true
|
|
30
|
+
},
|
|
31
|
+
itemsPerPage: {
|
|
32
|
+
type: Number,
|
|
33
|
+
required: true
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
computed: {
|
|
37
|
+
pageInterval () {
|
|
38
|
+
if (!this.totalCount) {
|
|
39
|
+
return ''
|
|
40
|
+
}
|
|
41
|
+
const last = this.value * this.itemsPerPage
|
|
42
|
+
const first = last + 1 - this.itemsPerPage
|
|
43
|
+
return `${first} - ${Math.min(last, this.totalCount)} /`
|
|
44
|
+
},
|
|
45
|
+
pageLength () {
|
|
46
|
+
return this.totalCount
|
|
47
|
+
? Math.ceil(this.totalCount / this.itemsPerPage)
|
|
48
|
+
: 0
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
methods: {
|
|
52
|
+
updateValue (newValue) {
|
|
53
|
+
this.$emit('input', newValue)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
</script>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sr-tab v-bind="$attrs" v-on="$listeners" class="sr-language-tab">
|
|
3
|
+
<component :is="language.icon" width="20" />
|
|
4
|
+
{{ language.text }}
|
|
5
|
+
</sr-tab>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
import getLanguage from './adminLanguages'
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
name: 'SrLanguageTab',
|
|
13
|
+
inheritAttrs: false,
|
|
14
|
+
props: {
|
|
15
|
+
lang: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: 'hu'
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
data () {
|
|
21
|
+
return {
|
|
22
|
+
language: getLanguage(this.lang)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
</script>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import SrUnitedKingdomFlag from '../../icons/flags/SrUnitedKingdomFlag.vue'
|
|
2
|
+
import SrHungaryFlag from '../../icons/flags/SrHungaryFlag.vue'
|
|
3
|
+
import SrGermanyFlag from '../../icons/flags/SrGermanyFlag.vue'
|
|
4
|
+
import SrCroatiaFlag from '../../icons/flags/SrCroatiaFlag.vue'
|
|
5
|
+
import SrRomaniaFlag from '../../icons/flags/SrRomaniaFlag.vue'
|
|
6
|
+
import SrSerbiaFlag from '../../icons/flags/SrSerbiaFlag.vue'
|
|
7
|
+
import SrSloveniaFlag from '../../icons/flags/SrSloveniaFlag.vue'
|
|
8
|
+
|
|
9
|
+
const adminLanguageList = [
|
|
10
|
+
{
|
|
11
|
+
code: 'hu',
|
|
12
|
+
icon: SrHungaryFlag,
|
|
13
|
+
text: 'Hungarian'
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
code: 'en',
|
|
17
|
+
icon: SrUnitedKingdomFlag,
|
|
18
|
+
text: 'English'
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
code: 'de',
|
|
22
|
+
icon: SrGermanyFlag,
|
|
23
|
+
text: 'German'
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
code: 'hr',
|
|
27
|
+
icon: SrCroatiaFlag,
|
|
28
|
+
text: 'Croatian'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
code: 'ro',
|
|
32
|
+
icon: SrRomaniaFlag,
|
|
33
|
+
text: 'Romanian'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
code: 'sr',
|
|
37
|
+
icon: SrSerbiaFlag,
|
|
38
|
+
text: 'Serbian'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
code: 'sl',
|
|
42
|
+
icon: SrSloveniaFlag,
|
|
43
|
+
text: 'Slovenian'
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
function getLanguage (code) {
|
|
48
|
+
const languages = adminLanguageList.filter((language) => {
|
|
49
|
+
return language.code === code
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
if (!languages[0]) {
|
|
53
|
+
console.error('Invalid language code: "' + code + '"')
|
|
54
|
+
return {
|
|
55
|
+
code,
|
|
56
|
+
icon: '',
|
|
57
|
+
text: ''
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return languages[0]
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export default getLanguage
|