sortablejs-vue3
Advanced tools
Comparing version 1.2.10 to 1.2.11
@@ -1,3 +0,4 @@ | ||
import { defineComponent, useAttrs, ref, computed, watch, onUnmounted, openBlock, createBlock, resolveDynamicComponent, normalizeClass, withCtx, renderSlot, createElementBlock, Fragment, renderList } from "vue"; | ||
import Sortable from "sortablejs"; | ||
import { defineComponent, useAttrs, ref, computed, watch, onUnmounted, openBlock, createBlock, resolveDynamicComponent, normalizeClass, withCtx, renderSlot, createElementBlock, Fragment, renderList } from 'vue'; | ||
import Sortable from 'sortablejs'; | ||
const _sfc_main = /* @__PURE__ */ defineComponent({ | ||
@@ -71,3 +72,6 @@ __name: "Sortable", | ||
// See https://github.com/MaxLeiter/sortablejs-vue3/pull/56 for context on `attrs`. | ||
onMove: (event, originalEvent) => "onMoveCapture" in attrs ? attrs.onMoveCapture(event, originalEvent) : emit("move", event, originalEvent), | ||
onMove: (event, originalEvent) => "onMoveCapture" in attrs ? ( | ||
/** eslint-disable-next-line */ | ||
attrs.onMoveCapture(event, originalEvent) | ||
) : emit("move", event, originalEvent), | ||
onClone: (event) => emit("clone", event), | ||
@@ -120,4 +124,3 @@ onChange: (event) => emit("change", event) | ||
}); | ||
export { | ||
_sfc_main as Sortable | ||
}; | ||
export { _sfc_main as Sortable }; |
import { PropType, Ref } from "vue"; | ||
import Sortable from "sortablejs"; | ||
import Sortable, { SortableOptions } from "sortablejs"; | ||
import type { AutoScrollOptions } from "sortablejs/plugins"; | ||
type SortableOptionsProp = Omit<SortableOptions | AutoScrollOptions, "onUnchoose" | "onChoose" | "onStart" | "onEnd" | "onAdd" | "onUpdate" | "onSort" | "onRemove" | "onFilter" | "onMove" | "onClone" | "onChange">; | ||
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{ | ||
/** All SortableJS options are supported; events are handled by the `defineEmits` below and should be used with v-on */ | ||
options: { | ||
type: PropType<Omit<Sortable.SortableOptions | AutoScrollOptions, "onUnchoose" | "onChoose" | "onStart" | "onEnd" | "onAdd" | "onUpdate" | "onSort" | "onRemove" | "onFilter" | "onMove" | "onClone" | "onChange">>; | ||
type: PropType<SortableOptionsProp>; | ||
default: null; | ||
@@ -35,23 +36,12 @@ required: false; | ||
choose: (evt: Sortable.SortableEvent) => void; | ||
} & { | ||
unchoose: (evt: Sortable.SortableEvent) => void; | ||
} & { | ||
start: (evt: Sortable.SortableEvent) => void; | ||
} & { | ||
end: (evt: Sortable.SortableEvent) => void; | ||
} & { | ||
add: (evt: Sortable.SortableEvent) => void; | ||
} & { | ||
update: (evt: Sortable.SortableEvent) => void; | ||
} & { | ||
sort: (evt: Sortable.SortableEvent) => void; | ||
} & { | ||
remove: (evt: Sortable.SortableEvent) => void; | ||
} & { | ||
filter: (evt: Sortable.SortableEvent) => void; | ||
} & { | ||
move: (evt: Sortable.MoveEvent, originalEvent: Event) => void; | ||
} & { | ||
clone: (evt: Sortable.SortableEvent) => void; | ||
} & { | ||
change: (evt: Sortable.SortableEvent) => void; | ||
@@ -61,3 +51,3 @@ }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{ | ||
options: { | ||
type: PropType<Omit<Sortable.SortableOptions | AutoScrollOptions, "onUnchoose" | "onChoose" | "onStart" | "onEnd" | "onAdd" | "onUpdate" | "onSort" | "onRemove" | "onFilter" | "onMove" | "onClone" | "onChange">>; | ||
type: PropType<SortableOptionsProp>; | ||
default: null; | ||
@@ -98,3 +88,3 @@ required: false; | ||
}, { | ||
options: Omit<Sortable.SortableOptions | AutoScrollOptions, "onUnchoose" | "onChoose" | "onStart" | "onEnd" | "onAdd" | "onUpdate" | "onSort" | "onRemove" | "onFilter" | "onMove" | "onClone" | "onChange">; | ||
options: SortableOptionsProp; | ||
list: any[]; | ||
@@ -104,9 +94,9 @@ itemKey: string | ((item: any) => string | number | Symbol); | ||
}, {}>, { | ||
header: (_: {}) => any; | ||
item: (_: { | ||
header?(_: {}): any; | ||
item?(_: { | ||
key: any; | ||
element: any; | ||
index: number; | ||
}) => any; | ||
footer: (_: {}) => any; | ||
}): any; | ||
footer?(_: {}): any; | ||
}>; | ||
@@ -113,0 +103,0 @@ export default _default; |
{ | ||
"name": "sortablejs-vue3", | ||
"version": "1.2.10", | ||
"version": "1.2.11", | ||
"author": { | ||
@@ -18,10 +18,2 @@ "email": "maxwell.leiter@gmail.com", | ||
}, | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build && vue-tsc --emitDeclarationOnly --project tsconfig.dist.json && mv dist/lib dist/types && rm -rf dist/favicon.ico", | ||
"build:site": "vue-tsc --noEmit --project tsconfig.site.json && vite --config vite.site.config.ts build", | ||
"preview": "vite preview", | ||
"lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src", | ||
"format": "yarn prettier --write '**/*.{ts,vue,json}'" | ||
}, | ||
"types": "./dist/types/main.d.ts", | ||
@@ -41,27 +33,27 @@ "files": [ | ||
"dependencies": { | ||
"pinia": "^2.1.3", | ||
"sortablejs": "github:roy-mdr/Sortable#cee2ee7bccf83a7776c85588759aa0b8", | ||
"vue": "^3.2.37", | ||
"vue-eslint-parser": "^9.3.0" | ||
"sortablejs": "^1.15.0", | ||
"vue": "^3.3.7" | ||
}, | ||
"peerDependencies": { | ||
"sortablejs": "github:roy-mdr/Sortable#cee2ee7bccf83a7776c85588759aa0b8", | ||
"sortablejs": "^1.15.0", | ||
"vue": "^3.2.25" | ||
}, | ||
"devDependencies": { | ||
"@rushstack/eslint-patch": "^1.3.0", | ||
"@types/node": "18.14.2", | ||
"@types/sortablejs": "1.15.0", | ||
"@typescript-eslint/parser": "^5.59.8", | ||
"@vitejs/plugin-vue": "4.0.0", | ||
"@vue/eslint-config-typescript": "^11.0.3", | ||
"eslint": "^8.42.0", | ||
"eslint-config-prettier": "^8.8.0", | ||
"eslint-plugin-vue": "^9.14.1", | ||
"prettier": "2.8.4", | ||
"terser": "5.16.5", | ||
"typescript": "4.9.5", | ||
"vite": "4.1.4", | ||
"vue-tsc": "1.2.0" | ||
"@types/sortablejs": "1.15.4", | ||
"@vitejs/plugin-vue": "4.4.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"prettier": "3.0.3", | ||
"terser": "5.22.0", | ||
"typescript": "5.2.2", | ||
"vite": "4.5.0", | ||
"vue-tsc": "1.8.22" | ||
}, | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build && vue-tsc --emitDeclarationOnly --project tsconfig.dist.json && mv dist/lib dist/types && rm -rf dist/favicon.ico", | ||
"build:site": "vue-tsc --noEmit --project tsconfig.site.json && vite --config vite.site.config.ts build", | ||
"preview": "vite preview", | ||
"lint": "pnpm prettier --write '**/*.{ts,vue,json}'" | ||
} | ||
} | ||
} |
@@ -22,3 +22,3 @@ # SortableJS-vue3 | ||
```bash | ||
yarn add sortablejs-vue3 sortablejs | ||
pnpm add sortablejs-vue3 sortablejs | ||
``` | ||
@@ -68,3 +68,3 @@ | ||
4. The `list` and `item-key` props are necessary. The `options` prop is an object that can contain any SortableJS option. You can find a full list of them here: https://github.com/SortableJS/Sortable#options | ||
- The `tag` prop is optional and defaults to `div`. It's the HTML node type for the outer element of the included template/slot. | ||
- The `tag` prop is optional and defaults to `div`. It's the HTML node type for the outer element of the included template/slot. | ||
@@ -107,4 +107,4 @@ ### Props | ||
```typescript | ||
import SortableJs from 'sortablejs'; | ||
import { Swap } from 'sortablejs/modular/sortable.core.esm'; | ||
import SortableJs from "sortablejs"; | ||
import { Swap } from "sortablejs/modular/sortable.core.esm"; | ||
SortableJs.mount(new Swap()); | ||
@@ -122,3 +122,3 @@ | ||
const item = array.splice(from, 1)[0]; | ||
array.splice(to, 0, item); | ||
nextTick(() => array.splice(to, 0, item)); | ||
}; | ||
@@ -131,8 +131,12 @@ | ||
### Examples | ||
- [./src/examples/WithStore.vue](./src/examples/WithStore.vue) - A simple example with a store | ||
## Development | ||
1. Run `yarn` to install dependencies | ||
2. `yarn dev` will start a web server with live reloading | ||
3. `yarn build` will build the production library files | ||
4. `yarn build:site` will build the demo website | ||
1. Run `pnpm` to install dependencies | ||
2. `pnpm dev` will start a web server with live reloading | ||
3. `pnpm build` will build the production library files | ||
4. `pnpm build:site` will build the demo website | ||
@@ -139,0 +143,0 @@ ### Recommended IDE Setup |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
GitHub dependency
Supply chain riskContains a dependency which resolves to a GitHub URL. Dependencies fetched from GitHub specifiers are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
4
9
141
0
578892
8
236
+ Addedmagic-string@0.30.15(transitive)
+ Addedsortablejs@1.15.6(transitive)
- Removedpinia@^2.1.3
- Removedvue-eslint-parser@^9.3.0
- Removed@eslint-community/eslint-utils@4.4.1(transitive)
- Removed@eslint-community/regexpp@4.12.1(transitive)
- Removed@eslint/config-array@0.19.1(transitive)
- Removed@eslint/core@0.9.1(transitive)
- Removed@eslint/eslintrc@3.2.0(transitive)
- Removed@eslint/js@9.17.0(transitive)
- Removed@eslint/object-schema@2.1.5(transitive)
- Removed@eslint/plugin-kit@0.2.4(transitive)
- Removed@humanfs/core@0.19.1(transitive)
- Removed@humanfs/node@0.16.6(transitive)
- Removed@humanwhocodes/module-importer@1.0.1(transitive)
- Removed@humanwhocodes/retry@0.3.10.4.1(transitive)
- Removed@types/estree@1.0.6(transitive)
- Removed@types/json-schema@7.0.15(transitive)
- Removed@vue/devtools-api@6.6.4(transitive)
- Removedacorn@8.14.0(transitive)
- Removedacorn-jsx@5.3.2(transitive)
- Removedajv@6.12.6(transitive)
- Removedansi-styles@4.3.0(transitive)
- Removedargparse@2.0.1(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedcallsites@3.1.0(transitive)
- Removedchalk@4.1.2(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedcross-spawn@7.0.6(transitive)
- Removeddebug@4.4.0(transitive)
- Removeddeep-is@0.1.4(transitive)
- Removedescape-string-regexp@4.0.0(transitive)
- Removedeslint@9.17.0(transitive)
- Removedeslint-scope@7.2.28.2.0(transitive)
- Removedeslint-visitor-keys@3.4.34.2.0(transitive)
- Removedespree@10.3.09.6.1(transitive)
- Removedesquery@1.6.0(transitive)
- Removedesrecurse@4.3.0(transitive)
- Removedestraverse@5.3.0(transitive)
- Removedesutils@2.0.3(transitive)
- Removedfast-deep-equal@3.1.3(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedfast-levenshtein@2.0.6(transitive)
- Removedfile-entry-cache@8.0.0(transitive)
- Removedfind-up@5.0.0(transitive)
- Removedflat-cache@4.0.1(transitive)
- Removedflatted@3.3.2(transitive)
- Removedglob-parent@6.0.2(transitive)
- Removedglobals@14.0.0(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedignore@5.3.2(transitive)
- Removedimport-fresh@3.3.0(transitive)
- Removedimurmurhash@0.1.4(transitive)
- Removedis-extglob@2.1.1(transitive)
- Removedis-glob@4.0.3(transitive)
- Removedisexe@2.0.0(transitive)
- Removedjs-yaml@4.1.0(transitive)
- Removedjson-buffer@3.0.1(transitive)
- Removedjson-schema-traverse@0.4.1(transitive)
- Removedjson-stable-stringify-without-jsonify@1.0.1(transitive)
- Removedkeyv@4.5.4(transitive)
- Removedlevn@0.4.1(transitive)
- Removedlocate-path@6.0.0(transitive)
- Removedlodash@4.17.21(transitive)
- Removedlodash.merge@4.6.2(transitive)
- Removedmagic-string@0.30.17(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedms@2.1.3(transitive)
- Removednatural-compare@1.4.0(transitive)
- Removedoptionator@0.9.4(transitive)
- Removedp-limit@3.1.0(transitive)
- Removedp-locate@5.0.0(transitive)
- Removedparent-module@1.0.1(transitive)
- Removedpath-exists@4.0.0(transitive)
- Removedpath-key@3.1.1(transitive)
- Removedpinia@2.3.0(transitive)
- Removedprelude-ls@1.2.1(transitive)
- Removedpunycode@2.3.1(transitive)
- Removedresolve-from@4.0.0(transitive)
- Removedsemver@7.6.3(transitive)
- Removedshebang-command@2.0.0(transitive)
- Removedshebang-regex@3.0.0(transitive)
- Removedstrip-json-comments@3.1.1(transitive)
- Removedsupports-color@7.2.0(transitive)
- Removedtype-check@0.4.0(transitive)
- Removeduri-js@4.4.1(transitive)
- Removedvue-demi@0.14.10(transitive)
- Removedvue-eslint-parser@9.4.3(transitive)
- Removedwhich@2.0.2(transitive)
- Removedword-wrap@1.2.5(transitive)
- Removedyocto-queue@0.1.0(transitive)
Updatedsortablejs@^1.15.0
Updatedvue@^3.3.7