amis 1.9.0 → 1.9.1-beta.3
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/RootRenderer.js +10 -2
- package/lib/RootRenderer.js.map +2 -2
- package/lib/Schema.d.ts +3 -2
- package/lib/Schema.js.map +1 -1
- package/lib/actions/Action.d.ts +1 -0
- package/lib/actions/Action.js +7 -6
- package/lib/actions/Action.js.map +2 -2
- package/lib/components/Button.d.ts +11 -10
- package/lib/components/Button.js +2 -2
- package/lib/components/Button.js.map +2 -2
- package/lib/components/CalendarMobile.d.ts +40 -40
- package/lib/components/Checkbox.js +1 -1
- package/lib/components/Checkbox.js.map +2 -2
- package/lib/components/ContextMenu.d.ts +4 -0
- package/lib/components/ContextMenu.js +23 -7
- package/lib/components/ContextMenu.js.map +2 -2
- package/lib/components/DatePicker.d.ts +40 -40
- package/lib/components/DateRangePicker.d.ts +40 -40
- package/lib/components/Form.d.ts +22 -0
- package/lib/components/Form.js +44 -0
- package/lib/components/Form.js.map +13 -0
- package/lib/components/FormField.d.ts +65 -0
- package/lib/components/FormField.js +48 -0
- package/lib/components/FormField.js.map +13 -0
- package/lib/components/InputBox.d.ts +10 -10
- package/lib/components/InputBox.js +4 -3
- package/lib/components/InputBox.js.map +2 -2
- package/lib/components/InputBoxWithSuggestion.d.ts +280 -0
- package/lib/components/InputBoxWithSuggestion.js +65 -0
- package/lib/components/InputBoxWithSuggestion.js.map +13 -0
- package/lib/components/ListGroup.d.ts +10 -10
- package/lib/components/PickerContainer.d.ts +4 -2
- package/lib/components/PickerContainer.js +28 -5
- package/lib/components/PickerContainer.js.map +2 -2
- package/lib/components/Radios.d.ts +10 -10
- package/lib/components/ResultBox.d.ts +40 -40
- package/lib/components/Select.d.ts +195 -202
- package/lib/components/Select.js +7 -3
- package/lib/components/Select.js.map +2 -2
- package/lib/components/Textarea.d.ts +568 -2
- package/lib/components/Textarea.js +129 -1
- package/lib/components/Textarea.js.map +2 -2
- package/lib/components/Toast.js +11 -9
- package/lib/components/Toast.js.map +2 -2
- package/lib/components/UserSelect.d.ts +500 -0
- package/lib/components/UserSelect.js +559 -0
- package/lib/components/UserSelect.js.map +13 -0
- package/lib/components/UserTabSelect.d.ts +320 -0
- package/lib/components/UserTabSelect.js +163 -0
- package/lib/components/UserTabSelect.js.map +13 -0
- package/lib/components/WithRemoteConfig.d.ts +7 -0
- package/lib/components/WithRemoteConfig.js +17 -11
- package/lib/components/WithRemoteConfig.js.map +2 -2
- package/lib/components/calendar/DaysView.d.ts +26 -1
- package/lib/components/calendar/DaysView.js +60 -19
- package/lib/components/calendar/DaysView.js.map +2 -2
- package/lib/components/calendar/TimeView.d.ts +1 -1
- package/lib/components/calendar/TimeView.js +10 -3
- package/lib/components/calendar/TimeView.js.map +2 -2
- package/lib/components/formula/Picker.js +4 -4
- package/lib/components/formula/Picker.js.map +2 -2
- package/lib/components/icons.d.ts +7 -1
- package/lib/components/icons.js +17 -1
- package/lib/components/icons.js.map +2 -2
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +3 -1
- package/lib/components/index.js.map +2 -2
- package/lib/components/json-schema/Array.d.ts +3 -0
- package/lib/components/json-schema/Array.js +125 -0
- package/lib/components/json-schema/Array.js.map +13 -0
- package/lib/components/json-schema/Item.d.ts +3 -0
- package/lib/components/json-schema/Item.js +34 -0
- package/lib/components/json-schema/Item.js.map +13 -0
- package/lib/components/json-schema/Object.d.ts +3 -0
- package/lib/components/json-schema/Object.js +178 -0
- package/lib/components/json-schema/Object.js.map +13 -0
- package/lib/components/json-schema/index.d.ts +279 -0
- package/lib/components/json-schema/index.js +16 -0
- package/lib/components/json-schema/index.js.map +13 -0
- package/lib/components/schema-editor/Array.js +2 -2
- package/lib/components/schema-editor/Array.js.map +2 -2
- package/lib/components/schema-editor/Common.d.ts +2 -0
- package/lib/components/schema-editor/Common.js +39 -3
- package/lib/components/schema-editor/Common.js.map +2 -2
- package/lib/components/schema-editor/Object.js +2 -2
- package/lib/components/schema-editor/Object.js.map +2 -2
- package/lib/components/schema-editor/index.d.ts +45 -41
- package/lib/components/schema-editor/index.js +5 -5
- package/lib/components/schema-editor/index.js.map +2 -2
- package/lib/helper.css +125 -124
- package/lib/helper.css.map +1 -1
- package/lib/hooks/use-validation-resolver.d.ts +1 -0
- package/lib/hooks/use-validation-resolver.js +49 -0
- package/lib/hooks/use-validation-resolver.js.map +13 -0
- package/lib/icons/department.js +17 -0
- package/lib/icons/menu.js +9 -0
- package/lib/icons/post.js +15 -0
- package/lib/icons/role.js +14 -0
- package/lib/icons/user-remove.js +12 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +3 -1
- package/lib/index.js.map +2 -2
- package/lib/locale/de-DE.js +11 -1
- package/lib/locale/de-DE.js.map +2 -2
- package/lib/locale/en-US.js +12 -1
- package/lib/locale/en-US.js.map +2 -2
- package/lib/locale/zh-CN.js +14 -3
- package/lib/locale/zh-CN.js.map +2 -2
- package/lib/renderers/Action.js +25 -11
- package/lib/renderers/Action.js.map +2 -2
- package/lib/renderers/CRUD.js +5 -1
- package/lib/renderers/CRUD.js.map +2 -2
- package/lib/renderers/Dialog.js +9 -3
- package/lib/renderers/Dialog.js.map +2 -2
- package/lib/renderers/Drawer.js +5 -1
- package/lib/renderers/Drawer.js.map +2 -2
- package/lib/renderers/Form/InputDate.d.ts +2 -2
- package/lib/renderers/Form/InputDate.js.map +2 -2
- package/lib/renderers/Form/InputFile.js +5 -12
- package/lib/renderers/Form/InputFile.js.map +2 -2
- package/lib/renderers/Form/InputText.d.ts +1 -1
- package/lib/renderers/Form/InputText.js.map +1 -1
- package/lib/renderers/Form/JSONSchema.d.ts +23 -0
- package/lib/renderers/Form/JSONSchema.js +44 -0
- package/lib/renderers/Form/JSONSchema.js.map +13 -0
- package/lib/renderers/Form/JSONSchemaEditor.d.ts +2 -3
- package/lib/renderers/Form/JSONSchemaEditor.js +9 -24
- package/lib/renderers/Form/JSONSchemaEditor.js.map +2 -2
- package/lib/renderers/Form/Textarea.d.ts +1 -8
- package/lib/renderers/Form/Textarea.js +11 -75
- package/lib/renderers/Form/Textarea.js.map +2 -2
- package/lib/renderers/Form/UserSelect.d.ts +54 -0
- package/lib/renderers/Form/UserSelect.js +197 -0
- package/lib/renderers/Form/UserSelect.js.map +13 -0
- package/lib/renderers/Form/index.d.ts +1 -1
- package/lib/renderers/Form/index.js +88 -42
- package/lib/renderers/Form/index.js.map +2 -2
- package/lib/renderers/Link.d.ts +1 -1
- package/lib/renderers/Link.js +15 -29
- package/lib/renderers/Link.js.map +2 -2
- package/lib/renderers/Log.d.ts +28 -0
- package/lib/renderers/Log.js +110 -20
- package/lib/renderers/Log.js.map +2 -2
- package/lib/renderers/Page.js +5 -1
- package/lib/renderers/Page.js.map +2 -2
- package/lib/renderers/Service.js +5 -1
- package/lib/renderers/Service.js.map +2 -2
- package/lib/renderers/Wizard.js +37 -14
- package/lib/renderers/Wizard.js.map +2 -2
- package/lib/store/form.js +65 -45
- package/lib/store/form.js.map +2 -2
- package/lib/themes/ang-ie11.css +576 -24
- package/lib/themes/ang.css +553 -12
- package/lib/themes/ang.css.map +1 -1
- package/lib/themes/antd-ie11.css +576 -24
- package/lib/themes/antd.css +553 -12
- package/lib/themes/antd.css.map +1 -1
- package/lib/themes/cxd-ie11.css +576 -24
- package/lib/themes/cxd.css +553 -12
- package/lib/themes/cxd.css.map +1 -1
- package/lib/themes/dark-ie11.css +576 -24
- package/lib/themes/dark.css +553 -12
- package/lib/themes/dark.css.map +1 -1
- package/lib/themes/default-ie11.css +576 -24
- package/lib/themes/default.css +553 -12
- package/lib/themes/default.css.map +1 -1
- package/lib/utils/api.js +1 -1
- package/lib/utils/api.js.map +2 -2
- package/lib/utils/renderer-event.js.map +2 -2
- package/package.json +2 -1
- package/schema.json +542 -4
- package/scss/_properties.scss +20 -8
- package/scss/components/_input-box.scss +22 -1
- package/scss/components/_json-schema.scss +124 -0
- package/scss/components/_log.scss +37 -5
- package/scss/components/form/_date-range.scss +1 -0
- package/scss/components/form/_select.scss +9 -0
- package/scss/components/form/_transfer.scss +19 -3
- package/scss/components/form/_user-select.scss +422 -0
- package/scss/helper/background/_background-color.scss +125 -124
- package/scss/themes/_common.scss +2 -0
- package/sdk/ang-ie11.css +670 -24
- package/sdk/ang.css +647 -12
- package/sdk/antd-ie11.css +670 -24
- package/sdk/antd.css +647 -12
- package/sdk/barcode.js +51 -51
- package/sdk/charts.js +14 -14
- package/sdk/codemirror.js +7 -7
- package/sdk/color-picker.js +65 -65
- package/sdk/cropperjs.js +2 -2
- package/sdk/cxd-ie11.css +670 -24
- package/sdk/cxd.css +647 -12
- package/sdk/dark-ie11.css +670 -24
- package/sdk/dark.css +647 -12
- package/sdk/exceljs.js +1 -1
- package/sdk/helper.css +125 -124
- package/sdk/helper.css.map +1 -1
- package/sdk/locale/de-DE.js +11 -1
- package/sdk/markdown.js +69 -69
- package/sdk/papaparse.js +1 -1
- package/sdk/renderers/Form/CityDB.js +1 -1
- package/sdk/rest.js +16 -16
- package/sdk/rich-text.js +62 -62
- package/sdk/sdk-ie11.css +670 -24
- package/sdk/sdk.css +647 -12
- package/sdk/sdk.js +1651 -1637
- package/sdk/thirds/hls.js/hls.js +1 -1
- package/sdk/thirds/mpegts.js/mpegts.js +1 -1
- package/sdk/tinymce.js +57 -57
- package/src/RootRenderer.tsx +27 -15
- package/src/Schema.ts +5 -1
- package/src/actions/Action.ts +5 -4
- package/src/components/Button.tsx +3 -0
- package/src/components/Checkbox.tsx +2 -1
- package/src/components/ContextMenu.tsx +25 -7
- package/src/components/Form.tsx +70 -0
- package/src/components/FormField.tsx +127 -0
- package/src/components/InputBox.tsx +4 -1
- package/src/components/InputBoxWithSuggestion.tsx +113 -0
- package/src/components/PickerContainer.tsx +20 -5
- package/src/components/Select.tsx +18 -10
- package/src/components/Textarea.tsx +234 -2
- package/src/components/Toast.tsx +19 -18
- package/src/components/UserSelect.tsx +850 -0
- package/src/components/UserTabSelect.tsx +261 -0
- package/src/components/WithRemoteConfig.tsx +22 -7
- package/src/components/calendar/DaysView.tsx +117 -49
- package/src/components/calendar/TimeView.tsx +11 -6
- package/src/components/formula/Picker.tsx +2 -1
- package/src/components/icons.tsx +17 -1
- package/src/components/index.tsx +3 -1
- package/src/components/json-schema/Array.tsx +216 -0
- package/src/components/json-schema/Item.tsx +47 -0
- package/src/components/json-schema/Object.tsx +339 -0
- package/src/components/json-schema/index.tsx +44 -0
- package/src/components/schema-editor/Array.tsx +3 -1
- package/src/components/schema-editor/Common.tsx +61 -4
- package/src/components/schema-editor/Object.tsx +3 -1
- package/src/components/schema-editor/index.tsx +12 -5
- package/src/hooks/use-validation-resolver.ts +45 -0
- package/src/icons/department.svg +17 -0
- package/src/icons/menu.svg +2 -0
- package/src/icons/post.svg +15 -0
- package/src/icons/role.svg +14 -0
- package/src/icons/user-remove.svg +12 -0
- package/src/index.tsx +2 -0
- package/src/locale/de-DE.ts +11 -1
- package/src/locale/en-US.ts +12 -1
- package/src/locale/zh-CN.ts +14 -3
- package/src/renderers/Action.tsx +10 -9
- package/src/renderers/CRUD.tsx +5 -1
- package/src/renderers/Dialog.tsx +9 -3
- package/src/renderers/Drawer.tsx +5 -1
- package/src/renderers/Form/InputDate.tsx +9 -4
- package/src/renderers/Form/InputFile.tsx +5 -15
- package/src/renderers/Form/InputText.tsx +1 -1
- package/src/renderers/Form/JSONSchema.tsx +56 -0
- package/src/renderers/Form/JSONSchemaEditor.tsx +8 -27
- package/src/renderers/Form/Textarea.tsx +7 -117
- package/src/renderers/Form/UserSelect.tsx +263 -0
- package/src/renderers/Form/index.tsx +28 -18
- package/src/renderers/Link.tsx +5 -17
- package/src/renderers/Log.tsx +213 -19
- package/src/renderers/Page.tsx +6 -1
- package/src/renderers/Service.tsx +5 -1
- package/src/renderers/Wizard.tsx +24 -10
- package/src/store/form.ts +24 -17
- package/src/utils/api.ts +1 -1
- package/src/utils/renderer-event.ts +0 -2
@@ -94,7 +94,7 @@ export declare class CalendarMobile extends React.Component<CalendarMobileProps,
|
|
94
94
|
render(): JSX.Element;
|
95
95
|
}
|
96
96
|
declare const _default: {
|
97
|
-
new (props: Omit<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
97
|
+
new (props: Omit<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
98
98
|
locale?: string | undefined;
|
99
99
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
100
100
|
}, keyof ThemeProps> & import("../theme").ThemeOutterProps): {
|
@@ -103,12 +103,12 @@ declare const _default: {
|
|
103
103
|
getWrappedInstance(): any;
|
104
104
|
render(): JSX.Element;
|
105
105
|
context: any;
|
106
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
106
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Omit<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
107
107
|
locale?: string | undefined;
|
108
108
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
109
109
|
}, keyof ThemeProps> & import("../theme").ThemeOutterProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
110
110
|
forceUpdate(callback?: (() => void) | undefined): void;
|
111
|
-
readonly props: Readonly<Omit<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
111
|
+
readonly props: Readonly<Omit<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
112
112
|
locale?: string | undefined;
|
113
113
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
114
114
|
}, keyof ThemeProps> & import("../theme").ThemeOutterProps> & Readonly<{
|
@@ -119,35 +119,35 @@ declare const _default: {
|
|
119
119
|
[key: string]: React.ReactInstance;
|
120
120
|
};
|
121
121
|
componentDidMount?(): void;
|
122
|
-
shouldComponentUpdate?(nextProps: Readonly<Omit<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
122
|
+
shouldComponentUpdate?(nextProps: Readonly<Omit<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
123
123
|
locale?: string | undefined;
|
124
124
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
125
125
|
}, keyof ThemeProps> & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): boolean;
|
126
126
|
componentWillUnmount?(): void;
|
127
127
|
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
128
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
128
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Omit<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
129
129
|
locale?: string | undefined;
|
130
130
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
131
131
|
}, keyof ThemeProps> & import("../theme").ThemeOutterProps>, prevState: Readonly<{}>): any;
|
132
|
-
componentDidUpdate?(prevProps: Readonly<Omit<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
132
|
+
componentDidUpdate?(prevProps: Readonly<Omit<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
133
133
|
locale?: string | undefined;
|
134
134
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
135
135
|
}, keyof ThemeProps> & import("../theme").ThemeOutterProps>, prevState: Readonly<{}>, snapshot?: any): void;
|
136
136
|
componentWillMount?(): void;
|
137
137
|
UNSAFE_componentWillMount?(): void;
|
138
|
-
componentWillReceiveProps?(nextProps: Readonly<Omit<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
138
|
+
componentWillReceiveProps?(nextProps: Readonly<Omit<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
139
139
|
locale?: string | undefined;
|
140
140
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
141
141
|
}, keyof ThemeProps> & import("../theme").ThemeOutterProps>, nextContext: any): void;
|
142
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
142
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Omit<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
143
143
|
locale?: string | undefined;
|
144
144
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
145
145
|
}, keyof ThemeProps> & import("../theme").ThemeOutterProps>, nextContext: any): void;
|
146
|
-
componentWillUpdate?(nextProps: Readonly<Omit<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
146
|
+
componentWillUpdate?(nextProps: Readonly<Omit<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
147
147
|
locale?: string | undefined;
|
148
148
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
149
149
|
}, keyof ThemeProps> & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
|
150
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
150
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Omit<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
151
151
|
locale?: string | undefined;
|
152
152
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
153
153
|
}, keyof ThemeProps> & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
|
@@ -155,7 +155,7 @@ declare const _default: {
|
|
155
155
|
displayName: string;
|
156
156
|
contextType: React.Context<string>;
|
157
157
|
ComposedComponent: React.ComponentType<{
|
158
|
-
new (props: Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
158
|
+
new (props: Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
159
159
|
locale?: string | undefined;
|
160
160
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
161
161
|
}): {
|
@@ -164,12 +164,12 @@ declare const _default: {
|
|
164
164
|
getWrappedInstance(): any;
|
165
165
|
render(): JSX.Element;
|
166
166
|
context: any;
|
167
|
-
setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
167
|
+
setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
168
168
|
locale?: string | undefined;
|
169
169
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
170
170
|
}>) => {} | Pick<{}, K_1> | null) | Pick<{}, K_1> | null, callback?: (() => void) | undefined): void;
|
171
171
|
forceUpdate(callback?: (() => void) | undefined): void;
|
172
|
-
readonly props: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
172
|
+
readonly props: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
173
173
|
locale?: string | undefined;
|
174
174
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
175
175
|
}> & Readonly<{
|
@@ -180,35 +180,35 @@ declare const _default: {
|
|
180
180
|
[key: string]: React.ReactInstance;
|
181
181
|
};
|
182
182
|
componentDidMount?(): void;
|
183
|
-
shouldComponentUpdate?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
183
|
+
shouldComponentUpdate?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
184
184
|
locale?: string | undefined;
|
185
185
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
186
186
|
}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
187
187
|
componentWillUnmount?(): void;
|
188
188
|
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
189
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
189
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
190
190
|
locale?: string | undefined;
|
191
191
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
192
192
|
}>, prevState: Readonly<{}>): any;
|
193
|
-
componentDidUpdate?(prevProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
193
|
+
componentDidUpdate?(prevProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
194
194
|
locale?: string | undefined;
|
195
195
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
196
196
|
}>, prevState: Readonly<{}>, snapshot?: any): void;
|
197
197
|
componentWillMount?(): void;
|
198
198
|
UNSAFE_componentWillMount?(): void;
|
199
|
-
componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
199
|
+
componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
200
200
|
locale?: string | undefined;
|
201
201
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
202
202
|
}>, nextContext: any): void;
|
203
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
203
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
204
204
|
locale?: string | undefined;
|
205
205
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
206
206
|
}>, nextContext: any): void;
|
207
|
-
componentWillUpdate?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
207
|
+
componentWillUpdate?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
208
208
|
locale?: string | undefined;
|
209
209
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
210
210
|
}>, nextState: Readonly<{}>, nextContext: any): void;
|
211
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
211
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
212
212
|
locale?: string | undefined;
|
213
213
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
214
214
|
}>, nextState: Readonly<{}>, nextContext: any): void;
|
@@ -220,7 +220,7 @@ declare const _default: {
|
|
220
220
|
ComposedComponent: typeof CalendarMobile;
|
221
221
|
}>;
|
222
222
|
} & import("hoist-non-react-statics").NonReactStatics<{
|
223
|
-
new (props: Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
223
|
+
new (props: Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
224
224
|
locale?: string | undefined;
|
225
225
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
226
226
|
}): {
|
@@ -229,12 +229,12 @@ declare const _default: {
|
|
229
229
|
getWrappedInstance(): any;
|
230
230
|
render(): JSX.Element;
|
231
231
|
context: any;
|
232
|
-
setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
232
|
+
setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
233
233
|
locale?: string | undefined;
|
234
234
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
235
235
|
}>) => {} | Pick<{}, K_1> | null) | Pick<{}, K_1> | null, callback?: (() => void) | undefined): void;
|
236
236
|
forceUpdate(callback?: (() => void) | undefined): void;
|
237
|
-
readonly props: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
237
|
+
readonly props: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
238
238
|
locale?: string | undefined;
|
239
239
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
240
240
|
}> & Readonly<{
|
@@ -245,35 +245,35 @@ declare const _default: {
|
|
245
245
|
[key: string]: React.ReactInstance;
|
246
246
|
};
|
247
247
|
componentDidMount?(): void;
|
248
|
-
shouldComponentUpdate?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
248
|
+
shouldComponentUpdate?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
249
249
|
locale?: string | undefined;
|
250
250
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
251
251
|
}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
252
252
|
componentWillUnmount?(): void;
|
253
253
|
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
254
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
254
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
255
255
|
locale?: string | undefined;
|
256
256
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
257
257
|
}>, prevState: Readonly<{}>): any;
|
258
|
-
componentDidUpdate?(prevProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
258
|
+
componentDidUpdate?(prevProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
259
259
|
locale?: string | undefined;
|
260
260
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
261
261
|
}>, prevState: Readonly<{}>, snapshot?: any): void;
|
262
262
|
componentWillMount?(): void;
|
263
263
|
UNSAFE_componentWillMount?(): void;
|
264
|
-
componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
264
|
+
componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
265
265
|
locale?: string | undefined;
|
266
266
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
267
267
|
}>, nextContext: any): void;
|
268
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
268
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
269
269
|
locale?: string | undefined;
|
270
270
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
271
271
|
}>, nextContext: any): void;
|
272
|
-
componentWillUpdate?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
272
|
+
componentWillUpdate?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
273
273
|
locale?: string | undefined;
|
274
274
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
275
275
|
}>, nextState: Readonly<{}>, nextContext: any): void;
|
276
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
276
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
277
277
|
locale?: string | undefined;
|
278
278
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
279
279
|
}>, nextState: Readonly<{}>, nextContext: any): void;
|
@@ -285,7 +285,7 @@ declare const _default: {
|
|
285
285
|
ComposedComponent: typeof CalendarMobile;
|
286
286
|
}, {}> & {
|
287
287
|
ComposedComponent: {
|
288
|
-
new (props: Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
288
|
+
new (props: Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
289
289
|
locale?: string | undefined;
|
290
290
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
291
291
|
}): {
|
@@ -294,12 +294,12 @@ declare const _default: {
|
|
294
294
|
getWrappedInstance(): any;
|
295
295
|
render(): JSX.Element;
|
296
296
|
context: any;
|
297
|
-
setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
297
|
+
setState<K_1 extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
298
298
|
locale?: string | undefined;
|
299
299
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
300
300
|
}>) => {} | Pick<{}, K_1> | null) | Pick<{}, K_1> | null, callback?: (() => void) | undefined): void;
|
301
301
|
forceUpdate(callback?: (() => void) | undefined): void;
|
302
|
-
readonly props: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
302
|
+
readonly props: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
303
303
|
locale?: string | undefined;
|
304
304
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
305
305
|
}> & Readonly<{
|
@@ -310,35 +310,35 @@ declare const _default: {
|
|
310
310
|
[key: string]: React.ReactInstance;
|
311
311
|
};
|
312
312
|
componentDidMount?(): void;
|
313
|
-
shouldComponentUpdate?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
313
|
+
shouldComponentUpdate?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
314
314
|
locale?: string | undefined;
|
315
315
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
316
316
|
}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
317
317
|
componentWillUnmount?(): void;
|
318
318
|
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
319
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
319
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
320
320
|
locale?: string | undefined;
|
321
321
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
322
322
|
}>, prevState: Readonly<{}>): any;
|
323
|
-
componentDidUpdate?(prevProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
323
|
+
componentDidUpdate?(prevProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
324
324
|
locale?: string | undefined;
|
325
325
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
326
326
|
}>, prevState: Readonly<{}>, snapshot?: any): void;
|
327
327
|
componentWillMount?(): void;
|
328
328
|
UNSAFE_componentWillMount?(): void;
|
329
|
-
componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
329
|
+
componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
330
330
|
locale?: string | undefined;
|
331
331
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
332
332
|
}>, nextContext: any): void;
|
333
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
333
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
334
334
|
locale?: string | undefined;
|
335
335
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
336
336
|
}>, nextContext: any): void;
|
337
|
-
componentWillUpdate?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
337
|
+
componentWillUpdate?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
338
338
|
locale?: string | undefined;
|
339
339
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
340
340
|
}>, nextState: Readonly<{}>, nextContext: any): void;
|
341
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "
|
341
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "classPrefix" | "classnames" | "embed" | "className" | "theme" | "close" | "confirm" | "onChange" | "inputFormat" | "maxDate" | "minDate" | "maxDuration" | "minDuration" | "dateFormat" | "timeFormat" | "timeConstraints" | "viewMode" | "startDate" | "endDate" | "footerExtra" | "isDatePicker" | "defaultDate"> & Partial<Pick<Omit<CalendarMobileProps, keyof LocaleProps>, "showViewMode">> & Partial<Pick<Pick<CalendarMobileProps, "showViewMode">, never>> & {
|
342
342
|
locale?: string | undefined;
|
343
343
|
translate?: ((str: string, ...args: any[]) => string) | undefined;
|
344
344
|
}>, nextState: Readonly<{}>, nextContext: any): void;
|
@@ -32,7 +32,7 @@ var Checkbox = /** @class */ (function (_super) {
|
|
32
32
|
_a["Checkbox--".concat(size)] = size,
|
33
33
|
_a['Checkbox--button'] = optionType === 'button',
|
34
34
|
_a['Checkbox--button--checked'] = optionType === 'button' && checked,
|
35
|
-
_a['Checkbox--button--disabled--unchecked'] = disabled && !checked,
|
35
|
+
_a['Checkbox--button--disabled--unchecked'] = optionType === 'button' && disabled && !checked,
|
36
36
|
_a)) },
|
37
37
|
react_1.default.createElement("input", { type: type, checked: typeof checked !== 'undefined'
|
38
38
|
? checked
|
@@ -6,8 +6,8 @@
|
|
6
6
|
"/src/components/Checkbox.tsx"
|
7
7
|
],
|
8
8
|
"names": [],
|
9
|
-
"mappings": ";AAAA;;;GAGG;;;;AAEH,6DAA0B;AAC1B,kCAAiD;AACjD,0CAAyC;AAEzC,IAAM,YAAY,GAAG,UAAC,CAAM,IAAK,OAAA,CAAC,CAAC,eAAe,EAAE,EAAnB,CAAmB,CAAC;AAwBrD;IAA8B,yCAAmC;IAAjE;;
|
9
|
+
"mappings": ";AAAA;;;GAGG;;;;AAEH,6DAA0B;AAC1B,kCAAiD;AACjD,0CAAyC;AAEzC,IAAM,YAAY,GAAG,UAAC,CAAM,IAAK,OAAA,CAAC,CAAC,eAAe,EAAE,EAAnB,CAAmB,CAAC;AAwBrD;IAA8B,yCAAmC;IAAjE;;IAiFA,CAAC;IAtEC,8BAAW,GAAX,UAAY,CAAyB;QAC7B,IAAA,KAAoC,IAAI,CAAC,KAAK,EAA7C,SAAS,eAAA,EAAE,UAAU,gBAAA,EAAE,QAAQ,cAAc,CAAC;QAErD,IAAI,CAAC,QAAQ,EAAE;YACb,OAAO;SACR;QAED,QAAQ,CACN,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,EAC/C,CAAC,CAAC,WAA0B,CAAC,QAAQ,CACvC,CAAC;IACJ,CAAC;IAED,yBAAM,GAAN;;QACM,IAAA,KAiBA,IAAI,CAAC,KAAK,EAhBZ,IAAI,UAAA,EACJ,SAAS,eAAA,EACG,EAAE,gBAAA,EACd,KAAK,WAAA,EACL,KAAK,WAAA,EACL,OAAO,aAAA,EACP,SAAS,eAAA,EACT,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,WAAW,iBAAA,EACX,QAAQ,cAAA,EACR,OAAO,aAAA,EACP,IAAI,UAAA,EACJ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AC,SAAS,GAiF5C;AAjFY,4BAAQ;AAmFrB,kBAAe,IAAA,iBAAS,EAAC,QAAQ,CAAC,CAAC",
|
10
10
|
"sourcesContent": [
|
11
|
-
"/**\n * @file Checkbox\n * @author fex\n */\n\nimport React from 'react';\nimport {ClassNamesFn, themeable} from '../theme';\nimport {autobind} from '../utils/helper';\n\nconst preventEvent = (e: any) => e.stopPropagation();\n\ninterface CheckboxProps {\n type: 'checkbox' | 'radio';\n size?: 'sm' | 'lg' | 'small' | 'large';\n label?: string;\n labelClassName?: string;\n className?: string;\n onChange?: (value: any, shift?: boolean) => void;\n value?: boolean | string | number;\n inline?: boolean;\n trueValue?: boolean | string | number;\n falseValue?: boolean | string | number;\n disabled?: boolean;\n readOnly?: boolean;\n checked?: boolean;\n name?: string;\n description?: string;\n classPrefix: string;\n classnames: ClassNamesFn;\n partial?: boolean;\n optionType?: 'default' | 'button';\n}\n\nexport class Checkbox extends React.Component<CheckboxProps, any> {\n static defaultProps: Pick<\n CheckboxProps,\n 'trueValue' | 'falseValue' | 'type'\n > = {\n trueValue: true,\n falseValue: false,\n type: 'checkbox'\n };\n\n @autobind\n handleCheck(e: React.ChangeEvent<any>) {\n const {trueValue, falseValue, onChange} = this.props;\n\n if (!onChange) {\n return;\n }\n\n onChange(\n e.currentTarget.checked ? trueValue : falseValue,\n (e.nativeEvent as MouseEvent).shiftKey\n );\n }\n\n render() {\n let {\n size,\n className,\n classnames: cx,\n value,\n label,\n partial,\n trueValue,\n children,\n disabled,\n description,\n readOnly,\n checked,\n type,\n name,\n labelClassName,\n optionType\n } = this.props;\n\n return (\n <label\n className={cx(`Checkbox Checkbox--${type}`, className, {\n 'Checkbox--full': !partial,\n // 'Checkbox--partial': partial\n [`Checkbox--${size}`]: size,\n 'Checkbox--button': optionType === 'button',\n 'Checkbox--button--checked': optionType === 'button' && checked,\n 'Checkbox--button--disabled--unchecked'
|
11
|
+
"/**\n * @file Checkbox\n * @author fex\n */\n\nimport React from 'react';\nimport {ClassNamesFn, themeable} from '../theme';\nimport {autobind} from '../utils/helper';\n\nconst preventEvent = (e: any) => e.stopPropagation();\n\ninterface CheckboxProps {\n type: 'checkbox' | 'radio';\n size?: 'sm' | 'lg' | 'small' | 'large';\n label?: string;\n labelClassName?: string;\n className?: string;\n onChange?: (value: any, shift?: boolean) => void;\n value?: boolean | string | number;\n inline?: boolean;\n trueValue?: boolean | string | number;\n falseValue?: boolean | string | number;\n disabled?: boolean;\n readOnly?: boolean;\n checked?: boolean;\n name?: string;\n description?: string;\n classPrefix: string;\n classnames: ClassNamesFn;\n partial?: boolean;\n optionType?: 'default' | 'button';\n}\n\nexport class Checkbox extends React.Component<CheckboxProps, any> {\n static defaultProps: Pick<\n CheckboxProps,\n 'trueValue' | 'falseValue' | 'type'\n > = {\n trueValue: true,\n falseValue: false,\n type: 'checkbox'\n };\n\n @autobind\n handleCheck(e: React.ChangeEvent<any>) {\n const {trueValue, falseValue, onChange} = this.props;\n\n if (!onChange) {\n return;\n }\n\n onChange(\n e.currentTarget.checked ? trueValue : falseValue,\n (e.nativeEvent as MouseEvent).shiftKey\n );\n }\n\n render() {\n let {\n size,\n className,\n classnames: cx,\n value,\n label,\n partial,\n trueValue,\n children,\n disabled,\n description,\n readOnly,\n checked,\n type,\n name,\n labelClassName,\n optionType\n } = this.props;\n\n return (\n <label\n className={cx(`Checkbox Checkbox--${type}`, className, {\n 'Checkbox--full': !partial,\n // 'Checkbox--partial': partial\n [`Checkbox--${size}`]: size,\n 'Checkbox--button': optionType === 'button',\n 'Checkbox--button--checked': optionType === 'button' && checked,\n 'Checkbox--button--disabled--unchecked':\n optionType === 'button' && disabled && !checked\n })}\n >\n <input\n type={type}\n checked={\n typeof checked !== 'undefined'\n ? checked\n : typeof value === 'undefined'\n ? value\n : value == trueValue\n }\n onChange={this.handleCheck}\n onClick={\n preventEvent // 当点击 i 的时候,这个地方也会触发 click,很奇怪,干脆禁掉\n }\n disabled={disabled}\n readOnly={readOnly}\n name={name}\n />\n <i />\n <span className={cx(labelClassName)}>{children || label}</span>\n {description ? (\n <div className={cx('Checkbox-desc')}>{description}</div>\n ) : null}\n </label>\n );\n }\n}\n\nexport default themeable(Checkbox);\n"
|
12
12
|
]
|
13
13
|
}
|
@@ -32,6 +32,10 @@ export declare class ContextMenu extends React.Component<ContextMenuProps, Conte
|
|
32
32
|
state: ContextMenuState;
|
33
33
|
menuRef: React.RefObject<HTMLDivElement>;
|
34
34
|
originInstance: this | null;
|
35
|
+
prevInfo: {
|
36
|
+
x: number;
|
37
|
+
y: number;
|
38
|
+
} | null;
|
35
39
|
constructor(props: ContextMenuProps);
|
36
40
|
componentDidMount(): void;
|
37
41
|
componentWillUnmount(): void;
|
@@ -50,13 +50,29 @@ var ContextMenu = /** @class */ (function (_super) {
|
|
50
50
|
delete this.originInstance;
|
51
51
|
};
|
52
52
|
ContextMenu.prototype.openContextMenus = function (info, menus, onClose) {
|
53
|
-
this
|
54
|
-
|
55
|
-
x
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
53
|
+
var _this = this;
|
54
|
+
if (this.state.isOpened) {
|
55
|
+
var _a = this.state, x = _a.x, y = _a.y;
|
56
|
+
// 避免 二次触发未进行智能定位 导致遮挡问题
|
57
|
+
this.setState({
|
58
|
+
x: x + (info.x - (this.prevInfo && this.prevInfo.x ? this.prevInfo.x : 0)),
|
59
|
+
y: y + (info.y - (this.prevInfo && this.prevInfo.y ? this.prevInfo.y : 0)),
|
60
|
+
menus: menus,
|
61
|
+
onClose: onClose
|
62
|
+
}, function () {
|
63
|
+
_this.handleEnter(_this.menuRef.current);
|
64
|
+
});
|
65
|
+
}
|
66
|
+
else {
|
67
|
+
this.setState({
|
68
|
+
isOpened: true,
|
69
|
+
x: info.x,
|
70
|
+
y: info.y,
|
71
|
+
menus: menus,
|
72
|
+
onClose: onClose
|
73
|
+
});
|
74
|
+
}
|
75
|
+
this.prevInfo = info;
|
60
76
|
};
|
61
77
|
ContextMenu.prototype.close = function () {
|
62
78
|
var onCl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AAG,KAAI,CAAC,KAAK,CAAC,CAAC,OAAI,EAAE,GAAG,EAAE,UAAG,KAAI,CAAC,KAAK,CAAC,CAAC,OAAI,EAAC,EAC5D,SAAS,EAAE,EAAE,CAAC,kBAAkB,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;gBAErD,sCAAI,SAAS,EAAE,EAAE,CAAC,kBAAkB,CAAC,IAClC,KAAI,CAAC,WAAW,CAAC,KAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAChC,CACD,CACF,CACP,EA3BoB,CA2BpB,CACU,CACd,CAAC;IACJ,CAAC;;IAlPM,oBAAQ,GAAQ,IAAI,CAAC;IAgD5B;QADC,iBAAQ;;kFAGA,KAAK,oBAAL,KAAK;;uDAwBb;IAGD;QADC,iBAAQ;;;;4CAYR;IAGD;QADC,iBAAQ;;0EACS,KAAK,oBAAL,KAAK;;qDAYtB;IAqBD;QADC,iBAAQ;;0EACQ,aAAa,oBAAb,aAAa;;oDAK7B;IAWD;QADC,iBAAQ;;0EACS,WAAW,oBAAX,WAAW;;kDAiB5B;IAGD;QADC,iBAAQ;;0EACgB,eAAK,oBAAL,eAAK,CAAC,UAAU;;4DAExC;IAiFH,kBAAC;CAAA,AAvPD,CAAiC,eAAK,CAAC,SAAS,GAuP/C;AAvPY,kCAAW;AAyPX,QAAA,iBAAiB,GAAG,IAAA,iBAAS,EAAC,WAAW,CAAC,CAAC;AACxD,kBAAe,yBAAiB,CAAC;AAEjC,SAAgB,gBAAgB,CAC9B,IAAoC,EACpC,KAAoC,EACpC,OAAoB;IAEpB,OAAO,WAAW,CAAC,WAAW,EAAE,CAAC,gBAAgB,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AAC1E,CAAC;AAND,4CAMC",
|
10
10
|
"sourcesContent": [
|
11
|
-
"import {ClassNamesFn, themeable} from '../theme';\nimport React from 'react';\nimport {render} from 'react-dom';\nimport {autobind} from '../utils/helper';\nimport Transition, {\n ENTERED,\n ENTERING,\n EXITING\n} from 'react-transition-group/Transition';\nimport {calculatePosition} from '../utils/dom';\nconst fadeStyles: {\n [propName: string]: string;\n} = {\n [ENTERING]: 'in',\n [ENTERED]: 'in',\n [EXITING]: 'out'\n};\n\ninterface ContextMenuProps {\n className?: string;\n classPrefix: string;\n classnames: ClassNamesFn;\n container?: HTMLElement | null | (() => HTMLElement);\n}\n\nexport type MenuItem = {\n label: string;\n icon?: string;\n disabled?: boolean;\n children?: Array<MenuItem | MenuDivider>;\n data?: any;\n className?: string;\n onSelect?: (data: any) => void;\n onHighlight?: (isHiglight: boolean, data: any) => void;\n};\n\nexport type MenuDivider = '|';\n\ninterface ContextMenuState {\n isOpened: boolean;\n menus: Array<MenuItem | MenuDivider>;\n x: number;\n y: number;\n align?: 'left' | 'right';\n onClose?: () => void;\n}\n\nexport class ContextMenu extends React.Component<\n ContextMenuProps,\n ContextMenuState\n> {\n static instance: any = null;\n static getInstance() {\n if (!ContextMenu.instance) {\n const container = document.body;\n const div = document.createElement('div');\n container.appendChild(div);\n render(<ThemedContextMenu />, div);\n }\n\n return ContextMenu.instance;\n }\n\n state: ContextMenuState = {\n isOpened: false,\n menus: [],\n x: -99999,\n y: -99999\n };\n\n menuRef: React.RefObject<HTMLDivElement> = React.createRef();\n originInstance: this | null;\n\n constructor(props: ContextMenuProps) {\n super(props);\n\n this.originInstance = ContextMenu.instance;\n ContextMenu.instance = this;\n }\n\n componentDidMount() {\n document.body.addEventListener('click', this.handleOutClick, true);\n document.addEventListener('keydown', this.handleKeyDown);\n }\n\n componentWillUnmount() {\n ContextMenu.instance = this.originInstance;\n document.body.removeEventListener('click', this.handleOutClick, true);\n document.removeEventListener('keydown', this.handleKeyDown);\n\n // @ts-ignore\n delete this.originInstance;\n }\n\n @autobind\n openContextMenus(\n info: {x: number; y: number},\n menus: Array<MenuItem>,\n onClose?: () => void\n ) {\n this.setState({\n isOpened: true,\n
|
11
|
+
"import {ClassNamesFn, themeable} from '../theme';\nimport React from 'react';\nimport {render} from 'react-dom';\nimport {autobind} from '../utils/helper';\nimport Transition, {\n ENTERED,\n ENTERING,\n EXITING\n} from 'react-transition-group/Transition';\nimport {calculatePosition} from '../utils/dom';\nconst fadeStyles: {\n [propName: string]: string;\n} = {\n [ENTERING]: 'in',\n [ENTERED]: 'in',\n [EXITING]: 'out'\n};\n\ninterface ContextMenuProps {\n className?: string;\n classPrefix: string;\n classnames: ClassNamesFn;\n container?: HTMLElement | null | (() => HTMLElement);\n}\n\nexport type MenuItem = {\n label: string;\n icon?: string;\n disabled?: boolean;\n children?: Array<MenuItem | MenuDivider>;\n data?: any;\n className?: string;\n onSelect?: (data: any) => void;\n onHighlight?: (isHiglight: boolean, data: any) => void;\n};\n\nexport type MenuDivider = '|';\n\ninterface ContextMenuState {\n isOpened: boolean;\n menus: Array<MenuItem | MenuDivider>;\n x: number;\n y: number;\n align?: 'left' | 'right';\n onClose?: () => void;\n}\n\nexport class ContextMenu extends React.Component<\n ContextMenuProps,\n ContextMenuState\n> {\n static instance: any = null;\n static getInstance() {\n if (!ContextMenu.instance) {\n const container = document.body;\n const div = document.createElement('div');\n container.appendChild(div);\n render(<ThemedContextMenu />, div);\n }\n\n return ContextMenu.instance;\n }\n\n state: ContextMenuState = {\n isOpened: false,\n menus: [],\n x: -99999,\n y: -99999\n };\n\n menuRef: React.RefObject<HTMLDivElement> = React.createRef();\n originInstance: this | null;\n prevInfo: { // 记录当前右键位置: 方便下一次做对比\n x: number;\n y: number;\n } | null;\n\n constructor(props: ContextMenuProps) {\n super(props);\n\n this.originInstance = ContextMenu.instance;\n ContextMenu.instance = this;\n }\n\n componentDidMount() {\n document.body.addEventListener('click', this.handleOutClick, true);\n document.addEventListener('keydown', this.handleKeyDown);\n }\n\n componentWillUnmount() {\n ContextMenu.instance = this.originInstance;\n document.body.removeEventListener('click', this.handleOutClick, true);\n document.removeEventListener('keydown', this.handleKeyDown);\n\n // @ts-ignore\n delete this.originInstance;\n }\n\n @autobind\n openContextMenus(\n info: {x: number; y: number},\n menus: Array<MenuItem>,\n onClose?: () => void\n ) {\n if (this.state.isOpened) {\n const {x, y} = this.state;\n // 避免 二次触发未进行智能定位 导致遮挡问题\n this.setState({\n x: x + (info.x - (this.prevInfo && this.prevInfo.x ? this.prevInfo.x : 0)),\n y: y + (info.y - (this.prevInfo && this.prevInfo.y ? this.prevInfo.y : 0)),\n menus: menus,\n onClose\n }, () => {\n this.handleEnter(this.menuRef.current as HTMLElement);\n });\n } else {\n this.setState({\n isOpened: true,\n x: info.x,\n y: info.y,\n menus: menus,\n onClose\n });\n }\n this.prevInfo = info;\n }\n\n @autobind\n close() {\n const onClose = this.state.onClose;\n this.setState(\n {\n isOpened: false,\n x: -99999,\n y: -99999,\n menus: []\n },\n onClose\n );\n }\n\n @autobind\n handleOutClick(e: Event) {\n if (\n !e.target ||\n !this.menuRef.current ||\n this.menuRef.current.contains(e.target as HTMLElement)\n ) {\n return;\n }\n if (this.state.isOpened) {\n e.preventDefault();\n this.close();\n }\n }\n\n handleClick(item: MenuItem) {\n const onClose = this.state.onClose;\n item.disabled ||\n (Array.isArray(item.children) && item.children.length) ||\n this.setState(\n {\n isOpened: false,\n x: -99999,\n y: -99999,\n menus: []\n },\n () => {\n item.onSelect?.(item.data);\n onClose?.();\n }\n );\n }\n\n @autobind\n handleKeyDown(e: KeyboardEvent) {\n if (e.keyCode === 27 && this.state.isOpened) {\n e.preventDefault();\n this.close();\n }\n }\n\n handleMouseEnter(item: MenuItem) {\n item.disabled || !item.onHighlight || item.onHighlight(true, item.data);\n }\n\n handleMouseLeave(item: MenuItem) {\n item.disabled || !item.onHighlight || item.onHighlight(false, item.data);\n }\n\n @autobind\n handleEnter(menu: HTMLElement) {\n // 智能定位,选择一个合适的对齐方式。\n const info = calculatePosition(\n 'auto',\n menu.lastChild,\n menu.children[1] as HTMLElement,\n document.body\n );\n\n const align =\n info.positionLeft + 300 < window.innerWidth ? 'right' : 'left';\n\n this.setState({\n x: info.positionLeft,\n y: info.positionTop,\n align\n });\n }\n\n @autobind\n handleSelfContextMenu(e: React.MouseEvent) {\n e.preventDefault();\n }\n\n renderMenus(menus: Array<MenuItem | MenuDivider>) {\n const {classnames: cx} = this.props;\n\n return menus.map((item, index) => {\n if (item === '|') {\n return <li key={index} className={cx('ContextMenu-divider')} />;\n }\n\n const hasChildren = Array.isArray(item.children) && item.children.length;\n return (\n <li\n key={`${item.label}-${index}`}\n className={cx('ContextMenu-item', item.className, {\n 'has-child': hasChildren,\n 'is-disabled': item.disabled\n })}\n >\n <a\n onClick={this.handleClick.bind(this, item)}\n onMouseEnter={this.handleMouseEnter.bind(this, item)}\n onMouseLeave={this.handleMouseLeave.bind(this, item)}\n >\n {item.icon ? (\n <span className={cx('ContextMenu-itemIcon', item.icon)} />\n ) : null}\n {item.label}\n </a>\n {hasChildren ? (\n <ul className={cx('ContextMenu-subList')}>\n {this.renderMenus(item.children!)}\n </ul>\n ) : null}\n </li>\n );\n });\n }\n\n render() {\n const {className, container, classnames: cx} = this.props;\n\n return (\n <Transition\n mountOnEnter\n unmountOnExit\n onEnter={this.handleEnter}\n in={this.state.isOpened}\n timeout={500}\n >\n {(status: string) => (\n <div\n ref={this.menuRef}\n role=\"contextmenu\"\n className={cx(\n 'ContextMenu',\n {\n 'ContextMenu--left': this.state.align === 'left'\n },\n className\n )}\n onContextMenu={this.handleSelfContextMenu}\n >\n <div className={cx(`ContextMenu-overlay`, fadeStyles[status])} />\n <div\n className={cx(`ContextMenu-cursor`)}\n style={{left: `${this.state.x}px`, top: `${this.state.y}px`}}\n />\n <div\n style={{left: `${this.state.x}px`, top: `${this.state.y}px`}}\n className={cx(`ContextMenu-menu`, fadeStyles[status])}\n >\n <ul className={cx('ContextMenu-list')}>\n {this.renderMenus(this.state.menus)}\n </ul>\n </div>\n </div>\n )}\n </Transition>\n );\n }\n}\n\nexport const ThemedContextMenu = themeable(ContextMenu);\nexport default ThemedContextMenu;\n\nexport function openContextMenus(\n info: Event | {x: number; y: number},\n menus: Array<MenuItem | MenuDivider>,\n onClose?: () => void\n) {\n return ContextMenu.getInstance().openContextMenus(info, menus, onClose);\n}\n"
|
12
12
|
]
|
13
13
|
}
|