@dfds-ui/react-components 2.2.0-alpha.9bb1ab0f → 2.2.0-alpha.a78c2264
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/accordion/Accordion.js +70 -51
- package/accordion/AccordionContent.js +13 -6
- package/accordion/AccordionSmall.js +52 -38
- package/app-bar/AppBar.js +49 -35
- package/app-bar/AppBarContext.js +7 -6
- package/app-bar/AppBarDrawer.js +13 -6
- package/app-bar/AppBarIconButton.js +10 -5
- package/app-bar/AppBarItem.js +71 -56
- package/assertions/banner/Banner.js +65 -51
- package/assertions/banner/BannerAction.js +10 -5
- package/assertions/banner/BannerTypography.js +9 -4
- package/assertions/toast/Toast.js +28 -17
- package/assertions/toast/Toaster.js +52 -56
- package/badge/Badge.js +17 -9
- package/button/BadgeIcon.js +18 -16
- package/button/Button.js +27 -19
- package/button/IconButton.js +20 -13
- package/button/LinkButton.js +8 -3
- package/button-stack/ButtonStack.js +27 -19
- package/card/Card.js +49 -35
- package/card/CardActions.js +13 -6
- package/card/CardContent.js +19 -9
- package/card/CardMedia.js +15 -6
- package/card/CardPriceTag.js +22 -4
- package/card/CardTitle.js +25 -15
- package/chip/Chip.js +22 -13
- package/cjs/accordion/Accordion.js +63 -50
- package/cjs/accordion/AccordionContent.js +7 -6
- package/cjs/accordion/AccordionSmall.js +45 -37
- package/cjs/app-bar/AppBar.js +45 -35
- package/cjs/app-bar/AppBarContext.js +5 -4
- package/cjs/app-bar/AppBarDrawer.js +7 -7
- package/cjs/app-bar/AppBarIconButton.js +6 -6
- package/cjs/app-bar/AppBarItem.js +63 -54
- package/cjs/app-bar/AppBarListItem.js +1 -2
- package/cjs/assertions/banner/Banner.js +56 -49
- package/cjs/assertions/banner/BannerAction.js +5 -4
- package/cjs/assertions/banner/BannerTypography.js +9 -7
- package/cjs/assertions/toast/Toast.js +22 -17
- package/cjs/assertions/toast/Toaster.js +36 -28
- package/cjs/badge/Badge.js +11 -7
- package/cjs/button/BadgeIcon.js +19 -17
- package/cjs/button/BaseButton.js +2 -4
- package/cjs/button/Button.js +21 -19
- package/cjs/button/IconButton.js +15 -14
- package/cjs/button/LinkButton.js +6 -6
- package/cjs/button/button-style.js +8 -15
- package/cjs/button-stack/ButtonStack.js +19 -17
- package/cjs/card/Card.js +39 -29
- package/cjs/card/CardActions.js +7 -7
- package/cjs/card/CardContent.js +13 -9
- package/cjs/card/CardMedia.js +9 -6
- package/cjs/card/CardPriceTag.js +16 -4
- package/cjs/card/CardTitle.js +16 -12
- package/cjs/chip/Chip.js +18 -15
- package/cjs/common/LockBodyScroll.js +15 -11
- package/cjs/common/emotionCloneElement.js +1 -2
- package/cjs/common/polymorphic.js +9 -5
- package/cjs/counter/Counter.js +50 -43
- package/cjs/counter/PluralCounter.js +13 -11
- package/cjs/data-table/DataTable.js +45 -37
- package/cjs/date-range-picker/DateRangePicker.d.ts +4 -4
- package/cjs/date-range-picker/DateRangePicker.js +276 -207
- package/cjs/date-range-picker/DateRangePicker.styles.d.ts +6 -0
- package/cjs/date-range-picker/DateRangePicker.styles.js +14 -0
- package/cjs/divider/Divider.js +6 -6
- package/cjs/drawer/Drawer.js +10 -8
- package/cjs/dropdown-menu/Dropdown.js +34 -29
- package/cjs/dropdown-menu/DropdownContext.js +7 -8
- package/cjs/dropdown-menu/MenuCheckbox.js +24 -23
- package/cjs/dropdown-menu/MenuItem.js +30 -28
- package/cjs/dropdown-menu/MenuTitle.js +15 -12
- package/cjs/elevation/index.js +1 -2
- package/cjs/flexbox/FlexBox.js +2 -4
- package/cjs/footer/Footer.js +10 -6
- package/cjs/forms/assistive-text/AssistiveText.js +1 -2
- package/cjs/forms/asterisk/Asterisk.js +5 -4
- package/cjs/forms/checkbox/Checkbox.js +36 -31
- package/cjs/forms/checkbox/ExampleControlComponent.js +7 -7
- package/cjs/forms/email-field/EmailField.js +7 -7
- package/cjs/forms/error-text/ErrorText.js +1 -2
- package/cjs/forms/field/Field.js +10 -6
- package/cjs/forms/input/Input.js +23 -21
- package/cjs/forms/input/InputComposition.js +29 -23
- package/cjs/forms/label/Label.js +6 -3
- package/cjs/forms/number-field/NumberField.js +6 -6
- package/cjs/forms/password-field/PasswordField.js +10 -10
- package/cjs/forms/radio/Radio.js +20 -19
- package/cjs/forms/reactselect/ReactSelect.js +70 -61
- package/cjs/forms/searchable-select/AsyncSearchableSelect.js +47 -38
- package/cjs/forms/select/Select.js +25 -22
- package/cjs/forms/select-field/SelectField.js +33 -29
- package/cjs/forms/switch/Switch.js +28 -22
- package/cjs/forms/tel-field/TelField.js +7 -7
- package/cjs/forms/text-field/TextField.js +37 -34
- package/cjs/global-styles/GlobalStyles.js +3 -2
- package/cjs/global-styles/ResetStyles.js +2 -1
- package/cjs/global-styles/sanitize.js +2 -3
- package/cjs/grid/Column.js +7 -7
- package/cjs/grid/Container.js +34 -29
- package/cjs/hero/Hero.js +32 -12
- package/cjs/hero/stripes.js +177 -162
- package/cjs/ie-banner/IEBanner.js +13 -8
- package/cjs/layout/LayoutLegacy.js +2 -1
- package/cjs/lists/FeatureList.js +16 -13
- package/cjs/lists/ListAddon.js +10 -7
- package/cjs/lists/ListDivider.js +6 -6
- package/cjs/lists/ListIcon.js +6 -6
- package/cjs/lists/ListItem.js +7 -6
- package/cjs/lists/ListText.js +6 -6
- package/cjs/lists/ListTextGroup.js +6 -6
- package/cjs/lists/ListTitle.js +6 -6
- package/cjs/loader/DfdsLoader.js +27 -21
- package/cjs/loader/Loader.js +9 -3
- package/cjs/localization/LocaleFlag.js +5 -4
- package/cjs/localization/locales.js +3 -6
- package/cjs/logo/Logo.js +12 -9
- package/cjs/media/index.js +1 -2
- package/cjs/menu/Menu.js +22 -15
- package/cjs/mobile-stepper/MobileStepper.js +17 -15
- package/cjs/nav-bar/NavBar.js +34 -24
- package/cjs/nav-menu/NavMenuItem.js +13 -11
- package/cjs/pagination/Pagination.js +50 -38
- package/cjs/pagination/Pagination.styles.js +6 -12
- package/cjs/popper/Popper.js +21 -17
- package/cjs/progress-bar/ProgressBar.js +3 -3
- package/cjs/schedule/ScheduleItem.js +11 -8
- package/cjs/schedule/ScheduleList.js +10 -11
- package/cjs/side-sheet/SideSheet.js +41 -33
- package/cjs/side-sheet/SideSheetCloseButton.js +6 -6
- package/cjs/side-sheet/SideSheetContent.js +10 -7
- package/cjs/side-sheet/SideSheetFooter.js +10 -7
- package/cjs/side-sheet/SideSheetHeader.js +10 -7
- package/cjs/side-sheet/SideSheetHeadline.js +6 -5
- package/cjs/site-layout/SiteLayout.js +30 -19
- package/cjs/skeleton/Skeleton.js +6 -6
- package/cjs/social-media-link-list/SocialMediaLinkList.js +64 -58
- package/cjs/spinner/Spinner.js +13 -13
- package/cjs/step/Step.js +29 -20
- package/cjs/step/Step.styles.js +4 -8
- package/cjs/step/StepButton.js +26 -23
- package/cjs/step/StepContent.js +12 -10
- package/cjs/step/StepContext.js +1 -2
- package/cjs/step/StepLabel.js +9 -7
- package/cjs/stepper/Stepper.js +12 -10
- package/cjs/stepper/StepperContext.js +1 -2
- package/cjs/stepper-feedback-message/StepperFeedbackMessage.js +10 -7
- package/cjs/styles/media.js +2 -4
- package/cjs/styles/theme.js +2 -4
- package/cjs/surface/Surface.js +20 -14
- package/cjs/tab/Tab.js +7 -6
- package/cjs/tab/TabPanel.js +6 -6
- package/cjs/tab/Tabs.js +29 -28
- package/cjs/tab/TabsContext.js +7 -8
- package/cjs/table/Table.js +15 -15
- package/cjs/table/TableBody.js +8 -9
- package/cjs/table/TableDataCell.js +9 -10
- package/cjs/table/TableHead.js +10 -12
- package/cjs/table/TableHeaderCell.js +9 -10
- package/cjs/table/TableRow.js +9 -10
- package/cjs/test/Test.js +5 -4
- package/cjs/tooltip/Tooltip.js +28 -22
- package/cjs/typography/Headlines.js +14 -20
- package/cjs/typography/Text.js +2 -3
- package/common/LockBodyScroll.js +20 -10
- package/common/polymorphic.js +9 -3
- package/common/use-media.js +2 -2
- package/counter/Counter.js +50 -42
- package/counter/PluralCounter.js +20 -11
- package/data-table/DataTable.js +52 -38
- package/date-range-picker/DateRangePicker.d.ts +4 -4
- package/date-range-picker/DateRangePicker.js +319 -238
- package/date-range-picker/DateRangePicker.styles.d.ts +6 -0
- package/date-range-picker/DateRangePicker.styles.js +9 -0
- package/divider/Divider.js +10 -5
- package/drawer/Drawer.js +15 -6
- package/dropdown-menu/Dropdown.js +42 -31
- package/dropdown-menu/DropdownContext.js +5 -4
- package/dropdown-menu/MenuCheckbox.js +24 -17
- package/dropdown-menu/MenuItem.js +26 -18
- package/dropdown-menu/MenuTitle.js +14 -11
- package/flexbox/FlexBox.js +2 -2
- package/footer/Footer.js +9 -4
- package/forms/asterisk/Asterisk.js +4 -2
- package/forms/checkbox/Checkbox.js +42 -32
- package/forms/checkbox/ExampleControlComponent.js +15 -8
- package/forms/email-field/EmailField.js +8 -3
- package/forms/field/Field.js +9 -4
- package/forms/input/Input.js +29 -22
- package/forms/input/InputComposition.js +29 -17
- package/forms/label/Label.js +12 -4
- package/forms/number-field/NumberField.js +8 -3
- package/forms/password-field/PasswordField.js +15 -9
- package/forms/radio/Radio.js +25 -18
- package/forms/reactselect/ReactSelect.js +65 -57
- package/forms/searchable-select/AsyncSearchableSelect.js +50 -38
- package/forms/select/Select.js +31 -23
- package/forms/select-field/SelectField.js +38 -29
- package/forms/switch/Switch.js +35 -23
- package/forms/tel-field/TelField.js +8 -3
- package/forms/text-field/TextField.js +43 -34
- package/global-styles/GlobalStyles.js +3 -3
- package/global-styles/ResetStyles.js +2 -2
- package/grid/Column.js +14 -7
- package/grid/Container.js +41 -35
- package/hero/Hero.js +32 -10
- package/hero/stripes.js +176 -160
- package/ie-banner/IEBanner.js +14 -8
- package/layout/LayoutLegacy.js +2 -2
- package/lists/FeatureList.js +21 -11
- package/lists/ListAddon.js +13 -6
- package/lists/ListDivider.js +10 -5
- package/lists/ListIcon.js +10 -5
- package/lists/ListItem.js +13 -6
- package/lists/ListText.js +10 -5
- package/lists/ListTextGroup.js +10 -5
- package/lists/ListTitle.js +10 -5
- package/loader/DfdsLoader.js +25 -19
- package/loader/Loader.js +8 -2
- package/localization/LocaleFlag.js +10 -5
- package/logo/Logo.js +14 -7
- package/menu/Menu.js +25 -12
- package/mobile-stepper/MobileStepper.js +26 -18
- package/nav-bar/NavBar.js +41 -23
- package/nav-menu/NavMenuItem.js +12 -10
- package/package.json +14 -16
- package/pagination/Pagination.js +53 -35
- package/popper/Popper.js +27 -17
- package/progress-bar/ProgressBar.js +2 -2
- package/schedule/ScheduleItem.js +9 -4
- package/schedule/ScheduleList.js +16 -10
- package/side-sheet/SideSheet.js +47 -34
- package/side-sheet/SideSheetCloseButton.js +10 -5
- package/side-sheet/SideSheetContent.js +17 -8
- package/side-sheet/SideSheetFooter.js +17 -8
- package/side-sheet/SideSheetHeader.js +17 -8
- package/side-sheet/SideSheetHeadline.js +5 -4
- package/site-layout/SiteLayout.js +31 -12
- package/skeleton/Skeleton.js +10 -5
- package/social-media-link-list/SocialMediaLinkList.js +69 -55
- package/spinner/Spinner.js +17 -10
- package/step/Step.js +34 -20
- package/step/StepButton.js +23 -15
- package/step/StepContent.js +11 -9
- package/step/StepLabel.js +8 -6
- package/stepper/Stepper.js +13 -11
- package/stepper-feedback-message/StepperFeedbackMessage.js +9 -6
- package/surface/Surface.js +17 -14
- package/tab/Tab.js +13 -6
- package/tab/TabPanel.js +5 -4
- package/tab/Tabs.js +42 -35
- package/tab/TabsContext.js +5 -4
- package/table/Table.js +20 -13
- package/table/TableBody.js +13 -7
- package/table/TableDataCell.js +14 -8
- package/table/TableHead.js +10 -8
- package/table/TableHeaderCell.js +14 -8
- package/table/TableRow.js +11 -10
- package/test/Test.js +4 -2
- package/tooltip/Tooltip.js +31 -21
- package/typography/Headlines.js +13 -6
- package/cjs/date-range-picker/DatePickerDefaultStyles.d.ts +0 -2
- package/cjs/date-range-picker/DatePickerDefaultStyles.js +0 -19
- package/cjs/date-range-picker/DatePickerDfdsStyles.d.ts +0 -2
- package/cjs/date-range-picker/DatePickerDfdsStyles.js +0 -11
- package/date-range-picker/DatePickerDefaultStyles.d.ts +0 -2
- package/date-range-picker/DatePickerDefaultStyles.js +0 -12
- package/date-range-picker/DatePickerDfdsStyles.d.ts +0 -2
- package/date-range-picker/DatePickerDfdsStyles.js +0 -4
package/counter/Counter.js
CHANGED
|
@@ -2,14 +2,14 @@ import _styled from "@emotion/styled/base";
|
|
|
2
2
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
3
3
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
4
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++)
|
|
6
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0)
|
|
5
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
6
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
7
7
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
8
8
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
9
9
|
import React, { useState, forwardRef } from 'react';
|
|
10
10
|
import { NumberDown, NumberUp } from '@dfds-ui/icons/system';
|
|
11
11
|
import { css } from '@emotion/react';
|
|
12
|
-
import { jsx as
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
13
13
|
var StyledCounter = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
|
|
14
14
|
target: "eef4fs64"
|
|
15
15
|
} : {
|
|
@@ -85,48 +85,56 @@ export var Counter = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
85
85
|
_useState2 = _slicedToArray(_useState, 2),
|
|
86
86
|
counterValue = _useState2[0],
|
|
87
87
|
setCounterValue = _useState2[1];
|
|
88
|
-
return
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
props.executeOnChange
|
|
88
|
+
return _jsxs(StyledCounter, {
|
|
89
|
+
children: [_jsx(StyledIconContainer, {
|
|
90
|
+
onClick: function onClick() {
|
|
91
|
+
if (!props.disableMin && counterValue - 1 >= props.minVal) {
|
|
92
|
+
setCounterValue(counterValue - 1);
|
|
93
|
+
if (props.executeOnChange) {
|
|
94
|
+
props.executeOnChange(counterValue - 1);
|
|
95
|
+
}
|
|
94
96
|
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
97
|
+
},
|
|
98
|
+
children: _jsx(IconToggler, {
|
|
99
|
+
disable: props.disableMin || counterValue === props.minVal,
|
|
100
|
+
children: _jsx(NumberDown, {
|
|
101
|
+
width: "100%",
|
|
102
|
+
height: "100%"
|
|
103
|
+
})
|
|
104
|
+
})
|
|
105
|
+
}), props.label ? _jsx(LabelContainer, {
|
|
106
|
+
children: props.label
|
|
107
|
+
}) : _jsx(StyledInput, {
|
|
108
|
+
ref: ref,
|
|
109
|
+
tabIndex: 0,
|
|
110
|
+
type: "number",
|
|
111
|
+
name: (_props$name = props.name) !== null && _props$name !== void 0 ? _props$name : 'counter',
|
|
112
|
+
value: counterValue,
|
|
113
|
+
onChange: function onChange(e) {
|
|
114
|
+
if (parseInt(e.target.value, 10) <= props.maxVal && parseInt(e.target.value, 10) >= props.minVal) {
|
|
115
|
+
setCounterValue(parseInt(e.target.value, 10));
|
|
116
|
+
if (props.executeOnChange) {
|
|
117
|
+
props.executeOnChange(parseInt(e.target.value, 10));
|
|
118
|
+
}
|
|
113
119
|
}
|
|
114
120
|
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
121
|
+
}), _jsx(StyledIconContainer, {
|
|
122
|
+
onClick: function onClick() {
|
|
123
|
+
if (!props.disableMax && counterValue + 1 <= props.maxVal) {
|
|
124
|
+
setCounterValue(counterValue + 1);
|
|
125
|
+
if (props.executeOnChange) {
|
|
126
|
+
props.executeOnChange(counterValue + 1);
|
|
127
|
+
}
|
|
122
128
|
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
},
|
|
130
|
+
children: _jsx(IconToggler, {
|
|
131
|
+
disable: props.disableMax || counterValue === props.maxVal,
|
|
132
|
+
children: _jsx(NumberUp, {
|
|
133
|
+
width: "100%",
|
|
134
|
+
height: "100%"
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
})]
|
|
138
|
+
});
|
|
131
139
|
});
|
|
132
140
|
export default Counter;
|
package/counter/PluralCounter.js
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
import _styled from "@emotion/styled/base";
|
|
2
3
|
var _excluded = ["singularLabel", "pluralLabel", "executeOnChange"];
|
|
3
|
-
function
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
9
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
5
10
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
11
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
7
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++)
|
|
8
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0)
|
|
12
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
9
14
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
10
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++)
|
|
11
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r)
|
|
15
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
16
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
12
17
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
13
18
|
import React, { useState, forwardRef } from 'react';
|
|
14
19
|
import Counter from './Counter';
|
|
15
|
-
import { jsx as
|
|
20
|
+
import { jsxs as _jsxs, jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
16
21
|
//Insert plural with max value as hidden to ensure rows are aligned. Assumes plural is longer than singular.
|
|
17
22
|
var WidthFix = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
|
|
18
23
|
target: "er7oqr50"
|
|
@@ -34,24 +39,28 @@ var PluralCounter = function PluralCounter(_ref, ref) {
|
|
|
34
39
|
executeOnChange = _ref.executeOnChange,
|
|
35
40
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
36
41
|
var Label = function Label(p) {
|
|
37
|
-
return
|
|
42
|
+
return _jsxs("div", {
|
|
43
|
+
children: [p.val, " ", p.val === 1 ? singularLabel : pluralLabel, _jsxs(WidthFix, {
|
|
44
|
+
children: [rest.maxVal, " ", pluralLabel]
|
|
45
|
+
})]
|
|
46
|
+
});
|
|
38
47
|
};
|
|
39
|
-
var _useState = useState(
|
|
48
|
+
var _useState = useState(_jsx(Label, {
|
|
40
49
|
val: (_ref2 = (_rest$currentVal = rest.currentVal) !== null && _rest$currentVal !== void 0 ? _rest$currentVal : rest.initialVal) !== null && _ref2 !== void 0 ? _ref2 : rest.minVal
|
|
41
50
|
})),
|
|
42
51
|
_useState2 = _slicedToArray(_useState, 2),
|
|
43
52
|
currentLabel = _useState2[0],
|
|
44
53
|
setCurrentLabel = _useState2[1];
|
|
45
54
|
var onChange = function onChange(s) {
|
|
46
|
-
setCurrentLabel(
|
|
55
|
+
setCurrentLabel(_jsx(Label, {
|
|
47
56
|
val: s
|
|
48
57
|
}));
|
|
49
58
|
if (executeOnChange) executeOnChange(s);
|
|
50
59
|
};
|
|
51
|
-
return
|
|
60
|
+
return _jsx(Counter, _objectSpread(_objectSpread({
|
|
52
61
|
executeOnChange: onChange,
|
|
53
62
|
label: currentLabel
|
|
54
|
-
}, rest, {
|
|
63
|
+
}, rest), {}, {
|
|
55
64
|
ref: ref
|
|
56
65
|
}));
|
|
57
66
|
};
|
package/data-table/DataTable.js
CHANGED
|
@@ -1,22 +1,27 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
var _excluded = ["children", "onChange", "columns", "data", "hasHeader"];
|
|
2
|
-
function
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
3
8
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
4
9
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0)
|
|
10
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
11
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++)
|
|
8
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r)
|
|
12
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
13
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
9
14
|
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
10
15
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
11
16
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
12
17
|
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
13
18
|
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
14
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++)
|
|
19
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
15
20
|
import React, { useReducer } from 'react';
|
|
16
21
|
import { css } from '@emotion/react';
|
|
17
22
|
import { Checkbox } from '../forms/checkbox';
|
|
18
23
|
import { theme } from '@dfds-ui/theme';
|
|
19
|
-
import { jsx as
|
|
24
|
+
import { jsxs as _jsxs, jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
20
25
|
var tableStyle = function tableStyle() {
|
|
21
26
|
return /*#__PURE__*/css("text-align:left;border-collapse:collapse;width:100%;border:none;color:", theme.colors.text.dark.primary, ";font-size:12px;tr{border-top:1px solid ", theme.colors.text.dark.disabled, ";border-bottom:1px solid ", theme.colors.text.dark.disabled, ";}th,td{padding:16px;label{color:", theme.colors.primary.main, ";font-weight:bold;}}" + (process.env.NODE_ENV === "production" ? "" : ";label:tableStyle;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kYXRhLXRhYmxlL0RhdGFUYWJsZS50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBYzRCIiwiZmlsZSI6Ii4uLy4uL3NyYy9kYXRhLXRhYmxlL0RhdGFUYWJsZS50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgRnVuY3Rpb25Db21wb25lbnQsIHVzZVJlZHVjZXIgfSBmcm9tICdyZWFjdCdcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0J1xuaW1wb3J0IHsgQ2hlY2tib3ggfSBmcm9tICcuLi9mb3Jtcy9jaGVja2JveCdcbmltcG9ydCB7IHRoZW1lIH0gZnJvbSAnQGRmZHMtdWkvdGhlbWUnXG5cbmV4cG9ydCB0eXBlIERhdGFUYWJsZVByb3BzID0ge1xuICBjaGlsZHJlbj86IFJlYWN0LlJlYWN0Tm9kZVxuICBvbkNoYW5nZT86IChtb2RlbDogb2JqZWN0W10pID0+IG9iamVjdFtdXG4gIGNvbHVtbnM/OiBzdHJpbmdbXVxuICBkYXRhOiBvYmplY3RbXVxuICBjbGFzc05hbWU/OiBzdHJpbmdcbiAgaGFzSGVhZGVyPzogYm9vbGVhblxufVxuXG5jb25zdCB0YWJsZVN0eWxlID0gKCkgPT4gY3NzYFxuICB0ZXh0LWFsaWduOiBsZWZ0O1xuICBib3JkZXItY29sbGFwc2U6IGNvbGxhcHNlO1xuICB3aWR0aDogMTAwJTtcbiAgYm9yZGVyOiBub25lO1xuICBjb2xvcjogJHt0aGVtZS5jb2xvcnMudGV4dC5kYXJrLnByaW1hcnl9O1xuICBmb250LXNpemU6IDEycHg7XG4gIHRyIHtcbiAgICBib3JkZXItdG9wOiAxcHggc29saWQgJHt0aGVtZS5jb2xvcnMudGV4dC5kYXJrLmRpc2FibGVkfTtcbiAgICBib3JkZXItYm90dG9tOiAxcHggc29saWQgJHt0aGVtZS5jb2xvcnMudGV4dC5kYXJrLmRpc2FibGVkfTtcbiAgfVxuICB0aCxcbiAgdGQge1xuICAgIHBhZGRpbmc6IDE2cHg7XG4gICAgbGFiZWwge1xuICAgICAgY29sb3I6ICR7dGhlbWUuY29sb3JzLnByaW1hcnkubWFpbn07XG4gICAgICBmb250LXdlaWdodDogYm9sZDtcbiAgICB9XG4gIH1cbmBcblxuY29uc3QgVE9HR0xFID0gJ3RvZ2dsZSdcblxuZnVuY3Rpb24gcmVkdWNlcihtb2RlbDogYW55LCBhY3Rpb246IGFueSk6IG9iamVjdFtdIHtcbiAgY29uc3QgbmV3TW9kZWwgPSBbLi4ubW9kZWxdXG4gIHN3aXRjaCAoYWN0aW9uLnR5cGUpIHtcbiAgICBjYXNlIFRPR0dMRTpcbiAgICAgIG5ld01vZGVsW2FjdGlvbi5rZXldLmZpZWxkLnZhbHVlID0gIW5ld01vZGVsW2FjdGlvbi5rZXldLmZpZWxkLnZhbHVlXG4gICAgICByZXR1cm4gbmV3TW9kZWxcbiAgICBkZWZhdWx0OlxuICAgICAgcmV0dXJuIG5ld01vZGVsXG4gIH1cbn1cblxuLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby11bnVzZWQtdmFyc1xuZXhwb3J0IGNvbnN0IERhdGFUYWJsZTogRnVuY3Rpb25Db21wb25lbnQ8RGF0YVRhYmxlUHJvcHM+ID0gKHtcbiAgY2hpbGRyZW4sXG4gIG9uQ2hhbmdlLFxuICBjb2x1bW5zLFxuICBkYXRhLFxuICBoYXNIZWFkZXIsXG4gIC4uLnJlc3Rcbn0pID0+IHtcbiAgY29uc3QgW21vZGVsLCBkaXNwYXRjaF0gPSB1c2VSZWR1Y2VyKHJlZHVjZXIsIGRhdGEpXG4gIGNvbnN0IGRhdGFLZXlzID0gT2JqZWN0LmtleXMobW9kZWxbMF0pXG4gIGNvbnN0IGRpc3BsYXlDb2x1bW5zID0gY29sdW1ucyA/IGNvbHVtbnMgOiBkYXRhS2V5c1xuXG4gIFJlYWN0LnVzZUVmZmVjdCgoKSA9PiB7XG4gICAgaWYgKG9uQ2hhbmdlKSB7XG4gICAgICBvbkNoYW5nZShtb2RlbClcbiAgICB9XG4gICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIHJlYWN0LWhvb2tzL2V4aGF1c3RpdmUtZGVwc1xuICB9LCBbbW9kZWxdKVxuXG4gIHJldHVybiAoXG4gICAgPHRhYmxlIGNzcz17dGFibGVTdHlsZSgpfSB7Li4ucmVzdH0+XG4gICAgICB7aGFzSGVhZGVyICYmIChcbiAgICAgICAgPHRoZWFkPlxuICAgICAgICAgIDx0cj5cbiAgICAgICAgICAgIHtkaXNwbGF5Q29sdW1ucy5tYXAoKGtleSwgaSkgPT4ge1xuICAgICAgICAgICAgICByZXR1cm4gPHRoIGtleT17aX0+IHtrZXl9IDwvdGg+XG4gICAgICAgICAgICB9KX1cbiAgICAgICAgICA8L3RyPlxuICAgICAgICA8L3RoZWFkPlxuICAgICAgKX1cbiAgICAgIDx0Ym9keT5cbiAgICAgICAge2RhdGEubWFwKCh2YWx1ZU9iajogYW55LCBpKSA9PiB7XG4gICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgIDx0ciBrZXk9e2l9PlxuICAgICAgICAgICAgICB7ZGF0YUtleXMubWFwKChrZXk6IGFueSwgeSkgPT4ge1xuICAgICAgICAgICAgICAgIGlmIChrZXkgPT09ICdmaWVsZCcpIHtcbiAgICAgICAgICAgICAgICAgIGNvbnN0IHsgbmFtZSwgdmFsdWUsIGxhYmVsIH0gPSB2YWx1ZU9iai5maWVsZFxuICAgICAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICAgICAgPHRkIGtleT17eX0+XG4gICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgPENoZWNrYm94XG4gICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU9e25hbWV9XG4gICAgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrZWQ9e3ZhbHVlfVxuICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNoYW5nZT17KCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BhdGNoKHsgdHlwZTogVE9HR0xFLCBrZXk6IGkgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfX1cbiAgICAgICAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAge2xhYmVsfVxuICAgICAgICAgICAgICAgICAgICAgICAgPC9DaGVja2JveD5cbiAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIDwvdGQ+XG4gICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiA8dGQga2V5PXt5fT4ge3ZhbHVlT2JqW2tleV19IDwvdGQ+XG4gICAgICAgICAgICAgIH0pfVxuICAgICAgICAgICAgPC90cj5cbiAgICAgICAgICApXG4gICAgICAgIH0pfVxuICAgICAgPC90Ym9keT5cbiAgICA8L3RhYmxlPlxuICApXG59XG5cbmV4cG9ydCBkZWZhdWx0IERhdGFUYWJsZVxuIl19 */");
|
|
22
27
|
};
|
|
@@ -52,38 +57,47 @@ export var DataTable = function DataTable(_ref) {
|
|
|
52
57
|
}
|
|
53
58
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
54
59
|
}, [model]);
|
|
55
|
-
return
|
|
60
|
+
return _jsxs("table", _objectSpread(_objectSpread({
|
|
56
61
|
css: tableStyle()
|
|
57
|
-
}, rest),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
62
|
+
}, rest), {}, {
|
|
63
|
+
children: [hasHeader && _jsx("thead", {
|
|
64
|
+
children: _jsx("tr", {
|
|
65
|
+
children: displayColumns.map(function (key, i) {
|
|
66
|
+
return _jsxs("th", {
|
|
67
|
+
children: [" ", key, " "]
|
|
68
|
+
}, i);
|
|
69
|
+
})
|
|
70
|
+
})
|
|
71
|
+
}), _jsx("tbody", {
|
|
72
|
+
children: data.map(function (valueObj, i) {
|
|
73
|
+
return _jsx("tr", {
|
|
74
|
+
children: dataKeys.map(function (key, y) {
|
|
75
|
+
if (key === 'field') {
|
|
76
|
+
var _valueObj$field = valueObj.field,
|
|
77
|
+
name = _valueObj$field.name,
|
|
78
|
+
value = _valueObj$field.value,
|
|
79
|
+
label = _valueObj$field.label;
|
|
80
|
+
return _jsx("td", {
|
|
81
|
+
children: _jsx(Checkbox, {
|
|
82
|
+
name: name,
|
|
83
|
+
checked: value,
|
|
84
|
+
onChange: function onChange() {
|
|
85
|
+
dispatch({
|
|
86
|
+
type: TOGGLE,
|
|
87
|
+
key: i
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
children: label
|
|
91
|
+
})
|
|
92
|
+
}, y);
|
|
93
|
+
}
|
|
94
|
+
return _jsxs("td", {
|
|
95
|
+
children: [" ", valueObj[key], " "]
|
|
96
|
+
}, y);
|
|
97
|
+
})
|
|
98
|
+
}, i);
|
|
99
|
+
})
|
|
100
|
+
})]
|
|
101
|
+
}));
|
|
88
102
|
};
|
|
89
103
|
export default DataTable;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import 'react-
|
|
3
|
-
interface IDateRangePickerProps {
|
|
2
|
+
import 'react-day-picker/dist/style.css';
|
|
3
|
+
export interface IDateRangePickerProps {
|
|
4
4
|
endDateDisabled?: boolean;
|
|
5
5
|
valid: boolean;
|
|
6
6
|
onDateChange: (d: string | null, r: string | null) => void;
|
|
@@ -16,14 +16,14 @@ interface IDateRangePickerProps {
|
|
|
16
16
|
className?: string;
|
|
17
17
|
locale?: string;
|
|
18
18
|
}
|
|
19
|
-
interface IDateLeg {
|
|
19
|
+
export interface IDateLeg {
|
|
20
20
|
initial: string | null;
|
|
21
21
|
maxDate: string;
|
|
22
22
|
minDate: string;
|
|
23
23
|
disabledDates?: string[];
|
|
24
24
|
offerDates?: string[];
|
|
25
25
|
}
|
|
26
|
-
interface IDateRangePickerLabels {
|
|
26
|
+
export interface IDateRangePickerLabels {
|
|
27
27
|
start: string;
|
|
28
28
|
end: string;
|
|
29
29
|
header: string;
|