@salutejs/plasma-new-hope 0.94.0-canary.1274.9714678450.0 → 0.94.1-canary.1273.9715265388.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Calendar/Calendar.tokens.js +67 -28
- package/cjs/components/Calendar/Calendar.tokens.js.map +1 -1
- package/cjs/components/Calendar/Calendar.types.js.map +1 -1
- package/cjs/components/Calendar/CalendarBase/CalendarBase.css +57 -29
- package/cjs/components/Calendar/CalendarBase/CalendarBase.js +6 -0
- package/cjs/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
- package/cjs/components/Calendar/CalendarBase/CalendarBase.styles.js +1 -1
- package/cjs/components/Calendar/CalendarBase/CalendarBase.styles.js.map +1 -1
- package/cjs/components/Calendar/CalendarBase/{CalendarBase.styles_rv9ax9.css → CalendarBase.styles_1m6uih1.css} +1 -1
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.css +58 -30
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +6 -0
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.styles.js +1 -1
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.styles.js.map +1 -1
- package/{es/components/Calendar/CalendarDouble/CalendarDouble.styles_1rc2ejs.css → cjs/components/Calendar/CalendarDouble/CalendarDouble.styles_e9ada0.css} +2 -2
- package/cjs/components/Calendar/hoc/withRange.js.map +1 -1
- package/cjs/components/Calendar/hooks/useDays.js +1 -1
- package/cjs/components/Calendar/hooks/useDays.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarDayItem/CalendarDayItem.css +4 -4
- package/cjs/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles.js +9 -9
- package/cjs/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles_107vqka.css +4 -0
- package/cjs/components/Calendar/ui/CalendarDays/CalendarDays.css +7 -7
- package/cjs/components/Calendar/ui/CalendarDays/CalendarDays.styles.js +1 -1
- package/cjs/components/Calendar/ui/CalendarDays/CalendarDays.styles.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarDays/{CalendarDays.styles_bnrjbd.css → CalendarDays.styles_1oq8sud.css} +1 -1
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.css +36 -8
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +31 -17
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js +27 -12
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.styles_gnorek.css +8 -0
- package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.css +4 -4
- package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js +1 -1
- package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.styles.js +1 -1
- package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.styles.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.styles_7jeg2n.css +4 -0
- package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.css +4 -4
- package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js +1 -1
- package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.styles.js +1 -1
- package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.styles.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.styles_4z2ki7.css +4 -0
- package/cjs/components/Calendar/utils/index.js.map +1 -1
- package/cjs/components/Combobox/Combobox.js +2 -2
- package/cjs/components/Combobox/Combobox.js.map +1 -1
- package/cjs/components/DatePicker/DatePicker.tokens.js +189 -0
- package/cjs/components/DatePicker/DatePicker.tokens.js.map +1 -0
- package/cjs/components/DatePicker/DatePickerBase.styles.js +30 -0
- package/cjs/components/DatePicker/DatePickerBase.styles.js.map +1 -0
- package/cjs/components/DatePicker/DatePickerBase.styles_1thp2xv.css +1 -0
- package/cjs/components/DatePicker/RangeDate/RangeDate.css +152 -0
- package/cjs/components/DatePicker/RangeDate/RangeDate.js +285 -0
- package/cjs/components/DatePicker/RangeDate/RangeDate.js.map +1 -0
- package/cjs/components/DatePicker/RangeDate/RangeDate.styles.js +51 -0
- package/cjs/components/DatePicker/RangeDate/RangeDate.styles.js.map +1 -0
- package/cjs/components/DatePicker/RangeDate/RangeDate.styles_ww61h9.css +5 -0
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +144 -0
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js +83 -0
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js.map +1 -0
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js +42 -0
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js.map +1 -0
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles_wp3vfj.css +2 -0
- package/cjs/components/DatePicker/RangeDate/variations/_disabled/base.js +9 -0
- package/cjs/components/DatePicker/RangeDate/variations/_disabled/base.js.map +1 -0
- package/cjs/components/DatePicker/RangeDate/variations/_disabled/base_tl4jc7.css +1 -0
- package/cjs/components/DatePicker/RangeDate/variations/_readonly/base.js +9 -0
- package/cjs/components/DatePicker/RangeDate/variations/_readonly/base.js.map +1 -0
- package/cjs/components/DatePicker/RangeDate/variations/_readonly/base_f58pkk.css +1 -0
- package/cjs/components/DatePicker/RangeDate/variations/_size/base.js +9 -0
- package/cjs/components/DatePicker/RangeDate/variations/_size/base.js.map +1 -0
- package/cjs/components/DatePicker/RangeDate/variations/_size/base_1911nyw.css +1 -0
- package/cjs/components/DatePicker/RangeDate/variations/_view/base.js +9 -0
- package/cjs/components/DatePicker/RangeDate/variations/_view/base.js.map +1 -0
- package/cjs/components/DatePicker/RangeDate/variations/_view/base_11yn9y8.css +1 -0
- package/cjs/components/DatePicker/SingleDate/SingleDate.css +134 -0
- package/cjs/components/DatePicker/SingleDate/SingleDate.js +183 -0
- package/cjs/components/DatePicker/SingleDate/SingleDate.js.map +1 -0
- package/cjs/components/DatePicker/SingleDate/SingleDate.styles.js +51 -0
- package/cjs/components/DatePicker/SingleDate/SingleDate.styles.js.map +1 -0
- package/cjs/components/DatePicker/SingleDate/SingleDate.styles_18b5qkz.css +5 -0
- package/cjs/components/DatePicker/SingleDate/variations/_disabled/base.js +9 -0
- package/cjs/components/DatePicker/SingleDate/variations/_disabled/base.js.map +1 -0
- package/cjs/components/DatePicker/SingleDate/variations/_disabled/base_1rfgfsz.css +1 -0
- package/cjs/components/DatePicker/SingleDate/variations/_readonly/base.js +9 -0
- package/cjs/components/DatePicker/SingleDate/variations/_readonly/base.js.map +1 -0
- package/cjs/components/DatePicker/SingleDate/variations/_readonly/base_1jucwp.css +1 -0
- package/cjs/components/DatePicker/SingleDate/variations/_size/base.js +9 -0
- package/cjs/components/DatePicker/SingleDate/variations/_size/base.js.map +1 -0
- package/cjs/components/DatePicker/SingleDate/variations/_size/base_lf7y25.css +1 -0
- package/cjs/components/DatePicker/SingleDate/variations/_view/base.js +9 -0
- package/cjs/components/DatePicker/SingleDate/variations/_view/base.js.map +1 -0
- package/cjs/components/DatePicker/SingleDate/variations/_view/base_15vaheb.css +1 -0
- package/cjs/components/DatePicker/hooks/useDatePicker.js +79 -0
- package/cjs/components/DatePicker/hooks/useDatePicker.js.map +1 -0
- package/cjs/components/DatePicker/utils/dateHelper.js +84 -0
- package/cjs/components/DatePicker/utils/dateHelper.js.map +1 -0
- package/cjs/components/Dropdown/Dropdown.js +4 -2
- package/cjs/components/Dropdown/Dropdown.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +8 -4
- package/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +6 -5
- package/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/cjs/components/Dropdown/utils/index.js +0 -17
- package/cjs/components/Dropdown/utils/index.js.map +1 -1
- package/cjs/components/Range/Range.css +6 -6
- package/cjs/components/Range/Range.js +17 -2
- package/cjs/components/Range/Range.js.map +1 -1
- package/cjs/components/Range/Range.styles.js +1 -1
- package/cjs/components/Range/Range.styles.js.map +1 -1
- package/cjs/components/Range/Range.styles_9rort8.css +8 -0
- package/cjs/components/Select/Select.js +2 -2
- package/cjs/components/Select/Select.js.map +1 -1
- package/cjs/components/Sheet/Sheet.js.map +1 -1
- package/cjs/components/Slider/Slider.css +3 -3
- package/cjs/components/Slider/components/Double/Double.css +3 -3
- package/cjs/components/TextField/TextField.tokens.js +1 -1
- package/cjs/components/TextField/TextField.tokens.js.map +1 -1
- package/cjs/components/TextField/variations/_read-only/base.js +1 -1
- package/cjs/components/TextField/variations/_read-only/base_1vu13zn.css +1 -0
- package/cjs/components/TextField/variations/_size/base.js +1 -1
- package/cjs/components/TextField/variations/_size/base.js.map +1 -1
- package/cjs/components/TextField/variations/_size/base_orwx1f.css +1 -0
- package/cjs/components/TextField/variations/_view/base.js +1 -1
- package/cjs/components/TextField/variations/_view/base_18ea6z7.css +1 -0
- package/cjs/components/_Icon/Icon.assets/DisclosureDownFill.js +23 -0
- package/cjs/components/_Icon/Icon.assets/DisclosureDownFill.js.map +1 -0
- package/cjs/components/_Icon/Icon.assets/DisclosureLeft.js +1 -1
- package/cjs/components/_Icon/Icon.assets/DisclosureLeft.js.map +1 -1
- package/cjs/components/_Icon/Icon.assets/DisclosureRight.js +5 -15
- package/cjs/components/_Icon/Icon.assets/DisclosureRight.js.map +1 -1
- package/cjs/components/_Icon/Icons/IconDisclosureDownFill.js +23 -0
- package/cjs/components/_Icon/Icons/IconDisclosureDownFill.js.map +1 -0
- package/cjs/index.css +71 -38
- package/cjs/index.js +12 -0
- package/cjs/index.js.map +1 -1
- package/cjs/utils/datejs.js +12 -0
- package/cjs/utils/datejs.js.map +1 -0
- package/cjs/utils/getPopoverPlacement.js +23 -0
- package/cjs/utils/getPopoverPlacement.js.map +1 -0
- package/cjs/utils/index.js.map +1 -1
- package/es/components/Calendar/Calendar.tokens.js +67 -28
- package/es/components/Calendar/Calendar.tokens.js.map +1 -1
- package/es/components/Calendar/Calendar.types.js.map +1 -1
- package/es/components/Calendar/CalendarBase/CalendarBase.css +57 -29
- package/es/components/Calendar/CalendarBase/CalendarBase.js +7 -1
- package/es/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
- package/es/components/Calendar/CalendarBase/CalendarBase.styles.js +1 -1
- package/es/components/Calendar/CalendarBase/CalendarBase.styles.js.map +1 -1
- package/es/components/Calendar/CalendarBase/{CalendarBase.styles_rv9ax9.css → CalendarBase.styles_1m6uih1.css} +1 -1
- package/es/components/Calendar/CalendarDouble/CalendarDouble.css +58 -30
- package/es/components/Calendar/CalendarDouble/CalendarDouble.js +7 -1
- package/es/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
- package/es/components/Calendar/CalendarDouble/CalendarDouble.styles.js +1 -1
- package/es/components/Calendar/CalendarDouble/CalendarDouble.styles.js.map +1 -1
- package/{cjs/components/Calendar/CalendarDouble/CalendarDouble.styles_1rc2ejs.css → es/components/Calendar/CalendarDouble/CalendarDouble.styles_e9ada0.css} +2 -2
- package/es/components/Calendar/hoc/withRange.js.map +1 -1
- package/es/components/Calendar/hooks/useDays.js +1 -1
- package/es/components/Calendar/hooks/useDays.js.map +1 -1
- package/es/components/Calendar/ui/CalendarDayItem/CalendarDayItem.css +4 -4
- package/es/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles.js +9 -9
- package/es/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles.js.map +1 -1
- package/es/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles_107vqka.css +4 -0
- package/es/components/Calendar/ui/CalendarDays/CalendarDays.css +7 -7
- package/es/components/Calendar/ui/CalendarDays/CalendarDays.styles.js +1 -1
- package/es/components/Calendar/ui/CalendarDays/CalendarDays.styles.js.map +1 -1
- package/es/components/Calendar/ui/CalendarDays/{CalendarDays.styles_bnrjbd.css → CalendarDays.styles_1oq8sud.css} +1 -1
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.css +36 -8
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +32 -18
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js.map +1 -1
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js +26 -13
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js.map +1 -1
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.styles_gnorek.css +8 -0
- package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.css +4 -4
- package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +1 -1
- package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js.map +1 -1
- package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.styles.js +1 -1
- package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.styles.js.map +1 -1
- package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.styles_7jeg2n.css +4 -0
- package/es/components/Calendar/ui/CalendarYears/CalendarYears.css +4 -4
- package/es/components/Calendar/ui/CalendarYears/CalendarYears.js +1 -1
- package/es/components/Calendar/ui/CalendarYears/CalendarYears.js.map +1 -1
- package/es/components/Calendar/ui/CalendarYears/CalendarYears.styles.js +1 -1
- package/es/components/Calendar/ui/CalendarYears/CalendarYears.styles.js.map +1 -1
- package/es/components/Calendar/ui/CalendarYears/CalendarYears.styles_4z2ki7.css +4 -0
- package/es/components/Calendar/utils/index.js.map +1 -1
- package/es/components/Combobox/Combobox.js +1 -1
- package/es/components/Combobox/Combobox.js.map +1 -1
- package/es/components/DatePicker/DatePicker.tokens.js +184 -0
- package/es/components/DatePicker/DatePicker.tokens.js.map +1 -0
- package/es/components/DatePicker/DatePickerBase.styles.js +26 -0
- package/es/components/DatePicker/DatePickerBase.styles.js.map +1 -0
- package/es/components/DatePicker/DatePickerBase.styles_1thp2xv.css +1 -0
- package/es/components/DatePicker/RangeDate/RangeDate.css +152 -0
- package/es/components/DatePicker/RangeDate/RangeDate.js +280 -0
- package/es/components/DatePicker/RangeDate/RangeDate.js.map +1 -0
- package/es/components/DatePicker/RangeDate/RangeDate.styles.js +43 -0
- package/es/components/DatePicker/RangeDate/RangeDate.styles.js.map +1 -0
- package/es/components/DatePicker/RangeDate/RangeDate.styles_ww61h9.css +5 -0
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +144 -0
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js +79 -0
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js.map +1 -0
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js +37 -0
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js.map +1 -0
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles_wp3vfj.css +2 -0
- package/es/components/DatePicker/RangeDate/variations/_disabled/base.js +5 -0
- package/es/components/DatePicker/RangeDate/variations/_disabled/base.js.map +1 -0
- package/es/components/DatePicker/RangeDate/variations/_disabled/base_tl4jc7.css +1 -0
- package/es/components/DatePicker/RangeDate/variations/_readonly/base.js +5 -0
- package/es/components/DatePicker/RangeDate/variations/_readonly/base.js.map +1 -0
- package/es/components/DatePicker/RangeDate/variations/_readonly/base_f58pkk.css +1 -0
- package/es/components/DatePicker/RangeDate/variations/_size/base.js +5 -0
- package/es/components/DatePicker/RangeDate/variations/_size/base.js.map +1 -0
- package/es/components/DatePicker/RangeDate/variations/_size/base_1911nyw.css +1 -0
- package/es/components/DatePicker/RangeDate/variations/_view/base.js +5 -0
- package/es/components/DatePicker/RangeDate/variations/_view/base.js.map +1 -0
- package/es/components/DatePicker/RangeDate/variations/_view/base_11yn9y8.css +1 -0
- package/es/components/DatePicker/SingleDate/SingleDate.css +134 -0
- package/es/components/DatePicker/SingleDate/SingleDate.js +178 -0
- package/es/components/DatePicker/SingleDate/SingleDate.js.map +1 -0
- package/es/components/DatePicker/SingleDate/SingleDate.styles.js +43 -0
- package/es/components/DatePicker/SingleDate/SingleDate.styles.js.map +1 -0
- package/es/components/DatePicker/SingleDate/SingleDate.styles_18b5qkz.css +5 -0
- package/es/components/DatePicker/SingleDate/variations/_disabled/base.js +5 -0
- package/es/components/DatePicker/SingleDate/variations/_disabled/base.js.map +1 -0
- package/es/components/DatePicker/SingleDate/variations/_disabled/base_1rfgfsz.css +1 -0
- package/es/components/DatePicker/SingleDate/variations/_readonly/base.js +5 -0
- package/es/components/DatePicker/SingleDate/variations/_readonly/base.js.map +1 -0
- package/es/components/DatePicker/SingleDate/variations/_readonly/base_1jucwp.css +1 -0
- package/es/components/DatePicker/SingleDate/variations/_size/base.js +5 -0
- package/es/components/DatePicker/SingleDate/variations/_size/base.js.map +1 -0
- package/es/components/DatePicker/SingleDate/variations/_size/base_lf7y25.css +1 -0
- package/es/components/DatePicker/SingleDate/variations/_view/base.js +5 -0
- package/es/components/DatePicker/SingleDate/variations/_view/base.js.map +1 -0
- package/es/components/DatePicker/SingleDate/variations/_view/base_15vaheb.css +1 -0
- package/es/components/DatePicker/hooks/useDatePicker.js +75 -0
- package/es/components/DatePicker/hooks/useDatePicker.js.map +1 -0
- package/es/components/DatePicker/utils/dateHelper.js +76 -0
- package/es/components/DatePicker/utils/dateHelper.js.map +1 -0
- package/es/components/Dropdown/Dropdown.js +4 -2
- package/es/components/Dropdown/Dropdown.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +8 -4
- package/es/components/Dropdown/ui/DropdownInner/DropdownInner.js.map +1 -1
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +6 -5
- package/es/components/Dropdown/ui/DropdownItem/DropdownItem.js.map +1 -1
- package/es/components/Dropdown/utils/index.js +1 -16
- package/es/components/Dropdown/utils/index.js.map +1 -1
- package/es/components/Range/Range.css +6 -6
- package/es/components/Range/Range.js +18 -3
- package/es/components/Range/Range.js.map +1 -1
- package/es/components/Range/Range.styles.js +1 -1
- package/es/components/Range/Range.styles.js.map +1 -1
- package/es/components/Range/Range.styles_9rort8.css +8 -0
- package/es/components/Select/Select.js +1 -1
- package/es/components/Select/Select.js.map +1 -1
- package/es/components/Sheet/Sheet.js +4 -4
- package/es/components/Sheet/Sheet.js.map +1 -1
- package/es/components/Slider/Slider.css +3 -3
- package/es/components/Slider/components/Double/Double.css +3 -3
- package/es/components/TextField/TextField.tokens.js +1 -1
- package/es/components/TextField/TextField.tokens.js.map +1 -1
- package/es/components/TextField/variations/_read-only/base.js +1 -1
- package/es/components/TextField/variations/_read-only/base_1vu13zn.css +1 -0
- package/es/components/TextField/variations/_size/base.js +1 -1
- package/es/components/TextField/variations/_size/base.js.map +1 -1
- package/es/components/TextField/variations/_size/base_orwx1f.css +1 -0
- package/es/components/TextField/variations/_view/base.js +1 -1
- package/es/components/TextField/variations/_view/base_18ea6z7.css +1 -0
- package/es/components/_Icon/Icon.assets/DisclosureDownFill.js +19 -0
- package/es/components/_Icon/Icon.assets/DisclosureDownFill.js.map +1 -0
- package/es/components/_Icon/Icon.assets/DisclosureLeft.js +1 -1
- package/es/components/_Icon/Icon.assets/DisclosureLeft.js.map +1 -1
- package/es/components/_Icon/Icon.assets/DisclosureRight.js +5 -15
- package/es/components/_Icon/Icon.assets/DisclosureRight.js.map +1 -1
- package/es/components/_Icon/Icons/IconDisclosureDownFill.js +19 -0
- package/es/components/_Icon/Icons/IconDisclosureDownFill.js.map +1 -0
- package/es/index.css +71 -38
- package/es/index.js +4 -0
- package/es/index.js.map +1 -1
- package/es/utils/datejs.js +8 -0
- package/es/utils/datejs.js.map +1 -0
- package/es/utils/getPopoverPlacement.js +18 -0
- package/es/utils/getPopoverPlacement.js.map +1 -0
- package/es/utils/index.js.map +1 -1
- package/package.json +5 -4
- package/styled-components/cjs/components/Calendar/Calendar.tokens.js +67 -28
- package/styled-components/cjs/components/Calendar/CalendarBase/CalendarBase.js +6 -0
- package/styled-components/cjs/components/Calendar/CalendarBase/CalendarBase.styles.js +2 -1
- package/styled-components/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +6 -0
- package/styled-components/cjs/components/Calendar/CalendarDouble/CalendarDouble.styles.js +2 -2
- package/styled-components/cjs/components/Calendar/hooks/useDays.js +1 -1
- package/styled-components/cjs/components/Calendar/mixins/active.js +12 -0
- package/styled-components/cjs/components/Calendar/mixins/flex.js +8 -0
- package/styled-components/cjs/components/Calendar/mixins/index.js +30 -29
- package/styled-components/cjs/components/Calendar/mixins/selected.js +24 -0
- package/styled-components/cjs/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles.js +27 -20
- package/styled-components/cjs/components/Calendar/ui/CalendarDays/CalendarDays.styles.js +2 -1
- package/styled-components/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.js +30 -16
- package/styled-components/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js +29 -11
- package/styled-components/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js +1 -1
- package/styled-components/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.styles.js +26 -12
- package/styled-components/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js +1 -1
- package/styled-components/cjs/components/Calendar/ui/CalendarYears/CalendarYears.styles.js +26 -14
- package/styled-components/cjs/components/Combobox/Combobox.js +6 -7
- package/styled-components/cjs/components/DatePicker/DatePicker.template-doc.mdx +150 -0
- package/styled-components/cjs/components/DatePicker/DatePicker.tokens.js +187 -0
- package/styled-components/cjs/components/DatePicker/DatePickerBase.styles.js +19 -0
- package/styled-components/cjs/components/DatePicker/DatePickerBase.types.js +5 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/RangeDate.js +293 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/RangeDate.styles.js +33 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/RangeDate.types.js +5 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js +81 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js +26 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.types.js +5 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/variations/_disabled/base.js +9 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/variations/_disabled/tokens.json +0 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/variations/_readonly/base.js +10 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/variations/_readonly/tokens.json +4 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/variations/_size/base.js +10 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/variations/_size/tokens.json +0 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/variations/_view/base.js +10 -0
- package/styled-components/cjs/components/DatePicker/RangeDate/variations/_view/tokens.json +0 -0
- package/styled-components/cjs/components/DatePicker/SingleDate/SingleDate.js +190 -0
- package/styled-components/cjs/components/DatePicker/SingleDate/SingleDate.styles.js +33 -0
- package/styled-components/cjs/components/DatePicker/SingleDate/SingleDate.types.js +5 -0
- package/styled-components/cjs/components/DatePicker/SingleDate/variations/_disabled/base.js +9 -0
- package/styled-components/cjs/components/DatePicker/SingleDate/variations/_disabled/tokens.json +4 -0
- package/styled-components/cjs/components/DatePicker/SingleDate/variations/_readonly/base.js +10 -0
- package/styled-components/cjs/components/DatePicker/SingleDate/variations/_readonly/tokens.json +4 -0
- package/styled-components/cjs/components/DatePicker/SingleDate/variations/_size/base.js +10 -0
- package/styled-components/cjs/components/DatePicker/SingleDate/variations/_size/tokens.json +16 -0
- package/styled-components/cjs/components/DatePicker/SingleDate/variations/_view/base.js +10 -0
- package/styled-components/cjs/components/DatePicker/SingleDate/variations/_view/tokens.json +1 -0
- package/styled-components/cjs/components/DatePicker/hooks/useDatePicker.js +77 -0
- package/styled-components/cjs/components/DatePicker/index.js +44 -0
- package/styled-components/cjs/components/DatePicker/utils/dateHelper.js +78 -0
- package/styled-components/cjs/components/Dropdown/Dropdown.js +3 -2
- package/styled-components/cjs/components/Dropdown/ui/DropdownInner/DropdownInner.js +8 -4
- package/styled-components/cjs/components/Dropdown/ui/DropdownItem/DropdownItem.js +6 -5
- package/styled-components/cjs/components/Dropdown/utils/index.js +1 -16
- package/styled-components/cjs/components/Range/Range.js +17 -2
- package/styled-components/cjs/components/Range/Range.styles.js +3 -2
- package/styled-components/cjs/components/Select/Select.js +7 -8
- package/styled-components/cjs/components/Sheet/Sheet.js +3 -3
- package/styled-components/cjs/components/TextField/TextField.tokens.js +1 -1
- package/styled-components/cjs/components/TextField/variations/_size/base.js +1 -1
- package/styled-components/cjs/components/_Icon/Icon.assets/DisclosureDownFill.js +22 -0
- package/styled-components/cjs/components/_Icon/Icon.assets/DisclosureLeft.js +1 -1
- package/styled-components/cjs/components/_Icon/Icon.assets/DisclosureRight.js +5 -15
- package/styled-components/cjs/components/_Icon/Icons/IconDisclosureDownFill.js +22 -0
- package/styled-components/cjs/components/_Icon/index.js +7 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Calendar/Calendar.stories.tsx +24 -6
- package/styled-components/cjs/examples/plasma_b2c/components/Calendar/CalendarBase.config.js +5 -2
- package/styled-components/cjs/examples/plasma_b2c/components/Calendar/CalendarDouble.config.js +5 -2
- package/styled-components/cjs/examples/plasma_b2c/components/DatePicker/DatePicker.config.js +31 -0
- package/styled-components/cjs/examples/plasma_b2c/components/DatePicker/DatePicker.js +13 -0
- package/styled-components/cjs/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +257 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Range/Range.config.js +4 -4
- package/styled-components/cjs/examples/plasma_b2c/components/Sheet/Sheet.stories.tsx +2 -2
- package/styled-components/cjs/examples/plasma_web/components/Calendar/Calendar.stories.tsx +24 -6
- package/styled-components/cjs/examples/plasma_web/components/Calendar/CalendarBase.config.js +5 -2
- package/styled-components/cjs/examples/plasma_web/components/Calendar/CalendarDouble.config.js +5 -2
- package/styled-components/cjs/examples/plasma_web/components/DatePicker/DatePicker.config.js +31 -0
- package/styled-components/cjs/examples/plasma_web/components/DatePicker/DatePicker.js +13 -0
- package/styled-components/cjs/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +257 -0
- package/styled-components/cjs/examples/plasma_web/components/Range/Range.config.js +4 -4
- package/styled-components/cjs/examples/plasma_web/components/Sheet/Sheet.stories.tsx +2 -2
- package/styled-components/cjs/examples/sds_engineer/components/Calendar/Calendar.stories.tsx +24 -6
- package/styled-components/cjs/examples/sds_engineer/components/Calendar/CalendarBase.config.js +5 -2
- package/styled-components/cjs/examples/sds_engineer/components/Calendar/CalendarDouble.config.js +5 -2
- package/styled-components/cjs/index.js +11 -0
- package/styled-components/cjs/utils/datejs.js +11 -0
- package/styled-components/cjs/utils/getPopoverPlacement.js +21 -0
- package/styled-components/cjs/utils/index.js +22 -0
- package/styled-components/es/components/Calendar/Calendar.tokens.js +67 -28
- package/styled-components/es/components/Calendar/CalendarBase/CalendarBase.js +7 -1
- package/styled-components/es/components/Calendar/CalendarBase/CalendarBase.styles.js +2 -1
- package/styled-components/es/components/Calendar/CalendarDouble/CalendarDouble.js +7 -1
- package/styled-components/es/components/Calendar/CalendarDouble/CalendarDouble.styles.js +2 -2
- package/styled-components/es/components/Calendar/hooks/useDays.js +1 -1
- package/styled-components/es/components/Calendar/mixins/active.js +6 -0
- package/styled-components/es/components/Calendar/mixins/flex.js +2 -0
- package/styled-components/es/components/Calendar/mixins/index.js +3 -27
- package/styled-components/es/components/Calendar/mixins/selected.js +18 -0
- package/styled-components/es/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles.js +26 -19
- package/styled-components/es/components/Calendar/ui/CalendarDays/CalendarDays.styles.js +2 -1
- package/styled-components/es/components/Calendar/ui/CalendarHeader/CalendarHeader.js +32 -18
- package/styled-components/es/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.js +29 -11
- package/styled-components/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +1 -1
- package/styled-components/es/components/Calendar/ui/CalendarMonths/CalendarMonths.styles.js +25 -11
- package/styled-components/es/components/Calendar/ui/CalendarYears/CalendarYears.js +1 -1
- package/styled-components/es/components/Calendar/ui/CalendarYears/CalendarYears.styles.js +25 -13
- package/styled-components/es/components/Combobox/Combobox.js +1 -2
- package/styled-components/es/components/DatePicker/DatePicker.template-doc.mdx +150 -0
- package/styled-components/es/components/DatePicker/DatePicker.tokens.js +181 -0
- package/styled-components/es/components/DatePicker/DatePickerBase.styles.js +12 -0
- package/styled-components/es/components/DatePicker/DatePickerBase.types.js +1 -0
- package/styled-components/es/components/DatePicker/RangeDate/RangeDate.js +284 -0
- package/styled-components/es/components/DatePicker/RangeDate/RangeDate.styles.js +25 -0
- package/styled-components/es/components/DatePicker/RangeDate/RangeDate.types.js +1 -0
- package/styled-components/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js +74 -0
- package/styled-components/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.js +19 -0
- package/styled-components/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.types.js +1 -0
- package/styled-components/es/components/DatePicker/RangeDate/variations/_disabled/base.js +3 -0
- package/styled-components/es/components/DatePicker/RangeDate/variations/_disabled/tokens.json +0 -0
- package/styled-components/es/components/DatePicker/RangeDate/variations/_readonly/base.js +4 -0
- package/styled-components/es/components/DatePicker/RangeDate/variations/_readonly/tokens.json +4 -0
- package/styled-components/es/components/DatePicker/RangeDate/variations/_size/base.js +4 -0
- package/styled-components/es/components/DatePicker/RangeDate/variations/_size/tokens.json +0 -0
- package/styled-components/es/components/DatePicker/RangeDate/variations/_view/base.js +4 -0
- package/styled-components/es/components/DatePicker/RangeDate/variations/_view/tokens.json +0 -0
- package/styled-components/es/components/DatePicker/SingleDate/SingleDate.js +181 -0
- package/styled-components/es/components/DatePicker/SingleDate/SingleDate.styles.js +25 -0
- package/styled-components/es/components/DatePicker/SingleDate/SingleDate.types.js +1 -0
- package/styled-components/es/components/DatePicker/SingleDate/variations/_disabled/base.js +3 -0
- package/styled-components/es/components/DatePicker/SingleDate/variations/_disabled/tokens.json +4 -0
- package/styled-components/es/components/DatePicker/SingleDate/variations/_readonly/base.js +4 -0
- package/styled-components/es/components/DatePicker/SingleDate/variations/_readonly/tokens.json +4 -0
- package/styled-components/es/components/DatePicker/SingleDate/variations/_size/base.js +4 -0
- package/styled-components/es/components/DatePicker/SingleDate/variations/_size/tokens.json +16 -0
- package/styled-components/es/components/DatePicker/SingleDate/variations/_view/base.js +4 -0
- package/styled-components/es/components/DatePicker/SingleDate/variations/_view/tokens.json +1 -0
- package/styled-components/es/components/DatePicker/hooks/useDatePicker.js +71 -0
- package/styled-components/es/components/DatePicker/index.js +3 -0
- package/styled-components/es/components/DatePicker/utils/dateHelper.js +72 -0
- package/styled-components/es/components/Dropdown/Dropdown.js +4 -3
- package/styled-components/es/components/Dropdown/ui/DropdownInner/DropdownInner.js +8 -4
- package/styled-components/es/components/Dropdown/ui/DropdownItem/DropdownItem.js +6 -5
- package/styled-components/es/components/Dropdown/utils/index.js +0 -15
- package/styled-components/es/components/Range/Range.js +18 -3
- package/styled-components/es/components/Range/Range.styles.js +3 -2
- package/styled-components/es/components/Select/Select.js +1 -2
- package/styled-components/es/components/Sheet/Sheet.js +4 -4
- package/styled-components/es/components/TextField/TextField.tokens.js +1 -1
- package/styled-components/es/components/TextField/variations/_size/base.js +1 -1
- package/styled-components/es/components/_Icon/Icon.assets/DisclosureDownFill.js +15 -0
- package/styled-components/es/components/_Icon/Icon.assets/DisclosureLeft.js +1 -1
- package/styled-components/es/components/_Icon/Icon.assets/DisclosureRight.js +5 -15
- package/styled-components/es/components/_Icon/Icons/IconDisclosureDownFill.js +15 -0
- package/styled-components/es/components/_Icon/index.js +1 -0
- package/styled-components/es/examples/plasma_b2c/components/Calendar/Calendar.stories.tsx +24 -6
- package/styled-components/es/examples/plasma_b2c/components/Calendar/CalendarBase.config.js +5 -2
- package/styled-components/es/examples/plasma_b2c/components/Calendar/CalendarDouble.config.js +5 -2
- package/styled-components/es/examples/plasma_b2c/components/DatePicker/DatePicker.config.js +25 -0
- package/styled-components/es/examples/plasma_b2c/components/DatePicker/DatePicker.js +7 -0
- package/styled-components/es/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +257 -0
- package/styled-components/es/examples/plasma_b2c/components/Range/Range.config.js +4 -4
- package/styled-components/es/examples/plasma_b2c/components/Sheet/Sheet.stories.tsx +2 -2
- package/styled-components/es/examples/plasma_web/components/Calendar/Calendar.stories.tsx +24 -6
- package/styled-components/es/examples/plasma_web/components/Calendar/CalendarBase.config.js +5 -2
- package/styled-components/es/examples/plasma_web/components/Calendar/CalendarDouble.config.js +5 -2
- package/styled-components/es/examples/plasma_web/components/DatePicker/DatePicker.config.js +25 -0
- package/styled-components/es/examples/plasma_web/components/DatePicker/DatePicker.js +7 -0
- package/styled-components/es/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +257 -0
- package/styled-components/es/examples/plasma_web/components/Range/Range.config.js +4 -4
- package/styled-components/es/examples/plasma_web/components/Sheet/Sheet.stories.tsx +2 -2
- package/styled-components/es/examples/sds_engineer/components/Calendar/Calendar.stories.tsx +24 -6
- package/styled-components/es/examples/sds_engineer/components/Calendar/CalendarBase.config.js +5 -2
- package/styled-components/es/examples/sds_engineer/components/Calendar/CalendarDouble.config.js +5 -2
- package/styled-components/es/index.js +2 -1
- package/styled-components/es/utils/datejs.js +4 -0
- package/styled-components/es/utils/getPopoverPlacement.js +15 -0
- package/styled-components/es/utils/index.js +1 -0
- package/types/components/Accordion/utils/index.d.ts +1 -1
- package/types/components/Calendar/Calendar.tokens.d.ts +60 -26
- package/types/components/Calendar/Calendar.tokens.d.ts.map +1 -1
- package/types/components/Calendar/Calendar.types.d.ts +1 -1
- package/types/components/Calendar/Calendar.types.d.ts.map +1 -1
- package/types/components/Calendar/CalendarBase/CalendarBase.d.ts +27 -3
- package/types/components/Calendar/CalendarBase/CalendarBase.d.ts.map +1 -1
- package/types/components/Calendar/CalendarBase/CalendarBase.styles.d.ts.map +1 -1
- package/types/components/Calendar/CalendarDouble/CalendarDouble.d.ts +30 -3
- package/types/components/Calendar/CalendarDouble/CalendarDouble.d.ts.map +1 -1
- package/types/components/Calendar/hooks/useDays.d.ts.map +1 -1
- package/types/components/Calendar/mixins/active.d.ts +17 -0
- package/types/components/Calendar/mixins/active.d.ts.map +1 -0
- package/types/components/Calendar/mixins/flex.d.ts +3 -0
- package/types/components/Calendar/mixins/flex.d.ts.map +1 -0
- package/types/components/Calendar/mixins/index.d.ts +3 -8
- package/types/components/Calendar/mixins/index.d.ts.map +1 -1
- package/types/components/Calendar/mixins/selected.d.ts +40 -0
- package/types/components/Calendar/mixins/selected.d.ts.map +1 -0
- package/types/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarDays/CalendarDays.styles.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarHeader/CalendarHeader.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.d.ts +47 -7
- package/types/components/Calendar/ui/CalendarHeader/CalendarHeader.styles.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarHeader/CalendarHeader.types.d.ts +1 -0
- package/types/components/Calendar/ui/CalendarHeader/CalendarHeader.types.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarMonths/CalendarMonths.styles.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarYears/CalendarYears.styles.d.ts.map +1 -1
- package/types/components/Calendar/utils/index.d.ts +1 -1
- package/types/components/Calendar/utils/index.d.ts.map +1 -1
- package/types/components/Combobox/Combobox.d.ts.map +1 -1
- package/types/components/DatePicker/DatePicker.tokens.d.ts +182 -0
- package/types/components/DatePicker/DatePicker.tokens.d.ts.map +1 -0
- package/types/components/DatePicker/DatePickerBase.styles.d.ts +8 -0
- package/types/components/DatePicker/DatePickerBase.styles.d.ts.map +1 -0
- package/types/components/DatePicker/DatePickerBase.types.d.ts +37 -0
- package/types/components/DatePicker/DatePickerBase.types.d.ts.map +1 -0
- package/types/components/DatePicker/RangeDate/RangeDate.d.ts +110 -0
- package/types/components/DatePicker/RangeDate/RangeDate.d.ts.map +1 -0
- package/types/components/DatePicker/RangeDate/RangeDate.styles.d.ts +115 -0
- package/types/components/DatePicker/RangeDate/RangeDate.styles.d.ts.map +1 -0
- package/types/components/DatePicker/RangeDate/RangeDate.types.d.ts +76 -0
- package/types/components/DatePicker/RangeDate/RangeDate.types.d.ts.map +1 -0
- package/types/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.d.ts +4 -0
- package/types/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.d.ts.map +1 -0
- package/types/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.d.ts +5 -0
- package/types/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.styles.d.ts.map +1 -0
- package/types/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.types.d.ts +29 -0
- package/types/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.types.d.ts.map +1 -0
- package/types/components/DatePicker/RangeDate/variations/_disabled/base.d.ts +2 -0
- package/types/components/DatePicker/RangeDate/variations/_disabled/base.d.ts.map +1 -0
- package/types/components/DatePicker/RangeDate/variations/_readonly/base.d.ts +2 -0
- package/types/components/DatePicker/RangeDate/variations/_readonly/base.d.ts.map +1 -0
- package/types/components/DatePicker/RangeDate/variations/_size/base.d.ts +2 -0
- package/types/components/DatePicker/RangeDate/variations/_size/base.d.ts.map +1 -0
- package/types/components/DatePicker/RangeDate/variations/_view/base.d.ts +2 -0
- package/types/components/DatePicker/RangeDate/variations/_view/base.d.ts.map +1 -0
- package/types/components/DatePicker/SingleDate/SingleDate.d.ts +31 -0
- package/types/components/DatePicker/SingleDate/SingleDate.d.ts.map +1 -0
- package/types/components/DatePicker/SingleDate/SingleDate.styles.d.ts +45 -0
- package/types/components/DatePicker/SingleDate/SingleDate.styles.d.ts.map +1 -0
- package/types/components/DatePicker/SingleDate/SingleDate.types.d.ts +120 -0
- package/types/components/DatePicker/SingleDate/SingleDate.types.d.ts.map +1 -0
- package/types/components/DatePicker/SingleDate/variations/_disabled/base.d.ts +2 -0
- package/types/components/DatePicker/SingleDate/variations/_disabled/base.d.ts.map +1 -0
- package/types/components/DatePicker/SingleDate/variations/_readonly/base.d.ts +2 -0
- package/types/components/DatePicker/SingleDate/variations/_readonly/base.d.ts.map +1 -0
- package/types/components/DatePicker/SingleDate/variations/_size/base.d.ts +2 -0
- package/types/components/DatePicker/SingleDate/variations/_size/base.d.ts.map +1 -0
- package/types/components/DatePicker/SingleDate/variations/_view/base.d.ts +2 -0
- package/types/components/DatePicker/SingleDate/variations/_view/base.d.ts.map +1 -0
- package/types/components/DatePicker/hooks/useDatePicker.d.ts +10 -0
- package/types/components/DatePicker/hooks/useDatePicker.d.ts.map +1 -0
- package/types/components/DatePicker/index.d.ts +6 -0
- package/types/components/DatePicker/index.d.ts.map +1 -0
- package/types/components/DatePicker/utils/dateHelper.d.ts +10 -0
- package/types/components/DatePicker/utils/dateHelper.d.ts.map +1 -0
- package/types/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts +1 -0
- package/types/components/Dropdown/ui/DropdownInner/DropdownInner.type.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.d.ts.map +1 -1
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts +1 -0
- package/types/components/Dropdown/ui/DropdownItem/DropdownItem.type.d.ts.map +1 -1
- package/types/components/Dropdown/utils/index.d.ts +1 -3
- package/types/components/Dropdown/utils/index.d.ts.map +1 -1
- package/types/components/Range/Range.d.ts +3 -3
- package/types/components/Range/Range.d.ts.map +1 -1
- package/types/components/Range/Range.styles.d.ts.map +1 -1
- package/types/components/Range/Range.types.d.ts +8 -3
- package/types/components/Range/Range.types.d.ts.map +1 -1
- package/types/components/Range/index.d.ts +1 -1
- package/types/components/Range/index.d.ts.map +1 -1
- package/types/components/Select/Select.d.ts.map +1 -1
- package/types/components/Sheet/Sheet.d.ts.map +1 -1
- package/types/components/Sheet/Sheet.types.d.ts +1 -1
- package/types/components/Sheet/Sheet.types.d.ts.map +1 -1
- package/types/components/TextField/variations/_size/base.d.ts.map +1 -1
- package/types/components/_Icon/Icon.assets/DisclosureDownFill.d.ts +4 -0
- package/types/components/_Icon/Icon.assets/DisclosureDownFill.d.ts.map +1 -0
- package/types/components/_Icon/Icon.assets/DisclosureRight.d.ts.map +1 -1
- package/types/components/_Icon/Icons/IconDisclosureDownFill.d.ts +4 -0
- package/types/components/_Icon/Icons/IconDisclosureDownFill.d.ts.map +1 -0
- package/types/components/_Icon/index.d.ts +1 -0
- package/types/components/_Icon/index.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Calendar/Calendar.d.ts +15 -4
- package/types/examples/plasma_b2c/components/Calendar/Calendar.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Calendar/CalendarBase.config.d.ts +3 -0
- package/types/examples/plasma_b2c/components/Calendar/CalendarBase.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Calendar/CalendarDouble.config.d.ts +3 -0
- package/types/examples/plasma_b2c/components/Calendar/CalendarDouble.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/DatePicker/DatePicker.config.d.ts +24 -0
- package/types/examples/plasma_b2c/components/DatePicker/DatePicker.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/DatePicker/DatePicker.d.ts +75 -0
- package/types/examples/plasma_b2c/components/DatePicker/DatePicker.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/Range/Range.d.ts +3 -3
- package/types/examples/plasma_b2c/components/Range/Range.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Calendar/Calendar.d.ts +15 -4
- package/types/examples/plasma_web/components/Calendar/Calendar.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Calendar/CalendarBase.config.d.ts +3 -0
- package/types/examples/plasma_web/components/Calendar/CalendarBase.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Calendar/CalendarDouble.config.d.ts +3 -0
- package/types/examples/plasma_web/components/Calendar/CalendarDouble.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/DatePicker/DatePicker.config.d.ts +24 -0
- package/types/examples/plasma_web/components/DatePicker/DatePicker.config.d.ts.map +1 -0
- package/types/examples/plasma_web/components/DatePicker/DatePicker.d.ts +75 -0
- package/types/examples/plasma_web/components/DatePicker/DatePicker.d.ts.map +1 -0
- package/types/examples/plasma_web/components/Range/Range.d.ts +3 -3
- package/types/examples/plasma_web/components/Range/Range.d.ts.map +1 -1
- package/types/examples/sds_engineer/components/Calendar/Calendar.d.ts +15 -4
- package/types/examples/sds_engineer/components/Calendar/Calendar.d.ts.map +1 -1
- package/types/examples/sds_engineer/components/Calendar/CalendarBase.config.d.ts +3 -0
- package/types/examples/sds_engineer/components/Calendar/CalendarBase.config.d.ts.map +1 -1
- package/types/examples/sds_engineer/components/Calendar/CalendarDouble.config.d.ts +3 -0
- package/types/examples/sds_engineer/components/Calendar/CalendarDouble.config.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/utils/datejs.d.ts +3 -0
- package/types/utils/datejs.d.ts.map +1 -0
- package/types/utils/getPopoverPlacement.d.ts +5 -0
- package/types/utils/getPopoverPlacement.d.ts.map +1 -0
- package/types/utils/index.d.ts +1 -0
- package/types/utils/index.d.ts.map +1 -1
- package/cjs/components/Calendar/mixins/index.js +0 -18
- package/cjs/components/Calendar/mixins/index.js.map +0 -1
- package/cjs/components/Calendar/mixins/index_o3bz9l.css +0 -1
- package/cjs/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles_xf9c5e.css +0 -4
- package/cjs/components/Calendar/ui/CalendarHeader/CalendarHeader.styles_1c4p417.css +0 -6
- package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.styles_1jnzviu.css +0 -4
- package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.styles_1lubnwe.css +0 -4
- package/cjs/components/Range/Range.styles_mc4w65.css +0 -8
- package/cjs/components/TextField/variations/_read-only/base_134hshp.css +0 -1
- package/cjs/components/TextField/variations/_size/base_ntoddv.css +0 -1
- package/cjs/components/TextField/variations/_view/base_19gxyva.css +0 -1
- package/es/components/Calendar/mixins/index.js +0 -14
- package/es/components/Calendar/mixins/index.js.map +0 -1
- package/es/components/Calendar/mixins/index_o3bz9l.css +0 -1
- package/es/components/Calendar/ui/CalendarDayItem/CalendarDayItem.styles_xf9c5e.css +0 -4
- package/es/components/Calendar/ui/CalendarHeader/CalendarHeader.styles_1c4p417.css +0 -6
- package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.styles_1jnzviu.css +0 -4
- package/es/components/Calendar/ui/CalendarYears/CalendarYears.styles_1lubnwe.css +0 -4
- package/es/components/Range/Range.styles_mc4w65.css +0 -8
- package/es/components/TextField/variations/_read-only/base_134hshp.css +0 -1
- package/es/components/TextField/variations/_size/base_ntoddv.css +0 -1
- package/es/components/TextField/variations/_view/base_19gxyva.css +0 -1
@@ -0,0 +1,284 @@
|
|
1
|
+
var _excluded = ["className", "isDoubleCalendar", "isOpen", "label", "leftHelper", "contentLeft", "contentRight", "view", "size", "readOnly", "disabled", "dividerVariant", "dividerIcon", "defaultFirstDate", "defaultSecondDate", "firstValueError", "secondValueError", "firstValueSuccess", "secondValueSuccess", "firstPlaceholder", "secondPlaceholder", "firstTextfieldContentLeft", "firstTextfieldContentRight", "secondTextfieldContentLeft", "secondTextfieldContentRight", "firstTextfieldTextBefore", "secondTextfieldTextBefore", "firstTextfieldTextAfter", "secondTextfieldTextAfter", "format", "maskWithFormat", "min", "max", "includeEdgeDates", "eventList", "disabledList", "type", "placement", "closeOnOverlayClick", "closeOnEsc", "offset", "onToggle", "onChangeFirstValue", "onChangeSecondValue", "onCommitFirstDate", "onCommitSecondDate", "onFocusFirstTextfield", "onFocusSecondTextfield", "onBlurFirstTextfield", "onBlurSecondTextfield"];
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
4
|
+
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 _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
6
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
7
|
+
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; } }
|
8
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
9
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
10
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
11
|
+
import React, { createRef, forwardRef, useCallback, useEffect, useRef, useState } from 'react';
|
12
|
+
import { cx } from '../../../utils';
|
13
|
+
import { formatCalendarValue, formatInputValue, getDateFormatDelimiter } from '../utils/dateHelper';
|
14
|
+
import { useDatePicker } from '../hooks/useDatePicker';
|
15
|
+
import { classes } from '../DatePicker.tokens';
|
16
|
+
import { base as sizeCSS } from './variations/_size/base';
|
17
|
+
import { base as viewCSS } from './variations/_view/base';
|
18
|
+
import { base as disabledCSS } from './variations/_disabled/base';
|
19
|
+
import { base as readOnlyCSS } from './variations/_readonly/base';
|
20
|
+
import { LeftHelper, StyledLabel, StyledRange, base } from './RangeDate.styles';
|
21
|
+
import { RangeDatePopover } from './RangeDatePopover/RangeDatePopover';
|
22
|
+
export var datePickerRangeRoot = function datePickerRangeRoot(Root) {
|
23
|
+
return /*#__PURE__*/forwardRef(function (_ref, ref) {
|
24
|
+
var _rangeRef$current, _rangeRef$current2;
|
25
|
+
var className = _ref.className,
|
26
|
+
_ref$isDoubleCalendar = _ref.isDoubleCalendar,
|
27
|
+
isDoubleCalendar = _ref$isDoubleCalendar === void 0 ? false : _ref$isDoubleCalendar,
|
28
|
+
_ref$isOpen = _ref.isOpen,
|
29
|
+
isOpen = _ref$isOpen === void 0 ? false : _ref$isOpen,
|
30
|
+
label = _ref.label,
|
31
|
+
leftHelper = _ref.leftHelper,
|
32
|
+
contentLeft = _ref.contentLeft,
|
33
|
+
contentRight = _ref.contentRight,
|
34
|
+
view = _ref.view,
|
35
|
+
size = _ref.size,
|
36
|
+
_ref$readOnly = _ref.readOnly,
|
37
|
+
readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
|
38
|
+
_ref$disabled = _ref.disabled,
|
39
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
40
|
+
_ref$dividerVariant = _ref.dividerVariant,
|
41
|
+
dividerVariant = _ref$dividerVariant === void 0 ? 'dash' : _ref$dividerVariant,
|
42
|
+
dividerIcon = _ref.dividerIcon,
|
43
|
+
_ref$defaultFirstDate = _ref.defaultFirstDate,
|
44
|
+
defaultFirstDate = _ref$defaultFirstDate === void 0 ? '' : _ref$defaultFirstDate,
|
45
|
+
_ref$defaultSecondDat = _ref.defaultSecondDate,
|
46
|
+
defaultSecondDate = _ref$defaultSecondDat === void 0 ? '' : _ref$defaultSecondDat,
|
47
|
+
firstValueError = _ref.firstValueError,
|
48
|
+
secondValueError = _ref.secondValueError,
|
49
|
+
firstValueSuccess = _ref.firstValueSuccess,
|
50
|
+
secondValueSuccess = _ref.secondValueSuccess,
|
51
|
+
firstPlaceholder = _ref.firstPlaceholder,
|
52
|
+
secondPlaceholder = _ref.secondPlaceholder,
|
53
|
+
firstTextfieldContentLeft = _ref.firstTextfieldContentLeft,
|
54
|
+
firstTextfieldContentRight = _ref.firstTextfieldContentRight,
|
55
|
+
secondTextfieldContentLeft = _ref.secondTextfieldContentLeft,
|
56
|
+
secondTextfieldContentRight = _ref.secondTextfieldContentRight,
|
57
|
+
firstTextfieldTextBefore = _ref.firstTextfieldTextBefore,
|
58
|
+
secondTextfieldTextBefore = _ref.secondTextfieldTextBefore,
|
59
|
+
firstTextfieldTextAfter = _ref.firstTextfieldTextAfter,
|
60
|
+
secondTextfieldTextAfter = _ref.secondTextfieldTextAfter,
|
61
|
+
_ref$format = _ref.format,
|
62
|
+
format = _ref$format === void 0 ? 'DD.MM.YYYY' : _ref$format,
|
63
|
+
maskWithFormat = _ref.maskWithFormat,
|
64
|
+
min = _ref.min,
|
65
|
+
max = _ref.max,
|
66
|
+
_ref$includeEdgeDates = _ref.includeEdgeDates,
|
67
|
+
includeEdgeDates = _ref$includeEdgeDates === void 0 ? false : _ref$includeEdgeDates,
|
68
|
+
eventList = _ref.eventList,
|
69
|
+
disabledList = _ref.disabledList,
|
70
|
+
_ref$type = _ref.type,
|
71
|
+
type = _ref$type === void 0 ? 'Days' : _ref$type,
|
72
|
+
_ref$placement = _ref.placement,
|
73
|
+
placement = _ref$placement === void 0 ? ['top', 'bottom'] : _ref$placement,
|
74
|
+
_ref$closeOnOverlayCl = _ref.closeOnOverlayClick,
|
75
|
+
closeOnOverlayClick = _ref$closeOnOverlayCl === void 0 ? true : _ref$closeOnOverlayCl,
|
76
|
+
_ref$closeOnEsc = _ref.closeOnEsc,
|
77
|
+
closeOnEsc = _ref$closeOnEsc === void 0 ? true : _ref$closeOnEsc,
|
78
|
+
offset = _ref.offset,
|
79
|
+
onToggle = _ref.onToggle,
|
80
|
+
onChangeFirstValue = _ref.onChangeFirstValue,
|
81
|
+
onChangeSecondValue = _ref.onChangeSecondValue,
|
82
|
+
onCommitFirstDate = _ref.onCommitFirstDate,
|
83
|
+
onCommitSecondDate = _ref.onCommitSecondDate,
|
84
|
+
onFocusFirstTextfield = _ref.onFocusFirstTextfield,
|
85
|
+
onFocusSecondTextfield = _ref.onFocusSecondTextfield,
|
86
|
+
onBlurFirstTextfield = _ref.onBlurFirstTextfield,
|
87
|
+
onBlurSecondTextfield = _ref.onBlurSecondTextfield,
|
88
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
89
|
+
var rangeRef = ref && 'current' in ref ? ref : /*#__PURE__*/createRef();
|
90
|
+
var rootRef = useRef(null);
|
91
|
+
var _useState = useState(rangeRef === null || rangeRef === void 0 || (_rangeRef$current = rangeRef.current) === null || _rangeRef$current === void 0 ? void 0 : _rangeRef$current.firstTextField()),
|
92
|
+
_useState2 = _slicedToArray(_useState, 2),
|
93
|
+
firstInputRef = _useState2[0],
|
94
|
+
setFirstInputRef = _useState2[1];
|
95
|
+
var _useState3 = useState(rangeRef === null || rangeRef === void 0 || (_rangeRef$current2 = rangeRef.current) === null || _rangeRef$current2 === void 0 ? void 0 : _rangeRef$current2.secondTextField()),
|
96
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
97
|
+
secondInputRef = _useState4[0],
|
98
|
+
setSecondInputRef = _useState4[1];
|
99
|
+
var _useState5 = useState(isOpen),
|
100
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
101
|
+
isInnerOpen = _useState6[0],
|
102
|
+
setIsInnerOpen = _useState6[1];
|
103
|
+
var _useState7 = useState(formatCalendarValue(defaultFirstDate, format)),
|
104
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
105
|
+
calendarFirstValue = _useState8[0],
|
106
|
+
setCalendarFirstValue = _useState8[1];
|
107
|
+
var _useState9 = useState(formatInputValue(defaultFirstDate, format)),
|
108
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
109
|
+
inputFirstValue = _useState10[0],
|
110
|
+
setInputFirstValue = _useState10[1];
|
111
|
+
var _useState11 = useState(formatCalendarValue(defaultSecondDate, format)),
|
112
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
113
|
+
calendarSecondValue = _useState12[0],
|
114
|
+
setCalendarSecondValue = _useState12[1];
|
115
|
+
var _useState13 = useState(formatInputValue(defaultSecondDate, format)),
|
116
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
117
|
+
inputSecondValue = _useState14[0],
|
118
|
+
setInputSecondValue = _useState14[1];
|
119
|
+
var dateFormatDelimiter = useCallback(function () {
|
120
|
+
return getDateFormatDelimiter(format);
|
121
|
+
}, [format]);
|
122
|
+
var _useDatePicker = useDatePicker({
|
123
|
+
currentValue: inputFirstValue,
|
124
|
+
setInputValue: setInputFirstValue,
|
125
|
+
setCalendarValue: setCalendarFirstValue,
|
126
|
+
setIsInnerOpen: setIsInnerOpen,
|
127
|
+
dateFormatDelimiter: dateFormatDelimiter,
|
128
|
+
format: format,
|
129
|
+
disabled: disabled,
|
130
|
+
readOnly: readOnly,
|
131
|
+
maskWithFormat: maskWithFormat,
|
132
|
+
valueError: firstValueError,
|
133
|
+
valueSuccess: firstValueSuccess,
|
134
|
+
inputRef: firstInputRef,
|
135
|
+
onChangeValue: onChangeFirstValue,
|
136
|
+
onCommitDate: onCommitFirstDate
|
137
|
+
}),
|
138
|
+
handleChangeFirstValue = _useDatePicker.handleChangeValue,
|
139
|
+
handleCommitFirstDate = _useDatePicker.handleCommitDate;
|
140
|
+
var _useDatePicker2 = useDatePicker({
|
141
|
+
currentValue: inputSecondValue,
|
142
|
+
setInputValue: setInputSecondValue,
|
143
|
+
setCalendarValue: setCalendarSecondValue,
|
144
|
+
setIsInnerOpen: setIsInnerOpen,
|
145
|
+
dateFormatDelimiter: dateFormatDelimiter,
|
146
|
+
format: format,
|
147
|
+
disabled: disabled,
|
148
|
+
readOnly: readOnly,
|
149
|
+
maskWithFormat: maskWithFormat,
|
150
|
+
valueError: secondValueError,
|
151
|
+
valueSuccess: secondValueSuccess,
|
152
|
+
inputRef: secondInputRef,
|
153
|
+
onChangeValue: onChangeSecondValue,
|
154
|
+
onCommitDate: onCommitSecondDate
|
155
|
+
}),
|
156
|
+
handleChangeSecondValue = _useDatePicker2.handleChangeValue,
|
157
|
+
handleCommitSecondDate = _useDatePicker2.handleCommitDate;
|
158
|
+
var handleToggle = function handleToggle(opened, event) {
|
159
|
+
var _firstInputRef$curren, _secondInputRef$curre;
|
160
|
+
if (disabled || readOnly) {
|
161
|
+
return;
|
162
|
+
}
|
163
|
+
var isCalendarOpen = firstInputRef !== null && firstInputRef !== void 0 && (_firstInputRef$curren = firstInputRef.current) !== null && _firstInputRef$curren !== void 0 && _firstInputRef$curren.contains(event.target || null) || secondInputRef !== null && secondInputRef !== void 0 && (_secondInputRef$curre = secondInputRef.current) !== null && _secondInputRef$curre !== void 0 && _secondInputRef$curre.contains(event.target || null) ? true : opened;
|
164
|
+
if (onToggle) {
|
165
|
+
return onToggle(isCalendarOpen, event);
|
166
|
+
}
|
167
|
+
setIsInnerOpen(isCalendarOpen);
|
168
|
+
};
|
169
|
+
var RangeComponent = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyledRange, {
|
170
|
+
ref: rangeRef,
|
171
|
+
dividerIcon: dividerIcon,
|
172
|
+
dividerVariant: dividerVariant,
|
173
|
+
disabled: disabled,
|
174
|
+
readOnly: !disabled && readOnly,
|
175
|
+
firstPlaceholder: firstPlaceholder,
|
176
|
+
secondPlaceholder: secondPlaceholder,
|
177
|
+
contentLeft: contentLeft,
|
178
|
+
contentRight: contentRight,
|
179
|
+
firstTextfieldTextBefore: firstTextfieldTextBefore,
|
180
|
+
secondTextfieldTextBefore: secondTextfieldTextBefore,
|
181
|
+
firstTextfieldTextAfter: firstTextfieldTextAfter,
|
182
|
+
secondTextfieldTextAfter: secondTextfieldTextAfter,
|
183
|
+
firstTextfieldContentLeft: firstTextfieldContentLeft,
|
184
|
+
firstTextfieldContentRight: firstTextfieldContentRight,
|
185
|
+
secondTextfieldContentLeft: secondTextfieldContentLeft,
|
186
|
+
secondTextfieldContentRight: secondTextfieldContentRight,
|
187
|
+
firstValue: inputFirstValue,
|
188
|
+
secondValue: inputSecondValue,
|
189
|
+
firstValueError: firstValueError,
|
190
|
+
secondValueError: secondValueError,
|
191
|
+
firstValueSuccess: firstValueSuccess,
|
192
|
+
secondValueSuccess: secondValueSuccess,
|
193
|
+
onChangeFirstValue: handleChangeFirstValue,
|
194
|
+
onChangeSecondValue: handleChangeSecondValue,
|
195
|
+
onSearchFirstValue: function onSearchFirstValue(_, date) {
|
196
|
+
handleCommitFirstDate(String(date), true, false);
|
197
|
+
if (!calendarSecondValue || secondValueError) {
|
198
|
+
var _rangeRef$current3;
|
199
|
+
rangeRef === null || rangeRef === void 0 || (_rangeRef$current3 = rangeRef.current) === null || _rangeRef$current3 === void 0 || (_rangeRef$current3 = _rangeRef$current3.secondTextField()) === null || _rangeRef$current3 === void 0 || (_rangeRef$current3 = _rangeRef$current3.current) === null || _rangeRef$current3 === void 0 || _rangeRef$current3.focus();
|
200
|
+
}
|
201
|
+
},
|
202
|
+
onSearchSecondValue: function onSearchSecondValue(_, date) {
|
203
|
+
handleCommitSecondDate(String(date), true, false);
|
204
|
+
if (!calendarFirstValue || firstValueError) {
|
205
|
+
var _rangeRef$current4;
|
206
|
+
rangeRef === null || rangeRef === void 0 || (_rangeRef$current4 = rangeRef.current) === null || _rangeRef$current4 === void 0 || (_rangeRef$current4 = _rangeRef$current4.firstTextField()) === null || _rangeRef$current4 === void 0 || (_rangeRef$current4 = _rangeRef$current4.current) === null || _rangeRef$current4 === void 0 || _rangeRef$current4.focus();
|
207
|
+
}
|
208
|
+
},
|
209
|
+
onFocusFirstTextfield: onFocusFirstTextfield,
|
210
|
+
onFocusSecondTextfield: onFocusSecondTextfield,
|
211
|
+
onBlurFirstTextfield: onBlurFirstTextfield,
|
212
|
+
onBlurSecondTextfield: onBlurSecondTextfield
|
213
|
+
}));
|
214
|
+
useEffect(function () {
|
215
|
+
var _rangeRef$current5, _rangeRef$current6;
|
216
|
+
setFirstInputRef((_rangeRef$current5 = rangeRef.current) === null || _rangeRef$current5 === void 0 ? void 0 : _rangeRef$current5.firstTextField());
|
217
|
+
setSecondInputRef((_rangeRef$current6 = rangeRef.current) === null || _rangeRef$current6 === void 0 ? void 0 : _rangeRef$current6.secondTextField());
|
218
|
+
}, [rangeRef.current]);
|
219
|
+
return /*#__PURE__*/React.createElement(Root, _extends({
|
220
|
+
ref: rootRef,
|
221
|
+
view: view,
|
222
|
+
size: size,
|
223
|
+
className: cx(classes.datePickerRoot, className),
|
224
|
+
disabled: disabled,
|
225
|
+
readOnly: !disabled && readOnly
|
226
|
+
}, rest), label && /*#__PURE__*/React.createElement(StyledLabel, null, label), /*#__PURE__*/React.createElement(RangeDatePopover, {
|
227
|
+
calendarValue: [calendarFirstValue, calendarSecondValue],
|
228
|
+
target: RangeComponent,
|
229
|
+
isOpen: isOpen || isInnerOpen,
|
230
|
+
includeEdgeDates: includeEdgeDates,
|
231
|
+
eventList: eventList,
|
232
|
+
disabledList: disabledList,
|
233
|
+
min: min,
|
234
|
+
max: max,
|
235
|
+
placement: placement,
|
236
|
+
closeOnOverlayClick: closeOnOverlayClick,
|
237
|
+
closeOnEsc: closeOnEsc,
|
238
|
+
offset: offset,
|
239
|
+
type: type,
|
240
|
+
onToggle: handleToggle,
|
241
|
+
isDoubleCalendar: isDoubleCalendar,
|
242
|
+
onChangeStartOfRange: function onChangeStartOfRange(firstDate) {
|
243
|
+
handleCommitFirstDate(firstDate, false, true);
|
244
|
+
handleCommitSecondDate('');
|
245
|
+
},
|
246
|
+
onChangeValue: function onChangeValue(_ref2) {
|
247
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
248
|
+
firstDate = _ref3[0],
|
249
|
+
secondDate = _ref3[1];
|
250
|
+
firstDate && handleCommitFirstDate(firstDate, false, true);
|
251
|
+
secondDate && handleCommitSecondDate(secondDate, false, true);
|
252
|
+
if (firstDate && secondDate && !firstValueError && !secondValueError) {
|
253
|
+
setIsInnerOpen(false);
|
254
|
+
}
|
255
|
+
}
|
256
|
+
}), leftHelper && /*#__PURE__*/React.createElement(LeftHelper, null, leftHelper));
|
257
|
+
});
|
258
|
+
};
|
259
|
+
export var datePickerRangeConfig = {
|
260
|
+
name: 'DatePickerRange',
|
261
|
+
tag: 'div',
|
262
|
+
layout: datePickerRangeRoot,
|
263
|
+
base: base,
|
264
|
+
variations: {
|
265
|
+
view: {
|
266
|
+
css: viewCSS
|
267
|
+
},
|
268
|
+
size: {
|
269
|
+
css: sizeCSS
|
270
|
+
},
|
271
|
+
disabled: {
|
272
|
+
css: disabledCSS,
|
273
|
+
attrs: true
|
274
|
+
},
|
275
|
+
readOnly: {
|
276
|
+
css: readOnlyCSS,
|
277
|
+
attrs: true
|
278
|
+
}
|
279
|
+
},
|
280
|
+
defaults: {
|
281
|
+
size: 'm',
|
282
|
+
view: 'default'
|
283
|
+
}
|
284
|
+
};
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import styled from 'styled-components';
|
2
|
+
import { css } from 'styled-components';
|
3
|
+
import { component, mergeConfig } from '../../../engines';
|
4
|
+
import { rangeConfig, rangeTokens } from '../../Range';
|
5
|
+
import { tokens } from '../DatePicker.tokens';
|
6
|
+
import { popoverConfig } from '../../Popover';
|
7
|
+
var mergedRangeConfig = /*#__PURE__*/mergeConfig(rangeConfig);
|
8
|
+
var Range = /*#__PURE__*/component(mergedRangeConfig);
|
9
|
+
var mergedPopoverConfig = /*#__PURE__*/mergeConfig(popoverConfig);
|
10
|
+
var Popover = /*#__PURE__*/component(mergedPopoverConfig);
|
11
|
+
export var StyledPopover = /*#__PURE__*/styled(Popover).withConfig({
|
12
|
+
componentId: "plasma-new-hope__sc-14j95rs-0"
|
13
|
+
})([""]);
|
14
|
+
|
15
|
+
// NOTE: переопределение токенов Range
|
16
|
+
export var StyledRange = /*#__PURE__*/styled(Range).withConfig({
|
17
|
+
componentId: "plasma-new-hope__sc-14j95rs-1"
|
18
|
+
})(["", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");", ":var(", ");"], rangeTokens.background, tokens.background, rangeTokens.backgroundError, tokens.backgroundError, rangeTokens.backgroundSuccess, tokens.backgroundSuccess, rangeTokens.borderColor, tokens.borderColor, rangeTokens.borderColorError, tokens.borderColorError, rangeTokens.borderColorSuccess, tokens.borderColorSuccess, rangeTokens.borderWidth, tokens.textFieldBorderWidth, rangeTokens.dividerColor, tokens.dividerColor, rangeTokens.labelColor, tokens.labelColor, rangeTokens.leftHelperColor, tokens.leftHelperColor, rangeTokens.textFieldColor, tokens.textFieldColor, rangeTokens.textFieldPlaceholderColor, tokens.textFieldPlaceholderColor, rangeTokens.textFieldCaretColor, tokens.textFieldCaretColor, rangeTokens.textFieldBackgroundColorFocus, tokens.textFieldBackgroundColorFocus, rangeTokens.textFieldBackgroundErrorColor, tokens.textFieldBackgroundErrorColor, rangeTokens.textFieldBackgroundErrorColorFocus, tokens.textFieldBackgroundErrorColorFocus, rangeTokens.textFieldBackgroundSuccessColor, tokens.textFieldBackgroundSuccessColor, rangeTokens.textFieldBackgroundSuccessColorFocus, tokens.textFieldBackgroundSuccessColorFocus, rangeTokens.textFieldBorderWidth, tokens.textFieldBorderWidth, rangeTokens.textFieldBorderColorFocus, tokens.textFieldBorderColorFocus, rangeTokens.textFieldBorderColorError, tokens.textFieldBorderColorError, rangeTokens.textFieldBorderColorErrorFocus, tokens.textFieldBorderColorErrorFocus, rangeTokens.textFieldBorderColorSuccess, tokens.textFieldBorderColorSuccess, rangeTokens.textFieldBorderColorSuccessFocus, tokens.textFieldBorderColorSuccessFocus, rangeTokens.textFieldTextBeforeColor, tokens.textFieldTextBeforeColor, rangeTokens.textFieldTextAfterColor, tokens.textFieldTextAfterColor, rangeTokens.focusColor, tokens.focusColor, rangeTokens.borderRadius, tokens.borderRadius, rangeTokens.dividerPadding, tokens.dividerPadding, rangeTokens.dividerFontFamily, tokens.dividerFontFamily, rangeTokens.dividerFontStyle, tokens.dividerFontStyle, rangeTokens.dividerFontSize, tokens.dividerFontSize, rangeTokens.dividerFontWeight, tokens.dividerFontWeight, rangeTokens.dividerLetterSpacing, tokens.dividerLetterSpacing, rangeTokens.dividerLineHeight, tokens.dividerLineHeight, rangeTokens.leftContentMargin, tokens.leftContentMargin, rangeTokens.rightContentMargin, tokens.rightContentMargin, rangeTokens.labelOffset, tokens.labelOffset, rangeTokens.labelFontFamily, tokens.labelFontFamily, rangeTokens.labelFontStyle, tokens.labelFontStyle, rangeTokens.labelFontSize, tokens.labelFontSize, rangeTokens.labelFontWeight, tokens.labelFontWeight, rangeTokens.labelLetterSpacing, tokens.labelLetterSpacing, rangeTokens.labelLineHeight, tokens.labelLineHeight, rangeTokens.textFieldHeight, tokens.textFieldHeight, rangeTokens.textFieldBorderRadius, tokens.textFieldBorderRadius, rangeTokens.textFieldPadding, tokens.textFieldPadding, rangeTokens.textFieldFontFamily, tokens.textFieldFontFamily, rangeTokens.textFieldFontStyle, tokens.textFieldFontStyle, rangeTokens.textFieldFontSize, tokens.textFieldFontSize, rangeTokens.textFieldFontWeight, tokens.textFieldFontWeight, rangeTokens.textFieldLetterSpacing, tokens.textFieldLetterSpacing, rangeTokens.textFieldLineHeight, tokens.textFieldLineHeight, rangeTokens.leftHelperOffset, tokens.leftHelperOffset, rangeTokens.leftHelperFontFamily, tokens.leftHelperFontFamily, rangeTokens.leftHelperFontStyle, tokens.leftHelperFontStyle, rangeTokens.leftHelperFontSize, tokens.leftHelperFontSize, rangeTokens.leftHelperFontWeight, tokens.leftHelperFontWeight, rangeTokens.leftHelperLetterSpacing, tokens.leftHelperLetterSpacing, rangeTokens.leftHelperLineHeight, tokens.leftHelperLineHeight, rangeTokens.textFieldLeftContentMargin, tokens.textFieldLeftContentMargin, rangeTokens.textFieldRightContentMargin, tokens.textFieldRightContentMargin, rangeTokens.textFieldTextBeforeMargin, tokens.textFieldTextBeforeMargin, rangeTokens.textFieldTextAfterMargin, tokens.textFieldTextAfterMargin, rangeTokens.backgroundReadOnly, tokens.backgroundReadOnly, rangeTokens.labelColorReadOnly, tokens.labelColorReadOnly, rangeTokens.leftHelperColorReadOnly, tokens.leftHelperColorReadOnly, rangeTokens.dividerColorReadOnly, tokens.dividerColorReadOnly, rangeTokens.textFieldColorReadOnly, tokens.textFieldColorReadOnly, rangeTokens.textFieldBackgroundColorReadOnly, tokens.textFieldBackgroundColorReadOnly, rangeTokens.textFieldPlaceholderColorReadOnly, tokens.textFieldPlaceholderColorReadOnly);
|
19
|
+
export var base = /*#__PURE__*/css(["display:inline-block;"]);
|
20
|
+
export var StyledLabel = /*#__PURE__*/styled.label.withConfig({
|
21
|
+
componentId: "plasma-new-hope__sc-14j95rs-2"
|
22
|
+
})([""]);
|
23
|
+
export var LeftHelper = /*#__PURE__*/styled.div.withConfig({
|
24
|
+
componentId: "plasma-new-hope__sc-14j95rs-3"
|
25
|
+
})([""]);
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/styled-components/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.js
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { getPlacements } from '../../../../utils';
|
3
|
+
import { StyledPopover } from '../RangeDate.styles';
|
4
|
+
import { StyledCalendar, StyledCalendarDouble } from './RangeDatePopover.styles';
|
5
|
+
export var RangeDatePopover = function RangeDatePopover(_ref) {
|
6
|
+
var target = _ref.target,
|
7
|
+
isOpen = _ref.isOpen,
|
8
|
+
isDoubleCalendar = _ref.isDoubleCalendar,
|
9
|
+
calendarValue = _ref.calendarValue,
|
10
|
+
min = _ref.min,
|
11
|
+
max = _ref.max,
|
12
|
+
includeEdgeDates = _ref.includeEdgeDates,
|
13
|
+
eventList = _ref.eventList,
|
14
|
+
disabledList = _ref.disabledList,
|
15
|
+
_ref$placement = _ref.placement,
|
16
|
+
placement = _ref$placement === void 0 ? ['top', 'bottom'] : _ref$placement,
|
17
|
+
_ref$closeOnOverlayCl = _ref.closeOnOverlayClick,
|
18
|
+
closeOnOverlayClick = _ref$closeOnOverlayCl === void 0 ? true : _ref$closeOnOverlayCl,
|
19
|
+
closeOnEsc = _ref.closeOnEsc,
|
20
|
+
offset = _ref.offset,
|
21
|
+
type = _ref.type,
|
22
|
+
size = _ref.size,
|
23
|
+
onChangeValue = _ref.onChangeValue,
|
24
|
+
onChangeStartOfRange = _ref.onChangeStartOfRange,
|
25
|
+
onToggle = _ref.onToggle;
|
26
|
+
if (isDoubleCalendar) {
|
27
|
+
return /*#__PURE__*/React.createElement(StyledPopover, {
|
28
|
+
isOpen: isOpen,
|
29
|
+
usePortal: false,
|
30
|
+
onToggle: onToggle,
|
31
|
+
offset: offset,
|
32
|
+
placement: getPlacements(placement),
|
33
|
+
trigger: "click",
|
34
|
+
closeOnOverlayClick: closeOnOverlayClick,
|
35
|
+
isFocusTrapped: false,
|
36
|
+
target: target,
|
37
|
+
preventOverflow: false
|
38
|
+
}, /*#__PURE__*/React.createElement(StyledCalendarDouble, {
|
39
|
+
size: size,
|
40
|
+
value: calendarValue,
|
41
|
+
eventList: eventList,
|
42
|
+
disabledList: disabledList,
|
43
|
+
min: min,
|
44
|
+
max: max,
|
45
|
+
includeEdgeDates: includeEdgeDates,
|
46
|
+
onChangeValue: onChangeValue,
|
47
|
+
onChangeStartOfRange: onChangeStartOfRange
|
48
|
+
}));
|
49
|
+
}
|
50
|
+
return /*#__PURE__*/React.createElement(StyledPopover, {
|
51
|
+
isOpen: isOpen,
|
52
|
+
usePortal: false,
|
53
|
+
onToggle: onToggle,
|
54
|
+
offset: offset,
|
55
|
+
placement: getPlacements(placement),
|
56
|
+
trigger: "click",
|
57
|
+
closeOnOverlayClick: closeOnOverlayClick,
|
58
|
+
isFocusTrapped: false,
|
59
|
+
target: target,
|
60
|
+
preventOverflow: false,
|
61
|
+
closeOnEsc: closeOnEsc
|
62
|
+
}, /*#__PURE__*/React.createElement(StyledCalendar, {
|
63
|
+
size: size,
|
64
|
+
value: calendarValue,
|
65
|
+
eventList: eventList,
|
66
|
+
disabledList: disabledList,
|
67
|
+
min: min,
|
68
|
+
max: max,
|
69
|
+
type: type,
|
70
|
+
includeEdgeDates: includeEdgeDates,
|
71
|
+
onChangeValue: onChangeValue,
|
72
|
+
onChangeStartOfRange: onChangeStartOfRange
|
73
|
+
}));
|
74
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import styled from 'styled-components';
|
2
|
+
import { calendarDoubleConfig, calendarBaseTokens, withRange, calendarBaseConfig } from '../../../Calendar';
|
3
|
+
import { tokens } from '../../DatePicker.tokens';
|
4
|
+
import { component, mergeConfig } from '../../../../engines';
|
5
|
+
import { baseCalendarTokens } from '../../DatePickerBase.styles';
|
6
|
+
var mergedCalendarDoubleConfig = /*#__PURE__*/mergeConfig(calendarDoubleConfig);
|
7
|
+
var CalendarDouble = /*#__PURE__*/component(mergedCalendarDoubleConfig);
|
8
|
+
var mergedCalendarConfig = /*#__PURE__*/mergeConfig(calendarBaseConfig);
|
9
|
+
var Calendar = /*#__PURE__*/component(mergedCalendarConfig);
|
10
|
+
var CalendarDoubleRange = /*#__PURE__*/withRange(CalendarDouble);
|
11
|
+
var CalendarRange = /*#__PURE__*/withRange(Calendar);
|
12
|
+
|
13
|
+
// NOTE: переопределение токенов Calendar
|
14
|
+
export var StyledCalendarDouble = /*#__PURE__*/styled(CalendarDoubleRange).withConfig({
|
15
|
+
componentId: "plasma-new-hope__sc-vflcna-0"
|
16
|
+
})(["", ":var(", ");", " ", ":calc(var(", ") * 2 + 2.063rem);"], calendarBaseTokens.calendarSeparatorBackground, tokens.calendarSeparatorBackground, baseCalendarTokens, calendarBaseTokens.calendarWidth, tokens.calendarWidth);
|
17
|
+
export var StyledCalendar = /*#__PURE__*/styled(CalendarRange).withConfig({
|
18
|
+
componentId: "plasma-new-hope__sc-vflcna-1"
|
19
|
+
})(["", ""], baseCalendarTokens);
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
File without changes
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { css } from 'styled-components';
|
2
|
+
import { tokens } from '../../../DatePicker.tokens';
|
3
|
+
import { LeftHelper, StyledLabel } from '../../RangeDate.styles';
|
4
|
+
export var base = /*#__PURE__*/css(["&[readonly]{cursor:default;", ":transparent;", "{display:block;color:var(", ");}", "{color:var(", ");}}"], tokens.textFieldBackgroundColorReadOnly, StyledLabel, tokens.labelColorReadOnly, LeftHelper, tokens.leftHelperColorReadOnly);
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { css } from 'styled-components';
|
2
|
+
import { tokens } from '../../../DatePicker.tokens';
|
3
|
+
import { StyledLabel, LeftHelper } from '../../RangeDate.styles';
|
4
|
+
export var base = /*#__PURE__*/css(["width:var(", ");", "{margin:var(", ");font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");}", "{margin:var(", ");font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");}"], tokens.width, StyledLabel, tokens.labelOffset, tokens.labelFontFamily, tokens.labelFontSize, tokens.labelFontStyle, tokens.labelFontWeight, tokens.labelLetterSpacing, tokens.labelLineHeight, LeftHelper, tokens.leftHelperOffset, tokens.leftHelperFontFamily, tokens.leftHelperFontSize, tokens.leftHelperFontStyle, tokens.leftHelperFontWeight, tokens.leftHelperLetterSpacing, tokens.leftHelperLineHeight);
|
File without changes
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { css } from 'styled-components';
|
2
|
+
import { LeftHelper, StyledLabel } from '../../RangeDate.styles';
|
3
|
+
import { tokens } from '../../../DatePicker.tokens';
|
4
|
+
export var base = /*#__PURE__*/css(["", "{display:block;color:var(", ");}", "{color:var(", ");}"], StyledLabel, tokens.labelColor, LeftHelper, tokens.leftHelperColor);
|
File without changes
|
@@ -0,0 +1,181 @@
|
|
1
|
+
var _excluded = ["className", "isOpen", "label", "placeholder", "leftHelper", "contentLeft", "contentRight", "textBefore", "textAfter", "view", "size", "readOnly", "disabled", "defaultDate", "valueError", "valueSuccess", "format", "maskWithFormat", "min", "max", "includeEdgeDates", "eventList", "disabledList", "type", "placement", "closeOnOverlayClick", "offset", "onChangeValue", "onCommitDate", "onToggle", "onFocus", "onBlur"];
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
4
|
+
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 _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
6
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
7
|
+
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; } }
|
8
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
9
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
10
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
11
|
+
import React, { forwardRef, useCallback, useRef, useState } from 'react';
|
12
|
+
import { cx, getPlacements } from '../../../utils';
|
13
|
+
import { formatCalendarValue, formatInputValue, getDateFormatDelimiter } from '../utils/dateHelper';
|
14
|
+
import { useDatePicker } from '../hooks/useDatePicker';
|
15
|
+
import { classes } from '../DatePicker.tokens';
|
16
|
+
import { StyledCalendar } from '../DatePickerBase.styles';
|
17
|
+
import { base as sizeCSS } from './variations/_size/base';
|
18
|
+
import { base as viewCSS } from './variations/_view/base';
|
19
|
+
import { base as disabledCSS } from './variations/_disabled/base';
|
20
|
+
import { base as readOnlyCSS } from './variations/_readonly/base';
|
21
|
+
import { LeftHelper, StyledInput, StyledLabel, StyledPopover, base } from './SingleDate.styles';
|
22
|
+
export var datePickerRoot = function datePickerRoot(Root) {
|
23
|
+
return /*#__PURE__*/forwardRef(function (_ref, ref) {
|
24
|
+
var className = _ref.className,
|
25
|
+
_ref$isOpen = _ref.isOpen,
|
26
|
+
isOpen = _ref$isOpen === void 0 ? false : _ref$isOpen,
|
27
|
+
label = _ref.label,
|
28
|
+
placeholder = _ref.placeholder,
|
29
|
+
leftHelper = _ref.leftHelper,
|
30
|
+
contentLeft = _ref.contentLeft,
|
31
|
+
contentRight = _ref.contentRight,
|
32
|
+
textBefore = _ref.textBefore,
|
33
|
+
textAfter = _ref.textAfter,
|
34
|
+
view = _ref.view,
|
35
|
+
size = _ref.size,
|
36
|
+
_ref$readOnly = _ref.readOnly,
|
37
|
+
readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
|
38
|
+
_ref$disabled = _ref.disabled,
|
39
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
40
|
+
_ref$defaultDate = _ref.defaultDate,
|
41
|
+
defaultDate = _ref$defaultDate === void 0 ? '' : _ref$defaultDate,
|
42
|
+
valueError = _ref.valueError,
|
43
|
+
valueSuccess = _ref.valueSuccess,
|
44
|
+
_ref$format = _ref.format,
|
45
|
+
format = _ref$format === void 0 ? 'DD.MM.YYYY' : _ref$format,
|
46
|
+
maskWithFormat = _ref.maskWithFormat,
|
47
|
+
min = _ref.min,
|
48
|
+
max = _ref.max,
|
49
|
+
_ref$includeEdgeDates = _ref.includeEdgeDates,
|
50
|
+
includeEdgeDates = _ref$includeEdgeDates === void 0 ? false : _ref$includeEdgeDates,
|
51
|
+
eventList = _ref.eventList,
|
52
|
+
disabledList = _ref.disabledList,
|
53
|
+
_ref$type = _ref.type,
|
54
|
+
type = _ref$type === void 0 ? 'Days' : _ref$type,
|
55
|
+
_ref$placement = _ref.placement,
|
56
|
+
placement = _ref$placement === void 0 ? ['top', 'bottom'] : _ref$placement,
|
57
|
+
_ref$closeOnOverlayCl = _ref.closeOnOverlayClick,
|
58
|
+
closeOnOverlayClick = _ref$closeOnOverlayCl === void 0 ? true : _ref$closeOnOverlayCl,
|
59
|
+
offset = _ref.offset,
|
60
|
+
onChangeValue = _ref.onChangeValue,
|
61
|
+
onCommitDate = _ref.onCommitDate,
|
62
|
+
onToggle = _ref.onToggle,
|
63
|
+
onFocus = _ref.onFocus,
|
64
|
+
onBlur = _ref.onBlur,
|
65
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
66
|
+
var inputRef = useRef(null);
|
67
|
+
var _useState = useState(isOpen),
|
68
|
+
_useState2 = _slicedToArray(_useState, 2),
|
69
|
+
isInnerOpen = _useState2[0],
|
70
|
+
setIsInnerOpen = _useState2[1];
|
71
|
+
var _useState3 = useState(formatCalendarValue(defaultDate, format)),
|
72
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
73
|
+
calendarValue = _useState4[0],
|
74
|
+
setCalendarValue = _useState4[1];
|
75
|
+
var _useState5 = useState(formatInputValue(defaultDate, format)),
|
76
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
77
|
+
inputValue = _useState6[0],
|
78
|
+
setInputValue = _useState6[1];
|
79
|
+
var dateFormatDelimiter = useCallback(function () {
|
80
|
+
return getDateFormatDelimiter(format);
|
81
|
+
}, [format]);
|
82
|
+
var _useDatePicker = useDatePicker({
|
83
|
+
currentValue: inputValue,
|
84
|
+
setInputValue: setInputValue,
|
85
|
+
setCalendarValue: setCalendarValue,
|
86
|
+
setIsInnerOpen: setIsInnerOpen,
|
87
|
+
dateFormatDelimiter: dateFormatDelimiter,
|
88
|
+
format: format,
|
89
|
+
disabled: disabled,
|
90
|
+
readOnly: readOnly,
|
91
|
+
maskWithFormat: maskWithFormat,
|
92
|
+
valueError: valueError,
|
93
|
+
valueSuccess: valueSuccess,
|
94
|
+
inputRef: inputRef,
|
95
|
+
onToggle: onToggle,
|
96
|
+
onChangeValue: onChangeValue,
|
97
|
+
onCommitDate: onCommitDate
|
98
|
+
}),
|
99
|
+
datePickerErrorClass = _useDatePicker.datePickerErrorClass,
|
100
|
+
datePickerSuccessClass = _useDatePicker.datePickerSuccessClass,
|
101
|
+
handleToggle = _useDatePicker.handleToggle,
|
102
|
+
handleChangeValue = _useDatePicker.handleChangeValue,
|
103
|
+
handleCommitDate = _useDatePicker.handleCommitDate;
|
104
|
+
var DatePickerInput = /*#__PURE__*/React.createElement(StyledInput, {
|
105
|
+
ref: inputRef,
|
106
|
+
className: cx(datePickerErrorClass, datePickerSuccessClass),
|
107
|
+
value: inputValue,
|
108
|
+
readOnly: readOnly,
|
109
|
+
disabled: disabled,
|
110
|
+
placeholder: placeholder,
|
111
|
+
contentLeft: contentLeft,
|
112
|
+
contentRight: contentRight,
|
113
|
+
textBefore: textBefore,
|
114
|
+
textAfter: textAfter,
|
115
|
+
onChange: handleChangeValue,
|
116
|
+
onSearch: function onSearch(date) {
|
117
|
+
return handleCommitDate(date, true, false);
|
118
|
+
},
|
119
|
+
onFocus: onFocus,
|
120
|
+
onBlur: onBlur
|
121
|
+
});
|
122
|
+
return /*#__PURE__*/React.createElement(Root, _extends({
|
123
|
+
view: view,
|
124
|
+
size: size,
|
125
|
+
className: cx(classes.datePickerRoot, className),
|
126
|
+
disabled: disabled,
|
127
|
+
readOnly: !disabled && readOnly,
|
128
|
+
ref: ref
|
129
|
+
}, rest), label && /*#__PURE__*/React.createElement(StyledLabel, null, label), /*#__PURE__*/React.createElement(StyledPopover, {
|
130
|
+
isOpen: isOpen || isInnerOpen,
|
131
|
+
usePortal: false,
|
132
|
+
onToggle: handleToggle,
|
133
|
+
offset: offset,
|
134
|
+
placement: getPlacements(placement),
|
135
|
+
trigger: "click",
|
136
|
+
closeOnOverlayClick: closeOnOverlayClick,
|
137
|
+
isFocusTrapped: false,
|
138
|
+
target: DatePickerInput,
|
139
|
+
preventOverflow: false
|
140
|
+
}, /*#__PURE__*/React.createElement(StyledCalendar, {
|
141
|
+
size: size,
|
142
|
+
value: calendarValue,
|
143
|
+
type: type,
|
144
|
+
eventList: eventList,
|
145
|
+
disabledList: disabledList,
|
146
|
+
min: min,
|
147
|
+
max: max,
|
148
|
+
includeEdgeDates: includeEdgeDates,
|
149
|
+
isRange: false,
|
150
|
+
onChangeValue: function onChangeValue(date) {
|
151
|
+
return handleCommitDate(date, false, true);
|
152
|
+
}
|
153
|
+
})), leftHelper && /*#__PURE__*/React.createElement(LeftHelper, null, leftHelper));
|
154
|
+
});
|
155
|
+
};
|
156
|
+
export var datePickerConfig = {
|
157
|
+
name: 'DatePicker',
|
158
|
+
tag: 'div',
|
159
|
+
layout: datePickerRoot,
|
160
|
+
base: base,
|
161
|
+
variations: {
|
162
|
+
view: {
|
163
|
+
css: viewCSS
|
164
|
+
},
|
165
|
+
size: {
|
166
|
+
css: sizeCSS
|
167
|
+
},
|
168
|
+
disabled: {
|
169
|
+
css: disabledCSS,
|
170
|
+
attrs: true
|
171
|
+
},
|
172
|
+
readOnly: {
|
173
|
+
css: readOnlyCSS,
|
174
|
+
attrs: true
|
175
|
+
}
|
176
|
+
},
|
177
|
+
defaults: {
|
178
|
+
size: 'm',
|
179
|
+
view: 'default'
|
180
|
+
}
|
181
|
+
};
|