@react-spectrum/datepicker 3.14.1 → 3.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/utils.main.js +3 -2
- package/dist/utils.main.js.map +1 -1
- package/dist/utils.mjs +3 -2
- package/dist/utils.module.js +3 -2
- package/dist/utils.module.js.map +1 -1
- package/package.json +26 -22
- package/src/utils.tsx +3 -2
package/dist/utils.main.js
CHANGED
|
@@ -44,16 +44,17 @@ function $9d3b96715dbbb2b7$export$322f4580ccd8dde6(props) {
|
|
|
44
44
|
return (0, $6Arg9$react.useMemo)(()=>{
|
|
45
45
|
if (props.description) return props.description;
|
|
46
46
|
if (props.showFormatHelpText) return formatter.formatToParts(new Date()).map((s, i)=>{
|
|
47
|
-
if (s.type === 'literal') return /*#__PURE__*/ (0, ($parcel$interopDefault($6Arg9$react))).createElement("span", {
|
|
47
|
+
if (s.type === 'literal' || s.type === 'unknown' || s.type === 'yearName') return /*#__PURE__*/ (0, ($parcel$interopDefault($6Arg9$react))).createElement("span", {
|
|
48
48
|
key: i
|
|
49
49
|
}, ` ${s.value} `);
|
|
50
|
+
let type = s.type === 'relatedYear' ? 'year' : s.type;
|
|
50
51
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($6Arg9$react))).createElement("span", {
|
|
51
52
|
key: i,
|
|
52
53
|
style: {
|
|
53
54
|
unicodeBidi: 'embed',
|
|
54
55
|
direction: 'ltr'
|
|
55
56
|
}
|
|
56
|
-
}, displayNames.of(
|
|
57
|
+
}, displayNames.of(type));
|
|
57
58
|
});
|
|
58
59
|
return '';
|
|
59
60
|
}, [
|
package/dist/utils.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAYM,SAAS,0CAAkB,KAA8E;IAC9G,IAAI,YAAY,CAAA,GAAA,qCAAe,EAAE;QAAC,WAAW;IAAO;IACpD,I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Content":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {createDOMRef} from '@react-spectrum/utils';\nimport {createFocusManager} from '@react-aria/focus';\nimport {DateFormatter, useDateFormatter, useLocale} from '@react-aria/i18n';\nimport {FocusableRef} from '@react-types/shared';\nimport {FormatterOptions} from '@react-stately/datepicker';\nimport React, {ReactNode, useImperativeHandle, useMemo, useRef, useState} from 'react';\nimport {SpectrumDatePickerBase} from '@react-types/datepicker';\nimport {useDisplayNames} from '@react-aria/datepicker';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useProvider} from '@react-spectrum/provider';\n\nexport function useFormatHelpText(props: Pick<SpectrumDatePickerBase<any>, 'description' | 'showFormatHelpText'>): ReactNode {\n let formatter = useDateFormatter({dateStyle: 'short'});\n let displayNames = useDisplayNames();\n return useMemo(() => {\n if (props.description) {\n return props.description;\n }\n\n if (props.showFormatHelpText) {\n return (\n formatter.formatToParts(new Date()).map((s, i) => {\n if (s.type === 'literal' || s.type === 'unknown' || (s.type as string) === 'yearName') {\n return <span key={i}>{` ${s.value} `}</span>;\n }\n\n let type = s.type as string === 'relatedYear' ? 'year' : s.type;\n return <span key={i} style={{unicodeBidi: 'embed', direction: 'ltr'}}>{displayNames.of(type)}</span>;\n })\n );\n }\n\n return '';\n }, [props.description, props.showFormatHelpText, formatter, displayNames]);\n}\n\nexport function useVisibleMonths(maxVisibleMonths: number): number {\n let {scale} = useProvider()!;\n let [visibleMonths, setVisibleMonths] = useState(getVisibleMonths(scale));\n useLayoutEffect(() => {\n let onResize = () => setVisibleMonths(getVisibleMonths(scale));\n onResize();\n\n window.addEventListener('resize', onResize);\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, [scale]);\n\n return Math.max(1, Math.min(visibleMonths, maxVisibleMonths, 3));\n}\n\nfunction getVisibleMonths(scale) {\n if (typeof window === 'undefined') {\n return 1;\n }\n let monthWidth = scale === 'large' ? 336 : 280;\n let gap = scale === 'large' ? 30 : 24;\n let popoverPadding = scale === 'large' ? 32 : 48;\n return Math.floor((window.innerWidth - popoverPadding * 2) / (monthWidth + gap));\n}\n\nexport function useFocusManagerRef(ref: FocusableRef<HTMLElement>): React.RefObject<HTMLElement | null> {\n let domRef = useRef<HTMLElement | null>(null);\n useImperativeHandle(ref, () => ({\n ...createDOMRef(domRef),\n focus() {\n createFocusManager(domRef).focusFirst({tabbable: true});\n }\n }));\n return domRef;\n}\n\nexport function useFormattedDateWidth(state: {getDateFormatter: (locale: string, formatOptions: FormatterOptions) => DateFormatter}): number {\n let locale = useLocale()?.locale;\n let currentDate = new Date();\n let formatedDate = state.getDateFormatter(locale, {shouldForceLeadingZeros: true}).format(currentDate);\n let totalCharacters = formatedDate.length;\n\n // The max of two is for times with only hours.\n // As the length of a date grows we need to proportionally increase the width.\n // We use the character count with 'ch' units and add extra padding to accomate for\n // dates with months and time dashes, which are wider characters.\n return (totalCharacters + Math.max(Math.floor(totalCharacters / 5), 2));\n}\n"],"names":[],"version":3,"file":"utils.main.js.map"}
|
package/dist/utils.mjs
CHANGED
|
@@ -31,16 +31,17 @@ function $ea94a5cfe92db3c2$export$322f4580ccd8dde6(props) {
|
|
|
31
31
|
return (0, $kDnTZ$useMemo)(()=>{
|
|
32
32
|
if (props.description) return props.description;
|
|
33
33
|
if (props.showFormatHelpText) return formatter.formatToParts(new Date()).map((s, i)=>{
|
|
34
|
-
if (s.type === 'literal') return /*#__PURE__*/ (0, $kDnTZ$react).createElement("span", {
|
|
34
|
+
if (s.type === 'literal' || s.type === 'unknown' || s.type === 'yearName') return /*#__PURE__*/ (0, $kDnTZ$react).createElement("span", {
|
|
35
35
|
key: i
|
|
36
36
|
}, ` ${s.value} `);
|
|
37
|
+
let type = s.type === 'relatedYear' ? 'year' : s.type;
|
|
37
38
|
return /*#__PURE__*/ (0, $kDnTZ$react).createElement("span", {
|
|
38
39
|
key: i,
|
|
39
40
|
style: {
|
|
40
41
|
unicodeBidi: 'embed',
|
|
41
42
|
direction: 'ltr'
|
|
42
43
|
}
|
|
43
|
-
}, displayNames.of(
|
|
44
|
+
}, displayNames.of(type));
|
|
44
45
|
});
|
|
45
46
|
return '';
|
|
46
47
|
}, [
|
package/dist/utils.module.js
CHANGED
|
@@ -31,16 +31,17 @@ function $ea94a5cfe92db3c2$export$322f4580ccd8dde6(props) {
|
|
|
31
31
|
return (0, $kDnTZ$useMemo)(()=>{
|
|
32
32
|
if (props.description) return props.description;
|
|
33
33
|
if (props.showFormatHelpText) return formatter.formatToParts(new Date()).map((s, i)=>{
|
|
34
|
-
if (s.type === 'literal') return /*#__PURE__*/ (0, $kDnTZ$react).createElement("span", {
|
|
34
|
+
if (s.type === 'literal' || s.type === 'unknown' || s.type === 'yearName') return /*#__PURE__*/ (0, $kDnTZ$react).createElement("span", {
|
|
35
35
|
key: i
|
|
36
36
|
}, ` ${s.value} `);
|
|
37
|
+
let type = s.type === 'relatedYear' ? 'year' : s.type;
|
|
37
38
|
return /*#__PURE__*/ (0, $kDnTZ$react).createElement("span", {
|
|
38
39
|
key: i,
|
|
39
40
|
style: {
|
|
40
41
|
unicodeBidi: 'embed',
|
|
41
42
|
direction: 'ltr'
|
|
42
43
|
}
|
|
43
|
-
}, displayNames.of(
|
|
44
|
+
}, displayNames.of(type));
|
|
44
45
|
});
|
|
45
46
|
return '';
|
|
46
47
|
}, [
|
package/dist/utils.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAYM,SAAS,0CAAkB,KAA8E;IAC9G,IAAI,YAAY,CAAA,GAAA,uBAAe,EAA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],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {createDOMRef} from '@react-spectrum/utils';\nimport {createFocusManager} from '@react-aria/focus';\nimport {DateFormatter, useDateFormatter, useLocale} from '@react-aria/i18n';\nimport {FocusableRef} from '@react-types/shared';\nimport {FormatterOptions} from '@react-stately/datepicker';\nimport React, {ReactNode, useImperativeHandle, useMemo, useRef, useState} from 'react';\nimport {SpectrumDatePickerBase} from '@react-types/datepicker';\nimport {useDisplayNames} from '@react-aria/datepicker';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useProvider} from '@react-spectrum/provider';\n\nexport function useFormatHelpText(props: Pick<SpectrumDatePickerBase<any>, 'description' | 'showFormatHelpText'>): ReactNode {\n let formatter = useDateFormatter({dateStyle: 'short'});\n let displayNames = useDisplayNames();\n return useMemo(() => {\n if (props.description) {\n return props.description;\n }\n\n if (props.showFormatHelpText) {\n return (\n formatter.formatToParts(new Date()).map((s, i) => {\n if (s.type === 'literal' || s.type === 'unknown' || (s.type as string) === 'yearName') {\n return <span key={i}>{` ${s.value} `}</span>;\n }\n\n let type = s.type as string === 'relatedYear' ? 'year' : s.type;\n return <span key={i} style={{unicodeBidi: 'embed', direction: 'ltr'}}>{displayNames.of(type)}</span>;\n })\n );\n }\n\n return '';\n }, [props.description, props.showFormatHelpText, formatter, displayNames]);\n}\n\nexport function useVisibleMonths(maxVisibleMonths: number): number {\n let {scale} = useProvider()!;\n let [visibleMonths, setVisibleMonths] = useState(getVisibleMonths(scale));\n useLayoutEffect(() => {\n let onResize = () => setVisibleMonths(getVisibleMonths(scale));\n onResize();\n\n window.addEventListener('resize', onResize);\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, [scale]);\n\n return Math.max(1, Math.min(visibleMonths, maxVisibleMonths, 3));\n}\n\nfunction getVisibleMonths(scale) {\n if (typeof window === 'undefined') {\n return 1;\n }\n let monthWidth = scale === 'large' ? 336 : 280;\n let gap = scale === 'large' ? 30 : 24;\n let popoverPadding = scale === 'large' ? 32 : 48;\n return Math.floor((window.innerWidth - popoverPadding * 2) / (monthWidth + gap));\n}\n\nexport function useFocusManagerRef(ref: FocusableRef<HTMLElement>): React.RefObject<HTMLElement | null> {\n let domRef = useRef<HTMLElement | null>(null);\n useImperativeHandle(ref, () => ({\n ...createDOMRef(domRef),\n focus() {\n createFocusManager(domRef).focusFirst({tabbable: true});\n }\n }));\n return domRef;\n}\n\nexport function useFormattedDateWidth(state: {getDateFormatter: (locale: string, formatOptions: FormatterOptions) => DateFormatter}): number {\n let locale = useLocale()?.locale;\n let currentDate = new Date();\n let formatedDate = state.getDateFormatter(locale, {shouldForceLeadingZeros: true}).format(currentDate);\n let totalCharacters = formatedDate.length;\n\n // The max of two is for times with only hours.\n // As the length of a date grows we need to proportionally increase the width.\n // We use the character count with 'ch' units and add extra padding to accomate for\n // dates with months and time dashes, which are wider characters.\n return (totalCharacters + Math.max(Math.floor(totalCharacters / 5), 2));\n}\n"],"names":[],"version":3,"file":"utils.module.js.map"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/datepicker",
|
|
3
|
-
"version": "3.14.
|
|
3
|
+
"version": "3.14.3",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"module": "dist/module.js",
|
|
8
8
|
"exports": {
|
|
9
|
-
"
|
|
9
|
+
"source": "./src/index.ts",
|
|
10
|
+
"types": [
|
|
11
|
+
"./dist/types.d.ts",
|
|
12
|
+
"./src/index.ts"
|
|
13
|
+
],
|
|
10
14
|
"import": "./dist/import.mjs",
|
|
11
15
|
"require": "./dist/main.js"
|
|
12
16
|
},
|
|
@@ -36,25 +40,25 @@
|
|
|
36
40
|
"url": "https://github.com/adobe/react-spectrum"
|
|
37
41
|
},
|
|
38
42
|
"dependencies": {
|
|
39
|
-
"@internationalized/date": "^3.8.
|
|
40
|
-
"@react-aria/datepicker": "^3.14.
|
|
41
|
-
"@react-aria/focus": "^3.20.
|
|
42
|
-
"@react-aria/i18n": "^3.12.
|
|
43
|
-
"@react-aria/interactions": "^3.25.
|
|
44
|
-
"@react-aria/utils": "^3.29.
|
|
45
|
-
"@react-spectrum/button": "^3.16.
|
|
46
|
-
"@react-spectrum/calendar": "^3.7.
|
|
47
|
-
"@react-spectrum/dialog": "^3.8.
|
|
48
|
-
"@react-spectrum/form": "^3.7.
|
|
49
|
-
"@react-spectrum/label": "^3.16.
|
|
50
|
-
"@react-spectrum/layout": "^3.6.
|
|
51
|
-
"@react-spectrum/utils": "^3.12.
|
|
52
|
-
"@react-spectrum/view": "^3.6.
|
|
53
|
-
"@react-stately/datepicker": "^3.14.
|
|
54
|
-
"@react-types/datepicker": "^3.12.
|
|
55
|
-
"@react-types/shared": "^3.
|
|
56
|
-
"@spectrum-icons/ui": "^3.6.
|
|
57
|
-
"@spectrum-icons/workflow": "^4.2.
|
|
43
|
+
"@internationalized/date": "^3.8.2",
|
|
44
|
+
"@react-aria/datepicker": "^3.14.5",
|
|
45
|
+
"@react-aria/focus": "^3.20.5",
|
|
46
|
+
"@react-aria/i18n": "^3.12.10",
|
|
47
|
+
"@react-aria/interactions": "^3.25.3",
|
|
48
|
+
"@react-aria/utils": "^3.29.1",
|
|
49
|
+
"@react-spectrum/button": "^3.16.16",
|
|
50
|
+
"@react-spectrum/calendar": "^3.7.3",
|
|
51
|
+
"@react-spectrum/dialog": "^3.8.23",
|
|
52
|
+
"@react-spectrum/form": "^3.7.16",
|
|
53
|
+
"@react-spectrum/label": "^3.16.16",
|
|
54
|
+
"@react-spectrum/layout": "^3.6.16",
|
|
55
|
+
"@react-spectrum/utils": "^3.12.6",
|
|
56
|
+
"@react-spectrum/view": "^3.6.20",
|
|
57
|
+
"@react-stately/datepicker": "^3.14.2",
|
|
58
|
+
"@react-types/datepicker": "^3.12.2",
|
|
59
|
+
"@react-types/shared": "^3.30.0",
|
|
60
|
+
"@spectrum-icons/ui": "^3.6.17",
|
|
61
|
+
"@spectrum-icons/workflow": "^4.2.22",
|
|
58
62
|
"@swc/helpers": "^0.5.0"
|
|
59
63
|
},
|
|
60
64
|
"devDependencies": {
|
|
@@ -69,5 +73,5 @@
|
|
|
69
73
|
"publishConfig": {
|
|
70
74
|
"access": "public"
|
|
71
75
|
},
|
|
72
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "a063122082d2b372e4846b58c85ae69ec73887ff"
|
|
73
77
|
}
|
package/src/utils.tsx
CHANGED
|
@@ -31,11 +31,12 @@ export function useFormatHelpText(props: Pick<SpectrumDatePickerBase<any>, 'desc
|
|
|
31
31
|
if (props.showFormatHelpText) {
|
|
32
32
|
return (
|
|
33
33
|
formatter.formatToParts(new Date()).map((s, i) => {
|
|
34
|
-
if (s.type === 'literal') {
|
|
34
|
+
if (s.type === 'literal' || s.type === 'unknown' || (s.type as string) === 'yearName') {
|
|
35
35
|
return <span key={i}>{` ${s.value} `}</span>;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
let type = s.type as string === 'relatedYear' ? 'year' : s.type;
|
|
39
|
+
return <span key={i} style={{unicodeBidi: 'embed', direction: 'ltr'}}>{displayNames.of(type)}</span>;
|
|
39
40
|
})
|
|
40
41
|
);
|
|
41
42
|
}
|