@king-design/vue 3.7.0 → 3.8.0-beta.0
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/__tests__/__snapshots__/Vue Next Demos.md +399 -0
- package/components/bubble/bubble.d.ts +61 -0
- package/components/bubble/bubble.js +81 -0
- package/components/bubble/bubble.vdt.js +85 -0
- package/components/bubble/index.d.ts +1 -0
- package/components/bubble/index.js +1 -0
- package/components/bubble/index.spec.d.ts +1 -0
- package/components/bubble/index.spec.js +771 -0
- package/components/bubble/styles.d.ts +5 -0
- package/components/bubble/styles.js +53 -0
- package/components/bubble/useBubbleDisplay.d.ts +18 -0
- package/components/bubble/useBubbleDisplay.js +300 -0
- package/components/bubbleList/bubbleList.d.ts +87 -0
- package/components/bubbleList/bubbleList.js +75 -0
- package/components/bubbleList/bubbleList.vdt.js +143 -0
- package/components/bubbleList/index.d.ts +1 -0
- package/components/bubbleList/index.js +1 -0
- package/components/bubbleList/index.spec.d.ts +1 -0
- package/components/bubbleList/index.spec.js +1268 -0
- package/components/bubbleList/item.d.ts +16 -0
- package/components/bubbleList/item.js +27 -0
- package/components/bubbleList/item.vdt.js +36 -0
- package/components/bubbleList/styles.d.ts +5 -0
- package/components/bubbleList/styles.js +33 -0
- package/components/bubbleList/useBubbleList.d.ts +28 -0
- package/components/bubbleList/useBubbleList.js +455 -0
- package/components/checkbox/index.d.ts +3 -3
- package/components/fileCard/fileCard.d.ts +65 -0
- package/components/fileCard/fileCard.js +72 -0
- package/components/fileCard/fileCard.vdt.js +161 -0
- package/components/fileCard/fileCardAssets.d.ts +1 -0
- package/components/fileCard/fileCardAssets.js +54 -0
- package/components/fileCard/fileCardUtils.d.ts +14 -0
- package/components/fileCard/fileCardUtils.js +94 -0
- package/components/fileCard/index.d.ts +2 -0
- package/components/fileCard/index.js +2 -0
- package/components/fileCard/index.spec.d.ts +1 -0
- package/components/fileCard/index.spec.js +1096 -0
- package/components/fileCard/list.d.ts +29 -0
- package/components/fileCard/list.js +46 -0
- package/components/fileCard/list.vdt.js +71 -0
- package/components/fileCard/styles.d.ts +5 -0
- package/components/fileCard/styles.js +83 -0
- package/components/fileCard/useFileCard.d.ts +45 -0
- package/components/fileCard/useFileCard.js +330 -0
- package/components/fileCard/useFileCardList.d.ts +14 -0
- package/components/fileCard/useFileCardList.js +49 -0
- package/components/form/form.js +2 -1
- package/components/media/context.d.ts +6 -0
- package/components/media/context.js +2 -0
- package/components/media/group.d.ts +12 -0
- package/components/media/group.js +32 -0
- package/components/media/group.vdt.js +50 -0
- package/components/media/index.d.ts +2 -0
- package/components/media/index.js +2 -0
- package/components/media/index.spec.d.ts +1 -0
- package/components/media/index.spec.js +1691 -0
- package/components/media/media.d.ts +37 -0
- package/components/media/media.js +67 -0
- package/components/media/media.vdt.js +202 -0
- package/components/media/mediaAssets.d.ts +4 -0
- package/components/media/mediaAssets.js +9 -0
- package/components/media/mediaUtils.d.ts +6 -0
- package/components/media/mediaUtils.js +66 -0
- package/components/media/styles.d.ts +13 -0
- package/components/media/styles.js +52 -0
- package/components/media/types.d.ts +37 -0
- package/components/media/types.js +1 -0
- package/components/media/useMedia.d.ts +70 -0
- package/components/media/useMedia.js +471 -0
- package/components/media/useMediaGroup.d.ts +15 -0
- package/components/media/useMediaGroup.js +136 -0
- package/components/media/useMediaViewer.d.ts +14 -0
- package/components/media/useMediaViewer.js +129 -0
- package/components/media/viewer.d.ts +24 -0
- package/components/media/viewer.js +54 -0
- package/components/media/viewer.vdt.js +100 -0
- package/components/radio/index.d.ts +3 -3
- package/components/sender/icons.d.ts +3 -0
- package/components/sender/icons.js +17 -0
- package/components/sender/index.d.ts +1 -0
- package/components/sender/index.js +1 -0
- package/components/sender/index.spec.d.ts +1 -0
- package/components/sender/index.spec.js +1597 -0
- package/components/sender/sender.d.ts +104 -0
- package/components/sender/sender.js +111 -0
- package/components/sender/sender.vdt.js +230 -0
- package/components/sender/styles.d.ts +5 -0
- package/components/sender/styles.js +56 -0
- package/components/sender/useAutoResize.d.ts +4 -0
- package/components/sender/useAutoResize.js +99 -0
- package/components/sender/useSenderDrag.d.ts +6 -0
- package/components/sender/useSenderDrag.js +320 -0
- package/components/sender/useSenderInput.d.ts +16 -0
- package/components/sender/useSenderInput.js +101 -0
- package/components/sender/useSenderPaste.d.ts +5 -0
- package/components/sender/useSenderPaste.js +36 -0
- package/components/sender/useSenderUpload.d.ts +11 -0
- package/components/sender/useSenderUpload.js +395 -0
- package/components/skeleton/skeleton.d.ts +2 -1
- package/components/skeleton/skeleton.js +1 -1
- package/components/think/index.d.ts +1 -0
- package/components/think/index.js +1 -0
- package/components/think/index.spec.d.ts +1 -0
- package/components/think/index.spec.js +345 -0
- package/components/think/index.vdt.js +82 -0
- package/components/think/styles.d.ts +5 -0
- package/components/think/styles.js +25 -0
- package/components/think/think.d.ts +28 -0
- package/components/think/think.js +48 -0
- package/components/think/useThinkExpand.d.ts +10 -0
- package/components/think/useThinkExpand.js +56 -0
- package/components/types.d.ts +4 -2
- package/components/upload/ajaxUploader.d.ts +1 -0
- package/components/upload/ajaxUploader.js +6 -0
- package/components/xmarkdown/index.d.ts +2 -0
- package/components/xmarkdown/index.js +1 -0
- package/components/xmarkdown/index.spec.d.ts +1 -0
- package/components/xmarkdown/index.spec.js +1666 -0
- package/components/xmarkdown/markdown/codeBlockRenderer.d.ts +8 -0
- package/components/xmarkdown/markdown/codeBlockRenderer.js +52 -0
- package/components/xmarkdown/markdown/codeblock.d.ts +8 -0
- package/components/xmarkdown/markdown/codeblock.js +74 -0
- package/components/xmarkdown/markdown/highlight.d.ts +17 -0
- package/components/xmarkdown/markdown/highlight.js +83 -0
- package/components/xmarkdown/markdown/index.d.ts +14 -0
- package/components/xmarkdown/markdown/index.js +14 -0
- package/components/xmarkdown/markdown/mermaid.d.ts +8 -0
- package/components/xmarkdown/markdown/mermaid.js +104 -0
- package/components/xmarkdown/markdown/renderTree.d.ts +54 -0
- package/components/xmarkdown/markdown/renderTree.js +386 -0
- package/components/xmarkdown/markdown/renderer.d.ts +18 -0
- package/components/xmarkdown/markdown/renderer.js +461 -0
- package/components/xmarkdown/markdown/streaming.d.ts +24 -0
- package/components/xmarkdown/markdown/streaming.js +513 -0
- package/components/xmarkdown/markdown/types.d.ts +124 -0
- package/components/xmarkdown/markdown/types.js +6 -0
- package/components/xmarkdown/markdown/utils.d.ts +7 -0
- package/components/xmarkdown/markdown/utils.js +9 -0
- package/components/xmarkdown/markdown.d.ts +1 -0
- package/components/xmarkdown/markdown.js +1 -0
- package/components/xmarkdown/styles.d.ts +5 -0
- package/components/xmarkdown/styles.js +50 -0
- package/components/xmarkdown/useMermaid.d.ts +27 -0
- package/components/xmarkdown/useMermaid.js +745 -0
- package/components/xmarkdown/useXMarkdownContent.d.ts +14 -0
- package/components/xmarkdown/useXMarkdownContent.js +218 -0
- package/components/xmarkdown/useXMarkdownDisplay.d.ts +26 -0
- package/components/xmarkdown/useXMarkdownDisplay.js +569 -0
- package/components/xmarkdown/xmarkdown.d.ts +61 -0
- package/components/xmarkdown/xmarkdown.js +109 -0
- package/components/xmarkdown/xmarkdown.vdt.js +43 -0
- package/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
- package/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Italic.woff +0 -0
- package/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_Math-Italic.woff +0 -0
- package/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Script-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/dist/i18n/en-US.js +29 -1
- package/dist/i18n/en-US.js.map +1 -1
- package/dist/i18n/en-US.min.js +1 -1
- package/dist/index.js +100506 -37457
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1569 -1
- package/dist/kpc.css +4 -0
- package/dist/ksyun.css +4 -0
- package/i18n/en-US.d.ts +27 -0
- package/i18n/en-US.js +29 -1
- package/index.d.ts +9 -2
- package/index.js +9 -2
- package/package.json +8 -2
- package/styles/global.js +12 -6
- package/yarn-error.log +0 -1012
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Component, TypeDefs } from 'intact-vue-next';
|
|
2
|
+
import type { Events } from '../types';
|
|
3
|
+
export interface BubbleTyping {
|
|
4
|
+
interval?: number;
|
|
5
|
+
step?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface BubbleRenderSlots {
|
|
8
|
+
avatar?: Function;
|
|
9
|
+
roleName?: Function;
|
|
10
|
+
beforeContent?: Function;
|
|
11
|
+
attachments?: Function;
|
|
12
|
+
content?: Function;
|
|
13
|
+
bottom?: Function;
|
|
14
|
+
footer?: Function;
|
|
15
|
+
loading?: Function;
|
|
16
|
+
extra?: Function;
|
|
17
|
+
}
|
|
18
|
+
export type BubbleRenderSlotName = keyof BubbleRenderSlots;
|
|
19
|
+
export interface BubbleProps {
|
|
20
|
+
content?: string | number;
|
|
21
|
+
placement?: 'start' | 'middle' | 'end';
|
|
22
|
+
avatar?: string | boolean;
|
|
23
|
+
roleName?: string;
|
|
24
|
+
loading?: boolean;
|
|
25
|
+
streaming?: boolean;
|
|
26
|
+
variant?: 'filled' | 'outlined' | 'plain';
|
|
27
|
+
shape?: 'round' | 'square' | 'corner';
|
|
28
|
+
maxWidthString?: string;
|
|
29
|
+
typing?: boolean | BubbleTyping;
|
|
30
|
+
}
|
|
31
|
+
interface BubbleInternalProps extends BubbleProps {
|
|
32
|
+
slotRenderers?: BubbleRenderSlots;
|
|
33
|
+
}
|
|
34
|
+
export interface BubbleEvents {
|
|
35
|
+
typing: [string, string];
|
|
36
|
+
typingComplete: [string];
|
|
37
|
+
}
|
|
38
|
+
export interface BubbleBlocks {
|
|
39
|
+
avatar: null;
|
|
40
|
+
roleName: null;
|
|
41
|
+
beforeContent: null;
|
|
42
|
+
attachments: null;
|
|
43
|
+
content: null;
|
|
44
|
+
bottom: null;
|
|
45
|
+
footer: null;
|
|
46
|
+
loading: null;
|
|
47
|
+
extra: null;
|
|
48
|
+
}
|
|
49
|
+
export declare class Bubble extends Component<BubbleInternalProps, BubbleEvents, BubbleBlocks> {
|
|
50
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
51
|
+
static typeDefs: Required<TypeDefs<BubbleInternalProps>>;
|
|
52
|
+
static defaults: () => Partial<BubbleProps>;
|
|
53
|
+
static events: Events<BubbleEvents>;
|
|
54
|
+
private config;
|
|
55
|
+
private display;
|
|
56
|
+
private getSlotRenderer;
|
|
57
|
+
private getSlotRenderers;
|
|
58
|
+
mounted(): void;
|
|
59
|
+
beforeUnmount(): void;
|
|
60
|
+
}
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
3
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
4
|
+
import { Component } from 'intact-vue-next';
|
|
5
|
+
import template from './bubble.vdt';
|
|
6
|
+
import { useConfigContext } from '../config';
|
|
7
|
+
import { useBubbleDisplay } from './useBubbleDisplay';
|
|
8
|
+
var BUBBLE_RENDER_SLOT_NAMES = ['avatar', 'roleName', 'beforeContent', 'attachments', 'content', 'bottom', 'footer', 'loading', 'extra'];
|
|
9
|
+
var typeDefs = {
|
|
10
|
+
content: [String, Number],
|
|
11
|
+
placement: ['start', 'middle', 'end'],
|
|
12
|
+
avatar: [Boolean, String],
|
|
13
|
+
roleName: String,
|
|
14
|
+
loading: Boolean,
|
|
15
|
+
streaming: Boolean,
|
|
16
|
+
variant: ['filled', 'outlined', 'plain'],
|
|
17
|
+
shape: ['round', 'square', 'corner'],
|
|
18
|
+
maxWidthString: String,
|
|
19
|
+
typing: [Boolean, Object]
|
|
20
|
+
};
|
|
21
|
+
var internalTypeDefs = _extends({}, typeDefs, {
|
|
22
|
+
slotRenderers: Object
|
|
23
|
+
});
|
|
24
|
+
var defaults = function defaults() {
|
|
25
|
+
return {
|
|
26
|
+
placement: 'start',
|
|
27
|
+
avatar: false,
|
|
28
|
+
roleName: undefined,
|
|
29
|
+
loading: false,
|
|
30
|
+
streaming: false,
|
|
31
|
+
variant: 'filled',
|
|
32
|
+
shape: 'square',
|
|
33
|
+
maxWidthString: '640px',
|
|
34
|
+
typing: false
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
var events = {
|
|
38
|
+
typing: true,
|
|
39
|
+
typingComplete: true
|
|
40
|
+
};
|
|
41
|
+
export var Bubble = /*#__PURE__*/function (_Component) {
|
|
42
|
+
_inheritsLoose(Bubble, _Component);
|
|
43
|
+
function Bubble() {
|
|
44
|
+
var _context;
|
|
45
|
+
var _this;
|
|
46
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
47
|
+
args[_key] = arguments[_key];
|
|
48
|
+
}
|
|
49
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
50
|
+
_this.config = useConfigContext();
|
|
51
|
+
_this.display = useBubbleDisplay();
|
|
52
|
+
return _this;
|
|
53
|
+
}
|
|
54
|
+
var _proto = Bubble.prototype;
|
|
55
|
+
// React/Vue 包装层通过 slotRenderers 传入插槽,Intact 原生插槽仍走 $blocks。
|
|
56
|
+
_proto.getSlotRenderer = function getSlotRenderer(name) {
|
|
57
|
+
var slotRenderers = this.get('slotRenderers');
|
|
58
|
+
return slotRenderers && slotRenderers[name] ? slotRenderers[name] : undefined;
|
|
59
|
+
};
|
|
60
|
+
_proto.getSlotRenderers = function getSlotRenderers() {
|
|
61
|
+
var _this2 = this;
|
|
62
|
+
return BUBBLE_RENDER_SLOT_NAMES.reduce(function (slotRenderers, name) {
|
|
63
|
+
var renderer = _this2.getSlotRenderer(name);
|
|
64
|
+
if (renderer) {
|
|
65
|
+
slotRenderers[name] = renderer;
|
|
66
|
+
}
|
|
67
|
+
return slotRenderers;
|
|
68
|
+
}, {});
|
|
69
|
+
};
|
|
70
|
+
_proto.mounted = function mounted() {
|
|
71
|
+
this.display.onMounted();
|
|
72
|
+
};
|
|
73
|
+
_proto.beforeUnmount = function beforeUnmount() {
|
|
74
|
+
this.display.onBeforeUnmount();
|
|
75
|
+
};
|
|
76
|
+
return Bubble;
|
|
77
|
+
}(Component);
|
|
78
|
+
Bubble.template = template;
|
|
79
|
+
Bubble.typeDefs = internalTypeDefs;
|
|
80
|
+
Bubble.defaults = defaults;
|
|
81
|
+
Bubble.events = events;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
+
import { createVNode as _$cv, className as _$cn, createElementVNode as _$ce, createUnknownComponentVNode as _$cc } from 'intact-vue-next';
|
|
3
|
+
import { Icon } from '../icon';
|
|
4
|
+
import { isInvalid } from 'intact-shared';
|
|
5
|
+
import { getRestProps, isEmptyString } from '../utils';
|
|
6
|
+
import { makeStyles } from './styles';
|
|
7
|
+
var _$tmp0 = {
|
|
8
|
+
'className': 'ion-person'
|
|
9
|
+
};
|
|
10
|
+
export default function ($props, $blocks, $__proto__) {
|
|
11
|
+
var _classNameObj;
|
|
12
|
+
$blocks || ($blocks = {});
|
|
13
|
+
$props || ($props = {});
|
|
14
|
+
var $this = this;
|
|
15
|
+
var _this$display = this.display,
|
|
16
|
+
shouldShowLoadingShell = _this$display.shouldShowLoadingShell,
|
|
17
|
+
shouldShowAvatar = _this$display.shouldShowAvatar,
|
|
18
|
+
hasRoleName = _this$display.hasRoleName,
|
|
19
|
+
shouldShowContentBlock = _this$display.shouldShowContentBlock,
|
|
20
|
+
getBubbleStyle = _this$display.getBubbleStyle,
|
|
21
|
+
getRoleNameText = _this$display.getRoleNameText,
|
|
22
|
+
getAvatarText = _this$display.getAvatarText,
|
|
23
|
+
hasNonEmptyContentProp = _this$display.hasNonEmptyContentProp,
|
|
24
|
+
getDisplayedContent = _this$display.getDisplayedContent;
|
|
25
|
+
var _this$get = this.get(),
|
|
26
|
+
className = _this$get.className,
|
|
27
|
+
placement = _this$get.placement,
|
|
28
|
+
avatar = _this$get.avatar,
|
|
29
|
+
variant = _this$get.variant,
|
|
30
|
+
shape = _this$get.shape,
|
|
31
|
+
children = _this$get.children;
|
|
32
|
+
var k = this.config.k;
|
|
33
|
+
var showLoadingShell = shouldShowLoadingShell();
|
|
34
|
+
var slotRenderers = this.getSlotRenderers();
|
|
35
|
+
var renderSlot = function renderSlot(name) {
|
|
36
|
+
if (slotRenderers[name]) return slotRenderers[name]();
|
|
37
|
+
if ($blocks[name]) return $blocks[name](function () {
|
|
38
|
+
return undefined;
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
var isEmptySlot = function isEmptySlot(value) {
|
|
42
|
+
if (isInvalid(value) || isEmptyString(value)) return true;
|
|
43
|
+
if (Array.isArray(value)) return value.every(function (item) {
|
|
44
|
+
return isEmptySlot(item);
|
|
45
|
+
});
|
|
46
|
+
if (value.type === 1) return isEmptySlot(value.children);
|
|
47
|
+
return false;
|
|
48
|
+
};
|
|
49
|
+
var avatarSlot = renderSlot('avatar');
|
|
50
|
+
var roleNameSlot = renderSlot('roleName');
|
|
51
|
+
var beforeContentSlot = renderSlot('beforeContent');
|
|
52
|
+
var attachmentsSlot = renderSlot('attachments');
|
|
53
|
+
var contentSlot = showLoadingShell ? undefined : renderSlot('content');
|
|
54
|
+
var bottomSlot = renderSlot('bottom');
|
|
55
|
+
var footerSlot = renderSlot('footer');
|
|
56
|
+
var loadingSlot = showLoadingShell ? renderSlot('loading') : undefined;
|
|
57
|
+
var extraSlot = renderSlot('extra');
|
|
58
|
+
var hasAvatarSlot = !isEmptySlot(avatarSlot);
|
|
59
|
+
var hasRoleNameSlot = !isEmptySlot(roleNameSlot);
|
|
60
|
+
var hasBeforeContentSlot = !isEmptySlot(beforeContentSlot);
|
|
61
|
+
var hasAttachmentsSlot = !isEmptySlot(attachmentsSlot);
|
|
62
|
+
var hasContentSlot = !isEmptySlot(contentSlot);
|
|
63
|
+
var hasBottomSlot = !isEmptySlot(bottomSlot);
|
|
64
|
+
var hasFooterSlot = !isEmptySlot(footerSlot);
|
|
65
|
+
var hasLoadingSlot = !isEmptySlot(loadingSlot);
|
|
66
|
+
var hasExtraSlot = !isEmptySlot(extraSlot);
|
|
67
|
+
var showAvatar = hasAvatarSlot || shouldShowAvatar();
|
|
68
|
+
var showHeader = hasRoleNameSlot || hasRoleName();
|
|
69
|
+
var showBeforeContent = hasBeforeContentSlot;
|
|
70
|
+
var showAttachments = hasAttachmentsSlot;
|
|
71
|
+
var showContent = showAttachments || hasContentSlot || !!children || shouldShowContentBlock();
|
|
72
|
+
var showFooter = hasFooterSlot;
|
|
73
|
+
var showBubble = showBeforeContent || showContent || showFooter;
|
|
74
|
+
var showMeta = (showBeforeContent || showContent) && (showAvatar || showHeader);
|
|
75
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-bubble"] = true, _classNameObj[k + "-bubble-" + placement] = true, _classNameObj[k + "-bubble-" + variant] = true, _classNameObj[k + "-bubble-" + shape] = true, _classNameObj[className] = className, _classNameObj[makeStyles(k)] = true, _classNameObj);
|
|
76
|
+
return showBubble ? _$cv('div', _extends({
|
|
77
|
+
'className': _$cn(classNameObj)
|
|
78
|
+
}, getRestProps(this)), _$ce(2, 'div', [showMeta ? _$ce(2, 'div', [showAvatar ? _$ce(2, 'div', hasAvatarSlot ? avatarSlot : typeof avatar === 'string' && avatar ? _$ce(2, 'img', null, 1, _$cn(k + "-bubble-avatar-image"), {
|
|
79
|
+
'src': avatar,
|
|
80
|
+
'alt': getRoleNameText() || 'avatar'
|
|
81
|
+
}) : getAvatarText() ? _$ce(2, 'span', getAvatarText(), 0) : _$cc(Icon, _$tmp0), 0, _$cn(k + "-bubble-avatar")) : undefined, showHeader ? _$ce(2, 'div', hasRoleNameSlot ? roleNameSlot : _$ce(2, 'span', getRoleNameText(), 0), 0, _$cn(k + "-bubble-header")) : undefined], 0, _$cn(k + "-bubble-meta")) : undefined, showBeforeContent ? _$ce(2, 'div', beforeContentSlot, 0, _$cn(k + "-bubble-before-content")) : undefined, showContent ? _$ce(2, 'div', [showAttachments ? _$ce(2, 'div', attachmentsSlot, 0, _$cn(k + "-bubble-attachments")) : undefined, showLoadingShell ? hasLoadingSlot ? loadingSlot : _$ce(2, 'div', [_$ce(2, 'span', null, 1, _$cn(k + "-bubble-loading-dot")), _$ce(2, 'span', null, 1, _$cn(k + "-bubble-loading-dot")), _$ce(2, 'span', null, 1, _$cn(k + "-bubble-loading-dot"))], 4, _$cn(k + "-bubble-loading")) : hasContentSlot ? contentSlot : children ? children : hasNonEmptyContentProp() || getDisplayedContent() ? _$ce(2, 'div', getDisplayedContent(), 0, _$cn(k + "-bubble-text")) : undefined, hasBottomSlot ? _$ce(2, 'div', bottomSlot, 0, _$cn(k + "-bubble-bottom")) : undefined], 0, _$cn(k + "-bubble-content")) : undefined, showFooter ? _$ce(2, 'div', footerSlot, 0, _$cn(k + "-bubble-footer")) : undefined, hasExtraSlot ? _$ce(2, 'div', extraSlot, 0, _$cn(k + "-bubble-extra")) : undefined], 0, _$cn(k + "-bubble-main"), {
|
|
82
|
+
'style': getBubbleStyle()
|
|
83
|
+
})) : undefined;
|
|
84
|
+
}
|
|
85
|
+
;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './bubble';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './bubble';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|