@king-design/vue 3.6.2 → 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/anchor/constants.d.ts +2 -0
- package/components/anchor/constants.js +2 -0
- package/components/anchor/index.d.ts +41 -0
- package/components/anchor/index.js +141 -0
- package/components/anchor/index.spec.d.ts +1 -0
- package/components/anchor/index.spec.js +230 -0
- package/components/anchor/index.vdt.js +31 -0
- package/components/anchor/link.d.ts +16 -0
- package/components/anchor/link.js +52 -0
- package/components/anchor/link.vdt.js +49 -0
- package/components/anchor/styles.d.ts +5 -0
- package/components/anchor/styles.js +30 -0
- package/components/anchor/useScroll.d.ts +7 -0
- package/components/anchor/useScroll.js +218 -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/dialog/base.vdt.js +1 -1
- package/components/drawer/index.d.ts +3 -0
- package/components/drawer/index.js +22 -3
- package/components/drawer/index.spec.js +83 -0
- package/components/drawer/index.vdt.js +23 -3
- package/components/drawer/styles.js +1 -1
- package/components/drawer/useDrawerResizable.d.ts +10 -0
- package/components/drawer/useDrawerResizable.js +162 -0
- 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/menu/styles.d.ts +1 -0
- package/components/menu/styles.js +4 -1
- package/components/notification/index.d.ts +1 -0
- package/components/notification/index.js +1 -0
- package/components/notification/index.spec.d.ts +1 -0
- package/components/notification/index.spec.js +317 -0
- package/components/notification/notification.d.ts +39 -0
- package/components/notification/notification.js +183 -0
- package/components/notification/notification.vdt.js +56 -0
- package/components/notification/notifications.d.ts +16 -0
- package/components/notification/notifications.js +51 -0
- package/components/notification/notifications.vdt.js +24 -0
- package/components/notification/styles.d.ts +9 -0
- package/components/notification/styles.js +110 -0
- package/components/radio/index.d.ts +3 -3
- package/components/select/styles.js +1 -1
- 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/table/styles.js +1 -1
- package/components/tabs/useActiveBar.js +7 -3
- package/components/tag/base.d.ts +2 -0
- package/components/tag/base.js +3 -0
- package/components/tag/index.spec.js +17 -0
- package/components/tag/index.vdt.js +12 -5
- package/components/tag/styles.d.ts +9 -0
- package/components/tag/styles.js +14 -1
- package/components/tag/useColor.d.ts +7 -0
- package/components/tag/useColor.js +71 -0
- 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/timepicker/index.spec.js +70 -42
- package/components/timepicker/useDefaultValue.js +12 -7
- package/components/timepicker/useStep.js +4 -2
- package/components/transfer/index.d.ts +13 -0
- package/components/transfer/index.js +6 -2
- package/components/transfer/index.spec.js +197 -0
- package/components/transfer/index.vdt.js +28 -5
- package/components/transfer/styles.js +4 -1
- package/components/transfer/useCheck.js +2 -1
- package/components/transfer/usePagination.d.ts +12 -0
- package/components/transfer/usePagination.js +79 -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/fonts/iconfont.eot +0 -0
- package/dist/fonts/iconfont.svg +235 -0
- package/dist/fonts/iconfont.ttf +0 -0
- package/dist/fonts/iconfont.woff +0 -0
- package/dist/fonts/iconfont.woff2 +0 -0
- package/dist/fonts/ionicons.eot +0 -0
- package/dist/fonts/ionicons.svg +2230 -0
- package/dist/fonts/ionicons.ttf +0 -0
- package/dist/fonts/ionicons.woff +0 -0
- package/dist/fonts/ionicons.woff2 +0 -0
- package/dist/i18n/en-US.js +1439 -0
- package/dist/i18n/en-US.js.map +1 -0
- package/dist/i18n/en-US.min.js +1 -0
- package/dist/i18n/index.js +283 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/index.min.js +1 -0
- package/dist/index.js +121177 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +1569 -0
- 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 +11 -2
- package/index.js +11 -2
- package/install.js +2 -0
- package/package.json +10 -2
- package/styles/fonts/iconfont.eot +0 -0
- package/styles/fonts/iconfont.js +1 -1
- package/styles/fonts/iconfont.svg +38 -0
- package/styles/fonts/iconfont.ttf +0 -0
- package/styles/fonts/iconfont.woff +0 -0
- package/styles/fonts/iconfont.woff2 +0 -0
- package/styles/global.js +12 -6
- package/styles/theme.d.ts +8 -0
- package/styles/theme.js +5 -1
- package/yarn-error.log +0 -1013
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Component, VNode, TypeDefs, Children } from 'intact-vue-next';
|
|
2
|
+
export interface NotificationProps {
|
|
3
|
+
title?: Children;
|
|
4
|
+
content?: Children;
|
|
5
|
+
duration?: number;
|
|
6
|
+
type?: 'info' | 'error' | 'success' | 'warning' | '';
|
|
7
|
+
closable?: boolean;
|
|
8
|
+
icon?: string | VNode;
|
|
9
|
+
position?: 'topRight' | 'topLeft' | 'bottomRight' | 'bottomLeft' | 'top' | 'bottom';
|
|
10
|
+
className?: string;
|
|
11
|
+
onClick?: (e: MouseEvent) => void;
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare class Notification extends Component<NotificationProps> {
|
|
15
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
16
|
+
static typeDefs: Required<TypeDefs<NotificationProps>>;
|
|
17
|
+
static defaults: () => Partial<NotificationProps>;
|
|
18
|
+
static classNamePrefix: string;
|
|
19
|
+
/**
|
|
20
|
+
* 显示通知
|
|
21
|
+
* @param props 通知配置对象
|
|
22
|
+
* @returns 返回通知的唯一 ID,可用于调用 close 方法关闭通知
|
|
23
|
+
*/
|
|
24
|
+
static notice(props: Partial<NotificationProps>): number;
|
|
25
|
+
/**
|
|
26
|
+
* 关闭指定 ID 的通知
|
|
27
|
+
* @param id 通知的唯一 ID,由 notice 方法返回
|
|
28
|
+
*/
|
|
29
|
+
static close(id: number): void;
|
|
30
|
+
static info(props: Partial<NotificationProps>): number;
|
|
31
|
+
static error(props: Partial<NotificationProps>): number;
|
|
32
|
+
static success(props: Partial<NotificationProps>): number;
|
|
33
|
+
static warning(props: Partial<NotificationProps>): number;
|
|
34
|
+
private delayClose;
|
|
35
|
+
private config;
|
|
36
|
+
onClick(e: MouseEvent): void;
|
|
37
|
+
onCloseClick(e: MouseEvent): void;
|
|
38
|
+
close(): void;
|
|
39
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/slice";
|
|
2
|
+
import _Array$from from "@babel/runtime-corejs3/core-js/array/from";
|
|
3
|
+
import _Symbol from "@babel/runtime-corejs3/core-js/symbol";
|
|
4
|
+
import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
|
|
5
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
6
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
7
|
+
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
|
+
function _unsupportedIterableToArray(o, minLen) { var _context2; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context2 = Object.prototype.toString.call(o)).call(_context2, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
9
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
10
|
+
import _Map from "@babel/runtime-corejs3/core-js/map";
|
|
11
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
12
|
+
import _entriesInstanceProperty from "@babel/runtime-corejs3/core-js/instance/entries";
|
|
13
|
+
import { __decorate } from "tslib";
|
|
14
|
+
import { Component, VNode, render, createVNode as h } from 'intact-vue-next';
|
|
15
|
+
import template from './notification.vdt';
|
|
16
|
+
import { Notifications } from './notifications';
|
|
17
|
+
import { useDelayClose } from '../../hooks/useDelayClose';
|
|
18
|
+
import { bind } from '../utils';
|
|
19
|
+
import { useConfigContext } from '../config';
|
|
20
|
+
var typeDefs = {
|
|
21
|
+
title: [String, VNode],
|
|
22
|
+
content: [String, VNode],
|
|
23
|
+
duration: Number,
|
|
24
|
+
type: ['info', 'error', 'success', 'warning', ''],
|
|
25
|
+
closable: Boolean,
|
|
26
|
+
icon: [String, VNode],
|
|
27
|
+
position: ['topRight', 'topLeft', 'bottomRight', 'bottomLeft', 'top', 'bottom'],
|
|
28
|
+
className: String,
|
|
29
|
+
onClick: Function,
|
|
30
|
+
onClose: Function
|
|
31
|
+
};
|
|
32
|
+
var id = 0;
|
|
33
|
+
var defaults = function defaults() {
|
|
34
|
+
return {
|
|
35
|
+
duration: 4500,
|
|
36
|
+
type: '',
|
|
37
|
+
closable: true,
|
|
38
|
+
position: 'topRight'
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
// 按位置维护多个容器实例
|
|
42
|
+
var notificationsMap = new _Map();
|
|
43
|
+
// 存储 notificationId -> { position, key } 的映射,用于通过 id 关闭通知
|
|
44
|
+
var notificationIdMap = new _Map();
|
|
45
|
+
export var Notification = /*#__PURE__*/function (_Component) {
|
|
46
|
+
_inheritsLoose(Notification, _Component);
|
|
47
|
+
function Notification() {
|
|
48
|
+
var _context;
|
|
49
|
+
var _this;
|
|
50
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
51
|
+
args[_key] = arguments[_key];
|
|
52
|
+
}
|
|
53
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
54
|
+
_this.delayClose = useDelayClose(_this.close, _this.get('duration'));
|
|
55
|
+
_this.config = useConfigContext();
|
|
56
|
+
return _this;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 显示通知
|
|
60
|
+
* @param props 通知配置对象
|
|
61
|
+
* @returns 返回通知的唯一 ID,可用于调用 close 方法关闭通知
|
|
62
|
+
*/
|
|
63
|
+
Notification.notice = function notice(props) {
|
|
64
|
+
var _props$type, _props$duration;
|
|
65
|
+
var notificationId = id++;
|
|
66
|
+
var key = notificationId;
|
|
67
|
+
var finalProps = _extends({}, props, {
|
|
68
|
+
key: key,
|
|
69
|
+
type: (_props$type = props.type) != null ? _props$type : '',
|
|
70
|
+
duration: (_props$duration = props.duration) != null ? _props$duration : 4500,
|
|
71
|
+
position: props.position || 'topRight'
|
|
72
|
+
});
|
|
73
|
+
var position = finalProps.position;
|
|
74
|
+
// 存储 notificationId 到 position 和 key 的映射
|
|
75
|
+
notificationIdMap.set(notificationId, {
|
|
76
|
+
position: position,
|
|
77
|
+
key: key
|
|
78
|
+
});
|
|
79
|
+
// 如果该位置的容器不存在,创建并挂载
|
|
80
|
+
if (!notificationsMap.has(position)) {
|
|
81
|
+
var container = document.createElement('div');
|
|
82
|
+
document.body.append(container);
|
|
83
|
+
// @ts-ignore 类型实例化过深
|
|
84
|
+
render(h(Notifications, {
|
|
85
|
+
ref: function ref(i) {
|
|
86
|
+
if (i) {
|
|
87
|
+
notificationsMap.set(position, i);
|
|
88
|
+
// 设置清理回调
|
|
89
|
+
i.__cleanup = function () {
|
|
90
|
+
notificationsMap.delete(position);
|
|
91
|
+
render(null, container);
|
|
92
|
+
container.remove();
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
classNamePrefix: Notification.classNamePrefix,
|
|
97
|
+
position: position
|
|
98
|
+
}), container);
|
|
99
|
+
}
|
|
100
|
+
// @ts-ignore 类型实例化过深
|
|
101
|
+
notificationsMap.get(position).notice(h(Notification, finalProps));
|
|
102
|
+
return notificationId;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* 关闭指定 ID 的通知
|
|
106
|
+
* @param id 通知的唯一 ID,由 notice 方法返回
|
|
107
|
+
*/;
|
|
108
|
+
Notification.close = function close(id) {
|
|
109
|
+
var notificationInfo = notificationIdMap.get(id);
|
|
110
|
+
if (!notificationInfo) {
|
|
111
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
112
|
+
console.warn("Notification with id " + id + " does not exist.");
|
|
113
|
+
}
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
var position = notificationInfo.position,
|
|
117
|
+
key = notificationInfo.key;
|
|
118
|
+
var notifications = notificationsMap.get(position);
|
|
119
|
+
if (notifications) {
|
|
120
|
+
notifications.delete(key);
|
|
121
|
+
}
|
|
122
|
+
// 从映射中移除
|
|
123
|
+
notificationIdMap.delete(id);
|
|
124
|
+
};
|
|
125
|
+
Notification.info = function info(props) {
|
|
126
|
+
return Notification.notice(_extends({}, props, {
|
|
127
|
+
type: 'info'
|
|
128
|
+
}));
|
|
129
|
+
};
|
|
130
|
+
Notification.error = function error(props) {
|
|
131
|
+
return Notification.notice(_extends({}, props, {
|
|
132
|
+
type: 'error'
|
|
133
|
+
}));
|
|
134
|
+
};
|
|
135
|
+
Notification.success = function success(props) {
|
|
136
|
+
return Notification.notice(_extends({}, props, {
|
|
137
|
+
type: 'success'
|
|
138
|
+
}));
|
|
139
|
+
};
|
|
140
|
+
Notification.warning = function warning(props) {
|
|
141
|
+
return Notification.notice(_extends({}, props, {
|
|
142
|
+
type: 'warning'
|
|
143
|
+
}));
|
|
144
|
+
};
|
|
145
|
+
var _proto = Notification.prototype;
|
|
146
|
+
_proto.onClick = function onClick(e) {
|
|
147
|
+
var onClick = this.get('onClick');
|
|
148
|
+
if (onClick) {
|
|
149
|
+
onClick(e);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
_proto.onCloseClick = function onCloseClick(e) {
|
|
153
|
+
e.stopPropagation(); // 阻止事件冒泡,避免触发外层的 onClick
|
|
154
|
+
this.close();
|
|
155
|
+
};
|
|
156
|
+
_proto.close = function close() {
|
|
157
|
+
var onClose = this.get('onClose');
|
|
158
|
+
if (onClose) {
|
|
159
|
+
onClose();
|
|
160
|
+
}
|
|
161
|
+
var position = this.get('position') || 'topRight';
|
|
162
|
+
var key = this.get('key');
|
|
163
|
+
// 从 notificationIdMap 中移除对应的映射
|
|
164
|
+
for (var _iterator = _createForOfIteratorHelperLoose(_entriesInstanceProperty(notificationIdMap).call(notificationIdMap)), _step; !(_step = _iterator()).done;) {
|
|
165
|
+
var _step$value = _step.value,
|
|
166
|
+
notificationId = _step$value[0],
|
|
167
|
+
info = _step$value[1];
|
|
168
|
+
if (info.position === position && info.key === key) {
|
|
169
|
+
notificationIdMap.delete(notificationId);
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
notificationsMap.get(position).delete(key);
|
|
174
|
+
};
|
|
175
|
+
return Notification;
|
|
176
|
+
}(Component);
|
|
177
|
+
Notification.template = template;
|
|
178
|
+
Notification.typeDefs = typeDefs;
|
|
179
|
+
Notification.defaults = defaults;
|
|
180
|
+
Notification.classNamePrefix = void 0;
|
|
181
|
+
__decorate([bind], Notification.prototype, "onClick", null);
|
|
182
|
+
__decorate([bind], Notification.prototype, "onCloseClick", null);
|
|
183
|
+
__decorate([bind], Notification.prototype, "close", null);
|
|
@@ -0,0 +1,56 @@
|
|
|
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 { Button } from '../button';
|
|
4
|
+
import { Icon } from '../icon';
|
|
5
|
+
import { getRestProps } from '../utils';
|
|
6
|
+
import { makeNotificationStyles } from './styles';
|
|
7
|
+
import { theme } from '../../styles/theme';
|
|
8
|
+
export default function ($props, $blocks, $__proto__) {
|
|
9
|
+
var _classNameObj, _$cn2;
|
|
10
|
+
$blocks || ($blocks = {});
|
|
11
|
+
$props || ($props = {});
|
|
12
|
+
var $this = this;
|
|
13
|
+
var _this$get = this.get(),
|
|
14
|
+
type = _this$get.type,
|
|
15
|
+
title = _this$get.title,
|
|
16
|
+
content = _this$get.content,
|
|
17
|
+
children = _this$get.children,
|
|
18
|
+
closable = _this$get.closable,
|
|
19
|
+
icon = _this$get.icon,
|
|
20
|
+
classNamePrefix = _this$get.classNamePrefix,
|
|
21
|
+
position = _this$get.position,
|
|
22
|
+
className = _this$get.className;
|
|
23
|
+
var k = this.config.k;
|
|
24
|
+
var classNameObj = (_classNameObj = {}, _classNameObj[k + "-notification"] = true, _classNameObj[className] = className, _classNameObj[k + "-" + type] = type && (type === 'info' || type === 'error' || type === 'success' || type === 'warning'), _classNameObj[k + "-position-" + (position || 'topRight')] = true, _classNameObj[makeNotificationStyles(k)] = true, _classNameObj);
|
|
25
|
+
var iconMap = {
|
|
26
|
+
info: k + "-icon-information-fill",
|
|
27
|
+
warning: k + "-icon-warning-fill",
|
|
28
|
+
success: k + "-icon-success-fill",
|
|
29
|
+
error: k + "-icon-error-fill"
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// type 优先级大于 icon,如果 type 存在且是四种类型之一,使用 type 对应的 icon
|
|
33
|
+
// 否则如果 icon 有值,使用自定义 icon
|
|
34
|
+
var hasIcon = type && iconMap[type] || icon;
|
|
35
|
+
var iconName = type && iconMap[type] ? iconMap[type] : typeof icon === 'string' ? icon : null;
|
|
36
|
+
var iconColor = type ? theme.color[type === 'error' ? 'danger' : type] : 'default';
|
|
37
|
+
return _$cv('div', _extends({}, getRestProps(this), {
|
|
38
|
+
'className': _$cn(classNameObj),
|
|
39
|
+
'ev-mouseenter': this.delayClose.onMouseEnter,
|
|
40
|
+
'ev-mouseleave': this.delayClose.onMouseLeave,
|
|
41
|
+
'ev-click': this.onClick
|
|
42
|
+
}), _$ce(2, 'div', [_$ce(2, 'div', [hasIcon && iconName ? _$ce(2, 'div', _$cc(Icon, {
|
|
43
|
+
'className': _$cn(iconName),
|
|
44
|
+
'color': iconColor
|
|
45
|
+
}), 2, _$cn(k + "-notification-icon")) : hasIcon && !iconName ? _$ce(2, 'div', icon, 0, _$cn(k + "-notification-icon")) : undefined, _$ce(2, 'div', [title ? _$ce(2, 'div', title, 0, _$cn(k + "-notification-title")) : undefined, content || children ? _$ce(2, 'div', content || children, 0, _$cn(k + "-notification-body")) : undefined], 0, _$cn(k + "-notification-content"))], 0, _$cn((_$cn2 = {}, _$cn2[k + "-notification-wrapper"] = true, _$cn2[k + "-with-icon"] = hasIcon, _$cn2))), closable ? _$cc(Button, {
|
|
46
|
+
'type': 'none',
|
|
47
|
+
'icon': true,
|
|
48
|
+
'className': _$cn(k + "-notification-close"),
|
|
49
|
+
'ev-click': this.onCloseClick,
|
|
50
|
+
'children': _$cc(Icon, {
|
|
51
|
+
'className': _$cn(k + "-icon-close"),
|
|
52
|
+
'hoverable': true
|
|
53
|
+
})
|
|
54
|
+
}) : undefined], 0, _$cn(k + "-notification-container")));
|
|
55
|
+
}
|
|
56
|
+
;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Component, VNodeComponentClass, TypeDefs } from 'intact-vue-next';
|
|
2
|
+
import type { Notification } from './notification';
|
|
3
|
+
export interface NotificationsProps {
|
|
4
|
+
classNamePrefix?: string;
|
|
5
|
+
position?: 'topRight' | 'topLeft' | 'bottomRight' | 'bottomLeft' | 'top' | 'bottom';
|
|
6
|
+
}
|
|
7
|
+
export declare class Notifications extends Component {
|
|
8
|
+
static template: string | import('intact-vue-next').Template<any>;
|
|
9
|
+
static typeDefs: Required<TypeDefs<NotificationsProps>>;
|
|
10
|
+
private notifications;
|
|
11
|
+
private config;
|
|
12
|
+
__cleanup?: () => void;
|
|
13
|
+
notice(notification: VNodeComponentClass<Notification>): void;
|
|
14
|
+
delete(key: number | string): void;
|
|
15
|
+
onAfterLeave(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
3
|
+
import _findIndexInstanceProperty from "@babel/runtime-corejs3/core-js/instance/find-index";
|
|
4
|
+
import _spliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/splice";
|
|
5
|
+
import { Component } from 'intact-vue-next';
|
|
6
|
+
import template from './notifications.vdt';
|
|
7
|
+
import { useConfigContext } from '../config';
|
|
8
|
+
var typeDefs = {
|
|
9
|
+
classNamePrefix: String,
|
|
10
|
+
position: ['topRight', 'topLeft', 'bottomRight', 'bottomLeft', 'top', 'bottom']
|
|
11
|
+
};
|
|
12
|
+
export var Notifications = /*#__PURE__*/function (_Component) {
|
|
13
|
+
_inheritsLoose(Notifications, _Component);
|
|
14
|
+
function Notifications() {
|
|
15
|
+
var _context;
|
|
16
|
+
var _this;
|
|
17
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
18
|
+
args[_key] = arguments[_key];
|
|
19
|
+
}
|
|
20
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
21
|
+
_this.notifications = [];
|
|
22
|
+
_this.config = useConfigContext();
|
|
23
|
+
_this.__cleanup = void 0;
|
|
24
|
+
return _this;
|
|
25
|
+
}
|
|
26
|
+
var _proto = Notifications.prototype;
|
|
27
|
+
_proto.notice = function notice(notification) {
|
|
28
|
+
this.notifications.push(notification);
|
|
29
|
+
this.forceUpdate();
|
|
30
|
+
};
|
|
31
|
+
_proto.delete = function _delete(key) {
|
|
32
|
+
var notifications = this.notifications;
|
|
33
|
+
var index = _findIndexInstanceProperty(notifications).call(notifications, function (notification) {
|
|
34
|
+
return notification.key === key;
|
|
35
|
+
});
|
|
36
|
+
if (process.env.NODE_ENV !== 'production' && !~index) {
|
|
37
|
+
throw new Error('You are removing a notification that does not exist.');
|
|
38
|
+
}
|
|
39
|
+
_spliceInstanceProperty(notifications).call(notifications, index, 1);
|
|
40
|
+
this.forceUpdate();
|
|
41
|
+
};
|
|
42
|
+
_proto.onAfterLeave = function onAfterLeave() {
|
|
43
|
+
// 当离开动画完成后,如果该位置 通知列表为空,则清理容器
|
|
44
|
+
if (this.notifications.length === 0 && this.__cleanup) {
|
|
45
|
+
this.__cleanup();
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return Notifications;
|
|
49
|
+
}(Component);
|
|
50
|
+
Notifications.template = template;
|
|
51
|
+
Notifications.typeDefs = typeDefs;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createUnknownComponentVNode as _$cc, createElementVNode as _$ce, map as _$ma, className as _$cn } from 'intact-vue-next';
|
|
2
|
+
import { TransitionGroup } from 'intact-vue-next';
|
|
3
|
+
import { makeNotificationsStyles } from './styles';
|
|
4
|
+
import { ConfigProvider } from '../config';
|
|
5
|
+
export default function ($props, $blocks, $__proto__) {
|
|
6
|
+
var _$cn2;
|
|
7
|
+
$blocks || ($blocks = {});
|
|
8
|
+
$props || ($props = {});
|
|
9
|
+
var $this = this;
|
|
10
|
+
var k = this.get('classNamePrefix') || this.config.k;
|
|
11
|
+
var position = this.get('position') || 'topRight';
|
|
12
|
+
return _$cc(ConfigProvider, {
|
|
13
|
+
'value': {
|
|
14
|
+
classNamePrefix: k
|
|
15
|
+
},
|
|
16
|
+
'children': _$ce(2, 'div', _$cc(TransitionGroup, {
|
|
17
|
+
'onAfterLeave': this.onAfterLeave.bind(this),
|
|
18
|
+
'children': _$ma(this.notifications, function ($value, $key) {
|
|
19
|
+
return $value;
|
|
20
|
+
}, $this)
|
|
21
|
+
}), 2, _$cn((_$cn2 = {}, _$cn2[k + "-notifications"] = true, _$cn2[makeNotificationsStyles(k, position)] = true, _$cn2)))
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { css } from '@emotion/css';
|
|
2
|
+
import { theme, setDefault } from '../../styles/theme';
|
|
3
|
+
import { deepDefaults } from '../../styles/utils';
|
|
4
|
+
import '../../styles/global';
|
|
5
|
+
import { cache } from '../utils';
|
|
6
|
+
var defaults = {
|
|
7
|
+
get transition() {
|
|
8
|
+
return theme.transition.large;
|
|
9
|
+
},
|
|
10
|
+
top: "24px",
|
|
11
|
+
right: "24px",
|
|
12
|
+
left: "24px",
|
|
13
|
+
bottom: "24px",
|
|
14
|
+
leftTransform: "translateX(-100%)",
|
|
15
|
+
rightTransform: "translateX(100%)",
|
|
16
|
+
topTransform: "translateY(-100%)",
|
|
17
|
+
bottomTransform: "translateY(100%)",
|
|
18
|
+
bgColor: '#fff',
|
|
19
|
+
get borderRadius() {
|
|
20
|
+
return theme.borderRadius;
|
|
21
|
+
},
|
|
22
|
+
gap: "8px",
|
|
23
|
+
boxShadow: '0px 4px 32px 4px #00000014',
|
|
24
|
+
padding: "12px",
|
|
25
|
+
get fontSize() {
|
|
26
|
+
return theme.default.fontSize;
|
|
27
|
+
},
|
|
28
|
+
get contentColor() {
|
|
29
|
+
return theme.color.text;
|
|
30
|
+
},
|
|
31
|
+
get titleColor() {
|
|
32
|
+
return theme.color.title;
|
|
33
|
+
},
|
|
34
|
+
minWidth: '320px',
|
|
35
|
+
width: '360px',
|
|
36
|
+
maxWidth: '400px',
|
|
37
|
+
titleFontSize: '14px',
|
|
38
|
+
titleFontWeight: '500',
|
|
39
|
+
titleMarginBottom: '8px',
|
|
40
|
+
bodyLineHeight: '1.5',
|
|
41
|
+
icon: {
|
|
42
|
+
fontSize: "20px"
|
|
43
|
+
},
|
|
44
|
+
close: {
|
|
45
|
+
right: "12px",
|
|
46
|
+
top: "12px",
|
|
47
|
+
width: "20px",
|
|
48
|
+
height: "20px"
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
var notification;
|
|
52
|
+
setDefault(function () {
|
|
53
|
+
notification = deepDefaults(theme, {
|
|
54
|
+
notification: defaults
|
|
55
|
+
}).notification;
|
|
56
|
+
makeNotificationsStyles == null || makeNotificationsStyles.clearCache();
|
|
57
|
+
makeNotificationStyles == null || makeNotificationStyles.clearCache();
|
|
58
|
+
});
|
|
59
|
+
export var makeNotificationsStyles = cache(function makeNotificationsStyles(k, position) {
|
|
60
|
+
// 位置配置
|
|
61
|
+
var positions = {
|
|
62
|
+
topRight: {
|
|
63
|
+
top: notification.top,
|
|
64
|
+
right: notification.right,
|
|
65
|
+
left: '',
|
|
66
|
+
bottom: '',
|
|
67
|
+
transform: ''
|
|
68
|
+
},
|
|
69
|
+
topLeft: {
|
|
70
|
+
top: notification.top,
|
|
71
|
+
left: notification.left,
|
|
72
|
+
right: '',
|
|
73
|
+
bottom: '',
|
|
74
|
+
transform: ''
|
|
75
|
+
},
|
|
76
|
+
bottomRight: {
|
|
77
|
+
bottom: notification.top,
|
|
78
|
+
right: notification.right,
|
|
79
|
+
left: '',
|
|
80
|
+
top: '',
|
|
81
|
+
transform: ''
|
|
82
|
+
},
|
|
83
|
+
bottomLeft: {
|
|
84
|
+
bottom: notification.top,
|
|
85
|
+
left: notification.left,
|
|
86
|
+
right: '',
|
|
87
|
+
top: '',
|
|
88
|
+
transform: ''
|
|
89
|
+
},
|
|
90
|
+
top: {
|
|
91
|
+
top: notification.top,
|
|
92
|
+
left: '50%',
|
|
93
|
+
right: '',
|
|
94
|
+
bottom: '',
|
|
95
|
+
transform: 'translateX(-50%)'
|
|
96
|
+
},
|
|
97
|
+
bottom: {
|
|
98
|
+
bottom: notification.top,
|
|
99
|
+
left: '50%',
|
|
100
|
+
right: '',
|
|
101
|
+
top: '',
|
|
102
|
+
transform: 'translateX(-50%)'
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
var pos = positions[position] || positions.topRight;
|
|
106
|
+
return /*#__PURE__*/css("position:fixed;", pos.top ? "top: " + pos.top + ";" : '', " ", pos.bottom ? "bottom: " + pos.bottom + ";" : '', " ", pos.left ? "left: " + pos.left + ";" : '', " ", pos.right ? "right: " + pos.right + ";" : '', " ", pos.transform ? "transform: " + pos.transform + ";" : '', " width:auto;pointer-events:none;z-index:", theme.maxZIndex + 1, ";");
|
|
107
|
+
});
|
|
108
|
+
export var makeNotificationStyles = cache(function makeNotificationStyles(k) {
|
|
109
|
+
return /*#__PURE__*/css(".", k, "-notification-container{display:flex;flex-direction:column;position:relative;box-shadow:", notification.boxShadow, ";border-radius:", notification.borderRadius, ";margin-bottom:", notification.gap, ";pointer-events:all;min-width:", notification.minWidth, ";max-width:", notification.maxWidth, ";width:", notification.width, ";background:", notification.bgColor, ";}.", k, "-notification-wrapper{position:relative;display:flex;gap:", notification.gap, ";padding:", notification.padding, ";}.", k, "-notification-icon{.", k, "-icon{font-size:", notification.icon.fontSize, ";}}.", k, "-notification-content{flex:1;display:flex;flex-direction:column;}.", k, "-notification-title{font-size:", notification.titleFontSize, ";font-weight:", notification.titleFontWeight, ";color:", notification.titleColor, ";margin-bottom:", notification.titleMarginBottom, ";line-height:", notification.bodyLineHeight, ";}.", k, "-notification-body{font-size:", notification.fontSize, ";color:", notification.contentColor, ";line-height:", notification.bodyLineHeight, ";word-break:break-word;word-wrap:break-word;}.", k, "-notification-close{position:absolute;right:", notification.close.right, ";top:", notification.close.top, ";width:", notification.close.width, ";height:", notification.close.height, ";}&.", k, "-position-topRight.transition-enter-from,&.", k, "-position-bottomRight.transition-enter-from,&.", k, "-position-topRight.transition-leave-to,&.", k, "-position-bottomRight.transition-leave-to{opacity:0;transform:", notification.rightTransform, ";}&.", k, "-position-topLeft.transition-enter-from,&.", k, "-position-bottomLeft.transition-enter-from,&.", k, "-position-topLeft.transition-leave-to,&.", k, "-position-bottomLeft.transition-leave-to{opacity:0;transform:", notification.leftTransform, ";}&.", k, "-position-top.transition-enter-from,&.", k, "-position-top.transition-leave-to{opacity:0;transform:", notification.topTransform, ";}&.", k, "-position-bottom.transition-enter-from,&.", k, "-position-bottom.transition-leave-to{opacity:0;transform:", notification.bottomTransform, ";}&.transition-enter-active,&.transition-leave-active{transition:transform ", notification.transition, ",opacity ", notification.transition, ";}&.transition-move{transition:transform ", notification.transition, ";}");
|
|
110
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Component, TypeDefs } from 'intact-vue-next';
|
|
2
|
-
import type {
|
|
3
|
-
export interface RadioProps<Value = false, True = true> extends
|
|
2
|
+
import type { CommonFormElementAttributes, Events } from '../types';
|
|
3
|
+
export interface RadioProps<Value = false, True = true> extends CommonFormElementAttributes {
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
value?: Value | True;
|
|
6
6
|
trueValue?: True;
|
|
@@ -11,7 +11,7 @@ export interface RadioEvents<True = true> {
|
|
|
11
11
|
}
|
|
12
12
|
export declare class Radio<Value = false, True = true> extends Component<RadioProps<Value, True>, RadioEvents<True>> {
|
|
13
13
|
static template: string | import('intact-vue-next').Template<any>;
|
|
14
|
-
static typeDefs: Required<TypeDefs<Omit<RadioProps<false, true>, keyof
|
|
14
|
+
static typeDefs: Required<TypeDefs<Omit<RadioProps<false, true>, keyof CommonFormElementAttributes>>>;
|
|
15
15
|
static defaults: () => Partial<RadioProps<false, true>>;
|
|
16
16
|
static events: Events<RadioEvents<true>>;
|
|
17
17
|
private elementRef;
|
|
@@ -157,7 +157,7 @@ export var makeStyles = cache(function makeStyles(k) {
|
|
|
157
157
|
});
|
|
158
158
|
export var makeMenuStyles = cache(function makeMenuStyles(k) {
|
|
159
159
|
var searchable = select.searchable;
|
|
160
|
-
return /*#__PURE__*/css("min-width:auto;max-height:", select.menuMaxHeight, ";overflow:auto;&:not([class*=\"-active\"]){transition:left ", select.transition, ",top ", select.transition, ";}.", k, "-select-empty{padding:", select.empty.padding, ";color:", select.empty.color, ";text-align:center;}.", k, "-select-option{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;&.", k, "-active{color:", select.activeColor, ";}}&.", k, "-card{display:flex;height:", select.card.height, ";.", k, "-tabs{border:none;overflow:auto;}.", k, "-select-group{flex:1;overflow:auto;}.", k, "-select-option.", k, "-hover{background:", select.card.itemHoverBgColor, ";color:", select.card.itemHoverColor, ";}}&.", k, "-searchable{max-height:none;padding:", searchable.padding, ";.", k, "-select-option{padding:", searchable.optionPadding, ";}}.", k, "-select-header{display:flex;padding:", searchable.header.padding, ";border-bottom:", searchable.border, ";margin-bottom:", searchable.header.gap, ";}.", k, "-select-op{white-space:nowrap;.", k, "-btn{padding:", searchable.header.btnPadding, ";margin-left:", searchable.header.btnGap, ";}}.", k, "-select-body{max-height:", select.menuMaxHeight, ";overflow:auto;}.", k, "-select-footer{border-top:", searchable.border, ";padding:", searchable.footer.padding, ";text-align:right;margin-top:", searchable.footer.gap, ";.", k, "-btn{margin-left:", searchable.footer.btnGap, ";}}.", k, "-select-option{.", k, "-checkbox{margin:0 -", getRight(searchable.optionPadding), " 0 -", getLeft(searchable.optionPadding), ";padding:", searchable.optionPadding, ";}}.", k, "-select-checkmark{float:right;height:100%;font-size:", select.multiple.checkmark.fontSize, ";}");
|
|
160
|
+
return /*#__PURE__*/css("min-width:auto;max-height:", select.menuMaxHeight, ";overflow:auto;&:not([class*=\"-active\"]){transition:left ", select.transition, ",top ", select.transition, ";}.", k, "-select-empty{padding:", select.empty.padding, ";color:", select.empty.color, ";text-align:center;}.", k, "-select-option{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;&.", k, "-active{color:", select.activeColor, ";}}&.", k, "-card{display:flex;height:", select.card.height, ";.", k, "-tabs{border:none;border-top-right-radius:0;border-bottom-right-radius:0;overflow:auto;}.", k, "-select-group{flex:1;overflow:auto;}.", k, "-select-option.", k, "-hover{background:", select.card.itemHoverBgColor, ";color:", select.card.itemHoverColor, ";}}&.", k, "-searchable{max-height:none;padding:", searchable.padding, ";.", k, "-select-option{padding:", searchable.optionPadding, ";}}.", k, "-select-header{display:flex;padding:", searchable.header.padding, ";border-bottom:", searchable.border, ";margin-bottom:", searchable.header.gap, ";}.", k, "-select-op{white-space:nowrap;.", k, "-btn{padding:", searchable.header.btnPadding, ";margin-left:", searchable.header.btnGap, ";}}.", k, "-select-body{max-height:", select.menuMaxHeight, ";overflow:auto;}.", k, "-select-footer{border-top:", searchable.border, ";padding:", searchable.footer.padding, ";text-align:right;margin-top:", searchable.footer.gap, ";.", k, "-btn{margin-left:", searchable.footer.btnGap, ";}}.", k, "-select-option{.", k, "-checkbox{margin:0 -", getRight(searchable.optionPadding), " 0 -", getLeft(searchable.optionPadding), ";padding:", searchable.optionPadding, ";}}.", k, "-select-checkmark{float:right;height:100%;font-size:", select.multiple.checkmark.fontSize, ";}");
|
|
161
161
|
});
|
|
162
162
|
export var makeGroupStyles = cache(function makeGroupStyles(k) {
|
|
163
163
|
return /*#__PURE__*/css(".", k, "-select-group-label{color:", select.group.labelColor, ";padding:", select.group.labelPadding, ";}");
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// 内联 SVG 资源:data URL 形式,与 fileCard 中的占位图保持一致策略,避免下游打包额外处理 SVG 资源。
|
|
2
|
+
// 三个发送态共用同一张图,hover/disabled 通过 CSS opacity 切换;附件用 currentColor,hover 时由 CSS 改色。
|
|
3
|
+
// 设计为 32×32 可点击主形(与 sendButtonSize 一致);原先 48×48 导出版本中间才是 32px 圆,用 img 外溢对齐容易「撑不满 / 对不齐」。
|
|
4
|
+
// 将图形坐标归一到 viewBox 0 0 32 32,阴影用组件侧 CSS filter,与原有 SVG feDropShadow 观感接近且不占画布。
|
|
5
|
+
var SEND_SVG = ['<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none">', '<rect width="32" height="32" rx="16" fill="url(#b)"/>',
|
|
6
|
+
// 路径由原 48 稿中 path 平移 (-8, -4) 到 0..32 坐标系
|
|
7
|
+
'<path d="M22.3337 9.6666L17.9003 22.3333L16.0003 16L9.667 14.1L22.3337 9.6666Z" fill="white" stroke="white" stroke-linejoin="round"/>', '<defs>', '<linearGradient id="b" x1="0" y1="0" x2="32" y2="32" gradientUnits="userSpaceOnUse">', '<stop stop-color="#00DDDD"/>', '<stop offset="0.538462" stop-color="#5370FF"/>', '<stop offset="1" stop-color="#712FFF"/>', '</linearGradient>', '</defs>', '</svg>'].join('');
|
|
8
|
+
var STOP_SVG = ['<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none">', '<rect width="32" height="32" rx="16" fill="url(#b)"/>', '<rect x="10" y="10" width="12" height="12" rx="2" fill="white"/>', '<defs>', '<linearGradient id="b" x1="0" y1="0" x2="32" y2="32" gradientUnits="userSpaceOnUse">', '<stop stop-color="#00DDDD"/>', '<stop offset="0.538462" stop-color="#5370FF"/>', '<stop offset="1" stop-color="#712FFF"/>', '</linearGradient>', '</defs>', '</svg>'].join('');
|
|
9
|
+
// 附件回形针 16x16,stroke 用 currentColor,方便用 CSS color 控制颜色变化。
|
|
10
|
+
var ATTACH_SVG = ['<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">', '<path d="M8.23567 3.18836L3.28591 8.13812C2.11433 9.30969 2.11433 11.2092 3.28591 12.3808C4.45747 13.5523 6.35697 13.5523 7.52854 12.3808L13.4211 6.48819C14.2021 5.70716 14.2021 4.44082 13.4211 3.65975C12.6401 2.87871 11.3737 2.87871 10.5927 3.65975L4.70014 9.55232C4.3096 9.94286 4.3096 10.576 4.70014 10.9665C5.09064 11.3571 5.7238 11.3571 6.11434 10.9665L11.0641 6.01679" stroke="currentColor" stroke-linecap="square" stroke-linejoin="round"/>', '</svg>'].join('');
|
|
11
|
+
function toDataUrl(svg) {
|
|
12
|
+
return "data:image/svg+xml;charset=UTF-8," + encodeURIComponent(svg);
|
|
13
|
+
}
|
|
14
|
+
export var senderSendIcon = toDataUrl(SEND_SVG);
|
|
15
|
+
export var senderStopIcon = toDataUrl(STOP_SVG);
|
|
16
|
+
// 附件用 innerHTML 注入,因为 currentColor 在 <img src> 形式下无法继承 color。
|
|
17
|
+
export var senderAttachSvg = ATTACH_SVG;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './sender';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './sender';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|