@expcat/tigercat-react 1.2.37 → 1.2.41
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/{chunk-2CJKAO2I.mjs → chunk-2VE2CP7E.mjs} +144 -9
- package/dist/{chunk-JNRUOQNT.js → chunk-36I5APFX.js} +2 -2
- package/dist/{chunk-C3NKZZQQ.js → chunk-AE2QE2C6.js} +2 -2
- package/dist/{chunk-4XOWNEZA.mjs → chunk-C44WSDEY.mjs} +19 -4
- package/dist/{chunk-6HELKWFN.js → chunk-JIFSUUGA.js} +19 -4
- package/dist/{chunk-AKZY7QYA.js → chunk-JLQBG5XU.js} +23 -17
- package/dist/{chunk-L2CAJUXH.js → chunk-LHBE3N3U.js} +162 -27
- package/dist/{chunk-IAONLOJN.js → chunk-LYYL2JMP.js} +2 -2
- package/dist/{chunk-UKBVJWP3.mjs → chunk-MV54EEKO.mjs} +1 -1
- package/dist/{chunk-KRFD27WA.js → chunk-OBY4FYRZ.js} +2 -2
- package/dist/{chunk-O4UDB6ZE.mjs → chunk-TANTMMR7.mjs} +1 -1
- package/dist/{chunk-WVTUGFWO.mjs → chunk-TYZNV54N.mjs} +23 -17
- package/dist/{chunk-ZGPOMSGD.mjs → chunk-WYGO6XC7.mjs} +232 -74
- package/dist/{chunk-MIINT2WV.js → chunk-XUETAIF3.js} +264 -106
- package/dist/{chunk-VE2YEFG2.mjs → chunk-ZDS5WL22.mjs} +1 -1
- package/dist/{chunk-73OAHAPC.mjs → chunk-ZL44XLSB.mjs} +1 -1
- package/dist/components/ChatWindow.js +3 -3
- package/dist/components/ChatWindow.mjs +2 -2
- package/dist/components/DataTableWithToolbar.d.mts +2 -2
- package/dist/components/DataTableWithToolbar.d.ts +2 -2
- package/dist/components/DataTableWithToolbar.js +12 -3
- package/dist/components/DataTableWithToolbar.mjs +11 -2
- package/dist/components/Dropdown.js +2 -2
- package/dist/components/Dropdown.mjs +1 -1
- package/dist/components/DropdownItem.js +3 -3
- package/dist/components/DropdownItem.mjs +2 -2
- package/dist/components/DropdownMenu.js +2 -2
- package/dist/components/DropdownMenu.mjs +1 -1
- package/dist/components/Popconfirm.js +3 -3
- package/dist/components/Popconfirm.mjs +2 -2
- package/dist/components/Popover.js +3 -3
- package/dist/components/Popover.mjs +2 -2
- package/dist/components/Table.d.mts +2 -2
- package/dist/components/Table.d.ts +2 -2
- package/dist/components/Table.js +9 -2
- package/dist/components/Table.mjs +8 -1
- package/dist/components/Tooltip.js +3 -3
- package/dist/components/Tooltip.mjs +2 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +20 -20
- package/dist/index.mjs +20 -20
- package/dist/{types-mtq1tZJd.d.ts → types-CHmCMNEM.d.mts} +1 -0
- package/dist/{types-mtq1tZJd.d.mts → types-CHmCMNEM.d.ts} +1 -0
- package/package.json +2 -2
- package/dist/{chunk-7KPALCG3.js → chunk-ABTJVM3X.js} +2 -2
- package/dist/{chunk-GYFR2O27.mjs → chunk-OXDX6CH2.mjs} +3 -3
|
@@ -1,28 +1,47 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkXUETAIF3js = require('./chunk-XUETAIF3.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunk6Z4LLPZAjs = require('./chunk-6Z4LLPZA.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
var _chunkLYYL2JMPjs = require('./chunk-LYYL2JMP.js');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _chunkTDODFBBOjs = require('./chunk-TDODFBBO.js');
|
|
13
|
+
|
|
14
|
+
|
|
9
15
|
var _chunkZYJTHGQWjs = require('./chunk-ZYJTHGQW.js');
|
|
10
16
|
|
|
11
17
|
|
|
18
|
+
var _chunkF7H4ALKNjs = require('./chunk-F7H4ALKN.js');
|
|
19
|
+
|
|
20
|
+
|
|
12
21
|
var _chunk56ZV3VVYjs = require('./chunk-56ZV3VVY.js');
|
|
13
22
|
|
|
14
23
|
// src/components/DataTableWithToolbar.tsx
|
|
15
24
|
var _react = require('react');
|
|
16
25
|
|
|
17
26
|
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
18
32
|
var _tigercatcore = require('@expcat/tigercat-core');
|
|
19
33
|
var _jsxruntime = require('react/jsx-runtime');
|
|
20
34
|
var DataTableWithToolbar = ({
|
|
21
35
|
toolbar,
|
|
36
|
+
locale,
|
|
37
|
+
labels,
|
|
22
38
|
onSearchChange,
|
|
23
39
|
onSearch,
|
|
24
40
|
onFiltersChange,
|
|
25
41
|
onBulkAction,
|
|
42
|
+
hiddenColumnKeys,
|
|
43
|
+
defaultHiddenColumnKeys,
|
|
44
|
+
onHiddenColumnsChange,
|
|
26
45
|
pagination = false,
|
|
27
46
|
onPageChange,
|
|
28
47
|
onPageSizeChange,
|
|
@@ -30,10 +49,14 @@ var DataTableWithToolbar = ({
|
|
|
30
49
|
tableClassName,
|
|
31
50
|
...tableProps
|
|
32
51
|
}) => {
|
|
52
|
+
const config = _chunkTDODFBBOjs.useTigerConfig.call(void 0, );
|
|
33
53
|
const previousPageSizeRef = _react.useRef.call(void 0,
|
|
34
54
|
pagination && typeof pagination === "object" ? _nullishCoalesce(_nullishCoalesce(pagination.pageSize, () => ( pagination.defaultPageSize)), () => ( 10)) : void 0
|
|
35
55
|
);
|
|
36
56
|
const [internalSearch, setInternalSearch] = _react.useState.call(void 0, _nullishCoalesce(_optionalChain([toolbar, 'optionalAccess', _ => _.defaultSearchValue]), () => ( "")));
|
|
57
|
+
const [internalHiddenKeys, setInternalHiddenKeys] = _react.useState.call(void 0,
|
|
58
|
+
_nullishCoalesce(_nullishCoalesce(defaultHiddenColumnKeys, () => ( hiddenColumnKeys)), () => ( []))
|
|
59
|
+
);
|
|
37
60
|
const [internalFilters, setInternalFilters] = _react.useState.call(void 0,
|
|
38
61
|
() => {
|
|
39
62
|
const initial = {};
|
|
@@ -45,11 +68,42 @@ var DataTableWithToolbar = ({
|
|
|
45
68
|
return initial;
|
|
46
69
|
}
|
|
47
70
|
);
|
|
71
|
+
const immediateTableLocale = _react.useMemo.call(void 0,
|
|
72
|
+
() => locale ? _tigercatcore.getImmediateTigerLocale.call(void 0, locale) : void 0,
|
|
73
|
+
[locale]
|
|
74
|
+
);
|
|
75
|
+
const [resolvedTableLocale, setResolvedTableLocale] = _react.useState.call(void 0,
|
|
76
|
+
immediateTableLocale
|
|
77
|
+
);
|
|
78
|
+
_react.useEffect.call(void 0, () => {
|
|
79
|
+
let active = true;
|
|
80
|
+
setResolvedTableLocale(immediateTableLocale);
|
|
81
|
+
if (locale && _tigercatcore.isLazyTigerLocale.call(void 0, locale)) {
|
|
82
|
+
_tigercatcore.resolveTigerLocale.call(void 0, locale).then((nextLocale) => {
|
|
83
|
+
if (active) setResolvedTableLocale(nextLocale);
|
|
84
|
+
}).catch(() => {
|
|
85
|
+
if (active) setResolvedTableLocale(immediateTableLocale);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return () => {
|
|
89
|
+
active = false;
|
|
90
|
+
};
|
|
91
|
+
}, [locale, immediateTableLocale]);
|
|
92
|
+
const tableLocale = _react.useMemo.call(void 0,
|
|
93
|
+
() => _tigercatcore.mergeTigerLocale.call(void 0, config.locale, resolvedTableLocale),
|
|
94
|
+
[config.locale, resolvedTableLocale]
|
|
95
|
+
);
|
|
96
|
+
const tableLabels = _react.useMemo.call(void 0, () => _tigercatcore.getTableLabels.call(void 0, tableLocale, labels), [labels, tableLocale]);
|
|
48
97
|
_react.useEffect.call(void 0, () => {
|
|
49
98
|
if (_optionalChain([toolbar, 'optionalAccess', _5 => _5.searchValue]) !== void 0) {
|
|
50
99
|
setInternalSearch(_nullishCoalesce(toolbar.searchValue, () => ( "")));
|
|
51
100
|
}
|
|
52
101
|
}, [_optionalChain([toolbar, 'optionalAccess', _6 => _6.searchValue])]);
|
|
102
|
+
_react.useEffect.call(void 0, () => {
|
|
103
|
+
if (hiddenColumnKeys !== void 0) {
|
|
104
|
+
setInternalHiddenKeys(hiddenColumnKeys);
|
|
105
|
+
}
|
|
106
|
+
}, [hiddenColumnKeys]);
|
|
53
107
|
_react.useEffect.call(void 0, () => {
|
|
54
108
|
if (pagination && typeof pagination === "object") {
|
|
55
109
|
previousPageSizeRef.current = _nullishCoalesce(_nullishCoalesce(pagination.pageSize, () => ( pagination.defaultPageSize)), () => ( 10));
|
|
@@ -81,10 +135,22 @@ var DataTableWithToolbar = ({
|
|
|
81
135
|
);
|
|
82
136
|
const hasFilters = Boolean(_optionalChain([toolbar, 'optionalAccess', _14 => _14.filters]) && toolbar.filters.length > 0);
|
|
83
137
|
const hasBulkActions = Boolean(_optionalChain([toolbar, 'optionalAccess', _15 => _15.bulkActions]) && toolbar.bulkActions.length > 0);
|
|
138
|
+
const hasColumnSettings = Boolean(_optionalChain([toolbar, 'optionalAccess', _16 => _16.showColumnSettings]));
|
|
139
|
+
const resolvedHiddenKeys = _nullishCoalesce(hiddenColumnKeys, () => ( internalHiddenKeys));
|
|
140
|
+
const handleHiddenColumnsChange = (nextHiddenKeys) => {
|
|
141
|
+
if (hiddenColumnKeys === void 0) {
|
|
142
|
+
setInternalHiddenKeys(nextHiddenKeys);
|
|
143
|
+
}
|
|
144
|
+
_optionalChain([onHiddenColumnsChange, 'optionalCall', _17 => _17(nextHiddenKeys)]);
|
|
145
|
+
};
|
|
146
|
+
const handleToggleColumnVisibility = (columnKey, visible) => {
|
|
147
|
+
const nextHiddenKeys = visible ? resolvedHiddenKeys.filter((key) => key !== columnKey) : [...resolvedHiddenKeys, columnKey];
|
|
148
|
+
handleHiddenColumnsChange(nextHiddenKeys);
|
|
149
|
+
};
|
|
84
150
|
const { bordered = false, ...remainingTableProps } = tableProps;
|
|
85
|
-
const selectedKeys = _nullishCoalesce(_nullishCoalesce(_optionalChain([toolbar, 'optionalAccess',
|
|
86
|
-
const selectedCount = _nullishCoalesce(_optionalChain([toolbar, 'optionalAccess',
|
|
87
|
-
const bulkLabel = _nullishCoalesce(_optionalChain([toolbar, 'optionalAccess',
|
|
151
|
+
const selectedKeys = _nullishCoalesce(_nullishCoalesce(_optionalChain([toolbar, 'optionalAccess', _18 => _18.selectedKeys]), () => ( _optionalChain([tableProps, 'access', _19 => _19.rowSelection, 'optionalAccess', _20 => _20.selectedRowKeys]))), () => ( []));
|
|
152
|
+
const selectedCount = _nullishCoalesce(_optionalChain([toolbar, 'optionalAccess', _21 => _21.selectedCount]), () => ( selectedKeys.length));
|
|
153
|
+
const bulkLabel = _nullishCoalesce(_optionalChain([toolbar, 'optionalAccess', _22 => _22.bulkActionsLabel]), () => ( tableLabels.selectedText));
|
|
88
154
|
const wrapperClasses = _react.useMemo.call(void 0,
|
|
89
155
|
() => _tigercatcore.classNames.call(void 0,
|
|
90
156
|
"tiger-data-table-with-toolbar flex flex-col",
|
|
@@ -94,15 +160,15 @@ var DataTableWithToolbar = ({
|
|
|
94
160
|
[className, bordered]
|
|
95
161
|
);
|
|
96
162
|
const handleSearchChange = (value) => {
|
|
97
|
-
if (_optionalChain([toolbar, 'optionalAccess',
|
|
163
|
+
if (_optionalChain([toolbar, 'optionalAccess', _23 => _23.searchValue]) === void 0) {
|
|
98
164
|
setInternalSearch(value);
|
|
99
165
|
}
|
|
100
|
-
_optionalChain([onSearchChange, 'optionalCall',
|
|
101
|
-
_optionalChain([toolbar, 'optionalAccess',
|
|
166
|
+
_optionalChain([onSearchChange, 'optionalCall', _24 => _24(value)]);
|
|
167
|
+
_optionalChain([toolbar, 'optionalAccess', _25 => _25.onSearchChange, 'optionalCall', _26 => _26(value)]);
|
|
102
168
|
};
|
|
103
169
|
const handleSearchSubmit = () => {
|
|
104
|
-
_optionalChain([onSearch, 'optionalCall',
|
|
105
|
-
_optionalChain([toolbar, 'optionalAccess',
|
|
170
|
+
_optionalChain([onSearch, 'optionalCall', _27 => _27(_nullishCoalesce(searchValue, () => ( "")))]);
|
|
171
|
+
_optionalChain([toolbar, 'optionalAccess', _28 => _28.onSearch, 'optionalCall', _29 => _29(_nullishCoalesce(searchValue, () => ( "")))]);
|
|
106
172
|
};
|
|
107
173
|
const handleFilterSelect = (filter, value) => {
|
|
108
174
|
const nextFilters = {
|
|
@@ -115,24 +181,88 @@ var DataTableWithToolbar = ({
|
|
|
115
181
|
[filter.key]: value
|
|
116
182
|
}));
|
|
117
183
|
}
|
|
118
|
-
_optionalChain([onFiltersChange, 'optionalCall',
|
|
119
|
-
_optionalChain([toolbar, 'optionalAccess',
|
|
184
|
+
_optionalChain([onFiltersChange, 'optionalCall', _30 => _30(nextFilters)]);
|
|
185
|
+
_optionalChain([toolbar, 'optionalAccess', _31 => _31.onFiltersChange, 'optionalCall', _32 => _32(nextFilters)]);
|
|
120
186
|
};
|
|
121
187
|
const handleBulkAction = (action) => {
|
|
122
188
|
const keys = _nullishCoalesce(selectedKeys, () => ( []));
|
|
123
|
-
_optionalChain([action, 'access',
|
|
124
|
-
_optionalChain([onBulkAction, 'optionalCall',
|
|
125
|
-
_optionalChain([toolbar, 'optionalAccess',
|
|
189
|
+
_optionalChain([action, 'access', _33 => _33.onClick, 'optionalCall', _34 => _34(keys)]);
|
|
190
|
+
_optionalChain([onBulkAction, 'optionalCall', _35 => _35(action, keys)]);
|
|
191
|
+
_optionalChain([toolbar, 'optionalAccess', _36 => _36.onBulkAction, 'optionalCall', _37 => _37(action, keys)]);
|
|
126
192
|
};
|
|
127
193
|
const handleTablePageChange = ({ current, pageSize }) => {
|
|
128
|
-
_optionalChain([onPageChange, 'optionalCall',
|
|
194
|
+
_optionalChain([onPageChange, 'optionalCall', _38 => _38(current, pageSize)]);
|
|
129
195
|
if (previousPageSizeRef.current !== void 0 && previousPageSizeRef.current !== pageSize) {
|
|
130
|
-
_optionalChain([onPageSizeChange, 'optionalCall',
|
|
196
|
+
_optionalChain([onPageSizeChange, 'optionalCall', _39 => _39(current, pageSize)]);
|
|
131
197
|
}
|
|
132
198
|
previousPageSizeRef.current = pageSize;
|
|
133
199
|
};
|
|
200
|
+
const renderColumnSettings = () => {
|
|
201
|
+
const lockedKeys = new Set(_nullishCoalesce(_optionalChain([toolbar, 'optionalAccess', _40 => _40.columnSettings, 'optionalAccess', _41 => _41.lockedColumnKeys]), () => ( [])));
|
|
202
|
+
const panelTitle = _nullishCoalesce(_optionalChain([toolbar, 'optionalAccess', _42 => _42.columnSettings, 'optionalAccess', _43 => _43.title]), () => ( tableLabels.columnSettingsText));
|
|
203
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
204
|
+
_chunkLYYL2JMPjs.Popover,
|
|
205
|
+
{
|
|
206
|
+
trigger: "click",
|
|
207
|
+
placement: "bottom-end",
|
|
208
|
+
titleContent: panelTitle,
|
|
209
|
+
contentContent: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-col gap-2 min-w-[160px]", children: tableProps.columns.map((column) => {
|
|
210
|
+
const locked = lockedKeys.has(column.key) || column.hideable === false;
|
|
211
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
212
|
+
_chunkF7H4ALKNjs.Checkbox,
|
|
213
|
+
{
|
|
214
|
+
size: "sm",
|
|
215
|
+
checked: !resolvedHiddenKeys.includes(column.key),
|
|
216
|
+
disabled: locked,
|
|
217
|
+
onChange: (checked) => handleToggleColumnVisibility(column.key, checked),
|
|
218
|
+
children: column.title
|
|
219
|
+
},
|
|
220
|
+
column.key
|
|
221
|
+
);
|
|
222
|
+
}) }),
|
|
223
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
224
|
+
_chunk56ZV3VVYjs.Button,
|
|
225
|
+
{
|
|
226
|
+
size: "sm",
|
|
227
|
+
variant: "outline",
|
|
228
|
+
className: "shrink-0 px-2",
|
|
229
|
+
"aria-label": tableLabels.columnSettingsAriaLabel,
|
|
230
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
231
|
+
"svg",
|
|
232
|
+
{
|
|
233
|
+
className: "w-3.5 h-3.5",
|
|
234
|
+
fill: "none",
|
|
235
|
+
stroke: "currentColor",
|
|
236
|
+
strokeWidth: "2",
|
|
237
|
+
viewBox: "0 0 24 24",
|
|
238
|
+
"aria-hidden": "true",
|
|
239
|
+
children: [
|
|
240
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
241
|
+
"path",
|
|
242
|
+
{
|
|
243
|
+
strokeLinecap: "round",
|
|
244
|
+
strokeLinejoin: "round",
|
|
245
|
+
d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"
|
|
246
|
+
}
|
|
247
|
+
),
|
|
248
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
249
|
+
"path",
|
|
250
|
+
{
|
|
251
|
+
strokeLinecap: "round",
|
|
252
|
+
strokeLinejoin: "round",
|
|
253
|
+
d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
254
|
+
}
|
|
255
|
+
)
|
|
256
|
+
]
|
|
257
|
+
}
|
|
258
|
+
)
|
|
259
|
+
}
|
|
260
|
+
)
|
|
261
|
+
}
|
|
262
|
+
);
|
|
263
|
+
};
|
|
134
264
|
const renderToolbar = () => {
|
|
135
|
-
if (!hasSearch && !hasFilters && !hasBulkActions) return null;
|
|
265
|
+
if (!hasSearch && !hasFilters && !hasBulkActions && !hasColumnSettings) return null;
|
|
136
266
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
137
267
|
"div",
|
|
138
268
|
{
|
|
@@ -141,7 +271,7 @@ var DataTableWithToolbar = ({
|
|
|
141
271
|
bordered ? "bg-[var(--tiger-surface-muted,#f9fafb)] dark:bg-gray-800/10 px-4 py-3.5 border-b border-[var(--tiger-border,#e5e7eb)]" : "bg-[var(--tiger-surface-muted,#f9fafb)]/80 dark:bg-gray-800/30 px-4 py-3.5 border border-[var(--tiger-border,#e5e7eb)] rounded-[var(--tiger-radius-md,0.5rem)] shadow-sm"
|
|
142
272
|
),
|
|
143
273
|
role: "toolbar",
|
|
144
|
-
"aria-label":
|
|
274
|
+
"aria-label": tableLabels.toolbarAriaLabel,
|
|
145
275
|
children: [
|
|
146
276
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-3 flex-wrap flex-1 min-w-0", children: [
|
|
147
277
|
hasSearch ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2 w-full sm:w-auto sm:min-w-[220px] sm:max-w-[320px]", children: [
|
|
@@ -151,7 +281,7 @@ var DataTableWithToolbar = ({
|
|
|
151
281
|
type: "search",
|
|
152
282
|
size: "sm",
|
|
153
283
|
value: searchValue,
|
|
154
|
-
placeholder: _nullishCoalesce(_optionalChain([toolbar, 'optionalAccess',
|
|
284
|
+
placeholder: _nullishCoalesce(_optionalChain([toolbar, 'optionalAccess', _44 => _44.searchPlaceholder]), () => ( tableLabels.searchPlaceholder)),
|
|
155
285
|
prefix: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
156
286
|
"svg",
|
|
157
287
|
{
|
|
@@ -179,19 +309,19 @@ var DataTableWithToolbar = ({
|
|
|
179
309
|
}
|
|
180
310
|
}
|
|
181
311
|
),
|
|
182
|
-
_nullishCoalesce(_optionalChain([toolbar, 'optionalAccess',
|
|
312
|
+
_nullishCoalesce(_optionalChain([toolbar, 'optionalAccess', _45 => _45.showSearchButton]), () => ( true)) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
183
313
|
_chunk56ZV3VVYjs.Button,
|
|
184
314
|
{
|
|
185
315
|
size: "sm",
|
|
186
316
|
variant: "primary",
|
|
187
317
|
className: "whitespace-nowrap shrink-0 rounded-[var(--tiger-radius-md,0.5rem)] px-3",
|
|
188
318
|
onClick: handleSearchSubmit,
|
|
189
|
-
disabled: !onSearch && !_optionalChain([toolbar, 'optionalAccess',
|
|
190
|
-
children: _nullishCoalesce(_optionalChain([toolbar, 'optionalAccess',
|
|
319
|
+
disabled: !onSearch && !_optionalChain([toolbar, 'optionalAccess', _46 => _46.onSearch]),
|
|
320
|
+
children: _nullishCoalesce(_optionalChain([toolbar, 'optionalAccess', _47 => _47.searchButtonText]), () => ( tableLabels.searchButtonText))
|
|
191
321
|
}
|
|
192
322
|
) : null
|
|
193
323
|
] }) : null,
|
|
194
|
-
hasFilters ? _optionalChain([toolbar, 'optionalAccess',
|
|
324
|
+
hasFilters ? _optionalChain([toolbar, 'optionalAccess', _48 => _48.filters, 'optionalAccess', _49 => _49.map, 'call', _50 => _50((filter) => {
|
|
195
325
|
const currentValue = resolvedFilters[filter.key];
|
|
196
326
|
const clearable = filter.clearable !== false;
|
|
197
327
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -226,10 +356,11 @@ var DataTableWithToolbar = ({
|
|
|
226
356
|
bulkLabel,
|
|
227
357
|
" ",
|
|
228
358
|
selectedCount,
|
|
229
|
-
"
|
|
359
|
+
" ",
|
|
360
|
+
tableLabels.selectedItemsText
|
|
230
361
|
] })
|
|
231
362
|
] }) : null,
|
|
232
|
-
_optionalChain([toolbar, 'optionalAccess',
|
|
363
|
+
_optionalChain([toolbar, 'optionalAccess', _51 => _51.bulkActions, 'optionalAccess', _52 => _52.map, 'call', _53 => _53((action) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
233
364
|
_chunk56ZV3VVYjs.Button,
|
|
234
365
|
{
|
|
235
366
|
size: "sm",
|
|
@@ -240,7 +371,8 @@ var DataTableWithToolbar = ({
|
|
|
240
371
|
},
|
|
241
372
|
action.key
|
|
242
373
|
))])
|
|
243
|
-
] }) : null
|
|
374
|
+
] }) : null,
|
|
375
|
+
hasColumnSettings ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _tigercatcore.classNames.call(void 0, "shrink-0", !hasBulkActions && "ml-auto"), children: renderColumnSettings() }) : null
|
|
244
376
|
]
|
|
245
377
|
}
|
|
246
378
|
);
|
|
@@ -248,10 +380,13 @@ var DataTableWithToolbar = ({
|
|
|
248
380
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: wrapperClasses, "data-tiger-data-table-with-toolbar": true, children: [
|
|
249
381
|
renderToolbar(),
|
|
250
382
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
251
|
-
|
|
383
|
+
_chunkXUETAIF3js.Table,
|
|
252
384
|
{
|
|
253
385
|
...remainingTableProps,
|
|
386
|
+
locale,
|
|
387
|
+
labels,
|
|
254
388
|
bordered,
|
|
389
|
+
hiddenColumnKeys: resolvedHiddenKeys,
|
|
255
390
|
pagination,
|
|
256
391
|
className: _tigercatcore.classNames.call(void 0, tableClassName, bordered && "border-none rounded-none shadow-none"),
|
|
257
392
|
onPageChange: handleTablePageChange
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkJIFSUUGAjs = require('./chunk-JIFSUUGA.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkSTTQ5LXXjs = require('./chunk-STTQ5LXX.js');
|
|
@@ -41,7 +41,7 @@ var Popover = ({
|
|
|
41
41
|
const popoverId = popoverIdRef.current;
|
|
42
42
|
const titleId = `${popoverId}-title`;
|
|
43
43
|
const contentId = `${popoverId}-content`;
|
|
44
|
-
const { currentVisible, containerRef, triggerRef, floatingRef, floatingStyles, triggerHandlers } =
|
|
44
|
+
const { currentVisible, containerRef, triggerRef, floatingRef, floatingStyles, triggerHandlers } = _chunkJIFSUUGAjs.usePopup.call(void 0, { open, defaultOpen, disabled, trigger, placement, offset, onOpenChange });
|
|
45
45
|
const containerClasses = _react.useMemo.call(void 0,
|
|
46
46
|
() => _tigercatcore.classNames.call(void 0, _tigercatcore.getPopoverContainerClasses.call(void 0, ), className),
|
|
47
47
|
[className]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkJIFSUUGAjs = require('./chunk-JIFSUUGA.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkSTTQ5LXXjs = require('./chunk-STTQ5LXX.js');
|
|
@@ -34,7 +34,7 @@ var Tooltip = ({
|
|
|
34
34
|
if (!tooltipIdRef.current) tooltipIdRef.current = createTooltipId();
|
|
35
35
|
const tooltipId = tooltipIdRef.current;
|
|
36
36
|
const describedBy = content != null ? tooltipId : void 0;
|
|
37
|
-
const { currentVisible, containerRef, triggerRef, floatingRef, floatingStyles, triggerHandlers } =
|
|
37
|
+
const { currentVisible, containerRef, triggerRef, floatingRef, floatingStyles, triggerHandlers } = _chunkJIFSUUGAjs.usePopup.call(void 0, { open, defaultOpen, disabled, trigger, placement, offset, onOpenChange });
|
|
38
38
|
const containerClasses = _react.useMemo.call(void 0,
|
|
39
39
|
() => _tigercatcore.classNames.call(void 0, _tigercatcore.getTooltipContainerClasses.call(void 0, ), className),
|
|
40
40
|
[className]
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
renderBodyPortal,
|
|
2
3
|
useClickOutside,
|
|
3
4
|
useEscapeKey,
|
|
4
5
|
useFloating
|
|
@@ -22,6 +23,7 @@ import {
|
|
|
22
23
|
getDropdownMenuClasses,
|
|
23
24
|
getTransformOrigin,
|
|
24
25
|
injectDropdownStyles,
|
|
26
|
+
FLOATING_OVERLAY_Z_INDEX,
|
|
25
27
|
DROPDOWN_CHEVRON_PATH,
|
|
26
28
|
DROPDOWN_ENTER_CLASS,
|
|
27
29
|
handleMenuNavigation,
|
|
@@ -50,6 +52,7 @@ var Dropdown = ({
|
|
|
50
52
|
defaultOpen = false,
|
|
51
53
|
closeOnClick = true,
|
|
52
54
|
showArrow = true,
|
|
55
|
+
portal = true,
|
|
53
56
|
className,
|
|
54
57
|
style,
|
|
55
58
|
onOpenChange,
|
|
@@ -125,7 +128,7 @@ var Dropdown = ({
|
|
|
125
128
|
}, []);
|
|
126
129
|
useClickOutside({
|
|
127
130
|
enabled: trigger === "click" && visible,
|
|
128
|
-
refs: [containerRef],
|
|
131
|
+
refs: [containerRef, floatingRef],
|
|
129
132
|
onOutsideClick: () => setVisible(false)
|
|
130
133
|
});
|
|
131
134
|
useEscapeKey({
|
|
@@ -151,12 +154,13 @@ var Dropdown = ({
|
|
|
151
154
|
[className]
|
|
152
155
|
);
|
|
153
156
|
const triggerClasses = useMemo(() => getDropdownTriggerClasses(disabled), [disabled]);
|
|
154
|
-
const menuWrapperClasses = classNames("absolute
|
|
157
|
+
const menuWrapperClasses = classNames("absolute", DROPDOWN_ENTER_CLASS);
|
|
155
158
|
const menuWrapperStyles = useMemo(
|
|
156
159
|
() => ({
|
|
157
160
|
position: "absolute",
|
|
158
161
|
left: x,
|
|
159
162
|
top: y,
|
|
163
|
+
zIndex: FLOATING_OVERLAY_Z_INDEX,
|
|
160
164
|
transformOrigin: getTransformOrigin(placement)
|
|
161
165
|
}),
|
|
162
166
|
[x, y, placement]
|
|
@@ -195,6 +199,22 @@ var Dropdown = ({
|
|
|
195
199
|
children: /* @__PURE__ */ jsx("path", { d: DROPDOWN_CHEVRON_PATH })
|
|
196
200
|
}
|
|
197
201
|
) : null;
|
|
202
|
+
const menuWrapperNode = /* @__PURE__ */ jsx(
|
|
203
|
+
"div",
|
|
204
|
+
{
|
|
205
|
+
ref: floatingRef,
|
|
206
|
+
className: menuWrapperClasses,
|
|
207
|
+
style: menuWrapperStyles,
|
|
208
|
+
hidden: !visible,
|
|
209
|
+
"data-tiger-dropdown-menu": "",
|
|
210
|
+
onMouseEnter: handleMouseEnter,
|
|
211
|
+
onMouseLeave: handleMouseLeave,
|
|
212
|
+
onKeyDown: handleMenuKeyDown,
|
|
213
|
+
children: menuElement && React.isValidElement(menuElement) ? React.cloneElement(menuElement, {
|
|
214
|
+
id: menuId
|
|
215
|
+
}) : menuElement
|
|
216
|
+
}
|
|
217
|
+
);
|
|
198
218
|
return /* @__PURE__ */ jsx(DropdownContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs("div", { ref: containerRef, className: containerClasses, style, ...divProps, children: [
|
|
199
219
|
/* @__PURE__ */ jsxs(
|
|
200
220
|
"div",
|
|
@@ -213,21 +233,7 @@ var Dropdown = ({
|
|
|
213
233
|
]
|
|
214
234
|
}
|
|
215
235
|
),
|
|
216
|
-
|
|
217
|
-
"div",
|
|
218
|
-
{
|
|
219
|
-
ref: floatingRef,
|
|
220
|
-
className: menuWrapperClasses,
|
|
221
|
-
style: menuWrapperStyles,
|
|
222
|
-
hidden: !visible,
|
|
223
|
-
onMouseEnter: handleMouseEnter,
|
|
224
|
-
onMouseLeave: handleMouseLeave,
|
|
225
|
-
onKeyDown: handleMenuKeyDown,
|
|
226
|
-
children: menuElement && React.isValidElement(menuElement) ? React.cloneElement(menuElement, {
|
|
227
|
-
id: menuId
|
|
228
|
-
}) : menuElement
|
|
229
|
-
}
|
|
230
|
-
)
|
|
236
|
+
portal ? renderBodyPortal(menuWrapperNode) : menuWrapperNode
|
|
231
237
|
] }) });
|
|
232
238
|
};
|
|
233
239
|
|