@semcore/date-picker 4.17.0 → 4.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/lib/cjs/DateRangeComparator.js +188 -0
  3. package/lib/cjs/DateRangeComparator.js.map +1 -0
  4. package/lib/cjs/MonthDateRangeComparator.js +223 -0
  5. package/lib/cjs/MonthDateRangeComparator.js.map +1 -0
  6. package/lib/cjs/components/Calendar.js +103 -63
  7. package/lib/cjs/components/Calendar.js.map +1 -1
  8. package/lib/cjs/components/DateRangeComparatorAbstract.js +584 -0
  9. package/lib/cjs/components/DateRangeComparatorAbstract.js.map +1 -0
  10. package/lib/cjs/components/InputTrigger.js +25 -18
  11. package/lib/cjs/components/InputTrigger.js.map +1 -1
  12. package/lib/cjs/components/PickerAbstract.js +25 -18
  13. package/lib/cjs/components/PickerAbstract.js.map +1 -1
  14. package/lib/cjs/components/RangePickerAbstract.js +25 -18
  15. package/lib/cjs/components/RangePickerAbstract.js.map +1 -1
  16. package/lib/cjs/index.d.js.map +1 -1
  17. package/lib/cjs/index.js +17 -1
  18. package/lib/cjs/index.js.map +1 -1
  19. package/lib/cjs/style/calendar.shadow.css +57 -10
  20. package/lib/cjs/style/date-picker.shadow.css +31 -0
  21. package/lib/es6/DateRangeComparator.js +180 -0
  22. package/lib/es6/DateRangeComparator.js.map +1 -0
  23. package/lib/es6/MonthDateRangeComparator.js +215 -0
  24. package/lib/es6/MonthDateRangeComparator.js.map +1 -0
  25. package/lib/es6/components/Calendar.js +103 -63
  26. package/lib/es6/components/Calendar.js.map +1 -1
  27. package/lib/es6/components/DateRangeComparatorAbstract.js +574 -0
  28. package/lib/es6/components/DateRangeComparatorAbstract.js.map +1 -0
  29. package/lib/es6/components/InputTrigger.js +25 -18
  30. package/lib/es6/components/InputTrigger.js.map +1 -1
  31. package/lib/es6/components/PickerAbstract.js +25 -18
  32. package/lib/es6/components/PickerAbstract.js.map +1 -1
  33. package/lib/es6/components/RangePickerAbstract.js +25 -18
  34. package/lib/es6/components/RangePickerAbstract.js.map +1 -1
  35. package/lib/es6/index.d.js.map +1 -1
  36. package/lib/es6/index.js +2 -0
  37. package/lib/es6/index.js.map +1 -1
  38. package/lib/es6/style/calendar.shadow.css +57 -10
  39. package/lib/es6/style/date-picker.shadow.css +31 -0
  40. package/lib/types/index.d.ts +136 -2
  41. package/package.json +5 -4
