vue-dialog-view 1.8.4 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -145,6 +145,10 @@ Example:
145
145
 
146
146
  These variables work across all builds and are the recommended way to adjust spacing.
147
147
 
148
+ ### Content Area Layout
149
+
150
+ The dialog's content area is a flex column container. Child components can use `flex: 1` (or `height: 100%`) to fill the available space, and overflow scrolling is handled by the wrapper — avoiding the `display:flex` + `overflow:auto` combination on the same element that causes issues in some browsers.
151
+
148
152
  ---
149
153
 
150
154
  ## 🛠️ Advanced: Build Variants
@@ -13,14 +13,14 @@ type __VLS_Slots = {} & {
13
13
  } & {
14
14
  footer?: (props: typeof __VLS_5) => any;
15
15
  };
16
- declare const __VLS_base: import('vue').DefineComponent<Props, {
16
+ declare const __VLS_base: import("vue").DefineComponent<Props, {
17
17
  get: () => HTMLDialogElement | undefined;
18
18
  open: () => void;
19
19
  close: () => void;
20
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
20
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
21
21
  "update:modelValue": (value: boolean) => any;
22
22
  closed: () => any;
23
- }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
23
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
24
24
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
25
25
  onClosed?: (() => any) | undefined;
26
26
  }>, {
@@ -28,7 +28,7 @@ declare const __VLS_base: import('vue').DefineComponent<Props, {
28
28
  showCloseButton: boolean;
29
29
  closable: boolean;
30
30
  closeOnClickMask: boolean;
31
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
31
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
32
32
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
33
33
  declare const _default: typeof __VLS_export;
34
34
  export default _default;
@@ -13,14 +13,14 @@ type __VLS_Slots = {} & {
13
13
  } & {
14
14
  footer?: (props: typeof __VLS_5) => any;
15
15
  };
16
- declare const __VLS_base: import('vue').DefineComponent<Props, {
16
+ declare const __VLS_base: import("vue").DefineComponent<Props, {
17
17
  get: () => HTMLDialogElement | undefined;
18
18
  open: () => void;
19
19
  close: () => void;
20
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
20
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
21
21
  "update:modelValue": (value: boolean) => any;
22
22
  closed: () => any;
23
- }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
23
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
24
24
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
25
25
  onClosed?: (() => any) | undefined;
26
26
  }>, {
@@ -28,7 +28,7 @@ declare const __VLS_base: import('vue').DefineComponent<Props, {
28
28
  showCloseButton: boolean;
29
29
  closable: boolean;
30
30
  closeOnClickMask: boolean;
31
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
31
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
32
32
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
33
33
  declare const _default: typeof __VLS_export;
34
34
  export default _default;
@@ -3,10 +3,10 @@ import { computed as e, createCommentVNode as t, createElementBlock as n, create
3
3
  var g = ["closedBy"], _ = {
4
4
  key: 0,
5
5
  class: "_4d394b1507fdc584"
6
- }, v = { class: "_088d860d2fd75292" }, y = { class: "_da3b3b2a4aeed1ee" }, b = {
6
+ }, v = { class: "_088d860d2fd75292" }, y = { class: "_0be228fb3f6dcf6a" }, b = { class: "_da3b3b2a4aeed1ee" }, x = {
7
7
  key: 1,
8
8
  class: "_61879ba330d9a71c"
9
- }, x = /* @__PURE__ */ i({
9
+ }, S = /* @__PURE__ */ i({
10
10
  __name: "DialogView.obf",
11
11
  props: {
12
12
  modelValue: { type: Boolean },
@@ -28,68 +28,68 @@ var g = ["closedBy"], _ = {
28
28
  }
29
29
  },
30
30
  emits: ["update:modelValue", "closed"],
31
- setup(i, { expose: x, emit: S }) {
32
- let C = i, w = S, T = f(), E = () => {
33
- w("update:modelValue", !0);
34
- }, D = () => {
35
- w("update:modelValue", !1);
36
- }, O = (e) => {
37
- e.preventDefault(), C.closable && D();
38
- }, k = f(!1), A = () => {
39
- if (!k.value) {
40
- if (!C.closable && C.modelValue) {
31
+ setup(i, { expose: S, emit: C }) {
32
+ let w = i, T = C, E = f(), D = () => {
33
+ T("update:modelValue", !0);
34
+ }, O = () => {
35
+ T("update:modelValue", !1);
36
+ }, k = (e) => {
37
+ e.preventDefault(), w.closable && O();
38
+ }, A = f(!1), j = () => {
39
+ if (!A.value) {
40
+ if (!w.closable && w.modelValue) {
41
41
  o(() => {
42
- T.value && !T.value.open && T.value.showModal();
42
+ E.value && !E.value.open && E.value.showModal();
43
43
  });
44
44
  return;
45
45
  }
46
- C.modelValue && w("update:modelValue", !1), o(() => {
47
- C.modelValue && T.value && !T.value.open && T.value.showModal();
48
- }), w("closed");
46
+ w.modelValue && T("update:modelValue", !1), o(() => {
47
+ w.modelValue && E.value && !E.value.open && E.value.showModal();
48
+ }), T("closed");
49
49
  }
50
- }, j = e(() => C.closable ? C.closeOnClickMask ? "any" : "closerequest" : "none");
51
- m(() => C.modelValue, async (e) => {
52
- await o(), e ? T.value && !T.value.open && T.value.showModal() : T.value && T.value.open && T.value.close();
50
+ }, M = e(() => w.closable ? w.closeOnClickMask ? "any" : "closerequest" : "none");
51
+ m(() => w.modelValue, async (e) => {
52
+ await o(), e ? E.value && !E.value.open && E.value.showModal() : E.value && E.value.open && E.value.close();
53
53
  });
54
- let M = () => {
55
- C.modelValue && T.value && !T.value.open && T.value.showModal();
54
+ let N = () => {
55
+ w.modelValue && E.value && !E.value.open && E.value.showModal();
56
56
  };
57
57
  return u(() => {
58
- M();
58
+ N();
59
59
  }), c(() => {
60
- T.value && T.value.open && T.value.close();
60
+ E.value && E.value.open && E.value.close();
61
61
  }), l(() => {
62
- T.value && T.value.open && (k.value = !0, T.value.close(), o(() => k.value = !1));
62
+ E.value && E.value.open && (A.value = !0, E.value.close(), o(() => A.value = !1));
63
63
  }), s(() => {
64
- M();
65
- }), x({
66
- get: () => T.value,
67
- open: E,
68
- close: D
64
+ N();
65
+ }), S({
66
+ get: () => E.value,
67
+ open: D,
68
+ close: O
69
69
  }), (e, o) => (d(), n("dialog", a({
70
70
  ref_key: "dialogRef",
71
- ref: T,
71
+ ref: E,
72
72
  class: "_b4102a3b79656a37"
73
73
  }, e.$attrs, {
74
- onClose: A,
75
- onCancel: O,
76
- closedBy: j.value
74
+ onClose: j,
75
+ onCancel: k,
76
+ closedBy: M.value
77
77
  }), [
78
78
  i.showTitleBar ? (d(), n("div", _, [r("span", v, [p(e.$slots, "title")]), i.showCloseButton && i.closable ? (d(), n("button", {
79
79
  key: 0,
80
80
  type: "button",
81
81
  "aria-label": "Close the dialog",
82
82
  class: "_468ff1da37ead40a",
83
- onClick: h(D, ["prevent"])
83
+ onClick: h(O, ["prevent"])
84
84
  }, "×")) : t("", !0)])) : t("", !0),
85
- r("div", y, [p(e.$slots, "default")]),
86
- e.$slots.footer ? (d(), n("div", b, [p(e.$slots, "footer")])) : t("", !0)
85
+ r("div", y, [r("div", b, [p(e.$slots, "default")])]),
86
+ e.$slots.footer ? (d(), n("div", x, [p(e.$slots, "footer")])) : t("", !0)
87
87
  ], 16, g));
88
88
  }
89
- }), S = { install: (e) => {
90
- e.component("DialogView", x);
89
+ }), C = { install: (e) => {
90
+ e.component("DialogView", S);
91
91
  } };
92
92
  //#endregion
93
- export { x as DialogView, S as DialogViewPlugin, S as default };
93
+ export { S as DialogView, C as DialogViewPlugin, C as default };
94
94
 
95
95
  //# sourceMappingURL=cssless-obfuscated.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cssless-obfuscated.es.js","names":["$attrs","$slots"],"sources":["../src/DialogView.obf.vue","../src/DialogView.obf.vue","../src/index.ts"],"sourcesContent":["<template>\n <dialog\n ref=\"dialogRef\"\n class=\"_b4102a3b79656a37\"\n v-bind=\"$attrs\"\n @close=\"handleDialogClose\"\n @cancel=\"handleDialogCancel\"\n :closedBy=\"closedBy\"\n >\n <div v-if=\"showTitleBar\" class=\"_4d394b1507fdc584\">\n <span class=\"_088d860d2fd75292\">\n <slot name=\"title\"></slot>\n </span>\n <button\n v-if=\"showCloseButton && closable\"\n type=\"button\"\n aria-label=\"Close the dialog\"\n class=\"_468ff1da37ead40a\"\n @click.prevent=\"closeDialog\"\n >&times;</button>\n </div>\n \n <div class=\"_da3b3b2a4aeed1ee\">\n <slot></slot>\n </div>\n\n <div v-if=\"$slots.footer\" class=\"_61879ba330d9a71c\">\n <slot name=\"footer\"></slot>\n </div>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, computed, nextTick, onMounted, onBeforeUnmount, onDeactivated, onActivated } from 'vue'\n\ninterface Props {\n modelValue: boolean\n showTitleBar?: boolean\n showCloseButton?: boolean\n closable?: boolean\n closeOnClickMask?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n showTitleBar: true,\n showCloseButton: true,\n closable: true,\n closeOnClickMask: false,\n})\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n (e: 'closed'): void\n}>()\n\nconst dialogRef = ref<HTMLDialogElement>();\n\nconst openDialog = (): void => {\n emit('update:modelValue', true)\n}\n\nconst closeDialog = (): void => {\n emit('update:modelValue', false)\n}\n\nconst handleDialogCancel = (e: Event) => {\n e.preventDefault();\n if (props.closable) closeDialog();\n}\n\nconst ignoreCloseEvent = ref(false);\n\nconst handleDialogClose = (): void => {\n if (ignoreCloseEvent.value) return;\n if (!props.closable) {\n if (props.modelValue) {\n // not programmatically close\n // re-open the dialog\n nextTick(() => {\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }) // Avoid using 'cancel' event because some browsers handle it incorrectly, see https://issues.chromium.org/issues/41491338\n return;\n }\n }\n if (props.modelValue) {\n emit('update:modelValue', false)\n }\n nextTick(() => {\n if (props.modelValue) {\n // model value keep unchanged\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }\n })\n emit('closed')\n}\n\nconst closedBy = computed(() => props.closable ? (props.closeOnClickMask ? 'any' : 'closerequest') : 'none') // see https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/closedBy\n\nwatch(() => props.modelValue, async (newValue: boolean) => {\n await nextTick()\n \n if (newValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n } else {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n }\n})\n\nconst initDialog = () => {\n if (props.modelValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n }\n};\n\nonMounted(() => {\n initDialog();\n});\n\nonBeforeUnmount(() => {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n});\n\nonDeactivated(() => {\n if (dialogRef.value && dialogRef.value.open) {\n ignoreCloseEvent.value = true;\n dialogRef.value.close();\n nextTick(() => ignoreCloseEvent.value = false);\n }\n});\n\nonActivated(() => {\n initDialog();\n});\n\ndefineExpose({\n get: () => dialogRef.value,\n open: openDialog,\n close: closeDialog,\n});\n</script>\n\n<style>\n._b4102a3b79656a37 {\n padding: var(--dialog-padding, 20px);\n border-radius: 5px;\n border: 1px solid gray;\n outline: 0 !important;\n max-width: calc(100% - 2em);\n max-height: calc(100% - 2em);\n box-sizing: border-box;\n overflow: hidden;\n}\n\n._b4102a3b79656a37[open] {\n display: flex;\n flex-direction: column;\n}\n\n._b4102a3b79656a37::backdrop {\n background: rgba(0, 0, 0, 0.5);\n}\n\n._4d394b1507fdc584 {\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-bottom: 0.5em;\n min-height: var(--dialog-title-height, 24px);\n white-space: pre;\n overflow: hidden;\n user-select: none;\n}\n\n._088d860d2fd75292 {\n flex: 1;\n text-align: center;\n font-weight: bold;\n font-size: large;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n._468ff1da37ead40a {\n margin-left: 0.5em;\n text-decoration: none;\n color: #666;\n font-size: 1.5em;\n line-height: 1;\n width: 24px;\n height: 24px;\n padding: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n border: none;\n background: none;\n}\n\n._468ff1da37ead40a:hover {\n color: #333;\n background-color: #f0f0f0;\n border-radius: 3px;\n}\n\n._468ff1da37ead40a:focus-visible {\n outline: 2px solid rgb(160, 207, 255);\n outline-offset: -2px;\n}\n\n._da3b3b2a4aeed1ee {\n flex: 1;\n overflow: auto;\n display: flex;\n flex-direction: column;\n}\n\n._61879ba330d9a71c {\n margin-top: 0.5em;\n}\n</style>\n","<template>\n <dialog\n ref=\"dialogRef\"\n class=\"_b4102a3b79656a37\"\n v-bind=\"$attrs\"\n @close=\"handleDialogClose\"\n @cancel=\"handleDialogCancel\"\n :closedBy=\"closedBy\"\n >\n <div v-if=\"showTitleBar\" class=\"_4d394b1507fdc584\">\n <span class=\"_088d860d2fd75292\">\n <slot name=\"title\"></slot>\n </span>\n <button\n v-if=\"showCloseButton && closable\"\n type=\"button\"\n aria-label=\"Close the dialog\"\n class=\"_468ff1da37ead40a\"\n @click.prevent=\"closeDialog\"\n >&times;</button>\n </div>\n \n <div class=\"_da3b3b2a4aeed1ee\">\n <slot></slot>\n </div>\n\n <div v-if=\"$slots.footer\" class=\"_61879ba330d9a71c\">\n <slot name=\"footer\"></slot>\n </div>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, computed, nextTick, onMounted, onBeforeUnmount, onDeactivated, onActivated } from 'vue'\n\ninterface Props {\n modelValue: boolean\n showTitleBar?: boolean\n showCloseButton?: boolean\n closable?: boolean\n closeOnClickMask?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n showTitleBar: true,\n showCloseButton: true,\n closable: true,\n closeOnClickMask: false,\n})\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n (e: 'closed'): void\n}>()\n\nconst dialogRef = ref<HTMLDialogElement>();\n\nconst openDialog = (): void => {\n emit('update:modelValue', true)\n}\n\nconst closeDialog = (): void => {\n emit('update:modelValue', false)\n}\n\nconst handleDialogCancel = (e: Event) => {\n e.preventDefault();\n if (props.closable) closeDialog();\n}\n\nconst ignoreCloseEvent = ref(false);\n\nconst handleDialogClose = (): void => {\n if (ignoreCloseEvent.value) return;\n if (!props.closable) {\n if (props.modelValue) {\n // not programmatically close\n // re-open the dialog\n nextTick(() => {\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }) // Avoid using 'cancel' event because some browsers handle it incorrectly, see https://issues.chromium.org/issues/41491338\n return;\n }\n }\n if (props.modelValue) {\n emit('update:modelValue', false)\n }\n nextTick(() => {\n if (props.modelValue) {\n // model value keep unchanged\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }\n })\n emit('closed')\n}\n\nconst closedBy = computed(() => props.closable ? (props.closeOnClickMask ? 'any' : 'closerequest') : 'none') // see https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/closedBy\n\nwatch(() => props.modelValue, async (newValue: boolean) => {\n await nextTick()\n \n if (newValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n } else {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n }\n})\n\nconst initDialog = () => {\n if (props.modelValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n }\n};\n\nonMounted(() => {\n initDialog();\n});\n\nonBeforeUnmount(() => {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n});\n\nonDeactivated(() => {\n if (dialogRef.value && dialogRef.value.open) {\n ignoreCloseEvent.value = true;\n dialogRef.value.close();\n nextTick(() => ignoreCloseEvent.value = false);\n }\n});\n\nonActivated(() => {\n initDialog();\n});\n\ndefineExpose({\n get: () => dialogRef.value,\n open: openDialog,\n close: closeDialog,\n});\n</script>\n\n<style>\n._b4102a3b79656a37 {\n padding: var(--dialog-padding, 20px);\n border-radius: 5px;\n border: 1px solid gray;\n outline: 0 !important;\n max-width: calc(100% - 2em);\n max-height: calc(100% - 2em);\n box-sizing: border-box;\n overflow: hidden;\n}\n\n._b4102a3b79656a37[open] {\n display: flex;\n flex-direction: column;\n}\n\n._b4102a3b79656a37::backdrop {\n background: rgba(0, 0, 0, 0.5);\n}\n\n._4d394b1507fdc584 {\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-bottom: 0.5em;\n min-height: var(--dialog-title-height, 24px);\n white-space: pre;\n overflow: hidden;\n user-select: none;\n}\n\n._088d860d2fd75292 {\n flex: 1;\n text-align: center;\n font-weight: bold;\n font-size: large;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n._468ff1da37ead40a {\n margin-left: 0.5em;\n text-decoration: none;\n color: #666;\n font-size: 1.5em;\n line-height: 1;\n width: 24px;\n height: 24px;\n padding: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n border: none;\n background: none;\n}\n\n._468ff1da37ead40a:hover {\n color: #333;\n background-color: #f0f0f0;\n border-radius: 3px;\n}\n\n._468ff1da37ead40a:focus-visible {\n outline: 2px solid rgb(160, 207, 255);\n outline-offset: -2px;\n}\n\n._da3b3b2a4aeed1ee {\n flex: 1;\n overflow: auto;\n display: flex;\n flex-direction: column;\n}\n\n._61879ba330d9a71c {\n margin-top: 0.5em;\n}\n</style>\n","import { App, Plugin } from 'vue'\nimport DialogViewComponent from './DialogView.obf.vue'\n\nexport { default as DialogView } from './DialogView.obf.vue'\n\nexport const DialogViewPlugin: Plugin = {\n install: (app: App) => {\n app.component('DialogView', DialogViewComponent)\n }\n}\n\nexport default DialogViewPlugin\n"],"mappings":";;;;;;;;;;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AAU;GACrB,MAAM;GACN,OAAO;GACR,CAAC,kBAjJA,EA4BS,UA5BT,EA4BS;YA3BH;GAAJ,KAAI;GACJ,OAAM;KACEA,EAAAA,QAAM;GACb,SAAO;GACP,UAAQ;GACR,UAAU,EAAA;;GAEA,EAAA,gBAAA,GAAA,EAAX,EAWM,OAXN,GAWM,CAVJ,EAEO,QAFP,GAEO,CADL,EAA0B,EAAA,QAAA,QAAA,CAAA,CAAA,EAGpB,EAAA,mBAAmB,EAAA,YAAA,GAAA,EAD3B,EAMiB,UAAA;;IAJf,MAAK;IACL,cAAW;IACX,OAAM;IACL,SAAK,EAAU,GAAW,CAAA,UAAA,CAAA;MAC5B,IAAO,IAAA,EAAA,IAAA,GAAA,CAAA,CAAA,IAAA,EAAA,IAAA,GAAA;GAGV,EAEM,OAFN,GAEM,CADJ,EAAa,EAAA,QAAA,UAAA,CAAA,CAAA;GAGJC,EAAAA,OAAO,UAAA,GAAA,EAAlB,EAEM,OAFN,GAEM,CADJ,EAA2B,EAAA,QAAA,SAAA,CAAA,CAAA,IAAA,EAAA,IAAA,GAAA;;;IEtBpB,IAA2B,EACtC,UAAU,MAAa;CACrB,EAAI,UAAU,cAAc,EAAoB;GAEnD"}
1
+ {"version":3,"file":"cssless-obfuscated.es.js","names":["$attrs","$slots"],"sources":["../src/DialogView.obf.vue","../src/DialogView.obf.vue","../src/index.ts"],"sourcesContent":["<template>\n <dialog\n ref=\"dialogRef\"\n class=\"_b4102a3b79656a37\"\n v-bind=\"$attrs\"\n @close=\"handleDialogClose\"\n @cancel=\"handleDialogCancel\"\n :closedBy=\"closedBy\"\n >\n <div v-if=\"showTitleBar\" class=\"_4d394b1507fdc584\">\n <span class=\"_088d860d2fd75292\">\n <slot name=\"title\"></slot>\n </span>\n <button\n v-if=\"showCloseButton && closable\"\n type=\"button\"\n aria-label=\"Close the dialog\"\n class=\"_468ff1da37ead40a\"\n @click.prevent=\"closeDialog\"\n >&times;</button>\n </div>\n \n <div class=\"_0be228fb3f6dcf6a\">\n <div class=\"_da3b3b2a4aeed1ee\">\n <slot></slot>\n </div>\n </div>\n\n <div v-if=\"$slots.footer\" class=\"_61879ba330d9a71c\">\n <slot name=\"footer\"></slot>\n </div>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, computed, nextTick, onMounted, onBeforeUnmount, onDeactivated, onActivated } from 'vue'\n\ninterface Props {\n modelValue: boolean\n showTitleBar?: boolean\n showCloseButton?: boolean\n closable?: boolean\n closeOnClickMask?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n showTitleBar: true,\n showCloseButton: true,\n closable: true,\n closeOnClickMask: false,\n})\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n (e: 'closed'): void\n}>()\n\nconst dialogRef = ref<HTMLDialogElement>();\n\nconst openDialog = (): void => {\n emit('update:modelValue', true)\n}\n\nconst closeDialog = (): void => {\n emit('update:modelValue', false)\n}\n\nconst handleDialogCancel = (e: Event) => {\n e.preventDefault();\n if (props.closable) closeDialog();\n}\n\nconst ignoreCloseEvent = ref(false);\n\nconst handleDialogClose = (): void => {\n if (ignoreCloseEvent.value) return;\n if (!props.closable) {\n if (props.modelValue) {\n // not programmatically close\n // re-open the dialog\n nextTick(() => {\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }) // Avoid using 'cancel' event because some browsers handle it incorrectly, see https://issues.chromium.org/issues/41491338\n return;\n }\n }\n if (props.modelValue) {\n emit('update:modelValue', false)\n }\n nextTick(() => {\n if (props.modelValue) {\n // model value keep unchanged\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }\n })\n emit('closed')\n}\n\nconst closedBy = computed(() => props.closable ? (props.closeOnClickMask ? 'any' : 'closerequest') : 'none') // see https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/closedBy\n\nwatch(() => props.modelValue, async (newValue: boolean) => {\n await nextTick()\n \n if (newValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n } else {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n }\n})\n\nconst initDialog = () => {\n if (props.modelValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n }\n};\n\nonMounted(() => {\n initDialog();\n});\n\nonBeforeUnmount(() => {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n});\n\nonDeactivated(() => {\n if (dialogRef.value && dialogRef.value.open) {\n ignoreCloseEvent.value = true;\n dialogRef.value.close();\n nextTick(() => ignoreCloseEvent.value = false);\n }\n});\n\nonActivated(() => {\n initDialog();\n});\n\ndefineExpose({\n get: () => dialogRef.value,\n open: openDialog,\n close: closeDialog,\n});\n</script>\n\n<style>\n._b4102a3b79656a37 {\n padding: var(--dialog-padding, 20px);\n border-radius: 5px;\n border: 1px solid gray;\n outline: 0 !important;\n max-width: calc(100% - 2em);\n max-height: calc(100% - 2em);\n box-sizing: border-box;\n overflow: hidden;\n}\n\n._b4102a3b79656a37[open] {\n display: flex;\n flex-direction: column;\n}\n\n._b4102a3b79656a37::backdrop {\n background: rgba(0, 0, 0, 0.5);\n}\n\n._4d394b1507fdc584 {\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-bottom: 0.5em;\n min-height: var(--dialog-title-height, 24px);\n white-space: pre;\n overflow: hidden;\n user-select: none;\n}\n\n._088d860d2fd75292 {\n flex: 1;\n text-align: center;\n font-weight: bold;\n font-size: large;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n._468ff1da37ead40a {\n margin-left: 0.5em;\n text-decoration: none;\n color: #666;\n font-size: 1.5em;\n line-height: 1;\n width: 24px;\n height: 24px;\n padding: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n border: none;\n background: none;\n}\n\n._468ff1da37ead40a:hover {\n color: #333;\n background-color: #f0f0f0;\n border-radius: 3px;\n}\n\n._468ff1da37ead40a:focus-visible {\n outline: 2px solid rgb(160, 207, 255);\n outline-offset: -2px;\n}\n\n._0be228fb3f6dcf6a {\n flex: 1;\n overflow: auto;\n}\n\n._da3b3b2a4aeed1ee {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n}\n\n._61879ba330d9a71c {\n margin-top: 0.5em;\n}\n</style>\n","<template>\n <dialog\n ref=\"dialogRef\"\n class=\"_b4102a3b79656a37\"\n v-bind=\"$attrs\"\n @close=\"handleDialogClose\"\n @cancel=\"handleDialogCancel\"\n :closedBy=\"closedBy\"\n >\n <div v-if=\"showTitleBar\" class=\"_4d394b1507fdc584\">\n <span class=\"_088d860d2fd75292\">\n <slot name=\"title\"></slot>\n </span>\n <button\n v-if=\"showCloseButton && closable\"\n type=\"button\"\n aria-label=\"Close the dialog\"\n class=\"_468ff1da37ead40a\"\n @click.prevent=\"closeDialog\"\n >&times;</button>\n </div>\n \n <div class=\"_0be228fb3f6dcf6a\">\n <div class=\"_da3b3b2a4aeed1ee\">\n <slot></slot>\n </div>\n </div>\n\n <div v-if=\"$slots.footer\" class=\"_61879ba330d9a71c\">\n <slot name=\"footer\"></slot>\n </div>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, computed, nextTick, onMounted, onBeforeUnmount, onDeactivated, onActivated } from 'vue'\n\ninterface Props {\n modelValue: boolean\n showTitleBar?: boolean\n showCloseButton?: boolean\n closable?: boolean\n closeOnClickMask?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n showTitleBar: true,\n showCloseButton: true,\n closable: true,\n closeOnClickMask: false,\n})\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n (e: 'closed'): void\n}>()\n\nconst dialogRef = ref<HTMLDialogElement>();\n\nconst openDialog = (): void => {\n emit('update:modelValue', true)\n}\n\nconst closeDialog = (): void => {\n emit('update:modelValue', false)\n}\n\nconst handleDialogCancel = (e: Event) => {\n e.preventDefault();\n if (props.closable) closeDialog();\n}\n\nconst ignoreCloseEvent = ref(false);\n\nconst handleDialogClose = (): void => {\n if (ignoreCloseEvent.value) return;\n if (!props.closable) {\n if (props.modelValue) {\n // not programmatically close\n // re-open the dialog\n nextTick(() => {\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }) // Avoid using 'cancel' event because some browsers handle it incorrectly, see https://issues.chromium.org/issues/41491338\n return;\n }\n }\n if (props.modelValue) {\n emit('update:modelValue', false)\n }\n nextTick(() => {\n if (props.modelValue) {\n // model value keep unchanged\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }\n })\n emit('closed')\n}\n\nconst closedBy = computed(() => props.closable ? (props.closeOnClickMask ? 'any' : 'closerequest') : 'none') // see https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/closedBy\n\nwatch(() => props.modelValue, async (newValue: boolean) => {\n await nextTick()\n \n if (newValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n } else {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n }\n})\n\nconst initDialog = () => {\n if (props.modelValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n }\n};\n\nonMounted(() => {\n initDialog();\n});\n\nonBeforeUnmount(() => {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n});\n\nonDeactivated(() => {\n if (dialogRef.value && dialogRef.value.open) {\n ignoreCloseEvent.value = true;\n dialogRef.value.close();\n nextTick(() => ignoreCloseEvent.value = false);\n }\n});\n\nonActivated(() => {\n initDialog();\n});\n\ndefineExpose({\n get: () => dialogRef.value,\n open: openDialog,\n close: closeDialog,\n});\n</script>\n\n<style>\n._b4102a3b79656a37 {\n padding: var(--dialog-padding, 20px);\n border-radius: 5px;\n border: 1px solid gray;\n outline: 0 !important;\n max-width: calc(100% - 2em);\n max-height: calc(100% - 2em);\n box-sizing: border-box;\n overflow: hidden;\n}\n\n._b4102a3b79656a37[open] {\n display: flex;\n flex-direction: column;\n}\n\n._b4102a3b79656a37::backdrop {\n background: rgba(0, 0, 0, 0.5);\n}\n\n._4d394b1507fdc584 {\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-bottom: 0.5em;\n min-height: var(--dialog-title-height, 24px);\n white-space: pre;\n overflow: hidden;\n user-select: none;\n}\n\n._088d860d2fd75292 {\n flex: 1;\n text-align: center;\n font-weight: bold;\n font-size: large;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n._468ff1da37ead40a {\n margin-left: 0.5em;\n text-decoration: none;\n color: #666;\n font-size: 1.5em;\n line-height: 1;\n width: 24px;\n height: 24px;\n padding: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n border: none;\n background: none;\n}\n\n._468ff1da37ead40a:hover {\n color: #333;\n background-color: #f0f0f0;\n border-radius: 3px;\n}\n\n._468ff1da37ead40a:focus-visible {\n outline: 2px solid rgb(160, 207, 255);\n outline-offset: -2px;\n}\n\n._0be228fb3f6dcf6a {\n flex: 1;\n overflow: auto;\n}\n\n._da3b3b2a4aeed1ee {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n}\n\n._61879ba330d9a71c {\n margin-top: 0.5em;\n}\n</style>\n","import { App, Plugin } from 'vue'\nimport DialogViewComponent from './DialogView.obf.vue'\n\nexport { default as DialogView } from './DialogView.obf.vue'\n\nexport const DialogViewPlugin: Plugin = {\n install: (app: App) => {\n app.component('DialogView', DialogViewComponent)\n }\n}\n\nexport default DialogViewPlugin\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6CA,IAAM,IAAQ,GAOR,IAAO,GAKP,IAAY,EAAuB,GAEnC,UAAyB;GAC7B,EAAK,qBAAqB,EAAI;EAChC,GAEM,UAA0B;GAC9B,EAAK,qBAAqB,EAAK;EACjC,GAEM,KAAsB,MAAa;GAEvC,AADA,EAAE,eAAe,GACb,EAAM,YAAU,EAAY;EAClC,GAEM,IAAmB,EAAI,EAAK,GAE5B,UAAgC;GAChC,OAAiB,OACrB;QAAI,CAA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A,QAAA,OAAA,CAAA,CAAA,GAGpB,EAAA,mBAAmB,EAAA,YAAA,EAAA,GAD3B,EAMiB,UAAA;;IAJf,MAAK;IACL,cAAW;IACX,OAAM;IACL,SAAK,EAAU,GAAW,CAAA,SAAA,CAAA;MAC5B,GAAO,KAAA,EAAA,IAAA,EAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA;GAGV,EAIM,OAJN,GAIM,CAHJ,EAEM,OAFN,GAEM,CADJ,EAAa,EAAA,QAAA,SAAA,CAAA,CAAA,CAAA,CAAA;GAINC,EAAAA,OAAO,UAAA,EAAA,GAAlB,EAEM,OAFN,GAEM,CADJ,EAA2B,EAAA,QAAA,QAAA,CAAA,CAAA,KAAA,EAAA,IAAA,EAAA;;;IExBpB,IAA2B,EACtC,UAAU,MAAa;CACrB,EAAI,UAAU,cAAc,CAAmB;AACjD,EACF"}
@@ -1,2 +1,2 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.DialogView={},e.Vue))})(this,function(e,t){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var n=[`closedBy`],r={key:0,class:`_4d394b1507fdc584`},i={class:`_088d860d2fd75292`},a={class:`_da3b3b2a4aeed1ee`},o={key:1,class:`_61879ba330d9a71c`},s=(0,t.defineComponent)({__name:`DialogView.obf`,props:{modelValue:{type:Boolean},showTitleBar:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0},closable:{type:Boolean,default:!0},closeOnClickMask:{type:Boolean,default:!1}},emits:[`update:modelValue`,`closed`],setup(e,{expose:s,emit:c}){let l=e,u=c,d=(0,t.ref)(),f=()=>{u(`update:modelValue`,!0)},p=()=>{u(`update:modelValue`,!1)},m=e=>{e.preventDefault(),l.closable&&p()},h=(0,t.ref)(!1),g=()=>{if(!h.value){if(!l.closable&&l.modelValue){(0,t.nextTick)(()=>{d.value&&!d.value.open&&d.value.showModal()});return}l.modelValue&&u(`update:modelValue`,!1),(0,t.nextTick)(()=>{l.modelValue&&d.value&&!d.value.open&&d.value.showModal()}),u(`closed`)}},_=(0,t.computed)(()=>l.closable?l.closeOnClickMask?`any`:`closerequest`:`none`);(0,t.watch)(()=>l.modelValue,async e=>{await(0,t.nextTick)(),e?d.value&&!d.value.open&&d.value.showModal():d.value&&d.value.open&&d.value.close()});let v=()=>{l.modelValue&&d.value&&!d.value.open&&d.value.showModal()};return(0,t.onMounted)(()=>{v()}),(0,t.onBeforeUnmount)(()=>{d.value&&d.value.open&&d.value.close()}),(0,t.onDeactivated)(()=>{d.value&&d.value.open&&(h.value=!0,d.value.close(),(0,t.nextTick)(()=>h.value=!1))}),(0,t.onActivated)(()=>{v()}),s({get:()=>d.value,open:f,close:p}),(s,c)=>((0,t.openBlock)(),(0,t.createElementBlock)(`dialog`,(0,t.mergeProps)({ref_key:`dialogRef`,ref:d,class:`_b4102a3b79656a37`},s.$attrs,{onClose:g,onCancel:m,closedBy:_.value}),[e.showTitleBar?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,r,[(0,t.createElementVNode)(`span`,i,[(0,t.renderSlot)(s.$slots,`title`)]),e.showCloseButton&&e.closable?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,"aria-label":`Close the dialog`,class:`_468ff1da37ead40a`,onClick:(0,t.withModifiers)(p,[`prevent`])},`×`)):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,a,[(0,t.renderSlot)(s.$slots,`default`)]),s.$slots.footer?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,o,[(0,t.renderSlot)(s.$slots,`footer`)])):(0,t.createCommentVNode)(``,!0)],16,n))}}),c={install:e=>{e.component(`DialogView`,s)}};e.DialogView=s,e.DialogViewPlugin=c,e.default=c});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("vue")):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.DialogView={},e.Vue))})(this,function(e,t){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var n=[`closedBy`],r={key:0,class:`_4d394b1507fdc584`},i={class:`_088d860d2fd75292`},a={class:`_0be228fb3f6dcf6a`},o={class:`_da3b3b2a4aeed1ee`},s={key:1,class:`_61879ba330d9a71c`},c=(0,t.defineComponent)({__name:`DialogView.obf`,props:{modelValue:{type:Boolean},showTitleBar:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0},closable:{type:Boolean,default:!0},closeOnClickMask:{type:Boolean,default:!1}},emits:[`update:modelValue`,`closed`],setup(e,{expose:c,emit:l}){let u=e,d=l,f=(0,t.ref)(),p=()=>{d(`update:modelValue`,!0)},m=()=>{d(`update:modelValue`,!1)},h=e=>{e.preventDefault(),u.closable&&m()},g=(0,t.ref)(!1),_=()=>{if(!g.value){if(!u.closable&&u.modelValue){(0,t.nextTick)(()=>{f.value&&!f.value.open&&f.value.showModal()});return}u.modelValue&&d(`update:modelValue`,!1),(0,t.nextTick)(()=>{u.modelValue&&f.value&&!f.value.open&&f.value.showModal()}),d(`closed`)}},v=(0,t.computed)(()=>u.closable?u.closeOnClickMask?`any`:`closerequest`:`none`);(0,t.watch)(()=>u.modelValue,async e=>{await(0,t.nextTick)(),e?f.value&&!f.value.open&&f.value.showModal():f.value&&f.value.open&&f.value.close()});let y=()=>{u.modelValue&&f.value&&!f.value.open&&f.value.showModal()};return(0,t.onMounted)(()=>{y()}),(0,t.onBeforeUnmount)(()=>{f.value&&f.value.open&&f.value.close()}),(0,t.onDeactivated)(()=>{f.value&&f.value.open&&(g.value=!0,f.value.close(),(0,t.nextTick)(()=>g.value=!1))}),(0,t.onActivated)(()=>{y()}),c({get:()=>f.value,open:p,close:m}),(c,l)=>((0,t.openBlock)(),(0,t.createElementBlock)(`dialog`,(0,t.mergeProps)({ref_key:`dialogRef`,ref:f,class:`_b4102a3b79656a37`},c.$attrs,{onClose:_,onCancel:h,closedBy:v.value}),[e.showTitleBar?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,r,[(0,t.createElementVNode)(`span`,i,[(0,t.renderSlot)(c.$slots,`title`)]),e.showCloseButton&&e.closable?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,"aria-label":`Close the dialog`,class:`_468ff1da37ead40a`,onClick:(0,t.withModifiers)(m,[`prevent`])},`×`)):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,a,[(0,t.createElementVNode)(`div`,o,[(0,t.renderSlot)(c.$slots,`default`)])]),c.$slots.footer?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,s,[(0,t.renderSlot)(c.$slots,`footer`)])):(0,t.createCommentVNode)(``,!0)],16,n))}}),l={install:e=>{e.component(`DialogView`,c)}};e.DialogView=c,e.DialogViewPlugin=l,e.default=l});
2
2
  //# sourceMappingURL=cssless-obfuscated.umd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cssless-obfuscated.umd.js","names":["$attrs","$slots"],"sources":["../src/DialogView.obf.vue","../src/DialogView.obf.vue","../src/index.ts"],"sourcesContent":["<template>\n <dialog\n ref=\"dialogRef\"\n class=\"_b4102a3b79656a37\"\n v-bind=\"$attrs\"\n @close=\"handleDialogClose\"\n @cancel=\"handleDialogCancel\"\n :closedBy=\"closedBy\"\n >\n <div v-if=\"showTitleBar\" class=\"_4d394b1507fdc584\">\n <span class=\"_088d860d2fd75292\">\n <slot name=\"title\"></slot>\n </span>\n <button\n v-if=\"showCloseButton && closable\"\n type=\"button\"\n aria-label=\"Close the dialog\"\n class=\"_468ff1da37ead40a\"\n @click.prevent=\"closeDialog\"\n >&times;</button>\n </div>\n \n <div class=\"_da3b3b2a4aeed1ee\">\n <slot></slot>\n </div>\n\n <div v-if=\"$slots.footer\" class=\"_61879ba330d9a71c\">\n <slot name=\"footer\"></slot>\n </div>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, computed, nextTick, onMounted, onBeforeUnmount, onDeactivated, onActivated } from 'vue'\n\ninterface Props {\n modelValue: boolean\n showTitleBar?: boolean\n showCloseButton?: boolean\n closable?: boolean\n closeOnClickMask?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n showTitleBar: true,\n showCloseButton: true,\n closable: true,\n closeOnClickMask: false,\n})\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n (e: 'closed'): void\n}>()\n\nconst dialogRef = ref<HTMLDialogElement>();\n\nconst openDialog = (): void => {\n emit('update:modelValue', true)\n}\n\nconst closeDialog = (): void => {\n emit('update:modelValue', false)\n}\n\nconst handleDialogCancel = (e: Event) => {\n e.preventDefault();\n if (props.closable) closeDialog();\n}\n\nconst ignoreCloseEvent = ref(false);\n\nconst handleDialogClose = (): void => {\n if (ignoreCloseEvent.value) return;\n if (!props.closable) {\n if (props.modelValue) {\n // not programmatically close\n // re-open the dialog\n nextTick(() => {\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }) // Avoid using 'cancel' event because some browsers handle it incorrectly, see https://issues.chromium.org/issues/41491338\n return;\n }\n }\n if (props.modelValue) {\n emit('update:modelValue', false)\n }\n nextTick(() => {\n if (props.modelValue) {\n // model value keep unchanged\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }\n })\n emit('closed')\n}\n\nconst closedBy = computed(() => props.closable ? (props.closeOnClickMask ? 'any' : 'closerequest') : 'none') // see https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/closedBy\n\nwatch(() => props.modelValue, async (newValue: boolean) => {\n await nextTick()\n \n if (newValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n } else {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n }\n})\n\nconst initDialog = () => {\n if (props.modelValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n }\n};\n\nonMounted(() => {\n initDialog();\n});\n\nonBeforeUnmount(() => {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n});\n\nonDeactivated(() => {\n if (dialogRef.value && dialogRef.value.open) {\n ignoreCloseEvent.value = true;\n dialogRef.value.close();\n nextTick(() => ignoreCloseEvent.value = false);\n }\n});\n\nonActivated(() => {\n initDialog();\n});\n\ndefineExpose({\n get: () => dialogRef.value,\n open: openDialog,\n close: closeDialog,\n});\n</script>\n\n<style>\n._b4102a3b79656a37 {\n padding: var(--dialog-padding, 20px);\n border-radius: 5px;\n border: 1px solid gray;\n outline: 0 !important;\n max-width: calc(100% - 2em);\n max-height: calc(100% - 2em);\n box-sizing: border-box;\n overflow: hidden;\n}\n\n._b4102a3b79656a37[open] {\n display: flex;\n flex-direction: column;\n}\n\n._b4102a3b79656a37::backdrop {\n background: rgba(0, 0, 0, 0.5);\n}\n\n._4d394b1507fdc584 {\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-bottom: 0.5em;\n min-height: var(--dialog-title-height, 24px);\n white-space: pre;\n overflow: hidden;\n user-select: none;\n}\n\n._088d860d2fd75292 {\n flex: 1;\n text-align: center;\n font-weight: bold;\n font-size: large;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n._468ff1da37ead40a {\n margin-left: 0.5em;\n text-decoration: none;\n color: #666;\n font-size: 1.5em;\n line-height: 1;\n width: 24px;\n height: 24px;\n padding: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n border: none;\n background: none;\n}\n\n._468ff1da37ead40a:hover {\n color: #333;\n background-color: #f0f0f0;\n border-radius: 3px;\n}\n\n._468ff1da37ead40a:focus-visible {\n outline: 2px solid rgb(160, 207, 255);\n outline-offset: -2px;\n}\n\n._da3b3b2a4aeed1ee {\n flex: 1;\n overflow: auto;\n display: flex;\n flex-direction: column;\n}\n\n._61879ba330d9a71c {\n margin-top: 0.5em;\n}\n</style>\n","<template>\n <dialog\n ref=\"dialogRef\"\n class=\"_b4102a3b79656a37\"\n v-bind=\"$attrs\"\n @close=\"handleDialogClose\"\n @cancel=\"handleDialogCancel\"\n :closedBy=\"closedBy\"\n >\n <div v-if=\"showTitleBar\" class=\"_4d394b1507fdc584\">\n <span class=\"_088d860d2fd75292\">\n <slot name=\"title\"></slot>\n </span>\n <button\n v-if=\"showCloseButton && closable\"\n type=\"button\"\n aria-label=\"Close the dialog\"\n class=\"_468ff1da37ead40a\"\n @click.prevent=\"closeDialog\"\n >&times;</button>\n </div>\n \n <div class=\"_da3b3b2a4aeed1ee\">\n <slot></slot>\n </div>\n\n <div v-if=\"$slots.footer\" class=\"_61879ba330d9a71c\">\n <slot name=\"footer\"></slot>\n </div>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, computed, nextTick, onMounted, onBeforeUnmount, onDeactivated, onActivated } from 'vue'\n\ninterface Props {\n modelValue: boolean\n showTitleBar?: boolean\n showCloseButton?: boolean\n closable?: boolean\n closeOnClickMask?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n showTitleBar: true,\n showCloseButton: true,\n closable: true,\n closeOnClickMask: false,\n})\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n (e: 'closed'): void\n}>()\n\nconst dialogRef = ref<HTMLDialogElement>();\n\nconst openDialog = (): void => {\n emit('update:modelValue', true)\n}\n\nconst closeDialog = (): void => {\n emit('update:modelValue', false)\n}\n\nconst handleDialogCancel = (e: Event) => {\n e.preventDefault();\n if (props.closable) closeDialog();\n}\n\nconst ignoreCloseEvent = ref(false);\n\nconst handleDialogClose = (): void => {\n if (ignoreCloseEvent.value) return;\n if (!props.closable) {\n if (props.modelValue) {\n // not programmatically close\n // re-open the dialog\n nextTick(() => {\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }) // Avoid using 'cancel' event because some browsers handle it incorrectly, see https://issues.chromium.org/issues/41491338\n return;\n }\n }\n if (props.modelValue) {\n emit('update:modelValue', false)\n }\n nextTick(() => {\n if (props.modelValue) {\n // model value keep unchanged\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }\n })\n emit('closed')\n}\n\nconst closedBy = computed(() => props.closable ? (props.closeOnClickMask ? 'any' : 'closerequest') : 'none') // see https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/closedBy\n\nwatch(() => props.modelValue, async (newValue: boolean) => {\n await nextTick()\n \n if (newValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n } else {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n }\n})\n\nconst initDialog = () => {\n if (props.modelValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n }\n};\n\nonMounted(() => {\n initDialog();\n});\n\nonBeforeUnmount(() => {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n});\n\nonDeactivated(() => {\n if (dialogRef.value && dialogRef.value.open) {\n ignoreCloseEvent.value = true;\n dialogRef.value.close();\n nextTick(() => ignoreCloseEvent.value = false);\n }\n});\n\nonActivated(() => {\n initDialog();\n});\n\ndefineExpose({\n get: () => dialogRef.value,\n open: openDialog,\n close: closeDialog,\n});\n</script>\n\n<style>\n._b4102a3b79656a37 {\n padding: var(--dialog-padding, 20px);\n border-radius: 5px;\n border: 1px solid gray;\n outline: 0 !important;\n max-width: calc(100% - 2em);\n max-height: calc(100% - 2em);\n box-sizing: border-box;\n overflow: hidden;\n}\n\n._b4102a3b79656a37[open] {\n display: flex;\n flex-direction: column;\n}\n\n._b4102a3b79656a37::backdrop {\n background: rgba(0, 0, 0, 0.5);\n}\n\n._4d394b1507fdc584 {\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-bottom: 0.5em;\n min-height: var(--dialog-title-height, 24px);\n white-space: pre;\n overflow: hidden;\n user-select: none;\n}\n\n._088d860d2fd75292 {\n flex: 1;\n text-align: center;\n font-weight: bold;\n font-size: large;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n._468ff1da37ead40a {\n margin-left: 0.5em;\n text-decoration: none;\n color: #666;\n font-size: 1.5em;\n line-height: 1;\n width: 24px;\n height: 24px;\n padding: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n border: none;\n background: none;\n}\n\n._468ff1da37ead40a:hover {\n color: #333;\n background-color: #f0f0f0;\n border-radius: 3px;\n}\n\n._468ff1da37ead40a:focus-visible {\n outline: 2px solid rgb(160, 207, 255);\n outline-offset: -2px;\n}\n\n._da3b3b2a4aeed1ee {\n flex: 1;\n overflow: auto;\n display: flex;\n flex-direction: column;\n}\n\n._61879ba330d9a71c {\n margin-top: 0.5em;\n}\n</style>\n","import { App, Plugin } from 'vue'\nimport DialogViewComponent from './DialogView.obf.vue'\n\nexport { default as DialogView } from './DialogView.obf.vue'\n\nexport const DialogViewPlugin: Plugin = {\n install: (app: App) => {\n app.component('DialogView', DialogViewComponent)\n }\n}\n\nexport default DialogViewPlugin\n"],"mappings":"oxBA2CA,IAAM,EAAQ,EAOR,EAAO,EAKP,GAAA,EAAA,EAAA,MAAoC,CAEpC,MAAyB,CAC7B,EAAK,oBAAqB,GAAI,EAG1B,MAA0B,CAC9B,EAAK,oBAAqB,GAAK,EAG3B,EAAsB,GAAa,CACvC,EAAE,gBAAgB,CACd,EAAM,UAAU,GAAa,EAG7B,GAAA,EAAA,EAAA,KAAuB,GAAM,CAE7B,MAAgC,CAChC,MAAiB,MACrB,IAAI,CAAC,EAAM,UACL,EAAM,WAAY,EAGpB,EAAA,EAAA,cAAe,CACT,EAAU,OAAS,CAAC,EAAU,MAAM,MAAM,EAAU,MAAM,WAAU,EACxE,CACF,OAGA,EAAM,YACR,EAAK,oBAAqB,GAAK,EAEjC,EAAA,EAAA,cAAe,CACT,EAAM,YAEJ,EAAU,OAAS,CAAC,EAAU,MAAM,MAAM,EAAU,MAAM,WAAU,EAE3E,CACD,EAAK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,EAC5B,IAAO,GAAA,EAAA,EAAA,oBAAA,GAAA,GAAA,CAAA,CAAA,GAAA,EAAA,EAAA,oBAAA,GAAA,GAAA,0BAKJ,MAFN,EAEM,EAAA,EAAA,EAAA,YADS,EAAA,OAAA,UAAA,CAAA,CAAA,CAGJC,EAAAA,OAAO,SAAA,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,oBAEZ,MAFN,EAEM,EAAA,EAAA,EAAA,YADuB,EAAA,OAAA,SAAA,CAAA,CAAA,GAAA,EAAA,EAAA,oBAAA,GAAA,GAAA,YEtBpB,EAA2B,CACtC,QAAU,GAAa,CACrB,EAAI,UAAU,aAAc,EAAoB,EAEnD"}
