@uipath/apollo-react 7.19.1 → 7.20.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/canvas/styles/tailwind.canvas.css +1 -1
- package/dist/chat/styles/tailwind.chat.css +1 -1
- package/dist/decision-table/AllowedValueList.cjs +106 -0
- package/dist/decision-table/AllowedValueList.d.ts +15 -0
- package/dist/decision-table/AllowedValueList.d.ts.map +1 -0
- package/dist/decision-table/AllowedValueList.js +72 -0
- package/dist/decision-table/BandColumn.cjs +31 -7
- package/dist/decision-table/BandColumn.d.ts +2 -0
- package/dist/decision-table/BandColumn.d.ts.map +1 -1
- package/dist/decision-table/BandColumn.js +33 -9
- package/dist/decision-table/BandList.cjs +5 -3
- package/dist/decision-table/BandList.d.ts +3 -0
- package/dist/decision-table/BandList.d.ts.map +1 -1
- package/dist/decision-table/BandList.js +5 -3
- package/dist/decision-table/ColumnEditorOverlay.cjs +62 -0
- package/dist/decision-table/ColumnEditorOverlay.d.ts +14 -0
- package/dist/decision-table/ColumnEditorOverlay.d.ts.map +1 -0
- package/dist/decision-table/ColumnEditorOverlay.js +28 -0
- package/dist/decision-table/ColumnPopover.cjs +223 -0
- package/dist/decision-table/ColumnPopover.d.ts +49 -0
- package/dist/decision-table/ColumnPopover.d.ts.map +1 -0
- package/dist/decision-table/ColumnPopover.js +186 -0
- package/dist/decision-table/ConditionLine.cjs +3 -2
- package/dist/decision-table/ConditionLine.d.ts +1 -0
- package/dist/decision-table/ConditionLine.d.ts.map +1 -1
- package/dist/decision-table/ConditionLine.js +4 -3
- package/dist/decision-table/DecisionText.cjs +37 -7
- package/dist/decision-table/DecisionText.d.ts.map +1 -1
- package/dist/decision-table/DecisionText.js +37 -7
- package/dist/decision-table/EditorOverlay.cjs +161 -0
- package/dist/decision-table/EditorOverlay.d.ts +16 -0
- package/dist/decision-table/EditorOverlay.d.ts.map +1 -0
- package/dist/decision-table/EditorOverlay.js +127 -0
- package/dist/decision-table/ExpressionEditorFrame.cjs +85 -0
- package/dist/decision-table/ExpressionEditorFrame.d.ts +10 -0
- package/dist/decision-table/ExpressionEditorFrame.d.ts.map +1 -0
- package/dist/decision-table/ExpressionEditorFrame.js +51 -0
- package/dist/decision-table/MarkTooltip.cjs +169 -0
- package/dist/decision-table/MarkTooltip.d.ts +8 -0
- package/dist/decision-table/MarkTooltip.d.ts.map +1 -0
- package/dist/decision-table/MarkTooltip.js +135 -0
- package/dist/decision-table/PopoverFooter.cjs +97 -0
- package/dist/decision-table/PopoverFooter.d.ts +25 -0
- package/dist/decision-table/PopoverFooter.d.ts.map +1 -0
- package/dist/decision-table/PopoverFooter.js +57 -0
- package/dist/decision-table/PopoverHeader.cjs +51 -0
- package/dist/decision-table/PopoverHeader.d.ts +7 -0
- package/dist/decision-table/PopoverHeader.d.ts.map +1 -0
- package/dist/decision-table/PopoverHeader.js +17 -0
- package/dist/decision-table/PopoverSelect.cjs +74 -0
- package/dist/decision-table/PopoverSelect.d.ts +19 -0
- package/dist/decision-table/PopoverSelect.d.ts.map +1 -0
- package/dist/decision-table/PopoverSelect.js +40 -0
- package/dist/decision-table/RangeFields.cjs +93 -0
- package/dist/decision-table/RangeFields.d.ts +23 -0
- package/dist/decision-table/RangeFields.d.ts.map +1 -0
- package/dist/decision-table/RangeFields.js +59 -0
- package/dist/decision-table/RuleCard.cjs +3 -2
- package/dist/decision-table/RuleCard.d.ts +1 -0
- package/dist/decision-table/RuleCard.d.ts.map +1 -1
- package/dist/decision-table/RuleCard.js +3 -2
- package/dist/decision-table/RuleList.cjs +2 -1
- package/dist/decision-table/RuleList.d.ts +2 -1
- package/dist/decision-table/RuleList.d.ts.map +1 -1
- package/dist/decision-table/RuleList.js +2 -1
- package/dist/decision-table/SentenceBands.cjs +5 -2
- package/dist/decision-table/SentenceBands.d.ts +1 -1
- package/dist/decision-table/SentenceBands.d.ts.map +1 -1
- package/dist/decision-table/SentenceBands.js +5 -2
- package/dist/decision-table/TextExpressionEditor.cjs +54 -0
- package/dist/decision-table/TextExpressionEditor.d.ts +7 -0
- package/dist/decision-table/TextExpressionEditor.d.ts.map +1 -0
- package/dist/decision-table/TextExpressionEditor.js +20 -0
- package/dist/decision-table/ValueChecklist.cjs +135 -0
- package/dist/decision-table/ValueChecklist.d.ts +20 -0
- package/dist/decision-table/ValueChecklist.d.ts.map +1 -0
- package/dist/decision-table/ValueChecklist.js +101 -0
- package/dist/decision-table/ValueEditorOverlay.cjs +20 -30
- package/dist/decision-table/ValueEditorOverlay.d.ts +4 -4
- package/dist/decision-table/ValueEditorOverlay.d.ts.map +1 -1
- package/dist/decision-table/ValueEditorOverlay.js +21 -31
- package/dist/decision-table/ValueFields.cjs +125 -0
- package/dist/decision-table/ValueFields.d.ts +26 -0
- package/dist/decision-table/ValueFields.d.ts.map +1 -0
- package/dist/decision-table/ValueFields.js +91 -0
- package/dist/decision-table/ValuePopover.cjs +219 -0
- package/dist/decision-table/ValuePopover.d.ts +28 -0
- package/dist/decision-table/ValuePopover.d.ts.map +1 -0
- package/dist/decision-table/ValuePopover.js +185 -0
- package/dist/decision-table/__fixtures__/editableSentences.fixtures.d.ts +6 -1
- package/dist/decision-table/__fixtures__/editableSentences.fixtures.d.ts.map +1 -1
- package/dist/decision-table/__fixtures__/modalDialog.d.ts +6 -0
- package/dist/decision-table/__fixtures__/modalDialog.d.ts.map +1 -0
- package/dist/decision-table/__fixtures__/sentences.fixtures.d.ts.map +1 -1
- package/dist/decision-table/decisionTextTypes.d.ts +9 -4
- package/dist/decision-table/decisionTextTypes.d.ts.map +1 -1
- package/dist/decision-table/gridEvents.cjs +4 -0
- package/dist/decision-table/gridEvents.d.ts +1 -0
- package/dist/decision-table/gridEvents.d.ts.map +1 -1
- package/dist/decision-table/gridEvents.js +2 -1
- package/dist/decision-table/index.d.ts +3 -2
- package/dist/decision-table/index.d.ts.map +1 -1
- package/dist/decision-table/renderedTree.cjs +53 -0
- package/dist/decision-table/renderedTree.d.ts +4 -0
- package/dist/decision-table/renderedTree.d.ts.map +1 -0
- package/dist/decision-table/renderedTree.js +13 -0
- package/dist/decision-table/sentenceStyles.cjs +162 -26
- package/dist/decision-table/sentenceStyles.d.ts +35 -1
- package/dist/decision-table/sentenceStyles.d.ts.map +1 -1
- package/dist/decision-table/sentenceStyles.js +36 -2
- package/dist/decision-table/sentenceTypes.d.ts +2 -0
- package/dist/decision-table/sentenceTypes.d.ts.map +1 -1
- package/dist/decision-table/styles/tailwind.decision-table.css +1 -1
- package/dist/decision-table/useColumnEditing.cjs +70 -0
- package/dist/decision-table/useColumnEditing.d.ts +22 -0
- package/dist/decision-table/useColumnEditing.d.ts.map +1 -0
- package/dist/decision-table/useColumnEditing.js +36 -0
- package/dist/decision-table/useContainerHandlers.cjs +3 -20
- package/dist/decision-table/useContainerHandlers.d.ts +5 -5
- package/dist/decision-table/useContainerHandlers.d.ts.map +1 -1
- package/dist/decision-table/useContainerHandlers.js +3 -20
- package/dist/decision-table/useEditorPlacement.cjs +34 -23
- package/dist/decision-table/useEditorPlacement.d.ts +6 -3
- package/dist/decision-table/useEditorPlacement.d.ts.map +1 -1
- package/dist/decision-table/useEditorPlacement.js +30 -22
- package/dist/decision-table/usePendingCondition.cjs +96 -0
- package/dist/decision-table/usePendingCondition.d.ts +15 -0
- package/dist/decision-table/usePendingCondition.d.ts.map +1 -0
- package/dist/decision-table/usePendingCondition.js +62 -0
- package/dist/decision-table/useRuleMenus.cjs +4 -15
- package/dist/decision-table/useRuleMenus.d.ts +0 -2
- package/dist/decision-table/useRuleMenus.d.ts.map +1 -1
- package/dist/decision-table/useRuleMenus.js +2 -13
- package/dist/decision-table/useShapeDraft.cjs +178 -0
- package/dist/decision-table/useShapeDraft.d.ts +41 -0
- package/dist/decision-table/useShapeDraft.d.ts.map +1 -0
- package/dist/decision-table/useShapeDraft.js +138 -0
- package/dist/decision-table/useValueEditing.cjs +33 -87
- package/dist/decision-table/useValueEditing.d.ts +6 -13
- package/dist/decision-table/useValueEditing.d.ts.map +1 -1
- package/dist/decision-table/useValueEditing.js +32 -89
- package/dist/decision-table/valueTypes.d.ts +35 -2
- package/dist/decision-table/valueTypes.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
ColumnPopover: ()=>ColumnPopover,
|
|
28
|
+
columnTitle: ()=>columnTitle
|
|
29
|
+
});
|
|
30
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
+
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
32
|
+
const external_react_namespaceObject = require("react");
|
|
33
|
+
const external_gridEvents_cjs_namespaceObject = require("./gridEvents.cjs");
|
|
34
|
+
const external_PopoverFooter_cjs_namespaceObject = require("./PopoverFooter.cjs");
|
|
35
|
+
const external_PopoverHeader_cjs_namespaceObject = require("./PopoverHeader.cjs");
|
|
36
|
+
const external_PopoverSelect_cjs_namespaceObject = require("./PopoverSelect.cjs");
|
|
37
|
+
const external_sentenceStyles_cjs_namespaceObject = require("./sentenceStyles.cjs");
|
|
38
|
+
const columnTitle = (kind, name, labels)=>'input' === kind ? labels.inputColumn(name) : labels.outputColumn(name);
|
|
39
|
+
const changeOf = (field, draft)=>{
|
|
40
|
+
const change = {};
|
|
41
|
+
if (draft.label.trim() !== field.label.trim()) change.label = draft.label.trim();
|
|
42
|
+
if (draft.binding.trim() !== field.binding.trim()) change.binding = draft.binding.trim();
|
|
43
|
+
if (draft.typeRef !== field.typeRef) change.typeRef = draft.typeRef;
|
|
44
|
+
if (void 0 !== field.allowedValues && draft.allowedValues.trim() !== field.allowedValues.trim()) change.allowedValues = draft.allowedValues.trim();
|
|
45
|
+
return change;
|
|
46
|
+
};
|
|
47
|
+
const ColumnPopover = ({ column, field, types, onApply, onCancel, onMoreProperties, labels, dataTestId })=>{
|
|
48
|
+
const id = (0, external_react_namespaceObject.useId)();
|
|
49
|
+
const [root, setRoot] = (0, external_react_namespaceObject.useState)(null);
|
|
50
|
+
const [draft, setDraft] = (0, external_react_namespaceObject.useState)({
|
|
51
|
+
label: field.label,
|
|
52
|
+
binding: field.binding,
|
|
53
|
+
typeRef: field.typeRef,
|
|
54
|
+
allowedValues: field.allowedValues ?? ''
|
|
55
|
+
});
|
|
56
|
+
const missing = field.required && '' === draft.binding.trim();
|
|
57
|
+
const missingLabel = '' === draft.label.trim();
|
|
58
|
+
const options = types.some((type)=>type.id === field.typeRef) ? types : [
|
|
59
|
+
{
|
|
60
|
+
id: field.typeRef,
|
|
61
|
+
label: field.typeRef
|
|
62
|
+
},
|
|
63
|
+
...types
|
|
64
|
+
];
|
|
65
|
+
const placeholder = types.find((type)=>type.id === draft.typeRef)?.allowedValuesPlaceholder;
|
|
66
|
+
const set = (key)=>(event)=>{
|
|
67
|
+
const value = event.currentTarget.value;
|
|
68
|
+
setDraft((current)=>({
|
|
69
|
+
...current,
|
|
70
|
+
[key]: value
|
|
71
|
+
}));
|
|
72
|
+
};
|
|
73
|
+
const apply = ()=>{
|
|
74
|
+
if (!missing && !missingLabel) onApply(changeOf(field, draft));
|
|
75
|
+
};
|
|
76
|
+
const onKeyDown = (event)=>{
|
|
77
|
+
if ((0, external_gridEvents_cjs_namespaceObject.isComposing)(event) || 'Enter' !== event.key) return;
|
|
78
|
+
if (event.target instanceof HTMLInputElement) {
|
|
79
|
+
event.preventDefault();
|
|
80
|
+
apply();
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
const input = 'input' === field.kind;
|
|
84
|
+
const bindingLabel = input ? labels.inputExpression : labels.outputName;
|
|
85
|
+
const links = onMoreProperties ? [
|
|
86
|
+
{
|
|
87
|
+
label: labels.moreProperties,
|
|
88
|
+
onClick: onMoreProperties,
|
|
89
|
+
dataTestId: `${dataTestId}-more`
|
|
90
|
+
}
|
|
91
|
+
] : [];
|
|
92
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
93
|
+
ref: setRoot,
|
|
94
|
+
className: external_sentenceStyles_cjs_namespaceObject.POPOVER_CLASS,
|
|
95
|
+
onKeyDown: onKeyDown,
|
|
96
|
+
children: [
|
|
97
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_PopoverHeader_cjs_namespaceObject.PopoverHeader, {
|
|
98
|
+
icon: column.icon,
|
|
99
|
+
column: columnTitle(field.kind, column.name, labels)
|
|
100
|
+
}),
|
|
101
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
102
|
+
className: external_sentenceStyles_cjs_namespaceObject.COLUMN_FIELD_CLASS,
|
|
103
|
+
children: [
|
|
104
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Label, {
|
|
105
|
+
htmlFor: `${id}-label`,
|
|
106
|
+
className: external_sentenceStyles_cjs_namespaceObject.COLUMN_FIELD_LABEL_CLASS,
|
|
107
|
+
children: labels.columnLabel
|
|
108
|
+
}),
|
|
109
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Input, {
|
|
110
|
+
id: `${id}-label`,
|
|
111
|
+
className: external_sentenceStyles_cjs_namespaceObject.POPOVER_FIELD_CLASS,
|
|
112
|
+
autoFocus: true,
|
|
113
|
+
"aria-invalid": missingLabel,
|
|
114
|
+
"aria-describedby": missingLabel ? `${id}-missing-label` : void 0,
|
|
115
|
+
value: draft.label,
|
|
116
|
+
onChange: set('label'),
|
|
117
|
+
"data-testid": `${dataTestId}-label`
|
|
118
|
+
}),
|
|
119
|
+
missingLabel && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
120
|
+
id: `${id}-missing-label`,
|
|
121
|
+
className: external_sentenceStyles_cjs_namespaceObject.POPOVER_ERROR_CLASS,
|
|
122
|
+
children: labels.missingLabel
|
|
123
|
+
})
|
|
124
|
+
]
|
|
125
|
+
}),
|
|
126
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
127
|
+
className: external_sentenceStyles_cjs_namespaceObject.COLUMN_FIELD_CLASS,
|
|
128
|
+
children: [
|
|
129
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.Label, {
|
|
130
|
+
htmlFor: `${id}-binding`,
|
|
131
|
+
className: external_sentenceStyles_cjs_namespaceObject.COLUMN_FIELD_LABEL_CLASS,
|
|
132
|
+
children: [
|
|
133
|
+
bindingLabel,
|
|
134
|
+
field.required && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
135
|
+
"aria-hidden": true,
|
|
136
|
+
className: external_sentenceStyles_cjs_namespaceObject.COLUMN_REQUIRED_CLASS,
|
|
137
|
+
children: ' *'
|
|
138
|
+
})
|
|
139
|
+
]
|
|
140
|
+
}),
|
|
141
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Input, {
|
|
142
|
+
id: `${id}-binding`,
|
|
143
|
+
className: external_sentenceStyles_cjs_namespaceObject.COLUMN_CODE_FIELD_CLASS,
|
|
144
|
+
"aria-required": field.required,
|
|
145
|
+
"aria-invalid": missing,
|
|
146
|
+
"aria-describedby": missing ? `${id}-missing` : void 0,
|
|
147
|
+
value: draft.binding,
|
|
148
|
+
onChange: set('binding'),
|
|
149
|
+
"data-testid": `${dataTestId}-binding`
|
|
150
|
+
}),
|
|
151
|
+
missing && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
152
|
+
id: `${id}-missing`,
|
|
153
|
+
className: external_sentenceStyles_cjs_namespaceObject.POPOVER_ERROR_CLASS,
|
|
154
|
+
children: input ? labels.missingInputExpression : labels.missingOutputName
|
|
155
|
+
})
|
|
156
|
+
]
|
|
157
|
+
}),
|
|
158
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
159
|
+
className: external_sentenceStyles_cjs_namespaceObject.COLUMN_FIELD_CLASS,
|
|
160
|
+
children: [
|
|
161
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Label, {
|
|
162
|
+
htmlFor: `${id}-type`,
|
|
163
|
+
className: external_sentenceStyles_cjs_namespaceObject.COLUMN_FIELD_LABEL_CLASS,
|
|
164
|
+
children: labels.dataType
|
|
165
|
+
}),
|
|
166
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_PopoverSelect_cjs_namespaceObject.PopoverSelect, {
|
|
167
|
+
id: `${id}-type`,
|
|
168
|
+
value: draft.typeRef,
|
|
169
|
+
options: options,
|
|
170
|
+
onChange: (typeRef)=>setDraft((current)=>({
|
|
171
|
+
...current,
|
|
172
|
+
typeRef
|
|
173
|
+
})),
|
|
174
|
+
container: root,
|
|
175
|
+
label: labels.dataType,
|
|
176
|
+
dataTestId: `${dataTestId}-type`
|
|
177
|
+
})
|
|
178
|
+
]
|
|
179
|
+
}),
|
|
180
|
+
void 0 !== field.allowedValues && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
181
|
+
className: external_sentenceStyles_cjs_namespaceObject.COLUMN_FIELD_CLASS,
|
|
182
|
+
children: [
|
|
183
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Label, {
|
|
184
|
+
htmlFor: `${id}-allowed`,
|
|
185
|
+
className: external_sentenceStyles_cjs_namespaceObject.COLUMN_FIELD_LABEL_CLASS,
|
|
186
|
+
children: labels.allowedValues
|
|
187
|
+
}),
|
|
188
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Input, {
|
|
189
|
+
id: `${id}-allowed`,
|
|
190
|
+
className: external_sentenceStyles_cjs_namespaceObject.COLUMN_CODE_FIELD_CLASS,
|
|
191
|
+
placeholder: placeholder,
|
|
192
|
+
"aria-describedby": `${id}-allowed-hint`,
|
|
193
|
+
value: draft.allowedValues,
|
|
194
|
+
onChange: set('allowedValues'),
|
|
195
|
+
"data-testid": `${dataTestId}-allowed-values`
|
|
196
|
+
}),
|
|
197
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
198
|
+
id: `${id}-allowed-hint`,
|
|
199
|
+
className: external_sentenceStyles_cjs_namespaceObject.COLUMN_HINT_CLASS,
|
|
200
|
+
children: labels.allowedValuesHint
|
|
201
|
+
})
|
|
202
|
+
]
|
|
203
|
+
}),
|
|
204
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_PopoverFooter_cjs_namespaceObject.PopoverFooter, {
|
|
205
|
+
links: links,
|
|
206
|
+
onCancel: onCancel,
|
|
207
|
+
onApply: apply,
|
|
208
|
+
applyDisabled: missing || missingLabel,
|
|
209
|
+
labels: labels,
|
|
210
|
+
dataTestId: dataTestId
|
|
211
|
+
})
|
|
212
|
+
]
|
|
213
|
+
});
|
|
214
|
+
};
|
|
215
|
+
exports.ColumnPopover = __webpack_exports__.ColumnPopover;
|
|
216
|
+
exports.columnTitle = __webpack_exports__.columnTitle;
|
|
217
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
218
|
+
"ColumnPopover",
|
|
219
|
+
"columnTitle"
|
|
220
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
221
|
+
Object.defineProperty(exports, '__esModule', {
|
|
222
|
+
value: true
|
|
223
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { type PopoverFooterLabels } from './PopoverFooter';
|
|
3
|
+
import { type PopoverSelectOption } from './PopoverSelect';
|
|
4
|
+
import type { SentenceBand, SentenceNameToken } from './sentenceTypes';
|
|
5
|
+
export interface ColumnField {
|
|
6
|
+
kind: SentenceNameToken['kind'];
|
|
7
|
+
label: string;
|
|
8
|
+
binding: string;
|
|
9
|
+
required: boolean;
|
|
10
|
+
typeRef: string;
|
|
11
|
+
allowedValues?: string;
|
|
12
|
+
}
|
|
13
|
+
export type ColumnChange = Partial<Pick<ColumnField, 'label' | 'binding' | 'typeRef' | 'allowedValues'>>;
|
|
14
|
+
export interface ColumnTypeOption extends PopoverSelectOption {
|
|
15
|
+
allowedValuesPlaceholder?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ColumnEdit {
|
|
18
|
+
field: (columnId: string) => ColumnField;
|
|
19
|
+
types: readonly ColumnTypeOption[];
|
|
20
|
+
onCommit: (columnId: string, change: ColumnChange) => void;
|
|
21
|
+
onMoreProperties?: (columnId: string) => void;
|
|
22
|
+
}
|
|
23
|
+
export interface ColumnPopoverLabels extends PopoverFooterLabels {
|
|
24
|
+
inputColumn: (name: string) => string;
|
|
25
|
+
outputColumn: (name: string) => string;
|
|
26
|
+
columnLabel: string;
|
|
27
|
+
missingLabel: string;
|
|
28
|
+
inputExpression: string;
|
|
29
|
+
outputName: string;
|
|
30
|
+
missingInputExpression: string;
|
|
31
|
+
missingOutputName: string;
|
|
32
|
+
dataType: string;
|
|
33
|
+
allowedValues: string;
|
|
34
|
+
allowedValuesHint: string;
|
|
35
|
+
moreProperties: string;
|
|
36
|
+
}
|
|
37
|
+
export interface ColumnPopoverProps {
|
|
38
|
+
column: SentenceBand['columns'][number];
|
|
39
|
+
field: ColumnField;
|
|
40
|
+
types: ColumnEdit['types'];
|
|
41
|
+
onApply: (change: ColumnChange) => void;
|
|
42
|
+
onCancel: () => void;
|
|
43
|
+
onMoreProperties: (() => void) | undefined;
|
|
44
|
+
labels: ColumnPopoverLabels;
|
|
45
|
+
dataTestId: string;
|
|
46
|
+
}
|
|
47
|
+
export declare const columnTitle: (kind: ColumnField["kind"], name: string, labels: ColumnPopoverLabels) => string;
|
|
48
|
+
export declare const ColumnPopover: React.FC<ColumnPopoverProps>;
|
|
49
|
+
//# sourceMappingURL=ColumnPopover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColumnPopover.d.ts","sourceRoot":"","sources":["../../src/decision-table/ColumnPopover.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAiB,KAAK,mBAAmB,EAA0B,MAAM,iBAAiB,CAAC;AAElG,OAAO,EAAiB,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAW1E,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGvE,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IAEd,OAAO,EAAE,MAAM,CAAC;IAEhB,QAAQ,EAAE,OAAO,CAAC;IAElB,OAAO,EAAE,MAAM,CAAC;IAEhB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAGD,MAAM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E,MAAM,IAAI,CAAC;IACrB,gBAAgB,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IAC3C,MAAM,EAAE,mBAAmB,CAAC;IAE5B,UAAU,EAAE,MAAM,CAAC;CACpB;AAGD,eAAO,MAAM,WAAW,GACtB,MAAM,WAAW,CAAC,MAAM,CAAC,EACzB,MAAM,MAAM,EACZ,QAAQ,mBAAmB,KAC1B,MAAmF,CAAC;AAiBvF,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA+ItD,CAAC"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Input, Label } from "@uipath/apollo-wind";
|
|
3
|
+
import { useId, useState } from "react";
|
|
4
|
+
import { isComposing } from "./gridEvents.js";
|
|
5
|
+
import { PopoverFooter } from "./PopoverFooter.js";
|
|
6
|
+
import { PopoverHeader } from "./PopoverHeader.js";
|
|
7
|
+
import { PopoverSelect } from "./PopoverSelect.js";
|
|
8
|
+
import { COLUMN_CODE_FIELD_CLASS, COLUMN_FIELD_CLASS, COLUMN_FIELD_LABEL_CLASS, COLUMN_HINT_CLASS, COLUMN_REQUIRED_CLASS, POPOVER_CLASS, POPOVER_ERROR_CLASS, POPOVER_FIELD_CLASS } from "./sentenceStyles.js";
|
|
9
|
+
const columnTitle = (kind, name, labels)=>'input' === kind ? labels.inputColumn(name) : labels.outputColumn(name);
|
|
10
|
+
const changeOf = (field, draft)=>{
|
|
11
|
+
const change = {};
|
|
12
|
+
if (draft.label.trim() !== field.label.trim()) change.label = draft.label.trim();
|
|
13
|
+
if (draft.binding.trim() !== field.binding.trim()) change.binding = draft.binding.trim();
|
|
14
|
+
if (draft.typeRef !== field.typeRef) change.typeRef = draft.typeRef;
|
|
15
|
+
if (void 0 !== field.allowedValues && draft.allowedValues.trim() !== field.allowedValues.trim()) change.allowedValues = draft.allowedValues.trim();
|
|
16
|
+
return change;
|
|
17
|
+
};
|
|
18
|
+
const ColumnPopover = ({ column, field, types, onApply, onCancel, onMoreProperties, labels, dataTestId })=>{
|
|
19
|
+
const id = useId();
|
|
20
|
+
const [root, setRoot] = useState(null);
|
|
21
|
+
const [draft, setDraft] = useState({
|
|
22
|
+
label: field.label,
|
|
23
|
+
binding: field.binding,
|
|
24
|
+
typeRef: field.typeRef,
|
|
25
|
+
allowedValues: field.allowedValues ?? ''
|
|
26
|
+
});
|
|
27
|
+
const missing = field.required && '' === draft.binding.trim();
|
|
28
|
+
const missingLabel = '' === draft.label.trim();
|
|
29
|
+
const options = types.some((type)=>type.id === field.typeRef) ? types : [
|
|
30
|
+
{
|
|
31
|
+
id: field.typeRef,
|
|
32
|
+
label: field.typeRef
|
|
33
|
+
},
|
|
34
|
+
...types
|
|
35
|
+
];
|
|
36
|
+
const placeholder = types.find((type)=>type.id === draft.typeRef)?.allowedValuesPlaceholder;
|
|
37
|
+
const set = (key)=>(event)=>{
|
|
38
|
+
const value = event.currentTarget.value;
|
|
39
|
+
setDraft((current)=>({
|
|
40
|
+
...current,
|
|
41
|
+
[key]: value
|
|
42
|
+
}));
|
|
43
|
+
};
|
|
44
|
+
const apply = ()=>{
|
|
45
|
+
if (!missing && !missingLabel) onApply(changeOf(field, draft));
|
|
46
|
+
};
|
|
47
|
+
const onKeyDown = (event)=>{
|
|
48
|
+
if (isComposing(event) || 'Enter' !== event.key) return;
|
|
49
|
+
if (event.target instanceof HTMLInputElement) {
|
|
50
|
+
event.preventDefault();
|
|
51
|
+
apply();
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const input = 'input' === field.kind;
|
|
55
|
+
const bindingLabel = input ? labels.inputExpression : labels.outputName;
|
|
56
|
+
const links = onMoreProperties ? [
|
|
57
|
+
{
|
|
58
|
+
label: labels.moreProperties,
|
|
59
|
+
onClick: onMoreProperties,
|
|
60
|
+
dataTestId: `${dataTestId}-more`
|
|
61
|
+
}
|
|
62
|
+
] : [];
|
|
63
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
64
|
+
ref: setRoot,
|
|
65
|
+
className: POPOVER_CLASS,
|
|
66
|
+
onKeyDown: onKeyDown,
|
|
67
|
+
children: [
|
|
68
|
+
/*#__PURE__*/ jsx(PopoverHeader, {
|
|
69
|
+
icon: column.icon,
|
|
70
|
+
column: columnTitle(field.kind, column.name, labels)
|
|
71
|
+
}),
|
|
72
|
+
/*#__PURE__*/ jsxs("div", {
|
|
73
|
+
className: COLUMN_FIELD_CLASS,
|
|
74
|
+
children: [
|
|
75
|
+
/*#__PURE__*/ jsx(Label, {
|
|
76
|
+
htmlFor: `${id}-label`,
|
|
77
|
+
className: COLUMN_FIELD_LABEL_CLASS,
|
|
78
|
+
children: labels.columnLabel
|
|
79
|
+
}),
|
|
80
|
+
/*#__PURE__*/ jsx(Input, {
|
|
81
|
+
id: `${id}-label`,
|
|
82
|
+
className: POPOVER_FIELD_CLASS,
|
|
83
|
+
autoFocus: true,
|
|
84
|
+
"aria-invalid": missingLabel,
|
|
85
|
+
"aria-describedby": missingLabel ? `${id}-missing-label` : void 0,
|
|
86
|
+
value: draft.label,
|
|
87
|
+
onChange: set('label'),
|
|
88
|
+
"data-testid": `${dataTestId}-label`
|
|
89
|
+
}),
|
|
90
|
+
missingLabel && /*#__PURE__*/ jsx("span", {
|
|
91
|
+
id: `${id}-missing-label`,
|
|
92
|
+
className: POPOVER_ERROR_CLASS,
|
|
93
|
+
children: labels.missingLabel
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
}),
|
|
97
|
+
/*#__PURE__*/ jsxs("div", {
|
|
98
|
+
className: COLUMN_FIELD_CLASS,
|
|
99
|
+
children: [
|
|
100
|
+
/*#__PURE__*/ jsxs(Label, {
|
|
101
|
+
htmlFor: `${id}-binding`,
|
|
102
|
+
className: COLUMN_FIELD_LABEL_CLASS,
|
|
103
|
+
children: [
|
|
104
|
+
bindingLabel,
|
|
105
|
+
field.required && /*#__PURE__*/ jsx("span", {
|
|
106
|
+
"aria-hidden": true,
|
|
107
|
+
className: COLUMN_REQUIRED_CLASS,
|
|
108
|
+
children: ' *'
|
|
109
|
+
})
|
|
110
|
+
]
|
|
111
|
+
}),
|
|
112
|
+
/*#__PURE__*/ jsx(Input, {
|
|
113
|
+
id: `${id}-binding`,
|
|
114
|
+
className: COLUMN_CODE_FIELD_CLASS,
|
|
115
|
+
"aria-required": field.required,
|
|
116
|
+
"aria-invalid": missing,
|
|
117
|
+
"aria-describedby": missing ? `${id}-missing` : void 0,
|
|
118
|
+
value: draft.binding,
|
|
119
|
+
onChange: set('binding'),
|
|
120
|
+
"data-testid": `${dataTestId}-binding`
|
|
121
|
+
}),
|
|
122
|
+
missing && /*#__PURE__*/ jsx("span", {
|
|
123
|
+
id: `${id}-missing`,
|
|
124
|
+
className: POPOVER_ERROR_CLASS,
|
|
125
|
+
children: input ? labels.missingInputExpression : labels.missingOutputName
|
|
126
|
+
})
|
|
127
|
+
]
|
|
128
|
+
}),
|
|
129
|
+
/*#__PURE__*/ jsxs("div", {
|
|
130
|
+
className: COLUMN_FIELD_CLASS,
|
|
131
|
+
children: [
|
|
132
|
+
/*#__PURE__*/ jsx(Label, {
|
|
133
|
+
htmlFor: `${id}-type`,
|
|
134
|
+
className: COLUMN_FIELD_LABEL_CLASS,
|
|
135
|
+
children: labels.dataType
|
|
136
|
+
}),
|
|
137
|
+
/*#__PURE__*/ jsx(PopoverSelect, {
|
|
138
|
+
id: `${id}-type`,
|
|
139
|
+
value: draft.typeRef,
|
|
140
|
+
options: options,
|
|
141
|
+
onChange: (typeRef)=>setDraft((current)=>({
|
|
142
|
+
...current,
|
|
143
|
+
typeRef
|
|
144
|
+
})),
|
|
145
|
+
container: root,
|
|
146
|
+
label: labels.dataType,
|
|
147
|
+
dataTestId: `${dataTestId}-type`
|
|
148
|
+
})
|
|
149
|
+
]
|
|
150
|
+
}),
|
|
151
|
+
void 0 !== field.allowedValues && /*#__PURE__*/ jsxs("div", {
|
|
152
|
+
className: COLUMN_FIELD_CLASS,
|
|
153
|
+
children: [
|
|
154
|
+
/*#__PURE__*/ jsx(Label, {
|
|
155
|
+
htmlFor: `${id}-allowed`,
|
|
156
|
+
className: COLUMN_FIELD_LABEL_CLASS,
|
|
157
|
+
children: labels.allowedValues
|
|
158
|
+
}),
|
|
159
|
+
/*#__PURE__*/ jsx(Input, {
|
|
160
|
+
id: `${id}-allowed`,
|
|
161
|
+
className: COLUMN_CODE_FIELD_CLASS,
|
|
162
|
+
placeholder: placeholder,
|
|
163
|
+
"aria-describedby": `${id}-allowed-hint`,
|
|
164
|
+
value: draft.allowedValues,
|
|
165
|
+
onChange: set('allowedValues'),
|
|
166
|
+
"data-testid": `${dataTestId}-allowed-values`
|
|
167
|
+
}),
|
|
168
|
+
/*#__PURE__*/ jsx("span", {
|
|
169
|
+
id: `${id}-allowed-hint`,
|
|
170
|
+
className: COLUMN_HINT_CLASS,
|
|
171
|
+
children: labels.allowedValuesHint
|
|
172
|
+
})
|
|
173
|
+
]
|
|
174
|
+
}),
|
|
175
|
+
/*#__PURE__*/ jsx(PopoverFooter, {
|
|
176
|
+
links: links,
|
|
177
|
+
onCancel: onCancel,
|
|
178
|
+
onApply: apply,
|
|
179
|
+
applyDisabled: missing || missingLabel,
|
|
180
|
+
labels: labels,
|
|
181
|
+
dataTestId: dataTestId
|
|
182
|
+
})
|
|
183
|
+
]
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
export { ColumnPopover, columnTitle };
|
|
@@ -33,11 +33,12 @@ const external_LineText_cjs_namespaceObject = require("./LineText.cjs");
|
|
|
33
33
|
const external_MarkBadge_cjs_namespaceObject = require("./MarkBadge.cjs");
|
|
34
34
|
const external_RemoveConditionButton_cjs_namespaceObject = require("./RemoveConditionButton.cjs");
|
|
35
35
|
const external_sentenceStyles_cjs_namespaceObject = require("./sentenceStyles.cjs");
|
|
36
|
-
const ConditionLine = ({ line, badge, removal, ...lineProps })=>{
|
|
36
|
+
const ConditionLine = ({ line, pending, badge, removal, ...lineProps })=>{
|
|
37
37
|
const matched = lineProps.cells?.[line.columnId]?.matched;
|
|
38
38
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("li", {
|
|
39
|
-
className: (0, apollo_wind_namespaceObject.cn)(external_sentenceStyles_cjs_namespaceObject.LINE_CLASS, external_sentenceStyles_cjs_namespaceObject.MATCHED_LINE_CLASS),
|
|
39
|
+
className: (0, apollo_wind_namespaceObject.cn)(external_sentenceStyles_cjs_namespaceObject.LINE_CLASS, external_sentenceStyles_cjs_namespaceObject.MATCHED_LINE_CLASS, pending && external_sentenceStyles_cjs_namespaceObject.PENDING_LINE_CLASS),
|
|
40
40
|
"data-column-id": line.columnId,
|
|
41
|
+
"data-pending": pending || void 0,
|
|
41
42
|
"data-matched": matched,
|
|
42
43
|
children: [
|
|
43
44
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_LineLead_cjs_namespaceObject.LineLead, {
|
|
@@ -5,6 +5,7 @@ import { type RemoveConditionButtonProps } from './RemoveConditionButton';
|
|
|
5
5
|
import type { SentenceLine } from './sentenceTypes';
|
|
6
6
|
export interface ConditionLineProps extends Pick<LineTextProps, 'cells' | 'selectedColumnId' | 'stopOf' | 'linkOf' | 'labels'> {
|
|
7
7
|
line: SentenceLine;
|
|
8
|
+
pending: boolean;
|
|
8
9
|
badge: MarkBadgeProps | null;
|
|
9
10
|
removal: RemoveConditionButtonProps | null;
|
|
10
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionLine.d.ts","sourceRoot":"","sources":["../../src/decision-table/ConditionLine.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAyB,KAAK,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAEjG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC1F,IAAI,EAAE,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ConditionLine.d.ts","sourceRoot":"","sources":["../../src/decision-table/ConditionLine.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAyB,KAAK,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAEjG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC1F,IAAI,EAAE,YAAY,CAAC;IAEnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,0BAA0B,GAAG,IAAI,CAAC;CAC5C;AAGD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAqBtD,CAAC"}
|
|
@@ -4,12 +4,13 @@ import { LineLead } from "./LineLead.js";
|
|
|
4
4
|
import { LineText } from "./LineText.js";
|
|
5
5
|
import { MarkBadge } from "./MarkBadge.js";
|
|
6
6
|
import { RemoveConditionButton } from "./RemoveConditionButton.js";
|
|
7
|
-
import { LINE_CLASS, MATCHED_LINE_CLASS } from "./sentenceStyles.js";
|
|
8
|
-
const ConditionLine = ({ line, badge, removal, ...lineProps })=>{
|
|
7
|
+
import { LINE_CLASS, MATCHED_LINE_CLASS, PENDING_LINE_CLASS } from "./sentenceStyles.js";
|
|
8
|
+
const ConditionLine = ({ line, pending, badge, removal, ...lineProps })=>{
|
|
9
9
|
const matched = lineProps.cells?.[line.columnId]?.matched;
|
|
10
10
|
return /*#__PURE__*/ jsxs("li", {
|
|
11
|
-
className: cn(LINE_CLASS, MATCHED_LINE_CLASS),
|
|
11
|
+
className: cn(LINE_CLASS, MATCHED_LINE_CLASS, pending && PENDING_LINE_CLASS),
|
|
12
12
|
"data-column-id": line.columnId,
|
|
13
|
+
"data-pending": pending || void 0,
|
|
13
14
|
"data-matched": matched,
|
|
14
15
|
children: [
|
|
15
16
|
/*#__PURE__*/ jsx(LineLead, {
|
|
@@ -30,9 +30,11 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
30
30
|
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
31
31
|
const external_react_namespaceObject = require("react");
|
|
32
32
|
const external_AddRuleFooter_cjs_namespaceObject = require("./AddRuleFooter.cjs");
|
|
33
|
+
const external_ColumnEditorOverlay_cjs_namespaceObject = require("./ColumnEditorOverlay.cjs");
|
|
33
34
|
const external_DecisionTextHeader_cjs_namespaceObject = require("./DecisionTextHeader.cjs");
|
|
34
35
|
const external_EmptyRules_cjs_namespaceObject = require("./EmptyRules.cjs");
|
|
35
36
|
const external_GridMenu_cjs_namespaceObject = require("./GridMenu.cjs");
|
|
37
|
+
const external_MarkTooltip_cjs_namespaceObject = require("./MarkTooltip.cjs");
|
|
36
38
|
const external_marks_cjs_namespaceObject = require("./marks.cjs");
|
|
37
39
|
const external_RuleList_cjs_namespaceObject = require("./RuleList.cjs");
|
|
38
40
|
const external_SentenceBands_cjs_namespaceObject = require("./SentenceBands.cjs");
|
|
@@ -41,7 +43,9 @@ const external_sentenceRuleHeights_cjs_namespaceObject = require("./sentenceRule
|
|
|
41
43
|
const external_sentenceStyles_cjs_namespaceObject = require("./sentenceStyles.cjs");
|
|
42
44
|
const external_useAddRule_cjs_namespaceObject = require("./useAddRule.cjs");
|
|
43
45
|
const external_useCellHover_cjs_namespaceObject = require("./useCellHover.cjs");
|
|
46
|
+
const external_useColumnEditing_cjs_namespaceObject = require("./useColumnEditing.cjs");
|
|
44
47
|
const external_useContainerHandlers_cjs_namespaceObject = require("./useContainerHandlers.cjs");
|
|
48
|
+
const external_usePendingCondition_cjs_namespaceObject = require("./usePendingCondition.cjs");
|
|
45
49
|
const external_useRuleMenus_cjs_namespaceObject = require("./useRuleMenus.cjs");
|
|
46
50
|
const external_useRuleWindow_cjs_namespaceObject = require("./useRuleWindow.cjs");
|
|
47
51
|
const external_useSentenceNavigation_cjs_namespaceObject = require("./useSentenceNavigation.cjs");
|
|
@@ -51,7 +55,12 @@ const DecisionText = ({ rules, bands, header, numbered = false, marks = external
|
|
|
51
55
|
const idPrefix = (0, external_react_namespaceObject.useId)();
|
|
52
56
|
const { rows: rowMarks, columns: bandMarks } = (0, external_sentenceMarks_cjs_namespaceObject.tableMarks)(marks);
|
|
53
57
|
const hoverTo = (0, external_useCellHover_cjs_namespaceObject.useCellHover)(onCellHover);
|
|
54
|
-
const
|
|
58
|
+
const shown = (0, external_usePendingCondition_cjs_namespaceObject.usePendingCondition)({
|
|
59
|
+
edit,
|
|
60
|
+
rules,
|
|
61
|
+
bands
|
|
62
|
+
});
|
|
63
|
+
const ruleWindow = (0, external_useRuleWindow_cjs_namespaceObject.useRuleWindow)(shown.rules, selected?.rowId, edit?.editing?.rowId ?? selected?.rowId);
|
|
55
64
|
const selectable = void 0 !== onSelect;
|
|
56
65
|
const addRuleAction = (0, external_useAddRule_cjs_namespaceObject.useAddRule)({
|
|
57
66
|
...ruleWindow,
|
|
@@ -78,10 +87,7 @@ const DecisionText = ({ rules, bands, header, numbered = false, marks = external
|
|
|
78
87
|
onSelect,
|
|
79
88
|
navigation,
|
|
80
89
|
labels,
|
|
81
|
-
container: ruleWindow.container
|
|
82
|
-
openMenu: ruleMenus.openFor,
|
|
83
|
-
onOpenDecision,
|
|
84
|
-
addRule: addRuleAction
|
|
90
|
+
container: ruleWindow.container
|
|
85
91
|
});
|
|
86
92
|
const sectionProps = (0, external_useContainerHandlers_cjs_namespaceObject.useContainerHandlers)({
|
|
87
93
|
containerProps,
|
|
@@ -93,6 +99,12 @@ const DecisionText = ({ rules, bands, header, numbered = false, marks = external
|
|
|
93
99
|
container: ruleWindow.container,
|
|
94
100
|
stopTabbable: selectable && null !== ruleWindow.selectedRow
|
|
95
101
|
});
|
|
102
|
+
const columnEditing = (0, external_useColumnEditing_cjs_namespaceObject.useColumnEditing)({
|
|
103
|
+
column: edit?.column,
|
|
104
|
+
bands,
|
|
105
|
+
container: ruleWindow.container
|
|
106
|
+
});
|
|
107
|
+
const columnEditorId = `${idPrefix}-column-editor`;
|
|
96
108
|
const listStyle = (0, external_sentenceRuleHeights_cjs_namespaceObject.sentenceListStyle)(numbered, rules.length);
|
|
97
109
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("section", {
|
|
98
110
|
ref: ruleWindow.attachSection,
|
|
@@ -115,7 +127,10 @@ const DecisionText = ({ rules, bands, header, numbered = false, marks = external
|
|
|
115
127
|
style: listStyle,
|
|
116
128
|
idPrefix: idPrefix,
|
|
117
129
|
dataTestId: dataTestId,
|
|
118
|
-
labels: labels
|
|
130
|
+
labels: labels,
|
|
131
|
+
onToggleColumn: columnEditing.onToggle,
|
|
132
|
+
openColumnId: columnEditing.openId,
|
|
133
|
+
editorId: columnEditorId
|
|
119
134
|
}),
|
|
120
135
|
0 === rules.length ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_EmptyRules_cjs_namespaceObject.EmptyRules, {
|
|
121
136
|
title: labels.emptyRules,
|
|
@@ -123,7 +138,8 @@ const DecisionText = ({ rules, bands, header, numbered = false, marks = external
|
|
|
123
138
|
dataTestId: dataTestId
|
|
124
139
|
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_RuleList_cjs_namespaceObject.RuleList, {
|
|
125
140
|
ref: ruleWindow.listRef,
|
|
126
|
-
rules: rules,
|
|
141
|
+
rules: shown.rules,
|
|
142
|
+
pending: shown.pending,
|
|
127
143
|
segments: ruleWindow.segments,
|
|
128
144
|
numbered: numbered,
|
|
129
145
|
marks: rowMarks,
|
|
@@ -145,9 +161,23 @@ const DecisionText = ({ rules, bands, header, numbered = false, marks = external
|
|
|
145
161
|
valueEditing.editor && edit && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ValueEditorOverlay_cjs_namespaceObject.ValueEditorOverlay, {
|
|
146
162
|
editor: valueEditing.editor,
|
|
147
163
|
renderEditor: edit.renderEditor,
|
|
164
|
+
labels: edit.labels,
|
|
165
|
+
onOperatorChange: shown.onOperatorChange,
|
|
148
166
|
container: ruleWindow.container,
|
|
149
167
|
dataTestId: dataTestId
|
|
150
168
|
}, valueEditing.editorKey),
|
|
169
|
+
columnEditing.editor && edit?.column && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ColumnEditorOverlay_cjs_namespaceObject.ColumnEditorOverlay, {
|
|
170
|
+
editor: columnEditing.editor,
|
|
171
|
+
edit: edit.column,
|
|
172
|
+
labels: edit.labels,
|
|
173
|
+
container: ruleWindow.container,
|
|
174
|
+
id: columnEditorId,
|
|
175
|
+
dataTestId: dataTestId
|
|
176
|
+
}, columnEditing.editor.column.id),
|
|
177
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_MarkTooltip_cjs_namespaceObject.MarkTooltip, {
|
|
178
|
+
container: ruleWindow.container,
|
|
179
|
+
dataTestId: dataTestId
|
|
180
|
+
}),
|
|
151
181
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_GridMenu_cjs_namespaceObject.GridContextMenu, {
|
|
152
182
|
label: ruleMenus.label,
|
|
153
183
|
dataTestId: dataTestId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecisionText.d.ts","sourceRoot":"","sources":["../../src/decision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