@adaptabletools/adaptable 24.0.0-canary.6 → 24.0.0-canary.8
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 +36 -173
- package/package.json +1 -1
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +6 -0
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +83 -4
- package/src/AdaptableState/StyledColumns/GradientStyle.d.ts +4 -0
- package/src/Api/Implementation/QuickSearchApiImpl.js +2 -2
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +0 -1
- package/src/Api/Implementation/UserInterfaceApiImpl.js +9 -15
- package/src/Api/Internal/AdaptableInternalApi.js +5 -3
- package/src/Api/Internal/StateInternalApi.js +4 -3
- package/src/Api/UserInterfaceApi.d.ts +0 -4
- package/src/Redux/ActionsReducers/QuickSearchRedux.d.ts +9 -0
- package/src/Redux/ActionsReducers/QuickSearchRedux.js +9 -0
- package/src/Redux/Store/AdaptableStore.js +4 -2
- package/src/Utilities/Helpers/UIHelper.d.ts +6 -11
- package/src/Utilities/Helpers/UIHelper.js +6 -33
- package/src/View/Components/Popups/AdaptablePopup/Navigation.js +9 -11
- package/src/View/Components/StyleComponent.js +2 -2
- package/src/View/Dashboard/Dashboard.d.ts +1 -1
- package/src/View/Dashboard/Dashboard.js +1 -1
- package/src/View/Filter/ColumnFilter/ColumnFilterNew.js +14 -9
- package/src/View/QuickSearch/QuickSearchInput.js +1 -1
- package/src/View/QuickSearch/QuickSearchPopup.d.ts +1 -1
- package/src/View/QuickSearch/QuickSearchPopup.js +1 -1
- package/src/View/QuickSearch/Utilities/useQuickSearchDebounced.d.ts +2 -2
- package/src/View/StyledColumn/RangesComponent.js +8 -11
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +0 -2
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +2 -3
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.d.ts +0 -3
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +3 -3
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +7 -11
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +4 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +2 -2
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +7 -7
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +4 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +3 -3
- package/src/components/ColorField/index.d.ts +13 -0
- package/src/components/ColorField/index.js +26 -0
- package/src/components/aql/QueryBuilder/GroupEditor.js +1 -1
- package/src/components/aql/QueryBuilder/QueryBuilder.d.ts +5 -0
- package/src/components/aql/QueryBuilder/QueryBuilder.js +1 -1
- package/src/components/aql/QueryBuilder/context.d.ts +7 -0
- package/src/components/aql/QueryBuilder/context.js +3 -1
- package/src/env.js +2 -2
- package/src/migration/VersionUpgrade24.d.ts +9 -0
- package/src/migration/VersionUpgrade24.js +27 -0
- package/src/setupDevTools.js +163 -9
- package/src/types.d.ts +1 -1
- package/tsconfig.esm.tsbuildinfo +1 -1
- package/vendor/components/ColorField/index.d.ts +53 -0
- package/vendor/components/ColorField/index.d.ts.map +1 -0
- package/vendor/components/ColorField/index.js +80 -0
- package/vendor/components/ColorField/index.js.map +1 -0
- package/vendor/components/ColorPicker/colorPickerTab.d.ts +2 -2
- package/vendor/components/ColorPicker/colorPickerTab.d.ts.map +1 -1
- package/vendor/components/ColorPicker/colorPickerTab.js +6 -28
- package/vendor/components/ColorPicker/colorPickerTab.js.map +1 -1
- package/vendor/components/ColorPicker/index.d.ts +76 -9
- package/vendor/components/ColorPicker/index.d.ts.map +1 -1
- package/vendor/components/ColorPicker/index.js +217 -27
- package/vendor/components/ColorPicker/index.js.map +1 -1
- package/vendor/components/ColorPicker/themeColors.d.ts +74 -4
- package/vendor/components/ColorPicker/themeColors.d.ts.map +1 -1
- package/vendor/components/ColorPicker/themeColors.js +206 -18
- package/vendor/components/ColorPicker/themeColors.js.map +1 -1
- package/vendor/components/NumberInput/index.d.ts +51 -0
- package/vendor/components/NumberInput/index.d.ts.map +1 -0
- package/vendor/components/NumberInput/index.js +82 -0
- package/vendor/components/NumberInput/index.js.map +1 -0
- package/vendor/components/index.css +73 -24
- package/vendor/components/index.d.ts +6 -2
- package/vendor/components/index.d.ts.map +1 -1
- package/vendor/components/index.js +3 -1
- package/vendor/components/index.js.map +1 -1
- package/vendor/components/ui/input-group.d.ts.map +1 -1
- package/vendor/components/ui/input-group.js +5 -4
- package/vendor/components/ui/input-group.js.map +1 -1
- package/src/components/ColorPicker/ColorPicker.d.ts +0 -12
- package/src/components/ColorPicker/ColorPicker.js +0 -48
- package/src/components/ColorPicker/OptionalColorPicker.d.ts +0 -12
- package/src/components/ColorPicker/OptionalColorPicker.js +0 -13
- package/src/components/ColorPicker/index.d.ts +0 -2
- package/src/components/ColorPicker/index.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-group.d.ts","sourceRoot":"","sources":["../../src/ui/input-group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAOlE,QAAA,MAAM,UAAU,mKAef,CAAC;AAEF,QAAA,MAAM,uBAAuB;;8EAoB5B,CAAC;AAEF,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,KAAsB,EACtB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,uBAAuB,CAAC,qBAgB5E;
|
|
1
|
+
{"version":3,"file":"input-group.d.ts","sourceRoot":"","sources":["../../src/ui/input-group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAOlE,QAAA,MAAM,UAAU,mKAef,CAAC;AAEF,QAAA,MAAM,uBAAuB;;8EAoB5B,CAAC;AAEF,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,KAAsB,EACtB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,uBAAuB,CAAC,qBAgB5E;AAuBD,QAAA,MAAM,gBAAgB;;;;;;WAIT,QAAQ,GAAG,QAAQ,GAAG,OAAO;mDAmBxC,CAAC;AAEH,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,qBAU5E;AAED,QAAA,MAAM,eAAe,8KAepB,CAAC;AAEF,QAAA,MAAM,kBAAkB,0LAetB,CAAC;AAEH,OAAO,EACL,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,kBAAkB,GACnB,CAAC"}
|
|
@@ -32,12 +32,13 @@ function InputGroupAddon({ className, align = 'inline-start', ...props }) {
|
|
|
32
32
|
}, ...props }));
|
|
33
33
|
}
|
|
34
34
|
const inputGroupButtonVariants = cva(
|
|
35
|
-
// fill the addon/group height with a 1-unit vertical margin
|
|
36
|
-
//
|
|
37
|
-
|
|
35
|
+
// fill the addon/group height (so it follows --ab-input-height) with a 1-unit vertical margin,
|
|
36
|
+
// and stay square: a percentage width would resolve against the addon, not the height.
|
|
37
|
+
// `size-auto` so twMerge drops Button's `size-10` from icon-md; fixed size variants override below.
|
|
38
|
+
'twa:flex twa:my-1 twa:aspect-square twa:size-auto twa:h-[calc(100%-2*var(--ab-base-space))] twa:min-h-0 twa:items-center twa:gap-1 twa:p-0 twa:text-sm twa:shadow-none twa:cursor-pointer', {
|
|
38
39
|
variants: {
|
|
39
40
|
size: {
|
|
40
|
-
xs: 'twa:h-6 twa:gap-1 twa:rounded twa:px-1.5 twa:[&>svg:not([class*=size-])]:size-3.5',
|
|
41
|
+
xs: 'twa:h-6 twa:aspect-auto twa:gap-1 twa:rounded twa:px-1.5 twa:[&>svg:not([class*=size-])]:size-3.5',
|
|
41
42
|
sm: 'twa:',
|
|
42
43
|
'icon-xs': 'twa:size-6 twa:rounded twa:has-[>svg]:p-0',
|
|
43
44
|
'icon-sm': 'twa:size-8 twa:has-[>svg]:p-0',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-group.js","sourceRoot":"","sources":["../../src/ui/input-group.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CACjC,SAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG;IAC9C,OAAO,CACL,cACE,GAAG,EAAE,GAAG,eACE,aAAa,EACvB,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE,EAAE,CACX,gqCAAgqC,EAChqC,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,uBAAuB,GAAG,GAAG;AACjC,iFAAiF;AACjF,oUAAoU,EACpU;IACE,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,cAAc,EACZ,+EAA+E;YACjF,YAAY,EACV,8EAA8E;YAChF,aAAa,EACX,+HAA+H;YACjI,W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,CAAC,CAAC,CAAC;AAEH,OAAO,EACL,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,kBAAkB,GACnB,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { HTMLProps } from 'react';
|
|
3
|
-
import { AdaptableApi } from '../../Api/AdaptableApi';
|
|
4
|
-
import { BoxProps } from '../Flex';
|
|
5
|
-
export type ColorPickerProps = Omit<HTMLProps<HTMLInputElement>, 'onChange'> & {
|
|
6
|
-
api: AdaptableApi;
|
|
7
|
-
onChange: (color: string) => void;
|
|
8
|
-
className?: string;
|
|
9
|
-
value: string;
|
|
10
|
-
includeAlpha?: boolean;
|
|
11
|
-
} & Omit<BoxProps, 'onChange'>;
|
|
12
|
-
export declare const ColorPicker: React.ForwardRefExoticComponent<Omit<ColorPickerProps, "ref"> & React.RefAttributes<unknown>>;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { useCallback, useEffect } from 'react';
|
|
4
|
-
import { debounce } from '../../Utilities/Helpers/TimingHelper';
|
|
5
|
-
import { cn } from '../../lib/utils';
|
|
6
|
-
import Input from '../Input';
|
|
7
|
-
import { getVariableColor } from '../../Utilities/Helpers/StyleHelper';
|
|
8
|
-
import tinycolor from 'tinycolor2';
|
|
9
|
-
import { Box, Flex } from '../Flex';
|
|
10
|
-
import { twMerge } from '../../twMerge';
|
|
11
|
-
export const ColorPicker = React.forwardRef((props, ref) => {
|
|
12
|
-
const ColorPalette = props.api.userInterfaceApi.getColorPalette();
|
|
13
|
-
let { value, includeAlpha = true, className, ...restProps } = props;
|
|
14
|
-
const debouncedOnChange = useCallback(debounce((color) => {
|
|
15
|
-
props.onChange(color);
|
|
16
|
-
}, 30), [props.onChange]);
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
return () => {
|
|
19
|
-
debouncedOnChange.cancel();
|
|
20
|
-
};
|
|
21
|
-
}, [debouncedOnChange]);
|
|
22
|
-
const optionsMap = ColorPalette.reduce((acc, colorItem) => ({ ...acc, [getVariableColor(colorItem)]: colorItem }), {});
|
|
23
|
-
const ABcolorChoicesOptions = Object.keys(optionsMap).map((x) => {
|
|
24
|
-
return (_jsx("option", { value: x, children: x }, x));
|
|
25
|
-
});
|
|
26
|
-
const ABcolorChoices = _jsx("datalist", { id: 'ABcolorChoices', children: ABcolorChoicesOptions });
|
|
27
|
-
const preparedValue = React.useMemo(() => {
|
|
28
|
-
const color = getVariableColor(value);
|
|
29
|
-
return tinycolor(color).toHexString();
|
|
30
|
-
}, [value]);
|
|
31
|
-
const preparedAlphaColor = React.useMemo(() => {
|
|
32
|
-
const color = getVariableColor(value);
|
|
33
|
-
return [tinycolor(color).setAlpha(0).toRgbString(), tinycolor(color).setAlpha(1).toRgbString()];
|
|
34
|
-
}, [value]);
|
|
35
|
-
const rangeBackround = `linear-gradient(90deg, ${preparedAlphaColor[0]} 0%, ${preparedAlphaColor[1]} 100%)`;
|
|
36
|
-
const alpha = tinycolor(getVariableColor(value)).getAlpha();
|
|
37
|
-
return (_jsxs(Flex, { className: cn('ColorPicker twa:items-center twa:gap-2', {
|
|
38
|
-
'twa:opacity-30': props.disabled,
|
|
39
|
-
}, className), children: [_jsx(Input, { ...restProps, as: undefined, disabled: props.disabled, className: twMerge('ab-ColorPicker-swatch'), onChange: (event) => {
|
|
40
|
-
const color = optionsMap[event.target.value] ?? event.target.value;
|
|
41
|
-
debouncedOnChange(color);
|
|
42
|
-
}, value: preparedValue, ref: ref, type: "color", list: "ABcolorChoices", title: props.title }), ABcolorChoices, includeAlpha && (_jsxs(Flex, { alignItems: "center", className: "twa:gap-1", children: [_jsx(Box, { children: "Opacity" }), _jsx(Flex, { alignItems: "center", className: "twa:min-h-input", children: _jsx(Input, { disabled: props.disabled, className: "ab-ColorPicker-range", style: { background: rangeBackround }, value: alpha, onChange: (event) => {
|
|
43
|
-
const color = tinycolor(getVariableColor(value))
|
|
44
|
-
.setAlpha(event.target.value)
|
|
45
|
-
.toRgbString();
|
|
46
|
-
debouncedOnChange(color);
|
|
47
|
-
}, min: 0, max: 1, step: 0.01, type: "range" }) })] }))] }));
|
|
48
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { AdaptableApi } from '../../Api/AdaptableApi';
|
|
3
|
-
export type OptionalColorPickerProps = {
|
|
4
|
-
api: AdaptableApi;
|
|
5
|
-
value: string | undefined;
|
|
6
|
-
onChange: (color: string | undefined) => void;
|
|
7
|
-
defaultColor?: string;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
includeAlpha?: boolean;
|
|
10
|
-
className?: string;
|
|
11
|
-
};
|
|
12
|
-
export declare const OptionalColorPicker: React.FC<OptionalColorPickerProps>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Flex } from '../Flex';
|
|
3
|
-
import SimpleButton from '../SimpleButton';
|
|
4
|
-
import { twMerge } from '../../twMerge';
|
|
5
|
-
import { ColorPicker } from './ColorPicker';
|
|
6
|
-
const DEFAULT_COLOR = '#000000';
|
|
7
|
-
export const OptionalColorPicker = (props) => {
|
|
8
|
-
const { api, value, onChange, defaultColor = DEFAULT_COLOR, disabled = false, includeAlpha = true, className, } = props;
|
|
9
|
-
if (!value) {
|
|
10
|
-
return (_jsxs(Flex, { alignItems: "center", className: twMerge('OptionalColorPicker twa:gap-1', className), children: [_jsxs(Box, { className: "twa:relative twa:w-[36px] twa:h-[24px] twa:shrink-0", children: [_jsx(Box, { className: "ab-OptionalColorPicker-empty twa:absolute twa:inset-0 twa:pointer-events-none", "aria-hidden": true }), _jsx(ColorPicker, { api: api, value: defaultColor, disabled: disabled, includeAlpha: false, onChange: onChange, title: "Click to set colour", className: twMerge('twa:absolute twa:inset-0 twa:gap-0', 'twa:[&_.ab-ColorPicker-swatch]:absolute twa:[&_.ab-ColorPicker-swatch]:inset-0', 'twa:[&_.ab-ColorPicker-swatch]:size-full twa:[&_.ab-ColorPicker-swatch]:opacity-0') })] }), _jsx(Box, { className: "twa:text-2 twa:text-muted-foreground", children: "None" })] }));
|
|
11
|
-
}
|
|
12
|
-
return (_jsxs(Flex, { alignItems: "center", className: twMerge('OptionalColorPicker twa:gap-1', className), children: [_jsx(ColorPicker, { api: api, value: value, disabled: disabled, includeAlpha: includeAlpha, onChange: onChange }), _jsx(SimpleButton, { icon: "close", variant: "text", disabled: disabled, tooltip: "Clear colour", onClick: () => onChange(undefined) })] }));
|
|
13
|
-
};
|