@uipath/apollo-wind 2.93.0 → 2.94.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.
Files changed (124) hide show
  1. package/dist/components/forms/field-renderer.cjs +1 -1
  2. package/dist/components/forms/field-renderer.js +1 -1
  3. package/dist/components/forms/field-rules-strings.cjs +40 -0
  4. package/dist/components/forms/field-rules-strings.d.ts +17 -0
  5. package/dist/components/forms/field-rules-strings.js +6 -0
  6. package/dist/components/forms/field-rules.cjs +526 -0
  7. package/dist/components/forms/field-rules.d.ts +97 -0
  8. package/dist/components/forms/field-rules.js +468 -0
  9. package/dist/components/forms/form-designer.cjs +208 -592
  10. package/dist/components/forms/form-designer.js +210 -594
  11. package/dist/components/forms/form-schema.d.ts +5 -0
  12. package/dist/components/forms/index.cjs +43 -3
  13. package/dist/components/forms/index.d.ts +4 -0
  14. package/dist/components/forms/index.js +5 -1
  15. package/dist/components/forms/metadata-form.cjs +1 -1
  16. package/dist/components/forms/metadata-form.js +1 -1
  17. package/dist/components/forms/rules-engine-dialect.cjs +644 -0
  18. package/dist/components/forms/rules-engine-dialect.d.ts +90 -0
  19. package/dist/components/forms/rules-engine-dialect.js +537 -0
  20. package/dist/components/forms/rules-engine.cjs +99 -10
  21. package/dist/components/forms/rules-engine.d.ts +5 -0
  22. package/dist/components/forms/rules-engine.js +99 -10
  23. package/dist/components/forms/use-field-rules.cjs +122 -0
  24. package/dist/components/forms/use-field-rules.d.ts +31 -0
  25. package/dist/components/forms/use-field-rules.js +88 -0
  26. package/dist/components/ui/conditions-editor/condition-row.cjs +458 -0
  27. package/dist/components/ui/conditions-editor/condition-row.d.ts +23 -0
  28. package/dist/components/ui/conditions-editor/condition-row.js +421 -0
  29. package/dist/components/ui/conditions-editor/conditions-editor.cjs +363 -0
  30. package/dist/components/ui/conditions-editor/conditions-editor.d.ts +67 -0
  31. package/dist/components/ui/conditions-editor/conditions-editor.js +329 -0
  32. package/dist/components/ui/conditions-editor/context.cjs +45 -0
  33. package/dist/components/ui/conditions-editor/context.d.ts +54 -0
  34. package/dist/components/ui/conditions-editor/context.js +8 -0
  35. package/dist/components/ui/conditions-editor/index.cjs +55 -0
  36. package/dist/components/ui/conditions-editor/index.d.ts +6 -0
  37. package/dist/components/ui/conditions-editor/index.js +6 -0
  38. package/dist/components/ui/conditions-editor/model.cjs +126 -0
  39. package/dist/components/ui/conditions-editor/model.d.ts +39 -0
  40. package/dist/components/ui/conditions-editor/model.js +71 -0
  41. package/dist/components/ui/conditions-editor/status.cjs +198 -0
  42. package/dist/components/ui/conditions-editor/status.d.ts +44 -0
  43. package/dist/components/ui/conditions-editor/status.js +131 -0
  44. package/dist/components/ui/conditions-editor/strings.cjs +86 -0
  45. package/dist/components/ui/conditions-editor/strings.d.ts +62 -0
  46. package/dist/components/ui/conditions-editor/strings.js +52 -0
  47. package/dist/components/ui/conditions-editor/vocabulary.cjs +163 -0
  48. package/dist/components/ui/conditions-editor/vocabulary.d.ts +51 -0
  49. package/dist/components/ui/conditions-editor/vocabulary.js +129 -0
  50. package/dist/components/ui/field-actions/index.cjs +9 -2
  51. package/dist/components/ui/field-actions/index.d.ts +1 -0
  52. package/dist/components/ui/field-actions/index.js +2 -1
  53. package/dist/components/ui/field-actions/insert-variable-action.cjs +3 -1
  54. package/dist/components/ui/field-actions/insert-variable-action.d.ts +4 -1
  55. package/dist/components/ui/field-actions/insert-variable-action.js +3 -1
  56. package/dist/components/ui/field-actions/rules-action.cjs +244 -0
  57. package/dist/components/ui/field-actions/rules-action.d.ts +42 -0
  58. package/dist/components/ui/field-actions/rules-action.js +207 -0
  59. package/dist/components/ui/index.cjs +273 -234
  60. package/dist/components/ui/index.d.ts +3 -0
  61. package/dist/components/ui/index.js +3 -0
  62. package/dist/components/ui/quick-form-field/components/field-header.cjs +137 -167
  63. package/dist/components/ui/quick-form-field/components/field-header.d.ts +1 -1
  64. package/dist/components/ui/quick-form-field/components/field-header.js +138 -168
  65. package/dist/components/ui/quick-form-field/components/header-actions.cjs +187 -0
  66. package/dist/components/ui/quick-form-field/components/header-actions.d.ts +59 -0
  67. package/dist/components/ui/quick-form-field/components/header-actions.js +138 -0
  68. package/dist/components/ui/quick-form-field/components/header-context.cjs +59 -0
  69. package/dist/components/ui/quick-form-field/components/header-context.d.ts +33 -0
  70. package/dist/components/ui/quick-form-field/components/header-context.js +16 -0
  71. package/dist/components/ui/quick-form-field/index.cjs +18 -4
  72. package/dist/components/ui/quick-form-field/index.d.ts +2 -0
  73. package/dist/components/ui/quick-form-field/index.js +3 -1
  74. package/dist/components/ui/quick-form-field/quick-form-field.cjs +1 -1
  75. package/dist/components/ui/quick-form-field/quick-form-field.d.ts +6 -6
  76. package/dist/components/ui/quick-form-field/quick-form-field.js +1 -1
  77. package/dist/components/ui/quick-form-field/types.d.ts +42 -11
  78. package/dist/components/ui/row-groups/add-row-button.cjs +54 -0
  79. package/dist/components/ui/row-groups/add-row-button.d.ts +10 -0
  80. package/dist/components/ui/row-groups/add-row-button.js +20 -0
  81. package/dist/components/ui/row-groups/after-press.cjs +73 -0
  82. package/dist/components/ui/row-groups/after-press.d.ts +7 -0
  83. package/dist/components/ui/row-groups/after-press.js +36 -0
  84. package/dist/components/ui/row-groups/collapsible-row-group.cjs +83 -0
  85. package/dist/components/ui/row-groups/collapsible-row-group.d.ts +13 -0
  86. package/dist/components/ui/row-groups/collapsible-row-group.js +49 -0
  87. package/dist/components/ui/row-groups/empty-rows.cjs +42 -0
  88. package/dist/components/ui/row-groups/empty-rows.d.ts +7 -0
  89. package/dist/components/ui/row-groups/empty-rows.js +8 -0
  90. package/dist/components/ui/row-groups/group-mode-toggle.cjs +80 -0
  91. package/dist/components/ui/row-groups/group-mode-toggle.d.ts +26 -0
  92. package/dist/components/ui/row-groups/group-mode-toggle.js +40 -0
  93. package/dist/components/ui/row-groups/index.cjs +62 -0
  94. package/dist/components/ui/row-groups/index.d.ts +6 -0
  95. package/dist/components/ui/row-groups/index.js +7 -0
  96. package/dist/components/ui/row-groups/row-delete-button.cjs +54 -0
  97. package/dist/components/ui/row-groups/row-delete-button.d.ts +18 -0
  98. package/dist/components/ui/row-groups/row-delete-button.js +20 -0
  99. package/dist/components/ui/row-groups/use-row-focus.cjs +82 -0
  100. package/dist/components/ui/row-groups/use-row-focus.d.ts +17 -0
  101. package/dist/components/ui/row-groups/use-row-focus.js +48 -0
  102. package/dist/components/ui/rules-editor/context.cjs +45 -0
  103. package/dist/components/ui/rules-editor/context.d.ts +52 -0
  104. package/dist/components/ui/rules-editor/context.js +8 -0
  105. package/dist/components/ui/rules-editor/index.cjs +56 -0
  106. package/dist/components/ui/rules-editor/index.d.ts +4 -0
  107. package/dist/components/ui/rules-editor/index.js +4 -0
  108. package/dist/components/ui/rules-editor/model.cjs +205 -0
  109. package/dist/components/ui/rules-editor/model.d.ts +128 -0
  110. package/dist/components/ui/rules-editor/model.js +144 -0
  111. package/dist/components/ui/rules-editor/rule-card.cjs +470 -0
  112. package/dist/components/ui/rules-editor/rule-card.d.ts +14 -0
  113. package/dist/components/ui/rules-editor/rule-card.js +436 -0
  114. package/dist/components/ui/rules-editor/rules-editor.cjs +160 -0
  115. package/dist/components/ui/rules-editor/rules-editor.d.ts +66 -0
  116. package/dist/components/ui/rules-editor/rules-editor.js +126 -0
  117. package/dist/components/ui/rules-editor/strings.cjs +68 -0
  118. package/dist/components/ui/rules-editor/strings.d.ts +56 -0
  119. package/dist/components/ui/rules-editor/strings.js +34 -0
  120. package/dist/index.cjs +129 -8
  121. package/dist/index.d.ts +17 -4
  122. package/dist/index.js +10 -3
  123. package/dist/styles.css +97 -24
  124. package/package.json +2 -2
