@adaptabletools/adaptable 23.0.9 → 23.0.11
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/index.css +56 -8
- package/package.json +1 -1
- package/src/View/Components/AdaptableDateInput/index.d.ts +1 -0
- package/src/View/Components/AdaptableDateInput/index.js +2 -1
- package/src/View/Components/ColumnFilter/FloatingFilter.js +13 -13
- package/src/View/Components/ColumnFilter/components/ColumnFilterInput.d.ts +3 -0
- package/src/View/Components/ColumnFilter/components/ColumnFilterInput.js +6 -5
- package/src/View/Components/ColumnFilter/components/FloatingFilterInputList.js +33 -21
- package/src/components/Combobox/index.js +5 -1
- package/src/components/Datepicker/index.d.ts +1 -0
- package/src/components/Datepicker/index.js +2 -2
- package/src/components/WindowModal/WindowModal.d.ts +6 -0
- package/src/components/WindowModal/WindowModal.js +232 -31
- package/src/components/ui/combobox.js +1 -1
- package/src/components/utils/useDraggable.d.ts +3 -1
- package/src/components/utils/useDraggable.js +67 -44
- package/src/env.js +2 -2
- package/tsconfig.esm.tsbuildinfo +1 -1
package/index.css
CHANGED
|
@@ -405,9 +405,6 @@
|
|
|
405
405
|
.twa\:-mx-1 {
|
|
406
406
|
margin-inline: calc(var(--ab-base-space) * -1);
|
|
407
407
|
}
|
|
408
|
-
.twa\:mx-0\.5 {
|
|
409
|
-
margin-inline: calc(var(--ab-base-space) * 0.5);
|
|
410
|
-
}
|
|
411
408
|
.twa\:mx-1 {
|
|
412
409
|
margin-inline: var(--ab-base-space);
|
|
413
410
|
}
|
|
@@ -711,8 +708,8 @@
|
|
|
711
708
|
.twa\:max-h-\[min\(calc\(--spacing\(72\)---spacing\(9\)\)\,calc\(var\(--available-height\)---spacing\(9\)\)\)\] {
|
|
712
709
|
max-height: min(calc(calc(var(--ab-base-space) * 72) - calc(var(--ab-base-space) * 9)), calc(var(--available-height) - calc(var(--ab-base-space) * 9)));
|
|
713
710
|
}
|
|
714
|
-
.twa\:max-h-\[min\(var\(--available-height\)\,80vh\)\] {
|
|
715
|
-
max-height: min(var(--available-height), 80vh);
|
|
711
|
+
.twa\:max-h-\[min\(var\(--available-height\,80vh\)\,80vh\)\] {
|
|
712
|
+
max-height: min(var(--available-height,80vh), 80vh);
|
|
716
713
|
}
|
|
717
714
|
.twa\:max-h-full {
|
|
718
715
|
max-height: 100%;
|
|
@@ -1023,6 +1020,9 @@
|
|
|
1023
1020
|
.twa\:max-w-\[min\(var\(--available-width\)\,80vw\)\] {
|
|
1024
1021
|
max-width: min(var(--available-width), 80vw);
|
|
1025
1022
|
}
|
|
1023
|
+
.twa\:max-w-\[min\(var\(--available-width\,80vw\)\,80vw\)\] {
|
|
1024
|
+
max-width: min(var(--available-width,80vw), 80vw);
|
|
1025
|
+
}
|
|
1026
1026
|
.twa\:max-w-full {
|
|
1027
1027
|
max-width: 100%;
|
|
1028
1028
|
}
|
|
@@ -1379,9 +1379,6 @@
|
|
|
1379
1379
|
.twa\:gap-y-3 {
|
|
1380
1380
|
row-gap: calc(var(--ab-base-space) * 3);
|
|
1381
1381
|
}
|
|
1382
|
-
.twa\:self-center {
|
|
1383
|
-
align-self: center;
|
|
1384
|
-
}
|
|
1385
1382
|
.twa\:self-end {
|
|
1386
1383
|
align-self: flex-end;
|
|
1387
1384
|
}
|
|
@@ -1825,6 +1822,9 @@
|
|
|
1825
1822
|
.twa\:px-0 {
|
|
1826
1823
|
padding-inline: 0;
|
|
1827
1824
|
}
|
|
1825
|
+
.twa\:px-0\.5 {
|
|
1826
|
+
padding-inline: calc(var(--ab-base-space) * 0.5);
|
|
1827
|
+
}
|
|
1828
1828
|
.twa\:px-1 {
|
|
1829
1829
|
padding-inline: var(--ab-base-space);
|
|
1830
1830
|
}
|
|
@@ -2756,6 +2756,16 @@
|
|
|
2756
2756
|
}
|
|
2757
2757
|
}
|
|
2758
2758
|
}
|
|
2759
|
+
@media (hover: hover) {
|
|
2760
|
+
.twa\:hover\:bg-current\/15:hover {
|
|
2761
|
+
background-color: currentcolor;
|
|
2762
|
+
}
|
|
2763
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
2764
|
+
.twa\:hover\:bg-current\/15:hover {
|
|
2765
|
+
background-color: color-mix(in oklab, currentcolor 15%, transparent);
|
|
2766
|
+
}
|
|
2767
|
+
}
|
|
2768
|
+
}
|
|
2759
2769
|
@media (hover: hover) {
|
|
2760
2770
|
.twa\:hover\:bg-destructive\/20:hover {
|
|
2761
2771
|
background-color: var(--ab-color-destructive);
|
|
@@ -3630,6 +3640,9 @@
|
|
|
3630
3640
|
:is(.twa\:\*\:\[\[role\=button\]\]\:absolute > *):is([role=button]) {
|
|
3631
3641
|
position: absolute;
|
|
3632
3642
|
}
|
|
3643
|
+
:is(.twa\:\*\:\[\[role\=button\]\]\:relative > *):is([role=button]) {
|
|
3644
|
+
position: relative;
|
|
3645
|
+
}
|
|
3633
3646
|
:is(.twa\:\*\:\[\[role\=button\]\]\:inset-x-0\.5 > *):is([role=button]) {
|
|
3634
3647
|
inset-inline: calc(var(--ab-base-space) * 0.5);
|
|
3635
3648
|
}
|
|
@@ -3639,12 +3652,31 @@
|
|
|
3639
3652
|
:is(.twa\:\*\:\[\[role\=button\]\]\:h-auto > *):is([role=button]) {
|
|
3640
3653
|
height: auto;
|
|
3641
3654
|
}
|
|
3655
|
+
:is(.twa\:\*\:\[\[role\=button\]\]\:h-full > *):is([role=button]) {
|
|
3656
|
+
height: 100%;
|
|
3657
|
+
}
|
|
3658
|
+
:is(.twa\:\*\:\[\[role\=button\]\]\:min-w-0 > *):is([role=button]) {
|
|
3659
|
+
min-width: 0;
|
|
3660
|
+
}
|
|
3661
|
+
:is(.twa\:\*\:\[\[role\=button\]\]\:flex-1 > *):is([role=button]) {
|
|
3662
|
+
flex: 1;
|
|
3663
|
+
}
|
|
3664
|
+
:is(.twa\:\*\:\[\[role\=button\]\]\:basis-0 > *):is([role=button]) {
|
|
3665
|
+
flex-basis: 0;
|
|
3666
|
+
}
|
|
3642
3667
|
:is(.twa\:\*\:\[\[role\=button\]\]\:rounded-input > *):is([role=button]) {
|
|
3643
3668
|
border-radius: var(--ab-border-radius-input);
|
|
3644
3669
|
}
|
|
3670
|
+
:is(.twa\:\*\:\[\[role\=button\]\]\:border-none > *):is([role=button]) {
|
|
3671
|
+
--tw-border-style: none;
|
|
3672
|
+
border-style: none;
|
|
3673
|
+
}
|
|
3645
3674
|
:is(.twa\:\*\:\[input\]\:absolute > *):is(input) {
|
|
3646
3675
|
position: absolute;
|
|
3647
3676
|
}
|
|
3677
|
+
:is(.twa\:\*\:\[input\]\:relative > *):is(input) {
|
|
3678
|
+
position: relative;
|
|
3679
|
+
}
|
|
3648
3680
|
:is(.twa\:\*\:\[input\]\:inset-x-0\.5 > *):is(input) {
|
|
3649
3681
|
inset-inline: calc(var(--ab-base-space) * 0.5);
|
|
3650
3682
|
}
|
|
@@ -3654,9 +3686,25 @@
|
|
|
3654
3686
|
:is(.twa\:\*\:\[input\]\:h-auto > *):is(input) {
|
|
3655
3687
|
height: auto;
|
|
3656
3688
|
}
|
|
3689
|
+
:is(.twa\:\*\:\[input\]\:h-full > *):is(input) {
|
|
3690
|
+
height: 100%;
|
|
3691
|
+
}
|
|
3692
|
+
:is(.twa\:\*\:\[input\]\:min-w-0 > *):is(input) {
|
|
3693
|
+
min-width: 0;
|
|
3694
|
+
}
|
|
3695
|
+
:is(.twa\:\*\:\[input\]\:flex-1 > *):is(input) {
|
|
3696
|
+
flex: 1;
|
|
3697
|
+
}
|
|
3698
|
+
:is(.twa\:\*\:\[input\]\:basis-0 > *):is(input) {
|
|
3699
|
+
flex-basis: 0;
|
|
3700
|
+
}
|
|
3657
3701
|
:is(.twa\:\*\:\[input\]\:rounded-input > *):is(input) {
|
|
3658
3702
|
border-radius: var(--ab-border-radius-input);
|
|
3659
3703
|
}
|
|
3704
|
+
:is(.twa\:\*\:\[input\]\:border-none > *):is(input) {
|
|
3705
|
+
--tw-border-style: none;
|
|
3706
|
+
border-style: none;
|
|
3707
|
+
}
|
|
3660
3708
|
:is(.twa\:\*\*\:\[input\]\:min-h-auto\! *):is(input) {
|
|
3661
3709
|
min-height: auto !important;
|
|
3662
3710
|
}
|
package/package.json
CHANGED
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { AdaptableInputProps } from '../AdaptableInput';
|
|
3
3
|
export type AdaptableDateInputProps = AdaptableInputProps & {
|
|
4
4
|
showClearButton?: boolean;
|
|
5
|
+
showTriggerButton?: boolean;
|
|
5
6
|
};
|
|
6
7
|
declare const AdaptableDateInput: React.ForwardRefExoticComponent<Omit<AdaptableDateInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
7
8
|
export default AdaptableDateInput;
|
|
@@ -6,7 +6,7 @@ import useProperty from '../../../components/utils/useProperty';
|
|
|
6
6
|
import { dateToISO, parseDateValue } from '../../../Utilities/Helpers/DateHelper';
|
|
7
7
|
const AdaptableDateInput = React.forwardRef(function AdaptableDateInputCmp(props, ref) {
|
|
8
8
|
const dateInputOptions = useAdaptable().adaptableOptions.userInterfaceOptions.dateInputOptions;
|
|
9
|
-
const { value: _, defaultValue: __, onChange, required, disabled, showClearButton, ...inputProps } = props;
|
|
9
|
+
const { value: _, defaultValue: __, onChange, required, disabled, showClearButton, showTriggerButton, ...inputProps } = props;
|
|
10
10
|
const [value, setValue] = useProperty(props, 'value', undefined, {
|
|
11
11
|
onChange: (dateString) => props.onChange?.({
|
|
12
12
|
target: {
|
|
@@ -28,6 +28,7 @@ const AdaptableDateInput = React.forwardRef(function AdaptableDateInputCmp(props
|
|
|
28
28
|
showOutsideDays: dateInputOptions.showOutsideDays,
|
|
29
29
|
datepickerButtons: dateInputOptions.datepickerButtons,
|
|
30
30
|
showClearButton,
|
|
31
|
+
showTriggerButton: showTriggerButton ?? true,
|
|
31
32
|
...inputProps,
|
|
32
33
|
};
|
|
33
34
|
return _jsx(Datepicker, { ref: ref, ...datepickerProps });
|
|
@@ -44,18 +44,18 @@ export const FloatingFilter = (props) => {
|
|
|
44
44
|
}));
|
|
45
45
|
const renderTriggerValue = () => (_jsxs(Flex, { alignItems: "center", className: "twa:min-w-0", children: [_jsx(Box, { className: "twa:flex twa:items-center", children: !isManualApply && singleFilterPredicateDef?.icon ? (singleFilterPredicateDef?.icon) : (_jsx(AdaptableIconComponent, { icon: { name: 'filter' } })) }), showLabel && (_jsx(Box, { className: "ab-FloatingFilter-label twa:ml-2 twa:flex-1 twa:truncate", title: label, children: label }))] }));
|
|
46
46
|
let filterDropdown = null;
|
|
47
|
-
const filterDropdownSelect = (_jsx(SingleSelect, { chevronIcon: null, "data-name": "floating-filter-button", ariaLabel: `Column Filter Operator Dropdown: current operator is ${label}`,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
47
|
+
const filterDropdownSelect = (_jsx("div", { className: cn('twa:flex twa:box-border twa:self-stretch twa:min-h-0 twa:h-full twa:py-0.5 twa:px-0.5', !isInlineEditable && 'twa:min-w-0 twa:flex-1'), children: _jsx(SingleSelect, { chevronIcon: null, "data-name": "floating-filter-button", ariaLabel: `Column Filter Operator Dropdown: current operator is ${label}`, stopMouseDownPropagation: true, disabled: props.disabled, open: selectOpen, extraWidthChars: 5, onOpenChange: (nextOpen) => {
|
|
48
|
+
if (nextOpen && !isInlineEditable) {
|
|
49
|
+
adaptable.api.filterApi.columnFilterApi.internalApi.openColumnFilterPopup(props.columnId);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
setSelectOpen(nextOpen);
|
|
53
|
+
}, value: currentOperator, placeholder: label, items: operatorOptions, showItemTooltip: true, renderValue: renderTriggerValue, onValueChange: (operator) => {
|
|
54
|
+
props.onPredicateChange({
|
|
55
|
+
operator: props.predicate.operator,
|
|
56
|
+
args: [{ operator: operator, args: [] }],
|
|
57
|
+
});
|
|
58
|
+
}, className: cn('twa:h-full twa:w-full twa:min-h-0 twa:text-left twa:px-0.5 twa:py-0.5 twa:border-none', 'twa:shadow-none twa:cursor-pointer', 'twa:text-primary-foreground twa:hover:bg-current/15') }) }));
|
|
59
59
|
if (isInlineEditable) {
|
|
60
60
|
filterDropdown = showQuickFilterDropdown && filterDropdownSelect;
|
|
61
61
|
}
|
|
@@ -91,7 +91,7 @@ export const FloatingFilter = (props) => {
|
|
|
91
91
|
refreshed[Math.min(nextIndex, refreshed.length - 1)]?.focus();
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
|
-
}, children: [filterDropdown, isInlineEditable && (_jsx(Flex, { className: "twa:flex-1 twa:min-w-0", children: _jsx(FloatingFilterInputList, { onKeyDown: props.onKeydown, columnId: props.columnId, disabled: props.disabled, predicate: props.predicate.args[0], predicateDefs: props.predicateDefs, onPredicateChange: (predicate) => {
|
|
94
|
+
}, children: [filterDropdown, isInlineEditable && (_jsx(Flex, { className: "twa:flex-1 twa:min-w-0 twa:min-h-0 twa:h-full", children: _jsx(FloatingFilterInputList, { onKeyDown: props.onKeydown, columnId: props.columnId, disabled: props.disabled, predicate: props.predicate.args[0], predicateDefs: props.predicateDefs, onPredicateChange: (predicate) => {
|
|
95
95
|
props.onPredicateChange({
|
|
96
96
|
operator: props.predicate.operator,
|
|
97
97
|
args: [predicate],
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { AdaptableInputProps } from '../../AdaptableInput';
|
|
3
|
+
import { AdaptableDateInputProps } from '../../AdaptableDateInput';
|
|
2
4
|
type ColumnFilterEditorChangeProps = {
|
|
3
5
|
type: 'text';
|
|
4
6
|
value: string;
|
|
@@ -23,5 +25,6 @@ export declare const ColumnFilterInput: (props: {
|
|
|
23
25
|
filterType?: "floating" | "default";
|
|
24
26
|
usePrimitiveInputs?: boolean;
|
|
25
27
|
columnId: string;
|
|
28
|
+
inputProps?: AdaptableInputProps | AdaptableDateInputProps;
|
|
26
29
|
} & ColumnFilterEditorChangeProps) => React.JSX.Element;
|
|
27
30
|
export {};
|
|
@@ -7,11 +7,12 @@ import { PermittedValuesSelector } from '../../Selectors/PermittedValuesSelector
|
|
|
7
7
|
import { useAdaptable } from '../../../AdaptableContext';
|
|
8
8
|
import { debounce } from '../../../../Utilities/Helpers/TimingHelper';
|
|
9
9
|
import { useCallback } from 'react';
|
|
10
|
+
import { cn } from '../../../../lib/utils';
|
|
10
11
|
function debounceOrImmediate(fn, time) {
|
|
11
12
|
return time && time > 0 ? debounce(fn, time) : fn;
|
|
12
13
|
}
|
|
13
14
|
export const ColumnFilterInput = (props) => {
|
|
14
|
-
const { type, value, onChange: onChangeProp, onClear: onClearProp, disabled, onKeyDown, filterType, usePrimitiveInputs = true, columnId, } = props;
|
|
15
|
+
const { type, value, onChange: onChangeProp, onClear: onClearProp, disabled, onKeyDown, filterType, usePrimitiveInputs = true, columnId, inputProps, } = props;
|
|
15
16
|
const [liveValue, setLiveValue] = React.useState(value);
|
|
16
17
|
const [hasFocus, setHasFocus] = React.useState(false);
|
|
17
18
|
const onFocus = useCallback(() => {
|
|
@@ -63,7 +64,7 @@ export const ColumnFilterInput = (props) => {
|
|
|
63
64
|
}
|
|
64
65
|
};
|
|
65
66
|
if (type === 'date' && !showDatePicker) {
|
|
66
|
-
return (_jsx(AdaptableDateInlineInput, { "data-name": "floating-filter-input", value: liveValue, disabled: disabled, onFocus: onFocus, onBlur: onBlur, className: "twa:border-none twa:pr-0", onKeyDownCapture: onKeyDownCapture, onChange: (value) => {
|
|
67
|
+
return (_jsx(AdaptableDateInlineInput, { ...inputProps, "data-name": "floating-filter-input", value: liveValue, disabled: disabled, onFocus: onFocus, onBlur: onBlur, className: "twa:border-none twa:pr-0", onKeyDownCapture: onKeyDownCapture, onChange: (value) => {
|
|
67
68
|
onChange(value);
|
|
68
69
|
setLiveValue(value);
|
|
69
70
|
} }));
|
|
@@ -80,13 +81,13 @@ export const ColumnFilterInput = (props) => {
|
|
|
80
81
|
}
|
|
81
82
|
} }));
|
|
82
83
|
}
|
|
83
|
-
return (_jsx(AdaptableInput, { style: filterType === 'floating'
|
|
84
|
+
return (_jsx(AdaptableInput, { ...inputProps, style: filterType === 'floating'
|
|
84
85
|
? {
|
|
85
|
-
width: '
|
|
86
|
+
width: '100%',
|
|
86
87
|
padding: 'var(--ab-base-space)',
|
|
87
88
|
border: 'none',
|
|
88
89
|
}
|
|
89
|
-
: {}, "data-name": "floating-filter-input", onFocus: onFocus, onBlur: onBlur, disabled: disabled, type: type === 'number' ? 'text' : type, autoFocus: false, value: liveValue ?? '', onKeyDown: onKeyDown, showClearButton: false, className: 'twa:flex-1', onChange: (e) => {
|
|
90
|
+
: {}, "data-name": "floating-filter-input", onFocus: onFocus, onBlur: onBlur, disabled: disabled, type: type === 'number' ? 'text' : type, autoFocus: false, value: liveValue ?? '', onKeyDown: onKeyDown, showClearButton: false, className: cn(filterType === 'floating' ? 'twa:w-full twa:min-w-0 twa:h-full' : 'twa:flex-1', inputProps?.className), onChange: (e) => {
|
|
90
91
|
const prevValue = `${liveValue}`;
|
|
91
92
|
const value = e.target.value;
|
|
92
93
|
if (value) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { debounce } from '../../../../Utilities/Helpers/TimingHelper';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { getOperatorMatchingInputs } from '../../../../components/ExpressionEditor/QueryBuilder/utils';
|
|
@@ -31,31 +31,43 @@ export const FloatingFilterInputList = (props) => {
|
|
|
31
31
|
});
|
|
32
32
|
}, value: props.predicate.args, type: props.predicate.operator === 'In' ? 'In' : 'NotIn' }));
|
|
33
33
|
}
|
|
34
|
+
const hasMultipleInputs = matchingInputs.length > 1;
|
|
34
35
|
return (_jsx("div", { className: cn('twa:relative twa:w-full twa:flex twa:flex-row twa:[&>*:not(:first-child)]:border-l! twa:[&>*:not(:first-child)]:border-input-border!', {
|
|
35
36
|
'twa:**:[input]:min-h-auto!': 'make all inputs inside not have a height fixed',
|
|
36
37
|
'twa:*:[[role=button]]:rounded-input': true,
|
|
37
|
-
'twa:*:[[role=button]]:absolute': 'make date picker absolute filter',
|
|
38
|
-
'twa:*:[[role=button]]:inset-y-0.5 twa:*:[[role=button]]:inset-x-0.5 twa:*:[[role=button]]:h-auto':
|
|
38
|
+
'twa:*:[[role=button]]:absolute': !hasMultipleInputs && 'make date picker absolute filter',
|
|
39
|
+
'twa:*:[[role=button]]:inset-y-0.5 twa:*:[[role=button]]:inset-x-0.5 twa:*:[[role=button]]:h-auto': !hasMultipleInputs &&
|
|
40
|
+
'make date picker - and give it some padding, so the focus is not cut off absolute outline filter',
|
|
39
41
|
'twa:*:[input]:rounded-input': true,
|
|
40
|
-
'twa:*:[input]:absolute': 'make inputs absolute filter',
|
|
41
|
-
'twa:*:[input]:inset-y-0.5 twa:*:[input]:inset-x-0.5 twa:*:[input]:h-auto':
|
|
42
|
+
'twa:*:[input]:absolute': !hasMultipleInputs && 'make inputs absolute filter',
|
|
43
|
+
'twa:*:[input]:inset-y-0.5 twa:*:[input]:inset-x-0.5 twa:*:[input]:h-auto': !hasMultipleInputs &&
|
|
44
|
+
'make inputs - and give it some padding, so the focus is not cut off absolute outline filter',
|
|
45
|
+
'twa:min-h-0 twa:h-full twa:p-0.5': hasMultipleInputs,
|
|
46
|
+
'twa:*:[input]:relative twa:*:[[role=button]]:relative': hasMultipleInputs,
|
|
47
|
+
'twa:*:[input]:min-w-0 twa:*:[[role=button]]:min-w-0': hasMultipleInputs,
|
|
48
|
+
'twa:*:[input]:flex-1 twa:*:[[role=button]]:flex-1': hasMultipleInputs,
|
|
49
|
+
'twa:*:[input]:basis-0 twa:*:[[role=button]]:basis-0': hasMultipleInputs,
|
|
50
|
+
'twa:*:[input]:h-full twa:*:[[role=button]]:h-full': hasMultipleInputs,
|
|
51
|
+
'twa:*:[input]:border-none twa:*:[[role=button]]:border-none': hasMultipleInputs,
|
|
42
52
|
}), children: (matchingInputs ?? []).map((input, index) => {
|
|
43
53
|
const value = props?.predicate?.args?.[index];
|
|
44
|
-
return (
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
return (_jsxs(_Fragment, { children: [index > 0 && _jsx("div", { className: "twa:border-l twa:border-input-border" }), _jsx(ColumnFilterInput, { inputProps: {
|
|
55
|
+
showTriggerButton: hasMultipleInputs ? false : undefined,
|
|
56
|
+
}, filterType: "floating", columnId: props.columnId, usePrimitiveInputs: true, disabled: props.disabled, type: input, value: value, onKeyDown: props.onKeyDown, onClear: () => {
|
|
57
|
+
const args = [...props.predicate.args];
|
|
58
|
+
args.splice(index, 1);
|
|
59
|
+
const newPredicate = {
|
|
60
|
+
operator: props.predicate.operator,
|
|
61
|
+
args: args,
|
|
62
|
+
};
|
|
63
|
+
debouncedPredicateChange(newPredicate);
|
|
64
|
+
}, onChange: (value) => {
|
|
65
|
+
const newPredicate = {
|
|
66
|
+
operator: props.predicate.operator,
|
|
67
|
+
args: [...props.predicate.args],
|
|
68
|
+
};
|
|
69
|
+
newPredicate.args[index] = value;
|
|
70
|
+
debouncedPredicateChange(newPredicate);
|
|
71
|
+
} }, index)] }));
|
|
60
72
|
}) }));
|
|
61
73
|
};
|
|
@@ -164,7 +164,11 @@ const useGetAllItems = (props) => {
|
|
|
164
164
|
onInputValueChange,
|
|
165
165
|
onValueChange,
|
|
166
166
|
allItems,
|
|
167
|
-
maxLabelLength: allItems.reduce((max, item) => Math.max(max, typeof item.label === 'string'
|
|
167
|
+
maxLabelLength: allItems.reduce((max, item) => Math.max(max, typeof item.label === 'string'
|
|
168
|
+
? item.label.length
|
|
169
|
+
: typeof item.textLabel === 'string'
|
|
170
|
+
? item.textLabel.length
|
|
171
|
+
: 0), 0),
|
|
168
172
|
};
|
|
169
173
|
};
|
|
170
174
|
function useCreatable(props, allItems, itemByValue) {
|
|
@@ -9,6 +9,7 @@ export type DatepickerProps = Omit<InputProps, 'value' | 'onChange' | 'defaultVa
|
|
|
9
9
|
onChange: (value: Date | undefined) => void;
|
|
10
10
|
onHide?: VoidFunction;
|
|
11
11
|
showClearButton?: boolean;
|
|
12
|
+
showTriggerButton?: boolean;
|
|
12
13
|
datepickerButtons?: DatepickerButton[];
|
|
13
14
|
dateProps: {
|
|
14
15
|
format: string;
|
|
@@ -38,7 +38,7 @@ const captionComponents = {
|
|
|
38
38
|
const END_MONTH = endOfYear(addYears(new Date(), 10));
|
|
39
39
|
const START_MONTH = startOfYear(addYears(new Date(), -50));
|
|
40
40
|
export const Datepicker = React.forwardRef((props, ref) => {
|
|
41
|
-
const { dateProps, disabled, style, className, placeholder, showWeekNumber, showOutsideDays, datepickerButtons, showClearButton, autoFocus, onHide, value: _value, defaultValue: _defaultValue, onChange: _onChange, } = props;
|
|
41
|
+
const { dateProps, disabled, style, className, placeholder, showWeekNumber, showOutsideDays, datepickerButtons, showClearButton, autoFocus, showTriggerButton = true, onHide, value: _value, defaultValue: _defaultValue, onChange: _onChange, } = props;
|
|
42
42
|
void _value;
|
|
43
43
|
void _defaultValue;
|
|
44
44
|
void _onChange;
|
|
@@ -172,7 +172,7 @@ export const Datepicker = React.forwardRef((props, ref) => {
|
|
|
172
172
|
clearValue();
|
|
173
173
|
triggerRef.current?.firstChild?.focus();
|
|
174
174
|
}, accessLevel: ACCESS_LEVEL_FULL })) : null;
|
|
175
|
-
const calendarButton = (_jsx(SimpleButton, { disabled: disabled, variant: "text", icon: "calendar", tooltip: "Date", iconSize: 20, className: "twa:p-0", type: "button" }));
|
|
175
|
+
const calendarButton = showTriggerButton !== false ? (_jsx(SimpleButton, { disabled: disabled, variant: "text", icon: "calendar", tooltip: "Date", iconSize: 20, className: "twa:p-0", type: "button" })) : null;
|
|
176
176
|
const [selectPortalRoot, setSelectPortalRoot] = React.useState(null);
|
|
177
177
|
const popupRefCallback = React.useCallback((el) => {
|
|
178
178
|
popupRef.current = el;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
export declare const WINDOW_MODAL_VIEWPORT_EDGE_OFFSET = 10;
|
|
2
3
|
export type WindowModalSize = {
|
|
3
4
|
width: number;
|
|
4
5
|
height: number;
|
|
@@ -7,6 +8,11 @@ export type WindowModalPosition = {
|
|
|
7
8
|
x: number;
|
|
8
9
|
y: number;
|
|
9
10
|
};
|
|
11
|
+
export declare const clampWindowModalToViewport: (position: WindowModalPosition, size: WindowModalSize, minWidth?: number, minHeight?: number, edgeOffset?: number) => {
|
|
12
|
+
position: WindowModalPosition;
|
|
13
|
+
size: WindowModalSize;
|
|
14
|
+
};
|
|
15
|
+
export declare const clampWindowModalPositionToViewport: (position: WindowModalPosition, size: WindowModalSize, edgeOffset?: number) => WindowModalPosition;
|
|
10
16
|
export interface WindowModalProps {
|
|
11
17
|
handleSelector: string;
|
|
12
18
|
size: WindowModalSize;
|