From 9d86c19ed394583231c6d1a8da46a978c7c59452 Mon Sep 17 00:00:00 2001 From: kousum Date: Thu, 4 Jul 2024 09:20:47 +0800 Subject: [PATCH] feat: semi 2.61.0 --- docs/.vitepress/theme/layout/index.mts | 14 +- package.json | 14 +- packages/semi-animation-vue/package.json | 8 +- packages/semi-icons-lab-vue/package.json | 4 +- packages/semi-icons-vue/package.json | 4 +- packages/semi-illustrations-vue/package.json | 4 +- packages/semi-ui-vue/package.json | 6 +- packages/semi-ui-vue/src/App.tsx | 4 +- .../src/components/breadcrumb/index.tsx | 10 +- .../src/components/breadcrumb/item.tsx | 4 +- .../src/components/form/baseForm.tsx | 7 + .../src/components/overflowList/index.tsx | 44 ++- .../src/components/pagination/index.tsx | 1 + .../src/components/select/index.tsx | 88 +++++- .../src/components/table/TableCell.tsx | 5 +- .../src/components/table/interface.ts | 6 +- .../src/components/tabs/TabBar.tsx | 117 +++++--- .../components/tabs/__test__/test.spec.tsx | 4 +- .../semi-ui-vue/src/components/tabs/index.tsx | 17 +- .../src/components/tabs/interface.ts | 17 +- .../src/components/tooltip/index.tsx | 7 + .../semi-ui-vue/src/components/tree/index.tsx | 2 + .../src/components/tree/interface.ts | 1 + .../src/components/treeSelect/index.tsx | 70 +++-- .../src/components/typography/base.tsx | 2 +- patches/@vue__repl@4.3.1.patch | 271 ++++++++++++++++++ pnpm-lock.yaml | 108 ++++--- 27 files changed, 648 insertions(+), 191 deletions(-) create mode 100644 patches/@vue__repl@4.3.1.patch diff --git a/docs/.vitepress/theme/layout/index.mts b/docs/.vitepress/theme/layout/index.mts index b9482a81..77914133 100644 --- a/docs/.vitepress/theme/layout/index.mts +++ b/docs/.vitepress/theme/layout/index.mts @@ -25,10 +25,22 @@ export { default as VPTeamPageTitle } from 'vitepress/dist/client/theme-default/ export { default as VPTeamPageSection } from 'vitepress/dist/client/theme-default/components/VPTeamPageSection.vue'; export { default as VPTeamMembers } from 'vitepress/dist/client/theme-default/components/VPTeamMembers.vue'; export { useSidebar } from 'vitepress/dist/client/theme-default/composables/sidebar'; +import LiveCode from '../../../LiveCode.vue'; +import LiveCode2 from '../../../LiveCode2.vue'; +import DesignToken from '../../../DesignToken.vue'; +import Notice from '../../../Notice'; +import PureA from '../../../PureA'; + const theme = { Layout, enhanceApp: ({ app }) => { app.component('Badge', VPBadge); + // 注册自定义全局组件 + app.component('LiveCode', LiveCode); + app.component('LiveCode2', LiveCode2); + app.component('DesignToken', DesignToken); + app.component('Notice', Notice); + app.component('PureA', PureA); } -}; +} export default theme; diff --git a/package.json b/package.json index be9960d1..188183a0 100755 --- a/package.json +++ b/package.json @@ -32,14 +32,13 @@ "packages/vite-plugin-semi-theme" ], "dependencies": { - "@douyinfe/semi-foundation": "2.60.0", - "@douyinfe/semi-theme-default": "2.60.0", - "@vue/repl": "4.2.1", + "@douyinfe/semi-foundation": "2.61.0", + "@douyinfe/semi-theme-default": "2.61.0", + "@vue/repl": "4.3.1", "lodash": "^4.17.21", "vue": "^3.4.31" }, "devDependencies": { - "@types/lodash": "^4.17.5", "@babel/core": "^7.18.2", "@babel/plugin-proposal-decorators": "^7.18.2", "@babel/plugin-transform-runtime": "^7.18.2", @@ -47,9 +46,9 @@ "@babel/preset-react": "^7.16.7", "@changesets/cli": "^2.27.1", "@chromatic-com/storybook": "1.3.4", - "@douyinfe/semi-theme-default": "2.60.0", - "@kousum/semi-icons-vue": "workspace: *", + "@douyinfe/semi-theme-default": "2.61.0", "@kousum/semi-icons-lab-vue": "workspace: *", + "@kousum/semi-icons-vue": "workspace: *", "@kousum/semi-illustrations-vue": "workspace: *", "@kousum/semi-ui-vue": "workspace: *", "@storybook/addon-essentials": "^8.1.7", @@ -74,6 +73,7 @@ "@svgr/plugin-svgo": "5.5.0", "@svgr/webpack": "5.5.0", "@testing-library/vue": "^8.1.0", + "@types/lodash": "^4.17.5", "@types/node": "^20.1.4", "@vitejs/plugin-vue": "^5.0.5", "@vitejs/plugin-vue-jsx": "^4.0.0", @@ -102,7 +102,7 @@ }, "pnpm": { "patchedDependencies": { - "@vue/repl@4.2.1": "patches/@vue__repl@4.2.1.patch" + "@vue/repl@4.3.1": "patches/@vue__repl@4.3.1.patch" } } } diff --git a/packages/semi-animation-vue/package.json b/packages/semi-animation-vue/package.json index 47df2628..c93258bc 100755 --- a/packages/semi-animation-vue/package.json +++ b/packages/semi-animation-vue/package.json @@ -38,10 +38,10 @@ "preview": "vite preview" }, "dependencies": { - "@douyinfe/semi-animation": "2.60.0", - "@douyinfe/semi-animation-styled": "2.60.0", - "@douyinfe/semi-foundation": "2.60.0", - "@douyinfe/semi-theme-default": "2.60.0", + "@douyinfe/semi-animation": "2.61.0", + "@douyinfe/semi-animation-styled": "2.61.0", + "@douyinfe/semi-foundation": "2.61.0", + "@douyinfe/semi-theme-default": "2.61.0", "classnames": "^2.3.2", "sass": "^1.57.1", "vue": "^3.4.31" diff --git a/packages/semi-icons-lab-vue/package.json b/packages/semi-icons-lab-vue/package.json index 2aed953a..2d037d8c 100644 --- a/packages/semi-icons-lab-vue/package.json +++ b/packages/semi-icons-lab-vue/package.json @@ -28,8 +28,8 @@ "preview": "vite preview" }, "dependencies": { - "@douyinfe/semi-foundation": "2.60.0", - "@douyinfe/semi-theme-default": "2.60.0", + "@douyinfe/semi-foundation": "2.61.0", + "@douyinfe/semi-theme-default": "2.61.0", "classnames": "^2.3.2", "sass": "^1.57.1", "vue": "^3.4.31" diff --git a/packages/semi-icons-vue/package.json b/packages/semi-icons-vue/package.json index 96cf61c9..465181eb 100755 --- a/packages/semi-icons-vue/package.json +++ b/packages/semi-icons-vue/package.json @@ -22,8 +22,8 @@ "preview": "vite preview" }, "dependencies": { - "@douyinfe/semi-foundation": "2.60.0", - "@douyinfe/semi-theme-default": "2.60.0", + "@douyinfe/semi-foundation": "2.61.0", + "@douyinfe/semi-theme-default": "2.61.0", "classnames": "^2.3.2", "sass": "^1.57.1", "vue": "^3.4.31" diff --git a/packages/semi-illustrations-vue/package.json b/packages/semi-illustrations-vue/package.json index c6313b24..f7ad0078 100755 --- a/packages/semi-illustrations-vue/package.json +++ b/packages/semi-illustrations-vue/package.json @@ -26,8 +26,8 @@ "build:icon": "node scripts/build-illustration.cjs" }, "dependencies": { - "@douyinfe/semi-foundation": "2.60.0", - "@douyinfe/semi-theme-default": "2.60.0", + "@douyinfe/semi-foundation": "2.61.0", + "@douyinfe/semi-theme-default": "2.61.0", "classnames": "^2.3.2", "vue": "^3.4.31" }, diff --git a/packages/semi-ui-vue/package.json b/packages/semi-ui-vue/package.json index e21145ec..aa3cd08b 100755 --- a/packages/semi-ui-vue/package.json +++ b/packages/semi-ui-vue/package.json @@ -24,9 +24,9 @@ "url": "https://github.com/rashagu/semi-design-vue" }, "dependencies": { - "@douyinfe/semi-foundation": "2.60.0", - "@douyinfe/semi-theme-default": "2.60.0", - "@douyinfe/semi-animation": "2.60.0", + "@douyinfe/semi-foundation": "2.61.0", + "@douyinfe/semi-theme-default": "2.61.0", + "@douyinfe/semi-animation": "2.61.0", "@kousum/semi-animation-vue": "^0.14.2", "@kousum/semi-icons-vue": "^0.14.2", "@kousum/semi-illustrations-vue": "^0.14.2", diff --git a/packages/semi-ui-vue/src/App.tsx b/packages/semi-ui-vue/src/App.tsx index 1540f92e..23b3d61f 100755 --- a/packages/semi-ui-vue/src/App.tsx +++ b/packages/semi-ui-vue/src/App.tsx @@ -163,7 +163,7 @@ const App = defineComponent((props, {slots}) => { {/**/} {/**/} {/**/} - {/**/} + {/**/} {/**/} {/* {a.value}*/} @@ -252,7 +252,7 @@ const App = defineComponent((props, {slots}) => { {/**/} {/**/} {/**/} - + {/**/} {/*
*/} {/*
- // ); + return ( + + ); } - const { dropdownClassName, dropdownStyle } = props; + const { dropdownClassName, dropdownStyle, showRestInDropdown } = props; const { rePosKey } = state; const disabled = !items.length; @@ -184,62 +187,82 @@ const TabBar = defineComponent((props, { attrs }) => { ); + const button = ( + + ); + const dropdownCls = cls(dropdownClassName, { [`${cssClasses.TABS_BAR}-dropdown`]: true, }); return ( - - - + + {showRestInDropdown ? ( + + {button} + + ) : (button)} + ); }; - const renderOverflow = (items: any[]): Array => - items.map((item, ind) => { - const icon = ind === 0 ? : ; - const pos = ind === 0 ? 'start' : 'end'; - return renderCollapse(item, icon, pos); - }); + const renderOverflow = (items: any[]): Array => items.map((item, index) => { + const pos = index === 0 ? 'start' : 'end'; + if (props.renderArrow) { + return props.renderArrow(item, pos, ()=>handleArrowClick(item, pos)); + } + const icon = index === 0 ? : ; + return renderCollapse(item, icon, pos); + }); + const renderCollapsedTab = (): VueJsxNode => { const { list } = props; const renderedList = list.map((item) => { const { itemKey } = item; - return { key: _getItemKey(itemKey), active: _isActive(itemKey), ...item }; + return { key: _getBarItemKeyByItemKey(itemKey), active: _isActive(itemKey), ...item }; }); return ( { + const visibleMapWithItemKey: Map = new Map(); + visibleMap.forEach((v, k )=>{ + visibleMapWithItemKey.set(_getItemKeyByBarItemKey(k), v); + }); + props.onVisibleTabsChange?.(visibleMapWithItemKey); + }} /> ); }; const _isActive = (key: string): boolean => key === props.activeKey; - const _getItemKey = (key: string): string => `${key}-bar`; + const _getBarItemKeyByItemKey = (key: string): string => `${key}-bar`; + const _getItemKeyByBarItemKey = (key: string): string => key.replace(/-bar$/, ""); const renderWithMoreTrigger = (): VNode => { @@ -273,10 +296,10 @@ const TabBar = defineComponent((props, { attrs }) => { throw new Error('[Semi Tabs]: invalid tab props format: more'); } - return <> + return {tabElements} {renderMoreDropdown(list.slice(keepCount), more?.['dropdownProps'], moreTrigger)} - ; + ; }; const renderMoreDropdown = (panels: PlainTab[], dropDownProps: DropdownProps, trigger: VNode): VNode => { diff --git a/packages/semi-ui-vue/src/components/tabs/__test__/test.spec.tsx b/packages/semi-ui-vue/src/components/tabs/__test__/test.spec.tsx index 4d23c3fe..1dde56c2 100644 --- a/packages/semi-ui-vue/src/components/tabs/__test__/test.spec.tsx +++ b/packages/semi-ui-vue/src/components/tabs/__test__/test.spec.tsx @@ -55,6 +55,6 @@ test('TabsDemo4', async () => { await fireEvent.click(bt) await (new Promise(resolve => setTimeout(resolve, 500))) - const presentation = await screen.findByRole("presentation") - expect(presentation.getAttribute('aria-haspopup')).toContain('true') + const presentation = await screen.findAllByRole("presentation") + expect(presentation[1].getAttribute('aria-haspopup')).toEqual('true') }) diff --git a/packages/semi-ui-vue/src/components/tabs/index.tsx b/packages/semi-ui-vue/src/components/tabs/index.tsx index 22cb03ce..906bfe33 100644 --- a/packages/semi-ui-vue/src/components/tabs/index.tsx +++ b/packages/semi-ui-vue/src/components/tabs/index.tsx @@ -52,6 +52,7 @@ const propTypes: ComponentObjectPropsOptions = { onChange: PropTypes.func as PropType, onTabClick: PropTypes.func as PropType, renderTabBar: PropTypes.func as PropType, + showRestInDropdown: PropTypes.bool, size: PropTypes.string as PropType, style: PropTypes.object, tabBarClassName: PropTypes.string, @@ -64,9 +65,11 @@ const propTypes: ComponentObjectPropsOptions = { onTabClose: PropTypes.func as PropType, preventScroll: PropTypes.bool, more: PropTypes.oneOfType([PropTypes.number, PropTypes.object]), + arrowPosition: PropTypes.string as PropType, + renderArrow: PropTypes.func as PropType, }; -const defaultProps = { +const defaultProps:TabsProps = { children: [], collapsible: false, keepDOM: true, @@ -78,6 +81,8 @@ const defaultProps = { tabPosition: 'top', type: 'line', onTabClose: () => undefined, + showRestInDropdown: true, + arrowPosition: "both", }; export const vuePropsType = vuePropsMake(propTypes, defaultProps); const Tabs = defineComponent( @@ -284,6 +289,7 @@ const Tabs = defineComponent( keepDOM, lazyRender, renderTabBar, + showRestInDropdown, size, style, tabBarClassName, @@ -293,6 +299,10 @@ const Tabs = defineComponent( tabPosition, type, more, + onVisibleTabsChange, + visibleTabsStyle, + arrowPosition, + renderArrow, ...restProps } = props; const { panes, activeKey } = state; @@ -312,6 +322,7 @@ const Tabs = defineComponent( collapsible, list: panes as any, onTabClick: onTabClick, + showRestInDropdown, size, style: tabBarStyle, tabBarExtraContent, @@ -320,6 +331,10 @@ const Tabs = defineComponent( deleteTabItem: deleteTabItem, handleKeyDown: foundation.handleKeyDown, more, + onVisibleTabsChange, + visibleTabsStyle, + arrowPosition, + renderArrow } as TabBarProps; const tabBar = renderTabBar ? renderTabBar(tabBarProps, TabBar) : ; diff --git a/packages/semi-ui-vue/src/components/tabs/interface.ts b/packages/semi-ui-vue/src/components/tabs/interface.ts index 8b33b7d1..10ed0b79 100644 --- a/packages/semi-ui-vue/src/components/tabs/interface.ts +++ b/packages/semi-ui-vue/src/components/tabs/interface.ts @@ -1,8 +1,9 @@ import { Motion } from '../_base/base'; -import TabBar from './TabBar'; +import TabBar, { OverflowItem } from './TabBar'; import {VueJsxNode} from "../interface"; import { CSSProperties, VNode } from 'vue'; import { DropdownProps } from "../dropdown"; +import { OverflowListProps } from "../overflowList"; export type TabType = 'line' | 'card' | 'button'; export type TabSize = 'small' | 'medium' | 'large'; @@ -29,6 +30,7 @@ export interface TabsProps { onChange?: (activeKey: string) => void; onTabClick?: (activeKey: string, e: MouseEvent) => void; renderTabBar?: (tabBarProps: TabBarProps, defaultTabBar: typeof TabBar) => VueJsxNode; + showRestInDropdown?: boolean; size?: TabSize; style?: CSSProperties; tabBarClassName?: string; @@ -40,7 +42,11 @@ export interface TabsProps { type?: TabType; onTabClose?: (tabKey: string) => void; preventScroll?: boolean; - more?: number | { count: number; render?: () => VNode; dropdownProps?: DropdownProps } + more?: number | { count: number; render?: () => VNode; dropdownProps?: DropdownProps }; + onVisibleTabsChange?: TabBarProps["onVisibleTabsChange"]; + visibleTabsStyle?: TabBarProps['visibleTabsStyle']; + arrowPosition?: TabBarProps['arrowPosition']; + renderArrow?: TabBarProps['renderArrow'] } @@ -50,6 +56,7 @@ export interface TabBarProps { collapsible?: boolean; list?: PlainTab[]; onTabClick?: (activeKey: string, event: MouseEvent) => void; + showRestInDropdown?: boolean; size?: TabSize; style?: CSSProperties; tabBarExtraContent?: VueJsxNode; @@ -60,7 +67,11 @@ export interface TabBarProps { closable?: boolean; deleteTabItem?: (tabKey: string, event: MouseEvent) => void; handleKeyDown?: (event: KeyboardEvent, itemKey: string, closable: boolean) => void; - more?: TabsProps['more'] + more?: TabsProps['more']; + onVisibleTabsChange?: (visibleState: Map) => void; + visibleTabsStyle?: CSSProperties; + arrowPosition?: OverflowListProps['overflowRenderDirection']; + renderArrow?: (items: OverflowItem[], pos: "start"|"end", handleArrowClick: () => void) => VNode } export interface TabPaneProps { diff --git a/packages/semi-ui-vue/src/components/tooltip/index.tsx b/packages/semi-ui-vue/src/components/tooltip/index.tsx index 40a104fd..41b173a9 100755 --- a/packages/semi-ui-vue/src/components/tooltip/index.tsx +++ b/packages/semi-ui-vue/src/components/tooltip/index.tsx @@ -488,6 +488,13 @@ const Tooltip = defineComponent((props, { expose }) => { setId: () => { state.id = getUuidShort(); }, + getTriggerDOM: ()=>{ + if (triggerEl.value) { + return triggerEl.value; + } else { + return null; + } + } }; } diff --git a/packages/semi-ui-vue/src/components/tree/index.tsx b/packages/semi-ui-vue/src/components/tree/index.tsx index ce3f960d..436215ab 100644 --- a/packages/semi-ui-vue/src/components/tree/index.tsx +++ b/packages/semi-ui-vue/src/components/tree/index.tsx @@ -63,6 +63,7 @@ const prefixcls = cssClasses.PREFIX; const propTypes: ComponentObjectPropsOptions = { + autoMergeValue: PropTypes.bool, blockNode: PropTypes.bool, className: PropTypes.string, showClear: PropTypes.bool, @@ -145,6 +146,7 @@ const defaultProps = { draggable: false, autoExpandWhenDragEnter: true, checkRelation: 'related', + autoMergeValue: true, }; export const vuePropsType = vuePropsMake(propTypes, defaultProps) const Tree = defineComponent((props, {}) => { diff --git a/packages/semi-ui-vue/src/components/tree/interface.ts b/packages/semi-ui-vue/src/components/tree/interface.ts index bc7eba82..b4d67529 100644 --- a/packages/semi-ui-vue/src/components/tree/interface.ts +++ b/packages/semi-ui-vue/src/components/tree/interface.ts @@ -85,6 +85,7 @@ export interface TreeProps extends BasicTreeProps { renderDraggingNode?: (nodeInstance: HTMLElement, node: TreeNodeData) => HTMLElement; renderFullLabel?: (renderFullLabelProps: RenderFullLabelProps) => VueJsxNode; renderLabel?: (label?: VueJsxNode, treeNode?: TreeNodeData) => VueJsxNode; + autoMergeValue?: boolean selectedKey?: string role?: string diff --git a/packages/semi-ui-vue/src/components/treeSelect/index.tsx b/packages/semi-ui-vue/src/components/treeSelect/index.tsx index 41468e13..2786998f 100644 --- a/packages/semi-ui-vue/src/components/treeSelect/index.tsx +++ b/packages/semi-ui-vue/src/components/treeSelect/index.tsx @@ -170,6 +170,7 @@ export interface TreeSelectProps onFocus?: (e: MouseEvent) => void; onVisibleChange?: (isVisible: boolean) => void; onClear?: (e: MouseEvent | KeyboardEvent) => void; + autoMergeValue?: boolean id?: string; } @@ -281,6 +282,7 @@ const propTypes: ComponentObjectPropsOptions = { restTagsPopoverProps: PropTypes.object, preventScroll: PropTypes.bool, clickTriggerToHide: PropTypes.bool, + autoMergeValue: PropTypes.bool, dropdownMargin: PropTypes.oneOfType([PropTypes.number, PropTypes.object]), position: PropTypes.string as PropType, @@ -317,6 +319,7 @@ const defaultProps: Partial = { showRestTagsPopover: false, restTagsPopoverProps: {}, clickTriggerToHide: true, + autoMergeValue: true, }; export const vuePropsType = vuePropsMake(propTypes, defaultProps); const TreeSelect = defineComponent( @@ -953,15 +956,14 @@ const TreeSelect = defineComponent( return showClear && (hasValue() || triggerSearchHasInputValue) && !disabled && (isOpen || isHovering); }; - const renderTagList = () => { - const { checkedKeys, keyEntities, disabledKeys, realCheckedKeys } = state; + const renderTagList = (triggerRenderKeys: string[]) => { + const { keyEntities, disabledKeys } = state; const { treeNodeLabelProp, leafOnly, disabled, disableStrictly, size, - checkRelation, renderSelectedItem: propRenderSelectedItem, keyMaps, } = props; @@ -972,15 +974,10 @@ const TreeSelect = defineComponent( isRenderInTag: true, content: get(item, realLabelName, null), }); - let renderKeys = []; - if (checkRelation === 'related') { - renderKeys = normalizeKeyList([...checkedKeys], keyEntities, leafOnly); - } else if (checkRelation === 'unRelated' && Object.keys(keyEntities).length > 0) { - renderKeys = [...realCheckedKeys]; - } + const tagList: VueJsxNodeSingle[] = []; // eslint-disable-next-line @typescript-eslint/no-shadow - renderKeys.forEach((key: TreeNodeData['key'], index) => { + triggerRenderKeys.forEach((key: TreeNodeData['key'], index) => { const item = keyEntities[key] && keyEntities[key].key === key ? keyEntities[key].data : getDataForKeyNotInKeyEntities(key); const onClose = (tagContent: any, e: MouseEvent) => { @@ -1026,7 +1023,9 @@ const TreeSelect = defineComponent( [`${prefixcls}-selection-TriggerSearchItem-placeholder`]: (inputTriggerFocus || !renderText) && !disabled, [`${prefixcls}-selection-TriggerSearchItem-disabled`]: disabled, }); - return {renderText ? renderText : placeholder}; + return + {renderText ? renderText : placeholder} + ; }; /** @@ -1036,13 +1035,13 @@ const TreeSelect = defineComponent( const { inputValue } = state; return ( <> - {!inputValue && renderSingleTriggerSearchItem()} {renderInput()} + {!inputValue && renderSingleTriggerSearchItem()} ); }; - const renderSelectContent = () => { + const renderSelectContent = (triggerRenderKeys: string[]) => { const { multiple, placeholder, @@ -1055,7 +1054,7 @@ const TreeSelect = defineComponent( const isTriggerPositionSearch = filterTreeNode && searchPosition === strings.SEARCH_POSITION_TRIGGER; // searchPosition = trigger if (isTriggerPositionSearch) { - return multiple ? renderTagInput() : renderSingleTriggerSearch(); + return multiple ? renderTagInput(triggerRenderKeys) : renderSingleTriggerSearch(); } // searchPosition = dropdown and single seleciton if (!multiple || !hasValue()) { @@ -1066,7 +1065,7 @@ const TreeSelect = defineComponent( return {renderText ? renderText : placeholder}; } // searchPosition = dropdown and multiple seleciton - const tagList = renderTagList(); + const tagList = renderTagList(triggerRenderKeys); // mode=custom to return tagList directly return ( ( searchPosition, triggerRender, borderless, + autoMergeValue, checkRelation, ...rest } = props; @@ -1202,17 +1202,19 @@ const TreeSelect = defineComponent( className ); let inner: VNode | VNode[]; - if (useCustomTrigger) { - let triggerRenderKeys = []; - if (multiple) { - if (checkRelation === 'related') { - triggerRenderKeys = normalizeKeyList([...checkedKeys], keyEntities, leafOnly, true); - } else if (checkRelation === 'unRelated') { - triggerRenderKeys = [...realCheckedKeys]; - } - } else { - triggerRenderKeys = selectedKeys; + let triggerRenderKeys = []; + if (multiple) { + if (!autoMergeValue) { + triggerRenderKeys =[...checkedKeys]; + } else if (checkRelation === 'related') { + triggerRenderKeys = normalizeKeyList([...checkedKeys], keyEntities, leafOnly, true); + } else if (checkRelation === 'unRelated') { + triggerRenderKeys = [...realCheckedKeys]; } + } else { + triggerRenderKeys = selectedKeys; + } + if (useCustomTrigger) { inner = get(keyEntities, [key, 'data']))} @@ -1229,7 +1231,7 @@ const TreeSelect = defineComponent( inner = [ {prefix || insetLabel ? renderPrefix() : null}, -
{renderSelectContent()}
+
{renderSelectContent(triggerRenderKeys)}
, {suffix ? renderSuffix() : null}, @@ -1331,28 +1333,22 @@ const TreeSelect = defineComponent( return {value}; }; - const renderTagInput = () => { + const renderTagInput = (triggerRenderKeys: string[]) => { const { - leafOnly, disabled, size, searchAutoFocus, placeholder, maxTagCount, - checkRelation, showRestTagsPopover, restTagsPopoverProps, searchPosition, filterTreeNode, preventScroll, } = props; - const { keyEntities, checkedKeys, inputValue, realCheckedKeys } = state; - let keyList = []; - if (checkRelation === 'related') { - keyList = normalizeKeyList(checkedKeys, keyEntities, leafOnly, true); - } else if (checkRelation === 'unRelated') { - keyList = [...realCheckedKeys]; - } + const { + inputValue, + } = state; // auto focus search input divide into two parts // 1. filterTreeNode && searchPosition === strings.SEARCH_POSITION_TRIGGER // Implemented by passing autofocus to the underlying input's autofocus @@ -1369,7 +1365,7 @@ const TreeSelect = defineComponent( onInputChange={(v) => search(v)} ref={tagInputRef} placeholder={placeholder} - value={keyList} + value={triggerRenderKeys} inputValue={inputValue} size={size} showRestTagsPopover={showRestTagsPopover} diff --git a/packages/semi-ui-vue/src/components/typography/base.tsx b/packages/semi-ui-vue/src/components/typography/base.tsx index b4a71e8f..593ff41b 100755 --- a/packages/semi-ui-vue/src/components/typography/base.tsx +++ b/packages/semi-ui-vue/src/components/typography/base.tsx @@ -670,7 +670,7 @@ const Base = defineComponent((props, {}) => { const iconSize: Size = realSize === 'small' ? 'small' : 'default'; return ( - {isSemiIcon(icon) ? cloneVNode((icon as any), {realSize: iconSize}) : icon} + {isSemiIcon(icon) ? cloneVNode((icon as any), {size: iconSize}) : icon} ); } diff --git a/patches/@vue__repl@4.3.1.patch b/patches/@vue__repl@4.3.1.patch new file mode 100644 index 00000000..49b81153 --- /dev/null +++ b/patches/@vue__repl@4.3.1.patch @@ -0,0 +1,271 @@ +diff --git a/dist/vue-repl.js b/dist/vue-repl.js +index c5a3d80d218b3af2e28679afa96c94ddb1263cb0..d9a86515eb177ffb5a0132cd7bd0acec861e95f4 100644 +--- a/dist/vue-repl.js ++++ b/dist/vue-repl.js +@@ -152,7 +152,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({ + + const Message = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-b80ebbc9"]]); + +-const srcdoc = "\n\n \n \n \n \n\n \n \n \n \n \n \n \n\n"; ++const srcdoc = "\n\n \n \n \n \n\n \n \n \n \n \n \n \n\n"; + + let uid = 1; + class PreviewProxy { +@@ -1187,9 +1187,9 @@ function formatTokenType(tokenType) { + } + + class Scope { +- +- +- ++ ++ ++ + + constructor(startTokenIndex, endTokenIndex, isFunctionScope) { + this.startTokenIndex = startTokenIndex; +@@ -1419,8 +1419,8 @@ function augmentError(error) { + } + + class Loc { +- +- ++ ++ + constructor(line, column) { + this.line = line; + this.column = column; +@@ -2471,38 +2471,38 @@ class Token { + this.nullishStartIndex = null; + } + +- +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ ++ + // Initially false for all tokens, then may be computed in a follow-up step that does scope + // analysis. +- ++ + // Initially false for all tokens, but may be set during transform to mark it as containing an + // await operation. +- +- ++ ++ + // For assignments, the index of the RHS. For export tokens, the end of the export. +- ++ + // For class tokens, records if the class is a class expression or a class statement. +- ++ + // Number of times to insert a `nullishCoalesce(` snippet before this token. +- ++ + // Number of times to insert a `)` snippet after this token. +- ++ + // If true, insert an `optionalChain([` snippet before this token. +- ++ + // If true, insert a `])` snippet after this token. +- ++ + // Tag for `.`, `?.`, `[`, `?.[`, `(`, and `?.(` to denote the "root" token for this + // subscript chain. This can be used to determine if this chain is an optional chain. +- ++ + // Tag for `??` operators to denote the root token for this nullish coalescing call. +- ++ + } + + // ## Tokenizer +@@ -2571,8 +2571,8 @@ function lookaheadType() { + } + + class TypeAndKeyword { +- +- ++ ++ + constructor(type, contextualKeyword) { + this.type = type; + this.contextualKeyword = contextualKeyword; +@@ -3689,7 +3689,7 @@ function splitPragma(pragma) { + + class Transformer { + // Return true if anything was processed, false otherwise. +- ++ + + getPrefixCode() { + return ""; +@@ -3705,9 +3705,9 @@ class Transformer { + } + + class JSXTransformer extends Transformer { +- +- +- ++ ++ ++ + + // State for calculating the line number of each JSX tag in development. + __init() {this.lastLineNumber = 1;} +@@ -4981,7 +4981,7 @@ function requireSetArray_umd () { + Object.defineProperty(exports, '__esModule', { value: true }); + + })); +- ++ + } (setArray_umd, setArray_umd.exports)); + return setArray_umd.exports; + } +@@ -5165,7 +5165,7 @@ function requireSourcemapCodec_umd () { + Object.defineProperty(exports, '__esModule', { value: true }); + + })); +- ++ + } (sourcemapCodec_umd, sourcemapCodec_umd.exports)); + return sourcemapCodec_umd.exports; + } +@@ -5416,7 +5416,7 @@ function requireResolveUri_umd () { + return resolve; + + })); +- ++ + } (resolveUri_umd)); + return resolveUri_umd.exports; + } +@@ -6023,7 +6023,7 @@ function requireTraceMapping_umd () { + exports.traceSegment = traceSegment; + + })); +- ++ + } (traceMapping_umd, traceMapping_umd.exports)); + return traceMapping_umd.exports; + } +@@ -6271,7 +6271,7 @@ function requireTraceMapping_umd () { + Object.defineProperty(exports, '__esModule', { value: true }); + + })); +- ++ + } (genMapping_umd, genMapping_umd.exports)); + + var genMapping_umdExports = genMapping_umd.exports; +@@ -7353,7 +7353,7 @@ var DetailUnionResolver = /** @class */ (function () { + Int32Array, Uint32Array, Float32Array, Float64Array, ArrayBuffer]; _i < _a.length; _i++) { + var array_1 = _a[_i]; + _loop_1(array_1); +- } ++ } + } (types)); + + (function (exports) { +@@ -7579,7 +7579,7 @@ var DetailUnionResolver = /** @class */ (function () { + }; + return Checker; + }()); +- exports.Checker = Checker; ++ exports.Checker = Checker; + } (dist)); + + /** +@@ -7625,7 +7625,7 @@ const exportedTypeSuite = { + + const {Options: OptionsChecker} = dist.createCheckers(exportedTypeSuite); + +- ++ + + + +@@ -9814,7 +9814,7 @@ function typedParseParenItem() { + + + class StopState { +- ++ + constructor(stop) { + this.stop = stop; + } +@@ -13057,8 +13057,8 @@ function parseFile() { + } + + let File$1 = class File { +- +- ++ ++ + + constructor(tokens, scopes) { + this.tokens = tokens; +@@ -13906,7 +13906,7 @@ class CJSImportTransformer extends Transformer { + __init() {this.hadExport = false;} + __init2() {this.hadNamedExport = false;} + __init3() {this.hadDefaultExport = false;} +- ++ + + constructor( + rootTransformer, +@@ -14800,9 +14800,9 @@ class CJSImportTransformer extends Transformer { + * type-only imports in TypeScript and Flow. + */ + class ESMImportTransformer extends Transformer { +- +- +- ++ ++ ++ + + constructor( + tokens, +@@ -16224,13 +16224,13 @@ class TypeScriptTransformer extends Transformer { + + class RootTransformer { + __init() {this.transformers = [];} +- +- ++ ++ + __init2() {this.generatedVariables = [];} +- +- +- +- ++ ++ ++ ++ + + constructor( + sucraseContext, +@@ -16721,7 +16721,7 @@ var build = {}; + return LinesAndColumns; + }()); + exports.LinesAndColumns = LinesAndColumns; +- exports["default"] = LinesAndColumns; ++ exports["default"] = LinesAndColumns; + } (build)); + + /** diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index afac1631..75fc6822 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,23 +5,23 @@ settings: excludeLinksFromLockfile: false patchedDependencies: - '@vue/repl@4.2.1': - hash: fvmtncc4wnnib6kfhc6bvvpssm - path: patches/@vue__repl@4.2.1.patch + '@vue/repl@4.3.1': + hash: 3rqzwkhy3g36fybfmy5vlgr3bq + path: patches/@vue__repl@4.3.1.patch importers: .: dependencies: '@douyinfe/semi-foundation': - specifier: 2.60.0 - version: 2.60.0 + specifier: 2.61.0 + version: 2.61.0 '@douyinfe/semi-theme-default': - specifier: 2.60.0 - version: 2.60.0 + specifier: 2.61.0 + version: 2.61.0 '@vue/repl': - specifier: 4.2.1 - version: 4.2.1(patch_hash=fvmtncc4wnnib6kfhc6bvvpssm) + specifier: 4.3.1 + version: 4.3.1(patch_hash=3rqzwkhy3g36fybfmy5vlgr3bq) lodash: specifier: ^4.17.21 version: 4.17.21 @@ -210,17 +210,17 @@ importers: packages/semi-animation-vue: dependencies: '@douyinfe/semi-animation': - specifier: 2.60.0 - version: 2.60.0 + specifier: 2.61.0 + version: 2.61.0 '@douyinfe/semi-animation-styled': - specifier: 2.60.0 - version: 2.60.0 + specifier: 2.61.0 + version: 2.61.0 '@douyinfe/semi-foundation': - specifier: 2.60.0 - version: 2.60.0 + specifier: 2.61.0 + version: 2.61.0 '@douyinfe/semi-theme-default': - specifier: 2.60.0 - version: 2.60.0 + specifier: 2.61.0 + version: 2.61.0 classnames: specifier: ^2.3.2 version: 2.5.1 @@ -304,11 +304,11 @@ importers: packages/semi-icons-lab-vue: dependencies: '@douyinfe/semi-foundation': - specifier: 2.60.0 - version: 2.60.0 + specifier: 2.61.0 + version: 2.61.0 '@douyinfe/semi-theme-default': - specifier: 2.60.0 - version: 2.60.0 + specifier: 2.61.0 + version: 2.61.0 classnames: specifier: ^2.3.2 version: 2.5.1 @@ -389,11 +389,11 @@ importers: packages/semi-icons-vue: dependencies: '@douyinfe/semi-foundation': - specifier: 2.60.0 - version: 2.60.0 + specifier: 2.61.0 + version: 2.61.0 '@douyinfe/semi-theme-default': - specifier: 2.60.0 - version: 2.60.0 + specifier: 2.61.0 + version: 2.61.0 classnames: specifier: ^2.3.2 version: 2.5.1 @@ -474,11 +474,11 @@ importers: packages/semi-illustrations-vue: dependencies: '@douyinfe/semi-foundation': - specifier: 2.60.0 - version: 2.60.0 + specifier: 2.61.0 + version: 2.61.0 '@douyinfe/semi-theme-default': - specifier: 2.60.0 - version: 2.60.0 + specifier: 2.61.0 + version: 2.61.0 classnames: specifier: ^2.3.2 version: 2.5.1 @@ -574,14 +574,14 @@ importers: specifier: 0.1.2 version: 0.1.2(lodash@4.17.21)(vue@3.4.31(typescript@5.5.2)) '@douyinfe/semi-animation': - specifier: 2.60.0 - version: 2.60.0 + specifier: 2.61.0 + version: 2.61.0 '@douyinfe/semi-foundation': - specifier: 2.60.0 - version: 2.60.0 + specifier: 2.61.0 + version: 2.61.0 '@douyinfe/semi-theme-default': - specifier: 2.60.0 - version: 2.60.0 + specifier: 2.61.0 + version: 2.61.0 '@kousum/semi-animation-vue': specifier: ^0.14.2 version: 0.14.2(vue@3.4.31(typescript@5.5.2)) @@ -1754,15 +1754,27 @@ packages: '@douyinfe/semi-animation-styled@2.60.0': resolution: {integrity: sha512-S5Gun0LmDuIDCkGwLADjcWY4eOU64p7OQH30+yCII1GrS0CSGAPlMzJ0p0zOieGUilcvmyCtWRZ8NeH8lVQLdA==} + '@douyinfe/semi-animation-styled@2.61.0': + resolution: {integrity: sha512-kzI6uFphJFd+4FhRLJc6b3LNR1wzf5dby0CPnI9E7phmqxpv5/I/AVpJ/h/7JKW7tdsy8EqsvuCYvyHSAtPU4A==} + '@douyinfe/semi-animation@2.60.0': resolution: {integrity: sha512-WqLvozsST4hgL8zHRBA3LtopJSIzyb7RdaCe8t0vJHxkH1n5Fe9coYBXEzScNF9xSpm11M7aub4v3x05XQO8bw==} + '@douyinfe/semi-animation@2.61.0': + resolution: {integrity: sha512-Yr8IAtn1NZXbCK8bJD1wnj6ktiI4mSwA8Kf4hLse0YhUeWfvIY529gQ5PUb30HiceE1RdteYxJEQwJ9IBaiCpw==} + '@douyinfe/semi-foundation@2.60.0': resolution: {integrity: sha512-R1sBQDo+lsNSfEV53sDOjfDsahwTX9T9kO+KD+8z4lyjHeQBcxhWI3gmWsubXY81yJU/Ve4WXN3MNaPxp/HIWw==} + '@douyinfe/semi-foundation@2.61.0': + resolution: {integrity: sha512-8FmVTGcerLv1GCNk4kVvYIOI4PcR+QN7/Rx/tULjwcANd47kLfLEgTSO8WwqtnJSQqXBFuZCZ4bjyG98jOeMpA==} + '@douyinfe/semi-theme-default@2.60.0': resolution: {integrity: sha512-qfhagnfWCJq/IguJk7Q9VaVb5pMaHbOVvbqrnwodquZ1k8jF6ApQIJQdiVUT9+l+23IZ7u3cPG87qyprU85+XQ==} + '@douyinfe/semi-theme-default@2.61.0': + resolution: {integrity: sha512-obn/DOw4vZyKFAlWvZxHTpBLAK9FO9kygTSm2GROgvi+UDB2PPU6l20cuUCsdGUNWJRSqYlTTVZ1tNYIyFZ5Sg==} + '@emotion/use-insertion-effect-with-fallbacks@1.0.1': resolution: {integrity: sha512-jT/qyKZ9rzLErtrjGgdkMBn2OP8wl0G3sQlBb3YPryvKHsjvINUhVaPFfP+fpBcOkmrVOVEEHQFJ7nbj2TH2gw==} peerDependencies: @@ -3043,8 +3055,8 @@ packages: '@vue/reactivity@3.4.31': resolution: {integrity: sha512-VGkTani8SOoVkZNds1PfJ/T1SlAIOf8E58PGAhIOUDYPC4GAmFA2u/E14TDAFcf3vVDKunc4QqCe/SHr8xC65Q==} - '@vue/repl@4.2.1': - resolution: {integrity: sha512-kPpoAp0hQ1sKIGXEHtVdtdh2BgL97SAizEvCqRDB3LmgIYCPbzInwd4mqYkHstAhJPmkNslLd3rwfceMwzwinQ==} + '@vue/repl@4.3.1': + resolution: {integrity: sha512-yzUuLhR+MqOGBDES+xbnm27SfPIEv7XKwhFWWpQhL7HUbXj77GVu+x50Q56JhCWWKTUJzk9MOvAn7bSgdvB5og==} '@vue/runtime-core@3.4.27': resolution: {integrity: sha512-7aYA9GEbOOdviqVvcuweTLe5Za4qBZkUY7SvET6vE8kyypxVgaT1ixHLg4urtOlrApdgcdgHoTZCUuTGap/5WA==} @@ -10076,10 +10088,16 @@ snapshots: '@douyinfe/semi-animation-styled@2.60.0': {} + '@douyinfe/semi-animation-styled@2.61.0': {} + '@douyinfe/semi-animation@2.60.0': dependencies: bezier-easing: 2.1.0 + '@douyinfe/semi-animation@2.61.0': + dependencies: + bezier-easing: 2.1.0 + '@douyinfe/semi-foundation@2.60.0': dependencies: '@douyinfe/semi-animation': 2.60.0 @@ -10092,8 +10110,22 @@ snapshots: memoize-one: 5.2.1 scroll-into-view-if-needed: 2.2.31 + '@douyinfe/semi-foundation@2.61.0': + dependencies: + '@douyinfe/semi-animation': 2.61.0 + async-validator: 3.5.2 + classnames: 2.5.1 + date-fns: 2.30.0 + date-fns-tz: 1.3.8(date-fns@2.30.0) + fast-copy: 3.0.2 + lodash: 4.17.21 + memoize-one: 5.2.1 + scroll-into-view-if-needed: 2.2.31 + '@douyinfe/semi-theme-default@2.60.0': {} + '@douyinfe/semi-theme-default@2.61.0': {} + '@emotion/use-insertion-effect-with-fallbacks@1.0.1(react@18.3.1)': dependencies: react: 18.3.1 @@ -11875,7 +11907,7 @@ snapshots: dependencies: '@vue/shared': 3.4.31 - '@vue/repl@4.2.1(patch_hash=fvmtncc4wnnib6kfhc6bvvpssm)': {} + '@vue/repl@4.3.1(patch_hash=3rqzwkhy3g36fybfmy5vlgr3bq)': {} '@vue/runtime-core@3.4.27': dependencies: