@vinicunca/taman-ui 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +2 -3
- 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/index.d.ts +1 -1
- package/dist/components/icon/index.mjs +1 -1
- package/dist/components/icon/{icon.mjs → taman-icon.mjs} +2 -3
- package/dist/components/icon/{icon.vue.d.ts → taman-icon.vue.d.ts} +0 -2
- package/dist/components/index.d.ts +1 -1
- 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 +5 -5
- 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 +5 -6
- package/dist/form/form-render/form-render-form.mjs +4 -5
- package/dist/form/form-render/form-render-group.mjs +4 -5
- 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 +3 -4
- 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.d.ts +1 -1
- package/dist/index.mjs +3 -3
- 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 +2 -3
- 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 +4 -5
- package/dist/menu/components/taman-menu-root.mjs +10 -10
- package/dist/menu/components/taman-menu-sub-menu-content.mjs +2 -3
- 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 +6 -4
- 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 +54 -61
- 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 +43 -33
- 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 +47 -32
- 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 +2 -3
- 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
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import _sfc_main$1 from "../../components/button/taman-button-icon.mjs";
|
|
2
|
-
import _sfc_main$2 from "../../components/
|
|
3
|
-
import _sfc_main$3 from "../../
|
|
4
|
-
import _sfc_main$4 from "../../ui/dialog/dialog-
|
|
5
|
-
import _sfc_main$5 from "../../ui/dialog/dialog-
|
|
2
|
+
import _sfc_main$2 from "../../components/icon/taman-icon.mjs";
|
|
3
|
+
import _sfc_main$3 from "../../components/loading/taman-loading.mjs";
|
|
4
|
+
import _sfc_main$4 from "../../ui/dialog/dialog-close.mjs";
|
|
5
|
+
import _sfc_main$5 from "../../ui/dialog/dialog-content.mjs";
|
|
6
|
+
import _sfc_main$6 from "../../ui/dialog/dialog-description.mjs";
|
|
6
7
|
import dialog_footer_default from "../../ui/dialog/dialog-footer.mjs";
|
|
7
8
|
import dialog_header_default from "../../ui/dialog/dialog-header.mjs";
|
|
8
|
-
import _sfc_main$
|
|
9
|
-
import _sfc_main$
|
|
9
|
+
import _sfc_main$7 from "../../ui/dialog/dialog-root.mjs";
|
|
10
|
+
import _sfc_main$8 from "../../ui/dialog/dialog-title.mjs";
|
|
10
11
|
import { VisuallyHidden } from "../../index.mjs";
|
|
11
12
|
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";
|
|
13
|
+
import { computed, createBlock, createCommentVNode, createElementVNode, createTextVNode, createVNode, defineComponent, nextTick, normalizeClass, onActivated, onDeactivated, openBlock, provide, ref, renderSlot, toDisplayString, unref, useId, watch, withCtx } from "vue";
|
|
13
14
|
import PButton from "pohon-ui/components/Button.vue";
|
|
14
15
|
import PTooltip from "pohon-ui/components/Tooltip.vue";
|
|
15
16
|
import { useOverlayZIndex, usePriorityValues, useSimpleLocale } from "@vinicunca/taman-core/composables";
|
|
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() {
|
|
@@ -182,12 +190,13 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
182
190
|
props.dialogApi?.onClosed();
|
|
183
191
|
}
|
|
184
192
|
return (_ctx, _cache) => {
|
|
185
|
-
return openBlock(), createBlock(unref(_sfc_main$
|
|
193
|
+
return openBlock(), createBlock(unref(_sfc_main$7), {
|
|
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
|
-
default: withCtx(() => [createVNode(unref(_sfc_main$
|
|
199
|
+
default: withCtx(() => [createVNode(unref(_sfc_main$5), {
|
|
191
200
|
ref_key: "contentRef",
|
|
192
201
|
ref: contentRef,
|
|
193
202
|
"append-to": getAppendTo.value,
|
|
@@ -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),
|
|
@@ -229,7 +239,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
229
239
|
}, unref(headerClass)]])
|
|
230
240
|
}, {
|
|
231
241
|
default: withCtx(() => [
|
|
232
|
-
createElementVNode("div", _hoisted_1, [unref(title) ? (openBlock(), createBlock(unref(_sfc_main$
|
|
242
|
+
createElementVNode("div", _hoisted_1, [unref(title) ? (openBlock(), createBlock(unref(_sfc_main$8), {
|
|
233
243
|
key: 0,
|
|
234
244
|
class: "text-left flex gap-1 items-center"
|
|
235
245
|
}, {
|
|
@@ -237,14 +247,14 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
237
247
|
key: 0,
|
|
238
248
|
text: unref(titleTooltip)
|
|
239
249
|
}, {
|
|
240
|
-
default: withCtx(() => [createVNode(
|
|
241
|
-
|
|
250
|
+
default: withCtx(() => [createVNode(unref(_sfc_main$2), {
|
|
251
|
+
icon: "lucide:circle-help",
|
|
242
252
|
class: "color-text-muted"
|
|
243
253
|
})]),
|
|
244
254
|
_: 1
|
|
245
255
|
}, 8, ["text"])) : createCommentVNode("v-if", true)])])]),
|
|
246
256
|
_: 3
|
|
247
|
-
})) : createCommentVNode("v-if", true), unref(description) ? (openBlock(), createBlock(unref(_sfc_main$
|
|
257
|
+
})) : createCommentVNode("v-if", true), unref(description) ? (openBlock(), createBlock(unref(_sfc_main$6), { key: 1 }, {
|
|
248
258
|
default: withCtx(() => [renderSlot(_ctx.$slots, "description", {}, () => [createTextVNode(toDisplayString(unref(description)), 1)])]),
|
|
249
259
|
_: 3
|
|
250
260
|
})) : createCommentVNode("v-if", true)]),
|
|
@@ -258,7 +268,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
258
268
|
variant: "ghost",
|
|
259
269
|
onClick: handleFullscreen
|
|
260
270
|
}, null, 8, ["icon"])) : createCommentVNode("v-if", true),
|
|
261
|
-
unref(closable) ? (openBlock(), createBlock(unref(_sfc_main$
|
|
271
|
+
unref(closable) ? (openBlock(), createBlock(unref(_sfc_main$4), {
|
|
262
272
|
key: 1,
|
|
263
273
|
"as-child": "",
|
|
264
274
|
onClick: handleClosed
|
|
@@ -272,14 +282,14 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
272
282
|
})) : createCommentVNode("v-if", true)
|
|
273
283
|
]),
|
|
274
284
|
!unref(title) || !unref(description) ? (openBlock(), createBlock(unref(VisuallyHidden), { key: 0 }, {
|
|
275
|
-
default: withCtx(() => [!unref(title) ? (openBlock(), createBlock(unref(_sfc_main$
|
|
285
|
+
default: withCtx(() => [!unref(title) ? (openBlock(), createBlock(unref(_sfc_main$8), { key: 0 })) : createCommentVNode("v-if", true), !unref(description) ? (openBlock(), createBlock(unref(_sfc_main$6), { key: 1 })) : createCommentVNode("v-if", true)]),
|
|
276
286
|
_: 1
|
|
277
287
|
})) : createCommentVNode("v-if", true)
|
|
278
288
|
]),
|
|
279
289
|
_: 3
|
|
280
290
|
}, 8, ["class"]),
|
|
281
|
-
createElementVNode("div", { class: normalizeClass(["
|
|
282
|
-
unref(showLoading) || unref(submitting) ? (openBlock(), createBlock(unref(_sfc_main$
|
|
291
|
+
createElementVNode("div", { class: normalizeClass(["px-4 py-3 flex-1 relative overflow-y-auto", [unref(contentClass), { "pointer-events-none": unref(showLoading) || unref(submitting) }]]) }, [renderSlot(_ctx.$slots, "default")], 2),
|
|
292
|
+
unref(showLoading) || unref(submitting) ? (openBlock(), createBlock(unref(_sfc_main$3), {
|
|
283
293
|
key: 0,
|
|
284
294
|
spinning: ""
|
|
285
295
|
})) : createCommentVNode("v-if", true),
|
|
@@ -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 };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import _sfc_main$1 from "../../components/button/taman-button-icon.mjs";
|
|
2
|
-
import _sfc_main$2 from "../../components/
|
|
3
|
-
import _sfc_main$3 from "../../
|
|
4
|
-
import _sfc_main$4 from "../../ui/sheet/sheet-
|
|
5
|
-
import _sfc_main$5 from "../../ui/sheet/sheet-
|
|
2
|
+
import _sfc_main$2 from "../../components/icon/taman-icon.mjs";
|
|
3
|
+
import _sfc_main$3 from "../../components/loading/taman-loading.mjs";
|
|
4
|
+
import _sfc_main$4 from "../../ui/sheet/sheet-close.mjs";
|
|
5
|
+
import _sfc_main$5 from "../../ui/sheet/sheet-content.mjs";
|
|
6
|
+
import _sfc_main$6 from "../../ui/sheet/sheet-description.mjs";
|
|
6
7
|
import sheet_footer_default from "../../ui/sheet/sheet-footer.mjs";
|
|
7
8
|
import sheet_header_default from "../../ui/sheet/sheet-header.mjs";
|
|
8
|
-
import _sfc_main$
|
|
9
|
-
import _sfc_main$
|
|
9
|
+
import _sfc_main$7 from "../../ui/sheet/sheet-root.mjs";
|
|
10
|
+
import _sfc_main$8 from "../../ui/sheet/sheet-title.mjs";
|
|
10
11
|
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";
|
|
12
|
+
import { computed, createBlock, createCommentVNode, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, onActivated, onDeactivated, openBlock, provide, ref, renderSlot, toDisplayString, unref, useId, watch, withCtx } from "vue";
|
|
12
13
|
import PButton from "pohon-ui/components/Button.vue";
|
|
13
14
|
import PSeparator from "pohon-ui/components/Separator.vue";
|
|
14
15
|
import PTooltip from "pohon-ui/components/Tooltip.vue";
|
|
15
16
|
import { useBreakpoints, useOverlayZIndex, usePriorityValues, useSimpleLocale } from "@vinicunca/taman-core/composables";
|
|
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
|
-
return openBlock(), createBlock(unref(_sfc_main$
|
|
147
|
+
return openBlock(), createBlock(unref(_sfc_main$7), {
|
|
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
|
-
default: withCtx(() => [createVNode(unref(_sfc_main$
|
|
153
|
+
default: withCtx(() => [createVNode(unref(_sfc_main$5), {
|
|
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(() => [
|
|
@@ -165,7 +180,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
165
180
|
}, {
|
|
166
181
|
default: withCtx(() => [
|
|
167
182
|
createElementVNode("div", _hoisted_1, [
|
|
168
|
-
unref(closable) && unref(closeIconPlacement) === "left" ? (openBlock(), createBlock(unref(_sfc_main$
|
|
183
|
+
unref(closable) && unref(closeIconPlacement) === "left" ? (openBlock(), createBlock(unref(_sfc_main$4), {
|
|
169
184
|
key: 0,
|
|
170
185
|
"as-child": "",
|
|
171
186
|
disabled: unref(submitting)
|
|
@@ -179,7 +194,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
179
194
|
decorative: "",
|
|
180
195
|
orientation: "vertical"
|
|
181
196
|
})) : createCommentVNode("v-if", true),
|
|
182
|
-
createElementVNode("div", _hoisted_2, [unref(title) ? (openBlock(), createBlock(unref(_sfc_main$
|
|
197
|
+
createElementVNode("div", _hoisted_2, [unref(title) ? (openBlock(), createBlock(unref(_sfc_main$8), {
|
|
183
198
|
key: 0,
|
|
184
199
|
class: "text-left inline-flex gap-1"
|
|
185
200
|
}, {
|
|
@@ -187,14 +202,14 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
187
202
|
key: 0,
|
|
188
203
|
text: unref(titleTooltip)
|
|
189
204
|
}, {
|
|
190
|
-
default: withCtx(() => [createVNode(
|
|
191
|
-
|
|
205
|
+
default: withCtx(() => [createVNode(unref(_sfc_main$2), {
|
|
206
|
+
icon: "lucide:circle-help",
|
|
192
207
|
class: "color-text-muted"
|
|
193
208
|
})]),
|
|
194
209
|
_: 1
|
|
195
210
|
}, 8, ["text"])) : createCommentVNode("v-if", true)])]),
|
|
196
211
|
_: 3
|
|
197
|
-
})) : createCommentVNode("v-if", true), unref(description) ? (openBlock(), createBlock(unref(_sfc_main$
|
|
212
|
+
})) : createCommentVNode("v-if", true), unref(description) ? (openBlock(), createBlock(unref(_sfc_main$6), {
|
|
198
213
|
key: 1,
|
|
199
214
|
class: "text-xs"
|
|
200
215
|
}, {
|
|
@@ -202,7 +217,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
202
217
|
_: 3
|
|
203
218
|
})) : createCommentVNode("v-if", true)])
|
|
204
219
|
]),
|
|
205
|
-
createElementVNode("div", _hoisted_3, [renderSlot(_ctx.$slots, "extra"), unref(closable) && unref(closeIconPlacement) === "right" ? (openBlock(), createBlock(unref(_sfc_main$
|
|
220
|
+
createElementVNode("div", _hoisted_3, [renderSlot(_ctx.$slots, "extra"), unref(closable) && unref(closeIconPlacement) === "right" ? (openBlock(), createBlock(unref(_sfc_main$4), {
|
|
206
221
|
key: 0,
|
|
207
222
|
"as-child": "",
|
|
208
223
|
disabled: unref(submitting)
|
|
@@ -211,17 +226,17 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
211
226
|
_: 3
|
|
212
227
|
}, 8, ["disabled"])) : createCommentVNode("v-if", true)]),
|
|
213
228
|
!unref(title) || !unref(description) ? (openBlock(), createBlock(unref(VisuallyHidden), { key: 0 }, {
|
|
214
|
-
default: withCtx(() => [!unref(title) ? (openBlock(), createBlock(unref(_sfc_main$
|
|
229
|
+
default: withCtx(() => [!unref(title) ? (openBlock(), createBlock(unref(_sfc_main$8), { key: 0 })) : createCommentVNode("v-if", true), !unref(description) ? (openBlock(), createBlock(unref(_sfc_main$6), { key: 1 })) : createCommentVNode("v-if", true)]),
|
|
215
230
|
_: 1
|
|
216
231
|
})) : createCommentVNode("v-if", true)
|
|
217
232
|
]),
|
|
218
233
|
_: 3
|
|
219
234
|
}, 8, ["class"])) : (openBlock(), createBlock(unref(VisuallyHidden), { key: 1 }, {
|
|
220
|
-
default: withCtx(() => [createVNode(unref(_sfc_main$
|
|
235
|
+
default: withCtx(() => [createVNode(unref(_sfc_main$8)), createVNode(unref(_sfc_main$6))]),
|
|
221
236
|
_: 1
|
|
222
237
|
})),
|
|
223
238
|
createElementVNode("div", { class: normalizeClass(["p-3 flex-1 relative overflow-y-auto", [unref(contentClass), { "pointer-events-none": unref(showLoading) || unref(submitting) }]]) }, [renderSlot(_ctx.$slots, "default")], 2),
|
|
224
|
-
unref(showLoading) || unref(submitting) ? (openBlock(), createBlock(unref(_sfc_main$
|
|
239
|
+
unref(showLoading) || unref(submitting) ? (openBlock(), createBlock(unref(_sfc_main$3), {
|
|
225
240
|
key: 2,
|
|
226
241
|
spinning: ""
|
|
227
242
|
})) : createCommentVNode("v-if", true),
|
|
@@ -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 };
|