@wikicasa-dev/components 2.2.8-alpha.14 → 2.2.8-alpha.15

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,5 +1,5 @@
1
1
  import { Autoplay as t } from "swiper/modules";
2
- import '../assets/swiper-controller.css';/* empty css */
2
+ import '../assets/swiper-thumbs.css';/* empty css */
3
3
  export {
4
4
  t as Autoplay
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import { Controller as e } from "swiper/modules";
2
- import '../assets/swiper-controller.css';/* empty css */
2
+ import '../assets/swiper-thumbs.css';/* empty css */
3
3
  export {
4
4
  e as Controller
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import { Keyboard as m } from "swiper/modules";
2
- import '../assets/swiper-controller.css';/* empty css */
2
+ import '../assets/swiper-thumbs.css';/* empty css */
3
3
  export {
4
4
  m as Keyboard
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import { Thumbs as p } from "swiper/modules";
2
- import '../assets/swiper-controller.css';/* empty css */
2
+ import '../assets/swiper-thumbs.css';/* empty css */
3
3
  export {
4
4
  p as Thumbs
5
5
  };
@@ -1,44 +1,40 @@
1
1
  import { ClassTypeProp } from '../types';
2
- type EventPayload = {
3
- id: string | number;
4
- label: string | number;
5
- checked: boolean;
6
- };
7
- type __VLS_Props = {
8
- id?: string | number;
9
- dataCy?: string;
10
- disabled?: boolean;
11
- /**
12
- * @deprecated Use v-model instead
13
- */
14
- checked?: boolean;
15
- required?: boolean;
16
- inputClass?: ClassTypeProp;
17
- label?: string | number;
18
- modelValue?: boolean;
19
- };
20
- declare function __VLS_template(): {
21
- attrs: Partial<{}>;
2
+ declare const _default: <TID extends string | number, TLabel extends string | number>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
+ readonly "onUpdate:modelValue"?: ((args_0: boolean) => any) | undefined;
5
+ readonly onClick?: ((args_0: MouseEvent) => any) | undefined;
6
+ readonly onChange?: ((args_0: {
7
+ id: TID;
8
+ label: TLabel;
9
+ checked: boolean;
10
+ }) => any) | undefined;
11
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue" | "onClick" | "onChange"> & {
12
+ id?: TID;
13
+ dataCy?: string;
14
+ disabled?: boolean;
15
+ /**
16
+ * @deprecated Use v-model instead
17
+ */
18
+ checked?: boolean;
19
+ required?: boolean;
20
+ inputClass?: ClassTypeProp;
21
+ label?: TLabel;
22
+ modelValue?: boolean;
23
+ } & Partial<{}>> & import('vue').PublicProps;
24
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
25
+ attrs: any;
22
26
  slots: {
23
27
  label?(_: {}): any;
24
28
  };
25
- refs: {};
26
- rootEl: HTMLLabelElement;
29
+ emit: ((evt: "update:modelValue", args_0: boolean) => void) & ((evt: "click", args_0: MouseEvent) => void) & ((evt: "change", args_0: {
30
+ id: TID;
31
+ label: TLabel;
32
+ checked: boolean;
33
+ }) => void);
34
+ }>) => import('vue').VNode & {
35
+ __ctx?: Awaited<typeof __VLS_setup>;
27
36
  };
28
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
29
- declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
30
- "update:modelValue": (args_0: boolean) => any;
31
- click: (args_0: MouseEvent) => any;
32
- change: (args_0: EventPayload) => any;
33
- }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
34
- "onUpdate:modelValue"?: ((args_0: boolean) => any) | undefined;
35
- onClick?: ((args_0: MouseEvent) => any) | undefined;
36
- onChange?: ((args_0: EventPayload) => any) | undefined;
37
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLLabelElement>;
38
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
39
37
  export default _default;
40
- type __VLS_WithTemplateSlots<T, S> = T & {
41
- new (): {
42
- $slots: S;
43
- };
44
- };
38
+ type __VLS_PrettifyLocal<T> = {
39
+ [K in keyof T]: T[K];
40
+ } & {};
@@ -7,9 +7,6 @@ export type CheckboxButtonType<TID = string | number, TLabel = string | number,
7
7
  payload?: TPayload;
8
8
  dataCy?: string;
9
9
  };