1
+ {"version":3,"file":"cssless-obfuscated.umd.js","names":["$attrs","$slots"],"sources":["../src/DialogView.obf.vue","../src/DialogView.obf.vue","../src/index.ts"],"sourcesContent":["<template>\n <dialog\n ref=\"dialogRef\"\n class=\"_b4102a3b79656a37\"\n v-bind=\"$attrs\"\n @close=\"handleDialogClose\"\n @cancel=\"handleDialogCancel\"\n :closedBy=\"closedBy\"\n >\n <div v-if=\"showTitleBar\" class=\"_4d394b1507fdc584\">\n <span class=\"_088d860d2fd75292\">\n <slot name=\"title\"></slot>\n </span>\n <button\n v-if=\"showCloseButton && closable\"\n type=\"button\"\n aria-label=\"Close the dialog\"\n class=\"_468ff1da37ead40a\"\n @click.prevent=\"closeDialog\"\n >&times;</button>\n </div>\n \n <div class=\"_0be228fb3f6dcf6a\">\n <div class=\"_da3b3b2a4aeed1ee\">\n <slot></slot>\n </div>\n </div>\n\n <div v-if=\"$slots.footer\" class=\"_61879ba330d9a71c\">\n <slot name=\"footer\"></slot>\n </div>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, computed, nextTick, onMounted, onBeforeUnmount, onDeactivated, onActivated } from 'vue'\n\ninterface Props {\n modelValue: boolean\n showTitleBar?: boolean\n showCloseButton?: boolean\n closable?: boolean\n closeOnClickMask?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n showTitleBar: true,\n showCloseButton: true,\n closable: true,\n closeOnClickMask: false,\n})\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n (e: 'closed'): void\n}>()\n\nconst dialogRef = ref<HTMLDialogElement>();\n\nconst openDialog = (): void => {\n emit('update:modelValue', true)\n}\n\nconst closeDialog = (): void => {\n emit('update:modelValue', false)\n}\n\nconst handleDialogCancel = (e: Event) => {\n e.preventDefault();\n if (props.closable) closeDialog();\n}\n\nconst ignoreCloseEvent = ref(false);\n\nconst handleDialogClose = (): void => {\n if (ignoreCloseEvent.value) return;\n if (!props.closable) {\n if (props.modelValue) {\n // not programmatically close\n // re-open the dialog\n nextTick(() => {\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }) // Avoid using 'cancel' event because some browsers handle it incorrectly, see https://issues.chromium.org/issues/41491338\n return;\n }\n }\n if (props.modelValue) {\n emit('update:modelValue', false)\n }\n nextTick(() => {\n if (props.modelValue) {\n // model value keep unchanged\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }\n })\n emit('closed')\n}\n\nconst closedBy = computed(() => props.closable ? (props.closeOnClickMask ? 'any' : 'closerequest') : 'none') // see https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/closedBy\n\nwatch(() => props.modelValue, async (newValue: boolean) => {\n await nextTick()\n \n if (newValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n } else {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n }\n})\n\nconst initDialog = () => {\n if (props.modelValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n }\n};\n\nonMounted(() => {\n initDialog();\n});\n\nonBeforeUnmount(() => {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n});\n\nonDeactivated(() => {\n if (dialogRef.value && dialogRef.value.open) {\n ignoreCloseEvent.value = true;\n dialogRef.value.close();\n nextTick(() => ignoreCloseEvent.value = false);\n }\n});\n\nonActivated(() => {\n initDialog();\n});\n\ndefineExpose({\n get: () => dialogRef.value,\n open: openDialog,\n close: closeDialog,\n});\n</script>\n\n<style>\n._b4102a3b79656a37 {\n padding: var(--dialog-padding, 20px);\n border-radius: 5px;\n border: 1px solid gray;\n outline: 0 !important;\n max-width: calc(100% - 2em);\n max-height: calc(100% - 2em);\n box-sizing: border-box;\n overflow: hidden;\n}\n\n._b4102a3b79656a37[open] {\n display: flex;\n flex-direction: column;\n}\n\n._b4102a3b79656a37::backdrop {\n background: rgba(0, 0, 0, 0.5);\n}\n\n._4d394b1507fdc584 {\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-bottom: 0.5em;\n min-height: var(--dialog-title-height, 24px);\n white-space: pre;\n overflow: hidden;\n user-select: none;\n}\n\n._088d860d2fd75292 {\n flex: 1;\n text-align: center;\n font-weight: bold;\n font-size: large;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n._468ff1da37ead40a {\n margin-left: 0.5em;\n text-decoration: none;\n color: #666;\n font-size: 1.5em;\n line-height: 1;\n width: 24px;\n height: 24px;\n padding: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n border: none;\n background: none;\n}\n\n._468ff1da37ead40a:hover {\n color: #333;\n background-color: #f0f0f0;\n border-radius: 3px;\n}\n\n._468ff1da37ead40a:focus-visible {\n outline: 2px solid rgb(160, 207, 255);\n outline-offset: -2px;\n}\n\n._0be228fb3f6dcf6a {\n flex: 1;\n overflow: auto;\n}\n\n._da3b3b2a4aeed1ee {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n}\n\n._61879ba330d9a71c {\n margin-top: 0.5em;\n}\n</style>\n","<template>\n <dialog\n ref=\"dialogRef\"\n class=\"_b4102a3b79656a37\"\n v-bind=\"$attrs\"\n @close=\"handleDialogClose\"\n @cancel=\"handleDialogCancel\"\n :closedBy=\"closedBy\"\n >\n <div v-if=\"showTitleBar\" class=\"_4d394b1507fdc584\">\n <span class=\"_088d860d2fd75292\">\n <slot name=\"title\"></slot>\n </span>\n <button\n v-if=\"showCloseButton && closable\"\n type=\"button\"\n aria-label=\"Close the dialog\"\n class=\"_468ff1da37ead40a\"\n @click.prevent=\"closeDialog\"\n >&times;</button>\n </div>\n \n <div class=\"_0be228fb3f6dcf6a\">\n <div class=\"_da3b3b2a4aeed1ee\">\n <slot></slot>\n </div>\n </div>\n\n <div v-if=\"$slots.footer\" class=\"_61879ba330d9a71c\">\n <slot name=\"footer\"></slot>\n </div>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, computed, nextTick, onMounted, onBeforeUnmount, onDeactivated, onActivated } from 'vue'\n\ninterface Props {\n modelValue: boolean\n showTitleBar?: boolean\n showCloseButton?: boolean\n closable?: boolean\n closeOnClickMask?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n showTitleBar: true,\n showCloseButton: true,\n closable: true,\n closeOnClickMask: false,\n})\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n (e: 'closed'): void\n}>()\n\nconst dialogRef = ref<HTMLDialogElement>();\n\nconst openDialog = (): void => {\n emit('update:modelValue', true)\n}\n\nconst closeDialog = (): void => {\n emit('update:modelValue', false)\n}\n\nconst handleDialogCancel = (e: Event) => {\n e.preventDefault();\n if (props.closable) closeDialog();\n}\n\nconst ignoreCloseEvent = ref(false);\n\nconst handleDialogClose = (): void => {\n if (ignoreCloseEvent.value) return;\n if (!props.closable) {\n if (props.modelValue) {\n // not programmatically close\n // re-open the dialog\n nextTick(() => {\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }) // Avoid using 'cancel' event because some browsers handle it incorrectly, see https://issues.chromium.org/issues/41491338\n return;\n }\n }\n if (props.modelValue) {\n emit('update:modelValue', false)\n }\n nextTick(() => {\n if (props.modelValue) {\n // model value keep unchanged\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }\n })\n emit('closed')\n}\n\nconst closedBy = computed(() => props.closable ? (props.closeOnClickMask ? 'any' : 'closerequest') : 'none') // see https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/closedBy\n\nwatch(() => props.modelValue, async (newValue: boolean) => {\n await nextTick()\n \n if (newValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n } else {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n }\n})\n\nconst initDialog = () => {\n if (props.modelValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n }\n};\n\nonMounted(() => {\n initDialog();\n});\n\nonBeforeUnmount(() => {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n});\n\nonDeactivated(() => {\n if (dialogRef.value && dialogRef.value.open) {\n ignoreCloseEvent.value = true;\n dialogRef.value.close();\n nextTick(() => ignoreCloseEvent.value = false);\n }\n});\n\nonActivated(() => {\n initDialog();\n});\n\ndefineExpose({\n get: () => dialogRef.value,\n open: openDialog,\n close: closeDialog,\n});\n</script>\n\n<style>\n._b4102a3b79656a37 {\n padding: var(--dialog-padding, 20px);\n border-radius: 5px;\n border: 1px solid gray;\n outline: 0 !important;\n max-width: calc(100% - 2em);\n max-height: calc(100% - 2em);\n box-sizing: border-box;\n overflow: hidden;\n}\n\n._b4102a3b79656a37[open] {\n display: flex;\n flex-direction: column;\n}\n\n._b4102a3b79656a37::backdrop {\n background: rgba(0, 0, 0, 0.5);\n}\n\n._4d394b1507fdc584 {\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-bottom: 0.5em;\n min-height: var(--dialog-title-height, 24px);\n white-space: pre;\n overflow: hidden;\n user-select: none;\n}\n\n._088d860d2fd75292 {\n flex: 1;\n text-align: center;\n font-weight: bold;\n font-size: large;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n._468ff1da37ead40a {\n margin-left: 0.5em;\n text-decoration: none;\n color: #666;\n font-size: 1.5em;\n line-height: 1;\n width: 24px;\n height: 24px;\n padding: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n border: none;\n background: none;\n}\n\n._468ff1da37ead40a:hover {\n color: #333;\n background-color: #f0f0f0;\n border-radius: 3px;\n}\n\n._468ff1da37ead40a:focus-visible {\n outline: 2px solid rgb(160, 207, 255);\n outline-offset: -2px;\n}\n\n._0be228fb3f6dcf6a {\n flex: 1;\n overflow: auto;\n}\n\n._da3b3b2a4aeed1ee {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n}\n\n._61879ba330d9a71c {\n margin-top: 0.5em;\n}\n</style>\n","import { App, Plugin } from 'vue'\nimport DialogViewComponent from './DialogView.obf.vue'\n\nexport { default as DialogView } from './DialogView.obf.vue'\n\nexport const DialogViewPlugin: Plugin = {\n install: (app: App) => {\n app.component('DialogView', DialogViewComponent)\n }\n}\n\nexport default DialogViewPlugin\n"],"mappings":"kzBA6CA,IAAM,EAAQ,EAOR,EAAO,EAKP,GAAA,EAAA,EAAA,KAAmC,EAEnC,MAAyB,CAC7B,EAAK,oBAAqB,EAAI,CAChC,EAEM,MAA0B,CAC9B,EAAK,oBAAqB,EAAK,CACjC,EAEM,EAAsB,GAAa,CACvC,EAAE,eAAe,EACb,EAAM,UAAU,EAAY,CAClC,EAEM,GAAA,EAAA,EAAA,KAAuB,EAAK,EAE5B,MAAgC,CAChC,MAAiB,MACrB,IAAI,CAAC,EAAM,UACL,EAAM,WAAY,EAGpB,EAAA,EAAA,cAAe,CACT,EAAU,OAAS,CAAC,EAAU,MAAM,MAAM,EAAU,MAAM,UAAU,CAC1E,CAAC,EACD,MACF,CAEE,EAAM,YACR,EAAK,oBAAqB,EAAK,GAEjC,EAAA,EAAA,cAAe,CACT,EAAM,YAEJ,EAAU,OAAS,CAAC,EAAU,MAAM,MAAM,EAAU,MAAM,UAAU,CAE5E,CAAC,EACD,EAAK,QAAQ,EACf,EAEM,GAAA,EAAA,EAAA,cAA0B,EAAM,SAAY,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AAA,EAAA,oBAAA,GAAA,EAAA,CAAA,CAAA,IAAA,EAAA,EAAA,oBAAA,GAAA,EAAA,2BAOJ,MAJN,EAIM,EAAA,EAAA,EAAA,oBADE,MAFN,EAEM,EAAA,EAAA,EAAA,YADS,EAAA,OAAA,SAAA,CAAA,CAAA,CAAA,CAAA,EAINC,EAAAA,OAAO,SAAA,EAAA,EAAA,WAAA,GAAA,EAAA,EAAA,oBAEZ,MAFN,EAEM,EAAA,EAAA,EAAA,YADuB,EAAA,OAAA,QAAA,CAAA,CAAA,IAAA,EAAA,EAAA,oBAAA,GAAA,EAAA,aExBpB,EAA2B,CACtC,QAAU,GAAa,CACrB,EAAI,UAAU,aAAc,CAAmB,CACjD,CACF"}
@@ -3,10 +3,10 @@ import { computed as e, createCommentVNode as t, createElementBlock as n, create
3
3
  var g = ["closedBy"], _ = {
4
4
  key: 0,
5
5
  class: "dialog-title-bar"
6
- }, v = { class: "dialog-title" }, y = { class: "dialog-content" }, b = {
6
+ }, v = { class: "dialog-title" }, y = { class: "dialog-content-wrapper" }, b = { class: "dialog-content" }, x = {
7
7
  key: 1,
8
8
  class: "dialog-footer"
9
- }, x = /* @__PURE__ */ ((e, t) => {
9
+ }, S = /* @__PURE__ */ ((e, t) => {
10
10
  let n = e.__vccOpts || e;
11
11
  for (let [e, r] of t) n[e] = r;
12
12
  return n;
@@ -32,68 +32,68 @@ var g = ["closedBy"], _ = {
32
32
  }
33
33
  },
34
34
  emits: ["update:modelValue", "closed"],
35
- setup(i, { expose: x, emit: S }) {
36
- let C = i, w = S, T = f(), E = () => {
37
- w("update:modelValue", !0);
38
- }, D = () => {
39
- w("update:modelValue", !1);
40
- }, O = (e) => {
41
- e.preventDefault(), C.closable && D();
42
- }, k = f(!1), A = () => {
43
- if (!k.value) {
44
- if (!C.closable && C.modelValue) {
35
+ setup(i, { expose: S, emit: C }) {
36
+ let w = i, T = C, E = f(), D = () => {
37
+ T("update:modelValue", !0);
38
+ }, O = () => {
39
+ T("update:modelValue", !1);
40
+ }, k = (e) => {
41
+ e.preventDefault(), w.closable && O();
42
+ }, A = f(!1), j = () => {
43
+ if (!A.value) {
44
+ if (!w.closable && w.modelValue) {
45
45
  o(() => {
46
- T.value && !T.value.open && T.value.showModal();
46
+ E.value && !E.value.open && E.value.showModal();
47
47
  });
48
48
  return;
49
49
  }
50
- C.modelValue && w("update:modelValue", !1), o(() => {
51
- C.modelValue && T.value && !T.value.open && T.value.showModal();
52
- }), w("closed");
50
+ w.modelValue && T("update:modelValue", !1), o(() => {
51
+ w.modelValue && E.value && !E.value.open && E.value.showModal();
52
+ }), T("closed");
53
53
  }
54
- }, j = e(() => C.closable ? C.closeOnClickMask ? "any" : "closerequest" : "none");
55
- m(() => C.modelValue, async (e) => {
56
- await o(), e ? T.value && !T.value.open && T.value.showModal() : T.value && T.value.open && T.value.close();
54
+ }, M = e(() => w.closable ? w.closeOnClickMask ? "any" : "closerequest" : "none");
55
+ m(() => w.modelValue, async (e) => {
56
+ await o(), e ? E.value && !E.value.open && E.value.showModal() : E.value && E.value.open && E.value.close();
57
57
  });
58
- let M = () => {
59
- C.modelValue && T.value && !T.value.open && T.value.showModal();
58
+ let N = () => {
59
+ w.modelValue && E.value && !E.value.open && E.value.showModal();
60
60
  };
61
61
  return u(() => {
62
- M();
62
+ N();
63
63
  }), c(() => {
64
- T.value && T.value.open && T.value.close();
64
+ E.value && E.value.open && E.value.close();
65
65
  }), l(() => {
66
- T.value && T.value.open && (k.value = !0, T.value.close(), o(() => k.value = !1));
66
+ E.value && E.value.open && (A.value = !0, E.value.close(), o(() => A.value = !1));
67
67
  }), s(() => {
68
- M();
69
- }), x({
70
- get: () => T.value,
71
- open: E,
72
- close: D
68
+ N();
69
+ }), S({
70
+ get: () => E.value,
71
+ open: D,
72
+ close: O
73
73
  }), (e, o) => (d(), n("dialog", a({
74
74
  ref_key: "dialogRef",
75
- ref: T,
75
+ ref: E,
76
76
  class: "dialog-view"
77
77
  }, e.$attrs, {
78
- onClose: A,
79
- onCancel: O,
80
- closedBy: j.value
78
+ onClose: j,
79
+ onCancel: k,
80
+ closedBy: M.value
81
81
  }), [
82
82
  i.showTitleBar ? (d(), n("div", _, [r("span", v, [p(e.$slots, "title", {}, void 0, !0)]), i.showCloseButton && i.closable ? (d(), n("button", {
83
83
  key: 0,
84
84
  type: "button",
85
85
  "aria-label": "Close the dialog",
86
86
  class: "dialog-close-button",
87
- onClick: h(D, ["prevent"])
87
+ onClick: h(O, ["prevent"])
88
88
  }, "×")) : t("", !0)])) : t("", !0),
89
- r("div", y, [p(e.$slots, "default", {}, void 0, !0)]),
90
- e.$slots.footer ? (d(), n("div", b, [p(e.$slots, "footer", {}, void 0, !0)])) : t("", !0)
89
+ r("div", y, [r("div", b, [p(e.$slots, "default", {}, void 0, !0)])]),
90
+ e.$slots.footer ? (d(), n("div", x, [p(e.$slots, "footer", {}, void 0, !0)])) : t("", !0)
91
91
  ], 16, g));
92
92
  }
93
- }), [["__scopeId", "data-v-7641dcfa"]]), S = { install: (e) => {
94
- e.component("DialogView", x);
93
+ }), [["__scopeId", "data-v-8eb40789"]]), C = { install: (e) => {
94
+ e.component("DialogView", S);
95
95
  } };
96
96
  //#endregion
97
- export { x as DialogView, S as DialogViewPlugin, S as default };
97
+ export { S as DialogView, C as DialogViewPlugin, C as default };
98
98
 
99
99
  //# sourceMappingURL=cssless.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cssless.es.js","names":["$attrs","$slots"],"sources":["../src/DialogView.vue","../src/DialogView.vue","../src/unobfuscated.ts"],"sourcesContent":["<template>\n <dialog\n ref=\"dialogRef\"\n class=\"dialog-view\"\n v-bind=\"$attrs\"\n @close=\"handleDialogClose\"\n @cancel=\"handleDialogCancel\"\n :closedBy=\"closedBy\"\n >\n <div v-if=\"showTitleBar\" class=\"dialog-title-bar\">\n <span class=\"dialog-title\">\n <slot name=\"title\"></slot>\n </span>\n <button\n v-if=\"showCloseButton && closable\"\n type=\"button\"\n aria-label=\"Close the dialog\"\n class=\"dialog-close-button\"\n @click.prevent=\"closeDialog\"\n >&times;</button>\n </div>\n \n <div class=\"dialog-content\">\n <slot></slot>\n </div>\n\n <div v-if=\"$slots.footer\" class=\"dialog-footer\">\n <slot name=\"footer\"></slot>\n </div>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, computed, nextTick, onMounted, onBeforeUnmount, onDeactivated, onActivated } from 'vue'\n\ninterface Props {\n modelValue: boolean\n showTitleBar?: boolean\n showCloseButton?: boolean\n closable?: boolean\n closeOnClickMask?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n showTitleBar: true,\n showCloseButton: true,\n closable: true,\n closeOnClickMask: false,\n})\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n (e: 'closed'): void\n}>()\n\nconst dialogRef = ref<HTMLDialogElement>();\n\nconst openDialog = (): void => {\n emit('update:modelValue', true)\n}\n\nconst closeDialog = (): void => {\n emit('update:modelValue', false)\n}\n\nconst handleDialogCancel = (e: Event) => {\n e.preventDefault();\n if (props.closable) closeDialog();\n}\n\nconst ignoreCloseEvent = ref(false);\n\nconst handleDialogClose = (): void => {\n if (ignoreCloseEvent.value) return;\n if (!props.closable) {\n if (props.modelValue) {\n // not programmatically close\n // re-open the dialog\n nextTick(() => {\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }) // Avoid using 'cancel' event because some browsers handle it incorrectly, see https://issues.chromium.org/issues/41491338\n return;\n }\n }\n if (props.modelValue) {\n emit('update:modelValue', false)\n }\n nextTick(() => {\n if (props.modelValue) {\n // model value keep unchanged\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }\n })\n emit('closed')\n}\n\nconst closedBy = computed(() => props.closable ? (props.closeOnClickMask ? 'any' : 'closerequest') : 'none') // see https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/closedBy\n\nwatch(() => props.modelValue, async (newValue: boolean) => {\n await nextTick()\n \n if (newValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n } else {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n }\n})\n\nconst initDialog = () => {\n if (props.modelValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n }\n};\n\nonMounted(() => {\n initDialog();\n});\n\nonBeforeUnmount(() => {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n});\n\nonDeactivated(() => {\n if (dialogRef.value && dialogRef.value.open) {\n ignoreCloseEvent.value = true;\n dialogRef.value.close();\n nextTick(() => ignoreCloseEvent.value = false);\n }\n});\n\nonActivated(() => {\n initDialog();\n});\n\ndefineExpose({\n get: () => dialogRef.value,\n open: openDialog,\n close: closeDialog,\n});\n</script>\n\n<style scoped>\n.dialog-view {\n padding: var(--dialog-padding, 20px);\n border-radius: 5px;\n border: 1px solid gray;\n outline: 0 !important;\n max-width: calc(100% - 2em);\n max-height: calc(100% - 2em);\n box-sizing: border-box;\n overflow: hidden;\n}\n\n.dialog-view[open] {\n display: flex;\n flex-direction: column;\n}\n\n.dialog-view::backdrop {\n background: rgba(0, 0, 0, 0.5);\n}\n\n.dialog-title-bar {\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-bottom: 0.5em;\n min-height: var(--dialog-title-height, 24px);\n white-space: pre;\n overflow: hidden;\n user-select: none;\n}\n\n.dialog-title {\n flex: 1;\n text-align: center;\n font-weight: bold;\n font-size: large;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.dialog-close-button {\n margin-left: 0.5em;\n text-decoration: none;\n color: #666;\n font-size: 1.5em;\n line-height: 1;\n width: 24px;\n height: 24px;\n padding: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n border: none;\n background: none;\n}\n\n.dialog-close-button:hover {\n color: #333;\n background-color: #f0f0f0;\n border-radius: 3px;\n}\n\n.dialog-close-button:focus-visible {\n outline: 2px solid rgb(160, 207, 255);\n outline-offset: -2px;\n}\n\n.dialog-content {\n flex: 1;\n overflow: auto;\n display: flex;\n flex-direction: column;\n}\n\n.dialog-footer {\n margin-top: 0.5em;\n}\n</style>\n","<template>\n <dialog\n ref=\"dialogRef\"\n class=\"dialog-view\"\n v-bind=\"$attrs\"\n @close=\"handleDialogClose\"\n @cancel=\"handleDialogCancel\"\n :closedBy=\"closedBy\"\n >\n <div v-if=\"showTitleBar\" class=\"dialog-title-bar\">\n <span class=\"dialog-title\">\n <slot name=\"title\"></slot>\n </span>\n <button\n v-if=\"showCloseButton && closable\"\n type=\"button\"\n aria-label=\"Close the dialog\"\n class=\"dialog-close-button\"\n @click.prevent=\"closeDialog\"\n >&times;</button>\n </div>\n \n <div class=\"dialog-content\">\n <slot></slot>\n </div>\n\n <div v-if=\"$slots.footer\" class=\"dialog-footer\">\n <slot name=\"footer\"></slot>\n </div>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, computed, nextTick, onMounted, onBeforeUnmount, onDeactivated, onActivated } from 'vue'\n\ninterface Props {\n modelValue: boolean\n showTitleBar?: boolean\n showCloseButton?: boolean\n closable?: boolean\n closeOnClickMask?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n showTitleBar: true,\n showCloseButton: true,\n closable: true,\n closeOnClickMask: false,\n})\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n (e: 'closed'): void\n}>()\n\nconst dialogRef = ref<HTMLDialogElement>();\n\nconst openDialog = (): void => {\n emit('update:modelValue', true)\n}\n\nconst closeDialog = (): void => {\n emit('update:modelValue', false)\n}\n\nconst handleDialogCancel = (e: Event) => {\n e.preventDefault();\n if (props.closable) closeDialog();\n}\n\nconst ignoreCloseEvent = ref(false);\n\nconst handleDialogClose = (): void => {\n if (ignoreCloseEvent.value) return;\n if (!props.closable) {\n if (props.modelValue) {\n // not programmatically close\n // re-open the dialog\n nextTick(() => {\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }) // Avoid using 'cancel' event because some browsers handle it incorrectly, see https://issues.chromium.org/issues/41491338\n return;\n }\n }\n if (props.modelValue) {\n emit('update:modelValue', false)\n }\n nextTick(() => {\n if (props.modelValue) {\n // model value keep unchanged\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }\n })\n emit('closed')\n}\n\nconst closedBy = computed(() => props.closable ? (props.closeOnClickMask ? 'any' : 'closerequest') : 'none') // see https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/closedBy\n\nwatch(() => props.modelValue, async (newValue: boolean) => {\n await nextTick()\n \n if (newValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n } else {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n }\n})\n\nconst initDialog = () => {\n if (props.modelValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n }\n};\n\nonMounted(() => {\n initDialog();\n});\n\nonBeforeUnmount(() => {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n});\n\nonDeactivated(() => {\n if (dialogRef.value && dialogRef.value.open) {\n ignoreCloseEvent.value = true;\n dialogRef.value.close();\n nextTick(() => ignoreCloseEvent.value = false);\n }\n});\n\nonActivated(() => {\n initDialog();\n});\n\ndefineExpose({\n get: () => dialogRef.value,\n open: openDialog,\n close: closeDialog,\n});\n</script>\n\n<style scoped>\n.dialog-view {\n padding: var(--dialog-padding, 20px);\n border-radius: 5px;\n border: 1px solid gray;\n outline: 0 !important;\n max-width: calc(100% - 2em);\n max-height: calc(100% - 2em);\n box-sizing: border-box;\n overflow: hidden;\n}\n\n.dialog-view[open] {\n display: flex;\n flex-direction: column;\n}\n\n.dialog-view::backdrop {\n background: rgba(0, 0, 0, 0.5);\n}\n\n.dialog-title-bar {\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-bottom: 0.5em;\n min-height: var(--dialog-title-height, 24px);\n white-space: pre;\n overflow: hidden;\n user-select: none;\n}\n\n.dialog-title {\n flex: 1;\n text-align: center;\n font-weight: bold;\n font-size: large;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.dialog-close-button {\n margin-left: 0.5em;\n text-decoration: none;\n color: #666;\n font-size: 1.5em;\n line-height: 1;\n width: 24px;\n height: 24px;\n padding: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n border: none;\n background: none;\n}\n\n.dialog-close-button:hover {\n color: #333;\n background-color: #f0f0f0;\n border-radius: 3px;\n}\n\n.dialog-close-button:focus-visible {\n outline: 2px solid rgb(160, 207, 255);\n outline-offset: -2px;\n}\n\n.dialog-content {\n flex: 1;\n overflow: auto;\n display: flex;\n flex-direction: column;\n}\n\n.dialog-footer {\n margin-top: 0.5em;\n}\n</style>\n","import { App, Plugin } from 'vue'\nimport DialogViewComponent from './DialogView.vue'\n\nexport { default as DialogView } from './DialogView.vue'\n\nexport const DialogViewPlugin: Plugin = {\n install: (app: App) => {\n app.component('DialogView', DialogViewComponent)\n }\n}\n\nexport default DialogViewPlugin\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CA,IAAM,IAAQ,GAOR,IAAO,GAKP,IAAY,GAAwB,EAEpC,UAAyB;GAC7B,EAAK,qBAAqB,GAAI;KAG1B,UAA0B;GAC9B,EAAK,qBAAqB,GAAK;KAG3B,KAAsB,MAAa;GAEvC,AADA,EAAE,gBAAgB,EACd,EAAM,YAAU,GAAa;KAG7B,IAAmB,EAAI,GAAM,EAE7B,UAAgC;GAChC,OAAiB,OACrB;QAAI,CAAC,EAAM,YACL,EAAM,YAAY;KAGpB,QAAe;MACb,AAAI,EAAU,SAAS,CAAC,EAAU,MAAM,QAAM,EAAU,MAAM,WAAU;OACxE;KACF;;IAYJ,AATI,EAAM,cACR,EAAK,qBAAqB,GAAK,EAEjC,QAAe;KACb,AAAI,EAAM,cAEJ,EAAU,SAAS,CAAC,EAAU,MAAM,QAAM,EAAU,MAAM,WAAU;MAE3E,EACD,E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,WAAA,EAAA,EAAA,KAAA,GAAA,GAAA,CAAA,CAAA;GAGJC,EAAAA,OAAO,UAAA,GAAA,EAAlB,EAEM,OAFN,GAEM,CADJ,EAA2B,EAAA,QAAA,UAAA,EAAA,EAAA,KAAA,GAAA,GAAA,CAAA,CAAA,IAAA,EAAA,IAAA,GAAA;;;yCEtBpB,IAA2B,EACtC,UAAU,MAAa;CACrB,EAAI,UAAU,cAAc,EAAoB;GAEnD"}
1
+ {"version":3,"file":"cssless.es.js","names":["$attrs","$slots"],"sources":["../src/DialogView.vue","../src/DialogView.vue","../src/unobfuscated.ts"],"sourcesContent":["<template>\n <dialog\n ref=\"dialogRef\"\n class=\"dialog-view\"\n v-bind=\"$attrs\"\n @close=\"handleDialogClose\"\n @cancel=\"handleDialogCancel\"\n :closedBy=\"closedBy\"\n >\n <div v-if=\"showTitleBar\" class=\"dialog-title-bar\">\n <span class=\"dialog-title\">\n <slot name=\"title\"></slot>\n </span>\n <button\n v-if=\"showCloseButton && closable\"\n type=\"button\"\n aria-label=\"Close the dialog\"\n class=\"dialog-close-button\"\n @click.prevent=\"closeDialog\"\n >&times;</button>\n </div>\n \n <div class=\"dialog-content-wrapper\">\n <div class=\"dialog-content\">\n <slot></slot>\n </div>\n </div>\n\n <div v-if=\"$slots.footer\" class=\"dialog-footer\">\n <slot name=\"footer\"></slot>\n </div>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, computed, nextTick, onMounted, onBeforeUnmount, onDeactivated, onActivated } from 'vue'\n\ninterface Props {\n modelValue: boolean\n showTitleBar?: boolean\n showCloseButton?: boolean\n closable?: boolean\n closeOnClickMask?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n showTitleBar: true,\n showCloseButton: true,\n closable: true,\n closeOnClickMask: false,\n})\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n (e: 'closed'): void\n}>()\n\nconst dialogRef = ref<HTMLDialogElement>();\n\nconst openDialog = (): void => {\n emit('update:modelValue', true)\n}\n\nconst closeDialog = (): void => {\n emit('update:modelValue', false)\n}\n\nconst handleDialogCancel = (e: Event) => {\n e.preventDefault();\n if (props.closable) closeDialog();\n}\n\nconst ignoreCloseEvent = ref(false);\n\nconst handleDialogClose = (): void => {\n if (ignoreCloseEvent.value) return;\n if (!props.closable) {\n if (props.modelValue) {\n // not programmatically close\n // re-open the dialog\n nextTick(() => {\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }) // Avoid using 'cancel' event because some browsers handle it incorrectly, see https://issues.chromium.org/issues/41491338\n return;\n }\n }\n if (props.modelValue) {\n emit('update:modelValue', false)\n }\n nextTick(() => {\n if (props.modelValue) {\n // model value keep unchanged\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }\n })\n emit('closed')\n}\n\nconst closedBy = computed(() => props.closable ? (props.closeOnClickMask ? 'any' : 'closerequest') : 'none') // see https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/closedBy\n\nwatch(() => props.modelValue, async (newValue: boolean) => {\n await nextTick()\n \n if (newValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n } else {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n }\n})\n\nconst initDialog = () => {\n if (props.modelValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n }\n};\n\nonMounted(() => {\n initDialog();\n});\n\nonBeforeUnmount(() => {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n});\n\nonDeactivated(() => {\n if (dialogRef.value && dialogRef.value.open) {\n ignoreCloseEvent.value = true;\n dialogRef.value.close();\n nextTick(() => ignoreCloseEvent.value = false);\n }\n});\n\nonActivated(() => {\n initDialog();\n});\n\ndefineExpose({\n get: () => dialogRef.value,\n open: openDialog,\n close: closeDialog,\n});\n</script>\n\n<style scoped>\n.dialog-view {\n padding: var(--dialog-padding, 20px);\n border-radius: 5px;\n border: 1px solid gray;\n outline: 0 !important;\n max-width: calc(100% - 2em);\n max-height: calc(100% - 2em);\n box-sizing: border-box;\n overflow: hidden;\n}\n\n.dialog-view[open] {\n display: flex;\n flex-direction: column;\n}\n\n.dialog-view::backdrop {\n background: rgba(0, 0, 0, 0.5);\n}\n\n.dialog-title-bar {\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-bottom: 0.5em;\n min-height: var(--dialog-title-height, 24px);\n white-space: pre;\n overflow: hidden;\n user-select: none;\n}\n\n.dialog-title {\n flex: 1;\n text-align: center;\n font-weight: bold;\n font-size: large;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.dialog-close-button {\n margin-left: 0.5em;\n text-decoration: none;\n color: #666;\n font-size: 1.5em;\n line-height: 1;\n width: 24px;\n height: 24px;\n padding: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n border: none;\n background: none;\n}\n\n.dialog-close-button:hover {\n color: #333;\n background-color: #f0f0f0;\n border-radius: 3px;\n}\n\n.dialog-close-button:focus-visible {\n outline: 2px solid rgb(160, 207, 255);\n outline-offset: -2px;\n}\n\n.dialog-content-wrapper {\n flex: 1;\n overflow: auto;\n}\n\n.dialog-content {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n}\n\n.dialog-footer {\n margin-top: 0.5em;\n}\n</style>\n","<template>\n <dialog\n ref=\"dialogRef\"\n class=\"dialog-view\"\n v-bind=\"$attrs\"\n @close=\"handleDialogClose\"\n @cancel=\"handleDialogCancel\"\n :closedBy=\"closedBy\"\n >\n <div v-if=\"showTitleBar\" class=\"dialog-title-bar\">\n <span class=\"dialog-title\">\n <slot name=\"title\"></slot>\n </span>\n <button\n v-if=\"showCloseButton && closable\"\n type=\"button\"\n aria-label=\"Close the dialog\"\n class=\"dialog-close-button\"\n @click.prevent=\"closeDialog\"\n >&times;</button>\n </div>\n \n <div class=\"dialog-content-wrapper\">\n <div class=\"dialog-content\">\n <slot></slot>\n </div>\n </div>\n\n <div v-if=\"$slots.footer\" class=\"dialog-footer\">\n <slot name=\"footer\"></slot>\n </div>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, computed, nextTick, onMounted, onBeforeUnmount, onDeactivated, onActivated } from 'vue'\n\ninterface Props {\n modelValue: boolean\n showTitleBar?: boolean\n showCloseButton?: boolean\n closable?: boolean\n closeOnClickMask?: boolean\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n showTitleBar: true,\n showCloseButton: true,\n closable: true,\n closeOnClickMask: false,\n})\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: boolean): void\n (e: 'closed'): void\n}>()\n\nconst dialogRef = ref<HTMLDialogElement>();\n\nconst openDialog = (): void => {\n emit('update:modelValue', true)\n}\n\nconst closeDialog = (): void => {\n emit('update:modelValue', false)\n}\n\nconst handleDialogCancel = (e: Event) => {\n e.preventDefault();\n if (props.closable) closeDialog();\n}\n\nconst ignoreCloseEvent = ref(false);\n\nconst handleDialogClose = (): void => {\n if (ignoreCloseEvent.value) return;\n if (!props.closable) {\n if (props.modelValue) {\n // not programmatically close\n // re-open the dialog\n nextTick(() => {\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }) // Avoid using 'cancel' event because some browsers handle it incorrectly, see https://issues.chromium.org/issues/41491338\n return;\n }\n }\n if (props.modelValue) {\n emit('update:modelValue', false)\n }\n nextTick(() => {\n if (props.modelValue) {\n // model value keep unchanged\n if (dialogRef.value && !dialogRef.value.open) dialogRef.value.showModal()\n }\n })\n emit('closed')\n}\n\nconst closedBy = computed(() => props.closable ? (props.closeOnClickMask ? 'any' : 'closerequest') : 'none') // see https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/closedBy\n\nwatch(() => props.modelValue, async (newValue: boolean) => {\n await nextTick()\n \n if (newValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n } else {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n }\n})\n\nconst initDialog = () => {\n if (props.modelValue) {\n if (dialogRef.value && !dialogRef.value.open) {\n dialogRef.value.showModal()\n }\n }\n};\n\nonMounted(() => {\n initDialog();\n});\n\nonBeforeUnmount(() => {\n if (dialogRef.value && dialogRef.value.open) {\n dialogRef.value.close()\n }\n});\n\nonDeactivated(() => {\n if (dialogRef.value && dialogRef.value.open) {\n ignoreCloseEvent.value = true;\n dialogRef.value.close();\n nextTick(() => ignoreCloseEvent.value = false);\n }\n});\n\nonActivated(() => {\n initDialog();\n});\n\ndefineExpose({\n get: () => dialogRef.value,\n open: openDialog,\n close: closeDialog,\n});\n</script>\n\n<style scoped>\n.dialog-view {\n padding: var(--dialog-padding, 20px);\n border-radius: 5px;\n border: 1px solid gray;\n outline: 0 !important;\n max-width: calc(100% - 2em);\n max-height: calc(100% - 2em);\n box-sizing: border-box;\n overflow: hidden;\n}\n\n.dialog-view[open] {\n display: flex;\n flex-direction: column;\n}\n\n.dialog-view::backdrop {\n background: rgba(0, 0, 0, 0.5);\n}\n\n.dialog-title-bar {\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-bottom: 0.5em;\n min-height: var(--dialog-title-height, 24px);\n white-space: pre;\n overflow: hidden;\n user-select: none;\n}\n\n.dialog-title {\n flex: 1;\n text-align: center;\n font-weight: bold;\n font-size: large;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.dialog-close-button {\n margin-left: 0.5em;\n text-decoration: none;\n color: #666;\n font-size: 1.5em;\n line-height: 1;\n width: 24px;\n height: 24px;\n padding: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n border: none;\n background: none;\n}\n\n.dialog-close-button:hover {\n color: #333;\n background-color: #f0f0f0;\n border-radius: 3px;\n}\n\n.dialog-close-button:focus-visible {\n outline: 2px solid rgb(160, 207, 255);\n outline-offset: -2px;\n}\n\n.dialog-content-wrapper {\n flex: 1;\n overflow: auto;\n}\n\n.dialog-content {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n}\n\n.dialog-footer {\n margin-top: 0.5em;\n}\n</style>\n","import { App, Plugin } from 'vue'\nimport DialogViewComponent from './DialogView.vue'\n\nexport { default as DialogView } from './DialogView.vue'\n\nexport const DialogViewPlugin: Plugin = {\n install: (app: App) => {\n app.component('DialogView', DialogViewComponent)\n }\n}\n\nexport default DialogViewPlugin\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6CA,IAAM,IAAQ,GAOR,IAAO,GAKP,IAAY,EAAuB,GAEnC,UAAyB;GAC7B,EAAK,qBAAqB,EAAI;EAChC,GAEM,UAA0B;GAC9B,EAAK,qBAAqB,EAAK;EACjC,GAEM,KAAsB,MAAa;GAEvC,AADA,EAAE,eAAe,GACb,EAAM,YAAU,EAAY;EAClC,GAEM,IAAmB,EAAI,EAAK,GAE5B,UAAgC;GAChC,OAAiB,OACrB;QAAI,CAAC,EAAM,YACL,EAAM,YAAY;KAGpB,QAAe;MACb,AAAI,EAAU,SAAS,CAAC,EAAU,MAAM,QAAM,EAAU,MAAM,UAAU;KAC1E,CAAC;KACD;IACF;IAWF,AATI,EAAM,cACR,EAAK,qBAAqB,EAAK,GAEjC,QAAe;KACb,AAAI,EAAM,cAEJ,EAAU,SAAS,CAAC,EAAU,MAAM,QAAM,EAAU,MAAM,UAAU;IAE5E,CAAC,GACD,EAAK,QAAQ;;EACf,GAEM,IAAW,QAAe,EAAM,WAAY,EAAM,mBAAmB,QAAQ,iBAAkB,MAAM;EAE3G,QAAY,EAAM,YAAY,OAAO,MAAsB;GAGzD,AAFA,MAAM,EAAS,GAEX,IACE,EAAU,SAAS,CAAC,EAAU,MAAM,QACtC,EAAU,MAAM,UAAU,IAGxB,EAAU,SAAS,EAAU,MAAM,QACrC,EAAU,MAAM,MAAM;EAG5B,CAAC;EAED,IAAM,UAAmB;GACvB,AAAI,EAAM,cACJ,EAAU,SAAS,CAAC,EAAU,MAAM,QACtC,EAAU,MAAM,UAAU;EAGhC;SAEA,QAAgB;GACd,E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<`u`?t(exports,require(`vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.DialogView={},e.Vue))})(this,function(e,t){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var n=[`closedBy`],r={key:0,class:`dialog-title-bar`},i={class:`dialog-title`},a={class:`dialog-content`},o={key:1,class:`dialog-footer`},s=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})((0,t.defineComponent)({__name:`DialogView`,props:{modelValue:{type:Boolean},showTitleBar:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0},closable:{type:Boolean,default:!0},closeOnClickMask:{type:Boolean,default:!1}},emits:[`update:modelValue`,`closed`],setup(e,{expose:s,emit:c}){let l=e,u=c,d=(0,t.ref)(),f=()=>{u(`update:modelValue`,!0)},p=()=>{u(`update:modelValue`,!1)},m=e=>{e.preventDefault(),l.closable&&p()},h=(0,t.ref)(!1),g=()=>{if(!h.value){if(!l.closable&&l.modelValue){(0,t.nextTick)(()=>{d.value&&!d.value.open&&d.value.showModal()});return}l.modelValue&&u(`update:modelValue`,!1),(0,t.nextTick)(()=>{l.modelValue&&d.value&&!d.value.open&&d.value.showModal()}),u(`closed`)}},_=(0,t.computed)(()=>l.closable?l.closeOnClickMask?`any`:`closerequest`:`none`);(0,t.watch)(()=>l.modelValue,async e=>{await(0,t.nextTick)(),e?d.value&&!d.value.open&&d.value.showModal():d.value&&d.value.open&&d.value.close()});let v=()=>{l.modelValue&&d.value&&!d.value.open&&d.value.showModal()};return(0,t.onMounted)(()=>{v()}),(0,t.onBeforeUnmount)(()=>{d.value&&d.value.open&&d.value.close()}),(0,t.onDeactivated)(()=>{d.value&&d.value.open&&(h.value=!0,d.value.close(),(0,t.nextTick)(()=>h.value=!1))}),(0,t.onActivated)(()=>{v()}),s({get:()=>d.value,open:f,close:p}),(s,c)=>((0,t.openBlock)(),(0,t.createElementBlock)(`dialog`,(0,t.mergeProps)({ref_key:`dialogRef`,ref:d,class:`dialog-view`},s.$attrs,{onClose:g,onCancel:m,closedBy:_.value}),[e.showTitleBar?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,r,[(0,t.createElementVNode)(`span`,i,[(0,t.renderSlot)(s.$slots,`title`,{},void 0,!0)]),e.showCloseButton&&e.closable?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,"aria-label":`Close the dialog`,class:`dialog-close-button`,onClick:(0,t.withModifiers)(p,[`prevent`])},`×`)):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,a,[(0,t.renderSlot)(s.$slots,`default`,{},void 0,!0)]),s.$slots.footer?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,o,[(0,t.renderSlot)(s.$slots,`footer`,{},void 0,!0)])):(0,t.createCommentVNode)(``,!0)],16,n))}}),[[`__scopeId`,`data-v-7641dcfa`]]),c={install:e=>{e.component(`DialogView`,s)}};e.DialogView=s,e.DialogViewPlugin=c,e.default=c});
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("vue")):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.DialogView={},e.Vue))})(this,function(e,t){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var n=[`closedBy`],r={key:0,class:`dialog-title-bar`},i={class:`dialog-title`},a={class:`dialog-content-wrapper`},o={class:`dialog-content`},s={key:1,class:`dialog-footer`},c=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})((0,t.defineComponent)({__name:`DialogView`,props:{modelValue:{type:Boolean},showTitleBar:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0},closable:{type:Boolean,default:!0},closeOnClickMask:{type:Boolean,default:!1}},emits:[`update:modelValue`,`closed`],setup(e,{expose:c,emit:l}){let u=e,d=l,f=(0,t.ref)(),p=()=>{d(`update:modelValue`,!0)},m=()=>{d(`update:modelValue`,!1)},h=e=>{e.preventDefault(),u.closable&&m()},g=(0,t.ref)(!1),_=()=>{if(!g.value){if(!u.closable&&u.modelValue){(0,t.nextTick)(()=>{f.value&&!f.value.open&&f.value.showModal()});return}u.modelValue&&d(`update:modelValue`,!1),(0,t.nextTick)(()=>{u.modelValue&&f.value&&!f.value.open&&f.value.showModal()}),d(`closed`)}},v=(0,t.computed)(()=>u.closable?u.closeOnClickMask?`any`:`closerequest`:`none`);(0,t.watch)(()=>u.modelValue,async e=>{await(0,t.nextTick)(),e?f.value&&!f.value.open&&f.value.showModal():f.value&&f.value.open&&f.value.close()});let y=()=>{u.modelValue&&f.value&&!f.value.open&&f.value.showModal()};return(0,t.onMounted)(()=>{y()}),(0,t.onBeforeUnmount)(()=>{f.value&&f.value.open&&f.value.close()}),(0,t.onDeactivated)(()=>{f.value&&f.value.open&&(g.value=!0,f.value.close(),(0,t.nextTick)(()=>g.value=!1))}),(0,t.onActivated)(()=>{y()}),c({get:()=>f.value,open:p,close:m}),(c,l)=>((0,t.openBlock)(),(0,t.createElementBlock)(`dialog`,(0,t.mergeProps)({ref_key:`dialogRef`,ref:f,class:`dialog-view`},c.$attrs,{onClose:_,onCancel:h,closedBy:v.value}),[e.showTitleBar?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,r,[(0,t.createElementVNode)(`span`,i,[(0,t.renderSlot)(c.$slots,`title`,{},void 0,!0)]),e.showCloseButton&&e.closable?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,type:`button`,"aria-label":`Close the dialog`,class:`dialog-close-button`,onClick:(0,t.withModifiers)(m,[`prevent`])},`×`)):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,a,[(0,t.createElementVNode)(`div`,o,[(0,t.renderSlot)(c.$slots,`default`,{},void 0,!0)])]),c.$slots.footer?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,s,[(0,t.renderSlot)(c.$slots,`footer`,{},void 0,!0)])):(0,t.createCommentVNode)(``,!0)],16,n))}}),[[`__scopeId`,`data-v-8eb40789`]]),l={install:e=>{e.component(`DialogView`,c)}};e.DialogView=c,e.DialogViewPlugin=l,e.default=l});
2
2
  //# sourceMappingURL=cssless.umd.js.map