@atlaskit/calendar 14.2.1 → 14.3.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 +793 -780
- package/README.md +2 -1
- package/__perf__/examples.tsx +53 -70
- package/codemods/11.0.0-lite-mode.tsx +2 -2
- package/codemods/__tests__/11.0.0-lite-mode.tsx +21 -21
- package/codemods/__tests__/flatten-certain-inner-props-as-prop.tsx +29 -31
- package/codemods/__tests__/remove-inner-props.tsx +28 -28
- package/codemods/migrations/flatten-certain-inner-props-as-prop.tsx +3 -3
- package/codemods/utils.tsx +150 -174
- package/dist/cjs/calendar.js +8 -3
- package/dist/cjs/internal/components/date.js +7 -0
- package/dist/cjs/internal/components/header.js +5 -0
- package/dist/cjs/internal/components/week-day-grid.js +5 -0
- package/dist/cjs/internal/components/week-days.js +5 -0
- package/dist/cjs/internal/components/week-header.js +5 -0
- package/dist/cjs/internal/styles/date.js +2 -0
- package/dist/es2019/calendar.js +10 -2
- package/dist/es2019/internal/components/date.js +7 -0
- package/dist/es2019/internal/components/header.js +5 -0
- package/dist/es2019/internal/components/week-day-grid.js +4 -0
- package/dist/es2019/internal/components/week-days.js +5 -0
- package/dist/es2019/internal/components/week-header.js +5 -0
- package/dist/es2019/internal/styles/date.js +2 -0
- package/dist/esm/calendar.js +10 -2
- package/dist/esm/internal/components/date.js +7 -0
- package/dist/esm/internal/components/header.js +5 -0
- package/dist/esm/internal/components/week-day-grid.js +4 -0
- package/dist/esm/internal/components/week-days.js +5 -0
- package/dist/esm/internal/components/week-header.js +5 -0
- package/dist/esm/internal/styles/date.js +2 -0
- package/dist/types/internal/components/header.d.ts +1 -1
- package/dist/types/internal/components/week-day-grid.d.ts +4 -1
- package/dist/types/internal/components/week-days.d.ts +1 -1
- package/dist/types/internal/hooks/use-calendar-ref.d.ts +1 -1
- package/dist/types/internal/hooks/use-focusing.d.ts +1 -1
- package/dist/types/internal/hooks/use-handle-date-select.d.ts +1 -1
- package/dist/types/internal/styles/date.d.ts +1 -1
- package/dist/types/types.d.ts +2 -2
- package/dist/types-ts4.5/internal/components/header.d.ts +1 -1
- package/dist/types-ts4.5/internal/components/week-day-grid.d.ts +4 -1
- package/dist/types-ts4.5/internal/components/week-days.d.ts +1 -1
- package/dist/types-ts4.5/internal/hooks/use-calendar-ref.d.ts +1 -1
- package/dist/types-ts4.5/internal/hooks/use-focusing.d.ts +1 -1
- package/dist/types-ts4.5/internal/hooks/use-handle-date-select.d.ts +1 -1
- package/dist/types-ts4.5/internal/styles/date.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +2 -2
- package/package.json +98 -100
- package/report.api.md +77 -76
package/codemods/utils.tsx
CHANGED
|
@@ -1,216 +1,192 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import type {
|
|
2
|
+
API,
|
|
3
|
+
ASTPath,
|
|
4
|
+
default as core,
|
|
5
|
+
FileInfo,
|
|
6
|
+
ImportDeclaration,
|
|
7
|
+
ImportSpecifier,
|
|
8
|
+
JSXAttribute,
|
|
9
|
+
ObjectExpression,
|
|
10
|
+
Options,
|
|
11
|
+
Program,
|
|
11
12
|
} from 'jscodeshift';
|
|
12
|
-
import { Collection } from 'jscodeshift/src/Collection';
|
|
13
|
+
import { type Collection } from 'jscodeshift/src/Collection';
|
|
13
14
|
|
|
14
15
|
export type Nullable<T> = T | null;
|
|
15
16
|
|
|
16
|
-
export function getDefaultSpecifier(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
)
|
|
27
|
-
.find(j.ImportDefaultSpecifier);
|
|
28
|
-
|
|
29
|
-
if (!specifiers.length) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
return specifiers.nodes()[0]!.local!.name;
|
|
17
|
+
export function getDefaultSpecifier(j: core.JSCodeshift, source: any, specifier: string) {
|
|
18
|
+
const specifiers = source
|
|
19
|
+
.find(j.ImportDeclaration)
|
|
20
|
+
.filter((path: ASTPath<ImportDeclaration>) => path.node.source.value === specifier)
|
|
21
|
+
.find(j.ImportDefaultSpecifier);
|
|
22
|
+
|
|
23
|
+
if (!specifiers.length) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return specifiers.nodes()[0]!.local!.name;
|
|
33
27
|
}
|
|
34
28
|
export function getNamedSpecifier(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
j: core.JSCodeshift,
|
|
30
|
+
source: any,
|
|
31
|
+
specifier: string,
|
|
32
|
+
importName: string,
|
|
39
33
|
) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
if (!specifiers.length) {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
return specifiers.nodes()[0]!.local!.name;
|
|
34
|
+
const specifiers = source
|
|
35
|
+
.find(j.ImportDeclaration)
|
|
36
|
+
.filter((path: ASTPath<ImportDeclaration>) => path.node.source.value === specifier)
|
|
37
|
+
.find(j.ImportSpecifier)
|
|
38
|
+
.filter((path: ASTPath<ImportSpecifier>) => path.node.imported.name === importName);
|
|
39
|
+
|
|
40
|
+
if (!specifiers.length) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
return specifiers.nodes()[0]!.local!.name;
|
|
56
44
|
}
|
|
57
45
|
|
|
58
46
|
export function getJSXAttributesByName(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
47
|
+
j: core.JSCodeshift,
|
|
48
|
+
element: ASTPath<any>,
|
|
49
|
+
attributeName: string,
|
|
62
50
|
): Collection<JSXAttribute> {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
51
|
+
return j(element)
|
|
52
|
+
.find(j.JSXOpeningElement)
|
|
53
|
+
.find(j.JSXAttribute)
|
|
54
|
+
.filter((attribute) => {
|
|
55
|
+
const matches = j(attribute)
|
|
56
|
+
.find(j.JSXIdentifier)
|
|
57
|
+
.filter((identifier) => identifier.value.name === attributeName);
|
|
58
|
+
return Boolean(matches.length);
|
|
59
|
+
});
|
|
72
60
|
}
|
|
73
61
|
|
|
74
|
-
export function hasImportDeclaration(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
typeof path.node.source.value === 'string' &&
|
|
84
|
-
path.node.source.value.startsWith(importPath),
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
return Boolean(imports.length);
|
|
62
|
+
export function hasImportDeclaration(j: core.JSCodeshift, source: any, importPath: string) {
|
|
63
|
+
const imports = source
|
|
64
|
+
.find(j.ImportDeclaration)
|
|
65
|
+
.filter(
|
|
66
|
+
(path: ASTPath<ImportDeclaration>) =>
|
|
67
|
+
typeof path.node.source.value === 'string' && path.node.source.value.startsWith(importPath),
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
return Boolean(imports.length);
|
|
88
71
|
}
|
|
89
72
|
// not replacing newlines (which \s does)
|
|
90
73
|
const spacesAndTabs: RegExp = /[ \t]{2,}/g;
|
|
91
74
|
const lineStartWithSpaces: RegExp = /^[ \t]*/gm;
|
|
92
75
|
|
|
93
76
|
function clean(value: string): string {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
77
|
+
return (
|
|
78
|
+
value
|
|
79
|
+
.replace(spacesAndTabs, ' ')
|
|
80
|
+
.replace(lineStartWithSpaces, '')
|
|
81
|
+
// using .trim() to clear the any newlines before the first text and after last text
|
|
82
|
+
.trim()
|
|
83
|
+
);
|
|
101
84
|
}
|
|
102
85
|
|
|
103
86
|
export function addCommentToStartOfFile({
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
87
|
+
j,
|
|
88
|
+
base,
|
|
89
|
+
message,
|
|
107
90
|
}: {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
91
|
+
j: core.JSCodeshift;
|
|
92
|
+
base: Collection<Node>;
|
|
93
|
+
message: string;
|
|
111
94
|
}) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
95
|
+
addCommentBefore({
|
|
96
|
+
j,
|
|
97
|
+
target: base.find(j.Program),
|
|
98
|
+
message,
|
|
99
|
+
});
|
|
117
100
|
}
|
|
118
101
|
|
|
119
102
|
export function addCommentBefore({
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
103
|
+
j,
|
|
104
|
+
target,
|
|
105
|
+
message,
|
|
123
106
|
}: {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
107
|
+
j: core.JSCodeshift;
|
|
108
|
+
target: Collection<Program> | Collection<ImportDeclaration>;
|
|
109
|
+
message: string;
|
|
127
110
|
}) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
111
|
+
const content: string = ` TODO: (from codemod) ${clean(message)} `;
|
|
112
|
+
target.forEach((path: ASTPath<Program | ImportDeclaration>) => {
|
|
113
|
+
path.value.comments = path.value.comments || [];
|
|
131
114
|
|
|
132
|
-
|
|
133
|
-
(comment) => comment.value === content,
|
|
134
|
-
);
|
|
115
|
+
const exists = path.value.comments.find((comment) => comment.value === content);
|
|
135
116
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
117
|
+
// avoiding duplicates of the same comment
|
|
118
|
+
if (exists) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
140
121
|
|
|
141
|
-
|
|
142
|
-
|
|
122
|
+
path.value.comments.push(j.commentBlock(content));
|
|
123
|
+
});
|
|
143
124
|
}
|
|
144
125
|
|
|
145
126
|
export const createRemoveFuncFor =
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
127
|
+
(component: string, prop: string, comment?: string) =>
|
|
128
|
+
(j: core.JSCodeshift, source: Collection<Node>) => {
|
|
129
|
+
const defaultSpecifier = getDefaultSpecifier(j, source, component);
|
|
130
|
+
|
|
131
|
+
if (!defaultSpecifier) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
source.findJSXElements(defaultSpecifier).forEach((element) => {
|
|
136
|
+
getJSXAttributesByName(j, element, prop).forEach((attribute) => {
|
|
137
|
+
j(attribute).remove();
|
|
138
|
+
if (comment) {
|
|
139
|
+
addCommentToStartOfFile({ j, base: source, message: comment });
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
};
|
|
163
144
|
|
|
164
145
|
export const flattenCertainChildPropsAsProp =
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
});
|
|
199
|
-
};
|
|
146
|
+
(component: string, propName: string, childProps: string[]) =>
|
|
147
|
+
(j: core.JSCodeshift, source: Collection<Node>) => {
|
|
148
|
+
const defaultSpecifier = getDefaultSpecifier(j, source, component);
|
|
149
|
+
if (!defaultSpecifier) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
source.findJSXElements(defaultSpecifier).forEach((element) => {
|
|
153
|
+
getJSXAttributesByName(j, element, propName).forEach((attribute) => {
|
|
154
|
+
j(attribute)
|
|
155
|
+
.find(j.JSXExpressionContainer)
|
|
156
|
+
.find(j.ObjectExpression)
|
|
157
|
+
.forEach((objectExpression) => {
|
|
158
|
+
objectExpression.node.properties.forEach((property) => {
|
|
159
|
+
childProps.forEach((childProp) => {
|
|
160
|
+
if (
|
|
161
|
+
property.type === 'ObjectProperty' &&
|
|
162
|
+
property.key.type === 'Identifier' &&
|
|
163
|
+
property.key.name === childProp &&
|
|
164
|
+
element.node.openingElement.attributes
|
|
165
|
+
) {
|
|
166
|
+
element.node.openingElement.attributes.push(
|
|
167
|
+
j.jsxAttribute(
|
|
168
|
+
j.jsxIdentifier(childProp),
|
|
169
|
+
j.jsxExpressionContainer(property.value as ObjectExpression),
|
|
170
|
+
),
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
};
|
|
200
179
|
|
|
201
180
|
export const createTransformer =
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
) =>
|
|
206
|
-
(fileInfo: FileInfo, { jscodeshift: j }: API, options: Options) => {
|
|
207
|
-
const source: Collection<Node> = j(fileInfo.source);
|
|
181
|
+
(component: string, migrates: { (j: core.JSCodeshift, source: Collection<Node>): void }[]) =>
|
|
182
|
+
(fileInfo: FileInfo, { jscodeshift: j }: API, options: Options) => {
|
|
183
|
+
const source: Collection<Node> = j(fileInfo.source);
|
|
208
184
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
185
|
+
if (!hasImportDeclaration(j, source, component)) {
|
|
186
|
+
return fileInfo.source;
|
|
187
|
+
}
|
|
212
188
|
|
|
213
|
-
|
|
189
|
+
migrates.forEach((tf) => tf(j, source));
|
|
214
190
|
|
|
215
|
-
|
|
216
|
-
|
|
191
|
+
return source.toSource(options.printOptions || { quote: 'single' });
|
|
192
|
+
};
|
package/dist/cjs/calendar.js
CHANGED
|
@@ -26,7 +26,9 @@ var _useHandleDateSelect2 = _interopRequireDefault(require("./internal/hooks/use
|
|
|
26
26
|
var _useLocale2 = _interopRequireDefault(require("./internal/hooks/use-locale"));
|
|
27
27
|
var _useUniqueId = _interopRequireDefault(require("./internal/hooks/use-unique-id"));
|
|
28
28
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
29
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /**
|
|
29
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /**
|
|
30
|
+
* @jsxRuntime classic
|
|
31
|
+
*/ /** @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
30
32
|
var boxStyles = (0, _primitives.xcss)({
|
|
31
33
|
display: 'inline-block',
|
|
32
34
|
userSelect: 'none'
|
|
@@ -34,7 +36,7 @@ var boxStyles = (0, _primitives.xcss)({
|
|
|
34
36
|
var analyticsAttributes = {
|
|
35
37
|
componentName: 'calendar',
|
|
36
38
|
packageName: "@atlaskit/calendar",
|
|
37
|
-
packageVersion: "14.
|
|
39
|
+
packageVersion: "14.3.0"
|
|
38
40
|
};
|
|
39
41
|
var InnerCalendar = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_ref, ref) {
|
|
40
42
|
var day = _ref.day,
|
|
@@ -189,7 +191,10 @@ var InnerCalendar = /*#__PURE__*/(0, _react.forwardRef)(function Calendar(_ref,
|
|
|
189
191
|
};
|
|
190
192
|
var headerId = (0, _useUniqueId.default)('month-year-header');
|
|
191
193
|
return (0, _react2.jsx)("div", {
|
|
192
|
-
|
|
194
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
195
|
+
className: className
|
|
196
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
197
|
+
,
|
|
193
198
|
style: style,
|
|
194
199
|
onBlur: handleContainerBlur,
|
|
195
200
|
onFocus: handleContainerFocus,
|
|
@@ -10,8 +10,13 @@ var _react2 = require("@emotion/react");
|
|
|
10
10
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
11
11
|
var _primitives = require("@atlaskit/primitives");
|
|
12
12
|
var _date = require("../styles/date");
|
|
13
|
+
/**
|
|
14
|
+
* @jsxRuntime classic
|
|
15
|
+
*/
|
|
13
16
|
/** @jsx jsx */
|
|
14
17
|
|
|
18
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
19
|
+
|
|
15
20
|
var Date = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(function Date(_ref2, _ref) {
|
|
16
21
|
var day = _ref2.children,
|
|
17
22
|
_ref2$isDisabled = _ref2.isDisabled,
|
|
@@ -69,6 +74,8 @@ var Date = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
69
74
|
});
|
|
70
75
|
}
|
|
71
76
|
}, [onClick]);
|
|
77
|
+
|
|
78
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
72
79
|
var dateCellStyles = (0, _react2.css)((0, _date.dateCellStyles)());
|
|
73
80
|
return (0, _react2.jsx)(_primitives.Grid, {
|
|
74
81
|
role: "gridcell",
|
|
@@ -14,8 +14,13 @@ var _chevronLeftLarge = _interopRequireDefault(require("@atlaskit/icon/glyph/che
|
|
|
14
14
|
var _chevronRightLarge = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-right-large"));
|
|
15
15
|
var _primitives = require("@atlaskit/primitives");
|
|
16
16
|
var _useUniqueId = _interopRequireDefault(require("../../internal/hooks/use-unique-id"));
|
|
17
|
+
/**
|
|
18
|
+
* @jsxRuntime classic
|
|
19
|
+
*/
|
|
17
20
|
/** @jsx jsx */
|
|
18
21
|
|
|
22
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
23
|
+
|
|
19
24
|
var Header = /*#__PURE__*/(0, _react.memo)(function Header(_ref) {
|
|
20
25
|
var monthLongTitle = _ref.monthLongTitle,
|
|
21
26
|
year = _ref.year,
|
|
@@ -6,8 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _primitives = require("@atlaskit/primitives");
|
|
9
|
+
/**
|
|
10
|
+
* @jsxRuntime classic
|
|
11
|
+
*/
|
|
9
12
|
/** @jsx jsx */
|
|
10
13
|
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
15
|
+
|
|
11
16
|
/**
|
|
12
17
|
* __Week day grid__
|
|
13
18
|
*
|
|
@@ -10,8 +10,13 @@ var _react2 = require("@emotion/react");
|
|
|
10
10
|
var _box = _interopRequireDefault(require("@atlaskit/primitives/box"));
|
|
11
11
|
var _date = _interopRequireDefault(require("./date"));
|
|
12
12
|
var _weekDayGrid = _interopRequireDefault(require("./week-day-grid"));
|
|
13
|
+
/**
|
|
14
|
+
* @jsxRuntime classic
|
|
15
|
+
*/
|
|
13
16
|
/** @jsx jsx */
|
|
14
17
|
|
|
18
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
19
|
+
|
|
15
20
|
var WeekDays = /*#__PURE__*/(0, _react.memo)(function WeekDays(_ref) {
|
|
16
21
|
var weeks = _ref.weeks,
|
|
17
22
|
handleClickDay = _ref.handleClickDay,
|
|
@@ -9,8 +9,13 @@ var _react = require("react");
|
|
|
9
9
|
var _react2 = require("@emotion/react");
|
|
10
10
|
var _primitives = require("@atlaskit/primitives");
|
|
11
11
|
var _weekDayGrid = _interopRequireDefault(require("./week-day-grid"));
|
|
12
|
+
/**
|
|
13
|
+
* @jsxRuntime classic
|
|
14
|
+
*/
|
|
12
15
|
/** @jsx jsx */
|
|
13
16
|
|
|
17
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
18
|
+
|
|
14
19
|
var columnHeaderStyles = (0, _primitives.xcss)({
|
|
15
20
|
minWidth: 'size.400',
|
|
16
21
|
// Account for languages with short week day names
|
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.dateCellStyles = void 0;
|
|
7
7
|
var _colors = require("@atlaskit/theme/colors");
|
|
8
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
+
|
|
8
10
|
var dateCellStyles = exports.dateCellStyles = function dateCellStyles() {
|
|
9
11
|
return {
|
|
10
12
|
all: 'unset',
|
package/dist/es2019/calendar.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/**
|
|
3
|
+
* @jsxRuntime classic
|
|
4
|
+
*/
|
|
2
5
|
/** @jsx jsx */
|
|
3
6
|
import { forwardRef, memo, useState } from 'react';
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
9
|
import { jsx } from '@emotion/react';
|
|
5
10
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
|
|
6
11
|
import noop from '@atlaskit/ds-lib/noop';
|
|
@@ -24,7 +29,7 @@ const boxStyles = xcss({
|
|
|
24
29
|
const analyticsAttributes = {
|
|
25
30
|
componentName: 'calendar',
|
|
26
31
|
packageName: "@atlaskit/calendar",
|
|
27
|
-
packageVersion: "14.
|
|
32
|
+
packageVersion: "14.3.0"
|
|
28
33
|
};
|
|
29
34
|
const InnerCalendar = /*#__PURE__*/forwardRef(function Calendar({
|
|
30
35
|
day,
|
|
@@ -161,7 +166,10 @@ const InnerCalendar = /*#__PURE__*/forwardRef(function Calendar({
|
|
|
161
166
|
};
|
|
162
167
|
const headerId = useUniqueId('month-year-header');
|
|
163
168
|
return jsx("div", {
|
|
164
|
-
|
|
169
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
170
|
+
className: className
|
|
171
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
172
|
+
,
|
|
165
173
|
style: style,
|
|
166
174
|
onBlur: handleContainerBlur,
|
|
167
175
|
onFocus: handleContainerFocus,
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
*/
|
|
1
4
|
/** @jsx jsx */
|
|
2
5
|
import { forwardRef, memo, useCallback, useEffect, useRef } from 'react';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
8
|
import { css, jsx } from '@emotion/react';
|
|
4
9
|
import noop from '@atlaskit/ds-lib/noop';
|
|
5
10
|
import { Grid } from '@atlaskit/primitives';
|
|
@@ -56,6 +61,8 @@ const Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date({
|
|
|
56
61
|
});
|
|
57
62
|
}
|
|
58
63
|
}, [onClick]);
|
|
64
|
+
|
|
65
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
59
66
|
const dateCellStyles = css(getDateCellStyles());
|
|
60
67
|
return jsx(Grid, {
|
|
61
68
|
role: "gridcell",
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
*/
|
|
1
4
|
/** @jsx jsx */
|
|
2
5
|
import { memo, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
8
|
import { jsx } from '@emotion/react';
|
|
4
9
|
import { IconButton } from '@atlaskit/button/new';
|
|
5
10
|
import Heading from '@atlaskit/heading';
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
*/
|
|
1
4
|
/** @jsx jsx */
|
|
2
5
|
import { memo } from 'react';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
8
|
import { jsx } from '@emotion/react';
|
|
4
9
|
import Box from '@atlaskit/primitives/box';
|
|
5
10
|
import DateComponent from './date';
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
*/
|
|
1
4
|
/** @jsx jsx */
|
|
2
5
|
import { memo } from 'react';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
8
|
import { jsx } from '@emotion/react';
|
|
4
9
|
import { Box, Text, xcss } from '@atlaskit/primitives';
|
|
5
10
|
import WeekDayGrid from './week-day-grid';
|
package/dist/esm/calendar.js
CHANGED
|
@@ -3,8 +3,13 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
/**
|
|
7
|
+
* @jsxRuntime classic
|
|
8
|
+
*/
|
|
6
9
|
/** @jsx jsx */
|
|
7
10
|
import { forwardRef, memo, useState } from 'react';
|
|
11
|
+
|
|
12
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
13
|
import { jsx } from '@emotion/react';
|
|
9
14
|
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
|
|
10
15
|
import noop from '@atlaskit/ds-lib/noop';
|
|
@@ -28,7 +33,7 @@ var boxStyles = xcss({
|
|
|
28
33
|
var analyticsAttributes = {
|
|
29
34
|
componentName: 'calendar',
|
|
30
35
|
packageName: "@atlaskit/calendar",
|
|
31
|
-
packageVersion: "14.
|
|
36
|
+
packageVersion: "14.3.0"
|
|
32
37
|
};
|
|
33
38
|
var InnerCalendar = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
34
39
|
var day = _ref.day,
|
|
@@ -183,7 +188,10 @@ var InnerCalendar = /*#__PURE__*/forwardRef(function Calendar(_ref, ref) {
|
|
|
183
188
|
};
|
|
184
189
|
var headerId = useUniqueId('month-year-header');
|
|
185
190
|
return jsx("div", {
|
|
186
|
-
|
|
191
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
192
|
+
className: className
|
|
193
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
194
|
+
,
|
|
187
195
|
style: style,
|
|
188
196
|
onBlur: handleContainerBlur,
|
|
189
197
|
onFocus: handleContainerFocus,
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
*/
|
|
1
4
|
/** @jsx jsx */
|
|
2
5
|
import { forwardRef, memo, useCallback, useEffect, useRef } from 'react';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
8
|
import { css, jsx } from '@emotion/react';
|
|
4
9
|
import noop from '@atlaskit/ds-lib/noop';
|
|
5
10
|
import { Grid } from '@atlaskit/primitives';
|
|
@@ -61,6 +66,8 @@ var Date = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function Date(_ref2, _ref)
|
|
|
61
66
|
});
|
|
62
67
|
}
|
|
63
68
|
}, [onClick]);
|
|
69
|
+
|
|
70
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
64
71
|
var dateCellStyles = css(getDateCellStyles());
|
|
65
72
|
return jsx(Grid, {
|
|
66
73
|
role: "gridcell",
|