@instructure/ui-date-input 8.38.2-snapshot-5 → 8.38.2-snapshot-6

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 CHANGED
@@ -3,7 +3,7 @@
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
- ## [8.38.2-snapshot-5](https://github.com/instructure/instructure-ui/compare/v8.38.1...v8.38.2-snapshot-5) (2023-07-14)
6
+ ## [8.38.2-snapshot-6](https://github.com/instructure/instructure-ui/compare/v8.38.1...v8.38.2-snapshot-6) (2023-07-17)
7
7
 
8
8
  **Note:** Version bump only for package @instructure/ui-date-input
9
9
 
@@ -34,13 +34,8 @@ import { DateInput } from './index';
34
34
 
35
35
  // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
36
36
  export const DateInputLocator = locator(DateInput.selector, {
37
- findInput: function () {
38
- return locator('input').find(...arguments);
39
- },
40
- findCalendar: async function (element) {
41
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
42
- args[_key - 1] = arguments[_key];
43
- }
37
+ findInput: (...args) => locator('input').find(...args),
38
+ findCalendar: async (element, ...args) => {
44
39
  const content = await PopoverLocator.findContent(element, ...args);
45
40
  return content ? CalendarLocator.find(content.getDOMNode()) : null;
46
41
  }
@@ -48,8 +48,8 @@ See <https://instructure.design/#DateInput/>
48
48
  @tsProps
49
49
  **/
50
50
  let DateInput = (_dec = withStyle(generateStyle, null), _dec2 = testable(), _dec(_class = _dec2(_class = (_class2 = class DateInput extends Component {
51
- constructor() {
52
- super(...arguments);
51
+ constructor(...args) {
52
+ super(...args);
53
53
  this.state = {
54
54
  hasInputRef: false
55
55
  };
@@ -90,8 +90,9 @@ let DateInput = (_dec = withStyle(generateStyle, null), _dec2 = testable(), _dec
90
90
  (_this$props$onRequest2 = (_this$props4 = this.props).onRequestValidateDate) === null || _this$props$onRequest2 === void 0 ? void 0 : _this$props$onRequest2.call(_this$props4, event);
91
91
  (_this$props$onRequest3 = (_this$props5 = this.props).onRequestHideCalendar) === null || _this$props$onRequest3 === void 0 ? void 0 : _this$props$onRequest3.call(_this$props5, event);
92
92
  };
93
- this.handleHighlightOption = (event, _ref) => {
94
- let direction = _ref.direction;
93
+ this.handleHighlightOption = (event, {
94
+ direction
95
+ }) => {
95
96
  const _this$props6 = this.props,
96
97
  onRequestSelectNextDay = _this$props6.onRequestSelectNextDay,
97
98
  onRequestSelectPrevDay = _this$props6.onRequestSelectPrevDay;
@@ -124,8 +125,7 @@ let DateInput = (_dec = withStyle(generateStyle, null), _dec2 = testable(), _dec
124
125
  props: this.props
125
126
  });
126
127
  }
127
- renderMonthNavigationButton() {
128
- let type = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 'prev';
128
+ renderMonthNavigationButton(type = 'prev') {
129
129
  const _this$props9 = this.props,
130
130
  renderPrevMonthButton = _this$props9.renderPrevMonthButton,
131
131
  renderNextMonthButton = _this$props9.renderNextMonthButton;
@@ -153,9 +153,10 @@ let DateInput = (_dec = withStyle(generateStyle, null), _dec2 = testable(), _dec
153
153
  return safeCloneElement(day, propsAdded);
154
154
  });
155
155
  }
156
- renderCalendar(_ref2) {
157
- let getListProps = _ref2.getListProps,
158
- getOptionProps = _ref2.getOptionProps;
156
+ renderCalendar({
157
+ getListProps,
158
+ getOptionProps
159
+ }) {
159
160
  const _this$props10 = this.props,
160
161
  onRequestRenderNextMonth = _this$props10.onRequestRenderNextMonth,
161
162
  onRequestRenderPrevMonth = _this$props10.onRequestRenderPrevMonth,
@@ -170,9 +171,10 @@ let DateInput = (_dec = withStyle(generateStyle, null), _dec2 = testable(), _dec
170
171
  renderPrevMonthButton: this.renderMonthNavigationButton('prev')
171
172
  }), this.renderDays(getOptionProps));
172
173
  }
173
- renderInput(_ref3) {
174
- let getInputProps = _ref3.getInputProps,
175
- getTriggerProps = _ref3.getTriggerProps;
174
+ renderInput({
175
+ getInputProps,
176
+ getTriggerProps
177
+ }) {
176
178
  const _this$props11 = this.props,
177
179
  renderLabel = _this$props11.renderLabel,
178
180
  value = _this$props11.value,
@@ -229,33 +231,32 @@ let DateInput = (_dec = withStyle(generateStyle, null), _dec2 = testable(), _dec
229
231
  onRequestSelectOption: this.handleHideCalendar,
230
232
  selectedOptionId: this.selectedDateId,
231
233
  highlightedOptionId: this.selectedDateId
232
- }, _ref4 => {
233
- let getRootProps = _ref4.getRootProps,
234
- getInputProps = _ref4.getInputProps,
235
- getTriggerProps = _ref4.getTriggerProps,
236
- getListProps = _ref4.getListProps,
237
- getOptionProps = _ref4.getOptionProps,
238
- getDescriptionProps = _ref4.getDescriptionProps;
239
- return jsx("span", Object.assign({}, getRootProps({
240
- css: styles === null || styles === void 0 ? void 0 : styles.dateInput
241
- }), {
242
- ref: el => this.ref = el
243
- }), this.renderInput({
244
- getInputProps,
245
- getTriggerProps
246
- }), jsx("span", Object.assign({}, getDescriptionProps(), {
247
- css: styles === null || styles === void 0 ? void 0 : styles.assistiveText
248
- }), assistiveText), jsx(Popover, {
249
- placement: placement,
250
- isShowingContent: isShowingCalendar,
251
- positionTarget: this._input,
252
- shouldReturnFocus: false,
253
- shouldFocusContentOnTriggerBlur: true
254
- }, this.renderCalendar({
255
- getListProps,
256
- getOptionProps
257
- })));
258
- });
234
+ }, ({
235
+ getRootProps,
236
+ getInputProps,
237
+ getTriggerProps,
238
+ getListProps,
239
+ getOptionProps,
240
+ getDescriptionProps
241
+ }) => jsx("span", Object.assign({}, getRootProps({
242
+ css: styles === null || styles === void 0 ? void 0 : styles.dateInput
243
+ }), {
244
+ ref: el => this.ref = el
245
+ }), this.renderInput({
246
+ getInputProps,
247
+ getTriggerProps
248
+ }), jsx("span", Object.assign({}, getDescriptionProps(), {
249
+ css: styles === null || styles === void 0 ? void 0 : styles.assistiveText
250
+ }), assistiveText), jsx(Popover, {
251
+ placement: placement,
252
+ isShowingContent: isShowingCalendar,
253
+ positionTarget: this._input,
254
+ shouldReturnFocus: false,
255
+ shouldFocusContentOnTriggerBlur: true
256
+ }, this.renderCalendar({
257
+ getListProps,
258
+ getOptionProps
259
+ }))));
259
260
  }
260
261
  }, _class2.displayName = "DateInput", _class2.componentId = 'DateInput', _class2.Day = Calendar.Day, _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
261
262
  value: '',
@@ -41,13 +41,8 @@ var _index = require("./index");
41
41
 
42
42
  // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
43
43
  const DateInputLocator = (0, _locator.locator)(_index.DateInput.selector, {
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
- }
44
+ findInput: (...args) => (0, _locator.locator)('input').find(...args),
45
+ findCalendar: async (element, ...args) => {
51
46
  const content = await _PopoverLocator.PopoverLocator.findContent(element, ...args);
52
47
  return content ? _CalendarLocator.CalendarLocator.find(content.getDOMNode()) : null;
53
48
  }
@@ -58,8 +58,8 @@ See <https://instructure.design/#DateInput/>
58
58
  @tsProps
59
59
  **/
60
60
  let DateInput = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_class2 = class DateInput extends _react.Component {
61
- constructor() {
62
- super(...arguments);
61
+ constructor(...args) {
62
+ super(...args);
63
63
  this.state = {
64
64
  hasInputRef: false
65
65
  };
@@ -100,8 +100,9 @@ let DateInput = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 =
100
100
  (_this$props$onRequest2 = (_this$props4 = this.props).onRequestValidateDate) === null || _this$props$onRequest2 === void 0 ? void 0 : _this$props$onRequest2.call(_this$props4, event);
101
101
  (_this$props$onRequest3 = (_this$props5 = this.props).onRequestHideCalendar) === null || _this$props$onRequest3 === void 0 ? void 0 : _this$props$onRequest3.call(_this$props5, event);
102
102
  };
103
- this.handleHighlightOption = (event, _ref) => {
104
- let direction = _ref.direction;
103
+ this.handleHighlightOption = (event, {
104
+ direction
105
+ }) => {
105
106
  const _this$props6 = this.props,
106
107
  onRequestSelectNextDay = _this$props6.onRequestSelectNextDay,
107
108
  onRequestSelectPrevDay = _this$props6.onRequestSelectPrevDay;
@@ -134,8 +135,7 @@ let DateInput = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 =
134
135
  props: this.props
135
136
  });
136
137
  }
137
- renderMonthNavigationButton() {
138
- let type = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 'prev';
138
+ renderMonthNavigationButton(type = 'prev') {
139
139
  const _this$props9 = this.props,
140
140
  renderPrevMonthButton = _this$props9.renderPrevMonthButton,
141
141
  renderNextMonthButton = _this$props9.renderNextMonthButton;
@@ -163,9 +163,10 @@ let DateInput = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 =
163
163
  return (0, _safeCloneElement.safeCloneElement)(day, propsAdded);
164
164
  });
165
165
  }
166
- renderCalendar(_ref2) {
167
- let getListProps = _ref2.getListProps,
168
- getOptionProps = _ref2.getOptionProps;
166
+ renderCalendar({
167
+ getListProps,
168
+ getOptionProps
169
+ }) {
169
170
  const _this$props10 = this.props,
170
171
  onRequestRenderNextMonth = _this$props10.onRequestRenderNextMonth,
171
172
  onRequestRenderPrevMonth = _this$props10.onRequestRenderPrevMonth,
@@ -180,9 +181,10 @@ let DateInput = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 =
180
181
  renderPrevMonthButton: this.renderMonthNavigationButton('prev')
181
182
  }), this.renderDays(getOptionProps));
182
183
  }
183
- renderInput(_ref3) {
184
- let getInputProps = _ref3.getInputProps,
185
- getTriggerProps = _ref3.getTriggerProps;
184
+ renderInput({
185
+ getInputProps,
186
+ getTriggerProps
187
+ }) {
186
188
  const _this$props11 = this.props,
187
189
  renderLabel = _this$props11.renderLabel,
188
190
  value = _this$props11.value,
@@ -239,33 +241,32 @@ let DateInput = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 =
239
241
  onRequestSelectOption: this.handleHideCalendar,
240
242
  selectedOptionId: this.selectedDateId,
241
243
  highlightedOptionId: this.selectedDateId
242
- }, _ref4 => {
243
- let getRootProps = _ref4.getRootProps,
244
- getInputProps = _ref4.getInputProps,
245
- getTriggerProps = _ref4.getTriggerProps,
246
- getListProps = _ref4.getListProps,
247
- getOptionProps = _ref4.getOptionProps,
248
- getDescriptionProps = _ref4.getDescriptionProps;
249
- return (0, _emotion.jsx)("span", Object.assign({}, getRootProps({
250
- css: styles === null || styles === void 0 ? void 0 : styles.dateInput
251
- }), {
252
- ref: el => this.ref = el
253
- }), this.renderInput({
254
- getInputProps,
255
- getTriggerProps
256
- }), (0, _emotion.jsx)("span", Object.assign({}, getDescriptionProps(), {
257
- css: styles === null || styles === void 0 ? void 0 : styles.assistiveText
258
- }), assistiveText), (0, _emotion.jsx)(_Popover.Popover, {
259
- placement: placement,
260
- isShowingContent: isShowingCalendar,
261
- positionTarget: this._input,
262
- shouldReturnFocus: false,
263
- shouldFocusContentOnTriggerBlur: true
264
- }, this.renderCalendar({
265
- getListProps,
266
- getOptionProps
267
- })));
268
- });
244
+ }, ({
245
+ getRootProps,
246
+ getInputProps,
247
+ getTriggerProps,
248
+ getListProps,
249
+ getOptionProps,
250
+ getDescriptionProps
251
+ }) => (0, _emotion.jsx)("span", Object.assign({}, getRootProps({
252
+ css: styles === null || styles === void 0 ? void 0 : styles.dateInput
253
+ }), {
254
+ ref: el => this.ref = el
255
+ }), this.renderInput({
256
+ getInputProps,
257
+ getTriggerProps
258
+ }), (0, _emotion.jsx)("span", Object.assign({}, getDescriptionProps(), {
259
+ css: styles === null || styles === void 0 ? void 0 : styles.assistiveText
260
+ }), assistiveText), (0, _emotion.jsx)(_Popover.Popover, {
261
+ placement: placement,
262
+ isShowingContent: isShowingCalendar,
263
+ positionTarget: this._input,
264
+ shouldReturnFocus: false,
265
+ shouldFocusContentOnTriggerBlur: true
266
+ }, this.renderCalendar({
267
+ getListProps,
268
+ getOptionProps
269
+ }))));
269
270
  }
270
271
  }, _class2.displayName = "DateInput", _class2.componentId = 'DateInput', _class2.Day = _Calendar.Calendar.Day, _class2.propTypes = _props2.propTypes, _class2.allowedProps = _props2.allowedProps, _class2.defaultProps = {
271
272
  value: '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-date-input",
3
- "version": "8.38.2-snapshot-5",
3
+ "version": "8.38.2-snapshot-6",
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.38.2-snapshot-5",
27
- "@instructure/ui-test-locator": "8.38.2-snapshot-5",
28
- "@instructure/ui-test-utils": "8.38.2-snapshot-5"
26
+ "@instructure/ui-babel-preset": "8.38.2-snapshot-6",
27
+ "@instructure/ui-test-locator": "8.38.2-snapshot-6",
28
+ "@instructure/ui-test-utils": "8.38.2-snapshot-6"
29
29
  },
