baseui 0.0.0-next-39f6d48 → 0.0.0-next-6048bbf
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/data-table/column-datetime.js +2 -0
- package/data-table/column-datetime.js.flow +2 -0
- package/datepicker/datepicker.js +3 -13
- package/datepicker/datepicker.js.flow +5 -14
- package/es/data-table/column-datetime.js +2 -0
- package/es/datepicker/datepicker.js +2 -12
- package/esm/data-table/column-datetime.js +2 -0
- package/esm/datepicker/datepicker.js +3 -13
- package/map-marker/index.d.ts +6 -5
- package/package.json +2 -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>;
|
|
@@ -86,6 +86,7 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
86
86
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
87
87
|
|
|
88
88
|
var DATE_FORMAT = 'MM-dd-yyyy';
|
|
89
|
+
var MASK = '99-99-9999 - 99-99-9999';
|
|
89
90
|
var TIME_FORMAT = 'HH:mm ss:SS';
|
|
90
91
|
var FORMAT_STRING = "".concat(DATE_FORMAT, " ").concat(TIME_FORMAT);
|
|
91
92
|
|
|
@@ -461,6 +462,7 @@ function DatetimeFilter(props) {
|
|
|
461
462
|
}
|
|
462
463
|
},
|
|
463
464
|
formatString: DATE_FORMAT,
|
|
465
|
+
mask: MASK,
|
|
464
466
|
placeholder: "MM-DD-YYYY - MM-DD-YYYY",
|
|
465
467
|
minDate: datesSorted[0],
|
|
466
468
|
maxDate: datesSorted[datesSorted.length - 1],
|
|
@@ -68,6 +68,7 @@ type FilterParametersT = {|
|
|
|
68
68
|
type DatetimeColumnT = ColumnT<Date, FilterParametersT>;
|
|
69
69
|
|
|
70
70
|
const DATE_FORMAT = 'MM-dd-yyyy';
|
|
71
|
+
const MASK = '99-99-9999 - 99-99-9999';
|
|
71
72
|
const TIME_FORMAT = 'HH:mm ss:SS';
|
|
72
73
|
const FORMAT_STRING = `${DATE_FORMAT} ${TIME_FORMAT}`;
|
|
73
74
|
|
|
@@ -415,6 +416,7 @@ function DatetimeFilter(props) {
|
|
|
415
416
|
}
|
|
416
417
|
}}
|
|
417
418
|
formatString={DATE_FORMAT}
|
|
419
|
+
mask={MASK}
|
|
418
420
|
placeholder="MM-DD-YYYY - MM-DD-YYYY"
|
|
419
421
|
minDate={datesSorted[0]}
|
|
420
422
|
maxDate={datesSorted[datesSorted.length - 1]}
|
package/datepicker/datepicker.js
CHANGED
|
@@ -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);
|
|
@@ -229,7 +229,10 @@ export default class Datepicker<T = Date> extends React.Component<
|
|
|
229
229
|
getMask = () => {
|
|
230
230
|
const {formatString, mask, range, separateRangeInputs} = this.props;
|
|
231
231
|
|
|
232
|
-
if (
|
|
232
|
+
if (
|
|
233
|
+
mask === null ||
|
|
234
|
+
(mask === undefined && formatString !== DEFAULT_DATE_FORMAT)
|
|
235
|
+
) {
|
|
233
236
|
return null;
|
|
234
237
|
}
|
|
235
238
|
|
|
@@ -237,18 +240,6 @@ export default class Datepicker<T = Date> extends React.Component<
|
|
|
237
240
|
return this.normalizeDashes(mask);
|
|
238
241
|
}
|
|
239
242
|
|
|
240
|
-
const normalizedFormatString = this.normalizeDashes(formatString);
|
|
241
|
-
if (formatString && !separateRangeInputs) {
|
|
242
|
-
if (range) {
|
|
243
|
-
return `${normalizedFormatString} – ${normalizedFormatString}`.replace(
|
|
244
|
-
/[a-z]/gi,
|
|
245
|
-
'9',
|
|
246
|
-
);
|
|
247
|
-
} else {
|
|
248
|
-
return normalizedFormatString.replace(/[a-z]/gi, '9');
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
|
|
252
243
|
if (range && !separateRangeInputs) {
|
|
253
244
|
return '9999/99/99 – 9999/99/99';
|
|
254
245
|
}
|
|
@@ -270,6 +261,7 @@ export default class Datepicker<T = Date> extends React.Component<
|
|
|
270
261
|
: event.currentTarget.value;
|
|
271
262
|
|
|
272
263
|
const mask = this.getMask();
|
|
264
|
+
const formatString = this.normalizeDashes(this.props.formatString);
|
|
273
265
|
|
|
274
266
|
if (
|
|
275
267
|
(typeof mask === 'string' && inputValue === mask.replace(/9/g, ' ')) ||
|
|
@@ -286,7 +278,6 @@ export default class Datepicker<T = Date> extends React.Component<
|
|
|
286
278
|
|
|
287
279
|
this.setState({inputValue});
|
|
288
280
|
|
|
289
|
-
const formatString = this.normalizeDashes(this.props.formatString);
|
|
290
281
|
const parseDateString = dateString => {
|
|
291
282
|
if (formatString === DEFAULT_DATE_FORMAT) {
|
|
292
283
|
return this.dateHelpers.parse(
|
|
@@ -29,6 +29,7 @@ import { COLUMNS, DATETIME_OPERATIONS } from './constants.js';
|
|
|
29
29
|
import FilterShell from './filter-shell.js';
|
|
30
30
|
import { LocaleContext } from '../locale/index.js';
|
|
31
31
|
const DATE_FORMAT = 'MM-dd-yyyy';
|
|
32
|
+
const MASK = '99-99-9999 - 99-99-9999';
|
|
32
33
|
const TIME_FORMAT = 'HH:mm ss:SS';
|
|
33
34
|
const FORMAT_STRING = `${DATE_FORMAT} ${TIME_FORMAT}`;
|
|
34
35
|
|
|
@@ -326,6 +327,7 @@ function DatetimeFilter(props) {
|
|
|
326
327
|
}
|
|
327
328
|
},
|
|
328
329
|
formatString: DATE_FORMAT,
|
|
330
|
+
mask: MASK,
|
|
329
331
|
placeholder: "MM-DD-YYYY - MM-DD-YYYY",
|
|
330
332
|
minDate: datesSorted[0],
|
|
331
333
|
maxDate: datesSorted[datesSorted.length - 1],
|
|
@@ -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) {
|
|
@@ -55,6 +55,7 @@ import { COLUMNS, DATETIME_OPERATIONS } from './constants.js';
|
|
|
55
55
|
import FilterShell from './filter-shell.js';
|
|
56
56
|
import { LocaleContext } from '../locale/index.js';
|
|
57
57
|
var DATE_FORMAT = 'MM-dd-yyyy';
|
|
58
|
+
var MASK = '99-99-9999 - 99-99-9999';
|
|
58
59
|
var TIME_FORMAT = 'HH:mm ss:SS';
|
|
59
60
|
var FORMAT_STRING = "".concat(DATE_FORMAT, " ").concat(TIME_FORMAT);
|
|
60
61
|
|
|
@@ -430,6 +431,7 @@ function DatetimeFilter(props) {
|
|
|
430
431
|
}
|
|
431
432
|
},
|
|
432
433
|
formatString: DATE_FORMAT,
|
|
434
|
+
mask: MASK,
|
|
433
435
|
placeholder: "MM-DD-YYYY - MM-DD-YYYY",
|
|
434
436
|
minDate: datesSorted[0],
|
|
435
437
|
maxDate: datesSorted[datesSorted.length - 1],
|
|
@@ -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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "baseui",
|
|
3
|
-
"version": "0.0.0-next-
|
|
3
|
+
"version": "0.0.0-next-6048bbf",
|
|
4
4
|
"description": "A React Component library implementing the Base design language",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -197,6 +197,7 @@
|
|
|
197
197
|
"glob": "^7.1.6",
|
|
198
198
|
"just-extend": "^4.0.2",
|
|
199
199
|
"memoize-one": "^5.1.1",
|
|
200
|
+
"mockdate": "^3.0.5",
|
|
200
201
|
"polished": "^3.2.0",
|
|
201
202
|
"popper.js": "^1.16.0",
|
|
202
203
|
"react-dropzone": "^9.0.0",
|
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>;
|