10
- export type CheckboxButtonTypeObj = Omit<CheckboxButtonType, "checked"> & {
11
- checked: boolean;
12
- };
13
10
  export type GetterIdType<T = CheckboxButtonType | string | number> = (checkboxBtn: T) => string;
14
11
  export type CheckboxGroupProps<TID = string | number, TLabel = string | number, TPayload = unknown> = {
15
12
  checkboxData?: CheckboxButtonType<TID, TLabel, TPayload>[];
@@ -36,7 +33,7 @@ export type CheckboxGroupProps<TID = string | number, TLabel = string | number,
36
33
  };
37
34
  declare const _default: <TID extends string | number, TLabel extends string | number, TPayload>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
38
35
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
39
- readonly "onUpdate:modelValue"?: ((args_0: CheckboxButtonType<string | number, string | number, unknown>[]) => any) | undefined;
36
+ readonly "onUpdate:modelValue"?: ((args_0: CheckboxButtonType<TID, TLabel, TPayload>[]) => any) | undefined;
40
37
  readonly onResetted?: (() => any) | undefined;
41
38
  readonly onCheckedGroup?: ((args_0: string) => any) | undefined;
42
39
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue" | "onResetted" | "onCheckedGroup"> & CheckboxGroupProps<TID, TLabel, TPayload> & Partial<{}>> & import('vue').PublicProps;
@@ -44,18 +41,18 @@ declare const _default: <TID extends string | number, TLabel extends string | nu
44
41
  attrs: any;
45
42
  slots: {
46
43
  default?(_: {
47
- isActive: (elem: CheckboxButtonType | string | number) => boolean;
48
- handleChange: (checkboxValue: CheckboxButtonType) => void;
44
+ isActive: (elem: CheckboxButtonType<TID, TLabel, TPayload> | string | number) => boolean;
45
+ handleChange: (checkboxValue: CheckboxButtonType<TID, TLabel, TPayload>) => void;
49
46
  checkboxesData: CheckboxButtonType<TID, TLabel, TPayload>[];
50
47
  }): any;
51
48
  checkbox_elements?(_: {
52
- isActive: (elem: CheckboxButtonType | string | number) => boolean;
53
- handleChange: (checkboxValue: CheckboxButtonType) => void;
49
+ isActive: (elem: CheckboxButtonType<TID, TLabel, TPayload> | string | number) => boolean;
50
+ handleChange: (checkboxValue: CheckboxButtonType<TID, TLabel, TPayload>) => void;
54
51
  checkboxesData: CheckboxButtonType<TID, TLabel, TPayload>[];
55
52
  reset: () => void;
56
53
  }): any;
57
54
  };
58
- emit: ((evt: "update:modelValue", args_0: CheckboxButtonType<string | number, string | number, unknown>[]) => void) & ((evt: "resetted") => void) & ((evt: "checkedGroup", args_0: string) => void);
55
+ emit: ((evt: "update:modelValue", args_0: CheckboxButtonType<TID, TLabel, TPayload>[]) => void) & ((evt: "resetted") => void) & ((evt: "checkedGroup", args_0: string) => void);
59
56
  }>) => import('vue').VNode & {
60
57
  __ctx?: Awaited<typeof __VLS_setup>;
61
58
  };
