@uipath/apollo-react 7.25.0 → 7.27.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/BandColumn.d.ts +2 -2
- package/dist/decision-table/BandColumn.d.ts.map +1 -1
- package/dist/decision-table/ColumnEditorOverlay.cjs +3 -3
- package/dist/decision-table/ColumnEditorOverlay.d.ts +6 -5
- package/dist/decision-table/ColumnEditorOverlay.d.ts.map +1 -1
- package/dist/decision-table/ColumnEditorOverlay.js +3 -3
- package/dist/decision-table/ColumnPopover.cjs +52 -31
- package/dist/decision-table/ColumnPopover.d.ts +36 -23
- package/dist/decision-table/ColumnPopover.d.ts.map +1 -1
- package/dist/decision-table/ColumnPopover.js +52 -31
- package/dist/decision-table/DecisionGraphText.cjs +2 -2
- package/dist/decision-table/DecisionGraphText.d.ts +0 -2
- package/dist/decision-table/DecisionGraphText.d.ts.map +1 -1
- package/dist/decision-table/DecisionGraphText.js +2 -2
- package/dist/decision-table/DecisionText.cjs +35 -10
- package/dist/decision-table/DecisionText.d.ts +29 -33
- package/dist/decision-table/DecisionText.d.ts.map +1 -1
- package/dist/decision-table/DecisionText.js +35 -10
- package/dist/decision-table/DecisionTextHeader.cjs +10 -8
- package/dist/decision-table/DecisionTextHeader.d.ts +13 -5
- package/dist/decision-table/DecisionTextHeader.d.ts.map +1 -1
- package/dist/decision-table/DecisionTextHeader.js +10 -8
- package/dist/decision-table/__fixtures__/diffSentences.fixtures.d.ts +9 -8
- package/dist/decision-table/__fixtures__/diffSentences.fixtures.d.ts.map +1 -1
- package/dist/decision-table/__fixtures__/editableSentences.fixtures.d.ts +5 -2
- package/dist/decision-table/__fixtures__/editableSentences.fixtures.d.ts.map +1 -1
- package/dist/decision-table/__fixtures__/sentences.fixtures.d.ts +12 -7
- package/dist/decision-table/__fixtures__/sentences.fixtures.d.ts.map +1 -1
- package/dist/decision-table/__fixtures__/storyTableHost.d.ts +15 -17
- package/dist/decision-table/__fixtures__/storyTableHost.d.ts.map +1 -1
- package/dist/decision-table/__fixtures__/textMode.d.ts +16 -0
- package/dist/decision-table/__fixtures__/textMode.d.ts.map +1 -0
- package/dist/decision-table/bandColumns.cjs +22 -35
- package/dist/decision-table/bandColumns.d.ts +2 -4
- package/dist/decision-table/bandColumns.d.ts.map +1 -1
- package/dist/decision-table/bandColumns.js +21 -31
- package/dist/decision-table/decisionTextDiff.d.ts +13 -12
- package/dist/decision-table/decisionTextDiff.d.ts.map +1 -1
- package/dist/decision-table/decisionTextTypes.d.ts +5 -4
- package/dist/decision-table/decisionTextTypes.d.ts.map +1 -1
- package/dist/decision-table/index.cjs +23 -11
- package/dist/decision-table/index.d.ts +9 -9
- package/dist/decision-table/index.d.ts.map +1 -1
- package/dist/decision-table/index.js +3 -2
- package/dist/decision-table/locales/de.cjs +1 -1
- package/dist/decision-table/locales/de.d.ts.map +1 -1
- package/dist/decision-table/locales/de.js +1 -1
- package/dist/decision-table/locales/en.cjs +1 -1
- package/dist/decision-table/locales/en.d.ts.map +1 -1
- package/dist/decision-table/locales/en.js +1 -1
- package/dist/decision-table/locales/es-MX.cjs +1 -1
- package/dist/decision-table/locales/es-MX.d.ts.map +1 -1
- package/dist/decision-table/locales/es-MX.js +1 -1
- package/dist/decision-table/locales/es.cjs +1 -1
- package/dist/decision-table/locales/es.d.ts.map +1 -1
- package/dist/decision-table/locales/es.js +1 -1
- package/dist/decision-table/locales/fr.cjs +1 -1
- package/dist/decision-table/locales/fr.d.ts.map +1 -1
- package/dist/decision-table/locales/fr.js +1 -1
- package/dist/decision-table/locales/ja.cjs +1 -1
- package/dist/decision-table/locales/ja.d.ts.map +1 -1
- package/dist/decision-table/locales/ja.js +1 -1
- package/dist/decision-table/locales/ko.cjs +1 -1
- package/dist/decision-table/locales/ko.d.ts.map +1 -1
- package/dist/decision-table/locales/ko.js +1 -1
- package/dist/decision-table/locales/pt-BR.cjs +1 -1
- package/dist/decision-table/locales/pt-BR.d.ts.map +1 -1
- package/dist/decision-table/locales/pt-BR.js +1 -1
- package/dist/decision-table/locales/pt.cjs +1 -1
- package/dist/decision-table/locales/pt.d.ts.map +1 -1
- package/dist/decision-table/locales/pt.js +1 -1
- package/dist/decision-table/locales/ro.cjs +1 -1
- package/dist/decision-table/locales/ro.d.ts.map +1 -1
- package/dist/decision-table/locales/ro.js +1 -1
- package/dist/decision-table/locales/ru.cjs +1 -1
- package/dist/decision-table/locales/ru.d.ts.map +1 -1
- package/dist/decision-table/locales/ru.js +1 -1
- package/dist/decision-table/locales/tr.cjs +1 -1
- package/dist/decision-table/locales/tr.d.ts.map +1 -1
- package/dist/decision-table/locales/tr.js +1 -1
- package/dist/decision-table/locales/zh-CN.cjs +1 -1
- package/dist/decision-table/locales/zh-CN.d.ts.map +1 -1
- package/dist/decision-table/locales/zh-CN.js +1 -1
- package/dist/decision-table/locales/zh-TW.cjs +1 -1
- package/dist/decision-table/locales/zh-TW.d.ts.map +1 -1
- package/dist/decision-table/locales/zh-TW.js +1 -1
- package/dist/decision-table/sentenceGridSelection.cjs +57 -0
- package/dist/decision-table/sentenceGridSelection.d.ts +6 -0
- package/dist/decision-table/sentenceGridSelection.d.ts.map +1 -0
- package/dist/decision-table/sentenceGridSelection.js +20 -0
- package/dist/decision-table/sentenceSelection.cjs +59 -0
- package/dist/decision-table/sentenceSelection.d.ts +6 -0
- package/dist/decision-table/sentenceSelection.d.ts.map +1 -0
- package/dist/decision-table/sentenceSelection.js +16 -0
- package/dist/decision-table/sentenceTargets.cjs +9 -13
- package/dist/decision-table/sentenceTargets.d.ts.map +1 -1
- package/dist/decision-table/sentenceTargets.js +2 -6
- package/dist/decision-table/sentenceTypes.d.ts +24 -14
- 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 +7 -5
- package/dist/decision-table/useColumnEditing.d.ts +6 -6
- package/dist/decision-table/useColumnEditing.d.ts.map +1 -1
- package/dist/decision-table/useColumnEditing.js +7 -5
- package/dist/decision-table/useDecisionGraphStrings.cjs +3 -7
- package/dist/decision-table/useDecisionGraphStrings.d.ts +1 -1
- package/dist/decision-table/useDecisionGraphStrings.d.ts.map +1 -1
- package/dist/decision-table/useDecisionGraphStrings.js +4 -8
- package/dist/decision-table/useDecisionTextStrings.cjs +11 -22
- package/dist/decision-table/useDecisionTextStrings.d.ts +2 -3
- package/dist/decision-table/useDecisionTextStrings.d.ts.map +1 -1
- package/dist/decision-table/useDecisionTextStrings.js +10 -18
- package/dist/decision-table/useEditState.d.ts +2 -2
- package/dist/decision-table/useEditState.d.ts.map +1 -1
- package/dist/decision-table/useSentenceNavigation.cjs +8 -12
- package/dist/decision-table/useSentenceNavigation.d.ts.map +1 -1
- package/dist/decision-table/useSentenceNavigation.js +8 -12
- package/dist/decision-table/useValueEditing.cjs +16 -29
- package/dist/decision-table/useValueEditing.d.ts.map +1 -1
- package/dist/decision-table/useValueEditing.js +16 -29
- package/dist/decision-table/valueTypes.d.ts +2 -2
- package/dist/decision-table/valueTypes.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -2,9 +2,9 @@ import type React from 'react';
|
|
|
2
2
|
import type { DiffChange, DiffLabels } from './decisionTextDiff';
|
|
3
3
|
import { type MarkBadgeProps } from './MarkBadge';
|
|
4
4
|
import type { Mark } from './marks';
|
|
5
|
-
import type {
|
|
5
|
+
import type { BandColumnView } from './sentenceTypes';
|
|
6
6
|
export interface BandColumnProps {
|
|
7
|
-
column:
|
|
7
|
+
column: BandColumnView;
|
|
8
8
|
mark: Mark | undefined;
|
|
9
9
|
badgeId: string;
|
|
10
10
|
change: DiffChange | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BandColumn.d.ts","sourceRoot":"","sources":["../../src/decision-table/BandColumn.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAa,KAAK,cAAc,EAAW,MAAM,aAAa,CAAC;AACtE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AASpC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"BandColumn.d.ts","sourceRoot":"","sources":["../../src/decision-table/BandColumn.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAa,KAAK,cAAc,EAAW,MAAM,aAAa,CAAC;AACtE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AASpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAWtD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,IAAI,GAAG,SAAS,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAEhB,MAAM,EAAE,UAAU,GAAG,SAAS,CAAC;IAC/B,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IAEpE,IAAI,EACA;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,GACjB;QAAE,IAAI,EAAE,QAAQ,CAAC;QAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;CAC3F;AAGD,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAqDhD,CAAC"}
|
|
@@ -30,8 +30,8 @@ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
|
30
30
|
const external_ColumnPopover_cjs_namespaceObject = require("./ColumnPopover.cjs");
|
|
31
31
|
const external_EditorOverlay_cjs_namespaceObject = require("./EditorOverlay.cjs");
|
|
32
32
|
const external_sentenceStyles_cjs_namespaceObject = require("./sentenceStyles.cjs");
|
|
33
|
-
const ColumnEditorOverlay = ({ editor,
|
|
34
|
-
const field =
|
|
33
|
+
const ColumnEditorOverlay = ({ editor, types, labels, container, id, dataTestId })=>{
|
|
34
|
+
const { field } = editor;
|
|
35
35
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_EditorOverlay_cjs_namespaceObject.EditorOverlay, {
|
|
36
36
|
anchor: editor.anchor,
|
|
37
37
|
container: container,
|
|
@@ -44,7 +44,7 @@ const ColumnEditorOverlay = ({ editor, edit, labels, container, id, dataTestId }
|
|
|
44
44
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ColumnPopover_cjs_namespaceObject.ColumnPopover, {
|
|
45
45
|
column: editor.column,
|
|
46
46
|
field: field,
|
|
47
|
-
types:
|
|
47
|
+
types: types,
|
|
48
48
|
onApply: editor.onApply,
|
|
49
49
|
onCancel: editor.onCancel,
|
|
50
50
|
onMoreProperties: editor.onMoreProperties,
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import { type
|
|
2
|
+
import { type ColumnPopoverLabels } from './ColumnPopover';
|
|
3
|
+
import type { ColumnTypeOption } from './columnTypes';
|
|
3
4
|
import type { OpenColumnEditor } from './useColumnEditing';
|
|
4
5
|
import type { RuleWindow } from './useRuleWindow';
|
|
5
|
-
export interface ColumnEditorOverlayProps {
|
|
6
|
-
editor: OpenColumnEditor
|
|
7
|
-
|
|
6
|
+
export interface ColumnEditorOverlayProps<Type> {
|
|
7
|
+
editor: OpenColumnEditor<Type>;
|
|
8
|
+
types: readonly ColumnTypeOption<Type>[];
|
|
8
9
|
labels: ColumnPopoverLabels;
|
|
9
10
|
container: RuleWindow['container'];
|
|
10
11
|
id: string;
|
|
11
12
|
dataTestId: string;
|
|
12
13
|
}
|
|
13
|
-
export declare const ColumnEditorOverlay: React.
|
|
14
|
+
export declare const ColumnEditorOverlay: <Type>({ editor, types, labels, container, id, dataTestId, }: ColumnEditorOverlayProps<Type>) => React.JSX.Element;
|
|
14
15
|
//# sourceMappingURL=ColumnEditorOverlay.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnEditorOverlay.d.ts","sourceRoot":"","sources":["../../src/decision-table/ColumnEditorOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,
|
|
1
|
+
{"version":3,"file":"ColumnEditorOverlay.d.ts","sourceRoot":"","sources":["../../src/decision-table/ColumnEditorOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAiB,KAAK,mBAAmB,EAAe,MAAM,iBAAiB,CAAC;AACvF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,WAAW,wBAAwB,CAAC,IAAI;IAC5C,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC/B,KAAK,EAAE,SAAS,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACzC,MAAM,EAAE,mBAAmB,CAAC;IAC5B,SAAS,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;CACpB;AAGD,eAAO,MAAM,mBAAmB,GAAI,IAAI,EAAG,uDAOxC,wBAAwB,CAAC,IAAI,CAAC,KAAG,KAAK,CAAC,GAAG,CAAC,OAyB7C,CAAC"}
|
|
@@ -2,8 +2,8 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { ColumnPopover, columnTitle } from "./ColumnPopover.js";
|
|
3
3
|
import { EditorOverlay } from "./EditorOverlay.js";
|
|
4
4
|
import { COLUMN_EDITOR_CLASS } from "./sentenceStyles.js";
|
|
5
|
-
const ColumnEditorOverlay = ({ editor,
|
|
6
|
-
const field =
|
|
5
|
+
const ColumnEditorOverlay = ({ editor, types, labels, container, id, dataTestId })=>{
|
|
6
|
+
const { field } = editor;
|
|
7
7
|
return /*#__PURE__*/ jsx(EditorOverlay, {
|
|
8
8
|
anchor: editor.anchor,
|
|
9
9
|
container: container,
|
|
@@ -16,7 +16,7 @@ const ColumnEditorOverlay = ({ editor, edit, labels, container, id, dataTestId }
|
|
|
16
16
|
children: /*#__PURE__*/ jsx(ColumnPopover, {
|
|
17
17
|
column: editor.column,
|
|
18
18
|
field: field,
|
|
19
|
-
types:
|
|
19
|
+
types: types,
|
|
20
20
|
onApply: editor.onApply,
|
|
21
21
|
onCancel: editor.onCancel,
|
|
22
22
|
onMoreProperties: editor.onMoreProperties,
|
|
@@ -30,44 +30,62 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
30
30
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
31
|
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
32
32
|
const external_react_namespaceObject = require("react");
|
|
33
|
-
const
|
|
33
|
+
const useSafeLingui_cjs_namespaceObject = require("../i18n/useSafeLingui.cjs");
|
|
34
|
+
const external_columnTypes_cjs_namespaceObject = require("./columnTypes.cjs");
|
|
34
35
|
const external_gridEvents_cjs_namespaceObject = require("./gridEvents.cjs");
|
|
35
36
|
const external_PopoverFooter_cjs_namespaceObject = require("./PopoverFooter.cjs");
|
|
36
37
|
const external_PopoverHeader_cjs_namespaceObject = require("./PopoverHeader.cjs");
|
|
37
38
|
const external_PopoverSelect_cjs_namespaceObject = require("./PopoverSelect.cjs");
|
|
38
39
|
const external_sentenceStyles_cjs_namespaceObject = require("./sentenceStyles.cjs");
|
|
39
40
|
const columnTitle = (kind, name, labels)=>'input' === kind ? labels.inputColumn(name) : labels.outputColumn(name);
|
|
41
|
+
const bindingOf = (field)=>'input' === field.kind ? field.expression : field.name;
|
|
42
|
+
const changed = (draft, held)=>draft.trim() === held.trim() ? void 0 : draft.trim();
|
|
40
43
|
const changeOf = (field, draft)=>{
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
const label = changed(draft.label, field.label);
|
|
45
|
+
const allowedValues = changed(draft.allowedValues, field.allowedValues);
|
|
46
|
+
const common = {
|
|
47
|
+
...void 0 === label ? {} : {
|
|
48
|
+
label
|
|
49
|
+
},
|
|
50
|
+
...draft.type === field.type ? {} : {
|
|
51
|
+
type: draft.type
|
|
52
|
+
},
|
|
53
|
+
...void 0 === allowedValues ? {} : {
|
|
54
|
+
allowedValues
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const binding = changed(draft.binding, bindingOf(field));
|
|
58
|
+
if ('input' === field.kind) return {
|
|
59
|
+
kind: 'input',
|
|
60
|
+
...common,
|
|
61
|
+
...void 0 === binding ? {} : {
|
|
62
|
+
expression: binding
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
return {
|
|
66
|
+
kind: 'output',
|
|
67
|
+
...common,
|
|
68
|
+
...void 0 === binding ? {} : {
|
|
69
|
+
name: binding
|
|
70
|
+
}
|
|
71
|
+
};
|
|
47
72
|
};
|
|
48
73
|
const ColumnPopover = ({ column, field, types, onApply, onCancel, onMoreProperties, labels, dataTestId })=>{
|
|
49
74
|
const id = (0, external_react_namespaceObject.useId)();
|
|
75
|
+
const { _ } = (0, useSafeLingui_cjs_namespaceObject.useSafeLingui)();
|
|
50
76
|
const [root, setRoot] = (0, external_react_namespaceObject.useState)(null);
|
|
51
77
|
const [draft, setDraft] = (0, external_react_namespaceObject.useState)({
|
|
52
78
|
label: field.label,
|
|
53
|
-
binding: field
|
|
54
|
-
|
|
55
|
-
allowedValues: field.allowedValues
|
|
79
|
+
binding: bindingOf(field),
|
|
80
|
+
type: field.type,
|
|
81
|
+
allowedValues: field.allowedValues
|
|
56
82
|
});
|
|
57
|
-
const
|
|
83
|
+
const required = 'input' === field.kind || field.nameRequired;
|
|
84
|
+
const missing = required && '' === draft.binding.trim();
|
|
58
85
|
const missingLabel = '' === draft.label.trim();
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}));
|
|
63
|
-
const options = types.some((type)=>type.id === field.typeRef) ? typed : [
|
|
64
|
-
{
|
|
65
|
-
id: field.typeRef,
|
|
66
|
-
label: field.typeRef
|
|
67
|
-
},
|
|
68
|
-
...typed
|
|
69
|
-
];
|
|
70
|
-
const placeholder = types.find((type)=>type.id === draft.typeRef)?.allowedValuesPlaceholder;
|
|
86
|
+
const choices = (0, external_columnTypes_cjs_namespaceObject.columnTypeChoicesOf)(types, _);
|
|
87
|
+
const place = types.findIndex((option)=>option.type === draft.type);
|
|
88
|
+
const placeholder = choices.find((_choice, index)=>index === place)?.allowedValuesPlaceholder;
|
|
71
89
|
const set = (key)=>(event)=>{
|
|
72
90
|
const value = event.currentTarget.value;
|
|
73
91
|
setDraft((current)=>({
|
|
@@ -136,7 +154,7 @@ const ColumnPopover = ({ column, field, types, onApply, onCancel, onMoreProperti
|
|
|
136
154
|
className: external_sentenceStyles_cjs_namespaceObject.COLUMN_FIELD_LABEL_CLASS,
|
|
137
155
|
children: [
|
|
138
156
|
bindingLabel,
|
|
139
|
-
|
|
157
|
+
required && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
140
158
|
"aria-hidden": true,
|
|
141
159
|
className: external_sentenceStyles_cjs_namespaceObject.COLUMN_REQUIRED_CLASS,
|
|
142
160
|
children: ' *'
|
|
@@ -146,7 +164,7 @@ const ColumnPopover = ({ column, field, types, onApply, onCancel, onMoreProperti
|
|
|
146
164
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Input, {
|
|
147
165
|
id: `${id}-binding`,
|
|
148
166
|
className: external_sentenceStyles_cjs_namespaceObject.COLUMN_CODE_FIELD_CLASS,
|
|
149
|
-
"aria-required":
|
|
167
|
+
"aria-required": required,
|
|
150
168
|
"aria-invalid": missing,
|
|
151
169
|
"aria-describedby": missing ? `${id}-missing` : void 0,
|
|
152
170
|
value: draft.binding,
|
|
@@ -170,19 +188,22 @@ const ColumnPopover = ({ column, field, types, onApply, onCancel, onMoreProperti
|
|
|
170
188
|
}),
|
|
171
189
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_PopoverSelect_cjs_namespaceObject.PopoverSelect, {
|
|
172
190
|
id: `${id}-type`,
|
|
173
|
-
value:
|
|
174
|
-
options:
|
|
175
|
-
onChange: (
|
|
191
|
+
value: String(place),
|
|
192
|
+
options: choices,
|
|
193
|
+
onChange: (picked)=>{
|
|
194
|
+
const option = types.find((_option, index)=>String(index) === picked);
|
|
195
|
+
if (option) setDraft((current)=>({
|
|
176
196
|
...current,
|
|
177
|
-
|
|
178
|
-
}))
|
|
197
|
+
type: option.type
|
|
198
|
+
}));
|
|
199
|
+
},
|
|
179
200
|
container: root,
|
|
180
201
|
label: labels.dataType,
|
|
181
202
|
dataTestId: `${dataTestId}-type`
|
|
182
203
|
})
|
|
183
204
|
]
|
|
184
205
|
}),
|
|
185
|
-
|
|
206
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
186
207
|
className: external_sentenceStyles_cjs_namespaceObject.COLUMN_FIELD_CLASS,
|
|
187
208
|
children: [
|
|
188
209
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Label, {
|
|
@@ -1,24 +1,37 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
+
import { type ColumnTypeOption } from './columnTypes';
|
|
2
3
|
import { type PopoverFooterLabels } from './PopoverFooter';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
kind: SentenceNameToken['kind'];
|
|
4
|
+
import type { SentenceBand } from './sentenceTypes';
|
|
5
|
+
export type ColumnFieldData<Type> = {
|
|
6
|
+
kind: 'input';
|
|
7
7
|
label: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
expression: string;
|
|
9
|
+
type: Type;
|
|
10
|
+
allowedValues: string;
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'output';
|
|
13
|
+
label: string;
|
|
14
|
+
name: string;
|
|
15
|
+
nameRequired: boolean;
|
|
16
|
+
type: Type;
|
|
17
|
+
allowedValues: string;
|
|
18
|
+
};
|
|
19
|
+
export type ColumnChange<Type> = {
|
|
20
|
+
kind: 'input';
|
|
21
|
+
label?: string;
|
|
22
|
+
expression?: string;
|
|
23
|
+
type?: Type;
|
|
11
24
|
allowedValues?: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
onCommit: (columnId: string, change: ColumnChange) => void;
|
|
25
|
+
} | {
|
|
26
|
+
kind: 'output';
|
|
27
|
+
label?: string;
|
|
28
|
+
name?: string;
|
|
29
|
+
type?: Type;
|
|
30
|
+
allowedValues?: string;
|
|
31
|
+
};
|
|
32
|
+
export interface ColumnEdit<Type> {
|
|
33
|
+
field: (columnId: string) => ColumnFieldData<Type> | undefined;
|
|
34
|
+
onCommit: (columnId: string, change: ColumnChange<Type>) => void;
|
|
22
35
|
onMoreProperties?: (columnId: string) => void;
|
|
23
36
|
}
|
|
24
37
|
export interface ColumnPopoverLabels extends PopoverFooterLabels {
|
|
@@ -35,16 +48,16 @@ export interface ColumnPopoverLabels extends PopoverFooterLabels {
|
|
|
35
48
|
allowedValuesHint: string;
|
|
36
49
|
moreProperties: string;
|
|
37
50
|
}
|
|
38
|
-
export interface ColumnPopoverProps {
|
|
51
|
+
export interface ColumnPopoverProps<Type> {
|
|
39
52
|
column: SentenceBand['columns'][number];
|
|
40
|
-
field:
|
|
41
|
-
types:
|
|
42
|
-
onApply: (change: ColumnChange) => void;
|
|
53
|
+
field: ColumnFieldData<Type>;
|
|
54
|
+
types: readonly ColumnTypeOption<Type>[];
|
|
55
|
+
onApply: (change: ColumnChange<Type>) => void;
|
|
43
56
|
onCancel: () => void;
|
|
44
57
|
onMoreProperties: (() => void) | undefined;
|
|
45
58
|
labels: ColumnPopoverLabels;
|
|
46
59
|
dataTestId: string;
|
|
47
60
|
}
|
|
48
|
-
export declare const columnTitle: (kind:
|
|
49
|
-
export declare const ColumnPopover: React.
|
|
61
|
+
export declare const columnTitle: (kind: ColumnFieldData<unknown>["kind"], name: string, labels: ColumnPopoverLabels) => string;
|
|
62
|
+
export declare const ColumnPopover: <Type>({ column, field, types, onApply, onCancel, onMoreProperties, labels, dataTestId, }: ColumnPopoverProps<Type>) => React.JSX.Element;
|
|
50
63
|
//# sourceMappingURL=ColumnPopover.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnPopover.d.ts","sourceRoot":"","sources":["../../src/decision-table/ColumnPopover.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ColumnPopover.d.ts","sourceRoot":"","sources":["../../src/decision-table/ColumnPopover.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,44 +1,62 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Input, Label } from "@uipath/apollo-wind";
|
|
3
3
|
import { useId, useState } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { useSafeLingui } from "../i18n/useSafeLingui.js";
|
|
5
|
+
import { columnTypeChoicesOf } from "./columnTypes.js";
|
|
5
6
|
import { isComposing } from "./gridEvents.js";
|
|
6
7
|
import { PopoverFooter } from "./PopoverFooter.js";
|
|
7
8
|
import { PopoverHeader } from "./PopoverHeader.js";
|
|
8
9
|
import { PopoverSelect } from "./PopoverSelect.js";
|
|
9
10
|
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";
|
|
10
11
|
const columnTitle = (kind, name, labels)=>'input' === kind ? labels.inputColumn(name) : labels.outputColumn(name);
|
|
12
|
+
const bindingOf = (field)=>'input' === field.kind ? field.expression : field.name;
|
|
13
|
+
const changed = (draft, held)=>draft.trim() === held.trim() ? void 0 : draft.trim();
|
|
11
14
|
const changeOf = (field, draft)=>{
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const label = changed(draft.label, field.label);
|
|
16
|
+
const allowedValues = changed(draft.allowedValues, field.allowedValues);
|
|
17
|
+
const common = {
|
|
18
|
+
...void 0 === label ? {} : {
|
|
19
|
+
label
|
|
20
|
+
},
|
|
21
|
+
...draft.type === field.type ? {} : {
|
|
22
|
+
type: draft.type
|
|
23
|
+
},
|
|
24
|
+
...void 0 === allowedValues ? {} : {
|
|
25
|
+
allowedValues
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const binding = changed(draft.binding, bindingOf(field));
|
|
29
|
+
if ('input' === field.kind) return {
|
|
30
|
+
kind: 'input',
|
|
31
|
+
...common,
|
|
32
|
+
...void 0 === binding ? {} : {
|
|
33
|
+
expression: binding
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
return {
|
|
37
|
+
kind: 'output',
|
|
38
|
+
...common,
|
|
39
|
+
...void 0 === binding ? {} : {
|
|
40
|
+
name: binding
|
|
41
|
+
}
|
|
42
|
+
};
|
|
18
43
|
};
|
|
19
44
|
const ColumnPopover = ({ column, field, types, onApply, onCancel, onMoreProperties, labels, dataTestId })=>{
|
|
20
45
|
const id = useId();
|
|
46
|
+
const { _ } = useSafeLingui();
|
|
21
47
|
const [root, setRoot] = useState(null);
|
|
22
48
|
const [draft, setDraft] = useState({
|
|
23
49
|
label: field.label,
|
|
24
|
-
binding: field
|
|
25
|
-
|
|
26
|
-
allowedValues: field.allowedValues
|
|
50
|
+
binding: bindingOf(field),
|
|
51
|
+
type: field.type,
|
|
52
|
+
allowedValues: field.allowedValues
|
|
27
53
|
});
|
|
28
|
-
const
|
|
54
|
+
const required = 'input' === field.kind || field.nameRequired;
|
|
55
|
+
const missing = required && '' === draft.binding.trim();
|
|
29
56
|
const missingLabel = '' === draft.label.trim();
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}));
|
|
34
|
-
const options = types.some((type)=>type.id === field.typeRef) ? typed : [
|
|
35
|
-
{
|
|
36
|
-
id: field.typeRef,
|
|
37
|
-
label: field.typeRef
|
|
38
|
-
},
|
|
39
|
-
...typed
|
|
40
|
-
];
|
|
41
|
-
const placeholder = types.find((type)=>type.id === draft.typeRef)?.allowedValuesPlaceholder;
|
|
57
|
+
const choices = columnTypeChoicesOf(types, _);
|
|
58
|
+
const place = types.findIndex((option)=>option.type === draft.type);
|
|
59
|
+
const placeholder = choices.find((_choice, index)=>index === place)?.allowedValuesPlaceholder;
|
|
42
60
|
const set = (key)=>(event)=>{
|
|
43
61
|
const value = event.currentTarget.value;
|
|
44
62
|
setDraft((current)=>({
|
|
@@ -107,7 +125,7 @@ const ColumnPopover = ({ column, field, types, onApply, onCancel, onMoreProperti
|
|
|
107
125
|
className: COLUMN_FIELD_LABEL_CLASS,
|
|
108
126
|
children: [
|
|
109
127
|
bindingLabel,
|
|
110
|
-
|
|
128
|
+
required && /*#__PURE__*/ jsx("span", {
|
|
111
129
|
"aria-hidden": true,
|
|
112
130
|
className: COLUMN_REQUIRED_CLASS,
|
|
113
131
|
children: ' *'
|
|
@@ -117,7 +135,7 @@ const ColumnPopover = ({ column, field, types, onApply, onCancel, onMoreProperti
|
|
|
117
135
|
/*#__PURE__*/ jsx(Input, {
|
|
118
136
|
id: `${id}-binding`,
|
|
119
137
|
className: COLUMN_CODE_FIELD_CLASS,
|
|
120
|
-
"aria-required":
|
|
138
|
+
"aria-required": required,
|
|
121
139
|
"aria-invalid": missing,
|
|
122
140
|
"aria-describedby": missing ? `${id}-missing` : void 0,
|
|
123
141
|
value: draft.binding,
|
|
@@ -141,19 +159,22 @@ const ColumnPopover = ({ column, field, types, onApply, onCancel, onMoreProperti
|
|
|
141
159
|
}),
|
|
142
160
|
/*#__PURE__*/ jsx(PopoverSelect, {
|
|
143
161
|
id: `${id}-type`,
|
|
144
|
-
value:
|
|
145
|
-
options:
|
|
146
|
-
onChange: (
|
|
162
|
+
value: String(place),
|
|
163
|
+
options: choices,
|
|
164
|
+
onChange: (picked)=>{
|
|
165
|
+
const option = types.find((_option, index)=>String(index) === picked);
|
|
166
|
+
if (option) setDraft((current)=>({
|
|
147
167
|
...current,
|
|
148
|
-
|
|
149
|
-
}))
|
|
168
|
+
type: option.type
|
|
169
|
+
}));
|
|
170
|
+
},
|
|
150
171
|
container: root,
|
|
151
172
|
label: labels.dataType,
|
|
152
173
|
dataTestId: `${dataTestId}-type`
|
|
153
174
|
})
|
|
154
175
|
]
|
|
155
176
|
}),
|
|
156
|
-
|
|
177
|
+
/*#__PURE__*/ jsxs("div", {
|
|
157
178
|
className: COLUMN_FIELD_CLASS,
|
|
158
179
|
children: [
|
|
159
180
|
/*#__PURE__*/ jsx(Label, {
|
|
@@ -109,8 +109,8 @@ const perRuleHeightOf = (heights, ruleCounts)=>{
|
|
|
109
109
|
}
|
|
110
110
|
return 0 === rules ? external_sentenceRuleHeights_cjs_namespaceObject.SENTENCE_MIN_RULE_HEIGHT_PX : height / rules;
|
|
111
111
|
};
|
|
112
|
-
const DecisionGraphText = ({ nodes, renderBody, expanded: hostExpanded, onExpandedChange, onFold, selected = null, onReveal, onOpenDecision, rules,
|
|
113
|
-
const labels = (0, external_useDecisionGraphStrings_cjs_namespaceObject.useDecisionGraphLabels)(
|
|
112
|
+
const DecisionGraphText = ({ nodes, renderBody, expanded: hostExpanded, onExpandedChange, onFold, selected = null, onReveal, onOpenDecision, rules, dataTestId })=>{
|
|
113
|
+
const labels = (0, external_useDecisionGraphStrings_cjs_namespaceObject.useDecisionGraphLabels)();
|
|
114
114
|
const idPrefix = (0, external_react_namespaceObject.useId)();
|
|
115
115
|
const [ownExpanded, setOwnExpanded] = (0, external_react_namespaceObject.useState)(NO_EXPANDED);
|
|
116
116
|
const expanded = hostExpanded ?? ownExpanded;
|
|
@@ -2,7 +2,6 @@ import type React from 'react';
|
|
|
2
2
|
import { type DecisionGraphMinimapSlotProps } from './DecisionGraphMinimapSlot';
|
|
3
3
|
import type { DecisionGraphNode, DecisionGraphTarget } from './decisionGraphTypes';
|
|
4
4
|
import type { ContainerHandlersParams } from './useContainerHandlers';
|
|
5
|
-
import { type DecisionGraphLabels } from './useDecisionGraphStrings';
|
|
6
5
|
import { type DecisionTextScroll } from './useRuleWindow';
|
|
7
6
|
export interface DecisionGraphTextProps {
|
|
8
7
|
nodes: readonly DecisionGraphNode[];
|
|
@@ -14,7 +13,6 @@ export interface DecisionGraphTextProps {
|
|
|
14
13
|
onReveal?: (target: DecisionGraphTarget) => void;
|
|
15
14
|
onOpenDecision?: ContainerHandlersParams['onOpenDecision'];
|
|
16
15
|
rules?: DecisionGraphMinimapSlotProps['rules'];
|
|
17
|
-
labels?: Partial<DecisionGraphLabels>;
|
|
18
16
|
dataTestId: string;
|
|
19
17
|
}
|
|
20
18
|
export declare const DecisionGraphText: React.FC<DecisionGraphTextProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DecisionGraphText.d.ts","sourceRoot":"","sources":["../../src/decision-table/DecisionGraphText.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,4BAA4B,CAAC;AAWpC,OAAO,KAAK,EAEV,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"DecisionGraphText.d.ts","sourceRoot":"","sources":["../../src/decision-table/DecisionGraphText.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,4BAA4B,CAAC;AAWpC,OAAO,KAAK,EAEV,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,OAAO,EAAgB,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAExE,MAAM,WAAW,sBAAsB;IAErC,KAAK,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAEpC,UAAU,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,kBAAkB,EAAE,MAAM,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IAEjG,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAEtC,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC/B,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IAE3D,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAEjD,cAAc,CAAC,EAAE,uBAAuB,CAAC,gBAAgB,CAAC,CAAC;IAE3D,KAAK,CAAC,EAAE,6BAA6B,CAAC,OAAO,CAAC,CAAC;IAE/C,UAAU,EAAE,MAAM,CAAC;CACpB;AAiGD,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAyQ9D,CAAC"}
|
|
@@ -81,8 +81,8 @@ const perRuleHeightOf = (heights, ruleCounts)=>{
|
|
|
81
81
|
}
|
|
82
82
|
return 0 === rules ? SENTENCE_MIN_RULE_HEIGHT_PX : height / rules;
|
|
83
83
|
};
|
|
84
|
-
const DecisionGraphText = ({ nodes, renderBody, expanded: hostExpanded, onExpandedChange, onFold, selected = null, onReveal, onOpenDecision, rules,
|
|
85
|
-
const labels = useDecisionGraphLabels(
|
|
84
|
+
const DecisionGraphText = ({ nodes, renderBody, expanded: hostExpanded, onExpandedChange, onFold, selected = null, onReveal, onOpenDecision, rules, dataTestId })=>{
|
|
85
|
+
const labels = useDecisionGraphLabels();
|
|
86
86
|
const idPrefix = useId();
|
|
87
87
|
const [ownExpanded, setOwnExpanded] = useState(NO_EXPANDED);
|
|
88
88
|
const expanded = hostExpanded ?? ownExpanded;
|
|
@@ -29,13 +29,16 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
29
29
|
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
|
+
const useSafeLingui_cjs_namespaceObject = require("../i18n/useSafeLingui.cjs");
|
|
32
33
|
const external_AddRuleFooter_cjs_namespaceObject = require("./AddRuleFooter.cjs");
|
|
33
34
|
const external_bandColumns_cjs_namespaceObject = require("./bandColumns.cjs");
|
|
34
35
|
const external_ColumnEditorOverlay_cjs_namespaceObject = require("./ColumnEditorOverlay.cjs");
|
|
36
|
+
const external_columnTypes_cjs_namespaceObject = require("./columnTypes.cjs");
|
|
35
37
|
const external_DecisionTextHeader_cjs_namespaceObject = require("./DecisionTextHeader.cjs");
|
|
36
38
|
const external_decisionTextDiff_cjs_namespaceObject = require("./decisionTextDiff.cjs");
|
|
37
39
|
const external_EmptyRules_cjs_namespaceObject = require("./EmptyRules.cjs");
|
|
38
40
|
const external_GridMenu_cjs_namespaceObject = require("./GridMenu.cjs");
|
|
41
|
+
const external_hitPolicyMenu_cjs_namespaceObject = require("./hitPolicyMenu.cjs");
|
|
39
42
|
const external_MarkTooltip_cjs_namespaceObject = require("./MarkTooltip.cjs");
|
|
40
43
|
const external_marks_cjs_namespaceObject = require("./marks.cjs");
|
|
41
44
|
const external_RuleList_cjs_namespaceObject = require("./RuleList.cjs");
|
|
@@ -71,19 +74,42 @@ const nameTokensOf = (bands)=>{
|
|
|
71
74
|
text: columnId
|
|
72
75
|
};
|
|
73
76
|
};
|
|
74
|
-
const DecisionText = ({
|
|
77
|
+
const DecisionText = ({ table, mode, hitPolicies, columnTypes, numbered = false, marks = external_marks_cjs_namespaceObject.EMPTY_MARKS, onCellHover, headerMark, onOpenDecision, scroll = 'self', ariaLabel, containerProps, dataTestId, children })=>{
|
|
78
|
+
const { rules, inputs, outputs } = table;
|
|
79
|
+
const selected = 'diff' === mode.kind ? null : mode.selected;
|
|
80
|
+
const onSelect = 'select' === mode.kind || 'edit' === mode.kind ? mode.onSelect : void 0;
|
|
81
|
+
const diff = 'diff' === mode.kind ? mode.diff : void 0;
|
|
75
82
|
const idPrefix = (0, external_react_namespaceObject.useId)();
|
|
76
|
-
const
|
|
77
|
-
const
|
|
83
|
+
const { _ } = (0, useSafeLingui_cjs_namespaceObject.useSafeLingui)();
|
|
84
|
+
const labels = (0, external_useDecisionTextStrings_cjs_namespaceObject.useDecisionTextLabels)();
|
|
85
|
+
const hostEdit = 'edit' === mode.kind ? mode.edit : void 0;
|
|
86
|
+
const { edit, refusal } = (0, external_useEditState_cjs_namespaceObject.useEditState)(hostEdit, (0, external_useDecisionTextStrings_cjs_namespaceObject.useDecisionTextEditLabels)());
|
|
87
|
+
const addRule = 'edit' === mode.kind ? {
|
|
88
|
+
label: labels.addRule,
|
|
89
|
+
onAdd: mode.onAddRule
|
|
90
|
+
} : void 0;
|
|
91
|
+
const policyHeader = (0, external_hitPolicyMenu_cjs_namespaceObject.policyHeaderOf)(hitPolicies, table.hitPolicy);
|
|
92
|
+
const title = 'edit' === mode.kind ? {
|
|
93
|
+
kind: 'picker',
|
|
94
|
+
policy: (0, external_hitPolicyMenu_cjs_namespaceObject.policyMenuOf)(hitPolicies, table.hitPolicy, mode.onPolicyChange, _)
|
|
95
|
+
} : diff?.hitPolicy ? {
|
|
96
|
+
kind: 'change',
|
|
97
|
+
before: (0, external_hitPolicyMenu_cjs_namespaceObject.policyHeaderOf)(hitPolicies, diff.hitPolicy.before).label,
|
|
98
|
+
after: (0, external_hitPolicyMenu_cjs_namespaceObject.policyHeaderOf)(hitPolicies, diff.hitPolicy.after).label
|
|
99
|
+
} : {
|
|
100
|
+
kind: 'label',
|
|
101
|
+
label: policyHeader.label
|
|
102
|
+
};
|
|
78
103
|
const columns = (0, external_react_namespaceObject.useMemo)(()=>diff && (0, external_decisionTextDiff_cjs_namespaceObject.diffColumnsOf)(inputs, outputs, diff), [
|
|
79
104
|
inputs,
|
|
80
105
|
outputs,
|
|
81
106
|
diff
|
|
82
107
|
]);
|
|
83
|
-
const bands = (0, external_react_namespaceObject.useMemo)(()=>(0, external_bandColumns_cjs_namespaceObject.bandsOf)(columns?.inputs ?? inputs, columns?.outputs ?? outputs, labels), [
|
|
108
|
+
const bands = (0, external_react_namespaceObject.useMemo)(()=>(0, external_bandColumns_cjs_namespaceObject.bandsOf)(columns?.inputs ?? inputs, columns?.outputs ?? outputs, (type)=>(0, external_columnTypes_cjs_namespaceObject.glyphOf)(columnTypes, type), labels), [
|
|
84
109
|
columns,
|
|
85
110
|
inputs,
|
|
86
111
|
outputs,
|
|
112
|
+
columnTypes,
|
|
87
113
|
labels
|
|
88
114
|
]);
|
|
89
115
|
const [folds, setFolds] = (0, external_react_namespaceObject.useState)({
|
|
@@ -146,7 +172,7 @@ const DecisionText = ({ rules, inputs, outputs, header, numbered = false, marks
|
|
|
146
172
|
stopTabbable: selectable && null !== ruleWindow.selectedRow
|
|
147
173
|
});
|
|
148
174
|
const columnEditing = (0, external_useColumnEditing_cjs_namespaceObject.useColumnEditing)({
|
|
149
|
-
column: edit
|
|
175
|
+
column: 'edit' === mode.kind ? mode.edit.column : void 0,
|
|
150
176
|
bands,
|
|
151
177
|
container: ruleWindow.container
|
|
152
178
|
});
|
|
@@ -167,10 +193,9 @@ const DecisionText = ({ rules, inputs, outputs, header, numbered = false, marks
|
|
|
167
193
|
children: [
|
|
168
194
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_DecisionTextHeader_cjs_namespaceObject.DecisionTextHeader, {
|
|
169
195
|
ref: ruleWindow.headerRef,
|
|
170
|
-
|
|
171
|
-
|
|
196
|
+
title: title,
|
|
197
|
+
hint: policyHeader.hint,
|
|
172
198
|
mark: headerMark,
|
|
173
|
-
hitPolicy: diff?.hitPolicy,
|
|
174
199
|
labels: labels,
|
|
175
200
|
sticky: 'self' === scroll,
|
|
176
201
|
dataTestId: dataTestId
|
|
@@ -237,9 +262,9 @@ const DecisionText = ({ rules, inputs, outputs, header, numbered = false, marks
|
|
|
237
262
|
container: ruleWindow.container,
|
|
238
263
|
dataTestId: dataTestId
|
|
239
264
|
}, valueEditing.editorKey),
|
|
240
|
-
'edit' === columnEditing.kind && columnEditing.editor && edit
|
|
265
|
+
'edit' === columnEditing.kind && columnEditing.editor && edit && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ColumnEditorOverlay_cjs_namespaceObject.ColumnEditorOverlay, {
|
|
241
266
|
editor: columnEditing.editor,
|
|
242
|
-
|
|
267
|
+
types: columnTypes,
|
|
243
268
|
labels: edit.labels,
|
|
244
269
|
container: ruleWindow.container,
|
|
245
270
|
id: columnEditorId,
|