@reviewpush/rp-treeselect 0.0.13 → 0.0.14

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.13",
3
+ "version": "0.0.14",
4
4
  "repository": "reviewpush/rp-treeselect",
5
5
  "main": "dist/rp-treeselect.cjs.js",
6
6
  "unpkg": "dist/rp-treeselect.umd.min.js",
@@ -10,21 +10,7 @@
10
10
  "dist"
11
11
  ],
12
12
  "scripts": {
13
- "dev": "node build/dev-server.js",
14
- "build-library": "node build/build-library.js",
15
- "build-docs": "rimraf gh-pages && mkdir gh-pages && node build/build-docs.js",
16
- "preview-docs": "http-server gh-pages",
17
- "gh-pages": "npm run build-docs && gh-pages --dist gh-pages --branch gh-pages --dotfiles",
18
- "cleanup-cov": "rimraf test/unit/coverage",
19
- "unit": "npm run cleanup-cov && karma start test/unit/karma.conf.js --watch",
20
- "testonly": "npm run cleanup-cov && karma start test/unit/karma.config.js --single-run",
21
- "test": "npm run testonly",
22
- "pretest": "npm run lint",
23
- "lint:js": "eslint --ext .js --ext .vue --cache --cache-location node_modules/.cache/eslint --rule 'no-console: 2' .",
24
- "lint:css": "stylelint '**/*.less'",
25
- "lint": "npm run lint:js && npm run lint:css",
26
- "verify-builds": "size-limit && node build/verify-builds.js",
27
- "finish": "npm test && npm run build-library && npm run verify-builds"
13
+ "build-library": "node build/build-library.js"
28
14
  },
29
15
  "pre-commit": "lint",
30
16
  "dependencies": {
@@ -43,7 +29,7 @@
43
29
  "@babel/plugin-transform-runtime": "^7.0.0",
44
30
  "@babel/preset-env": "^7.3.1",
45
31
  "@size-limit/preset-big-lib": "^2.0.2",
46
- "@vue/test-utils": "1.0.0-beta.16",
32
+ "@vue/compiler-sfc": "^3.4.21",
47
33
  "autoprefixer": "^9.4.6",
48
34
  "babel-eslint": "^10.0.1",
49
35
  "babel-loader": "^8.0.0",
@@ -54,7 +40,7 @@
54
40
  "codecov": "^3.0.0",
55
41
  "connect-history-api-fallback": "^1.5.0",
56
42
  "copy-webpack-plugin": "^5.0.3",
57
- "css-loader": "^3.0.0",
43
+ "css-loader": "^3.6.0",
58
44
  "entities": "^2.0.0",
59
45
  "eslint": "^6.1.0",
60
46
  "eslint-config-riophae": "^0.10.0",
@@ -67,6 +53,7 @@
67
53
  "eslint-plugin-vue": "^6.0.0",
68
54
  "eventsource-polyfill": "^0.9.6",
69
55
  "express": "^4.16.3",
56
+ "file-loader": "^6.2.0",
70
57
  "friendly-errors-webpack-plugin": "^1.7.0",
71
58
  "gh-pages": "^2.0.0",
72
59
  "html-webpack-plugin": "^3.1.0",
@@ -83,7 +70,7 @@
83
70
  "karma-webpack": "^4.0.2",
84
71
  "less": "^3.0.1",
85
72
  "less-loader": "^5.0.0",
86
- "mini-css-extract-plugin": "^0.8.0",
73
+ "mini-css-extract-plugin": "^0.8.2",
87
74
  "open": "^7.0.0",
88
75
  "optimize-css-assets-webpack-plugin": "^5.0.0",
89
76
  "ora": "^4.0.1",
@@ -105,12 +92,8 @@
105
92
  "stylelint-config-xo-space": "^0.13.0",
106
93
  "terser-webpack-plugin": "^2.1.0",
107
94
  "url-loader": "^2.0.1",
108
- "vodal": "^2.3.3",
109
- "vue": "^2.2.0",
110
- "vue-loader": "^15.6.0",
111
- "vue-style-loader": "^4.0.2",
112
- "vue-template-compiler": "^2.4.4",
113
- "vuex": "^3.0.1",
95
+ "vue": "^3.4.21",
96
+ "vue-loader": "^17.3.1",
114
97
  "webpack": "^4.6.0",
115
98
  "webpack-bundle-analyzer": "^3.0.2",
116
99
  "webpack-cdn-plugin": "^3.1.4",
@@ -121,7 +104,8 @@
121
104
  "yaku": "^0.19.3"
122
105
  },
123
106
  "peerDependencies": {
124
- "vue": "^3.4.21"
107
+ "vue": "^3.4.21",
108
+ "vue-loader": "^17.3.1"
125
109
  },
