@7shifts/sous-chef 2.8.2 → 2.10.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/core/DataTable/types.d.ts +13 -2
- package/dist/core/DataTableRow/DataTableRow.d.ts +2 -2
- package/dist/core/DataTableRow/DataTableRowActions/DataTableRowActions.d.ts +6 -0
- package/dist/core/DataTableRow/DataTableRowActions/index.d.ts +1 -0
- package/dist/core/index.d.ts +2 -2
- package/dist/index.css +152 -152
- package/dist/index.js +300 -121
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +298 -121
- package/dist/index.modern.js.map +1 -1
- package/dist/overlay/Calendar/Calendar.d.ts +23 -0
- package/dist/overlay/Calendar/constants.d.ts +8 -0
- package/dist/overlay/Calendar/domain.d.ts +7 -0
- package/dist/overlay/Calendar/index.d.ts +1 -0
- package/dist/overlay/Calendar/types.d.ts +2 -0
- package/dist/overlay/Menu/MenuItem.d.ts +1 -1
- package/dist/overlay/index.d.ts +2 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -4,13 +4,14 @@ import ReactDOM from 'react-dom';
|
|
|
4
4
|
import Select, { components } from 'react-select';
|
|
5
5
|
import DayPickerInput from 'react-day-picker/DayPickerInput';
|
|
6
6
|
import { isDate, startOfDay } from 'date-fns';
|
|
7
|
-
import { DateUtils } from 'react-day-picker';
|
|
7
|
+
import DayPicker, { DateUtils } from 'react-day-picker';
|
|
8
8
|
import dateFnsFormat from 'date-fns/format';
|
|
9
9
|
import dateFnsParse from 'date-fns/parse';
|
|
10
10
|
import startOfDay$1 from 'date-fns/startOfDay';
|
|
11
11
|
import eachDayOfInterval from 'date-fns/eachDayOfInterval';
|
|
12
12
|
import parseTime from 'time-autocomplete/src/core/AMPMParser';
|
|
13
13
|
import ReactModal from 'react-modal';
|
|
14
|
+
import 'react-day-picker/lib/style.css';
|
|
14
15
|
|
|
15
16
|
function _extends() {
|
|
16
17
|
_extends = Object.assign || function (target) {
|
|
@@ -96,7 +97,7 @@ var MenuItem = function MenuItem(_ref) {
|
|
|
96
97
|
|
|
97
98
|
var handleClick = function handleClick(e) {
|
|
98
99
|
onToggleMenu();
|
|
99
|
-
onClick();
|
|
100
|
+
onClick(e);
|
|
100
101
|
e.stopPropagation();
|
|
101
102
|
};
|
|
102
103
|
|
|
@@ -3342,6 +3343,64 @@ var useDataTableContext = function useDataTableContext() {
|
|
|
3342
3343
|
|
|
3343
3344
|
var styles$9 = {"item":"_1d8Ci","selected":"_3tb7U","clickable":"_thFcO","item-column":"_OTcMc","item-column--default-padding":"_lNHQ8","item-column--right-align":"_13YLe","item-column--vertical-border":"_1rrRr","actions":"_azbIG"};
|
|
3344
3345
|
|
|
3346
|
+
var styles$a = {"caption":"_1QDLF","label":"_2wiMV","toggle":"_1ui8X","toggle__label":"_1YRJT","toggle__caption":"_1jEiW","toggle__switch":"_3tNyE"};
|
|
3347
|
+
|
|
3348
|
+
var Toggle = function Toggle(_ref) {
|
|
3349
|
+
var checked = _ref.checked,
|
|
3350
|
+
label = _ref.label,
|
|
3351
|
+
caption = _ref.caption,
|
|
3352
|
+
onChange = _ref.onChange,
|
|
3353
|
+
_ref$disabled = _ref.disabled,
|
|
3354
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
3355
|
+
id = _ref.id;
|
|
3356
|
+
return React__default.createElement(Stack, {
|
|
3357
|
+
space: 8
|
|
3358
|
+
}, React__default.createElement("label", {
|
|
3359
|
+
className: styles$a['toggle']
|
|
3360
|
+
}, React__default.createElement("input", {
|
|
3361
|
+
"data-testid": "toggle",
|
|
3362
|
+
type: "checkbox",
|
|
3363
|
+
checked: checked,
|
|
3364
|
+
onChange: onChange,
|
|
3365
|
+
disabled: disabled,
|
|
3366
|
+
id: id
|
|
3367
|
+
}), React__default.createElement("span", {
|
|
3368
|
+
className: styles$a['toggle__switch']
|
|
3369
|
+
}), label && React__default.createElement("span", {
|
|
3370
|
+
className: styles$a['toggle__label']
|
|
3371
|
+
}, label)), caption && React__default.createElement("span", {
|
|
3372
|
+
className: styles$a['toggle__caption']
|
|
3373
|
+
}, caption));
|
|
3374
|
+
};
|
|
3375
|
+
|
|
3376
|
+
var ActionsCell = function ActionsCell(_ref) {
|
|
3377
|
+
var actions = _ref.actions;
|
|
3378
|
+
var kebabMenuItems = actions.filter(function (action) {
|
|
3379
|
+
return action.showInKebab === undefined || action.showInKebab;
|
|
3380
|
+
});
|
|
3381
|
+
var sideActions = actions.filter(function (action) {
|
|
3382
|
+
return action.showInKebab === false;
|
|
3383
|
+
});
|
|
3384
|
+
return React__default.createElement("div", {
|
|
3385
|
+
className: classnames(styles$9['item-column'], styles$9['actions']),
|
|
3386
|
+
"data-testid": "data-table-dropdown-menu"
|
|
3387
|
+
}, React__default.createElement(Inline, {
|
|
3388
|
+
space: 0,
|
|
3389
|
+
justifyContent: "end"
|
|
3390
|
+
}, sideActions.length > 0 && sideActions.map(function (action, index) {
|
|
3391
|
+
return React__default.createElement(Button$1, Object.assign({
|
|
3392
|
+
key: action.action || index,
|
|
3393
|
+
onClick: action.onAction,
|
|
3394
|
+
theme: "link-icon"
|
|
3395
|
+
}, action.showInKebab === false ? action.buttonProps : {}), action.label);
|
|
3396
|
+
}), kebabMenuItems.length > 0 && React__default.createElement(Menu, null, React__default.createElement(MenuButton, null, React__default.createElement(IconEllipsisV, null)), React__default.createElement(MenuList, null, kebabMenuItems.map(function (action, index) {
|
|
3397
|
+
return React__default.createElement(MenuItem, {
|
|
3398
|
+
onClick: action.onAction,
|
|
3399
|
+
key: index
|
|
3400
|
+
}, action.label);
|
|
3401
|
+
})))));
|
|
3402
|
+
};
|
|
3403
|
+
|
|
3345
3404
|
var _excluded$2 = ["children", "onClick", "isSelected", "actions", "hasDefaultPadding"];
|
|
3346
3405
|
|
|
3347
3406
|
var DataTableRowComponent = function DataTableRowComponent(_ref, ref) {
|
|
@@ -3388,20 +3447,14 @@ var DataTableRowComponent = function DataTableRowComponent(_ref, ref) {
|
|
|
3388
3447
|
ref: ref
|
|
3389
3448
|
}), React__default.Children.map(children, function (child, index) {
|
|
3390
3449
|
return renderColumn(child, index);
|
|
3391
|
-
}), showActionMenu && React__default.createElement(
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
}, actions.length > 0 && React__default.createElement(Menu, null, React__default.createElement(MenuButton, null, React__default.createElement(IconEllipsisV, null)), React__default.createElement(MenuList, null, actions.map(function (action, index) {
|
|
3395
|
-
return React__default.createElement(MenuItem, {
|
|
3396
|
-
onClick: action.onAction,
|
|
3397
|
-
key: index
|
|
3398
|
-
}, action.label);
|
|
3399
|
-
})))));
|
|
3450
|
+
}), showActionMenu && React__default.createElement(ActionsCell, {
|
|
3451
|
+
actions: actions
|
|
3452
|
+
}));
|
|
3400
3453
|
};
|
|
3401
3454
|
|
|
3402
3455
|
var DataTableRow = forwardRef(DataTableRowComponent);
|
|
3403
3456
|
|
|
3404
|
-
var styles$
|
|
3457
|
+
var styles$b = {"header":"_of22N","header-item":"_27x4v","header-item--sortable":"_3gw3Z","header-item--right-align":"_Fjm2n","header-item--action":"_LoIvx","header-sort-icon":"_3VjFP","body":"_1bTmd","footer":"_1opWx","pagination-controls":"_F_spz"};
|
|
3405
3458
|
|
|
3406
3459
|
var SORT_ORDER$1 = {
|
|
3407
3460
|
ASC: 'asc',
|
|
@@ -3432,7 +3485,7 @@ var DataTableHeader = function DataTableHeader(_ref) {
|
|
|
3432
3485
|
};
|
|
3433
3486
|
|
|
3434
3487
|
return React__default.createElement("div", {
|
|
3435
|
-
className: styles$
|
|
3488
|
+
className: styles$b['header']
|
|
3436
3489
|
}, columns.map(function (column) {
|
|
3437
3490
|
var _classnames;
|
|
3438
3491
|
|
|
@@ -3440,7 +3493,7 @@ var DataTableHeader = function DataTableHeader(_ref) {
|
|
|
3440
3493
|
var sortDir = column.currentSort;
|
|
3441
3494
|
var isRightAligned = column.isRightAligned;
|
|
3442
3495
|
return React__default.createElement("div", {
|
|
3443
|
-
className: classnames((_classnames = {}, _classnames[styles$
|
|
3496
|
+
className: classnames((_classnames = {}, _classnames[styles$b['header-item']] = true, _classnames[styles$b['header-item--sortable']] = isSortable, _classnames[styles$b['header-item--right-align']] = isRightAligned, _classnames)),
|
|
3444
3497
|
style: {
|
|
3445
3498
|
flex: column.size || 1
|
|
3446
3499
|
},
|
|
@@ -3454,12 +3507,12 @@ var DataTableHeader = function DataTableHeader(_ref) {
|
|
|
3454
3507
|
role: "columnheader",
|
|
3455
3508
|
tabIndex: 0
|
|
3456
3509
|
}, column.label, ' ', isSortable && React__default.createElement("span", {
|
|
3457
|
-
className: styles$
|
|
3510
|
+
className: styles$b['header-sort-icon']
|
|
3458
3511
|
}, React__default.createElement(IconSort$2, {
|
|
3459
3512
|
sortDirection: sortDir
|
|
3460
3513
|
})));
|
|
3461
3514
|
}), showActionMenu && React__default.createElement("div", {
|
|
3462
|
-
className: classnames(styles$
|
|
3515
|
+
className: classnames(styles$b['header-item'], styles$b['header-item--action'])
|
|
3463
3516
|
}));
|
|
3464
3517
|
};
|
|
3465
3518
|
|
|
@@ -3539,7 +3592,7 @@ var DataTable = function DataTable(_ref) {
|
|
|
3539
3592
|
onSort: onSort,
|
|
3540
3593
|
showActionMenu: showActionMenu
|
|
3541
3594
|
}), React__default.createElement("div", {
|
|
3542
|
-
className: styles$
|
|
3595
|
+
className: styles$b['body'],
|
|
3543
3596
|
style: conditionalStyles,
|
|
3544
3597
|
role: "table"
|
|
3545
3598
|
}, isLoading && React__default.createElement(Spinner, {
|
|
@@ -3552,10 +3605,10 @@ var DataTable = function DataTable(_ref) {
|
|
|
3552
3605
|
index: index
|
|
3553
3606
|
});
|
|
3554
3607
|
}), footerComponent && !isLoading && React__default.createElement("div", {
|
|
3555
|
-
className: styles$
|
|
3608
|
+
className: styles$b['footer'],
|
|
3556
3609
|
"data-testid": "footer"
|
|
3557
3610
|
}, footerComponent)), onPreviousClick && onNextClick && (hasPrevious || hasNext) && React__default.createElement("div", {
|
|
3558
|
-
className: styles$
|
|
3611
|
+
className: styles$b['pagination-controls'],
|
|
3559
3612
|
"data-testid": "pagination-controls"
|
|
3560
3613
|
}, React__default.createElement(PaginationControls, {
|
|
3561
3614
|
hasPrevious: hasPrevious && !isLoading,
|
|
@@ -3583,7 +3636,7 @@ var DefaultItemComponent$1 = function DefaultItemComponent(_ref2) {
|
|
|
3583
3636
|
}));
|
|
3584
3637
|
};
|
|
3585
3638
|
|
|
3586
|
-
var styles$
|
|
3639
|
+
var styles$c = {"data-table-cell":"_orjDM","data-table-cell--right-aligned":"_3EpfF"};
|
|
3587
3640
|
|
|
3588
3641
|
var DataTableCell = function DataTableCell(_ref) {
|
|
3589
3642
|
var _columns$columnIndex, _classnames;
|
|
@@ -3597,7 +3650,7 @@ var DataTableCell = function DataTableCell(_ref) {
|
|
|
3597
3650
|
var column = (_columns$columnIndex = columns === null || columns === void 0 ? void 0 : columns[columnIndex]) != null ? _columns$columnIndex : null;
|
|
3598
3651
|
var isRightAligned = column ? column.isRightAligned : false;
|
|
3599
3652
|
return React__default.createElement("div", {
|
|
3600
|
-
className: classnames((_classnames = {}, _classnames[styles$
|
|
3653
|
+
className: classnames((_classnames = {}, _classnames[styles$c['data-table-cell--right-aligned']] = isRightAligned, _classnames), styles$c['data-table-cell'])
|
|
3601
3654
|
}, children);
|
|
3602
3655
|
};
|
|
3603
3656
|
|
|
@@ -3713,36 +3766,36 @@ var useFieldControllers = function useFieldControllers(_ref) {
|
|
|
3713
3766
|
return controllers;
|
|
3714
3767
|
};
|
|
3715
3768
|
|
|
3716
|
-
var styles$
|
|
3769
|
+
var styles$d = {"label":"_h724f"};
|
|
3717
3770
|
|
|
3718
3771
|
var Label = function Label(_ref) {
|
|
3719
3772
|
var htmlFor = _ref.htmlFor,
|
|
3720
3773
|
children = _ref.children;
|
|
3721
3774
|
return React__default.createElement("label", {
|
|
3722
3775
|
htmlFor: htmlFor,
|
|
3723
|
-
className: styles$
|
|
3776
|
+
className: styles$d['label']
|
|
3724
3777
|
}, children);
|
|
3725
3778
|
};
|
|
3726
3779
|
|
|
3727
|
-
var styles$
|
|
3780
|
+
var styles$e = {"caption":"_1DWBq"};
|
|
3728
3781
|
|
|
3729
3782
|
var Caption = function Caption(_ref) {
|
|
3730
3783
|
var fieldId = _ref.fieldId,
|
|
3731
3784
|
children = _ref.children;
|
|
3732
3785
|
return React__default.createElement("div", {
|
|
3733
3786
|
id: fieldId && fieldId + "-describer",
|
|
3734
|
-
className: styles$
|
|
3787
|
+
className: styles$e['caption']
|
|
3735
3788
|
}, children);
|
|
3736
3789
|
};
|
|
3737
3790
|
|
|
3738
|
-
var styles$
|
|
3791
|
+
var styles$f = {"error-message":"_nZ2MD"};
|
|
3739
3792
|
|
|
3740
3793
|
var ErrorMessage = function ErrorMessage(_ref) {
|
|
3741
3794
|
var fieldId = _ref.fieldId,
|
|
3742
3795
|
children = _ref.children;
|
|
3743
3796
|
return React__default.createElement("div", {
|
|
3744
3797
|
id: fieldId && fieldId + "-error-message",
|
|
3745
|
-
className: styles$
|
|
3798
|
+
className: styles$f['error-message']
|
|
3746
3799
|
}, React__default.createElement(Inline, {
|
|
3747
3800
|
space: 8,
|
|
3748
3801
|
alignItems: "center"
|
|
@@ -3771,7 +3824,7 @@ var Field = function Field(_ref) {
|
|
|
3771
3824
|
}, error));
|
|
3772
3825
|
};
|
|
3773
3826
|
|
|
3774
|
-
var styles$
|
|
3827
|
+
var styles$g = {"affix-container":"_ybKOk","affix-container--prefixed":"_2COk3","affix-container--suffixed":"_1xXXN","prefix":"_eX5OL","suffix":"__YH01"};
|
|
3775
3828
|
|
|
3776
3829
|
var AffixContainer = function AffixContainer(_ref) {
|
|
3777
3830
|
var _classnames;
|
|
@@ -3808,21 +3861,21 @@ var AffixContainer = function AffixContainer(_ref) {
|
|
|
3808
3861
|
return children;
|
|
3809
3862
|
}
|
|
3810
3863
|
|
|
3811
|
-
var classes = classnames(styles$
|
|
3864
|
+
var classes = classnames(styles$g['affix-container'], (_classnames = {}, _classnames[styles$g['affix-container--prefixed']] = hasPrefix, _classnames[styles$g['affix-container--suffixed']] = hasSuffix, _classnames));
|
|
3812
3865
|
return React__default.createElement("div", {
|
|
3813
3866
|
className: classes,
|
|
3814
3867
|
ref: container,
|
|
3815
3868
|
"data-testid": "affix-container"
|
|
3816
3869
|
}, hasPrefix && React__default.createElement("div", {
|
|
3817
|
-
className: styles$
|
|
3870
|
+
className: styles$g['prefix'],
|
|
3818
3871
|
ref: prefixElement
|
|
3819
3872
|
}, prefix), children, hasSuffix && React__default.createElement("div", {
|
|
3820
|
-
className: styles$
|
|
3873
|
+
className: styles$g['suffix'],
|
|
3821
3874
|
ref: suffixElement
|
|
3822
3875
|
}, suffix));
|
|
3823
3876
|
};
|
|
3824
3877
|
|
|
3825
|
-
var styles$
|
|
3878
|
+
var styles$h = {"data-table-editable-cell":"_kIngZ","data-table-editable-cell--right-aligned":"_3_QIj","data-table-editable-cell--currency":"_2Kyuc","data-table-editable-cell--invalid":"_y9SBQ","data-table-editable-cell--top-left":"_32mWH","data-table-editable-cell--top-right":"_3Jg2-","data-table-editable-cell--bottom-left":"_1F5fj","data-table-editable-cell--bottom-right":"_1fTTW"};
|
|
3826
3879
|
|
|
3827
3880
|
var DataTableEditableCell = function DataTableEditableCell(_ref) {
|
|
3828
3881
|
var _columns$columnIndex, _classnames, _classnames2;
|
|
@@ -3869,14 +3922,14 @@ var DataTableEditableCell = function DataTableEditableCell(_ref) {
|
|
|
3869
3922
|
id: controllers.id
|
|
3870
3923
|
};
|
|
3871
3924
|
return React__default.createElement("div", {
|
|
3872
|
-
className: classnames((_classnames = {}, _classnames[styles$
|
|
3925
|
+
className: classnames((_classnames = {}, _classnames[styles$h['data-table-editable-cell--currency']] = type === 'currency', _classnames), styles$h['data-table-editable-cell'])
|
|
3873
3926
|
}, React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement(AffixContainer, {
|
|
3874
3927
|
prefix: prefix,
|
|
3875
3928
|
suffix: suffix
|
|
3876
3929
|
}, React__default.createElement("input", {
|
|
3877
3930
|
name: name,
|
|
3878
3931
|
id: controllers.id,
|
|
3879
|
-
className: classnames((_classnames2 = {}, _classnames2[styles$
|
|
3932
|
+
className: classnames((_classnames2 = {}, _classnames2[styles$h['data-table-editable-cell--right-aligned']] = isRightAligned, _classnames2[styles$h['data-table-editable-cell--top-left']] = isTopLeftCell, _classnames2[styles$h['data-table-editable-cell--top-right']] = isTopRightCell, _classnames2[styles$h['data-table-editable-cell--bottom-left']] = isBottomLeftCell, _classnames2[styles$h['data-table-editable-cell--bottom-right']] = isBottomRightCell, _classnames2[styles$h['data-table-editable-cell--invalid']] = hasError, _classnames2)),
|
|
3880
3933
|
type: type === 'currency' ? 'number' : 'text',
|
|
3881
3934
|
step: type === 'currency' ? 'any' : '',
|
|
3882
3935
|
"data-testid": "text-field-" + name,
|
|
@@ -4072,7 +4125,7 @@ var ToolbarSelect = function ToolbarSelect(_ref) {
|
|
|
4072
4125
|
}));
|
|
4073
4126
|
};
|
|
4074
4127
|
|
|
4075
|
-
var styles$
|
|
4128
|
+
var styles$i = {"form--standard-size":"_3CaV0"};
|
|
4076
4129
|
|
|
4077
4130
|
var Form = function Form(_ref) {
|
|
4078
4131
|
var _classnames;
|
|
@@ -4096,7 +4149,7 @@ var Form = function Form(_ref) {
|
|
|
4096
4149
|
}
|
|
4097
4150
|
}, React__default.createElement("form", {
|
|
4098
4151
|
onSubmit: onSubmit ? handleSubmit : formik === null || formik === void 0 ? void 0 : formik.handleSubmit,
|
|
4099
|
-
className: classnames((_classnames = {}, _classnames[styles$
|
|
4152
|
+
className: classnames((_classnames = {}, _classnames[styles$i['form--standard-size']] = !wide, _classnames)),
|
|
4100
4153
|
"data-testid": "form"
|
|
4101
4154
|
}, stackContent ? React__default.createElement(Stack, null, children) : children));
|
|
4102
4155
|
};
|
|
@@ -4135,7 +4188,7 @@ var FormRow = function FormRow(_ref) {
|
|
|
4135
4188
|
}));
|
|
4136
4189
|
};
|
|
4137
4190
|
|
|
4138
|
-
var styles$
|
|
4191
|
+
var styles$j = {"text-field":"_BkzdC","text-field--focus":"_Rop31","text-field--disabled":"_2x3Cm","text-field--invalid":"_3zOwV","text-field__toolbar":"_rQqnL"};
|
|
4139
4192
|
|
|
4140
4193
|
var useGrowTextAreaRef = function useGrowTextAreaRef(minHeight, maxHeight, autoGrow, forwardedRef) {
|
|
4141
4194
|
var textareaRef = useRef(null);
|
|
@@ -4210,7 +4263,7 @@ var TextAreaField = function TextAreaField(_ref) {
|
|
|
4210
4263
|
updateHeight = _useGrowTextAreaRef.updateHeight;
|
|
4211
4264
|
|
|
4212
4265
|
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement("div", {
|
|
4213
|
-
className: classnames(styles$
|
|
4266
|
+
className: classnames(styles$j['text-field'], (_classnames = {}, _classnames[styles$j['text-field--invalid']] = hasError, _classnames[styles$j['text-field--disabled']] = disabled, _classnames[styles$j['text-field--focus']] = hasFocus, _classnames)),
|
|
4214
4267
|
ref: containerRef,
|
|
4215
4268
|
onClick: function onClick(event) {
|
|
4216
4269
|
if (event.target === (containerRef === null || containerRef === void 0 ? void 0 : containerRef.current)) {
|
|
@@ -4242,7 +4295,7 @@ var TextAreaField = function TextAreaField(_ref) {
|
|
|
4242
4295
|
},
|
|
4243
4296
|
ref: textAreaRef
|
|
4244
4297
|
}), toolbar && React__default.createElement("div", {
|
|
4245
|
-
className: styles$
|
|
4298
|
+
className: styles$j['text-field__toolbar'],
|
|
4246
4299
|
id: controllers.id + "-toolbar",
|
|
4247
4300
|
ref: toolbarRef,
|
|
4248
4301
|
onClick: function onClick(event) {
|
|
@@ -4255,7 +4308,7 @@ var TextAreaField = function TextAreaField(_ref) {
|
|
|
4255
4308
|
}, toolbar)));
|
|
4256
4309
|
};
|
|
4257
4310
|
|
|
4258
|
-
var styles$
|
|
4311
|
+
var styles$k = {"text-field":"_20YOA","text-field--invalid":"_3kUSh","text-field--prefixed":"_3IU3Q","text-field--suffixed":"_QXJOD"};
|
|
4259
4312
|
|
|
4260
4313
|
var useTextField = function useTextField(_ref) {
|
|
4261
4314
|
var _classnames;
|
|
@@ -4293,7 +4346,7 @@ var useTextField = function useTextField(_ref) {
|
|
|
4293
4346
|
'aria-invalid': hasError,
|
|
4294
4347
|
autoComplete: autoComplete,
|
|
4295
4348
|
autoFocus: autoFocus,
|
|
4296
|
-
className: classnames(styles$
|
|
4349
|
+
className: classnames(styles$k['text-field'], (_classnames = {}, _classnames[styles$k['text-field--invalid']] = hasError, _classnames)),
|
|
4297
4350
|
'data-testid': "text-field-" + name,
|
|
4298
4351
|
disabled: disabled,
|
|
4299
4352
|
defaultValue: defaultValue,
|
|
@@ -4390,7 +4443,7 @@ var useCheckBoxFieldControllers = function useCheckBoxFieldControllers(_ref) {
|
|
|
4390
4443
|
return controllers;
|
|
4391
4444
|
};
|
|
4392
4445
|
|
|
4393
|
-
var styles$
|
|
4446
|
+
var styles$l = {"check-box-field":"_2sg0c","check-box-field__caption":"_2LdrP","check-box-field__custom-input":"_2mA8e"};
|
|
4394
4447
|
|
|
4395
4448
|
var CheckboxField = function CheckboxField(_ref) {
|
|
4396
4449
|
var name = _ref.name,
|
|
@@ -4417,7 +4470,7 @@ var CheckboxField = function CheckboxField(_ref) {
|
|
|
4417
4470
|
space: 8,
|
|
4418
4471
|
alignItems: "center"
|
|
4419
4472
|
}, React__default.createElement("div", {
|
|
4420
|
-
className: styles$
|
|
4473
|
+
className: styles$l['check-box-field']
|
|
4421
4474
|
}, React__default.createElement("input", {
|
|
4422
4475
|
name: name,
|
|
4423
4476
|
id: controllers.id,
|
|
@@ -4430,11 +4483,11 @@ var CheckboxField = function CheckboxField(_ref) {
|
|
|
4430
4483
|
onChange: controllers.onChange,
|
|
4431
4484
|
onBlur: controllers.onBlur
|
|
4432
4485
|
}), React__default.createElement("span", {
|
|
4433
|
-
className: styles$
|
|
4486
|
+
className: styles$l['check-box-field__custom-input']
|
|
4434
4487
|
})), label && React__default.createElement(Label, {
|
|
4435
4488
|
htmlFor: controllers.id
|
|
4436
4489
|
}, label)), caption && React__default.createElement("div", {
|
|
4437
|
-
className: styles$
|
|
4490
|
+
className: styles$l['check-box-field__caption']
|
|
4438
4491
|
}, React__default.createElement(Caption, {
|
|
4439
4492
|
fieldId: controllers.id
|
|
4440
4493
|
}, caption)), controllers.error && React__default.createElement(ErrorMessage, {
|
|
@@ -4442,7 +4495,7 @@ var CheckboxField = function CheckboxField(_ref) {
|
|
|
4442
4495
|
}, controllers.error));
|
|
4443
4496
|
};
|
|
4444
4497
|
|
|
4445
|
-
var styles$
|
|
4498
|
+
var styles$m = {"pill-select-field":"_g6T-p","pill-select-field__custom-input":"_1i2AX"};
|
|
4446
4499
|
|
|
4447
4500
|
var useMultiSelectFieldControllers = function useMultiSelectFieldControllers(_ref) {
|
|
4448
4501
|
var name = _ref.name,
|
|
@@ -4533,7 +4586,7 @@ var PillSelectField = function PillSelectField(_ref) {
|
|
|
4533
4586
|
var itemId = controllers.id + "-" + itemIdentifier;
|
|
4534
4587
|
return React__default.createElement("div", {
|
|
4535
4588
|
key: itemIdentifier,
|
|
4536
|
-
className: styles$
|
|
4589
|
+
className: styles$m['pill-select-field']
|
|
4537
4590
|
}, React__default.createElement("input", {
|
|
4538
4591
|
name: name + "-" + itemIdentifier,
|
|
4539
4592
|
id: itemId,
|
|
@@ -4555,7 +4608,7 @@ var PillSelectField = function PillSelectField(_ref) {
|
|
|
4555
4608
|
controllers.onChange(newValue);
|
|
4556
4609
|
}
|
|
4557
4610
|
}), React__default.createElement("span", {
|
|
4558
|
-
className: styles$
|
|
4611
|
+
className: styles$m['pill-select-field__custom-input']
|
|
4559
4612
|
}, option.label));
|
|
4560
4613
|
})));
|
|
4561
4614
|
};
|
|
@@ -4603,7 +4656,7 @@ var useRadioGroupFieldContext = function useRadioGroupFieldContext() {
|
|
|
4603
4656
|
return context;
|
|
4604
4657
|
};
|
|
4605
4658
|
|
|
4606
|
-
var styles$
|
|
4659
|
+
var styles$n = {"label":"_1WGz2","radio-group-field__label":"_RXyG_"};
|
|
4607
4660
|
|
|
4608
4661
|
var RadioGroupField = function RadioGroupField(_ref) {
|
|
4609
4662
|
var name = _ref.name,
|
|
@@ -4636,7 +4689,7 @@ var RadioGroupField = function RadioGroupField(_ref) {
|
|
|
4636
4689
|
}, React__default.createElement(Stack, {
|
|
4637
4690
|
space: 12
|
|
4638
4691
|
}, label && React__default.createElement("div", {
|
|
4639
|
-
className: styles$
|
|
4692
|
+
className: styles$n['radio-group-field__label']
|
|
4640
4693
|
}, label), React__default.createElement(Stack, {
|
|
4641
4694
|
space: 8
|
|
4642
4695
|
}, inline ? React__default.createElement(InlineOptions, null, children) : React__default.createElement(Stack, {
|
|
@@ -4670,7 +4723,7 @@ var InlineOptions = function InlineOptions(_ref2) {
|
|
|
4670
4723
|
return React__default.createElement(FormRow, null, children);
|
|
4671
4724
|
};
|
|
4672
4725
|
|
|
4673
|
-
var styles$
|
|
4726
|
+
var styles$o = {"radio-group-option":"_1Clmp","radio-group-option__caption":"_3UmWA","radio-group-option__custom-input":"_1tMq-"};
|
|
4674
4727
|
|
|
4675
4728
|
var RadioGroupOption = function RadioGroupOption(_ref) {
|
|
4676
4729
|
var value = _ref.value,
|
|
@@ -4688,7 +4741,7 @@ var RadioGroupOption = function RadioGroupOption(_ref) {
|
|
|
4688
4741
|
space: 8,
|
|
4689
4742
|
alignItems: "center"
|
|
4690
4743
|
}, React__default.createElement("div", {
|
|
4691
|
-
className: styles$
|
|
4744
|
+
className: styles$o['radio-group-option']
|
|
4692
4745
|
}, React__default.createElement("input", {
|
|
4693
4746
|
type: "radio",
|
|
4694
4747
|
id: id,
|
|
@@ -4698,19 +4751,19 @@ var RadioGroupOption = function RadioGroupOption(_ref) {
|
|
|
4698
4751
|
checked: radioGroupContext.value !== undefined ? radioGroupContext.value === value : undefined,
|
|
4699
4752
|
disabled: radioGroupContext.disabled
|
|
4700
4753
|
}), React__default.createElement("span", {
|
|
4701
|
-
className: styles$
|
|
4754
|
+
className: styles$o['radio-group-option__custom-input']
|
|
4702
4755
|
})), label && React__default.createElement(Label, {
|
|
4703
4756
|
htmlFor: id
|
|
4704
4757
|
}, label)), caption && React__default.createElement("div", {
|
|
4705
|
-
className: styles$
|
|
4758
|
+
className: styles$o['radio-group-option__caption']
|
|
4706
4759
|
}, React__default.createElement(Caption, {
|
|
4707
4760
|
fieldId: id
|
|
4708
4761
|
}, caption)));
|
|
4709
4762
|
};
|
|
4710
4763
|
|
|
4711
|
-
var styles$
|
|
4764
|
+
var styles$p = {"text-field":"_18Rzv","text-field--invalid":"_3eD7t","text-field--prefixed":"_2evrG","text-field--suffixed":"_-MgeO","password-container":"_-Rf3c","password-toggle":"_yinPY"};
|
|
4712
4765
|
|
|
4713
|
-
var styles$
|
|
4766
|
+
var styles$q = {"password-criteria":"_U0krC","password-criteria--invalid":"_2XIl4"};
|
|
4714
4767
|
|
|
4715
4768
|
var PasswordCriteria = function PasswordCriteria(_ref) {
|
|
4716
4769
|
var _classnames;
|
|
@@ -4718,7 +4771,7 @@ var PasswordCriteria = function PasswordCriteria(_ref) {
|
|
|
4718
4771
|
var met = _ref.met,
|
|
4719
4772
|
children = _ref.children;
|
|
4720
4773
|
return React__default.createElement("span", {
|
|
4721
|
-
className: classnames(styles$
|
|
4774
|
+
className: classnames(styles$q['password-criteria'], (_classnames = {}, _classnames[styles$q['password-criteria--invalid']] = !met, _classnames))
|
|
4722
4775
|
}, React__default.createElement(Inline, {
|
|
4723
4776
|
space: met ? 4 : 8
|
|
4724
4777
|
}, met ? React__default.createElement(IconCheck, {
|
|
@@ -4802,11 +4855,11 @@ var PasswordField = function PasswordField(_ref) {
|
|
|
4802
4855
|
error: controllers.error
|
|
4803
4856
|
};
|
|
4804
4857
|
return React__default.createElement(Field, Object.assign({}, fieldProps), React__default.createElement("div", {
|
|
4805
|
-
className: styles$
|
|
4858
|
+
className: styles$p['password-container']
|
|
4806
4859
|
}, React__default.createElement("input", {
|
|
4807
4860
|
name: name,
|
|
4808
4861
|
id: controllers.id,
|
|
4809
|
-
className: classnames(styles$
|
|
4862
|
+
className: classnames(styles$p['text-field'], (_classnames = {}, _classnames[styles$p['text-field--invalid']] = hasError, _classnames)),
|
|
4810
4863
|
type: type,
|
|
4811
4864
|
"data-testid": "text-field-" + name,
|
|
4812
4865
|
"aria-describedby": hasError ? controllers.id + "-error-message" : controllers.id + "-describer",
|
|
@@ -4818,7 +4871,7 @@ var PasswordField = function PasswordField(_ref) {
|
|
|
4818
4871
|
onChange: controllers.onChange,
|
|
4819
4872
|
onBlur: controllers.onBlur
|
|
4820
4873
|
}), React__default.createElement("div", {
|
|
4821
|
-
className: styles$
|
|
4874
|
+
className: styles$p['password-toggle'],
|
|
4822
4875
|
onClick: toggleType,
|
|
4823
4876
|
onKeyPress: toggleType,
|
|
4824
4877
|
"data-testid": "password-toggle",
|
|
@@ -5056,7 +5109,7 @@ var MultiSelectField = function MultiSelectField(_ref) {
|
|
|
5056
5109
|
}));
|
|
5057
5110
|
};
|
|
5058
5111
|
|
|
5059
|
-
var styles$
|
|
5112
|
+
var styles$r = {"custom-control":"_1cDCR"};
|
|
5060
5113
|
|
|
5061
5114
|
var _excluded$5 = ["children", "CustomPrefixComponent"];
|
|
5062
5115
|
|
|
@@ -5069,7 +5122,7 @@ function CustomControl(_ref) {
|
|
|
5069
5122
|
|
|
5070
5123
|
var selectedOption = (_props$getValue = props.getValue()) === null || _props$getValue === void 0 ? void 0 : _props$getValue[0];
|
|
5071
5124
|
return React__default.createElement(components.Control, Object.assign({}, props), CustomControl && selectedOption ? React__default.createElement("div", {
|
|
5072
|
-
className: styles$
|
|
5125
|
+
className: styles$r['custom-control'],
|
|
5073
5126
|
style: {
|
|
5074
5127
|
paddingLeft: selectedOption ? 8 : 0
|
|
5075
5128
|
}
|
|
@@ -5254,7 +5307,7 @@ var DatePickerCalendar = function DatePickerCalendar(_ref) {
|
|
|
5254
5307
|
|
|
5255
5308
|
var inputStyles = {"text-field":"_1btTx","date-field":"_1Sc9D","text-field--invalid":"_2feYp","date-field--invalid":"_2SNat","text-field--prefixed":"_E18JV","date-field--prefixed":"_jLolW","text-field--suffixed":"_27J43","date-field--suffixed":"_3eTNi"};
|
|
5256
5309
|
|
|
5257
|
-
var
|
|
5310
|
+
var dayStyles = {"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"};
|
|
5258
5311
|
|
|
5259
5312
|
function parseDate(str, format, locale) {
|
|
5260
5313
|
var parsed = dateFnsParse(str, format, new Date(), {
|
|
@@ -5338,7 +5391,7 @@ var DateField = function DateField(_ref) {
|
|
|
5338
5391
|
error: controllers.error
|
|
5339
5392
|
};
|
|
5340
5393
|
var dayPickerProps = {
|
|
5341
|
-
classNames:
|
|
5394
|
+
classNames: dayStyles,
|
|
5342
5395
|
disabledDays: function disabledDays(day) {
|
|
5343
5396
|
return _disabledDays && _disabledDays(setToMidnight(day));
|
|
5344
5397
|
},
|
|
@@ -5355,7 +5408,7 @@ var DateField = function DateField(_ref) {
|
|
|
5355
5408
|
})
|
|
5356
5409
|
}, React__default.createElement(DayPickerInput, {
|
|
5357
5410
|
format: format,
|
|
5358
|
-
classNames:
|
|
5411
|
+
classNames: dayStyles,
|
|
5359
5412
|
formatDate: formatDate,
|
|
5360
5413
|
parseDate: parseDate,
|
|
5361
5414
|
placeholder: placeholder || format.toUpperCase(),
|
|
@@ -5755,7 +5808,7 @@ var DateRangeField = function DateRangeField(_ref) {
|
|
|
5755
5808
|
})));
|
|
5756
5809
|
};
|
|
5757
5810
|
|
|
5758
|
-
var
|
|
5811
|
+
var weekStyles = {"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"};
|
|
5759
5812
|
|
|
5760
5813
|
var WeekField = function WeekField(_ref) {
|
|
5761
5814
|
var _classnames;
|
|
@@ -5830,7 +5883,7 @@ var WeekField = function WeekField(_ref) {
|
|
|
5830
5883
|
};
|
|
5831
5884
|
|
|
5832
5885
|
var dayPickerProps = {
|
|
5833
|
-
classNames:
|
|
5886
|
+
classNames: weekStyles,
|
|
5834
5887
|
disabledDays: function disabledDays(day) {
|
|
5835
5888
|
return _disabledDays && _disabledDays(setToMidnight(day));
|
|
5836
5889
|
},
|
|
@@ -5860,7 +5913,7 @@ var WeekField = function WeekField(_ref) {
|
|
|
5860
5913
|
})
|
|
5861
5914
|
}, React__default.createElement(DayPickerInput, {
|
|
5862
5915
|
format: format,
|
|
5863
|
-
classNames:
|
|
5916
|
+
classNames: weekStyles,
|
|
5864
5917
|
formatDate: formatDate,
|
|
5865
5918
|
parseDate: parseDate,
|
|
5866
5919
|
placeholder: placeholder || format.toUpperCase(),
|
|
@@ -6056,39 +6109,9 @@ var PercentageElement = function PercentageElement(_ref, ref) {
|
|
|
6056
6109
|
|
|
6057
6110
|
var PercentageField = forwardRef(PercentageElement);
|
|
6058
6111
|
|
|
6059
|
-
var styles$
|
|
6060
|
-
|
|
6061
|
-
var Toggle = function Toggle(_ref) {
|
|
6062
|
-
var checked = _ref.checked,
|
|
6063
|
-
label = _ref.label,
|
|
6064
|
-
caption = _ref.caption,
|
|
6065
|
-
onChange = _ref.onChange,
|
|
6066
|
-
_ref$disabled = _ref.disabled,
|
|
6067
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
6068
|
-
id = _ref.id;
|
|
6069
|
-
return React__default.createElement(Stack, {
|
|
6070
|
-
space: 8
|
|
6071
|
-
}, React__default.createElement("label", {
|
|
6072
|
-
className: styles$u['toggle']
|
|
6073
|
-
}, React__default.createElement("input", {
|
|
6074
|
-
"data-testid": "toggle",
|
|
6075
|
-
type: "checkbox",
|
|
6076
|
-
checked: checked,
|
|
6077
|
-
onChange: onChange,
|
|
6078
|
-
disabled: disabled,
|
|
6079
|
-
id: id
|
|
6080
|
-
}), React__default.createElement("span", {
|
|
6081
|
-
className: styles$u['toggle__switch']
|
|
6082
|
-
}), label && React__default.createElement("span", {
|
|
6083
|
-
className: styles$u['toggle__label']
|
|
6084
|
-
}, label)), caption && React__default.createElement("span", {
|
|
6085
|
-
className: styles$u['toggle__caption']
|
|
6086
|
-
}, caption));
|
|
6087
|
-
};
|
|
6088
|
-
|
|
6089
|
-
var styles$v = {"overlay":"_2puqJ","overlay--after-open":"_1167h","overlay--before-close":"_t_t7L","content":"_wQQ_2","content--after-open":"_3jwux","content--before-close":"_2c2QP"};
|
|
6112
|
+
var styles$t = {"overlay":"_2puqJ","overlay--after-open":"_1167h","overlay--before-close":"_t_t7L","content":"_wQQ_2","content--after-open":"_3jwux","content--before-close":"_2c2QP"};
|
|
6090
6113
|
|
|
6091
|
-
var styles$
|
|
6114
|
+
var styles$u = {"header":"_36nxW","sub-header":"_2XwRD"};
|
|
6092
6115
|
|
|
6093
6116
|
var ModalHeader = function ModalHeader(_ref) {
|
|
6094
6117
|
var header = _ref.header,
|
|
@@ -6100,12 +6123,12 @@ var ModalHeader = function ModalHeader(_ref) {
|
|
|
6100
6123
|
flex: [1],
|
|
6101
6124
|
alignItems: "center"
|
|
6102
6125
|
}, React__default.createElement("span", {
|
|
6103
|
-
className: styles$
|
|
6126
|
+
className: styles$u['header']
|
|
6104
6127
|
}, header), React__default.createElement(Button$1, {
|
|
6105
6128
|
theme: "link-icon",
|
|
6106
6129
|
onClick: onClose
|
|
6107
6130
|
}, React__default.createElement(IconTimes, null))), subHeader && React__default.createElement("div", {
|
|
6108
|
-
className: styles$
|
|
6131
|
+
className: styles$u['sub-header']
|
|
6109
6132
|
}, subHeader));
|
|
6110
6133
|
};
|
|
6111
6134
|
|
|
@@ -6141,14 +6164,14 @@ var Modal = function Modal(_ref) {
|
|
|
6141
6164
|
contentLabel: "Modal",
|
|
6142
6165
|
appElement: rootElementId && document.getElementById(rootElementId) || undefined,
|
|
6143
6166
|
overlayClassName: {
|
|
6144
|
-
base: styles$
|
|
6145
|
-
afterOpen: styles$
|
|
6146
|
-
beforeClose: styles$
|
|
6167
|
+
base: styles$t['overlay'],
|
|
6168
|
+
afterOpen: styles$t['overlay--after-open'],
|
|
6169
|
+
beforeClose: styles$t['overlay--before-close']
|
|
6147
6170
|
},
|
|
6148
6171
|
className: {
|
|
6149
|
-
base: styles$
|
|
6150
|
-
afterOpen: styles$
|
|
6151
|
-
beforeClose: styles$
|
|
6172
|
+
base: styles$t['content'],
|
|
6173
|
+
afterOpen: styles$t['content--after-open'],
|
|
6174
|
+
beforeClose: styles$t['content--before-close']
|
|
6152
6175
|
}
|
|
6153
6176
|
}, React__default.createElement(ModalHeader, {
|
|
6154
6177
|
header: header,
|
|
@@ -6161,16 +6184,16 @@ Modal.setAppElement = function (rootElement) {
|
|
|
6161
6184
|
ReactModal.setAppElement(rootElement);
|
|
6162
6185
|
};
|
|
6163
6186
|
|
|
6164
|
-
var styles$
|
|
6187
|
+
var styles$v = {"modal-body":"_2J-ku"};
|
|
6165
6188
|
|
|
6166
6189
|
var ModalBody = function ModalBody(_ref) {
|
|
6167
6190
|
var children = _ref.children;
|
|
6168
6191
|
return React__default.createElement("div", {
|
|
6169
|
-
className: styles$
|
|
6192
|
+
className: styles$v['modal-body']
|
|
6170
6193
|
}, children);
|
|
6171
6194
|
};
|
|
6172
6195
|
|
|
6173
|
-
var styles$
|
|
6196
|
+
var styles$w = {"modal-footer":"_LKOr5","tertiary-container":"_Qktd-"};
|
|
6174
6197
|
|
|
6175
6198
|
var ModalFooter = function ModalFooter(_ref) {
|
|
6176
6199
|
var children = _ref.children,
|
|
@@ -6191,7 +6214,7 @@ var ModalFooter = function ModalFooter(_ref) {
|
|
|
6191
6214
|
return React__default.createElement(FooterContainer, null, React__default.createElement(Inline, {
|
|
6192
6215
|
justifyContent: "space-between"
|
|
6193
6216
|
}, React__default.createElement("div", {
|
|
6194
|
-
className: classnames((_classnames = {}, _classnames[styles$
|
|
6217
|
+
className: classnames((_classnames = {}, _classnames[styles$w['tertiary-container']] = tertiaryButton && tertiaryButton.props.theme.startsWith('link'), _classnames))
|
|
6195
6218
|
}, tertiaryButton || React__default.createElement("div", null)), React__default.createElement(Inline, {
|
|
6196
6219
|
space: 12
|
|
6197
6220
|
}, secondaryButton, primaryButton)));
|
|
@@ -6219,7 +6242,7 @@ var FooterContainer = function FooterContainer(_ref2) {
|
|
|
6219
6242
|
var childrenItens = React__default.Children.toArray(children);
|
|
6220
6243
|
var hasCustomAlignment = childrenItens.length === 1 && childrenItens[0].type === Inline;
|
|
6221
6244
|
return React__default.createElement("div", {
|
|
6222
|
-
className: styles$
|
|
6245
|
+
className: styles$w['modal-footer']
|
|
6223
6246
|
}, React__default.createElement(Inline, {
|
|
6224
6247
|
justifyContent: "end",
|
|
6225
6248
|
space: 12,
|
|
@@ -6227,7 +6250,161 @@ var FooterContainer = function FooterContainer(_ref2) {
|
|
|
6227
6250
|
}, children));
|
|
6228
6251
|
};
|
|
6229
6252
|
|
|
6230
|
-
var
|
|
6253
|
+
var CALENDAR_MODE = {
|
|
6254
|
+
DAY: 'day',
|
|
6255
|
+
WEEK: 'week'
|
|
6256
|
+
};
|
|
6257
|
+
var CALENDAR_PLACEMENT = {
|
|
6258
|
+
BOTTOM: 'bottom',
|
|
6259
|
+
TOP: 'top'
|
|
6260
|
+
};
|
|
6261
|
+
|
|
6262
|
+
var calculateCalendarPosition = function calculateCalendarPosition(placement, anchorPosition, calendarDimensions) {
|
|
6263
|
+
if (!calendarDimensions) {
|
|
6264
|
+
return {
|
|
6265
|
+
left: 0,
|
|
6266
|
+
top: 0
|
|
6267
|
+
};
|
|
6268
|
+
}
|
|
6269
|
+
|
|
6270
|
+
var horizontalPosition = getHorizontalPosition(anchorPosition, calendarDimensions);
|
|
6271
|
+
var verticalPosition = getVerticalPosition(anchorPosition, placement, calendarDimensions);
|
|
6272
|
+
return _extends({}, horizontalPosition, verticalPosition);
|
|
6273
|
+
};
|
|
6274
|
+
|
|
6275
|
+
var getHorizontalPosition = function getHorizontalPosition(anchorPosition, calendarDimensions) {
|
|
6276
|
+
var innerWidth = window.innerWidth;
|
|
6277
|
+
var calendarRight = anchorPosition.left + calendarDimensions.width;
|
|
6278
|
+
|
|
6279
|
+
if (innerWidth > calendarRight + BUFFER) {
|
|
6280
|
+
return {
|
|
6281
|
+
left: anchorPosition.left
|
|
6282
|
+
};
|
|
6283
|
+
}
|
|
6284
|
+
|
|
6285
|
+
return {
|
|
6286
|
+
left: anchorPosition.right - calendarDimensions.width
|
|
6287
|
+
};
|
|
6288
|
+
};
|
|
6289
|
+
|
|
6290
|
+
var getVerticalPosition = function getVerticalPosition(anchorPosition, placement, calendarDimensions) {
|
|
6291
|
+
var calendarTopAboveTrigger = anchorPosition.top - calendarDimensions.height - PADDING;
|
|
6292
|
+
var calendarTopBelowTrigger = anchorPosition.bottom + PADDING;
|
|
6293
|
+
|
|
6294
|
+
if (placement === CALENDAR_PLACEMENT.TOP) {
|
|
6295
|
+
if (calendarTopAboveTrigger < 0) {
|
|
6296
|
+
return {
|
|
6297
|
+
top: anchorPosition.bottom + PADDING
|
|
6298
|
+
};
|
|
6299
|
+
}
|
|
6300
|
+
|
|
6301
|
+
return {
|
|
6302
|
+
top: calendarTopAboveTrigger + window.scrollY
|
|
6303
|
+
};
|
|
6304
|
+
} else {
|
|
6305
|
+
if (calendarTopBelowTrigger + calendarDimensions.height > window.innerHeight) {
|
|
6306
|
+
return {
|
|
6307
|
+
top: calendarTopAboveTrigger + window.scrollY
|
|
6308
|
+
};
|
|
6309
|
+
}
|
|
6310
|
+
|
|
6311
|
+
return {
|
|
6312
|
+
top: calendarTopBelowTrigger + window.scrollY
|
|
6313
|
+
};
|
|
6314
|
+
}
|
|
6315
|
+
};
|
|
6316
|
+
|
|
6317
|
+
var Calendar = function Calendar(_ref) {
|
|
6318
|
+
var _ref$mode = _ref.mode,
|
|
6319
|
+
mode = _ref$mode === void 0 ? CALENDAR_MODE.DAY : _ref$mode,
|
|
6320
|
+
_ref$position = _ref.position,
|
|
6321
|
+
position = _ref$position === void 0 ? CALENDAR_PLACEMENT.BOTTOM : _ref$position,
|
|
6322
|
+
_ref$weekStart = _ref.weekStart,
|
|
6323
|
+
weekStart = _ref$weekStart === void 0 ? 0 : _ref$weekStart,
|
|
6324
|
+
selected = _ref.selected,
|
|
6325
|
+
onSelect = _ref.onSelect,
|
|
6326
|
+
onClickOutside = _ref.onClickOutside,
|
|
6327
|
+
disabledDays = _ref.disabledDays,
|
|
6328
|
+
anchorRef = _ref.anchorRef;
|
|
6329
|
+
|
|
6330
|
+
var _useState = useState(null),
|
|
6331
|
+
calendarRef = _useState[0],
|
|
6332
|
+
setCalendarRef = _useState[1];
|
|
6333
|
+
|
|
6334
|
+
var style = mode === CALENDAR_MODE.DAY ? dayStyles : weekStyles;
|
|
6335
|
+
var anchorNode = anchorRef.current;
|
|
6336
|
+
useOnClickOutside({
|
|
6337
|
+
current: calendarRef
|
|
6338
|
+
}, function (event) {
|
|
6339
|
+
var _anchorRef$current;
|
|
6340
|
+
|
|
6341
|
+
if (!((_anchorRef$current = anchorRef.current) !== null && _anchorRef$current !== void 0 && _anchorRef$current.contains(event === null || event === void 0 ? void 0 : event.srcElement))) {
|
|
6342
|
+
onClickOutside();
|
|
6343
|
+
}
|
|
6344
|
+
});
|
|
6345
|
+
var weekRange = selected ? createWeekRange(selected, weekStart) : undefined;
|
|
6346
|
+
var selectedRange = weekRange && {
|
|
6347
|
+
from: weekRange.start,
|
|
6348
|
+
to: weekRange.end
|
|
6349
|
+
};
|
|
6350
|
+
|
|
6351
|
+
var handleSelect = function handleSelect(day) {
|
|
6352
|
+
var selectedDate = setToMidnight(day);
|
|
6353
|
+
|
|
6354
|
+
if (mode === CALENDAR_MODE.DAY) {
|
|
6355
|
+
onSelect(selectedDate);
|
|
6356
|
+
} else {
|
|
6357
|
+
var _weekRange = createWeekRange(selectedDate, weekStart);
|
|
6358
|
+
|
|
6359
|
+
onSelect(_weekRange.start);
|
|
6360
|
+
}
|
|
6361
|
+
|
|
6362
|
+
setTimeout(function () {
|
|
6363
|
+
onClickOutside();
|
|
6364
|
+
}, 100);
|
|
6365
|
+
};
|
|
6366
|
+
|
|
6367
|
+
if (!anchorNode) {
|
|
6368
|
+
return null;
|
|
6369
|
+
}
|
|
6370
|
+
|
|
6371
|
+
var anchorPosition = anchorNode.getBoundingClientRect();
|
|
6372
|
+
var calendarPosition = calculateCalendarPosition(position, anchorPosition, calendarRef === null || calendarRef === void 0 ? void 0 : calendarRef.getBoundingClientRect());
|
|
6373
|
+
return React__default.createElement(Portal, null, React__default.createElement("div", {
|
|
6374
|
+
className: style.overlayWrapper
|
|
6375
|
+
}, React__default.createElement("div", {
|
|
6376
|
+
className: style.overlay,
|
|
6377
|
+
ref: function ref(_ref2) {
|
|
6378
|
+
return setCalendarRef(_ref2);
|
|
6379
|
+
},
|
|
6380
|
+
style: _extends({}, calendarPosition, {
|
|
6381
|
+
zIndex: Z_INDEX_LAYERS.MODAL
|
|
6382
|
+
})
|
|
6383
|
+
}, React__default.createElement(DayPicker, {
|
|
6384
|
+
format: "MM/dd/yyyy",
|
|
6385
|
+
classNames: style,
|
|
6386
|
+
onDayClick: function onDayClick(day, activeModifiers) {
|
|
6387
|
+
var isDateDisabled = Object.keys(activeModifiers).find(function (modifier) {
|
|
6388
|
+
return modifier.includes('disabled');
|
|
6389
|
+
});
|
|
6390
|
+
|
|
6391
|
+
if (!Boolean(isDateDisabled)) {
|
|
6392
|
+
handleSelect(day);
|
|
6393
|
+
}
|
|
6394
|
+
},
|
|
6395
|
+
selectedDays: mode === CALENDAR_MODE.DAY ? selected : selectedRange,
|
|
6396
|
+
disabledDays: disabledDays,
|
|
6397
|
+
months: MONTH_NAMES,
|
|
6398
|
+
weekdaysLong: DAYS,
|
|
6399
|
+
weekdaysShort: DAYS.map(function (day) {
|
|
6400
|
+
return day.substring(0, 2);
|
|
6401
|
+
}),
|
|
6402
|
+
showOutsideDays: mode === CALENDAR_MODE.WEEK,
|
|
6403
|
+
firstDayOfWeek: weekStart
|
|
6404
|
+
}))));
|
|
6405
|
+
};
|
|
6406
|
+
|
|
6407
|
+
var styles$x = {"badge":"_2f81N","badge--warning":"_2g1GI","badge--danger":"_2zLnM","badge--success":"_27QOo","badge--info":"_2gmsM"};
|
|
6231
6408
|
|
|
6232
6409
|
var _excluded$a = ["children", "theme", "title"];
|
|
6233
6410
|
|
|
@@ -6250,16 +6427,16 @@ var Badge = function Badge(_ref, forwardedRef) {
|
|
|
6250
6427
|
overlay: title,
|
|
6251
6428
|
ref: ref
|
|
6252
6429
|
}, React__default.createElement("div", Object.assign({
|
|
6253
|
-
className: classnames(styles$
|
|
6430
|
+
className: classnames(styles$x['badge'], (_classnames = {}, _classnames[styles$x['badge--success']] = theme === 'success', _classnames[styles$x['badge--danger']] = theme === 'danger', _classnames[styles$x['badge--info']] = theme === 'info', _classnames[styles$x['badge--warning']] = theme === 'warning', _classnames)),
|
|
6254
6431
|
ref: ref
|
|
6255
6432
|
}, otherProps), children));
|
|
6256
6433
|
};
|
|
6257
6434
|
|
|
6258
6435
|
var Badge$1 = forwardRef(Badge);
|
|
6259
6436
|
|
|
6260
|
-
var styles$
|
|
6437
|
+
var styles$y = {"avatar":"_2wJGB","avatar--small":"_3QTSo","avatar__badge":"_2Rl8S","avatar--medium":"_1zwj0","avatar--large":"_3-U6x","avatar--extra-large":"_3qn2q"};
|
|
6261
6438
|
|
|
6262
|
-
var styles$
|
|
6439
|
+
var styles$z = {"avatar-image":"_GKL9P"};
|
|
6263
6440
|
|
|
6264
6441
|
var AvatarImage = function AvatarImage(_ref) {
|
|
6265
6442
|
var url = _ref.url,
|
|
@@ -6284,7 +6461,7 @@ var AvatarImage = function AvatarImage(_ref) {
|
|
|
6284
6461
|
}
|
|
6285
6462
|
|
|
6286
6463
|
return React__default.createElement("div", {
|
|
6287
|
-
className: styles$
|
|
6464
|
+
className: styles$z['avatar-image']
|
|
6288
6465
|
}, React__default.createElement(IconUserSolid, {
|
|
6289
6466
|
size: "flexible",
|
|
6290
6467
|
color: color
|
|
@@ -6352,7 +6529,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
6352
6529
|
|
|
6353
6530
|
var backgroundColor = url ? GREY200 : color;
|
|
6354
6531
|
return React__default.createElement("div", {
|
|
6355
|
-
className: classnames(styles$
|
|
6532
|
+
className: classnames(styles$y['avatar'], (_classnames = {}, _classnames[styles$y['avatar--small']] = size === 'small', _classnames[styles$y['avatar--medium']] = size === 'medium', _classnames[styles$y['avatar--large']] = size === 'large', _classnames[styles$y['avatar--extra-large']] = size === 'extra-large', _classnames)),
|
|
6356
6533
|
style: {
|
|
6357
6534
|
backgroundColor: children || url && !showIconInsteadOfImage ? backgroundColor : defaultProfilePictureColors.backgroundColor
|
|
6358
6535
|
}
|
|
@@ -6364,9 +6541,9 @@ var Avatar = function Avatar(_ref) {
|
|
|
6364
6541
|
return setShowIconInsteadOfImage(true);
|
|
6365
6542
|
}
|
|
6366
6543
|
}), badge && size !== 'small' && React__default.createElement("div", {
|
|
6367
|
-
className: styles$
|
|
6544
|
+
className: styles$y['avatar__badge']
|
|
6368
6545
|
}, badge));
|
|
6369
6546
|
};
|
|
6370
6547
|
|
|
6371
|
-
export { Avatar, Badge$1 as Badge, Button$1 as Button, CheckboxField, CurrencyField, DataTable, DataTableCell, DataTableEditableCell, DataTableRow, DateField, DateRangeField, Form, FormRow, IconAnalytics, IconArrowDown, IconArrowLeft, IconArrowRight, IconArrowToTop, IconArrowUp, IconAward, IconBalanceScale, IconBalanceScaleLeft, IconBan, IconBarsH, IconBarsV, IconBell, IconBirthdayCake, IconBold, IconBolt, IconBook, IconBriefcase, IconBullseyeArrow, IconCalculator, IconCalendar, IconCalendarAlt, IconCalendarCheck, IconCalendarDay, IconCalendarExclamation, IconCalendarStar, IconCalendarTomorrow, IconCamera, IconCameraSlash, IconCashRegister, IconChartBar, IconCheck, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconClipboardList, IconClock, IconCog, IconComment, IconCommentLines, IconCopy, IconCreditCard, IconCreditCardPlus, IconDownload, IconEdit, IconEllipsisV, IconEnvelope, IconExclaimation, IconExclaimationTriangle, IconExpand, IconExternalLink, IconEye, IconEyeSlash, IconFile, IconFilePdf, IconFlag, IconFourDotsCircle, IconFourSquares, IconGavel, IconGif, IconGift, IconGrinBeam, IconGripVertical, IconHandshake, IconImage, IconInfoCircle, IconIslandTropical, IconItalic, IconLaptopSearch, IconLink, IconList, IconListOI as IconListOi, IconLock, IconMagicSolid, IconMapMarker, IconMegaphone, IconMinus, IconMinusCircle, IconMoneyBill, IconNotesMedical, IconOvertime, IconPaperPlane, IconPaperPlaneClock, IconPaperclip, IconPencil, IconPercentage, IconPhone, IconPlug, IconPlus, IconPrint, IconQuestionCircle, IconRepeat, IconSearch, IconSignOut, IconSitemap, IconSlidersH, IconSort, IconStar, IconStarSolid, IconStickyNoteLines, IconStopwatch, IconStrikethrough, IconSync, IconSyncExclaimation, IconTachometer, IconTimes, IconTimesOctagon, IconTrash, IconUnderline, IconUndo, IconUniversity, IconUserComputer, IconUserLight, IconUserPlus, IconUserSlash, IconUserSolid, IconUserTag, IconUserTie, IconUsers, IconVideo, IconVolume, IconVolumeMute, IconWrench, Inline, Modal, ModalBody, ModalFooter, MultiSelectField, PaginationControls, PasswordField, PercentageField, PillSelectField, RadioGroupField, RadioGroupOption, ResourceTable, ResourceTableRow, SIZE_25_PERCENT, SIZE_33_PERCENT, SIZE_50_PERCENT, SIZE_66_PERCENT, SIZE_75_PERCENT, SelectField, Spinner, Stack, TextAreaField, TextField, TimeField, Toggle, ToolbarSelect, Tooltip$1 as Tooltip, WeekField };
|
|
6548
|
+
export { Avatar, Badge$1 as Badge, Button$1 as Button, Calendar, CheckboxField, CurrencyField, DataTable, DataTableCell, DataTableEditableCell, DataTableRow, DateField, DateRangeField, Form, FormRow, IconAnalytics, IconArrowDown, IconArrowLeft, IconArrowRight, IconArrowToTop, IconArrowUp, IconAward, IconBalanceScale, IconBalanceScaleLeft, IconBan, IconBarsH, IconBarsV, IconBell, IconBirthdayCake, IconBold, IconBolt, IconBook, IconBriefcase, IconBullseyeArrow, IconCalculator, IconCalendar, IconCalendarAlt, IconCalendarCheck, IconCalendarDay, IconCalendarExclamation, IconCalendarStar, IconCalendarTomorrow, IconCamera, IconCameraSlash, IconCashRegister, IconChartBar, IconCheck, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconClipboardList, IconClock, IconCog, IconComment, IconCommentLines, IconCopy, IconCreditCard, IconCreditCardPlus, IconDownload, IconEdit, IconEllipsisV, IconEnvelope, IconExclaimation, IconExclaimationTriangle, IconExpand, IconExternalLink, IconEye, IconEyeSlash, IconFile, IconFilePdf, IconFlag, IconFourDotsCircle, IconFourSquares, IconGavel, IconGif, IconGift, IconGrinBeam, IconGripVertical, IconHandshake, IconImage, IconInfoCircle, IconIslandTropical, IconItalic, IconLaptopSearch, IconLink, IconList, IconListOI as IconListOi, IconLock, IconMagicSolid, IconMapMarker, IconMegaphone, IconMinus, IconMinusCircle, IconMoneyBill, IconNotesMedical, IconOvertime, IconPaperPlane, IconPaperPlaneClock, IconPaperclip, IconPencil, IconPercentage, IconPhone, IconPlug, IconPlus, IconPrint, IconQuestionCircle, IconRepeat, IconSearch, IconSignOut, IconSitemap, IconSlidersH, IconSort, IconStar, IconStarSolid, IconStickyNoteLines, IconStopwatch, IconStrikethrough, IconSync, IconSyncExclaimation, IconTachometer, IconTimes, IconTimesOctagon, IconTrash, IconUnderline, IconUndo, IconUniversity, IconUserComputer, IconUserLight, IconUserPlus, IconUserSlash, IconUserSolid, IconUserTag, IconUserTie, IconUsers, IconVideo, IconVolume, IconVolumeMute, IconWrench, Inline, Modal, ModalBody, ModalFooter, MultiSelectField, PaginationControls, PasswordField, PercentageField, PillSelectField, RadioGroupField, RadioGroupOption, ResourceTable, ResourceTableRow, SIZE_25_PERCENT, SIZE_33_PERCENT, SIZE_50_PERCENT, SIZE_66_PERCENT, SIZE_75_PERCENT, SelectField, Spinner, Stack, TextAreaField, TextField, TimeField, Toggle, ToolbarSelect, Tooltip$1 as Tooltip, WeekField };
|
|
6372
6549
|
//# sourceMappingURL=index.modern.js.map
|