Skip to content

Commit 5e4d2cb

Browse files
committed
feat: semi 2.77.1
1 parent 43d0224 commit 5e4d2cb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1465
-232
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"publishConfig": {
2525
"access": "public"
2626
},
27-
"packageManager": "pnpm@10.7.1",
27+
"packageManager": "pnpm@10.8.0",
2828
"workspaces": [
2929
"packages/semi-animation-vue",
3030
"packages/semi-icons-vue",
@@ -34,8 +34,8 @@
3434
"packages/vite-plugin-semi-theme"
3535
],
3636
"dependencies": {
37-
"@douyinfe/semi-foundation": "2.74.0",
38-
"@douyinfe/semi-theme-default": "2.74.0",
37+
"@douyinfe/semi-foundation": "2.77.1",
38+
"@douyinfe/semi-theme-default": "2.77.1",
3939
"@vue/repl": "4.4.2",
4040
"lodash": "^4.17.21",
4141
"vue": "^3.5.13"
@@ -48,7 +48,7 @@
4848
"@babel/preset-react": "^7.16.7",
4949
"@changesets/cli": "^2.27.1",
5050
"@chromatic-com/storybook": "1.3.4",
51-
"@douyinfe/semi-theme-default": "2.74.0",
51+
"@douyinfe/semi-theme-default": "2.77.1",
5252
"@kousum/semi-icons-lab-vue": "workspace: *",
5353
"@kousum/semi-icons-vue": "workspace: *",
5454
"@kousum/semi-illustrations-vue": "workspace: *",

packages/semi-animation-vue/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838
"preview": "vite preview"
3939
},
4040
"dependencies": {
41-
"@douyinfe/semi-animation": "2.74.0",
42-
"@douyinfe/semi-animation-styled": "2.74.0",
43-
"@douyinfe/semi-foundation": "2.74.0",
44-
"@douyinfe/semi-theme-default": "2.74.0",
41+
"@douyinfe/semi-animation": "2.77.1",
42+
"@douyinfe/semi-animation-styled": "2.77.1",
43+
"@douyinfe/semi-foundation": "2.77.1",
44+
"@douyinfe/semi-theme-default": "2.77.1",
4545
"classnames": "^2.3.2",
4646
"sass": "^1.57.1",
4747
"vue": "^3.5.13"

packages/semi-icons-lab-vue/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
"preview": "vite preview"
2929
},
3030
"dependencies": {
31-
"@douyinfe/semi-foundation": "2.74.0",
32-
"@douyinfe/semi-theme-default": "2.74.0",
31+
"@douyinfe/semi-foundation": "2.77.1",
32+
"@douyinfe/semi-theme-default": "2.77.1",
3333
"classnames": "^2.3.2",
3434
"sass": "^1.57.1",
3535
"vue": "^3.5.13"

packages/semi-icons-vue/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"preview": "vite preview"
2323
},
2424
"dependencies": {
25-
"@douyinfe/semi-foundation": "2.74.0",
26-
"@douyinfe/semi-theme-default": "2.74.0",
25+
"@douyinfe/semi-foundation": "2.77.1",
26+
"@douyinfe/semi-theme-default": "2.77.1",
2727
"classnames": "^2.3.2",
2828
"sass": "^1.57.1",
2929
"vue": "^3.5.13"

packages/semi-illustrations-vue/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"build:icon": "node scripts/build-illustration.cjs"
2727
},
2828
"dependencies": {
29-
"@douyinfe/semi-foundation": "2.74.0",
30-
"@douyinfe/semi-theme-default": "2.74.0",
29+
"@douyinfe/semi-foundation": "2.77.1",
30+
"@douyinfe/semi-theme-default": "2.77.1",
3131
"classnames": "^2.3.2",
3232
"vue": "^3.5.13"
3333
},

