@atlaskit/datetime-picker 17.6.5 → 17.8.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 (149) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/date-picker/package.json +17 -0
  3. package/date-time-picker/package.json +17 -0
  4. package/dist/cjs/components/date-picker.js +20 -15
  5. package/dist/cjs/components/date-time-picker-class.js +7 -9
  6. package/dist/cjs/components/date-time-picker-fc.js +468 -7
  7. package/dist/cjs/components/time-picker.js +11 -8
  8. package/dist/cjs/entry-points/date-picker.js +13 -0
  9. package/dist/cjs/entry-points/date-time-picker.js +13 -0
  10. package/dist/cjs/entry-points/time-picker.js +13 -0
  11. package/dist/cjs/entry-points/types.js +1 -0
  12. package/dist/cjs/internal/convert-to24hr-time.js +66 -0
  13. package/dist/cjs/internal/default-date-format.js +7 -0
  14. package/dist/cjs/internal/default-times.js +7 -0
  15. package/dist/cjs/internal/empty-component.js +12 -0
  16. package/dist/cjs/internal/format-date-time-zone-into-iso.js +15 -0
  17. package/dist/cjs/internal/format-date.js +39 -0
  18. package/dist/cjs/internal/{date-picker-migration.js → get-parsed-iso.js} +4 -48
  19. package/dist/cjs/internal/get-placeholder.js +32 -0
  20. package/dist/cjs/internal/get-safe-calendar-value.js +18 -0
  21. package/dist/cjs/internal/get-short-iso-string.js +13 -0
  22. package/dist/cjs/internal/is-date-disabled.js +29 -0
  23. package/dist/cjs/internal/is-valid.js +39 -0
  24. package/dist/cjs/internal/pad-two.js +9 -0
  25. package/dist/cjs/internal/parse-date.js +31 -20
  26. package/dist/cjs/internal/parse-time.js +6 -102
  27. package/dist/cjs/internal/placeholder-date-time.js +9 -0
  28. package/dist/cjs/internal/remove-spacer.js +9 -0
  29. package/dist/es2019/components/date-picker.js +9 -4
  30. package/dist/es2019/components/date-time-picker-class.js +4 -6
  31. package/dist/es2019/components/date-time-picker-fc.js +451 -5
  32. package/dist/es2019/components/time-picker.js +5 -2
  33. package/dist/es2019/entry-points/date-picker.js +1 -0
  34. package/dist/es2019/entry-points/date-time-picker.js +1 -0
  35. package/dist/es2019/entry-points/time-picker.js +1 -0
  36. package/dist/es2019/entry-points/types.js +0 -0
  37. package/dist/es2019/internal/convert-to24hr-time.js +60 -0
  38. package/dist/es2019/internal/default-date-format.js +1 -0
  39. package/dist/es2019/internal/default-times.js +1 -0
  40. package/dist/es2019/internal/empty-component.js +4 -0
  41. package/dist/es2019/internal/format-date-time-zone-into-iso.js +9 -0
  42. package/dist/es2019/internal/format-date.js +34 -0
  43. package/dist/es2019/internal/{date-picker-migration.js → get-parsed-iso.js} +2 -54
  44. package/dist/es2019/internal/get-placeholder.js +28 -0
  45. package/dist/es2019/internal/get-safe-calendar-value.js +11 -0
  46. package/dist/es2019/internal/get-short-iso-string.js +6 -0
  47. package/dist/es2019/internal/is-date-disabled.js +25 -0
  48. package/dist/es2019/internal/is-valid.js +33 -0
  49. package/dist/es2019/internal/pad-two.js +3 -0
  50. package/dist/es2019/internal/parse-date.js +33 -18
  51. package/dist/es2019/internal/parse-time.js +3 -96
  52. package/dist/es2019/internal/placeholder-date-time.js +3 -0
  53. package/dist/es2019/internal/remove-spacer.js +3 -0
  54. package/dist/esm/components/date-picker.js +9 -4
  55. package/dist/esm/components/date-time-picker-class.js +4 -6
  56. package/dist/esm/components/date-time-picker-fc.js +468 -7
  57. package/dist/esm/components/time-picker.js +5 -2
  58. package/dist/esm/entry-points/date-picker.js +1 -0
  59. package/dist/esm/entry-points/date-time-picker.js +1 -0
  60. package/dist/esm/entry-points/time-picker.js +1 -0
  61. package/dist/esm/entry-points/types.js +0 -0
  62. package/dist/esm/internal/convert-to24hr-time.js +60 -0
  63. package/dist/esm/internal/default-date-format.js +1 -0
  64. package/dist/esm/internal/default-times.js +1 -0
  65. package/dist/esm/internal/empty-component.js +6 -0
  66. package/dist/esm/internal/format-date-time-zone-into-iso.js +9 -0
  67. package/dist/esm/internal/format-date.js +32 -0
  68. package/dist/esm/internal/{date-picker-migration.js → get-parsed-iso.js} +2 -46
  69. package/dist/esm/internal/get-placeholder.js +26 -0
  70. package/dist/esm/internal/get-safe-calendar-value.js +11 -0
  71. package/dist/esm/internal/get-short-iso-string.js +6 -0
  72. package/dist/esm/internal/is-date-disabled.js +23 -0
  73. package/dist/esm/internal/is-valid.js +33 -0
  74. package/dist/esm/internal/pad-two.js +3 -0
  75. package/dist/esm/internal/parse-date.js +31 -18
  76. package/dist/esm/internal/parse-time.js +3 -96
  77. package/dist/esm/internal/placeholder-date-time.js +3 -0
  78. package/dist/esm/internal/remove-spacer.js +3 -0
  79. package/dist/types/components/date-time-picker-class.d.ts +0 -2
  80. package/dist/types/components/date-time-picker-fc.d.ts +4 -2
  81. package/dist/types/entry-points/date-picker.d.ts +2 -0
  82. package/dist/types/entry-points/date-time-picker.d.ts +1 -0
  83. package/dist/types/entry-points/time-picker.d.ts +1 -0
  84. package/dist/types/entry-points/types.d.ts +1 -0
  85. package/dist/types/internal/convert-to24hr-time.d.ts +7 -0
  86. package/dist/types/internal/default-date-format.d.ts +1 -0
  87. package/dist/types/internal/default-times.d.ts +1 -0
  88. package/dist/types/internal/empty-component.d.ts +4 -0
  89. package/dist/types/internal/format-date-time-zone-into-iso.d.ts +4 -0
  90. package/dist/{types-ts4.5/internal/date-picker-migration.d.ts → types/internal/format-date.d.ts} +0 -28
  91. package/dist/types/internal/get-parsed-iso.d.ts +20 -0
  92. package/dist/types/internal/get-placeholder.d.ts +22 -0
  93. package/dist/types/internal/get-safe-calendar-value.d.ts +1 -0
  94. package/dist/types/internal/get-short-iso-string.d.ts +1 -0
  95. package/dist/types/internal/is-date-disabled.d.ts +20 -0
  96. package/dist/types/internal/is-valid.d.ts +1 -0
  97. package/dist/types/internal/pad-two.d.ts +1 -0
  98. package/dist/types/internal/parse-date.d.ts +26 -5
  99. package/dist/types/internal/parse-time.d.ts +0 -9
  100. package/dist/types/internal/placeholder-date-time.d.ts +1 -0
  101. package/dist/types/internal/remove-spacer.d.ts +1 -0
  102. package/dist/types-ts4.5/components/date-time-picker-class.d.ts +0 -2
  103. package/dist/types-ts4.5/components/date-time-picker-fc.d.ts +4 -2
  104. package/dist/types-ts4.5/entry-points/date-picker.d.ts +2 -0
  105. package/dist/types-ts4.5/entry-points/date-time-picker.d.ts +1 -0
  106. package/dist/types-ts4.5/entry-points/time-picker.d.ts +1 -0
  107. package/dist/types-ts4.5/entry-points/types.d.ts +1 -0
  108. package/dist/types-ts4.5/internal/convert-to24hr-time.d.ts +7 -0
  109. package/dist/types-ts4.5/internal/default-date-format.d.ts +1 -0
  110. package/dist/types-ts4.5/internal/default-times.d.ts +1 -0
  111. package/dist/types-ts4.5/internal/empty-component.d.ts +4 -0
  112. package/dist/types-ts4.5/internal/format-date-time-zone-into-iso.d.ts +4 -0
  113. package/dist/{types/internal/date-picker-migration.d.ts → types-ts4.5/internal/format-date.d.ts} +0 -28
  114. package/dist/types-ts4.5/internal/get-parsed-iso.d.ts +20 -0
  115. package/dist/types-ts4.5/internal/get-placeholder.d.ts +22 -0
  116. package/dist/types-ts4.5/internal/get-safe-calendar-value.d.ts +1 -0
  117. package/dist/types-ts4.5/internal/get-short-iso-string.d.ts +1 -0
  118. package/dist/types-ts4.5/internal/is-date-disabled.d.ts +20 -0
  119. package/dist/types-ts4.5/internal/is-valid.d.ts +1 -0
  120. package/dist/types-ts4.5/internal/pad-two.d.ts +1 -0
  121. package/dist/types-ts4.5/internal/parse-date.d.ts +26 -5
  122. package/dist/types-ts4.5/internal/parse-time.d.ts +0 -9
  123. package/dist/types-ts4.5/internal/placeholder-date-time.d.ts +1 -0
  124. package/dist/types-ts4.5/internal/remove-spacer.d.ts +1 -0
  125. package/package.json +11 -14
  126. package/time-picker/package.json +17 -0
  127. package/types/package.json +5 -5
  128. package/dist/cjs/components/date-time-picker-fc-new.js +0 -479
  129. package/dist/cjs/components/date-time-picker-fc-old.js +0 -370
  130. package/dist/cjs/internal/index.js +0 -31
  131. package/dist/es2019/components/date-time-picker-fc-new.js +0 -456
  132. package/dist/es2019/components/date-time-picker-fc-old.compiled.css +0 -6
  133. package/dist/es2019/components/date-time-picker-fc-old.js +0 -336
  134. package/dist/es2019/internal/index.js +0 -20
  135. package/dist/esm/components/date-time-picker-fc-new.compiled.css +0 -6
  136. package/dist/esm/components/date-time-picker-fc-new.js +0 -473
  137. package/dist/esm/components/date-time-picker-fc-old.compiled.css +0 -6
  138. package/dist/esm/components/date-time-picker-fc-old.js +0 -364
  139. package/dist/esm/internal/index.js +0 -22
  140. package/dist/types/components/date-time-picker-fc-new.d.ts +0 -6
  141. package/dist/types/components/date-time-picker-fc-old.d.ts +0 -6
  142. package/dist/types/internal/index.d.ts +0 -10
  143. package/dist/types-ts4.5/components/date-time-picker-fc-new.d.ts +0 -6
  144. package/dist/types-ts4.5/components/date-time-picker-fc-old.d.ts +0 -6
  145. package/dist/types-ts4.5/internal/index.d.ts +0 -10
  146. package/offerings.json +0 -98
  147. /package/dist/cjs/components/{date-time-picker-fc-new.compiled.css → date-time-picker-fc.compiled.css} +0 -0
  148. /package/dist/{cjs/components/date-time-picker-fc-old.compiled.css → es2019/components/date-time-picker-fc.compiled.css} +0 -0
  149. /package/dist/{es2019/components/date-time-picker-fc-new.compiled.css → esm/components/date-time-picker-fc.compiled.css} +0 -0
