@wikicasa-dev/components 1.8.2 → 1.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,48 +1,39 @@
1
1
  import { defineComponent as s, openBlock as a, createElementBlock as l, normalizeClass as t, withModifiers as o, createElementVNode as n, createCommentVNode as r } from "vue";
2
- import { _ as u } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
3
- import './assets/BaseFloatingLabel.css';const d = s({
4
- name: "BaseFloatingLabel",
2
+ import { _ as d } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
3
+ import './assets/BaseFloatingLabel.css';const u = ["for"], k = ["innerHTML"], m = /* @__PURE__ */ s({
4
+ __name: "BaseFloatingLabel",
5
5
  props: {
6
- labelState: {
7
- type: String,
8
- default: () => "inline-label"
9
- },
10
- isValid: {
11
- type: Boolean,
12
- default: () => null
13
- },
14
- labelText: {
15
- type: String,
16
- required: !0
17
- },
18
- disabled: {
19
- type: [String, Boolean],
20
- default: !1
21
- }
6
+ labelState: { default: "inline-label" },
7
+ isValid: { default: null },
8
+ labelText: {},
9
+ disabled: { type: [String, Boolean], default: !1 }
22
10
  },
23
- emits: ["click"]
24
- }), p = ["for"], k = ["innerHTML"];
25
- function m(e, i, c, f, b, y) {
26
- return a(), l("label", {
27
- for: e.$attrs.for,
28
- class: t(["uikit-absolute uikit-left-15px uikit-h-5 uikit-text-sm", [
29
- e.labelState,
30
- { "uikit-text-w-secondary": e.disabled },
31
- e.$attrs["label-classes"]
32
- ]]),
33
- onClick: i[0] || (i[0] = o(($) => e.$emit("click"), ["stop"]))
34
- }, [
35
- n("span", {
36
- class: t(["uikit-text uikit-font-medium uikit-text-w-black", { "!uikit-text-w-secondary": e.disabled }]),
37
- innerHTML: e.labelText
38
- }, null, 10, k),
39
- e.$attrs.required ? (a(), l("sup", {
40
- key: 0,
41
- class: t(["uikit-absolute -uikit-top-[0.3rem] uikit-text uikit-text-w-primary", { "uikit-text-w-secondary": e.disabled }])
42
- }, " *", 2)) : r("", !0)
43
- ], 10, p);
44
- }
45
- const g = /* @__PURE__ */ u(d, [["render", m], ["__scopeId", "data-v-bc398569"]]);
11
+ emits: ["click"],
12
+ setup(p, { emit: b }) {
13
+ return (e, i) => (a(), l("label", {
14
+ for: e.$attrs.for,
15
+ class: t(["uikit-absolute uikit-left-15px uikit-h-5 uikit-text-sm", [
16
+ e.labelState,
17
+ { "uikit-text-w-secondary": e.disabled },
18
+ e.$attrs["label-classes"]
19
+ ]]),
20
+ onClick: i[0] || (i[0] = o((f) => e.$emit("click"), ["stop"]))
21
+ }, [
22
+ n("span", {
23
+ class: t(["uikit-text uikit-font-medium uikit-text-w-black", { "!uikit-text-w-secondary": e.disabled }]),
24
+ innerHTML: e.labelText
25
+ }, null, 10, k),
26
+ e.$attrs.required ? (a(), l("sup", {
27
+ key: 0,
28
+ class: t(["uikit-absolute -uikit-top-[0.3rem] uikit-text", [
29
+ { "uikit-text-w-secondary": e.disabled },
30
+ { "uikit-text-w-danger": e.isValid === !1 },
31
+ { "uikit-text-w-primary": (e.isValid || e.isValid === null) && !e.disabled }
32
+ ]])
33
+ }, " *", 2)) : r("", !0)
34
+ ], 10, u));
35
+ }
36
+ }), y = /* @__PURE__ */ d(m, [["__scopeId", "data-v-5a3dceb6"]]);
46
37
  export {
47
- g as default
38
+ y as default
48
39
  };
package/dist/BaseModal.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./chunks/BaseModal.vue_vue_type_style_index_0_lang.DRnvHI35.js";
1
+ import { _ as f } from "./chunks/BaseModal.vue_vue_type_style_index_0_lang.DSPssuBQ.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,41 +1,27 @@
1
1
  import { Nullable } from '@wikicasa-dev/types';
2
2
 
3
3
  type LabelState = "inline-label" | "floating-label";
