@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.
- package/CHANGELOG.md +16 -1
- package/lib/cjs/DatePicker.js +1 -1
- package/lib/cjs/DatePicker.js.map +1 -1
- package/lib/cjs/DateRangeComparator.js +11 -8
- package/lib/cjs/DateRangeComparator.js.map +1 -1
- package/lib/cjs/MonthDateRangeComparator.js +7 -6
- package/lib/cjs/MonthDateRangeComparator.js.map +1 -1
- package/lib/cjs/components/Calendar.js +156 -72
- package/lib/cjs/components/Calendar.js.map +1 -1
- package/lib/cjs/components/DateRangeComparatorAbstract.js +206 -123
- package/lib/cjs/components/DateRangeComparatorAbstract.js.map +1 -1
- package/lib/cjs/components/InputTrigger.js +50 -38
- package/lib/cjs/components/InputTrigger.js.map +1 -1
- package/lib/cjs/components/PickerAbstract.js +38 -29
- package/lib/cjs/components/PickerAbstract.js.map +1 -1
- package/lib/cjs/components/RangePickerAbstract.js +105 -79
- package/lib/cjs/components/RangePickerAbstract.js.map +1 -1
- package/lib/cjs/components/index.js +4 -4
- package/lib/cjs/components/index.js.map +1 -1
- package/lib/cjs/style/calendar.shadow.css +7 -3
- package/lib/cjs/translations/en.json +8 -1
- package/lib/cjs/utils/formatDate.js +19 -7
- package/lib/cjs/utils/formatDate.js.map +1 -1
- package/lib/es6/DatePicker.js +2 -2
- package/lib/es6/DatePicker.js.map +1 -1
- package/lib/es6/DateRangeComparator.js +11 -8
- package/lib/es6/DateRangeComparator.js.map +1 -1
- package/lib/es6/MonthDateRangeComparator.js +7 -6
- package/lib/es6/MonthDateRangeComparator.js.map +1 -1
- package/lib/es6/components/Calendar.js +157 -73
- package/lib/es6/components/Calendar.js.map +1 -1
- package/lib/es6/components/DateRangeComparatorAbstract.js +206 -123
- package/lib/es6/components/DateRangeComparatorAbstract.js.map +1 -1
- package/lib/es6/components/InputTrigger.js +50 -38
- package/lib/es6/components/InputTrigger.js.map +1 -1
- package/lib/es6/components/PickerAbstract.js +38 -29
- package/lib/es6/components/PickerAbstract.js.map +1 -1
- package/lib/es6/components/RangePickerAbstract.js +105 -79
- package/lib/es6/components/RangePickerAbstract.js.map +1 -1
- package/lib/es6/components/index.js +4 -4
- package/lib/es6/components/index.js.map +1 -1
- package/lib/es6/style/calendar.shadow.css +7 -3
- package/lib/es6/translations/en.json +8 -1
- package/lib/es6/utils/formatDate.js +16 -5
- package/lib/es6/utils/formatDate.js.map +1 -1
- 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
|
|
3
|
-
export var
|
|
4
|
-
if (
|
|
5
|
-
|
|
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 =
|
|
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","
|
|
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.
|
|
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.
|
|
13
|
-
"@semcore/base-trigger": "4.26.
|
|
14
|
-
"@semcore/button": "5.20.
|
|
15
|
-
"@semcore/divider": "4.18.
|
|
16
|
-
"@semcore/dropdown": "4.19.
|
|
17
|
-
"@semcore/flex-box": "5.19.
|
|
18
|
-
"@semcore/icon": "4.
|
|
19
|
-
"@semcore/input": "4.20.
|
|
20
|
-
"@semcore/input-mask": "5.20.
|
|
21
|
-
"@semcore/neighbor-location": "4.17.
|
|
22
|
-
"@semcore/typography": "5.26.
|
|
23
|
-
"@semcore/checkbox": "7.22.
|
|
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.
|
|
27
|
+
"@semcore/core": "^2.17.4",
|
|
28
28
|
"react": "16.8 - 18",
|
|
29
29
|
"react-dom": "16.8 - 18"
|
|
30
30
|
},
|