@@ -16,36 +16,8 @@
16
16
  * broken out to be it's own function.
17
17
  */
18
18
  import { type LocalizationProvider } from '@atlaskit/locale';
19
- export declare const isDateDisabled: (date: string, di: {
20
- disabled: string[];
21
- }) => boolean;
22
- export declare const getParsedISO: (di: {
23
- iso: string;
24
- }) => string;
25
- /**
26
- * There are two props that can change how the date is parsed.
27
- * The priority of props used is:
28
- * 1. `parseInputValue`
29
- * 2. `locale`
30
- */
31
- export declare const parseDate: (date: string, di: {
32
- parseInputValue: ((date: string, dateFormat: string) => Date) | undefined;
33
- dateFormat: string | undefined;
34
- l10n: LocalizationProvider;
35
- }) => Date;
36
- /**
37
- * There are multiple props that can change how the date is formatted.
38
- * The priority of props used is:
39
- * 1. `formatDisplayLabel`
40
- * 2. `dateFormat`
41
- * 3. `locale`
42
- */
43
19
  export declare const formatDate: (value: string, di: {
44
20
  formatDisplayLabel: ((value: string, dateFormat: string) => string) | undefined;
45
21
  dateFormat: string | undefined;
46
22
  l10n: LocalizationProvider;
47
23
  }) => string;
