@reviewpush/rp-treeselect 0.0.3 → 0.0.5

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.3",
3
+ "version": "0.0.5",
4
4
  "repository": "reviewpush/rp-treeselect",
5
5
  "main": "dist/rp-treeselect.cjs.js",
6
6
  "unpkg": "dist/rp-treeselect.umd.min.js",
@@ -121,7 +121,7 @@
121
121
  "yaku": "^0.19.3"
122
122
  },
123
123
  "peerDependencies": {
124
- "vue": "^3.0.0"
124
+ "vue": "^3.4.21"
125
125
  },
126
126
  "keywords": [
127
127
  "vue",
@@ -1,4 +1,5 @@
1
1
  <script>
2
+ import { inject } from 'vue'
2
3
  import { onLeftClick, isPromise } from '../utils'
3
4
  import SingleValue from './SingleValue'
4
5
  import MultiValue from './MultiValue'
@@ -7,7 +8,10 @@
7
8
 
8
9
  export default {
9
10
  name: 'rp-treeselect--control',
10
- inject: [ 'instance' ],
11
+
12
+ setup() {
13
+ const count = inject('instance')
14
+ },
11
15
 
12
16
  computed: {
13
17
  /* eslint-disable valid-jsdoc */
@@ -9,9 +9,13 @@
9
9
  return ''
10
10
  }
11
11
 
12
- export default {
12
+ import { inject } from 'vue'
13
+ export default {
13
14
  name: 'rp-treeselect--hidden-fields',
14
- inject: [ 'instance' ],
15
+
16
+ setup() {
17
+ const count = inject('instance')
18
+ },
15
19
  functional: true,
16
20
 
17
21
  render(_, context) {
@@ -12,9 +12,13 @@
12
12
  KEY_CODES.ARROW_DOWN,
13
13
  ]
14
14
 
15
- export default {
15
+ import { inject } from 'vue'
16
+ export default {
16
17
  name: 'rp-treeselect--input',
17
- inject: [ 'instance' ],
18
+
19
+ setup() {
20
+ const count = inject('instance')
21
+ },
18
22
 
19
23
  data: () => ({
20
24
  inputWidth: MIN_INPUT_WIDTH,
@@ -11,9 +11,13 @@
11
11
  below: 'bottom',
12
12
  }
13
13
 
14
- export default {
14
+ import { inject } from 'vue'
15
+ export default {
15
16
  name: 'rp-treeselect--menu',
16
- inject: [ 'instance' ],
17
+
18
+ setup() {
19
+ const count = inject('instance')
20
+ },
17
21
 
18
22
  computed: {
19
23
  menuStyle() {
@@ -3,9 +3,13 @@
3
3
  import Input from './Input'
4
4
  import Placeholder from './Placeholder'
5
5
 
6
- export default {
6
+ import { inject } from 'vue'
7
+ export default {
7
8
  name: 'rp-treeselect--multi-value',
8
- inject: [ 'instance' ],
9
+
10
+ setup() {
11
+ const count = inject('instance')
12
+ },
9
13
 
10
14
  methods: {
11
15
  renderMultiValueItems() {
@@ -2,9 +2,13 @@
2
2
  import { onLeftClick } from '../utils'
3
3
  import DeleteIcon from './icons/Delete'
4
4
 
5
- export default {
5
+ import { inject } from 'vue'
6
+ export default {
6
7
  name: 'rp-treeselect--multi-value-item',
7
- inject: [ 'instance' ],
8
+
9
+ setup() {
10
+ const count = inject('instance')
11
+ },
8
12
 
9
13
  props: {
10
14
  node: {
@@ -1,7 +1,11 @@
1
1
  <script>
2
- export default {
2
+ import { inject } from 'vue'
3
+ export default {
3
4
  name: 'rp-treeselect--placeholder',
4
- inject: [ 'instance' ],
5
+
6
+ setup() {
7
+ const count = inject('instance')
8
+ },
5
9
 
6
10
  render() {
7
11
  const { instance } = this
@@ -2,9 +2,13 @@
2
2
  import Input from './Input'
3
3
  import Placeholder from './Placeholder'
4
4
 
5
- export default {
5
+ import { inject } from 'vue'
6
+ export default {
6
7
  name: 'rp-treeselect--single-value',
7
- inject: [ 'instance' ],
8
+
9
+ setup() {
10
+ const count = inject('instance')
11
+ },
8
12
  methods: {
9
13
  renderSingleValueLabel() {
10
14
  const { instance } = this
@@ -1,5 +1,6 @@
1
1
  <script>
2
2
  import fuzzysearch from 'fuzzysearch'
3
+ import { provide } from 'vue'
3
4
  import {
4
5
  warning,
5
6
  onLeftClick, scrollIntoView,
@@ -20,6 +21,7 @@
20
21
  import Menu from './Menu'
21
22
  import MenuPortal from './MenuPortal'
22
23
 
24
+
23
25
  function sortValueByIndex(a, b) {
24
26
  let i = 0
25
27
  do {
@@ -66,12 +68,8 @@
66
68
  export default {
67
69
  name: 'rp-treeselect',
68
70
 
69
- provide() {
70
- return {
71
- // Enable access to the instance of root component of rp-treeselect
72
- // across hierarchy.
73
- instance: this,
74
- }
71
+ setup() {
72
+ provide('instance', this)
75
73
  },
76
74
 
77
75
  props: {