@bagelink/vue 0.0.140 → 0.0.145

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/components/FormSchema.vue.d.ts +2 -2
  2. package/dist/components/FormSchema.vue.d.ts.map +1 -1
  3. package/dist/components/Modal.vue.d.ts.map +1 -1
  4. package/dist/components/ModalForm.vue.d.ts.map +1 -1
  5. package/dist/components/formkit/FileUploader.vue.d.ts +4 -4
  6. package/dist/components/formkit/FileUploader.vue.d.ts.map +1 -1
  7. package/dist/index.cjs +43 -15
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.mjs +44 -16
  10. package/dist/plugins/modal.d.ts.map +1 -1
  11. package/dist/style.css +1376 -57
  12. package/dist/utils/index.d.ts +1 -0
  13. package/dist/utils/index.d.ts.map +1 -1
  14. package/package.json +2 -2
  15. package/src/components/FormSchema.vue +1 -1
  16. package/src/components/Modal.vue +21 -8
  17. package/src/components/ModalForm.vue +23 -8
  18. package/src/components/formkit/FileUploader.vue +2 -2
  19. package/src/index.ts +1 -0
  20. package/src/plugins/modal.ts +12 -10
  21. package/src/styles/bagel.css +37 -0
  22. package/src/styles/buttons.css +56 -0
  23. package/src/styles/fonts/Ploni/ploni-black.eot +0 -0
  24. package/src/styles/fonts/Ploni/ploni-black.woff +0 -0
  25. package/src/styles/fonts/Ploni/ploni-black.woff2 +0 -0
  26. package/src/styles/fonts/Ploni/ploni-bold.eot +0 -0
  27. package/src/styles/fonts/Ploni/ploni-bold.woff +0 -0
  28. package/src/styles/fonts/Ploni/ploni-bold.woff2 +0 -0
  29. package/src/styles/fonts/Ploni/ploni-demibold.eot +0 -0
  30. package/src/styles/fonts/Ploni/ploni-demibold.woff +0 -0
  31. package/src/styles/fonts/Ploni/ploni-demibold.woff2 +0 -0
  32. package/src/styles/fonts/Ploni/ploni-light.eot +0 -0
  33. package/src/styles/fonts/Ploni/ploni-light.woff +0 -0
  34. package/src/styles/fonts/Ploni/ploni-light.woff2 +0 -0
  35. package/src/styles/fonts/Ploni/ploni-medium.eot +0 -0
  36. package/src/styles/fonts/Ploni/ploni-medium.woff +0 -0
  37. package/src/styles/fonts/Ploni/ploni-medium.woff2 +0 -0
  38. package/src/styles/fonts/Ploni/ploni-regular.eot +0 -0
  39. package/src/styles/fonts/Ploni/ploni-regular.woff +0 -0
  40. package/src/styles/fonts/Ploni/ploni-regular.woff2 +0 -0
  41. package/src/styles/fonts/Ploni/ploni-ultrabold.eot +0 -0
  42. package/src/styles/fonts/Ploni/ploni-ultrabold.woff +0 -0
  43. package/src/styles/fonts/Ploni/ploni-ultrabold.woff2 +0 -0
  44. package/src/styles/fonts/Ploni/ploni-ultralight.eot +0 -0
  45. package/src/styles/fonts/Ploni/ploni-ultralight.woff +0 -0
  46. package/src/styles/fonts/Ploni/ploni-ultralight.woff2 +0 -0
  47. package/src/styles/fonts/Ploni.css +71 -0
  48. package/src/styles/inputs.css +315 -0
  49. package/src/styles/layout.css +268 -0
  50. package/src/styles/modal.css +55 -54
  51. package/src/styles/scrollbar.css +18 -0
  52. package/src/styles/text.css +35 -0
  53. package/src/styles/theme.css +736 -0
  54. package/src/styles/transitions.css +47 -0
  55. package/src/utils/index.ts +6 -0
@@ -3,7 +3,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
3
3
  modelValue?: any;
4
4
  schema: FormKitSchemaDefinition;
5
5
  onDelete?: ((id: string) => void) | undefined;
