@atlaskit/datetime-picker 17.5.0 → 17.5.1
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 +6 -0
- package/codemods/14.0.0-remove-duplicate-and-unused-props.tsx +1 -1
- package/codemods/utils/helpers.tsx +17 -17
- package/dist/esm/internal/fixed-layer-menu.js +3 -2
- package/dist/esm/internal/indicators-container.js +3 -2
- package/dist/types/components/date-time-picker-class.d.ts +8 -8
- package/dist/types/components/date-time-picker.d.ts +8 -8
- package/dist/types-ts4.5/components/date-time-picker-class.d.ts +8 -8
- package/dist/types-ts4.5/components/date-time-picker.d.ts +8 -8
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -409,7 +409,7 @@ function moveDateTimePickerProps(
|
|
|
409
409
|
});
|
|
410
410
|
}
|
|
411
411
|
|
|
412
|
-
export default function transformer(fileInfo: FileInfo, { jscodeshift: j }: API, options: Options) {
|
|
412
|
+
export default function transformer(fileInfo: FileInfo, { jscodeshift: j }: API, options: Options): string {
|
|
413
413
|
const { source } = fileInfo;
|
|
414
414
|
const collection = j(source);
|
|
415
415
|
|
|
@@ -19,7 +19,7 @@ export function hasImportDeclaration(
|
|
|
19
19
|
j: JSCodeshift,
|
|
20
20
|
collection: Collection<any>,
|
|
21
21
|
importPath: string,
|
|
22
|
-
) {
|
|
22
|
+
): boolean {
|
|
23
23
|
return getImportDeclarationCollection(j, collection, importPath).length > 0;
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -27,13 +27,13 @@ export function getImportDeclarationCollection(
|
|
|
27
27
|
j: JSCodeshift,
|
|
28
28
|
collection: Collection<any>,
|
|
29
29
|
importPath: string,
|
|
30
|
-
) {
|
|
30
|
+
): Collection<ImportDeclaration> {
|
|
31
31
|
return collection
|
|
32
32
|
.find(j.ImportDeclaration)
|
|
33
33
|
.filter((importDeclarationPath) => importDeclarationPath.node.source.value === importPath);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
export function hasDynamicImport(j: JSCodeshift, collection: Collection<any>, importPath: string) {
|
|
36
|
+
export function hasDynamicImport(j: JSCodeshift, collection: Collection<any>, importPath: string): boolean {
|
|
37
37
|
return getDynamicImportCollection(j, collection, importPath).length > 0;
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -41,7 +41,7 @@ export function getDynamicImportCollection(
|
|
|
41
41
|
j: JSCodeshift,
|
|
42
42
|
collection: Collection<any>,
|
|
43
43
|
importPath: string,
|
|
44
|
-
) {
|
|
44
|
+
): Collection<CallExpression> {
|
|
45
45
|
return collection.find(j.CallExpression).filter((callExpressionPath) => {
|
|
46
46
|
const { callee, arguments: callExpressionArguments } = callExpressionPath.node;
|
|
47
47
|
|
|
@@ -76,13 +76,13 @@ export function getImportSpecifierCollection(
|
|
|
76
76
|
j: JSCodeshift,
|
|
77
77
|
importDeclarationCollection: Collection<ImportDeclaration>,
|
|
78
78
|
importName: string,
|
|
79
|
-
) {
|
|
79
|
+
): Collection<ImportSpecifier> {
|
|
80
80
|
return importDeclarationCollection
|
|
81
81
|
.find(j.ImportSpecifier)
|
|
82
82
|
.filter((importSpecifierPath) => importSpecifierPath.node.imported.name === importName);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
export function getImportSpecifierName(importSpecifierCollection: Collection<ImportSpecifier>) {
|
|
85
|
+
export function getImportSpecifierName(importSpecifierCollection: Collection<ImportSpecifier>): string | null {
|
|
86
86
|
if (importSpecifierCollection.length === 0) {
|
|
87
87
|
return null;
|
|
88
88
|
}
|
|
@@ -94,7 +94,7 @@ export function isVariableDeclaratorIdentifierPresent(
|
|
|
94
94
|
j: JSCodeshift,
|
|
95
95
|
collection: Collection<any>,
|
|
96
96
|
variableName: string,
|
|
97
|
-
) {
|
|
97
|
+
): boolean {
|
|
98
98
|
return collection
|
|
99
99
|
.find(j.VariableDeclaration)
|
|
100
100
|
.find(j.VariableDeclarator)
|
|
@@ -109,7 +109,7 @@ export function isFunctionDeclarationIdentifierPresent(
|
|
|
109
109
|
j: JSCodeshift,
|
|
110
110
|
collection: Collection<any>,
|
|
111
111
|
variableName: string,
|
|
112
|
-
) {
|
|
112
|
+
): boolean {
|
|
113
113
|
return collection.find(j.FunctionDeclaration).some((functionDeclarationPath) => {
|
|
114
114
|
const { id } = functionDeclarationPath.node;
|
|
115
115
|
|
|
@@ -121,7 +121,7 @@ export function isClassDeclarationIdentifierPresent(
|
|
|
121
121
|
j: JSCodeshift,
|
|
122
122
|
collection: Collection<any>,
|
|
123
123
|
variableName: string,
|
|
124
|
-
) {
|
|
124
|
+
): boolean {
|
|
125
125
|
return collection.find(j.ClassDeclaration).some((classDeclarationPath) => {
|
|
126
126
|
const { id } = classDeclarationPath.node;
|
|
127
127
|
|
|
@@ -133,7 +133,7 @@ export function isImportDeclarationIdentifierPresent(
|
|
|
133
133
|
j: JSCodeshift,
|
|
134
134
|
collection: Collection<any>,
|
|
135
135
|
variableName: string,
|
|
136
|
-
) {
|
|
136
|
+
): boolean {
|
|
137
137
|
return collection
|
|
138
138
|
.find(j.ImportDeclaration)
|
|
139
139
|
.find(j.Identifier)
|
|
@@ -194,7 +194,7 @@ export function getJSXSpreadObjectExpressionAttributesByName(
|
|
|
194
194
|
j: JSCodeshift,
|
|
195
195
|
jsxElementPath: ASTPath<JSXElement>,
|
|
196
196
|
attributeName: string,
|
|
197
|
-
) {
|
|
197
|
+
): Collection<ObjectProperty> {
|
|
198
198
|
return j(jsxElementPath)
|
|
199
199
|
.find(j.JSXOpeningElement)
|
|
200
200
|
.find(j.JSXSpreadAttribute)
|
|
@@ -207,7 +207,7 @@ export function getJSXSpreadObjectExpressionAttributesByName(
|
|
|
207
207
|
);
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
export const createRemoveFuncFor =
|
|
210
|
+
export const createRemoveFuncFor: (component: string, importName: string, prop: string, comment?: string) => (j: core.JSCodeshift, source: Collection<Node>) => void =
|
|
211
211
|
(component: string, importName: string, prop: string, comment?: string) =>
|
|
212
212
|
(j: core.JSCodeshift, source: Collection<Node>) => {
|
|
213
213
|
const specifier = getNamedSpecifier(j, source, component, importName);
|
|
@@ -226,7 +226,7 @@ export const createRemoveFuncFor =
|
|
|
226
226
|
});
|
|
227
227
|
};
|
|
228
228
|
|
|
229
|
-
export const getJSXAttributeByName = (
|
|
229
|
+
export const getJSXAttributeByName: (j: JSCodeshift, jsxElementPath: ASTPath<JSXElement>, attributeName: string) => JSXAttribute | undefined = (
|
|
230
230
|
j: JSCodeshift,
|
|
231
231
|
jsxElementPath: ASTPath<JSXElement>,
|
|
232
232
|
attributeName: string,
|
|
@@ -236,7 +236,7 @@ export const getJSXAttributeByName = (
|
|
|
236
236
|
return attributes?.find((attr) => attr.name && attr.name.name === attributeName);
|
|
237
237
|
};
|
|
238
238
|
|
|
239
|
-
export const addJSXAttributeToJSXElement = (
|
|
239
|
+
export const addJSXAttributeToJSXElement: (j: JSCodeshift, jsxElementPath: ASTPath<JSXElement>, jsxAttribute: JSXAttribute) => void = (
|
|
240
240
|
j: JSCodeshift,
|
|
241
241
|
jsxElementPath: ASTPath<JSXElement>,
|
|
242
242
|
jsxAttribute: JSXAttribute,
|
|
@@ -248,7 +248,7 @@ export const addJSXAttributeToJSXElement = (
|
|
|
248
248
|
});
|
|
249
249
|
};
|
|
250
250
|
|
|
251
|
-
export const removeJSXAttributeByName = (
|
|
251
|
+
export const removeJSXAttributeByName: (j: JSCodeshift, jsxElementPath: ASTPath<JSXElement>, attrName: string) => void = (
|
|
252
252
|
j: JSCodeshift,
|
|
253
253
|
jsxElementPath: ASTPath<JSXElement>,
|
|
254
254
|
attrName: string,
|
|
@@ -260,10 +260,10 @@ export const removeJSXAttributeByName = (
|
|
|
260
260
|
}
|
|
261
261
|
};
|
|
262
262
|
|
|
263
|
-
export const getJSXAttributes = (jsxElementPath: ASTPath<JSXElement>) =>
|
|
263
|
+
export const getJSXAttributes: (jsxElementPath: ASTPath<JSXElement>) => JSXAttribute[] = (jsxElementPath: ASTPath<JSXElement>) =>
|
|
264
264
|
jsxElementPath.node.openingElement.attributes as JSXAttribute[];
|
|
265
265
|
|
|
266
|
-
export const removeJSXAttributeObjectPropertyByName = (
|
|
266
|
+
export const removeJSXAttributeObjectPropertyByName: (j: JSCodeshift, jsxElementPath: ASTPath<JSXElement>, attrName: string, propertyToRemove: string) => void = (
|
|
267
267
|
j: JSCodeshift,
|
|
268
268
|
jsxElementPath: ASTPath<JSXElement>,
|
|
269
269
|
attrName: string,
|
|
@@ -10,7 +10,7 @@ import FixedLayer from '../internal/fixed-layer';
|
|
|
10
10
|
/**
|
|
11
11
|
* This is the fixed layer menu used in the time picker.
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
var FixedLayerMenu = function FixedLayerMenu(_ref) {
|
|
14
14
|
var className = _ref.className,
|
|
15
15
|
clearValue = _ref.clearValue,
|
|
16
16
|
cx = _ref.cx,
|
|
@@ -67,4 +67,5 @@ export var FixedLayerMenu = function FixedLayerMenu(_ref) {
|
|
|
67
67
|
,
|
|
68
68
|
testId: selectProps.testId
|
|
69
69
|
});
|
|
70
|
-
};
|
|
70
|
+
};
|
|
71
|
+
export { FixedLayerMenu };
|
|
@@ -11,10 +11,11 @@ var styles = {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
14
|
-
|
|
14
|
+
var IndicatorsContainer = function IndicatorsContainer(_ref) {
|
|
15
15
|
var showClearIndicator = _ref.showClearIndicator,
|
|
16
16
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
17
17
|
return /*#__PURE__*/React.createElement("div", {
|
|
18
18
|
className: ax([showClearIndicator ? styles.calendarButtonInclusionStyles : styles.calendarButtonOnlyInclusionStyles])
|
|
19
19
|
}, /*#__PURE__*/React.createElement(components.IndicatorsContainer, rest));
|
|
20
|
-
};
|
|
20
|
+
};
|
|
21
|
+
export { IndicatorsContainer };
|
|
@@ -52,24 +52,24 @@ export { DateTimePickerComponent as DateTimePickerWithoutAnalytics };
|
|
|
52
52
|
* - [Usage](https://atlassian.design/components/datetime-picker/usage)
|
|
53
53
|
*/
|
|
54
54
|
declare const DateTimePicker: React.ForwardRefExoticComponent<Omit<Omit<Pick<Omit<DateTimePickerBaseProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, never> & {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
appearance?: import("..").Appearance | undefined;
|
|
56
|
+
isDisabled?: boolean | undefined;
|
|
57
|
+
innerProps?: React.AllHTMLAttributes<HTMLElement> | undefined;
|
|
58
58
|
defaultValue?: string | undefined;
|
|
59
59
|
autoFocus?: boolean | undefined;
|
|
60
|
+
id?: string | undefined;
|
|
60
61
|
'aria-describedby'?: string | undefined;
|
|
61
62
|
onFocus?: React.FocusEventHandler<HTMLInputElement> | undefined;
|
|
62
63
|
onBlur?: React.FocusEventHandler<HTMLInputElement> | undefined;
|
|
63
64
|
onChange?: ((value: string) => void) | undefined;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
spacing?: import("..").Spacing | undefined;
|
|
65
|
+
value?: string | undefined;
|
|
66
|
+
name?: string | undefined;
|
|
67
67
|
testId?: string | undefined;
|
|
68
68
|
locale?: string | undefined;
|
|
69
|
-
innerProps?: React.AllHTMLAttributes<HTMLElement> | undefined;
|
|
70
|
-
isInvalid?: boolean | undefined;
|
|
71
69
|
clearControlLabel?: string | undefined;
|
|
70
|
+
isInvalid?: boolean | undefined;
|
|
72
71
|
isRequired?: boolean | undefined;
|
|
72
|
+
spacing?: import("..").Spacing | undefined;
|
|
73
73
|
datePickerProps?: import("..").DatePickerProps | undefined;
|
|
74
74
|
timePickerProps?: import("..").TimePickerProps | undefined;
|
|
75
75
|
parseValue?: ((dateTimeValue: string, date: string, time: string, timezone: string) => {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
declare const DateTimePicker: import("react").FC<Omit<Omit<import("..").DateTimePickerProps, "ref"> & import("react").RefAttributes<HTMLElement>, "ref"> & Omit<Omit<Omit<Pick<Omit<import("..").DateTimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, never> & {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
appearance?: import("..").Appearance | undefined;
|
|
3
|
+
isDisabled?: boolean | undefined;
|
|
4
|
+
innerProps?: React.AllHTMLAttributes<HTMLElement> | undefined;
|
|
5
5
|
defaultValue?: string | undefined;
|
|
6
6
|
autoFocus?: boolean | undefined;
|
|
7
|
+
id?: string | undefined;
|
|
7
8
|
'aria-describedby'?: string | undefined;
|
|
8
9
|
onFocus?: React.FocusEventHandler<HTMLInputElement> | undefined;
|
|
9
10
|
onBlur?: React.FocusEventHandler<HTMLInputElement> | undefined;
|
|
10
11
|
onChange?: ((value: string) => void) | undefined;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
spacing?: import("..").Spacing | undefined;
|
|
12
|
+
value?: string | undefined;
|
|
13
|
+
name?: string | undefined;
|
|
14
14
|
testId?: string | undefined;
|
|
15
15
|
locale?: string | undefined;
|
|
16
|
-
innerProps?: React.AllHTMLAttributes<HTMLElement> | undefined;
|
|
17
|
-
isInvalid?: boolean | undefined;
|
|
18
16
|
clearControlLabel?: string | undefined;
|
|
17
|
+
isInvalid?: boolean | undefined;
|
|
19
18
|
isRequired?: boolean | undefined;
|
|
19
|
+
spacing?: import("..").Spacing | undefined;
|
|
20
20
|
datePickerProps?: import("..").DatePickerProps | undefined;
|
|
21
21
|
timePickerProps?: import("..").TimePickerProps | undefined;
|
|
22
22
|
parseValue?: ((dateTimeValue: string, date: string, time: string, timezone: string) => {
|
|
@@ -52,24 +52,24 @@ export { DateTimePickerComponent as DateTimePickerWithoutAnalytics };
|
|
|
52
52
|
* - [Usage](https://atlassian.design/components/datetime-picker/usage)
|
|
53
53
|
*/
|
|
54
54
|
declare const DateTimePicker: React.ForwardRefExoticComponent<Omit<Omit<Pick<Omit<DateTimePickerBaseProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, never> & {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
appearance?: import("..").Appearance | undefined;
|
|
56
|
+
isDisabled?: boolean | undefined;
|
|
57
|
+
innerProps?: React.AllHTMLAttributes<HTMLElement> | undefined;
|
|
58
58
|
defaultValue?: string | undefined;
|
|
59
59
|
autoFocus?: boolean | undefined;
|
|
60
|
+
id?: string | undefined;
|
|
60
61
|
'aria-describedby'?: string | undefined;
|
|
61
62
|
onFocus?: React.FocusEventHandler<HTMLInputElement> | undefined;
|
|
62
63
|
onBlur?: React.FocusEventHandler<HTMLInputElement> | undefined;
|
|
63
64
|
onChange?: ((value: string) => void) | undefined;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
spacing?: import("..").Spacing | undefined;
|
|
65
|
+
value?: string | undefined;
|
|
66
|
+
name?: string | undefined;
|
|
67
67
|
testId?: string | undefined;
|
|
68
68
|
locale?: string | undefined;
|
|
69
|
-
innerProps?: React.AllHTMLAttributes<HTMLElement> | undefined;
|
|
70
|
-
isInvalid?: boolean | undefined;
|
|
71
69
|
clearControlLabel?: string | undefined;
|
|
70
|
+
isInvalid?: boolean | undefined;
|
|
72
71
|
isRequired?: boolean | undefined;
|
|
72
|
+
spacing?: import("..").Spacing | undefined;
|
|
73
73
|
datePickerProps?: import("..").DatePickerProps | undefined;
|
|
74
74
|
timePickerProps?: import("..").TimePickerProps | undefined;
|
|
75
75
|
parseValue?: ((dateTimeValue: string, date: string, time: string, timezone: string) => {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
declare const DateTimePicker: import("react").FC<Omit<Omit<import("..").DateTimePickerProps, "ref"> & import("react").RefAttributes<HTMLElement>, "ref"> & Omit<Omit<Omit<Pick<Omit<import("..").DateTimePickerProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, never> & {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
appearance?: import("..").Appearance | undefined;
|
|
3
|
+
isDisabled?: boolean | undefined;
|
|
4
|
+
innerProps?: React.AllHTMLAttributes<HTMLElement> | undefined;
|
|
5
5
|
defaultValue?: string | undefined;
|
|
6
6
|
autoFocus?: boolean | undefined;
|
|
7
|
+
id?: string | undefined;
|
|
7
8
|
'aria-describedby'?: string | undefined;
|
|
8
9
|
onFocus?: React.FocusEventHandler<HTMLInputElement> | undefined;
|
|
9
10
|
onBlur?: React.FocusEventHandler<HTMLInputElement> | undefined;
|
|
10
11
|
onChange?: ((value: string) => void) | undefined;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
spacing?: import("..").Spacing | undefined;
|
|
12
|
+
value?: string | undefined;
|
|
13
|
+
name?: string | undefined;
|
|
14
14
|
testId?: string | undefined;
|
|
15
15
|
locale?: string | undefined;
|
|
16
|
-
innerProps?: React.AllHTMLAttributes<HTMLElement> | undefined;
|
|
17
|
-
isInvalid?: boolean | undefined;
|
|
18
16
|
clearControlLabel?: string | undefined;
|
|
17
|
+
isInvalid?: boolean | undefined;
|
|
19
18
|
isRequired?: boolean | undefined;
|
|
19
|
+
spacing?: import("..").Spacing | undefined;
|
|
20
20
|
datePickerProps?: import("..").DatePickerProps | undefined;
|
|
21
21
|
timePickerProps?: import("..").TimePickerProps | undefined;
|
|
22
22
|
parseValue?: ((dateTimeValue: string, date: string, time: string, timezone: string) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/datetime-picker",
|
|
3
|
-
"version": "17.5.
|
|
3
|
+
"version": "17.5.1",
|
|
4
4
|
"description": "A date time picker allows the user to select an associated date and time.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@atlaskit/calendar": "^17.2.0",
|
|
38
38
|
"@atlaskit/css": "^0.19.0",
|
|
39
39
|
"@atlaskit/ds-lib": "^5.3.0",
|
|
40
|
-
"@atlaskit/icon": "^
|
|
40
|
+
"@atlaskit/icon": "^31.0.0",
|
|
41
41
|
"@atlaskit/layering": "^3.6.0",
|
|
42
42
|
"@atlaskit/locale": "^3.0.0",
|
|
43
43
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
61
61
|
"@atlaskit/docs": "^11.3.0",
|
|
62
62
|
"@atlaskit/form": "^15.3.0",
|
|
63
|
-
"@atlaskit/heading": "^5.
|
|
63
|
+
"@atlaskit/heading": "^5.3.0",
|
|
64
64
|
"@atlaskit/link": "^3.3.0",
|
|
65
65
|
"@atlaskit/modal-dialog": "^14.10.0",
|
|
66
66
|
"@atlaskit/popup": "^4.13.0",
|