@eturnity/eturnity_reusable_components 7.4.4-EPDM-7260.8 → 7.4.4-EPDM-7260.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "7.4.4-EPDM-7260.8",
3
+ "version": "7.4.4-EPDM-7260.10",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
package/src/App.vue CHANGED
@@ -14,87 +14,42 @@
14
14
  textAlign="left"
15
15
  :isInteractive="true"
16
16
  :interactionStep="1"
17
- @on-input="value = $event"
17
+ @on-input="inputHandler"
18
18
  @input-change="changeHandler"
19
19
  @input-focus="focusHandler"
20
20
  @input-blur="blurHandler"
21
21
  >
22
22
  <template v-slot:label>
23
- <div>Interactive Label</div>
23
+ <div>Interactive Label 1</div>
24
24
  </template>
25
25
  </input-number>
26
26
 
27
- <dropdown-component openingMode="hover" gap="30px">
28
- <template #trigger><i>Click Me</i></template>
29
- <template #dropdown>
30
- <div>
31
- <a href="">test1</a>
32
- <button href="">test2</button>
33
- <br />
34
- <p>Text</p>
35
- </div>
36
- </template>
37
- </dropdown-component>
38
-
39
- <videoThumbnail
40
- src="https://musicart.xboxlive.com/6/cfaf1e9d-0000-0000-0000-000000000009/504/image.jpg?w=1920&h=1080"
41
- playIconColor="red"
42
- playIconSize="20px"
43
- width="400px"
44
- height="600px"
45
- />
27
+ <hr>
46
28
 
47
- <SwitchField
48
- @on-switch-change="onInputChange($event)"
49
- :options="[
50
- { value: 0, content: 'zero' },
51
- { value: 1, content: 'one' },
52
- { value: 2, content: 'two' }
53
- ]"
54
- :value="value"
55
- label="label"
56
- toggleColor="red"
57
- size="large"
58
- backgroundColor="blue"
59
- labelAlign="left"
60
- fontColor="black"
61
- :disabled="false"
62
- />
63
- <icon
64
- name="opacity"
65
- color="red"
66
- hoveredColor="blue"
67
- size="60px"
68
- cursor="default"
69
- isStriked="true"
70
- />
71
- <Select
29
+ <input-number
72
30
  :value="value"
73
- selectWidth="100%"
74
- optionWidth="50%"
75
- label="that is a label"
76
- alignItems="vertical"
77
- colorMode="dark"
78
- isSearchable="true"
79
- @input-change="value = $event"
80
- @search-change="searchValue = $event"
31
+ :minNumber="0"
32
+ unitName="mm"
33
+ :numberPrecision="0"
34
+ backgroundColor="transparent"
35
+ borderColor="eturnityGrey"
36
+ inputHeight="34px"
37
+ inputWidth="420px"
38
+ textAlign="left"
39
+ :isInteractive="true"
40
+ :interactionStep="1"
41
+ @on-input="inputHandler"
42
+ @input-change="changeHandler"
43
+ @input-focus="focusHandler"
44
+ @input-blur="blurHandler"
81
45
  >
82
- <template #selector="{ selectedValue }">
83
- value selected: {{ selectedValue }}
84
- </template>
85
- <template #dropdown>
86
- <Option
87
- v-for="opt in filteredOptionList"
88
- :key="opt.id"
89
- :value="opt.val"
90
- >{{ opt.lookFor }}
91
- </Option>
46
+ <template v-slot:label>
47
+ <div>Interactive Label 2</div>
92
48
  </template>
93
- </Select>
94
-
95
- {{ filteredOptionList }}
49
+ </input-number>
96
50
 
97
- <iconCollection color="red" />
51
+ <hr>
52
+ <button @click="value=42">Click to set at 42</button>
98
53
  </page-container>
99
54
  </ThemeProvider>
100
55
  </template>
@@ -104,64 +59,24 @@ import { ThemeProvider } from 'vue-styled-components'
104
59
  import theme from './assets/theme'
105
60
  import styled from 'vue-styled-components'
106
61
  import InputNumber from '@/components/inputs/inputNumber'
107
- import Select from '@/components/inputs/select'
108
- import SwitchField from '@/components/inputs/switchField'
109
- import Option from '@/components/inputs/select/option'
110
- import iconCollection from '@/components/icon/iconCollection'
111
- import dropdownComponent from '@/components/dropdown'
112
- import videoThumbnail from '@/components/videoThumbnail'
113
- import icon from '@/components/icon'
114
- // import infoCard from '@/components/infoCard'
115
- // import TableDropdown from "@/components/tableDropdown"
116
62
 
117
63
  const PageContainer = styled.div`
118
64
  padding: 40px;
119
65
  `
120
66
 
