@marsio/vue-draggable 1.0.2 → 1.0.4
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/README.md +86 -46
- package/build/cjs/Draggable.js +57 -25
- package/build/cjs/DraggableCore.js +44 -21
- package/build/cjs/utils/domFns.js +221 -97
- package/build/cjs/utils/log.js +2 -3
- package/build/cjs/utils/positionFns.js +86 -68
- package/build/cjs/utils/shims.js +45 -6
- package/build/cjs/utils/types.js +10 -2
- package/build/web/vue-draggable.min.89b0ffb5e5b82299d838.hot-update.js +30 -0
- package/build/web/vue-draggable.min.js +1420 -2
- package/build/web/vue-draggable_min.89b0ffb5e5b82299d838.hot-update.json +1 -0
- package/package.json +35 -11
- package/typings/index.d.ts +21 -4
- package/LICENSE +0 -21
- package/build/cjs/utils/test.js +0 -12
- package/build/web/vue-draggable.min.js.LICENSE.txt +0 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"c":["vue-draggable.min"],"r":[],"m":[]}
|
package/package.json
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marsio/vue-draggable",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Vue draggable component",
|
|
5
5
|
"main": "build/cjs/cjs.js",
|
|
6
6
|
"unpkg": "build/web/vue-draggable.min.js",
|
|
7
|
-
"
|
|
8
|
-
"dev": "make dev",
|
|
9
|
-
"build": "make clean build",
|
|
10
|
-
"lint": "make lint"
|
|
11
|
-
},
|
|
7
|
+
"sideEffects": false,
|
|
12
8
|
"files": [
|
|
13
9
|
"/build",
|
|
14
10
|
"/typings",
|
|
@@ -33,6 +29,8 @@
|
|
|
33
29
|
"@babel/plugin-transform-class-properties": "^7.18.6",
|
|
34
30
|
"@babel/preset-env": "^7.22.20",
|
|
35
31
|
"@babel/preset-typescript": "^7.23.3",
|
|
32
|
+
"@commitlint/cli": "^19.3.0",
|
|
33
|
+
"@commitlint/config-conventional": "^19.2.2",
|
|
36
34
|
"@types/lodash": "^4.14.202",
|
|
37
35
|
"@types/node": "^20.7.0",
|
|
38
36
|
"@typescript-eslint/eslint-plugin": "^6.16.0",
|
|
@@ -40,32 +38,58 @@
|
|
|
40
38
|
"@vue/babel-plugin-jsx": "^1.1.5",
|
|
41
39
|
"@vue/eslint-config-typescript": "^12.0.0",
|
|
42
40
|
"babel-loader": "^9.1.3",
|
|
41
|
+
"babel-plugin-lodash": "^3.3.4",
|
|
43
42
|
"babel-plugin-transform-inline-environment-variables": "^0.4.4",
|
|
43
|
+
"chalk": "^3.0.0",
|
|
44
44
|
"eslint": "^8.56.0",
|
|
45
45
|
"eslint-plugin-vue": "^9.19.2",
|
|
46
46
|
"eslint-webpack-plugin": "^4.0.1",
|
|
47
|
+
"fork-ts-checker-webpack-plugin": "^9.0.2",
|
|
48
|
+
"fs-extra": "^11.2.0",
|
|
49
|
+
"git-cliff": "^2.4.0",
|
|
50
|
+
"husky": "^9.0.11",
|
|
51
|
+
"inquirer": "^8.2.6",
|
|
47
52
|
"jasmine-core": "^5.1.1",
|
|
53
|
+
"lint-staged": "^15.2.7",
|
|
54
|
+
"lodash-webpack-plugin": "^0.11.6",
|
|
55
|
+
"minimist": "^1.2.5",
|
|
48
56
|
"pre-commit": "^1.2.2",
|
|
49
57
|
"process": "^0.11.10",
|
|
58
|
+
"progress-bar-webpack-plugin": "^2.1.0",
|
|
50
59
|
"puppeteer": "^21.3.5",
|
|
51
|
-
"semver": "^7.
|
|
60
|
+
"semver": "^7.6.2",
|
|
52
61
|
"static-server": "^3.0.0",
|
|
62
|
+
"terser-webpack-plugin": "^5.3.10",
|
|
63
|
+
"ts-loader": "^9.5.1",
|
|
53
64
|
"typescript": "^5.2.2",
|
|
54
65
|
"vue-loader": "next",
|
|
55
66
|
"webpack": "^5.88.2",
|
|
67
|
+
"webpack-bundle-analyzer": "^4.10.2",
|
|
56
68
|
"webpack-cli": "^5.1.4",
|
|
57
69
|
"webpack-dev-server": "^4.15.1"
|
|
58
70
|
},
|
|
59
71
|
"resolutions": {
|
|
60
72
|
"minimist": "^1.2.5"
|
|
61
73
|
},
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
|
|
74
|
+
"husky": {
|
|
75
|
+
"hooks": {}
|
|
76
|
+
},
|
|
77
|
+
"lint-staged": {
|
|
78
|
+
"lib/**/*.{js,vue,ts,tsx}": "eslint --fix"
|
|
79
|
+
},
|
|
65
80
|
"dependencies": {
|
|
66
81
|
"clsx": "^1.1.1",
|
|
67
82
|
"lodash": "^4.17.21",
|
|
68
83
|
"vue": "^3.2.23",
|
|
69
84
|
"vue-types": "^5.1.1"
|
|
85
|
+
},
|
|
86
|
+
"scripts": {
|
|
87
|
+
"dev": "node script.js --action=dev",
|
|
88
|
+
"build": "node script.js --action=build",
|
|
89
|
+
"build-docs": "node script.js --action=docs",
|
|
90
|
+
"lint": "eslint 'lib/**/*.{js.vue,ts,tsx}'",
|
|
91
|
+
"clean": "node script.js --action=clean",
|
|
92
|
+
"release": "node script.js --action=release",
|
|
93
|
+
"analyze": "ANALYZE=true webpack --config webpack.config.js"
|
|
70
94
|
}
|
|
71
|
-
}
|
|
95
|
+
}
|
package/typings/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
declare module 'vue-draggable' {
|
|
2
|
-
import { DefineComponent, PropType } from 'vue';
|
|
1
|
+
declare module '@marsio/vue-draggable' {
|
|
2
|
+
import { DefineComponent, PropType, Ref } from 'vue';
|
|
3
3
|
|
|
4
4
|
export interface DraggableBounds {
|
|
5
5
|
left?: number;
|
|
@@ -19,8 +19,24 @@ declare module 'vue-draggable' {
|
|
|
19
19
|
|
|
20
20
|
export type ControlPosition = { x: number; y: number };
|
|
21
21
|
export type PositionOffsetControlPosition = { x: number | string; y: number | string };
|
|
22
|
+
export type DraggableEventHandler = (e: MouseEvent, data: DraggableData) => void | false
|
|
22
23
|
|
|
23
|
-
export interface
|
|
24
|
+
export interface DraggableCoreProps {
|
|
25
|
+
allowAnyClick: boolean,
|
|
26
|
+
cancel: string,
|
|
27
|
+
disabled: boolean,
|
|
28
|
+
enableUserSelectHack: boolean,
|
|
29
|
+
offsetParent: HTMLElement,
|
|
30
|
+
grid: [number, number],
|
|
31
|
+
handle: string,
|
|
32
|
+
nodeRef?: Ref<HTMLElement | undefined>,
|
|
33
|
+
startFn: DraggableEventHandler,
|
|
34
|
+
dragFn: DraggableEventHandler,
|
|
35
|
+
stopFn: DraggableEventHandler,
|
|
36
|
+
scale: number
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface DraggableProps extends DraggableCoreProps {
|
|
24
40
|
axis?: 'both' | 'x' | 'y' | 'none';
|
|
25
41
|
bounds?: DraggableBounds | string | false;
|
|
26
42
|
defaultClassName?: string;
|
|
@@ -32,5 +48,6 @@ declare module 'vue-draggable' {
|
|
|
32
48
|
}
|
|
33
49
|
|
|
34
50
|
const Draggable: DefineComponent<DraggableProps>;
|
|
35
|
-
|
|
51
|
+
const DraggableCore: DefineComponent<DraggableCoreProps>;
|
|
52
|
+
export { Draggable as default, DraggableCore};
|
|
36
53
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
(MIT License)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 Marshall. All rights reserved.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a
|
|
6
|
-
copy of this software and associated documentation files (the "Software"),
|
|
7
|
-
to deal in the Software without restriction, including without limitation
|
|
8
|
-
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
9
|
-
and/or sell copies of the Software, and to permit persons to whom the
|
|
10
|
-
Software is furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
20
|
-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
21
|
-
DEALINGS IN THE SOFTWARE.
|
package/build/cjs/utils/test.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.externalFunction = externalFunction;
|
|
7
|
-
function externalFunction(componentInstance) {
|
|
8
|
-
// 调用组件的内部方法
|
|
9
|
-
if (componentInstance && componentInstance.internalMethod) {
|
|
10
|
-
componentInstance.internalMethod();
|
|
11
|
-
}
|
|
12
|
-
}
|