@wikicasa-dev/components 2.3.1-alpha.14 → 2.3.1-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,11 +1,15 @@
1
1
  import { TabsRootProps } from 'reka-ui';
2
- export interface BaseTabsProps<T extends string | number> extends TabsRootProps<T> {
2
+ export interface BaseTabsProps<T extends string | number> extends Omit<TabsRootProps<T>, "modelValue"> {
3
3
  dataCy?: string;
4
4
  }
5
5
  declare const _default: <T 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<{
6
6
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
7
- readonly "onUpdate:modelValue"?: ((payload: T) => any) | undefined;
8
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue"> & BaseTabsProps<T> & Partial<{}>> & import('vue').PublicProps;
7
+ readonly "onUpdate:modelValue"?: ((value: T) => any) | undefined;
8
+ readonly "onUpdate:activeIdx"?: ((value: number) => any) | undefined;
9
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue" | "onUpdate:activeIdx"> & ({
10
+ modelValue?: T;
11
+ activeIdx?: number;
12
+ } & BaseTabsProps<T>) & Partial<{}>> & import('vue').PublicProps;
9
13
  expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
10
14
  attrs: any;
11
15
  slots: {
@@ -13,7 +17,7 @@ declare const _default: <T extends string | number>(__VLS_props: NonNullable<Awa
13
17
  modelValue: T;
14
18
  }): any;
15
19
  };
16
- emit: (evt: "update:modelValue", payload: T) => void;
20
+ emit: ((evt: "update:modelValue", value: T) => void) & ((evt: "update:activeIdx", value: number) => void);
17
21
  }>) => import('vue').VNode & {
18
22
  __ctx?: Awaited<typeof __VLS_setup>;
19
23
  };
@@ -1,13 +1,20 @@
1
1
  import { TabsTriggerProps } from 'reka-ui';
