@digitalwalletcorp/vue-core 1.3.0 → 1.4.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/README.md CHANGED
@@ -172,6 +172,42 @@ export default defineNuxtConfig({
172
172
  });
173
173
  ```
174
174
 
175
+ **🧭 Application-wide Options (`vueCoreOptionsKey`)**
176
+
177
+ Settings that are the same on every page, such as the texts of `DataTable`, can be provided once for the whole application instead of being passed to each component.
178
+ Provide `vueCoreOptionsKey` in a component above the components or with `app.provide`.
179
+ A prop wins over the provided value, and without either, the default of the library is used.
180
+
181
+ ```ts
182
+ // Vue: main.ts
183
+ import { vueCoreOptionsKey } from '@digitalwalletcorp/vue-core';
184
+
185
+ app.provide(vueCoreOptionsKey, {
186
+ dataTable: {
187
+ labels: { totalCount: 'Total', totalUnit: 'records', noData: 'No data' },
188
+ sortMode: 'page'
189
+ }
190
+ });
191
+ ```
192
+
193
+ ```ts
194
+ // Nuxt: plugins/vue-core.ts
195
+ import { vueCoreOptionsKey } from '@digitalwalletcorp/vue-core';
196
+
197
+ export default defineNuxtPlugin((nuxtApp) => {
198
+ nuxtApp.vueApp.provide(vueCoreOptionsKey, {
199
+ dataTable: {
200
+ labels: { totalCount: 'Total', totalUnit: 'records', noData: 'No data' },
201
+ sortMode: 'page'
202
+ }
203
+ });
204
+ });
205
+ ```
206
+
207
+ | Property | Type | Description |
208
+ | ----------- | ------------------ | ----------- |
209
+ | `dataTable` | `DataTableOptions` | Sets default props for [`DataTable`](https://github.com/digitalwalletcorp/vue-core/blob/main/docs/components/data-table.md) components across the application. For example, you can configure default labels or sort behavior. |
210
+
175
211
  #### 🛠️ Helper Functions
176
212
 
177
213
  Dialogs, snackbars and floating windows are shown from code, so you can call them from a click handler or a store action without placing a component in the template.
@@ -1,4 +1,4 @@
1
- import { f as a, h as s, a as n, i as _, j as o, k as e, l as c, m as i, o as t, p as m, q as f, b as r, d as l, s as $, t as p, e as d, u as b, v as g, w as u } from "./warning-popper.vue_vue_type_style_index_0_lang-zt-jCsvz.js";
1
+ import { f as a, h as s, a as n, i as _, j as o, k as e, l as c, m as i, o as t, p as m, q as f, b as r, d as l, s as $, t as p, e as d, u as b, v as g, w as u } from "./warning-popper.vue_vue_type_style_index_0_lang-CgXoSjjp.js";
2
2
  const y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3
3
  __proto__: null,
4
4
  AccordionFieldset: a,
@@ -1 +1 @@
1
- "use strict";const n=require("./warning-popper.vue_vue_type_style_index_0_lang-CxVzqsbn.cjs"),_=Object.freeze(Object.defineProperty({__proto__:null,AccordionFieldset:n._sfc_main$5,AccordionSection:n._sfc_main$6,CopyButton:n._sfc_main$1,DarkModeSelector:n._sfc_main$7,DataTable:n._sfc_main$8,HelpButton:n._sfc_main$9,HelpPopper:n._sfc_main$10,HourglassLoading:n._sfc_main$11,IntersectionLazyComponent:n._sfc_main$12,LabelButton:n._sfc_main$13,LabelIcon:n._sfc_main$14,ModalDialog:n._sfc_main$2,OverlayBox:n._sfc_main$3,PageSection:n._sfc_main$15,PageTitle:n._sfc_main$16,ScreenLoading:n._sfc_main$4,TabContent:n._sfc_main$17,TabGroup:n._sfc_main$18,WarningPopper:n._sfc_main$19},Symbol.toStringTag,{value:"Module"}));exports.components=_;
1
+ "use strict";const n=require("./warning-popper.vue_vue_type_style_index_0_lang-4FIOsOY5.cjs"),_=Object.freeze(Object.defineProperty({__proto__:null,AccordionFieldset:n._sfc_main$5,AccordionSection:n._sfc_main$6,CopyButton:n._sfc_main$1,DarkModeSelector:n._sfc_main$7,DataTable:n._sfc_main$8,HelpButton:n._sfc_main$9,HelpPopper:n._sfc_main$10,HourglassLoading:n._sfc_main$11,IntersectionLazyComponent:n._sfc_main$12,LabelButton:n._sfc_main$13,LabelIcon:n._sfc_main$14,ModalDialog:n._sfc_main$2,OverlayBox:n._sfc_main$3,PageSection:n._sfc_main$15,PageTitle:n._sfc_main$16,ScreenLoading:n._sfc_main$4,TabContent:n._sfc_main$17,TabGroup:n._sfc_main$18,WarningPopper:n._sfc_main$19},Symbol.toStringTag,{value:"Module"}));exports.components=_;
@@ -1,15 +1,107 @@
1
- import { DataTableEmits, DataTableHeader, DataTableProps, DataTableSlots, DataTableSortContext } from './types/data-table.cjs';
1
+ import { ClassValue, StyleValue } from 'vue';
2
+ import { DataTableControlsPlacement, DataTableHeader, DataTableLabels, DataTableSortContext, DataTableSortMode } from './types/data-table.cjs';
3
+ /**
4
+ * DataTable の props
5
+ */
6
+ export interface Props<T = unknown> {
7
+ /** 表示している行のデータ。スロットで描画する行と同じ順に並んでいること */
8
+ dataList: T[];
9
+ /** ヘッダ。id は一意であること */
10
+ headers: DataTableHeader<T>[];
11
+ /** 読み込み中。true の間は行を描画せず読み込み中の表示を出す */
12
+ loading?: boolean;
13
+ /** 総件数。未指定なら dataList の件数 */
14
+ totalCount?: number;
15
+ /** 現在ページ(1起点) */
16
+ current?: number;
17
+ /** 1ページあたりの表示件数 */
18
+ limit?: number;
19
+ /** 1ページあたりの表示件数の上限 */
20
+ maxLimit?: number;
21
+ /** ページネーションに並べるページ番号の最大数 */
22
+ maxPagination?: number;
23
+ /** 行をクリックで選択できるか */
24
+ selectable?: boolean;
25
+ /** コントロールを出す位置 */
26
+ controls?: DataTableControlsPlacement;
27
+ /** ページネーションを出す位置。controls が無い側には出ない */
28
+ pagination?: DataTableControlsPlacement;
29
+ /** ページダウンロードボタンを表示するか */
30
+ showDownloadPage?: boolean;
31
+ /** 全件ダウンロードボタンを表示するか */
32
+ showDownloadAll?: boolean;
33
+ /** 総件数を表示するか */
34
+ showTotal?: boolean;
35
+ /** 1ページあたりの表示件数の入力を表示するか */
36
+ showLimit?: boolean;
37
+ /** ページネーションにページ番号の選択を表示するか */
38
+ showPageSelect?: boolean;
39
+ /** dataList が空のときにデータが無い旨の行を表示するか */
40
+ showNoData?: boolean;
41
+ /** ヘッダの境界のドラッグで列幅を変えられるか */
42
+ resizable?: boolean;
43
+ /** ヘッダのクリックでソートできるか */
44
+ sortable?: boolean;
45
+ /** ソートの方式。未指定なら remote */
46
+ sortMode?: DataTableSortMode;
47
+ /** テーブルをスクロールする領域に付ける class */
48
+ contentClass?: ClassValue;
49
+ /** テーブルをスクロールする領域に付ける style */
50
+ contentStyle?: StyleValue;
51
+ /** table に付ける class */
52
+ tableClass?: ClassValue;
53
+ /** table に付ける style */
54
+ tableStyle?: StyleValue;
55
+ /** 表示する文言。未指定の項目は英語 */
56
+ labels?: DataTableLabels;
57
+ /** 総件数の整形。未指定なら en-US の桁区切り。SSR とクライアントで同じ文字列を返すこと */
58
+ formatTotalCount?: (count: number) => string;
59
+ }
60
+ /**
61
+ * DataTable が発行するイベント
62
+ */
63
+ export interface Emits<T = unknown> {
64
+ /** 選択が変わった。クリックでの選択・解除、カーソルキーでの移動、読み込み完了時の解除で発行する。解除は undefined と -1 */
65
+ (e: 'emit:selectRow', value: T | undefined, index: number): void;
66
+ /** ソートの条件が変わった。sortMode に関わらず発行する */
67
+ (e: 'emit:changeSort', context: DataTableSortContext): void;
68
+ (e: 'emit:updateHeader', headers: DataTableHeader<T>[]): void;
69
+ (e: 'emit:dblclickRow', value: T, index: number): void;
70
+ (e: 'emit:changeLimit', limit: number): void;
71
+ (e: 'emit:changePage', page: number): void;
72
+ (e: 'emit:downloadPage'): void;
73
+ (e: 'emit:downloadAll'): void;
74
+ }
75
+ /**
76
+ * DataTable のスロット
77
+ */
78
+ export interface Slots<T = unknown> {
79
+ /** 行。tr を rows と同じ順に並べ、tr の click で clickRow(row, index) を呼ぶ */
80
+ default?(props: {
81
+ /** 表示する行。sortMode が page のときはソートした順、それ以外は dataList そのもの */
82
+ rows: T[];
83
+ /** 行を選択する。選択している行なら選択を解除する */
84
+ clickRow: (row: T, index: number) => void;
85
+ /** 行を選択してダブルクリックを通知する */
86
+ dblclickRow: (row: T, index: number) => void;
87
+ /** 行のインデックスから、ページをまたいだ1起点の行番号を返す */
88
+ rowNumber: (index: number) => number;
89
+ /** 選択している行のインデックス。選択していなければ -1 */
90
+ selectedIndex: number;
91
+ }): unknown;
92
+ /** 読み込み中の表示。未指定なら既定のスピナー */
93
+ loading?(): unknown;
94
+ }
2
95
  declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
- props: __VLS_PrettifyLocal<DataTableProps<T> & {
96
+ props: __VLS_PrettifyLocal<Props<T> & {
97
+ "onEmit:changePage"?: ((page: number) => any) | undefined;
98
+ "onEmit:changeLimit"?: ((limit: number) => any) | undefined;
99
+ "onEmit:downloadPage"?: (() => any) | undefined;
100
+ "onEmit:downloadAll"?: (() => any) | undefined;
4
101
  "onEmit:selectRow"?: ((value: T | undefined, index: number) => any) | undefined;
5
102
  "onEmit:changeSort"?: ((context: DataTableSortContext) => any) | undefined;
6
- "onEmit:sortData"?: ((dataList: T[]) => any) | undefined;
7
103
  "onEmit:updateHeader"?: ((headers: DataTableHeader<T>[]) => any) | undefined;
8
104
  "onEmit:dblclickRow"?: ((value: T, index: number) => any) | undefined;
9
- "onEmit:changeLimit"?: ((limit: number) => any) | undefined;
10
- "onEmit:changePage"?: ((page: number) => any) | undefined;
11
- "onEmit:downloadPage"?: (() => any) | undefined;
12
- "onEmit:downloadAll"?: (() => any) | undefined;
13
105
  }> & import('vue').PublicProps & (typeof globalThis extends {
14
106
  __VLS_PROPS_FALLBACK: infer P;
15
107
  } ? P : {});
@@ -18,8 +110,8 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
18
110
  getSortContext: () => DataTableSortContext;
19
111
  }>) => void;
20
112
  attrs: any;
21
- slots: DataTableSlots<T>;
22
- emit: DataTableEmits<T>;
113
+ slots: Slots<T>;
114
+ emit: Emits<T>;
23
115
  }>) => import('vue').VNode & {
24
116
  __ctx?: Awaited<typeof __VLS_setup>;
25
117
  };
@@ -1,15 +1,107 @@
1
- import { DataTableEmits, DataTableHeader, DataTableProps, DataTableSlots, DataTableSortContext } from './types/data-table';
1
+ import { ClassValue, StyleValue } from 'vue';
2
+ import { DataTableControlsPlacement, DataTableHeader, DataTableLabels, DataTableSortContext, DataTableSortMode } from './types/data-table';
3
+ /**
4
+ * DataTable の props
5
+ */
6
+ export interface Props<T = unknown> {
7
+ /** 表示している行のデータ。スロットで描画する行と同じ順に並んでいること */
8
+ dataList: T[];
9
+ /** ヘッダ。id は一意であること */
10
+ headers: DataTableHeader<T>[];
11
+ /** 読み込み中。true の間は行を描画せず読み込み中の表示を出す */
12
+ loading?: boolean;
13
+ /** 総件数。未指定なら dataList の件数 */
14
+ totalCount?: number;
15
+ /** 現在ページ(1起点) */
16
+ current?: number;
17
+ /** 1ページあたりの表示件数 */
18
+ limit?: number;
19
+ /** 1ページあたりの表示件数の上限 */
20
+ maxLimit?: number;
21
+ /** ページネーションに並べるページ番号の最大数 */
22
+ maxPagination?: number;
23
+ /** 行をクリックで選択できるか */
24
+ selectable?: boolean;
25
+ /** コントロールを出す位置 */
26
+ controls?: DataTableControlsPlacement;
27
+ /** ページネーションを出す位置。controls が無い側には出ない */
28
+ pagination?: DataTableControlsPlacement;
29
+ /** ページダウンロードボタンを表示するか */
30
+ showDownloadPage?: boolean;
31
+ /** 全件ダウンロードボタンを表示するか */
32
+ showDownloadAll?: boolean;
33
+ /** 総件数を表示するか */
34
+ showTotal?: boolean;
35
+ /** 1ページあたりの表示件数の入力を表示するか */
36
+ showLimit?: boolean;
37
+ /** ページネーションにページ番号の選択を表示するか */
38
+ showPageSelect?: boolean;
39
+ /** dataList が空のときにデータが無い旨の行を表示するか */
40
+ showNoData?: boolean;
41
+ /** ヘッダの境界のドラッグで列幅を変えられるか */
42
+ resizable?: boolean;
43
+ /** ヘッダのクリックでソートできるか */
44
+ sortable?: boolean;
45
+ /** ソートの方式。未指定なら remote */
46
+ sortMode?: DataTableSortMode;
47
+ /** テーブルをスクロールする領域に付ける class */
48
+ contentClass?: ClassValue;
49
+ /** テーブルをスクロールする領域に付ける style */
50
+ contentStyle?: StyleValue;
51
+ /** table に付ける class */
52
+ tableClass?: ClassValue;
53
+ /** table に付ける style */
54
+ tableStyle?: StyleValue;
55
+ /** 表示する文言。未指定の項目は英語 */
56
+ labels?: DataTableLabels;
57
+ /** 総件数の整形。未指定なら en-US の桁区切り。SSR とクライアントで同じ文字列を返すこと */
58
+ formatTotalCount?: (count: number) => string;
59
+ }
60
+ /**
61
+ * DataTable が発行するイベント
62
+ */
63
+ export interface Emits<T = unknown> {
64
+ /** 選択が変わった。クリックでの選択・解除、カーソルキーでの移動、読み込み完了時の解除で発行する。解除は undefined と -1 */
65
+ (e: 'emit:selectRow', value: T | undefined, index: number): void;
66
+ /** ソートの条件が変わった。sortMode に関わらず発行する */
67
+ (e: 'emit:changeSort', context: DataTableSortContext): void;
68
+ (e: 'emit:updateHeader', headers: DataTableHeader<T>[]): void;
69
+ (e: 'emit:dblclickRow', value: T, index: number): void;
70
+ (e: 'emit:changeLimit', limit: number): void;
71
+ (e: 'emit:changePage', page: number): void;
72
+ (e: 'emit:downloadPage'): void;
73
+ (e: 'emit:downloadAll'): void;
74
+ }
75
+ /**
76
+ * DataTable のスロット
77
+ */
78
+ export interface Slots<T = unknown> {
79
+ /** 行。tr を rows と同じ順に並べ、tr の click で clickRow(row, index) を呼ぶ */
80
+ default?(props: {
81
+ /** 表示する行。sortMode が page のときはソートした順、それ以外は dataList そのもの */
82
+ rows: T[];
83
+ /** 行を選択する。選択している行なら選択を解除する */
84
+ clickRow: (row: T, index: number) => void;
85
+ /** 行を選択してダブルクリックを通知する */
86
+ dblclickRow: (row: T, index: number) => void;
87
+ /** 行のインデックスから、ページをまたいだ1起点の行番号を返す */
88
+ rowNumber: (index: number) => number;
89
+ /** 選択している行のインデックス。選択していなければ -1 */
90
+ selectedIndex: number;
91
+ }): unknown;
92
+ /** 読み込み中の表示。未指定なら既定のスピナー */
93
+ loading?(): unknown;
94
+ }
2
95
  declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
- props: __VLS_PrettifyLocal<DataTableProps<T> & {
96
+ props: __VLS_PrettifyLocal<Props<T> & {
97
+ "onEmit:changePage"?: ((page: number) => any) | undefined;
98
+ "onEmit:changeLimit"?: ((limit: number) => any) | undefined;
99
+ "onEmit:downloadPage"?: (() => any) | undefined;
100
+ "onEmit:downloadAll"?: (() => any) | undefined;
4
101
  "onEmit:selectRow"?: ((value: T | undefined, index: number) => any) | undefined;
5
102
  "onEmit:changeSort"?: ((context: DataTableSortContext) => any) | undefined;
6
- "onEmit:sortData"?: ((dataList: T[]) => any) | undefined;
7
103
  "onEmit:updateHeader"?: ((headers: DataTableHeader<T>[]) => any) | undefined;
8
104
  "onEmit:dblclickRow"?: ((value: T, index: number) => any) | undefined;
9
- "onEmit:changeLimit"?: ((limit: number) => any) | undefined;
10
- "onEmit:changePage"?: ((page: number) => any) | undefined;
11
- "onEmit:downloadPage"?: (() => any) | undefined;
12
- "onEmit:downloadAll"?: (() => any) | undefined;
13
105
  }> & import('vue').PublicProps & (typeof globalThis extends {
14
106
  __VLS_PROPS_FALLBACK: infer P;
15
107
  } ? P : {});
@@ -18,8 +110,8 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
18
110
  getSortContext: () => DataTableSortContext;
19
111
  }>) => void;
20
112
  attrs: any;
21
- slots: DataTableSlots<T>;
22
- emit: DataTableEmits<T>;
113
+ slots: Slots<T>;
114
+ emit: Emits<T>;
23
115
  }>) => import('vue').VNode & {
24
116
  __ctx?: Awaited<typeof __VLS_setup>;
25
117
  };
@@ -42,6 +42,10 @@ export interface ShowFloatingComponentOptions {
42
42
  /** ウィンドウが閉じ終わって取り外されたときに呼ぶ関数。ハンドル・利用者の操作・closeAllFloatingComponents のどれで閉じても呼ぶ */
43
43
  onClose?: () => void;
44
44
  }
45
+ export interface ShowFloatingMessageOptions extends ShowFloatingComponentOptions {
46
+ /** trueを指定した場合、文字列をHTMLとして表示する。オブジェクトには影響しない */
47
+ html?: boolean;
48
+ }
45
49
  /**
46
50
  * FloatingComponent を body の末尾に描画し、中身にコンポーネントを表示する。
47
51
  * 中身のコンポーネントには、渡した props に加えて close と setLoading を props として渡す。
@@ -55,15 +59,15 @@ export interface ShowFloatingComponentOptions {
55
59
  export declare function showFloatingComponent(component: Component, props?: Record<string, unknown>, options?: ShowFloatingComponentOptions): FloatingComponentHandle;
56
60
  /**
57
61
  * FloatingComponent を body の末尾に描画し、中身に文字列を表示する。
58
- * 文字列は HTML として解釈せず、改行や空白をそのまま表示する。オブジェクトは整形した JSON で表示する。
59
- * 見出しのコピーボタンは、copyValue を指定しなければ表示した文字列をコピーする。
62
+ * 文字列は改行や空白をそのまま表示し、html を指定すれば HTML として表示する。オブジェクトは整形した JSON で表示する。
63
+ * 見出しのコピーボタンは、copyValue を指定しなければ渡した文字列をコピーする。
60
64
  * ブラウザでのみ動作する
61
65
  *
62
66
  * @param {string | object} message 表示する文字列またはオブジェクト
63
- * @param {ShowFloatingComponentOptions} [options]
67
+ * @param {ShowFloatingMessageOptions} [options]
64
68
  * @returns {FloatingComponentHandle}
65
69
  */
66
- export declare function showFloatingMessage(message: string | object, options?: ShowFloatingComponentOptions): FloatingComponentHandle;
70
+ export declare function showFloatingMessage(message: string | object, options?: ShowFloatingMessageOptions): FloatingComponentHandle;
67
71
  /**
68
72
  * 開いている FloatingComponent をすべて閉じる
69
73
  */
@@ -42,6 +42,10 @@ export interface ShowFloatingComponentOptions {
42
42
  /** ウィンドウが閉じ終わって取り外されたときに呼ぶ関数。ハンドル・利用者の操作・closeAllFloatingComponents のどれで閉じても呼ぶ */
43
43
  onClose?: () => void;
44
44
  }
45
+ export interface ShowFloatingMessageOptions extends ShowFloatingComponentOptions {
46
+ /** trueを指定した場合、文字列をHTMLとして表示する。オブジェクトには影響しない */
47
+ html?: boolean;
48
+ }
45
49
  /**
46
50
  * FloatingComponent を body の末尾に描画し、中身にコンポーネントを表示する。
47
51
  * 中身のコンポーネントには、渡した props に加えて close と setLoading を props として渡す。
@@ -55,15 +59,15 @@ export interface ShowFloatingComponentOptions {
55
59
  export declare function showFloatingComponent(component: Component, props?: Record<string, unknown>, options?: ShowFloatingComponentOptions): FloatingComponentHandle;
56
60
  /**
57
61
  * FloatingComponent を body の末尾に描画し、中身に文字列を表示する。
58
- * 文字列は HTML として解釈せず、改行や空白をそのまま表示する。オブジェクトは整形した JSON で表示する。
59
- * 見出しのコピーボタンは、copyValue を指定しなければ表示した文字列をコピーする。
62
+ * 文字列は改行や空白をそのまま表示し、html を指定すれば HTML として表示する。オブジェクトは整形した JSON で表示する。
63
+ * 見出しのコピーボタンは、copyValue を指定しなければ渡した文字列をコピーする。
60
64
  * ブラウザでのみ動作する
61
65
  *
62
66
  * @param {string | object} message 表示する文字列またはオブジェクト
63
- * @param {ShowFloatingComponentOptions} [options]
67
+ * @param {ShowFloatingMessageOptions} [options]
64
68
  * @returns {FloatingComponentHandle}
65
69
  */
66
- export declare function showFloatingMessage(message: string | object, options?: ShowFloatingComponentOptions): FloatingComponentHandle;
70
+ export declare function showFloatingMessage(message: string | object, options?: ShowFloatingMessageOptions): FloatingComponentHandle;
67
71
  /**
68
72
  * 開いている FloatingComponent をすべて閉じる
69
73
  */
@@ -0,0 +1,17 @@
1
+ import { InjectionKey } from 'vue';
2
+ import { Props } from '../data-table.cjs';
3
+ /**
4
+ * DataTable のアプリ既定の設定。vueCoreOptionsKey の dataTable で渡す。
5
+ * props のうちデータと表示の状態を除いた項目を持ち、DataTable の props に同じ名前の指定があればそちらが優先される
6
+ */
7
+ export type DataTableOptions = Partial<Omit<Props, 'dataList' | 'headers' | 'loading' | 'totalCount' | 'current' | 'limit'>>;
8
+ /** アプリ全体の設定 */
9
+ export type VueCoreOptions = {
10
+ /** DataTable のアプリ既定の設定 */
11
+ dataTable?: DataTableOptions;
12
+ };
13
+ /**
14
+ * アプリ全体の設定を provide/inject するためのキー
15
+ * provide は任意。画面の上位または app.provide で使う
16
+ */
17
+ export declare const vueCoreOptionsKey: InjectionKey<VueCoreOptions>;
@@ -0,0 +1,17 @@
1
+ import { InjectionKey } from 'vue';
2
+ import { Props } from '../data-table';
3
+ /**
4
+ * DataTable のアプリ既定の設定。vueCoreOptionsKey の dataTable で渡す。
5
+ * props のうちデータと表示の状態を除いた項目を持ち、DataTable の props に同じ名前の指定があればそちらが優先される
6
+ */
7
+ export type DataTableOptions = Partial<Omit<Props, 'dataList' | 'headers' | 'loading' | 'totalCount' | 'current' | 'limit'>>;
8
+ /** アプリ全体の設定 */
9
+ export type VueCoreOptions = {
10
+ /** DataTable のアプリ既定の設定 */
11
+ dataTable?: DataTableOptions;
12
+ };
13
+ /**
14
+ * アプリ全体の設定を provide/inject するためのキー
15
+ * provide は任意。画面の上位または app.provide で使う
16
+ */
17
+ export declare const vueCoreOptionsKey: InjectionKey<VueCoreOptions>;
package/lib/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./warning-popper.vue_vue_type_style_index_0_lang-CxVzqsbn.cjs"),e=require("vue"),F=require("@digitalwalletcorp/vue-svg-icons"),W="$index",B=o=>{const t=[];for(const n of o)if(n.csv===!0)t.push({header:n,column:{}});else if(Array.isArray(n.csv))for(const a of n.csv)a.disabled||t.push({header:n,column:a});return t},N=o=>B(o).map(({header:t,column:n})=>r.resolveLabel(n.label??t.label)),P=(o,t,n)=>B(o).map(({header:a,column:l})=>{if(l.format)return l.format(t);const s=l.key??a.id;return s===W?n:r.getValueByPath(t,s)}),z=e.defineComponent({__name:"floating-component",props:{open:{type:Boolean},title:{},anchor:{},dragMode:{},loading:{type:Boolean},closeLabel:{},copyValue:{type:[String,Number,Function]},copyLabel:{},closeOnDblClick:{type:Boolean},lockScroll:{type:Boolean},initialSize:{},headerClass:{type:[Boolean,null,String,Object,Array]},headerStyle:{type:[Boolean,null,String,Object,Array]}},emits:["update:open","emit:close"],setup(o,{emit:t}){const n=o,a=t,l=e.ref(),s=e.ref(r.nextWindowOrder()),c=()=>{s.value=r.nextWindowOrder()},d=()=>{n.closeOnDblClick&&a("update:open",!1)},i=()=>{const u=l.value;if(!u?.element)return;const m=u.element.getBoundingClientRect();let p=n.initialSize?.width??m.width;window.innerWidth<p&&(p=window.innerWidth*.9);let f=n.initialSize?.height??-1;window.innerHeight<f&&(f=window.innerHeight*.9),u.size.width=p,u.size.height=f;const _=document.documentElement.scrollLeft,b=document.documentElement.scrollTop;if(n.anchor){const V={width:p,height:0<=f?f:m.height},M={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight},v=r.computeAnchoredPosition(n.anchor.getBoundingClientRect(),V,M,{placement:"bottom-start",offset:0,margin:0,arrowMargin:0});u.position.x=v.left+_,u.position.y=v.top+b}else u.position.x=10+_,u.position.y=10+b};return e.onMounted(()=>{n.open&&i()}),(u,m)=>(e.openBlock(),e.createBlock(e.Transition,{name:"dwui-floating-component-fade",onAfterLeave:m[1]||(m[1]=p=>a("emit:close"))},{default:e.withCtx(()=>[n.open?(e.openBlock(),e.createBlock(r._sfc_main,{key:0,ref_key:"refWindow",ref:l,class:e.normalizeClass(["dwui-floating-component",{"dwui-lock-scroll":n.lockScroll}]),name:"dwui-floating-component",style:e.normalizeStyle({"--dwui-order-window":s.value}),"drag-mode":n.dragMode,loading:n.loading,"close-label":n.closeLabel,"clamp-bottom":!1,"header-class":n.headerClass,"header-style":n.headerStyle,onPointerdownCapture:c,onDblclick:d,"onEmit:close":m[0]||(m[0]=p=>a("update:open",!1))},e.createSlots({title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.title),1)]),default:e.withCtx(()=>[e.renderSlot(u.$slots,"default")]),_:2},[n.copyValue!=null?{name:"actions",fn:e.withCtx(()=>[e.createVNode(r._sfc_main$1,{class:"dwui-floating-component-copy-button",value:n.copyValue,"aria-label":n.copyLabel},null,8,["value","aria-label"])]),key:"0"}:void 0]),1032,["class","style","drag-mode","loading","close-label","header-class","header-style"])):e.createCommentVNode("",!0)]),_:3}))}});function x(o,t,n){const a=document.createElement("div");document.body.appendChild(a);const l=e.ref(!0),s=e.ref(!1),c={close:()=>{l.value=!1},setLoading:u=>{s.value=u}},d=e.defineComponent(()=>()=>o({open:l.value,loading:s.value,"onUpdate:open":u=>{l.value=u},"onEmit:close":()=>{n.delete(c),e.render(null,a),a.remove(),t.onClosed?.(),t.onClose?.()}},c)),i=e.h(d);return t.appContext&&(i.appContext=t.appContext),e.render(i,a),n.add(c),c}function S(o){const t=e.getCurrentInstance();if(!t)throw new Error(`${o}() must be called inside setup().`);const n=new Set;return e.onBeforeUnmount(()=>{for(const a of n)a.close()}),{appContext:t.appContext,own:a=>{const l=a(()=>{n.delete(l)});return n.add(l),l}}}const $=new Set,h=(o,t,n)=>{const{appContext:a,onClose:l,...s}=t??{};return x((c,d)=>e.h(z,{closeLabel:"Close",copyLabel:"Copy",closeOnDblClick:!1,lockScroll:!1,...s,...c},{default:()=>o(d)}),{appContext:a,onClose:l,onClosed:n},$)},L=(o,t)=>n=>e.h(o,{...t,...n}),E=o=>typeof o=="string"?o:JSON.stringify(o,null,2),D=o=>()=>e.h("div",{class:"dwui-floating-component-message"},o);function I(o,t,n){return h(L(o,t),n)}function H(o,t){const n=E(o);return h(D(n),{copyValue:n,...t})}function R(){for(const o of[...$])o.close()}function j(){const o=S("useFloatingComponent"),t=n=>({appContext:o.appContext,...n});return{showFloatingComponent:(n,a,l)=>o.own(s=>h(L(n,a),t(l),s)),showFloatingMessage:(n,a)=>{const l=E(n);return o.own(s=>h(D(l),t({copyValue:l,...a}),s))}}}function w(o,t){const{icon:n,appContext:a,...l}=t??{};return new Promise(s=>{const c=document.createElement("div");document.body.appendChild(c);const d=e.h(r._sfc_main$2,{...l,message:o,open:!0,"onEmit:close":i=>{e.render(null,c),c.remove(),s(i)}},n?{icon:()=>e.h(n)}:void 0);a&&(d.appContext=a),e.render(d,c)})}function q(o,t){return w(o,{...t,type:"info"})}function G(o,t){return w(o,{...t,type:"confirm"})}function U(o,t){return w(o,{...t,type:"warn"})}function J(o,t){return w(o,{...t,type:"error"})}const O=new Set,T=(o,t,n,a)=>{const{appContext:l,onClose:s,...c}=n??{};return x((d,i)=>e.h(r._sfc_main$3,{...c,...d},{default:()=>e.h(o,{...t,close:i.close,setLoading:i.setLoading})}),{appContext:l,onClose:s,onClosed:a},O)};function K(o,t,n){return T(o,t,n)}function X(){for(const o of[...O])o.close()}function Y(){const o=S("useOverlayBox");return{showOverlayBox:(t,n,a)=>o.own(l=>T(t,n,{appContext:o.appContext,...a},l))}}function Q(o){const t=document.createElement("div");document.body.appendChild(t);const n=()=>{e.render(null,t),t.remove()};return e.render(e.h(r._sfc_main$4,{...o,loading:!0}),t),{close:n}}const Z=["aria-label","title"],ee=["title","onClick"],ne={key:0,class:"dwui-snackbar-header"},oe={key:0,class:"dwui-snackbar-title"},te={key:1,class:"dwui-snackbar-label"},ae={class:"dwui-snackbar-message"},le={key:1,class:"dwui-snackbar-timestamp"},se=e.defineComponent({__name:"snackbar-container",props:{placement:{},direction:{},items:{}},emits:["emit:close","emit:clear","emit:afterLeave"],setup(o,{emit:t}){const n=o,a=t,l=e.computed(()=>{const[c,d="center"]=n.placement.split("-");return[`dwui-snackbar-container-${c}`,`dwui-snackbar-container-${d}`,`dwui-snackbar-container-${n.direction}`]}),s=e.computed(()=>n.items.filter(c=>c.clearable).at(-1)?.clearLabel);return(c,d)=>(e.openBlock(),e.createBlock(e.TransitionGroup,{tag:"div",name:"dwui-snackbar-fade",class:e.normalizeClass(["dwui-snackbar-container",l.value]),role:"status",onAfterLeave:d[1]||(d[1]=i=>a("emit:afterLeave"))},{default:e.withCtx(()=>[s.value!=null?(e.openBlock(),e.createElementBlock("button",{key:"clear",type:"button",class:"dwui-snackbar-clear-button","aria-label":s.value,title:s.value,onClick:d[0]||(d[0]=i=>a("emit:clear"))},[e.createVNode(e.unref(F.SvgWastebasket))],8,Z)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,i=>(e.openBlock(),e.createElementBlock("button",{key:i.id,type:"button",class:e.normalizeClass(["dwui-snackbar",i.class]),style:e.normalizeStyle(i.style),title:i.message,onClick:u=>a("emit:close",i.id)},[i.title||i.label?(e.openBlock(),e.createElementBlock("span",ne,[i.title?(e.openBlock(),e.createElementBlock("span",oe,e.toDisplayString(i.title),1)):e.createCommentVNode("",!0),i.label?(e.openBlock(),e.createElementBlock("span",te,e.toDisplayString(i.label),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("span",ae,e.toDisplayString(i.message),1),i.timestamp?(e.openBlock(),e.createElementBlock("span",le,e.toDisplayString(i.timestamp),1)):e.createCommentVNode("",!0)],14,ee))),128))]),_:1},8,["class"]))}}),re=50,g=new Map,y=new Map;let k=0;const C=(o,t,n)=>{const a=o.findIndex(s=>s.id===t);if(a<0)return;o.splice(a,1);const l=y.get(t);y.delete(t),clearTimeout(l?.timer),l?.onClose?.(n)},A=o=>{const t=o.map(n=>n.id);for(let n=0;n<t.length;n++)setTimeout(()=>C(o,t[n],"clear"),re*n)},ie=(o,t)=>{const n=`${o} ${t}`,a=g.get(n);if(a)return a;const l=document.createElement("div");document.body.appendChild(l);const s=e.shallowReactive([]);return g.set(n,s),e.render(e.h(se,{placement:o,direction:t,items:s,"onEmit:close":c=>C(s,c,"click"),"onEmit:clear":()=>A(s),"onEmit:afterLeave":()=>{s.length===0&&g.get(n)===s&&(g.delete(n),e.render(null,l),l.remove())}}),l),s};function ce(o,t){const{placement:n="bottom",direction:a="overlap",duration:l,clearable:s=!1,clearLabel:c="Clear all",onClose:d,...i}=t??{},u=ie(n,a);k+=1;const m=k;return u.push({...i,id:m,message:o,clearable:s,clearLabel:c}),y.set(m,{timer:l?setTimeout(()=>C(u,m,"duration"),l):void 0,onClose:d}),{close:()=>C(u,m,"handle")}}function de(){for(const o of g.values())A(o)}exports.AccordionFieldset=r._sfc_main$5;exports.AccordionSection=r._sfc_main$6;exports.CopyButton=r._sfc_main$1;exports.DarkModeSelector=r._sfc_main$7;exports.DataTable=r._sfc_main$8;exports.HelpButton=r._sfc_main$9;exports.HelpPopper=r._sfc_main$10;exports.HourglassLoading=r._sfc_main$11;exports.IntersectionLazyComponent=r._sfc_main$12;exports.LabelButton=r._sfc_main$13;exports.LabelIcon=r._sfc_main$14;exports.ModalDialog=r._sfc_main$2;exports.OverlayBox=r._sfc_main$3;exports.PageSection=r._sfc_main$15;exports.PageTitle=r._sfc_main$16;exports.ScreenLoading=r._sfc_main$4;exports.TabContent=r._sfc_main$17;exports.TabGroup=r._sfc_main$18;exports.WarningPopper=r._sfc_main$19;exports.closeAllFloatingComponents=R;exports.closeAllOverlayBoxes=X;exports.closeAllSnackbars=de;exports.headersToCsvColumns=N;exports.rowToCsvColumns=P;exports.showConfirmationDialog=G;exports.showErrorDialog=J;exports.showFloatingComponent=I;exports.showFloatingMessage=H;exports.showInformationDialog=q;exports.showModalDialog=w;exports.showOverlayBox=K;exports.showScreenLoading=Q;exports.showSnackbar=ce;exports.showWarningDialog=U;exports.useFloatingComponent=j;exports.useOverlayBox=Y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./warning-popper.vue_vue_type_style_index_0_lang-4FIOsOY5.cjs"),e=require("vue"),F=require("@digitalwalletcorp/vue-svg-icons"),W="$index",x=o=>{const t=[];for(const n of o)if(n.csv===!0)t.push({header:n,column:{}});else if(Array.isArray(n.csv))for(const a of n.csv)a.disabled||t.push({header:n,column:a});return t},N=o=>x(o).map(({header:t,column:n})=>r.resolveLabel(n.label??t.label)),P=(o,t,n)=>x(o).map(({header:a,column:l})=>{if(l.format)return l.format(t);const s=l.key??a.id;return s===W?n:r.getValueByPath(t,s)}),z=e.defineComponent({__name:"floating-component",props:{open:{type:Boolean},title:{},anchor:{},dragMode:{},loading:{type:Boolean},closeLabel:{},copyValue:{type:[String,Number,Function]},copyLabel:{},closeOnDblClick:{type:Boolean},lockScroll:{type:Boolean},initialSize:{},headerClass:{type:[Boolean,null,String,Object,Array]},headerStyle:{type:[Boolean,null,String,Object,Array]}},emits:["update:open","emit:close"],setup(o,{emit:t}){const n=o,a=t,l=e.ref(),s=e.ref(r.nextWindowOrder()),c=()=>{s.value=r.nextWindowOrder()},d=()=>{n.closeOnDblClick&&a("update:open",!1)},i=()=>{const u=l.value;if(!u?.element)return;const p=u.element.getBoundingClientRect();let m=n.initialSize?.width??p.width;window.innerWidth<m&&(m=window.innerWidth*.9);let f=n.initialSize?.height??-1;window.innerHeight<f&&(f=window.innerHeight*.9),u.size.width=m,u.size.height=f;const v=document.documentElement.scrollLeft,b=document.documentElement.scrollTop;if(n.anchor){const M={width:m,height:0<=f?f:p.height},V={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight},k=r.computeAnchoredPosition(n.anchor.getBoundingClientRect(),M,V,{placement:"bottom-start",offset:0,margin:0,arrowMargin:0});u.position.x=k.left+v,u.position.y=k.top+b}else u.position.x=10+v,u.position.y=10+b};return e.onMounted(()=>{n.open&&i()}),(u,p)=>(e.openBlock(),e.createBlock(e.Transition,{name:"dwui-floating-component-fade",onAfterLeave:p[1]||(p[1]=m=>a("emit:close"))},{default:e.withCtx(()=>[n.open?(e.openBlock(),e.createBlock(r._sfc_main,{key:0,ref_key:"refWindow",ref:l,class:e.normalizeClass(["dwui-floating-component",{"dwui-lock-scroll":n.lockScroll}]),name:"dwui-floating-component",style:e.normalizeStyle({"--dwui-order-window":s.value}),"drag-mode":n.dragMode,loading:n.loading,"close-label":n.closeLabel,"clamp-bottom":!1,"header-class":n.headerClass,"header-style":n.headerStyle,onPointerdownCapture:c,onDblclick:d,"onEmit:close":p[0]||(p[0]=m=>a("update:open",!1))},e.createSlots({title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.title),1)]),default:e.withCtx(()=>[e.renderSlot(u.$slots,"default")]),_:2},[n.copyValue!=null?{name:"actions",fn:e.withCtx(()=>[e.createVNode(r._sfc_main$1,{class:"dwui-floating-component-copy-button",value:n.copyValue,"aria-label":n.copyLabel},null,8,["value","aria-label"])]),key:"0"}:void 0]),1032,["class","style","drag-mode","loading","close-label","header-class","header-style"])):e.createCommentVNode("",!0)]),_:3}))}});function S(o,t,n){const a=document.createElement("div");document.body.appendChild(a);const l=e.ref(!0),s=e.ref(!1),c={close:()=>{l.value=!1},setLoading:u=>{s.value=u}},d=e.defineComponent(()=>()=>o({open:l.value,loading:s.value,"onUpdate:open":u=>{l.value=u},"onEmit:close":()=>{n.delete(c),e.render(null,a),a.remove(),t.onClosed?.(),t.onClose?.()}},c)),i=e.h(d);return t.appContext&&(i.appContext=t.appContext),e.render(i,a),n.add(c),c}function $(o){const t=e.getCurrentInstance();if(!t)throw new Error(`${o}() must be called inside setup().`);const n=new Set;return e.onBeforeUnmount(()=>{for(const a of n)a.close()}),{appContext:t.appContext,own:a=>{const l=a(()=>{n.delete(l)});return n.add(l),l}}}const L=new Set,h=(o,t,n)=>{const{appContext:a,onClose:l,...s}=t??{};return S((c,d)=>e.h(z,{closeLabel:"Close",copyLabel:"Copy",closeOnDblClick:!1,lockScroll:!1,...s,...c},{default:()=>o(d)}),{appContext:a,onClose:l,onClosed:n},L)},E=(o,t)=>n=>e.h(o,{...t,...n}),_=o=>typeof o=="string"?o:JSON.stringify(o,null,2),D=(o,t)=>()=>t&&typeof o=="string"?e.h("div",{class:"dwui-floating-component-message",innerHTML:o}):e.h("div",{class:"dwui-floating-component-message"},_(o));function I(o,t,n){return h(E(o,t),n)}function H(o,t){const{html:n,...a}=t??{};return h(D(o,n),{copyValue:_(o),...a})}function R(){for(const o of[...L])o.close()}function j(){const o=$("useFloatingComponent"),t=n=>({appContext:o.appContext,...n});return{showFloatingComponent:(n,a,l)=>o.own(s=>h(E(n,a),t(l),s)),showFloatingMessage:(n,a)=>{const{html:l,...s}=a??{};return o.own(c=>h(D(n,l),t({copyValue:_(n),...s}),c))}}}function g(o,t){const{icon:n,appContext:a,...l}=t??{};return new Promise(s=>{const c=document.createElement("div");document.body.appendChild(c);const d=e.h(r._sfc_main$2,{...l,message:o,open:!0,"onEmit:close":i=>{e.render(null,c),c.remove(),s(i)}},n?{icon:()=>e.h(n)}:void 0);a&&(d.appContext=a),e.render(d,c)})}function q(o,t){return g(o,{...t,type:"info"})}function K(o,t){return g(o,{...t,type:"confirm"})}function G(o,t){return g(o,{...t,type:"warn"})}function U(o,t){return g(o,{...t,type:"error"})}const O=new Set,T=(o,t,n,a)=>{const{appContext:l,onClose:s,...c}=n??{};return S((d,i)=>e.h(r._sfc_main$3,{...c,...d},{default:()=>e.h(o,{...t,close:i.close,setLoading:i.setLoading})}),{appContext:l,onClose:s,onClosed:a},O)};function J(o,t,n){return T(o,t,n)}function X(){for(const o of[...O])o.close()}function Y(){const o=$("useOverlayBox");return{showOverlayBox:(t,n,a)=>o.own(l=>T(t,n,{appContext:o.appContext,...a},l))}}function Q(o){const t=document.createElement("div");document.body.appendChild(t);const n=()=>{e.render(null,t),t.remove()};return e.render(e.h(r._sfc_main$4,{...o,loading:!0}),t),{close:n}}const Z=["aria-label","title"],ee=["title","onClick"],ne={key:0,class:"dwui-snackbar-header"},oe={key:0,class:"dwui-snackbar-title"},te={key:1,class:"dwui-snackbar-label"},ae={class:"dwui-snackbar-message"},le={key:1,class:"dwui-snackbar-timestamp"},se=e.defineComponent({__name:"snackbar-container",props:{placement:{},direction:{},items:{}},emits:["emit:close","emit:clear","emit:afterLeave"],setup(o,{emit:t}){const n=o,a=t,l=e.computed(()=>{const[c,d="center"]=n.placement.split("-");return[`dwui-snackbar-container-${c}`,`dwui-snackbar-container-${d}`,`dwui-snackbar-container-${n.direction}`]}),s=e.computed(()=>n.items.filter(c=>c.clearable).at(-1)?.clearLabel);return(c,d)=>(e.openBlock(),e.createBlock(e.TransitionGroup,{tag:"div",name:"dwui-snackbar-fade",class:e.normalizeClass(["dwui-snackbar-container",l.value]),role:"status",onAfterLeave:d[1]||(d[1]=i=>a("emit:afterLeave"))},{default:e.withCtx(()=>[s.value!=null?(e.openBlock(),e.createElementBlock("button",{key:"clear",type:"button",class:"dwui-snackbar-clear-button","aria-label":s.value,title:s.value,onClick:d[0]||(d[0]=i=>a("emit:clear"))},[e.createVNode(e.unref(F.SvgWastebasket))],8,Z)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,i=>(e.openBlock(),e.createElementBlock("button",{key:i.id,type:"button",class:e.normalizeClass(["dwui-snackbar",i.class]),style:e.normalizeStyle(i.style),title:i.message,onClick:u=>a("emit:close",i.id)},[i.title||i.label?(e.openBlock(),e.createElementBlock("span",ne,[i.title?(e.openBlock(),e.createElementBlock("span",oe,e.toDisplayString(i.title),1)):e.createCommentVNode("",!0),i.label?(e.openBlock(),e.createElementBlock("span",te,e.toDisplayString(i.label),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("span",ae,e.toDisplayString(i.message),1),i.timestamp?(e.openBlock(),e.createElementBlock("span",le,e.toDisplayString(i.timestamp),1)):e.createCommentVNode("",!0)],14,ee))),128))]),_:1},8,["class"]))}}),re=50,w=new Map,y=new Map;let B=0;const C=(o,t,n)=>{const a=o.findIndex(s=>s.id===t);if(a<0)return;o.splice(a,1);const l=y.get(t);y.delete(t),clearTimeout(l?.timer),l?.onClose?.(n)},A=o=>{const t=o.map(n=>n.id);for(let n=0;n<t.length;n++)setTimeout(()=>C(o,t[n],"clear"),re*n)},ie=(o,t)=>{const n=`${o} ${t}`,a=w.get(n);if(a)return a;const l=document.createElement("div");document.body.appendChild(l);const s=e.shallowReactive([]);return w.set(n,s),e.render(e.h(se,{placement:o,direction:t,items:s,"onEmit:close":c=>C(s,c,"click"),"onEmit:clear":()=>A(s),"onEmit:afterLeave":()=>{s.length===0&&w.get(n)===s&&(w.delete(n),e.render(null,l),l.remove())}}),l),s};function ce(o,t){const{placement:n="bottom",direction:a="overlap",duration:l,clearable:s=!1,clearLabel:c="Clear all",onClose:d,...i}=t??{},u=ie(n,a);B+=1;const p=B;return u.push({...i,id:p,message:o,clearable:s,clearLabel:c}),y.set(p,{timer:l?setTimeout(()=>C(u,p,"duration"),l):void 0,onClose:d}),{close:()=>C(u,p,"handle")}}function de(){for(const o of w.values())A(o)}exports.AccordionFieldset=r._sfc_main$5;exports.AccordionSection=r._sfc_main$6;exports.CopyButton=r._sfc_main$1;exports.DarkModeSelector=r._sfc_main$7;exports.DataTable=r._sfc_main$8;exports.HelpButton=r._sfc_main$9;exports.HelpPopper=r._sfc_main$10;exports.HourglassLoading=r._sfc_main$11;exports.IntersectionLazyComponent=r._sfc_main$12;exports.LabelButton=r._sfc_main$13;exports.LabelIcon=r._sfc_main$14;exports.ModalDialog=r._sfc_main$2;exports.OverlayBox=r._sfc_main$3;exports.PageSection=r._sfc_main$15;exports.PageTitle=r._sfc_main$16;exports.ScreenLoading=r._sfc_main$4;exports.TabContent=r._sfc_main$17;exports.TabGroup=r._sfc_main$18;exports.WarningPopper=r._sfc_main$19;exports.vueCoreOptionsKey=r.vueCoreOptionsKey;exports.closeAllFloatingComponents=R;exports.closeAllOverlayBoxes=X;exports.closeAllSnackbars=de;exports.headersToCsvColumns=N;exports.rowToCsvColumns=P;exports.showConfirmationDialog=K;exports.showErrorDialog=U;exports.showFloatingComponent=I;exports.showFloatingMessage=H;exports.showInformationDialog=q;exports.showModalDialog=g;exports.showOverlayBox=J;exports.showScreenLoading=Q;exports.showSnackbar=ce;exports.showWarningDialog=G;exports.useFloatingComponent=j;exports.useOverlayBox=Y;
package/lib/index.d.cts CHANGED
@@ -2,6 +2,7 @@ export * from './components.cjs';
2
2
  export type { Props as AccordionFieldsetProps, Slots as AccordionFieldsetSlots } from './accordion-fieldset.cjs';
3
3
  export type { Props as AccordionSectionProps, Slots as AccordionSectionSlots } from './accordion-section.cjs';
4
4
  export type { Props as CopyButtonProps, Emits as CopyButtonEmits, Slots as CopyButtonSlots } from './copy-button.cjs';
5
+ export type { Props as DataTableProps, Emits as DataTableEmits, Slots as DataTableSlots } from './data-table.cjs';
5
6
  export type { Props as DarkModeSelectorProps, Emits as DarkModeSelectorEmits, Slots as DarkModeSelectorSlots } from './dark-mode-selector.cjs';
6
7
  export type { Props as HelpButtonProps, Emits as HelpButtonEmits, Slots as HelpButtonSlots } from './help-button.cjs';
7
8
  export type { Props as HelpPopperProps, Emits as HelpPopperEmits, Slots as HelpPopperSlots } from './help-popper.cjs';
@@ -18,9 +19,9 @@ export type { Props as TabContentProps, Slots as TabContentSlots } from './tab-c
18
19
  export type { Props as TabGroupProps, Slots as TabGroupSlots } from './tab-group.cjs';
19
20
  export type { Props as WarningPopperProps, Emits as WarningPopperEmits, Slots as WarningPopperSlots } from './warning-popper.cjs';
20
21
  export { headersToCsvColumns, rowToCsvColumns } from './helpers/data-table-csv.cjs';
21
- export type { DataTableControlsPlacement, DataTableCsvColumn, DataTableEmits, DataTableHeader, DataTableLabels, DataTableProps, DataTableResolvedLabels, DataTableSlots, DataTableSortContext, DataTableSortMode, DataTableValueType } from './types/data-table.cjs';
22
+ export type { DataTableControlsPlacement, DataTableCsvColumn, DataTableHeader, DataTableLabels, DataTableResolvedLabels, DataTableSortContext, DataTableSortMode, DataTableValueType } from './types/data-table.cjs';
22
23
  export { closeAllFloatingComponents, showFloatingComponent, showFloatingMessage, useFloatingComponent } from './helpers/show-floating-component.cjs';
23
- export type { FloatingComponentContentProps, FloatingComponentHandle, ShowFloatingComponentOptions } from './helpers/show-floating-component.cjs';
24
+ export type { FloatingComponentContentProps, FloatingComponentHandle, ShowFloatingComponentOptions, ShowFloatingMessageOptions } from './helpers/show-floating-component.cjs';
24
25
  export { showConfirmationDialog, showErrorDialog, showInformationDialog, showModalDialog, showWarningDialog } from './helpers/show-modal-dialog.cjs';
25
26
  export type { ShowModalDialogOptions } from './helpers/show-modal-dialog.cjs';
26
27
  export type { ModalDialogButton, ModalDialogImage, ModalDialogResult, ModalDialogType } from './types/modal-dialog.cjs';
@@ -34,4 +35,6 @@ export type { SnackbarDirection, SnackbarPlacement } from './internal/snackbar-i
34
35
  export type { LabelPreset } from './types/label-preset.cjs';
35
36
  export type { MovableWindowContentProps, MovableWindowDragMode, MovableWindowHandle } from './types/movable-window.cjs';
36
37
  export type { TabContentStatus } from './internal/tab-group-context.cjs';
38
+ export { vueCoreOptionsKey } from './helpers/vue-core-options.cjs';
39
+ export type { DataTableOptions, VueCoreOptions } from './helpers/vue-core-options.cjs';
37
40
  export type { PopoverPlacement } from './internal/anchored-position.cjs';
package/lib/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export * from './components';
2
2
  export type { Props as AccordionFieldsetProps, Slots as AccordionFieldsetSlots } from './accordion-fieldset';
3
3
  export type { Props as AccordionSectionProps, Slots as AccordionSectionSlots } from './accordion-section';
4
4
  export type { Props as CopyButtonProps, Emits as CopyButtonEmits, Slots as CopyButtonSlots } from './copy-button';
5
+ export type { Props as DataTableProps, Emits as DataTableEmits, Slots as DataTableSlots } from './data-table';
5
6
  export type { Props as DarkModeSelectorProps, Emits as DarkModeSelectorEmits, Slots as DarkModeSelectorSlots } from './dark-mode-selector';
6
7
  export type { Props as HelpButtonProps, Emits as HelpButtonEmits, Slots as HelpButtonSlots } from './help-button';
7
8
  export type { Props as HelpPopperProps, Emits as HelpPopperEmits, Slots as HelpPopperSlots } from './help-popper';
@@ -18,9 +19,9 @@ export type { Props as TabContentProps, Slots as TabContentSlots } from './tab-c
18
19
  export type { Props as TabGroupProps, Slots as TabGroupSlots } from './tab-group';
19
20
  export type { Props as WarningPopperProps, Emits as WarningPopperEmits, Slots as WarningPopperSlots } from './warning-popper';
20
21
  export { headersToCsvColumns, rowToCsvColumns } from './helpers/data-table-csv';
21
- export type { DataTableControlsPlacement, DataTableCsvColumn, DataTableEmits, DataTableHeader, DataTableLabels, DataTableProps, DataTableResolvedLabels, DataTableSlots, DataTableSortContext, DataTableSortMode, DataTableValueType } from './types/data-table';
22
+ export type { DataTableControlsPlacement, DataTableCsvColumn, DataTableHeader, DataTableLabels, DataTableResolvedLabels, DataTableSortContext, DataTableSortMode, DataTableValueType } from './types/data-table';
22
23
  export { closeAllFloatingComponents, showFloatingComponent, showFloatingMessage, useFloatingComponent } from './helpers/show-floating-component';
23
- export type { FloatingComponentContentProps, FloatingComponentHandle, ShowFloatingComponentOptions } from './helpers/show-floating-component';
24
+ export type { FloatingComponentContentProps, FloatingComponentHandle, ShowFloatingComponentOptions, ShowFloatingMessageOptions } from './helpers/show-floating-component';
24
25
  export { showConfirmationDialog, showErrorDialog, showInformationDialog, showModalDialog, showWarningDialog } from './helpers/show-modal-dialog';
25
26
  export type { ShowModalDialogOptions } from './helpers/show-modal-dialog';
26
27
  export type { ModalDialogButton, ModalDialogImage, ModalDialogResult, ModalDialogType } from './types/modal-dialog';
@@ -34,4 +35,6 @@ export type { SnackbarDirection, SnackbarPlacement } from './internal/snackbar-i
34
35
  export type { LabelPreset } from './types/label-preset';
35
36
  export type { MovableWindowContentProps, MovableWindowDragMode, MovableWindowHandle } from './types/movable-window';
36
37
  export type { TabContentStatus } from './internal/tab-group-context';
38
+ export { vueCoreOptionsKey } from './helpers/vue-core-options';
39
+ export type { DataTableOptions, VueCoreOptions } from './helpers/vue-core-options';
37
40
  export type { PopoverPlacement } from './internal/anchored-position';