@wallarm-org/design-system 0.77.4 → 0.77.5
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/components/FilterInput/FilterInputField/FilterInputChip/classes.d.ts +4 -2
- package/dist/components/FilterInput/FilterInputField/FilterInputChip/classes.js +1 -1
- package/dist/components/FilterInput/FilterInputField/FilterInputChip/constants.d.ts +6 -4
- package/dist/components/FilterInput/FilterInputField/FilterInputChip/constants.js +1 -1
- package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/useMenuFlow/useOperatorFlow.js +9 -0
- package/dist/metadata/components.json +2 -2
- package/package.json +1 -1
|
@@ -10,8 +10,10 @@ export declare const segmentContainer = "flex flex-col justify-center overflow-h
|
|
|
10
10
|
/** Hit target for an empty required value: a small full-height box so the value
|
|
11
11
|
* is clickable and the trailing × can't sit on top of it (AS-1192). */
|
|
12
12
|
export declare const emptyValueHitTarget = "min-w-[4px] self-stretch";
|
|
13
|
-
/**
|
|
14
|
-
|
|
13
|
+
/** The value edit input hugs its content (measured width + WIDTH_OFFSET). `min-w-0`
|
|
14
|
+
* drops the flex/intrinsic min-width so a short value like "f" isn't forced into a
|
|
15
|
+
* wide box; an empty value falls back to the sizer's MIN_INPUT_WIDTH floor. */
|
|
16
|
+
export declare const editingValueMinWidth = "min-w-0";
|
|
15
17
|
/** Segment text styles by variant */
|
|
16
18
|
export declare const segmentTextVariants: (props?: ({
|
|
17
19
|
variant?: "value" | "operator" | "attribute" | null | undefined;
|
|
@@ -36,7 +36,7 @@ const chipVariants = cva(`h-22 group/chip relative flex items-center justify-cen
|
|
|
36
36
|
});
|
|
37
37
|
const segmentContainer = 'flex flex-col justify-center overflow-hidden leading-none';
|
|
38
38
|
const emptyValueHitTarget = 'min-w-[4px] self-stretch';
|
|
39
|
-
const editingValueMinWidth = 'min-w-
|
|
39
|
+
const editingValueMinWidth = 'min-w-0';
|
|
40
40
|
const segmentTextVariants = cva('truncate text-sm', {
|
|
41
41
|
variants: {
|
|
42
42
|
variant: {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/** Minimum input width in px */
|
|
2
2
|
export declare const MIN_INPUT_WIDTH = 4;
|
|
3
|
-
/** Maximum
|
|
4
|
-
*
|
|
3
|
+
/** Maximum measured content width in px before the edit input stops growing
|
|
4
|
+
* (the rendered width is this + WIDTH_OFFSET); caps a long value so it can't
|
|
5
|
+
* grow past the chip, beyond which it scrolls content natively. */
|
|
5
6
|
export declare const MAX_INPUT_WIDTH = 280;
|
|
6
|
-
/** Extra pixels added to measured width
|
|
7
|
-
|
|
7
|
+
/** Extra pixels added to measured width: caret room so the edit input sits at
|
|
8
|
+
* the entered text width + 4px (prevents clipping and the caret hugging the edge). */
|
|
9
|
+
export declare const WIDTH_OFFSET = 4;
|
|
8
10
|
/** Approximate width of a single character in px (text-sm fallback) */
|
|
9
11
|
export declare const CHAR_WIDTH_PX = 8;
|
package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/useMenuFlow/useOperatorFlow.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useCallback } from "react";
|
|
2
|
+
import { flushSync } from "react-dom";
|
|
2
3
|
import { SEGMENT_VARIANT } from "../../../FilterInputField/FilterInputChip/index.js";
|
|
3
4
|
import { OPERATOR_SYMBOLS, chipIdToConditionIndex, getFieldOperators, getOperatorFromLabel, isNoValueOperator, isOperatorAllowedForField, isValueShapeCompatible } from "../../../lib/index.js";
|
|
4
5
|
const useOperatorFlow = ({ editing, selectedField, selectedOperator, insertIndex, upsertCondition, conditionsRef, resetState, setSelectedOperator, setMenuState, setBuildingMultiValue, setInputText, buildingSide, buildingBase, setBuildingBase, setBuildingSide })=>{
|
|
@@ -49,6 +50,14 @@ const useOperatorFlow = ({ editing, selectedField, selectedOperator, insertIndex
|
|
|
49
50
|
setSegmentFilterText('');
|
|
50
51
|
}
|
|
51
52
|
}
|
|
53
|
+
if (!editingChipId) {
|
|
54
|
+
flushSync(()=>{
|
|
55
|
+
setSelectedOperator(operator);
|
|
56
|
+
setInputText('');
|
|
57
|
+
});
|
|
58
|
+
setMenuState('value');
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
52
61
|
setSelectedOperator(operator);
|
|
53
62
|
setInputText('');
|
|
54
63
|
setMenuState('value');
|