@luomus/laji-form 15.1.55 → 15.1.56
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/dist/laji-form.js +1 -1
- package/dist/styles.css +6 -3
- package/lib/ReactContext.js +20 -1
- package/lib/components/LajiForm.js +47 -25
- package/lib/components/VirtualSchemaField.d.ts +1 -1
- package/lib/components/VirtualSchemaField.js +25 -3
- package/lib/components/components/Affix.d.ts +38 -0
- package/lib/components/components/Affix.js +155 -0
- package/lib/components/components/Button.d.ts +14 -0
- package/lib/components/components/Button.js +46 -0
- package/lib/components/components/DeleteButton.d.ts +36 -0
- package/lib/components/components/DeleteButton.js +132 -0
- package/lib/components/components/ErrorPanel.d.ts +29 -0
- package/lib/components/components/ErrorPanel.js +75 -0
- package/lib/components/components/FailedBackgroundJobsPanel.d.ts +24 -0
- package/lib/components/components/FailedBackgroundJobsPanel.js +97 -0
- package/lib/components/components/FetcherInput.d.ts +14 -0
- package/lib/components/components/FetcherInput.js +62 -0
- package/lib/components/components/Fullscreen.d.ts +14 -0
- package/lib/components/components/Fullscreen.js +43 -0
- package/lib/components/components/GlyphButton.d.ts +10 -0
- package/lib/components/components/GlyphButton.js +46 -0
- package/lib/components/components/Help.d.ts +19 -0
- package/lib/components/components/Help.js +54 -0
- package/lib/components/components/Label.d.ts +12 -0
- package/lib/components/components/Label.js +59 -0
- package/lib/components/components/OverlayTrigger.d.ts +36 -0
- package/lib/components/components/OverlayTrigger.js +90 -0
- package/lib/components/components/Stretch.d.ts +36 -0
- package/lib/components/components/Stretch.js +115 -0
- package/lib/components/components/TooltipComponent.d.ts +12 -0
- package/lib/components/components/TooltipComponent.js +38 -0
- package/lib/components/components/index.d.ts +13 -0
- package/lib/components/components/index.js +25 -0
- package/lib/components/fields/AnnotationField.js +30 -8
- package/lib/components/fields/AnyToBooleanField.js +21 -2
- package/lib/components/fields/ArrayBulkField.js +25 -3
- package/lib/components/fields/ArrayCombinerField.js +27 -5
- package/lib/components/fields/ArrayField.js +27 -5
- package/lib/components/fields/ArrayPropertySumField.js +25 -3
- package/lib/components/fields/AsArrayField.js +25 -3
- package/lib/components/fields/AudioArrayField.js +28 -6
- package/lib/components/fields/AutoArrayField.js +25 -3
- package/lib/components/fields/AutosuggestField.js +27 -5
- package/lib/components/fields/CombinedValueDisplayField.js +25 -3
- package/lib/components/fields/CondensedObjectField.d.ts +1 -1
- package/lib/components/fields/CondensedObjectField.js +29 -7
- package/lib/components/fields/ConditionalOnChangeField.js +25 -3
- package/lib/components/fields/ConditionalUiSchemaField.js +27 -5
- package/lib/components/fields/ContextInjectionField.js +26 -4
- package/lib/components/fields/DataLeakerField.js +25 -3
- package/lib/components/fields/DefaultValueArrayField.js +26 -4
- package/lib/components/fields/DependentBooleanField.js +26 -4
- package/lib/components/fields/DependentDisableField.js +26 -4
- package/lib/components/fields/EnumRangeArrayField.js +25 -3
- package/lib/components/fields/ExtraLabelRowField.d.ts +1 -3
- package/lib/components/fields/ExtraLabelRowField.js +29 -12
- package/lib/components/fields/FakePropertyField.js +25 -3
- package/lib/components/fields/FilterArrayField.js +25 -3
- package/lib/components/fields/FlatField.js +26 -4
- package/lib/components/fields/GeocoderField.js +32 -10
- package/lib/components/fields/GridLayoutField.js +21 -2
- package/lib/components/fields/HiddenField.js +21 -2
- package/lib/components/fields/HiddenWithTextField.js +21 -2
- package/lib/components/fields/ImageArrayField.js +41 -19
- package/lib/components/fields/ImageDisplayField.js +26 -4
- package/lib/components/fields/InitiallyHiddenField.js +26 -4
- package/lib/components/fields/InjectDefaultValueField.js +26 -4
- package/lib/components/fields/InjectField.js +25 -3
- package/lib/components/fields/InputWithDefaultValueButtonField.js +27 -5
- package/lib/components/fields/LocalityField.js +27 -5
- package/lib/components/fields/LocationChooserField.js +27 -5
- package/lib/components/fields/MapArrayField.js +33 -12
- package/lib/components/fields/MapField.js +29 -8
- package/lib/components/fields/MultiAnyToBooleanField.js +26 -4
- package/lib/components/fields/MultiArrayField.js +26 -4
- package/lib/components/fields/MultiLanguageField.js +25 -3
- package/lib/components/fields/MultiTagArrayField.d.ts +2 -5
- package/lib/components/fields/MultiTagArrayField.js +34 -19
- package/lib/components/fields/NamedPlaceChooserField.js +31 -9
- package/lib/components/fields/NamedPlaceSaverField.js +33 -11
- package/lib/components/fields/NestField.js +28 -6
- package/lib/components/fields/ObjectField.js +24 -2
- package/lib/components/fields/PdfArrayField.js +20 -1
- package/lib/components/fields/PrefillingArrayField.js +25 -3
- package/lib/components/fields/SchemaField.js +20 -1
- package/lib/components/fields/ScopeField.js +30 -8
- package/lib/components/fields/SectionArrayField.js +34 -13
- package/lib/components/fields/SelectTreeField.js +20 -1
- package/lib/components/fields/SingleActiveArrayField.js +41 -26
- package/lib/components/fields/SingleItemArrayField.js +25 -3
- package/lib/components/fields/SortArrayField.js +31 -9
- package/lib/components/fields/SplitField.js +26 -4
- package/lib/components/fields/StringToArrayField.js +25 -3
- package/lib/components/fields/SumField.js +25 -3
- package/lib/components/fields/TableField.js +26 -4
- package/lib/components/fields/TagArrayField.d.ts +1 -1
- package/lib/components/fields/TagArrayField.js +28 -6
- package/lib/components/fields/ToggleAdditionalArrayFieldsField.js +26 -4
- package/lib/components/fields/UiFieldApplierField.js +25 -3
- package/lib/components/fields/UiFieldMapperArrayField.js +25 -3
- package/lib/components/fields/UnitCountShorthandField.js +29 -7
- package/lib/components/fields/UnitListShorthandArrayField.js +26 -4
- package/lib/components/fields/UnitShorthandField.js +27 -5
- package/lib/components/templates/ArrayFieldTemplate.js +27 -5
- package/lib/components/templates/BaseInputTemplate.js +24 -2
- package/lib/components/templates/DescriptionField.js +21 -2
- package/lib/components/templates/ErrorListTemplate.js +24 -2
- package/lib/components/templates/FieldTemplate.js +24 -2
- package/lib/components/templates/ObjectFieldTemplate.js +24 -2
- package/lib/components/templates/TitleField.js +25 -3
- package/lib/components/widgets/AnyToBooleanWidget.js +21 -2
- package/lib/components/widgets/AutosuggestWidget.js +33 -7
- package/lib/components/widgets/CheckboxWidget.js +25 -3
- package/lib/components/widgets/DateTimeWidget.d.ts +1 -1
- package/lib/components/widgets/DateTimeWidget.js +38 -16
- package/lib/components/widgets/DateWidget.js +27 -5
- package/lib/components/widgets/HiddenWidget.js +21 -2
- package/lib/components/widgets/ImageSelectWidget.js +28 -6
- package/lib/components/widgets/InformalTaxonGroupChooserWidget.js +30 -8
- package/lib/components/widgets/InputGroupWidget.js +27 -5
- package/lib/components/widgets/InputWithDefaultValueButtonWidget.js +26 -4
- package/lib/components/widgets/NumberWidget.js +25 -3
- package/lib/components/widgets/PlainTextWidget.js +21 -2
- package/lib/components/widgets/SelectWidget.js +26 -4
- package/lib/components/widgets/SeparatedDateTimeWidget.js +28 -6
- package/lib/components/widgets/TaxonImageWidget.js +21 -2
- package/lib/components/widgets/TextSelectWidget.js +27 -5
- package/lib/components/widgets/TextareaWidget.js +26 -4
- package/lib/components/widgets/TimeWidget.js +28 -6
- package/lib/components/widgets/URLWidget.js +21 -2
- package/lib/components/widgets/UpperCaseWidget.js +25 -3
- package/lib/index.js +24 -2
- package/lib/services/id-service.d.ts +1 -1
- package/lib/services/id-service.js +1 -1
- package/lib/services/key-handler-service.js +4 -1
- package/lib/services/singleton-map-service.js +4 -1
- package/lib/services/submit-hook-service.d.ts +4 -2
- package/lib/services/submit-hook-service.js +1 -0
- package/lib/themes/bs3.js +94 -72
- package/lib/themes/bs5.js +20 -1
- package/lib/themes/stub.js +20 -1
- package/lib/themes/theme.d.ts +5 -3
- package/lib/utils.js +27 -5
- package/lib/validation.js +20 -1
- package/package.json +1 -1
- package/test-export/test-utils.js +20 -1
- package/lib/components/components.d.ts +0 -129
- package/lib/components/components.js +0 -633
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export declare type PanelError = {
|
|
3
|
+
label: string;
|
|
4
|
+
error: Error | string;
|
|
5
|
+
id?: string;
|
|
6
|
+
getId: () => string;
|
|
7
|
+
extra: React.ReactNode[] | null;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare type Props = {
|
|
11
|
+
errors: PanelError[];
|
|
12
|
+
title: string;
|
|
13
|
+
clickHandler: (id?: string) => void;
|
|
14
|
+
poppedToggle: React.MouseEventHandler;
|
|
15
|
+
showToggle?: boolean;
|
|
16
|
+
classNames?: string;
|
|
17
|
+
footer?: React.ReactNode;
|
|
18
|
+
};
|
|
19
|
+
declare type State = {
|
|
20
|
+
expanded: boolean;
|
|
21
|
+
};
|
|
22
|
+
export declare class ErrorPanel extends React.Component<Props, State> {
|
|
23
|
+
static contextType: React.Context<import("../../ReactContext").ContextProps>;
|
|
24
|
+
constructor(props: Props);
|
|
25
|
+
expand: () => void;
|
|
26
|
+
collapseToggle: () => void;
|
|
27
|
+
render(): JSX.Element | null;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.ErrorPanel = void 0;
|
|
26
|
+
const React = __importStar(require("react"));
|
|
27
|
+
const ReactContext_1 = __importDefault(require("../../ReactContext"));
|
|
28
|
+
const components_1 = require("../components");
|
|
29
|
+
class ErrorPanel extends React.Component {
|
|
30
|
+
constructor(props) {
|
|
31
|
+
super(props);
|
|
32
|
+
this.expand = () => {
|
|
33
|
+
if (!this.state.expanded)
|
|
34
|
+
this.setState({ expanded: true });
|
|
35
|
+
};
|
|
36
|
+
this.collapseToggle = () => this.setState({ expanded: !this.state.expanded });
|
|
37
|
+
this.state = { expanded: true };
|
|
38
|
+
}
|
|
39
|
+
render() {
|
|
40
|
+
const { errors, title, clickHandler, poppedToggle, showToggle, classNames, footer } = this.props;
|
|
41
|
+
if (errors.length === 0)
|
|
42
|
+
return null;
|
|
43
|
+
const { Panel, ListGroup } = this.context.theme;
|
|
44
|
+
return (React.createElement(Panel, { collapsible: "true", onToggle: this.collapseToggle, className: classNames },
|
|
45
|
+
React.createElement(Panel.Heading, null,
|
|
46
|
+
React.createElement("div", { className: "laji-form-clickable-panel-header", onClick: this.collapseToggle },
|
|
47
|
+
React.createElement("div", { className: "panel-title" },
|
|
48
|
+
title,
|
|
49
|
+
React.createElement("span", { className: "pull-right" },
|
|
50
|
+
React.createElement(components_1.GlyphButton, { glyph: this.state.expanded ? "chevron-up" : "chevron-down", variant: "link" }),
|
|
51
|
+
showToggle ? React.createElement(components_1.GlyphButton, { glyph: "new-window", variant: "link", onClick: poppedToggle }) : null)))),
|
|
52
|
+
React.createElement(Panel.Collapse, { in: this.state.expanded },
|
|
53
|
+
React.createElement(ListGroup, null, errors.map((props, i) => React.createElement(ErrorPanelError, Object.assign({ key: i, clickHandler: clickHandler }, props))))),
|
|
54
|
+
footer
|
|
55
|
+
? (React.createElement(Panel.Footer, null, footer))
|
|
56
|
+
: null));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.ErrorPanel = ErrorPanel;
|
|
60
|
+
ErrorPanel.contextType = ReactContext_1.default;
|
|
61
|
+
function ErrorPanelError({ label, error, id, getId, extra = null, disabled, clickHandler }) {
|
|
62
|
+
const message = error && error.message ? error.message : error;
|
|
63
|
+
const _clickHandler = React.useCallback(() => {
|
|
64
|
+
clickHandler(id || (getId ? getId() : undefined));
|
|
65
|
+
}, [clickHandler, id, getId]);
|
|
66
|
+
const { ListGroupItem } = React.useContext(ReactContext_1.default).theme;
|
|
67
|
+
return (React.createElement(ListGroupItem, { onClick: _clickHandler, disabled: disabled },
|
|
68
|
+
label ? React.createElement("b", null,
|
|
69
|
+
label,
|
|
70
|
+
":") : null,
|
|
71
|
+
" ",
|
|
72
|
+
message,
|
|
73
|
+
" ",
|
|
74
|
+
extra));
|
|
75
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { FormContext } from "../LajiForm";
|
|
3
|
+
import { FieldProps } from "../../types";
|
|
4
|
+
import { SubmitHook } from "../../services/submit-hook-service";
|
|
5
|
+
declare type Props = {
|
|
6
|
+
schema: FieldProps["schema"];
|
|
7
|
+
uiSchema: FieldProps["schema"];
|
|
8
|
+
formContext: FormContext;
|
|
9
|
+
jobs?: SubmitHook[];
|
|
10
|
+
errorClickHandler: (id?: string | undefined) => void;
|
|
11
|
+
};
|
|
12
|
+
declare type State = {
|
|
13
|
+
popped: boolean;
|
|
14
|
+
poppedTouched?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare class FailedBackgroundJobsPanel extends React.Component<Props, State> {
|
|
17
|
+
static contextType: React.Context<import("../../ReactContext").ContextProps>;
|
|
18
|
+
constructor(props: Props);
|
|
19
|
+
dismissFailedJob: ({ hook, running }: SubmitHook) => (e: React.MouseEvent) => void;
|
|
20
|
+
retryFailedJob: ({ hook, running }: SubmitHook) => (e: React.MouseEvent) => void;
|
|
21
|
+
poppedToggle: (e: React.MouseEvent) => void;
|
|
22
|
+
render(): JSX.Element | null;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.FailedBackgroundJobsPanel = void 0;
|
|
26
|
+
const React = __importStar(require("react"));
|
|
27
|
+
const ReactContext_1 = __importDefault(require("../../ReactContext"));
|
|
28
|
+
const components_1 = require("../components");
|
|
29
|
+
const utils_1 = require("../../utils");
|
|
30
|
+
class FailedBackgroundJobsPanel extends React.Component {
|
|
31
|
+
constructor(props) {
|
|
32
|
+
super(props);
|
|
33
|
+
this.dismissFailedJob = ({ hook, running }) => (e) => {
|
|
34
|
+
e.stopPropagation();
|
|
35
|
+
if (running)
|
|
36
|
+
return;
|
|
37
|
+
this.props.formContext.services.submitHooks.remove(undefined, hook);
|
|
38
|
+
};
|
|
39
|
+
this.retryFailedJob = ({ hook, running }) => (e) => {
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
if (running)
|
|
42
|
+
return;
|
|
43
|
+
hook();
|
|
44
|
+
};
|
|
45
|
+
this.poppedToggle = (e) => {
|
|
46
|
+
e.stopPropagation();
|
|
47
|
+
this.setState({ popped: !this.state.popped, poppedTouched: true });
|
|
48
|
+
};
|
|
49
|
+
this.state = { popped: true };
|
|
50
|
+
}
|
|
51
|
+
render() {
|
|
52
|
+
const { jobs = [], schema, uiSchema = {}, formContext: { translations } } = this.props;
|
|
53
|
+
if (!jobs.length)
|
|
54
|
+
return null;
|
|
55
|
+
const { Glyphicon } = this.context.theme;
|
|
56
|
+
const errors = jobs.reduce((_errors, error) => {
|
|
57
|
+
const { lajiFormId, relativePointer, e, running } = error;
|
|
58
|
+
if (!e) {
|
|
59
|
+
return _errors;
|
|
60
|
+
}
|
|
61
|
+
const getJsonPointer = () => this.props.formContext.services.ids.getJSONPointerFromLajiFormIdAndRelativePointer(lajiFormId, relativePointer);
|
|
62
|
+
const jsonPointer = getJsonPointer();
|
|
63
|
+
const label = utils_1.parseJSONPointer(uiSchema, `${utils_1.uiSchemaJSONPointer(uiSchema, jsonPointer)}/ui:title`, true)
|
|
64
|
+
|| utils_1.parseJSONPointer(schema, `${utils_1.schemaJSONPointer(schema, jsonPointer)}/title`, true);
|
|
65
|
+
const retryButton = React.createElement(components_1.Button, { key: "retry", className: "pull-right", variant: "link", small: true, disabled: running, onClick: this.retryFailedJob(error) },
|
|
66
|
+
React.createElement(Glyphicon, { className: running ? "rotating" : "", glyph: "refresh" }),
|
|
67
|
+
" ",
|
|
68
|
+
translations.Retry);
|
|
69
|
+
const dismissButton = React.createElement(components_1.Button, { key: "dismiss", className: "pull-right", variant: "link", small: true, onClick: this.dismissFailedJob(error) },
|
|
70
|
+
React.createElement(Glyphicon, { glyph: "ok" }),
|
|
71
|
+
" ",
|
|
72
|
+
translations.Dismiss);
|
|
73
|
+
const getId = () => {
|
|
74
|
+
const jsonPointer = getJsonPointer();
|
|
75
|
+
return `root_${utils_1.JSONPointerToId(jsonPointer)}`;
|
|
76
|
+
};
|
|
77
|
+
const _error = {
|
|
78
|
+
getId,
|
|
79
|
+
error: e,
|
|
80
|
+
extra: [dismissButton, retryButton],
|
|
81
|
+
disabled: running,
|
|
82
|
+
label
|
|
83
|
+
};
|
|
84
|
+
return [..._errors, _error];
|
|
85
|
+
}, []);
|
|
86
|
+
if (!errors.length)
|
|
87
|
+
return null;
|
|
88
|
+
const footer = (React.createElement(components_1.Button, { onClick: this.props.formContext.services.submitHooks.removeAll },
|
|
89
|
+
React.createElement(Glyphicon, { glyph: "ok" }),
|
|
90
|
+
" ",
|
|
91
|
+
`${translations.Dismiss} ${translations.all}`));
|
|
92
|
+
return (React.createElement("div", { className: `laji-form-error-list laji-form-failed-jobs-list${this.state.popped ? " laji-form-popped" : ""}`, style: this.state.popped ? { top: (this.props.formContext.topOffset || 0) + 5 } : undefined },
|
|
93
|
+
React.createElement(components_1.ErrorPanel, { title: translations.FailedBackgroundJobs, errors: errors, showToggle: true, poppedToggle: this.poppedToggle, clickHandler: this.props.errorClickHandler, classNames: "error-panel", footer: footer })));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.FailedBackgroundJobsPanel = FailedBackgroundJobsPanel;
|
|
97
|
+
FailedBackgroundJobsPanel.contextType = ReactContext_1.default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ValidationState } from "../../themes/theme";
|
|
3
|
+
declare type Props = {
|
|
4
|
+
loading?: boolean;
|
|
5
|
+
validationState?: ValidationState;
|
|
6
|
+
glyph?: React.ReactNode | null;
|
|
7
|
+
onMouseOver?: React.MouseEventHandler;
|
|
8
|
+
onMouseOut?: React.MouseEventHandler;
|
|
9
|
+
className?: string;
|
|
10
|
+
InputComponent?: React.ComponentType | null;
|
|
11
|
+
extra?: React.ReactNode | React.ReactNode[] | null;
|
|
12
|
+
};
|
|
13
|
+
export declare const FetcherInput: React.ForwardRefExoticComponent<Props & React.RefAttributes<unknown>>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
22
|
+
var t = {};
|
|
23
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
24
|
+
t[p] = s[p];
|
|
25
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
26
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
27
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
28
|
+
t[p[i]] = s[p[i]];
|
|
29
|
+
}
|
|
30
|
+
return t;
|
|
31
|
+
};
|
|
32
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
33
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
34
|
+
};
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.FetcherInput = void 0;
|
|
37
|
+
const React = __importStar(require("react"));
|
|
38
|
+
const react_1 = require("react");
|
|
39
|
+
const ReactContext_1 = __importDefault(require("../../ReactContext"));
|
|
40
|
+
const utils_1 = require("../../utils");
|
|
41
|
+
const react_spinner_1 = __importDefault(require("react-spinner"));
|
|
42
|
+
exports.FetcherInput = react_1.forwardRef((props, ref) => {
|
|
43
|
+
const { loading, validationState, glyph, extra, onMouseOver, onMouseOut, className = "", InputComponent } = props, inputProps = __rest(props, ["loading", "validationState", "glyph", "extra", "onMouseOver", "onMouseOut", "className", "InputComponent"]); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
44
|
+
const { InputGroup, FormGroup } = react_1.useContext(ReactContext_1.default).theme;
|
|
45
|
+
const Input = InputComponent ? InputComponent : FetcherInputDefaultInput;
|
|
46
|
+
const _extra = (!Array.isArray(extra)) ? [extra] : extra;
|
|
47
|
+
const hasExtras = _extra.some(item => item !== null && item !== undefined);
|
|
48
|
+
const inputContent = React.createElement(React.Fragment, null,
|
|
49
|
+
hasExtras && React.createElement(InputGroup.Button, null, _extra),
|
|
50
|
+
React.createElement(Input, Object.assign({}, inputProps, { ref: ref })),
|
|
51
|
+
glyph,
|
|
52
|
+
loading && React.createElement(react_spinner_1.default, null));
|
|
53
|
+
const content = hasExtras
|
|
54
|
+
? (React.createElement(InputGroup, null, inputContent))
|
|
55
|
+
: inputContent;
|
|
56
|
+
return (React.createElement(FormGroup, { onMouseOver: onMouseOver, onMouseOut: onMouseOut, validationState: validationState, className: utils_1.classNames(className, "fetcher-input") }, content));
|
|
57
|
+
});
|
|
58
|
+
const FetcherInputDefaultInput = React.forwardRef((props, ref) => {
|
|
59
|
+
const { readonly } = props, inputProps = __rest(props, ["readonly"]);
|
|
60
|
+
const { FormControl } = react_1.useContext(ReactContext_1.default).theme;
|
|
61
|
+
return React.createElement(FormControl, Object.assign({ type: "text" }, inputProps, { readOnly: readonly, ref: ref }));
|
|
62
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { FormContext } from "../LajiForm";
|
|
3
|
+
declare type Props = {
|
|
4
|
+
formContext: FormContext;
|
|
5
|
+
onKeyDown: React.KeyboardEventHandler;
|
|
6
|
+
};
|
|
7
|
+
export declare class Fullscreen extends React.Component<Props> {
|
|
8
|
+
bodyOverFlow: string;
|
|
9
|
+
_onKeyDown?: boolean;
|
|
10
|
+
componentDidMount(): void;
|
|
11
|
+
componentWillUnmount(): void;
|
|
12
|
+
render(): React.ReactPortal;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.Fullscreen = void 0;
|
|
23
|
+
const React = __importStar(require("react"));
|
|
24
|
+
const react_dom_1 = require("react-dom");
|
|
25
|
+
class Fullscreen extends React.Component {
|
|
26
|
+
componentDidMount() {
|
|
27
|
+
this.bodyOverFlow = document.body.style.overflow;
|
|
28
|
+
if (this.props.onKeyDown) {
|
|
29
|
+
this._onKeyDown = true;
|
|
30
|
+
this.props.formContext.services.keyHandler.addGlobalEventHandler("keydown", this.props.onKeyDown);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
componentWillUnmount() {
|
|
34
|
+
document.body.style.overflow = this.bodyOverFlow;
|
|
35
|
+
if (this._onKeyDown) {
|
|
36
|
+
this.props.formContext.services.keyHandler.removeGlobalEventHandler("keydown", this.props.onKeyDown);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
render() {
|
|
40
|
+
return react_dom_1.createPortal((React.createElement("div", { className: "laji-form fullscreen" }, this.props.children)), document.body);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.Fullscreen = Fullscreen;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Glyph } from "../../themes/theme";
|
|
3
|
+
export declare const GlyphButton: React.ForwardRefExoticComponent<Pick<import("../../themes/theme").ButtonProps & {
|
|
4
|
+
tooltip?: string | undefined;
|
|
5
|
+
tooltipPlacement?: string | undefined;
|
|
6
|
+
tooltipTrigger?: string | undefined;
|
|
7
|
+
tooltipClass?: string | undefined;
|
|
8
|
+
} & {
|
|
9
|
+
glyph: Glyph;
|
|
10
|
+
}, "small" | "active" | "style" | "disabled" | "block" | "tooltip" | "children" | "key" | "id" | "className" | "onKeyDown" | "onClick" | "tooltipPlacement" | "tooltipTrigger" | "tooltipClass" | "variant" | "glyph"> & React.RefAttributes<unknown>>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
22
|
+
var t = {};
|
|
23
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
24
|
+
t[p] = s[p];
|
|
25
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
26
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
27
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
28
|
+
t[p[i]] = s[p[i]];
|
|
29
|
+
}
|
|
30
|
+
return t;
|
|
31
|
+
};
|
|
32
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
33
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
34
|
+
};
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.GlyphButton = void 0;
|
|
37
|
+
const React = __importStar(require("react"));
|
|
38
|
+
const ReactContext_1 = __importDefault(require("../../ReactContext"));
|
|
39
|
+
const components_1 = require("../components");
|
|
40
|
+
exports.GlyphButton = React.forwardRef((props, ref) => {
|
|
41
|
+
const { glyph } = props, buttonProps = __rest(props, ["glyph"]);
|
|
42
|
+
const { Glyphicon } = React.useContext(ReactContext_1.default).theme;
|
|
43
|
+
return (React.createElement(components_1.Button, Object.assign({}, buttonProps, { ref: ref, className: `glyph-button${props.className ? ` ${props.className}` : ""}`, tooltipPlacement: props.tooltipPlacement || "left" }),
|
|
44
|
+
React.createElement(Glyphicon, { glyph: glyph }),
|
|
45
|
+
props.children));
|
|
46
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare type Props = {
|
|
3
|
+
help?: string;
|
|
4
|
+
id: string;
|
|
5
|
+
focusable?: boolean;
|
|
6
|
+
onFocus?: () => void;
|
|
7
|
+
onBlur?: () => void;
|
|
8
|
+
className?: string;
|
|
9
|
+
onClick?: React.MouseEventHandler;
|
|
10
|
+
standalone?: boolean;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* @param standalone If provided, the help icon will handle **accessibility** itself.
|
|
14
|
+
* If not provided, the parent element must take care of showing the tooltip.
|
|
15
|
+
*
|
|
16
|
+
* **accessibility** means that it handles showing the tooltip on focus & hover, and
|
|
17
|
+
*/
|
|
18
|
+
export declare function Help({ help, id, focusable, onFocus, onBlur, className, onClick, standalone }: Props): JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.Help = void 0;
|
|
26
|
+
const React = __importStar(require("react"));
|
|
27
|
+
const react_1 = require("react");
|
|
28
|
+
const ReactContext_1 = __importDefault(require("../../ReactContext"));
|
|
29
|
+
const utils_1 = require("../../utils");
|
|
30
|
+
const components_1 = require("../components");
|
|
31
|
+
/**
|
|
32
|
+
* @param standalone If provided, the help icon will handle **accessibility** itself.
|
|
33
|
+
* If not provided, the parent element must take care of showing the tooltip.
|
|
34
|
+
*
|
|
35
|
+
* **accessibility** means that it handles showing the tooltip on focus & hover, and
|
|
36
|
+
*/
|
|
37
|
+
function Help({ help, id, focusable = false, onFocus, onBlur, className, onClick, standalone }) {
|
|
38
|
+
const { Tooltip } = react_1.useContext(ReactContext_1.default).theme;
|
|
39
|
+
const [focused, setFocused] = React.useState(false);
|
|
40
|
+
const onHelpFocus = React.useCallback(() => {
|
|
41
|
+
setFocused(true);
|
|
42
|
+
}, []);
|
|
43
|
+
const onHelpBlur = React.useCallback(() => {
|
|
44
|
+
setFocused(false);
|
|
45
|
+
}, []);
|
|
46
|
+
const helpGlyph = React.createElement("span", { className: utils_1.classNames("laji-form-help-glyph", "text-muted", className), tabIndex: focusable ? 0 : -1, onFocus: standalone ? onHelpFocus : onFocus, onBlur: standalone ? onHelpBlur : onBlur, onClick: onClick });
|
|
47
|
+
const tooltip = React.createElement(Tooltip, { id: id },
|
|
48
|
+
React.createElement("span", { dangerouslySetInnerHTML: { __html: help || "" } }));
|
|
49
|
+
return help ? (React.createElement(components_1.OverlayTrigger, { placement: "right", overlay: tooltip, show: standalone && focused || undefined },
|
|
50
|
+
React.createElement(React.Fragment, null,
|
|
51
|
+
helpGlyph,
|
|
52
|
+
standalone && React.createElement("div", { id: `${id}--help`, style: { display: "none" } }, help)))) : helpGlyph;
|
|
53
|
+
}
|
|
54
|
+
exports.Help = Help;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { FieldProps } from "../../types";
|
|
3
|
+
declare type Props = {
|
|
4
|
+
label: string;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
id: string;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
registry?: FieldProps["registry"] | Record<string, never>;
|
|
9
|
+
uiSchema?: any;
|
|
10
|
+
};
|
|
11
|
+
export declare function Label({ label, children, id, required, registry, uiSchema }: Props): JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.Label = void 0;
|
|
26
|
+
const React = __importStar(require("react"));
|
|
27
|
+
const react_1 = require("react");
|
|
28
|
+
const ReactContext_1 = __importDefault(require("../../ReactContext"));
|
|
29
|
+
const components_1 = require("../components");
|
|
30
|
+
function Label({ label, children, id, required, registry = {}, uiSchema = {} }) {
|
|
31
|
+
const { "ui:help": help, "ui:helpHoverable": helpHoverable, "ui:helpPlacement": helpPlacement, labelComponent } = uiSchema;
|
|
32
|
+
const showHelp = label && help;
|
|
33
|
+
const { Tooltip } = react_1.useContext(ReactContext_1.default).theme;
|
|
34
|
+
const tooltipElem = (React.createElement(Tooltip, { id: id + "-tooltip" }, help ? (React.createElement("span", null,
|
|
35
|
+
React.createElement("strong", { dangerouslySetInnerHTML: { __html: label } }),
|
|
36
|
+
React.createElement("br", null),
|
|
37
|
+
React.createElement("span", { dangerouslySetInnerHTML: { __html: help } }))) : label));
|
|
38
|
+
const requiredHtml = required ? "<span class='text-danger'>*</span>" : "";
|
|
39
|
+
const [focused, setFocused] = React.useState(false);
|
|
40
|
+
const onHelpFocus = React.useCallback(() => {
|
|
41
|
+
setFocused(true);
|
|
42
|
+
}, []);
|
|
43
|
+
const onHelpBlur = React.useCallback(() => {
|
|
44
|
+
setFocused(false);
|
|
45
|
+
}, []);
|
|
46
|
+
const onHelpClick = React.useCallback((e) => {
|
|
47
|
+
e.preventDefault();
|
|
48
|
+
}, []);
|
|
49
|
+
const LabelComponent = labelComponent || "label";
|
|
50
|
+
const labelElem = (React.createElement(LabelComponent, { htmlFor: id, "aria-describedby": `${id}--help` },
|
|
51
|
+
React.createElement("div", { style: { whiteSpace: "normal" } },
|
|
52
|
+
React.createElement("span", { dangerouslySetInnerHTML: { __html: label + requiredHtml } }),
|
|
53
|
+
showHelp ? React.createElement(components_1.Help, { focusable: true, onFocus: onHelpFocus, onBlur: onHelpBlur, onClick: onHelpClick, id: id }) : null),
|
|
54
|
+
children));
|
|
55
|
+
return help ? React.createElement(React.Fragment, null,
|
|
56
|
+
React.createElement(components_1.OverlayTrigger, { placement: helpPlacement || "right", overlay: tooltipElem, hoverable: helpHoverable, formContext: registry.formContext, show: focused || undefined, style: { display: "inline-block" } }, labelElem),
|
|
57
|
+
React.createElement("div", { id: `${id}--help`, style: { display: "none" } }, help)) : labelElem;
|
|
58
|
+
}
|
|
59
|
+
exports.Label = Label;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { OverlayTriggerProps } from "../../themes/theme";
|
|
3
|
+
import { FormContext } from "../LajiForm";
|
|
4
|
+
declare type IsHoverableProps = {
|
|
5
|
+
hoverable: true;
|
|
6
|
+
formContext: FormContext;
|
|
7
|
+
};
|
|
8
|
+
declare type IsNotHoverableProps = {
|
|
9
|
+
hoverable?: false;
|
|
10
|
+
formContext?: FormContext;
|
|
11
|
+
};
|
|
12
|
+
declare type Props = OverlayTriggerProps & (IsHoverableProps | IsNotHoverableProps) & {
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
};
|
|
15
|
+
declare type State = {
|
|
16
|
+
hoveringElem?: boolean;
|
|
17
|
+
hoveringOverlay?: boolean;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* OverlayTrigger that is hoverable if `hoverable: true`
|
|
21
|
+
*
|
|
22
|
+
* If you pass `hoverable: true`, you must also pass `formContext`.
|
|
23
|
+
*/
|
|
24
|
+
export declare class OverlayTrigger extends React.Component<Props, State> {
|
|
25
|
+
static contextType: React.Context<import("../../ReactContext").ContextProps>;
|
|
26
|
+
overlayTimeout?: ReturnType<FormContext["setTimeout"]>;
|
|
27
|
+
popoverMouseIn?: boolean;
|
|
28
|
+
constructor(props: Props);
|
|
29
|
+
componentWillUnmount(): void;
|
|
30
|
+
overlayTriggerMouseOver: () => void;
|
|
31
|
+
overlayTriggerMouseOut: () => void;
|
|
32
|
+
overlayMouseOver: () => void;
|
|
33
|
+
overlayMouseOut: () => void;
|
|
34
|
+
render(): JSX.Element;
|
|
35
|
+
}
|
|
36
|
+
export {};
|