@7shifts/sous-chef 3.11.2 → 3.13.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/forms/TimeField/TimeField.d.ts +18 -7
- package/dist/forms/TimeField/TimeFieldDropdown/TimeFieldDropdown.d.ts +4 -3
- package/dist/forms/TimeField/TimeFieldDropdownTrigger/TimeFieldDropdownTrigger.d.ts +3 -3
- package/dist/forms/TimeField/TimeFieldInput/TimeFieldInput.d.ts +5 -1
- package/dist/forms/TimeField/domain.d.ts +2 -1
- package/dist/forms/TimeRangeField/TimeRangeEnd/TimeRangeEnd.d.ts +5 -0
- package/dist/forms/TimeRangeField/TimeRangeEnd/index.d.ts +1 -0
- package/dist/forms/TimeRangeField/TimeRangeField.d.ts +20 -0
- package/dist/forms/TimeRangeField/TimeRangeStart/TimeRangeStart.d.ts +5 -0
- package/dist/forms/TimeRangeField/TimeRangeStart/index.d.ts +1 -0
- package/dist/forms/TimeRangeField/index.d.ts +1 -0
- package/dist/forms/TimeRangeField/types.d.ts +9 -0
- package/dist/forms/index.d.ts +2 -1
- package/dist/foundation/color-codes.d.ts +1 -0
- package/dist/foundation/color-constants.d.ts +1 -0
- package/dist/foundation/domain.d.ts +2 -0
- package/dist/index.css +609 -552
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1506 -1326
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1506 -1327
- package/dist/index.modern.js.map +1 -1
- package/dist/lists/DataTable/DataTableDefaultItemComponent/DataTableDefaultItemComponent.d.ts +3 -0
- package/dist/lists/DataTable/DataTableDefaultItemComponent/index.d.ts +1 -0
- package/dist/lists/DataTable/DataTableHeader/ColumnSizes/ColumnSizes.d.ts +7 -0
- package/dist/lists/DataTable/DataTableHeader/ColumnSizes/index.d.ts +1 -0
- package/dist/lists/DataTable/{DataTableHeader.d.ts → DataTableHeader/DataTableHeader.d.ts} +1 -1
- package/dist/lists/DataTable/DataTableHeader/HeaderSortIcon/HeaderSortIcon.d.ts +6 -0
- package/dist/lists/DataTable/DataTableHeader/HeaderSortIcon/index.d.ts +1 -0
- package/dist/lists/DataTable/DataTableHeader/constants.d.ts +2 -0
- package/dist/lists/DataTable/DataTableHeader/domain.d.ts +2 -0
- package/dist/lists/DataTable/DataTableHeader/types.d.ts +4 -0
- package/dist/lists/DataTable/types.d.ts +1 -1
- package/dist/lists/DataTableCell/index.d.ts +1 -0
- package/dist/lists/index.d.ts +1 -1
- package/dist/overlay/KebabMenu/types.d.ts +1 -0
- package/dist/typography/Text/Text.d.ts +2 -1
- package/dist/utils/date.d.ts +1 -0
- package/package.json +3 -3
- package/dist/foundation/colors.d.ts +0 -53
- package/dist/lists/DataTable/DataTableCell/index.d.ts +0 -1
- /package/dist/lists/{DataTable/DataTableCell → DataTableCell}/DataTableCell.d.ts +0 -0
package/dist/index.modern.js
CHANGED
|
@@ -3,14 +3,14 @@ import classnames from 'classnames';
|
|
|
3
3
|
import { toast as toast$1, ToastContainer as ToastContainer$1, Slide } from 'react-toastify';
|
|
4
4
|
import ReactDOM from 'react-dom';
|
|
5
5
|
import 'react-toastify/dist/ReactToastify.css';
|
|
6
|
+
import { debounce } from 'lodash-es';
|
|
7
|
+
import parseTime from 'time-autocomplete/src/core/AMPMParser';
|
|
6
8
|
import ReactModal from 'react-modal';
|
|
7
9
|
import DayPicker, { DateUtils } from 'react-day-picker';
|
|
8
10
|
import 'react-day-picker/lib/style.css';
|
|
9
11
|
import dateFnsFormat from 'date-fns/format';
|
|
10
12
|
import dateFnsParse from 'date-fns/parse';
|
|
11
13
|
import startOfDay from 'date-fns/startOfDay';
|
|
12
|
-
import { debounce } from 'lodash-es';
|
|
13
|
-
import parseTime from 'time-autocomplete/src/core/AMPMParser';
|
|
14
14
|
import Select, { components } from 'react-select';
|
|
15
15
|
import { Link as Link$1 } from 'react-router-dom';
|
|
16
16
|
import AsyncSelect from 'react-select/async';
|
|
@@ -18,6 +18,8 @@ import DayPickerInput from 'react-day-picker/DayPickerInput';
|
|
|
18
18
|
import { isDate, startOfDay as startOfDay$1 } from 'date-fns';
|
|
19
19
|
import eachDayOfInterval from 'date-fns/eachDayOfInterval';
|
|
20
20
|
|
|
21
|
+
var COLORS = {};
|
|
22
|
+
|
|
21
23
|
function _extends() {
|
|
22
24
|
_extends = Object.assign || function (target) {
|
|
23
25
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -762,6 +764,14 @@ var ButtonElement = forwardRef(function (_ref2, ref) {
|
|
|
762
764
|
});
|
|
763
765
|
var Button$1 = forwardRef(Button);
|
|
764
766
|
|
|
767
|
+
var getColor = function getColor(color) {
|
|
768
|
+
if (color && COLORS[color]) {
|
|
769
|
+
return COLORS[color];
|
|
770
|
+
} else {
|
|
771
|
+
return color;
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
|
|
765
775
|
var ICON_SIZES = {
|
|
766
776
|
small: '12px',
|
|
767
777
|
medium: '16px',
|
|
@@ -780,7 +790,8 @@ var getIconStyles = function getIconStyles(_ref) {
|
|
|
780
790
|
width: ICON_SIZES[size],
|
|
781
791
|
height: ICON_SIZES[size],
|
|
782
792
|
verticalAlign: 'middle',
|
|
783
|
-
fill: color
|
|
793
|
+
fill: color,
|
|
794
|
+
color: getColor(color)
|
|
784
795
|
}, styles);
|
|
785
796
|
};
|
|
786
797
|
|
|
@@ -931,7 +942,8 @@ var IconArrowTurnDownRight = forwardRef(function (_ref, ref) {
|
|
|
931
942
|
clipPath: "url(#icon-arrow-turn-down-right_svg__a)"
|
|
932
943
|
}, React__default.createElement("path", {
|
|
933
944
|
opacity: 0.9,
|
|
934
|
-
d: "m15.957 14.862 3.905-3.905a.47.47 0 0 0 0-.664l-3.905-3.906a.47.47 0 0 0-.664 0l-.332.332a.47.47 0 0 0 0 .665l2.537 2.538H1.406V5.938a.469.469 0 0 0-.137-.331L.8 5.138a.469.469 0 0 0-.8.331v4.921c0 .518.42.938.937.938h16.561l-2.537 2.538a.47.47 0 0 0 0 .664l.332.332a.47.47 0 0 0 .664 0Z"
|
|
945
|
+
d: "m15.957 14.862 3.905-3.905a.47.47 0 0 0 0-.664l-3.905-3.906a.47.47 0 0 0-.664 0l-.332.332a.47.47 0 0 0 0 .665l2.537 2.538H1.406V5.938a.469.469 0 0 0-.137-.331L.8 5.138a.469.469 0 0 0-.8.331v4.921c0 .518.42.938.937.938h16.561l-2.537 2.538a.47.47 0 0 0 0 .664l.332.332a.47.47 0 0 0 .664 0Z",
|
|
946
|
+
fill: "currentColor"
|
|
935
947
|
})), React__default.createElement("defs", null, React__default.createElement("clipPath", {
|
|
936
948
|
id: "icon-arrow-turn-down-right_svg__a"
|
|
937
949
|
}, React__default.createElement("path", {
|
|
@@ -2410,13 +2422,12 @@ var IconFourSquares = forwardRef(function (_ref, ref) {
|
|
|
2410
2422
|
rx: 1,
|
|
2411
2423
|
fill: "currentColor"
|
|
2412
2424
|
}), React__default.createElement("rect", {
|
|
2413
|
-
x: 10.
|
|
2414
|
-
y: 10.
|
|
2415
|
-
width: 8.
|
|
2416
|
-
height: 8.
|
|
2417
|
-
rx:
|
|
2418
|
-
|
|
2419
|
-
strokeWidth: 0.5
|
|
2425
|
+
x: 10.573,
|
|
2426
|
+
y: 10.573,
|
|
2427
|
+
width: 8.594,
|
|
2428
|
+
height: 8.594,
|
|
2429
|
+
rx: 1,
|
|
2430
|
+
fill: "currentColor"
|
|
2420
2431
|
}), React__default.createElement("rect", {
|
|
2421
2432
|
x: 0.833,
|
|
2422
2433
|
y: 0.833,
|
|
@@ -2998,7 +3009,8 @@ var IconMessages = forwardRef(function (_ref, ref) {
|
|
|
2998
3009
|
"data-testid": testId,
|
|
2999
3010
|
ref: ref
|
|
3000
3011
|
}, props), React__default.createElement("path", {
|
|
3001
|
-
d: "M17.778 5.556h-3.334V2.222A2.224 2.224 0 0 0 12.222 0h-10A2.224 2.224 0 0 0 0 2.222v5.556C0 9.003.997 10 2.222 10h1.111v1.806a.415.415 0 0 0 .664.333l2.67-1.51v2.704c0 1.226.996 2.223 2.222 2.223h3.333l3.781 2.138a.416.416 0 0 0 .663-.333v-1.805h1.112A2.224 2.224 0 0 0 20 13.333V7.778a2.224 2.224 0 0 0-2.222-2.222ZM2.222 8.889c-.61 0-1.11-.5-1.11-1.111V2.222c0-.61.5-1.11 1.11-1.11h10c.611 0 1.111.5 1.111 1.11v5.556c0 .61-.5 1.11-1.11 1.11H7.485l-.253.147-2.789 1.576V8.89H2.222Zm16.667 4.444c0 .611-.5 1.111-1.111 1.111h-2.222v1.723L12.77 14.59l-.254-.146H8.89c-.611 0-1.111-.5-1.111-1.11V10h4.444a2.224 2.224 0 0 0 2.222-2.222V6.667h3.334c.61 0 1.11.5 1.11 1.11v5.556Z"
|
|
3012
|
+
d: "M17.778 5.556h-3.334V2.222A2.224 2.224 0 0 0 12.222 0h-10A2.224 2.224 0 0 0 0 2.222v5.556C0 9.003.997 10 2.222 10h1.111v1.806a.415.415 0 0 0 .664.333l2.67-1.51v2.704c0 1.226.996 2.223 2.222 2.223h3.333l3.781 2.138a.416.416 0 0 0 .663-.333v-1.805h1.112A2.224 2.224 0 0 0 20 13.333V7.778a2.224 2.224 0 0 0-2.222-2.222ZM2.222 8.889c-.61 0-1.11-.5-1.11-1.111V2.222c0-.61.5-1.11 1.11-1.11h10c.611 0 1.111.5 1.111 1.11v5.556c0 .61-.5 1.11-1.11 1.11H7.485l-.253.147-2.789 1.576V8.89H2.222Zm16.667 4.444c0 .611-.5 1.111-1.111 1.111h-2.222v1.723L12.77 14.59l-.254-.146H8.89c-.611 0-1.111-.5-1.111-1.11V10h4.444a2.224 2.224 0 0 0 2.222-2.222V6.667h3.334c.61 0 1.11.5 1.11 1.11v5.556Z",
|
|
3013
|
+
fill: "currentColor"
|
|
3002
3014
|
}));
|
|
3003
3015
|
});
|
|
3004
3016
|
IconMessages.displayName = 'IconMessages';
|
|
@@ -3077,7 +3089,8 @@ var IconMugSaucerSolid = forwardRef(function (_ref, ref) {
|
|
|
3077
3089
|
"data-testid": testId,
|
|
3078
3090
|
ref: ref
|
|
3079
3091
|
}, props), React__default.createElement("path", {
|
|
3080
|
-
d: "M7 14h6a3 3 0 0 0 3-3h1c2.206 0 4-1.794 4-4s-1.794-4-4-4H4.75a.748.748 0 0 0-.75.75V11a3 3 0 0 0 3 3Zm10-9c1.103 0 2 .897 2 2s-.897 2-2 2h-1V5h1Zm1.49 12H2.51c-1.488 0-1.907-2-1.126-2h18.228c.782 0 .369 2-1.122 2Z"
|
|
3092
|
+
d: "M7 14h6a3 3 0 0 0 3-3h1c2.206 0 4-1.794 4-4s-1.794-4-4-4H4.75a.748.748 0 0 0-.75.75V11a3 3 0 0 0 3 3Zm10-9c1.103 0 2 .897 2 2s-.897 2-2 2h-1V5h1Zm1.49 12H2.51c-1.488 0-1.907-2-1.126-2h18.228c.782 0 .369 2-1.122 2Z",
|
|
3093
|
+
fill: "currentColor"
|
|
3081
3094
|
}));
|
|
3082
3095
|
});
|
|
3083
3096
|
IconMugSaucerSolid.displayName = 'IconMugSaucerSolid';
|
|
@@ -4303,6 +4316,141 @@ var SousChefProvider = function SousChefProvider(_ref) {
|
|
|
4303
4316
|
return React__default.createElement(Fragment, null, React__default.createElement(ToastContainer, null), children);
|
|
4304
4317
|
};
|
|
4305
4318
|
|
|
4319
|
+
var styles$9 = {"data-table-header":"_FcxnN","data-table-header__item":"_1QljH","data-table-header__item--sortable":"_1T4uT","data-table-header__itemfocus":"_HtAmk","data-table-header__item--action":"_39zhh","data-table-header__item-content":"_1CG8B","data-table-header__item-content--right-align":"_1iqpa","data-table-header__sort-icon":"_21Xc6"};
|
|
4320
|
+
|
|
4321
|
+
var SORT_ORDER = {
|
|
4322
|
+
ASC: 'asc',
|
|
4323
|
+
DESC: 'desc'
|
|
4324
|
+
};
|
|
4325
|
+
|
|
4326
|
+
var getNextSort = function getNextSort(column) {
|
|
4327
|
+
switch (column.currentSort) {
|
|
4328
|
+
case SORT_ORDER.ASC:
|
|
4329
|
+
return null;
|
|
4330
|
+
|
|
4331
|
+
case SORT_ORDER.DESC:
|
|
4332
|
+
return SORT_ORDER.ASC;
|
|
4333
|
+
|
|
4334
|
+
default:
|
|
4335
|
+
return SORT_ORDER.DESC;
|
|
4336
|
+
}
|
|
4337
|
+
};
|
|
4338
|
+
|
|
4339
|
+
var calculatePercentageOfProportion = function calculatePercentageOfProportion(proportionNumbers) {
|
|
4340
|
+
var sum = proportionNumbers.reduce(function (total, num) {
|
|
4341
|
+
return total + num;
|
|
4342
|
+
}, 0);
|
|
4343
|
+
var percentages = proportionNumbers.map(function (num) {
|
|
4344
|
+
return parseFloat((num / sum * 100).toFixed(2));
|
|
4345
|
+
});
|
|
4346
|
+
return percentages;
|
|
4347
|
+
};
|
|
4348
|
+
|
|
4349
|
+
var ColumnSizes = function ColumnSizes(_ref) {
|
|
4350
|
+
var columns = _ref.columns,
|
|
4351
|
+
showActionMenu = _ref.showActionMenu;
|
|
4352
|
+
var columnPercentageSizes = calculatePercentageOfProportion(columns.map(function (column) {
|
|
4353
|
+
return column.size || 1;
|
|
4354
|
+
}));
|
|
4355
|
+
return React__default.createElement("colgroup", null, columns.map(function (column, index) {
|
|
4356
|
+
return React__default.createElement("col", {
|
|
4357
|
+
key: column.name,
|
|
4358
|
+
style: {
|
|
4359
|
+
width: columnPercentageSizes[index] + "%"
|
|
4360
|
+
}
|
|
4361
|
+
});
|
|
4362
|
+
}), showActionMenu && React__default.createElement("col", {
|
|
4363
|
+
style: {
|
|
4364
|
+
width: "1%",
|
|
4365
|
+
whiteSpace: 'nowrap'
|
|
4366
|
+
}
|
|
4367
|
+
}));
|
|
4368
|
+
};
|
|
4369
|
+
|
|
4370
|
+
var HeaderSortIcon = function HeaderSortIcon(_ref) {
|
|
4371
|
+
var sortDirection = _ref.sortDirection;
|
|
4372
|
+
var sortDir = sortDirection || null;
|
|
4373
|
+
return React__default.createElement("div", {
|
|
4374
|
+
style: {
|
|
4375
|
+
display: 'inline-flex',
|
|
4376
|
+
flexDirection: 'column'
|
|
4377
|
+
}
|
|
4378
|
+
}, sortDir !== 'desc' && React__default.createElement(IconChevronUp, {
|
|
4379
|
+
size: "small",
|
|
4380
|
+
color: "grey-400"
|
|
4381
|
+
}), sortDir !== 'asc' && React__default.createElement("span", {
|
|
4382
|
+
style: {
|
|
4383
|
+
marginTop: '-4px'
|
|
4384
|
+
}
|
|
4385
|
+
}, React__default.createElement(IconChevronDown, {
|
|
4386
|
+
size: "small",
|
|
4387
|
+
color: "grey-400"
|
|
4388
|
+
})));
|
|
4389
|
+
};
|
|
4390
|
+
|
|
4391
|
+
var DataTableHeader = function DataTableHeader(_ref) {
|
|
4392
|
+
var columns = _ref.columns,
|
|
4393
|
+
onSort = _ref.onSort,
|
|
4394
|
+
showActionMenu = _ref.showActionMenu;
|
|
4395
|
+
var haveLabels = columns.find(function (column) {
|
|
4396
|
+
return column.label && column.label !== '';
|
|
4397
|
+
});
|
|
4398
|
+
|
|
4399
|
+
if (!haveLabels) {
|
|
4400
|
+
return React__default.createElement(ColumnSizes, {
|
|
4401
|
+
columns: columns,
|
|
4402
|
+
showActionMenu: showActionMenu
|
|
4403
|
+
});
|
|
4404
|
+
}
|
|
4405
|
+
|
|
4406
|
+
var handleSort = function handleSort(column) {
|
|
4407
|
+
var nextDirection = getNextSort(column);
|
|
4408
|
+
|
|
4409
|
+
if (onSort) {
|
|
4410
|
+
onSort({
|
|
4411
|
+
columnName: column.name,
|
|
4412
|
+
direction: nextDirection
|
|
4413
|
+
});
|
|
4414
|
+
}
|
|
4415
|
+
};
|
|
4416
|
+
|
|
4417
|
+
return React__default.createElement(Fragment, null, React__default.createElement(ColumnSizes, {
|
|
4418
|
+
columns: columns,
|
|
4419
|
+
showActionMenu: showActionMenu
|
|
4420
|
+
}), React__default.createElement("thead", null, React__default.createElement("tr", {
|
|
4421
|
+
className: styles$9['data-table-header']
|
|
4422
|
+
}, columns.map(function (column) {
|
|
4423
|
+
var _classnames, _classnames2;
|
|
4424
|
+
|
|
4425
|
+
var isSortable = column.isSortable;
|
|
4426
|
+
var sortDir = column.currentSort;
|
|
4427
|
+
var isRightAligned = column.isRightAligned;
|
|
4428
|
+
return React__default.createElement("th", {
|
|
4429
|
+
className: classnames((_classnames = {}, _classnames[styles$9['data-table-header__item']] = true, _classnames[styles$9['data-table-header__item--sortable']] = isSortable, _classnames)),
|
|
4430
|
+
style: {
|
|
4431
|
+
flex: column.size || 1
|
|
4432
|
+
},
|
|
4433
|
+
key: column.name,
|
|
4434
|
+
onClick: function onClick() {
|
|
4435
|
+
return isSortable && handleSort(column);
|
|
4436
|
+
},
|
|
4437
|
+
onKeyPress: function onKeyPress() {
|
|
4438
|
+
return isSortable && handleSort(column);
|
|
4439
|
+
},
|
|
4440
|
+
role: "columnheader",
|
|
4441
|
+
tabIndex: 0
|
|
4442
|
+
}, React__default.createElement("div", {
|
|
4443
|
+
className: classnames(styles$9['data-table-header__item-content'], (_classnames2 = {}, _classnames2[styles$9['data-table-header__item-content--right-align']] = isRightAligned, _classnames2))
|
|
4444
|
+
}, column.label, ' ', isSortable && React__default.createElement("span", {
|
|
4445
|
+
className: styles$9['data-table-header__sort-icon']
|
|
4446
|
+
}, React__default.createElement(HeaderSortIcon, {
|
|
4447
|
+
sortDirection: sortDir
|
|
4448
|
+
}))));
|
|
4449
|
+
}), showActionMenu && React__default.createElement("th", {
|
|
4450
|
+
className: classnames(styles$9['data-table-header__item'], styles$9['data-table-header__item--action'])
|
|
4451
|
+
}))));
|
|
4452
|
+
};
|
|
4453
|
+
|
|
4306
4454
|
var initialValue = {
|
|
4307
4455
|
columns: [],
|
|
4308
4456
|
numberOfRows: 0
|
|
@@ -4318,9 +4466,42 @@ var useDataTableContext = function useDataTableContext() {
|
|
|
4318
4466
|
return context;
|
|
4319
4467
|
};
|
|
4320
4468
|
|
|
4321
|
-
var styles$
|
|
4469
|
+
var styles$a = {"data-table":"_umpGL","data-table__content":"_5BvsJ","data-table__content--with-scroll":"_3p04C","data-table__table":"_3_o_a","data-table__table--no-columns":"_3aKQI","data-table__body":"_tCd-U","data-table__body--no-bottom-radius":"_Hp5nC","data-table__footer":"__15fo","data-table__pagination-controls":"_2KGQu"};
|
|
4470
|
+
|
|
4471
|
+
var styles$b = {"data-table-scroll-fake-border":"_1zw4R","data-table-scroll-fake-border--top":"_2vWl5","data-table-scroll-fake-border--bottom":"_397Yd","data-table-scroll-fake-border__left":"_AGTVL","data-table-scroll-fake-border__left--top":"_3wzKK","data-table-scroll-fake-border__left--bottom":"_2pJrs","data-table-scroll-fake-border__right":"_vh4go","data-table-scroll-fake-border__right--top":"_2sj0a","data-table-scroll-fake-border__right--bottom":"_1s8kO"};
|
|
4472
|
+
|
|
4473
|
+
var DataTableScrollFakeBorder = function DataTableScrollFakeBorder(_ref) {
|
|
4474
|
+
var _classNames, _classNames2, _classNames3;
|
|
4475
|
+
|
|
4476
|
+
var placement = _ref.placement;
|
|
4477
|
+
return React__default.createElement("div", {
|
|
4478
|
+
className: classnames(styles$b['data-table-scroll-fake-border'], (_classNames = {}, _classNames[styles$b['data-table-scroll-fake-border--top']] = placement === 'top', _classNames[styles$b['data-table-scroll-fake-border--bottom']] = placement === 'bottom', _classNames))
|
|
4479
|
+
}, React__default.createElement("div", {
|
|
4480
|
+
className: classnames(styles$b['data-table-scroll-fake-border__left'], (_classNames2 = {}, _classNames2[styles$b['data-table-scroll-fake-border__left--top']] = placement === 'top', _classNames2[styles$b['data-table-scroll-fake-border__left--bottom']] = placement === 'bottom', _classNames2))
|
|
4481
|
+
}), React__default.createElement("div", {
|
|
4482
|
+
className: classnames(styles$b['data-table-scroll-fake-border__right'], (_classNames3 = {}, _classNames3[styles$b['data-table-scroll-fake-border__right--top']] = placement === 'top', _classNames3[styles$b['data-table-scroll-fake-border__right--bottom']] = placement === 'bottom', _classNames3))
|
|
4483
|
+
}));
|
|
4484
|
+
};
|
|
4485
|
+
|
|
4486
|
+
var styles$c = {"data-table-loading-block":"_94pbt"};
|
|
4487
|
+
|
|
4488
|
+
var DataTableLoadingBlock = function DataTableLoadingBlock(_ref) {
|
|
4489
|
+
var amountOfColumns = _ref.amountOfColumns,
|
|
4490
|
+
showActionMenu = _ref.showActionMenu;
|
|
4491
|
+
var aditionalColums = showActionMenu ? 1 : 0;
|
|
4492
|
+
var colSpan = amountOfColumns + aditionalColums;
|
|
4493
|
+
return React__default.createElement("tr", {
|
|
4494
|
+
className: styles$c['data-table-loading-block']
|
|
4495
|
+
}, React__default.createElement("td", {
|
|
4496
|
+
colSpan: colSpan
|
|
4497
|
+
}, React__default.createElement(Spinner, {
|
|
4498
|
+
block: true
|
|
4499
|
+
})));
|
|
4500
|
+
};
|
|
4501
|
+
|
|
4502
|
+
var styles$d = {"item":"_2GGMG","clickable":"_3VoZI","selected":"_1ZCir"};
|
|
4322
4503
|
|
|
4323
|
-
var styles$
|
|
4504
|
+
var styles$e = {"actions":"_3Iab2"};
|
|
4324
4505
|
|
|
4325
4506
|
var DropdownContext = React__default.createContext({
|
|
4326
4507
|
onToggleDropdown: function onToggleDropdown() {},
|
|
@@ -4336,7 +4517,7 @@ var useDropdownContext = function useDropdownContext() {
|
|
|
4336
4517
|
return React__default.useContext(DropdownContext);
|
|
4337
4518
|
};
|
|
4338
4519
|
|
|
4339
|
-
var styles$
|
|
4520
|
+
var styles$f = {"dropdown-pane":"_2EwLt"};
|
|
4340
4521
|
|
|
4341
4522
|
function isClickInside(ref, event) {
|
|
4342
4523
|
return !ref.current || event.target instanceof Node && ref.current.contains(event.target);
|
|
@@ -4476,7 +4657,7 @@ var PaneOverlay = function PaneOverlay(_ref) {
|
|
|
4476
4657
|
useKeyPress(['Escape'], handleEscapeKey);
|
|
4477
4658
|
var overflow = maxHeight ? 'scroll' : undefined;
|
|
4478
4659
|
return React__default.createElement("div", {
|
|
4479
|
-
className: classnames(styles$
|
|
4660
|
+
className: classnames(styles$f['dropdown-pane'], (_classNames = {}, _classNames[styles$f['dropdown-pane--with-padding']] = true, _classNames)),
|
|
4480
4661
|
style: _extends({}, position, {
|
|
4481
4662
|
width: width,
|
|
4482
4663
|
maxHeight: maxHeight,
|
|
@@ -4506,7 +4687,7 @@ var getKeyboardFocusableElements = function getKeyboardFocusableElements(element
|
|
|
4506
4687
|
});
|
|
4507
4688
|
};
|
|
4508
4689
|
|
|
4509
|
-
var styles$
|
|
4690
|
+
var styles$g = {"dropdown__trigger":"_2rs8m"};
|
|
4510
4691
|
|
|
4511
4692
|
var DROPDOWN_ALIGNEMNT = {
|
|
4512
4693
|
LEFT: 'left',
|
|
@@ -4517,422 +4698,588 @@ var DROPDOWN_TRIGGER = {
|
|
|
4517
4698
|
CLICK: 'click'
|
|
4518
4699
|
};
|
|
4519
4700
|
|
|
4520
|
-
var styles$
|
|
4701
|
+
var styles$h = {"label":"_h724f","label--truncate":"_1VUoF"};
|
|
4521
4702
|
|
|
4522
|
-
var
|
|
4703
|
+
var isEllipsisActive = function isEllipsisActive(e) {
|
|
4704
|
+
return e.offsetWidth < e.scrollWidth;
|
|
4705
|
+
};
|
|
4523
4706
|
|
|
4524
|
-
var
|
|
4525
|
-
var
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
loading = _ref.loading;
|
|
4707
|
+
var useLabelTooltip = function useLabelTooltip(labelId, tooltipContent, truncate) {
|
|
4708
|
+
var _useState = useState(false),
|
|
4709
|
+
showTooltip = _useState[0],
|
|
4710
|
+
setShowTooltip = _useState[1];
|
|
4529
4711
|
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
}, React__default.createElement(IconTimes, null))) : null;
|
|
4538
|
-
}
|
|
4712
|
+
var shouldTruncate = typeof tooltipContent === 'string' && truncate;
|
|
4713
|
+
var labelElement = document.getElementById(labelId);
|
|
4714
|
+
var isHidden = labelElement && labelElement.offsetParent === null;
|
|
4715
|
+
var handleApplyTooltip = useCallback(function () {
|
|
4716
|
+
if (!shouldTruncate) {
|
|
4717
|
+
return;
|
|
4718
|
+
}
|
|
4539
4719
|
|
|
4540
|
-
|
|
4541
|
-
space: 12,
|
|
4542
|
-
marginBottom: 24
|
|
4543
|
-
}, React__default.createElement(Inline, {
|
|
4544
|
-
flex: [1],
|
|
4545
|
-
alignItems: "center"
|
|
4546
|
-
}, React__default.createElement("span", {
|
|
4547
|
-
className: styles$e['header']
|
|
4548
|
-
}, header), onClose && React__default.createElement(Button$1, {
|
|
4549
|
-
theme: "link-icon",
|
|
4550
|
-
onClick: onClose,
|
|
4551
|
-
disabled: loading
|
|
4552
|
-
}, React__default.createElement(IconTimes, null))), subHeader && React__default.createElement("div", {
|
|
4553
|
-
className: styles$e['sub-header']
|
|
4554
|
-
}, subHeader));
|
|
4555
|
-
};
|
|
4720
|
+
var labelElement = document.getElementById(labelId);
|
|
4556
4721
|
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
}
|
|
4560
|
-
var useModalContext = function useModalContext() {
|
|
4561
|
-
var context = useContext(ModalContext);
|
|
4562
|
-
return context || {};
|
|
4563
|
-
};
|
|
4722
|
+
if (!labelElement) {
|
|
4723
|
+
return;
|
|
4724
|
+
}
|
|
4564
4725
|
|
|
4565
|
-
var
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
onClose = _ref.onClose,
|
|
4570
|
-
loading = _ref.loading,
|
|
4571
|
-
_ref$zIndex = _ref.zIndex,
|
|
4572
|
-
zIndex = _ref$zIndex === void 0 ? Z_INDEX_LAYERS.MODAL : _ref$zIndex,
|
|
4573
|
-
rootElementId = _ref.rootElementId,
|
|
4574
|
-
_ref$width = _ref.width,
|
|
4575
|
-
width = _ref$width === void 0 ? 500 : _ref$width,
|
|
4576
|
-
height = _ref.height,
|
|
4577
|
-
maxWidth = _ref.maxWidth,
|
|
4578
|
-
_ref$shouldReturnFocu = _ref.shouldReturnFocusAfterClose,
|
|
4579
|
-
shouldReturnFocusAfterClose = _ref$shouldReturnFocu === void 0 ? true : _ref$shouldReturnFocu,
|
|
4580
|
-
testId = _ref.testId;
|
|
4581
|
-
var style = {
|
|
4582
|
-
content: {
|
|
4583
|
-
width: width,
|
|
4584
|
-
height: height,
|
|
4585
|
-
maxWidth: maxWidth
|
|
4586
|
-
},
|
|
4587
|
-
overlay: {
|
|
4588
|
-
zIndex: zIndex
|
|
4726
|
+
var shouldShowTooltip = isEllipsisActive(labelElement);
|
|
4727
|
+
|
|
4728
|
+
if (showTooltip !== shouldShowTooltip) {
|
|
4729
|
+
setShowTooltip(shouldShowTooltip);
|
|
4589
4730
|
}
|
|
4590
|
-
};
|
|
4591
|
-
return React__default.createElement(ReactModal, {
|
|
4592
|
-
isOpen: true,
|
|
4593
|
-
testId: testId,
|
|
4594
|
-
shouldCloseOnEsc: true,
|
|
4595
|
-
shouldCloseOnOverlayClick: false,
|
|
4596
|
-
shouldReturnFocusAfterClose: shouldReturnFocusAfterClose,
|
|
4597
|
-
onRequestClose: onClose && !loading ? onClose : undefined,
|
|
4598
|
-
style: style,
|
|
4599
|
-
closeTimeoutMS: 200,
|
|
4600
|
-
contentLabel: "Modal",
|
|
4601
|
-
appElement: rootElementId && document.getElementById(rootElementId) || undefined,
|
|
4602
|
-
overlayClassName: {
|
|
4603
|
-
base: styles$d['overlay'],
|
|
4604
|
-
afterOpen: styles$d['overlay--after-open'],
|
|
4605
|
-
beforeClose: styles$d['overlay--before-close']
|
|
4606
|
-
},
|
|
4607
|
-
className: {
|
|
4608
|
-
base: styles$d['content'],
|
|
4609
|
-
afterOpen: styles$d['content--after-open'],
|
|
4610
|
-
beforeClose: styles$d['content--before-close']
|
|
4611
|
-
}
|
|
4612
|
-
}, React__default.createElement(ModalHeader, {
|
|
4613
|
-
header: header,
|
|
4614
|
-
subHeader: subHeader,
|
|
4615
|
-
onClose: onClose,
|
|
4616
|
-
loading: loading
|
|
4617
|
-
}), React__default.createElement(ModalContext.Provider, {
|
|
4618
|
-
value: {
|
|
4619
|
-
isModalMounted: true
|
|
4620
|
-
}
|
|
4621
|
-
}, children));
|
|
4622
|
-
};
|
|
4623
|
-
|
|
4624
|
-
Modal.setAppElement = function (rootElement) {
|
|
4625
|
-
ReactModal.setAppElement(rootElement);
|
|
4626
|
-
};
|
|
4627
|
-
|
|
4628
|
-
var THRESHOLD = 20;
|
|
4629
|
-
var useScrollShadow = function useScrollShadow() {
|
|
4630
|
-
var ref = useRef(null);
|
|
4631
|
-
|
|
4632
|
-
var _useState = useState(false),
|
|
4633
|
-
showScrollShadow = _useState[0],
|
|
4634
|
-
setShowScrollShadow = _useState[1];
|
|
4635
|
-
|
|
4731
|
+
}, [shouldTruncate, isHidden]);
|
|
4636
4732
|
useEffect(function () {
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
setShowScrollShadow(true);
|
|
4645
|
-
}
|
|
4646
|
-
}, []);
|
|
4733
|
+
var onWindowResize = debounce(handleApplyTooltip, 300);
|
|
4734
|
+
window.addEventListener('resize', onWindowResize);
|
|
4735
|
+
return function () {
|
|
4736
|
+
return window.removeEventListener('resize', onWindowResize);
|
|
4737
|
+
};
|
|
4738
|
+
}, [handleApplyTooltip]);
|
|
4739
|
+
useLayoutEffect(handleApplyTooltip, [handleApplyTooltip]);
|
|
4647
4740
|
return {
|
|
4648
|
-
|
|
4649
|
-
|
|
4741
|
+
showTooltip: showTooltip,
|
|
4742
|
+
shouldTruncate: shouldTruncate
|
|
4650
4743
|
};
|
|
4651
4744
|
};
|
|
4652
4745
|
|
|
4653
|
-
var
|
|
4654
|
-
|
|
4655
|
-
var ModalBody = function ModalBody(_ref) {
|
|
4746
|
+
var Label = function Label(_ref) {
|
|
4656
4747
|
var _classNames;
|
|
4657
4748
|
|
|
4658
|
-
var
|
|
4659
|
-
|
|
4749
|
+
var htmlFor = _ref.htmlFor,
|
|
4750
|
+
children = _ref.children,
|
|
4751
|
+
_ref$truncate = _ref.truncate,
|
|
4752
|
+
truncate = _ref$truncate === void 0 ? true : _ref$truncate;
|
|
4753
|
+
var labelId = "label-" + htmlFor;
|
|
4660
4754
|
|
|
4661
|
-
var
|
|
4662
|
-
|
|
4663
|
-
|
|
4755
|
+
var _useLabelTooltip = useLabelTooltip(labelId, children, truncate),
|
|
4756
|
+
showTooltip = _useLabelTooltip.showTooltip,
|
|
4757
|
+
shouldTruncate = _useLabelTooltip.shouldTruncate;
|
|
4664
4758
|
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4759
|
+
var LabelElement = React__default.createElement("label", {
|
|
4760
|
+
htmlFor: htmlFor,
|
|
4761
|
+
id: labelId,
|
|
4762
|
+
className: classnames(styles$h['label'], (_classNames = {}, _classNames[styles$h['label--truncate']] = shouldTruncate, _classNames))
|
|
4669
4763
|
}, children);
|
|
4670
|
-
};
|
|
4671
|
-
|
|
4672
|
-
var styles$g = {"modal-footer":"_LKOr5","tertiary-container":"_Qktd-"};
|
|
4673
|
-
|
|
4674
|
-
var updateButtonProps = function updateButtonProps(button, newProps) {
|
|
4675
|
-
if (!button) {
|
|
4676
|
-
return null;
|
|
4677
|
-
}
|
|
4678
4764
|
|
|
4679
|
-
if (
|
|
4680
|
-
return
|
|
4765
|
+
if (showTooltip) {
|
|
4766
|
+
return React__default.createElement(Tooltip$1, {
|
|
4767
|
+
overlay: children,
|
|
4768
|
+
placement: "top"
|
|
4769
|
+
}, LabelElement);
|
|
4681
4770
|
}
|
|
4682
4771
|
|
|
4683
|
-
return
|
|
4772
|
+
return LabelElement;
|
|
4684
4773
|
};
|
|
4685
4774
|
|
|
4686
|
-
var
|
|
4687
|
-
var children = _ref.children,
|
|
4688
|
-
actions = _ref.actions,
|
|
4689
|
-
testId = _ref.testId;
|
|
4690
|
-
|
|
4691
|
-
if (actions) {
|
|
4692
|
-
var _actions$primary, _actions$secondary, _actions$tertiary, _classnames;
|
|
4693
|
-
|
|
4694
|
-
var primaryButton = updateButtonProps(actions.primary, {
|
|
4695
|
-
theme: (actions === null || actions === void 0 ? void 0 : (_actions$primary = actions.primary) === null || _actions$primary === void 0 ? void 0 : _actions$primary.props.theme) || 'primary',
|
|
4696
|
-
size: BUTTON_SIZES.MIN_WIDTH_100
|
|
4697
|
-
});
|
|
4698
|
-
var secondaryButton = updateButtonProps(actions.secondary, {
|
|
4699
|
-
theme: (actions === null || actions === void 0 ? void 0 : (_actions$secondary = actions.secondary) === null || _actions$secondary === void 0 ? void 0 : _actions$secondary.props.theme) || 'default',
|
|
4700
|
-
size: BUTTON_SIZES.MIN_WIDTH_100
|
|
4701
|
-
});
|
|
4702
|
-
var tertiaryButton = updateButtonProps(actions.tertiary, {
|
|
4703
|
-
theme: (actions === null || actions === void 0 ? void 0 : (_actions$tertiary = actions.tertiary) === null || _actions$tertiary === void 0 ? void 0 : _actions$tertiary.props.theme) || 'link-primary',
|
|
4704
|
-
size: BUTTON_SIZES.MIN_WIDTH_100
|
|
4705
|
-
});
|
|
4706
|
-
return React__default.createElement(FooterContainer, {
|
|
4707
|
-
testId: testId
|
|
4708
|
-
}, React__default.createElement(Inline, {
|
|
4709
|
-
justifyContent: "space-between"
|
|
4710
|
-
}, React__default.createElement("div", {
|
|
4711
|
-
className: classnames((_classnames = {}, _classnames[styles$g['tertiary-container']] = tertiaryButton && tertiaryButton.props.theme.startsWith('link'), _classnames))
|
|
4712
|
-
}, tertiaryButton || React__default.createElement("div", null)), React__default.createElement(Inline, {
|
|
4713
|
-
space: 12
|
|
4714
|
-
}, secondaryButton, primaryButton)));
|
|
4715
|
-
}
|
|
4775
|
+
var styles$i = {"caption":"_1DWBq"};
|
|
4716
4776
|
|
|
4717
|
-
|
|
4777
|
+
var Caption = function Caption(_ref) {
|
|
4778
|
+
var fieldId = _ref.fieldId,
|
|
4779
|
+
children = _ref.children;
|
|
4780
|
+
return React__default.createElement("div", {
|
|
4781
|
+
id: fieldId && fieldId + "-describer",
|
|
4782
|
+
className: styles$i['caption']
|
|
4783
|
+
}, children);
|
|
4718
4784
|
};
|
|
4719
4785
|
|
|
4720
|
-
var
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
var
|
|
4724
|
-
|
|
4786
|
+
var styles$j = {"error-message":"_nZ2MD"};
|
|
4787
|
+
|
|
4788
|
+
var ErrorMessage = function ErrorMessage(_ref) {
|
|
4789
|
+
var fieldId = _ref.fieldId,
|
|
4790
|
+
children = _ref.children,
|
|
4791
|
+
testId = _ref.testId;
|
|
4725
4792
|
return React__default.createElement("div", {
|
|
4726
|
-
|
|
4793
|
+
id: fieldId && fieldId + "-error-message",
|
|
4794
|
+
className: styles$j['error-message'],
|
|
4727
4795
|
"data-testid": testId
|
|
4728
4796
|
}, React__default.createElement(Inline, {
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4797
|
+
space: 8,
|
|
4798
|
+
alignItems: "center"
|
|
4799
|
+
}, React__default.createElement(IconTimesOctagon, {
|
|
4800
|
+
color: "radish-400",
|
|
4801
|
+
size: "medium"
|
|
4802
|
+
}), children));
|
|
4733
4803
|
};
|
|
4734
4804
|
|
|
4735
|
-
var
|
|
4805
|
+
var Field = function Field(_ref) {
|
|
4806
|
+
var id = _ref.id,
|
|
4807
|
+
label = _ref.label,
|
|
4808
|
+
caption = _ref.caption,
|
|
4809
|
+
error = _ref.error,
|
|
4810
|
+
children = _ref.children;
|
|
4811
|
+
var shouldRenderLabel = label || typeof label === 'string';
|
|
4812
|
+
return React__default.createElement(Stack, {
|
|
4813
|
+
space: 8,
|
|
4814
|
+
flexItems: true
|
|
4815
|
+
}, shouldRenderLabel && React__default.createElement(Label, {
|
|
4816
|
+
htmlFor: id
|
|
4817
|
+
}, label), children, caption && React__default.createElement(Caption, {
|
|
4818
|
+
fieldId: id
|
|
4819
|
+
}, caption), error && React__default.createElement(ErrorMessage, {
|
|
4820
|
+
fieldId: id
|
|
4821
|
+
}, error));
|
|
4822
|
+
};
|
|
4736
4823
|
|
|
4737
|
-
var
|
|
4824
|
+
var Context$1 = createContext({});
|
|
4825
|
+
var useFormContext = function useFormContext() {
|
|
4826
|
+
var context = useContext(Context$1);
|
|
4827
|
+
return context || {};
|
|
4828
|
+
};
|
|
4738
4829
|
|
|
4739
|
-
function
|
|
4740
|
-
var
|
|
4741
|
-
|
|
4742
|
-
|
|
4830
|
+
var useFieldId = function useFieldId(_ref) {
|
|
4831
|
+
var name = _ref.name,
|
|
4832
|
+
inputId = _ref.id;
|
|
4833
|
+
var id = useMemo(function () {
|
|
4834
|
+
return inputId ? inputId : name + "-" + Math.random();
|
|
4835
|
+
}, [inputId, name]);
|
|
4836
|
+
return id;
|
|
4837
|
+
};
|
|
4743
4838
|
|
|
4744
|
-
|
|
4745
|
-
|
|
4839
|
+
var getFormikState = function getFormikState(name, formik) {
|
|
4840
|
+
if (formik === undefined) {
|
|
4841
|
+
return null;
|
|
4746
4842
|
}
|
|
4747
4843
|
|
|
4748
|
-
|
|
4749
|
-
}
|
|
4750
|
-
function formatDate(date, format, locale) {
|
|
4751
|
-
return dateFnsFormat(date, format, {
|
|
4752
|
-
locale: locale
|
|
4753
|
-
});
|
|
4754
|
-
}
|
|
4755
|
-
function setToMidnight(date) {
|
|
4756
|
-
return date && startOfDay(date);
|
|
4757
|
-
}
|
|
4758
|
-
function getStartOfWeek(date, weekIndex) {
|
|
4759
|
-
var d = new Date(date);
|
|
4760
|
-
var firstDay = d.getDate() - d.getDay() + weekIndex;
|
|
4761
|
-
var firstDayAdjusted = firstDay > d.getDate() ? firstDay - 7 : firstDay;
|
|
4762
|
-
return new Date(d.setDate(firstDayAdjusted));
|
|
4763
|
-
}
|
|
4764
|
-
function getEndOfWeek(date, weekIndex) {
|
|
4765
|
-
var startOfWeek = getStartOfWeek(date, weekIndex);
|
|
4766
|
-
var endDay = startOfWeek.getDate() + 6;
|
|
4767
|
-
return new Date(startOfWeek.setDate(endDay));
|
|
4768
|
-
}
|
|
4769
|
-
function createWeekRange(date, weekStart) {
|
|
4770
|
-
return {
|
|
4771
|
-
start: getStartOfWeek(date, weekStart),
|
|
4772
|
-
end: getEndOfWeek(date, weekStart)
|
|
4773
|
-
};
|
|
4774
|
-
}
|
|
4775
|
-
var DAYS = [getLocalizedString('time.sunday'), getLocalizedString('time.monday'), getLocalizedString('time.tuesday'), getLocalizedString('time.wednesday'), getLocalizedString('time.thursday'), getLocalizedString('time.friday'), getLocalizedString('time.saturday')];
|
|
4776
|
-
var MONTH_NAMES = [getLocalizedString('time.january'), getLocalizedString('time.february'), getLocalizedString('time.march'), getLocalizedString('time.april'), getLocalizedString('time.may'), getLocalizedString('time.june'), getLocalizedString('time.july'), getLocalizedString('time.august'), getLocalizedString('time.september'), getLocalizedString('time.october'), getLocalizedString('time.november'), getLocalizedString('time.december')];
|
|
4777
|
-
|
|
4778
|
-
var CALENDAR_MODE = {
|
|
4779
|
-
DAY: 'day',
|
|
4780
|
-
WEEK: 'week'
|
|
4781
|
-
};
|
|
4782
|
-
var CALENDAR_PLACEMENT = {
|
|
4783
|
-
BOTTOM: 'bottom',
|
|
4784
|
-
TOP: 'top'
|
|
4785
|
-
};
|
|
4844
|
+
var formikPath = getFormikArrayPath(name);
|
|
4786
4845
|
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
return {
|
|
4790
|
-
left: 0,
|
|
4791
|
-
top: 0
|
|
4792
|
-
};
|
|
4846
|
+
if (formikPath.length === 0) {
|
|
4847
|
+
return null;
|
|
4793
4848
|
}
|
|
4794
4849
|
|
|
4795
|
-
var
|
|
4796
|
-
|
|
4797
|
-
return _extends({}, horizontalPosition, verticalPosition);
|
|
4798
|
-
};
|
|
4799
|
-
|
|
4800
|
-
var getHorizontalPosition = function getHorizontalPosition(anchorPosition, calendarDimensions) {
|
|
4801
|
-
var innerWidth = window.innerWidth;
|
|
4802
|
-
var calendarRight = anchorPosition.left + calendarDimensions.width;
|
|
4850
|
+
var formikLatestLevel = formikPath.reduce(function (acc, path) {
|
|
4851
|
+
var _acc$touched, _acc$error, _acc$value;
|
|
4803
4852
|
|
|
4804
|
-
if (innerWidth > calendarRight + BUFFER) {
|
|
4805
4853
|
return {
|
|
4806
|
-
|
|
4854
|
+
touched: (_acc$touched = acc.touched) === null || _acc$touched === void 0 ? void 0 : _acc$touched[path],
|
|
4855
|
+
error: (_acc$error = acc.error) === null || _acc$error === void 0 ? void 0 : _acc$error[path],
|
|
4856
|
+
value: (_acc$value = acc.value) === null || _acc$value === void 0 ? void 0 : _acc$value[path]
|
|
4807
4857
|
};
|
|
4808
|
-
}
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
};
|
|
4813
|
-
|
|
4858
|
+
}, {
|
|
4859
|
+
touched: formik.touched,
|
|
4860
|
+
error: formik.errors,
|
|
4861
|
+
value: formik.values
|
|
4862
|
+
});
|
|
4863
|
+
return {
|
|
4864
|
+
error: formikLatestLevel.touched ? formikLatestLevel.error : undefined,
|
|
4865
|
+
value: formikLatestLevel.value
|
|
4866
|
+
};
|
|
4867
|
+
};
|
|
4868
|
+
var getFormikArrayPath = function getFormikArrayPath(name) {
|
|
4869
|
+
return name.split(/[^a-zA-Z0-9]/).filter(Boolean);
|
|
4870
|
+
};
|
|
4814
4871
|
|
|
4815
|
-
var
|
|
4816
|
-
var
|
|
4817
|
-
|
|
4872
|
+
var useFieldControllers = function useFieldControllers(_ref) {
|
|
4873
|
+
var name = _ref.name,
|
|
4874
|
+
inputId = _ref.id,
|
|
4875
|
+
value = _ref.value,
|
|
4876
|
+
_onChange = _ref.onChange,
|
|
4877
|
+
_onBlur = _ref.onBlur,
|
|
4878
|
+
_onFocus = _ref.onFocus,
|
|
4879
|
+
_onKeyDown = _ref.onKeyDown,
|
|
4880
|
+
error = _ref.error,
|
|
4881
|
+
_ref$type = _ref.type,
|
|
4882
|
+
type = _ref$type === void 0 ? 'text' : _ref$type;
|
|
4818
4883
|
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
return {
|
|
4822
|
-
top: anchorPosition.bottom + PADDING
|
|
4823
|
-
};
|
|
4824
|
-
}
|
|
4884
|
+
var _useFormContext = useFormContext(),
|
|
4885
|
+
formik = _useFormContext.formik;
|
|
4825
4886
|
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
}
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4887
|
+
var id = useFieldId({
|
|
4888
|
+
name: name,
|
|
4889
|
+
id: inputId
|
|
4890
|
+
});
|
|
4891
|
+
var controllers = {
|
|
4892
|
+
id: id,
|
|
4893
|
+
error: error,
|
|
4894
|
+
value: value,
|
|
4895
|
+
onChange: function onChange(e) {
|
|
4896
|
+
return _onChange && _onChange(e.target.value);
|
|
4897
|
+
},
|
|
4898
|
+
onBlur: function onBlur(e) {
|
|
4899
|
+
return _onBlur && _onBlur(e.target.value);
|
|
4900
|
+
},
|
|
4901
|
+
onFocus: function onFocus(e) {
|
|
4902
|
+
return _onFocus && _onFocus(e.target.value);
|
|
4903
|
+
},
|
|
4904
|
+
onKeyDown: function onKeyDown(e) {
|
|
4905
|
+
return _onKeyDown && _onKeyDown(e.key);
|
|
4834
4906
|
}
|
|
4907
|
+
};
|
|
4908
|
+
var formikState = getFormikState(name, formik);
|
|
4835
4909
|
|
|
4836
|
-
|
|
4837
|
-
|
|
4910
|
+
if (formik && formikState) {
|
|
4911
|
+
var currencyBlur = function currencyBlur() {
|
|
4912
|
+
if (type === 'currency') {
|
|
4913
|
+
formik.setFieldValue(name, Number(value).toFixed(2));
|
|
4914
|
+
}
|
|
4838
4915
|
};
|
|
4916
|
+
|
|
4917
|
+
controllers = _extends({}, controllers, {
|
|
4918
|
+
error: error !== undefined ? controllers.error : formikState.error,
|
|
4919
|
+
value: value !== undefined ? controllers.value : formikState.value,
|
|
4920
|
+
onChange: _onChange ? controllers.onChange : function (e) {
|
|
4921
|
+
return formik.setFieldValue(name, e.target.value);
|
|
4922
|
+
},
|
|
4923
|
+
onBlur: _onBlur ? function (e) {
|
|
4924
|
+
_onBlur && _onBlur(e.target.value);
|
|
4925
|
+
formik.setFieldTouched(name);
|
|
4926
|
+
currencyBlur();
|
|
4927
|
+
} : function () {
|
|
4928
|
+
formik.setFieldTouched(name);
|
|
4929
|
+
currencyBlur();
|
|
4930
|
+
}
|
|
4931
|
+
});
|
|
4839
4932
|
}
|
|
4933
|
+
|
|
4934
|
+
return controllers;
|
|
4840
4935
|
};
|
|
4841
4936
|
|
|
4842
|
-
var
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4937
|
+
var textFieldStyles = {"text-field":"_20YOA","text-field--invalid":"_3kUSh","text-field--prefixed":"_3IU3Q","text-field--suffixed":"_QXJOD"};
|
|
4938
|
+
|
|
4939
|
+
var useTextField = function useTextField(_ref) {
|
|
4940
|
+
var _classnames;
|
|
4941
|
+
|
|
4942
|
+
var autoComplete = _ref.autoComplete,
|
|
4943
|
+
autoFocus = _ref.autoFocus,
|
|
4944
|
+
defaultValue = _ref.defaultValue,
|
|
4945
|
+
disabled = _ref.disabled,
|
|
4946
|
+
error = _ref.error,
|
|
4947
|
+
id = _ref.id,
|
|
4948
|
+
maxLength = _ref.maxLength,
|
|
4949
|
+
name = _ref.name,
|
|
4950
|
+
caption = _ref.caption,
|
|
4951
|
+
label = _ref.label,
|
|
4952
|
+
onBlur = _ref.onBlur,
|
|
4953
|
+
onChange = _ref.onChange,
|
|
4954
|
+
onFocus = _ref.onFocus,
|
|
4955
|
+
onKeyDown = _ref.onKeyDown,
|
|
4956
|
+
placeholder = _ref.placeholder,
|
|
4957
|
+
value = _ref.value,
|
|
4958
|
+
ref = _ref.ref,
|
|
4959
|
+
testId = _ref.testId;
|
|
4960
|
+
var controllers = useFieldControllers({
|
|
4961
|
+
error: error,
|
|
4962
|
+
id: id,
|
|
4963
|
+
name: name,
|
|
4964
|
+
onChange: onChange,
|
|
4965
|
+
onBlur: onBlur,
|
|
4966
|
+
onFocus: onFocus,
|
|
4967
|
+
onKeyDown: onKeyDown,
|
|
4968
|
+
value: value
|
|
4969
|
+
});
|
|
4970
|
+
var hasError = !!controllers.error;
|
|
4971
|
+
var inputProps = {
|
|
4972
|
+
'aria-describedby': hasError ? controllers.id + "-error-message" : controllers.id + "-describer",
|
|
4973
|
+
'aria-invalid': hasError,
|
|
4974
|
+
autoComplete: autoComplete,
|
|
4975
|
+
autoFocus: autoFocus,
|
|
4976
|
+
className: classnames(textFieldStyles['text-field'], (_classnames = {}, _classnames[textFieldStyles['text-field--invalid']] = hasError, _classnames)),
|
|
4977
|
+
'data-testid': testId,
|
|
4978
|
+
disabled: disabled,
|
|
4979
|
+
defaultValue: defaultValue,
|
|
4980
|
+
id: controllers.id,
|
|
4981
|
+
maxLength: maxLength,
|
|
4982
|
+
name: name,
|
|
4983
|
+
onBlur: controllers.onBlur,
|
|
4984
|
+
onChange: controllers.onChange,
|
|
4985
|
+
onFocus: controllers.onFocus,
|
|
4986
|
+
onKeyDown: controllers.onKeyDown,
|
|
4987
|
+
placeholder: placeholder,
|
|
4988
|
+
ref: ref,
|
|
4989
|
+
size: 1,
|
|
4990
|
+
type: 'text',
|
|
4991
|
+
value: controllers.value
|
|
4992
|
+
};
|
|
4993
|
+
var fieldProps = {
|
|
4994
|
+
caption: caption,
|
|
4995
|
+
error: controllers.error,
|
|
4996
|
+
label: label,
|
|
4997
|
+
id: inputProps.id,
|
|
4998
|
+
name: name
|
|
4999
|
+
};
|
|
5000
|
+
return {
|
|
5001
|
+
inputProps: inputProps,
|
|
5002
|
+
fieldProps: fieldProps
|
|
5003
|
+
};
|
|
5004
|
+
};
|
|
5005
|
+
|
|
5006
|
+
var styles$k = {"affix-container":"_ybKOk","affix-container--prefixed":"_2COk3","affix-container--suffixed":"_1xXXN","prefix":"_eX5OL","suffix":"__YH01"};
|
|
5007
|
+
|
|
5008
|
+
var AffixContainer = function AffixContainer(_ref) {
|
|
5009
|
+
var _classnames;
|
|
5010
|
+
|
|
5011
|
+
var prefix = _ref.prefix,
|
|
5012
|
+
suffix = _ref.suffix,
|
|
5013
|
+
children = _ref.children,
|
|
4854
5014
|
testId = _ref.testId;
|
|
5015
|
+
var container = useRef(null);
|
|
5016
|
+
var prefixElement = useRef(null);
|
|
5017
|
+
var suffixElement = useRef(null);
|
|
5018
|
+
var isHidden = container.current && container.current.offsetParent === null;
|
|
5019
|
+
useLayoutEffect(function () {
|
|
5020
|
+
if (container.current) {
|
|
5021
|
+
var input = container.current.querySelector('input, [class$=control] > div');
|
|
4855
5022
|
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
5023
|
+
if (input) {
|
|
5024
|
+
if (prefix && prefixElement.current) {
|
|
5025
|
+
var _prefixElement$curren;
|
|
4859
5026
|
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
current: calendarRef
|
|
4864
|
-
}, function (event) {
|
|
4865
|
-
var _anchorRef$current;
|
|
5027
|
+
var prefixWidth = prefixElement === null || prefixElement === void 0 ? void 0 : (_prefixElement$curren = prefixElement.current) === null || _prefixElement$curren === void 0 ? void 0 : _prefixElement$curren.offsetWidth;
|
|
5028
|
+
input.style.paddingLeft = prefixWidth + 'px';
|
|
5029
|
+
}
|
|
4866
5030
|
|
|
4867
|
-
|
|
4868
|
-
|
|
5031
|
+
if (suffix && suffixElement.current) {
|
|
5032
|
+
var suffixWidth = suffixElement.current.offsetWidth;
|
|
5033
|
+
input.style.paddingRight = suffixWidth + 'px';
|
|
5034
|
+
}
|
|
5035
|
+
}
|
|
4869
5036
|
}
|
|
4870
|
-
});
|
|
4871
|
-
var
|
|
4872
|
-
var
|
|
4873
|
-
from: weekRange.start,
|
|
4874
|
-
to: weekRange.end
|
|
4875
|
-
};
|
|
5037
|
+
}, [prefix, suffix, isHidden]);
|
|
5038
|
+
var hasPrefix = !!prefix;
|
|
5039
|
+
var hasSuffix = !!suffix;
|
|
4876
5040
|
|
|
4877
|
-
|
|
4878
|
-
|
|
5041
|
+
if (!hasPrefix && !hasSuffix) {
|
|
5042
|
+
return children;
|
|
5043
|
+
}
|
|
4879
5044
|
|
|
4880
|
-
|
|
4881
|
-
|
|
5045
|
+
var classes = classnames(styles$k['affix-container'], (_classnames = {}, _classnames[styles$k['affix-container--prefixed']] = hasPrefix, _classnames[styles$k['affix-container--suffixed']] = hasSuffix, _classnames));
|
|
5046
|
+
return React__default.createElement("div", {
|
|
5047
|
+
className: classes,
|
|
5048
|
+
ref: container,
|
|
5049
|
+
"data-testid": testId
|
|
5050
|
+
}, hasPrefix && React__default.createElement("div", {
|
|
5051
|
+
className: styles$k['prefix'],
|
|
5052
|
+
ref: prefixElement
|
|
5053
|
+
}, prefix), children, hasSuffix && React__default.createElement("div", {
|
|
5054
|
+
className: styles$k['suffix'],
|
|
5055
|
+
ref: suffixElement
|
|
5056
|
+
}, suffix));
|
|
5057
|
+
};
|
|
5058
|
+
|
|
5059
|
+
var TimeFieldInput = function TimeFieldInput(_ref) {
|
|
5060
|
+
var inputProps = _ref.inputProps,
|
|
5061
|
+
allOtherProps = _ref.allOtherProps,
|
|
5062
|
+
prefix = _ref.prefix,
|
|
5063
|
+
duration = _ref.duration;
|
|
5064
|
+
return React__default.createElement(AffixContainer, {
|
|
5065
|
+
prefix: prefix ? prefix : React__default.createElement(IconClock, {
|
|
5066
|
+
size: "medium",
|
|
5067
|
+
color: "grey-400"
|
|
5068
|
+
}),
|
|
5069
|
+
suffix: duration
|
|
5070
|
+
}, React__default.createElement("input", Object.assign({}, inputProps, {
|
|
5071
|
+
onBlur: function onBlur(e) {
|
|
5072
|
+
e.target.value = parseTime(e.target.value, 'g:i A');
|
|
5073
|
+
inputProps.onChange(e);
|
|
5074
|
+
inputProps.onBlur(e);
|
|
5075
|
+
},
|
|
5076
|
+
onClick: allOtherProps.onClick,
|
|
5077
|
+
onMouseEnter: allOtherProps.onMouseEnter,
|
|
5078
|
+
onMouseLeave: allOtherProps.onMouseLeave,
|
|
5079
|
+
onInput: function onInput(e) {
|
|
5080
|
+
var target = e.target;
|
|
5081
|
+
allOtherProps.onInputChange(target.value);
|
|
5082
|
+
}
|
|
5083
|
+
})));
|
|
5084
|
+
};
|
|
5085
|
+
|
|
5086
|
+
var _excluded$2g = ["placeholder", "autoComplete", "selectedTimeOption", "prefix", "startTime", "duration"];
|
|
5087
|
+
|
|
5088
|
+
var TimeFieldDropdownElement = function TimeFieldDropdownElement(_ref, ref) {
|
|
5089
|
+
var _ref$placeholder = _ref.placeholder,
|
|
5090
|
+
placeholder = _ref$placeholder === void 0 ? '9:00 AM' : _ref$placeholder,
|
|
5091
|
+
_ref$autoComplete = _ref.autoComplete,
|
|
5092
|
+
autoComplete = _ref$autoComplete === void 0 ? 'off' : _ref$autoComplete,
|
|
5093
|
+
selectedTimeOption = _ref.selectedTimeOption,
|
|
5094
|
+
prefix = _ref.prefix,
|
|
5095
|
+
duration = _ref.duration,
|
|
5096
|
+
allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2g);
|
|
5097
|
+
|
|
5098
|
+
var _useTextField = useTextField(_extends({}, allOtherProps, {
|
|
5099
|
+
placeholder: placeholder,
|
|
5100
|
+
autoComplete: autoComplete,
|
|
5101
|
+
ref: ref
|
|
5102
|
+
})),
|
|
5103
|
+
inputProps = _useTextField.inputProps,
|
|
5104
|
+
fieldProps = _useTextField.fieldProps;
|
|
5105
|
+
|
|
5106
|
+
useEffect(function () {
|
|
5107
|
+
if (selectedTimeOption) {
|
|
5108
|
+
inputProps.onChange({
|
|
5109
|
+
target: {
|
|
5110
|
+
value: selectedTimeOption
|
|
5111
|
+
}
|
|
5112
|
+
});
|
|
5113
|
+
}
|
|
5114
|
+
}, [selectedTimeOption]);
|
|
5115
|
+
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement(TimeFieldInput, {
|
|
5116
|
+
inputProps: inputProps,
|
|
5117
|
+
allOtherProps: allOtherProps,
|
|
5118
|
+
prefix: prefix,
|
|
5119
|
+
duration: duration
|
|
5120
|
+
}));
|
|
5121
|
+
};
|
|
5122
|
+
|
|
5123
|
+
var TimeFieldDropdownTrigger = forwardRef(TimeFieldDropdownElement);
|
|
5124
|
+
|
|
5125
|
+
var Dropdown = function Dropdown(_ref) {
|
|
5126
|
+
var trigger = _ref.trigger,
|
|
5127
|
+
_ref$triggersOn = _ref.triggersOn,
|
|
5128
|
+
triggersOn = _ref$triggersOn === void 0 ? DROPDOWN_TRIGGER.CLICK : _ref$triggersOn,
|
|
5129
|
+
_ref$alignment = _ref.alignment,
|
|
5130
|
+
alignment = _ref$alignment === void 0 ? DROPDOWN_ALIGNEMNT.RIGHT : _ref$alignment,
|
|
5131
|
+
width = _ref.width,
|
|
5132
|
+
maxHeight = _ref.maxHeight,
|
|
5133
|
+
testId = _ref.testId,
|
|
5134
|
+
children = _ref.children,
|
|
5135
|
+
triggerWidth = _ref.triggerWidth;
|
|
5136
|
+
|
|
5137
|
+
var _useState = useState(false),
|
|
5138
|
+
isOpen = _useState[0],
|
|
5139
|
+
setIsOpen = _useState[1];
|
|
5140
|
+
|
|
5141
|
+
var triggerRef = useRef(null);
|
|
5142
|
+
var paneRef = useRef(null);
|
|
5143
|
+
var isFocusingOverlay = useRef(false);
|
|
5144
|
+
|
|
5145
|
+
var handleToggleDropdown = function handleToggleDropdown() {
|
|
5146
|
+
return setIsOpen(!isOpen);
|
|
5147
|
+
};
|
|
5148
|
+
|
|
5149
|
+
var handleMouseClick = function handleMouseClick(e) {
|
|
5150
|
+
if (trigger.type === TimeFieldDropdownTrigger) {
|
|
5151
|
+
setIsOpen(true);
|
|
4882
5152
|
} else {
|
|
4883
|
-
|
|
5153
|
+
handleToggleDropdown();
|
|
5154
|
+
}
|
|
4884
5155
|
|
|
4885
|
-
|
|
5156
|
+
e.stopPropagation();
|
|
5157
|
+
|
|
5158
|
+
if ('onClick' in trigger.props) {
|
|
5159
|
+
trigger.props.onClick(e);
|
|
4886
5160
|
}
|
|
5161
|
+
};
|
|
4887
5162
|
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
5163
|
+
var handleMouseEnter = function handleMouseEnter(e) {
|
|
5164
|
+
if (triggersOn !== 'hover') {
|
|
5165
|
+
return;
|
|
5166
|
+
}
|
|
5167
|
+
|
|
5168
|
+
setIsOpen(true);
|
|
5169
|
+
|
|
5170
|
+
if ('onMouseEnter' in trigger.props) {
|
|
5171
|
+
trigger.props.onMouseEnter(e);
|
|
5172
|
+
}
|
|
4891
5173
|
};
|
|
4892
5174
|
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
5175
|
+
var handleFocus = function handleFocus(e) {
|
|
5176
|
+
if (triggersOn !== 'hover') {
|
|
5177
|
+
if (trigger.type === TimeFieldDropdownTrigger && !isOpen) {
|
|
5178
|
+
setIsOpen(true);
|
|
5179
|
+
}
|
|
4896
5180
|
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
}
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
5181
|
+
if ('onFocus' in trigger.props) {
|
|
5182
|
+
trigger.props.onFocus(e);
|
|
5183
|
+
}
|
|
5184
|
+
|
|
5185
|
+
return;
|
|
5186
|
+
}
|
|
5187
|
+
|
|
5188
|
+
setIsOpen(true);
|
|
5189
|
+
|
|
5190
|
+
if ('onFocus' in trigger.props) {
|
|
5191
|
+
trigger.props.onFocus(e);
|
|
5192
|
+
}
|
|
5193
|
+
};
|
|
5194
|
+
|
|
5195
|
+
var handleMouseLeave = function handleMouseLeave(e) {
|
|
5196
|
+
if (triggersOn !== 'hover' || !paneRef.current) {
|
|
5197
|
+
return;
|
|
5198
|
+
}
|
|
5199
|
+
|
|
5200
|
+
var panePosition = paneRef.current.getBoundingClientRect();
|
|
5201
|
+
|
|
5202
|
+
if (!isGoingTowardsPane(panePosition, e.clientY)) {
|
|
5203
|
+
setIsOpen(false);
|
|
5204
|
+
|
|
5205
|
+
if ('onMouseLeave' in trigger.props) {
|
|
5206
|
+
trigger.props.onMouseLeave && trigger.props.onMouseLeave(e);
|
|
5207
|
+
}
|
|
5208
|
+
}
|
|
5209
|
+
};
|
|
5210
|
+
|
|
5211
|
+
var handlePaneMouseEnter = function handlePaneMouseEnter() {
|
|
5212
|
+
isFocusingOverlay.current = true;
|
|
5213
|
+
};
|
|
5214
|
+
|
|
5215
|
+
var handlePaneMouseLeave = function handlePaneMouseLeave() {
|
|
5216
|
+
isFocusingOverlay.current = false;
|
|
5217
|
+
|
|
5218
|
+
if (triggersOn === 'hover') {
|
|
5219
|
+
setIsOpen(false);
|
|
5220
|
+
}
|
|
5221
|
+
};
|
|
5222
|
+
|
|
5223
|
+
var handleOnBlur = function handleOnBlur(e) {
|
|
5224
|
+
trigger.props.onBlur && trigger.props.onBlur(e);
|
|
5225
|
+
|
|
5226
|
+
if (!paneRef || !(paneRef !== null && paneRef !== void 0 && paneRef.current)) {
|
|
5227
|
+
return;
|
|
5228
|
+
}
|
|
5229
|
+
|
|
5230
|
+
var focusableElements = getKeyboardFocusableElements(paneRef.current);
|
|
4917
5231
|
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
5232
|
+
if (focusableElements.length > 0) {
|
|
5233
|
+
window.setTimeout(function () {
|
|
5234
|
+
return focusableElements[0].focus();
|
|
5235
|
+
}, 0);
|
|
5236
|
+
} else {
|
|
5237
|
+
setIsOpen(false);
|
|
5238
|
+
}
|
|
5239
|
+
};
|
|
5240
|
+
|
|
5241
|
+
var getRef = function getRef() {
|
|
5242
|
+
if ((trigger.type === Button$1 || trigger.type === TimeFieldDropdownTrigger) && trigger.ref) {
|
|
5243
|
+
return trigger.ref;
|
|
5244
|
+
}
|
|
5245
|
+
|
|
5246
|
+
return triggerRef;
|
|
5247
|
+
};
|
|
5248
|
+
|
|
5249
|
+
var updatedRef = getRef();
|
|
5250
|
+
var triggerProps = {
|
|
5251
|
+
onClick: handleMouseClick,
|
|
5252
|
+
onMouseEnter: handleMouseEnter,
|
|
5253
|
+
onMouseLeave: handleMouseLeave,
|
|
5254
|
+
onBlur: handleOnBlur,
|
|
5255
|
+
ref: updatedRef,
|
|
5256
|
+
style: {
|
|
5257
|
+
width: triggerWidth === 'full' ? '100%' : 'fit-content'
|
|
4921
5258
|
},
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
5259
|
+
onFocus: handleFocus
|
|
5260
|
+
};
|
|
5261
|
+
return React__default.createElement(DropdownContext.Provider, {
|
|
5262
|
+
value: {
|
|
5263
|
+
isOpen: isOpen,
|
|
5264
|
+
onToggleDropdown: handleToggleDropdown,
|
|
5265
|
+
triggerRef: updatedRef,
|
|
5266
|
+
paneRef: paneRef
|
|
5267
|
+
}
|
|
5268
|
+
}, trigger.type === Button$1 || trigger.type === TimeFieldDropdownTrigger ? React__default.cloneElement(trigger, _extends({}, trigger.props, triggerProps)) : React__default.createElement("button", Object.assign({}, triggerProps, {
|
|
5269
|
+
className: styles$g['dropdown__trigger'],
|
|
5270
|
+
ref: updatedRef,
|
|
5271
|
+
onFocus: handleFocus
|
|
5272
|
+
}), trigger), React__default.createElement(DropdownPane, {
|
|
5273
|
+
width: width,
|
|
5274
|
+
maxHeight: maxHeight,
|
|
5275
|
+
onMouseEnter: handlePaneMouseEnter,
|
|
5276
|
+
onMouseLeave: handlePaneMouseLeave,
|
|
5277
|
+
alignment: alignment,
|
|
5278
|
+
testId: testId
|
|
5279
|
+
}, children));
|
|
4933
5280
|
};
|
|
4934
5281
|
|
|
4935
|
-
var styles$
|
|
5282
|
+
var styles$l = {"dropdown-list":"_1v1df","dropdown-list__item--hover":"_eAjpa"};
|
|
4936
5283
|
|
|
4937
5284
|
var findNextActiveIndex = function findNextActiveIndex(items, startAt) {
|
|
4938
5285
|
var startIndex = 0;
|
|
@@ -5042,17 +5389,17 @@ var useListKeyboardNavigation = function useListKeyboardNavigation(listItems, ac
|
|
|
5042
5389
|
};
|
|
5043
5390
|
};
|
|
5044
5391
|
|
|
5045
|
-
var styles$
|
|
5392
|
+
var styles$m = {"dropdown-list-divider":"_3x1F6"};
|
|
5046
5393
|
|
|
5047
5394
|
var DropdownListDivider = function DropdownListDivider(_ref) {
|
|
5048
5395
|
var testId = _ref.testId;
|
|
5049
5396
|
return React__default.createElement("div", {
|
|
5050
|
-
className: styles$
|
|
5397
|
+
className: styles$m['dropdown-list-divider'],
|
|
5051
5398
|
"data-testid": testId
|
|
5052
5399
|
});
|
|
5053
5400
|
};
|
|
5054
5401
|
|
|
5055
|
-
var styles$
|
|
5402
|
+
var styles$n = {"dropdown-list-item":"_B3_I5","dropdown-list-item--selected":"_1mr1h","dropdown-list-item__content":"_2b7Fg","dropdown-list-item--disabled":"_2l0Cb"};
|
|
5056
5403
|
|
|
5057
5404
|
var TEXT_TYPES = {
|
|
5058
5405
|
CAPTION: 'caption',
|
|
@@ -5077,9 +5424,9 @@ var ALIGNMENTS = {
|
|
|
5077
5424
|
JUSTIFY: 'justify'
|
|
5078
5425
|
};
|
|
5079
5426
|
|
|
5080
|
-
var styles$
|
|
5427
|
+
var styles$o = {"text":"_3CIA3","text__body":"_1nnj8","text__caption":"_37K6o","text__insight":"_avqxy","text--bold":"_2TG6E","text--italic":"_2hlsn","text--underline":"_1Pjo6","text--monospace":"_eDdDI","text--align-left":"_2gNwS","text--align-right":"_ufv1W","text--align-center":"_2WMN6","text--align-justify":"_2iH-J"};
|
|
5081
5428
|
|
|
5082
|
-
var _excluded$
|
|
5429
|
+
var _excluded$2h = ["children", "as", "emphasis", "alignment", "color", "testId"];
|
|
5083
5430
|
|
|
5084
5431
|
var Text = function Text(_ref) {
|
|
5085
5432
|
var _classnames;
|
|
@@ -5091,14 +5438,14 @@ var Text = function Text(_ref) {
|
|
|
5091
5438
|
alignment = _ref.alignment,
|
|
5092
5439
|
color = _ref.color,
|
|
5093
5440
|
testId = _ref.testId,
|
|
5094
|
-
positionProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
5441
|
+
positionProps = _objectWithoutPropertiesLoose(_ref, _excluded$2h);
|
|
5095
5442
|
|
|
5096
5443
|
var positionStyles = usePositionStyles(positionProps);
|
|
5097
5444
|
var elementProps = {
|
|
5098
5445
|
style: _extends({
|
|
5099
|
-
color: color
|
|
5446
|
+
color: getColor(color)
|
|
5100
5447
|
}, positionStyles),
|
|
5101
|
-
className: classnames(styles$
|
|
5448
|
+
className: classnames(styles$o['text'], (_classnames = {}, _classnames[styles$o['text--bold']] = emphasis === null || emphasis === void 0 ? void 0 : emphasis.includes(FONT_EMPHASIS.BOLD), _classnames[styles$o['text--italic']] = emphasis === null || emphasis === void 0 ? void 0 : emphasis.includes(FONT_EMPHASIS.ITALIC), _classnames[styles$o['text--underline']] = emphasis === null || emphasis === void 0 ? void 0 : emphasis.includes(FONT_EMPHASIS.UNDERLINE), _classnames[styles$o['text--monospace']] = emphasis === null || emphasis === void 0 ? void 0 : emphasis.includes(FONT_EMPHASIS.MONOSPACE), _classnames[styles$o['text--align-left']] = alignment === ALIGNMENTS.LEFT, _classnames[styles$o['text--align-right']] = alignment === ALIGNMENTS.RIGHT, _classnames[styles$o['text--align-center']] = alignment === ALIGNMENTS.CENTER, _classnames[styles$o['text--align-justify']] = alignment === ALIGNMENTS.JUSTIFY, _classnames[styles$o['text__body']] = as === TEXT_TYPES.BODY, _classnames[styles$o['text__insight']] = as === TEXT_TYPES.INSIGHT, _classnames[styles$o['text__caption']] = as === TEXT_TYPES.CAPTION, _classnames)),
|
|
5102
5449
|
'data-testid': testId
|
|
5103
5450
|
};
|
|
5104
5451
|
var pTypes = [TEXT_TYPES.BODY, TEXT_TYPES.CAPTION, TEXT_TYPES.INSIGHT];
|
|
@@ -5109,37 +5456,24 @@ var Text = function Text(_ref) {
|
|
|
5109
5456
|
var Bold = function Bold(_ref) {
|
|
5110
5457
|
var children = _ref.children;
|
|
5111
5458
|
return React__default.createElement("span", {
|
|
5112
|
-
className: classnames(styles$
|
|
5459
|
+
className: classnames(styles$o['text--bold'], styles$o['text'])
|
|
5113
5460
|
}, children);
|
|
5114
5461
|
};
|
|
5115
5462
|
|
|
5116
5463
|
var Underline = function Underline(_ref) {
|
|
5117
5464
|
var children = _ref.children;
|
|
5118
5465
|
return React__default.createElement("span", {
|
|
5119
|
-
className: classnames(styles$
|
|
5466
|
+
className: classnames(styles$o['text--underline'], styles$o['text'])
|
|
5120
5467
|
}, children);
|
|
5121
5468
|
};
|
|
5122
5469
|
|
|
5123
5470
|
var Italic = function Italic(_ref) {
|
|
5124
5471
|
var children = _ref.children;
|
|
5125
5472
|
return React__default.createElement("span", {
|
|
5126
|
-
className: classnames(styles$
|
|
5473
|
+
className: classnames(styles$o['text--italic'], styles$o['text'])
|
|
5127
5474
|
}, children);
|
|
5128
5475
|
};
|
|
5129
5476
|
|
|
5130
|
-
var WHITE = '#ffffff';
|
|
5131
|
-
var EGGPLANT200 = '#d3dbf4';
|
|
5132
|
-
var EGGPLANT300 = '#a7b7ea';
|
|
5133
|
-
var EGGPLANT400 = '#6d87dd';
|
|
5134
|
-
var EGGPLANT500 = '#6179c6';
|
|
5135
|
-
var EGGPLANT600 = '#415184';
|
|
5136
|
-
var RADISH400 = '#e76767';
|
|
5137
|
-
var GREY100 = '#F3F3F3';
|
|
5138
|
-
var GREY200 = '#D5D5D5';
|
|
5139
|
-
var GREY300 = '#949494';
|
|
5140
|
-
var GREY400 = '#767676';
|
|
5141
|
-
var GREY500 = '#464646';
|
|
5142
|
-
|
|
5143
5477
|
var DropdownListItem = function DropdownListItem(_ref) {
|
|
5144
5478
|
var _classNames;
|
|
5145
5479
|
|
|
@@ -5168,18 +5502,18 @@ var DropdownListItem = function DropdownListItem(_ref) {
|
|
|
5168
5502
|
|
|
5169
5503
|
var getCaptionColor = function getCaptionColor() {
|
|
5170
5504
|
if (selected) {
|
|
5171
|
-
return
|
|
5505
|
+
return 'eggplant-500';
|
|
5172
5506
|
}
|
|
5173
5507
|
|
|
5174
5508
|
if (disabled) {
|
|
5175
|
-
return
|
|
5509
|
+
return 'grey-400';
|
|
5176
5510
|
}
|
|
5177
5511
|
|
|
5178
5512
|
return undefined;
|
|
5179
5513
|
};
|
|
5180
5514
|
|
|
5181
5515
|
return React__default.createElement("li", {
|
|
5182
|
-
className: classnames(styles$
|
|
5516
|
+
className: classnames(styles$n['dropdown-list-item'], (_classNames = {}, _classNames[styles$n['dropdown-list-item--selected']] = selected, _classNames[styles$n['dropdown-list-item--disabled']] = disabled, _classNames)),
|
|
5183
5517
|
onMouseDown: function onMouseDown(e) {
|
|
5184
5518
|
return e.preventDefault();
|
|
5185
5519
|
},
|
|
@@ -5188,7 +5522,7 @@ var DropdownListItem = function DropdownListItem(_ref) {
|
|
|
5188
5522
|
role: "menuitem",
|
|
5189
5523
|
"data-testid": testId
|
|
5190
5524
|
}, prefix, React__default.createElement("div", {
|
|
5191
|
-
className: styles$
|
|
5525
|
+
className: styles$n['dropdown-list-item__content']
|
|
5192
5526
|
}, React__default.createElement(Stack, {
|
|
5193
5527
|
space: 4,
|
|
5194
5528
|
flex: [1]
|
|
@@ -5280,7 +5614,7 @@ var DropdownList = function DropdownList(_ref) {
|
|
|
5280
5614
|
}
|
|
5281
5615
|
}, [highlightItemIndex]);
|
|
5282
5616
|
return React__default.createElement("ul", {
|
|
5283
|
-
className: styles$
|
|
5617
|
+
className: styles$l['dropdown-list'],
|
|
5284
5618
|
"data-testid": testId,
|
|
5285
5619
|
ref: listRef
|
|
5286
5620
|
}, React__default.Children.map(children, function (child, index) {
|
|
@@ -5288,7 +5622,7 @@ var DropdownList = function DropdownList(_ref) {
|
|
|
5288
5622
|
|
|
5289
5623
|
return React__default.createElement("div", {
|
|
5290
5624
|
key: index,
|
|
5291
|
-
className: classnames(styles$
|
|
5625
|
+
className: classnames(styles$l['dropdown-list__item'], (_classNames = {}, _classNames[styles$l['dropdown-list__item--hover']] = focusedItem === index, _classNames)),
|
|
5292
5626
|
onMouseEnter: function onMouseEnter() {
|
|
5293
5627
|
return setFocusOnItem(index);
|
|
5294
5628
|
}
|
|
@@ -5296,537 +5630,438 @@ var DropdownList = function DropdownList(_ref) {
|
|
|
5296
5630
|
}));
|
|
5297
5631
|
};
|
|
5298
5632
|
|
|
5299
|
-
var
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
var isHidden = labelElement && labelElement.offsetParent === null;
|
|
5313
|
-
var handleApplyTooltip = useCallback(function () {
|
|
5314
|
-
if (!shouldTruncate) {
|
|
5315
|
-
return;
|
|
5316
|
-
}
|
|
5317
|
-
|
|
5318
|
-
var labelElement = document.getElementById(labelId);
|
|
5319
|
-
|
|
5320
|
-
if (!labelElement) {
|
|
5321
|
-
return;
|
|
5322
|
-
}
|
|
5323
|
-
|
|
5324
|
-
var shouldShowTooltip = isEllipsisActive(labelElement);
|
|
5325
|
-
|
|
5326
|
-
if (showTooltip !== shouldShowTooltip) {
|
|
5327
|
-
setShowTooltip(shouldShowTooltip);
|
|
5328
|
-
}
|
|
5329
|
-
}, [shouldTruncate, isHidden]);
|
|
5330
|
-
useEffect(function () {
|
|
5331
|
-
var onWindowResize = debounce(handleApplyTooltip, 300);
|
|
5332
|
-
window.addEventListener('resize', onWindowResize);
|
|
5333
|
-
return function () {
|
|
5334
|
-
return window.removeEventListener('resize', onWindowResize);
|
|
5335
|
-
};
|
|
5336
|
-
}, [handleApplyTooltip]);
|
|
5337
|
-
useLayoutEffect(handleApplyTooltip, [handleApplyTooltip]);
|
|
5338
|
-
return {
|
|
5339
|
-
showTooltip: showTooltip,
|
|
5340
|
-
shouldTruncate: shouldTruncate
|
|
5341
|
-
};
|
|
5633
|
+
var KebabMenu = function KebabMenu(_ref) {
|
|
5634
|
+
var actions = _ref.actions;
|
|
5635
|
+
return React__default.createElement(Dropdown, {
|
|
5636
|
+
trigger: React__default.createElement(Button$1, {
|
|
5637
|
+
theme: "link-icon"
|
|
5638
|
+
}, React__default.createElement(IconEllipsisV, null)),
|
|
5639
|
+
alignment: "right"
|
|
5640
|
+
}, React__default.createElement(DropdownList, null, actions.map(function (action) {
|
|
5641
|
+
return !action.hidden && React__default.createElement(DropdownListItem, {
|
|
5642
|
+
onClick: action.onAction,
|
|
5643
|
+
key: action.action
|
|
5644
|
+
}, action.label);
|
|
5645
|
+
})));
|
|
5342
5646
|
};
|
|
5343
5647
|
|
|
5344
|
-
var
|
|
5345
|
-
var _classNames;
|
|
5648
|
+
var styles$p = {"data-table-cell":"_SpJZY","data-table-cell--no-padding":"_3R9X2","data-table-cell--vertical-border":"_6CjWl","data-table-cell--invalid":"_tvnPS","data-table-cell__content":"_2D9Do","data-table-cell__content--right-align":"_1HyJe","data-table-cell__content--with-error":"_3tEcf","data-table-cell__error-icon":"_2ctV2","data-table-cell__error-icon--right-align":"_2QAov","data-table-cell__error-icon--left-align":"_AzpZE"};
|
|
5346
5649
|
|
|
5347
|
-
|
|
5348
|
-
children = _ref.children,
|
|
5349
|
-
_ref$truncate = _ref.truncate,
|
|
5350
|
-
truncate = _ref$truncate === void 0 ? true : _ref$truncate;
|
|
5351
|
-
var labelId = "label-" + htmlFor;
|
|
5650
|
+
var styles$q = {"overlay":"_2puqJ","overlay--after-open":"_1167h","overlay--before-close":"_t_t7L","content":"_wQQ_2","content--after-open":"_3jwux","content--before-close":"_2c2QP"};
|
|
5352
5651
|
|
|
5353
|
-
|
|
5354
|
-
showTooltip = _useLabelTooltip.showTooltip,
|
|
5355
|
-
shouldTruncate = _useLabelTooltip.shouldTruncate;
|
|
5652
|
+
var styles$r = {"header":"_36nxW","header__close-button":"_2zYre","sub-header":"_2XwRD"};
|
|
5356
5653
|
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5654
|
+
var ModalHeader = function ModalHeader(_ref) {
|
|
5655
|
+
var header = _ref.header,
|
|
5656
|
+
subHeader = _ref.subHeader,
|
|
5657
|
+
onClose = _ref.onClose,
|
|
5658
|
+
loading = _ref.loading;
|
|
5362
5659
|
|
|
5363
|
-
if (
|
|
5364
|
-
return React__default.createElement(
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
5660
|
+
if (!header && !subHeader) {
|
|
5661
|
+
return onClose ? React__default.createElement("div", {
|
|
5662
|
+
className: styles$r['header__close-button']
|
|
5663
|
+
}, React__default.createElement(Button$1, {
|
|
5664
|
+
theme: "link-icon",
|
|
5665
|
+
onClick: onClose,
|
|
5666
|
+
disabled: loading
|
|
5667
|
+
}, React__default.createElement(IconTimes, null))) : null;
|
|
5368
5668
|
}
|
|
5369
5669
|
|
|
5370
|
-
return
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
var styles$o = {"caption":"_1DWBq"};
|
|
5374
|
-
|
|
5375
|
-
var Caption = function Caption(_ref) {
|
|
5376
|
-
var fieldId = _ref.fieldId,
|
|
5377
|
-
children = _ref.children;
|
|
5378
|
-
return React__default.createElement("div", {
|
|
5379
|
-
id: fieldId && fieldId + "-describer",
|
|
5380
|
-
className: styles$o['caption']
|
|
5381
|
-
}, children);
|
|
5382
|
-
};
|
|
5383
|
-
|
|
5384
|
-
var styles$p = {"error-message":"_nZ2MD"};
|
|
5385
|
-
|
|
5386
|
-
var ErrorMessage = function ErrorMessage(_ref) {
|
|
5387
|
-
var fieldId = _ref.fieldId,
|
|
5388
|
-
children = _ref.children,
|
|
5389
|
-
testId = _ref.testId;
|
|
5390
|
-
return React__default.createElement("div", {
|
|
5391
|
-
id: fieldId && fieldId + "-error-message",
|
|
5392
|
-
className: styles$p['error-message'],
|
|
5393
|
-
"data-testid": testId
|
|
5670
|
+
return React__default.createElement(Stack, {
|
|
5671
|
+
space: 12,
|
|
5672
|
+
marginBottom: 24
|
|
5394
5673
|
}, React__default.createElement(Inline, {
|
|
5395
|
-
|
|
5674
|
+
flex: [1],
|
|
5396
5675
|
alignItems: "center"
|
|
5397
|
-
}, React__default.createElement(
|
|
5398
|
-
|
|
5399
|
-
|
|
5400
|
-
|
|
5676
|
+
}, React__default.createElement("span", {
|
|
5677
|
+
className: styles$r['header']
|
|
5678
|
+
}, header), onClose && React__default.createElement(Button$1, {
|
|
5679
|
+
theme: "link-icon",
|
|
5680
|
+
onClick: onClose,
|
|
5681
|
+
disabled: loading
|
|
5682
|
+
}, React__default.createElement(IconTimes, null))), subHeader && React__default.createElement("div", {
|
|
5683
|
+
className: styles$r['sub-header']
|
|
5684
|
+
}, subHeader));
|
|
5401
5685
|
};
|
|
5402
5686
|
|
|
5403
|
-
var
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
var shouldRenderLabel = label || typeof label === 'string';
|
|
5410
|
-
return React__default.createElement(Stack, {
|
|
5411
|
-
space: 8,
|
|
5412
|
-
flexItems: true
|
|
5413
|
-
}, shouldRenderLabel && React__default.createElement(Label, {
|
|
5414
|
-
htmlFor: id
|
|
5415
|
-
}, label), children, caption && React__default.createElement(Caption, {
|
|
5416
|
-
fieldId: id
|
|
5417
|
-
}, caption), error && React__default.createElement(ErrorMessage, {
|
|
5418
|
-
fieldId: id
|
|
5419
|
-
}, error));
|
|
5687
|
+
var ModalContext = createContext({
|
|
5688
|
+
isModalMounted: false
|
|
5689
|
+
});
|
|
5690
|
+
var useModalContext = function useModalContext() {
|
|
5691
|
+
var context = useContext(ModalContext);
|
|
5692
|
+
return context || {};
|
|
5420
5693
|
};
|
|
5421
5694
|
|
|
5422
|
-
var
|
|
5423
|
-
var
|
|
5424
|
-
|
|
5425
|
-
|
|
5695
|
+
var Modal = function Modal(_ref) {
|
|
5696
|
+
var children = _ref.children,
|
|
5697
|
+
header = _ref.header,
|
|
5698
|
+
subHeader = _ref.subHeader,
|
|
5699
|
+
onClose = _ref.onClose,
|
|
5700
|
+
loading = _ref.loading,
|
|
5701
|
+
_ref$zIndex = _ref.zIndex,
|
|
5702
|
+
zIndex = _ref$zIndex === void 0 ? Z_INDEX_LAYERS.MODAL : _ref$zIndex,
|
|
5703
|
+
rootElementId = _ref.rootElementId,
|
|
5704
|
+
_ref$width = _ref.width,
|
|
5705
|
+
width = _ref$width === void 0 ? 500 : _ref$width,
|
|
5706
|
+
height = _ref.height,
|
|
5707
|
+
maxWidth = _ref.maxWidth,
|
|
5708
|
+
_ref$shouldReturnFocu = _ref.shouldReturnFocusAfterClose,
|
|
5709
|
+
shouldReturnFocusAfterClose = _ref$shouldReturnFocu === void 0 ? true : _ref$shouldReturnFocu,
|
|
5710
|
+
testId = _ref.testId;
|
|
5711
|
+
var style = {
|
|
5712
|
+
content: {
|
|
5713
|
+
width: width,
|
|
5714
|
+
height: height,
|
|
5715
|
+
maxWidth: maxWidth
|
|
5716
|
+
},
|
|
5717
|
+
overlay: {
|
|
5718
|
+
zIndex: zIndex
|
|
5719
|
+
}
|
|
5720
|
+
};
|
|
5721
|
+
return React__default.createElement(ReactModal, {
|
|
5722
|
+
isOpen: true,
|
|
5723
|
+
testId: testId,
|
|
5724
|
+
shouldCloseOnEsc: true,
|
|
5725
|
+
shouldCloseOnOverlayClick: false,
|
|
5726
|
+
shouldReturnFocusAfterClose: shouldReturnFocusAfterClose,
|
|
5727
|
+
onRequestClose: onClose && !loading ? onClose : undefined,
|
|
5728
|
+
style: style,
|
|
5729
|
+
closeTimeoutMS: 200,
|
|
5730
|
+
contentLabel: "Modal",
|
|
5731
|
+
appElement: rootElementId && document.getElementById(rootElementId) || undefined,
|
|
5732
|
+
overlayClassName: {
|
|
5733
|
+
base: styles$q['overlay'],
|
|
5734
|
+
afterOpen: styles$q['overlay--after-open'],
|
|
5735
|
+
beforeClose: styles$q['overlay--before-close']
|
|
5736
|
+
},
|
|
5737
|
+
className: {
|
|
5738
|
+
base: styles$q['content'],
|
|
5739
|
+
afterOpen: styles$q['content--after-open'],
|
|
5740
|
+
beforeClose: styles$q['content--before-close']
|
|
5741
|
+
}
|
|
5742
|
+
}, React__default.createElement(ModalHeader, {
|
|
5743
|
+
header: header,
|
|
5744
|
+
subHeader: subHeader,
|
|
5745
|
+
onClose: onClose,
|
|
5746
|
+
loading: loading
|
|
5747
|
+
}), React__default.createElement(ModalContext.Provider, {
|
|
5748
|
+
value: {
|
|
5749
|
+
isModalMounted: true
|
|
5750
|
+
}
|
|
5751
|
+
}, children));
|
|
5426
5752
|
};
|
|
5427
5753
|
|
|
5428
|
-
|
|
5429
|
-
|
|
5430
|
-
inputId = _ref.id;
|
|
5431
|
-
var id = useMemo(function () {
|
|
5432
|
-
return inputId ? inputId : name + "-" + Math.random();
|
|
5433
|
-
}, [inputId, name]);
|
|
5434
|
-
return id;
|
|
5754
|
+
Modal.setAppElement = function (rootElement) {
|
|
5755
|
+
ReactModal.setAppElement(rootElement);
|
|
5435
5756
|
};
|
|
5436
5757
|
|
|
5437
|
-
var
|
|
5438
|
-
|
|
5439
|
-
|
|
5440
|
-
}
|
|
5758
|
+
var THRESHOLD = 20;
|
|
5759
|
+
var useScrollShadow = function useScrollShadow() {
|
|
5760
|
+
var ref = useRef(null);
|
|
5441
5761
|
|
|
5442
|
-
var
|
|
5762
|
+
var _useState = useState(false),
|
|
5763
|
+
showScrollShadow = _useState[0],
|
|
5764
|
+
setShowScrollShadow = _useState[1];
|
|
5443
5765
|
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5766
|
+
useEffect(function () {
|
|
5767
|
+
if (!ref.current) {
|
|
5768
|
+
return;
|
|
5769
|
+
}
|
|
5447
5770
|
|
|
5448
|
-
|
|
5449
|
-
var _acc$touched, _acc$error, _acc$value;
|
|
5771
|
+
var modalBody = ref.current;
|
|
5450
5772
|
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
};
|
|
5456
|
-
}, {
|
|
5457
|
-
touched: formik.touched,
|
|
5458
|
-
error: formik.errors,
|
|
5459
|
-
value: formik.values
|
|
5460
|
-
});
|
|
5773
|
+
if (modalBody.offsetHeight > THRESHOLD) {
|
|
5774
|
+
setShowScrollShadow(true);
|
|
5775
|
+
}
|
|
5776
|
+
}, []);
|
|
5461
5777
|
return {
|
|
5462
|
-
|
|
5463
|
-
|
|
5778
|
+
ref: ref,
|
|
5779
|
+
showScrollShadow: showScrollShadow
|
|
5464
5780
|
};
|
|
5465
5781
|
};
|
|
5466
|
-
var getFormikArrayPath = function getFormikArrayPath(name) {
|
|
5467
|
-
return name.split(/[^a-zA-Z0-9]/).filter(Boolean);
|
|
5468
|
-
};
|
|
5469
|
-
|
|
5470
|
-
var useFieldControllers = function useFieldControllers(_ref) {
|
|
5471
|
-
var name = _ref.name,
|
|
5472
|
-
inputId = _ref.id,
|
|
5473
|
-
value = _ref.value,
|
|
5474
|
-
_onChange = _ref.onChange,
|
|
5475
|
-
_onBlur = _ref.onBlur,
|
|
5476
|
-
_onFocus = _ref.onFocus,
|
|
5477
|
-
_onKeyDown = _ref.onKeyDown,
|
|
5478
|
-
error = _ref.error,
|
|
5479
|
-
_ref$type = _ref.type,
|
|
5480
|
-
type = _ref$type === void 0 ? 'text' : _ref$type;
|
|
5481
5782
|
|
|
5482
|
-
|
|
5483
|
-
formik = _useFormContext.formik;
|
|
5783
|
+
var styles$s = {"modal-body":"_2J-ku","modal-body--with-scroll-shadow":"_2ErCP"};
|
|
5484
5784
|
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
id: inputId
|
|
5488
|
-
});
|
|
5489
|
-
var controllers = {
|
|
5490
|
-
id: id,
|
|
5491
|
-
error: error,
|
|
5492
|
-
value: value,
|
|
5493
|
-
onChange: function onChange(e) {
|
|
5494
|
-
return _onChange && _onChange(e.target.value);
|
|
5495
|
-
},
|
|
5496
|
-
onBlur: function onBlur(e) {
|
|
5497
|
-
return _onBlur && _onBlur(e.target.value);
|
|
5498
|
-
},
|
|
5499
|
-
onFocus: function onFocus(e) {
|
|
5500
|
-
return _onFocus && _onFocus(e.target.value);
|
|
5501
|
-
},
|
|
5502
|
-
onKeyDown: function onKeyDown(e) {
|
|
5503
|
-
return _onKeyDown && _onKeyDown(e.key);
|
|
5504
|
-
}
|
|
5505
|
-
};
|
|
5506
|
-
var formikState = getFormikState(name, formik);
|
|
5785
|
+
var ModalBody = function ModalBody(_ref) {
|
|
5786
|
+
var _classNames;
|
|
5507
5787
|
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
if (type === 'currency') {
|
|
5511
|
-
formik.setFieldValue(name, Number(value).toFixed(2));
|
|
5512
|
-
}
|
|
5513
|
-
};
|
|
5788
|
+
var children = _ref.children,
|
|
5789
|
+
testId = _ref.testId;
|
|
5514
5790
|
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
onChange: _onChange ? controllers.onChange : function (e) {
|
|
5519
|
-
return formik.setFieldValue(name, e.target.value);
|
|
5520
|
-
},
|
|
5521
|
-
onBlur: _onBlur ? function (e) {
|
|
5522
|
-
_onBlur && _onBlur(e.target.value);
|
|
5523
|
-
formik.setFieldTouched(name);
|
|
5524
|
-
currencyBlur();
|
|
5525
|
-
} : function () {
|
|
5526
|
-
formik.setFieldTouched(name);
|
|
5527
|
-
currencyBlur();
|
|
5528
|
-
}
|
|
5529
|
-
});
|
|
5530
|
-
}
|
|
5791
|
+
var _useScrollShadow = useScrollShadow(),
|
|
5792
|
+
ref = _useScrollShadow.ref,
|
|
5793
|
+
showScrollShadow = _useScrollShadow.showScrollShadow;
|
|
5531
5794
|
|
|
5532
|
-
return
|
|
5795
|
+
return React__default.createElement("div", {
|
|
5796
|
+
className: classnames(styles$s['modal-body'], (_classNames = {}, _classNames[styles$s['modal-body--with-scroll-shadow']] = showScrollShadow, _classNames)),
|
|
5797
|
+
ref: ref,
|
|
5798
|
+
"data-testid": testId
|
|
5799
|
+
}, children);
|
|
5533
5800
|
};
|
|
5534
5801
|
|
|
5535
|
-
var
|
|
5802
|
+
var styles$t = {"modal-footer":"_LKOr5","tertiary-container":"_Qktd-"};
|
|
5536
5803
|
|
|
5537
|
-
var
|
|
5538
|
-
|
|
5804
|
+
var updateButtonProps = function updateButtonProps(button, newProps) {
|
|
5805
|
+
if (!button) {
|
|
5806
|
+
return null;
|
|
5807
|
+
}
|
|
5539
5808
|
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
disabled = _ref.disabled,
|
|
5544
|
-
error = _ref.error,
|
|
5545
|
-
id = _ref.id,
|
|
5546
|
-
maxLength = _ref.maxLength,
|
|
5547
|
-
name = _ref.name,
|
|
5548
|
-
caption = _ref.caption,
|
|
5549
|
-
label = _ref.label,
|
|
5550
|
-
onBlur = _ref.onBlur,
|
|
5551
|
-
onChange = _ref.onChange,
|
|
5552
|
-
onFocus = _ref.onFocus,
|
|
5553
|
-
onKeyDown = _ref.onKeyDown,
|
|
5554
|
-
placeholder = _ref.placeholder,
|
|
5555
|
-
value = _ref.value,
|
|
5556
|
-
ref = _ref.ref,
|
|
5557
|
-
testId = _ref.testId;
|
|
5558
|
-
var controllers = useFieldControllers({
|
|
5559
|
-
error: error,
|
|
5560
|
-
id: id,
|
|
5561
|
-
name: name,
|
|
5562
|
-
onChange: onChange,
|
|
5563
|
-
onBlur: onBlur,
|
|
5564
|
-
onFocus: onFocus,
|
|
5565
|
-
onKeyDown: onKeyDown,
|
|
5566
|
-
value: value
|
|
5567
|
-
});
|
|
5568
|
-
var hasError = !!controllers.error;
|
|
5569
|
-
var inputProps = {
|
|
5570
|
-
'aria-describedby': hasError ? controllers.id + "-error-message" : controllers.id + "-describer",
|
|
5571
|
-
'aria-invalid': hasError,
|
|
5572
|
-
autoComplete: autoComplete,
|
|
5573
|
-
autoFocus: autoFocus,
|
|
5574
|
-
className: classnames(textFieldStyles['text-field'], (_classnames = {}, _classnames[textFieldStyles['text-field--invalid']] = hasError, _classnames)),
|
|
5575
|
-
'data-testid': testId,
|
|
5576
|
-
disabled: disabled,
|
|
5577
|
-
defaultValue: defaultValue,
|
|
5578
|
-
id: controllers.id,
|
|
5579
|
-
maxLength: maxLength,
|
|
5580
|
-
name: name,
|
|
5581
|
-
onBlur: controllers.onBlur,
|
|
5582
|
-
onChange: controllers.onChange,
|
|
5583
|
-
onFocus: controllers.onFocus,
|
|
5584
|
-
onKeyDown: controllers.onKeyDown,
|
|
5585
|
-
placeholder: placeholder,
|
|
5586
|
-
ref: ref,
|
|
5587
|
-
size: 1,
|
|
5588
|
-
type: 'text',
|
|
5589
|
-
value: controllers.value
|
|
5590
|
-
};
|
|
5591
|
-
var fieldProps = {
|
|
5592
|
-
caption: caption,
|
|
5593
|
-
error: controllers.error,
|
|
5594
|
-
label: label,
|
|
5595
|
-
id: inputProps.id,
|
|
5596
|
-
name: name
|
|
5597
|
-
};
|
|
5598
|
-
return {
|
|
5599
|
-
inputProps: inputProps,
|
|
5600
|
-
fieldProps: fieldProps
|
|
5601
|
-
};
|
|
5602
|
-
};
|
|
5809
|
+
if (button.type !== Button$1) {
|
|
5810
|
+
return button;
|
|
5811
|
+
}
|
|
5603
5812
|
|
|
5604
|
-
|
|
5605
|
-
var inputProps = _ref.inputProps,
|
|
5606
|
-
allOtherProps = _ref.allOtherProps;
|
|
5607
|
-
return React__default.createElement("input", Object.assign({}, inputProps, {
|
|
5608
|
-
onBlur: function onBlur(e) {
|
|
5609
|
-
e.target.value = parseTime(e.target.value, 'g:i A');
|
|
5610
|
-
inputProps.onChange(e);
|
|
5611
|
-
inputProps.onBlur(e);
|
|
5612
|
-
},
|
|
5613
|
-
onClick: allOtherProps.onClick,
|
|
5614
|
-
onMouseEnter: allOtherProps.onMouseEnter,
|
|
5615
|
-
onMouseLeave: allOtherProps.onMouseLeave,
|
|
5616
|
-
onInput: function onInput(e) {
|
|
5617
|
-
var target = e.target;
|
|
5618
|
-
allOtherProps.onInputChange(target.value);
|
|
5619
|
-
}
|
|
5620
|
-
}));
|
|
5813
|
+
return React__default.cloneElement(button, _extends({}, newProps));
|
|
5621
5814
|
};
|
|
5622
5815
|
|
|
5623
|
-
var
|
|
5816
|
+
var ModalFooter = function ModalFooter(_ref) {
|
|
5817
|
+
var children = _ref.children,
|
|
5818
|
+
actions = _ref.actions,
|
|
5819
|
+
testId = _ref.testId;
|
|
5624
5820
|
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
placeholder = _ref$placeholder === void 0 ? '9:00 AM' : _ref$placeholder,
|
|
5628
|
-
_ref$autoComplete = _ref.autoComplete,
|
|
5629
|
-
autoComplete = _ref$autoComplete === void 0 ? 'off' : _ref$autoComplete,
|
|
5630
|
-
selectedTimeOption = _ref.selectedTimeOption,
|
|
5631
|
-
allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2h);
|
|
5821
|
+
if (actions) {
|
|
5822
|
+
var _actions$primary, _actions$secondary, _actions$tertiary, _classnames;
|
|
5632
5823
|
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5824
|
+
var primaryButton = updateButtonProps(actions.primary, {
|
|
5825
|
+
theme: (actions === null || actions === void 0 ? void 0 : (_actions$primary = actions.primary) === null || _actions$primary === void 0 ? void 0 : _actions$primary.props.theme) || 'primary',
|
|
5826
|
+
size: BUTTON_SIZES.MIN_WIDTH_100
|
|
5827
|
+
});
|
|
5828
|
+
var secondaryButton = updateButtonProps(actions.secondary, {
|
|
5829
|
+
theme: (actions === null || actions === void 0 ? void 0 : (_actions$secondary = actions.secondary) === null || _actions$secondary === void 0 ? void 0 : _actions$secondary.props.theme) || 'default',
|
|
5830
|
+
size: BUTTON_SIZES.MIN_WIDTH_100
|
|
5831
|
+
});
|
|
5832
|
+
var tertiaryButton = updateButtonProps(actions.tertiary, {
|
|
5833
|
+
theme: (actions === null || actions === void 0 ? void 0 : (_actions$tertiary = actions.tertiary) === null || _actions$tertiary === void 0 ? void 0 : _actions$tertiary.props.theme) || 'link-primary',
|
|
5834
|
+
size: BUTTON_SIZES.MIN_WIDTH_100
|
|
5835
|
+
});
|
|
5836
|
+
return React__default.createElement(FooterContainer, {
|
|
5837
|
+
testId: testId
|
|
5838
|
+
}, React__default.createElement(Inline, {
|
|
5839
|
+
justifyContent: "space-between"
|
|
5840
|
+
}, React__default.createElement("div", {
|
|
5841
|
+
className: classnames((_classnames = {}, _classnames[styles$t['tertiary-container']] = tertiaryButton && tertiaryButton.props.theme.startsWith('link'), _classnames))
|
|
5842
|
+
}, tertiaryButton || React__default.createElement("div", null)), React__default.createElement(Inline, {
|
|
5843
|
+
space: 12
|
|
5844
|
+
}, secondaryButton, primaryButton)));
|
|
5845
|
+
}
|
|
5846
|
+
|
|
5847
|
+
return React__default.createElement(FooterContainer, null, children);
|
|
5848
|
+
};
|
|
5640
5849
|
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
},
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
}));
|
|
5850
|
+
var FooterContainer = function FooterContainer(_ref2) {
|
|
5851
|
+
var children = _ref2.children,
|
|
5852
|
+
testId = _ref2.testId;
|
|
5853
|
+
var childrenItens = React__default.Children.toArray(children);
|
|
5854
|
+
var hasCustomAlignment = childrenItens.length === 1 && childrenItens[0].type === Inline;
|
|
5855
|
+
return React__default.createElement("div", {
|
|
5856
|
+
className: styles$t['modal-footer'],
|
|
5857
|
+
"data-testid": testId
|
|
5858
|
+
}, React__default.createElement(Inline, {
|
|
5859
|
+
justifyContent: "end",
|
|
5860
|
+
space: 12,
|
|
5861
|
+
flex: hasCustomAlignment ? [1] : undefined
|
|
5862
|
+
}, children));
|
|
5654
5863
|
};
|
|
5655
5864
|
|
|
5656
|
-
var
|
|
5865
|
+
var styles$u = {"container":"_v1b-5","wrapper":"_3mrLu","interactionDisabled":"_1J9dh","DayPicker-Day":"_8FcQE","navBar":"_1SPuq","todayButton":"_24FJ6","navButtonInteractionDisabled":"_Oxdm9","navButtonPrev":"_20uqc","navButtonNext":"_3C53z","months":"_M_eHz","month":"_3RPpJ","caption":"_1FXNw","weekdays":"_3KcRU","weekdaysRow":"_1fO_e","weekday":"_c1Y-X","body":"_34mA1","week":"_1PmqZ","day":"_1AWH2","disabled":"_3vJkw","selected":"_1DR0N","outside":"_276GV","footer":"_2M5xr","today":"_3N6fj","overlayWrapper":"_3Zqgu","overlay":"_20Ncd","weekNumber":"_2hb-S"};
|
|
5657
5866
|
|
|
5658
|
-
var
|
|
5659
|
-
var trigger = _ref.trigger,
|
|
5660
|
-
_ref$triggersOn = _ref.triggersOn,
|
|
5661
|
-
triggersOn = _ref$triggersOn === void 0 ? DROPDOWN_TRIGGER.CLICK : _ref$triggersOn,
|
|
5662
|
-
_ref$alignment = _ref.alignment,
|
|
5663
|
-
alignment = _ref$alignment === void 0 ? DROPDOWN_ALIGNEMNT.RIGHT : _ref$alignment,
|
|
5664
|
-
width = _ref.width,
|
|
5665
|
-
maxHeight = _ref.maxHeight,
|
|
5666
|
-
testId = _ref.testId,
|
|
5667
|
-
children = _ref.children,
|
|
5668
|
-
triggerWidth = _ref.triggerWidth;
|
|
5867
|
+
var styles$v = {"container":"_okDvi","wrapper":"_17XdD","interactionDisabled":"_1O7OT","DayPicker-Day":"_3noGA","navBar":"_1Hl3Q","todayButton":"_m0Vs9","navButtonInteractionDisabled":"_1ULWH","navButtonPrev":"_3gjq8","navButtonNext":"_1m-Kd","months":"_Fq6Xh","month":"_3i0Oo","caption":"_36X9Y","weekdays":"_1aWPn","weekdaysRow":"_3HXCK","weekday":"_t-ctd","body":"_XAbiR","week":"_3Nwep","day":"_3nNcG","disabled":"_1M4ZF","selected":"_2PEs8","outside":"_1PIJa","footer":"_2T_z1","today":"_1hVM6","overlayWrapper":"_1L-hI","overlay":"_dDPZb","weekNumber":"_1alhT"};
|
|
5669
5868
|
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5869
|
+
function parseDate(str, format, locale) {
|
|
5870
|
+
var parsed = dateFnsParse(str, format, new Date(), {
|
|
5871
|
+
locale: locale
|
|
5872
|
+
});
|
|
5673
5873
|
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5874
|
+
if (str.length === format.length && DateUtils.isDate(parsed)) {
|
|
5875
|
+
return parsed;
|
|
5876
|
+
}
|
|
5677
5877
|
|
|
5678
|
-
|
|
5679
|
-
|
|
5878
|
+
return undefined;
|
|
5879
|
+
}
|
|
5880
|
+
function formatDate(date, format, locale) {
|
|
5881
|
+
return dateFnsFormat(date, format, {
|
|
5882
|
+
locale: locale
|
|
5883
|
+
});
|
|
5884
|
+
}
|
|
5885
|
+
function setToMidnight(date) {
|
|
5886
|
+
return date && startOfDay(date);
|
|
5887
|
+
}
|
|
5888
|
+
function getStartOfWeek(date, weekIndex) {
|
|
5889
|
+
var d = new Date(date);
|
|
5890
|
+
var firstDay = d.getDate() - d.getDay() + weekIndex;
|
|
5891
|
+
var firstDayAdjusted = firstDay > d.getDate() ? firstDay - 7 : firstDay;
|
|
5892
|
+
return new Date(d.setDate(firstDayAdjusted));
|
|
5893
|
+
}
|
|
5894
|
+
function getEndOfWeek(date, weekIndex) {
|
|
5895
|
+
var startOfWeek = getStartOfWeek(date, weekIndex);
|
|
5896
|
+
var endDay = startOfWeek.getDate() + 6;
|
|
5897
|
+
return new Date(startOfWeek.setDate(endDay));
|
|
5898
|
+
}
|
|
5899
|
+
function createWeekRange(date, weekStart) {
|
|
5900
|
+
return {
|
|
5901
|
+
start: getStartOfWeek(date, weekStart),
|
|
5902
|
+
end: getEndOfWeek(date, weekStart)
|
|
5680
5903
|
};
|
|
5904
|
+
}
|
|
5905
|
+
var DAYS = [getLocalizedString('time.sunday'), getLocalizedString('time.monday'), getLocalizedString('time.tuesday'), getLocalizedString('time.wednesday'), getLocalizedString('time.thursday'), getLocalizedString('time.friday'), getLocalizedString('time.saturday')];
|
|
5906
|
+
var MONTH_NAMES = [getLocalizedString('time.january'), getLocalizedString('time.february'), getLocalizedString('time.march'), getLocalizedString('time.april'), getLocalizedString('time.may'), getLocalizedString('time.june'), getLocalizedString('time.july'), getLocalizedString('time.august'), getLocalizedString('time.september'), getLocalizedString('time.october'), getLocalizedString('time.november'), getLocalizedString('time.december')];
|
|
5681
5907
|
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5908
|
+
var CALENDAR_MODE = {
|
|
5909
|
+
DAY: 'day',
|
|
5910
|
+
WEEK: 'week'
|
|
5911
|
+
};
|
|
5912
|
+
var CALENDAR_PLACEMENT = {
|
|
5913
|
+
BOTTOM: 'bottom',
|
|
5914
|
+
TOP: 'top'
|
|
5915
|
+
};
|
|
5688
5916
|
|
|
5689
|
-
|
|
5917
|
+
var calculateCalendarPosition = function calculateCalendarPosition(placement, anchorPosition, calendarDimensions) {
|
|
5918
|
+
if (!calendarDimensions) {
|
|
5919
|
+
return {
|
|
5920
|
+
left: 0,
|
|
5921
|
+
top: 0
|
|
5922
|
+
};
|
|
5923
|
+
}
|
|
5690
5924
|
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5925
|
+
var horizontalPosition = getHorizontalPosition(anchorPosition, calendarDimensions);
|
|
5926
|
+
var verticalPosition = getVerticalPosition(anchorPosition, placement, calendarDimensions);
|
|
5927
|
+
return _extends({}, horizontalPosition, verticalPosition);
|
|
5928
|
+
};
|
|
5695
5929
|
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
}
|
|
5930
|
+
var getHorizontalPosition = function getHorizontalPosition(anchorPosition, calendarDimensions) {
|
|
5931
|
+
var innerWidth = window.innerWidth;
|
|
5932
|
+
var calendarRight = anchorPosition.left + calendarDimensions.width;
|
|
5700
5933
|
|
|
5701
|
-
|
|
5934
|
+
if (innerWidth > calendarRight + BUFFER) {
|
|
5935
|
+
return {
|
|
5936
|
+
left: anchorPosition.left
|
|
5937
|
+
};
|
|
5938
|
+
}
|
|
5702
5939
|
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
}
|
|
5940
|
+
return {
|
|
5941
|
+
left: anchorPosition.right - calendarDimensions.width
|
|
5706
5942
|
};
|
|
5943
|
+
};
|
|
5707
5944
|
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
setIsOpen(true);
|
|
5712
|
-
}
|
|
5713
|
-
|
|
5714
|
-
if ('onFocus' in trigger.props) {
|
|
5715
|
-
trigger.props.onFocus(e);
|
|
5716
|
-
}
|
|
5717
|
-
|
|
5718
|
-
return;
|
|
5719
|
-
}
|
|
5720
|
-
|
|
5721
|
-
setIsOpen(true);
|
|
5945
|
+
var getVerticalPosition = function getVerticalPosition(anchorPosition, placement, calendarDimensions) {
|
|
5946
|
+
var calendarTopAboveTrigger = anchorPosition.top - calendarDimensions.height - PADDING;
|
|
5947
|
+
var calendarTopBelowTrigger = anchorPosition.bottom + PADDING;
|
|
5722
5948
|
|
|
5723
|
-
|
|
5724
|
-
|
|
5949
|
+
if (placement === CALENDAR_PLACEMENT.TOP) {
|
|
5950
|
+
if (calendarTopAboveTrigger < 0) {
|
|
5951
|
+
return {
|
|
5952
|
+
top: anchorPosition.bottom + PADDING
|
|
5953
|
+
};
|
|
5725
5954
|
}
|
|
5726
|
-
};
|
|
5727
5955
|
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5956
|
+
return {
|
|
5957
|
+
top: calendarTopAboveTrigger + window.scrollY
|
|
5958
|
+
};
|
|
5959
|
+
} else {
|
|
5960
|
+
if (calendarTopBelowTrigger + calendarDimensions.height > window.innerHeight) {
|
|
5961
|
+
return {
|
|
5962
|
+
top: calendarTopAboveTrigger + window.scrollY
|
|
5963
|
+
};
|
|
5731
5964
|
}
|
|
5732
5965
|
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5966
|
+
return {
|
|
5967
|
+
top: calendarTopBelowTrigger + window.scrollY
|
|
5968
|
+
};
|
|
5969
|
+
}
|
|
5970
|
+
};
|
|
5737
5971
|
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5972
|
+
var Calendar = function Calendar(_ref) {
|
|
5973
|
+
var _ref$mode = _ref.mode,
|
|
5974
|
+
mode = _ref$mode === void 0 ? CALENDAR_MODE.DAY : _ref$mode,
|
|
5975
|
+
_ref$position = _ref.position,
|
|
5976
|
+
position = _ref$position === void 0 ? CALENDAR_PLACEMENT.BOTTOM : _ref$position,
|
|
5977
|
+
_ref$weekStart = _ref.weekStart,
|
|
5978
|
+
weekStart = _ref$weekStart === void 0 ? 0 : _ref$weekStart,
|
|
5979
|
+
selected = _ref.selected,
|
|
5980
|
+
onSelect = _ref.onSelect,
|
|
5981
|
+
onClickOutside = _ref.onClickOutside,
|
|
5982
|
+
disabledDays = _ref.disabledDays,
|
|
5983
|
+
anchorRef = _ref.anchorRef,
|
|
5984
|
+
testId = _ref.testId;
|
|
5743
5985
|
|
|
5744
|
-
var
|
|
5745
|
-
|
|
5746
|
-
|
|
5986
|
+
var _useState = useState(null),
|
|
5987
|
+
calendarRef = _useState[0],
|
|
5988
|
+
setCalendarRef = _useState[1];
|
|
5747
5989
|
|
|
5748
|
-
var
|
|
5749
|
-
|
|
5990
|
+
var style = mode === CALENDAR_MODE.DAY ? styles$u : styles$v;
|
|
5991
|
+
var anchorNode = anchorRef.current;
|
|
5992
|
+
useOnClickOutside({
|
|
5993
|
+
current: calendarRef
|
|
5994
|
+
}, function (event) {
|
|
5995
|
+
var _anchorRef$current;
|
|
5750
5996
|
|
|
5751
|
-
if (
|
|
5752
|
-
|
|
5997
|
+
if (!((_anchorRef$current = anchorRef.current) !== null && _anchorRef$current !== void 0 && _anchorRef$current.contains(event === null || event === void 0 ? void 0 : event.srcElement))) {
|
|
5998
|
+
onClickOutside();
|
|
5753
5999
|
}
|
|
6000
|
+
});
|
|
6001
|
+
var weekRange = selected ? createWeekRange(selected, weekStart) : undefined;
|
|
6002
|
+
var selectedRange = weekRange && {
|
|
6003
|
+
from: weekRange.start,
|
|
6004
|
+
to: weekRange.end
|
|
5754
6005
|
};
|
|
5755
6006
|
|
|
5756
|
-
var
|
|
5757
|
-
|
|
5758
|
-
return;
|
|
5759
|
-
}
|
|
5760
|
-
|
|
5761
|
-
var focusableElements = getKeyboardFocusableElements(paneRef.current);
|
|
6007
|
+
var handleSelect = function handleSelect(day) {
|
|
6008
|
+
var selectedDate = setToMidnight(day);
|
|
5762
6009
|
|
|
5763
|
-
if (
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5767
|
-
} else if (!isFocusingOverlay.current) {
|
|
5768
|
-
setIsOpen(false);
|
|
5769
|
-
}
|
|
5770
|
-
};
|
|
6010
|
+
if (mode === CALENDAR_MODE.DAY) {
|
|
6011
|
+
onSelect(selectedDate);
|
|
6012
|
+
} else {
|
|
6013
|
+
var _weekRange = createWeekRange(selectedDate, weekStart);
|
|
5771
6014
|
|
|
5772
|
-
|
|
5773
|
-
if ((trigger.type === Button$1 || trigger.type === TimeFieldDropdownTrigger) && trigger.ref) {
|
|
5774
|
-
return trigger.ref;
|
|
6015
|
+
onSelect(_weekRange.start);
|
|
5775
6016
|
}
|
|
5776
6017
|
|
|
5777
|
-
|
|
6018
|
+
setTimeout(function () {
|
|
6019
|
+
onClickOutside();
|
|
6020
|
+
}, 100);
|
|
5778
6021
|
};
|
|
5779
6022
|
|
|
5780
|
-
|
|
5781
|
-
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
6023
|
+
if (!anchorNode) {
|
|
6024
|
+
return null;
|
|
6025
|
+
}
|
|
6026
|
+
|
|
6027
|
+
var anchorPosition = anchorNode.getBoundingClientRect();
|
|
6028
|
+
var calendarPosition = calculateCalendarPosition(position, anchorPosition, calendarRef === null || calendarRef === void 0 ? void 0 : calendarRef.getBoundingClientRect());
|
|
6029
|
+
return React__default.createElement(Portal, null, React__default.createElement("div", {
|
|
6030
|
+
className: style.overlayWrapper
|
|
6031
|
+
}, React__default.createElement("div", {
|
|
6032
|
+
className: style.overlay,
|
|
6033
|
+
ref: function ref(_ref2) {
|
|
6034
|
+
return setCalendarRef(_ref2);
|
|
5789
6035
|
},
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
ref: updatedRef,
|
|
5802
|
-
onFocus: handleFocus
|
|
5803
|
-
}), trigger), React__default.createElement(DropdownPane, {
|
|
5804
|
-
width: width,
|
|
5805
|
-
maxHeight: maxHeight,
|
|
5806
|
-
onMouseEnter: handlePaneMouseEnter,
|
|
5807
|
-
onMouseLeave: handlePaneMouseLeave,
|
|
5808
|
-
alignment: alignment,
|
|
5809
|
-
testId: testId
|
|
5810
|
-
}, children));
|
|
5811
|
-
};
|
|
6036
|
+
style: _extends({}, calendarPosition, {
|
|
6037
|
+
zIndex: Z_INDEX_LAYERS.MODAL
|
|
6038
|
+
}),
|
|
6039
|
+
"data-testid": testId
|
|
6040
|
+
}, React__default.createElement(DayPicker, {
|
|
6041
|
+
format: "MM/dd/yyyy",
|
|
6042
|
+
classNames: style,
|
|
6043
|
+
onDayClick: function onDayClick(day, activeModifiers) {
|
|
6044
|
+
var isDateDisabled = Object.keys(activeModifiers).find(function (modifier) {
|
|
6045
|
+
return modifier.includes('disabled');
|
|
6046
|
+
});
|
|
5812
6047
|
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
},
|
|
5825
|
-
|
|
6048
|
+
if (!Boolean(isDateDisabled)) {
|
|
6049
|
+
handleSelect(day);
|
|
6050
|
+
}
|
|
6051
|
+
},
|
|
6052
|
+
selectedDays: mode === CALENDAR_MODE.DAY ? selected : selectedRange,
|
|
6053
|
+
disabledDays: disabledDays,
|
|
6054
|
+
months: MONTH_NAMES,
|
|
6055
|
+
weekdaysLong: DAYS,
|
|
6056
|
+
initialMonth: selected,
|
|
6057
|
+
weekdaysShort: DAYS.map(function (day) {
|
|
6058
|
+
return day.substring(0, 2);
|
|
6059
|
+
}),
|
|
6060
|
+
showOutsideDays: mode === CALENDAR_MODE.WEEK,
|
|
6061
|
+
firstDayOfWeek: weekStart
|
|
6062
|
+
}))));
|
|
5826
6063
|
};
|
|
5827
6064
|
|
|
5828
|
-
var styles$q = {"data-table-cell":"_2Ybjx","data-table-cell--no-padding":"_5KXHH","data-table-cell--vertical-border":"_2-I0j","data-table-cell--invalid":"_D73Vx","data-table-cell__content":"_3A9-M","data-table-cell__content--right-align":"_17Km7","data-table-cell__content--with-error":"_2c6KQ","data-table-cell__error-icon":"_2hIl3","data-table-cell__error-icon--right-align":"_8Uhyd","data-table-cell__error-icon--left-align":"_3X51R"};
|
|
5829
|
-
|
|
5830
6065
|
var DataTableCellElement = function DataTableCellElement(_ref, ref) {
|
|
5831
6066
|
var _columns$columnIndex, _classnames, _classnames2, _classnames3;
|
|
5832
6067
|
|
|
@@ -5848,17 +6083,17 @@ var DataTableCellElement = function DataTableCellElement(_ref, ref) {
|
|
|
5848
6083
|
var hasError = !!error;
|
|
5849
6084
|
var errorMessage = error;
|
|
5850
6085
|
var icon = hasError && React__default.createElement("div", {
|
|
5851
|
-
className: classnames(styles$
|
|
6086
|
+
className: classnames(styles$p['data-table-cell__error-icon'], (_classnames = {}, _classnames[styles$p['data-table-cell__error-icon--right-align']] = isRightAligned, _classnames[styles$p['data-table-cell__error-icon--left-align']] = !isRightAligned, _classnames))
|
|
5852
6087
|
}, React__default.createElement(IconTimesOctagon, {
|
|
5853
6088
|
size: "medium",
|
|
5854
|
-
color:
|
|
6089
|
+
color: "radish-400"
|
|
5855
6090
|
}));
|
|
5856
6091
|
var TableCell = React__default.createElement("td", {
|
|
5857
|
-
className: classnames((_classnames2 = {}, _classnames2[styles$
|
|
6092
|
+
className: classnames((_classnames2 = {}, _classnames2[styles$p['data-table-cell--invalid']] = hasError, _classnames2[styles$p['data-table-cell--no-padding']] = noPadding, _classnames2[styles$p['data-table-cell--vertical-border']] = hasVerticalBorders, _classnames2), styles$p['data-table-cell']),
|
|
5858
6093
|
colSpan: colSpan,
|
|
5859
6094
|
ref: ref
|
|
5860
6095
|
}, React__default.createElement("div", {
|
|
5861
|
-
className: classnames(styles$
|
|
6096
|
+
className: classnames(styles$p['data-table-cell__content'], (_classnames3 = {}, _classnames3[styles$p['data-table-cell__content--with-error']] = hasError, _classnames3[styles$p['data-table-cell__content--right-align']] = isRightAligned, _classnames3))
|
|
5862
6097
|
}, isRightAligned && icon, children, !isRightAligned && icon));
|
|
5863
6098
|
return React__default.createElement(Tooltip$1, {
|
|
5864
6099
|
overlay: errorMessage,
|
|
@@ -5882,7 +6117,7 @@ var DataTableRowActions = function DataTableRowActions(_ref) {
|
|
|
5882
6117
|
return React__default.createElement(DataTableCell, {
|
|
5883
6118
|
columnIndex: columnIndex
|
|
5884
6119
|
}, React__default.createElement("div", {
|
|
5885
|
-
className: styles$
|
|
6120
|
+
className: styles$e['actions'],
|
|
5886
6121
|
"data-testid": "data-table-dropdown-menu"
|
|
5887
6122
|
}, sideActions.length > 0 && sideActions.map(function (action) {
|
|
5888
6123
|
return React__default.createElement(Button$1, Object.assign({
|
|
@@ -5895,60 +6130,7 @@ var DataTableRowActions = function DataTableRowActions(_ref) {
|
|
|
5895
6130
|
})));
|
|
5896
6131
|
};
|
|
5897
6132
|
|
|
5898
|
-
var styles$
|
|
5899
|
-
|
|
5900
|
-
var AffixContainer = function AffixContainer(_ref) {
|
|
5901
|
-
var _classnames;
|
|
5902
|
-
|
|
5903
|
-
var prefix = _ref.prefix,
|
|
5904
|
-
suffix = _ref.suffix,
|
|
5905
|
-
children = _ref.children,
|
|
5906
|
-
testId = _ref.testId;
|
|
5907
|
-
var container = useRef(null);
|
|
5908
|
-
var prefixElement = useRef(null);
|
|
5909
|
-
var suffixElement = useRef(null);
|
|
5910
|
-
var isHidden = container.current && container.current.offsetParent === null;
|
|
5911
|
-
useLayoutEffect(function () {
|
|
5912
|
-
if (container.current) {
|
|
5913
|
-
var input = container.current.querySelector('input, [class$=control] > div');
|
|
5914
|
-
|
|
5915
|
-
if (input) {
|
|
5916
|
-
if (prefix && prefixElement.current) {
|
|
5917
|
-
var _prefixElement$curren;
|
|
5918
|
-
|
|
5919
|
-
var prefixWidth = prefixElement === null || prefixElement === void 0 ? void 0 : (_prefixElement$curren = prefixElement.current) === null || _prefixElement$curren === void 0 ? void 0 : _prefixElement$curren.offsetWidth;
|
|
5920
|
-
input.style.paddingLeft = prefixWidth + 'px';
|
|
5921
|
-
}
|
|
5922
|
-
|
|
5923
|
-
if (suffix && suffixElement.current) {
|
|
5924
|
-
var suffixWidth = suffixElement.current.offsetWidth;
|
|
5925
|
-
input.style.paddingRight = suffixWidth + 'px';
|
|
5926
|
-
}
|
|
5927
|
-
}
|
|
5928
|
-
}
|
|
5929
|
-
}, [prefix, suffix, isHidden]);
|
|
5930
|
-
var hasPrefix = !!prefix;
|
|
5931
|
-
var hasSuffix = !!suffix;
|
|
5932
|
-
|
|
5933
|
-
if (!hasPrefix && !hasSuffix) {
|
|
5934
|
-
return children;
|
|
5935
|
-
}
|
|
5936
|
-
|
|
5937
|
-
var classes = classnames(styles$r['affix-container'], (_classnames = {}, _classnames[styles$r['affix-container--prefixed']] = hasPrefix, _classnames[styles$r['affix-container--suffixed']] = hasSuffix, _classnames));
|
|
5938
|
-
return React__default.createElement("div", {
|
|
5939
|
-
className: classes,
|
|
5940
|
-
ref: container,
|
|
5941
|
-
"data-testid": testId
|
|
5942
|
-
}, hasPrefix && React__default.createElement("div", {
|
|
5943
|
-
className: styles$r['prefix'],
|
|
5944
|
-
ref: prefixElement
|
|
5945
|
-
}, prefix), children, hasSuffix && React__default.createElement("div", {
|
|
5946
|
-
className: styles$r['suffix'],
|
|
5947
|
-
ref: suffixElement
|
|
5948
|
-
}, suffix));
|
|
5949
|
-
};
|
|
5950
|
-
|
|
5951
|
-
var styles$s = {"data-table-editable-cell":"_qYNve","data-table-editable-cell--right-aligned":"_3w6bw","data-table-editable-cell--currency":"_2y-_5","data-table-editable-cell--invalid":"_1Mx8j","data-table-editable-cell--top-left":"_2BlhN","data-table-editable-cell--top-right":"_1qDoN","data-table-editable-cell--bottom-left":"_2NUlb","data-table-editable-cell--bottom-right":"_3Mm-v"};
|
|
6133
|
+
var styles$w = {"data-table-editable-cell":"_qYNve","data-table-editable-cell--right-aligned":"_3w6bw","data-table-editable-cell--currency":"_2y-_5","data-table-editable-cell--invalid":"_1Mx8j","data-table-editable-cell--top-left":"_2BlhN","data-table-editable-cell--top-right":"_1qDoN","data-table-editable-cell--bottom-left":"_2NUlb","data-table-editable-cell--bottom-right":"_3Mm-v"};
|
|
5952
6134
|
|
|
5953
6135
|
var DataTableEditableCellElement = function DataTableEditableCellElement(_ref, ref) {
|
|
5954
6136
|
var _columns$columnIndex, _controllers$error, _classnames, _classnames2;
|
|
@@ -5997,7 +6179,7 @@ var DataTableEditableCellElement = function DataTableEditableCellElement(_ref, r
|
|
|
5997
6179
|
id: controllers.id
|
|
5998
6180
|
};
|
|
5999
6181
|
var EditableCell = React__default.createElement("div", {
|
|
6000
|
-
className: classnames((_classnames = {}, _classnames[styles$
|
|
6182
|
+
className: classnames((_classnames = {}, _classnames[styles$w['data-table-editable-cell--currency']] = type === 'currency', _classnames), styles$w['data-table-editable-cell']),
|
|
6001
6183
|
"data-testid": testId,
|
|
6002
6184
|
role: "cell"
|
|
6003
6185
|
}, React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement(AffixContainer, {
|
|
@@ -6006,249 +6188,103 @@ var DataTableEditableCellElement = function DataTableEditableCellElement(_ref, r
|
|
|
6006
6188
|
}, React__default.createElement("input", {
|
|
6007
6189
|
name: name,
|
|
6008
6190
|
id: controllers.id,
|
|
6009
|
-
className: classnames((_classnames2 = {}, _classnames2[styles$
|
|
6191
|
+
className: classnames((_classnames2 = {}, _classnames2[styles$w['data-table-editable-cell--right-aligned']] = isRightAligned, _classnames2[styles$w['data-table-editable-cell--top-left']] = isTopLeftCell, _classnames2[styles$w['data-table-editable-cell--top-right']] = isTopRightCell, _classnames2[styles$w['data-table-editable-cell--bottom-left']] = isBottomLeftCell, _classnames2[styles$w['data-table-editable-cell--bottom-right']] = isBottomRightCell, _classnames2[styles$w['data-table-editable-cell--invalid']] = hasError, _classnames2)),
|
|
6010
6192
|
type: type === 'currency' ? 'number' : 'text',
|
|
6011
6193
|
step: type === 'currency' ? 'any' : '',
|
|
6012
6194
|
"data-testid": testId && testId + "-text-field",
|
|
6013
6195
|
"aria-describedby": hasError ? controllers.id + "-error-message" : controllers.id + "-describer",
|
|
6014
6196
|
"aria-invalid": hasError,
|
|
6015
6197
|
disabled: disabled,
|
|
6016
|
-
placeholder: placeholder,
|
|
6017
|
-
defaultValue: defaultValue,
|
|
6018
|
-
value: controllers.value,
|
|
6019
|
-
onChange: controllers.onChange,
|
|
6020
|
-
onBlur: controllers.onBlur,
|
|
6021
|
-
ref: ref,
|
|
6022
|
-
onWheel: function onWheel(e) {
|
|
6023
|
-
e.target.blur();
|
|
6024
|
-
}
|
|
6025
|
-
}))));
|
|
6026
|
-
return React__default.createElement(Tooltip$1, {
|
|
6027
|
-
overlay: errorMessage,
|
|
6028
|
-
placement: "top",
|
|
6029
|
-
theme: "white"
|
|
6030
|
-
}, EditableCell);
|
|
6031
|
-
};
|
|
6032
|
-
|
|
6033
|
-
var DataTableEditableCell = forwardRef(DataTableEditableCellElement);
|
|
6034
|
-
|
|
6035
|
-
var _excluded$2i = ["children", "onClick", "isSelected", "actions", "hasDefaultPadding", "hasDefaultCell", "testId"];
|
|
6036
|
-
|
|
6037
|
-
var DataTableRowComponent = function DataTableRowComponent(_ref, ref) {
|
|
6038
|
-
var _classnames;
|
|
6039
|
-
|
|
6040
|
-
var children = _ref.children,
|
|
6041
|
-
onClick = _ref.onClick,
|
|
6042
|
-
_ref$isSelected = _ref.isSelected,
|
|
6043
|
-
isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
|
|
6044
|
-
_ref$actions = _ref.actions,
|
|
6045
|
-
actions = _ref$actions === void 0 ? [] : _ref$actions,
|
|
6046
|
-
_ref$hasDefaultCell = _ref.hasDefaultCell,
|
|
6047
|
-
hasDefaultCell = _ref$hasDefaultCell === void 0 ? true : _ref$hasDefaultCell,
|
|
6048
|
-
testId = _ref.testId,
|
|
6049
|
-
nativeDivProps = _objectWithoutPropertiesLoose(_ref, _excluded$2i);
|
|
6050
|
-
|
|
6051
|
-
var _useDataTableContext = useDataTableContext(),
|
|
6052
|
-
showActionMenu = _useDataTableContext.showActionMenu;
|
|
6053
|
-
|
|
6054
|
-
var styleNames = classnames(styles$9['item'], (_classnames = {}, _classnames[styles$9['clickable']] = onClick, _classnames[styles$9['selected']] = isSelected, _classnames));
|
|
6055
|
-
|
|
6056
|
-
var renderColumn = function renderColumn(columnElement, index) {
|
|
6057
|
-
var isUsingDataTableCell = columnElement && typeof columnElement === 'object' && 'type' in columnElement && (columnElement === null || columnElement === void 0 ? void 0 : columnElement.type) === DataTableCell;
|
|
6058
|
-
|
|
6059
|
-
if (isUsingDataTableCell || !hasDefaultCell) {
|
|
6060
|
-
return columnElement;
|
|
6061
|
-
}
|
|
6062
|
-
|
|
6063
|
-
var isUsingDataTableEditableCell = columnElement && typeof columnElement === 'object' && 'type' in columnElement && (columnElement === null || columnElement === void 0 ? void 0 : columnElement.type) === DataTableEditableCell;
|
|
6064
|
-
return React__default.createElement(DataTableCell, {
|
|
6065
|
-
key: index,
|
|
6066
|
-
columnIndex: index,
|
|
6067
|
-
noPadding: !!isUsingDataTableEditableCell
|
|
6068
|
-
}, columnElement);
|
|
6069
|
-
};
|
|
6070
|
-
|
|
6071
|
-
return React__default.createElement("tr", Object.assign({}, nativeDivProps, {
|
|
6072
|
-
className: styleNames,
|
|
6073
|
-
onClick: onClick ? onClick : undefined,
|
|
6074
|
-
onKeyPress: onClick ? onClick : undefined,
|
|
6075
|
-
"data-testid": testId && testId + "-row",
|
|
6076
|
-
role: "row",
|
|
6077
|
-
ref: ref
|
|
6078
|
-
}), React__default.Children.toArray(children).filter(Boolean).map(function (child, index) {
|
|
6079
|
-
return renderColumn(child, index);
|
|
6080
|
-
}), showActionMenu && React__default.createElement(DataTableRowActions, {
|
|
6081
|
-
actions: actions,
|
|
6082
|
-
columnIndex: React__default.Children.count(children)
|
|
6083
|
-
}));
|
|
6084
|
-
};
|
|
6085
|
-
|
|
6086
|
-
var DataTableRow = forwardRef(DataTableRowComponent);
|
|
6087
|
-
|
|
6088
|
-
var styles$t = {"table-container":"_3qoNq","table-content":"_2HcDV","table-content--with-scroll":"_3dowz","table":"_tGpUv","table--no-columns":"_3VePT","header":"_2ZgmC","header-item":"_3slLU","header-item__content":"_1jb-H","header-item__content--right-align":"_2Np60","header-item--sortable":"_1-26z","header-item--action":"_2i1wY","header-sort-icon":"_BLrNe","body":"_CT4Lp","body--no-bottom-radius":"_1wU1R","footer":"_398L3","pagination-controls":"_2smmY"};
|
|
6089
|
-
|
|
6090
|
-
var calculatePercentageOfProportion = function calculatePercentageOfProportion(proportionNumbers) {
|
|
6091
|
-
var sum = proportionNumbers.reduce(function (total, num) {
|
|
6092
|
-
return total + num;
|
|
6093
|
-
}, 0);
|
|
6094
|
-
var percentages = proportionNumbers.map(function (num) {
|
|
6095
|
-
return parseFloat((num / sum * 100).toFixed(2));
|
|
6096
|
-
});
|
|
6097
|
-
return percentages;
|
|
6098
|
-
};
|
|
6099
|
-
|
|
6100
|
-
var SORT_ORDER = {
|
|
6101
|
-
ASC: 'asc',
|
|
6102
|
-
DESC: 'desc'
|
|
6103
|
-
};
|
|
6104
|
-
|
|
6105
|
-
var DataTableHeader = function DataTableHeader(_ref) {
|
|
6106
|
-
var columns = _ref.columns,
|
|
6107
|
-
onSort = _ref.onSort,
|
|
6108
|
-
showActionMenu = _ref.showActionMenu;
|
|
6109
|
-
var haveLabels = columns.find(function (column) {
|
|
6110
|
-
return column.label && column.label !== '';
|
|
6111
|
-
});
|
|
6112
|
-
|
|
6113
|
-
if (!haveLabels) {
|
|
6114
|
-
return React__default.createElement(ColumnSizes, {
|
|
6115
|
-
columns: columns,
|
|
6116
|
-
showActionMenu: showActionMenu
|
|
6117
|
-
});
|
|
6118
|
-
}
|
|
6119
|
-
|
|
6120
|
-
var handleSort = function handleSort(column) {
|
|
6121
|
-
var nextDirection = getNextSort(column);
|
|
6122
|
-
|
|
6123
|
-
if (onSort) {
|
|
6124
|
-
onSort({
|
|
6125
|
-
columnName: column.name,
|
|
6126
|
-
direction: nextDirection
|
|
6127
|
-
});
|
|
6128
|
-
}
|
|
6129
|
-
};
|
|
6130
|
-
|
|
6131
|
-
return React__default.createElement(Fragment, null, React__default.createElement(ColumnSizes, {
|
|
6132
|
-
columns: columns,
|
|
6133
|
-
showActionMenu: showActionMenu
|
|
6134
|
-
}), React__default.createElement("thead", null, React__default.createElement("tr", {
|
|
6135
|
-
className: styles$t['header']
|
|
6136
|
-
}, columns.map(function (column) {
|
|
6137
|
-
var _classnames, _classnames2;
|
|
6138
|
-
|
|
6139
|
-
var isSortable = column.isSortable;
|
|
6140
|
-
var sortDir = column.currentSort;
|
|
6141
|
-
var isRightAligned = column.isRightAligned;
|
|
6142
|
-
return React__default.createElement("th", {
|
|
6143
|
-
className: classnames((_classnames = {}, _classnames[styles$t['header-item']] = true, _classnames[styles$t['header-item--sortable']] = isSortable, _classnames)),
|
|
6144
|
-
style: {
|
|
6145
|
-
flex: column.size || 1
|
|
6146
|
-
},
|
|
6147
|
-
key: column.name,
|
|
6148
|
-
onClick: function onClick() {
|
|
6149
|
-
return isSortable && handleSort(column);
|
|
6150
|
-
},
|
|
6151
|
-
onKeyPress: function onKeyPress() {
|
|
6152
|
-
return isSortable && handleSort(column);
|
|
6153
|
-
},
|
|
6154
|
-
role: "columnheader",
|
|
6155
|
-
tabIndex: 0
|
|
6156
|
-
}, React__default.createElement("div", {
|
|
6157
|
-
className: classnames(styles$t['header-item__content'], (_classnames2 = {}, _classnames2[styles$t['header-item__content--right-align']] = isRightAligned, _classnames2))
|
|
6158
|
-
}, column.label, ' ', isSortable && React__default.createElement("span", {
|
|
6159
|
-
className: styles$t['header-sort-icon']
|
|
6160
|
-
}, React__default.createElement(IconSort$1, {
|
|
6161
|
-
sortDirection: sortDir
|
|
6162
|
-
}))));
|
|
6163
|
-
}), showActionMenu && React__default.createElement("th", {
|
|
6164
|
-
className: classnames(styles$t['header-item'], styles$t['header-item--action'])
|
|
6198
|
+
placeholder: placeholder,
|
|
6199
|
+
defaultValue: defaultValue,
|
|
6200
|
+
value: controllers.value,
|
|
6201
|
+
onChange: controllers.onChange,
|
|
6202
|
+
onBlur: controllers.onBlur,
|
|
6203
|
+
ref: ref,
|
|
6204
|
+
onWheel: function onWheel(e) {
|
|
6205
|
+
e.target.blur();
|
|
6206
|
+
}
|
|
6165
6207
|
}))));
|
|
6208
|
+
return React__default.createElement(Tooltip$1, {
|
|
6209
|
+
overlay: errorMessage,
|
|
6210
|
+
placement: "top",
|
|
6211
|
+
theme: "white"
|
|
6212
|
+
}, EditableCell);
|
|
6166
6213
|
};
|
|
6167
6214
|
|
|
6168
|
-
var
|
|
6169
|
-
var columns = _ref2.columns,
|
|
6170
|
-
showActionMenu = _ref2.showActionMenu;
|
|
6171
|
-
var columnPercentageSizes = calculatePercentageOfProportion(columns.map(function (column) {
|
|
6172
|
-
return column.size || 1;
|
|
6173
|
-
}));
|
|
6174
|
-
return React__default.createElement("colgroup", null, columns.map(function (column, index) {
|
|
6175
|
-
return React__default.createElement("col", {
|
|
6176
|
-
key: column.name,
|
|
6177
|
-
style: {
|
|
6178
|
-
width: columnPercentageSizes[index] + "%"
|
|
6179
|
-
}
|
|
6180
|
-
});
|
|
6181
|
-
}), showActionMenu && React__default.createElement("col", {
|
|
6182
|
-
style: {
|
|
6183
|
-
width: "1%",
|
|
6184
|
-
whiteSpace: 'nowrap'
|
|
6185
|
-
}
|
|
6186
|
-
}));
|
|
6187
|
-
};
|
|
6215
|
+
var DataTableEditableCell = forwardRef(DataTableEditableCellElement);
|
|
6188
6216
|
|
|
6189
|
-
var
|
|
6190
|
-
switch (column.currentSort) {
|
|
6191
|
-
case SORT_ORDER.ASC:
|
|
6192
|
-
return null;
|
|
6217
|
+
var _excluded$2i = ["children", "onClick", "isSelected", "actions", "hasDefaultPadding", "hasDefaultCell", "testId"];
|
|
6193
6218
|
|
|
6194
|
-
|
|
6195
|
-
|
|
6219
|
+
var DataTableRowComponent = function DataTableRowComponent(_ref, ref) {
|
|
6220
|
+
var _classnames;
|
|
6196
6221
|
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6222
|
+
var children = _ref.children,
|
|
6223
|
+
onClick = _ref.onClick,
|
|
6224
|
+
_ref$isSelected = _ref.isSelected,
|
|
6225
|
+
isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
|
|
6226
|
+
_ref$actions = _ref.actions,
|
|
6227
|
+
actions = _ref$actions === void 0 ? [] : _ref$actions,
|
|
6228
|
+
_ref$hasDefaultCell = _ref.hasDefaultCell,
|
|
6229
|
+
hasDefaultCell = _ref$hasDefaultCell === void 0 ? true : _ref$hasDefaultCell,
|
|
6230
|
+
testId = _ref.testId,
|
|
6231
|
+
nativeDivProps = _objectWithoutPropertiesLoose(_ref, _excluded$2i);
|
|
6201
6232
|
|
|
6202
|
-
var
|
|
6203
|
-
|
|
6204
|
-
var sortDir = sortDirection || null;
|
|
6205
|
-
return React__default.createElement("div", {
|
|
6206
|
-
style: {
|
|
6207
|
-
display: 'inline-flex',
|
|
6208
|
-
flexDirection: 'column'
|
|
6209
|
-
}
|
|
6210
|
-
}, sortDir !== 'desc' && React__default.createElement(IconChevronUp, {
|
|
6211
|
-
size: "small",
|
|
6212
|
-
color: GREY400
|
|
6213
|
-
}), sortDir !== 'asc' && React__default.createElement("span", {
|
|
6214
|
-
style: {
|
|
6215
|
-
marginTop: '-4px'
|
|
6216
|
-
}
|
|
6217
|
-
}, React__default.createElement(IconChevronDown, {
|
|
6218
|
-
size: "small",
|
|
6219
|
-
color: GREY400
|
|
6220
|
-
})));
|
|
6221
|
-
};
|
|
6233
|
+
var _useDataTableContext = useDataTableContext(),
|
|
6234
|
+
showActionMenu = _useDataTableContext.showActionMenu;
|
|
6222
6235
|
|
|
6223
|
-
var styles$
|
|
6236
|
+
var styleNames = classnames(styles$d['item'], (_classnames = {}, _classnames[styles$d['clickable']] = onClick, _classnames[styles$d['selected']] = isSelected, _classnames));
|
|
6224
6237
|
|
|
6225
|
-
var
|
|
6226
|
-
|
|
6238
|
+
var renderColumn = function renderColumn(columnElement, index) {
|
|
6239
|
+
var isUsingDataTableCell = columnElement && typeof columnElement === 'object' && 'type' in columnElement && (columnElement === null || columnElement === void 0 ? void 0 : columnElement.type) === DataTableCell;
|
|
6227
6240
|
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6241
|
+
if (isUsingDataTableCell || !hasDefaultCell) {
|
|
6242
|
+
return columnElement;
|
|
6243
|
+
}
|
|
6244
|
+
|
|
6245
|
+
var isUsingDataTableEditableCell = columnElement && typeof columnElement === 'object' && 'type' in columnElement && (columnElement === null || columnElement === void 0 ? void 0 : columnElement.type) === DataTableEditableCell;
|
|
6246
|
+
return React__default.createElement(DataTableCell, {
|
|
6247
|
+
key: index,
|
|
6248
|
+
columnIndex: index,
|
|
6249
|
+
noPadding: !!isUsingDataTableEditableCell
|
|
6250
|
+
}, columnElement);
|
|
6251
|
+
};
|
|
6252
|
+
|
|
6253
|
+
return React__default.createElement("tr", Object.assign({}, nativeDivProps, {
|
|
6254
|
+
className: styleNames,
|
|
6255
|
+
onClick: onClick ? onClick : undefined,
|
|
6256
|
+
onKeyPress: onClick ? onClick : undefined,
|
|
6257
|
+
"data-testid": testId && testId + "-row",
|
|
6258
|
+
role: "row",
|
|
6259
|
+
ref: ref
|
|
6260
|
+
}), React__default.Children.toArray(children).filter(Boolean).map(function (child, index) {
|
|
6261
|
+
return renderColumn(child, index);
|
|
6262
|
+
}), showActionMenu && React__default.createElement(DataTableRowActions, {
|
|
6263
|
+
actions: actions,
|
|
6264
|
+
columnIndex: React__default.Children.count(children)
|
|
6235
6265
|
}));
|
|
6236
6266
|
};
|
|
6237
6267
|
|
|
6238
|
-
var
|
|
6268
|
+
var DataTableRow = forwardRef(DataTableRowComponent);
|
|
6239
6269
|
|
|
6240
|
-
var
|
|
6241
|
-
var
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
var
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
}
|
|
6250
|
-
|
|
6251
|
-
|
|
6270
|
+
var DataTableDefaultItemComponent = function DataTableDefaultItemComponent(_ref) {
|
|
6271
|
+
var columns = _ref.columns,
|
|
6272
|
+
item = _ref.item,
|
|
6273
|
+
testId = _ref.testId;
|
|
6274
|
+
var headingKeys = columns ? columns.map(function (column) {
|
|
6275
|
+
return column.name;
|
|
6276
|
+
}) : Object.keys(item);
|
|
6277
|
+
var columnsToShow = headingKeys.filter(function (key) {
|
|
6278
|
+
return key !== 'actions';
|
|
6279
|
+
});
|
|
6280
|
+
return React__default.createElement(DataTableRow, {
|
|
6281
|
+
actions: item.actions,
|
|
6282
|
+
testId: testId
|
|
6283
|
+
}, columnsToShow.map(function (headingKey) {
|
|
6284
|
+
return React__default.createElement("div", {
|
|
6285
|
+
key: headingKey
|
|
6286
|
+
}, item[headingKey] || '');
|
|
6287
|
+
}));
|
|
6252
6288
|
};
|
|
6253
6289
|
|
|
6254
6290
|
var DataTable = function DataTable(_ref) {
|
|
@@ -6273,7 +6309,7 @@ var DataTable = function DataTable(_ref) {
|
|
|
6273
6309
|
_ref$hasVerticalBorde = _ref.hasVerticalBorders,
|
|
6274
6310
|
hasVerticalBorders = _ref$hasVerticalBorde === void 0 ? false : _ref$hasVerticalBorde,
|
|
6275
6311
|
testId = _ref.testId;
|
|
6276
|
-
var RowItem = itemComponent ||
|
|
6312
|
+
var RowItem = itemComponent || DataTableDefaultItemComponent;
|
|
6277
6313
|
var conditionalStyles = {};
|
|
6278
6314
|
var isScrollableTable = !!maxHeight;
|
|
6279
6315
|
|
|
@@ -6295,20 +6331,20 @@ var DataTable = function DataTable(_ref) {
|
|
|
6295
6331
|
hasVerticalBorders: hasVerticalBorders
|
|
6296
6332
|
}
|
|
6297
6333
|
}, React__default.createElement("div", {
|
|
6298
|
-
className: classnames(styles$
|
|
6334
|
+
className: classnames(styles$a['data-table'])
|
|
6299
6335
|
}, isShowingColumns && isScrollableTable && React__default.createElement(DataTableScrollFakeBorder, {
|
|
6300
6336
|
placement: "top"
|
|
6301
6337
|
}), React__default.createElement("div", {
|
|
6302
|
-
className: classnames(styles$
|
|
6338
|
+
className: classnames(styles$a['data-table__content'], (_classNames = {}, _classNames[styles$a['data-table__content--with-scroll']] = isScrollableTable, _classNames)),
|
|
6303
6339
|
style: conditionalStyles
|
|
6304
6340
|
}, React__default.createElement("table", {
|
|
6305
|
-
className: classnames(styles$
|
|
6341
|
+
className: classnames(styles$a['data-table__table'], (_classNames2 = {}, _classNames2[styles$a['data-table__table--no-columns']] = !isShowingColumns, _classNames2))
|
|
6306
6342
|
}, columns && isShowingColumns && React__default.createElement(DataTableHeader, {
|
|
6307
6343
|
columns: columns,
|
|
6308
6344
|
onSort: onSort,
|
|
6309
6345
|
showActionMenu: showActionMenu
|
|
6310
6346
|
}), React__default.createElement("tbody", {
|
|
6311
|
-
className: classnames(styles$
|
|
6347
|
+
className: classnames(styles$a['data-table__body'], (_classNames3 = {}, _classNames3[styles$a['data-table__body--no-bottom-radius']] = isShowingFooter, _classNames3)),
|
|
6312
6348
|
"data-testid": testId
|
|
6313
6349
|
}, isLoading && React__default.createElement(DataTableLoadingBlock, {
|
|
6314
6350
|
amountOfColumns: (columns === null || columns === void 0 ? void 0 : columns.length) || 1,
|
|
@@ -6322,12 +6358,12 @@ var DataTable = function DataTable(_ref) {
|
|
|
6322
6358
|
testId: testId
|
|
6323
6359
|
});
|
|
6324
6360
|
})), isShowingFooter && React__default.createElement("tfoot", {
|
|
6325
|
-
className: styles$
|
|
6361
|
+
className: styles$a['data-table__footer'],
|
|
6326
6362
|
"data-testid": testId && testId + "-footer"
|
|
6327
6363
|
}, footerComponent))), !isShowingFooter && isScrollableTable && React__default.createElement(DataTableScrollFakeBorder, {
|
|
6328
6364
|
placement: "bottom"
|
|
6329
6365
|
})), onPreviousClick && onNextClick && (hasPrevious || hasNext) && React__default.createElement("div", {
|
|
6330
|
-
className: styles$
|
|
6366
|
+
className: styles$a['data-table__pagination-controls'],
|
|
6331
6367
|
"data-testid": testId && testId + "-pagination-controls"
|
|
6332
6368
|
}, React__default.createElement(PaginationControls, {
|
|
6333
6369
|
hasPrevious: hasPrevious && !isLoading,
|
|
@@ -6337,26 +6373,6 @@ var DataTable = function DataTable(_ref) {
|
|
|
6337
6373
|
})));
|
|
6338
6374
|
};
|
|
6339
6375
|
|
|
6340
|
-
var DefaultItemComponent = function DefaultItemComponent(_ref2) {
|
|
6341
|
-
var columns = _ref2.columns,
|
|
6342
|
-
item = _ref2.item,
|
|
6343
|
-
testId = _ref2.testId;
|
|
6344
|
-
var headingKeys = columns ? columns.map(function (column) {
|
|
6345
|
-
return column.name;
|
|
6346
|
-
}) : Object.keys(item);
|
|
6347
|
-
var columnsToShow = headingKeys.filter(function (key) {
|
|
6348
|
-
return key !== 'actions';
|
|
6349
|
-
});
|
|
6350
|
-
return React__default.createElement(DataTableRow, {
|
|
6351
|
-
actions: item.actions,
|
|
6352
|
-
testId: testId
|
|
6353
|
-
}, columnsToShow.map(function (headingKey) {
|
|
6354
|
-
return React__default.createElement("div", {
|
|
6355
|
-
key: headingKey
|
|
6356
|
-
}, item[headingKey] || '');
|
|
6357
|
-
}));
|
|
6358
|
-
};
|
|
6359
|
-
|
|
6360
6376
|
var useSelectFieldControllers = function useSelectFieldControllers(_ref) {
|
|
6361
6377
|
var name = _ref.name,
|
|
6362
6378
|
inputId = _ref.id,
|
|
@@ -6452,7 +6468,7 @@ var isReactSelectElement = function isReactSelectElement(element) {
|
|
|
6452
6468
|
return typeof firstOption.id === 'string' && firstOption.id.includes('react-select');
|
|
6453
6469
|
};
|
|
6454
6470
|
|
|
6455
|
-
var styles$
|
|
6471
|
+
var styles$x = {"custom-control":"_1cDCR"};
|
|
6456
6472
|
|
|
6457
6473
|
var _excluded$2j = ["children"];
|
|
6458
6474
|
|
|
@@ -6465,7 +6481,7 @@ function CustomControl(_ref) {
|
|
|
6465
6481
|
var SelectedOptionPrefix = props.selectProps.componentsProps.SelectedOptionPrefix;
|
|
6466
6482
|
var selectedOption = (_props$getValue = props.getValue()) === null || _props$getValue === void 0 ? void 0 : _props$getValue[0];
|
|
6467
6483
|
return React__default.createElement(components.Control, Object.assign({}, props), SelectedOptionPrefix && selectedOption ? React__default.createElement("div", {
|
|
6468
|
-
className: styles$
|
|
6484
|
+
className: styles$x['custom-control'],
|
|
6469
6485
|
style: {
|
|
6470
6486
|
paddingLeft: selectedOption ? 8 : 0
|
|
6471
6487
|
}
|
|
@@ -6494,7 +6510,7 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
6494
6510
|
asToolbarFilter = _ref$asToolbarFilter === void 0 ? false : _ref$asToolbarFilter,
|
|
6495
6511
|
_ref$wrapToNextLine = _ref.wrapToNextLine,
|
|
6496
6512
|
wrapToNextLine = _ref$wrapToNextLine === void 0 ? false : _ref$wrapToNextLine;
|
|
6497
|
-
var borderColor = isInvalid ?
|
|
6513
|
+
var borderColor = isInvalid ? COLORS['radish-400'] : COLORS['grey-200'];
|
|
6498
6514
|
return {
|
|
6499
6515
|
valueContainer: function valueContainer(base) {
|
|
6500
6516
|
return Object.assign({}, base, {
|
|
@@ -6506,16 +6522,16 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
6506
6522
|
flex: '1',
|
|
6507
6523
|
fontFamily: FONT_FAMILY,
|
|
6508
6524
|
minWidth: '110px',
|
|
6509
|
-
backgroundColor: state.isDisabled ?
|
|
6525
|
+
backgroundColor: state.isDisabled ? COLORS['grey-100'] : COLORS['white'],
|
|
6510
6526
|
position: 'initial',
|
|
6511
6527
|
borderRadius: '4px'
|
|
6512
6528
|
});
|
|
6513
6529
|
},
|
|
6514
6530
|
control: function control(base, state) {
|
|
6515
6531
|
return Object.assign({}, base, {
|
|
6516
|
-
borderColor: state.isFocused ?
|
|
6517
|
-
color: state.isDisabled ?
|
|
6518
|
-
boxShadow: state.isFocused ? "0 0 8px " +
|
|
6532
|
+
borderColor: state.isFocused ? COLORS['eggplant-400'] : borderColor,
|
|
6533
|
+
color: state.isDisabled ? COLORS['grey-400'] : COLORS['grey-500'],
|
|
6534
|
+
boxShadow: state.isFocused ? "0 0 8px " + COLORS['eggplant-300'] : 'none',
|
|
6519
6535
|
'&:hover': 'none',
|
|
6520
6536
|
background: 'none',
|
|
6521
6537
|
fontSize: '14px',
|
|
@@ -6523,7 +6539,7 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
6523
6539
|
width: asToolbarFilter ? 'fit-content' : undefined,
|
|
6524
6540
|
margin: 0,
|
|
6525
6541
|
':hover': asToolbarFilter ? {
|
|
6526
|
-
backgroundColor:
|
|
6542
|
+
backgroundColor: COLORS['grey-100']
|
|
6527
6543
|
} : 'none'
|
|
6528
6544
|
});
|
|
6529
6545
|
},
|
|
@@ -6534,7 +6550,7 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
6534
6550
|
},
|
|
6535
6551
|
placeholder: function placeholder(base, state) {
|
|
6536
6552
|
return _extends({}, base, {
|
|
6537
|
-
color: state.isDisabled && asToolbarFilter ?
|
|
6553
|
+
color: state.isDisabled && asToolbarFilter ? COLORS['grey-300'] : COLORS['grey-400'],
|
|
6538
6554
|
marginRight: 0,
|
|
6539
6555
|
position: 'static',
|
|
6540
6556
|
transform: 'initial',
|
|
@@ -6545,7 +6561,7 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
6545
6561
|
},
|
|
6546
6562
|
noOptionsMessage: function noOptionsMessage() {
|
|
6547
6563
|
return {
|
|
6548
|
-
color:
|
|
6564
|
+
color: COLORS['grey-400'],
|
|
6549
6565
|
textAlign: 'center',
|
|
6550
6566
|
padding: '8px',
|
|
6551
6567
|
fontFamily: FONT_FAMILY,
|
|
@@ -6554,7 +6570,7 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
6554
6570
|
},
|
|
6555
6571
|
loadingMessage: function loadingMessage() {
|
|
6556
6572
|
return {
|
|
6557
|
-
color:
|
|
6573
|
+
color: COLORS['grey-400'],
|
|
6558
6574
|
textAlign: 'center',
|
|
6559
6575
|
padding: '8px',
|
|
6560
6576
|
fontFamily: FONT_FAMILY,
|
|
@@ -6563,7 +6579,7 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
6563
6579
|
},
|
|
6564
6580
|
singleValue: function singleValue(base, state) {
|
|
6565
6581
|
return Object.assign({}, base, {
|
|
6566
|
-
color: state.isDisabled ?
|
|
6582
|
+
color: state.isDisabled ? COLORS['grey-400'] : null,
|
|
6567
6583
|
marginRight: 0,
|
|
6568
6584
|
position: asToolbarFilter ? 'static' : 'absolute',
|
|
6569
6585
|
transform: 'initial',
|
|
@@ -6575,15 +6591,15 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
6575
6591
|
},
|
|
6576
6592
|
dropdownIndicator: function dropdownIndicator(base, state) {
|
|
6577
6593
|
return Object.assign({}, base, {
|
|
6578
|
-
color: state.isDisabled ?
|
|
6594
|
+
color: state.isDisabled ? COLORS['grey-300'] : COLORS['grey-400'],
|
|
6579
6595
|
padding: '8px',
|
|
6580
6596
|
':hover': 'none'
|
|
6581
6597
|
});
|
|
6582
6598
|
},
|
|
6583
6599
|
option: function option(base, state) {
|
|
6584
6600
|
return Object.assign({}, base, {
|
|
6585
|
-
backgroundColor: state.isDisabled ? null : state.isSelected ?
|
|
6586
|
-
color: state.isDisabled ?
|
|
6601
|
+
backgroundColor: state.isDisabled ? null : state.isSelected ? COLORS['eggplant-200'] : state.isFocused ? COLORS['grey-100'] : COLORS['white'],
|
|
6602
|
+
color: state.isDisabled ? COLORS['grey-400'] : state.isSelected ? COLORS['eggplant-600'] : COLORS['grey-500'],
|
|
6587
6603
|
cursor: 'pointer',
|
|
6588
6604
|
fontFamily: FONT_FAMILY,
|
|
6589
6605
|
fontSize: '14px',
|
|
@@ -6599,15 +6615,15 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
6599
6615
|
return Object.assign({}, base, {
|
|
6600
6616
|
':hover': {
|
|
6601
6617
|
backgroundColor: 'none',
|
|
6602
|
-
color:
|
|
6618
|
+
color: COLORS['grey-500']
|
|
6603
6619
|
}
|
|
6604
6620
|
});
|
|
6605
6621
|
},
|
|
6606
6622
|
clearIndicator: function clearIndicator(base) {
|
|
6607
6623
|
return Object.assign({}, base, {
|
|
6608
|
-
color:
|
|
6624
|
+
color: COLORS['grey-400'],
|
|
6609
6625
|
':hover': {
|
|
6610
|
-
color:
|
|
6626
|
+
color: COLORS['grey-500']
|
|
6611
6627
|
}
|
|
6612
6628
|
});
|
|
6613
6629
|
},
|
|
@@ -6633,7 +6649,7 @@ var CustomContainer = function CustomContainer(props) {
|
|
|
6633
6649
|
}));
|
|
6634
6650
|
};
|
|
6635
6651
|
|
|
6636
|
-
var styles$
|
|
6652
|
+
var styles$y = {"custom-menu-text-field":"_2-zhH","custom-menu-hr":"_3sdnK","custom-menu-div":"_2F1jP"};
|
|
6637
6653
|
|
|
6638
6654
|
var _excluded$2l = ["children"];
|
|
6639
6655
|
|
|
@@ -6703,15 +6719,15 @@ function CustomMenu(_ref) {
|
|
|
6703
6719
|
return React__default.createElement(components.Menu, Object.assign({}, props), React__default.createElement("div", {
|
|
6704
6720
|
ref: containerRef
|
|
6705
6721
|
}, children, React__default.createElement("hr", {
|
|
6706
|
-
className: styles$
|
|
6722
|
+
className: styles$y['custom-menu-hr']
|
|
6707
6723
|
}), !showFooter ? React__default.createElement(CreatableButton, null) : React__default.createElement("div", {
|
|
6708
|
-
className: styles$
|
|
6724
|
+
className: styles$y['custom-menu-div']
|
|
6709
6725
|
}, React__default.createElement(Flex, {
|
|
6710
6726
|
space: 4,
|
|
6711
6727
|
flex: [1],
|
|
6712
6728
|
flexItems: true
|
|
6713
6729
|
}, React__default.createElement("input", {
|
|
6714
|
-
className: classnames(textFieldStyles['text-field'], styles$
|
|
6730
|
+
className: classnames(textFieldStyles['text-field'], styles$y['custom-menu-text-field']),
|
|
6715
6731
|
autoCorrect: "off",
|
|
6716
6732
|
autoComplete: "off",
|
|
6717
6733
|
spellCheck: "false",
|
|
@@ -6894,9 +6910,9 @@ var ToolbarSelect = function ToolbarSelect(_ref) {
|
|
|
6894
6910
|
});
|
|
6895
6911
|
};
|
|
6896
6912
|
|
|
6897
|
-
var styles$
|
|
6913
|
+
var styles$z = {"date-filter":"_2X-yg","date-filter--wide":"_3O5Kh"};
|
|
6898
6914
|
|
|
6899
|
-
var styles$
|
|
6915
|
+
var styles$A = {"date-filter-display":"_23gnr","date-filter-display--non-interactive":"_Zv1Se","date-filter-display--wide":"_18V8V","date-filter-display__display-icon":"_2v9v_"};
|
|
6900
6916
|
|
|
6901
6917
|
var DATE_FILTER_MODE = {
|
|
6902
6918
|
DAY: 'day',
|
|
@@ -6940,7 +6956,7 @@ var DateFilterText = function DateFilterText(_ref) {
|
|
|
6940
6956
|
space: 12
|
|
6941
6957
|
}, React__default.createElement("span", null, getDateString(weekRange.start, mode)), React__default.createElement(IconArrowRight, {
|
|
6942
6958
|
size: "small",
|
|
6943
|
-
color:
|
|
6959
|
+
color: "grey-400"
|
|
6944
6960
|
}), React__default.createElement("span", null, getDateString(weekRange.end, mode)));
|
|
6945
6961
|
|
|
6946
6962
|
default:
|
|
@@ -6956,17 +6972,17 @@ var DateFilterDisplay = function DateFilterDisplay(_ref) {
|
|
|
6956
6972
|
weekStart = _ref.weekStart,
|
|
6957
6973
|
onClick = _ref.onClick;
|
|
6958
6974
|
return React__default.createElement("button", {
|
|
6959
|
-
className: classnames(styles$
|
|
6975
|
+
className: classnames(styles$A['date-filter-display'], (_classnames = {}, _classnames[styles$A['date-filter-display--wide']] = mode === DATE_FILTER_MODE.WEEK, _classnames[styles$A['date-filter-display--non-interactive']] = mode === DATE_FILTER_MODE.MONTH, _classnames)),
|
|
6960
6976
|
onClick: onClick,
|
|
6961
6977
|
tabIndex: mode === DATE_FILTER_MODE.MONTH ? -1 : undefined
|
|
6962
6978
|
}, React__default.createElement(Inline, {
|
|
6963
6979
|
space: 12,
|
|
6964
6980
|
alignItems: "center"
|
|
6965
6981
|
}, React__default.createElement("div", {
|
|
6966
|
-
className: classnames(styles$
|
|
6982
|
+
className: classnames(styles$A['date-filter-display__display-icon'])
|
|
6967
6983
|
}, React__default.createElement(IconCalendarAlt, {
|
|
6968
6984
|
size: "flexible",
|
|
6969
|
-
color:
|
|
6985
|
+
color: "grey-400"
|
|
6970
6986
|
})), React__default.createElement(DateFilterText, {
|
|
6971
6987
|
mode: mode,
|
|
6972
6988
|
selectedDate: selectedDate,
|
|
@@ -6974,7 +6990,7 @@ var DateFilterDisplay = function DateFilterDisplay(_ref) {
|
|
|
6974
6990
|
})));
|
|
6975
6991
|
};
|
|
6976
6992
|
|
|
6977
|
-
var styles$
|
|
6993
|
+
var styles$B = {"date-stepper":"_s8MoI","date-stepper--backward":"_34Yoi","date-stepper--forward":"_BeWpb"};
|
|
6978
6994
|
|
|
6979
6995
|
var handleDateStepper = function handleDateStepper(date, mode, stepDirection, onChange) {
|
|
6980
6996
|
var step = stepDirection === STEP_DIRECTION.FORWARD ? 1 : -1;
|
|
@@ -7009,7 +7025,7 @@ var DateFilterStepper = function DateFilterStepper(_ref) {
|
|
|
7009
7025
|
onChange = _ref.onChange,
|
|
7010
7026
|
date = _ref.date;
|
|
7011
7027
|
return React__default.createElement("button", {
|
|
7012
|
-
className: classnames(styles$
|
|
7028
|
+
className: classnames(styles$B['date-stepper'], (_classnames = {}, _classnames[styles$B['date-stepper--backward']] = stepDirection === STEP_DIRECTION.BACKWARD, _classnames[styles$B['date-stepper--forward']] = stepDirection === STEP_DIRECTION.FORWARD, _classnames)),
|
|
7013
7029
|
onClick: function onClick() {
|
|
7014
7030
|
return handleDateStepper(date, mode, stepDirection, onChange);
|
|
7015
7031
|
}
|
|
@@ -7045,7 +7061,7 @@ var DateFilter = function DateFilter(_ref) {
|
|
|
7045
7061
|
return React__default.createElement("div", {
|
|
7046
7062
|
"data-testid": testId,
|
|
7047
7063
|
ref: calendarAnchorRef,
|
|
7048
|
-
className: classnames(styles$
|
|
7064
|
+
className: classnames(styles$z['date-filter'], (_classnames = {}, _classnames[styles$z['date-filter--wide']] = mode === DATE_FILTER_MODE.WEEK, _classnames))
|
|
7049
7065
|
}, React__default.createElement(Inline, {
|
|
7050
7066
|
space: 0
|
|
7051
7067
|
}, React__default.createElement(DateFilterStepper, {
|
|
@@ -7055,7 +7071,7 @@ var DateFilter = function DateFilter(_ref) {
|
|
|
7055
7071
|
onChange: handleChange
|
|
7056
7072
|
}, React__default.createElement(IconChevronLeft, {
|
|
7057
7073
|
size: "small",
|
|
7058
|
-
color:
|
|
7074
|
+
color: "grey-400"
|
|
7059
7075
|
})), React__default.createElement(DateFilterDisplay, {
|
|
7060
7076
|
mode: mode,
|
|
7061
7077
|
weekStart: weekStart,
|
|
@@ -7072,7 +7088,7 @@ var DateFilter = function DateFilter(_ref) {
|
|
|
7072
7088
|
onChange: handleChange
|
|
7073
7089
|
}, React__default.createElement(IconChevronRight, {
|
|
7074
7090
|
size: "small",
|
|
7075
|
-
color:
|
|
7091
|
+
color: "grey-400"
|
|
7076
7092
|
}))), calendarOpen && mode !== DATE_FILTER_MODE.MONTH && React__default.createElement(Calendar, {
|
|
7077
7093
|
onSelect: handleChange,
|
|
7078
7094
|
selected: date,
|
|
@@ -7086,7 +7102,7 @@ var DateFilter = function DateFilter(_ref) {
|
|
|
7086
7102
|
}));
|
|
7087
7103
|
};
|
|
7088
7104
|
|
|
7089
|
-
var styles$
|
|
7105
|
+
var styles$C = {"segmented-control":"_J5ph7","segmented-control__button":"_2xgv4","segmented-control__button--selected":"_1vG3O","segmented-control__divider":"_1uKNF"};
|
|
7090
7106
|
|
|
7091
7107
|
var SegmentedControl = function SegmentedControl(_ref) {
|
|
7092
7108
|
var options = _ref.options,
|
|
@@ -7103,7 +7119,7 @@ var SegmentedControl = function SegmentedControl(_ref) {
|
|
|
7103
7119
|
};
|
|
7104
7120
|
|
|
7105
7121
|
return React__default.createElement("div", {
|
|
7106
|
-
className: styles$
|
|
7122
|
+
className: styles$C['segmented-control'],
|
|
7107
7123
|
"data-testid": testId
|
|
7108
7124
|
}, options.map(function (option, i) {
|
|
7109
7125
|
var _classnames;
|
|
@@ -7114,16 +7130,16 @@ var SegmentedControl = function SegmentedControl(_ref) {
|
|
|
7114
7130
|
onClick: function onClick() {
|
|
7115
7131
|
return onChange(option);
|
|
7116
7132
|
},
|
|
7117
|
-
className: classnames(styles$
|
|
7133
|
+
className: classnames(styles$C['segmented-control__button'], (_classnames = {}, _classnames[styles$C['segmented-control__button--selected']] = isSelected(option), _classnames))
|
|
7118
7134
|
}, option), !isLastElement(i) && React__default.createElement("div", {
|
|
7119
|
-
className: classnames(styles$
|
|
7135
|
+
className: classnames(styles$C['segmented-control__divider'])
|
|
7120
7136
|
}));
|
|
7121
7137
|
}));
|
|
7122
7138
|
};
|
|
7123
7139
|
|
|
7124
|
-
var styles$
|
|
7140
|
+
var styles$D = {"form--standard-size":"_3CaV0"};
|
|
7125
7141
|
|
|
7126
|
-
var styles$
|
|
7142
|
+
var styles$E = {"card":"_29ZIp","card__body":"_3Q8NT","card__body--interactive":"_2Fah6","card--focus":"_SGno0","card__body--focus":"_1zqRN","card__body--with-kebab":"_3Hwms","card__kebab":"_TmEUS"};
|
|
7127
7143
|
|
|
7128
7144
|
var _excluded$2m = ["children", "onClick", "isSelected", "actions", "testId"];
|
|
7129
7145
|
|
|
@@ -7140,18 +7156,18 @@ var Card = function Card(_ref) {
|
|
|
7140
7156
|
|
|
7141
7157
|
var positionStyles = usePositionStyles(positionProps);
|
|
7142
7158
|
return React__default.createElement("div", {
|
|
7143
|
-
className: classnames(styles$
|
|
7159
|
+
className: classnames(styles$E['card']),
|
|
7144
7160
|
style: positionStyles
|
|
7145
7161
|
}, onClick ? React__default.createElement("button", {
|
|
7146
|
-
className: classnames(styles$
|
|
7162
|
+
className: classnames(styles$E['card__body'], styles$E['card__body--interactive'], (_classnames = {}, _classnames[styles$E['card__body--focus']] = isSelected, _classnames[styles$E['card__body--with-kebab']] = actions, _classnames)),
|
|
7147
7163
|
"data-testid": testId,
|
|
7148
7164
|
tabIndex: 0,
|
|
7149
7165
|
onClick: onClick
|
|
7150
7166
|
}, children) : React__default.createElement("div", {
|
|
7151
|
-
className: classnames(styles$
|
|
7167
|
+
className: classnames(styles$E['card__body'], (_classnames2 = {}, _classnames2[styles$E['card__body--focus']] = isSelected, _classnames2[styles$E['card__body--with-kebab']] = actions, _classnames2)),
|
|
7152
7168
|
"data-testid": testId
|
|
7153
7169
|
}, children), actions && React__default.createElement("div", {
|
|
7154
|
-
className: classnames(styles$
|
|
7170
|
+
className: classnames(styles$E['card__kebab'])
|
|
7155
7171
|
}, React__default.createElement(KebabMenu, {
|
|
7156
7172
|
actions: actions
|
|
7157
7173
|
})));
|
|
@@ -7165,7 +7181,7 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
|
|
|
7165
7181
|
}, children);
|
|
7166
7182
|
};
|
|
7167
7183
|
|
|
7168
|
-
var styles$
|
|
7184
|
+
var styles$F = {"breadcrumb-item":"_XFvYB"};
|
|
7169
7185
|
|
|
7170
7186
|
var BreadcrumbItem = function BreadcrumbItem(_ref) {
|
|
7171
7187
|
var href = _ref.href,
|
|
@@ -7178,24 +7194,24 @@ var BreadcrumbItem = function BreadcrumbItem(_ref) {
|
|
|
7178
7194
|
}), children);
|
|
7179
7195
|
return reloadDocument ? React__default.createElement("a", {
|
|
7180
7196
|
href: href,
|
|
7181
|
-
className: styles$
|
|
7197
|
+
className: styles$F['breadcrumb-item'],
|
|
7182
7198
|
"data-testid": testId
|
|
7183
7199
|
}, content) : React__default.createElement(Link$1, {
|
|
7184
7200
|
to: href,
|
|
7185
|
-
className: styles$
|
|
7201
|
+
className: styles$F['breadcrumb-item'],
|
|
7186
7202
|
relative: "path",
|
|
7187
7203
|
reloadDocument: reloadDocument,
|
|
7188
7204
|
"data-testid": testId
|
|
7189
7205
|
}, content);
|
|
7190
7206
|
};
|
|
7191
7207
|
|
|
7192
|
-
var styles$
|
|
7208
|
+
var styles$G = {"page-breadcrumbs":"_HAJCd"};
|
|
7193
7209
|
|
|
7194
7210
|
var PageBreadcrumbs = function PageBreadcrumbs(_ref) {
|
|
7195
7211
|
var breadcrumbs = _ref.breadcrumbs;
|
|
7196
7212
|
var items = getBreadbrumbItems(breadcrumbs);
|
|
7197
7213
|
return React__default.createElement("div", {
|
|
7198
|
-
className: styles$
|
|
7214
|
+
className: styles$G['page-breadcrumbs']
|
|
7199
7215
|
}, React__default.createElement(Breadcrumbs, null, items));
|
|
7200
7216
|
};
|
|
7201
7217
|
|
|
@@ -7220,7 +7236,7 @@ var getBreadbrumbItems = function getBreadbrumbItems(breadcrumbs) {
|
|
|
7220
7236
|
}, breadcrumbs.label);
|
|
7221
7237
|
};
|
|
7222
7238
|
|
|
7223
|
-
var styles$
|
|
7239
|
+
var styles$H = {"page":"_FbhTM","page--fullwidth":"_3QyAE","page--restricted":"_17aOG"};
|
|
7224
7240
|
|
|
7225
7241
|
var PAGE_SIZES = {
|
|
7226
7242
|
FULL_WIDTH: 'fullwidth',
|
|
@@ -7243,7 +7259,7 @@ var Page = function Page(_ref) {
|
|
|
7243
7259
|
var hasHeader = title || actions;
|
|
7244
7260
|
var hasPageBlocks = hasHeader || banner || filterBar;
|
|
7245
7261
|
return React__default.createElement("div", {
|
|
7246
|
-
className: classnames(styles$
|
|
7262
|
+
className: classnames(styles$H['page'], (_classNames = {}, _classNames[styles$H['page--restricted']] = size === PAGE_SIZES.RESTRICTED, _classNames[styles$H['page--fullwidth']] = size === PAGE_SIZES.FULL_WIDTH, _classNames)),
|
|
7247
7263
|
"data-testid": testId
|
|
7248
7264
|
}, React__default.createElement(Stack, {
|
|
7249
7265
|
space: 20
|
|
@@ -7263,7 +7279,7 @@ var Page = function Page(_ref) {
|
|
|
7263
7279
|
}, title), actions), subtitle && React__default.createElement(Text, null, subtitle)), banner, filterBar)), children));
|
|
7264
7280
|
};
|
|
7265
7281
|
|
|
7266
|
-
var styles$
|
|
7282
|
+
var styles$I = {"form-section":"_7-5gD","form-section__title":"_a83vM","form-section__subtitle":"_1lKv8","form-section--no-margin":"_lZyFQ"};
|
|
7267
7283
|
|
|
7268
7284
|
var FormSection = function FormSection(_ref) {
|
|
7269
7285
|
var _classnames;
|
|
@@ -7275,14 +7291,14 @@ var FormSection = function FormSection(_ref) {
|
|
|
7275
7291
|
noMargin = _ref$noMargin === void 0 ? false : _ref$noMargin,
|
|
7276
7292
|
testId = _ref.testId;
|
|
7277
7293
|
return React__default.createElement("div", {
|
|
7278
|
-
className: classnames(styles$
|
|
7294
|
+
className: classnames(styles$I['form-section'], (_classnames = {}, _classnames[styles$I['form-section--no-margin']] = noMargin, _classnames)),
|
|
7279
7295
|
"data-testid": testId
|
|
7280
7296
|
}, React__default.createElement(Stack, null, React__default.createElement(Stack, {
|
|
7281
7297
|
space: 8
|
|
7282
7298
|
}, title && React__default.createElement("h2", {
|
|
7283
|
-
className: classnames(styles$
|
|
7299
|
+
className: classnames(styles$I['form-section__title'])
|
|
7284
7300
|
}, title), subtitle && React__default.createElement("h3", {
|
|
7285
|
-
className: classnames(styles$
|
|
7301
|
+
className: classnames(styles$I['form-section__subtitle'])
|
|
7286
7302
|
}, subtitle)), children));
|
|
7287
7303
|
};
|
|
7288
7304
|
|
|
@@ -7300,7 +7316,7 @@ var updateButtonProps$1 = function updateButtonProps(child, newProps) {
|
|
|
7300
7316
|
}, newProps, child.props));
|
|
7301
7317
|
};
|
|
7302
7318
|
|
|
7303
|
-
var styles$
|
|
7319
|
+
var styles$J = {"form-footer":"_3vVBF"};
|
|
7304
7320
|
|
|
7305
7321
|
var FormFooterActions = function FormFooterActions(_ref) {
|
|
7306
7322
|
var _actions$primary, _actions$secondary, _actions$tertiary;
|
|
@@ -7335,7 +7351,7 @@ var FormFooter = function FormFooter(_ref) {
|
|
|
7335
7351
|
});
|
|
7336
7352
|
var isInlineChildren = React__default.Children.count(children) === 1 && React__default.isValidElement(children) && children.type === Inline;
|
|
7337
7353
|
return React__default.createElement("div", {
|
|
7338
|
-
className: classnames(styles$
|
|
7354
|
+
className: classnames(styles$J['form-footer']),
|
|
7339
7355
|
"data-testid": testId
|
|
7340
7356
|
}, actions && React__default.createElement(FormFooterActions, {
|
|
7341
7357
|
actions: actions
|
|
@@ -7377,12 +7393,12 @@ var Form = function Form(_ref) {
|
|
|
7377
7393
|
}
|
|
7378
7394
|
}, React__default.createElement("form", {
|
|
7379
7395
|
onSubmit: onSubmit ? handleSubmit : formik === null || formik === void 0 ? void 0 : formik.handleSubmit,
|
|
7380
|
-
className: classnames((_classnames = {}, _classnames[styles$
|
|
7396
|
+
className: classnames((_classnames = {}, _classnames[styles$D['form--standard-size']] = !wide, _classnames)),
|
|
7381
7397
|
"data-testid": testId
|
|
7382
7398
|
}, stackContent ? React__default.createElement(Stack, null, formattedChildren) : formattedChildren));
|
|
7383
7399
|
};
|
|
7384
7400
|
|
|
7385
|
-
var styles$
|
|
7401
|
+
var styles$K = {"form-row":"_2i-Ll"};
|
|
7386
7402
|
|
|
7387
7403
|
var SIZE_25_PERCENT = '25%';
|
|
7388
7404
|
var SIZE_33_PERCENT = '33.333%';
|
|
@@ -7413,7 +7429,7 @@ var FormRow = function FormRow(_ref) {
|
|
|
7413
7429
|
space: 20,
|
|
7414
7430
|
testId: testId,
|
|
7415
7431
|
alignItems: "stretch",
|
|
7416
|
-
extraClass: styles$
|
|
7432
|
+
extraClass: styles$K['form-row']
|
|
7417
7433
|
}, children, additionalColumns.map(function (_, index) {
|
|
7418
7434
|
return React__default.createElement("span", {
|
|
7419
7435
|
key: index,
|
|
@@ -7422,7 +7438,7 @@ var FormRow = function FormRow(_ref) {
|
|
|
7422
7438
|
}));
|
|
7423
7439
|
};
|
|
7424
7440
|
|
|
7425
|
-
var styles$
|
|
7441
|
+
var styles$L = {"text-field":"_BkzdC","text-field--focus":"_Rop31","text-field--disabled":"_2x3Cm","text-field--invalid":"_3zOwV","text-field__toolbar":"_rQqnL"};
|
|
7426
7442
|
|
|
7427
7443
|
var useGrowTextAreaRef = function useGrowTextAreaRef(minHeight, maxHeight, autoGrow, forwardedRef) {
|
|
7428
7444
|
var textareaRef = useRef(null);
|
|
@@ -7498,7 +7514,7 @@ var TextAreaField = function TextAreaField(_ref) {
|
|
|
7498
7514
|
updateHeight = _useGrowTextAreaRef.updateHeight;
|
|
7499
7515
|
|
|
7500
7516
|
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement("div", {
|
|
7501
|
-
className: classnames(styles$
|
|
7517
|
+
className: classnames(styles$L['text-field'], (_classnames = {}, _classnames[styles$L['text-field--invalid']] = hasError, _classnames[styles$L['text-field--disabled']] = disabled, _classnames[styles$L['text-field--focus']] = hasFocus, _classnames)),
|
|
7502
7518
|
ref: containerRef,
|
|
7503
7519
|
onClick: function onClick(event) {
|
|
7504
7520
|
if (event.target === (containerRef === null || containerRef === void 0 ? void 0 : containerRef.current)) {
|
|
@@ -7530,7 +7546,7 @@ var TextAreaField = function TextAreaField(_ref) {
|
|
|
7530
7546
|
},
|
|
7531
7547
|
ref: textAreaRef
|
|
7532
7548
|
}), toolbar && React__default.createElement("div", {
|
|
7533
|
-
className: styles$
|
|
7549
|
+
className: styles$L['text-field__toolbar'],
|
|
7534
7550
|
id: controllers.id + "-toolbar",
|
|
7535
7551
|
ref: toolbarRef,
|
|
7536
7552
|
onClick: function onClick(event) {
|
|
@@ -7610,7 +7626,7 @@ var useCheckBoxFieldControllers = function useCheckBoxFieldControllers(_ref) {
|
|
|
7610
7626
|
return controllers;
|
|
7611
7627
|
};
|
|
7612
7628
|
|
|
7613
|
-
var styles$
|
|
7629
|
+
var styles$M = {"check-box-field":"_2sg0c","check-box-field__caption":"_2LdrP","check-box-field__custom-input":"_2mA8e"};
|
|
7614
7630
|
|
|
7615
7631
|
var CheckboxField = function CheckboxField(_ref) {
|
|
7616
7632
|
var name = _ref.name,
|
|
@@ -7640,7 +7656,7 @@ var CheckboxField = function CheckboxField(_ref) {
|
|
|
7640
7656
|
flexItems: true,
|
|
7641
7657
|
flex: ['0 0 auto']
|
|
7642
7658
|
}, React__default.createElement("div", {
|
|
7643
|
-
className: styles$
|
|
7659
|
+
className: styles$M['check-box-field']
|
|
7644
7660
|
}, React__default.createElement("input", {
|
|
7645
7661
|
name: name,
|
|
7646
7662
|
id: controllers.id,
|
|
@@ -7653,12 +7669,12 @@ var CheckboxField = function CheckboxField(_ref) {
|
|
|
7653
7669
|
onChange: controllers.onChange,
|
|
7654
7670
|
onBlur: controllers.onBlur
|
|
7655
7671
|
}), React__default.createElement("span", {
|
|
7656
|
-
className: styles$
|
|
7672
|
+
className: styles$M['check-box-field__custom-input']
|
|
7657
7673
|
})), label && React__default.createElement(Label, {
|
|
7658
7674
|
htmlFor: controllers.id,
|
|
7659
7675
|
truncate: false
|
|
7660
7676
|
}, label)), caption && React__default.createElement("div", {
|
|
7661
|
-
className: styles$
|
|
7677
|
+
className: styles$M['check-box-field__caption']
|
|
7662
7678
|
}, React__default.createElement(Caption, {
|
|
7663
7679
|
fieldId: controllers.id
|
|
7664
7680
|
}, caption)), controllers.error && React__default.createElement(ErrorMessage, {
|
|
@@ -7666,7 +7682,7 @@ var CheckboxField = function CheckboxField(_ref) {
|
|
|
7666
7682
|
}, controllers.error));
|
|
7667
7683
|
};
|
|
7668
7684
|
|
|
7669
|
-
var styles$
|
|
7685
|
+
var styles$N = {"pill-select-field":"_g6T-p","pill-select-field__custom-input":"_1i2AX"};
|
|
7670
7686
|
|
|
7671
7687
|
var useMultiSelectFieldControllers = function useMultiSelectFieldControllers(_ref) {
|
|
7672
7688
|
var name = _ref.name,
|
|
@@ -7758,7 +7774,7 @@ var PillSelectField = function PillSelectField(_ref) {
|
|
|
7758
7774
|
var itemId = controllers.id + "-" + itemIdentifier;
|
|
7759
7775
|
return React__default.createElement("div", {
|
|
7760
7776
|
key: itemIdentifier,
|
|
7761
|
-
className: styles$
|
|
7777
|
+
className: styles$N['pill-select-field']
|
|
7762
7778
|
}, React__default.createElement("input", {
|
|
7763
7779
|
name: name + "-" + itemIdentifier,
|
|
7764
7780
|
id: itemId,
|
|
@@ -7780,7 +7796,7 @@ var PillSelectField = function PillSelectField(_ref) {
|
|
|
7780
7796
|
controllers.onChange(newValue);
|
|
7781
7797
|
}
|
|
7782
7798
|
}), React__default.createElement("span", {
|
|
7783
|
-
className: styles$
|
|
7799
|
+
className: styles$N['pill-select-field__custom-input']
|
|
7784
7800
|
}, option.label));
|
|
7785
7801
|
})));
|
|
7786
7802
|
};
|
|
@@ -7828,9 +7844,9 @@ var useRadioGroupFieldContext = function useRadioGroupFieldContext() {
|
|
|
7828
7844
|
return context;
|
|
7829
7845
|
};
|
|
7830
7846
|
|
|
7831
|
-
var styles$
|
|
7847
|
+
var styles$O = {"label":"_1WGz2","label--truncate":"_mQ9Rd","radio-group-field__label":"_RXyG_"};
|
|
7832
7848
|
|
|
7833
|
-
var styles$
|
|
7849
|
+
var styles$P = {"label":"_1Tw96","label--truncate":"_1o8rK","radio-group-box-option":"_2OGKE","radio-group-box-option__box":"_23M9k","radio-group-box-option__label":"_1r-Wg"};
|
|
7834
7850
|
|
|
7835
7851
|
var RadioGroupBoxOption = function RadioGroupBoxOption(_ref) {
|
|
7836
7852
|
var value = _ref.value,
|
|
@@ -7845,7 +7861,7 @@ var RadioGroupBoxOption = function RadioGroupBoxOption(_ref) {
|
|
|
7845
7861
|
id: inputId
|
|
7846
7862
|
});
|
|
7847
7863
|
return React__default.createElement("label", {
|
|
7848
|
-
className: styles$
|
|
7864
|
+
className: styles$P['radio-group-box-option']
|
|
7849
7865
|
}, React__default.createElement("input", {
|
|
7850
7866
|
type: "radio",
|
|
7851
7867
|
"data-testid": testId,
|
|
@@ -7856,7 +7872,7 @@ var RadioGroupBoxOption = function RadioGroupBoxOption(_ref) {
|
|
|
7856
7872
|
checked: radioGroupContext.value !== undefined ? radioGroupContext.value === value : undefined,
|
|
7857
7873
|
disabled: radioGroupContext.disabled
|
|
7858
7874
|
}), React__default.createElement("div", {
|
|
7859
|
-
className: styles$
|
|
7875
|
+
className: styles$P['radio-group-box-option__box']
|
|
7860
7876
|
}, React__default.createElement(Stack, {
|
|
7861
7877
|
space: 16,
|
|
7862
7878
|
alignItems: "center",
|
|
@@ -7865,13 +7881,13 @@ var RadioGroupBoxOption = function RadioGroupBoxOption(_ref) {
|
|
|
7865
7881
|
space: 8,
|
|
7866
7882
|
alignItems: "center"
|
|
7867
7883
|
}, label && React__default.createElement("div", {
|
|
7868
|
-
className: styles$
|
|
7884
|
+
className: styles$P['radio-group-box-option__label']
|
|
7869
7885
|
}, label), caption && React__default.createElement(Caption, {
|
|
7870
7886
|
fieldId: id
|
|
7871
7887
|
}, caption)))));
|
|
7872
7888
|
};
|
|
7873
7889
|
|
|
7874
|
-
var styles$
|
|
7890
|
+
var styles$Q = {"radio-group-option":"_1Clmp","radio-group-option__caption":"_3UmWA","radio-group-option__custom-input":"_1tMq-"};
|
|
7875
7891
|
|
|
7876
7892
|
var RadioGroupOption = function RadioGroupOption(_ref) {
|
|
7877
7893
|
var value = _ref.value,
|
|
@@ -7890,7 +7906,7 @@ var RadioGroupOption = function RadioGroupOption(_ref) {
|
|
|
7890
7906
|
space: 8,
|
|
7891
7907
|
alignItems: "center"
|
|
7892
7908
|
}, React__default.createElement("div", {
|
|
7893
|
-
className: styles$
|
|
7909
|
+
className: styles$Q['radio-group-option']
|
|
7894
7910
|
}, React__default.createElement("input", {
|
|
7895
7911
|
type: "radio",
|
|
7896
7912
|
"data-testid": testId,
|
|
@@ -7901,11 +7917,11 @@ var RadioGroupOption = function RadioGroupOption(_ref) {
|
|
|
7901
7917
|
checked: radioGroupContext.value !== undefined ? radioGroupContext.value === value : undefined,
|
|
7902
7918
|
disabled: radioGroupContext.disabled
|
|
7903
7919
|
}), React__default.createElement("span", {
|
|
7904
|
-
className: styles$
|
|
7920
|
+
className: styles$Q['radio-group-option__custom-input']
|
|
7905
7921
|
})), label && React__default.createElement(Label, {
|
|
7906
7922
|
htmlFor: id
|
|
7907
7923
|
}, label)), caption && React__default.createElement("div", {
|
|
7908
|
-
className: styles$
|
|
7924
|
+
className: styles$Q['radio-group-option__caption']
|
|
7909
7925
|
}, React__default.createElement(Caption, {
|
|
7910
7926
|
fieldId: id
|
|
7911
7927
|
}, caption)));
|
|
@@ -8040,7 +8056,7 @@ var RadioGroupField = function RadioGroupField(_ref) {
|
|
|
8040
8056
|
}, React__default.createElement(Stack, {
|
|
8041
8057
|
space: 12
|
|
8042
8058
|
}, label && React__default.createElement("div", {
|
|
8043
|
-
className: styles$
|
|
8059
|
+
className: styles$O['radio-group-field__label']
|
|
8044
8060
|
}, label), React__default.createElement(Stack, {
|
|
8045
8061
|
space: 8
|
|
8046
8062
|
}, optionsType === OPTION_TYPES.RADIO ? React__default.createElement(RadioOptions, {
|
|
@@ -8053,9 +8069,9 @@ var RadioGroupField = function RadioGroupField(_ref) {
|
|
|
8053
8069
|
}, children), controllers.error && React__default.createElement(ErrorMessage, null, controllers.error))));
|
|
8054
8070
|
};
|
|
8055
8071
|
|
|
8056
|
-
var styles$
|
|
8072
|
+
var styles$R = {"text-field":"_18Rzv","text-field--invalid":"_3eD7t","text-field--prefixed":"_2evrG","text-field--suffixed":"_-MgeO","password-container":"_-Rf3c","password-toggle":"_yinPY"};
|
|
8057
8073
|
|
|
8058
|
-
var styles$
|
|
8074
|
+
var styles$S = {"password-criteria":"_U0krC","password-criteria--invalid":"_2XIl4"};
|
|
8059
8075
|
|
|
8060
8076
|
var PasswordCriteria = function PasswordCriteria(_ref) {
|
|
8061
8077
|
var _classnames;
|
|
@@ -8063,12 +8079,12 @@ var PasswordCriteria = function PasswordCriteria(_ref) {
|
|
|
8063
8079
|
var met = _ref.met,
|
|
8064
8080
|
children = _ref.children;
|
|
8065
8081
|
return React__default.createElement("span", {
|
|
8066
|
-
className: classnames(styles$
|
|
8082
|
+
className: classnames(styles$S['password-criteria'], (_classnames = {}, _classnames[styles$S['password-criteria--invalid']] = !met, _classnames))
|
|
8067
8083
|
}, React__default.createElement(Inline, {
|
|
8068
8084
|
space: met ? 4 : 8
|
|
8069
8085
|
}, met ? React__default.createElement(IconCheck, {
|
|
8070
8086
|
size: "small",
|
|
8071
|
-
color:
|
|
8087
|
+
color: "grey-200"
|
|
8072
8088
|
}) : "\u25CF", children));
|
|
8073
8089
|
};
|
|
8074
8090
|
|
|
@@ -8148,11 +8164,11 @@ var PasswordField = function PasswordField(_ref) {
|
|
|
8148
8164
|
error: controllers.error
|
|
8149
8165
|
};
|
|
8150
8166
|
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement("div", {
|
|
8151
|
-
className: styles$
|
|
8167
|
+
className: styles$R['password-container']
|
|
8152
8168
|
}, React__default.createElement("input", {
|
|
8153
8169
|
name: name,
|
|
8154
8170
|
id: controllers.id,
|
|
8155
|
-
className: classnames(styles$
|
|
8171
|
+
className: classnames(styles$R['text-field'], (_classnames = {}, _classnames[styles$R['text-field--invalid']] = hasError, _classnames)),
|
|
8156
8172
|
type: type,
|
|
8157
8173
|
"data-testid": testId,
|
|
8158
8174
|
"aria-describedby": hasError ? controllers.id + "-error-message" : controllers.id + "-describer",
|
|
@@ -8164,16 +8180,16 @@ var PasswordField = function PasswordField(_ref) {
|
|
|
8164
8180
|
onChange: controllers.onChange,
|
|
8165
8181
|
onBlur: controllers.onBlur
|
|
8166
8182
|
}), React__default.createElement("div", {
|
|
8167
|
-
className: styles$
|
|
8183
|
+
className: styles$R['password-toggle'],
|
|
8168
8184
|
onClick: toggleType,
|
|
8169
8185
|
onKeyPress: toggleType,
|
|
8170
8186
|
"data-testid": testId && testId + "-toggle",
|
|
8171
8187
|
tabIndex: 0,
|
|
8172
8188
|
role: "button"
|
|
8173
8189
|
}, type === 'password' ? React__default.createElement(IconEyeSlash, {
|
|
8174
|
-
color:
|
|
8190
|
+
color: "grey-400"
|
|
8175
8191
|
}) : React__default.createElement(IconEye, {
|
|
8176
|
-
color:
|
|
8192
|
+
color: "grey-400"
|
|
8177
8193
|
}))));
|
|
8178
8194
|
};
|
|
8179
8195
|
|
|
@@ -8255,7 +8271,7 @@ var MultiSelectField = function MultiSelectField(_ref) {
|
|
|
8255
8271
|
}));
|
|
8256
8272
|
};
|
|
8257
8273
|
|
|
8258
|
-
var styles$
|
|
8274
|
+
var styles$T = {"custom-list":"_uC4zU"};
|
|
8259
8275
|
|
|
8260
8276
|
var _excluded$2o = ["children", "hasMoreOptions", "hasMoreOptionsFirstLoad"];
|
|
8261
8277
|
|
|
@@ -8274,7 +8290,7 @@ var CustomList = function CustomList(_ref) {
|
|
|
8274
8290
|
return React__default.createElement(components.MenuList, Object.assign({}, props), React__default.createElement(Fragment, null, children, showFooter && React__default.createElement(Inline, {
|
|
8275
8291
|
justifyContent: "center"
|
|
8276
8292
|
}, React__default.createElement("div", {
|
|
8277
|
-
className: styles$
|
|
8293
|
+
className: styles$T['custom-list']
|
|
8278
8294
|
}, getLocalizedString('main.START_TYPING_TO_SEE_MORE_OPTIONS')))));
|
|
8279
8295
|
};
|
|
8280
8296
|
|
|
@@ -8503,7 +8519,7 @@ var DateField = function DateField(_ref) {
|
|
|
8503
8519
|
error: controllers.error
|
|
8504
8520
|
};
|
|
8505
8521
|
var dayPickerProps = {
|
|
8506
|
-
classNames: styles$
|
|
8522
|
+
classNames: styles$u,
|
|
8507
8523
|
disabledDays: function disabledDays(day) {
|
|
8508
8524
|
return _disabledDays && _disabledDays(setToMidnight(day));
|
|
8509
8525
|
},
|
|
@@ -8521,7 +8537,7 @@ var DateField = function DateField(_ref) {
|
|
|
8521
8537
|
})
|
|
8522
8538
|
}, React__default.createElement(DayPickerInput, {
|
|
8523
8539
|
format: format,
|
|
8524
|
-
classNames: styles$
|
|
8540
|
+
classNames: styles$u,
|
|
8525
8541
|
formatDate: formatDate,
|
|
8526
8542
|
parseDate: parseDate,
|
|
8527
8543
|
placeholder: placeholder || format.toUpperCase(),
|
|
@@ -8630,7 +8646,7 @@ var getFormikError = function getFormikError(error) {
|
|
|
8630
8646
|
return undefined;
|
|
8631
8647
|
};
|
|
8632
8648
|
|
|
8633
|
-
var styles$
|
|
8649
|
+
var styles$U = {"container":"_1Ini2","wrapper":"_21VnL","interactionDisabled":"_wJ6Cb","DayPicker-Day":"_1c48y","navBar":"_3KwsN","todayButton":"_10CBO","navButtonInteractionDisabled":"_dHL-D","navButtonPrev":"_6kNi3","navButtonNext":"_13W_e","months":"_1FeSY","month":"_wU6A4","caption":"_AMbAo","weekdays":"_1LEst","weekdaysRow":"_2XECo","weekday":"_1C5ry","body":"_11F-Y","week":"_3MAFk","day":"_mG73F","disabled":"_2pgnH","selected":"_MtLaz","outside":"_CRqyX","footer":"_2KG9-","today":"_2JA2y","overlayWrapper":"_1JWbc","overlay":"_2tL6g","weekNumber":"_3u72O","text-field":"_25rf7","date-range-field":"_3qVhi","text-field--invalid":"_2M9Ud","text-field--prefixed":"_3TUb2","text-field--suffixed":"_foqL0","date-range-field--invalid":"_3df9R","date-range-field--disabled":"_2Nkht"};
|
|
8634
8650
|
|
|
8635
8651
|
var FromDate = function FromDate(_ref) {
|
|
8636
8652
|
var name = _ref.name,
|
|
@@ -8669,7 +8685,7 @@ var FromDate = function FromDate(_ref) {
|
|
|
8669
8685
|
}
|
|
8670
8686
|
|
|
8671
8687
|
var dayPickerProps = {
|
|
8672
|
-
classNames: styles$
|
|
8688
|
+
classNames: styles$U,
|
|
8673
8689
|
months: MONTH_NAMES,
|
|
8674
8690
|
weekdaysLong: DAYS,
|
|
8675
8691
|
weekdaysShort: DAYS.map(function (day) {
|
|
@@ -8696,7 +8712,7 @@ var FromDate = function FromDate(_ref) {
|
|
|
8696
8712
|
};
|
|
8697
8713
|
return React__default.createElement(DayPickerInput, {
|
|
8698
8714
|
format: format,
|
|
8699
|
-
classNames: styles$
|
|
8715
|
+
classNames: styles$U,
|
|
8700
8716
|
selectedDay: start,
|
|
8701
8717
|
value: start,
|
|
8702
8718
|
formatDate: formatDate,
|
|
@@ -8770,7 +8786,7 @@ var ToDate = function ToDate(_ref, ref) {
|
|
|
8770
8786
|
}
|
|
8771
8787
|
|
|
8772
8788
|
var dayPickerProps = {
|
|
8773
|
-
classNames: styles$
|
|
8789
|
+
classNames: styles$U,
|
|
8774
8790
|
months: MONTH_NAMES,
|
|
8775
8791
|
weekdaysLong: DAYS,
|
|
8776
8792
|
weekdaysShort: DAYS.map(function (day) {
|
|
@@ -8789,7 +8805,7 @@ var ToDate = function ToDate(_ref, ref) {
|
|
|
8789
8805
|
};
|
|
8790
8806
|
return React__default.createElement(DayPickerInput, {
|
|
8791
8807
|
format: format,
|
|
8792
|
-
classNames: styles$
|
|
8808
|
+
classNames: styles$U,
|
|
8793
8809
|
selectedDay: end,
|
|
8794
8810
|
value: end,
|
|
8795
8811
|
formatDate: formatDate,
|
|
@@ -8874,11 +8890,11 @@ var DateRangeField = function DateRangeField(_ref) {
|
|
|
8874
8890
|
start = _controllers$value.start,
|
|
8875
8891
|
end = _controllers$value.end;
|
|
8876
8892
|
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement("div", {
|
|
8877
|
-
className: classnames(styles$
|
|
8893
|
+
className: classnames(styles$U['date-range-field'], (_classnames = {}, _classnames[styles$U['date-range-field--invalid']] = hasError, _classnames[styles$U['date-range-field--disabled']] = disabled, _classnames)),
|
|
8878
8894
|
"data-testid": testId
|
|
8879
8895
|
}, React__default.createElement(IconCalendarAlt, {
|
|
8880
8896
|
size: "medium",
|
|
8881
|
-
color:
|
|
8897
|
+
color: "grey-400"
|
|
8882
8898
|
}), React__default.createElement(FromDate, {
|
|
8883
8899
|
name: name,
|
|
8884
8900
|
id: controllers.id,
|
|
@@ -8904,7 +8920,7 @@ var DateRangeField = function DateRangeField(_ref) {
|
|
|
8904
8920
|
testId: testId
|
|
8905
8921
|
}), React__default.createElement(IconArrowRight, {
|
|
8906
8922
|
size: "medium",
|
|
8907
|
-
color:
|
|
8923
|
+
color: "grey-400"
|
|
8908
8924
|
}), React__default.createElement(ToDate$1, {
|
|
8909
8925
|
name: name,
|
|
8910
8926
|
format: format,
|
|
@@ -9001,7 +9017,7 @@ var WeekField = function WeekField(_ref) {
|
|
|
9001
9017
|
};
|
|
9002
9018
|
|
|
9003
9019
|
var dayPickerProps = {
|
|
9004
|
-
classNames: styles$
|
|
9020
|
+
classNames: styles$v,
|
|
9005
9021
|
disabledDays: function disabledDays(day) {
|
|
9006
9022
|
return _disabledDays && _disabledDays(setToMidnight(day));
|
|
9007
9023
|
},
|
|
@@ -9031,7 +9047,7 @@ var WeekField = function WeekField(_ref) {
|
|
|
9031
9047
|
})
|
|
9032
9048
|
}, React__default.createElement(DayPickerInput, {
|
|
9033
9049
|
format: format,
|
|
9034
|
-
classNames: styles$
|
|
9050
|
+
classNames: styles$v,
|
|
9035
9051
|
formatDate: formatDate,
|
|
9036
9052
|
parseDate: parseDate,
|
|
9037
9053
|
placeholder: placeholder || format.toUpperCase(),
|
|
@@ -9070,35 +9086,59 @@ var WeekField = function WeekField(_ref) {
|
|
|
9070
9086
|
})));
|
|
9071
9087
|
};
|
|
9072
9088
|
|
|
9073
|
-
var getTimeOptions = function getTimeOptions(interval, startTime) {
|
|
9089
|
+
var getTimeOptions = function getTimeOptions(interval, startTime, skipStartTime) {
|
|
9074
9090
|
if (startTime === void 0) {
|
|
9075
9091
|
startTime = new Date('Janurary 1 2023 00:00:00');
|
|
9076
9092
|
}
|
|
9077
9093
|
|
|
9094
|
+
if (skipStartTime === void 0) {
|
|
9095
|
+
skipStartTime = false;
|
|
9096
|
+
}
|
|
9097
|
+
|
|
9098
|
+
var intervalCoeffecient = 1000 * 60 * interval;
|
|
9078
9099
|
var optionsCount = 60 * 24 / interval;
|
|
9079
9100
|
var timeOptions = [];
|
|
9080
|
-
var intervalCoeffecient = 1000 * 60 * interval;
|
|
9081
9101
|
var rounded = new Date(Math.ceil(startTime.getTime() / intervalCoeffecient) * intervalCoeffecient);
|
|
9102
|
+
var skipFirstInterval = skipStartTime && startTime.getTime() === rounded.getTime();
|
|
9082
9103
|
|
|
9083
|
-
var
|
|
9084
|
-
if (hours === 0) {
|
|
9085
|
-
return 12;
|
|
9086
|
-
} else if (hours > 12) {
|
|
9087
|
-
return hours - 12;
|
|
9088
|
-
} else {
|
|
9089
|
-
return hours;
|
|
9090
|
-
}
|
|
9091
|
-
};
|
|
9092
|
-
|
|
9093
|
-
for (var i = 0; i < optionsCount; i++) {
|
|
9104
|
+
for (var i = skipFirstInterval ? 1 : 0; i < optionsCount; i++) {
|
|
9094
9105
|
var newDate = new Date(rounded.getTime());
|
|
9095
9106
|
newDate.setMinutes(rounded.getMinutes() + interval * i);
|
|
9107
|
+
var hours = formatHours(newDate.getHours());
|
|
9096
9108
|
var minutes = newDate.getMinutes();
|
|
9097
|
-
|
|
9109
|
+
var period = newDate.getHours() < 12 ? 'AM' : 'PM';
|
|
9110
|
+
timeOptions.push(hours + ":" + (minutes === 0 ? '00' : minutes) + " " + period);
|
|
9098
9111
|
}
|
|
9099
9112
|
|
|
9100
9113
|
return timeOptions;
|
|
9101
9114
|
};
|
|
9115
|
+
var getDuration = function getDuration(timeOption, startTime) {
|
|
9116
|
+
var start = new Date("Janurary 1 2023 " + startTime).getTime();
|
|
9117
|
+
var end = new Date("Janurary 1 2023 " + timeOption).getTime();
|
|
9118
|
+
var diffInMinutes = Math.round((end - start) / 60000);
|
|
9119
|
+
|
|
9120
|
+
if (diffInMinutes < 0) {
|
|
9121
|
+
diffInMinutes = diffInMinutes + 1440;
|
|
9122
|
+
}
|
|
9123
|
+
|
|
9124
|
+
if (diffInMinutes < 60) {
|
|
9125
|
+
return "(" + diffInMinutes + " min" + (diffInMinutes === 1 ? '' : 's') + ")";
|
|
9126
|
+
} else if (diffInMinutes >= 60) {
|
|
9127
|
+
return "(" + +(diffInMinutes / 60).toFixed(2) + " hr" + (diffInMinutes === 60 ? '' : 's') + ")";
|
|
9128
|
+
} else {
|
|
9129
|
+
return undefined;
|
|
9130
|
+
}
|
|
9131
|
+
};
|
|
9132
|
+
|
|
9133
|
+
var formatHours = function formatHours(hours) {
|
|
9134
|
+
if (hours === 0) {
|
|
9135
|
+
return 12;
|
|
9136
|
+
} else if (hours > 12) {
|
|
9137
|
+
return hours - 12;
|
|
9138
|
+
} else {
|
|
9139
|
+
return hours;
|
|
9140
|
+
}
|
|
9141
|
+
};
|
|
9102
9142
|
|
|
9103
9143
|
var TimeFieldDropdown = function TimeFieldDropdown(_ref) {
|
|
9104
9144
|
var trigger = _ref.trigger,
|
|
@@ -9106,7 +9146,9 @@ var TimeFieldDropdown = function TimeFieldDropdown(_ref) {
|
|
|
9106
9146
|
startTime = _ref.startTime,
|
|
9107
9147
|
onOptionClick = _ref.onOptionClick,
|
|
9108
9148
|
inputValue = _ref.inputValue,
|
|
9109
|
-
width = _ref.width
|
|
9149
|
+
width = _ref.width,
|
|
9150
|
+
_ref$endField = _ref.endField,
|
|
9151
|
+
endField = _ref$endField === void 0 ? false : _ref$endField;
|
|
9110
9152
|
var startTimeParsed;
|
|
9111
9153
|
|
|
9112
9154
|
if (startTime) {
|
|
@@ -9114,7 +9156,7 @@ var TimeFieldDropdown = function TimeFieldDropdown(_ref) {
|
|
|
9114
9156
|
}
|
|
9115
9157
|
|
|
9116
9158
|
var timeOptions = useMemo(function () {
|
|
9117
|
-
return getTimeOptions(interval, startTimeParsed);
|
|
9159
|
+
return getTimeOptions(interval, startTimeParsed, endField && !!startTime);
|
|
9118
9160
|
}, [interval, startTime]);
|
|
9119
9161
|
|
|
9120
9162
|
var _useState = useState(undefined),
|
|
@@ -9142,16 +9184,22 @@ var TimeFieldDropdown = function TimeFieldDropdown(_ref) {
|
|
|
9142
9184
|
onClick: function onClick() {
|
|
9143
9185
|
onOptionClick(option);
|
|
9144
9186
|
}
|
|
9145
|
-
},
|
|
9187
|
+
}, React__default.createElement(Inline, {
|
|
9188
|
+
space: 4
|
|
9189
|
+
}, option, endField && startTime && getDuration(option, startTime)));
|
|
9146
9190
|
})));
|
|
9147
9191
|
};
|
|
9148
9192
|
|
|
9149
|
-
var _excluded$2q = ["interval", "startTime"];
|
|
9193
|
+
var _excluded$2q = ["interval", "startTime", "prefix", "endField", "duration"];
|
|
9150
9194
|
|
|
9151
9195
|
var TimeFieldElement = function TimeFieldElement(_ref, forwardedRef) {
|
|
9152
9196
|
var _ref$interval = _ref.interval,
|
|
9153
9197
|
interval = _ref$interval === void 0 ? 15 : _ref$interval,
|
|
9154
9198
|
startTime = _ref.startTime,
|
|
9199
|
+
prefix = _ref.prefix,
|
|
9200
|
+
_ref$endField = _ref.endField,
|
|
9201
|
+
endField = _ref$endField === void 0 ? false : _ref$endField,
|
|
9202
|
+
duration = _ref.duration,
|
|
9155
9203
|
allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2q);
|
|
9156
9204
|
|
|
9157
9205
|
var internalRef = useRef(null);
|
|
@@ -9195,17 +9243,148 @@ var TimeFieldElement = function TimeFieldElement(_ref, forwardedRef) {
|
|
|
9195
9243
|
onInputChange: function onInputChange(e) {
|
|
9196
9244
|
return setSelectedDropdownValue(e);
|
|
9197
9245
|
},
|
|
9198
|
-
selectedTimeOption: selectedDropdownValue
|
|
9246
|
+
selectedTimeOption: selectedDropdownValue,
|
|
9247
|
+
prefix: prefix,
|
|
9248
|
+
duration: duration
|
|
9199
9249
|
})),
|
|
9200
9250
|
startTime: startTime,
|
|
9201
9251
|
onOptionClick: onOptionClick,
|
|
9202
9252
|
inputValue: selectedDropdownValue,
|
|
9203
|
-
width: width
|
|
9253
|
+
width: width,
|
|
9254
|
+
endField: endField
|
|
9204
9255
|
});
|
|
9205
9256
|
};
|
|
9206
9257
|
|
|
9258
|
+
var TimeRangeSelector = forwardRef(TimeFieldElement);
|
|
9207
9259
|
var TimeField = forwardRef(TimeFieldElement);
|
|
9208
9260
|
|
|
9261
|
+
var styles$V = {"text-field":"_1EJlZ","time-range-field":"_20_Q3","text-field--invalid":"_3vaZG","text-field--prefixed":"_2dh_z","text-field--suffixed":"_2iyg-","time-range-field--invalid":"_22G5J","time-range-field--disabled":"_1bvhh"};
|
|
9262
|
+
|
|
9263
|
+
var TimeRangeEnd = function TimeRangeEnd(_ref) {
|
|
9264
|
+
var startTime = _ref.startTime,
|
|
9265
|
+
onChange = _ref.onChange,
|
|
9266
|
+
interval = _ref.interval,
|
|
9267
|
+
_ref$placeholder = _ref.placeholder,
|
|
9268
|
+
placeholder = _ref$placeholder === void 0 ? '2:00 PM' : _ref$placeholder,
|
|
9269
|
+
duration = _ref.duration,
|
|
9270
|
+
disabled = _ref.disabled,
|
|
9271
|
+
testId = _ref.testId;
|
|
9272
|
+
return React__default.createElement(TimeRangeSelector, {
|
|
9273
|
+
name: "end-time",
|
|
9274
|
+
startTime: startTime,
|
|
9275
|
+
onChange: onChange,
|
|
9276
|
+
placeholder: placeholder,
|
|
9277
|
+
interval: interval,
|
|
9278
|
+
prefix: React__default.createElement(IconArrowRight, {
|
|
9279
|
+
size: "medium",
|
|
9280
|
+
color: "grey-400"
|
|
9281
|
+
}),
|
|
9282
|
+
duration: duration,
|
|
9283
|
+
endField: true,
|
|
9284
|
+
testId: testId && testId + "-end-time",
|
|
9285
|
+
disabled: disabled
|
|
9286
|
+
});
|
|
9287
|
+
};
|
|
9288
|
+
|
|
9289
|
+
var TimeRangeStart = function TimeRangeStart(_ref) {
|
|
9290
|
+
var startTime = _ref.startTime,
|
|
9291
|
+
onChange = _ref.onChange,
|
|
9292
|
+
interval = _ref.interval,
|
|
9293
|
+
_ref$placeholder = _ref.placeholder,
|
|
9294
|
+
placeholder = _ref$placeholder === void 0 ? '9:00 AM' : _ref$placeholder,
|
|
9295
|
+
id = _ref.id,
|
|
9296
|
+
disabled = _ref.disabled,
|
|
9297
|
+
testId = _ref.testId;
|
|
9298
|
+
return React__default.createElement(TimeRangeSelector, {
|
|
9299
|
+
name: "start-time",
|
|
9300
|
+
startTime: startTime,
|
|
9301
|
+
onChange: onChange,
|
|
9302
|
+
placeholder: placeholder,
|
|
9303
|
+
interval: interval,
|
|
9304
|
+
testId: testId && testId + "-start-time",
|
|
9305
|
+
id: id,
|
|
9306
|
+
disabled: disabled
|
|
9307
|
+
});
|
|
9308
|
+
};
|
|
9309
|
+
|
|
9310
|
+
var TimeRangeField = function TimeRangeField(_ref) {
|
|
9311
|
+
var _classnames;
|
|
9312
|
+
|
|
9313
|
+
var name = _ref.name,
|
|
9314
|
+
inputId = _ref.id,
|
|
9315
|
+
value = _ref.value,
|
|
9316
|
+
_ref$interval = _ref.interval,
|
|
9317
|
+
interval = _ref$interval === void 0 ? 15 : _ref$interval,
|
|
9318
|
+
startTime = _ref.startTime,
|
|
9319
|
+
onChange = _ref.onChange,
|
|
9320
|
+
onBlur = _ref.onBlur,
|
|
9321
|
+
label = _ref.label,
|
|
9322
|
+
caption = _ref.caption,
|
|
9323
|
+
error = _ref.error,
|
|
9324
|
+
placeholder = _ref.placeholder,
|
|
9325
|
+
disabled = _ref.disabled,
|
|
9326
|
+
testId = _ref.testId;
|
|
9327
|
+
var controllers = useRangeFieldControllers({
|
|
9328
|
+
name: name,
|
|
9329
|
+
id: inputId,
|
|
9330
|
+
value: value,
|
|
9331
|
+
onChange: onChange,
|
|
9332
|
+
onBlur: onBlur,
|
|
9333
|
+
error: error
|
|
9334
|
+
});
|
|
9335
|
+
var hasError = controllers.error;
|
|
9336
|
+
var fieldProps = {
|
|
9337
|
+
name: name,
|
|
9338
|
+
id: controllers.id,
|
|
9339
|
+
label: label,
|
|
9340
|
+
caption: caption,
|
|
9341
|
+
error: controllers.error
|
|
9342
|
+
};
|
|
9343
|
+
var _controllers$value = controllers.value,
|
|
9344
|
+
start = _controllers$value.start,
|
|
9345
|
+
end = _controllers$value.end;
|
|
9346
|
+
|
|
9347
|
+
var onStartChange = function onStartChange(inputValue) {
|
|
9348
|
+
controllers.onChange({
|
|
9349
|
+
start: inputValue === '' ? undefined : inputValue,
|
|
9350
|
+
end: end
|
|
9351
|
+
});
|
|
9352
|
+
};
|
|
9353
|
+
|
|
9354
|
+
var onEndChange = function onEndChange(inputValue) {
|
|
9355
|
+
controllers.onChange({
|
|
9356
|
+
start: start,
|
|
9357
|
+
end: inputValue === '' ? undefined : inputValue
|
|
9358
|
+
});
|
|
9359
|
+
};
|
|
9360
|
+
|
|
9361
|
+
var timeRangeDuration = getDuration(end, start);
|
|
9362
|
+
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement("div", {
|
|
9363
|
+
className: classnames(styles$V['time-range-field'], (_classnames = {}, _classnames[styles$V['time-range-field--invalid']] = hasError, _classnames[styles$V['time-range-field--disabled']] = disabled, _classnames)),
|
|
9364
|
+
"data-testid": testId
|
|
9365
|
+
}, React__default.createElement(TimeRangeStart, {
|
|
9366
|
+
startTime: startTime,
|
|
9367
|
+
interval: interval,
|
|
9368
|
+
onChange: function onChange(value) {
|
|
9369
|
+
return onStartChange(value);
|
|
9370
|
+
},
|
|
9371
|
+
placeholder: placeholder,
|
|
9372
|
+
testId: testId,
|
|
9373
|
+
id: controllers.id,
|
|
9374
|
+
disabled: disabled
|
|
9375
|
+
}), React__default.createElement(TimeRangeEnd, {
|
|
9376
|
+
startTime: start,
|
|
9377
|
+
interval: interval,
|
|
9378
|
+
onChange: function onChange(value) {
|
|
9379
|
+
return onEndChange(value);
|
|
9380
|
+
},
|
|
9381
|
+
placeholder: placeholder,
|
|
9382
|
+
duration: timeRangeDuration,
|
|
9383
|
+
testId: testId,
|
|
9384
|
+
disabled: disabled
|
|
9385
|
+
})));
|
|
9386
|
+
};
|
|
9387
|
+
|
|
9209
9388
|
var _excluded$2r = ["currencySymbol", "step"];
|
|
9210
9389
|
|
|
9211
9390
|
var CurrencyFieldElement = function CurrencyFieldElement(_ref, ref) {
|
|
@@ -9368,7 +9547,7 @@ var BUTTON_THEME = {
|
|
|
9368
9547
|
UPSELL: 'upsell'
|
|
9369
9548
|
};
|
|
9370
9549
|
|
|
9371
|
-
var styles$
|
|
9550
|
+
var styles$W = {"banner":"_vgLin","banner__title":"_63TwY","banner__body":"_3n6S7","banner__body--multilineCTA":"_2pMYs","banner--info":"_ON6Eg","banner__icon":"_1-D-E","banner--success":"_1FFZh","banner--danger":"_2R34O","banner--warning":"_3Cfhe","banner--upsell":"_1SIOw","banner__close":"_3SNQ1","banner--single-line":"_3nLTI"};
|
|
9372
9551
|
|
|
9373
9552
|
var ButtonCTA = function ButtonCTA(_ref) {
|
|
9374
9553
|
var button = _ref.button,
|
|
@@ -9391,7 +9570,7 @@ var ButtonCTA = function ButtonCTA(_ref) {
|
|
|
9391
9570
|
}, button.props));
|
|
9392
9571
|
};
|
|
9393
9572
|
|
|
9394
|
-
var styles$
|
|
9573
|
+
var styles$X = {"banner__caption":"_1jqm8"};
|
|
9395
9574
|
|
|
9396
9575
|
var InlineBannerCTA = function InlineBannerCTA(_ref) {
|
|
9397
9576
|
var primaryButton = _ref.primaryButton,
|
|
@@ -9422,7 +9601,7 @@ var InlineBannerCTA = function InlineBannerCTA(_ref) {
|
|
|
9422
9601
|
bannerTheme: bannerTheme,
|
|
9423
9602
|
primaryCTA: true
|
|
9424
9603
|
})), caption && multiLine && React__default.createElement("div", {
|
|
9425
|
-
className: styles$
|
|
9604
|
+
className: styles$X['banner__caption']
|
|
9426
9605
|
}, caption));
|
|
9427
9606
|
};
|
|
9428
9607
|
|
|
@@ -9469,14 +9648,14 @@ var InlineBanner = function InlineBanner(_ref) {
|
|
|
9469
9648
|
var Layout = multiLine ? Stack : Inline;
|
|
9470
9649
|
return React__default.createElement("div", {
|
|
9471
9650
|
"data-testid": testId,
|
|
9472
|
-
className: classnames(styles$
|
|
9651
|
+
className: classnames(styles$W['banner'], (_classnames = {}, _classnames[styles$W['banner--info']] = theme === BANNER_THEME.INFO, _classnames[styles$W['banner--warning']] = theme === BANNER_THEME.WARNING, _classnames[styles$W['banner--success']] = theme === BANNER_THEME.SUCCESS, _classnames[styles$W['banner--danger']] = theme === BANNER_THEME.DANGER, _classnames[styles$W['banner--upsell']] = theme === BANNER_THEME.UPSELL, _classnames[styles$W['banner--single-line']] = !multiLine, _classnames)),
|
|
9473
9652
|
style: positionStyles
|
|
9474
9653
|
}, React__default.createElement(Inline, {
|
|
9475
9654
|
alignItems: multiLine ? undefined : 'center',
|
|
9476
9655
|
flex: ['0 1 auto', 1],
|
|
9477
9656
|
space: 12
|
|
9478
9657
|
}, React__default.createElement("div", {
|
|
9479
|
-
className: styles$
|
|
9658
|
+
className: styles$W['banner__icon']
|
|
9480
9659
|
}, React__default.createElement(InlineBannerIcon, {
|
|
9481
9660
|
theme: theme
|
|
9482
9661
|
})), React__default.createElement(Layout, {
|
|
@@ -9486,9 +9665,9 @@ var InlineBanner = function InlineBanner(_ref) {
|
|
|
9486
9665
|
flex: ['min-content'],
|
|
9487
9666
|
flexWrap: multiLine ? undefined : 'wrap'
|
|
9488
9667
|
}, title && React__default.createElement("div", {
|
|
9489
|
-
className: styles$
|
|
9668
|
+
className: styles$W['banner__title']
|
|
9490
9669
|
}, title), React__default.createElement("div", {
|
|
9491
|
-
className: classnames(styles$
|
|
9670
|
+
className: classnames(styles$W['banner__body'], (_classnames2 = {}, _classnames2[styles$W['banner__body--multilineCTA']] = primaryButton && multiLine, _classnames2))
|
|
9492
9671
|
}, children), primaryButton && React__default.createElement(InlineBannerCTA, {
|
|
9493
9672
|
primaryButton: primaryButton,
|
|
9494
9673
|
secondaryButton: secondaryButton,
|
|
@@ -9496,7 +9675,7 @@ var InlineBanner = function InlineBanner(_ref) {
|
|
|
9496
9675
|
multiLine: multiLine,
|
|
9497
9676
|
bannerTheme: theme
|
|
9498
9677
|
})), dismissable && React__default.createElement("div", {
|
|
9499
|
-
className: styles$
|
|
9678
|
+
className: styles$W['banner__close']
|
|
9500
9679
|
}, React__default.createElement(Button$1, {
|
|
9501
9680
|
theme: "link-icon",
|
|
9502
9681
|
type: "button",
|
|
@@ -9510,7 +9689,7 @@ var PERSISTENT_BANNER_THEME = {
|
|
|
9510
9689
|
DANGER: 'danger'
|
|
9511
9690
|
};
|
|
9512
9691
|
|
|
9513
|
-
var styles$
|
|
9692
|
+
var styles$Y = {"persistent-banner":"_1KO1J","persistent-banner--info":"_2mTN3","persistent-banner--danger":"_1YuCF","persistent-banner--upsell":"_tlNFk"};
|
|
9514
9693
|
|
|
9515
9694
|
var PersistentBanner = function PersistentBanner(_ref) {
|
|
9516
9695
|
var _classNames;
|
|
@@ -9539,7 +9718,7 @@ var PersistentBanner = function PersistentBanner(_ref) {
|
|
|
9539
9718
|
};
|
|
9540
9719
|
|
|
9541
9720
|
return React__default.createElement("div", {
|
|
9542
|
-
className: classnames(styles$
|
|
9721
|
+
className: classnames(styles$Y['persistent-banner'], (_classNames = {}, _classNames[styles$Y['persistent-banner--info']] = theme === PERSISTENT_BANNER_THEME.INFO, _classNames[styles$Y['persistent-banner--danger']] = theme === PERSISTENT_BANNER_THEME.DANGER, _classNames[styles$Y['persistent-banner--upsell']] = theme === PERSISTENT_BANNER_THEME.UPSELL, _classNames)),
|
|
9543
9722
|
"data-testid": testId
|
|
9544
9723
|
}, onDismiss ? React__default.createElement(Inline, {
|
|
9545
9724
|
flex: [1],
|
|
@@ -9611,7 +9790,7 @@ var useProgress = function useProgress(progress, maxValue, getMetric) {
|
|
|
9611
9790
|
};
|
|
9612
9791
|
};
|
|
9613
9792
|
|
|
9614
|
-
var styles$
|
|
9793
|
+
var styles$Z = {"circular-progress":"_1XR7V","circular-progress__label":"_1BygP","circular-progress__track":"_1Ak-z","circular-progress__indicator":"_22YIp"};
|
|
9615
9794
|
|
|
9616
9795
|
var CircularProgress = function CircularProgress(_ref) {
|
|
9617
9796
|
var progress = _ref.progress,
|
|
@@ -9626,7 +9805,7 @@ var CircularProgress = function CircularProgress(_ref) {
|
|
|
9626
9805
|
|
|
9627
9806
|
var determinant = metric.percentage * 2.79;
|
|
9628
9807
|
return React__default.createElement("div", Object.assign({}, elementProps, {
|
|
9629
|
-
className: styles$
|
|
9808
|
+
className: styles$Z['circular-progress'],
|
|
9630
9809
|
"data-testid": testId
|
|
9631
9810
|
}), React__default.createElement("svg", {
|
|
9632
9811
|
viewBox: "0 0 100 100"
|
|
@@ -9635,21 +9814,21 @@ var CircularProgress = function CircularProgress(_ref) {
|
|
|
9635
9814
|
cy: 50,
|
|
9636
9815
|
r: 45,
|
|
9637
9816
|
strokeWidth: "10px",
|
|
9638
|
-
className: styles$
|
|
9817
|
+
className: styles$Z['circular-progress__track']
|
|
9639
9818
|
}), React__default.createElement("circle", {
|
|
9640
9819
|
cx: 50,
|
|
9641
9820
|
cy: 50,
|
|
9642
9821
|
r: 45,
|
|
9643
9822
|
strokeWidth: "10px",
|
|
9644
|
-
className: styles$
|
|
9823
|
+
className: styles$Z['circular-progress__indicator'],
|
|
9645
9824
|
strokeDashoffset: "66",
|
|
9646
9825
|
strokeDasharray: determinant + " " + (279 - determinant)
|
|
9647
9826
|
})), React__default.createElement("div", {
|
|
9648
|
-
className: styles$
|
|
9827
|
+
className: styles$Z['circular-progress__label']
|
|
9649
9828
|
}, children || metric.progress + "/" + metric.maxValue));
|
|
9650
9829
|
};
|
|
9651
9830
|
|
|
9652
|
-
var styles$
|
|
9831
|
+
var styles$_ = {"progress-bar":"_3nyZN","progress-bar__indicator":"_11TEp","progress-bar__steps":"_3XFTU"};
|
|
9653
9832
|
|
|
9654
9833
|
var ProgressBar = function ProgressBar(_ref) {
|
|
9655
9834
|
var progress = _ref.progress,
|
|
@@ -9664,15 +9843,15 @@ var ProgressBar = function ProgressBar(_ref) {
|
|
|
9664
9843
|
metric = _useProgress.metric;
|
|
9665
9844
|
|
|
9666
9845
|
return React__default.createElement(Stack, null, React__default.createElement("div", Object.assign({}, elementProps, {
|
|
9667
|
-
className: styles$
|
|
9846
|
+
className: styles$_['progress-bar'],
|
|
9668
9847
|
"data-testid": testId
|
|
9669
9848
|
}), React__default.createElement("div", {
|
|
9670
|
-
className: styles$
|
|
9849
|
+
className: styles$_['progress-bar__indicator'],
|
|
9671
9850
|
style: {
|
|
9672
9851
|
width: metric.percentage + "%"
|
|
9673
9852
|
}
|
|
9674
9853
|
})), steps && steps.length > 0 && React__default.createElement("div", {
|
|
9675
|
-
className: styles$
|
|
9854
|
+
className: styles$_['progress-bar__steps']
|
|
9676
9855
|
}, steps.map(function (step) {
|
|
9677
9856
|
return React__default.createElement("div", {
|
|
9678
9857
|
key: step
|
|
@@ -9680,7 +9859,7 @@ var ProgressBar = function ProgressBar(_ref) {
|
|
|
9680
9859
|
})));
|
|
9681
9860
|
};
|
|
9682
9861
|
|
|
9683
|
-
var styles
|
|
9862
|
+
var styles$$ = {"badge":"_2f81N","badge--warning":"_2g1GI","badge--danger":"_2zLnM","badge--success":"_27QOo","badge--info":"_2gmsM"};
|
|
9684
9863
|
|
|
9685
9864
|
var _excluded$2u = ["children", "theme", "title", "testId"];
|
|
9686
9865
|
|
|
@@ -9704,7 +9883,7 @@ var Badge = function Badge(_ref, forwardedRef) {
|
|
|
9704
9883
|
overlay: title,
|
|
9705
9884
|
ref: ref
|
|
9706
9885
|
}, React__default.createElement("div", Object.assign({
|
|
9707
|
-
className: classnames(styles
|
|
9886
|
+
className: classnames(styles$$['badge'], (_classnames = {}, _classnames[styles$$['badge--success']] = theme === 'success', _classnames[styles$$['badge--danger']] = theme === 'danger', _classnames[styles$$['badge--info']] = theme === 'info', _classnames[styles$$['badge--warning']] = theme === 'warning', _classnames)),
|
|
9708
9887
|
ref: ref,
|
|
9709
9888
|
"data-testid": testId
|
|
9710
9889
|
}, otherProps), children));
|
|
@@ -9712,9 +9891,9 @@ var Badge = function Badge(_ref, forwardedRef) {
|
|
|
9712
9891
|
|
|
9713
9892
|
var Badge$1 = forwardRef(Badge);
|
|
9714
9893
|
|
|
9715
|
-
var styles$
|
|
9894
|
+
var styles$10 = {"avatar":"_2wJGB","avatar--small":"_3QTSo","avatar__badge":"_2Rl8S","avatar--medium":"_1zwj0","avatar--large":"_3-U6x","avatar--extra-large":"_3qn2q"};
|
|
9716
9895
|
|
|
9717
|
-
var styles
|
|
9896
|
+
var styles$11 = {"avatar-image":"_GKL9P"};
|
|
9718
9897
|
|
|
9719
9898
|
var AvatarImage = function AvatarImage(_ref) {
|
|
9720
9899
|
var url = _ref.url,
|
|
@@ -9739,7 +9918,7 @@ var AvatarImage = function AvatarImage(_ref) {
|
|
|
9739
9918
|
}
|
|
9740
9919
|
|
|
9741
9920
|
return React__default.createElement("div", {
|
|
9742
|
-
className: styles
|
|
9921
|
+
className: styles$11['avatar-image']
|
|
9743
9922
|
}, React__default.createElement(IconUserSolid, {
|
|
9744
9923
|
size: "flexible",
|
|
9745
9924
|
color: color
|
|
@@ -9789,7 +9968,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
9789
9968
|
|
|
9790
9969
|
var children = _ref.children,
|
|
9791
9970
|
_ref$color = _ref.color,
|
|
9792
|
-
color = _ref$color === void 0 ?
|
|
9971
|
+
color = _ref$color === void 0 ? COLORS['grey-400'] : _ref$color,
|
|
9793
9972
|
_ref$size = _ref.size,
|
|
9794
9973
|
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
9795
9974
|
url = _ref.url,
|
|
@@ -9806,9 +9985,9 @@ var Avatar = function Avatar(_ref) {
|
|
|
9806
9985
|
}),
|
|
9807
9986
|
defaultProfilePictureColors = _useState2[0];
|
|
9808
9987
|
|
|
9809
|
-
var backgroundColor = url ?
|
|
9988
|
+
var backgroundColor = url ? COLORS['grey-200'] : getColor(color);
|
|
9810
9989
|
return React__default.createElement("div", {
|
|
9811
|
-
className: classnames(styles$
|
|
9990
|
+
className: classnames(styles$10['avatar'], (_classnames = {}, _classnames[styles$10['avatar--small']] = size === 'small', _classnames[styles$10['avatar--medium']] = size === 'medium', _classnames[styles$10['avatar--large']] = size === 'large', _classnames[styles$10['avatar--extra-large']] = size === 'extra-large', _classnames)),
|
|
9812
9991
|
style: {
|
|
9813
9992
|
backgroundColor: children || url && !showIconInsteadOfImage ? backgroundColor : defaultProfilePictureColors.backgroundColor
|
|
9814
9993
|
},
|
|
@@ -9821,7 +10000,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
9821
10000
|
return setShowIconInsteadOfImage(true);
|
|
9822
10001
|
}
|
|
9823
10002
|
}), badge && size !== 'small' && React__default.createElement("div", {
|
|
9824
|
-
className: styles$
|
|
10003
|
+
className: styles$10['avatar__badge']
|
|
9825
10004
|
}, badge));
|
|
9826
10005
|
};
|
|
9827
10006
|
|
|
@@ -9834,7 +10013,7 @@ var CHIP_THEME = {
|
|
|
9834
10013
|
DANGER: 'danger'
|
|
9835
10014
|
};
|
|
9836
10015
|
|
|
9837
|
-
var styles$
|
|
10016
|
+
var styles$12 = {"chip":"_1fIeV","chip--marketing":"_V4byU","chip--success":"_37gN9","chip--upsell":"_Tw7tp","chip--warning":"_t94VZ","chip--info":"_3SmeO","chip--danger":"_2eoX0"};
|
|
9838
10017
|
|
|
9839
10018
|
var Chip = function Chip(_ref) {
|
|
9840
10019
|
var _classnames;
|
|
@@ -9845,11 +10024,11 @@ var Chip = function Chip(_ref) {
|
|
|
9845
10024
|
testId = _ref.testId;
|
|
9846
10025
|
return React__default.createElement("div", {
|
|
9847
10026
|
"data-testid": testId,
|
|
9848
|
-
className: classnames(styles$
|
|
10027
|
+
className: classnames(styles$12['chip'], (_classnames = {}, _classnames[styles$12['chip--marketing']] = theme === CHIP_THEME.MARKETING, _classnames[styles$12['chip--success']] = theme === CHIP_THEME.SUCCESS, _classnames[styles$12['chip--upsell']] = theme === CHIP_THEME.UPSELL, _classnames[styles$12['chip--warning']] = theme === CHIP_THEME.WARNING, _classnames[styles$12['chip--info']] = theme === CHIP_THEME.INFO, _classnames[styles$12['chip--danger']] = theme === CHIP_THEME.DANGER, _classnames))
|
|
9849
10028
|
}, children);
|
|
9850
10029
|
};
|
|
9851
10030
|
|
|
9852
|
-
var styles$
|
|
10031
|
+
var styles$13 = {"pill":"_23q4Y","pill--default":"_niDEM","pill--success":"_IwDRB","pill--danger":"_MPji-","pill--warning":"_3S2m8","pill--info":"_2G3ML"};
|
|
9853
10032
|
|
|
9854
10033
|
var PILL_THEME = {
|
|
9855
10034
|
INFO: 'info',
|
|
@@ -9868,7 +10047,7 @@ var Pill = function Pill(_ref) {
|
|
|
9868
10047
|
testId = _ref.testId;
|
|
9869
10048
|
return React__default.createElement("div", {
|
|
9870
10049
|
"data-testid": testId,
|
|
9871
|
-
className: classnames(styles$
|
|
10050
|
+
className: classnames(styles$13['pill'], (_classnames = {}, _classnames[styles$13['pill--default']] = theme === PILL_THEME.DEFAULT, _classnames[styles$13['pill--warning']] = theme === PILL_THEME.WARNING, _classnames[styles$13['pill--success']] = theme === PILL_THEME.SUCCESS, _classnames[styles$13['pill--danger']] = theme === PILL_THEME.DANGER, _classnames[styles$13['pill--info']] = theme === PILL_THEME.INFO, _classnames))
|
|
9872
10051
|
}, children);
|
|
9873
10052
|
};
|
|
9874
10053
|
|
|
@@ -9878,9 +10057,9 @@ var EMPTY_STATE_SIZE = {
|
|
|
9878
10057
|
LARGE: 'large'
|
|
9879
10058
|
};
|
|
9880
10059
|
|
|
9881
|
-
var styles$
|
|
10060
|
+
var styles$14 = {"empty-state-container-stack":"_2B8Vd","empty-state-container-stack__content":"_NBTDp","empty-state-container-stack__content--full-page":"_1UWbP","empty-state-container-stack__content--inline-horizontal":"_2BVOy","empty-state-container-stack__body":"_1LuiZ"};
|
|
9882
10061
|
|
|
9883
|
-
var styles$
|
|
10062
|
+
var styles$15 = {"empty-state-container-cta":"_1Cx9N","empty-state-container-cta--inside-modal":"_WbcaM"};
|
|
9884
10063
|
|
|
9885
10064
|
var EmptyStateContainerCTA = function EmptyStateContainerCTA(_ref) {
|
|
9886
10065
|
var _actions$primary, _actions$secondary, _classNames;
|
|
@@ -9898,7 +10077,7 @@ var EmptyStateContainerCTA = function EmptyStateContainerCTA(_ref) {
|
|
|
9898
10077
|
size: BUTTON_SIZES.MIN_WIDTH_100
|
|
9899
10078
|
});
|
|
9900
10079
|
return React__default.createElement("div", {
|
|
9901
|
-
className: classnames(styles$
|
|
10080
|
+
className: classnames(styles$15['empty-state-container-cta'], (_classNames = {}, _classNames[styles$15['empty-state-container-cta--inside-modal']] = isInsideModal, _classNames))
|
|
9902
10081
|
}, primaryButton, secondaryButton);
|
|
9903
10082
|
};
|
|
9904
10083
|
|
|
@@ -9913,7 +10092,7 @@ var EmptyStateContainerStack = function EmptyStateContainerStack(_ref) {
|
|
|
9913
10092
|
isPaywall = _ref$isPaywall === void 0 ? false : _ref$isPaywall,
|
|
9914
10093
|
testId = _ref.testId;
|
|
9915
10094
|
return React__default.createElement("div", {
|
|
9916
|
-
className: styles$
|
|
10095
|
+
className: styles$14['empty-state-container-stack'],
|
|
9917
10096
|
"data-testid": testId
|
|
9918
10097
|
}, React__default.createElement("img", {
|
|
9919
10098
|
src: mediaUrl,
|
|
@@ -9924,12 +10103,12 @@ var EmptyStateContainerStack = function EmptyStateContainerStack(_ref) {
|
|
|
9924
10103
|
alignItems: "center"
|
|
9925
10104
|
}, header && React__default.createElement(Text, {
|
|
9926
10105
|
as: "h4",
|
|
9927
|
-
color: isPaywall &&
|
|
10106
|
+
color: isPaywall && 'eggplant-500'
|
|
9928
10107
|
}, header), React__default.createElement(Text, {
|
|
9929
10108
|
emphasis: "bold",
|
|
9930
10109
|
as: "body"
|
|
9931
10110
|
}, title), React__default.createElement("div", {
|
|
9932
|
-
className: styles$
|
|
10111
|
+
className: styles$14['empty-state-container-stack__body']
|
|
9933
10112
|
}, children)), React__default.createElement(Stack, {
|
|
9934
10113
|
space: 8,
|
|
9935
10114
|
alignItems: "center"
|
|
@@ -9941,7 +10120,7 @@ var EmptyStateContainerStack = function EmptyStateContainerStack(_ref) {
|
|
|
9941
10120
|
}, caption)));
|
|
9942
10121
|
};
|
|
9943
10122
|
|
|
9944
|
-
var styles$
|
|
10123
|
+
var styles$16 = {"empty-state-container-inline":"_eMr1V","empty-state-container-inline--inside-modal":"_2sweG","empty-state-container-inline__content":"_2jreb","empty-state-container-inline__content--full-page":"_3RLfH","empty-state-container-inline__content--inline-horizontal":"_3BMpx","empty-state-container-inline__body":"_2J5vn","empty-state-container-inline__image":"_G2VtA"};
|
|
9945
10124
|
|
|
9946
10125
|
var EmptyStateContainerInline = function EmptyStateContainerInline(_ref) {
|
|
9947
10126
|
var _classNames, _classnames;
|
|
@@ -9962,19 +10141,19 @@ var EmptyStateContainerInline = function EmptyStateContainerInline(_ref) {
|
|
|
9962
10141
|
isInsideModal = _useModalContext.isModalMounted;
|
|
9963
10142
|
|
|
9964
10143
|
return React__default.createElement("div", {
|
|
9965
|
-
className: classnames(styles$
|
|
10144
|
+
className: classnames(styles$16['empty-state-container-inline'], (_classNames = {}, _classNames[styles$16['empty-state-container-inline--inside-modal']] = isInsideModal, _classNames)),
|
|
9966
10145
|
"data-testid": testId
|
|
9967
10146
|
}, React__default.createElement("div", {
|
|
9968
|
-
className: classnames(styles$
|
|
10147
|
+
className: classnames(styles$16['empty-state-container-inline__content'], (_classnames = {}, _classnames[styles$16['empty-state-container__content--full-page']] = size === EMPTY_STATE_SIZE.LARGE, _classnames[styles$16['empty-state-container__content--inline-horizontal']] = size === EMPTY_STATE_SIZE.MEDIUM, _classnames))
|
|
9969
10148
|
}, React__default.createElement(Stack, {
|
|
9970
10149
|
space: 8
|
|
9971
10150
|
}, header && React__default.createElement(Text, {
|
|
9972
10151
|
as: "h4",
|
|
9973
|
-
color: isPaywall &&
|
|
10152
|
+
color: isPaywall && 'eggplant-500'
|
|
9974
10153
|
}, header), React__default.createElement(Text, {
|
|
9975
10154
|
as: "h1"
|
|
9976
10155
|
}, title)), React__default.createElement("div", {
|
|
9977
|
-
className: styles$
|
|
10156
|
+
className: styles$16['empty-state-container-inline__body']
|
|
9978
10157
|
}, children), React__default.createElement(Stack, {
|
|
9979
10158
|
space: 8,
|
|
9980
10159
|
marginTop: 12
|
|
@@ -9985,7 +10164,7 @@ var EmptyStateContainerInline = function EmptyStateContainerInline(_ref) {
|
|
|
9985
10164
|
}), caption && React__default.createElement(Text, {
|
|
9986
10165
|
as: "caption"
|
|
9987
10166
|
}, caption))), React__default.createElement("div", {
|
|
9988
|
-
className: styles$
|
|
10167
|
+
className: styles$16['empty-state-container-inline__image']
|
|
9989
10168
|
}, React__default.createElement("img", {
|
|
9990
10169
|
src: mediaUrl,
|
|
9991
10170
|
alt: String(title),
|
|
@@ -10059,5 +10238,5 @@ var EmptyState = function EmptyState(_ref) {
|
|
|
10059
10238
|
}, children);
|
|
10060
10239
|
};
|
|
10061
10240
|
|
|
10062
|
-
export { AsyncSelectField, Avatar, Badge$1 as Badge, Bold, BreadcrumbItem, Breadcrumbs, Button$1 as Button, Calendar, Card, CheckboxField, Chip, CircularProgress, CurrencyField, DataTable, DataTableCell, DataTableEditableCell, DataTableRow, DateField, DateFilter, DateRangeField, Dropdown, DropdownList, DropdownListDivider, DropdownListItem, EmptyState, Form, FormFeedback, FormFooter, FormRow, FormSection, IconAnalytics, IconArrowDown, IconArrowLeft, IconArrowRight, IconArrowToTop, IconArrowTurnDownRight, IconArrowUp, IconAward, IconAwful, IconAwfulMonochromatic, IconBad, IconBadMonochromatic, IconBalanceScale, IconBalanceScaleLeft, IconBan, IconBarsH, IconBarsV, IconBell, IconBirthdayCake, IconBold, IconBolt, IconBook, IconBriefcase, IconBullseyeArrow, IconCalculator, IconCalendar, IconCalendarAlt, IconCalendarCheck, IconCalendarDay, IconCalendarExclamation, IconCalendarStar, IconCalendarTomorrow, IconCamera, IconCameraSlash, IconCashRegister, IconChartBar, IconCheck, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconClipboardList, IconClock, IconCog, IconComment, IconCommentLines, IconCopy, IconCreditCard, IconCreditCardPlus, IconDecent, IconDecentMonochromatic, IconDownload, IconEdit, IconEllipsisV, IconEnvelope, IconExclaimation, IconExclaimationTriangle, IconExpand, IconExternalLink, IconEye, IconEyeSlash, IconFile, IconFilePdf, IconFlag, IconFourDotsCircle, IconFourSquares, IconGavel, IconGif, IconGift, IconGood, IconGoodMonochromatic, IconGreat, IconGreatMonochromatic, IconGrinBeam, IconGripVertical, IconHandshake, IconImage, IconInfoCircle, IconIslandTropical, IconItalic, IconLaptopSearch, IconLink, IconList, IconListOI as IconListOi, IconLock, IconMagicSolid, IconMapMarker, IconMegaphone, IconMessages, IconMinus, IconMinusCircle, IconMoneyBill, IconMugSaucerSolid, IconNotesMedical, IconOvertime, IconPaperPlane, IconPaperPlaneClock, IconPaperclip, IconPencil, IconPercentage, IconPhone, IconPlug, IconPlus, IconPrint, IconQuestionCircle, IconRepeat, IconReply, IconSearch, IconSignOut, IconSitemap, IconSlidersH, IconSort, IconStar, IconStarSolid, IconStickyNoteLines, IconStopwatch, IconStrikethrough, IconSync, IconSyncExclaimation, IconTable, IconTachometer, IconTimes, IconTimesOctagon, IconTrash, IconUnderline, IconUndo, IconUniversity, IconUserComputer, IconUserFriends, IconUserLight, IconUserPlus, IconUserSearch, IconUserSlash, IconUserSolid, IconUserTag, IconUserTie, IconUsers, IconVideo, IconVolume, IconVolumeMute, IconWrench, Inline, InlineBanner, Italic, Link, Modal, ModalBody, ModalFooter, MultiSelectField, Page, PaginationControls, PasswordField, Paywall, PercentageField, PersistentBanner, Pill, PillSelectField, ProgressBar, RadioGroupBoxOption, RadioGroupField, RadioGroupOption, SIZE_25_PERCENT, SIZE_33_PERCENT, SIZE_50_PERCENT, SIZE_66_PERCENT, SIZE_75_PERCENT, SegmentedControl, SelectField, SousChefProvider, Spinner, Stack, Text, TextAreaField, TextField, TimeField, Toggle, ToolbarSelect, Tooltip$1 as Tooltip, Underline, WeekField, toast };
|
|
10241
|
+
export { AsyncSelectField, Avatar, Badge$1 as Badge, Bold, BreadcrumbItem, Breadcrumbs, Button$1 as Button, Calendar, Card, CheckboxField, Chip, CircularProgress, CurrencyField, DataTable, DataTableCell, DataTableEditableCell, DataTableRow, DateField, DateFilter, DateRangeField, Dropdown, DropdownList, DropdownListDivider, DropdownListItem, EmptyState, Form, FormFeedback, FormFooter, FormRow, FormSection, IconAnalytics, IconArrowDown, IconArrowLeft, IconArrowRight, IconArrowToTop, IconArrowTurnDownRight, IconArrowUp, IconAward, IconAwful, IconAwfulMonochromatic, IconBad, IconBadMonochromatic, IconBalanceScale, IconBalanceScaleLeft, IconBan, IconBarsH, IconBarsV, IconBell, IconBirthdayCake, IconBold, IconBolt, IconBook, IconBriefcase, IconBullseyeArrow, IconCalculator, IconCalendar, IconCalendarAlt, IconCalendarCheck, IconCalendarDay, IconCalendarExclamation, IconCalendarStar, IconCalendarTomorrow, IconCamera, IconCameraSlash, IconCashRegister, IconChartBar, IconCheck, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconClipboardList, IconClock, IconCog, IconComment, IconCommentLines, IconCopy, IconCreditCard, IconCreditCardPlus, IconDecent, IconDecentMonochromatic, IconDownload, IconEdit, IconEllipsisV, IconEnvelope, IconExclaimation, IconExclaimationTriangle, IconExpand, IconExternalLink, IconEye, IconEyeSlash, IconFile, IconFilePdf, IconFlag, IconFourDotsCircle, IconFourSquares, IconGavel, IconGif, IconGift, IconGood, IconGoodMonochromatic, IconGreat, IconGreatMonochromatic, IconGrinBeam, IconGripVertical, IconHandshake, IconImage, IconInfoCircle, IconIslandTropical, IconItalic, IconLaptopSearch, IconLink, IconList, IconListOI as IconListOi, IconLock, IconMagicSolid, IconMapMarker, IconMegaphone, IconMessages, IconMinus, IconMinusCircle, IconMoneyBill, IconMugSaucerSolid, IconNotesMedical, IconOvertime, IconPaperPlane, IconPaperPlaneClock, IconPaperclip, IconPencil, IconPercentage, IconPhone, IconPlug, IconPlus, IconPrint, IconQuestionCircle, IconRepeat, IconReply, IconSearch, IconSignOut, IconSitemap, IconSlidersH, IconSort, IconStar, IconStarSolid, IconStickyNoteLines, IconStopwatch, IconStrikethrough, IconSync, IconSyncExclaimation, IconTable, IconTachometer, IconTimes, IconTimesOctagon, IconTrash, IconUnderline, IconUndo, IconUniversity, IconUserComputer, IconUserFriends, IconUserLight, IconUserPlus, IconUserSearch, IconUserSlash, IconUserSolid, IconUserTag, IconUserTie, IconUsers, IconVideo, IconVolume, IconVolumeMute, IconWrench, Inline, InlineBanner, Italic, Link, Modal, ModalBody, ModalFooter, MultiSelectField, Page, PaginationControls, PasswordField, Paywall, PercentageField, PersistentBanner, Pill, PillSelectField, ProgressBar, RadioGroupBoxOption, RadioGroupField, RadioGroupOption, SIZE_25_PERCENT, SIZE_33_PERCENT, SIZE_50_PERCENT, SIZE_66_PERCENT, SIZE_75_PERCENT, SegmentedControl, SelectField, SousChefProvider, Spinner, Stack, Text, TextAreaField, TextField, TimeField, TimeRangeField, Toggle, ToolbarSelect, Tooltip$1 as Tooltip, Underline, WeekField, toast };
|
|
10063
10242
|
//# sourceMappingURL=index.modern.js.map
|