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

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