@digitalwalletcorp/vue-core 1.2.1 → 1.3.1
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/README.md +79 -3
- package/lib/accordion-fieldset.d.cts +14 -4
- package/lib/accordion-fieldset.d.ts +14 -4
- package/lib/accordion-section.d.cts +20 -10
- package/lib/accordion-section.d.ts +20 -10
- package/lib/components-BuTJ1wX8.js +26 -0
- package/lib/components-CKql5lWg.cjs +1 -0
- package/lib/components.d.cts +10 -0
- package/lib/components.d.ts +10 -0
- package/lib/copy-button.d.cts +34 -0
- package/lib/copy-button.d.ts +34 -0
- package/lib/dark-mode-selector.d.cts +32 -0
- package/lib/dark-mode-selector.d.ts +32 -0
- package/lib/data-table.d.cts +29 -0
- package/lib/data-table.d.ts +29 -0
- package/lib/help-button.d.cts +39 -0
- package/lib/help-button.d.ts +39 -0
- package/lib/help-popper.d.cts +39 -0
- package/lib/help-popper.d.ts +39 -0
- package/lib/helpers/data-table-csv.d.cts +17 -0
- package/lib/helpers/data-table-csv.d.ts +17 -0
- package/lib/helpers/show-floating-component.d.cts +86 -0
- package/lib/helpers/show-floating-component.d.ts +86 -0
- package/lib/helpers/show-modal-dialog.d.cts +73 -0
- package/lib/helpers/show-modal-dialog.d.ts +73 -0
- package/lib/helpers/show-overlay-box.d.cts +53 -0
- package/lib/helpers/show-overlay-box.d.ts +53 -0
- package/lib/helpers/show-screen-loading.d.cts +20 -0
- package/lib/helpers/show-screen-loading.d.ts +20 -0
- package/lib/helpers/show-snackbar.d.cts +47 -0
- package/lib/helpers/show-snackbar.d.ts +47 -0
- package/lib/hourglass-loading.d.cts +1 -1
- package/lib/hourglass-loading.d.ts +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +34 -0
- package/lib/index.d.ts +34 -0
- package/lib/index.js +445 -18
- package/lib/internal/anchored-popover.d.cts +35 -0
- package/lib/internal/anchored-popover.d.ts +35 -0
- package/lib/internal/anchored-position.d.cts +50 -0
- package/lib/internal/anchored-position.d.ts +50 -0
- package/lib/internal/data-table-controls.d.cts +42 -0
- package/lib/internal/data-table-controls.d.ts +42 -0
- package/lib/internal/data-table-value.d.cts +32 -0
- package/lib/internal/data-table-value.d.ts +32 -0
- package/lib/internal/floating-component.d.cts +52 -0
- package/lib/internal/floating-component.d.ts +52 -0
- package/lib/internal/icon-popper.d.cts +32 -0
- package/lib/internal/icon-popper.d.ts +32 -0
- package/lib/internal/mount-window.d.cts +39 -0
- package/lib/internal/mount-window.d.ts +39 -0
- package/lib/internal/movable-window.d.cts +55 -0
- package/lib/internal/movable-window.d.ts +55 -0
- package/lib/internal/opened-overlay-boxes.d.cts +2 -0
- package/lib/internal/opened-overlay-boxes.d.ts +2 -0
- package/lib/internal/pagination.d.cts +22 -0
- package/lib/internal/pagination.d.ts +22 -0
- package/lib/internal/snackbar-container.d.cts +20 -0
- package/lib/internal/snackbar-container.d.ts +20 -0
- package/lib/internal/snackbar-item.d.cts +17 -0
- package/lib/internal/snackbar-item.d.ts +17 -0
- package/lib/internal/tab-group-context.d.cts +4 -2
- package/lib/internal/tab-group-context.d.ts +4 -2
- package/lib/internal/use-movable-window.d.cts +44 -0
- package/lib/internal/use-movable-window.d.ts +44 -0
- package/lib/internal/window-order.d.cts +6 -0
- package/lib/internal/window-order.d.ts +6 -0
- package/lib/intersection-lazy-component.d.cts +32 -0
- package/lib/intersection-lazy-component.d.ts +32 -0
- package/lib/label-button.d.cts +2 -2
- package/lib/label-button.d.ts +2 -2
- package/lib/label-icon.d.cts +2 -2
- package/lib/label-icon.d.ts +2 -2
- package/lib/modal-dialog.d.cts +67 -0
- package/lib/modal-dialog.d.ts +67 -0
- package/lib/nuxt.cjs +1 -1
- package/lib/nuxt.js +1 -1
- package/lib/overlay-box.d.cts +52 -0
- package/lib/overlay-box.d.ts +52 -0
- package/lib/page-section.d.cts +2 -2
- package/lib/page-section.d.ts +2 -2
- package/lib/page-title.d.cts +2 -2
- package/lib/page-title.d.ts +2 -2
- package/lib/register.cjs +1 -1
- package/lib/register.js +1 -1
- package/lib/screen-loading.d.cts +7 -0
- package/lib/screen-loading.d.ts +7 -0
- package/lib/style.css +1 -1
- package/lib/tab-content.d.cts +5 -5
- package/lib/tab-content.d.ts +5 -5
- package/lib/tab-group.d.cts +7 -10
- package/lib/tab-group.d.ts +7 -10
- package/lib/types/data-table.d.cts +185 -0
- package/lib/types/data-table.d.ts +185 -0
- package/lib/types/modal-dialog.d.cts +13 -0
- package/lib/types/modal-dialog.d.ts +13 -0
- package/lib/types/movable-window.d.cts +16 -0
- package/lib/types/movable-window.d.ts +16 -0
- package/lib/warning-popper.d.cts +39 -0
- package/lib/warning-popper.d.ts +39 -0
- package/lib/warning-popper.vue_vue_type_style_index_0_lang-BKV_FX6k.js +1837 -0
- package/lib/warning-popper.vue_vue_type_style_index_0_lang-CHmkjVCO.cjs +1 -0
- package/package.json +40 -14
- package/src/accordion-fieldset.vue +24 -19
- package/src/accordion-section.vue +33 -28
- package/src/components.ts +10 -0
- package/src/copy-button.vue +89 -0
- package/src/dark-mode-selector.vue +212 -0
- package/src/data-table.vue +648 -0
- package/src/help-button.vue +128 -0
- package/src/help-popper.vue +70 -0
- package/src/helpers/data-table-csv.ts +55 -0
- package/src/helpers/show-floating-component.ts +177 -0
- package/src/helpers/show-modal-dialog.ts +121 -0
- package/src/helpers/show-overlay-box.ts +106 -0
- package/src/helpers/show-screen-loading.ts +37 -0
- package/src/helpers/show-snackbar.ts +153 -0
- package/src/hourglass-loading.vue +1 -1
- package/src/index.ts +34 -0
- package/src/internal/anchored-popover.vue +192 -0
- package/src/internal/anchored-position.ts +135 -0
- package/src/internal/data-table-controls.vue +203 -0
- package/src/internal/data-table-value.ts +99 -0
- package/src/internal/floating-component.vue +202 -0
- package/src/internal/icon-popper.vue +185 -0
- package/src/internal/mount-window.ts +110 -0
- package/src/internal/movable-window.vue +315 -0
- package/src/internal/opened-overlay-boxes.ts +2 -0
- package/src/internal/pagination.vue +325 -0
- package/src/internal/snackbar-container.vue +258 -0
- package/src/internal/snackbar-item.ts +20 -0
- package/src/internal/tab-group-context.ts +4 -2
- package/src/internal/use-movable-window.ts +208 -0
- package/src/internal/window-order.ts +11 -0
- package/src/intersection-lazy-component.vue +84 -0
- package/src/label-button.vue +9 -6
- package/src/label-icon.vue +2 -2
- package/src/modal-dialog.vue +287 -0
- package/src/overlay-box.vue +218 -0
- package/src/page-section.vue +7 -7
- package/src/page-title.vue +4 -4
- package/src/screen-loading.vue +90 -0
- package/src/tab-content.vue +16 -15
- package/src/tab-group.vue +34 -36
- package/src/types/data-table.ts +196 -0
- package/src/types/modal-dialog.ts +16 -0
- package/src/types/movable-window.ts +18 -0
- package/src/warning-popper.vue +70 -0
- package/lib/accordion-fieldset.cjs +0 -1
- package/lib/accordion-fieldset.js +0 -4
- package/lib/accordion-fieldset.vue_vue_type_style_index_0_lang-Cf4czDXz.js +0 -66
- package/lib/accordion-fieldset.vue_vue_type_style_index_0_lang-DoM5QjpJ.cjs +0 -1
- package/lib/accordion-section.cjs +0 -1
- package/lib/accordion-section.js +0 -4
- package/lib/accordion-section.vue_vue_type_style_index_0_lang-CFDdUEnn.cjs +0 -1
- package/lib/accordion-section.vue_vue_type_style_index_0_lang-Gvjjx02P.js +0 -78
- package/lib/components-C63HJoCn.cjs +0 -1
- package/lib/components-q4Cf97bO.js +0 -24
- package/lib/hourglass-loading.cjs +0 -1
- package/lib/hourglass-loading.js +0 -4
- package/lib/hourglass-loading.vue_vue_type_style_index_0_lang-C72UVA9W.cjs +0 -1
- package/lib/hourglass-loading.vue_vue_type_style_index_0_lang-DkUGIxQ2.js +0 -22
- package/lib/label-button.cjs +0 -1
- package/lib/label-button.js +0 -4
- package/lib/label-button.vue_vue_type_style_index_0_lang-D7ZgfZOL.cjs +0 -1
- package/lib/label-button.vue_vue_type_style_index_0_lang-DqRYddVt.js +0 -44
- package/lib/label-icon.cjs +0 -1
- package/lib/label-icon.js +0 -4
- package/lib/label-icon.vue_vue_type_style_index_0_lang-D9Cimu20.cjs +0 -1
- package/lib/label-icon.vue_vue_type_style_index_0_lang-me52HE2V.js +0 -38
- package/lib/page-section.cjs +0 -1
- package/lib/page-section.js +0 -4
- package/lib/page-section.vue_vue_type_style_index_0_lang-DEAkTLxd.cjs +0 -1
- package/lib/page-section.vue_vue_type_style_index_0_lang-DpVQe_rV.js +0 -54
- package/lib/page-title.cjs +0 -1
- package/lib/page-title.js +0 -4
- package/lib/page-title.vue_vue_type_style_index_0_lang-BqIsIks5.cjs +0 -1
- package/lib/page-title.vue_vue_type_style_index_0_lang-ChZot85K.js +0 -36
- package/lib/tab-content.cjs +0 -1
- package/lib/tab-content.js +0 -4
- package/lib/tab-content.vue_vue_type_style_index_0_lang-BeCi7Xkp.cjs +0 -1
- package/lib/tab-content.vue_vue_type_style_index_0_lang-CcQLHmIF.js +0 -44
- package/lib/tab-group.cjs +0 -1
- package/lib/tab-group.js +0 -4
- package/lib/tab-group.vue_vue_type_style_index_0_lang-C84mDEOC.js +0 -103
- package/lib/tab-group.vue_vue_type_style_index_0_lang-CMaufRJV.cjs +0 -1
- package/lib/use-shrinkable-CS2bmsJJ.js +0 -17
- package/lib/use-shrinkable-Cu9JQZll.cjs +0 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { PopoverPlacement } from './internal/anchored-position';
|
|
2
|
+
export interface Props {
|
|
3
|
+
/** ボタンに対するパネルの表示位置。収まらないときは反対側に出す */
|
|
4
|
+
placement?: PopoverPlacement;
|
|
5
|
+
/** ボタンを指す矢印をパネルに付ける */
|
|
6
|
+
arrow?: boolean;
|
|
7
|
+
/** ボタンの読み上げ名。aria-label 属性を渡したときはそちらが優先される */
|
|
8
|
+
label?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface Emits {
|
|
11
|
+
(e: 'emit:open'): void;
|
|
12
|
+
(e: 'emit:close'): void;
|
|
13
|
+
}
|
|
14
|
+
export interface Slots {
|
|
15
|
+
/** ボタンのアイコン */
|
|
16
|
+
icon?(): unknown;
|
|
17
|
+
/** パネルに表示する中身 */
|
|
18
|
+
default?(): unknown;
|
|
19
|
+
}
|
|
20
|
+
type __VLS_Slots = Slots;
|
|
21
|
+
declare const __VLS_base: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
22
|
+
"emit:open": () => any;
|
|
23
|
+
"emit:close": () => any;
|
|
24
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
25
|
+
"onEmit:open"?: (() => any) | undefined;
|
|
26
|
+
"onEmit:close"?: (() => any) | undefined;
|
|
27
|
+
}>, {
|
|
28
|
+
label: string;
|
|
29
|
+
placement: PopoverPlacement;
|
|
30
|
+
arrow: boolean;
|
|
31
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
32
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
33
|
+
declare const _default: typeof __VLS_export;
|
|
34
|
+
export default _default;
|
|
35
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
36
|
+
new (): {
|
|
37
|
+
$slots: S;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { PopoverPlacement } from './internal/anchored-position.cjs';
|
|
2
|
+
export interface Props {
|
|
3
|
+
/** アイコンに対するパネルの表示位置。収まらないときは反対側に出す */
|
|
4
|
+
placement?: PopoverPlacement;
|
|
5
|
+
/** アイコンを指す矢印をパネルに付ける */
|
|
6
|
+
arrow?: boolean;
|
|
7
|
+
/** アイコンの読み上げ名 */
|
|
8
|
+
label?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface Emits {
|
|
11
|
+
(e: 'emit:open'): void;
|
|
12
|
+
(e: 'emit:close'): void;
|
|
13
|
+
}
|
|
14
|
+
export interface Slots {
|
|
15
|
+
/** アイコン */
|
|
16
|
+
icon?(): unknown;
|
|
17
|
+
/** パネルに表示する中身 */
|
|
18
|
+
default?(): unknown;
|
|
19
|
+
}
|
|
20
|
+
type __VLS_Slots = Slots;
|
|
21
|
+
declare const __VLS_base: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
22
|
+
"emit:open": () => any;
|
|
23
|
+
"emit:close": () => any;
|
|
24
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
25
|
+
"onEmit:open"?: (() => any) | undefined;
|
|
26
|
+
"onEmit:close"?: (() => any) | undefined;
|
|
27
|
+
}>, {
|
|
28
|
+
label: string;
|
|
29
|
+
placement: PopoverPlacement;
|
|
30
|
+
arrow: boolean;
|
|
31
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
32
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
33
|
+
declare const _default: typeof __VLS_export;
|
|
34
|
+
export default _default;
|
|
35
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
36
|
+
new (): {
|
|
37
|
+
$slots: S;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { PopoverPlacement } from './internal/anchored-position';
|
|
2
|
+
export interface Props {
|
|
3
|
+
/** アイコンに対するパネルの表示位置。収まらないときは反対側に出す */
|
|
4
|
+
placement?: PopoverPlacement;
|
|
5
|
+
/** アイコンを指す矢印をパネルに付ける */
|
|
6
|
+
arrow?: boolean;
|
|
7
|
+
/** アイコンの読み上げ名 */
|
|
8
|
+
label?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface Emits {
|
|
11
|
+
(e: 'emit:open'): void;
|
|
12
|
+
(e: 'emit:close'): void;
|
|
13
|
+
}
|
|
14
|
+
export interface Slots {
|
|
15
|
+
/** アイコン */
|
|
16
|
+
icon?(): unknown;
|
|
17
|
+
/** パネルに表示する中身 */
|
|
18
|
+
default?(): unknown;
|
|
19
|
+
}
|
|
20
|
+
type __VLS_Slots = Slots;
|
|
21
|
+
declare const __VLS_base: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
22
|
+
"emit:open": () => any;
|
|
23
|
+
"emit:close": () => any;
|
|
24
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
25
|
+
"onEmit:open"?: (() => any) | undefined;
|
|
26
|
+
"onEmit:close"?: (() => any) | undefined;
|
|
27
|
+
}>, {
|
|
28
|
+
label: string;
|
|
29
|
+
placement: PopoverPlacement;
|
|
30
|
+
arrow: boolean;
|
|
31
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
32
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
33
|
+
declare const _default: typeof __VLS_export;
|
|
34
|
+
export default _default;
|
|
35
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
36
|
+
new (): {
|
|
37
|
+
$slots: S;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DataTableHeader } from '../types/data-table.cjs';
|
|
2
|
+
/**
|
|
3
|
+
* ヘッダの csv の定義から CSV の列名を作る
|
|
4
|
+
*
|
|
5
|
+
* @param {DataTableHeader<T>[]} headers
|
|
6
|
+
* @returns {string[]} 列名
|
|
7
|
+
*/
|
|
8
|
+
export declare const headersToCsvColumns: <T>(headers: DataTableHeader<T>[]) => string[];
|
|
9
|
+
/**
|
|
10
|
+
* ヘッダの csv の定義に従って行から CSV の列の値を取り出す
|
|
11
|
+
*
|
|
12
|
+
* @param {DataTableHeader<T>[]} headers
|
|
13
|
+
* @param {T} row
|
|
14
|
+
* @param {number} [rowNumber] key が '$index' の列に出力する行番号
|
|
15
|
+
* @returns {unknown[]} 列の値。文字列化はしない
|
|
16
|
+
*/
|
|
17
|
+
export declare const rowToCsvColumns: <T>(headers: DataTableHeader<T>[], row: T, rowNumber?: number) => unknown[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DataTableHeader } from '../types/data-table';
|
|
2
|
+
/**
|
|
3
|
+
* ヘッダの csv の定義から CSV の列名を作る
|
|
4
|
+
*
|
|
5
|
+
* @param {DataTableHeader<T>[]} headers
|
|
6
|
+
* @returns {string[]} 列名
|
|
7
|
+
*/
|
|
8
|
+
export declare const headersToCsvColumns: <T>(headers: DataTableHeader<T>[]) => string[];
|
|
9
|
+
/**
|
|
10
|
+
* ヘッダの csv の定義に従って行から CSV の列の値を取り出す
|
|
11
|
+
*
|
|
12
|
+
* @param {DataTableHeader<T>[]} headers
|
|
13
|
+
* @param {T} row
|
|
14
|
+
* @param {number} [rowNumber] key が '$index' の列に出力する行番号
|
|
15
|
+
* @returns {unknown[]} 列の値。文字列化はしない
|
|
16
|
+
*/
|
|
17
|
+
export declare const rowToCsvColumns: <T>(headers: DataTableHeader<T>[], row: T, rowNumber?: number) => unknown[];
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { AppContext, ClassValue, Component, StyleValue } from 'vue';
|
|
2
|
+
import { MovableWindowContentProps, MovableWindowDragMode, MovableWindowHandle } from '../types/movable-window.cjs';
|
|
3
|
+
/** showFloatingComponent が中身のコンポーネントに props として渡す関数 */
|
|
4
|
+
export type FloatingComponentContentProps = MovableWindowContentProps;
|
|
5
|
+
/** showFloatingComponent / showFloatingMessage が返す、表示中のウィンドウを操作するためのハンドル */
|
|
6
|
+
export type FloatingComponentHandle = MovableWindowHandle;
|
|
7
|
+
export interface ShowFloatingComponentOptions {
|
|
8
|
+
/** 見出し */
|
|
9
|
+
title?: string;
|
|
10
|
+
/** この要素の下に開く。下に収まらなければ上に開く。未指定ならページの表示中の左上に開く */
|
|
11
|
+
anchor?: HTMLElement;
|
|
12
|
+
/** ドラッグで移動するときに掴む範囲 */
|
|
13
|
+
dragMode?: MovableWindowDragMode;
|
|
14
|
+
/** 閉じるボタンの読み上げ名 */
|
|
15
|
+
closeLabel?: string;
|
|
16
|
+
/** 見出しにコピーボタンを置き、この値をコピーする。関数を渡すとクリック時に呼び出して値を得る */
|
|
17
|
+
copyValue?: string | number | (() => string | number);
|
|
18
|
+
/** コピーボタンの読み上げ名 */
|
|
19
|
+
copyLabel?: string;
|
|
20
|
+
/** ウィンドウのダブルクリックで閉じる */
|
|
21
|
+
closeOnDblClick?: boolean;
|
|
22
|
+
/** 開いている間、背面のページをスクロールさせない */
|
|
23
|
+
lockScroll?: boolean;
|
|
24
|
+
/** 初期の幅・高さ(px) */
|
|
25
|
+
initialSize?: {
|
|
26
|
+
width?: number;
|
|
27
|
+
height?: number;
|
|
28
|
+
};
|
|
29
|
+
/** ウィンドウに付けるクラス */
|
|
30
|
+
class?: ClassValue;
|
|
31
|
+
/** ウィンドウに付けるスタイル */
|
|
32
|
+
style?: StyleValue;
|
|
33
|
+
/** 見出しに付けるクラス */
|
|
34
|
+
headerClass?: ClassValue;
|
|
35
|
+
/** 見出しに付けるスタイル */
|
|
36
|
+
headerStyle?: StyleValue;
|
|
37
|
+
/**
|
|
38
|
+
* 中身のコンポーネントに引き継ぐアプリのコンテキスト。
|
|
39
|
+
* 中身でアプリに登録したプラグイン・コンポーネント・provide を使う場合に渡す
|
|
40
|
+
*/
|
|
41
|
+
appContext?: AppContext;
|
|
42
|
+
/** ウィンドウが閉じ終わって取り外されたときに呼ぶ関数。ハンドル・利用者の操作・closeAllFloatingComponents のどれで閉じても呼ぶ */
|
|
43
|
+
onClose?: () => void;
|
|
44
|
+
}
|
|
45
|
+
export interface ShowFloatingMessageOptions extends ShowFloatingComponentOptions {
|
|
46
|
+
/** trueを指定した場合、文字列をHTMLとして表示する。オブジェクトには影響しない */
|
|
47
|
+
html?: boolean;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* FloatingComponent を body の末尾に描画し、中身にコンポーネントを表示する。
|
|
51
|
+
* 中身のコンポーネントには、渡した props に加えて close と setLoading を props として渡す。
|
|
52
|
+
* ブラウザでのみ動作する
|
|
53
|
+
*
|
|
54
|
+
* @param {Component} component 中身に表示するコンポーネント
|
|
55
|
+
* @param {Record<string, unknown>} [props] 中身のコンポーネントに渡す props
|
|
56
|
+
* @param {ShowFloatingComponentOptions} [options]
|
|
57
|
+
* @returns {FloatingComponentHandle}
|
|
58
|
+
*/
|
|
59
|
+
export declare function showFloatingComponent(component: Component, props?: Record<string, unknown>, options?: ShowFloatingComponentOptions): FloatingComponentHandle;
|
|
60
|
+
/**
|
|
61
|
+
* FloatingComponent を body の末尾に描画し、中身に文字列を表示する。
|
|
62
|
+
* 文字列は改行や空白をそのまま表示し、html を指定すれば HTML として表示する。オブジェクトは整形した JSON で表示する。
|
|
63
|
+
* 見出しのコピーボタンは、copyValue を指定しなければ渡した文字列をコピーする。
|
|
64
|
+
* ブラウザでのみ動作する
|
|
65
|
+
*
|
|
66
|
+
* @param {string | object} message 表示する文字列またはオブジェクト
|
|
67
|
+
* @param {ShowFloatingMessageOptions} [options]
|
|
68
|
+
* @returns {FloatingComponentHandle}
|
|
69
|
+
*/
|
|
70
|
+
export declare function showFloatingMessage(message: string | object, options?: ShowFloatingMessageOptions): FloatingComponentHandle;
|
|
71
|
+
/**
|
|
72
|
+
* 開いている FloatingComponent をすべて閉じる
|
|
73
|
+
*/
|
|
74
|
+
export declare function closeAllFloatingComponents(): void;
|
|
75
|
+
/**
|
|
76
|
+
* 呼び出したコンポーネントに結び付けて FloatingComponent を開く関数を返す。
|
|
77
|
+
* 開いたウィンドウは、呼び出したコンポーネントがアンマウントされると閉じる。
|
|
78
|
+
* appContext を指定しなければ、呼び出したコンポーネントのアプリのコンテキストを中身に引き継ぐ。
|
|
79
|
+
* コンポーネントの setup の中で呼ぶこと
|
|
80
|
+
*
|
|
81
|
+
* @returns {{ showFloatingComponent: typeof showFloatingComponent; showFloatingMessage: typeof showFloatingMessage }}
|
|
82
|
+
*/
|
|
83
|
+
export declare function useFloatingComponent(): {
|
|
84
|
+
showFloatingComponent: typeof showFloatingComponent;
|
|
85
|
+
showFloatingMessage: typeof showFloatingMessage;
|
|
86
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { AppContext, ClassValue, Component, StyleValue } from 'vue';
|
|
2
|
+
import { MovableWindowContentProps, MovableWindowDragMode, MovableWindowHandle } from '../types/movable-window';
|
|
3
|
+
/** showFloatingComponent が中身のコンポーネントに props として渡す関数 */
|
|
4
|
+
export type FloatingComponentContentProps = MovableWindowContentProps;
|
|
5
|
+
/** showFloatingComponent / showFloatingMessage が返す、表示中のウィンドウを操作するためのハンドル */
|
|
6
|
+
export type FloatingComponentHandle = MovableWindowHandle;
|
|
7
|
+
export interface ShowFloatingComponentOptions {
|
|
8
|
+
/** 見出し */
|
|
9
|
+
title?: string;
|
|
10
|
+
/** この要素の下に開く。下に収まらなければ上に開く。未指定ならページの表示中の左上に開く */
|
|
11
|
+
anchor?: HTMLElement;
|
|
12
|
+
/** ドラッグで移動するときに掴む範囲 */
|
|
13
|
+
dragMode?: MovableWindowDragMode;
|
|
14
|
+
/** 閉じるボタンの読み上げ名 */
|
|
15
|
+
closeLabel?: string;
|
|
16
|
+
/** 見出しにコピーボタンを置き、この値をコピーする。関数を渡すとクリック時に呼び出して値を得る */
|
|
17
|
+
copyValue?: string | number | (() => string | number);
|
|
18
|
+
/** コピーボタンの読み上げ名 */
|
|
19
|
+
copyLabel?: string;
|
|
20
|
+
/** ウィンドウのダブルクリックで閉じる */
|
|
21
|
+
closeOnDblClick?: boolean;
|
|
22
|
+
/** 開いている間、背面のページをスクロールさせない */
|
|
23
|
+
lockScroll?: boolean;
|
|
24
|
+
/** 初期の幅・高さ(px) */
|
|
25
|
+
initialSize?: {
|
|
26
|
+
width?: number;
|
|
27
|
+
height?: number;
|
|
28
|
+
};
|
|
29
|
+
/** ウィンドウに付けるクラス */
|
|
30
|
+
class?: ClassValue;
|
|
31
|
+
/** ウィンドウに付けるスタイル */
|
|
32
|
+
style?: StyleValue;
|
|
33
|
+
/** 見出しに付けるクラス */
|
|
34
|
+
headerClass?: ClassValue;
|
|
35
|
+
/** 見出しに付けるスタイル */
|
|
36
|
+
headerStyle?: StyleValue;
|
|
37
|
+
/**
|
|
38
|
+
* 中身のコンポーネントに引き継ぐアプリのコンテキスト。
|
|
39
|
+
* 中身でアプリに登録したプラグイン・コンポーネント・provide を使う場合に渡す
|
|
40
|
+
*/
|
|
41
|
+
appContext?: AppContext;
|
|
42
|
+
/** ウィンドウが閉じ終わって取り外されたときに呼ぶ関数。ハンドル・利用者の操作・closeAllFloatingComponents のどれで閉じても呼ぶ */
|
|
43
|
+
onClose?: () => void;
|
|
44
|
+
}
|
|
45
|
+
export interface ShowFloatingMessageOptions extends ShowFloatingComponentOptions {
|
|
46
|
+
/** trueを指定した場合、文字列をHTMLとして表示する。オブジェクトには影響しない */
|
|
47
|
+
html?: boolean;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* FloatingComponent を body の末尾に描画し、中身にコンポーネントを表示する。
|
|
51
|
+
* 中身のコンポーネントには、渡した props に加えて close と setLoading を props として渡す。
|
|
52
|
+
* ブラウザでのみ動作する
|
|
53
|
+
*
|
|
54
|
+
* @param {Component} component 中身に表示するコンポーネント
|
|
55
|
+
* @param {Record<string, unknown>} [props] 中身のコンポーネントに渡す props
|
|
56
|
+
* @param {ShowFloatingComponentOptions} [options]
|
|
57
|
+
* @returns {FloatingComponentHandle}
|
|
58
|
+
*/
|
|
59
|
+
export declare function showFloatingComponent(component: Component, props?: Record<string, unknown>, options?: ShowFloatingComponentOptions): FloatingComponentHandle;
|
|
60
|
+
/**
|
|
61
|
+
* FloatingComponent を body の末尾に描画し、中身に文字列を表示する。
|
|
62
|
+
* 文字列は改行や空白をそのまま表示し、html を指定すれば HTML として表示する。オブジェクトは整形した JSON で表示する。
|
|
63
|
+
* 見出しのコピーボタンは、copyValue を指定しなければ渡した文字列をコピーする。
|
|
64
|
+
* ブラウザでのみ動作する
|
|
65
|
+
*
|
|
66
|
+
* @param {string | object} message 表示する文字列またはオブジェクト
|
|
67
|
+
* @param {ShowFloatingMessageOptions} [options]
|
|
68
|
+
* @returns {FloatingComponentHandle}
|
|
69
|
+
*/
|
|
70
|
+
export declare function showFloatingMessage(message: string | object, options?: ShowFloatingMessageOptions): FloatingComponentHandle;
|
|
71
|
+
/**
|
|
72
|
+
* 開いている FloatingComponent をすべて閉じる
|
|
73
|
+
*/
|
|
74
|
+
export declare function closeAllFloatingComponents(): void;
|
|
75
|
+
/**
|
|
76
|
+
* 呼び出したコンポーネントに結び付けて FloatingComponent を開く関数を返す。
|
|
77
|
+
* 開いたウィンドウは、呼び出したコンポーネントがアンマウントされると閉じる。
|
|
78
|
+
* appContext を指定しなければ、呼び出したコンポーネントのアプリのコンテキストを中身に引き継ぐ。
|
|
79
|
+
* コンポーネントの setup の中で呼ぶこと
|
|
80
|
+
*
|
|
81
|
+
* @returns {{ showFloatingComponent: typeof showFloatingComponent; showFloatingMessage: typeof showFloatingMessage }}
|
|
82
|
+
*/
|
|
83
|
+
export declare function useFloatingComponent(): {
|
|
84
|
+
showFloatingComponent: typeof showFloatingComponent;
|
|
85
|
+
showFloatingMessage: typeof showFloatingMessage;
|
|
86
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { AppContext, ClassValue, Component, StyleValue } from 'vue';
|
|
2
|
+
import { ModalDialogButton, ModalDialogImage, ModalDialogResult, ModalDialogType } from '../types/modal-dialog.cjs';
|
|
3
|
+
export interface ShowModalDialogOptions {
|
|
4
|
+
/** ダイアログの種類 */
|
|
5
|
+
type?: ModalDialogType;
|
|
6
|
+
/** 見出し */
|
|
7
|
+
title?: string;
|
|
8
|
+
/** true の場合、見出しとメッセージを HTML として表示する */
|
|
9
|
+
html?: boolean;
|
|
10
|
+
/** メッセージの下に並べる画像 */
|
|
11
|
+
image?: ModalDialogImage | ModalDialogImage[];
|
|
12
|
+
/** 種類ごとのアイコンに代えて表示するコンポーネント */
|
|
13
|
+
icon?: Component;
|
|
14
|
+
/** 左から順に並べるボタン。未指定なら confirm は Yes と No、それ以外は OK */
|
|
15
|
+
buttons?: ModalDialogButton[];
|
|
16
|
+
/** OK ボタンの文字 */
|
|
17
|
+
okLabel?: string;
|
|
18
|
+
/** Yes ボタンの文字 */
|
|
19
|
+
yesLabel?: string;
|
|
20
|
+
/** No ボタンの文字 */
|
|
21
|
+
noLabel?: string;
|
|
22
|
+
/** Cancel ボタンの文字 */
|
|
23
|
+
cancelLabel?: string;
|
|
24
|
+
/** ダイアログに付けるクラス */
|
|
25
|
+
class?: ClassValue;
|
|
26
|
+
/** ダイアログに付けるスタイル */
|
|
27
|
+
style?: StyleValue;
|
|
28
|
+
/**
|
|
29
|
+
* icon のコンポーネントに引き継ぐアプリのコンテキスト。
|
|
30
|
+
* icon でアプリに登録したプラグイン・コンポーネント・provide を使う場合に渡す
|
|
31
|
+
*/
|
|
32
|
+
appContext?: AppContext;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* ModalDialog を body の末尾に描画して開き、閉じたら取り外す。ブラウザでのみ動作する
|
|
36
|
+
*
|
|
37
|
+
* @param {string | string[]} message 表示する文字列。配列なら1要素を1段落として表示する
|
|
38
|
+
* @param {ShowModalDialogOptions} [options]
|
|
39
|
+
* @returns {Promise<ModalDialogResult>} 閉じたボタン
|
|
40
|
+
*/
|
|
41
|
+
export declare function showModalDialog(message: string | string[], options?: ShowModalDialogOptions): Promise<ModalDialogResult>;
|
|
42
|
+
/**
|
|
43
|
+
* 情報を伝えるダイアログを開く
|
|
44
|
+
*
|
|
45
|
+
* @param {string | string[]} message 表示する文字列
|
|
46
|
+
* @param {Omit<ShowModalDialogOptions, 'type'>} [options]
|
|
47
|
+
* @returns {Promise<ModalDialogResult>} 閉じたボタン
|
|
48
|
+
*/
|
|
49
|
+
export declare function showInformationDialog(message: string | string[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
|
|
50
|
+
/**
|
|
51
|
+
* Yes / No を尋ねるダイアログを開く
|
|
52
|
+
*
|
|
53
|
+
* @param {string | string[]} message 表示する文字列
|
|
54
|
+
* @param {Omit<ShowModalDialogOptions, 'type'>} [options]
|
|
55
|
+
* @returns {Promise<ModalDialogResult>} 閉じたボタン
|
|
56
|
+
*/
|
|
57
|
+
export declare function showConfirmationDialog(message: string | string[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
|
|
58
|
+
/**
|
|
59
|
+
* 警告のダイアログを開く
|
|
60
|
+
*
|
|
61
|
+
* @param {string | string[]} message 表示する文字列
|
|
62
|
+
* @param {Omit<ShowModalDialogOptions, 'type'>} [options]
|
|
63
|
+
* @returns {Promise<ModalDialogResult>} 閉じたボタン
|
|
64
|
+
*/
|
|
65
|
+
export declare function showWarningDialog(message: string | string[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
|
|
66
|
+
/**
|
|
67
|
+
* エラーのダイアログを開く
|
|
68
|
+
*
|
|
69
|
+
* @param {string | string[]} message 表示する文字列
|
|
70
|
+
* @param {Omit<ShowModalDialogOptions, 'type'>} [options]
|
|
71
|
+
* @returns {Promise<ModalDialogResult>} 閉じたボタン
|
|
72
|
+
*/
|
|
73
|
+
export declare function showErrorDialog(message: string | string[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { AppContext, ClassValue, Component, StyleValue } from 'vue';
|
|
2
|
+
import { ModalDialogButton, ModalDialogImage, ModalDialogResult, ModalDialogType } from '../types/modal-dialog';
|
|
3
|
+
export interface ShowModalDialogOptions {
|
|
4
|
+
/** ダイアログの種類 */
|
|
5
|
+
type?: ModalDialogType;
|
|
6
|
+
/** 見出し */
|
|
7
|
+
title?: string;
|
|
8
|
+
/** true の場合、見出しとメッセージを HTML として表示する */
|
|
9
|
+
html?: boolean;
|
|
10
|
+
/** メッセージの下に並べる画像 */
|
|
11
|
+
image?: ModalDialogImage | ModalDialogImage[];
|
|
12
|
+
/** 種類ごとのアイコンに代えて表示するコンポーネント */
|
|
13
|
+
icon?: Component;
|
|
14
|
+
/** 左から順に並べるボタン。未指定なら confirm は Yes と No、それ以外は OK */
|
|
15
|
+
buttons?: ModalDialogButton[];
|
|
16
|
+
/** OK ボタンの文字 */
|
|
17
|
+
okLabel?: string;
|
|
18
|
+
/** Yes ボタンの文字 */
|
|
19
|
+
yesLabel?: string;
|
|
20
|
+
/** No ボタンの文字 */
|
|
21
|
+
noLabel?: string;
|
|
22
|
+
/** Cancel ボタンの文字 */
|
|
23
|
+
cancelLabel?: string;
|
|
24
|
+
/** ダイアログに付けるクラス */
|
|
25
|
+
class?: ClassValue;
|
|
26
|
+
/** ダイアログに付けるスタイル */
|
|
27
|
+
style?: StyleValue;
|
|
28
|
+
/**
|
|
29
|
+
* icon のコンポーネントに引き継ぐアプリのコンテキスト。
|
|
30
|
+
* icon でアプリに登録したプラグイン・コンポーネント・provide を使う場合に渡す
|
|
31
|
+
*/
|
|
32
|
+
appContext?: AppContext;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* ModalDialog を body の末尾に描画して開き、閉じたら取り外す。ブラウザでのみ動作する
|
|
36
|
+
*
|
|
37
|
+
* @param {string | string[]} message 表示する文字列。配列なら1要素を1段落として表示する
|
|
38
|
+
* @param {ShowModalDialogOptions} [options]
|
|
39
|
+
* @returns {Promise<ModalDialogResult>} 閉じたボタン
|
|
40
|
+
*/
|
|
41
|
+
export declare function showModalDialog(message: string | string[], options?: ShowModalDialogOptions): Promise<ModalDialogResult>;
|
|
42
|
+
/**
|
|
43
|
+
* 情報を伝えるダイアログを開く
|
|
44
|
+
*
|
|
45
|
+
* @param {string | string[]} message 表示する文字列
|
|
46
|
+
* @param {Omit<ShowModalDialogOptions, 'type'>} [options]
|
|
47
|
+
* @returns {Promise<ModalDialogResult>} 閉じたボタン
|
|
48
|
+
*/
|
|
49
|
+
export declare function showInformationDialog(message: string | string[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
|
|
50
|
+
/**
|
|
51
|
+
* Yes / No を尋ねるダイアログを開く
|
|
52
|
+
*
|
|
53
|
+
* @param {string | string[]} message 表示する文字列
|
|
54
|
+
* @param {Omit<ShowModalDialogOptions, 'type'>} [options]
|
|
55
|
+
* @returns {Promise<ModalDialogResult>} 閉じたボタン
|
|
56
|
+
*/
|
|
57
|
+
export declare function showConfirmationDialog(message: string | string[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
|
|
58
|
+
/**
|
|
59
|
+
* 警告のダイアログを開く
|
|
60
|
+
*
|
|
61
|
+
* @param {string | string[]} message 表示する文字列
|
|
62
|
+
* @param {Omit<ShowModalDialogOptions, 'type'>} [options]
|
|
63
|
+
* @returns {Promise<ModalDialogResult>} 閉じたボタン
|
|
64
|
+
*/
|
|
65
|
+
export declare function showWarningDialog(message: string | string[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
|
|
66
|
+
/**
|
|
67
|
+
* エラーのダイアログを開く
|
|
68
|
+
*
|
|
69
|
+
* @param {string | string[]} message 表示する文字列
|
|
70
|
+
* @param {Omit<ShowModalDialogOptions, 'type'>} [options]
|
|
71
|
+
* @returns {Promise<ModalDialogResult>} 閉じたボタン
|
|
72
|
+
*/
|
|
73
|
+
export declare function showErrorDialog(message: string | string[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { AppContext, ClassValue, Component, StyleValue } from 'vue';
|
|
2
|
+
import { MovableWindowContentProps, MovableWindowDragMode, MovableWindowHandle } from '../types/movable-window.cjs';
|
|
3
|
+
/** showOverlayBox が中身のコンポーネントに props として渡す関数 */
|
|
4
|
+
export type OverlayBoxContentProps = MovableWindowContentProps;
|
|
5
|
+
/** showOverlayBox が返す、表示中のボックスを操作するためのハンドル */
|
|
6
|
+
export type OverlayBoxHandle = MovableWindowHandle;
|
|
7
|
+
export interface ShowOverlayBoxOptions {
|
|
8
|
+
/** 見出し */
|
|
9
|
+
title?: string;
|
|
10
|
+
/** ドラッグで移動するときに掴む範囲 */
|
|
11
|
+
dragMode?: MovableWindowDragMode;
|
|
12
|
+
/** 暗幕のクリックで閉じる */
|
|
13
|
+
closeOnBackdrop?: boolean;
|
|
14
|
+
/** 閉じるボタンの読み上げ名 */
|
|
15
|
+
closeLabel?: string;
|
|
16
|
+
/** ボックスのルート要素に付けるクラス */
|
|
17
|
+
class?: ClassValue;
|
|
18
|
+
/** ボックスのルート要素に付けるスタイル */
|
|
19
|
+
style?: StyleValue;
|
|
20
|
+
/**
|
|
21
|
+
* 中身のコンポーネントに引き継ぐアプリのコンテキスト。
|
|
22
|
+
* 中身でアプリに登録したプラグイン・コンポーネント・provide を使う場合に渡す
|
|
23
|
+
*/
|
|
24
|
+
appContext?: AppContext;
|
|
25
|
+
/** ボックスが閉じ終わって取り外されたときに呼ぶ関数。ハンドル・利用者の操作・closeAllOverlayBoxes のどれで閉じても呼ぶ */
|
|
26
|
+
onClose?: () => void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* OverlayBox を body の末尾に描画し、中身にコンポーネントを表示する。
|
|
30
|
+
* 中身のコンポーネントには、渡した props に加えて close と setLoading を props として渡す。
|
|
31
|
+
* テンプレートに置けない処理(ボタンのクリックで画面を開くなど)から呼ぶためのもので、ブラウザでのみ動作する
|
|
32
|
+
*
|
|
33
|
+
* @param {Component} component 中身に表示するコンポーネント
|
|
34
|
+
* @param {Record<string, unknown>} [props] 中身のコンポーネントに渡す props
|
|
35
|
+
* @param {ShowOverlayBoxOptions} [options]
|
|
36
|
+
* @returns {OverlayBoxHandle}
|
|
37
|
+
*/
|
|
38
|
+
export declare function showOverlayBox(component: Component, props?: Record<string, unknown>, options?: ShowOverlayBoxOptions): OverlayBoxHandle;
|
|
39
|
+
/**
|
|
40
|
+
* 開いている OverlayBox をすべて閉じる
|
|
41
|
+
*/
|
|
42
|
+
export declare function closeAllOverlayBoxes(): void;
|
|
43
|
+
/**
|
|
44
|
+
* 呼び出したコンポーネントに結び付けて OverlayBox を開く関数を返す。
|
|
45
|
+
* 開いたボックスは、呼び出したコンポーネントがアンマウントされると閉じる。
|
|
46
|
+
* appContext を指定しなければ、呼び出したコンポーネントのアプリのコンテキストを中身に引き継ぐ。
|
|
47
|
+
* コンポーネントの setup の中で呼ぶこと
|
|
48
|
+
*
|
|
49
|
+
* @returns {{ showOverlayBox: typeof showOverlayBox }}
|
|
50
|
+
*/
|
|
51
|
+
export declare function useOverlayBox(): {
|
|
52
|
+
showOverlayBox: typeof showOverlayBox;
|
|
53
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { AppContext, ClassValue, Component, StyleValue } from 'vue';
|
|
2
|
+
import { MovableWindowContentProps, MovableWindowDragMode, MovableWindowHandle } from '../types/movable-window';
|
|
3
|
+
/** showOverlayBox が中身のコンポーネントに props として渡す関数 */
|
|
4
|
+
export type OverlayBoxContentProps = MovableWindowContentProps;
|
|
5
|
+
/** showOverlayBox が返す、表示中のボックスを操作するためのハンドル */
|
|
6
|
+
export type OverlayBoxHandle = MovableWindowHandle;
|
|
7
|
+
export interface ShowOverlayBoxOptions {
|
|
8
|
+
/** 見出し */
|
|
9
|
+
title?: string;
|
|
10
|
+
/** ドラッグで移動するときに掴む範囲 */
|
|
11
|
+
dragMode?: MovableWindowDragMode;
|
|
12
|
+
/** 暗幕のクリックで閉じる */
|
|
13
|
+
closeOnBackdrop?: boolean;
|
|
14
|
+
/** 閉じるボタンの読み上げ名 */
|
|
15
|
+
closeLabel?: string;
|
|
16
|
+
/** ボックスのルート要素に付けるクラス */
|
|
17
|
+
class?: ClassValue;
|
|
18
|
+
/** ボックスのルート要素に付けるスタイル */
|
|
19
|
+
style?: StyleValue;
|
|
20
|
+
/**
|
|
21
|
+
* 中身のコンポーネントに引き継ぐアプリのコンテキスト。
|
|
22
|
+
* 中身でアプリに登録したプラグイン・コンポーネント・provide を使う場合に渡す
|
|
23
|
+
*/
|
|
24
|
+
appContext?: AppContext;
|
|
25
|
+
/** ボックスが閉じ終わって取り外されたときに呼ぶ関数。ハンドル・利用者の操作・closeAllOverlayBoxes のどれで閉じても呼ぶ */
|
|
26
|
+
onClose?: () => void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* OverlayBox を body の末尾に描画し、中身にコンポーネントを表示する。
|
|
30
|
+
* 中身のコンポーネントには、渡した props に加えて close と setLoading を props として渡す。
|
|
31
|
+
* テンプレートに置けない処理(ボタンのクリックで画面を開くなど)から呼ぶためのもので、ブラウザでのみ動作する
|
|
32
|
+
*
|
|
33
|
+
* @param {Component} component 中身に表示するコンポーネント
|
|
34
|
+
* @param {Record<string, unknown>} [props] 中身のコンポーネントに渡す props
|
|
35
|
+
* @param {ShowOverlayBoxOptions} [options]
|
|
36
|
+
* @returns {OverlayBoxHandle}
|
|
37
|
+
*/
|
|
38
|
+
export declare function showOverlayBox(component: Component, props?: Record<string, unknown>, options?: ShowOverlayBoxOptions): OverlayBoxHandle;
|
|
39
|
+
/**
|
|
40
|
+
* 開いている OverlayBox をすべて閉じる
|
|
41
|
+
*/
|
|
42
|
+
export declare function closeAllOverlayBoxes(): void;
|
|
43
|
+
/**
|
|
44
|
+
* 呼び出したコンポーネントに結び付けて OverlayBox を開く関数を返す。
|
|
45
|
+
* 開いたボックスは、呼び出したコンポーネントがアンマウントされると閉じる。
|
|
46
|
+
* appContext を指定しなければ、呼び出したコンポーネントのアプリのコンテキストを中身に引き継ぐ。
|
|
47
|
+
* コンポーネントの setup の中で呼ぶこと
|
|
48
|
+
*
|
|
49
|
+
* @returns {{ showOverlayBox: typeof showOverlayBox }}
|
|
50
|
+
*/
|
|
51
|
+
export declare function useOverlayBox(): {
|
|
52
|
+
showOverlayBox: typeof showOverlayBox;
|
|
53
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ClassValue, StyleValue } from 'vue';
|
|
2
|
+
export interface ShowScreenLoadingOptions {
|
|
3
|
+
/** ローディングのルート要素に付けるクラス */
|
|
4
|
+
class?: ClassValue;
|
|
5
|
+
/** ローディングのルート要素に付けるスタイル */
|
|
6
|
+
style?: StyleValue;
|
|
7
|
+
}
|
|
8
|
+
/** showScreenLoading が返す、表示中のローディングを閉じるためのハンドル */
|
|
9
|
+
export interface ScreenLoadingHandle {
|
|
10
|
+
/** ローディングを閉じて取り外す */
|
|
11
|
+
close: () => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* ScreenLoading を body の末尾に描画して表示する。
|
|
15
|
+
* テンプレートに置けない処理(API 呼び出しの前後など)から呼ぶためのもので、ブラウザでのみ動作する
|
|
16
|
+
*
|
|
17
|
+
* @param {ShowScreenLoadingOptions} [options]
|
|
18
|
+
* @returns {ScreenLoadingHandle}
|
|
19
|
+
*/
|
|
20
|
+
export declare function showScreenLoading(options?: ShowScreenLoadingOptions): ScreenLoadingHandle;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ClassValue, StyleValue } from 'vue';
|
|
2
|
+
export interface ShowScreenLoadingOptions {
|
|
3
|
+
/** ローディングのルート要素に付けるクラス */
|
|
4
|
+
class?: ClassValue;
|
|
5
|
+
/** ローディングのルート要素に付けるスタイル */
|
|
6
|
+
style?: StyleValue;
|
|
7
|
+
}
|
|
8
|
+
/** showScreenLoading が返す、表示中のローディングを閉じるためのハンドル */
|
|
9
|
+
export interface ScreenLoadingHandle {
|
|
10
|
+
/** ローディングを閉じて取り外す */
|
|
11
|
+
close: () => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* ScreenLoading を body の末尾に描画して表示する。
|
|
15
|
+
* テンプレートに置けない処理(API 呼び出しの前後など)から呼ぶためのもので、ブラウザでのみ動作する
|
|
16
|
+
*
|
|
17
|
+
* @param {ShowScreenLoadingOptions} [options]
|
|
18
|
+
* @returns {ScreenLoadingHandle}
|
|
19
|
+
*/
|
|
20
|
+
export declare function showScreenLoading(options?: ShowScreenLoadingOptions): ScreenLoadingHandle;
|