@digitalwalletcorp/vue-core 1.2.1 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +79 -3
- package/lib/accordion-fieldset.d.cts +14 -4
- package/lib/accordion-fieldset.d.ts +14 -4
- package/lib/accordion-section.d.cts +20 -10
- package/lib/accordion-section.d.ts +20 -10
- package/lib/components-BuTJ1wX8.js +26 -0
- package/lib/components-CKql5lWg.cjs +1 -0
- package/lib/components.d.cts +10 -0
- package/lib/components.d.ts +10 -0
- package/lib/copy-button.d.cts +34 -0
- package/lib/copy-button.d.ts +34 -0
- package/lib/dark-mode-selector.d.cts +32 -0
- package/lib/dark-mode-selector.d.ts +32 -0
- package/lib/data-table.d.cts +29 -0
- package/lib/data-table.d.ts +29 -0
- package/lib/help-button.d.cts +39 -0
- package/lib/help-button.d.ts +39 -0
- package/lib/help-popper.d.cts +39 -0
- package/lib/help-popper.d.ts +39 -0
- package/lib/helpers/data-table-csv.d.cts +17 -0
- package/lib/helpers/data-table-csv.d.ts +17 -0
- package/lib/helpers/show-floating-component.d.cts +86 -0
- package/lib/helpers/show-floating-component.d.ts +86 -0
- package/lib/helpers/show-modal-dialog.d.cts +73 -0
- package/lib/helpers/show-modal-dialog.d.ts +73 -0
- package/lib/helpers/show-overlay-box.d.cts +53 -0
- package/lib/helpers/show-overlay-box.d.ts +53 -0
- package/lib/helpers/show-screen-loading.d.cts +20 -0
- package/lib/helpers/show-screen-loading.d.ts +20 -0
- package/lib/helpers/show-snackbar.d.cts +47 -0
- package/lib/helpers/show-snackbar.d.ts +47 -0
- package/lib/hourglass-loading.d.cts +1 -1
- package/lib/hourglass-loading.d.ts +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +34 -0
- package/lib/index.d.ts +34 -0
- package/lib/index.js +445 -18
- package/lib/internal/anchored-popover.d.cts +35 -0
- package/lib/internal/anchored-popover.d.ts +35 -0
- package/lib/internal/anchored-position.d.cts +50 -0
- package/lib/internal/anchored-position.d.ts +50 -0
- package/lib/internal/data-table-controls.d.cts +42 -0
- package/lib/internal/data-table-controls.d.ts +42 -0
- package/lib/internal/data-table-value.d.cts +32 -0
- package/lib/internal/data-table-value.d.ts +32 -0
- package/lib/internal/floating-component.d.cts +52 -0
- package/lib/internal/floating-component.d.ts +52 -0
- package/lib/internal/icon-popper.d.cts +32 -0
- package/lib/internal/icon-popper.d.ts +32 -0
- package/lib/internal/mount-window.d.cts +39 -0
- package/lib/internal/mount-window.d.ts +39 -0
- package/lib/internal/movable-window.d.cts +55 -0
- package/lib/internal/movable-window.d.ts +55 -0
- package/lib/internal/opened-overlay-boxes.d.cts +2 -0
- package/lib/internal/opened-overlay-boxes.d.ts +2 -0
- package/lib/internal/pagination.d.cts +22 -0
- package/lib/internal/pagination.d.ts +22 -0
- package/lib/internal/snackbar-container.d.cts +20 -0
- package/lib/internal/snackbar-container.d.ts +20 -0
- package/lib/internal/snackbar-item.d.cts +17 -0
- package/lib/internal/snackbar-item.d.ts +17 -0
- package/lib/internal/tab-group-context.d.cts +4 -2
- package/lib/internal/tab-group-context.d.ts +4 -2
- package/lib/internal/use-movable-window.d.cts +44 -0
- package/lib/internal/use-movable-window.d.ts +44 -0
- package/lib/internal/window-order.d.cts +6 -0
- package/lib/internal/window-order.d.ts +6 -0
- package/lib/intersection-lazy-component.d.cts +32 -0
- package/lib/intersection-lazy-component.d.ts +32 -0
- package/lib/label-button.d.cts +2 -2
- package/lib/label-button.d.ts +2 -2
- package/lib/label-icon.d.cts +2 -2
- package/lib/label-icon.d.ts +2 -2
- package/lib/modal-dialog.d.cts +67 -0
- package/lib/modal-dialog.d.ts +67 -0
- package/lib/nuxt.cjs +1 -1
- package/lib/nuxt.js +1 -1
- package/lib/overlay-box.d.cts +52 -0
- package/lib/overlay-box.d.ts +52 -0
- package/lib/page-section.d.cts +2 -2
- package/lib/page-section.d.ts +2 -2
- package/lib/page-title.d.cts +2 -2
- package/lib/page-title.d.ts +2 -2
- package/lib/register.cjs +1 -1
- package/lib/register.js +1 -1
- package/lib/screen-loading.d.cts +7 -0
- package/lib/screen-loading.d.ts +7 -0
- package/lib/style.css +1 -1
- package/lib/tab-content.d.cts +5 -5
- package/lib/tab-content.d.ts +5 -5
- package/lib/tab-group.d.cts +7 -10
- package/lib/tab-group.d.ts +7 -10
- package/lib/types/data-table.d.cts +185 -0
- package/lib/types/data-table.d.ts +185 -0
- package/lib/types/modal-dialog.d.cts +13 -0
- package/lib/types/modal-dialog.d.ts +13 -0
- package/lib/types/movable-window.d.cts +16 -0
- package/lib/types/movable-window.d.ts +16 -0
- package/lib/warning-popper.d.cts +39 -0
- package/lib/warning-popper.d.ts +39 -0
- package/lib/warning-popper.vue_vue_type_style_index_0_lang-BKV_FX6k.js +1837 -0
- package/lib/warning-popper.vue_vue_type_style_index_0_lang-CHmkjVCO.cjs +1 -0
- package/package.json +40 -14
- package/src/accordion-fieldset.vue +24 -19
- package/src/accordion-section.vue +33 -28
- package/src/components.ts +10 -0
- package/src/copy-button.vue +89 -0
- package/src/dark-mode-selector.vue +212 -0
- package/src/data-table.vue +648 -0
- package/src/help-button.vue +128 -0
- package/src/help-popper.vue +70 -0
- package/src/helpers/data-table-csv.ts +55 -0
- package/src/helpers/show-floating-component.ts +177 -0
- package/src/helpers/show-modal-dialog.ts +121 -0
- package/src/helpers/show-overlay-box.ts +106 -0
- package/src/helpers/show-screen-loading.ts +37 -0
- package/src/helpers/show-snackbar.ts +153 -0
- package/src/hourglass-loading.vue +1 -1
- package/src/index.ts +34 -0
- package/src/internal/anchored-popover.vue +192 -0
- package/src/internal/anchored-position.ts +135 -0
- package/src/internal/data-table-controls.vue +203 -0
- package/src/internal/data-table-value.ts +99 -0
- package/src/internal/floating-component.vue +202 -0
- package/src/internal/icon-popper.vue +185 -0
- package/src/internal/mount-window.ts +110 -0
- package/src/internal/movable-window.vue +315 -0
- package/src/internal/opened-overlay-boxes.ts +2 -0
- package/src/internal/pagination.vue +325 -0
- package/src/internal/snackbar-container.vue +258 -0
- package/src/internal/snackbar-item.ts +20 -0
- package/src/internal/tab-group-context.ts +4 -2
- package/src/internal/use-movable-window.ts +208 -0
- package/src/internal/window-order.ts +11 -0
- package/src/intersection-lazy-component.vue +84 -0
- package/src/label-button.vue +9 -6
- package/src/label-icon.vue +2 -2
- package/src/modal-dialog.vue +287 -0
- package/src/overlay-box.vue +218 -0
- package/src/page-section.vue +7 -7
- package/src/page-title.vue +4 -4
- package/src/screen-loading.vue +90 -0
- package/src/tab-content.vue +16 -15
- package/src/tab-group.vue +34 -36
- package/src/types/data-table.ts +196 -0
- package/src/types/modal-dialog.ts +16 -0
- package/src/types/movable-window.ts +18 -0
- package/src/warning-popper.vue +70 -0
- package/lib/accordion-fieldset.cjs +0 -1
- package/lib/accordion-fieldset.js +0 -4
- package/lib/accordion-fieldset.vue_vue_type_style_index_0_lang-Cf4czDXz.js +0 -66
- package/lib/accordion-fieldset.vue_vue_type_style_index_0_lang-DoM5QjpJ.cjs +0 -1
- package/lib/accordion-section.cjs +0 -1
- package/lib/accordion-section.js +0 -4
- package/lib/accordion-section.vue_vue_type_style_index_0_lang-CFDdUEnn.cjs +0 -1
- package/lib/accordion-section.vue_vue_type_style_index_0_lang-Gvjjx02P.js +0 -78
- package/lib/components-C63HJoCn.cjs +0 -1
- package/lib/components-q4Cf97bO.js +0 -24
- package/lib/hourglass-loading.cjs +0 -1
- package/lib/hourglass-loading.js +0 -4
- package/lib/hourglass-loading.vue_vue_type_style_index_0_lang-C72UVA9W.cjs +0 -1
- package/lib/hourglass-loading.vue_vue_type_style_index_0_lang-DkUGIxQ2.js +0 -22
- package/lib/label-button.cjs +0 -1
- package/lib/label-button.js +0 -4
- package/lib/label-button.vue_vue_type_style_index_0_lang-D7ZgfZOL.cjs +0 -1
- package/lib/label-button.vue_vue_type_style_index_0_lang-DqRYddVt.js +0 -44
- package/lib/label-icon.cjs +0 -1
- package/lib/label-icon.js +0 -4
- package/lib/label-icon.vue_vue_type_style_index_0_lang-D9Cimu20.cjs +0 -1
- package/lib/label-icon.vue_vue_type_style_index_0_lang-me52HE2V.js +0 -38
- package/lib/page-section.cjs +0 -1
- package/lib/page-section.js +0 -4
- package/lib/page-section.vue_vue_type_style_index_0_lang-DEAkTLxd.cjs +0 -1
- package/lib/page-section.vue_vue_type_style_index_0_lang-DpVQe_rV.js +0 -54
- package/lib/page-title.cjs +0 -1
- package/lib/page-title.js +0 -4
- package/lib/page-title.vue_vue_type_style_index_0_lang-BqIsIks5.cjs +0 -1
- package/lib/page-title.vue_vue_type_style_index_0_lang-ChZot85K.js +0 -36
- package/lib/tab-content.cjs +0 -1
- package/lib/tab-content.js +0 -4
- package/lib/tab-content.vue_vue_type_style_index_0_lang-BeCi7Xkp.cjs +0 -1
- package/lib/tab-content.vue_vue_type_style_index_0_lang-CcQLHmIF.js +0 -44
- package/lib/tab-group.cjs +0 -1
- package/lib/tab-group.js +0 -4
- package/lib/tab-group.vue_vue_type_style_index_0_lang-C84mDEOC.js +0 -103
- package/lib/tab-group.vue_vue_type_style_index_0_lang-CMaufRJV.cjs +0 -1
- package/lib/use-shrinkable-CS2bmsJJ.js +0 -17
- package/lib/use-shrinkable-Cu9JQZll.cjs +0 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ClassValue, StyleValue } from 'vue';
|
|
2
|
+
import { SnackbarDirection, SnackbarPlacement } from '../internal/snackbar-item.cjs';
|
|
3
|
+
/** snackbar が閉じた理由。click はクリック、duration は表示時間の経過、clear は一括消去ボタンと closeAllSnackbars()、handle は SnackbarHandle の close() */
|
|
4
|
+
export type SnackbarCloseReason = 'click' | 'duration' | 'clear' | 'handle';
|
|
5
|
+
export interface ShowSnackbarOptions {
|
|
6
|
+
/** 見出し */
|
|
7
|
+
title?: string;
|
|
8
|
+
/** 見出しの右側に出す短い文字 */
|
|
9
|
+
label?: string;
|
|
10
|
+
/** 右下に出す時刻。整形済みの文字列を渡す */
|
|
11
|
+
timestamp?: string;
|
|
12
|
+
/** 自動で閉じるまでの時間(ミリ秒)。未指定ならクリックするまで閉じない */
|
|
13
|
+
duration?: number;
|
|
14
|
+
/** 表示する位置 */
|
|
15
|
+
placement?: SnackbarPlacement;
|
|
16
|
+
/** 同じ表示領域に並べる向き。overlap は同じ位置に重ねて新しいものを前面に出し、column は縦に積み、row は横に並べて端で折り返す */
|
|
17
|
+
direction?: SnackbarDirection;
|
|
18
|
+
/** 同じ表示領域に一括消去ボタンを出す */
|
|
19
|
+
clearable?: boolean;
|
|
20
|
+
/** 一括消去ボタンの読み上げ名 */
|
|
21
|
+
clearLabel?: string;
|
|
22
|
+
/** snackbar に付けるクラス */
|
|
23
|
+
class?: ClassValue;
|
|
24
|
+
/** snackbar に付けるスタイル */
|
|
25
|
+
style?: StyleValue;
|
|
26
|
+
/** snackbar が閉じたときに呼ぶ関数 */
|
|
27
|
+
onClose?: (reason: SnackbarCloseReason) => void;
|
|
28
|
+
}
|
|
29
|
+
/** showSnackbar が返す、表示中の snackbar を閉じるためのハンドル */
|
|
30
|
+
export interface SnackbarHandle {
|
|
31
|
+
/** snackbar を閉じる */
|
|
32
|
+
close: () => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* snackbar を表示する。
|
|
36
|
+
* placement と direction の組み合わせが同じ snackbar は同じ表示領域に並び、新しいものが末尾(overlap では前面)に加わる。
|
|
37
|
+
* クリックすると閉じる。ブラウザでのみ動作する
|
|
38
|
+
*
|
|
39
|
+
* @param {string} message 表示する文字列
|
|
40
|
+
* @param {ShowSnackbarOptions} [options]
|
|
41
|
+
* @returns {SnackbarHandle}
|
|
42
|
+
*/
|
|
43
|
+
export declare function showSnackbar(message: string, options?: ShowSnackbarOptions): SnackbarHandle;
|
|
44
|
+
/**
|
|
45
|
+
* 表示中の snackbar をすべて閉じる。表示領域ごとに、古い順に少しずつずらして閉じる
|
|
46
|
+
*/
|
|
47
|
+
export declare function closeAllSnackbars(): void;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ClassValue, StyleValue } from 'vue';
|
|
2
|
+
import { SnackbarDirection, SnackbarPlacement } from '../internal/snackbar-item';
|
|
3
|
+
/** snackbar が閉じた理由。click はクリック、duration は表示時間の経過、clear は一括消去ボタンと closeAllSnackbars()、handle は SnackbarHandle の close() */
|
|
4
|
+
export type SnackbarCloseReason = 'click' | 'duration' | 'clear' | 'handle';
|
|
5
|
+
export interface ShowSnackbarOptions {
|
|
6
|
+
/** 見出し */
|
|
7
|
+
title?: string;
|
|
8
|
+
/** 見出しの右側に出す短い文字 */
|
|
9
|
+
label?: string;
|
|
10
|
+
/** 右下に出す時刻。整形済みの文字列を渡す */
|
|
11
|
+
timestamp?: string;
|
|
12
|
+
/** 自動で閉じるまでの時間(ミリ秒)。未指定ならクリックするまで閉じない */
|
|
13
|
+
duration?: number;
|
|
14
|
+
/** 表示する位置 */
|
|
15
|
+
placement?: SnackbarPlacement;
|
|
16
|
+
/** 同じ表示領域に並べる向き。overlap は同じ位置に重ねて新しいものを前面に出し、column は縦に積み、row は横に並べて端で折り返す */
|
|
17
|
+
direction?: SnackbarDirection;
|
|
18
|
+
/** 同じ表示領域に一括消去ボタンを出す */
|
|
19
|
+
clearable?: boolean;
|
|
20
|
+
/** 一括消去ボタンの読み上げ名 */
|
|
21
|
+
clearLabel?: string;
|
|
22
|
+
/** snackbar に付けるクラス */
|
|
23
|
+
class?: ClassValue;
|
|
24
|
+
/** snackbar に付けるスタイル */
|
|
25
|
+
style?: StyleValue;
|
|
26
|
+
/** snackbar が閉じたときに呼ぶ関数 */
|
|
27
|
+
onClose?: (reason: SnackbarCloseReason) => void;
|
|
28
|
+
}
|
|
29
|
+
/** showSnackbar が返す、表示中の snackbar を閉じるためのハンドル */
|
|
30
|
+
export interface SnackbarHandle {
|
|
31
|
+
/** snackbar を閉じる */
|
|
32
|
+
close: () => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* snackbar を表示する。
|
|
36
|
+
* placement と direction の組み合わせが同じ snackbar は同じ表示領域に並び、新しいものが末尾(overlap では前面)に加わる。
|
|
37
|
+
* クリックすると閉じる。ブラウザでのみ動作する
|
|
38
|
+
*
|
|
39
|
+
* @param {string} message 表示する文字列
|
|
40
|
+
* @param {ShowSnackbarOptions} [options]
|
|
41
|
+
* @returns {SnackbarHandle}
|
|
42
|
+
*/
|
|
43
|
+
export declare function showSnackbar(message: string, options?: ShowSnackbarOptions): SnackbarHandle;
|
|
44
|
+
/**
|
|
45
|
+
* 表示中の snackbar をすべて閉じる。表示領域ごとに、古い順に少しずつずらして閉じる
|
|
46
|
+
*/
|
|
47
|
+
export declare function closeAllSnackbars(): void;
|
package/lib/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./accordion-fieldset.vue_vue_type_style_index_0_lang-DoM5QjpJ.cjs"),_=require("./accordion-section.vue_vue_type_style_index_0_lang-CFDdUEnn.cjs"),n=require("./hourglass-loading.vue_vue_type_style_index_0_lang-C72UVA9W.cjs"),t=require("./label-button.vue_vue_type_style_index_0_lang-D7ZgfZOL.cjs"),i=require("./label-icon.vue_vue_type_style_index_0_lang-D9Cimu20.cjs"),a=require("./page-section.vue_vue_type_style_index_0_lang-DEAkTLxd.cjs"),o=require("./page-title.vue_vue_type_style_index_0_lang-BqIsIks5.cjs"),u=require("./tab-content.vue_vue_type_style_index_0_lang-BeCi7Xkp.cjs"),s=require("./tab-group.vue_vue_type_style_index_0_lang-CMaufRJV.cjs");exports.AccordionFieldset=e._sfc_main;exports.AccordionSection=_._sfc_main;exports.HourglassLoading=n._sfc_main;exports.LabelButton=t._sfc_main;exports.LabelIcon=i._sfc_main;exports.PageSection=a._sfc_main;exports.PageTitle=o._sfc_main;exports.TabContent=u._sfc_main;exports.TabGroup=s._sfc_main;
|
|
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;
|
package/lib/index.d.cts
CHANGED
|
@@ -1,3 +1,37 @@
|
|
|
1
1
|
export * from './components.cjs';
|
|
2
|
+
export type { Props as AccordionFieldsetProps, Slots as AccordionFieldsetSlots } from './accordion-fieldset.cjs';
|
|
3
|
+
export type { Props as AccordionSectionProps, Slots as AccordionSectionSlots } from './accordion-section.cjs';
|
|
4
|
+
export type { Props as CopyButtonProps, Emits as CopyButtonEmits, Slots as CopyButtonSlots } from './copy-button.cjs';
|
|
5
|
+
export type { Props as DarkModeSelectorProps, Emits as DarkModeSelectorEmits, Slots as DarkModeSelectorSlots } from './dark-mode-selector.cjs';
|
|
6
|
+
export type { Props as HelpButtonProps, Emits as HelpButtonEmits, Slots as HelpButtonSlots } from './help-button.cjs';
|
|
7
|
+
export type { Props as HelpPopperProps, Emits as HelpPopperEmits, Slots as HelpPopperSlots } from './help-popper.cjs';
|
|
8
|
+
export type { Props as HourglassLoadingProps } from './hourglass-loading.cjs';
|
|
9
|
+
export type { Props as IntersectionLazyComponentProps, Emits as IntersectionLazyComponentEmits, Slots as IntersectionLazyComponentSlots } from './intersection-lazy-component.cjs';
|
|
10
|
+
export type { Props as LabelButtonProps, Slots as LabelButtonSlots } from './label-button.cjs';
|
|
11
|
+
export type { Props as LabelIconProps, Slots as LabelIconSlots } from './label-icon.cjs';
|
|
12
|
+
export type { Props as ModalDialogProps, Emits as ModalDialogEmits, Slots as ModalDialogSlots } from './modal-dialog.cjs';
|
|
13
|
+
export type { Props as OverlayBoxProps, Emits as OverlayBoxEmits, Slots as OverlayBoxSlots } from './overlay-box.cjs';
|
|
14
|
+
export type { Props as PageSectionProps, Slots as PageSectionSlots } from './page-section.cjs';
|
|
15
|
+
export type { Props as PageTitleProps, Slots as PageTitleSlots } from './page-title.cjs';
|
|
16
|
+
export type { Props as ScreenLoadingProps } from './screen-loading.cjs';
|
|
17
|
+
export type { Props as TabContentProps, Slots as TabContentSlots } from './tab-content.cjs';
|
|
18
|
+
export type { Props as TabGroupProps, Slots as TabGroupSlots } from './tab-group.cjs';
|
|
19
|
+
export type { Props as WarningPopperProps, Emits as WarningPopperEmits, Slots as WarningPopperSlots } from './warning-popper.cjs';
|
|
20
|
+
export { headersToCsvColumns, rowToCsvColumns } from './helpers/data-table-csv.cjs';
|
|
21
|
+
export type { DataTableControlsPlacement, DataTableCsvColumn, DataTableEmits, DataTableHeader, DataTableLabels, DataTableProps, DataTableResolvedLabels, DataTableSlots, DataTableSortContext, DataTableSortMode, DataTableValueType } from './types/data-table.cjs';
|
|
22
|
+
export { closeAllFloatingComponents, showFloatingComponent, showFloatingMessage, useFloatingComponent } from './helpers/show-floating-component.cjs';
|
|
23
|
+
export type { FloatingComponentContentProps, FloatingComponentHandle, ShowFloatingComponentOptions, ShowFloatingMessageOptions } from './helpers/show-floating-component.cjs';
|
|
24
|
+
export { showConfirmationDialog, showErrorDialog, showInformationDialog, showModalDialog, showWarningDialog } from './helpers/show-modal-dialog.cjs';
|
|
25
|
+
export type { ShowModalDialogOptions } from './helpers/show-modal-dialog.cjs';
|
|
26
|
+
export type { ModalDialogButton, ModalDialogImage, ModalDialogResult, ModalDialogType } from './types/modal-dialog.cjs';
|
|
27
|
+
export { closeAllOverlayBoxes, showOverlayBox, useOverlayBox } from './helpers/show-overlay-box.cjs';
|
|
28
|
+
export type { OverlayBoxContentProps, OverlayBoxHandle, ShowOverlayBoxOptions } from './helpers/show-overlay-box.cjs';
|
|
29
|
+
export { showScreenLoading } from './helpers/show-screen-loading.cjs';
|
|
30
|
+
export type { ScreenLoadingHandle, ShowScreenLoadingOptions } from './helpers/show-screen-loading.cjs';
|
|
31
|
+
export { closeAllSnackbars, showSnackbar } from './helpers/show-snackbar.cjs';
|
|
32
|
+
export type { ShowSnackbarOptions, SnackbarCloseReason, SnackbarHandle } from './helpers/show-snackbar.cjs';
|
|
33
|
+
export type { SnackbarDirection, SnackbarPlacement } from './internal/snackbar-item.cjs';
|
|
2
34
|
export type { LabelPreset } from './types/label-preset.cjs';
|
|
35
|
+
export type { MovableWindowContentProps, MovableWindowDragMode, MovableWindowHandle } from './types/movable-window.cjs';
|
|
3
36
|
export type { TabContentStatus } from './internal/tab-group-context.cjs';
|
|
37
|
+
export type { PopoverPlacement } from './internal/anchored-position.cjs';
|
package/lib/index.d.ts
CHANGED
|
@@ -1,3 +1,37 @@
|
|
|
1
1
|
export * from './components';
|
|
2
|
+
export type { Props as AccordionFieldsetProps, Slots as AccordionFieldsetSlots } from './accordion-fieldset';
|
|
3
|
+
export type { Props as AccordionSectionProps, Slots as AccordionSectionSlots } from './accordion-section';
|
|
4
|
+
export type { Props as CopyButtonProps, Emits as CopyButtonEmits, Slots as CopyButtonSlots } from './copy-button';
|
|
5
|
+
export type { Props as DarkModeSelectorProps, Emits as DarkModeSelectorEmits, Slots as DarkModeSelectorSlots } from './dark-mode-selector';
|
|
6
|
+
export type { Props as HelpButtonProps, Emits as HelpButtonEmits, Slots as HelpButtonSlots } from './help-button';
|
|
7
|
+
export type { Props as HelpPopperProps, Emits as HelpPopperEmits, Slots as HelpPopperSlots } from './help-popper';
|
|
8
|
+
export type { Props as HourglassLoadingProps } from './hourglass-loading';
|
|
9
|
+
export type { Props as IntersectionLazyComponentProps, Emits as IntersectionLazyComponentEmits, Slots as IntersectionLazyComponentSlots } from './intersection-lazy-component';
|
|
10
|
+
export type { Props as LabelButtonProps, Slots as LabelButtonSlots } from './label-button';
|
|
11
|
+
export type { Props as LabelIconProps, Slots as LabelIconSlots } from './label-icon';
|
|
12
|
+
export type { Props as ModalDialogProps, Emits as ModalDialogEmits, Slots as ModalDialogSlots } from './modal-dialog';
|
|
13
|
+
export type { Props as OverlayBoxProps, Emits as OverlayBoxEmits, Slots as OverlayBoxSlots } from './overlay-box';
|
|
14
|
+
export type { Props as PageSectionProps, Slots as PageSectionSlots } from './page-section';
|
|
15
|
+
export type { Props as PageTitleProps, Slots as PageTitleSlots } from './page-title';
|
|
16
|
+
export type { Props as ScreenLoadingProps } from './screen-loading';
|
|
17
|
+
export type { Props as TabContentProps, Slots as TabContentSlots } from './tab-content';
|
|
18
|
+
export type { Props as TabGroupProps, Slots as TabGroupSlots } from './tab-group';
|
|
19
|
+
export type { Props as WarningPopperProps, Emits as WarningPopperEmits, Slots as WarningPopperSlots } from './warning-popper';
|
|
20
|
+
export { headersToCsvColumns, rowToCsvColumns } from './helpers/data-table-csv';
|
|
21
|
+
export type { DataTableControlsPlacement, DataTableCsvColumn, DataTableEmits, DataTableHeader, DataTableLabels, DataTableProps, DataTableResolvedLabels, DataTableSlots, DataTableSortContext, DataTableSortMode, DataTableValueType } from './types/data-table';
|
|
22
|
+
export { closeAllFloatingComponents, showFloatingComponent, showFloatingMessage, useFloatingComponent } from './helpers/show-floating-component';
|
|
23
|
+
export type { FloatingComponentContentProps, FloatingComponentHandle, ShowFloatingComponentOptions, ShowFloatingMessageOptions } from './helpers/show-floating-component';
|
|
24
|
+
export { showConfirmationDialog, showErrorDialog, showInformationDialog, showModalDialog, showWarningDialog } from './helpers/show-modal-dialog';
|
|
25
|
+
export type { ShowModalDialogOptions } from './helpers/show-modal-dialog';
|
|
26
|
+
export type { ModalDialogButton, ModalDialogImage, ModalDialogResult, ModalDialogType } from './types/modal-dialog';
|
|
27
|
+
export { closeAllOverlayBoxes, showOverlayBox, useOverlayBox } from './helpers/show-overlay-box';
|
|
28
|
+
export type { OverlayBoxContentProps, OverlayBoxHandle, ShowOverlayBoxOptions } from './helpers/show-overlay-box';
|
|
29
|
+
export { showScreenLoading } from './helpers/show-screen-loading';
|
|
30
|
+
export type { ScreenLoadingHandle, ShowScreenLoadingOptions } from './helpers/show-screen-loading';
|
|
31
|
+
export { closeAllSnackbars, showSnackbar } from './helpers/show-snackbar';
|
|
32
|
+
export type { ShowSnackbarOptions, SnackbarCloseReason, SnackbarHandle } from './helpers/show-snackbar';
|
|
33
|
+
export type { SnackbarDirection, SnackbarPlacement } from './internal/snackbar-item';
|
|
2
34
|
export type { LabelPreset } from './types/label-preset';
|
|
35
|
+
export type { MovableWindowContentProps, MovableWindowDragMode, MovableWindowHandle } from './types/movable-window';
|
|
3
36
|
export type { TabContentStatus } from './internal/tab-group-context';
|
|
37
|
+
export type { PopoverPlacement } from './internal/anchored-position';
|