@adaptabletools/adaptable 24.0.0-canary.6 → 24.0.0-canary.7
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 +29 -173
- package/package.json +1 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +4 -6
- 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/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 +14 -0
- package/src/components/ColorField/index.js +6 -0
- 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/tsconfig.esm.tsbuildinfo +1 -1
- package/vendor/components/ColorField/index.d.ts +43 -0
- package/vendor/components/ColorField/index.d.ts.map +1 -0
- package/vendor/components/ColorField/index.js +81 -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 +36 -8
- package/vendor/components/ColorPicker/index.d.ts.map +1 -1
- package/vendor/components/ColorPicker/index.js +97 -25
- package/vendor/components/ColorPicker/index.js.map +1 -1
- package/vendor/components/ColorPicker/themeColors.d.ts +33 -4
- package/vendor/components/ColorPicker/themeColors.d.ts.map +1 -1
- package/vendor/components/ColorPicker/themeColors.js +76 -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 +67 -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
|
@@ -25,28 +25,86 @@ const SEMANTIC_COLORS = [
|
|
|
25
25
|
themeColor('muted', 'Muted'),
|
|
26
26
|
themeColor('muted-foreground', 'Muted text'),
|
|
27
27
|
];
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const
|
|
28
|
+
export const THEME_COLOR_GROUP = {
|
|
29
|
+
id: 'theme',
|
|
30
|
+
label: 'Theme',
|
|
31
|
+
colors: SEMANTIC_COLORS,
|
|
32
|
+
};
|
|
33
|
+
const LABEL_BY_VALUE = new Map(SEMANTIC_COLORS.map((c) => [c.value, c.label]));
|
|
34
|
+
const PALETTE_VALUE = /^var\(--ab-color-palette-(\d+)\)$/;
|
|
35
|
+
const TOKEN_VALUE = /^var\(--ab-color-([a-z0-9]+(?:-[a-z0-9]+)*)\)$/;
|
|
36
|
+
/** `quick-search-match-foreground` → "Quick search match text". */
|
|
37
|
+
function tokenLabel(token) {
|
|
38
|
+
const words = token.split('-').map((word) => (word === 'foreground' ? 'text' : word));
|
|
39
|
+
const label = words.join(' ');
|
|
40
|
+
return label.charAt(0).toUpperCase() + label.slice(1);
|
|
41
|
+
}
|
|
42
|
+
const paletteColor = (index) => themeColor(`palette-${index}`, `Palette ${index}`);
|
|
43
|
+
/** Stops the palette probe on a theme that defines palette vars without a gap. */
|
|
44
|
+
const MAX_PALETTE_SIZE = 256;
|
|
45
|
+
export const PALETTE_COUNT_VAR = '--ab-cmp-color-picker__palette-count';
|
|
46
|
+
export const ALLOWED_COLORS_VAR = '--ab-cmp-color-picker__allowed-colors';
|
|
47
|
+
export const TABS_VAR = '--ab-cmp-color-picker__tabs';
|
|
48
|
+
const DEFAULT_TABS = ['precise', 'colors'];
|
|
49
|
+
const TAB_IDS = new Map([
|
|
50
|
+
['precise', 'precise'],
|
|
51
|
+
['colors', 'colors'],
|
|
52
|
+
['colours', 'colors'],
|
|
53
|
+
]);
|
|
54
|
+
/**
|
|
55
|
+
* The palette colours in effect on `element`: `--ab-color-palette-1` upwards
|
|
56
|
+
* until one is not defined, capped by `--ab-cmp-color-picker__palette-count`
|
|
57
|
+
* when that is a positive integer.
|
|
58
|
+
*/
|
|
59
|
+
export function readPaletteColors(element) {
|
|
60
|
+
const style = getComputedStyle(element);
|
|
61
|
+
const count = Number.parseInt(style.getPropertyValue(PALETTE_COUNT_VAR).trim(), 10);
|
|
62
|
+
const max = count > 0 ? Math.min(count, MAX_PALETTE_SIZE) : MAX_PALETTE_SIZE;
|
|
63
|
+
const colors = [];
|
|
64
|
+
for (let index = 1; index <= max; index++) {
|
|
65
|
+
if (!style.getPropertyValue(`--ab-color-palette-${index}`).trim()) {
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
colors.push(paletteColor(index));
|
|
69
|
+
}
|
|
70
|
+
return colors;
|
|
71
|
+
}
|
|
72
|
+
/** `--ab-cmp-color-picker__allowed-colors` on `element`; `any` when unset or unrecognised. */
|
|
73
|
+
export function readAllowedColors(element) {
|
|
74
|
+
const value = getComputedStyle(element).getPropertyValue(ALLOWED_COLORS_VAR).trim();
|
|
75
|
+
return value === 'predefined' || value === 'palette' ? value : 'any';
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* `--ab-cmp-color-picker__tabs` on `element`: the tabs to show, in order, the
|
|
79
|
+
* first being the default (e.g. `colors precise`; `colours` is also
|
|
80
|
+
* accepted). Unknown and repeated ids are dropped; `precise colors` when
|
|
81
|
+
* nothing valid is left.
|
|
82
|
+
*/
|
|
83
|
+
export function readTabs(element) {
|
|
84
|
+
return parseTabs(getComputedStyle(element).getPropertyValue(TABS_VAR));
|
|
85
|
+
}
|
|
86
|
+
/** A `--ab-cmp-color-picker__tabs` value as tab ids; see `readTabs`. */
|
|
87
|
+
export function parseTabs(value) {
|
|
88
|
+
const ids = value.trim().toLowerCase().split(/[\s,]+/).map((id) => TAB_IDS.get(id));
|
|
89
|
+
const tabs = [...new Set(ids.filter((id) => id !== undefined))];
|
|
90
|
+
return tabs.length ? tabs : DEFAULT_TABS;
|
|
91
|
+
}
|
|
36
92
|
/**
|
|
37
93
|
* The picker's name for a stored colour: the token label for a theme colour
|
|
38
|
-
* (`var(--ab-color-success)` → "Success"
|
|
94
|
+
* (`var(--ab-color-success)` → "Success", `var(--ab-color-palette-3)` →
|
|
95
|
+
* "Palette 3"), a name derived from any other `--ab-color-*` token
|
|
96
|
+
* (`var(--ab-color-badge-foreground)` → "Badge text"), the value itself otherwise.
|
|
39
97
|
*/
|
|
40
|
-
export function describeColor(value
|
|
41
|
-
|
|
42
|
-
|
|
98
|
+
export function describeColor(value) {
|
|
99
|
+
const palette = PALETTE_VALUE.exec(value);
|
|
100
|
+
if (palette) {
|
|
101
|
+
return `Palette ${palette[1]}`;
|
|
43
102
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return color.label;
|
|
48
|
-
}
|
|
103
|
+
const label = LABEL_BY_VALUE.get(value);
|
|
104
|
+
if (label) {
|
|
105
|
+
return label;
|
|
49
106
|
}
|
|
50
|
-
|
|
107
|
+
const token = TOKEN_VALUE.exec(value);
|
|
108
|
+
return token ? tokenLabel(token[1]) : value;
|
|
51
109
|
}
|
|
52
110
|
//# sourceMappingURL=themeColors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themeColors.js","sourceRoot":"","sources":["../../src/ColorPicker/themeColors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"themeColors.js","sourceRoot":"","sources":["../../src/ColorPicker/themeColors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAiBH,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,KAAa,EAAc,EAAE,CAAC,CAAC;IAChE,KAAK,EAAE,kBAAkB,KAAK,GAAG;IACjC,KAAK;CACN,CAAC,CAAC;AAEH,MAAM,eAAe,GAAiB;IACpC,UAAU,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC9B,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC;IAChC,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC;IAC7B,UAAU,CAAC,aAAa,EAAE,aAAa,CAAC;IACxC,UAAU,CAAC,wBAAwB,EAAE,kBAAkB,CAAC;IACxD,UAAU,CAAC,aAAa,EAAE,aAAa,CAAC;IACxC,UAAU,CAAC,cAAc,EAAE,cAAc,CAAC;IAC1C,UAAU,CAAC,eAAe,EAAE,eAAe,CAAC;IAC5C,UAAU,CAAC,cAAc,EAAE,cAAc,CAAC;IAC1C,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC;IAChC,UAAU,CAAC,oBAAoB,EAAE,cAAc,CAAC;IAChD,UAAU,CAAC,YAAY,EAAE,YAAY,CAAC;IACtC,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,kBAAkB,EAAE,YAAY,CAAC;CAC7C,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAoB;IAChD,EAAE,EAAE,OAAO;IACX,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,eAAe;CACxB,CAAC;AAEF,MAAM,cAAc,GAAG,IAAI,GAAG,CAAiB,e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C,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IACpF,MAAM,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,EAAwB,EAAE,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC;IACtF,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC;AAC3C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1C,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,WAAW,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IACjC,CAAC;IACD,MAAM,KAAK,GAAG,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtC,OAAO,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type NumberInputProps = Omit<React.ComponentPropsWithoutRef<'input'>, 'value' | 'defaultValue' | 'onChange' | 'type' | 'min' | 'max' | 'step'> & {
|
|
3
|
+
/** Controlled value; `undefined` is empty. Leave out `value` entirely for uncontrolled mode. */
|
|
4
|
+
value?: number | undefined;
|
|
5
|
+
/** Initial value in uncontrolled mode. */
|
|
6
|
+
defaultValue?: number;
|
|
7
|
+
/**
|
|
8
|
+
* Called with every valid value: typed (once it parses and is in range),
|
|
9
|
+
* stepped, or clamped on blur. `undefined` when cleared (see `clearable`).
|
|
10
|
+
*/
|
|
11
|
+
onValueChange?: (value: number | undefined) => void;
|
|
12
|
+
min?: number;
|
|
13
|
+
max?: number;
|
|
14
|
+
/** Default `1`; Shift + Arrow steps ten times as far. */
|
|
15
|
+
step?: number;
|
|
16
|
+
/** Whether the field can be left empty; default `true`. */
|
|
17
|
+
clearable?: boolean;
|
|
18
|
+
/** Applied to the `InputGroup` wrapper — the input itself takes `inputClassName`. */
|
|
19
|
+
className?: string;
|
|
20
|
+
inputClassName?: string;
|
|
21
|
+
'data-name'?: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* A numeric input with − / + buttons on either side instead of the browser's
|
|
25
|
+
* spinner arrows. The text can be mid-edit (empty, `-`, `1.`) without
|
|
26
|
+
* reporting; out-of-range numbers are clamped to `min` / `max` on blur.
|
|
27
|
+
* Supports controlled (`value` + `onValueChange`) and uncontrolled
|
|
28
|
+
* (`defaultValue`) modes.
|
|
29
|
+
*/
|
|
30
|
+
export declare const NumberInput: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "onChange" | "value" | "max" | "min" | "step" | "type" | "defaultValue"> & {
|
|
31
|
+
/** Controlled value; `undefined` is empty. Leave out `value` entirely for uncontrolled mode. */
|
|
32
|
+
value?: number | undefined;
|
|
33
|
+
/** Initial value in uncontrolled mode. */
|
|
34
|
+
defaultValue?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Called with every valid value: typed (once it parses and is in range),
|
|
37
|
+
* stepped, or clamped on blur. `undefined` when cleared (see `clearable`).
|
|
38
|
+
*/
|
|
39
|
+
onValueChange?: (value: number | undefined) => void;
|
|
40
|
+
min?: number;
|
|
41
|
+
max?: number;
|
|
42
|
+
/** Default `1`; Shift + Arrow steps ten times as far. */
|
|
43
|
+
step?: number;
|
|
44
|
+
/** Whether the field can be left empty; default `true`. */
|
|
45
|
+
clearable?: boolean;
|
|
46
|
+
/** Applied to the `InputGroup` wrapper — the input itself takes `inputClassName`. */
|
|
47
|
+
className?: string;
|
|
48
|
+
inputClassName?: string;
|
|
49
|
+
'data-name'?: string;
|
|
50
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
51
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/NumberInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,EACvC,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CACxE,GAAG;IACF,gGAAgG;IAChG,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IACpD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AASF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW;IAnCtB,gGAAgG;YACxF,MAAM,GAAG,SAAS;IAC1B,0CAA0C;mBAC3B,MAAM;IACrB;;;OAGG;oBACa,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI;UAC7C,MAAM;UACN,MAAM;IACZ,yDAAyD;WAClD,MAAM;IACb,2DAA2D;gBAC/C,OAAO;IACnB,qFAAqF;gBACzE,MAAM;qBACD,MAAM;kBACT,MAAM;0CAqJrB,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { MinusIcon, PlusIcon } from 'lucide-react';
|
|
4
|
+
import { cn } from '../lib/utils';
|
|
5
|
+
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, } from '../ui/input-group';
|
|
6
|
+
const decimalsOf = (n) => (String(n).split('.')[1] ?? '').length;
|
|
7
|
+
/** A number at the precision of `step`, so 0.1 + 0.2 shows as 0.3. */
|
|
8
|
+
const roundTo = (n, step) => Number(n.toFixed(decimalsOf(step)));
|
|
9
|
+
const format = (n) => (n === undefined ? '' : String(n));
|
|
10
|
+
/**
|
|
11
|
+
* A numeric input with − / + buttons on either side instead of the browser's
|
|
12
|
+
* spinner arrows. The text can be mid-edit (empty, `-`, `1.`) without
|
|
13
|
+
* reporting; out-of-range numbers are clamped to `min` / `max` on blur.
|
|
14
|
+
* Supports controlled (`value` + `onValueChange`) and uncontrolled
|
|
15
|
+
* (`defaultValue`) modes.
|
|
16
|
+
*/
|
|
17
|
+
export const NumberInput = React.forwardRef(function NumberInput(props, ref) {
|
|
18
|
+
const { value: controlledValue, defaultValue, onValueChange, min = -Infinity, max = Infinity, step = 1, clearable = true, disabled, className, inputClassName, onBlur, onKeyDown, 'data-name': dataName, ...inputProps } = props;
|
|
19
|
+
// `value={undefined}` is a controlled empty field, not uncontrolled mode
|
|
20
|
+
const isControlled = 'value' in props;
|
|
21
|
+
const [uncontrolledValue, setUncontrolledValue] = React.useState(defaultValue);
|
|
22
|
+
const value = isControlled ? controlledValue : uncontrolledValue;
|
|
23
|
+
// the text while editing; `null` shows the value
|
|
24
|
+
const [draft, setDraft] = React.useState(null);
|
|
25
|
+
const clamp = (n) => Math.min(max, Math.max(min, n));
|
|
26
|
+
const commit = (next) => {
|
|
27
|
+
if (!isControlled) {
|
|
28
|
+
setUncontrolledValue(next);
|
|
29
|
+
}
|
|
30
|
+
if (next !== value) {
|
|
31
|
+
onValueChange?.(next);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const stepBy = (direction, multiplier = 1) => {
|
|
35
|
+
const start = value ?? (Number.isFinite(min) ? min : 0);
|
|
36
|
+
const next = value === undefined ? start : roundTo(start + direction * step * multiplier, step);
|
|
37
|
+
setDraft(null);
|
|
38
|
+
commit(clamp(next));
|
|
39
|
+
};
|
|
40
|
+
const handleChange = (text) => {
|
|
41
|
+
setDraft(text);
|
|
42
|
+
if (text.trim() === '') {
|
|
43
|
+
if (clearable)
|
|
44
|
+
commit(undefined);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const n = Number(text);
|
|
48
|
+
if (Number.isFinite(n) && n >= min && n <= max) {
|
|
49
|
+
commit(n);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const handleBlur = () => {
|
|
53
|
+
if (draft === null)
|
|
54
|
+
return;
|
|
55
|
+
const n = Number(draft);
|
|
56
|
+
if (draft.trim() === '') {
|
|
57
|
+
commit(clearable ? undefined : value);
|
|
58
|
+
}
|
|
59
|
+
else if (Number.isFinite(n)) {
|
|
60
|
+
commit(clamp(n));
|
|
61
|
+
}
|
|
62
|
+
setDraft(null);
|
|
63
|
+
};
|
|
64
|
+
const canDecrement = !disabled && (value === undefined || value > min);
|
|
65
|
+
const canIncrement = !disabled && (value === undefined || value < max);
|
|
66
|
+
return (_jsxs(InputGroup, { className: cn('twa:w-32', className), "data-disabled": disabled ? true : undefined, "data-name": dataName, children: [_jsx(InputGroupAddon, { children: _jsx(InputGroupButton, { tabIndex: -1, "aria-label": "Decrease", disabled: !canDecrement, onClick: () => stepBy(-1), "data-name": dataName ? `${dataName}-decrement` : undefined, children: _jsx(MinusIcon, {}) }) }), _jsx(InputGroupInput, { ref: ref, type: "text", inputMode: "decimal", role: "spinbutton", autoComplete: "off", "aria-valuenow": value, "aria-valuemin": Number.isFinite(min) ? min : undefined, "aria-valuemax": Number.isFinite(max) ? max : undefined, disabled: disabled, value: draft ?? format(value), onChange: (event) => handleChange(event.target.value), onBlur: (event) => {
|
|
67
|
+
handleBlur();
|
|
68
|
+
onBlur?.(event);
|
|
69
|
+
}, onKeyDown: (event) => {
|
|
70
|
+
onKeyDown?.(event);
|
|
71
|
+
if (event.defaultPrevented)
|
|
72
|
+
return;
|
|
73
|
+
if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
|
|
74
|
+
event.preventDefault();
|
|
75
|
+
stepBy(event.key === 'ArrowUp' ? 1 : -1, event.shiftKey ? 10 : 1);
|
|
76
|
+
}
|
|
77
|
+
else if (event.key === 'Enter') {
|
|
78
|
+
handleBlur();
|
|
79
|
+
}
|
|
80
|
+
}, className: cn('twa:px-0 twa:text-center twa:tabular-nums', inputClassName), "data-name": dataName ? `${dataName}-input` : undefined, ...inputProps }), _jsx(InputGroupAddon, { align: "inline-end", children: _jsx(InputGroupButton, { tabIndex: -1, "aria-label": "Increase", disabled: !canIncrement, onClick: () => stepBy(1), "data-name": dataName ? `${dataName}-increment` : undefined, children: _jsx(PlusIcon, {}) }) })] }));
|
|
81
|
+
});
|
|
82
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/NumberInput/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,C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AAO,EAAE,CAAC;wBACjC,UAAU,EAAE,CAAC;oBACf,CAAC;gBACH,CAAC,EACD,SAAS,EAAE,EAAE,CAAC,2CAA2C,EAAE,cAAc,CAAC,eAC/D,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,QAAQ,CAAC,CAAC,CAAC,SAAS,KACjD,UAAU,GACd,EACF,KAAC,eAAe,IAAC,KAAK,EAAC,YAAY,YACjC,KAAC,gBAAgB,IACf,QAAQ,EAAE,CAAC,CAAC,gBACD,UAAU,EACrB,QAAQ,EAAE,CAAC,YAAY,EACvB,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,eACb,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,YAAY,CAAC,CAAC,CAAC,SAAS,YAEzD,KAAC,QAAQ,KAAG,GACK,GACH,IACP,CACd,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -268,6 +268,9 @@
|
|
|
268
268
|
.twa\:field-sizing-content {
|
|
269
269
|
field-sizing: content;
|
|
270
270
|
}
|
|
271
|
+
.twa\:aspect-auto {
|
|
272
|
+
aspect-ratio: auto;
|
|
273
|
+
}
|
|
271
274
|
.twa\:aspect-square {
|
|
272
275
|
aspect-ratio: 1 / 1;
|
|
273
276
|
}
|
|
@@ -315,10 +318,6 @@
|
|
|
315
318
|
width: calc(var(--ab-base-space) * 16);
|
|
316
319
|
height: calc(var(--ab-base-space) * 16);
|
|
317
320
|
}
|
|
318
|
-
.twa\:size-\[calc\(100\%-2\*var\(--ab-base-space\)\)\] {
|
|
319
|
-
width: calc(100% - 2 * var(--ab-base-space));
|
|
320
|
-
height: calc(100% - 2 * var(--ab-base-space));
|
|
321
|
-
}
|
|
322
321
|
.twa\:size-auto {
|
|
323
322
|
width: auto;
|
|
324
323
|
height: auto;
|
|
@@ -353,6 +352,9 @@
|
|
|
353
352
|
.twa\:h-\[calc\(100\%-1px\)\] {
|
|
354
353
|
height: calc(100% - 1px);
|
|
355
354
|
}
|
|
355
|
+
.twa\:h-\[calc\(100\%-2\*var\(--ab-base-space\)\)\] {
|
|
356
|
+
height: calc(100% - 2 * var(--ab-base-space));
|
|
357
|
+
}
|
|
356
358
|
.twa\:h-\[min\(22rem\,var\(--total-size\)\)\] {
|
|
357
359
|
height: min(22rem, var(--total-size));
|
|
358
360
|
}
|
|
@@ -410,6 +412,12 @@
|
|
|
410
412
|
.twa\:w-1 {
|
|
411
413
|
width: var(--ab-base-space);
|
|
412
414
|
}
|
|
415
|
+
.twa\:w-12 {
|
|
416
|
+
width: calc(var(--ab-base-space) * 12);
|
|
417
|
+
}
|
|
418
|
+
.twa\:w-32 {
|
|
419
|
+
width: calc(var(--ab-base-space) * 32);
|
|
420
|
+
}
|
|
413
421
|
.twa\:w-72 {
|
|
414
422
|
width: calc(var(--ab-base-space) * 72);
|
|
415
423
|
}
|
|
@@ -419,6 +427,9 @@
|
|
|
419
427
|
.twa\:w-\[1rem\] {
|
|
420
428
|
width: 1rem;
|
|
421
429
|
}
|
|
430
|
+
.twa\:w-\[300px\] {
|
|
431
|
+
width: 300px;
|
|
432
|
+
}
|
|
422
433
|
.twa\:w-auto {
|
|
423
434
|
width: auto;
|
|
424
435
|
}
|
|
@@ -819,6 +830,9 @@
|
|
|
819
830
|
.twa\:px-\(--cell-size\) {
|
|
820
831
|
padding-inline: var(--cell-size);
|
|
821
832
|
}
|
|
833
|
+
.twa\:px-0 {
|
|
834
|
+
padding-inline: 0px;
|
|
835
|
+
}
|
|
822
836
|
.twa\:px-1\.5 {
|
|
823
837
|
padding-inline: calc(var(--ab-base-space) * 1.5);
|
|
824
838
|
}
|
|
@@ -959,6 +973,10 @@
|
|
|
959
973
|
.twa\:text-white {
|
|
960
974
|
color: var(--twa-color-white);
|
|
961
975
|
}
|
|
976
|
+
.twa\:tabular-nums {
|
|
977
|
+
--tw-numeric-spacing: tabular-nums;
|
|
978
|
+
font-variant-numeric: var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);
|
|
979
|
+
}
|
|
962
980
|
.twa\:underline-offset-4 {
|
|
963
981
|
text-underline-offset: 4px;
|
|
964
982
|
}
|
|
@@ -2654,26 +2672,26 @@
|
|
|
2654
2672
|
--ab-color-palette-10: #4a5568;
|
|
2655
2673
|
--ab-color-palette-11: #f3e8ff;
|
|
2656
2674
|
--ab-color-palette-12: #553c9a;
|
|
2657
|
-
--ab-color-
|
|
2658
|
-
--ab-color-
|
|
2659
|
-
--ab-color-
|
|
2660
|
-
--ab-color-
|
|
2661
|
-
--ab-color-
|
|
2662
|
-
--ab-color-
|
|
2663
|
-
--ab-color-
|
|
2664
|
-
--ab-color-
|
|
2665
|
-
--ab-color-
|
|
2666
|
-
--ab-color-
|
|
2667
|
-
--ab-color-
|
|
2668
|
-
--ab-color-
|
|
2669
|
-
--ab-color-
|
|
2670
|
-
--ab-color-
|
|
2671
|
-
--ab-color-
|
|
2672
|
-
--ab-color-
|
|
2673
|
-
--ab-color-
|
|
2674
|
-
--ab-color-
|
|
2675
|
-
--ab-color-
|
|
2676
|
-
--ab-color-
|
|
2675
|
+
--ab-color-palette-13: #000000;
|
|
2676
|
+
--ab-color-palette-14: #ffffff;
|
|
2677
|
+
--ab-color-palette-15: #d3d3d3;
|
|
2678
|
+
--ab-color-palette-16: #808080;
|
|
2679
|
+
--ab-color-palette-17: #a52a2a;
|
|
2680
|
+
--ab-color-palette-18: #006400;
|
|
2681
|
+
--ab-color-palette-19: #008000;
|
|
2682
|
+
--ab-color-palette-20: #32cd32;
|
|
2683
|
+
--ab-color-palette-21: #ffff00;
|
|
2684
|
+
--ab-color-palette-22: #ffffe0;
|
|
2685
|
+
--ab-color-palette-23: #00008b;
|
|
2686
|
+
--ab-color-palette-24: #0000ff;
|
|
2687
|
+
--ab-color-palette-25: #87cefa;
|
|
2688
|
+
--ab-color-palette-26: #00ffff;
|
|
2689
|
+
--ab-color-palette-27: #ff00ff;
|
|
2690
|
+
--ab-color-palette-28: #800080;
|
|
2691
|
+
--ab-color-palette-29: #8b0000;
|
|
2692
|
+
--ab-color-palette-30: #ff0000;
|
|
2693
|
+
--ab-color-palette-31: #dc143c;
|
|
2694
|
+
--ab-color-palette-32: #ffa500;
|
|
2677
2695
|
--ab-icon-fill: currentColor;
|
|
2678
2696
|
--ab-custom-scrollbar-size: 8px;
|
|
2679
2697
|
--ab-color-custom-scrollbar-track: var(--ab-color-background);
|
|
@@ -2930,6 +2948,26 @@
|
|
|
2930
2948
|
syntax: "*";
|
|
2931
2949
|
inherits: false;
|
|
2932
2950
|
}
|
|
2951
|
+
@property --tw-ordinal {
|
|
2952
|
+
syntax: "*";
|
|
2953
|
+
inherits: false;
|
|
2954
|
+
}
|
|
2955
|
+
@property --tw-slashed-zero {
|
|
2956
|
+
syntax: "*";
|
|
2957
|
+
inherits: false;
|
|
2958
|
+
}
|
|
2959
|
+
@property --tw-numeric-figure {
|
|
2960
|
+
syntax: "*";
|
|
2961
|
+
inherits: false;
|
|
2962
|
+
}
|
|
2963
|
+
@property --tw-numeric-spacing {
|
|
2964
|
+
syntax: "*";
|
|
2965
|
+
inherits: false;
|
|
2966
|
+
}
|
|
2967
|
+
@property --tw-numeric-fraction {
|
|
2968
|
+
syntax: "*";
|
|
2969
|
+
inherits: false;
|
|
2970
|
+
}
|
|
2933
2971
|
@property --tw-shadow {
|
|
2934
2972
|
syntax: "*";
|
|
2935
2973
|
inherits: false;
|
|
@@ -3159,6 +3197,11 @@
|
|
|
3159
3197
|
--tw-leading: initial;
|
|
3160
3198
|
--tw-font-weight: initial;
|
|
3161
3199
|
--tw-tracking: initial;
|
|
3200
|
+
--tw-ordinal: initial;
|
|
3201
|
+
--tw-slashed-zero: initial;
|
|
3202
|
+
--tw-numeric-figure: initial;
|
|
3203
|
+
--tw-numeric-spacing: initial;
|
|
3204
|
+
--tw-numeric-fraction: initial;
|
|
3162
3205
|
--tw-shadow: 0 0 #0000;
|
|
3163
3206
|
--tw-shadow-color: initial;
|
|
3164
3207
|
--tw-shadow-alpha: 100%;
|
|
@@ -15,12 +15,16 @@ export { Resizable, ResizablePanel, ResizableHandle } from './Resizable';
|
|
|
15
15
|
export type { ResizableProps, ResizablePanelProps, ResizableHandleProps, PanelSizeValue, ResizableSizes, ResizableSizeInput, } from './Resizable';
|
|
16
16
|
export { SearchInput } from './SearchInput';
|
|
17
17
|
export type { SearchInputProps } from './SearchInput';
|
|
18
|
+
export { NumberInput } from './NumberInput';
|
|
19
|
+
export type { NumberInputProps } from './NumberInput';
|
|
18
20
|
export { Tooltip } from './Tooltip';
|
|
19
21
|
export type { TooltipProps } from './Tooltip';
|
|
20
22
|
export { Button } from './Button';
|
|
21
23
|
export type { ButtonProps } from './Button';
|
|
22
|
-
export { ColorPicker, CHECKERBOARD, HEX_COLOR, describeColor,
|
|
23
|
-
export type { ColorPickerProps, ColorPickerTab, ThemeColor, ThemeColorGroup, } from './ColorPicker';
|
|
24
|
+
export { ALLOWED_COLORS_VAR, ColorPicker, CHECKERBOARD, HEX_COLOR, describeColor, PALETTE_COUNT_VAR, parseTabs, readAllowedColors, readPaletteColors, readTabs, TABS_VAR, THEME_COLOR_GROUP, setColorPickerTab, useColorPickerTab, } from './ColorPicker';
|
|
25
|
+
export type { AllowedColors, ColorPickerProps, ColorPickerTab, ThemeColor, ThemeColorGroup, } from './ColorPicker';
|
|
26
|
+
export { ColorField } from './ColorField';
|
|
27
|
+
export type { ColorFieldProps } from './ColorField';
|
|
24
28
|
export { DropdownButton, NewDropdownButton } from './DropdownButton';
|
|
25
29
|
export type { DropdownButtonItem, DropdownButtonProps, NewDropdownButtonItem, NewDropdownButtonProps, } from './DropdownButton';
|
|
26
30
|
export type { TreeListItem, NewTreeDropdownProps, GridFilterTreeDropdownProps, } from './Tree/TreeDropdown';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,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BAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAI7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
|
@@ -8,11 +8,13 @@ export { SingleCombobox, MultiCombobox, GridFilterCombobox, GRID_FILTER_COMBBOX_
|
|
|
8
8
|
export { SingleSelect, MultiSelect } from './Select';
|
|
9
9
|
export { Resizable, ResizablePanel, ResizableHandle } from './Resizable';
|
|
10
10
|
export { SearchInput } from './SearchInput';
|
|
11
|
+
export { NumberInput } from './NumberInput';
|
|
11
12
|
export { Tooltip } from './Tooltip';
|
|
12
13
|
// Shadows the star export from ./ui/button below (explicit exports win):
|
|
13
14
|
// same Button, plus a `tooltip` prop.
|
|
14
15
|
export { Button } from './Button';
|
|
15
|
-
export { ColorPicker, CHECKERBOARD, HEX_COLOR, describeColor,
|
|
16
|
+
export { ALLOWED_COLORS_VAR, ColorPicker, CHECKERBOARD, HEX_COLOR, describeColor, PALETTE_COUNT_VAR, parseTabs, readAllowedColors, readPaletteColors, readTabs, TABS_VAR, THEME_COLOR_GROUP, setColorPickerTab, useColorPickerTab, } from './ColorPicker';
|
|
17
|
+
export { ColorField } from './ColorField';
|
|
16
18
|
export { DropdownButton, NewDropdownButton } from './DropdownButton';
|
|
17
19
|
export { toDisplayValueDefault, toDisplayValueFromOptionTree } from './Tree/treeUtils';
|
|
18
20
|
export * from './ui/alert-dialog';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,2BAA2B,EAC3B,wBAAwB,GACzB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAElE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AASrD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAGxE,OAAO,EACL,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,yCAAyC,GAC1C,MAAM,YAAY,CAAC;AAQpB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAErD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAUzE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,yEAAyE;AACzE,sCAAsC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,OAAO,EACL,WAAW,EACX,YAAY,EACZ,SAAS,EACT,aAAa,EACb,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,2BAA2B,EAC3B,wBAAwB,GACzB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,UAA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CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,0EAA0E;AAC1E,uEAAuE;AACvE,4EAA4E;AAC5E,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
|
@@ -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"],"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ChD,OAAO;YACT,CAAC;YACD,CAAC,CAAC,aAAa,CAAC,aAAa,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC;QACjE,CAAC,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,MAAM,wBAAwB,GAAG,GAAG;AAClC,
|
|
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,WAAW,EACT,8HAA8H;SACjI;KACF;IACD,eAAe,EAAE;QACf,KAAK,EAAE,cAAc;KACtB;CACF,CACF,CAAC;AAEF,SAAS,eAAe,CAAC,EACvB,SAAS,EACT,KAAK,GAAG,cAAc,EACtB,GAAG,KAAK,EACmE;IAC3E,O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T,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,SAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAgC;IAC3E,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,kJAAkJ,EAClJ,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CACtC,SAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG;IACnD,OAAO,CACL,KAAC,KAAK,iBACM,qBAAqB,EAC/B,SAAS,EAAE,EAAE,CACX,iMAAiM,EACjM,oEAAoE,EACpE,SAAS,CACV,EACD,GAAG,EAAE,GAAG,KACJ,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,kBAAkB,GAAG,KAAK,CAAC,UAAU,CAGzC,SAAS,kBAAkB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG;IACxD,OAAO,CACL,KAAC,QAAQ,iBACG,qBAAqB,EAC/B,SAAS,EAAE,EAAE,CACX,0LAA0L,EAC1L,SAAS,CACV,KACG,KAAK,EACT,GAAG,EAAE,GAAG,GACR,CACH,CAAC;AACJ,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>;
|