@addsign/moje-agenda-shared-lib 0.0.19 → 0.0.20

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.
@@ -20,16 +20,16 @@ var le = ["mousedown", "touchstart"], se = function(e, t, r) {
20
20
  p(function() {
21
21
  d.current = t;
22
22
  }, [t]), p(function() {
23
- for (var o = function(f) {
23
+ for (var o = function(i) {
24
24
  var c = e.current;
25
- c && !c.contains(f.target) && d.current(f);
25
+ c && !c.contains(i.target) && d.current(i);
26
26
  }, a = 0, u = r; a < u.length; a++) {
27
27
  var h = u[a];
28
28
  re(document, h, o);
29
29
  }
30
30
  return function() {
31
- for (var f = 0, c = r; f < c.length; f++) {
32
- var k = c[f];
31
+ for (var i = 0, c = r; i < c.length; i++) {
32
+ var k = c[i];
33
33
  ae(document, k, o);
34
34
  }
35
35
  };
@@ -44,79 +44,79 @@ const me = ({
44
44
  fetchUrl: a,
45
45
  valueKey: u,
46
46
  labelKey: h,
47
- onChange: f,
47
+ onChange: i,
48
48
  onFocus: c,
49
49
  onBlur: k,
50
- placeholder: D,
51
- serverSearch: v = !1,
50
+ placeholder: j,
51
+ serverSearch: w = !1,
52
52
  value: L,
53
53
  initOptions: R,
54
- showId: C
54
+ showId: E
55
55
  }) => {
56
- var T, V;
57
- const [E, w] = m(""), [J, M] = m(!1), [x, A] = m([]), [O, b] = m(-1), [P, Q] = m(
56
+ var V, W;
57
+ const [M, C] = m(""), [J, O] = m(!1), [x, A] = m([]), [Q, b] = m(-1), [P, S] = m(
58
58
  null
59
- ), [g, y] = m([]), X = F(null), j = F(null), S = te(), [B, q] = m(!1), [z] = m({});
59
+ ), [g, y] = m([]), X = F(null), q = F(null), D = te(), [B, z] = m(!1), [H] = m({});
60
60
  p(() => {
61
61
  a && (async () => {
62
- M(!0), console.log(
62
+ O(!0), console.log(
63
63
  "%csrcsharedAutocompleteSearchBar.tsx:77 fetchUrl, value",
64
64
  "color: #007acc;",
65
65
  a
66
66
  );
67
- const { data: s } = await S.apiClient.get(a || "");
67
+ const { data: s } = await D.apiClient.get(a || ""), f = s.content || s;
68
68
  A(
69
- s.map((i) => ({
70
- value: i[u],
71
- label: i[h] + (C ? " (" + i[u] + ")" : "")
69
+ f.map((v) => ({
70
+ value: v[u],
71
+ label: v[h] + (E ? " (" + v[u] + ")" : "")
72
72
  }))
73
- ), M(!1);
73
+ ), O(!1);
74
74
  })();
75
- }, [a, u, S.apiClient, h, C]), p(() => {
75
+ }, [a]), p(() => {
76
76
  R && A(R);
77
77
  }, [R]), p(() => {
78
78
  if (L && x) {
79
79
  const l = x.find((s) => s.value == L);
80
- l && (w(l.label), Q(l));
80
+ l && (C(l.label), S(l));
81
81
  }
82
82
  }, [L, x]), p(() => {
83
- v && (async () => {
84
- M(!0);
85
- const { data: s } = await S.apiClient.get(a + E);
83
+ w && (async () => {
84
+ O(!0);
85
+ const { data: s } = await D.apiClient.get(a + M);
86
86
  A(
87
- s.map((i) => ({
88
- value: i[u],
89
- label: i[h] + (C ? " (" + i[u] + ")" : "")
87
+ s.map((f) => ({
88
+ value: f[u],
89
+ label: f[h] + (E ? " (" + f[u] + ")" : "")
90
90
  }))
91
91
  ), y(
92
- s.map((i) => ({
93
- value: i[u],
94
- label: i[h] + (C ? " (" + i[u] + ")" : "")
92
+ s.map((f) => ({
93
+ value: f[u],
94
+ label: f[h] + (E ? " (" + f[u] + ")" : "")
95
95
  }))
96
- ), M(!1);
96
+ ), O(!1);
97
97
  })();
98
98
  }, [
99
- E,
100
- v,
99
+ M,
100
+ w,
101
101
  u,
102
102
  h,
103
103
  a,
104
- S.apiClient,
105
- C
106
- ]), se(j, () => {
107
- y([]), P || (w(""), f(null)), $();
104
+ D.apiClient,
105
+ E
106
+ ]), se(q, () => {
107
+ y([]), P || (C(""), i(null)), $();
108
108
  });
109
109
  const Y = (l) => {
110
- w(l.target.value), Q(null), b(-1), y(
110
+ C(l.target.value), S(null), b(-1), y(
111
111
  x.filter(
112
112
  (s) => {
113
- var i, W, G;
114
- return (G = s == null ? void 0 : s.label) == null ? void 0 : G.toLowerCase().includes((W = (i = l.target) == null ? void 0 : i.value) == null ? void 0 : W.toLowerCase());
113
+ var f, v, G;
114
+ return (G = s == null ? void 0 : s.label) == null ? void 0 : G.toLowerCase().includes((v = (f = l.target) == null ? void 0 : f.value) == null ? void 0 : v.toLowerCase());
115
115
  }
116
116
  )
117
117
  );
118
118
  }, Z = () => {
119
- console.log("handleFocus query", E), q(!0), c(), y(
119
+ console.log("handleFocus query", M), z(!0), c(), y(
120
120
  x
121
121
  /*.filter((option) =>
122
122
  option.label.toLowerCase().includes(query.toLowerCase()),
@@ -126,7 +126,7 @@ const me = ({
126
126
  console.log(
127
127
  "%csrcsharedAutocompleteSearchBar.tsx:95 handleClearQuery",
128
128
  "color: #007acc;"
129
- ), w(""), f(null), Q(null), setTimeout(() => {
129
+ ), C(""), i(null), S(null), setTimeout(() => {
130
130
  b(-1), y(x);
131
131
  }, 1e3);
132
132
  }, I = (l) => {
@@ -134,18 +134,18 @@ const me = ({
134
134
  (s) => s > 0 ? s - 1 : g.length - 1
135
135
  ) : l.key === "ArrowDown" && g.length > 0 ? b(
136
136
  (s) => s < g.length - 1 ? s + 1 : 0
137
- ) : l.key === "Enter" && O !== -1 ? H(g[O]) : l.key === "Escape" && O !== -1 && $();
138
- }, H = (l) => {
139
- w(l.label), Q(l), b(-1), f(l.value), $();
137
+ ) : l.key === "Enter" && Q !== -1 ? T(g[Q]) : l.key === "Escape" && Q !== -1 && $();
138
+ }, T = (l) => {
139
+ C(l.label), S(l), b(-1), i(l.value), $();
140
140
  }, $ = () => {
141
- y([]), k(), q(!1);
141
+ y([]), k(), z(!1);
142
142
  };
143
143
  return /* @__PURE__ */ N("div", { className: "w-full min-h-20 flex-col justify-start items-start gap-1.5 inline-flex", children: [
144
144
  /* @__PURE__ */ N(
145
145
  "div",
146
146
  {
147
147
  className: "self-stretch min-h-14 flex-col justify-start items-start gap-1.5 flex relative",
148
- ref: j,
148
+ ref: q,
149
149
  children: [
150
150
  /* @__PURE__ */ N(
151
151
  "label",
@@ -164,19 +164,19 @@ const me = ({
164
164
  {
165
165
  className: `self-stretch px-3 py-1.5 rounded-lg justify-start items-center gap-2 inline-flex outline-none border
166
166
  ${B ? "outline-4 outline-indigo-200 outline-offset-0 border-indigo-300" : ""}
167
- ${B && ((T = z[t]) != null && T.message) ? "outline-4 outline-red-200 outline-offset-0 border-none" : ""}
168
- ${!B && ((V = z[t]) != null && V.message) ? "border-red-200" : ""}
167
+ ${B && ((V = H[t]) != null && V.message) ? "outline-4 outline-red-200 outline-offset-0 border-none" : ""}
168
+ ${!B && ((W = H[t]) != null && W.message) ? "border-red-200" : ""}
169
169
  ${d ? "bg-gray-100" : "bg-transparent"}`,
170
170
  children: /* @__PURE__ */ n("div", { className: "Content grow shrink basis-0 min-h-5 xl:min-h-8 justify-start items-start gap-2 flex relative flex-col w-full mx-auto", children: /* @__PURE__ */ n(
171
171
  oe,
172
172
  {
173
- value: E,
173
+ value: M,
174
174
  onChange: Y,
175
175
  onKeyDown: I,
176
176
  onFocus: Z,
177
177
  clearQuery: U,
178
178
  inputRef: X,
179
- placeholder: D,
179
+ placeholder: j,
180
180
  isFocused: B,
181
181
  onBlur: $,
182
182
  isLoading: J
@@ -188,8 +188,8 @@ const me = ({
188
188
  ne,
189
189
  {
190
190
  options: g,
191
- selectedOptionIndex: O,
192
- handleOptionClick: H
191
+ selectedOptionIndex: Q,
192
+ handleOptionClick: T
193
193
  }
194
194
  )
195
195
  ]
@@ -217,7 +217,7 @@ const me = ({
217
217
  {
218
218
  ref: d,
219
219
  className: "overflow-y-auto resultOptionContainer w-full max-h-96 absolute outline-4 bg-white border border-gray-200 drop-shadow-xl rounded-xl z-50 top-[73px]",
220
- children: e.map((o, a) => /* @__PURE__ */ n(
220
+ children: e == null ? void 0 : e.map((o, a) => /* @__PURE__ */ n(
221
221
  "div",
222
222
  {
223
223
  className: `py-2 px-4 flex items-center justify-between gap-8 hover:bg-gray-200 cursor-pointer ${t === a ? "bg-gray-200" : ""}`,
@@ -237,7 +237,7 @@ const me = ({
237
237
  inputRef: a,
238
238
  placeholder: u,
239
239
  clearQuery: h,
240
- isFocused: f,
240
+ isFocused: i,
241
241
  isLoading: c
242
242
  }) => /* @__PURE__ */ N("div", { className: "relative flex items-center w-full sharedResource", children: [
243
243
  /* @__PURE__ */ n(
@@ -284,20 +284,20 @@ const me = ({
284
284
  ]
285
285
  }
286
286
  ) }),
287
- f && !c && /* @__PURE__ */ n(
287
+ i && !c && /* @__PURE__ */ n(
288
288
  K,
289
289
  {
290
290
  className: "material-icons absolute right-0 cursor-pointer text-gray-500",
291
291
  onClick: o
292
292
  }
293
293
  ),
294
- !f && !c && /* @__PURE__ */ n(
294
+ !i && !c && /* @__PURE__ */ n(
295
295
  _,
296
296
  {
297
297
  className: "material-icons absolute right-0 cursor-pointer text-gray-500",
298
298
  onClick: () => {
299
- var v;
300
- (v = a.current) == null || v.focus(), d();
299
+ var w;
300
+ (w = a.current) == null || w.focus(), d();
301
301
  }
302
302
  }
303
303
  ),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@addsign/moje-agenda-shared-lib",
3
3
  "private": false,
4
- "version": "0.0.19",
4
+ "version": "0.0.20",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",