30
30
  "dependencies": {
31
- "@babel/runtime": "^7.22.5",
32
- "@instructure/emotion": "8.38.2-snapshot-5",
33
- "@instructure/ui-calendar": "8.38.2-snapshot-5",
34
- "@instructure/ui-form-field": "8.38.2-snapshot-5",
35
- "@instructure/ui-icons": "8.38.2-snapshot-5",
36
- "@instructure/ui-popover": "8.38.2-snapshot-5",
37
- "@instructure/ui-position": "8.38.2-snapshot-5",
38
- "@instructure/ui-prop-types": "8.38.2-snapshot-5",
39
- "@instructure/ui-react-utils": "8.38.2-snapshot-5",
40
- "@instructure/ui-selectable": "8.38.2-snapshot-5",
41
- "@instructure/ui-testable": "8.38.2-snapshot-5",
42
- "@instructure/ui-text-input": "8.38.2-snapshot-5",
43
- "@instructure/ui-utils": "8.38.2-snapshot-5",
31
+ "@babel/runtime": "^7.22.6",
32
+ "@instructure/emotion": "8.38.2-snapshot-6",
33
+ "@instructure/ui-calendar": "8.38.2-snapshot-6",
34
+ "@instructure/ui-form-field": "8.38.2-snapshot-6",
35
+ "@instructure/ui-icons": "8.38.2-snapshot-6",
36
+ "@instructure/ui-popover": "8.38.2-snapshot-6",
37
+ "@instructure/ui-position": "8.38.2-snapshot-6",
38
+ "@instructure/ui-prop-types": "8.38.2-snapshot-6",
39
+ "@instructure/ui-react-utils": "8.38.2-snapshot-6",
40
+ "@instructure/ui-selectable": "8.38.2-snapshot-6",
41
+ "@instructure/ui-testable": "8.38.2-snapshot-6",
42
+ "@instructure/ui-text-input": "8.38.2-snapshot-6",
43
+ "@instructure/ui-utils": "8.38.2-snapshot-6",
44
44
  "prop-types": "^15.8.1"
45
45
  },
46
46
  "peerDependencies": {