@wikicasa-dev/components 2.2.8-alpha.10 → 2.2.8-alpha.12

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-autoplay.css';/* empty css */
2
+ import '../assets/swiper-keyboard.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-autoplay.css';/* empty css */
2
+ import '../assets/swiper-keyboard.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-autoplay.css';/* empty css */
2
+ import '../assets/swiper-keyboard.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-autoplay.css';/* empty css */
2
+ import '../assets/swiper-keyboard.css';/* empty css */
3
3
  export {
4
4
  p as Thumbs
5
5
  };
@@ -17,12 +17,16 @@ declare const _default: <TID extends string | number | undefined, TPayload>(__VL
17
17
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
18
18
  readonly "onUpdate:modelValue"?: ((value: Nullable<AccessibleSelectOptions<TPayload, TID>>) => any) | undefined;
19
19
  readonly onClick?: (() => any) | undefined;
20
+ readonly onKeydown?: ((args_0: KeyboardEvent) => any) | undefined;
20
21
  readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
21
- } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue" | "onClick" | "onUpdate:open"> & ({
22
+ readonly "onUpdate:inputValue"?: ((args_0: string) => any) | undefined;
23
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue" | "onClick" | "onKeydown" | "onUpdate:open" | "onUpdate:inputValue"> & ({
22
24
  open?: boolean;
23
25
  modelValue?: Nullable<AccessibleSelectOptions<TPayload, TID>>;
24
26
  } & ClearableAutocompleteProps<TID, TPayload>) & Partial<{}>> & import('vue').PublicProps;
25
- expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
27
+ expose(exposed: import('vue').ShallowUnwrapRef<{
28
+ select: () => void;
29
+ }>): void;
26
30
  attrs: any;
27
31
  slots: {
28
32
  'left-icon'?(_: {}): any;
@@ -33,7 +37,7 @@ declare const _default: <TID extends string | number | undefined, TPayload>(__VL
33
37
  idx: number;
34
38
  }): any;
35
39
  };
36
- emit: ((evt: "click") => void) & (((evt: "update:modelValue", value: Nullable<AccessibleSelectOptions<TPayload, TID>>) => void) & ((evt: "update:open", value: boolean) => void));
40
+ emit: (((evt: "click") => void) & ((evt: "keydown", args_0: KeyboardEvent) => void) & ((evt: "update:inputValue", args_0: string) => void)) & (((evt: "update:modelValue", value: Nullable<AccessibleSelectOptions<TPayload, TID>>) => void) & ((evt: "update:open", value: boolean) => void));
37
41
  }>) => import('vue').VNode & {
38
42
  __ctx?: Awaited<typeof __VLS_setup>;
39
43
  };
@@ -1,11 +1,11 @@
1
- import { defineComponent as F, mergeModels as S, useModel as g, shallowRef as r, useTemplateRef as M, onBeforeMount as L, watch as m, nextTick as N, createBlock as $, openBlock as p, withCtx as C, createElementBlock as V, Fragment as O, renderList as U, renderSlot as c, createElementVNode as d, normalizeClass as v, withDirectives as D, createCommentVNode as E, vModelText as H, toDisplayString as K, normalizeStyle as A, createTextVNode as P } from "vue";
2
- import X from "../BaseDropDown.vue.js";
1
+ import { defineComponent as L, mergeModels as M, useModel as V, useTemplateRef as C, shallowRef as r, onBeforeMount as N, watch as b, nextTick as O, createBlock as $, openBlock as p, withCtx as y, createElementBlock as B, Fragment as U, renderList as D, renderSlot as c, createElementVNode as d, normalizeClass as v, withDirectives as H, createCommentVNode as A, vModelText as P, toDisplayString as X, normalizeStyle as j, createTextVNode as q } from "vue";
2
+ import G from "../BaseDropDown.vue.js";
3
3
  import '../../../../../assets/BaseDropDown.css';/* empty css */
