@eturnity/eturnity_reusable_components 1.2.31-3d-master.9 → 1.2.31-3d-master.11

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": "1.2.31-3d-master.9",
3
+ "version": "1.2.31-3d-master.11",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
package/src/App.vue CHANGED
@@ -17,7 +17,7 @@
17
17
  inputWidth="420px"
18
18
  textAlign="left"
19
19
  :isInteractive="true"
20
- :interactionStep="50"
20
+ :interactionStep="1"
21
21
  alignItems="horizontal"
22
22
  @on-input="value=$event"
23
23
  @input-change="changeHandler"
@@ -30,68 +30,28 @@
30
30
  </div>
31
31
  </template>
32
32
  </input-number>
33
- <input-number
34
- :value="value2"
35
- :minNumber="0"
36
- unitName="mm"
37
- :numberPrecision="0"
38
- backgroundColor="transparent"
39
- inputHeight="34px"
40
- inputWidth="420px"
41
- textAlign="left"
42
- :isInteractive="true"
43
- :interactionStep="50"
44
- alignItems="horizontal"
45
- @input-change="changeHandler"
46
- @input-focus="focusHandler"
47
- @input-blur="blurHandler"
48
- @on-input="inputHandler"
49
- >
50
- <template v-slot:label>
51
- <div>
52
- Interactive Label
53
- </div>
54
- </template>
55
- </input-number>
56
- <Select
57
- selectWidth="100%"
58
- optionWidth="50%"
59
- label="that is a label"
60
- alignItems="vertical"
61
- colorMode="light"
62
- >
63
- <template #selector="{selectedValue}">
64
- value selected: {{selectedValue}}
65
- </template>
66
- <template #dropdown>
67
- <Option value="1">value one</Option>
68
- <Option value="2">value two</Option>
69
- <Option value="3">value three</Option>
70
- <Option value="4">value four</Option>
71
- </template>
72
- </Select>
73
- <Select
74
- selectWidth="100%"
75
- optionWidth="50%"
76
- label="that is a label"
77
- alignItems="vertical"
78
- >
79
- <template #selector="{selectedValue}">
80
- value selected: {{selectedValue}}
81
- </template>
82
- <template #dropdown>
83
- <Option value="1">value one</Option>
84
- <Option value="2">value two</Option>
85
- <Option value="3">value three</Option>
86
- <Option value="4">value four</Option>
87
- </template>
88
- </Select>
33
+
34
+ <SwitchField
35
+ @on-switch-change="onInputChange($event)"
36
+ :options="[{value:0,content:'zero'},{value:1,content:'one'},{value:2,content:'two'}]"
37
+ :value="value"
38
+ label="label"
39
+ toggleColor="red"
40
+ size="large"
41
+ backgroundColor="blue"
42
+ labelAlign="left"
43
+ fontColor="black"
44
+ :disabled="false"
45
+ />
46
+
89
47
  <Select
48
+ :value="value"
90
49
  selectWidth="100%"
91
50
  optionWidth="50%"
92
51
  label="that is a label"
93
52
  alignItems="vertical"
94
53
  colorMode="dark"
54
+ @input-change="value=$event"
95
55
  >
96
56
  <template #selector="{selectedValue}">
97
57
  value selected: {{selectedValue}}
@@ -103,34 +63,8 @@
103
63
  <Option value="4">value four</Option>
104
64
  </template>
105
65
  </Select>
106
- <hr>
107
- <SwitchField
108
- @on-switch-change="onInputChange($event)"
109
- :options="[{value:0,content:'zero'},{value:1,content:'one'},{value:2,content:'two'}]"
110
- :value="1"
111
- label="label"
112
- toggleColor="red"
113
- size="large"
114
- backgroundColor="blue"
115
- labelAlign="left"
116
- fontColor="black"
117
- :disabled="false"
118
- />
119
- <div :style="{padding:'50px',backgroundColor:'#1e1e1e'}">
120
- <SwitchField
121
- @on-switch-change="onInputChange($event)"
122
- :options="[{value:'test',content:'zero'},{value:'1',content:'one'},{value:'2',content:'two'}]"
123
- value='test'
124
- label="label"
125
- toggleColor="red"
126
- size="large"
127
- backgroundColor="blue"
128
- labelAlign="left"
129
- colorMode="dark"
130
- alignItems="vertical"
131
- />
66
+
132
67
  </div>
133
- </div>
134
68
  </modal>
135
69
  </page-container>
136
70
  </ThemeProvider>
@@ -142,9 +76,9 @@ import theme from "./assets/theme"
142
76
  import styled from "vue-styled-components"
143
77
  import InputNumber from "@/components/inputs/inputNumber"
144
78
  import Select from "@/components/inputs/select"
79
+ import SwitchField from "@/components/inputs/switchField"
145
80
  import Option from "@/components/inputs/select/option"
146
81
  import Modal from "@/components/modals/modal"
147
- import SwitchField from "@/components/inputs/switchField"
148
82
 
149
83
  // import TableDropdown from "@/components/tableDropdown"
150
84
 
@@ -456,10 +456,13 @@ export default {
456
456
  return evaluated
457
457
  },
458
458
  onInput(value){
459
+ let evaluatedVal
459
460
  try{
460
- const evaluatedVal=this.onEvaluateCode(value)
461
- this.$emit('on-input',evaluatedVal)
462
- }catch(err){
461
+ evaluatedVal=this.onEvaluateCode(value)
462
+ }finally {
463
+ if(evaluatedVal){
464
+ this.$emit('on-input',evaluatedVal)
465
+ }
463
466
  }
464
467
  },
465
468
  onInputBlur(e) {
@@ -269,6 +269,11 @@ const InputWrapper = styled('div', inputAttrs)`
269
269
  },
270
270
  },
271
271
  computed: {
272
+ },
273
+ watch:{
274
+ value(val){
275
+ this.selectedValue=val
276
+ }
272
277
  }
273
278
  }
274
279
  </script>
@@ -55,18 +55,18 @@
55
55
  <script>
56
56
  // import Toggle from "@eturnity/eturnity_reusable_components/src/components/inputs/toggle"
57
57
  // To use:
58
- // <SwitchField
59
- // @on-switch-change="onInputChange($event)"
60
- // :options="[{value:0,content:'zero'},{value:1,content:'one'},{value:2,content:'two'}]"
61
- // :value="1"
62
- // label="label"
63
- // toggleColor="red"
64
- // size="large"
65
- // backgroundColor="blue"
66
- // labelAlign="left"
67
- // fontColor="black"
68
- // :disabled="false"
69
- // />
58
+ // <SwitchField
59
+ // @on-switch-change="onInputChange($event)"
60
+ // :options="[{value:0,content:'zero'},{value:1,content:'one'},{value:2,content:'two'}]"
61
+ // :value="1"
62
+ // label="label"
63
+ // toggleColor="red"
64
+ // size="large"
65
+ // backgroundColor="blue"
66
+ // labelAlign="left"
67
+ // fontColor="black"
68
+ // :disabled="false"
69
+ // />
70
70
 
71
71
  import styled from "vue-styled-components"
72
72
  import InfoText from "../../infoText"
@@ -234,6 +234,11 @@ import styled from "vue-styled-components"
234
234
  this.$emit("on-switch-change", this.selectedValue)
235
235
  },
236
236
  },
237
+ watch:{
238
+ value(val){
239
+ this.selectedValue=val
240
+ }
241
+ }
237
242
  }
238
243
  </script>
239
244