@instructure/ui-date-input 8.12.1-snapshot.44 → 8.12.1-snapshot.50

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.
@@ -30,8 +30,14 @@ import { PopoverLocator } from '@instructure/ui-popover/es/Popover/PopoverLocato
30
30
 
31
31
  import { DateInput } from './index';
32
32
  export const DateInputLocator = locator(DateInput.selector, {
33
- findInput: (...args) => locator('input').find(...args),
34
- findCalendar: async (element, ...args) => {
33
+ findInput: function () {
34
+ return locator('input').find(...arguments);
35
+ },
36
+ findCalendar: async function (element) {
37
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
38
+ args[_key - 1] = arguments[_key];
39
+ }
40
+
35
41
  const content = await PopoverLocator.findContent(element, ...args);
36
42
  return content ? CalendarLocator.find(content.getDOMNode()) : null;
37
43
  }
@@ -48,8 +48,8 @@ category: components
48
48
  ---
49
49
  **/
50
50
  let DateInput = (_dec = withStyle(generateStyle, null), _dec2 = testable(), _dec(_class = _dec2(_class = (_temp = _class2 = class DateInput extends Component {
51
- constructor(...args) {
52
- super(...args);
51
+ constructor() {
52
+ super(...arguments);
53
53
  this.state = {
54
54
  hasInputRef: false
55
55
  };
@@ -106,9 +106,8 @@ let DateInput = (_dec = withStyle(generateStyle, null), _dec2 = testable(), _dec
106
106
  onRequestHideCalendar(event);
107
107
  };
108
108
 
109
- this.handleHighlightOption = (event, {
110
- direction
111
- }) => {
109
+ this.handleHighlightOption = (event, _ref) => {
110
+ let direction = _ref.direction;
112
111
  const _this$props2 = this.props,
113
112
  onRequestSelectNextDay = _this$props2.onRequestSelectNextDay,
114
113
  onRequestSelectPrevDay = _this$props2.onRequestSelectPrevDay;
@@ -146,7 +145,8 @@ let DateInput = (_dec = withStyle(generateStyle, null), _dec2 = testable(), _dec
146
145
  });
147
146
  }
148
147
 
149
- renderMonthNavigationButton(type = 'prev') {
148
+ renderMonthNavigationButton() {
149
+ let type = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 'prev';
150
150
  const _this$props5 = this.props,
151
151
  renderPrevMonthButton = _this$props5.renderPrevMonthButton,
152
152
  renderNextMonthButton = _this$props5.renderNextMonthButton;
@@ -156,9 +156,8 @@ let DateInput = (_dec = withStyle(generateStyle, null), _dec2 = testable(), _dec
156
156
  });
157
157
  }
158
158
 
159
- renderDays({
160
- getOptionProps
161
- }) {
159
+ renderDays(_ref2) {
160
+ let getOptionProps = _ref2.getOptionProps;
162
161
  const children = this.props.children;
163
162
  return Children.map(children, day => {
164
163
  const _day$props2 = day.props,
@@ -177,10 +176,9 @@ let DateInput = (_dec = withStyle(generateStyle, null), _dec2 = testable(), _dec
177
176
  });
178
177
  }
179
178
 
180
- renderCalendar({
181
- getListProps,
182
- getOptionProps
183
- }) {
179
+ renderCalendar(_ref3) {
180
+ let getListProps = _ref3.getListProps,
181
+ getOptionProps = _ref3.getOptionProps;
184
182
  const _this$props6 = this.props,
185
183
  onRequestRenderNextMonth = _this$props6.onRequestRenderNextMonth,
186
184
  onRequestRenderPrevMonth = _this$props6.onRequestRenderPrevMonth,
@@ -198,10 +196,10 @@ let DateInput = (_dec = withStyle(generateStyle, null), _dec2 = testable(), _dec
198
196
  }));
199
197
  }
200
198
 
201
- renderInput({
202
- getInputProps,
203
- getTriggerProps
204
- }) {
199
+ renderInput(_ref4) {
200
+ let getInputProps = _ref4.getInputProps,
201
+ getTriggerProps = _ref4.getTriggerProps;
202
+
205
203
  const _this$props7 = this.props,
206
204
  renderLabel = _this$props7.renderLabel,
207
205
  value = _this$props7.value,
@@ -265,30 +263,31 @@ let DateInput = (_dec = withStyle(generateStyle, null), _dec2 = testable(), _dec
265
263
  onRequestSelectOption: this.handleHideCalendar,
266
264
  selectedOptionId: selectedDateId,
267
265
  highlightedOptionId: selectedDateId
268
- }, ({
269
- getRootProps,
270
- getInputProps,
271
- getTriggerProps,
272
- getListProps,
273
- getOptionProps,
274
- getDescriptionProps
275
- }) => jsx("span", getRootProps({
276
- css: styles === null || styles === void 0 ? void 0 : styles.dateInput
277
- }), this.renderInput({
278
- getInputProps,
279
- getTriggerProps
280
- }), jsx("span", Object.assign({}, getDescriptionProps(), {
281
- css: styles === null || styles === void 0 ? void 0 : styles.assistiveText
282
- }), assistiveText), jsx(Popover, {
283
- placement: placement,
284
- isShowingContent: isShowingCalendar,
285
- positionTarget: this._input,
286
- shouldReturnFocus: false,
287
- shouldFocusContentOnTriggerBlur: true
288
- }, this.renderCalendar({
289
- getListProps,
290
- getOptionProps
291
- }))));
266
+ }, _ref5 => {
267
+ let getRootProps = _ref5.getRootProps,
268
+ getInputProps = _ref5.getInputProps,
269
+ getTriggerProps = _ref5.getTriggerProps,
270
+ getListProps = _ref5.getListProps,
271
+ getOptionProps = _ref5.getOptionProps,
272
+ getDescriptionProps = _ref5.getDescriptionProps;
273
+ return jsx("span", getRootProps({
274
+ css: styles === null || styles === void 0 ? void 0 : styles.dateInput
275
+ }), this.renderInput({
276
+ getInputProps,
277
+ getTriggerProps
278
+ }), jsx("span", Object.assign({}, getDescriptionProps(), {
279
+ css: styles === null || styles === void 0 ? void 0 : styles.assistiveText
280
+ }), assistiveText), jsx(Popover, {
281
+ placement: placement,
282
+ isShowingContent: isShowingCalendar,
283
+ positionTarget: this._input,
284
+ shouldReturnFocus: false,
285
+ shouldFocusContentOnTriggerBlur: true
286
+ }, this.renderCalendar({
287
+ getListProps,
288
+ getOptionProps
289
+ })));
290
+ });
292
291
  }
293
292
 
294
293
  }, _class2.displayName = "DateInput", _class2.componentId = 'DateInput', _class2.Day = Calendar.Day, _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
@@ -41,8 +41,14 @@ var _index = require("./index");
41
41
 
42
42
  /* eslint-enable no-restricted-imports */
43
43
  const DateInputLocator = (0, _locator.locator)(_index.DateInput.selector, {
44
- findInput: (...args) => (0, _locator.locator)('input').find(...args),
45
- findCalendar: async (element, ...args) => {
44
+ findInput: function () {
45
+ return (0, _locator.locator)('input').find(...arguments);
46
+ },
47
+ findCalendar: async function (element) {
48
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
49
+ args[_key - 1] = arguments[_key];
50
+ }
51
+
46
52
  const content = await _PopoverLocator.PopoverLocator.findContent(element, ...args);
47
53
  return content ? _CalendarLocator.CalendarLocator.find(content.getDOMNode()) : null;
48
54
  }
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.DateInput = exports.default = void 0;
8
+ exports.default = exports.DateInput = void 0;
9
9
 
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
11
 
@@ -50,8 +50,8 @@ category: components
50
50
  ---
51
51
  **/
52
52
  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
- constructor(...args) {
54
- super(...args);
53
+ constructor() {
54
+ super(...arguments);
55
55
  this.state = {
56
56
  hasInputRef: false
57
57
  };
@@ -108,9 +108,8 @@ let DateInput = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 =
108
108
  onRequestHideCalendar(event);
109
109
  };
110
110
 
111
- this.handleHighlightOption = (event, {
112
- direction
113
- }) => {
111
+ this.handleHighlightOption = (event, _ref) => {
112
+ let direction = _ref.direction;
114
113
  const _this$props2 = this.props,
115
114
  onRequestSelectNextDay = _this$props2.onRequestSelectNextDay,
116
115
  onRequestSelectPrevDay = _this$props2.onRequestSelectPrevDay;
@@ -150,7 +149,8 @@ let DateInput = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 =
150
149
  });
151
150
  }
152
151
 
153
- renderMonthNavigationButton(type = 'prev') {
152
+ renderMonthNavigationButton() {
153
+ let type = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 'prev';
154
154
  const _this$props5 = this.props,
155
155
  renderPrevMonthButton = _this$props5.renderPrevMonthButton,
156
156
  renderNextMonthButton = _this$props5.renderNextMonthButton;
@@ -160,9 +160,8 @@ let DateInput = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 =
160
160
  });
161
161
  }
162
162
 
163
- renderDays({
164
- getOptionProps
165
- }) {
163
+ renderDays(_ref2) {
164
+ let getOptionProps = _ref2.getOptionProps;
166
165
  const children = this.props.children;
167
166
  return _react.Children.map(children, day => {
168
167
  const _day$props2 = day.props,
@@ -181,10 +180,9 @@ let DateInput = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 =
181
180
  });
182
181
  }
183
182
 
184
- renderCalendar({
185
- getListProps,
186
- getOptionProps
187
- }) {
183
+ renderCalendar(_ref3) {
184
+ let getListProps = _ref3.getListProps,
185
+ getOptionProps = _ref3.getOptionProps;
188
186
  const _this$props6 = this.props,
189
187
  onRequestRenderNextMonth = _this$props6.onRequestRenderNextMonth,
190
188
  onRequestRenderPrevMonth = _this$props6.onRequestRenderPrevMonth,
@@ -202,10 +200,9 @@ let DateInput = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 =
202
200
  }));
203
201
  }
204
202
 
205
- renderInput({
206
- getInputProps,
207
- getTriggerProps
208
- }) {
203
+ renderInput(_ref4) {
204
+ let getInputProps = _ref4.getInputProps,
205
+ getTriggerProps = _ref4.getTriggerProps;
209
206
  const _this$props7 = this.props,
210
207
  renderLabel = _this$props7.renderLabel,
211
208
  value = _this$props7.value,
@@ -268,30 +265,31 @@ let DateInput = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 =
268
265
  onRequestSelectOption: this.handleHideCalendar,
269
266
  selectedOptionId: selectedDateId,
270
267
  highlightedOptionId: selectedDateId
271
- }, ({
272
- getRootProps,
273
- getInputProps,
274
- getTriggerProps,
275
- getListProps,
276
- getOptionProps,
277
- getDescriptionProps
278
- }) => (0, _emotion.jsx)("span", getRootProps({
279
- css: styles === null || styles === void 0 ? void 0 : styles.dateInput
280
- }), this.renderInput({
281
- getInputProps,
282
- getTriggerProps
283
- }), (0, _emotion.jsx)("span", Object.assign({}, getDescriptionProps(), {
284
- css: styles === null || styles === void 0 ? void 0 : styles.assistiveText
285
- }), assistiveText), (0, _emotion.jsx)(_Popover.Popover, {
286
- placement: placement,
287
- isShowingContent: isShowingCalendar,
288
- positionTarget: this._input,
289
- shouldReturnFocus: false,
290
- shouldFocusContentOnTriggerBlur: true
291
- }, this.renderCalendar({
292
- getListProps,
293
- getOptionProps
294
- }))));
268
+ }, _ref5 => {
269
+ let getRootProps = _ref5.getRootProps,
270
+ getInputProps = _ref5.getInputProps,
271
+ getTriggerProps = _ref5.getTriggerProps,
272
+ getListProps = _ref5.getListProps,
273
+ getOptionProps = _ref5.getOptionProps,
274
+ getDescriptionProps = _ref5.getDescriptionProps;
275
+ return (0, _emotion.jsx)("span", getRootProps({
276
+ css: styles === null || styles === void 0 ? void 0 : styles.dateInput
277
+ }), this.renderInput({
278
+ getInputProps,
279
+ getTriggerProps
280
+ }), (0, _emotion.jsx)("span", Object.assign({}, getDescriptionProps(), {
281
+ css: styles === null || styles === void 0 ? void 0 : styles.assistiveText
282
+ }), assistiveText), (0, _emotion.jsx)(_Popover.Popover, {
283
+ placement: placement,
284
+ isShowingContent: isShowingCalendar,
285
+ positionTarget: this._input,
286
+ shouldReturnFocus: false,
287
+ shouldFocusContentOnTriggerBlur: true
288
+ }, this.renderCalendar({
289
+ getListProps,
290
+ getOptionProps
291
+ })));
292
+ });
295
293
  }
296
294
 
297
295
  }, _class2.displayName = "DateInput", _class2.componentId = 'DateInput', _class2.Day = _Calendar.Calendar.Day, _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.allowedProps = exports.propTypes = void 0;
8
+ exports.propTypes = exports.allowedProps = void 0;
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-date-input",
3
- "version": "8.12.1-snapshot.44+6f00103af",
3
+ "version": "8.12.1-snapshot.50+3786369ec",
4
4
  "description": "A UI component library made by Instructure Inc.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "type": "commonjs",
@@ -24,24 +24,24 @@
24
24
  },
25
25
  "license": "MIT",
26
26
  "devDependencies": {
27
- "@instructure/ui-babel-preset": "8.12.1-snapshot.44+6f00103af",
28
- "@instructure/ui-test-locator": "8.12.1-snapshot.44+6f00103af",
29
- "@instructure/ui-test-utils": "8.12.1-snapshot.44+6f00103af"
27
+ "@instructure/ui-babel-preset": "8.12.1-snapshot.50+3786369ec",
28
+ "@instructure/ui-test-locator": "8.12.1-snapshot.50+3786369ec",
29
+ "@instructure/ui-test-utils": "8.12.1-snapshot.50+3786369ec"
30
30
  },
31
31
  "dependencies": {
32
32
  "@babel/runtime": "^7.13.10",
33
- "@instructure/emotion": "8.12.1-snapshot.44+6f00103af",
34
- "@instructure/ui-calendar": "8.12.1-snapshot.44+6f00103af",
35
- "@instructure/ui-form-field": "8.12.1-snapshot.44+6f00103af",
36
- "@instructure/ui-icons": "8.12.1-snapshot.44+6f00103af",
37
- "@instructure/ui-popover": "8.12.1-snapshot.44+6f00103af",
38
- "@instructure/ui-position": "8.12.1-snapshot.44+6f00103af",
39
- "@instructure/ui-prop-types": "8.12.1-snapshot.44+6f00103af",
40
- "@instructure/ui-react-utils": "8.12.1-snapshot.44+6f00103af",
41
- "@instructure/ui-selectable": "8.12.1-snapshot.44+6f00103af",
42
- "@instructure/ui-testable": "8.12.1-snapshot.44+6f00103af",
43
- "@instructure/ui-text-input": "8.12.1-snapshot.44+6f00103af",
44
- "@instructure/ui-utils": "8.12.1-snapshot.44+6f00103af",
33
+ "@instructure/emotion": "8.12.1-snapshot.50+3786369ec",
34
+ "@instructure/ui-calendar": "8.12.1-snapshot.50+3786369ec",
35
+ "@instructure/ui-form-field": "8.12.1-snapshot.50+3786369ec",
36
+ "@instructure/ui-icons": "8.12.1-snapshot.50+3786369ec",
37
+ "@instructure/ui-popover": "8.12.1-snapshot.50+3786369ec",
38
+ "@instructure/ui-position": "8.12.1-snapshot.50+3786369ec",
39
+ "@instructure/ui-prop-types": "8.12.1-snapshot.50+3786369ec",
40
+ "@instructure/ui-react-utils": "8.12.1-snapshot.50+3786369ec",
41
+ "@instructure/ui-selectable": "8.12.1-snapshot.50+3786369ec",
42
+ "@instructure/ui-testable": "8.12.1-snapshot.50+3786369ec",
43
+ "@instructure/ui-text-input": "8.12.1-snapshot.50+3786369ec",
44
+ "@instructure/ui-utils": "8.12.1-snapshot.50+3786369ec",
45
45
  "prop-types": "^15"
46
46
  },
47
47
  "peerDependencies": {
@@ -51,5 +51,5 @@
51
51
  "access": "public"
52
52
  },
53
53
  "sideEffects": false,
54
- "gitHead": "6f00103af2fc970bbdcc8c2505413e42257afef4"
54
+ "gitHead": "3786369ec892bc0f716844828cc2729447adb8be"
55
55
  }