2
- export interface BaseTabsTriggerProps extends TabsTriggerProps {
2
+ export interface BaseTabsTriggerProps<T extends string | number> extends Omit<TabsTriggerProps, "value"> {
3
3
  dataCy?: string;
4
+ value: T;
4
5
  }
5
- declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<BaseTabsTriggerProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<BaseTabsTriggerProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, {
6
- default?(_: {}): any;
7
- }>;
8
- export default _default;
9
- type __VLS_WithTemplateSlots<T, S> = T & {
10
- new (): {
11
- $slots: S;
6
+ declare const _default: <T 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<{
7
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, never> & BaseTabsTriggerProps<T> & Partial<{}>> & import('vue').PublicProps;
8
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
9
+ attrs: any;
10
+ slots: {
11
+ default?(_: {}): any;
12
12
  };
13
+ emit: {};
14
+ }>) => import('vue').VNode & {
15
+ __ctx?: Awaited<typeof __VLS_setup>;
13
16
  };
17
+ export default _default;
18
+ type __VLS_PrettifyLocal<T> = {
19
+ [K in keyof T]: T[K];
20
+ } & {};
@@ -1,33 +1,59 @@
1
- import { defineComponent as l, createPropsRestProxy as s, createBlock as u, openBlock as m, unref as i, mergeProps as p, withCtx as c, renderSlot as f } from "vue";
2
- import { TabsRoot as y } from "reka-ui";
3
- const V = /* @__PURE__ */ l({
1
+ import { defineComponent as p, mergeModels as x, createPropsRestProxy as y, useModel as i, shallowRef as V, provide as n, watch as s, createBlock as B, openBlock as T, unref as I, mergeProps as C, withCtx as M, renderSlot as h } from "vue";
2
+ import { TabsRoot as w } from "reka-ui";
3
+ const b = /* @__PURE__ */ p({
4
4
  __name: "BaseTabs",
5
- props: {
5
+ props: /* @__PURE__ */ x({
6
6
  dataCy: {},
7
7
  defaultValue: {},
8
8
  orientation: {},
9
9
  dir: {},
10
10
  activationMode: {},
11
- modelValue: {},
12
11
  unmountOnHide: { type: Boolean },
13
12
  asChild: { type: Boolean },
14
13
  as: {}
15
- },
16
- emits: ["update:modelValue"],
17
- setup(t, { emit: o }) {
18
- const d = o, n = s(t, ["dataCy"]);
19
- return (r, a) => (m(), u(i(y), p({ "data-cy": t.dataCy }, n, {
20
- "onUpdate:modelValue": a[0] || (a[0] = (e) => d("update:modelValue", e))
14
+ }, {
15
+ modelValue: {},
16
+ modelModifiers: {},
17
+ activeIdx: { default: -1 },
18
+ activeIdxModifiers: {}
19
+ }),
20
+ emits: ["update:modelValue", "update:activeIdx"],
21
+ setup(l) {
22
+ const c = y(l, ["dataCy"]), a = i(l, "modelValue"), o = i(l, "activeIdx"), r = V([]), g = (t) => {
23
+ const e = r.value.length;
24
+ r.value.push({
25
+ idx: e,
26
+ value: t
27
+ }), d(o.value);
28
+ }, v = (t) => {
29
+ r.value = r.value.filter(
30
+ (e) => e.value !== t
31
+ );
32
+ }, m = (t) => r.value.find((e) => e.value === t), d = (t) => {
33
+ const e = r.value[t];
34
+ !e || e.value === a.value || (a.value = e.value);
35
+ }, f = (t) => {
36
+ const e = m(t);
37
+ !e || e.value === a.value || (o.value = e.idx);
38
+ };
39
+ return n("registerTrigger", g), n("unregisterTrigger", v), s(a, (t) => {
40
+ f(t);
41
+ }), s(o, (t) => {
42
+ d(t);
43
+ }), (t, e) => (T(), B(I(w), C(c, {
44
+ modelValue: a.value,
45
+ "onUpdate:modelValue": e[0] || (e[0] = (u) => a.value = u),
46
+ "data-cy": l.dataCy
21
47
  }), {
22
- default: c(({ modelValue: e }) => [
23
- f(r.$slots, "default", {
24
- modelValue: e
48
+ default: M(({ modelValue: u }) => [
49
+ h(t.$slots, "default", {
50
+ modelValue: u
25
51
  })
26
52
  ]),
27
53
  _: 3
28
- }, 16, ["data-cy"]));
54
+ }, 16, ["modelValue", "data-cy"]));
29
55
  }
30
56
  });
31
57
  export {
32
- V as default
58
+ b as default
33
59
  };
@@ -1,6 +1,6 @@
1
- import { defineComponent as o, createPropsRestProxy as r, createBlock as s, openBlock as i, unref as d, mergeProps as n, withCtx as l, renderSlot as p } from "vue";
2
- import { TabsTrigger as c } from "reka-ui";
3
- const y = /* @__PURE__ */ o({
1
+ import { defineComponent as s, createPropsRestProxy as n, inject as r, onMounted as d, onUnmounted as g, createBlock as u, openBlock as c, unref as l, mergeProps as p, withCtx as m, renderSlot as f } from "vue";
2
+ import { TabsTrigger as y } from "reka-ui";
3
+ const C = /* @__PURE__ */ s({
4
4
  __name: "BaseTabsTrigger",
5
5
  props: {
6
6
  dataCy: {},
@@ -10,15 +10,25 @@ const y = /* @__PURE__ */ o({
10
10
  as: {}
11
11
  },
12
12
  setup(t) {
13
- const e = r(t, ["dataCy"]);
14
- return (a, u) => (i(), s(d(c), n({ "data-cy": t.dataCy }, e, { class: "uikit-bg-white uikit-p-[4px] uikit-text-16 data-[state=active]:uikit-font-semibold" }), {
15
- default: l(() => [
16
- p(a.$slots, "default")
13
+ const e = n(t, ["dataCy"]), a = r(
14
+ "registerTrigger",
15
+ void 0
16
+ ), o = r(
17
+ "unregisterTrigger",
18
+ void 0
19
+ );
20
+ return d(() => {
21
+ a?.(e.value);
22
+ }), g(() => {
23
+ o?.(e.value);
24
+ }), (i, T) => (c(), u(l(y), p({ "data-cy": t.dataCy }, e, { class: "uikit-bg-white uikit-p-[4px] uikit-text-16 data-[state=active]:uikit-font-semibold" }), {
25
+ default: m(() => [
26
+ f(i.$slots, "default")
17
27
  ]),
18
28
  _: 3
19
29
  }, 16, ["data-cy"]));
20
30
  }
21
31
  });
22
32
  export {
23
- y as default
33
+ C as default
24
34
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.3.1-alpha.14",
3
+ "version": "2.3.1-alpha.15",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",