@ballistix.digital/react-components 0.5.10 → 0.7.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 +8 -0
- package/dist/index.esm.js +280 -252
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +279 -251
- package/dist/index.js.map +1 -1
- package/dist/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -15,8 +15,8 @@ var react = require('@headlessui/react');
|
|
|
15
15
|
var mask = require('@react-input/mask');
|
|
16
16
|
var outline$2 = require('@heroicons/react/24/outline');
|
|
17
17
|
var reactTable = require('@tanstack/react-table');
|
|
18
|
-
var set = require('lodash/set');
|
|
19
18
|
var Select = require('react-tailwindcss-select');
|
|
19
|
+
var set = require('lodash/set');
|
|
20
20
|
var Datepicker = require('react-tailwindcss-datepicker');
|
|
21
21
|
var formik = require('formik');
|
|
22
22
|
|
|
@@ -405,7 +405,7 @@ var styles$s = {
|
|
|
405
405
|
};
|
|
406
406
|
|
|
407
407
|
var BadgeElement = function (props) {
|
|
408
|
-
var children = props.children, _a = props.color, color = _a === void 0 ? 'gray' : _a, _b = props.type, type = _b === void 0 ? 'normal' : _b, _c = props.size, size = _c === void 0 ? 'sm' : _c, _d = props.figure, figure = _d === void 0 ? 'block' : _d, isDisabled = props.isDisabled, isLoading = props.isLoading, onClose = props.onClose, stylesOverrides = props.styles;
|
|
408
|
+
var children = props.children, _a = props.color, color = _a === void 0 ? 'gray' : _a, _b = props.type, type = _b === void 0 ? 'normal' : _b, _c = props.size, size = _c === void 0 ? 'sm' : _c, _d = props.figure, figure = _d === void 0 ? 'block' : _d, isDisabled = props.isDisabled, isLoading = props.isLoading, onClose = props.onClose, stylesOverrides = props.styles, dataCy = props.dataCy;
|
|
409
409
|
var handleGenerateStyle = function () {
|
|
410
410
|
var result = deepCopyObject(styles$r.base);
|
|
411
411
|
var keys = calculateNestedKeys(styles$r.base);
|
|
@@ -419,7 +419,7 @@ var BadgeElement = function (props) {
|
|
|
419
419
|
if (isLoading) {
|
|
420
420
|
return (jsxRuntime.jsx("span", { className: toClassName(styles.container, 'h-4 w-12 animate-pulse'), children: type === 'indicator' && (jsxRuntime.jsx("svg", { className: styles.indicator, fill: "currentColor", viewBox: "0 0 8 8", children: jsxRuntime.jsx("circle", { cx: 4, cy: 4, r: 3 }) })) }));
|
|
421
421
|
}
|
|
422
|
-
return (jsxRuntime.jsxs("span", { className: styles.container, children: [type === 'indicator' && (jsxRuntime.jsx("svg", { className: styles.indicator, fill: "currentColor", viewBox: "0 0 8 8", children: jsxRuntime.jsx("circle", { cx: 4, cy: 4, r: 3 }) })), children, type === 'close' && (jsxRuntime.jsxs("button", { type: "button", className: styles.button, onClick: onClose, children: [jsxRuntime.jsx("span", { className: "sr-only", children: "Remove large option" }), xIcon] }))] }));
|
|
422
|
+
return (jsxRuntime.jsxs("span", { className: styles.container, "data-cy": dataCy, children: [type === 'indicator' && (jsxRuntime.jsx("svg", { className: styles.indicator, fill: "currentColor", viewBox: "0 0 8 8", children: jsxRuntime.jsx("circle", { cx: 4, cy: 4, r: 3 }) })), children, type === 'close' && (jsxRuntime.jsxs("button", { type: "button", className: styles.button, onClick: onClose, children: [jsxRuntime.jsx("span", { className: "sr-only", children: "Remove large option" }), xIcon] }))] }));
|
|
423
423
|
};
|
|
424
424
|
|
|
425
425
|
var base$o = {
|
|
@@ -530,7 +530,7 @@ var styles$r = {
|
|
|
530
530
|
};
|
|
531
531
|
|
|
532
532
|
var ButtonElement = function (props) {
|
|
533
|
-
var children = props.children, innerRef = props.innerRef, _a = props.htmlType, htmlType = _a === void 0 ? 'button' : _a, _b = props.type, type = _b === void 0 ? 'primary' : _b, _c = props.size, size = _c === void 0 ? 'md' : _c, _d = props.figure, figure = _d === void 0 ? 'block' : _d, _e = props.status, status = _e === void 0 ? 'idle' : _e, isDisabled = props.isDisabled, stylesOverrides = props.styles, onClick = props.onClick;
|
|
533
|
+
var children = props.children, innerRef = props.innerRef, _a = props.htmlType, htmlType = _a === void 0 ? 'button' : _a, dataCy = props.dataCy, _b = props.type, type = _b === void 0 ? 'primary' : _b, _c = props.size, size = _c === void 0 ? 'md' : _c, _d = props.figure, figure = _d === void 0 ? 'block' : _d, _e = props.status, status = _e === void 0 ? 'idle' : _e, isDisabled = props.isDisabled, stylesOverrides = props.styles, onClick = props.onClick;
|
|
534
534
|
var handleGenerateStyle = function () {
|
|
535
535
|
var result = deepCopyObject(styles$q.base);
|
|
536
536
|
var keys = calculateNestedKeys(styles$q.base);
|
|
@@ -542,7 +542,7 @@ var ButtonElement = function (props) {
|
|
|
542
542
|
var styles = handleGenerateStyle();
|
|
543
543
|
return (jsxRuntime.jsxs("button", { type: htmlType, className: styles.container, disabled: isDisabled || status !== 'idle', onClick: function (e) {
|
|
544
544
|
onClick && onClick(e);
|
|
545
|
-
}, ref: innerRef, children: [status === 'idle' && children, status === 'loading' && (jsxRuntime.jsxs("div", { className: styles.content, children: [jsxRuntime.jsx(IconElement, { type: "regular", accessor: "spinner", className: styles.spinner }), jsxRuntime.jsx("div", { children: children })] })), status === 'error' && (jsxRuntime.jsxs("div", { className: styles.content, children: [jsxRuntime.jsx(IconElement, { type: "regular", accessor: "circle-exclamation", className: styles.icon }), jsxRuntime.jsx("div", { children: children })] })), status === 'success' && (jsxRuntime.jsxs("div", { className: styles.content, children: [jsxRuntime.jsx(IconElement, { type: "regular", accessor: "circle-check", className: styles.icon }), jsxRuntime.jsx("div", { children: children })] }))] }));
|
|
545
|
+
}, ref: innerRef, "data-cy": dataCy, children: [status === 'idle' && children, status === 'loading' && (jsxRuntime.jsxs("div", { className: styles.content, children: [jsxRuntime.jsx(IconElement, { type: "regular", accessor: "spinner", className: styles.spinner }), jsxRuntime.jsx("div", { children: children })] })), status === 'error' && (jsxRuntime.jsxs("div", { className: styles.content, children: [jsxRuntime.jsx(IconElement, { type: "regular", accessor: "circle-exclamation", className: styles.icon }), jsxRuntime.jsx("div", { children: children })] })), status === 'success' && (jsxRuntime.jsxs("div", { className: styles.content, children: [jsxRuntime.jsx(IconElement, { type: "regular", accessor: "circle-check", className: styles.icon }), jsxRuntime.jsx("div", { children: children })] }))] }));
|
|
546
546
|
};
|
|
547
547
|
|
|
548
548
|
var base$n = {
|
|
@@ -651,7 +651,7 @@ var styles$p = {
|
|
|
651
651
|
};
|
|
652
652
|
|
|
653
653
|
var Container$3 = function (props) {
|
|
654
|
-
var children = props.children, label = props.label, trigger = props.trigger, _a = props.type, type = _a === void 0 ? 'button' : _a, _b = props.direction, direction = _b === void 0 ? 'bottom-left' : _b, _c = props.isEscapingOverflow, isEscapingOverflow = _c === void 0 ? false : _c, stylesOverrides = props.styles;
|
|
654
|
+
var children = props.children, label = props.label, trigger = props.trigger, dataCy = props.dataCy, _a = props.type, type = _a === void 0 ? 'button' : _a, _b = props.direction, direction = _b === void 0 ? 'bottom-left' : _b, _c = props.isEscapingOverflow, isEscapingOverflow = _c === void 0 ? false : _c, stylesOverrides = props.styles;
|
|
655
655
|
var handleGenerateStyle = function () {
|
|
656
656
|
var result = deepCopyObject(styles$o.base);
|
|
657
657
|
var keys = calculateNestedKeys(styles$o.base);
|
|
@@ -662,7 +662,7 @@ var Container$3 = function (props) {
|
|
|
662
662
|
};
|
|
663
663
|
var styles = handleGenerateStyle();
|
|
664
664
|
return (jsxRuntime.jsxs(react.Menu, { as: "div", className: toClassName(styles.container, !isEscapingOverflow && 'relative'), children: [jsxRuntime.jsxs("div", { children: [type === 'button' &&
|
|
665
|
-
(!trigger ? (jsxRuntime.jsxs(react.Menu.Button, { className: styles.button, children: [label, jsxRuntime.jsx(solid.ChevronDownIcon, { className: "-mr-1 ml-2 h-5 w-5", "aria-hidden": "true" })] })) : (jsxRuntime.jsx(react.Menu.Button, { children: trigger }))), type === 'compact' && (jsxRuntime.jsxs(react.Menu.Button, { className: styles.compact, children: [jsxRuntime.jsx("span", { className: "sr-only", children: label }), jsxRuntime.jsx(solid.EllipsisVerticalIcon, { className: styles.dots, "aria-hidden": "true" })] }))] }), jsxRuntime.jsx(react.Transition, { as: React.Fragment, enter: "transition ease-out duration-100", enterFrom: "transform opacity-0 scale-95", enterTo: "transform opacity-100 scale-100", leave: "transition ease-in duration-75", leaveFrom: "transform opacity-100 scale-100", leaveTo: "transform opacity-0 scale-95", children: jsxRuntime.jsx(react.Menu.Items, { className: styles.items, children: children }) })] }));
|
|
665
|
+
(!trigger ? (jsxRuntime.jsxs(react.Menu.Button, { className: styles.button, "data-cy": dataCy, children: [label, jsxRuntime.jsx(solid.ChevronDownIcon, { className: "-mr-1 ml-2 h-5 w-5", "aria-hidden": "true" })] })) : (jsxRuntime.jsx(react.Menu.Button, { "data-cy": dataCy, children: trigger }))), type === 'compact' && (jsxRuntime.jsxs(react.Menu.Button, { className: styles.compact, "data-cy": dataCy, children: [jsxRuntime.jsx("span", { className: "sr-only", children: label }), jsxRuntime.jsx(solid.EllipsisVerticalIcon, { className: styles.dots, "aria-hidden": "true" })] }))] }), jsxRuntime.jsx(react.Transition, { as: React.Fragment, enter: "transition ease-out duration-100", enterFrom: "transform opacity-0 scale-95", enterTo: "transform opacity-100 scale-100", leave: "transition ease-in duration-75", leaveFrom: "transform opacity-100 scale-100", leaveTo: "transform opacity-0 scale-95", children: jsxRuntime.jsx(react.Menu.Items, { className: styles.items, children: children }) })] }));
|
|
666
666
|
};
|
|
667
667
|
var DropdownElement = {
|
|
668
668
|
Container: Container$3,
|
|
@@ -720,8 +720,10 @@ var InputGroupForm = function (props) {
|
|
|
720
720
|
var styles = handleGenerateStyle();
|
|
721
721
|
var invalidIcon = (jsxRuntime.jsx(solid.ExclamationCircleIcon, { className: "h-5 w-5 text-red-500", "aria-hidden": "true" }));
|
|
722
722
|
var isClearable = !trailing && isValid && onClear && value !== '' && value;
|
|
723
|
+
var inputDataCy = "form-input-".concat(name);
|
|
724
|
+
var errorDataCy = "form-input-error-".concat(name);
|
|
723
725
|
return (jsxRuntime.jsxs("div", { className: styles.container, children: [jsxRuntime.jsxs("div", { className: styles.head, children: [label && (jsxRuntime.jsx("label", { htmlFor: name, className: styles.label, children: label })), !required && !isRequired && typeof label === 'string' && (jsxRuntime.jsx("span", { className: styles.hint, children: "Optional" })), required && required({ isRequired: isRequired })] }), jsxRuntime.jsxs("div", { className: styles.body, children: [leading && jsxRuntime.jsx("div", { className: styles.leading, children: leading }), !htmlType ||
|
|
724
|
-
(htmlType !== 'area' && (jsxRuntime.jsxs("div", { className: "flex items-center", children: [jsxRuntime.jsx("input", { type: mask$1 !== undefined ? 'text' : htmlType, ref: mask$1 && ref, name: name, id: name, className: toClassName(styles.input, htmlType === 'color' && '!h-10'), placeholder: placeholder, defaultValue: isSolo ? value : undefined, value: isSolo ? undefined : value, min: min, max: max, maxLength: maxLength, disabled: isDisabled, onChange: onChange, onBlur: onBlur }), htmlType === 'text' && isClearable && (jsxRuntime.jsx("div", { className: "right-5 px-2 absolute cursor-pointer hover:opacity-60", onClick: onClear, children: jsxRuntime.jsx(IconElement, { accessor: "times", className: "text-gray-500" }) })), htmlType === 'date' && isClearable && (jsxRuntime.jsx("div", { className: "right-10 px-2 absolute cursor-pointer hover:opacity-60", onClick: onClear, children: jsxRuntime.jsx(IconElement, { accessor: "times", className: "text-gray-500" }) }))] }))), htmlType === 'area' && (jsxRuntime.jsx("textarea", { rows: rows, name: name, id: name, className: styles.input, placeholder: placeholder, defaultValue: isSolo ? value : undefined, value: isSolo ? undefined : value, maxLength: maxLength, disabled: isDisabled, onChange: onChange, onBlur: onBlur })), type === 'floored' && (jsxRuntime.jsx("div", { className: "absolute inset-x-0 bottom-0 border-t border-gray-300 peer-focus:border-t-2 peer-focus:border-primary-600", "aria-hidden": "true" })), trailing && isValid && (jsxRuntime.jsx("div", { className: styles.trailing, children: trailing })), isTouched && !isValid && (jsxRuntime.jsx("div", { className: styles.trailing, children: invalidIcon }))] }), jsxRuntime.jsxs("div", { className: styles.foot, children: [description && !(error && isTouched) && (jsxRuntime.jsx("p", { className: styles.description, children: description })), error && isTouched && jsxRuntime.jsx("p", { className: styles.error, children: error })] })] }));
|
|
726
|
+
(htmlType !== 'area' && (jsxRuntime.jsxs("div", { className: "flex items-center", children: [jsxRuntime.jsx("input", { type: mask$1 !== undefined ? 'text' : htmlType, ref: mask$1 && ref, name: name, id: name, "data-cy": inputDataCy, className: toClassName(styles.input, htmlType === 'color' && '!h-10'), placeholder: placeholder, defaultValue: isSolo ? value : undefined, value: isSolo ? undefined : value, min: min, max: max, maxLength: maxLength, disabled: isDisabled, onChange: onChange, onBlur: onBlur }), htmlType === 'text' && isClearable && (jsxRuntime.jsx("div", { className: "right-5 px-2 absolute cursor-pointer hover:opacity-60", onClick: onClear, children: jsxRuntime.jsx(IconElement, { accessor: "times", className: "text-gray-500" }) })), htmlType === 'date' && isClearable && (jsxRuntime.jsx("div", { className: "right-10 px-2 absolute cursor-pointer hover:opacity-60", onClick: onClear, children: jsxRuntime.jsx(IconElement, { accessor: "times", className: "text-gray-500" }) }))] }))), htmlType === 'area' && (jsxRuntime.jsx("textarea", { rows: rows, name: name, id: name, "data-cy": inputDataCy, className: styles.input, placeholder: placeholder, defaultValue: isSolo ? value : undefined, value: isSolo ? undefined : value, maxLength: maxLength, disabled: isDisabled, onChange: onChange, onBlur: onBlur })), type === 'floored' && (jsxRuntime.jsx("div", { className: "absolute inset-x-0 bottom-0 border-t border-gray-300 peer-focus:border-t-2 peer-focus:border-primary-600", "aria-hidden": "true" })), trailing && isValid && (jsxRuntime.jsx("div", { className: styles.trailing, children: trailing })), isTouched && !isValid && (jsxRuntime.jsx("div", { className: styles.trailing, children: invalidIcon }))] }), jsxRuntime.jsxs("div", { className: styles.foot, children: [description && !(error && isTouched) && (jsxRuntime.jsx("p", { className: styles.description, children: description })), error && isTouched && (jsxRuntime.jsx("p", { className: styles.error, "data-cy": errorDataCy, children: error }))] })] }));
|
|
725
727
|
};
|
|
726
728
|
|
|
727
729
|
var base$k = {
|
|
@@ -1187,19 +1189,196 @@ var useExcel = function () {
|
|
|
1187
1189
|
};
|
|
1188
1190
|
};
|
|
1189
1191
|
|
|
1192
|
+
var base$e = {
|
|
1193
|
+
container: '',
|
|
1194
|
+
head: 'flex justify-between',
|
|
1195
|
+
body: 'relative rounded-md',
|
|
1196
|
+
foot: '',
|
|
1197
|
+
label: 'block font-medium text-gray-900',
|
|
1198
|
+
hint: 'text-xs text-gray-500',
|
|
1199
|
+
leading: 'pointer-events-none absolute inset-y-0 left-0 flex items-center',
|
|
1200
|
+
input: 'block w-full flex border',
|
|
1201
|
+
menuButton: '',
|
|
1202
|
+
menu: 'z-10 !px-0 !py-0 !w-full rounded-md overflow-hidden border !mt-1 absolute bg-white',
|
|
1203
|
+
tagItem: 'bg-gray-200 px-2 py-1 flex flex-row gap-x-1 items-center justify-between rounded-sm',
|
|
1204
|
+
tagItemText: 'text-xs',
|
|
1205
|
+
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',
|
|
1206
|
+
tagItemIcon: '',
|
|
1207
|
+
list: '!px-0 !w-full [&>*]:px-0 max-h-56 overflow-scroll !py-1',
|
|
1208
|
+
listGroupLabel: '',
|
|
1209
|
+
listItem: '!w-full !list-none hover:bg-primary-500 hover:text-white !py-2 !px-2',
|
|
1210
|
+
listDisabledItem: '',
|
|
1211
|
+
searchContainer: '!w-full !px-2 !py-2 border-b',
|
|
1212
|
+
searchBox: '',
|
|
1213
|
+
searchIcon: '',
|
|
1214
|
+
closeIcon: '',
|
|
1215
|
+
emptyState: 'w-full inline-flex items-start justify-start px-4',
|
|
1216
|
+
trailing: 'pointer-events-none absolute inset-y-0 right-0 flex items-center',
|
|
1217
|
+
description: 'text-gray-400 text-xs mt-1',
|
|
1218
|
+
error: 'text-red-500 text-xs ml-5 mt-1',
|
|
1219
|
+
};
|
|
1220
|
+
var leading$4 = {
|
|
1221
|
+
input: 'pl-10',
|
|
1222
|
+
};
|
|
1223
|
+
var trailing$4 = {};
|
|
1224
|
+
var normal$5 = {
|
|
1225
|
+
label: 'leading-6 text-sm mb-2',
|
|
1226
|
+
hint: 'leading-6',
|
|
1227
|
+
leading: 'pl-3',
|
|
1228
|
+
input: 'rounded-md border-gray-200 shadow-sm focus:border-primary-500 focus:ring-primary-500 sm:text-sm placeholder-gray-300',
|
|
1229
|
+
trailing: '',
|
|
1230
|
+
description: 'mt-2 text-sm',
|
|
1231
|
+
};
|
|
1232
|
+
var inset$4 = {
|
|
1233
|
+
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',
|
|
1234
|
+
label: 'text-xs',
|
|
1235
|
+
hint: 'text-xs',
|
|
1236
|
+
input: 'border-0 !ring-0 p-0 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm pl-0',
|
|
1237
|
+
description: 'hidden',
|
|
1238
|
+
};
|
|
1239
|
+
var overlapping$4 = {
|
|
1240
|
+
container: 'relative',
|
|
1241
|
+
head: ' absolute flex justify-between items-center left-0 -top-2 right-0 mx-2 z-10 w-full',
|
|
1242
|
+
label: 'inline-block bg-white px-1 text-xs font-medium text-gray-900 ',
|
|
1243
|
+
hint: 'text-xs mr-4 bg-white px-1',
|
|
1244
|
+
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',
|
|
1245
|
+
description: 'hidden',
|
|
1246
|
+
};
|
|
1247
|
+
var pill$4 = {
|
|
1248
|
+
head: 'mx-px block px-4 text-sm font-medium leading-6 text-gray-900 mb-1 pr-6',
|
|
1249
|
+
foot: 'mx-px block px-4 text-sm font-medium leading-6 text-gray-900 mt-1 pr-6',
|
|
1250
|
+
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',
|
|
1251
|
+
trailing: 'pr-2',
|
|
1252
|
+
description: 'text-xs',
|
|
1253
|
+
};
|
|
1254
|
+
var floored$4 = {
|
|
1255
|
+
body: 'relative mt-2',
|
|
1256
|
+
label: 'block text-sm font-medium leading-6 text-gray-900',
|
|
1257
|
+
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',
|
|
1258
|
+
description: 'text-xs mt-2',
|
|
1259
|
+
};
|
|
1260
|
+
var invalid$4 = {
|
|
1261
|
+
container: 'ring-red-500',
|
|
1262
|
+
input:
|
|
1263
|
+
// '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',
|
|
1264
|
+
'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',
|
|
1265
|
+
description: 'text-sm text-red-600',
|
|
1266
|
+
};
|
|
1267
|
+
var disabled$5 = {
|
|
1268
|
+
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',
|
|
1269
|
+
};
|
|
1270
|
+
var styles$h = {
|
|
1271
|
+
base: base$e,
|
|
1272
|
+
leading: leading$4,
|
|
1273
|
+
trailing: trailing$4,
|
|
1274
|
+
normal: normal$5,
|
|
1275
|
+
inset: inset$4,
|
|
1276
|
+
overlapping: overlapping$4,
|
|
1277
|
+
pill: pill$4,
|
|
1278
|
+
floored: floored$4,
|
|
1279
|
+
invalid: invalid$4,
|
|
1280
|
+
disabled: disabled$5,
|
|
1281
|
+
};
|
|
1282
|
+
|
|
1283
|
+
var SelectMenuForm = function (props) {
|
|
1284
|
+
var _a;
|
|
1285
|
+
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;
|
|
1286
|
+
var _j = React.useState(true), isFocus = _j[0], setIsFocus = _j[1];
|
|
1287
|
+
var _k = React.useState(value !== null && value !== void 0 ? value : null), state = _k[0], setState = _k[1];
|
|
1288
|
+
var isValid = error === undefined;
|
|
1289
|
+
var selectDataCy = "form-select-".concat(name);
|
|
1290
|
+
var errorDataCy = "form-select-error-".concat(name);
|
|
1291
|
+
var handleGenerateStyle = function () {
|
|
1292
|
+
var result = deepCopyObject(styles$h.base);
|
|
1293
|
+
var keys = calculateNestedKeys(styles$h.base);
|
|
1294
|
+
keys.forEach(function (key) {
|
|
1295
|
+
lodash.set(result, key, toClassName(lodash.get(styles$h.base, key), lodash.get(styles$h['normal'], key), isTouched === true && !isValid && lodash.get(styles$h.invalid, key), isDisabled && lodash.get(styles$h.disabled, key), lodash.get(stylesOverrides, key)));
|
|
1296
|
+
});
|
|
1297
|
+
return result;
|
|
1298
|
+
};
|
|
1299
|
+
var handleChange = function (selectValue) {
|
|
1300
|
+
setState(selectValue);
|
|
1301
|
+
onChange && onChange(selectValue);
|
|
1302
|
+
setIsFocus(false);
|
|
1303
|
+
};
|
|
1304
|
+
var styles = handleGenerateStyle();
|
|
1305
|
+
// Simulate onClear event.
|
|
1306
|
+
React.useEffect(function () {
|
|
1307
|
+
if (state === null && !isFocus) {
|
|
1308
|
+
onClear && onClear(name);
|
|
1309
|
+
}
|
|
1310
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1311
|
+
}, [state]);
|
|
1312
|
+
// Simulate onBlur event.
|
|
1313
|
+
React.useEffect(function () {
|
|
1314
|
+
if (!isFocus) {
|
|
1315
|
+
onBlur && onBlur();
|
|
1316
|
+
}
|
|
1317
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1318
|
+
}, [isFocus]);
|
|
1319
|
+
// listen to value changes.
|
|
1320
|
+
React.useEffect(function () {
|
|
1321
|
+
setState(value);
|
|
1322
|
+
}, [value]);
|
|
1323
|
+
return (jsxRuntime.jsxs("div", { className: styles.container, children: [jsxRuntime.jsxs("div", { className: styles.head, children: [label && (jsxRuntime.jsx("label", { htmlFor: name, className: styles.label, children: label })), !required && !isRequired && typeof label === 'string' && (jsxRuntime.jsx("span", { className: styles.hint, children: "Optional" })), required && required({ isRequired: isRequired })] }), jsxRuntime.jsxs("div", { className: styles.container, children: [jsxRuntime.jsx("div", { "data-cy": selectDataCy, children: jsxRuntime.jsx(Select, { primaryColor: "primary",
|
|
1324
|
+
//
|
|
1325
|
+
placeholder: placeholder === null || placeholder === void 0 ? void 0 : placeholder.select, noOptionsMessage: (jsxRuntime.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,
|
|
1326
|
+
//
|
|
1327
|
+
loading: isLoading, isDisabled: isDisabled, isClearable: isClearable, isMultiple: isMultiple, isSearchable: isSearchable,
|
|
1328
|
+
//
|
|
1329
|
+
options: options,
|
|
1330
|
+
//
|
|
1331
|
+
value: state, onChange: handleChange, onSearchInputChange: onSearchInputChange,
|
|
1332
|
+
//
|
|
1333
|
+
classNames: {
|
|
1334
|
+
menuButton: function () {
|
|
1335
|
+
return toClassName(styles.input, state === null && '[&>*]:!text-gray-300 ', state === null &&
|
|
1336
|
+
!isValid &&
|
|
1337
|
+
isTouched &&
|
|
1338
|
+
'[&>*]:!text-red-300');
|
|
1339
|
+
},
|
|
1340
|
+
menu: styles.menu,
|
|
1341
|
+
tagItem: function () { return styles.tagItem; },
|
|
1342
|
+
tagItemText: styles.tagItemText,
|
|
1343
|
+
tagItemIconContainer: styles.tagItemIconContainer,
|
|
1344
|
+
tagItemIcon: styles.tagItemIcon,
|
|
1345
|
+
list: styles.list,
|
|
1346
|
+
listItem: function () { return styles.listItem; },
|
|
1347
|
+
listDisabledItem: styles.listDisabledItem,
|
|
1348
|
+
listGroupLabel: styles.listGroupLabel,
|
|
1349
|
+
searchContainer: styles.searchContainer,
|
|
1350
|
+
searchBox: styles.searchBox,
|
|
1351
|
+
searchIcon: styles.searchIcon,
|
|
1352
|
+
closeIcon: styles.closeIcon,
|
|
1353
|
+
} }) }), !isSolo && (jsxRuntime.jsxs("div", { className: styles.foot, children: [description && !(error && isTouched) && (jsxRuntime.jsx("p", { className: styles.description, children: description })), error && isTouched && (jsxRuntime.jsx("p", { className: styles.error, "data-cy": errorDataCy, children: JSON.stringify(error).replaceAll('"', '') }))] }))] })] }));
|
|
1354
|
+
};
|
|
1355
|
+
|
|
1190
1356
|
var PanelPaginationNavigation = function (props) {
|
|
1191
|
-
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;
|
|
1192
|
-
var
|
|
1357
|
+
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 ? lodash.noop : _c, children = props.children, onChange = props.onChange;
|
|
1358
|
+
var _d = React.useState(1), current = _d[0], setCurrent = _d[1];
|
|
1359
|
+
var _e = React.useState({
|
|
1360
|
+
value: "".concat(defaultPageSize),
|
|
1361
|
+
label: "".concat(defaultPageSize),
|
|
1362
|
+
}), pageSize = _e[0], setPageSize = _e[1];
|
|
1193
1363
|
React.useEffect(function () {
|
|
1194
1364
|
if (defaultValue) {
|
|
1195
1365
|
setCurrent(defaultValue);
|
|
1196
1366
|
}
|
|
1197
1367
|
}, [defaultValue]);
|
|
1368
|
+
var hasCustomizablePageSize = React.useMemo(function () { return !!pageSizeOptions; }, [pageSizeOptions]);
|
|
1369
|
+
var pageSizeMenuOptions = React.useMemo(function () {
|
|
1370
|
+
var options = lodash.map(pageSizeOptions, function (option) { return ({
|
|
1371
|
+
value: "".concat(option),
|
|
1372
|
+
label: "".concat(option),
|
|
1373
|
+
}); });
|
|
1374
|
+
!pageSize && setPageSize(options[0]);
|
|
1375
|
+
return options;
|
|
1376
|
+
}, [pageSize, pageSizeOptions]);
|
|
1198
1377
|
var handleGenerateStyle = function () {
|
|
1199
|
-
var result = deepCopyObject(styles$
|
|
1200
|
-
var keys = calculateNestedKeys(styles$
|
|
1378
|
+
var result = deepCopyObject(styles$g.base);
|
|
1379
|
+
var keys = calculateNestedKeys(styles$g.base);
|
|
1201
1380
|
keys.forEach(function (key) {
|
|
1202
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
1381
|
+
lodash.set(result, key, toClassName(lodash.get(styles$g.base, key), lodash.get(stylesOverrides, key)));
|
|
1203
1382
|
});
|
|
1204
1383
|
return result;
|
|
1205
1384
|
};
|
|
@@ -1236,10 +1415,18 @@ var PanelPaginationNavigation = function (props) {
|
|
|
1236
1415
|
component = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("button", { className: toClassName(styles.button.default, current === min && styles.button.active), onClick: function () { return handleChangeCurrent(min); }, children: min }), max >= min + 1 && (jsxRuntime.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 && (jsxRuntime.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 && (jsxRuntime.jsx("button", { className: toClassName(styles.button.default, current === min + 3 && styles.button.active), onClick: function () { return handleChangeCurrent(min + 3); }, children: min + 3 }))] }));
|
|
1237
1416
|
break;
|
|
1238
1417
|
}
|
|
1239
|
-
return (jsxRuntime.jsxs("div", { className: styles.container, children: [jsxRuntime.jsxs("div", { className: "flex flex-1 justify-between sm:hidden", children: [jsxRuntime.jsx("button", { className: toClassName(styles.mobile.button, current === min && styles.button.disabled), disabled: current === min, onClick: function () { return handleChangeCurrent(current - 1); }, children: "Previous" }),
|
|
1418
|
+
return (jsxRuntime.jsxs("div", { className: styles.container, children: [jsxRuntime.jsxs("div", { className: "flex flex-1 justify-between sm:hidden", children: [jsxRuntime.jsx("button", { className: toClassName(styles.mobile.button, current === min && styles.button.disabled), disabled: current === min, onClick: function () { return handleChangeCurrent(current - 1); }, children: "Previous" }), hasCustomizablePageSize && (jsxRuntime.jsx(SelectMenuForm, { name: "pageSize", isClearable: false, isSearchable: false, isMultiple: false, isSolo: true, options: pageSizeMenuOptions, value: pageSize, styles: { list: styles.pageSizeList }, onClear: lodash.noop, onChange: function (value) {
|
|
1419
|
+
if (onChangePageSize) {
|
|
1420
|
+
onChangePageSize(lodash.toSafeInteger(value === null || value === void 0 ? void 0 : value.value));
|
|
1421
|
+
}
|
|
1422
|
+
} })), jsxRuntime.jsx("button", { className: toClassName(styles.mobile.button, current === max && styles.button.disabled), disabled: current === max, onClick: function () { return handleChangeCurrent(current + 1); }, children: "Next" })] }), jsxRuntime.jsxs("div", { className: styles.desktop.container, children: [jsxRuntime.jsx("div", { children: jsxRuntime.jsx("div", { className: "text-sm text-gray-700", children: children && children({ min: min, max: max, current: current }) }) }), hasCustomizablePageSize && (jsxRuntime.jsx(SelectMenuForm, { name: "pageSize", isClearable: false, isSearchable: false, isMultiple: false, isSolo: true, options: pageSizeMenuOptions, value: pageSize, styles: { list: styles.pageSizeList }, onClear: lodash.noop, onChange: function (value) {
|
|
1423
|
+
if (onChangePageSize) {
|
|
1424
|
+
onChangePageSize(lodash.toSafeInteger(value === null || value === void 0 ? void 0 : value.value));
|
|
1425
|
+
}
|
|
1426
|
+
} })), jsxRuntime.jsx("div", { children: jsxRuntime.jsxs("nav", { className: styles.desktop.navigation, "aria-label": "Pagination", children: [jsxRuntime.jsxs("button", { className: toClassName(styles.desktop.outerLeftButton, current === min && styles.button.disabled), disabled: current === min, onClick: function () { return handleChangeCurrent(1); }, children: [jsxRuntime.jsx("span", { className: styles.label, children: "First" }), jsxRuntime.jsx(solid.ChevronDoubleLeftIcon, { className: styles.icon, "aria-hidden": "true" })] }), jsxRuntime.jsxs("button", { className: toClassName(styles.desktop.innerButton, current === min && styles.button.disabled), disabled: current === min, onClick: function () { return handleChangeCurrent(current - 1); }, children: [jsxRuntime.jsx("span", { className: styles.label, children: "Previous" }), jsxRuntime.jsx(solid.ChevronLeftIcon, { className: styles.icon, "aria-hidden": "true" })] }), component, jsxRuntime.jsxs("button", { className: toClassName(styles.desktop.innerButton, current === max && styles.button.disabled), disabled: current === max, onClick: function () { return handleChangeCurrent(current + 1); }, children: [jsxRuntime.jsx("span", { className: styles.label, children: "Next" }), jsxRuntime.jsx(solid.ChevronRightIcon, { className: styles.icon, "aria-hidden": "true" })] }), jsxRuntime.jsxs("button", { className: toClassName(styles.desktop.outerRightButton, current === max && styles.button.disabled), disabled: current === max, onClick: function () { return handleChangeCurrent(max); }, children: [jsxRuntime.jsx("span", { className: styles.label, children: "Last" }), jsxRuntime.jsx(solid.ChevronDoubleRightIcon, { className: styles.icon, "aria-hidden": "true" })] })] }) })] })] }));
|
|
1240
1427
|
};
|
|
1241
1428
|
|
|
1242
|
-
var base$
|
|
1429
|
+
var base$d = {
|
|
1243
1430
|
container: 'flex items-center justify-between border-t border-gray-200 bg-white py-3',
|
|
1244
1431
|
mobile: {
|
|
1245
1432
|
container: '',
|
|
@@ -1260,9 +1447,10 @@ var base$e = {
|
|
|
1260
1447
|
divider: 'relative inline-flex items-center border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-500',
|
|
1261
1448
|
label: 'sr-only',
|
|
1262
1449
|
icon: 'w-5 h-5',
|
|
1450
|
+
pageSizeList: '!overflow-hidden',
|
|
1263
1451
|
};
|
|
1264
|
-
var styles$
|
|
1265
|
-
base: base$
|
|
1452
|
+
var styles$g = {
|
|
1453
|
+
base: base$d,
|
|
1266
1454
|
};
|
|
1267
1455
|
|
|
1268
1456
|
var TableList = function (props) {
|
|
@@ -1270,10 +1458,10 @@ var TableList = function (props) {
|
|
|
1270
1458
|
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;
|
|
1271
1459
|
var _m = useExcel(), generate = _m.generate, write = _m.write;
|
|
1272
1460
|
var handleGenerateStyle = function () {
|
|
1273
|
-
var result = deepCopyObject(styles$
|
|
1274
|
-
var keys = calculateNestedKeys(styles$
|
|
1461
|
+
var result = deepCopyObject(styles$f.base);
|
|
1462
|
+
var keys = calculateNestedKeys(styles$f.base);
|
|
1275
1463
|
keys.forEach(function (key) {
|
|
1276
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
1464
|
+
lodash.set(result, key, toClassName(lodash.get(styles$f.base, key), type && lodash.get(styles$f[type], key), hasStickyHeader && lodash.get(styles$f.sticky, key), hasVerticalSeparators && lodash.get(styles$f.separated, key), areControlsVisible && lodash.get(styles$f.controlled, key), lodash.get(stylesOverrides, key)));
|
|
1277
1465
|
});
|
|
1278
1466
|
return result;
|
|
1279
1467
|
};
|
|
@@ -1398,7 +1586,7 @@ var TableList = function (props) {
|
|
|
1398
1586
|
: { container: 'mt-4' }, onChange: onPaginate, children: children })] }) }));
|
|
1399
1587
|
};
|
|
1400
1588
|
|
|
1401
|
-
var base$
|
|
1589
|
+
var base$c = {
|
|
1402
1590
|
container: 'px-4 sm:px-6 lg:px-8',
|
|
1403
1591
|
head: {
|
|
1404
1592
|
container: 'sm:flex sm:items-center',
|
|
@@ -1452,7 +1640,7 @@ var base$d = {
|
|
|
1452
1640
|
},
|
|
1453
1641
|
},
|
|
1454
1642
|
};
|
|
1455
|
-
var normal$
|
|
1643
|
+
var normal$4 = {
|
|
1456
1644
|
body: {
|
|
1457
1645
|
content: 'inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8',
|
|
1458
1646
|
styleWrapper: 'relative',
|
|
@@ -1510,9 +1698,9 @@ var controlled = {
|
|
|
1510
1698
|
container: '!flex',
|
|
1511
1699
|
},
|
|
1512
1700
|
};
|
|
1513
|
-
var styles$
|
|
1514
|
-
base: base$
|
|
1515
|
-
normal: normal$
|
|
1701
|
+
var styles$f = {
|
|
1702
|
+
base: base$c,
|
|
1703
|
+
normal: normal$4,
|
|
1516
1704
|
panel: panel$1,
|
|
1517
1705
|
full: full,
|
|
1518
1706
|
sticky: sticky,
|
|
@@ -1564,10 +1752,10 @@ var TableList2 = function (props) {
|
|
|
1564
1752
|
var _h = React.useState({}), columnVisibility = _h[0], setColumnVisibility = _h[1];
|
|
1565
1753
|
var _j = React.useState([]), columnOrder = _j[0], setColumnOrder = _j[1];
|
|
1566
1754
|
var handleGenerateStyle = function () {
|
|
1567
|
-
var result = deepCopyObject(styles$
|
|
1568
|
-
var keys = calculateNestedKeys(styles$
|
|
1755
|
+
var result = deepCopyObject(styles$e.base);
|
|
1756
|
+
var keys = calculateNestedKeys(styles$e.base);
|
|
1569
1757
|
keys.forEach(function (key) {
|
|
1570
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
1758
|
+
lodash.set(result, key, toClassName(lodash.get(styles$e.base, key),
|
|
1571
1759
|
// type && get(defaultStyles[type], key),
|
|
1572
1760
|
// hasStickyHeader && get(defaultStyles.sticky, key),
|
|
1573
1761
|
// hasVerticalSeparators && get(defaultStyles.separated, key),
|
|
@@ -1654,7 +1842,7 @@ var TableList2 = function (props) {
|
|
|
1654
1842
|
setTableState(id, state);
|
|
1655
1843
|
}
|
|
1656
1844
|
}, [id, state]);
|
|
1657
|
-
return (jsxRuntime.jsxs("div", { className: styles.container, children: [jsxRuntime.jsx("div", { className: styles.head, children: head && head(state) }), jsxRuntime.jsx("div", { className: styles.body.content, children: jsxRuntime.jsx("div", { className: styles.body.wrapper, children: jsxRuntime.jsx("div", { className: styles.body.styleWrapper, children: jsxRuntime.jsxs("div", { className: styles.body.tableWrapper, children: [jsxRuntime.jsxs("table", { className: styles.body.table.container, children: [jsxRuntime.jsx("thead", { className: styles.body.table.head.container, children: table === null || table === void 0 ? void 0 : table.getHeaderGroups().map(function (headerGroup) { return (jsxRuntime.jsx("tr", { children: headerGroup.headers.map(function (header) {
|
|
1845
|
+
return (jsxRuntime.jsxs("div", { className: styles.container, "data-cy": "table-list-".concat(id), children: [jsxRuntime.jsx("div", { className: styles.head, children: head && head(state) }), jsxRuntime.jsx("div", { className: styles.body.content, children: jsxRuntime.jsx("div", { className: styles.body.wrapper, children: jsxRuntime.jsx("div", { className: styles.body.styleWrapper, children: jsxRuntime.jsxs("div", { className: styles.body.tableWrapper, children: [jsxRuntime.jsxs("table", { className: styles.body.table.container, children: [jsxRuntime.jsx("thead", { className: styles.body.table.head.container, children: table === null || table === void 0 ? void 0 : table.getHeaderGroups().map(function (headerGroup) { return (jsxRuntime.jsx("tr", { children: headerGroup.headers.map(function (header) {
|
|
1658
1846
|
// Default sort icon to show a user that the column is sortable
|
|
1659
1847
|
var SortIconElement = solid.ChevronUpDownIcon;
|
|
1660
1848
|
if (header.column.getIsSorted()) {
|
|
@@ -1691,7 +1879,7 @@ var TableList2 = function (props) {
|
|
|
1691
1879
|
}) }))] }), lodash.isEmpty(table === null || table === void 0 ? void 0 : table.getRowModel().rows) && !isLoading && (jsxRuntime.jsx(jsxRuntime.Fragment, { 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) : (jsxRuntime.jsx("div", { className: "w-full flex justify-center my-2", children: "There is no data to show..." })) })), isLoading && (jsxRuntime.jsx("div", { className: "flex flex-col gap-y-2 w-full pt-5", children: new Array(8).fill(undefined).map(function (index) { return (jsxRuntime.jsxs("div", { className: "flex gap-2", children: [jsxRuntime.jsx("div", { className: "w-20 h-12 rounded-md bg-gray-100 animate-pulse" }), jsxRuntime.jsx("div", { className: "w-full h-12 rounded-md bg-gray-100 animate-pulse" })] }, index)); }) }))] }) }) }) }), jsxRuntime.jsx("div", { className: styles.foot, children: foot && foot(state) })] }));
|
|
1692
1880
|
};
|
|
1693
1881
|
|
|
1694
|
-
var base$
|
|
1882
|
+
var base$b = {
|
|
1695
1883
|
container: '',
|
|
1696
1884
|
head: '',
|
|
1697
1885
|
body: {
|
|
@@ -1730,8 +1918,8 @@ var base$c = {
|
|
|
1730
1918
|
},
|
|
1731
1919
|
foot: '',
|
|
1732
1920
|
};
|
|
1733
|
-
var styles$
|
|
1734
|
-
base: base$
|
|
1921
|
+
var styles$e = {
|
|
1922
|
+
base: base$b,
|
|
1735
1923
|
};
|
|
1736
1924
|
|
|
1737
1925
|
var createColumnHelper = function () {
|
|
@@ -1741,10 +1929,10 @@ var createColumnHelper = function () {
|
|
|
1741
1929
|
var BreadcrumbsNavigation = function (props) {
|
|
1742
1930
|
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;
|
|
1743
1931
|
var handleGenerateStyle = function () {
|
|
1744
|
-
var result = deepCopyObject(styles$
|
|
1745
|
-
var keys = calculateNestedKeys(styles$
|
|
1932
|
+
var result = deepCopyObject(styles$d.base);
|
|
1933
|
+
var keys = calculateNestedKeys(styles$d.base);
|
|
1746
1934
|
keys.forEach(function (key) {
|
|
1747
|
-
set(result, key, toClassName(get(styles$
|
|
1935
|
+
set(result, key, toClassName(get(styles$d.base, key), type && get(styles$d[type], key), get(stylesOverrides, key)));
|
|
1748
1936
|
});
|
|
1749
1937
|
return result;
|
|
1750
1938
|
};
|
|
@@ -1780,7 +1968,7 @@ var BreadcrumbsNavigation = function (props) {
|
|
|
1780
1968
|
return (jsxRuntime.jsx("nav", { className: styles.container, "aria-label": "Breadcrumb", children: jsxRuntime.jsxs("ol", { className: styles.list, children: [jsxRuntime.jsx(HomeLink, {}), pages === null || pages === void 0 ? void 0 : pages.map(function (page) { return jsxRuntime.jsx(PageLink, { page: page }, page.name); })] }) }));
|
|
1781
1969
|
};
|
|
1782
1970
|
|
|
1783
|
-
var base$
|
|
1971
|
+
var base$a = {
|
|
1784
1972
|
container: 'flex',
|
|
1785
1973
|
list: 'flex',
|
|
1786
1974
|
separator: '',
|
|
@@ -1865,8 +2053,8 @@ var bar = {
|
|
|
1865
2053
|
link: '',
|
|
1866
2054
|
},
|
|
1867
2055
|
};
|
|
1868
|
-
var styles$
|
|
1869
|
-
base: base$
|
|
2056
|
+
var styles$d = {
|
|
2057
|
+
base: base$a,
|
|
1870
2058
|
slashes: slashes,
|
|
1871
2059
|
chevrons: chevrons,
|
|
1872
2060
|
panel: panel,
|
|
@@ -1877,10 +2065,10 @@ var PagePaginationNavigation = function (props) {
|
|
|
1877
2065
|
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;
|
|
1878
2066
|
var _c = React.useState(2), current = _c[0], setCurrent = _c[1];
|
|
1879
2067
|
var handleGenerateStyle = function () {
|
|
1880
|
-
var result = deepCopyObject(styles$
|
|
1881
|
-
var keys = calculateNestedKeys(styles$
|
|
2068
|
+
var result = deepCopyObject(styles$c.base);
|
|
2069
|
+
var keys = calculateNestedKeys(styles$c.base);
|
|
1882
2070
|
keys.forEach(function (key) {
|
|
1883
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
2071
|
+
lodash.set(result, key, toClassName(lodash.get(styles$c.base, key), lodash.get(stylesOverrides, key)));
|
|
1884
2072
|
});
|
|
1885
2073
|
return result;
|
|
1886
2074
|
};
|
|
@@ -1921,7 +2109,7 @@ var PagePaginationNavigation = function (props) {
|
|
|
1921
2109
|
return (jsxRuntime.jsxs("nav", { className: styles.container, children: [jsxRuntime.jsx("div", { className: styles.left.container, children: jsxRuntime.jsxs("button", { className: toClassName(styles.left.button, current === min && styles.button.disabled), disabled: current === min, onClick: function () { return setCurrent(current - 1); }, children: [jsxRuntime.jsx(solid.ArrowLongLeftIcon, { className: styles.left.icon }), "Previous"] }) }), jsxRuntime.jsx("div", { className: styles.center.container, children: component }), jsxRuntime.jsx("div", { className: styles.right.container, children: jsxRuntime.jsxs("button", { className: toClassName(styles.right.button, current === max && styles.button.disabled), disabled: current === max, onClick: function () { return setCurrent(current + 1); }, children: ["Next", jsxRuntime.jsx(solid.ArrowLongRightIcon, { className: styles.right.icon })] }) })] }));
|
|
1922
2110
|
};
|
|
1923
2111
|
|
|
1924
|
-
var base$
|
|
2112
|
+
var base$9 = {
|
|
1925
2113
|
container: 'flex items-center justify-between border-t border-gray-200 px-4 sm:px-0',
|
|
1926
2114
|
left: {
|
|
1927
2115
|
container: '-mt-px flex w-0 flex-1',
|
|
@@ -1943,18 +2131,18 @@ var base$a = {
|
|
|
1943
2131
|
},
|
|
1944
2132
|
divider: 'inline-flex items-center border-t-2 border-transparent px-4 pt-4 text-sm font-medium text-gray-500',
|
|
1945
2133
|
};
|
|
1946
|
-
var styles$
|
|
1947
|
-
base: base$
|
|
2134
|
+
var styles$c = {
|
|
2135
|
+
base: base$9,
|
|
1948
2136
|
};
|
|
1949
2137
|
|
|
1950
2138
|
var Container$1 = function (props) {
|
|
1951
2139
|
var children = props.children, stylesOverrides = props.styles;
|
|
1952
2140
|
var _a = React.useState(''), active = _a[0], setActive = _a[1];
|
|
1953
2141
|
var handleGenerateStyle = function () {
|
|
1954
|
-
var result = deepCopyObject(styles$
|
|
1955
|
-
var keys = calculateNestedKeys(styles$
|
|
2142
|
+
var result = deepCopyObject(styles$b.base);
|
|
2143
|
+
var keys = calculateNestedKeys(styles$b.base);
|
|
1956
2144
|
keys.forEach(function (key) {
|
|
1957
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
2145
|
+
lodash.set(result, key, toClassName(lodash.get(styles$b.base, key), lodash.get(stylesOverrides, key)));
|
|
1958
2146
|
});
|
|
1959
2147
|
return result;
|
|
1960
2148
|
};
|
|
@@ -1964,10 +2152,10 @@ var Container$1 = function (props) {
|
|
|
1964
2152
|
var List$1 = function (props) {
|
|
1965
2153
|
var name = props.name, children = props.children, active = props.active, setActive = props.setActive, stylesOverrides = props.styles;
|
|
1966
2154
|
var handleGenerateStyle = function () {
|
|
1967
|
-
var result = deepCopyObject(styles$
|
|
1968
|
-
var keys = calculateNestedKeys(styles$
|
|
2155
|
+
var result = deepCopyObject(styles$b.base);
|
|
2156
|
+
var keys = calculateNestedKeys(styles$b.base);
|
|
1969
2157
|
keys.forEach(function (key) {
|
|
1970
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
2158
|
+
lodash.set(result, key, toClassName(lodash.get(styles$b.base, key), lodash.get(stylesOverrides, key)));
|
|
1971
2159
|
});
|
|
1972
2160
|
return result;
|
|
1973
2161
|
};
|
|
@@ -2013,10 +2201,10 @@ var List$1 = function (props) {
|
|
|
2013
2201
|
var Item$1 = function (props) {
|
|
2014
2202
|
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;
|
|
2015
2203
|
var handleGenerateStyle = function () {
|
|
2016
|
-
var result = deepCopyObject(styles$
|
|
2017
|
-
var keys = calculateNestedKeys(styles$
|
|
2204
|
+
var result = deepCopyObject(styles$b.base);
|
|
2205
|
+
var keys = calculateNestedKeys(styles$b.base);
|
|
2018
2206
|
keys.forEach(function (key) {
|
|
2019
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
2207
|
+
lodash.set(result, key, toClassName(lodash.get(styles$b.base, key), type && lodash.get(styles$b[type], key), lodash.get(stylesOverrides, key)));
|
|
2020
2208
|
});
|
|
2021
2209
|
return result;
|
|
2022
2210
|
};
|
|
@@ -2037,7 +2225,7 @@ var TabNavigation = {
|
|
|
2037
2225
|
View: View$1,
|
|
2038
2226
|
};
|
|
2039
2227
|
|
|
2040
|
-
var base$
|
|
2228
|
+
var base$8 = {
|
|
2041
2229
|
container: '',
|
|
2042
2230
|
list: {
|
|
2043
2231
|
container: '',
|
|
@@ -2074,8 +2262,8 @@ var buttons = {
|
|
|
2074
2262
|
inactive: 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300',
|
|
2075
2263
|
},
|
|
2076
2264
|
};
|
|
2077
|
-
var styles$
|
|
2078
|
-
base: base$
|
|
2265
|
+
var styles$b = {
|
|
2266
|
+
base: base$8,
|
|
2079
2267
|
underline: underline,
|
|
2080
2268
|
pills: pills,
|
|
2081
2269
|
buttons: buttons,
|
|
@@ -2102,11 +2290,11 @@ var List = function (props) {
|
|
|
2102
2290
|
setActive && setActive(tab === null || tab === void 0 ? void 0 : tab.props.accessor);
|
|
2103
2291
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2104
2292
|
}, []);
|
|
2105
|
-
return (jsxRuntime.jsx("nav", { className: toClassName(styles$
|
|
2293
|
+
return (jsxRuntime.jsx("nav", { className: toClassName(styles$a.list, stylesOverrides === null || stylesOverrides === void 0 ? void 0 : stylesOverrides.list), children: children }));
|
|
2106
2294
|
};
|
|
2107
2295
|
var Item = function (props) {
|
|
2108
2296
|
var children = props.children, href = props.href, isCurrent = props.isCurrent, _a = props.linkComponent, LinkComponent = _a === void 0 ? 'a' : _a, onClick = props.onClick;
|
|
2109
|
-
return (jsxRuntime.jsx(LinkComponent, { href: href, className: toClassName(styles$
|
|
2297
|
+
return (jsxRuntime.jsx(LinkComponent, { href: href, className: toClassName(styles$a.item[isCurrent ? 'active' : 'notActive'], styles$a.item.base), onClick: onClick, children: children }));
|
|
2110
2298
|
};
|
|
2111
2299
|
var View = function (props) {
|
|
2112
2300
|
var children = props.children;
|
|
@@ -2119,7 +2307,7 @@ var VerticalNavigation = {
|
|
|
2119
2307
|
View: View,
|
|
2120
2308
|
};
|
|
2121
2309
|
|
|
2122
|
-
var styles$
|
|
2310
|
+
var styles$a = {
|
|
2123
2311
|
container: '',
|
|
2124
2312
|
list: 'space-y-1',
|
|
2125
2313
|
item: {
|
|
@@ -2130,17 +2318,17 @@ var styles$b = {
|
|
|
2130
2318
|
};
|
|
2131
2319
|
|
|
2132
2320
|
var ModalOverlay = function (props) {
|
|
2133
|
-
var children = props.children, trigger = props.trigger, _a = props.size, size = _a === void 0 ? 'md' : _a, stylesOverrides = props.styles, onOpen = props.onOpen, onClose = props.onClose;
|
|
2321
|
+
var children = props.children, trigger = props.trigger, _a = props.size, size = _a === void 0 ? 'md' : _a, stylesOverrides = props.styles, dataCy = props.dataCy, onOpen = props.onOpen, onClose = props.onClose;
|
|
2134
2322
|
var _b = React.useState(trigger ? false : true), isOpen = _b[0], setIsOpen = _b[1];
|
|
2135
2323
|
var options = React.useMemo(function () { return ({
|
|
2136
2324
|
handleOpen: function () { return setIsOpen(true); },
|
|
2137
2325
|
handleClose: function () { return setIsOpen(false); },
|
|
2138
2326
|
}); }, []);
|
|
2139
2327
|
var handleGenerateStyle = function () {
|
|
2140
|
-
var result = deepCopyObject(styles$
|
|
2141
|
-
var keys = calculateNestedKeys(styles$
|
|
2328
|
+
var result = deepCopyObject(styles$9.base);
|
|
2329
|
+
var keys = calculateNestedKeys(styles$9.base);
|
|
2142
2330
|
keys.forEach(function (key) {
|
|
2143
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
2331
|
+
lodash.set(result, key, toClassName(lodash.get(styles$9.base, key), size && lodash.get(styles$9[size], key), lodash.get(stylesOverrides, key)));
|
|
2144
2332
|
});
|
|
2145
2333
|
return result;
|
|
2146
2334
|
};
|
|
@@ -2155,10 +2343,10 @@ var ModalOverlay = function (props) {
|
|
|
2155
2343
|
onClose && onClose();
|
|
2156
2344
|
}
|
|
2157
2345
|
}, [isOpen, onClose]);
|
|
2158
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(react.Transition.Root, { show: isOpen, as: React.Fragment, children: jsxRuntime.jsxs(react.Dialog, { as: "div", className: styles.container, onClose: setIsOpen, children: [jsxRuntime.jsx(react.Transition.Child, { as: React.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: jsxRuntime.jsx("div", { className: styles.background.container }) }), jsxRuntime.jsx("div", { className: styles.layout.container, children: jsxRuntime.jsx("div", { className: styles.layout.content, children: jsxRuntime.jsx(react.Transition.Child, { as: React.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: jsxRuntime.jsx(react.Dialog.Panel, { className: styles.panel.container, children: children(options) }) }) }) })] }) }), trigger && trigger(options)] }));
|
|
2346
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(react.Transition.Root, { show: isOpen, as: React.Fragment, children: jsxRuntime.jsxs(react.Dialog, { as: "div", className: styles.container, onClose: setIsOpen, children: [jsxRuntime.jsx(react.Transition.Child, { as: React.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: jsxRuntime.jsx("div", { className: styles.background.container }) }), jsxRuntime.jsx("div", { className: styles.layout.container, "data-cy": dataCy, children: jsxRuntime.jsx("div", { className: styles.layout.content, children: jsxRuntime.jsx(react.Transition.Child, { as: React.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: jsxRuntime.jsx(react.Dialog.Panel, { className: styles.panel.container, children: children(options) }) }) }) })] }) }), trigger && trigger(options)] }));
|
|
2159
2347
|
};
|
|
2160
2348
|
|
|
2161
|
-
var base$
|
|
2349
|
+
var base$7 = {
|
|
2162
2350
|
container: 'relative z-20',
|
|
2163
2351
|
background: {
|
|
2164
2352
|
container: 'fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity',
|
|
@@ -2212,8 +2400,8 @@ var xl$2 = {
|
|
|
2212
2400
|
container: 'sm:max-w-4xl',
|
|
2213
2401
|
},
|
|
2214
2402
|
};
|
|
2215
|
-
var styles$
|
|
2216
|
-
base: base$
|
|
2403
|
+
var styles$9 = {
|
|
2404
|
+
base: base$7,
|
|
2217
2405
|
xs: xs$2,
|
|
2218
2406
|
sm: sm$2,
|
|
2219
2407
|
md: md$2,
|
|
@@ -2224,10 +2412,10 @@ var styles$a = {
|
|
|
2224
2412
|
var NotificationOverlayContainer = function (_a) {
|
|
2225
2413
|
var children = _a.children, stylesOverrides = _a.styles;
|
|
2226
2414
|
var handleGenerateStyle = function () {
|
|
2227
|
-
var result = deepCopyObject(styles$
|
|
2228
|
-
var keys = calculateNestedKeys(styles$
|
|
2415
|
+
var result = deepCopyObject(styles$8.base);
|
|
2416
|
+
var keys = calculateNestedKeys(styles$8.base);
|
|
2229
2417
|
keys.forEach(function (key) {
|
|
2230
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
2418
|
+
lodash.set(result, key, toClassName(lodash.get(styles$8.base, key), lodash.get(stylesOverrides, key)));
|
|
2231
2419
|
});
|
|
2232
2420
|
return result;
|
|
2233
2421
|
};
|
|
@@ -2242,10 +2430,10 @@ var NotificationOverlayItem = function (props) {
|
|
|
2242
2430
|
onClose: function () { return setIsOpen(false); },
|
|
2243
2431
|
}); }, []);
|
|
2244
2432
|
var handleGenerateStyle = function () {
|
|
2245
|
-
var result = deepCopyObject(styles$
|
|
2246
|
-
var keys = calculateNestedKeys(styles$
|
|
2433
|
+
var result = deepCopyObject(styles$8.base);
|
|
2434
|
+
var keys = calculateNestedKeys(styles$8.base);
|
|
2247
2435
|
keys.forEach(function (key) {
|
|
2248
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
2436
|
+
lodash.set(result, key, toClassName(lodash.get(styles$8.base, key), size && lodash.get(styles$8[size], key), lodash.get(stylesOverrides, key)));
|
|
2249
2437
|
});
|
|
2250
2438
|
return result;
|
|
2251
2439
|
};
|
|
@@ -2257,7 +2445,7 @@ var NotificationOverlay = {
|
|
|
2257
2445
|
Item: NotificationOverlayItem,
|
|
2258
2446
|
};
|
|
2259
2447
|
|
|
2260
|
-
var base$
|
|
2448
|
+
var base$6 = {
|
|
2261
2449
|
container: {
|
|
2262
2450
|
outer: 'pointer-events-none fixed inset-0 flex items-end px-4 py-6 sm:items-start sm:p-6 z-30',
|
|
2263
2451
|
inner: 'flex w-full flex-col items-center space-y-4 sm:items-end',
|
|
@@ -2317,8 +2505,8 @@ var xl$1 = {
|
|
|
2317
2505
|
},
|
|
2318
2506
|
},
|
|
2319
2507
|
};
|
|
2320
|
-
var styles$
|
|
2321
|
-
base: base$
|
|
2508
|
+
var styles$8 = {
|
|
2509
|
+
base: base$6,
|
|
2322
2510
|
xs: xs$1,
|
|
2323
2511
|
sm: sm$1,
|
|
2324
2512
|
md: md$1,
|
|
@@ -2334,10 +2522,10 @@ var SlideOverOverlay = function (props) {
|
|
|
2334
2522
|
handleClose: function () { return setIsOpen(false); },
|
|
2335
2523
|
}); }, []);
|
|
2336
2524
|
var handleGenerateStyle = function () {
|
|
2337
|
-
var result = deepCopyObject(styles$
|
|
2338
|
-
var keys = calculateNestedKeys(styles$
|
|
2525
|
+
var result = deepCopyObject(styles$7.base);
|
|
2526
|
+
var keys = calculateNestedKeys(styles$7.base);
|
|
2339
2527
|
keys.forEach(function (key) {
|
|
2340
|
-
lodash.set(result, key, toClassName(lodash.get(styles$
|
|
2528
|
+
lodash.set(result, key, toClassName(lodash.get(styles$7.base, key), size && lodash.get(styles$7[size], key), lodash.get(stylesOverrides, key)));
|
|
2341
2529
|
});
|
|
2342
2530
|
return result;
|
|
2343
2531
|
};
|
|
@@ -2345,7 +2533,7 @@ var SlideOverOverlay = function (props) {
|
|
|
2345
2533
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(react.Transition.Root, { show: isOpen, as: React.Fragment, children: jsxRuntime.jsxs(react.Dialog, { as: "div", className: styles.container, onClose: setIsOpen, children: [jsxRuntime.jsx(react.Transition.Child, { as: React.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: jsxRuntime.jsx("div", { className: styles.background.container }) }), jsxRuntime.jsx("div", { className: styles.layout.container, children: jsxRuntime.jsx("div", { className: styles.layout.content, children: jsxRuntime.jsx("div", { className: styles.layout.inner, children: jsxRuntime.jsx(react.Transition.Child, { as: React.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: jsxRuntime.jsx(react.Dialog.Panel, { className: styles.panel.container, children: children(options) }) }) }) }) })] }) }), trigger && trigger(options)] }));
|
|
2346
2534
|
};
|
|
2347
2535
|
|
|
2348
|
-
var base$
|
|
2536
|
+
var base$5 = {
|
|
2349
2537
|
container: 'relative z-20',
|
|
2350
2538
|
background: {
|
|
2351
2539
|
container: 'fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity',
|
|
@@ -2400,8 +2588,8 @@ var xl = {
|
|
|
2400
2588
|
container: 'sm:max-w-4xl',
|
|
2401
2589
|
},
|
|
2402
2590
|
};
|
|
2403
|
-
var styles$
|
|
2404
|
-
base: base$
|
|
2591
|
+
var styles$7 = {
|
|
2592
|
+
base: base$5,
|
|
2405
2593
|
xs: xs,
|
|
2406
2594
|
sm: sm,
|
|
2407
2595
|
md: md,
|
|
@@ -2422,19 +2610,19 @@ var TableColumnOptionsCustom = function (props) {
|
|
|
2422
2610
|
ids.splice(location, 0, column.id);
|
|
2423
2611
|
setColumnOrder(ids);
|
|
2424
2612
|
}, []);
|
|
2425
|
-
return (jsxRuntime.jsxs(react.Popover, { children: [jsxRuntime.jsx(react.Popover.Button, { children: trigger }), jsxRuntime.jsx(react.Popover.Panel, { className: styles$
|
|
2613
|
+
return (jsxRuntime.jsxs(react.Popover, { children: [jsxRuntime.jsx(react.Popover.Button, { children: trigger }), jsxRuntime.jsx(react.Popover.Panel, { className: styles$6.controls.content, children: table
|
|
2426
2614
|
.getAllLeafColumns()
|
|
2427
2615
|
.map(function (column, index) {
|
|
2428
2616
|
var isAccessorColumn = !!(column === null || column === void 0 ? void 0 : column.accessorFn);
|
|
2429
|
-
return (jsxRuntime.jsxs("div", { className: toClassName(styles$
|
|
2617
|
+
return (jsxRuntime.jsxs("div", { className: toClassName(styles$6.controls.dropdown.container, !isAccessorColumn && 'hidden'), children: [jsxRuntime.jsx("input", { className: styles$6.controls.dropdown.input, type: "checkbox", checked: column.getIsVisible(), onChange: column.getToggleVisibilityHandler() }), jsxRuntime.jsx("label", { className: styles$6.controls.dropdown.label, children: column.columnDef.header }), jsxRuntime.jsxs("div", { className: styles$6.controls.dropdown.actions, children: [jsxRuntime.jsx(outline$2.ChevronDownIcon, { className: styles$6.controls.dropdown.upIcon, onClick: function () {
|
|
2430
2618
|
return handleUpdateColumnOrder(table, column, index - 1, setColumnOrder);
|
|
2431
|
-
} }), jsxRuntime.jsx(outline$2.ChevronDownIcon, { className: styles$
|
|
2619
|
+
} }), jsxRuntime.jsx(outline$2.ChevronDownIcon, { className: styles$6.controls.dropdown.downIcon, onClick: function () {
|
|
2432
2620
|
return handleUpdateColumnOrder(table, column, index + 1, setColumnOrder);
|
|
2433
2621
|
} })] })] }, column.id));
|
|
2434
2622
|
}) })] }));
|
|
2435
2623
|
};
|
|
2436
2624
|
|
|
2437
|
-
var styles$
|
|
2625
|
+
var styles$6 = {
|
|
2438
2626
|
container: '',
|
|
2439
2627
|
controls: {
|
|
2440
2628
|
container: 'flex-row justify-between z-10 relative mb-4 gap-2 hidden',
|
|
@@ -2464,168 +2652,6 @@ var TableExcelExportCustom = function (props) {
|
|
|
2464
2652
|
return jsxRuntime.jsx("div", { children: children({ handleExport: handleExport }) });
|
|
2465
2653
|
};
|
|
2466
2654
|
|
|
2467
|
-
var SelectMenuForm = function (props) {
|
|
2468
|
-
var _a;
|
|
2469
|
-
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;
|
|
2470
|
-
var _j = React.useState(true), isFocus = _j[0], setIsFocus = _j[1];
|
|
2471
|
-
var _k = React.useState(value !== null && value !== void 0 ? value : null), state = _k[0], setState = _k[1];
|
|
2472
|
-
var isValid = error === undefined;
|
|
2473
|
-
var handleGenerateStyle = function () {
|
|
2474
|
-
var result = deepCopyObject(styles$6.base);
|
|
2475
|
-
var keys = calculateNestedKeys(styles$6.base);
|
|
2476
|
-
keys.forEach(function (key) {
|
|
2477
|
-
lodash.set(result, key, toClassName(lodash.get(styles$6.base, key), lodash.get(styles$6['normal'], key), isTouched === true && !isValid && lodash.get(styles$6.invalid, key), isDisabled && lodash.get(styles$6.disabled, key), lodash.get(stylesOverrides, key)));
|
|
2478
|
-
});
|
|
2479
|
-
return result;
|
|
2480
|
-
};
|
|
2481
|
-
var handleChange = function (selectValue) {
|
|
2482
|
-
setState(selectValue);
|
|
2483
|
-
onChange && onChange(selectValue);
|
|
2484
|
-
setIsFocus(false);
|
|
2485
|
-
};
|
|
2486
|
-
var styles = handleGenerateStyle();
|
|
2487
|
-
// Simulate onClear event.
|
|
2488
|
-
React.useEffect(function () {
|
|
2489
|
-
if (state === null && !isFocus) {
|
|
2490
|
-
onClear && onClear(name);
|
|
2491
|
-
}
|
|
2492
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2493
|
-
}, [state]);
|
|
2494
|
-
// Simulate onBlur event.
|
|
2495
|
-
React.useEffect(function () {
|
|
2496
|
-
if (!isFocus) {
|
|
2497
|
-
onBlur && onBlur();
|
|
2498
|
-
}
|
|
2499
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2500
|
-
}, [isFocus]);
|
|
2501
|
-
// listen to value changes.
|
|
2502
|
-
React.useEffect(function () {
|
|
2503
|
-
setState(value);
|
|
2504
|
-
}, [value]);
|
|
2505
|
-
return (jsxRuntime.jsxs("div", { className: styles.container, children: [jsxRuntime.jsxs("div", { className: styles.head, children: [label && (jsxRuntime.jsx("label", { htmlFor: name, className: styles.label, children: label })), !required && !isRequired && typeof label === 'string' && (jsxRuntime.jsx("span", { className: styles.hint, children: "Optional" })), required && required({ isRequired: isRequired })] }), jsxRuntime.jsxs("div", { className: styles.container, children: [jsxRuntime.jsx(Select, { primaryColor: "primary",
|
|
2506
|
-
//
|
|
2507
|
-
placeholder: placeholder === null || placeholder === void 0 ? void 0 : placeholder.select, noOptionsMessage: (jsxRuntime.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,
|
|
2508
|
-
//
|
|
2509
|
-
loading: isLoading, isDisabled: isDisabled, isClearable: isClearable, isMultiple: isMultiple, isSearchable: isSearchable,
|
|
2510
|
-
//
|
|
2511
|
-
options: options,
|
|
2512
|
-
//
|
|
2513
|
-
value: state, onChange: handleChange, onSearchInputChange: onSearchInputChange,
|
|
2514
|
-
//
|
|
2515
|
-
classNames: {
|
|
2516
|
-
menuButton: function () {
|
|
2517
|
-
return toClassName(styles.input, state === null && '[&>*]:!text-gray-300 ', state === null &&
|
|
2518
|
-
!isValid &&
|
|
2519
|
-
isTouched &&
|
|
2520
|
-
'[&>*]:!text-red-300');
|
|
2521
|
-
},
|
|
2522
|
-
menu: styles.menu,
|
|
2523
|
-
tagItem: function () { return styles.tagItem; },
|
|
2524
|
-
tagItemText: styles.tagItemText,
|
|
2525
|
-
tagItemIconContainer: styles.tagItemIconContainer,
|
|
2526
|
-
tagItemIcon: styles.tagItemIcon,
|
|
2527
|
-
list: styles.list,
|
|
2528
|
-
listItem: function () { return styles.listItem; },
|
|
2529
|
-
listDisabledItem: styles.listDisabledItem,
|
|
2530
|
-
listGroupLabel: styles.listGroupLabel,
|
|
2531
|
-
searchContainer: styles.searchContainer,
|
|
2532
|
-
searchBox: styles.searchBox,
|
|
2533
|
-
searchIcon: styles.searchIcon,
|
|
2534
|
-
closeIcon: styles.closeIcon,
|
|
2535
|
-
} }), !isSolo && (jsxRuntime.jsxs("div", { className: styles.foot, children: [description && !(error && isTouched) && (jsxRuntime.jsx("p", { className: styles.description, children: description })), error && isTouched && (jsxRuntime.jsx("p", { className: styles.error, children: JSON.stringify(error).replaceAll('"', '') }))] }))] })] }));
|
|
2536
|
-
};
|
|
2537
|
-
|
|
2538
|
-
var base$5 = {
|
|
2539
|
-
container: '',
|
|
2540
|
-
head: 'flex justify-between',
|
|
2541
|
-
body: 'relative rounded-md',
|
|
2542
|
-
foot: '',
|
|
2543
|
-
label: 'block font-medium text-gray-900',
|
|
2544
|
-
hint: 'text-xs text-gray-500',
|
|
2545
|
-
leading: 'pointer-events-none absolute inset-y-0 left-0 flex items-center',
|
|
2546
|
-
input: 'block w-full flex border',
|
|
2547
|
-
menuButton: '',
|
|
2548
|
-
menu: 'z-10 !px-0 !py-0 !w-full rounded-md overflow-hidden border !mt-1 absolute bg-white',
|
|
2549
|
-
tagItem: 'bg-gray-200 px-2 py-1 flex flex-row gap-x-1 items-center justify-between rounded-sm',
|
|
2550
|
-
tagItemText: 'text-xs',
|
|
2551
|
-
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',
|
|
2552
|
-
tagItemIcon: '',
|
|
2553
|
-
list: '!px-0 !w-full [&>*]:px-0 max-h-56 overflow-scroll !py-1',
|
|
2554
|
-
listGroupLabel: '',
|
|
2555
|
-
listItem: '!w-full !list-none hover:bg-primary-500 hover:text-white !py-2 !px-2',
|
|
2556
|
-
listDisabledItem: '',
|
|
2557
|
-
searchContainer: '!w-full !px-2 !py-2 border-b',
|
|
2558
|
-
searchBox: '',
|
|
2559
|
-
searchIcon: '',
|
|
2560
|
-
closeIcon: '',
|
|
2561
|
-
emptyState: 'w-full inline-flex items-start justify-start px-4',
|
|
2562
|
-
trailing: 'pointer-events-none absolute inset-y-0 right-0 flex items-center',
|
|
2563
|
-
description: 'text-gray-400 text-xs mt-1',
|
|
2564
|
-
error: 'text-red-500 text-xs ml-5 mt-1',
|
|
2565
|
-
};
|
|
2566
|
-
var leading$4 = {
|
|
2567
|
-
input: 'pl-10',
|
|
2568
|
-
};
|
|
2569
|
-
var trailing$4 = {};
|
|
2570
|
-
var normal$4 = {
|
|
2571
|
-
label: 'leading-6 text-sm mb-2',
|
|
2572
|
-
hint: 'leading-6',
|
|
2573
|
-
leading: 'pl-3',
|
|
2574
|
-
input: 'rounded-md border-gray-200 shadow-sm focus:border-primary-500 focus:ring-primary-500 sm:text-sm placeholder-gray-300',
|
|
2575
|
-
trailing: '',
|
|
2576
|
-
description: 'mt-2 text-sm',
|
|
2577
|
-
};
|
|
2578
|
-
var inset$4 = {
|
|
2579
|
-
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',
|
|
2580
|
-
label: 'text-xs',
|
|
2581
|
-
hint: 'text-xs',
|
|
2582
|
-
input: 'border-0 !ring-0 p-0 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm pl-0',
|
|
2583
|
-
description: 'hidden',
|
|
2584
|
-
};
|
|
2585
|
-
var overlapping$4 = {
|
|
2586
|
-
container: 'relative',
|
|
2587
|
-
head: ' absolute flex justify-between items-center left-0 -top-2 right-0 mx-2 z-10 w-full',
|
|
2588
|
-
label: 'inline-block bg-white px-1 text-xs font-medium text-gray-900 ',
|
|
2589
|
-
hint: 'text-xs mr-4 bg-white px-1',
|
|
2590
|
-
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',
|
|
2591
|
-
description: 'hidden',
|
|
2592
|
-
};
|
|
2593
|
-
var pill$4 = {
|
|
2594
|
-
head: 'mx-px block px-4 text-sm font-medium leading-6 text-gray-900 mb-1 pr-6',
|
|
2595
|
-
foot: 'mx-px block px-4 text-sm font-medium leading-6 text-gray-900 mt-1 pr-6',
|
|
2596
|
-
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',
|
|
2597
|
-
trailing: 'pr-2',
|
|
2598
|
-
description: 'text-xs',
|
|
2599
|
-
};
|
|
2600
|
-
var floored$4 = {
|
|
2601
|
-
body: 'relative mt-2',
|
|
2602
|
-
label: 'block text-sm font-medium leading-6 text-gray-900',
|
|
2603
|
-
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',
|
|
2604
|
-
description: 'text-xs mt-2',
|
|
2605
|
-
};
|
|
2606
|
-
var invalid$4 = {
|
|
2607
|
-
container: 'ring-red-500',
|
|
2608
|
-
input:
|
|
2609
|
-
// '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',
|
|
2610
|
-
'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',
|
|
2611
|
-
description: 'text-sm text-red-600',
|
|
2612
|
-
};
|
|
2613
|
-
var disabled$5 = {
|
|
2614
|
-
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',
|
|
2615
|
-
};
|
|
2616
|
-
var styles$6 = {
|
|
2617
|
-
base: base$5,
|
|
2618
|
-
leading: leading$4,
|
|
2619
|
-
trailing: trailing$4,
|
|
2620
|
-
normal: normal$4,
|
|
2621
|
-
inset: inset$4,
|
|
2622
|
-
overlapping: overlapping$4,
|
|
2623
|
-
pill: pill$4,
|
|
2624
|
-
floored: floored$4,
|
|
2625
|
-
invalid: invalid$4,
|
|
2626
|
-
disabled: disabled$5,
|
|
2627
|
-
};
|
|
2628
|
-
|
|
2629
2655
|
var DateMenuForm = function (props) {
|
|
2630
2656
|
var _a;
|
|
2631
2657
|
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) {
|
|
@@ -2652,6 +2678,8 @@ var DateMenuForm = function (props) {
|
|
|
2652
2678
|
return result;
|
|
2653
2679
|
};
|
|
2654
2680
|
var styles = handleGenerateStyle();
|
|
2681
|
+
var inputDataCy = "form-input-date-".concat(name);
|
|
2682
|
+
var errorDataCy = "form-input-date-error-".concat(name);
|
|
2655
2683
|
// Simulate onClear event.
|
|
2656
2684
|
React.useEffect(function () {
|
|
2657
2685
|
if (state.startDate === null && state.endDate === null) {
|
|
@@ -2659,13 +2687,13 @@ var DateMenuForm = function (props) {
|
|
|
2659
2687
|
}
|
|
2660
2688
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2661
2689
|
}, [state]);
|
|
2662
|
-
return (jsxRuntime.jsxs("div", { className: styles.container, children: [jsxRuntime.jsxs("div", { className: styles.head, children: [label && (jsxRuntime.jsx("label", { htmlFor: name, className: styles.label, children: label })), !required && !isRequired && typeof label === 'string' && (jsxRuntime.jsx("span", { className: styles.hint, children: "Optional" })), required && required({ isRequired: isRequired })] }), jsxRuntime.jsxs("div", { className: styles.container, children: [jsxRuntime.jsx(Datepicker, { inputName: name, inputId: name, i18n: i18n, useRange: size === 'expanded', placeholder: placeholder, asSingle: !isRanged, separator: separator, startFrom: startFrom, displayFormat: displayFormat, disabled: isDisabled, popoverDirection: direction, minDate: minDate, maxDate: maxDate, toggleIcon: icon,
|
|
2690
|
+
return (jsxRuntime.jsxs("div", { className: styles.container, children: [jsxRuntime.jsxs("div", { className: styles.head, children: [label && (jsxRuntime.jsx("label", { htmlFor: name, className: styles.label, children: label })), !required && !isRequired && typeof label === 'string' && (jsxRuntime.jsx("span", { className: styles.hint, children: "Optional" })), required && required({ isRequired: isRequired })] }), jsxRuntime.jsxs("div", { className: styles.container, "data-cy": inputDataCy, children: [jsxRuntime.jsx(Datepicker, { inputName: name, inputId: name, i18n: i18n, useRange: size === 'expanded', placeholder: placeholder, asSingle: !isRanged, separator: separator, startFrom: startFrom, displayFormat: displayFormat, disabled: isDisabled, popoverDirection: direction, minDate: minDate, maxDate: maxDate, toggleIcon: icon,
|
|
2663
2691
|
//
|
|
2664
2692
|
value: state,
|
|
2665
2693
|
//
|
|
2666
2694
|
onChange: handleValueChange,
|
|
2667
2695
|
//
|
|
2668
|
-
inputClassName: styles.input, startWeekOn: startWeekOn }), !isSolo && (jsxRuntime.jsxs("div", { className: styles.foot, children: [description && !(error && isTouched) && (jsxRuntime.jsx("p", { className: styles.description, children: description })), error && isTouched && (jsxRuntime.jsx("p", { className: styles.error, children: typeof error === 'string'
|
|
2696
|
+
inputClassName: styles.input, startWeekOn: startWeekOn }), !isSolo && (jsxRuntime.jsxs("div", { className: styles.foot, children: [description && !(error && isTouched) && (jsxRuntime.jsx("p", { className: styles.description, children: description })), error && isTouched && (jsxRuntime.jsx("p", { className: styles.error, "data-cy": errorDataCy, children: typeof error === 'string'
|
|
2669
2697
|
? error
|
|
2670
2698
|
: (_a = error === null || error === void 0 ? void 0 : error.startDate) !== null && _a !== void 0 ? _a : error === null || error === void 0 ? void 0 : error.endDate }))] }))] })] }));
|
|
2671
2699
|
};
|
|
@@ -2761,7 +2789,7 @@ var CheckboxInputGroupForm = function (props) {
|
|
|
2761
2789
|
var styles = handleGenerateStyle();
|
|
2762
2790
|
return (jsxRuntime.jsx(formik.FormikProvider, { value: form, children: jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("legend", { className: styles.sr, children: name }), jsxRuntime.jsx("div", { className: styles.list, children: jsxRuntime.jsx(formik.FieldArray, { name: name, render: function (_a) {
|
|
2763
2791
|
var remove = _a.remove, push = _a.push;
|
|
2764
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: options === null || options === void 0 ? void 0 : options.map(function (option) { return (jsxRuntime.jsxs("div", { className: styles.item.container, children: [jsxRuntime.jsx("div", { className: styles.item.head, children: jsxRuntime.jsx("input", { id: option.value, name: option.value, "aria-describedby": "".concat(option.value, "-description"), type: "checkbox", checked: values === null || values === void 0 ? void 0 : values.includes(option.value), className: styles.item.input, disabled: isDisabled, onChange: function (value) {
|
|
2792
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: options === null || options === void 0 ? void 0 : options.map(function (option) { return (jsxRuntime.jsxs("div", { className: styles.item.container, children: [jsxRuntime.jsx("div", { className: styles.item.head, children: jsxRuntime.jsx("input", { id: option.value, name: option.value, "data-cy": "form-".concat(name, "-checkbox-").concat(option.value), "aria-describedby": "".concat(option.value, "-description"), type: "checkbox", checked: values === null || values === void 0 ? void 0 : values.includes(option.value), className: styles.item.input, disabled: isDisabled, onChange: function (value) {
|
|
2765
2793
|
var isChecked = value.currentTarget.checked;
|
|
2766
2794
|
if (isChecked) {
|
|
2767
2795
|
push(option.value);
|