@digitalwalletcorp/vue-core 1.3.1 → 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 +36 -0
- package/lib/{components-BuTJ1wX8.js → components-B2jz-g6A.js} +1 -1
- package/lib/{components-CKql5lWg.cjs → components-COL2ZbhC.cjs} +1 -1
- package/lib/data-table.d.cts +101 -8
- package/lib/data-table.d.ts +101 -8
- package/lib/helpers/vue-core-options.d.cts +17 -0
- package/lib/helpers/vue-core-options.d.ts +17 -0
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +4 -1
- package/lib/index.d.ts +4 -1
- package/lib/index.js +30 -29
- package/lib/internal/data-table-controls.d.cts +2 -2
- package/lib/internal/data-table-controls.d.ts +2 -2
- package/lib/nuxt.cjs +1 -1
- package/lib/nuxt.js +1 -1
- package/lib/register.cjs +1 -1
- package/lib/register.js +1 -1
- package/lib/types/data-table.d.cts +0 -93
- package/lib/types/data-table.d.ts +0 -93
- package/lib/warning-popper.vue_vue_type_style_index_0_lang-4FIOsOY5.cjs +1 -0
- package/lib/{warning-popper.vue_vue_type_style_index_0_lang-BKV_FX6k.js → warning-popper.vue_vue_type_style_index_0_lang-CgXoSjjp.js} +745 -717
- package/package.json +1 -1
- package/src/data-table.vue +188 -48
- package/src/helpers/vue-core-options.ts +20 -0
- package/src/index.ts +4 -1
- package/src/types/data-table.ts +0 -97
- package/lib/warning-popper.vue_vue_type_style_index_0_lang-CHmkjVCO.cjs +0 -1
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-
|
|
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-
|
|
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=_;
|
package/lib/data-table.d.cts
CHANGED
|
@@ -1,14 +1,107 @@
|
|
|
1
|
-
import {
|
|
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<
|
|
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
103
|
"onEmit:updateHeader"?: ((headers: DataTableHeader<T>[]) => any) | undefined;
|
|
7
104
|
"onEmit:dblclickRow"?: ((value: T, index: number) => any) | undefined;
|
|
8
|
-
"onEmit:changeLimit"?: ((limit: number) => any) | undefined;
|
|
9
|
-
"onEmit:changePage"?: ((page: number) => any) | undefined;
|
|
10
|
-
"onEmit:downloadPage"?: (() => any) | undefined;
|
|
11
|
-
"onEmit:downloadAll"?: (() => any) | undefined;
|
|
12
105
|
}> & import('vue').PublicProps & (typeof globalThis extends {
|
|
13
106
|
__VLS_PROPS_FALLBACK: infer P;
|
|
14
107
|
} ? P : {});
|
|
@@ -17,8 +110,8 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
17
110
|
getSortContext: () => DataTableSortContext;
|
|
18
111
|
}>) => void;
|
|
19
112
|
attrs: any;
|
|
20
|
-
slots:
|
|
21
|
-
emit:
|
|
113
|
+
slots: Slots<T>;
|
|
114
|
+
emit: Emits<T>;
|
|
22
115
|
}>) => import('vue').VNode & {
|
|
23
116
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
24
117
|
};
|
package/lib/data-table.d.ts
CHANGED
|
@@ -1,14 +1,107 @@
|
|
|
1
|
-
import {
|
|
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<
|
|
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
103
|
"onEmit:updateHeader"?: ((headers: DataTableHeader<T>[]) => any) | undefined;
|
|
7
104
|
"onEmit:dblclickRow"?: ((value: T, index: number) => any) | undefined;
|
|
8
|
-
"onEmit:changeLimit"?: ((limit: number) => any) | undefined;
|
|
9
|
-
"onEmit:changePage"?: ((page: number) => any) | undefined;
|
|
10
|
-
"onEmit:downloadPage"?: (() => any) | undefined;
|
|
11
|
-
"onEmit:downloadAll"?: (() => any) | undefined;
|
|
12
105
|
}> & import('vue').PublicProps & (typeof globalThis extends {
|
|
13
106
|
__VLS_PROPS_FALLBACK: infer P;
|
|
14
107
|
} ? P : {});
|
|
@@ -17,8 +110,8 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
17
110
|
getSortContext: () => DataTableSortContext;
|
|
18
111
|
}>) => void;
|
|
19
112
|
attrs: any;
|
|
20
|
-
slots:
|
|
21
|
-
emit:
|
|
113
|
+
slots: Slots<T>;
|
|
114
|
+
emit: Emits<T>;
|
|
22
115
|
}>) => import('vue').VNode & {
|
|
23
116
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
24
117
|
};
|
|
@@ -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-CHmkjVCO.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 b=document.documentElement.scrollLeft,v=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+b,u.position.y=k.top+v}else u.position.x=10+b,u.position.y=10+v};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 G(o,t){return g(o,{...t,type:"confirm"})}function U(o,t){return g(o,{...t,type:"warn"})}function J(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 K(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.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=g;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,7 +19,7 @@ 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,
|
|
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
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';
|
|
@@ -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,7 +19,7 @@ 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,
|
|
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
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';
|
|
@@ -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';
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as
|
|
2
|
-
import { f as Xe, h as Ye, i as Qe, j as Ze, k as en, l as nn, m as tn, o as on, p as an, q as sn, s as ln, t as rn, u as cn, v as dn, w as un } from "./warning-popper.vue_vue_type_style_index_0_lang-
|
|
1
|
+
import { r as J, g as X, n as A, _ as Y, a as Q, c as Z, b as ee, d as ne, e as te } from "./warning-popper.vue_vue_type_style_index_0_lang-CgXoSjjp.js";
|
|
2
|
+
import { f as Xe, h as Ye, i as Qe, j as Ze, k as en, l as nn, m as tn, o as on, p as an, q as sn, s as ln, t as rn, u as cn, v as dn, w as un, x as pn } from "./warning-popper.vue_vue_type_style_index_0_lang-CgXoSjjp.js";
|
|
3
3
|
import { defineComponent as E, ref as C, onMounted as oe, openBlock as p, createBlock as L, Transition as ae, withCtx as b, normalizeStyle as P, normalizeClass as S, createSlots as se, renderSlot as le, createTextVNode as re, toDisplayString as y, createVNode as F, createCommentVNode as g, getCurrentInstance as ie, onBeforeUnmount as ce, render as m, h as u, computed as M, TransitionGroup as de, createElementBlock as f, unref as ue, Fragment as pe, renderList as me, createElementVNode as fe, shallowReactive as we } from "vue";
|
|
4
4
|
import { SvgWastebasket as ge } from "@digitalwalletcorp/vue-svg-icons";
|
|
5
5
|
const he = "$index", H = (n) => {
|
|
@@ -11,7 +11,7 @@ const he = "$index", H = (n) => {
|
|
|
11
11
|
for (const o of e.csv)
|
|
12
12
|
o.disabled || t.push({ header: e, column: o });
|
|
13
13
|
return t;
|
|
14
|
-
}, De = (n) => H(n).map(({ header: t, column: e }) =>
|
|
14
|
+
}, De = (n) => H(n).map(({ header: t, column: e }) => J(e.label ?? t.label)), Ae = (n, t, e) => H(n).map(({ header: o, column: a }) => {
|
|
15
15
|
if (a.format)
|
|
16
16
|
return a.format(t);
|
|
17
17
|
const s = a.key ?? o.id;
|
|
@@ -50,13 +50,13 @@ const he = "$index", H = (n) => {
|
|
|
50
50
|
window.innerHeight < h && (h = window.innerHeight * 0.9), c.size.width = w, c.size.height = h;
|
|
51
51
|
const O = document.documentElement.scrollLeft, T = document.documentElement.scrollTop;
|
|
52
52
|
if (e.anchor) {
|
|
53
|
-
const
|
|
53
|
+
const U = {
|
|
54
54
|
width: w,
|
|
55
55
|
height: 0 <= h ? h : d.height
|
|
56
|
-
},
|
|
56
|
+
}, q = {
|
|
57
57
|
width: document.documentElement.clientWidth,
|
|
58
58
|
height: document.documentElement.clientHeight
|
|
59
|
-
}, D = Z(e.anchor.getBoundingClientRect(),
|
|
59
|
+
}, D = Z(e.anchor.getBoundingClientRect(), U, q, {
|
|
60
60
|
placement: "bottom-start",
|
|
61
61
|
offset: 0,
|
|
62
62
|
margin: 0,
|
|
@@ -201,7 +201,7 @@ function Fe() {
|
|
|
201
201
|
}
|
|
202
202
|
};
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function _(n, t) {
|
|
205
205
|
const { icon: e, appContext: o, ...a } = t ?? {};
|
|
206
206
|
return new Promise((s) => {
|
|
207
207
|
const r = document.createElement("div");
|
|
@@ -218,25 +218,25 @@ function x(n, t) {
|
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
220
|
function He(n, t) {
|
|
221
|
-
return
|
|
221
|
+
return _(n, {
|
|
222
222
|
...t,
|
|
223
223
|
type: "info"
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
226
|
function Ve(n, t) {
|
|
227
|
-
return
|
|
227
|
+
return _(n, {
|
|
228
228
|
...t,
|
|
229
229
|
type: "confirm"
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
232
|
function Ie(n, t) {
|
|
233
|
-
return
|
|
233
|
+
return _(n, {
|
|
234
234
|
...t,
|
|
235
235
|
type: "warn"
|
|
236
236
|
});
|
|
237
237
|
}
|
|
238
238
|
function ze(n, t) {
|
|
239
|
-
return
|
|
239
|
+
return _(n, {
|
|
240
240
|
...t,
|
|
241
241
|
type: "error"
|
|
242
242
|
});
|
|
@@ -287,10 +287,10 @@ const ye = ["aria-label", "title"], ve = ["title", "onClick"], Ce = {
|
|
|
287
287
|
}, ke = {
|
|
288
288
|
key: 0,
|
|
289
289
|
class: "dwui-snackbar-title"
|
|
290
|
-
},
|
|
290
|
+
}, xe = {
|
|
291
291
|
key: 1,
|
|
292
292
|
class: "dwui-snackbar-label"
|
|
293
|
-
},
|
|
293
|
+
}, _e = { class: "dwui-snackbar-message" }, Le = {
|
|
294
294
|
key: 1,
|
|
295
295
|
class: "dwui-snackbar-timestamp"
|
|
296
296
|
}, Se = /* @__PURE__ */ E({
|
|
@@ -338,9 +338,9 @@ const ye = ["aria-label", "title"], ve = ["title", "onClick"], Ce = {
|
|
|
338
338
|
}, [
|
|
339
339
|
l.title || l.label ? (p(), f("span", Ce, [
|
|
340
340
|
l.title ? (p(), f("span", ke, y(l.title), 1)) : g("", !0),
|
|
341
|
-
l.label ? (p(), f("span",
|
|
341
|
+
l.label ? (p(), f("span", xe, y(l.label), 1)) : g("", !0)
|
|
342
342
|
])) : g("", !0),
|
|
343
|
-
fe("span",
|
|
343
|
+
fe("span", _e, y(l.message), 1),
|
|
344
344
|
l.timestamp ? (p(), f("span", Le, y(l.timestamp), 1)) : g("", !0)
|
|
345
345
|
], 14, ve))), 128))
|
|
346
346
|
]),
|
|
@@ -349,17 +349,17 @@ const ye = ["aria-label", "title"], ve = ["title", "onClick"], Ce = {
|
|
|
349
349
|
}
|
|
350
350
|
}), Be = 50, v = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map();
|
|
351
351
|
let W = 0;
|
|
352
|
-
const
|
|
352
|
+
const x = (n, t, e) => {
|
|
353
353
|
const o = n.findIndex((s) => s.id === t);
|
|
354
354
|
if (o < 0)
|
|
355
355
|
return;
|
|
356
356
|
n.splice(o, 1);
|
|
357
357
|
const a = B.get(t);
|
|
358
358
|
B.delete(t), clearTimeout(a?.timer), a?.onClose?.(e);
|
|
359
|
-
},
|
|
359
|
+
}, K = (n) => {
|
|
360
360
|
const t = n.map((e) => e.id);
|
|
361
361
|
for (let e = 0; e < t.length; e++)
|
|
362
|
-
setTimeout(() =>
|
|
362
|
+
setTimeout(() => x(n, t[e], "clear"), Be * e);
|
|
363
363
|
}, Ee = (n, t) => {
|
|
364
364
|
const e = `${n} ${t}`, o = v.get(e);
|
|
365
365
|
if (o)
|
|
@@ -371,14 +371,14 @@ const _ = (n, t, e) => {
|
|
|
371
371
|
placement: n,
|
|
372
372
|
direction: t,
|
|
373
373
|
items: s,
|
|
374
|
-
"onEmit:close": (r) =>
|
|
375
|
-
"onEmit:clear": () =>
|
|
374
|
+
"onEmit:close": (r) => x(s, r, "click"),
|
|
375
|
+
"onEmit:clear": () => K(s),
|
|
376
376
|
"onEmit:afterLeave": () => {
|
|
377
377
|
s.length === 0 && v.get(e) === s && (v.delete(e), m(null, a), a.remove());
|
|
378
378
|
}
|
|
379
379
|
}), a), s;
|
|
380
380
|
};
|
|
381
|
-
function
|
|
381
|
+
function Ke(n, t) {
|
|
382
382
|
const {
|
|
383
383
|
placement: e = "bottom",
|
|
384
384
|
direction: o = "overlap",
|
|
@@ -397,15 +397,15 @@ function Ue(n, t) {
|
|
|
397
397
|
clearable: s,
|
|
398
398
|
clearLabel: r
|
|
399
399
|
}), B.set(d, {
|
|
400
|
-
timer: a ? setTimeout(() =>
|
|
400
|
+
timer: a ? setTimeout(() => x(c, d, "duration"), a) : void 0,
|
|
401
401
|
onClose: i
|
|
402
402
|
}), {
|
|
403
|
-
close: () =>
|
|
403
|
+
close: () => x(c, d, "handle")
|
|
404
404
|
};
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function Ue() {
|
|
407
407
|
for (const n of v.values())
|
|
408
|
-
|
|
408
|
+
K(n);
|
|
409
409
|
}
|
|
410
410
|
export {
|
|
411
411
|
Xe as AccordionFieldset,
|
|
@@ -429,7 +429,7 @@ export {
|
|
|
429
429
|
un as WarningPopper,
|
|
430
430
|
Pe as closeAllFloatingComponents,
|
|
431
431
|
Re as closeAllOverlayBoxes,
|
|
432
|
-
|
|
432
|
+
Ue as closeAllSnackbars,
|
|
433
433
|
De as headersToCsvColumns,
|
|
434
434
|
Ae as rowToCsvColumns,
|
|
435
435
|
Ve as showConfirmationDialog,
|
|
@@ -437,11 +437,12 @@ export {
|
|
|
437
437
|
Me as showFloatingComponent,
|
|
438
438
|
We as showFloatingMessage,
|
|
439
439
|
He as showInformationDialog,
|
|
440
|
-
|
|
440
|
+
_ as showModalDialog,
|
|
441
441
|
Ne as showOverlayBox,
|
|
442
442
|
Ge as showScreenLoading,
|
|
443
|
-
|
|
443
|
+
Ke as showSnackbar,
|
|
444
444
|
Ie as showWarningDialog,
|
|
445
445
|
Fe as useFloatingComponent,
|
|
446
|
-
je as useOverlayBox
|
|
446
|
+
je as useOverlayBox,
|
|
447
|
+
pn as vueCoreOptionsKey
|
|
447
448
|
};
|
|
@@ -28,13 +28,13 @@ interface Props {
|
|
|
28
28
|
formatTotalCount?: (count: number) => string;
|
|
29
29
|
}
|
|
30
30
|
declare const __VLS_export: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
31
|
-
"emit:changeLimit": (limit: number) => any;
|
|
32
31
|
"emit:changePage": (page: number) => any;
|
|
32
|
+
"emit:changeLimit": (limit: number) => any;
|
|
33
33
|
"emit:downloadPage": () => any;
|
|
34
34
|
"emit:downloadAll": () => any;
|
|
35
35
|
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
36
|
-
"onEmit:changeLimit"?: ((limit: number) => any) | undefined;
|
|
37
36
|
"onEmit:changePage"?: ((page: number) => any) | undefined;
|
|
37
|
+
"onEmit:changeLimit"?: ((limit: number) => any) | undefined;
|
|
38
38
|
"onEmit:downloadPage"?: (() => any) | undefined;
|
|
39
39
|
"onEmit:downloadAll"?: (() => any) | undefined;
|
|
40
40
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|