@servicetitan/dte-unlayer 0.111.0 → 0.112.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/display-conditions/ConditionGroup.d.ts +1 -4
- package/dist/display-conditions/ConditionGroup.d.ts.map +1 -1
- package/dist/display-conditions/ConditionGroup.js +38 -115
- package/dist/display-conditions/ConditionGroup.js.map +1 -1
- package/dist/display-conditions/ConditionGroupsSection.d.ts +6 -3
- package/dist/display-conditions/ConditionGroupsSection.d.ts.map +1 -1
- package/dist/display-conditions/ConditionGroupsSection.js +62 -57
- package/dist/display-conditions/ConditionGroupsSection.js.map +1 -1
- package/dist/display-conditions/ConditionRow.d.ts.map +1 -1
- package/dist/display-conditions/ConditionRow.js +15 -11
- package/dist/display-conditions/ConditionRow.js.map +1 -1
- package/dist/display-conditions/DisplayConditionModal.d.ts.map +1 -1
- package/dist/display-conditions/DisplayConditionModal.js +86 -115
- package/dist/display-conditions/DisplayConditionModal.js.map +1 -1
- package/dist/display-conditions/nunjucks.d.ts.map +1 -1
- package/dist/display-conditions/nunjucks.js +11 -3
- package/dist/display-conditions/nunjucks.js.map +1 -1
- package/package.json +1 -1
- package/src/display-conditions/ConditionGroup.tsx +5 -68
- package/src/display-conditions/ConditionGroupsSection.tsx +41 -44
- package/src/display-conditions/ConditionRow.tsx +18 -8
- package/src/display-conditions/DisplayConditionModal.tsx +101 -92
- package/src/display-conditions/nunjucks.ts +13 -2
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { ConditionGroup as ConditionGroupType } from './types';
|
|
2
2
|
import type { DataPointOption } from './types';
|
|
3
3
|
export interface ConditionGroupProps {
|
|
4
|
-
canDelete: boolean;
|
|
5
4
|
dataPointOptions: DataPointOption[];
|
|
6
5
|
group: ConditionGroupType;
|
|
7
|
-
onDelete: () => void;
|
|
8
6
|
onUpdate: (g: ConditionGroupType) => void;
|
|
9
|
-
ruleIndex: number;
|
|
10
7
|
}
|
|
11
|
-
export declare function ConditionGroup({
|
|
8
|
+
export declare function ConditionGroup({ dataPointOptions, group, onUpdate, }: Readonly<ConditionGroupProps>): import("react/jsx-runtime").JSX.Element;
|
|
12
9
|
//# sourceMappingURL=ConditionGroup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionGroup.d.ts","sourceRoot":"","sources":["../../src/display-conditions/ConditionGroup.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConditionGroup.d.ts","sourceRoot":"","sources":["../../src/display-conditions/ConditionGroup.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,IAAI,kBAAkB,EAAmB,MAAM,SAAS,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,WAAW,mBAAmB;IAChC,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,QAAQ,EAAE,CAAC,CAAC,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAC7C;AAED,wBAAgB,cAAc,CAAC,EAC3B,gBAAgB,EAChB,KAAK,EACL,QAAQ,GACX,EAAE,QAAQ,CAAC,mBAAmB,CAAC,2CA+D/B"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button, Flex
|
|
2
|
+
import { Button, Flex } from '@servicetitan/anvil2';
|
|
3
3
|
import PlusIcon from '@servicetitan/anvil2/assets/icons/material/round/add.svg';
|
|
4
|
-
import TrashIcon from '@servicetitan/anvil2/assets/icons/material/round/delete.svg';
|
|
5
4
|
import { useCallback } from 'react';
|
|
6
5
|
import { ConditionRow } from './ConditionRow';
|
|
7
6
|
import { defaultCondition } from './constants';
|
|
8
|
-
export function ConditionGroup({
|
|
7
|
+
export function ConditionGroup({ dataPointOptions, group, onUpdate }) {
|
|
9
8
|
const addCondition = useCallback(()=>{
|
|
10
9
|
const newCondition = {
|
|
11
10
|
...defaultCondition(),
|
|
@@ -37,9 +36,8 @@ export function ConditionGroup({ canDelete, dataPointOptions, group, onDelete, o
|
|
|
37
36
|
]);
|
|
38
37
|
const removeCondition = useCallback((index)=>{
|
|
39
38
|
let next = group.conditions.filter((_, i)=>i !== index);
|
|
40
|
-
// If we removed the first condition, clear logicalOperator on the new first
|
|
41
39
|
if (index === 0 && next.length > 0) {
|
|
42
|
-
const { logicalOperator:
|
|
40
|
+
const { logicalOperator: _unusedOp, ...rest } = next[0];
|
|
43
41
|
next = [
|
|
44
42
|
rest,
|
|
45
43
|
...next.slice(1)
|
|
@@ -55,126 +53,51 @@ export function ConditionGroup({ canDelete, dataPointOptions, group, onDelete, o
|
|
|
55
53
|
group,
|
|
56
54
|
onUpdate
|
|
57
55
|
]);
|
|
58
|
-
|
|
59
|
-
const next = [
|
|
60
|
-
...group.conditions
|
|
61
|
-
];
|
|
62
|
-
next[conditionIndex] = {
|
|
63
|
-
...next[conditionIndex],
|
|
64
|
-
logicalOperator: value
|
|
65
|
-
};
|
|
66
|
-
onUpdate({
|
|
67
|
-
...group,
|
|
68
|
-
conditions: next
|
|
69
|
-
});
|
|
70
|
-
}, [
|
|
71
|
-
group,
|
|
72
|
-
onUpdate
|
|
73
|
-
]);
|
|
74
|
-
return /*#__PURE__*/ _jsxs(Flex, {
|
|
56
|
+
return /*#__PURE__*/ _jsx(Flex, {
|
|
75
57
|
direction: "column",
|
|
76
58
|
gap: "2",
|
|
77
59
|
style: {
|
|
78
60
|
width: '100%'
|
|
79
61
|
},
|
|
80
|
-
children:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
size: "medium",
|
|
91
|
-
variant: "body",
|
|
62
|
+
children: /*#__PURE__*/ _jsxs(Flex, {
|
|
63
|
+
direction: "column",
|
|
64
|
+
gap: "3",
|
|
65
|
+
style: {
|
|
66
|
+
width: '100%'
|
|
67
|
+
},
|
|
68
|
+
children: [
|
|
69
|
+
group.conditions.map((c, i)=>/*#__PURE__*/ _jsx(Flex, {
|
|
70
|
+
direction: "column",
|
|
71
|
+
gap: "3",
|
|
92
72
|
style: {
|
|
93
|
-
|
|
73
|
+
padding: '8px 0'
|
|
94
74
|
},
|
|
95
|
-
children:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
75
|
+
children: /*#__PURE__*/ _jsx(ConditionRow, {
|
|
76
|
+
canRemove: true,
|
|
77
|
+
condition: c,
|
|
78
|
+
dataPointOptions: dataPointOptions,
|
|
79
|
+
onChange: (next)=>updateCondition(i, next),
|
|
80
|
+
onRemove: ()=>removeCondition(i)
|
|
81
|
+
})
|
|
82
|
+
}, c.id)),
|
|
83
|
+
/*#__PURE__*/ _jsx(Flex, {
|
|
84
|
+
justifyContent: "center",
|
|
85
|
+
style: {
|
|
86
|
+
paddingTop: 8,
|
|
87
|
+
width: '100%'
|
|
88
|
+
},
|
|
89
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
90
|
+
appearance: "secondary",
|
|
103
91
|
icon: {
|
|
104
|
-
before:
|
|
92
|
+
before: PlusIcon
|
|
105
93
|
},
|
|
106
|
-
size: "
|
|
107
|
-
onClick:
|
|
94
|
+
size: "small",
|
|
95
|
+
onClick: addCondition,
|
|
96
|
+
children: "Add Condition"
|
|
108
97
|
})
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
direction: "column",
|
|
113
|
-
gap: "3",
|
|
114
|
-
style: {
|
|
115
|
-
backgroundColor: '#fff',
|
|
116
|
-
border: '1px solid #e0e0e0',
|
|
117
|
-
borderRadius: 8,
|
|
118
|
-
padding: 12,
|
|
119
|
-
width: '100%'
|
|
120
|
-
},
|
|
121
|
-
children: [
|
|
122
|
-
group.conditions.map((c, i)=>{
|
|
123
|
-
var _c_logicalOperator;
|
|
124
|
-
return /*#__PURE__*/ _jsxs(Flex, {
|
|
125
|
-
direction: "column",
|
|
126
|
-
gap: "3",
|
|
127
|
-
style: {
|
|
128
|
-
padding: '8px 0'
|
|
129
|
-
},
|
|
130
|
-
children: [
|
|
131
|
-
i > 0 && /*#__PURE__*/ _jsx(Flex, {
|
|
132
|
-
justifyContent: "center",
|
|
133
|
-
alignItems: "center",
|
|
134
|
-
gap: "2",
|
|
135
|
-
children: /*#__PURE__*/ _jsxs(SegmentedControl, {
|
|
136
|
-
selected: (_c_logicalOperator = c.logicalOperator) !== null && _c_logicalOperator !== void 0 ? _c_logicalOperator : 'and',
|
|
137
|
-
onChange: (v)=>handleLogicalOperatorChange(i, v),
|
|
138
|
-
children: [
|
|
139
|
-
/*#__PURE__*/ _jsx(SegmentedControl.Segment, {
|
|
140
|
-
value: "and",
|
|
141
|
-
children: "And"
|
|
142
|
-
}),
|
|
143
|
-
/*#__PURE__*/ _jsx(SegmentedControl.Segment, {
|
|
144
|
-
value: "or",
|
|
145
|
-
children: "Or"
|
|
146
|
-
})
|
|
147
|
-
]
|
|
148
|
-
})
|
|
149
|
-
}),
|
|
150
|
-
/*#__PURE__*/ _jsx(ConditionRow, {
|
|
151
|
-
canRemove: true,
|
|
152
|
-
condition: c,
|
|
153
|
-
dataPointOptions: dataPointOptions,
|
|
154
|
-
onChange: (next)=>updateCondition(i, next),
|
|
155
|
-
onRemove: ()=>removeCondition(i)
|
|
156
|
-
})
|
|
157
|
-
]
|
|
158
|
-
}, c.id);
|
|
159
|
-
}),
|
|
160
|
-
/*#__PURE__*/ _jsx(Flex, {
|
|
161
|
-
justifyContent: "center",
|
|
162
|
-
style: {
|
|
163
|
-
paddingTop: 8,
|
|
164
|
-
width: '100%'
|
|
165
|
-
},
|
|
166
|
-
children: /*#__PURE__*/ _jsx(Button, {
|
|
167
|
-
appearance: "secondary",
|
|
168
|
-
icon: {
|
|
169
|
-
before: PlusIcon
|
|
170
|
-
},
|
|
171
|
-
onClick: addCondition,
|
|
172
|
-
children: "Add Condition"
|
|
173
|
-
})
|
|
174
|
-
})
|
|
175
|
-
]
|
|
176
|
-
})
|
|
177
|
-
]
|
|
98
|
+
})
|
|
99
|
+
]
|
|
100
|
+
})
|
|
178
101
|
});
|
|
179
102
|
}
|
|
180
103
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/display-conditions/ConditionGroup.tsx"],"sourcesContent":["import { Button, Flex
|
|
1
|
+
{"version":3,"sources":["../../src/display-conditions/ConditionGroup.tsx"],"sourcesContent":["import { Button, Flex } from '@servicetitan/anvil2';\nimport PlusIcon from '@servicetitan/anvil2/assets/icons/material/round/add.svg';\nimport { useCallback } from 'react';\nimport { ConditionRow } from './ConditionRow';\nimport { defaultCondition } from './constants';\nimport { ConditionGroup as ConditionGroupType, SingleCondition } from './types';\nimport type { DataPointOption } from './types';\n\nexport interface ConditionGroupProps {\n dataPointOptions: DataPointOption[];\n group: ConditionGroupType;\n onUpdate: (g: ConditionGroupType) => void;\n}\n\nexport function ConditionGroup({\n dataPointOptions,\n group,\n onUpdate,\n}: Readonly<ConditionGroupProps>) {\n const addCondition = useCallback(() => {\n const newCondition: SingleCondition = {\n ...defaultCondition(),\n logicalOperator: 'and',\n };\n onUpdate({\n ...group,\n conditions: [...group.conditions, newCondition],\n });\n }, [group, onUpdate]);\n\n const updateCondition = useCallback(\n (index: number, c: SingleCondition) => {\n const next = [...group.conditions];\n next[index] = c;\n onUpdate({ ...group, conditions: next });\n },\n [group, onUpdate],\n );\n\n const removeCondition = useCallback(\n (index: number) => {\n let next = group.conditions.filter((_, i) => i !== index);\n if (index === 0 && next.length > 0) {\n const { logicalOperator: _unusedOp, ...rest } = next[0];\n next = [rest as SingleCondition, ...next.slice(1)];\n }\n onUpdate({\n ...group,\n conditions: next.length ? next : [defaultCondition()],\n });\n },\n [group, onUpdate],\n );\n\n return (\n <Flex direction=\"column\" gap=\"2\" style={{ width: '100%' }}>\n <Flex direction=\"column\" gap=\"3\" style={{ width: '100%' }}>\n {group.conditions.map((c, i) => (\n <Flex key={c.id} direction=\"column\" gap=\"3\" style={{ padding: '8px 0' }}>\n <ConditionRow\n canRemove\n condition={c}\n dataPointOptions={dataPointOptions}\n onChange={next => updateCondition(i, next)}\n onRemove={() => removeCondition(i)}\n />\n </Flex>\n ))}\n <Flex justifyContent=\"center\" style={{ paddingTop: 8, width: '100%' }}>\n <Button\n appearance=\"secondary\"\n icon={{ before: PlusIcon }}\n size=\"small\"\n onClick={addCondition}\n >\n Add Condition\n </Button>\n </Flex>\n </Flex>\n </Flex>\n );\n}\n"],"names":["Button","Flex","PlusIcon","useCallback","ConditionRow","defaultCondition","ConditionGroup","dataPointOptions","group","onUpdate","addCondition","newCondition","logicalOperator","conditions","updateCondition","index","c","next","removeCondition","filter","_","i","length","_unusedOp","rest","slice","direction","gap","style","width","map","padding","canRemove","condition","onChange","onRemove","id","justifyContent","paddingTop","appearance","icon","before","size","onClick"],"mappings":";AAAA,SAASA,MAAM,EAAEC,IAAI,QAAQ,uBAAuB;AACpD,OAAOC,cAAc,2DAA2D;AAChF,SAASC,WAAW,QAAQ,QAAQ;AACpC,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,gBAAgB,QAAQ,cAAc;AAU/C,OAAO,SAASC,eAAe,EAC3BC,gBAAgB,EAChBC,KAAK,EACLC,QAAQ,EACoB;IAC5B,MAAMC,eAAeP,YAAY;QAC7B,MAAMQ,eAAgC;YAClC,GAAGN,kBAAkB;YACrBO,iBAAiB;QACrB;QACAH,SAAS;YACL,GAAGD,KAAK;YACRK,YAAY;mBAAIL,MAAMK,UAAU;gBAAEF;aAAa;QACnD;IACJ,GAAG;QAACH;QAAOC;KAAS;IAEpB,MAAMK,kBAAkBX,YACpB,CAACY,OAAeC;QACZ,MAAMC,OAAO;eAAIT,MAAMK,UAAU;SAAC;QAClCI,IAAI,CAACF,MAAM,GAAGC;QACdP,SAAS;YAAE,GAAGD,KAA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2
|
import { ConditionGroup as ConditionGroupType } from './types';
|
|
2
3
|
import type { DataPointOption } from './types';
|
|
4
|
+
export type MatchType = 'all' | 'any';
|
|
3
5
|
export interface ConditionGroupsSectionProps {
|
|
6
|
+
behaviorSection?: ReactNode;
|
|
4
7
|
dataPointOptions: DataPointOption[];
|
|
5
8
|
groups: ConditionGroupType[];
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
matchType: MatchType;
|
|
10
|
+
onMatchTypeChange: (matchType: MatchType) => void;
|
|
8
11
|
onUpdateGroup: (index: number, group: ConditionGroupType) => void;
|
|
9
12
|
}
|
|
10
|
-
export declare function ConditionGroupsSection({ dataPointOptions, groups,
|
|
13
|
+
export declare function ConditionGroupsSection({ behaviorSection, dataPointOptions, groups, matchType, onMatchTypeChange, onUpdateGroup, }: Readonly<ConditionGroupsSectionProps>): import("react/jsx-runtime").JSX.Element | null;
|
|
11
14
|
//# sourceMappingURL=ConditionGroupsSection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionGroupsSection.d.ts","sourceRoot":"","sources":["../../src/display-conditions/ConditionGroupsSection.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConditionGroupsSection.d.ts","sourceRoot":"","sources":["../../src/display-conditions/ConditionGroupsSection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,KAAK,CAAC;AAEtC,MAAM,WAAW,2BAA2B;IACxC,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,SAAS,EAAE,SAAS,CAAC;IACrB,iBAAiB,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;IAClD,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACrE;AAED,wBAAgB,sBAAsB,CAAC,EACnC,eAAe,EACf,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,iBAAiB,EACjB,aAAa,GAChB,EAAE,QAAQ,CAAC,2BAA2B,CAAC,kDAoCvC"}
|
|
@@ -1,68 +1,73 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import PlusIcon from '@servicetitan/anvil2/assets/icons/material/round/add.svg';
|
|
2
|
+
import { Chip, Flex, SegmentedControl, Text } from '@servicetitan/anvil2';
|
|
4
3
|
import { ConditionGroup } from './ConditionGroup';
|
|
5
|
-
export function ConditionGroupsSection({ dataPointOptions, groups,
|
|
4
|
+
export function ConditionGroupsSection({ behaviorSection, dataPointOptions, groups, matchType, onMatchTypeChange, onUpdateGroup }) {
|
|
5
|
+
const firstGroup = groups[0];
|
|
6
|
+
if (!firstGroup) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
6
9
|
return /*#__PURE__*/ _jsxs(Flex, {
|
|
7
10
|
direction: "column",
|
|
8
11
|
gap: "4",
|
|
9
12
|
children: [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
gap: "3",
|
|
15
|
-
children: [
|
|
16
|
-
index > 0 && /*#__PURE__*/ _jsx(Flex, {
|
|
17
|
-
justifyContent: "center",
|
|
18
|
-
alignItems: "center",
|
|
19
|
-
gap: "2",
|
|
20
|
-
style: {
|
|
21
|
-
padding: '12px'
|
|
22
|
-
},
|
|
23
|
-
children: /*#__PURE__*/ _jsxs(SegmentedControl, {
|
|
24
|
-
selected: (_group_logicalOperator = group.logicalOperator) !== null && _group_logicalOperator !== void 0 ? _group_logicalOperator : 'and',
|
|
25
|
-
onChange: (value)=>onUpdateGroup(index, {
|
|
26
|
-
...group,
|
|
27
|
-
logicalOperator: value
|
|
28
|
-
}),
|
|
29
|
-
children: [
|
|
30
|
-
/*#__PURE__*/ _jsx(SegmentedControl.Segment, {
|
|
31
|
-
value: "and",
|
|
32
|
-
children: "And"
|
|
33
|
-
}),
|
|
34
|
-
/*#__PURE__*/ _jsx(SegmentedControl.Segment, {
|
|
35
|
-
value: "or",
|
|
36
|
-
children: "Or"
|
|
37
|
-
})
|
|
38
|
-
]
|
|
39
|
-
})
|
|
40
|
-
}),
|
|
41
|
-
/*#__PURE__*/ _jsx(ConditionGroup, {
|
|
42
|
-
canDelete: groups.length > 1,
|
|
43
|
-
dataPointOptions: dataPointOptions,
|
|
44
|
-
group: group,
|
|
45
|
-
onDelete: ()=>onRemoveGroup(index),
|
|
46
|
-
onUpdate: (g)=>onUpdateGroup(index, g),
|
|
47
|
-
ruleIndex: index
|
|
48
|
-
})
|
|
49
|
-
]
|
|
50
|
-
}, group.id);
|
|
51
|
-
}),
|
|
52
|
-
/*#__PURE__*/ _jsx(Flex, {
|
|
53
|
-
justifyContent: "center",
|
|
13
|
+
/*#__PURE__*/ _jsxs(Flex, {
|
|
14
|
+
direction: "row",
|
|
15
|
+
alignItems: "center",
|
|
16
|
+
gap: "1",
|
|
54
17
|
style: {
|
|
55
|
-
|
|
56
|
-
width: '100%'
|
|
18
|
+
flexWrap: 'wrap'
|
|
57
19
|
},
|
|
58
|
-
children:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
20
|
+
children: [
|
|
21
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
22
|
+
size: "small",
|
|
23
|
+
variant: "body",
|
|
24
|
+
style: {
|
|
25
|
+
fontWeight: 'bold'
|
|
26
|
+
},
|
|
27
|
+
children: "When"
|
|
28
|
+
}),
|
|
29
|
+
/*#__PURE__*/ _jsxs(SegmentedControl, {
|
|
30
|
+
selected: matchType,
|
|
31
|
+
size: "small",
|
|
32
|
+
onChange: (value)=>onMatchTypeChange(value),
|
|
33
|
+
children: [
|
|
34
|
+
/*#__PURE__*/ _jsx(SegmentedControl.Segment, {
|
|
35
|
+
value: "all",
|
|
36
|
+
children: "All"
|
|
37
|
+
}),
|
|
38
|
+
/*#__PURE__*/ _jsx(SegmentedControl.Segment, {
|
|
39
|
+
value: "any",
|
|
40
|
+
children: "Any"
|
|
41
|
+
})
|
|
42
|
+
]
|
|
43
|
+
}),
|
|
44
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
45
|
+
size: "small",
|
|
46
|
+
variant: "body",
|
|
47
|
+
style: {
|
|
48
|
+
fontWeight: 'bold'
|
|
49
|
+
},
|
|
50
|
+
children: "of the"
|
|
51
|
+
}),
|
|
52
|
+
/*#__PURE__*/ _jsx(Chip, {
|
|
53
|
+
label: "IF",
|
|
54
|
+
size: "small"
|
|
55
|
+
}),
|
|
56
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
57
|
+
size: "small",
|
|
58
|
+
variant: "body",
|
|
59
|
+
style: {
|
|
60
|
+
fontWeight: 'bold'
|
|
61
|
+
},
|
|
62
|
+
children: "conditions are met"
|
|
63
|
+
})
|
|
64
|
+
]
|
|
65
|
+
}),
|
|
66
|
+
behaviorSection,
|
|
67
|
+
/*#__PURE__*/ _jsx(ConditionGroup, {
|
|
68
|
+
dataPointOptions: dataPointOptions,
|
|
69
|
+
group: firstGroup,
|
|
70
|
+
onUpdate: (g)=>onUpdateGroup(0, g)
|
|
66
71
|
})
|
|
67
72
|
]
|
|
68
73
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/display-conditions/ConditionGroupsSection.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../src/display-conditions/ConditionGroupsSection.tsx"],"sourcesContent":["import { Chip, Flex, SegmentedControl, Text } from '@servicetitan/anvil2';\nimport type { ReactNode } from 'react';\nimport { ConditionGroup } from './ConditionGroup';\nimport { ConditionGroup as ConditionGroupType } from './types';\nimport type { DataPointOption } from './types';\n\nexport type MatchType = 'all' | 'any';\n\nexport interface ConditionGroupsSectionProps {\n behaviorSection?: ReactNode;\n dataPointOptions: DataPointOption[];\n groups: ConditionGroupType[];\n matchType: MatchType;\n onMatchTypeChange: (matchType: MatchType) => void;\n onUpdateGroup: (index: number, group: ConditionGroupType) => void;\n}\n\nexport function ConditionGroupsSection({\n behaviorSection,\n dataPointOptions,\n groups,\n matchType,\n onMatchTypeChange,\n onUpdateGroup,\n}: Readonly<ConditionGroupsSectionProps>) {\n const firstGroup = groups[0];\n if (!firstGroup) {\n return null;\n }\n\n return (\n <Flex direction=\"column\" gap=\"4\">\n <Flex direction=\"row\" alignItems=\"center\" gap=\"1\" style={{ flexWrap: 'wrap' }}>\n <Text size=\"small\" variant=\"body\" style={{ fontWeight: 'bold' }}>\n When\n </Text>\n <SegmentedControl\n selected={matchType}\n size=\"small\"\n onChange={(value: string) => onMatchTypeChange(value as MatchType)}\n >\n <SegmentedControl.Segment value=\"all\">All</SegmentedControl.Segment>\n <SegmentedControl.Segment value=\"any\">Any</SegmentedControl.Segment>\n </SegmentedControl>\n <Text size=\"small\" variant=\"body\" style={{ fontWeight: 'bold' }}>\n of the\n </Text>\n <Chip label=\"IF\" size=\"small\" />\n <Text size=\"small\" variant=\"body\" style={{ fontWeight: 'bold' }}>\n conditions are met\n </Text>\n </Flex>\n {behaviorSection}\n <ConditionGroup\n dataPointOptions={dataPointOptions}\n group={firstGroup}\n onUpdate={g => onUpdateGroup(0, g)}\n />\n </Flex>\n );\n}\n"],"names":["Chip","Flex","SegmentedControl","Text","ConditionGroup","ConditionGroupsSection","behaviorSection","dataPointOptions","groups","matchType","onMatchTypeChange","onUpdateGroup","firstGroup","direction","gap","alignItems","style","flexWrap","size","variant","fontWeight","selected","onChange","value","Segment","label","group","onUpdate","g"],"mappings":";AAAA,SAASA,IAAI,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,uBAAuB;AAE1E,SAASC,cAAc,QAAQ,mBAAmB;AAelD,OAAO,SAASC,uBAAuB,EACnCC,eAAe,EACfC,gBAAgB,EAChBC,MAAM,EACNC,SAAS,EACTC,iBAAiB,EACjBC,aAAa,EACuB;IACpC,MAAMC,aAAaJ,MAAM,CAAC,EAAE;IAC5B,IAAI,CAACI,YAAY;QACb,OAAO;IACX;IAEA,qBACI,MAACX;QAAKY,WAAU;QAASC,KAAI;;0BACzB,MAACb;gBAAKY,WAAU;gBAAME,YAAW;gBAASD,KAAI;gBAAIE,OAAO;oBAAEC,UAAU;gBAAO;;kCACxE,KAACd;wBAAKe,MAAK;wBAAQC,SAAQ;wBAAOH,OAAO;4BAAEI,YAAY;wBAAO;kCAAG;;kCAGjE,MAAClB;wBACGmB,UAAUZ;wBACVS,MAAK;wBACLI,UAAU,CAACC,QAAkBb,kBAAkBa;;0CAE/C,KAACrB,iBAAiBsB,OAAO;gCAACD,OAAM;0CAAM;;0CACtC,KAACrB,iBAAiBsB,OAAO;gCAACD,OAAM;0CAAM;;;;kCAE1C,KAACpB;wBAAKe,MAAK;wBAAQC,SAAQ;wBAAOH,OAAO;4BAAEI,YAAY;wBAAO;kCAAG;;kCAGjE,KAACpB;wBAAKyB,OAAM;wBAAKP,MAAK;;kCACtB,KAACf;wBAAKe,MAAK;wBAAQC,SAAQ;wBAAOH,OAAO;4BAAEI,YAAY;wBAAO;kCAAG;;;;YAIpEd;0BACD,KAACF;gBACGG,kBAAkBA;gBAClBmB,OAAOd;gBACPe,UAAUC,CAAAA,IAAKjB,cAAc,GAAGiB;;;;AAIhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionRow.d.ts","sourceRoot":"","sources":["../../src/display-conditions/ConditionRow.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAoB,eAAe,EAA0C,MAAM,SAAS,CAAC;AACpG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,WAAW,iBAAiB;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,eAAe,CAAC;IAC3B,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,QAAQ,EAAE,CAAC,CAAC,EAAE,eAAe,KAAK,IAAI,CAAC;IACvC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB;AAsBD,wBAAgB,YAAY,CAAC,EACzB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,QAAQ,GACX,EAAE,QAAQ,CAAC,iBAAiB,CAAC,
|
|
1
|
+
{"version":3,"file":"ConditionRow.d.ts","sourceRoot":"","sources":["../../src/display-conditions/ConditionRow.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAoB,eAAe,EAA0C,MAAM,SAAS,CAAC;AACpG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,WAAW,iBAAiB;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,eAAe,CAAC;IAC3B,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,QAAQ,EAAE,CAAC,CAAC,EAAE,eAAe,KAAK,IAAI,CAAC;IACvC,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB;AAsBD,wBAAgB,YAAY,CAAC,EACzB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,QAAQ,GACX,EAAE,QAAQ,CAAC,iBAAiB,CAAC,2CA2J7B"}
|
|
@@ -77,17 +77,17 @@ export function ConditionRow({ canRemove, condition, dataPointOptions, onChange,
|
|
|
77
77
|
display: 'flex',
|
|
78
78
|
alignItems: 'flex-end',
|
|
79
79
|
flexShrink: 0,
|
|
80
|
-
padding: '
|
|
80
|
+
padding: '4px 8px'
|
|
81
81
|
},
|
|
82
82
|
children: /*#__PURE__*/ _jsx(Chip, {
|
|
83
83
|
label: "IF",
|
|
84
|
-
size: "
|
|
84
|
+
size: "small"
|
|
85
85
|
})
|
|
86
86
|
}),
|
|
87
87
|
/*#__PURE__*/ _jsx("div", {
|
|
88
88
|
style: {
|
|
89
|
-
flex: '2 1
|
|
90
|
-
minWidth:
|
|
89
|
+
flex: '2 1 240px',
|
|
90
|
+
minWidth: 200
|
|
91
91
|
},
|
|
92
92
|
children: /*#__PURE__*/ _jsxs(Combobox, {
|
|
93
93
|
...{
|
|
@@ -108,7 +108,8 @@ export function ConditionRow({ canRemove, condition, dataPointOptions, onChange,
|
|
|
108
108
|
children: [
|
|
109
109
|
/*#__PURE__*/ _jsx(Combobox.SelectTrigger, {
|
|
110
110
|
label: "Data point",
|
|
111
|
-
placeholder: "Select data point..."
|
|
111
|
+
placeholder: "Select data point...",
|
|
112
|
+
size: "small"
|
|
112
113
|
}),
|
|
113
114
|
/*#__PURE__*/ _jsx(Combobox.Content, {
|
|
114
115
|
children: ({ items })=>/*#__PURE__*/ _jsx(Combobox.List, {
|
|
@@ -124,8 +125,8 @@ export function ConditionRow({ canRemove, condition, dataPointOptions, onChange,
|
|
|
124
125
|
}),
|
|
125
126
|
/*#__PURE__*/ _jsx("div", {
|
|
126
127
|
style: {
|
|
127
|
-
flex: '1 1
|
|
128
|
-
minWidth:
|
|
128
|
+
flex: '1 1 180px',
|
|
129
|
+
minWidth: 150
|
|
129
130
|
},
|
|
130
131
|
children: /*#__PURE__*/ _jsxs(Combobox, {
|
|
131
132
|
...{
|
|
@@ -151,7 +152,8 @@ export function ConditionRow({ canRemove, condition, dataPointOptions, onChange,
|
|
|
151
152
|
children: [
|
|
152
153
|
/*#__PURE__*/ _jsx(Combobox.SelectTrigger, {
|
|
153
154
|
label: "Condition",
|
|
154
|
-
placeholder: "Select..."
|
|
155
|
+
placeholder: "Select...",
|
|
156
|
+
size: "small"
|
|
155
157
|
}),
|
|
156
158
|
/*#__PURE__*/ _jsx(Combobox.Content, {
|
|
157
159
|
children: ({ items })=>/*#__PURE__*/ _jsx(Combobox.List, {
|
|
@@ -167,11 +169,12 @@ export function ConditionRow({ canRemove, condition, dataPointOptions, onChange,
|
|
|
167
169
|
}),
|
|
168
170
|
!isValueLess && /*#__PURE__*/ _jsx("div", {
|
|
169
171
|
style: {
|
|
170
|
-
flex: '1 1
|
|
171
|
-
minWidth:
|
|
172
|
+
flex: '1 1 180px',
|
|
173
|
+
minWidth: 150
|
|
172
174
|
},
|
|
173
175
|
children: /*#__PURE__*/ _jsx(TextField, {
|
|
174
176
|
label: "Value",
|
|
177
|
+
size: "small",
|
|
175
178
|
value: condition.value,
|
|
176
179
|
onChange: (e)=>handleValueChange(e.target.value),
|
|
177
180
|
placeholder: fieldType === 'number' ? 'e.g. 1.5' : 'Enter value...',
|
|
@@ -189,7 +192,7 @@ export function ConditionRow({ canRemove, condition, dataPointOptions, onChange,
|
|
|
189
192
|
display: 'flex',
|
|
190
193
|
alignItems: 'flex-end',
|
|
191
194
|
flexShrink: 0,
|
|
192
|
-
padding: '
|
|
195
|
+
padding: '4px 8px'
|
|
193
196
|
},
|
|
194
197
|
children: /*#__PURE__*/ _jsx(Button, {
|
|
195
198
|
appearance: "secondary",
|
|
@@ -197,6 +200,7 @@ export function ConditionRow({ canRemove, condition, dataPointOptions, onChange,
|
|
|
197
200
|
icon: {
|
|
198
201
|
before: TrashIcon
|
|
199
202
|
},
|
|
203
|
+
size: "small",
|
|
200
204
|
onClick: onRemove
|
|
201
205
|
})
|
|
202
206
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/display-conditions/ConditionRow.tsx"],"sourcesContent":["import { Button, Chip, Combobox, Flex, TextField } from '@servicetitan/anvil2';\nimport TrashIcon from '@servicetitan/anvil2/assets/icons/material/round/delete.svg';\nimport { useMemo } from 'react';\nimport { NUMBER_OPERATORS, SingleCondition, STRING_OPERATORS, VALUE_LESS_OPERATORS } from './types';\nimport type { DataPointOption } from './types';\n\nexport interface ConditionRowProps {\n canRemove: boolean;\n condition: SingleCondition;\n dataPointOptions: DataPointOption[];\n onChange: (c: SingleCondition) => void;\n onRemove: () => void;\n}\n\ninterface OperatorOption {\n label: string;\n value: string;\n}\n\nfunction sanitizeNumericInput(raw: string): string {\n // Allow only a single leading minus and one decimal separator.\n let value = raw.replaceAll(/[^0-9.-]/g, '');\n const isNegative = value.startsWith('-');\n value = value.replaceAll('-', '');\n if (isNegative) {\n value = `-${value}`;\n }\n const firstDot = value.indexOf('.');\n if (firstDot >= 0) {\n value = `${value.slice(0, firstDot + 1)}${value.slice(firstDot + 1).replaceAll('.', '')}`;\n }\n return value;\n}\n\nexport function ConditionRow({\n canRemove,\n condition,\n dataPointOptions,\n onChange,\n onRemove,\n}: Readonly<ConditionRowProps>) {\n const selectedDataPoint = useMemo(\n () => dataPointOptions.find(opt => opt.fullKey === condition.dataPointKey) ?? null,\n [dataPointOptions, condition.dataPointKey],\n );\n\n const fieldType = selectedDataPoint?.fieldType ?? 'string';\n\n const operatorItems: OperatorOption[] = useMemo(\n () =>\n fieldType === 'number'\n ? ([...NUMBER_OPERATORS] as OperatorOption[])\n : ([...STRING_OPERATORS] as OperatorOption[]),\n [fieldType],\n );\n\n const selectedOperator = useMemo(\n () => operatorItems.find(op => op.value === condition.operator) ?? null,\n [operatorItems, condition.operator],\n );\n\n const isValueLess = VALUE_LESS_OPERATORS.includes(condition.operator);\n\n const handleValueChange = (raw: string) => {\n const value = fieldType === 'number' ? sanitizeNumericInput(raw) : raw;\n onChange({ ...condition, value });\n };\n\n const handleDataPointChange = (item: DataPointOption | null) => {\n const nextFieldType = item?.fieldType ?? 'string';\n const nextIsNumber = nextFieldType === 'number';\n const nextOperatorItems = nextIsNumber ? NUMBER_OPERATORS : STRING_OPERATORS;\n const operatorReset = !nextOperatorItems.some(op => op.value === condition.operator);\n onChange({\n ...condition,\n dataPointKey: item?.fullKey ?? '',\n operator: operatorReset\n ? nextIsNumber\n ? 'num_eq'\n : 'is_equal_to'\n : condition.operator,\n });\n };\n\n return (\n <Flex\n direction=\"row\"\n alignItems=\"flex-end\"\n gap=\"2\"\n style={{ flexWrap: 'wrap', rowGap: 8, width: '100%' }}\n >\n <div\n style={{\n display: 'flex',\n alignItems: 'flex-end',\n flexShrink: 0,\n padding: '6px 12px',\n }}\n >\n <Chip label=\"IF\" size=\"medium\" />\n </div>\n <div style={{ flex: '2 1 280px', minWidth: 240 }}>\n <Combobox\n {...({ disableClearSelection: true } as object)}\n groupBy=\"group\"\n itemToKey={(item: DataPointOption | null) => item?.fullKey ?? ''}\n itemToString={(item: DataPointOption | null) => item?.title ?? ''}\n items={dataPointOptions}\n selectedItem={selectedDataPoint}\n onChange={handleDataPointChange}\n >\n <Combobox.SelectTrigger label=\"Data point\" placeholder=\"Select data point...\" />\n <Combobox.Content>\n {({ items }: { items: DataPointOption[] }) => (\n <Combobox.List>\n {items.map((item, i) => (\n <Combobox.Item index={i} item={item} key={item.fullKey}>\n {item.title}\n </Combobox.Item>\n ))}\n </Combobox.List>\n )}\n </Combobox.Content>\n </Combobox>\n </div>\n <div style={{ flex: '1 1 220px', minWidth: 180 }}>\n <Combobox\n {...({ disableClearSelection: true } as object)}\n itemToKey={(item: OperatorOption | null) => item?.value ?? ''}\n itemToString={(item: OperatorOption | null) => item?.label ?? ''}\n items={operatorItems}\n selectedItem={selectedOperator}\n onChange={(item: OperatorOption | null) =>\n onChange({\n ...condition,\n operator: (item?.value ?? 'is_equal_to') as SingleCondition['operator'],\n })\n }\n >\n <Combobox.SelectTrigger label=\"Condition\" placeholder=\"Select...\" />\n <Combobox.Content>\n {({ items }: { items: OperatorOption[] }) => (\n <Combobox.List>\n {items.map((item, i) => (\n <Combobox.Item index={i} item={item} key={item.value}>\n {item.label}\n </Combobox.Item>\n ))}\n </Combobox.List>\n )}\n </Combobox.Content>\n </Combobox>\n </div>\n {!isValueLess && (\n <div style={{ flex: '1 1 220px', minWidth: 180 }}>\n <TextField\n label=\"Value\"\n value={condition.value}\n onChange={e => handleValueChange(e.target.value)}\n placeholder={fieldType === 'number' ? 'e.g. 1.5' : 'Enter value...'}\n style={{ width: '100%' }}\n aria-label=\"Value\"\n {...(fieldType === 'number' && { inputMode: 'decimal' })}\n />\n </div>\n )}\n {canRemove && (\n <div\n style={{\n display: 'flex',\n alignItems: 'flex-end',\n flexShrink: 0,\n padding: '6px 12px',\n }}\n >\n <Button\n appearance=\"secondary\"\n aria-label=\"Remove condition\"\n icon={{ before: TrashIcon }}\n onClick={onRemove}\n />\n </div>\n )}\n </Flex>\n );\n}\n"],"names":["Button","Chip","Combobox","Flex","TextField","TrashIcon","useMemo","NUMBER_OPERATORS","STRING_OPERATORS","VALUE_LESS_OPERATORS","sanitizeNumericInput","raw","value","replaceAll","isNegative","startsWith","firstDot","indexOf","slice","ConditionRow","canRemove","condition","dataPointOptions","onChange","onRemove","selectedDataPoint","find","opt","fullKey","dataPointKey","fieldType","operatorItems","selectedOperator","op","operator","isValueLess","includes","handleValueChange","handleDataPointChange","item","nextFieldType","nextIsNumber","nextOperatorItems","operatorReset","some","direction","alignItems","gap","style","flexWrap","rowGap","width","div","display","flexShrink","padding","label","size","flex","minWidth","disableClearSelection","groupBy","itemToKey","itemToString","title","items","selectedItem","SelectTrigger","placeholder","Content","List","map","i","Item","index","e","target","aria-label","inputMode","appearance","icon","before","onClick"],"mappings":";AAAA,SAASA,MAAM,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,SAAS,QAAQ,uBAAuB;AAC/E,OAAOC,eAAe,8DAA8D;AACpF,SAASC,OAAO,QAAQ,QAAQ;AAChC,SAASC,gBAAgB,EAAmBC,gBAAgB,EAAEC,oBAAoB,QAAQ,UAAU;AAgBpG,SAASC,qBAAqBC,GAAW;IACrC,+DAA+D;IAC/D,IAAIC,QAAQD,IAAIE,UAAU,CAAC,aAAa;IACxC,MAAMC,aAAaF,MAAMG,UAAU,CAAC;IACpCH,QAAQA,MAAMC,UAAU,CAAC,KAAK;IAC9B,IAAIC,YAAY;QACZF,QAAQ,CAAC,CAAC,EAAEA,OAAO;IACv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;wBAAEG,OAAO;oBAAO;oBACvB0B,cAAW;oBACV,GAAI/C,cAAc,YAAY;wBAAEgD,WAAW;oBAAU,CAAC;;;YAIlE1D,2BACG,KAACgC;gBACGJ,OAAO;oBACHK,SAAS;oBACTP,YAAY;oBACZQ,YAAY;oBACZC,SAAS;gBACb;0BAEA,cAAA,KAACvD;oBACG+E,YAAW;oBACXF,cAAW;oBACXG,MAAM;wBAAEC,QAAQ5E;oBAAU;oBAC1B6E,SAAS1D;;;;;AAMjC"}
|
|
1
|
+
{"version":3,"sources":["../../src/display-conditions/ConditionRow.tsx"],"sourcesContent":["import { Button, Chip, Combobox, Flex, TextField } from '@servicetitan/anvil2';\nimport TrashIcon from '@servicetitan/anvil2/assets/icons/material/round/delete.svg';\nimport { useMemo } from 'react';\nimport { NUMBER_OPERATORS, SingleCondition, STRING_OPERATORS, VALUE_LESS_OPERATORS } from './types';\nimport type { DataPointOption } from './types';\n\nexport interface ConditionRowProps {\n canRemove: boolean;\n condition: SingleCondition;\n dataPointOptions: DataPointOption[];\n onChange: (c: SingleCondition) => void;\n onRemove: () => void;\n}\n\ninterface OperatorOption {\n label: string;\n value: string;\n}\n\nfunction sanitizeNumericInput(raw: string): string {\n // Allow only a single leading minus and one decimal separator.\n let value = raw.replaceAll(/[^0-9.-]/g, '');\n const isNegative = value.startsWith('-');\n value = value.replaceAll('-', '');\n if (isNegative) {\n value = `-${value}`;\n }\n const firstDot = value.indexOf('.');\n if (firstDot >= 0) {\n value = `${value.slice(0, firstDot + 1)}${value.slice(firstDot + 1).replaceAll('.', '')}`;\n }\n return value;\n}\n\nexport function ConditionRow({\n canRemove,\n condition,\n dataPointOptions,\n onChange,\n onRemove,\n}: Readonly<ConditionRowProps>) {\n const selectedDataPoint = useMemo(\n () => dataPointOptions.find(opt => opt.fullKey === condition.dataPointKey) ?? null,\n [dataPointOptions, condition.dataPointKey],\n );\n\n const fieldType = selectedDataPoint?.fieldType ?? 'string';\n\n const operatorItems: OperatorOption[] = useMemo(\n () =>\n fieldType === 'number'\n ? ([...NUMBER_OPERATORS] as OperatorOption[])\n : ([...STRING_OPERATORS] as OperatorOption[]),\n [fieldType],\n );\n\n const selectedOperator = useMemo(\n () => operatorItems.find(op => op.value === condition.operator) ?? null,\n [operatorItems, condition.operator],\n );\n\n const isValueLess = VALUE_LESS_OPERATORS.includes(condition.operator);\n\n const handleValueChange = (raw: string) => {\n const value = fieldType === 'number' ? sanitizeNumericInput(raw) : raw;\n onChange({ ...condition, value });\n };\n\n const handleDataPointChange = (item: DataPointOption | null) => {\n const nextFieldType = item?.fieldType ?? 'string';\n const nextIsNumber = nextFieldType === 'number';\n const nextOperatorItems = nextIsNumber ? NUMBER_OPERATORS : STRING_OPERATORS;\n const operatorReset = !nextOperatorItems.some(op => op.value === condition.operator);\n onChange({\n ...condition,\n dataPointKey: item?.fullKey ?? '',\n operator: operatorReset\n ? nextIsNumber\n ? 'num_eq'\n : 'is_equal_to'\n : condition.operator,\n });\n };\n\n return (\n <Flex\n direction=\"row\"\n alignItems=\"flex-end\"\n gap=\"2\"\n style={{ flexWrap: 'wrap', rowGap: 8, width: '100%' }}\n >\n <div\n style={{\n display: 'flex',\n alignItems: 'flex-end',\n flexShrink: 0,\n padding: '4px 8px',\n }}\n >\n <Chip label=\"IF\" size=\"small\" />\n </div>\n <div style={{ flex: '2 1 240px', minWidth: 200 }}>\n <Combobox\n {...({ disableClearSelection: true } as object)}\n groupBy=\"group\"\n itemToKey={(item: DataPointOption | null) => item?.fullKey ?? ''}\n itemToString={(item: DataPointOption | null) => item?.title ?? ''}\n items={dataPointOptions}\n selectedItem={selectedDataPoint}\n onChange={handleDataPointChange}\n >\n <Combobox.SelectTrigger\n label=\"Data point\"\n placeholder=\"Select data point...\"\n size=\"small\"\n />\n <Combobox.Content>\n {({ items }: { items: DataPointOption[] }) => (\n <Combobox.List>\n {items.map((item, i) => (\n <Combobox.Item index={i} item={item} key={item.fullKey}>\n {item.title}\n </Combobox.Item>\n ))}\n </Combobox.List>\n )}\n </Combobox.Content>\n </Combobox>\n </div>\n <div style={{ flex: '1 1 180px', minWidth: 150 }}>\n <Combobox\n {...({ disableClearSelection: true } as object)}\n itemToKey={(item: OperatorOption | null) => item?.value ?? ''}\n itemToString={(item: OperatorOption | null) => item?.label ?? ''}\n items={operatorItems}\n selectedItem={selectedOperator}\n onChange={(item: OperatorOption | null) =>\n onChange({\n ...condition,\n operator: (item?.value ?? 'is_equal_to') as SingleCondition['operator'],\n })\n }\n >\n <Combobox.SelectTrigger\n label=\"Condition\"\n placeholder=\"Select...\"\n size=\"small\"\n />\n <Combobox.Content>\n {({ items }: { items: OperatorOption[] }) => (\n <Combobox.List>\n {items.map((item, i) => (\n <Combobox.Item index={i} item={item} key={item.value}>\n {item.label}\n </Combobox.Item>\n ))}\n </Combobox.List>\n )}\n </Combobox.Content>\n </Combobox>\n </div>\n {!isValueLess && (\n <div style={{ flex: '1 1 180px', minWidth: 150 }}>\n <TextField\n label=\"Value\"\n size=\"small\"\n value={condition.value}\n onChange={e => handleValueChange(e.target.value)}\n placeholder={fieldType === 'number' ? 'e.g. 1.5' : 'Enter value...'}\n style={{ width: '100%' }}\n aria-label=\"Value\"\n {...(fieldType === 'number' && { inputMode: 'decimal' })}\n />\n </div>\n )}\n {canRemove && (\n <div\n style={{\n display: 'flex',\n alignItems: 'flex-end',\n flexShrink: 0,\n padding: '4px 8px',\n }}\n >\n <Button\n appearance=\"secondary\"\n aria-label=\"Remove condition\"\n icon={{ before: TrashIcon }}\n size=\"small\"\n onClick={onRemove}\n />\n </div>\n )}\n </Flex>\n );\n}\n"],"names":["Button","Chip","Combobox","Flex","TextField","TrashIcon","useMemo","NUMBER_OPERATORS","STRING_OPERATORS","VALUE_LESS_OPERATORS","sanitizeNumericInput","raw","value","replaceAll","isNegative","startsWith","firstDot","indexOf","slice","ConditionRow","canRemove","condition","dataPointOptions","onChange","onRemove","selectedDataPoint","find","opt","fullKey","dataPointKey","fieldType","operatorItems","selectedOperator","op","operator","isValueLess","includes","handleValueChange","handleDataPointChange","item","nextFieldType","nextIsNumber","nextOperatorItems","operatorReset","some","direction","alignItems","gap","style","flexWrap","rowGap","width","div","display","flexShrink","padding","label","size","flex","minWidth","disableClearSelection","groupBy","itemToKey","itemToString","title","items","selectedItem","SelectTrigger","placeholder","Content","List","map","i","Item","index","e","target","aria-label","inputMode","appearance","icon","before","onClick"],"mappings":";AAAA,SAASA,MAAM,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,SAAS,QAAQ,uBAAuB;AAC/E,OAAOC,eAAe,8DAA8D;AACpF,SAASC,OAAO,QAAQ,QAAQ;AAChC,SAASC,gBAAgB,EAAmBC,gBAAgB,EAAEC,oBAAoB,QAAQ,UAAU;AAgBpG,SAASC,qBAAqBC,GAAW;IACrC,+DAA+D;IAC/D,IAAIC,QAAQD,IAAIE,UAAU,CAAC,aAAa;IACxC,MAAMC,aAAaF,MAAMG,UAAU,CAAC;IACpCH,QAAQA,MAAMC,UAAU,CAAC,KAAK;IAC9B,IAAIC,YAAY;QACZF,QAAQ,CAAC,CAAC,EAAEA,OAAO;IACvB;IACA,MAAMI,WAAWJ,MAAMK,OAAO,CAAC;IAC/B,IAAID,YAAY,GAAG;QACfJ,QAAQ,GAAGA,MAAMM,KAAK,CAAC,GAAGF,WAAW,KAAKJ,MAAMM,KAAK,CAACF,WAAW,GAAGH,UAAU,CAAC,KAAK,KAAK;IAC7F;IACA,OAAOD;AACX;AAEA,OAAO,SAASO,aAAa,EACzBC,SAAS,EACTC,SAAS,EACTC,gBAAgB,EAChBC,QAAQ,EACRC,QAAQ,EACkB;IAC1B,MAAMC,oBAAoBnB,QACtB;YAAMgB;eAAAA,CAAAA,yBAAAA,iBAAiBI,IAAI,CAACC,CAAAA,MAAOA,IAAIC,OAAO,KAAKP,UAAUQ,YAAY,eAAnEP,oCAAAA,yBAAwE;OAC9E;QAACA;QAAkBD,UAAUQ,YAAY;KAAC;QAG5BJ;IAAlB,MAAMK,YAAYL,C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GQA;+BAFfhB,SAAS;4BACL,GAAGF,SAAS;4BACZa,UAAWK,CAAAA,cAAAA,iBAAAA,2BAAAA,KAAM3B,KAAK,cAAX2B,yBAAAA,cAAe;wBAC9B;;;sCAGJ,KAACrC,SAASiE,aAAa;4BACnBX,OAAM;4BACNY,aAAY;4BACZX,MAAK;;sCAET,KAACvD,SAASmE,OAAO;sCACZ,CAAC,EAAEJ,KAAK,EAA+B,iBACpC,KAAC/D,SAASoE,IAAI;8CACTL,MAAMM,GAAG,CAAC,CAAChC,MAAMiC,kBACd,KAACtE,SAASuE,IAAI;4CAACC,OAAOF;4CAAGjC,MAAMA;sDAC1BA,KAAKiB,KAAK;2CAD2BjB,KAAK3B,KAAK;;;;;;YAS3E,CAACuB,6BACE,KAACiB;gBAAIJ,OAAO;oBAAEU,MAAM;oBAAaC,UAAU;gBAAI;0BAC3C,cAAA,KAACvD;oBACGoD,OAAM;oBACNC,MAAK;oBACL7C,OAAOS,UAAUT,KAAK;oBACtBW,UAAUoD,CAAAA,IAAKtC,kBAAkBsC,EAAEC,MAAM,CAAChE,KAAK;oBAC/CwD,aAAatC,cAAc,WAAW,aAAa;oBACnDkB,OAAO;wBAAEG,OAAO;oBAAO;oBACvB0B,cAAW;oBACV,GAAI/C,cAAc,YAAY;wBAAEgD,WAAW;oBAAU,CAAC;;;YAIlE1D,2BACG,KAACgC;gBACGJ,OAAO;oBACHK,SAAS;oBACTP,YAAY;oBACZQ,YAAY;oBACZC,SAAS;gBACb;0BAEA,cAAA,KAACvD;oBACG+E,YAAW;oBACXF,cAAW;oBACXG,MAAM;wBAAEC,QAAQ5E;oBAAU;oBAC1BoD,MAAK;oBACLyB,SAAS1D;;;;;AAMjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisplayConditionModal.d.ts","sourceRoot":"","sources":["../../src/display-conditions/DisplayConditionModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DisplayConditionModal.d.ts","sourceRoot":"","sources":["../../src/display-conditions/DisplayConditionModal.tsx"],"names":[],"mappings":"AAoDA,MAAM,WAAW,0BAA0B;IACvC,MAAM,CAAC,EAAE,OAAO,kBAAkB,EAAE,YAAY,CAAC;CACpD;AAED,eAAO,MAAM,qBAAqB,GAAI,OAAO,0BAA0B,uCAsLtE,CAAC"}
|