@@ -0,0 +1,458 @@
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
+ ConditionRow: ()=>condition_row_ConditionRow,
28
+ ConditionSeparator: ()=>ConditionSeparator
29
+ });
30
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
+ const external_react_namespaceObject = require("react");
32
+ const external_date_picker_cjs_namespaceObject = require("../date-picker.cjs");
33
+ const index_cjs_namespaceObject = require("../field-addons/index.cjs");
34
+ const external_form_field_cjs_namespaceObject = require("../form-field.cjs");
35
+ const external_input_group_cjs_namespaceObject = require("../input-group.cjs");
36
+ const external_multi_select_cjs_namespaceObject = require("../multi-select.cjs");
37
+ const external_row_groups_index_cjs_namespaceObject = require("../row-groups/index.cjs");
38
+ const after_press_cjs_namespaceObject = require("../row-groups/after-press.cjs");
39
+ const external_select_cjs_namespaceObject = require("../select.cjs");
40
+ const external_variable_value_control_cjs_namespaceObject = require("../variable-value-control.cjs");
41
+ const external_lib_index_cjs_namespaceObject = require("../../../lib/index.cjs");
42
+ const external_context_cjs_namespaceObject = require("./context.cjs");
43
+ const external_status_cjs_namespaceObject = require("./status.cjs");
44
+ const ROW_GRID = 'grid min-w-0 flex-1 grid-cols-1 items-start gap-2 @xs:grid-cols-[minmax(0,3fr)_minmax(0,2fr)] @lg:grid-cols-[minmax(0,1fr)_minmax(0,0.8fr)_minmax(0,1.2fr)]';
45
+ const LABEL_CLASS = '@lg:in-[[data-condition-row]~[data-condition-row]]:sr-only';
46
+ const LABEL_SPACER_CLASS = 'h-4 @lg:in-[[data-condition-row]~[data-condition-row]]:hidden';
47
+ const POPUPS = '[data-radix-popper-content-wrapper], [role="dialog"]';
48
+ function leftRow(event) {
49
+ const next = event.relatedTarget;
50
+ if (next && event.currentTarget.contains(next)) return false;
51
+ const popup = next?.closest(POPUPS);
52
+ if (popup && !popup.contains(event.currentTarget)) return false;
53
+ return true;
54
+ }
55
+ function keptValues(c, field, mode) {
56
+ if (field?.type !== 'enum' || 'literal' !== mode) return {};
57
+ const known = (value)=>field.options?.some((option)=>option.value === value);
58
+ return {
59
+ value: c.value && known(c.value) ? c.value : '',
60
+ values: (c.values ?? []).filter(known)
61
+ };
62
+ }
63
+ function ConditionValue({ condition: c, resolved, name, labelledBy, invalid, errorId, describedBy, onChange }) {
64
+ const editor = (0, external_context_cjs_namespaceObject.useConditionsEditor)();
65
+ const { strings, disabled } = editor;
66
+ const controlId = external_react_namespaceObject.useId();
67
+ const { field, operator, mode } = resolved;
68
+ const aria = {
69
+ 'aria-invalid': invalid || void 0,
70
+ 'aria-describedby': describedBy,
71
+ 'aria-errormessage': invalid ? errorId : void 0
72
+ };
73
+ const builtIns = (0, index_cjs_namespaceObject.builtInValueModes)(editor.valueModeStrings, {
74
+ expectedType: field?.type === 'number' ? 'number' : void 0
75
+ });
76
+ const modes = editor.valueModes.map((id)=>resolved.allowedModes.includes(id) ? {
77
+ ...builtIns[id],
78
+ id
79
+ } : {
80
+ ...builtIns[id],
81
+ id,
82
+ disabled: true,
83
+ description: strings.valueModeUnavailable(operator?.label ?? '')
84
+ });
85
+ const builtInControl = ()=>{
86
+ if ('variable' === mode) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_variable_value_control_cjs_namespaceObject.VariableValueControl, {
87
+ "aria-labelledby": labelledBy,
88
+ "aria-describedby": describedBy,
89
+ value: c.value,
90
+ variables: editor.variables ?? [],
91
+ disabled: disabled,
92
+ strings: editor.valueModeStrings,
93
+ onChange: (reference)=>onChange({
94
+ value: reference
95
+ })
96
+ });
97
+ if ('literal' === mode && field?.type === 'date') return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_date_picker_cjs_namespaceObject.DatePicker, {
98
+ "aria-labelledby": labelledBy,
99
+ ...aria,
100
+ placeholder: strings.datePlaceholder,
101
+ value: (0, external_status_cjs_namespaceObject.parseDateValue)(c.value),
102
+ disabled: disabled,
103
+ onValueChange: (date)=>onChange({
104
+ value: date ? (0, external_status_cjs_namespaceObject.formatDateValue)(date) : ''
105
+ })
106
+ });
107
+ if ('literal' === mode && field?.type === 'enum' && operator?.multiple) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
108
+ children: [
109
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("label", {
110
+ htmlFor: controlId,
111
+ className: "sr-only",
112
+ children: name
113
+ }),
114
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_multi_select_cjs_namespaceObject.MultiSelect, {
115
+ id: controlId,
116
+ ...aria,
117
+ options: [
118
+ ...field.options ?? []
119
+ ],
120
+ selected: c.values ?? [],
121
+ overflow: "collapse",
122
+ placeholder: strings.optionsPlaceholder,
123
+ disabled: disabled,
124
+ strings: editor.multiSelectStrings,
125
+ onChange: (values)=>onChange({
126
+ values
127
+ })
128
+ })
129
+ ]
130
+ });
131
+ if ('literal' === mode && field?.type === 'enum') return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_select_cjs_namespaceObject.Select, {
132
+ value: c.value,
133
+ onValueChange: (value)=>onChange({
134
+ value
135
+ }),
136
+ disabled: disabled,
137
+ children: [
138
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_select_cjs_namespaceObject.SelectTrigger, {
139
+ "aria-labelledby": labelledBy,
140
+ ...aria,
141
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_select_cjs_namespaceObject.SelectValue, {
142
+ placeholder: strings.optionPlaceholder
143
+ })
144
+ }),
145
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_select_cjs_namespaceObject.SelectContent, {
146
+ children: field.options?.map((option)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_select_cjs_namespaceObject.SelectItem, {
147
+ value: option.value,
148
+ children: option.label
149
+ }, option.value))
150
+ })
151
+ ]
152
+ });
153
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupInput, {
154
+ "aria-labelledby": labelledBy,
155
+ ...aria,
156
+ className: (0, external_lib_index_cjs_namespaceObject.cn)('expression' === mode && 'font-mono'),
157
+ placeholder: 'expression' === mode ? strings.expressionPlaceholder || void 0 : strings.valuePlaceholder,
158
+ value: c.value ?? '',
159
+ disabled: disabled,
160
+ onChange: (event)=>onChange({
161
+ value: event.target.value
162
+ })
163
+ });
164
+ };
165
+ const hostControl = editor.renderValue?.({
166
+ condition: c,
167
+ field,
168
+ operator,
169
+ mode,
170
+ labelledBy,
171
+ invalid,
172
+ errorId,
173
+ describedBy,
174
+ disabled,
175
+ onChange
176
+ });
177
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_input_group_cjs_namespaceObject.InputGroup, {
178
+ invalid: invalid,
179
+ children: [
180
+ 'expression' === mode && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
181
+ align: "inline-start",
182
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.ValueModeIndicator, {
183
+ mode: "expression",
184
+ className: "px-0",
185
+ strings: editor.valueModeStrings
186
+ })
187
+ }),
188
+ void 0 === hostControl ? builtInControl() : hostControl,
189
+ modes.length > 1 && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_input_group_cjs_namespaceObject.InputGroupAddon, {
190
+ align: "inline-end",
191
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.FieldMenu, {
192
+ mode: mode,
193
+ modes: modes,
194
+ disabled: disabled,
195
+ strings: editor.valueModeStrings,
196
+ triggerLabel: strings.valueModeMenu(name, builtIns[mode].title),
197
+ onSelect: (next)=>{
198
+ if (next !== mode) onChange({
199
+ valueMode: next,
200
+ value: '',
201
+ values: []
202
+ });
203
+ }
204
+ })
205
+ })
206
+ ]
207
+ });
208
+ }
209
+ function ConditionSeparator() {
210
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
211
+ "aria-hidden": "true",
212
+ "data-condition-separator": "",
213
+ className: "@lg:hidden",
214
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
215
+ className: "h-px bg-border"
216
+ })
217
+ });
218
+ }
219
+ const condition_row_ConditionRow = /*#__PURE__*/ external_react_namespaceObject.memo(function({ index, position, condition: c, onDelete }) {
220
+ const editor = (0, external_context_cjs_namespaceObject.useConditionsEditor)();
221
+ const { strings, disabled } = editor;
222
+ const baseId = external_react_namespaceObject.useId();
223
+ const errorId = `${baseId}-error`;
224
+ const rowNameId = `${baseId}-name`;
225
+ const labelIds = {
226
+ field: `${baseId}-field`,
227
+ operator: `${baseId}-operator`,
228
+ value: `${baseId}-value`
229
+ };
230
+ const labelledBy = (part)=>`${rowNameId} ${labelIds[part]}`;
231
+ const resolved = (0, external_status_cjs_namespaceObject.resolveCondition)(c, editor);
232
+ const showError = editor.forceErrors || editor.touched.has(c.id);
233
+ const error = showError ? (0, external_status_cjs_namespaceObject.conditionError)(c, editor, strings) : void 0;
234
+ const invalid = Boolean(error);
235
+ const warningId = `${baseId}-warning`;
236
+ const hintId = `${baseId}-hint`;
237
+ const warning = showError && !error && resolved.hasValue && (0, external_status_cjs_namespaceObject.isComplete)(c, editor) ? editor.valueWarning?.(c) : void 0;
238
+ const hint = resolved.hasValue ? resolved.operator?.valueHint : void 0;
239
+ const rowName = strings.conditionName(index);
240
+ const onChange = (patch)=>{
241
+ const shown = {};
242
+ if (void 0 === c.operator && resolved.operator) shown.operator = resolved.operator.value;
243
+ if (void 0 !== c.valueMode && c.valueMode !== resolved.mode) shown.valueMode = resolved.mode;
244
+ editor.updateCondition(c.id, {
245
+ ...shown,
246
+ ...patch
247
+ });
248
+ };
249
+ const withOperator = (patch, field, operatorValue)=>{
250
+ const operators = (0, external_status_cjs_namespaceObject.operatorsFor)(field, editor.operators);
251
+ const next = operators.find((option)=>option.value === operatorValue) ?? operators[0];
252
+ const modes = (0, external_status_cjs_namespaceObject.allowedModes)(next, editor.valueModes);
253
+ const base = {
254
+ ...patch,
255
+ operator: next?.value
256
+ };
257
+ if (!modes.includes(resolved.mode)) return {
258
+ ...base,
259
+ valueMode: modes[0] ?? 'literal',
260
+ value: '',
261
+ values: []
262
+ };
263
+ if (Boolean(next?.multiple) !== Boolean(resolved.operator?.multiple)) return {
264
+ ...base,
265
+ value: '',
266
+ values: []
267
+ };
268
+ return base;
269
+ };
270
+ const fieldControl = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_select_cjs_namespaceObject.Select, {
271
+ value: c.field,
272
+ disabled: disabled,
273
+ onValueChange: (value)=>{
274
+ const field = editor.fields.find((option)=>option.value === value);
275
+ const sameType = (field?.type ?? 'string') === (resolved.field?.type ?? 'string');
276
+ if (sameType) return void onChange({
277
+ ...withOperator({
278
+ field: value
279
+ }, field, resolved.operator?.value),
280
+ ...keptValues(c, field, resolved.mode)
281
+ });
282
+ onChange({
283
+ ...withOperator({
284
+ field: value
285
+ }, field, void 0),
286
+ value: '',
287
+ values: []
288
+ });
289
+ },
290
+ children: [
291
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_select_cjs_namespaceObject.SelectTrigger, {
292
+ "data-row-first": "",
293
+ "aria-labelledby": labelledBy('field'),
294
+ "aria-invalid": invalid && !resolved.field || void 0,
295
+ "aria-describedby": invalid ? errorId : void 0,
296
+ "aria-errormessage": invalid && !resolved.field ? errorId : void 0,
297
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_select_cjs_namespaceObject.SelectValue, {
298
+ placeholder: strings.fieldPlaceholder
299
+ })
300
+ }),
301
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_select_cjs_namespaceObject.SelectContent, {
302
+ children: [
303
+ c.field && !resolved.field && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_select_cjs_namespaceObject.SelectItem, {
304
+ value: c.field,
305
+ disabled: true,
306
+ children: strings.unknownField(c.field)
307
+ }),
308
+ editor.fields.map((option)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_select_cjs_namespaceObject.SelectItem, {
309
+ value: option.value,
310
+ children: option.label
311
+ }, option.value))
312
+ ]
313
+ })
314
+ ]
315
+ });
316
+ const operatorInvalid = invalid && Boolean(resolved.field) && !resolved.operator;
317
+ const operatorControl = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_select_cjs_namespaceObject.Select, {
318
+ value: resolved.operator?.value ?? '',
319
+ disabled: disabled,
320
+ onValueChange: (operator)=>onChange(withOperator({}, resolved.field, operator)),
321
+ children: [
322
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_select_cjs_namespaceObject.SelectTrigger, {
323
+ "aria-labelledby": labelledBy('operator'),
324
+ "aria-invalid": operatorInvalid || void 0,
325
+ "aria-describedby": invalid ? errorId : void 0,
326
+ "aria-errormessage": operatorInvalid ? errorId : void 0,
327
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_select_cjs_namespaceObject.SelectValue, {
328
+ placeholder: strings.operatorPlaceholder
329
+ })
330
+ }),
331
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_select_cjs_namespaceObject.SelectContent, {
332
+ children: resolved.operators.map((option)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_select_cjs_namespaceObject.SelectItem, {
333
+ value: option.value,
334
+ children: option.label
335
+ }, option.value))
336
+ })
337
+ ]
338
+ });
339
+ const valueControl = resolved.hasValue ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ConditionValue, {
340
+ condition: c,
341
+ resolved: resolved,
342
+ name: `${rowName} ${strings.valueLabel}`,
343
+ labelledBy: labelledBy('value'),
344
+ invalid: invalid && (0, external_status_cjs_namespaceObject.isValueInvalid)(c, resolved),
345
+ errorId: invalid ? errorId : warning ? warningId : void 0,
346
+ describedBy: [
347
+ hint && hintId,
348
+ invalid ? errorId : warning && warningId
349
+ ].filter(Boolean).join(' ') || void 0,
350
+ onChange: onChange
351
+ }) : null;
352
+ const deleteControl = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_row_groups_index_cjs_namespaceObject.RowDeleteButton, {
353
+ label: strings.removeCondition(index),
354
+ onClick: ()=>onDelete(c.id, position),
355
+ disabled: disabled
356
+ });
357
+ const valueMessage = Boolean(valueControl && resolved.field && resolved.operator);
358
+ const errorMessage = error && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_cjs_namespaceObject.FormFieldError, {
359
+ id: errorId,
360
+ children: error
361
+ });
362
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("fieldset", {
363
+ "data-row": "",
364
+ "data-condition-row": "",
365
+ "aria-label": rowName,
366
+ className: "m-0 flex min-w-0 flex-col border-0 p-0",
367
+ onBlur: (event)=>{
368
+ if (!editor.touched.has(c.id) && leftRow(event)) (0, after_press_cjs_namespaceObject.afterPress)(()=>editor.markTouched(c.id));
369
+ },
370
+ children: [
371
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
372
+ id: rowNameId,
373
+ className: "sr-only",
374
+ children: rowName
375
+ }),
376
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_form_field_cjs_namespaceObject.FormField, {
377
+ children: [
378
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
379
+ className: "@container",
380
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
381
+ className: "flex items-start gap-2",
382
+ children: [
383
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
384
+ className: ROW_GRID,
385
+ children: [
386
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_form_field_cjs_namespaceObject.FormField, {
387
+ children: [
388
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_cjs_namespaceObject.FormFieldLabel, {
389
+ id: labelIds.field,
390
+ className: LABEL_CLASS,
391
+ children: strings.fieldLabel
392
+ }),
393
+ fieldControl
394
+ ]
395
+ }),
396
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_form_field_cjs_namespaceObject.FormField, {
397
+ children: [
398
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_cjs_namespaceObject.FormFieldLabel, {
399
+ id: labelIds.operator,
400
+ className: LABEL_CLASS,
401
+ children: strings.operatorLabel
402
+ }),
403
+ operatorControl
404
+ ]
405
+ }),
406
+ valueControl && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_form_field_cjs_namespaceObject.FormField, {
407
+ className: "@xs:col-span-2 @lg:col-span-1",
408
+ children: [
409
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_cjs_namespaceObject.FormFieldLabel, {
410
+ id: labelIds.value,
411
+ className: LABEL_CLASS,
412
+ children: strings.valueLabel
413
+ }),
414
+ valueControl,
415
+ hint && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_cjs_namespaceObject.FormFieldDescription, {
416
+ id: hintId,
417
+ children: hint
418
+ }),
419
+ valueMessage && errorMessage,
420
+ warning && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_form_field_cjs_namespaceObject.FormFieldError, {
421
+ id: warningId,
422
+ severity: "warning",
423
+ children: warning
424
+ })
425
+ ]
426
+ })
427
+ ]
428
+ }),
429
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_form_field_cjs_namespaceObject.FormField, {
430
+ children: [
431
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
432
+ "aria-hidden": "true",
433
+ className: LABEL_SPACER_CLASS
434
+ }),
435
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
436
+ className: "flex h-9 items-center future:h-10",
437
+ children: deleteControl
438
+ })
439
+ ]
440
+ })
441
+ ]
442
+ })
443
+ }),
444
+ !valueMessage && errorMessage
445
+ ]
446
+ })
447
+ ]
448
+ });
449
+ });
450
+ exports.ConditionRow = __webpack_exports__.ConditionRow;
451
+ exports.ConditionSeparator = __webpack_exports__.ConditionSeparator;
452
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
453
+ "ConditionRow",
454
+ "ConditionSeparator"
455
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
456
+ Object.defineProperty(exports, '__esModule', {
457
+ value: true
458
+ });
@@ -0,0 +1,23 @@
1
+ import * as React from 'react';
2
+ import type { Condition } from './model';
3
+ /**
4
+ * Between two adjacent rows of a group, where the rows stack. It sits in the list's flow and spans
5
+ * the rows' full width. The next row's label line box has about 4px of leading above its glyphs, so
6
+ * the gap below is pulled in to match the gap above, unless the row above also ends in text.
7
+ */
8
+ export declare function ConditionSeparator(): import("react/jsx-runtime").JSX.Element;
9
+ export interface ConditionRowProps {
10
+ /** 1-based position across the editor, used in accessible names. */
11
+ index: number;
12
+ /** 0-based position in its group, for focus after a delete. */
13
+ position: number;
14
+ condition: Condition;
15
+ onDelete: (id: string, position: number) => void;
16
+ }
17
+ /**
18
+ * Field / operator / value / delete. The operators and the value control follow the field's type,
19
+ * and operators like "Is empty" hide the value. The operator decides the value mode: picking one
20
+ * that cannot compare against the current mode resets the value to the first mode it allows. Every
21
+ * change also writes the operator and mode the row shows, so the host's model matches the screen.
22
+ */
23
+ export declare const ConditionRow: React.NamedExoticComponent<ConditionRowProps>;