packages/semi-ui-vue/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
"url": "https://github.com/rashagu/semi-design-vue"
2525
},
2626
"dependencies": {
27-
"@douyinfe/semi-foundation": "2.74.0",
28-
"@douyinfe/semi-theme-default": "2.74.0",
29-
"@douyinfe/semi-animation": "2.74.0",
27+
"@douyinfe/semi-foundation": "2.77.1",
28+
"@douyinfe/semi-theme-default": "2.77.1",
29+
"@douyinfe/semi-animation": "2.77.1",
3030
"@kousum/semi-animation-vue": "workspace:*",
3131
"@kousum/semi-icons-vue": "workspace:*",
3232
"@kousum/semi-illustrations-vue": "workspace:*",

packages/semi-ui-vue/src/App.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ import SelectTest from './components/select/__test__/SelectTest';
170170
import { InputVModel } from './components';
171171
import CropperDemo from './components/cropper/__test__/CropperDemo';
172172
import AudioPlayerDemo from './components/audioPlayer/__test__/AudioPlayerDemo';
173+
import UserGuideDemo from './components/userGuide/__test__/UserGuideDemo';
173174

174175
export interface ExampleProps {
175176
name?: string
@@ -200,7 +201,8 @@ const App = defineComponent<ExampleProps>((props, {slots}) => {
200201
<div>
201202
<ConfigProvider locale={zh_CN}>
202203
{a.value}
203-
<AudioPlayerDemo/>
204+
<UserGuideDemo/>
205+
{/*<AudioPlayerDemo/>*/}
204206
{/*<CropperDemo/>*/}
205207
{/*<InputVModel ref={testRef} v-model={a.value}/>*/}
206208
{/*<WithVModelDemo/>*/}

packages/semi-ui-vue/src/components/cascader/index.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ const Index = defineComponent({
254254
const { getProps } = useHasInProps();
255255

256256
const state = reactive<CascaderState>({
257+
emptyContentMinWidth: null,
257258
disabledKeys: new Set(),
258259
isOpen: props.defaultOpen,
259260
/* By changing rePosKey, the dropdown position can be refreshed */
@@ -366,6 +367,13 @@ const Index = defineComponent({
366367
...adapterInject<CascaderProps, CascaderState>(),
367368
...filterAdapter,
368369
...cascaderAdapter,
370+
setEmptyContentMinWidth: minWidth => {
371+
state.emptyContentMinWidth = minWidth
372+
},
373+
getTriggerWidth: () => {
374+
const el = triggerRef.value;
375+
return el.width;
376+
},
369377
updateStates: (states) => {
370378
for (let key in states) {
371379
state[key] = states[key];
@@ -767,8 +775,10 @@ const Index = defineComponent({
767775
const popoverCls = cls(dropdownClassName, `${prefixcls}-popover`);
768776
const renderData = foundation.getRenderData();
769777
// console.log(activeKeys, selectedKeys);
778+
const isEmpty = !renderData || !renderData.length;
779+
const realDropDownStyle = isEmpty ? {...dropdownStyle, minWidth: state.emptyContentMinWidth } : dropdownStyle;
770780
const content = (
771-
<div class={popoverCls} role="listbox" style={dropdownStyle} onKeydown={foundation.handleKeyDown}>
781+
<div class={popoverCls} role="listbox" style={realDropDownStyle} onKeydown={foundation.handleKeyDown}>
772782
{topSlot}
773783
<Item
774784
activeKeys={activeKeys}

packages/semi-ui-vue/src/components/chat/index.tsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ export const chatPropTypes: CombineProps<ChatProps> = {
7474
mode: PropTypes.string as PropType<ChatProps['mode']>,
7575
renderDivider: PropTypes.func as PropType<ChatProps['renderDivider']>,
7676
markdownRenderProps: PropTypes.object as PropType<ChatProps['markdownRenderProps']>,
77+
78+
enableUpload: PropTypes.bool,
7779
};
7880
const defaultProps = {
7981
align: CHAT_ALIGN.LEFT_RIGHT,
@@ -331,7 +333,7 @@ const index = defineComponent({
331333
hintCls,
332334
uploadProps,
333335
uploadTipProps,
334-
sendHotKey, renderDivider, markdownRenderProps
336+
sendHotKey, renderDivider, markdownRenderProps, enableUpload
335337
} = props;
336338
const { backBottomVisible, chats, wheelScroll, uploadAreaVisible } = state;
337339
let showStopGenerateFlag = false;
@@ -342,9 +344,19 @@ const index = defineComponent({
342344
disableSend = lastChatOnGoing;
343345
showStopGenerate && (showStopGenerateFlag = lastChatOnGoing);
344346
}
347+
const { dragUpload, clickUpload, pasteUpload } = foundation.getUploadProps(enableUpload);
348+
const dragEventHandlers = dragUpload ? {
349+
onDragover: foundation.handleDragOver,
350+
onDragstart: foundation.handleDragStart,
351+
onDragend: foundation.handleDragEnd,
352+
} : {};
345353
return (
346-
<div class={cls(`${prefixCls}`, className)} style={style} onDragover={foundation.handleDragOver}>
347-
{uploadAreaVisible && (
354+
<div
355+
class={cls(`${prefixCls}`, className)}
356+
style={style}
357+
{...dragEventHandlers}
358+
>
359+
{dragUpload && uploadAreaVisible && (
348360
<div
349361
ref={dropAreaRef}
350362
class={`${prefixCls}-dropArea`}
@@ -443,6 +455,8 @@ const index = defineComponent({
443455
uploadProps={uploadProps}
444456
uploadTipProps={uploadTipProps}
445457
sendHotKey={sendHotKey}
458+
clickUpload={clickUpload}
459+
pasteUpload={pasteUpload}
446460
/>
447461
{bottomSlot}
448462
</div>

packages/semi-ui-vue/src/components/chat/inputBox/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ export const propsType: CombineProps<InputBoxProps> = {
3838
onSend: PropTypes.func as PropType<InputBoxProps['onSend']>,
3939
onClearContext: PropTypes.func as PropType<InputBoxProps['onClearContext']>,
4040
onInputChange: PropTypes.func as PropType<InputBoxProps['onInputChange']>,
41+
clickUpload: PropTypes.bool,
42+
pasteUpload: PropTypes.bool,
4143
};
4244
const vuePropsType = vuePropsMake(propsType, {
4345
uploadProps: {}
@@ -81,7 +83,10 @@ const index = defineComponent({
8183
}
8284

8385
const renderUploadButton = () => {
84-
const { uploadProps, uploadRef, uploadTipProps } = props;
86+
const { uploadProps, uploadRef, uploadTipProps, clickUpload } = props;
87+
if (!clickUpload) {
88+
return null;
89+
}
8590
const { attachment } = state;
8691
const { className, onChange, renderFileItem, ...rest } = uploadProps;
8792
const children = slots.children?.()

0 commit comments

Comments
 (0)