4
- import j from "../BaseSelect/SelectItem.vue.js";
5
- import { debounce as q } from "@wikicasa-dev/utilities";
6
- const G = ["readonly", "placeholder"], J = ["innerHTML"], te = /* @__PURE__ */ F({
4
+ import J from "../BaseSelect/SelectItem.vue.js";
5
+ import { debounce as Q } from "@wikicasa-dev/utilities";
6
+ const Y = ["readonly", "placeholder"], Z = ["innerHTML"], oe = /* @__PURE__ */ L({
7
7
  __name: "ClearableAutocomplete",
8
- props: /* @__PURE__ */ S({
8
+ props: /* @__PURE__ */ M({
9
9
  dataCy: {},
10
10
  placeholder: {},
11
11
  triggerWrapperClasses: {},
@@ -22,52 +22,56 @@ const G = ["readonly", "placeholder"], J = ["innerHTML"], te = /* @__PURE__ */ F
22
22
  modelValue: { default: null },
23
23
  modelModifiers: {}
24
24
  }),
25
- emits: /* @__PURE__ */ S(["click"], ["update:open", "update:modelValue"]),
26
- setup(l, { emit: B }) {
27
- const s = g(l, "open"), i = g(l, "modelValue"), T = B, n = r(""), b = r(0), f = r(!1), y = r(null), a = r([]), x = M("dropdownRef"), k = M("hiddenSpan"), z = () => {
28
- n.value = "", i.value = null;
29
- }, W = async (t) => {
30
- if (!t) {
31
- a.value = [], s.value = !1;
25
+ emits: /* @__PURE__ */ M(["click", "update:inputValue", "keydown"], ["update:open", "update:modelValue"]),
26
+ setup(l, { expose: x, emit: R }) {
27
+ const u = V(l, "open"), i = V(l, "modelValue"), f = R, T = C("inputRef"), o = r(""), w = r(0), k = r(!1), h = r(null), a = r([]), z = C("dropdownRef"), m = C("hiddenSpan"), W = () => {
28
+ o.value = "", i.value = null;
29
+ }, I = async (t) => {
30
+ if (f("update:inputValue", t), !t) {
31
+ a.value = [], u.value = !1;
32
32
  return;
33
33
  }
34
- a.value = await y.value?.(t) || [], f.value = !0, s.value = !!a.value.length;
35
- }, h = (t = -1) => {
34
+ a.value = await h.value?.(t) || [], k.value = !0, u.value = !!a.value.length;
35
+ }, S = (t = -1) => {
36
36
  const e = a.value[t];
37
- !e || e.id === i.value?.id || (l.onOptionSelectedCb?.(e), n.value = e.label, s.value = !1, i.value = e, a.value = []);
37
+ !e || e.id === i.value?.id || (l.onOptionSelectedCb?.(e), o.value = e.label, u.value = !1, i.value = e, a.value = []);
38
+ }, E = () => {
39
+ T.value?.select();
38
40
  };
39
- return L(() => {
40
- y.value = q({ delay: 300 }, l.onInputChangeCb);
41
- }), m(n, () => {
42
- N(() => {
43
- k.value && (b.value = k.value.offsetWidth);
41
+ return N(() => {
42
+ h.value = Q({ delay: 300 }, l.onInputChangeCb);
43
+ }), b(o, () => {
44
+ O(() => {
45
+ m.value && (w.value = m.value.offsetWidth);
44
46
  });
45
- }), m(
46
- () => x.value?.selectedIdx,
47
+ }), b(
48
+ () => z.value?.selectedIdx,
47
49
  (t) => {
48
50
  const e = t ?? -1;
49
- e !== -1 && h(e);
51
+ e !== -1 && S(e);
50
52
  }
51
- ), m(
53
+ ), b(
52
54
  i,
53
55
  (t, e) => {
54
- t === e || t?.label === n.value || (n.value = t?.label || "");
56
+ t === e || t?.label === o.value || (o.value = t?.label || "");
55
57
  },
56
58
  { immediate: !0 }
57
- ), (t, e) => (p(), $(X, {
59
+ ), x({
60
+ select: E
61
+ }), (t, e) => (p(), $(G, {
58
62
  ref: "dropdownRef",
59
63
  class: "uikit-clearable-autocomplete",
60
64
  "data-cy": l.dataCy,
61
65
  "dropdown-element": "ul",
62
66
  "dropdown-classes": ["uikit-z-30", l.dropdownClasses],
63
- "open-dropdown": s.value,
67
+ "open-dropdown": u.value,
64
68
  "keep-state": !a.value.length || l.keepState === "closed" ? "closed" : "opened",
65
- "reset-keyboard-controller": f.value,
66
- "onUpdate:resetKeyboardController": e[1] || (e[1] = (o) => f.value = o),
67
- "onUpdate:dropdownState": e[2] || (e[2] = (o) => s.value = o),
68
- onClick: e[3] || (e[3] = (o) => T("click"))
69
+ "reset-keyboard-controller": k.value,
70
+ "onUpdate:resetKeyboardController": e[2] || (e[2] = (n) => k.value = n),
71
+ "onUpdate:dropdownState": e[3] || (e[3] = (n) => u.value = n),
72
+ onClick: e[4] || (e[4] = (n) => f("click"))
69
73
  }, {
70
- btn_slot: C(() => [
74
+ btn_slot: y(() => [
71
75
  d("div", {
72
76
  class: v(["uikit-text-16", l.triggerWrapperClasses])
73
77
  }, [
@@ -75,10 +79,11 @@ const G = ["readonly", "placeholder"], J = ["innerHTML"], te = /* @__PURE__ */ F
75
79
  d("div", {
76
80
  class: v(["uikit-relative", l.inputWrapperClasses])
77
81
  }, [
78
- D(d("input", {
82
+ H(d("input", {
83
+ ref: "inputRef",
79
84
  "onUpdate:modelValue": [
80
- e[0] || (e[0] = (o) => n.value = o),
81
- W
85
+ e[0] || (e[0] = (n) => o.value = n),
86
+ I
82
87
  ],
83
88
  readonly: !!i.value?.label,
84
89
  class: v(["uikit-w-full uikit-border-none focus-visible:uikit-outline-none", l.inputClasses]),
@@ -86,53 +91,54 @@ const G = ["readonly", "placeholder"], J = ["innerHTML"], te = /* @__PURE__ */ F
86
91
  font: "inherit",
87
92
  fontSize: "inherit"
88
93
  },
89
- placeholder: l.placeholder
90
- }, null, 10, G), [
91
- [H, n.value]
94
+ placeholder: l.placeholder,
95
+ onKeydown: e[1] || (e[1] = (n) => f("keydown", n))
96
+ }, null, 42, Y), [
97
+ [P, o.value]
92
98
  ]),
93
99
  d("span", {
94
100
  ref_key: "hiddenSpan",
95
- ref: k,
101
+ ref: m,
96
102
  class: "uikit-invisible uikit-absolute uikit-left-0 uikit-top-0 uikit-whitespace-pre",
97
103
  style: {
98
104
  font: "inherit",
99
105
  fontSize: "inherit"
100
106
  }
101
- }, K(n.value), 513),
102
- i.value?.label ? (p(), V("button", {
107
+ }, X(o.value), 513),
108
+ i.value?.label ? (p(), B("button", {
103
109
  key: 0,
104
110
  type: "button",
105
111
  class: v(["uikit-clear-btn uikit-absolute uikit-top-1/2 -uikit-translate-y-1/2 uikit-appearance-none", l.clearButtonClasses]),
106
112
  "aria-label": "Clear input",
107
- style: A({
108
- left: `${b.value + 16}px`
113
+ style: j({
114
+ left: `${w.value + 16}px`
109
115
  }),
110
- onClick: z
116
+ onClick: W
111
117
  }, [
112
118
  c(t.$slots, "clear-icon", {}, () => [
113
- e[4] || (e[4] = P("X", -1))
119
+ e[5] || (e[5] = q("X", -1))
114
120
  ])
115
- ], 6)) : E("", !0)
121
+ ], 6)) : A("", !0)
116
122
  ], 2),
117
123
  c(t.$slots, "right-icon")
118
124
  ], 2)
119
125
  ]),
120
- default: C(({ activeIdx: o, setActiveIdx: I }) => [
121
- (p(!0), V(O, null, U(a.value, (w, u) => (p(), $(j, {
122
- key: u,
123
- active: o === u,
126
+ default: y(({ activeIdx: n, setActiveIdx: F }) => [
127
+ (p(!0), B(U, null, D(a.value, (g, s) => (p(), $(J, {
128
+ key: s,
129
+ active: n === s,
124
130
  class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
125
- onClick: (R) => h(u),
126
- onMouseover: (R) => I(u)
131
+ onClick: (K) => S(s),
132
+ onMouseover: (K) => F(s)
127
133
  }, {
128
- default: C(() => [
134
+ default: y(() => [
129
135
  c(t.$slots, "option-content", {
130
- option: w,
131
- idx: u
136
+ option: g,
137
+ idx: s
132
138
  }, () => [
133
139
  d("span", {
134
- innerHTML: w.label
135
- }, null, 8, J)
140
+ innerHTML: g.label
141
+ }, null, 8, Z)
136
142
  ])
137
143
  ]),
138
144
  _: 2
@@ -143,5 +149,5 @@ const G = ["readonly", "placeholder"], J = ["innerHTML"], te = /* @__PURE__ */ F
143
149
  }
144
150
  });
145
151
  export {
146
- te as default
152
+ oe as default
147
153
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.2.8-alpha.10",
3
+ "version": "2.2.8-alpha.12",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",