baseui 11.0.1 → 11.1.0
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/a11y/index.d.ts +1 -1
- package/accordion/index.d.ts +25 -28
- package/app-nav-bar/app-nav-bar.js +33 -40
- package/app-nav-bar/app-nav-bar.js.flow +46 -62
- package/app-nav-bar/index.d.ts +9 -8
- package/app-nav-bar/styled-components.js +49 -29
- package/app-nav-bar/styled-components.js.flow +25 -8
- package/app-nav-bar/types.js.flow +2 -0
- package/aspect-ratio-box/index.d.ts +2 -4
- package/avatar/index.d.ts +6 -12
- package/badge/badge.js +109 -0
- package/badge/badge.js.flow +91 -0
- package/badge/constants.js +54 -0
- package/badge/constants.js.flow +52 -0
- package/badge/hint-dot.js +96 -0
- package/badge/hint-dot.js.flow +68 -0
- package/badge/index.d.ts +97 -0
- package/badge/index.js +80 -0
- package/badge/index.js.flow +20 -0
- package/badge/notification-circle.js +103 -0
- package/badge/notification-circle.js.flow +81 -0
- package/badge/package.json +4 -0
- package/badge/styled-components.js +242 -0
- package/badge/styled-components.js.flow +325 -0
- package/badge/types.js +11 -0
- package/badge/types.js.flow +59 -0
- package/badge/utils.js +33 -0
- package/badge/utils.js.flow +23 -0
- package/banner/banner.js +283 -0
- package/banner/banner.js.flow +253 -0
- package/banner/constants.js +35 -0
- package/banner/constants.js.flow +33 -0
- package/banner/index.d.ts +75 -0
- package/banner/index.js +44 -0
- package/banner/index.js.flow +16 -0
- package/banner/package.json +4 -0
- package/banner/styled-components.js +131 -0
- package/banner/styled-components.js.flow +119 -0
- package/banner/types.js +11 -0
- package/banner/types.js.flow +66 -0
- package/block/index.d.ts +4 -4
- package/breadcrumbs/breadcrumbs.js +5 -1
- package/breadcrumbs/breadcrumbs.js.flow +2 -2
- package/breadcrumbs/index.d.ts +5 -5
- package/button/button.js +2 -1
- package/button/button.js.flow +1 -0
- package/button/index.d.ts +19 -29
- package/button-group/index.d.ts +18 -24
- package/card/index.d.ts +16 -14
- package/checkbox/index.d.ts +17 -21
- package/combobox/index.d.ts +7 -11
- package/data-table/index.d.ts +7 -10
- package/datepicker/calendar.js +16 -11
- package/datepicker/calendar.js.flow +12 -9
- package/datepicker/datepicker.js +58 -58
- package/datepicker/datepicker.js.flow +51 -34
- package/datepicker/index.d.ts +42 -63
- package/datepicker/stateful-calendar.js +6 -1
- package/datepicker/stateful-calendar.js.flow +8 -1
- package/datepicker/stateful-container.js +23 -2
- package/datepicker/stateful-container.js.flow +17 -4
- package/datepicker/stateful-datepicker.js +6 -1
- package/datepicker/stateful-datepicker.js.flow +7 -1
- package/datepicker/types.js.flow +21 -43
- package/datepicker/utils/date-helpers.js +1 -1
- package/datepicker/utils/date-helpers.js.flow +1 -1
- package/dnd-list/index.d.ts +22 -35
- package/drawer/index.d.ts +22 -27
- package/es/app-nav-bar/app-nav-bar.js +9 -19
- package/es/app-nav-bar/styled-components.js +32 -13
- package/es/badge/badge.js +70 -0
- package/es/badge/constants.js +42 -0
- package/es/badge/hint-dot.js +55 -0
- package/es/badge/index.js +11 -0
- package/es/badge/notification-circle.js +65 -0
- package/es/badge/styled-components.js +296 -0
- package/es/badge/types.js +8 -0
- package/es/badge/utils.js +17 -0
- package/es/banner/banner.js +213 -0
- package/es/banner/constants.js +24 -0
- package/es/banner/index.js +9 -0
- package/es/banner/styled-components.js +122 -0
- package/es/banner/types.js +8 -0
- package/es/breadcrumbs/breadcrumbs.js +5 -1
- package/es/button/button.js +1 -0
- package/es/datepicker/calendar.js +15 -10
- package/es/datepicker/datepicker.js +52 -52
- package/es/datepicker/stateful-calendar.js +6 -1
- package/es/datepicker/stateful-container.js +22 -2
- package/es/datepicker/stateful-datepicker.js +6 -1
- package/es/datepicker/utils/date-helpers.js +1 -1
- package/es/helper/helper-steps.js +3 -1
- package/es/input/base-input.js +18 -11
- package/es/input/input.js +15 -10
- package/es/input/masked-input.js +5 -2
- package/es/input/utils.js +4 -2
- package/es/locale/tr_TR.js +115 -0
- package/es/notification/notification.js +16 -1
- package/es/payment-card/custom-cards.config.js +22 -0
- package/es/payment-card/icons/uatp.js +52 -0
- package/es/payment-card/payment-card.js +8 -3
- package/es/popover/popover.js +2 -1
- package/es/popover/stateful-container.js +2 -0
- package/es/popover/styled-components.js +2 -1
- package/es/progress-steps/numbered-step.js +2 -2
- package/es/select/select-component.js +48 -23
- package/es/select/utils/default-filter-options.js +1 -1
- package/es/snackbar/snackbar-context.js +1 -1
- package/es/table-semantic/styled-components.js +14 -0
- package/es/table-semantic/table-builder.js +12 -5
- package/es/textarea/textarea.js +15 -9
- package/es/themes/dark-theme/color-component-tokens.js +8 -0
- package/es/themes/light-theme/color-component-tokens.js +8 -0
- package/es/tree-view/tree-label.js +9 -1
- package/esm/app-nav-bar/app-nav-bar.js +32 -38
- package/esm/app-nav-bar/styled-components.js +46 -28
- package/esm/badge/badge.js +97 -0
- package/esm/badge/constants.js +42 -0
- package/esm/badge/hint-dot.js +83 -0
- package/esm/badge/index.js +11 -0
- package/esm/badge/notification-circle.js +91 -0
- package/esm/badge/styled-components.js +235 -0
- package/esm/badge/types.js +8 -0
- package/esm/badge/utils.js +17 -0
- package/esm/banner/banner.js +271 -0
- package/esm/banner/constants.js +24 -0
- package/esm/banner/index.js +9 -0
- package/esm/banner/styled-components.js +113 -0
- package/esm/banner/types.js +8 -0
- package/esm/breadcrumbs/breadcrumbs.js +5 -1
- package/esm/button/button.js +2 -1
- package/esm/datepicker/calendar.js +16 -11
- package/esm/datepicker/datepicker.js +58 -58
- package/esm/datepicker/stateful-calendar.js +6 -1
- package/esm/datepicker/stateful-container.js +23 -2
- package/esm/datepicker/stateful-datepicker.js +6 -1
- package/esm/datepicker/utils/date-helpers.js +1 -1
- package/esm/helper/helper-steps.js +3 -1
- package/esm/input/base-input.js +18 -11
- package/esm/input/input.js +15 -10
- package/esm/input/masked-input.js +6 -3
- package/esm/input/utils.js +4 -2
- package/esm/locale/tr_TR.js +115 -0
- package/esm/notification/notification.js +17 -1
- package/esm/payment-card/custom-cards.config.js +22 -0
- package/esm/payment-card/icons/uatp.js +53 -0
- package/esm/payment-card/payment-card.js +9 -7
- package/esm/popover/popover.js +2 -1
- package/esm/popover/stateful-container.js +2 -0
- package/esm/popover/styled-components.js +3 -2
- package/esm/progress-steps/numbered-step.js +2 -2
- package/esm/select/select-component.js +85 -59
- package/esm/select/utils/default-filter-options.js +1 -1
- package/esm/snackbar/snackbar-context.js +1 -1
- package/esm/table-semantic/styled-components.js +31 -18
- package/esm/table-semantic/table-builder.js +34 -23
- package/esm/textarea/textarea.js +15 -9
- package/esm/themes/dark-theme/color-component-tokens.js +8 -0
- package/esm/themes/light-theme/color-component-tokens.js +8 -0
- package/esm/tree-view/tree-label.js +10 -2
- package/file-uploader/index.d.ts +11 -11
- package/flex-grid/index.d.ts +3 -3
- package/form-control/index.d.ts +7 -19
- package/header-navigation/index.d.ts +8 -9
- package/heading/index.d.ts +3 -4
- package/helper/helper-steps.js +19 -13
- package/helper/helper-steps.js.flow +3 -1
- package/helper/index.d.ts +7 -7
- package/helpers/base-provider.d.ts +16 -0
- package/helpers/overrides.d.ts +23 -0
- package/icon/index.d.ts +32 -32
- package/index.d.ts +34 -114
- package/input/base-input.js +18 -11
- package/input/base-input.js.flow +18 -6
- package/input/index.d.ts +29 -32
- package/input/input.js +15 -10
- package/input/input.js.flow +10 -5
- package/input/masked-input.js +6 -3
- package/input/masked-input.js.flow +3 -0
- package/input/types.js.flow +4 -0
- package/input/utils.js +4 -2
- package/input/utils.js.flow +2 -1
- package/layer/index.d.ts +6 -11
- package/layout-grid/index.d.ts +25 -7
- package/link/index.d.ts +2 -2
- package/list/index.d.ts +26 -31
- package/{locale.ts → locale/index.d.ts} +8 -0
- package/locale/tr_TR.js +123 -0
- package/locale/tr_TR.js.flow +124 -0
- package/map-marker/index.d.ts +41 -47
- package/menu/index.d.ts +27 -37
- package/modal/index.d.ts +28 -38
- package/notification/index.d.ts +2 -3
- package/notification/notification.js +18 -1
- package/notification/notification.js.flow +15 -1
- package/overrides.ts +2 -22
- package/package.json +26 -17
- package/pagination/index.d.ts +22 -26
- package/payment-card/custom-cards.config.js +30 -0
- package/payment-card/custom-cards.config.js.flow +29 -0
- package/payment-card/icons/uatp.js +67 -0
- package/payment-card/icons/uatp.js.flow +62 -0
- package/payment-card/index.d.ts +8 -8
- package/payment-card/payment-card.js +12 -7
- package/payment-card/payment-card.js.flow +12 -0
- package/phone-input/index.d.ts +261 -269
- package/pin-code/index.d.ts +11 -18
- package/popover/index.d.ts +39 -55
- package/popover/popover.js +2 -1
- package/popover/popover.js.flow +2 -1
- package/popover/stateful-container.js +2 -0
- package/popover/stateful-container.js.flow +2 -0
- package/popover/styled-components.js +3 -2
- package/popover/styled-components.js.flow +2 -1
- package/popover/types.js.flow +1 -0
- package/progress-bar/index.d.ts +11 -12
- package/progress-steps/index.d.ts +16 -16
- package/progress-steps/numbered-step.js.flow +2 -2
- package/radio/index.d.ts +12 -15
- package/rating/index.d.ts +9 -12
- package/select/index.d.ts +34 -36
- package/select/select-component.js +82 -56
- package/select/select-component.js.flow +46 -34
- package/select/types.js.flow +1 -0
- package/select/utils/default-filter-options.js +1 -1
- package/select/utils/default-filter-options.js.flow +1 -1
- package/side-navigation/index.d.ts +11 -13
- package/skeleton/index.d.ts +1 -1
- package/slider/index.d.ts +17 -26
- package/snackbar/index.d.ts +8 -8
- package/snackbar/snackbar-context.js +1 -1
- package/snackbar/snackbar-context.js.flow +1 -1
- package/spinner/index.d.ts +4 -3
- package/styles/index.d.ts +82 -2
- package/table/index.d.ts +16 -16
- package/table-grid/index.d.ts +6 -8
- package/table-semantic/index.d.ts +26 -32
- package/table-semantic/styled-components.js +33 -19
- package/table-semantic/styled-components.js.flow +12 -0
- package/table-semantic/table-builder.js +38 -22
- package/table-semantic/table-builder.js.flow +32 -17
- package/table-semantic/types.js.flow +1 -0
- package/tabs/index.d.ts +20 -23
- package/tabs-motion/index.d.ts +23 -23
- package/tag/index.d.ts +14 -18
- package/tag/types.js.flow +1 -1
- package/textarea/index.d.ts +11 -14
- package/textarea/textarea.js +15 -9
- package/textarea/textarea.js.flow +11 -5
- package/textarea/types.js.flow +1 -0
- package/theme.ts +36 -777
- package/themes/dark-theme/color-component-tokens.js +8 -0
- package/themes/dark-theme/color-component-tokens.js.flow +9 -0
- package/themes/index.d.ts +765 -0
- package/themes/light-theme/color-component-tokens.js +8 -0
- package/themes/light-theme/color-component-tokens.js.flow +9 -0
- package/themes/types.js.flow +9 -0
- package/timepicker/index.d.ts +5 -8
- package/timezonepicker/index.d.ts +5 -8
- package/toast/index.d.ts +26 -40
- package/tokens/index.d.ts +1 -1
- package/tooltip/index.d.ts +7 -9
- package/tree-view/index.d.ts +15 -19
- package/tree-view/tree-label.js +10 -2
- package/tree-view/tree-label.js.flow +4 -4
- package/typography/index.d.ts +37 -37
package/card/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {StyletronComponent} from 'styletron-react';
|
|
3
|
-
import {Override} from '../overrides';
|
|
2
|
+
import { StyletronComponent } from 'styletron-react';
|
|
3
|
+
import { Override } from '../overrides';
|
|
4
4
|
|
|
5
5
|
export interface CardOverrides {
|
|
6
6
|
Action?: Override<any>;
|
|
@@ -14,20 +14,22 @@ export interface CardOverrides {
|
|
|
14
14
|
export interface CardProps {
|
|
15
15
|
readonly action?: React.ReactNode;
|
|
16
16
|
readonly children?: React.ReactNode;
|
|
17
|
-
readonly hasThumbnail?: (props: {readonly thumbnail?: string}) => boolean;
|
|
18
|
-
readonly headerImage?:
|
|
17
|
+
readonly hasThumbnail?: (props: { readonly thumbnail?: string }) => boolean;
|
|
18
|
+
readonly headerImage?:
|
|
19
|
+
| string
|
|
20
|
+
| React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;
|
|
19
21
|
readonly overrides?: CardOverrides;
|
|
20
22
|
readonly thumbnail?: string;
|
|
21
23
|
readonly title?: React.ReactNode;
|
|
22
24
|
}
|
|
23
|
-
export const Card: React.FC<CardProps>;
|
|
24
|
-
export type hasThumbnail = (props: {readonly thumbnail?: string}) => boolean;
|
|
25
|
+
export declare const Card: React.FC<CardProps>;
|
|
26
|
+
export type hasThumbnail = (props: { readonly thumbnail?: string }) => boolean;
|
|
25
27
|
|
|
26
|
-
export const StyledAction: StyletronComponent<any>;
|
|
27
|
-
export const StyledBody: StyletronComponent<any>;
|
|
28
|
-
export const StyledContents: StyletronComponent<any>;
|
|
29
|
-
export const StyledHeaderImage: StyletronComponent<any>;
|
|
30
|
-
export const StyledThumbnail: StyletronComponent<any>;
|
|
31
|
-
export const StyledTitle: StyletronComponent<any>;
|
|
32
|
-
export const StyledRoot: StyletronComponent<any>;
|
|
33
|
-
export const StyledWrapper: StyletronComponent<any>;
|
|
28
|
+
export declare const StyledAction: StyletronComponent<any>;
|
|
29
|
+
export declare const StyledBody: StyletronComponent<any>;
|
|
30
|
+
export declare const StyledContents: StyletronComponent<any>;
|
|
31
|
+
export declare const StyledHeaderImage: StyletronComponent<any>;
|
|
32
|
+
export declare const StyledThumbnail: StyletronComponent<any>;
|
|
33
|
+
export declare const StyledTitle: StyletronComponent<any>;
|
|
34
|
+
export declare const StyledRoot: StyletronComponent<any>;
|
|
35
|
+
export declare const StyledWrapper: StyletronComponent<any>;
|
package/checkbox/index.d.ts
CHANGED
|
@@ -2,34 +2,34 @@ import * as React from 'react';
|
|
|
2
2
|
import { StyletronComponent } from 'styletron-react';
|
|
3
3
|
import { Override } from '../overrides';
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export declare const STATE_TYPE: {
|
|
6
6
|
change: 'CHANGE';
|
|
7
|
-
}
|
|
8
|
-
export
|
|
7
|
+
};
|
|
8
|
+
export declare const STYLE_TYPE: {
|
|
9
9
|
default: 'default';
|
|
10
10
|
toggle: 'toggle';
|
|
11
11
|
toggle_round: 'toggle';
|
|
12
|
-
}
|
|
12
|
+
};
|
|
13
13
|
|
|
14
|
-
export
|
|
14
|
+
export declare const LABEL_PLACEMENT: {
|
|
15
15
|
top: 'top';
|
|
16
16
|
right: 'right';
|
|
17
17
|
bottom: 'bottom';
|
|
18
18
|
left: 'left';
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
|
|
21
21
|
type initialState = {
|
|
22
22
|
checked?: boolean;
|
|
23
23
|
isIndeterminate?: boolean;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
export const StyledRoot: StyletronComponent<any>;
|
|
27
|
-
export const StyledCheckmark: StyletronComponent<any>;
|
|
28
|
-
export const StyledLabel: StyletronComponent<any>;
|
|
29
|
-
export const StyledInput: StyletronComponent<any>;
|
|
30
|
-
export const StyledToggle: StyletronComponent<any>;
|
|
31
|
-
export const StyledToggleInner: StyletronComponent<any>;
|
|
32
|
-
export const StyledToggleTrack: StyletronComponent<any>;
|
|
26
|
+
export declare const StyledRoot: StyletronComponent<any>;
|
|
27
|
+
export declare const StyledCheckmark: StyletronComponent<any>;
|
|
28
|
+
export declare const StyledLabel: StyletronComponent<any>;
|
|
29
|
+
export declare const StyledInput: StyletronComponent<any>;
|
|
30
|
+
export declare const StyledToggle: StyletronComponent<any>;
|
|
31
|
+
export declare const StyledToggleInner: StyletronComponent<any>;
|
|
32
|
+
export declare const StyledToggleTrack: StyletronComponent<any>;
|
|
33
33
|
|
|
34
34
|
export type StateReducer = (
|
|
35
35
|
stateType: string,
|
|
@@ -51,7 +51,7 @@ export interface StatefulContainerProps {
|
|
|
51
51
|
autoFocus?: boolean;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export const StatefulContainer: React.FC<StatefulContainerProps>;
|
|
54
|
+
export declare const StatefulContainer: React.FC<StatefulContainerProps>;
|
|
55
55
|
|
|
56
56
|
export interface StatefulCheckboxProps {
|
|
57
57
|
overrides?: CheckboxOverrides;
|
|
@@ -64,7 +64,7 @@ export interface StatefulCheckboxProps {
|
|
|
64
64
|
children?: React.ReactNode;
|
|
65
65
|
initialState?: initialState;
|
|
66
66
|
autoFocus?: boolean;
|
|
67
|
-
checkmarkType?: STYLE_TYPE[keyof STYLE_TYPE];
|
|
67
|
+
checkmarkType?: typeof STYLE_TYPE[keyof typeof STYLE_TYPE];
|
|
68
68
|
onChange?: React.FormEventHandler<HTMLInputElement>;
|
|
69
69
|
onMouseEnter?: React.MouseEventHandler<HTMLInputElement>;
|
|
70
70
|
onMouseLeave?: React.MouseEventHandler<HTMLInputElement>;
|
|
@@ -72,7 +72,7 @@ export interface StatefulCheckboxProps {
|
|
|
72
72
|
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
export const StatefulCheckbox: React.FC<StatefulCheckboxProps>;
|
|
75
|
+
export declare const StatefulCheckbox: React.FC<StatefulCheckboxProps>;
|
|
76
76
|
|
|
77
77
|
export interface CheckboxOverrides {
|
|
78
78
|
Checkmark?: Override<any>;
|
|
@@ -101,7 +101,7 @@ export interface CheckboxProps {
|
|
|
101
101
|
value?: string;
|
|
102
102
|
isIndeterminate?: boolean;
|
|
103
103
|
labelPlacement?: 'top' | 'right' | 'bottom' | 'left';
|
|
104
|
-
checkmarkType?: STYLE_TYPE[keyof STYLE_TYPE];
|
|
104
|
+
checkmarkType?: typeof STYLE_TYPE[keyof typeof STYLE_TYPE];
|
|
105
105
|
title?: string;
|
|
106
106
|
ariaLabel?: string;
|
|
107
107
|
'aria-label'?: string;
|
|
@@ -128,7 +128,3 @@ export class Checkbox extends React.Component<CheckboxProps, CheckboxState> {
|
|
|
128
128
|
onFocus(event: React.FocusEvent<HTMLInputElement>): void;
|
|
129
129
|
onBlur(event: React.FocusEvent<HTMLInputElement>): void;
|
|
130
130
|
}
|
|
131
|
-
|
|
132
|
-
export const STATE_TYPE: STATE_TYPE;
|
|
133
|
-
export const STYLE_TYPE: STYLE_TYPE;
|
|
134
|
-
export const LABEL_PLACEMENT: LABEL_PLACEMENT;
|
package/combobox/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {Override} from '../overrides';
|
|
2
|
+
import { Override } from '../overrides';
|
|
3
3
|
|
|
4
|
-
export
|
|
4
|
+
export declare const SIZE: {
|
|
5
5
|
compact: 'compact';
|
|
6
6
|
default: 'default';
|
|
7
7
|
large: 'large';
|
|
8
8
|
mini: 'mini';
|
|
9
|
-
}
|
|
9
|
+
};
|
|
10
10
|
|
|
11
11
|
export interface ComboboxOverrides {
|
|
12
12
|
Root?: Override<any>;
|
|
@@ -20,10 +20,7 @@ export interface ComboboxOverrides {
|
|
|
20
20
|
export type PropsT<OptionT = any> = {
|
|
21
21
|
autocomplete?: boolean;
|
|
22
22
|
disabled?: boolean;
|
|
23
|
-
mapOptionToNode?: (option: {
|
|
24
|
-
isSelected: boolean;
|
|
25
|
-
option: OptionT;
|
|
26
|
-
}) => React.ReactNode;
|
|
23
|
+
mapOptionToNode?: (option: { isSelected: boolean; option: OptionT }) => React.ReactNode;
|
|
27
24
|
mapOptionToString: (option: OptionT) => string;
|
|
28
25
|
id?: string;
|
|
29
26
|
name?: string;
|
|
@@ -31,12 +28,11 @@ export type PropsT<OptionT = any> = {
|
|
|
31
28
|
onBlur?: (event: React.FocusEvent<HTMLInputElement>) => any;
|
|
32
29
|
onChange?: (value: string, option: OptionT | null) => any;
|
|
33
30
|
onFocus?: (event: React.FocusEvent<HTMLInputElement>) => any;
|
|
34
|
-
onSubmit?: (params: {closeListbox: () => void; value: string}) => any;
|
|
31
|
+
onSubmit?: (params: { closeListbox: () => void; value: string }) => any;
|
|
35
32
|
options: OptionT[];
|
|
36
33
|
overrides?: ComboboxOverrides;
|
|
37
|
-
size?: SIZE[keyof SIZE];
|
|
34
|
+
size?: typeof SIZE[keyof typeof SIZE];
|
|
38
35
|
value: string;
|
|
39
36
|
};
|
|
40
37
|
|
|
41
|
-
export const Combobox: React.FC<PropsT>;
|
|
42
|
-
export const SIZE: SIZE;
|
|
38
|
+
export declare const Combobox: React.FC<PropsT>;
|
package/data-table/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export function CustomColumn<ValueT, FilterParamsT>(options: any): any;
|
|
|
10
10
|
export function NumericalColumn(options: any): any;
|
|
11
11
|
export function StringColumn(options: any): any;
|
|
12
12
|
|
|
13
|
-
export
|
|
13
|
+
export declare const COLUMNS: {
|
|
14
14
|
ANCHOR: 'ANCHOR';
|
|
15
15
|
CATEGORICAL: 'CATEGORICAL';
|
|
16
16
|
DATETIME: 'DATETIME';
|
|
@@ -18,23 +18,20 @@ export interface COLUMNS {
|
|
|
18
18
|
BOOLEAN: 'BOOLEAN';
|
|
19
19
|
STRING: 'STRING';
|
|
20
20
|
CUSTOM: 'CUSTOM';
|
|
21
|
-
}
|
|
22
|
-
export const COLUMNS: COLUMNS;
|
|
21
|
+
};
|
|
23
22
|
|
|
24
|
-
export
|
|
23
|
+
export declare const NUMERICAL_FORMATS: {
|
|
25
24
|
DEFAULT: 'DEFAULT';
|
|
26
25
|
ACCOUNTING: 'ACCOUNTING';
|
|
27
26
|
PERCENTAGE: 'PERCENTAGE';
|
|
28
|
-
}
|
|
29
|
-
export const NUMERICAL_FORMATS: NUMERICAL_FORMATS;
|
|
27
|
+
};
|
|
30
28
|
|
|
31
|
-
export
|
|
29
|
+
export declare const SORT_DIRECTIONS: {
|
|
32
30
|
ASC: 'ASC';
|
|
33
31
|
DESC: 'DESC';
|
|
34
|
-
}
|
|
35
|
-
export const SORT_DIRECTIONS: SORT_DIRECTIONS;
|
|
32
|
+
};
|
|
36
33
|
|
|
37
|
-
export type SortDirectionsT = SORT_DIRECTIONS[
|
|
34
|
+
export type SortDirectionsT = typeof SORT_DIRECTIONS[keyof typeof SORT_DIRECTIONS] | null;
|
|
38
35
|
export type ColumnT = any;
|
|
39
36
|
export type RowT = {
|
|
40
37
|
id: number | string;
|
package/datepicker/calendar.js
CHANGED
|
@@ -333,12 +333,12 @@ var Calendar = /*#__PURE__*/function (_React$Component) {
|
|
|
333
333
|
_defineProperty(_assertThisInitialized(_this), "handleDateChange", function (data) {
|
|
334
334
|
var _this$props$onChange = _this.props.onChange,
|
|
335
335
|
onChange = _this$props$onChange === void 0 ? function (params) {} : _this$props$onChange;
|
|
336
|
-
var updatedDate = data.date; //
|
|
337
|
-
|
|
338
|
-
var newTimeState = _toConsumableArray(_this.state.time); // Apply the currently selected time values (saved in state) to the updated date
|
|
339
|
-
|
|
336
|
+
var updatedDate = data.date; // Apply the currently selected time values (saved in state) to the updated date
|
|
340
337
|
|
|
341
338
|
if (Array.isArray(data.date)) {
|
|
339
|
+
// We'll need to update the date in time values of internal state
|
|
340
|
+
var newTimeState = _toConsumableArray(_this.state.time);
|
|
341
|
+
|
|
342
342
|
var start = data.date[0] ? _this.dateHelpers.applyDateToTime(newTimeState[0], data.date[0]) : null;
|
|
343
343
|
var end = data.date[1] ? _this.dateHelpers.applyDateToTime(newTimeState[1], data.date[1]) : null;
|
|
344
344
|
newTimeState[0] = start;
|
|
@@ -348,16 +348,21 @@ var Calendar = /*#__PURE__*/function (_React$Component) {
|
|
|
348
348
|
newTimeState[1] = end;
|
|
349
349
|
} else {
|
|
350
350
|
updatedDate = [start];
|
|
351
|
-
}
|
|
351
|
+
} // Update the date in time values of internal state
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
_this.setState({
|
|
355
|
+
time: newTimeState
|
|
356
|
+
});
|
|
352
357
|
} else if (!Array.isArray(_this.props.value) && data.date) {
|
|
353
|
-
|
|
354
|
-
updatedDate = newTimeState[0];
|
|
355
|
-
} // Update the date in time values of internal state
|
|
358
|
+
var _newTimeState = _this.dateHelpers.applyDateToTime(_this.state.time[0], data.date);
|
|
356
359
|
|
|
360
|
+
updatedDate = _newTimeState; // Update the date in time values of internal state
|
|
357
361
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
362
|
+
_this.setState({
|
|
363
|
+
time: [_newTimeState]
|
|
364
|
+
});
|
|
365
|
+
}
|
|
361
366
|
|
|
362
367
|
onChange({
|
|
363
368
|
date: updatedDate
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
import dateFnsAdapter from './utils/date-fns-adapter.js';
|
|
23
23
|
import DateHelpers from './utils/date-helpers.js';
|
|
24
24
|
import { getOverrides, mergeOverrides } from '../helpers/overrides.js';
|
|
25
|
-
import type { CalendarPropsT, CalendarInternalState
|
|
25
|
+
import type { CalendarPropsT, CalendarInternalState } from './types.js';
|
|
26
26
|
import { DENSITY, ORIENTATION } from './constants.js';
|
|
27
27
|
|
|
28
28
|
export default class Calendar<T = Date> extends React.Component<
|
|
@@ -134,7 +134,7 @@ export default class Calendar<T = Date> extends React.Component<
|
|
|
134
134
|
return monthDelta >= 0 && monthDelta < (this.props.monthsShown || 1);
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
getSingleDate(value:
|
|
137
|
+
getSingleDate(value: ?T | $ReadOnlyArray<?T>): ?T {
|
|
138
138
|
// need to check this.props.range but flow would complain
|
|
139
139
|
// at the return value in the else clause
|
|
140
140
|
if (Array.isArray(value)) {
|
|
@@ -339,13 +339,13 @@ export default class Calendar<T = Date> extends React.Component<
|
|
|
339
339
|
|
|
340
340
|
/** Responsible for merging time values into date values. Note: the 'Day' component
|
|
341
341
|
* determines how the days themselves change when a new day is selected. */
|
|
342
|
-
handleDateChange: ({ date:
|
|
342
|
+
handleDateChange: ({ +date: ?T | Array<?T> }) => void = (data) => {
|
|
343
343
|
const { onChange = (params) => {} } = this.props;
|
|
344
344
|
let updatedDate = data.date;
|
|
345
|
-
// We'll need to update the date in time values of internal state
|
|
346
|
-
const newTimeState = [...this.state.time];
|
|
347
345
|
// Apply the currently selected time values (saved in state) to the updated date
|
|
348
346
|
if (Array.isArray(data.date)) {
|
|
347
|
+
// We'll need to update the date in time values of internal state
|
|
348
|
+
const newTimeState = [...this.state.time];
|
|
349
349
|
const start = data.date[0]
|
|
350
350
|
? this.dateHelpers.applyDateToTime(newTimeState[0], data.date[0])
|
|
351
351
|
: null;
|
|
@@ -359,13 +359,16 @@ export default class Calendar<T = Date> extends React.Component<
|
|
|
359
359
|
} else {
|
|
360
360
|
updatedDate = [start];
|
|
361
361
|
}
|
|
362
|
+
// Update the date in time values of internal state
|
|
363
|
+
this.setState({ time: newTimeState });
|
|
362
364
|
} else if (!Array.isArray(this.props.value) && data.date) {
|
|
363
|
-
newTimeState
|
|
364
|
-
updatedDate = newTimeState
|
|
365
|
+
const newTimeState = this.dateHelpers.applyDateToTime(this.state.time[0], data.date);
|
|
366
|
+
updatedDate = newTimeState;
|
|
367
|
+
|
|
368
|
+
// Update the date in time values of internal state
|
|
369
|
+
this.setState({ time: [newTimeState] });
|
|
365
370
|
}
|
|
366
371
|
|
|
367
|
-
// Update the date in time values of internal state
|
|
368
|
-
this.setState({ time: newTimeState });
|
|
369
372
|
onChange({ date: updatedDate });
|
|
370
373
|
};
|
|
371
374
|
|
package/datepicker/datepicker.js
CHANGED
|
@@ -37,6 +37,10 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
37
37
|
|
|
38
38
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
39
39
|
|
|
40
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
41
|
+
|
|
42
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
43
|
+
|
|
40
44
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
41
45
|
|
|
42
46
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -45,10 +49,6 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.it
|
|
|
45
49
|
|
|
46
50
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
47
51
|
|
|
48
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
49
|
-
|
|
50
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
51
|
-
|
|
52
52
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
53
53
|
|
|
54
54
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
@@ -126,7 +126,39 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
|
|
|
126
126
|
|
|
127
127
|
_defineProperty(_assertThisInitialized(_this), "dateHelpers", void 0);
|
|
128
128
|
|
|
129
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
129
|
+
_defineProperty(_assertThisInitialized(_this), "handleChange", function (date) {
|
|
130
|
+
var onChange = _this.props.onChange;
|
|
131
|
+
var onRangeChange = _this.props.onRangeChange;
|
|
132
|
+
|
|
133
|
+
if (Array.isArray(date)) {
|
|
134
|
+
if (onChange && date.every(Boolean)) {
|
|
135
|
+
// flowlint-next-line unclear-type:off
|
|
136
|
+
onChange({
|
|
137
|
+
date: date
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (onRangeChange) {
|
|
142
|
+
onRangeChange({
|
|
143
|
+
date: _toConsumableArray(date)
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
} else {
|
|
147
|
+
if (onChange) {
|
|
148
|
+
onChange({
|
|
149
|
+
date: date
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (onRangeChange) {
|
|
154
|
+
onRangeChange({
|
|
155
|
+
date: date
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
_defineProperty(_assertThisInitialized(_this), "onCalendarSelect", function (data) {
|
|
130
162
|
var isOpen = false;
|
|
131
163
|
var isPseudoFocused = false;
|
|
132
164
|
var calendarFocused = false;
|
|
@@ -203,9 +235,7 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
|
|
|
203
235
|
inputValue: _this.formatDisplayValue(nextDate)
|
|
204
236
|
}));
|
|
205
237
|
|
|
206
|
-
_this.
|
|
207
|
-
date: nextDate
|
|
208
|
-
});
|
|
238
|
+
_this.handleChange(nextDate);
|
|
209
239
|
});
|
|
210
240
|
|
|
211
241
|
_defineProperty(_assertThisInitialized(_this), "formatDisplayValue", function (date) {
|
|
@@ -309,16 +339,10 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
|
|
|
309
339
|
var formatString = _this.normalizeDashes(_this.props.formatString);
|
|
310
340
|
|
|
311
341
|
if (typeof mask === 'string' && inputValue === mask.replace(/9/g, ' ') || inputValue.length === 0) {
|
|
312
|
-
if (_this.props.
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
});
|
|
317
|
-
} else {
|
|
318
|
-
_this.props.onChange({
|
|
319
|
-
date: null
|
|
320
|
-
});
|
|
321
|
-
}
|
|
342
|
+
if (_this.props.range) {
|
|
343
|
+
_this.handleChange([]);
|
|
344
|
+
} else {
|
|
345
|
+
_this.handleChange(null);
|
|
322
346
|
}
|
|
323
347
|
}
|
|
324
348
|
|
|
@@ -349,19 +373,13 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
|
|
|
349
373
|
endDate = parseDateString(right);
|
|
350
374
|
}
|
|
351
375
|
|
|
352
|
-
var
|
|
353
|
-
|
|
354
|
-
if (onChange) {
|
|
355
|
-
var datesValid = _this.dateHelpers.isValid(startDate) && _this.dateHelpers.isValid(endDate); // added equal case so that times within the same day can be expressed
|
|
376
|
+
var datesValid = _this.dateHelpers.isValid(startDate) && _this.dateHelpers.isValid(endDate); // added equal case so that times within the same day can be expressed
|
|
356
377
|
|
|
357
378
|
|
|
358
|
-
|
|
379
|
+
var rangeValid = _this.dateHelpers.isAfter(endDate, startDate) || _this.dateHelpers.isEqual(startDate, endDate);
|
|
359
380
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
date: [startDate, endDate]
|
|
363
|
-
});
|
|
364
|
-
}
|
|
381
|
+
if (datesValid && rangeValid) {
|
|
382
|
+
_this.handleChange([startDate, endDate]);
|
|
365
383
|
}
|
|
366
384
|
} else {
|
|
367
385
|
var dateString = _this.normalizeDashes(inputValue);
|
|
@@ -379,11 +397,10 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
|
|
|
379
397
|
|
|
380
398
|
var _this$props3 = _this.props,
|
|
381
399
|
displayValueAtRangeIndex = _this$props3.displayValueAtRangeIndex,
|
|
382
|
-
_onChange = _this$props3.onChange,
|
|
383
400
|
range = _this$props3.range,
|
|
384
401
|
value = _this$props3.value;
|
|
385
402
|
|
|
386
|
-
if (date && _this.dateHelpers.isValid(date)
|
|
403
|
+
if (date && _this.dateHelpers.isValid(date)) {
|
|
387
404
|
if (range && Array.isArray(value) && typeof displayValueAtRangeIndex === 'number') {
|
|
388
405
|
var _value = _slicedToArray(value, 2),
|
|
389
406
|
_left = _value[0],
|
|
@@ -393,22 +410,16 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
|
|
|
393
410
|
_left = date;
|
|
394
411
|
|
|
395
412
|
if (!_right) {
|
|
396
|
-
|
|
397
|
-
date: [_left]
|
|
398
|
-
});
|
|
413
|
+
_this.handleChange([_left]);
|
|
399
414
|
} else {
|
|
400
415
|
if (_this.dateHelpers.isAfter(_right, _left) || _this.dateHelpers.isEqual(_left, _right)) {
|
|
401
|
-
|
|
402
|
-
date: [_left, _right]
|
|
403
|
-
});
|
|
416
|
+
_this.handleChange([_left, _right]);
|
|
404
417
|
} else {
|
|
405
418
|
// Is resetting back to previous value appropriate? Invalid range is not
|
|
406
419
|
// communicated to the user, but if it was not reset the text value would
|
|
407
420
|
// show one value and date value another. This seems a bit better but clearly
|
|
408
421
|
// has a downside.
|
|
409
|
-
|
|
410
|
-
date: _toConsumableArray(value)
|
|
411
|
-
});
|
|
422
|
+
_this.handleChange(_toConsumableArray(value));
|
|
412
423
|
}
|
|
413
424
|
}
|
|
414
425
|
} else if (displayValueAtRangeIndex === 1) {
|
|
@@ -416,26 +427,18 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
|
|
|
416
427
|
|
|
417
428
|
if (!_left) {
|
|
418
429
|
// If start value is not defined, set start/end to the same day.
|
|
419
|
-
|
|
420
|
-
date: [_right, _right]
|
|
421
|
-
});
|
|
430
|
+
_this.handleChange([_right, _right]);
|
|
422
431
|
} else {
|
|
423
432
|
if (_this.dateHelpers.isAfter(_right, _left) || _this.dateHelpers.isEqual(_left, _right)) {
|
|
424
|
-
|
|
425
|
-
date: [_left, _right]
|
|
426
|
-
});
|
|
433
|
+
_this.handleChange([_left, _right]);
|
|
427
434
|
} else {
|
|
428
435
|
// See comment above about resetting dates on invalid range
|
|
429
|
-
|
|
430
|
-
date: _toConsumableArray(value)
|
|
431
|
-
});
|
|
436
|
+
_this.handleChange(_toConsumableArray(value));
|
|
432
437
|
}
|
|
433
438
|
}
|
|
434
439
|
}
|
|
435
440
|
} else {
|
|
436
|
-
|
|
437
|
-
date: date
|
|
438
|
-
});
|
|
441
|
+
_this.handleChange(date);
|
|
439
442
|
}
|
|
440
443
|
}
|
|
441
444
|
}
|
|
@@ -552,11 +555,6 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
|
|
|
552
555
|
endDate = _split2$2 === void 0 ? '' : _split2$2;
|
|
553
556
|
|
|
554
557
|
var value = inputRole === _constants.INPUT_ROLE.startDate ? startDate : inputRole === _constants.INPUT_ROLE.endDate ? endDate : this.state.inputValue;
|
|
555
|
-
|
|
556
|
-
var onChange = function onChange(event) {
|
|
557
|
-
return _this3.handleInputChange(event, inputRole);
|
|
558
|
-
};
|
|
559
|
-
|
|
560
558
|
return /*#__PURE__*/React.createElement(InputComponent, _extends({
|
|
561
559
|
"aria-disabled": this.props.disabled,
|
|
562
560
|
"aria-label": this.props['aria-label'] || (this.props.range ? locale.datepicker.ariaLabelRange : locale.datepicker.ariaLabel),
|
|
@@ -573,7 +571,9 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
|
|
|
573
571
|
},
|
|
574
572
|
onBlur: this.handleInputBlur,
|
|
575
573
|
onKeyDown: this.handleKeyDown,
|
|
576
|
-
onChange: onChange
|
|
574
|
+
onChange: function onChange(event) {
|
|
575
|
+
return _this3.handleInputChange(event, inputRole);
|
|
576
|
+
},
|
|
577
577
|
placeholder: placeholder,
|
|
578
578
|
mask: this.getMask(),
|
|
579
579
|
required: this.props.required,
|
|
@@ -633,7 +633,7 @@ var Datepicker = /*#__PURE__*/function (_React$Component) {
|
|
|
633
633
|
trapTabbing: true,
|
|
634
634
|
value: _this4.props.value
|
|
635
635
|
}, _this4.props, {
|
|
636
|
-
onChange: _this4.
|
|
636
|
+
onChange: _this4.onCalendarSelect,
|
|
637
637
|
selectedInput: _this4.state.selectedInput,
|
|
638
638
|
hasLockedBehavior: _this4.hasLockedBehavior()
|
|
639
639
|
}))
|