Skip to content

Commit

Permalink
chore: update common (#3273)
Browse files Browse the repository at this point in the history
* chore: update common

* fix(cascader): fix remove and change trigger effect
  • Loading branch information
uyarn authored Aug 15, 2024
1 parent 958f010 commit faf526d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/_common
Submodule _common updated 51 files
+23 −0 docs/mobile/api/back-top.en-US.md
+1 −1 docs/mobile/api/back-top.md
+23 −0 docs/mobile/api/cell.en-US.md
+7 −11 docs/mobile/api/cell.md
+7 −0 docs/mobile/api/icon.en-US.md
+1 −1 docs/mobile/api/icon.md
+0 −0 docs/mobile/api/layout.en-US.md
+0 −0 docs/mobile/api/layout.md
+32 −0 docs/mobile/api/navbar.en-US.md
+16 −4 docs/mobile/api/navbar.md
+11 −0 docs/mobile/api/overlay.en-US.md
+23 −0 docs/mobile/api/popup.en-US.md
+8 −26 docs/mobile/api/popup.md
+32 −0 docs/mobile/api/skeleton.en-US.md
+13 −12 docs/mobile/api/skeleton.md
+24 −0 docs/mobile/api/sticky.en-US.md
+5 −2 docs/mobile/api/sticky.md
+32 −0 docs/mobile/api/tag.en-US.md
+12 −26 docs/mobile/api/tag.md
+17 −0 docs/mobile/api_v2/layout.en-US.md
+17 −0 docs/mobile/api_v2/layout.md
+8 −0 docs/mobile/overview.en-US.md
+8 −0 docs/mobile/overview.md
+27 −0 docs/web/api/empty.en-US.md
+27 −0 docs/web/api/empty.md
+18 −2 js/global-config/default-config.ts
+14 −2 js/global-config/locale/ar_KW.ts
+18 −2 js/global-config/locale/en_US.ts
+31 −7 js/global-config/locale/it_IT.ts
+19 −3 js/global-config/locale/ja_JP.ts
+19 −3 js/global-config/locale/ko_KR.ts
+32 −6 js/global-config/locale/ru_RU.ts
+18 −2 js/global-config/locale/zh_CN.ts
+18 −2 js/global-config/locale/zh_TW.ts
+14 −1 js/input-number/large-number.ts
+11 −4 js/table/tree-store.ts
+4 −1 js/tree-v1/tree-node.ts
+4 −4 style/mobile/components/_index.less
+8 −1 style/mobile/components/layout/_index.less
+0 −0 style/mobile/components/layout/_mixin.less
+5 −0 style/mobile/components/notice-bar/v2/_index.less
+4 −1 style/mobile/components/overlay/_index.less
+0 −1 style/mobile/components/overlay/_var.less
+51 −0 style/mobile/components/overlay/v2/_animate.less
+7 −2 style/mobile/components/overlay/v2/_index.less
+0 −1 style/mobile/components/overlay/v2/_var.less
+0 −8 style/mobile/components/row/v2/_index.less
+0 −1 style/web/components/dropdown/_index.less
+31 −0 style/web/components/empty/_index.less
+23 −0 style/web/components/empty/_var.less
+12 −0 test/unit/input-number/largeNumberToFixed.test.js
37 changes: 20 additions & 17 deletions src/cascader/core/effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,24 +140,27 @@ export function handleRemoveTagEffect(
} = cascaderContext;

if (disabled) return;
const newValue = cloneDeep(value) as [];
const res = newValue.splice(index, 1);
const node = treeStore.getNodes(res[0])[0];

setValue(newValue, 'uncheck', node.getModel());

const checked = node.setChecked(!node.isChecked());
// 处理不同数据类型
const resValue = valueType === 'single'
? checked
: checked.map((val) => treeStore
.getNode(val)
.getPath()
.map((item) => item.value));

setValue(resValue, 'uncheck', node.getModel());
if (isFunction(onRemove)) {
onRemove({ value: checked, node: node as any });
// index equal to undefined means to click clear button
if (index !== undefined) {
const newValue = cloneDeep(value) as [];
const res = newValue.splice(index, 1);
const node = treeStore.getNodes(res[0])[0];

const checked = node.setChecked(!node.isChecked());
// 处理不同数据类型
const resValue = valueType === 'single'
? checked
: checked.map((val) => treeStore
.getNode(val)
.getPath()
.map((item) => item.value));
setValue(resValue, 'uncheck', node.getModel());
if (isFunction(onRemove)) {
onRemove({ value: checked, node: node as any });
}
} else if (isFunction(onRemove)) {
onRemove({ value, node: undefined });
}
}

Expand Down

0 comments on commit faf526d

Please sign in to comment.