@digitalwalletcorp/vue-core 1.4.0 → 1.4.2

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.
Files changed (110) hide show
  1. package/lib/accordion-section.d.cts +1 -1
  2. package/lib/accordion-section.d.ts +1 -1
  3. package/lib/{components-B2jz-g6A.js → components-Mk1fpjbw.js} +5 -5
  4. package/lib/components-ytOBcKlQ.cjs +1 -0
  5. package/lib/data-table.d.cts +1 -1
  6. package/lib/data-table.d.ts +1 -1
  7. package/lib/{types → helpers}/data-table.d.cts +47 -0
  8. package/lib/{types → helpers}/data-table.d.ts +47 -0
  9. package/lib/helpers/{show-floating-component.d.cts → floating-component.d.cts} +1 -1
  10. package/lib/helpers/{show-floating-component.d.ts → floating-component.d.ts} +1 -1
  11. package/lib/helpers/{show-modal-dialog.d.cts → modal-dialog.d.cts} +21 -7
  12. package/lib/helpers/{show-modal-dialog.d.ts → modal-dialog.d.ts} +21 -7
  13. package/lib/helpers/{show-overlay-box.d.ts → overlay-box.d.cts} +3 -1
  14. package/lib/helpers/{show-overlay-box.d.cts → overlay-box.d.ts} +3 -1
  15. package/lib/helpers/{show-snackbar.d.cts → snackbar.d.cts} +16 -1
  16. package/lib/helpers/{show-snackbar.d.ts → snackbar.d.ts} +16 -1
  17. package/lib/index.cjs +1 -1
  18. package/lib/index.d.cts +15 -18
  19. package/lib/index.d.ts +15 -18
  20. package/lib/index.js +181 -265
  21. package/lib/internal/data-table-controls.d.cts +1 -1
  22. package/lib/internal/data-table-controls.d.ts +1 -1
  23. package/lib/internal/floating-component.d.cts +1 -1
  24. package/lib/internal/floating-component.d.ts +1 -1
  25. package/lib/internal/message.d.cts +11 -0
  26. package/lib/internal/message.d.ts +11 -0
  27. package/lib/internal/movable-window.d.cts +1 -1
  28. package/lib/internal/movable-window.d.ts +1 -1
  29. package/lib/internal/pagination.d.cts +1 -1
  30. package/lib/internal/pagination.d.ts +1 -1
  31. package/lib/internal/snackbar-container.d.cts +1 -1
  32. package/lib/internal/snackbar-container.d.ts +1 -1
  33. package/lib/internal/use-movable-window.d.cts +1 -1
  34. package/lib/internal/use-movable-window.d.ts +1 -1
  35. package/lib/internal/{mount-window.d.cts → window-control.d.cts} +22 -1
  36. package/lib/internal/{mount-window.d.ts → window-control.d.ts} +22 -1
  37. package/lib/label-button.d.cts +1 -1
  38. package/lib/label-button.d.ts +1 -1
  39. package/lib/label-icon.d.cts +12 -2
  40. package/lib/label-icon.d.ts +12 -2
  41. package/lib/modal-dialog.d.cts +5 -5
  42. package/lib/modal-dialog.d.ts +5 -5
  43. package/lib/nuxt.cjs +1 -1
  44. package/lib/nuxt.js +1 -1
  45. package/lib/overlay-box.d.cts +1 -1
  46. package/lib/overlay-box.d.ts +1 -1
  47. package/lib/register.cjs +1 -1
  48. package/lib/register.js +1 -1
  49. package/lib/style.css +1 -1
  50. package/lib/tab-content.d.cts +1 -1
  51. package/lib/tab-content.d.ts +1 -1
  52. package/lib/warning-popper.vue_vue_type_style_index_0_lang-142lRixg.cjs +4 -0
  53. package/lib/warning-popper.vue_vue_type_style_index_0_lang-BKR56ef2.js +2019 -0
  54. package/package.json +1 -1
  55. package/src/accordion-section.vue +1 -1
  56. package/src/data-table.vue +2 -2
  57. package/src/helpers/data-table.ts +250 -0
  58. package/src/helpers/{show-floating-component.ts → floating-component.ts} +3 -6
  59. package/src/helpers/{show-modal-dialog.ts → modal-dialog.ts} +26 -7
  60. package/src/helpers/{show-overlay-box.ts → overlay-box.ts} +5 -2
  61. package/src/helpers/{show-snackbar.ts → snackbar.ts} +19 -1
  62. package/src/index.ts +15 -18
  63. package/src/internal/data-table-controls.vue +1 -1
  64. package/src/internal/floating-component.vue +2 -2
  65. package/src/internal/message.ts +118 -0
  66. package/src/internal/movable-window.vue +1 -1
  67. package/src/internal/pagination.vue +1 -1
  68. package/src/internal/snackbar-container.vue +1 -1
  69. package/src/internal/use-movable-window.ts +1 -1
  70. package/src/internal/{mount-window.ts → window-control.ts} +31 -1
  71. package/src/label-button.vue +1 -1
  72. package/src/label-icon.vue +13 -2
  73. package/src/modal-dialog.vue +17 -10
  74. package/src/overlay-box.vue +3 -3
  75. package/src/tab-content.vue +2 -2
  76. package/src/tab-group.vue +2 -2
  77. package/lib/components-COL2ZbhC.cjs +0 -1
  78. package/lib/helpers/data-table-csv.d.cts +0 -17
  79. package/lib/helpers/data-table-csv.d.ts +0 -17
  80. package/lib/internal/data-table-value.d.cts +0 -32
  81. package/lib/internal/data-table-value.d.ts +0 -32
  82. package/lib/internal/opened-overlay-boxes.d.cts +0 -2
  83. package/lib/internal/opened-overlay-boxes.d.ts +0 -2
  84. package/lib/internal/snackbar-item.d.cts +0 -17
  85. package/lib/internal/snackbar-item.d.ts +0 -17
  86. package/lib/internal/window-order.d.cts +0 -6
  87. package/lib/internal/window-order.d.ts +0 -6
  88. package/lib/types/label-preset.d.cts +0 -12
  89. package/lib/types/label-preset.d.ts +0 -12
  90. package/lib/types/modal-dialog.d.cts +0 -13
  91. package/lib/types/modal-dialog.d.ts +0 -13
  92. package/lib/types/movable-window.d.cts +0 -16
  93. package/lib/types/movable-window.d.ts +0 -16
  94. package/lib/warning-popper.vue_vue_type_style_index_0_lang-4FIOsOY5.cjs +0 -1
  95. package/lib/warning-popper.vue_vue_type_style_index_0_lang-CgXoSjjp.js +0 -1865
  96. package/src/helpers/data-table-csv.ts +0 -55
  97. package/src/internal/data-table-value.ts +0 -99
  98. package/src/internal/opened-overlay-boxes.ts +0 -2
  99. package/src/internal/snackbar-item.ts +0 -20
  100. package/src/internal/window-order.ts +0 -11
  101. package/src/types/data-table.ts +0 -99
  102. package/src/types/label-preset.ts +0 -13
  103. package/src/types/modal-dialog.ts +0 -16
  104. package/src/types/movable-window.ts +0 -18
  105. /package/lib/helpers/{show-screen-loading.d.cts → screen-loading.d.cts} +0 -0
  106. /package/lib/helpers/{show-screen-loading.d.ts → screen-loading.d.ts} +0 -0
  107. /package/lib/internal/{tab-group-context.d.cts → tab-group.d.cts} +0 -0
  108. /package/lib/internal/{tab-group-context.d.ts → tab-group.d.ts} +0 -0
  109. /package/src/helpers/{show-screen-loading.ts → screen-loading.ts} +0 -0
  110. /package/src/internal/{tab-group-context.ts → tab-group.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import { LabelPreset } from './types/label-preset.cjs';
1
+ import { LabelPreset } from './label-icon.cjs';
2
2
  export interface Props {
3
3
  /** trueの場合、開閉ボタンを無効にする */
4
4
  disabled?: boolean;
@@ -1,4 +1,4 @@
1
- import { LabelPreset } from './types/label-preset';
1
+ import { LabelPreset } from './label-icon';
2
2
  export interface Props {
3
3
  /** trueの場合、開閉ボタンを無効にする */
4
4
  disabled?: boolean;
@@ -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-CgXoSjjp.js";
1
+ import { e as a, f as s, a as n, g as _, h as o, i as e, j as c, k as i, l as t, o as f, p as m, b as r, q as l, r as $, s as p, d, v as g, w as b, x as u } from "./warning-popper.vue_vue_type_style_index_0_lang-BKR56ef2.js";
2
2
  const y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3
3
  __proto__: null,
4
4
  AccordionFieldset: a,
@@ -10,15 +10,15 @@ const y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
10
10
  HelpPopper: c,
11
11
  HourglassLoading: i,
12
12
  IntersectionLazyComponent: t,
13
- LabelButton: m,
14
- LabelIcon: f,
13
+ LabelButton: f,
14
+ LabelIcon: m,
15
15
  ModalDialog: r,
16
16
  OverlayBox: l,
17
17
  PageSection: $,
18
18
  PageTitle: p,
19
19
  ScreenLoading: d,
20
- TabContent: b,
21
- TabGroup: g,
20
+ TabContent: g,
21
+ TabGroup: b,
22
22
  WarningPopper: u
23
23
  }, Symbol.toStringTag, { value: "Module" }));
