@vinicunca/taman-ui 0.1.3 → 0.1.4
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/dist/_virtual/_/plugin-vue/export-helper.mjs +1 -2
- package/dist/components/auth/taman-auth-form.mjs +1 -2
- package/dist/components/auth/taman-auth-form.vue.d.ts +0 -2
- package/dist/components/back-to-top/taman-back-to-top.mjs +1 -2
- package/dist/components/back-to-top/taman-back-to-top.vue.d.ts +0 -2
- package/dist/components/button/check-group-selection.mjs +1 -2
- package/dist/components/button/taman-button-check-group.mjs +1 -2
- package/dist/components/button/taman-button-check-group.types.d.ts +1 -3
- package/dist/components/button/taman-button-check-group.vue.d.ts +0 -2
- package/dist/components/button/taman-button-icon.mjs +1 -2
- package/dist/components/button/taman-button-icon.vue.d.ts +0 -2
- package/dist/components/descriptions/taman-description-cell.mjs +1 -2
- package/dist/components/descriptions/taman-description-item.mjs +1 -2
- package/dist/components/descriptions/taman-description-item.vue.d.ts +0 -2
- package/dist/components/descriptions/taman-description-row.mjs +1 -2
- package/dist/components/descriptions/taman-description.mjs +1 -2
- package/dist/components/descriptions/taman-description.types.d.ts +1 -3
- package/dist/components/descriptions/taman-description.vue.d.ts +7 -7
- package/dist/components/descriptions/use-taman-description.mjs +1 -2
- package/dist/components/file-upload/taman-file-upload.mjs +1 -2
- package/dist/components/file-upload/taman-file-upload.types.d.ts +1 -3
- package/dist/components/file-upload/taman-file-upload.vue.d.ts +0 -2
- package/dist/components/full-screen/full-screen.mjs +1 -2
- package/dist/components/full-screen/full-screen.vue.d.ts +0 -2
- package/dist/components/icon/icon.mjs +1 -2
- package/dist/components/icon/icon.vue.d.ts +0 -2
- package/dist/components/index.mjs +10 -10
- package/dist/components/input/password-strength.d.ts +1 -3
- package/dist/components/input/password-strength.mjs +1 -2
- package/dist/components/input/taman-input-currency.mjs +1 -2
- package/dist/components/input/taman-input-currency.types.d.ts +1 -3
- package/dist/components/input/taman-input-currency.vue.d.ts +0 -2
- package/dist/components/input/taman-input-password.mjs +1 -2
- package/dist/components/input/taman-input-password.vue.d.ts +0 -2
- package/dist/components/input-date/format-calendar-input-value.mjs +1 -2
- package/dist/components/input-date/taman-input-date.mjs +1 -2
- package/dist/components/input-date/taman-input-date.types.d.ts +1 -3
- package/dist/components/input-date/taman-input-date.vue.d.ts +0 -2
- package/dist/components/loading/index.d.ts +1 -1
- package/dist/components/loading/taman-loading.mjs +1 -2
- package/dist/components/loading/taman-loading.vue.d.ts +5 -5
- package/dist/components/loading/types.d.ts +1 -3
- package/dist/components/logo/taman-logo.mjs +1 -2
- package/dist/components/logo/taman-logo.vue.d.ts +5 -5
- package/dist/components/render-content/render-content.mjs +1 -2
- package/dist/components/render-content/render-content.vue.d.ts +0 -2
- package/dist/components/scrollbar/scrollbar.mjs +1 -2
- package/dist/components/scrollbar/scrollbar.vue.d.ts +5 -5
- package/dist/form/components/form-actions.mjs +1 -2
- package/dist/form/components/form-field-array.mjs +3 -4
- package/dist/form/components/form-field-array.types.d.ts +1 -3
- package/dist/form/form-render/form-render-field-collapsible.mjs +1 -2
- package/dist/form/form-render/form-render-field-control.mjs +1 -2
- package/dist/form/form-render/form-render-form-field.mjs +1 -2
- package/dist/form/form-render/form-render-form-label.mjs +1 -2
- package/dist/form/form-render/form-render-form.mjs +4 -5
- package/dist/form/form-render/form-render-group.mjs +1 -2
- package/dist/form/form-render/form-render.context.mjs +1 -2
- package/dist/form/form-render/form-render.dependencies.mjs +1 -2
- package/dist/form/form-render/form-render.helper.mjs +1 -2
- package/dist/form/form-render/form-render.schema.mjs +1 -2
- package/dist/form/form-render/index.mjs +1 -1
- package/dist/form/form.api.d.ts +0 -2
- package/dist/form/form.api.mjs +2 -3
- package/dist/form/form.built-ins.d.ts +1 -3
- package/dist/form/form.built-ins.mjs +1 -2
- package/dist/form/form.codec.d.ts +0 -2
- package/dist/form/form.codec.mjs +1 -2
- package/dist/form/form.config.d.ts +1 -3
- package/dist/form/form.config.mjs +2 -3
- package/dist/form/form.empty-value.d.ts +1 -3
- package/dist/form/form.empty-value.mjs +1 -2
- package/dist/form/form.field-name.mjs +1 -2
- package/dist/form/form.rule-registry.mjs +1 -2
- package/dist/form/form.runtime-field.mjs +1 -2
- package/dist/form/form.runtime.mjs +1 -2
- package/dist/form/form.schema-defaults.mjs +1 -2
- package/dist/form/form.types.d.ts +0 -2
- package/dist/form/form.use-delayed-flag.mjs +1 -2
- package/dist/form/form.use-form-context.mjs +1 -2
- package/dist/form/form.use-taman-form.d.ts +0 -2
- package/dist/form/form.use-taman-form.mjs +1 -2
- package/dist/form/index.d.ts +1 -1
- package/dist/form/index.mjs +1 -1
- package/dist/form/taman-use-form.mjs +4 -5
- package/dist/index.mjs +2 -2
- package/dist/layout/components/taman-core-button-collapse.mjs +1 -2
- package/dist/layout/components/taman-core-button-fixed.mjs +1 -2
- package/dist/layout/components/taman-core-layout-content.mjs +1 -2
- package/dist/layout/components/taman-core-layout-footer.mjs +1 -2
- package/dist/layout/components/taman-core-layout-header.mjs +1 -2
- package/dist/layout/components/taman-core-layout-sidebar.mjs +1 -2
- package/dist/layout/components/taman-core-layout-tabbar.mjs +1 -2
- package/dist/layout/composables/use-layout.mjs +1 -2
- package/dist/layout/composables/use-sidebar-drag.mjs +1 -2
- package/dist/layout/header-scroll-state.mjs +1 -2
- package/dist/layout/taman-core-layout.d.ts +0 -2
- package/dist/layout/taman-core-layout.mjs +1 -2
- package/dist/layout/taman-core-layout.vue.d.ts +32 -27
- package/dist/menu/components/collapse-transition.mjs +1 -2
- package/dist/menu/components/index.mjs +3 -3
- package/dist/menu/components/normal-menu/normal-menu.d.ts +0 -2
- package/dist/menu/components/normal-menu/normal-menu.mjs +1 -2
- package/dist/menu/components/normal-menu/normal-menu.vue.d.ts +0 -2
- package/dist/menu/components/taman-menu-badge-dot.mjs +1 -2
- package/dist/menu/components/taman-menu-badge.mjs +1 -2
- package/dist/menu/components/taman-menu-badge.vue.d.ts +0 -2
- package/dist/menu/components/taman-menu-item.mjs +3 -4
- package/dist/menu/components/taman-menu-root.mjs +5 -6
- package/dist/menu/components/taman-menu-sub-menu-content.mjs +1 -2
- package/dist/menu/components/taman-menu-sub-menu.mjs +3 -4
- package/dist/menu/composables/use-menu-context.mjs +1 -2
- package/dist/menu/composables/use-menu-scroll.mjs +1 -2
- package/dist/menu/composables/use-menu.mjs +1 -2
- package/dist/menu/menu.constants.mjs +1 -2
- package/dist/menu/menu.types.d.ts +0 -2
- package/dist/menu/menu.utils.mjs +1 -2
- package/dist/menu/taman-menu.mjs +1 -2
- package/dist/menu/taman-menu.vue.d.ts +0 -2
- package/dist/menu/taman-sub-menu.mjs +1 -2
- package/dist/popup/alert/alert-builder.d.ts +1 -3
- package/dist/popup/alert/alert-builder.mjs +1 -2
- package/dist/popup/alert/alert-overlay.mjs +1 -2
- package/dist/popup/alert/alert.d.ts +1 -3
- package/dist/popup/alert/alert.mjs +1 -2
- package/dist/popup/alert/alert.vue.d.ts +0 -2
- package/dist/popup/alert/alert2.mjs +1 -2
- package/dist/popup/alert/index.mjs +1 -1
- package/dist/popup/dialog/dialog.api.d.ts +1 -3
- package/dist/popup/dialog/dialog.api.mjs +1 -2
- package/dist/popup/dialog/dialog.mjs +26 -16
- package/dist/popup/dialog/dialog.types.d.ts +0 -2
- package/dist/popup/dialog/dialog.vue.d.ts +25 -25
- package/dist/popup/dialog/use-dialog-draggable.mjs +1 -2
- package/dist/popup/dialog/use-taman-dialog.d.ts +0 -2
- package/dist/popup/dialog/use-taman-dialog.mjs +2 -3
- package/dist/popup/drawer/drawer.api.d.ts +1 -3
- package/dist/popup/drawer/drawer.api.mjs +1 -2
- package/dist/popup/drawer/drawer.mjs +29 -14
- package/dist/popup/drawer/drawer.types.d.ts +0 -2
- package/dist/popup/drawer/drawer.vue.d.ts +27 -27
- package/dist/popup/drawer/use-taman-drawer.d.ts +0 -2
- package/dist/popup/drawer/use-taman-drawer.mjs +2 -3
- package/dist/tabs/components/taman-tabs.mjs +1 -2
- package/dist/tabs/components/widgets/tool-more.mjs +1 -2
- package/dist/tabs/components/widgets/tool-more.vue.d.ts +0 -2
- package/dist/tabs/components/widgets/tool-refresh.mjs +1 -2
- package/dist/tabs/components/widgets/tool-refresh.vue.d.ts +0 -2
- package/dist/tabs/components/widgets/tool-screen.mjs +1 -2
- package/dist/tabs/components/widgets/tool-screen.vue.d.ts +0 -2
- package/dist/tabs/strict-context-menu.d.ts +0 -2
- package/dist/tabs/tabs.types.d.ts +1 -3
- package/dist/tabs/taman-tabs-view.mjs +1 -2
- package/dist/tabs/taman-tabs-view.vue.d.ts +0 -2
- package/dist/tabs/use-tabs-drag.mjs +1 -2
- package/dist/tabs/use-tabs-view-scroll.mjs +1 -2
- package/dist/ui/alert-dialog/alert-dialog-action.mjs +1 -2
- package/dist/ui/alert-dialog/alert-dialog-action.vue.d.ts +5 -5
- package/dist/ui/alert-dialog/alert-dialog-cancel.mjs +1 -2
- package/dist/ui/alert-dialog/alert-dialog-cancel.vue.d.ts +5 -5
- package/dist/ui/alert-dialog/alert-dialog-content.mjs +1 -2
- package/dist/ui/alert-dialog/alert-dialog-content.vue.d.ts +5 -5
- package/dist/ui/alert-dialog/alert-dialog-description.mjs +1 -2
- package/dist/ui/alert-dialog/alert-dialog-description.vue.d.ts +5 -5
- package/dist/ui/alert-dialog/alert-dialog-footer.mjs +1 -2
- package/dist/ui/alert-dialog/alert-dialog-footer.vue.d.ts +5 -5
- package/dist/ui/alert-dialog/alert-dialog-header.mjs +1 -2
- package/dist/ui/alert-dialog/alert-dialog-header.vue.d.ts +5 -5
- package/dist/ui/alert-dialog/alert-dialog-overlay.mjs +1 -2
- package/dist/ui/alert-dialog/alert-dialog-root.mjs +1 -2
- package/dist/ui/alert-dialog/alert-dialog-root.vue.d.ts +8 -8
- package/dist/ui/alert-dialog/alert-dialog-title.mjs +1 -2
- package/dist/ui/alert-dialog/alert-dialog-title.vue.d.ts +5 -5
- package/dist/ui/alert-dialog/alert-dialog-trigger.mjs +1 -2
- package/dist/ui/alert-dialog/alert-dialog-trigger.vue.d.ts +5 -5
- package/dist/ui/dialog/dialog-close.mjs +1 -2
- package/dist/ui/dialog/dialog-close.vue.d.ts +5 -5
- package/dist/ui/dialog/dialog-content.mjs +10 -6
- package/dist/ui/dialog/dialog-content.vue.d.ts +7 -5
- package/dist/ui/dialog/dialog-description.mjs +1 -2
- package/dist/ui/dialog/dialog-description.vue.d.ts +5 -5
- package/dist/ui/dialog/dialog-footer.mjs +1 -2
- package/dist/ui/dialog/dialog-footer.vue.d.ts +5 -5
- package/dist/ui/dialog/dialog-header.mjs +1 -2
- package/dist/ui/dialog/dialog-header.vue.d.ts +5 -5
- package/dist/ui/dialog/dialog-overlay.mjs +1 -2
- package/dist/ui/dialog/dialog-overlay.vue.d.ts +0 -2
- package/dist/ui/dialog/dialog-root.mjs +1 -2
- package/dist/ui/dialog/dialog-root.vue.d.ts +8 -8
- package/dist/ui/dialog/dialog-title.mjs +1 -2
- package/dist/ui/dialog/dialog-title.vue.d.ts +5 -5
- package/dist/ui/dialog/dialog-trigger.mjs +1 -2
- package/dist/ui/dialog/dialog-trigger.vue.d.ts +5 -5
- package/dist/ui/dialog/index.mjs +4 -4
- package/dist/ui/dialog/use-dialog-state-events.mjs +1 -2
- package/dist/ui/form/form-control.mjs +1 -2
- package/dist/ui/form/form-control.vue.d.ts +5 -5
- package/dist/ui/form/form-description.mjs +1 -2
- package/dist/ui/form/form-description.vue.d.ts +5 -5
- package/dist/ui/form/form-field.mjs +1 -2
- package/dist/ui/form/form-field.vue.d.ts +5 -5
- package/dist/ui/form/form-item.mjs +1 -2
- package/dist/ui/form/form-item.vue.d.ts +5 -5
- package/dist/ui/form/form-label.mjs +3 -4
- package/dist/ui/form/form-label.vue.d.ts +5 -5
- package/dist/ui/form/form-message.mjs +1 -2
- package/dist/ui/form/form-message.vue.d.ts +0 -2
- package/dist/ui/form/injection-keys.d.ts +1 -3
- package/dist/ui/form/injection-keys.mjs +1 -2
- package/dist/ui/form/use-form-field.mjs +1 -2
- package/dist/ui/index.mjs +2 -2
- package/dist/ui/label/label.mjs +1 -2
- package/dist/ui/label/label.vue.d.ts +5 -5
- package/dist/ui/scroll-area/index.mjs +3 -3
- package/dist/ui/scroll-area/scroll-area.mjs +1 -2
- package/dist/ui/scroll-area/scroll-area.vue.d.ts +5 -5
- package/dist/ui/scroll-area/scroll-bar.mjs +1 -2
- package/dist/ui/scroll-area/scroll-bar.vue.d.ts +0 -2
- package/dist/ui/sheet/sheet-close.mjs +1 -2
- package/dist/ui/sheet/sheet-close.vue.d.ts +5 -5
- package/dist/ui/sheet/sheet-content.mjs +9 -5
- package/dist/ui/sheet/sheet-content.vue.d.ts +7 -5
- package/dist/ui/sheet/sheet-description.mjs +1 -2
- package/dist/ui/sheet/sheet-description.vue.d.ts +5 -5
- package/dist/ui/sheet/sheet-footer.mjs +1 -2
- package/dist/ui/sheet/sheet-footer.vue.d.ts +5 -5
- package/dist/ui/sheet/sheet-header.mjs +1 -2
- package/dist/ui/sheet/sheet-header.vue.d.ts +5 -5
- package/dist/ui/sheet/sheet-overlay.mjs +1 -2
- package/dist/ui/sheet/sheet-root.mjs +1 -2
- package/dist/ui/sheet/sheet-root.vue.d.ts +8 -8
- package/dist/ui/sheet/sheet-title.mjs +1 -2
- package/dist/ui/sheet/sheet-title.vue.d.ts +5 -5
- package/dist/ui/sheet/sheet.variants.d.ts +1 -3
- package/dist/ui/sheet/sheet.variants.mjs +1 -2
- package/dist/unocss/content.d.ts +1 -3
- package/dist/unocss/content.mjs +1 -2
- package/package.json +8 -8
|
@@ -6,7 +6,7 @@ import { isFunctionType } from "@vinicunca/taman-core/utils";
|
|
|
6
6
|
import { useSimpleLocale } from "@vinicunca/taman-core/composables";
|
|
7
7
|
import PInput from "pohon-ui/components/Input.vue";
|
|
8
8
|
import { useOverlay } from "pohon-ui/composables";
|
|
9
|
-
|
|
9
|
+
// src/popup/alert/alert-builder.ts
|
|
10
10
|
const alertIds = /* @__PURE__ */ new Set();
|
|
11
11
|
const { $t } = useSimpleLocale();
|
|
12
12
|
function tamanAlert(options) {
|
|
@@ -94,5 +94,4 @@ function clearAllAlerts() {
|
|
|
94
94
|
alertIds.delete(id);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
//#endregion
|
|
98
97
|
export { clearAllAlerts, tamanAlert, tamanConfirm, tamanPrompt };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _sfc_main$1 from "./alert2.mjs";
|
|
2
2
|
import { computed, createBlock, defineComponent, mergeModels, mergeProps, openBlock, useAttrs, useModel } from "vue";
|
|
3
|
-
|
|
3
|
+
// src/popup/alert/alert-overlay.vue
|
|
4
4
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
5
5
|
inheritAttrs: false,
|
|
6
6
|
__name: "alert-overlay",
|
|
@@ -51,5 +51,4 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
-
//#endregion
|
|
55
54
|
export { _sfc_main as default };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Component, VNode, VNodeArrayChildren } from "vue";
|
|
2
2
|
import { Recordable } from "@vinicunca/taman-core/typings";
|
|
3
|
-
//#region src/popup/alert/alert.d.ts
|
|
4
3
|
export type IconType = 'error' | 'info' | 'question' | 'success' | 'warning';
|
|
5
4
|
export interface AlertBeforeCloseScope {
|
|
6
5
|
isConfirm: boolean;
|
|
@@ -38,5 +37,4 @@ export interface AlertContext {
|
|
|
38
37
|
doCancel: () => void;
|
|
39
38
|
doConfirm: () => void;
|
|
40
39
|
}
|
|
41
|
-
export declare function useAlertContext(): AlertContext;
|
|
42
|
-
//#endregion
|
|
40
|
+
export declare function useAlertContext(): AlertContext;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { createContext } from "../../index.mjs";
|
|
2
|
-
|
|
2
|
+
// src/popup/alert/alert.ts
|
|
3
3
|
const [injectAlertContext, provideAlertContext] = createContext("TamanAlertContext");
|
|
4
4
|
function useAlertContext() {
|
|
5
5
|
const context = injectAlertContext();
|
|
6
6
|
if (!context) throw new Error("useAlertContext must be used within an AlertProvider");
|
|
7
7
|
return context;
|
|
8
8
|
}
|
|
9
|
-
//#endregion
|
|
10
9
|
export { injectAlertContext, provideAlertContext, useAlertContext };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { TamanAlertProps } from "./alert.js";
|
|
2
|
-
//#region src/popup/alert/alert.vue.d.ts
|
|
3
2
|
type __VLS_Props = TamanAlertProps;
|
|
4
3
|
type __VLS_ModelProps = {
|
|
5
4
|
'open'?: boolean;
|
|
@@ -22,5 +21,4 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
22
21
|
escapeKeyClose: boolean;
|
|
23
22
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
23
|
declare const _default: typeof __VLS_export;
|
|
25
|
-
//#endregion
|
|
26
24
|
export { _default as default };
|
|
@@ -15,7 +15,7 @@ import { isString } from "@vinicunca/taman-core/utils";
|
|
|
15
15
|
import { useOverlayZIndex, useSimpleLocale } from "@vinicunca/taman-core/composables";
|
|
16
16
|
import PIcon from "pohon-ui/components/Icon.vue";
|
|
17
17
|
import { usePreferences } from "@vinicunca/taman-core/preferences";
|
|
18
|
-
|
|
18
|
+
// src/popup/alert/alert.vue
|
|
19
19
|
const _hoisted_1 = { class: "flex items-center" };
|
|
20
20
|
const _hoisted_2 = { class: "flex-auto" };
|
|
21
21
|
const _hoisted_3 = { class: "m-4 min-h-7.5" };
|
|
@@ -234,5 +234,4 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
234
234
|
};
|
|
235
235
|
}
|
|
236
236
|
});
|
|
237
|
-
//#endregion
|
|
238
237
|
export { _sfc_main as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { useAlertContext } from "./alert.mjs";
|
|
2
|
-
import _sfc_main from "./alert2.mjs";
|
|
3
2
|
import { clearAllAlerts, tamanAlert, tamanConfirm, tamanPrompt } from "./alert-builder.mjs";
|
|
3
|
+
import _sfc_main from "./alert2.mjs";
|
|
4
4
|
export { _sfc_main as Alert, clearAllAlerts, tamanAlert, tamanConfirm, tamanPrompt, useAlertContext };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DialogApiOptions, DialogState } from "./dialog.types.js";
|
|
2
2
|
import { Store } from "@vinicunca/taman-core/store";
|
|
3
|
-
//#region src/popup/dialog/dialog.api.d.ts
|
|
4
3
|
export declare class DialogApi<TData = unknown> {
|
|
5
4
|
sharedData: Record<'payload', TData | undefined>;
|
|
6
5
|
store: Store<DialogState>;
|
|
@@ -18,5 +17,4 @@ export declare class DialogApi<TData = unknown> {
|
|
|
18
17
|
setData(payload: TData): this;
|
|
19
18
|
setState(stateOrFn: ((prev: DialogState) => Partial<DialogState>) | Partial<DialogState>): this;
|
|
20
19
|
unlock(): this;
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
20
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { bindMethods, isFunction } from "@vinicunca/taman-core/utils";
|
|
2
2
|
import { Store } from "@vinicunca/taman-core/store";
|
|
3
|
-
|
|
3
|
+
// src/popup/dialog/dialog.api.ts
|
|
4
4
|
var DialogApi = class {
|
|
5
5
|
/** Shared data */
|
|
6
6
|
sharedData = { payload: void 0 };
|
|
@@ -131,5 +131,4 @@ var DialogApi = class {
|
|
|
131
131
|
return this.lock(false);
|
|
132
132
|
}
|
|
133
133
|
};
|
|
134
|
-
//#endregion
|
|
135
134
|
export { DialogApi };
|
|
@@ -9,13 +9,13 @@ import _sfc_main$6 from "../../ui/dialog/dialog-root.mjs";
|
|
|
9
9
|
import _sfc_main$7 from "../../ui/dialog/dialog-title.mjs";
|
|
10
10
|
import { VisuallyHidden } from "../../index.mjs";
|
|
11
11
|
import { useDialogDraggable } from "./use-dialog-draggable.mjs";
|
|
12
|
-
import { computed, createBlock, createCommentVNode, createElementVNode, createTextVNode, createVNode, defineComponent, nextTick, normalizeClass, onDeactivated, openBlock, provide, ref, renderSlot, toDisplayString, unref, useId, watch, withCtx } from "vue";
|
|
12
|
+
import { computed, createBlock, createCommentVNode, createElementVNode, createTextVNode, createVNode, defineComponent, nextTick, normalizeClass, onActivated, onDeactivated, openBlock, provide, ref, renderSlot, toDisplayString, unref, useId, watch, withCtx } from "vue";
|
|
13
13
|
import PButton from "pohon-ui/components/Button.vue";
|
|
14
14
|
import PTooltip from "pohon-ui/components/Tooltip.vue";
|
|
15
15
|
import { useOverlayZIndex, usePriorityValues, useSimpleLocale } from "@vinicunca/taman-core/composables";
|
|
16
16
|
import PIcon from "pohon-ui/components/Icon.vue";
|
|
17
17
|
import { DISMISSABLE_DIALOG_ID, ELEMENT_ID_MAIN_CONTENT } from "@vinicunca/taman-core/constants";
|
|
18
|
-
|
|
18
|
+
// src/popup/dialog/dialog.vue
|
|
19
19
|
const _hoisted_1 = { class: "flex flex-col gap-1" };
|
|
20
20
|
const _hoisted_2 = { class: "flex-center gap-2" };
|
|
21
21
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
@@ -101,7 +101,9 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
101
101
|
const id = useId();
|
|
102
102
|
provide(DISMISSABLE_DIALOG_ID, id);
|
|
103
103
|
const { appendToMain, bordered, cancelText, centered, class: dialogClass, closable, closeOnClickModal, closeOnPressEscape, confirmDisabled, confirmLoading, confirmText, contentClass, description, destroyOnClose, draggable, overflow, footer: showFooter, footerClass, fullscreen: shouldFullscreen, fullscreenButton, header, headerClass, loading: showLoading, modal, openAutoFocus, overlayBlur, showCancelButton, showConfirmButton, submitting, title, titleTooltip, animationType, zIndex } = usePriorityValues(props, state);
|
|
104
|
-
const
|
|
104
|
+
const isDeactivated = ref(false);
|
|
105
|
+
const isVisible = computed(() => !!state?.value?.isOpen && !isDeactivated.value);
|
|
106
|
+
const openZIndex = useOverlayZIndex(isVisible);
|
|
105
107
|
const layerZIndex = computed(() => zIndex.value ?? openZIndex.value);
|
|
106
108
|
const shouldDraggable = computed(() => draggable.value && !shouldFullscreen.value && header.value);
|
|
107
109
|
const shouldCentered = computed(() => centered.value && !shouldFullscreen.value);
|
|
@@ -118,23 +120,26 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
118
120
|
});
|
|
119
121
|
const firstOpened = ref(false);
|
|
120
122
|
const isClosed = ref(true);
|
|
123
|
+
let pendingOpened = false;
|
|
121
124
|
watch(() => state?.value?.isOpen, async (isOpen_) => {
|
|
122
|
-
|
|
125
|
+
pendingOpened = !!isOpen_;
|
|
123
126
|
if (isOpen_) {
|
|
124
127
|
isClosed.value = false;
|
|
125
128
|
if (!firstOpened.value) firstOpened.value = true;
|
|
126
129
|
await nextTick();
|
|
127
|
-
if (!contentRef.value) return;
|
|
130
|
+
if (!contentRef.value || isDeactivated.value) return;
|
|
128
131
|
const innerContentRef = contentRef.value.getContentRef();
|
|
129
132
|
dialogRef.value = innerContentRef?.$el;
|
|
133
|
+
if (!dialogRef.value) return;
|
|
130
134
|
const { offsetX, offsetY } = transform;
|
|
131
135
|
dialogRef.value.style.transform = shouldCentered.value ? `translate(${offsetX}px, calc(-50% + ${offsetY}px))` : `translate(${offsetX}px, ${offsetY}px)`;
|
|
132
136
|
}
|
|
133
137
|
}, { immediate: true });
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
138
|
+
onActivated(() => {
|
|
139
|
+
isDeactivated.value = false;
|
|
140
|
+
});
|
|
137
141
|
onDeactivated(() => {
|
|
142
|
+
isDeactivated.value = true;
|
|
138
143
|
if (!appendToMain.value) props.dialogApi?.close();
|
|
139
144
|
});
|
|
140
145
|
function handleFullscreen() {
|
|
@@ -158,8 +163,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
158
163
|
if (!openAutoFocus.value) event?.preventDefault();
|
|
159
164
|
}
|
|
160
165
|
function handlePointerDownOutside(event) {
|
|
161
|
-
const
|
|
162
|
-
if (!closeOnClickModal.value ||
|
|
166
|
+
const isDismissableDialog = event.target?.dataset.dismissableDialog;
|
|
167
|
+
if (!closeOnClickModal.value || isDismissableDialog !== id || submitting.value) {
|
|
163
168
|
event.preventDefault();
|
|
164
169
|
event.stopPropagation();
|
|
165
170
|
}
|
|
@@ -170,11 +175,14 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
170
175
|
}
|
|
171
176
|
function handleCloseAutoFocus(_event) {}
|
|
172
177
|
const getForceMount = computed(() => {
|
|
173
|
-
return !unref(destroyOnClose) && unref(firstOpened);
|
|
178
|
+
return !isDeactivated.value && !unref(destroyOnClose) && unref(firstOpened);
|
|
174
179
|
});
|
|
175
180
|
function handleOpened() {
|
|
176
181
|
requestAnimationFrame(() => {
|
|
177
|
-
|
|
182
|
+
if (pendingOpened && isVisible.value) {
|
|
183
|
+
pendingOpened = false;
|
|
184
|
+
props.dialogApi?.onOpened();
|
|
185
|
+
}
|
|
178
186
|
});
|
|
179
187
|
}
|
|
180
188
|
function handleClosed() {
|
|
@@ -184,7 +192,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
184
192
|
return (_ctx, _cache) => {
|
|
185
193
|
return openBlock(), createBlock(unref(_sfc_main$6), {
|
|
186
194
|
modal: false,
|
|
187
|
-
open:
|
|
195
|
+
open: isVisible.value,
|
|
196
|
+
"unmount-on-hide": !isDeactivated.value || !firstOpened.value,
|
|
188
197
|
"onUpdate:open": _cache[2] || (_cache[2] = () => !unref(submitting) ? __props.dialogApi?.close() : void 0)
|
|
189
198
|
}, {
|
|
190
199
|
default: withCtx(() => [createVNode(unref(_sfc_main$4), {
|
|
@@ -199,9 +208,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
199
208
|
"top-0 left-0 size-full! max-h-full! max-w-full! translate-0!": unref(shouldFullscreen),
|
|
200
209
|
"top-1/2": unref(centered) && !unref(shouldFullscreen),
|
|
201
210
|
"duration-300": !unref(dragging),
|
|
202
|
-
"hidden": isClosed.value
|
|
211
|
+
"hidden": isClosed.value || isDeactivated.value
|
|
203
212
|
}, unref(dialogClass)]]),
|
|
204
213
|
"force-mount": getForceMount.value,
|
|
214
|
+
inactive: isDeactivated.value,
|
|
205
215
|
modal: unref(modal),
|
|
206
216
|
open: unref(state)?.isOpen,
|
|
207
217
|
"animation-type": unref(animationType),
|
|
@@ -321,6 +331,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
321
331
|
"append-to",
|
|
322
332
|
"class",
|
|
323
333
|
"force-mount",
|
|
334
|
+
"inactive",
|
|
324
335
|
"modal",
|
|
325
336
|
"open",
|
|
326
337
|
"animation-type",
|
|
@@ -328,9 +339,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
328
339
|
"overlay-blur"
|
|
329
340
|
])]),
|
|
330
341
|
_: 3
|
|
331
|
-
}, 8, ["open"]);
|
|
342
|
+
}, 8, ["open", "unmount-on-hide"]);
|
|
332
343
|
};
|
|
333
344
|
}
|
|
334
345
|
});
|
|
335
|
-
//#endregion
|
|
336
346
|
export { _sfc_main as default };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DialogApi } from "./dialog.api.js";
|
|
2
2
|
import { Component, HTMLAttributes, Ref } from "vue";
|
|
3
3
|
import { MaybePromise } from "@vinicunca/taman-core/typings";
|
|
4
|
-
//#region src/popup/dialog/dialog.types.d.ts
|
|
5
4
|
export interface DialogProps {
|
|
6
5
|
animationType?: 'scale' | 'slide';
|
|
7
6
|
appendToMain?: boolean;
|
|
@@ -56,5 +55,4 @@ export interface DialogApiOptions<TConnectedComponent extends Component = Compon
|
|
|
56
55
|
onOpenChange?: (isOpen: boolean) => void;
|
|
57
56
|
onOpened?: () => void;
|
|
58
57
|
}
|
|
59
|
-
//#endregion
|
|
60
58
|
export {};
|
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
import { DialogProps, ExtendedDialogApi } from "./dialog.types.js";
|
|
2
|
-
//#region src/popup/dialog/dialog.vue.d.ts
|
|
3
2
|
interface Props extends DialogProps {
|
|
4
3
|
dialogApi?: ExtendedDialogApi;
|
|
5
4
|
closeDisabled?: boolean;
|
|
6
5
|
closeClass?: string;
|
|
7
6
|
}
|
|
8
|
-
declare
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} & {
|
|
12
|
-
|
|
13
|
-
} & {
|
|
14
|
-
|
|
15
|
-
} & {
|
|
16
|
-
|
|
17
|
-
} & {
|
|
18
|
-
|
|
19
|
-
} & {
|
|
20
|
-
|
|
21
|
-
} & {
|
|
22
|
-
|
|
23
|
-
} & {
|
|
24
|
-
|
|
25
|
-
} & {
|
|
26
|
-
|
|
27
|
-
} & {
|
|
28
|
-
|
|
29
|
-
} & {
|
|
30
|
-
|
|
7
|
+
declare const __VLS_template: () => {
|
|
8
|
+
__VLS_Slots: {
|
|
9
|
+
title?: (props: {}) => any;
|
|
10
|
+
} & {
|
|
11
|
+
titleTooltip?: (props: {}) => any;
|
|
12
|
+
} & {
|
|
13
|
+
description?: (props: {}) => any;
|
|
14
|
+
} & {
|
|
15
|
+
extra?: (props: {}) => any;
|
|
16
|
+
} & {
|
|
17
|
+
default?: (props: {}) => any;
|
|
18
|
+
} & {
|
|
19
|
+
'leading-footer'?: (props: {}) => any;
|
|
20
|
+
} & {
|
|
21
|
+
footer?: (props: {}) => any;
|
|
22
|
+
} & {
|
|
23
|
+
cancelText?: (props: {}) => any;
|
|
24
|
+
} & {
|
|
25
|
+
'center-footer'?: (props: {}) => any;
|
|
26
|
+
} & {
|
|
27
|
+
confirmText?: (props: {}) => any;
|
|
28
|
+
} & {
|
|
29
|
+
'trailing-footer'?: (props: {}) => any;
|
|
30
|
+
};
|
|
31
31
|
};
|
|
32
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
32
33
|
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
33
34
|
appendToMain: boolean;
|
|
34
35
|
closable: boolean;
|
|
@@ -42,5 +43,4 @@ type __VLS_WithSlots<T, S> = T & {
|
|
|
42
43
|
$slots: S;
|
|
43
44
|
};
|
|
44
45
|
};
|
|
45
|
-
//#endregion
|
|
46
46
|
export { _default as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { onBeforeUnmount, onMounted, reactive, ref, watchEffect } from "vue";
|
|
2
2
|
import { unrefElement } from "@vueuse/core";
|
|
3
|
-
|
|
3
|
+
// src/popup/dialog/use-dialog-draggable.ts
|
|
4
4
|
function useDialogDraggable({ targetRef, dragRef, draggable, containerSelector, centered, isOverflow }) {
|
|
5
5
|
const transform = reactive({
|
|
6
6
|
offsetX: 0,
|
|
@@ -89,5 +89,4 @@ function useDialogDraggable({ targetRef, dragRef, draggable, containerSelector,
|
|
|
89
89
|
transform
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
//#endregion
|
|
93
92
|
export { useDialogDraggable };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DialogApiOptions, DialogProps, ExtendedDialogApi, InferDialogData } from "./dialog.types.js";
|
|
2
2
|
import { Component } from "vue";
|
|
3
|
-
//#region src/popup/dialog/use-taman-dialog.d.ts
|
|
4
3
|
declare const DIALOG_DATA_NOT_PROVIDED: unique symbol;
|
|
5
4
|
interface DialogDataNotProvided {
|
|
6
5
|
readonly [DIALOG_DATA_NOT_PROVIDED]: true;
|
|
@@ -9,5 +8,4 @@ type ResolvedDialogData<TData, TConnectedComponent extends Component> = TData ex
|
|
|
9
8
|
export declare function setDefaultDialogProps(props: Partial<DialogProps>): void;
|
|
10
9
|
export declare function useTamanDialog<TData = DialogDataNotProvided, TConnectedComponent extends Component = Component>(options?: DialogApiOptions<TConnectedComponent>): readonly [import("vue").DefineSetupFnComponent<DialogProps, {}, {}, DialogProps & {}, import("vue").PublicProps>, ExtendedDialogApi<ResolvedDialogData<TData, TConnectedComponent>>];
|
|
11
10
|
export declare function createTamanDialog<TData = unknown>(): <TConnectedComponent extends Component = Component>(options?: DialogApiOptions<TConnectedComponent>) => readonly [import("vue").DefineSetupFnComponent<DialogProps, {}, {}, DialogProps & {}, import("vue").PublicProps>, ExtendedDialogApi<ResolvedDialogData<TData, TConnectedComponent>>];
|
|
12
|
-
//#endregion
|
|
13
11
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import _sfc_main from "./dialog.mjs";
|
|
2
1
|
import { DialogApi } from "./dialog.api.mjs";
|
|
2
|
+
import _sfc_main from "./dialog.mjs";
|
|
3
3
|
import { defineComponent, h, inject, markRaw, nextTick, onBeforeUnmount, provide, ref, shallowReactive } from "vue";
|
|
4
4
|
import { useSelector } from "@vinicunca/taman-core/store";
|
|
5
5
|
import { usePreferences } from "@vinicunca/taman-core/preferences";
|
|
6
|
-
|
|
6
|
+
// src/popup/dialog/use-taman-dialog.ts
|
|
7
7
|
const TAMAN_DIALOG_INJECT_KEY = Symbol("TAMAN_DIALOG_INJECT");
|
|
8
8
|
const { globalEscapeShortcutKey } = usePreferences();
|
|
9
9
|
const DEFAULT_DIALOG_PROPS = {};
|
|
@@ -102,5 +102,4 @@ async function checkProps(api, attrs) {
|
|
|
102
102
|
const stateKeys = new Set(Object.keys(state));
|
|
103
103
|
for (const attr of Object.keys(attrs)) if (stateKeys.has(attr) && !["class"].includes(attr)) console.warn(`[Taman Dialog]: When 'connectedComponent' exists, do not set props or slots '${attr}', which will increase complexity. If you need to modify the props of Modal, please use useTamanDialog or api.`);
|
|
104
104
|
}
|
|
105
|
-
//#endregion
|
|
106
105
|
export { createTamanDialog, setDefaultDialogProps, useTamanDialog };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DrawerApiOptions, DrawerState } from "./drawer.types.js";
|
|
2
2
|
import { Store } from "@vinicunca/taman-core/store";
|
|
3
|
-
//#region src/popup/drawer/drawer.api.d.ts
|
|
4
3
|
export declare class DrawerApi<TData = unknown> {
|
|
5
4
|
sharedData: Record<'payload', TData | undefined>;
|
|
6
5
|
store: Store<DrawerState>;
|
|
@@ -18,5 +17,4 @@ export declare class DrawerApi<TData = unknown> {
|
|
|
18
17
|
setData(payload: TData): this;
|
|
19
18
|
setState(stateOrFn: ((prev: DrawerState) => Partial<DrawerState>) | Partial<DrawerState>): this;
|
|
20
19
|
unlock(): this;
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
20
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { bindMethods, isFunction } from "@vinicunca/taman-core/utils";
|
|
2
2
|
import { Store } from "@vinicunca/taman-core/store";
|
|
3
|
-
|
|
3
|
+
// src/popup/drawer/drawer.api.ts
|
|
4
4
|
var DrawerApi = class {
|
|
5
5
|
/** Shared data */
|
|
6
6
|
sharedData = { payload: void 0 };
|
|
@@ -121,5 +121,4 @@ var DrawerApi = class {
|
|
|
121
121
|
return this.lock(false);
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
|
-
//#endregion
|
|
125
124
|
export { DrawerApi };
|
|
@@ -8,14 +8,14 @@ import sheet_header_default from "../../ui/sheet/sheet-header.mjs";
|
|
|
8
8
|
import _sfc_main$6 from "../../ui/sheet/sheet-root.mjs";
|
|
9
9
|
import _sfc_main$7 from "../../ui/sheet/sheet-title.mjs";
|
|
10
10
|
import { VisuallyHidden } from "../../index.mjs";
|
|
11
|
-
import { computed, createBlock, createCommentVNode, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, onDeactivated, openBlock, provide, ref, renderSlot, toDisplayString, unref, useId, watch, withCtx } from "vue";
|
|
11
|
+
import { computed, createBlock, createCommentVNode, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, onActivated, onDeactivated, openBlock, provide, ref, renderSlot, toDisplayString, unref, useId, watch, withCtx } from "vue";
|
|
12
12
|
import PButton from "pohon-ui/components/Button.vue";
|
|
13
13
|
import PSeparator from "pohon-ui/components/Separator.vue";
|
|
14
14
|
import PTooltip from "pohon-ui/components/Tooltip.vue";
|
|
15
15
|
import { useBreakpoints, useOverlayZIndex, usePriorityValues, useSimpleLocale } from "@vinicunca/taman-core/composables";
|
|
16
16
|
import PIcon from "pohon-ui/components/Icon.vue";
|
|
17
17
|
import { DISMISSABLE_DRAWER_ID, ELEMENT_ID_MAIN_CONTENT } from "@vinicunca/taman-core/constants";
|
|
18
|
-
|
|
18
|
+
// src/popup/drawer/drawer.vue
|
|
19
19
|
const _hoisted_1 = { class: "flex items-center" };
|
|
20
20
|
const _hoisted_2 = { class: "flex flex-col gap-1" };
|
|
21
21
|
const _hoisted_3 = { class: "flex-center" };
|
|
@@ -86,12 +86,15 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
86
86
|
const { isMobile } = useBreakpoints();
|
|
87
87
|
const state = props.drawerApi?.useStore?.();
|
|
88
88
|
const { appendToMain, cancelText, class: drawerClass, closable, closeIconPlacement, closeOnClickModal, closeOnPressEscape, confirmLoading, confirmText, contentClass, description, destroyOnClose, footer: showFooter, footerClass, header: showHeader, headerClass, loading: showLoading, modal, openAutoFocus, overlayBlur, placement, showCancelButton, showConfirmButton, submitting, title, titleTooltip, zIndex } = usePriorityValues(props, state);
|
|
89
|
-
const
|
|
89
|
+
const isDeactivated = ref(false);
|
|
90
|
+
const isVisible = computed(() => !!state?.value?.isOpen && !isDeactivated.value);
|
|
91
|
+
const openZIndex = useOverlayZIndex(isVisible);
|
|
90
92
|
const layerZIndex = computed(() => zIndex.value ?? openZIndex.value);
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
93
|
+
onActivated(() => {
|
|
94
|
+
isDeactivated.value = false;
|
|
95
|
+
});
|
|
94
96
|
onDeactivated(() => {
|
|
97
|
+
isDeactivated.value = true;
|
|
95
98
|
if (!appendToMain.value) props.drawerApi?.close();
|
|
96
99
|
});
|
|
97
100
|
function interactOutside(event) {
|
|
@@ -119,8 +122,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
119
122
|
*/
|
|
120
123
|
const hasOpened = ref(false);
|
|
121
124
|
const isClosed = ref(true);
|
|
125
|
+
let pendingOpened = false;
|
|
122
126
|
watch(() => state?.value?.isOpen, (value) => {
|
|
123
|
-
|
|
127
|
+
pendingOpened = !!value;
|
|
128
|
+
if (value) isClosed.value = false;
|
|
124
129
|
if (value && !unref(hasOpened)) hasOpened.value = true;
|
|
125
130
|
}, { immediate: true });
|
|
126
131
|
function handleClosed() {
|
|
@@ -128,26 +133,36 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
128
133
|
props.drawerApi?.onClosed();
|
|
129
134
|
}
|
|
130
135
|
const getForceMount = computed(() => {
|
|
131
|
-
return !unref(destroyOnClose) && unref(hasOpened);
|
|
136
|
+
return !isDeactivated.value && !unref(destroyOnClose) && unref(hasOpened);
|
|
132
137
|
});
|
|
138
|
+
function handleOpened() {
|
|
139
|
+
requestAnimationFrame(() => {
|
|
140
|
+
if (pendingOpened && isVisible.value) {
|
|
141
|
+
pendingOpened = false;
|
|
142
|
+
props.drawerApi?.onOpened();
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
133
146
|
return (_ctx, _cache) => {
|
|
134
147
|
return openBlock(), createBlock(unref(_sfc_main$6), {
|
|
135
148
|
modal: false,
|
|
136
|
-
open:
|
|
137
|
-
"
|
|
149
|
+
open: isVisible.value,
|
|
150
|
+
"unmount-on-hide": !isDeactivated.value || !hasOpened.value,
|
|
151
|
+
"onUpdate:open": _cache[2] || (_cache[2] = () => __props.drawerApi?.close())
|
|
138
152
|
}, {
|
|
139
153
|
default: withCtx(() => [createVNode(unref(_sfc_main$4), {
|
|
140
154
|
"append-to": getAppendTo.value,
|
|
141
155
|
class: normalizeClass(["flex flex-col w-130", [{
|
|
142
156
|
"pohon:w-full": unref(isMobile) || unref(placement) === "bottom" || unref(placement) === "top",
|
|
143
157
|
"max-h-screen": unref(placement) === "bottom" || unref(placement) === "top",
|
|
144
|
-
"hidden": isClosed.value
|
|
158
|
+
"hidden": isClosed.value || isDeactivated.value
|
|
145
159
|
}, unref(drawerClass)]]),
|
|
146
160
|
modal: unref(modal),
|
|
147
161
|
open: unref(state)?.isOpen,
|
|
148
162
|
side: unref(placement),
|
|
149
163
|
"z-index": layerZIndex.value,
|
|
150
164
|
"force-mount": getForceMount.value,
|
|
165
|
+
inactive: isDeactivated.value,
|
|
151
166
|
"overlay-blur": unref(overlayBlur),
|
|
152
167
|
onCloseAutoFocus: handleFocusOutside,
|
|
153
168
|
onClosed: handleClosed,
|
|
@@ -155,7 +170,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
155
170
|
onFocusOutside: handleFocusOutside,
|
|
156
171
|
onInteractOutside: interactOutside,
|
|
157
172
|
onOpenAutoFocus: handerOpenAutoFocus,
|
|
158
|
-
onOpened:
|
|
173
|
+
onOpened: handleOpened,
|
|
159
174
|
onPointerDownOutside: pointerDownOutside
|
|
160
175
|
}, {
|
|
161
176
|
default: withCtx(() => [
|
|
@@ -266,12 +281,12 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
266
281
|
"side",
|
|
267
282
|
"z-index",
|
|
268
283
|
"force-mount",
|
|
284
|
+
"inactive",
|
|
269
285
|
"overlay-blur"
|
|
270
286
|
])]),
|
|
271
287
|
_: 3
|
|
272
|
-
}, 8, ["open"]);
|
|
288
|
+
}, 8, ["open", "unmount-on-hide"]);
|
|
273
289
|
};
|
|
274
290
|
}
|
|
275
291
|
});
|
|
276
|
-
//#endregion
|
|
277
292
|
export { _sfc_main as default };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { DrawerApi } from "./drawer.api.js";
|
|
2
2
|
import { Component, HTMLAttributes, Ref } from "vue";
|
|
3
3
|
import { MaybePromise } from "@vinicunca/taman-core/typings";
|
|
4
|
-
//#region src/popup/drawer/drawer.types.d.ts
|
|
5
4
|
export type DrawerPlacement = 'bottom' | 'left' | 'right' | 'top';
|
|
6
5
|
export type CloseIconPlacement = 'left' | 'right';
|
|
7
6
|
export interface TamanDrawerProps {
|
|
@@ -52,5 +51,4 @@ export interface DrawerApiOptions<TConnectedComponent extends Component = Compon
|
|
|
52
51
|
onOpenChange?: (isOpen: boolean) => void;
|
|
53
52
|
onOpened?: () => void;
|
|
54
53
|
}
|
|
55
|
-
//#endregion
|
|
56
54
|
export {};
|
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
import { CloseIconPlacement, ExtendedDrawerApi, TamanDrawerProps } from "./drawer.types.js";
|
|
2
|
-
//#region src/popup/drawer/drawer.vue.d.ts
|
|
3
2
|
interface Props extends TamanDrawerProps {
|
|
4
3
|
drawerApi?: ExtendedDrawerApi;
|
|
5
4
|
}
|
|
6
|
-
declare
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} & {
|
|
10
|
-
|
|
11
|
-
} & {
|
|
12
|
-
|
|
13
|
-
} & {
|
|
14
|
-
|
|
15
|
-
} & {
|
|
16
|
-
|
|
17
|
-
} & {
|
|
18
|
-
|
|
19
|
-
} & {
|
|
20
|
-
|
|
21
|
-
} & {
|
|
22
|
-
|
|
23
|
-
} & {
|
|
24
|
-
|
|
25
|
-
} & {
|
|
26
|
-
|
|
27
|
-
} & {
|
|
28
|
-
|
|
29
|
-
} & {
|
|
30
|
-
|
|
5
|
+
declare const __VLS_template: () => {
|
|
6
|
+
__VLS_Slots: {
|
|
7
|
+
'close-icon'?: (props: {}) => any;
|
|
8
|
+
} & {
|
|
9
|
+
title?: (props: {}) => any;
|
|
10
|
+
} & {
|
|
11
|
+
description?: (props: {}) => any;
|
|
12
|
+
} & {
|
|
13
|
+
extra?: (props: {}) => any;
|
|
14
|
+
} & {
|
|
15
|
+
'close-icon'?: (props: {}) => any;
|
|
16
|
+
} & {
|
|
17
|
+
default?: (props: {}) => any;
|
|
18
|
+
} & {
|
|
19
|
+
'prepend-footer'?: (props: {}) => any;
|
|
20
|
+
} & {
|
|
21
|
+
footer?: (props: {}) => any;
|
|
22
|
+
} & {
|
|
23
|
+
cancelText?: (props: {}) => any;
|
|
24
|
+
} & {
|
|
25
|
+
'center-footer'?: (props: {}) => any;
|
|
26
|
+
} & {
|
|
27
|
+
confirmText?: (props: {}) => any;
|
|
28
|
+
} & {
|
|
29
|
+
'append-footer'?: (props: {}) => any;
|
|
30
|
+
};
|
|
31
31
|
};
|
|
32
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
32
33
|
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
33
34
|
appendToMain: boolean;
|
|
34
35
|
closeIconPlacement: CloseIconPlacement;
|
|
@@ -43,5 +44,4 @@ type __VLS_WithSlots<T, S> = T & {
|
|
|
43
44
|
$slots: S;
|
|
44
45
|
};
|
|
45
46
|
};
|
|
46
|
-
//#endregion
|
|
47
47
|
export { _default as default };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DrawerApiOptions, ExtendedDrawerApi, InferDrawerData, TamanDrawerProps } from "./drawer.types.js";
|
|
2
2
|
import { Component } from "vue";
|
|
3
|
-
//#region src/popup/drawer/use-taman-drawer.d.ts
|
|
4
3
|
declare const DRAWER_DATA_NOT_PROVIDED: unique symbol;
|
|
5
4
|
interface DrawerDataNotProvided {
|
|
6
5
|
readonly [DRAWER_DATA_NOT_PROVIDED]: true;
|
|
@@ -9,5 +8,4 @@ type ResolvedDrawerData<TData, TConnectedComponent extends Component> = TData ex
|
|
|
9
8
|
export declare function setDefaultDrawerProps(props: Partial<TamanDrawerProps>): void;
|
|
10
9
|
export declare function useTamanDrawer<TData = DrawerDataNotProvided, TConnectedComponent extends Component = Component>(options?: DrawerApiOptions<TConnectedComponent>): readonly [import("vue").DefineSetupFnComponent<TamanDrawerProps, {}, {}, TamanDrawerProps & {}, import("vue").PublicProps>, ExtendedDrawerApi<ResolvedDrawerData<TData, TConnectedComponent>>];
|
|
11
10
|
export declare function createTamanDrawer<TData = unknown>(): <TConnectedComponent extends Component = Component>(options?: DrawerApiOptions<TConnectedComponent>) => readonly [import("vue").DefineSetupFnComponent<TamanDrawerProps, {}, {}, TamanDrawerProps & {}, import("vue").PublicProps>, ExtendedDrawerApi<ResolvedDrawerData<TData, TConnectedComponent>>];
|
|
12
|
-
//#endregion
|
|
13
11
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import _sfc_main from "./drawer.mjs";
|
|
2
1
|
import { DrawerApi } from "./drawer.api.mjs";
|
|
2
|
+
import _sfc_main from "./drawer.mjs";
|
|
3
3
|
import { defineComponent, h, inject, markRaw, nextTick, onBeforeUnmount, provide, ref, shallowReactive } from "vue";
|
|
4
4
|
import { useSelector } from "@vinicunca/taman-core/store";
|
|
5
5
|
import { usePreferences } from "@vinicunca/taman-core/preferences";
|
|
6
|
-
|
|
6
|
+
// src/popup/drawer/use-taman-drawer.ts
|
|
7
7
|
const TAMAN_DRAWER_INJECT_KEY = Symbol("TAMAN_DRAWER_INJECT");
|
|
8
8
|
const { globalEscapeShortcutKey } = usePreferences();
|
|
9
9
|
/**
|
|
@@ -105,5 +105,4 @@ async function checkProps(api, attrs) {
|
|
|
105
105
|
const stateKeys = new Set(Object.keys(state));
|
|
106
106
|
for (const attr of Object.keys(attrs)) if (stateKeys.has(attr) && !["class"].includes(attr)) console.warn(`[Taman Drawer]: When 'connectedComponent' exists, do not set props or slots '${attr}', which will increase complexity. If you need to modify the props of Drawer, please use useTamanDrawer or api.`);
|
|
107
107
|
}
|
|
108
|
-
//#endregion
|
|
109
108
|
export { createTamanDrawer, setDefaultDrawerProps, useTamanDrawer };
|