@reviewpush/rp-treeselect 0.0.5 → 0.0.7

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": "@reviewpush/rp-treeselect",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "repository": "reviewpush/rp-treeselect",
5
5
  "main": "dist/rp-treeselect.cjs.js",
6
6
  "unpkg": "dist/rp-treeselect.umd.min.js",
@@ -10,7 +10,8 @@
10
10
  name: 'rp-treeselect--control',
11
11
 
12
12
  setup() {
13
- const count = inject('instance')
13
+ const instance = inject('instance')
14
+ return { instance }
14
15
  },
15
16
 
16
17
  computed: {
@@ -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
- import { inject } from 'vue'
13
- export default {
13
+
14
+ export default {
14
15
  name: 'rp-treeselect--hidden-fields',
15
-
16
+
16
17
  setup() {
17
- const count = inject('instance')
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
- if (!instance.name || instance.disabled || !instance.hasValue) return null
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
  />
@@ -1,4 +1,5 @@
1
1
  <script>
2
+ import { inject } from 'vue'
2
3
  import { debounce, deepExtend, includes } from '../utils'
3
4
  import { MIN_INPUT_WIDTH, KEY_CODES, INPUT_DEBOUNCE_DELAY } from '../constants'
4
5
 
@@ -12,12 +13,12 @@
12
13
  KEY_CODES.ARROW_DOWN,
13
14
  ]
14
15
 
15
- import { inject } from 'vue'
16
- export default {
16
+ export default {
17
17
  name: 'rp-treeselect--input',
18
-
18
+
19
19
  setup() {
20
- const count = inject('instance')
20
+ const instance = inject('instance')
21
+ return { instance }
21
22
  },
22
23
 
23
24
  data: () => ({
@@ -1,4 +1,5 @@
1
1
  <script>
2
+ import { inject } from 'vue'
2
3
  import { MENU_BUFFER } from '../constants'
3
4
  import { watchSize, setupResizeAndScrollEventListeners } from '../utils'
4
5
  import Option from './Option'
@@ -11,12 +12,13 @@
11
12
  below: 'bottom',
12
13
  }
13
14
 
14
- import { inject } from 'vue'
15
- export default {
15
+
16
+ export default {
16
17
  name: 'rp-treeselect--menu',
17
-
18
+
18
19
  setup() {
19
- const count = inject('instance')
20
+ const instance = inject('instance')
21
+ return { instance }
20
22
  },
21
23
 
22
24
  computed: {
@@ -1,14 +1,15 @@
1
1
  <script>
2
+ import { inject } from 'vue'
2
3
  import MultiValueItem from './MultiValueItem'
3
4
  import Input from './Input'
4
5
  import Placeholder from './Placeholder'
5
6
 
6
- import { inject } from 'vue'
7
- export default {
7
+ export default {
8
8
  name: 'rp-treeselect--multi-value',
9
-
9
+
10
10
  setup() {
11
- const count = inject('instance')
11
+ const instance = inject('instance')
12
+ return { instance }
12
13
  },
13
14
 
14
15
  methods: {
@@ -1,13 +1,14 @@
1
1
  <script>
2
+ import { inject } from 'vue'
2
3
  import { onLeftClick } from '../utils'
3
4
  import DeleteIcon from './icons/Delete'
4
5
 
5
- import { inject } from 'vue'
6
- export default {
6
+ export default {
7
7
  name: 'rp-treeselect--multi-value-item',
8
-
8
+
9
9
  setup() {
10
- const count = inject('instance')
10
+ const instance = inject('instance')
11
+ return { instance }
11
12
  },
12
13
 
13
14
  props: {
@@ -1,10 +1,12 @@
1
1
  <script>
2
2
  import { inject } from 'vue'
3
- export default {
3
+
4
+ export default {
4
5
  name: 'rp-treeselect--placeholder',
5
-
6
+
6
7
  setup() {
7
- const count = inject('instance')
8
+ const instance = inject('instance')
9
+ return { instance }
8
10
  },
9
11
 
10
12
  render() {
@@ -1,13 +1,14 @@
1
1
  <script>
2
+ import { inject } from 'vue'
2
3
  import Input from './Input'
3
4
  import Placeholder from './Placeholder'
4
5
 
5
- import { inject } from 'vue'
6
- export default {
6
+ export default {
7
7
  name: 'rp-treeselect--single-value',
8
-
8
+
9
9
  setup() {
10
- const count = inject('instance')
10
+ const instance = inject('instance')
11
+ return { instance }
11
12
  },
12
13
  methods: {
13
14
  renderSingleValueLabel() {
@@ -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(_, context) {
18
- const { props, children } = context
16
+ render() {
17
+ const { icon, type } = this.$props
19
18
 
20
19
  return (
21
- <div class={`rp-treeselect__tip rp-treeselect__${props.type}-tip`}>
20
+ <div class={`rp-treeselect__tip rp-treeselect__${type}-tip`}>
22
21
  <div class="rp-treeselect__icon-container">
23
- <span class={`rp-treeselect__icon-${props.icon}`} />
22
+ <span class={`rp-treeselect__icon-${icon}`} />
24
23
  </div>
25
- <span class={`rp-treeselect__tip-text rp-treeselect__${props.type}-tip-text`}>
26
- {children}
24
+ <span class={`rp-treeselect__tip-text rp-treeselect__${type}-tip-text`}>
25
+ <slot></slot>
27
26
  </span>
28
27
  </div>
29
28
  )