@wikicasa-dev/components 2.2.2-alpha.0 → 2.2.2

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.
@@ -38,6 +38,10 @@ declare const _default: <T, LabelID extends string | number | undefined>(__VLS_p
38
38
  righticon?(_: {
39
39
  handleClean: () => void;
40
40
  }): any;
41
+ 'item-content'?(_: {
42
+ option: import('@vue/reactivity').UnwrapRefSimple<AccessibleSelectOptions<T, LabelID>>;
43
+ idx: number;
44
+ }): any;
41
45
  };
42
46
  emit: (((evt: "click") => void) & ((evt: "update:dropdownState", args_0: boolean) => void) & ((evt: "keydown", args_0: KeyboardEvent) => void) & ((evt: "keydownEnterPressed") => void) & ((evt: "changedValue", args_0: string) => void)) & ((evt: "update:modelValue", value: AccessibleSelectOptions<T, LabelID> | undefined) => void);
43
47
  }>) => import('vue').VNode & {
@@ -1,4 +1,4 @@
1
- import { defineComponent as P, mergeModels as y, useModel as F, ref as d, computed as k, onBeforeMount as L, watch as f, createBlock as g, openBlock as w, normalizeClass as H, withCtx as s, createElementBlock as K, Fragment as T, renderList as z, unref as N, createElementVNode as U, createVNode as A, renderSlot as $ } from "vue";
1
+ import { defineComponent as P, mergeModels as $, useModel as F, ref as d, computed as k, onBeforeMount as L, watch as f, createBlock as g, openBlock as w, normalizeClass as H, withCtx as c, createElementBlock as K, Fragment as T, renderList as z, unref as N, renderSlot as p, createElementVNode as U, createVNode as A } from "vue";
2
2
  import W from "../../../../UIKit/BaseInput.js";
3
3
  import j from "./BaseDropDown.vue.js";
4
4
  import { debounce as q } from "@wikicasa-dev/utilities";
@@ -6,7 +6,7 @@ import G from "./BaseSelect/SelectItem.vue.js";
6
6
  import { useKeyboardController as J } from "@wikicasa-dev/vue-composables";
7
7
  const Q = ["innerHTML"], le = /* @__PURE__ */ P({
8
8
  __name: "BaseAutocomplete",
9
- props: /* @__PURE__ */ y({
9
+ props: /* @__PURE__ */ $({
10
10
  isValid: { type: [Boolean, null], default: null },
11
11
  theme: { default: "" },
12
12
  label: { default: "" },
@@ -28,12 +28,12 @@ const Q = ["innerHTML"], le = /* @__PURE__ */ P({
28
28
  },
29
29
  modelModifiers: {}
30
30
  }),
31
- emits: /* @__PURE__ */ y(["update:dropdownState", "changedValue", "click", "keydown", "keydownEnterPressed"], ["update:modelValue"]),
31
+ emits: /* @__PURE__ */ $(["update:dropdownState", "changedValue", "click", "keydown", "keydownEnterPressed"], ["update:modelValue"]),
32
32
  setup(t, { expose: S, emit: V }) {
33
33
  const u = F(
34
34
  t,
35
35
  "modelValue"
36
- ), r = V, i = d(""), a = d([]), v = d(null), c = d(!1), n = d(!1), p = d(null), B = k(() => a.value.length);
36
+ ), r = V, i = d(""), o = d([]), v = d(null), b = d(!1), n = d(!1), C = d(null), B = k(() => o.value.length);
37
37
  L(() => {
38
38
  v.value = q({ delay: 300 }, t.onInputChangeCb);
39
39
  });
@@ -52,7 +52,7 @@ const Q = ["innerHTML"], le = /* @__PURE__ */ P({
52
52
  default:
53
53
  return "";
54
54
  }
55
- }), x = k(() => {
55
+ }), I = k(() => {
56
56
  switch (t.theme) {
57
57
  case "bordered":
58
58
  return "";
@@ -63,7 +63,7 @@ const Q = ["innerHTML"], le = /* @__PURE__ */ P({
63
63
  default:
64
64
  return "";
65
65
  }
66
- }), I = k(() => {
66
+ }), M = k(() => {
67
67
  const e = "uikit-rounded-b-xl uikit-shadow uikit-rounded-t-none uikit-mb-0 !uikit-mt-0 uikit-text-w-black !uikit-rounded-b-xl !uikit-rounded-t-none";
68
68
  switch (t.theme) {
69
69
  case "bordered":
@@ -75,18 +75,18 @@ const Q = ["innerHTML"], le = /* @__PURE__ */ P({
75
75
  default:
76
76
  return "";
77
77
  }
78
- }), M = async (e) => {
78
+ }), x = async (e) => {
79
79
  if (i.value !== e && (r("changedValue", e), i.value = e, !!t.onInputChangeCb)) {
80
- if (!e || c.value) {
81
- a.value = [], c.value = !1, h.value = -1, m.value = -1, u.value && (u.value.label = ""), n.value = !1, await v.value(null);
80
+ if (!e || b.value) {
81
+ o.value = [], b.value = !1, h.value = -1, m.value = -1, u.value && (u.value.label = ""), n.value = !1, await v.value(null);
82
82
  return;
83
83
  }
84
- t.disableCb || (a.value = await v.value(e), n.value = !!a.value.length);
84
+ t.disableCb || (o.value = await v.value(e), n.value = !!o.value.length);
85
85
  }
86
- }, C = (e, l) => {
87
- t.onOptionSelectedCb && t.onOptionSelectedCb(e), t.cleanupOnClose && (a.value = []), c.value = !0, i.value = e.label, u.value = e, n.value = !1, h.value = l;
86
+ }, y = (e, l) => {
87
+ t.onOptionSelectedCb && t.onOptionSelectedCb(e), t.cleanupOnClose && (o.value = []), b.value = !0, i.value = e.label, u.value = e, n.value = !1, h.value = l;
88
88
  }, D = () => {
89
- a.value.length && t.keepState !== "closed" && (n.value = !0);
89
+ o.value.length && t.keepState !== "closed" && (n.value = !0);
90
90
  };
91
91
  return f(
92
92
  u,
@@ -95,19 +95,19 @@ const Q = ["innerHTML"], le = /* @__PURE__ */ P({
95
95
  },
96
96
  { immediate: !0 }
97
97
  ), f(h, (e) => {
98
- if (e === -1 || !a.value.length) return;
99
- const l = a.value[e];
100
- c.value && l.label === u.value?.label || C(l, e);
98
+ if (e === -1 || !o.value.length) return;
99
+ const l = o.value[e];
100
+ b.value && l.label === u.value?.label || y(l, e);
101
101
  }), f(
102
102
  () => t.keepState,
103
103
  (e) => {
104
- e === "closed" ? (n.value = !1, t.cleanupOnClose && (a.value = [])) : e === "open" && a.value.length && (n.value = !0);
104
+ e === "closed" ? (n.value = !1, t.cleanupOnClose && (o.value = [])) : e === "open" && o.value.length && (n.value = !0);
105
105
  }
106
106
  ), f(n, (e) => {
107
107
  r("update:dropdownState", e);
108
108
  }), S({
109
109
  select: () => {
110
- p.value?.select();
110
+ C.value?.select();
111
111
  }
112
112
  }), (e, l) => (w(), g(j, {
113
113
  class: H(e.$attrs["root-classes"]),
@@ -120,24 +120,24 @@ const Q = ["innerHTML"], le = /* @__PURE__ */ P({
120
120
  {
121
121
  "uikit-mt-10px !uikit-border !uikit-border-w-secondary !uikit-rounded-xs": !t.theme
122
122
  },
123
- I.value,
123
+ M.value,
124
124
  "!uikit-max-h-[210px] uikit-z-30",
125
125
  t.dropdownClasses
126
126
  ],
127
127
  "open-dropdown": n.value,
128
- "keep-state": !a.value.length || t.keepState === "closed" ? "closed" : "opened",
128
+ "keep-state": !o.value.length || t.keepState === "closed" ? "closed" : "opened",
129
129
  "close-when-clicked-outside": t.closeDropdownOnBodyPressed,
130
130
  "activate-keyboard-controller": !1,
131
- "onUpdate:dropdownState": l[3] || (l[3] = (o) => n.value = o),
132
- onClick: l[4] || (l[4] = (o) => {
131
+ "onUpdate:dropdownState": l[3] || (l[3] = (a) => n.value = a),
132
+ onClick: l[4] || (l[4] = (a) => {
133
133
  r("click"), D();
134
134
  })
135
135
  }, {
136
- btn_slot: s(() => [
136
+ btn_slot: c(() => [
137
137
  A(W, {
138
138
  id: e.$attrs.id ? `ac_input_${e.$attrs.id}` : "",
139
139
  ref_key: "baseInput",
140
- ref: p,
140
+ ref: C,
141
141
  "data-cy": t.dataCy ? `ac_input_${t.dataCy}` : `ac_input_${e.$attrs.id}`,
142
142
  "label-text": t.label,
143
143
  "model-value": i.value,
@@ -151,32 +151,37 @@ const Q = ["innerHTML"], le = /* @__PURE__ */ P({
151
151
  t.inputClasses,
152
152
  "!uikit-ml-0 !uikit-w-full"
153
153
  ],
154
- "fieldset-classes": [x.value, t.fieldsetClasses],
155
- "onUpdate:modelValue": l[0] || (l[0] = (o) => M(o === void 0 ? "" : `${o}`)),
156
- onKeydown: l[1] || (l[1] = (o) => r("keydown", o)),
154
+ "fieldset-classes": [I.value, t.fieldsetClasses],
155
+ "onUpdate:modelValue": l[0] || (l[0] = (a) => x(a === void 0 ? "" : `${a}`)),
156
+ onKeydown: l[1] || (l[1] = (a) => r("keydown", a)),
157
157
  onKeydownEnterPressed: l[2] || (l[2] = () => r("keydownEnterPressed"))
158
158
  }, {
159
- leftIcon: s(() => [
160
- $(e.$slots, "lefticon")
159
+ leftIcon: c(() => [
160
+ p(e.$slots, "lefticon")
161
161
  ]),
162
- righticon: s(({ handleClean: o }) => [
163
- $(e.$slots, "righticon", { handleClean: o })
162
+ righticon: c(({ handleClean: a }) => [
163
+ p(e.$slots, "righticon", { handleClean: a })
164
164
  ]),
165
165
  _: 3
166
166
  }, 8, ["id", "data-cy", "label-text", "model-value", "is-valid", "disabled", "placeholder", "with-left-icon", "with-right-icon", "input-class", "fieldset-classes"])
167
167
  ]),
168
- default: s(() => [
169
- (w(!0), K(T, null, z(a.value, (o, b) => (w(), g(G, {
170
- key: b,
171
- active: N(m) === b,
168
+ default: c(() => [
169
+ (w(!0), K(T, null, z(o.value, (a, s) => (w(), g(G, {
170
+ key: s,
171
+ active: N(m) === s,
172
172
  class: "uikit-m-1 uikit-rounded-[5px] uikit-px-5 uikit-py-10px hover:uikit-cursor-pointer",
173
- onClick: (E) => C(o, b),
174
- onMouseover: (E) => m.value = b
173
+ onClick: (E) => y(a, s),
174
+ onMouseover: (E) => m.value = s
175
175
  }, {
176
- default: s(() => [
177
- U("span", {
178
- innerHTML: o.label
179
- }, null, 8, Q)
176
+ default: c(() => [
177
+ p(e.$slots, "item-content", {
178
+ option: a,
179
+ idx: s
180
+ }, () => [
181
+ U("span", {
182
+ innerHTML: a.label
183
+ }, null, 8, Q)
184
+ ])
180
185
  ]),
181
186
  _: 2
182
187
  }, 1032, ["active", "onClick", "onMouseover"]))), 128))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.2.2-alpha.0",
3
+ "version": "2.2.2",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",