ia-table 0.15.0 → 0.15.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.
package/dist/pivot.d.ts CHANGED
@@ -934,6 +934,10 @@ declare type SmartGridCellRendererParams = {
934
934
  rightLabel?: string;
935
935
  splits?: SmartGridColumnDefinition[];
936
936
  isEnableResetButton?: boolean;
937
+ placeholder?: string;
938
+ isOnDemandDropdownOptions?: boolean;
939
+ isDropdownValueLableSame?: boolean;
940
+ getDropdownOptions?: (params: SmartGridDropdownOptionsParams) => Promise<SmartGridSelectOption[]>;
937
941
  } & Record<string, unknown>;
938
942
 
939
943
  declare interface SmartGridCellValueChangedParams {
@@ -1186,6 +1190,12 @@ declare interface SmartGridDisptach {
1186
1190
  payload?: unknown;
1187
1191
  }
1188
1192
 
1193
+ declare interface SmartGridDropdownOptionsParams {
1194
+ value: string | number | (string | number)[] | null;
1195
+ data: SmartGridRowData;
1196
+ colDef: SmartGridColumnDefinition;
1197
+ }
1198
+
1189
1199
  declare interface SmartGridEvent {
1190
1200
  type: string;
1191
1201
  api?: SmartGridAPI;
package/dist/pivot.js CHANGED
@@ -2,8 +2,8 @@
2
2
  import { jsxs as t, jsx as e, Fragment as Y } from "react/jsx-runtime";
3
3
  import * as j from "react";
4
4
  import q, { useState as D, useCallback as c, useMemo as V, useRef as Q, useEffect as J } from "react";
5
- import { S as X, g as E, b as ve, T as pe, B as G, C as U, R as oe, M as He, I as de, c as ee } from "./RadioGroup-Cv9QL-Yd.js";
6
- import { S as Ze, d as K, c as qe, a as ue, e as Ue, b as We } from "./right-arrow-5CR5OWUs.js";
5
+ import { S as X, g as E, b as ve, T as pe, B as G, C as U, R as oe, M as He, I as de, c as ee } from "./RadioGroup-D3RQET6P.js";
6
+ import { S as Ze, d as K, c as qe, a as ue, e as Ue, b as We } from "./right-arrow-CAPmbx1Z.js";
7
7
  import { createPortal as Qe } from "react-dom";
8
8
  const Je = ({
9
9
  title: l,
@@ -0,0 +1,413 @@
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.ia-table-select-search{padding:9.5px 12px}.ia-table-select-search svg path{fill:#a0a8b1}.ia-table-select-search .ia-table-select-search-input{width:100%;border:none;border-radius:8px;padding:0 10px;font-size:14px;outline:none;background-color:inherit;color:#1f2b4d;line-height:16px}.ia-table-select-search .ia-table-select-search-input:focus{border-color:#4259ee}.ia-table-select-search .ia-table-select-search-input::placeholder{color:#b4bac7}.ia-table-select-dropdown{position:absolute;margin-top:6px;border-radius:12px;box-shadow:0 1px 6px #1a277c24;border:none;padding:8px 6px;background-color:#fff;font-family:Manrope,sans-serif;z-index:1050;min-height:135px;max-height:262px}.ia-table-select-dropdown.ia-table-select-dropdown-above{margin-top:0;margin-bottom:6px;bottom:100%;top:auto}.ia-table-select-reset{width:20px;height:20px;background:transparent;border:none;margin-left:8px}.ia-table-select-reset svg path{fill:#60697d}.ia-table-select-all-row .ia-table-select-all-option{padding:4px 12px;font-size:14px;color:#0d152c;line-height:16px;font-weight:400}.ia-table-select-all-row .ia-table-select-clear-btn{background:transparent;border:none;font-size:14px;color:#60697d;font-weight:400;line-height:16px;padding:4px 8px}.ia-table-select-options{max-height:240px;overflow-y:auto;margin-top:2px}.ia-table-select-options::-webkit-scrollbar{width:6px}.ia-table-select-options::-webkit-scrollbar-track{background:transparent}.ia-table-select-options::-webkit-scrollbar-thumb{background-color:#c3c8d4;border-radius:3px}.ia-table-select-options .ia-table-select-option{padding:7.5px 12px;font-size:14px;color:#1f2b4d;line-height:20px;font-weight:500;transition:background-color .2s ease;border-radius:8px}.ia-table-select-options .ia-table-select-option:hover{background-color:#f5f6fa}.ia-table-select-options .ia-table-select-option.ia-table-select-option-selected,.ia-table-select-options .ia-table-select-option.ia-table-select-option-highlighted{background-color:#eef0ff}.ia-table-select-options .ia-table-select-option.ia-table-option-disabled{cursor:not-allowed;-webkit-user-select:none;user-select:none;color:#b4bac7}.ia-table-select-options .ia-table-select-no-options{padding:12px;text-align:center;color:#a0a8b1;font-style:italic}.ia-table-selectbox-container{width:100%;font-family:Manrope,sans-serif;position:relative;margin:0;padding:0}.ia-table-selectbox-container .ia-table-select-label{font-size:12px;font-weight:500;color:#60697d;line-height:16px;margin-bottom:6px;display:block}.ia-table-selectbox-container .ia-table-select-container{width:100%;height:32px;border:1px solid #d9dde7;border-radius:8px;background-color:#fff;padding:0 12px;cursor:pointer;transition:all .2s ease-in-out;position:relative;margin:0}.ia-table-selectbox-container .ia-table-select-container:hover:not(.ia-table-select-disabled,.ia-table-selectrenderer){border-color:#4259ee}.ia-table-selectbox-container .ia-table-select-container.ia-table-select-disabled{background-color:#f2f4fb;border-color:#e2e8f0;cursor:not-allowed;opacity:.7}.ia-table-selectbox-container .ia-table-select-container.ia-table-selectrenderer{border:none}.ia-table-selectbox-container .ia-table-select-container .ia-table-select-value{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px;font-weight:400;color:#1f2b4d;line-height:19px}.ia-table-selectbox-container .ia-table-select-container .ia-table-select-value:empty:before{content:"Select an option";color:#b4bac7}.ia-table-selectbox-container .ia-table-select-container .ia-table-select-arrow{width:16px;height:16px;transition:transform .2s ease}.ia-table-selectbox-container .ia-table-select-container .ia-table-select-arrow svg{transition:transform .2s ease;fill:#404b62}.ia-table-cell-render-select-disabled .ia-table-select-disabled .ia-table-select-value{color:#b4bac7!important;font-weight:400!important}.ia-table-cell-render-select-disabled .ia-table-select-disabled{border:none!important;background-color:inherit!important;cursor:not-allowed!important}.ia-table-cell-render-select-disabled .ia-table-select-disabled svg path{fill:#d9dde7}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
+ import * as v from "react";
3
+ import { useEffect as V, memo as pe, useRef as E, useState as H, useMemo as _, useCallback as $ } from "react";
4
+ import { jsxs as T, jsx as s } from "react/jsx-runtime";
5
+ import { createPortal as Se } from "react-dom";
6
+ import { S as De, N as re, O as le, P as Ne } from "./RadioGroup-D3RQET6P.js";
7
+ const Pe = (f) => /* @__PURE__ */ v.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 8 11", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...f }, /* @__PURE__ */ v.createElement("path", { d: "M1.99902 8.66675C2.45611 8.66675 2.83283 9.04271 2.83301 9.49976C2.83301 9.95695 2.45621 10.3337 1.99902 10.3337C1.54198 10.3336 1.16602 9.95684 1.16602 9.49976C1.16619 9.04282 1.54209 8.66693 1.99902 8.66675ZM5.99902 8.66675C6.45611 8.66675 6.83283 9.04271 6.83301 9.49976C6.83301 9.95695 6.45621 10.3337 5.99902 10.3337C5.54198 10.3336 5.16602 9.95684 5.16602 9.49976C5.16619 9.04282 5.54209 8.66693 5.99902 8.66675ZM1.99902 4.66675C2.45611 4.66675 2.83283 5.04271 2.83301 5.49976C2.83301 5.95695 2.45621 6.33374 1.99902 6.33374C1.54198 6.33356 1.16602 5.95684 1.16602 5.49976C1.16619 5.04282 1.54209 4.66693 1.99902 4.66675ZM5.99902 4.66675C6.45611 4.66675 6.83283 5.04271 6.83301 5.49976C6.83301 5.95695 6.45621 6.33374 5.99902 6.33374C5.54198 6.33356 5.16602 5.95684 5.16602 5.49976C5.16619 5.04282 5.54209 4.66693 5.99902 4.66675ZM1.99902 0.666748C2.45611 0.666748 2.83283 1.04271 2.83301 1.49976C2.83301 1.95695 2.45621 2.33374 1.99902 2.33374C1.54198 2.33356 1.16602 1.95684 1.16602 1.49976C1.16619 1.04282 1.54209 0.666926 1.99902 0.666748ZM5.99902 0.666748C6.45611 0.666748 6.83283 1.04271 6.83301 1.49976C6.83301 1.95695 6.45621 2.33374 5.99902 2.33374C5.54198 2.33356 5.16602 1.95684 5.16602 1.49976C5.16619 1.04282 5.54209 0.666926 5.99902 0.666748Z", fill: "currentColor", stroke: "currentColor" })), ke = (f) => /* @__PURE__ */ v.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...f }, /* @__PURE__ */ v.createElement("path", { d: "M7.15604 14.8024C7.0149 14.6706 6.94434 14.5146 6.94434 14.3344C6.94434 14.1545 7.0149 13.9987 7.15604 13.8669L11.2913 10.0066L7.14192 6.13307C7.0102 6.0101 6.94434 5.85639 6.94434 5.67194C6.94434 5.48748 7.0149 5.32938 7.15604 5.19763C7.29717 5.06588 7.46427 5 7.65735 5C7.85004 5 8.01696 5.06588 8.15809 5.19763L12.9002 9.63768C12.9567 9.69038 12.9967 9.74747 13.0204 9.80896C13.0438 9.87044 13.0554 9.93632 13.0554 10.0066C13.0554 10.0769 13.0438 10.1427 13.0204 10.2042C12.9967 10.2657 12.9567 10.3228 12.9002 10.3755L8.14398 14.8155C8.01225 14.9385 7.85004 15 7.65735 15C7.46427 15 7.29717 14.9341 7.15604 14.8024Z", fill: "#60697D" })), Ie = (f) => /* @__PURE__ */ v.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...f }, /* @__PURE__ */ v.createElement("path", { d: "M5.35163 10.7033C3.85592 10.7033 2.59005 10.1852 1.55403 9.14923C0.51801 8.11321 0 6.84734 0 5.35163C0 3.85592 0.51801 2.59005 1.55403 1.55403C2.59005 0.51801 3.85592 0 5.35163 0C6.84734 0 8.11321 0.51801 9.14923 1.55403C10.1852 2.59005 10.7033 3.85592 10.7033 5.35163C10.7033 5.9554 10.6072 6.52487 10.4151 7.06003C10.223 7.5952 9.96226 8.06861 9.63293 8.48027L13.7736 12.6209C13.9245 12.7719 14 12.964 14 13.1973C14 13.4305 13.9245 13.6226 13.7736 13.7736C13.6226 13.9245 13.4305 14 13.1973 14C12.964 14 12.7719 13.9245 12.6209 13.7736L8.48027 9.63293C8.06861 9.96226 7.5952 10.223 7.06003 10.4151C6.52487 10.6072 5.9554 10.7033 5.35163 10.7033ZM5.35163 9.0566C6.38079 9.0566 7.25557 8.6964 7.97599 7.97599C8.6964 7.25557 9.0566 6.38079 9.0566 5.35163C9.0566 4.32247 8.6964 3.44768 7.97599 2.72727C7.25557 2.00686 6.38079 1.64666 5.35163 1.64666C4.32247 1.64666 3.44768 2.00686 2.72727 2.72727C2.00686 3.44768 1.64666 4.32247 1.64666 5.35163C1.64666 6.38079 2.00686 7.25557 2.72727 7.97599C3.44768 8.6964 4.32247 9.0566 5.35163 9.0566Z", fill: "#60697D" })), Le = ({ inputRef: f, onChange: N, type: a, placeholder: d, value: w }) => /* @__PURE__ */ T("div", { className: "ia-table-select-search d-flex align-items-center", children: [
8
+ /* @__PURE__ */ s(Ie, { className: "icon-10" }),
9
+ /* @__PURE__ */ s(
10
+ "input",
11
+ {
12
+ ref: f,
13
+ type: a,
14
+ value: w,
15
+ placeholder: d,
16
+ className: "ia-table-select-search-input",
17
+ onChange: N,
18
+ onClick: (k) => k.stopPropagation()
19
+ }
20
+ )
21
+ ] }), Ee = (f, N, a) => {
22
+ V(() => {
23
+ var w;
24
+ const d = (w = a == null ? void 0 : a.getTableInstance) == null ? void 0 : w.call(a);
25
+ if (f && N && (d != null && d.current)) {
26
+ const k = d.current.querySelectorAll(
27
+ ".ia-table-frozen-scroll-container, .ia-table-right-pinned-scroll-container, .ia-table-normal-scroll-container, .ia-table-normal-columns-section"
28
+ ), z = Array.from(
29
+ k
30
+ ).map((o) => ({
31
+ element: o,
32
+ overflow: o.style.overflow,
33
+ "overflow-y": o.style.overflowY
34
+ }));
35
+ return k.forEach((o) => {
36
+ o.style.overflow = "hidden";
37
+ }), () => {
38
+ z.forEach((o) => {
39
+ o.element.style.overflow = o.overflow, o.element.style.overflowY = o["overflow-y"];
40
+ });
41
+ };
42
+ }
43
+ }, [f, N, a]);
44
+ }, He = ({
45
+ label: f = "",
46
+ width: N = "100%",
47
+ selectedOptions: a,
48
+ setSelectedOptions: d,
49
+ isDisabled: w = !1,
50
+ isOpen: k = void 0,
51
+ setIsOpen: z = void 0,
52
+ initialOptions: o = [],
53
+ withPortal: m = !1,
54
+ className: oe = "",
55
+ isMulti: u = !1,
56
+ currentOptions: Z,
57
+ setCurrentOptions: P,
58
+ onBlur: x,
59
+ isCellRenderer: C = !1,
60
+ tableApi: i = null,
61
+ lazyLoadCellRenderer: F = !1,
62
+ isEnableResetButton: ce = !0,
63
+ isOnDemandOptions: se = !1,
64
+ getDropdownOptions: K,
65
+ isDropdownValueLableSame: ie = !1,
66
+ dropdownOptionsParams: O
67
+ }) => {
68
+ const p = E(null), A = E(null), U = E(null), [fe, de] = H(!1), [ue, me] = H(""), [b, q] = H(null), [R, j] = H(-1), [ee, Y] = H(o), [W, G] = H(null), [ne, ae] = H(!1), B = E(!1), J = E([]), Q = E(O);
69
+ Q.current = O;
70
+ const S = se && ie, h = _(() => S && W ? W : Z || ee || o, [
71
+ S,
72
+ W,
73
+ Z,
74
+ ee,
75
+ o
76
+ ]), M = $(async () => {
77
+ if (!(!S || !K || B.current || !Q.current)) {
78
+ B.current = !0, ae(!0);
79
+ try {
80
+ const e = await K(
81
+ Q.current
82
+ );
83
+ G(e), J.current = e;
84
+ } catch {
85
+ B.current = !1;
86
+ } finally {
87
+ ae(!1);
88
+ }
89
+ }
90
+ }, [S, K]), te = E(M);
91
+ te.current = M;
92
+ const c = k !== void 0 ? k : fe, y = z || de;
93
+ Ee(c, C, i);
94
+ const D = $(() => {
95
+ if (p.current) {
96
+ const e = p.current.getBoundingClientRect(), t = 250, r = window.innerHeight - e.bottom, l = e.top, n = r < t && l > r;
97
+ return {
98
+ top: n ? e.top - t : e.bottom,
99
+ left: e.left,
100
+ width: e.width,
101
+ openAbove: n
102
+ };
103
+ }
104
+ return null;
105
+ }, []);
106
+ V(() => {
107
+ if (F) {
108
+ if (m) {
109
+ const e = D();
110
+ e && q(e);
111
+ }
112
+ y(F), te.current();
113
+ }
114
+ }, [F, m, D]), V(() => {
115
+ if (c && m) {
116
+ const e = D();
117
+ e && q(e);
118
+ }
119
+ }, [c, m, D]), V(() => {
120
+ const e = (r) => {
121
+ p.current && !p.current.contains(r.target) && A.current && !A.current.contains(r.target) && (y(!1), x && x(), C && (i != null && i.tableId) && (window.iaTablePortalOpen || (window.iaTablePortalOpen = {}), window.iaTablePortalOpen[i.tableId] = !1));
122
+ }, t = () => {
123
+ if (c && m) {
124
+ const r = D();
125
+ r && q(r);
126
+ }
127
+ };
128
+ return c && (document.addEventListener("mousedown", e), m && (window.addEventListener("scroll", t, !0), window.addEventListener("resize", t))), () => {
129
+ document.removeEventListener("mousedown", e), m && (window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", t));
130
+ };
131
+ }, [
132
+ c,
133
+ y,
134
+ m,
135
+ C,
136
+ x,
137
+ i,
138
+ D
139
+ ]), V(() => {
140
+ c && U.current && (U.current.focus(), j(-1));
141
+ }, [c]), V(() => {
142
+ Z || o && o.length > 0 && Y(o);
143
+ }, [o, Z, P]);
144
+ const he = $(
145
+ (e) => {
146
+ if (e.stopPropagation(), !w) {
147
+ if (!c && m) {
148
+ const l = D();
149
+ l && q(l);
150
+ }
151
+ const t = e.currentTarget.dataset.keyboardshortcut, r = t ? !1 : !c;
152
+ y(r), r && M(), (c && x || t && x) && x();
153
+ }
154
+ },
155
+ [
156
+ w,
157
+ c,
158
+ y,
159
+ m,
160
+ D,
161
+ x,
162
+ M
163
+ ]
164
+ ), X = $(
165
+ (e) => {
166
+ if (u)
167
+ if (Array.isArray(a) && a.some((r) => r.value === e.value))
168
+ d(
169
+ a.filter(
170
+ (r) => r.value !== e.value
171
+ )
172
+ );
173
+ else {
174
+ const r = Array.isArray(a) ? a : [];
175
+ d([...r, e]);
176
+ }
177
+ else
178
+ d(e), y(!1), C && (i != null && i.tableId) && (window.iaTablePortalOpen || (window.iaTablePortalOpen = {}), window.iaTablePortalOpen[i.tableId] = !1);
179
+ },
180
+ [
181
+ u,
182
+ a,
183
+ d,
184
+ y,
185
+ C,
186
+ i == null ? void 0 : i.tableId
187
+ ]
188
+ ), ge = $(() => {
189
+ if (u) {
190
+ const e = h.filter((t) => !t.isDisabled);
191
+ d(e);
192
+ }
193
+ }, [u, h, d]), ve = $(() => {
194
+ u && d([]);
195
+ }, [u, d]), we = _(() => {
196
+ if (!u || !Array.isArray(a)) return !1;
197
+ const e = h.filter((t) => !t.isDisabled);
198
+ return e.length > 0 && a.length === e.length;
199
+ }, [u, a, h]), Ce = $(
200
+ (e) => {
201
+ const t = e.target.value.toLowerCase();
202
+ me(t), j(-1);
203
+ const r = S && B.current ? J.current : Z || o;
204
+ if (t) {
205
+ const l = r.filter((n) => n.label && typeof n.label == "string" ? n.label.toLowerCase().includes(t) : n.value && typeof n.value == "string" ? n.value.toLowerCase().includes(t) : n.label && typeof n.label == "number" ? n.label == Number(t) : n.value && typeof n.value == "number" ? n.value == Number(t) : !1);
206
+ S && B.current ? G(l) : P ? P(l) : Y(l);
207
+ } else
208
+ S && B.current ? G(J.current) : P ? P(o) : Y(o);
209
+ },
210
+ [o, Z, P, S]
211
+ );
212
+ V(() => {
213
+ if (!c) return;
214
+ const e = (t) => {
215
+ const r = h.filter((l) => !l.isDisabled);
216
+ switch (t.key) {
217
+ case "ArrowDown":
218
+ t.preventDefault(), t.stopPropagation(), j((l) => {
219
+ const n = l < r.length - 1 ? l + 1 : 0;
220
+ return setTimeout(() => {
221
+ var I;
222
+ const g = (I = A.current) == null ? void 0 : I.querySelector(
223
+ `[data-option-index="${n}"]`
224
+ );
225
+ g == null || g.scrollIntoView({ block: "nearest" });
226
+ }, 0), n;
227
+ });
228
+ break;
229
+ case "ArrowUp":
230
+ t.preventDefault(), t.stopPropagation(), j((l) => {
231
+ const n = l > 0 ? l - 1 : r.length - 1;
232
+ return setTimeout(() => {
233
+ var I;
234
+ const g = (I = A.current) == null ? void 0 : I.querySelector(
235
+ `[data-option-index="${n}"]`
236
+ );
237
+ g == null || g.scrollIntoView({ block: "nearest" });
238
+ }, 0), n;
239
+ });
240
+ break;
241
+ case "Enter":
242
+ if (t.preventDefault(), t.stopPropagation(), R >= 0 && R < r.length) {
243
+ const l = r[R];
244
+ l && !l.isDisabled && X(l);
245
+ }
246
+ break;
247
+ case "Escape":
248
+ t.preventDefault(), t.stopPropagation(), y(!1), C && (i != null && i.tableId) && (window.iaTablePortalOpen || (window.iaTablePortalOpen = {}), window.iaTablePortalOpen[i.tableId] = !1);
249
+ break;
250
+ }
251
+ };
252
+ return document.addEventListener("keydown", e), () => {
253
+ document.removeEventListener("keydown", e);
254
+ };
255
+ }, [
256
+ c,
257
+ h,
258
+ R,
259
+ X,
260
+ y,
261
+ C,
262
+ i
263
+ ]);
264
+ const be = _(() => {
265
+ if (!c || !p.current) return !1;
266
+ const e = p.current.getBoundingClientRect(), t = 250, r = window.innerHeight - e.bottom, l = e.top;
267
+ return r < t && l > r;
268
+ }, [c]), ye = `ia-table-select-container d-flex justify-content-between align-items-center ${w ? "ia-table-select-disabled" : ""} ${c ? "ia-table-select-open" : ""} ${C ? "ia-table-selectrenderer" : ""} ${oe}`, xe = () => {
269
+ var l;
270
+ const e = h.filter((n) => !n.isDisabled), t = m ? b == null ? void 0 : b.openAbove : be, r = /* @__PURE__ */ T(
271
+ "div",
272
+ {
273
+ ref: A,
274
+ className: `ia-table-select-dropdown d-flex flex-column ${t ? "ia-table-select-dropdown-above" : ""}`,
275
+ onClick: (n) => n.stopPropagation(),
276
+ style: {
277
+ ...m && b ? {
278
+ position: "fixed",
279
+ top: b.openAbove ? "auto" : `${b.top}px`,
280
+ bottom: b.openAbove ? `${window.innerHeight - (((l = p.current) == null ? void 0 : l.getBoundingClientRect().top) || 0)}px` : "auto",
281
+ left: `${b.left}px`,
282
+ width: `${b.width}px`
283
+ } : { width: N }
284
+ },
285
+ children: [
286
+ /* @__PURE__ */ s(
287
+ Le,
288
+ {
289
+ inputRef: U,
290
+ type: "text",
291
+ value: ue,
292
+ onChange: Ce,
293
+ placeholder: "Search here..."
294
+ }
295
+ ),
296
+ u && h && h.length > 0 && !ne && /* @__PURE__ */ T("div", { className: "ia-table-select-all-row d-flex align-items-center justify-content-between", children: [
297
+ /* @__PURE__ */ T(
298
+ "div",
299
+ {
300
+ className: "ia-table-select-option ia-table-select-all-option cursor-pointer d-flex align-items-center gap-6",
301
+ onClick: (n) => {
302
+ n.stopPropagation(), ge();
303
+ },
304
+ children: [
305
+ we ? /* @__PURE__ */ s(re, { className: "icon-16" }) : /* @__PURE__ */ s(le, { className: "icon-16" }),
306
+ /* @__PURE__ */ s("span", { children: "Select All" })
307
+ ]
308
+ }
309
+ ),
310
+ Array.isArray(a) && a.length > 0 && /* @__PURE__ */ s(
311
+ "button",
312
+ {
313
+ className: "ia-table-select-clear-btn cursor-pointer",
314
+ onClick: (n) => {
315
+ n.stopPropagation(), ve();
316
+ },
317
+ children: "Clear"
318
+ }
319
+ )
320
+ ] }),
321
+ /* @__PURE__ */ s("div", { className: "ia-table-select-options d-flex flex-column gap-2", children: ne ? /* @__PURE__ */ s(Ne, { size: "small" }) : h && h.length > 0 ? h.map((n) => {
322
+ const g = e.findIndex(
323
+ (L) => L.value === n.value
324
+ ), I = g === R;
325
+ return /* @__PURE__ */ T(
326
+ "div",
327
+ {
328
+ "data-option-index": g,
329
+ className: `ia-table-select-option cursor-pointer d-flex align-items-center gap-6 ${u ? Array.isArray(a) && a.some(
330
+ (L) => L.value === n.value
331
+ ) ? "ia-table-select-option-selected" : "" : a && !Array.isArray(a) && a.value === n.value ? "ia-table-select-option-selected" : ""} ${n.isDisabled ? "ia-table-option-disabled" : ""} ${I ? "ia-table-select-option-highlighted" : ""}`,
332
+ onClick: (L) => {
333
+ L.stopPropagation(), n.isDisabled || X(n);
334
+ },
335
+ onMouseEnter: () => {
336
+ n.isDisabled || j(g);
337
+ },
338
+ onMouseLeave: () => {
339
+ n.isDisabled || j(-1);
340
+ },
341
+ children: [
342
+ u && Array.isArray(a) && a.some(
343
+ (L) => L.value === n.value
344
+ ) ? /* @__PURE__ */ s(re, { className: "icon-16" }) : u ? /* @__PURE__ */ s(le, { className: "icon-16" }) : null,
345
+ /* @__PURE__ */ s("span", { children: n.label })
346
+ ]
347
+ },
348
+ n.value
349
+ );
350
+ }) : /* @__PURE__ */ s("div", { className: "ia-table-select-no-options", children: "No options available" }) })
351
+ ]
352
+ }
353
+ );
354
+ return m ? Se(r, document.body) : r;
355
+ };
356
+ return /* @__PURE__ */ T(
357
+ "div",
358
+ {
359
+ className: `ia-table-selectbox-container ${C && w ? "ia-table-cell-render-select-disabled" : ""}`,
360
+ style: { width: N },
361
+ children: [
362
+ f && /* @__PURE__ */ s("label", { className: "ia-table-select-label", children: f }),
363
+ /* @__PURE__ */ T(
364
+ "div",
365
+ {
366
+ ref: p,
367
+ className: ye,
368
+ onClick: he,
369
+ children: [
370
+ /* @__PURE__ */ s("div", { className: "ia-table-select-value", children: a ? u ? Array.isArray(a) && a.length > 0 ? a.length === 1 ? a[0].label : `${a.length} items selected` : "Select" : Array.isArray(a) ? "Select" : a.label : u ? "Select" : "Select an option" }),
371
+ (u ? Array.isArray(a) && a.length > 0 : a) && ce && /* @__PURE__ */ s(
372
+ "button",
373
+ {
374
+ className: "ia-table-select-reset cursor-pointer flex-shrink-0 d-flex align-items-center justify-content-center",
375
+ onClick: (e) => {
376
+ e.stopPropagation(), d([]);
377
+ },
378
+ children: /* @__PURE__ */ s(De, { className: "icon-10" })
379
+ }
380
+ ),
381
+ /* @__PURE__ */ s(
382
+ "div",
383
+ {
384
+ className: "ia-table-select-arrow d-flex align-items-center icon-16 justify-content-center",
385
+ style: {
386
+ marginLeft: a ? "0" : "8px"
387
+ },
388
+ children: /* @__PURE__ */ s(
389
+ ke,
390
+ {
391
+ className: `icon-16 ${c ? "ia-table-rotate-270" : "ia-table-rotate-90"}`
392
+ }
393
+ )
394
+ }
395
+ )
396
+ ]
397
+ }
398
+ ),
399
+ c && xe()
400
+ ]
401
+ }
402
+ );
403
+ }, je = pe(He), Be = (f) => /* @__PURE__ */ v.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...f }, /* @__PURE__ */ v.createElement("path", { d: "M3.62057 16C3.15514 16 2.75754 15.8327 2.42777 15.498C2.09814 15.1632 1.93333 14.7595 1.93333 14.287V2.25959H1V0.838165H5.2V0H10.8V0.838165H15V2.25959H14.0667V14.287C14.0667 14.7657 13.9033 15.1708 13.5767 15.5025C13.25 15.8342 12.8509 16 12.3794 16H3.62057ZM12.6667 2.25959H3.33333V14.287C3.33333 14.3721 3.36024 14.442 3.41407 14.4966C3.46789 14.5513 3.53672 14.5786 3.62057 14.5786H12.3794C12.4513 14.5786 12.5171 14.5482 12.5768 14.4874C12.6367 14.4267 12.6667 14.3599 12.6667 14.287V2.25959ZM5.57707 12.6833H6.97683V4.15482H5.57707V12.6833ZM9.02317 12.6833H10.4229V4.15482H9.02317V12.6833Z", fill: "#B4BAC7" })), Ae = (f) => /* @__PURE__ */ v.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 6 9", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...f }, /* @__PURE__ */ v.createElement("path", { d: "M0.725024 8.3419C0.612116 8.23649 0.555663 8.1117 0.555663 7.96751C0.555663 7.8236 0.612116 7.69894 0.725024 7.59354L4.03321 4.50527L0.713734 1.40646C0.608354 1.30808 0.555664 1.18511 0.555664 1.03755C0.555664 0.889987 0.612118 0.763505 0.725025 0.658103C0.837932 0.552701 0.971615 0.5 1.12607 0.5C1.28023 0.5 1.41376 0.552701 1.52667 0.658103L5.32035 4.21015C5.36552 4.25231 5.39758 4.29798 5.41655 4.34717C5.43522 4.39635 5.44455 4.44906 5.44455 4.50527C5.44455 4.56148 5.43522 4.61419 5.41655 4.66337C5.39758 4.71256 5.36552 4.75823 5.32035 4.80039L1.51537 8.35244C1.40999 8.45081 1.28023 8.5 1.12607 8.5C0.971613 8.5 0.837931 8.4473 0.725024 8.3419Z", fill: "#60697D" }));
404
+ export {
405
+ Pe as S,
406
+ je as a,
407
+ Le as b,
408
+ Be as c,
409
+ ke as d,
410
+ Ae as e,
411
+ Ie as f,
412
+ Ee as u
413
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ia-table",
3
- "version": "0.15.0",
3
+ "version": "0.15.2",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "moment": "^2.0.0",