24
24
  export {
@@ -0,0 +1 @@
1
+ "use strict";const n=require("./warning-popper.vue_vue_type_style_index_0_lang-142lRixg.cjs"),_=Object.freeze(Object.defineProperty({__proto__:null,AccordionFieldset:n._sfc_main$4,AccordionSection:n._sfc_main$5,CopyButton:n._sfc_main$1,DarkModeSelector:n._sfc_main$6,DataTable:n._sfc_main$7,HelpButton:n._sfc_main$8,HelpPopper:n._sfc_main$9,HourglassLoading:n._sfc_main$10,IntersectionLazyComponent:n._sfc_main$11,LabelButton:n._sfc_main$12,LabelIcon:n._sfc_main$13,ModalDialog:n._sfc_main$2,OverlayBox:n._sfc_main$14,PageSection:n._sfc_main$15,PageTitle:n._sfc_main$16,ScreenLoading:n._sfc_main$3,TabContent:n._sfc_main$17,TabGroup:n._sfc_main$18,WarningPopper:n._sfc_main$19},Symbol.toStringTag,{value:"Module"}));exports.components=_;
@@ -1,5 +1,5 @@
1
1
  import { ClassValue, StyleValue } from 'vue';
2
- import { DataTableControlsPlacement, DataTableHeader, DataTableLabels, DataTableSortContext, DataTableSortMode } from './types/data-table.cjs';
2
+ import { DataTableControlsPlacement, DataTableHeader, DataTableLabels, DataTableSortContext, DataTableSortMode } from './helpers/data-table.cjs';
3
3
  /**
4
4
  * DataTable の props
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import { ClassValue, StyleValue } from 'vue';
2
- import { DataTableControlsPlacement, DataTableHeader, DataTableLabels, DataTableSortContext, DataTableSortMode } from './types/data-table';
2
+ import { DataTableControlsPlacement, DataTableHeader, DataTableLabels, DataTableSortContext, DataTableSortMode } from './helpers/data-table';
3
3
  /**
4
4
  * DataTable の props
5
5
  */
@@ -90,3 +90,50 @@ export interface DataTableSortContext {
90
90
  /** 降順なら true */
91
91
  descending: boolean;
92
92
  }
93
+ /**
94
+ * ドット区切りのパスで入れ子の値を取り出す。途中が null なら undefined
95
+ *
96
+ * @param {unknown} obj
97
+ * @param {string} path 'a.b.c' の形。'a[0].b' は 'a.0.b' と同じ
98
+ * @returns {unknown}
99
+ */
100
+ export declare const getValueByPath: (obj: unknown, path: string) => unknown;
101
+ /**
102
+ * 文字列または文字列を返す関数から文字列を得る
103
+ *
104
+ * @param {string | (() => string)} label
105
+ * @returns {string}
106
+ */
107
+ export declare const resolveLabel: (label: string | (() => string) | undefined) => string;
108
+ /**
109
+ * 型に応じて2つの値を比較する。null / undefined は最小として扱う
110
+ *
111
+ * @param {unknown} a
112
+ * @param {unknown} b
113
+ * @param {DataTableValueType} type
114
+ * @returns {number} a が前なら負の数、後ろなら正の数、等しければ 0
115
+ */
116
+ export declare const compareValues: (a: unknown, b: unknown, type: DataTableValueType) => number;
117
+ /**
118
+ * 行の同一性の判定に使う文字列にする。bigint は文字列にし、循環参照は空文字にする
119
+ *
120
+ * @param {unknown} value
121
+ * @returns {string}
122
+ */
123
+ export declare const stringifyValue: (value: unknown) => string;
124
+ /**
125
+ * ヘッダの csv の定義から CSV の列名を作る
126
+ *
127
+ * @param {DataTableHeader<T>[]} headers
128
+ * @returns {string[]} 列名
129
+ */
130
+ export declare const headersToCsvColumns: <T>(headers: DataTableHeader<T>[]) => string[];
131
+ /**
132
+ * ヘッダの csv の定義に従って行から CSV の列の値を取り出す
133
+ *
134
+ * @param {DataTableHeader<T>[]} headers
135
+ * @param {T} row
136
+ * @param {number} [rowNumber] key が '$index' の列に出力する行番号
137
+ * @returns {unknown[]} 列の値。文字列化はしない
138
+ */
139
+ export declare const rowToCsvColumns: <T>(headers: DataTableHeader<T>[], row: T, rowNumber?: number) => unknown[];
@@ -90,3 +90,50 @@ export interface DataTableSortContext {
90
90
  /** 降順なら true */
91
91
  descending: boolean;
92
92
  }
93
+ /**
94
+ * ドット区切りのパスで入れ子の値を取り出す。途中が null なら undefined
95
+ *
96
+ * @param {unknown} obj
97
+ * @param {string} path 'a.b.c' の形。'a[0].b' は 'a.0.b' と同じ
98
+ * @returns {unknown}
99
+ */
100
+ export declare const getValueByPath: (obj: unknown, path: string) => unknown;
101
+ /**
102
+ * 文字列または文字列を返す関数から文字列を得る
103
+ *
104
+ * @param {string | (() => string)} label
105
+ * @returns {string}
106
+ */
107
+ export declare const resolveLabel: (label: string | (() => string) | undefined) => string;
108
+ /**
109
+ * 型に応じて2つの値を比較する。null / undefined は最小として扱う
110
+ *
111
+ * @param {unknown} a
112
+ * @param {unknown} b
113
+ * @param {DataTableValueType} type
114
+ * @returns {number} a が前なら負の数、後ろなら正の数、等しければ 0
115
+ */
116
+ export declare const compareValues: (a: unknown, b: unknown, type: DataTableValueType) => number;
117
+ /**
118
+ * 行の同一性の判定に使う文字列にする。bigint は文字列にし、循環参照は空文字にする
119
+ *
120
+ * @param {unknown} value
121
+ * @returns {string}
122
+ */
123
+ export declare const stringifyValue: (value: unknown) => string;
124
+ /**
125
+ * ヘッダの csv の定義から CSV の列名を作る
126
+ *
127
+ * @param {DataTableHeader<T>[]} headers
128
+ * @returns {string[]} 列名
129
+ */
130
+ export declare const headersToCsvColumns: <T>(headers: DataTableHeader<T>[]) => string[];
131
+ /**
132
+ * ヘッダの csv の定義に従って行から CSV の列の値を取り出す
133
+ *
134
+ * @param {DataTableHeader<T>[]} headers
135
+ * @param {T} row
136
+ * @param {number} [rowNumber] key が '$index' の列に出力する行番号
137
+ * @returns {unknown[]} 列の値。文字列化はしない
138
+ */
139
+ export declare const rowToCsvColumns: <T>(headers: DataTableHeader<T>[], row: T, rowNumber?: number) => unknown[];
@@ -1,5 +1,5 @@
1
1
  import { AppContext, ClassValue, Component, StyleValue } from 'vue';
2
- import { MovableWindowContentProps, MovableWindowDragMode, MovableWindowHandle } from '../types/movable-window.cjs';
2
+ import { MovableWindowContentProps, MovableWindowDragMode, MovableWindowHandle } from '../internal/window-control.cjs';
3
3
  /** showFloatingComponent が中身のコンポーネントに props として渡す関数 */
4
4
  export type FloatingComponentContentProps = MovableWindowContentProps;
5
5
  /** showFloatingComponent / showFloatingMessage が返す、表示中のウィンドウを操作するためのハンドル */
@@ -1,5 +1,5 @@
1
1
  import { AppContext, ClassValue, Component, StyleValue } from 'vue';
2
- import { MovableWindowContentProps, MovableWindowDragMode, MovableWindowHandle } from '../types/movable-window';
2
+ import { MovableWindowContentProps, MovableWindowDragMode, MovableWindowHandle } from '../internal/window-control';
3
3
  /** showFloatingComponent が中身のコンポーネントに props として渡す関数 */
4
4
  export type FloatingComponentContentProps = MovableWindowContentProps;
5
5
  /** showFloatingComponent / showFloatingMessage が返す、表示中のウィンドウを操作するためのハンドル */
@@ -1,5 +1,19 @@
1
1
  import { AppContext, ClassValue, Component, StyleValue } from 'vue';
2
- import { ModalDialogButton, ModalDialogImage, ModalDialogResult, ModalDialogType } from '../types/modal-dialog.cjs';
2
+ /** モーダルダイアログに表示するメッセージ。オブジェクトは整形した JSON 風のテキストで表示する */
3
+ export type ModalDialogMessage = string | object;
4
+ /** モーダルダイアログの種類 */
5
+ export type ModalDialogType = 'info' | 'confirm' | 'warn' | 'error';
6
+ /** モーダルダイアログに並べるボタンの種類 */
7
+ export type ModalDialogButton = 'ok' | 'yes' | 'no' | 'cancel';
8
+ /** モーダルダイアログを閉じたボタン。Esc で閉じたときは cancel */
9
+ export type ModalDialogResult = ModalDialogButton;
10
+ /** モーダルダイアログに表示する画像。文字列は画像の URL */
11
+ export type ModalDialogImage = string | {
12
+ /** 画像の URL */
13
+ src: string;
14
+ /** 代替テキスト */
15
+ alt: string;
16
+ };
3
17
  export interface ShowModalDialogOptions {
4
18
  /** ダイアログの種類 */
5
19
  type?: ModalDialogType;
@@ -34,11 +48,11 @@ export interface ShowModalDialogOptions {
34
48
  /**
35
49
  * ModalDialog を body の末尾に描画して開き、閉じたら取り外す。ブラウザでのみ動作する
36
50
  *
37
- * @param {string | string[]} message 表示する文字列。配列なら1要素を1段落として表示する
51
+ * @param {ModalDialogMessage | ModalDialogMessage[]} message 表示するメッセージ。配列なら1要素を1段落として表示する
38
52
  * @param {ShowModalDialogOptions} [options]
39
53
  * @returns {Promise<ModalDialogResult>} 閉じたボタン
40
54
  */
41
- export declare function showModalDialog(message: string | string[], options?: ShowModalDialogOptions): Promise<ModalDialogResult>;
55
+ export declare function showModalDialog(message: ModalDialogMessage | ModalDialogMessage[], options?: ShowModalDialogOptions): Promise<ModalDialogResult>;
42
56
  /**
43
57
  * 情報を伝えるダイアログを開く
44
58
  *
@@ -46,7 +60,7 @@ export declare function showModalDialog(message: string | string[], options?: Sh
46
60
  * @param {Omit<ShowModalDialogOptions, 'type'>} [options]
47
61
  * @returns {Promise<ModalDialogResult>} 閉じたボタン
48
62
  */
49
- export declare function showInformationDialog(message: string | string[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
63
+ export declare function showInformationDialog(message: ModalDialogMessage | ModalDialogMessage[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
50
64
  /**
51
65
  * Yes / No を尋ねるダイアログを開く
52
66
  *
@@ -54,7 +68,7 @@ export declare function showInformationDialog(message: string | string[], option
54
68
  * @param {Omit<ShowModalDialogOptions, 'type'>} [options]
55
69
  * @returns {Promise<ModalDialogResult>} 閉じたボタン
56
70
  */
57
- export declare function showConfirmationDialog(message: string | string[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
71
+ export declare function showConfirmationDialog(message: ModalDialogMessage | ModalDialogMessage[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
58
72
  /**
59
73
  * 警告のダイアログを開く
60
74
  *
@@ -62,7 +76,7 @@ export declare function showConfirmationDialog(message: string | string[], optio
62
76
  * @param {Omit<ShowModalDialogOptions, 'type'>} [options]
63
77
  * @returns {Promise<ModalDialogResult>} 閉じたボタン
64
78
  */
65
- export declare function showWarningDialog(message: string | string[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
79
+ export declare function showWarningDialog(message: ModalDialogMessage | ModalDialogMessage[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
66
80
  /**
67
81
  * エラーのダイアログを開く
68
82
  *
@@ -70,4 +84,4 @@ export declare function showWarningDialog(message: string | string[], options?:
70
84
  * @param {Omit<ShowModalDialogOptions, 'type'>} [options]
71
85
  * @returns {Promise<ModalDialogResult>} 閉じたボタン
72
86
  */
73
- export declare function showErrorDialog(message: string | string[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
87
+ export declare function showErrorDialog(message: ModalDialogMessage | ModalDialogMessage[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
@@ -1,5 +1,19 @@
1
1
  import { AppContext, ClassValue, Component, StyleValue } from 'vue';
2
- import { ModalDialogButton, ModalDialogImage, ModalDialogResult, ModalDialogType } from '../types/modal-dialog';
2
+ /** モーダルダイアログに表示するメッセージ。オブジェクトは整形した JSON 風のテキストで表示する */
3
+ export type ModalDialogMessage = string | object;
4
+ /** モーダルダイアログの種類 */
5
+ export type ModalDialogType = 'info' | 'confirm' | 'warn' | 'error';
6
+ /** モーダルダイアログに並べるボタンの種類 */
7
+ export type ModalDialogButton = 'ok' | 'yes' | 'no' | 'cancel';
8
+ /** モーダルダイアログを閉じたボタン。Esc で閉じたときは cancel */
9
+ export type ModalDialogResult = ModalDialogButton;
10
+ /** モーダルダイアログに表示する画像。文字列は画像の URL */
11
+ export type ModalDialogImage = string | {
12
+ /** 画像の URL */
13
+ src: string;
14
+ /** 代替テキスト */
15
+ alt: string;
16
+ };
3
17
  export interface ShowModalDialogOptions {
4
18
  /** ダイアログの種類 */
5
19
  type?: ModalDialogType;
@@ -34,11 +48,11 @@ export interface ShowModalDialogOptions {
34
48
  /**
35
49
  * ModalDialog を body の末尾に描画して開き、閉じたら取り外す。ブラウザでのみ動作する
36
50
  *
37
- * @param {string | string[]} message 表示する文字列。配列なら1要素を1段落として表示する
51
+ * @param {ModalDialogMessage | ModalDialogMessage[]} message 表示するメッセージ。配列なら1要素を1段落として表示する
38
52
  * @param {ShowModalDialogOptions} [options]
39
53
  * @returns {Promise<ModalDialogResult>} 閉じたボタン
40
54
  */
41
- export declare function showModalDialog(message: string | string[], options?: ShowModalDialogOptions): Promise<ModalDialogResult>;
55
+ export declare function showModalDialog(message: ModalDialogMessage | ModalDialogMessage[], options?: ShowModalDialogOptions): Promise<ModalDialogResult>;
42
56
  /**
43
57
  * 情報を伝えるダイアログを開く
44
58
  *
@@ -46,7 +60,7 @@ export declare function showModalDialog(message: string | string[], options?: Sh
46
60
  * @param {Omit<ShowModalDialogOptions, 'type'>} [options]
47
61
  * @returns {Promise<ModalDialogResult>} 閉じたボタン
48
62
  */
49
- export declare function showInformationDialog(message: string | string[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
63
+ export declare function showInformationDialog(message: ModalDialogMessage | ModalDialogMessage[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
50
64
  /**
51
65
  * Yes / No を尋ねるダイアログを開く
52
66
  *
@@ -54,7 +68,7 @@ export declare function showInformationDialog(message: string | string[], option
54
68
  * @param {Omit<ShowModalDialogOptions, 'type'>} [options]
55
69
  * @returns {Promise<ModalDialogResult>} 閉じたボタン
56
70
  */
57
- export declare function showConfirmationDialog(message: string | string[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
71
+ export declare function showConfirmationDialog(message: ModalDialogMessage | ModalDialogMessage[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
58
72
  /**
59
73
  * 警告のダイアログを開く
60
74
  *
@@ -62,7 +76,7 @@ export declare function showConfirmationDialog(message: string | string[], optio
62
76
  * @param {Omit<ShowModalDialogOptions, 'type'>} [options]
63
77
  * @returns {Promise<ModalDialogResult>} 閉じたボタン
64
78
  */
65
- export declare function showWarningDialog(message: string | string[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
79
+ export declare function showWarningDialog(message: ModalDialogMessage | ModalDialogMessage[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
66
80
  /**
67
81
  * エラーのダイアログを開く
68
82
  *
@@ -70,4 +84,4 @@ export declare function showWarningDialog(message: string | string[], options?:
70
84
  * @param {Omit<ShowModalDialogOptions, 'type'>} [options]
71
85
  * @returns {Promise<ModalDialogResult>} 閉じたボタン
72
86
  */
73
- export declare function showErrorDialog(message: string | string[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
87
+ export declare function showErrorDialog(message: ModalDialogMessage | ModalDialogMessage[], options?: Omit<ShowModalDialogOptions, 'type'>): Promise<ModalDialogResult>;
@@ -1,5 +1,7 @@
1
1
  import { AppContext, ClassValue, Component, StyleValue } from 'vue';
2
- import { MovableWindowContentProps, MovableWindowDragMode, MovableWindowHandle } from '../types/movable-window';
2
+ import { MovableWindowContentProps, MovableWindowDragMode, MovableWindowHandle } from '../internal/window-control.cjs';
3
+ /** 開いている OverlayBox を開いた順に持つ。Esc では最後に開いたものだけを閉じる */
4
+ export declare const openedOverlayBoxes: symbol[];
3
5
  /** showOverlayBox が中身のコンポーネントに props として渡す関数 */
4
6
  export type OverlayBoxContentProps = MovableWindowContentProps;
5
7
  /** showOverlayBox が返す、表示中のボックスを操作するためのハンドル */
@@ -1,5 +1,7 @@
1
1
  import { AppContext, ClassValue, Component, StyleValue } from 'vue';
2
- import { MovableWindowContentProps, MovableWindowDragMode, MovableWindowHandle } from '../types/movable-window.cjs';
2
+ import { MovableWindowContentProps, MovableWindowDragMode, MovableWindowHandle } from '../internal/window-control';
3
+ /** 開いている OverlayBox を開いた順に持つ。Esc では最後に開いたものだけを閉じる */
4
+ export declare const openedOverlayBoxes: symbol[];
3
5
  /** showOverlayBox が中身のコンポーネントに props として渡す関数 */
4
6
  export type OverlayBoxContentProps = MovableWindowContentProps;
5
7
  /** showOverlayBox が返す、表示中のボックスを操作するためのハンドル */
@@ -1,5 +1,20 @@
1
1
  import { ClassValue, StyleValue } from 'vue';
2
- import { SnackbarDirection, SnackbarPlacement } from '../internal/snackbar-item.cjs';
2
+ /** snackbar を表示する画面上の位置 */
3
+ export type SnackbarPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end';
4
+ /** 同じ表示領域に並べる向き。overlap は同じ位置に重ねて新しいものを前面に出し、column は縦に積み、row は横に並べて端で折り返す */
5
+ export type SnackbarDirection = 'overlap' | 'column' | 'row';
6
+ /** 表示領域に並べる snackbar 1件分の内容 */
7
+ export interface SnackbarItem {
8
+ id: number;
9
+ message: string;
10
+ title?: string;
11
+ label?: string;
12
+ timestamp?: string;
13
+ clearable: boolean;
14
+ clearLabel: string;
15
+ class?: ClassValue;
16
+ style?: StyleValue;
17
+ }
3
18
  /** snackbar が閉じた理由。click はクリック、duration は表示時間の経過、clear は一括消去ボタンと closeAllSnackbars()、handle は SnackbarHandle の close() */
4
19
  export type SnackbarCloseReason = 'click' | 'duration' | 'clear' | 'handle';
5
20
  export interface ShowSnackbarOptions {
@@ -1,5 +1,20 @@
1
1
  import { ClassValue, StyleValue } from 'vue';
2
- import { SnackbarDirection, SnackbarPlacement } from '../internal/snackbar-item';
2
+ /** snackbar を表示する画面上の位置 */
3
+ export type SnackbarPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end';
4
+ /** 同じ表示領域に並べる向き。overlap は同じ位置に重ねて新しいものを前面に出し、column は縦に積み、row は横に並べて端で折り返す */
5
+ export type SnackbarDirection = 'overlap' | 'column' | 'row';
6
+ /** 表示領域に並べる snackbar 1件分の内容 */
7
+ export interface SnackbarItem {
8
+ id: number;
9
+ message: string;
10
+ title?: string;
11
+ label?: string;
12
+ timestamp?: string;
13
+ clearable: boolean;
14
+ clearLabel: string;
15
+ class?: ClassValue;
16
+ style?: StyleValue;
17
+ }
3
18
  /** snackbar が閉じた理由。click はクリック、duration は表示時間の経過、clear は一括消去ボタンと closeAllSnackbars()、handle は SnackbarHandle の close() */
4
19
  export type SnackbarCloseReason = 'click' | 'duration' | 'clear' | 'handle';
5
20
  export interface ShowSnackbarOptions {
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-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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./warning-popper.vue_vue_type_style_index_0_lang-142lRixg.cjs"),e=require("vue"),E=require("@digitalwalletcorp/vue-svg-icons"),T=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(n,{emit:t}){const o=n,l=t,s=e.ref(),i=e.ref(a.nextWindowOrder()),c=()=>{i.value=a.nextWindowOrder()},d=()=>{o.closeOnDblClick&&l("update:open",!1)},r=()=>{const u=s.value;if(!u?.element)return;const m=u.element.getBoundingClientRect();let p=o.initialSize?.width??m.width;window.innerWidth<p&&(p=window.innerWidth*.9);let f=o.initialSize?.height??-1;window.innerHeight<f&&(f=window.innerHeight*.9),u.size.width=p,u.size.height=f;const C=document.documentElement.scrollLeft,b=document.documentElement.scrollTop;if(o.anchor){const L={width:p,height:0<=f?f:m.height},D={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight},k=a.computeAnchoredPosition(o.anchor.getBoundingClientRect(),L,D,{placement:"bottom-start",offset:0,margin:0,arrowMargin:0});u.position.x=k.left+C,u.position.y=k.top+b}else u.position.x=10+C,u.position.y=10+b};return e.onMounted(()=>{o.open&&r()}),(u,m)=>(e.openBlock(),e.createBlock(e.Transition,{name:"dwui-floating-component-fade",onAfterLeave:m[1]||(m[1]=p=>l("emit:close"))},{default:e.withCtx(()=>[o.open?(e.openBlock(),e.createBlock(a._sfc_main,{key:0,ref_key:"refWindow",ref:s,class:e.normalizeClass(["dwui-floating-component",{"dwui-lock-scroll":o.lockScroll}]),name:"dwui-floating-component",style:e.normalizeStyle({"--dwui-order-window":i.value}),"drag-mode":o.dragMode,loading:o.loading,"close-label":o.closeLabel,"clamp-bottom":!1,"header-class":o.headerClass,"header-style":o.headerStyle,onPointerdownCapture:c,onDblclick:d,"onEmit:close":m[0]||(m[0]=p=>l("update:open",!1))},e.createSlots({title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.title),1)]),default:e.withCtx(()=>[e.renderSlot(u.$slots,"default")]),_:2},[o.copyValue!=null?{name:"actions",fn:e.withCtx(()=>[e.createVNode(a._sfc_main$1,{class:"dwui-floating-component-copy-button",value:o.copyValue,"aria-label":o.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}))}}),B=new Set,h=(n,t,o)=>{const{appContext:l,onClose:s,...i}=t??{};return a.mountWindow((c,d)=>e.h(T,{closeLabel:"Close",copyLabel:"Copy",closeOnDblClick:!1,lockScroll:!1,...i,...c},{default:()=>n(d)}),{appContext:l,onClose:s,onClosed:o},B)},S=(n,t)=>o=>e.h(n,{...t,...o}),$=(n,t)=>()=>t&&typeof n=="string"?e.h("div",{class:"dwui-floating-component-message",innerHTML:n}):e.h("div",{class:"dwui-floating-component-message"},a.toMessageText(n));function O(n,t,o){return h(S(n,t),o)}function M(n,t){const{html:o,...l}=t??{};return h($(n,o),{copyValue:a.toMessageText(n),...l})}function V(){for(const n of[...B])n.close()}function A(){const n=a.useWindowOwner("useFloatingComponent"),t=o=>({appContext:n.appContext,...o});return{showFloatingComponent:(o,l,s)=>n.own(i=>h(S(o,l),t(s),i)),showFloatingMessage:(o,l)=>{const{html:s,...i}=l??{};return n.own(c=>h($(o,s),t({copyValue:a.toMessageText(o),...i}),c))}}}function w(n,t){const{icon:o,appContext:l,...s}=t??{};return new Promise(i=>{const c=document.createElement("div");document.body.appendChild(c);const d=e.h(a._sfc_main$2,{...s,message:n,open:!0,"onEmit:close":r=>{e.render(null,c),c.remove(),i(r)}},o?{icon:()=>e.h(o)}:void 0);l&&(d.appContext=l),e.render(d,c)})}function F(n,t){return w(n,{...t,type:"info"})}function W(n,t){return w(n,{...t,type:"confirm"})}function z(n,t){return w(n,{...t,type:"warn"})}function N(n,t){return w(n,{...t,type:"error"})}function P(n){const t=document.createElement("div");document.body.appendChild(t);const o=()=>{e.render(null,t),t.remove()};return e.render(e.h(a._sfc_main$3,{...n,loading:!0}),t),{close:o}}const I=["aria-label","title"],H=["title","onClick"],R={key:0,class:"dwui-snackbar-header"},j={key:0,class:"dwui-snackbar-title"},q={key:1,class:"dwui-snackbar-label"},G={class:"dwui-snackbar-message"},K={key:1,class:"dwui-snackbar-timestamp"},J=e.defineComponent({__name:"snackbar-container",props:{placement:{},direction:{},items:{}},emits:["emit:close","emit:clear","emit:afterLeave"],setup(n,{emit:t}){const o=n,l=t,s=e.computed(()=>{const[c,d="center"]=o.placement.split("-");return[`dwui-snackbar-container-${c}`,`dwui-snackbar-container-${d}`,`dwui-snackbar-container-${o.direction}`]}),i=e.computed(()=>o.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",s.value]),role:"status",onAfterLeave:d[1]||(d[1]=r=>l("emit:afterLeave"))},{default:e.withCtx(()=>[i.value!=null?(e.openBlock(),e.createElementBlock("button",{key:"clear",type:"button",class:"dwui-snackbar-clear-button","aria-label":i.value,title:i.value,onClick:d[0]||(d[0]=r=>l("emit:clear"))},[e.createVNode(e.unref(E.SvgWastebasket))],8,I)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.items,r=>(e.openBlock(),e.createElementBlock("button",{key:r.id,type:"button",class:e.normalizeClass(["dwui-snackbar",r.class]),style:e.normalizeStyle(r.style),title:r.message,onClick:u=>l("emit:close",r.id)},[r.title||r.label?(e.openBlock(),e.createElementBlock("span",R,[r.title?(e.openBlock(),e.createElementBlock("span",j,e.toDisplayString(r.title),1)):e.createCommentVNode("",!0),r.label?(e.openBlock(),e.createElementBlock("span",q,e.toDisplayString(r.label),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("span",G,e.toDisplayString(r.message),1),r.timestamp?(e.openBlock(),e.createElementBlock("span",K,e.toDisplayString(r.timestamp),1)):e.createCommentVNode("",!0)],14,H))),128))]),_:1},8,["class"]))}}),Q=50,g=new Map,y=new Map;let v=0;const _=(n,t,o)=>{const l=n.findIndex(i=>i.id===t);if(l<0)return;n.splice(l,1);const s=y.get(t);y.delete(t),clearTimeout(s?.timer),s?.onClose?.(o)},x=n=>{const t=n.map(o=>o.id);for(let o=0;o<t.length;o++)setTimeout(()=>_(n,t[o],"clear"),Q*o)},U=(n,t)=>{const o=`${n} ${t}`,l=g.get(o);if(l)return l;const s=document.createElement("div");document.body.appendChild(s);const i=e.shallowReactive([]);return g.set(o,i),e.render(e.h(J,{placement:n,direction:t,items:i,"onEmit:close":c=>_(i,c,"click"),"onEmit:clear":()=>x(i),"onEmit:afterLeave":()=>{i.length===0&&g.get(o)===i&&(g.delete(o),e.render(null,s),s.remove())}}),s),i};function X(n,t){const{placement:o="bottom",direction:l="overlap",duration:s,clearable:i=!1,clearLabel:c="Clear all",onClose:d,...r}=t??{},u=U(o,l);v+=1;const m=v;return u.push({...r,id:m,message:n,clearable:i,clearLabel:c}),y.set(m,{timer:s?setTimeout(()=>_(u,m,"duration"),s):void 0,onClose:d}),{close:()=>_(u,m,"handle")}}function Y(){for(const n of g.values())x(n)}exports.AccordionFieldset=a._sfc_main$4;exports.AccordionSection=a._sfc_main$5;exports.CopyButton=a._sfc_main$1;exports.DarkModeSelector=a._sfc_main$6;exports.DataTable=a._sfc_main$7;exports.HelpButton=a._sfc_main$8;exports.HelpPopper=a._sfc_main$9;exports.HourglassLoading=a._sfc_main$10;exports.IntersectionLazyComponent=a._sfc_main$11;exports.LabelButton=a._sfc_main$12;exports.LabelIcon=a._sfc_main$13;exports.ModalDialog=a._sfc_main$2;exports.OverlayBox=a._sfc_main$14;exports.PageSection=a._sfc_main$15;exports.PageTitle=a._sfc_main$16;exports.ScreenLoading=a._sfc_main$3;exports.TabContent=a._sfc_main$17;exports.TabGroup=a._sfc_main$18;exports.WarningPopper=a._sfc_main$19;exports.closeAllOverlayBoxes=a.closeAllOverlayBoxes;exports.headersToCsvColumns=a.headersToCsvColumns;exports.rowToCsvColumns=a.rowToCsvColumns;exports.showOverlayBox=a.showOverlayBox;exports.useOverlayBox=a.useOverlayBox;exports.vueCoreOptionsKey=a.vueCoreOptionsKey;exports.closeAllFloatingComponents=V;exports.closeAllSnackbars=Y;exports.showConfirmationDialog=W;exports.showErrorDialog=N;exports.showFloatingComponent=O;exports.showFloatingMessage=M;exports.showInformationDialog=F;exports.showModalDialog=w;exports.showScreenLoading=P;exports.showSnackbar=X;exports.showWarningDialog=z;exports.useFloatingComponent=A;
package/lib/index.d.cts CHANGED
@@ -9,7 +9,7 @@ export type { Props as HelpPopperProps, Emits as HelpPopperEmits, Slots as HelpP
9
9
  export type { Props as HourglassLoadingProps } from './hourglass-loading.cjs';
10
10
  export type { Props as IntersectionLazyComponentProps, Emits as IntersectionLazyComponentEmits, Slots as IntersectionLazyComponentSlots } from './intersection-lazy-component.cjs';
11
11
  export type { Props as LabelButtonProps, Slots as LabelButtonSlots } from './label-button.cjs';
12
- export type { Props as LabelIconProps, Slots as LabelIconSlots } from './label-icon.cjs';
12
+ export type { Props as LabelIconProps, Slots as LabelIconSlots, LabelPreset } from './label-icon.cjs';
13
13
  export type { Props as ModalDialogProps, Emits as ModalDialogEmits, Slots as ModalDialogSlots } from './modal-dialog.cjs';
14
14
  export type { Props as OverlayBoxProps, Emits as OverlayBoxEmits, Slots as OverlayBoxSlots } from './overlay-box.cjs';
15
15
  export type { Props as PageSectionProps, Slots as PageSectionSlots } from './page-section.cjs';
@@ -18,23 +18,20 @@ export type { Props as ScreenLoadingProps } from './screen-loading.cjs';
18
18
  export type { Props as TabContentProps, Slots as TabContentSlots } from './tab-content.cjs';
19
19
  export type { Props as TabGroupProps, Slots as TabGroupSlots } from './tab-group.cjs';
20
20
  export type { Props as WarningPopperProps, Emits as WarningPopperEmits, Slots as WarningPopperSlots } from './warning-popper.cjs';
21
- export { headersToCsvColumns, rowToCsvColumns } from './helpers/data-table-csv.cjs';
22
- export type { DataTableControlsPlacement, DataTableCsvColumn, DataTableHeader, DataTableLabels, DataTableResolvedLabels, DataTableSortContext, DataTableSortMode, DataTableValueType } from './types/data-table.cjs';
23
- export { closeAllFloatingComponents, showFloatingComponent, showFloatingMessage, useFloatingComponent } from './helpers/show-floating-component.cjs';
24
- export type { FloatingComponentContentProps, FloatingComponentHandle, ShowFloatingComponentOptions, ShowFloatingMessageOptions } from './helpers/show-floating-component.cjs';
25
- export { showConfirmationDialog, showErrorDialog, showInformationDialog, showModalDialog, showWarningDialog } from './helpers/show-modal-dialog.cjs';
26
- export type { ShowModalDialogOptions } from './helpers/show-modal-dialog.cjs';
27
- export type { ModalDialogButton, ModalDialogImage, ModalDialogResult, ModalDialogType } from './types/modal-dialog.cjs';
28
- export { closeAllOverlayBoxes, showOverlayBox, useOverlayBox } from './helpers/show-overlay-box.cjs';
29
- export type { OverlayBoxContentProps, OverlayBoxHandle, ShowOverlayBoxOptions } from './helpers/show-overlay-box.cjs';
30
- export { showScreenLoading } from './helpers/show-screen-loading.cjs';
31
- export type { ScreenLoadingHandle, ShowScreenLoadingOptions } from './helpers/show-screen-loading.cjs';
32
- export { closeAllSnackbars, showSnackbar } from './helpers/show-snackbar.cjs';
33
- export type { ShowSnackbarOptions, SnackbarCloseReason, SnackbarHandle } from './helpers/show-snackbar.cjs';
34
- export type { SnackbarDirection, SnackbarPlacement } from './internal/snackbar-item.cjs';
35
- export type { LabelPreset } from './types/label-preset.cjs';
36
- export type { MovableWindowContentProps, MovableWindowDragMode, MovableWindowHandle } from './types/movable-window.cjs';
37
- export type { TabContentStatus } from './internal/tab-group-context.cjs';
21
+ export { headersToCsvColumns, rowToCsvColumns } from './helpers/data-table.cjs';
22
+ export type { DataTableControlsPlacement, DataTableCsvColumn, DataTableHeader, DataTableLabels, DataTableResolvedLabels, DataTableSortContext, DataTableSortMode, DataTableValueType } from './helpers/data-table.cjs';
23
+ export { closeAllFloatingComponents, showFloatingComponent, showFloatingMessage, useFloatingComponent } from './helpers/floating-component.cjs';
24
+ export type { FloatingComponentContentProps, FloatingComponentHandle, ShowFloatingComponentOptions, ShowFloatingMessageOptions } from './helpers/floating-component.cjs';
25
+ export { showConfirmationDialog, showErrorDialog, showInformationDialog, showModalDialog, showWarningDialog } from './helpers/modal-dialog.cjs';
26
+ export type { ModalDialogButton, ModalDialogImage, ModalDialogMessage, ModalDialogResult, ModalDialogType, ShowModalDialogOptions } from './helpers/modal-dialog.cjs';
27
+ export { closeAllOverlayBoxes, showOverlayBox, useOverlayBox } from './helpers/overlay-box.cjs';
28
+ export type { OverlayBoxContentProps, OverlayBoxHandle, ShowOverlayBoxOptions } from './helpers/overlay-box.cjs';
29
+ export { showScreenLoading } from './helpers/screen-loading.cjs';
30
+ export type { ScreenLoadingHandle, ShowScreenLoadingOptions } from './helpers/screen-loading.cjs';
31
+ export { closeAllSnackbars, showSnackbar } from './helpers/snackbar.cjs';
32
+ export type { ShowSnackbarOptions, SnackbarCloseReason, SnackbarDirection, SnackbarHandle, SnackbarPlacement } from './helpers/snackbar.cjs';
33
+ export type { MovableWindowContentProps, MovableWindowDragMode, MovableWindowHandle } from './internal/window-control.cjs';
34
+ export type { TabContentStatus } from './internal/tab-group.cjs';
38
35
  export { vueCoreOptionsKey } from './helpers/vue-core-options.cjs';
39
36
  export type { DataTableOptions, VueCoreOptions } from './helpers/vue-core-options.cjs';
40
37
  export type { PopoverPlacement } from './internal/anchored-position.cjs';
package/lib/index.d.ts CHANGED
@@ -9,7 +9,7 @@ export type { Props as HelpPopperProps, Emits as HelpPopperEmits, Slots as HelpP
9
9
  export type { Props as HourglassLoadingProps } from './hourglass-loading';
10
10
  export type { Props as IntersectionLazyComponentProps, Emits as IntersectionLazyComponentEmits, Slots as IntersectionLazyComponentSlots } from './intersection-lazy-component';
11
11
  export type { Props as LabelButtonProps, Slots as LabelButtonSlots } from './label-button';
12
- export type { Props as LabelIconProps, Slots as LabelIconSlots } from './label-icon';
12
+ export type { Props as LabelIconProps, Slots as LabelIconSlots, LabelPreset } from './label-icon';
13
13
  export type { Props as ModalDialogProps, Emits as ModalDialogEmits, Slots as ModalDialogSlots } from './modal-dialog';
14
14
  export type { Props as OverlayBoxProps, Emits as OverlayBoxEmits, Slots as OverlayBoxSlots } from './overlay-box';
15
15
  export type { Props as PageSectionProps, Slots as PageSectionSlots } from './page-section';
@@ -18,23 +18,20 @@ export type { Props as ScreenLoadingProps } from './screen-loading';
18
18
  export type { Props as TabContentProps, Slots as TabContentSlots } from './tab-content';
19
19
  export type { Props as TabGroupProps, Slots as TabGroupSlots } from './tab-group';
20
20
  export type { Props as WarningPopperProps, Emits as WarningPopperEmits, Slots as WarningPopperSlots } from './warning-popper';
21
- export { headersToCsvColumns, rowToCsvColumns } from './helpers/data-table-csv';
22
- export type { DataTableControlsPlacement, DataTableCsvColumn, DataTableHeader, DataTableLabels, DataTableResolvedLabels, DataTableSortContext, DataTableSortMode, DataTableValueType } from './types/data-table';
23
- export { closeAllFloatingComponents, showFloatingComponent, showFloatingMessage, useFloatingComponent } from './helpers/show-floating-component';
24
- export type { FloatingComponentContentProps, FloatingComponentHandle, ShowFloatingComponentOptions, ShowFloatingMessageOptions } from './helpers/show-floating-component';
25
- export { showConfirmationDialog, showErrorDialog, showInformationDialog, showModalDialog, showWarningDialog } from './helpers/show-modal-dialog';
26
- export type { ShowModalDialogOptions } from './helpers/show-modal-dialog';
27
- export type { ModalDialogButton, ModalDialogImage, ModalDialogResult, ModalDialogType } from './types/modal-dialog';
28
- export { closeAllOverlayBoxes, showOverlayBox, useOverlayBox } from './helpers/show-overlay-box';
29
- export type { OverlayBoxContentProps, OverlayBoxHandle, ShowOverlayBoxOptions } from './helpers/show-overlay-box';
30
- export { showScreenLoading } from './helpers/show-screen-loading';
31
- export type { ScreenLoadingHandle, ShowScreenLoadingOptions } from './helpers/show-screen-loading';
32
- export { closeAllSnackbars, showSnackbar } from './helpers/show-snackbar';
33
- export type { ShowSnackbarOptions, SnackbarCloseReason, SnackbarHandle } from './helpers/show-snackbar';
34
- export type { SnackbarDirection, SnackbarPlacement } from './internal/snackbar-item';
35
- export type { LabelPreset } from './types/label-preset';
36
- export type { MovableWindowContentProps, MovableWindowDragMode, MovableWindowHandle } from './types/movable-window';
37
- export type { TabContentStatus } from './internal/tab-group-context';
21
+ export { headersToCsvColumns, rowToCsvColumns } from './helpers/data-table';
22
+ export type { DataTableControlsPlacement, DataTableCsvColumn, DataTableHeader, DataTableLabels, DataTableResolvedLabels, DataTableSortContext, DataTableSortMode, DataTableValueType } from './helpers/data-table';
23
+ export { closeAllFloatingComponents, showFloatingComponent, showFloatingMessage, useFloatingComponent } from './helpers/floating-component';
24
+ export type { FloatingComponentContentProps, FloatingComponentHandle, ShowFloatingComponentOptions, ShowFloatingMessageOptions } from './helpers/floating-component';
25
+ export { showConfirmationDialog, showErrorDialog, showInformationDialog, showModalDialog, showWarningDialog } from './helpers/modal-dialog';
26
+ export type { ModalDialogButton, ModalDialogImage, ModalDialogMessage, ModalDialogResult, ModalDialogType, ShowModalDialogOptions } from './helpers/modal-dialog';
27
+ export { closeAllOverlayBoxes, showOverlayBox, useOverlayBox } from './helpers/overlay-box';
28
+ export type { OverlayBoxContentProps, OverlayBoxHandle, ShowOverlayBoxOptions } from './helpers/overlay-box';
29
+ export { showScreenLoading } from './helpers/screen-loading';
30
+ export type { ScreenLoadingHandle, ShowScreenLoadingOptions } from './helpers/screen-loading';
31
+ export { closeAllSnackbars, showSnackbar } from './helpers/snackbar';
32
+ export type { ShowSnackbarOptions, SnackbarCloseReason, SnackbarDirection, SnackbarHandle, SnackbarPlacement } from './helpers/snackbar';
33
+ export type { MovableWindowContentProps, MovableWindowDragMode, MovableWindowHandle } from './internal/window-control';
34
+ export type { TabContentStatus } from './internal/tab-group';
38
35
  export { vueCoreOptionsKey } from './helpers/vue-core-options';
39
36
  export type { DataTableOptions, VueCoreOptions } from './helpers/vue-core-options';
40
37
  export type { PopoverPlacement } from './internal/anchored-position';