@eturnity/eturnity_reusable_components 7.12.2 → 7.12.4

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.12.2",
3
+ "version": "7.12.4",
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
  }
@@ -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
 
@@ -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"
@@ -27,7 +26,6 @@
27
26
  //To use:
28
27
  // <info-text
29
28
  // text="Veritatis et quasi architecto beatae vitae"
30
- // borderColor="#ccc"
31
29
  // size="20"
32
30
  // alignArrow="right" // which side the arrow should be on
33
31
  // />
@@ -37,7 +35,6 @@ import icon from '../icon'
37
35
 
38
36
  const textAttrs = {
39
37
  iconSize: String,
40
- borderColor: String,
41
38
  alignArrow: String,
42
39
  width: String,
43
40
  halfComputedTextInfoWidth: Number
@@ -112,10 +109,6 @@ export default {
112
109
  text: {
113
110
  required: false
114
111
  },
115
- borderColor: {
116
- required: false,
117
- default: null
118
- },
119
112
  size: {
120
113
  required: false,
121
114
  default: '14px'
@@ -157,11 +150,7 @@ export default {
157
150
  },
158
151
  computed: {
159
152
  iconColor() {
160
- return this.isActive
161
- ? this.borderColor
162
- ? this.borderColor
163
- : theme.colors.secondary
164
- : theme.colors.mediumGray
153
+ return theme.colors.mediumGray
165
154
  },
166
155
  halfComputedTextInfoWidth() {
167
156
  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>
@@ -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,7 +469,7 @@ export default {
469
469
  }
470
470
  },
471
471
  methods: {
472
- onEnterPress(event){
472
+ onEnterPress(){
473
473
  this.$emit('on-enter-click')
474
474
  this.$refs.inputField1.$el.blur()
475
475
  },
@@ -549,6 +549,9 @@ export default {
549
549
  return array
550
550
  },
551
551
  onInput(value) {
552
+ // if(!this.isFocused){
553
+ // return
554
+ // }
552
555
  if (this.isBlurred) {
553
556
  this.isBlurred = false
554
557
  return
@@ -655,7 +658,7 @@ export default {
655
658
  e.preventDefault()
656
659
  let value = parseFloat(this.value || 0)
657
660
  value += parseFloat(this.interactionStep) * parseInt(e.movementX)
658
- this.$emit('on-input', value)
661
+ this.$emit('on-input-drag', value)
659
662
 
660
663
  this.textInput = numberToString({
661
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
  />
@@ -22,9 +22,7 @@
22
22
  <info-text
23
23
  v-if="infoTextMessage"
24
24
  :text="infoTextMessage"
25
- borderColor="#ccc"
26
25
  :size="infoTextSize"
27
- :alignText="infoTextAlign"
28
26
  />
29
27
  </label-wrapper>
30
28
  <select-button-wrapper :disabled="disabled">
@@ -327,9 +325,6 @@ export default {
327
325
  infoTextMessage: {
328
326
  required: false
329
327
  },
330
- infoTextAlign: {
331
- required: false
332
- },
333
328
  selectWidth: {
334
329
  type: String,
335
330
  required: false,
@@ -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
  />
@@ -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>