baseui 0.0.0-next-e7d1f7c → 0.0.0-next-d6f91d4
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/combobox/index.d.ts +6 -3
- package/datepicker/datepicker.js +4 -14
- package/datepicker/datepicker.js.flow +13 -19
- package/datepicker/index.d.ts +1 -0
- package/datepicker/types.js.flow +2 -0
- package/es/datepicker/datepicker.js +3 -13
- package/esm/datepicker/datepicker.js +4 -14
- package/map-marker/index.d.ts +6 -5
- package/package.json +1 -1
- package/snackbar/index.d.ts +21 -16
package/combobox/index.d.ts
CHANGED
|
@@ -17,11 +17,14 @@ export interface ComboboxOverrides {
|
|
|
17
17
|
ListItem?: Override<any>;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export type PropsT<OptionT =
|
|
20
|
+
export type PropsT<OptionT = any> = {
|
|
21
21
|
autocomplete?: boolean;
|
|
22
22
|
disabled?: boolean;
|
|
23
|
-
mapOptionToNode?: (
|
|
24
|
-
|
|
23
|
+
mapOptionToNode?: (option: {
|
|
24
|
+
isSelected: boolean;
|
|
25
|
+
option: OptionT;
|
|
26
|
+
}) => React.ReactNode;
|
|
27
|
+
mapOptionToString: (option: OptionT) => string;
|
|
25
28
|
id?: string;
|
|
26
29
|
name?: string;
|
|
27
30
|
inputRef?: React.Ref<HTMLInputElement>;
|
package/datepicker/datepicker.js
CHANGED
|
@@ -239,7 +239,7 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
|
|
|
239
239
|
isOpen: true,
|
|
240
240
|
isPseudoFocused: true,
|
|
241
241
|
calendarFocused: false
|
|
242
|
-
});
|
|
242
|
+
}, _this.props.onOpen);
|
|
243
243
|
});
|
|
244
244
|
|
|
245
245
|
_defineProperty(_assertThisInitialized(_this), "close", function () {
|
|
@@ -273,7 +273,7 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
|
|
|
273
273
|
range = _this$props2.range,
|
|
274
274
|
separateRangeInputs = _this$props2.separateRangeInputs;
|
|
275
275
|
|
|
276
|
-
if (mask === null) {
|
|
276
|
+
if (mask === null || mask === undefined && formatString !== DEFAULT_DATE_FORMAT) {
|
|
277
277
|
return null;
|
|
278
278
|
}
|
|
279
279
|
|
|
@@ -281,16 +281,6 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
|
|
|
281
281
|
return _this.normalizeDashes(mask);
|
|
282
282
|
}
|
|
283
283
|
|
|
284
|
-
var normalizedFormatString = _this.normalizeDashes(formatString);
|
|
285
|
-
|
|
286
|
-
if (formatString && !separateRangeInputs) {
|
|
287
|
-
if (range) {
|
|
288
|
-
return "".concat(normalizedFormatString, " \u2013 ").concat(normalizedFormatString).replace(/[a-z]/gi, '9');
|
|
289
|
-
} else {
|
|
290
|
-
return normalizedFormatString.replace(/[a-z]/gi, '9');
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
|
|
294
284
|
if (range && !separateRangeInputs) {
|
|
295
285
|
return '9999/99/99 – 9999/99/99';
|
|
296
286
|
}
|
|
@@ -303,6 +293,8 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
|
|
|
303
293
|
|
|
304
294
|
var mask = _this.getMask();
|
|
305
295
|
|
|
296
|
+
var formatString = _this.normalizeDashes(_this.props.formatString);
|
|
297
|
+
|
|
306
298
|
if (typeof mask === 'string' && inputValue === mask.replace(/9/g, ' ') || inputValue.length === 0) {
|
|
307
299
|
if (_this.props.onChange) {
|
|
308
300
|
if (_this.props.range) {
|
|
@@ -321,8 +313,6 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
|
|
|
321
313
|
inputValue: inputValue
|
|
322
314
|
});
|
|
323
315
|
|
|
324
|
-
var formatString = _this.normalizeDashes(_this.props.formatString);
|
|
325
|
-
|
|
326
316
|
var parseDateString = function parseDateString(dateString) {
|
|
327
317
|
if (formatString === DEFAULT_DATE_FORMAT) {
|
|
328
318
|
return _this.dateHelpers.parse(dateString, 'slashDate', _this.props.locale);
|
|
@@ -191,11 +191,14 @@ export default class Datepicker<T = Date> extends React.Component<
|
|
|
191
191
|
};
|
|
192
192
|
|
|
193
193
|
open = () => {
|
|
194
|
-
this.setState(
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
194
|
+
this.setState(
|
|
195
|
+
{
|
|
196
|
+
isOpen: true,
|
|
197
|
+
isPseudoFocused: true,
|
|
198
|
+
calendarFocused: false,
|
|
199
|
+
},
|
|
200
|
+
this.props.onOpen,
|
|
201
|
+
);
|
|
199
202
|
};
|
|
200
203
|
|
|
201
204
|
close = () => {
|
|
@@ -226,7 +229,10 @@ export default class Datepicker<T = Date> extends React.Component<
|
|
|
226
229
|
getMask = () => {
|
|
227
230
|
const {formatString, mask, range, separateRangeInputs} = this.props;
|
|
228
231
|
|
|
229
|
-
if (
|
|
232
|
+
if (
|
|
233
|
+
mask === null ||
|
|
234
|
+
(mask === undefined && formatString !== DEFAULT_DATE_FORMAT)
|
|
235
|
+
) {
|
|
230
236
|
return null;
|
|
231
237
|
}
|
|
232
238
|
|
|
@@ -234,18 +240,6 @@ export default class Datepicker<T = Date> extends React.Component<
|
|
|
234
240
|
return this.normalizeDashes(mask);
|
|
235
241
|
}
|
|
236
242
|
|
|
237
|
-
const normalizedFormatString = this.normalizeDashes(formatString);
|
|
238
|
-
if (formatString && !separateRangeInputs) {
|
|
239
|
-
if (range) {
|
|
240
|
-
return `${normalizedFormatString} – ${normalizedFormatString}`.replace(
|
|
241
|
-
/[a-z]/gi,
|
|
242
|
-
'9',
|
|
243
|
-
);
|
|
244
|
-
} else {
|
|
245
|
-
return normalizedFormatString.replace(/[a-z]/gi, '9');
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
243
|
if (range && !separateRangeInputs) {
|
|
250
244
|
return '9999/99/99 – 9999/99/99';
|
|
251
245
|
}
|
|
@@ -267,6 +261,7 @@ export default class Datepicker<T = Date> extends React.Component<
|
|
|
267
261
|
: event.currentTarget.value;
|
|
268
262
|
|
|
269
263
|
const mask = this.getMask();
|
|
264
|
+
const formatString = this.normalizeDashes(this.props.formatString);
|
|
270
265
|
|
|
271
266
|
if (
|
|
272
267
|
(typeof mask === 'string' && inputValue === mask.replace(/9/g, ' ')) ||
|
|
@@ -283,7 +278,6 @@ export default class Datepicker<T = Date> extends React.Component<
|
|
|
283
278
|
|
|
284
279
|
this.setState({inputValue});
|
|
285
280
|
|
|
286
|
-
const formatString = this.normalizeDashes(this.props.formatString);
|
|
287
281
|
const parseDateString = dateString => {
|
|
288
282
|
if (formatString === DEFAULT_DATE_FORMAT) {
|
|
289
283
|
return this.dateHelpers.parse(
|
package/datepicker/index.d.ts
CHANGED
package/datepicker/types.js.flow
CHANGED
|
@@ -222,6 +222,8 @@ export type DatepickerPropsT<T = Date> = CalendarPropsT<T> & {
|
|
|
222
222
|
mountNode?: HTMLElement,
|
|
223
223
|
/** Called when calendar is closed */
|
|
224
224
|
onClose?: () => mixed,
|
|
225
|
+
/** Called when calendar is opened */
|
|
226
|
+
onOpen?: () => mixed,
|
|
225
227
|
mask?: string | null,
|
|
226
228
|
/** Determines if startDate and endDate should be separated into two input fields. Ignored if `range` is not true. */
|
|
227
229
|
separateRangeInputs?: boolean,
|
|
@@ -151,7 +151,7 @@ export default class Datepicker extends React.Component {
|
|
|
151
151
|
isOpen: true,
|
|
152
152
|
isPseudoFocused: true,
|
|
153
153
|
calendarFocused: false
|
|
154
|
-
});
|
|
154
|
+
}, this.props.onOpen);
|
|
155
155
|
});
|
|
156
156
|
|
|
157
157
|
_defineProperty(this, "close", () => {
|
|
@@ -185,7 +185,7 @@ export default class Datepicker extends React.Component {
|
|
|
185
185
|
separateRangeInputs
|
|
186
186
|
} = this.props;
|
|
187
187
|
|
|
188
|
-
if (mask === null) {
|
|
188
|
+
if (mask === null || mask === undefined && formatString !== DEFAULT_DATE_FORMAT) {
|
|
189
189
|
return null;
|
|
190
190
|
}
|
|
191
191
|
|
|
@@ -193,16 +193,6 @@ export default class Datepicker extends React.Component {
|
|
|
193
193
|
return this.normalizeDashes(mask);
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
const normalizedFormatString = this.normalizeDashes(formatString);
|
|
197
|
-
|
|
198
|
-
if (formatString && !separateRangeInputs) {
|
|
199
|
-
if (range) {
|
|
200
|
-
return `${normalizedFormatString} – ${normalizedFormatString}`.replace(/[a-z]/gi, '9');
|
|
201
|
-
} else {
|
|
202
|
-
return normalizedFormatString.replace(/[a-z]/gi, '9');
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
196
|
if (range && !separateRangeInputs) {
|
|
207
197
|
return '9999/99/99 – 9999/99/99';
|
|
208
198
|
}
|
|
@@ -213,6 +203,7 @@ export default class Datepicker extends React.Component {
|
|
|
213
203
|
_defineProperty(this, "handleInputChange", (event, separatedInput) => {
|
|
214
204
|
const inputValue = this.props.range && this.props.separateRangeInputs ? combineSeparatedInputs(event.currentTarget.value, this.state.inputValue, separatedInput) : event.currentTarget.value;
|
|
215
205
|
const mask = this.getMask();
|
|
206
|
+
const formatString = this.normalizeDashes(this.props.formatString);
|
|
216
207
|
|
|
217
208
|
if (typeof mask === 'string' && inputValue === mask.replace(/9/g, ' ') || inputValue.length === 0) {
|
|
218
209
|
if (this.props.onChange) {
|
|
@@ -231,7 +222,6 @@ export default class Datepicker extends React.Component {
|
|
|
231
222
|
this.setState({
|
|
232
223
|
inputValue
|
|
233
224
|
});
|
|
234
|
-
const formatString = this.normalizeDashes(this.props.formatString);
|
|
235
225
|
|
|
236
226
|
const parseDateString = dateString => {
|
|
237
227
|
if (formatString === DEFAULT_DATE_FORMAT) {
|
|
@@ -221,7 +221,7 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
|
|
|
221
221
|
isOpen: true,
|
|
222
222
|
isPseudoFocused: true,
|
|
223
223
|
calendarFocused: false
|
|
224
|
-
});
|
|
224
|
+
}, _this.props.onOpen);
|
|
225
225
|
});
|
|
226
226
|
|
|
227
227
|
_defineProperty(_assertThisInitialized(_this), "close", function () {
|
|
@@ -255,7 +255,7 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
|
|
|
255
255
|
range = _this$props2.range,
|
|
256
256
|
separateRangeInputs = _this$props2.separateRangeInputs;
|
|
257
257
|
|
|
258
|
-
if (mask === null) {
|
|
258
|
+
if (mask === null || mask === undefined && formatString !== DEFAULT_DATE_FORMAT) {
|
|
259
259
|
return null;
|
|
260
260
|
}
|
|
261
261
|
|
|
@@ -263,16 +263,6 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
|
|
|
263
263
|
return _this.normalizeDashes(mask);
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
-
var normalizedFormatString = _this.normalizeDashes(formatString);
|
|
267
|
-
|
|
268
|
-
if (formatString && !separateRangeInputs) {
|
|
269
|
-
if (range) {
|
|
270
|
-
return "".concat(normalizedFormatString, " \u2013 ").concat(normalizedFormatString).replace(/[a-z]/gi, '9');
|
|
271
|
-
} else {
|
|
272
|
-
return normalizedFormatString.replace(/[a-z]/gi, '9');
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
266
|
if (range && !separateRangeInputs) {
|
|
277
267
|
return '9999/99/99 – 9999/99/99';
|
|
278
268
|
}
|
|
@@ -285,6 +275,8 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
|
|
|
285
275
|
|
|
286
276
|
var mask = _this.getMask();
|
|
287
277
|
|
|
278
|
+
var formatString = _this.normalizeDashes(_this.props.formatString);
|
|
279
|
+
|
|
288
280
|
if (typeof mask === 'string' && inputValue === mask.replace(/9/g, ' ') || inputValue.length === 0) {
|
|
289
281
|
if (_this.props.onChange) {
|
|
290
282
|
if (_this.props.range) {
|
|
@@ -303,8 +295,6 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
|
|
|
303
295
|
inputValue: inputValue
|
|
304
296
|
});
|
|
305
297
|
|
|
306
|
-
var formatString = _this.normalizeDashes(_this.props.formatString);
|
|
307
|
-
|
|
308
298
|
var parseDateString = function parseDateString(dateString) {
|
|
309
299
|
if (formatString === DEFAULT_DATE_FORMAT) {
|
|
310
300
|
return _this.dateHelpers.parse(dateString, 'slashDate', _this.props.locale);
|
package/map-marker/index.d.ts
CHANGED
|
@@ -40,11 +40,12 @@ export interface FLOATING_MARKER_ANCHOR_TYPES {
|
|
|
40
40
|
square: 'square';
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
export type NeedleSizeT =
|
|
44
|
-
export type PinHeadT =
|
|
45
|
-
export type PinHeadSizeT =
|
|
46
|
-
export type AnchorPositionsT =
|
|
47
|
-
export type FloatingMarkerSizeT =
|
|
43
|
+
export type NeedleSizeT = NEEDLE_SIZES[keyof NEEDLE_SIZES];
|
|
44
|
+
export type PinHeadT = PINHEAD_TYPES[keyof PINHEAD_TYPES];
|
|
45
|
+
export type PinHeadSizeT = PINHEAD_SIZES_SHAPES[keyof PINHEAD_SIZES_SHAPES];
|
|
46
|
+
export type AnchorPositionsT = FLOATING_MARKER_ANCHOR_POSITIONS[keyof FLOATING_MARKER_ANCHOR_POSITIONS];
|
|
47
|
+
export type FloatingMarkerSizeT = FLOATING_MARKER_SIZES[keyof FLOATING_MARKER_SIZES];
|
|
48
|
+
export type FloatingMarkerAnchorTypeT = FLOATING_MARKER_ANCHOR_TYPES[keyof FLOATING_MARKER_ANCHOR_TYPES];
|
|
48
49
|
|
|
49
50
|
export type FixedMarkerOverridesT = {
|
|
50
51
|
Root?: Override<any>;
|
package/package.json
CHANGED
package/snackbar/index.d.ts
CHANGED
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
3
|
import {Override} from '../overrides';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
4
|
+
|
|
5
|
+
declare const DURATION: {
|
|
6
|
+
infinite: number;
|
|
7
|
+
short: number;
|
|
8
|
+
medium: number;
|
|
9
|
+
long: number;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
declare const PLACEMENT: {
|
|
13
|
+
topLeft: 'topLeft';
|
|
14
|
+
top: 'top';
|
|
15
|
+
topRight: 'topRight';
|
|
16
|
+
bottomRight: 'bottomRight';
|
|
17
|
+
bottom: 'bottom';
|
|
18
|
+
bottomLeft: 'bottomLeft';
|
|
19
|
+
};
|
|
20
|
+
export {DURATION, PLACEMENT};
|
|
21
|
+
|
|
22
|
+
export type DurationT = (typeof DURATION)[keyof typeof DURATION];
|
|
23
|
+
|
|
24
|
+
export type PlacementT = (typeof PLACEMENT)[keyof typeof PLACEMENT];
|
|
20
25
|
|
|
21
26
|
export type SnackbarElementOverridesT = {
|
|
22
27
|
Root?: Override<any>;
|