@farris/x-ui 0.6.3 → 0.6.4

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.
@@ -0,0 +1,28 @@
1
+ import { Plugin } from '../../vue';
2
+ import { default as Notify } from '../../src/notify.component';
3
+ import { default as Toast } from '../../src/components/toast.component';
4
+ import { default as FXNotifyService } from '../../src/notify.service';
5
+
6
+ export * from '../../src/notify.props';
7
+ export * from '../../src/components/toast.props';
8
+ export { Notify, Toast, FXNotifyService };
9
+ /** 全局单例通知服务 */
10
+ export declare const notifyService: FXNotifyService;
11
+ /** @deprecated 请从 '@farris/x-ui' 直接导入 Notify / FXNotify */
12
+ export declare const FXNotify: import('../../vue').DefineComponent<{
13
+ [x: string]: /*elided*/ any;
14
+ }, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('../../vue').ComponentOptionsMixin, import('../../vue').ComponentOptionsMixin, {}, "close" | "empty", import('../../vue').PublicProps, Readonly<{
15
+ [x: string]: /*elided*/ any;
16
+ }> & Readonly<{}>, {
17
+ [x: string]: any;
18
+ }, {}, {}, {}, string, import('../../vue').ComponentProvideOptions, true, {}, any>;
19
+ /** @deprecated 请从 '@farris/x-ui' 直接导入 Toast / FXToast */
20
+ export declare const FXToast: import('../../vue').DefineComponent<{
21
+ [x: string]: /*elided*/ any;
22
+ }, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('../../vue').ComponentOptionsMixin, import('../../vue').ComponentOptionsMixin, {}, "click" | "close", import('../../vue').PublicProps, Readonly<{
23
+ [x: string]: /*elided*/ any;
24
+ }> & Readonly<{}>, {
25
+ [x: string]: any;
26
+ }, {}, {}, {}, string, import('../../vue').ComponentProvideOptions, true, {}, any>;
27
+ declare const _default: typeof Notify & Plugin;
28
+ export default _default;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Toast 子组件:实际渲染通知内容。
3
+ * 1. 只有描述内容时,显示图标、描述内容
4
+ * 2. 有标题和内容时,不显示图标,显示标题和描述内容,展示特殊背景和边线颜色
5
+ */
6
+ declare const _default: import('../../../../vue').DefineComponent<{
7
+ [x: string]: /*elided*/ any;
8
+ }, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('../../../../vue').ComponentOptionsMixin, import('../../../../vue').ComponentOptionsMixin, {}, "click" | "close", import('../../../../vue').PublicProps, Readonly<{
9
+ [x: string]: /*elided*/ any;
10
+ }> & Readonly<{}>, {
11
+ [x: string]: any;
12
+ }, {}, {}, {}, string, import('../../../../vue').ComponentProvideOptions, true, {}, any>;
13
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import { ExtractPropTypes } from '../../../../vue';
2
+
3
+ export declare const toastProps: Record<string, any>;
4
+ export type ToastProps = ExtractPropTypes<typeof toastProps>;
@@ -0,0 +1,12 @@
1
+ export interface NotifyStyleInput {
2
+ position: string;
3
+ hasHost: boolean;
4
+ left?: number;
5
+ right?: number;
6
+ top?: number;
7
+ bottom?: number;
8
+ }
9
+ /** 解析通知挂载目标:host 为空回退 document.body;host 为选择器时按选择器查询 */
10
+ export declare function resolveNotifyMountTarget(host?: HTMLElement | string): HTMLElement;
11
+ /** 计算通知定位样式:hasHost 时绝对定位相对容器,否则沿用 fixed 视口定位 */
12
+ export declare function resolveNotifyPositionStyle(input: NotifyStyleInput): Record<string, string>;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Notify 组件:全局消息提示。
3
+ *
4
+ * 1. 轻量级提示,不影响用户继续执行其他操作
5
+ * 2. 支持 info / success / warning / error 四种类型
6
+ * 3. 可设置显示位置
7
+ * 4. 可只有内容,也可同时带标题
8
+ */
9
+ declare const _default: import('../../../vue').DefineComponent<{
10
+ [x: string]: /*elided*/ any;
11
+ }, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import('../../../vue').ComponentOptionsMixin, import('../../../vue').ComponentOptionsMixin, {}, "close" | "empty", import('../../../vue').PublicProps, Readonly<{
12
+ [x: string]: /*elided*/ any;
13
+ }> & Readonly<{}>, {
14
+ [x: string]: any;
15
+ }, {}, {}, {}, string, import('../../../vue').ComponentProvideOptions, true, {}, any>;
16
+ export default _default;
@@ -0,0 +1,59 @@
1
+ import { ExtractPropTypes } from '../../../vue';
2
+
3
+ export type NotifyPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | 'top-center' | 'bottom-center' | 'center-center';
4
+ export type ToastyAnimate = 'fx-notify-bounceInRight' | 'fx-notify-bounceInLeft' | 'fx-notify-bounceInDown' | 'fx-notify-bounceInUp' | 'fx-notify-bounceIn' | 'fx-notify-fadeIn';
5
+ export type NotifyTheme = 'default' | 'material' | 'bootstrap';
6
+ export interface NotifyButton {
7
+ /** 自定义类名 */
8
+ customClass?: string;
9
+ /** 按钮文本 */
10
+ text: string;
11
+ /** 是否禁用 */
12
+ disable?: boolean;
13
+ /** 点击回调 */
14
+ onClick?: ($event: Event, component: unknown) => void;
15
+ }
16
+ export interface NotifyData {
17
+ /** 通知类型:info / success / warning / error */
18
+ type: string;
19
+ /** 标题 */
20
+ title?: string;
21
+ /** 消息内容 */
22
+ message?: string;
23
+ /** 按钮列表 */
24
+ buttons?: NotifyButton[];
25
+ /** 是否显示关闭按钮 */
26
+ showClose?: boolean;
27
+ /** 主题 */
28
+ theme?: string;
29
+ /** 自动关闭延时(ms) */
30
+ timeout?: number;
31
+ /** 实例 ID */
32
+ id?: number | string;
33
+ }
34
+ export declare const notifyProps: Record<string, any>;
35
+ export type NotifyProps = ExtractPropTypes<typeof notifyProps>;
36
+ /** 调用 notifyService.success / info / warning / error 时传入的参数 */
37
+ export interface ShowNotifyParams {
38
+ /** 通知内容 */
39
+ message: string;
40
+ /** 通知挂载与定位的宿主容器;未提供时挂载到 body */
41
+ host?: HTMLElement | string;
42
+ /** 标题 */
43
+ title?: string;
44
+ /** 是否显示关闭按钮 */
45
+ showCloseButton?: boolean;
46
+ /** 通知位置 */
47
+ position?: NotifyPosition;
48
+ /** 延时关闭时间,默认 3000ms */
49
+ timeout?: number;
50
+ }
51
+ /** 全局默认配置 */
52
+ export interface NotifyGlobalConfig {
53
+ /** 是否显示关闭按钮 */
54
+ showCloseButton?: boolean;
55
+ /** 通知位置 */
56
+ position?: NotifyPosition;
57
+ /** 延时关闭时间,默认 3000ms */
58
+ timeout?: number;
59
+ }
@@ -0,0 +1,21 @@
1
+ import { App } from '../../../vue';
2
+ import { NotifyGlobalConfig, NotifyProps, ShowNotifyParams } from '../../../notify.props';
3
+
4
+ export default class FXNotifyService {
5
+ notifyRefs: Array<any>;
6
+ globalConfig: Partial<NotifyGlobalConfig>;
7
+ /** 对 HTML 字符串做安全转义,保留换行与制表符 */
8
+ escapeAllHtml(htmlString: string): string;
9
+ private createNotifyInstance;
10
+ private getNotifyInstances;
11
+ private updateNotifyPositionForCreate;
12
+ private updateNotifyPositionForClose;
13
+ show(props: Partial<NotifyProps>): App;
14
+ private buildNotifyProps;
15
+ info(opts: ShowNotifyParams | string): App;
16
+ success(opts: ShowNotifyParams | string): App;
17
+ warning(opts: ShowNotifyParams | string): App;
18
+ error(opts: ShowNotifyParams | string): App;
19
+ close(notifyApp: App): void;
20
+ closeAll(): void;
21
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -28,5 +28,5 @@
28
28
  "peerDependencies": {
29
29
  "vue": "^3.2.0"
30
30
  },
31
- "version": "0.6.3"
31
+ "version": "0.6.4"
32
32
  }