48
- export declare const getPlaceholder: (di: {
49
- placeholder: string | undefined;
50
- l10n: LocalizationProvider;
51
- }) => string;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Everything in this file is to smooth out the migration of the new date picker
3
+ * (https://product-fabric.atlassian.net/browse/DSP-20682). When that ticket is
4
+ * complete, all of these functions will ilkely be merged back into the date
5
+ * picker. Please do not pre-optimize and put these back into the date picker
6
+ * unless you are working on the DTP Refresh and you have a good reason to do
7
+ * so, thank you!
8
+ *
9
+ * All variables within the `di` objects are dependency injections. They should
10
+ * be read from within the component at the end of the day. But because we are
11
+ * extracting them, we have to inject them in every place manually. When we
12
+ * re-introduce them to the components, we can likely remove the `di` variables
13
+ * and instead use internal variables.
14
+ *
15
+ * If component _only_ has injected variables, it is fully internal and was
16
+ * broken out to be it's own function.
17
+ */
18
+ export declare const getParsedISO: (di: {
19
+ iso: string;
20
+ }) => string;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Everything in this file is to smooth out the migration of the new date picker
3
+ * (https://product-fabric.atlassian.net/browse/DSP-20682). When that ticket is
4
+ * complete, all of these functions will ilkely be merged back into the date
5
+ * picker. Please do not pre-optimize and put these back into the date picker
6
+ * unless you are working on the DTP Refresh and you have a good reason to do
7
+ * so, thank you!
8
+ *
9
+ * All variables within the `di` objects are dependency injections. They should
10
+ * be read from within the component at the end of the day. But because we are
11
+ * extracting them, we have to inject them in every place manually. When we
12
+ * re-introduce them to the components, we can likely remove the `di` variables
13
+ * and instead use internal variables.
14
+ *
15
+ * If component _only_ has injected variables, it is fully internal and was
16
+ * broken out to be it's own function.
17
+ */
18
+ import { type LocalizationProvider } from '@atlaskit/locale';
19
+ export declare const getPlaceholder: (di: {
20
+ placeholder: string | undefined;
21
+ l10n: LocalizationProvider;
22
+ }) => string;
@@ -0,0 +1 @@
1
+ export declare function getSafeCalendarValue(calendarValue: string): string;
@@ -0,0 +1 @@
1
+ export declare function getShortISOString(date: Date): string;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Everything in this file is to smooth out the migration of the new date picker
3
+ * (https://product-fabric.atlassian.net/browse/DSP-20682). When that ticket is
4
+ * complete, all of these functions will ilkely be merged back into the date
5
+ * picker. Please do not pre-optimize and put these back into the date picker
6
+ * unless you are working on the DTP Refresh and you have a good reason to do
7
+ * so, thank you!
8
+ *
9
+ * All variables within the `di` objects are dependency injections. They should
10
+ * be read from within the component at the end of the day. But because we are
11
+ * extracting them, we have to inject them in every place manually. When we
12
+ * re-introduce them to the components, we can likely remove the `di` variables
13
+ * and instead use internal variables.
14
+ *
15
+ * If component _only_ has injected variables, it is fully internal and was
16
+ * broken out to be it's own function.
17
+ */
18
+ export declare const isDateDisabled: (date: string, di: {
19
+ disabled: string[];
20
+ }) => boolean;
@@ -0,0 +1 @@
1
+ export declare function isValid(timeString: string): boolean;
@@ -0,0 +1 @@
1
+ export declare function padToTwo(number: number): string;
@@ -1,8 +1,29 @@
1
1
  /**
2
- * Converts a Date object into an ISO date, formatted `YYYY-MM-DD`.
2
+ * Everything in this file is to smooth out the migration of the new date picker
3
+ * (https://product-fabric.atlassian.net/browse/DSP-20682). When that ticket is
4
+ * complete, all of these functions will ilkely be merged back into the date
5
+ * picker. Please do not pre-optimize and put these back into the date picker
6
+ * unless you are working on the DTP Refresh and you have a good reason to do
7
+ * so, thank you!
3
8
  *
4
- * @param date The date to convert.
5
- * @returns An ISO date (`YYYY-MM-DD`).
9
+ * All variables within the `di` objects are dependency injections. They should
10
+ * be read from within the component at the end of the day. But because we are
11
+ * extracting them, we have to inject them in every place manually. When we
12
+ * re-introduce them to the components, we can likely remove the `di` variables
13
+ * and instead use internal variables.
14
+ *
15
+ * If component _only_ has injected variables, it is fully internal and was
16
+ * broken out to be it's own function.
17
+ */
18
+ import { type LocalizationProvider } from '@atlaskit/locale';
19
+ /**
20
+ * There are two props that can change how the date is parsed.
21
+ * The priority of props used is:
22
+ * 1. `parseInputValue`
23
+ * 2. `locale`
6
24
  */
7
- export declare function getShortISOString(date: Date): string;
8
- export declare function getSafeCalendarValue(calendarValue: string): string;
25
+ export declare const parseDate: (date: string, di: {
26
+ parseInputValue: ((date: string, dateFormat: string) => Date) | undefined;
27
+ dateFormat: string | undefined;
28
+ l10n: LocalizationProvider;
29
+ }) => Date;
@@ -1,10 +1 @@
1
- type TimeObject = {
2
- hour: number;
3
- minute: number;
4
- seconds: number;
5
- };
6
- export declare function isValid(timeString: string): boolean;
7
- export declare function removeSpacer(time: string): string;
8
- export declare function convertTo24hrTime(time: string): TimeObject | null;
9
1
  export default function parseTime(time: string): string | Date;
10
- export {};
@@ -0,0 +1 @@
1
+ export declare const placeholderDatetime: Date;
@@ -0,0 +1 @@
1
+ export declare function removeSpacer(time: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/datetime-picker",
3
- "version": "17.6.5",
3
+ "version": "17.8.0",
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/"
@@ -44,11 +44,11 @@
44
44
  "@atlaskit/calendar": "^17.2.0",
45
45
  "@atlaskit/css": "^0.19.0",
46
46
  "@atlaskit/ds-lib": "^7.0.0",
47
- "@atlaskit/icon": "^34.0.0",
48
- "@atlaskit/layering": "^3.6.0",
49
- "@atlaskit/locale": "^4.0.0",
47
+ "@atlaskit/icon": "^34.3.0",
48
+ "@atlaskit/layering": "^3.7.0",
49
+ "@atlaskit/locale": "^4.1.0",
50
50
  "@atlaskit/platform-feature-flags": "^1.1.0",
51
- "@atlaskit/popper": "^7.1.0",
51
+ "@atlaskit/popper": "^7.2.0",
52
52
  "@atlaskit/primitives": "^19.0.0",
53
53
  "@atlaskit/select": "^21.10.0",
54
54
  "@atlaskit/tokens": "^13.0.0",
@@ -63,18 +63,18 @@
63
63
  "@af/accessibility-testing": "workspace:^",
64
64
  "@af/integration-testing": "workspace:^",
65
65
  "@af/visual-regression": "workspace:^",
66
- "@atlaskit/code": "^17.4.0",
66
+ "@atlaskit/code": "^17.5.0",
67
67
  "@atlaskit/codemod-utils": "^4.2.0",
68
- "@atlaskit/docs": "^11.7.0",
68
+ "@atlaskit/docs": "^11.8.0",
69
69
  "@atlaskit/form": "^15.5.0",
70
70
  "@atlaskit/heading": "^5.4.0",
71
71
  "@atlaskit/link": "^3.4.0",
72
- "@atlaskit/modal-dialog": "^14.15.0",
73
- "@atlaskit/popup": "^4.16.0",
74
- "@atlaskit/range": "^10.0.0",
72
+ "@atlaskit/modal-dialog": "^14.18.0",
73
+ "@atlaskit/popup": "^4.17.0",
74
+ "@atlaskit/range": "^10.1.0",
75
75
  "@atlaskit/section-message": "^8.12.0",
76
76
  "@atlaskit/textfield": "^8.3.0",
77
- "@atlaskit/toggle": "^15.5.0",
77
+ "@atlaskit/toggle": "^15.6.0",
78
78
  "@atlassian/feature-flags-test-utils": "^1.0.0",
79
79
  "@atlassian/react-compiler-gating": "workspace:^",
80
80
  "@atlassian/ssr-tests": "workspace:^",
@@ -115,9 +115,6 @@
115
115
  "dst-date-picker-use-functional-component": {
116
116
  "type": "boolean"
117
117
  },
118
- "dst-a11y_fix-dtp-value-calculation": {
119
- "type": "boolean"
120
- },
121
118
  "dst-date-time-picker-use-functional-component": {
122
119
  "type": "boolean"
123
120
  },
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@atlaskit/datetime-picker/time-picker",
3
+ "main": "../dist/cjs/entry-points/time-picker.js",
4
+ "module": "../dist/esm/entry-points/time-picker.js",
5
+ "module:es2019": "../dist/es2019/entry-points/time-picker.js",
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
9
+ "types": "../dist/types/entry-points/time-picker.d.ts",
10
+ "typesVersions": {
11
+ ">=4.5 <5.9": {
12
+ "*": [
13
+ "../dist/types-ts4.5/entry-points/time-picker.d.ts"
14
+ ]
15
+ }
16
+ }
17
+ }
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@atlaskit/datetime-picker/types",
3
- "main": "../dist/cjs/types.js",
4
- "module": "../dist/esm/types.js",
5
- "module:es2019": "../dist/es2019/types.js",
3
+ "main": "../dist/cjs/entry-points/types.js",
4
+ "module": "../dist/esm/entry-points/types.js",
5
+ "module:es2019": "../dist/es2019/entry-points/types.js",
6
6
  "sideEffects": [
7
7
  "**/*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/types.d.ts",
9
+ "types": "../dist/types/entry-points/types.d.ts",
10
10
  "typesVersions": {
11
11
  ">=4.5 <5.9": {
12
12
  "*": [
13
- "../dist/types-ts4.5/types.d.ts"
13
+ "../dist/types-ts4.5/entry-points/types.d.ts"
14
14
  ]
15
15
  }
16
16
  }