6
- i18nT: (key: string) => string;
6
+ i18nT?: ((key: string) => string) | undefined;
7
7
  }>, {
8
8
  i18nT: (key: string) => string;
9
9
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -13,7 +13,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
13
13
  modelValue?: any;
14
14
  schema: FormKitSchemaDefinition;
15
15
  onDelete?: ((id: string) => void) | undefined;
16
- i18nT: (key: string) => string;
16
+ i18nT?: ((key: string) => string) | undefined;
17
17
  }>, {
18
18
  i18nT: (key: string) => string;
19
19
  }>>> & {
@@ -1 +1 @@
1
- {"version":3,"file":"FormSchema.vue.d.ts","sourceRoot":"","sources":["../../src/components/FormSchema.vue"],"names":[],"mappings":"AA0BA;AAGA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,eAAe,CAAC;;iBA4J/C,GAAG;YACR,uBAAuB;qBAEd,MAAM,KAAK,IAAI;iBAEnB,MAAM,KAAK,MAAM;;;;;;;iBALjB,GAAG;YACR,uBAAuB;qBAEd,MAAM,KAAK,IAAI;iBAEnB,MAAM,KAAK,MAAM;;;;;;;iBAAjB,MAAM,KAAK,MAAM;;AAP/B,wBAcG;AAGH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACxE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AACN,KA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C,CAAC;CACT,CAAC;AACN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.vue.d.ts","sourceRoot":"","sources":["../../src/components/Modal.vue"],"names":[],"mappings":"AA+BA;AAGA,OAAO,EAAE,KAAK,UAAU,EAAO,MAAM,eAAe,CAAC;AACrD,OAAO,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;AAwL7B,wBAAwG;AAGxG,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
1
+ {"version":3,"file":"Modal.vue.d.ts","sourceRoot":"","sources":["../../src/components/Modal.vue"],"names":[],"mappings":"AA+BA;AAGA,OAAO,EAAE,KAAK,UAAU,EAAkB,MAAM,eAAe,CAAC;AAChE,OAAO,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;AAqM7B,wBAAwG;AAGxG,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAA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,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
1
+ {"version":3,"file":"ModalForm.vue.d.ts","sourceRoot":"","sources":["../../src/components/ModalForm.vue"],"names":[],"mappings":"AAiCA;AAEA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAE7D,OAAO,EACW,UAAU,EAC3B,MAAM,eAAe,CAAC;AACvB,OAAO,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiP7B,wBAAwG;AAGxG,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
@@ -1,14 +1,14 @@
1
1
  declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
2
2
  context: Record<string, any>;
3
- dragDropLabel: string;
4
- browseLabel: string;
3
+ dragDropLabel?: string | undefined;
4
+ browseLabel?: string | undefined;
5
5
  }>, {
6
6
  dragDropLabel: string;
7
7
  browseLabel: string;
8
8
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
9
9
  context: Record<string, any>;
10
- dragDropLabel: string;
11
- browseLabel: string;
10
+ dragDropLabel?: string | undefined;
11
+ browseLabel?: string | undefined;
12
12
  }>, {
13
13
  dragDropLabel: string;
14
14
  browseLabel: string;
@@ -1 +1 @@
1
- {"version":3,"file":"FileUploader.vue.d.ts","sourceRoot":"","sources":["../../../src/components/formkit/FileUploader.vue"],"names":[],"mappings":"AAiFA;;aA2aU,OAAO,MAAM,EAAE,GAAG,CAAC;mBACb,MAAM;iBACR,MAAM;;;;;aAFV,OAAO,MAAM,EAAE,GAAG,CAAC;mBACb,MAAM;iBACR,MAAM;;;;;mBADJ,MAAM;iBACR,MAAM;;AAJpB,wBAUG;AAGH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,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M,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACxE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AACN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
package/dist/index.cjs CHANGED
@@ -2269,6 +2269,9 @@ const useModal = () => {
2269
2269
  const ModalPlugin = {
2270
2270
  install: (app) => {
2271
2271
  const modalStack = vue.ref([]);
2272
+ const hideModal = (index2) => {
2273
+ modalStack.value.splice(index2, 1);
2274
+ };
2272
2275
  const showModal = (isForm, options, slots = {}) => {
2273
2276
  modalStack.value.push({
2274
2277
  modalOptions: options,
@@ -2276,9 +2279,6 @@ const ModalPlugin = {
2276
2279
  componentSlots: slots
2277
2280
  });
2278
2281
  };
2279
- const hideModal = (index2) => {
2280
- modalStack.value.splice(index2, 1);
2281
- };
2282
2282
  app.provide(ModalSymbol, {
2283
2283
  modalForm: (options, slots) => showModal(true, options, slots),
2284
2284
  showModal: (options, slots) => showModal(false, options, slots),
@@ -2288,7 +2288,7 @@ const ModalPlugin = {
2288
2288
  const ModalComponent = vue.defineComponent({
2289
2289
  data() {
2290
2290
  return {
2291
- modalStack
2291
+ modalStack: modalStack.value
2292
2292
  };
2293
2293
  },
2294
2294
  render() {
@@ -2364,6 +2364,11 @@ const useFormkit = () => {
2364
2364
  return formkit;
2365
2365
  };
2366
2366
  const initials = (...strArr) => strArr.map((str) => str == null ? void 0 : str.charAt(0)).join("");
2367
+ function useEscape(event, closeModel) {
2368
+ if (event.key === "Escape") {
2369
+ closeModel();
2370
+ }
2371
+ }
2367
2372
  const _hoisted_1$V = { ref: "el" };
2368
2373
  const _sfc_main$P = /* @__PURE__ */ vue.defineComponent({
2369
2374
  __name: "LangText",
@@ -14734,11 +14739,6 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
14734
14739
  emits: ["update:isModalVisible"],
14735
14740
  setup(__props, { emit: __emit }) {
14736
14741
  let isActive = vue.ref(false);
14737
- vue.onMounted(() => {
14738
- setTimeout(() => {
14739
- isActive.value = true;
14740
- }, 1);
14741
- });
14742
14742
  const emit2 = __emit;
14743
14743
  const closeModal = () => {
14744
14744
  isActive.value = false;
@@ -14746,6 +14746,22 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
14746
14746
  emit2("update:isModalVisible", false);
14747
14747
  }, 200);
14748
14748
  };
14749
+ const escapeKeyClose = (e) => useEscape(e, () => closeModal());
14750
+ vue.onMounted(() => {
14751
+ setTimeout(() => {
14752
+ isActive.value = true;
14753
+ }, 1);
14754
+ document.addEventListener(
14755
+ "keydown",
14756
+ escapeKeyClose
14757
+ );
14758
+ });
14759
+ vue.onUnmounted(() => {
14760
+ document.removeEventListener(
14761
+ "keydown",
14762
+ escapeKeyClose
14763
+ );
14764
+ });
14749
14765
  return (_ctx, _cache) => {
14750
14766
  return vue.openBlock(), vue.createElementBlock("div", {
14751
14767
  class: vue.normalizeClass(["bg-dark", { "is-side": _ctx.side, "is-active": vue.unref(isActive) }]),
@@ -15130,11 +15146,6 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
15130
15146
  return props2.schema;
15131
15147
  });
15132
15148
  let isActive = vue.ref(false);
15133
- vue.onMounted(() => {
15134
- setTimeout(() => {
15135
- isActive.value = true;
15136
- }, 1);
15137
- });
15138
15149
  const emit2 = __emit;
15139
15150
  const handleEmit = (value) => {
15140
15151
  emit2("update:modelValue", value);
@@ -15159,6 +15170,22 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
15159
15170
  (_b = props2.onDelete) == null ? void 0 : _b.call(props2, (_a = props2.modelValue) == null ? void 0 : _a.id);
15160
15171
  closeModal();
15161
15172
  };
15173
+ const escapeKeyClose = (e) => useEscape(e, () => closeModal());
15174
+ vue.onMounted(() => {
15175
+ setTimeout(() => {
15176
+ isActive.value = true;
15177
+ }, 1);
15178
+ document.addEventListener(
15179
+ "keydown",
15180
+ escapeKeyClose
15181
+ );
15182
+ });
15183
+ vue.onUnmounted(() => {
15184
+ document.removeEventListener(
15185
+ "keydown",
15186
+ escapeKeyClose
15187
+ );
15188
+ });
15162
15189
  return (_ctx, _cache) => {
15163
15190
  return vue.openBlock(), vue.createElementBlock("div", {
15164
15191
  class: vue.normalizeClass(["bg-dark", { "is-side": _ctx.side, "is-active": vue.unref(isActive) }]),
@@ -15192,7 +15219,7 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
15192
15219
  };
15193
15220
  }
15194
15221
  });
15195
- const ModalForm = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-665350cb"]]);
15222
+ const ModalForm = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-ca1b8501"]]);
15196
15223
  const _hoisted_1$J = {
15197
15224
  key: 0,
15198
15225
  class: "data"
@@ -28526,5 +28553,6 @@ exports.formatString = formatString;
28526
28553
  exports.initials = initials;
28527
28554
  exports.keyToLabel = keyToLabel;
28528
28555
  exports.useBagel = useBagel;
28556
+ exports.useEscape = useEscape;
28529
28557
  exports.useFormkit = useFormkit;
28530
28558
  exports.useModal = useModal;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,QAAQ,EAAE,KAAK,YAAY,EAAE,iBAAiB,EAAE,QAAQ,GACxD,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACxD,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,QAAQ,EAAE,KAAK,YAAY,EAAE,iBAAiB,EAAE,QAAQ,GACxD,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACxD,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,OAAO,oBAAoB,CAAC"}
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { inject, ref, defineComponent, h, openBlock, createElementBlock, Fragment as Fragment$1, createElementVNode, createTextVNode, toDisplayString, watch, onMounted, withKeys, withModifiers, normalizeStyle, resolveComponent, normalizeClass, renderSlot, renderList, createBlock, withCtx, useSlots, resolveDynamicComponent, unref, createCommentVNode, mergeProps, createVNode, withDirectives, vModelText, isRef, computed, reactive, Transition, useCssVars, pushScopeId, popScopeId, markRaw, vModelCheckbox, onUnmounted, Teleport, vModelDynamic, TransitionGroup, provide } from "vue";
1
+ import { inject, ref, defineComponent, h, openBlock, createElementBlock, Fragment as Fragment$1, createElementVNode, createTextVNode, toDisplayString, watch, onMounted, withKeys, withModifiers, normalizeStyle, resolveComponent, normalizeClass, renderSlot, renderList, createBlock, withCtx, useSlots, resolveDynamicComponent, unref, createCommentVNode, onUnmounted, mergeProps, createVNode, withDirectives, vModelText, isRef, computed, reactive, Transition, useCssVars, pushScopeId, popScopeId, markRaw, vModelCheckbox, Teleport, vModelDynamic, TransitionGroup, provide } from "vue";
2
2
  function bind$2(fn, thisArg) {
3
3
  return function wrap2() {
4
4
  return fn.apply(thisArg, arguments);
@@ -2267,6 +2267,9 @@ const useModal = () => {
2267
2267
  const ModalPlugin = {
2268
2268
  install: (app) => {
2269
2269
  const modalStack = ref([]);
2270
+ const hideModal = (index2) => {
2271
+ modalStack.value.splice(index2, 1);
2272
+ };
2270
2273
  const showModal = (isForm, options, slots = {}) => {
2271
2274
  modalStack.value.push({
2272
2275
  modalOptions: options,
@@ -2274,9 +2277,6 @@ const ModalPlugin = {
2274
2277
  componentSlots: slots
2275
2278
  });
2276
2279
  };
2277
- const hideModal = (index2) => {
2278
- modalStack.value.splice(index2, 1);
2279
- };
2280
2280
  app.provide(ModalSymbol, {
2281
2281
  modalForm: (options, slots) => showModal(true, options, slots),
2282
2282
  showModal: (options, slots) => showModal(false, options, slots),
@@ -2286,7 +2286,7 @@ const ModalPlugin = {
2286
2286
  const ModalComponent = defineComponent({
2287
2287
  data() {
2288
2288
  return {
2289
- modalStack
2289
+ modalStack: modalStack.value
2290
2290
  };
2291
2291
  },
2292
2292
  render() {
@@ -2362,6 +2362,11 @@ const useFormkit = () => {
2362
2362
  return formkit;
2363
2363
  };
2364
2364
  const initials = (...strArr) => strArr.map((str) => str == null ? void 0 : str.charAt(0)).join("");
2365
+ function useEscape(event, closeModel) {
2366
+ if (event.key === "Escape") {
2367
+ closeModel();
2368
+ }
2369
+ }
2365
2370
  const _hoisted_1$V = { ref: "el" };
2366
2371
  const _sfc_main$P = /* @__PURE__ */ defineComponent({
2367
2372
  __name: "LangText",
@@ -14732,11 +14737,6 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
14732
14737
  emits: ["update:isModalVisible"],
14733
14738
  setup(__props, { emit: __emit }) {
14734
14739
  let isActive = ref(false);
14735
- onMounted(() => {
14736
- setTimeout(() => {
14737
- isActive.value = true;
14738
- }, 1);
14739
- });
14740
14740
  const emit2 = __emit;
14741
14741
  const closeModal = () => {
14742
14742
  isActive.value = false;
@@ -14744,6 +14744,22 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
14744
14744
  emit2("update:isModalVisible", false);
14745
14745
  }, 200);
14746
14746
  };
14747
+ const escapeKeyClose = (e) => useEscape(e, () => closeModal());
14748
+ onMounted(() => {
14749
+ setTimeout(() => {
14750
+ isActive.value = true;
14751
+ }, 1);
14752
+ document.addEventListener(
14753
+ "keydown",
14754
+ escapeKeyClose
14755
+ );
14756
+ });
14757
+ onUnmounted(() => {
14758
+ document.removeEventListener(
14759
+ "keydown",
14760
+ escapeKeyClose
14761
+ );
14762
+ });
14747
14763
  return (_ctx, _cache) => {
14748
14764
  return openBlock(), createElementBlock("div", {
14749
14765
  class: normalizeClass(["bg-dark", { "is-side": _ctx.side, "is-active": unref(isActive) }]),
@@ -15128,11 +15144,6 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
15128
15144
  return props2.schema;
15129
15145
  });
15130
15146
  let isActive = ref(false);
15131
- onMounted(() => {
15132
- setTimeout(() => {
15133
- isActive.value = true;
15134
- }, 1);
15135
- });
15136
15147
  const emit2 = __emit;
15137
15148
  const handleEmit = (value) => {
15138
15149
  emit2("update:modelValue", value);
@@ -15157,6 +15168,22 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
15157
15168
  (_b = props2.onDelete) == null ? void 0 : _b.call(props2, (_a = props2.modelValue) == null ? void 0 : _a.id);
15158
15169
  closeModal();
15159
15170
  };
15171
+ const escapeKeyClose = (e) => useEscape(e, () => closeModal());
15172
+ onMounted(() => {
15173
+ setTimeout(() => {
15174
+ isActive.value = true;
15175
+ }, 1);
15176
+ document.addEventListener(
15177
+ "keydown",
15178
+ escapeKeyClose
15179
+ );
15180
+ });
15181
+ onUnmounted(() => {
15182
+ document.removeEventListener(
15183
+ "keydown",
15184
+ escapeKeyClose
15185
+ );
15186
+ });
15160
15187
  return (_ctx, _cache) => {
15161
15188
  return openBlock(), createElementBlock("div", {
15162
15189
  class: normalizeClass(["bg-dark", { "is-side": _ctx.side, "is-active": unref(isActive) }]),
@@ -15190,7 +15217,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
15190
15217
  };
15191
15218
  }
15192
15219
  });
15193
- const ModalForm = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-665350cb"]]);
15220
+ const ModalForm = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-ca1b8501"]]);
15194
15221
  const _hoisted_1$J = {
15195
15222
  key: 0,
15196
15223
  class: "data"
@@ -28525,6 +28552,7 @@ export {
28525
28552
  initials,
28526
28553
  keyToLabel,
28527
28554
  useBagel,
28555
+ useEscape,
28528
28556
  useFormkit,
28529
28557
  useModal
28530
28558
  };
@@ -1 +1 @@
1
- {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/plugins/modal.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACf,MAAM,KAAK,CAAC;AACb,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAE7D,UAAU,YAAY;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,UAAU,gBAAiB,SAAQ,YAAY;IAC9C,UAAU,CAAC,EAAE,GAAG,CAAC;IAEjB,qBAAqB,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAE3C,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAE7B,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,MAAM,EAAE,uBAAuB,CAAC;CAChC;AAED,UAAU,QAAQ;IAEjB,SAAS,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAExE,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAE5E,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;C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