@qoretechnologies/reqraft 0.10.58-pr.129.gd317f2e → 0.10.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/form/engine/FormEngine.d.ts.map +1 -1
- package/dist/components/form/engine/FormEngine.js +30 -53
- package/dist/components/form/engine/FormEngine.js.map +1 -1
- package/dist/components/form/engine/readFirst.d.ts +16 -20
- package/dist/components/form/engine/readFirst.d.ts.map +1 -1
- package/dist/components/form/engine/readFirst.js +16 -49
- package/dist/components/form/engine/readFirst.js.map +1 -1
- package/dist/components/form/expressions/builder/index.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/index.js +29 -14
- package/dist/components/form/expressions/builder/index.js.map +1 -1
- package/dist/components/form/fields/emittedValues.d.ts +5 -0
- package/dist/components/form/fields/emittedValues.d.ts.map +1 -1
- package/dist/components/form/fields/emittedValues.js +8 -0
- package/dist/components/form/fields/emittedValues.js.map +1 -1
- package/dist/components/form/fields/template/TemplateField.d.ts.map +1 -1
- package/dist/components/form/fields/template/TemplateField.js +3 -1
- package/dist/components/form/fields/template/TemplateField.js.map +1 -1
- package/dist/components/smartEditor/SmartEditor.d.ts.map +1 -1
- package/dist/components/smartEditor/SmartEditor.js +27 -4
- package/dist/components/smartEditor/SmartEditor.js.map +1 -1
- package/dist/components/smartEditor/useLspSession.d.ts.map +1 -1
- package/dist/components/smartEditor/useLspSession.js +8 -0
- package/dist/components/smartEditor/useLspSession.js.map +1 -1
- package/dist/helpers/allowedValues.d.ts +71 -0
- package/dist/helpers/allowedValues.d.ts.map +1 -0
- package/dist/helpers/allowedValues.js +183 -0
- package/dist/helpers/allowedValues.js.map +1 -0
- package/dist/helpers/common.d.ts +7 -0
- package/dist/helpers/common.d.ts.map +1 -1
- package/dist/helpers/common.js +16 -1
- package/dist/helpers/common.js.map +1 -1
- package/dist/helpers/expressions.d.ts +13 -0
- package/dist/helpers/expressions.d.ts.map +1 -1
- package/dist/helpers/expressions.js +23 -1
- package/dist/helpers/expressions.js.map +1 -1
- package/dist/helpers/validations.d.ts.map +1 -1
- package/dist/helpers/validations.js +14 -0
- package/dist/helpers/validations.js.map +1 -1
- package/dist/hooks/useCoarsePointer.d.ts +9 -0
- package/dist/hooks/useCoarsePointer.d.ts.map +1 -0
- package/dist/hooks/useCoarsePointer.js +29 -0
- package/dist/hooks/useCoarsePointer.js.map +1 -0
- package/dist/utils/fetch.d.ts +4 -0
- package/dist/utils/fetch.d.ts.map +1 -1
- package/dist/utils/fetch.js +6 -1
- package/dist/utils/fetch.js.map +1 -1
- package/package.json +1 -1
- package/src/components/form/engine/FormEngine.tsx +26 -48
- package/src/components/form/engine/readFirst.ts +19 -50
- package/src/components/form/expressions/builder/index.tsx +21 -3
- package/src/components/form/fields/emittedValues.ts +8 -0
- package/src/components/form/fields/template/TemplateField.tsx +4 -1
- package/src/components/smartEditor/SmartEditor.tsx +28 -4
- package/src/components/smartEditor/useLspSession.ts +8 -0
- package/src/helpers/allowedValues.ts +216 -0
- package/src/helpers/common.ts +14 -0
- package/src/helpers/expressions.ts +25 -0
- package/src/helpers/validations.ts +16 -0
- package/src/hooks/useCoarsePointer.ts +30 -0
- package/src/utils/fetch.ts +10 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormEngine.d.ts","sourceRoot":"","sources":["../../../../src/components/form/engine/FormEngine.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAE7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AASzF,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,2BAA2B,EAC3B,kBAAkB,EAClB,yBAAyB,EACzB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,qBAAqB,EACrB,uBAAuB,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OAAO,CAAC;IACnB;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACnD;;;;;;;;OAQG;IACH,mBAAmB,CAAC,EAAE,oBAAoB,CAAC;IAC3C;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IACrC;;;;;;;OAOG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B;;;;;;;OAOG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;;;;;;;OAQG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE9C;;;;;;;;;;;;;OAaG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC;;;;;;;;;;;;;;;;;;OAkBG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;IAElC;;;;;;;;;;;;;;;OAeG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAmuGD;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,UAAW,gBAAgB,4CAIjD,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -339,7 +339,7 @@ var fixOptions = function (value, options, operators, isRendererOnly) {
|
|
|
339
339
|
return fixedValue;
|
|
340
340
|
}
|
|
341
341
|
(0, lodash_1.forEach)(options, function (option, name) {
|
|
342
|
-
var _a, _b, _c, _d, _f, _g, _h
|
|
342
|
+
var _a, _b, _c, _d, _f, _g, _h;
|
|
343
343
|
if (option.value ||
|
|
344
344
|
option.required_groups ||
|
|
345
345
|
((option.required || option.preselected) && !fixedValue[name]) ||
|
|
@@ -350,30 +350,22 @@ var fixOptions = function (value, options, operators, isRendererOnly) {
|
|
|
350
350
|
((_c = fixedValue[name]) === null || _c === void 0 ? void 0 : _c.value) === undefined) {
|
|
351
351
|
obj = option.default_value;
|
|
352
352
|
}
|
|
353
|
-
else if (option.default_view === 'expression' &&
|
|
354
|
-
((_d = fixedValue[name]) === null || _d === void 0 ? void 0 : _d.value) === undefined) {
|
|
355
|
-
// A field the schema declares as opening in expression mode starts as an
|
|
356
|
-
// EMPTY expression, not as its raw default. `isDefaultFunction` already
|
|
357
|
-
// makes the renderer open that way, so without this the data disagreed
|
|
358
|
-
// with what the operator was looking at: an expression editor whose
|
|
359
|
-
// value was still the plain default, and no `is_expression` on the field
|
|
360
|
-
// until the first edit.
|
|
361
|
-
obj = {
|
|
362
|
-
type: type,
|
|
363
|
-
value: {
|
|
364
|
-
args: [],
|
|
365
|
-
},
|
|
366
|
-
is_expression: true,
|
|
367
|
-
};
|
|
368
|
-
}
|
|
369
353
|
else {
|
|
354
|
+
// A field declared with `default_view: 'expression'` is NOT seeded with
|
|
355
|
+
// an empty expression here. This runs on every load, so a seed written
|
|
356
|
+
// here changed a saved object merely by opening it: an existing Qog
|
|
357
|
+
// state gained `{args: []}` the moment its panel opened, and the editor
|
|
358
|
+
// autosaved a draft nobody made. The renderer already opens such a
|
|
359
|
+
// field in expression mode from the schema (`isDefaultFunction`), the
|
|
360
|
+
// first edit stores `is_expression`, and a host that creates a NEW
|
|
361
|
+
// object seeds the expression itself, at creation.
|
|
370
362
|
obj = {
|
|
371
363
|
type: type,
|
|
372
|
-
value: (
|
|
373
|
-
(
|
|
374
|
-
: fixedValue[name])) !== null &&
|
|
364
|
+
value: (_g = (_f = (typeof fixedValue[name] === 'object' ?
|
|
365
|
+
(_d = fixedValue[name]) === null || _d === void 0 ? void 0 : _d.value
|
|
366
|
+
: fixedValue[name])) !== null && _f !== void 0 ? _f : option.value) !== null && _g !== void 0 ? _g : (0, common_1.getDefaultValue)(option),
|
|
375
367
|
};
|
|
376
|
-
if ((
|
|
368
|
+
if ((_h = fixedValue[name]) === null || _h === void 0 ? void 0 : _h.is_expression) {
|
|
377
369
|
obj.is_expression = true;
|
|
378
370
|
}
|
|
379
371
|
}
|
|
@@ -382,7 +374,7 @@ var fixOptions = function (value, options, operators, isRendererOnly) {
|
|
|
382
374
|
});
|
|
383
375
|
var res = (0, reduce_1.default)(fixedValue, function (newValue, option, optionName) {
|
|
384
376
|
var _a;
|
|
385
|
-
var _b, _c, _d
|
|
377
|
+
var _b, _c, _d;
|
|
386
378
|
var newOption = option;
|
|
387
379
|
if (!(0, lodash_1.isPlainObject)(newOption) || !(newOption === null || newOption === void 0 ? void 0 : newOption.type)) {
|
|
388
380
|
var isUntypedEnvelope = (0, lodash_1.isPlainObject)(newOption) && 'value' in newOption;
|
|
@@ -397,35 +389,18 @@ var fixOptions = function (value, options, operators, isRendererOnly) {
|
|
|
397
389
|
isRendererOnly(newOption.type)) {
|
|
398
390
|
newOption = __assign(__assign({}, newOption), { type: (0, exports.getType)(getOptionSchemaStorageType(options === null || options === void 0 ? void 0 : options[optionName], isRendererOnly), operators, newOption.op) });
|
|
399
391
|
}
|
|
400
|
-
// A value that is not one of the declared choices is
|
|
401
|
-
//
|
|
402
|
-
//
|
|
403
|
-
//
|
|
404
|
-
//
|
|
405
|
-
//
|
|
406
|
-
//
|
|
407
|
-
// the
|
|
408
|
-
//
|
|
409
|
-
// saying it has no reference values to offer right now (the app-action
|
|
410
|
-
// catalogue ships exactly that, with an
|
|
411
|
-
// `option_reference_values_unavailable` message attached). An empty array
|
|
412
|
-
// is truthy, so testing the array itself made every such option erase the
|
|
413
|
-
// operator's stored value on the first render, before the
|
|
414
|
-
// connection-refreshed schema arrived to say otherwise — and the emptied
|
|
415
|
-
// form then autosaved over the draft, so the value was gone for good.
|
|
416
|
-
// Only an option that actually declares choices can have a value that is
|
|
417
|
-
// not one of them.
|
|
418
|
-
if (newOption.value !== undefined &&
|
|
419
|
-
((_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) &&
|
|
420
|
-
!(0, readFirst_1.findAllowedValueOption)(newOption.value, options === null || options === void 0 ? void 0 : options[optionName]) &&
|
|
421
|
-
!(0, TemplateField_1.isValueTemplate)(newOption.value) &&
|
|
422
|
-
!((_f = options === null || options === void 0 ? void 0 : options[optionName]) === null || _f === void 0 ? void 0 : _f.multiselect) &&
|
|
423
|
-
!((_g = options === null || options === void 0 ? void 0 : options[optionName]) === null || _g === void 0 ? void 0 : _g.allowed_values_creatable)) {
|
|
424
|
-
newOption.value = undefined;
|
|
425
|
-
}
|
|
392
|
+
// A value that is not one of the declared choices is KEPT. It used to be
|
|
393
|
+
// dropped here, on load, and the dropped value was three times a real
|
|
394
|
+
// one — a bare-declared choice, a document naming a choice, a value whose
|
|
395
|
+
// choices had not arrived yet — that the emptied form then autosaved, so
|
|
396
|
+
// it was gone for good. Whether a value is one of the choices is now the
|
|
397
|
+
// validator's question (`getUnlistedChoiceReason`, asked through
|
|
398
|
+
// `validateFieldWithResult`): such a field is invalid, sits under "Needs
|
|
399
|
+
// attention" saying which value is not a choice, and the form reports
|
|
400
|
+
// itself invalid so the host blocks submitting it.
|
|
426
401
|
if (newOption.value &&
|
|
427
|
-
((
|
|
428
|
-
((
|
|
402
|
+
((_c = options === null || options === void 0 ? void 0 : options[optionName]) === null || _c === void 0 ? void 0 : _c.readonly) &&
|
|
403
|
+
((_d = options === null || options === void 0 ? void 0 : options[optionName]) === null || _d === void 0 ? void 0 : _d.default_value) &&
|
|
429
404
|
(0, common_1.getDefaultValue)(options === null || options === void 0 ? void 0 : options[optionName]) !== newOption.value) {
|
|
430
405
|
newOption.value = (0, common_1.getDefaultValue)(options[optionName]);
|
|
431
406
|
}
|
|
@@ -1100,8 +1075,8 @@ var FormEngineImpl = function (_a) {
|
|
|
1100
1075
|
touchedOptionsRef.current.add(optionName);
|
|
1101
1076
|
setLocalValue(function (_a) {
|
|
1102
1077
|
var _b, _c;
|
|
1103
|
-
var _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
1104
|
-
var
|
|
1078
|
+
var _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
1079
|
+
var _s = _a.fields, fields = _s === void 0 ? {} : _s;
|
|
1105
1080
|
var schemaType = getOptionSchemaStorageType(options === null || options === void 0 ? void 0 : options[optionName], isRendererOnly);
|
|
1106
1081
|
var isAnyLike = (0, optionUiTypes_1.isUntypedOptionType)(schemaType);
|
|
1107
1082
|
// For any/auto schema types, preserve the user's chosen type stored in the field
|
|
@@ -1181,7 +1156,9 @@ var FormEngineImpl = function (_a) {
|
|
|
1181
1156
|
meta.events = (_q = options === null || options === void 0 ? void 0 : options[optionName]) === null || _q === void 0 ? void 0 : _q.on_change;
|
|
1182
1157
|
}
|
|
1183
1158
|
onSingleOptionsChange === null || onSingleOptionsChange === void 0 ? void 0 : onSingleOptionsChange(optionName, updatedValue[optionName]);
|
|
1184
|
-
if (compact &&
|
|
1159
|
+
if (compact &&
|
|
1160
|
+
!readOnly &&
|
|
1161
|
+
(0, readFirst_1.shouldAutoCollapseCompactOption)(options === null || options === void 0 ? void 0 : options[optionName], val, !!((_r = updatedValue[optionName]) === null || _r === void 0 ? void 0 : _r.is_expression))) {
|
|
1185
1162
|
setExpandedOptions(function (prev) { return prev.filter(function (name) { return name !== optionName; }); });
|
|
1186
1163
|
}
|
|
1187
1164
|
return {
|