@laerdal/life-react-components 1.0.1-dev.19.full → 1.0.1-dev.22.full
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/esm/AuthPage/Information.js +4 -7
- package/dist/esm/AuthPage/Information.js.map +1 -1
- package/dist/esm/Banners/Banner.js +5 -5
- package/dist/esm/Banners/Banner.js.map +1 -1
- package/dist/esm/Banners/OverviewBanner.js +2 -2
- package/dist/esm/Banners/OverviewBanner.js.map +1 -1
- package/dist/esm/Breadcrumb/Breadcrumb.js +46 -20
- package/dist/esm/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/esm/Button/Iconbutton.js +4 -1
- package/dist/esm/Button/Iconbutton.js.map +1 -1
- package/dist/esm/Dropdown/CommonStyling.js +28 -28
- package/dist/esm/Dropdown/CommonStyling.js.map +1 -1
- package/dist/esm/Footer/Components/FooterDropdownLinks.js +9 -9
- package/dist/esm/Footer/Components/FooterDropdownLinks.js.map +1 -1
- package/dist/esm/Footer/Components/FooterNavSection.js +4 -8
- package/dist/esm/Footer/Components/FooterNavSection.js.map +1 -1
- package/dist/esm/Footer/Components/FooterNewsletterAndSocialSection.js +4 -4
- package/dist/esm/Footer/Components/FooterNewsletterAndSocialSection.js.map +1 -1
- package/dist/esm/Footer/Components/FooterTop.js +2 -2
- package/dist/esm/Footer/Components/FooterTop.js.map +1 -1
- package/dist/esm/GlobalNavigationBar/Logo.js +8 -11
- package/dist/esm/GlobalNavigationBar/Logo.js.map +1 -1
- package/dist/esm/GlobalNavigationBar/RightSideNav.js +4 -3
- package/dist/esm/GlobalNavigationBar/RightSideNav.js.map +1 -1
- package/dist/esm/GlobalNavigationBar/UserMenu/MenuLink.js +3 -6
- package/dist/esm/GlobalNavigationBar/UserMenu/MenuLink.js.map +1 -1
- package/dist/esm/GlobalNavigationBar/UserMenu/MobileUserMenu.js +10 -7
- package/dist/esm/GlobalNavigationBar/UserMenu/MobileUserMenu.js.map +1 -1
- package/dist/esm/GlobalNavigationBar/UserMenu/UserMenu.js +5 -13
- package/dist/esm/GlobalNavigationBar/UserMenu/UserMenu.js.map +1 -1
- package/dist/esm/GlobalNavigationBar/mobile/CommonStyles.js +4 -1
- package/dist/esm/GlobalNavigationBar/mobile/CommonStyles.js.map +1 -1
- package/dist/esm/GlobalNavigationBar/mobile/MobileMenu.js +6 -9
- package/dist/esm/GlobalNavigationBar/mobile/MobileMenu.js.map +1 -1
- package/dist/esm/InputFields/DatepickerField.js +13 -14
- package/dist/esm/InputFields/DatepickerField.js.map +1 -1
- package/dist/esm/InputFields/components/SearchBarInput.js +11 -11
- package/dist/esm/InputFields/components/SearchBarInput.js.map +1 -1
- package/dist/esm/InputFields/components/SearchField.js +13 -11
- package/dist/esm/InputFields/components/SearchField.js.map +1 -1
- package/dist/esm/List/ListRow.js +5 -2
- package/dist/esm/List/ListRow.js.map +1 -1
- package/dist/esm/List/ListRowDropdown.js +4 -5
- package/dist/esm/List/ListRowDropdown.js.map +1 -1
- package/dist/esm/LoadingPage/GlobalLoadingPage.js +4 -3
- package/dist/esm/LoadingPage/GlobalLoadingPage.js.map +1 -1
- package/dist/esm/MiniProductCard/MiniProductCard.js +4 -5
- package/dist/esm/MiniProductCard/MiniProductCard.js.map +1 -1
- package/dist/esm/Modals/ModalDialog.js +22 -10
- package/dist/esm/Modals/ModalDialog.js.map +1 -1
- package/dist/esm/Paginator/Paginator.js +5 -6
- package/dist/esm/Paginator/Paginator.js.map +1 -1
- package/dist/esm/SkipToContent/SkipToContent.js +4 -5
- package/dist/esm/SkipToContent/SkipToContent.js.map +1 -1
- package/dist/esm/Switcher/MobileSwitcherMenu.js +4 -4
- package/dist/esm/Switcher/MobileSwitcherMenu.js.map +1 -1
- package/dist/esm/Switcher/SwitcherMenuItem.js +8 -9
- package/dist/esm/Switcher/SwitcherMenuItem.js.map +1 -1
- package/dist/esm/Tabs/HorizontalTabs.js +7 -10
- package/dist/esm/Tabs/HorizontalTabs.js.map +1 -1
- package/dist/esm/Toasters/Toast.js +1 -2
- package/dist/esm/Toasters/Toast.js.map +1 -1
- package/dist/esm/styles/typography.js +52 -1
- package/dist/esm/styles/typography.js.map +1 -1
- package/dist/js/AuthPage/Information.js +4 -2
- package/dist/js/AuthPage/Information.js.map +1 -1
- package/dist/js/Banners/Banner.js +2 -2
- package/dist/js/Banners/Banner.js.map +1 -1
- package/dist/js/Banners/OverviewBanner.js +3 -1
- package/dist/js/Banners/OverviewBanner.js.map +1 -1
- package/dist/js/Breadcrumb/Breadcrumb.d.ts +2 -0
- package/dist/js/Breadcrumb/Breadcrumb.js +46 -14
- package/dist/js/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/js/Button/Iconbutton.d.ts +1 -0
- package/dist/js/Button/Iconbutton.js +4 -1
- package/dist/js/Button/Iconbutton.js.map +1 -1
- package/dist/js/Dropdown/CommonStyling.js +4 -4
- package/dist/js/Dropdown/CommonStyling.js.map +1 -1
- package/dist/js/Footer/Components/FooterDropdownLinks.js +3 -3
- package/dist/js/Footer/Components/FooterDropdownLinks.js.map +1 -1
- package/dist/js/Footer/Components/FooterNavSection.js +4 -2
- package/dist/js/Footer/Components/FooterNavSection.js.map +1 -1
- package/dist/js/Footer/Components/FooterNewsletterAndSocialSection.js +2 -2
- package/dist/js/Footer/Components/FooterNewsletterAndSocialSection.js.map +1 -1
- package/dist/js/Footer/Components/FooterTop.js +3 -1
- package/dist/js/Footer/Components/FooterTop.js.map +1 -1
- package/dist/js/GlobalNavigationBar/Logo.js +9 -7
- package/dist/js/GlobalNavigationBar/Logo.js.map +1 -1
- package/dist/js/GlobalNavigationBar/RightSideNav.js +3 -1
- package/dist/js/GlobalNavigationBar/RightSideNav.js.map +1 -1
- package/dist/js/GlobalNavigationBar/UserMenu/MenuLink.js +3 -1
- package/dist/js/GlobalNavigationBar/UserMenu/MenuLink.js.map +1 -1
- package/dist/js/GlobalNavigationBar/UserMenu/MobileUserMenu.js +4 -2
- package/dist/js/GlobalNavigationBar/UserMenu/MobileUserMenu.js.map +1 -1
- package/dist/js/GlobalNavigationBar/UserMenu/UserMenu.js +4 -2
- package/dist/js/GlobalNavigationBar/UserMenu/UserMenu.js.map +1 -1
- package/dist/js/GlobalNavigationBar/mobile/CommonStyles.js +1 -1
- package/dist/js/GlobalNavigationBar/mobile/CommonStyles.js.map +1 -1
- package/dist/js/GlobalNavigationBar/mobile/MobileMenu.d.ts +1 -1
- package/dist/js/GlobalNavigationBar/mobile/MobileMenu.js +4 -2
- package/dist/js/GlobalNavigationBar/mobile/MobileMenu.js.map +1 -1
- package/dist/js/InputFields/DatepickerField.js +4 -2
- package/dist/js/InputFields/DatepickerField.js.map +1 -1
- package/dist/js/InputFields/components/SearchBarInput.js +4 -2
- package/dist/js/InputFields/components/SearchBarInput.js.map +1 -1
- package/dist/js/InputFields/components/SearchField.js +3 -1
- package/dist/js/InputFields/components/SearchField.js.map +1 -1
- package/dist/js/List/ListRow.js +3 -1
- package/dist/js/List/ListRow.js.map +1 -1
- package/dist/js/List/ListRowDropdown.js +3 -1
- package/dist/js/List/ListRowDropdown.js.map +1 -1
- package/dist/js/LoadingPage/GlobalLoadingPage.js +3 -1
- package/dist/js/LoadingPage/GlobalLoadingPage.js.map +1 -1
- package/dist/js/MiniProductCard/MiniProductCard.js +4 -2
- package/dist/js/MiniProductCard/MiniProductCard.js.map +1 -1
- package/dist/js/Modals/ModalDialog.d.ts +1 -1
- package/dist/js/Modals/ModalDialog.js +24 -10
- package/dist/js/Modals/ModalDialog.js.map +1 -1
- package/dist/js/Paginator/Paginator.js +3 -1
- package/dist/js/Paginator/Paginator.js.map +1 -1
- package/dist/js/SkipToContent/SkipToContent.js +3 -1
- package/dist/js/SkipToContent/SkipToContent.js.map +1 -1
- package/dist/js/Switcher/MobileSwitcherMenu.js +3 -1
- package/dist/js/Switcher/MobileSwitcherMenu.js.map +1 -1
- package/dist/js/Switcher/SwitcherMenuItem.js +3 -1
- package/dist/js/Switcher/SwitcherMenuItem.js.map +1 -1
- package/dist/js/Tabs/HorizontalTabs.js +3 -1
- package/dist/js/Tabs/HorizontalTabs.js.map +1 -1
- package/dist/js/Toasters/Toast.js +3 -3
- package/dist/js/Toasters/Toast.js.map +1 -1
- package/dist/js/styles/typography.d.ts +19 -6
- package/dist/js/styles/typography.js +80 -5
- package/dist/js/styles/typography.js.map +1 -1
- package/dist/umd/AuthPage/Information.js +6 -10
- package/dist/umd/AuthPage/Information.js.map +1 -1
- package/dist/umd/Banners/Banner.js +2 -2
- package/dist/umd/Banners/Banner.js.map +1 -1
- package/dist/umd/Banners/OverviewBanner.js +5 -6
- package/dist/umd/Banners/OverviewBanner.js.map +1 -1
- package/dist/umd/Breadcrumb/Breadcrumb.js +48 -22
- package/dist/umd/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/umd/Button/Iconbutton.js +4 -1
- package/dist/umd/Button/Iconbutton.js.map +1 -1
- package/dist/umd/Dropdown/CommonStyling.js +28 -28
- package/dist/umd/Dropdown/CommonStyling.js.map +1 -1
- package/dist/umd/Footer/Components/FooterDropdownLinks.js +8 -8
- package/dist/umd/Footer/Components/FooterDropdownLinks.js.map +1 -1
- package/dist/umd/Footer/Components/FooterNavSection.js +6 -11
- package/dist/umd/Footer/Components/FooterNavSection.js.map +1 -1
- package/dist/umd/Footer/Components/FooterNewsletterAndSocialSection.js +3 -3
- package/dist/umd/Footer/Components/FooterNewsletterAndSocialSection.js.map +1 -1
- package/dist/umd/Footer/Components/FooterTop.js +5 -6
- package/dist/umd/Footer/Components/FooterTop.js.map +1 -1
- package/dist/umd/GlobalNavigationBar/Logo.js +10 -14
- package/dist/umd/GlobalNavigationBar/Logo.js.map +1 -1
- package/dist/umd/GlobalNavigationBar/RightSideNav.js +6 -6
- package/dist/umd/GlobalNavigationBar/RightSideNav.js.map +1 -1
- package/dist/umd/GlobalNavigationBar/UserMenu/MenuLink.js +5 -9
- package/dist/umd/GlobalNavigationBar/UserMenu/MenuLink.js.map +1 -1
- package/dist/umd/GlobalNavigationBar/UserMenu/MobileUserMenu.js +12 -10
- package/dist/umd/GlobalNavigationBar/UserMenu/MobileUserMenu.js.map +1 -1
- package/dist/umd/GlobalNavigationBar/UserMenu/UserMenu.js +7 -16
- package/dist/umd/GlobalNavigationBar/UserMenu/UserMenu.js.map +1 -1
- package/dist/umd/GlobalNavigationBar/mobile/CommonStyles.js +4 -1
- package/dist/umd/GlobalNavigationBar/mobile/CommonStyles.js.map +1 -1
- package/dist/umd/GlobalNavigationBar/mobile/MobileMenu.js +7 -11
- package/dist/umd/GlobalNavigationBar/mobile/MobileMenu.js.map +1 -1
- package/dist/umd/InputFields/DatepickerField.js +15 -16
- package/dist/umd/InputFields/DatepickerField.js.map +1 -1
- package/dist/umd/InputFields/components/SearchBarInput.js +13 -14
- package/dist/umd/InputFields/components/SearchBarInput.js.map +1 -1
- package/dist/umd/InputFields/components/SearchField.js +15 -14
- package/dist/umd/InputFields/components/SearchField.js.map +1 -1
- package/dist/umd/List/ListRow.js +7 -5
- package/dist/umd/List/ListRow.js.map +1 -1
- package/dist/umd/List/ListRowDropdown.js +6 -8
- package/dist/umd/List/ListRowDropdown.js.map +1 -1
- package/dist/umd/LoadingPage/GlobalLoadingPage.js +6 -6
- package/dist/umd/LoadingPage/GlobalLoadingPage.js.map +1 -1
- package/dist/umd/MiniProductCard/MiniProductCard.js +6 -8
- package/dist/umd/MiniProductCard/MiniProductCard.js.map +1 -1
- package/dist/umd/Modals/ModalDialog.js +22 -10
- package/dist/umd/Modals/ModalDialog.js.map +1 -1
- package/dist/umd/Paginator/Paginator.js +7 -9
- package/dist/umd/Paginator/Paginator.js.map +1 -1
- package/dist/umd/SkipToContent/SkipToContent.js +6 -8
- package/dist/umd/SkipToContent/SkipToContent.js.map +1 -1
- package/dist/umd/Switcher/MobileSwitcherMenu.js +6 -7
- package/dist/umd/Switcher/MobileSwitcherMenu.js.map +1 -1
- package/dist/umd/Switcher/SwitcherMenuItem.js +10 -12
- package/dist/umd/Switcher/SwitcherMenuItem.js.map +1 -1
- package/dist/umd/Tabs/HorizontalTabs.js +8 -12
- package/dist/umd/Tabs/HorizontalTabs.js.map +1 -1
- package/dist/umd/Toasters/Toast.js +1 -2
- package/dist/umd/Toasters/Toast.js.map +1 -1
- package/dist/umd/styles/typography.js +62 -2
- package/dist/umd/styles/typography.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
if (typeof define === "function" && define.amd) {
|
|
3
|
-
define(["exports", "prop-types", "react", "styled-components", "react-datepicker", "date-fns/locale/en-GB", "moment", "../styles/colors", "../icons/systemicons/SystemIcons", "../Button/index", "./DatepickerFieldHeader", "../styles", "./styling", "react-datepicker/dist/react-datepicker.css"], factory);
|
|
3
|
+
define(["exports", "prop-types", "react", "styled-components", "react-datepicker", "date-fns/locale/en-GB", "moment", "../styles/colors", "../icons/systemicons/SystemIcons", "../Button/index", "./DatepickerFieldHeader", "../styles", "./styling", "../styles/typography", "react-datepicker/dist/react-datepicker.css"], factory);
|
|
4
4
|
} else if (typeof exports !== "undefined") {
|
|
5
|
-
factory(exports, require("prop-types"), require("react"), require("styled-components"), require("react-datepicker"), require("date-fns/locale/en-GB"), require("moment"), require("../styles/colors"), require("../icons/systemicons/SystemIcons"), require("../Button/index"), require("./DatepickerFieldHeader"), require("../styles"), require("./styling"), require("react-datepicker/dist/react-datepicker.css"));
|
|
5
|
+
factory(exports, require("prop-types"), require("react"), require("styled-components"), require("react-datepicker"), require("date-fns/locale/en-GB"), require("moment"), require("../styles/colors"), require("../icons/systemicons/SystemIcons"), require("../Button/index"), require("./DatepickerFieldHeader"), require("../styles"), require("./styling"), require("../styles/typography"), require("react-datepicker/dist/react-datepicker.css"));
|
|
6
6
|
} else {
|
|
7
7
|
var mod = {
|
|
8
8
|
exports: {}
|
|
9
9
|
};
|
|
10
|
-
factory(mod.exports, global.propTypes, global.react, global.styledComponents, global.reactDatepicker, global.enGB, global.moment, global.colors, global.SystemIcons, global.index, global.DatepickerFieldHeader, global.styles, global.styling, global.reactDatepicker);
|
|
10
|
+
factory(mod.exports, global.propTypes, global.react, global.styledComponents, global.reactDatepicker, global.enGB, global.moment, global.colors, global.SystemIcons, global.index, global.DatepickerFieldHeader, global.styles, global.styling, global.typography, global.reactDatepicker);
|
|
11
11
|
global.undefined = mod.exports;
|
|
12
12
|
}
|
|
13
|
-
})(this, function (exports, _propTypes, _react, _styledComponents, _reactDatepicker, _enGB, _moment, _colors, _SystemIcons, _index, _DatepickerFieldHeader, _styles, _styling) {
|
|
13
|
+
})(this, function (exports, _propTypes, _react, _styledComponents, _reactDatepicker, _enGB, _moment, _colors, _SystemIcons, _index, _DatepickerFieldHeader, _styles, _styling, _typography) {
|
|
14
14
|
"use strict";
|
|
15
15
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -144,6 +144,10 @@
|
|
|
144
144
|
*/
|
|
145
145
|
|
|
146
146
|
|
|
147
|
+
/**
|
|
148
|
+
* Add custom types.
|
|
149
|
+
*/
|
|
150
|
+
|
|
147
151
|
/**
|
|
148
152
|
* Add custom styles.
|
|
149
153
|
*/
|
|
@@ -241,13 +245,12 @@
|
|
|
241
245
|
}
|
|
242
246
|
|
|
243
247
|
.react-datepicker__current-month {
|
|
244
|
-
color: ${_colors2.default.neutral_600};
|
|
245
|
-
font-weight: 700;
|
|
246
248
|
height: 48px;
|
|
247
249
|
display: inline-flex;
|
|
248
250
|
align-items: center;
|
|
249
|
-
font-size: 19px;
|
|
250
251
|
margin-right: 5px;
|
|
252
|
+
|
|
253
|
+
${(0, _typography.ComponentSStyling)(_styles.ComponentTextStyle.Bold, _colors2.default.neutral_600)}
|
|
251
254
|
}
|
|
252
255
|
|
|
253
256
|
.react-datepicker__year {
|
|
@@ -263,30 +266,28 @@
|
|
|
263
266
|
}
|
|
264
267
|
|
|
265
268
|
.react-datepicker__day-name {
|
|
266
|
-
color: ${_colors2.default.neutral_600};
|
|
267
|
-
font-weight: 400;
|
|
268
269
|
display: inline-flex;
|
|
269
270
|
justify-content: center;
|
|
270
271
|
align-items: center;
|
|
271
272
|
height: 48px;
|
|
272
|
-
font-size: 19px;
|
|
273
273
|
margin: 0px;
|
|
274
274
|
width: 48px;
|
|
275
|
+
|
|
276
|
+
${(0, _typography.ComponentMStyling)(_styles.ComponentTextStyle.Regular, _colors2.default.neutral_600)}
|
|
275
277
|
}
|
|
276
278
|
|
|
277
279
|
.react-datepicker__year-text {
|
|
278
|
-
color: ${_colors2.default.neutral_600};
|
|
279
280
|
background: ${_colors2.default.white};
|
|
280
|
-
font-weight: 400;
|
|
281
281
|
border: none;
|
|
282
282
|
display: inline-flex;
|
|
283
283
|
justify-content: center;
|
|
284
284
|
align-items: center;
|
|
285
|
-
font-size: 19px;
|
|
286
285
|
margin-top: 20px;
|
|
287
286
|
padding-top: 10px;
|
|
288
287
|
padding-bottom: 10px;
|
|
289
288
|
|
|
289
|
+
${(0, _typography.ComponentMStyling)(_styles.ComponentTextStyle.Regular, _colors2.default.neutral_600)}
|
|
290
|
+
|
|
290
291
|
&.react-datepicker__year-text--disabled {
|
|
291
292
|
display: none;
|
|
292
293
|
}
|
|
@@ -317,9 +318,7 @@
|
|
|
317
318
|
}
|
|
318
319
|
|
|
319
320
|
.react-datepicker__day {
|
|
320
|
-
color: ${_colors2.default.neutral_600};
|
|
321
321
|
background: ${_colors2.default.white};
|
|
322
|
-
font-weight: 400;
|
|
323
322
|
border: none;
|
|
324
323
|
display: inline-flex;
|
|
325
324
|
justify-content: center;
|
|
@@ -327,8 +326,8 @@
|
|
|
327
326
|
height: 40px;
|
|
328
327
|
width: 40px;
|
|
329
328
|
margin: 4px;
|
|
330
|
-
font-size: 19px;
|
|
331
329
|
|
|
330
|
+
${(0, _typography.ComponentMStyling)(_styles.ComponentTextStyle.Regular, _colors2.default.neutral_600)}
|
|
332
331
|
&.react-datepicker__day--keyboard-selected {
|
|
333
332
|
color: ${_colors2.default.neutral_600};
|
|
334
333
|
background: ${_colors2.default.white};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/InputFields/DatepickerField.tsx"],"names":["id","disabled","locked","onChange","hasError","value","dateFormat","validationMessage","autoComplete","placeholder","required","yearPicker","yearsBeforeCurrentDate","yearsAfterCurrentDate","margin","DatePickerContainer","styled","div","props","COLORS","primary_20","primary_100","focus_25","focus","neutral_20","neutral_200","neutral_600","scrollBarStyling","white","primary_700","primary_800","primary_500","neutral_700","neutral_100","DatepickerRow","css","primary_600","StyledInputFieldStyling","primary_200","primary_300","neutral_300","DatepickerField","inputRef","React","datepickerRef","supressFocusRef","moment","selectedDate","document","dropdownParent","handleCalendarOpen","setOpenAt","maxDate","minDate","itemsNumber","Math","e","newDate","setYearPickerMode","yearPickerMode","openAt","params","customHeaderCount","display","setTabbedHere","critical_400"],"mappings":";;;;;;;;;;;;;;;;;;;;;MAGA,K;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAHA;AACA;AACA;;;AAgDA;AACA;AACA;AACA,QAAMe,mBAAmB,GAAGC,2BAAOC,GAA6C;AAChF;AACA;AACA,MAAOC,KAAD,IAAYA,KAAK,CAALA,MAAAA,GAAgB,WAAUA,KAAK,CAACJ,MAAhCI,GAAAA,GAA4C,EAAI;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsBC,iBAAOC,UAAW;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsBD,iBAAOE,WAAY;AACzC,mCAAmCF,iBAAOG,QAAS,iBAAgBH,iBAAOI,KAAM;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6BJ,iBAAOK,UAAW;AAC/C;AACA;AACA;AACA,iCAAiCL,iBAAOM,WAAY;AACpD,oBAAoBN,iBAAOK,UAAW;AACtC,gBAAiBN,KAAD,IAAY,CAACA,KAAK,CAAN,UAAA,GAAA,MAAA,GAA6B,MAAQ;AACjE;AACA;AACA;AACA;AACA,eAAeC,iBAAOO,WAAY;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQC,wBAAiB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeR,iBAAOO,WAAY;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeP,iBAAOO,WAAY;AAClC,oBAAoBP,iBAAOS,KAAM;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiBT,iBAAOO,WAAY;AACpC,sBAAsBP,iBAAOS,KAAM;AACnC;AACA;AACA;AACA;AACA;AACA,iBAAiBT,iBAAOU,WAAY;AACpC,sBAAsBV,iBAAOC,UAAW;AACxC;AACA;AACA;AACA,iBAAiBD,iBAAOW,WAAY;AACpC,sBAAsBX,iBAAOE,WAAY;AACzC,mCAAmCF,iBAAOG,QAAS,iBAAgBH,iBAAOI,KAAM;AAChF;AACA;AACA;AACA;AACA,iBAAiBJ,iBAAOS,KAAM;AAC9B,sBAAsBT,iBAAOY,WAAY;AACzC;AACA;AACA;AACA;AACA,eAAeZ,iBAAOO,WAAY;AAClC,oBAAoBP,iBAAOS,KAAM;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiBT,iBAAOO,WAAY;AACpC,sBAAsBP,iBAAOS,KAAM;AACn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A,aAAA,CAAA,MAAA,EAAA,IAAA,EAhFR,iBAgFQ,CAFF,CA7EJ,CADF;AAhEF,GAAA;;;AArTEjE,IAAAA,E;AACAC,IAAAA,Q;AACAC,IAAAA,M;AACAC,IAAAA,Q;AACAC,IAAAA,Q;AACAC,IAAAA,K;AACAC,IAAAA,U;AACAC,IAAAA,iB;AACAC,IAAAA,Y;AACAC,IAAAA,W;AACAC,IAAAA,Q;AACAC,IAAAA,U;AACAC,IAAAA,sB;AACAC,IAAAA,qB;AACAC,IAAAA,M;;oBA8bF,e","sourcesContent":["/**\n * Import react libraries.\n */\nimport * as React from 'react';\n\n/**\n * Import third-party libraries.\n */\nimport styled, { css } from 'styled-components';\nimport DatePicker from 'react-datepicker';\nimport en from 'date-fns/locale/en-GB';\nimport moment from 'moment';\n\n/**\n * Import custom components.\n */\nimport COLORS from '../styles/colors';\nimport { Calendar, TechnicalWarning } from '../icons/systemicons/SystemIcons';\nimport { IconButton } from '../Button/index';\nimport { DatepickerFieldHeader, DatepickerFieldHeaderParams } from './DatepickerFieldHeader';\nimport { scrollBarStyling } from '../styles';\n\n/**\n * Import custom styles.\n */\nimport { InputFieldStyling, InputWrapper, ErrorMessage } from './styling';\nimport 'react-datepicker/dist/react-datepicker.css';\nimport { CommonInteractionStyling } from '../common';\n\n/**\n * Add custom types.\n */\ntype DatepickerFieldProps = {\n id: string;\n disabled?: boolean;\n locked?: boolean;\n onChange?: (date: Date) => void;\n hasError?: boolean;\n value?: Date;\n dateFormat?: string;\n validationMessage?: string;\n autoComplete?: string;\n placeholder?: string;\n required?: boolean;\n yearPicker?: boolean;\n yearsBeforeCurrentDate?: number;\n yearsAfterCurrentDate?: number;\n margin?: string;\n};\n\n/**\n * Add custom styles.\n */\nconst DatePickerContainer = styled.div<{ yearPicker: boolean; margin: string }>`\n > div {\n display: block;\n ${(props) => (props.margin ? `margin: ${props.margin};` : '')}\n\n .react-datepicker {\n box-sizing: border-box;\n box-shadow: 0px 2px 4px rgb(0 0 0 / 15%);\n border: 1px solid #e5e5e5;\n }\n\n .react-datepicker__navigation {\n line-height: normal;\n text-indent: inherit;\n border: none;\n border-radius: 4px;\n height: 32px;\n width: 32px;\n outline: none;\n margin: 0px;\n color: transparent;\n\n &:hover {\n background: ${COLORS.primary_20};\n\n &.react-datepicker__navigation--previous::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M15.1975 4.46474C15.5885 4.85478 15.5893 5.48794 15.1993 5.87895L8.92124 12.1727L15.1993 18.4665C15.5893 18.8575 15.5885 19.4907 15.1975 19.8807C14.8065 20.2708 14.1734 20.27 13.7833 19.879L6.8008 12.879C6.41145 12.4886 6.41145 11.8568 6.8008 11.4665L13.7833 4.46651C14.1734 4.0755 14.8065 4.0747 15.1975 4.46474Z' fill='%23215369' /%3E%3C/svg%3E\");\n }\n\n &.react-datepicker__navigation--next::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M9.24214 19.8807C8.85113 19.4907 8.85034 18.8575 9.24038 18.4665L15.5184 12.1727L9.24037 5.87895C8.85034 5.48794 8.85113 4.85478 9.24214 4.46474C9.63315 4.0747 10.2663 4.07549 10.6564 4.46651L17.6389 11.4665C18.0282 11.8568 18.0282 12.4886 17.6389 12.879L10.6564 19.879C10.2663 20.27 9.63316 20.2708 9.24214 19.8807Z' fill='%23215369' /%3E%3C/svg%3E\");\n }\n }\n\n &:focus {\n background: ${COLORS.primary_100};\n box-shadow: 0px 4px 12px ${COLORS.focus_25}, 0px 0px 8px ${COLORS.focus} !important;\n\n &.react-datepicker__navigation--next::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M9.24214 19.8807C8.85113 19.4907 8.85034 18.8575 9.24038 18.4665L15.5184 12.1727L9.24037 5.87895C8.85034 5.48794 8.85113 4.85478 9.24214 4.46474C9.63315 4.0747 10.2663 4.07549 10.6564 4.46651L17.6389 11.4665C18.0282 11.8568 18.0282 12.4886 17.6389 12.879L10.6564 19.879C10.2663 20.27 9.63316 20.2708 9.24214 19.8807Z' fill='%23163746' /%3E%3C/svg%3E\");\n }\n\n &.react-datepicker__navigation--previous::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M15.1975 4.46474C15.5885 4.85478 15.5893 5.48794 15.1993 5.87895L8.92124 12.1727L15.1993 18.4665C15.5893 18.8575 15.5885 19.4907 15.1975 19.8807C14.8065 20.2708 14.1734 20.27 13.7833 19.879L6.8008 12.879C6.41145 12.4886 6.41145 11.8568 6.8008 11.4665L13.7833 4.46651C14.1734 4.0755 14.8065 4.0747 15.1975 4.46474Z' fill='%23163746' /%3E%3C/svg%3E\");\n }\n }\n\n &::before {\n text-align: center;\n display: inline-block;\n content: '';\n height: 32px;\n width: 32px;\n vertical-align: middle;\n }\n\n &.react-datepicker__navigation--next::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M9.24214 19.8807C8.85113 19.4907 8.85034 18.8575 9.24038 18.4665L15.5184 12.1727L9.24037 5.87895C8.85034 5.48794 8.85113 4.85478 9.24214 4.46474C9.63315 4.0747 10.2663 4.07549 10.6564 4.46651L17.6389 11.4665C18.0282 11.8568 18.0282 12.4886 17.6389 12.879L10.6564 19.879C10.2663 20.27 9.63316 20.2708 9.24214 19.8807Z' fill='%23666666' /%3E%3C/svg%3E\");\n }\n\n &.react-datepicker__navigation--previous::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M15.1975 4.46474C15.5885 4.85478 15.5893 5.48794 15.1993 5.87895L8.92124 12.1727L15.1993 18.4665C15.5893 18.8575 15.5885 19.4907 15.1975 19.8807C14.8065 20.2708 14.1734 20.27 13.7833 19.879L6.8008 12.879C6.41145 12.4886 6.41145 11.8568 6.8008 11.4665L13.7833 4.46651C14.1734 4.0755 14.8065 4.0747 15.1975 4.46474Z' fill='%23666666' /%3E%3C/svg%3E\");\n }\n }\n\n .react-datepicker__month-container,\n .react-datepicker__year--container {\n width: 336px;\n }\n\n .react-datepicker__month {\n margin: 0px;\n }\n\n .react-datepicker__triangle {\n left: 50% !important;\n display: none;\n }\n .react-datepicker-popper[data-placement^='bottom'] {\n margin-top: 0;\n }\n\n .react-datepicker-popper[data-placement^='bottom'] .react-datepicker__triangle {\n border-bottom-color: ${COLORS.neutral_20};\n }\n\n .react-datepicker__header {\n border-bottom: 1px solid ${COLORS.neutral_200};\n background: ${COLORS.neutral_20};\n height: ${(props) => (!props.yearPicker ? '96px' : '54px')};\n padding-top: 0px;\n }\n\n .react-datepicker__current-month {\n color: ${COLORS.neutral_600};\n font-weight: 700;\n height: 48px;\n display: inline-flex;\n align-items: center;\n font-size: 19px;\n margin-right: 5px;\n }\n\n .react-datepicker__year {\n max-height: 300px;\n overflow-y: scroll;\n\n ${scrollBarStyling}\n }\n\n .react-datepicker__year-wrapper {\n max-width: 100%;\n justify-content: space-around;\n }\n\n .react-datepicker__day-name {\n color: ${COLORS.neutral_600};\n font-weight: 400;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n height: 48px;\n font-size: 19px;\n margin: 0px;\n width: 48px;\n }\n\n .react-datepicker__year-text {\n color: ${COLORS.neutral_600};\n background: ${COLORS.white};\n font-weight: 400;\n border: none;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n font-size: 19px;\n margin-top: 20px;\n padding-top: 10px;\n padding-bottom: 10px;\n\n &.react-datepicker__year-text--disabled {\n display: none;\n }\n\n &.react-datepicker__day--keyboard-selected {\n color: ${COLORS.neutral_600};\n background: ${COLORS.white};\n font-weight: 400;\n border: none;\n }\n\n &:hover {\n color: ${COLORS.primary_700};\n background: ${COLORS.primary_20};\n }\n\n &:focus {\n color: ${COLORS.primary_800};\n background: ${COLORS.primary_100};\n box-shadow: 0px 4px 12px ${COLORS.focus_25}, 0px 0px 8px ${COLORS.focus} !important;\n outline: none;\n }\n\n &.react-datepicker__year-text--selected {\n color: ${COLORS.white} !important;\n background: ${COLORS.primary_500} !important;\n }\n }\n\n .react-datepicker__day {\n color: ${COLORS.neutral_600};\n background: ${COLORS.white};\n font-weight: 400;\n border: none;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n height: 40px;\n width: 40px;\n margin: 4px;\n font-size: 19px;\n\n &.react-datepicker__day--keyboard-selected {\n color: ${COLORS.neutral_600};\n background: ${COLORS.white};\n font-weight: 400;\n border: none;\n }\n\n &:hover {\n color: ${COLORS.primary_700};\n background: ${COLORS.primary_20};\n }\n\n &:focus {\n color: ${COLORS.primary_800};\n background: ${COLORS.primary_100};\n box-shadow: 0px 4px 12px ${COLORS.focus_25}, 0px 0px 8px ${COLORS.focus} !important;\n outline: none;\n }\n\n &.react-datepicker__day--selected {\n color: ${COLORS.white} !important;\n background: ${COLORS.primary_500} !important;\n }\n\n &.react-datepicker__day--today {\n border-radius: 0.3rem;\n color: ${COLORS.neutral_700};\n background: ${COLORS.neutral_100};\n\n &:hover {\n color: ${COLORS.primary_700};\n background: ${COLORS.primary_20};\n }\n\n &:focus {\n color: ${COLORS.primary_800};\n background: ${COLORS.primary_100};\n box-shadow: 0px 4px 12px ${COLORS.focus_25}, 0px 0px 8px ${COLORS.focus} !important;\n outline: none;\n }\n }\n }\n }\n`;\n\nconst DatepickerRow = styled.div<{ disabled?: boolean; locked?: boolean }>`\n display: flex;\n flex-direction: row;\n position: relative;\n\n > button {\n position: absolute;\n right: 4px;\n top: 4px;\n\n svg {\n }\n }\n\n ${(props) =>\n props?.disabled || props?.locked\n ? ''\n : css`\n &:hover {\n svg,\n svg path {\n fill: ${COLORS.primary_600} !important;\n }\n }\n `}\n &:focus-within {\n -webkit-box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_800};\n -moz-box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_800};\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_800};\n }\n`;\n\nconst StyledInputFieldStyling = styled(InputFieldStyling)`\n &:hover {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_200};\n ::placeholder {\n color: ${COLORS.primary_600};\n }\n cursor: pointer;\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_600};\n }\n &:active {\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_300};\n ::placeholder {\n color: ${COLORS.primary_800};\n }\n }\n &:disabled {\n box-shadow: none;\n background-color: ${COLORS.white};\n span {\n color: ${COLORS.neutral_300};\n }\n &::after {\n background-color: ${COLORS.white};\n }\n }\n`;\n\nconst DatepickerField = ({\n id,\n disabled,\n locked,\n onChange,\n hasError,\n value,\n validationMessage,\n dateFormat,\n autoComplete,\n placeholder,\n required,\n yearPicker,\n yearsBeforeCurrentDate,\n yearsAfterCurrentDate,\n margin,\n}: DatepickerFieldProps) => {\n // Globally used variables within the component\n const inputRef = React.useRef<any>(null);\n const datepickerRef = React.useRef<any>(null);\n const [tabbedHere, setTabbedHere] = React.useState<boolean>(false);\n const [activeMonthPage, setActiveMonthPage] = React.useState<number>(-1);\n const [yearPickerMode, setYearPickerMode] = React.useState<boolean>(false);\n const [openAt, setOpenAt] = React.useState<Date | null>(null);\n const supressFocusRef = React.useRef<any>(null);\n\n /**\n * Format the date in a specific way.\n */\n React.useEffect(() => {\n if (value) inputRef.current.value = moment(value).format(dateFormat ? dateFormat : 'MMMM Do, YYYY');\n }, [value]);\n\n React.useEffect(() => {\n if (yearPickerMode) {\n //unfortunately, since there are no refs, and year pickers is rendered not by our code, but by 'react-datepicker'\n //we have to touch DOM directly\n const selectedDate = document.getElementsByClassName('react-datepicker__year-text--selected')[0] as HTMLElement;\n const dropdownParent = selectedDate?.parentElement?.parentElement;\n if (selectedDate && dropdownParent) dropdownParent.scrollTop = selectedDate.offsetTop - 2 * selectedDate.offsetHeight;\n }\n }, [yearPickerMode]);\n\n //we have to manually reopen the calendar when needed, to guarantee that datepicker will show selected date after year selection\n //otherwise after year selection datepicker will show January month of the selected year\n React.useEffect(() => {\n if (openAt) {\n datepickerRef.current.setOpen(true);\n //setOpenAt(null);\n }\n }, [openAt]);\n\n const handleCalendarOpen = () => {\n if (openAt) setOpenAt(null);\n };\n\n let maxDate = new Date(value && new Date(value) > new Date() ? new Date(value) : new Date());\n maxDate.setFullYear(maxDate.getFullYear() + (yearsAfterCurrentDate ?? 50));\n\n //itemsNumber - controls number of year select options generated in the dropdown\n //items related to dates higher than 'maxDate' will be hidden, thus to avoid creating hundreds of invisible divs, we divide by 5\n let minDate = new Date(value && new Date(value) < new Date() ? new Date(value) : new Date());\n const itemsNumber = Math.round((minDate.getFullYear() - (yearsBeforeCurrentDate ?? 15)) / 5);\n\n return (\n <>\n {/* Let's render the input itself */}\n <DatePickerContainer yearPicker={yearPickerMode} margin={margin || ''}>\n <DatePicker\n ref={datepickerRef}\n onCalendarOpen={handleCalendarOpen}\n onChange={(e: any) => {\n if (onChange) {\n if (yearPickerMode) {\n const newDate = new Date();\n newDate.setFullYear(e.getFullYear());\n newDate.setMonth(activeMonthPage);\n setOpenAt(newDate);\n } else onChange(e);\n }\n if (yearPickerMode) setYearPickerMode(false);\n }}\n disabled={disabled || locked}\n locale={en}\n showYearPicker={yearPickerMode}\n //we manipulate 'yearItemNumber' and 'maxDate' to guarantee number of year select options shown before and after selected year\n yearItemNumber={yearPickerMode ? itemsNumber : undefined}\n maxDate={yearPickerMode ? maxDate : undefined}\n selected={value}\n openToDate={openAt ?? undefined}\n shouldCloseOnSelect={true}\n renderCustomHeader={\n yearPicker\n ? (params: DatepickerFieldHeaderParams) =>\n React.createElement(\n DatepickerFieldHeader,\n { ...params, setActiveMonthPage, customHeaderCount: 0, yearPickerMode: yearPickerMode, setYearPickerMode: setYearPickerMode },\n null,\n )\n : undefined\n }\n customInput={\n <InputWrapper disabled={disabled} locked={locked} tabIndex={disabled ? -1 : 0}>\n <div style={{ display: 'block' }}>\n <DatepickerRow locked={locked} disabled={disabled}>\n <StyledInputFieldStyling\n id={id}\n ref={inputRef}\n type=\"text\"\n name=\"datepicker\"\n readOnly={true}\n className={hasError ? 'error' : ''}\n tabIndex={0}\n autoComplete={autoComplete}\n placeholder={placeholder}\n disabled={disabled}\n locked={locked}\n required={required}\n tabbedHere={tabbedHere}\n onBlur={() => setTabbedHere(false)}\n onMouseDown={(e: any) => {\n if (!(locked || disabled) && !tabbedHere) supressFocusRef.current = true;\n }}\n onFocus={(e: any) => {\n if (!(locked || disabled)) {\n if (!supressFocusRef.current) setTabbedHere(true);\n else supressFocusRef.current = false;\n }\n }}\n />\n <IconButton variant=\"secondary\" shape=\"square\" tabIndex={-1} action={() => {}} disabled={disabled || locked}>\n <Calendar size=\"24\" />\n </IconButton>\n </DatepickerRow>\n </div>\n </InputWrapper>\n }\n />\n </DatePickerContainer>\n\n {/* If there is an error, let's render the error */}\n {validationMessage && (\n <ErrorMessage>\n <TechnicalWarning size=\"20px\" color={COLORS.critical_400} />\n <span>{validationMessage}</span>\n </ErrorMessage>\n )}\n </>\n );\n};\n\nexport default DatepickerField;\n"],"file":"DatepickerField.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/InputFields/DatepickerField.tsx"],"names":["id","disabled","locked","onChange","hasError","value","dateFormat","validationMessage","autoComplete","placeholder","required","yearPicker","yearsBeforeCurrentDate","yearsAfterCurrentDate","margin","DatePickerContainer","styled","div","props","COLORS","primary_20","primary_100","focus_25","focus","neutral_20","neutral_200","ComponentSStyling","ComponentTextStyle","scrollBarStyling","ComponentMStyling","white","neutral_600","primary_700","primary_800","primary_500","neutral_700","neutral_100","DatepickerRow","css","primary_600","StyledInputFieldStyling","primary_200","primary_300","neutral_300","DatepickerField","inputRef","React","datepickerRef","supressFocusRef","moment","selectedDate","document","dropdownParent","handleCalendarOpen","setOpenAt","maxDate","minDate","itemsNumber","Math","e","newDate","setYearPickerMode","yearPickerMode","openAt","params","customHeaderCount","display","setTabbedHere","critical_400"],"mappings":";;;;;;;;;;;;;;;;;;;;;MAGA,K;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAHA;AACA;AACA;;;AA2BA;AACA;AACA;;AAmBA;AACA;AACA;AACA,QAAMe,mBAAmB,GAAGC,2BAAOC,GAA6C;AAChF;AACA;AACA,MAAOC,KAAD,IAAYA,KAAK,CAALA,MAAAA,GAAgB,WAAUA,KAAK,CAACJ,MAAhCI,GAAAA,GAA4C,EAAI;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsBC,iBAAOC,UAAW;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsBD,iBAAOE,WAAY;AACzC,mCAAmCF,iBAAOG,QAAS,iBAAgBH,iBAAOI,KAAM;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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AAA,KAAK,EAAEY,iBAAOiD;AAA5C,KAAA,CADF,EAAA,aAEE,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA,IAAA,EAhFR,iBAgFQ,CAFF,CA7EJ,CADF;AAhEF,GAAA;;;AAhTEpE,IAAAA,E;AACAC,IAAAA,Q;AACAC,IAAAA,M;AACAC,IAAAA,Q;AACAC,IAAAA,Q;AACAC,IAAAA,K;AACAC,IAAAA,U;AACAC,IAAAA,iB;AACAC,IAAAA,Y;AACAC,IAAAA,W;AACAC,IAAAA,Q;AACAC,IAAAA,U;AACAC,IAAAA,sB;AACAC,IAAAA,qB;AACAC,IAAAA,M;;oBAybF,e","sourcesContent":["/**\n * Import react libraries.\n */\nimport * as React from 'react';\n\n/**\n * Import third-party libraries.\n */\nimport styled, {css} from 'styled-components';\nimport DatePicker from 'react-datepicker';\nimport en from 'date-fns/locale/en-GB';\nimport moment from 'moment';\n\n/**\n * Import custom components.\n */\nimport COLORS from '../styles/colors';\nimport {Calendar, TechnicalWarning} from '../icons/systemicons/SystemIcons';\nimport {IconButton} from '../Button/index';\nimport {DatepickerFieldHeader, DatepickerFieldHeaderParams} from './DatepickerFieldHeader';\nimport {ComponentTextStyle, scrollBarStyling} from '../styles';\n\n/**\n * Import custom styles.\n */\nimport {ErrorMessage, InputFieldStyling, InputWrapper} from './styling';\nimport 'react-datepicker/dist/react-datepicker.css';\nimport {ComponentMStyling, ComponentSStyling} from '../styles/typography';\n\n/**\n * Add custom types.\n */\ntype DatepickerFieldProps = {\n id: string;\n disabled?: boolean;\n locked?: boolean;\n onChange?: (date: Date) => void;\n hasError?: boolean;\n value?: Date;\n dateFormat?: string;\n validationMessage?: string;\n autoComplete?: string;\n placeholder?: string;\n required?: boolean;\n yearPicker?: boolean;\n yearsBeforeCurrentDate?: number;\n yearsAfterCurrentDate?: number;\n margin?: string;\n};\n\n/**\n * Add custom styles.\n */\nconst DatePickerContainer = styled.div<{ yearPicker: boolean; margin: string }>`\n > div {\n display: block;\n ${(props) => (props.margin ? `margin: ${props.margin};` : '')}\n\n .react-datepicker {\n box-sizing: border-box;\n box-shadow: 0px 2px 4px rgb(0 0 0 / 15%);\n border: 1px solid #e5e5e5;\n }\n\n .react-datepicker__navigation {\n line-height: normal;\n text-indent: inherit;\n border: none;\n border-radius: 4px;\n height: 32px;\n width: 32px;\n outline: none;\n margin: 0px;\n color: transparent;\n\n &:hover {\n background: ${COLORS.primary_20};\n\n &.react-datepicker__navigation--previous::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M15.1975 4.46474C15.5885 4.85478 15.5893 5.48794 15.1993 5.87895L8.92124 12.1727L15.1993 18.4665C15.5893 18.8575 15.5885 19.4907 15.1975 19.8807C14.8065 20.2708 14.1734 20.27 13.7833 19.879L6.8008 12.879C6.41145 12.4886 6.41145 11.8568 6.8008 11.4665L13.7833 4.46651C14.1734 4.0755 14.8065 4.0747 15.1975 4.46474Z' fill='%23215369' /%3E%3C/svg%3E\");\n }\n\n &.react-datepicker__navigation--next::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M9.24214 19.8807C8.85113 19.4907 8.85034 18.8575 9.24038 18.4665L15.5184 12.1727L9.24037 5.87895C8.85034 5.48794 8.85113 4.85478 9.24214 4.46474C9.63315 4.0747 10.2663 4.07549 10.6564 4.46651L17.6389 11.4665C18.0282 11.8568 18.0282 12.4886 17.6389 12.879L10.6564 19.879C10.2663 20.27 9.63316 20.2708 9.24214 19.8807Z' fill='%23215369' /%3E%3C/svg%3E\");\n }\n }\n\n &:focus {\n background: ${COLORS.primary_100};\n box-shadow: 0px 4px 12px ${COLORS.focus_25}, 0px 0px 8px ${COLORS.focus} !important;\n\n &.react-datepicker__navigation--next::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M9.24214 19.8807C8.85113 19.4907 8.85034 18.8575 9.24038 18.4665L15.5184 12.1727L9.24037 5.87895C8.85034 5.48794 8.85113 4.85478 9.24214 4.46474C9.63315 4.0747 10.2663 4.07549 10.6564 4.46651L17.6389 11.4665C18.0282 11.8568 18.0282 12.4886 17.6389 12.879L10.6564 19.879C10.2663 20.27 9.63316 20.2708 9.24214 19.8807Z' fill='%23163746' /%3E%3C/svg%3E\");\n }\n\n &.react-datepicker__navigation--previous::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M15.1975 4.46474C15.5885 4.85478 15.5893 5.48794 15.1993 5.87895L8.92124 12.1727L15.1993 18.4665C15.5893 18.8575 15.5885 19.4907 15.1975 19.8807C14.8065 20.2708 14.1734 20.27 13.7833 19.879L6.8008 12.879C6.41145 12.4886 6.41145 11.8568 6.8008 11.4665L13.7833 4.46651C14.1734 4.0755 14.8065 4.0747 15.1975 4.46474Z' fill='%23163746' /%3E%3C/svg%3E\");\n }\n }\n\n &::before {\n text-align: center;\n display: inline-block;\n content: '';\n height: 32px;\n width: 32px;\n vertical-align: middle;\n }\n\n &.react-datepicker__navigation--next::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M9.24214 19.8807C8.85113 19.4907 8.85034 18.8575 9.24038 18.4665L15.5184 12.1727L9.24037 5.87895C8.85034 5.48794 8.85113 4.85478 9.24214 4.46474C9.63315 4.0747 10.2663 4.07549 10.6564 4.46651L17.6389 11.4665C18.0282 11.8568 18.0282 12.4886 17.6389 12.879L10.6564 19.879C10.2663 20.27 9.63316 20.2708 9.24214 19.8807Z' fill='%23666666' /%3E%3C/svg%3E\");\n }\n\n &.react-datepicker__navigation--previous::before {\n background-image: url(\"data:image/svg+xml,%3Csvg style='width: 32px; height: 32px;' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M15.1975 4.46474C15.5885 4.85478 15.5893 5.48794 15.1993 5.87895L8.92124 12.1727L15.1993 18.4665C15.5893 18.8575 15.5885 19.4907 15.1975 19.8807C14.8065 20.2708 14.1734 20.27 13.7833 19.879L6.8008 12.879C6.41145 12.4886 6.41145 11.8568 6.8008 11.4665L13.7833 4.46651C14.1734 4.0755 14.8065 4.0747 15.1975 4.46474Z' fill='%23666666' /%3E%3C/svg%3E\");\n }\n }\n\n .react-datepicker__month-container,\n .react-datepicker__year--container {\n width: 336px;\n }\n\n .react-datepicker__month {\n margin: 0px;\n }\n\n .react-datepicker__triangle {\n left: 50% !important;\n display: none;\n }\n .react-datepicker-popper[data-placement^='bottom'] {\n margin-top: 0;\n }\n\n .react-datepicker-popper[data-placement^='bottom'] .react-datepicker__triangle {\n border-bottom-color: ${COLORS.neutral_20};\n }\n\n .react-datepicker__header {\n border-bottom: 1px solid ${COLORS.neutral_200};\n background: ${COLORS.neutral_20};\n height: ${(props) => (!props.yearPicker ? '96px' : '54px')};\n padding-top: 0px;\n }\n\n .react-datepicker__current-month {\n height: 48px;\n display: inline-flex;\n align-items: center;\n margin-right: 5px;\n\n ${ComponentSStyling(ComponentTextStyle.Bold, COLORS.neutral_600)}\n }\n\n .react-datepicker__year {\n max-height: 300px;\n overflow-y: scroll;\n\n ${scrollBarStyling}\n }\n\n .react-datepicker__year-wrapper {\n max-width: 100%;\n justify-content: space-around;\n }\n\n .react-datepicker__day-name {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n height: 48px;\n margin: 0px;\n width: 48px;\n\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n }\n\n .react-datepicker__year-text {\n background: ${COLORS.white};\n border: none;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n margin-top: 20px;\n padding-top: 10px;\n padding-bottom: 10px;\n\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n\n &.react-datepicker__year-text--disabled {\n display: none;\n }\n\n &.react-datepicker__day--keyboard-selected {\n color: ${COLORS.neutral_600};\n background: ${COLORS.white};\n font-weight: 400;\n border: none;\n }\n\n &:hover {\n color: ${COLORS.primary_700};\n background: ${COLORS.primary_20};\n }\n\n &:focus {\n color: ${COLORS.primary_800};\n background: ${COLORS.primary_100};\n box-shadow: 0px 4px 12px ${COLORS.focus_25}, 0px 0px 8px ${COLORS.focus} !important;\n outline: none;\n }\n\n &.react-datepicker__year-text--selected {\n color: ${COLORS.white} !important;\n background: ${COLORS.primary_500} !important;\n }\n }\n\n .react-datepicker__day {\n background: ${COLORS.white};\n border: none;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n height: 40px;\n width: 40px;\n margin: 4px;\n\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n &.react-datepicker__day--keyboard-selected {\n color: ${COLORS.neutral_600};\n background: ${COLORS.white};\n font-weight: 400;\n border: none;\n }\n\n &:hover {\n color: ${COLORS.primary_700};\n background: ${COLORS.primary_20};\n }\n\n &:focus {\n color: ${COLORS.primary_800};\n background: ${COLORS.primary_100};\n box-shadow: 0px 4px 12px ${COLORS.focus_25}, 0px 0px 8px ${COLORS.focus} !important;\n outline: none;\n }\n\n &.react-datepicker__day--selected {\n color: ${COLORS.white} !important;\n background: ${COLORS.primary_500} !important;\n }\n\n &.react-datepicker__day--today {\n border-radius: 0.3rem;\n color: ${COLORS.neutral_700};\n background: ${COLORS.neutral_100};\n\n &:hover {\n color: ${COLORS.primary_700};\n background: ${COLORS.primary_20};\n }\n\n &:focus {\n color: ${COLORS.primary_800};\n background: ${COLORS.primary_100};\n box-shadow: 0px 4px 12px ${COLORS.focus_25}, 0px 0px 8px ${COLORS.focus} !important;\n outline: none;\n }\n }\n }\n }\n`;\n\nconst DatepickerRow = styled.div<{ disabled?: boolean; locked?: boolean }>`\n display: flex;\n flex-direction: row;\n position: relative;\n\n > button {\n position: absolute;\n right: 4px;\n top: 4px;\n\n svg {\n }\n }\n\n ${(props) =>\n props?.disabled || props?.locked\n ? ''\n : css`\n &:hover {\n svg,\n svg path {\n fill: ${COLORS.primary_600} !important;\n }\n }\n `}\n &:focus-within {\n -webkit-box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_800};\n -moz-box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_800};\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_800};\n }\n`;\n\nconst StyledInputFieldStyling = styled(InputFieldStyling)`\n &:hover {\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_200};\n ::placeholder {\n color: ${COLORS.primary_600};\n }\n cursor: pointer;\n background-color: ${COLORS.primary_20};\n color: ${COLORS.primary_600};\n }\n &:active {\n background-color: ${COLORS.primary_100};\n color: ${COLORS.primary_800};\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_300};\n ::placeholder {\n color: ${COLORS.primary_800};\n }\n }\n &:disabled {\n box-shadow: none;\n background-color: ${COLORS.white};\n span {\n color: ${COLORS.neutral_300};\n }\n &::after {\n background-color: ${COLORS.white};\n }\n }\n`;\n\nconst DatepickerField = ({\n id,\n disabled,\n locked,\n onChange,\n hasError,\n value,\n validationMessage,\n dateFormat,\n autoComplete,\n placeholder,\n required,\n yearPicker,\n yearsBeforeCurrentDate,\n yearsAfterCurrentDate,\n margin,\n}: DatepickerFieldProps) => {\n // Globally used variables within the component\n const inputRef = React.useRef<any>(null);\n const datepickerRef = React.useRef<any>(null);\n const [tabbedHere, setTabbedHere] = React.useState<boolean>(false);\n const [activeMonthPage, setActiveMonthPage] = React.useState<number>(-1);\n const [yearPickerMode, setYearPickerMode] = React.useState<boolean>(false);\n const [openAt, setOpenAt] = React.useState<Date | null>(null);\n const supressFocusRef = React.useRef<any>(null);\n\n /**\n * Format the date in a specific way.\n */\n React.useEffect(() => {\n if (value) inputRef.current.value = moment(value).format(dateFormat ? dateFormat : 'MMMM Do, YYYY');\n }, [value]);\n\n React.useEffect(() => {\n if (yearPickerMode) {\n //unfortunately, since there are no refs, and year pickers is rendered not by our code, but by 'react-datepicker'\n //we have to touch DOM directly\n const selectedDate = document.getElementsByClassName('react-datepicker__year-text--selected')[0] as HTMLElement;\n const dropdownParent = selectedDate?.parentElement?.parentElement;\n if (selectedDate && dropdownParent) dropdownParent.scrollTop = selectedDate.offsetTop - 2 * selectedDate.offsetHeight;\n }\n }, [yearPickerMode]);\n\n //we have to manually reopen the calendar when needed, to guarantee that datepicker will show selected date after year selection\n //otherwise after year selection datepicker will show January month of the selected year\n React.useEffect(() => {\n if (openAt) {\n datepickerRef.current.setOpen(true);\n //setOpenAt(null);\n }\n }, [openAt]);\n\n const handleCalendarOpen = () => {\n if (openAt) setOpenAt(null);\n };\n\n let maxDate = new Date(value && new Date(value) > new Date() ? new Date(value) : new Date());\n maxDate.setFullYear(maxDate.getFullYear() + (yearsAfterCurrentDate ?? 50));\n\n //itemsNumber - controls number of year select options generated in the dropdown\n //items related to dates higher than 'maxDate' will be hidden, thus to avoid creating hundreds of invisible divs, we divide by 5\n let minDate = new Date(value && new Date(value) < new Date() ? new Date(value) : new Date());\n const itemsNumber = Math.round((minDate.getFullYear() - (yearsBeforeCurrentDate ?? 15)) / 5);\n\n return (\n <>\n {/* Let's render the input itself */}\n <DatePickerContainer yearPicker={yearPickerMode} margin={margin || ''}>\n <DatePicker\n ref={datepickerRef}\n onCalendarOpen={handleCalendarOpen}\n onChange={(e: any) => {\n if (onChange) {\n if (yearPickerMode) {\n const newDate = new Date();\n newDate.setFullYear(e.getFullYear());\n newDate.setMonth(activeMonthPage);\n setOpenAt(newDate);\n } else onChange(e);\n }\n if (yearPickerMode) setYearPickerMode(false);\n }}\n disabled={disabled || locked}\n locale={en}\n showYearPicker={yearPickerMode}\n //we manipulate 'yearItemNumber' and 'maxDate' to guarantee number of year select options shown before and after selected year\n yearItemNumber={yearPickerMode ? itemsNumber : undefined}\n maxDate={yearPickerMode ? maxDate : undefined}\n selected={value}\n openToDate={openAt ?? undefined}\n shouldCloseOnSelect={true}\n renderCustomHeader={\n yearPicker\n ? (params: DatepickerFieldHeaderParams) =>\n React.createElement(\n DatepickerFieldHeader,\n { ...params, setActiveMonthPage, customHeaderCount: 0, yearPickerMode: yearPickerMode, setYearPickerMode: setYearPickerMode },\n null,\n )\n : undefined\n }\n customInput={\n <InputWrapper disabled={disabled} locked={locked} tabIndex={disabled ? -1 : 0}>\n <div style={{ display: 'block' }}>\n <DatepickerRow locked={locked} disabled={disabled}>\n <StyledInputFieldStyling\n id={id}\n ref={inputRef}\n type=\"text\"\n name=\"datepicker\"\n readOnly={true}\n className={hasError ? 'error' : ''}\n tabIndex={0}\n autoComplete={autoComplete}\n placeholder={placeholder}\n disabled={disabled}\n locked={locked}\n required={required}\n tabbedHere={tabbedHere}\n onBlur={() => setTabbedHere(false)}\n onMouseDown={(e: any) => {\n if (!(locked || disabled) && !tabbedHere) supressFocusRef.current = true;\n }}\n onFocus={(e: any) => {\n if (!(locked || disabled)) {\n if (!supressFocusRef.current) setTabbedHere(true);\n else supressFocusRef.current = false;\n }\n }}\n />\n <IconButton variant=\"secondary\" shape=\"square\" tabIndex={-1} action={() => {}} disabled={disabled || locked}>\n <Calendar size=\"24\" />\n </IconButton>\n </DatepickerRow>\n </div>\n </InputWrapper>\n }\n />\n </DatePickerContainer>\n\n {/* If there is an error, let's render the error */}\n {validationMessage && (\n <ErrorMessage>\n <TechnicalWarning size=\"20px\" color={COLORS.critical_400} />\n <span>{validationMessage}</span>\n </ErrorMessage>\n )}\n </>\n );\n};\n\nexport default DatepickerField;\n"],"file":"DatepickerField.js"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
if (typeof define === "function" && define.amd) {
|
|
3
|
-
define(["exports", "prop-types", "react", "styled-components", "../../styles/index"], factory);
|
|
3
|
+
define(["exports", "prop-types", "react", "styled-components", "../../styles/index", "../../styles/typography"], factory);
|
|
4
4
|
} else if (typeof exports !== "undefined") {
|
|
5
|
-
factory(exports, require("prop-types"), require("react"), require("styled-components"), require("../../styles/index"));
|
|
5
|
+
factory(exports, require("prop-types"), require("react"), require("styled-components"), require("../../styles/index"), require("../../styles/typography"));
|
|
6
6
|
} else {
|
|
7
7
|
var mod = {
|
|
8
8
|
exports: {}
|
|
9
9
|
};
|
|
10
|
-
factory(mod.exports, global.propTypes, global.react, global.styledComponents, global.index);
|
|
10
|
+
factory(mod.exports, global.propTypes, global.react, global.styledComponents, global.index, global.typography);
|
|
11
11
|
global.undefined = mod.exports;
|
|
12
12
|
}
|
|
13
|
-
})(this, function (exports, _propTypes, _react, _styledComponents, _index) {
|
|
13
|
+
})(this, function (exports, _propTypes, _react, _styledComponents, _index, _typography) {
|
|
14
14
|
"use strict";
|
|
15
15
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -84,8 +84,8 @@
|
|
|
84
84
|
type: 'search'
|
|
85
85
|
}))`
|
|
86
86
|
appearance: none;
|
|
87
|
-
font-size: 1rem;
|
|
88
87
|
width: calc(100% - 96px);
|
|
88
|
+
${(0, _typography.ComponentSStyling)(_index.ComponentTextStyle.Regular, _index.COLORS.black)}
|
|
89
89
|
|
|
90
90
|
/* To prevent browser putting its own cross inside the search bar */
|
|
91
91
|
::-ms-clear {
|
|
@@ -106,8 +106,7 @@
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
::placeholder {
|
|
109
|
-
|
|
110
|
-
color: ${_index.COLORS.neutral_400};
|
|
109
|
+
${(0, _typography.ComponentSStyling)(_index.ComponentTextStyle.Italic, _index.COLORS.neutral_500)}
|
|
111
110
|
}
|
|
112
111
|
|
|
113
112
|
&:focus {
|
|
@@ -116,28 +115,28 @@
|
|
|
116
115
|
`;
|
|
117
116
|
const BigSearch = exports.BigSearch = (0, _styledComponents2.default)(Search)`
|
|
118
117
|
height: 32px;
|
|
119
|
-
font-size: 1.125rem;
|
|
120
118
|
border-width: 0;
|
|
121
119
|
margin-left: 50px;
|
|
122
|
-
color: ${_index.COLORS.black};
|
|
123
120
|
outline: none;
|
|
121
|
+
|
|
122
|
+
${(0, _typography.ComponentMStyling)(_index.ComponentTextStyle.Regular, _index.COLORS.black)}
|
|
123
|
+
|
|
124
124
|
::placeholder {
|
|
125
|
-
|
|
126
|
-
font-size: 16px;
|
|
125
|
+
${(0, _typography.ComponentSStyling)(_index.ComponentTextStyle.Italic, _index.COLORS.neutral_600)}
|
|
127
126
|
}
|
|
128
127
|
${_index.BREAKPOINTS.MEDIUM} {
|
|
129
128
|
::placeholder {
|
|
130
|
-
|
|
129
|
+
${(0, _typography.ComponentMStyling)(_index.ComponentTextStyle.Italic, _index.COLORS.neutral_600)}
|
|
131
130
|
}
|
|
132
131
|
}
|
|
133
132
|
&.small {
|
|
134
133
|
::placeholder {
|
|
135
|
-
|
|
134
|
+
${(0, _typography.ComponentSStyling)(_index.ComponentTextStyle.Italic, _index.COLORS.neutral_600)}
|
|
136
135
|
}
|
|
137
136
|
}
|
|
138
137
|
&.medium {
|
|
139
138
|
::placeholder {
|
|
140
|
-
|
|
139
|
+
${(0, _typography.ComponentMStyling)(_index.ComponentTextStyle.Italic, _index.COLORS.neutral_600)}
|
|
141
140
|
}
|
|
142
141
|
}
|
|
143
142
|
&:disabled {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/InputFields/components/SearchBarInput.tsx"],"names":["Search","type","
|
|
1
|
+
{"version":3,"sources":["../../../../src/InputFields/components/SearchBarInput.tsx"],"names":["Search","type","ComponentSStyling","ComponentTextStyle","COLORS","BigSearch","styled","ComponentMStyling","BREAKPOINTS","MEDIUM","id","searchTerm","setSearchTerm","enterSearch","placeholder","disabled","onKeyDown","size","setTabbedHere","onBlur","SearchBarInput","isPressingEnter","e"],"mappings":";;;;;;;;;;;;;;;;;;;;;;MAAA,K;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,QAAMA,MAAM,WAANA,MAAM,GAAG,2BAAA,KAAA,CAAA,KAAA,CAAmB,OAAO;AAAEC,IAAAA,IAAI,EAAE;AAAR,GAAP,CAAnB,CAA+C;AACrE;AACA;AACA,IAAIC,mCAAkBC,0BAAD,OAAjBD,EAA8CE,cAA7B,KAAjBF,CAA4D;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,mCAAkBC,0BAAD,MAAjBD,EAA6CE,cAA5B,WAAjBF,CAAiE;AACvE;AACA;AACA;AACA;AACA;AA7BO,CAAA;AAgCA,QAAMG,SAAS,WAATA,SAAS,GAAGC,gCAAM,MAANA,CAAe;AACxC;AACA;AACA;AACA;AACA;AACA,IAAIC,mCAAkBJ,0BAAD,OAAjBI,EAA8CH,cAA7B,KAAjBG,CAA4D;AAChE;AACA;AACA,MAAML,mCAAkBC,0BAAD,MAAjBD,EAA6CE,cAA5B,WAAjBF,CAAiE;AACvE;AACA,IAAIM,mBAAYC,MAAO;AACvB;AACA,QAAQF,mCAAkBJ,0BAAD,MAAjBI,EAA6CH,cAA5B,WAAjBG,CAAiE;AACzE;AACA;AACA;AACA;AACA,QAAQL,mCAAkBC,0BAAD,MAAjBD,EAA6CE,cAA5B,WAAjBF,CAAiE;AACzE;AACA;AACA;AACA;AACA,QAAQK,mCAAkBJ,0BAAD,MAAjBI,EAA6CH,cAA5B,WAAjBG,CAAiE;AACzE;AACA;AACA;AACA;AACA;AACA;AA7BO,CAAA;AA6CP,QAAMa,cAAc,GAAA,aAAG,KAAK,CAAL,UAAA,CAAwD,CAAA,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,IAAAA,W;AACAC,IAAAA,Q;AACAC,IAAAA,S;AACAC,IAAAA,I,6BAAO,O,EAAU,Q;AACjBC,IAAAA,a;AACAC,IAAAA,M;;oBAgCF,c","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {BREAKPOINTS, COLORS, ComponentTextStyle} from '../../styles/index';\nimport {ComponentMStyling, ComponentSStyling} from '../../styles/typography';\n\nexport const Search = styled.input.attrs(() => ({ type: 'search' }))`\n appearance: none;\n width: calc(100% - 96px);\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n\n /* To prevent browser putting its own cross inside the search bar */\n ::-ms-clear {\n display: none;\n width: 0;\n height: 0;\n }\n ::-ms-reveal {\n display: none;\n width: 0;\n height: 0;\n }\n ::-webkit-search-decoration,\n ::-webkit-search-cancel-button,\n ::-webkit-search-results-button,\n ::-webkit-search-results-decoration {\n display: none;\n }\n\n ::placeholder {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n\n &:focus {\n outline-width: 0;\n }\n`;\n\nexport const BigSearch = styled(Search)`\n height: 32px;\n border-width: 0;\n margin-left: 50px;\n outline: none;\n\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n\n ::placeholder {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}\n }\n ${BREAKPOINTS.MEDIUM} {\n ::placeholder {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}\n }\n }\n &.small {\n ::placeholder {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}\n }\n }\n &.medium {\n ::placeholder {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_600)}\n }\n }\n &:disabled {\n background: transparent;\n border: none;\n }\n`;\n\ntype SearchBarInputProps = {\n id: string;\n searchTerm?: string;\n setSearchTerm: (term: string) => void;\n enterSearch: (e: any) => void;\n placeholder?: string;\n disabled?: boolean;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n size?: 'small' | 'medium';\n setTabbedHere: (tabbedHere: boolean) => void;\n onBlur?: (e: any) => void;\n};\n\nconst SearchBarInput = React.forwardRef<HTMLInputElement, SearchBarInputProps>((props: SearchBarInputProps, ref) => {\n const { id, searchTerm, setSearchTerm, enterSearch, placeholder, disabled, onKeyDown, size, setTabbedHere, onBlur } = props;\n const isPressingEnter = (e: any) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n e.stopPropagation();\n return true;\n }\n return false;\n };\n\n return (\n <BigSearch\n placeholder={disabled ? '' : placeholder}\n id={id}\n data-testid={id}\n className={size ? size : ''}\n tabIndex={-1}\n disabled={disabled}\n onChange={(e: any) => setSearchTerm(e.target.value)}\n value={searchTerm}\n ref={ref}\n onBlur={(e) => (onBlur ? onBlur(e) : setTabbedHere(false))}\n onKeyDown={onKeyDown}\n onKeyPress={(e: any) => (isPressingEnter(e) ? enterSearch(e) : null)}\n />\n );\n});\n\nexport default SearchBarInput;\n"],"file":"SearchBarInput.js"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
if (typeof define === "function" && define.amd) {
|
|
3
|
-
define(["exports", "prop-types", "react", "styled-components", "../../styles/index", "../styling"], factory);
|
|
3
|
+
define(["exports", "prop-types", "react", "styled-components", "../../styles/index", "../styling", "../../styles/typography"], factory);
|
|
4
4
|
} else if (typeof exports !== "undefined") {
|
|
5
|
-
factory(exports, require("prop-types"), require("react"), require("styled-components"), require("../../styles/index"), require("../styling"));
|
|
5
|
+
factory(exports, require("prop-types"), require("react"), require("styled-components"), require("../../styles/index"), require("../styling"), require("../../styles/typography"));
|
|
6
6
|
} else {
|
|
7
7
|
var mod = {
|
|
8
8
|
exports: {}
|
|
9
9
|
};
|
|
10
|
-
factory(mod.exports, global.propTypes, global.react, global.styledComponents, global.index, global.styling);
|
|
10
|
+
factory(mod.exports, global.propTypes, global.react, global.styledComponents, global.index, global.styling, global.typography);
|
|
11
11
|
global.undefined = mod.exports;
|
|
12
12
|
}
|
|
13
|
-
})(this, function (exports, _propTypes, _react, _styledComponents, _index, _styling) {
|
|
13
|
+
})(this, function (exports, _propTypes, _react, _styledComponents, _index, _styling, _typography) {
|
|
14
14
|
"use strict";
|
|
15
15
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -97,35 +97,36 @@
|
|
|
97
97
|
position: relative;
|
|
98
98
|
height: 48px;
|
|
99
99
|
appearance: none;
|
|
100
|
-
|
|
100
|
+
|
|
101
|
+
${(0, _typography.ComponentSStyling)(_index.ComponentTextStyle.Regular, _index.COLORS.black)}
|
|
102
|
+
|
|
101
103
|
padding: 0 !important;
|
|
102
104
|
width: 100%;
|
|
103
105
|
::placeholder {
|
|
104
|
-
|
|
105
|
-
color: ${_index.COLORS.neutral_400};
|
|
106
|
+
${(0, _typography.ComponentSStyling)(_index.ComponentTextStyle.Italic, _index.COLORS.neutral_500)}
|
|
106
107
|
}
|
|
107
108
|
${_index.BREAKPOINTS.MEDIUM} {
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
${(0, _typography.ComponentMStyling)(_index.ComponentTextStyle.Regular, _index.COLORS.black)}
|
|
110
|
+
|
|
110
111
|
height: 56px;
|
|
111
112
|
padding: 0 4px !important;
|
|
112
113
|
&::placeholder {
|
|
113
|
-
|
|
114
|
+
${(0, _typography.ComponentMStyling)(_index.ComponentTextStyle.Italic, _index.COLORS.neutral_500)}
|
|
114
115
|
}
|
|
115
116
|
}
|
|
116
117
|
&.small {
|
|
117
|
-
|
|
118
|
+
${(0, _typography.ComponentSStyling)(_index.ComponentTextStyle.Regular, _index.COLORS.black)}
|
|
118
119
|
height: 48px;
|
|
119
120
|
padding: 0 !important;
|
|
120
121
|
&::placeholder {
|
|
121
|
-
|
|
122
|
+
${(0, _typography.ComponentSStyling)(_index.ComponentTextStyle.Italic, _index.COLORS.neutral_500)}
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
&.medium {
|
|
125
|
-
|
|
126
|
+
${(0, _typography.ComponentMStyling)(_index.ComponentTextStyle.Regular, _index.COLORS.black)}
|
|
126
127
|
height: 56px;
|
|
127
128
|
&::placeholder {
|
|
128
|
-
|
|
129
|
+
${(0, _typography.ComponentMStyling)(_index.ComponentTextStyle.Italic, _index.COLORS.neutral_500)}
|
|
129
130
|
}
|
|
130
131
|
}
|
|
131
132
|
&:hover {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/InputFields/components/SearchField.tsx"],"names":["DisabledState","css","COLORS","neutral_100","StyledSearchField","styled","div","neutral_300","
|
|
1
|
+
{"version":3,"sources":["../../../../src/InputFields/components/SearchField.tsx"],"names":["DisabledState","css","COLORS","neutral_100","StyledSearchField","styled","div","neutral_300","ComponentSStyling","ComponentTextStyle","BREAKPOINTS","MEDIUM","ComponentMStyling","primary_700","primary_800","neutral_600","props","id","searchTerm","disabled","validationMessage","children","tabbedHere","size","SearchField"],"mappings":";;;;;;;;;;;;;;;;;;;;;;MAAA,K;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,QAAMA,aAAa,GAAGC,qBAAI;AAC1B,sBAAsBC,cAAOC,WAAY;AACzC;AACA;AACA;AAJA,CAAA;AAOO,QAAMC,iBAAiB,WAAjBA,iBAAiB,GAAGC,2BAAOC,GAAqF;AAC7H;AACA;AACA;AACA,sCAAsCJ,cAAOK,WAAY;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,mCAAkBC,0BAAD,OAAjBD,EAA8CN,cAA7B,KAAjBM,CAA4D;AAChE;AACA;AACA;AACA;AACA,MAAMA,mCAAkBC,0BAAD,MAAjBD,EAA6CN,cAA5B,WAAjBM,CAAiE;AACvE;AACA,IAAIE,mBAAYC,MAAO;AACvB,MAAMC,mCAAkBH,0BAAD,OAAjBG,EAA8CV,cAA7B,KAAjBU,CAA4D;AAClE;AACA;AACA;AACA;AACA,QAAQA,mCAAkBH,0BA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VA,EAAAA,GAAAA,eAAAA,GAAD,EAAA,EAAA,MAAA,CAAkDK,IAAI,GAAA,IAAA,GAFnE,EAEa,CAFb;AAGE,MAAA,QAAQ,EAHV,QAAA;AAIE,MAAA,UAAU,EAJZ,UAAA;AAKE,MAAA,QAAQ,EAAE,CALZ,CAAA;AAME,MAAA,uBAAuB,EAAEH,iBAAiB,KAAjBA,SAAAA,IAAmCA,iBAAiB,KAAK;AANpF,KAAA,EADF,QACE,CADF;AADF,GAAA;;;AATEH,IAAAA,E;AACAC,IAAAA,U;AACAC,IAAAA,Q;AACAC,IAAAA,iB;AACAC,IAAAA,Q;AACAC,IAAAA,U;AACAC,IAAAA,I;;oBAiBF,W","sourcesContent":["import * as React from 'react';\nimport styled, {css} from 'styled-components';\nimport {BREAKPOINTS, COLORS, ComponentTextStyle} from '../../styles/index';\nimport {activeValidationMessageState, tabbedHereStyle} from '../styling';\nimport {ComponentMStyling, ComponentSStyling} from '../../styles/typography';\n\nconst DisabledState = css`\n border: 1px solid ${COLORS.neutral_100};\n pointer-events: none;\n background-color: transparent !important;\n box-shadow: none !important;\n`;\n\nexport const StyledSearchField = styled.div<{ disabled?: boolean; activeValidationMessage?: boolean; tabbedHere?: boolean }>`\n display: flex;\n flex-direction: row;\n border: solid 2px transparent;\n box-shadow: inset 0px 0px 0px 1px ${COLORS.neutral_300};\n box-sizing: border-box;\n border-radius: 56px;\n align-items: center;\n position: relative;\n height: 48px;\n appearance: none;\n\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n\n padding: 0 !important;\n width: 100%;\n ::placeholder {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n ${BREAKPOINTS.MEDIUM} {\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n\n height: 56px;\n padding: 0 4px !important;\n &::placeholder {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n }\n &.small {\n ${ComponentSStyling(ComponentTextStyle.Regular, COLORS.black)}\n height: 48px;\n padding: 0 !important;\n &::placeholder {\n ${ComponentSStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n }\n &.medium {\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.black)}\n height: 56px;\n &::placeholder {\n ${ComponentMStyling(ComponentTextStyle.Italic, COLORS.neutral_500)}\n }\n }\n &:hover {\n -webkit-box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_700};\n -moz-box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_700};\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_700};\n border-color: transparent;\n }\n &:focus-within {\n -webkit-box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_800};\n -moz-box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_800};\n box-shadow: inset 0px 0px 0px 2px ${COLORS.primary_800};\n border-color: transparent;\n }\n &:disabled {\n border: 1px solid ${COLORS.neutral_100};\n pointer-events: none;\n background-color: transparent !important;\n }\n div {\n color: ${COLORS.neutral_600};\n }\n ${(props) => (props.disabled ? DisabledState : '')}\n ${(props) => (props.activeValidationMessage ? activeValidationMessageState : '')}\n ${(props) => (props.tabbedHere ? tabbedHereStyle : '')}\n`;\n\ntype SeachFieldProps = {\n id: string;\n searchTerm?: string;\n disabled?: boolean;\n validationMessage?: string;\n children: any;\n tabbedHere: boolean;\n size: string;\n};\n\nconst SearchField: React.FunctionComponent<SeachFieldProps> = ({ id, searchTerm, disabled, validationMessage, children, tabbedHere, size }) => {\n return (\n <StyledSearchField\n id={`${id}_main`}\n className={(searchTerm !== '' ? 'searchactive ' : '').concat(size ? size : '')}\n disabled={disabled}\n tabbedHere={tabbedHere}\n tabIndex={-1}\n activeValidationMessage={validationMessage !== undefined && validationMessage !== ''}>\n {children}\n </StyledSearchField>\n );\n};\n\nexport default SearchField;\n"],"file":"SearchField.js"}
|
package/dist/umd/List/ListRow.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
if (typeof define === "function" && define.amd) {
|
|
3
|
-
define(["exports", "prop-types", "react", "styled-components", "../Button", "../icons/systemicons/SystemIcons", "../styles", "./ListRowDropdown"], factory);
|
|
3
|
+
define(["exports", "prop-types", "react", "styled-components", "../Button", "../icons/systemicons/SystemIcons", "../styles", "./ListRowDropdown", "../styles/typography"], factory);
|
|
4
4
|
} else if (typeof exports !== "undefined") {
|
|
5
|
-
factory(exports, require("prop-types"), require("react"), require("styled-components"), require("../Button"), require("../icons/systemicons/SystemIcons"), require("../styles"), require("./ListRowDropdown"));
|
|
5
|
+
factory(exports, require("prop-types"), require("react"), require("styled-components"), require("../Button"), require("../icons/systemicons/SystemIcons"), require("../styles"), require("./ListRowDropdown"), require("../styles/typography"));
|
|
6
6
|
} else {
|
|
7
7
|
var mod = {
|
|
8
8
|
exports: {}
|
|
9
9
|
};
|
|
10
|
-
factory(mod.exports, global.propTypes, global.react, global.styledComponents, global.Button, global.SystemIcons, global.styles, global.ListRowDropdown);
|
|
10
|
+
factory(mod.exports, global.propTypes, global.react, global.styledComponents, global.Button, global.SystemIcons, global.styles, global.ListRowDropdown, global.typography);
|
|
11
11
|
global.undefined = mod.exports;
|
|
12
12
|
}
|
|
13
|
-
})(this, function (exports, _propTypes, _react, _styledComponents, _Button, _SystemIcons, _styles, _ListRowDropdown) {
|
|
13
|
+
})(this, function (exports, _propTypes, _react, _styledComponents, _Button, _SystemIcons, _styles, _ListRowDropdown, _typography) {
|
|
14
14
|
"use strict";
|
|
15
15
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -108,8 +108,10 @@
|
|
|
108
108
|
const LeftSection = _styledComponents2.default.div`
|
|
109
109
|
display: flex;
|
|
110
110
|
flex-direction: row;
|
|
111
|
-
font-size: 16px;
|
|
112
111
|
align-items: center;
|
|
112
|
+
|
|
113
|
+
${(0, _typography.ComponentSStyling)(_styles.ComponentTextStyle.Regular, 'inherit')}
|
|
114
|
+
|
|
113
115
|
svg {
|
|
114
116
|
margin-right: 12px;
|
|
115
117
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/List/ListRow.tsx"],"names":["EditRow","styled","div","props","COLORS","neutral_20","neutral_100","LeftSection","MainInfo","ButtonWrapper","UserDropdownButton","white","StyledMoreVertical","primary_20","primary_100","key","Icon","mainInfo","dropdownOptions","disableDifferentBackgroundforEvenNumbers","ListRow","color","React","setDropdownActive","neutral_500","dropdownActive"],"mappings":";;;;;;;;;;;;;;;;;;;;;MAAA,K;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"sources":["../../../src/List/ListRow.tsx"],"names":["EditRow","styled","div","props","COLORS","neutral_20","neutral_100","LeftSection","ComponentSStyling","ComponentTextStyle","MainInfo","ButtonWrapper","UserDropdownButton","white","StyledMoreVertical","primary_20","primary_100","key","Icon","mainInfo","dropdownOptions","disableDifferentBackgroundforEvenNumbers","ListRow","color","React","setDropdownActive","neutral_500","dropdownActive"],"mappings":";;;;;;;;;;;;;;;;;;;;;MAAA,K;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,QAAMA,OAAO,GAAGC,2BAAOC,GAA4D;AACnF;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwBC,KAAK,IAAKA,KAAK,CAALA,wCAAAA,GAAAA,SAAAA,GAA6DC,eAAOC,UAAY;AAClH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwBD,eAAOE,WAAY;AAC3C;AAtBA,CAAA;AAyBA,QAAMC,WAAW,GAAGN,2BAAOC,GAAI;AAC/B;AACA;AACA;AACA;AACA,IAAIM,mCAAkBC,2BAAD,OAAjBD,EAAiB,SAAjBA,CAAyD;AAC7D;AACA;AACA;AACA;AATA,CAAA;AAYA,QAAME,QAAQ,GAAGT,2BAA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,EAAC;AAAzB,KAAA,EAAA,aACE,KAAA,CAAA,aAAA,CAAA,kBAAA,EAAA;AACE,MAAA,OAAO,EADT,MAAA;AAEE,MAAA,OAAO,EAAE,MAAM;AACbO,QAAAA,iBAAiB,CAAjBA,IAAiB,CAAjBA;AACD;AAJH,KAAA,EAAA,aAKE,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAK,MAAA,QAAQ,EAAE,CAAC;AAAhB,KAAA,EAAA,aACE,KAAA,CAAA,aAAA,CAAA,kBAAA,EAAA;AAAoB,MAAA,IAAI,EAAxB,MAAA;AAAgC,MAAA,KAAK,EAAErB,eAAOsB;AAA9C,KAAA,CADF,CALF,CADF,EAUGC,cAAc,IAAA,aAAI,KAAA,CAAA,aAAA,CAAA,yBAAA,EAAA;AAAiB,MAAA,aAAa,EAAE,MAAMF,iBAAiB,CAAvD,KAAuD,CAAvD;AAAgE,MAAA,OAAO,EAAEL;AAAzE,KAAA,CAVrB,CANF,CADF;AAJF,GAAA;;;AAPEH,IAAAA,G;AACAC,IAAAA,I;AACAC,IAAAA,Q;AACAC,IAAAA,e;AACAC,IAAAA,wC;;oBA8BF,O","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {Button} from '../Button';\nimport {MoreVertical} from '../icons/systemicons/SystemIcons';\nimport {COLORS, ComponentTextStyle} from '../styles';\nimport {ListRowDropdownOption} from '../types';\n\nimport ListRowDropdown from './ListRowDropdown';\nimport {ComponentSStyling} from '../styles/typography';\n\nconst EditRow = styled.div<{ disableDifferentBackgroundforEvenNumbers?: boolean }>`\n display: flex;\n justify-content: space-between;\n padding: 8px 12px;\n align-items: center;\n\n &:nth-child(even) {\n background-color: ${props => (props.disableDifferentBackgroundforEvenNumbers ? 'inherit' : COLORS.neutral_20)};\n }\n\n .user-actions {\n display: flex;\n position: relative;\n align-items: center;\n }\n\n .somePaddingForAlignment {\n padding: 0 3px 0 0;\n }\n\n &.active {\n background-color: ${COLORS.neutral_100};\n }\n`;\n\nconst LeftSection = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n\n ${ComponentSStyling(ComponentTextStyle.Regular, 'inherit')}\n\n svg {\n margin-right: 12px;\n }\n`;\n\nconst MainInfo = styled.div`\n margin: auto 1em auto 0;\n display: flex;\n flex-direction: column;\n`;\n\nconst ButtonWrapper = styled.div`\n outline: none;\n`;\n\nconst UserDropdownButton = styled(Button)`\n display: flex;\n text-decoration: none;\n outline: none;\n div {\n outline: none;\n }\n &:focus > div {\n box-shadow: 0px 0px 8px #2e7fa1, 0px 4px 12px rgba(46, 127, 161, 0.25);\n border-radius: 4px;\n outline: none;\n background: ${COLORS.white};\n }\n`;\n\nconst StyledMoreVertical = styled(MoreVertical)`\n padding: 8px 8px;\n outline: none;\n &:hover {\n background: ${COLORS.primary_20};\n border-radius: 4px;\n }\n &:active {\n background: ${COLORS.primary_100};\n border-radius: 4px;\n }\n`;\n\ntype Props = {\n key?: string;\n Icon?: any;\n mainInfo: any;\n dropdownOptions: ListRowDropdownOption[];\n disableDifferentBackgroundforEvenNumbers?: boolean;\n};\n\nconst ListRow: React.FunctionComponent<Props> = ({ key, Icon, mainInfo, dropdownOptions, disableDifferentBackgroundforEvenNumbers }: Props) => {\n const color = COLORS.black;\n const [dropdownActive, setDropdownActive] = React.useState<Boolean>(false);\n\n return (\n <EditRow key={key} disableDifferentBackgroundforEvenNumbers={disableDifferentBackgroundforEvenNumbers}>\n <LeftSection color={color} data-hj-suppress>\n {Icon && <Icon size=\"22px\" color={color} className=\"somePaddingForAlignment\" />}\n <MainInfo data-hj-suppress>{mainInfo}</MainInfo>\n </LeftSection>\n\n <ButtonWrapper className=\"user-actions\">\n <UserDropdownButton\n variant=\"text\"\n onClick={() => {\n setDropdownActive(true);\n }}>\n <div tabIndex={-1}>\n <StyledMoreVertical size=\"22px\" color={COLORS.neutral_500} />\n </div>\n </UserDropdownButton>\n {dropdownActive && <ListRowDropdown closeDropdown={() => setDropdownActive(false)} options={dropdownOptions} />}\n </ButtonWrapper>\n </EditRow>\n );\n};\n\nexport default ListRow;\n"],"file":"ListRow.js"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
if (typeof define === "function" && define.amd) {
|
|
3
|
-
define(["exports", "prop-types", "react", "styled-components", "../styles"], factory);
|
|
3
|
+
define(["exports", "prop-types", "react", "styled-components", "../styles", "../styles/typography"], factory);
|
|
4
4
|
} else if (typeof exports !== "undefined") {
|
|
5
|
-
factory(exports, require("prop-types"), require("react"), require("styled-components"), require("../styles"));
|
|
5
|
+
factory(exports, require("prop-types"), require("react"), require("styled-components"), require("../styles"), require("../styles/typography"));
|
|
6
6
|
} else {
|
|
7
7
|
var mod = {
|
|
8
8
|
exports: {}
|
|
9
9
|
};
|
|
10
|
-
factory(mod.exports, global.propTypes, global.react, global.styledComponents, global.styles);
|
|
10
|
+
factory(mod.exports, global.propTypes, global.react, global.styledComponents, global.styles, global.typography);
|
|
11
11
|
global.undefined = mod.exports;
|
|
12
12
|
}
|
|
13
|
-
})(this, function (exports, _propTypes, _react, _styledComponents, _styles) {
|
|
13
|
+
})(this, function (exports, _propTypes, _react, _styledComponents, _styles, _typography) {
|
|
14
14
|
"use strict";
|
|
15
15
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -104,11 +104,9 @@
|
|
|
104
104
|
padding: 12px 16px;
|
|
105
105
|
|
|
106
106
|
text-align: left;
|
|
107
|
-
font-style: normal;
|
|
108
|
-
font-weight: normal;
|
|
109
|
-
font-size: 16px;
|
|
110
107
|
height: 48px;
|
|
111
|
-
|
|
108
|
+
|
|
109
|
+
${(0, _typography.ComponentMStyling)(_styles.ComponentTextStyle.Regular, _styles.COLORS.neutral_600)}
|
|
112
110
|
|
|
113
111
|
background-color: ${_styles.COLORS.white};
|
|
114
112
|
border-width: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/List/ListRowDropdown.tsx"],"names":["Wrapper","styled","div","DropdownMenuContainer","COLORS","white","Content","button","
|
|
1
|
+
{"version":3,"sources":["../../../src/List/ListRowDropdown.tsx"],"names":["Wrapper","styled","div","DropdownMenuContainer","COLORS","white","Content","button","ComponentMStyling","ComponentTextStyle","primary_20","primary_100","options","closeDropdown","ListRowDropdown","React","reference","clickIsOutside","e","handleClick","isInViewport","offset","top","inside","window","setClassname","document","classname","option","action"],"mappings":";;;;;;;;;;;;;;;;;;;;;MAAA,K;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,QAAMA,OAAO,GAAGC,2BAAOC,GAAI;AAC3B;AACA;AACA;AACA;AACA;AACA;AANA,CAAA;AASA,QAAMC,qBAAqB,GAAGF,2BAAOC,GAAI;AACzC;AACA;AACA,gBAAgBE,eAAOC,KAAM;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,CAAA;AAaA,QAAMC,OAAO,GAAGL,2BAAOM,MAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,mCAAkBC,2BAAD,OAAjBD,EAA8CJ,eAA7B,WAAjBI,CAAkE;AACtE;AACA,sBAAsBJ,eAAOC,KAAM;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkBD,eAAOM,UAAW;AACpC;AACA;AACA;AACA,kBAAkBN,eAAOO,WAAY;AACrC;AACA;AAxBA,CAAA;;AAgCA,QAAMG,eAA2D,GAAG,CAAC;AAAA,IAAA,OAAA;AAAWD,IAAAA;AAAX,GAAD,KAAmD;AACrH,UAAM,CAAA,SAAA,EAAA,YAAA,IAA4BE,KAAK,CAALA,QAAAA,CAAlC,UAAkCA,CAAlC;AACA,UAAMC,SAAS,GAAGD,KAAK,CAALA,MAAAA,CAAlB,IAAkBA,CAAlB;;AAEA,UAAME,cAAc,GAAIC,CAAD,IAAYF,SAAS,IAAIA,SAAS,EAAtBA,OAAAA,IAAmC,CAACA,SAAS,EAATA,OAAAA,CAAAA,QAA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AAAuB,MAAA,GAAG,EAA1B,SAAA;AAAuC,MAAA,SAAS,EAAEY;AAAlD,KAAA,EACGf,OAAO,CAAPA,GAAAA,CAAYgB,MAAM,IAAA,aACjB,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA;AAAS,MAAA,GAAG,EAAEA,MAAM,CAApB,GAAA;AAA0B,MAAA,OAAO,EAAEA,MAAM,CAACC;AAA1C,KAAA,EACGD,MAAM,CALjB,KAIQ,CADDhB,CADH,CADF,CADF;AApCF,GAAA;;;AAJEA,IAAAA,O;AACAC,IAAAA,a;;oBAoDF,e","sourcesContent":["import * as React from 'react';\nimport styled from 'styled-components';\nimport {COLORS, ComponentTextStyle} from '../styles';\nimport {ListRowDropdownOption} from '../types';\nimport {ComponentMStyling} from '../styles/typography';\n\nconst Wrapper = styled.div`\n .isInside {\n top: 42px;\n }\n .isOutside {\n bottom: 42px;\n }\n`;\n\nconst DropdownMenuContainer = styled.div`\n position: absolute;\n flex-direction: column;\n background: ${COLORS.white};\n font-size: 1em;\n z-index: 1;\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);\n border-radius: 4px;\n right: 0;\n width: max-content;\n min-width: 260px;\n`;\n\nconst Content = styled.button`\n min-width: 100%;\n padding: 12px 16px;\n\n text-align: left;\n height: 48px;\n\n ${ComponentMStyling(ComponentTextStyle.Regular, COLORS.neutral_600)}\n\n background-color: ${COLORS.white};\n border-width: 0;\n\n &:hover,\n &:focus {\n cursor: pointer;\n }\n\n &:hover {\n background: ${COLORS.primary_20};\n border-radius: 4px;\n }\n &:active {\n background: ${COLORS.primary_100};\n border-radius: 4px;\n }\n`;\n\ntype DropdownMenuProps = {\n options: ListRowDropdownOption[];\n closeDropdown: any;\n};\n\nconst ListRowDropdown: React.FunctionComponent<DropdownMenuProps> = ({ options, closeDropdown }: DropdownMenuProps) => {\n const [classname, setClassname] = React.useState('isInside');\n const reference = React.useRef<HTMLDivElement>(null);\n\n const clickIsOutside = (e: any) => reference && reference?.current && !reference?.current.contains(e.target);\n\n const handleClick = (e: any) => {\n if (e.keyCode) {\n if (e.keyCode === 27) {\n closeDropdown();\n }\n } else if (clickIsOutside(e)) {\n closeDropdown();\n }\n };\n\n const isInViewport = (offset = 0) => {\n if (!reference.current) return;\n const top = reference.current.getBoundingClientRect().bottom;\n const inside = top + offset >= 0 && top - offset <= window.innerHeight;\n if (!inside) {\n setClassname('isOutside');\n }\n };\n\n React.useEffect(() => {\n document.addEventListener('mousedown', handleClick, false);\n document.addEventListener('keydown', handleClick, false);\n isInViewport();\n return () => {\n document.removeEventListener('mousedown', handleClick, false);\n document.removeEventListener('keydown', handleClick, false);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return (\n <Wrapper>\n <DropdownMenuContainer ref={reference} className={classname}>\n {options.map(option => (\n <Content key={option.key} onClick={option.action}>\n {option.label}\n </Content>\n ))}\n </DropdownMenuContainer>\n </Wrapper>\n );\n};\n\nexport default ListRowDropdown;\n"],"file":"ListRowDropdown.js"}
|