@@ -14,7 +14,7 @@ const N = ["for"], j = /* @__PURE__ */ m({
14
14
  label: { default: "" },
15
15
  modelValue: { type: Boolean, default: !1 }
16
16
  },
17
- emits: ["click", "change", "update:modelValue"],
17
+ emits: ["click", "update:modelValue", "change"],
18
18
  setup(e, { emit: r }) {
19
19
  const l = f(), d = h(() => `${e.id ?? l}`), a = r;
20
20
  b(
@@ -40,7 +40,7 @@ const N = ["for"], j = /* @__PURE__ */ m({
40
40
  "model-value": e.modelValue,
41
41
  "data-cy": e.dataCy,
42
42
  disabled: e.disabled,
43
- class: y(["data-[state='unchecked']:uikit-border-w-lightgray uikit-inline-flex uikit-size-[20px] uikit-items-center uikit-justify-center uikit-rounded-[4px] uikit-p-0 data-[state='unchecked']:uikit-border data-[state='unchecked']:uikit-border-solid", [
43
+ class: y(["uikit-inline-flex uikit-size-[20px] uikit-items-center uikit-justify-center uikit-rounded-[4px] uikit-p-0 data-[state='unchecked']:uikit-border data-[state='unchecked']:uikit-border-solid data-[state='unchecked']:uikit-border-w-lightgray", [
44
44
  {
45
45
  "uikit-bg-white": !e.modelValue,
46
46
  "uikit-bg-w-primary": e.modelValue
@@ -1,7 +1,7 @@
1
- import { defineComponent as x, ref as p, computed as h, watch as v, renderSlot as b, createElementVNode as D, normalizeClass as E, createElementBlock as $, createCommentVNode as B, openBlock as g, Fragment as A, renderList as I, createBlock as R, unref as K } from "vue";
2
- import { stringToHyphened as V, isArrNullOrEmpty as L } from "@wikicasa-dev/utilities";
3
- import G from "./CheckboxBtn.vue.js";
4
- const N = ["id", "data-cy"], O = /* @__PURE__ */ x({
1
+ import { defineComponent as p, ref as v, computed as h, watch as D, renderSlot as b, createElementVNode as E, normalizeClass as $, createElementBlock as B, createCommentVNode as A, openBlock as g, Fragment as I, renderList as R, createBlock as K, unref as V } from "vue";
2
+ import { stringToHyphened as L, isArrNullOrEmpty as G } from "@wikicasa-dev/utilities";
3
+ import N from "./CheckboxBtn.vue.js";
4
+ const T = ["id", "data-cy"], S = /* @__PURE__ */ p({
5
5
  inheritAttrs: !1,
6
6
  __name: "CheckboxGroup",
7
7
  props: {
@@ -14,36 +14,38 @@ const N = ["id", "data-cy"], O = /* @__PURE__ */ x({
14
14
  autoCheckResetAll: { type: Boolean, default: !1 },
15
15
  autoCheckResetEmpty: { type: Boolean, default: !1 },
16
16
  manualToggleResetButton: { type: Boolean, default: !1 },
17
- getKey: { type: Function, default: (t) => typeof t == "string" || typeof t == "number" ? `${t}` : `${t.id}` },
17
+ getKey: { type: Function, default: (a) => typeof a == "string" || typeof a == "number" ? `${a}` : `${a.id}` },
18
18
  groupId: { default: "" },
19
19
  dataCy: { default: "" }
20
20
  },
21
21
  emits: ["resetted", "update:modelValue", "checkedGroup"],
22
- setup(t, { emit: C }) {
23
- const o = t, s = C, l = p(/* @__PURE__ */ new Map()), r = h(() => {
22
+ setup(a, { emit: C }) {
23
+ const o = a, s = C, l = v(
24
+ /* @__PURE__ */ new Map()
25
+ ), r = h(() => {
24
26
  for (const e of o.checkboxData)
25
27
  if (e.reset) return e;
26
28
  return null;
27
29
  }), y = h(() => o.checkboxData.length), f = h(() => {
28
30
  let e = 0;
29
- return l.value.forEach((a) => {
30
- a.checked && e++;
31
+ return l.value.forEach((t) => {
32
+ t.checked && e++;
31
33
  }), e;
32
34
  });
33
35
  (() => {
34
36
  const e = [];
35
- for (const a of o.checkboxData)
36
- a.checked = !!a.checked, l.value.set(
37
- `${a.id}`,
38
- a
39
- ), a.checked && e.push(a);
37
+ for (const t of o.checkboxData)
38
+ l.value.set(`${t.id}`, {
39
+ ...t,
40
+ checked: !!t.checked
41
+ }), t.checked && e.push(t);
40
42
  s("update:modelValue", e);
41
43
  })();
42
- const u = (e, a) => {
44
+ const u = (e, t) => {
43
45
  const c = l.value.get(e);
44
46
  if (c) {
45
- if (a) {
46
- l.value.set(e, { ...c, ...a });
47
+ if (t) {
48
+ l.value.set(e, { ...c, ...t });
47
49
  return;
48
50
  }
49
51
  l.value.set(e, { ...c, checked: !c.checked });
@@ -55,55 +57,55 @@ const N = ["id", "data-cy"], O = /* @__PURE__ */ x({
55
57
  }, m = () => {
56
58
  k(), s("update:modelValue", []), s("resetted");
57
59
  }, d = (e) => l.value.get(o.getKey(e))?.checked ?? !1, i = (e) => {
58
- if (L(o.checkboxData)) return;
59
- const a = l.value.get(e.id);
60
- a?.reset && e.checked ? k() : r.value && !a?.reset && u(o.getKey(r.value), { checked: !1 }), u(`${e.id}`), o.autoCheckResetAll && r.value && f.value === y.value - 1 && l.value.forEach((n) => {
60
+ if (G(o.checkboxData)) return;
61
+ const t = l.value.get(e.id);
62
+ t?.reset && e.checked ? k() : r.value && !t?.reset && u(o.getKey(r.value), { checked: !1 }), u(`${e.id}`), o.autoCheckResetAll && r.value && f.value === y.value - 1 && l.value.forEach((n) => {
61
63
  n.checked = !!n.reset;
62
- }), o.autoCheckResetEmpty && r.value && !f.value && (!o.manualToggleResetButton || !a?.reset) && u(o.getKey(r.value), { checked: !0 });
64
+ }), o.autoCheckResetEmpty && r.value && !f.value && (!o.manualToggleResetButton || !t?.reset) && u(o.getKey(r.value), { checked: !0 });
63
65
  const c = [];
64
66
  l.value.forEach((n) => {
65
67
  n.checked && c.push(n);
66
68
  }), s("update:modelValue", c), s("checkedGroup", o.groupId);
67
69
  };
68
- return v(
70
+ return D(
69
71
  () => o.reset,
70
72
  (e) => {
71
73
  e && m();
72
74
  }
73
- ), (e, a) => b(e.$slots, "default", {
75
+ ), (e, t) => b(e.$slots, "default", {
74
76
  isActive: d,
75
77
  handleChange: i,
76
- checkboxesData: t.checkboxData
78
+ checkboxesData: a.checkboxData
77
79
  }, () => [
78
- D("div", {
79
- id: t.groupId,
80
- class: E(["checkbox-group-container", e.$attrs.class || ""]),
81
- "data-cy": t.dataCy
80
+ E("div", {
81
+ id: a.groupId,
82
+ class: $(["checkbox-group-container", e.$attrs.class || ""]),
83
+ "data-cy": a.dataCy
82
84
  }, [
83
85
  b(e.$slots, "checkbox_elements", {
84
86
  isActive: d,
85
87
  handleChange: i,
86
- checkboxesData: t.checkboxData,
88
+ checkboxesData: a.checkboxData,
87
89
  reset: m
88
90
  }, () => [
89
- t.checkboxData ? (g(!0), $(A, { key: 0 }, I(t.checkboxData, (c, n) => (g(), R(G, {
90
- id: t.getKey(c),
91
+ a.checkboxData ? (g(!0), B(I, { key: 0 }, R(a.checkboxData, (c, n) => (g(), K(N, {
92
+ id: a.getKey(c),
91
93
  key: n,
92
- "data-cy": c.dataCy ?? `checkbox_${K(V)(`${c.label}`)}`,
94
+ "data-cy": c.dataCy ?? `checkbox_${V(L)(`${c.label}`)}`,
93
95
  label: c.label,
94
- inline: t.formCheckInline,
96
+ inline: a.formCheckInline,
95
97
  "model-value": d(c),
96
98
  "container-class": [
97
- t.formCheckInline ? "uikit-mr-10px" : "uikit-mb-10px",
98
- t.checkboxContainerClasses
99
+ a.formCheckInline ? "uikit-mr-10px" : "uikit-mb-10px",
100
+ a.checkboxContainerClasses
99
101
  ],
100
- onChange: i
101
- }, null, 8, ["id", "data-cy", "label", "inline", "model-value", "container-class"]))), 128)) : B("", !0)
102
+ onChange: t[0] || (t[0] = (x) => i(x))
103
+ }, null, 8, ["id", "data-cy", "label", "inline", "model-value", "container-class"]))), 128)) : A("", !0)
102
104
  ])
103
- ], 10, N)
105
+ ], 10, T)
104
106
  ]);
105
107
  }
106
108
  });
107
109
  export {
108
- O as default
110
+ S as default
109
111
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.2.8-alpha.14",
3
+ "version": "2.2.8-alpha.15",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",