@reviewpush/rp-treeselect 0.0.5 → 0.0.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/package.json +1 -1
- package/src/components/Control.vue +2 -1
- package/src/components/HiddenFields.vue +12 -13
- package/src/components/Input.vue +2 -1
- package/src/components/Menu.vue +2 -1
- package/src/components/MultiValue.vue +2 -1
- package/src/components/MultiValueItem.vue +2 -1
- package/src/components/Placeholder.vue +2 -1
- package/src/components/SingleValue.vue +2 -1
- package/src/components/Tip.vue +6 -7
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
import { inject } from 'vue'
|
|
2
3
|
import { isNaN } from '../utils'
|
|
3
4
|
|
|
4
5
|
function stringifyValue(value) {
|
|
@@ -9,29 +10,27 @@
|
|
|
9
10
|
return ''
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
export default {
|
|
13
|
+
|
|
14
|
+
export default {
|
|
14
15
|
name: 'rp-treeselect--hidden-fields',
|
|
15
|
-
|
|
16
|
+
|
|
16
17
|
setup() {
|
|
17
|
-
const
|
|
18
|
+
const instance = inject('instance')
|
|
19
|
+
return { instance }
|
|
18
20
|
},
|
|
19
|
-
functional: true,
|
|
20
|
-
|
|
21
|
-
render(_, context) {
|
|
22
|
-
const { instance } = context.injections
|
|
23
21
|
|
|
24
|
-
|
|
22
|
+
render() {
|
|
23
|
+
if (!this.instance.name || this.instance.disabled || !this.instance.hasValue) return null
|
|
25
24
|
|
|
26
|
-
let stringifiedValues = instance.internalValue.map(stringifyValue)
|
|
25
|
+
let stringifiedValues = this.instance.internalValue.map(stringifyValue)
|
|
27
26
|
|
|
28
|
-
if (instance.multiple && instance.joinValues) stringifiedValues = [
|
|
29
|
-
stringifiedValues.join(instance.delimiter),
|
|
27
|
+
if (this.instance.multiple && this.instance.joinValues) stringifiedValues = [
|
|
28
|
+
stringifiedValues.join(this.instance.delimiter),
|
|
30
29
|
]
|
|
31
30
|
|
|
32
31
|
return stringifiedValues.map((stringifiedValue, i) => (
|
|
33
32
|
<input type="hidden"
|
|
34
|
-
name={instance.name}
|
|
33
|
+
name={this.instance.name}
|
|
35
34
|
value={stringifiedValue}
|
|
36
35
|
key={'hidden-field-' + i}
|
|
37
36
|
/>
|
package/src/components/Input.vue
CHANGED
package/src/components/Menu.vue
CHANGED
package/src/components/Tip.vue
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
export default {
|
|
3
3
|
name: 'rp-treeselect--tip',
|
|
4
|
-
functional: true,
|
|
5
4
|
|
|
6
5
|
props: {
|
|
7
6
|
type: {
|
|
@@ -14,16 +13,16 @@
|
|
|
14
13
|
},
|
|
15
14
|
},
|
|
16
15
|
|
|
17
|
-
render(
|
|
18
|
-
const {
|
|
16
|
+
render() {
|
|
17
|
+
const { icon, type } = this.$props
|
|
19
18
|
|
|
20
19
|
return (
|
|
21
|
-
<div class={`rp-treeselect__tip rp-treeselect__${
|
|
20
|
+
<div class={`rp-treeselect__tip rp-treeselect__${type}-tip`}>
|
|
22
21
|
<div class="rp-treeselect__icon-container">
|
|
23
|
-
<span class={`rp-treeselect__icon-${
|
|
22
|
+
<span class={`rp-treeselect__icon-${icon}`} />
|
|
24
23
|
</div>
|
|
25
|
-
<span class={`rp-treeselect__tip-text rp-treeselect__${
|
|
26
|
-
|
|
24
|
+
<span class={`rp-treeselect__tip-text rp-treeselect__${type}-tip-text`}>
|
|
25
|
+
<slot></slot>
|
|
27
26
|
</span>
|
|
28
27
|
</div>
|
|
29
28
|
)
|