@eturnity/eturnity_reusable_components 7.12.7--EPDM-5518.2 → 7.12.7-EPDM-7951.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/.storybook/preview.js +1 -1
- package/package.json +19 -23
- package/src/App.vue +2 -2
- package/src/components/addNewButton/index.vue +5 -3
- package/src/components/buttons/buttonIcon/index.vue +1 -1
- package/src/components/buttons/closeButton/index.vue +1 -1
- package/src/components/buttons/mainButton/index.vue +6 -1
- package/src/components/deleteIcon/DeleteIcon.stories.js +7 -7
- package/src/components/deleteIcon/index.vue +25 -21
- package/src/components/draggableInputHandle/index.vue +24 -25
- package/src/components/dropdown/index.vue +129 -110
- package/src/components/errorMessage/index.vue +1 -1
- package/src/components/filter/filterSettings.vue +54 -113
- package/src/components/filter/index.vue +3 -3
- package/src/components/filter/parentDropdown.vue +2 -2
- package/src/components/icon/iconCache.js +23 -0
- package/src/components/icon/iconCollection.vue +2 -2
- package/src/components/icon/index.vue +67 -70
- package/src/components/iconWrapper/index.vue +1 -4
- package/src/components/infoCard/index.vue +2 -3
- package/src/components/infoText/index.vue +1 -1
- package/src/components/inputs/checkbox/index.vue +24 -16
- package/src/components/inputs/inputNumber/index.vue +7 -10
- package/src/components/inputs/inputNumberQuestion/index.vue +1 -1
- package/src/components/inputs/inputText/index.vue +4 -4
- package/src/components/inputs/radioButton/index.vue +1 -1
- package/src/components/inputs/searchInput/index.vue +7 -8
- package/src/components/inputs/select/index.vue +208 -66
- package/src/components/inputs/select/option/index.vue +5 -5
- package/src/components/inputs/slider/index.vue +16 -16
- package/src/components/inputs/switchField/index.vue +2 -2
- package/src/components/inputs/textAreaInput/index.vue +2 -2
- package/src/components/inputs/toggle/index.vue +2 -2
- package/src/components/label/index.vue +27 -31
- package/src/components/modals/modal/index.vue +2 -6
- package/src/components/navigationTabs/index.vue +27 -20
- package/src/components/pageSubtitle/index.vue +1 -1
- package/src/components/pageTitle/index.vue +4 -4
- package/src/components/pagination/index.vue +5 -3
- package/src/components/progressBar/index.vue +1 -1
- package/src/components/projectMarker/index.vue +11 -8
- package/src/components/sideMenu/index.vue +1 -1
- package/src/components/spinner/index.vue +6 -11
- package/src/components/tableDropdown/index.vue +21 -26
- package/src/components/tables/mainTable/exampleNested.vue +1 -1
- package/src/components/tables/mainTable/index.vue +10 -9
- package/src/components/tables/viewTable/index.vue +2 -2
- package/src/components/threeDots/index.vue +1 -1
- package/src/components/videoThumbnail/index.vue +95 -100
- package/src/main.js +4 -11
- package/src/components/markerItem/index.vue +0 -96
- package/src/components/selectedOptions/index.vue +0 -145
@@ -3,7 +3,7 @@
|
|
3
3
|
<upper-container v-if="filterViews && filterViews.length">
|
4
4
|
<view-container :maxWidth="activeView.length">
|
5
5
|
<select-component
|
6
|
-
@click.
|
6
|
+
@click.stop
|
7
7
|
selectWidth="100%"
|
8
8
|
selectHeight="36px"
|
9
9
|
fontSize="13px"
|
@@ -19,10 +19,10 @@
|
|
19
19
|
<Option
|
20
20
|
v-for="(item, idx) in filterViews"
|
21
21
|
:key="idx + '_view'"
|
22
|
-
@click
|
22
|
+
@click="$emit('on-view-select', item)"
|
23
23
|
:value="item.name"
|
24
24
|
>{{ item.name }}
|
25
|
-
<delete-icon @click.
|
25
|
+
<delete-icon @click.stop="$emit('on-view-delete', item)"
|
26
26
|
/></Option>
|
27
27
|
</template>
|
28
28
|
</select-component>
|
@@ -55,28 +55,28 @@
|
|
55
55
|
ghost-class="ghost"
|
56
56
|
:setData="modifyDragItem"
|
57
57
|
v-model="item.dataOptions"
|
58
|
+
itemKey="choice"
|
58
59
|
>
|
59
|
-
<
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
<
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
</checkbox-wrapper>
|
60
|
+
<template #item="{ element: column }">
|
61
|
+
<checkbox-wrapper>
|
62
|
+
<drag-container class="drag-container">
|
63
|
+
<icon :name="'duplicate-1'" size="12px" />
|
64
|
+
</drag-container>
|
65
|
+
<checkbox
|
66
|
+
:label="column.text"
|
67
|
+
:isChecked="column.selected"
|
68
|
+
@on-event-handler="
|
69
|
+
onChange({
|
70
|
+
dataType: item.type,
|
71
|
+
value: $event,
|
72
|
+
choice: column.choice
|
73
|
+
})
|
74
|
+
"
|
75
|
+
size="small"
|
76
|
+
:isDisabled="column.selected && isCheckboxDisabled"
|
77
|
+
/>
|
78
|
+
</checkbox-wrapper>
|
79
|
+
</template>
|
80
80
|
</draggable>
|
81
81
|
</checkbox-container>
|
82
82
|
</row-container>
|
@@ -169,12 +169,19 @@
|
|
169
169
|
>
|
170
170
|
<row-label :data-id="filter.dataId">{{ filter.label }}</row-label>
|
171
171
|
<grid-container>
|
172
|
-
<
|
172
|
+
<VueDatePicker
|
173
173
|
:placeholder="$gettext('Date from')"
|
174
|
-
:
|
175
|
-
|
176
|
-
:
|
177
|
-
|
174
|
+
:locale="getDatePickerLanguage()"
|
175
|
+
:model-value="filter.range.start"
|
176
|
+
:enable-time-picker="false"
|
177
|
+
:clearable="false"
|
178
|
+
:auto-apply="true"
|
179
|
+
:disabled-dates="disableFutureDates"
|
180
|
+
format="yyyy-MM-dd"
|
181
|
+
model-type="format"
|
182
|
+
@focus="onDatepickerFocus(filter.range)"
|
183
|
+
@close="onDatepickerBlur()"
|
184
|
+
@update:model-value="
|
178
185
|
onChange({
|
179
186
|
dataType: item.type,
|
180
187
|
value: $event,
|
@@ -182,18 +189,20 @@
|
|
182
189
|
field: filter.field
|
183
190
|
})
|
184
191
|
"
|
185
|
-
@focus="onDatepickerFocus(filter.range)"
|
186
|
-
@close="onDatepickerBlur()"
|
187
|
-
format="YYYY-MM-DD"
|
188
|
-
valueType="format"
|
189
|
-
:disabled-date="disableFutureDates"
|
190
192
|
/>
|
191
|
-
<
|
193
|
+
<VueDatePicker
|
192
194
|
:placeholder="$gettext('Date to')"
|
193
|
-
:
|
194
|
-
|
195
|
-
:
|
196
|
-
|
195
|
+
:locale="getDatePickerLanguage()"
|
196
|
+
:model-value="filter.range.end"
|
197
|
+
:enable-time-picker="false"
|
198
|
+
:clearable="false"
|
199
|
+
:auto-apply="true"
|
200
|
+
:disabled-dates="disablePastDates"
|
201
|
+
format="yyyy-MM-dd"
|
202
|
+
model-type="format"
|
203
|
+
@focus="onDatepickerFocus(filter.range)"
|
204
|
+
@close="onDatepickerBlur()"
|
205
|
+
@update:model-value="
|
197
206
|
onChange({
|
198
207
|
dataType: item.type,
|
199
208
|
value: $event,
|
@@ -201,11 +210,6 @@
|
|
201
210
|
field: filter.field
|
202
211
|
})
|
203
212
|
"
|
204
|
-
@focus="onDatepickerFocus(filter.range)"
|
205
|
-
@close="onDatepickerBlur()"
|
206
|
-
format="YYYY-MM-DD"
|
207
|
-
valueType="format"
|
208
|
-
:disabled-date="disablePastDates"
|
209
213
|
/>
|
210
214
|
</grid-container>
|
211
215
|
</section-container>
|
@@ -247,33 +251,26 @@
|
|
247
251
|
v-if="buttonText.apply_view"
|
248
252
|
type="primary"
|
249
253
|
:text="buttonText.apply_view"
|
250
|
-
@click
|
254
|
+
@click="$emit('on-apply-current-view')"
|
251
255
|
/>
|
252
256
|
<main-button
|
253
257
|
type="secondary"
|
254
258
|
v-if="buttonText.save_view"
|
255
259
|
:text="buttonText.save_view"
|
256
|
-
@click
|
260
|
+
@click="$emit('on-save-new-view')"
|
257
261
|
/>
|
258
262
|
<main-button
|
259
263
|
type="cancel"
|
260
264
|
v-if="buttonText.cancel"
|
261
265
|
:text="buttonText.cancel"
|
262
|
-
@click
|
266
|
+
@click="$emit('on-cancel-view')"
|
263
267
|
/>
|
264
|
-
<reset-container v-if="!filterViews || !filterViews.length">
|
265
|
-
<reset-button @click="$emit('on-reset-filters')">
|
266
|
-
<icon :name="'update'" size="14px" :color="theme.colors.blue" />
|
267
|
-
<div>{{ $gettext('reset_filters') }}</div>
|
268
|
-
</reset-button>
|
269
|
-
</reset-container>
|
270
268
|
</button-container>
|
271
269
|
</container-wrapper>
|
272
270
|
</template>
|
273
271
|
|
274
272
|
<script>
|
275
|
-
import styled from '
|
276
|
-
import DatePicker from 'vue2-datepicker'
|
273
|
+
import styled from 'vue3-styled-components'
|
277
274
|
import SelectComponent from '../inputs/select'
|
278
275
|
import Option from '../inputs/select/option'
|
279
276
|
import InputNumber from '../inputs/inputNumber'
|
@@ -284,12 +281,7 @@ import Icon from '../icon'
|
|
284
281
|
import DeleteIcon from '../deleteIcon'
|
285
282
|
import { datePickerLang } from '../../helpers/translateLang'
|
286
283
|
import theme from '@/assets/theme.js'
|
287
|
-
import '
|
288
|
-
import 'vue2-datepicker/locale/de'
|
289
|
-
import 'vue2-datepicker/locale/en'
|
290
|
-
import 'vue2-datepicker/locale/es'
|
291
|
-
import 'vue2-datepicker/locale/fr'
|
292
|
-
import 'vue2-datepicker/locale/it'
|
284
|
+
import VueDatePicker from '@vuepic/vue-datepicker'
|
293
285
|
|
294
286
|
const ContainerWrapper = styled.div`
|
295
287
|
position: absolute;
|
@@ -334,16 +326,6 @@ const ButtonContainer = styled.div`
|
|
334
326
|
padding: 15px;
|
335
327
|
`
|
336
328
|
|
337
|
-
const ResetContainer = styled.div`
|
338
|
-
display: grid;
|
339
|
-
align-content: center;
|
340
|
-
margin-left: auto;
|
341
|
-
div {
|
342
|
-
margin-top: 0;
|
343
|
-
align-self: center;
|
344
|
-
}
|
345
|
-
`
|
346
|
-
|
347
329
|
const ColumnContainer = styled.div``
|
348
330
|
|
349
331
|
const DragContainer = styled.div`
|
@@ -398,46 +380,6 @@ const RowWrapper = styled.div`
|
|
398
380
|
margin-bottom: 12px;
|
399
381
|
`
|
400
382
|
|
401
|
-
const DatePickerInput = styled(DatePicker)`
|
402
|
-
border: 1px solid ${(props) => props.theme.colors.grey4};
|
403
|
-
border-radius: 4px;
|
404
|
-
padding: 7px 12px 7px 7px;
|
405
|
-
width: 100%;
|
406
|
-
position: relative;
|
407
|
-
|
408
|
-
&.mx-datepicker {
|
409
|
-
width: 100% !important;
|
410
|
-
max-width: 100%;
|
411
|
-
height: 36px;
|
412
|
-
align-self: flex-end;
|
413
|
-
}
|
414
|
-
|
415
|
-
.mx-input-wrapper {
|
416
|
-
position: unset;
|
417
|
-
|
418
|
-
input {
|
419
|
-
border: none;
|
420
|
-
height: auto;
|
421
|
-
padding: 0;
|
422
|
-
font-size: 13px;
|
423
|
-
box-shadow: none;
|
424
|
-
color: #393939;
|
425
|
-
vertical-align: bottom;
|
426
|
-
}
|
427
|
-
|
428
|
-
.mx-input-append {
|
429
|
-
top: 1px;
|
430
|
-
}
|
431
|
-
}
|
432
|
-
|
433
|
-
.mx-input-append {
|
434
|
-
left: 0;
|
435
|
-
top: 5px;
|
436
|
-
height: auto;
|
437
|
-
cursor: pointer;
|
438
|
-
}
|
439
|
-
`
|
440
|
-
|
441
383
|
const LabelAttrs = {
|
442
384
|
marginTop: Boolean
|
443
385
|
}
|
@@ -502,7 +444,6 @@ export default {
|
|
502
444
|
Icon,
|
503
445
|
DragContainer,
|
504
446
|
InputNumber,
|
505
|
-
DatePickerInput,
|
506
447
|
RowLabel,
|
507
448
|
SectionContainer,
|
508
449
|
GridContainer,
|
@@ -510,7 +451,7 @@ export default {
|
|
510
451
|
DeleteIcon,
|
511
452
|
UpperContainer,
|
512
453
|
ResetButton,
|
513
|
-
|
454
|
+
VueDatePicker
|
514
455
|
},
|
515
456
|
props: {
|
516
457
|
filterData: {
|
@@ -29,7 +29,7 @@
|
|
29
29
|
</template>
|
30
30
|
|
31
31
|
<script>
|
32
|
-
import styled from '
|
32
|
+
import styled from 'vue3-styled-components'
|
33
33
|
import parentDropdown from './parentDropdown'
|
34
34
|
import filterSettings from './filterSettings'
|
35
35
|
|
@@ -93,9 +93,9 @@ export default {
|
|
93
93
|
}, 100)
|
94
94
|
},
|
95
95
|
clickOutside(event) {
|
96
|
-
const target = event.target
|
97
96
|
if (
|
98
|
-
|
97
|
+
this.$refs.dropdown &&
|
98
|
+
!this.$refs.dropdown.$el.contains(event.target) &&
|
99
99
|
!this.preventOutsideClick
|
100
100
|
) {
|
101
101
|
this.isDropdownOpen = false
|
@@ -9,7 +9,7 @@
|
|
9
9
|
</title-text>
|
10
10
|
<arrow-wrapper>
|
11
11
|
<icon
|
12
|
-
@click.
|
12
|
+
@click.stop="$emit('on-toggle')"
|
13
13
|
:name="isOpen ? 'arrow_up' : 'arrow_down'"
|
14
14
|
size="12px"
|
15
15
|
/>
|
@@ -19,7 +19,7 @@
|
|
19
19
|
</template>
|
20
20
|
|
21
21
|
<script>
|
22
|
-
import styled from '
|
22
|
+
import styled from 'vue3-styled-components'
|
23
23
|
import Icon from '../icon'
|
24
24
|
|
25
25
|
const PageWrapper = styled.div`
|
@@ -0,0 +1,23 @@
|
|
1
|
+
const iconCache = {}
|
2
|
+
|
3
|
+
export const fetchIcon = async (fileName) => {
|
4
|
+
if (iconCache[fileName]) {
|
5
|
+
return iconCache[fileName]
|
6
|
+
}
|
7
|
+
|
8
|
+
// We need to use "new URL" to load dynamic assets (https://vitejs.dev/guide/assets.html#new-url-url-import-meta-url)
|
9
|
+
const fetchUrl = new URL(
|
10
|
+
`../../assets/svgIcons/${fileName}.svg`,
|
11
|
+
import.meta.url
|
12
|
+
).href
|
13
|
+
|
14
|
+
try {
|
15
|
+
const response = await fetch(fetchUrl)
|
16
|
+
const rawFile = await response.text()
|
17
|
+
iconCache[fileName] = rawFile
|
18
|
+
|
19
|
+
return rawFile
|
20
|
+
} catch (error) {
|
21
|
+
console.error(`Failed to load ${fileName}.svg`)
|
22
|
+
}
|
23
|
+
}
|
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
<script>
|
18
18
|
import icon from './index.vue'
|
19
|
-
import styled from '
|
19
|
+
import styled from 'vue3-styled-components'
|
20
20
|
|
21
21
|
const Wrapper = styled.div`
|
22
22
|
display: block;
|
@@ -36,7 +36,7 @@ const IconWrapper = styled.div`
|
|
36
36
|
margin: 10px;
|
37
37
|
`
|
38
38
|
export default {
|
39
|
-
name: '
|
39
|
+
name: 'collectionComponent',
|
40
40
|
components: { icon, IconWrapper, Wrapper },
|
41
41
|
props: {
|
42
42
|
size: { required: false },
|
@@ -1,19 +1,13 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
<icon-image
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
v-html="
|
9
|
-
require(`!html-loader!./../../assets/svgIcons/${name.toLowerCase()}.svg`)
|
10
|
-
"
|
11
|
-
></icon-image>
|
12
|
-
<striked-line v-if="isStriked" :color="color" :disabled="disabled" :hoveredColor="hoveredColor"></striked-line>
|
13
|
-
</Wrapper>
|
2
|
+
<wrapper>
|
3
|
+
<icon-image>
|
4
|
+
<i v-html="icon.html" />
|
5
|
+
</icon-image>
|
6
|
+
<striked-line v-if="isStriked"></striked-line>
|
7
|
+
</wrapper>
|
14
8
|
</template>
|
15
9
|
|
16
|
-
<script>
|
10
|
+
<script setup>
|
17
11
|
// import Icon from "@eturnity/eturnity_reusable_components/src/components/icon"
|
18
12
|
// How to use:
|
19
13
|
//<icon
|
@@ -25,92 +19,95 @@
|
|
25
19
|
// isStriked = "true"
|
26
20
|
// />
|
27
21
|
|
28
|
-
import
|
22
|
+
import { onMounted, reactive, watch } from 'vue'
|
23
|
+
import styled from 'vue3-styled-components'
|
24
|
+
import { fetchIcon } from './iconCache'
|
29
25
|
|
30
|
-
const
|
31
|
-
|
26
|
+
const props = defineProps({
|
27
|
+
disabled: {
|
28
|
+
required: false,
|
29
|
+
default: false
|
30
|
+
},
|
31
|
+
name: {
|
32
|
+
required: true
|
33
|
+
},
|
34
|
+
color: {
|
35
|
+
required: false
|
36
|
+
},
|
37
|
+
hoveredColor: {
|
38
|
+
required: false
|
39
|
+
},
|
40
|
+
size: {
|
41
|
+
required: false,
|
42
|
+
default: '30px'
|
43
|
+
},
|
44
|
+
cursor: {
|
45
|
+
required: false,
|
46
|
+
default: null
|
47
|
+
},
|
48
|
+
isStriked: {
|
49
|
+
required: false,
|
50
|
+
default: false
|
51
|
+
}
|
52
|
+
})
|
53
|
+
|
54
|
+
const Wrapper = styled('div')`
|
32
55
|
display: flex;
|
33
56
|
position: relative;
|
34
57
|
align-content: center;
|
35
58
|
justify-content: center;
|
36
|
-
width: ${
|
37
|
-
height: ${
|
38
|
-
min-width: ${
|
39
|
-
min-height: ${
|
40
|
-
cursor: ${
|
59
|
+
width: ${props.size};
|
60
|
+
height: ${props.size};
|
61
|
+
min-width: ${props.size};
|
62
|
+
min-height: ${props.size};
|
63
|
+
cursor: ${props.disabled ? 'not-allowed' : props.cursor};
|
41
64
|
line-height: 0;
|
42
65
|
`
|
43
|
-
const strikedAttrs = {
|
44
|
-
|
66
|
+
const strikedAttrs = {
|
67
|
+
isDisabled: Boolean,
|
68
|
+
color: String,
|
69
|
+
hoveredColor: String
|
70
|
+
}
|
71
|
+
const StrikedLine = styled.div`
|
45
72
|
display: flex;
|
46
73
|
position: absolute;
|
47
|
-
bottom:0;
|
48
|
-
left:0;
|
74
|
+
bottom: 0;
|
75
|
+
left: 0;
|
49
76
|
align-content: center;
|
50
77
|
justify-content: center;
|
51
78
|
width: 143%;
|
52
|
-
height:8%;
|
53
|
-
background-color: ${(
|
79
|
+
height: 8%;
|
80
|
+
background-color: ${({ theme }) => theme.colors[props.color] || props.color};
|
54
81
|
min-height: 0;
|
55
82
|
line-height: 0;
|
56
83
|
transform-origin: 0% 100%;
|
57
84
|
transform: rotate(-45deg);
|
58
85
|
`
|
59
|
-
const
|
60
|
-
const IconImage = styled('div', IconImageProps)`
|
86
|
+
const IconImage = styled.div`
|
61
87
|
width: 100%;
|
62
88
|
svg {
|
63
89
|
width: 100%;
|
64
90
|
height: 100%;
|
65
91
|
}
|
66
92
|
svg path {
|
67
|
-
${(
|
68
|
-
props.color && `fill: ${
|
93
|
+
${({ theme }) =>
|
94
|
+
props.color && `fill: ${theme.colors[props.color] || props.color};`}
|
69
95
|
}
|
70
96
|
&:hover > svg path {
|
71
|
-
${
|
97
|
+
${props.hoveredColor && `fill: ${props.hoveredColor};`}
|
72
98
|
}
|
73
99
|
&:hover + div {
|
74
|
-
background-color: ${
|
100
|
+
background-color: ${props.hoveredColor};
|
75
101
|
}
|
76
102
|
`
|
77
103
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
Wrapper,
|
83
|
-
strikedLine
|
84
|
-
},
|
85
|
-
props: {
|
86
|
-
disabled: {
|
87
|
-
required: false,
|
88
|
-
default: false
|
89
|
-
},
|
90
|
-
name: {
|
91
|
-
required: true
|
92
|
-
},
|
93
|
-
color: {
|
94
|
-
required: false
|
95
|
-
},
|
96
|
-
hoveredColor: {
|
97
|
-
required: false
|
98
|
-
},
|
99
|
-
size: {
|
100
|
-
required: false,
|
101
|
-
default: '30px'
|
102
|
-
},
|
103
|
-
cursor: {
|
104
|
-
required: false,
|
105
|
-
default: null
|
106
|
-
},
|
107
|
-
isStriked: {
|
108
|
-
required: false,
|
109
|
-
default: false
|
110
|
-
}
|
111
|
-
},
|
112
|
-
data() {
|
113
|
-
return {}
|
114
|
-
}
|
104
|
+
const icon = reactive({ html: '' })
|
105
|
+
|
106
|
+
const loadSvg = async () => {
|
107
|
+
icon.html = await fetchIcon(props.name.toLowerCase())
|
115
108
|
}
|
109
|
+
|
110
|
+
onMounted(() => loadSvg())
|
111
|
+
|
112
|
+
watch(() => props.name, loadSvg)
|
116
113
|
</script>
|
@@ -42,7 +42,7 @@
|
|
42
42
|
// size="60px" by default, this is 30px
|
43
43
|
// />
|
44
44
|
|
45
|
-
import styled from '
|
45
|
+
import styled from 'vue3-styled-components'
|
46
46
|
import icon from '../icon'
|
47
47
|
const wrapperAttrs = {
|
48
48
|
color: String,
|
@@ -148,9 +148,6 @@ export default {
|
|
148
148
|
required: false,
|
149
149
|
default: false
|
150
150
|
}
|
151
|
-
},
|
152
|
-
data() {
|
153
|
-
return {}
|
154
151
|
}
|
155
152
|
}
|
156
153
|
</script>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
</template>
|
9
9
|
|
10
10
|
<script>
|
11
|
-
import styled from '
|
11
|
+
import styled from 'vue3-styled-components'
|
12
12
|
import Icon from '../icon'
|
13
13
|
|
14
14
|
const InfoContainer = styled.div`
|
@@ -24,7 +24,6 @@ const TextContainer = styled.div`
|
|
24
24
|
width: 100%;
|
25
25
|
`
|
26
26
|
|
27
|
-
|
28
27
|
export default {
|
29
28
|
name: 'InfoCard',
|
30
29
|
components: {
|
@@ -33,4 +32,4 @@ export default {
|
|
33
32
|
TextContainer
|
34
33
|
}
|
35
34
|
}
|
36
|
-
</script>
|
35
|
+
</script>
|
@@ -30,7 +30,7 @@
|
|
30
30
|
// alignArrow="right" // which side the arrow should be on
|
31
31
|
// />
|
32
32
|
import theme from '../../assets/theme.js'
|
33
|
-
import styled from '
|
33
|
+
import styled from 'vue3-styled-components'
|
34
34
|
import icon from '../icon'
|
35
35
|
|
36
36
|
const textAttrs = {
|
@@ -3,11 +3,10 @@
|
|
3
3
|
<container
|
4
4
|
:checkColor="checkColor"
|
5
5
|
:size="size"
|
6
|
-
:hasLabel="
|
6
|
+
:hasLabel="hasLabel"
|
7
7
|
:backgroundColor="backgroundColor"
|
8
8
|
:isChecked="isChecked"
|
9
9
|
:isDisabled="isDisabled"
|
10
|
-
:cursorType="cursorType"
|
11
10
|
>
|
12
11
|
<input-checkbox
|
13
12
|
type="checkbox"
|
@@ -15,10 +14,10 @@
|
|
15
14
|
:data-id="dataId"
|
16
15
|
@change="onChangeHandler(!isChecked)"
|
17
16
|
/>
|
18
|
-
<
|
17
|
+
<check-wrapper :hasLabel="hasLabel">
|
19
18
|
<span class="checkmark"></span>
|
20
|
-
</
|
21
|
-
<label-text v-if="
|
19
|
+
</check-wrapper>
|
20
|
+
<label-text v-if="hasLabel">{{ label }}</label-text>
|
22
21
|
</container>
|
23
22
|
</component-wrapper>
|
24
23
|
</template>
|
@@ -34,22 +33,29 @@
|
|
34
33
|
// size="small"
|
35
34
|
// backgroundColor="red"
|
36
35
|
// :isDisabled="true"
|
37
|
-
// cursorType="default"
|
38
36
|
// />
|
39
|
-
import styled from '
|
37
|
+
import styled from 'vue3-styled-components'
|
40
38
|
|
41
39
|
const ComponentWrapper = styled.div`
|
42
40
|
min-height: 18px;
|
43
41
|
`
|
44
42
|
|
43
|
+
const CheckWrapper = styled('div', { hasLabel: Boolean })`
|
44
|
+
${(props) =>
|
45
|
+
props.hasLabel &&
|
46
|
+
`
|
47
|
+
display: flex;
|
48
|
+
align-items: center;
|
49
|
+
`}
|
50
|
+
`
|
51
|
+
|
45
52
|
const containerAttrs = {
|
46
53
|
checkColor: String,
|
47
54
|
size: String,
|
48
55
|
hasLabel: Boolean,
|
49
56
|
backgroundColor: String,
|
50
57
|
isChecked: Boolean,
|
51
|
-
isDisabled: Boolean
|
52
|
-
cursorType: String
|
58
|
+
isDisabled: Boolean
|
53
59
|
}
|
54
60
|
const Container = styled('label', containerAttrs)`
|
55
61
|
display: grid;
|
@@ -58,7 +64,7 @@ const Container = styled('label', containerAttrs)`
|
|
58
64
|
align-content: center;
|
59
65
|
color: ${(props) => props.theme.colors.black};
|
60
66
|
position: relative;
|
61
|
-
cursor: ${(props) => (props.isDisabled ? 'not-allowed' :
|
67
|
+
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
|
62
68
|
font-size: 16px;
|
63
69
|
user-select: none;
|
64
70
|
|
@@ -83,7 +89,7 @@ const Container = styled('label', containerAttrs)`
|
|
83
89
|
: props.theme.colors.green
|
84
90
|
: props.isDisabled
|
85
91
|
? props.theme.colors.lightGray
|
86
|
-
:
|
92
|
+
: '#fff'};
|
87
93
|
border-radius: 4px;
|
88
94
|
border: 1px solid
|
89
95
|
${(props) =>
|
@@ -148,7 +154,8 @@ export default {
|
|
148
154
|
ComponentWrapper,
|
149
155
|
Container,
|
150
156
|
InputCheckbox,
|
151
|
-
LabelText
|
157
|
+
LabelText,
|
158
|
+
CheckWrapper
|
152
159
|
},
|
153
160
|
props: {
|
154
161
|
label: {
|
@@ -176,10 +183,11 @@ export default {
|
|
176
183
|
dataId: {
|
177
184
|
type: String,
|
178
185
|
default: ''
|
179
|
-
}
|
180
|
-
|
181
|
-
|
182
|
-
|
186
|
+
}
|
187
|
+
},
|
188
|
+
computed: {
|
189
|
+
hasLabel() {
|
190
|
+
return !!this.label.length
|
183
191
|
}
|
184
192
|
},
|
185
193
|
methods: {
|