121
- // const RowContainer = styled.div`
122
- // display: inline-flex;
123
- // gap: 10px;
124
- // flex-wrap: wrap;
125
- // `
126
-
127
67
  export default {
128
68
  name: 'App',
129
69
  components: {
130
70
  ThemeProvider,
131
71
  PageContainer,
132
72
  InputNumber,
133
- Option,
134
- Select,
135
- SwitchField,
136
- iconCollection,
137
- dropdownComponent,
138
- videoThumbnail,
139
- icon,
140
73
  },
141
74
  data() {
142
75
  return {
143
76
  value: 42,
144
- value2: 42,
145
- companyName: 'toto',
146
- optionList: [
147
- { id: 'a', val: 'A', lookFor: 'babababa' },
148
- { id: 'b', val: 'B', lookFor: 'abab' },
149
- { id: 'c', val: 'C', lookFor: 'ccc' },
150
- { id: 'd', val: 'D', lookFor: 'ddd' },
151
- { id: 'e', val: 'E', lookFor: 'dddee' },
152
- { id: 'f', val: 'F', lookFor: 'ddfff' },
153
- { id: 'g', val: 'G', lookFor: 'dggg' },
154
- { id: 'h', val: 'H', lookFor: 'dddhhh' }
155
- ],
156
- searchValue: ''
157
77
  }
158
78
  },
159
79
  computed: {
160
- filteredOptionList() {
161
- return this.optionList.filter((opt) =>
162
- opt.lookFor.includes(this.searchValue)
163
- )
164
- }
165
80
  },
166
81
  methods: {
167
82
  blurHandler(e) {
@@ -174,64 +89,12 @@ export default {
174
89
  console.log('focus', e)
175
90
  },
176
91
  inputHandler(e) {
177
- this.value2 = e
178
92
  console.log('input', e)
179
- },
180
- keydownHandler(e) {
181
- console.log('test', e)
93
+ //this.value = e
94
+ setTimeout(()=>{this.value = e},1000)
182
95
  },
183
96
  getTheme() {
184
97
  return theme
185
- },
186
- onInputChange(event) {
187
- this.inputValue = event
188
- },
189
- onInputBlur(event) {
190
- console.log(event)
191
- },
192
- isDropdownOpen() {
193
- return this.dropdownOpen
194
- },
195
- onClickButton() {
196
- console.log('Test')
197
- },
198
- toggleDropdownOpen() {
199
- this.dropdownOpen = !this.dropdownOpen
200
- },
201
- getDropdownValues() {
202
- let items = []
203
- items = [
204
- {
205
- value: this.getComponentInfo({
206
- row: this.itemOptions[0],
207
- value: 'display_name'
208
- })
209
- },
210
- {
211
- value: this.getComponentInfo({
212
- row: this.itemOptions[0],
213
- value: 'company_item_number'
214
- })
215
- },
216
- {
217
- value: this.getComponentInfo({
218
- row: this.itemOptions[0],
219
- value: 'model'
220
- })
221
- }
222
- ]
223
- return items
224
- },
225
- getComponentInfo({ row, value }) {
226
- let item
227
- if (row.selectedValue && row.selectedValue[value]) {
228
- item = row.selectedValue[value]
229
- } else if (row[value]) {
230
- item = row[value]
231
- } else {
232
- item = '-'
233
- }
234
- return item
235
98
  }
236
99
  }
237
100
  }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M245.7,232.4c1,7.7-2.4,11.3-10.3,10.8l-62.1-6.9c-4.9-0.5-8-1.9-9.3-4.1c-1.3-2.2-0.6-4.7,2.3-7.5c1.9-1.6,4.1-3.9,6.8-6.8c2.7-2.9,5-5.2,6.8-7c1.9-2,2.4-3.8,1.8-5.4c-0.7-1.6-2-3.5-4-5.7c-4.7-4.4-9-8.5-12.9-12.1c-3.9-3.6-8.2-7.8-12.9-12.6c-1-1-2-2-3-3.2c-1-1.2-1.8-2.4-2.3-3.8c-0.5-1.4-0.6-2.9-0.2-4.4c0.3-1.6,1.4-3.3,3.3-5.1c1-1,1.9-1.9,2.5-2.6c0.7-0.7,1.3-1.4,2-2c0.7-0.6,1.4-1.2,2.1-2c0.7-0.7,1.7-1.8,2.9-3.1c3.4-3.3,6.5-4.7,9.3-4.2c2.9,0.5,6,2.4,9.3,5.7c3.4,3.3,6.8,6.6,10.3,10c3.5,3.4,7.5,7.2,11.8,11.5c3.2,3,5.9,5,8.2,6.2c2.3,1.2,4.5,0.6,6.7-1.5c1.5-1.5,3.4-3.3,5.7-5.3c2.3-2,4.2-3.9,5.9-5.5c2.9-2.8,5.4-3.9,7.7-3.2c2.3,0.7,3.7,3.1,4.2,7.4L245.7,232.4L245.7,232.4L245.7,232.4z M11.1,24c-0.5-4.3,0-7.2,1.6-8.9c1.6-1.6,4.4-2.3,8.5-2L83.2,20c5.1,0.5,8.2,1.9,9.5,4.1c1.3,2.2,0.5,4.7-2.4,7.5c-1.7,1.6-3.7,3.8-6.2,6.4c-2.4,2.6-4.6,4.8-6.4,6.6c-2,2-2.7,3.8-2,5.4c0.7,1.6,2.1,3.5,4.3,5.7c2.2,2.3,4.2,4.3,6.2,6c1.9,1.7,3.8,3.4,5.7,5.2c1.9,1.7,3.8,3.6,5.8,5.5l6.3,6.2c1,1,2,2.1,2.9,3.4c0.9,1.3,1.6,2.7,2,4.2c0.4,1.5,0.4,3-0.1,4.7c-0.5,1.6-1.6,3.3-3.3,4.9l-2.8,2.7c-0.7,0.7-1.3,1.3-1.9,2c-0.6,0.7-1.3,1.3-2.1,2l-2.8,3c-3.4,3.3-6.3,4.5-8.7,3.7c-2.4-0.8-5.3-2.9-8.7-6.2c-3.4-3.3-6.5-6.4-9.6-9.2c-3-2.9-6.7-6.5-11.1-10.7c-3-3-5.7-5-8.1-6.2c-2.4-1.2-4.6-0.7-6.8,1.5c-1.5,1.6-3.6,3.7-6.3,6c-2.7,2.4-4.9,4.4-6.5,6c-2.9,2.8-5.4,3.9-7.6,3.2c-2.2-0.7-3.5-3.1-4-7.4L11.1,24L11.1,24L11.1,24z M234.8,12.9c4.4-0.5,7.4,0,9.1,1.6c1.7,1.6,2.4,4.4,2,8.5l-7.1,60.6c-0.5,4.8-1.9,7.8-4.2,9.1c-2.3,1.3-4.8,0.5-7.7-2.5c-1.7-1.6-3.9-3.7-6.5-6c-2.7-2.4-5-4.5-6.8-6.3c-2-1.8-3.9-2.4-5.5-1.9c-1.7,0.6-3.6,1.9-5.8,4.1c-4.5,4.4-8.5,8.5-12,12.1c-3.4,3.6-7.5,7.7-12.2,12.3c-1,1-2.2,1.9-3.5,2.8c-1.3,0.9-2.8,1.6-4.3,2c-1.5,0.4-3.1,0.4-4.8-0.1s-3.4-1.6-5-3.4c-1-1-1.9-1.8-2.6-2.5s-1.5-1.3-2.1-2c-0.7-0.7-1.4-1.3-2.1-2c-0.7-0.6-1.7-1.6-2.9-3c-3.4-3.3-4.7-6.2-4-8.6c0.7-2.5,2.8-5.3,6.3-8.6l9.6-9.8c3.2-3.3,7-7.1,11.3-11.3c3.2-3,5.4-5.6,6.6-7.9c1.2-2.3,0.6-4.4-1.8-6.4c-1.5-1.5-3.4-3.5-5.8-6c-2.4-2.6-4.4-4.6-6-6.3c-2.9-2.8-3.9-5.2-3.3-7.4c0.7-2.1,3.2-3.4,7.6-3.9L234.8,12.9L234.8,12.9L234.8,12.9z M21.2,241.7c-4.2,0.3-7.2-0.3-9-1.9c-1.8-1.6-2.5-4.3-2.1-8.3l7.1-60.6c0.5-4.9,1.9-8,4.2-9.2c2.3-1.2,4.8-0.5,7.7,2.3c1.7,1.6,4,3.8,6.9,6.4c2.9,2.6,5.3,4.8,7.2,6.6c2,2,3.7,2.8,5,2.6c1.3-0.2,3-1.4,5-3.6c2.2-2.1,4.3-4.2,6.3-6.3c2-2,4-4.1,6-6c2-2,4.1-4,6.2-6.2c2.1-2.1,4.3-4.4,6.7-6.6c1-1,2.1-2,3.3-3c1.2-1,2.5-1.7,3.9-2.2s2.9-0.5,4.5-0.1c1.6,0.4,3.3,1.5,5.2,3.3c1,1,1.9,1.8,2.6,2.5c0.7,0.7,1.5,1.3,2.1,2l2,2.2l3,2.7c3.4,3.3,4.8,6.3,4.4,9c-0.4,2.7-2.4,5.8-5.9,9.2c-3.2,3.1-6.5,6.5-10.1,10c-3.5,3.5-7.5,7.4-11.8,11.7c-3,3-4.9,5.4-5.7,7.3c-0.7,1.9,0,3.9,2.1,6c1.7,1.5,3.6,3.3,5.7,5.5c2.1,2.2,4,4.1,5.7,5.8c2.9,2.8,3.9,5.2,3.2,7.4c-0.7,2.1-3.3,3.4-7.7,3.9L21.2,241.7L21.2,241.7L21.2,241.7z" style="stroke-dasharray: 1461, 1461;stroke-dashoffset: 0;fill-opacity: 1;"></path></svg>
@@ -0,0 +1,94 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
+
4
+ <svg
5
+ version="1.1"
6
+ id="svg438"
7
+ width="838"
8
+ height="833"
9
+ viewBox="0 0 838 833"
10
+ sodipodi:docname="split.svg"
11
+ inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
12
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
13
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
14
+ xmlns="http://www.w3.org/2000/svg"
15
+ xmlns:svg="http://www.w3.org/2000/svg">
16
+ <defs
17
+ id="defs442">
18
+ <linearGradient
19
+ id="linearGradient7383"
20
+ inkscape:swatch="solid">
21
+ <stop
22
+ style="stop-color:#ffffff;stop-opacity:1;"
23
+ offset="0"
24
+ id="stop7381" />
25
+ </linearGradient>
26
+ <linearGradient
27
+ id="linearGradient6933"
28
+ inkscape:swatch="solid">
29
+ <stop
30
+ style="stop-color:#000000;stop-opacity:1;"
31
+ offset="0"
32
+ id="stop6931" />
33
+ </linearGradient>
34
+ </defs>
35
+ <sodipodi:namedview
36
+ id="namedview440"
37
+ pagecolor="#ffffff"
38
+ bordercolor="#666666"
39
+ borderopacity="1.0"
40
+ inkscape:pageshadow="2"
41
+ inkscape:pageopacity="0.0"
42
+ inkscape:pagecheckerboard="0"
43
+ showgrid="false"
44
+ inkscape:zoom="0.95078031"
45
+ inkscape:cx="466.45896"
46
+ inkscape:cy="549.02273"
47
+ inkscape:window-width="1920"
48
+ inkscape:window-height="1007"
49
+ inkscape:window-x="0"
50
+ inkscape:window-y="0"
51
+ inkscape:window-maximized="1"
52
+ inkscape:current-layer="g444" />
53
+ <g
54
+ inkscape:groupmode="layer"
55
+ inkscape:label="Image"
56
+ id="g444">
57
+ <circle
58
+ id="path5141"
59
+ style="fill:none;stroke:#fffeff;stroke-opacity:1"
60
+ cx="0.66903824"
61
+ cy="263.65976"
62
+ r="0.52949077" />
63
+ <circle
64
+ id="path5143"
65
+ style="fill:none;stroke:#fffeff;stroke-opacity:1"
66
+ cx="0.66903824"
67
+ cy="263.65976"
68
+ r="0.52949077" />
69
+ <g
70
+ id="path5184"
71
+ style="stroke:#fffeff;stroke-opacity:1;fill:none">
72
+ <path
73
+ style="color:#000000;fill:none;stroke-width:154.42;-inkscape-stroke:none;stroke:#fffeff;stroke-opacity:1"
74
+ d="m -156.35359,113.32885 348.76355,221.92361 744.6236,-498.85799"
75
+ id="path6861" />
76
+ <path
77
+ style="color:#000000;fill:none;-inkscape-stroke:none;stroke:#fffeff;stroke-opacity:1"
78
+ d="M 894.06055,-227.75 191.32227,243.04492 -114.9043,48.1875 -197.80273,178.46875 193.49609,427.45898 980.00781,-99.460937 Z"
79
+ id="path6863" />
80
+ </g>
81
+ <g
82
+ id="path5186"
83
+ style="stroke:#fffeff;stroke-opacity:1;fill:none">
84
+ <path
85
+ style="color:#000000;fill:none;stroke-width:166.34;-inkscape-stroke:none;stroke:#fffeff;stroke-opacity:1"
86
+ d="M 816.06617,905.68984 357.97591,628.01443 1035.7943,176.14788"
87
+ id="path6855" />
88
+ <path
89
+ style="color:#000000;fill:none;-inkscape-stroke:none;stroke:#fffeff;stroke-opacity:1"
90
+ d="M 989.66016,106.94531 203.03125,631.34961 772.95312,976.81445 859.17773,834.56641 512.91992,624.67773 1081.9277,245.34961 Z"
91
+ id="path6857" />
92
+ </g>
93
+ </g>
94
+ </svg>
@@ -22,6 +22,8 @@ const theme = {
22
22
  grey6: '#555d61',
23
23
  green: '#99db0c',
24
24
  transparentWhite1: '#ffffff32',
25
+ transparentWhite2: '#ffffff16',
26
+ transparentWhite3: '#ffffff48',
25
27
  transparentBlack1: '#263238e6',
26
28
  disabled: '#dfe1e1',
27
29
  eturnityGrey: '#263238'
@@ -8,7 +8,10 @@
8
8
  :noWrap="noWrap"
9
9
  :data-id="dataId"
10
10
  >
11
- {{ text }}
11
+ <Label :hasIcon="Boolean(icon)">
12
+ <icon v-if="icon" :name="icon" size="14px" />
13
+ {{ text }}
14
+ </Label>
12
15
  </button-container>
13
16
  </page-container>
14
17
  </template>
@@ -20,12 +23,14 @@
20
23
  // text="Click Me"
21
24
  // customColor="#ab5348"
22
25
  // type="secondary" // primary, secondary, cancel
26
+ // icon="icon-name" // icon name from icon component
23
27
  // :isDisabled="true"
24
28
  // :minWidth="minWidth"
25
29
  // :data-id="test_data_id"
26
30
  // />
27
31
 
28
32
  import styled from 'vue-styled-components'
33
+ import Icon from '../../icon'
29
34
 
30
35
  const PageContainer = styled.div``
31
36
 
@@ -68,9 +73,22 @@ const ButtonContainer = styled('div', ButtonAttrs)`
68
73
  }
69
74
  `
70
75
 
76
+ const LabelAttrs = {
77
+ hasIcon: Boolean
78
+ }
79
+
80
+ const Label = styled('span', LabelAttrs)`
81
+ display: flex;
82
+ align-items: center;
83
+ justify-content: center;
84
+ gap: ${(props) => (props.hasIcon ? '5px' : '0')};
85
+ `
86
+
71
87
  export default {
72
88
  name: 'main-button',
73
89
  components: {
90
+ Icon,
91
+ Label,
74
92
  PageContainer,
75
93
  ButtonContainer
76
94
  },
@@ -83,6 +101,10 @@ export default {
83
101
  required: false,
84
102
  default: false
85
103
  },
104
+ icon: {
105
+ required: false,
106
+ default: null
107
+ },
86
108
  text: {
87
109
  required: true
88
110
  },
@@ -9,9 +9,7 @@
9
9
  <script>
10
10
  // import ErrorMessage from "@eturnity/eturnity_reusable_components/src/components/errorMessage"
11
11
  //To use:
12
- // <error-message
13
- // alignText="right" // default is left
14
- // />
12
+ // <error-message />
15
13
 
16
14
  import styled from 'vue-styled-components'
17
15
 
@@ -9,7 +9,12 @@
9
9
  require(`!html-loader!./../../assets/svgIcons/${name.toLowerCase()}.svg`)
10
10
  "
11
11
  ></icon-image>
12
- <striked-line v-if="isStriked" :color="color" :disabled="disabled" :hoveredColor="hoveredColor"></striked-line>
12
+ <striked-line
13
+ v-if="isStriked"
14
+ :color="color"
15
+ :disabled="disabled"
16
+ :hoveredColor="hoveredColor"
17
+ ></striked-line>
13
18
  </Wrapper>
14
19
  </template>
15
20
 
@@ -40,17 +45,22 @@ const Wrapper = styled('div', wrapperAttrs)`
40
45
  cursor: ${(props) => (props.isDisabled ? 'not-allowed' : props.cursor)};
41
46
  line-height: 0;
42
47
  `
43
- const strikedAttrs = { isDisabled: Boolean, color: String, hoveredColor: String }
48
+ const strikedAttrs = {
49
+ isDisabled: Boolean,
50
+ color: String,
51
+ hoveredColor: String
52
+ }
44
53
  const strikedLine = styled('div', strikedAttrs)`
45
54
  display: flex;
46
55
  position: absolute;
47
- bottom:0;
48
- left:0;
56
+ bottom: 0;
57
+ left: 0;
49
58
  align-content: center;
50
59
  justify-content: center;
51
60
  width: 143%;
52
- height:8%;
53
- background-color: ${(props)=>props.theme.colors[props.color] || props.color};
61
+ height: 8%;
62
+ background-color: ${(props) =>
63
+ props.theme.colors[props.color] || props.color};
54
64
  min-height: 0;
55
65
  line-height: 0;
56
66
  transform-origin: 0% 100%;
@@ -71,7 +81,7 @@ const IconImage = styled('div', IconImageProps)`
71
81
  ${(props) => props.hoveredColor && `fill: ${props.hoveredColor};`}
72
82
  }
73
83
  &:hover + div {
74
- background-color: ${(props)=>props.hoveredColor};
84
+ background-color: ${(props) => props.hoveredColor};
75
85
  }
76
86
  `
77
87
 
@@ -118,7 +118,7 @@ export default {
118
118
  },
119
119
  hoveredBackgroundColor: {
120
120
  required: false,
121
- default: 'transparentWhite1'
121
+ default: 'transparentWhite2'
122
122
  },
123
123
  size: {
124
124
  required: false,
@@ -10,7 +10,6 @@
10
10
  </icon-img>
11
11
  <text-overlay
12
12
  v-if="showInfo"
13
- :borderColor="borderColor"
14
13
  :width="width"
15
14
  :halfComputedTextInfoWidth="halfComputedTextInfoWidth"
16
15
  :alignArrow="alignArrow"
@@ -37,7 +36,6 @@ import icon from '../icon'
37
36
 
38
37
  const textAttrs = {
39
38
  iconSize: String,
40
- borderColor: String,
41
39
  alignArrow: String,
42
40
  width: String,
43
41
  halfComputedTextInfoWidth: Number
@@ -112,10 +110,6 @@ export default {
112
110
  text: {
113
111
  required: false
114
112
  },
115
- borderColor: {
116
- required: false,
117
- default: null
118
- },
119
113
  size: {
120
114
  required: false,
121
115
  default: '14px'
@@ -157,11 +151,7 @@ export default {
157
151
  },
158
152
  computed: {
159
153
  iconColor() {
160
- return this.isActive
161
- ? this.borderColor
162
- ? this.borderColor
163
- : theme.colors.secondary
164
- : theme.colors.mediumGray
154
+ return theme.colors.mediumGray
165
155
  },
166
156
  halfComputedTextInfoWidth() {
167
157
  return parseInt(this.width) / 2
@@ -16,12 +16,10 @@
16
16
  <label-text :labelFontColor="labelFontColor" :data-id="labelDataId">
17
17
  {{ labelText }}
18
18
  </label-text>
19
-
19
+
20
20
  <info-text
21
21
  v-if="labelInfoText"
22
22
  :text="labelInfoText"
23
- borderColor="#ccc"
24
- size="14px"
25
23
  :alignArrow="labelInfoAlign"
26
24
  />
27
25
  </label-wrapper>
@@ -38,7 +36,7 @@
38
36
  :value="formatWithCurrency(value)"
39
37
  @blur="onInputBlur($event)"
40
38
  @focus="focusInput()"
41
- @keyup.enter="$emit('on-enter-click')"
39
+ @keyup.enter="onEnterPress"
42
40
  @input="onInput($event)"
43
41
  :disabled="disabled"
44
42
  :isDisabled="disabled"
@@ -100,7 +98,9 @@
100
98
  // labelInfoAlign="left"
101
99
  // :minNumber="0"
102
100
  // fontColor="blue"
103
- // />
101
+ // >
102
+ //<template name=label><img>....</template>
103
+ //</inputNumber>
104
104
  import styled from 'vue-styled-components'
105
105
  import {
106
106
  stringToNumber,
@@ -469,6 +469,10 @@ export default {
469
469
  }
470
470
  },
471
471
  methods: {
472
+ onEnterPress(){
473
+ this.$emit('on-enter-click')
474
+ this.$refs.inputField1.$el.blur()
475
+ },
472
476
  onChangeHandler(event) {
473
477
  if (isNaN(event) || event === '') {
474
478
  event = this.defaultNumber
@@ -545,6 +549,9 @@ export default {
545
549
  return array
546
550
  },
547
551
  onInput(value) {
552
+ // if(!this.isFocused){
553
+ // return
554
+ // }
548
555
  if (this.isBlurred) {
549
556
  this.isBlurred = false
550
557
  return
@@ -651,7 +658,7 @@ export default {
651
658
  e.preventDefault()
652
659
  let value = parseFloat(this.value || 0)
653
660
  value += parseFloat(this.interactionStep) * parseInt(e.movementX)
654
- this.$emit('on-input', value)
661
+ this.$emit('on-input-drag', value)
655
662
 
656
663
  this.textInput = numberToString({
657
664
  value: value && value.length ? value : this.minNumber,
@@ -17,7 +17,6 @@
17
17
  <info-text
18
18
  v-if="infoTextMessage"
19
19
  :text="infoTextMessage"
20
- borderColor="#ccc"
21
20
  :size="fontSize ? fontSize : '16px'"
22
21
  :alignArrow="infoTextAlign"
23
22
  />
@@ -34,6 +33,7 @@
34
33
  :value="value"
35
34
  @input="onChangeHandler"
36
35
  @blur="onInputBlur"
36
+ @keyup.enter="onEnterPress"
37
37
  :noBorder="noBorder"
38
38
  :disabled="disabled"
39
39
  :isDisabled="disabled"
@@ -343,6 +343,10 @@ export default {
343
343
  }
344
344
  },
345
345
  methods: {
346
+ onEnterPress(event){
347
+ this.$emit('on-enter-click')
348
+ this.$refs.inputElement.$el.blur()
349
+ },
346
350
  onChangeHandler($event) {
347
351
  this.$emit('input-change', $event)
348
352
  },
@@ -25,9 +25,7 @@
25
25
  <info-text
26
26
  v-if="infoTextMessage"
27
27
  :text="infoTextMessage"
28
- borderColor="#ccc"
29
28
  :size="infoTextSize"
30
- :alignText="infoTextAlign"
31
29
  />
32
30
  </label-wrapper>
33
31
  <select-button-wrapper :disabled="disabled">
@@ -50,7 +48,7 @@
50
48
  @keydown.native="onKeyDown"
51
49
  :showBorder="showBorder"
52
50
  :data-id="dataId"
53
- :isDraggable="isDraggable"
51
+ :paddingLeft="paddingLeft"
54
52
  >
55
53
  <draggableInputHandle
56
54
  v-if="isDraggable && !isSearchBarVisible"
@@ -72,7 +70,12 @@
72
70
  @input-change="searchChange"
73
71
  @click.native.stop
74
72
  />
75
- <selector v-else>
73
+ <selector
74
+ v-else
75
+ :showBorder="showBorder"
76
+ :selectWidth="selectWidth"
77
+ :paddingLeft="paddingLeft"
78
+ >
76
79
  <slot name="selector" :selectedValue="selectedValue"></slot>
77
80
  </selector>
78
81
  <Caret @click.stop="toggleCaretDropdown" v-if="dropDownArrowVisible">
@@ -154,20 +157,38 @@ import icon from '../../icon'
154
157
  import inputText from '../inputText'
155
158
  import draggableInputHandle from '../../draggableInputHandle'
156
159
 
160
+ const CARET_WIDTH = '30px'
161
+ const BORDER_WIDTH = '1px'
162
+
157
163
  const Caret = styled.div`
158
164
  display: flex;
159
165
  align-items: center;
160
166
  justify-content: center;
161
- width: 30px;
162
- min-width: 30px;
167
+ width: ${CARET_WIDTH};
168
+ min-width: ${CARET_WIDTH};
163
169
  height: 100%;
164
- align-items: stretch
170
+ align-items: stretch;
165
171
  cursor: pointer;
166
172
  margin-left: auto;
167
173
  `
168
174
 
169
- const Selector = styled.div`
170
- width: 100%;
175
+ const selectorProps = {
176
+ selectWidth: String,
177
+ paddingLeft: String,
178
+ showBorder: Boolean
179
+ }
180
+ const Selector = styled('div', selectorProps)`
181
+ ${(props) => props.selectWidth === '100%' ? 'width: 100%;' : `width: calc(${props.selectWidth} -
182
+ (
183
+ ${CARET_WIDTH} +
184
+ ${props.paddingLeft}
185
+ ${props.showBorder ? `+ (${BORDER_WIDTH} * 2)` : ''}
186
+ )
187
+ );
188
+ white-space: nowrap;
189
+ text-overflow: ellipsis;
190
+ overflow: hidden;`
191
+ }
171
192
  `
172
193
 
173
194
  const labelAttrs = { fontSize: String, fontColor: String }
@@ -176,7 +197,7 @@ const InputLabel = styled('div', labelAttrs)`
176
197
  props.theme.colors[props.fontColor]
177
198
  ? props.theme.colors[props.fontColor]
178
199
  : props.fontColor};
179
- font-size: ${(props) => (props.fontSize ? props.fontSize : '13px')};
200
+ font-size: ${(props) => props.fontSize};
180
201
  font-weight: 700;
181
202
  `
182
203
  const optionalLabel = styled.span`
@@ -189,13 +210,7 @@ const inputProps = {
189
210
  maxWidth: String
190
211
  }
191
212
  const Container = styled('div', inputProps)`
192
- min-width: ${(props) => (props.minWidth ? props.minWidth : '150px')};
193
- width: ${(props) =>
194
- props.selectWidth
195
- ? props.selectWidth
196
- : props.maxWidth
197
- ? props.maxWidth
198
- : '100%'};
213
+ width: ${(props) => props.selectWidth};
199
214
  position: relative;
200
215
  display: inline-block;
201
216
  `
@@ -224,18 +239,16 @@ const selectButtonAttrs = {
224
239
  selectMinHeight: String,
225
240
  isSearchBarVisible: Boolean,
226
241
  showBorder: Boolean,
227
- isDraggable: Boolean,
228
- fontSize: String
242
+ paddingLeft: String
229
243
  }
230
244
  const selectButton = styled('div', selectButtonAttrs)`
231
245
  font-size: ${(props) => (props.fontSize ? props.fontSize : '13px')};
232
246
  position: relative;
233
247
  box-sizing: border-box;
234
248
  border-radius: 4px;
235
- padding-left: ${(props) =>
236
- props.isSearchBarVisible ? '0' : props.isDraggable ? '30px' : '15px'};
249
+ ${(props) =>
250
+ props.isSearchBarVisible ? '' : `padding-left: ${props.paddingLeft}`};
237
251
  text-align: left;
238
- border-radius: 4px;
239
252
  min-height: ${(props) =>
240
253
  props.selectHeight
241
254
  ? props.selectHeight
@@ -250,7 +263,9 @@ const selectButton = styled('div', selectButtonAttrs)`
250
263
  ${({ showBorder, theme, hasError }) =>
251
264
  showBorder &&
252
265
  `
253
- border:1px solid ${hasError ? theme.colors.red : theme.colors.grey4}
266
+ border: ${BORDER_WIDTH} solid ${
267
+ hasError ? theme.colors.red : theme.colors.grey4
268
+ }
254
269
  `}
255
270
  background-color:${(props) =>
256
271
  props.disabled
@@ -274,7 +289,6 @@ const selectDropdownAttrs = {
274
289
  hoveredBgColor: String,
275
290
  bgColor: String,
276
291
  fontColor: String,
277
- selectWidth: String,
278
292
  optionWidth: String,
279
293
  hoveredIndex: Number,
280
294
  hoveredValue: Number | String,
@@ -282,35 +296,34 @@ const selectDropdownAttrs = {
282
296
  fontSize: String
283
297
  }
284
298
  const selectDropdown = styled('div', selectDropdownAttrs)`
285
- box-sizing: border-box;
286
- z-index:${(props) => (props.isActive ? '2' : '1')};
287
- position:absolute;
288
- top:5px;
289
- border:1px solid ${(props) => props.theme.colors.grey4}
290
- font-size: ${(props) => (props.fontSize ? props.fontSize : '13px')};
291
- border-radius:4px;
292
- display: flex;
293
- flex-direction: column;
294
- align-items: flex-start;
295
- padding: 0px;
296
- box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
297
- width: ${(props) => (props.optionWidth ? props.optionWidth : '100%')};
298
- background-color:${(props) =>
299
- props.theme.colors[props.bgColor]
300
- ? props.theme.colors[props.bgColor]
301
- : props.bgColor};
302
- color:${(props) =>
303
- props.theme.colors[props.fontColor]
304
- ? props.theme.colors[props.fontColor]
305
- : props.fontColor};
306
- max-height:300px;
307
- overflow-y:auto;
308
- &>div[data-value="${(props) => props.hoveredValue}"]{
309
- background-color:${(props) =>
310
- props.theme.colors[props.hoveredBgColor]
311
- ? props.theme.colors[props.hoveredBgColor]
312
- : props.hoveredBgColor};
313
- }
299
+ box-sizing: border-box;
300
+ z-index: ${(props) => (props.isActive ? '2' : '1')};
301
+ position: absolute;
302
+ top: 5px;
303
+ border: ${BORDER_WIDTH} solid ${(props) => props.theme.colors.grey4};
304
+ border-radius: 4px;
305
+ display: flex;
306
+ flex-direction: column;
307
+ align-items: flex-start;
308
+ padding: 0px;
309
+ box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
310
+ width: ${(props) => (props.optionWidth ? props.optionWidth : '100%')};
311
+ background-color: ${(props) =>
312
+ props.theme.colors[props.bgColor]
313
+ ? props.theme.colors[props.bgColor]
314
+ : props.bgColor};
315
+ color: ${(props) =>
316
+ props.theme.colors[props.fontColor]
317
+ ? props.theme.colors[props.fontColor]
318
+ : props.fontColor};
319
+ max-height: 300px;
320
+ overflow-y: auto;
321
+ & > div[data-value='${(props) => props.hoveredValue}'] {
322
+ background-color: ${(props) =>
323
+ props.theme.colors[props.hoveredBgColor]
324
+ ? props.theme.colors[props.hoveredBgColor]
325
+ : props.hoveredBgColor};
326
+ }
314
327
  `
315
328
  const DropdownWrapper = styled('div')`
316
329
  position: relative;
@@ -336,7 +349,7 @@ export default {
336
349
  },
337
350
  fontSize: {
338
351
  required: false,
339
- default: null
352
+ default: '13px'
340
353
  },
341
354
  label: {
342
355
  required: false
@@ -352,12 +365,10 @@ export default {
352
365
  infoTextMessage: {
353
366
  required: false
354
367
  },
355
- infoTextAlign: {
356
- required: false
357
- },
358
368
  selectWidth: {
369
+ type: String,
359
370
  required: false,
360
- default: null
371
+ default: '100%'
361
372
  },
362
373
  minWidth: {
363
374
  required: false
@@ -476,6 +487,7 @@ export default {
476
487
  data() {
477
488
  return {
478
489
  selectedValue: null,
490
+ paddingLeft: this.isDraggable ? '30px' : '15px',
479
491
  isDropdownOpen: false,
480
492
  isActive: false,
481
493
  textSearch: '',
@@ -546,9 +558,6 @@ export default {
546
558
  }
547
559
  })
548
560
  },
549
- onSelectSlotClick() {
550
- this.toggleDropdown()
551
- },
552
561
  clickOutside(event) {
553
562
  const dropdownRef = this.$refs.dropdown
554
563
  // we need to prevent closing on selecting an option, because in the case of
@@ -594,29 +603,21 @@ export default {
594
603
  this.$refs.dropdown.$el.scrollTop = topPos
595
604
  }
596
605
  }
606
+ },
607
+ clearSearch() {
608
+ this.textSearch = ''
597
609
  }
598
610
  },
599
611
  computed: {
600
612
  optionLength() {
601
613
  if (this.isDropdownOpen) {
602
- // this filterRef is needed to check for the # of children on Filter dropdowns
603
- const filterRef =
604
- this.$refs &&
605
- this.$refs.dropdown &&
606
- this.$refs.dropdown.$children &&
607
- this.$refs.dropdown.$children.length > 1
608
- ? this.$refs.dropdown.$children
609
- : this.$refs.dropdown.$children.length &&
610
- this.$refs.dropdown.$children[0].$children
611
- ? this.$refs.dropdown.$children[0].$children
612
- : this.$refs.dropdown.$children
613
- return filterRef.length
614
- } else {
615
- return 0
614
+ return this.$refs.dropdown.$el.childElementCount
616
615
  }
616
+
617
+ return 0
617
618
  },
618
619
  isSearchBarVisible() {
619
- return this.isSearchable && this.optionLength >= 5 && this.isDropdownOpen
620
+ return this.isSearchable && this.isDropdownOpen
620
621
  }
621
622
  },
622
623
  watch: {
@@ -17,9 +17,6 @@
17
17
  <info-text
18
18
  v-if="infoTextMessage"
19
19
  :text="infoTextMessage"
20
- borderColor="#ccc"
21
- size="14px"
22
- :alignText="infoTextAlign"
23
20
  />
24
21
  </label-container>
25
22
 
@@ -51,9 +48,6 @@
51
48
  @click.native.stop
52
49
  v-if="infoTextMessage"
53
50
  :text="infoTextMessage"
54
- borderColor="#ccc"
55
- size="14px"
56
- :alignText="infoTextAlign"
57
51
  />
58
52
  </label-container>
59
53
  </flex-wrapper>
@@ -207,9 +201,6 @@ export default {
207
201
  infoTextMessage: {
208
202
  required: false
209
203
  },
210
- infoTextAlign: {
211
- required: false
212
- },
213
204
  colorMode: {
214
205
  required: false,
215
206
  default: 'light'
@@ -22,7 +22,6 @@ const Template = (args, { argTypes }) => ({
22
22
  // rowHeight="4" //optional
23
23
  // :isError="false"
24
24
  // :errorText="$gettext('field_required')"
25
- // infoTextAlign="right" // left by default
26
25
  // infoTextMessage="My info message"
27
26
  // label="Question 5"
28
27
  // alignItems="horizontal" // horizontal, vertical
@@ -37,7 +36,6 @@ Default.args = {
37
36
  rowHeight: "2",
38
37
  isError: false,
39
38
  errorText: "This field is required",
40
- infoTextAlign: "right",
41
39
  infoTextMessage: "",
42
40
  label: "",
43
41
  value: "",
@@ -52,7 +50,6 @@ Disabled.args = {
52
50
  rowHeight: "2",
53
51
  isError: false,
54
52
  errorText: "This field is required",
55
- infoTextAlign: "right",
56
53
  infoTextMessage: "",
57
54
  label: "",
58
55
  value: "",
@@ -67,7 +64,6 @@ Error.args = {
67
64
  rowHeight: "2",
68
65
  isError: true,
69
66
  errorText: "This field is required",
70
- infoTextAlign: "right",
71
67
  infoTextMessage: "",
72
68
  label: "",
73
69
  value: "",
@@ -82,7 +78,6 @@ WithLabel.args = {
82
78
  rowHeight: "2",
83
79
  isError: false,
84
80
  errorText: "This field is required",
85
- infoTextAlign: "right",
86
81
  infoTextMessage: "Here is some information",
87
82
  label: "Description",
88
83
  value: "Here is my description!",
@@ -97,7 +92,6 @@ HorizontalLabel.args = {
97
92
  rowHeight: "2",
98
93
  isError: false,
99
94
  errorText: "This field is required",
100
- infoTextAlign: "right",
101
95
  infoTextMessage: "Here is some information",
102
96
  label: "Description",
103
97
  value: "Here is my description!",
@@ -112,7 +106,6 @@ LargerTextArea.args = {
112
106
  rowHeight: "5",
113
107
  isError: false,
114
108
  errorText: "This field is required",
115
- infoTextAlign: "right",
116
109
  infoTextMessage: "Here is some information",
117
110
  label: "Description",
118
111
  value: "Here is my description!",
@@ -127,7 +120,6 @@ LargerFontSize.args = {
127
120
  fontSize: "24px",
128
121
  isError: false,
129
122
  errorText: "This field is required",
130
- infoTextAlign: "right",
131
123
  infoTextMessage: "Here is some information",
132
124
  label: "Description",
133
125
  value: "Here is my description!",
@@ -11,9 +11,7 @@
11
11
  <info-text
12
12
  v-if="infoTextMessage"
13
13
  :text="infoTextMessage"
14
- borderColor="#ccc"
15
14
  size="16px"
16
- :alignText="infoTextAlign"
17
15
  />
18
16
  </label-wrapper>
19
17
  <input-container
@@ -47,7 +45,6 @@
47
45
  // rowHeight="4" //optional
48
46
  // :isError="false"
49
47
  // :errorText="$gettext('field_required')"
50
- // infoTextAlign="right" // left by default
51
48
  // infoTextMessage="My info message"
52
49
  // label="Question 5"
53
50
  // alignItems="horizontal" // horizontal, vertical
@@ -167,9 +164,6 @@ export default {
167
164
  infoTextMessage: {
168
165
  required: false
169
166
  },
170
- infoTextAlign: {
171
- required: false
172
- },
173
167
  label: {
174
168
  required: false
175
169
  },
@@ -14,9 +14,6 @@
14
14
  <info-text
15
15
  v-if="infoTextMessage"
16
16
  :text="infoTextMessage"
17
- borderColor="#ccc"
18
- size="14px"
19
- :alignText="infoTextAlign"
20
17
  />
21
18
  </label-container>
22
19
  <toggle-wrapper
@@ -50,9 +47,6 @@
50
47
  @click.native.stop
51
48
  v-if="infoTextMessage"
52
49
  :text="infoTextMessage"
53
- borderColor="#ccc"
54
- size="14px"
55
- :alignText="infoTextAlign"
56
50
  />
57
51
  </label-container>
58
52
  </flex-wrapper>
@@ -72,7 +66,6 @@
72
66
  // labelAlign="right"
73
67
  // fontColor="black"
74
68
  // :disabled="true"
75
- // infoTextAlign="right" // left by default
76
69
  // infoTextMessage="My info message"
77
70
  // data-id="test_data_id"
78
71
  // />
@@ -193,7 +186,7 @@ const ToggleDot = styled('span', toggleProps)`
193
186
  : props.size === 'small'
194
187
  ? '10px'
195
188
  : '14px'};
196
- left: 3px
189
+ left: 3px;
197
190
  bottom: ${(props) =>
198
191
  props.size === 'medium' ? '5px' : props.size === 'small' ? '2px' : '5px'};
199
192
  background-color: ${(props) =>
@@ -278,9 +271,6 @@ export default {
278
271
  infoTextMessage: {
279
272
  required: false
280
273
  },
281
- infoTextAlign: {
282
- required: false
283
- },
284
274
  dataId: {
285
275
  type: String,
286
276
  default: ''
@@ -13,7 +13,6 @@
13
13
  <info-text
14
14
  v-if="infoTextMessage"
15
15
  :text="infoTextMessage"
16
- borderColor="#ccc"
17
16
  :size="fontSize ? fontSize : '16px'"
18
17
  :alignArrow="infoTextAlign"
19
18
  />
@@ -5,7 +5,7 @@
5
5
  :class="{ visible: isOpen, hidden: !isOpen }"
6
6
  :backdrop="backdrop"
7
7
  >
8
- <modal-container @click.stop>
8
+ <modal-container @click="onClickModalContainer">
9
9
  <spinner v-if="isLoading" size="50px" :limitedToModal="true" />
10
10
  <content-container :visible="!isLoading">
11
11
  <slot />
@@ -26,7 +26,7 @@
26
26
  // import Modal from "@eturnity/eturnity_reusable_components/src/components/modals/modal"
27
27
  // This is a more flexible modal box, where the parent can decide how the body of the modal looks
28
28
  // To use:
29
- // <modal :isOpen="isOpen" @on-close="$emit('on-close-summary')" :isLoading="true" :hideClose="true">
29
+ // <modal :isOpen="isOpen" @on-close="$emit('on-close-summary')" :isLoading="true" :hideClose="true" :stopPropagation="false">
30
30
  // <div>Data....</div>
31
31
  // </modal>
32
32
 
@@ -151,6 +151,10 @@ export default {
151
151
  position: {
152
152
  required: false,
153
153
  default: 'fixed'
154
+ },
155
+ stopPropagation: {
156
+ type: Boolean,
157
+ default: true
154
158
  }
155
159
  },
156
160
  beforeDestroy() {
@@ -164,6 +168,11 @@ export default {
164
168
  if (key === 'Escape') {
165
169
  this.onCloseModal()
166
170
  }
171
+ },
172
+ onClickModalContainer(event) {
173
+ if (this.stopPropagation) {
174
+ event.stopPropagation()
175
+ }
167
176
  }
168
177
  },
169
178
  watch: {
@@ -13,8 +13,6 @@
13
13
  <info-text
14
14
  v-if="tab['labelInfoText']"
15
15
  :text="tab['labelInfoText']"
16
- borderColor="#ccc"
17
- size="14px"
18
16
  :alignArrow="tab['labelInfoAlign']"
19
17
  />
20
18
  </Option>
@@ -57,7 +55,7 @@ const Option = styled('div',TabAttr)`
57
55
  justify-content: center;
58
56
  flex-direction: row;
59
57
  gap: 10px;
60
- color: ${props=>props.textColor ?
58
+ color: ${props=>props.textColor ?
61
59
  props.theme.colors[props.textColor] ? props.theme.colors[props.textColor] : props.textColor :
62
60
  props.isDisabled ? props.theme.colors.grey2 : props.theme.colors.black};
63
61
  `
@@ -4,11 +4,8 @@
4
4
  {{ text }}
5
5
  </span>
6
6
  <info-text
7
- :text="infoText"
8
7
  v-if="!!infoText"
9
- size="14px"
10
- borderColor="#ccc"
11
- :alignText="alignInfoText"
8
+ :text="infoText"
12
9
  />
13
10
  </subtitle-text>
14
11
  </template>
@@ -55,10 +52,6 @@ export default {
55
52
  required: false,
56
53
  default: null,
57
54
  },
58
- alignInfoText: {
59
- required: false,
60
- default: "left",
61
- },
62
55
  marginBottom: {
63
56
  required: false,
64
57
  default: "30px",
@@ -1,14 +1,14 @@
1
1
  <template>
2
- <flex>
3
- <title-text :color="color" :fontSize="fontSize" :uppercase="uppercase">{{ text }}</title-text>
2
+ <title-wrap :hasInfoText="!!infoText">
3
+ <title-text :color="color" :fontSize="fontSize" :uppercase="uppercase">
4
+ {{ text }}
5
+ </title-text>
4
6
  <info-text
5
- v-if="infoText"
6
- :text="infoText"
7
- borderColor="#ccc"
8
- size="14px"
9
- :alignArrow="infoAlign"
10
- />
11
- </flex>
7
+ v-if="!!infoText"
8
+ :text="infoText"
9
+ :alignArrow="infoAlign"
10
+ />
11
+ </title-wrap>
12
12
  </template>
13
13
 
14
14
  <script>
@@ -19,28 +19,32 @@
19
19
  // color="red"
20
20
  // />
21
21
  import styled from "vue-styled-components"
22
- import InfoText from '../infoText'
23
- const textAttrs = { color: String, fontSize: String, uppercase: Boolean }
24
- const TitleText = styled("div", textAttrs)`
22
+ import InfoText from "../infoText"
23
+
24
+ const wrapAttrs = { hasInfoText: Boolean }
25
+ const TitleWrap = styled("div", wrapAttrs)`
26
+ display: grid;
27
+ align-items: center;
28
+ grid-gap: 12px;
29
+ grid-template-columns: ${(props) =>
30
+ props.hasInfoText ? "auto auto 1fr" : "1fr"};
31
+ margin-bottom: 20px;
32
+ `
33
+
34
+ const titleAttrs = { color: String, fontSize: String, uppercase: Boolean }
35
+ const TitleText = styled('span', titleAttrs)`
25
36
  color: ${(props) => (props.color ? props.color : props.theme.colors.black)};
26
37
  font-weight: bold;
27
38
  font-size: ${(props) => (props.fontSize ? props.fontSize : '16px')};
28
39
  text-transform: ${(props) => (props.uppercase ? 'uppercase' : 'none')};
29
-
30
- `
31
- const flex = styled("div", textAttrs)`
32
- display: flex;
33
- gap:10px;
34
- margin-bottom: 20px;
35
- align-items: center;
36
40
  `
37
41
 
38
42
  export default {
39
43
  name: "page-title",
40
44
  components: {
41
45
  TitleText,
42
- InfoText,
43
- flex
46
+ TitleWrap,
47
+ InfoText
44
48
  },
45
49
  props: {
46
50
  text: {
@@ -59,10 +63,11 @@ export default {
59
63
  },
60
64
  infoText: {
61
65
  required: false,
66
+ default: null,
62
67
  },
63
68
  infoAlign: {
64
69
  required: false,
65
- },
70
+ }
66
71
  },
67
72
  }
68
73
  </script>
@@ -11,7 +11,7 @@
11
11
  <VerticalLabel>{{ label.name }}</VerticalLabel>
12
12
  <BarSlider>
13
13
  <Bar
14
- @contextmenu="
14
+ @click.native.stop="
15
15
  onBarRightClick({ event: $event, label, type: 'add' })
16
16
  "
17
17
  >
@@ -57,12 +57,11 @@
57
57
  label.selectedTariffs
58
58
  )
59
59
  "
60
- @contextmenu.native.stop="
61
- onBarRightClick({
62
- event: $event,
63
- label,
60
+ @click.native.stop="
61
+ $emit('on-bar-tariff-click', {
64
62
  type: 'delete',
65
- bar
63
+ item: bar,
64
+ label: activeLabel
66
65
  })
67
66
  "
68
67
  @activated="onActivateBar({ item: bar })"
@@ -401,6 +400,7 @@ export default {
401
400
  document.addEventListener('keydown', this.onKeyDownDelete)
402
401
  },
403
402
  onDeactivateBar() {
403
+ this.$emit('deactivate')
404
404
  this.activeItem = null
405
405
  document.removeEventListener('keydown', this.onKeyDownDelete)
406
406
  },
@@ -18,6 +18,7 @@ export const stringToNumber = ({
18
18
  selectedLang === 'de-lu' ||
19
19
  selectedLang === 'de-be' ||
20
20
  selectedLang === 'es-es' ||
21
+ selectedLang === 'ca-es' ||
21
22
  selectedLang === 'de' ||
22
23
  selectedLang === 'de-at' ||
23
24
  selectedLang === 'it' ||
@@ -48,6 +48,8 @@ export const translateLang = (lang) => {
48
48
  return 'portuguese'
49
49
  } else if (lang === 'es-es') {
50
50
  return 'spanish'
51
+ } else if (lang === 'ca-es') {
52
+ return 'catalan_es'
51
53
  } else {
52
54
  return lang
53
55
  }
@@ -72,6 +74,8 @@ export const datePickerLang = (lang) => {
72
74
  return 'it'
73
75
  } else if (lang === 'en-us' || lang === 'en-gb') {
74
76
  return 'en'
77
+ } else if (lang === 'es-es' || lang === 'ca-es' || lang === 'pt-pt') {
78
+ return 'es'
75
79
  } else {
76
80
  return lang
77
81
  }
@@ -97,6 +101,8 @@ export const tinyLanguage = (lang) => {
97
101
  return 'fr_FR'
98
102
  } else if (lang === 'it' || lang === 'it-it' || lang === 'it-ch') {
99
103
  return 'it'
104
+ } else if (lang === 'es-es' || lang === 'ca-es') {
105
+ return 'es'
100
106
  } else if (lang === 'en-us') {
101
107
  return null
102
108
  } else {
@@ -114,7 +120,9 @@ export const langForLocaleString = () => {
114
120
  ? 'fr-fr'
115
121
  : localStorage.getItem('lang') === 'fr-ch'
116
122
  ? 'de-ch'
117
- : localStorage.getItem('lang')
123
+ : localStorage.getItem('lang') === 'ca-es'
124
+ ? 'es-es'
125
+ : localStorage.getItem('lang')
118
126
  : 'en-US'
119
127
  return selectedLang !== 'null' ? selectedLang : 'en-US'
120
128
  }