@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.js
CHANGED
|
@@ -6,6 +6,8 @@ var classnames = _interopDefault(require('classnames'));
|
|
|
6
6
|
var reactToastify = require('react-toastify');
|
|
7
7
|
var ReactDOM = _interopDefault(require('react-dom'));
|
|
8
8
|
require('react-toastify/dist/ReactToastify.css');
|
|
9
|
+
var lodashEs = require('lodash-es');
|
|
10
|
+
var parseTime = _interopDefault(require('time-autocomplete/src/core/AMPMParser'));
|
|
9
11
|
var ReactModal = _interopDefault(require('react-modal'));
|
|
10
12
|
var DayPicker = require('react-day-picker');
|
|
11
13
|
var DayPicker__default = _interopDefault(DayPicker);
|
|
@@ -13,8 +15,6 @@ require('react-day-picker/lib/style.css');
|
|
|
13
15
|
var dateFnsFormat = _interopDefault(require('date-fns/format'));
|
|
14
16
|
var dateFnsParse = _interopDefault(require('date-fns/parse'));
|
|
15
17
|
var startOfDay = _interopDefault(require('date-fns/startOfDay'));
|
|
16
|
-
var lodashEs = require('lodash-es');
|
|
17
|
-
var parseTime = _interopDefault(require('time-autocomplete/src/core/AMPMParser'));
|
|
18
18
|
var Select = require('react-select');
|
|
19
19
|
var Select__default = _interopDefault(Select);
|
|
20
20
|
var reactRouterDom = require('react-router-dom');
|
|
@@ -23,6 +23,8 @@ var DayPickerInput = _interopDefault(require('react-day-picker/DayPickerInput'))
|
|
|
23
23
|
var dateFns = require('date-fns');
|
|
24
24
|
var eachDayOfInterval = _interopDefault(require('date-fns/eachDayOfInterval'));
|
|
25
25
|
|
|
26
|
+
var COLORS = {};
|
|
27
|
+
|
|
26
28
|
function _extends() {
|
|
27
29
|
_extends = Object.assign || function (target) {
|
|
28
30
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -767,6 +769,14 @@ var ButtonElement = React.forwardRef(function (_ref2, ref) {
|
|
|
767
769
|
});
|
|
768
770
|
var Button$1 = React.forwardRef(Button);
|
|
769
771
|
|
|
772
|
+
var getColor = function getColor(color) {
|
|
773
|
+
if (color && COLORS[color]) {
|
|
774
|
+
return COLORS[color];
|
|
775
|
+
} else {
|
|
776
|
+
return color;
|
|
777
|
+
}
|
|
778
|
+
};
|
|
779
|
+
|
|
770
780
|
var ICON_SIZES = {
|
|
771
781
|
small: '12px',
|
|
772
782
|
medium: '16px',
|
|
@@ -785,7 +795,8 @@ var getIconStyles = function getIconStyles(_ref) {
|
|
|
785
795
|
width: ICON_SIZES[size],
|
|
786
796
|
height: ICON_SIZES[size],
|
|
787
797
|
verticalAlign: 'middle',
|
|
788
|
-
fill: color
|
|
798
|
+
fill: color,
|
|
799
|
+
color: getColor(color)
|
|
789
800
|
}, styles);
|
|
790
801
|
};
|
|
791
802
|
|
|
@@ -936,7 +947,8 @@ var IconArrowTurnDownRight = React.forwardRef(function (_ref, ref) {
|
|
|
936
947
|
clipPath: "url(#icon-arrow-turn-down-right_svg__a)"
|
|
937
948
|
}, React__default.createElement("path", {
|
|
938
949
|
opacity: 0.9,
|
|
939
|
-
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"
|
|
950
|
+
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",
|
|
951
|
+
fill: "currentColor"
|
|
940
952
|
})), React__default.createElement("defs", null, React__default.createElement("clipPath", {
|
|
941
953
|
id: "icon-arrow-turn-down-right_svg__a"
|
|
942
954
|
}, React__default.createElement("path", {
|
|
@@ -2415,13 +2427,12 @@ var IconFourSquares = React.forwardRef(function (_ref, ref) {
|
|
|
2415
2427
|
rx: 1,
|
|
2416
2428
|
fill: "currentColor"
|
|
2417
2429
|
}), React__default.createElement("rect", {
|
|
2418
|
-
x: 10.
|
|
2419
|
-
y: 10.
|
|
2420
|
-
width: 8.
|
|
2421
|
-
height: 8.
|
|
2422
|
-
rx:
|
|
2423
|
-
|
|
2424
|
-
strokeWidth: 0.5
|
|
2430
|
+
x: 10.573,
|
|
2431
|
+
y: 10.573,
|
|
2432
|
+
width: 8.594,
|
|
2433
|
+
height: 8.594,
|
|
2434
|
+
rx: 1,
|
|
2435
|
+
fill: "currentColor"
|
|
2425
2436
|
}), React__default.createElement("rect", {
|
|
2426
2437
|
x: 0.833,
|
|
2427
2438
|
y: 0.833,
|
|
@@ -3003,7 +3014,8 @@ var IconMessages = React.forwardRef(function (_ref, ref) {
|
|
|
3003
3014
|
"data-testid": testId,
|
|
3004
3015
|
ref: ref
|
|
3005
3016
|
}, props), React__default.createElement("path", {
|
|
3006
|
-
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"
|
|
3017
|
+
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",
|
|
3018
|
+
fill: "currentColor"
|
|
3007
3019
|
}));
|
|
3008
3020
|
});
|
|
3009
3021
|
IconMessages.displayName = 'IconMessages';
|
|
@@ -3082,7 +3094,8 @@ var IconMugSaucerSolid = React.forwardRef(function (_ref, ref) {
|
|
|
3082
3094
|
"data-testid": testId,
|
|
3083
3095
|
ref: ref
|
|
3084
3096
|
}, props), React__default.createElement("path", {
|
|
3085
|
-
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"
|
|
3097
|
+
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",
|
|
3098
|
+
fill: "currentColor"
|
|
3086
3099
|
}));
|
|
3087
3100
|
});
|
|
3088
3101
|
IconMugSaucerSolid.displayName = 'IconMugSaucerSolid';
|
|
@@ -4308,6 +4321,141 @@ var SousChefProvider = function SousChefProvider(_ref) {
|
|
|
4308
4321
|
return React__default.createElement(React.Fragment, null, React__default.createElement(ToastContainer, null), children);
|
|
4309
4322
|
};
|
|
4310
4323
|
|
|
4324
|
+
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"};
|
|
4325
|
+
|
|
4326
|
+
var SORT_ORDER = {
|
|
4327
|
+
ASC: 'asc',
|
|
4328
|
+
DESC: 'desc'
|
|
4329
|
+
};
|
|
4330
|
+
|
|
4331
|
+
var getNextSort = function getNextSort(column) {
|
|
4332
|
+
switch (column.currentSort) {
|
|
4333
|
+
case SORT_ORDER.ASC:
|
|
4334
|
+
return null;
|
|
4335
|
+
|
|
4336
|
+
case SORT_ORDER.DESC:
|
|
4337
|
+
return SORT_ORDER.ASC;
|
|
4338
|
+
|
|
4339
|
+
default:
|
|
4340
|
+
return SORT_ORDER.DESC;
|
|
4341
|
+
}
|
|
4342
|
+
};
|
|
4343
|
+
|
|
4344
|
+
var calculatePercentageOfProportion = function calculatePercentageOfProportion(proportionNumbers) {
|
|
4345
|
+
var sum = proportionNumbers.reduce(function (total, num) {
|
|
4346
|
+
return total + num;
|
|
4347
|
+
}, 0);
|
|
4348
|
+
var percentages = proportionNumbers.map(function (num) {
|
|
4349
|
+
return parseFloat((num / sum * 100).toFixed(2));
|
|
4350
|
+
});
|
|
4351
|
+
return percentages;
|
|
4352
|
+
};
|
|
4353
|
+
|
|
4354
|
+
var ColumnSizes = function ColumnSizes(_ref) {
|
|
4355
|
+
var columns = _ref.columns,
|
|
4356
|
+
showActionMenu = _ref.showActionMenu;
|
|
4357
|
+
var columnPercentageSizes = calculatePercentageOfProportion(columns.map(function (column) {
|
|
4358
|
+
return column.size || 1;
|
|
4359
|
+
}));
|
|
4360
|
+
return React__default.createElement("colgroup", null, columns.map(function (column, index) {
|
|
4361
|
+
return React__default.createElement("col", {
|
|
4362
|
+
key: column.name,
|
|
4363
|
+
style: {
|
|
4364
|
+
width: columnPercentageSizes[index] + "%"
|
|
4365
|
+
}
|
|
4366
|
+
});
|
|
4367
|
+
}), showActionMenu && React__default.createElement("col", {
|
|
4368
|
+
style: {
|
|
4369
|
+
width: "1%",
|
|
4370
|
+
whiteSpace: 'nowrap'
|
|
4371
|
+
}
|
|
4372
|
+
}));
|
|
4373
|
+
};
|
|
4374
|
+
|
|
4375
|
+
var HeaderSortIcon = function HeaderSortIcon(_ref) {
|
|
4376
|
+
var sortDirection = _ref.sortDirection;
|
|
4377
|
+
var sortDir = sortDirection || null;
|
|
4378
|
+
return React__default.createElement("div", {
|
|
4379
|
+
style: {
|
|
4380
|
+
display: 'inline-flex',
|
|
4381
|
+
flexDirection: 'column'
|
|
4382
|
+
}
|
|
4383
|
+
}, sortDir !== 'desc' && React__default.createElement(IconChevronUp, {
|
|
4384
|
+
size: "small",
|
|
4385
|
+
color: "grey-400"
|
|
4386
|
+
}), sortDir !== 'asc' && React__default.createElement("span", {
|
|
4387
|
+
style: {
|
|
4388
|
+
marginTop: '-4px'
|
|
4389
|
+
}
|
|
4390
|
+
}, React__default.createElement(IconChevronDown, {
|
|
4391
|
+
size: "small",
|
|
4392
|
+
color: "grey-400"
|
|
4393
|
+
})));
|
|
4394
|
+
};
|
|
4395
|
+
|
|
4396
|
+
var DataTableHeader = function DataTableHeader(_ref) {
|
|
4397
|
+
var columns = _ref.columns,
|
|
4398
|
+
onSort = _ref.onSort,
|
|
4399
|
+
showActionMenu = _ref.showActionMenu;
|
|
4400
|
+
var haveLabels = columns.find(function (column) {
|
|
4401
|
+
return column.label && column.label !== '';
|
|
4402
|
+
});
|
|
4403
|
+
|
|
4404
|
+
if (!haveLabels) {
|
|
4405
|
+
return React__default.createElement(ColumnSizes, {
|
|
4406
|
+
columns: columns,
|
|
4407
|
+
showActionMenu: showActionMenu
|
|
4408
|
+
});
|
|
4409
|
+
}
|
|
4410
|
+
|
|
4411
|
+
var handleSort = function handleSort(column) {
|
|
4412
|
+
var nextDirection = getNextSort(column);
|
|
4413
|
+
|
|
4414
|
+
if (onSort) {
|
|
4415
|
+
onSort({
|
|
4416
|
+
columnName: column.name,
|
|
4417
|
+
direction: nextDirection
|
|
4418
|
+
});
|
|
4419
|
+
}
|
|
4420
|
+
};
|
|
4421
|
+
|
|
4422
|
+
return React__default.createElement(React.Fragment, null, React__default.createElement(ColumnSizes, {
|
|
4423
|
+
columns: columns,
|
|
4424
|
+
showActionMenu: showActionMenu
|
|
4425
|
+
}), React__default.createElement("thead", null, React__default.createElement("tr", {
|
|
4426
|
+
className: styles$9['data-table-header']
|
|
4427
|
+
}, columns.map(function (column) {
|
|
4428
|
+
var _classnames, _classnames2;
|
|
4429
|
+
|
|
4430
|
+
var isSortable = column.isSortable;
|
|
4431
|
+
var sortDir = column.currentSort;
|
|
4432
|
+
var isRightAligned = column.isRightAligned;
|
|
4433
|
+
return React__default.createElement("th", {
|
|
4434
|
+
className: classnames((_classnames = {}, _classnames[styles$9['data-table-header__item']] = true, _classnames[styles$9['data-table-header__item--sortable']] = isSortable, _classnames)),
|
|
4435
|
+
style: {
|
|
4436
|
+
flex: column.size || 1
|
|
4437
|
+
},
|
|
4438
|
+
key: column.name,
|
|
4439
|
+
onClick: function onClick() {
|
|
4440
|
+
return isSortable && handleSort(column);
|
|
4441
|
+
},
|
|
4442
|
+
onKeyPress: function onKeyPress() {
|
|
4443
|
+
return isSortable && handleSort(column);
|
|
4444
|
+
},
|
|
4445
|
+
role: "columnheader",
|
|
4446
|
+
tabIndex: 0
|
|
4447
|
+
}, React__default.createElement("div", {
|
|
4448
|
+
className: classnames(styles$9['data-table-header__item-content'], (_classnames2 = {}, _classnames2[styles$9['data-table-header__item-content--right-align']] = isRightAligned, _classnames2))
|
|
4449
|
+
}, column.label, ' ', isSortable && React__default.createElement("span", {
|
|
4450
|
+
className: styles$9['data-table-header__sort-icon']
|
|
4451
|
+
}, React__default.createElement(HeaderSortIcon, {
|
|
4452
|
+
sortDirection: sortDir
|
|
4453
|
+
}))));
|
|
4454
|
+
}), showActionMenu && React__default.createElement("th", {
|
|
4455
|
+
className: classnames(styles$9['data-table-header__item'], styles$9['data-table-header__item--action'])
|
|
4456
|
+
}))));
|
|
4457
|
+
};
|
|
4458
|
+
|
|
4311
4459
|
var initialValue = {
|
|
4312
4460
|
columns: [],
|
|
4313
4461
|
numberOfRows: 0
|
|
@@ -4323,9 +4471,42 @@ var useDataTableContext = function useDataTableContext() {
|
|
|
4323
4471
|
return context;
|
|
4324
4472
|
};
|
|
4325
4473
|
|
|
4326
|
-
var styles$
|
|
4474
|
+
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"};
|
|
4475
|
+
|
|
4476
|
+
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"};
|
|
4477
|
+
|
|
4478
|
+
var DataTableScrollFakeBorder = function DataTableScrollFakeBorder(_ref) {
|
|
4479
|
+
var _classNames, _classNames2, _classNames3;
|
|
4480
|
+
|
|
4481
|
+
var placement = _ref.placement;
|
|
4482
|
+
return React__default.createElement("div", {
|
|
4483
|
+
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))
|
|
4484
|
+
}, React__default.createElement("div", {
|
|
4485
|
+
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))
|
|
4486
|
+
}), React__default.createElement("div", {
|
|
4487
|
+
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))
|
|
4488
|
+
}));
|
|
4489
|
+
};
|
|
4490
|
+
|
|
4491
|
+
var styles$c = {"data-table-loading-block":"_94pbt"};
|
|
4492
|
+
|
|
4493
|
+
var DataTableLoadingBlock = function DataTableLoadingBlock(_ref) {
|
|
4494
|
+
var amountOfColumns = _ref.amountOfColumns,
|
|
4495
|
+
showActionMenu = _ref.showActionMenu;
|
|
4496
|
+
var aditionalColums = showActionMenu ? 1 : 0;
|
|
4497
|
+
var colSpan = amountOfColumns + aditionalColums;
|
|
4498
|
+
return React__default.createElement("tr", {
|
|
4499
|
+
className: styles$c['data-table-loading-block']
|
|
4500
|
+
}, React__default.createElement("td", {
|
|
4501
|
+
colSpan: colSpan
|
|
4502
|
+
}, React__default.createElement(Spinner, {
|
|
4503
|
+
block: true
|
|
4504
|
+
})));
|
|
4505
|
+
};
|
|
4506
|
+
|
|
4507
|
+
var styles$d = {"item":"_2GGMG","clickable":"_3VoZI","selected":"_1ZCir"};
|
|
4327
4508
|
|
|
4328
|
-
var styles$
|
|
4509
|
+
var styles$e = {"actions":"_3Iab2"};
|
|
4329
4510
|
|
|
4330
4511
|
var DropdownContext = React__default.createContext({
|
|
4331
4512
|
onToggleDropdown: function onToggleDropdown() {},
|
|
@@ -4341,7 +4522,7 @@ var useDropdownContext = function useDropdownContext() {
|
|
|
4341
4522
|
return React__default.useContext(DropdownContext);
|
|
4342
4523
|
};
|
|
4343
4524
|
|
|
4344
|
-
var styles$
|
|
4525
|
+
var styles$f = {"dropdown-pane":"_2EwLt"};
|
|
4345
4526
|
|
|
4346
4527
|
function isClickInside(ref, event) {
|
|
4347
4528
|
return !ref.current || event.target instanceof Node && ref.current.contains(event.target);
|
|
@@ -4481,7 +4662,7 @@ var PaneOverlay = function PaneOverlay(_ref) {
|
|
|
4481
4662
|
useKeyPress(['Escape'], handleEscapeKey);
|
|
4482
4663
|
var overflow = maxHeight ? 'scroll' : undefined;
|
|
4483
4664
|
return React__default.createElement("div", {
|
|
4484
|
-
className: classnames(styles$
|
|
4665
|
+
className: classnames(styles$f['dropdown-pane'], (_classNames = {}, _classNames[styles$f['dropdown-pane--with-padding']] = true, _classNames)),
|
|
4485
4666
|
style: _extends({}, position, {
|
|
4486
4667
|
width: width,
|
|
4487
4668
|
maxHeight: maxHeight,
|
|
@@ -4511,7 +4692,7 @@ var getKeyboardFocusableElements = function getKeyboardFocusableElements(element
|
|
|
4511
4692
|
});
|
|
4512
4693
|
};
|
|
4513
4694
|
|
|
4514
|
-
var styles$
|
|
4695
|
+
var styles$g = {"dropdown__trigger":"_2rs8m"};
|
|
4515
4696
|
|
|
4516
4697
|
var DROPDOWN_ALIGNEMNT = {
|
|
4517
4698
|
LEFT: 'left',
|
|
@@ -4522,422 +4703,588 @@ var DROPDOWN_TRIGGER = {
|
|
|
4522
4703
|
CLICK: 'click'
|
|
4523
4704
|
};
|
|
4524
4705
|
|
|
4525
|
-
var styles$
|
|
4706
|
+
var styles$h = {"label":"_h724f","label--truncate":"_1VUoF"};
|
|
4526
4707
|
|
|
4527
|
-
var
|
|
4708
|
+
var isEllipsisActive = function isEllipsisActive(e) {
|
|
4709
|
+
return e.offsetWidth < e.scrollWidth;
|
|
4710
|
+
};
|
|
4528
4711
|
|
|
4529
|
-
var
|
|
4530
|
-
var
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
loading = _ref.loading;
|
|
4712
|
+
var useLabelTooltip = function useLabelTooltip(labelId, tooltipContent, truncate) {
|
|
4713
|
+
var _useState = React.useState(false),
|
|
4714
|
+
showTooltip = _useState[0],
|
|
4715
|
+
setShowTooltip = _useState[1];
|
|
4534
4716
|
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
}, React__default.createElement(IconTimes, null))) : null;
|
|
4543
|
-
}
|
|
4717
|
+
var shouldTruncate = typeof tooltipContent === 'string' && truncate;
|
|
4718
|
+
var labelElement = document.getElementById(labelId);
|
|
4719
|
+
var isHidden = labelElement && labelElement.offsetParent === null;
|
|
4720
|
+
var handleApplyTooltip = React.useCallback(function () {
|
|
4721
|
+
if (!shouldTruncate) {
|
|
4722
|
+
return;
|
|
4723
|
+
}
|
|
4544
4724
|
|
|
4545
|
-
|
|
4546
|
-
space: 12,
|
|
4547
|
-
marginBottom: 24
|
|
4548
|
-
}, React__default.createElement(Inline, {
|
|
4549
|
-
flex: [1],
|
|
4550
|
-
alignItems: "center"
|
|
4551
|
-
}, React__default.createElement("span", {
|
|
4552
|
-
className: styles$e['header']
|
|
4553
|
-
}, header), onClose && React__default.createElement(Button$1, {
|
|
4554
|
-
theme: "link-icon",
|
|
4555
|
-
onClick: onClose,
|
|
4556
|
-
disabled: loading
|
|
4557
|
-
}, React__default.createElement(IconTimes, null))), subHeader && React__default.createElement("div", {
|
|
4558
|
-
className: styles$e['sub-header']
|
|
4559
|
-
}, subHeader));
|
|
4560
|
-
};
|
|
4725
|
+
var labelElement = document.getElementById(labelId);
|
|
4561
4726
|
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
}
|
|
4565
|
-
var useModalContext = function useModalContext() {
|
|
4566
|
-
var context = React.useContext(ModalContext);
|
|
4567
|
-
return context || {};
|
|
4568
|
-
};
|
|
4727
|
+
if (!labelElement) {
|
|
4728
|
+
return;
|
|
4729
|
+
}
|
|
4569
4730
|
|
|
4570
|
-
var
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
onClose = _ref.onClose,
|
|
4575
|
-
loading = _ref.loading,
|
|
4576
|
-
_ref$zIndex = _ref.zIndex,
|
|
4577
|
-
zIndex = _ref$zIndex === void 0 ? Z_INDEX_LAYERS.MODAL : _ref$zIndex,
|
|
4578
|
-
rootElementId = _ref.rootElementId,
|
|
4579
|
-
_ref$width = _ref.width,
|
|
4580
|
-
width = _ref$width === void 0 ? 500 : _ref$width,
|
|
4581
|
-
height = _ref.height,
|
|
4582
|
-
maxWidth = _ref.maxWidth,
|
|
4583
|
-
_ref$shouldReturnFocu = _ref.shouldReturnFocusAfterClose,
|
|
4584
|
-
shouldReturnFocusAfterClose = _ref$shouldReturnFocu === void 0 ? true : _ref$shouldReturnFocu,
|
|
4585
|
-
testId = _ref.testId;
|
|
4586
|
-
var style = {
|
|
4587
|
-
content: {
|
|
4588
|
-
width: width,
|
|
4589
|
-
height: height,
|
|
4590
|
-
maxWidth: maxWidth
|
|
4591
|
-
},
|
|
4592
|
-
overlay: {
|
|
4593
|
-
zIndex: zIndex
|
|
4731
|
+
var shouldShowTooltip = isEllipsisActive(labelElement);
|
|
4732
|
+
|
|
4733
|
+
if (showTooltip !== shouldShowTooltip) {
|
|
4734
|
+
setShowTooltip(shouldShowTooltip);
|
|
4594
4735
|
}
|
|
4595
|
-
};
|
|
4596
|
-
return React__default.createElement(ReactModal, {
|
|
4597
|
-
isOpen: true,
|
|
4598
|
-
testId: testId,
|
|
4599
|
-
shouldCloseOnEsc: true,
|
|
4600
|
-
shouldCloseOnOverlayClick: false,
|
|
4601
|
-
shouldReturnFocusAfterClose: shouldReturnFocusAfterClose,
|
|
4602
|
-
onRequestClose: onClose && !loading ? onClose : undefined,
|
|
4603
|
-
style: style,
|
|
4604
|
-
closeTimeoutMS: 200,
|
|
4605
|
-
contentLabel: "Modal",
|
|
4606
|
-
appElement: rootElementId && document.getElementById(rootElementId) || undefined,
|
|
4607
|
-
overlayClassName: {
|
|
4608
|
-
base: styles$d['overlay'],
|
|
4609
|
-
afterOpen: styles$d['overlay--after-open'],
|
|
4610
|
-
beforeClose: styles$d['overlay--before-close']
|
|
4611
|
-
},
|
|
4612
|
-
className: {
|
|
4613
|
-
base: styles$d['content'],
|
|
4614
|
-
afterOpen: styles$d['content--after-open'],
|
|
4615
|
-
beforeClose: styles$d['content--before-close']
|
|
4616
|
-
}
|
|
4617
|
-
}, React__default.createElement(ModalHeader, {
|
|
4618
|
-
header: header,
|
|
4619
|
-
subHeader: subHeader,
|
|
4620
|
-
onClose: onClose,
|
|
4621
|
-
loading: loading
|
|
4622
|
-
}), React__default.createElement(ModalContext.Provider, {
|
|
4623
|
-
value: {
|
|
4624
|
-
isModalMounted: true
|
|
4625
|
-
}
|
|
4626
|
-
}, children));
|
|
4627
|
-
};
|
|
4628
|
-
|
|
4629
|
-
Modal.setAppElement = function (rootElement) {
|
|
4630
|
-
ReactModal.setAppElement(rootElement);
|
|
4631
|
-
};
|
|
4632
|
-
|
|
4633
|
-
var THRESHOLD = 20;
|
|
4634
|
-
var useScrollShadow = function useScrollShadow() {
|
|
4635
|
-
var ref = React.useRef(null);
|
|
4636
|
-
|
|
4637
|
-
var _useState = React.useState(false),
|
|
4638
|
-
showScrollShadow = _useState[0],
|
|
4639
|
-
setShowScrollShadow = _useState[1];
|
|
4640
|
-
|
|
4736
|
+
}, [shouldTruncate, isHidden]);
|
|
4641
4737
|
React.useEffect(function () {
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
setShowScrollShadow(true);
|
|
4650
|
-
}
|
|
4651
|
-
}, []);
|
|
4738
|
+
var onWindowResize = lodashEs.debounce(handleApplyTooltip, 300);
|
|
4739
|
+
window.addEventListener('resize', onWindowResize);
|
|
4740
|
+
return function () {
|
|
4741
|
+
return window.removeEventListener('resize', onWindowResize);
|
|
4742
|
+
};
|
|
4743
|
+
}, [handleApplyTooltip]);
|
|
4744
|
+
React.useLayoutEffect(handleApplyTooltip, [handleApplyTooltip]);
|
|
4652
4745
|
return {
|
|
4653
|
-
|
|
4654
|
-
|
|
4746
|
+
showTooltip: showTooltip,
|
|
4747
|
+
shouldTruncate: shouldTruncate
|
|
4655
4748
|
};
|
|
4656
4749
|
};
|
|
4657
4750
|
|
|
4658
|
-
var
|
|
4659
|
-
|
|
4660
|
-
var ModalBody = function ModalBody(_ref) {
|
|
4751
|
+
var Label = function Label(_ref) {
|
|
4661
4752
|
var _classNames;
|
|
4662
4753
|
|
|
4663
|
-
var
|
|
4664
|
-
|
|
4754
|
+
var htmlFor = _ref.htmlFor,
|
|
4755
|
+
children = _ref.children,
|
|
4756
|
+
_ref$truncate = _ref.truncate,
|
|
4757
|
+
truncate = _ref$truncate === void 0 ? true : _ref$truncate;
|
|
4758
|
+
var labelId = "label-" + htmlFor;
|
|
4665
4759
|
|
|
4666
|
-
var
|
|
4667
|
-
|
|
4668
|
-
|
|
4760
|
+
var _useLabelTooltip = useLabelTooltip(labelId, children, truncate),
|
|
4761
|
+
showTooltip = _useLabelTooltip.showTooltip,
|
|
4762
|
+
shouldTruncate = _useLabelTooltip.shouldTruncate;
|
|
4669
4763
|
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4764
|
+
var LabelElement = React__default.createElement("label", {
|
|
4765
|
+
htmlFor: htmlFor,
|
|
4766
|
+
id: labelId,
|
|
4767
|
+
className: classnames(styles$h['label'], (_classNames = {}, _classNames[styles$h['label--truncate']] = shouldTruncate, _classNames))
|
|
4674
4768
|
}, children);
|
|
4675
|
-
};
|
|
4676
|
-
|
|
4677
|
-
var styles$g = {"modal-footer":"_LKOr5","tertiary-container":"_Qktd-"};
|
|
4678
|
-
|
|
4679
|
-
var updateButtonProps = function updateButtonProps(button, newProps) {
|
|
4680
|
-
if (!button) {
|
|
4681
|
-
return null;
|
|
4682
|
-
}
|
|
4683
4769
|
|
|
4684
|
-
if (
|
|
4685
|
-
return
|
|
4770
|
+
if (showTooltip) {
|
|
4771
|
+
return React__default.createElement(Tooltip$1, {
|
|
4772
|
+
overlay: children,
|
|
4773
|
+
placement: "top"
|
|
4774
|
+
}, LabelElement);
|
|
4686
4775
|
}
|
|
4687
4776
|
|
|
4688
|
-
return
|
|
4777
|
+
return LabelElement;
|
|
4689
4778
|
};
|
|
4690
4779
|
|
|
4691
|
-
var
|
|
4692
|
-
var children = _ref.children,
|
|
4693
|
-
actions = _ref.actions,
|
|
4694
|
-
testId = _ref.testId;
|
|
4695
|
-
|
|
4696
|
-
if (actions) {
|
|
4697
|
-
var _actions$primary, _actions$secondary, _actions$tertiary, _classnames;
|
|
4698
|
-
|
|
4699
|
-
var primaryButton = updateButtonProps(actions.primary, {
|
|
4700
|
-
theme: (actions === null || actions === void 0 ? void 0 : (_actions$primary = actions.primary) === null || _actions$primary === void 0 ? void 0 : _actions$primary.props.theme) || 'primary',
|
|
4701
|
-
size: BUTTON_SIZES.MIN_WIDTH_100
|
|
4702
|
-
});
|
|
4703
|
-
var secondaryButton = updateButtonProps(actions.secondary, {
|
|
4704
|
-
theme: (actions === null || actions === void 0 ? void 0 : (_actions$secondary = actions.secondary) === null || _actions$secondary === void 0 ? void 0 : _actions$secondary.props.theme) || 'default',
|
|
4705
|
-
size: BUTTON_SIZES.MIN_WIDTH_100
|
|
4706
|
-
});
|
|
4707
|
-
var tertiaryButton = updateButtonProps(actions.tertiary, {
|
|
4708
|
-
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',
|
|
4709
|
-
size: BUTTON_SIZES.MIN_WIDTH_100
|
|
4710
|
-
});
|
|
4711
|
-
return React__default.createElement(FooterContainer, {
|
|
4712
|
-
testId: testId
|
|
4713
|
-
}, React__default.createElement(Inline, {
|
|
4714
|
-
justifyContent: "space-between"
|
|
4715
|
-
}, React__default.createElement("div", {
|
|
4716
|
-
className: classnames((_classnames = {}, _classnames[styles$g['tertiary-container']] = tertiaryButton && tertiaryButton.props.theme.startsWith('link'), _classnames))
|
|
4717
|
-
}, tertiaryButton || React__default.createElement("div", null)), React__default.createElement(Inline, {
|
|
4718
|
-
space: 12
|
|
4719
|
-
}, secondaryButton, primaryButton)));
|
|
4720
|
-
}
|
|
4780
|
+
var styles$i = {"caption":"_1DWBq"};
|
|
4721
4781
|
|
|
4722
|
-
|
|
4782
|
+
var Caption = function Caption(_ref) {
|
|
4783
|
+
var fieldId = _ref.fieldId,
|
|
4784
|
+
children = _ref.children;
|
|
4785
|
+
return React__default.createElement("div", {
|
|
4786
|
+
id: fieldId && fieldId + "-describer",
|
|
4787
|
+
className: styles$i['caption']
|
|
4788
|
+
}, children);
|
|
4723
4789
|
};
|
|
4724
4790
|
|
|
4725
|
-
var
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
var
|
|
4729
|
-
|
|
4791
|
+
var styles$j = {"error-message":"_nZ2MD"};
|
|
4792
|
+
|
|
4793
|
+
var ErrorMessage = function ErrorMessage(_ref) {
|
|
4794
|
+
var fieldId = _ref.fieldId,
|
|
4795
|
+
children = _ref.children,
|
|
4796
|
+
testId = _ref.testId;
|
|
4730
4797
|
return React__default.createElement("div", {
|
|
4731
|
-
|
|
4798
|
+
id: fieldId && fieldId + "-error-message",
|
|
4799
|
+
className: styles$j['error-message'],
|
|
4732
4800
|
"data-testid": testId
|
|
4733
4801
|
}, React__default.createElement(Inline, {
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4802
|
+
space: 8,
|
|
4803
|
+
alignItems: "center"
|
|
4804
|
+
}, React__default.createElement(IconTimesOctagon, {
|
|
4805
|
+
color: "radish-400",
|
|
4806
|
+
size: "medium"
|
|
4807
|
+
}), children));
|
|
4738
4808
|
};
|
|
4739
4809
|
|
|
4740
|
-
var
|
|
4810
|
+
var Field = function Field(_ref) {
|
|
4811
|
+
var id = _ref.id,
|
|
4812
|
+
label = _ref.label,
|
|
4813
|
+
caption = _ref.caption,
|
|
4814
|
+
error = _ref.error,
|
|
4815
|
+
children = _ref.children;
|
|
4816
|
+
var shouldRenderLabel = label || typeof label === 'string';
|
|
4817
|
+
return React__default.createElement(Stack, {
|
|
4818
|
+
space: 8,
|
|
4819
|
+
flexItems: true
|
|
4820
|
+
}, shouldRenderLabel && React__default.createElement(Label, {
|
|
4821
|
+
htmlFor: id
|
|
4822
|
+
}, label), children, caption && React__default.createElement(Caption, {
|
|
4823
|
+
fieldId: id
|
|
4824
|
+
}, caption), error && React__default.createElement(ErrorMessage, {
|
|
4825
|
+
fieldId: id
|
|
4826
|
+
}, error));
|
|
4827
|
+
};
|
|
4741
4828
|
|
|
4742
|
-
var
|
|
4829
|
+
var Context$1 = React.createContext({});
|
|
4830
|
+
var useFormContext = function useFormContext() {
|
|
4831
|
+
var context = React.useContext(Context$1);
|
|
4832
|
+
return context || {};
|
|
4833
|
+
};
|
|
4743
4834
|
|
|
4744
|
-
function
|
|
4745
|
-
var
|
|
4746
|
-
|
|
4747
|
-
|
|
4835
|
+
var useFieldId = function useFieldId(_ref) {
|
|
4836
|
+
var name = _ref.name,
|
|
4837
|
+
inputId = _ref.id;
|
|
4838
|
+
var id = React.useMemo(function () {
|
|
4839
|
+
return inputId ? inputId : name + "-" + Math.random();
|
|
4840
|
+
}, [inputId, name]);
|
|
4841
|
+
return id;
|
|
4842
|
+
};
|
|
4748
4843
|
|
|
4749
|
-
|
|
4750
|
-
|
|
4844
|
+
var getFormikState = function getFormikState(name, formik) {
|
|
4845
|
+
if (formik === undefined) {
|
|
4846
|
+
return null;
|
|
4751
4847
|
}
|
|
4752
4848
|
|
|
4753
|
-
|
|
4754
|
-
}
|
|
4755
|
-
function formatDate(date, format, locale) {
|
|
4756
|
-
return dateFnsFormat(date, format, {
|
|
4757
|
-
locale: locale
|
|
4758
|
-
});
|
|
4759
|
-
}
|
|
4760
|
-
function setToMidnight(date) {
|
|
4761
|
-
return date && startOfDay(date);
|
|
4762
|
-
}
|
|
4763
|
-
function getStartOfWeek(date, weekIndex) {
|
|
4764
|
-
var d = new Date(date);
|
|
4765
|
-
var firstDay = d.getDate() - d.getDay() + weekIndex;
|
|
4766
|
-
var firstDayAdjusted = firstDay > d.getDate() ? firstDay - 7 : firstDay;
|
|
4767
|
-
return new Date(d.setDate(firstDayAdjusted));
|
|
4768
|
-
}
|
|
4769
|
-
function getEndOfWeek(date, weekIndex) {
|
|
4770
|
-
var startOfWeek = getStartOfWeek(date, weekIndex);
|
|
4771
|
-
var endDay = startOfWeek.getDate() + 6;
|
|
4772
|
-
return new Date(startOfWeek.setDate(endDay));
|
|
4773
|
-
}
|
|
4774
|
-
function createWeekRange(date, weekStart) {
|
|
4775
|
-
return {
|
|
4776
|
-
start: getStartOfWeek(date, weekStart),
|
|
4777
|
-
end: getEndOfWeek(date, weekStart)
|
|
4778
|
-
};
|
|
4779
|
-
}
|
|
4780
|
-
var DAYS = [getLocalizedString('time.sunday'), getLocalizedString('time.monday'), getLocalizedString('time.tuesday'), getLocalizedString('time.wednesday'), getLocalizedString('time.thursday'), getLocalizedString('time.friday'), getLocalizedString('time.saturday')];
|
|
4781
|
-
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')];
|
|
4782
|
-
|
|
4783
|
-
var CALENDAR_MODE = {
|
|
4784
|
-
DAY: 'day',
|
|
4785
|
-
WEEK: 'week'
|
|
4786
|
-
};
|
|
4787
|
-
var CALENDAR_PLACEMENT = {
|
|
4788
|
-
BOTTOM: 'bottom',
|
|
4789
|
-
TOP: 'top'
|
|
4790
|
-
};
|
|
4849
|
+
var formikPath = getFormikArrayPath(name);
|
|
4791
4850
|
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
return {
|
|
4795
|
-
left: 0,
|
|
4796
|
-
top: 0
|
|
4797
|
-
};
|
|
4851
|
+
if (formikPath.length === 0) {
|
|
4852
|
+
return null;
|
|
4798
4853
|
}
|
|
4799
4854
|
|
|
4800
|
-
var
|
|
4801
|
-
|
|
4802
|
-
return _extends({}, horizontalPosition, verticalPosition);
|
|
4803
|
-
};
|
|
4804
|
-
|
|
4805
|
-
var getHorizontalPosition = function getHorizontalPosition(anchorPosition, calendarDimensions) {
|
|
4806
|
-
var innerWidth = window.innerWidth;
|
|
4807
|
-
var calendarRight = anchorPosition.left + calendarDimensions.width;
|
|
4855
|
+
var formikLatestLevel = formikPath.reduce(function (acc, path) {
|
|
4856
|
+
var _acc$touched, _acc$error, _acc$value;
|
|
4808
4857
|
|
|
4809
|
-
if (innerWidth > calendarRight + BUFFER) {
|
|
4810
4858
|
return {
|
|
4811
|
-
|
|
4859
|
+
touched: (_acc$touched = acc.touched) === null || _acc$touched === void 0 ? void 0 : _acc$touched[path],
|
|
4860
|
+
error: (_acc$error = acc.error) === null || _acc$error === void 0 ? void 0 : _acc$error[path],
|
|
4861
|
+
value: (_acc$value = acc.value) === null || _acc$value === void 0 ? void 0 : _acc$value[path]
|
|
4812
4862
|
};
|
|
4813
|
-
}
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
};
|
|
4818
|
-
|
|
4863
|
+
}, {
|
|
4864
|
+
touched: formik.touched,
|
|
4865
|
+
error: formik.errors,
|
|
4866
|
+
value: formik.values
|
|
4867
|
+
});
|
|
4868
|
+
return {
|
|
4869
|
+
error: formikLatestLevel.touched ? formikLatestLevel.error : undefined,
|
|
4870
|
+
value: formikLatestLevel.value
|
|
4871
|
+
};
|
|
4872
|
+
};
|
|
4873
|
+
var getFormikArrayPath = function getFormikArrayPath(name) {
|
|
4874
|
+
return name.split(/[^a-zA-Z0-9]/).filter(Boolean);
|
|
4875
|
+
};
|
|
4819
4876
|
|
|
4820
|
-
var
|
|
4821
|
-
var
|
|
4822
|
-
|
|
4877
|
+
var useFieldControllers = function useFieldControllers(_ref) {
|
|
4878
|
+
var name = _ref.name,
|
|
4879
|
+
inputId = _ref.id,
|
|
4880
|
+
value = _ref.value,
|
|
4881
|
+
_onChange = _ref.onChange,
|
|
4882
|
+
_onBlur = _ref.onBlur,
|
|
4883
|
+
_onFocus = _ref.onFocus,
|
|
4884
|
+
_onKeyDown = _ref.onKeyDown,
|
|
4885
|
+
error = _ref.error,
|
|
4886
|
+
_ref$type = _ref.type,
|
|
4887
|
+
type = _ref$type === void 0 ? 'text' : _ref$type;
|
|
4823
4888
|
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
return {
|
|
4827
|
-
top: anchorPosition.bottom + PADDING
|
|
4828
|
-
};
|
|
4829
|
-
}
|
|
4889
|
+
var _useFormContext = useFormContext(),
|
|
4890
|
+
formik = _useFormContext.formik;
|
|
4830
4891
|
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
}
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4892
|
+
var id = useFieldId({
|
|
4893
|
+
name: name,
|
|
4894
|
+
id: inputId
|
|
4895
|
+
});
|
|
4896
|
+
var controllers = {
|
|
4897
|
+
id: id,
|
|
4898
|
+
error: error,
|
|
4899
|
+
value: value,
|
|
4900
|
+
onChange: function onChange(e) {
|
|
4901
|
+
return _onChange && _onChange(e.target.value);
|
|
4902
|
+
},
|
|
4903
|
+
onBlur: function onBlur(e) {
|
|
4904
|
+
return _onBlur && _onBlur(e.target.value);
|
|
4905
|
+
},
|
|
4906
|
+
onFocus: function onFocus(e) {
|
|
4907
|
+
return _onFocus && _onFocus(e.target.value);
|
|
4908
|
+
},
|
|
4909
|
+
onKeyDown: function onKeyDown(e) {
|
|
4910
|
+
return _onKeyDown && _onKeyDown(e.key);
|
|
4839
4911
|
}
|
|
4912
|
+
};
|
|
4913
|
+
var formikState = getFormikState(name, formik);
|
|
4840
4914
|
|
|
4841
|
-
|
|
4842
|
-
|
|
4915
|
+
if (formik && formikState) {
|
|
4916
|
+
var currencyBlur = function currencyBlur() {
|
|
4917
|
+
if (type === 'currency') {
|
|
4918
|
+
formik.setFieldValue(name, Number(value).toFixed(2));
|
|
4919
|
+
}
|
|
4843
4920
|
};
|
|
4921
|
+
|
|
4922
|
+
controllers = _extends({}, controllers, {
|
|
4923
|
+
error: error !== undefined ? controllers.error : formikState.error,
|
|
4924
|
+
value: value !== undefined ? controllers.value : formikState.value,
|
|
4925
|
+
onChange: _onChange ? controllers.onChange : function (e) {
|
|
4926
|
+
return formik.setFieldValue(name, e.target.value);
|
|
4927
|
+
},
|
|
4928
|
+
onBlur: _onBlur ? function (e) {
|
|
4929
|
+
_onBlur && _onBlur(e.target.value);
|
|
4930
|
+
formik.setFieldTouched(name);
|
|
4931
|
+
currencyBlur();
|
|
4932
|
+
} : function () {
|
|
4933
|
+
formik.setFieldTouched(name);
|
|
4934
|
+
currencyBlur();
|
|
4935
|
+
}
|
|
4936
|
+
});
|
|
4844
4937
|
}
|
|
4938
|
+
|
|
4939
|
+
return controllers;
|
|
4845
4940
|
};
|
|
4846
4941
|
|
|
4847
|
-
var
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4942
|
+
var textFieldStyles = {"text-field":"_20YOA","text-field--invalid":"_3kUSh","text-field--prefixed":"_3IU3Q","text-field--suffixed":"_QXJOD"};
|
|
4943
|
+
|
|
4944
|
+
var useTextField = function useTextField(_ref) {
|
|
4945
|
+
var _classnames;
|
|
4946
|
+
|
|
4947
|
+
var autoComplete = _ref.autoComplete,
|
|
4948
|
+
autoFocus = _ref.autoFocus,
|
|
4949
|
+
defaultValue = _ref.defaultValue,
|
|
4950
|
+
disabled = _ref.disabled,
|
|
4951
|
+
error = _ref.error,
|
|
4952
|
+
id = _ref.id,
|
|
4953
|
+
maxLength = _ref.maxLength,
|
|
4954
|
+
name = _ref.name,
|
|
4955
|
+
caption = _ref.caption,
|
|
4956
|
+
label = _ref.label,
|
|
4957
|
+
onBlur = _ref.onBlur,
|
|
4958
|
+
onChange = _ref.onChange,
|
|
4959
|
+
onFocus = _ref.onFocus,
|
|
4960
|
+
onKeyDown = _ref.onKeyDown,
|
|
4961
|
+
placeholder = _ref.placeholder,
|
|
4962
|
+
value = _ref.value,
|
|
4963
|
+
ref = _ref.ref,
|
|
4964
|
+
testId = _ref.testId;
|
|
4965
|
+
var controllers = useFieldControllers({
|
|
4966
|
+
error: error,
|
|
4967
|
+
id: id,
|
|
4968
|
+
name: name,
|
|
4969
|
+
onChange: onChange,
|
|
4970
|
+
onBlur: onBlur,
|
|
4971
|
+
onFocus: onFocus,
|
|
4972
|
+
onKeyDown: onKeyDown,
|
|
4973
|
+
value: value
|
|
4974
|
+
});
|
|
4975
|
+
var hasError = !!controllers.error;
|
|
4976
|
+
var inputProps = {
|
|
4977
|
+
'aria-describedby': hasError ? controllers.id + "-error-message" : controllers.id + "-describer",
|
|
4978
|
+
'aria-invalid': hasError,
|
|
4979
|
+
autoComplete: autoComplete,
|
|
4980
|
+
autoFocus: autoFocus,
|
|
4981
|
+
className: classnames(textFieldStyles['text-field'], (_classnames = {}, _classnames[textFieldStyles['text-field--invalid']] = hasError, _classnames)),
|
|
4982
|
+
'data-testid': testId,
|
|
4983
|
+
disabled: disabled,
|
|
4984
|
+
defaultValue: defaultValue,
|
|
4985
|
+
id: controllers.id,
|
|
4986
|
+
maxLength: maxLength,
|
|
4987
|
+
name: name,
|
|
4988
|
+
onBlur: controllers.onBlur,
|
|
4989
|
+
onChange: controllers.onChange,
|
|
4990
|
+
onFocus: controllers.onFocus,
|
|
4991
|
+
onKeyDown: controllers.onKeyDown,
|
|
4992
|
+
placeholder: placeholder,
|
|
4993
|
+
ref: ref,
|
|
4994
|
+
size: 1,
|
|
4995
|
+
type: 'text',
|
|
4996
|
+
value: controllers.value
|
|
4997
|
+
};
|
|
4998
|
+
var fieldProps = {
|
|
4999
|
+
caption: caption,
|
|
5000
|
+
error: controllers.error,
|
|
5001
|
+
label: label,
|
|
5002
|
+
id: inputProps.id,
|
|
5003
|
+
name: name
|
|
5004
|
+
};
|
|
5005
|
+
return {
|
|
5006
|
+
inputProps: inputProps,
|
|
5007
|
+
fieldProps: fieldProps
|
|
5008
|
+
};
|
|
5009
|
+
};
|
|
5010
|
+
|
|
5011
|
+
var styles$k = {"affix-container":"_ybKOk","affix-container--prefixed":"_2COk3","affix-container--suffixed":"_1xXXN","prefix":"_eX5OL","suffix":"__YH01"};
|
|
5012
|
+
|
|
5013
|
+
var AffixContainer = function AffixContainer(_ref) {
|
|
5014
|
+
var _classnames;
|
|
5015
|
+
|
|
5016
|
+
var prefix = _ref.prefix,
|
|
5017
|
+
suffix = _ref.suffix,
|
|
5018
|
+
children = _ref.children,
|
|
4859
5019
|
testId = _ref.testId;
|
|
5020
|
+
var container = React.useRef(null);
|
|
5021
|
+
var prefixElement = React.useRef(null);
|
|
5022
|
+
var suffixElement = React.useRef(null);
|
|
5023
|
+
var isHidden = container.current && container.current.offsetParent === null;
|
|
5024
|
+
React.useLayoutEffect(function () {
|
|
5025
|
+
if (container.current) {
|
|
5026
|
+
var input = container.current.querySelector('input, [class$=control] > div');
|
|
4860
5027
|
|
|
4861
|
-
|
|
4862
|
-
|
|
4863
|
-
|
|
5028
|
+
if (input) {
|
|
5029
|
+
if (prefix && prefixElement.current) {
|
|
5030
|
+
var _prefixElement$curren;
|
|
4864
5031
|
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
current: calendarRef
|
|
4869
|
-
}, function (event) {
|
|
4870
|
-
var _anchorRef$current;
|
|
5032
|
+
var prefixWidth = prefixElement === null || prefixElement === void 0 ? void 0 : (_prefixElement$curren = prefixElement.current) === null || _prefixElement$curren === void 0 ? void 0 : _prefixElement$curren.offsetWidth;
|
|
5033
|
+
input.style.paddingLeft = prefixWidth + 'px';
|
|
5034
|
+
}
|
|
4871
5035
|
|
|
4872
|
-
|
|
4873
|
-
|
|
5036
|
+
if (suffix && suffixElement.current) {
|
|
5037
|
+
var suffixWidth = suffixElement.current.offsetWidth;
|
|
5038
|
+
input.style.paddingRight = suffixWidth + 'px';
|
|
5039
|
+
}
|
|
5040
|
+
}
|
|
4874
5041
|
}
|
|
4875
|
-
});
|
|
4876
|
-
var
|
|
4877
|
-
var
|
|
4878
|
-
from: weekRange.start,
|
|
4879
|
-
to: weekRange.end
|
|
4880
|
-
};
|
|
5042
|
+
}, [prefix, suffix, isHidden]);
|
|
5043
|
+
var hasPrefix = !!prefix;
|
|
5044
|
+
var hasSuffix = !!suffix;
|
|
4881
5045
|
|
|
4882
|
-
|
|
4883
|
-
|
|
5046
|
+
if (!hasPrefix && !hasSuffix) {
|
|
5047
|
+
return children;
|
|
5048
|
+
}
|
|
4884
5049
|
|
|
4885
|
-
|
|
4886
|
-
|
|
5050
|
+
var classes = classnames(styles$k['affix-container'], (_classnames = {}, _classnames[styles$k['affix-container--prefixed']] = hasPrefix, _classnames[styles$k['affix-container--suffixed']] = hasSuffix, _classnames));
|
|
5051
|
+
return React__default.createElement("div", {
|
|
5052
|
+
className: classes,
|
|
5053
|
+
ref: container,
|
|
5054
|
+
"data-testid": testId
|
|
5055
|
+
}, hasPrefix && React__default.createElement("div", {
|
|
5056
|
+
className: styles$k['prefix'],
|
|
5057
|
+
ref: prefixElement
|
|
5058
|
+
}, prefix), children, hasSuffix && React__default.createElement("div", {
|
|
5059
|
+
className: styles$k['suffix'],
|
|
5060
|
+
ref: suffixElement
|
|
5061
|
+
}, suffix));
|
|
5062
|
+
};
|
|
5063
|
+
|
|
5064
|
+
var TimeFieldInput = function TimeFieldInput(_ref) {
|
|
5065
|
+
var inputProps = _ref.inputProps,
|
|
5066
|
+
allOtherProps = _ref.allOtherProps,
|
|
5067
|
+
prefix = _ref.prefix,
|
|
5068
|
+
duration = _ref.duration;
|
|
5069
|
+
return React__default.createElement(AffixContainer, {
|
|
5070
|
+
prefix: prefix ? prefix : React__default.createElement(IconClock, {
|
|
5071
|
+
size: "medium",
|
|
5072
|
+
color: "grey-400"
|
|
5073
|
+
}),
|
|
5074
|
+
suffix: duration
|
|
5075
|
+
}, React__default.createElement("input", Object.assign({}, inputProps, {
|
|
5076
|
+
onBlur: function onBlur(e) {
|
|
5077
|
+
e.target.value = parseTime(e.target.value, 'g:i A');
|
|
5078
|
+
inputProps.onChange(e);
|
|
5079
|
+
inputProps.onBlur(e);
|
|
5080
|
+
},
|
|
5081
|
+
onClick: allOtherProps.onClick,
|
|
5082
|
+
onMouseEnter: allOtherProps.onMouseEnter,
|
|
5083
|
+
onMouseLeave: allOtherProps.onMouseLeave,
|
|
5084
|
+
onInput: function onInput(e) {
|
|
5085
|
+
var target = e.target;
|
|
5086
|
+
allOtherProps.onInputChange(target.value);
|
|
5087
|
+
}
|
|
5088
|
+
})));
|
|
5089
|
+
};
|
|
5090
|
+
|
|
5091
|
+
var _excluded$2g = ["placeholder", "autoComplete", "selectedTimeOption", "prefix", "startTime", "duration"];
|
|
5092
|
+
|
|
5093
|
+
var TimeFieldDropdownElement = function TimeFieldDropdownElement(_ref, ref) {
|
|
5094
|
+
var _ref$placeholder = _ref.placeholder,
|
|
5095
|
+
placeholder = _ref$placeholder === void 0 ? '9:00 AM' : _ref$placeholder,
|
|
5096
|
+
_ref$autoComplete = _ref.autoComplete,
|
|
5097
|
+
autoComplete = _ref$autoComplete === void 0 ? 'off' : _ref$autoComplete,
|
|
5098
|
+
selectedTimeOption = _ref.selectedTimeOption,
|
|
5099
|
+
prefix = _ref.prefix,
|
|
5100
|
+
duration = _ref.duration,
|
|
5101
|
+
allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2g);
|
|
5102
|
+
|
|
5103
|
+
var _useTextField = useTextField(_extends({}, allOtherProps, {
|
|
5104
|
+
placeholder: placeholder,
|
|
5105
|
+
autoComplete: autoComplete,
|
|
5106
|
+
ref: ref
|
|
5107
|
+
})),
|
|
5108
|
+
inputProps = _useTextField.inputProps,
|
|
5109
|
+
fieldProps = _useTextField.fieldProps;
|
|
5110
|
+
|
|
5111
|
+
React.useEffect(function () {
|
|
5112
|
+
if (selectedTimeOption) {
|
|
5113
|
+
inputProps.onChange({
|
|
5114
|
+
target: {
|
|
5115
|
+
value: selectedTimeOption
|
|
5116
|
+
}
|
|
5117
|
+
});
|
|
5118
|
+
}
|
|
5119
|
+
}, [selectedTimeOption]);
|
|
5120
|
+
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement(TimeFieldInput, {
|
|
5121
|
+
inputProps: inputProps,
|
|
5122
|
+
allOtherProps: allOtherProps,
|
|
5123
|
+
prefix: prefix,
|
|
5124
|
+
duration: duration
|
|
5125
|
+
}));
|
|
5126
|
+
};
|
|
5127
|
+
|
|
5128
|
+
var TimeFieldDropdownTrigger = React.forwardRef(TimeFieldDropdownElement);
|
|
5129
|
+
|
|
5130
|
+
var Dropdown = function Dropdown(_ref) {
|
|
5131
|
+
var trigger = _ref.trigger,
|
|
5132
|
+
_ref$triggersOn = _ref.triggersOn,
|
|
5133
|
+
triggersOn = _ref$triggersOn === void 0 ? DROPDOWN_TRIGGER.CLICK : _ref$triggersOn,
|
|
5134
|
+
_ref$alignment = _ref.alignment,
|
|
5135
|
+
alignment = _ref$alignment === void 0 ? DROPDOWN_ALIGNEMNT.RIGHT : _ref$alignment,
|
|
5136
|
+
width = _ref.width,
|
|
5137
|
+
maxHeight = _ref.maxHeight,
|
|
5138
|
+
testId = _ref.testId,
|
|
5139
|
+
children = _ref.children,
|
|
5140
|
+
triggerWidth = _ref.triggerWidth;
|
|
5141
|
+
|
|
5142
|
+
var _useState = React.useState(false),
|
|
5143
|
+
isOpen = _useState[0],
|
|
5144
|
+
setIsOpen = _useState[1];
|
|
5145
|
+
|
|
5146
|
+
var triggerRef = React.useRef(null);
|
|
5147
|
+
var paneRef = React.useRef(null);
|
|
5148
|
+
var isFocusingOverlay = React.useRef(false);
|
|
5149
|
+
|
|
5150
|
+
var handleToggleDropdown = function handleToggleDropdown() {
|
|
5151
|
+
return setIsOpen(!isOpen);
|
|
5152
|
+
};
|
|
5153
|
+
|
|
5154
|
+
var handleMouseClick = function handleMouseClick(e) {
|
|
5155
|
+
if (trigger.type === TimeFieldDropdownTrigger) {
|
|
5156
|
+
setIsOpen(true);
|
|
4887
5157
|
} else {
|
|
4888
|
-
|
|
5158
|
+
handleToggleDropdown();
|
|
5159
|
+
}
|
|
4889
5160
|
|
|
4890
|
-
|
|
5161
|
+
e.stopPropagation();
|
|
5162
|
+
|
|
5163
|
+
if ('onClick' in trigger.props) {
|
|
5164
|
+
trigger.props.onClick(e);
|
|
4891
5165
|
}
|
|
5166
|
+
};
|
|
4892
5167
|
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
5168
|
+
var handleMouseEnter = function handleMouseEnter(e) {
|
|
5169
|
+
if (triggersOn !== 'hover') {
|
|
5170
|
+
return;
|
|
5171
|
+
}
|
|
5172
|
+
|
|
5173
|
+
setIsOpen(true);
|
|
5174
|
+
|
|
5175
|
+
if ('onMouseEnter' in trigger.props) {
|
|
5176
|
+
trigger.props.onMouseEnter(e);
|
|
5177
|
+
}
|
|
4896
5178
|
};
|
|
4897
5179
|
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
5180
|
+
var handleFocus = function handleFocus(e) {
|
|
5181
|
+
if (triggersOn !== 'hover') {
|
|
5182
|
+
if (trigger.type === TimeFieldDropdownTrigger && !isOpen) {
|
|
5183
|
+
setIsOpen(true);
|
|
5184
|
+
}
|
|
4901
5185
|
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
}
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
5186
|
+
if ('onFocus' in trigger.props) {
|
|
5187
|
+
trigger.props.onFocus(e);
|
|
5188
|
+
}
|
|
5189
|
+
|
|
5190
|
+
return;
|
|
5191
|
+
}
|
|
5192
|
+
|
|
5193
|
+
setIsOpen(true);
|
|
5194
|
+
|
|
5195
|
+
if ('onFocus' in trigger.props) {
|
|
5196
|
+
trigger.props.onFocus(e);
|
|
5197
|
+
}
|
|
5198
|
+
};
|
|
5199
|
+
|
|
5200
|
+
var handleMouseLeave = function handleMouseLeave(e) {
|
|
5201
|
+
if (triggersOn !== 'hover' || !paneRef.current) {
|
|
5202
|
+
return;
|
|
5203
|
+
}
|
|
5204
|
+
|
|
5205
|
+
var panePosition = paneRef.current.getBoundingClientRect();
|
|
5206
|
+
|
|
5207
|
+
if (!isGoingTowardsPane(panePosition, e.clientY)) {
|
|
5208
|
+
setIsOpen(false);
|
|
5209
|
+
|
|
5210
|
+
if ('onMouseLeave' in trigger.props) {
|
|
5211
|
+
trigger.props.onMouseLeave && trigger.props.onMouseLeave(e);
|
|
5212
|
+
}
|
|
5213
|
+
}
|
|
5214
|
+
};
|
|
5215
|
+
|
|
5216
|
+
var handlePaneMouseEnter = function handlePaneMouseEnter() {
|
|
5217
|
+
isFocusingOverlay.current = true;
|
|
5218
|
+
};
|
|
5219
|
+
|
|
5220
|
+
var handlePaneMouseLeave = function handlePaneMouseLeave() {
|
|
5221
|
+
isFocusingOverlay.current = false;
|
|
5222
|
+
|
|
5223
|
+
if (triggersOn === 'hover') {
|
|
5224
|
+
setIsOpen(false);
|
|
5225
|
+
}
|
|
5226
|
+
};
|
|
5227
|
+
|
|
5228
|
+
var handleOnBlur = function handleOnBlur(e) {
|
|
5229
|
+
trigger.props.onBlur && trigger.props.onBlur(e);
|
|
5230
|
+
|
|
5231
|
+
if (!paneRef || !(paneRef !== null && paneRef !== void 0 && paneRef.current)) {
|
|
5232
|
+
return;
|
|
5233
|
+
}
|
|
5234
|
+
|
|
5235
|
+
var focusableElements = getKeyboardFocusableElements(paneRef.current);
|
|
4922
5236
|
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
5237
|
+
if (focusableElements.length > 0) {
|
|
5238
|
+
window.setTimeout(function () {
|
|
5239
|
+
return focusableElements[0].focus();
|
|
5240
|
+
}, 0);
|
|
5241
|
+
} else {
|
|
5242
|
+
setIsOpen(false);
|
|
5243
|
+
}
|
|
5244
|
+
};
|
|
5245
|
+
|
|
5246
|
+
var getRef = function getRef() {
|
|
5247
|
+
if ((trigger.type === Button$1 || trigger.type === TimeFieldDropdownTrigger) && trigger.ref) {
|
|
5248
|
+
return trigger.ref;
|
|
5249
|
+
}
|
|
5250
|
+
|
|
5251
|
+
return triggerRef;
|
|
5252
|
+
};
|
|
5253
|
+
|
|
5254
|
+
var updatedRef = getRef();
|
|
5255
|
+
var triggerProps = {
|
|
5256
|
+
onClick: handleMouseClick,
|
|
5257
|
+
onMouseEnter: handleMouseEnter,
|
|
5258
|
+
onMouseLeave: handleMouseLeave,
|
|
5259
|
+
onBlur: handleOnBlur,
|
|
5260
|
+
ref: updatedRef,
|
|
5261
|
+
style: {
|
|
5262
|
+
width: triggerWidth === 'full' ? '100%' : 'fit-content'
|
|
4926
5263
|
},
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
5264
|
+
onFocus: handleFocus
|
|
5265
|
+
};
|
|
5266
|
+
return React__default.createElement(DropdownContext.Provider, {
|
|
5267
|
+
value: {
|
|
5268
|
+
isOpen: isOpen,
|
|
5269
|
+
onToggleDropdown: handleToggleDropdown,
|
|
5270
|
+
triggerRef: updatedRef,
|
|
5271
|
+
paneRef: paneRef
|
|
5272
|
+
}
|
|
5273
|
+
}, trigger.type === Button$1 || trigger.type === TimeFieldDropdownTrigger ? React__default.cloneElement(trigger, _extends({}, trigger.props, triggerProps)) : React__default.createElement("button", Object.assign({}, triggerProps, {
|
|
5274
|
+
className: styles$g['dropdown__trigger'],
|
|
5275
|
+
ref: updatedRef,
|
|
5276
|
+
onFocus: handleFocus
|
|
5277
|
+
}), trigger), React__default.createElement(DropdownPane, {
|
|
5278
|
+
width: width,
|
|
5279
|
+
maxHeight: maxHeight,
|
|
5280
|
+
onMouseEnter: handlePaneMouseEnter,
|
|
5281
|
+
onMouseLeave: handlePaneMouseLeave,
|
|
5282
|
+
alignment: alignment,
|
|
5283
|
+
testId: testId
|
|
5284
|
+
}, children));
|
|
4938
5285
|
};
|
|
4939
5286
|
|
|
4940
|
-
var styles$
|
|
5287
|
+
var styles$l = {"dropdown-list":"_1v1df","dropdown-list__item--hover":"_eAjpa"};
|
|
4941
5288
|
|
|
4942
5289
|
var findNextActiveIndex = function findNextActiveIndex(items, startAt) {
|
|
4943
5290
|
var startIndex = 0;
|
|
@@ -5047,17 +5394,17 @@ var useListKeyboardNavigation = function useListKeyboardNavigation(listItems, ac
|
|
|
5047
5394
|
};
|
|
5048
5395
|
};
|
|
5049
5396
|
|
|
5050
|
-
var styles$
|
|
5397
|
+
var styles$m = {"dropdown-list-divider":"_3x1F6"};
|
|
5051
5398
|
|
|
5052
5399
|
var DropdownListDivider = function DropdownListDivider(_ref) {
|
|
5053
5400
|
var testId = _ref.testId;
|
|
5054
5401
|
return React__default.createElement("div", {
|
|
5055
|
-
className: styles$
|
|
5402
|
+
className: styles$m['dropdown-list-divider'],
|
|
5056
5403
|
"data-testid": testId
|
|
5057
5404
|
});
|
|
5058
5405
|
};
|
|
5059
5406
|
|
|
5060
|
-
var styles$
|
|
5407
|
+
var styles$n = {"dropdown-list-item":"_B3_I5","dropdown-list-item--selected":"_1mr1h","dropdown-list-item__content":"_2b7Fg","dropdown-list-item--disabled":"_2l0Cb"};
|
|
5061
5408
|
|
|
5062
5409
|
var TEXT_TYPES = {
|
|
5063
5410
|
CAPTION: 'caption',
|
|
@@ -5082,9 +5429,9 @@ var ALIGNMENTS = {
|
|
|
5082
5429
|
JUSTIFY: 'justify'
|
|
5083
5430
|
};
|
|
5084
5431
|
|
|
5085
|
-
var styles$
|
|
5432
|
+
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"};
|
|
5086
5433
|
|
|
5087
|
-
var _excluded$
|
|
5434
|
+
var _excluded$2h = ["children", "as", "emphasis", "alignment", "color", "testId"];
|
|
5088
5435
|
|
|
5089
5436
|
var Text = function Text(_ref) {
|
|
5090
5437
|
var _classnames;
|
|
@@ -5096,14 +5443,14 @@ var Text = function Text(_ref) {
|
|
|
5096
5443
|
alignment = _ref.alignment,
|
|
5097
5444
|
color = _ref.color,
|
|
5098
5445
|
testId = _ref.testId,
|
|
5099
|
-
positionProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
5446
|
+
positionProps = _objectWithoutPropertiesLoose(_ref, _excluded$2h);
|
|
5100
5447
|
|
|
5101
5448
|
var positionStyles = usePositionStyles(positionProps);
|
|
5102
5449
|
var elementProps = {
|
|
5103
5450
|
style: _extends({
|
|
5104
|
-
color: color
|
|
5451
|
+
color: getColor(color)
|
|
5105
5452
|
}, positionStyles),
|
|
5106
|
-
className: classnames(styles$
|
|
5453
|
+
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)),
|
|
5107
5454
|
'data-testid': testId
|
|
5108
5455
|
};
|
|
5109
5456
|
var pTypes = [TEXT_TYPES.BODY, TEXT_TYPES.CAPTION, TEXT_TYPES.INSIGHT];
|
|
@@ -5114,37 +5461,24 @@ var Text = function Text(_ref) {
|
|
|
5114
5461
|
var Bold = function Bold(_ref) {
|
|
5115
5462
|
var children = _ref.children;
|
|
5116
5463
|
return React__default.createElement("span", {
|
|
5117
|
-
className: classnames(styles$
|
|
5464
|
+
className: classnames(styles$o['text--bold'], styles$o['text'])
|
|
5118
5465
|
}, children);
|
|
5119
5466
|
};
|
|
5120
5467
|
|
|
5121
5468
|
var Underline = function Underline(_ref) {
|
|
5122
5469
|
var children = _ref.children;
|
|
5123
5470
|
return React__default.createElement("span", {
|
|
5124
|
-
className: classnames(styles$
|
|
5471
|
+
className: classnames(styles$o['text--underline'], styles$o['text'])
|
|
5125
5472
|
}, children);
|
|
5126
5473
|
};
|
|
5127
5474
|
|
|
5128
5475
|
var Italic = function Italic(_ref) {
|
|
5129
5476
|
var children = _ref.children;
|
|
5130
5477
|
return React__default.createElement("span", {
|
|
5131
|
-
className: classnames(styles$
|
|
5478
|
+
className: classnames(styles$o['text--italic'], styles$o['text'])
|
|
5132
5479
|
}, children);
|
|
5133
5480
|
};
|
|
5134
5481
|
|
|
5135
|
-
var WHITE = '#ffffff';
|
|
5136
|
-
var EGGPLANT200 = '#d3dbf4';
|
|
5137
|
-
var EGGPLANT300 = '#a7b7ea';
|
|
5138
|
-
var EGGPLANT400 = '#6d87dd';
|
|
5139
|
-
var EGGPLANT500 = '#6179c6';
|
|
5140
|
-
var EGGPLANT600 = '#415184';
|
|
5141
|
-
var RADISH400 = '#e76767';
|
|
5142
|
-
var GREY100 = '#F3F3F3';
|
|
5143
|
-
var GREY200 = '#D5D5D5';
|
|
5144
|
-
var GREY300 = '#949494';
|
|
5145
|
-
var GREY400 = '#767676';
|
|
5146
|
-
var GREY500 = '#464646';
|
|
5147
|
-
|
|
5148
5482
|
var DropdownListItem = function DropdownListItem(_ref) {
|
|
5149
5483
|
var _classNames;
|
|
5150
5484
|
|
|
@@ -5173,18 +5507,18 @@ var DropdownListItem = function DropdownListItem(_ref) {
|
|
|
5173
5507
|
|
|
5174
5508
|
var getCaptionColor = function getCaptionColor() {
|
|
5175
5509
|
if (selected) {
|
|
5176
|
-
return
|
|
5510
|
+
return 'eggplant-500';
|
|
5177
5511
|
}
|
|
5178
5512
|
|
|
5179
5513
|
if (disabled) {
|
|
5180
|
-
return
|
|
5514
|
+
return 'grey-400';
|
|
5181
5515
|
}
|
|
5182
5516
|
|
|
5183
5517
|
return undefined;
|
|
5184
5518
|
};
|
|
5185
5519
|
|
|
5186
5520
|
return React__default.createElement("li", {
|
|
5187
|
-
className: classnames(styles$
|
|
5521
|
+
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)),
|
|
5188
5522
|
onMouseDown: function onMouseDown(e) {
|
|
5189
5523
|
return e.preventDefault();
|
|
5190
5524
|
},
|
|
@@ -5193,7 +5527,7 @@ var DropdownListItem = function DropdownListItem(_ref) {
|
|
|
5193
5527
|
role: "menuitem",
|
|
5194
5528
|
"data-testid": testId
|
|
5195
5529
|
}, prefix, React__default.createElement("div", {
|
|
5196
|
-
className: styles$
|
|
5530
|
+
className: styles$n['dropdown-list-item__content']
|
|
5197
5531
|
}, React__default.createElement(Stack, {
|
|
5198
5532
|
space: 4,
|
|
5199
5533
|
flex: [1]
|
|
@@ -5285,7 +5619,7 @@ var DropdownList = function DropdownList(_ref) {
|
|
|
5285
5619
|
}
|
|
5286
5620
|
}, [highlightItemIndex]);
|
|
5287
5621
|
return React__default.createElement("ul", {
|
|
5288
|
-
className: styles$
|
|
5622
|
+
className: styles$l['dropdown-list'],
|
|
5289
5623
|
"data-testid": testId,
|
|
5290
5624
|
ref: listRef
|
|
5291
5625
|
}, React__default.Children.map(children, function (child, index) {
|
|
@@ -5293,7 +5627,7 @@ var DropdownList = function DropdownList(_ref) {
|
|
|
5293
5627
|
|
|
5294
5628
|
return React__default.createElement("div", {
|
|
5295
5629
|
key: index,
|
|
5296
|
-
className: classnames(styles$
|
|
5630
|
+
className: classnames(styles$l['dropdown-list__item'], (_classNames = {}, _classNames[styles$l['dropdown-list__item--hover']] = focusedItem === index, _classNames)),
|
|
5297
5631
|
onMouseEnter: function onMouseEnter() {
|
|
5298
5632
|
return setFocusOnItem(index);
|
|
5299
5633
|
}
|
|
@@ -5301,537 +5635,438 @@ var DropdownList = function DropdownList(_ref) {
|
|
|
5301
5635
|
}));
|
|
5302
5636
|
};
|
|
5303
5637
|
|
|
5304
|
-
var
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
var isHidden = labelElement && labelElement.offsetParent === null;
|
|
5318
|
-
var handleApplyTooltip = React.useCallback(function () {
|
|
5319
|
-
if (!shouldTruncate) {
|
|
5320
|
-
return;
|
|
5321
|
-
}
|
|
5322
|
-
|
|
5323
|
-
var labelElement = document.getElementById(labelId);
|
|
5324
|
-
|
|
5325
|
-
if (!labelElement) {
|
|
5326
|
-
return;
|
|
5327
|
-
}
|
|
5328
|
-
|
|
5329
|
-
var shouldShowTooltip = isEllipsisActive(labelElement);
|
|
5330
|
-
|
|
5331
|
-
if (showTooltip !== shouldShowTooltip) {
|
|
5332
|
-
setShowTooltip(shouldShowTooltip);
|
|
5333
|
-
}
|
|
5334
|
-
}, [shouldTruncate, isHidden]);
|
|
5335
|
-
React.useEffect(function () {
|
|
5336
|
-
var onWindowResize = lodashEs.debounce(handleApplyTooltip, 300);
|
|
5337
|
-
window.addEventListener('resize', onWindowResize);
|
|
5338
|
-
return function () {
|
|
5339
|
-
return window.removeEventListener('resize', onWindowResize);
|
|
5340
|
-
};
|
|
5341
|
-
}, [handleApplyTooltip]);
|
|
5342
|
-
React.useLayoutEffect(handleApplyTooltip, [handleApplyTooltip]);
|
|
5343
|
-
return {
|
|
5344
|
-
showTooltip: showTooltip,
|
|
5345
|
-
shouldTruncate: shouldTruncate
|
|
5346
|
-
};
|
|
5638
|
+
var KebabMenu = function KebabMenu(_ref) {
|
|
5639
|
+
var actions = _ref.actions;
|
|
5640
|
+
return React__default.createElement(Dropdown, {
|
|
5641
|
+
trigger: React__default.createElement(Button$1, {
|
|
5642
|
+
theme: "link-icon"
|
|
5643
|
+
}, React__default.createElement(IconEllipsisV, null)),
|
|
5644
|
+
alignment: "right"
|
|
5645
|
+
}, React__default.createElement(DropdownList, null, actions.map(function (action) {
|
|
5646
|
+
return !action.hidden && React__default.createElement(DropdownListItem, {
|
|
5647
|
+
onClick: action.onAction,
|
|
5648
|
+
key: action.action
|
|
5649
|
+
}, action.label);
|
|
5650
|
+
})));
|
|
5347
5651
|
};
|
|
5348
5652
|
|
|
5349
|
-
var
|
|
5350
|
-
var _classNames;
|
|
5653
|
+
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"};
|
|
5351
5654
|
|
|
5352
|
-
|
|
5353
|
-
children = _ref.children,
|
|
5354
|
-
_ref$truncate = _ref.truncate,
|
|
5355
|
-
truncate = _ref$truncate === void 0 ? true : _ref$truncate;
|
|
5356
|
-
var labelId = "label-" + htmlFor;
|
|
5655
|
+
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"};
|
|
5357
5656
|
|
|
5358
|
-
|
|
5359
|
-
showTooltip = _useLabelTooltip.showTooltip,
|
|
5360
|
-
shouldTruncate = _useLabelTooltip.shouldTruncate;
|
|
5657
|
+
var styles$r = {"header":"_36nxW","header__close-button":"_2zYre","sub-header":"_2XwRD"};
|
|
5361
5658
|
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
5659
|
+
var ModalHeader = function ModalHeader(_ref) {
|
|
5660
|
+
var header = _ref.header,
|
|
5661
|
+
subHeader = _ref.subHeader,
|
|
5662
|
+
onClose = _ref.onClose,
|
|
5663
|
+
loading = _ref.loading;
|
|
5367
5664
|
|
|
5368
|
-
if (
|
|
5369
|
-
return React__default.createElement(
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5665
|
+
if (!header && !subHeader) {
|
|
5666
|
+
return onClose ? React__default.createElement("div", {
|
|
5667
|
+
className: styles$r['header__close-button']
|
|
5668
|
+
}, React__default.createElement(Button$1, {
|
|
5669
|
+
theme: "link-icon",
|
|
5670
|
+
onClick: onClose,
|
|
5671
|
+
disabled: loading
|
|
5672
|
+
}, React__default.createElement(IconTimes, null))) : null;
|
|
5373
5673
|
}
|
|
5374
5674
|
|
|
5375
|
-
return
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
var styles$o = {"caption":"_1DWBq"};
|
|
5379
|
-
|
|
5380
|
-
var Caption = function Caption(_ref) {
|
|
5381
|
-
var fieldId = _ref.fieldId,
|
|
5382
|
-
children = _ref.children;
|
|
5383
|
-
return React__default.createElement("div", {
|
|
5384
|
-
id: fieldId && fieldId + "-describer",
|
|
5385
|
-
className: styles$o['caption']
|
|
5386
|
-
}, children);
|
|
5387
|
-
};
|
|
5388
|
-
|
|
5389
|
-
var styles$p = {"error-message":"_nZ2MD"};
|
|
5390
|
-
|
|
5391
|
-
var ErrorMessage = function ErrorMessage(_ref) {
|
|
5392
|
-
var fieldId = _ref.fieldId,
|
|
5393
|
-
children = _ref.children,
|
|
5394
|
-
testId = _ref.testId;
|
|
5395
|
-
return React__default.createElement("div", {
|
|
5396
|
-
id: fieldId && fieldId + "-error-message",
|
|
5397
|
-
className: styles$p['error-message'],
|
|
5398
|
-
"data-testid": testId
|
|
5675
|
+
return React__default.createElement(Stack, {
|
|
5676
|
+
space: 12,
|
|
5677
|
+
marginBottom: 24
|
|
5399
5678
|
}, React__default.createElement(Inline, {
|
|
5400
|
-
|
|
5679
|
+
flex: [1],
|
|
5401
5680
|
alignItems: "center"
|
|
5402
|
-
}, React__default.createElement(
|
|
5403
|
-
|
|
5404
|
-
|
|
5405
|
-
|
|
5681
|
+
}, React__default.createElement("span", {
|
|
5682
|
+
className: styles$r['header']
|
|
5683
|
+
}, header), onClose && React__default.createElement(Button$1, {
|
|
5684
|
+
theme: "link-icon",
|
|
5685
|
+
onClick: onClose,
|
|
5686
|
+
disabled: loading
|
|
5687
|
+
}, React__default.createElement(IconTimes, null))), subHeader && React__default.createElement("div", {
|
|
5688
|
+
className: styles$r['sub-header']
|
|
5689
|
+
}, subHeader));
|
|
5406
5690
|
};
|
|
5407
5691
|
|
|
5408
|
-
var
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
var shouldRenderLabel = label || typeof label === 'string';
|
|
5415
|
-
return React__default.createElement(Stack, {
|
|
5416
|
-
space: 8,
|
|
5417
|
-
flexItems: true
|
|
5418
|
-
}, shouldRenderLabel && React__default.createElement(Label, {
|
|
5419
|
-
htmlFor: id
|
|
5420
|
-
}, label), children, caption && React__default.createElement(Caption, {
|
|
5421
|
-
fieldId: id
|
|
5422
|
-
}, caption), error && React__default.createElement(ErrorMessage, {
|
|
5423
|
-
fieldId: id
|
|
5424
|
-
}, error));
|
|
5692
|
+
var ModalContext = React.createContext({
|
|
5693
|
+
isModalMounted: false
|
|
5694
|
+
});
|
|
5695
|
+
var useModalContext = function useModalContext() {
|
|
5696
|
+
var context = React.useContext(ModalContext);
|
|
5697
|
+
return context || {};
|
|
5425
5698
|
};
|
|
5426
5699
|
|
|
5427
|
-
var
|
|
5428
|
-
var
|
|
5429
|
-
|
|
5430
|
-
|
|
5700
|
+
var Modal = function Modal(_ref) {
|
|
5701
|
+
var children = _ref.children,
|
|
5702
|
+
header = _ref.header,
|
|
5703
|
+
subHeader = _ref.subHeader,
|
|
5704
|
+
onClose = _ref.onClose,
|
|
5705
|
+
loading = _ref.loading,
|
|
5706
|
+
_ref$zIndex = _ref.zIndex,
|
|
5707
|
+
zIndex = _ref$zIndex === void 0 ? Z_INDEX_LAYERS.MODAL : _ref$zIndex,
|
|
5708
|
+
rootElementId = _ref.rootElementId,
|
|
5709
|
+
_ref$width = _ref.width,
|
|
5710
|
+
width = _ref$width === void 0 ? 500 : _ref$width,
|
|
5711
|
+
height = _ref.height,
|
|
5712
|
+
maxWidth = _ref.maxWidth,
|
|
5713
|
+
_ref$shouldReturnFocu = _ref.shouldReturnFocusAfterClose,
|
|
5714
|
+
shouldReturnFocusAfterClose = _ref$shouldReturnFocu === void 0 ? true : _ref$shouldReturnFocu,
|
|
5715
|
+
testId = _ref.testId;
|
|
5716
|
+
var style = {
|
|
5717
|
+
content: {
|
|
5718
|
+
width: width,
|
|
5719
|
+
height: height,
|
|
5720
|
+
maxWidth: maxWidth
|
|
5721
|
+
},
|
|
5722
|
+
overlay: {
|
|
5723
|
+
zIndex: zIndex
|
|
5724
|
+
}
|
|
5725
|
+
};
|
|
5726
|
+
return React__default.createElement(ReactModal, {
|
|
5727
|
+
isOpen: true,
|
|
5728
|
+
testId: testId,
|
|
5729
|
+
shouldCloseOnEsc: true,
|
|
5730
|
+
shouldCloseOnOverlayClick: false,
|
|
5731
|
+
shouldReturnFocusAfterClose: shouldReturnFocusAfterClose,
|
|
5732
|
+
onRequestClose: onClose && !loading ? onClose : undefined,
|
|
5733
|
+
style: style,
|
|
5734
|
+
closeTimeoutMS: 200,
|
|
5735
|
+
contentLabel: "Modal",
|
|
5736
|
+
appElement: rootElementId && document.getElementById(rootElementId) || undefined,
|
|
5737
|
+
overlayClassName: {
|
|
5738
|
+
base: styles$q['overlay'],
|
|
5739
|
+
afterOpen: styles$q['overlay--after-open'],
|
|
5740
|
+
beforeClose: styles$q['overlay--before-close']
|
|
5741
|
+
},
|
|
5742
|
+
className: {
|
|
5743
|
+
base: styles$q['content'],
|
|
5744
|
+
afterOpen: styles$q['content--after-open'],
|
|
5745
|
+
beforeClose: styles$q['content--before-close']
|
|
5746
|
+
}
|
|
5747
|
+
}, React__default.createElement(ModalHeader, {
|
|
5748
|
+
header: header,
|
|
5749
|
+
subHeader: subHeader,
|
|
5750
|
+
onClose: onClose,
|
|
5751
|
+
loading: loading
|
|
5752
|
+
}), React__default.createElement(ModalContext.Provider, {
|
|
5753
|
+
value: {
|
|
5754
|
+
isModalMounted: true
|
|
5755
|
+
}
|
|
5756
|
+
}, children));
|
|
5431
5757
|
};
|
|
5432
5758
|
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
inputId = _ref.id;
|
|
5436
|
-
var id = React.useMemo(function () {
|
|
5437
|
-
return inputId ? inputId : name + "-" + Math.random();
|
|
5438
|
-
}, [inputId, name]);
|
|
5439
|
-
return id;
|
|
5759
|
+
Modal.setAppElement = function (rootElement) {
|
|
5760
|
+
ReactModal.setAppElement(rootElement);
|
|
5440
5761
|
};
|
|
5441
5762
|
|
|
5442
|
-
var
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
}
|
|
5763
|
+
var THRESHOLD = 20;
|
|
5764
|
+
var useScrollShadow = function useScrollShadow() {
|
|
5765
|
+
var ref = React.useRef(null);
|
|
5446
5766
|
|
|
5447
|
-
var
|
|
5767
|
+
var _useState = React.useState(false),
|
|
5768
|
+
showScrollShadow = _useState[0],
|
|
5769
|
+
setShowScrollShadow = _useState[1];
|
|
5448
5770
|
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
|
|
5771
|
+
React.useEffect(function () {
|
|
5772
|
+
if (!ref.current) {
|
|
5773
|
+
return;
|
|
5774
|
+
}
|
|
5452
5775
|
|
|
5453
|
-
|
|
5454
|
-
var _acc$touched, _acc$error, _acc$value;
|
|
5776
|
+
var modalBody = ref.current;
|
|
5455
5777
|
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
};
|
|
5461
|
-
}, {
|
|
5462
|
-
touched: formik.touched,
|
|
5463
|
-
error: formik.errors,
|
|
5464
|
-
value: formik.values
|
|
5465
|
-
});
|
|
5778
|
+
if (modalBody.offsetHeight > THRESHOLD) {
|
|
5779
|
+
setShowScrollShadow(true);
|
|
5780
|
+
}
|
|
5781
|
+
}, []);
|
|
5466
5782
|
return {
|
|
5467
|
-
|
|
5468
|
-
|
|
5783
|
+
ref: ref,
|
|
5784
|
+
showScrollShadow: showScrollShadow
|
|
5469
5785
|
};
|
|
5470
5786
|
};
|
|
5471
|
-
var getFormikArrayPath = function getFormikArrayPath(name) {
|
|
5472
|
-
return name.split(/[^a-zA-Z0-9]/).filter(Boolean);
|
|
5473
|
-
};
|
|
5474
|
-
|
|
5475
|
-
var useFieldControllers = function useFieldControllers(_ref) {
|
|
5476
|
-
var name = _ref.name,
|
|
5477
|
-
inputId = _ref.id,
|
|
5478
|
-
value = _ref.value,
|
|
5479
|
-
_onChange = _ref.onChange,
|
|
5480
|
-
_onBlur = _ref.onBlur,
|
|
5481
|
-
_onFocus = _ref.onFocus,
|
|
5482
|
-
_onKeyDown = _ref.onKeyDown,
|
|
5483
|
-
error = _ref.error,
|
|
5484
|
-
_ref$type = _ref.type,
|
|
5485
|
-
type = _ref$type === void 0 ? 'text' : _ref$type;
|
|
5486
5787
|
|
|
5487
|
-
|
|
5488
|
-
formik = _useFormContext.formik;
|
|
5788
|
+
var styles$s = {"modal-body":"_2J-ku","modal-body--with-scroll-shadow":"_2ErCP"};
|
|
5489
5789
|
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
id: inputId
|
|
5493
|
-
});
|
|
5494
|
-
var controllers = {
|
|
5495
|
-
id: id,
|
|
5496
|
-
error: error,
|
|
5497
|
-
value: value,
|
|
5498
|
-
onChange: function onChange(e) {
|
|
5499
|
-
return _onChange && _onChange(e.target.value);
|
|
5500
|
-
},
|
|
5501
|
-
onBlur: function onBlur(e) {
|
|
5502
|
-
return _onBlur && _onBlur(e.target.value);
|
|
5503
|
-
},
|
|
5504
|
-
onFocus: function onFocus(e) {
|
|
5505
|
-
return _onFocus && _onFocus(e.target.value);
|
|
5506
|
-
},
|
|
5507
|
-
onKeyDown: function onKeyDown(e) {
|
|
5508
|
-
return _onKeyDown && _onKeyDown(e.key);
|
|
5509
|
-
}
|
|
5510
|
-
};
|
|
5511
|
-
var formikState = getFormikState(name, formik);
|
|
5790
|
+
var ModalBody = function ModalBody(_ref) {
|
|
5791
|
+
var _classNames;
|
|
5512
5792
|
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
if (type === 'currency') {
|
|
5516
|
-
formik.setFieldValue(name, Number(value).toFixed(2));
|
|
5517
|
-
}
|
|
5518
|
-
};
|
|
5793
|
+
var children = _ref.children,
|
|
5794
|
+
testId = _ref.testId;
|
|
5519
5795
|
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
onChange: _onChange ? controllers.onChange : function (e) {
|
|
5524
|
-
return formik.setFieldValue(name, e.target.value);
|
|
5525
|
-
},
|
|
5526
|
-
onBlur: _onBlur ? function (e) {
|
|
5527
|
-
_onBlur && _onBlur(e.target.value);
|
|
5528
|
-
formik.setFieldTouched(name);
|
|
5529
|
-
currencyBlur();
|
|
5530
|
-
} : function () {
|
|
5531
|
-
formik.setFieldTouched(name);
|
|
5532
|
-
currencyBlur();
|
|
5533
|
-
}
|
|
5534
|
-
});
|
|
5535
|
-
}
|
|
5796
|
+
var _useScrollShadow = useScrollShadow(),
|
|
5797
|
+
ref = _useScrollShadow.ref,
|
|
5798
|
+
showScrollShadow = _useScrollShadow.showScrollShadow;
|
|
5536
5799
|
|
|
5537
|
-
return
|
|
5800
|
+
return React__default.createElement("div", {
|
|
5801
|
+
className: classnames(styles$s['modal-body'], (_classNames = {}, _classNames[styles$s['modal-body--with-scroll-shadow']] = showScrollShadow, _classNames)),
|
|
5802
|
+
ref: ref,
|
|
5803
|
+
"data-testid": testId
|
|
5804
|
+
}, children);
|
|
5538
5805
|
};
|
|
5539
5806
|
|
|
5540
|
-
var
|
|
5807
|
+
var styles$t = {"modal-footer":"_LKOr5","tertiary-container":"_Qktd-"};
|
|
5541
5808
|
|
|
5542
|
-
var
|
|
5543
|
-
|
|
5809
|
+
var updateButtonProps = function updateButtonProps(button, newProps) {
|
|
5810
|
+
if (!button) {
|
|
5811
|
+
return null;
|
|
5812
|
+
}
|
|
5544
5813
|
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
disabled = _ref.disabled,
|
|
5549
|
-
error = _ref.error,
|
|
5550
|
-
id = _ref.id,
|
|
5551
|
-
maxLength = _ref.maxLength,
|
|
5552
|
-
name = _ref.name,
|
|
5553
|
-
caption = _ref.caption,
|
|
5554
|
-
label = _ref.label,
|
|
5555
|
-
onBlur = _ref.onBlur,
|
|
5556
|
-
onChange = _ref.onChange,
|
|
5557
|
-
onFocus = _ref.onFocus,
|
|
5558
|
-
onKeyDown = _ref.onKeyDown,
|
|
5559
|
-
placeholder = _ref.placeholder,
|
|
5560
|
-
value = _ref.value,
|
|
5561
|
-
ref = _ref.ref,
|
|
5562
|
-
testId = _ref.testId;
|
|
5563
|
-
var controllers = useFieldControllers({
|
|
5564
|
-
error: error,
|
|
5565
|
-
id: id,
|
|
5566
|
-
name: name,
|
|
5567
|
-
onChange: onChange,
|
|
5568
|
-
onBlur: onBlur,
|
|
5569
|
-
onFocus: onFocus,
|
|
5570
|
-
onKeyDown: onKeyDown,
|
|
5571
|
-
value: value
|
|
5572
|
-
});
|
|
5573
|
-
var hasError = !!controllers.error;
|
|
5574
|
-
var inputProps = {
|
|
5575
|
-
'aria-describedby': hasError ? controllers.id + "-error-message" : controllers.id + "-describer",
|
|
5576
|
-
'aria-invalid': hasError,
|
|
5577
|
-
autoComplete: autoComplete,
|
|
5578
|
-
autoFocus: autoFocus,
|
|
5579
|
-
className: classnames(textFieldStyles['text-field'], (_classnames = {}, _classnames[textFieldStyles['text-field--invalid']] = hasError, _classnames)),
|
|
5580
|
-
'data-testid': testId,
|
|
5581
|
-
disabled: disabled,
|
|
5582
|
-
defaultValue: defaultValue,
|
|
5583
|
-
id: controllers.id,
|
|
5584
|
-
maxLength: maxLength,
|
|
5585
|
-
name: name,
|
|
5586
|
-
onBlur: controllers.onBlur,
|
|
5587
|
-
onChange: controllers.onChange,
|
|
5588
|
-
onFocus: controllers.onFocus,
|
|
5589
|
-
onKeyDown: controllers.onKeyDown,
|
|
5590
|
-
placeholder: placeholder,
|
|
5591
|
-
ref: ref,
|
|
5592
|
-
size: 1,
|
|
5593
|
-
type: 'text',
|
|
5594
|
-
value: controllers.value
|
|
5595
|
-
};
|
|
5596
|
-
var fieldProps = {
|
|
5597
|
-
caption: caption,
|
|
5598
|
-
error: controllers.error,
|
|
5599
|
-
label: label,
|
|
5600
|
-
id: inputProps.id,
|
|
5601
|
-
name: name
|
|
5602
|
-
};
|
|
5603
|
-
return {
|
|
5604
|
-
inputProps: inputProps,
|
|
5605
|
-
fieldProps: fieldProps
|
|
5606
|
-
};
|
|
5607
|
-
};
|
|
5814
|
+
if (button.type !== Button$1) {
|
|
5815
|
+
return button;
|
|
5816
|
+
}
|
|
5608
5817
|
|
|
5609
|
-
|
|
5610
|
-
var inputProps = _ref.inputProps,
|
|
5611
|
-
allOtherProps = _ref.allOtherProps;
|
|
5612
|
-
return React__default.createElement("input", Object.assign({}, inputProps, {
|
|
5613
|
-
onBlur: function onBlur(e) {
|
|
5614
|
-
e.target.value = parseTime(e.target.value, 'g:i A');
|
|
5615
|
-
inputProps.onChange(e);
|
|
5616
|
-
inputProps.onBlur(e);
|
|
5617
|
-
},
|
|
5618
|
-
onClick: allOtherProps.onClick,
|
|
5619
|
-
onMouseEnter: allOtherProps.onMouseEnter,
|
|
5620
|
-
onMouseLeave: allOtherProps.onMouseLeave,
|
|
5621
|
-
onInput: function onInput(e) {
|
|
5622
|
-
var target = e.target;
|
|
5623
|
-
allOtherProps.onInputChange(target.value);
|
|
5624
|
-
}
|
|
5625
|
-
}));
|
|
5818
|
+
return React__default.cloneElement(button, _extends({}, newProps));
|
|
5626
5819
|
};
|
|
5627
5820
|
|
|
5628
|
-
var
|
|
5821
|
+
var ModalFooter = function ModalFooter(_ref) {
|
|
5822
|
+
var children = _ref.children,
|
|
5823
|
+
actions = _ref.actions,
|
|
5824
|
+
testId = _ref.testId;
|
|
5629
5825
|
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
placeholder = _ref$placeholder === void 0 ? '9:00 AM' : _ref$placeholder,
|
|
5633
|
-
_ref$autoComplete = _ref.autoComplete,
|
|
5634
|
-
autoComplete = _ref$autoComplete === void 0 ? 'off' : _ref$autoComplete,
|
|
5635
|
-
selectedTimeOption = _ref.selectedTimeOption,
|
|
5636
|
-
allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2h);
|
|
5826
|
+
if (actions) {
|
|
5827
|
+
var _actions$primary, _actions$secondary, _actions$tertiary, _classnames;
|
|
5637
5828
|
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5829
|
+
var primaryButton = updateButtonProps(actions.primary, {
|
|
5830
|
+
theme: (actions === null || actions === void 0 ? void 0 : (_actions$primary = actions.primary) === null || _actions$primary === void 0 ? void 0 : _actions$primary.props.theme) || 'primary',
|
|
5831
|
+
size: BUTTON_SIZES.MIN_WIDTH_100
|
|
5832
|
+
});
|
|
5833
|
+
var secondaryButton = updateButtonProps(actions.secondary, {
|
|
5834
|
+
theme: (actions === null || actions === void 0 ? void 0 : (_actions$secondary = actions.secondary) === null || _actions$secondary === void 0 ? void 0 : _actions$secondary.props.theme) || 'default',
|
|
5835
|
+
size: BUTTON_SIZES.MIN_WIDTH_100
|
|
5836
|
+
});
|
|
5837
|
+
var tertiaryButton = updateButtonProps(actions.tertiary, {
|
|
5838
|
+
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',
|
|
5839
|
+
size: BUTTON_SIZES.MIN_WIDTH_100
|
|
5840
|
+
});
|
|
5841
|
+
return React__default.createElement(FooterContainer, {
|
|
5842
|
+
testId: testId
|
|
5843
|
+
}, React__default.createElement(Inline, {
|
|
5844
|
+
justifyContent: "space-between"
|
|
5845
|
+
}, React__default.createElement("div", {
|
|
5846
|
+
className: classnames((_classnames = {}, _classnames[styles$t['tertiary-container']] = tertiaryButton && tertiaryButton.props.theme.startsWith('link'), _classnames))
|
|
5847
|
+
}, tertiaryButton || React__default.createElement("div", null)), React__default.createElement(Inline, {
|
|
5848
|
+
space: 12
|
|
5849
|
+
}, secondaryButton, primaryButton)));
|
|
5850
|
+
}
|
|
5851
|
+
|
|
5852
|
+
return React__default.createElement(FooterContainer, null, children);
|
|
5853
|
+
};
|
|
5645
5854
|
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
},
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
}));
|
|
5855
|
+
var FooterContainer = function FooterContainer(_ref2) {
|
|
5856
|
+
var children = _ref2.children,
|
|
5857
|
+
testId = _ref2.testId;
|
|
5858
|
+
var childrenItens = React__default.Children.toArray(children);
|
|
5859
|
+
var hasCustomAlignment = childrenItens.length === 1 && childrenItens[0].type === Inline;
|
|
5860
|
+
return React__default.createElement("div", {
|
|
5861
|
+
className: styles$t['modal-footer'],
|
|
5862
|
+
"data-testid": testId
|
|
5863
|
+
}, React__default.createElement(Inline, {
|
|
5864
|
+
justifyContent: "end",
|
|
5865
|
+
space: 12,
|
|
5866
|
+
flex: hasCustomAlignment ? [1] : undefined
|
|
5867
|
+
}, children));
|
|
5659
5868
|
};
|
|
5660
5869
|
|
|
5661
|
-
var
|
|
5870
|
+
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"};
|
|
5662
5871
|
|
|
5663
|
-
var
|
|
5664
|
-
var trigger = _ref.trigger,
|
|
5665
|
-
_ref$triggersOn = _ref.triggersOn,
|
|
5666
|
-
triggersOn = _ref$triggersOn === void 0 ? DROPDOWN_TRIGGER.CLICK : _ref$triggersOn,
|
|
5667
|
-
_ref$alignment = _ref.alignment,
|
|
5668
|
-
alignment = _ref$alignment === void 0 ? DROPDOWN_ALIGNEMNT.RIGHT : _ref$alignment,
|
|
5669
|
-
width = _ref.width,
|
|
5670
|
-
maxHeight = _ref.maxHeight,
|
|
5671
|
-
testId = _ref.testId,
|
|
5672
|
-
children = _ref.children,
|
|
5673
|
-
triggerWidth = _ref.triggerWidth;
|
|
5872
|
+
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"};
|
|
5674
5873
|
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5874
|
+
function parseDate(str, format, locale) {
|
|
5875
|
+
var parsed = dateFnsParse(str, format, new Date(), {
|
|
5876
|
+
locale: locale
|
|
5877
|
+
});
|
|
5678
5878
|
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5879
|
+
if (str.length === format.length && DayPicker.DateUtils.isDate(parsed)) {
|
|
5880
|
+
return parsed;
|
|
5881
|
+
}
|
|
5682
5882
|
|
|
5683
|
-
|
|
5684
|
-
|
|
5883
|
+
return undefined;
|
|
5884
|
+
}
|
|
5885
|
+
function formatDate(date, format, locale) {
|
|
5886
|
+
return dateFnsFormat(date, format, {
|
|
5887
|
+
locale: locale
|
|
5888
|
+
});
|
|
5889
|
+
}
|
|
5890
|
+
function setToMidnight(date) {
|
|
5891
|
+
return date && startOfDay(date);
|
|
5892
|
+
}
|
|
5893
|
+
function getStartOfWeek(date, weekIndex) {
|
|
5894
|
+
var d = new Date(date);
|
|
5895
|
+
var firstDay = d.getDate() - d.getDay() + weekIndex;
|
|
5896
|
+
var firstDayAdjusted = firstDay > d.getDate() ? firstDay - 7 : firstDay;
|
|
5897
|
+
return new Date(d.setDate(firstDayAdjusted));
|
|
5898
|
+
}
|
|
5899
|
+
function getEndOfWeek(date, weekIndex) {
|
|
5900
|
+
var startOfWeek = getStartOfWeek(date, weekIndex);
|
|
5901
|
+
var endDay = startOfWeek.getDate() + 6;
|
|
5902
|
+
return new Date(startOfWeek.setDate(endDay));
|
|
5903
|
+
}
|
|
5904
|
+
function createWeekRange(date, weekStart) {
|
|
5905
|
+
return {
|
|
5906
|
+
start: getStartOfWeek(date, weekStart),
|
|
5907
|
+
end: getEndOfWeek(date, weekStart)
|
|
5685
5908
|
};
|
|
5909
|
+
}
|
|
5910
|
+
var DAYS = [getLocalizedString('time.sunday'), getLocalizedString('time.monday'), getLocalizedString('time.tuesday'), getLocalizedString('time.wednesday'), getLocalizedString('time.thursday'), getLocalizedString('time.friday'), getLocalizedString('time.saturday')];
|
|
5911
|
+
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')];
|
|
5686
5912
|
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5913
|
+
var CALENDAR_MODE = {
|
|
5914
|
+
DAY: 'day',
|
|
5915
|
+
WEEK: 'week'
|
|
5916
|
+
};
|
|
5917
|
+
var CALENDAR_PLACEMENT = {
|
|
5918
|
+
BOTTOM: 'bottom',
|
|
5919
|
+
TOP: 'top'
|
|
5920
|
+
};
|
|
5693
5921
|
|
|
5694
|
-
|
|
5922
|
+
var calculateCalendarPosition = function calculateCalendarPosition(placement, anchorPosition, calendarDimensions) {
|
|
5923
|
+
if (!calendarDimensions) {
|
|
5924
|
+
return {
|
|
5925
|
+
left: 0,
|
|
5926
|
+
top: 0
|
|
5927
|
+
};
|
|
5928
|
+
}
|
|
5695
5929
|
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5930
|
+
var horizontalPosition = getHorizontalPosition(anchorPosition, calendarDimensions);
|
|
5931
|
+
var verticalPosition = getVerticalPosition(anchorPosition, placement, calendarDimensions);
|
|
5932
|
+
return _extends({}, horizontalPosition, verticalPosition);
|
|
5933
|
+
};
|
|
5700
5934
|
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
}
|
|
5935
|
+
var getHorizontalPosition = function getHorizontalPosition(anchorPosition, calendarDimensions) {
|
|
5936
|
+
var innerWidth = window.innerWidth;
|
|
5937
|
+
var calendarRight = anchorPosition.left + calendarDimensions.width;
|
|
5705
5938
|
|
|
5706
|
-
|
|
5939
|
+
if (innerWidth > calendarRight + BUFFER) {
|
|
5940
|
+
return {
|
|
5941
|
+
left: anchorPosition.left
|
|
5942
|
+
};
|
|
5943
|
+
}
|
|
5707
5944
|
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
}
|
|
5945
|
+
return {
|
|
5946
|
+
left: anchorPosition.right - calendarDimensions.width
|
|
5711
5947
|
};
|
|
5948
|
+
};
|
|
5712
5949
|
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
setIsOpen(true);
|
|
5717
|
-
}
|
|
5718
|
-
|
|
5719
|
-
if ('onFocus' in trigger.props) {
|
|
5720
|
-
trigger.props.onFocus(e);
|
|
5721
|
-
}
|
|
5722
|
-
|
|
5723
|
-
return;
|
|
5724
|
-
}
|
|
5725
|
-
|
|
5726
|
-
setIsOpen(true);
|
|
5950
|
+
var getVerticalPosition = function getVerticalPosition(anchorPosition, placement, calendarDimensions) {
|
|
5951
|
+
var calendarTopAboveTrigger = anchorPosition.top - calendarDimensions.height - PADDING;
|
|
5952
|
+
var calendarTopBelowTrigger = anchorPosition.bottom + PADDING;
|
|
5727
5953
|
|
|
5728
|
-
|
|
5729
|
-
|
|
5954
|
+
if (placement === CALENDAR_PLACEMENT.TOP) {
|
|
5955
|
+
if (calendarTopAboveTrigger < 0) {
|
|
5956
|
+
return {
|
|
5957
|
+
top: anchorPosition.bottom + PADDING
|
|
5958
|
+
};
|
|
5730
5959
|
}
|
|
5731
|
-
};
|
|
5732
5960
|
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5961
|
+
return {
|
|
5962
|
+
top: calendarTopAboveTrigger + window.scrollY
|
|
5963
|
+
};
|
|
5964
|
+
} else {
|
|
5965
|
+
if (calendarTopBelowTrigger + calendarDimensions.height > window.innerHeight) {
|
|
5966
|
+
return {
|
|
5967
|
+
top: calendarTopAboveTrigger + window.scrollY
|
|
5968
|
+
};
|
|
5736
5969
|
}
|
|
5737
5970
|
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5971
|
+
return {
|
|
5972
|
+
top: calendarTopBelowTrigger + window.scrollY
|
|
5973
|
+
};
|
|
5974
|
+
}
|
|
5975
|
+
};
|
|
5742
5976
|
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5977
|
+
var Calendar = function Calendar(_ref) {
|
|
5978
|
+
var _ref$mode = _ref.mode,
|
|
5979
|
+
mode = _ref$mode === void 0 ? CALENDAR_MODE.DAY : _ref$mode,
|
|
5980
|
+
_ref$position = _ref.position,
|
|
5981
|
+
position = _ref$position === void 0 ? CALENDAR_PLACEMENT.BOTTOM : _ref$position,
|
|
5982
|
+
_ref$weekStart = _ref.weekStart,
|
|
5983
|
+
weekStart = _ref$weekStart === void 0 ? 0 : _ref$weekStart,
|
|
5984
|
+
selected = _ref.selected,
|
|
5985
|
+
onSelect = _ref.onSelect,
|
|
5986
|
+
onClickOutside = _ref.onClickOutside,
|
|
5987
|
+
disabledDays = _ref.disabledDays,
|
|
5988
|
+
anchorRef = _ref.anchorRef,
|
|
5989
|
+
testId = _ref.testId;
|
|
5748
5990
|
|
|
5749
|
-
var
|
|
5750
|
-
|
|
5751
|
-
|
|
5991
|
+
var _useState = React.useState(null),
|
|
5992
|
+
calendarRef = _useState[0],
|
|
5993
|
+
setCalendarRef = _useState[1];
|
|
5752
5994
|
|
|
5753
|
-
var
|
|
5754
|
-
|
|
5995
|
+
var style = mode === CALENDAR_MODE.DAY ? styles$u : styles$v;
|
|
5996
|
+
var anchorNode = anchorRef.current;
|
|
5997
|
+
useOnClickOutside({
|
|
5998
|
+
current: calendarRef
|
|
5999
|
+
}, function (event) {
|
|
6000
|
+
var _anchorRef$current;
|
|
5755
6001
|
|
|
5756
|
-
if (
|
|
5757
|
-
|
|
6002
|
+
if (!((_anchorRef$current = anchorRef.current) !== null && _anchorRef$current !== void 0 && _anchorRef$current.contains(event === null || event === void 0 ? void 0 : event.srcElement))) {
|
|
6003
|
+
onClickOutside();
|
|
5758
6004
|
}
|
|
6005
|
+
});
|
|
6006
|
+
var weekRange = selected ? createWeekRange(selected, weekStart) : undefined;
|
|
6007
|
+
var selectedRange = weekRange && {
|
|
6008
|
+
from: weekRange.start,
|
|
6009
|
+
to: weekRange.end
|
|
5759
6010
|
};
|
|
5760
6011
|
|
|
5761
|
-
var
|
|
5762
|
-
|
|
5763
|
-
return;
|
|
5764
|
-
}
|
|
5765
|
-
|
|
5766
|
-
var focusableElements = getKeyboardFocusableElements(paneRef.current);
|
|
6012
|
+
var handleSelect = function handleSelect(day) {
|
|
6013
|
+
var selectedDate = setToMidnight(day);
|
|
5767
6014
|
|
|
5768
|
-
if (
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
} else if (!isFocusingOverlay.current) {
|
|
5773
|
-
setIsOpen(false);
|
|
5774
|
-
}
|
|
5775
|
-
};
|
|
6015
|
+
if (mode === CALENDAR_MODE.DAY) {
|
|
6016
|
+
onSelect(selectedDate);
|
|
6017
|
+
} else {
|
|
6018
|
+
var _weekRange = createWeekRange(selectedDate, weekStart);
|
|
5776
6019
|
|
|
5777
|
-
|
|
5778
|
-
if ((trigger.type === Button$1 || trigger.type === TimeFieldDropdownTrigger) && trigger.ref) {
|
|
5779
|
-
return trigger.ref;
|
|
6020
|
+
onSelect(_weekRange.start);
|
|
5780
6021
|
}
|
|
5781
6022
|
|
|
5782
|
-
|
|
6023
|
+
setTimeout(function () {
|
|
6024
|
+
onClickOutside();
|
|
6025
|
+
}, 100);
|
|
5783
6026
|
};
|
|
5784
6027
|
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
6028
|
+
if (!anchorNode) {
|
|
6029
|
+
return null;
|
|
6030
|
+
}
|
|
6031
|
+
|
|
6032
|
+
var anchorPosition = anchorNode.getBoundingClientRect();
|
|
6033
|
+
var calendarPosition = calculateCalendarPosition(position, anchorPosition, calendarRef === null || calendarRef === void 0 ? void 0 : calendarRef.getBoundingClientRect());
|
|
6034
|
+
return React__default.createElement(Portal, null, React__default.createElement("div", {
|
|
6035
|
+
className: style.overlayWrapper
|
|
6036
|
+
}, React__default.createElement("div", {
|
|
6037
|
+
className: style.overlay,
|
|
6038
|
+
ref: function ref(_ref2) {
|
|
6039
|
+
return setCalendarRef(_ref2);
|
|
5794
6040
|
},
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5805
|
-
|
|
5806
|
-
ref: updatedRef,
|
|
5807
|
-
onFocus: handleFocus
|
|
5808
|
-
}), trigger), React__default.createElement(DropdownPane, {
|
|
5809
|
-
width: width,
|
|
5810
|
-
maxHeight: maxHeight,
|
|
5811
|
-
onMouseEnter: handlePaneMouseEnter,
|
|
5812
|
-
onMouseLeave: handlePaneMouseLeave,
|
|
5813
|
-
alignment: alignment,
|
|
5814
|
-
testId: testId
|
|
5815
|
-
}, children));
|
|
5816
|
-
};
|
|
6041
|
+
style: _extends({}, calendarPosition, {
|
|
6042
|
+
zIndex: Z_INDEX_LAYERS.MODAL
|
|
6043
|
+
}),
|
|
6044
|
+
"data-testid": testId
|
|
6045
|
+
}, React__default.createElement(DayPicker__default, {
|
|
6046
|
+
format: "MM/dd/yyyy",
|
|
6047
|
+
classNames: style,
|
|
6048
|
+
onDayClick: function onDayClick(day, activeModifiers) {
|
|
6049
|
+
var isDateDisabled = Object.keys(activeModifiers).find(function (modifier) {
|
|
6050
|
+
return modifier.includes('disabled');
|
|
6051
|
+
});
|
|
5817
6052
|
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
},
|
|
5830
|
-
|
|
6053
|
+
if (!Boolean(isDateDisabled)) {
|
|
6054
|
+
handleSelect(day);
|
|
6055
|
+
}
|
|
6056
|
+
},
|
|
6057
|
+
selectedDays: mode === CALENDAR_MODE.DAY ? selected : selectedRange,
|
|
6058
|
+
disabledDays: disabledDays,
|
|
6059
|
+
months: MONTH_NAMES,
|
|
6060
|
+
weekdaysLong: DAYS,
|
|
6061
|
+
initialMonth: selected,
|
|
6062
|
+
weekdaysShort: DAYS.map(function (day) {
|
|
6063
|
+
return day.substring(0, 2);
|
|
6064
|
+
}),
|
|
6065
|
+
showOutsideDays: mode === CALENDAR_MODE.WEEK,
|
|
6066
|
+
firstDayOfWeek: weekStart
|
|
6067
|
+
}))));
|
|
5831
6068
|
};
|
|
5832
6069
|
|
|
5833
|
-
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"};
|
|
5834
|
-
|
|
5835
6070
|
var DataTableCellElement = function DataTableCellElement(_ref, ref) {
|
|
5836
6071
|
var _columns$columnIndex, _classnames, _classnames2, _classnames3;
|
|
5837
6072
|
|
|
@@ -5853,17 +6088,17 @@ var DataTableCellElement = function DataTableCellElement(_ref, ref) {
|
|
|
5853
6088
|
var hasError = !!error;
|
|
5854
6089
|
var errorMessage = error;
|
|
5855
6090
|
var icon = hasError && React__default.createElement("div", {
|
|
5856
|
-
className: classnames(styles$
|
|
6091
|
+
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))
|
|
5857
6092
|
}, React__default.createElement(IconTimesOctagon, {
|
|
5858
6093
|
size: "medium",
|
|
5859
|
-
color:
|
|
6094
|
+
color: "radish-400"
|
|
5860
6095
|
}));
|
|
5861
6096
|
var TableCell = React__default.createElement("td", {
|
|
5862
|
-
className: classnames((_classnames2 = {}, _classnames2[styles$
|
|
6097
|
+
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']),
|
|
5863
6098
|
colSpan: colSpan,
|
|
5864
6099
|
ref: ref
|
|
5865
6100
|
}, React__default.createElement("div", {
|
|
5866
|
-
className: classnames(styles$
|
|
6101
|
+
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))
|
|
5867
6102
|
}, isRightAligned && icon, children, !isRightAligned && icon));
|
|
5868
6103
|
return React__default.createElement(Tooltip$1, {
|
|
5869
6104
|
overlay: errorMessage,
|
|
@@ -5887,7 +6122,7 @@ var DataTableRowActions = function DataTableRowActions(_ref) {
|
|
|
5887
6122
|
return React__default.createElement(DataTableCell, {
|
|
5888
6123
|
columnIndex: columnIndex
|
|
5889
6124
|
}, React__default.createElement("div", {
|
|
5890
|
-
className: styles$
|
|
6125
|
+
className: styles$e['actions'],
|
|
5891
6126
|
"data-testid": "data-table-dropdown-menu"
|
|
5892
6127
|
}, sideActions.length > 0 && sideActions.map(function (action) {
|
|
5893
6128
|
return React__default.createElement(Button$1, Object.assign({
|
|
@@ -5900,60 +6135,7 @@ var DataTableRowActions = function DataTableRowActions(_ref) {
|
|
|
5900
6135
|
})));
|
|
5901
6136
|
};
|
|
5902
6137
|
|
|
5903
|
-
var styles$
|
|
5904
|
-
|
|
5905
|
-
var AffixContainer = function AffixContainer(_ref) {
|
|
5906
|
-
var _classnames;
|
|
5907
|
-
|
|
5908
|
-
var prefix = _ref.prefix,
|
|
5909
|
-
suffix = _ref.suffix,
|
|
5910
|
-
children = _ref.children,
|
|
5911
|
-
testId = _ref.testId;
|
|
5912
|
-
var container = React.useRef(null);
|
|
5913
|
-
var prefixElement = React.useRef(null);
|
|
5914
|
-
var suffixElement = React.useRef(null);
|
|
5915
|
-
var isHidden = container.current && container.current.offsetParent === null;
|
|
5916
|
-
React.useLayoutEffect(function () {
|
|
5917
|
-
if (container.current) {
|
|
5918
|
-
var input = container.current.querySelector('input, [class$=control] > div');
|
|
5919
|
-
|
|
5920
|
-
if (input) {
|
|
5921
|
-
if (prefix && prefixElement.current) {
|
|
5922
|
-
var _prefixElement$curren;
|
|
5923
|
-
|
|
5924
|
-
var prefixWidth = prefixElement === null || prefixElement === void 0 ? void 0 : (_prefixElement$curren = prefixElement.current) === null || _prefixElement$curren === void 0 ? void 0 : _prefixElement$curren.offsetWidth;
|
|
5925
|
-
input.style.paddingLeft = prefixWidth + 'px';
|
|
5926
|
-
}
|
|
5927
|
-
|
|
5928
|
-
if (suffix && suffixElement.current) {
|
|
5929
|
-
var suffixWidth = suffixElement.current.offsetWidth;
|
|
5930
|
-
input.style.paddingRight = suffixWidth + 'px';
|
|
5931
|
-
}
|
|
5932
|
-
}
|
|
5933
|
-
}
|
|
5934
|
-
}, [prefix, suffix, isHidden]);
|
|
5935
|
-
var hasPrefix = !!prefix;
|
|
5936
|
-
var hasSuffix = !!suffix;
|
|
5937
|
-
|
|
5938
|
-
if (!hasPrefix && !hasSuffix) {
|
|
5939
|
-
return children;
|
|
5940
|
-
}
|
|
5941
|
-
|
|
5942
|
-
var classes = classnames(styles$r['affix-container'], (_classnames = {}, _classnames[styles$r['affix-container--prefixed']] = hasPrefix, _classnames[styles$r['affix-container--suffixed']] = hasSuffix, _classnames));
|
|
5943
|
-
return React__default.createElement("div", {
|
|
5944
|
-
className: classes,
|
|
5945
|
-
ref: container,
|
|
5946
|
-
"data-testid": testId
|
|
5947
|
-
}, hasPrefix && React__default.createElement("div", {
|
|
5948
|
-
className: styles$r['prefix'],
|
|
5949
|
-
ref: prefixElement
|
|
5950
|
-
}, prefix), children, hasSuffix && React__default.createElement("div", {
|
|
5951
|
-
className: styles$r['suffix'],
|
|
5952
|
-
ref: suffixElement
|
|
5953
|
-
}, suffix));
|
|
5954
|
-
};
|
|
5955
|
-
|
|
5956
|
-
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"};
|
|
6138
|
+
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"};
|
|
5957
6139
|
|
|
5958
6140
|
var DataTableEditableCellElement = function DataTableEditableCellElement(_ref, ref) {
|
|
5959
6141
|
var _columns$columnIndex, _controllers$error, _classnames, _classnames2;
|
|
@@ -6002,7 +6184,7 @@ var DataTableEditableCellElement = function DataTableEditableCellElement(_ref, r
|
|
|
6002
6184
|
id: controllers.id
|
|
6003
6185
|
};
|
|
6004
6186
|
var EditableCell = React__default.createElement("div", {
|
|
6005
|
-
className: classnames((_classnames = {}, _classnames[styles$
|
|
6187
|
+
className: classnames((_classnames = {}, _classnames[styles$w['data-table-editable-cell--currency']] = type === 'currency', _classnames), styles$w['data-table-editable-cell']),
|
|
6006
6188
|
"data-testid": testId,
|
|
6007
6189
|
role: "cell"
|
|
6008
6190
|
}, React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement(AffixContainer, {
|
|
@@ -6011,249 +6193,103 @@ var DataTableEditableCellElement = function DataTableEditableCellElement(_ref, r
|
|
|
6011
6193
|
}, React__default.createElement("input", {
|
|
6012
6194
|
name: name,
|
|
6013
6195
|
id: controllers.id,
|
|
6014
|
-
className: classnames((_classnames2 = {}, _classnames2[styles$
|
|
6196
|
+
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)),
|
|
6015
6197
|
type: type === 'currency' ? 'number' : 'text',
|
|
6016
6198
|
step: type === 'currency' ? 'any' : '',
|
|
6017
6199
|
"data-testid": testId && testId + "-text-field",
|
|
6018
6200
|
"aria-describedby": hasError ? controllers.id + "-error-message" : controllers.id + "-describer",
|
|
6019
6201
|
"aria-invalid": hasError,
|
|
6020
6202
|
disabled: disabled,
|
|
6021
|
-
placeholder: placeholder,
|
|
6022
|
-
defaultValue: defaultValue,
|
|
6023
|
-
value: controllers.value,
|
|
6024
|
-
onChange: controllers.onChange,
|
|
6025
|
-
onBlur: controllers.onBlur,
|
|
6026
|
-
ref: ref,
|
|
6027
|
-
onWheel: function onWheel(e) {
|
|
6028
|
-
e.target.blur();
|
|
6029
|
-
}
|
|
6030
|
-
}))));
|
|
6031
|
-
return React__default.createElement(Tooltip$1, {
|
|
6032
|
-
overlay: errorMessage,
|
|
6033
|
-
placement: "top",
|
|
6034
|
-
theme: "white"
|
|
6035
|
-
}, EditableCell);
|
|
6036
|
-
};
|
|
6037
|
-
|
|
6038
|
-
var DataTableEditableCell = React.forwardRef(DataTableEditableCellElement);
|
|
6039
|
-
|
|
6040
|
-
var _excluded$2i = ["children", "onClick", "isSelected", "actions", "hasDefaultPadding", "hasDefaultCell", "testId"];
|
|
6041
|
-
|
|
6042
|
-
var DataTableRowComponent = function DataTableRowComponent(_ref, ref) {
|
|
6043
|
-
var _classnames;
|
|
6044
|
-
|
|
6045
|
-
var children = _ref.children,
|
|
6046
|
-
onClick = _ref.onClick,
|
|
6047
|
-
_ref$isSelected = _ref.isSelected,
|
|
6048
|
-
isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
|
|
6049
|
-
_ref$actions = _ref.actions,
|
|
6050
|
-
actions = _ref$actions === void 0 ? [] : _ref$actions,
|
|
6051
|
-
_ref$hasDefaultCell = _ref.hasDefaultCell,
|
|
6052
|
-
hasDefaultCell = _ref$hasDefaultCell === void 0 ? true : _ref$hasDefaultCell,
|
|
6053
|
-
testId = _ref.testId,
|
|
6054
|
-
nativeDivProps = _objectWithoutPropertiesLoose(_ref, _excluded$2i);
|
|
6055
|
-
|
|
6056
|
-
var _useDataTableContext = useDataTableContext(),
|
|
6057
|
-
showActionMenu = _useDataTableContext.showActionMenu;
|
|
6058
|
-
|
|
6059
|
-
var styleNames = classnames(styles$9['item'], (_classnames = {}, _classnames[styles$9['clickable']] = onClick, _classnames[styles$9['selected']] = isSelected, _classnames));
|
|
6060
|
-
|
|
6061
|
-
var renderColumn = function renderColumn(columnElement, index) {
|
|
6062
|
-
var isUsingDataTableCell = columnElement && typeof columnElement === 'object' && 'type' in columnElement && (columnElement === null || columnElement === void 0 ? void 0 : columnElement.type) === DataTableCell;
|
|
6063
|
-
|
|
6064
|
-
if (isUsingDataTableCell || !hasDefaultCell) {
|
|
6065
|
-
return columnElement;
|
|
6066
|
-
}
|
|
6067
|
-
|
|
6068
|
-
var isUsingDataTableEditableCell = columnElement && typeof columnElement === 'object' && 'type' in columnElement && (columnElement === null || columnElement === void 0 ? void 0 : columnElement.type) === DataTableEditableCell;
|
|
6069
|
-
return React__default.createElement(DataTableCell, {
|
|
6070
|
-
key: index,
|
|
6071
|
-
columnIndex: index,
|
|
6072
|
-
noPadding: !!isUsingDataTableEditableCell
|
|
6073
|
-
}, columnElement);
|
|
6074
|
-
};
|
|
6075
|
-
|
|
6076
|
-
return React__default.createElement("tr", Object.assign({}, nativeDivProps, {
|
|
6077
|
-
className: styleNames,
|
|
6078
|
-
onClick: onClick ? onClick : undefined,
|
|
6079
|
-
onKeyPress: onClick ? onClick : undefined,
|
|
6080
|
-
"data-testid": testId && testId + "-row",
|
|
6081
|
-
role: "row",
|
|
6082
|
-
ref: ref
|
|
6083
|
-
}), React__default.Children.toArray(children).filter(Boolean).map(function (child, index) {
|
|
6084
|
-
return renderColumn(child, index);
|
|
6085
|
-
}), showActionMenu && React__default.createElement(DataTableRowActions, {
|
|
6086
|
-
actions: actions,
|
|
6087
|
-
columnIndex: React__default.Children.count(children)
|
|
6088
|
-
}));
|
|
6089
|
-
};
|
|
6090
|
-
|
|
6091
|
-
var DataTableRow = React.forwardRef(DataTableRowComponent);
|
|
6092
|
-
|
|
6093
|
-
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"};
|
|
6094
|
-
|
|
6095
|
-
var calculatePercentageOfProportion = function calculatePercentageOfProportion(proportionNumbers) {
|
|
6096
|
-
var sum = proportionNumbers.reduce(function (total, num) {
|
|
6097
|
-
return total + num;
|
|
6098
|
-
}, 0);
|
|
6099
|
-
var percentages = proportionNumbers.map(function (num) {
|
|
6100
|
-
return parseFloat((num / sum * 100).toFixed(2));
|
|
6101
|
-
});
|
|
6102
|
-
return percentages;
|
|
6103
|
-
};
|
|
6104
|
-
|
|
6105
|
-
var SORT_ORDER = {
|
|
6106
|
-
ASC: 'asc',
|
|
6107
|
-
DESC: 'desc'
|
|
6108
|
-
};
|
|
6109
|
-
|
|
6110
|
-
var DataTableHeader = function DataTableHeader(_ref) {
|
|
6111
|
-
var columns = _ref.columns,
|
|
6112
|
-
onSort = _ref.onSort,
|
|
6113
|
-
showActionMenu = _ref.showActionMenu;
|
|
6114
|
-
var haveLabels = columns.find(function (column) {
|
|
6115
|
-
return column.label && column.label !== '';
|
|
6116
|
-
});
|
|
6117
|
-
|
|
6118
|
-
if (!haveLabels) {
|
|
6119
|
-
return React__default.createElement(ColumnSizes, {
|
|
6120
|
-
columns: columns,
|
|
6121
|
-
showActionMenu: showActionMenu
|
|
6122
|
-
});
|
|
6123
|
-
}
|
|
6124
|
-
|
|
6125
|
-
var handleSort = function handleSort(column) {
|
|
6126
|
-
var nextDirection = getNextSort(column);
|
|
6127
|
-
|
|
6128
|
-
if (onSort) {
|
|
6129
|
-
onSort({
|
|
6130
|
-
columnName: column.name,
|
|
6131
|
-
direction: nextDirection
|
|
6132
|
-
});
|
|
6133
|
-
}
|
|
6134
|
-
};
|
|
6135
|
-
|
|
6136
|
-
return React__default.createElement(React.Fragment, null, React__default.createElement(ColumnSizes, {
|
|
6137
|
-
columns: columns,
|
|
6138
|
-
showActionMenu: showActionMenu
|
|
6139
|
-
}), React__default.createElement("thead", null, React__default.createElement("tr", {
|
|
6140
|
-
className: styles$t['header']
|
|
6141
|
-
}, columns.map(function (column) {
|
|
6142
|
-
var _classnames, _classnames2;
|
|
6143
|
-
|
|
6144
|
-
var isSortable = column.isSortable;
|
|
6145
|
-
var sortDir = column.currentSort;
|
|
6146
|
-
var isRightAligned = column.isRightAligned;
|
|
6147
|
-
return React__default.createElement("th", {
|
|
6148
|
-
className: classnames((_classnames = {}, _classnames[styles$t['header-item']] = true, _classnames[styles$t['header-item--sortable']] = isSortable, _classnames)),
|
|
6149
|
-
style: {
|
|
6150
|
-
flex: column.size || 1
|
|
6151
|
-
},
|
|
6152
|
-
key: column.name,
|
|
6153
|
-
onClick: function onClick() {
|
|
6154
|
-
return isSortable && handleSort(column);
|
|
6155
|
-
},
|
|
6156
|
-
onKeyPress: function onKeyPress() {
|
|
6157
|
-
return isSortable && handleSort(column);
|
|
6158
|
-
},
|
|
6159
|
-
role: "columnheader",
|
|
6160
|
-
tabIndex: 0
|
|
6161
|
-
}, React__default.createElement("div", {
|
|
6162
|
-
className: classnames(styles$t['header-item__content'], (_classnames2 = {}, _classnames2[styles$t['header-item__content--right-align']] = isRightAligned, _classnames2))
|
|
6163
|
-
}, column.label, ' ', isSortable && React__default.createElement("span", {
|
|
6164
|
-
className: styles$t['header-sort-icon']
|
|
6165
|
-
}, React__default.createElement(IconSort$1, {
|
|
6166
|
-
sortDirection: sortDir
|
|
6167
|
-
}))));
|
|
6168
|
-
}), showActionMenu && React__default.createElement("th", {
|
|
6169
|
-
className: classnames(styles$t['header-item'], styles$t['header-item--action'])
|
|
6203
|
+
placeholder: placeholder,
|
|
6204
|
+
defaultValue: defaultValue,
|
|
6205
|
+
value: controllers.value,
|
|
6206
|
+
onChange: controllers.onChange,
|
|
6207
|
+
onBlur: controllers.onBlur,
|
|
6208
|
+
ref: ref,
|
|
6209
|
+
onWheel: function onWheel(e) {
|
|
6210
|
+
e.target.blur();
|
|
6211
|
+
}
|
|
6170
6212
|
}))));
|
|
6213
|
+
return React__default.createElement(Tooltip$1, {
|
|
6214
|
+
overlay: errorMessage,
|
|
6215
|
+
placement: "top",
|
|
6216
|
+
theme: "white"
|
|
6217
|
+
}, EditableCell);
|
|
6171
6218
|
};
|
|
6172
6219
|
|
|
6173
|
-
var
|
|
6174
|
-
var columns = _ref2.columns,
|
|
6175
|
-
showActionMenu = _ref2.showActionMenu;
|
|
6176
|
-
var columnPercentageSizes = calculatePercentageOfProportion(columns.map(function (column) {
|
|
6177
|
-
return column.size || 1;
|
|
6178
|
-
}));
|
|
6179
|
-
return React__default.createElement("colgroup", null, columns.map(function (column, index) {
|
|
6180
|
-
return React__default.createElement("col", {
|
|
6181
|
-
key: column.name,
|
|
6182
|
-
style: {
|
|
6183
|
-
width: columnPercentageSizes[index] + "%"
|
|
6184
|
-
}
|
|
6185
|
-
});
|
|
6186
|
-
}), showActionMenu && React__default.createElement("col", {
|
|
6187
|
-
style: {
|
|
6188
|
-
width: "1%",
|
|
6189
|
-
whiteSpace: 'nowrap'
|
|
6190
|
-
}
|
|
6191
|
-
}));
|
|
6192
|
-
};
|
|
6220
|
+
var DataTableEditableCell = React.forwardRef(DataTableEditableCellElement);
|
|
6193
6221
|
|
|
6194
|
-
var
|
|
6195
|
-
switch (column.currentSort) {
|
|
6196
|
-
case SORT_ORDER.ASC:
|
|
6197
|
-
return null;
|
|
6222
|
+
var _excluded$2i = ["children", "onClick", "isSelected", "actions", "hasDefaultPadding", "hasDefaultCell", "testId"];
|
|
6198
6223
|
|
|
6199
|
-
|
|
6200
|
-
|
|
6224
|
+
var DataTableRowComponent = function DataTableRowComponent(_ref, ref) {
|
|
6225
|
+
var _classnames;
|
|
6201
6226
|
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6227
|
+
var children = _ref.children,
|
|
6228
|
+
onClick = _ref.onClick,
|
|
6229
|
+
_ref$isSelected = _ref.isSelected,
|
|
6230
|
+
isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
|
|
6231
|
+
_ref$actions = _ref.actions,
|
|
6232
|
+
actions = _ref$actions === void 0 ? [] : _ref$actions,
|
|
6233
|
+
_ref$hasDefaultCell = _ref.hasDefaultCell,
|
|
6234
|
+
hasDefaultCell = _ref$hasDefaultCell === void 0 ? true : _ref$hasDefaultCell,
|
|
6235
|
+
testId = _ref.testId,
|
|
6236
|
+
nativeDivProps = _objectWithoutPropertiesLoose(_ref, _excluded$2i);
|
|
6206
6237
|
|
|
6207
|
-
var
|
|
6208
|
-
|
|
6209
|
-
var sortDir = sortDirection || null;
|
|
6210
|
-
return React__default.createElement("div", {
|
|
6211
|
-
style: {
|
|
6212
|
-
display: 'inline-flex',
|
|
6213
|
-
flexDirection: 'column'
|
|
6214
|
-
}
|
|
6215
|
-
}, sortDir !== 'desc' && React__default.createElement(IconChevronUp, {
|
|
6216
|
-
size: "small",
|
|
6217
|
-
color: GREY400
|
|
6218
|
-
}), sortDir !== 'asc' && React__default.createElement("span", {
|
|
6219
|
-
style: {
|
|
6220
|
-
marginTop: '-4px'
|
|
6221
|
-
}
|
|
6222
|
-
}, React__default.createElement(IconChevronDown, {
|
|
6223
|
-
size: "small",
|
|
6224
|
-
color: GREY400
|
|
6225
|
-
})));
|
|
6226
|
-
};
|
|
6238
|
+
var _useDataTableContext = useDataTableContext(),
|
|
6239
|
+
showActionMenu = _useDataTableContext.showActionMenu;
|
|
6227
6240
|
|
|
6228
|
-
var styles$
|
|
6241
|
+
var styleNames = classnames(styles$d['item'], (_classnames = {}, _classnames[styles$d['clickable']] = onClick, _classnames[styles$d['selected']] = isSelected, _classnames));
|
|
6229
6242
|
|
|
6230
|
-
var
|
|
6231
|
-
|
|
6243
|
+
var renderColumn = function renderColumn(columnElement, index) {
|
|
6244
|
+
var isUsingDataTableCell = columnElement && typeof columnElement === 'object' && 'type' in columnElement && (columnElement === null || columnElement === void 0 ? void 0 : columnElement.type) === DataTableCell;
|
|
6232
6245
|
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6246
|
+
if (isUsingDataTableCell || !hasDefaultCell) {
|
|
6247
|
+
return columnElement;
|
|
6248
|
+
}
|
|
6249
|
+
|
|
6250
|
+
var isUsingDataTableEditableCell = columnElement && typeof columnElement === 'object' && 'type' in columnElement && (columnElement === null || columnElement === void 0 ? void 0 : columnElement.type) === DataTableEditableCell;
|
|
6251
|
+
return React__default.createElement(DataTableCell, {
|
|
6252
|
+
key: index,
|
|
6253
|
+
columnIndex: index,
|
|
6254
|
+
noPadding: !!isUsingDataTableEditableCell
|
|
6255
|
+
}, columnElement);
|
|
6256
|
+
};
|
|
6257
|
+
|
|
6258
|
+
return React__default.createElement("tr", Object.assign({}, nativeDivProps, {
|
|
6259
|
+
className: styleNames,
|
|
6260
|
+
onClick: onClick ? onClick : undefined,
|
|
6261
|
+
onKeyPress: onClick ? onClick : undefined,
|
|
6262
|
+
"data-testid": testId && testId + "-row",
|
|
6263
|
+
role: "row",
|
|
6264
|
+
ref: ref
|
|
6265
|
+
}), React__default.Children.toArray(children).filter(Boolean).map(function (child, index) {
|
|
6266
|
+
return renderColumn(child, index);
|
|
6267
|
+
}), showActionMenu && React__default.createElement(DataTableRowActions, {
|
|
6268
|
+
actions: actions,
|
|
6269
|
+
columnIndex: React__default.Children.count(children)
|
|
6240
6270
|
}));
|
|
6241
6271
|
};
|
|
6242
6272
|
|
|
6243
|
-
var
|
|
6273
|
+
var DataTableRow = React.forwardRef(DataTableRowComponent);
|
|
6244
6274
|
|
|
6245
|
-
var
|
|
6246
|
-
var
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
var
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
}
|
|
6255
|
-
|
|
6256
|
-
|
|
6275
|
+
var DataTableDefaultItemComponent = function DataTableDefaultItemComponent(_ref) {
|
|
6276
|
+
var columns = _ref.columns,
|
|
6277
|
+
item = _ref.item,
|
|
6278
|
+
testId = _ref.testId;
|
|
6279
|
+
var headingKeys = columns ? columns.map(function (column) {
|
|
6280
|
+
return column.name;
|
|
6281
|
+
}) : Object.keys(item);
|
|
6282
|
+
var columnsToShow = headingKeys.filter(function (key) {
|
|
6283
|
+
return key !== 'actions';
|
|
6284
|
+
});
|
|
6285
|
+
return React__default.createElement(DataTableRow, {
|
|
6286
|
+
actions: item.actions,
|
|
6287
|
+
testId: testId
|
|
6288
|
+
}, columnsToShow.map(function (headingKey) {
|
|
6289
|
+
return React__default.createElement("div", {
|
|
6290
|
+
key: headingKey
|
|
6291
|
+
}, item[headingKey] || '');
|
|
6292
|
+
}));
|
|
6257
6293
|
};
|
|
6258
6294
|
|
|
6259
6295
|
var DataTable = function DataTable(_ref) {
|
|
@@ -6278,7 +6314,7 @@ var DataTable = function DataTable(_ref) {
|
|
|
6278
6314
|
_ref$hasVerticalBorde = _ref.hasVerticalBorders,
|
|
6279
6315
|
hasVerticalBorders = _ref$hasVerticalBorde === void 0 ? false : _ref$hasVerticalBorde,
|
|
6280
6316
|
testId = _ref.testId;
|
|
6281
|
-
var RowItem = itemComponent ||
|
|
6317
|
+
var RowItem = itemComponent || DataTableDefaultItemComponent;
|
|
6282
6318
|
var conditionalStyles = {};
|
|
6283
6319
|
var isScrollableTable = !!maxHeight;
|
|
6284
6320
|
|
|
@@ -6300,20 +6336,20 @@ var DataTable = function DataTable(_ref) {
|
|
|
6300
6336
|
hasVerticalBorders: hasVerticalBorders
|
|
6301
6337
|
}
|
|
6302
6338
|
}, React__default.createElement("div", {
|
|
6303
|
-
className: classnames(styles$
|
|
6339
|
+
className: classnames(styles$a['data-table'])
|
|
6304
6340
|
}, isShowingColumns && isScrollableTable && React__default.createElement(DataTableScrollFakeBorder, {
|
|
6305
6341
|
placement: "top"
|
|
6306
6342
|
}), React__default.createElement("div", {
|
|
6307
|
-
className: classnames(styles$
|
|
6343
|
+
className: classnames(styles$a['data-table__content'], (_classNames = {}, _classNames[styles$a['data-table__content--with-scroll']] = isScrollableTable, _classNames)),
|
|
6308
6344
|
style: conditionalStyles
|
|
6309
6345
|
}, React__default.createElement("table", {
|
|
6310
|
-
className: classnames(styles$
|
|
6346
|
+
className: classnames(styles$a['data-table__table'], (_classNames2 = {}, _classNames2[styles$a['data-table__table--no-columns']] = !isShowingColumns, _classNames2))
|
|
6311
6347
|
}, columns && isShowingColumns && React__default.createElement(DataTableHeader, {
|
|
6312
6348
|
columns: columns,
|
|
6313
6349
|
onSort: onSort,
|
|
6314
6350
|
showActionMenu: showActionMenu
|
|
6315
6351
|
}), React__default.createElement("tbody", {
|
|
6316
|
-
className: classnames(styles$
|
|
6352
|
+
className: classnames(styles$a['data-table__body'], (_classNames3 = {}, _classNames3[styles$a['data-table__body--no-bottom-radius']] = isShowingFooter, _classNames3)),
|
|
6317
6353
|
"data-testid": testId
|
|
6318
6354
|
}, isLoading && React__default.createElement(DataTableLoadingBlock, {
|
|
6319
6355
|
amountOfColumns: (columns === null || columns === void 0 ? void 0 : columns.length) || 1,
|
|
@@ -6327,12 +6363,12 @@ var DataTable = function DataTable(_ref) {
|
|
|
6327
6363
|
testId: testId
|
|
6328
6364
|
});
|
|
6329
6365
|
})), isShowingFooter && React__default.createElement("tfoot", {
|
|
6330
|
-
className: styles$
|
|
6366
|
+
className: styles$a['data-table__footer'],
|
|
6331
6367
|
"data-testid": testId && testId + "-footer"
|
|
6332
6368
|
}, footerComponent))), !isShowingFooter && isScrollableTable && React__default.createElement(DataTableScrollFakeBorder, {
|
|
6333
6369
|
placement: "bottom"
|
|
6334
6370
|
})), onPreviousClick && onNextClick && (hasPrevious || hasNext) && React__default.createElement("div", {
|
|
6335
|
-
className: styles$
|
|
6371
|
+
className: styles$a['data-table__pagination-controls'],
|
|
6336
6372
|
"data-testid": testId && testId + "-pagination-controls"
|
|
6337
6373
|
}, React__default.createElement(PaginationControls, {
|
|
6338
6374
|
hasPrevious: hasPrevious && !isLoading,
|
|
@@ -6342,26 +6378,6 @@ var DataTable = function DataTable(_ref) {
|
|
|
6342
6378
|
})));
|
|
6343
6379
|
};
|
|
6344
6380
|
|
|
6345
|
-
var DefaultItemComponent = function DefaultItemComponent(_ref2) {
|
|
6346
|
-
var columns = _ref2.columns,
|
|
6347
|
-
item = _ref2.item,
|
|
6348
|
-
testId = _ref2.testId;
|
|
6349
|
-
var headingKeys = columns ? columns.map(function (column) {
|
|
6350
|
-
return column.name;
|
|
6351
|
-
}) : Object.keys(item);
|
|
6352
|
-
var columnsToShow = headingKeys.filter(function (key) {
|
|
6353
|
-
return key !== 'actions';
|
|
6354
|
-
});
|
|
6355
|
-
return React__default.createElement(DataTableRow, {
|
|
6356
|
-
actions: item.actions,
|
|
6357
|
-
testId: testId
|
|
6358
|
-
}, columnsToShow.map(function (headingKey) {
|
|
6359
|
-
return React__default.createElement("div", {
|
|
6360
|
-
key: headingKey
|
|
6361
|
-
}, item[headingKey] || '');
|
|
6362
|
-
}));
|
|
6363
|
-
};
|
|
6364
|
-
|
|
6365
6381
|
var useSelectFieldControllers = function useSelectFieldControllers(_ref) {
|
|
6366
6382
|
var name = _ref.name,
|
|
6367
6383
|
inputId = _ref.id,
|
|
@@ -6457,7 +6473,7 @@ var isReactSelectElement = function isReactSelectElement(element) {
|
|
|
6457
6473
|
return typeof firstOption.id === 'string' && firstOption.id.includes('react-select');
|
|
6458
6474
|
};
|
|
6459
6475
|
|
|
6460
|
-
var styles$
|
|
6476
|
+
var styles$x = {"custom-control":"_1cDCR"};
|
|
6461
6477
|
|
|
6462
6478
|
var _excluded$2j = ["children"];
|
|
6463
6479
|
|
|
@@ -6470,7 +6486,7 @@ function CustomControl(_ref) {
|
|
|
6470
6486
|
var SelectedOptionPrefix = props.selectProps.componentsProps.SelectedOptionPrefix;
|
|
6471
6487
|
var selectedOption = (_props$getValue = props.getValue()) === null || _props$getValue === void 0 ? void 0 : _props$getValue[0];
|
|
6472
6488
|
return React__default.createElement(Select.components.Control, Object.assign({}, props), SelectedOptionPrefix && selectedOption ? React__default.createElement("div", {
|
|
6473
|
-
className: styles$
|
|
6489
|
+
className: styles$x['custom-control'],
|
|
6474
6490
|
style: {
|
|
6475
6491
|
paddingLeft: selectedOption ? 8 : 0
|
|
6476
6492
|
}
|
|
@@ -6499,7 +6515,7 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
6499
6515
|
asToolbarFilter = _ref$asToolbarFilter === void 0 ? false : _ref$asToolbarFilter,
|
|
6500
6516
|
_ref$wrapToNextLine = _ref.wrapToNextLine,
|
|
6501
6517
|
wrapToNextLine = _ref$wrapToNextLine === void 0 ? false : _ref$wrapToNextLine;
|
|
6502
|
-
var borderColor = isInvalid ?
|
|
6518
|
+
var borderColor = isInvalid ? COLORS['radish-400'] : COLORS['grey-200'];
|
|
6503
6519
|
return {
|
|
6504
6520
|
valueContainer: function valueContainer(base) {
|
|
6505
6521
|
return Object.assign({}, base, {
|
|
@@ -6511,16 +6527,16 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
6511
6527
|
flex: '1',
|
|
6512
6528
|
fontFamily: FONT_FAMILY,
|
|
6513
6529
|
minWidth: '110px',
|
|
6514
|
-
backgroundColor: state.isDisabled ?
|
|
6530
|
+
backgroundColor: state.isDisabled ? COLORS['grey-100'] : COLORS['white'],
|
|
6515
6531
|
position: 'initial',
|
|
6516
6532
|
borderRadius: '4px'
|
|
6517
6533
|
});
|
|
6518
6534
|
},
|
|
6519
6535
|
control: function control(base, state) {
|
|
6520
6536
|
return Object.assign({}, base, {
|
|
6521
|
-
borderColor: state.isFocused ?
|
|
6522
|
-
color: state.isDisabled ?
|
|
6523
|
-
boxShadow: state.isFocused ? "0 0 8px " +
|
|
6537
|
+
borderColor: state.isFocused ? COLORS['eggplant-400'] : borderColor,
|
|
6538
|
+
color: state.isDisabled ? COLORS['grey-400'] : COLORS['grey-500'],
|
|
6539
|
+
boxShadow: state.isFocused ? "0 0 8px " + COLORS['eggplant-300'] : 'none',
|
|
6524
6540
|
'&:hover': 'none',
|
|
6525
6541
|
background: 'none',
|
|
6526
6542
|
fontSize: '14px',
|
|
@@ -6528,7 +6544,7 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
6528
6544
|
width: asToolbarFilter ? 'fit-content' : undefined,
|
|
6529
6545
|
margin: 0,
|
|
6530
6546
|
':hover': asToolbarFilter ? {
|
|
6531
|
-
backgroundColor:
|
|
6547
|
+
backgroundColor: COLORS['grey-100']
|
|
6532
6548
|
} : 'none'
|
|
6533
6549
|
});
|
|
6534
6550
|
},
|
|
@@ -6539,7 +6555,7 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
6539
6555
|
},
|
|
6540
6556
|
placeholder: function placeholder(base, state) {
|
|
6541
6557
|
return _extends({}, base, {
|
|
6542
|
-
color: state.isDisabled && asToolbarFilter ?
|
|
6558
|
+
color: state.isDisabled && asToolbarFilter ? COLORS['grey-300'] : COLORS['grey-400'],
|
|
6543
6559
|
marginRight: 0,
|
|
6544
6560
|
position: 'static',
|
|
6545
6561
|
transform: 'initial',
|
|
@@ -6550,7 +6566,7 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
6550
6566
|
},
|
|
6551
6567
|
noOptionsMessage: function noOptionsMessage() {
|
|
6552
6568
|
return {
|
|
6553
|
-
color:
|
|
6569
|
+
color: COLORS['grey-400'],
|
|
6554
6570
|
textAlign: 'center',
|
|
6555
6571
|
padding: '8px',
|
|
6556
6572
|
fontFamily: FONT_FAMILY,
|
|
@@ -6559,7 +6575,7 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
6559
6575
|
},
|
|
6560
6576
|
loadingMessage: function loadingMessage() {
|
|
6561
6577
|
return {
|
|
6562
|
-
color:
|
|
6578
|
+
color: COLORS['grey-400'],
|
|
6563
6579
|
textAlign: 'center',
|
|
6564
6580
|
padding: '8px',
|
|
6565
6581
|
fontFamily: FONT_FAMILY,
|
|
@@ -6568,7 +6584,7 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
6568
6584
|
},
|
|
6569
6585
|
singleValue: function singleValue(base, state) {
|
|
6570
6586
|
return Object.assign({}, base, {
|
|
6571
|
-
color: state.isDisabled ?
|
|
6587
|
+
color: state.isDisabled ? COLORS['grey-400'] : null,
|
|
6572
6588
|
marginRight: 0,
|
|
6573
6589
|
position: asToolbarFilter ? 'static' : 'absolute',
|
|
6574
6590
|
transform: 'initial',
|
|
@@ -6580,15 +6596,15 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
6580
6596
|
},
|
|
6581
6597
|
dropdownIndicator: function dropdownIndicator(base, state) {
|
|
6582
6598
|
return Object.assign({}, base, {
|
|
6583
|
-
color: state.isDisabled ?
|
|
6599
|
+
color: state.isDisabled ? COLORS['grey-300'] : COLORS['grey-400'],
|
|
6584
6600
|
padding: '8px',
|
|
6585
6601
|
':hover': 'none'
|
|
6586
6602
|
});
|
|
6587
6603
|
},
|
|
6588
6604
|
option: function option(base, state) {
|
|
6589
6605
|
return Object.assign({}, base, {
|
|
6590
|
-
backgroundColor: state.isDisabled ? null : state.isSelected ?
|
|
6591
|
-
color: state.isDisabled ?
|
|
6606
|
+
backgroundColor: state.isDisabled ? null : state.isSelected ? COLORS['eggplant-200'] : state.isFocused ? COLORS['grey-100'] : COLORS['white'],
|
|
6607
|
+
color: state.isDisabled ? COLORS['grey-400'] : state.isSelected ? COLORS['eggplant-600'] : COLORS['grey-500'],
|
|
6592
6608
|
cursor: 'pointer',
|
|
6593
6609
|
fontFamily: FONT_FAMILY,
|
|
6594
6610
|
fontSize: '14px',
|
|
@@ -6604,15 +6620,15 @@ var getSelectStyles = function getSelectStyles(_ref) {
|
|
|
6604
6620
|
return Object.assign({}, base, {
|
|
6605
6621
|
':hover': {
|
|
6606
6622
|
backgroundColor: 'none',
|
|
6607
|
-
color:
|
|
6623
|
+
color: COLORS['grey-500']
|
|
6608
6624
|
}
|
|
6609
6625
|
});
|
|
6610
6626
|
},
|
|
6611
6627
|
clearIndicator: function clearIndicator(base) {
|
|
6612
6628
|
return Object.assign({}, base, {
|
|
6613
|
-
color:
|
|
6629
|
+
color: COLORS['grey-400'],
|
|
6614
6630
|
':hover': {
|
|
6615
|
-
color:
|
|
6631
|
+
color: COLORS['grey-500']
|
|
6616
6632
|
}
|
|
6617
6633
|
});
|
|
6618
6634
|
},
|
|
@@ -6638,7 +6654,7 @@ var CustomContainer = function CustomContainer(props) {
|
|
|
6638
6654
|
}));
|
|
6639
6655
|
};
|
|
6640
6656
|
|
|
6641
|
-
var styles$
|
|
6657
|
+
var styles$y = {"custom-menu-text-field":"_2-zhH","custom-menu-hr":"_3sdnK","custom-menu-div":"_2F1jP"};
|
|
6642
6658
|
|
|
6643
6659
|
var _excluded$2l = ["children"];
|
|
6644
6660
|
|
|
@@ -6708,15 +6724,15 @@ function CustomMenu(_ref) {
|
|
|
6708
6724
|
return React__default.createElement(Select.components.Menu, Object.assign({}, props), React__default.createElement("div", {
|
|
6709
6725
|
ref: containerRef
|
|
6710
6726
|
}, children, React__default.createElement("hr", {
|
|
6711
|
-
className: styles$
|
|
6727
|
+
className: styles$y['custom-menu-hr']
|
|
6712
6728
|
}), !showFooter ? React__default.createElement(CreatableButton, null) : React__default.createElement("div", {
|
|
6713
|
-
className: styles$
|
|
6729
|
+
className: styles$y['custom-menu-div']
|
|
6714
6730
|
}, React__default.createElement(Flex, {
|
|
6715
6731
|
space: 4,
|
|
6716
6732
|
flex: [1],
|
|
6717
6733
|
flexItems: true
|
|
6718
6734
|
}, React__default.createElement("input", {
|
|
6719
|
-
className: classnames(textFieldStyles['text-field'], styles$
|
|
6735
|
+
className: classnames(textFieldStyles['text-field'], styles$y['custom-menu-text-field']),
|
|
6720
6736
|
autoCorrect: "off",
|
|
6721
6737
|
autoComplete: "off",
|
|
6722
6738
|
spellCheck: "false",
|
|
@@ -6899,9 +6915,9 @@ var ToolbarSelect = function ToolbarSelect(_ref) {
|
|
|
6899
6915
|
});
|
|
6900
6916
|
};
|
|
6901
6917
|
|
|
6902
|
-
var styles$
|
|
6918
|
+
var styles$z = {"date-filter":"_2X-yg","date-filter--wide":"_3O5Kh"};
|
|
6903
6919
|
|
|
6904
|
-
var styles$
|
|
6920
|
+
var styles$A = {"date-filter-display":"_23gnr","date-filter-display--non-interactive":"_Zv1Se","date-filter-display--wide":"_18V8V","date-filter-display__display-icon":"_2v9v_"};
|
|
6905
6921
|
|
|
6906
6922
|
var DATE_FILTER_MODE = {
|
|
6907
6923
|
DAY: 'day',
|
|
@@ -6945,7 +6961,7 @@ var DateFilterText = function DateFilterText(_ref) {
|
|
|
6945
6961
|
space: 12
|
|
6946
6962
|
}, React__default.createElement("span", null, getDateString(weekRange.start, mode)), React__default.createElement(IconArrowRight, {
|
|
6947
6963
|
size: "small",
|
|
6948
|
-
color:
|
|
6964
|
+
color: "grey-400"
|
|
6949
6965
|
}), React__default.createElement("span", null, getDateString(weekRange.end, mode)));
|
|
6950
6966
|
|
|
6951
6967
|
default:
|
|
@@ -6961,17 +6977,17 @@ var DateFilterDisplay = function DateFilterDisplay(_ref) {
|
|
|
6961
6977
|
weekStart = _ref.weekStart,
|
|
6962
6978
|
onClick = _ref.onClick;
|
|
6963
6979
|
return React__default.createElement("button", {
|
|
6964
|
-
className: classnames(styles$
|
|
6980
|
+
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)),
|
|
6965
6981
|
onClick: onClick,
|
|
6966
6982
|
tabIndex: mode === DATE_FILTER_MODE.MONTH ? -1 : undefined
|
|
6967
6983
|
}, React__default.createElement(Inline, {
|
|
6968
6984
|
space: 12,
|
|
6969
6985
|
alignItems: "center"
|
|
6970
6986
|
}, React__default.createElement("div", {
|
|
6971
|
-
className: classnames(styles$
|
|
6987
|
+
className: classnames(styles$A['date-filter-display__display-icon'])
|
|
6972
6988
|
}, React__default.createElement(IconCalendarAlt, {
|
|
6973
6989
|
size: "flexible",
|
|
6974
|
-
color:
|
|
6990
|
+
color: "grey-400"
|
|
6975
6991
|
})), React__default.createElement(DateFilterText, {
|
|
6976
6992
|
mode: mode,
|
|
6977
6993
|
selectedDate: selectedDate,
|
|
@@ -6979,7 +6995,7 @@ var DateFilterDisplay = function DateFilterDisplay(_ref) {
|
|
|
6979
6995
|
})));
|
|
6980
6996
|
};
|
|
6981
6997
|
|
|
6982
|
-
var styles$
|
|
6998
|
+
var styles$B = {"date-stepper":"_s8MoI","date-stepper--backward":"_34Yoi","date-stepper--forward":"_BeWpb"};
|
|
6983
6999
|
|
|
6984
7000
|
var handleDateStepper = function handleDateStepper(date, mode, stepDirection, onChange) {
|
|
6985
7001
|
var step = stepDirection === STEP_DIRECTION.FORWARD ? 1 : -1;
|
|
@@ -7014,7 +7030,7 @@ var DateFilterStepper = function DateFilterStepper(_ref) {
|
|
|
7014
7030
|
onChange = _ref.onChange,
|
|
7015
7031
|
date = _ref.date;
|
|
7016
7032
|
return React__default.createElement("button", {
|
|
7017
|
-
className: classnames(styles$
|
|
7033
|
+
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)),
|
|
7018
7034
|
onClick: function onClick() {
|
|
7019
7035
|
return handleDateStepper(date, mode, stepDirection, onChange);
|
|
7020
7036
|
}
|
|
@@ -7050,7 +7066,7 @@ var DateFilter = function DateFilter(_ref) {
|
|
|
7050
7066
|
return React__default.createElement("div", {
|
|
7051
7067
|
"data-testid": testId,
|
|
7052
7068
|
ref: calendarAnchorRef,
|
|
7053
|
-
className: classnames(styles$
|
|
7069
|
+
className: classnames(styles$z['date-filter'], (_classnames = {}, _classnames[styles$z['date-filter--wide']] = mode === DATE_FILTER_MODE.WEEK, _classnames))
|
|
7054
7070
|
}, React__default.createElement(Inline, {
|
|
7055
7071
|
space: 0
|
|
7056
7072
|
}, React__default.createElement(DateFilterStepper, {
|
|
@@ -7060,7 +7076,7 @@ var DateFilter = function DateFilter(_ref) {
|
|
|
7060
7076
|
onChange: handleChange
|
|
7061
7077
|
}, React__default.createElement(IconChevronLeft, {
|
|
7062
7078
|
size: "small",
|
|
7063
|
-
color:
|
|
7079
|
+
color: "grey-400"
|
|
7064
7080
|
})), React__default.createElement(DateFilterDisplay, {
|
|
7065
7081
|
mode: mode,
|
|
7066
7082
|
weekStart: weekStart,
|
|
@@ -7077,7 +7093,7 @@ var DateFilter = function DateFilter(_ref) {
|
|
|
7077
7093
|
onChange: handleChange
|
|
7078
7094
|
}, React__default.createElement(IconChevronRight, {
|
|
7079
7095
|
size: "small",
|
|
7080
|
-
color:
|
|
7096
|
+
color: "grey-400"
|
|
7081
7097
|
}))), calendarOpen && mode !== DATE_FILTER_MODE.MONTH && React__default.createElement(Calendar, {
|
|
7082
7098
|
onSelect: handleChange,
|
|
7083
7099
|
selected: date,
|
|
@@ -7091,7 +7107,7 @@ var DateFilter = function DateFilter(_ref) {
|
|
|
7091
7107
|
}));
|
|
7092
7108
|
};
|
|
7093
7109
|
|
|
7094
|
-
var styles$
|
|
7110
|
+
var styles$C = {"segmented-control":"_J5ph7","segmented-control__button":"_2xgv4","segmented-control__button--selected":"_1vG3O","segmented-control__divider":"_1uKNF"};
|
|
7095
7111
|
|
|
7096
7112
|
var SegmentedControl = function SegmentedControl(_ref) {
|
|
7097
7113
|
var options = _ref.options,
|
|
@@ -7108,7 +7124,7 @@ var SegmentedControl = function SegmentedControl(_ref) {
|
|
|
7108
7124
|
};
|
|
7109
7125
|
|
|
7110
7126
|
return React__default.createElement("div", {
|
|
7111
|
-
className: styles$
|
|
7127
|
+
className: styles$C['segmented-control'],
|
|
7112
7128
|
"data-testid": testId
|
|
7113
7129
|
}, options.map(function (option, i) {
|
|
7114
7130
|
var _classnames;
|
|
@@ -7119,16 +7135,16 @@ var SegmentedControl = function SegmentedControl(_ref) {
|
|
|
7119
7135
|
onClick: function onClick() {
|
|
7120
7136
|
return onChange(option);
|
|
7121
7137
|
},
|
|
7122
|
-
className: classnames(styles$
|
|
7138
|
+
className: classnames(styles$C['segmented-control__button'], (_classnames = {}, _classnames[styles$C['segmented-control__button--selected']] = isSelected(option), _classnames))
|
|
7123
7139
|
}, option), !isLastElement(i) && React__default.createElement("div", {
|
|
7124
|
-
className: classnames(styles$
|
|
7140
|
+
className: classnames(styles$C['segmented-control__divider'])
|
|
7125
7141
|
}));
|
|
7126
7142
|
}));
|
|
7127
7143
|
};
|
|
7128
7144
|
|
|
7129
|
-
var styles$
|
|
7145
|
+
var styles$D = {"form--standard-size":"_3CaV0"};
|
|
7130
7146
|
|
|
7131
|
-
var styles$
|
|
7147
|
+
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"};
|
|
7132
7148
|
|
|
7133
7149
|
var _excluded$2m = ["children", "onClick", "isSelected", "actions", "testId"];
|
|
7134
7150
|
|
|
@@ -7145,18 +7161,18 @@ var Card = function Card(_ref) {
|
|
|
7145
7161
|
|
|
7146
7162
|
var positionStyles = usePositionStyles(positionProps);
|
|
7147
7163
|
return React__default.createElement("div", {
|
|
7148
|
-
className: classnames(styles$
|
|
7164
|
+
className: classnames(styles$E['card']),
|
|
7149
7165
|
style: positionStyles
|
|
7150
7166
|
}, onClick ? React__default.createElement("button", {
|
|
7151
|
-
className: classnames(styles$
|
|
7167
|
+
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)),
|
|
7152
7168
|
"data-testid": testId,
|
|
7153
7169
|
tabIndex: 0,
|
|
7154
7170
|
onClick: onClick
|
|
7155
7171
|
}, children) : React__default.createElement("div", {
|
|
7156
|
-
className: classnames(styles$
|
|
7172
|
+
className: classnames(styles$E['card__body'], (_classnames2 = {}, _classnames2[styles$E['card__body--focus']] = isSelected, _classnames2[styles$E['card__body--with-kebab']] = actions, _classnames2)),
|
|
7157
7173
|
"data-testid": testId
|
|
7158
7174
|
}, children), actions && React__default.createElement("div", {
|
|
7159
|
-
className: classnames(styles$
|
|
7175
|
+
className: classnames(styles$E['card__kebab'])
|
|
7160
7176
|
}, React__default.createElement(KebabMenu, {
|
|
7161
7177
|
actions: actions
|
|
7162
7178
|
})));
|
|
@@ -7170,7 +7186,7 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
|
|
|
7170
7186
|
}, children);
|
|
7171
7187
|
};
|
|
7172
7188
|
|
|
7173
|
-
var styles$
|
|
7189
|
+
var styles$F = {"breadcrumb-item":"_XFvYB"};
|
|
7174
7190
|
|
|
7175
7191
|
var BreadcrumbItem = function BreadcrumbItem(_ref) {
|
|
7176
7192
|
var href = _ref.href,
|
|
@@ -7183,24 +7199,24 @@ var BreadcrumbItem = function BreadcrumbItem(_ref) {
|
|
|
7183
7199
|
}), children);
|
|
7184
7200
|
return reloadDocument ? React__default.createElement("a", {
|
|
7185
7201
|
href: href,
|
|
7186
|
-
className: styles$
|
|
7202
|
+
className: styles$F['breadcrumb-item'],
|
|
7187
7203
|
"data-testid": testId
|
|
7188
7204
|
}, content) : React__default.createElement(reactRouterDom.Link, {
|
|
7189
7205
|
to: href,
|
|
7190
|
-
className: styles$
|
|
7206
|
+
className: styles$F['breadcrumb-item'],
|
|
7191
7207
|
relative: "path",
|
|
7192
7208
|
reloadDocument: reloadDocument,
|
|
7193
7209
|
"data-testid": testId
|
|
7194
7210
|
}, content);
|
|
7195
7211
|
};
|
|
7196
7212
|
|
|
7197
|
-
var styles$
|
|
7213
|
+
var styles$G = {"page-breadcrumbs":"_HAJCd"};
|
|
7198
7214
|
|
|
7199
7215
|
var PageBreadcrumbs = function PageBreadcrumbs(_ref) {
|
|
7200
7216
|
var breadcrumbs = _ref.breadcrumbs;
|
|
7201
7217
|
var items = getBreadbrumbItems(breadcrumbs);
|
|
7202
7218
|
return React__default.createElement("div", {
|
|
7203
|
-
className: styles$
|
|
7219
|
+
className: styles$G['page-breadcrumbs']
|
|
7204
7220
|
}, React__default.createElement(Breadcrumbs, null, items));
|
|
7205
7221
|
};
|
|
7206
7222
|
|
|
@@ -7225,7 +7241,7 @@ var getBreadbrumbItems = function getBreadbrumbItems(breadcrumbs) {
|
|
|
7225
7241
|
}, breadcrumbs.label);
|
|
7226
7242
|
};
|
|
7227
7243
|
|
|
7228
|
-
var styles$
|
|
7244
|
+
var styles$H = {"page":"_FbhTM","page--fullwidth":"_3QyAE","page--restricted":"_17aOG"};
|
|
7229
7245
|
|
|
7230
7246
|
var PAGE_SIZES = {
|
|
7231
7247
|
FULL_WIDTH: 'fullwidth',
|
|
@@ -7248,7 +7264,7 @@ var Page = function Page(_ref) {
|
|
|
7248
7264
|
var hasHeader = title || actions;
|
|
7249
7265
|
var hasPageBlocks = hasHeader || banner || filterBar;
|
|
7250
7266
|
return React__default.createElement("div", {
|
|
7251
|
-
className: classnames(styles$
|
|
7267
|
+
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)),
|
|
7252
7268
|
"data-testid": testId
|
|
7253
7269
|
}, React__default.createElement(Stack, {
|
|
7254
7270
|
space: 20
|
|
@@ -7268,7 +7284,7 @@ var Page = function Page(_ref) {
|
|
|
7268
7284
|
}, title), actions), subtitle && React__default.createElement(Text, null, subtitle)), banner, filterBar)), children));
|
|
7269
7285
|
};
|
|
7270
7286
|
|
|
7271
|
-
var styles$
|
|
7287
|
+
var styles$I = {"form-section":"_7-5gD","form-section__title":"_a83vM","form-section__subtitle":"_1lKv8","form-section--no-margin":"_lZyFQ"};
|
|
7272
7288
|
|
|
7273
7289
|
var FormSection = function FormSection(_ref) {
|
|
7274
7290
|
var _classnames;
|
|
@@ -7280,14 +7296,14 @@ var FormSection = function FormSection(_ref) {
|
|
|
7280
7296
|
noMargin = _ref$noMargin === void 0 ? false : _ref$noMargin,
|
|
7281
7297
|
testId = _ref.testId;
|
|
7282
7298
|
return React__default.createElement("div", {
|
|
7283
|
-
className: classnames(styles$
|
|
7299
|
+
className: classnames(styles$I['form-section'], (_classnames = {}, _classnames[styles$I['form-section--no-margin']] = noMargin, _classnames)),
|
|
7284
7300
|
"data-testid": testId
|
|
7285
7301
|
}, React__default.createElement(Stack, null, React__default.createElement(Stack, {
|
|
7286
7302
|
space: 8
|
|
7287
7303
|
}, title && React__default.createElement("h2", {
|
|
7288
|
-
className: classnames(styles$
|
|
7304
|
+
className: classnames(styles$I['form-section__title'])
|
|
7289
7305
|
}, title), subtitle && React__default.createElement("h3", {
|
|
7290
|
-
className: classnames(styles$
|
|
7306
|
+
className: classnames(styles$I['form-section__subtitle'])
|
|
7291
7307
|
}, subtitle)), children));
|
|
7292
7308
|
};
|
|
7293
7309
|
|
|
@@ -7305,7 +7321,7 @@ var updateButtonProps$1 = function updateButtonProps(child, newProps) {
|
|
|
7305
7321
|
}, newProps, child.props));
|
|
7306
7322
|
};
|
|
7307
7323
|
|
|
7308
|
-
var styles$
|
|
7324
|
+
var styles$J = {"form-footer":"_3vVBF"};
|
|
7309
7325
|
|
|
7310
7326
|
var FormFooterActions = function FormFooterActions(_ref) {
|
|
7311
7327
|
var _actions$primary, _actions$secondary, _actions$tertiary;
|
|
@@ -7340,7 +7356,7 @@ var FormFooter = function FormFooter(_ref) {
|
|
|
7340
7356
|
});
|
|
7341
7357
|
var isInlineChildren = React__default.Children.count(children) === 1 && React__default.isValidElement(children) && children.type === Inline;
|
|
7342
7358
|
return React__default.createElement("div", {
|
|
7343
|
-
className: classnames(styles$
|
|
7359
|
+
className: classnames(styles$J['form-footer']),
|
|
7344
7360
|
"data-testid": testId
|
|
7345
7361
|
}, actions && React__default.createElement(FormFooterActions, {
|
|
7346
7362
|
actions: actions
|
|
@@ -7382,12 +7398,12 @@ var Form = function Form(_ref) {
|
|
|
7382
7398
|
}
|
|
7383
7399
|
}, React__default.createElement("form", {
|
|
7384
7400
|
onSubmit: onSubmit ? handleSubmit : formik === null || formik === void 0 ? void 0 : formik.handleSubmit,
|
|
7385
|
-
className: classnames((_classnames = {}, _classnames[styles$
|
|
7401
|
+
className: classnames((_classnames = {}, _classnames[styles$D['form--standard-size']] = !wide, _classnames)),
|
|
7386
7402
|
"data-testid": testId
|
|
7387
7403
|
}, stackContent ? React__default.createElement(Stack, null, formattedChildren) : formattedChildren));
|
|
7388
7404
|
};
|
|
7389
7405
|
|
|
7390
|
-
var styles$
|
|
7406
|
+
var styles$K = {"form-row":"_2i-Ll"};
|
|
7391
7407
|
|
|
7392
7408
|
var SIZE_25_PERCENT = '25%';
|
|
7393
7409
|
var SIZE_33_PERCENT = '33.333%';
|
|
@@ -7418,7 +7434,7 @@ var FormRow = function FormRow(_ref) {
|
|
|
7418
7434
|
space: 20,
|
|
7419
7435
|
testId: testId,
|
|
7420
7436
|
alignItems: "stretch",
|
|
7421
|
-
extraClass: styles$
|
|
7437
|
+
extraClass: styles$K['form-row']
|
|
7422
7438
|
}, children, additionalColumns.map(function (_, index) {
|
|
7423
7439
|
return React__default.createElement("span", {
|
|
7424
7440
|
key: index,
|
|
@@ -7427,7 +7443,7 @@ var FormRow = function FormRow(_ref) {
|
|
|
7427
7443
|
}));
|
|
7428
7444
|
};
|
|
7429
7445
|
|
|
7430
|
-
var styles$
|
|
7446
|
+
var styles$L = {"text-field":"_BkzdC","text-field--focus":"_Rop31","text-field--disabled":"_2x3Cm","text-field--invalid":"_3zOwV","text-field__toolbar":"_rQqnL"};
|
|
7431
7447
|
|
|
7432
7448
|
var useGrowTextAreaRef = function useGrowTextAreaRef(minHeight, maxHeight, autoGrow, forwardedRef) {
|
|
7433
7449
|
var textareaRef = React.useRef(null);
|
|
@@ -7503,7 +7519,7 @@ var TextAreaField = function TextAreaField(_ref) {
|
|
|
7503
7519
|
updateHeight = _useGrowTextAreaRef.updateHeight;
|
|
7504
7520
|
|
|
7505
7521
|
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement("div", {
|
|
7506
|
-
className: classnames(styles$
|
|
7522
|
+
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)),
|
|
7507
7523
|
ref: containerRef,
|
|
7508
7524
|
onClick: function onClick(event) {
|
|
7509
7525
|
if (event.target === (containerRef === null || containerRef === void 0 ? void 0 : containerRef.current)) {
|
|
@@ -7535,7 +7551,7 @@ var TextAreaField = function TextAreaField(_ref) {
|
|
|
7535
7551
|
},
|
|
7536
7552
|
ref: textAreaRef
|
|
7537
7553
|
}), toolbar && React__default.createElement("div", {
|
|
7538
|
-
className: styles$
|
|
7554
|
+
className: styles$L['text-field__toolbar'],
|
|
7539
7555
|
id: controllers.id + "-toolbar",
|
|
7540
7556
|
ref: toolbarRef,
|
|
7541
7557
|
onClick: function onClick(event) {
|
|
@@ -7615,7 +7631,7 @@ var useCheckBoxFieldControllers = function useCheckBoxFieldControllers(_ref) {
|
|
|
7615
7631
|
return controllers;
|
|
7616
7632
|
};
|
|
7617
7633
|
|
|
7618
|
-
var styles$
|
|
7634
|
+
var styles$M = {"check-box-field":"_2sg0c","check-box-field__caption":"_2LdrP","check-box-field__custom-input":"_2mA8e"};
|
|
7619
7635
|
|
|
7620
7636
|
var CheckboxField = function CheckboxField(_ref) {
|
|
7621
7637
|
var name = _ref.name,
|
|
@@ -7645,7 +7661,7 @@ var CheckboxField = function CheckboxField(_ref) {
|
|
|
7645
7661
|
flexItems: true,
|
|
7646
7662
|
flex: ['0 0 auto']
|
|
7647
7663
|
}, React__default.createElement("div", {
|
|
7648
|
-
className: styles$
|
|
7664
|
+
className: styles$M['check-box-field']
|
|
7649
7665
|
}, React__default.createElement("input", {
|
|
7650
7666
|
name: name,
|
|
7651
7667
|
id: controllers.id,
|
|
@@ -7658,12 +7674,12 @@ var CheckboxField = function CheckboxField(_ref) {
|
|
|
7658
7674
|
onChange: controllers.onChange,
|
|
7659
7675
|
onBlur: controllers.onBlur
|
|
7660
7676
|
}), React__default.createElement("span", {
|
|
7661
|
-
className: styles$
|
|
7677
|
+
className: styles$M['check-box-field__custom-input']
|
|
7662
7678
|
})), label && React__default.createElement(Label, {
|
|
7663
7679
|
htmlFor: controllers.id,
|
|
7664
7680
|
truncate: false
|
|
7665
7681
|
}, label)), caption && React__default.createElement("div", {
|
|
7666
|
-
className: styles$
|
|
7682
|
+
className: styles$M['check-box-field__caption']
|
|
7667
7683
|
}, React__default.createElement(Caption, {
|
|
7668
7684
|
fieldId: controllers.id
|
|
7669
7685
|
}, caption)), controllers.error && React__default.createElement(ErrorMessage, {
|
|
@@ -7671,7 +7687,7 @@ var CheckboxField = function CheckboxField(_ref) {
|
|
|
7671
7687
|
}, controllers.error));
|
|
7672
7688
|
};
|
|
7673
7689
|
|
|
7674
|
-
var styles$
|
|
7690
|
+
var styles$N = {"pill-select-field":"_g6T-p","pill-select-field__custom-input":"_1i2AX"};
|
|
7675
7691
|
|
|
7676
7692
|
var useMultiSelectFieldControllers = function useMultiSelectFieldControllers(_ref) {
|
|
7677
7693
|
var name = _ref.name,
|
|
@@ -7763,7 +7779,7 @@ var PillSelectField = function PillSelectField(_ref) {
|
|
|
7763
7779
|
var itemId = controllers.id + "-" + itemIdentifier;
|
|
7764
7780
|
return React__default.createElement("div", {
|
|
7765
7781
|
key: itemIdentifier,
|
|
7766
|
-
className: styles$
|
|
7782
|
+
className: styles$N['pill-select-field']
|
|
7767
7783
|
}, React__default.createElement("input", {
|
|
7768
7784
|
name: name + "-" + itemIdentifier,
|
|
7769
7785
|
id: itemId,
|
|
@@ -7785,7 +7801,7 @@ var PillSelectField = function PillSelectField(_ref) {
|
|
|
7785
7801
|
controllers.onChange(newValue);
|
|
7786
7802
|
}
|
|
7787
7803
|
}), React__default.createElement("span", {
|
|
7788
|
-
className: styles$
|
|
7804
|
+
className: styles$N['pill-select-field__custom-input']
|
|
7789
7805
|
}, option.label));
|
|
7790
7806
|
})));
|
|
7791
7807
|
};
|
|
@@ -7833,9 +7849,9 @@ var useRadioGroupFieldContext = function useRadioGroupFieldContext() {
|
|
|
7833
7849
|
return context;
|
|
7834
7850
|
};
|
|
7835
7851
|
|
|
7836
|
-
var styles$
|
|
7852
|
+
var styles$O = {"label":"_1WGz2","label--truncate":"_mQ9Rd","radio-group-field__label":"_RXyG_"};
|
|
7837
7853
|
|
|
7838
|
-
var styles$
|
|
7854
|
+
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"};
|
|
7839
7855
|
|
|
7840
7856
|
var RadioGroupBoxOption = function RadioGroupBoxOption(_ref) {
|
|
7841
7857
|
var value = _ref.value,
|
|
@@ -7850,7 +7866,7 @@ var RadioGroupBoxOption = function RadioGroupBoxOption(_ref) {
|
|
|
7850
7866
|
id: inputId
|
|
7851
7867
|
});
|
|
7852
7868
|
return React__default.createElement("label", {
|
|
7853
|
-
className: styles$
|
|
7869
|
+
className: styles$P['radio-group-box-option']
|
|
7854
7870
|
}, React__default.createElement("input", {
|
|
7855
7871
|
type: "radio",
|
|
7856
7872
|
"data-testid": testId,
|
|
@@ -7861,7 +7877,7 @@ var RadioGroupBoxOption = function RadioGroupBoxOption(_ref) {
|
|
|
7861
7877
|
checked: radioGroupContext.value !== undefined ? radioGroupContext.value === value : undefined,
|
|
7862
7878
|
disabled: radioGroupContext.disabled
|
|
7863
7879
|
}), React__default.createElement("div", {
|
|
7864
|
-
className: styles$
|
|
7880
|
+
className: styles$P['radio-group-box-option__box']
|
|
7865
7881
|
}, React__default.createElement(Stack, {
|
|
7866
7882
|
space: 16,
|
|
7867
7883
|
alignItems: "center",
|
|
@@ -7870,13 +7886,13 @@ var RadioGroupBoxOption = function RadioGroupBoxOption(_ref) {
|
|
|
7870
7886
|
space: 8,
|
|
7871
7887
|
alignItems: "center"
|
|
7872
7888
|
}, label && React__default.createElement("div", {
|
|
7873
|
-
className: styles$
|
|
7889
|
+
className: styles$P['radio-group-box-option__label']
|
|
7874
7890
|
}, label), caption && React__default.createElement(Caption, {
|
|
7875
7891
|
fieldId: id
|
|
7876
7892
|
}, caption)))));
|
|
7877
7893
|
};
|
|
7878
7894
|
|
|
7879
|
-
var styles$
|
|
7895
|
+
var styles$Q = {"radio-group-option":"_1Clmp","radio-group-option__caption":"_3UmWA","radio-group-option__custom-input":"_1tMq-"};
|
|
7880
7896
|
|
|
7881
7897
|
var RadioGroupOption = function RadioGroupOption(_ref) {
|
|
7882
7898
|
var value = _ref.value,
|
|
@@ -7895,7 +7911,7 @@ var RadioGroupOption = function RadioGroupOption(_ref) {
|
|
|
7895
7911
|
space: 8,
|
|
7896
7912
|
alignItems: "center"
|
|
7897
7913
|
}, React__default.createElement("div", {
|
|
7898
|
-
className: styles$
|
|
7914
|
+
className: styles$Q['radio-group-option']
|
|
7899
7915
|
}, React__default.createElement("input", {
|
|
7900
7916
|
type: "radio",
|
|
7901
7917
|
"data-testid": testId,
|
|
@@ -7906,11 +7922,11 @@ var RadioGroupOption = function RadioGroupOption(_ref) {
|
|
|
7906
7922
|
checked: radioGroupContext.value !== undefined ? radioGroupContext.value === value : undefined,
|
|
7907
7923
|
disabled: radioGroupContext.disabled
|
|
7908
7924
|
}), React__default.createElement("span", {
|
|
7909
|
-
className: styles$
|
|
7925
|
+
className: styles$Q['radio-group-option__custom-input']
|
|
7910
7926
|
})), label && React__default.createElement(Label, {
|
|
7911
7927
|
htmlFor: id
|
|
7912
7928
|
}, label)), caption && React__default.createElement("div", {
|
|
7913
|
-
className: styles$
|
|
7929
|
+
className: styles$Q['radio-group-option__caption']
|
|
7914
7930
|
}, React__default.createElement(Caption, {
|
|
7915
7931
|
fieldId: id
|
|
7916
7932
|
}, caption)));
|
|
@@ -8045,7 +8061,7 @@ var RadioGroupField = function RadioGroupField(_ref) {
|
|
|
8045
8061
|
}, React__default.createElement(Stack, {
|
|
8046
8062
|
space: 12
|
|
8047
8063
|
}, label && React__default.createElement("div", {
|
|
8048
|
-
className: styles$
|
|
8064
|
+
className: styles$O['radio-group-field__label']
|
|
8049
8065
|
}, label), React__default.createElement(Stack, {
|
|
8050
8066
|
space: 8
|
|
8051
8067
|
}, optionsType === OPTION_TYPES.RADIO ? React__default.createElement(RadioOptions, {
|
|
@@ -8058,9 +8074,9 @@ var RadioGroupField = function RadioGroupField(_ref) {
|
|
|
8058
8074
|
}, children), controllers.error && React__default.createElement(ErrorMessage, null, controllers.error))));
|
|
8059
8075
|
};
|
|
8060
8076
|
|
|
8061
|
-
var styles$
|
|
8077
|
+
var styles$R = {"text-field":"_18Rzv","text-field--invalid":"_3eD7t","text-field--prefixed":"_2evrG","text-field--suffixed":"_-MgeO","password-container":"_-Rf3c","password-toggle":"_yinPY"};
|
|
8062
8078
|
|
|
8063
|
-
var styles$
|
|
8079
|
+
var styles$S = {"password-criteria":"_U0krC","password-criteria--invalid":"_2XIl4"};
|
|
8064
8080
|
|
|
8065
8081
|
var PasswordCriteria = function PasswordCriteria(_ref) {
|
|
8066
8082
|
var _classnames;
|
|
@@ -8068,12 +8084,12 @@ var PasswordCriteria = function PasswordCriteria(_ref) {
|
|
|
8068
8084
|
var met = _ref.met,
|
|
8069
8085
|
children = _ref.children;
|
|
8070
8086
|
return React__default.createElement("span", {
|
|
8071
|
-
className: classnames(styles$
|
|
8087
|
+
className: classnames(styles$S['password-criteria'], (_classnames = {}, _classnames[styles$S['password-criteria--invalid']] = !met, _classnames))
|
|
8072
8088
|
}, React__default.createElement(Inline, {
|
|
8073
8089
|
space: met ? 4 : 8
|
|
8074
8090
|
}, met ? React__default.createElement(IconCheck, {
|
|
8075
8091
|
size: "small",
|
|
8076
|
-
color:
|
|
8092
|
+
color: "grey-200"
|
|
8077
8093
|
}) : "\u25CF", children));
|
|
8078
8094
|
};
|
|
8079
8095
|
|
|
@@ -8153,11 +8169,11 @@ var PasswordField = function PasswordField(_ref) {
|
|
|
8153
8169
|
error: controllers.error
|
|
8154
8170
|
};
|
|
8155
8171
|
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement("div", {
|
|
8156
|
-
className: styles$
|
|
8172
|
+
className: styles$R['password-container']
|
|
8157
8173
|
}, React__default.createElement("input", {
|
|
8158
8174
|
name: name,
|
|
8159
8175
|
id: controllers.id,
|
|
8160
|
-
className: classnames(styles$
|
|
8176
|
+
className: classnames(styles$R['text-field'], (_classnames = {}, _classnames[styles$R['text-field--invalid']] = hasError, _classnames)),
|
|
8161
8177
|
type: type,
|
|
8162
8178
|
"data-testid": testId,
|
|
8163
8179
|
"aria-describedby": hasError ? controllers.id + "-error-message" : controllers.id + "-describer",
|
|
@@ -8169,16 +8185,16 @@ var PasswordField = function PasswordField(_ref) {
|
|
|
8169
8185
|
onChange: controllers.onChange,
|
|
8170
8186
|
onBlur: controllers.onBlur
|
|
8171
8187
|
}), React__default.createElement("div", {
|
|
8172
|
-
className: styles$
|
|
8188
|
+
className: styles$R['password-toggle'],
|
|
8173
8189
|
onClick: toggleType,
|
|
8174
8190
|
onKeyPress: toggleType,
|
|
8175
8191
|
"data-testid": testId && testId + "-toggle",
|
|
8176
8192
|
tabIndex: 0,
|
|
8177
8193
|
role: "button"
|
|
8178
8194
|
}, type === 'password' ? React__default.createElement(IconEyeSlash, {
|
|
8179
|
-
color:
|
|
8195
|
+
color: "grey-400"
|
|
8180
8196
|
}) : React__default.createElement(IconEye, {
|
|
8181
|
-
color:
|
|
8197
|
+
color: "grey-400"
|
|
8182
8198
|
}))));
|
|
8183
8199
|
};
|
|
8184
8200
|
|
|
@@ -8260,7 +8276,7 @@ var MultiSelectField = function MultiSelectField(_ref) {
|
|
|
8260
8276
|
}));
|
|
8261
8277
|
};
|
|
8262
8278
|
|
|
8263
|
-
var styles$
|
|
8279
|
+
var styles$T = {"custom-list":"_uC4zU"};
|
|
8264
8280
|
|
|
8265
8281
|
var _excluded$2o = ["children", "hasMoreOptions", "hasMoreOptionsFirstLoad"];
|
|
8266
8282
|
|
|
@@ -8279,7 +8295,7 @@ var CustomList = function CustomList(_ref) {
|
|
|
8279
8295
|
return React__default.createElement(Select.components.MenuList, Object.assign({}, props), React__default.createElement(React.Fragment, null, children, showFooter && React__default.createElement(Inline, {
|
|
8280
8296
|
justifyContent: "center"
|
|
8281
8297
|
}, React__default.createElement("div", {
|
|
8282
|
-
className: styles$
|
|
8298
|
+
className: styles$T['custom-list']
|
|
8283
8299
|
}, getLocalizedString('main.START_TYPING_TO_SEE_MORE_OPTIONS')))));
|
|
8284
8300
|
};
|
|
8285
8301
|
|
|
@@ -8508,7 +8524,7 @@ var DateField = function DateField(_ref) {
|
|
|
8508
8524
|
error: controllers.error
|
|
8509
8525
|
};
|
|
8510
8526
|
var dayPickerProps = {
|
|
8511
|
-
classNames: styles$
|
|
8527
|
+
classNames: styles$u,
|
|
8512
8528
|
disabledDays: function disabledDays(day) {
|
|
8513
8529
|
return _disabledDays && _disabledDays(setToMidnight(day));
|
|
8514
8530
|
},
|
|
@@ -8526,7 +8542,7 @@ var DateField = function DateField(_ref) {
|
|
|
8526
8542
|
})
|
|
8527
8543
|
}, React__default.createElement(DayPickerInput, {
|
|
8528
8544
|
format: format,
|
|
8529
|
-
classNames: styles$
|
|
8545
|
+
classNames: styles$u,
|
|
8530
8546
|
formatDate: formatDate,
|
|
8531
8547
|
parseDate: parseDate,
|
|
8532
8548
|
placeholder: placeholder || format.toUpperCase(),
|
|
@@ -8635,7 +8651,7 @@ var getFormikError = function getFormikError(error) {
|
|
|
8635
8651
|
return undefined;
|
|
8636
8652
|
};
|
|
8637
8653
|
|
|
8638
|
-
var styles$
|
|
8654
|
+
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"};
|
|
8639
8655
|
|
|
8640
8656
|
var FromDate = function FromDate(_ref) {
|
|
8641
8657
|
var name = _ref.name,
|
|
@@ -8674,7 +8690,7 @@ var FromDate = function FromDate(_ref) {
|
|
|
8674
8690
|
}
|
|
8675
8691
|
|
|
8676
8692
|
var dayPickerProps = {
|
|
8677
|
-
classNames: styles$
|
|
8693
|
+
classNames: styles$U,
|
|
8678
8694
|
months: MONTH_NAMES,
|
|
8679
8695
|
weekdaysLong: DAYS,
|
|
8680
8696
|
weekdaysShort: DAYS.map(function (day) {
|
|
@@ -8701,7 +8717,7 @@ var FromDate = function FromDate(_ref) {
|
|
|
8701
8717
|
};
|
|
8702
8718
|
return React__default.createElement(DayPickerInput, {
|
|
8703
8719
|
format: format,
|
|
8704
|
-
classNames: styles$
|
|
8720
|
+
classNames: styles$U,
|
|
8705
8721
|
selectedDay: start,
|
|
8706
8722
|
value: start,
|
|
8707
8723
|
formatDate: formatDate,
|
|
@@ -8775,7 +8791,7 @@ var ToDate = function ToDate(_ref, ref) {
|
|
|
8775
8791
|
}
|
|
8776
8792
|
|
|
8777
8793
|
var dayPickerProps = {
|
|
8778
|
-
classNames: styles$
|
|
8794
|
+
classNames: styles$U,
|
|
8779
8795
|
months: MONTH_NAMES,
|
|
8780
8796
|
weekdaysLong: DAYS,
|
|
8781
8797
|
weekdaysShort: DAYS.map(function (day) {
|
|
@@ -8794,7 +8810,7 @@ var ToDate = function ToDate(_ref, ref) {
|
|
|
8794
8810
|
};
|
|
8795
8811
|
return React__default.createElement(DayPickerInput, {
|
|
8796
8812
|
format: format,
|
|
8797
|
-
classNames: styles$
|
|
8813
|
+
classNames: styles$U,
|
|
8798
8814
|
selectedDay: end,
|
|
8799
8815
|
value: end,
|
|
8800
8816
|
formatDate: formatDate,
|
|
@@ -8879,11 +8895,11 @@ var DateRangeField = function DateRangeField(_ref) {
|
|
|
8879
8895
|
start = _controllers$value.start,
|
|
8880
8896
|
end = _controllers$value.end;
|
|
8881
8897
|
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement("div", {
|
|
8882
|
-
className: classnames(styles$
|
|
8898
|
+
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)),
|
|
8883
8899
|
"data-testid": testId
|
|
8884
8900
|
}, React__default.createElement(IconCalendarAlt, {
|
|
8885
8901
|
size: "medium",
|
|
8886
|
-
color:
|
|
8902
|
+
color: "grey-400"
|
|
8887
8903
|
}), React__default.createElement(FromDate, {
|
|
8888
8904
|
name: name,
|
|
8889
8905
|
id: controllers.id,
|
|
@@ -8909,7 +8925,7 @@ var DateRangeField = function DateRangeField(_ref) {
|
|
|
8909
8925
|
testId: testId
|
|
8910
8926
|
}), React__default.createElement(IconArrowRight, {
|
|
8911
8927
|
size: "medium",
|
|
8912
|
-
color:
|
|
8928
|
+
color: "grey-400"
|
|
8913
8929
|
}), React__default.createElement(ToDate$1, {
|
|
8914
8930
|
name: name,
|
|
8915
8931
|
format: format,
|
|
@@ -9006,7 +9022,7 @@ var WeekField = function WeekField(_ref) {
|
|
|
9006
9022
|
};
|
|
9007
9023
|
|
|
9008
9024
|
var dayPickerProps = {
|
|
9009
|
-
classNames: styles$
|
|
9025
|
+
classNames: styles$v,
|
|
9010
9026
|
disabledDays: function disabledDays(day) {
|
|
9011
9027
|
return _disabledDays && _disabledDays(setToMidnight(day));
|
|
9012
9028
|
},
|
|
@@ -9036,7 +9052,7 @@ var WeekField = function WeekField(_ref) {
|
|
|
9036
9052
|
})
|
|
9037
9053
|
}, React__default.createElement(DayPickerInput, {
|
|
9038
9054
|
format: format,
|
|
9039
|
-
classNames: styles$
|
|
9055
|
+
classNames: styles$v,
|
|
9040
9056
|
formatDate: formatDate,
|
|
9041
9057
|
parseDate: parseDate,
|
|
9042
9058
|
placeholder: placeholder || format.toUpperCase(),
|
|
@@ -9075,35 +9091,59 @@ var WeekField = function WeekField(_ref) {
|
|
|
9075
9091
|
})));
|
|
9076
9092
|
};
|
|
9077
9093
|
|
|
9078
|
-
var getTimeOptions = function getTimeOptions(interval, startTime) {
|
|
9094
|
+
var getTimeOptions = function getTimeOptions(interval, startTime, skipStartTime) {
|
|
9079
9095
|
if (startTime === void 0) {
|
|
9080
9096
|
startTime = new Date('Janurary 1 2023 00:00:00');
|
|
9081
9097
|
}
|
|
9082
9098
|
|
|
9099
|
+
if (skipStartTime === void 0) {
|
|
9100
|
+
skipStartTime = false;
|
|
9101
|
+
}
|
|
9102
|
+
|
|
9103
|
+
var intervalCoeffecient = 1000 * 60 * interval;
|
|
9083
9104
|
var optionsCount = 60 * 24 / interval;
|
|
9084
9105
|
var timeOptions = [];
|
|
9085
|
-
var intervalCoeffecient = 1000 * 60 * interval;
|
|
9086
9106
|
var rounded = new Date(Math.ceil(startTime.getTime() / intervalCoeffecient) * intervalCoeffecient);
|
|
9107
|
+
var skipFirstInterval = skipStartTime && startTime.getTime() === rounded.getTime();
|
|
9087
9108
|
|
|
9088
|
-
var
|
|
9089
|
-
if (hours === 0) {
|
|
9090
|
-
return 12;
|
|
9091
|
-
} else if (hours > 12) {
|
|
9092
|
-
return hours - 12;
|
|
9093
|
-
} else {
|
|
9094
|
-
return hours;
|
|
9095
|
-
}
|
|
9096
|
-
};
|
|
9097
|
-
|
|
9098
|
-
for (var i = 0; i < optionsCount; i++) {
|
|
9109
|
+
for (var i = skipFirstInterval ? 1 : 0; i < optionsCount; i++) {
|
|
9099
9110
|
var newDate = new Date(rounded.getTime());
|
|
9100
9111
|
newDate.setMinutes(rounded.getMinutes() + interval * i);
|
|
9112
|
+
var hours = formatHours(newDate.getHours());
|
|
9101
9113
|
var minutes = newDate.getMinutes();
|
|
9102
|
-
|
|
9114
|
+
var period = newDate.getHours() < 12 ? 'AM' : 'PM';
|
|
9115
|
+
timeOptions.push(hours + ":" + (minutes === 0 ? '00' : minutes) + " " + period);
|
|
9103
9116
|
}
|
|
9104
9117
|
|
|
9105
9118
|
return timeOptions;
|
|
9106
9119
|
};
|
|
9120
|
+
var getDuration = function getDuration(timeOption, startTime) {
|
|
9121
|
+
var start = new Date("Janurary 1 2023 " + startTime).getTime();
|
|
9122
|
+
var end = new Date("Janurary 1 2023 " + timeOption).getTime();
|
|
9123
|
+
var diffInMinutes = Math.round((end - start) / 60000);
|
|
9124
|
+
|
|
9125
|
+
if (diffInMinutes < 0) {
|
|
9126
|
+
diffInMinutes = diffInMinutes + 1440;
|
|
9127
|
+
}
|
|
9128
|
+
|
|
9129
|
+
if (diffInMinutes < 60) {
|
|
9130
|
+
return "(" + diffInMinutes + " min" + (diffInMinutes === 1 ? '' : 's') + ")";
|
|
9131
|
+
} else if (diffInMinutes >= 60) {
|
|
9132
|
+
return "(" + +(diffInMinutes / 60).toFixed(2) + " hr" + (diffInMinutes === 60 ? '' : 's') + ")";
|
|
9133
|
+
} else {
|
|
9134
|
+
return undefined;
|
|
9135
|
+
}
|
|
9136
|
+
};
|
|
9137
|
+
|
|
9138
|
+
var formatHours = function formatHours(hours) {
|
|
9139
|
+
if (hours === 0) {
|
|
9140
|
+
return 12;
|
|
9141
|
+
} else if (hours > 12) {
|
|
9142
|
+
return hours - 12;
|
|
9143
|
+
} else {
|
|
9144
|
+
return hours;
|
|
9145
|
+
}
|
|
9146
|
+
};
|
|
9107
9147
|
|
|
9108
9148
|
var TimeFieldDropdown = function TimeFieldDropdown(_ref) {
|
|
9109
9149
|
var trigger = _ref.trigger,
|
|
@@ -9111,7 +9151,9 @@ var TimeFieldDropdown = function TimeFieldDropdown(_ref) {
|
|
|
9111
9151
|
startTime = _ref.startTime,
|
|
9112
9152
|
onOptionClick = _ref.onOptionClick,
|
|
9113
9153
|
inputValue = _ref.inputValue,
|
|
9114
|
-
width = _ref.width
|
|
9154
|
+
width = _ref.width,
|
|
9155
|
+
_ref$endField = _ref.endField,
|
|
9156
|
+
endField = _ref$endField === void 0 ? false : _ref$endField;
|
|
9115
9157
|
var startTimeParsed;
|
|
9116
9158
|
|
|
9117
9159
|
if (startTime) {
|
|
@@ -9119,7 +9161,7 @@ var TimeFieldDropdown = function TimeFieldDropdown(_ref) {
|
|
|
9119
9161
|
}
|
|
9120
9162
|
|
|
9121
9163
|
var timeOptions = React.useMemo(function () {
|
|
9122
|
-
return getTimeOptions(interval, startTimeParsed);
|
|
9164
|
+
return getTimeOptions(interval, startTimeParsed, endField && !!startTime);
|
|
9123
9165
|
}, [interval, startTime]);
|
|
9124
9166
|
|
|
9125
9167
|
var _useState = React.useState(undefined),
|
|
@@ -9147,16 +9189,22 @@ var TimeFieldDropdown = function TimeFieldDropdown(_ref) {
|
|
|
9147
9189
|
onClick: function onClick() {
|
|
9148
9190
|
onOptionClick(option);
|
|
9149
9191
|
}
|
|
9150
|
-
},
|
|
9192
|
+
}, React__default.createElement(Inline, {
|
|
9193
|
+
space: 4
|
|
9194
|
+
}, option, endField && startTime && getDuration(option, startTime)));
|
|
9151
9195
|
})));
|
|
9152
9196
|
};
|
|
9153
9197
|
|
|
9154
|
-
var _excluded$2q = ["interval", "startTime"];
|
|
9198
|
+
var _excluded$2q = ["interval", "startTime", "prefix", "endField", "duration"];
|
|
9155
9199
|
|
|
9156
9200
|
var TimeFieldElement = function TimeFieldElement(_ref, forwardedRef) {
|
|
9157
9201
|
var _ref$interval = _ref.interval,
|
|
9158
9202
|
interval = _ref$interval === void 0 ? 15 : _ref$interval,
|
|
9159
9203
|
startTime = _ref.startTime,
|
|
9204
|
+
prefix = _ref.prefix,
|
|
9205
|
+
_ref$endField = _ref.endField,
|
|
9206
|
+
endField = _ref$endField === void 0 ? false : _ref$endField,
|
|
9207
|
+
duration = _ref.duration,
|
|
9160
9208
|
allOtherProps = _objectWithoutPropertiesLoose(_ref, _excluded$2q);
|
|
9161
9209
|
|
|
9162
9210
|
var internalRef = React.useRef(null);
|
|
@@ -9200,17 +9248,148 @@ var TimeFieldElement = function TimeFieldElement(_ref, forwardedRef) {
|
|
|
9200
9248
|
onInputChange: function onInputChange(e) {
|
|
9201
9249
|
return setSelectedDropdownValue(e);
|
|
9202
9250
|
},
|
|
9203
|
-
selectedTimeOption: selectedDropdownValue
|
|
9251
|
+
selectedTimeOption: selectedDropdownValue,
|
|
9252
|
+
prefix: prefix,
|
|
9253
|
+
duration: duration
|
|
9204
9254
|
})),
|
|
9205
9255
|
startTime: startTime,
|
|
9206
9256
|
onOptionClick: onOptionClick,
|
|
9207
9257
|
inputValue: selectedDropdownValue,
|
|
9208
|
-
width: width
|
|
9258
|
+
width: width,
|
|
9259
|
+
endField: endField
|
|
9209
9260
|
});
|
|
9210
9261
|
};
|
|
9211
9262
|
|
|
9263
|
+
var TimeRangeSelector = React.forwardRef(TimeFieldElement);
|
|
9212
9264
|
var TimeField = React.forwardRef(TimeFieldElement);
|
|
9213
9265
|
|
|
9266
|
+
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"};
|
|
9267
|
+
|
|
9268
|
+
var TimeRangeEnd = function TimeRangeEnd(_ref) {
|
|
9269
|
+
var startTime = _ref.startTime,
|
|
9270
|
+
onChange = _ref.onChange,
|
|
9271
|
+
interval = _ref.interval,
|
|
9272
|
+
_ref$placeholder = _ref.placeholder,
|
|
9273
|
+
placeholder = _ref$placeholder === void 0 ? '2:00 PM' : _ref$placeholder,
|
|
9274
|
+
duration = _ref.duration,
|
|
9275
|
+
disabled = _ref.disabled,
|
|
9276
|
+
testId = _ref.testId;
|
|
9277
|
+
return React__default.createElement(TimeRangeSelector, {
|
|
9278
|
+
name: "end-time",
|
|
9279
|
+
startTime: startTime,
|
|
9280
|
+
onChange: onChange,
|
|
9281
|
+
placeholder: placeholder,
|
|
9282
|
+
interval: interval,
|
|
9283
|
+
prefix: React__default.createElement(IconArrowRight, {
|
|
9284
|
+
size: "medium",
|
|
9285
|
+
color: "grey-400"
|
|
9286
|
+
}),
|
|
9287
|
+
duration: duration,
|
|
9288
|
+
endField: true,
|
|
9289
|
+
testId: testId && testId + "-end-time",
|
|
9290
|
+
disabled: disabled
|
|
9291
|
+
});
|
|
9292
|
+
};
|
|
9293
|
+
|
|
9294
|
+
var TimeRangeStart = function TimeRangeStart(_ref) {
|
|
9295
|
+
var startTime = _ref.startTime,
|
|
9296
|
+
onChange = _ref.onChange,
|
|
9297
|
+
interval = _ref.interval,
|
|
9298
|
+
_ref$placeholder = _ref.placeholder,
|
|
9299
|
+
placeholder = _ref$placeholder === void 0 ? '9:00 AM' : _ref$placeholder,
|
|
9300
|
+
id = _ref.id,
|
|
9301
|
+
disabled = _ref.disabled,
|
|
9302
|
+
testId = _ref.testId;
|
|
9303
|
+
return React__default.createElement(TimeRangeSelector, {
|
|
9304
|
+
name: "start-time",
|
|
9305
|
+
startTime: startTime,
|
|
9306
|
+
onChange: onChange,
|
|
9307
|
+
placeholder: placeholder,
|
|
9308
|
+
interval: interval,
|
|
9309
|
+
testId: testId && testId + "-start-time",
|
|
9310
|
+
id: id,
|
|
9311
|
+
disabled: disabled
|
|
9312
|
+
});
|
|
9313
|
+
};
|
|
9314
|
+
|
|
9315
|
+
var TimeRangeField = function TimeRangeField(_ref) {
|
|
9316
|
+
var _classnames;
|
|
9317
|
+
|
|
9318
|
+
var name = _ref.name,
|
|
9319
|
+
inputId = _ref.id,
|
|
9320
|
+
value = _ref.value,
|
|
9321
|
+
_ref$interval = _ref.interval,
|
|
9322
|
+
interval = _ref$interval === void 0 ? 15 : _ref$interval,
|
|
9323
|
+
startTime = _ref.startTime,
|
|
9324
|
+
onChange = _ref.onChange,
|
|
9325
|
+
onBlur = _ref.onBlur,
|
|
9326
|
+
label = _ref.label,
|
|
9327
|
+
caption = _ref.caption,
|
|
9328
|
+
error = _ref.error,
|
|
9329
|
+
placeholder = _ref.placeholder,
|
|
9330
|
+
disabled = _ref.disabled,
|
|
9331
|
+
testId = _ref.testId;
|
|
9332
|
+
var controllers = useRangeFieldControllers({
|
|
9333
|
+
name: name,
|
|
9334
|
+
id: inputId,
|
|
9335
|
+
value: value,
|
|
9336
|
+
onChange: onChange,
|
|
9337
|
+
onBlur: onBlur,
|
|
9338
|
+
error: error
|
|
9339
|
+
});
|
|
9340
|
+
var hasError = controllers.error;
|
|
9341
|
+
var fieldProps = {
|
|
9342
|
+
name: name,
|
|
9343
|
+
id: controllers.id,
|
|
9344
|
+
label: label,
|
|
9345
|
+
caption: caption,
|
|
9346
|
+
error: controllers.error
|
|
9347
|
+
};
|
|
9348
|
+
var _controllers$value = controllers.value,
|
|
9349
|
+
start = _controllers$value.start,
|
|
9350
|
+
end = _controllers$value.end;
|
|
9351
|
+
|
|
9352
|
+
var onStartChange = function onStartChange(inputValue) {
|
|
9353
|
+
controllers.onChange({
|
|
9354
|
+
start: inputValue === '' ? undefined : inputValue,
|
|
9355
|
+
end: end
|
|
9356
|
+
});
|
|
9357
|
+
};
|
|
9358
|
+
|
|
9359
|
+
var onEndChange = function onEndChange(inputValue) {
|
|
9360
|
+
controllers.onChange({
|
|
9361
|
+
start: start,
|
|
9362
|
+
end: inputValue === '' ? undefined : inputValue
|
|
9363
|
+
});
|
|
9364
|
+
};
|
|
9365
|
+
|
|
9366
|
+
var timeRangeDuration = getDuration(end, start);
|
|
9367
|
+
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement("div", {
|
|
9368
|
+
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)),
|
|
9369
|
+
"data-testid": testId
|
|
9370
|
+
}, React__default.createElement(TimeRangeStart, {
|
|
9371
|
+
startTime: startTime,
|
|
9372
|
+
interval: interval,
|
|
9373
|
+
onChange: function onChange(value) {
|
|
9374
|
+
return onStartChange(value);
|
|
9375
|
+
},
|
|
9376
|
+
placeholder: placeholder,
|
|
9377
|
+
testId: testId,
|
|
9378
|
+
id: controllers.id,
|
|
9379
|
+
disabled: disabled
|
|
9380
|
+
}), React__default.createElement(TimeRangeEnd, {
|
|
9381
|
+
startTime: start,
|
|
9382
|
+
interval: interval,
|
|
9383
|
+
onChange: function onChange(value) {
|
|
9384
|
+
return onEndChange(value);
|
|
9385
|
+
},
|
|
9386
|
+
placeholder: placeholder,
|
|
9387
|
+
duration: timeRangeDuration,
|
|
9388
|
+
testId: testId,
|
|
9389
|
+
disabled: disabled
|
|
9390
|
+
})));
|
|
9391
|
+
};
|
|
9392
|
+
|
|
9214
9393
|
var _excluded$2r = ["currencySymbol", "step"];
|
|
9215
9394
|
|
|
9216
9395
|
var CurrencyFieldElement = function CurrencyFieldElement(_ref, ref) {
|
|
@@ -9373,7 +9552,7 @@ var BUTTON_THEME = {
|
|
|
9373
9552
|
UPSELL: 'upsell'
|
|
9374
9553
|
};
|
|
9375
9554
|
|
|
9376
|
-
var styles$
|
|
9555
|
+
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"};
|
|
9377
9556
|
|
|
9378
9557
|
var ButtonCTA = function ButtonCTA(_ref) {
|
|
9379
9558
|
var button = _ref.button,
|
|
@@ -9396,7 +9575,7 @@ var ButtonCTA = function ButtonCTA(_ref) {
|
|
|
9396
9575
|
}, button.props));
|
|
9397
9576
|
};
|
|
9398
9577
|
|
|
9399
|
-
var styles$
|
|
9578
|
+
var styles$X = {"banner__caption":"_1jqm8"};
|
|
9400
9579
|
|
|
9401
9580
|
var InlineBannerCTA = function InlineBannerCTA(_ref) {
|
|
9402
9581
|
var primaryButton = _ref.primaryButton,
|
|
@@ -9427,7 +9606,7 @@ var InlineBannerCTA = function InlineBannerCTA(_ref) {
|
|
|
9427
9606
|
bannerTheme: bannerTheme,
|
|
9428
9607
|
primaryCTA: true
|
|
9429
9608
|
})), caption && multiLine && React__default.createElement("div", {
|
|
9430
|
-
className: styles$
|
|
9609
|
+
className: styles$X['banner__caption']
|
|
9431
9610
|
}, caption));
|
|
9432
9611
|
};
|
|
9433
9612
|
|
|
@@ -9474,14 +9653,14 @@ var InlineBanner = function InlineBanner(_ref) {
|
|
|
9474
9653
|
var Layout = multiLine ? Stack : Inline;
|
|
9475
9654
|
return React__default.createElement("div", {
|
|
9476
9655
|
"data-testid": testId,
|
|
9477
|
-
className: classnames(styles$
|
|
9656
|
+
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)),
|
|
9478
9657
|
style: positionStyles
|
|
9479
9658
|
}, React__default.createElement(Inline, {
|
|
9480
9659
|
alignItems: multiLine ? undefined : 'center',
|
|
9481
9660
|
flex: ['0 1 auto', 1],
|
|
9482
9661
|
space: 12
|
|
9483
9662
|
}, React__default.createElement("div", {
|
|
9484
|
-
className: styles$
|
|
9663
|
+
className: styles$W['banner__icon']
|
|
9485
9664
|
}, React__default.createElement(InlineBannerIcon, {
|
|
9486
9665
|
theme: theme
|
|
9487
9666
|
})), React__default.createElement(Layout, {
|
|
@@ -9491,9 +9670,9 @@ var InlineBanner = function InlineBanner(_ref) {
|
|
|
9491
9670
|
flex: ['min-content'],
|
|
9492
9671
|
flexWrap: multiLine ? undefined : 'wrap'
|
|
9493
9672
|
}, title && React__default.createElement("div", {
|
|
9494
|
-
className: styles$
|
|
9673
|
+
className: styles$W['banner__title']
|
|
9495
9674
|
}, title), React__default.createElement("div", {
|
|
9496
|
-
className: classnames(styles$
|
|
9675
|
+
className: classnames(styles$W['banner__body'], (_classnames2 = {}, _classnames2[styles$W['banner__body--multilineCTA']] = primaryButton && multiLine, _classnames2))
|
|
9497
9676
|
}, children), primaryButton && React__default.createElement(InlineBannerCTA, {
|
|
9498
9677
|
primaryButton: primaryButton,
|
|
9499
9678
|
secondaryButton: secondaryButton,
|
|
@@ -9501,7 +9680,7 @@ var InlineBanner = function InlineBanner(_ref) {
|
|
|
9501
9680
|
multiLine: multiLine,
|
|
9502
9681
|
bannerTheme: theme
|
|
9503
9682
|
})), dismissable && React__default.createElement("div", {
|
|
9504
|
-
className: styles$
|
|
9683
|
+
className: styles$W['banner__close']
|
|
9505
9684
|
}, React__default.createElement(Button$1, {
|
|
9506
9685
|
theme: "link-icon",
|
|
9507
9686
|
type: "button",
|
|
@@ -9515,7 +9694,7 @@ var PERSISTENT_BANNER_THEME = {
|
|
|
9515
9694
|
DANGER: 'danger'
|
|
9516
9695
|
};
|
|
9517
9696
|
|
|
9518
|
-
var styles$
|
|
9697
|
+
var styles$Y = {"persistent-banner":"_1KO1J","persistent-banner--info":"_2mTN3","persistent-banner--danger":"_1YuCF","persistent-banner--upsell":"_tlNFk"};
|
|
9519
9698
|
|
|
9520
9699
|
var PersistentBanner = function PersistentBanner(_ref) {
|
|
9521
9700
|
var _classNames;
|
|
@@ -9544,7 +9723,7 @@ var PersistentBanner = function PersistentBanner(_ref) {
|
|
|
9544
9723
|
};
|
|
9545
9724
|
|
|
9546
9725
|
return React__default.createElement("div", {
|
|
9547
|
-
className: classnames(styles$
|
|
9726
|
+
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)),
|
|
9548
9727
|
"data-testid": testId
|
|
9549
9728
|
}, onDismiss ? React__default.createElement(Inline, {
|
|
9550
9729
|
flex: [1],
|
|
@@ -9616,7 +9795,7 @@ var useProgress = function useProgress(progress, maxValue, getMetric) {
|
|
|
9616
9795
|
};
|
|
9617
9796
|
};
|
|
9618
9797
|
|
|
9619
|
-
var styles$
|
|
9798
|
+
var styles$Z = {"circular-progress":"_1XR7V","circular-progress__label":"_1BygP","circular-progress__track":"_1Ak-z","circular-progress__indicator":"_22YIp"};
|
|
9620
9799
|
|
|
9621
9800
|
var CircularProgress = function CircularProgress(_ref) {
|
|
9622
9801
|
var progress = _ref.progress,
|
|
@@ -9631,7 +9810,7 @@ var CircularProgress = function CircularProgress(_ref) {
|
|
|
9631
9810
|
|
|
9632
9811
|
var determinant = metric.percentage * 2.79;
|
|
9633
9812
|
return React__default.createElement("div", Object.assign({}, elementProps, {
|
|
9634
|
-
className: styles$
|
|
9813
|
+
className: styles$Z['circular-progress'],
|
|
9635
9814
|
"data-testid": testId
|
|
9636
9815
|
}), React__default.createElement("svg", {
|
|
9637
9816
|
viewBox: "0 0 100 100"
|
|
@@ -9640,21 +9819,21 @@ var CircularProgress = function CircularProgress(_ref) {
|
|
|
9640
9819
|
cy: 50,
|
|
9641
9820
|
r: 45,
|
|
9642
9821
|
strokeWidth: "10px",
|
|
9643
|
-
className: styles$
|
|
9822
|
+
className: styles$Z['circular-progress__track']
|
|
9644
9823
|
}), React__default.createElement("circle", {
|
|
9645
9824
|
cx: 50,
|
|
9646
9825
|
cy: 50,
|
|
9647
9826
|
r: 45,
|
|
9648
9827
|
strokeWidth: "10px",
|
|
9649
|
-
className: styles$
|
|
9828
|
+
className: styles$Z['circular-progress__indicator'],
|
|
9650
9829
|
strokeDashoffset: "66",
|
|
9651
9830
|
strokeDasharray: determinant + " " + (279 - determinant)
|
|
9652
9831
|
})), React__default.createElement("div", {
|
|
9653
|
-
className: styles$
|
|
9832
|
+
className: styles$Z['circular-progress__label']
|
|
9654
9833
|
}, children || metric.progress + "/" + metric.maxValue));
|
|
9655
9834
|
};
|
|
9656
9835
|
|
|
9657
|
-
var styles$
|
|
9836
|
+
var styles$_ = {"progress-bar":"_3nyZN","progress-bar__indicator":"_11TEp","progress-bar__steps":"_3XFTU"};
|
|
9658
9837
|
|
|
9659
9838
|
var ProgressBar = function ProgressBar(_ref) {
|
|
9660
9839
|
var progress = _ref.progress,
|
|
@@ -9669,15 +9848,15 @@ var ProgressBar = function ProgressBar(_ref) {
|
|
|
9669
9848
|
metric = _useProgress.metric;
|
|
9670
9849
|
|
|
9671
9850
|
return React__default.createElement(Stack, null, React__default.createElement("div", Object.assign({}, elementProps, {
|
|
9672
|
-
className: styles$
|
|
9851
|
+
className: styles$_['progress-bar'],
|
|
9673
9852
|
"data-testid": testId
|
|
9674
9853
|
}), React__default.createElement("div", {
|
|
9675
|
-
className: styles$
|
|
9854
|
+
className: styles$_['progress-bar__indicator'],
|
|
9676
9855
|
style: {
|
|
9677
9856
|
width: metric.percentage + "%"
|
|
9678
9857
|
}
|
|
9679
9858
|
})), steps && steps.length > 0 && React__default.createElement("div", {
|
|
9680
|
-
className: styles$
|
|
9859
|
+
className: styles$_['progress-bar__steps']
|
|
9681
9860
|
}, steps.map(function (step) {
|
|
9682
9861
|
return React__default.createElement("div", {
|
|
9683
9862
|
key: step
|
|
@@ -9685,7 +9864,7 @@ var ProgressBar = function ProgressBar(_ref) {
|
|
|
9685
9864
|
})));
|
|
9686
9865
|
};
|
|
9687
9866
|
|
|
9688
|
-
var styles
|
|
9867
|
+
var styles$$ = {"badge":"_2f81N","badge--warning":"_2g1GI","badge--danger":"_2zLnM","badge--success":"_27QOo","badge--info":"_2gmsM"};
|
|
9689
9868
|
|
|
9690
9869
|
var _excluded$2u = ["children", "theme", "title", "testId"];
|
|
9691
9870
|
|
|
@@ -9709,7 +9888,7 @@ var Badge = function Badge(_ref, forwardedRef) {
|
|
|
9709
9888
|
overlay: title,
|
|
9710
9889
|
ref: ref
|
|
9711
9890
|
}, React__default.createElement("div", Object.assign({
|
|
9712
|
-
className: classnames(styles
|
|
9891
|
+
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)),
|
|
9713
9892
|
ref: ref,
|
|
9714
9893
|
"data-testid": testId
|
|
9715
9894
|
}, otherProps), children));
|
|
@@ -9717,9 +9896,9 @@ var Badge = function Badge(_ref, forwardedRef) {
|
|
|
9717
9896
|
|
|
9718
9897
|
var Badge$1 = React.forwardRef(Badge);
|
|
9719
9898
|
|
|
9720
|
-
var styles$
|
|
9899
|
+
var styles$10 = {"avatar":"_2wJGB","avatar--small":"_3QTSo","avatar__badge":"_2Rl8S","avatar--medium":"_1zwj0","avatar--large":"_3-U6x","avatar--extra-large":"_3qn2q"};
|
|
9721
9900
|
|
|
9722
|
-
var styles
|
|
9901
|
+
var styles$11 = {"avatar-image":"_GKL9P"};
|
|
9723
9902
|
|
|
9724
9903
|
var AvatarImage = function AvatarImage(_ref) {
|
|
9725
9904
|
var url = _ref.url,
|
|
@@ -9744,7 +9923,7 @@ var AvatarImage = function AvatarImage(_ref) {
|
|
|
9744
9923
|
}
|
|
9745
9924
|
|
|
9746
9925
|
return React__default.createElement("div", {
|
|
9747
|
-
className: styles
|
|
9926
|
+
className: styles$11['avatar-image']
|
|
9748
9927
|
}, React__default.createElement(IconUserSolid, {
|
|
9749
9928
|
size: "flexible",
|
|
9750
9929
|
color: color
|
|
@@ -9794,7 +9973,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
9794
9973
|
|
|
9795
9974
|
var children = _ref.children,
|
|
9796
9975
|
_ref$color = _ref.color,
|
|
9797
|
-
color = _ref$color === void 0 ?
|
|
9976
|
+
color = _ref$color === void 0 ? COLORS['grey-400'] : _ref$color,
|
|
9798
9977
|
_ref$size = _ref.size,
|
|
9799
9978
|
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
9800
9979
|
url = _ref.url,
|
|
@@ -9811,9 +9990,9 @@ var Avatar = function Avatar(_ref) {
|
|
|
9811
9990
|
}),
|
|
9812
9991
|
defaultProfilePictureColors = _useState2[0];
|
|
9813
9992
|
|
|
9814
|
-
var backgroundColor = url ?
|
|
9993
|
+
var backgroundColor = url ? COLORS['grey-200'] : getColor(color);
|
|
9815
9994
|
return React__default.createElement("div", {
|
|
9816
|
-
className: classnames(styles$
|
|
9995
|
+
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)),
|
|
9817
9996
|
style: {
|
|
9818
9997
|
backgroundColor: children || url && !showIconInsteadOfImage ? backgroundColor : defaultProfilePictureColors.backgroundColor
|
|
9819
9998
|
},
|
|
@@ -9826,7 +10005,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
9826
10005
|
return setShowIconInsteadOfImage(true);
|
|
9827
10006
|
}
|
|
9828
10007
|
}), badge && size !== 'small' && React__default.createElement("div", {
|
|
9829
|
-
className: styles$
|
|
10008
|
+
className: styles$10['avatar__badge']
|
|
9830
10009
|
}, badge));
|
|
9831
10010
|
};
|
|
9832
10011
|
|
|
@@ -9839,7 +10018,7 @@ var CHIP_THEME = {
|
|
|
9839
10018
|
DANGER: 'danger'
|
|
9840
10019
|
};
|
|
9841
10020
|
|
|
9842
|
-
var styles$
|
|
10021
|
+
var styles$12 = {"chip":"_1fIeV","chip--marketing":"_V4byU","chip--success":"_37gN9","chip--upsell":"_Tw7tp","chip--warning":"_t94VZ","chip--info":"_3SmeO","chip--danger":"_2eoX0"};
|
|
9843
10022
|
|
|
9844
10023
|
var Chip = function Chip(_ref) {
|
|
9845
10024
|
var _classnames;
|
|
@@ -9850,11 +10029,11 @@ var Chip = function Chip(_ref) {
|
|
|
9850
10029
|
testId = _ref.testId;
|
|
9851
10030
|
return React__default.createElement("div", {
|
|
9852
10031
|
"data-testid": testId,
|
|
9853
|
-
className: classnames(styles$
|
|
10032
|
+
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))
|
|
9854
10033
|
}, children);
|
|
9855
10034
|
};
|
|
9856
10035
|
|
|
9857
|
-
var styles$
|
|
10036
|
+
var styles$13 = {"pill":"_23q4Y","pill--default":"_niDEM","pill--success":"_IwDRB","pill--danger":"_MPji-","pill--warning":"_3S2m8","pill--info":"_2G3ML"};
|
|
9858
10037
|
|
|
9859
10038
|
var PILL_THEME = {
|
|
9860
10039
|
INFO: 'info',
|
|
@@ -9873,7 +10052,7 @@ var Pill = function Pill(_ref) {
|
|
|
9873
10052
|
testId = _ref.testId;
|
|
9874
10053
|
return React__default.createElement("div", {
|
|
9875
10054
|
"data-testid": testId,
|
|
9876
|
-
className: classnames(styles$
|
|
10055
|
+
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))
|
|
9877
10056
|
}, children);
|
|
9878
10057
|
};
|
|
9879
10058
|
|
|
@@ -9883,9 +10062,9 @@ var EMPTY_STATE_SIZE = {
|
|
|
9883
10062
|
LARGE: 'large'
|
|
9884
10063
|
};
|
|
9885
10064
|
|
|
9886
|
-
var styles$
|
|
10065
|
+
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"};
|
|
9887
10066
|
|
|
9888
|
-
var styles$
|
|
10067
|
+
var styles$15 = {"empty-state-container-cta":"_1Cx9N","empty-state-container-cta--inside-modal":"_WbcaM"};
|
|
9889
10068
|
|
|
9890
10069
|
var EmptyStateContainerCTA = function EmptyStateContainerCTA(_ref) {
|
|
9891
10070
|
var _actions$primary, _actions$secondary, _classNames;
|
|
@@ -9903,7 +10082,7 @@ var EmptyStateContainerCTA = function EmptyStateContainerCTA(_ref) {
|
|
|
9903
10082
|
size: BUTTON_SIZES.MIN_WIDTH_100
|
|
9904
10083
|
});
|
|
9905
10084
|
return React__default.createElement("div", {
|
|
9906
|
-
className: classnames(styles$
|
|
10085
|
+
className: classnames(styles$15['empty-state-container-cta'], (_classNames = {}, _classNames[styles$15['empty-state-container-cta--inside-modal']] = isInsideModal, _classNames))
|
|
9907
10086
|
}, primaryButton, secondaryButton);
|
|
9908
10087
|
};
|
|
9909
10088
|
|
|
@@ -9918,7 +10097,7 @@ var EmptyStateContainerStack = function EmptyStateContainerStack(_ref) {
|
|
|
9918
10097
|
isPaywall = _ref$isPaywall === void 0 ? false : _ref$isPaywall,
|
|
9919
10098
|
testId = _ref.testId;
|
|
9920
10099
|
return React__default.createElement("div", {
|
|
9921
|
-
className: styles$
|
|
10100
|
+
className: styles$14['empty-state-container-stack'],
|
|
9922
10101
|
"data-testid": testId
|
|
9923
10102
|
}, React__default.createElement("img", {
|
|
9924
10103
|
src: mediaUrl,
|
|
@@ -9929,12 +10108,12 @@ var EmptyStateContainerStack = function EmptyStateContainerStack(_ref) {
|
|
|
9929
10108
|
alignItems: "center"
|
|
9930
10109
|
}, header && React__default.createElement(Text, {
|
|
9931
10110
|
as: "h4",
|
|
9932
|
-
color: isPaywall &&
|
|
10111
|
+
color: isPaywall && 'eggplant-500'
|
|
9933
10112
|
}, header), React__default.createElement(Text, {
|
|
9934
10113
|
emphasis: "bold",
|
|
9935
10114
|
as: "body"
|
|
9936
10115
|
}, title), React__default.createElement("div", {
|
|
9937
|
-
className: styles$
|
|
10116
|
+
className: styles$14['empty-state-container-stack__body']
|
|
9938
10117
|
}, children)), React__default.createElement(Stack, {
|
|
9939
10118
|
space: 8,
|
|
9940
10119
|
alignItems: "center"
|
|
@@ -9946,7 +10125,7 @@ var EmptyStateContainerStack = function EmptyStateContainerStack(_ref) {
|
|
|
9946
10125
|
}, caption)));
|
|
9947
10126
|
};
|
|
9948
10127
|
|
|
9949
|
-
var styles$
|
|
10128
|
+
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"};
|
|
9950
10129
|
|
|
9951
10130
|
var EmptyStateContainerInline = function EmptyStateContainerInline(_ref) {
|
|
9952
10131
|
var _classNames, _classnames;
|
|
@@ -9967,19 +10146,19 @@ var EmptyStateContainerInline = function EmptyStateContainerInline(_ref) {
|
|
|
9967
10146
|
isInsideModal = _useModalContext.isModalMounted;
|
|
9968
10147
|
|
|
9969
10148
|
return React__default.createElement("div", {
|
|
9970
|
-
className: classnames(styles$
|
|
10149
|
+
className: classnames(styles$16['empty-state-container-inline'], (_classNames = {}, _classNames[styles$16['empty-state-container-inline--inside-modal']] = isInsideModal, _classNames)),
|
|
9971
10150
|
"data-testid": testId
|
|
9972
10151
|
}, React__default.createElement("div", {
|
|
9973
|
-
className: classnames(styles$
|
|
10152
|
+
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))
|
|
9974
10153
|
}, React__default.createElement(Stack, {
|
|
9975
10154
|
space: 8
|
|
9976
10155
|
}, header && React__default.createElement(Text, {
|
|
9977
10156
|
as: "h4",
|
|
9978
|
-
color: isPaywall &&
|
|
10157
|
+
color: isPaywall && 'eggplant-500'
|
|
9979
10158
|
}, header), React__default.createElement(Text, {
|
|
9980
10159
|
as: "h1"
|
|
9981
10160
|
}, title)), React__default.createElement("div", {
|
|
9982
|
-
className: styles$
|
|
10161
|
+
className: styles$16['empty-state-container-inline__body']
|
|
9983
10162
|
}, children), React__default.createElement(Stack, {
|
|
9984
10163
|
space: 8,
|
|
9985
10164
|
marginTop: 12
|
|
@@ -9990,7 +10169,7 @@ var EmptyStateContainerInline = function EmptyStateContainerInline(_ref) {
|
|
|
9990
10169
|
}), caption && React__default.createElement(Text, {
|
|
9991
10170
|
as: "caption"
|
|
9992
10171
|
}, caption))), React__default.createElement("div", {
|
|
9993
|
-
className: styles$
|
|
10172
|
+
className: styles$16['empty-state-container-inline__image']
|
|
9994
10173
|
}, React__default.createElement("img", {
|
|
9995
10174
|
src: mediaUrl,
|
|
9996
10175
|
alt: String(title),
|
|
@@ -10269,6 +10448,7 @@ exports.Text = Text;
|
|
|
10269
10448
|
exports.TextAreaField = TextAreaField;
|
|
10270
10449
|
exports.TextField = TextField;
|
|
10271
10450
|
exports.TimeField = TimeField;
|
|
10451
|
+
exports.TimeRangeField = TimeRangeField;
|
|
10272
10452
|
exports.Toggle = Toggle;
|
|
10273
10453
|
exports.ToolbarSelect = ToolbarSelect;
|
|
10274
10454
|
exports.Tooltip = Tooltip$1;
|