@instructure/ui-date-input 8.18.0 → 8.18.1-snapshot.12
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/LICENSE.md +27 -0
- package/es/DateInput/index.js +98 -108
- package/es/DateInput/props.js +0 -148
- package/es/DateInput/styles.js +3 -4
- package/lib/DateInput/index.js +101 -109
- package/lib/DateInput/props.js +0 -148
- package/lib/DateInput/styles.js +3 -4
- package/package.json +18 -17
- package/src/DateInput/index.tsx +62 -103
- package/src/DateInput/props.ts +78 -75
- package/src/DateInput/styles.ts +3 -4
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/DateInput/index.d.ts +61 -70
- package/types/DateInput/index.d.ts.map +1 -1
- package/types/DateInput/props.d.ts +141 -18
- package/types/DateInput/props.d.ts.map +1 -1
- package/types/DateInput/styles.d.ts +3 -4
- package/types/DateInput/styles.d.ts.map +1 -1
package/lib/DateInput/index.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
6
|
+
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
@@ -9,7 +11,7 @@ exports.default = exports.DateInput = void 0;
|
|
|
9
11
|
|
|
10
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
13
|
|
|
12
|
-
var _react = require("react");
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
15
|
|
|
14
16
|
var _Calendar = require("@instructure/ui-calendar/lib/Calendar");
|
|
15
17
|
|
|
@@ -37,7 +39,7 @@ var _emotion = require("@instructure/emotion");
|
|
|
37
39
|
|
|
38
40
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
39
41
|
|
|
40
|
-
var
|
|
42
|
+
var _props2 = require("./props");
|
|
41
43
|
|
|
42
44
|
const _excluded = ["renderLabel", "value", "placeholder", "onBlur", "isRequired", "size", "isInline", "layout", "width", "messages", "onRequestValidateDate", "onRequestShowCalendar", "onRequestHideCalendar", "onRequestSelectNextDay", "onRequestSelectPrevDay", "onRequestRenderNextMonth", "onRequestRenderPrevMonth"],
|
|
43
45
|
_excluded2 = ["ref"];
|
|
@@ -48,6 +50,9 @@ var _dec, _dec2, _class, _class2, _temp, _IconCalendarMonthLin;
|
|
|
48
50
|
---
|
|
49
51
|
category: components
|
|
50
52
|
---
|
|
53
|
+
The `DateInput` component provides a visual interface for inputting date data.
|
|
54
|
+
See <https://instructure.design/#DateInput/>
|
|
55
|
+
@tsProps
|
|
51
56
|
**/
|
|
52
57
|
let DateInput = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_temp = _class2 = class DateInput extends _react.Component {
|
|
53
58
|
constructor() {
|
|
@@ -69,71 +74,77 @@ let DateInput = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 =
|
|
|
69
74
|
};
|
|
70
75
|
|
|
71
76
|
this.handleInputRef = el => {
|
|
72
|
-
|
|
73
|
-
const hasInputRef = this.state.hasInputRef; // Ensures that we position the Calendar with respect to the input correctly
|
|
74
|
-
// if the Calendar is open on mount
|
|
77
|
+
var _this$props$inputRef, _this$props;
|
|
75
78
|
|
|
76
|
-
|
|
79
|
+
// Ensures that we position the Calendar with respect to the input correctly
|
|
80
|
+
// if the Calendar is open on mount
|
|
81
|
+
if (!this.state.hasInputRef) {
|
|
77
82
|
this.setState({
|
|
78
83
|
hasInputRef: true
|
|
79
84
|
});
|
|
80
85
|
}
|
|
81
86
|
|
|
82
87
|
this._input = el;
|
|
83
|
-
inputRef(el);
|
|
88
|
+
(_this$props$inputRef = (_this$props = this.props).inputRef) === null || _this$props$inputRef === void 0 ? void 0 : _this$props$inputRef.call(_this$props, el);
|
|
84
89
|
};
|
|
85
90
|
|
|
86
91
|
this.handleInputChange = (event, value) => {
|
|
87
|
-
|
|
88
|
-
|
|
92
|
+
var _this$props$onChange, _this$props2;
|
|
93
|
+
|
|
94
|
+
(_this$props$onChange = (_this$props2 = this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props2, event, {
|
|
89
95
|
value
|
|
90
96
|
});
|
|
91
97
|
this.handleShowCalendar(event);
|
|
92
98
|
};
|
|
93
99
|
|
|
94
100
|
this.handleShowCalendar = event => {
|
|
95
|
-
|
|
96
|
-
|
|
101
|
+
if (this.interaction === 'enabled') {
|
|
102
|
+
var _this$props$onRequest, _this$props3;
|
|
97
103
|
|
|
98
|
-
|
|
99
|
-
onRequestShowCalendar(event);
|
|
104
|
+
(_this$props$onRequest = (_this$props3 = this.props).onRequestShowCalendar) === null || _this$props$onRequest === void 0 ? void 0 : _this$props$onRequest.call(_this$props3, event);
|
|
100
105
|
}
|
|
101
106
|
};
|
|
102
107
|
|
|
103
108
|
this.handleHideCalendar = event => {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
onRequestHideCalendar(event);
|
|
109
|
+
var _this$props$onRequest2, _this$props4, _this$props$onRequest3, _this$props5;
|
|
110
|
+
|
|
111
|
+
(_this$props$onRequest2 = (_this$props4 = this.props).onRequestValidateDate) === null || _this$props$onRequest2 === void 0 ? void 0 : _this$props$onRequest2.call(_this$props4, event);
|
|
112
|
+
(_this$props$onRequest3 = (_this$props5 = this.props).onRequestHideCalendar) === null || _this$props$onRequest3 === void 0 ? void 0 : _this$props$onRequest3.call(_this$props5, event);
|
|
109
113
|
};
|
|
110
114
|
|
|
111
115
|
this.handleHighlightOption = (event, _ref) => {
|
|
112
116
|
let direction = _ref.direction;
|
|
113
|
-
const _this$
|
|
114
|
-
onRequestSelectNextDay = _this$
|
|
115
|
-
onRequestSelectPrevDay = _this$
|
|
116
|
-
if (direction === -1) onRequestSelectPrevDay(event);
|
|
117
|
-
if (direction === 1) onRequestSelectNextDay(event);
|
|
117
|
+
const _this$props6 = this.props,
|
|
118
|
+
onRequestSelectNextDay = _this$props6.onRequestSelectNextDay,
|
|
119
|
+
onRequestSelectPrevDay = _this$props6.onRequestSelectPrevDay;
|
|
120
|
+
if (direction === -1) onRequestSelectPrevDay === null || onRequestSelectPrevDay === void 0 ? void 0 : onRequestSelectPrevDay(event);
|
|
121
|
+
if (direction === 1) onRequestSelectNextDay === null || onRequestSelectNextDay === void 0 ? void 0 : onRequestSelectNextDay(event);
|
|
118
122
|
};
|
|
119
123
|
}
|
|
120
124
|
|
|
121
125
|
componentDidMount() {
|
|
122
|
-
|
|
126
|
+
var _this$props$makeStyle, _this$props7;
|
|
127
|
+
|
|
128
|
+
(_this$props$makeStyle = (_this$props7 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props7);
|
|
123
129
|
}
|
|
124
130
|
|
|
125
131
|
componentDidUpdate() {
|
|
126
|
-
|
|
132
|
+
var _this$props$makeStyle2, _this$props8;
|
|
133
|
+
|
|
134
|
+
(_this$props$makeStyle2 = (_this$props8 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props8);
|
|
127
135
|
}
|
|
128
136
|
|
|
129
137
|
get selectedDateId() {
|
|
130
138
|
let selectedDateId;
|
|
131
139
|
|
|
132
140
|
_react.Children.toArray(this.props.children).forEach(day => {
|
|
133
|
-
const
|
|
134
|
-
date =
|
|
135
|
-
isSelected =
|
|
136
|
-
|
|
141
|
+
const _props = day.props,
|
|
142
|
+
date = _props.date,
|
|
143
|
+
isSelected = _props.isSelected;
|
|
144
|
+
|
|
145
|
+
if (isSelected) {
|
|
146
|
+
selectedDateId = this.formatDateId(date);
|
|
147
|
+
}
|
|
137
148
|
});
|
|
138
149
|
|
|
139
150
|
return selectedDateId;
|
|
@@ -147,43 +158,42 @@ let DateInput = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 =
|
|
|
147
158
|
|
|
148
159
|
renderMonthNavigationButton() {
|
|
149
160
|
let type = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 'prev';
|
|
150
|
-
const _this$
|
|
151
|
-
renderPrevMonthButton = _this$
|
|
152
|
-
renderNextMonthButton = _this$
|
|
161
|
+
const _this$props9 = this.props,
|
|
162
|
+
renderPrevMonthButton = _this$props9.renderPrevMonthButton,
|
|
163
|
+
renderNextMonthButton = _this$props9.renderNextMonthButton;
|
|
153
164
|
const button = type === 'prev' ? renderPrevMonthButton : renderNextMonthButton;
|
|
154
165
|
return button && (0, _safeCloneElement.safeCloneElement)((0, _callRenderProp.callRenderProp)(button), {
|
|
155
166
|
tabIndex: -1
|
|
156
167
|
});
|
|
157
168
|
}
|
|
158
169
|
|
|
159
|
-
renderDays(
|
|
160
|
-
let getOptionProps = _ref2.getOptionProps;
|
|
170
|
+
renderDays(getOptionProps) {
|
|
161
171
|
const children = this.props.children;
|
|
162
172
|
return _react.Children.map(children, day => {
|
|
163
|
-
const _day$
|
|
164
|
-
date = _day$
|
|
165
|
-
isOutsideMonth = _day$
|
|
166
|
-
|
|
173
|
+
const _day$props = day.props,
|
|
174
|
+
date = _day$props.date,
|
|
175
|
+
isOutsideMonth = _day$props.isOutsideMonth;
|
|
176
|
+
const props = {
|
|
167
177
|
tabIndex: -1,
|
|
168
178
|
id: this.formatDateId(date)
|
|
169
179
|
};
|
|
170
180
|
const optionProps = getOptionProps(props);
|
|
171
|
-
|
|
181
|
+
const propsAdded = isOutsideMonth ? { ...props,
|
|
172
182
|
onClick: optionProps.onClick,
|
|
173
183
|
role: 'presentation'
|
|
174
184
|
} : optionProps;
|
|
175
|
-
return (0, _safeCloneElement.safeCloneElement)(day,
|
|
185
|
+
return (0, _safeCloneElement.safeCloneElement)(day, propsAdded);
|
|
176
186
|
});
|
|
177
187
|
}
|
|
178
188
|
|
|
179
|
-
renderCalendar(
|
|
180
|
-
let getListProps =
|
|
181
|
-
getOptionProps =
|
|
182
|
-
const _this$
|
|
183
|
-
onRequestRenderNextMonth = _this$
|
|
184
|
-
onRequestRenderPrevMonth = _this$
|
|
185
|
-
renderNavigationLabel = _this$
|
|
186
|
-
renderWeekdayLabels = _this$
|
|
189
|
+
renderCalendar(_ref2) {
|
|
190
|
+
let getListProps = _ref2.getListProps,
|
|
191
|
+
getOptionProps = _ref2.getOptionProps;
|
|
192
|
+
const _this$props10 = this.props,
|
|
193
|
+
onRequestRenderNextMonth = _this$props10.onRequestRenderNextMonth,
|
|
194
|
+
onRequestRenderPrevMonth = _this$props10.onRequestRenderPrevMonth,
|
|
195
|
+
renderNavigationLabel = _this$props10.renderNavigationLabel,
|
|
196
|
+
renderWeekdayLabels = _this$props10.renderWeekdayLabels;
|
|
187
197
|
return (0, _emotion.jsx)(_Calendar.Calendar, getListProps({
|
|
188
198
|
onRequestRenderNextMonth,
|
|
189
199
|
onRequestRenderPrevMonth,
|
|
@@ -191,33 +201,31 @@ let DateInput = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 =
|
|
|
191
201
|
renderWeekdayLabels,
|
|
192
202
|
renderNextMonthButton: this.renderMonthNavigationButton('next'),
|
|
193
203
|
renderPrevMonthButton: this.renderMonthNavigationButton('prev')
|
|
194
|
-
}), this.renderDays(
|
|
195
|
-
getOptionProps
|
|
196
|
-
}));
|
|
204
|
+
}), this.renderDays(getOptionProps));
|
|
197
205
|
}
|
|
198
206
|
|
|
199
|
-
renderInput(
|
|
200
|
-
let getInputProps =
|
|
201
|
-
getTriggerProps =
|
|
202
|
-
const _this$
|
|
203
|
-
renderLabel = _this$
|
|
204
|
-
value = _this$
|
|
205
|
-
placeholder = _this$
|
|
206
|
-
onBlur = _this$
|
|
207
|
-
isRequired = _this$
|
|
208
|
-
size = _this$
|
|
209
|
-
isInline = _this$
|
|
210
|
-
layout = _this$
|
|
211
|
-
width = _this$
|
|
212
|
-
messages = _this$
|
|
213
|
-
onRequestValidateDate = _this$
|
|
214
|
-
onRequestShowCalendar = _this$
|
|
215
|
-
onRequestHideCalendar = _this$
|
|
216
|
-
onRequestSelectNextDay = _this$
|
|
217
|
-
onRequestSelectPrevDay = _this$
|
|
218
|
-
onRequestRenderNextMonth = _this$
|
|
219
|
-
onRequestRenderPrevMonth = _this$
|
|
220
|
-
rest = (0, _objectWithoutProperties2.default)(_this$
|
|
207
|
+
renderInput(_ref3) {
|
|
208
|
+
let getInputProps = _ref3.getInputProps,
|
|
209
|
+
getTriggerProps = _ref3.getTriggerProps;
|
|
210
|
+
const _this$props11 = this.props,
|
|
211
|
+
renderLabel = _this$props11.renderLabel,
|
|
212
|
+
value = _this$props11.value,
|
|
213
|
+
placeholder = _this$props11.placeholder,
|
|
214
|
+
onBlur = _this$props11.onBlur,
|
|
215
|
+
isRequired = _this$props11.isRequired,
|
|
216
|
+
size = _this$props11.size,
|
|
217
|
+
isInline = _this$props11.isInline,
|
|
218
|
+
layout = _this$props11.layout,
|
|
219
|
+
width = _this$props11.width,
|
|
220
|
+
messages = _this$props11.messages,
|
|
221
|
+
onRequestValidateDate = _this$props11.onRequestValidateDate,
|
|
222
|
+
onRequestShowCalendar = _this$props11.onRequestShowCalendar,
|
|
223
|
+
onRequestHideCalendar = _this$props11.onRequestHideCalendar,
|
|
224
|
+
onRequestSelectNextDay = _this$props11.onRequestSelectNextDay,
|
|
225
|
+
onRequestSelectPrevDay = _this$props11.onRequestSelectPrevDay,
|
|
226
|
+
onRequestRenderNextMonth = _this$props11.onRequestRenderNextMonth,
|
|
227
|
+
onRequestRenderPrevMonth = _this$props11.onRequestRenderPrevMonth,
|
|
228
|
+
rest = (0, _objectWithoutProperties2.default)(_this$props11, _excluded);
|
|
221
229
|
const interaction = this.interaction;
|
|
222
230
|
|
|
223
231
|
const _getTriggerProps = getTriggerProps(),
|
|
@@ -247,34 +255,33 @@ let DateInput = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 =
|
|
|
247
255
|
}
|
|
248
256
|
|
|
249
257
|
render() {
|
|
250
|
-
const _this$
|
|
251
|
-
placement = _this$
|
|
252
|
-
isShowingCalendar = _this$
|
|
253
|
-
assistiveText = _this$
|
|
254
|
-
styles = _this$
|
|
255
|
-
const selectedDateId = this.selectedDateId;
|
|
258
|
+
const _this$props12 = this.props,
|
|
259
|
+
placement = _this$props12.placement,
|
|
260
|
+
isShowingCalendar = _this$props12.isShowingCalendar,
|
|
261
|
+
assistiveText = _this$props12.assistiveText,
|
|
262
|
+
styles = _this$props12.styles;
|
|
256
263
|
return (0, _emotion.jsx)(_Selectable.Selectable, {
|
|
257
264
|
isShowingOptions: isShowingCalendar,
|
|
258
265
|
onRequestShowOptions: this.handleShowCalendar,
|
|
259
266
|
onRequestHideOptions: this.handleHideCalendar,
|
|
260
267
|
onRequestHighlightOption: this.handleHighlightOption,
|
|
261
268
|
onRequestSelectOption: this.handleHideCalendar,
|
|
262
|
-
selectedOptionId: selectedDateId,
|
|
263
|
-
highlightedOptionId: selectedDateId
|
|
264
|
-
},
|
|
265
|
-
let getRootProps =
|
|
266
|
-
getInputProps =
|
|
267
|
-
getTriggerProps =
|
|
268
|
-
getListProps =
|
|
269
|
-
getOptionProps =
|
|
270
|
-
getDescriptionProps =
|
|
269
|
+
selectedOptionId: this.selectedDateId,
|
|
270
|
+
highlightedOptionId: this.selectedDateId
|
|
271
|
+
}, _ref4 => {
|
|
272
|
+
let getRootProps = _ref4.getRootProps,
|
|
273
|
+
getInputProps = _ref4.getInputProps,
|
|
274
|
+
getTriggerProps = _ref4.getTriggerProps,
|
|
275
|
+
getListProps = _ref4.getListProps,
|
|
276
|
+
getOptionProps = _ref4.getOptionProps,
|
|
277
|
+
getDescriptionProps = _ref4.getDescriptionProps;
|
|
271
278
|
return (0, _emotion.jsx)("span", getRootProps({
|
|
272
|
-
css: styles
|
|
279
|
+
css: styles === null || styles === void 0 ? void 0 : styles.dateInput
|
|
273
280
|
}), this.renderInput({
|
|
274
281
|
getInputProps,
|
|
275
282
|
getTriggerProps
|
|
276
283
|
}), (0, _emotion.jsx)("span", Object.assign({}, getDescriptionProps(), {
|
|
277
|
-
css: styles
|
|
284
|
+
css: styles === null || styles === void 0 ? void 0 : styles.assistiveText
|
|
278
285
|
}), assistiveText), (0, _emotion.jsx)(_Popover.Popover, {
|
|
279
286
|
placement: placement,
|
|
280
287
|
isShowingContent: isShowingCalendar,
|
|
@@ -288,32 +295,17 @@ let DateInput = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 =
|
|
|
288
295
|
});
|
|
289
296
|
}
|
|
290
297
|
|
|
291
|
-
}, _class2.displayName = "DateInput", _class2.componentId = 'DateInput', _class2.Day = _Calendar.Calendar.Day, _class2.propTypes =
|
|
298
|
+
}, _class2.displayName = "DateInput", _class2.componentId = 'DateInput', _class2.Day = _Calendar.Calendar.Day, _class2.propTypes = _props2.propTypes, _class2.allowedProps = _props2.allowedProps, _class2.defaultProps = {
|
|
292
299
|
value: '',
|
|
293
300
|
size: 'medium',
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
onBlur: event => {},
|
|
297
|
-
// Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
|
|
301
|
+
onBlur: () => {},
|
|
302
|
+
// must have a default so createChainedFunction works
|
|
298
303
|
isRequired: false,
|
|
299
304
|
isInline: false,
|
|
300
305
|
layout: 'stacked',
|
|
301
|
-
width: null,
|
|
302
306
|
display: 'inline-block',
|
|
303
|
-
inputRef: el => {},
|
|
304
307
|
placement: 'bottom center',
|
|
305
|
-
isShowingCalendar: false
|
|
306
|
-
onRequestValidateDate: event => {},
|
|
307
|
-
onRequestShowCalendar: event => {},
|
|
308
|
-
onRequestHideCalendar: event => {},
|
|
309
|
-
onRequestSelectNextDay: event => {},
|
|
310
|
-
onRequestSelectPrevDay: event => {},
|
|
311
|
-
onRequestRenderNextMonth: event => {},
|
|
312
|
-
onRequestRenderPrevMonth: event => {},
|
|
313
|
-
renderNavigationLabel: null,
|
|
314
|
-
renderNextMonthButton: null,
|
|
315
|
-
renderPrevMonthButton: null,
|
|
316
|
-
children: null
|
|
308
|
+
isShowingCalendar: false
|
|
317
309
|
}, _temp)) || _class) || _class);
|
|
318
310
|
exports.DateInput = DateInput;
|
|
319
311
|
var _default = DateInput;
|
package/lib/DateInput/props.js
CHANGED
|
@@ -43,182 +43,34 @@ var _Calendar = require("@instructure/ui-calendar/lib/Calendar");
|
|
|
43
43
|
* SOFTWARE.
|
|
44
44
|
*/
|
|
45
45
|
const propTypes = {
|
|
46
|
-
/**
|
|
47
|
-
* Specifies the input label.
|
|
48
|
-
*/
|
|
49
46
|
renderLabel: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]).isRequired,
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Specifies the input value.
|
|
53
|
-
*/
|
|
54
47
|
value: (0, _controllable.controllable)(_propTypes.default.string),
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Specifies the input size.
|
|
58
|
-
*/
|
|
59
48
|
size: _propTypes.default.oneOf(['small', 'medium', 'large']),
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Html placeholder text to display when the input has no value. This should
|
|
63
|
-
* be hint text, not a label replacement.
|
|
64
|
-
*/
|
|
65
49
|
placeholder: _propTypes.default.string,
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Callback executed when the input fires a change event.
|
|
69
|
-
* @param {Object} event - the event object
|
|
70
|
-
* @param {Object} data - additional data
|
|
71
|
-
* @param data.value - the new value
|
|
72
|
-
*/
|
|
73
50
|
onChange: _propTypes.default.func,
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Callback executed when the input fires a blur event.
|
|
77
|
-
*/
|
|
78
51
|
onBlur: _propTypes.default.func,
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Specifies if interaction with the input is enabled, disabled, or readonly.
|
|
82
|
-
* When "disabled", the input changes visibly to indicate that it cannot
|
|
83
|
-
* receive user interactions. When "readonly" the input still cannot receive
|
|
84
|
-
* user interactions but it keeps the same styles as if it were enabled.
|
|
85
|
-
*/
|
|
86
52
|
interaction: _propTypes.default.oneOf(['enabled', 'disabled', 'readonly']),
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Specifies if the input is required.
|
|
90
|
-
*/
|
|
91
53
|
isRequired: _propTypes.default.bool,
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Controls whether the input is rendered inline with other elements or if it
|
|
95
|
-
* is rendered as a block level element.
|
|
96
|
-
*/
|
|
97
54
|
isInline: _propTypes.default.bool,
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Additional helpful text to provide to screen readers about the operation
|
|
101
|
-
* of the component.
|
|
102
|
-
*/
|
|
103
55
|
assistiveText: _propTypes.default.string,
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Controls the layout. When set to `stacked`, the label rests on top of the
|
|
107
|
-
* input. When set to `inline` the label is next to the input.
|
|
108
|
-
*/
|
|
109
56
|
layout: _propTypes.default.oneOf(['stacked', 'inline']),
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Specifies the width of the input.
|
|
113
|
-
*/
|
|
114
57
|
width: _propTypes.default.string,
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Specifies the display property of the container.
|
|
118
|
-
*/
|
|
119
58
|
display: _propTypes.default.oneOf(['inline-block', 'block']),
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Provides a ref to the underlying input element.
|
|
123
|
-
*/
|
|
124
59
|
inputRef: _propTypes.default.func,
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Displays messages and validation for the input. It should be an object
|
|
128
|
-
* with the following shape:
|
|
129
|
-
* `{
|
|
130
|
-
* text: PropTypes.node,
|
|
131
|
-
* type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
|
|
132
|
-
* }`
|
|
133
|
-
*/
|
|
134
60
|
messages: _propTypes.default.arrayOf(_FormPropTypes.FormPropTypes.message),
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* The placement of the calendar in relation to the input.
|
|
138
|
-
*/
|
|
139
61
|
placement: _PositionPropTypes.PositionPropTypes.placement,
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Controls whether or not the calendar is showing.
|
|
143
|
-
*/
|
|
144
62
|
isShowingCalendar: _propTypes.default.bool,
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Callback fired when the input is blurred. Feedback should be provided
|
|
148
|
-
* to the user when this function is called if the selected date or input
|
|
149
|
-
* value is not valid.
|
|
150
|
-
*/
|
|
151
63
|
onRequestValidateDate: _propTypes.default.func,
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Callback fired requesting the calendar be shown.
|
|
155
|
-
*/
|
|
156
64
|
onRequestShowCalendar: _propTypes.default.func,
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Callback fired requesting the calendar be hidden.
|
|
160
|
-
*/
|
|
161
65
|
onRequestHideCalendar: _propTypes.default.func,
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Callback fired requesting the next day be selected. If no date is currently
|
|
165
|
-
* selected should default to the first day of the currently rendered month.
|
|
166
|
-
*/
|
|
167
66
|
onRequestSelectNextDay: _propTypes.default.func,
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Callback fired requesting the previous day be selected. If no date is currently
|
|
171
|
-
* selected should default to the first day of the currently rendered month.
|
|
172
|
-
*/
|
|
173
67
|
onRequestSelectPrevDay: _propTypes.default.func,
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Callback fired requesting the next month be rendered.
|
|
177
|
-
*/
|
|
178
68
|
onRequestRenderNextMonth: _propTypes.default.func,
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Callback fired requesting the previous month be rendered.
|
|
182
|
-
*/
|
|
183
69
|
onRequestRenderPrevMonth: _propTypes.default.func,
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Content to render in the calendar navigation header. The recommendation is
|
|
187
|
-
* to include the name of the current rendered month along with the year.
|
|
188
|
-
*/
|
|
189
70
|
renderNavigationLabel: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* An array of labels containing the name of each day of the week. The visible
|
|
193
|
-
* portion of the label should be abbreviated (no longer than three characters).
|
|
194
|
-
* Note that screen readers will read this content preceding each date as the
|
|
195
|
-
* `<Calendar />` is navigated. Consider using
|
|
196
|
-
* [AccessibleContent](#AccessibleContent) with the `alt` prop containing the
|
|
197
|
-
* full day name for assistive technologies and the children containing the
|
|
198
|
-
* abbreviation. ex. `[<AccessibleContent alt="Sunday">Sun</AccessibleContent>, ...]`
|
|
199
|
-
*/
|
|
200
71
|
renderWeekdayLabels: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node])).isRequired,
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* A button to render in the calendar navigation header. The recommendation is
|
|
204
|
-
* to compose it with the [Button](#Button) component, setting the `variant`
|
|
205
|
-
* prop to `icon`, the `size` prop to `small`, and setting the `icon` prop to
|
|
206
|
-
* [IconArrowOpenEnd](#iconography).
|
|
207
|
-
*/
|
|
208
72
|
renderNextMonthButton: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* A button to render in the calendar navigation header. The recommendation is
|
|
212
|
-
* to compose it with the [Button](#Button) component, setting the `variant`
|
|
213
|
-
* prop to `icon`, the `size` prop to `small`, and setting the `icon` prop to
|
|
214
|
-
* [IconArrowOpenStart](#iconography).
|
|
215
|
-
*/
|
|
216
73
|
renderPrevMonthButton: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* children of type `<DateInput.Day />` There should be exactly 42 provided (6
|
|
220
|
-
* weeks).
|
|
221
|
-
*/
|
|
222
74
|
children: _Children.Children.oneOf([_Calendar.Calendar.Day])
|
|
223
75
|
};
|
|
224
76
|
exports.propTypes = propTypes;
|
package/lib/DateInput/styles.js
CHANGED
|
@@ -34,10 +34,9 @@ exports.default = void 0;
|
|
|
34
34
|
* private: true
|
|
35
35
|
* ---
|
|
36
36
|
* Generates the style object from the theme and provided additional information
|
|
37
|
-
* @param
|
|
38
|
-
* @param
|
|
39
|
-
* @
|
|
40
|
-
* @return {Object} The final style object, which will be used in the component
|
|
37
|
+
* @param _componentTheme The theme variable object.
|
|
38
|
+
* @param props the props of the component, the style is applied to
|
|
39
|
+
* @return The final style object, which will be used in the component
|
|
41
40
|
*/
|
|
42
41
|
const generateStyle = (_componentTheme, props) => {
|
|
43
42
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-date-input",
|
|
3
|
-
"version": "8.18.
|
|
3
|
+
"version": "8.18.1-snapshot.12+ca14b3dc8",
|
|
4
4
|
"description": "A UI component library made by Instructure Inc.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,24 +23,24 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-babel-preset": "8.18.
|
|
27
|
-
"@instructure/ui-test-locator": "8.18.
|
|
28
|
-
"@instructure/ui-test-utils": "8.18.
|
|
26
|
+
"@instructure/ui-babel-preset": "8.18.1-snapshot.12+ca14b3dc8",
|
|
27
|
+
"@instructure/ui-test-locator": "8.18.1-snapshot.12+ca14b3dc8",
|
|
28
|
+
"@instructure/ui-test-utils": "8.18.1-snapshot.12+ca14b3dc8"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "^7.13.10",
|
|
32
|
-
"@instructure/emotion": "8.18.
|
|
33
|
-
"@instructure/ui-calendar": "8.18.
|
|
34
|
-
"@instructure/ui-form-field": "8.18.
|
|
35
|
-
"@instructure/ui-icons": "8.18.
|
|
36
|
-
"@instructure/ui-popover": "8.18.
|
|
37
|
-
"@instructure/ui-position": "8.18.
|
|
38
|
-
"@instructure/ui-prop-types": "8.18.
|
|
39
|
-
"@instructure/ui-react-utils": "8.18.
|
|
40
|
-
"@instructure/ui-selectable": "8.18.
|
|
41
|
-
"@instructure/ui-testable": "8.18.
|
|
42
|
-
"@instructure/ui-text-input": "8.18.
|
|
43
|
-
"@instructure/ui-utils": "8.18.
|
|
32
|
+
"@instructure/emotion": "8.18.1-snapshot.12+ca14b3dc8",
|
|
33
|
+
"@instructure/ui-calendar": "8.18.1-snapshot.12+ca14b3dc8",
|
|
34
|
+
"@instructure/ui-form-field": "8.18.1-snapshot.12+ca14b3dc8",
|
|
35
|
+
"@instructure/ui-icons": "8.18.1-snapshot.12+ca14b3dc8",
|
|
36
|
+
"@instructure/ui-popover": "8.18.1-snapshot.12+ca14b3dc8",
|
|
37
|
+
"@instructure/ui-position": "8.18.1-snapshot.12+ca14b3dc8",
|
|
38
|
+
"@instructure/ui-prop-types": "8.18.1-snapshot.12+ca14b3dc8",
|
|
39
|
+
"@instructure/ui-react-utils": "8.18.1-snapshot.12+ca14b3dc8",
|
|
40
|
+
"@instructure/ui-selectable": "8.18.1-snapshot.12+ca14b3dc8",
|
|
41
|
+
"@instructure/ui-testable": "8.18.1-snapshot.12+ca14b3dc8",
|
|
42
|
+
"@instructure/ui-text-input": "8.18.1-snapshot.12+ca14b3dc8",
|
|
43
|
+
"@instructure/ui-utils": "8.18.1-snapshot.12+ca14b3dc8",
|
|
44
44
|
"prop-types": "^15"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
@@ -49,5 +49,6 @@
|
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
|
-
"sideEffects": false
|
|
52
|
+
"sideEffects": false,
|
|
53
|
+
"gitHead": "ca14b3dc8f0315daef7b86aa05f711e6d6684c58"
|
|
53
54
|
}
|