@7shifts/sous-chef 2.3.1 → 2.3.5
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/DataTable.d.ts +1 -1
- package/dist/core/DataTable/DataTableContext.d.ts +1 -1
- package/dist/forms/Form/types.d.ts +3 -18
- package/dist/icons/components/IconGif.d.ts +11 -0
- package/dist/icons/components/index.d.ts +1 -0
- package/dist/index.css +30 -8
- package/dist/index.js +59 -43
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +60 -45
- package/dist/index.modern.js.map +1 -1
- package/dist/overlay/Tooltip/Tooltip.d.ts +1 -0
- package/dist/utils/formik.d.ts +1 -0
- package/package.json +2 -2
package/dist/index.modern.js
CHANGED
|
@@ -3,7 +3,7 @@ import classnames from 'classnames';
|
|
|
3
3
|
import ReactDOM from 'react-dom';
|
|
4
4
|
import Select, { components } from 'react-select';
|
|
5
5
|
import DayPickerInput from 'react-day-picker/DayPickerInput';
|
|
6
|
-
import { startOfDay } from 'date-fns';
|
|
6
|
+
import { isDate, startOfDay } from 'date-fns';
|
|
7
7
|
import { DateUtils } from 'react-day-picker';
|
|
8
8
|
import dateFnsFormat from 'date-fns/format';
|
|
9
9
|
import dateFnsParse from 'date-fns/parse';
|
|
@@ -389,7 +389,9 @@ var TooltipOverlay = function TooltipOverlay(_ref) {
|
|
|
389
389
|
}, []);
|
|
390
390
|
var tooltipRectPosition = tooltipRef === null || tooltipRef === void 0 ? void 0 : (_tooltipRef$current = tooltipRef.current) === null || _tooltipRef$current === void 0 ? void 0 : _tooltipRef$current.getBoundingClientRect();
|
|
391
391
|
var position = calculatePosition(placement, anchorPosition, tooltipRectPosition);
|
|
392
|
-
return React__default.createElement(Portal, null, React__default.createElement("div",
|
|
392
|
+
return React__default.createElement(Portal, null, React__default.createElement("div", {
|
|
393
|
+
role: "tooltip"
|
|
394
|
+
}, React__default.createElement("div", {
|
|
393
395
|
ref: tooltipRef,
|
|
394
396
|
style: _extends({}, position.overlay, {
|
|
395
397
|
zIndex: Z_INDEX_LAYERS.TOOLTIP
|
|
@@ -425,6 +427,7 @@ var Tooltip = function Tooltip(_ref, forwardedRef) {
|
|
|
425
427
|
header = _ref.header,
|
|
426
428
|
extraClass = _ref.extraClass,
|
|
427
429
|
onClose = _ref.onClose,
|
|
430
|
+
onVisibleChange = _ref.onVisibleChange,
|
|
428
431
|
children = _ref.children;
|
|
429
432
|
var checkIsMounted = useIsMounted();
|
|
430
433
|
var internalRef = useRef(null);
|
|
@@ -436,6 +439,11 @@ var Tooltip = function Tooltip(_ref, forwardedRef) {
|
|
|
436
439
|
|
|
437
440
|
var isFocusingOnTooltip = useRef(false);
|
|
438
441
|
var isFocusingOnAnchor = useRef(false);
|
|
442
|
+
useEffect(function () {
|
|
443
|
+
if (isVisible && !header && !overlay) {
|
|
444
|
+
setIsVisible(false);
|
|
445
|
+
}
|
|
446
|
+
}, [isVisible, header, overlay]);
|
|
439
447
|
|
|
440
448
|
var updateOverlayVisibility = function updateOverlayVisibility(shouldShow) {
|
|
441
449
|
setIsVisible(shouldShow);
|
|
@@ -443,6 +451,10 @@ var Tooltip = function Tooltip(_ref, forwardedRef) {
|
|
|
443
451
|
if (!shouldShow) {
|
|
444
452
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
445
453
|
}
|
|
454
|
+
|
|
455
|
+
if (onVisibleChange) {
|
|
456
|
+
onVisibleChange(shouldShow);
|
|
457
|
+
}
|
|
446
458
|
};
|
|
447
459
|
|
|
448
460
|
var onAnchorFocusIn = function onAnchorFocusIn() {
|
|
@@ -1797,6 +1809,25 @@ var IconGavel = function IconGavel(props) {
|
|
|
1797
1809
|
|
|
1798
1810
|
IconGavel.displayName = 'IconGavel';
|
|
1799
1811
|
|
|
1812
|
+
var IconGif = function IconGif(props) {
|
|
1813
|
+
return React__default.createElement("svg", Object.assign({
|
|
1814
|
+
viewBox: "0 0 20 20",
|
|
1815
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1816
|
+
"data-testid": "icon-gif",
|
|
1817
|
+
style: getIconStyles(props)
|
|
1818
|
+
}, props), React__default.createElement("path", {
|
|
1819
|
+
d: "M18.096 2.85H1.906c-.79 0-1.43.64-1.43 1.429v11.428c0 .79.64 1.429 1.43 1.429h16.19c.789 0 1.428-.64 1.428-1.429V4.28c0-.79-.64-1.429-1.428-1.429Z",
|
|
1820
|
+
stroke: "currentColor",
|
|
1821
|
+
strokeWidth: 0.952,
|
|
1822
|
+
fill: "none"
|
|
1823
|
+
}), React__default.createElement("path", {
|
|
1824
|
+
d: "M7.124 12.541c.876 0 1.592-.373 2.087-.93V9.715H6.804v.785h1.524v.785c-.23.22-.686.457-1.204.457-1.006 0-1.753-.777-1.753-1.836 0-1.074.747-1.836 1.753-1.836a1.64 1.64 0 0 1 1.318.678l.724-.42c-.404-.578-1.052-1.05-2.042-1.05-1.478 0-2.667 1.028-2.667 2.628 0 1.592 1.189 2.636 2.667 2.636Zm3.907-.099V7.36h-.892v5.082h.892Zm1.971 0V10.24h2.538v-.785h-2.538v-1.31h2.59V7.36h-3.481v5.082h.891Z",
|
|
1825
|
+
fill: "currentColor"
|
|
1826
|
+
}));
|
|
1827
|
+
};
|
|
1828
|
+
|
|
1829
|
+
IconGif.displayName = 'IconGif';
|
|
1830
|
+
|
|
1800
1831
|
var IconGift = function IconGift(props) {
|
|
1801
1832
|
return React__default.createElement("svg", Object.assign({
|
|
1802
1833
|
viewBox: "0 0 20 20",
|
|
@@ -2857,7 +2888,7 @@ var IconWrench = function IconWrench(props) {
|
|
|
2857
2888
|
|
|
2858
2889
|
IconWrench.displayName = 'IconWrench';
|
|
2859
2890
|
|
|
2860
|
-
var styles$6 = {"item":"_3DlpO","
|
|
2891
|
+
var styles$6 = {"item":"_3DlpO","selected":"_NS-B9","clickable":"_2jPpF","item-column":"_3ENNn","actions":"_1FTaE"};
|
|
2861
2892
|
|
|
2862
2893
|
var ResourceTableRow = function ResourceTableRow(_ref) {
|
|
2863
2894
|
var _classnames;
|
|
@@ -3174,7 +3205,7 @@ var useDataTableContext = function useDataTableContext() {
|
|
|
3174
3205
|
return context;
|
|
3175
3206
|
};
|
|
3176
3207
|
|
|
3177
|
-
var styles$9 = {"item":"_1d8Ci","
|
|
3208
|
+
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"};
|
|
3178
3209
|
|
|
3179
3210
|
var DataTableRow = function DataTableRow(_ref) {
|
|
3180
3211
|
var _classnames;
|
|
@@ -3362,7 +3393,7 @@ var DataTable = function DataTable(_ref) {
|
|
|
3362
3393
|
numberOfRows: numberOfRows,
|
|
3363
3394
|
hasVerticalBorders: hasVerticalBorders
|
|
3364
3395
|
}
|
|
3365
|
-
}, React__default.createElement("div", null, React__default.createElement(DataTableHeader, {
|
|
3396
|
+
}, React__default.createElement("div", null, columns && React__default.createElement(DataTableHeader, {
|
|
3366
3397
|
columns: columns,
|
|
3367
3398
|
onSort: onSort,
|
|
3368
3399
|
showActionMenu: showActionMenu
|
|
@@ -3422,7 +3453,7 @@ var DataTableCell = function DataTableCell(_ref) {
|
|
|
3422
3453
|
var _useDataTableContext = useDataTableContext(),
|
|
3423
3454
|
columns = _useDataTableContext.columns;
|
|
3424
3455
|
|
|
3425
|
-
var column = (_columns$columnIndex = columns[columnIndex]) != null ? _columns$columnIndex : null;
|
|
3456
|
+
var column = (_columns$columnIndex = columns === null || columns === void 0 ? void 0 : columns[columnIndex]) != null ? _columns$columnIndex : null;
|
|
3426
3457
|
var isRightAligned = column ? column.isRightAligned : false;
|
|
3427
3458
|
return React__default.createElement("div", {
|
|
3428
3459
|
className: classnames((_classnames = {}, _classnames[styles$b['data-table-cell--right-aligned']] = isRightAligned, _classnames), styles$b['data-table-cell'])
|
|
@@ -3449,49 +3480,33 @@ var getFormikState = function getFormikState(name, formik) {
|
|
|
3449
3480
|
return null;
|
|
3450
3481
|
}
|
|
3451
3482
|
|
|
3452
|
-
|
|
3453
|
-
return {
|
|
3454
|
-
error: formik.touched[name] ? formik.errors[name] : undefined,
|
|
3455
|
-
value: formik.values[name]
|
|
3456
|
-
};
|
|
3457
|
-
}
|
|
3483
|
+
var formikPath = getFormikArrayPath(name);
|
|
3458
3484
|
|
|
3459
|
-
|
|
3485
|
+
if (formikPath.length === 0) {
|
|
3486
|
+
return null;
|
|
3487
|
+
}
|
|
3460
3488
|
|
|
3461
|
-
|
|
3462
|
-
var
|
|
3489
|
+
var formikLatestLevel = formikPath.reduce(function (acc, path) {
|
|
3490
|
+
var _acc$touched, _acc$error, _acc$value;
|
|
3463
3491
|
|
|
3464
|
-
var arrayName = formikArray.arrayName,
|
|
3465
|
-
itemIndex = formikArray.itemIndex,
|
|
3466
|
-
fieldName = formikArray.fieldName;
|
|
3467
3492
|
return {
|
|
3468
|
-
|
|
3469
|
-
|
|
3493
|
+
touched: (_acc$touched = acc.touched) === null || _acc$touched === void 0 ? void 0 : _acc$touched[path],
|
|
3494
|
+
error: (_acc$error = acc.error) === null || _acc$error === void 0 ? void 0 : _acc$error[path],
|
|
3495
|
+
value: (_acc$value = acc.value) === null || _acc$value === void 0 ? void 0 : _acc$value[path]
|
|
3470
3496
|
};
|
|
3471
|
-
}
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
var getFormikArrayPath = function getFormikArrayPath(name) {
|
|
3477
|
-
if (!name.includes('[')) {
|
|
3478
|
-
return false;
|
|
3479
|
-
}
|
|
3480
|
-
|
|
3481
|
-
var _name$split = name.split('['),
|
|
3482
|
-
arrayName = _name$split[0],
|
|
3483
|
-
missingSplit = _name$split[1];
|
|
3484
|
-
|
|
3485
|
-
var _missingSplit$split = missingSplit.split('].'),
|
|
3486
|
-
itemIndex = _missingSplit$split[0],
|
|
3487
|
-
fieldName = _missingSplit$split[1];
|
|
3488
|
-
|
|
3497
|
+
}, {
|
|
3498
|
+
touched: formik.touched,
|
|
3499
|
+
error: formik.errors,
|
|
3500
|
+
value: formik.values
|
|
3501
|
+
});
|
|
3489
3502
|
return {
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
fieldName: fieldName
|
|
3503
|
+
error: formikLatestLevel.touched ? formikLatestLevel.error : undefined,
|
|
3504
|
+
value: formikLatestLevel.value
|
|
3493
3505
|
};
|
|
3494
3506
|
};
|
|
3507
|
+
var getFormikArrayPath = function getFormikArrayPath(name) {
|
|
3508
|
+
return name.split(/[^a-zA-Z0-9]/).filter(Boolean);
|
|
3509
|
+
};
|
|
3495
3510
|
|
|
3496
3511
|
var useFieldControllers = function useFieldControllers(_ref) {
|
|
3497
3512
|
var name = _ref.name,
|
|
@@ -3691,9 +3706,9 @@ var DataTableEditableCell = function DataTableEditableCell(_ref) {
|
|
|
3691
3706
|
columns = _useDataTableContext.columns,
|
|
3692
3707
|
numberOfRows = _useDataTableContext.numberOfRows;
|
|
3693
3708
|
|
|
3694
|
-
var column = (_columns$columnIndex = columns[columnIndex]) != null ? _columns$columnIndex : null;
|
|
3709
|
+
var column = (_columns$columnIndex = columns === null || columns === void 0 ? void 0 : columns[columnIndex]) != null ? _columns$columnIndex : null;
|
|
3695
3710
|
var isRightAligned = column ? column.isRightAligned : false;
|
|
3696
|
-
var numberOfColumns = columns === null || columns === void 0 ? void 0 : columns.length;
|
|
3711
|
+
var numberOfColumns = (columns === null || columns === void 0 ? void 0 : columns.length) || 0;
|
|
3697
3712
|
var isTopLeftCell = columnIndex === 0 && rowIndex === 0;
|
|
3698
3713
|
var isTopRightCell = columnIndex === numberOfColumns - 1 && rowIndex === 0;
|
|
3699
3714
|
var isBottomLeftCell = columnIndex === 0 && rowIndex === numberOfRows - 1;
|
|
@@ -4891,7 +4906,7 @@ var useDateFieldControllers = function useDateFieldControllers(_ref) {
|
|
|
4891
4906
|
error: error,
|
|
4892
4907
|
value: value,
|
|
4893
4908
|
onChange: function onChange(newValue) {
|
|
4894
|
-
return
|
|
4909
|
+
return _onChange && _onChange(isDate(newValue) ? startOfDay(newValue) : newValue);
|
|
4895
4910
|
},
|
|
4896
4911
|
onBlur: function onBlur() {
|
|
4897
4912
|
return _onBlur && _onBlur();
|
|
@@ -5799,5 +5814,5 @@ var Avatar = function Avatar(_ref) {
|
|
|
5799
5814
|
}, badge));
|
|
5800
5815
|
};
|
|
5801
5816
|
|
|
5802
|
-
export { Avatar, Badge$1 as Badge, Button$1 as Button, CheckboxField, DataTable, DataTableCell, DataTableEditableCell, DataTableRow, DateField, DateRangeField, Form, FormRow, IconAnalytics, IconArrowDown, IconArrowLeft, IconArrowRight, IconArrowToTop, IconArrowUp, IconAward, IconBalanceScale, IconBalanceScaleLeft, IconBan, IconBarsH, IconBarsV, IconBell, IconBold, IconBolt, IconBook, IconBriefcase, IconBullseyeArrow, IconCalculator, IconCalendar, IconCalendarAlt, IconCalendarCheck, IconCalendarDay, IconCalendarExclamation, 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, 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, IconStickyNoteLines, IconStopwatch, IconStrikethrough, IconSync, IconSyncExclaimation, IconTachometer, IconTimes, IconTimesOctagon, IconTrash, IconUnderline, IconUndo, IconUserComputer, IconUserLight, IconUserPlus, IconUserSlash, IconUserSolid, IconUserTag, IconUserTie, IconUsers, IconVideo, IconVolume, IconVolumeMute, IconWrench, Inline, Modal, ModalBody, ModalFooter, MultiSelectField, PaginationControls, PasswordField, 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, Tooltip$1 as Tooltip, WeekField };
|
|
5817
|
+
export { Avatar, Badge$1 as Badge, Button$1 as Button, CheckboxField, DataTable, DataTableCell, DataTableEditableCell, DataTableRow, DateField, DateRangeField, Form, FormRow, IconAnalytics, IconArrowDown, IconArrowLeft, IconArrowRight, IconArrowToTop, IconArrowUp, IconAward, IconBalanceScale, IconBalanceScaleLeft, IconBan, IconBarsH, IconBarsV, IconBell, IconBold, IconBolt, IconBook, IconBriefcase, IconBullseyeArrow, IconCalculator, IconCalendar, IconCalendarAlt, IconCalendarCheck, IconCalendarDay, IconCalendarExclamation, 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, IconStickyNoteLines, IconStopwatch, IconStrikethrough, IconSync, IconSyncExclaimation, IconTachometer, IconTimes, IconTimesOctagon, IconTrash, IconUnderline, IconUndo, IconUserComputer, IconUserLight, IconUserPlus, IconUserSlash, IconUserSolid, IconUserTag, IconUserTie, IconUsers, IconVideo, IconVolume, IconVolumeMute, IconWrench, Inline, Modal, ModalBody, ModalFooter, MultiSelectField, PaginationControls, PasswordField, 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, Tooltip$1 as Tooltip, WeekField };
|
|
5803
5818
|
//# sourceMappingURL=index.modern.js.map
|