@eturnity/eturnity_reusable_components 7.8.6-EPDM-7951.0 → 7.10.0-EPDM-10163.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 +23 -18
- package/src/App.vue +2 -2
- package/src/assets/svgIcons/expand.svg +1 -0
- package/src/assets/svgIcons/split.svg +45 -0
- package/src/assets/theme.js +2 -0
- package/src/components/addNewButton/index.vue +3 -5
- 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 +1 -6
- package/src/components/deleteIcon/DeleteIcon.stories.js +7 -7
- package/src/components/deleteIcon/index.vue +21 -25
- package/src/components/draggableInputHandle/index.vue +25 -24
- package/src/components/dropdown/index.vue +110 -129
- package/src/components/errorMessage/index.vue +1 -1
- package/src/components/filter/filterSettings.vue +97 -55
- package/src/components/filter/index.vue +3 -3
- package/src/components/filter/parentDropdown.vue +2 -2
- package/src/components/icon/iconCollection.vue +2 -2
- package/src/components/icon/index.vue +55 -57
- package/src/components/iconWrapper/index.vue +5 -2
- package/src/components/infoCard/index.vue +3 -2
- package/src/components/infoText/index.vue +6 -2
- package/src/components/inputs/checkbox/index.vue +6 -21
- package/src/components/inputs/inputNumber/index.vue +12 -8
- package/src/components/inputs/inputNumberQuestion/index.vue +1 -1
- package/src/components/inputs/inputText/index.vue +8 -3
- package/src/components/inputs/radioButton/index.vue +1 -1
- package/src/components/inputs/searchInput/index.vue +8 -7
- package/src/components/inputs/select/index.vue +72 -213
- 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 +1 -1
- package/src/components/inputs/toggle/index.vue +2 -2
- package/src/components/label/index.vue +32 -27
- package/src/components/modals/modal/index.vue +8 -13
- package/src/components/navigationTabs/index.vue +30 -37
- package/src/components/pageSubtitle/index.vue +1 -1
- package/src/components/pageTitle/index.vue +19 -20
- package/src/components/pagination/index.vue +1 -1
- package/src/components/progressBar/index.vue +1 -1
- package/src/components/projectMarker/index.vue +7 -10
- package/src/components/sideMenu/index.vue +1 -1
- package/src/components/spinner/index.vue +11 -6
- package/src/components/tableDropdown/index.vue +26 -21
- package/src/components/tables/mainTable/exampleNested.vue +1 -1
- package/src/components/tables/mainTable/index.vue +1 -2
- package/src/components/tables/viewTable/index.vue +2 -2
- package/src/components/threeDots/index.vue +1 -1
- package/src/components/videoThumbnail/index.vue +100 -95
- package/src/main.js +11 -4
@@ -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.stop
|
6
|
+
@click.native.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="$emit('on-view-select', item)"
|
22
|
+
@click.native="$emit('on-view-select', item)"
|
23
23
|
:value="item.name"
|
24
24
|
>{{ item.name }}
|
25
|
-
<delete-icon @click.stop="$emit('on-view-delete', item)"
|
25
|
+
<delete-icon @click.native.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"
|
59
58
|
>
|
60
|
-
<
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
<
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
59
|
+
<checkbox-wrapper
|
60
|
+
v-for="(column, index) in item.dataOptions"
|
61
|
+
:key="index + 'dataOption'"
|
62
|
+
>
|
63
|
+
<drag-container class="drag-container">
|
64
|
+
<icon :name="'duplicate-1'" size="12px" />
|
65
|
+
</drag-container>
|
66
|
+
<checkbox
|
67
|
+
:label="column.text"
|
68
|
+
:isChecked="column.selected"
|
69
|
+
@on-event-handler="
|
70
|
+
onChange({
|
71
|
+
dataType: item.type,
|
72
|
+
value: $event,
|
73
|
+
choice: column.choice
|
74
|
+
})
|
75
|
+
"
|
76
|
+
size="small"
|
77
|
+
:isDisabled="column.selected && isCheckboxDisabled"
|
78
|
+
/>
|
79
|
+
</checkbox-wrapper>
|
80
80
|
</draggable>
|
81
81
|
</checkbox-container>
|
82
82
|
</row-container>
|
@@ -169,19 +169,12 @@
|
|
169
169
|
>
|
170
170
|
<row-label :data-id="filter.dataId">{{ filter.label }}</row-label>
|
171
171
|
<grid-container>
|
172
|
-
<
|
172
|
+
<date-picker-input
|
173
173
|
:placeholder="$gettext('Date from')"
|
174
|
-
:
|
175
|
-
|
176
|
-
:
|
177
|
-
|
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="
|
174
|
+
:lang="getDatePickerLanguage()"
|
175
|
+
type="date"
|
176
|
+
:value="filter.range.start"
|
177
|
+
@change="
|
185
178
|
onChange({
|
186
179
|
dataType: item.type,
|
187
180
|
value: $event,
|
@@ -189,20 +182,18 @@
|
|
189
182
|
field: filter.field
|
190
183
|
})
|
191
184
|
"
|
192
|
-
/>
|
193
|
-
<VueDatePicker
|
194
|
-
:placeholder="$gettext('Date to')"
|
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
185
|
@focus="onDatepickerFocus(filter.range)"
|
204
186
|
@close="onDatepickerBlur()"
|
205
|
-
|
187
|
+
format="YYYY-MM-DD"
|
188
|
+
valueType="format"
|
189
|
+
:disabled-date="disableFutureDates"
|
190
|
+
/>
|
191
|
+
<date-picker-input
|
192
|
+
:placeholder="$gettext('Date to')"
|
193
|
+
:lang="getDatePickerLanguage()"
|
194
|
+
type="date"
|
195
|
+
:value="filter.range.end"
|
196
|
+
@change="
|
206
197
|
onChange({
|
207
198
|
dataType: item.type,
|
208
199
|
value: $event,
|
@@ -210,6 +201,11 @@
|
|
210
201
|
field: filter.field
|
211
202
|
})
|
212
203
|
"
|
204
|
+
@focus="onDatepickerFocus(filter.range)"
|
205
|
+
@close="onDatepickerBlur()"
|
206
|
+
format="YYYY-MM-DD"
|
207
|
+
valueType="format"
|
208
|
+
:disabled-date="disablePastDates"
|
213
209
|
/>
|
214
210
|
</grid-container>
|
215
211
|
</section-container>
|
@@ -251,26 +247,27 @@
|
|
251
247
|
v-if="buttonText.apply_view"
|
252
248
|
type="primary"
|
253
249
|
:text="buttonText.apply_view"
|
254
|
-
@click="$emit('on-apply-current-view')"
|
250
|
+
@click.native="$emit('on-apply-current-view')"
|
255
251
|
/>
|
256
252
|
<main-button
|
257
253
|
type="secondary"
|
258
254
|
v-if="buttonText.save_view"
|
259
255
|
:text="buttonText.save_view"
|
260
|
-
@click="$emit('on-save-new-view')"
|
256
|
+
@click.native="$emit('on-save-new-view')"
|
261
257
|
/>
|
262
258
|
<main-button
|
263
259
|
type="cancel"
|
264
260
|
v-if="buttonText.cancel"
|
265
261
|
:text="buttonText.cancel"
|
266
|
-
@click="$emit('on-cancel-view')"
|
262
|
+
@click.native="$emit('on-cancel-view')"
|
267
263
|
/>
|
268
264
|
</button-container>
|
269
265
|
</container-wrapper>
|
270
266
|
</template>
|
271
267
|
|
272
268
|
<script>
|
273
|
-
import styled from '
|
269
|
+
import styled from 'vue-styled-components'
|
270
|
+
import DatePicker from 'vue2-datepicker'
|
274
271
|
import SelectComponent from '../inputs/select'
|
275
272
|
import Option from '../inputs/select/option'
|
276
273
|
import InputNumber from '../inputs/inputNumber'
|
@@ -281,7 +278,12 @@ import Icon from '../icon'
|
|
281
278
|
import DeleteIcon from '../deleteIcon'
|
282
279
|
import { datePickerLang } from '../../helpers/translateLang'
|
283
280
|
import theme from '@/assets/theme.js'
|
284
|
-
import
|
281
|
+
import 'vue2-datepicker/index.css'
|
282
|
+
import 'vue2-datepicker/locale/de'
|
283
|
+
import 'vue2-datepicker/locale/en'
|
284
|
+
import 'vue2-datepicker/locale/es'
|
285
|
+
import 'vue2-datepicker/locale/fr'
|
286
|
+
import 'vue2-datepicker/locale/it'
|
285
287
|
|
286
288
|
const ContainerWrapper = styled.div`
|
287
289
|
position: absolute;
|
@@ -380,6 +382,46 @@ const RowWrapper = styled.div`
|
|
380
382
|
margin-bottom: 12px;
|
381
383
|
`
|
382
384
|
|
385
|
+
const DatePickerInput = styled(DatePicker)`
|
386
|
+
border: 1px solid ${(props) => props.theme.colors.grey4};
|
387
|
+
border-radius: 4px;
|
388
|
+
padding: 7px 12px 7px 7px;
|
389
|
+
width: 100%;
|
390
|
+
position: relative;
|
391
|
+
|
392
|
+
&.mx-datepicker {
|
393
|
+
width: 100% !important;
|
394
|
+
max-width: 100%;
|
395
|
+
height: 36px;
|
396
|
+
align-self: flex-end;
|
397
|
+
}
|
398
|
+
|
399
|
+
.mx-input-wrapper {
|
400
|
+
position: unset;
|
401
|
+
|
402
|
+
input {
|
403
|
+
border: none;
|
404
|
+
height: auto;
|
405
|
+
padding: 0;
|
406
|
+
font-size: 13px;
|
407
|
+
box-shadow: none;
|
408
|
+
color: #393939;
|
409
|
+
vertical-align: bottom;
|
410
|
+
}
|
411
|
+
|
412
|
+
.mx-input-append {
|
413
|
+
top: 1px;
|
414
|
+
}
|
415
|
+
}
|
416
|
+
|
417
|
+
.mx-input-append {
|
418
|
+
left: 0;
|
419
|
+
top: 5px;
|
420
|
+
height: auto;
|
421
|
+
cursor: pointer;
|
422
|
+
}
|
423
|
+
`
|
424
|
+
|
383
425
|
const LabelAttrs = {
|
384
426
|
marginTop: Boolean
|
385
427
|
}
|
@@ -444,14 +486,14 @@ export default {
|
|
444
486
|
Icon,
|
445
487
|
DragContainer,
|
446
488
|
InputNumber,
|
489
|
+
DatePickerInput,
|
447
490
|
RowLabel,
|
448
491
|
SectionContainer,
|
449
492
|
GridContainer,
|
450
493
|
ViewContainer,
|
451
494
|
DeleteIcon,
|
452
495
|
UpperContainer,
|
453
|
-
ResetButton
|
454
|
-
VueDatePicker
|
496
|
+
ResetButton
|
455
497
|
},
|
456
498
|
props: {
|
457
499
|
filterData: {
|
@@ -29,7 +29,7 @@
|
|
29
29
|
</template>
|
30
30
|
|
31
31
|
<script>
|
32
|
-
import styled from '
|
32
|
+
import styled from 'vue-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
|
96
97
|
if (
|
97
|
-
this.$refs.dropdown &&
|
98
|
-
!this.$refs.dropdown.$el.contains(event.target) &&
|
98
|
+
!this.$refs.dropdown.$el.contains(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.stop="$emit('on-toggle')"
|
12
|
+
@click.native.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 'vue-styled-components'
|
23
23
|
import Icon from '../icon'
|
24
24
|
|
25
25
|
const PageWrapper = styled.div`
|
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
<script>
|
18
18
|
import icon from './index.vue'
|
19
|
-
import styled from '
|
19
|
+
import styled from 'vue-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: 'collection',
|
40
40
|
components: { icon, IconWrapper, Wrapper },
|
41
41
|
props: {
|
42
42
|
size: { required: false },
|
@@ -1,18 +1,19 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
<icon-image
|
4
|
-
<i v-html="icon.html" />
|
5
|
-
</icon-image>
|
6
|
-
<striked-line
|
7
|
-
v-if="isStriked"
|
8
|
-
:color="color"
|
2
|
+
<Wrapper :isDisabled="disabled" :size="size" :cursor="cursor">
|
3
|
+
<icon-image
|
9
4
|
:disabled="disabled"
|
5
|
+
:size="size"
|
6
|
+
:color="color"
|
10
7
|
:hoveredColor="hoveredColor"
|
11
|
-
|
12
|
-
|
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>
|
13
14
|
</template>
|
14
15
|
|
15
|
-
<script
|
16
|
+
<script>
|
16
17
|
// import Icon from "@eturnity/eturnity_reusable_components/src/components/icon"
|
17
18
|
// How to use:
|
18
19
|
//<icon
|
@@ -24,8 +25,8 @@
|
|
24
25
|
// isStriked = "true"
|
25
26
|
// />
|
26
27
|
|
27
|
-
import
|
28
|
-
|
28
|
+
import styled from 'vue-styled-components'
|
29
|
+
|
29
30
|
const wrapperAttrs = { isDisabled: Boolean, size: String, cursor: String }
|
30
31
|
const Wrapper = styled('div', wrapperAttrs)`
|
31
32
|
display: flex;
|
@@ -39,22 +40,17 @@ const Wrapper = styled('div', wrapperAttrs)`
|
|
39
40
|
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : props.cursor)};
|
40
41
|
line-height: 0;
|
41
42
|
`
|
42
|
-
const strikedAttrs = {
|
43
|
-
|
44
|
-
color: String,
|
45
|
-
hoveredColor: String
|
46
|
-
}
|
47
|
-
const StrikedLine = styled('div', strikedAttrs)`
|
43
|
+
const strikedAttrs = { isDisabled: Boolean, color: String, hoveredColor: String }
|
44
|
+
const strikedLine = styled('div', strikedAttrs)`
|
48
45
|
display: flex;
|
49
46
|
position: absolute;
|
50
|
-
bottom:
|
51
|
-
left:
|
47
|
+
bottom:0;
|
48
|
+
left:0;
|
52
49
|
align-content: center;
|
53
50
|
justify-content: center;
|
54
51
|
width: 143%;
|
55
|
-
height:
|
56
|
-
background-color: ${(props)
|
57
|
-
props.theme.colors[props.color] || props.color};
|
52
|
+
height:8%;
|
53
|
+
background-color: ${(props)=>props.theme.colors[props.color] || props.color};
|
58
54
|
min-height: 0;
|
59
55
|
line-height: 0;
|
60
56
|
transform-origin: 0% 100%;
|
@@ -75,44 +71,46 @@ const IconImage = styled('div', IconImageProps)`
|
|
75
71
|
${(props) => props.hoveredColor && `fill: ${props.hoveredColor};`}
|
76
72
|
}
|
77
73
|
&:hover + div {
|
78
|
-
background-color: ${(props)
|
74
|
+
background-color: ${(props)=>props.hoveredColor};
|
79
75
|
}
|
80
76
|
`
|
81
77
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
required: true
|
89
|
-
},
|
90
|
-
color: {
|
91
|
-
required: false
|
78
|
+
export default {
|
79
|
+
name: 'icon',
|
80
|
+
components: {
|
81
|
+
IconImage,
|
82
|
+
Wrapper,
|
83
|
+
strikedLine
|
92
84
|
},
|
93
|
-
|
94
|
-
|
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
|
+
}
|
95
111
|
},
|
96
|
-
|
97
|
-
|
98
|
-
default: '30px'
|
99
|
-
},
|
100
|
-
cursor: {
|
101
|
-
required: false,
|
102
|
-
default: null
|
103
|
-
},
|
104
|
-
isStriked: {
|
105
|
-
required: false,
|
106
|
-
default: false
|
112
|
+
data() {
|
113
|
+
return {}
|
107
114
|
}
|
108
|
-
}
|
109
|
-
|
110
|
-
const icon = reactive({ html: '' })
|
111
|
-
|
112
|
-
onMounted(async () => {
|
113
|
-
const iconPath = `../../assets/svgIcons/${props.name.toLowerCase()}.svg?raw`
|
114
|
-
const module = await import(/* @vite-ignore */ iconPath)
|
115
|
-
|
116
|
-
icon.html = module.default
|
117
|
-
})
|
115
|
+
}
|
118
116
|
</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 'vue-styled-components'
|
46
46
|
import icon from '../icon'
|
47
47
|
const wrapperAttrs = {
|
48
48
|
color: String,
|
@@ -118,7 +118,7 @@ export default {
|
|
118
118
|
},
|
119
119
|
hoveredBackgroundColor: {
|
120
120
|
required: false,
|
121
|
-
default: '
|
121
|
+
default: 'transparentWhite2'
|
122
122
|
},
|
123
123
|
size: {
|
124
124
|
required: false,
|
@@ -148,6 +148,9 @@ export default {
|
|
148
148
|
required: false,
|
149
149
|
default: false
|
150
150
|
}
|
151
|
+
},
|
152
|
+
data() {
|
153
|
+
return {}
|
151
154
|
}
|
152
155
|
}
|
153
156
|
</script>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
</template>
|
9
9
|
|
10
10
|
<script>
|
11
|
-
import styled from '
|
11
|
+
import styled from 'vue-styled-components'
|
12
12
|
import Icon from '../icon'
|
13
13
|
|
14
14
|
const InfoContainer = styled.div`
|
@@ -24,6 +24,7 @@ const TextContainer = styled.div`
|
|
24
24
|
width: 100%;
|
25
25
|
`
|
26
26
|
|
27
|
+
|
27
28
|
export default {
|
28
29
|
name: 'InfoCard',
|
29
30
|
components: {
|
@@ -32,4 +33,4 @@ export default {
|
|
32
33
|
TextContainer
|
33
34
|
}
|
34
35
|
}
|
35
|
-
</script>
|
36
|
+
</script>
|
@@ -32,7 +32,7 @@
|
|
32
32
|
// alignArrow="right" // which side the arrow should be on
|
33
33
|
// />
|
34
34
|
import theme from '../../assets/theme.js'
|
35
|
-
import styled from '
|
35
|
+
import styled from 'vue-styled-components'
|
36
36
|
import icon from '../icon'
|
37
37
|
|
38
38
|
const textAttrs = {
|
@@ -157,7 +157,11 @@ export default {
|
|
157
157
|
},
|
158
158
|
computed: {
|
159
159
|
iconColor() {
|
160
|
-
return
|
160
|
+
return this.isActive
|
161
|
+
? this.borderColor
|
162
|
+
? this.borderColor
|
163
|
+
: theme.colors.secondary
|
164
|
+
: theme.colors.mediumGray
|
161
165
|
},
|
162
166
|
halfComputedTextInfoWidth() {
|
163
167
|
return parseInt(this.width) / 2
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<container
|
4
4
|
:checkColor="checkColor"
|
5
5
|
:size="size"
|
6
|
-
:hasLabel="
|
6
|
+
:hasLabel="!!label.length"
|
7
7
|
:backgroundColor="backgroundColor"
|
8
8
|
:isChecked="isChecked"
|
9
9
|
:isDisabled="isDisabled"
|
@@ -14,10 +14,10 @@
|
|
14
14
|
:data-id="dataId"
|
15
15
|
@change="onChangeHandler(!isChecked)"
|
16
16
|
/>
|
17
|
-
<
|
17
|
+
<div>
|
18
18
|
<span class="checkmark"></span>
|
19
|
-
</
|
20
|
-
<label-text v-if="
|
19
|
+
</div>
|
20
|
+
<label-text v-if="!!label.length">{{ label }}</label-text>
|
21
21
|
</container>
|
22
22
|
</component-wrapper>
|
23
23
|
</template>
|
@@ -34,21 +34,12 @@
|
|
34
34
|
// backgroundColor="red"
|
35
35
|
// :isDisabled="true"
|
36
36
|
// />
|
37
|
-
import styled from '
|
37
|
+
import styled from 'vue-styled-components'
|
38
38
|
|
39
39
|
const ComponentWrapper = styled.div`
|
40
40
|
min-height: 18px;
|
41
41
|
`
|
42
42
|
|
43
|
-
const CheckWrapper = styled('div', { hasLabel: Boolean })`
|
44
|
-
${(props) =>
|
45
|
-
props.hasLabel &&
|
46
|
-
`
|
47
|
-
display: flex;
|
48
|
-
align-items: center;
|
49
|
-
`}
|
50
|
-
`
|
51
|
-
|
52
43
|
const containerAttrs = {
|
53
44
|
checkColor: String,
|
54
45
|
size: String,
|
@@ -154,8 +145,7 @@ export default {
|
|
154
145
|
ComponentWrapper,
|
155
146
|
Container,
|
156
147
|
InputCheckbox,
|
157
|
-
LabelText
|
158
|
-
CheckWrapper
|
148
|
+
LabelText
|
159
149
|
},
|
160
150
|
props: {
|
161
151
|
label: {
|
@@ -185,11 +175,6 @@ export default {
|
|
185
175
|
default: ''
|
186
176
|
}
|
187
177
|
},
|
188
|
-
computed: {
|
189
|
-
hasLabel() {
|
190
|
-
return !!this.label.length
|
191
|
-
}
|
192
|
-
},
|
193
178
|
methods: {
|
194
179
|
onChangeHandler(value) {
|
195
180
|
if (this.isDisabled) {
|
@@ -38,7 +38,7 @@
|
|
38
38
|
:value="formatWithCurrency(value)"
|
39
39
|
@blur="onInputBlur($event)"
|
40
40
|
@focus="focusInput()"
|
41
|
-
@keyup.enter="
|
41
|
+
@keyup.enter="onEnterPress"
|
42
42
|
@input="onInput($event)"
|
43
43
|
:disabled="disabled"
|
44
44
|
:isDisabled="disabled"
|
@@ -49,6 +49,7 @@
|
|
49
49
|
:fontSize="fontSize"
|
50
50
|
:fontColor="fontColor"
|
51
51
|
:backgroundColor="backgroundColor"
|
52
|
+
v-on="$listeners"
|
52
53
|
:hasSlot="hasSlot"
|
53
54
|
:hasLabelSlot="hasLabelSlot"
|
54
55
|
:slotSize="slotSize"
|
@@ -100,7 +101,7 @@
|
|
100
101
|
// :minNumber="0"
|
101
102
|
// fontColor="blue"
|
102
103
|
// />
|
103
|
-
import styled from '
|
104
|
+
import styled from 'vue-styled-components'
|
104
105
|
import {
|
105
106
|
stringToNumber,
|
106
107
|
numberToString
|
@@ -468,6 +469,10 @@ export default {
|
|
468
469
|
}
|
469
470
|
},
|
470
471
|
methods: {
|
472
|
+
onEnterPress(event){
|
473
|
+
this.$emit('on-enter-click')
|
474
|
+
this.$refs.inputField1.$el.blur()
|
475
|
+
},
|
471
476
|
onChangeHandler(event) {
|
472
477
|
if (isNaN(event) || event === '') {
|
473
478
|
event = this.defaultNumber
|
@@ -483,10 +488,9 @@ export default {
|
|
483
488
|
// Need to return an integer rather than a string
|
484
489
|
this.$emit('input-change', event)
|
485
490
|
},
|
486
|
-
onEvaluateCode(
|
491
|
+
onEvaluateCode(val) {
|
487
492
|
// function to perform math on the code
|
488
493
|
// filter the string in case of any malicious content
|
489
|
-
const val = event.target.value
|
490
494
|
let filtered = val.replace('(auto)', '').replace(/[^-()\d/*+.,]/g, '')
|
491
495
|
filtered = filtered.split(/([-+*/()])/)
|
492
496
|
let formatted = filtered.map((item) => {
|
@@ -544,17 +548,17 @@ export default {
|
|
544
548
|
}
|
545
549
|
return array
|
546
550
|
},
|
547
|
-
onInput(
|
551
|
+
onInput(value) {
|
548
552
|
if (this.isBlurred) {
|
549
553
|
this.isBlurred = false
|
550
554
|
return
|
551
555
|
}
|
552
|
-
if (
|
556
|
+
if (value === '') {
|
553
557
|
this.$emit('on-input', '')
|
554
558
|
}
|
555
559
|
let evaluatedVal
|
556
560
|
try {
|
557
|
-
evaluatedVal = this.onEvaluateCode(
|
561
|
+
evaluatedVal = this.onEvaluateCode(value)
|
558
562
|
} finally {
|
559
563
|
if (evaluatedVal) {
|
560
564
|
this.$emit('on-input', evaluatedVal)
|
@@ -566,7 +570,7 @@ export default {
|
|
566
570
|
// setting isBlurred so we don't trigger onInput as well
|
567
571
|
this.isBlurred = true
|
568
572
|
let value = e.target.value
|
569
|
-
let evaluatedInput = this.onEvaluateCode(
|
573
|
+
let evaluatedInput = this.onEvaluateCode(value)
|
570
574
|
this.onChangeHandler(evaluatedInput ? evaluatedInput : value)
|
571
575
|
if ((evaluatedInput && value.length) || this.minNumber !== null) {
|
572
576
|
this.textInput = numberToString({
|