4
- declare const _default: import('vue').DefineComponent<{
5
- labelState: {
6
- type: () => LabelState;
7
- default: () => LabelState;
8
- };
9
- isValid: {
10
- type: () => Nullable<boolean>;
11
- default: () => Nullable<boolean>;
12
- };
13
- labelText: {
14
- type: StringConstructor;
15
- required: true;
16
- };
17
- disabled: {
18
- type: (BooleanConstructor | StringConstructor)[];
19
- default: boolean;
20
- };
21
- }, unknown, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "click"[], "click", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
22
- labelState: {
23
- type: () => LabelState;
24
- default: () => LabelState;
25
- };
26
- isValid: {
27
- type: () => Nullable<boolean>;
28
- default: () => Nullable<boolean>;
29
- };
30
- labelText: {
31
- type: StringConstructor;
32
- required: true;
33
- };
34
- disabled: {
35
- type: (BooleanConstructor | StringConstructor)[];
36
- default: boolean;
37
- };
38
- }>> & {
4
+ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
5
+ labelState?: LabelState;
6
+ isValid?: Nullable<boolean>;
7
+ labelText: string;
8
+ disabled?: string | boolean;
9
+ }>, {
10
+ labelState: string;
11
+ isValid: null;
12
+ disabled: boolean;
13
+ }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
+ click: (...args: any[]) => void;
15
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
16
+ labelState?: LabelState;
17
+ isValid?: Nullable<boolean>;
18
+ labelText: string;
19
+ disabled?: string | boolean;
20
+ }>, {
21
+ labelState: string;
22
+ isValid: null;
23
+ disabled: boolean;
24
+ }>>> & {
39
25
  onClick?: ((...args: any[]) => any) | undefined;
40
26
  }, {
41
27
  labelState: LabelState;
@@ -43,3 +29,20 @@ declare const _default: import('vue').DefineComponent<{
43
29
  disabled: string | boolean;
44
30
  }, {}>;
45
31
  export default _default;
32
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
33
+ type __VLS_TypePropsToRuntimeProps<T> = {
34
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
35
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
36
+ } : {
37
+ type: import('vue').PropType<T[K]>;
38
+ required: true;
39
+ };
40
+ };
41
+ type __VLS_WithDefaults<P, D> = {
42
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
43
+ default: D[K];
44
+ }> : P[K];
45
+ };
46
+ type __VLS_Prettify<T> = {
47
+ [K in keyof T]: T[K];
48
+ } & {};
@@ -1 +1 @@
1
- .floating-label[data-v-bc398569]{top:-10px;left:1.25rem;border-radius:5px;font-size:14px;line-height:18px}.inline-label[data-v-bc398569]{top:.75rem;background-color:transparent;font-size:16px;line-height:20px}.inline-label>span[data-v-bc398569]{--tw-text-opacity: 1;color:rgb(109 118 135 / var(--tw-text-opacity))}.floating-label[data-v-bc398569],.inline-label[data-v-bc398569]{transition-property:top,left;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;will-change:top,left}
1
+ .floating-label[data-v-5a3dceb6]{top:-10px;left:1.25rem;border-radius:5px;font-size:14px;line-height:18px}.inline-label[data-v-5a3dceb6]{top:.75rem;background-color:transparent;font-size:16px;line-height:20px}.inline-label>span[data-v-5a3dceb6]{--tw-text-opacity: 1;color:rgb(109 118 135 / var(--tw-text-opacity))}.floating-label[data-v-5a3dceb6],.inline-label[data-v-5a3dceb6]{transition-property:top,left;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;will-change:top,left}
@@ -1,9 +1,9 @@
1
- import { defineComponent as x, ref as k, watch as M, nextTick as B, openBlock as c, createBlock as f, Teleport as E, createElementVNode as a, normalizeClass as o, withModifiers as b, withCtx as L, createVNode as $, unref as T, createCommentVNode as y, renderSlot as d, createElementBlock as z } from "vue";
1
+ import { defineComponent as x, ref as k, onUnmounted as M, watch as B, nextTick as E, openBlock as c, createBlock as b, Teleport as L, createElementVNode as a, normalizeClass as o, withModifiers as y, withCtx as $, createVNode as T, unref as z, createCommentVNode as h, renderSlot as d, createElementBlock as H } from "vue";
2
2
  import "./js.cookie.CkZE2oaL.js";
