@eturnity/eturnity_reusable_components 7.8.5 → 7.8.6

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/.eslintrc ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "extends": ["plugin:prettier/recommended", "plugin:vue/essential"],
3
+
4
+ "plugins": ["prettier"],
5
+
6
+ "rules": {
7
+ "prettier/prettier": "error",
8
+ "vue/no-parsing-error": "off",
9
+ "vue/no-side-effects-in-computed-properties": "off",
10
+ "vue/invalid-first-character-of-tag-name": "off"
11
+ },
12
+
13
+ "parserOptions": {
14
+ "ecmaVersion": 6,
15
+ "parser": "babel-eslint",
16
+ "sourceType": "module"
17
+ }
18
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "7.8.5",
3
+ "version": "7.8.6",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
package/src/App.vue CHANGED
@@ -136,8 +136,7 @@ export default {
136
136
  iconCollection,
137
137
  dropdownComponent,
138
138
  videoThumbnail,
139
- icon
140
- // infoCard
139
+ icon,
141
140
  },
142
141
  data() {
143
142
  return {
@@ -0,0 +1,47 @@
1
+ <template>
2
+ <Handle :height = "height" class="handle">
3
+ <Dot></Dot>
4
+ <Dot></Dot>
5
+ <Dot></Dot>
6
+ </Handle>
7
+ </template>
8
+
9
+ <script>
10
+
11
+ import styled from 'vue-styled-components'
12
+
13
+ const Handle = styled('div',{ height : String })`
14
+ position:absolute;
15
+ left:0;
16
+ margin-right:10px;
17
+ display: flex;
18
+ align-items: stretch;
19
+ flex-direction: column;
20
+ justify-content: center;
21
+ width: 14px;
22
+ height:${props=> props.height};
23
+ padding: 0 5px;
24
+ background-color: #f3f3f7;
25
+ cursor: pointer;
26
+ align-items: center;
27
+ `
28
+ const Dot = styled.div`
29
+ display: inline-block;
30
+ width: 4px;
31
+ height: 4px;
32
+ margin:2px;
33
+ background-color: #0068de;
34
+ `
35
+
36
+ export default {
37
+ name: 'draggableInputHandle',
38
+ props:['height'],
39
+ components: {
40
+ Handle,
41
+ Dot
42
+ },
43
+ data() {
44
+ return {}
45
+ }
46
+ }
47
+ </script>
@@ -46,7 +46,9 @@
46
46
  @keydown.native="onKeyDown"
47
47
  :showBorder="showBorder"
48
48
  :data-id="dataId"
49
- >
49
+ :isDraggable="isDraggable"
50
+ >
51
+ <draggableInputHandle v-if="isDraggable && !isSearchBarVisible" :height="selectHeight" />
50
52
  <inputText
51
53
  v-if="isSearchBarVisible"
52
54
  ref="searchInput"
@@ -141,6 +143,7 @@ import styled from 'vue-styled-components'
141
143
  import InfoText from '../../infoText'
142
144
  import icon from '../../icon'
143
145
  import inputText from '../inputText'
146
+ import draggableInputHandle from '../../draggableInputHandle'
144
147
 
145
148
  const Caret = styled.div`
146
149
  display: flex;
@@ -200,13 +203,14 @@ const selectButtonAttrs = {
200
203
  height: String,
201
204
  selectMinHeight: String,
202
205
  isSearchBarVisible: Boolean,
203
- showBorder: Boolean
206
+ showBorder: Boolean,
207
+ isDraggable: Boolean,
204
208
  }
205
209
  const selectButton = styled('div', selectButtonAttrs)`
206
210
  position: relative;
207
211
  box-sizing: border-box;
208
212
  border-radius: 4px;
209
- padding: ${(props) => (props.isSearchBarVisible ? '0' : '0px 0px 0 15px')};
213
+ padding-left:${(props) => (props.isSearchBarVisible ? '0' : props.isDraggable?'30px':'15px')};
210
214
  text-align: left;
211
215
  border-radius: 4px;
212
216
  min-height: ${(props) =>
@@ -236,6 +240,10 @@ const selectButton = styled('div', selectButtonAttrs)`
236
240
  ? props.theme.colors[props.fontColor]
237
241
  : props.fontColor};
238
242
  ${(props) => (props.disabled ? 'pointer-events: none' : '')};
243
+ overflow: hidden;
244
+ & >.handle{
245
+ border-right:${(props) =>props.hasError ? props.theme.colors.red : props.theme.colors.grey4} 1px solid;
246
+ }
239
247
  `
240
248
  const selectDropdownAttrs = {
241
249
  hoveredBgColor: String,
@@ -401,6 +409,10 @@ export default {
401
409
  dataId: {
402
410
  type: String,
403
411
  default: ''
412
+ },
413
+ isDraggable: {
414
+ type: Boolean,
415
+ default: false
404
416
  }
405
417
  },
406
418
 
@@ -418,7 +430,8 @@ export default {
418
430
  icon,
419
431
  Caret,
420
432
  Selector,
421
- inputText
433
+ inputText,
434
+ draggableInputHandle
422
435
  },
423
436
 
424
437
  data() {
@@ -0,0 +1,104 @@
1
+ <template>
2
+ <label-wrapper
3
+ :labelAlign="labelAlign">
4
+ <input-label
5
+ :labelFontColor="labelFontColor"
6
+ :fontSize="fontSize"
7
+ >
8
+ <slot></slot>
9
+ <optionalLabel v-if="labelOptional"
10
+ >({{ $gettext('Optional') }})</optionalLabel
11
+ ></input-label
12
+ >
13
+ <info-text
14
+ v-if="infoTextMessage"
15
+ :text="infoTextMessage"
16
+ borderColor="#ccc"
17
+ :size="fontSize ? fontSize : '16px'"
18
+ :alignArrow="infoTextAlign"
19
+ />
20
+ </label-wrapper>
21
+ </template>
22
+
23
+ <script>
24
+ import styled from 'vue-styled-components'
25
+ import InfoText from '../infoText'
26
+
27
+
28
+ const labelAttrs = { fontSize: String, labelFontColor: String }
29
+ const InputLabel = styled('div', labelAttrs)`
30
+ color: ${(props) =>
31
+ props.theme.colors[props.labelFontColor]
32
+ ? props.theme.colors[props.labelFontColor]
33
+ : props.labelFontColor
34
+ ? props.labelFontColor
35
+ : props.theme.colors.eturnityGrey};
36
+
37
+ font-size: ${(props) => (props.fontSize ? props.fontSize : '13px')};
38
+ font-weight: 700;
39
+ `
40
+ const optionalLabel = styled.span`
41
+ font-weight: 300;
42
+ `
43
+
44
+ const LabelWrapper = styled('div',{labelAlign:String})`
45
+ ${props=>props.labelAlign=='horizontal'?
46
+ 'display: inline-grid;':
47
+ 'display: grid;'
48
+ }
49
+ ${props=>props.labelAlign=='horizontal'?
50
+ 'margin-right: 10px;':
51
+ 'margin-bottom: 8px;'
52
+ }
53
+ vertical-align: center;
54
+ grid-template-columns: auto auto;
55
+ grid-gap: 12px;
56
+ align-items: center;
57
+ justify-content: start;
58
+ `
59
+ export default {
60
+ // import labelText from "@eturnity/eturnity_reusable_components/src/components/label"
61
+ // To use:
62
+ // <label-text
63
+ // infoTextAlign="right" // left by default
64
+ // infoTextMessage="My info message"
65
+ // label="Question 5"
66
+ // />
67
+ name: 'input-text',
68
+ components: {
69
+ InfoText,
70
+ InputLabel,
71
+ LabelWrapper,
72
+ optionalLabel
73
+ },
74
+ data() {
75
+ return {
76
+ inputTypeData: 'text'
77
+ }
78
+ },
79
+ props: {
80
+ infoTextMessage: {
81
+ required: false
82
+ },
83
+ infoTextAlign: {
84
+ required: false
85
+ },
86
+ labelOptional: {
87
+ required: false,
88
+ default: false
89
+ },
90
+ fontSize: {
91
+ required: false,
92
+ default: null
93
+ },
94
+ labelFontColor: {
95
+ required: false,
96
+ default: 'black'
97
+ },
98
+ labelAlign: {
99
+ required: false,
100
+ default: 'vertical'
101
+ },
102
+ },
103
+ }
104
+ </script>