@monolith-forensics/monolith-ui 1.8.1-dev.4 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Button/Button.js +58 -9
- package/dist/Calendar/Calendar.d.ts +2 -7
- package/dist/Calendar/Calendar.js +49 -226
- package/dist/Calendar/CalendarStyles.d.ts +2 -6
- package/dist/Calendar/CalendarStyles.js +33 -153
- package/dist/Calendar/calendarHelpers.d.ts +2 -6
- package/dist/Calendar/calendarHelpers.js +5 -13
- package/dist/CheckBox/CheckBox.js +19 -36
- package/dist/DateInput/DateInput.js +143 -198
- package/dist/DropDownMenu/DropDownMenu.js +15 -25
- package/dist/DropDownMenu/components/MenuComponent.js +2 -8
- package/dist/DropDownMenu/components/MenuItem.d.ts +0 -2
- package/dist/DropDownMenu/components/MenuItem.js +21 -25
- package/dist/DropDownMenu/components/MenuItemList.d.ts +0 -3
- package/dist/DropDownMenu/components/MenuItemList.js +86 -192
- package/dist/DropDownMenu/components/StyledContent.js +2 -1
- package/dist/DropDownMenu/components/StyledFloatContainer.js +1 -1
- package/dist/DropDownMenu/types.d.ts +0 -3
- package/dist/FieldLabel/FieldLabel.js +12 -4
- package/dist/FileInputField/FileInputField.js +23 -4
- package/dist/FileViewer/viewers/ImageViewer.js +18 -75
- package/dist/FormSection/FormSection.js +25 -5
- package/dist/IconButton/IconButton.js +16 -2
- package/dist/Input/Input.js +56 -7
- package/dist/MonolithUIProvider/MonolithUIProvider.d.ts +0 -1
- package/dist/Pill/Pill.js +79 -8
- package/dist/Popover/Popover.context.d.ts +1 -2
- package/dist/Popover/Popover.js +2 -5
- package/dist/Popover/Popover.styles.d.ts +6 -1
- package/dist/Popover/Popover.styles.js +28 -11
- package/dist/Popover/Popover.transitions.d.ts +2 -4
- package/dist/Popover/Popover.transitions.js +49 -23
- package/dist/Popover/PopoverDropdown.js +8 -6
- package/dist/Popover/PopoverTarget.js +3 -6
- package/dist/QueryFilter/DefaultOperators.d.ts +76 -0
- package/dist/QueryFilter/DefaultOperators.js +21 -0
- package/dist/QueryFilter/QueryFilter.d.ts +1 -1
- package/dist/QueryFilter/QueryFilter.js +303 -3
- package/dist/QueryFilter/index.d.ts +2 -3
- package/dist/QueryFilter/index.js +2 -3
- package/dist/QueryFilter/{QueryFilter.types.d.ts → types.d.ts} +2 -11
- package/dist/QueryFilter/useQueryFilter.d.ts +1 -1
- package/dist/QueryFilter/useQueryFilter.js +19 -23
- package/dist/RichTextEditor/Extensions/getTiptapExtensions.js +15 -5
- package/dist/RichTextEditor/Plugins/UploadImagesPlugin.d.ts +0 -15
- package/dist/RichTextEditor/Plugins/UploadImagesPlugin.js +51 -115
- package/dist/RichTextEditor/Plugins/index.d.ts +0 -1
- package/dist/RichTextEditor/Plugins/index.js +0 -1
- package/dist/RichTextEditor/RichTextEditor.d.ts +2 -3
- package/dist/RichTextEditor/RichTextEditor.js +35 -309
- package/dist/RichTextEditor/Toolbar/Toolbar.js +2 -14
- package/dist/SegmentedControl/SegmentedControl.utils.d.ts +2 -2
- package/dist/SegmentedControl/SegmentedControl.utils.js +30 -3
- package/dist/SelectBox/SelectBox.js +5 -5
- package/dist/SelectBox/select-box.styled-components.d.ts +1 -4
- package/dist/SelectBox/select-box.styled-components.js +48 -11
- package/dist/SelectBox/types.d.ts +0 -1
- package/dist/Switch/Switch.d.ts +2 -2
- package/dist/Switch/Switch.js +83 -18
- package/dist/Table/ColumnResizer.d.ts +9 -6
- package/dist/Table/ColumnResizer.js +10 -30
- package/dist/Table/StateStorage.d.ts +0 -4
- package/dist/Table/StateStorage.js +0 -13
- package/dist/Table/Table.js +12 -160
- package/dist/Table/TableComponents.d.ts +0 -10
- package/dist/Table/TableComponents.js +10 -71
- package/dist/Table/TableDefaults.d.ts +0 -7
- package/dist/Table/TableDefaults.js +0 -7
- package/dist/Table/TableHeader.js +16 -31
- package/dist/Table/TableMenu/TableMenu.js +1 -1
- package/dist/Table/TableProvider.js +75 -354
- package/dist/Table/TableRow.js +16 -28
- package/dist/Table/Utils/index.d.ts +1 -0
- package/dist/Table/Utils/index.js +1 -0
- package/dist/Table/Utils/resizeHandler.d.ts +3 -0
- package/dist/Table/Utils/resizeHandler.js +84 -0
- package/dist/Table/types.d.ts +19 -70
- package/dist/Tabs/Tab.js +0 -8
- package/dist/TagBox/TagBox.d.ts +1 -1
- package/dist/TagBox/TagBox.js +208 -50
- package/dist/TagBox/types.d.ts +13 -1
- package/dist/TextArea/TextArea.js +23 -9
- package/dist/TextInput/TextInput.js +6 -12
- package/dist/Utilities/parseTimestamp.js +6 -11
- package/dist/core/ArrowButton.d.ts +0 -2
- package/dist/core/ArrowButton.js +3 -7
- package/dist/core/ClearButton.d.ts +0 -2
- package/dist/core/ClearButton.js +3 -7
- package/dist/core/controlSizes.d.ts +0 -26
- package/dist/core/controlSizes.js +0 -156
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -2
- package/dist/theme/variants.js +0 -2
- package/package.json +18 -26
- package/dist/Charts/BarChart/BarChart.d.ts +0 -5
- package/dist/Charts/BarChart/BarChart.js +0 -549
- package/dist/Charts/BarChart/BarChart.lib.d.ts +0 -31
- package/dist/Charts/BarChart/BarChart.lib.js +0 -136
- package/dist/Charts/BarChart/BarChart.styled.d.ts +0 -51
- package/dist/Charts/BarChart/BarChart.styled.js +0 -115
- package/dist/Charts/BarChart/BarChart.types.d.ts +0 -171
- package/dist/Charts/BarChart/index.d.ts +0 -3
- package/dist/Charts/BarChart/index.js +0 -2
- package/dist/Charts/ChartPrimitives/ChartExportControl.d.ts +0 -11
- package/dist/Charts/ChartPrimitives/ChartExportControl.js +0 -29
- package/dist/Charts/ChartPrimitives/chartActions.styled.d.ts +0 -1
- package/dist/Charts/ChartPrimitives/chartActions.styled.js +0 -8
- package/dist/Charts/ChartPrimitives/chartLegend.styled.d.ts +0 -12
- package/dist/Charts/ChartPrimitives/chartLegend.styled.js +0 -52
- package/dist/Charts/ChartPrimitives/chartTooltip.styled.d.ts +0 -19
- package/dist/Charts/ChartPrimitives/chartTooltip.styled.js +0 -61
- package/dist/Charts/ChartPrimitives/index.d.ts +0 -4
- package/dist/Charts/ChartPrimitives/index.js +0 -4
- package/dist/Charts/ChartUtils/chartColors.d.ts +0 -8
- package/dist/Charts/ChartUtils/chartColors.js +0 -65
- package/dist/Charts/ChartUtils/chartExport.d.ts +0 -47
- package/dist/Charts/ChartUtils/chartExport.js +0 -311
- package/dist/Charts/ChartUtils/chartMath.d.ts +0 -3
- package/dist/Charts/ChartUtils/chartMath.js +0 -3
- package/dist/Charts/ChartUtils/index.d.ts +0 -3
- package/dist/Charts/ChartUtils/index.js +0 -3
- package/dist/Charts/HeatMap/HeatMap.d.ts +0 -5
- package/dist/Charts/HeatMap/HeatMap.js +0 -212
- package/dist/Charts/HeatMap/HeatMap.lib.d.ts +0 -30
- package/dist/Charts/HeatMap/HeatMap.lib.js +0 -115
- package/dist/Charts/HeatMap/HeatMap.styled.d.ts +0 -37
- package/dist/Charts/HeatMap/HeatMap.styled.js +0 -91
- package/dist/Charts/HeatMap/HeatMap.types.d.ts +0 -80
- package/dist/Charts/HeatMap/HeatMap.types.js +0 -1
- package/dist/Charts/HeatMap/index.d.ts +0 -3
- package/dist/Charts/HeatMap/index.js +0 -2
- package/dist/Charts/LineChart/LineChart.d.ts +0 -5
- package/dist/Charts/LineChart/LineChart.js +0 -529
- package/dist/Charts/LineChart/LineChart.lib.d.ts +0 -24
- package/dist/Charts/LineChart/LineChart.lib.js +0 -132
- package/dist/Charts/LineChart/LineChart.styled.d.ts +0 -59
- package/dist/Charts/LineChart/LineChart.styled.js +0 -147
- package/dist/Charts/LineChart/LineChart.types.d.ts +0 -193
- package/dist/Charts/LineChart/LineChart.types.js +0 -1
- package/dist/Charts/LineChart/index.d.ts +0 -3
- package/dist/Charts/LineChart/index.js +0 -2
- package/dist/Charts/PieChart/PieChart.d.ts +0 -4
- package/dist/Charts/PieChart/PieChart.js +0 -199
- package/dist/Charts/PieChart/PieChart.lib.d.ts +0 -5
- package/dist/Charts/PieChart/PieChart.lib.js +0 -19
- package/dist/Charts/PieChart/PieChart.styled.d.ts +0 -51
- package/dist/Charts/PieChart/PieChart.styled.js +0 -163
- package/dist/Charts/PieChart/PieChart.types.d.ts +0 -100
- package/dist/Charts/PieChart/PieChart.types.js +0 -1
- package/dist/Charts/PieChart/index.d.ts +0 -2
- package/dist/Charts/PieChart/index.js +0 -1
- package/dist/Charts/index.d.ts +0 -5
- package/dist/Charts/index.js +0 -4
- package/dist/QueryFilter/QueryFilter.constants.d.ts +0 -134
- package/dist/QueryFilter/QueryFilter.constants.js +0 -39
- package/dist/QueryFilter/QueryFilter.lib.d.ts +0 -14
- package/dist/QueryFilter/QueryFilter.lib.js +0 -84
- package/dist/QueryFilter/QueryFilter.styled.d.ts +0 -89
- package/dist/QueryFilter/QueryFilter.styled.js +0 -184
- package/dist/QueryFilter/QueryFilter.types.js +0 -1
- package/dist/QueryFilter/components/MultiSelectEditor.d.ts +0 -7
- package/dist/QueryFilter/components/MultiSelectEditor.js +0 -44
- package/dist/QueryFilter/components/RuleChip.d.ts +0 -8
- package/dist/QueryFilter/components/RuleChip.js +0 -37
- package/dist/QueryFilter/components/Rules.d.ts +0 -11
- package/dist/QueryFilter/components/Rules.js +0 -41
- package/dist/QueryFilter/components/UnavailableRuleChip.d.ts +0 -5
- package/dist/QueryFilter/components/UnavailableRuleChip.js +0 -7
- package/dist/QueryFilter/components/ValueEditor.d.ts +0 -7
- package/dist/QueryFilter/components/ValueEditor.js +0 -45
- package/dist/QueryFilter/components/ValueSelector.d.ts +0 -7
- package/dist/QueryFilter/components/ValueSelector.js +0 -34
- package/dist/QueryFilter/components/index.d.ts +0 -6
- package/dist/QueryFilter/components/index.js +0 -6
- package/dist/RichTextEditor/Plugins/ImageActionsPlugin.d.ts +0 -3
- package/dist/RichTextEditor/Plugins/ImageActionsPlugin.js +0 -241
- package/dist/SuperDatePicker/SuperDatePicker.constants.d.ts +0 -24
- package/dist/SuperDatePicker/SuperDatePicker.constants.js +0 -30
- package/dist/SuperDatePicker/SuperDatePicker.d.ts +0 -3
- package/dist/SuperDatePicker/SuperDatePicker.js +0 -31
- package/dist/SuperDatePicker/SuperDatePicker.lib.d.ts +0 -17
- package/dist/SuperDatePicker/SuperDatePicker.lib.js +0 -206
- package/dist/SuperDatePicker/SuperDatePicker.styled.d.ts +0 -60
- package/dist/SuperDatePicker/SuperDatePicker.styled.js +0 -256
- package/dist/SuperDatePicker/SuperDatePicker.types.d.ts +0 -48
- package/dist/SuperDatePicker/SuperDatePicker.types.js +0 -1
- package/dist/SuperDatePicker/components/CommonPresetGroups.d.ts +0 -7
- package/dist/SuperDatePicker/components/CommonPresetGroups.js +0 -6
- package/dist/SuperDatePicker/components/EndpointCalendarDropdown.d.ts +0 -10
- package/dist/SuperDatePicker/components/EndpointCalendarDropdown.js +0 -9
- package/dist/SuperDatePicker/components/EndpointDateInput.d.ts +0 -16
- package/dist/SuperDatePicker/components/EndpointDateInput.js +0 -26
- package/dist/SuperDatePicker/components/EndpointPopover.d.ts +0 -18
- package/dist/SuperDatePicker/components/EndpointPopover.js +0 -11
- package/dist/SuperDatePicker/components/QuickRangeDropdown.d.ts +0 -14
- package/dist/SuperDatePicker/components/QuickRangeDropdown.js +0 -19
- package/dist/SuperDatePicker/components/QuickRangePopover.d.ts +0 -18
- package/dist/SuperDatePicker/components/QuickRangePopover.js +0 -12
- package/dist/SuperDatePicker/components/index.d.ts +0 -6
- package/dist/SuperDatePicker/components/index.js +0 -6
- package/dist/SuperDatePicker/index.d.ts +0 -3
- package/dist/SuperDatePicker/index.js +0 -3
- package/dist/SuperDatePicker/useSuperDatePicker.d.ts +0 -32
- package/dist/SuperDatePicker/useSuperDatePicker.js +0 -125
- /package/dist/{Charts/BarChart/BarChart.types.js → QueryFilter/types.js} +0 -0
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useTheme } from "styled-components";
|
|
3
|
-
import { DropDownMenu } from "../../DropDownMenu";
|
|
4
|
-
import { QUERY_FILTER_COMBINATOR_OPTIONS, QUERY_FILTER_COMBINATOR_TITLE, } from "../QueryFilter.constants";
|
|
5
|
-
import { updateRuleOperator } from "../QueryFilter.lib";
|
|
6
|
-
import { RuleChip } from "./RuleChip";
|
|
7
|
-
import { UnavailableRuleChip } from "./UnavailableRuleChip";
|
|
8
|
-
export const Rules = ({ rules = [], combinator, showCombinator, filterDefinitions, onDelete, onUpdate, onUpdateRootCombinator, }) => {
|
|
9
|
-
const theme = useTheme();
|
|
10
|
-
const handleCombinatorChange = (e) => {
|
|
11
|
-
onUpdateRootCombinator(e);
|
|
12
|
-
};
|
|
13
|
-
const handleOperatorChange = (rule, operator) => {
|
|
14
|
-
onUpdate(updateRuleOperator(rule, operator));
|
|
15
|
-
};
|
|
16
|
-
return (_jsxs(_Fragment, { children: [showCombinator === true && (_jsx(DropDownMenu, { variant: "outlined", data: QUERY_FILTER_COMBINATOR_OPTIONS, size: "xs", buttonProps: {
|
|
17
|
-
title: QUERY_FILTER_COMBINATOR_TITLE,
|
|
18
|
-
variant: "contained",
|
|
19
|
-
color: "secondary",
|
|
20
|
-
style: {
|
|
21
|
-
fontFamily: theme.typography.fontFamily,
|
|
22
|
-
fontWeight: 400,
|
|
23
|
-
fontSize: 11,
|
|
24
|
-
letterSpacing: 0,
|
|
25
|
-
lineHeight: 1,
|
|
26
|
-
padding: "3px 8px",
|
|
27
|
-
height: 24,
|
|
28
|
-
borderRadius: 5,
|
|
29
|
-
borderColor: "transparent",
|
|
30
|
-
color: theme.palette.text.secondary,
|
|
31
|
-
},
|
|
32
|
-
}, onItemSelect: (e) => handleCombinatorChange(e.value), dropDownProps: {
|
|
33
|
-
style: { width: 75 },
|
|
34
|
-
}, children: combinator.toUpperCase() })), rules.map((rule, index) => {
|
|
35
|
-
const filterDef = filterDefinitions.find((f) => f.dataField === rule.dataField);
|
|
36
|
-
if (!filterDef) {
|
|
37
|
-
return (_jsx(UnavailableRuleChip, { rule: rule, onDelete: onDelete }, rule.id || `${rule.dataField}-${index}`));
|
|
38
|
-
}
|
|
39
|
-
return (_jsx(RuleChip, { rule: rule, filterDef: filterDef, onDelete: onDelete, onOperatorChange: handleOperatorChange, onUpdate: onUpdate }, rule.id || `${rule.dataField}-${index}`));
|
|
40
|
-
})] }));
|
|
41
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { XIcon } from "lucide-react";
|
|
3
|
-
import { QUERY_FILTER_UNAVAILABLE_FILTER_LABEL } from "../QueryFilter.constants";
|
|
4
|
-
import { CloseLabel, FieldLabel, UnavailableRuleContainer, ValueLabel, } from "../QueryFilter.styled";
|
|
5
|
-
export const UnavailableRuleChip = ({ rule, onDelete }) => {
|
|
6
|
-
return (_jsxs(UnavailableRuleContainer, { "data-rule-id": rule.id, children: [_jsx(FieldLabel, { title: rule.dataField, children: rule.label || rule.dataField }), _jsx(ValueLabel, { children: QUERY_FILTER_UNAVAILABLE_FILTER_LABEL }), _jsx(CloseLabel, { variant: "contained", onClick: () => onDelete(rule), children: _jsx(XIcon, { size: 16 }) })] }));
|
|
7
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import { useDebouncedCallback } from "use-debounce";
|
|
4
|
-
import { QUERY_FILTER_DATE_FORMATS, QUERY_FILTER_VALUE_PLACEHOLDER, } from "../QueryFilter.constants";
|
|
5
|
-
import { dateFormatResolver, formatRuleTimestampValue, } from "../QueryFilter.lib";
|
|
6
|
-
import { StyledDateInput, StyledInput } from "../QueryFilter.styled";
|
|
7
|
-
import { MultiSelectEditor } from "./MultiSelectEditor";
|
|
8
|
-
export const ValueEditor = ({ rule, inputType, filterDef, onChange }) => {
|
|
9
|
-
var _a, _b, _c;
|
|
10
|
-
const editorValue = ((_a = rule.value) === null || _a === void 0 ? void 0 : _a[0]) || "";
|
|
11
|
-
const dateEditorValue = ((_b = rule.value) === null || _b === void 0 ? void 0 : _b[0]) === "" ? undefined : (_c = rule.value) === null || _c === void 0 ? void 0 : _c[0];
|
|
12
|
-
const [draftValue, setDraftValue] = useState(editorValue);
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
setDraftValue(editorValue);
|
|
15
|
-
}, [editorValue]);
|
|
16
|
-
const handleInputChange = useDebouncedCallback((value) => {
|
|
17
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(Object.assign(Object.assign({}, rule), { value: value ? [value] : undefined }));
|
|
18
|
-
}, 250);
|
|
19
|
-
const handleDraftInputChange = (e) => {
|
|
20
|
-
const value = e.target.value;
|
|
21
|
-
setDraftValue(value);
|
|
22
|
-
handleInputChange(value);
|
|
23
|
-
};
|
|
24
|
-
const handleMultiSelectChange = useDebouncedCallback((selected) => {
|
|
25
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(Object.assign(Object.assign({}, rule), { value: selected.map((s) => s.value), options: selected }));
|
|
26
|
-
}, 100);
|
|
27
|
-
const handleTimestampChange = useDebouncedCallback((timestamp) => {
|
|
28
|
-
const formattedValue = formatRuleTimestampValue(timestamp, filterDef);
|
|
29
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(Object.assign(Object.assign({}, rule), { value: formattedValue ? [formattedValue] : undefined }));
|
|
30
|
-
}, 100);
|
|
31
|
-
switch (inputType) {
|
|
32
|
-
case "text":
|
|
33
|
-
return (_jsx(StyledInput, { placeholder: filterDef.placeholder || QUERY_FILTER_VALUE_PLACEHOLDER, value: draftValue, onChange: handleDraftInputChange }));
|
|
34
|
-
case "number":
|
|
35
|
-
return (_jsx(StyledInput, { type: "number", placeholder: filterDef.placeholder || QUERY_FILTER_VALUE_PLACEHOLDER, value: draftValue, onChange: handleDraftInputChange }));
|
|
36
|
-
case "date":
|
|
37
|
-
return (_jsx(StyledDateInput, { arrow: false, enableCalendar: true, format: QUERY_FILTER_DATE_FORMATS.day, value: dateEditorValue, onChange: handleTimestampChange }));
|
|
38
|
-
case "datetime":
|
|
39
|
-
return (_jsx(StyledDateInput, { arrow: false, enableCalendar: true, format: dateFormatResolver(filterDef === null || filterDef === void 0 ? void 0 : filterDef.resolution), value: dateEditorValue, onChange: handleTimestampChange }));
|
|
40
|
-
case "multiselect":
|
|
41
|
-
return (_jsx(MultiSelectEditor, { rule: rule, filterDef: filterDef, onChange: handleMultiSelectChange }));
|
|
42
|
-
default:
|
|
43
|
-
return (_jsx(StyledInput, { placeholder: filterDef.placeholder || QUERY_FILTER_VALUE_PLACEHOLDER, value: draftValue, onChange: handleDraftInputChange }));
|
|
44
|
-
}
|
|
45
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import styled from "styled-components";
|
|
3
|
-
import SuperDatePicker from "../../SuperDatePicker";
|
|
4
|
-
import { QUERY_FILTER_DATE_FORMATS } from "../QueryFilter.constants";
|
|
5
|
-
import { dateFormatResolver, getRuleDateRangeValue, getSecondaryRuleValue, isDateInputType, isBetweenOperator, updateRuleDateRangeValue, updateRulePrimaryValue, updateRuleSecondaryValue, } from "../QueryFilter.lib";
|
|
6
|
-
import { FieldLabel } from "../QueryFilter.styled";
|
|
7
|
-
import { ValueEditor } from "./ValueEditor";
|
|
8
|
-
const BetweenAndLabel = styled(FieldLabel) `
|
|
9
|
-
&:hover {
|
|
10
|
-
background-color: transparent;
|
|
11
|
-
}
|
|
12
|
-
`;
|
|
13
|
-
export const ValueSelector = ({ rule, inputType, filterDef, onChange }) => {
|
|
14
|
-
var _a, _b;
|
|
15
|
-
const isBetween = isBetweenOperator(rule.operator);
|
|
16
|
-
const useSuperDatePicker = isBetween &&
|
|
17
|
-
isDateInputType(inputType) &&
|
|
18
|
-
filterDef.betweenEditor === "superDatePicker";
|
|
19
|
-
const handleValueChange = (nextRule) => {
|
|
20
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(updateRulePrimaryValue(rule, nextRule));
|
|
21
|
-
};
|
|
22
|
-
const handleSecondaryValueChange = (nextRule) => {
|
|
23
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(updateRuleSecondaryValue(rule, nextRule));
|
|
24
|
-
};
|
|
25
|
-
const handleDateRangeChange = (value) => {
|
|
26
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(updateRuleDateRangeValue(rule, value, filterDef));
|
|
27
|
-
};
|
|
28
|
-
if (useSuperDatePicker) {
|
|
29
|
-
return (_jsx(SuperDatePicker, Object.assign({}, filterDef.superDatePickerProps, { clearable: (_b = (_a = filterDef.superDatePickerProps) === null || _a === void 0 ? void 0 : _a.clearable) !== null && _b !== void 0 ? _b : false, format: inputType === "date"
|
|
30
|
-
? QUERY_FILTER_DATE_FORMATS.day
|
|
31
|
-
: dateFormatResolver(filterDef.resolution), size: "xxs", value: getRuleDateRangeValue(rule), variant: "text", width: "auto", onChange: handleDateRangeChange })));
|
|
32
|
-
}
|
|
33
|
-
return (_jsxs(_Fragment, { children: [_jsx(ValueEditor, { rule: rule, inputType: inputType, filterDef: filterDef, onChange: handleValueChange }), isBetween && (_jsxs(_Fragment, { children: [_jsx(BetweenAndLabel, { children: "and" }), _jsx(ValueEditor, { rule: Object.assign(Object.assign({}, rule), { value: [getSecondaryRuleValue(rule)] }), inputType: inputType, filterDef: filterDef, onChange: handleSecondaryValueChange })] }))] }));
|
|
34
|
-
};
|
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
|
-
import { Plugin, PluginKey } from "@tiptap/pm/state";
|
|
12
|
-
import { ReactRenderer } from "@tiptap/react";
|
|
13
|
-
import { CopyIcon, DownloadIcon, FullscreenIcon } from "lucide-react";
|
|
14
|
-
import styled from "styled-components";
|
|
15
|
-
import { Button } from "../../Button";
|
|
16
|
-
import { FileViewer } from "../../FileViewer";
|
|
17
|
-
import { useState } from "react";
|
|
18
|
-
const imageActionsKey = new PluginKey("image-actions");
|
|
19
|
-
const ImageActionsMenuRoot = styled.div `
|
|
20
|
-
display: flex;
|
|
21
|
-
gap: 4px;
|
|
22
|
-
padding: 4px;
|
|
23
|
-
border-radius: 5px;
|
|
24
|
-
|
|
25
|
-
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
|
|
26
|
-
|
|
27
|
-
button {
|
|
28
|
-
width: 24px;
|
|
29
|
-
padding: 0;
|
|
30
|
-
}
|
|
31
|
-
`;
|
|
32
|
-
const ImageActionsMenu = ({ onCopy, onDownload, getFile, onMouseEnter, onMouseLeave, }) => {
|
|
33
|
-
const [viewerFile, setViewerFile] = useState(null);
|
|
34
|
-
const keepEditorFocus = (event) => {
|
|
35
|
-
event.preventDefault();
|
|
36
|
-
};
|
|
37
|
-
return (_jsxs(_Fragment, { children: [_jsxs(ImageActionsMenuRoot, { onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, children: [_jsx(Button, { type: "button", size: "xxs", variant: "outlined", "aria-label": "Copy image", title: "Copy image", onMouseDown: keepEditorFocus, onClick: onCopy, children: _jsx(CopyIcon, { size: 14 }) }), _jsx(Button, { type: "button", size: "xxs", variant: "outlined", "aria-label": "Download image", title: "Download image", onMouseDown: keepEditorFocus, onClick: onDownload, children: _jsx(DownloadIcon, { size: 14 }) }), _jsx(Button, { type: "button", size: "xxs", variant: "outlined", "aria-label": "View image fullscreen", title: "View image fullscreen", onMouseDown: keepEditorFocus, onClick: () => {
|
|
38
|
-
const file = getFile();
|
|
39
|
-
if (file) {
|
|
40
|
-
setViewerFile(file);
|
|
41
|
-
}
|
|
42
|
-
}, children: _jsx(FullscreenIcon, { size: 14 }) })] }), _jsx(FileViewer, { file: viewerFile || undefined, open: Boolean(viewerFile), onClose: () => setViewerFile(null) })] }));
|
|
43
|
-
};
|
|
44
|
-
const getImageFilename = (image) => {
|
|
45
|
-
var _a, _b;
|
|
46
|
-
const fromTitle = (_b = (_a = image.title) === null || _a === void 0 ? void 0 : _a.match(/Filename:\s*(.+)$/)) === null || _b === void 0 ? void 0 : _b[1];
|
|
47
|
-
if (fromTitle)
|
|
48
|
-
return fromTitle;
|
|
49
|
-
if (image.alt)
|
|
50
|
-
return image.alt;
|
|
51
|
-
try {
|
|
52
|
-
const url = new URL(image.src);
|
|
53
|
-
const pathname = url.pathname.split("/").filter(Boolean).pop();
|
|
54
|
-
if (pathname)
|
|
55
|
-
return pathname;
|
|
56
|
-
}
|
|
57
|
-
catch (_c) {
|
|
58
|
-
// Data URLs and blob URLs are fine; fall back to a generated filename.
|
|
59
|
-
}
|
|
60
|
-
return "image.png";
|
|
61
|
-
};
|
|
62
|
-
const getImageBlob = (src) => __awaiter(void 0, void 0, void 0, function* () {
|
|
63
|
-
const response = yield fetch(src);
|
|
64
|
-
if (!response.ok) {
|
|
65
|
-
throw new Error("Unable to load image.");
|
|
66
|
-
}
|
|
67
|
-
return response.blob();
|
|
68
|
-
});
|
|
69
|
-
const copyImage = (image) => __awaiter(void 0, void 0, void 0, function* () {
|
|
70
|
-
var _a;
|
|
71
|
-
const ClipboardItemCtor = window.ClipboardItem;
|
|
72
|
-
if (!((_a = navigator.clipboard) === null || _a === void 0 ? void 0 : _a.write) || !ClipboardItemCtor) {
|
|
73
|
-
throw new Error("Image copying is not supported by this browser.");
|
|
74
|
-
}
|
|
75
|
-
const blob = yield getImageBlob(image.src);
|
|
76
|
-
const type = blob.type || "image/png";
|
|
77
|
-
yield navigator.clipboard.write([
|
|
78
|
-
new ClipboardItemCtor({
|
|
79
|
-
[type]: blob,
|
|
80
|
-
}),
|
|
81
|
-
]);
|
|
82
|
-
});
|
|
83
|
-
const downloadImage = (image) => __awaiter(void 0, void 0, void 0, function* () {
|
|
84
|
-
const filename = getImageFilename(image);
|
|
85
|
-
let href = image.src;
|
|
86
|
-
let objectUrl = null;
|
|
87
|
-
try {
|
|
88
|
-
const blob = yield getImageBlob(image.src);
|
|
89
|
-
objectUrl = URL.createObjectURL(blob);
|
|
90
|
-
href = objectUrl;
|
|
91
|
-
}
|
|
92
|
-
catch (_a) {
|
|
93
|
-
// Cross-origin images may not be fetchable, but the browser can still try
|
|
94
|
-
// the original URL as the download target.
|
|
95
|
-
}
|
|
96
|
-
const link = document.createElement("a");
|
|
97
|
-
link.href = href;
|
|
98
|
-
link.download = filename;
|
|
99
|
-
document.body.appendChild(link);
|
|
100
|
-
link.click();
|
|
101
|
-
link.remove();
|
|
102
|
-
if (objectUrl) {
|
|
103
|
-
URL.revokeObjectURL(objectUrl);
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
const getImageViewerFile = (image) => {
|
|
107
|
-
var _a;
|
|
108
|
-
const name = getImageFilename(image);
|
|
109
|
-
const ext = ((_a = name.split(".").pop()) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || "png";
|
|
110
|
-
const url = image.currentSrc || image.src;
|
|
111
|
-
return {
|
|
112
|
-
name,
|
|
113
|
-
ext,
|
|
114
|
-
type: "image",
|
|
115
|
-
url,
|
|
116
|
-
};
|
|
117
|
-
};
|
|
118
|
-
class ImageActionsView {
|
|
119
|
-
constructor(view, editor) {
|
|
120
|
-
this.component = null;
|
|
121
|
-
this.toolbar = null;
|
|
122
|
-
this.activeImage = null;
|
|
123
|
-
this.hideTimer = null;
|
|
124
|
-
this.handleMouseOver = (event) => {
|
|
125
|
-
var _a;
|
|
126
|
-
const target = event.target;
|
|
127
|
-
const image = (_a = target === null || target === void 0 ? void 0 : target.closest) === null || _a === void 0 ? void 0 : _a.call(target, "img");
|
|
128
|
-
if (!(image instanceof HTMLImageElement) ||
|
|
129
|
-
image.classList.contains("uploading") ||
|
|
130
|
-
!this.view.dom.contains(image)) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
this.activeImage = image;
|
|
134
|
-
this.cancelHide();
|
|
135
|
-
this.show();
|
|
136
|
-
};
|
|
137
|
-
this.handleMouseOut = (event) => {
|
|
138
|
-
var _a, _b;
|
|
139
|
-
const relatedTarget = event.relatedTarget;
|
|
140
|
-
if (relatedTarget &&
|
|
141
|
-
(((_a = this.toolbar) === null || _a === void 0 ? void 0 : _a.contains(relatedTarget)) ||
|
|
142
|
-
((_b = this.activeImage) === null || _b === void 0 ? void 0 : _b.contains(relatedTarget)))) {
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
this.scheduleHide();
|
|
146
|
-
};
|
|
147
|
-
this.handleCopy = () => __awaiter(this, void 0, void 0, function* () {
|
|
148
|
-
if (!this.activeImage)
|
|
149
|
-
return;
|
|
150
|
-
try {
|
|
151
|
-
yield copyImage(this.activeImage);
|
|
152
|
-
}
|
|
153
|
-
catch (error) {
|
|
154
|
-
alert(error.message || "Unable to copy image.");
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
this.handleDownload = () => __awaiter(this, void 0, void 0, function* () {
|
|
158
|
-
if (!this.activeImage)
|
|
159
|
-
return;
|
|
160
|
-
yield downloadImage(this.activeImage);
|
|
161
|
-
});
|
|
162
|
-
this.getFile = () => {
|
|
163
|
-
if (!this.activeImage)
|
|
164
|
-
return null;
|
|
165
|
-
return getImageViewerFile(this.activeImage);
|
|
166
|
-
};
|
|
167
|
-
this.hide = () => {
|
|
168
|
-
if (this.toolbar) {
|
|
169
|
-
this.toolbar.style.display = "none";
|
|
170
|
-
}
|
|
171
|
-
this.activeImage = null;
|
|
172
|
-
};
|
|
173
|
-
this.cancelHide = () => {
|
|
174
|
-
if (!this.hideTimer)
|
|
175
|
-
return;
|
|
176
|
-
clearTimeout(this.hideTimer);
|
|
177
|
-
this.hideTimer = null;
|
|
178
|
-
};
|
|
179
|
-
this.scheduleHide = () => {
|
|
180
|
-
this.cancelHide();
|
|
181
|
-
this.hideTimer = setTimeout(this.hide, 120);
|
|
182
|
-
};
|
|
183
|
-
this.updatePosition = () => {
|
|
184
|
-
if (!this.activeImage ||
|
|
185
|
-
!this.toolbar ||
|
|
186
|
-
this.toolbar.style.display === "none")
|
|
187
|
-
return;
|
|
188
|
-
const rect = this.activeImage.getBoundingClientRect();
|
|
189
|
-
const top = Math.max(8, rect.top + 8);
|
|
190
|
-
const left = Math.min(window.innerWidth - this.toolbar.offsetWidth - 8, Math.max(8, rect.right - this.toolbar.offsetWidth - 8));
|
|
191
|
-
this.toolbar.style.top = `${top}px`;
|
|
192
|
-
this.toolbar.style.left = `${left}px`;
|
|
193
|
-
};
|
|
194
|
-
this.view = view;
|
|
195
|
-
this.editor = editor;
|
|
196
|
-
this.view.dom.addEventListener("mouseover", this.handleMouseOver);
|
|
197
|
-
this.view.dom.addEventListener("mouseout", this.handleMouseOut);
|
|
198
|
-
window.addEventListener("scroll", this.updatePosition, true);
|
|
199
|
-
window.addEventListener("resize", this.updatePosition);
|
|
200
|
-
}
|
|
201
|
-
ensureToolbar() {
|
|
202
|
-
if (this.toolbar)
|
|
203
|
-
return this.toolbar;
|
|
204
|
-
this.component = new ReactRenderer(ImageActionsMenu, {
|
|
205
|
-
editor: this.editor,
|
|
206
|
-
props: {
|
|
207
|
-
onCopy: this.handleCopy,
|
|
208
|
-
onDownload: this.handleDownload,
|
|
209
|
-
getFile: this.getFile,
|
|
210
|
-
onMouseEnter: this.cancelHide,
|
|
211
|
-
onMouseLeave: this.scheduleHide,
|
|
212
|
-
},
|
|
213
|
-
className: "monolith-image-actions",
|
|
214
|
-
});
|
|
215
|
-
this.toolbar = this.component.element;
|
|
216
|
-
this.toolbar.style.position = "fixed";
|
|
217
|
-
this.toolbar.style.display = "none";
|
|
218
|
-
this.toolbar.style.zIndex = "16000";
|
|
219
|
-
this.view.dom.ownerDocument.body.appendChild(this.toolbar);
|
|
220
|
-
return this.toolbar;
|
|
221
|
-
}
|
|
222
|
-
show() {
|
|
223
|
-
const toolbar = this.ensureToolbar();
|
|
224
|
-
toolbar.style.display = "block";
|
|
225
|
-
this.updatePosition();
|
|
226
|
-
}
|
|
227
|
-
destroy() {
|
|
228
|
-
var _a, _b;
|
|
229
|
-
this.cancelHide();
|
|
230
|
-
this.view.dom.removeEventListener("mouseover", this.handleMouseOver);
|
|
231
|
-
this.view.dom.removeEventListener("mouseout", this.handleMouseOut);
|
|
232
|
-
window.removeEventListener("scroll", this.updatePosition, true);
|
|
233
|
-
window.removeEventListener("resize", this.updatePosition);
|
|
234
|
-
(_a = this.toolbar) === null || _a === void 0 ? void 0 : _a.remove();
|
|
235
|
-
(_b = this.component) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
export const ImageActionsPlugin = (editor) => new Plugin({
|
|
239
|
-
key: imageActionsKey,
|
|
240
|
-
view: (view) => new ImageActionsView(view, editor),
|
|
241
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { QuickDirection, QuickUnit, SuperDatePickerProps, SuperDatePickerValue } from "./SuperDatePicker.types";
|
|
2
|
-
export declare const DEFAULT_VALUE: SuperDatePickerValue;
|
|
3
|
-
export declare const DEFAULT_ON_CHANGE: NonNullable<SuperDatePickerProps["onChange"]>;
|
|
4
|
-
export declare const DEFAULT_PLACEHOLDER = "Select date/time range";
|
|
5
|
-
export declare const DEFAULT_START_LABEL = "Start";
|
|
6
|
-
export declare const DEFAULT_END_LABEL = "End";
|
|
7
|
-
export declare const DEFAULT_FORMAT: NonNullable<SuperDatePickerProps["format"]>;
|
|
8
|
-
export declare const DEFAULT_SIZE: NonNullable<SuperDatePickerProps["size"]>;
|
|
9
|
-
export declare const DEFAULT_VARIANT: NonNullable<SuperDatePickerProps["variant"]>;
|
|
10
|
-
export declare const DEFAULT_REQUIRED = false;
|
|
11
|
-
export declare const DEFAULT_CLEARABLE = true;
|
|
12
|
-
export declare const DEFAULT_DISABLED = false;
|
|
13
|
-
export declare const DEFAULT_UTC = false;
|
|
14
|
-
export declare const DEFAULT_QUICK_DIRECTION: QuickDirection;
|
|
15
|
-
export declare const DEFAULT_QUICK_AMOUNT = "15";
|
|
16
|
-
export declare const DEFAULT_QUICK_UNIT: QuickUnit;
|
|
17
|
-
export declare const QUICK_UNITS: Array<{
|
|
18
|
-
label: string;
|
|
19
|
-
value: QuickUnit;
|
|
20
|
-
}>;
|
|
21
|
-
export declare const QUICK_DIRECTION_OPTIONS: Array<{
|
|
22
|
-
label: string;
|
|
23
|
-
value: QuickDirection;
|
|
24
|
-
}>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export const DEFAULT_VALUE = {
|
|
2
|
-
start: null,
|
|
3
|
-
end: null,
|
|
4
|
-
};
|
|
5
|
-
export const DEFAULT_ON_CHANGE = () => { };
|
|
6
|
-
export const DEFAULT_PLACEHOLDER = "Select date/time range";
|
|
7
|
-
export const DEFAULT_START_LABEL = "Start";
|
|
8
|
-
export const DEFAULT_END_LABEL = "End";
|
|
9
|
-
export const DEFAULT_FORMAT = "YYYY-MM-DD HH:mm:ss";
|
|
10
|
-
export const DEFAULT_SIZE = "sm";
|
|
11
|
-
export const DEFAULT_VARIANT = "outlined";
|
|
12
|
-
export const DEFAULT_REQUIRED = false;
|
|
13
|
-
export const DEFAULT_CLEARABLE = true;
|
|
14
|
-
export const DEFAULT_DISABLED = false;
|
|
15
|
-
export const DEFAULT_UTC = false;
|
|
16
|
-
export const DEFAULT_QUICK_DIRECTION = "last";
|
|
17
|
-
export const DEFAULT_QUICK_AMOUNT = "15";
|
|
18
|
-
export const DEFAULT_QUICK_UNIT = "minutes";
|
|
19
|
-
export const QUICK_UNITS = [
|
|
20
|
-
{ label: "Minutes", value: "minutes" },
|
|
21
|
-
{ label: "Hours", value: "hours" },
|
|
22
|
-
{ label: "Days", value: "days" },
|
|
23
|
-
{ label: "Weeks", value: "weeks" },
|
|
24
|
-
{ label: "Months", value: "months" },
|
|
25
|
-
{ label: "Years", value: "years" },
|
|
26
|
-
];
|
|
27
|
-
export const QUICK_DIRECTION_OPTIONS = [
|
|
28
|
-
{ label: "Last", value: "last" },
|
|
29
|
-
{ label: "Next", value: "next" },
|
|
30
|
-
];
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import { FieldLabel } from "..";
|
|
4
|
-
import { ClearButton } from "../core";
|
|
5
|
-
import { DEFAULT_DISABLED, DEFAULT_END_LABEL, DEFAULT_FORMAT, DEFAULT_ON_CHANGE, DEFAULT_PLACEHOLDER, DEFAULT_REQUIRED, DEFAULT_SIZE, DEFAULT_START_LABEL, DEFAULT_UTC, DEFAULT_VALUE, DEFAULT_VARIANT, } from "./SuperDatePicker.constants";
|
|
6
|
-
import useSuperDatePicker from "./useSuperDatePicker";
|
|
7
|
-
import { EndpointPopover, QuickRangePopover, } from "./components";
|
|
8
|
-
import { RangeSeparator, StyledContainer, StyledInput, TriggerActions, } from "./SuperDatePicker.styled";
|
|
9
|
-
const SuperDatePicker = forwardRef(({ className, style, defaultValue = DEFAULT_VALUE, value, onChange = DEFAULT_ON_CHANGE, label, description, placeholder = DEFAULT_PLACEHOLDER, startLabel = DEFAULT_START_LABEL, endLabel = DEFAULT_END_LABEL, format = DEFAULT_FORMAT, size = DEFAULT_SIZE, variant = DEFAULT_VARIANT, required = DEFAULT_REQUIRED, clearable, disabled = DEFAULT_DISABLED, error, width, min, max, timeIntervalMinutes, utc = DEFAULT_UTC, presets, }, ref) => {
|
|
10
|
-
const isClearable = clearable === true;
|
|
11
|
-
const picker = useSuperDatePicker({
|
|
12
|
-
defaultValue,
|
|
13
|
-
value,
|
|
14
|
-
onChange,
|
|
15
|
-
disabled,
|
|
16
|
-
min,
|
|
17
|
-
max,
|
|
18
|
-
utc,
|
|
19
|
-
presets,
|
|
20
|
-
});
|
|
21
|
-
return (_jsxs(StyledContainer, { ref: (node) => {
|
|
22
|
-
if (typeof ref === "function") {
|
|
23
|
-
ref(node);
|
|
24
|
-
}
|
|
25
|
-
else if (ref) {
|
|
26
|
-
ref.current = node;
|
|
27
|
-
}
|
|
28
|
-
}, className: className, "$width": width, children: [label && (_jsx(FieldLabel, { error: error, asterisk: required, size: size, description: description, children: label })), _jsxs(StyledInput, { size: size, variant: variant, "$disabled": disabled, "$active": picker.openSegment !== null, "$clearable": isClearable, style: style, children: [_jsx(QuickRangePopover, { opened: picker.openSegment === "quick", disabled: disabled, size: size, commonRangeGroups: picker.commonRangeGroups, quickDirection: picker.quickDirection, quickAmount: picker.quickAmount, quickUnit: picker.quickUnit, onOpenChange: (opened) => picker.handleOpenSegmentChange("quick", opened), onQuickDirectionChange: picker.handleQuickDirectionChange, onQuickAmountChange: picker.handleQuickAmountChange, onQuickAmountSubmit: picker.handleQuickAmountSubmit, onQuickUnitChange: picker.handleQuickUnitChange, onPresetClick: picker.handlePreset }), _jsx(EndpointPopover, { opened: picker.openSegment === "start", disabled: disabled, label: startLabel, value: picker.value.start, onOpenChange: (opened) => picker.handleOpenSegmentChange("start", opened), onInputChange: (next) => picker.handleEndpointChange("start", next), onCalendarChange: (date) => picker.handleCalendarChange("start", date), format: format, size: size, utc: utc, min: min, max: picker.getEndpointMax("start"), timeIntervalMinutes: timeIntervalMinutes }), _jsx(RangeSeparator, { size: size, children: "\u2192" }), _jsx(EndpointPopover, { opened: picker.openSegment === "end", disabled: disabled, label: endLabel, value: picker.value.end, onOpenChange: (opened) => picker.handleOpenSegmentChange("end", opened), onInputChange: (next) => picker.handleEndpointChange("end", next), onCalendarChange: (date) => picker.handleCalendarChange("end", date), format: format, size: size, utc: utc, min: picker.getEndpointMin("end"), max: max, timeIntervalMinutes: timeIntervalMinutes }), _jsx(TriggerActions, { children: isClearable && (picker.value.start || picker.value.end) ? (_jsx(ClearButton, { size: size, onClick: picker.handleClear })) : null })] })] }));
|
|
29
|
-
});
|
|
30
|
-
SuperDatePicker.displayName = "SuperDatePicker";
|
|
31
|
-
export default SuperDatePicker;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import moment from "moment";
|
|
2
|
-
import type { CommonRangeGroupConfig, SuperDatePickerPreset } from "./SuperDatePicker.types";
|
|
3
|
-
export declare const resolveNow: (utc: boolean) => moment.Moment;
|
|
4
|
-
export declare const serializeMoment: (value: moment.Moment, utc: boolean) => string;
|
|
5
|
-
export declare const createRange: (start: moment.Moment, end: moment.Moment, utc: boolean) => {
|
|
6
|
-
start: string;
|
|
7
|
-
end: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const makeCommonRange: (utc: boolean, label: string, getRange: (now: moment.Moment) => {
|
|
10
|
-
start: moment.Moment;
|
|
11
|
-
end: moment.Moment;
|
|
12
|
-
}) => SuperDatePickerPreset;
|
|
13
|
-
export declare const getDefaultCommonRangeGroups: (utc: boolean) => CommonRangeGroupConfig[];
|
|
14
|
-
export declare const getAdditionalCommonRangeGroups: (utc: boolean) => CommonRangeGroupConfig[];
|
|
15
|
-
export declare const parseRangeMoment: (value: string | null | undefined, utc: boolean) => moment.Moment | null;
|
|
16
|
-
export declare const momentToCalendarDate: (value: string | null | undefined, utc: boolean) => Date | undefined;
|
|
17
|
-
export declare const calendarDateToMoment: (value: Date, utc: boolean) => moment.Moment;
|