@atlaskit/datetime-picker 17.4.5 → 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.
Files changed (35) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/codemods/14.0.0-remove-duplicate-and-unused-props.tsx +1 -1
  3. package/codemods/utils/helpers.tsx +17 -17
  4. package/dist/cjs/components/date-picker.js +614 -8
  5. package/dist/cjs/components/date-time-picker-class.js +2 -8
  6. package/dist/cjs/components/date-time-picker-fc.js +2 -8
  7. package/dist/es2019/components/date-picker.js +546 -6
  8. package/dist/es2019/components/date-time-picker-class.js +1 -5
  9. package/dist/es2019/components/date-time-picker-fc.js +1 -5
  10. package/dist/esm/components/date-picker.js +613 -8
  11. package/dist/esm/components/date-time-picker-class.js +1 -7
  12. package/dist/esm/components/date-time-picker-fc.js +1 -7
  13. package/dist/esm/internal/fixed-layer-menu.js +3 -2
  14. package/dist/esm/internal/indicators-container.js +3 -2
  15. package/dist/types/components/date-picker.d.ts +18 -3
  16. package/dist/types/components/date-time-picker-class.d.ts +4 -4
  17. package/dist/types-ts4.5/components/date-picker.d.ts +18 -3
  18. package/dist/types-ts4.5/components/date-time-picker-class.d.ts +4 -4
  19. package/package.json +3 -3
  20. package/dist/cjs/components/date-picker-class.js +0 -658
  21. package/dist/cjs/components/date-picker-fc.js +0 -622
  22. package/dist/es2019/components/date-picker-class.js +0 -623
  23. package/dist/es2019/components/date-picker-fc.compiled.css +0 -16
  24. package/dist/es2019/components/date-picker-fc.js +0 -547
  25. package/dist/esm/components/date-picker-class.compiled.css +0 -16
  26. package/dist/esm/components/date-picker-class.js +0 -652
  27. package/dist/esm/components/date-picker-fc.compiled.css +0 -16
  28. package/dist/esm/components/date-picker-fc.js +0 -614
  29. package/dist/types/components/date-picker-class.d.ts +0 -109
  30. package/dist/types/components/date-picker-fc.d.ts +0 -19
  31. package/dist/types-ts4.5/components/date-picker-class.d.ts +0 -109
  32. package/dist/types-ts4.5/components/date-picker-fc.d.ts +0 -19
  33. /package/dist/cjs/components/{date-picker-class.compiled.css → date-picker.compiled.css} +0 -0
  34. /package/dist/{cjs/components/date-picker-fc.compiled.css → es2019/components/date-picker.compiled.css} +0 -0
  35. /package/dist/{es2019/components/date-picker-class.compiled.css → esm/components/date-picker.compiled.css} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/datetime-picker
2
2
 
3
+ ## 17.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 17.5.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`2d81fca9ecf1e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2d81fca9ecf1e) -
14
+ Clean up flag to convert date picker from a class component to a functional component.
15
+
3
16
  ## 17.4.5
4
17
 
5
18
  ### Patch Changes
@@ -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,