@uipath/apollo-react 4.44.1 → 4.45.1
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/components/NodePropertiesPanel/NodePropertiesPanel.cjs +14 -13
- package/dist/canvas/components/NodePropertiesPanel/NodePropertiesPanel.d.ts.map +1 -1
- package/dist/canvas/components/NodePropertiesPanel/NodePropertiesPanel.js +12 -11
- package/dist/canvas/components/NodePropertiesPanel/fields/CheckboxField.cjs +14 -16
- package/dist/canvas/components/NodePropertiesPanel/fields/CheckboxField.d.ts.map +1 -1
- package/dist/canvas/components/NodePropertiesPanel/fields/CheckboxField.js +14 -16
- package/dist/canvas/components/NodePropertiesPanel/fields/NumberField.cjs +18 -16
- package/dist/canvas/components/NodePropertiesPanel/fields/NumberField.d.ts.map +1 -1
- package/dist/canvas/components/NodePropertiesPanel/fields/NumberField.js +18 -16
- package/dist/canvas/components/NodePropertiesPanel/fields/SelectField.cjs +40 -22
- package/dist/canvas/components/NodePropertiesPanel/fields/SelectField.d.ts.map +1 -1
- package/dist/canvas/components/NodePropertiesPanel/fields/SelectField.js +40 -22
- package/dist/canvas/components/NodePropertiesPanel/fields/TextField.cjs +24 -20
- package/dist/canvas/components/NodePropertiesPanel/fields/TextField.d.ts.map +1 -1
- package/dist/canvas/components/NodePropertiesPanel/fields/TextField.js +24 -20
- package/dist/canvas/components/NodePropertiesPanel/index.cjs +12 -55
- package/dist/canvas/components/NodePropertiesPanel/index.d.ts +0 -1
- package/dist/canvas/components/NodePropertiesPanel/index.d.ts.map +1 -1
- package/dist/canvas/components/NodePropertiesPanel/index.js +0 -1
- package/dist/canvas/components/index.cjs +2 -2
- package/dist/canvas/controls/NodePropertyTrigger/NodePropertyTrigger.cjs +395 -0
- package/dist/canvas/controls/NodePropertyTrigger/NodePropertyTrigger.d.ts +57 -0
- package/dist/canvas/controls/NodePropertyTrigger/NodePropertyTrigger.d.ts.map +1 -0
- package/dist/canvas/controls/NodePropertyTrigger/NodePropertyTrigger.js +349 -0
- package/dist/canvas/controls/NodePropertyTrigger/index.cjs +48 -0
- package/dist/canvas/controls/NodePropertyTrigger/index.d.ts +3 -0
- package/dist/canvas/controls/NodePropertyTrigger/index.d.ts.map +1 -0
- package/dist/canvas/controls/NodePropertyTrigger/index.js +2 -0
- package/dist/canvas/controls/index.cjs +18 -2
- package/dist/canvas/controls/index.d.ts +2 -0
- package/dist/canvas/controls/index.d.ts.map +1 -1
- package/dist/canvas/controls/index.js +2 -1
- package/dist/canvas/locales/en.cjs +1 -1
- package/dist/canvas/locales/en.d.ts.map +1 -1
- package/dist/canvas/locales/en.js +1 -1
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/package.json +1 -1
- package/dist/canvas/components/NodePropertiesPanel/NodePropertiesPanel.styles.cjs +0 -284
- package/dist/canvas/components/NodePropertiesPanel/NodePropertiesPanel.styles.d.ts +0 -69
- package/dist/canvas/components/NodePropertiesPanel/NodePropertiesPanel.styles.d.ts.map +0 -1
- package/dist/canvas/components/NodePropertiesPanel/NodePropertiesPanel.styles.js +0 -195
|
@@ -0,0 +1,395 @@
|
|
|
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
|
+
NodePropertyTriggerSectionLabel: ()=>NodePropertyTriggerSectionLabel,
|
|
28
|
+
NodePropertyTriggerSeparator: ()=>NodePropertyTriggerSeparator,
|
|
29
|
+
NodePropertyTriggerCheckboxItem: ()=>NodePropertyTriggerCheckboxItem,
|
|
30
|
+
NodePropertyTriggerRadioItem: ()=>NodePropertyTriggerRadioItem,
|
|
31
|
+
NodePropertyTrigger: ()=>NodePropertyTrigger
|
|
32
|
+
});
|
|
33
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
34
|
+
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
35
|
+
const external_react_namespaceObject = require("react");
|
|
36
|
+
const index_cjs_namespaceObject = require("../../../i18n/index.cjs");
|
|
37
|
+
const icon_registry_cjs_namespaceObject = require("../../utils/icon-registry.cjs");
|
|
38
|
+
function clampToOptions(value, options) {
|
|
39
|
+
return options.some((option)=>option.value === value) ? value : options[0]?.value ?? value;
|
|
40
|
+
}
|
|
41
|
+
const defaultBehaviorOptions = (_)=>[
|
|
42
|
+
{
|
|
43
|
+
value: 'auto-hide',
|
|
44
|
+
label: _({
|
|
45
|
+
id: 'canvas.property_trigger.auto_hide',
|
|
46
|
+
message: 'Auto hide'
|
|
47
|
+
})
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: 'always-persist',
|
|
51
|
+
label: _({
|
|
52
|
+
id: 'canvas.property_trigger.always_persist',
|
|
53
|
+
message: 'Always persist'
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
];
|
|
57
|
+
const defaultLayoutOptions = (_)=>[
|
|
58
|
+
{
|
|
59
|
+
value: 'right',
|
|
60
|
+
label: _({
|
|
61
|
+
id: 'canvas.property_trigger.layout_right',
|
|
62
|
+
message: 'Default — Right'
|
|
63
|
+
})
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
value: 'bottom',
|
|
67
|
+
label: _({
|
|
68
|
+
id: 'canvas.property_trigger.layout_bottom',
|
|
69
|
+
message: 'Default — Bottom'
|
|
70
|
+
})
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
value: 'split',
|
|
74
|
+
label: _({
|
|
75
|
+
id: 'canvas.property_trigger.layout_split',
|
|
76
|
+
message: 'Default — Split'
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
];
|
|
80
|
+
const ROW_CLASS = 'group justify-between gap-2 rounded-none px-3 py-2 text-xs text-foreground-muted focus:bg-surface-overlay focus:text-foreground';
|
|
81
|
+
const DOT_CLASS = 'size-2 shrink-0 rounded-full bg-surface-overlay group-data-[state=checked]:bg-foreground-accent';
|
|
82
|
+
const HIDE_LEFT_INDICATOR_CLASS = '[&>span:first-child]:hidden';
|
|
83
|
+
function NodePropertyTriggerSectionLabel({ className, ...props }) {
|
|
84
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.DropdownMenuLabel, {
|
|
85
|
+
className: (0, apollo_wind_namespaceObject.cn)('px-3 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-wide text-foreground-subtle', className),
|
|
86
|
+
...props
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function NodePropertyTriggerSeparator({ className, ...props }) {
|
|
90
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.DropdownMenuSeparator, {
|
|
91
|
+
className: (0, apollo_wind_namespaceObject.cn)('mx-0 my-0 bg-border-subtle', className),
|
|
92
|
+
...props
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function NodePropertyTriggerCheckboxItem({ className, children, closeOnSelect = false, onSelect, ...props }) {
|
|
96
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.DropdownMenuCheckboxItem, {
|
|
97
|
+
className: (0, apollo_wind_namespaceObject.cn)(ROW_CLASS, HIDE_LEFT_INDICATOR_CLASS, className),
|
|
98
|
+
onSelect: (e)=>{
|
|
99
|
+
if (!closeOnSelect) e.preventDefault();
|
|
100
|
+
onSelect?.(e);
|
|
101
|
+
},
|
|
102
|
+
...props,
|
|
103
|
+
children: [
|
|
104
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
105
|
+
className: "min-w-0 flex-1 truncate",
|
|
106
|
+
children: children
|
|
107
|
+
}),
|
|
108
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
109
|
+
className: DOT_CLASS
|
|
110
|
+
})
|
|
111
|
+
]
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function NodePropertyTriggerRadioItem({ className, children, ...props }) {
|
|
115
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.DropdownMenuRadioItem, {
|
|
116
|
+
className: (0, apollo_wind_namespaceObject.cn)(ROW_CLASS, HIDE_LEFT_INDICATOR_CLASS, className),
|
|
117
|
+
...props,
|
|
118
|
+
children: [
|
|
119
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
120
|
+
className: "min-w-0 flex-1 truncate",
|
|
121
|
+
children: children
|
|
122
|
+
}),
|
|
123
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
124
|
+
className: DOT_CLASS
|
|
125
|
+
})
|
|
126
|
+
]
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function NodePropertyTrigger({ label, className, showMenu = true, open, onOpenChange, menuAriaLabel, children, onPropertiesClick, panels = [], behavior, behaviorOptions, layout, layoutOptions, presets = [], onBehaviorChange, onLayoutChange, onPanelToggle, onPresetApply, onPresetRename, onPresetDelete, onSavePreset, canSavePreset = false }) {
|
|
130
|
+
const { _ } = (0, index_cjs_namespaceObject.useSafeLingui)();
|
|
131
|
+
const resolvedLabel = label ?? _({
|
|
132
|
+
id: 'canvas.property_trigger.properties',
|
|
133
|
+
message: 'Properties'
|
|
134
|
+
});
|
|
135
|
+
const resolvedMenuAriaLabel = menuAriaLabel ?? _({
|
|
136
|
+
id: 'canvas.property_trigger.panel_options',
|
|
137
|
+
message: 'Panel options'
|
|
138
|
+
});
|
|
139
|
+
const resolvedBehaviorOptions = behaviorOptions ?? defaultBehaviorOptions(_);
|
|
140
|
+
const resolvedLayoutOptions = layoutOptions ?? defaultLayoutOptions(_);
|
|
141
|
+
const labelBaseClassName = 'flex h-8 items-center rounded-lg px-2.5 text-xs font-medium text-foreground-muted transition';
|
|
142
|
+
const [internalBehavior, setInternalBehavior] = (0, external_react_namespaceObject.useState)(()=>resolvedBehaviorOptions[0]?.value ?? 'auto-hide');
|
|
143
|
+
const [internalLayout, setInternalLayout] = (0, external_react_namespaceObject.useState)(()=>resolvedLayoutOptions[0]?.value ?? 'right');
|
|
144
|
+
const effectiveBehavior = behavior ?? clampToOptions(internalBehavior, resolvedBehaviorOptions);
|
|
145
|
+
const effectiveLayout = layout ?? clampToOptions(internalLayout, resolvedLayoutOptions);
|
|
146
|
+
const handleBehaviorChange = (0, external_react_namespaceObject.useCallback)((val)=>{
|
|
147
|
+
if (onBehaviorChange) onBehaviorChange(val);
|
|
148
|
+
else setInternalBehavior(val);
|
|
149
|
+
}, [
|
|
150
|
+
onBehaviorChange
|
|
151
|
+
]);
|
|
152
|
+
const handleLayoutChange = (0, external_react_namespaceObject.useCallback)((val)=>{
|
|
153
|
+
if (onLayoutChange) onLayoutChange(val);
|
|
154
|
+
else setInternalLayout(val);
|
|
155
|
+
}, [
|
|
156
|
+
onLayoutChange
|
|
157
|
+
]);
|
|
158
|
+
const sections = [];
|
|
159
|
+
if (panels.length > 0) sections.push({
|
|
160
|
+
key: 'panels',
|
|
161
|
+
node: panels.map(({ id, label: panelLabel, enabled })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(NodePropertyTriggerCheckboxItem, {
|
|
162
|
+
checked: !!enabled,
|
|
163
|
+
onCheckedChange: (checked)=>onPanelToggle?.(id ?? panelLabel, true === checked),
|
|
164
|
+
children: panelLabel
|
|
165
|
+
}, id ?? panelLabel))
|
|
166
|
+
});
|
|
167
|
+
if (resolvedBehaviorOptions.length > 0) sections.push({
|
|
168
|
+
key: 'behavior',
|
|
169
|
+
node: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
170
|
+
children: [
|
|
171
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(NodePropertyTriggerSectionLabel, {
|
|
172
|
+
children: _({
|
|
173
|
+
id: 'canvas.property_trigger.panel_behavior',
|
|
174
|
+
message: 'Panel behavior'
|
|
175
|
+
})
|
|
176
|
+
}),
|
|
177
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.DropdownMenuRadioGroup, {
|
|
178
|
+
value: effectiveBehavior,
|
|
179
|
+
onValueChange: handleBehaviorChange,
|
|
180
|
+
children: resolvedBehaviorOptions.map(({ value, label: behaviorLabel })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(NodePropertyTriggerRadioItem, {
|
|
181
|
+
value: value,
|
|
182
|
+
children: behaviorLabel
|
|
183
|
+
}, value))
|
|
184
|
+
})
|
|
185
|
+
]
|
|
186
|
+
})
|
|
187
|
+
});
|
|
188
|
+
if (resolvedLayoutOptions.length > 0) sections.push({
|
|
189
|
+
key: 'layouts',
|
|
190
|
+
node: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
191
|
+
children: [
|
|
192
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(NodePropertyTriggerSectionLabel, {
|
|
193
|
+
children: _({
|
|
194
|
+
id: 'canvas.property_trigger.default_layouts',
|
|
195
|
+
message: 'Default layouts'
|
|
196
|
+
})
|
|
197
|
+
}),
|
|
198
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.DropdownMenuRadioGroup, {
|
|
199
|
+
value: effectiveLayout,
|
|
200
|
+
onValueChange: handleLayoutChange,
|
|
201
|
+
children: resolvedLayoutOptions.map(({ value, label: layoutLabel })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(NodePropertyTriggerRadioItem, {
|
|
202
|
+
value: value,
|
|
203
|
+
children: layoutLabel
|
|
204
|
+
}, value))
|
|
205
|
+
})
|
|
206
|
+
]
|
|
207
|
+
})
|
|
208
|
+
});
|
|
209
|
+
if (presets.length > 0 || canSavePreset) sections.push({
|
|
210
|
+
key: 'presets',
|
|
211
|
+
node: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
212
|
+
children: [
|
|
213
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(NodePropertyTriggerSectionLabel, {
|
|
214
|
+
children: _({
|
|
215
|
+
id: 'canvas.property_trigger.saved_presets',
|
|
216
|
+
message: 'Saved presets'
|
|
217
|
+
})
|
|
218
|
+
}),
|
|
219
|
+
0 === presets.length && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
|
|
220
|
+
className: "px-3 pb-2 text-[11px] text-foreground-subtle",
|
|
221
|
+
children: _({
|
|
222
|
+
id: 'canvas.property_trigger.no_saved_presets',
|
|
223
|
+
message: 'No saved presets yet.'
|
|
224
|
+
})
|
|
225
|
+
}),
|
|
226
|
+
presets.map((preset)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.DropdownMenuItem, {
|
|
227
|
+
"aria-label": _({
|
|
228
|
+
id: 'canvas.property_trigger.apply_preset_with_label',
|
|
229
|
+
message: 'Apply {label}',
|
|
230
|
+
values: {
|
|
231
|
+
label: preset.label
|
|
232
|
+
}
|
|
233
|
+
}),
|
|
234
|
+
className: (0, apollo_wind_namespaceObject.cn)(ROW_CLASS, 'pr-1'),
|
|
235
|
+
onSelect: ()=>onPresetApply?.(preset),
|
|
236
|
+
children: [
|
|
237
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
238
|
+
title: preset.label,
|
|
239
|
+
className: "min-w-0 flex-1 truncate",
|
|
240
|
+
children: preset.label
|
|
241
|
+
}),
|
|
242
|
+
onPresetRename && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
243
|
+
type: "button",
|
|
244
|
+
title: _({
|
|
245
|
+
id: 'canvas.property_trigger.rename_preset_with_label',
|
|
246
|
+
message: 'Rename {label}',
|
|
247
|
+
values: {
|
|
248
|
+
label: preset.label
|
|
249
|
+
}
|
|
250
|
+
}),
|
|
251
|
+
"aria-label": _({
|
|
252
|
+
id: 'canvas.property_trigger.rename_preset_with_label',
|
|
253
|
+
message: 'Rename {label}',
|
|
254
|
+
values: {
|
|
255
|
+
label: preset.label
|
|
256
|
+
}
|
|
257
|
+
}),
|
|
258
|
+
onClick: (e)=>{
|
|
259
|
+
e.stopPropagation();
|
|
260
|
+
e.preventDefault();
|
|
261
|
+
onPresetRename(preset);
|
|
262
|
+
},
|
|
263
|
+
onPointerDown: (e)=>e.stopPropagation(),
|
|
264
|
+
onPointerUp: (e)=>e.stopPropagation(),
|
|
265
|
+
className: "grid size-6 shrink-0 place-items-center rounded text-foreground-subtle transition hover:text-foreground",
|
|
266
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
|
|
267
|
+
icon: "pencil",
|
|
268
|
+
size: 11
|
|
269
|
+
})
|
|
270
|
+
}),
|
|
271
|
+
onPresetDelete && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
272
|
+
type: "button",
|
|
273
|
+
title: _({
|
|
274
|
+
id: 'canvas.property_trigger.delete_preset_with_label',
|
|
275
|
+
message: 'Delete {label}',
|
|
276
|
+
values: {
|
|
277
|
+
label: preset.label
|
|
278
|
+
}
|
|
279
|
+
}),
|
|
280
|
+
"aria-label": _({
|
|
281
|
+
id: 'canvas.property_trigger.delete_preset_with_label',
|
|
282
|
+
message: 'Delete {label}',
|
|
283
|
+
values: {
|
|
284
|
+
label: preset.label
|
|
285
|
+
}
|
|
286
|
+
}),
|
|
287
|
+
onClick: (e)=>{
|
|
288
|
+
e.stopPropagation();
|
|
289
|
+
e.preventDefault();
|
|
290
|
+
onPresetDelete(preset.id);
|
|
291
|
+
},
|
|
292
|
+
onPointerDown: (e)=>e.stopPropagation(),
|
|
293
|
+
onPointerUp: (e)=>e.stopPropagation(),
|
|
294
|
+
className: "grid size-6 shrink-0 place-items-center rounded text-foreground-subtle transition hover:text-foreground",
|
|
295
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
|
|
296
|
+
icon: "trash-2",
|
|
297
|
+
size: 11
|
|
298
|
+
})
|
|
299
|
+
})
|
|
300
|
+
]
|
|
301
|
+
}, preset.id)),
|
|
302
|
+
canSavePreset && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.DropdownMenuItem, {
|
|
303
|
+
className: (0, apollo_wind_namespaceObject.cn)(ROW_CLASS, 'justify-start'),
|
|
304
|
+
onSelect: ()=>onSavePreset?.(),
|
|
305
|
+
children: [
|
|
306
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
|
|
307
|
+
icon: "plus",
|
|
308
|
+
size: 12
|
|
309
|
+
}),
|
|
310
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
311
|
+
children: _({
|
|
312
|
+
id: 'canvas.property_trigger.save_as_preset',
|
|
313
|
+
message: 'Save as preset'
|
|
314
|
+
})
|
|
315
|
+
})
|
|
316
|
+
]
|
|
317
|
+
})
|
|
318
|
+
]
|
|
319
|
+
})
|
|
320
|
+
});
|
|
321
|
+
const defaultSections = sections.map(({ key, node }, index)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_react_namespaceObject.Fragment, {
|
|
322
|
+
children: [
|
|
323
|
+
index > 0 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(NodePropertyTriggerSeparator, {}),
|
|
324
|
+
node
|
|
325
|
+
]
|
|
326
|
+
}, key));
|
|
327
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
328
|
+
"data-node-property-trigger-root": true,
|
|
329
|
+
className: (0, apollo_wind_namespaceObject.cn)('w-fit flex flex-row items-center rounded-xl border border-border-subtle bg-surface-raised p-1', className),
|
|
330
|
+
style: {
|
|
331
|
+
boxShadow: '0 2px 6px rgba(0,0,0,0.08)'
|
|
332
|
+
},
|
|
333
|
+
children: [
|
|
334
|
+
onPropertiesClick ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
335
|
+
type: "button",
|
|
336
|
+
onClick: onPropertiesClick,
|
|
337
|
+
className: (0, apollo_wind_namespaceObject.cn)(labelBaseClassName, 'hover:bg-surface-overlay hover:text-foreground'),
|
|
338
|
+
children: resolvedLabel
|
|
339
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
340
|
+
className: labelBaseClassName,
|
|
341
|
+
children: resolvedLabel
|
|
342
|
+
}),
|
|
343
|
+
showMenu && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
|
|
344
|
+
children: [
|
|
345
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
346
|
+
className: "mx-0.5 h-4 w-px shrink-0 bg-border-subtle"
|
|
347
|
+
}),
|
|
348
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.DropdownMenu, {
|
|
349
|
+
open: open,
|
|
350
|
+
onOpenChange: onOpenChange,
|
|
351
|
+
modal: false,
|
|
352
|
+
children: [
|
|
353
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.DropdownMenuTrigger, {
|
|
354
|
+
asChild: true,
|
|
355
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
356
|
+
type: "button",
|
|
357
|
+
title: resolvedMenuAriaLabel,
|
|
358
|
+
"aria-label": resolvedMenuAriaLabel,
|
|
359
|
+
className: "grid size-8 place-items-center rounded-lg text-foreground-muted transition hover:bg-surface-overlay hover:text-foreground data-[state=open]:bg-surface-overlay data-[state=open]:text-foreground",
|
|
360
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icon_registry_cjs_namespaceObject.CanvasIcon, {
|
|
361
|
+
icon: "sliders-horizontal",
|
|
362
|
+
size: 14
|
|
363
|
+
})
|
|
364
|
+
})
|
|
365
|
+
}),
|
|
366
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.DropdownMenuContent, {
|
|
367
|
+
"data-node-property-trigger-menu": true,
|
|
368
|
+
align: "end",
|
|
369
|
+
sideOffset: 8,
|
|
370
|
+
className: "w-56 rounded-xl border-border-subtle bg-surface-raised p-0 shadow-[0_4px_16px_rgba(0,0,0,0.12)]",
|
|
371
|
+
children: children ?? defaultSections
|
|
372
|
+
})
|
|
373
|
+
]
|
|
374
|
+
})
|
|
375
|
+
]
|
|
376
|
+
})
|
|
377
|
+
]
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
NodePropertyTrigger.displayName = 'NodePropertyTrigger';
|
|
381
|
+
exports.NodePropertyTrigger = __webpack_exports__.NodePropertyTrigger;
|
|
382
|
+
exports.NodePropertyTriggerCheckboxItem = __webpack_exports__.NodePropertyTriggerCheckboxItem;
|
|
383
|
+
exports.NodePropertyTriggerRadioItem = __webpack_exports__.NodePropertyTriggerRadioItem;
|
|
384
|
+
exports.NodePropertyTriggerSectionLabel = __webpack_exports__.NodePropertyTriggerSectionLabel;
|
|
385
|
+
exports.NodePropertyTriggerSeparator = __webpack_exports__.NodePropertyTriggerSeparator;
|
|
386
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
387
|
+
"NodePropertyTrigger",
|
|
388
|
+
"NodePropertyTriggerCheckboxItem",
|
|
389
|
+
"NodePropertyTriggerRadioItem",
|
|
390
|
+
"NodePropertyTriggerSectionLabel",
|
|
391
|
+
"NodePropertyTriggerSeparator"
|
|
392
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
393
|
+
Object.defineProperty(exports, '__esModule', {
|
|
394
|
+
value: true
|
|
395
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { DropdownMenuCheckboxItem, DropdownMenuLabel, DropdownMenuRadioItem, DropdownMenuSeparator } from '@uipath/apollo-wind';
|
|
2
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
3
|
+
export type NodePropertyTriggerItem = {
|
|
4
|
+
id?: string;
|
|
5
|
+
label: string;
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type NodePropertyTriggerBehavior = 'auto-hide' | 'always-persist' | (string & {});
|
|
9
|
+
export type NodePropertyTriggerLayout = 'right' | 'bottom' | 'split' | (string & {});
|
|
10
|
+
export type NodePropertyTriggerPreset = {
|
|
11
|
+
id: string;
|
|
12
|
+
label: string;
|
|
13
|
+
};
|
|
14
|
+
export type NodePropertyTriggerBehaviorOption = {
|
|
15
|
+
value: NodePropertyTriggerBehavior;
|
|
16
|
+
label: string;
|
|
17
|
+
};
|
|
18
|
+
export type NodePropertyTriggerLayoutOption = {
|
|
19
|
+
value: NodePropertyTriggerLayout;
|
|
20
|
+
label: string;
|
|
21
|
+
};
|
|
22
|
+
export type NodePropertyTriggerProps = {
|
|
23
|
+
label?: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
showMenu?: boolean;
|
|
26
|
+
open?: boolean;
|
|
27
|
+
onOpenChange?: (open: boolean) => void;
|
|
28
|
+
menuAriaLabel?: string;
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
onPropertiesClick?: () => void;
|
|
31
|
+
panels?: NodePropertyTriggerItem[];
|
|
32
|
+
behavior?: NodePropertyTriggerBehavior;
|
|
33
|
+
behaviorOptions?: NodePropertyTriggerBehaviorOption[];
|
|
34
|
+
layout?: NodePropertyTriggerLayout;
|
|
35
|
+
layoutOptions?: NodePropertyTriggerLayoutOption[];
|
|
36
|
+
presets?: NodePropertyTriggerPreset[];
|
|
37
|
+
onBehaviorChange?: (behavior: NodePropertyTriggerBehavior) => void;
|
|
38
|
+
onLayoutChange?: (layout: NodePropertyTriggerLayout) => void;
|
|
39
|
+
onPanelToggle?: (id: string, enabled: boolean) => void;
|
|
40
|
+
onPresetApply?: (preset: NodePropertyTriggerPreset) => void;
|
|
41
|
+
onPresetRename?: (preset: NodePropertyTriggerPreset) => void;
|
|
42
|
+
onPresetDelete?: (id: string) => void;
|
|
43
|
+
onSavePreset?: () => void;
|
|
44
|
+
canSavePreset?: boolean;
|
|
45
|
+
};
|
|
46
|
+
export declare function NodePropertyTriggerSectionLabel({ className, ...props }: ComponentPropsWithoutRef<typeof DropdownMenuLabel>): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export declare function NodePropertyTriggerSeparator({ className, ...props }: ComponentPropsWithoutRef<typeof DropdownMenuSeparator>): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
export type NodePropertyTriggerCheckboxItemProps = ComponentPropsWithoutRef<typeof DropdownMenuCheckboxItem> & {
|
|
49
|
+
closeOnSelect?: boolean;
|
|
50
|
+
};
|
|
51
|
+
export declare function NodePropertyTriggerCheckboxItem({ className, children, closeOnSelect, onSelect, ...props }: NodePropertyTriggerCheckboxItemProps): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export declare function NodePropertyTriggerRadioItem({ className, children, ...props }: ComponentPropsWithoutRef<typeof DropdownMenuRadioItem>): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
export declare function NodePropertyTrigger({ label, className, showMenu, open, onOpenChange, menuAriaLabel, children, onPropertiesClick, panels, behavior, behaviorOptions, layout, layoutOptions, presets, onBehaviorChange, onLayoutChange, onPanelToggle, onPresetApply, onPresetRename, onPresetDelete, onSavePreset, canSavePreset, }: NodePropertyTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
export declare namespace NodePropertyTrigger {
|
|
55
|
+
var displayName: string;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=NodePropertyTrigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NodePropertyTrigger.d.ts","sourceRoot":"","sources":["../../../../src/canvas/controls/NodePropertyTrigger/NodePropertyTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,wBAAwB,EAGxB,iBAAiB,EAEjB,qBAAqB,EACrB,qBAAqB,EAEtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,wBAAwB,EAE7B,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAIf,MAAM,MAAM,uBAAuB,GAAG;IAKpC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAIF,MAAM,MAAM,2BAA2B,GAAG,WAAW,GAAG,gBAAgB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AACzF,MAAM,MAAM,yBAAyB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,CAAC,MAAM,GAAG,EAAE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