@ballistix.digital/react-components 0.5.10 → 0.6.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.
- package/dist/index.d.ts +4 -0
- package/dist/index.esm.js +261 -239
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +260 -238
- package/dist/index.js.map +1 -1
- package/dist/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
2
2
|
import { ArrowPathIcon, ChevronDownIcon, EllipsisVerticalIcon, ExclamationCircleIcon, ChevronDoubleLeftIcon, ChevronLeftIcon, ChevronRightIcon, ChevronDoubleRightIcon, ChevronUpIcon, ChevronUpDownIcon, HomeIcon, ArrowLongLeftIcon, ArrowLongRightIcon } from '@heroicons/react/20/solid';
|
|
3
|
-
import { isArray, map, set, get, noop as noop$1, indexOf, pick, isEmpty, some, forEach, assign } from 'lodash';
|
|
3
|
+
import { isArray, map, set, get, noop as noop$1, indexOf, toSafeInteger, pick, isEmpty, some, forEach, assign } from 'lodash';
|
|
4
4
|
import get$1 from 'lodash/get';
|
|
5
5
|
import React, { useState, useMemo, Children, Fragment, useEffect, useCallback, forwardRef, useImperativeHandle, useRef, useReducer, createElement, PureComponent, Component } from 'react';
|
|
6
6
|
import { library } from '@fortawesome/fontawesome-svg-core';
|
|
@@ -13,8 +13,8 @@ import { Menu, Transition, Dialog, Popover, Switch } from '@headlessui/react';
|
|
|
13
13
|
import { useMask } from '@react-input/mask';
|
|
14
14
|
import { ViewColumnsIcon, ChevronDownIcon as ChevronDownIcon$1, TableCellsIcon, XMarkIcon, PlusIcon } from '@heroicons/react/24/outline';
|
|
15
15
|
import { useReactTable, getCoreRowModel, flexRender, createColumnHelper as createColumnHelper$1 } from '@tanstack/react-table';
|
|
16
|
-
import set$1 from 'lodash/set';
|
|
17
16
|
import Select from 'react-tailwindcss-select';
|
|
17
|
+
import set$1 from 'lodash/set';
|
|
18
18
|
import Datepicker from 'react-tailwindcss-datepicker';
|
|
19
19
|
import { FormikProvider, FieldArray, useFormik } from 'formik';
|
|
20
20
|
|
|
@@ -1185,19 +1185,194 @@ var useExcel = function () {
|
|
|
1185
1185
|
};
|
|
1186
1186
|
};
|
|
1187
1187
|
|
|
1188
|
+
var base$e = {
|
|
1189
|
+
container: '',
|
|
1190
|
+
head: 'flex justify-between',
|
|
1191
|
+
body: 'relative rounded-md',
|
|
1192
|
+
foot: '',
|
|
1193
|
+
label: 'block font-medium text-gray-900',
|
|
1194
|
+
hint: 'text-xs text-gray-500',
|
|
1195
|
+
leading: 'pointer-events-none absolute inset-y-0 left-0 flex items-center',
|
|
1196
|
+
input: 'block w-full flex border',
|
|
1197
|
+
menuButton: '',
|
|
1198
|
+
menu: 'z-10 !px-0 !py-0 !w-full rounded-md overflow-hidden border !mt-1 absolute bg-white',
|
|
1199
|
+
tagItem: 'bg-gray-200 px-2 py-1 flex flex-row gap-x-1 items-center justify-between rounded-sm',
|
|
1200
|
+
tagItemText: 'text-xs',
|
|
1201
|
+
tagItemIconContainer: '!p-0 rounded-full hover:bg-gray-400 text-sm hover:text-white aspect-square w-4 flex items-center justify-center cursor-pointer',
|
|
1202
|
+
tagItemIcon: '',
|
|
1203
|
+
list: '!px-0 !w-full [&>*]:px-0 max-h-56 overflow-scroll !py-1',
|
|
1204
|
+
listGroupLabel: '',
|
|
1205
|
+
listItem: '!w-full !list-none hover:bg-primary-500 hover:text-white !py-2 !px-2',
|
|
1206
|
+
listDisabledItem: '',
|
|
1207
|
+
searchContainer: '!w-full !px-2 !py-2 border-b',
|
|
1208
|
+
searchBox: '',
|
|
1209
|
+
searchIcon: '',
|
|
1210
|
+
closeIcon: '',
|
|
1211
|
+
emptyState: 'w-full inline-flex items-start justify-start px-4',
|
|
1212
|
+
trailing: 'pointer-events-none absolute inset-y-0 right-0 flex items-center',
|
|
1213
|
+
description: 'text-gray-400 text-xs mt-1',
|
|
1214
|
+
error: 'text-red-500 text-xs ml-5 mt-1',
|
|
1215
|
+
};
|
|
1216
|
+
var leading$4 = {
|
|
1217
|
+
input: 'pl-10',
|
|
1218
|
+
};
|
|
1219
|
+
var trailing$4 = {};
|
|
1220
|
+
var normal$5 = {
|
|
1221
|
+
label: 'leading-6 text-sm mb-2',
|
|
1222
|
+
hint: 'leading-6',
|
|
1223
|
+
leading: 'pl-3',
|
|
1224
|
+
input: 'rounded-md border-gray-200 shadow-sm focus:border-primary-500 focus:ring-primary-500 sm:text-sm placeholder-gray-300',
|
|
1225
|
+
trailing: '',
|
|
1226
|
+
description: 'mt-2 text-sm',
|
|
1227
|
+
};
|
|
1228
|
+
var inset$4 = {
|
|
1229
|
+
container: 'rounded-md px-3 pt-2.5 pb-1.5 shadow-sm ring-1 ring-inset ring-gray-300 focus-within:ring-2 focus-within:ring-primary-600',
|
|
1230
|
+
label: 'text-xs',
|
|
1231
|
+
hint: 'text-xs',
|
|
1232
|
+
input: 'border-0 !ring-0 p-0 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm pl-0',
|
|
1233
|
+
description: 'hidden',
|
|
1234
|
+
};
|
|
1235
|
+
var overlapping$4 = {
|
|
1236
|
+
container: 'relative',
|
|
1237
|
+
head: ' absolute flex justify-between items-center left-0 -top-2 right-0 mx-2 z-10 w-full',
|
|
1238
|
+
label: 'inline-block bg-white px-1 text-xs font-medium text-gray-900 ',
|
|
1239
|
+
hint: 'text-xs mr-4 bg-white px-1',
|
|
1240
|
+
input: 'block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6',
|
|
1241
|
+
description: 'hidden',
|
|
1242
|
+
};
|
|
1243
|
+
var pill$4 = {
|
|
1244
|
+
head: 'mx-px block px-4 text-sm font-medium leading-6 text-gray-900 mb-1 pr-6',
|
|
1245
|
+
foot: 'mx-px block px-4 text-sm font-medium leading-6 text-gray-900 mt-1 pr-6',
|
|
1246
|
+
input: 'block w-full rounded-full border-0 px-4 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6',
|
|
1247
|
+
trailing: 'pr-2',
|
|
1248
|
+
description: 'text-xs',
|
|
1249
|
+
};
|
|
1250
|
+
var floored$4 = {
|
|
1251
|
+
body: 'relative mt-2',
|
|
1252
|
+
label: 'block text-sm font-medium leading-6 text-gray-900',
|
|
1253
|
+
input: 'peer block w-full border-0 bg-gray-50 py-1.5 text-gray-900 focus:ring-0 sm:text-sm sm:leading-6 ring-0',
|
|
1254
|
+
description: 'text-xs mt-2',
|
|
1255
|
+
};
|
|
1256
|
+
var invalid$4 = {
|
|
1257
|
+
container: 'ring-red-500',
|
|
1258
|
+
input:
|
|
1259
|
+
// 'block w-full border border-transparent text-red-900 ring-1 ring-inset ring-red-300 placeholder:text-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500 sm:leading-6 pr-10',
|
|
1260
|
+
'block w-full border border-transparent text-red-900 ring-1 ring-inset ring-red-300 placeholder:text-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500',
|
|
1261
|
+
description: 'text-sm text-red-600',
|
|
1262
|
+
};
|
|
1263
|
+
var disabled$5 = {
|
|
1264
|
+
input: 'block w-full rounded-md border-0 text-gray-900 shadow-sm ring-1 ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 cursor-not-allowed bg-gray-50 text-gray-500 ring-gray-200',
|
|
1265
|
+
};
|
|
1266
|
+
var styles$h = {
|
|
1267
|
+
base: base$e,
|
|
1268
|
+
leading: leading$4,
|
|
1269
|
+
trailing: trailing$4,
|
|
1270
|
+
normal: normal$5,
|
|
1271
|
+
inset: inset$4,
|
|
1272
|
+
overlapping: overlapping$4,
|
|
1273
|
+
pill: pill$4,
|
|
1274
|
+
floored: floored$4,
|
|
1275
|
+
invalid: invalid$4,
|
|
1276
|
+
disabled: disabled$5,
|
|
1277
|
+
};
|
|
1278
|
+
|
|
1279
|
+
var SelectMenuForm = function (props) {
|
|
1280
|
+
var _a;
|
|
1281
|
+
var _b = props.name, name = _b === void 0 ? 'select-menu-form' : _b, label = props.label, description = props.description, placeholder = props.placeholder, options = props.options, required = props.required, value = props.value, error = props.error, _c = props.isRequired, isRequired = _c === void 0 ? false : _c, isLoading = props.isLoading, _d = props.isTouched, isTouched = _d === void 0 ? false : _d, isDisabled = props.isDisabled, _e = props.isClearable, isClearable = _e === void 0 ? true : _e, _f = props.isMultiple, isMultiple = _f === void 0 ? false : _f, _g = props.isSearchable, isSearchable = _g === void 0 ? true : _g, _h = props.isSolo, isSolo = _h === void 0 ? false : _h, onChange = props.onChange, onSearchInputChange = props.onSearchInputChange, onClear = props.onClear, onBlur = props.onBlur, stylesOverrides = props.styles;
|
|
1282
|
+
var _j = useState(true), isFocus = _j[0], setIsFocus = _j[1];
|
|
1283
|
+
var _k = useState(value !== null && value !== void 0 ? value : null), state = _k[0], setState = _k[1];
|
|
1284
|
+
var isValid = error === undefined;
|
|
1285
|
+
var handleGenerateStyle = function () {
|
|
1286
|
+
var result = deepCopyObject(styles$h.base);
|
|
1287
|
+
var keys = calculateNestedKeys(styles$h.base);
|
|
1288
|
+
keys.forEach(function (key) {
|
|
1289
|
+
set(result, key, toClassName(get(styles$h.base, key), get(styles$h['normal'], key), isTouched === true && !isValid && get(styles$h.invalid, key), isDisabled && get(styles$h.disabled, key), get(stylesOverrides, key)));
|
|
1290
|
+
});
|
|
1291
|
+
return result;
|
|
1292
|
+
};
|
|
1293
|
+
var handleChange = function (selectValue) {
|
|
1294
|
+
setState(selectValue);
|
|
1295
|
+
onChange && onChange(selectValue);
|
|
1296
|
+
setIsFocus(false);
|
|
1297
|
+
};
|
|
1298
|
+
var styles = handleGenerateStyle();
|
|
1299
|
+
// Simulate onClear event.
|
|
1300
|
+
useEffect(function () {
|
|
1301
|
+
if (state === null && !isFocus) {
|
|
1302
|
+
onClear && onClear(name);
|
|
1303
|
+
}
|
|
1304
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1305
|
+
}, [state]);
|
|
1306
|
+
// Simulate onBlur event.
|
|
1307
|
+
useEffect(function () {
|
|
1308
|
+
if (!isFocus) {
|
|
1309
|
+
onBlur && onBlur();
|
|
1310
|
+
}
|
|
1311
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1312
|
+
}, [isFocus]);
|
|
1313
|
+
// listen to value changes.
|
|
1314
|
+
useEffect(function () {
|
|
1315
|
+
setState(value);
|
|
1316
|
+
}, [value]);
|
|
1317
|
+
return (jsxs("div", { className: styles.container, children: [jsxs("div", { className: styles.head, children: [label && (jsx("label", { htmlFor: name, className: styles.label, children: label })), !required && !isRequired && typeof label === 'string' && (jsx("span", { className: styles.hint, children: "Optional" })), required && required({ isRequired: isRequired })] }), jsxs("div", { className: styles.container, children: [jsx(Select, { primaryColor: "primary",
|
|
1318
|
+
//
|
|
1319
|
+
placeholder: placeholder === null || placeholder === void 0 ? void 0 : placeholder.select, noOptionsMessage: (jsx("p", { className: styles.emptyState, children: (_a = placeholder === null || placeholder === void 0 ? void 0 : placeholder.emptyState) !== null && _a !== void 0 ? _a : 'No results found' })), searchInputPlaceholder: placeholder === null || placeholder === void 0 ? void 0 : placeholder.searchInput,
|
|
1320
|
+
//
|
|
1321
|
+
loading: isLoading, isDisabled: isDisabled, isClearable: isClearable, isMultiple: isMultiple, isSearchable: isSearchable,
|
|
1322
|
+
//
|
|
1323
|
+
options: options,
|
|
1324
|
+
//
|
|
1325
|
+
value: state, onChange: handleChange, onSearchInputChange: onSearchInputChange,
|
|
1326
|
+
//
|
|
1327
|
+
classNames: {
|
|
1328
|
+
menuButton: function () {
|
|
1329
|
+
return toClassName(styles.input, state === null && '[&>*]:!text-gray-300 ', state === null &&
|
|
1330
|
+
!isValid &&
|
|
1331
|
+
isTouched &&
|
|
1332
|
+
'[&>*]:!text-red-300');
|
|
1333
|
+
},
|
|
1334
|
+
menu: styles.menu,
|
|
1335
|
+
tagItem: function () { return styles.tagItem; },
|
|
1336
|
+
tagItemText: styles.tagItemText,
|
|
1337
|
+
tagItemIconContainer: styles.tagItemIconContainer,
|
|
1338
|
+
tagItemIcon: styles.tagItemIcon,
|
|
1339
|
+
list: styles.list,
|
|
1340
|
+
listItem: function () { return styles.listItem; },
|
|
1341
|
+
listDisabledItem: styles.listDisabledItem,
|
|
1342
|
+
listGroupLabel: styles.listGroupLabel,
|
|
1343
|
+
searchContainer: styles.searchContainer,
|
|
1344
|
+
searchBox: styles.searchBox,
|
|
1345
|
+
searchIcon: styles.searchIcon,
|
|
1346
|
+
closeIcon: styles.closeIcon,
|
|
1347
|
+
} }), !isSolo && (jsxs("div", { className: styles.foot, children: [description && !(error && isTouched) && (jsx("p", { className: styles.description, children: description })), error && isTouched && (jsx("p", { className: styles.error, children: JSON.stringify(error).replaceAll('"', '') }))] }))] })] }));
|
|
1348
|
+
};
|
|
1349
|
+
|
|
1188
1350
|
var PanelPaginationNavigation = function (props) {
|
|
1189
|
-
var defaultValue = props.current, _a = props.min, min = _a === void 0 ? 1 : _a, _b = props.max, max = _b === void 0 ? 20 : _b, stylesOverrides = props.styles, children = props.children, onChange = props.onChange;
|
|
1190
|
-
var
|
|
1351
|
+
var defaultValue = props.current, _a = props.min, min = _a === void 0 ? 1 : _a, _b = props.max, max = _b === void 0 ? 20 : _b, stylesOverrides = props.styles, pageSizeOptions = props.pageSizeOptions, defaultPageSize = props.defaultPageSize, _c = props.onChangePageSize, onChangePageSize = _c === void 0 ? noop$1 : _c, children = props.children, onChange = props.onChange;
|
|
1352
|
+
var _d = useState(1), current = _d[0], setCurrent = _d[1];
|
|
1353
|
+
var _e = useState({
|
|
1354
|
+
value: "".concat(defaultPageSize),
|
|
1355
|
+
label: "".concat(defaultPageSize),
|
|
1356
|
+
}), pageSize = _e[0], setPageSize = _e[1];
|
|
1191
1357
|
useEffect(function () {
|
|
1192
1358
|
if (defaultValue) {
|
|
1193
1359
|
setCurrent(defaultValue);
|
|
1194
1360
|
}
|
|
1195
1361
|
}, [defaultValue]);
|
|
1362
|
+
var hasCustomizablePageSize = useMemo(function () { return !!pageSizeOptions; }, [pageSizeOptions]);
|
|
1363
|
+
var pageSizeMenuOptions = useMemo(function () {
|
|
1364
|
+
var options = map(pageSizeOptions, function (option) { return ({
|
|
1365
|
+
value: "".concat(option),
|
|
1366
|
+
label: "".concat(option),
|
|
1367
|
+
}); });
|
|
1368
|
+
!pageSize && setPageSize(options[0]);
|
|
1369
|
+
return options;
|
|
1370
|
+
}, [pageSize, pageSizeOptions]);
|
|
1196
1371
|
var handleGenerateStyle = function () {
|
|
1197
|
-
var result = deepCopyObject(styles$
|
|
1198
|
-
var keys = calculateNestedKeys(styles$
|
|
1372
|
+
var result = deepCopyObject(styles$g.base);
|
|
1373
|
+
var keys = calculateNestedKeys(styles$g.base);
|
|
1199
1374
|
keys.forEach(function (key) {
|
|
1200
|
-
set(result, key, toClassName(get(styles$
|
|
1375
|
+
set(result, key, toClassName(get(styles$g.base, key), get(stylesOverrides, key)));
|
|
1201
1376
|
});
|
|
1202
1377
|
return result;
|
|
1203
1378
|
};
|
|
@@ -1234,10 +1409,18 @@ var PanelPaginationNavigation = function (props) {
|
|
|
1234
1409
|
component = (jsxs(Fragment$1, { children: [jsx("button", { className: toClassName(styles.button.default, current === min && styles.button.active), onClick: function () { return handleChangeCurrent(min); }, children: min }), max >= min + 1 && (jsx("button", { className: toClassName(styles.button.default, current === min + 1 && styles.button.active), onClick: function () { return handleChangeCurrent(min + 1); }, children: min + 1 })), max >= min + 2 && (jsx("button", { className: toClassName(styles.button.default, current === min + 2 && styles.button.active), onClick: function () { return handleChangeCurrent(min + 2); }, children: min + 2 })), max >= min + 3 && (jsx("button", { className: toClassName(styles.button.default, current === min + 3 && styles.button.active), onClick: function () { return handleChangeCurrent(min + 3); }, children: min + 3 }))] }));
|
|
1235
1410
|
break;
|
|
1236
1411
|
}
|
|
1237
|
-
return (jsxs("div", { className: styles.container, children: [jsxs("div", { className: "flex flex-1 justify-between sm:hidden", children: [jsx("button", { className: toClassName(styles.mobile.button, current === min && styles.button.disabled), disabled: current === min, onClick: function () { return handleChangeCurrent(current - 1); }, children: "Previous" }),
|
|
1412
|
+
return (jsxs("div", { className: styles.container, children: [jsxs("div", { className: "flex flex-1 justify-between sm:hidden", children: [jsx("button", { className: toClassName(styles.mobile.button, current === min && styles.button.disabled), disabled: current === min, onClick: function () { return handleChangeCurrent(current - 1); }, children: "Previous" }), hasCustomizablePageSize && (jsx(SelectMenuForm, { name: "pageSize", isClearable: false, isSearchable: false, isMultiple: false, isSolo: true, options: pageSizeMenuOptions, value: pageSize, styles: { list: styles.pageSizeList }, onClear: noop$1, onChange: function (value) {
|
|
1413
|
+
if (onChangePageSize) {
|
|
1414
|
+
onChangePageSize(toSafeInteger(value === null || value === void 0 ? void 0 : value.value));
|
|
1415
|
+
}
|
|
1416
|
+
} })), jsx("button", { className: toClassName(styles.mobile.button, current === max && styles.button.disabled), disabled: current === max, onClick: function () { return handleChangeCurrent(current + 1); }, children: "Next" })] }), jsxs("div", { className: styles.desktop.container, children: [jsx("div", { children: jsx("div", { className: "text-sm text-gray-700", children: children && children({ min: min, max: max, current: current }) }) }), hasCustomizablePageSize && (jsx(SelectMenuForm, { name: "pageSize", isClearable: false, isSearchable: false, isMultiple: false, isSolo: true, options: pageSizeMenuOptions, value: pageSize, styles: { list: styles.pageSizeList }, onClear: noop$1, onChange: function (value) {
|
|
1417
|
+
if (onChangePageSize) {
|
|
1418
|
+
onChangePageSize(toSafeInteger(value === null || value === void 0 ? void 0 : value.value));
|
|
1419
|
+
}
|
|
1420
|
+
} })), jsx("div", { children: jsxs("nav", { className: styles.desktop.navigation, "aria-label": "Pagination", children: [jsxs("button", { className: toClassName(styles.desktop.outerLeftButton, current === min && styles.button.disabled), disabled: current === min, onClick: function () { return handleChangeCurrent(1); }, children: [jsx("span", { className: styles.label, children: "First" }), jsx(ChevronDoubleLeftIcon, { className: styles.icon, "aria-hidden": "true" })] }), jsxs("button", { className: toClassName(styles.desktop.innerButton, current === min && styles.button.disabled), disabled: current === min, onClick: function () { return handleChangeCurrent(current - 1); }, children: [jsx("span", { className: styles.label, children: "Previous" }), jsx(ChevronLeftIcon, { className: styles.icon, "aria-hidden": "true" })] }), component, jsxs("button", { className: toClassName(styles.desktop.innerButton, current === max && styles.button.disabled), disabled: current === max, onClick: function () { return handleChangeCurrent(current + 1); }, children: [jsx("span", { className: styles.label, children: "Next" }), jsx(ChevronRightIcon, { className: styles.icon, "aria-hidden": "true" })] }), jsxs("button", { className: toClassName(styles.desktop.outerRightButton, current === max && styles.button.disabled), disabled: current === max, onClick: function () { return handleChangeCurrent(max); }, children: [jsx("span", { className: styles.label, children: "Last" }), jsx(ChevronDoubleRightIcon, { className: styles.icon, "aria-hidden": "true" })] })] }) })] })] }));
|
|
1238
1421
|
};
|
|
1239
1422
|
|
|
1240
|
-
var base$
|
|
1423
|
+
var base$d = {
|
|
1241
1424
|
container: 'flex items-center justify-between border-t border-gray-200 bg-white py-3',
|
|
1242
1425
|
mobile: {
|
|
1243
1426
|
container: '',
|
|
@@ -1258,9 +1441,10 @@ var base$e = {
|
|
|
1258
1441
|
divider: 'relative inline-flex items-center border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-500',
|
|
1259
1442
|
label: 'sr-only',
|
|
1260
1443
|
icon: 'w-5 h-5',
|
|
1444
|
+
pageSizeList: '!overflow-hidden',
|
|
1261
1445
|
};
|
|
1262
|
-
var styles$
|
|
1263
|
-
base: base$
|
|
1446
|
+
var styles$g = {
|
|
1447
|
+
base: base$d,
|
|
1264
1448
|
};
|
|
1265
1449
|
|
|
1266
1450
|
var TableList = function (props) {
|
|
@@ -1268,10 +1452,10 @@ var TableList = function (props) {
|
|
|
1268
1452
|
var id = props.id, columns = props.columns, data = props.data, page = props.page, children = props.children, defaultOrder = props.defaultOrder, defaultVisibility = props.defaultVisibility, _f = props.type, type = _f === void 0 ? 'normal' : _f, isLoading = props.isLoading, _g = props.isStriped, isStriped = _g === void 0 ? false : _g, _h = props.hasStickyHeader, hasStickyHeader = _h === void 0 ? false : _h, _j = props.hasVerticalSeparators, hasVerticalSeparators = _j === void 0 ? false : _j, _k = props.areControlsVisible, areControlsVisible = _k === void 0 ? true : _k, customControls = props.customControls, _l = props.exportFileName, exportFileName = _l === void 0 ? 'table-export' : _l, stylesOverrides = props.styles, onChange = props.onChange, onPaginate = props.onPaginate;
|
|
1269
1453
|
var _m = useExcel(), generate = _m.generate, write = _m.write;
|
|
1270
1454
|
var handleGenerateStyle = function () {
|
|
1271
|
-
var result = deepCopyObject(styles$
|
|
1272
|
-
var keys = calculateNestedKeys(styles$
|
|
1455
|
+
var result = deepCopyObject(styles$f.base);
|
|
1456
|
+
var keys = calculateNestedKeys(styles$f.base);
|
|
1273
1457
|
keys.forEach(function (key) {
|
|
1274
|
-
set(result, key, toClassName(get(styles$
|
|
1458
|
+
set(result, key, toClassName(get(styles$f.base, key), type && get(styles$f[type], key), hasStickyHeader && get(styles$f.sticky, key), hasVerticalSeparators && get(styles$f.separated, key), areControlsVisible && get(styles$f.controlled, key), get(stylesOverrides, key)));
|
|
1275
1459
|
});
|
|
1276
1460
|
return result;
|
|
1277
1461
|
};
|
|
@@ -1396,7 +1580,7 @@ var TableList = function (props) {
|
|
|
1396
1580
|
: { container: 'mt-4' }, onChange: onPaginate, children: children })] }) }));
|
|
1397
1581
|
};
|
|
1398
1582
|
|
|
1399
|
-
var base$
|
|
1583
|
+
var base$c = {
|
|
1400
1584
|
container: 'px-4 sm:px-6 lg:px-8',
|
|
1401
1585
|
head: {
|
|
1402
1586
|
container: 'sm:flex sm:items-center',
|
|
@@ -1450,7 +1634,7 @@ var base$d = {
|
|
|
1450
1634
|
},
|
|
1451
1635
|
},
|
|
1452
1636
|
};
|
|
1453
|
-
var normal$
|
|
1637
|
+
var normal$4 = {
|
|
1454
1638
|
body: {
|
|
1455
1639
|
content: 'inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8',
|
|
1456
1640
|
styleWrapper: 'relative',
|
|
@@ -1508,9 +1692,9 @@ var controlled = {
|
|
|
1508
1692
|
container: '!flex',
|
|
1509
1693
|
},
|
|
1510
1694
|
};
|
|
1511
|
-
var styles$
|
|
1512
|
-
base: base$
|
|
1513
|
-
normal: normal$
|
|
1695
|
+
var styles$f = {
|
|
1696
|
+
base: base$c,
|
|
1697
|
+
normal: normal$4,
|
|
1514
1698
|
panel: panel$1,
|
|
1515
1699
|
full: full,
|
|
1516
1700
|
sticky: sticky,
|
|
@@ -1562,10 +1746,10 @@ var TableList2 = function (props) {
|
|
|
1562
1746
|
var _h = useState({}), columnVisibility = _h[0], setColumnVisibility = _h[1];
|
|
1563
1747
|
var _j = useState([]), columnOrder = _j[0], setColumnOrder = _j[1];
|
|
1564
1748
|
var handleGenerateStyle = function () {
|
|
1565
|
-
var result = deepCopyObject(styles$
|
|
1566
|
-
var keys = calculateNestedKeys(styles$
|
|
1749
|
+
var result = deepCopyObject(styles$e.base);
|
|
1750
|
+
var keys = calculateNestedKeys(styles$e.base);
|
|
1567
1751
|
keys.forEach(function (key) {
|
|
1568
|
-
set(result, key, toClassName(get(styles$
|
|
1752
|
+
set(result, key, toClassName(get(styles$e.base, key),
|
|
1569
1753
|
// type && get(defaultStyles[type], key),
|
|
1570
1754
|
// hasStickyHeader && get(defaultStyles.sticky, key),
|
|
1571
1755
|
// hasVerticalSeparators && get(defaultStyles.separated, key),
|
|
@@ -1689,7 +1873,7 @@ var TableList2 = function (props) {
|
|
|
1689
1873
|
}) }))] }), isEmpty(table === null || table === void 0 ? void 0 : table.getRowModel().rows) && !isLoading && (jsx(Fragment$1, { children: ((_e = config === null || config === void 0 ? void 0 : config.options) === null || _e === void 0 ? void 0 : _e.emptyComponent) ? ((_f = config === null || config === void 0 ? void 0 : config.options) === null || _f === void 0 ? void 0 : _f.emptyComponent) : (jsx("div", { className: "w-full flex justify-center my-2", children: "There is no data to show..." })) })), isLoading && (jsx("div", { className: "flex flex-col gap-y-2 w-full pt-5", children: new Array(8).fill(undefined).map(function (index) { return (jsxs("div", { className: "flex gap-2", children: [jsx("div", { className: "w-20 h-12 rounded-md bg-gray-100 animate-pulse" }), jsx("div", { className: "w-full h-12 rounded-md bg-gray-100 animate-pulse" })] }, index)); }) }))] }) }) }) }), jsx("div", { className: styles.foot, children: foot && foot(state) })] }));
|
|
1690
1874
|
};
|
|
1691
1875
|
|
|
1692
|
-
var base$
|
|
1876
|
+
var base$b = {
|
|
1693
1877
|
container: '',
|
|
1694
1878
|
head: '',
|
|
1695
1879
|
body: {
|
|
@@ -1728,8 +1912,8 @@ var base$c = {
|
|
|
1728
1912
|
},
|
|
1729
1913
|
foot: '',
|
|
1730
1914
|
};
|
|
1731
|
-
var styles$
|
|
1732
|
-
base: base$
|
|
1915
|
+
var styles$e = {
|
|
1916
|
+
base: base$b,
|
|
1733
1917
|
};
|
|
1734
1918
|
|
|
1735
1919
|
var createColumnHelper = function () {
|
|
@@ -1739,10 +1923,10 @@ var createColumnHelper = function () {
|
|
|
1739
1923
|
var BreadcrumbsNavigation = function (props) {
|
|
1740
1924
|
var _a = props.href, href = _a === void 0 ? '/' : _a, pages = props.pages, _b = props.type, type = _b === void 0 ? 'slashes' : _b, customSeparator = props.separator, stylesOverrides = props.styles;
|
|
1741
1925
|
var handleGenerateStyle = function () {
|
|
1742
|
-
var result = deepCopyObject(styles$
|
|
1743
|
-
var keys = calculateNestedKeys(styles$
|
|
1926
|
+
var result = deepCopyObject(styles$d.base);
|
|
1927
|
+
var keys = calculateNestedKeys(styles$d.base);
|
|
1744
1928
|
keys.forEach(function (key) {
|
|
1745
|
-
set$1(result, key, toClassName(get$1(styles$
|
|
1929
|
+
set$1(result, key, toClassName(get$1(styles$d.base, key), type && get$1(styles$d[type], key), get$1(stylesOverrides, key)));
|
|
1746
1930
|
});
|
|
1747
1931
|
return result;
|
|
1748
1932
|
};
|
|
@@ -1778,7 +1962,7 @@ var BreadcrumbsNavigation = function (props) {
|
|
|
1778
1962
|
return (jsx("nav", { className: styles.container, "aria-label": "Breadcrumb", children: jsxs("ol", { className: styles.list, children: [jsx(HomeLink, {}), pages === null || pages === void 0 ? void 0 : pages.map(function (page) { return jsx(PageLink, { page: page }, page.name); })] }) }));
|
|
1779
1963
|
};
|
|
1780
1964
|
|
|
1781
|
-
var base$
|
|
1965
|
+
var base$a = {
|
|
1782
1966
|
container: 'flex',
|
|
1783
1967
|
list: 'flex',
|
|
1784
1968
|
separator: '',
|
|
@@ -1863,8 +2047,8 @@ var bar = {
|
|
|
1863
2047
|
link: '',
|
|
1864
2048
|
},
|
|
1865
2049
|
};
|
|
1866
|
-
var styles$
|
|
1867
|
-
base: base$
|
|
2050
|
+
var styles$d = {
|
|
2051
|
+
base: base$a,
|
|
1868
2052
|
slashes: slashes,
|
|
1869
2053
|
chevrons: chevrons,
|
|
1870
2054
|
panel: panel,
|
|
@@ -1875,10 +2059,10 @@ var PagePaginationNavigation = function (props) {
|
|
|
1875
2059
|
var _a = props.min, min = _a === void 0 ? 1 : _a, _b = props.max, max = _b === void 0 ? 20 : _b, stylesOverrides = props.styles, onChange = props.onChange;
|
|
1876
2060
|
var _c = useState(2), current = _c[0], setCurrent = _c[1];
|
|
1877
2061
|
var handleGenerateStyle = function () {
|
|
1878
|
-
var result = deepCopyObject(styles$
|
|
1879
|
-
var keys = calculateNestedKeys(styles$
|
|
2062
|
+
var result = deepCopyObject(styles$c.base);
|
|
2063
|
+
var keys = calculateNestedKeys(styles$c.base);
|
|
1880
2064
|
keys.forEach(function (key) {
|
|
1881
|
-
set(result, key, toClassName(get(styles$
|
|
2065
|
+
set(result, key, toClassName(get(styles$c.base, key), get(stylesOverrides, key)));
|
|
1882
2066
|
});
|
|
1883
2067
|
return result;
|
|
1884
2068
|
};
|
|
@@ -1919,7 +2103,7 @@ var PagePaginationNavigation = function (props) {
|
|
|
1919
2103
|
return (jsxs("nav", { className: styles.container, children: [jsx("div", { className: styles.left.container, children: jsxs("button", { className: toClassName(styles.left.button, current === min && styles.button.disabled), disabled: current === min, onClick: function () { return setCurrent(current - 1); }, children: [jsx(ArrowLongLeftIcon, { className: styles.left.icon }), "Previous"] }) }), jsx("div", { className: styles.center.container, children: component }), jsx("div", { className: styles.right.container, children: jsxs("button", { className: toClassName(styles.right.button, current === max && styles.button.disabled), disabled: current === max, onClick: function () { return setCurrent(current + 1); }, children: ["Next", jsx(ArrowLongRightIcon, { className: styles.right.icon })] }) })] }));
|
|
1920
2104
|
};
|
|
1921
2105
|
|
|
1922
|
-
var base$
|
|
2106
|
+
var base$9 = {
|
|
1923
2107
|
container: 'flex items-center justify-between border-t border-gray-200 px-4 sm:px-0',
|
|
1924
2108
|
left: {
|
|
1925
2109
|
container: '-mt-px flex w-0 flex-1',
|
|
@@ -1941,18 +2125,18 @@ var base$a = {
|
|
|
1941
2125
|
},
|
|
1942
2126
|
divider: 'inline-flex items-center border-t-2 border-transparent px-4 pt-4 text-sm font-medium text-gray-500',
|
|
1943
2127
|
};
|
|
1944
|
-
var styles$
|
|
1945
|
-
base: base$
|
|
2128
|
+
var styles$c = {
|
|
2129
|
+
base: base$9,
|
|
1946
2130
|
};
|
|
1947
2131
|
|
|
1948
2132
|
var Container$1 = function (props) {
|
|
1949
2133
|
var children = props.children, stylesOverrides = props.styles;
|
|
1950
2134
|
var _a = useState(''), active = _a[0], setActive = _a[1];
|
|
1951
2135
|
var handleGenerateStyle = function () {
|
|
1952
|
-
var result = deepCopyObject(styles$
|
|
1953
|
-
var keys = calculateNestedKeys(styles$
|
|
2136
|
+
var result = deepCopyObject(styles$b.base);
|
|
2137
|
+
var keys = calculateNestedKeys(styles$b.base);
|
|
1954
2138
|
keys.forEach(function (key) {
|
|
1955
|
-
set(result, key, toClassName(get(styles$
|
|
2139
|
+
set(result, key, toClassName(get(styles$b.base, key), get(stylesOverrides, key)));
|
|
1956
2140
|
});
|
|
1957
2141
|
return result;
|
|
1958
2142
|
};
|
|
@@ -1962,10 +2146,10 @@ var Container$1 = function (props) {
|
|
|
1962
2146
|
var List$1 = function (props) {
|
|
1963
2147
|
var name = props.name, children = props.children, active = props.active, setActive = props.setActive, stylesOverrides = props.styles;
|
|
1964
2148
|
var handleGenerateStyle = function () {
|
|
1965
|
-
var result = deepCopyObject(styles$
|
|
1966
|
-
var keys = calculateNestedKeys(styles$
|
|
2149
|
+
var result = deepCopyObject(styles$b.base);
|
|
2150
|
+
var keys = calculateNestedKeys(styles$b.base);
|
|
1967
2151
|
keys.forEach(function (key) {
|
|
1968
|
-
set(result, key, toClassName(get(styles$
|
|
2152
|
+
set(result, key, toClassName(get(styles$b.base, key), get(stylesOverrides, key)));
|
|
1969
2153
|
});
|
|
1970
2154
|
return result;
|
|
1971
2155
|
};
|
|
@@ -2011,10 +2195,10 @@ var List$1 = function (props) {
|
|
|
2011
2195
|
var Item$1 = function (props) {
|
|
2012
2196
|
var children = props.children, _a = props.as, LinkComponent = _a === void 0 ? 'a' : _a, _b = props.type, type = _b === void 0 ? 'underline' : _b, href = props.href, isCurrent = props.isCurrent, onClick = props.onClick, stylesOverrides = props.styles, isLoading = props.isLoading;
|
|
2013
2197
|
var handleGenerateStyle = function () {
|
|
2014
|
-
var result = deepCopyObject(styles$
|
|
2015
|
-
var keys = calculateNestedKeys(styles$
|
|
2198
|
+
var result = deepCopyObject(styles$b.base);
|
|
2199
|
+
var keys = calculateNestedKeys(styles$b.base);
|
|
2016
2200
|
keys.forEach(function (key) {
|
|
2017
|
-
set(result, key, toClassName(get(styles$
|
|
2201
|
+
set(result, key, toClassName(get(styles$b.base, key), type && get(styles$b[type], key), get(stylesOverrides, key)));
|
|
2018
2202
|
});
|
|
2019
2203
|
return result;
|
|
2020
2204
|
};
|
|
@@ -2035,7 +2219,7 @@ var TabNavigation = {
|
|
|
2035
2219
|
View: View$1,
|
|
2036
2220
|
};
|
|
2037
2221
|
|
|
2038
|
-
var base$
|
|
2222
|
+
var base$8 = {
|
|
2039
2223
|
container: '',
|
|
2040
2224
|
list: {
|
|
2041
2225
|
container: '',
|
|
@@ -2072,8 +2256,8 @@ var buttons = {
|
|
|
2072
2256
|
inactive: 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300',
|
|
2073
2257
|
},
|
|
2074
2258
|
};
|
|
2075
|
-
var styles$
|
|
2076
|
-
base: base$
|
|
2259
|
+
var styles$b = {
|
|
2260
|
+
base: base$8,
|
|
2077
2261
|
underline: underline,
|
|
2078
2262
|
pills: pills,
|
|
2079
2263
|
buttons: buttons,
|
|
@@ -2100,11 +2284,11 @@ var List = function (props) {
|
|
|
2100
2284
|
setActive && setActive(tab === null || tab === void 0 ? void 0 : tab.props.accessor);
|
|
2101
2285
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2102
2286
|
}, []);
|
|
2103
|
-
return (jsx("nav", { className: toClassName(styles$
|
|
2287
|
+
return (jsx("nav", { className: toClassName(styles$a.list, stylesOverrides === null || stylesOverrides === void 0 ? void 0 : stylesOverrides.list), children: children }));
|
|
2104
2288
|
};
|
|
2105
2289
|
var Item = function (props) {
|
|
2106
2290
|
var children = props.children, href = props.href, isCurrent = props.isCurrent, _a = props.linkComponent, LinkComponent = _a === void 0 ? 'a' : _a, onClick = props.onClick;
|
|
2107
|
-
return (jsx(LinkComponent, { href: href, className: toClassName(styles$
|
|
2291
|
+
return (jsx(LinkComponent, { href: href, className: toClassName(styles$a.item[isCurrent ? 'active' : 'notActive'], styles$a.item.base), onClick: onClick, children: children }));
|
|
2108
2292
|
};
|
|
2109
2293
|
var View = function (props) {
|
|
2110
2294
|
var children = props.children;
|
|
@@ -2117,7 +2301,7 @@ var VerticalNavigation = {
|
|
|
2117
2301
|
View: View,
|
|
2118
2302
|
};
|
|
2119
2303
|
|
|
2120
|
-
var styles$
|
|
2304
|
+
var styles$a = {
|
|
2121
2305
|
container: '',
|
|
2122
2306
|
list: 'space-y-1',
|
|
2123
2307
|
item: {
|
|
@@ -2135,10 +2319,10 @@ var ModalOverlay = function (props) {
|
|
|
2135
2319
|
handleClose: function () { return setIsOpen(false); },
|
|
2136
2320
|
}); }, []);
|
|
2137
2321
|
var handleGenerateStyle = function () {
|
|
2138
|
-
var result = deepCopyObject(styles$
|
|
2139
|
-
var keys = calculateNestedKeys(styles$
|
|
2322
|
+
var result = deepCopyObject(styles$9.base);
|
|
2323
|
+
var keys = calculateNestedKeys(styles$9.base);
|
|
2140
2324
|
keys.forEach(function (key) {
|
|
2141
|
-
set(result, key, toClassName(get(styles$
|
|
2325
|
+
set(result, key, toClassName(get(styles$9.base, key), size && get(styles$9[size], key), get(stylesOverrides, key)));
|
|
2142
2326
|
});
|
|
2143
2327
|
return result;
|
|
2144
2328
|
};
|
|
@@ -2156,7 +2340,7 @@ var ModalOverlay = function (props) {
|
|
|
2156
2340
|
return (jsxs(Fragment$1, { children: [jsx(Transition.Root, { show: isOpen, as: Fragment, children: jsxs(Dialog, { as: "div", className: styles.container, onClose: setIsOpen, children: [jsx(Transition.Child, { as: Fragment, enter: styles.background.transition.enter, enterFrom: styles.background.transition.enterFrom, enterTo: styles.background.transition.enterTo, leave: styles.background.transition.leave, leaveFrom: styles.background.transition.leaveFrom, leaveTo: styles.background.transition.leaveTo, children: jsx("div", { className: styles.background.container }) }), jsx("div", { className: styles.layout.container, children: jsx("div", { className: styles.layout.content, children: jsx(Transition.Child, { as: Fragment, enter: styles.panel.transition.enter, enterFrom: styles.panel.transition.enterFrom, enterTo: styles.panel.transition.enterTo, leave: styles.panel.transition.leave, leaveFrom: styles.panel.transition.leaveFrom, leaveTo: styles.panel.transition.leaveTo, children: jsx(Dialog.Panel, { className: styles.panel.container, children: children(options) }) }) }) })] }) }), trigger && trigger(options)] }));
|
|
2157
2341
|
};
|
|
2158
2342
|
|
|
2159
|
-
var base$
|
|
2343
|
+
var base$7 = {
|
|
2160
2344
|
container: 'relative z-20',
|
|
2161
2345
|
background: {
|
|
2162
2346
|
container: 'fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity',
|
|
@@ -2210,8 +2394,8 @@ var xl$2 = {
|
|
|
2210
2394
|
container: 'sm:max-w-4xl',
|
|
2211
2395
|
},
|
|
2212
2396
|
};
|
|
2213
|
-
var styles$
|
|
2214
|
-
base: base$
|
|
2397
|
+
var styles$9 = {
|
|
2398
|
+
base: base$7,
|
|
2215
2399
|
xs: xs$2,
|
|
2216
2400
|
sm: sm$2,
|
|
2217
2401
|
md: md$2,
|
|
@@ -2222,10 +2406,10 @@ var styles$a = {
|
|
|
2222
2406
|
var NotificationOverlayContainer = function (_a) {
|
|
2223
2407
|
var children = _a.children, stylesOverrides = _a.styles;
|
|
2224
2408
|
var handleGenerateStyle = function () {
|
|
2225
|
-
var result = deepCopyObject(styles$
|
|
2226
|
-
var keys = calculateNestedKeys(styles$
|
|
2409
|
+
var result = deepCopyObject(styles$8.base);
|
|
2410
|
+
var keys = calculateNestedKeys(styles$8.base);
|
|
2227
2411
|
keys.forEach(function (key) {
|
|
2228
|
-
set(result, key, toClassName(get(styles$
|
|
2412
|
+
set(result, key, toClassName(get(styles$8.base, key), get(stylesOverrides, key)));
|
|
2229
2413
|
});
|
|
2230
2414
|
return result;
|
|
2231
2415
|
};
|
|
@@ -2240,10 +2424,10 @@ var NotificationOverlayItem = function (props) {
|
|
|
2240
2424
|
onClose: function () { return setIsOpen(false); },
|
|
2241
2425
|
}); }, []);
|
|
2242
2426
|
var handleGenerateStyle = function () {
|
|
2243
|
-
var result = deepCopyObject(styles$
|
|
2244
|
-
var keys = calculateNestedKeys(styles$
|
|
2427
|
+
var result = deepCopyObject(styles$8.base);
|
|
2428
|
+
var keys = calculateNestedKeys(styles$8.base);
|
|
2245
2429
|
keys.forEach(function (key) {
|
|
2246
|
-
set(result, key, toClassName(get(styles$
|
|
2430
|
+
set(result, key, toClassName(get(styles$8.base, key), size && get(styles$8[size], key), get(stylesOverrides, key)));
|
|
2247
2431
|
});
|
|
2248
2432
|
return result;
|
|
2249
2433
|
};
|
|
@@ -2255,7 +2439,7 @@ var NotificationOverlay = {
|
|
|
2255
2439
|
Item: NotificationOverlayItem,
|
|
2256
2440
|
};
|
|
2257
2441
|
|
|
2258
|
-
var base$
|
|
2442
|
+
var base$6 = {
|
|
2259
2443
|
container: {
|
|
2260
2444
|
outer: 'pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6 z-30',
|
|
2261
2445
|
inner: 'flex w-full flex-col items-center space-y-4 sm:items-end',
|
|
@@ -2315,8 +2499,8 @@ var xl$1 = {
|
|
|
2315
2499
|
},
|
|
2316
2500
|
},
|
|
2317
2501
|
};
|
|
2318
|
-
var styles$
|
|
2319
|
-
base: base$
|
|
2502
|
+
var styles$8 = {
|
|
2503
|
+
base: base$6,
|
|
2320
2504
|
xs: xs$1,
|
|
2321
2505
|
sm: sm$1,
|
|
2322
2506
|
md: md$1,
|
|
@@ -2332,10 +2516,10 @@ var SlideOverOverlay = function (props) {
|
|
|
2332
2516
|
handleClose: function () { return setIsOpen(false); },
|
|
2333
2517
|
}); }, []);
|
|
2334
2518
|
var handleGenerateStyle = function () {
|
|
2335
|
-
var result = deepCopyObject(styles$
|
|
2336
|
-
var keys = calculateNestedKeys(styles$
|
|
2519
|
+
var result = deepCopyObject(styles$7.base);
|
|
2520
|
+
var keys = calculateNestedKeys(styles$7.base);
|
|
2337
2521
|
keys.forEach(function (key) {
|
|
2338
|
-
set(result, key, toClassName(get(styles$
|
|
2522
|
+
set(result, key, toClassName(get(styles$7.base, key), size && get(styles$7[size], key), get(stylesOverrides, key)));
|
|
2339
2523
|
});
|
|
2340
2524
|
return result;
|
|
2341
2525
|
};
|
|
@@ -2343,7 +2527,7 @@ var SlideOverOverlay = function (props) {
|
|
|
2343
2527
|
return (jsxs(Fragment$1, { children: [jsx(Transition.Root, { show: isOpen, as: Fragment, children: jsxs(Dialog, { as: "div", className: styles.container, onClose: setIsOpen, children: [jsx(Transition.Child, { as: Fragment, enter: styles.background.transition.enter, enterFrom: styles.background.transition.enterFrom, enterTo: styles.background.transition.enterTo, leave: styles.background.transition.leave, leaveFrom: styles.background.transition.leaveFrom, leaveTo: styles.background.transition.leaveTo, children: jsx("div", { className: styles.background.container }) }), jsx("div", { className: styles.layout.container, children: jsx("div", { className: styles.layout.content, children: jsx("div", { className: styles.layout.inner, children: jsx(Transition.Child, { as: Fragment, enter: styles.panel.transition.enter, enterFrom: styles.panel.transition.enterFrom, enterTo: styles.panel.transition.enterTo, leave: styles.panel.transition.leave, leaveFrom: styles.panel.transition.leaveFrom, leaveTo: styles.panel.transition.leaveTo, children: jsx(Dialog.Panel, { className: styles.panel.container, children: children(options) }) }) }) }) })] }) }), trigger && trigger(options)] }));
|
|
2344
2528
|
};
|
|
2345
2529
|
|
|
2346
|
-
var base$
|
|
2530
|
+
var base$5 = {
|
|
2347
2531
|
container: 'relative z-20',
|
|
2348
2532
|
background: {
|
|
2349
2533
|
container: 'fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity',
|
|
@@ -2398,8 +2582,8 @@ var xl = {
|
|
|
2398
2582
|
container: 'sm:max-w-4xl',
|
|
2399
2583
|
},
|
|
2400
2584
|
};
|
|
2401
|
-
var styles$
|
|
2402
|
-
base: base$
|
|
2585
|
+
var styles$7 = {
|
|
2586
|
+
base: base$5,
|
|
2403
2587
|
xs: xs,
|
|
2404
2588
|
sm: sm,
|
|
2405
2589
|
md: md,
|
|
@@ -2420,19 +2604,19 @@ var TableColumnOptionsCustom = function (props) {
|
|
|
2420
2604
|
ids.splice(location, 0, column.id);
|
|
2421
2605
|
setColumnOrder(ids);
|
|
2422
2606
|
}, []);
|
|
2423
|
-
return (jsxs(Popover, { children: [jsx(Popover.Button, { children: trigger }), jsx(Popover.Panel, { className: styles$
|
|
2607
|
+
return (jsxs(Popover, { children: [jsx(Popover.Button, { children: trigger }), jsx(Popover.Panel, { className: styles$6.controls.content, children: table
|
|
2424
2608
|
.getAllLeafColumns()
|
|
2425
2609
|
.map(function (column, index) {
|
|
2426
2610
|
var isAccessorColumn = !!(column === null || column === void 0 ? void 0 : column.accessorFn);
|
|
2427
|
-
return (jsxs("div", { className: toClassName(styles$
|
|
2611
|
+
return (jsxs("div", { className: toClassName(styles$6.controls.dropdown.container, !isAccessorColumn && 'hidden'), children: [jsx("input", { className: styles$6.controls.dropdown.input, type: "checkbox", checked: column.getIsVisible(), onChange: column.getToggleVisibilityHandler() }), jsx("label", { className: styles$6.controls.dropdown.label, children: column.columnDef.header }), jsxs("div", { className: styles$6.controls.dropdown.actions, children: [jsx(ChevronDownIcon$1, { className: styles$6.controls.dropdown.upIcon, onClick: function () {
|
|
2428
2612
|
return handleUpdateColumnOrder(table, column, index - 1, setColumnOrder);
|
|
2429
|
-
} }), jsx(ChevronDownIcon$1, { className: styles$
|
|
2613
|
+
} }), jsx(ChevronDownIcon$1, { className: styles$6.controls.dropdown.downIcon, onClick: function () {
|
|
2430
2614
|
return handleUpdateColumnOrder(table, column, index + 1, setColumnOrder);
|
|
2431
2615
|
} })] })] }, column.id));
|
|
2432
2616
|
}) })] }));
|
|
2433
2617
|
};
|
|
2434
2618
|
|
|
2435
|
-
var styles$
|
|
2619
|
+
var styles$6 = {
|
|
2436
2620
|
container: '',
|
|
2437
2621
|
controls: {
|
|
2438
2622
|
container: 'flex-row justify-between z-10 relative mb-4 gap-2 hidden',
|
|
@@ -2462,168 +2646,6 @@ var TableExcelExportCustom = function (props) {
|
|
|
2462
2646
|
return jsx("div", { children: children({ handleExport: handleExport }) });
|
|
2463
2647
|
};
|
|
2464
2648
|
|
|
2465
|
-
var SelectMenuForm = function (props) {
|
|
2466
|
-
var _a;
|
|
2467
|
-
var _b = props.name, name = _b === void 0 ? 'select-menu-form' : _b, label = props.label, description = props.description, placeholder = props.placeholder, options = props.options, required = props.required, value = props.value, error = props.error, _c = props.isRequired, isRequired = _c === void 0 ? false : _c, isLoading = props.isLoading, _d = props.isTouched, isTouched = _d === void 0 ? false : _d, isDisabled = props.isDisabled, _e = props.isClearable, isClearable = _e === void 0 ? true : _e, _f = props.isMultiple, isMultiple = _f === void 0 ? false : _f, _g = props.isSearchable, isSearchable = _g === void 0 ? true : _g, _h = props.isSolo, isSolo = _h === void 0 ? false : _h, onChange = props.onChange, onSearchInputChange = props.onSearchInputChange, onClear = props.onClear, onBlur = props.onBlur, stylesOverrides = props.styles;
|
|
2468
|
-
var _j = useState(true), isFocus = _j[0], setIsFocus = _j[1];
|
|
2469
|
-
var _k = useState(value !== null && value !== void 0 ? value : null), state = _k[0], setState = _k[1];
|
|
2470
|
-
var isValid = error === undefined;
|
|
2471
|
-
var handleGenerateStyle = function () {
|
|
2472
|
-
var result = deepCopyObject(styles$6.base);
|
|
2473
|
-
var keys = calculateNestedKeys(styles$6.base);
|
|
2474
|
-
keys.forEach(function (key) {
|
|
2475
|
-
set(result, key, toClassName(get(styles$6.base, key), get(styles$6['normal'], key), isTouched === true && !isValid && get(styles$6.invalid, key), isDisabled && get(styles$6.disabled, key), get(stylesOverrides, key)));
|
|
2476
|
-
});
|
|
2477
|
-
return result;
|
|
2478
|
-
};
|
|
2479
|
-
var handleChange = function (selectValue) {
|
|
2480
|
-
setState(selectValue);
|
|
2481
|
-
onChange && onChange(selectValue);
|
|
2482
|
-
setIsFocus(false);
|
|
2483
|
-
};
|
|
2484
|
-
var styles = handleGenerateStyle();
|
|
2485
|
-
// Simulate onClear event.
|
|
2486
|
-
useEffect(function () {
|
|
2487
|
-
if (state === null && !isFocus) {
|
|
2488
|
-
onClear && onClear(name);
|
|
2489
|
-
}
|
|
2490
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2491
|
-
}, [state]);
|
|
2492
|
-
// Simulate onBlur event.
|
|
2493
|
-
useEffect(function () {
|
|
2494
|
-
if (!isFocus) {
|
|
2495
|
-
onBlur && onBlur();
|
|
2496
|
-
}
|
|
2497
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2498
|
-
}, [isFocus]);
|
|
2499
|
-
// listen to value changes.
|
|
2500
|
-
useEffect(function () {
|
|
2501
|
-
setState(value);
|
|
2502
|
-
}, [value]);
|
|
2503
|
-
return (jsxs("div", { className: styles.container, children: [jsxs("div", { className: styles.head, children: [label && (jsx("label", { htmlFor: name, className: styles.label, children: label })), !required && !isRequired && typeof label === 'string' && (jsx("span", { className: styles.hint, children: "Optional" })), required && required({ isRequired: isRequired })] }), jsxs("div", { className: styles.container, children: [jsx(Select, { primaryColor: "primary",
|
|
2504
|
-
//
|
|
2505
|
-
placeholder: placeholder === null || placeholder === void 0 ? void 0 : placeholder.select, noOptionsMessage: (jsx("p", { className: styles.emptyState, children: (_a = placeholder === null || placeholder === void 0 ? void 0 : placeholder.emptyState) !== null && _a !== void 0 ? _a : 'No results found' })), searchInputPlaceholder: placeholder === null || placeholder === void 0 ? void 0 : placeholder.searchInput,
|
|
2506
|
-
//
|
|
2507
|
-
loading: isLoading, isDisabled: isDisabled, isClearable: isClearable, isMultiple: isMultiple, isSearchable: isSearchable,
|
|
2508
|
-
//
|
|
2509
|
-
options: options,
|
|
2510
|
-
//
|
|
2511
|
-
value: state, onChange: handleChange, onSearchInputChange: onSearchInputChange,
|
|
2512
|
-
//
|
|
2513
|
-
classNames: {
|
|
2514
|
-
menuButton: function () {
|
|
2515
|
-
return toClassName(styles.input, state === null && '[&>*]:!text-gray-300 ', state === null &&
|
|
2516
|
-
!isValid &&
|
|
2517
|
-
isTouched &&
|
|
2518
|
-
'[&>*]:!text-red-300');
|
|
2519
|
-
},
|
|
2520
|
-
menu: styles.menu,
|
|
2521
|
-
tagItem: function () { return styles.tagItem; },
|
|
2522
|
-
tagItemText: styles.tagItemText,
|
|
2523
|
-
tagItemIconContainer: styles.tagItemIconContainer,
|
|
2524
|
-
tagItemIcon: styles.tagItemIcon,
|
|
2525
|
-
list: styles.list,
|
|
2526
|
-
listItem: function () { return styles.listItem; },
|
|
2527
|
-
listDisabledItem: styles.listDisabledItem,
|
|
2528
|
-
listGroupLabel: styles.listGroupLabel,
|
|
2529
|
-
searchContainer: styles.searchContainer,
|
|
2530
|
-
searchBox: styles.searchBox,
|
|
2531
|
-
searchIcon: styles.searchIcon,
|
|
2532
|
-
closeIcon: styles.closeIcon,
|
|
2533
|
-
} }), !isSolo && (jsxs("div", { className: styles.foot, children: [description && !(error && isTouched) && (jsx("p", { className: styles.description, children: description })), error && isTouched && (jsx("p", { className: styles.error, children: JSON.stringify(error).replaceAll('"', '') }))] }))] })] }));
|
|
2534
|
-
};
|
|
2535
|
-
|
|
2536
|
-
var base$5 = {
|
|
2537
|
-
container: '',
|
|
2538
|
-
head: 'flex justify-between',
|
|
2539
|
-
body: 'relative rounded-md',
|
|
2540
|
-
foot: '',
|
|
2541
|
-
label: 'block font-medium text-gray-900',
|
|
2542
|
-
hint: 'text-xs text-gray-500',
|
|
2543
|
-
leading: 'pointer-events-none absolute inset-y-0 left-0 flex items-center',
|
|
2544
|
-
input: 'block w-full flex border',
|
|
2545
|
-
menuButton: '',
|
|
2546
|
-
menu: 'z-10 !px-0 !py-0 !w-full rounded-md overflow-hidden border !mt-1 absolute bg-white',
|
|
2547
|
-
tagItem: 'bg-gray-200 px-2 py-1 flex flex-row gap-x-1 items-center justify-between rounded-sm',
|
|
2548
|
-
tagItemText: 'text-xs',
|
|
2549
|
-
tagItemIconContainer: '!p-0 rounded-full hover:bg-gray-400 text-sm hover:text-white aspect-square w-4 flex items-center justify-center cursor-pointer',
|
|
2550
|
-
tagItemIcon: '',
|
|
2551
|
-
list: '!px-0 !w-full [&>*]:px-0 max-h-56 overflow-scroll !py-1',
|
|
2552
|
-
listGroupLabel: '',
|
|
2553
|
-
listItem: '!w-full !list-none hover:bg-primary-500 hover:text-white !py-2 !px-2',
|
|
2554
|
-
listDisabledItem: '',
|
|
2555
|
-
searchContainer: '!w-full !px-2 !py-2 border-b',
|
|
2556
|
-
searchBox: '',
|
|
2557
|
-
searchIcon: '',
|
|
2558
|
-
closeIcon: '',
|
|
2559
|
-
emptyState: 'w-full inline-flex items-start justify-start px-4',
|
|
2560
|
-
trailing: 'pointer-events-none absolute inset-y-0 right-0 flex items-center',
|
|
2561
|
-
description: 'text-gray-400 text-xs mt-1',
|
|
2562
|
-
error: 'text-red-500 text-xs ml-5 mt-1',
|
|
2563
|
-
};
|
|
2564
|
-
var leading$4 = {
|
|
2565
|
-
input: 'pl-10',
|
|
2566
|
-
};
|
|
2567
|
-
var trailing$4 = {};
|
|
2568
|
-
var normal$4 = {
|
|
2569
|
-
label: 'leading-6 text-sm mb-2',
|
|
2570
|
-
hint: 'leading-6',
|
|
2571
|
-
leading: 'pl-3',
|
|
2572
|
-
input: 'rounded-md border-gray-200 shadow-sm focus:border-primary-500 focus:ring-primary-500 sm:text-sm placeholder-gray-300',
|
|
2573
|
-
trailing: '',
|
|
2574
|
-
description: 'mt-2 text-sm',
|
|
2575
|
-
};
|
|
2576
|
-
var inset$4 = {
|
|
2577
|
-
container: 'rounded-md px-3 pt-2.5 pb-1.5 shadow-sm ring-1 ring-inset ring-gray-300 focus-within:ring-2 focus-within:ring-primary-600',
|
|
2578
|
-
label: 'text-xs',
|
|
2579
|
-
hint: 'text-xs',
|
|
2580
|
-
input: 'border-0 !ring-0 p-0 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm pl-0',
|
|
2581
|
-
description: 'hidden',
|
|
2582
|
-
};
|
|
2583
|
-
var overlapping$4 = {
|
|
2584
|
-
container: 'relative',
|
|
2585
|
-
head: ' absolute flex justify-between items-center left-0 -top-2 right-0 mx-2 z-10 w-full',
|
|
2586
|
-
label: 'inline-block bg-white px-1 text-xs font-medium text-gray-900 ',
|
|
2587
|
-
hint: 'text-xs mr-4 bg-white px-1',
|
|
2588
|
-
input: 'block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6',
|
|
2589
|
-
description: 'hidden',
|
|
2590
|
-
};
|
|
2591
|
-
var pill$4 = {
|
|
2592
|
-
head: 'mx-px block px-4 text-sm font-medium leading-6 text-gray-900 mb-1 pr-6',
|
|
2593
|
-
foot: 'mx-px block px-4 text-sm font-medium leading-6 text-gray-900 mt-1 pr-6',
|
|
2594
|
-
input: 'block w-full rounded-full border-0 px-4 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 sm:text-sm sm:leading-6',
|
|
2595
|
-
trailing: 'pr-2',
|
|
2596
|
-
description: 'text-xs',
|
|
2597
|
-
};
|
|
2598
|
-
var floored$4 = {
|
|
2599
|
-
body: 'relative mt-2',
|
|
2600
|
-
label: 'block text-sm font-medium leading-6 text-gray-900',
|
|
2601
|
-
input: 'peer block w-full border-0 bg-gray-50 py-1.5 text-gray-900 focus:ring-0 sm:text-sm sm:leading-6 ring-0',
|
|
2602
|
-
description: 'text-xs mt-2',
|
|
2603
|
-
};
|
|
2604
|
-
var invalid$4 = {
|
|
2605
|
-
container: 'ring-red-500',
|
|
2606
|
-
input:
|
|
2607
|
-
// 'block w-full border border-transparent text-red-900 ring-1 ring-inset ring-red-300 placeholder:text-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500 sm:leading-6 pr-10',
|
|
2608
|
-
'block w-full border border-transparent text-red-900 ring-1 ring-inset ring-red-300 placeholder:text-red-300 focus:ring-2 focus:ring-inset focus:ring-red-500',
|
|
2609
|
-
description: 'text-sm text-red-600',
|
|
2610
|
-
};
|
|
2611
|
-
var disabled$5 = {
|
|
2612
|
-
input: 'block w-full rounded-md border-0 text-gray-900 shadow-sm ring-1 ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-primary-600 cursor-not-allowed bg-gray-50 text-gray-500 ring-gray-200',
|
|
2613
|
-
};
|
|
2614
|
-
var styles$6 = {
|
|
2615
|
-
base: base$5,
|
|
2616
|
-
leading: leading$4,
|
|
2617
|
-
trailing: trailing$4,
|
|
2618
|
-
normal: normal$4,
|
|
2619
|
-
inset: inset$4,
|
|
2620
|
-
overlapping: overlapping$4,
|
|
2621
|
-
pill: pill$4,
|
|
2622
|
-
floored: floored$4,
|
|
2623
|
-
invalid: invalid$4,
|
|
2624
|
-
disabled: disabled$5,
|
|
2625
|
-
};
|
|
2626
|
-
|
|
2627
2649
|
var DateMenuForm = function (props) {
|
|
2628
2650
|
var _a;
|
|
2629
2651
|
var _b = props.name, name = _b === void 0 ? 'date-menu-form' : _b, _c = props.size, size = _c === void 0 ? 'compact' : _c, label = props.label, _d = props.i18n, i18n = _d === void 0 ? 'en' : _d, description = props.description, placeholder = props.placeholder, separator = props.separator, startFrom = props.startFrom, _e = props.displayFormat, displayFormat = _e === void 0 ? 'DD.MM.YYYY' : _e, _f = props.direction, direction = _f === void 0 ? 'down' : _f, minDate = props.minDate, maxDate = props.maxDate, _g = props.startWeekOn, startWeekOn = _g === void 0 ? 'mon' : _g, _h = props.icon, icon = _h === void 0 ? function (isEmpty) {
|