@instructure/ui-date-input 7.20.0 → 7.20.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/es/DateInput/index.js +18 -6
- package/lib/DateInput/index.js +20 -6
- package/package.json +17 -16
- package/src/DateInput/index.js +15 -2
- package/src/DateInput/styles.css +7 -1
- package/types/index.d.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [7.20.1](https://github.com/instructure/instructure-ui/compare/v7.20.0...v7.20.1) (2022-07-22)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **ui-date-input:** add `display` prop to DateInput ([1c2b6a7](https://github.com/instructure/instructure-ui/commit/1c2b6a7))
|
|
11
|
+
|
|
6
12
|
# [7.20.0](https://github.com/instructure/instructure-ui/compare/v7.19.0...v7.20.0) (2022-06-22)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @instructure/ui-date-input
|
package/es/DateInput/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
1
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
4
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
@@ -33,6 +34,7 @@ var _dec, _dec2, _dec3, _class, _class2, _temp;
|
|
|
33
34
|
*/
|
|
34
35
|
import React, { Children, Component } from 'react';
|
|
35
36
|
import PropTypes from 'prop-types';
|
|
37
|
+
import classnames from 'classnames';
|
|
36
38
|
import { Calendar } from '@instructure/ui-calendar';
|
|
37
39
|
import { IconCalendarMonthLine } from '@instructure/ui-icons';
|
|
38
40
|
import { Popover } from '@instructure/ui-popover';
|
|
@@ -46,12 +48,13 @@ import { FormPropTypes } from '@instructure/ui-form-field';
|
|
|
46
48
|
import { testable } from '@instructure/ui-testable';
|
|
47
49
|
import { themeable } from '@instructure/ui-themeable';
|
|
48
50
|
var styles = {
|
|
49
|
-
componentId: '
|
|
51
|
+
componentId: 'bBhxr',
|
|
50
52
|
template: function template(theme) {
|
|
51
|
-
return "\n\n.
|
|
53
|
+
return "\n\n.bBhxr_ZftU{display:block}\n\n.bBhxr_cbWx{display:inline-block}\n\n.bBhxr_dJgE{display:none}";
|
|
52
54
|
},
|
|
53
|
-
'
|
|
54
|
-
'
|
|
55
|
+
'display-block': 'bBhxr_ZftU',
|
|
56
|
+
'display-inline-block': 'bBhxr_cbWx',
|
|
57
|
+
'assistiveText': 'bBhxr_dJgE'
|
|
55
58
|
};
|
|
56
59
|
/**
|
|
57
60
|
---
|
|
@@ -260,7 +263,8 @@ var DateInput = (_dec = deprecated('8.0.0', {
|
|
|
260
263
|
var _this$props6 = this.props,
|
|
261
264
|
placement = _this$props6.placement,
|
|
262
265
|
isShowingCalendar = _this$props6.isShowingCalendar,
|
|
263
|
-
assistiveText = _this$props6.assistiveText
|
|
266
|
+
assistiveText = _this$props6.assistiveText,
|
|
267
|
+
display = _this$props6.display;
|
|
264
268
|
var selectedDateId = this.selectedDateId;
|
|
265
269
|
return /*#__PURE__*/React.createElement(Selectable, {
|
|
266
270
|
isShowingOptions: isShowingCalendar,
|
|
@@ -271,6 +275,8 @@ var DateInput = (_dec = deprecated('8.0.0', {
|
|
|
271
275
|
selectedOptionId: selectedDateId,
|
|
272
276
|
highlightedOptionId: selectedDateId
|
|
273
277
|
}, function (_ref6) {
|
|
278
|
+
var _classnames;
|
|
279
|
+
|
|
274
280
|
var getRootProps = _ref6.getRootProps,
|
|
275
281
|
getInputProps = _ref6.getInputProps,
|
|
276
282
|
getTriggerProps = _ref6.getTriggerProps,
|
|
@@ -278,7 +284,7 @@ var DateInput = (_dec = deprecated('8.0.0', {
|
|
|
278
284
|
getOptionProps = _ref6.getOptionProps,
|
|
279
285
|
getDescriptionProps = _ref6.getDescriptionProps;
|
|
280
286
|
return /*#__PURE__*/React.createElement("span", getRootProps({
|
|
281
|
-
className: styles.root
|
|
287
|
+
className: classnames((_classnames = {}, _defineProperty(_classnames, styles.root, true), _defineProperty(_classnames, styles["display-".concat(display)], display), _classnames))
|
|
282
288
|
}), _this3.renderInput({
|
|
283
289
|
getInputProps: getInputProps,
|
|
284
290
|
getTriggerProps: getTriggerProps
|
|
@@ -397,6 +403,11 @@ var DateInput = (_dec = deprecated('8.0.0', {
|
|
|
397
403
|
*/
|
|
398
404
|
width: PropTypes.string,
|
|
399
405
|
|
|
406
|
+
/**
|
|
407
|
+
* Specifies the display property of the container.
|
|
408
|
+
*/
|
|
409
|
+
display: PropTypes.oneOf(['inline-block', 'block']),
|
|
410
|
+
|
|
400
411
|
/**
|
|
401
412
|
* Provides a ref to the underlying input element.
|
|
402
413
|
*/
|
|
@@ -513,6 +524,7 @@ var DateInput = (_dec = deprecated('8.0.0', {
|
|
|
513
524
|
assistiveText: void 0,
|
|
514
525
|
layout: 'stacked',
|
|
515
526
|
width: null,
|
|
527
|
+
display: 'inline-block',
|
|
516
528
|
inputRef: function inputRef(el) {},
|
|
517
529
|
messages: void 0,
|
|
518
530
|
placement: 'bottom center',
|
package/lib/DateInput/index.js
CHANGED
|
@@ -9,6 +9,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports.DateInput = exports.default = void 0;
|
|
11
11
|
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
|
|
12
14
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
15
|
|
|
14
16
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
@@ -27,6 +29,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
27
29
|
|
|
28
30
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
29
31
|
|
|
32
|
+
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
33
|
+
|
|
30
34
|
var _Calendar = require("@instructure/ui-calendar/lib/Calendar");
|
|
31
35
|
|
|
32
36
|
var _IconCalendarMonthLine = require("@instructure/ui-icons/lib/IconCalendarMonthLine.js");
|
|
@@ -64,12 +68,13 @@ var _themeable = require("@instructure/ui-themeable/lib/themeable.js");
|
|
|
64
68
|
var _dec, _dec2, _dec3, _class, _class2, _temp;
|
|
65
69
|
|
|
66
70
|
var styles = {
|
|
67
|
-
componentId: '
|
|
71
|
+
componentId: 'bBhxr',
|
|
68
72
|
template: function template(theme) {
|
|
69
|
-
return "\n\n.
|
|
73
|
+
return "\n\n.bBhxr_ZftU{display:block}\n\n.bBhxr_cbWx{display:inline-block}\n\n.bBhxr_dJgE{display:none}";
|
|
70
74
|
},
|
|
71
|
-
'
|
|
72
|
-
'
|
|
75
|
+
'display-block': 'bBhxr_ZftU',
|
|
76
|
+
'display-inline-block': 'bBhxr_cbWx',
|
|
77
|
+
'assistiveText': 'bBhxr_dJgE'
|
|
73
78
|
};
|
|
74
79
|
/**
|
|
75
80
|
---
|
|
@@ -276,7 +281,8 @@ var DateInput = (_dec = (0, _deprecated.deprecated)('8.0.0', {
|
|
|
276
281
|
var _this$props6 = this.props,
|
|
277
282
|
placement = _this$props6.placement,
|
|
278
283
|
isShowingCalendar = _this$props6.isShowingCalendar,
|
|
279
|
-
assistiveText = _this$props6.assistiveText
|
|
284
|
+
assistiveText = _this$props6.assistiveText,
|
|
285
|
+
display = _this$props6.display;
|
|
280
286
|
var selectedDateId = this.selectedDateId;
|
|
281
287
|
return /*#__PURE__*/_react.default.createElement(_Selectable.Selectable, {
|
|
282
288
|
isShowingOptions: isShowingCalendar,
|
|
@@ -287,6 +293,8 @@ var DateInput = (_dec = (0, _deprecated.deprecated)('8.0.0', {
|
|
|
287
293
|
selectedOptionId: selectedDateId,
|
|
288
294
|
highlightedOptionId: selectedDateId
|
|
289
295
|
}, function (_ref6) {
|
|
296
|
+
var _classnames;
|
|
297
|
+
|
|
290
298
|
var getRootProps = _ref6.getRootProps,
|
|
291
299
|
getInputProps = _ref6.getInputProps,
|
|
292
300
|
getTriggerProps = _ref6.getTriggerProps,
|
|
@@ -294,7 +302,7 @@ var DateInput = (_dec = (0, _deprecated.deprecated)('8.0.0', {
|
|
|
294
302
|
getOptionProps = _ref6.getOptionProps,
|
|
295
303
|
getDescriptionProps = _ref6.getDescriptionProps;
|
|
296
304
|
return /*#__PURE__*/_react.default.createElement("span", getRootProps({
|
|
297
|
-
className: styles.root
|
|
305
|
+
className: (0, _classnames2.default)((_classnames = {}, (0, _defineProperty2.default)(_classnames, styles.root, true), (0, _defineProperty2.default)(_classnames, styles["display-".concat(display)], display), _classnames))
|
|
298
306
|
}), _this3.renderInput({
|
|
299
307
|
getInputProps: getInputProps,
|
|
300
308
|
getTriggerProps: getTriggerProps
|
|
@@ -414,6 +422,11 @@ var DateInput = (_dec = (0, _deprecated.deprecated)('8.0.0', {
|
|
|
414
422
|
*/
|
|
415
423
|
width: _propTypes.default.string,
|
|
416
424
|
|
|
425
|
+
/**
|
|
426
|
+
* Specifies the display property of the container.
|
|
427
|
+
*/
|
|
428
|
+
display: _propTypes.default.oneOf(['inline-block', 'block']),
|
|
429
|
+
|
|
417
430
|
/**
|
|
418
431
|
* Provides a ref to the underlying input element.
|
|
419
432
|
*/
|
|
@@ -530,6 +543,7 @@ var DateInput = (_dec = (0, _deprecated.deprecated)('8.0.0', {
|
|
|
530
543
|
assistiveText: void 0,
|
|
531
544
|
layout: 'stacked',
|
|
532
545
|
width: null,
|
|
546
|
+
display: 'inline-block',
|
|
533
547
|
inputRef: function inputRef(el) {},
|
|
534
548
|
messages: void 0,
|
|
535
549
|
placement: 'bottom center',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-date-input",
|
|
3
|
-
"version": "7.20.
|
|
3
|
+
"version": "7.20.1",
|
|
4
4
|
"description": "A UI component library made by Instructure Inc.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -22,24 +22,25 @@
|
|
|
22
22
|
},
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@instructure/ui-babel-preset": "^7.20.
|
|
26
|
-
"@instructure/ui-test-locator": "^7.20.
|
|
27
|
-
"@instructure/ui-test-utils": "^7.20.
|
|
25
|
+
"@instructure/ui-babel-preset": "^7.20.1",
|
|
26
|
+
"@instructure/ui-test-locator": "^7.20.1",
|
|
27
|
+
"@instructure/ui-test-utils": "^7.20.1"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@babel/runtime": "^7.9.2",
|
|
31
|
-
"@instructure/ui-calendar": "^7.20.
|
|
32
|
-
"@instructure/ui-form-field": "^7.20.
|
|
33
|
-
"@instructure/ui-icons": "^7.20.
|
|
34
|
-
"@instructure/ui-popover": "^7.20.
|
|
35
|
-
"@instructure/ui-position": "^7.20.
|
|
36
|
-
"@instructure/ui-prop-types": "^7.20.
|
|
37
|
-
"@instructure/ui-react-utils": "^7.20.
|
|
38
|
-
"@instructure/ui-selectable": "^7.20.
|
|
39
|
-
"@instructure/ui-testable": "^7.20.
|
|
40
|
-
"@instructure/ui-text-input": "^7.20.
|
|
41
|
-
"@instructure/ui-themeable": "^7.20.
|
|
42
|
-
"@instructure/ui-utils": "^7.20.
|
|
31
|
+
"@instructure/ui-calendar": "^7.20.1",
|
|
32
|
+
"@instructure/ui-form-field": "^7.20.1",
|
|
33
|
+
"@instructure/ui-icons": "^7.20.1",
|
|
34
|
+
"@instructure/ui-popover": "^7.20.1",
|
|
35
|
+
"@instructure/ui-position": "^7.20.1",
|
|
36
|
+
"@instructure/ui-prop-types": "^7.20.1",
|
|
37
|
+
"@instructure/ui-react-utils": "^7.20.1",
|
|
38
|
+
"@instructure/ui-selectable": "^7.20.1",
|
|
39
|
+
"@instructure/ui-testable": "^7.20.1",
|
|
40
|
+
"@instructure/ui-text-input": "^7.20.1",
|
|
41
|
+
"@instructure/ui-themeable": "^7.20.1",
|
|
42
|
+
"@instructure/ui-utils": "^7.20.1",
|
|
43
|
+
"classnames": "^2",
|
|
43
44
|
"prop-types": "^15"
|
|
44
45
|
},
|
|
45
46
|
"peerDependencies": {
|
package/src/DateInput/index.js
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
import React, { Children, Component } from 'react'
|
|
26
26
|
import PropTypes from 'prop-types'
|
|
27
|
+
import classnames from 'classnames'
|
|
27
28
|
|
|
28
29
|
import { Calendar } from '@instructure/ui-calendar'
|
|
29
30
|
import { IconCalendarMonthLine } from '@instructure/ui-icons'
|
|
@@ -126,6 +127,10 @@ class DateInput extends Component {
|
|
|
126
127
|
* Specifies the width of the input.
|
|
127
128
|
*/
|
|
128
129
|
width: PropTypes.string,
|
|
130
|
+
/**
|
|
131
|
+
* Specifies the display property of the container.
|
|
132
|
+
*/
|
|
133
|
+
display: PropTypes.oneOf(['inline-block', 'block']),
|
|
129
134
|
/**
|
|
130
135
|
* Provides a ref to the underlying input element.
|
|
131
136
|
*/
|
|
@@ -240,6 +245,7 @@ class DateInput extends Component {
|
|
|
240
245
|
assistiveText: undefined,
|
|
241
246
|
layout: 'stacked',
|
|
242
247
|
width: null,
|
|
248
|
+
display: 'inline-block',
|
|
243
249
|
inputRef: (el) => {},
|
|
244
250
|
messages: undefined,
|
|
245
251
|
placement: 'bottom center',
|
|
@@ -432,7 +438,7 @@ class DateInput extends Component {
|
|
|
432
438
|
}
|
|
433
439
|
|
|
434
440
|
render() {
|
|
435
|
-
const { placement, isShowingCalendar, assistiveText } = this.props
|
|
441
|
+
const { placement, isShowingCalendar, assistiveText, display } = this.props
|
|
436
442
|
|
|
437
443
|
const { selectedDateId } = this
|
|
438
444
|
|
|
@@ -454,7 +460,14 @@ class DateInput extends Component {
|
|
|
454
460
|
getOptionProps,
|
|
455
461
|
getDescriptionProps
|
|
456
462
|
}) => (
|
|
457
|
-
<span
|
|
463
|
+
<span
|
|
464
|
+
{...getRootProps({
|
|
465
|
+
className: classnames({
|
|
466
|
+
[styles.root]: true,
|
|
467
|
+
[styles[`display-${display}`]]: display
|
|
468
|
+
})
|
|
469
|
+
})}
|
|
470
|
+
>
|
|
458
471
|
{this.renderInput({ getInputProps, getTriggerProps })}
|
|
459
472
|
<span {...getDescriptionProps()} className={styles.assistiveText}>
|
|
460
473
|
{assistiveText}
|
package/src/DateInput/styles.css
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export type DateInputInteraction = "enabled" | "disabled" | "readonly";
|
|
|
10
10
|
|
|
11
11
|
export type DateInputLayout = "stacked" | "inline";
|
|
12
12
|
|
|
13
|
+
export type DateInputDisplay = "inline-block" | "block";
|
|
14
|
+
|
|
13
15
|
export type DateInputRenderNavigationLabel = ((...args: any[])=>any) | React.ReactNode;
|
|
14
16
|
|
|
15
17
|
export type DateInputRenderWeekdayLabels = ((...args: any[])=>any) | React.ReactNode;
|
|
@@ -81,6 +83,10 @@ export interface DateInputProps {
|
|
|
81
83
|
* Specifies the width of the input.
|
|
82
84
|
*/
|
|
83
85
|
width?: string;
|
|
86
|
+
/**
|
|
87
|
+
* Specifies the display property of the container.
|
|
88
|
+
*/
|
|
89
|
+
display?: DateInputDisplay;
|
|
84
90
|
/**
|
|
85
91
|
* Provides a ref to the underlying input element.
|
|
86
92
|
*/
|