From 66fd321ebfec71bbe18554a929ba8b99ea8c5cb6 Mon Sep 17 00:00:00 2001 From: York Yao Date: Sun, 5 Sep 2021 16:45:12 +0800 Subject: [PATCH] chore: update dependencies --- package.json | 14 ++-- packages/core/demo/index.ts | 10 +-- packages/core/src/index.ts | 2 +- packages/react/demo/index.tsx | 2 +- packages/vue/demo/index.ts | 2 +- yarn.lock | 132 +++++++++++++++++----------------- 6 files changed, 81 insertions(+), 81 deletions(-) diff --git a/package.json b/package.json index 98b4bfb..0296895 100644 --- a/package.json +++ b/package.json @@ -27,13 +27,13 @@ "devDependencies": { "@rollup/plugin-commonjs": "20.0.0", "@rollup/plugin-node-resolve": "13.0.4", - "@types/node": "16.7.4", + "@types/node": "16.7.10", "@types/react": "17.0.19", "@types/react-dom": "17.0.9", "@types/webpack": "5.28.0", - "@typescript-eslint/eslint-plugin": "4.29.3", - "@typescript-eslint/parser": "4.29.3", - "autoprefixer": "10.3.3", + "@typescript-eslint/eslint-plugin": "4.30.0", + "@typescript-eslint/parser": "4.30.0", + "autoprefixer": "10.3.4", "clean-css-cli": "5.3.3", "clean-release": "2.15.2", "clean-scripts": "1.20.1", @@ -59,11 +59,11 @@ "stylelint-config-standard": "22.0.0", "ts-loader": "9.2.5", "ts-node": "10.2.1", - "tsconfig-plantain": "0.0.1", - "type-coverage": "2.18.0", + "tsconfig-plantain": "0.0.2", + "type-coverage": "2.18.2", "typescript": "4.4.2", "watch-then-execute": "1.2.0", - "webpack": "5.51.1", + "webpack": "5.52.0", "webpack-cli": "4.8.0" }, "workspaces": [ diff --git a/packages/core/demo/index.ts b/packages/core/demo/index.ts index 0b9ef87..fca1505 100644 --- a/packages/core/demo/index.ts +++ b/packages/core/demo/index.ts @@ -157,7 +157,7 @@ export function toggle(eventData: EventData, customComponent?: string | F const newExtraData: TreeData[] = JSON.parse(JSON.stringify(rawExtraData)) eventData.data.children = newExtraData if (customComponent) { - newExtraData[5].component = customComponent + newExtraData[5]!.component = customComponent } eventData.data.state.loading = false eventData.data.state.opened = !eventData.data.state.opened @@ -207,9 +207,9 @@ export function setParentsSelection(tree: TreeData[], path: number[]) { const parentPath = path.slice(0, path.length - 1) for (const index of parentPath) { if (parents.length === 0) { - parents.unshift(tree[index]) + parents.unshift(tree[index]!) } else { - parents.unshift(parents[0].children[index]) + parents.unshift(parents[0]!.children[index]!) } } for (const parent of parents) { @@ -242,7 +242,7 @@ export function move(dropData: DropData, treeData: TreeData[]) { const sourceParent = getNodeFromPath(treeData, dropData.sourcePath.slice(0, dropData.sourcePath.length - 1)) const sourceChildren = sourceParent && sourceParent.children ? sourceParent.children : treeData - let sourceIndex = dropData.sourcePath[dropData.sourcePath.length - 1] + let sourceIndex = dropData.sourcePath[dropData.sourcePath.length - 1]! if (dropData.targetData.state.dropPosition === DropPosition.inside) { if (dropData.targetData.children) { @@ -252,7 +252,7 @@ export function move(dropData: DropData, treeData: TreeData[]) { } dropData.targetData.state.opened = true } else { - const startIndex = dropData.targetPath[dropData.targetPath.length - 1] + (dropData.targetData.state.dropPosition === DropPosition.up ? 0 : 1) + const startIndex = dropData.targetPath[dropData.targetPath.length - 1]! + (dropData.targetData.state.dropPosition === DropPosition.up ? 0 : 1) const targetParent = getNodeFromPath(treeData, dropData.targetPath.slice(0, dropData.targetPath.length - 1)) const targetChildren = targetParent && targetParent.children ? targetParent.children : treeData targetChildren.splice(startIndex, 0, dropData.sourceData) diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 50a79f2..4da738c 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -221,7 +221,7 @@ export interface DropData { * @public */ export function getNodeFromPath(rootData: TreeData[], path: number[]) { - let node: TreeData | null = null + let node: TreeData | undefined for (const index of path) { node = node ? node.children[index] : rootData[index] if (!node) { diff --git a/packages/react/demo/index.tsx b/packages/react/demo/index.tsx index b79f850..7bfd06e 100644 --- a/packages/react/demo/index.tsx +++ b/packages/react/demo/index.tsx @@ -6,7 +6,7 @@ import { data, clearSelectionOfTree, toggle, setSelectionOfTree, setParentsSelec const DeleteButton: React.StatelessComponent<{ data: ContextMenuData }> = props => diff --git a/packages/vue/demo/index.ts b/packages/vue/demo/index.ts index 7f622a7..77254e4 100644 --- a/packages/vue/demo/index.ts +++ b/packages/vue/demo/index.ts @@ -13,7 +13,7 @@ const DeleteButton = defineComponent({ click() { const parent = getNodeFromPath(this.data.root, this.data.path.slice(0, this.data.path.length - 1)) const children = parent && parent.children ? parent.children : this.data.root - const index = this.data.path[this.data.path.length - 1] + const index = this.data.path[this.data.path.length - 1]! children.splice(index, 1) } }, diff --git a/yarn.lock b/yarn.lock index 7f24c00..171b894 100644 --- a/yarn.lock +++ b/yarn.lock @@ -460,10 +460,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.4.13.tgz#7dfd9c14661edc65cccd43a29eb454174642370d" integrity sha512-bLL69sKtd25w7p1nvg9pigE4gtKVpGTPojBFLMkGHXuUgap2sLqQt2qUnqmVCDfzGUL0DRNZP+1prIZJbMeAXg== -"@types/node@16.7.4": - version "16.7.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.7.4.tgz#68a9384694af63ceab8848e95d76d9a3519e84b6" - integrity sha512-25QXpDsTiDnl2rZGUenagVMwO46way8dOUdvoC3R3p+6TrbpxeJBo/v87BEG1IHI31Jhaa8lPeSHcqwxsVBeYQ== +"@types/node@16.7.10": + version "16.7.10" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.7.10.tgz#7aa732cc47341c12a16b7d562f519c2383b6d4fc" + integrity sha512-S63Dlv4zIPb8x6MMTgDq5WWRJQe56iBEY0O3SOFA9JrRienkOVDXSXBjjJw6HTNQYSE2JI6GMCR6LVbIMHJVvA== "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -531,13 +531,13 @@ tapable "^2.2.0" webpack "^5" -"@typescript-eslint/eslint-plugin@4.29.3": - version "4.29.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.29.3.tgz#95cb8029a8bd8bd9c7f4ab95074a7cb2115adefa" - integrity sha512-tBgfA3K/3TsZY46ROGvoRxQr1wBkclbVqRQep97MjVHJzcRBURRY3sNFqLk0/Xr//BY5hM9H2p/kp+6qim85SA== +"@typescript-eslint/eslint-plugin@4.30.0": + version "4.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.30.0.tgz#4a0c1ae96b953f4e67435e20248d812bfa55e4fb" + integrity sha512-NgAnqk55RQ/SD+tZFD9aPwNSeHmDHHe5rtUyhIq0ZeCWZEvo4DK9rYz7v9HDuQZFvn320Ot+AikaCKMFKLlD0g== dependencies: - "@typescript-eslint/experimental-utils" "4.29.3" - "@typescript-eslint/scope-manager" "4.29.3" + "@typescript-eslint/experimental-utils" "4.30.0" + "@typescript-eslint/scope-manager" "4.30.0" debug "^4.3.1" functional-red-black-tree "^1.0.1" regexpp "^3.1.0" @@ -555,45 +555,45 @@ eslint-scope "^5.0.0" eslint-utils "^2.0.0" -"@typescript-eslint/experimental-utils@4.29.3": - version "4.29.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.29.3.tgz#52e437a689ccdef73e83c5106b34240a706f15e1" - integrity sha512-ffIvbytTVWz+3keg+Sy94FG1QeOvmV9dP2YSdLFHw/ieLXWCa3U1TYu8IRCOpMv2/SPS8XqhM1+ou1YHsdzKrg== +"@typescript-eslint/experimental-utils@4.30.0": + version "4.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.30.0.tgz#9e49704fef568432ae16fc0d6685c13d67db0fd5" + integrity sha512-K8RNIX9GnBsv5v4TjtwkKtqMSzYpjqAQg/oSphtxf3xxdt6T0owqnpojztjjTcatSteH3hLj3t/kklKx87NPqw== dependencies: "@types/json-schema" "^7.0.7" - "@typescript-eslint/scope-manager" "4.29.3" - "@typescript-eslint/types" "4.29.3" - "@typescript-eslint/typescript-estree" "4.29.3" + "@typescript-eslint/scope-manager" "4.30.0" + "@typescript-eslint/types" "4.30.0" + "@typescript-eslint/typescript-estree" "4.30.0" eslint-scope "^5.1.1" eslint-utils "^3.0.0" -"@typescript-eslint/parser@4.29.3": - version "4.29.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.29.3.tgz#2ac25535f34c0e98f50c0e6b28c679c2357d45f2" - integrity sha512-jrHOV5g2u8ROghmspKoW7pN8T/qUzk0+DITun0MELptvngtMrwUJ1tv5zMI04CYVEUsSrN4jV7AKSv+I0y0EfQ== +"@typescript-eslint/parser@4.30.0": + version "4.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.30.0.tgz#6abd720f66bd790f3e0e80c3be77180c8fcb192d" + integrity sha512-HJ0XuluSZSxeboLU7Q2VQ6eLlCwXPBOGnA7CqgBnz2Db3JRQYyBDJgQnop6TZ+rsbSx5gEdWhw4rE4mDa1FnZg== dependencies: - "@typescript-eslint/scope-manager" "4.29.3" - "@typescript-eslint/types" "4.29.3" - "@typescript-eslint/typescript-estree" "4.29.3" + "@typescript-eslint/scope-manager" "4.30.0" + "@typescript-eslint/types" "4.30.0" + "@typescript-eslint/typescript-estree" "4.30.0" debug "^4.3.1" -"@typescript-eslint/scope-manager@4.29.3": - version "4.29.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.29.3.tgz#497dec66f3a22e459f6e306cf14021e40ec86e19" - integrity sha512-x+w8BLXO7iWPkG5mEy9bA1iFRnk36p/goVlYobVWHyDw69YmaH9q6eA+Fgl7kYHmFvWlebUTUfhtIg4zbbl8PA== +"@typescript-eslint/scope-manager@4.30.0": + version "4.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.30.0.tgz#1a3ffbb385b1a06be85cd5165a22324f069a85ee" + integrity sha512-VJ/jAXovxNh7rIXCQbYhkyV2Y3Ac/0cVHP/FruTJSAUUm4Oacmn/nkN5zfWmWFEanN4ggP0vJSHOeajtHq3f8A== dependencies: - "@typescript-eslint/types" "4.29.3" - "@typescript-eslint/visitor-keys" "4.29.3" + "@typescript-eslint/types" "4.30.0" + "@typescript-eslint/visitor-keys" "4.30.0" "@typescript-eslint/types@3.10.1": version "3.10.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-3.10.1.tgz#1d7463fa7c32d8a23ab508a803ca2fe26e758727" integrity sha512-+3+FCUJIahE9q0lDi1WleYzjCwJs5hIsbugIgnbB+dSCYUxl8L6PwmsyOPFZde2hc1DlTo/xnkOgiTLSyAbHiQ== -"@typescript-eslint/types@4.29.3": - version "4.29.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.29.3.tgz#d7980c49aef643d0af8954c9f14f656b7fd16017" - integrity sha512-s1eV1lKNgoIYLAl1JUba8NhULmf+jOmmeFO1G5MN/RBCyyzg4TIOfIOICVNC06lor+Xmy4FypIIhFiJXOknhIg== +"@typescript-eslint/types@4.30.0": + version "4.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.30.0.tgz#fb9d9b0358426f18687fba82eb0b0f869780204f" + integrity sha512-YKldqbNU9K4WpTNwBqtAerQKLLW/X2A/j4yw92e3ZJYLx+BpKLeheyzoPfzIXHfM8BXfoleTdiYwpsvVPvHrDw== "@typescript-eslint/typescript-estree@3.10.1": version "3.10.1" @@ -609,13 +609,13 @@ semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/typescript-estree@4.29.3": - version "4.29.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.29.3.tgz#1bafad610015c4ded35c85a70b6222faad598b40" - integrity sha512-45oQJA0bxna4O5TMwz55/TpgjX1YrAPOI/rb6kPgmdnemRZx/dB0rsx+Ku8jpDvqTxcE1C/qEbVHbS3h0hflag== +"@typescript-eslint/typescript-estree@4.30.0": + version "4.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.30.0.tgz#ae57833da72a753f4846cd3053758c771670c2ac" + integrity sha512-6WN7UFYvykr/U0Qgy4kz48iGPWILvYL34xXJxvDQeiRE018B7POspNRVtAZscWntEPZpFCx4hcz/XBT+erenfg== dependencies: - "@typescript-eslint/types" "4.29.3" - "@typescript-eslint/visitor-keys" "4.29.3" + "@typescript-eslint/types" "4.30.0" + "@typescript-eslint/visitor-keys" "4.30.0" debug "^4.3.1" globby "^11.0.3" is-glob "^4.0.1" @@ -629,12 +629,12 @@ dependencies: eslint-visitor-keys "^1.1.0" -"@typescript-eslint/visitor-keys@4.29.3": - version "4.29.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.29.3.tgz#c691760a00bd86bf8320d2a90a93d86d322f1abf" - integrity sha512-MGGfJvXT4asUTeVs0Q2m+sY63UsfnA+C/FDgBKV3itLBmM9H0u+URcneePtkd0at1YELmZK6HSolCqM4Fzs6yA== +"@typescript-eslint/visitor-keys@4.30.0": + version "4.30.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.30.0.tgz#a47c6272fc71b0c627d1691f68eaecf4ad71445e" + integrity sha512-pNaaxDt/Ol/+JZwzP7MqWc8PJQTUhZwoee/PVlQ+iYoYhagccvoHnC9e4l+C/krQYYkENxznhVSDwClIbZVxRw== dependencies: - "@typescript-eslint/types" "4.29.3" + "@typescript-eslint/types" "4.30.0" eslint-visitor-keys "^2.0.0" "@vue/compiler-core@3.1.5": @@ -971,10 +971,10 @@ at-least-node@^1.0.0: resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== -autoprefixer@10.3.3: - version "10.3.3" - resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.3.3.tgz#4bac89c74ef98e6a40fe1c5b76c0d1c91db153ce" - integrity sha512-yRzjxfnggrP/+qVHlUuZz5FZzEbkT+Yt0/Df6ScEMnbbZBLzYB2W0KLxoQCW+THm1SpOsM1ZPcTHAwuvmibIsQ== +autoprefixer@10.3.4: + version "10.3.4" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.3.4.tgz#29efe5d19f51c281953178ddb5b84c5f1ca24c86" + integrity sha512-EKjKDXOq7ug+jagLzmnoTRpTT0q1KVzEJqrJd0hCBa7FiG0WbFOBCcJCy2QkW1OckpO3qgttA1aWjVbeIPAecw== dependencies: browserslist "^4.16.8" caniuse-lite "^1.0.30001252" @@ -4208,10 +4208,10 @@ ts-node@10.2.1: make-error "^1.1.1" yn "3.1.1" -tsconfig-plantain@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/tsconfig-plantain/-/tsconfig-plantain-0.0.1.tgz#44ef6a8f3e3cada987377bedfe976d34165cac84" - integrity sha512-pxHR0SOmqyprd1LU1GMT09wWoJFIC5mIOKYwgoGfB1Q42MkDX8kEDAl7GjBqch/MY5FPn6ivS31Wku933l86Hw== +tsconfig-plantain@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/tsconfig-plantain/-/tsconfig-plantain-0.0.2.tgz#6934e0596873a448cfe673767f14b8f8c6f0d0e2" + integrity sha512-flRn+rNie8A4ORR5gThnaiculQ7wkNf0/opnOgb8pJM7SmJgupg+LQsDw/+YYQU3TlFGzI4Bn7CCqxs+HgbYsQ== "tslib@1 || 2", tslib@2, tslib@~2.1.0: version "2.1.0" @@ -4237,10 +4237,10 @@ type-check@^0.4.0, type-check@~0.4.0: dependencies: prelude-ls "^1.2.1" -type-coverage-core@^2.17.5: - version "2.17.5" - resolved "https://registry.yarnpkg.com/type-coverage-core/-/type-coverage-core-2.17.5.tgz#c5fd423be515c9207c82d7fa529847fefed19e6a" - integrity sha512-FfkH2kIgQkkgC47V2WHJZWBbjYjMw2ZpQRdRGTcMBAnkijmRCp9I1LpOuI+Gv4MDtniRLnkAo8htGGt2iExFgA== +type-coverage-core@^2.18.2: + version "2.18.2" + resolved "https://registry.yarnpkg.com/type-coverage-core/-/type-coverage-core-2.18.2.tgz#2ffe1abe035c5a506614778223536b5d1d22f451" + integrity sha512-cyQKmRoh+7gbIvXnPg5F6xWTdZ2+0R0tqgdJaIImqDs1Gih6fBeIDhYblS25TkR2ZmacmYnG33nAvQUe89zwnA== dependencies: fast-glob "3" minimatch "3" @@ -4248,13 +4248,13 @@ type-coverage-core@^2.17.5: tslib "1 || 2" tsutils "3" -type-coverage@2.18.0: - version "2.18.0" - resolved "https://registry.yarnpkg.com/type-coverage/-/type-coverage-2.18.0.tgz#ed2fc6d23a4517bae0bb7ee54863e6c77461165a" - integrity sha512-SAyrR6Xl7GfHNcXU8Y3wSnJfGftdCvf/b2JlJJtt7gt74T0dCF077/ukhlLjI/MsWmRCxW8k8x/d4AjrFiLSpQ== +type-coverage@2.18.2: + version "2.18.2" + resolved "https://registry.yarnpkg.com/type-coverage/-/type-coverage-2.18.2.tgz#96fb05aff17bc56bb85a94339c7291742ddafe67" + integrity sha512-1CumIpMrwTtp0asIBoYfvZlaEgxlIwGhIs/UoKuKOIIsNWnXw4iThg+LyEGMLfNJNsCEzheeZR4Xx9F8QdPXPg== dependencies: minimist "1" - type-coverage-core "^2.17.5" + type-coverage-core "^2.18.2" type-fest@^0.18.0: version "0.18.1" @@ -4469,10 +4469,10 @@ webpack-sources@^3.2.0: resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.0.tgz#b16973bcf844ebcdb3afde32eda1c04d0b90f89d" integrity sha512-fahN08Et7P9trej8xz/Z7eRu8ltyiygEo/hnRi9KqBUs80KeDcnf96ZJo++ewWd84fEf3xSX9bp4ZS9hbw0OBw== -webpack@5.51.1: - version "5.51.1" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.51.1.tgz#41bebf38dccab9a89487b16dbe95c22e147aac57" - integrity sha512-xsn3lwqEKoFvqn4JQggPSRxE4dhsRcysWTqYABAZlmavcoTmwlOb9b1N36Inbt/eIispSkuHa80/FJkDTPos1A== +webpack@5.52.0: + version "5.52.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.52.0.tgz#88d997c2c3ebb62abcaa453d2a26e0fd917c71a3" + integrity sha512-yRZOat8jWGwBwHpco3uKQhVU7HYaNunZiJ4AkAVQkPCUGoZk/tiIXiwG+8HIy/F+qsiZvSOa+GLQOj3q5RKRYg== dependencies: "@types/eslint-scope" "^3.7.0" "@types/estree" "^0.0.50"