@wikicasa-dev/components 1.2.53 → 1.2.54

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,59 +1,4 @@
1
- import { defineComponent as r, openBlock as a, createElementBlock as l, normalizeClass as n, withModifiers as o, createElementVNode as s, createTextVNode as d, toDisplayString as u } from "vue";
2
- import { _ as k } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
3
- const h = r({
4
- name: "RadioButton",
5
- inheritAttrs: !1,
6
- props: {
7
- label: { type: [String, Boolean], required: !0 },
8
- isChecked: { type: Boolean }
9
- },
10
- emits: ["change"],
11
- methods: {
12
- emitChange() {
13
- this.$emit("change", {
14
- id: this.$attrs.id,
15
- label: this.label,
16
- name: this.$attrs.name
17
- });
18
- },
19
- handleClick() {
20
- const i = this.$refs.checkbox;
21
- i.checked = !i.checked, this.emitChange();
22
- },
23
- handleOnInput() {
24
- this.emitChange();
25
- }
26
- }
27
- }), c = ["id", "value", "name", "checked"], m = ["for"];
28
- function p(i, e, b, f, C, $) {
29
- return a(), l("div", {
30
- class: n([i.$attrs.class, "uikit-mb-4 uikit-mr-4 uikit-inline-block"]),
31
- onClick: e[1] || (e[1] = o((...t) => i.handleClick && i.handleClick(...t), ["stop"]))
32
- }, [
33
- s("input", {
34
- id: i.$attrs.id,
35
- ref: "checkbox",
36
- type: "radio",
37
- class: "uikit-hidden",
38
- value: i.label,
39
- name: i.$attrs.name,
40
- checked: i.isChecked,
41
- onChange: e[0] || (e[0] = o((...t) => i.handleOnInput && i.handleOnInput(...t), ["stop"]))
42
- }, null, 40, c),
43
- s("label", {
44
- class: n([i.$attrs["label-classes"], "uikit-flex uikit-cursor-pointer uikit-items-center uikit-text-sm"]),
45
- for: i.$attrs.id
46
- }, [
47
- s("span", {
48
- class: n(["uikit-flex-no-shrink uikit-mr-2 uikit-inline-block uikit-h-4 uikit-w-4 uikit-transform uikit-rounded-full uikit-border uikit-border-solid uikit-border-w-secondary uikit-transition-colors uikit-duration-200", {
49
- "uikit-border-w-primary uikit-bg-w-primary uikit-shadow-[0_0_0_2px_white_inset]": i.isChecked
50
- }])
51
- }, null, 2),
52
- d(" " + u(i.label), 1)
53
- ], 10, m)
54
- ], 2);
55
- }
56
- const y = /* @__PURE__ */ k(h, [["render", p]]);
1
+ import { _ as f } from "./chunks/RadioButton.vue_vue_type_script_setup_true_lang.CJE9e0tE.js";
57
2
  export {
58
- y as default
3
+ f as default
59
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./chunks/RadioGroup.vue_vue_type_script_setup_true_lang.DqQlcQd2.js";
1
+ import { _ as f } from "./chunks/RadioGroup.vue_vue_type_script_setup_true_lang.C2qvBRnU.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,26 +1,43 @@
1
- declare const _default: import("vue").DefineComponent<{
2
- label: {
3
- type: (BooleanConstructor | StringConstructor)[];
4
- required: true;
5
- };
6
- isChecked: {
7
- type: BooleanConstructor;
8
- };
9
- }, unknown, unknown, {}, {
10
- emitChange(): void;
11
- handleClick(): void;
12
- handleOnInput(): void;
13
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "change"[], "change", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
14
- label: {
15
- type: (BooleanConstructor | StringConstructor)[];
16
- required: true;
17
- };
18
- isChecked: {
19
- type: BooleanConstructor;
20
- };
21
- }>> & {
22
- onChange?: ((...args: any[]) => any) | undefined;
1
+ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
2
+ label: string;
3
+ isChecked?: boolean | undefined;
4
+ }>, {
5
+ isChecked: boolean;
6
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
+ change: (args_0: {
8
+ id: string;
9
+ label: string;
10
+ name: string;
11
+ }) => void;
12
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
13
+ label: string;
14
+ isChecked?: boolean | undefined;
15
+ }>, {
16
+ isChecked: boolean;
17
+ }>>> & {
18
+ onChange?: ((args_0: {
19
+ id: string;
20
+ label: string;
21
+ name: string;
22
+ }) => any) | undefined;
23
23
  }, {
24
24
  isChecked: boolean;
25
25
  }, {}>;
26
26
  export default _default;
27
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
28
+ type __VLS_TypePropsToRuntimeProps<T> = {
29
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
30
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
31
+ } : {
32
+ type: import('vue').PropType<T[K]>;
33
+ required: true;
34
+ };
35
+ };
36
+ type __VLS_WithDefaults<P, D> = {
37
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
38
+ default: D[K];
39
+ }> : P[K];
40
+ };
41
+ type __VLS_Prettify<T> = {
42
+ [K in keyof T]: T[K];
43
+ } & {};
@@ -0,0 +1,54 @@
1
+ import { defineComponent as d, ref as h, openBlock as m, createElementBlock as p, normalizeClass as t, withModifiers as a, createElementVNode as s, createTextVNode as b, toDisplayString as f, useAttrs as C } from "vue";
2
+ const _ = ["id", "value", "name", "checked"], w = ["for"], v = /* @__PURE__ */ d({
3
+ inheritAttrs: !1,
4
+ __name: "RadioButton",
5
+ props: {
6
+ label: {},
7
+ isChecked: { type: Boolean, default: !1 }
8
+ },
9
+ emits: ["change"],
10
+ setup(o, { emit: r }) {
11
+ const l = o, u = r, n = () => {
12
+ const e = C();
13
+ u("change", {
14
+ id: e.id,
15
+ label: l.label,
16
+ name: e.name
17
+ });
18
+ }, i = h(null), c = () => {
19
+ i.value && (i.value.checked = !i.value.checked, n());
20
+ }, k = () => {
21
+ n();
22
+ };
23
+ return (e, y) => (m(), p("div", {
24
+ class: t([e.$attrs.class, "uikit-mb-4 uikit-mr-4 uikit-inline-block"]),
25
+ onClick: a(c, ["stop"])
26
+ }, [
27
+ s("input", {
28
+ id: e.$attrs.id,
29
+ ref_key: "checkbox",
30
+ ref: i,
31
+ type: "radio",
32
+ class: "uikit-hidden",
33
+ value: e.label,
34
+ name: e.$attrs.name,
35
+ checked: e.isChecked,
36
+ onChange: a(k, ["stop"])
37
+ }, null, 40, _),
38
+ s("label", {
39
+ class: t([e.$attrs["label-classes"], "uikit-flex uikit-cursor-pointer uikit-items-center uikit-text-sm"]),
40
+ for: e.$attrs.id
41
+ }, [
42
+ s("span", {
43
+ class: t(["uikit-flex-no-shrink uikit-mr-2 uikit-inline-block uikit-h-4 uikit-w-4 uikit-transform uikit-rounded-full uikit-border uikit-border-solid uikit-border-w-secondary uikit-transition-colors uikit-duration-200", {
44
+ "uikit-border-w-primary uikit-bg-w-primary uikit-shadow-[0_0_0_2px_white_inset]": e.isChecked
45
+ }])
46
+ }, null, 2),
47
+ b(" " + f(e.label), 1)
48
+ ], 10, w)
49
+ ], 2));
50
+ }
51
+ });
52
+ export {
53
+ v as _
54
+ };
@@ -1,6 +1,6 @@
1
- import { defineComponent as p, ref as f, watch as h, onBeforeMount as v, renderSlot as i, createElementVNode as V, normalizeClass as k, openBlock as u, createElementBlock as B, Fragment as C, renderList as b, createBlock as y } from "vue";
2
- import _ from "../RadioButton.js";
3
- const $ = ["data-cy"], E = /* @__PURE__ */ p({
1
+ import { defineComponent as p, ref as f, watch as h, onBeforeMount as v, renderSlot as o, createElementVNode as V, normalizeClass as k, openBlock as u, createElementBlock as _, Fragment as C, renderList as $, createBlock as b } from "vue";
2
+ import { _ as y } from "./RadioButton.vue_vue_type_script_setup_true_lang.CJE9e0tE.js";
3
+ const B = ["data-cy"], E = /* @__PURE__ */ p({
4
4
  inheritAttrs: !1,
5
5
  __name: "RadioGroup",
6
6
  props: {
@@ -14,7 +14,7 @@ const $ = ["data-cy"], E = /* @__PURE__ */ p({
14
14
  a.value = e, r("update:modelValue", e);
15
15
  }, n = () => {
16
16
  a.value = null;
17
- }, s = (e) => a.value ? a.value.id === e.id : !1;
17
+ }, i = (e) => a.value ? a.value.id === e.id : !1;
18
18
  return h(
19
19
  () => l.resetRadio,
20
20
  (e) => {
@@ -22,31 +22,31 @@ const $ = ["data-cy"], E = /* @__PURE__ */ p({
22
22
  }
23
23
  ), v(() => {
24
24
  l.initialValue && t(l.initialValue);
25
- }), (e, g) => i(e.$slots, "default", {
25
+ }), (e, g) => o(e.$slots, "default", {
26
26
  handleClick: t,
27
27
  activeValue: a.value,
28
28
  reset: n,
29
- isActive: s
29
+ isActive: i
30
30
  }, () => [
31
31
  V("div", {
32
32
  class: k(["radio-group-container", e.$attrs.class || ""]),
33
33
  "data-cy": e.$attrs["data-cy"] || ""
34
34
  }, [
35
- i(e.$slots, "radio_elements", {
35
+ o(e.$slots, "radio_elements", {
36
36
  handleClick: t,
37
37
  activeValue: a.value,
38
38
  reset: n,
39
- isActive: s
39
+ isActive: i
40
40
  }, () => [
41
- (u(!0), B(C, null, b(e.radioValues, (o, m) => (u(), y(_, {
42
- id: o.id,
41
+ (u(!0), _(C, null, $(e.radioValues, (s, m) => (u(), b(y, {
42
+ id: s.id,
43
43
  key: m,
44
- label: `${o.label}`,
45
- "is-checked": o.label === a.value?.label,
44
+ label: `${s.label}`,
45
+ "is-checked": s.label === a.value?.label,
46
46
  onChange: t
47
47
  }, null, 8, ["id", "label", "is-checked"]))), 128))
48
48
  ])
49
- ], 10, $)
49
+ ], 10, B)
50
50
  ]);
51
51
  }
52
52
  });
package/dist/index.js CHANGED
@@ -6,8 +6,8 @@ import { _ as m } from "./chunks/BaseAccordionItem.vue_vue_type_script_setup_tru
6
6
  import { _ as l } from "./chunks/SelectItem.vue_vue_type_script_setup_true_lang.BOLdDTLM.js";
7
7
  import { default as B } from "./CheckboxBtn.js";
8
8
  import { _ as n } from "./chunks/CheckboxGroup.vue_vue_type_script_setup_true_lang.DDtN9_Bg.js";
9
- import { default as c } from "./RadioButton.js";
10
- import { _ as b } from "./chunks/RadioGroup.vue_vue_type_script_setup_true_lang.DqQlcQd2.js";
9
+ import { _ as c } from "./chunks/RadioButton.vue_vue_type_script_setup_true_lang.CJE9e0tE.js";
10
+ import { _ as b } from "./chunks/RadioGroup.vue_vue_type_script_setup_true_lang.C2qvBRnU.js";
11
11
  import { _ as A } from "./chunks/AccessibleSelect.vue_vue_type_script_setup_true_lang.lyHlWiC5.js";
12
12
  import { _ as C } from "./chunks/BaseAlert.vue_vue_type_script_setup_true_lang.HqYdk4yE.js";
13
13
  import { _ as T } from "./chunks/BaseAutocomplete.vue_vue_type_script_setup_true_lang.3aynnDI5.js";
@@ -1,4 +1,4 @@
1
- import { reactive as s, onBeforeMount as o, onUnmounted as t, toRefs as r } from "vue";
1
+ import { reactive as s, onBeforeMount as t, onUnmounted as o, toRefs as r } from "vue";
2
2
  var i = /* @__PURE__ */ ((e) => (e[e.SMALL = 576] = "SMALL", e[e.MEDIUM = 768] = "MEDIUM", e[e.LARGE = 992] = "LARGE", e[e.EXTRA_LARGE = 1200] = "EXTRA_LARGE", e))(i || {});
3
3
  function d() {
4
4
  const e = s({
@@ -10,9 +10,9 @@ function d() {
10
10
  }), n = () => {
11
11
  e.isDesktopMode = window.innerWidth > i.SMALL, e.isSmall = window.innerWidth <= i.SMALL, e.isMedium = window.innerWidth > i.SMALL, e.isLarge = window.innerWidth > i.MEDIUM, e.isExtraLarge = window.innerWidth > i.LARGE;
12
12
  };
13
- return o(() => {
13
+ return t(() => {
14
14
  n(), window.addEventListener("resize", n);
15
- }), t(() => {
15
+ }), o(() => {
16
16
  window.removeEventListener("resize", n);
17
17
  }), r(e);
18
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "1.2.53",
3
+ "version": "1.2.54",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -51,7 +51,7 @@
51
51
  "@storybook/vue3-vite": "^8.0.2",
52
52
  "@types/node": "^20.5.0",
53
53
  "@vitejs/plugin-vue": "^5.0.4",
54
- "@wikicasa-dev/types": "^0.9.2",
54
+ "@wikicasa-dev/types": "^1.0.2",
55
55
  "@wikicasa-dev/utilities": "^0.2.1",
56
56
  "@wikicasa-dev/svg-icons": "^0.0.1",
57
57
  "@wikicasa-dev/vue-composables": "^0.0.3",