126
110
  "keywords": [
127
111
  "vue",
@@ -1,15 +1,11 @@
1
1
  <script>
2
- import { inject, createApp } from 'vue'
2
+ import { provide, inject, createApp } from 'vue'
3
3
  import { watchSize, setupResizeAndScrollEventListeners, find } from '../utils'
4
4
  import Menu from './Menu'
5
5
 
6
6
  const PortalTarget = {
7
7
  name: 'rp-treeselect--portal-target',
8
- setup() {
9
- console.log('TEST')
10
- const instance = inject('instance')
11
- return { instance }
12
- },
8
+ props: [ 'instance' ],
13
9
 
14
10
  watch: {
15
11
  'instance.menu.isOpen'(newValue) {
@@ -31,8 +27,10 @@
31
27
  },
32
28
 
33
29
  mounted() {
34
- console.log('TEST')
35
- const { instance } = this
30
+ const { instance } = this.$props
31
+
32
+ console.log('PROVIDING')
33
+ provide('instance', instance)
36
34
 
37
35
  if (instance.menu.isOpen) this.setupHandlers()
38
36
  },
@@ -51,7 +49,7 @@
51
49
  },
52
50
 
53
51
  setupControlResizeAndScrollEventListeners() {
54
- const { instance } = this
52
+ const { instance } = this.$props
55
53
  const $control = instance.getControl()
56
54
 
57
55
  // istanbul ignore next
@@ -63,7 +61,7 @@
63
61
  },
64
62
 
65
63
  setupControlSizeWatcher() {
66
- const { instance } = this
64
+ const { instance } = this.$props
67
65
  const $control = instance.getControl()
68
66
 
69
67
  // istanbul ignore next
@@ -92,7 +90,7 @@
92
90
  },
93
91
 
94
92
  updateWidth() {
95
- const { instance } = this
93
+ const { instance } = this.$props
96
94
  const $portalTarget = this.$el
97
95
  const $control = instance.getControl()
98
96
  const controlRect = $control.getBoundingClientRect()
@@ -101,7 +99,7 @@
101
99
  },
102
100
 
103
101
  updateMenuContainerOffset() {
104
- const { instance } = this
102
+ const { instance } = this.$props
105
103
  const $control = instance.getControl()
106
104
  const $portalTarget = this.$el
107
105
  const controlRect = $control.getBoundingClientRect()
@@ -119,14 +117,17 @@
119
117
  },
120
118
 
121
119
  render() {
122
- const portalTargetClass = [ 'rp-treeselect__portal-target', this.instance.wrapperClass ]
123
- const portalTargetStyle = { zIndex: this.instance.zIndex }
124
-
125
- return (
126
- <div class={portalTargetClass} style={portalTargetStyle} data-instance-id={this.instance.getInstanceId()}>
127
- <Menu ref="menu" />
128
- </div>
129
- )
120
+ const { instance } = this.$props
121
+ if (instance) {
122
+ const portalTargetClass = [ 'rp-treeselect__portal-target', instance.wrapperClass ]
123
+ const portalTargetStyle = { zIndex: instance.zIndex }
124
+
125
+ return (
126
+ <div class={portalTargetClass} style={portalTargetStyle} data-instance-id={instance.getInstanceId()}>
127
+ <Menu ref="menu" />
128
+ </div>
129
+ )
130
+ }
130
131
  },
131
132
 
132
133
  destroyed() {
@@ -138,13 +139,17 @@
138
139
 
139
140
  export default {
140
141
  name: 'rp-treeselect--menu-portal',
142
+ setup() {
143
+ const instance = inject('instance')
144
+ return { instance }
145
+ },
141
146
 
142
147
  created() {
143
148
  this.portalTarget = null
144
149
  },
145
150
 
146
151
  mounted() {
147
- this.setup()
152
+ this.setupPortal()
148
153
  },
149
154
 
150
155
  destroyed() {
@@ -152,18 +157,12 @@
152
157
  },
153
158
 
154
159
  methods: {
155
- setup() {
160
+ setupPortal() {
156
161
  const el = document.createElement('div')
157
162
  el.setAttribute('id', `menu-target-${this._uid}`)
158
163
  document.body.appendChild(el)
159
164
 
160
-
161
- const targetApp = {
162
- parent: this,
163
- ...PortalTarget,
164
- }
165
-
166
- this.portalTarget = createApp(targetApp)
165
+ this.portalTarget = createApp(PortalTarget, { instance: this.instance })
167
166
  this.portalTarget.mount(`#menu-target-${this._uid}`)
168
167
  },
169
168