@king-design/vue 3.8.0-beta.1 → 3.8.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/bubble/bubble.d.ts +2 -0
- package/components/bubble/index.spec.js +183 -10
- package/components/bubble/useBubbleDisplay.js +60 -22
- package/components/bubbleList/index.spec.js +77 -0
- package/components/sender/index.spec.js +345 -279
- package/components/sender/sender.d.ts +1 -1
- package/components/sender/sender.js +1 -1
- package/components/sender/useAutoResize.js +7 -6
- package/components/xmarkdown/index.spec.js +416 -318
- package/components/xmarkdown/useXMarkdownDisplay.js +60 -23
- package/components/xmarkdown/xmarkdown.d.ts +2 -0
- package/dist/index.js +419 -343
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +1 -1
|
@@ -73,7 +73,7 @@ export interface SenderProps {
|
|
|
73
73
|
pasteFile?: boolean;
|
|
74
74
|
/** 整个输入外框 `k-sender` 的宽度,数字会按 `px` 处理 */
|
|
75
75
|
width?: number | string;
|
|
76
|
-
/** 整个输入外框 `k-sender-shell`
|
|
76
|
+
/** 整个输入外框 `k-sender-shell` 的最大高度,包含附件区、beforeInput、输入区和工具栏,不包含 header/footer。 */
|
|
77
77
|
maxHeight?: number | string;
|
|
78
78
|
attachments?: SenderAttachment[];
|
|
79
79
|
uploadProps?: SenderUploadProps;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import _Number$isFinite from "@babel/runtime-corejs3/core-js/number/is-finite";
|
|
2
2
|
import { useInstance, onMounted, onUpdated, nextTick } from 'intact-vue-next';
|
|
3
3
|
import { useConfigContext } from '../config';
|
|
4
|
-
// textarea
|
|
4
|
+
// textarea 高度自适应:默认保留 64 的输入区高度;当上传入口放进附件列表时压缩为单行输入。
|
|
5
|
+
// maxHeight 约束整个输入外框而非 textarea 本身。
|
|
5
6
|
var SHELL_MAX_FALLBACK = 300;
|
|
6
|
-
var
|
|
7
|
-
var
|
|
7
|
+
var TEXTAREA_MIN_DEFAULT = 64;
|
|
8
|
+
var TEXTAREA_MIN_LIST_UPLOAD = 20;
|
|
8
9
|
export function useAutoResize(textareaRef) {
|
|
9
10
|
var instance = useInstance();
|
|
10
11
|
var _useConfigContext = useConfigContext(),
|
|
@@ -45,8 +46,8 @@ export function useAutoResize(textareaRef) {
|
|
|
45
46
|
if (!el) return;
|
|
46
47
|
var shell = getShell(el);
|
|
47
48
|
if (!shell) return;
|
|
48
|
-
var
|
|
49
|
-
var min =
|
|
49
|
+
var isListUpload = instance.get('uploadButton') === 'list';
|
|
50
|
+
var min = isListUpload ? TEXTAREA_MIN_LIST_UPLOAD : TEXTAREA_MIN_DEFAULT;
|
|
50
51
|
/** 整框最大高度(props 或默认 300),从实际 CSS 读取,支持 50vh 等合法 CSS 值 */
|
|
51
52
|
var shellMax = getShellMaxHeight(shell);
|
|
52
53
|
var nonInputH = measureNonInputBlockHeight(el, shell);
|
|
@@ -85,7 +86,7 @@ export function useAutoResize(textareaRef) {
|
|
|
85
86
|
inited: true,
|
|
86
87
|
presented: true
|
|
87
88
|
});
|
|
88
|
-
instance.watch('
|
|
89
|
+
instance.watch('uploadButton', scheduleAdjust, {
|
|
89
90
|
inited: true,
|
|
90
91
|
presented: true
|
|
91
92
|
});
|