ia-table 0.14.8 → 0.15.0

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,1339 +0,0 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('button.ia-table-btn{border:none;border-radius:8px;text-decoration:none;font-size:14px;font-weight:500;font-family:Manrope,sans-serif;line-height:20px}button.ia-table-btn-url{background-color:transparent;color:#4259ee}button.ia-table-btn-url svg{padding:2px}button.ia-table-btn-url.ia-table-btn-icon{width:24px;height:24px}button.ia-table-btn-primary{background-color:#4259ee;color:#fff}button.ia-table-btn-link{color:#4259ee;background-color:transparent}button.ia-table-btn-danger{color:#fff;background-color:#e15554}button.ia-table-btn-tertiary{border:1px solid #c3c8d4;color:#1f2b4d;background-color:#fff}button.ia-table-btn-tertiary svg{padding:2px!important}button.ia-table-btn-tertiary:hover{border-color:#4259ee;color:#4259ee}button.ia-table-btn-tertiary:hover svg path{fill:#4259ee}button.ia-table-btn-icon{padding:0}button.ia-table-btn.ia-table-btn-disabled{background-color:#c3c8d4;color:#fff}button.ia-table-btn.ia-table-btn-disabled svg path{fill:#b4bac7}button.ia-table-btn-text{height:32px;max-height:32px;border-radius:8px;background-color:#f5f6fa;padding:8px;display:flex;align-items:center;justify-content:center;color:#60697d}button.ia-table-btn-text.ia-table-btn-disabled{background-color:#f8f9fb}button.ia-table-btn-text.ia-table-btn-icon{color:#60697d}button.ia-table-btn-text.ia-table-btn-icon-color{background-color:#eceefd}button.ia-table-btn-text.ia-table-btn-icon-color svg path{fill:#3649c6}button.ia-table-btn svg{height:16px;width:16px;display:flex;align-items:center;justify-content:center}button.ia-table-btn:focus svg path{fill:#3649c6}button.ia-table-btn-small{height:24px;min-width:24px;padding:2px 4px}button.ia-table-btn-small .ia-table-btn-text{padding:2px 12px}button.ia-table-btn-medium{height:28px;min-width:28px;padding:4px 6px}button.ia-table-btn-medium .ia-table-btn-text{padding:4px 12px}button.ia-table-btn-large{height:32px;min-width:32px;padding:6px 8px}button.ia-table-btn.ia-table-btn-simple{width:auto;height:auto;min-width:auto;padding:0}button.ia-table-btn.ia-table-btn-simple svg{padding:0}.tooltip-container{position:relative;display:inline-block}.tooltip{position:absolute;background-color:#1976d2;color:#fff;font-family:Manrope,sans-serif;border-radius:6px;font-size:14px;z-index:9999;box-shadow:0 2px 8px #0003;white-space:normal;max-width:400px;overflow-wrap:break-word;display:flex;align-items:center;justify-content:center;text-align:center;opacity:0;pointer-events:none;transition:opacity .2s ease-in-out}.tooltip-title{font-family:Manrope;font-weight:500;font-size:14px;line-height:20px;vertical-align:middle;padding:6px 12px}.tooltip.tooltip-visible{opacity:1;pointer-events:auto}.tooltip--primary{background:var(--Colors-Primary-Surface-Darker, rgb(54, 73, 198));color:#fff}.tooltip--secondary{background:var(--Colors-Neutrals-Surface-White, rgb(255, 255, 255));color:#000;border:1px solid #ccc}.tooltip--tertiary{background:var(--Colors-Neutrals-Text-icon-Title, rgb(13, 21, 44));color:#fff}.tooltip-arrow{position:absolute;width:10px;height:10px;background-color:inherit;transform:rotate(45deg)}.tooltip--top .tooltip-arrow{bottom:-5px}.tooltip--bottom .tooltip-arrow{top:-5px}.tooltip--left .tooltip-arrow{right:-5px}.tooltip--right .tooltip-arrow{left:-5px}.tooltip-header{padding:8px 12px}.body-text span{display:block;width:100%;text-align:justify;white-space:normal;overflow-wrap:break-word;word-break:break-word;overflow:hidden;text-overflow:ellipsis}.tooltip-btns{align-self:flex-end;gap:4px;margin-left:auto}.tooltip-btn{font-size:8px;border-radius:4px;padding:6px 12px;cursor:pointer;transition:background-color .2s ease,color .2s ease;border:none}.btn-no-bg{background:transparent;color:inherit;border:none;padding:0;min-width:auto}.btn--primary{background-color:#1976d2;color:#fff}.btn--primary:hover{background-color:#1565c0}.btn--secondary{background-color:#fff;color:#333}.btn--secondary:hover{background-color:#fff}.btn--default{background:transparent;color:inherit;border:none;padding:0;min-width:auto}.tooltip-illustration{margin:0;padding:0}.tooltip-illustration img{width:100%;max-width:100%;height:120px;object-fit:cover;border-radius:4px}.tooltip-close{background:none;position:relative;border:none;font-size:16px;cursor:pointer;color:inherit;padding:0;margin-left:auto;flex-shrink:0;width:24px;height:24px;border-radius:50%;transition:background-color .2s ease}.tooltip-close:hover{background-color:#ffffff1a}.tooltip-pagination{justify-content:flex-start;gap:5px;max-width:100%;overflow:hidden}.tooltip-pagination-bar{width:20px;height:5px;border-radius:1px;background-color:#fff;flex-shrink:0}.tooltip-pagination-bar.secondary-variant{background-color:#1976d2}.ia-table-badge{display:inline-flex;border-radius:100px;font-family:Manrope,sans-serif;font-weight:500;white-space:nowrap;padding:0 8px;max-width:-webkit-fill-available}.ia-table-badge-size-small{height:20px;font-size:10px;line-height:16px}.ia-table-badge-size-default{height:24px;font-size:12px;line-height:16px}.ia-table-badge-filled.ia-table-badge-default{background-color:#5f6673;color:#fff}.ia-table-badge-filled.ia-table-badge-success{background-color:#0f8431;color:#fff}.ia-table-badge-filled.ia-table-badge-warning{background-color:#8b6f06;color:#1f2b4d}.ia-table-badge-filled.ia-table-badge-error{background-color:#d62f4c;color:#fff}.ia-table-badge-filled.ia-table-badge-info{background-color:#4159ee;color:#fff}.ia-table-badge-stroke{background-color:#fff}.ia-table-badge-stroke.ia-table-badge-default{border:1px solid #5f6673;color:#5f6673}.ia-table-badge-stroke.ia-table-badge-success{border:1px solid #0f8431;color:#0f8431}.ia-table-badge-stroke.ia-table-badge-warning{border:1px solid #8b6f06;color:#8b6f06}.ia-table-badge-stroke.ia-table-badge-error{border:1px solid #d62f4c;color:#d62f4c}.ia-table-badge-stroke.ia-table-badge-info{border:1px solid #4159ee;color:#4159ee}.ia-table-badge-subtile.ia-table-badge-default{background:#f2f3f4;color:#5f6673}.ia-table-badge-subtile.ia-table-badge-success{background:#f4fff7;color:#0f8431}.ia-table-badge-subtile.ia-table-badge-warning{background:#fdfae9;color:#8b6f06}.ia-table-badge-subtile.ia-table-badge-error{background:#fef4f5;color:#d62f4c}.ia-table-badge-subtile.ia-table-badge-info{background:#f1f3fe;color:#4159ee}.ia-table-badge-label{display:inline-block}.ia-table-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:#00000080;z-index:1000;animation:ia-table-modal-fade-in .2s ease-out}.ia-table-modal-overlay .ia-table-modal{background-color:#fff;border-radius:8px;box-shadow:0 4px 16px #00000029;max-height:90vh;animation:ia-table-modal-slide-in .2s ease-out;position:relative;max-width:95vw;overflow:hidden}.ia-table-modal-overlay .ia-table-modal-small{width:400px}.ia-table-modal-overlay .ia-table-modal-medium{width:600px}.ia-table-modal-overlay .ia-table-modal-large{width:800px}.ia-table-modal-overlay .ia-table-modal .ia-table-modal-header{min-height:48px;padding:12px 16px;background-color:#eceefd;flex-shrink:0}.ia-table-modal-overlay .ia-table-modal .ia-table-modal-header .ia-table-modal-title{font-family:Manrope,sans-serif;font-weight:800;font-size:16px;line-height:24px;color:#0d152c;margin:0}.ia-table-modal-overlay .ia-table-modal .ia-table-modal-content{padding:16px;flex:1;overflow-y:auto;min-height:100px}.ia-table-modal-overlay .ia-table-modal .ia-table-modal-footer{border-top:1px solid #d9dde7;padding:12px 16px;height:56px;flex-shrink:0;background-color:#fff;border-radius:0 0 8px 8px}@keyframes ia-table-modal-fade-in{0%{opacity:0}to{opacity:1}}@keyframes ia-table-modal-slide-in{0%{transform:translateY(-20px);opacity:0}to{transform:translateY(0);opacity:1}}@media(max-width:768px){.ia-table-modal-overlay .ia-table-modal-small,.ia-table-modal-overlay .ia-table-modal-medium,.ia-table-modal-overlay .ia-table-modal-large{width:95vw}}.ia-table-inputbox-container{width:100%;font-family:Manrope,sans-serif;height:32px;margin:0;padding:0}.ia-table-inputbox-container .ia-table-input-label{font-size:12px;font-weight:500;color:#60697d;line-height:16px;margin-bottom:6px}.ia-table-inputbox-container .ia-table-input-container{width:100%;height:inherit;border:1px solid #d9dde7;border-radius:8px;background-color:#fff;padding:0 12px;transition:all .2s ease-in-out;margin:0}.ia-table-inputbox-container .ia-table-input-container:hover:not(.ia-table-input-disabled,.ia-table-cellrender-input){border-color:#4259ee}.ia-table-inputbox-container .ia-table-input-container:focus-within:not(.ia-table-input-disabled,.ia-table-cellrender-input){border-color:#4259ee}.ia-table-inputbox-container .ia-table-input-container.ia-table-input-error{border-color:#ff3b30}.ia-table-inputbox-container .ia-table-input-container.ia-table-input-disabled{background-color:#f7f7f7;border-color:#e2e8f0;cursor:not-allowed}.ia-table-inputbox-container .ia-table-input-container.ia-table-cellrender-input{border:none}.ia-table-inputbox-container .ia-table-input-container.has-left-icon{padding-left:8px}.ia-table-inputbox-container .ia-table-input-container.has-right-icon{padding-right:8px}.ia-table-inputbox-container .ia-table-input-container.has-left-icon-button{padding-left:8px}.ia-table-inputbox-container .ia-table-input-container.has-right-icon-button{padding-right:8px}.ia-table-inputbox-container .ia-table-input-container .left-input-icon,.ia-table-inputbox-container .ia-table-input-container .right-input-icon,.ia-table-inputbox-container .ia-table-input-container .left-input-icon-button,.ia-table-inputbox-container .ia-table-input-container .right-input-icon-button{height:24px;color:#60697d}.ia-table-inputbox-container .ia-table-input-container .left-input-icon svg,.ia-table-inputbox-container .ia-table-input-container .right-input-icon svg,.ia-table-inputbox-container .ia-table-input-container .left-input-icon-button svg,.ia-table-inputbox-container .ia-table-input-container .right-input-icon-button svg{width:16px;height:16px}.ia-table-inputbox-container .ia-table-input-container .left-input-icon.hidden,.ia-table-inputbox-container .ia-table-input-container .right-input-icon.hidden,.ia-table-inputbox-container .ia-table-input-container .left-input-icon-button.hidden,.ia-table-inputbox-container .ia-table-input-container .right-input-icon-button.hidden{opacity:0;visibility:hidden;transition:opacity .2s ease-in-out,visibility .2s ease-in-out}.ia-table-inputbox-container .ia-table-input-container .left-input-icon.hidden.ia-table-body-cell-lock,.ia-table-inputbox-container .ia-table-input-container .right-input-icon.hidden.ia-table-body-cell-lock,.ia-table-inputbox-container .ia-table-input-container .left-input-icon-button.hidden.ia-table-body-cell-lock,.ia-table-inputbox-container .ia-table-input-container .right-input-icon-button.hidden.ia-table-body-cell-lock{opacity:1;visibility:visible}.ia-table-inputbox-container .ia-table-input-container .left-input-icon.hidden.ia-table-body-cell-lock svg path,.ia-table-inputbox-container .ia-table-input-container .right-input-icon.hidden.ia-table-body-cell-lock svg path,.ia-table-inputbox-container .ia-table-input-container .left-input-icon-button.hidden.ia-table-body-cell-lock svg path,.ia-table-inputbox-container .ia-table-input-container .right-input-icon-button.hidden.ia-table-body-cell-lock svg path{fill:#b4bac7}.ia-table-inputbox-container .ia-table-input-container .left-input-icon.visible,.ia-table-inputbox-container .ia-table-input-container .right-input-icon.visible,.ia-table-inputbox-container .ia-table-input-container .left-input-icon-button.visible,.ia-table-inputbox-container .ia-table-input-container .right-input-icon-button.visible{opacity:1;visibility:visible;transition:opacity .2s ease-in-out,visibility .2s ease-in-out}.ia-table-inputbox-container .ia-table-input-container .ia-table-input-wrapper{flex:1;height:100%;margin:0;padding:0}.ia-table-inputbox-container .ia-table-input-container .ia-table-input-wrapper .ia-table-input{width:100%;height:100%;border:none;outline:none;background:transparent;font-size:14px;font-weight:400;color:#1f2b4d;padding:0 4px;margin:0}.ia-table-inputbox-container .ia-table-input-container .ia-table-input-wrapper .ia-table-input::placeholder{color:#a0a8b1}.ia-table-inputbox-container .ia-table-input-container .ia-table-input-wrapper .ia-table-input:disabled{cursor:not-allowed;color:#a0a8b1}.ia-table-inputbox-container .ia-table-input-container .ia-table-input-wrapper .ia-table-input::-webkit-inner-spin-button,.ia-table-inputbox-container .ia-table-input-container .ia-table-input-wrapper .ia-table-input::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0}.ia-table-inputbox-container .ia-table-input-container .ia-table-input-wrapper .ia-table-input[type=number]{-moz-appearance:textfield;-webkit-appearance:textfield;appearance:textfield}.ia-table-inputbox-container .ia-table-input-error-message{font-size:12px;font-weight:400;color:#ff3b30;margin-top:4px}.ia-table-cell-render-input-disabled{cursor:not-allowed;border:none!important;background-color:#fafafa!important}.ia-table-cell-render-input-disabled input{color:#b4bac7!important;font-weight:400!important}.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-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}.ia-checkbox-container{-webkit-user-select:none;user-select:none}.ia-checkbox-input,.ia-checkbox-icon{width:16px;height:16px}.ia-checkbox-input{position:absolute;opacity:0;margin:0}.ia-checkbox-custom{width:16px;height:16px;transition:all .2s ease}.ia-checkbox-label{font-family:Manrope,sans-serif;font-weight:500;font-size:14px;line-height:20px;color:#60697d}.ia-checkbox-disabled{opacity:.5;cursor:not-allowed}.ia-checkbox-disabled .ia-checkbox-input,.ia-checkbox-disabled .ia-checkbox-custom{cursor:not-allowed}.ia-checkbox-container:not(.ia-checkbox-disabled):hover .ia-checkbox-custom{opacity:.9}.ia-checkbox-input:focus-visible+.ia-checkbox-custom{outline-offset:1px}.ia-table-radio-group-container{width:100%}.ia-table-radio-group-container.vertical{flex-direction:column}.ia-table-radio-group-container.horizontal{flex-direction:row}.ia-table-radio-option{padding:0;margin:0;-webkit-user-select:none;user-select:none;font-family:Manrope,sans-serif;font-weight:500;font-size:14px;line-height:20px;color:#60697d}.ia-table-radio-input{opacity:0;height:0;width:0}.ia-table-radio-custom{height:16px;width:16px;min-width:16px;background-color:#fff;border:1px solid #c3c8d4;border-radius:50%;transition:all .2s ease}.ia-table-radio-custom:after{content:"";position:absolute;display:none;width:8px;height:8px;border-radius:50%;background:#4259ee}.ia-table-radio-input:checked~.ia-table-radio-custom{border-color:#4259ee}.ia-table-radio-input:checked~.ia-table-radio-custom:after{display:block}.ia-table-radio-input:focus-visible~.ia-table-radio-custom{box-shadow:0 0 0 3px #4259ee33;outline:none}.ia-table-radio-input:disabled~.ia-table-radio-custom{background-color:#f4f5f7;border-color:#dfe1e6;cursor:not-allowed}.ia-table-radio-input:disabled~.ia-table-radio-custom:after{background:#a5adba}.ia-table-radio-input:disabled~.ia-table-radio-label{color:#a5adba;cursor:not-allowed}.ia-table-radio-label.ia-table-radio-label-selected{color:#1f2b4d}')),document.head.appendChild(t)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
- import { jsxs as M, jsx as m } from "react/jsx-runtime";
3
- import * as S from "react";
4
- import { useRef as q, useEffect as V, memo as ne, useCallback as U, useState as J, useMemo as we } from "react";
5
- import { createPortal as re } from "react-dom";
6
- const Fe = 200, Ze = 2, Ce = 56, Ee = 48, Oe = {
7
- default: {
8
- height: 46,
9
- padding: 24
10
- },
11
- compact: {
12
- height: 30,
13
- padding: 9
14
- },
15
- comfortable: {
16
- height: 52,
17
- padding: 32
18
- }
19
- }, Ue = {
20
- 46: "32px",
21
- 30: "24px",
22
- 52: "32px"
23
- }, Be = 16, Ge = [
24
- "int",
25
- "str",
26
- "percentage",
27
- "number",
28
- "date",
29
- "datetime",
30
- "time",
31
- "float",
32
- "dollar",
33
- "decimal",
34
- "DateTimeField",
35
- "daterangepicker",
36
- "list",
37
- "dropdown"
38
- ], qe = 0, ze = "furthestFromViewport", Ye = 2, Ke = !1, Xe = "infiniteCache", Je = {
39
- maxPersistedBlocks: 5,
40
- persistBlockData: !0,
41
- compressionEnabled: !1
42
- }, Qe = 1e6, le = 3, et = 7, tt = 6, nt = ({
43
- isFrozen: e,
44
- column: t,
45
- frozenColumns: n
46
- }) => {
47
- const l = e && t.pinned !== "right", a = e && t.pinned === "right", i = F(t), o = l && n.positions ? n.positions[i] : null, c = l && n.indexes ? n.indexes.indexOf(i) : null, r = a && n.rightPinned && n.rightPinned.positions ? n.rightPinned.positions[i] : null;
48
- return {
49
- isPinnedLeft: l,
50
- isPinnedRight: a,
51
- frozenPosition: o,
52
- frozenIndex: c,
53
- rightPinnedPosition: r
54
- };
55
- }, ye = (e, t, n) => e ? t || n ? Ee : Ce : 0, it = (e, t) => {
56
- let n = e;
57
- return t.includes(".") && !n[t] ? (t.split(".").every((a) => n[a] ? (n = n[a], !0) : !1), n) : Object.prototype.hasOwnProperty.call(n, t);
58
- }, F = (e) => e && (e.colId || e.field || e.column_name || e.accessor || e.groupId || e.headerName) || "", Ne = (e, t = !1) => e.uniqueHierarchyId ? t && e.originalPath ? e.originalPath : e.path || [] : e.path || [], W = (e) => e.is_hidden || e.hidden || e.hide || !1, Y = (e, t, n) => {
59
- let l = t;
60
- return e.length <= t && (l = e.findIndex((a) => a === n)), l >= 1 && e.length > 1 ? `${e.slice(0, l).join("/")}/${n ?? ""}` : n ?? "";
61
- }, oe = (e, t = 0) => !e || !e.length ? t : e.every(
62
- (l) => l.headerName === ""
63
- ) ? t - 1 : Math.max(
64
- ...e.map((l) => l.children && l.children.length ? oe(l.children, t + 1) : t),
65
- t
66
- ), $e = (e, t) => {
67
- if (!Array.isArray(e) || t < 0) return [];
68
- if (t === 0) {
69
- const c = /* @__PURE__ */ new Set(), r = [];
70
- for (const u of e) {
71
- const s = u.path;
72
- if (!(s != null && s.length) || !s[0]) continue;
73
- F(u) === s[0] ? r.push(`null-${s[0]}`) : c.has(s[0]) || (c.add(s[0]), r.push(s[0]));
74
- }
75
- return r;
76
- }
77
- const n = /* @__PURE__ */ Object.create(null), l = /* @__PURE__ */ new Map(), a = [], i = [];
78
- let o;
79
- for (const c of e) {
80
- const r = c.path;
81
- if (!(r != null && r.length) || !r[0]) continue;
82
- const u = r[0];
83
- n[u] || (n[u] = [], a.push(u)), n[u].push(r);
84
- const s = F(c);
85
- s && l.set(r, s);
86
- }
87
- for (let c = 0; c < a.length; c++) {
88
- const r = n[a[c]];
89
- if (r.length > 1 && r.some((s) => s.length > 1))
90
- for (const s of r) {
91
- const p = l.get(s);
92
- if (s.length > t) {
93
- const d = s[t];
94
- if (p === s[t]) {
95
- const h = Y(
96
- s,
97
- t,
98
- p
99
- );
100
- i.push(`null-${h}`), o = `null-${p}`;
101
- } else if (d !== o) {
102
- const h = Y(
103
- s,
104
- t,
105
- d
106
- );
107
- i.push(h), o = d;
108
- }
109
- } else {
110
- const d = Y(
111
- s,
112
- t,
113
- p
114
- ), h = d ? `null-${d}` : "null", f = p ? `null-${p}` : "null";
115
- i.push(h), o = f;
116
- }
117
- }
118
- else {
119
- const s = r[0], p = l.get(s), d = Y(
120
- s,
121
- t,
122
- p
123
- );
124
- if (s.length > t) {
125
- const h = s[t];
126
- if (p === s[t])
127
- i.push(`null-${d}`);
128
- else if (h !== i[i.length - 1]) {
129
- const f = Y(
130
- s,
131
- t,
132
- h
133
- );
134
- i.push(f);
135
- }
136
- } else {
137
- const h = d ? `null-${d}` : "null";
138
- i.push(h);
139
- }
140
- }
141
- }
142
- return i;
143
- }, xe = (e) => {
144
- const t = {}, n = (l) => {
145
- Array.isArray(l) && l.forEach((a) => {
146
- var u;
147
- if (typeof a != "object" || a === null) return;
148
- const i = F(a), o = Y(
149
- a.path || [],
150
- (((u = a.path) == null ? void 0 : u.length) || 1) - 1,
151
- i
152
- ), c = a.value ? `[${a.value}]` : "", r = o ? `${o}${c}`.toLowerCase() : "";
153
- r && (t[r] = a), o && !t[o.toLowerCase()] && (t[o.toLowerCase()] = a), Array.isArray(a.children) && n(a.children);
154
- });
155
- };
156
- return n(e), t;
157
- }, at = (e) => {
158
- const t = {}, n = (l) => {
159
- Array.isArray(l) && l.forEach((a) => {
160
- if (!(typeof a != "object" || a === null))
161
- if (!Array.isArray(a.children) || a.children.length === 0) {
162
- const i = F(a);
163
- i && (t[i.toLowerCase()] = a);
164
- } else
165
- n(a.children);
166
- });
167
- };
168
- return n(e), t;
169
- }, ce = (e, t, n = 0, l = null, a = 150, i = [], o = [], c = !1, r = null) => !e || !Array.isArray(e) ? {} : { processedColumns: e.map((s) => {
170
- var P;
171
- const p = s.autoHeight === !0 || c, d = F(s), h = s.value ? `${d}[${s.value}]` : d, f = [...o, h], g = s.children && s.children.length > 0, y = s.children && s.children.some((K) => K.columnGroupShow !== "open") || !1, v = ((P = s.children) == null ? void 0 : P.length) && !y, N = t.isAllGroupExpanded || t[d] === !0 || i.includes(d) || v || !1, x = l ? t[l] === !0 || t.isAllGroupExpanded || i.includes(l) || v : !0, L = s.columnGroupShow === "open" && !x || !l && W(s);
172
- N && x && t[d] !== !0 && !i.includes(d) && v && i.push(d);
173
- const T = g ? ce(
174
- s.children || [],
175
- t,
176
- n + 1,
177
- h,
178
- // Use pathIdentifier (includes value) for unique parent field
179
- a,
180
- i,
181
- f,
182
- // Pass current path to children
183
- p,
184
- // Pass down autoHeight to children
185
- r
186
- // Pass down column counts
187
- ) : {}, k = g ? T.processedColumns.reduce(
188
- (K, X) => K + (X.colSpan || 1),
189
- 0
190
- ) : 1, Z = l !== null, I = Z ? !1 : L, A = Object.prototype.hasOwnProperty.call(
191
- s,
192
- "headerName"
193
- ), j = !g, $ = {
194
- ...s,
195
- level: n,
196
- parentField: l,
197
- // Store the unique path identifier for this column (includes value for pivot columns)
198
- pathIdentifier: h,
199
- path: f,
200
- // Track column's position in the hierarchy
201
- notApplyGrouping: v,
202
- headerName: s.headerName || s.label || (A ? "" : F(s)),
203
- hasChildren: g,
204
- isExpanded: N,
205
- hidden: I,
206
- is_hidden: L,
207
- belongsToColumnGroup: Z,
208
- children: T.processedColumns || [],
209
- colSpan: k,
210
- field: s.field || F(s),
211
- is_frozen: s.is_frozen || s.pinned === "left" || s.pinned === "right",
212
- pinned: s.pinned ? s.pinned : s.is_frozen ? "left" : null,
213
- // rowSpan: 1, // Will be adjusted during header rendering
214
- isLeaf: j,
215
- autoHeight: p,
216
- // Explicitly set autoHeight based on parent or own value
217
- isSearchable: s.isSearchable || s.is_searchable
218
- };
219
- return r && j && !L && ($.is_frozen && $.pinned !== "right" || $.pinned === "left" ? r.left++ : $.is_frozen && $.pinned === "right" ? r.right++ : r.normal++), $;
220
- }), initialGroupedColumns: i };
221
- let se = 0;
222
- const Le = (e, {
223
- pinnedType: t,
224
- minWidth: n = 150
225
- } = {}) => {
226
- if (!e || !Array.isArray(e))
227
- return { headerRows: [], leafColumns: [] };
228
- se = 0;
229
- const l = (p) => W(p) ? !1 : t === "leftPinnedOnly" ? ee(p) : t === "rightPinnedOnly" ? te(p) : t === "normal" ? !ee(p) && !te(p) : !0, a = oe(e), i = Array(a + 1).fill(null).map(() => []), o = [];
230
- de(
231
- e,
232
- i,
233
- o,
234
- /* @__PURE__ */ new Set(),
235
- a,
236
- l
237
- ), Math.max(...i.map((p) => p.length));
238
- const r = [];
239
- i.forEach((p, d) => {
240
- if (d !== i.length - 1) {
241
- const h = $e(
242
- i[i.length - 1],
243
- d
244
- );
245
- r[d] = h;
246
- } else
247
- r[d] = p;
248
- });
249
- const u = xe(e), s = r.map(
250
- (p, d) => d === i.length - 1 ? p : p.map(
251
- (h, f) => {
252
- var g;
253
- if (h.startsWith("null")) {
254
- const y = (g = h.split("-")[1]) == null ? void 0 : g.toLowerCase(), v = u[y], N = (v == null ? void 0 : v.width) || n, x = (v == null ? void 0 : v.is_hidden) || !1;
255
- return {
256
- headerName: "",
257
- isPlaceholder: !0,
258
- isLastInGroup: !1,
259
- depth: d,
260
- colSpan: 1,
261
- rowSpan: 1,
262
- isLeaf: !1,
263
- isStandalone: !1,
264
- field: `empty_${d}_${f}`,
265
- id: `empty_${d}_${f}`,
266
- accessor: `empty_${d}_${f}`,
267
- width: N,
268
- is_hidden: x,
269
- emptyCell: !0,
270
- is_frozen: t === "leftPinnedOnly" || t === "rightPinnedOnly",
271
- pinned: t === "leftPinnedOnly" ? "left" : t === "rightPinnedOnly" ? "right" : null,
272
- children: [],
273
- childColumn: v
274
- };
275
- } else
276
- return u[h.toLowerCase()];
277
- }
278
- )
279
- );
280
- return s.forEach((p) => {
281
- let d = 0, h = 0;
282
- p.forEach((f) => {
283
- const g = He(f, f.hasChildren, n);
284
- f.width = g, d += f.isWithEmptyHeaderName ? 0 : g || 0, h += f.isParentWithChildEmptyHeaderName ? g : 0, f.isWithEmptyHeaderName ? (f.leftTotalWidth = d + g - h, h -= g) : f.leftTotalWidth = d;
285
- });
286
- }), {
287
- headerRows: s,
288
- leafColumns: o
289
- };
290
- }, de = (e, t, n, l, a, i, o = 0, c = [], r = !1) => {
291
- !e || !Array.isArray(e) || e.length === 0 || e.forEach((u) => {
292
- var L, T;
293
- const s = u.field || F(u), p = Ne(u, !0), d = u.value ? `[${u.value}]` : "", h = (p == null ? void 0 : p.length) > 1 ? `${p.slice(0, p.length - 1).join("/")}/${s}${d}` : `${s}${d}`;
294
- if (!i(u) || l.has(h))
295
- return;
296
- l.add(h);
297
- const f = u.children && u.children.some((k) => i(k)), g = f && ((T = (L = u.children) == null ? void 0 : L.every) == null ? void 0 : T.call(
298
- L,
299
- (k) => !k.headerName && !k.columnGroupShow
300
- )), y = !f || g, v = y ? a : o;
301
- y || se++;
302
- const N = y ? null : se % 2 === 0 ? "even-column-group" : "odd-column-group";
303
- u.colorClass = N || "";
304
- const x = {
305
- ...u,
306
- isLastInGroup: !1,
307
- // Will be set later
308
- depth: o,
309
- isLeaf: y,
310
- field: s,
311
- isStandalone: y || r,
312
- isParentWithChildEmptyHeaderName: g
313
- };
314
- t[v].push(x), g && u.children && (u.children.forEach((k) => {
315
- k.isLeaf = !0, k.isStandalone = !0, k.isWithEmptyHeaderName = !0;
316
- }), t[v].push(...u.children)), y && (n.push(x), g && n.push(...u.children || [])), f && !g && f && de(
317
- u.children || [],
318
- t,
319
- n,
320
- l,
321
- a,
322
- i,
323
- o + 1,
324
- [...c, s],
325
- !1
326
- );
327
- });
328
- }, st = (e, t, n = {}, l) => {
329
- const a = { left: 0, normal: 0, right: 0 }, {
330
- processedColumns: i
331
- // initialGroupedColumns
332
- } = ce(
333
- e,
334
- n,
335
- 0,
336
- null,
337
- l,
338
- [],
339
- [],
340
- !1,
341
- a
342
- ), { headerRows: o, leafColumns: c } = Le(i, {
343
- pinnedType: t,
344
- minWidth: l
345
- });
346
- return {
347
- secondRowColumns: c,
348
- // parentColumns: allParentColumns,
349
- // expandableParentColumns,
350
- headerRows: o,
351
- // New: Include the full header hierarchy
352
- // leafColumns, // New: All leaf nodes (columns with data)
353
- // initialGroupedColumns,
354
- globalColumnCounts: a,
355
- totalColumnsCount: a.left + a.normal + a.right
356
- };
357
- }, lt = (e, t) => {
358
- const n = (l) => l.reduce((a, i) => {
359
- if (W(i)) return a + 0;
360
- if (i.children && i.children.length > 0)
361
- return a + n(i.children);
362
- const o = i.width || t;
363
- return a + (o < t ? t : o);
364
- }, 0);
365
- return n(e);
366
- }, ee = (e) => e.pinned === "right" ? !1 : e.is_frozen || e.pinned === "left", te = (e) => e.pinned === "right";
367
- function rt(e, t = {}) {
368
- if (t && typeof t == "object") {
369
- const {
370
- leftPinned: n = !1,
371
- rightPinned: l = !1,
372
- includeHidden: a = !1
373
- } = t;
374
- return l ? e.filter(
375
- (i) => te(i) && (a || !W(i))
376
- ) : n ? e.filter(
377
- (i) => ee(i) && (a || !W(i))
378
- ) : e.filter(
379
- (i) => !ee(i) && !te(i) && (a || !W(i))
380
- );
381
- }
382
- return e;
383
- }
384
- const He = (e, t, n = 150) => {
385
- const l = (a) => a.children && a.children.length > 0 ? W(a) ? 0 : a.children.reduce(
386
- (i, o) => i + l(o),
387
- 0
388
- ) : W(a) ? 0 : a.width && a.width < n ? n : a.width || n;
389
- return t && e.children && e.children.length > 0 ? W(e) ? 0 : e.children.reduce(
390
- (a, i) => a + l(i),
391
- 0
392
- ) : W(e) ? 0 : e.width && e.width < n ? n : e.width || n;
393
- }, ot = (e, t, n, l, a, i) => {
394
- var r;
395
- const o = [];
396
- let c = 0;
397
- for (let u = 0; u < e.length; u++) {
398
- o[u] = c;
399
- const s = e[u];
400
- if (s.__parentId !== void 0) continue;
401
- const p = s.id || s[t] || u;
402
- if (a && ((r = l == null ? void 0 : l.expandedRows) != null && r.includes(p))) {
403
- const h = l.detailRowHeight || 200;
404
- c += h;
405
- }
406
- const d = s[t] || "";
407
- i[u] !== void 0 ? c += i[u] - n : i[d] && (c += i[d] - n);
408
- }
409
- return o;
410
- }, ct = (e, t, n, l, a, i, o, c, r, u) => {
411
- let s = 0;
412
- const p = Object.keys(r) || [];
413
- if (r && p.length > 0) {
414
- let d = 0;
415
- p.forEach((h) => {
416
- const f = String(h);
417
- if (f.includes("/") && l.includes(f))
418
- s += r[f];
419
- else if (f.includes("/")) {
420
- const g = f.split("/"), y = g.slice(0, g.length - 1).join("/");
421
- l.includes(y) ? s += r[f] : d += 1;
422
- } else
423
- s += r[f];
424
- }), s += (e.length - p.length + d) * t;
425
- } else
426
- s += e.length * t;
427
- return n && (a != null && a.expandedRows) && a.expandedRows.length > 0 && e.forEach((d) => {
428
- var f;
429
- const h = d.id || d[i];
430
- (f = a == null ? void 0 : a.expandedRows) != null && f.includes(h) && (s += (a == null ? void 0 : a.detailRowHeight) || 200);
431
- }), o && (s += le * t), c.length && u && (s += le * t), s;
432
- }, dt = (e, t, n) => {
433
- var c;
434
- const l = ((c = t.path) == null ? void 0 : c.length) || 0, a = n.length - (e - l + 2), i = n.slice(
435
- a
436
- );
437
- return i.reduce((r, u) => r + u, 0) + 19 * i.length;
438
- }, ht = (e, t, n = 40) => {
439
- const a = [
440
- e[`left_pinned_${t}`],
441
- e[`normal_${t}`],
442
- e[`right_pinned_${t}`]
443
- ].filter((i) => i);
444
- return a.length === 0 ? { maxHeight: n, maxLineCount: 1 } : a.reduce((i, o) => !i || o.maxHeight > i.maxHeight ? o : i, a[0]);
445
- }, ft = (e, t, n, l, a) => e ? `${(t.leftTotalWidth || 0) - n + ye(
446
- e,
447
- a,
448
- l
449
- )}px` : `${(t.leftTotalWidth || 0) - n}px`, Se = (e, t, n) => (e.is_frozen = t, e.pinned = n, e.children && Array.isArray(e.children) && e.children.length > 0 && e.children.forEach((l) => {
450
- Se(l, t, n);
451
- }), e), ae = ({
452
- onClick: e,
453
- children: t,
454
- variant: n = "primary",
455
- size: l = "large",
456
- iconButton: a = !1,
457
- className: i = "",
458
- disabled: o = !1,
459
- leftIcon: c = null,
460
- rightIcon: r = null,
461
- buttonRef: u = null,
462
- simpleButton: s = !1,
463
- ...p
464
- }) => /* @__PURE__ */ M(
465
- "button",
466
- {
467
- ref: u,
468
- onClick: (d) => {
469
- o || e(d);
470
- },
471
- className: `ia-table-btn cursor-pointer d-flex align-items-center justify-content-center ia-table-btn-${n} ia-table-btn-${l} ${a ? "ia-table-btn-icon" : ""} ${i} ${o ? "ia-table-btn-disabled pointer-events-none" : ""} gap-4 ${s ? "ia-table-btn-simple" : ""}`,
472
- ...p,
473
- children: [
474
- c && c,
475
- a ? t : /* @__PURE__ */ m("div", { className: "ia-table-btn-text", children: t }),
476
- r && r
477
- ]
478
- }
479
- );
480
- class ke {
481
- constructor() {
482
- this.tooltipElement = null, this.currentConfig = null, this.hideTimeout = null;
483
- }
484
- initialize() {
485
- this.tooltipElement || (this.tooltipElement = document.createElement("div"), this.tooltipElement.className = "tooltip d-flex align-items-center justify-content-center", this.tooltipElement.style.position = "absolute", this.tooltipElement.style.top = "0", this.tooltipElement.style.left = "0", document.body.appendChild(this.tooltipElement));
486
- }
487
- show(t) {
488
- this.initialize(), this.currentConfig = t, this.hideTimeout && (clearTimeout(this.hideTimeout), this.hideTimeout = null), this.updateContent(t), requestAnimationFrame(() => {
489
- var n;
490
- this.calculatePosition(t), (n = this.tooltipElement) == null || n.classList.add("tooltip-visible");
491
- });
492
- }
493
- hide() {
494
- this.tooltipElement && (this.tooltipElement.classList.remove("tooltip-visible"), this.currentConfig = null, setTimeout(() => {
495
- this.tooltipElement && !this.currentConfig && (this.tooltipElement.innerHTML = "");
496
- }, 200));
497
- }
498
- updateContent(t) {
499
- const {
500
- title: n,
501
- varient: l,
502
- illustration: a,
503
- icon: i,
504
- bodyText: o,
505
- btns: c,
506
- showPaginationAbove: r,
507
- pagination: u
508
- } = t;
509
- if (!this.tooltipElement) return;
510
- this.tooltipElement.className = `tooltip tooltip--${l || "primary"}`;
511
- let s = "";
512
- u && r && (s += this.getPaginationHTML(l)), a || (i && (s += `<div class="tooltip-icon">${i}</div>`), n && (s += `<div class="tooltip-title">${n}</div>`)), (o || c || a || u) && (s += `<button class="tooltip-close d-flex align-items-center justify-content-center" aria-label="Close tooltip">
513
- <svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
514
- <path d="M8 7.293l3.646-3.647a.5.5 0 01.708.708L8.707 8l3.647 3.646a.5.5 0 01-.708.708L8 8.707l-3.646 3.647a.5.5 0 01-.708-.708L7.293 8 3.646 4.354a.5.5 0 01.708-.708L8 7.293z"/>
515
- </svg>
516
- </button>`), a && (s += `<div class="tooltip-illustration"><img src="${a}" alt="Illustration" /></div>`), a && (s += '<div class="tooltip-header d-flex align-items-center">', i && (s += `<div class="tooltip-icon">${i}</div>`), n && (s += `<div class="tooltip-title">${n}</div>`), s += "</div>"), u && !r && (s += this.getPaginationHTML(l)), c && (s += '<div class="tooltip-btns d-flex">', c.forEach((d) => {
517
- let h = d.type;
518
- d.type !== "default" && (l === "primary" || l === "tertiary" ? h = "secondary" : l === "secondary" && (h = "primary")), s += `<button class="${h === "default" ? "btn-no-bg" : `tooltip-btn btn--${h}`}">${d.label}</button>`;
519
- }), s += "</div>"), s += "</div></div>", s += '<div class="tooltip-arrow"></div>', this.tooltipElement.innerHTML = s;
520
- const p = this.tooltipElement.querySelector(
521
- ".tooltip-close"
522
- );
523
- p && (p.onclick = () => this.hide());
524
- }
525
- getPaginationHTML(t) {
526
- return `<div class="tooltip-pagination d-flex align-items-center">
527
- <div class="tooltip-pagination-bar ${t === "secondary" ? "secondary-variant" : ""}"></div>
528
- <div class="tooltip-pagination-bar ${t === "secondary" ? "secondary-variant" : ""}"></div>
529
- <div class="tooltip-pagination-bar ${t === "secondary" ? "secondary-variant" : ""}"></div>
530
- <div class="tooltip-pagination-bar ${t === "secondary" ? "secondary-variant" : ""}"></div>
531
- </div>`;
532
- }
533
- calculatePosition(t) {
534
- const { targetRef: n, orientation: l = "top", varient: a } = t;
535
- if (!(n != null && n.current) || !this.tooltipElement) return;
536
- const i = n.current.getBoundingClientRect(), o = this.tooltipElement.getBoundingClientRect(), c = 8, r = 16, u = {
537
- top: i.top - r,
538
- bottom: window.innerHeight - i.bottom - r,
539
- left: i.left - r,
540
- right: window.innerWidth - i.right - r
541
- }, s = l === "top" ? u.top > o.height : l === "bottom" ? u.bottom > o.height : l === "left" ? u.left > o.width : u.right > o.width, p = Object.entries(u).sort(
542
- (y, v) => v[1] - y[1]
543
- )[0][0], d = s ? l : p;
544
- let h = 0, f = 0;
545
- switch (d) {
546
- case "top":
547
- h = i.top - o.height - c, f = i.left + i.width / 2 - o.width / 2;
548
- break;
549
- case "bottom":
550
- h = i.bottom + c, f = i.left + i.width / 2 - o.width / 2;
551
- break;
552
- case "left":
553
- h = i.top + i.height / 2 - o.height / 2, f = i.left - o.width - c;
554
- break;
555
- case "right":
556
- h = i.top + i.height / 2 - o.height / 2, f = i.right + c;
557
- break;
558
- default:
559
- h = i.top - o.height - c, f = i.left + i.width / 2 - o.width / 2;
560
- }
561
- f = Math.max(
562
- r,
563
- Math.min(f, window.innerWidth - o.width - r)
564
- ), h = Math.max(
565
- r,
566
- Math.min(h, window.innerHeight - o.height - r)
567
- ), this.tooltipElement.style.top = `${h + window.scrollY}px`, this.tooltipElement.style.left = `${f + window.scrollX}px`, this.tooltipElement.className = `tooltip tooltip--${a || "primary"} tooltip--${d}`;
568
- const g = this.tooltipElement.querySelector(
569
- ".tooltip-arrow"
570
- );
571
- if (g)
572
- if (d === "top" || d === "bottom") {
573
- let v = (i.left + i.width / 2 - f) / o.width * 100;
574
- v = Math.max(10, Math.min(90, v)), g.style.left = `${v}%`, g.style.top = "";
575
- } else {
576
- let v = (i.top + i.height / 2 - h) / o.height * 100;
577
- v = Math.max(10, Math.min(90, v)), g.style.top = `${v}%`, g.style.left = "";
578
- }
579
- }
580
- cleanup() {
581
- this.tooltipElement && this.tooltipElement.parentNode && (this.tooltipElement.parentNode.removeChild(this.tooltipElement), this.tooltipElement = null);
582
- }
583
- }
584
- const Q = new ke(), ut = ({
585
- title: e,
586
- varient: t,
587
- orientation: n,
588
- children: l,
589
- targetRef: a,
590
- illustration: i = "",
591
- icon: o = null,
592
- bodyText: c = "",
593
- btns: r = null,
594
- showPaginationAbove: u = null,
595
- pagination: s = null,
596
- justifyBodyContent: p = null,
597
- forceShowTooltip: d = !1,
598
- className: h = "ia-table-width-inherit"
599
- }) => {
600
- const f = q({
601
- title: e,
602
- varient: t,
603
- orientation: n,
604
- targetRef: a,
605
- illustration: i,
606
- icon: o,
607
- bodyText: c,
608
- btns: r,
609
- showPaginationAbove: u,
610
- pagination: s,
611
- justifyBodyContent: p
612
- });
613
- f.current = {
614
- title: e,
615
- varient: t,
616
- orientation: n,
617
- targetRef: a,
618
- illustration: i,
619
- icon: o,
620
- bodyText: c,
621
- btns: r,
622
- showPaginationAbove: u,
623
- pagination: s,
624
- justifyBodyContent: p
625
- }, V(() => () => {
626
- Q.hide();
627
- }, []);
628
- const g = () => {
629
- if (!(a != null && a.current) || !e)
630
- return;
631
- if (d && e) {
632
- Q.show(f.current);
633
- return;
634
- }
635
- const v = a.current, N = v.querySelector("input") || // element.querySelector("div[data-tooltip-title]") ||
636
- v.querySelector(".text-overflow-ellipsis") || v.querySelector(".ia-table-header-string-title") || v.querySelector("span") || v, x = N.classList.contains("ia-table-line-clamp-2") || N.classList.contains("ia-table-line-clamp-3") || window.getComputedStyle(N).webkitLineClamp !== "none";
637
- let L = !1;
638
- if (x) {
639
- const T = N.scrollHeight, k = N.clientHeight;
640
- L = T > k;
641
- } else {
642
- const T = N.scrollWidth, k = N.clientWidth;
643
- L = T > k;
644
- }
645
- L && Q.show(f.current);
646
- }, y = () => {
647
- Q.hide();
648
- };
649
- return /* @__PURE__ */ m(
650
- "div",
651
- {
652
- ref: a,
653
- className: `tooltip-container ${h}`,
654
- onMouseEnter: g,
655
- onMouseLeave: y,
656
- onFocus: g,
657
- onBlur: y,
658
- children: l
659
- }
660
- );
661
- }, he = (e) => /* @__PURE__ */ S.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 10 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ S.createElement("path", { d: "M9.66659 1.27325L8.72659 0.333252L4.99992 4.05992L1.27325 0.333252L0.333252 1.27325L4.05992 4.99992L0.333252 8.72659L1.27325 9.66659L4.99992 5.93992L8.72659 9.66659L9.66659 8.72659L5.93992 4.99992L9.66659 1.27325Z", fill: "currentColor" })), pt = (e) => /* @__PURE__ */ S.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 13 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ S.createElement("path", { d: "M9.09808 7.54717H8.52308L8.31929 7.36192C9.03258 6.57976 9.46201 5.56432 9.46201 4.45969C9.46201 1.99657 7.34397 0 4.731 0C2.11803 0 0 1.99657 0 4.45969C0 6.92281 2.11803 8.91938 4.731 8.91938C5.90284 8.91938 6.98005 8.51458 7.80979 7.8422L8.00631 8.0343V8.57633L11.6455 12L12.73 10.9777L9.09808 7.54717ZM4.731 7.54717C2.91866 7.54717 1.45569 6.1681 1.45569 4.45969C1.45569 2.75129 2.91866 1.37221 4.731 1.37221C6.54334 1.37221 8.00631 2.75129 8.00631 4.45969C8.00631 6.1681 6.54334 7.54717 4.731 7.54717Z", fill: "#60697D" })), gt = (e) => /* @__PURE__ */ S.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 8 11", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ S.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" })), _e = ({
662
- label: e,
663
- variant: t = "filled",
664
- color: n = "default",
665
- size: l = "default",
666
- className: a = "",
667
- onClick: i,
668
- ...o
669
- }) => {
670
- if (!e) return null;
671
- const c = `ia-table-badge align-items-center justify-content-center ia-table-badge-${t} ia-table-badge-${n} ia-table-badge-size-${l} ${a} ${i ? "cursor-pointer" : ""}`;
672
- return /* @__PURE__ */ m("div", { className: c, onClick: i, ...o, children: /* @__PURE__ */ m("span", { className: "ia-table-badge-label text-overflow-ellipsis", children: e }) });
673
- }, mt = ne(_e), Pe = ({
674
- open: e = !1,
675
- onClose: t,
676
- title: n,
677
- children: l,
678
- size: a = "medium",
679
- width: i,
680
- height: o,
681
- className: c = "",
682
- onPrimaryButtonClick: r,
683
- primaryButtonLabel: u = "Confirm",
684
- onSecondaryButtonClick: s,
685
- secondaryButtonLabel: p = "Cancel",
686
- closeOnOutsideClick: d = !0,
687
- primaryButtonVariant: h = "primary",
688
- primaryButtonProps: f = {},
689
- showCloseButton: g = !0,
690
- showPrimaryButton: y = !0,
691
- showSecondaryButton: v = !0
692
- }) => {
693
- const N = q(null);
694
- V(() => {
695
- const I = (A) => {
696
- A.key === "Escape" && e && t();
697
- };
698
- return e && (document.addEventListener("keydown", I), document.body.style.overflow = "hidden"), () => {
699
- document.removeEventListener("keydown", I), document.body.style.overflow = "";
700
- };
701
- }, [e, t]);
702
- const x = U(
703
- (I) => {
704
- d && N.current && !N.current.contains(I.target) && t();
705
- },
706
- [d, t]
707
- );
708
- if (!e) return null;
709
- const L = `ia-table-modal-${a}`, T = {};
710
- i && (T.width = typeof i == "number" ? `${i}px` : i), o && (T.height = typeof o == "number" ? `${o}px` : o);
711
- const k = y && u || v && p, Z = /* @__PURE__ */ m(
712
- "div",
713
- {
714
- className: "ia-table-modal-overlay d-flex align-items-center justify-content-center",
715
- onClick: x,
716
- children: /* @__PURE__ */ M(
717
- "div",
718
- {
719
- className: `ia-table-modal d-flex flex-column ${L} ${c}`,
720
- style: T,
721
- ref: N,
722
- children: [
723
- /* @__PURE__ */ M("div", { className: "ia-table-modal-header d-flex justify-content-between align-items-center", children: [
724
- /* @__PURE__ */ m("div", { className: "ia-table-modal-header-content", children: n && /* @__PURE__ */ m("h2", { className: "ia-table-modal-title", children: n }) }),
725
- g && /* @__PURE__ */ m(
726
- ae,
727
- {
728
- onClick: t,
729
- "aria-label": "Close",
730
- variant: "url",
731
- className: "ia-table-close-button",
732
- size: "small",
733
- iconButton: !0,
734
- children: /* @__PURE__ */ m(he, { className: "ia-table-close-icon" })
735
- }
736
- )
737
- ] }),
738
- /* @__PURE__ */ m("div", { className: "ia-table-modal-content", children: l }),
739
- k && /* @__PURE__ */ M("div", { className: "ia-table-modal-footer d-flex justify-content-end align-items-center gap-12", children: [
740
- v && p && /* @__PURE__ */ m(
741
- ae,
742
- {
743
- onClick: s || t,
744
- variant: "link",
745
- children: p
746
- }
747
- ),
748
- y && u && r && /* @__PURE__ */ m(
749
- ae,
750
- {
751
- onClick: r,
752
- variant: h,
753
- ...f,
754
- children: u
755
- }
756
- )
757
- ] })
758
- ]
759
- }
760
- )
761
- }
762
- );
763
- return re(Z, document.body);
764
- }, vt = ne(Pe), Te = ({
765
- placeholder: e = "",
766
- label: t = "",
767
- value: n = "",
768
- onChange: l,
769
- type: a = "text",
770
- disabled: i = !1,
771
- error: o = "",
772
- leftIcon: c = null,
773
- rightIcon: r = null,
774
- className: u = "",
775
- width: s = "100%",
776
- onClick: p = (x) => x.stopPropagation(),
777
- isCellRenderer: d = !1,
778
- inputType: h = "text",
779
- iconButton: f = null,
780
- iconButtonClassName: g = "",
781
- height: y,
782
- autoFocus: v = !1,
783
- ...N
784
- }) => {
785
- const x = q(null), L = q(null);
786
- V(() => {
787
- v && x.current && x.current.focus();
788
- }, [v]);
789
- const T = U(() => {
790
- var $;
791
- ($ = x.current) == null || $.focus();
792
- }, []), k = U(
793
- ($) => {
794
- if (h === "int" && ($.key === "." || $.keyCode === 190 || $.keyCode === 110))
795
- return $.preventDefault(), !1;
796
- },
797
- [h]
798
- ), Z = U(
799
- ($) => {
800
- const P = $.target.value;
801
- switch (h) {
802
- case "int":
803
- (P === "" || /^-?\d*$/.test(P)) && l($);
804
- break;
805
- case "float":
806
- case "decimal":
807
- (P === "" || /^-?\d*\.?\d*$/.test(P)) && l($);
808
- break;
809
- case "percentage":
810
- (P === "" || /^\d*\.?\d*%?$/.test(P)) && l($);
811
- break;
812
- case "dollar":
813
- (P === "" || /^\$?\d*\.?\d*$/.test(P)) && l($);
814
- break;
815
- case "str":
816
- default:
817
- l($);
818
- break;
819
- }
820
- },
821
- [l, h]
822
- ), I = h === "str" || h === "text", A = h === "str" || h === "text" ? "left" : "right", j = `ia-table-input-container d-flex align-items-center ${i ? d ? "ia-table-cell-render-input-disabled" : "ia-table-input-disabled" : ""} ${o ? "ia-table-input-error" : ""} ${c ? "has-left-icon" : ""} ${r ? "has-right-icon" : ""} ${f && !I ? "has-left-icon-button" : ""} ${f && I ? "has-right-icon-button" : ""} ${d ? "ia-table-cellrender-input" : ""} ${u}
823
- `;
824
- return /* @__PURE__ */ M(
825
- "div",
826
- {
827
- className: `ia-table-inputbox-container d-flex flex-column ${i && d ? "ia-table-cell-render-input-disabled" : ""} `,
828
- style: { width: s, ...y ? { height: y } : {} },
829
- children: [
830
- t && /* @__PURE__ */ m("label", { className: "ia-table-input-label", children: t }),
831
- /* @__PURE__ */ M(
832
- "div",
833
- {
834
- className: j,
835
- onClick: T,
836
- onMouseEnter: () => {
837
- L.current && L.current.classList.add("visible");
838
- },
839
- onMouseLeave: () => {
840
- L.current && L.current.classList.remove("visible");
841
- },
842
- children: [
843
- c && /* @__PURE__ */ m("div", { className: "left-input-icon d-flex align-items-center justify-content-center", children: c }),
844
- f && !I && /* @__PURE__ */ m(
845
- "div",
846
- {
847
- ref: L,
848
- className: `left-input-icon-button d-flex align-items-center justify-content-center ${g}`,
849
- children: f
850
- }
851
- ),
852
- /* @__PURE__ */ m("div", { className: "ia-table-input-wrapper", children: /* @__PURE__ */ m(
853
- "input",
854
- {
855
- ref: x,
856
- type: a,
857
- value: n,
858
- onChange: Z,
859
- onClick: p,
860
- onKeyDown: k,
861
- placeholder: e,
862
- disabled: i,
863
- className: "ia-table-input",
864
- style: { textAlign: A },
865
- ...N
866
- }
867
- ) }),
868
- r && /* @__PURE__ */ m("div", { className: "right-input-icon d-flex align-items-center justify-content-center", children: r }),
869
- f && I && /* @__PURE__ */ m(
870
- "div",
871
- {
872
- className: `right-input-icon-button d-flex align-items-center justify-content-center ${g}`,
873
- children: f
874
- }
875
- )
876
- ]
877
- }
878
- ),
879
- o && /* @__PURE__ */ m("div", { className: "ia-table-input-error-message", children: o })
880
- ]
881
- }
882
- );
883
- }, bt = ne(Te), Ae = (e) => /* @__PURE__ */ S.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ S.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" })), fe = (e) => /* @__PURE__ */ S.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ S.createElement("path", { d: "M4 0.5H12C13.933 0.5 15.5 2.067 15.5 4V12C15.5 13.933 13.933 15.5 12 15.5H4C2.067 15.5 0.5 13.933 0.5 12V4C0.5 2.067 2.067 0.5 4 0.5Z", fill: "#ECEEFD" }), /* @__PURE__ */ S.createElement("path", { d: "M4 0.5H12C13.933 0.5 15.5 2.067 15.5 4V12C15.5 13.933 13.933 15.5 12 15.5H4C2.067 15.5 0.5 13.933 0.5 12V4C0.5 2.067 2.067 0.5 4 0.5Z", stroke: "#4259EE" }), /* @__PURE__ */ S.createElement("path", { d: "M11.4375 5.4375L6.75 10.125L4.5625 7.9375", stroke: "#4259EE", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" })), ue = (e) => /* @__PURE__ */ S.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ S.createElement("path", { d: "M4 0.5H12C13.933 0.5 15.5 2.067 15.5 4V12C15.5 13.933 13.933 15.5 12 15.5H4C2.067 15.5 0.5 13.933 0.5 12V4C0.5 2.067 2.067 0.5 4 0.5Z", fill: "white" }), /* @__PURE__ */ S.createElement("path", { d: "M4 0.5H12C13.933 0.5 15.5 2.067 15.5 4V12C15.5 13.933 13.933 15.5 12 15.5H4C2.067 15.5 0.5 13.933 0.5 12V4C0.5 2.067 2.067 0.5 4 0.5Z", stroke: "#C3C8D4" })), Me = (e) => /* @__PURE__ */ S.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ S.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" })), Ie = ({ inputRef: e, onChange: t, type: n, placeholder: l, value: a }) => /* @__PURE__ */ M("div", { className: "ia-table-select-search d-flex align-items-center", children: [
884
- /* @__PURE__ */ m(Me, { className: "icon-10" }),
885
- /* @__PURE__ */ m(
886
- "input",
887
- {
888
- ref: e,
889
- type: n,
890
- value: a,
891
- placeholder: l,
892
- className: "ia-table-select-search-input",
893
- onChange: t,
894
- onClick: (i) => i.stopPropagation()
895
- }
896
- )
897
- ] }), Re = (e, t, n) => {
898
- V(() => {
899
- var a;
900
- const l = (a = n == null ? void 0 : n.getTableInstance) == null ? void 0 : a.call(n);
901
- if (e && t && (l != null && l.current)) {
902
- const i = l.current.querySelectorAll(
903
- ".ia-table-frozen-scroll-container, .ia-table-right-pinned-scroll-container, .ia-table-normal-scroll-container"
904
- ), o = Array.from(
905
- i
906
- ).map((c) => ({
907
- element: c,
908
- overflow: c.style.overflow
909
- }));
910
- return i.forEach((c) => {
911
- c.style.overflow = "hidden";
912
- }), () => {
913
- o.forEach((c) => {
914
- c.element.style.overflow = c.overflow;
915
- });
916
- };
917
- }
918
- }, [e, t, n]);
919
- }, Ve = ({
920
- label: e = "",
921
- width: t = "100%",
922
- selectedOptions: n,
923
- setSelectedOptions: l,
924
- isDisabled: a = !1,
925
- isOpen: i = void 0,
926
- setIsOpen: o = void 0,
927
- initialOptions: c = [],
928
- withPortal: r = !1,
929
- className: u = "",
930
- isMulti: s = !1,
931
- currentOptions: p,
932
- setCurrentOptions: d,
933
- onBlur: h,
934
- isCellRenderer: f = !1,
935
- tableApi: g = null,
936
- lazyLoadCellRenderer: y = !1,
937
- isEnableResetButton: v = !0
938
- }) => {
939
- const N = q(null), x = q(null), L = q(null), [T, k] = J(!1), [Z, I] = J(""), [A, j] = J(null), [$, P] = J(-1), [K, X] = J(c), z = p || K || c, _ = i !== void 0 ? i : T, D = o || k;
940
- Re(_, f, g);
941
- const O = U(() => {
942
- if (N.current) {
943
- const w = N.current.getBoundingClientRect(), C = 250, E = window.innerHeight - w.bottom, H = w.top, b = E < C && H > E;
944
- return {
945
- top: b ? w.top + window.scrollY - C : w.bottom + window.scrollY,
946
- left: w.left + window.scrollX,
947
- width: w.width,
948
- openAbove: b
949
- };
950
- }
951
- return null;
952
- }, []);
953
- V(() => {
954
- if (y) {
955
- if (r) {
956
- const w = O();
957
- w && j(w);
958
- }
959
- D(y);
960
- }
961
- }, [y, r, O]), V(() => {
962
- if (_ && r) {
963
- const w = O();
964
- w && j(w);
965
- }
966
- }, [_, r, O]), V(() => {
967
- const w = (E) => {
968
- N.current && !N.current.contains(E.target) && x.current && !x.current.contains(E.target) && (D(!1), h && h(), f && (g != null && g.tableId) && (window.iaTablePortalOpen || (window.iaTablePortalOpen = {}), window.iaTablePortalOpen[g.tableId] = !1));
969
- }, C = () => {
970
- if (_ && r) {
971
- const E = O();
972
- E && j(E);
973
- }
974
- };
975
- return _ && (document.addEventListener("mousedown", w), r && (window.addEventListener("scroll", C, !0), window.addEventListener("resize", C))), () => {
976
- document.removeEventListener("mousedown", w), r && (window.removeEventListener("scroll", C, !0), window.removeEventListener("resize", C));
977
- };
978
- }, [
979
- _,
980
- D,
981
- r,
982
- f,
983
- h,
984
- g,
985
- O
986
- ]), V(() => {
987
- _ && L.current && (L.current.focus(), P(-1));
988
- }, [_]), V(() => {
989
- p || c && c.length > 0 && X(c);
990
- }, [c, p, d]);
991
- const pe = U(
992
- (w) => {
993
- if (w.stopPropagation(), !a) {
994
- if (!_ && r) {
995
- const E = O();
996
- E && j(E);
997
- }
998
- const C = w.currentTarget.dataset.keyboardshortcut;
999
- D(C ? !1 : !_), (_ && h || C && h) && h();
1000
- }
1001
- },
1002
- [
1003
- a,
1004
- _,
1005
- D,
1006
- r,
1007
- O,
1008
- h
1009
- ]
1010
- ), ie = U(
1011
- (w) => {
1012
- if (s)
1013
- if (Array.isArray(n) && n.some((E) => E.value === w.value))
1014
- l(
1015
- n.filter(
1016
- (E) => E.value !== w.value
1017
- )
1018
- );
1019
- else {
1020
- const E = Array.isArray(n) ? n : [];
1021
- l([...E, w]);
1022
- }
1023
- else
1024
- l(w), D(!1), f && (g != null && g.tableId) && (window.iaTablePortalOpen || (window.iaTablePortalOpen = {}), window.iaTablePortalOpen[g.tableId] = !1);
1025
- },
1026
- [s, n, l, D, f]
1027
- ), ge = U(
1028
- (w) => {
1029
- const C = w.target.value.toLowerCase();
1030
- I(C), P(-1);
1031
- const E = p || c;
1032
- if (C) {
1033
- const H = E.filter((b) => b.label && typeof b.label == "string" ? b.label.toLowerCase().includes(C) : b.value && typeof b.value == "string" ? b.value.toLowerCase().includes(C) : b.label && typeof b.label == "number" ? b.label == Number(C) : b.value && typeof b.value == "number" ? b.value == Number(C) : !1);
1034
- d ? d(H) : X(H);
1035
- } else
1036
- d ? d(c) : X(c);
1037
- },
1038
- [c, p, d]
1039
- );
1040
- V(() => {
1041
- if (!_) return;
1042
- const w = (C) => {
1043
- const E = z.filter((H) => !H.isDisabled);
1044
- switch (C.key) {
1045
- case "ArrowDown":
1046
- C.preventDefault(), C.stopPropagation(), P((H) => {
1047
- const b = H < E.length - 1 ? H + 1 : 0;
1048
- return setTimeout(() => {
1049
- var B;
1050
- const R = (B = x.current) == null ? void 0 : B.querySelector(
1051
- `[data-option-index="${b}"]`
1052
- );
1053
- R == null || R.scrollIntoView({ block: "nearest" });
1054
- }, 0), b;
1055
- });
1056
- break;
1057
- case "ArrowUp":
1058
- C.preventDefault(), C.stopPropagation(), P((H) => {
1059
- const b = H > 0 ? H - 1 : E.length - 1;
1060
- return setTimeout(() => {
1061
- var B;
1062
- const R = (B = x.current) == null ? void 0 : B.querySelector(
1063
- `[data-option-index="${b}"]`
1064
- );
1065
- R == null || R.scrollIntoView({ block: "nearest" });
1066
- }, 0), b;
1067
- });
1068
- break;
1069
- case "Enter":
1070
- if (C.preventDefault(), C.stopPropagation(), $ >= 0 && $ < E.length) {
1071
- const H = E[$];
1072
- H && !H.isDisabled && ie(H);
1073
- }
1074
- break;
1075
- case "Escape":
1076
- C.preventDefault(), C.stopPropagation(), D(!1), f && (g != null && g.tableId) && (window.iaTablePortalOpen || (window.iaTablePortalOpen = {}), window.iaTablePortalOpen[g.tableId] = !1);
1077
- break;
1078
- }
1079
- };
1080
- return document.addEventListener("keydown", w), () => {
1081
- document.removeEventListener("keydown", w);
1082
- };
1083
- }, [
1084
- _,
1085
- z,
1086
- $,
1087
- ie,
1088
- D,
1089
- f,
1090
- g
1091
- ]);
1092
- const me = we(() => {
1093
- if (!_ || !N.current) return !1;
1094
- const w = N.current.getBoundingClientRect(), C = 250, E = window.innerHeight - w.bottom, H = w.top;
1095
- return E < C && H > E;
1096
- }, [_]), ve = `ia-table-select-container d-flex justify-content-between align-items-center ${a ? "ia-table-select-disabled" : ""} ${_ ? "ia-table-select-open" : ""} ${f ? "ia-table-selectrenderer" : ""} ${u}`, be = () => {
1097
- var H;
1098
- const w = z.filter((b) => !b.isDisabled), C = r ? A == null ? void 0 : A.openAbove : me, E = /* @__PURE__ */ M(
1099
- "div",
1100
- {
1101
- ref: x,
1102
- className: `ia-table-select-dropdown d-flex flex-column ${C ? "ia-table-select-dropdown-above" : ""}`,
1103
- onClick: (b) => b.stopPropagation(),
1104
- style: {
1105
- ...r && A ? {
1106
- position: "absolute",
1107
- top: A.openAbove ? "auto" : `${A.top}px`,
1108
- bottom: A.openAbove ? `${window.innerHeight - (((H = N.current) == null ? void 0 : H.getBoundingClientRect().top) || 0)}px` : "auto",
1109
- left: `${A.left}px`,
1110
- width: `${A.width}px`
1111
- } : { width: t }
1112
- },
1113
- children: [
1114
- /* @__PURE__ */ m(
1115
- Ie,
1116
- {
1117
- inputRef: L,
1118
- type: "text",
1119
- value: Z,
1120
- onChange: ge,
1121
- placeholder: "Search here..."
1122
- }
1123
- ),
1124
- /* @__PURE__ */ m("div", { className: "ia-table-select-options d-flex flex-column gap-2", children: z && z.length > 0 ? z.map((b) => {
1125
- const R = w.findIndex(
1126
- (G) => G.value === b.value
1127
- ), B = R === $;
1128
- return /* @__PURE__ */ M(
1129
- "div",
1130
- {
1131
- "data-option-index": R,
1132
- className: `ia-table-select-option cursor-pointer d-flex align-items-center gap-6 ${s ? Array.isArray(n) && n.some(
1133
- (G) => G.value === b.value
1134
- ) ? "ia-table-select-option-selected" : "" : n && !Array.isArray(n) && n.value === b.value ? "ia-table-select-option-selected" : ""} ${b.isDisabled ? "ia-table-option-disabled" : ""} ${B ? "ia-table-select-option-highlighted" : ""}`,
1135
- onClick: (G) => {
1136
- G.stopPropagation(), b.isDisabled || ie(b);
1137
- },
1138
- onMouseEnter: () => {
1139
- b.isDisabled || P(R);
1140
- },
1141
- onMouseLeave: () => {
1142
- b.isDisabled || P(-1);
1143
- },
1144
- children: [
1145
- s && Array.isArray(n) && n.some(
1146
- (G) => G.value === b.value
1147
- ) ? /* @__PURE__ */ m(fe, { className: "icon-16" }) : s ? /* @__PURE__ */ m(ue, { className: "icon-16" }) : null,
1148
- /* @__PURE__ */ m("span", { children: b.label })
1149
- ]
1150
- },
1151
- b.value
1152
- );
1153
- }) : /* @__PURE__ */ m("div", { className: "ia-table-select-no-options", children: "No options available" }) })
1154
- ]
1155
- }
1156
- );
1157
- return r ? re(E, document.body) : E;
1158
- };
1159
- return /* @__PURE__ */ M(
1160
- "div",
1161
- {
1162
- className: `ia-table-selectbox-container ${f && a ? "ia-table-cell-render-select-disabled" : ""}`,
1163
- style: { width: t },
1164
- children: [
1165
- e && /* @__PURE__ */ m("label", { className: "ia-table-select-label", children: e }),
1166
- /* @__PURE__ */ M(
1167
- "div",
1168
- {
1169
- ref: N,
1170
- className: ve,
1171
- onClick: pe,
1172
- children: [
1173
- /* @__PURE__ */ m("div", { className: "ia-table-select-value", children: n ? s ? Array.isArray(n) && n.length > 0 ? n.length === 1 ? n[0].label : `${n.length} items selected` : "Select" : Array.isArray(n) ? "Select" : n.label : s ? "Select" : "Select an option" }),
1174
- (s ? Array.isArray(n) && n.length > 0 : n) && v && /* @__PURE__ */ m(
1175
- "button",
1176
- {
1177
- className: "ia-table-select-reset cursor-pointer flex-shrink-0 d-flex align-items-center justify-content-center",
1178
- onClick: (w) => {
1179
- w.stopPropagation(), l([]);
1180
- },
1181
- children: /* @__PURE__ */ m(he, { className: "icon-10" })
1182
- }
1183
- ),
1184
- /* @__PURE__ */ m(
1185
- "div",
1186
- {
1187
- className: "ia-table-select-arrow d-flex align-items-center icon-16 justify-content-center",
1188
- style: {
1189
- marginLeft: n ? "0" : "8px"
1190
- },
1191
- children: /* @__PURE__ */ m(
1192
- Ae,
1193
- {
1194
- className: `icon-16 ${_ ? "ia-table-rotate-270" : "ia-table-rotate-90"}`
1195
- }
1196
- )
1197
- }
1198
- )
1199
- ]
1200
- }
1201
- ),
1202
- _ && be()
1203
- ]
1204
- }
1205
- );
1206
- }, wt = ne(Ve), Ct = ({
1207
- checked: e = !1,
1208
- onChange: t,
1209
- label: n,
1210
- disabled: l = !1,
1211
- className: a = ""
1212
- }) => {
1213
- const i = (o) => {
1214
- o.stopPropagation(), !l && t && t(o.target.checked);
1215
- };
1216
- return /* @__PURE__ */ M(
1217
- "label",
1218
- {
1219
- className: `ia-checkbox-container d-flex align-items-center gap-6 cursor-pointer ${a} ${l ? "ia-checkbox-disabled" : ""} `,
1220
- children: [
1221
- /* @__PURE__ */ M("div", { className: "ia-checkbox-wrapper d-flex align-items-center justify-content-center position-relative", children: [
1222
- /* @__PURE__ */ m(
1223
- "input",
1224
- {
1225
- type: "checkbox",
1226
- checked: e,
1227
- onChange: i,
1228
- disabled: l,
1229
- className: "ia-checkbox-input cursor-pointer"
1230
- }
1231
- ),
1232
- /* @__PURE__ */ m("span", { className: "ia-checkbox-custom d-flex align-items-center justify-content-center", children: e ? /* @__PURE__ */ m(fe, { className: "ia-checkbox-icon" }) : /* @__PURE__ */ m(ue, { className: "ia-checkbox-icon" }) })
1233
- ] }),
1234
- n && /* @__PURE__ */ m("span", { className: "ia-checkbox-label", children: n })
1235
- ]
1236
- }
1237
- );
1238
- }, Et = ({
1239
- options: e,
1240
- selectedOption: t,
1241
- onChange: n,
1242
- orientation: l = "vertical",
1243
- disabled: a = !1,
1244
- name: i = "radio-group",
1245
- className: o = ""
1246
- }) => {
1247
- const c = (r) => {
1248
- !a && n && n(r);
1249
- };
1250
- return /* @__PURE__ */ m(
1251
- "div",
1252
- {
1253
- className: `ia-table-radio-group-container d-flex gap-16 ${l} ${o}`,
1254
- children: e.map((r) => /* @__PURE__ */ M(
1255
- "label",
1256
- {
1257
- className: "ia-table-radio-option d-flex align-items-center gap-8 cursor-pointer position-relative",
1258
- children: [
1259
- /* @__PURE__ */ m(
1260
- "input",
1261
- {
1262
- type: "radio",
1263
- name: i,
1264
- value: r.value,
1265
- checked: t === r.value,
1266
- onChange: c,
1267
- disabled: a || r.disabled,
1268
- "aria-label": r.label,
1269
- className: "ia-table-radio-input position-absolute cursor-pointer"
1270
- }
1271
- ),
1272
- /* @__PURE__ */ m("span", { className: "ia-table-radio-custom position-relative d-flex align-items-center justify-content-center" }),
1273
- r.label && /* @__PURE__ */ m(
1274
- "span",
1275
- {
1276
- className: `ia-table-radio-label ${t === r.value ? "ia-table-radio-label-selected" : ""}`,
1277
- children: r.label
1278
- }
1279
- )
1280
- ]
1281
- },
1282
- r.value
1283
- ))
1284
- }
1285
- );
1286
- }, yt = (e) => /* @__PURE__ */ S.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ S.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" })), Nt = (e) => /* @__PURE__ */ S.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 6 9", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ S.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" }));
1287
- export {
1288
- et as A,
1289
- ae as B,
1290
- Ct as C,
1291
- Nt as D,
1292
- tt as E,
1293
- Y as F,
1294
- Me as G,
1295
- ht as H,
1296
- bt as I,
1297
- dt as J,
1298
- st as K,
1299
- lt as L,
1300
- vt as M,
1301
- Ye as N,
1302
- Je as O,
1303
- Xe as P,
1304
- Ke as Q,
1305
- Oe as R,
1306
- he as S,
1307
- ut as T,
1308
- ze as U,
1309
- Fe as V,
1310
- Ze as W,
1311
- qe as X,
1312
- Qe as Y,
1313
- Se as a,
1314
- W as b,
1315
- xe as c,
1316
- at as d,
1317
- ye as e,
1318
- gt as f,
1319
- F as g,
1320
- rt as h,
1321
- pt as i,
1322
- Et as j,
1323
- wt as k,
1324
- mt as l,
1325
- Ie as m,
1326
- yt as n,
1327
- Ae as o,
1328
- ce as p,
1329
- ft as q,
1330
- le as r,
1331
- Be as s,
1332
- nt as t,
1333
- Re as u,
1334
- it as v,
1335
- Ge as w,
1336
- ot as x,
1337
- Ue as y,
1338
- ct as z
1339
- };