@wikicasa-dev/components 2.1.4-alpha.16 → 2.1.4-alpha.18

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.
@@ -35,6 +35,10 @@ declare const _default: <T, LabelID extends string | number | undefined, TCompon
35
35
  attrs: any;
36
36
  slots: {
37
37
  leftIcon?(_: {}): any;
38
+ dropdown?(_: {
39
+ options: import('@vue/reactivity').UnwrapRefSimple<AccessibleSelectOptions<T, LabelID, TComponent>>[];
40
+ toggleDropdown: () => void;
41
+ }): any;
38
42
  };
39
43
  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: Optional<AccessibleSelectOptions<T, LabelID, TComponent>>) => void);
40
44
  }>) => import('vue').VNode & {
@@ -0,0 +1,6 @@
1
+ function e(t) {
2
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
3
+ }
4
+ export {
5
+ e as getDefaultExportFromCjs
6
+ };
@@ -0,0 +1,4 @@
1
+ var e = {};
2
+ export {
3
+ e as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var e = {};
2
+ export {
3
+ e as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var e = {};
2
+ export {
3
+ e as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var e = {};
2
+ export {
3
+ e as __exports
4
+ };
@@ -0,0 +1,7 @@
1
+ import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
2
+ import { __require as r } from "../node_modules/tailwindcss/defaultTheme.js";
3
+ var t = r();
4
+ const m = /* @__PURE__ */ e(t);
5
+ export {
6
+ m as default
7
+ };
@@ -0,0 +1,7 @@
1
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
+ import { __require as o } from "../node_modules/tailwindcss/plugin.js";
3
+ var t = o();
4
+ const p = /* @__PURE__ */ r(t);
5
+ export {
6
+ p as default
7
+ };
@@ -1,13 +1,13 @@
1
- import { defineComponent as P, mergeModels as y, useModel as A, ref as c, computed as g, onBeforeMount as L, watch as m, createBlock as C, openBlock as v, normalizeClass as z, withCtx as p, createElementBlock as G, Fragment as H, renderList as K, unref as B, createCommentVNode as N, createElementVNode as $, resolveDynamicComponent as F, createVNode as T, createSlots as j, renderSlot as W, withDirectives as X, vShow as q } from "vue";
2
- import J from "./BaseInput.vue.js";
1
+ import { defineComponent as H, mergeModels as g, useModel as K, ref as r, computed as $, onBeforeMount as N, watch as C, createBlock as w, openBlock as v, normalizeClass as U, withCtx as f, renderSlot as B, createElementBlock as A, Fragment as F, renderList as T, unref as S, createCommentVNode as j, createElementVNode as V, resolveDynamicComponent as W, createVNode as X, createSlots as q, withDirectives as G, vShow as J } from "vue";
2
+ import Q from "./BaseInput.vue.js";
3
3
  import '../../assets/lib/UIKit/BaseInput.css';/* empty css */
4
- import Q from "./BaseDropDown.vue.js";
5
- import { debounce as R } from "../../node_modules/@wikicasa-dev/utilities/dist/utils/FunctionUtils.js";
6
- import Y from "./BaseSelect/SelectItem.vue.js";
7
- import { useKeyboardController as Z } from "../../node_modules/@wikicasa-dev/vue-composables/dist/useKeyboardController.js";
8
- const x = ["onClick"], _ = ["innerHTML"], ue = /* @__PURE__ */ P({
4
+ import R from "./BaseDropDown.vue.js";
5
+ import { debounce as Y } from "../../node_modules/@wikicasa-dev/utilities/dist/utils/FunctionUtils.js";
6
+ import Z from "./BaseSelect/SelectItem.vue.js";
7
+ import { useKeyboardController as x } from "../../node_modules/@wikicasa-dev/vue-composables/dist/useKeyboardController.js";
8
+ const _ = ["onClick"], ee = ["innerHTML"], se = /* @__PURE__ */ H({
9
9
  __name: "BaseAutocomplete",
10
- props: /* @__PURE__ */ y({
10
+ props: /* @__PURE__ */ g({
11
11
  isValid: { default: null },
12
12
  disableCb: { type: Boolean, default: !1 },
13
13
  onInputChangeCb: { type: Function },
@@ -30,74 +30,67 @@ const x = ["onClick"], _ = ["innerHTML"], ue = /* @__PURE__ */ P({
30
30
  },
31
31
  modelModifiers: {}
32
32
  }),
33
- emits: /* @__PURE__ */ y(["update:dropdownState", "changedValue", "click", "keydown", "keydownEnterPressed"], ["update:modelValue"]),
34
- setup(o, { expose: D, emit: S }) {
35
- const u = A(o, "modelValue"), s = S, i = c(""), a = c([]), d = c(null), n = c(!1), b = c(null), V = g(() => a.value.length);
36
- L(() => {
37
- d.value = R({ delay: 300 }, o.onInputChangeCb);
33
+ emits: /* @__PURE__ */ g(["update:dropdownState", "changedValue", "click", "keydown", "keydownEnterPressed"], ["update:modelValue"]),
34
+ setup(o, { expose: D, emit: I }) {
35
+ const u = K(o, "modelValue"), s = I, i = r(""), a = r([]), c = r(null), n = r(!1), b = r(null), O = $(() => a.value.length);
36
+ N(() => {
37
+ c.value = Y({ delay: 300 }, o.onInputChangeCb);
38
38
  });
39
- const { activeIdx: k, selectedIdx: r } = Z({
40
- optionsLength: V,
39
+ const { activeIdx: m, selectedIdx: d } = x({
40
+ optionsLength: O,
41
41
  isDropdownOpen: n,
42
42
  disableSpaceHandler: !0
43
- }), h = g(() => r.value !== -1), I = async (e) => {
43
+ }), y = $(() => d.value !== -1), M = async (e) => {
44
44
  if (i.value !== e && (s("changedValue", e), i.value = e, !!o.onInputChangeCb)) {
45
- if (!e || h.value) {
46
- a.value = [], r.value = -1, k.value = -1, u.value && (u.value.label = ""), n.value = !1, await d.value?.("");
45
+ if (!e || y.value) {
46
+ a.value = [], d.value = -1, m.value = -1, u.value && (u.value.label = ""), n.value = !1, await c.value?.("");
47
47
  return;
48
48
  }
49
- o.disableCb || !d.value || (a.value = await d.value(e), console.log("DEBUG:options", {
50
- disableCb: o.disableCb,
51
- cb: d.value,
52
- length: a.value.length,
53
- open: !!a.value.length
54
- }), n.value = !!a.value.length);
49
+ o.disableCb || !c.value || (a.value = await c.value(e), n.value = !!a.value.length);
55
50
  }
56
- }, w = (e, t) => {
57
- o.onOptionSelectedCb && o.onOptionSelectedCb(e), o.cleanupOnClose && (a.value = []), i.value = e.label, u.value = e, n.value = !1, r.value = t;
58
- }, O = () => {
51
+ }, h = (e, t) => {
52
+ o.onOptionSelectedCb && o.onOptionSelectedCb(e), o.cleanupOnClose && (a.value = []), i.value = e.label, u.value = e, n.value = !1, d.value = t;
53
+ }, E = () => {
59
54
  a.value.length && o.keepState !== "closed" && (n.value = !0);
60
55
  };
61
- m(
56
+ C(
62
57
  u,
63
58
  (e, t) => {
64
59
  e === t || e?.label === i.value || (i.value = e?.label || "");
65
60
  },
66
61
  { immediate: !0 }
67
- ), m(r, (e) => {
62
+ ), C(d, (e) => {
68
63
  if (e === -1 || !a.value.length) return;
69
64
  const t = a.value[e];
70
- h.value && t.label === u.value?.label || w(t, e);
71
- }), m(
65
+ y.value && t.label === u.value?.label || h(t, e);
66
+ }), C(
72
67
  n,
73
68
  (e) => {
74
- console.log("DEBUG:BaseAutocomplete => openDropdown watcher", e), s("update:dropdownState", e);
69
+ s("update:dropdownState", e);
75
70
  },
76
71
  { immediate: !0 }
77
72
  );
78
- const E = () => {
73
+ const P = () => {
79
74
  b.value?.select();
80
- }, M = () => {
81
- s("click"), O(), console.log("DEBUG:BaseAutocomplete => handleDropDownClick", {
82
- "options.value.length": a.value.length
83
- }), a.value.length && (n.value = !0);
75
+ }, L = () => {
76
+ s("click"), E(), a.value.length && (n.value = !0);
84
77
  };
85
78
  return D({
86
- select: E
87
- }), (e, t) => (v(), C(Q, {
79
+ select: P
80
+ }), (e, t) => (v(), w(R, {
88
81
  open: n.value,
89
82
  "onUpdate:open": t[3] || (t[3] = (l) => n.value = l),
90
- class: z(e.$attrs["root-classes"]),
83
+ class: U(e.$attrs["root-classes"]),
91
84
  "data-cy": e.dataCy ? e.dataCy : `ac_${e.$attrs.id}`,
92
85
  "dropdown-element": "ul",
93
86
  "dropdown-classes": ["!uikit-max-h-[210px] uikit-z-30", e.dropdownClasses],
94
87
  "close-when-clicked-outside": e.closeDropdownOnBodyPressed,
95
88
  "activate-keyboard-controller": !1,
96
89
  "onUpdate:dropdownState": t[4] || (t[4] = (l) => n.value = l),
97
- onClick: M
90
+ onClick: L
98
91
  }, {
99
- btn_slot: p(() => [
100
- T(J, {
92
+ btn_slot: f(() => [
93
+ X(Q, {
101
94
  id: e.$attrs.id ? `ac_input_${e.$attrs.id}` : "",
102
95
  ref_key: "baseInput",
103
96
  ref: b,
@@ -109,52 +102,57 @@ const x = ["onClick"], _ = ["innerHTML"], ue = /* @__PURE__ */ P({
109
102
  "input-class": [e.inputClasses, "!uikit-text"],
110
103
  "fieldset-classes": [e.fieldsetClasses],
111
104
  "with-border": e.withBorder,
112
- "onUpdate:modelValue": t[0] || (t[0] = (l) => I(l === void 0 ? "" : `${l}`)),
105
+ "onUpdate:modelValue": t[0] || (t[0] = (l) => M(l === void 0 ? "" : `${l}`)),
113
106
  onKeydown: t[1] || (t[1] = (l) => s("keydown", l)),
114
107
  onKeydownEnterPressed: t[2] || (t[2] = () => s("keydownEnterPressed"))
115
- }, j({ _: 2 }, [
108
+ }, q({ _: 2 }, [
116
109
  e.$slots.leftIcon ? {
117
110
  name: "leftIcon",
118
- fn: p(() => [
119
- W(e.$slots, "leftIcon")
111
+ fn: f(() => [
112
+ B(e.$slots, "leftIcon")
120
113
  ]),
121
114
  key: "0"
122
115
  } : void 0,
123
116
  e.withCleanBtn ? {
124
117
  name: "rightIcon",
125
- fn: p(({ handleClean: l }) => [
126
- X($("span", {
118
+ fn: f(({ handleClean: l }) => [
119
+ G(V("span", {
127
120
  class: "text-input-icon right uikit-flex uikit-size-md uikit-cursor-pointer uikit-items-center uikit-justify-center uikit-rounded-full uikit-bg-w-lightgray uikit-text uikit-font-semibold uikit-text-white",
128
121
  onClick: l
129
- }, "X", 8, x), [
130
- [q, B(r) !== -1]
122
+ }, "X", 8, _), [
123
+ [J, S(d) !== -1]
131
124
  ])
132
125
  ]),
133
126
  key: "1"
134
127
  } : void 0
135
128
  ]), 1032, ["id", "data-cy", "model-value", "is-valid", "disabled", "placeholder", "input-class", "fieldset-classes", "with-border"])
136
129
  ]),
137
- default: p(() => [
138
- (v(!0), G(H, null, K(a.value, (l, f) => (v(), C(Y, {
139
- key: f,
140
- active: B(k) === f,
141
- class: "uikit-relative uikit-flex uikit-gap-x-xs uikit-rounded-[5px] uikit-p-md uikit-py-xs uikit-text after:uikit-absolute after:uikit-bottom-0 after:uikit-left-1/2 after:uikit-h-[1px] after:uikit-w-[95%] after:-uikit-translate-x-1/2 after:uikit-bg-w-lightgray after:uikit-content-[''] after:last:uikit-hidden hover:uikit-cursor-pointer",
142
- onClick: (U) => w(l, f),
143
- onMouseover: (U) => k.value = f
144
- }, {
145
- default: p(() => [
146
- l.icon ? (v(), C(F(l.icon), { key: 0 })) : N("", !0),
147
- $("span", {
148
- innerHTML: l.label
149
- }, null, 8, _)
150
- ]),
151
- _: 2
152
- }, 1032, ["active", "onClick", "onMouseover"]))), 128))
130
+ default: f(({ toggleDropdown: l }) => [
131
+ B(e.$slots, "dropdown", {
132
+ options: a.value,
133
+ toggleDropdown: l
134
+ }, () => [
135
+ (v(!0), A(F, null, T(a.value, (p, k) => (v(), w(Z, {
136
+ key: k,
137
+ active: S(m) === k,
138
+ class: "uikit-relative uikit-flex uikit-gap-x-xs uikit-rounded-[5px] uikit-p-md uikit-py-xs uikit-text after:uikit-absolute after:uikit-bottom-0 after:uikit-left-1/2 after:uikit-h-[1px] after:uikit-w-[95%] after:-uikit-translate-x-1/2 after:uikit-bg-w-lightgray after:uikit-content-[''] after:last:uikit-hidden hover:uikit-cursor-pointer",
139
+ onClick: (z) => h(p, k),
140
+ onMouseover: (z) => m.value = k
141
+ }, {
142
+ default: f(() => [
143
+ p.icon ? (v(), w(W(p.icon), { key: 0 })) : j("", !0),
144
+ V("span", {
145
+ innerHTML: p.label
146
+ }, null, 8, ee)
147
+ ]),
148
+ _: 2
149
+ }, 1032, ["active", "onClick", "onMouseover"]))), 128))
150
+ ])
153
151
  ]),
154
152
  _: 3
155
153
  }, 8, ["open", "class", "data-cy", "dropdown-classes", "close-when-clicked-outside"]));
156
154
  }
157
155
  });
158
156
  export {
159
- ue as default
157
+ se as default
160
158
  };
@@ -0,0 +1,11 @@
1
+ import { __require as t } from "./lib/public/default-theme.js";
2
+ var r, u;
3
+ function f() {
4
+ if (u) return r;
5
+ u = 1;
6
+ let e = t();
7
+ return r = (e.__esModule ? e : { default: e }).default, r;
8
+ }
9
+ export {
10
+ f as __require
11
+ };
@@ -0,0 +1,25 @@
1
+ import { __exports as r } from "../../../../_virtual/create-plugin.js";
2
+ import { __require as _ } from "../util/createPlugin.js";
3
+ var u;
4
+ function o() {
5
+ return u ? r : (u = 1, function(t) {
6
+ Object.defineProperty(t, "__esModule", {
7
+ value: !0
8
+ }), Object.defineProperty(t, "default", {
9
+ enumerable: !0,
10
+ get: function() {
11
+ return a;
12
+ }
13
+ });
14
+ const n = /* @__PURE__ */ i(_());
15
+ function i(e) {
16
+ return e && e.__esModule ? e : {
17
+ default: e
18
+ };
19
+ }
20
+ const a = n.default;
21
+ }(r), r);
22
+ }
23
+ export {
24
+ o as __require
25
+ };
@@ -0,0 +1,26 @@
1
+ import { __exports as r } from "../../../../_virtual/default-theme.js";
2
+ import { __require as l } from "../util/cloneDeep.js";
3
+ import { __require as _ } from "../../stubs/config.full.js";
4
+ var u;
5
+ function m() {
6
+ return u ? r : (u = 1, function(t) {
7
+ Object.defineProperty(t, "__esModule", {
8
+ value: !0
9
+ }), Object.defineProperty(t, "default", {
10
+ enumerable: !0,
11
+ get: function() {
12
+ return o;
13
+ }
14
+ });
15
+ const n = l(), f = /* @__PURE__ */ i(_());
16
+ function i(e) {
17
+ return e && e.__esModule ? e : {
18
+ default: e
19
+ };
20
+ }
21
+ const o = (0, n.cloneDeep)(f.default.theme);
22
+ }(r), r);
23
+ }
24
+ export {
25
+ m as __require
26
+ };
@@ -0,0 +1,23 @@
1
+ import { __exports as t } from "../../../../_virtual/cloneDeep.js";
2
+ var i;
3
+ function f() {
4
+ return i ? t : (i = 1, function(o) {
5
+ Object.defineProperty(o, "__esModule", {
6
+ value: !0
7
+ }), Object.defineProperty(o, "cloneDeep", {
8
+ enumerable: !0,
9
+ get: function() {
10
+ return r;
11
+ }
12
+ });
13
+ function r(e) {
14
+ return Array.isArray(e) ? e.map((n) => r(n)) : typeof e == "object" && e !== null ? Object.fromEntries(Object.entries(e).map(([n, u]) => [
15
+ n,
16
+ r(u)
17
+ ])) : e;
18
+ }
19
+ }(t), t);
20
+ }
21
+ export {
22
+ f as __require
23
+ };
@@ -0,0 +1,34 @@
1
+ import { __exports as u } from "../../../../_virtual/createPlugin.js";
2
+ var c;
3
+ function f() {
4
+ return c ? u : (c = 1, function(i) {
5
+ Object.defineProperty(i, "__esModule", {
6
+ value: !0
7
+ }), Object.defineProperty(i, "default", {
8
+ enumerable: !0,
9
+ get: function() {
10
+ return _;
11
+ }
12
+ });
13
+ function o(e, n) {
14
+ return {
15
+ handler: e,
16
+ config: n
17
+ };
18
+ }
19
+ o.withOptions = function(e, n = () => ({})) {
20
+ const r = function(t) {
21
+ return {
22
+ __options: t,
23
+ handler: e(t),
24
+ config: n(t)
25
+ };
26
+ };
27
+ return r.__isOptionsFunction = !0, r.__pluginFunction = e, r.__configFunction = n, r;
28
+ };
29
+ const _ = o;
30
+ }(u), u);
31
+ }
32
+ export {
33
+ f as __require
34
+ };
@@ -0,0 +1,11 @@
1
+ import { __require as i } from "./lib/public/create-plugin.js";
2
+ var r, u;
3
+ function a() {
4
+ if (u) return r;
5
+ u = 1;
6
+ let e = i();
7
+ return r = (e.__esModule ? e : { default: e }).default, r;
8
+ }
9
+ export {
10
+ a as __require
11
+ };