@@ -1 +1 @@
1
- {"version":3,"file":"RangePickerAbstract.js","names":["React","dayjs","Component","Root","CORE_INSTANCE","sstyled","Button","Box","Flex","Divider","Dropdown","i18nEnhance","localizedMessages","style","_sstyled","insert","INTERACTION_TAGS","defaultDisplayedPeriod","Date","setHours","getEndDate","value","Array","isArray","_value","_slicedToArray","startDate","_value$","endDate","RangePickerAbstract","_Component","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","_key","call","apply","concat","_defineProperty","_assertThisInitialized","dirtyValue","defaultInteraction","direction","displayedPeriod","asProps","action","date","navigateStep","toDate","handlers","navigateView","e","target","currentTarget","_this$asProps","highlighted","state","day","keyDiff","keyCode","setNextDisplayedPeriod","next_highlighted","_next_highlighted","right_period","month_right_period","getMonth","month_displayed_Period","subtract","handleChange","preventDefault","includes","tagName","add","keyStep","_value2","_value2$","setState","_createClass","key","uncontrolledProps","_this2","visible","_this2$asProps$value","undefined","props","_value$2","_value$3","getDefaultPeriods","getButtonTriggerProps","_this$asProps2","size","empty","onKeyDown","handlerKeyDown","setDefaultInteractionToClick","getPopperProps","Picker","_this$asProps3","_this$asProps3$period","periods","unclearable","buttons","createElement","Fragment","Apply","Reset","ml","tabIndex","children","mr","Header","Prev","Title","Calendar","Next","m","orientation","h","Period","mt","getHeaderProps","getTitleProps","index","_this$asProps4","locale","Intl","DateTimeFormat","month","year","format","startOf","getNextProps","onClick","bindHandlerNavigateClick","getI18nText","getPrevProps","getCalendarProps","_props","_this$asProps5","disabled","onHighlightedChange","onVisibleChange","onChange","getPeriodProps","_this$asProps6","_this$asProps6$period","onDisplayedPeriodChange","handleApply","getApplyProps","_this3","_this$asProps7","getResetProps","_this4","render","_ref","_ref4","_this$asProps8","Children","styles","providedAriaLabel","_assignProps","cn","defaultProps","_ref5","defaultValue","i18n","defaultHighlighted","defaultVisible","amount","unit","_ref2","arguments[0]","_assignProps2","_ref3","_assignProps3"],"sources":["../../../src/components/RangePickerAbstract.jsx"],"sourcesContent":["import React from 'react';\nimport dayjs from 'dayjs';\nimport { Component, Root, CORE_INSTANCE, sstyled } from '@semcore/core';\nimport Button from '@semcore/button';\nimport { Box, Flex } from '@semcore/flex-box';\nimport Divider from '@semcore/divider';\nimport Dropdown from '@semcore/dropdown';\nimport i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';\nimport { localizedMessages } from '../translations/__intergalactic-dynamic-locales';\n\nimport style from '../style/date-picker.shadow.css';\n\nconst INTERACTION_TAGS = ['INPUT'];\n\nconst defaultDisplayedPeriod = new Date(new Date().setHours(0, 0, 0, 0));\n\nfunction getEndDate(value) {\n if (!Array.isArray(value)) return null;\n const [startDate, endDate = startDate] = value;\n return endDate;\n}\n\nclass RangePickerAbstract extends Component {\n static displayName = 'DatePicker';\n static style = style;\n\n static defaultProps({ value, defaultValue }) {\n return {\n i18n: localizedMessages,\n locale: 'en',\n defaultDisplayedPeriod:\n getEndDate(value) || getEndDate(defaultValue) || defaultDisplayedPeriod,\n defaultValue: [],\n defaultHighlighted: [],\n defaultVisible: false,\n disabled: [],\n size: 'm',\n };\n }\n\n static enhance = [i18nEnhance(localizedMessages)];\n\n static add = (date, amount, unit) => {\n return dayjs(date).add(amount, unit).toDate();\n };\n\n static subtract = (date, amount, unit) => {\n return dayjs(date).subtract(amount, unit).toDate();\n };\n\n navigateStep;\n keyDiff;\n keyStep;\n\n state = {\n dirtyValue: [],\n // To remove after removing button trigger\n defaultInteraction: 'focus',\n };\n\n uncontrolledProps() {\n return {\n displayedPeriod: null,\n visible: [\n null,\n (visible) => {\n if (!visible) {\n this.handlers.highlighted([]);\n this.setState({ dirtyValue: [] });\n this.handlers.displayedPeriod(\n getEndDate(this.asProps.value ?? undefined) || this.props.defaultDisplayedPeriod,\n );\n }\n },\n ],\n highlighted: null,\n value: [\n null,\n (value) => {\n this.handlers.visible(false);\n this.handlers.displayedPeriod(getEndDate([value[0] ?? undefined, value[1] ?? undefined]));\n },\n ],\n };\n }\n\n navigateView = (direction) => {\n const { displayedPeriod } = this.asProps;\n const action = direction >= 1 ? 'add' : 'subtract';\n const date = dayjs(displayedPeriod)[action](1, this.navigateStep).toDate();\n this.handlers.displayedPeriod(date);\n };\n\n bindHandlerNavigateClick = (direction) => () => this.navigateView(direction);\n\n handlerKeyDown = (e) => {\n if (e.target !== e.currentTarget) return;\n const { displayedPeriod, highlighted } = this.asProps;\n const { dirtyValue } = this.state;\n const day = this.keyDiff[e.keyCode];\n\n const setNextDisplayedPeriod = (next_highlighted) => {\n const [, right_period] = next_highlighted;\n\n if (right_period) {\n const month_right_period = right_period.getMonth();\n const month_displayed_Period = displayedPeriod.getMonth();\n if (month_right_period - month_displayed_Period > 1) {\n return RangePickerAbstract.subtract(right_period, 1, 'month');\n } else if (month_right_period - month_displayed_Period < 0) {\n return right_period;\n }\n }\n return displayedPeriod;\n };\n\n if (e.keyCode === 32 && highlighted.length) {\n this.handleChange(highlighted[1] || highlighted[0]);\n e.preventDefault();\n }\n if (day) {\n if (INTERACTION_TAGS.includes(e.target.tagName)) return;\n if (highlighted.length) {\n let next_highlighted;\n if (dirtyValue.length === 1) {\n next_highlighted = [\n dirtyValue[0],\n dayjs(highlighted[1] || highlighted[0])\n .add(day, this.keyStep)\n .toDate(),\n ];\n } else {\n next_highlighted = [\n dayjs(highlighted[0])\n .add(day, this.keyStep)\n .toDate(),\n ];\n }\n this.handlers.highlighted(next_highlighted);\n this.handlers.displayedPeriod(setNextDisplayedPeriod(next_highlighted));\n } else {\n this.handlers.highlighted([displayedPeriod]);\n }\n e.preventDefault();\n }\n };\n\n handleApply = (value) => {\n const [startDate, endDate = startDate] = value;\n this.handleChange([]);\n this.handlers.value([startDate, endDate]);\n };\n\n handleChange = (date) => {\n let { dirtyValue } = this.state;\n let highlighted = [];\n if (Array.isArray(date)) {\n dirtyValue = date;\n } else if (!dirtyValue.length) {\n dirtyValue = [date];\n highlighted = [date];\n } else if (dirtyValue.length >= 2) {\n dirtyValue = [date];\n highlighted = [date];\n } else if (dirtyValue[0] > date) {\n dirtyValue = [date, dirtyValue[0]];\n } else {\n dirtyValue = [dirtyValue[0], date];\n }\n\n this.setState({ dirtyValue }, () => {\n this.handlers.highlighted(highlighted);\n });\n };\n\n getDefaultPeriods() {\n return [];\n }\n\n setDefaultInteractionToClick = () => {\n if (this.state.defaultInteraction === 'click') return;\n this.setState({ defaultInteraction: 'click' });\n };\n\n getButtonTriggerProps() {\n const { value, size } = this.asProps;\n\n return {\n size,\n empty: !value[0] && !value[1],\n onKeyDown: this.handlerKeyDown,\n setDefaultInteractionToClick: this.setDefaultInteractionToClick,\n };\n }\n\n getPopperProps() {\n const Picker = this[CORE_INSTANCE];\n const { periods = this.getDefaultPeriods(), unclearable } = this.asProps;\n\n const buttons = (\n <>\n <Picker.Apply />\n {!unclearable && <Picker.Reset ml={2} />}\n </>\n );\n\n return {\n tabIndex: 0,\n onKeyDown: this.handlerKeyDown,\n children: (\n <>\n <Flex>\n <Box mr={2}>\n <Picker.Header>\n <Picker.Prev />\n <Picker.Title />\n </Picker.Header>\n <Picker.Calendar />\n </Box>\n <Box ml={2}>\n <Picker.Header>\n <Picker.Title />\n <Picker.Next />\n </Picker.Header>\n <Picker.Calendar />\n </Box>\n {periods.length ? (\n <>\n <Divider m='-16px 16px' orientation='vertical' h='auto' />\n <Flex direction='column'>\n <Picker.Period />\n <Flex mt='auto'>{buttons}</Flex>\n </Flex>\n </>\n ) : (\n <Flex mt={4}>{buttons}</Flex>\n )}\n </Flex>\n </>\n ),\n };\n }\n\n getHeaderProps() {\n const Picker = this[CORE_INSTANCE];\n return {\n children: (\n <>\n <Picker.Prev />\n <Picker.Title />\n <Picker.Next />\n </>\n ),\n };\n }\n\n getTitleProps(props, index) {\n const { locale, displayedPeriod } = this.asProps;\n return {\n children: new Intl.DateTimeFormat(locale, { month: 'long', year: 'numeric' }).format(\n dayjs(displayedPeriod).add(index, this.navigateStep).startOf(this.navigateStep).toDate(),\n ),\n };\n }\n\n getNextProps() {\n return {\n onClick: this.bindHandlerNavigateClick(1),\n getI18nText: this.asProps.getI18nText,\n };\n }\n\n getPrevProps() {\n return {\n onClick: this.bindHandlerNavigateClick(-1),\n getI18nText: this.asProps.getI18nText,\n };\n }\n\n getCalendarProps(_props, index) {\n const {\n locale,\n displayedPeriod,\n disabled,\n value,\n highlighted,\n onHighlightedChange,\n onVisibleChange,\n } = this.asProps;\n const { dirtyValue } = this.state;\n\n return {\n locale,\n displayedPeriod: dayjs(displayedPeriod)\n .add(index, this.navigateStep)\n .startOf(this.navigateStep)\n .toDate(),\n disabled,\n highlighted,\n onHighlightedChange,\n onVisibleChange,\n value: dirtyValue.length ? dirtyValue : value,\n onChange: this.handleChange,\n };\n }\n\n getPeriodProps() {\n const {\n periods = this.getDefaultPeriods(),\n value,\n onHighlightedChange,\n onDisplayedPeriodChange,\n } = this.asProps;\n const { dirtyValue } = this.state;\n return {\n periods,\n value: dirtyValue.length ? dirtyValue : value,\n onChange: this.handleApply,\n onHighlightedChange,\n onDisplayedPeriodChange,\n };\n }\n\n getApplyProps() {\n const { value, getI18nText } = this.asProps;\n const { dirtyValue } = this.state;\n return {\n getI18nText,\n onClick: () => this.handleApply(dirtyValue.length ? dirtyValue : value),\n };\n }\n\n getResetProps() {\n const { getI18nText } = this.asProps;\n return {\n getI18nText,\n onClick: () => this.handleApply([]),\n };\n }\n\n render() {\n const { Children, styles, 'aria-label': providedAriaLabel } = this.asProps;\n const { defaultInteraction } = this.state;\n\n return (\n <>\n {sstyled(styles)(\n <Root\n render={Dropdown}\n use:aria-label={providedAriaLabel}\n interaction={defaultInteraction}\n __excludeProps={['onChange', 'value']}\n >\n <Children />\n </Root>,\n )}\n </>\n );\n }\n}\n\nfunction Apply(props) {\n const { getI18nText } = props;\n return <Root render={Button} use='primary' children={getI18nText('apply')} />;\n}\n\nfunction Reset(props) {\n const { getI18nText } = props;\n return <Root render={Button} use='tertiary' theme='muted' children={getI18nText('reset')} />;\n}\n\nexport { Apply, Reset };\n\nexport default RangePickerAbstract;\n"],"mappings":";;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,IAAI,EAAEC,aAAa,EAAEC,OAAO,QAAQ,eAAe;AACvE,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SAASC,GAAG,EAAEC,IAAI,QAAQ,mBAAmB;AAC7C,OAAOC,OAAO,MAAM,kBAAkB;AACtC,OAAOC,QAAQ,MAAM,mBAAmB;AACxC,OAAOC,WAAW,MAAM,yCAAyC;AACjE,SAASC,iBAAiB,QAAQ,iDAAiD;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAIpF,IAAMC,gBAAgB,GAAG,CAAC,OAAO,CAAC;AAElC,IAAMC,sBAAsB,GAAG,IAAIC,IAAI,CAAC,IAAIA,IAAI,EAAE,CAACC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAExE,SAASC,UAAUA,CAACC,KAAK,EAAE;EACzB,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE,OAAO,IAAI;EACtC,IAAAG,MAAA,GAAAC,cAAA,CAAyCJ,KAAK;IAAvCK,SAAS,GAAAF,MAAA;IAAAG,OAAA,GAAAH,MAAA;IAAEI,OAAO,GAAAD,OAAA,cAAG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,IAAI,EAAK;EACnC,OAAO9K,KAAK,CAACmD,IAAI,CAAC,CAAC0B,GAAG,CAACgG,MAAM,EAAEC,IAAI,CAAC,CAACzH,MAAM,EAAE;AAC/C,CAAC;AAAAV,eAAA,CAtBGf,mBAAmB,cAwBL,UAACuB,IAAI,EAAE0H,MAAM,EAAEC,IAAI,EAAK;EACxC,OAAO9K,KAAK,CAACmD,IAAI,CAAC,CAACqB,QAAQ,CAACqG,MAAM,EAAEC,IAAI,CAAC,CAACzH,MAAM,EAAE;AACpD,CAAC;AAyTH,SAASwD,KAAKA,CAACpB,KAAK,EAAE;EAAA,IAAAsF,KAAA,GAAAC,YAAA;EACpB,IAAQrC,WAAW,GAAKlD,KAAK,CAArBkD,WAAW;EACnB,oBAAO5I,KAAA,CAAA4G,aAAA,CAActG,MAAM,EAAA4K,aAAA;IAAA,OAAM,SAAS;IAAA,YAAWtC,WAAW,CAAC,OAAO;EAAC,GAAAoC,KAAA,EAAI;AAC/E;AAEA,SAASjE,KAAKA,CAACrB,KAAK,EAAE;EAAA,IAAAyF,KAAA,GAAAF,YAAA;EACpB,IAAQrC,WAAW,GAAKlD,KAAK,CAArBkD,WAAW;EACnB,oBAAO5I,KAAA,CAAA4G,aAAA,CAActG,MAAM,EAAA8K,aAAA;IAAA,OAAM,UAAU;IAAA,SAAO,OAAO;IAAA,YAAWxC,WAAW,CAAC,OAAO;EAAC,GAAAuC,KAAA,EAAI;AAC9F;AAEA,SAASrE,KAAK,EAAEC,KAAK;AAErB,eAAelF,mBAAmB"}
1
+ {"version":3,"file":"RangePickerAbstract.js","names":["React","dayjs","Component","Root","CORE_INSTANCE","sstyled","Button","Box","Flex","Divider","Dropdown","i18nEnhance","localizedMessages","style","_sstyled","insert","INTERACTION_TAGS","defaultDisplayedPeriod","Date","setHours","getEndDate","value","Array","isArray","_value","_slicedToArray","startDate","_value$","endDate","RangePickerAbstract","_Component","_inherits","_super","_createSuper","_this","_classCallCheck","_len","arguments","length","args","_key","call","apply","concat","_defineProperty","_assertThisInitialized","dirtyValue","defaultInteraction","direction","displayedPeriod","asProps","action","date","navigateStep","toDate","handlers","navigateView","e","target","currentTarget","_this$asProps","highlighted","state","day","keyDiff","keyCode","setNextDisplayedPeriod","next_highlighted","_next_highlighted","right_period","month_right_period","getMonth","month_displayed_Period","subtract","handleChange","preventDefault","includes","tagName","add","keyStep","_value2","_value2$","setState","_createClass","key","uncontrolledProps","_this2","visible","_this2$asProps$value","undefined","props","_value$2","_value$3","getDefaultPeriods","getButtonTriggerProps","_this$asProps2","size","empty","onKeyDown","handlerKeyDown","setDefaultInteractionToClick","getPopperProps","Picker","_this$asProps3","_this$asProps3$period","periods","unclearable","buttons","createElement","Fragment","Apply","Reset","ml","tabIndex","children","mr","Header","Prev","Title","Calendar","Next","m","orientation","h","Period","mt","getHeaderProps","getTitleProps","index","_this$asProps4","locale","Intl","DateTimeFormat","month","year","format","startOf","getNextProps","onClick","bindHandlerNavigateClick","getI18nText","getPrevProps","getCalendarProps","_props","_this$asProps5","disabled","onHighlightedChange","onVisibleChange","onChange","getPeriodProps","_this$asProps6","_this$asProps6$period","onDisplayedPeriodChange","handleApply","getApplyProps","_this3","_this$asProps7","getResetProps","_this4","render","_ref","_ref4","_this$asProps8","Children","styles","providedAriaLabel","_assignProps","cn","defaultProps","_ref5","defaultValue","i18n","defaultHighlighted","defaultVisible","amount","unit","_ref2","arguments[0]","_assignProps2","_ref3","_assignProps3"],"sources":["../../../src/components/RangePickerAbstract.jsx"],"sourcesContent":["import React from 'react';\nimport dayjs from 'dayjs';\nimport { Component, Root, CORE_INSTANCE, sstyled } from '@semcore/core';\nimport Button from '@semcore/button';\nimport { Box, Flex } from '@semcore/flex-box';\nimport Divider from '@semcore/divider';\nimport Dropdown from '@semcore/dropdown';\nimport i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';\nimport { localizedMessages } from '../translations/__intergalactic-dynamic-locales';\n\nimport style from '../style/date-picker.shadow.css';\n\nconst INTERACTION_TAGS = ['INPUT'];\n\nconst defaultDisplayedPeriod = new Date(new Date().setHours(0, 0, 0, 0));\n\nfunction getEndDate(value) {\n if (!Array.isArray(value)) return null;\n const [startDate, endDate = startDate] = value;\n return endDate;\n}\n\nclass RangePickerAbstract extends Component {\n static displayName = 'DatePicker';\n static style = style;\n\n static defaultProps({ value, defaultValue }) {\n return {\n i18n: localizedMessages,\n locale: 'en',\n defaultDisplayedPeriod:\n getEndDate(value) || getEndDate(defaultValue) || defaultDisplayedPeriod,\n defaultValue: [],\n defaultHighlighted: [],\n defaultVisible: false,\n disabled: [],\n size: 'm',\n };\n }\n\n static enhance = [i18nEnhance(localizedMessages)];\n\n static add = (date, amount, unit) => {\n return dayjs(date).add(amount, unit).toDate();\n };\n\n static subtract = (date, amount, unit) => {\n return dayjs(date).subtract(amount, unit).toDate();\n };\n\n navigateStep;\n keyDiff;\n keyStep;\n\n state = {\n dirtyValue: [],\n // To remove after removing button trigger\n defaultInteraction: 'focus',\n };\n\n uncontrolledProps() {\n return {\n displayedPeriod: null,\n visible: [\n null,\n (visible) => {\n if (!visible) {\n this.handlers.highlighted([]);\n this.setState({ dirtyValue: [] });\n this.handlers.displayedPeriod(\n getEndDate(this.asProps.value ?? undefined) || this.props.defaultDisplayedPeriod,\n );\n }\n },\n ],\n highlighted: null,\n value: [\n null,\n (value) => {\n this.handlers.visible(false);\n this.handlers.displayedPeriod(getEndDate([value[0] ?? undefined, value[1] ?? undefined]));\n },\n ],\n };\n }\n\n navigateView = (direction) => {\n const { displayedPeriod } = this.asProps;\n const action = direction >= 1 ? 'add' : 'subtract';\n const date = dayjs(displayedPeriod)[action](1, this.navigateStep).toDate();\n this.handlers.displayedPeriod(date);\n };\n\n bindHandlerNavigateClick = (direction) => () => this.navigateView(direction);\n\n handlerKeyDown = (e) => {\n if (e.target !== e.currentTarget) return;\n const { displayedPeriod, highlighted } = this.asProps;\n const { dirtyValue } = this.state;\n const day = this.keyDiff[e.keyCode];\n\n const setNextDisplayedPeriod = (next_highlighted) => {\n const [, right_period] = next_highlighted;\n\n if (right_period) {\n const month_right_period = right_period.getMonth();\n const month_displayed_Period = displayedPeriod.getMonth();\n if (month_right_period - month_displayed_Period > 1) {\n return RangePickerAbstract.subtract(right_period, 1, 'month');\n } else if (month_right_period - month_displayed_Period < 0) {\n return right_period;\n }\n }\n return displayedPeriod;\n };\n\n if (e.keyCode === 32 && highlighted.length) {\n this.handleChange(highlighted[1] || highlighted[0]);\n e.preventDefault();\n }\n if (day) {\n if (INTERACTION_TAGS.includes(e.target.tagName)) return;\n if (highlighted.length) {\n let next_highlighted;\n if (dirtyValue.length === 1) {\n next_highlighted = [\n dirtyValue[0],\n dayjs(highlighted[1] || highlighted[0])\n .add(day, this.keyStep)\n .toDate(),\n ];\n } else {\n next_highlighted = [\n dayjs(highlighted[0])\n .add(day, this.keyStep)\n .toDate(),\n ];\n }\n this.handlers.highlighted(next_highlighted);\n this.handlers.displayedPeriod(setNextDisplayedPeriod(next_highlighted));\n } else {\n this.handlers.highlighted([displayedPeriod]);\n }\n e.preventDefault();\n }\n };\n\n handleApply = (value) => {\n const [startDate, endDate = startDate] = value;\n this.handleChange([]);\n this.handlers.value([startDate, endDate]);\n };\n\n handleChange = (date) => {\n let { dirtyValue } = this.state;\n let highlighted = [];\n if (Array.isArray(date)) {\n dirtyValue = date;\n } else if (!dirtyValue.length) {\n dirtyValue = [date];\n highlighted = [date];\n } else if (dirtyValue.length >= 2) {\n dirtyValue = [date];\n highlighted = [date];\n } else if (dirtyValue[0] > date) {\n dirtyValue = [date, dirtyValue[0]];\n } else {\n dirtyValue = [dirtyValue[0], date];\n }\n\n this.setState({ dirtyValue }, () => {\n this.handlers.highlighted(highlighted);\n });\n };\n\n getDefaultPeriods() {\n return [];\n }\n\n setDefaultInteractionToClick = () => {\n if (this.state.defaultInteraction === 'click') return;\n this.setState({ defaultInteraction: 'click' });\n };\n\n getButtonTriggerProps() {\n const { value, size } = this.asProps;\n\n return {\n size,\n empty: !value[0] && !value[1],\n onKeyDown: this.handlerKeyDown,\n setDefaultInteractionToClick: this.setDefaultInteractionToClick,\n };\n }\n\n getPopperProps() {\n const Picker = this[CORE_INSTANCE];\n const { periods = this.getDefaultPeriods(), unclearable } = this.asProps;\n\n const buttons = (\n <>\n <Picker.Apply />\n {!unclearable && <Picker.Reset ml={2} />}\n </>\n );\n\n return {\n tabIndex: 0,\n onKeyDown: this.handlerKeyDown,\n children: (\n <>\n <Flex>\n <Box mr={2}>\n <Picker.Header>\n <Picker.Prev />\n <Picker.Title />\n </Picker.Header>\n <Picker.Calendar />\n </Box>\n <Box ml={2}>\n <Picker.Header>\n <Picker.Title />\n <Picker.Next />\n </Picker.Header>\n <Picker.Calendar />\n </Box>\n {periods.length ? (\n <>\n <Divider m='-16px 16px' orientation='vertical' h='auto' />\n <Flex direction='column'>\n <Picker.Period />\n <Flex mt='auto'>{buttons}</Flex>\n </Flex>\n </>\n ) : (\n <Flex mt={4}>{buttons}</Flex>\n )}\n </Flex>\n </>\n ),\n };\n }\n\n getHeaderProps() {\n const Picker = this[CORE_INSTANCE];\n return {\n children: (\n <>\n <Picker.Prev />\n <Picker.Title />\n <Picker.Next />\n </>\n ),\n };\n }\n\n getTitleProps(props, index) {\n const { locale, displayedPeriod } = this.asProps;\n return {\n children: new Intl.DateTimeFormat(locale, { month: 'long', year: 'numeric' }).format(\n dayjs(displayedPeriod).add(index, this.navigateStep).startOf(this.navigateStep).toDate(),\n ),\n };\n }\n\n getNextProps() {\n return {\n onClick: this.bindHandlerNavigateClick(1),\n getI18nText: this.asProps.getI18nText,\n };\n }\n\n getPrevProps() {\n return {\n onClick: this.bindHandlerNavigateClick(-1),\n getI18nText: this.asProps.getI18nText,\n };\n }\n\n getCalendarProps(_props, index) {\n const {\n locale,\n displayedPeriod,\n disabled,\n value,\n highlighted,\n onHighlightedChange,\n onVisibleChange,\n } = this.asProps;\n const { dirtyValue } = this.state;\n\n return {\n locale,\n displayedPeriod: dayjs(displayedPeriod)\n .add(index, this.navigateStep)\n .startOf(this.navigateStep)\n .toDate(),\n disabled,\n highlighted,\n onHighlightedChange,\n onVisibleChange,\n value: dirtyValue.length ? dirtyValue : value,\n onChange: this.handleChange,\n };\n }\n\n getPeriodProps() {\n const {\n periods = this.getDefaultPeriods(),\n value,\n onHighlightedChange,\n onDisplayedPeriodChange,\n } = this.asProps;\n const { dirtyValue } = this.state;\n return {\n periods,\n value: dirtyValue.length ? dirtyValue : value,\n onChange: this.handleApply,\n onHighlightedChange,\n onDisplayedPeriodChange,\n };\n }\n\n getApplyProps() {\n const { value, getI18nText } = this.asProps;\n const { dirtyValue } = this.state;\n return {\n getI18nText,\n onClick: () => this.handleApply(dirtyValue.length ? dirtyValue : value),\n };\n }\n\n getResetProps() {\n const { getI18nText } = this.asProps;\n return {\n getI18nText,\n onClick: () => this.handleApply([]),\n };\n }\n\n render() {\n const { Children, styles, 'aria-label': providedAriaLabel } = this.asProps;\n const { defaultInteraction } = this.state;\n\n return (\n <>\n {sstyled(styles)(\n <Root\n render={Dropdown}\n use:aria-label={providedAriaLabel}\n interaction={defaultInteraction}\n __excludeProps={['onChange', 'value']}\n >\n <Children />\n </Root>,\n )}\n </>\n );\n }\n}\n\nfunction Apply(props) {\n const { getI18nText } = props;\n return <Root render={Button} use='primary' children={getI18nText('apply')} />;\n}\n\nfunction Reset(props) {\n const { getI18nText } = props;\n return <Root render={Button} use='tertiary' theme='muted' children={getI18nText('reset')} />;\n}\n\nexport { Apply, Reset };\n\nexport default RangePickerAbstract;\n"],"mappings":";;;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,IAAI,EAAEC,aAAa,EAAEC,OAAO,QAAQ,eAAe;AACvE,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SAASC,GAAG,EAAEC,IAAI,QAAQ,mBAAmB;AAC7C,OAAOC,OAAO,MAAM,kBAAkB;AACtC,OAAOC,QAAQ,MAAM,mBAAmB;AACxC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AAS;IAAA,YAAWtC,WAAW,CAAC,OAAO;EAAC,GAAAoC,KAAA,EAAI;AAC/E;AAEA,SAASjE,KAAKA,CAACrB,KAAK,EAAE;EAAA,IAAAyF,KAAA,GAAAF,YAAA;EACpB,IAAQrC,WAAW,GAAKlD,KAAK,CAArBkD,WAAW;EACnB,oBAAO5I,KAAA,CAAA4G,aAAA,CAActG,MAAM,EAAA8K,aAAA;IAAA,OAAM,UAAU;IAAA,SAAO,OAAO;IAAA,YAAWxC,WAAW,CAAC,OAAO;EAAC,GAAAuC,KAAA,EAAI;AAC9F;AAEA,SAASrE,KAAK,EAAEC,KAAK;AAErB,eAAelF,mBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React, { ChangeEvent, ComponentProps } from 'react';\nimport dayjs from 'dayjs';\nimport { Box, BoxProps } from '@semcore/flex-box';\nimport { UnknownProperties, Intergalactic, PropGetterFn } from '@semcore/core';\nimport Button, { ButtonProps } from '@semcore/button';\nimport Dropdown, { DropdownProps, DropdownTriggerProps } from '@semcore/dropdown';\nimport { WithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';\nimport BaseTrigger, { BaseTriggerProps } from '@semcore/base-trigger';\nimport Input, { InputProps, InputValueProps } from '@semcore/input';\nimport { InputMaskValueProps } from '@semcore/input-mask';\n\nexport type DateConstructorParams = string | number | Date;\n\n/** @deprecated */\nexport interface ICalendarProps extends CalendarProps, UnknownProperties {}\nexport type CalendarProps = BoxProps & {\n /**\n * Locale for displaying the days of a week and months, to be transferred to `Intl`\n * @default en\n * */\n locale?: NavigatorLanguage['language'];\n /**\n * Array of dates blocked for selection\n * Accepts the date or the range of dates for specifying infinity ([Date | false, Date | false]), crontab(6,7)\n * */\n disabled?: (Date | (Date | false)[] | string)[];\n /**\n * @ignore\n * */\n highlighted?: DateConstructorParams[];\n /**\n * @ignore\n * */\n onHighlightedChange?: (date: Date[]) => void;\n /**\n * The selected date, accepts everything which is accepted by `new Date()`\n * */\n value?: DateConstructorParams[];\n /**\n * To be activated upon selecting the date\n * */\n onChange?: (date: Date[]) => void;\n /**\n * Date for showing the necessary month\n * @default new Date()\n * */\n displayedPeriod?: Date;\n\n renderOutdated?: boolean;\n};\n\n/** @deprecated */\nexport interface ICalendarDaysContext extends CalendarDaysContext, UnknownProperties {}\nexport type CalendarDaysContext = {\n days: CalendarUnitProps[];\n};\n\n/** @deprecated */\nexport interface ICalendarMonthsContext extends CalendarMonthsContext, UnknownProperties {}\nexport type CalendarMonthsContext = {\n months: CalendarUnitProps[];\n};\n\n/** @deprecated */\nexport interface ICalendarUnitProps extends CalendarUnitProps, UnknownProperties {}\nexport type CalendarUnitProps = BoxProps & {\n selected?: boolean;\n outdated?: boolean;\n disabled?: boolean;\n today?: boolean;\n startSelected?: boolean;\n endSelected?: boolean;\n highlighted?: boolean;\n startHighlighted?: boolean;\n endHighlighted?: boolean;\n date?: Date;\n children?: React.ReactNode;\n};\n\n/** @deprecated */\nexport interface ICalendarContext extends CalendarContext, UnknownProperties {}\nexport type CalendarContext = {\n getUnitProps: PropGetterFn;\n};\n\ndeclare const Calendar: Intergalactic.Component<\n 'div',\n CalendarProps,\n CalendarContext & CalendarDaysContext,\n [handlers: AbstractDatePickerHandlers]\n> & {\n Unit: Intergalactic.Component<'div', CalendarUnitProps>;\n};\n\n/** @deprecated */\nexport interface IDatePickerProps extends DatePickerProps, UnknownProperties {}\nexport type DatePickerProps = DropdownProps &\n WithI18nEnhanceProps & {\n /**\n * The selected date, accepts everything which is accepted by `new Date()`\n * */\n value?: DateConstructorParams;\n /**\n * To be activated upon selecting the date\n * */\n onChange?: (date: Date) => void;\n /**\n * Array of dates blocked for selection\n * */\n disabled?: (Date | (Date | false)[] | string)[];\n /**\n * Date for showing the necessary month\n * @default new Date()\n * */\n displayedPeriod?: DateConstructorParams;\n /**\n * To be activated upon changing the current shown month\n * */\n onDisplayedPeriodChange?: (date: Date) => void;\n /**\n * Component size\n * @default m\n */\n size?: 'm' | 'l';\n /**\n * The selected date, accepts everything which is accepted by `new Date()`\n * */\n highlighted?: DateConstructorParams[];\n /**\n * Default value selected date, accepts everything which is accepted by `new Date()`\n * */\n defaultValue?: DateConstructorParams;\n /**\n * Default value date for showing the necessary month\n * */\n defaultDisplayedPeriod?: DateConstructorParams;\n /**\n * Default value selected date, accepts everything which is accepted by `new Date()`\n * */\n defaultHighlighted?: DateConstructorParams[];\n };\n\n/** @deprecated */\nexport interface IDateRangePickerProps extends DateRangePickerProps, UnknownProperties {}\nexport type DateRangePickerProps = DropdownProps &\n WithI18nEnhanceProps & {\n /**\n * The selected date, accepts everything which is accepted by `new Date()`\n * */\n value?: DateConstructorParams[];\n /**\n * Default value selected date, accepts everything which is accepted by `new Date()`\n * */\n defaultValue?: DateConstructorParams[];\n /**\n * Default value date for showing the necessary month\n * */\n defaultDisplayedPeriod?: DateConstructorParams;\n /**\n * Default value selected date, accepts everything which is accepted by `new Date()`\n * */\n defaultHighlighted?: DateConstructorParams[];\n /**\n * To be activated upon selecting the date\n * */\n onChange?: (date: Date[]) => void;\n /**\n * Array of dates blocked for selection\n * */\n disabled?: (Date | (Date | false)[] | string)[];\n /**\n * Date for showing the necessary month\n * @default new Date()\n * */\n displayedPeriod?: DateConstructorParams;\n /**\n * To be activated upon changing the current shown month\n * */\n onDisplayedPeriodChange?: (date: Date) => void;\n /**\n * Component size\n * @default m\n */\n size?: 'm' | 'l' | 'xl';\n /**\n * The selected date, accepts everything which is accepted by `new Date()`\n * */\n highlighted?: DateConstructorParams[];\n /**\n * Remove the 'Reset' button\n * */\n unclearable?: boolean;\n /**\n * To be activated upon selecting the date\n * */\n onHighlightedChange?: (date: Date[]) => void;\n /**\n * Array of periods\n * [{value: [new Date(), new Date()], children: \"Today\"}]\n * @default Past 2 days / Past week / Past 2 week / Past month / Past 2 month\n * */\n periods?: (ButtonProps & { value: Date[] })[];\n };\n\n/** @deprecated */\nexport interface IDateRangePickerPeriodProps\n extends DateRangePickerPeriodProps,\n UnknownProperties {}\nexport type DateRangePickerPeriodProps = BoxProps & {\n /**\n * Current selected period\n * */\n value?: DateConstructorParams[];\n /**\n * To be activated by clicking the button for switching the selected period.\n * */\n onChange?: (date: Date[]) => void;\n /**\n * To be activated by hovering a cursor over the button for changing the current displayed month.\n * */\n onDisplayedPeriodChange?: (date: Date) => void;\n /**\n * To be activated by hovering a cursor over the button for selecting the dates.\n * */\n onHighlightedChange?: (date: Date[]) => void;\n /**\n * Array of periods\n * [{value: [new Date(), new Date()], children: \"Today\"}]\n * @default Past 2 days / Past week / Past 2 week / Past month / Past 2 month\n * */\n periods?: (ButtonProps & { value: Date[] })[];\n};\n\n/** @deprecated */\nexport interface IDatePickerContext extends DatePickerContext, UnknownProperties {}\nexport type DatePickerContext = {\n getTriggerProps: PropGetterFn;\n getPopperProps: PropGetterFn;\n getHeaderProps: PropGetterFn;\n getTitleProps: PropGetterFn;\n getNextProps: PropGetterFn;\n getPrevProps: PropGetterFn;\n getCalendarProps: PropGetterFn;\n getTodayProps: PropGetterFn;\n};\n\n/** @deprecated */\nexport interface IAbstractDatePickerHandlers\n extends AbstractDatePickerHandlers,\n UnknownProperties {}\nexport type AbstractDatePickerHandlers = {\n displayedPeriod: (value: DateConstructorParams) => void;\n visible: (index: boolean) => void;\n highlighted: (list: DateConstructorParams[]) => void;\n value: (index: DateConstructorParams) => void;\n};\n\n/** @deprecated */\nexport interface IDatePickerHandlers extends DatePickerHandlers, UnknownProperties {}\nexport type DatePickerHandlers = {\n visible: (index: boolean) => void;\n};\n\n/** @deprecated */\nexport interface IInputTriggerProps extends InputTriggerProps, UnknownProperties {}\ntype BaseInputTriggerProps = InputProps & {\n /**\n * Date input placeholder characters\n * @default { year: 'Y'; month: 'M'; day: 'D' }\n */\n placeholders?: { year: string; month: string; day: string };\n locale?: string;\n onDisplayedPeriodChange?: (date: Date) => void;\n};\nexport type InputTriggerProps = BaseInputTriggerProps & {\n value?: Date;\n onChange?: (date: Date, event: ChangeEvent) => void;\n};\n\nexport type RangeInputTriggerProps = BaseInputTriggerProps & {\n value?: Date[];\n onChange?: (date: Date[], event: ChangeEvent) => void;\n};\n\n/** @deprecated */\nexport interface ISingleDateInputProps extends SingleDateInputProps, UnknownProperties {}\nexport type SingleDateInputProps = InputTriggerProps & {};\n\n/** @deprecated */\nexport interface IDateRangeProps extends DateRangeProps, UnknownProperties {}\nexport type DateRangeProps = RangeInputTriggerProps & {};\n\n/** @deprecated */\nexport interface IDatePickerMaskedInputProps\n extends DatePickerMaskedInputProps,\n UnknownProperties {}\nexport type DatePickerMaskedInputProps = {\n date?: Date;\n onDateChange?: (date: Date, event: ChangeEvent) => void;\n onDisplayedPeriodChange?: (date: Date) => void;\n locale?: string;\n parts?: { year: Boolean; month: Boolean; day: Boolean };\n disabledDates?: (Date | (Date | false)[] | string)[];\n};\n\ndeclare const InputTrigger: Intergalactic.Component<\n 'div',\n DropdownTriggerProps & InputTriggerProps\n> & {\n Addon: typeof Input.Addon;\n Value: typeof Input.Value;\n SingleDateInput: Intergalactic.Component<'div', InputProps & SingleDateInputProps> & {\n Indicator: typeof Input.Addon;\n MaskedInput: Intergalactic.Component<'input', InputMaskValueProps & DatePickerMaskedInputProps>;\n };\n};\n\ndeclare const RangeInputTrigger: Intergalactic.Component<\n 'div',\n DropdownTriggerProps & RangeInputTriggerProps\n> & {\n Addon: typeof Input.Addon;\n Value: typeof Input.Value;\n DateRange: Intergalactic.Component<'div', InputValueProps & DateRangeProps> & {\n Indicator: typeof Input.Addon;\n RangeSep: typeof Input.Addon;\n FromMaskedInput: Intergalactic.Component<\n 'input',\n InputMaskValueProps & DatePickerMaskedInputProps\n >;\n ToMaskedInput: Intergalactic.Component<\n 'input',\n InputMaskValueProps & DatePickerMaskedInputProps\n >;\n };\n};\n\ndeclare const DatePicker: Intergalactic.Component<\n 'div',\n DatePickerProps,\n DatePickerContext & CalendarDaysContext\n> & {\n /** @deprecated `DatePicker.ButtonTrigger` is deprecated, consider migrating to `DatePicker.Trigger` instead */\n ButtonTrigger: Intergalactic.Component<'div', DropdownTriggerProps & BaseTriggerProps> & {\n Addon: typeof BaseTrigger.Addon;\n Text: typeof BaseTrigger.Text;\n };\n Trigger: typeof InputTrigger;\n Popper: typeof Dropdown.Popper;\n Header: typeof Box;\n Title: Intergalactic.Component<'div', DatePickerProps, DatePickerContext>;\n Prev: typeof Button;\n Next: typeof Button;\n Calendar: typeof Calendar;\n Today: typeof Box;\n add: (date: number | Date, amount: number, unit: dayjs.OpUnitType) => Date;\n subtract: (date: number | Date, amount: number, unit: dayjs.OpUnitType) => Date;\n};\n\n/** @deprecated */\nexport interface IDateRangePickerContext extends DateRangePickerContext, UnknownProperties {}\nexport type DateRangePickerContext = {\n getTriggerProps: PropGetterFn;\n getPopperProps: PropGetterFn;\n getHeaderProps: PropGetterFn;\n getTitleProps: PropGetterFn;\n getNextProps: PropGetterFn;\n getPrevProps: PropGetterFn;\n getCalendarProps: PropGetterFn;\n getPeriodProps: PropGetterFn;\n};\n\ndeclare const DateRangePicker: Intergalactic.Component<\n 'div',\n DateRangePickerProps,\n DateRangePickerContext & CalendarDaysContext,\n [handlers: DatePickerHandlers]\n> & {\n /** @deprecated `DatePicker.ButtonTrigger` is deprecated, consider migrating to `DatePicker.Trigger` instead */\n ButtonTrigger: Intergalactic.Component<'div', DropdownTriggerProps & BaseTriggerProps> & {\n Addon: typeof BaseTrigger.Addon;\n Text: typeof BaseTrigger.Text;\n };\n Trigger: typeof RangeInputTrigger;\n Popper: typeof Dropdown.Popper;\n Header: typeof Box;\n Title: Intergalactic.Component<'div', DateRangePickerProps, DateRangePickerContext>;\n Prev: typeof Button;\n Next: typeof Button;\n Calendar: typeof Calendar;\n Period: Intergalactic.Component<'div', DateRangePickerPeriodProps>;\n Apply: typeof Button;\n Reset: typeof Button;\n add: (date: number | Date, amount: number, unit: dayjs.OpUnitType) => Date;\n subtract: (date: number | Date, amount: number, unit: dayjs.OpUnitType) => Date;\n};\n\n/** @deprecated */\nexport interface IMonthPickerContext extends MonthPickerContext, UnknownProperties {}\nexport type MonthPickerContext = {\n getTriggerProps: PropGetterFn;\n getPopperProps: PropGetterFn;\n getHeaderProps: PropGetterFn;\n getTitleProps: PropGetterFn;\n getNextProps: PropGetterFn;\n getPrevProps: PropGetterFn;\n getCalendarProps: PropGetterFn;\n};\n\ndeclare const MonthPicker: Intergalactic.Component<\n 'div',\n DatePickerProps,\n MonthPickerContext & CalendarMonthsContext,\n [handlers: DatePickerHandlers]\n> & {\n /** @deprecated `DatePicker.ButtonTrigger` is deprecated, consider migrating to `DatePicker.Trigger` instead */\n ButtonTrigger: Intergalactic.Component<'div', DropdownTriggerProps & BaseTriggerProps> & {\n Addon: typeof BaseTrigger.Addon;\n Text: typeof BaseTrigger.Text;\n };\n Trigger: typeof InputTrigger;\n Popper: typeof Dropdown.Popper;\n Header: typeof Box;\n Title: Intergalactic.Component<'div', DatePickerProps, MonthPickerContext>;\n Prev: typeof Button;\n Next: typeof Button;\n Calendar: typeof Calendar;\n add: (date: number | Date, amount: number, unit: dayjs.OpUnitType) => Date;\n subtract: (date: number | Date, amount: number, unit: dayjs.OpUnitType) => Date;\n};\n\n/** @deprecated */\nexport interface IMonthRangePickerContext extends MonthRangePickerContext, UnknownProperties {}\nexport type MonthRangePickerContext = {\n getTriggerProps: PropGetterFn;\n getPopperProps: PropGetterFn;\n getHeaderProps: PropGetterFn;\n getTitleProps: PropGetterFn;\n getNextProps: PropGetterFn;\n getPrevProps: PropGetterFn;\n getCalendarProps: PropGetterFn;\n getPeriodProps: PropGetterFn;\n};\n\ndeclare const MonthRangePicker: Intergalactic.Component<\n 'div',\n DateRangePickerProps,\n MonthRangePickerContext & CalendarMonthsContext,\n [handlers: DatePickerHandlers]\n> & {\n /** @deprecated `DatePicker.ButtonTrigger` is deprecated, consider migrating to `DatePicker.Trigger` instead */\n ButtonTrigger: Intergalactic.Component<'div', DropdownTriggerProps & BaseTriggerProps> & {\n Addon: typeof BaseTrigger.Addon;\n Text: typeof BaseTrigger.Text;\n };\n Trigger: typeof RangeInputTrigger;\n Popper: typeof Dropdown.Popper;\n Header: typeof Box;\n Title: Intergalactic.Component<'div', DateRangePickerProps, MonthRangePickerContext>;\n Prev: typeof Button;\n Next: typeof Button;\n Calendar: typeof Calendar;\n Period: Intergalactic.Component<'div', DateRangePickerPeriodProps>;\n Apply: typeof Button;\n Reset: typeof Button;\n add: (date: number | Date, amount: number, unit: dayjs.OpUnitType) => Date;\n subtract: (date: number | Date, amount: number, unit: dayjs.OpUnitType) => Date;\n};\n\nexport { DatePicker, DateRangePicker, MonthPicker, MonthRangePicker };\n"],"mappings":""}
1
+ {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React, { ChangeEvent, ComponentProps } from 'react';\nimport dayjs from 'dayjs';\nimport { Flex, Box, BoxProps } from '@semcore/flex-box';\nimport { UnknownProperties, Intergalactic, PropGetterFn } from '@semcore/core';\nimport Button, { ButtonProps } from '@semcore/button';\nimport Dropdown, { DropdownProps, DropdownTriggerProps } from '@semcore/dropdown';\nimport { WithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';\nimport BaseTrigger, { BaseTriggerProps } from '@semcore/base-trigger';\nimport Input, { InputProps, InputValueProps } from '@semcore/input';\nimport { InputMaskValueProps } from '@semcore/input-mask';\nimport Checkbox from '@semcore/checkbox';\n\nexport type DateConstructorParams = string | number | Date;\n\n/** @deprecated */\nexport interface ICalendarProps extends CalendarProps, UnknownProperties {}\nexport type CalendarProps = BoxProps & {\n /**\n * Locale for displaying the days of a week and months, to be transferred to `Intl`\n * @default en\n * */\n locale?: NavigatorLanguage['language'];\n /**\n * Array of dates blocked for selection\n * Accepts the date or the range of dates for specifying infinity ([Date | false, Date | false]), crontab(6,7)\n * */\n disabled?: (Date | (Date | false)[] | string)[];\n /**\n * @ignore\n * */\n highlighted?: DateConstructorParams[];\n /**\n * @ignore\n * */\n onHighlightedChange?: (date: Date[]) => void;\n /**\n * The selected date, accepts everything which is accepted by `new Date()`\n * */\n value?: DateConstructorParams[];\n /**\n * To be activated upon selecting the date\n * */\n onChange?: (date: Date[]) => void;\n /**\n * Date for showing the necessary month\n * @default new Date()\n * */\n displayedPeriod?: Date;\n\n renderOutdated?: boolean;\n};\n\n/** @deprecated */\nexport interface ICalendarDaysContext extends CalendarDaysContext, UnknownProperties {}\nexport type CalendarDaysContext = {\n days: CalendarUnitProps[];\n};\n\n/** @deprecated */\nexport interface ICalendarMonthsContext extends CalendarMonthsContext, UnknownProperties {}\nexport type CalendarMonthsContext = {\n months: CalendarUnitProps[];\n};\n\n/** @deprecated */\nexport interface ICalendarUnitProps extends CalendarUnitProps, UnknownProperties {}\nexport type CalendarUnitProps = BoxProps & {\n selected?: boolean;\n outdated?: boolean;\n disabled?: boolean;\n today?: boolean;\n startSelected?: boolean;\n endSelected?: boolean;\n highlighted?: boolean;\n startHighlighted?: boolean;\n endHighlighted?: boolean;\n date?: Date;\n children?: React.ReactNode;\n};\n\n/** @deprecated */\nexport interface ICalendarContext extends CalendarContext, UnknownProperties {}\nexport type CalendarContext = {\n getUnitProps: PropGetterFn;\n};\n\ndeclare const Calendar: Intergalactic.Component<\n 'div',\n CalendarProps,\n CalendarContext & CalendarDaysContext,\n [handlers: AbstractDatePickerHandlers]\n> & {\n Unit: Intergalactic.Component<'div', CalendarUnitProps>;\n};\n\n/** @deprecated */\nexport interface IDatePickerProps extends DatePickerProps, UnknownProperties {}\nexport type DatePickerProps = DropdownProps &\n WithI18nEnhanceProps & {\n /**\n * The selected date, accepts everything which is accepted by `new Date()`\n * */\n value?: DateConstructorParams;\n /**\n * To be activated upon selecting the date\n * */\n onChange?: (date: Date) => void;\n /**\n * Array of dates blocked for selection\n * */\n disabled?: (Date | (Date | false)[] | string)[];\n /**\n * Date for showing the necessary month\n * @default new Date()\n * */\n displayedPeriod?: DateConstructorParams;\n /**\n * To be activated upon changing the current shown month\n * */\n onDisplayedPeriodChange?: (date: Date) => void;\n /**\n * Component size\n * @default m\n */\n size?: 'm' | 'l';\n /**\n * The selected date, accepts everything which is accepted by `new Date()`\n * */\n highlighted?: DateConstructorParams[];\n /**\n * Default value selected date, accepts everything which is accepted by `new Date()`\n * */\n defaultValue?: DateConstructorParams;\n /**\n * Default value date for showing the necessary month\n * */\n defaultDisplayedPeriod?: DateConstructorParams;\n /**\n * Default value selected date, accepts everything which is accepted by `new Date()`\n * */\n defaultHighlighted?: DateConstructorParams[];\n };\n\n/** @deprecated */\nexport interface IDateRangePickerProps extends DateRangePickerProps, UnknownProperties {}\nexport type DateRangePickerProps = DropdownProps &\n WithI18nEnhanceProps & {\n /**\n * The selected date, accepts everything which is accepted by `new Date()`\n * */\n value?: DateConstructorParams[];\n /**\n * Default value selected date, accepts everything which is accepted by `new Date()`\n * */\n defaultValue?: DateConstructorParams[];\n /**\n * Default value date for showing the necessary month\n * */\n defaultDisplayedPeriod?: DateConstructorParams;\n /**\n * Default value selected date, accepts everything which is accepted by `new Date()`\n * */\n defaultHighlighted?: DateConstructorParams[];\n /**\n * To be activated upon selecting the date\n * */\n onChange?: (date: Date[]) => void;\n /**\n * Array of dates blocked for selection\n * */\n disabled?: (Date | (Date | false)[] | string)[];\n /**\n * Date for showing the necessary month\n * @default new Date()\n * */\n displayedPeriod?: DateConstructorParams;\n /**\n * To be activated upon changing the current shown month\n * */\n onDisplayedPeriodChange?: (date: Date) => void;\n /**\n * Component size\n * @default m\n */\n size?: 'm' | 'l' | 'xl';\n /**\n * The selected date, accepts everything which is accepted by `new Date()`\n * */\n highlighted?: DateConstructorParams[];\n /**\n * Remove the 'Reset' button\n * */\n unclearable?: boolean;\n /**\n * To be activated upon selecting the date\n * */\n onHighlightedChange?: (date: Date[]) => void;\n /**\n * Array of periods\n * [{value: [new Date(), new Date()], children: \"Today\"}]\n * @default Past 2 days / Past week / Past 2 week / Past month / Past 2 month\n * */\n periods?: (ButtonProps & { value: Date[] })[];\n };\n\n/** @deprecated */\nexport interface IDateRangePickerPeriodProps\n extends DateRangePickerPeriodProps,\n UnknownProperties {}\nexport type DateRangePickerPeriodProps = BoxProps & {\n /**\n * Current selected period\n * */\n value?: DateConstructorParams[];\n /**\n * To be activated by clicking the button for switching the selected period.\n * */\n onChange?: (date: Date[]) => void;\n /**\n * To be activated by hovering a cursor over the button for changing the current displayed month.\n * */\n onDisplayedPeriodChange?: (date: Date) => void;\n /**\n * To be activated by hovering a cursor over the button for selecting the dates.\n * */\n onHighlightedChange?: (date: Date[]) => void;\n /**\n * Array of periods\n * [{value: [new Date(), new Date()], children: \"Today\"}]\n * @default Past 2 days / Past week / Past 2 week / Past month / Past 2 month\n * */\n periods?: (ButtonProps & { value: Date[] })[];\n};\n\n/** @deprecated */\nexport interface IDatePickerContext extends DatePickerContext, UnknownProperties {}\nexport type DatePickerContext = {\n getTriggerProps: PropGetterFn;\n getPopperProps: PropGetterFn;\n getHeaderProps: PropGetterFn;\n getTitleProps: PropGetterFn;\n getNextProps: PropGetterFn;\n getPrevProps: PropGetterFn;\n getCalendarProps: PropGetterFn;\n getTodayProps: PropGetterFn;\n};\n\n/** @deprecated */\nexport interface IAbstractDatePickerHandlers\n extends AbstractDatePickerHandlers,\n UnknownProperties {}\nexport type AbstractDatePickerHandlers = {\n displayedPeriod: (value: DateConstructorParams) => void;\n visible: (index: boolean) => void;\n highlighted: (list: DateConstructorParams[]) => void;\n value: (index: DateConstructorParams) => void;\n};\n\n/** @deprecated */\nexport interface IDatePickerHandlers extends DatePickerHandlers, UnknownProperties {}\nexport type DatePickerHandlers = {\n visible: (index: boolean) => void;\n};\n\n/** @deprecated */\nexport interface IInputTriggerProps extends InputTriggerProps, UnknownProperties {}\ntype BaseInputTriggerProps = InputProps & {\n /**\n * Date input placeholder characters\n * @default { year: 'Y'; month: 'M'; day: 'D' }\n */\n placeholders?: { year: string; month: string; day: string };\n locale?: string;\n onDisplayedPeriodChange?: (date: Date) => void;\n};\nexport type InputTriggerProps = BaseInputTriggerProps & {\n value?: Date;\n onChange?: (date: Date, event: ChangeEvent) => void;\n};\n\nexport type RangeInputTriggerProps = BaseInputTriggerProps & {\n value?: Date[];\n onChange?: (date: Date[], event: ChangeEvent) => void;\n};\n\n/** @deprecated */\nexport interface ISingleDateInputProps extends SingleDateInputProps, UnknownProperties {}\nexport type SingleDateInputProps = InputTriggerProps & {};\n\n/** @deprecated */\nexport interface IDateRangeProps extends DateRangeProps, UnknownProperties {}\nexport type DateRangeProps = RangeInputTriggerProps & {};\n\n/** @deprecated */\nexport interface IDatePickerMaskedInputProps\n extends DatePickerMaskedInputProps,\n UnknownProperties {}\nexport type DatePickerMaskedInputProps = {\n date?: Date;\n onDateChange?: (date: Date, event: ChangeEvent) => void;\n onDisplayedPeriodChange?: (date: Date) => void;\n locale?: string;\n parts?: { year: Boolean; month: Boolean; day: Boolean };\n disabledDates?: (Date | (Date | false)[] | string)[];\n};\n\ndeclare const InputTrigger: Intergalactic.Component<\n 'div',\n DropdownTriggerProps & InputTriggerProps\n> & {\n Addon: typeof Input.Addon;\n Value: typeof Input.Value;\n SingleDateInput: Intergalactic.Component<'div', InputProps & SingleDateInputProps> & {\n Indicator: typeof Input.Addon;\n MaskedInput: Intergalactic.Component<'input', InputMaskValueProps & DatePickerMaskedInputProps>;\n };\n};\n\ndeclare const RangeInputTrigger: Intergalactic.Component<\n 'div',\n DropdownTriggerProps & RangeInputTriggerProps\n> & {\n Addon: typeof Input.Addon;\n Value: typeof Input.Value;\n DateRange: Intergalactic.Component<'div', InputValueProps & DateRangeProps> & {\n Indicator: typeof Input.Addon;\n RangeSep: typeof Input.Addon;\n FromMaskedInput: Intergalactic.Component<\n 'input',\n InputMaskValueProps & DatePickerMaskedInputProps\n >;\n ToMaskedInput: Intergalactic.Component<\n 'input',\n InputMaskValueProps & DatePickerMaskedInputProps\n >;\n };\n};\n\ndeclare const DatePicker: Intergalactic.Component<\n 'div',\n DatePickerProps,\n DatePickerContext & CalendarDaysContext\n> & {\n /** @deprecated `DatePicker.ButtonTrigger` is deprecated, consider migrating to `DatePicker.Trigger` instead */\n ButtonTrigger: Intergalactic.Component<'div', DropdownTriggerProps & BaseTriggerProps> & {\n Addon: typeof BaseTrigger.Addon;\n Text: typeof BaseTrigger.Text;\n };\n Trigger: typeof InputTrigger;\n Popper: typeof Dropdown.Popper;\n Header: typeof Box;\n Title: Intergalactic.Component<'div', DatePickerProps, DatePickerContext>;\n Prev: typeof Button;\n Next: typeof Button;\n Calendar: typeof Calendar;\n Today: typeof Box;\n add: (date: number | Date, amount: number, unit: dayjs.OpUnitType) => Date;\n subtract: (date: number | Date, amount: number, unit: dayjs.OpUnitType) => Date;\n};\n\n/** @deprecated */\nexport interface IDateRangePickerContext extends DateRangePickerContext, UnknownProperties {}\nexport type DateRangePickerContext = {\n getTriggerProps: PropGetterFn;\n getPopperProps: PropGetterFn;\n getHeaderProps: PropGetterFn;\n getTitleProps: PropGetterFn;\n getNextProps: PropGetterFn;\n getPrevProps: PropGetterFn;\n getCalendarProps: PropGetterFn;\n getPeriodProps: PropGetterFn;\n};\n\ndeclare const DateRangePicker: Intergalactic.Component<\n 'div',\n DateRangePickerProps,\n DateRangePickerContext & CalendarDaysContext,\n [handlers: DatePickerHandlers]\n> & {\n /** @deprecated `DatePicker.ButtonTrigger` is deprecated, consider migrating to `DatePicker.Trigger` instead */\n ButtonTrigger: Intergalactic.Component<'div', DropdownTriggerProps & BaseTriggerProps> & {\n Addon: typeof BaseTrigger.Addon;\n Text: typeof BaseTrigger.Text;\n };\n Trigger: typeof RangeInputTrigger;\n Popper: typeof Dropdown.Popper;\n Header: typeof Box;\n Title: Intergalactic.Component<'div', DateRangePickerProps, DateRangePickerContext>;\n Prev: typeof Button;\n Next: typeof Button;\n Calendar: typeof Calendar;\n Period: Intergalactic.Component<'div', DateRangePickerPeriodProps>;\n Apply: typeof Button;\n Reset: typeof Button;\n add: (date: number | Date, amount: number, unit: dayjs.OpUnitType) => Date;\n subtract: (date: number | Date, amount: number, unit: dayjs.OpUnitType) => Date;\n};\n\n/** @deprecated */\nexport interface IMonthPickerContext extends MonthPickerContext, UnknownProperties {}\nexport type MonthPickerContext = {\n getTriggerProps: PropGetterFn;\n getPopperProps: PropGetterFn;\n getHeaderProps: PropGetterFn;\n getTitleProps: PropGetterFn;\n getNextProps: PropGetterFn;\n getPrevProps: PropGetterFn;\n getCalendarProps: PropGetterFn;\n};\n\ndeclare const MonthPicker: Intergalactic.Component<\n 'div',\n DatePickerProps,\n MonthPickerContext & CalendarMonthsContext,\n [handlers: DatePickerHandlers]\n> & {\n /** @deprecated `DatePicker.ButtonTrigger` is deprecated, consider migrating to `DatePicker.Trigger` instead */\n ButtonTrigger: Intergalactic.Component<'div', DropdownTriggerProps & BaseTriggerProps> & {\n Addon: typeof BaseTrigger.Addon;\n Text: typeof BaseTrigger.Text;\n };\n Trigger: typeof InputTrigger;\n Popper: typeof Dropdown.Popper;\n Header: typeof Box;\n Title: Intergalactic.Component<'div', DatePickerProps, MonthPickerContext>;\n Prev: typeof Button;\n Next: typeof Button;\n Calendar: typeof Calendar;\n add: (date: number | Date, amount: number, unit: dayjs.OpUnitType) => Date;\n subtract: (date: number | Date, amount: number, unit: dayjs.OpUnitType) => Date;\n};\n\n/** @deprecated */\nexport interface IMonthRangePickerContext extends MonthRangePickerContext, UnknownProperties {}\nexport type MonthRangePickerContext = {\n getTriggerProps: PropGetterFn;\n getPopperProps: PropGetterFn;\n getHeaderProps: PropGetterFn;\n getTitleProps: PropGetterFn;\n getNextProps: PropGetterFn;\n getPrevProps: PropGetterFn;\n getCalendarProps: PropGetterFn;\n getPeriodProps: PropGetterFn;\n};\n\ndeclare const MonthRangePicker: Intergalactic.Component<\n 'div',\n DateRangePickerProps,\n MonthRangePickerContext & CalendarMonthsContext,\n [handlers: DatePickerHandlers]\n> & {\n /** @deprecated `DatePicker.ButtonTrigger` is deprecated, consider migrating to `DatePicker.Trigger` instead */\n ButtonTrigger: Intergalactic.Component<'div', DropdownTriggerProps & BaseTriggerProps> & {\n Addon: typeof BaseTrigger.Addon;\n Text: typeof BaseTrigger.Text;\n };\n Trigger: typeof RangeInputTrigger;\n Popper: typeof Dropdown.Popper;\n Header: typeof Box;\n Title: Intergalactic.Component<'div', DateRangePickerProps, MonthRangePickerContext>;\n Prev: typeof Button;\n Next: typeof Button;\n Calendar: typeof Calendar;\n Period: Intergalactic.Component<'div', DateRangePickerPeriodProps>;\n Apply: typeof Button;\n Reset: typeof Button;\n add: (date: number | Date, amount: number, unit: dayjs.OpUnitType) => Date;\n subtract: (date: number | Date, amount: number, unit: dayjs.OpUnitType) => Date;\n};\n\nexport type DateRangeComparatorProps = DropdownProps &\n WithI18nEnhanceProps & {\n /**\n * Selected date ranges\n * */\n value?: { value?: DateConstructorParams[]; compare?: DateConstructorParams[] };\n /**\n * Default value for selected date ranges\n * */\n defaultValue?: { value?: DateConstructorParams[]; compare?: DateConstructorParams[] };\n /**\n * Default value date for showing the necessary month\n * */\n defaultDisplayedPeriod?: DateConstructorParams;\n /**\n * Default value selected date, accepts everything which is accepted by `new Date()`\n * */\n defaultHighlighted?: DateConstructorParams[];\n /**\n * Called with selected date when user clicks `Apply` button.\n * */\n onChange?: (ranges: {\n value?: DateConstructorParams[];\n compare?: DateConstructorParams[];\n }) => void;\n /**\n * Array of dates blocked for selection\n * */\n disabled?: (Date | (Date | false)[] | string)[];\n /**\n * Date for showing the necessary month\n * @default new Date()\n * */\n displayedPeriod?: DateConstructorParams;\n /**\n * To be activated upon changing the current shown month\n * */\n onDisplayedPeriodChange?: (date: Date) => void;\n /**\n * Component size\n * @default m\n */\n size?: 'm' | 'l' | 'xl';\n /**\n * The selected date, accepts everything which is accepted by `new Date()`\n * */\n highlighted?: DateConstructorParams[];\n /**\n * To be activated upon selecting the date\n * */\n onHighlightedChange?: (date: Date[]) => void;\n /**\n * The selected date, accepts everything which is accepted by `new Date()`\n * */\n compareHighlighted?: DateConstructorParams[];\n /**\n * To be activated upon selecting the date\n * */\n onCompareHighlightedChange?: (date: Date[]) => void;\n /**\n * Remove the 'Reset' button\n * */\n unclearable?: boolean;\n /**\n * Array of periods\n * [{value: [new Date(), new Date()], children: \"Today\"}]\n * @default Past 2 days / Past week / Past 2 week / Past month / Past 2 month\n * */\n periods?: (ButtonProps & { value: Date[] })[];\n };\n\nexport type DateRangeComparatorContext = {\n getTriggerProps: PropGetterFn;\n getPopperProps: PropGetterFn;\n getHeaderProps: PropGetterFn;\n getTitleProps: PropGetterFn;\n getNextProps: PropGetterFn;\n getPrevProps: PropGetterFn;\n getCalendarProps: PropGetterFn;\n getPeriodProps: PropGetterFn;\n};\n\nexport type DateRangeComparatorTriggerProps = DropdownTriggerProps &\n BaseTriggerProps & {\n /**\n * Text between the selected date range and the compared date range when both are selected.\n * @default 'vs.'\n */\n separator?: string;\n /**\n * Trigger text when no ranges are selected.\n */\n placeholder?: string;\n };\n\ndeclare const DateRangeComparator: Intergalactic.Component<\n 'div',\n DateRangeComparatorProps,\n DateRangeComparatorContext & CalendarDaysContext\n> & {\n Popper: typeof Dropdown.Popper;\n Header: typeof Flex;\n Prev: typeof Button;\n Next: typeof Button;\n Calendar: typeof Calendar;\n Apply: typeof Button;\n Reset: typeof Button;\n\n CalendarHeader: typeof Box;\n Title: typeof Box;\n\n Trigger: Intergalactic.Component<'div', DropdownTriggerProps & BaseTriggerProps> & {\n Addon: typeof BaseTrigger.Addon;\n Text: typeof BaseTrigger.Text;\n };\n ValueDateRange: Intergalactic.Component<'div', InputTriggerProps>;\n CompareToggle: typeof Checkbox;\n CompareDateRange: Intergalactic.Component<'div', InputTriggerProps>;\n Body: typeof Flex;\n RangeCalendar: typeof Flex;\n Periods: typeof Flex;\n Footer: typeof Flex;\n};\n\ndeclare const MonthDateRangeComparator: typeof DateRangeComparator;\n\nexport {\n DatePicker,\n DateRangePicker,\n MonthPicker,\n MonthRangePicker,\n DateRangeComparator,\n MonthDateRangeComparator,\n};\n"],"mappings":""}
package/lib/es6/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  export { default as DatePicker } from './DatePicker';
2
2
  export * from './DatePicker';
3
3
  export { default as DateRangePicker } from './DateRangePicker';
4
+ export { default as DateRangeComparator } from './DateRangeComparator';
4
5
  export { default as MonthPicker } from './MonthPicker';
5
6
  export { default as MonthRangePicker } from './MonthRangePicker';
7
+ export { default as MonthDateRangeComparator } from './MonthDateRangeComparator';
6
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["default","DatePicker","DateRangePicker","MonthPicker","MonthRangePicker"],"sources":["../../src/index.js"],"sourcesContent":["export { default as DatePicker } from './DatePicker';\nexport * from './DatePicker';\n\nexport { default as DateRangePicker } from './DateRangePicker';\n\nexport { default as MonthPicker } from './MonthPicker';\n\nexport { default as MonthRangePicker } from './MonthRangePicker';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,UAAU,QAAQ,cAAc;AACpD,cAAc,cAAc;AAE5B,SAASD,OAAO,IAAIE,eAAe,QAAQ,mBAAmB;AAE9D,SAASF,OAAO,IAAIG,WAAW,QAAQ,eAAe;AAEtD,SAASH,OAAO,IAAII,gBAAgB,QAAQ,oBAAoB"}
1
+ {"version":3,"file":"index.js","names":["default","DatePicker","DateRangePicker","DateRangeComparator","MonthPicker","MonthRangePicker","MonthDateRangeComparator"],"sources":["../../src/index.js"],"sourcesContent":["export { default as DatePicker } from './DatePicker';\nexport * from './DatePicker';\n\nexport { default as DateRangePicker } from './DateRangePicker';\n\nexport { default as DateRangeComparator } from './DateRangeComparator';\n\nexport { default as MonthPicker } from './MonthPicker';\n\nexport { default as MonthRangePicker } from './MonthRangePicker';\n\nexport { default as MonthDateRangeComparator } from './MonthDateRangeComparator';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,UAAU,QAAQ,cAAc;AACpD,cAAc,cAAc;AAE5B,SAASD,OAAO,IAAIE,eAAe,QAAQ,mBAAmB;AAE9D,SAASF,OAAO,IAAIG,mBAAmB,QAAQ,uBAAuB;AAEtE,SAASH,OAAO,IAAII,WAAW,QAAQ,eAAe;AAEtD,SAASJ,OAAO,IAAIK,gBAAgB,QAAQ,oBAAoB;AAEhE,SAASL,OAAO,IAAIM,wBAAwB,QAAQ,4BAA4B"}
@@ -47,7 +47,7 @@ SCalendarUnit {
47
47
  user-select: none;
48
48
  touch-action: manipulation;
49
49
  -webkit-tap-highlight-color: transparent;
50
- background: var(--intergalactic-date-picker-cell, #ffffff);
50
+ background-color: var(--intergalactic-date-picker-cell, #ffffff);
51
51
 
52
52
  align-items: center;
53
53
  border-radius: var(--intergalactic-control-rounded, 6px);
@@ -62,10 +62,11 @@ SCalendarUnit {
62
62
  transition: color 0.15s, background 0.15s, border-radius 0.15s 0.15s;
63
63
  outline: none;
64
64
  margin: 0;
65
+ margin-top: 4px;
65
66
 
66
67
  &:hover {
67
68
  color: var(--intergalactic-text-primary, #191b23);
68
- background: var(--intergalactic-date-picker-cell-hover, #e0e1e9);
69
+ background-color: var(--intergalactic-date-picker-cell-hover, #e0e1e9);
69
70
  }
70
71
 
71
72
  &:focus-visible {
@@ -96,30 +97,30 @@ SCalendarUnit[today]SCalendarUnit[endSelected] {
96
97
  }
97
98
 
98
99
  SCalendarUnit[selected] {
99
- background: var(--intergalactic-date-picker-cell-range, #c4e5fe);
100
+ background-color: var(--intergalactic-date-picker-cell-range, #c4e5fe);
100
101
  border-radius: 0;
101
102
  transition: color 0.15s, background 0.15s, border-radius 0s 0s;
102
103
  color: var(--intergalactic-text-primary, #191b23);
103
104
 
104
105
  &:hover {
105
- background: var(--intergalactic-date-picker-cell-range-hover, #8ecdff);
106
+ background-color: var(--intergalactic-date-picker-cell-range-hover, #8ecdff);
106
107
  }
107
108
  }
108
109
 
109
110
  SCalendarUnit[highlighted] {
110
- background: var(--intergalactic-date-picker-cell-range-hover, #8ecdff);
111
+ background-color: var(--intergalactic-date-picker-cell-range-hover, #8ecdff);
111
112
  border-radius: 0;
112
113
  transition: color 0.15s, background 0.15s, border-radius 0s 0s;
113
114
  color: var(--intergalactic-text-primary, #191b23);
114
115
 
115
116
  &:hover {
116
- background: var(--intergalactic-date-picker-cell-range-hover, #8ecdff);
117
+ background-color: var(--intergalactic-date-picker-cell-range-hover, #8ecdff);
117
118
  }
118
119
  }
119
120
 
120
121
  SCalendarUnit[startSelected] {
121
122
  color: var(--intergalactic-text-primary-invert, #ffffff);
122
- background: var(--intergalactic-date-picker-cell-active, #2bb3ff);
123
+ background-color: var(--intergalactic-date-picker-cell-active, #2bb3ff);
123
124
 
124
125
  &:not([highlighted]) {
125
126
  border-bottom-left-radius: var(--intergalactic-control-rounded, 6px);
@@ -130,12 +131,12 @@ SCalendarUnit[startSelected] {
130
131
 
131
132
  &:hover {
132
133
  color: var(--intergalactic-text-primary-invert, #ffffff);
133
- background: var(--intergalactic-date-picker-cell-active-hover, #008ff8);
134
+ background-color: var(--intergalactic-date-picker-cell-active-hover, #008ff8);
134
135
  }
135
136
  }
136
137
 
137
138
  SCalendarUnit[endSelected] {
138
- background: var(--intergalactic-date-picker-cell-active, #2bb3ff);
139
+ background-color: var(--intergalactic-date-picker-cell-active, #2bb3ff);
139
140
  color: var(--intergalactic-text-primary-invert, #ffffff);
140
141
 
141
142
  &:not([highlighted]) {
@@ -147,7 +148,7 @@ SCalendarUnit[endSelected] {
147
148
 
148
149
  &:hover {
149
150
  color: var(--intergalactic-text-primary-invert, #ffffff);
150
- background: var(--intergalactic-date-picker-cell-active-hover, #008ff8);
151
+ background-color: var(--intergalactic-date-picker-cell-active-hover, #008ff8);
151
152
  }
152
153
  }
153
154
 
@@ -179,6 +180,52 @@ SCalendarUnit[startSelected]SCalendarUnit[endSelected] {
179
180
  border-top-right-radius: var(--intergalactic-control-rounded, 6px);
180
181
  }
181
182
 
183
+ SCalendarUnit[compareHighlighted] {
184
+ border-top: 2px dashed var(--intergalactic-date-picker-cell-comparison-active, #8649e1);
185
+ border-bottom: 2px dashed var(--intergalactic-date-picker-cell-comparison-active, #8649e1);
186
+ border-radius: 0;
187
+ transition: none;
188
+ }
189
+
190
+
191
+ SCalendarUnit[compareStartHighlighted],
192
+ SCalendarUnit[compareEndHighlighted] {
193
+ border-left: 2px dashed var(--intergalactic-date-picker-cell-comparison-active, #8649e1);
194
+ border-right: 2px dashed var(--intergalactic-date-picker-cell-comparison-active, #8649e1);
195
+ }
196
+
197
+ SCalendarUnit[compareStart],
198
+ SCalendarUnit[compareEnd] {
199
+ border-radius: 0;
200
+ background-color: var(--intergalactic-date-picker-cell-comparison-active, #8649e1);
201
+ color: var(--intergalactic-text-primary-invert, #ffffff);
202
+
203
+ &:hover {
204
+ color: var(--intergalactic-text-primary-invert, #ffffff);
205
+ background-color: var(--intergalactic-date-picker-cell-comparison-active-hover, #5925ab);
206
+ }
207
+ }
208
+
209
+ SCalendarUnit[compareStartHighlighted] {
210
+ border-top-left-radius: var(--intergalactic-control-rounded, 6px);
211
+ border-bottom-left-radius: var(--intergalactic-control-rounded, 6px);
212
+ }
213
+
214
+ SCalendarUnit[compareEndHighlighted] {
215
+ border-top-right-radius: var(--intergalactic-control-rounded, 6px);
216
+ border-bottom-right-radius: var(--intergalactic-control-rounded, 6px);
217
+ }
218
+
219
+ SCalendarUnit[compareStart]:not([compareHighlighted]) {
220
+ border-top-left-radius: var(--intergalactic-control-rounded, 6px);
221
+ border-bottom-left-radius: var(--intergalactic-control-rounded, 6px);
222
+ }
223
+
224
+ SCalendarUnit[compareEnd]:not([compareHighlighted]) {
225
+ border-top-right-radius: var(--intergalactic-control-rounded, 6px);
226
+ border-bottom-right-radius: var(--intergalactic-control-rounded, 6px);
227
+ }
228
+
182
229
  SCalendarUnit[outdated] {
183
230
  opacity: 0.2;
184
231
  }
@@ -59,6 +59,19 @@ SIndicator {
59
59
  color: var(--intergalactic-text-secondary, #6c6e79);
60
60
  }
61
61
 
62
+ SRangeIndicator {
63
+ border-radius: 50%;
64
+ flex-shrink: 0;
65
+ }
66
+
67
+ SRangeIndicator[range='value'] {
68
+ background-color: var(--intergalactic-date-picker-cell-active, #2bb3ff);
69
+ }
70
+
71
+ SRangeIndicator[range='compare'] {
72
+ background-color: var(--intergalactic-date-picker-cell-comparison-active, #8649e1);
73
+ }
74
+
62
75
  SHumanizedDate {
63
76
  position: absolute;
64
77
  pointer-events: none;
@@ -107,4 +120,22 @@ SDateRange SInputMask:focus-within SMask {
107
120
  SRangeSep[fulfilled],
108
121
  SDateRange:focus-within SRangeSep {
109
122
  color: var(--intergalactic-text-primary, #191b23);
123
+ }
124
+
125
+ SRangeComparatorHeader {
126
+ border-bottom: 1px solid var(--intergalactic-border-primary, #c4c7cf);
127
+ padding: var(--intergalactic-spacing-4x, 16px);
128
+ }
129
+
130
+ SRangeCalendar {
131
+ padding: var(--intergalactic-spacing-4x, 16px);
132
+ }
133
+
134
+ SFooter {
135
+ border-top: 1px solid var(--intergalactic-border-primary, #c4c7cf);
136
+ padding: var(--intergalactic-spacing-4x, 16px);
137
+ }
138
+
139
+ SPeriodsList {
140
+ padding: var(--intergalactic-spacing-4x, 16px);
110
141
  }
@@ -1,6 +1,6 @@
1
1
  import React, { ChangeEvent, ComponentProps } from 'react';
2
2
  import dayjs from 'dayjs';
3
- import { Box, BoxProps } from '@semcore/flex-box';
3
+ import { Flex, Box, BoxProps } from '@semcore/flex-box';
4
4
  import { UnknownProperties, Intergalactic, PropGetterFn } from '@semcore/core';
5
5
  import Button, { ButtonProps } from '@semcore/button';
6
6
  import Dropdown, { DropdownProps, DropdownTriggerProps } from '@semcore/dropdown';
@@ -8,6 +8,7 @@ import { WithI18nEnhanceProps } from '@semcore/utils/lib/enhances/i18nEnhance';
8
8
  import BaseTrigger, { BaseTriggerProps } from '@semcore/base-trigger';
9
9
  import Input, { InputProps, InputValueProps } from '@semcore/input';
10
10
  import { InputMaskValueProps } from '@semcore/input-mask';
11
+ import Checkbox from '@semcore/checkbox';
11
12
 
12
13
  export type DateConstructorParams = string | number | Date;
13
14
 
@@ -467,4 +468,137 @@ declare const MonthRangePicker: Intergalactic.Component<
467
468
  subtract: (date: number | Date, amount: number, unit: dayjs.OpUnitType) => Date;
468
469
  };
469
470
 
470
- export { DatePicker, DateRangePicker, MonthPicker, MonthRangePicker };
471
+ export type DateRangeComparatorProps = DropdownProps &
472
+ WithI18nEnhanceProps & {
473
+ /**
474
+ * Selected date ranges
475
+ * */
476
+ value?: { value?: DateConstructorParams[]; compare?: DateConstructorParams[] };
477
+ /**
478
+ * Default value for selected date ranges
479
+ * */
480
+ defaultValue?: { value?: DateConstructorParams[]; compare?: DateConstructorParams[] };
481
+ /**
482
+ * Default value date for showing the necessary month
483
+ * */
484
+ defaultDisplayedPeriod?: DateConstructorParams;
485
+ /**
486
+ * Default value selected date, accepts everything which is accepted by `new Date()`
487
+ * */
488
+ defaultHighlighted?: DateConstructorParams[];
489
+ /**
490
+ * Called with selected date when user clicks `Apply` button.
491
+ * */
492
+ onChange?: (ranges: {
493
+ value?: DateConstructorParams[];
494
+ compare?: DateConstructorParams[];
495
+ }) => void;
496
+ /**
497
+ * Array of dates blocked for selection
498
+ * */
499
+ disabled?: (Date | (Date | false)[] | string)[];
500
+ /**
501
+ * Date for showing the necessary month
502
+ * @default new Date()
503
+ * */
504
+ displayedPeriod?: DateConstructorParams;
505
+ /**
506
+ * To be activated upon changing the current shown month
507
+ * */
508
+ onDisplayedPeriodChange?: (date: Date) => void;
509
+ /**
510
+ * Component size
511
+ * @default m
512
+ */
513
+ size?: 'm' | 'l' | 'xl';
514
+ /**
515
+ * The selected date, accepts everything which is accepted by `new Date()`
516
+ * */
517
+ highlighted?: DateConstructorParams[];
518
+ /**
519
+ * To be activated upon selecting the date
520
+ * */
521
+ onHighlightedChange?: (date: Date[]) => void;
522
+ /**
523
+ * The selected date, accepts everything which is accepted by `new Date()`
524
+ * */
525
+ compareHighlighted?: DateConstructorParams[];
526
+ /**
527
+ * To be activated upon selecting the date
528
+ * */
529
+ onCompareHighlightedChange?: (date: Date[]) => void;
530
+ /**
531
+ * Remove the 'Reset' button
532
+ * */
533
+ unclearable?: boolean;
534
+ /**
535
+ * Array of periods
536
+ * [{value: [new Date(), new Date()], children: "Today"}]
537
+ * @default Past 2 days / Past week / Past 2 week / Past month / Past 2 month
538
+ * */
539
+ periods?: (ButtonProps & { value: Date[] })[];
540
+ };
541
+
542
+ export type DateRangeComparatorContext = {
543
+ getTriggerProps: PropGetterFn;
544
+ getPopperProps: PropGetterFn;
545
+ getHeaderProps: PropGetterFn;
546
+ getTitleProps: PropGetterFn;
547
+ getNextProps: PropGetterFn;
548
+ getPrevProps: PropGetterFn;
549
+ getCalendarProps: PropGetterFn;
550
+ getPeriodProps: PropGetterFn;
551
+ };
552
+
553
+ export type DateRangeComparatorTriggerProps = DropdownTriggerProps &
554
+ BaseTriggerProps & {
555
+ /**
556
+ * Text between the selected date range and the compared date range when both are selected.
557
+ * @default 'vs.'
558
+ */
559
+ separator?: string;
560
+ /**
561
+ * Trigger text when no ranges are selected.
562
+ */
563
+ placeholder?: string;
564
+ };
565
+
566
+ declare const DateRangeComparator: Intergalactic.Component<
567
+ 'div',
568
+ DateRangeComparatorProps,
569
+ DateRangeComparatorContext & CalendarDaysContext
570
+ > & {
571
+ Popper: typeof Dropdown.Popper;
572
+ Header: typeof Flex;
573
+ Prev: typeof Button;
574
+ Next: typeof Button;
575
+ Calendar: typeof Calendar;
576
+ Apply: typeof Button;
577
+ Reset: typeof Button;
578
+
579
+ CalendarHeader: typeof Box;
580
+ Title: typeof Box;
581
+
582
+ Trigger: Intergalactic.Component<'div', DropdownTriggerProps & BaseTriggerProps> & {
583
+ Addon: typeof BaseTrigger.Addon;
584
+ Text: typeof BaseTrigger.Text;
585
+ };
586
+ ValueDateRange: Intergalactic.Component<'div', InputTriggerProps>;
587
+ CompareToggle: typeof Checkbox;
588
+ CompareDateRange: Intergalactic.Component<'div', InputTriggerProps>;
589
+ Body: typeof Flex;
590
+ RangeCalendar: typeof Flex;
591
+ Periods: typeof Flex;
592
+ Footer: typeof Flex;
593
+ };
594
+
595
+ declare const MonthDateRangeComparator: typeof DateRangeComparator;
596
+
597
+ export {
598
+ DatePicker,
599
+ DateRangePicker,
600
+ MonthPicker,
601
+ MonthRangePicker,
602
+ DateRangeComparator,
603
+ MonthDateRangeComparator,
604
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/date-picker",
3
3
  "description": "Semrush DatePicker Component",
4
- "version": "4.17.0",
4
+ "version": "4.18.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -20,6 +20,7 @@
20
20
  "@semcore/input-mask": "5.13.0",
21
21
  "@semcore/neighbor-location": "4.10.0",
22
22
  "@semcore/typography": "5.18.0",
23
+ "@semcore/checkbox": "7.14.0",
23
24
  "dayjs": "1.8.36"
24
25
  },
25
26
  "peerDependencies": {
@@ -33,10 +34,10 @@
33
34
  "directory": "semcore/date-picker"
34
35
  },
35
36
  "devDependencies": {
36
- "@types/react": "18.0.21",
37
- "@semcore/testing-utils": "1.0.0",
38
37
  "@guidepup/playwright": "0.6.1",
39
- "@playwright/test": "1.25.1"
38
+ "@playwright/test": "1.25.1",
39
+ "@semcore/testing-utils": "1.0.0",
40
+ "@types/react": "18.0.21"
40
41
  },
41
42
  "scripts": {
42
43
  "build": "pnpm semcore-builder --source=js"