@qoretechnologies/reqraft 0.10.46-pr.95.ge595a13 → 0.10.46
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/.claude/CLAUDE.md +12 -0
- package/.tasks/INDEX.md +1 -0
- package/.tasks/TEMPLATE_TOKEN_GRAMMAR.md +72 -0
- package/dist/components/composer/Composer.d.ts.map +1 -1
- package/dist/components/composer/Composer.js +5 -1
- package/dist/components/composer/Composer.js.map +1 -1
- package/dist/components/form/engine/CompactRow.d.ts +14 -0
- package/dist/components/form/engine/CompactRow.d.ts.map +1 -1
- package/dist/components/form/engine/CompactRow.js +199 -41
- package/dist/components/form/engine/CompactRow.js.map +1 -1
- package/dist/components/form/engine/CompactToolbar.d.ts.map +1 -1
- package/dist/components/form/engine/CompactToolbar.js +72 -72
- package/dist/components/form/engine/CompactToolbar.js.map +1 -1
- package/dist/components/form/engine/FormEngine.d.ts +65 -1
- package/dist/components/form/engine/FormEngine.d.ts.map +1 -1
- package/dist/components/form/engine/FormEngine.js +276 -108
- package/dist/components/form/engine/FormEngine.js.map +1 -1
- package/dist/components/form/engine/_structuredData/SchemaDataView.d.ts.map +1 -1
- package/dist/components/form/engine/_structuredData/SchemaDataView.js +55 -13
- package/dist/components/form/engine/_structuredData/SchemaDataView.js.map +1 -1
- package/dist/components/form/engine/_structuredData/structuredData.d.ts +15 -0
- package/dist/components/form/engine/_structuredData/structuredData.d.ts.map +1 -1
- package/dist/components/form/engine/_structuredData/structuredData.js +22 -1
- package/dist/components/form/engine/_structuredData/structuredData.js.map +1 -1
- package/dist/components/form/engine/compactRowStyles.d.ts.map +1 -1
- package/dist/components/form/engine/compactRowStyles.js +15 -3
- package/dist/components/form/engine/compactRowStyles.js.map +1 -1
- package/dist/components/form/engine/compactToolbarContext.d.ts +8 -0
- package/dist/components/form/engine/compactToolbarContext.d.ts.map +1 -1
- package/dist/components/form/engine/compactToolbarContext.js.map +1 -1
- package/dist/components/form/engine/readFirst.d.ts +24 -0
- package/dist/components/form/engine/readFirst.d.ts.map +1 -1
- package/dist/components/form/engine/readFirst.js +84 -6
- package/dist/components/form/engine/readFirst.js.map +1 -1
- package/dist/components/form/fields/Field.d.ts.map +1 -1
- package/dist/components/form/fields/Field.js +1 -1
- package/dist/components/form/fields/Field.js.map +1 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.d.ts +12 -2
- package/dist/components/form/fields/allowed-values/AllowedValues.d.ts.map +1 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.js +16 -6
- package/dist/components/form/fields/allowed-values/AllowedValues.js.map +1 -1
- package/dist/components/form/fields/auto/AutoFormField.d.ts.map +1 -1
- package/dist/components/form/fields/auto/AutoFormField.js +64 -14
- package/dist/components/form/fields/auto/AutoFormField.js.map +1 -1
- package/dist/components/form/fields/long-string/LongString.d.ts +9 -1
- package/dist/components/form/fields/long-string/LongString.d.ts.map +1 -1
- package/dist/components/form/fields/long-string/LongString.js +25 -4
- package/dist/components/form/fields/long-string/LongString.js.map +1 -1
- package/dist/components/form/fields/template/ExampleValueModal.d.ts +29 -0
- package/dist/components/form/fields/template/ExampleValueModal.d.ts.map +1 -0
- package/dist/components/form/fields/template/ExampleValueModal.js +122 -0
- package/dist/components/form/fields/template/ExampleValueModal.js.map +1 -0
- package/dist/components/form/fields/template/ReadOnlyTemplateTag.d.ts.map +1 -1
- package/dist/components/form/fields/template/ReadOnlyTemplateTag.js +3 -3
- package/dist/components/form/fields/template/ReadOnlyTemplateTag.js.map +1 -1
- package/dist/components/form/fields/template/TemplateField.d.ts.map +1 -1
- package/dist/components/form/fields/template/TemplateField.js +81 -27
- package/dist/components/form/fields/template/TemplateField.js.map +1 -1
- package/dist/components/form/fields/template/__fixtures__/longExampleValue.d.ts +2 -0
- package/dist/components/form/fields/template/__fixtures__/longExampleValue.d.ts.map +1 -0
- package/dist/components/form/fields/template/__fixtures__/longExampleValue.js +9 -0
- package/dist/components/form/fields/template/__fixtures__/longExampleValue.js.map +1 -0
- package/dist/components/form/index.d.ts +1 -0
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/index.js +1 -0
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/searchFilterBar/SearchFilterBar.d.ts +12 -1
- package/dist/components/searchFilterBar/SearchFilterBar.d.ts.map +1 -1
- package/dist/components/searchFilterBar/SearchFilterBar.js +2 -2
- package/dist/components/searchFilterBar/SearchFilterBar.js.map +1 -1
- package/dist/components/ticketThread/TicketThread.d.ts.map +1 -1
- package/dist/components/ticketThread/TicketThread.js +1 -1
- package/dist/components/ticketThread/TicketThread.js.map +1 -1
- package/dist/helpers/common.d.ts +8 -1
- package/dist/helpers/common.d.ts.map +1 -1
- package/dist/helpers/common.js +9 -1
- package/dist/helpers/common.js.map +1 -1
- package/dist/helpers/expressions.d.ts.map +1 -1
- package/dist/helpers/expressions.js +15 -2
- package/dist/helpers/expressions.js.map +1 -1
- package/dist/helpers/optionUiTypes.d.ts +30 -0
- package/dist/helpers/optionUiTypes.d.ts.map +1 -0
- package/dist/helpers/optionUiTypes.js +156 -0
- package/dist/helpers/optionUiTypes.js.map +1 -0
- package/dist/helpers/options.d.ts +19 -0
- package/dist/helpers/options.d.ts.map +1 -1
- package/dist/helpers/options.js +25 -1
- package/dist/helpers/options.js.map +1 -1
- package/dist/helpers/providerValue.d.ts +68 -0
- package/dist/helpers/providerValue.d.ts.map +1 -0
- package/dist/helpers/providerValue.js +50 -0
- package/dist/helpers/providerValue.js.map +1 -0
- package/dist/helpers/singleLineString.d.ts +37 -0
- package/dist/helpers/singleLineString.d.ts.map +1 -0
- package/dist/helpers/singleLineString.js +66 -0
- package/dist/helpers/singleLineString.js.map +1 -0
- package/dist/helpers/templates.d.ts +100 -0
- package/dist/helpers/templates.d.ts.map +1 -1
- package/dist/helpers/templates.js +237 -4
- package/dist/helpers/templates.js.map +1 -1
- package/dist/helpers/validations.d.ts +103 -2
- package/dist/helpers/validations.d.ts.map +1 -1
- package/dist/helpers/validations.js +858 -91
- package/dist/helpers/validations.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/composer/Composer.tsx +7 -3
- package/src/components/form/engine/CompactRow.tsx +279 -33
- package/src/components/form/engine/CompactToolbar.tsx +105 -98
- package/src/components/form/engine/FormEngine.stories.tsx +995 -12
- package/src/components/form/engine/FormEngine.tsx +377 -94
- package/src/components/form/engine/_structuredData/SchemaDataView.stories.tsx +104 -0
- package/src/components/form/engine/_structuredData/SchemaDataView.tsx +158 -101
- package/src/components/form/engine/_structuredData/structuredData.ts +20 -0
- package/src/components/form/engine/compactRowStyles.ts +55 -1
- package/src/components/form/engine/compactToolbarContext.ts +8 -0
- package/src/components/form/engine/readFirst.ts +125 -35
- package/src/components/form/fields/Field.tsx +3 -1
- package/src/components/form/fields/allowed-values/AllowedValues.tsx +24 -2
- package/src/components/form/fields/array/ArrayAutoField.stories.tsx +81 -0
- package/src/components/form/fields/auto/AutoFormField.stories.tsx +47 -1
- package/src/components/form/fields/auto/AutoFormField.tsx +73 -11
- package/src/components/form/fields/long-string/LongString.tsx +46 -5
- package/src/components/form/fields/schema-definition/SchemaDefinitionField.stories.tsx +5 -0
- package/src/components/form/fields/template/ExampleValueModal.stories.tsx +114 -0
- package/src/components/form/fields/template/ExampleValueModal.tsx +99 -0
- package/src/components/form/fields/template/ReadOnlyTemplateTag.tsx +8 -4
- package/src/components/form/fields/template/TemplateField.stories.tsx +389 -1
- package/src/components/form/fields/template/TemplateField.tsx +100 -35
- package/src/components/form/fields/template/__fixtures__/longExampleValue.ts +7 -0
- package/src/components/form/index.tsx +1 -0
- package/src/components/searchFilterBar/SearchFilterBar.stories.tsx +62 -0
- package/src/components/searchFilterBar/SearchFilterBar.tsx +13 -0
- package/src/components/ticketThread/TicketThread.tsx +7 -0
- package/src/helpers/common.ts +11 -1
- package/src/helpers/expressions.ts +16 -2
- package/src/helpers/optionUiTypes.ts +161 -0
- package/src/helpers/options.ts +23 -0
- package/src/helpers/providerValue.ts +125 -0
- package/src/helpers/singleLineString.ts +61 -0
- package/src/helpers/templates.ts +272 -3
- package/src/helpers/validations.ts +1177 -109
- package/src/hooks/useWebSocket/useWebsocket.stories.tsx +23 -2
- package/src/index.tsx +1 -0
|
@@ -202,7 +202,7 @@ var StyledCommitDock = styled_components_1.default.div(templateObject_2 || (temp
|
|
|
202
202
|
return "".concat((0, colors_1.changeDarkness)($bg, 0.4)).concat((0, colors_1.percentToHexAlpha)(55));
|
|
203
203
|
});
|
|
204
204
|
var getType = function (type, operators, operator) {
|
|
205
|
-
var finalType = getTypeFromOperator(operators, (0,
|
|
205
|
+
var finalType = getTypeFromOperator(operators, (0, common_1.fixOperatorValue)(operator)) || type;
|
|
206
206
|
var resolvedType = (0, isArray_1.default)(finalType) ? finalType[0] : finalType;
|
|
207
207
|
// A value can be received before its server-driven option schema. Keep the
|
|
208
208
|
// renderer type-safe during that transition without guessing a concrete type.
|
|
@@ -216,23 +216,22 @@ var getTypeFromOperator = function (operators, operatorData) {
|
|
|
216
216
|
}
|
|
217
217
|
return ((_a = operators[(0, lodash_1.last)(operatorData)]) === null || _a === void 0 ? void 0 : _a.type) || null;
|
|
218
218
|
};
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
219
|
+
/** Re-exported from `helpers/common` so existing importers keep working; it
|
|
220
|
+
* lives there because `helpers/validations` needs it and cannot import this
|
|
221
|
+
* module (this module imports the validators). */
|
|
222
|
+
var common_2 = require("../../../helpers/common");
|
|
223
|
+
Object.defineProperty(exports, "fixOperatorValue", { enumerable: true, get: function () { return common_2.fixOperatorValue; } });
|
|
223
224
|
var getOptionSchemaStorageType = function (option, isRendererOnly) {
|
|
224
225
|
if (isRendererOnly === void 0) { isRendererOnly = rendererTypes_1.isRendererOnlyUiType; }
|
|
225
|
-
return (((0, readFirst_1.isFixedCompactAllowedValueOption)(option)
|
|
226
|
-
? (option === null || option === void 0 ? void 0 : option.type) || (option === null || option === void 0 ? void 0 : option.ui_type)
|
|
227
|
-
: isRendererOnly(option === null || option === void 0 ? void 0 : option.ui_type)
|
|
228
|
-
? (option === null || option === void 0 ? void 0 : option.type) || (option === null || option === void 0 ? void 0 : option.ui_type)
|
|
226
|
+
return (((0, readFirst_1.isFixedCompactAllowedValueOption)(option) ? (option === null || option === void 0 ? void 0 : option.type) || (option === null || option === void 0 ? void 0 : option.ui_type)
|
|
227
|
+
: isRendererOnly(option === null || option === void 0 ? void 0 : option.ui_type) ? (option === null || option === void 0 ? void 0 : option.type) || (option === null || option === void 0 ? void 0 : option.ui_type)
|
|
229
228
|
: (option === null || option === void 0 ? void 0 : option.ui_type) || (option === null || option === void 0 ? void 0 : option.type)) || 'any');
|
|
230
229
|
};
|
|
231
230
|
var getOptionFieldStorageType = function (optionName, fieldType, schema, operators, operatorData, isRendererOnly) {
|
|
232
231
|
if (isRendererOnly === void 0) { isRendererOnly = rendererTypes_1.isRendererOnlyUiType; }
|
|
233
232
|
var schemaOption = schema === null || schema === void 0 ? void 0 : schema[optionName];
|
|
234
|
-
var storedType = fieldType && !(fieldType === (schemaOption === null || schemaOption === void 0 ? void 0 : schemaOption.ui_type) && isRendererOnly(fieldType))
|
|
235
|
-
|
|
233
|
+
var storedType = fieldType && !(fieldType === (schemaOption === null || schemaOption === void 0 ? void 0 : schemaOption.ui_type) && isRendererOnly(fieldType)) ?
|
|
234
|
+
fieldType
|
|
236
235
|
: getOptionSchemaStorageType(schemaOption, isRendererOnly);
|
|
237
236
|
return (0, exports.getType)(storedType, operators, operatorData);
|
|
238
237
|
};
|
|
@@ -253,7 +252,7 @@ var fixOptions = function (value, options, operators, isRendererOnly) {
|
|
|
253
252
|
return fixedValue;
|
|
254
253
|
}
|
|
255
254
|
(0, lodash_1.forEach)(options, function (option, name) {
|
|
256
|
-
var _a, _b, _c, _d, _f, _g, _h;
|
|
255
|
+
var _a, _b, _c, _d, _f, _g, _h, _j;
|
|
257
256
|
if (option.value ||
|
|
258
257
|
option.required_groups ||
|
|
259
258
|
((option.required || option.preselected) && !fixedValue[name]) ||
|
|
@@ -264,14 +263,30 @@ var fixOptions = function (value, options, operators, isRendererOnly) {
|
|
|
264
263
|
((_c = fixedValue[name]) === null || _c === void 0 ? void 0 : _c.value) === undefined) {
|
|
265
264
|
obj = option.default_value;
|
|
266
265
|
}
|
|
266
|
+
else if (option.default_view === 'expression' &&
|
|
267
|
+
((_d = fixedValue[name]) === null || _d === void 0 ? void 0 : _d.value) === undefined) {
|
|
268
|
+
// A field the schema declares as opening in expression mode starts as an
|
|
269
|
+
// EMPTY expression, not as its raw default. `isDefaultFunction` already
|
|
270
|
+
// makes the renderer open that way, so without this the data disagreed
|
|
271
|
+
// with what the operator was looking at: an expression editor whose
|
|
272
|
+
// value was still the plain default, and no `is_expression` on the field
|
|
273
|
+
// until the first edit.
|
|
274
|
+
obj = {
|
|
275
|
+
type: type,
|
|
276
|
+
value: {
|
|
277
|
+
args: [],
|
|
278
|
+
},
|
|
279
|
+
is_expression: true,
|
|
280
|
+
};
|
|
281
|
+
}
|
|
267
282
|
else {
|
|
268
283
|
obj = {
|
|
269
284
|
type: type,
|
|
270
|
-
value: (
|
|
271
|
-
(
|
|
272
|
-
: fixedValue[name])) !== null &&
|
|
285
|
+
value: (_h = (_g = (typeof fixedValue[name] === 'object' ?
|
|
286
|
+
(_f = fixedValue[name]) === null || _f === void 0 ? void 0 : _f.value
|
|
287
|
+
: fixedValue[name])) !== null && _g !== void 0 ? _g : option.value) !== null && _h !== void 0 ? _h : (0, common_1.getDefaultValue)(option),
|
|
273
288
|
};
|
|
274
|
-
if ((
|
|
289
|
+
if ((_j = fixedValue[name]) === null || _j === void 0 ? void 0 : _j.is_expression) {
|
|
275
290
|
obj.is_expression = true;
|
|
276
291
|
}
|
|
277
292
|
}
|
|
@@ -280,7 +295,7 @@ var fixOptions = function (value, options, operators, isRendererOnly) {
|
|
|
280
295
|
});
|
|
281
296
|
var res = (0, reduce_1.default)(fixedValue, function (newValue, option, optionName) {
|
|
282
297
|
var _a;
|
|
283
|
-
var _b, _c, _d, _f, _g, _h;
|
|
298
|
+
var _b, _c, _d, _f, _g, _h, _j;
|
|
284
299
|
var newOption = option;
|
|
285
300
|
if (!(0, lodash_1.isPlainObject)(newOption) || !(newOption === null || newOption === void 0 ? void 0 : newOption.type)) {
|
|
286
301
|
var isUntypedEnvelope = (0, lodash_1.isPlainObject)(newOption) && 'value' in newOption;
|
|
@@ -303,17 +318,27 @@ var fixOptions = function (value, options, operators, isRendererOnly) {
|
|
|
303
318
|
// every value declared the bare way: the collapsed row still showed its
|
|
304
319
|
// display name while the editor showed "—" and the value never reached
|
|
305
320
|
// the submitted data.
|
|
321
|
+
// `allowed_values: []` is NOT "no value is permitted" — it is the server
|
|
322
|
+
// saying it has no reference values to offer right now (the app-action
|
|
323
|
+
// catalogue ships exactly that, with an
|
|
324
|
+
// `option_reference_values_unavailable` message attached). An empty array
|
|
325
|
+
// is truthy, so testing the array itself made every such option erase the
|
|
326
|
+
// operator's stored value on the first render, before the
|
|
327
|
+
// connection-refreshed schema arrived to say otherwise — and the emptied
|
|
328
|
+
// form then autosaved over the draft, so the value was gone for good.
|
|
329
|
+
// Only an option that actually declares choices can have a value that is
|
|
330
|
+
// not one of them.
|
|
306
331
|
if (newOption.value !== undefined &&
|
|
307
|
-
((_c = options === null || options === void 0 ? void 0 : options[optionName]) === null || _c === void 0 ? void 0 : _c.allowed_values) &&
|
|
332
|
+
((_d = (_c = options === null || options === void 0 ? void 0 : options[optionName]) === null || _c === void 0 ? void 0 : _c.allowed_values) === null || _d === void 0 ? void 0 : _d.length) &&
|
|
308
333
|
!(0, readFirst_1.findAllowedValueOption)(newOption.value, options === null || options === void 0 ? void 0 : options[optionName]) &&
|
|
309
334
|
!(0, TemplateField_1.isValueTemplate)(newOption.value) &&
|
|
310
|
-
!((
|
|
311
|
-
!((
|
|
335
|
+
!((_f = options === null || options === void 0 ? void 0 : options[optionName]) === null || _f === void 0 ? void 0 : _f.multiselect) &&
|
|
336
|
+
!((_g = options === null || options === void 0 ? void 0 : options[optionName]) === null || _g === void 0 ? void 0 : _g.allowed_values_creatable)) {
|
|
312
337
|
newOption.value = undefined;
|
|
313
338
|
}
|
|
314
339
|
if (newOption.value &&
|
|
315
|
-
((
|
|
316
|
-
((
|
|
340
|
+
((_h = options === null || options === void 0 ? void 0 : options[optionName]) === null || _h === void 0 ? void 0 : _h.readonly) &&
|
|
341
|
+
((_j = options === null || options === void 0 ? void 0 : options[optionName]) === null || _j === void 0 ? void 0 : _j.default_value) &&
|
|
317
342
|
(0, common_1.getDefaultValue)(options === null || options === void 0 ? void 0 : options[optionName]) !== newOption.value) {
|
|
318
343
|
newOption.value = (0, common_1.getDefaultValue)(options[optionName]);
|
|
319
344
|
}
|
|
@@ -372,12 +397,12 @@ var FormEngineImpl = function (_a) {
|
|
|
372
397
|
var _b, _c, _d, _f, _g, _h;
|
|
373
398
|
var name = _a.name, uniqueName = _a.uniqueName, value = _a.value, onChange = _a.onChange, onSingleOptionsChange = _a.onSingleOptionsChange, onDependableOptionChange = _a.onDependableOptionChange, placeholder = _a.placeholder, noValueString = _a.noValueString, // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
374
399
|
isValid = _a.isValid, // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
375
|
-
url = _a.url, customUrl = _a.customUrl, operatorsUrl = _a.operatorsUrl, onOptionsLoaded = _a.onOptionsLoaded, recordRequiresSearchOptions = _a.recordRequiresSearchOptions, readOnly = _a.readOnly, _j = _a.allowTemplates, allowTemplates = _j === void 0 ? true : _j, interfaceContext = _a.interfaceContext, templateFieldProps = _a.templateFieldProps, forceDropdown = _a.forceDropdown, _k = _a.showTypeToggle, showTypeToggle = _k === void 0 ? true : _k, compact = _a.compact, _l = _a.compactFlush, compactFlush = _l === void 0 ? false : _l, _m = _a.compactNested, compactNested = _m === void 0 ? false : _m, compactPanelProps = _a.compactPanelProps, _o = _a.
|
|
400
|
+
url = _a.url, customUrl = _a.customUrl, operatorsUrl = _a.operatorsUrl, onOptionsLoaded = _a.onOptionsLoaded, recordRequiresSearchOptions = _a.recordRequiresSearchOptions, readOnly = _a.readOnly, _j = _a.allowTemplates, allowTemplates = _j === void 0 ? true : _j, interfaceContext = _a.interfaceContext, templateFieldProps = _a.templateFieldProps, forceDropdown = _a.forceDropdown, _k = _a.showTypeToggle, showTypeToggle = _k === void 0 ? true : _k, compact = _a.compact, _l = _a.compactFlush, compactFlush = _l === void 0 ? false : _l, _m = _a.compactNested, compactNested = _m === void 0 ? false : _m, compactPanelProps = _a.compactPanelProps, _o = _a.compactCollapsedGroups, compactCollapsedGroups = _o === void 0 ? ['optional'] : _o, _p = _a.compactToolbar, compactToolbar = _p === void 0 ? true : _p, _q = _a.commitMode, commitMode = _q === void 0 ? 'immediate' : _q, _r = _a.expandMode, expandMode = _r === void 0 ? 'single' : _r, onCommit = _a.onCommit, operatorsProp = _a.operators, groups = _a.groups, optionsLoader = _a.optionsLoader, onValidityChange = _a.onValidityChange, optionActions = _a.optionActions, _s = _a.optionActionsCollapse, optionActionsCollapse = _s === void 0 ? 'auto' : _s, componentOverrides = _a.componentOverrides, codePreviewRenderer = _a.codePreviewRenderer,
|
|
376
401
|
// consumed by the wrapper below, which publishes it to every description this
|
|
377
402
|
// form draws; destructured here only so it cannot reach `rest` and be spread
|
|
378
403
|
// onto a DOM node
|
|
379
404
|
_markdownRenderer = _a.markdownRenderer, // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
380
|
-
rendererOnlyUiTypes = _a.rendererOnlyUiTypes, inheritedFromParent = _a.inheritedFromParent, autoFocusFirstRequired = _a.autoFocusFirstRequired, expandFirstRequired = _a.expandFirstRequired, initialExpandedOptions = _a.initialExpandedOptions, rest = __rest(_a, ["name", "uniqueName", "value", "onChange", "onSingleOptionsChange", "onDependableOptionChange", "placeholder", "noValueString", "isValid", "url", "customUrl", "operatorsUrl", "onOptionsLoaded", "recordRequiresSearchOptions", "readOnly", "allowTemplates", "interfaceContext", "templateFieldProps", "forceDropdown", "showTypeToggle", "compact", "compactFlush", "compactNested", "compactPanelProps", "commitMode", "expandMode", "onCommit", "operators", "groups", "optionsLoader", "onValidityChange", "optionActions", "optionActionsCollapse", "componentOverrides", "codePreviewRenderer", "markdownRenderer", "rendererOnlyUiTypes", "inheritedFromParent", "autoFocusFirstRequired", "expandFirstRequired", "initialExpandedOptions"]);
|
|
405
|
+
rendererOnlyUiTypes = _a.rendererOnlyUiTypes, inheritedFromParent = _a.inheritedFromParent, autoFocusFirstRequired = _a.autoFocusFirstRequired, expandFirstRequired = _a.expandFirstRequired, initialExpandedOptions = _a.initialExpandedOptions, maxFieldsShown = _a.maxFieldsShown, rest = __rest(_a, ["name", "uniqueName", "value", "onChange", "onSingleOptionsChange", "onDependableOptionChange", "placeholder", "noValueString", "isValid", "url", "customUrl", "operatorsUrl", "onOptionsLoaded", "recordRequiresSearchOptions", "readOnly", "allowTemplates", "interfaceContext", "templateFieldProps", "forceDropdown", "showTypeToggle", "compact", "compactFlush", "compactNested", "compactPanelProps", "compactCollapsedGroups", "compactToolbar", "commitMode", "expandMode", "onCommit", "operators", "groups", "optionsLoader", "onValidityChange", "optionActions", "optionActionsCollapse", "componentOverrides", "codePreviewRenderer", "markdownRenderer", "rendererOnlyUiTypes", "inheritedFromParent", "autoFocusFirstRequired", "expandFirstRequired", "initialExpandedOptions", "maxFieldsShown"]);
|
|
381
406
|
// Built-ins + whatever the consumer declared for its own injected editors.
|
|
382
407
|
var isRendererOnly = (0, react_2.useMemo)(function () { return (0, rendererTypes_1.createRendererOnlyUiTypeCheck)(rendererOnlyUiTypes); }, [JSON.stringify(rendererOnlyUiTypes)]);
|
|
383
408
|
// Pointer CAPABILITY and viewport WIDTH are different questions and both
|
|
@@ -395,30 +420,33 @@ var FormEngineImpl = function (_a) {
|
|
|
395
420
|
var collapseOptionActions = optionActionsCollapse === 'always' ? true
|
|
396
421
|
: optionActionsCollapse === 'never' ? false
|
|
397
422
|
: !isHoverCapable || !!isMobile;
|
|
398
|
-
var
|
|
423
|
+
var _t = (0, react_2.useState)((rest === null || rest === void 0 ? void 0 : rest.options) || undefined), options = _t[0], setOptions = _t[1];
|
|
399
424
|
// optionsLoader lifecycle: loading feeds the skeleton gate, error the banner.
|
|
400
|
-
var
|
|
401
|
-
var
|
|
425
|
+
var _u = (0, react_2.useState)(!!optionsLoader && !(rest === null || rest === void 0 ? void 0 : rest.options)), optionsLoading = _u[0], setOptionsLoading = _u[1];
|
|
426
|
+
var _v = (0, react_2.useState)(), optionsError = _v[0], setOptionsError = _v[1];
|
|
402
427
|
// Operators: prop-provided (compact) or fetched via operatorsUrl (dpql,
|
|
403
428
|
// ported from IDE Options) — the fetch overrides the seeded prop value.
|
|
404
|
-
var
|
|
429
|
+
var _w = (0, react_2.useState)(operatorsProp), operators = _w[0], setOperators = _w[1];
|
|
405
430
|
// Remote-fetch loading (ported from IDE Options); only relevant when one of
|
|
406
431
|
// the fetch urls is set — schema-as-props consumers never see the skeleton.
|
|
407
|
-
var
|
|
432
|
+
var _x = (0, react_2.useState)(!!(url || customUrl || operatorsUrl)), loading = _x[0], setLoading = _x[1];
|
|
408
433
|
var confirmAction = (0, reqore_1.useReqoreProperty)('confirmAction');
|
|
409
434
|
var theme = (0, reqore_1.useReqoreTheme)();
|
|
410
|
-
var
|
|
411
|
-
var
|
|
435
|
+
var _y = (0, react_2.useState)(), focusedEditing = _y[0], setFocusedEditing = _y[1];
|
|
436
|
+
var _z = (0, react_2.useState)(false), showFieldTypes = _z[0], setShowFieldTypes = _z[1];
|
|
412
437
|
// Global toggle (toolbar ⓘ): reveal the short-description info panel on every
|
|
413
438
|
// field that has a short_desc. Per-row ⓘ overrides still win over it.
|
|
414
439
|
// Global field-info visibility, tri-state: `undefined` = default (critical
|
|
415
440
|
// messages auto-open, the rest closed); `true` = show all; `false` = hide all
|
|
416
441
|
// (even message fields). The toolbar ⓘ drives it.
|
|
417
|
-
var
|
|
418
|
-
var
|
|
419
|
-
var
|
|
442
|
+
var _0 = (0, react_2.useState)(undefined), showAllDescriptions = _0[0], setShowAllDescriptions = _0[1];
|
|
443
|
+
var _1 = (0, react_2.useState)(), showHelpForOption = _1[0], setShowHelpForOption = _1[1];
|
|
444
|
+
var _2 = (0, react_2.useState)(false), showInvalidOptionsOnly = _2[0], setShowInvalidOptionsOnly = _2[1];
|
|
420
445
|
// Which options are expanded into their editor (several can be open at once).
|
|
421
|
-
var
|
|
446
|
+
var _3 = (0, react_2.useState)([]), expandedOptions = _3[0], setExpandedOptions = _3[1];
|
|
447
|
+
/** Status boxes whose "N more fields" control the reader has opened. Keyed by
|
|
448
|
+
box so opening Optional does not also unfold Set. */
|
|
449
|
+
var _4 = (0, react_2.useState)([]), expandedMoreBoxes = _4[0], setExpandedMoreBoxes = _4[1];
|
|
422
450
|
// --- Reveal a status box's content when it is opened ----------------------
|
|
423
451
|
//
|
|
424
452
|
// The status boxes stack, so the last one ("Optional", which holds every
|
|
@@ -434,7 +462,7 @@ var FormEngineImpl = function (_a) {
|
|
|
434
462
|
// box has not grown and there is nothing to scroll to. A layout effect runs
|
|
435
463
|
// after the DOM is updated and before paint, which makes the reveal
|
|
436
464
|
// deterministic instead of a guessed delay.
|
|
437
|
-
var
|
|
465
|
+
var _5 = (0, react_2.useState)(undefined), openedStatusBox = _5[0], setOpenedStatusBox = _5[1];
|
|
438
466
|
var statusBoxRefs = (0, react_2.useRef)({});
|
|
439
467
|
(0, react_2.useLayoutEffect)(function () {
|
|
440
468
|
var _a, _b;
|
|
@@ -465,13 +493,13 @@ var FormEngineImpl = function (_a) {
|
|
|
465
493
|
var settledBucket = (0, react_2.useRef)({});
|
|
466
494
|
// Measured form width (not viewport — the form lives in drawers/panels of
|
|
467
495
|
// arbitrary width) drives the stacked narrow layout.
|
|
468
|
-
var
|
|
496
|
+
var _6 = (0, react_use_1.useMeasure)(), compactWrapRef = _6[0], compactWrapWidth = _6[1].width;
|
|
469
497
|
// Own handle on the scroll wrap (useMeasure's ref is a callback, no `.current`)
|
|
470
498
|
// so the label-column measurement can publish its CSS var on the element. It's
|
|
471
499
|
// STATE, not a ref: the wrap mounts only after the loading-skeleton gate
|
|
472
500
|
// resolves, so the measurement effect must re-run when the node appears — a
|
|
473
501
|
// ref wouldn't retrigger it.
|
|
474
|
-
var
|
|
502
|
+
var _7 = (0, react_2.useState)(null), compactWrapNode = _7[0], setCompactWrapNode = _7[1];
|
|
475
503
|
// Ref mirror of the wrap node for callbacks that must not re-create when it
|
|
476
504
|
// mounts (flashOptions reads it inside a rAF).
|
|
477
505
|
var compactWrapNodeRef = (0, react_2.useRef)(null);
|
|
@@ -525,8 +553,8 @@ var FormEngineImpl = function (_a) {
|
|
|
525
553
|
var readRowHeights = (0, react_2.useRef)({});
|
|
526
554
|
// Required-groups linkage: hovering a group chip highlights every member row;
|
|
527
555
|
// clicking a sibling in the chip's popover scrolls to it and flashes it.
|
|
528
|
-
var
|
|
529
|
-
var
|
|
556
|
+
var _8 = (0, react_2.useState)([]), highlightedOptions = _8[0], setHighlightedOptions = _8[1];
|
|
557
|
+
var _9 = (0, react_2.useState)([]), flashedOptions = _9[0], setFlashedOptions = _9[1];
|
|
530
558
|
var flashTimeout = (0, react_2.useRef)();
|
|
531
559
|
var flashOptions = (0, react_2.useCallback)(function (optionNames, scrollToFirst) {
|
|
532
560
|
if (scrollToFirst === void 0) { scrollToFirst = false; }
|
|
@@ -575,16 +603,16 @@ var FormEngineImpl = function (_a) {
|
|
|
575
603
|
});
|
|
576
604
|
var compactNarrow = !!compactWrapWidth && compactWrapWidth < 480;
|
|
577
605
|
// Info panels auto-open on Tier-1 content; the per-row user override sticks.
|
|
578
|
-
var
|
|
606
|
+
var _10 = (0, react_2.useState)({}), infoPanelOverrides = _10[0], setInfoPanelOverrides = _10[1];
|
|
579
607
|
// Toolbar filters affect the listed rows only — the meter reflects the full set.
|
|
580
|
-
var
|
|
581
|
-
var
|
|
608
|
+
var _11 = (0, react_2.useState)(false), requiredOnly = _11[0], setRequiredOnly = _11[1];
|
|
609
|
+
var _12 = (0, react_2.useState)(''), compactQuery = _12[0], setCompactQuery = _12[1];
|
|
582
610
|
// Compact field sort (Fields menu → "Sort by"); 'schema' = declared order.
|
|
583
|
-
var
|
|
584
|
-
var
|
|
611
|
+
var _13 = (0, react_2.useState)('schema'), compactSort = _13[0], setCompactSort = _13[1];
|
|
612
|
+
var _14 = (0, react_2.useState)(function () { return ({
|
|
585
613
|
fields: (0, exports.fixOptions)(value, options || {}, undefined, isRendererOnly),
|
|
586
614
|
meta: undefined,
|
|
587
|
-
}); }), localValue =
|
|
615
|
+
}); }), localValue = _14[0], setLocalValue = _14[1];
|
|
588
616
|
var originalValue = (0, react_2.useRef)();
|
|
589
617
|
// Track the last value we emitted via onChange so we can skip re-applying fixOptions
|
|
590
618
|
// when the parent echoes it back as the new value prop (controlled component loop prevention)
|
|
@@ -593,7 +621,7 @@ var FormEngineImpl = function (_a) {
|
|
|
593
621
|
originalValue.current = localValue.fields;
|
|
594
622
|
}
|
|
595
623
|
var unavailableOptionsCount = (0, react_2.useRef)(0);
|
|
596
|
-
var
|
|
624
|
+
var _15 = (0, useQorusTypes_1.useQorusTypes)(), compactValue = _15.compactValue, typesLoading = _15.loading;
|
|
597
625
|
var templates = (0, useTemplates_1.useTemplates)(allowTemplates, rest.stringTemplates, interfaceContext);
|
|
598
626
|
(0, react_2.useEffect)(function () {
|
|
599
627
|
if ((0, lodash_1.isEqual)(localValue.fields, value)) {
|
|
@@ -667,7 +695,10 @@ var FormEngineImpl = function (_a) {
|
|
|
667
695
|
setOptions({});
|
|
668
696
|
return [2 /*return*/];
|
|
669
697
|
}
|
|
670
|
-
setLocalValue({
|
|
698
|
+
setLocalValue({
|
|
699
|
+
fields: (0, exports.fixOptions)(value, data.data, undefined, isRendererOnly),
|
|
700
|
+
meta: undefined,
|
|
701
|
+
});
|
|
671
702
|
if (!operatorsUrl) {
|
|
672
703
|
setLoading(false);
|
|
673
704
|
}
|
|
@@ -726,7 +757,10 @@ var FormEngineImpl = function (_a) {
|
|
|
726
757
|
}
|
|
727
758
|
setOptions(data.data);
|
|
728
759
|
onOptionsLoaded === null || onOptionsLoaded === void 0 ? void 0 : onOptionsLoaded(data.data);
|
|
729
|
-
setLocalValue({
|
|
760
|
+
setLocalValue({
|
|
761
|
+
fields: (0, exports.fixOptions)({}, data.data, undefined, isRendererOnly),
|
|
762
|
+
meta: undefined,
|
|
763
|
+
});
|
|
730
764
|
return [2 /*return*/];
|
|
731
765
|
}
|
|
732
766
|
});
|
|
@@ -787,11 +821,11 @@ var FormEngineImpl = function (_a) {
|
|
|
787
821
|
var schemaType = getOptionSchemaStorageType(options === null || options === void 0 ? void 0 : options[optionName], isRendererOnly);
|
|
788
822
|
var isAnyLike = schemaType === 'any' || schemaType === 'auto';
|
|
789
823
|
// For any/auto schema types, preserve the user's chosen type stored in the field
|
|
790
|
-
var resolvedSchemaType = isAnyLike && ((_d = fields[optionName]) === null || _d === void 0 ? void 0 : _d.type)
|
|
791
|
-
|
|
792
|
-
: ((_f = fields[optionName]) === null || _f === void 0 ? void 0 : _f.type) === ((_g = options === null || options === void 0 ? void 0 : options[optionName]) === null || _g === void 0 ? void 0 : _g.ui_type) &&
|
|
793
|
-
isRendererOnly((_h = fields[optionName]) === null || _h === void 0 ? void 0 : _h.type)
|
|
794
|
-
|
|
824
|
+
var resolvedSchemaType = isAnyLike && ((_d = fields[optionName]) === null || _d === void 0 ? void 0 : _d.type) ?
|
|
825
|
+
fields[optionName].type
|
|
826
|
+
: (((_f = fields[optionName]) === null || _f === void 0 ? void 0 : _f.type) === ((_g = options === null || options === void 0 ? void 0 : options[optionName]) === null || _g === void 0 ? void 0 : _g.ui_type) &&
|
|
827
|
+
isRendererOnly((_h = fields[optionName]) === null || _h === void 0 ? void 0 : _h.type)) ?
|
|
828
|
+
schemaType
|
|
795
829
|
: schemaType || ((_j = fields[optionName]) === null || _j === void 0 ? void 0 : _j.type);
|
|
796
830
|
var type = _type ||
|
|
797
831
|
(0, exports.getTypeAndCanBeNull)(resolvedSchemaType, (_k = options === null || options === void 0 ? void 0 : options[optionName]) === null || _k === void 0 ? void 0 : _k.allowed_values).type;
|
|
@@ -839,9 +873,7 @@ var FormEngineImpl = function (_a) {
|
|
|
839
873
|
meta.events = (_p = options === null || options === void 0 ? void 0 : options[optionName]) === null || _p === void 0 ? void 0 : _p.on_change;
|
|
840
874
|
}
|
|
841
875
|
onSingleOptionsChange === null || onSingleOptionsChange === void 0 ? void 0 : onSingleOptionsChange(optionName, updatedValue[optionName]);
|
|
842
|
-
if (compact &&
|
|
843
|
-
!readOnly &&
|
|
844
|
-
(0, readFirst_1.shouldAutoCollapseCompactOption)(options === null || options === void 0 ? void 0 : options[optionName], val)) {
|
|
876
|
+
if (compact && !readOnly && (0, readFirst_1.shouldAutoCollapseCompactOption)(options === null || options === void 0 ? void 0 : options[optionName], val)) {
|
|
845
877
|
setExpandedOptions(function (prev) { return prev.filter(function (name) { return name !== optionName; }); });
|
|
846
878
|
}
|
|
847
879
|
return {
|
|
@@ -861,7 +893,7 @@ var FormEngineImpl = function (_a) {
|
|
|
861
893
|
var handleOperatorChange = (0, react_2.useCallback)(function (optionName, currentValue, operator, index) {
|
|
862
894
|
var _a;
|
|
863
895
|
setLocalValue === null || setLocalValue === void 0 ? void 0 : setLocalValue({
|
|
864
|
-
fields: __assign(__assign({}, currentValue), (_a = {}, _a[optionName] = __assign(__assign({}, currentValue[optionName]), { op: (0,
|
|
896
|
+
fields: __assign(__assign({}, currentValue), (_a = {}, _a[optionName] = __assign(__assign({}, currentValue[optionName]), { op: (0, common_1.fixOperatorValue)(currentValue[optionName].op).map(function (op, idx) {
|
|
865
897
|
if (idx === index) {
|
|
866
898
|
return operator;
|
|
867
899
|
}
|
|
@@ -873,14 +905,14 @@ var FormEngineImpl = function (_a) {
|
|
|
873
905
|
var handleAddOperator = (0, react_2.useCallback)(function (optionName, currentValue, index) {
|
|
874
906
|
var _a;
|
|
875
907
|
setLocalValue === null || setLocalValue === void 0 ? void 0 : setLocalValue({
|
|
876
|
-
fields: __assign(__assign({}, currentValue), (_a = {}, _a[optionName] = __assign(__assign({}, currentValue[optionName]), { op: (0, common_1.insertAtIndex)((0,
|
|
908
|
+
fields: __assign(__assign({}, currentValue), (_a = {}, _a[optionName] = __assign(__assign({}, currentValue[optionName]), { op: (0, common_1.insertAtIndex)((0, common_1.fixOperatorValue)(currentValue[optionName].op), index, null) }), _a)),
|
|
877
909
|
meta: undefined,
|
|
878
910
|
});
|
|
879
911
|
}, []);
|
|
880
912
|
var handleRemoveOperator = (0, react_2.useCallback)(function (optionName, currentValue, index) {
|
|
881
913
|
var _a;
|
|
882
914
|
setLocalValue === null || setLocalValue === void 0 ? void 0 : setLocalValue({
|
|
883
|
-
fields: __assign(__assign({}, currentValue), (_a = {}, _a[optionName] = __assign(__assign({}, currentValue[optionName]), { op: (0,
|
|
915
|
+
fields: __assign(__assign({}, currentValue), (_a = {}, _a[optionName] = __assign(__assign({}, currentValue[optionName]), { op: (0, common_1.fixOperatorValue)(currentValue[optionName].op).filter(function (_op, idx) { return idx !== index; }) }), _a)),
|
|
884
916
|
meta: undefined,
|
|
885
917
|
});
|
|
886
918
|
}, []);
|
|
@@ -1137,7 +1169,11 @@ var FormEngineImpl = function (_a) {
|
|
|
1137
1169
|
var schema = options === null || options === void 0 ? void 0 : options[name];
|
|
1138
1170
|
var type = getOptionFieldStorageType(name, (_a = availableOptions === null || availableOptions === void 0 ? void 0 : availableOptions[name]) === null || _a === void 0 ? void 0 : _a.type, options, operators, (_b = availableOptions === null || availableOptions === void 0 ? void 0 : availableOptions[name]) === null || _b === void 0 ? void 0 : _b.op, isRendererOnly);
|
|
1139
1171
|
var value = (_c = availableOptions === null || availableOptions === void 0 ? void 0 : availableOptions[name]) === null || _c === void 0 ? void 0 : _c.value;
|
|
1140
|
-
|
|
1172
|
+
// A schema-declared hash whose every entry is a materialised-but-unset
|
|
1173
|
+
// field holds nothing, so it is not "set" — without this the row showed a
|
|
1174
|
+
// green set-dot and counted toward the completion meter while the
|
|
1175
|
+
// sub-form it summarises said 0/3 set.
|
|
1176
|
+
var empty = (0, readFirst_1.isOptionValueEmpty)(value) || (0, readFirst_1.isUnsetSchemaHash)(value, schema);
|
|
1141
1177
|
var reqGroups = (schema === null || schema === void 0 ? void 0 : schema.required_groups) || [];
|
|
1142
1178
|
var required = !!((schema === null || schema === void 0 ? void 0 : schema.required) || reqGroups.length);
|
|
1143
1179
|
var covered = empty &&
|
|
@@ -1398,7 +1434,10 @@ var FormEngineImpl = function (_a) {
|
|
|
1398
1434
|
next[optionName] = value;
|
|
1399
1435
|
}
|
|
1400
1436
|
});
|
|
1401
|
-
return {
|
|
1437
|
+
return {
|
|
1438
|
+
fields: (0, exports.fixOptions)(next, options || {}, operators, isRendererOnly),
|
|
1439
|
+
meta: undefined,
|
|
1440
|
+
};
|
|
1402
1441
|
});
|
|
1403
1442
|
setRequiredOnly(false);
|
|
1404
1443
|
}, [JSON.stringify(options), JSON.stringify(operators), isRendererOnly]);
|
|
@@ -1420,9 +1459,9 @@ var FormEngineImpl = function (_a) {
|
|
|
1420
1459
|
// The info panel below the row keeps showing schema messages while editing —
|
|
1421
1460
|
// rendering them in the editor too would balloon a one-line edit.
|
|
1422
1461
|
suppressSchemaMessages) {
|
|
1423
|
-
var _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
1462
|
+
var _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
1424
1463
|
var type = _a.type, other = __rest(_a, ["type"]);
|
|
1425
|
-
var operatorParts = (0,
|
|
1464
|
+
var operatorParts = (0, common_1.fixOperatorValue)(other.op);
|
|
1426
1465
|
// The RENDERER type for this row — which editor mounts. Distinct from the
|
|
1427
1466
|
// storage type on the value envelope: a `richtext` field stores a string
|
|
1428
1467
|
// but must render the richtext editor, so `ui_type` wins here.
|
|
@@ -1437,10 +1476,9 @@ var FormEngineImpl = function (_a) {
|
|
|
1437
1476
|
var optionSchema = options === null || options === void 0 ? void 0 : options[optionName];
|
|
1438
1477
|
var schemaUiType = optionSchema === null || optionSchema === void 0 ? void 0 : optionSchema.ui_type;
|
|
1439
1478
|
var uiTypeIsAnyLike = schemaUiType === 'any' || schemaUiType === 'auto';
|
|
1440
|
-
var resolvedType = ((0, readFirst_1.isFixedCompactAllowedValueOption)(optionSchema)
|
|
1441
|
-
|
|
1442
|
-
: schemaUiType && !uiTypeIsAnyLike
|
|
1443
|
-
? schemaUiType
|
|
1479
|
+
var resolvedType = ((0, readFirst_1.isFixedCompactAllowedValueOption)(optionSchema) ?
|
|
1480
|
+
getOptionSchemaStorageType(optionSchema, isRendererOnly)
|
|
1481
|
+
: schemaUiType && !uiTypeIsAnyLike ? schemaUiType
|
|
1444
1482
|
: undefined) ||
|
|
1445
1483
|
type ||
|
|
1446
1484
|
schemaUiType ||
|
|
@@ -1520,8 +1558,14 @@ var FormEngineImpl = function (_a) {
|
|
|
1520
1558
|
// `[localValue, onChange]` — an inline lambda resets the pending emit
|
|
1521
1559
|
// every render and the typed value can starve.
|
|
1522
1560
|
handleValueChange, key: optionName, arg_schema: (_j = options === null || options === void 0 ? void 0 : options[optionName]) === null || _j === void 0 ? void 0 : _j.arg_schema, noSoft: !!(rest === null || rest === void 0 ? void 0 : rest.options), value: other.value, isFunction: other.is_expression, isDefaultFunction: ((_k = options === null || options === void 0 ? void 0 : options[optionName]) === null || _k === void 0 ? void 0 : _k.default_view) === 'expression', sensitive: (_l = options === null || options === void 0 ? void 0 : options[optionName]) === null || _l === void 0 ? void 0 : _l.sensitive, default_value: (0, common_1.getDefaultValue)(options === null || options === void 0 ? void 0 : options[optionName]), isDefaultTemplate: ((_m = options === null || options === void 0 ? void 0 : options[optionName]) === null || _m === void 0 ? void 0 : _m.default_view) === 'template', allowed_values: (_o = options === null || options === void 0 ? void 0 : options[optionName]) === null || _o === void 0 ? void 0 : _o.allowed_values, allowed_values_creatable: (_p = options === null || options === void 0 ? void 0 : options[optionName]) === null || _p === void 0 ? void 0 : _p.allowed_values_creatable, disabled: ((_q = options === null || options === void 0 ? void 0 : options[optionName]) === null || _q === void 0 ? void 0 : _q.disabled) ||
|
|
1561
|
+
(
|
|
1562
|
+
// a system-owned field states that as `readonly`; only the older
|
|
1563
|
+
// compat projection also sent `disabled`, so honouring only
|
|
1564
|
+
// `disabled` rendered an editable control for a value the user
|
|
1565
|
+
// cannot change (see CompactRow's `fieldReadonly`)
|
|
1566
|
+
(_r = options === null || options === void 0 ? void 0 : options[optionName]) === null || _r === void 0 ? void 0 : _r.readonly) ||
|
|
1523
1567
|
readOnly ||
|
|
1524
|
-
!(0, validations_1.hasAllDependenciesFullfilled)((
|
|
1568
|
+
!(0, validations_1.hasAllDependenciesFullfilled)((_s = options === null || options === void 0 ? void 0 : options[optionName]) === null || _s === void 0 ? void 0 : _s.depends_on, availableOptions, options || {}), readOnly: readOnly, size: editorSize || rest.size, menuItems: ((_t = options === null || options === void 0 ? void 0 : options[optionName]) === null || _t === void 0 ? void 0 : _t.ui_type) === 'any' ?
|
|
1525
1569
|
getCustomMenuTemplateItems(optionName)
|
|
1526
1570
|
: undefined }, templateFieldProps, { forceDropdown: effectiveForceDropdown })), (0, jsx_runtime_1.jsx)(OptionFieldMessages_1.OptionFieldMessages, { schema: options || {}, allOptions: availableOptions, name: optionName, option: __assign({ type: resolvedType }, other), getType: getTypeForOption }), operators && (0, size_1.default)(operators) && (0, size_1.default)(other.op) ?
|
|
1527
1571
|
(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreVerticalSpacer, { height: 5 }), (0, jsx_runtime_1.jsx)(reqore_1.ReqoreMessage, { size: 'small', children: (0, jsx_runtime_1.jsxs)(reqore_1.ReqoreTagGroup, { children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { size: 'small', labelKey: 'WHERE', label: optionName }), (0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { size: 'small', labelKey: 'IS', label: operatorParts.join(' ') }), (0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { size: 'small', intent: 'info', label: other.value ?
|
|
@@ -1572,6 +1616,9 @@ var FormEngineImpl = function (_a) {
|
|
|
1572
1616
|
var cBg = (theme === null || theme === void 0 ? void 0 : theme.main) || '#181818';
|
|
1573
1617
|
var cRowBg = (0, colors_1.changeDarkness)((0, colors_1.getMainBackgroundColor)(theme), 0.01);
|
|
1574
1618
|
var cGroupLine = "".concat(cText, "1f");
|
|
1619
|
+
// The "N more fields" row's dashed edge. Well above the divider tint: this
|
|
1620
|
+
// one is an affordance the reader has to notice, not a hairline between rows.
|
|
1621
|
+
var cMoreBorder = "".concat(cText, "4d");
|
|
1575
1622
|
// The closure surface the extracted CompactRow reads through context. Refs and
|
|
1576
1623
|
// setters are stable; the state/memo/handler fields change identity as they do
|
|
1577
1624
|
// today, so a row re-renders exactly when its inputs do.
|
|
@@ -1670,6 +1717,14 @@ var FormEngineImpl = function (_a) {
|
|
|
1670
1717
|
cInfo,
|
|
1671
1718
|
cBg,
|
|
1672
1719
|
]);
|
|
1720
|
+
// `compactToolbar` resolved to a full object, so neither the context type nor
|
|
1721
|
+
// the toolbar itself has to re-default anything. `null` means no toolbar.
|
|
1722
|
+
var compactToolbarParts = (0, react_2.useMemo)(function () {
|
|
1723
|
+
if (compactToolbar === false)
|
|
1724
|
+
return null;
|
|
1725
|
+
var all = { completion: true, search: true, fields: true, help: true };
|
|
1726
|
+
return compactToolbar === true ? all : __assign(__assign({}, all), compactToolbar);
|
|
1727
|
+
}, [JSON.stringify(compactToolbar)]);
|
|
1673
1728
|
var compactToolbarContextValue = (0, react_2.useMemo)(function () { return ({
|
|
1674
1729
|
readOnly: readOnly,
|
|
1675
1730
|
invalidCount: (0, size_1.default)(validityData.invalidFields),
|
|
@@ -1677,6 +1732,12 @@ var FormEngineImpl = function (_a) {
|
|
|
1677
1732
|
completion: readFirstCompletion,
|
|
1678
1733
|
showInvalidOnly: showInvalidOptionsOnly,
|
|
1679
1734
|
onToggleInvalidOnly: handleToggleInvalidOnly,
|
|
1735
|
+
parts: compactToolbarParts !== null && compactToolbarParts !== void 0 ? compactToolbarParts : {
|
|
1736
|
+
completion: false,
|
|
1737
|
+
search: false,
|
|
1738
|
+
fields: false,
|
|
1739
|
+
help: false,
|
|
1740
|
+
},
|
|
1680
1741
|
hasMultipleOptions: (0, size_1.default)(availableOptions) > 1,
|
|
1681
1742
|
compactQuery: compactQuery,
|
|
1682
1743
|
setCompactQuery: setCompactQuery,
|
|
@@ -1724,8 +1785,9 @@ var FormEngineImpl = function (_a) {
|
|
|
1724
1785
|
]);
|
|
1725
1786
|
// The engine's own toolbar action, plus whatever the consumer added through
|
|
1726
1787
|
// `compactPanelProps.actions` — appended, so an outside action can never
|
|
1727
|
-
// knock the form's toolbar out of the header.
|
|
1728
|
-
|
|
1788
|
+
// knock the form's toolbar out of the header. Only `compactToolbar={false}`
|
|
1789
|
+
// removes it, and then the header carries just the consumer's own actions.
|
|
1790
|
+
var compactHeaderActions = (0, react_2.useMemo)(function () { return __spreadArray(__spreadArray([], (compactToolbarParts ? [{ as: CompactToolbar_1.CompactToolbar, responsive: false }] : []), true), ((compactPanelProps === null || compactPanelProps === void 0 ? void 0 : compactPanelProps.actions) || []), true); }, [compactPanelProps === null || compactPanelProps === void 0 ? void 0 : compactPanelProps.actions, compactToolbarParts]);
|
|
1729
1791
|
var renderCompact = function () {
|
|
1730
1792
|
var headerBg = "".concat((0, colors_1.changeDarkness)((0, colors_1.getMainBackgroundColor)(theme), 0.02)).concat((0, colors_1.percentToHexAlpha)(88));
|
|
1731
1793
|
// Toolbar filters narrow the listed rows; the meter reflects the full set.
|
|
@@ -1848,7 +1910,11 @@ var FormEngineImpl = function (_a) {
|
|
|
1848
1910
|
set: {},
|
|
1849
1911
|
optional: {},
|
|
1850
1912
|
};
|
|
1851
|
-
var bucketGroups = {
|
|
1913
|
+
var bucketGroups = {
|
|
1914
|
+
attention: [],
|
|
1915
|
+
set: [],
|
|
1916
|
+
optional: [],
|
|
1917
|
+
};
|
|
1852
1918
|
// Freeze the box of any field currently being edited (or whose one-of group
|
|
1853
1919
|
// has an edited member) to its last settled box — so finishing an edit that
|
|
1854
1920
|
// flips its status doesn't remount it in another box and steal focus.
|
|
@@ -1892,6 +1958,33 @@ var FormEngineImpl = function (_a) {
|
|
|
1892
1958
|
var showGroupSubLabel = function (groupName) {
|
|
1893
1959
|
return (groupName !== 'general' && groupName !== 'optional') || !!(groups === null || groups === void 0 ? void 0 : groups[groupName]);
|
|
1894
1960
|
};
|
|
1961
|
+
// `preselected` means "show this option by default when a new form is
|
|
1962
|
+
// loaded, so it's visible to the user". An empty non-required preselected
|
|
1963
|
+
// field buckets to 'optional' (nothing is wrong with it, and it has no
|
|
1964
|
+
// value), and the Optional box is collapsed by default — so the very
|
|
1965
|
+
// fields the schema asked to put in front of the author were the ones
|
|
1966
|
+
// nobody could see. A preselected row therefore forces its box open.
|
|
1967
|
+
//
|
|
1968
|
+
// A hidden row is an addable the author has not put in the form yet, so it
|
|
1969
|
+
// is never what `preselected` is talking about, however its schema is
|
|
1970
|
+
// flagged.
|
|
1971
|
+
var isPreselectedRow = function (entry) {
|
|
1972
|
+
var _a;
|
|
1973
|
+
return !entry.hidden &&
|
|
1974
|
+
!!((_a = options === null || options === void 0 ? void 0 : options[entry.name]) === null || _a === void 0 ? void 0 : _a.preselected);
|
|
1975
|
+
};
|
|
1976
|
+
// ONLY the Optional box. A preselected field that HAS a value buckets to
|
|
1977
|
+
// 'set' and one that fails validation to 'attention'; in both boxes the
|
|
1978
|
+
// field is already accounted for, and whether those boxes start collapsed
|
|
1979
|
+
// is the consumer's deliberate `compactCollapsedGroups` choice. Overriding
|
|
1980
|
+
// them here forced the Set box open against an explicit request.
|
|
1981
|
+
var groupHasPreselectedRow = function (boxKey, groupName) {
|
|
1982
|
+
return boxKey === 'optional' && (buckets[boxKey][groupName] || []).some(isPreselectedRow);
|
|
1983
|
+
};
|
|
1984
|
+
var boxHasPreselectedRows = function (boxKey) {
|
|
1985
|
+
return boxKey === 'optional' &&
|
|
1986
|
+
bucketGroups[boxKey].some(function (groupName) { return groupHasPreselectedRow(boxKey, groupName); });
|
|
1987
|
+
};
|
|
1895
1988
|
var STATUS_BOXES = [
|
|
1896
1989
|
{ key: 'attention', label: 'Needs attention', intent: 'warning', icon: 'ErrorWarningLine' },
|
|
1897
1990
|
{ key: 'set', label: 'Set', intent: 'success', icon: 'CheckLine' },
|
|
@@ -1946,13 +2039,37 @@ var FormEngineImpl = function (_a) {
|
|
|
1946
2039
|
return ((0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRequiredClusterBox, { className: 'options-readfirst-required-cluster', "$border": "".concat(cWarning, "33"), "$tint": "".concat(cWarning, "0d"), children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRequiredClusterHeader, { "$color": cWarning, children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: 'LinkM', size: '11px', style: { color: cWarning } }), "One of the below is required"] }), railed] }, grp));
|
|
1947
2040
|
});
|
|
1948
2041
|
};
|
|
2042
|
+
// One schema group inside a status box: its thin sub-label, the group's
|
|
2043
|
+
// subtitle, then its rows. Factored out of the box body so the SAME markup
|
|
2044
|
+
// renders both the groups a box shows directly and the ones it defers
|
|
2045
|
+
// behind the inner collapse.
|
|
2046
|
+
/** @param only when given, render just these rows of the group — the group
|
|
2047
|
+
can be split across the shown and folded halves of a capped box, and its
|
|
2048
|
+
label must appear above whichever half holds its first row. */
|
|
2049
|
+
var renderBoxGroup = function (boxKey, groupName, only) {
|
|
2050
|
+
var groupConfig = groups === null || groups === void 0 ? void 0 : groups[groupName];
|
|
2051
|
+
var rows = only ?
|
|
2052
|
+
(buckets[boxKey][groupName] || []).filter(function (entry) { return only.has(entry.name); })
|
|
2053
|
+
: buckets[boxKey][groupName];
|
|
2054
|
+
if (only && !rows.length) {
|
|
2055
|
+
return null;
|
|
2056
|
+
}
|
|
2057
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.default.Fragment, { children: [showGroupSubLabel(groupName) ?
|
|
2058
|
+
(0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledStatusBoxGroupLabel, { children: (0, readFirst_1.getOptionGroupLabel)(groupName, groups) })
|
|
2059
|
+
: null, showGroupSubLabel(groupName) && (groupConfig === null || groupConfig === void 0 ? void 0 : groupConfig.subtitle) ?
|
|
2060
|
+
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreP, { size: 'small', effect: { opacity: 0.6 }, style: {
|
|
2061
|
+
marginTop: 2,
|
|
2062
|
+
marginBottom: 8,
|
|
2063
|
+
marginLeft: compactRowStyles_1.GROUP_INDENT,
|
|
2064
|
+
paddingRight: 10,
|
|
2065
|
+
}, children: groupConfig.subtitle })
|
|
2066
|
+
: null, renderGroupRows(rows)] }, groupName));
|
|
2067
|
+
};
|
|
1949
2068
|
return ((0, jsx_runtime_1.jsx)(exports.OptionsContext.Provider, { value: { schema: options, value: availableOptions }, children: (0, jsx_runtime_1.jsx)(compactRowContext_1.CompactRowContext.Provider, { value: compactRowContextValue, children: (0, jsx_runtime_1.jsxs)(reqore_1.ReqoreErrorBoundary, { children: [showHelpForOption && ((0, jsx_runtime_1.jsx)(OptionsHelpDialog_1.OptionsHelpDialog, { onClose: function () { return setShowHelpForOption(undefined); }, option: options[showHelpForOption] })), (0, jsx_runtime_1.jsx)(compactToolbarContext_1.CompactToolbarContext.Provider, { value: compactToolbarContextValue, children: (0, jsx_runtime_1.jsxs)(StyledCompactWrap, { ref: setCompactWrap, className: 'options-readfirst-scroll', "$flush": compactFlush || compactNested, children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledCompactPanel
|
|
1950
|
-
//
|
|
1951
|
-
//
|
|
1952
|
-
//
|
|
1953
|
-
|
|
1954
|
-
// transparent inside the parent's card.
|
|
1955
|
-
, __assign({ "$headerBg": compactNested ? 'transparent' : headerBg, "$nested": compactNested, flat: true, raised: true, minimal: true,
|
|
2069
|
+
// Mirrors the toolbar's own search-row gate: when no search
|
|
2070
|
+
// row renders, the header is a thin strip and sits tight to
|
|
2071
|
+
// the first status box (see StyledCompactPanel).
|
|
2072
|
+
, __assign({ "$tightHeader": !((compactToolbarParts === null || compactToolbarParts === void 0 ? void 0 : compactToolbarParts.search) && (0, size_1.default)(availableOptions) > 1), "$headerBg": compactNested ? 'transparent' : headerBg, "$nested": compactNested, flat: true, raised: true, minimal: true,
|
|
1956
2073
|
// No panel background: the form sits transparently on whatever
|
|
1957
2074
|
// hosts it (page, drawer, or — for an arg_schema field — the
|
|
1958
2075
|
// parent's edit card) instead of stacking its own dark surface.
|
|
@@ -1965,6 +2082,44 @@ var FormEngineImpl = function (_a) {
|
|
|
1965
2082
|
var count = bucketCount(box.key);
|
|
1966
2083
|
if (!count)
|
|
1967
2084
|
return null;
|
|
2085
|
+
var hasPreselectedRows = boxHasPreselectedRows(box.key);
|
|
2086
|
+
var wouldCollapse = compactCollapsedGroups.includes(box.key) &&
|
|
2087
|
+
!query &&
|
|
2088
|
+
!(box.key === 'optional' && onlyOptionalRows);
|
|
2089
|
+
// Only a box that was opened SOLELY to reveal a preselected
|
|
2090
|
+
// row splits its body; a box that renders open anyway shows
|
|
2091
|
+
// all of its groups as before.
|
|
2092
|
+
var splitForPreselected = wouldCollapse && hasPreselectedRows;
|
|
2093
|
+
// Which rows this box shows, and which fold away, decided at
|
|
2094
|
+
// ROW level because `maxFieldsShown` counts fields — a
|
|
2095
|
+
// group-level split can only ever cut at a group boundary.
|
|
2096
|
+
// Group order is preserved so the visible rows read in the
|
|
2097
|
+
// same order they would if nothing were folded.
|
|
2098
|
+
var orderedRows = groupsInBox.flatMap(function (groupName) { return buckets[box.key][groupName] || []; });
|
|
2099
|
+
// Optional's own rule first: a box opened solely to reveal
|
|
2100
|
+
// preselected rows offers those, not an arbitrary first-N.
|
|
2101
|
+
var candidateRows = splitForPreselected ? orderedRows.filter(isPreselectedRow) : orderedRows;
|
|
2102
|
+
// …then the cap applies to whatever that left.
|
|
2103
|
+
var capped = maxFieldsShown !== undefined && candidateRows.length > maxFieldsShown;
|
|
2104
|
+
var shownRows = capped ? candidateRows.slice(0, maxFieldsShown) : candidateRows;
|
|
2105
|
+
var shownRowSet = new Set(shownRows.map(function (entry) { return entry.name; }));
|
|
2106
|
+
// Everything the box holds that is not on show. Once the
|
|
2107
|
+
// reader asks for more they get the whole box — withholding
|
|
2108
|
+
// the non-preselected remainder behind a second control is
|
|
2109
|
+
// the same defect one level down.
|
|
2110
|
+
var deferredRowSet = new Set(orderedRows
|
|
2111
|
+
.filter(function (entry) { return !shownRowSet.has(entry.name); })
|
|
2112
|
+
.map(function (entry) { return entry.name; }));
|
|
2113
|
+
var deferredCount = deferredRowSet.size;
|
|
2114
|
+
var shownGroups = groupsInBox.filter(function (groupName) {
|
|
2115
|
+
return (buckets[box.key][groupName] || []).some(function (entry) {
|
|
2116
|
+
return shownRowSet.has(entry.name);
|
|
2117
|
+
});
|
|
2118
|
+
});
|
|
2119
|
+
var deferredGroups = groupsInBox.filter(function (groupName) {
|
|
2120
|
+
return (buckets[box.key][groupName] || []).some(function (entry) { return !shownRowSet.has(entry.name); });
|
|
2121
|
+
});
|
|
2122
|
+
var moreOpen = Boolean(query) || expandedMoreBoxes.includes(box.key);
|
|
1968
2123
|
var accent = box.key === 'attention' ? cWarning
|
|
1969
2124
|
: box.key === 'set' ? cSuccess
|
|
1970
2125
|
: cMuted;
|
|
@@ -1982,36 +2137,49 @@ var FormEngineImpl = function (_a) {
|
|
|
1982
2137
|
onCollapseChange: function (collapsed) {
|
|
1983
2138
|
return setOpenedStatusBox(collapsed ? undefined : box.key);
|
|
1984
2139
|
}, flat: true, minimal: true, collapseButtonProps: { flat: true, minimal: true, size: 'small' }, collapsible: true,
|
|
1985
|
-
//
|
|
1986
|
-
//
|
|
1987
|
-
//
|
|
1988
|
-
//
|
|
1989
|
-
//
|
|
1990
|
-
//
|
|
1991
|
-
//
|
|
1992
|
-
//
|
|
1993
|
-
//
|
|
1994
|
-
//
|
|
1995
|
-
//
|
|
1996
|
-
//
|
|
1997
|
-
//
|
|
1998
|
-
//
|
|
1999
|
-
//
|
|
2000
|
-
//
|
|
2001
|
-
//
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2140
|
+
// Which boxes start closed is the consumer's call
|
|
2141
|
+
// (`compactCollapsedGroups`, default `['optional']`: the
|
|
2142
|
+
// Optional box holds every not-yet-added field, so a form
|
|
2143
|
+
// opens on what is in use). Two rules override it:
|
|
2144
|
+
//
|
|
2145
|
+
// A SEARCH forces every box open — ReqorePanel unmounts
|
|
2146
|
+
// collapsed content, so a match inside a closed box would
|
|
2147
|
+
// be unreachable. (isCollapsed is the panel's controllable
|
|
2148
|
+
// state; manual toggling still works with no query set.)
|
|
2149
|
+
//
|
|
2150
|
+
// The Optional box stays open when it is the ONLY box,
|
|
2151
|
+
// because collapsing it renders a card that looks empty and
|
|
2152
|
+
// broken: an auth profile's Authorization block, whose nine
|
|
2153
|
+
// requirement fields are all optional, showed as a titled
|
|
2154
|
+
// card containing one collapsed "Optional 9" strip and
|
|
2155
|
+
// nothing else. This does not generalise to the other two —
|
|
2156
|
+
// a lone Set box collapsed is a deliberate ask, and its
|
|
2157
|
+
// header still reports what is in there.
|
|
2158
|
+
//
|
|
2159
|
+
// A PRESELECTED row overrides it too: the schema asked
|
|
2160
|
+
// for that field to be visible on a new form, so the
|
|
2161
|
+
// box it lands in opens. The groups it does NOT appear
|
|
2162
|
+
// in stay behind an inner collapse below, so opening
|
|
2163
|
+
// the box reveals the preselected fields without also
|
|
2164
|
+
// dumping every not-yet-added optional field on the
|
|
2165
|
+
// author.
|
|
2166
|
+
isCollapsed: wouldCollapse && !hasPreselectedRows, label: (0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledGroupHeader, { children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreP, { effect: { weight: 'bold' }, size: 'normal', children: box.label }), (0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { size: 'small', minimal: true, compact: true, intent: box.intent, label: String(count) })] }), icon: box.icon, className: 'options-readfirst-group', padded: false, contentStyle: { padding: '4px 4px 6px' }, children: (0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledGroupBody, { "$divider": cDivider, "$hover": cHover, "$focus": cWarning, "$success": cSuccess, "$rowBg": cRowBg, "$lineColor": cGroupLine, "$moreBorder": cMoreBorder, className: compactNarrow ? 'readfirst-narrow' : undefined, children: [shownGroups.map(function (groupName) {
|
|
2167
|
+
return renderBoxGroup(box.key, groupName, shownRowSet);
|
|
2168
|
+
}), deferredCount ?
|
|
2169
|
+
(0, jsx_runtime_1.jsxs)("button", { type: 'button', className: 'readfirst-row readfirst-more-row options-readfirst-more', "aria-expanded": moreOpen, onClick: function () {
|
|
2170
|
+
return setExpandedMoreBoxes(function (prev) {
|
|
2171
|
+
return prev.includes(box.key) ?
|
|
2172
|
+
prev.filter(function (k) { return k !== box.key; })
|
|
2173
|
+
: __spreadArray(__spreadArray([], prev, true), [box.key], false);
|
|
2174
|
+
});
|
|
2175
|
+
}, children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreP, { size: 'small', effect: { opacity: 0.8 }, children: moreOpen ?
|
|
2176
|
+
'Show fewer'
|
|
2177
|
+
: "".concat(deferredCount, " more ").concat(box.key === 'optional' ? 'optional ' : '', "field").concat(deferredCount === 1 ? '' : 's') }), (0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: 'ArrowDownSLine', size: 'small', className: 'readfirst-more-chevron', effect: { opacity: 0.8 } })] })
|
|
2178
|
+
: null, deferredCount && moreOpen ?
|
|
2179
|
+
deferredGroups.map(function (groupName) {
|
|
2180
|
+
return renderBoxGroup(box.key, groupName, deferredRowSet);
|
|
2181
|
+
})
|
|
2182
|
+
: null] }) }, box.key));
|
|
2015
2183
|
})] })), commitMode === 'batched' && !readOnly && dirtyOptionNames.length ?
|
|
2016
2184
|
(0, jsx_runtime_1.jsx)(StyledCommitDock, { "$bg": cBg, "$border": cDivider, children: (0, jsx_runtime_1.jsxs)(reqore_1.ReqoreControlGroup, { className: 'options-readfirst-commitbar', verticalAlign: 'center', wrap: true, children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { size: 'tiny', minimal: true, flat: true, compact: true, effect: { uppercase: true, spaced: 1 }, intent: 'warning', icon: 'EditLine', label: "".concat(dirtyOptionNames.length, " unsaved change").concat(dirtyOptionNames.length === 1 ? '' : 's') }), (0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { size: 'small', intent: 'success', icon: 'CheckLine', fixed: true, className: 'options-readfirst-save', disabled: !validityData.isValid, tooltip: validityData.isValid ?
|
|
2017
2185
|
'Apply the staged changes'
|