@semcore/date-picker 4.29.2 → 4.30.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 (46) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/lib/cjs/DatePicker.js +1 -1
  3. package/lib/cjs/DatePicker.js.map +1 -1
  4. package/lib/cjs/DateRangeComparator.js +11 -8
  5. package/lib/cjs/DateRangeComparator.js.map +1 -1
  6. package/lib/cjs/MonthDateRangeComparator.js +7 -6
  7. package/lib/cjs/MonthDateRangeComparator.js.map +1 -1
  8. package/lib/cjs/components/Calendar.js +156 -72
  9. package/lib/cjs/components/Calendar.js.map +1 -1
  10. package/lib/cjs/components/DateRangeComparatorAbstract.js +206 -123
  11. package/lib/cjs/components/DateRangeComparatorAbstract.js.map +1 -1
  12. package/lib/cjs/components/InputTrigger.js +50 -38
  13. package/lib/cjs/components/InputTrigger.js.map +1 -1
  14. package/lib/cjs/components/PickerAbstract.js +38 -29
  15. package/lib/cjs/components/PickerAbstract.js.map +1 -1
  16. package/lib/cjs/components/RangePickerAbstract.js +105 -79
  17. package/lib/cjs/components/RangePickerAbstract.js.map +1 -1
  18. package/lib/cjs/components/index.js +4 -4
  19. package/lib/cjs/components/index.js.map +1 -1
  20. package/lib/cjs/style/calendar.shadow.css +7 -3
  21. package/lib/cjs/translations/en.json +8 -1
  22. package/lib/cjs/utils/formatDate.js +19 -7
  23. package/lib/cjs/utils/formatDate.js.map +1 -1
  24. package/lib/es6/DatePicker.js +2 -2
  25. package/lib/es6/DatePicker.js.map +1 -1
  26. package/lib/es6/DateRangeComparator.js +11 -8
  27. package/lib/es6/DateRangeComparator.js.map +1 -1
  28. package/lib/es6/MonthDateRangeComparator.js +7 -6
  29. package/lib/es6/MonthDateRangeComparator.js.map +1 -1
  30. package/lib/es6/components/Calendar.js +157 -73
  31. package/lib/es6/components/Calendar.js.map +1 -1
  32. package/lib/es6/components/DateRangeComparatorAbstract.js +206 -123
  33. package/lib/es6/components/DateRangeComparatorAbstract.js.map +1 -1
  34. package/lib/es6/components/InputTrigger.js +50 -38
  35. package/lib/es6/components/InputTrigger.js.map +1 -1
  36. package/lib/es6/components/PickerAbstract.js +38 -29
  37. package/lib/es6/components/PickerAbstract.js.map +1 -1
  38. package/lib/es6/components/RangePickerAbstract.js +105 -79
  39. package/lib/es6/components/RangePickerAbstract.js.map +1 -1
  40. package/lib/es6/components/index.js +4 -4
  41. package/lib/es6/components/index.js.map +1 -1
  42. package/lib/es6/style/calendar.shadow.css +7 -3
  43. package/lib/es6/translations/en.json +8 -1
  44. package/lib/es6/utils/formatDate.js +16 -5
  45. package/lib/es6/utils/formatDate.js.map +1 -1
  46. package/package.json +14 -14
@@ -13,5 +13,12 @@
13
13
  "prev": "Previous period",
14
14
  "next": "Next period",
15
15
  "input": "Date field",
16
- "compare": "Compare to"
16
+ "compare": "Compare to",
17
+ "fromDate": "From {date}",
18
+ "toDate": "To {date}",
19
+ "dateRange": "Date range",
20
+ "dateRange1": "First date range",
21
+ "dateRange2": "Second date range",
22
+ "selectingStarted": "Started selecting",
23
+ "selectingFinished": "Selected"
17
24
  }
@@ -1,14 +1,25 @@
1
1
  import dayjs from 'dayjs';