3
- import { _ as H } from "./BaseButton.vue_vue_type_script_setup_true_lang.dlLTK59i.js";
4
- import { l as O } from "./CloseIcon._moEkaop.js";
3
+ import { _ as O } from "./BaseButton.vue_vue_type_script_setup_true_lang.dlLTK59i.js";
4
+ import { l as I } from "./CloseIcon._moEkaop.js";
5
5
  import "./DownloadIcon.DHCHRETy.js";
6
- import '../assets/BaseModal.css';const I = (l, n) => new Promise((s, u) => {
6
+ import '../assets/BaseModal.css';const K = (l, n) => new Promise((s, u) => {
7
7
  setTimeout(() => {
8
8
  try {
9
9
  l && l(), s();
@@ -11,7 +11,7 @@ import '../assets/BaseModal.css';const I = (l, n) => new Promise((s, u) => {
11
11
  u();
12
12
  }
13
13
  }, n);
14
- }), K = ["id", "data-cy"], N = ["innerHTML"], j = /* @__PURE__ */ x({
14
+ }), N = ["id", "data-cy"], V = ["innerHTML"], j = /* @__PURE__ */ x({
15
15
  __name: "BaseModal",
16
16
  props: {
17
17
  id: { default: "base-bt-modal" },
@@ -32,11 +32,11 @@ import '../assets/BaseModal.css';const I = (l, n) => new Promise((s, u) => {
32
32
  },
33
33
  emits: ["closed", "opened"],
34
34
  setup(l, { emit: n }) {
35
- const s = l, u = n, e = k(!1), r = k(null), h = k(null), m = ({ key: t }) => {
35
+ const s = l, u = n, e = k(!1), r = k(null), v = k(null), m = ({ key: t }) => {
36
36
  t === "Escape" && i();
37
37
  }, w = () => {
38
38
  document.body.addEventListener("keydown", m);
39
- }, v = () => {
39
+ }, p = () => {
40
40
  document.body.removeEventListener("keydown", m);
41
41
  }, C = async () => {
42
42
  e.value = !0, w(), document.documentElement.classList.add("uikit-no-scrolling"), document.body.classList.add("uikit-no-scrolling", "sm:uikit-pr-15px"), u("opened"), s.autoClose !== void 0 && setTimeout(() => {
@@ -45,19 +45,21 @@ import '../assets/BaseModal.css';const I = (l, n) => new Promise((s, u) => {
45
45
  }, g = async () => {
46
46
  s.closeOnClickOut && await i();
47
47
  }, i = async () => {
48
- e.value = !1, v(), document.body.classList.remove("uikit-no-scrolling", "sm:uikit-pr-15px"), document.documentElement.classList.remove("uikit-no-scrolling"), await I(() => {
48
+ e.value = !1, p(), document.body.classList.remove("uikit-no-scrolling", "sm:uikit-pr-15px"), document.documentElement.classList.remove("uikit-no-scrolling"), await K(() => {
49
49
  r.value?.classList.add("uikit-hidden"), u("closed");
50
50
  }, 250);
51
51
  };
52
- return M(
52
+ return M(() => {
53
+ p(), document.body.classList.remove("uikit-no-scrolling", "sm:uikit-pr-15px"), document.documentElement.classList.remove("uikit-no-scrolling");
54
+ }), B(
53
55
  () => s.showModal,
54
56
  async (t) => {
55
- !t && !e.value && B(() => {
57
+ !t && !e.value && E(() => {
56
58
  r.value?.classList.add("uikit-hidden");
57
59
  }), t && !e.value && await C(), !t && e.value && await i(), e.value = t;
58
60
  },
59
61
  { immediate: !0 }
60
- ), (t, p) => (c(), f(E, { to: "body" }, [
62
+ ), (t, f) => (c(), b(L, { to: "body" }, [
61
63
  a("div", {
62
64
  ref_key: "backdropEl",
63
65
  ref: r,
@@ -75,7 +77,7 @@ import '../assets/BaseModal.css';const I = (l, n) => new Promise((s, u) => {
75
77
  a("dialog", {
76
78
  id: t.id,
77
79
  ref_key: "modalEl",
78
- ref: h,
80
+ ref: v,
79
81
  "data-cy": t.$attrs["data-cy"],
80
82
  class: o(["uikit-modal-dialog transition-y uikit-mx-auto uikit-block uikit-w-full uikit-overflow-y-auto uikit-overflow-x-hidden uikit-rounded uikit-border-none uikit-bg-transparent uikit-bg-white uikit-p-0 uikit-shadow-lg uikit-no-scrollbar uikit-safe-bottom max-sm:uikit-fixed max-sm:uikit-bottom-0 max-sm:uikit-max-h-[95%] max-sm:uikit-rounded-bl-none max-sm:uikit-rounded-br-none sm:uikit-h-auto", [
81
83
  t.customModalDialogClasses,
@@ -85,13 +87,13 @@ import '../assets/BaseModal.css';const I = (l, n) => new Promise((s, u) => {
85
87
  `base-${t.size}`,
86
88
  t.fullHeight ? "uikit-h-[95%]" : "uikit-h-auto"
87
89
  ]]),
88
- onClick: p[0] || (p[0] = b(() => {
90
+ onClick: f[0] || (f[0] = y(() => {
89
91
  }, ["stop"]))
90
92
  }, [
91
93
  a("div", {
92
94
  class: o(["default-header uikit-sticky uikit-top-0 uikit-z-10 uikit-rounded-t uikit-border-0 uikit-bg-white uikit-px-4 uikit-pb-10px uikit-pt-20px sm:uikit-px-6", [t.customModalHeaderClasses]])
93
95
  }, [
94
- t.withCloseIcon ? (c(), f(H, {
96
+ t.withCloseIcon ? (c(), b(O, {
95
97
  key: 0,
96
98
  id: "close-icon-btn",
97
99
  "data-cy": "bbt-default-close-icon-btn",
@@ -99,22 +101,22 @@ import '../assets/BaseModal.css';const I = (l, n) => new Promise((s, u) => {
99
101
  type: "button",
100
102
  "aria-label": "Close",
101
103
  "is-empty": !0,
102
- onClick: b(i, ["prevent", "stop"])
104
+ onClick: y(i, ["prevent", "stop"])
103
105
  }, {
104
- default: L(() => [
105
- $(T(O), {
106
+ default: $(() => [
107
+ T(z(I), {
106
108
  class: "bbt-close-icon uikit-box-border uikit-p-5px",
107
109
  width: 30,
108
110
  height: 30
109
111
  })
110
112
  ]),
111
113
  _: 1
112
- }, 8, ["class"])) : y("", !0),
114
+ }, 8, ["class"])) : h("", !0),
113
115
  d(t.$slots, "header", { closeModal: i }, () => [
114
116
  a("span", {
115
117
  class: o(["uikit-w-auto uikit-text-18 uikit-font-semibold sm:uikit-text-22", t.$attrs["title-classes"]]),
116
118
  innerHTML: t.headerTitle
117
- }, null, 10, N)
119
+ }, null, 10, V)
118
120
  ])
119
121
  ], 2),
120
122
  a("div", {
@@ -122,14 +124,14 @@ import '../assets/BaseModal.css';const I = (l, n) => new Promise((s, u) => {
122
124
  }, [
123
125
  d(t.$slots, "body", { closeModal: i })
124
126
  ], 2),
125
- t.$slots.footer ? (c(), z("div", {
127
+ t.$slots.footer ? (c(), H("div", {
126
128
  key: 0,
127
129
  class: o(["uikit-bbt-footer uikit-sticky uikit-bottom-0 uikit-border-0 uikit-bg-white uikit-px-4 uikit-py-15px sm:uikit-px-6", t.customModalFooterClasses])
128
130
  }, [
129
131
  d(t.$slots, "footer", { closeModal: i })
130
- ], 2)) : y("", !0),
132
+ ], 2)) : h("", !0),
131
133
  d(t.$slots, "fixed-bottom")
132
- ], 10, K)
134
+ ], 10, N)
133
135
  ], 2)
134
136
  ]));
135
137
  }
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ import { default as ee } from "./BaseTextarea.js";
28
28
  import { default as re } from "./BaseToggle.js";
29
29
  import { default as te } from "./BaseTooltip.js";
30
30
  import { _ as fe } from "./chunks/BaseUploadFile.vue_vue_type_script_setup_true_lang.Dj2egDaT.js";
31
- import { _ as me } from "./chunks/BaseModal.vue_vue_type_style_index_0_lang.DRnvHI35.js";
31
+ import { _ as me } from "./chunks/BaseModal.vue_vue_type_style_index_0_lang.DSPssuBQ.js";
32
32
  import { default as le } from "./BaseSnackbar.js";
33
33
  import { default as de } from "./StaticSpinner.js";
34
34
  import { default as ue } from "./BaseShimmerLoader.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "1.8.2",
3
+ "version": "1.8.4",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",