2
- var formatterCache = {};
3
- export var getLocaleDate = function getLocaleDate(date, locale) {
4
- if (formatterCache[locale] === undefined) {
5
- formatterCache[locale] = new Intl.DateTimeFormat(locale, {
2
+ var DDMMYYFormattersCache = {};
3
+ export var formatDDMMYY = function formatDDMMYY(date, locale) {
4
+ if (DDMMYYFormattersCache[locale] === undefined) {
5
+ DDMMYYFormattersCache[locale] = new Intl.DateTimeFormat(locale, {
6
6
  day: 'numeric',
7
7
  month: 'short',
8
8
  year: 'numeric'
9
9
  });
10
10
  }
11
- var formatter = formatterCache[locale];
11
+ var formatter = DDMMYYFormattersCache[locale];
12
+ return formatter.format(dayjs(date).toDate());
13
+ };
14
+ var MMYYYYFormattersCache = {};
15
+ export var formatMMYY = function formatMMYY(date, locale) {
16
+ if (MMYYYYFormattersCache[locale] === undefined) {
17
+ MMYYYYFormattersCache[locale] = new Intl.DateTimeFormat(locale, {
18
+ month: 'long',
19
+ year: 'numeric'
20
+ });
21
+ }
22
+ var formatter = MMYYYYFormattersCache[locale];
12
23
  return formatter.format(dayjs(date).toDate());
13
24
  };
14
25
  //# sourceMappingURL=formatDate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatDate.js","names":["dayjs","formatterCache","getLocaleDate","date","locale","undefined","Intl","DateTimeFormat","day","month","year","formatter","format","toDate"],"sources":["../../../src/utils/formatDate.js"],"sourcesContent":["import dayjs from 'dayjs';\n\nconst formatterCache = {};\n\nexport const getLocaleDate = (date, locale) => {\n if (formatterCache[locale] === undefined) {\n formatterCache[locale] = new Intl.DateTimeFormat(locale, {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n });\n }\n\n const formatter = formatterCache[locale];\n\n return formatter.format(dayjs(date).toDate());\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,IAAMC,cAAc,GAAG,CAAC,CAAC;AAEzB,OAAO,IAAMC,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,IAAI,EAAEC,MAAM,EAAK;EAC7C,IAAIH,cAAc,CAACG,MAAM,CAAC,KAAKC,SAAS,EAAE;IACxCJ,cAAc,CAACG,MAAM,CAAC,GAAG,IAAIE,IAAI,CAACC,cAAc,CAACH,MAAM,EAAE;MACvDI,GAAG,EAAE,SAAS;MACdC,KAAK,EAAE,OAAO;MACdC,IAAI,EAAE;IACR,CAAC,CAAC;EACJ;EAEA,IAAMC,SAAS,GAAGV,cAAc,CAACG,MAAM,CAAC;EAExC,OAAOO,SAAS,CAACC,MAAM,CAACZ,KAAK,CAACG,IAAI,CAAC,CAACU,MAAM,EAAE,CAAC;AAC/C,CAAC"}
1
+ {"version":3,"file":"formatDate.js","names":["dayjs","DDMMYYFormattersCache","formatDDMMYY","date","locale","undefined","Intl","DateTimeFormat","day","month","year","formatter","format","toDate","MMYYYYFormattersCache","formatMMYY"],"sources":["../../../src/utils/formatDate.js"],"sourcesContent":["import dayjs from 'dayjs';\n\nconst DDMMYYFormattersCache = {};\n\nexport const formatDDMMYY = (date, locale) => {\n if (DDMMYYFormattersCache[locale] === undefined) {\n DDMMYYFormattersCache[locale] = new Intl.DateTimeFormat(locale, {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n });\n }\n\n const formatter = DDMMYYFormattersCache[locale];\n\n return formatter.format(dayjs(date).toDate());\n};\n\nconst MMYYYYFormattersCache = {};\n\nexport const formatMMYY = (date, locale) => {\n if (MMYYYYFormattersCache[locale] === undefined) {\n MMYYYYFormattersCache[locale] = new Intl.DateTimeFormat(locale, {\n month: 'long',\n year: 'numeric',\n });\n }\n\n const formatter = MMYYYYFormattersCache[locale];\n\n return formatter.format(dayjs(date).toDate());\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,IAAMC,qBAAqB,GAAG,CAAC,CAAC;AAEhC,OAAO,IAAMC,YAAY,GAAG,SAAfA,YAAYA,CAAIC,IAAI,EAAEC,MAAM,EAAK;EAC5C,IAAIH,qBAAqB,CAACG,MAAM,CAAC,KAAKC,SAAS,EAAE;IAC/CJ,qBAAqB,CAACG,MAAM,CAAC,GAAG,IAAIE,IAAI,CAACC,cAAc,CAACH,MAAM,EAAE;MAC9DI,GAAG,EAAE,SAAS;MACdC,KAAK,EAAE,OAAO;MACdC,IAAI,EAAE;IACR,CAAC,CAAC;EACJ;EAEA,IAAMC,SAAS,GAAGV,qBAAqB,CAACG,MAAM,CAAC;EAE/C,OAAOO,SAAS,CAACC,MAAM,CAACZ,KAAK,CAACG,IAAI,CAAC,CAACU,MAAM,EAAE,CAAC;AAC/C,CAAC;AAED,IAAMC,qBAAqB,GAAG,CAAC,CAAC;AAEhC,OAAO,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAIZ,IAAI,EAAEC,MAAM,EAAK;EAC1C,IAAIU,qBAAqB,CAACV,MAAM,CAAC,KAAKC,SAAS,EAAE;IAC/CS,qBAAqB,CAACV,MAAM,CAAC,GAAG,IAAIE,IAAI,CAACC,cAAc,CAACH,MAAM,EAAE;MAC9DK,KAAK,EAAE,MAAM;MACbC,IAAI,EAAE;IACR,CAAC,CAAC;EACJ;EAEA,IAAMC,SAAS,GAAGG,qBAAqB,CAACV,MAAM,CAAC;EAE/C,OAAOO,SAAS,CAACC,MAAM,CAACZ,KAAK,CAACG,IAAI,CAAC,CAACU,MAAM,EAAE,CAAC;AAC/C,CAAC"}
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.29.2",
4
+ "version": "4.30.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -9,22 +9,22 @@
9
9
  "author": "UI-kit team <ui-kit-team@semrush.com>",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@semcore/utils": "4.20.3",
13
- "@semcore/base-trigger": "4.26.5",
14
- "@semcore/button": "5.20.3",
15
- "@semcore/divider": "4.18.3",
16
- "@semcore/dropdown": "4.19.5",
17
- "@semcore/flex-box": "5.19.2",
18
- "@semcore/icon": "4.26.1",
19
- "@semcore/input": "4.20.3",
20
- "@semcore/input-mask": "5.20.4",
21
- "@semcore/neighbor-location": "4.17.3",
22
- "@semcore/typography": "5.26.2",
23
- "@semcore/checkbox": "7.22.1",
12
+ "@semcore/utils": "4.20.4",
13
+ "@semcore/base-trigger": "4.26.6",
14
+ "@semcore/button": "5.20.4",
15
+ "@semcore/divider": "4.18.4",
16
+ "@semcore/dropdown": "4.19.6",
17
+ "@semcore/flex-box": "5.19.3",
18
+ "@semcore/icon": "4.27.0",
19
+ "@semcore/input": "4.20.4",
20
+ "@semcore/input-mask": "5.20.5",
21
+ "@semcore/neighbor-location": "4.17.4",
22
+ "@semcore/typography": "5.26.3",
23
+ "@semcore/checkbox": "7.22.2",
24
24
  "dayjs": "1.8.36"
25
25
  },
26
26
  "peerDependencies": {
27
- "@semcore/core": "^2.17.3",
27
+ "@semcore/core": "^2.17.4",
28
28
  "react": "16.8 - 18",
29
29
  "react-dom": "16.8 - 18"
30
30
  },