@qoretechnologies/reqraft 0.10.66-pr.145.gcb1e59d → 0.10.66
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/README.md +53 -1
- package/dist/components/Description/AllowedValuesHelp.d.ts +20 -0
- package/dist/components/Description/AllowedValuesHelp.d.ts.map +1 -0
- package/dist/components/Description/AllowedValuesHelp.js +86 -0
- package/dist/components/Description/AllowedValuesHelp.js.map +1 -0
- package/dist/components/Description/describedControl.d.ts +54 -0
- package/dist/components/Description/describedControl.d.ts.map +1 -0
- package/dist/components/Description/describedControl.js +81 -0
- package/dist/components/Description/describedControl.js.map +1 -0
- package/dist/components/Description/index.d.ts.map +1 -1
- package/dist/components/Description/index.js +3 -2
- package/dist/components/Description/index.js.map +1 -1
- package/dist/components/colorValue/colorValue.d.ts +59 -0
- package/dist/components/colorValue/colorValue.d.ts.map +1 -0
- package/dist/components/colorValue/colorValue.js +245 -0
- package/dist/components/colorValue/colorValue.js.map +1 -0
- package/dist/components/colorValue/index.d.ts +34 -0
- package/dist/components/colorValue/index.d.ts.map +1 -0
- package/dist/components/colorValue/index.js +136 -0
- package/dist/components/colorValue/index.js.map +1 -0
- package/dist/components/colorValue/labels.d.ts +12 -0
- package/dist/components/colorValue/labels.d.ts.map +1 -0
- package/dist/components/colorValue/labels.js +11 -0
- package/dist/components/colorValue/labels.js.map +1 -0
- package/dist/components/composer/Composer.d.ts +1 -1
- package/dist/components/composer/Composer.d.ts.map +1 -1
- package/dist/components/composer/Composer.js +2 -2
- package/dist/components/composer/Composer.js.map +1 -1
- package/dist/components/dpqlEditor/DpqlEditor.d.ts.map +1 -1
- package/dist/components/dpqlEditor/DpqlEditor.js +156 -10
- package/dist/components/dpqlEditor/DpqlEditor.js.map +1 -1
- package/dist/components/dpqlEditor/dpqlCompletions.d.ts +39 -0
- package/dist/components/dpqlEditor/dpqlCompletions.d.ts.map +1 -0
- package/dist/components/dpqlEditor/dpqlCompletions.js +294 -0
- package/dist/components/dpqlEditor/dpqlCompletions.js.map +1 -0
- package/dist/components/dpqlEditor/dpqlHelpers.d.ts +54 -5
- package/dist/components/dpqlEditor/dpqlHelpers.d.ts.map +1 -1
- package/dist/components/dpqlEditor/dpqlHelpers.js +420 -63
- package/dist/components/dpqlEditor/dpqlHelpers.js.map +1 -1
- package/dist/components/dpqlEditor/dpqlInserter.d.ts.map +1 -1
- package/dist/components/dpqlEditor/dpqlInserter.js +67 -29
- package/dist/components/dpqlEditor/dpqlInserter.js.map +1 -1
- package/dist/components/dpqlEditor/dpqlTags.d.ts +17 -7
- package/dist/components/dpqlEditor/dpqlTags.d.ts.map +1 -1
- package/dist/components/dpqlEditor/dpqlTags.js +44 -17
- package/dist/components/dpqlEditor/dpqlTags.js.map +1 -1
- package/dist/components/dpqlEditor/types.d.ts +94 -8
- package/dist/components/dpqlEditor/types.d.ts.map +1 -1
- package/dist/components/dpqlEditor/useDpqlSession.d.ts +7 -2
- package/dist/components/dpqlEditor/useDpqlSession.d.ts.map +1 -1
- package/dist/components/dpqlEditor/useDpqlSession.js +49 -17
- package/dist/components/dpqlEditor/useDpqlSession.js.map +1 -1
- package/dist/components/form/engine/CompactRow.d.ts.map +1 -1
- package/dist/components/form/engine/CompactRow.js +336 -243
- 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 +20 -57
- package/dist/components/form/engine/CompactToolbar.js.map +1 -1
- package/dist/components/form/engine/FormEngine.d.ts +67 -59
- package/dist/components/form/engine/FormEngine.d.ts.map +1 -1
- package/dist/components/form/engine/FormEngine.js +606 -409
- package/dist/components/form/engine/FormEngine.js.map +1 -1
- package/dist/components/form/engine/HiddenFieldsNote.d.ts +28 -0
- package/dist/components/form/engine/HiddenFieldsNote.d.ts.map +1 -0
- package/dist/components/form/engine/HiddenFieldsNote.js +32 -0
- package/dist/components/form/engine/HiddenFieldsNote.js.map +1 -0
- package/dist/components/form/engine/OptionFieldMessages.d.ts +2 -18
- package/dist/components/form/engine/OptionFieldMessages.d.ts.map +1 -1
- package/dist/components/form/engine/OptionFieldMessages.js +28 -25
- package/dist/components/form/engine/OptionFieldMessages.js.map +1 -1
- package/dist/components/form/engine/OptionsHelpDialog.d.ts.map +1 -1
- package/dist/components/form/engine/OptionsHelpDialog.js +19 -2
- package/dist/components/form/engine/OptionsHelpDialog.js.map +1 -1
- package/dist/components/form/engine/_structuredData/SchemaDataView.d.ts +2 -2
- package/dist/components/form/engine/_structuredData/SchemaDataView.d.ts.map +1 -1
- package/dist/components/form/engine/_structuredData/SchemaDataView.js +11 -31
- package/dist/components/form/engine/_structuredData/SchemaDataView.js.map +1 -1
- package/dist/components/form/engine/compactRowContext.d.ts +30 -6
- package/dist/components/form/engine/compactRowContext.d.ts.map +1 -1
- package/dist/components/form/engine/compactRowContext.js.map +1 -1
- package/dist/components/form/engine/compactRowStyles.d.ts +56 -31
- package/dist/components/form/engine/compactRowStyles.d.ts.map +1 -1
- package/dist/components/form/engine/compactRowStyles.js +121 -110
- package/dist/components/form/engine/compactRowStyles.js.map +1 -1
- package/dist/components/form/engine/compactToolbarColors.d.ts +16 -0
- package/dist/components/form/engine/compactToolbarColors.d.ts.map +1 -0
- package/dist/components/form/engine/compactToolbarColors.js +21 -0
- package/dist/components/form/engine/compactToolbarColors.js.map +1 -0
- package/dist/components/form/engine/compactToolbarContext.d.ts +0 -3
- 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/inheritProps.d.ts +29 -0
- package/dist/components/form/engine/inheritProps.d.ts.map +1 -0
- package/dist/components/form/engine/inheritProps.js +43 -0
- package/dist/components/form/engine/inheritProps.js.map +1 -0
- package/dist/components/form/engine/operatorSummary.d.ts +26 -0
- package/dist/components/form/engine/operatorSummary.d.ts.map +1 -0
- package/dist/components/form/engine/operatorSummary.js +35 -0
- package/dist/components/form/engine/operatorSummary.js.map +1 -0
- package/dist/components/form/engine/readFirst.d.ts +26 -22
- package/dist/components/form/engine/readFirst.d.ts.map +1 -1
- package/dist/components/form/engine/readFirst.js +79 -115
- package/dist/components/form/engine/readFirst.js.map +1 -1
- package/dist/components/form/engine/readFirstColors.d.ts +30 -0
- package/dist/components/form/engine/readFirstColors.d.ts.map +1 -0
- package/dist/components/form/engine/readFirstColors.js +51 -0
- package/dist/components/form/engine/readFirstColors.js.map +1 -0
- package/dist/components/form/engine/rowFocus.d.ts +3 -9
- package/dist/components/form/engine/rowFocus.d.ts.map +1 -1
- package/dist/components/form/engine/rowFocus.js +30 -19
- package/dist/components/form/engine/rowFocus.js.map +1 -1
- package/dist/components/form/engine/typeChoices.d.ts +1 -1
- package/dist/components/form/engine/variants/VariantCalmTable.d.ts.map +1 -1
- package/dist/components/form/engine/variants/VariantCalmTable.js +2 -1
- package/dist/components/form/engine/variants/VariantCalmTable.js.map +1 -1
- package/dist/components/form/engine/variants/VariantCards.d.ts.map +1 -1
- package/dist/components/form/engine/variants/VariantCards.js +2 -1
- package/dist/components/form/engine/variants/VariantCards.js.map +1 -1
- package/dist/components/form/engine/variants/VariantFocus.js +1 -1
- package/dist/components/form/engine/variants/VariantFocus.js.map +1 -1
- package/dist/components/form/engine/variants/VariantMinimal.d.ts.map +1 -1
- package/dist/components/form/engine/variants/VariantMinimal.js +2 -1
- package/dist/components/form/engine/variants/VariantMinimal.js.map +1 -1
- package/dist/components/form/engine/variants/variantParts.d.ts +1 -1
- package/dist/components/form/engine/variants/variantParts.d.ts.map +1 -1
- package/dist/components/form/engine/variants/variantParts.js +25 -17
- package/dist/components/form/engine/variants/variantParts.js.map +1 -1
- package/dist/components/form/expressions/DpqlRendering.d.ts +1 -1
- package/dist/components/form/expressions/DpqlRendering.d.ts.map +1 -1
- package/dist/components/form/expressions/DpqlRendering.js +7 -6
- package/dist/components/form/expressions/DpqlRendering.js.map +1 -1
- package/dist/components/form/expressions/ExpressionField.d.ts +67 -3
- package/dist/components/form/expressions/ExpressionField.d.ts.map +1 -1
- package/dist/components/form/expressions/ExpressionField.js +536 -114
- package/dist/components/form/expressions/ExpressionField.js.map +1 -1
- package/dist/components/form/expressions/argumentPresence.d.ts +14 -0
- package/dist/components/form/expressions/argumentPresence.d.ts.map +1 -1
- package/dist/components/form/expressions/argumentPresence.js +16 -1
- package/dist/components/form/expressions/argumentPresence.js.map +1 -1
- package/dist/components/form/expressions/builder/argumentDetail.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/argumentDetail.js +4 -1
- package/dist/components/form/expressions/builder/argumentDetail.js.map +1 -1
- package/dist/components/form/expressions/builder/argumentLabel.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/argumentLabel.js +30 -11
- package/dist/components/form/expressions/builder/argumentLabel.js.map +1 -1
- package/dist/components/form/expressions/builder/argumentWrapper.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/argumentWrapper.js +3 -1
- package/dist/components/form/expressions/builder/argumentWrapper.js.map +1 -1
- package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.d.ts +9 -0
- package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.js +30 -27
- package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.js.map +1 -1
- package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.d.ts +1 -1
- package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.js +7 -5
- package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.js.map +1 -1
- package/dist/components/form/expressions/builder/index.d.ts +34 -2
- package/dist/components/form/expressions/builder/index.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/index.js +170 -80
- package/dist/components/form/expressions/builder/index.js.map +1 -1
- package/dist/components/form/expressions/builder/item.d.ts +6 -2
- package/dist/components/form/expressions/builder/item.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/item.js +19 -5
- package/dist/components/form/expressions/builder/item.js.map +1 -1
- package/dist/components/form/expressions/builder/renderTemplate.js +1 -1
- package/dist/components/form/expressions/builder/renderTemplate.js.map +1 -1
- package/dist/components/form/expressions/dpqlMockRecordPath.d.ts +11 -0
- package/dist/components/form/expressions/dpqlMockRecordPath.d.ts.map +1 -0
- package/dist/components/form/expressions/dpqlMockRecordPath.js +254 -0
- package/dist/components/form/expressions/dpqlMockRecordPath.js.map +1 -0
- package/dist/components/form/expressions/expressionOperands.d.ts +16 -0
- package/dist/components/form/expressions/expressionOperands.d.ts.map +1 -0
- package/dist/components/form/expressions/expressionOperands.js +97 -0
- package/dist/components/form/expressions/expressionOperands.js.map +1 -0
- package/dist/components/form/expressions/fieldPath.d.ts +24 -0
- package/dist/components/form/expressions/fieldPath.d.ts.map +1 -0
- package/dist/components/form/expressions/fieldPath.js +152 -0
- package/dist/components/form/expressions/fieldPath.js.map +1 -0
- package/dist/components/form/expressions/loneValue.d.ts +17 -0
- package/dist/components/form/expressions/loneValue.d.ts.map +1 -0
- package/dist/components/form/expressions/loneValue.js +33 -0
- package/dist/components/form/expressions/loneValue.js.map +1 -0
- package/dist/components/form/expressions/mockExpressions.d.ts.map +1 -1
- package/dist/components/form/expressions/mockExpressions.js +22 -5
- package/dist/components/form/expressions/mockExpressions.js.map +1 -1
- package/dist/components/form/expressions/renderExpressionToText.d.ts +2 -0
- package/dist/components/form/expressions/renderExpressionToText.d.ts.map +1 -1
- package/dist/components/form/expressions/renderExpressionToText.js +37 -25
- package/dist/components/form/expressions/renderExpressionToText.js.map +1 -1
- package/dist/components/form/expressions/textOfExpression.d.ts +18 -0
- package/dist/components/form/expressions/textOfExpression.d.ts.map +1 -0
- package/dist/components/form/expressions/textOfExpression.js +49 -0
- package/dist/components/form/expressions/textOfExpression.js.map +1 -0
- package/dist/components/form/expressions/types.d.ts +12 -0
- package/dist/components/form/expressions/types.d.ts.map +1 -1
- package/dist/components/form/expressions/types.js +6 -1
- package/dist/components/form/expressions/types.js.map +1 -1
- package/dist/components/form/expressions/useExpressionType.d.ts +26 -0
- package/dist/components/form/expressions/useExpressionType.d.ts.map +1 -0
- package/dist/components/form/expressions/useExpressionType.js +181 -0
- package/dist/components/form/expressions/useExpressionType.js.map +1 -0
- package/dist/components/form/expressions/useRenderExpression.d.ts.map +1 -1
- package/dist/components/form/expressions/useRenderExpression.js +13 -9
- package/dist/components/form/expressions/useRenderExpression.js.map +1 -1
- package/dist/components/form/expressions/wildcardExpressions.d.ts +27 -0
- package/dist/components/form/expressions/wildcardExpressions.d.ts.map +1 -0
- package/dist/components/form/expressions/wildcardExpressions.js +101 -0
- package/dist/components/form/expressions/wildcardExpressions.js.map +1 -0
- package/dist/components/form/fields/Field.d.ts.map +1 -1
- package/dist/components/form/fields/Field.js +39 -18
- package/dist/components/form/fields/Field.js.map +1 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.d.ts +0 -7
- package/dist/components/form/fields/allowed-values/AllowedValues.d.ts.map +1 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.js +46 -35
- package/dist/components/form/fields/allowed-values/AllowedValues.js.map +1 -1
- package/dist/components/form/fields/allowed-values/choicePicture.d.ts +37 -0
- package/dist/components/form/fields/allowed-values/choicePicture.d.ts.map +1 -0
- package/dist/components/form/fields/allowed-values/choicePicture.js +64 -0
- package/dist/components/form/fields/allowed-values/choicePicture.js.map +1 -0
- package/dist/components/form/fields/array/ArrayAuto.d.ts.map +1 -1
- package/dist/components/form/fields/array/ArrayAuto.js +24 -0
- package/dist/components/form/fields/array/ArrayAuto.js.map +1 -1
- package/dist/components/form/fields/array/ArrayAutoField.d.ts.map +1 -1
- package/dist/components/form/fields/array/ArrayAutoField.js +36 -13
- package/dist/components/form/fields/array/ArrayAutoField.js.map +1 -1
- package/dist/components/form/fields/auto/AutoFormField.d.ts +30 -1
- package/dist/components/form/fields/auto/AutoFormField.d.ts.map +1 -1
- package/dist/components/form/fields/auto/AutoFormField.js +123 -79
- package/dist/components/form/fields/auto/AutoFormField.js.map +1 -1
- package/dist/components/form/fields/auto/hostEditorValue.d.ts +30 -0
- package/dist/components/form/fields/auto/hostEditorValue.d.ts.map +1 -0
- package/dist/components/form/fields/auto/hostEditorValue.js +53 -0
- package/dist/components/form/fields/auto/hostEditorValue.js.map +1 -0
- package/dist/components/form/fields/binary/Binary.d.ts.map +1 -1
- package/dist/components/form/fields/binary/Binary.js +23 -3
- package/dist/components/form/fields/binary/Binary.js.map +1 -1
- package/dist/components/form/fields/boolean/Boolean.d.ts +5 -0
- package/dist/components/form/fields/boolean/Boolean.d.ts.map +1 -1
- package/dist/components/form/fields/boolean/Boolean.js +9 -1
- package/dist/components/form/fields/boolean/Boolean.js.map +1 -1
- package/dist/components/form/fields/color/Color.d.ts +103 -16
- package/dist/components/form/fields/color/Color.d.ts.map +1 -1
- package/dist/components/form/fields/color/Color.js +616 -16
- package/dist/components/form/fields/color/Color.js.map +1 -1
- package/dist/components/form/fields/emittedValues.d.ts +34 -3
- package/dist/components/form/fields/emittedValues.d.ts.map +1 -1
- package/dist/components/form/fields/emittedValues.js +24 -1
- package/dist/components/form/fields/emittedValues.js.map +1 -1
- package/dist/components/form/fields/file/File.d.ts +1 -1
- package/dist/components/form/fields/file/File.d.ts.map +1 -1
- package/dist/components/form/fields/file/File.js +4 -2
- package/dist/components/form/fields/file/File.js.map +1 -1
- package/dist/components/form/fields/long-string/LongString.d.ts +1 -7
- package/dist/components/form/fields/long-string/LongString.d.ts.map +1 -1
- package/dist/components/form/fields/long-string/LongString.js +30 -13
- package/dist/components/form/fields/long-string/LongString.js.map +1 -1
- package/dist/components/form/fields/markdown/MarkdownView.js +1 -1
- package/dist/components/form/fields/multi-select/MultiSelectFormField.d.ts.map +1 -1
- package/dist/components/form/fields/multi-select/MultiSelectFormField.js +10 -7
- package/dist/components/form/fields/multi-select/MultiSelectFormField.js.map +1 -1
- package/dist/components/form/fields/number/Number.d.ts +7 -4
- package/dist/components/form/fields/number/Number.d.ts.map +1 -1
- package/dist/components/form/fields/number/Number.js +45 -18
- package/dist/components/form/fields/number/Number.js.map +1 -1
- package/dist/components/form/fields/object/Object.d.ts +1 -1
- package/dist/components/form/fields/object/Object.d.ts.map +1 -1
- package/dist/components/form/fields/object/Object.js +4 -2
- package/dist/components/form/fields/object/Object.js.map +1 -1
- package/dist/components/form/fields/pendingEdit.d.ts +52 -0
- package/dist/components/form/fields/pendingEdit.d.ts.map +1 -0
- package/dist/components/form/fields/pendingEdit.js +79 -0
- package/dist/components/form/fields/pendingEdit.js.map +1 -0
- package/dist/components/form/fields/radio-group/RadioGroup.d.ts.map +1 -1
- package/dist/components/form/fields/radio-group/RadioGroup.js +8 -13
- package/dist/components/form/fields/radio-group/RadioGroup.js.map +1 -1
- package/dist/components/form/fields/rich-text/RichText.d.ts +20 -1
- package/dist/components/form/fields/rich-text/RichText.d.ts.map +1 -1
- package/dist/components/form/fields/rich-text/RichText.js +426 -91
- package/dist/components/form/fields/rich-text/RichText.js.map +1 -1
- package/dist/components/form/fields/rich-text/useTemplateTags.d.ts +18 -0
- package/dist/components/form/fields/rich-text/useTemplateTags.d.ts.map +1 -0
- package/dist/components/form/fields/rich-text/useTemplateTags.js +80 -0
- package/dist/components/form/fields/rich-text/useTemplateTags.js.map +1 -0
- package/dist/components/form/fields/schema-definition/CatalogLeafForm.d.ts.map +1 -1
- package/dist/components/form/fields/schema-definition/CatalogLeafForm.js +4 -1
- package/dist/components/form/fields/schema-definition/CatalogLeafForm.js.map +1 -1
- package/dist/components/form/fields/schema-definition/CatalogNodeEditor.d.ts.map +1 -1
- package/dist/components/form/fields/schema-definition/CatalogNodeEditor.js +20 -5
- package/dist/components/form/fields/schema-definition/CatalogNodeEditor.js.map +1 -1
- package/dist/components/form/fields/schema-definition/TableEditor.d.ts.map +1 -1
- package/dist/components/form/fields/schema-definition/TableEditor.js +10 -2
- package/dist/components/form/fields/schema-definition/TableEditor.js.map +1 -1
- package/dist/components/form/fields/schema-definition/index.d.ts.map +1 -1
- package/dist/components/form/fields/schema-definition/index.js +8 -4
- package/dist/components/form/fields/schema-definition/index.js.map +1 -1
- package/dist/components/form/fields/select/Select.d.ts +10 -1
- package/dist/components/form/fields/select/Select.d.ts.map +1 -1
- package/dist/components/form/fields/select/Select.js +28 -14
- package/dist/components/form/fields/select/Select.js.map +1 -1
- package/dist/components/form/fields/select/SelectCollection.d.ts +5 -0
- package/dist/components/form/fields/select/SelectCollection.d.ts.map +1 -1
- package/dist/components/form/fields/select/SelectCollection.js +25 -12
- package/dist/components/form/fields/select/SelectCollection.js.map +1 -1
- package/dist/components/form/fields/select/unavailableRow.d.ts +23 -0
- package/dist/components/form/fields/select/unavailableRow.d.ts.map +1 -0
- package/dist/components/form/fields/select/unavailableRow.js +55 -0
- package/dist/components/form/fields/select/unavailableRow.js.map +1 -0
- package/dist/components/form/fields/template/ReadOnlyTemplateTag.d.ts +11 -5
- package/dist/components/form/fields/template/ReadOnlyTemplateTag.d.ts.map +1 -1
- package/dist/components/form/fields/template/ReadOnlyTemplateTag.js +21 -5
- package/dist/components/form/fields/template/ReadOnlyTemplateTag.js.map +1 -1
- package/dist/components/form/fields/template/TemplateBrowser.d.ts +16 -0
- package/dist/components/form/fields/template/TemplateBrowser.d.ts.map +1 -0
- package/dist/components/form/fields/template/TemplateBrowser.js +89 -0
- package/dist/components/form/fields/template/TemplateBrowser.js.map +1 -0
- package/dist/components/form/fields/template/TemplateField.d.ts +105 -1
- package/dist/components/form/fields/template/TemplateField.d.ts.map +1 -1
- package/dist/components/form/fields/template/TemplateField.js +706 -168
- package/dist/components/form/fields/template/TemplateField.js.map +1 -1
- package/dist/components/form/fields/template/TemplatePicker.d.ts +54 -0
- package/dist/components/form/fields/template/TemplatePicker.d.ts.map +1 -0
- package/dist/components/form/fields/template/TemplatePicker.js +459 -0
- package/dist/components/form/fields/template/TemplatePicker.js.map +1 -0
- package/dist/components/form/fields/template/TemplateText.d.ts +0 -17
- package/dist/components/form/fields/template/TemplateText.d.ts.map +1 -1
- package/dist/components/form/fields/template/TemplateText.js +22 -16
- package/dist/components/form/fields/template/TemplateText.js.map +1 -1
- package/dist/components/form/fields/template/referenceNames.d.ts +63 -0
- package/dist/components/form/fields/template/referenceNames.d.ts.map +1 -0
- package/dist/components/form/fields/template/referenceNames.js +69 -0
- package/dist/components/form/fields/template/referenceNames.js.map +1 -0
- package/dist/components/form/fields/template/writtenAsText.d.ts +61 -0
- package/dist/components/form/fields/template/writtenAsText.d.ts.map +1 -0
- package/dist/components/form/fields/template/writtenAsText.js +204 -0
- package/dist/components/form/fields/template/writtenAsText.js.map +1 -0
- package/dist/components/form/index.d.ts +12 -2
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/index.js +25 -3
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/form/typeSentenceForm.d.ts +17 -0
- package/dist/components/form/typeSentenceForm.d.ts.map +1 -0
- package/dist/components/form/typeSentenceForm.js +54 -0
- package/dist/components/form/typeSentenceForm.js.map +1 -0
- package/dist/components/imageLightbox/ImageLightbox.d.ts.map +1 -1
- package/dist/components/imageLightbox/ImageLightbox.js +19 -9
- package/dist/components/imageLightbox/ImageLightbox.js.map +1 -1
- package/dist/components/log/Log.d.ts.map +1 -1
- package/dist/components/log/Log.js +20 -8
- package/dist/components/log/Log.js.map +1 -1
- package/dist/components/menu/Menu.d.ts.map +1 -1
- package/dist/components/menu/Menu.js +19 -10
- package/dist/components/menu/Menu.js.map +1 -1
- package/dist/components/smartEditor/CompletionMenu.d.ts +53 -0
- package/dist/components/smartEditor/CompletionMenu.d.ts.map +1 -0
- package/dist/components/smartEditor/CompletionMenu.js +302 -0
- package/dist/components/smartEditor/CompletionMenu.js.map +1 -0
- package/dist/components/smartEditor/MarkdownDoc.d.ts +1 -1
- package/dist/components/smartEditor/MarkdownDoc.js +3 -3
- package/dist/components/smartEditor/MarkdownDoc.js.map +1 -1
- package/dist/components/smartEditor/SmartEditor.d.ts.map +1 -1
- package/dist/components/smartEditor/SmartEditor.js +616 -190
- package/dist/components/smartEditor/SmartEditor.js.map +1 -1
- package/dist/components/smartEditor/completionStyle.d.ts +28 -0
- package/dist/components/smartEditor/completionStyle.d.ts.map +1 -0
- package/dist/components/smartEditor/completionStyle.js +79 -0
- package/dist/components/smartEditor/completionStyle.js.map +1 -0
- package/dist/components/smartEditor/contextTitle.d.ts +10 -0
- package/dist/components/smartEditor/contextTitle.d.ts.map +1 -0
- package/dist/components/smartEditor/contextTitle.js +21 -0
- package/dist/components/smartEditor/contextTitle.js.map +1 -0
- package/dist/components/smartEditor/editingAids.d.ts +64 -0
- package/dist/components/smartEditor/editingAids.d.ts.map +1 -0
- package/dist/components/smartEditor/editingAids.js +213 -0
- package/dist/components/smartEditor/editingAids.js.map +1 -0
- package/dist/components/smartEditor/index.d.ts +6 -1
- package/dist/components/smartEditor/index.d.ts.map +1 -1
- package/dist/components/smartEditor/index.js +19 -1
- package/dist/components/smartEditor/index.js.map +1 -1
- package/dist/components/smartEditor/templateCompletions.d.ts +98 -0
- package/dist/components/smartEditor/templateCompletions.d.ts.map +1 -0
- package/dist/components/smartEditor/templateCompletions.js +380 -0
- package/dist/components/smartEditor/templateCompletions.js.map +1 -0
- package/dist/components/smartEditor/typedReferences.d.ts +34 -0
- package/dist/components/smartEditor/typedReferences.d.ts.map +1 -0
- package/dist/components/smartEditor/typedReferences.js +179 -0
- package/dist/components/smartEditor/typedReferences.js.map +1 -0
- package/dist/components/smartEditor/types.d.ts +116 -2
- package/dist/components/smartEditor/types.d.ts.map +1 -1
- package/dist/components/smartEditor/useEditingAids.d.ts +38 -0
- package/dist/components/smartEditor/useEditingAids.d.ts.map +1 -0
- package/dist/components/smartEditor/useEditingAids.js +392 -0
- package/dist/components/smartEditor/useEditingAids.js.map +1 -0
- package/dist/components/smartEditor/useLspAutocomplete.d.ts +106 -3
- package/dist/components/smartEditor/useLspAutocomplete.d.ts.map +1 -1
- package/dist/components/smartEditor/useLspAutocomplete.js +592 -149
- package/dist/components/smartEditor/useLspAutocomplete.js.map +1 -1
- package/dist/components/smartEditor/useLspHover.d.ts +33 -7
- package/dist/components/smartEditor/useLspHover.d.ts.map +1 -1
- package/dist/components/smartEditor/useLspHover.js +364 -35
- package/dist/components/smartEditor/useLspHover.js.map +1 -1
- package/dist/components/smartEditor/useLspSemanticTokens.js +1 -1
- package/dist/components/smartEditor/useLspSemanticTokens.js.map +1 -1
- package/dist/components/smartEditor/useLspSession.d.ts +6 -0
- package/dist/components/smartEditor/useLspSession.d.ts.map +1 -1
- package/dist/components/smartEditor/useLspSession.js +7 -6
- package/dist/components/smartEditor/useLspSession.js.map +1 -1
- package/dist/components/smartEditor/useLspSignatureHelp.d.ts.map +1 -1
- package/dist/components/smartEditor/useLspSignatureHelp.js +6 -11
- package/dist/components/smartEditor/useLspSignatureHelp.js.map +1 -1
- package/dist/components/smartEditor/useTabCameIn.d.ts +10 -0
- package/dist/components/smartEditor/useTabCameIn.d.ts.map +1 -0
- package/dist/components/smartEditor/useTabCameIn.js +42 -0
- package/dist/components/smartEditor/useTabCameIn.js.map +1 -0
- package/dist/components/supportTicket/AttachmentChips.d.ts.map +1 -1
- package/dist/components/supportTicket/AttachmentChips.js +15 -5
- package/dist/components/supportTicket/AttachmentChips.js.map +1 -1
- package/dist/components/supportTicket/InterfaceReferenceTags.d.ts +2 -3
- package/dist/components/supportTicket/InterfaceReferenceTags.d.ts.map +1 -1
- package/dist/components/supportTicket/InterfaceReferenceTags.js.map +1 -1
- package/dist/components/supportTicket/ReferencePicker.d.ts +9 -3
- package/dist/components/supportTicket/ReferencePicker.d.ts.map +1 -1
- package/dist/components/supportTicket/ReferencePicker.js +38 -23
- package/dist/components/supportTicket/ReferencePicker.js.map +1 -1
- package/dist/components/supportTicket/TicketHeader.d.ts +3 -4
- package/dist/components/supportTicket/TicketHeader.d.ts.map +1 -1
- package/dist/components/supportTicket/TicketHeader.js +21 -6
- package/dist/components/supportTicket/TicketHeader.js.map +1 -1
- package/dist/components/supportTicket/TicketMetaTags.d.ts +1 -1
- package/dist/components/supportTicket/TicketReplyBox.d.ts.map +1 -1
- package/dist/components/supportTicket/TicketReplyBox.js +10 -29
- package/dist/components/supportTicket/TicketReplyBox.js.map +1 -1
- package/dist/components/supportTicket/useLoadedImages.d.ts +0 -10
- package/dist/components/supportTicket/useLoadedImages.d.ts.map +1 -1
- package/dist/components/supportTicket/useLoadedImages.js +1 -63
- package/dist/components/supportTicket/useLoadedImages.js.map +1 -1
- package/dist/components/ticketReferences/TicketReferences.d.ts.map +1 -1
- package/dist/components/ticketReferences/TicketReferences.js +10 -9
- package/dist/components/ticketReferences/TicketReferences.js.map +1 -1
- package/dist/components/ticketThread/TicketThread.d.ts.map +1 -1
- package/dist/components/ticketThread/TicketThread.js +52 -21
- package/dist/components/ticketThread/TicketThread.js.map +1 -1
- package/dist/helpers/allowedValues.d.ts +21 -12
- package/dist/helpers/allowedValues.d.ts.map +1 -1
- package/dist/helpers/allowedValues.js +40 -20
- package/dist/helpers/allowedValues.js.map +1 -1
- package/dist/helpers/descriptionTooltip.d.ts +46 -0
- package/dist/helpers/descriptionTooltip.d.ts.map +1 -0
- package/dist/helpers/descriptionTooltip.js +76 -0
- package/dist/helpers/descriptionTooltip.js.map +1 -0
- package/dist/helpers/domProps.d.ts +5 -0
- package/dist/helpers/domProps.d.ts.map +1 -0
- package/dist/helpers/domProps.js +47 -0
- package/dist/helpers/domProps.js.map +1 -0
- package/dist/helpers/expressions.d.ts +115 -4
- package/dist/helpers/expressions.d.ts.map +1 -1
- package/dist/helpers/expressions.js +247 -29
- package/dist/helpers/expressions.js.map +1 -1
- package/dist/helpers/hoveringPointer.d.ts +26 -0
- package/dist/helpers/hoveringPointer.d.ts.map +1 -0
- package/dist/helpers/hoveringPointer.js +29 -0
- package/dist/helpers/hoveringPointer.js.map +1 -0
- package/dist/helpers/markdownText.d.ts +14 -0
- package/dist/helpers/markdownText.d.ts.map +1 -0
- package/dist/helpers/markdownText.js +160 -0
- package/dist/helpers/markdownText.js.map +1 -0
- package/dist/helpers/noDescription.d.ts +9 -0
- package/dist/helpers/noDescription.d.ts.map +1 -0
- package/dist/helpers/noDescription.js +13 -0
- package/dist/helpers/noDescription.js.map +1 -0
- package/dist/helpers/optionUiTypes.d.ts +2 -2
- package/dist/helpers/qorusTypeCatalogue.d.ts +147 -0
- package/dist/helpers/qorusTypeCatalogue.d.ts.map +1 -0
- package/dist/helpers/qorusTypeCatalogue.js +505 -0
- package/dist/helpers/qorusTypeCatalogue.js.map +1 -0
- package/dist/helpers/readableColors.d.ts +36 -0
- package/dist/helpers/readableColors.d.ts.map +1 -0
- package/dist/helpers/readableColors.js +116 -0
- package/dist/helpers/readableColors.js.map +1 -0
- package/dist/helpers/recordFieldReference.d.ts +15 -0
- package/dist/helpers/recordFieldReference.d.ts.map +1 -0
- package/dist/helpers/recordFieldReference.js +89 -0
- package/dist/helpers/recordFieldReference.js.map +1 -0
- package/dist/helpers/singleLineString.d.ts.map +1 -1
- package/dist/helpers/singleLineString.js +0 -1
- package/dist/helpers/singleLineString.js.map +1 -1
- package/dist/helpers/templateCatalogue.d.ts +104 -0
- package/dist/helpers/templateCatalogue.d.ts.map +1 -0
- package/dist/helpers/templateCatalogue.js +116 -0
- package/dist/helpers/templateCatalogue.js.map +1 -0
- package/dist/helpers/templateCatalogueContext.d.ts +19 -0
- package/dist/helpers/templateCatalogueContext.d.ts.map +1 -0
- package/dist/helpers/templateCatalogueContext.js +31 -0
- package/dist/helpers/templateCatalogueContext.js.map +1 -0
- package/dist/helpers/templateItems.d.ts +2 -2
- package/dist/helpers/templateItems.d.ts.map +1 -1
- package/dist/helpers/templateItems.js +6 -4
- package/dist/helpers/templateItems.js.map +1 -1
- package/dist/helpers/templateText.d.ts +1 -0
- package/dist/helpers/templateText.d.ts.map +1 -1
- package/dist/helpers/templateText.js +7 -3
- package/dist/helpers/templateText.js.map +1 -1
- package/dist/helpers/templateTree.d.ts +248 -0
- package/dist/helpers/templateTree.d.ts.map +1 -0
- package/dist/helpers/templateTree.js +892 -0
- package/dist/helpers/templateTree.js.map +1 -0
- package/dist/helpers/templateType.d.ts +28 -0
- package/dist/helpers/templateType.d.ts.map +1 -0
- package/dist/helpers/templateType.js +30 -0
- package/dist/helpers/templateType.js.map +1 -0
- package/dist/helpers/templates.d.ts +86 -16
- package/dist/helpers/templates.d.ts.map +1 -1
- package/dist/helpers/templates.js +305 -45
- package/dist/helpers/templates.js.map +1 -1
- package/dist/helpers/validations.d.ts +27 -0
- package/dist/helpers/validations.d.ts.map +1 -1
- package/dist/helpers/validations.js +169 -39
- package/dist/helpers/validations.js.map +1 -1
- package/dist/helpers/webLink.d.ts +8 -0
- package/dist/helpers/webLink.d.ts.map +1 -0
- package/dist/helpers/webLink.js +29 -0
- package/dist/helpers/webLink.js.map +1 -0
- package/dist/hooks/useQorusTypes.d.ts +12 -17
- package/dist/hooks/useQorusTypes.d.ts.map +1 -1
- package/dist/hooks/useQorusTypes.js +44 -172
- package/dist/hooks/useQorusTypes.js.map +1 -1
- package/dist/hooks/useReadableIntentShade.d.ts +9 -0
- package/dist/hooks/useReadableIntentShade.d.ts.map +1 -0
- package/dist/hooks/useReadableIntentShade.js +23 -0
- package/dist/hooks/useReadableIntentShade.js.map +1 -0
- package/dist/hooks/useReadableOpacity.d.ts +6 -0
- package/dist/hooks/useReadableOpacity.d.ts.map +1 -0
- package/dist/hooks/useReadableOpacity.js +17 -0
- package/dist/hooks/useReadableOpacity.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -1
- package/dist/index.js.map +1 -1
- package/dist/tracking/ui/ExperimentCard.d.ts +1 -1
- package/dist/tracking/ui/ExperimentCard.d.ts.map +1 -1
- package/dist/tracking/ui/ExperimentCard.js +26 -10
- package/dist/tracking/ui/ExperimentCard.js.map +1 -1
- package/dist/tracking/ui/card.d.ts +2 -2
- package/dist/tracking/ui/card.d.ts.map +1 -1
- package/dist/tracking/ui/card.js +2 -2
- package/dist/tracking/ui/card.js.map +1 -1
- package/dist/tracking/ui/readable.d.ts +14 -0
- package/dist/tracking/ui/readable.d.ts.map +1 -0
- package/dist/tracking/ui/readable.js +60 -0
- package/dist/tracking/ui/readable.js.map +1 -0
- package/dist/utils/fetch.d.ts +9 -2
- package/dist/utils/fetch.d.ts.map +1 -1
- package/dist/utils/fetch.js +6 -5
- package/dist/utils/fetch.js.map +1 -1
- package/dist/utils/lspClient.types.d.ts +2 -0
- package/dist/utils/lspClient.types.d.ts.map +1 -1
- package/dist/utils/websocket.d.ts +65 -2
- package/dist/utils/websocket.d.ts.map +1 -1
- package/dist/utils/websocket.js +276 -44
- package/dist/utils/websocket.js.map +1 -1
- package/package.json +14 -6
- package/.claude/CLAUDE.md +0 -317
- package/.tasks/EXPORT_EXPRESSION_BUILDER.md +0 -38
- package/.tasks/EXPRESSION_BUILDER_REPORT.md +0 -149
- package/.tasks/EXPRESSION_FIELD_SEAMS.md +0 -66
- package/.tasks/FIELD_STACK_REPORT.md +0 -234
- package/.tasks/FORM_ENGINE_COMPACT_READ_FIRST.md +0 -558
- package/.tasks/FORM_ENGINE_EXPRESSIONS.md +0 -197
- package/.tasks/FORM_ENGINE_OPTIONS_SYNC.md +0 -95
- package/.tasks/FORM_FIELD_EXTRAS.md +0 -72
- package/.tasks/INDEX.md +0 -111
- package/.tasks/LSP_SHARED_CONNECTION.md +0 -75
- package/.tasks/QONSOLE_ASSIST_FEATURES.md +0 -306
- package/.tasks/RENDER_EXPRESSION_LSP.md +0 -159
- package/.tasks/REQRAFT_AUTO_FIELD.md +0 -176
- package/.tasks/SCHEMA_DEFINITION_FIELD.md +0 -250
- package/.tasks/SMART_EDITOR_CONTEXT_AND_POLISH.md +0 -340
- package/.tasks/SMART_EDITOR_LSP_FEATURES.md +0 -299
- package/.tasks/SMART_EDITOR_REVIEW_FOLLOWUPS.md +0 -280
- package/.tasks/SMART_EDITOR_UX_POLISH.md +0 -383
- package/.tasks/SMART_EDITOR_VISUAL_POLISH.md +0 -246
- package/.tasks/STORY_NETWORK_ISOLATION.md +0 -98
- package/.tasks/TEMPLATE_TOKEN_GRAMMAR.md +0 -72
- package/CODE_OF_CONDUCT.md +0 -105
- package/CONTRIBUTING.MD +0 -78
- package/SECURITY.md +0 -3
- package/chromatic.config.json +0 -5
- package/design/COMPACT_ENGINE_REDESIGN.md +0 -156
- package/design/COMPACT_INFO_DISPLAY.md +0 -87
- package/design/COMPACT_PARITY.md +0 -85
- package/design/EXPRESSION_BUILDER_REPORT_STRATEGY.md +0 -92
- package/design/FORM_ENGINE_COMPACT.md +0 -300
- package/design/FORM_ENGINE_COMPACT_UX_PLAN.md +0 -353
- package/design/FORM_ENGINE_EXPRESSIONS.md +0 -257
- package/design/FORM_ENGINE_FIELD_MIGRATION.md +0 -419
- package/design/IDE_INTEGRATION.md +0 -64
- package/design/RENDER_EXPRESSION_TRANSPORT.md +0 -156
- package/design/SELECT_DIALOG_FLOOR.md +0 -86
- package/design/SMART_EDITOR_UX.md +0 -438
- package/design/TRACKING.md +0 -290
- package/design/UNAVAILABLE_ALLOWED_VALUES.md +0 -226
- package/dist/components/form/engine/formAppearance.d.ts +0 -49
- package/dist/components/form/engine/formAppearance.d.ts.map +0 -1
- package/dist/components/form/engine/formAppearance.js +0 -50
- package/dist/components/form/engine/formAppearance.js.map +0 -1
- package/dist/components/form/fields/ChoiceGroupHeading.d.ts +0 -21
- package/dist/components/form/fields/ChoiceGroupHeading.d.ts.map +0 -1
- package/dist/components/form/fields/ChoiceGroupHeading.js +0 -33
- package/dist/components/form/fields/ChoiceGroupHeading.js.map +0 -1
- package/dist/components/form/fields/allowed-values/savedValues.d.ts +0 -30
- package/dist/components/form/fields/allowed-values/savedValues.d.ts.map +0 -1
- package/dist/components/form/fields/allowed-values/savedValues.js +0 -39
- package/dist/components/form/fields/allowed-values/savedValues.js.map +0 -1
- package/dist/helpers/fieldDescription.d.ts +0 -16
- package/dist/helpers/fieldDescription.d.ts.map +0 -1
- package/dist/helpers/fieldDescription.js +0 -40
- package/dist/helpers/fieldDescription.js.map +0 -1
- package/src/components/Description/index.tsx +0 -254
- package/src/components/Description/markdownRendererContext.tsx +0 -29
- package/src/components/FocusedEditing/index.tsx +0 -50
- package/src/components/codeSize/index.tsx +0 -79
- package/src/components/composer/Composer.stories.tsx +0 -238
- package/src/components/composer/Composer.tsx +0 -554
- package/src/components/composer/helpers.ts +0 -74
- package/src/components/composer/index.ts +0 -2
- package/src/components/dpqlEditor/DpqlEditor.stories.tsx +0 -1183
- package/src/components/dpqlEditor/DpqlEditor.tsx +0 -219
- package/src/components/dpqlEditor/dpqlHelpers.ts +0 -287
- package/src/components/dpqlEditor/dpqlInserter.ts +0 -121
- package/src/components/dpqlEditor/dpqlProbe.ts +0 -165
- package/src/components/dpqlEditor/dpqlTags.ts +0 -114
- package/src/components/dpqlEditor/index.ts +0 -41
- package/src/components/dpqlEditor/types.ts +0 -203
- package/src/components/dpqlEditor/useDpqlProbe.ts +0 -33
- package/src/components/dpqlEditor/useDpqlSession.ts +0 -411
- package/src/components/form/engine/CompactRow.tsx +0 -2740
- package/src/components/form/engine/CompactToolbar.tsx +0 -399
- package/src/components/form/engine/FormEngine.stories.tsx +0 -9934
- package/src/components/form/engine/FormEngine.tsx +0 -4891
- package/src/components/form/engine/FormEngineAppearance.stories.tsx +0 -609
- package/src/components/form/engine/FormEngineRemote.stories.tsx +0 -679
- package/src/components/form/engine/FormEngineStickyHeaders.stories.tsx +0 -335
- package/src/components/form/engine/FormFieldsSkeleton.tsx +0 -82
- package/src/components/form/engine/OptionFieldMessages.tsx +0 -548
- package/src/components/form/engine/OptionsHelpDialog.tsx +0 -29
- package/src/components/form/engine/__fixtures__/basicFormOptions.ts +0 -309
- package/src/components/form/engine/__fixtures__/fieldChromeOptions.ts +0 -45
- package/src/components/form/engine/_structuredData/SchemaDataView.stories.tsx +0 -233
- package/src/components/form/engine/_structuredData/SchemaDataView.tsx +0 -755
- package/src/components/form/engine/_structuredData/StructuredDataView.stories.tsx +0 -85
- package/src/components/form/engine/_structuredData/StructuredDataView.tsx +0 -75
- package/src/components/form/engine/_structuredData/structuredData.ts +0 -145
- package/src/components/form/engine/compactRowContext.ts +0 -153
- package/src/components/form/engine/compactRowStyles.ts +0 -1087
- package/src/components/form/engine/compactToolbarContext.ts +0 -72
- package/src/components/form/engine/formAppearance.ts +0 -79
- package/src/components/form/engine/optionActions.ts +0 -128
- package/src/components/form/engine/optionsContext.ts +0 -24
- package/src/components/form/engine/readFirst.ts +0 -1090
- package/src/components/form/engine/rendererTypes.ts +0 -107
- package/src/components/form/engine/revealRow.ts +0 -123
- package/src/components/form/engine/rowFocus.ts +0 -112
- package/src/components/form/engine/rowMenuContext.ts +0 -159
- package/src/components/form/engine/rowOpenPicker.ts +0 -27
- package/src/components/form/engine/typeChoices.ts +0 -63
- package/src/components/form/engine/variants/FormEngineVariants.stories.tsx +0 -159
- package/src/components/form/engine/variants/VariantCalmTable.tsx +0 -244
- package/src/components/form/engine/variants/VariantCards.tsx +0 -212
- package/src/components/form/engine/variants/VariantFocus.tsx +0 -382
- package/src/components/form/engine/variants/VariantMinimal.tsx +0 -170
- package/src/components/form/engine/variants/focusDemo.ts +0 -145
- package/src/components/form/engine/variants/variantModel.ts +0 -223
- package/src/components/form/engine/variants/variantParts.tsx +0 -313
- package/src/components/form/expressions/DpqlRendering.tsx +0 -85
- package/src/components/form/expressions/ExpressionField.stories.tsx +0 -1395
- package/src/components/form/expressions/ExpressionField.tsx +0 -503
- package/src/components/form/expressions/argumentPresence.ts +0 -213
- package/src/components/form/expressions/builder/ExpressionBuilder.stories.tsx +0 -1683
- package/src/components/form/expressions/builder/argumentDetail.tsx +0 -17
- package/src/components/form/expressions/builder/argumentLabel.tsx +0 -146
- package/src/components/form/expressions/builder/argumentSlot.tsx +0 -101
- package/src/components/form/expressions/builder/argumentWrapper.tsx +0 -243
- package/src/components/form/expressions/builder/confirmMismatchedTypesModal.tsx +0 -120
- package/src/components/form/expressions/builder/confirmUnsupportedTypeModal.tsx +0 -69
- package/src/components/form/expressions/builder/index.tsx +0 -1545
- package/src/components/form/expressions/builder/item.tsx +0 -89
- package/src/components/form/expressions/builder/moveToPositionStrip.tsx +0 -156
- package/src/components/form/expressions/builder/renderTemplate.tsx +0 -42
- package/src/components/form/expressions/dpqlMockLanguage.ts +0 -566
- package/src/components/form/expressions/dpqlMockLsp.ts +0 -126
- package/src/components/form/expressions/mockExpressions.ts +0 -317
- package/src/components/form/expressions/renderExpressionToText.ts +0 -152
- package/src/components/form/expressions/types.ts +0 -110
- package/src/components/form/expressions/useExpressions.ts +0 -101
- package/src/components/form/expressions/useRenderExpression.ts +0 -165
- package/src/components/form/fields/ChoiceGroupHeading.tsx +0 -38
- package/src/components/form/fields/Field.stories.tsx +0 -143
- package/src/components/form/fields/Field.tsx +0 -734
- package/src/components/form/fields/allowed-values/AllowedValues.tsx +0 -321
- package/src/components/form/fields/allowed-values/savedValues.ts +0 -64
- package/src/components/form/fields/array/ArrayAuto.tsx +0 -237
- package/src/components/form/fields/array/ArrayAutoField.stories.tsx +0 -475
- package/src/components/form/fields/array/ArrayAutoField.tsx +0 -367
- package/src/components/form/fields/auto/AutoFormField.stories.tsx +0 -825
- package/src/components/form/fields/auto/AutoFormField.tsx +0 -1183
- package/src/components/form/fields/binary/Binary.stories.tsx +0 -122
- package/src/components/form/fields/binary/Binary.tsx +0 -91
- package/src/components/form/fields/boolean/Boolean.stories.tsx +0 -125
- package/src/components/form/fields/boolean/Boolean.tsx +0 -34
- package/src/components/form/fields/byte-size/ByteSize.stories.tsx +0 -87
- package/src/components/form/fields/byte-size/ByteSize.tsx +0 -58
- package/src/components/form/fields/color/Color.stories.tsx +0 -99
- package/src/components/form/fields/color/Color.tsx +0 -46
- package/src/components/form/fields/cron/Cron.stories.tsx +0 -68
- package/src/components/form/fields/cron/Cron.tsx +0 -80
- package/src/components/form/fields/date/Date.stories.tsx +0 -77
- package/src/components/form/fields/date/Date.tsx +0 -55
- package/src/components/form/fields/emittedValues.ts +0 -70
- package/src/components/form/fields/file/File.stories.tsx +0 -161
- package/src/components/form/fields/file/File.tsx +0 -227
- package/src/components/form/fields/long-string/LongString.stories.tsx +0 -147
- package/src/components/form/fields/long-string/LongString.tsx +0 -141
- package/src/components/form/fields/markdown/Markdown.stories.tsx +0 -76
- package/src/components/form/fields/markdown/Markdown.tsx +0 -81
- package/src/components/form/fields/markdown/MarkdownView.tsx +0 -222
- package/src/components/form/fields/multi-select/MultiSelectFormField.tsx +0 -140
- package/src/components/form/fields/number/Number.stories.tsx +0 -159
- package/src/components/form/fields/number/Number.tsx +0 -175
- package/src/components/form/fields/object/Object.stories.tsx +0 -398
- package/src/components/form/fields/object/Object.tsx +0 -255
- package/src/components/form/fields/radio-group/RadioGroup.stories.tsx +0 -95
- package/src/components/form/fields/radio-group/RadioGroup.tsx +0 -52
- package/src/components/form/fields/radio-group/images/java-96x128.png +0 -0
- package/src/components/form/fields/radio-group/images/python-129x128.png +0 -0
- package/src/components/form/fields/radio-group/images/qore-106x128.png +0 -0
- package/src/components/form/fields/rich-text/RichText.stories.tsx +0 -260
- package/src/components/form/fields/rich-text/RichText.tsx +0 -537
- package/src/components/form/fields/schema-definition/CatalogLeafForm.tsx +0 -242
- package/src/components/form/fields/schema-definition/CatalogNodeEditor.tsx +0 -758
- package/src/components/form/fields/schema-definition/Hint.tsx +0 -22
- package/src/components/form/fields/schema-definition/InlineValidationBanner.tsx +0 -138
- package/src/components/form/fields/schema-definition/Loader.tsx +0 -20
- package/src/components/form/fields/schema-definition/MigrationsTab.tsx +0 -187
- package/src/components/form/fields/schema-definition/SchemaDefinitionField.stories.tsx +0 -286
- package/src/components/form/fields/schema-definition/TableEditor.tsx +0 -155
- package/src/components/form/fields/schema-definition/TablesTab.tsx +0 -138
- package/src/components/form/fields/schema-definition/catalog.ts +0 -237
- package/src/components/form/fields/schema-definition/helpers.ts +0 -90
- package/src/components/form/fields/schema-definition/index.tsx +0 -418
- package/src/components/form/fields/schema-definition/mockCatalog.ts +0 -325
- package/src/components/form/fields/schema-definition/mockDefinition.ts +0 -111
- package/src/components/form/fields/schema-definition/referenceSuggestions.tsx +0 -152
- package/src/components/form/fields/schema-definition/starterTemplate.ts +0 -68
- package/src/components/form/fields/schema-definition/types.ts +0 -185
- package/src/components/form/fields/schema-definition/useSchemaOptionCatalog.ts +0 -49
- package/src/components/form/fields/select/Select.stories.tsx +0 -872
- package/src/components/form/fields/select/Select.tsx +0 -624
- package/src/components/form/fields/select/SelectCollection.tsx +0 -594
- package/src/components/form/fields/string/String.stories.tsx +0 -86
- package/src/components/form/fields/string/String.tsx +0 -43
- package/src/components/form/fields/template/ExampleValueModal.stories.tsx +0 -114
- package/src/components/form/fields/template/ExampleValueModal.tsx +0 -99
- package/src/components/form/fields/template/ReadOnlyTemplateTag.tsx +0 -47
- package/src/components/form/fields/template/TemplateField.stories.tsx +0 -1121
- package/src/components/form/fields/template/TemplateField.tsx +0 -1749
- package/src/components/form/fields/template/TemplateText.tsx +0 -115
- package/src/components/form/fields/template/__fixtures__/longExampleValue.ts +0 -7
- package/src/components/form/fields/template/__fixtures__/multiLevelTemplates.json +0 -147
- package/src/components/form/fields/template/__fixtures__/templates.json +0 -83
- package/src/components/form/fields/timeout/Timeout.stories.tsx +0 -228
- package/src/components/form/fields/timeout/Timeout.tsx +0 -87
- package/src/components/form/fields/url/Url.stories.tsx +0 -94
- package/src/components/form/fields/url/Url.tsx +0 -85
- package/src/components/form/index.tsx +0 -49
- package/src/components/imageLightbox/ImageLightbox.stories.tsx +0 -238
- package/src/components/imageLightbox/ImageLightbox.tsx +0 -238
- package/src/components/imageLightbox/index.ts +0 -1
- package/src/components/log/Log.stories.tsx +0 -333
- package/src/components/log/Log.tsx +0 -285
- package/src/components/menu/Menu.stories.tsx +0 -155
- package/src/components/menu/Menu.tsx +0 -312
- package/src/components/qonsoleSmartInput/QonsoleSmartInput.stories.tsx +0 -797
- package/src/components/qonsoleSmartInput/QonsoleSmartInput.tsx +0 -105
- package/src/components/qonsoleSmartInput/index.ts +0 -16
- package/src/components/qonsoleSmartInput/qonsoleInserter.ts +0 -77
- package/src/components/qonsoleSmartInput/types.ts +0 -133
- package/src/components/qonsoleSmartInput/useQonsoleSession.ts +0 -124
- package/src/components/searchFilterBar/SearchFilterBar.stories.tsx +0 -62
- package/src/components/searchFilterBar/SearchFilterBar.tsx +0 -144
- package/src/components/searchFilterBar/index.ts +0 -1
- package/src/components/smartEditor/MarkdownDoc.tsx +0 -190
- package/src/components/smartEditor/SmartEditor.stories.tsx +0 -475
- package/src/components/smartEditor/SmartEditor.tsx +0 -808
- package/src/components/smartEditor/__fixtures__/mockLspServer.ts +0 -205
- package/src/components/smartEditor/helpers.ts +0 -217
- package/src/components/smartEditor/index.ts +0 -35
- package/src/components/smartEditor/styling.ts +0 -45
- package/src/components/smartEditor/types.ts +0 -211
- package/src/components/smartEditor/useLspAutocomplete.ts +0 -758
- package/src/components/smartEditor/useLspDiagnosticDecorations.ts +0 -125
- package/src/components/smartEditor/useLspHover.ts +0 -230
- package/src/components/smartEditor/useLspSemanticTokens.ts +0 -298
- package/src/components/smartEditor/useLspSession.ts +0 -231
- package/src/components/smartEditor/useLspSignatureHelp.ts +0 -198
- package/src/components/supportTicket/AttachmentChips.stories.tsx +0 -171
- package/src/components/supportTicket/AttachmentChips.tsx +0 -147
- package/src/components/supportTicket/InterfaceReferenceTags.stories.tsx +0 -257
- package/src/components/supportTicket/InterfaceReferenceTags.tsx +0 -130
- package/src/components/supportTicket/ReferencePicker.stories.tsx +0 -580
- package/src/components/supportTicket/ReferencePicker.tsx +0 -573
- package/src/components/supportTicket/TicketConversation.stories.tsx +0 -120
- package/src/components/supportTicket/TicketHeader.stories.tsx +0 -183
- package/src/components/supportTicket/TicketHeader.tsx +0 -248
- package/src/components/supportTicket/TicketMetaTags.stories.tsx +0 -103
- package/src/components/supportTicket/TicketMetaTags.tsx +0 -85
- package/src/components/supportTicket/TicketReplyBox.stories.tsx +0 -357
- package/src/components/supportTicket/TicketReplyBox.tsx +0 -172
- package/src/components/supportTicket/__fixtures__/kindMarks.ts +0 -28
- package/src/components/supportTicket/attachmentAccess.ts +0 -97
- package/src/components/supportTicket/fileToAttachment.ts +0 -24
- package/src/components/supportTicket/index.ts +0 -10
- package/src/components/supportTicket/meta.ts +0 -206
- package/src/components/supportTicket/ticketModel.ts +0 -131
- package/src/components/supportTicket/useLoadedImages.ts +0 -93
- package/src/components/ticketReferences/TicketReferences.stories.tsx +0 -341
- package/src/components/ticketReferences/TicketReferences.tsx +0 -914
- package/src/components/ticketReferences/index.ts +0 -2
- package/src/components/ticketThread/TicketThread.stories.tsx +0 -898
- package/src/components/ticketThread/TicketThread.tsx +0 -706
- package/src/components/ticketThread/index.ts +0 -6
- package/src/contexts/FetchContext.tsx +0 -25
- package/src/contexts/ReqraftContext.tsx +0 -9
- package/src/contexts/StorageContext.tsx +0 -33
- package/src/global.d.ts +0 -4
- package/src/helpers/allowedValues.ts +0 -268
- package/src/helpers/choiceChip.ts +0 -227
- package/src/helpers/common.ts +0 -326
- package/src/helpers/dpqlDetection.ts +0 -209
- package/src/helpers/expressions.ts +0 -140
- package/src/helpers/fieldDescription.ts +0 -39
- package/src/helpers/optionUiTypes.ts +0 -199
- package/src/helpers/options.ts +0 -150
- package/src/helpers/providerValue.ts +0 -125
- package/src/helpers/scrollbar.ts +0 -32
- package/src/helpers/singleLineString.ts +0 -62
- package/src/helpers/templateItems.ts +0 -81
- package/src/helpers/templateText.ts +0 -350
- package/src/helpers/templates.ts +0 -602
- package/src/helpers/validations.ts +0 -2085
- package/src/hooks/useArgSchema.ts +0 -37
- package/src/hooks/useCoarsePointer.ts +0 -30
- package/src/hooks/useFetch/useFetch.stories.tsx +0 -379
- package/src/hooks/useFetch/useFetch.tsx +0 -154
- package/src/hooks/usePhoneViewport.ts +0 -34
- package/src/hooks/useQorusTypes.ts +0 -233
- package/src/hooks/useReqraftProperty.ts +0 -16
- package/src/hooks/useStorage/useStorage.stories.tsx +0 -168
- package/src/hooks/useStorage/useStorage.ts +0 -35
- package/src/hooks/useTemplates.ts +0 -123
- package/src/hooks/useValidation.ts +0 -9
- package/src/hooks/useWebSocket/useWebSocket.ts +0 -224
- package/src/hooks/useWebSocket/useWebsocket.stories.tsx +0 -640
- package/src/hooks/useWhyDidYouUpdate.ts +0 -38
- package/src/index.tsx +0 -86
- package/src/providers/FetchProvider.tsx +0 -40
- package/src/providers/ReqraftProvider.tsx +0 -52
- package/src/providers/StorageProvider.tsx +0 -131
- package/src/stores/currentUser/currentUser.stories.tsx +0 -100
- package/src/stores/currentUser/currentUser.tsx +0 -94
- package/src/stories/Data/fileFieldArgSchema.json +0 -86
- package/src/stories/Tests/utils.ts +0 -320
- package/src/stories/storyNetwork.ts +0 -92
- package/src/stories/tracking.tsx +0 -206
- package/src/tracking/browser/attach.ts +0 -186
- package/src/tracking/browser/env.ts +0 -78
- package/src/tracking/core/consent.ts +0 -37
- package/src/tracking/core/engagement.ts +0 -47
- package/src/tracking/core/experiments.ts +0 -258
- package/src/tracking/core/hash.ts +0 -26
- package/src/tracking/core/ids.ts +0 -25
- package/src/tracking/core/observable.ts +0 -23
- package/src/tracking/core/queue.ts +0 -131
- package/src/tracking/core/sections.ts +0 -166
- package/src/tracking/core/storage.ts +0 -69
- package/src/tracking/core/tracker.ts +0 -417
- package/src/tracking/core/types.ts +0 -162
- package/src/tracking/core/utm.ts +0 -23
- package/src/tracking/index.ts +0 -72
- package/src/tracking/markup.ts +0 -17
- package/src/tracking/react/Experiment.tsx +0 -44
- package/src/tracking/react/TrackingProvider.tsx +0 -56
- package/src/tracking/react/hooks.ts +0 -106
- package/src/tracking/react/index.ts +0 -13
- package/src/tracking/testing.ts +0 -108
- package/src/tracking/ui/ExperimentCard.stories.tsx +0 -296
- package/src/tracking/ui/ExperimentCard.tsx +0 -667
- package/src/tracking/ui/ExperimentsOverlay.stories.tsx +0 -155
- package/src/tracking/ui/ExperimentsOverlay.tsx +0 -437
- package/src/tracking/ui/anchor.ts +0 -180
- package/src/tracking/ui/card.ts +0 -464
- package/src/tracking/ui/client.ts +0 -117
- package/src/tracking/ui/index.ts +0 -77
- package/src/tracking/ui/types.ts +0 -110
- package/src/tracking/ui/useExperimentsAdmin.ts +0 -103
- package/src/types/Form.ts +0 -29
- package/src/types.ts +0 -14
- package/src/utils/datetime.ts +0 -10
- package/src/utils/fetch.ts +0 -457
- package/src/utils/lspClient.ts +0 -711
- package/src/utils/lspClient.types.ts +0 -211
- package/src/utils/queryUnlessCancelled.ts +0 -28
- package/src/utils/websocket.ts +0 -293
- package/vite.config.ts +0 -58
- package/vitest.config.ts +0 -69
|
@@ -97,17 +97,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
97
97
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
98
98
|
};
|
|
99
99
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
100
|
-
exports.FormEngine = exports.getTypeAndCanBeNull = exports.flattenOptions = exports.shouldEmitLocalValue = exports.agreementFromRebuild = exports.isMirrorOfValue = exports.fixOptions = exports.OptionsContext = exports.hasRequiredOptions = exports.getOptionFieldStorageType = exports.fixOperatorValue = exports.getType = exports.inheritedScopeFor = void 0;
|
|
100
|
+
exports.FormEngine = exports.getTypeAndCanBeNull = exports.flattenOptions = exports.shouldEmitLocalValue = exports.mergeOwnEdits = exports.takeHostsAttributes = exports.agreementFromRebuild = exports.isMirrorOfValue = exports.fixOptions = exports.OptionsContext = exports.hasRequiredOptions = exports.getOptionFieldStorageType = exports.fixOperatorValue = exports.getType = exports.inheritedScopeFor = void 0;
|
|
101
101
|
var react_1 = require("react");
|
|
102
102
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
103
103
|
var reqore_1 = require("@qoretechnologies/reqore");
|
|
104
|
+
var readFirstColors_1 = require("./readFirstColors");
|
|
105
|
+
var operatorSummary_1 = require("./operatorSummary");
|
|
106
|
+
var inheritProps_1 = require("./inheritProps");
|
|
107
|
+
var readableColors_1 = require("../../../helpers/readableColors");
|
|
104
108
|
var colors_1 = require("@qoretechnologies/reqore/dist/helpers/colors");
|
|
105
109
|
var argumentPresence_1 = require("../expressions/argumentPresence");
|
|
106
110
|
var typeChoices_1 = require("./typeChoices");
|
|
107
111
|
var optionActions_1 = require("./optionActions");
|
|
108
112
|
var rendererTypes_1 = require("./rendererTypes");
|
|
109
113
|
var revealRow_1 = require("./revealRow");
|
|
110
|
-
var rowFocus_1 = require("./rowFocus");
|
|
111
114
|
var emittedValues_1 = require("../fields/emittedValues");
|
|
112
115
|
var lodash_1 = require("lodash");
|
|
113
116
|
var map_1 = __importDefault(require("lodash/map"));
|
|
@@ -116,11 +119,10 @@ var size_1 = __importDefault(require("lodash/size"));
|
|
|
116
119
|
var react_2 = __importStar(require("react"));
|
|
117
120
|
var react_use_1 = require("react-use");
|
|
118
121
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
119
|
-
var allowedValues_1 = require("../../../helpers/allowedValues");
|
|
120
|
-
var fieldDescription_1 = require("../../../helpers/fieldDescription");
|
|
121
122
|
var common_1 = require("../../../helpers/common");
|
|
122
123
|
var options_1 = require("../../../helpers/options");
|
|
123
124
|
var validations_1 = require("../../../helpers/validations");
|
|
125
|
+
var useCoarsePointer_1 = require("../../../hooks/useCoarsePointer");
|
|
124
126
|
var useQorusTypes_1 = require("../../../hooks/useQorusTypes");
|
|
125
127
|
var useTemplates_1 = require("../../../hooks/useTemplates");
|
|
126
128
|
var fetch_1 = require("../../../utils/fetch");
|
|
@@ -135,51 +137,18 @@ var compactRowContext_1 = require("./compactRowContext");
|
|
|
135
137
|
var compactRowStyles_1 = require("./compactRowStyles");
|
|
136
138
|
var CompactToolbar_1 = require("./CompactToolbar");
|
|
137
139
|
var compactToolbarContext_1 = require("./compactToolbarContext");
|
|
140
|
+
var HiddenFieldsNote_1 = require("./HiddenFieldsNote");
|
|
138
141
|
var OptionFieldMessages_1 = require("./OptionFieldMessages");
|
|
139
142
|
var optionsContext_1 = require("./optionsContext");
|
|
140
143
|
var markdownRendererContext_1 = require("../../Description/markdownRendererContext");
|
|
141
144
|
var OptionsHelpDialog_1 = require("./OptionsHelpDialog");
|
|
142
|
-
var
|
|
145
|
+
var typeSentenceForm_1 = require("../typeSentenceForm");
|
|
146
|
+
var referenceNames_1 = require("../fields/template/referenceNames");
|
|
147
|
+
var qorusTypeCatalogue_1 = require("../../../helpers/qorusTypeCatalogue");
|
|
148
|
+
var allowedValues_1 = require("../../../helpers/allowedValues");
|
|
149
|
+
var rowFocus_1 = require("./rowFocus");
|
|
143
150
|
var optionUiTypes_1 = require("../../../helpers/optionUiTypes");
|
|
144
151
|
var readFirst_1 = require("./readFirst");
|
|
145
|
-
/**
|
|
146
|
-
* Resolve a field's `inherit_props` map against the current available
|
|
147
|
-
* options (plus any values inherited from an outer FormEngine scope),
|
|
148
|
-
* producing a `{ propName: siblingValue }` hash suitable for spreading
|
|
149
|
-
* onto the field's renderer.
|
|
150
|
-
*
|
|
151
|
-
* For each entry `<prop-name-on-renderer> -> <sibling-field-name>`, the
|
|
152
|
-
* sibling's current value is forwarded under the receiving prop name.
|
|
153
|
-
* Lookup order:
|
|
154
|
-
* 1. `availableOptions[siblingName]?.value` — the field's local scope.
|
|
155
|
-
* 2. `inheritedFromParent[siblingName]` — the bag threaded in by an
|
|
156
|
-
* outer FormEngine (see the `inheritedFromParent` prop). Used when
|
|
157
|
-
* a composite field's `arg_schema` sub-form needs to reach a value
|
|
158
|
-
* on an ancestor scope — e.g. a service-method row's `body` picking
|
|
159
|
-
* up `language` from the parent service form.
|
|
160
|
-
* Missing siblings emit `undefined`, which the renderer's prop type can
|
|
161
|
-
* treat as "no hint".
|
|
162
|
-
*
|
|
163
|
-
* Designed to be JSON-pure: no closures, no transformations. Renderers
|
|
164
|
-
* decide how to use the forwarded value (e.g. the consumer-injected
|
|
165
|
-
* `code-editor` renderer maps a `language: "qore"` prop to its
|
|
166
|
-
* highlighter mode).
|
|
167
|
-
*
|
|
168
|
-
* Mirrored in qorus-ide `src/components/Field/systemOptions.tsx`; keep
|
|
169
|
-
* the two in sync (see qorus-ide's `.claude/CLAUDE.md`).
|
|
170
|
-
*/
|
|
171
|
-
var resolveInheritProps = function (inheritProps, availableOptions, inheritedFromParent) {
|
|
172
|
-
var _a;
|
|
173
|
-
if (!inheritProps)
|
|
174
|
-
return {};
|
|
175
|
-
var out = {};
|
|
176
|
-
for (var propName in inheritProps) {
|
|
177
|
-
var siblingName = inheritProps[propName];
|
|
178
|
-
var localValue = (_a = availableOptions === null || availableOptions === void 0 ? void 0 : availableOptions[siblingName]) === null || _a === void 0 ? void 0 : _a.value;
|
|
179
|
-
out[propName] = localValue !== undefined ? localValue : inheritedFromParent === null || inheritedFromParent === void 0 ? void 0 : inheritedFromParent[siblingName];
|
|
180
|
-
}
|
|
181
|
-
return out;
|
|
182
|
-
};
|
|
183
152
|
/** One shared "nothing came down from above" bag. See `inheritedScopeFor`. */
|
|
184
153
|
var NO_INHERITED_SCOPE = Object.freeze({});
|
|
185
154
|
/**
|
|
@@ -210,7 +179,7 @@ var NO_INHERITED_SCOPE = Object.freeze({});
|
|
|
210
179
|
* @param inheritedFromParent the bag threaded in from an outer form
|
|
211
180
|
*/
|
|
212
181
|
var inheritedScopeFor = function (inheritProps, availableOptions, inheritedFromParent) {
|
|
213
|
-
var resolved = resolveInheritProps(inheritProps, availableOptions, inheritedFromParent);
|
|
182
|
+
var resolved = (0, inheritProps_1.resolveInheritProps)(inheritProps, availableOptions, inheritedFromParent);
|
|
214
183
|
if (!Object.keys(resolved).length) {
|
|
215
184
|
return inheritedFromParent !== null && inheritedFromParent !== void 0 ? inheritedFromParent : NO_INHERITED_SCOPE;
|
|
216
185
|
}
|
|
@@ -232,7 +201,7 @@ var PositiveColorEffect = {
|
|
|
232
201
|
glow: 'success',
|
|
233
202
|
};
|
|
234
203
|
// Compact (read-first) layout: flat label | value | action rows in collapsible
|
|
235
|
-
// group panels;
|
|
204
|
+
// group panels; colors come in as props so the layout follows the Reqore theme.
|
|
236
205
|
var StyledCompactWrap = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n flex-flow: column;\n gap: 10px;\n width: 100%;\n /* Allow the wrap to shrink inside flex/grid parents so its rows' ellipsis can\n engage instead of overflowing the container horizontally. */\n min-width: 0;\n max-width: 100%;\n\n /* Scroll ownership \u2014 see `compactScroll`.\n\n 'host' (the default): the page or panel around us already scrolls, so we\n must not cap our height and scroll our own body, or the reader gets two\n scrollbars in two styles and cannot tell which moves what.\n\n `overflow-x: clip`, NOT `hidden`: CSS coerces an `overflow-y: visible`\n to `auto` whenever the other axis is neither visible nor clip, which would\n leave this box a scroll container \u2014 the element stops scrolling only\n because `max-height: none` means nothing overflows, while `position:\n sticky` inside it still resolves against US instead of the host, so the\n toolbar silently stops pinning. `clip` keeps the horizontal guard without\n that coercion. */\n ", "\n\n /* Option logos (e.g. language images) render as <img> inside ReqoreIcon's\n square box; constrain them so portrait PNGs don't overflow the row. */\n .reqore-icon img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n"], ["\n display: flex;\n flex-flow: column;\n gap: 10px;\n width: 100%;\n /* Allow the wrap to shrink inside flex/grid parents so its rows' ellipsis can\n engage instead of overflowing the container horizontally. */\n min-width: 0;\n max-width: 100%;\n\n /* Scroll ownership \u2014 see \\`compactScroll\\`.\n\n 'host' (the default): the page or panel around us already scrolls, so we\n must not cap our height and scroll our own body, or the reader gets two\n scrollbars in two styles and cannot tell which moves what.\n\n \\`overflow-x: clip\\`, NOT \\`hidden\\`: CSS coerces an \\`overflow-y: visible\\`\n to \\`auto\\` whenever the other axis is neither visible nor clip, which would\n leave this box a scroll container \u2014 the element stops scrolling only\n because \\`max-height: none\\` means nothing overflows, while \\`position:\n sticky\\` inside it still resolves against US instead of the host, so the\n toolbar silently stops pinning. \\`clip\\` keeps the horizontal guard without\n that coercion. */\n ", "\n\n /* Option logos (e.g. language images) render as <img> inside ReqoreIcon's\n square box; constrain them so portrait PNGs don't overflow the row. */\n .reqore-icon img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n }\n"])), function (_a) {
|
|
237
206
|
var $ownScroll = _a.$ownScroll;
|
|
238
207
|
return $ownScroll ? (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n /* 'own': we are the scroller. The sticky toolbar pins to whatever\n scrolls, so a host whose scrollport carries top padding would\n resolve sticky `top: 0` against its padding box and leave an\n unblurred strip above the toolbar. Scrolling in this unpadded box\n pins it flush. Cap at the host's available height, but do not grow\n to fill it \u2014 short forms still hug their content.\n\n `min-height: 0` is what lets a flex item shrink below its content\n so there is something to scroll; it belongs to this branch only. */\n min-height: 0;\n max-height: 100%;\n overflow-y: auto;\n overflow-x: hidden;\n "], ["\n /* 'own': we are the scroller. The sticky toolbar pins to whatever\n scrolls, so a host whose scrollport carries top padding would\n resolve sticky \\`top: 0\\` against its padding box and leave an\n unblurred strip above the toolbar. Scrolling in this unpadded box\n pins it flush. Cap at the host's available height, but do not grow\n to fill it \u2014 short forms still hug their content.\n\n \\`min-height: 0\\` is what lets a flex item shrink below its content\n so there is something to scroll; it belongs to this branch only. */\n min-height: 0;\n max-height: 100%;\n overflow-y: auto;\n overflow-x: hidden;\n "]))) : (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n /* `min-height: auto` is load-bearing, not a default: inside a column\n flex parent the shrink allowance above collapses this box to zero\n height while its rows paint outside it, so the form looks right but\n contributes nothing to layout \u2014 the host cannot size or scroll to\n it and anything below it stacks against nothing. */\n min-height: auto;\n max-height: none;\n overflow-y: visible;\n overflow-x: clip;\n "], ["\n /* \\`min-height: auto\\` is load-bearing, not a default: inside a column\n flex parent the shrink allowance above collapses this box to zero\n height while its rows paint outside it, so the form looks right but\n contributes nothing to layout \u2014 the host cannot size or scroll to\n it and anything below it stacks against nothing. */\n min-height: auto;\n max-height: none;\n overflow-y: visible;\n overflow-x: clip;\n "])));
|
|
@@ -435,6 +404,34 @@ var normalizeEmptyFieldValues = function (fields) {
|
|
|
435
404
|
return acc;
|
|
436
405
|
}, {});
|
|
437
406
|
};
|
|
407
|
+
/**
|
|
408
|
+
* The value as a host can hand it back: each field as its value, and the fields that hold nothing left out.
|
|
409
|
+
*
|
|
410
|
+
* A report of the form's is recognised by what it says, not by how the host writes it back. A host that
|
|
411
|
+
* stores only the fields holding a value (the Qorus IDE's editors) hands a report back without its empty
|
|
412
|
+
* fields; one that stores a field under its own type (the IDE stores what an `int` field reported as a
|
|
413
|
+
* `string`) hands it back with that type. Compared field for field, type and all, the report never came
|
|
414
|
+
* back as itself:
|
|
415
|
+
* - the form took it for the host's own change and went back to it, losing what had been typed since, and
|
|
416
|
+
* the two chased each other's reports on every echo;
|
|
417
|
+
* - an edit back to a value reported before (A, then B, then A again), made as the echo of B arrived, was
|
|
418
|
+
* held back as made before the host's change, and the field went back to B (qorus#646: a template
|
|
419
|
+
* field's text, deleted back to its reference, kept the text in the IDE).
|
|
420
|
+
*
|
|
421
|
+
* For recognising a value only. Whether a rebuild adds anything is still read with the empty fields in
|
|
422
|
+
* (`isMirrorOfValue`): a new schema's empty required field is a row the form has to add.
|
|
423
|
+
*/
|
|
424
|
+
var reportedValues = function (fields) {
|
|
425
|
+
return (0, reduce_1.default)(fields || {}, function (acc, field, name) {
|
|
426
|
+
var fieldValue = comparableField(field);
|
|
427
|
+
if (fieldValue !== undefined) {
|
|
428
|
+
acc[name] = fieldValue;
|
|
429
|
+
}
|
|
430
|
+
return acc;
|
|
431
|
+
}, {});
|
|
432
|
+
};
|
|
433
|
+
/** The same value, as a report coming back from a host is recognised. */
|
|
434
|
+
var sameReportedValue = function (a, b) { return (0, lodash_1.isEqual)(reportedValues(a), reportedValues(b)); };
|
|
438
435
|
/**
|
|
439
436
|
* Does this rebuild say anything the parent does not already hold?
|
|
440
437
|
*
|
|
@@ -464,6 +461,118 @@ var agreementFromRebuild = function (fixedValue, value) {
|
|
|
464
461
|
return (0, exports.isMirrorOfValue)(fixedValue, value) ? fixedValue : undefined;
|
|
465
462
|
};
|
|
466
463
|
exports.agreementFromRebuild = agreementFromRebuild;
|
|
464
|
+
/**
|
|
465
|
+
* A field as the form compares one host value with another: an empty field ('' or none, whatever its type) is
|
|
466
|
+
* the same as no field, and a field is its value, however it is written (`{ type, value }` or the bare value).
|
|
467
|
+
*/
|
|
468
|
+
var comparableField = function (field) {
|
|
469
|
+
var fieldValue = field !== null && typeof field === 'object' && !Array.isArray(field) && 'value' in field ?
|
|
470
|
+
field.value
|
|
471
|
+
: field !== null && typeof field === 'object' && !Array.isArray(field) && 'type' in field ?
|
|
472
|
+
undefined
|
|
473
|
+
: field;
|
|
474
|
+
return fieldValue === '' ? undefined : fieldValue;
|
|
475
|
+
};
|
|
476
|
+
var sameField = function (a, b) {
|
|
477
|
+
return (0, lodash_1.isEqual)(comparableField(a), comparableField(b));
|
|
478
|
+
};
|
|
479
|
+
/** A field written as `{ type, value }`, not a bare value. */
|
|
480
|
+
var isTypedField = function (field) {
|
|
481
|
+
return field !== null &&
|
|
482
|
+
typeof field === 'object' &&
|
|
483
|
+
!Array.isArray(field) &&
|
|
484
|
+
typeof field.type === 'string';
|
|
485
|
+
};
|
|
486
|
+
/**
|
|
487
|
+
* The form's copy of a field, with everything the host changed beside its value since `base`: its type, whether
|
|
488
|
+
* it is an expression, its operator, or anything else it says. `own` itself where the host changed nothing.
|
|
489
|
+
*
|
|
490
|
+
* A report of the form's is recognised by its values, and a field's value is merged by its value (see
|
|
491
|
+
* `reportedValues`, `mergeOwnEdits`), so a change the host made to a field's type alone said nothing: the form
|
|
492
|
+
* kept its own type. The Qorus IDE makes an added field's whole number true or false, holding the same field
|
|
493
|
+
* `pos`; the form kept the `int` and drew `pos` as text on the Value tab, where a true or false field shows it on
|
|
494
|
+
* its Expression tab (qorus#646).
|
|
495
|
+
*
|
|
496
|
+
* Every key but `value` is compared, not a list of the ones known today: whatever a host writes into a field
|
|
497
|
+
* beside its value, a change of it is the host's. A key the host writes as it always has is not a change, so a
|
|
498
|
+
* host that stores a field under its own type does not change the form's (that is why the value alone is what
|
|
499
|
+
* recognises a report).
|
|
500
|
+
*/
|
|
501
|
+
var withHostsAttributes = function (own, host, base) {
|
|
502
|
+
if (!isTypedField(own) || !isTypedField(host)) {
|
|
503
|
+
return own;
|
|
504
|
+
}
|
|
505
|
+
var hostField = host;
|
|
506
|
+
var baseField = isTypedField(base) ? base : {};
|
|
507
|
+
var ownField = own;
|
|
508
|
+
var taken;
|
|
509
|
+
new Set(__spreadArray(__spreadArray([], Object.keys(hostField), true), Object.keys(baseField), true)).forEach(function (key) {
|
|
510
|
+
var hosts = hostField[key];
|
|
511
|
+
if (key === 'value' || (0, lodash_1.isEqual)(hosts, baseField[key]) || (0, lodash_1.isEqual)(ownField[key], hosts)) {
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
taken = taken !== null && taken !== void 0 ? taken : __assign({}, ownField);
|
|
515
|
+
if (hosts === undefined) {
|
|
516
|
+
delete taken[key];
|
|
517
|
+
}
|
|
518
|
+
else {
|
|
519
|
+
taken[key] = hosts;
|
|
520
|
+
}
|
|
521
|
+
});
|
|
522
|
+
return taken !== null && taken !== void 0 ? taken : own;
|
|
523
|
+
};
|
|
524
|
+
/**
|
|
525
|
+
* The form's copy with what the host changed beside each field's value since `base` taken (see
|
|
526
|
+
* `withHostsAttributes`). Returns `ours` itself when there is nothing the form's copy does not have already.
|
|
527
|
+
*/
|
|
528
|
+
var takeHostsAttributes = function (theirs, ours, base) {
|
|
529
|
+
var _a;
|
|
530
|
+
var typed;
|
|
531
|
+
(0, lodash_1.forEach)(theirs || {}, function (host, name) {
|
|
532
|
+
var own = ours === null || ours === void 0 ? void 0 : ours[name];
|
|
533
|
+
var taken = withHostsAttributes(own, host, base === null || base === void 0 ? void 0 : base[name]);
|
|
534
|
+
if (taken !== own) {
|
|
535
|
+
typed = typed !== null && typed !== void 0 ? typed : __assign({}, (ours || {}));
|
|
536
|
+
typed[name] = taken;
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
return (_a = typed) !== null && _a !== void 0 ? _a : ours;
|
|
540
|
+
};
|
|
541
|
+
exports.takeHostsAttributes = takeHostsAttributes;
|
|
542
|
+
/**
|
|
543
|
+
* The host's change, with the form's own edits kept: a three-way merge of `theirs` (the `value` the host
|
|
544
|
+
* hands down now) and `ours` (the form's copy) against `base` (the `value` the form last saw).
|
|
545
|
+
*
|
|
546
|
+
* A field the form changed and the host did not keeps the form's value; every other field takes the host's,
|
|
547
|
+
* a field both changed included. The host and the form can change the value in the same commit - a host
|
|
548
|
+
* renaming something as the user's edit reaches the form - and taking either side whole lost the other's
|
|
549
|
+
* change; sending the form's copy over the host's change made the two trade places forever (qorus#646).
|
|
550
|
+
*
|
|
551
|
+
* Returns `theirs` itself when the form has nothing of its own to keep.
|
|
552
|
+
*/
|
|
553
|
+
var mergeOwnEdits = function (theirs, ours, base) {
|
|
554
|
+
var _a;
|
|
555
|
+
var merged;
|
|
556
|
+
var names = new Set(__spreadArray(__spreadArray([], Object.keys(ours || {}), true), Object.keys(base || {}), true));
|
|
557
|
+
names.forEach(function (name) {
|
|
558
|
+
var own = ours === null || ours === void 0 ? void 0 : ours[name];
|
|
559
|
+
var before = base === null || base === void 0 ? void 0 : base[name];
|
|
560
|
+
var host = theirs === null || theirs === void 0 ? void 0 : theirs[name];
|
|
561
|
+
if (sameField(own, before) || !sameField(host, before) || sameField(host, own)) {
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
merged = merged !== null && merged !== void 0 ? merged : __assign({}, (theirs || {}));
|
|
565
|
+
if (own === undefined) {
|
|
566
|
+
delete merged[name];
|
|
567
|
+
}
|
|
568
|
+
else {
|
|
569
|
+
// the form's value, with what the host changed beside it (its type, say)
|
|
570
|
+
merged[name] = withHostsAttributes(own, host, before);
|
|
571
|
+
}
|
|
572
|
+
});
|
|
573
|
+
return (_a = merged) !== null && _a !== void 0 ? _a : theirs;
|
|
574
|
+
};
|
|
575
|
+
exports.mergeOwnEdits = mergeOwnEdits;
|
|
467
576
|
/**
|
|
468
577
|
* Should the form report `localValue` to its parent as an answer?
|
|
469
578
|
*
|
|
@@ -520,33 +629,34 @@ var getTypeAndCanBeNull = function (type, allowed_values, operatorData, operator
|
|
|
520
629
|
exports.getTypeAndCanBeNull = getTypeAndCanBeNull;
|
|
521
630
|
// Option types rendered full-width (IDE Options parity, commit 8e6b7781).
|
|
522
631
|
var STRECHABLE_TYPES = new Set(['tool-catalog']);
|
|
632
|
+
/** How faded reqore draws a panel's title icon. */
|
|
633
|
+
var PANEL_TITLE_ICON_ALPHA = 0.7;
|
|
523
634
|
var FormEngineImpl = function (_a) {
|
|
524
635
|
var _b, _c, _d, _f, _g;
|
|
525
636
|
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
|
|
526
637
|
isValid = _a.isValid, // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
527
638
|
url = _a.url, customUrl = _a.customUrl, operatorsUrl = _a.operatorsUrl, onOptionsLoaded = _a.onOptionsLoaded, recordRequiresSearchOptions = _a.recordRequiresSearchOptions, readOnly = _a.readOnly, onReadOnlyActivate = _a.onReadOnlyActivate, _h = _a.allowTemplates, allowTemplates = _h === void 0 ? true : _h, interfaceContext = _a.interfaceContext, templateFieldProps = _a.templateFieldProps, forceDropdown = _a.forceDropdown, _j = _a.showTypeToggle, showTypeToggle = _j === void 0 ? true : _j, compact = _a.compact,
|
|
528
|
-
// Read through the context `FormEngine` provides (resolved there against an
|
|
529
|
-
// inherited appearance); destructured only to keep it out of `rest`.
|
|
530
|
-
_appearance = _a.appearance, // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
531
639
|
// Destructured only to keep it out of `rest` (and so off the DOM). The gutter
|
|
532
640
|
// this prop documents was never implemented: it was passed to the wrap as
|
|
533
641
|
// `$flush`, whose styled template had no interpolation slot, so it has always
|
|
534
642
|
// been a no-op. Removing it from the API is a separate, breaking change —
|
|
535
643
|
// every consumer passing it today already gets the flush layout by default.
|
|
536
644
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
537
|
-
_k = _a.compactFlush,
|
|
645
|
+
_k = _a.compactFlush,
|
|
538
646
|
// Destructured only to keep it out of `rest` (and so off the DOM). The gutter
|
|
539
647
|
// this prop documents was never implemented: it was passed to the wrap as
|
|
540
648
|
// `$flush`, whose styled template had no interpolation slot, so it has always
|
|
541
649
|
// been a no-op. Removing it from the API is a separate, breaking change —
|
|
542
650
|
// every consumer passing it today already gets the flush layout by default.
|
|
543
651
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
544
|
-
compactFlush = _k === void 0 ? false : _k, _l = _a.compactNested, compactNested = _l === void 0 ? false : _l, _m = _a.compactScroll, compactScroll = _m === void 0 ? 'host' : _m, compactPanelProps = _a.compactPanelProps, compactCollapsedGroupsProp = _a.compactCollapsedGroups, compactBoxLabels = _a.compactBoxLabels, _o = _a.
|
|
652
|
+
compactFlush = _k === void 0 ? false : _k, _l = _a.compactNested, compactNested = _l === void 0 ? false : _l, _m = _a.compactScroll, compactScroll = _m === void 0 ? 'host' : _m, compactPanelProps = _a.compactPanelProps, compactCollapsedGroupsProp = _a.compactCollapsedGroups, compactBoxLabels = _a.compactBoxLabels, _o = _a.compactStickyBoxHeaders, compactStickyBoxHeaders = _o === void 0 ? true : _o, _p = _a.compactStickyOffset, compactStickyOffset = _p === void 0 ? 0 : _p, _q = _a.compactToolbar, compactToolbar = _q === void 0 ? true : _q, _r = _a.commitMode, commitMode = _r === void 0 ? 'immediate' : _r, _s = _a.expandMode, expandMode = _s === void 0 ? 'single' : _s, onCommit = _a.onCommit, operatorsProp = _a.operators, groups = _a.groups, optionsLoader = _a.optionsLoader, onValidityChange = _a.onValidityChange, optionActions = _a.optionActions, _t = _a.optionActionsCollapse, optionActionsCollapse = _t === void 0 ? 'auto' : _t, componentOverrides = _a.componentOverrides, codePreviewRenderer = _a.codePreviewRenderer, readSummaries = _a.readSummaries, cardEditorTypes = _a.cardEditorTypes,
|
|
545
653
|
// consumed by the wrapper below, which publishes it to every description this
|
|
546
654
|
// form draws; destructured here only so it cannot reach `rest` and be spread
|
|
547
655
|
// onto a DOM node
|
|
548
656
|
_markdownRenderer = _a.markdownRenderer, // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
549
|
-
rendererOnlyUiTypes = _a.rendererOnlyUiTypes, templateAwareUiTypes = _a.templateAwareUiTypes, anyLikeUiTypes = _a.anyLikeUiTypes, inheritedFromParent = _a.inheritedFromParent, autoFocusFirstRequired = _a.autoFocusFirstRequired, expandFirstRequired = _a.expandFirstRequired, initialExpandedOptions = _a.initialExpandedOptions,
|
|
657
|
+
rendererOnlyUiTypes = _a.rendererOnlyUiTypes, templateAwareUiTypes = _a.templateAwareUiTypes, anyLikeUiTypes = _a.anyLikeUiTypes, inheritedFromParent = _a.inheritedFromParent, autoFocusFirstRequired = _a.autoFocusFirstRequired, expandFirstRequired = _a.expandFirstRequired, initialExpandedOptions = _a.initialExpandedOptions, valueKey = _a.valueKey, maxFieldsShown = _a.maxFieldsShown,
|
|
658
|
+
// The form's own props, read here and never handed on to the collection drawn below (`{...rest}`).
|
|
659
|
+
optionsSchema = _a.options, stringTemplates = _a.stringTemplates, skeletonReason = _a.skeletonReason, rest = __rest(_a, ["name", "uniqueName", "value", "onChange", "onSingleOptionsChange", "onDependableOptionChange", "placeholder", "noValueString", "isValid", "url", "customUrl", "operatorsUrl", "onOptionsLoaded", "recordRequiresSearchOptions", "readOnly", "onReadOnlyActivate", "allowTemplates", "interfaceContext", "templateFieldProps", "forceDropdown", "showTypeToggle", "compact", "compactFlush", "compactNested", "compactScroll", "compactPanelProps", "compactCollapsedGroups", "compactBoxLabels", "compactStickyBoxHeaders", "compactStickyOffset", "compactToolbar", "commitMode", "expandMode", "onCommit", "operators", "groups", "optionsLoader", "onValidityChange", "optionActions", "optionActionsCollapse", "componentOverrides", "codePreviewRenderer", "readSummaries", "cardEditorTypes", "markdownRenderer", "rendererOnlyUiTypes", "templateAwareUiTypes", "anyLikeUiTypes", "inheritedFromParent", "autoFocusFirstRequired", "expandFirstRequired", "initialExpandedOptions", "valueKey", "maxFieldsShown", "options", "stringTemplates", "skeletonReason"]);
|
|
550
660
|
// Built-ins + whatever the consumer declared for its own injected editors.
|
|
551
661
|
var isRendererOnly = (0, react_2.useMemo)(function () { return (0, rendererTypes_1.createRendererOnlyUiTypeCheck)(rendererOnlyUiTypes); }, [JSON.stringify(rendererOnlyUiTypes)]);
|
|
552
662
|
// Pointer CAPABILITY and viewport WIDTH are different questions and both
|
|
@@ -571,50 +681,46 @@ var FormEngineImpl = function (_a) {
|
|
|
571
681
|
enters the component, so the header, the chips, the messages, the meter and
|
|
572
682
|
the read-first summary cannot disagree about it: every one of them reads
|
|
573
683
|
`options`, and none of them has to know the rule. */
|
|
574
|
-
var
|
|
684
|
+
var _u = (0, react_2.useState)(optionsSchema || undefined), servedOptions = _u[0], setOptions = _u[1];
|
|
575
685
|
var options = (0, react_2.useMemo)(function () { return (0, options_1.resolveDegenerateRequiredGroups)(servedOptions); }, [servedOptions]);
|
|
686
|
+
/* Whether the schema the form holds is the one in force: its host is not waiting behind the skeleton, and a
|
|
687
|
+
schema the host hands down has been taken in (`servedOptions` follows the `options` prop a render later).
|
|
688
|
+
Until then the value is neither pruned against the schema nor emitted. A host loading the schema hands an
|
|
689
|
+
empty or an earlier one meanwhile; read against that, every stored field was "not on this instance" and
|
|
690
|
+
was removed, so a Qog state opened before its options had loaded showed them empty and, once emitted,
|
|
691
|
+
lost them (qorus#646). */
|
|
692
|
+
var hostSchemaPending = !optionsLoader &&
|
|
693
|
+
!url &&
|
|
694
|
+
!customUrl &&
|
|
695
|
+
optionsSchema !== servedOptions &&
|
|
696
|
+
JSON.stringify(optionsSchema || undefined) !== JSON.stringify(servedOptions);
|
|
697
|
+
var schemaInForce = !rest.skeleton && !hostSchemaPending;
|
|
576
698
|
// optionsLoader lifecycle: loading feeds the skeleton gate, error the banner.
|
|
577
|
-
var
|
|
578
|
-
var
|
|
699
|
+
var _v = (0, react_2.useState)(!!optionsLoader && !optionsSchema), optionsLoading = _v[0], setOptionsLoading = _v[1];
|
|
700
|
+
var _w = (0, react_2.useState)(), optionsError = _w[0], setOptionsError = _w[1];
|
|
579
701
|
// Operators: prop-provided (compact) or fetched via operatorsUrl (dpql,
|
|
580
702
|
// ported from IDE Options) — the fetch overrides the seeded prop value.
|
|
581
|
-
var
|
|
703
|
+
var _x = (0, react_2.useState)(operatorsProp), operators = _x[0], setOperators = _x[1];
|
|
582
704
|
// Remote-fetch loading (ported from IDE Options); only relevant when one of
|
|
583
705
|
// the fetch urls is set — schema-as-props consumers never see the skeleton.
|
|
584
|
-
var
|
|
706
|
+
var _y = (0, react_2.useState)(!!(url || customUrl || operatorsUrl)), loading = _y[0], setLoading = _y[1];
|
|
585
707
|
var confirmAction = (0, reqore_1.useReqoreProperty)('confirmAction');
|
|
586
708
|
var theme = (0, reqore_1.useReqoreTheme)();
|
|
587
|
-
var
|
|
588
|
-
var _0 = (0, react_2.useState)(),
|
|
589
|
-
var _1 = (0, react_2.useState)(false), showFieldTypes = _1[0], setShowFieldTypes = _1[1];
|
|
709
|
+
var _z = (0, react_2.useState)(), focusedEditing = _z[0], setFocusedEditing = _z[1];
|
|
710
|
+
var _0 = (0, react_2.useState)(false), showFieldTypes = _0[0], setShowFieldTypes = _0[1];
|
|
590
711
|
// Global toggle (toolbar ⓘ): reveal the short-description info panel on every
|
|
591
712
|
// field that has a short_desc. Per-row ⓘ overrides still win over it.
|
|
592
713
|
// Global field-info visibility, tri-state: `undefined` = default (critical
|
|
593
714
|
// messages auto-open, the rest closed); `true` = show all; `false` = hide all
|
|
594
715
|
// (even message fields). The toolbar ⓘ drives it.
|
|
595
|
-
var
|
|
596
|
-
var
|
|
597
|
-
var
|
|
716
|
+
var _1 = (0, react_2.useState)(undefined), showAllDescriptions = _1[0], setShowAllDescriptions = _1[1];
|
|
717
|
+
var _2 = (0, react_2.useState)(), showHelpForOption = _2[0], setShowHelpForOption = _2[1];
|
|
718
|
+
var _3 = (0, react_2.useState)(false), showInvalidOptionsOnly = _3[0], setShowInvalidOptionsOnly = _3[1];
|
|
598
719
|
// Which options are expanded into their editor (several can be open at once).
|
|
599
|
-
var
|
|
600
|
-
// The fields the person has opened and left. An empty required field becomes a
|
|
601
|
-
// fault only then (or after a submit attempt, `revealRequired`): a form nobody has
|
|
602
|
-
// touched is not already wrong.
|
|
603
|
-
var _6 = (0, react_2.useState)([]), visitedOptions = _6[0], setVisitedOptions = _6[1];
|
|
604
|
-
var lastExpandedOptions = (0, react_2.useRef)([]);
|
|
605
|
-
(0, react_2.useEffect)(function () {
|
|
606
|
-
var left = lastExpandedOptions.current.filter(function (name) { return !expandedOptions.includes(name); });
|
|
607
|
-
lastExpandedOptions.current = expandedOptions;
|
|
608
|
-
if (left.length) {
|
|
609
|
-
setVisitedOptions(function (prev) {
|
|
610
|
-
var added = left.filter(function (name) { return !prev.includes(name); });
|
|
611
|
-
return added.length ? __spreadArray(__spreadArray([], prev, true), added, true) : prev;
|
|
612
|
-
});
|
|
613
|
-
}
|
|
614
|
-
}, [expandedOptions]);
|
|
720
|
+
var _4 = (0, react_2.useState)([]), expandedOptions = _4[0], setExpandedOptions = _4[1];
|
|
615
721
|
/** Status boxes whose "N more fields" control the reader has opened. Keyed by
|
|
616
722
|
box so opening Optional does not also unfold Set. */
|
|
617
|
-
var
|
|
723
|
+
var _5 = (0, react_2.useState)([]), expandedMoreBoxes = _5[0], setExpandedMoreBoxes = _5[1];
|
|
618
724
|
// --- Reveal a status box's content when it is opened ----------------------
|
|
619
725
|
//
|
|
620
726
|
// The status boxes stack, so the last one ("Optional", which holds every
|
|
@@ -630,7 +736,7 @@ var FormEngineImpl = function (_a) {
|
|
|
630
736
|
// box has not grown and there is nothing to scroll to. A layout effect runs
|
|
631
737
|
// after the DOM is updated and before paint, which makes the reveal
|
|
632
738
|
// deterministic instead of a guessed delay.
|
|
633
|
-
var
|
|
739
|
+
var _6 = (0, react_2.useState)(undefined), openedStatusBox = _6[0], setOpenedStatusBox = _6[1];
|
|
634
740
|
var statusBoxRefs = (0, react_2.useRef)({});
|
|
635
741
|
(0, react_2.useLayoutEffect)(function () {
|
|
636
742
|
var _a, _b;
|
|
@@ -661,13 +767,13 @@ var FormEngineImpl = function (_a) {
|
|
|
661
767
|
var settledBucket = (0, react_2.useRef)({});
|
|
662
768
|
// Measured form width (not viewport — the form lives in drawers/panels of
|
|
663
769
|
// arbitrary width) drives the stacked narrow layout.
|
|
664
|
-
var
|
|
770
|
+
var _7 = (0, react_use_1.useMeasure)(), compactWrapRef = _7[0], compactWrapWidth = _7[1].width;
|
|
665
771
|
// Own handle on the scroll wrap (useMeasure's ref is a callback, no `.current`)
|
|
666
772
|
// so the label-column measurement can publish its CSS var on the element. It's
|
|
667
773
|
// STATE, not a ref: the wrap mounts only after the loading-skeleton gate
|
|
668
774
|
// resolves, so the measurement effect must re-run when the node appears — a
|
|
669
775
|
// ref wouldn't retrigger it.
|
|
670
|
-
var
|
|
776
|
+
var _8 = (0, react_2.useState)(null), compactWrapNode = _8[0], setCompactWrapNode = _8[1];
|
|
671
777
|
// Ref mirror of the wrap node for callbacks that must not re-create when it
|
|
672
778
|
// mounts (flashOptions reads it inside a rAF).
|
|
673
779
|
var compactWrapNodeRef = (0, react_2.useRef)(null);
|
|
@@ -680,7 +786,13 @@ var FormEngineImpl = function (_a) {
|
|
|
680
786
|
measurement below takes it as a dependency, and a dependency array is
|
|
681
787
|
evaluated during render — a `const` declared further down would still be
|
|
682
788
|
in its temporal dead zone. */
|
|
683
|
-
|
|
789
|
+
/* The label column the rows are laid out with: measured from the labels (see below), the
|
|
790
|
+
default until it is. A form stacks its rows where its value column would be too narrow
|
|
791
|
+
beside it (`isCompactNarrow`), not at one form width whatever its labels are. */
|
|
792
|
+
var _9 = (0, react_2.useState)(compactRowStyles_1.COMPACT_LABEL_COL), compactLabelColumn = _9[0], setCompactLabelColumn = _9[1];
|
|
793
|
+
// the label column holds a finger's help button where the pointer is a finger (`labelAffordanceWidth`)
|
|
794
|
+
var coarsePointer = (0, useCoarsePointer_1.useCoarsePointer)();
|
|
795
|
+
var compactNarrow = !!compactWrapWidth && (0, compactRowStyles_1.isCompactNarrow)(compactWrapWidth, compactLabelColumn);
|
|
684
796
|
/* How much pinned chrome sits above a status-box header.
|
|
685
797
|
|
|
686
798
|
Sticky offsets do not compose on their own: everything pinned in one
|
|
@@ -695,7 +807,7 @@ var FormEngineImpl = function (_a) {
|
|
|
695
807
|
a search row and a field picker that each hide themselves when they have
|
|
696
808
|
nothing to say, and what is left wraps differently at every form width.
|
|
697
809
|
Zero when this form draws no toolbar at all. */
|
|
698
|
-
var
|
|
810
|
+
var _10 = (0, react_2.useState)(0), compactToolbarHeight = _10[0], setCompactToolbarHeight = _10[1];
|
|
699
811
|
(0, react_2.useLayoutEffect)(function () {
|
|
700
812
|
var wrap = compactWrapNode;
|
|
701
813
|
if (!compact || !wrap || compactNested || !compactStickyBoxHeaders) {
|
|
@@ -735,38 +847,6 @@ var FormEngineImpl = function (_a) {
|
|
|
735
847
|
the ResizeObserver never fires and a stale 124px would go on offsetting
|
|
736
848
|
the box headers below a toolbar that is no longer there. */
|
|
737
849
|
}, [compact, compactNested, compactStickyBoxHeaders, compactNarrow, compactWrapNode, options]);
|
|
738
|
-
/* The colour a calm form sits on, for its pinned toolbar's glass.
|
|
739
|
-
|
|
740
|
-
A calm form has no surface of its own, so the toolbar has to paint one to
|
|
741
|
-
keep the rows that scroll under it from showing through the meter and the
|
|
742
|
-
search — and it has to be the host's colour, or it draws a band across the
|
|
743
|
-
form before anything has moved. The host is whatever paints first above the
|
|
744
|
-
form: the page, a drawer's panel surface, a card. Read once it mounts (and
|
|
745
|
-
when the theme changes), not assumed from the theme's main colour. */
|
|
746
|
-
var _12 = (0, react_2.useState)(), compactHostColour = _12[0], setCompactHostColour = _12[1];
|
|
747
|
-
(0, react_2.useLayoutEffect)(function () {
|
|
748
|
-
if (!calm || !compact || compactNested || !compactWrapNode) {
|
|
749
|
-
setCompactHostColour(undefined);
|
|
750
|
-
return;
|
|
751
|
-
}
|
|
752
|
-
var _loop_1 = function (node) {
|
|
753
|
-
var _a = (getComputedStyle(node).backgroundColor.match(/[\d.]+/g) || [])
|
|
754
|
-
.slice(0, 4)
|
|
755
|
-
.map(Number), r = _a[0], g = _a[1], b = _a[2], _b = _a[3], alpha = _b === void 0 ? 1 : _b;
|
|
756
|
-
if (alpha > 0 && b !== undefined) {
|
|
757
|
-
setCompactHostColour(function (prev) {
|
|
758
|
-
return (prev === null || prev === void 0 ? void 0 : prev[0]) === r && (prev === null || prev === void 0 ? void 0 : prev[1]) === g && (prev === null || prev === void 0 ? void 0 : prev[2]) === b ? prev : [r, g, b];
|
|
759
|
-
});
|
|
760
|
-
return { value: void 0 };
|
|
761
|
-
}
|
|
762
|
-
};
|
|
763
|
-
for (var node = compactWrapNode.parentElement; node; node = node.parentElement) {
|
|
764
|
-
var state_1 = _loop_1(node);
|
|
765
|
-
if (typeof state_1 === "object")
|
|
766
|
-
return state_1.value;
|
|
767
|
-
}
|
|
768
|
-
setCompactHostColour(undefined);
|
|
769
|
-
}, [calm, compact, compactNested, compactWrapNode, theme]);
|
|
770
850
|
// Global label-column sizing: size the label column to the WIDEST field label
|
|
771
851
|
// across the whole form, clamped to [MIN, MAX], and publish it as a CSS var on
|
|
772
852
|
// the scroll wrap. Both the grid column and the value-surface offsets read the
|
|
@@ -804,16 +884,19 @@ var FormEngineImpl = function (_a) {
|
|
|
804
884
|
// survives at every label length. MAX still bounds how much room the NAME may
|
|
805
885
|
// take, which is what it is for; the asterisk and the `?` are chrome that has
|
|
806
886
|
// to fit beside it either way.
|
|
807
|
-
var text = Math.
|
|
808
|
-
|
|
809
|
-
|
|
887
|
+
var text = Math.min(compactRowStyles_1.LABEL_COL_MAX, Math.round(widest));
|
|
888
|
+
// a finger's help button is wider than a mouse's (`labelAffordanceWidth`); a short name's column is the floor
|
|
889
|
+
var column = Math.max(compactRowStyles_1.LABEL_COLUMN_MIN, text + (0, compactRowStyles_1.labelAffordanceWidth)(coarsePointer));
|
|
890
|
+
wrap.style.setProperty(compactRowStyles_1.LABEL_COL_VAR, "".concat(column, "px"));
|
|
891
|
+
setCompactLabelColumn(column);
|
|
892
|
+
}, [compact, options, theme, compactWrapNode, coarsePointer]);
|
|
810
893
|
// Editing rows pin min-height to the measured read row they replace, so the
|
|
811
894
|
// toggle never shifts neighbours (height varies with chrome — measure it).
|
|
812
895
|
var readRowHeights = (0, react_2.useRef)({});
|
|
813
896
|
// Required-groups linkage: hovering a group chip highlights every member row;
|
|
814
897
|
// clicking a sibling in the chip's popover scrolls to it and flashes it.
|
|
815
|
-
var
|
|
816
|
-
var
|
|
898
|
+
var _11 = (0, react_2.useState)([]), highlightedOptions = _11[0], setHighlightedOptions = _11[1];
|
|
899
|
+
var _12 = (0, react_2.useState)([]), flashedOptions = _12[0], setFlashedOptions = _12[1];
|
|
817
900
|
var flashTimeout = (0, react_2.useRef)();
|
|
818
901
|
var flashOptions = (0, react_2.useCallback)(function (optionNames, scrollToFirst) {
|
|
819
902
|
if (scrollToFirst === void 0) { scrollToFirst = false; }
|
|
@@ -865,16 +948,16 @@ var FormEngineImpl = function (_a) {
|
|
|
865
948
|
}
|
|
866
949
|
});
|
|
867
950
|
// Info panels auto-open on Tier-1 content; the per-row user override sticks.
|
|
868
|
-
var
|
|
951
|
+
var _13 = (0, react_2.useState)({}), infoPanelOverrides = _13[0], setInfoPanelOverrides = _13[1];
|
|
869
952
|
// Toolbar filters affect the listed rows only — the meter reflects the full set.
|
|
870
|
-
var
|
|
871
|
-
var
|
|
953
|
+
var _14 = (0, react_2.useState)(false), requiredOnly = _14[0], setRequiredOnly = _14[1];
|
|
954
|
+
var _15 = (0, react_2.useState)(''), compactQuery = _15[0], setCompactQuery = _15[1];
|
|
872
955
|
// Compact field sort (Fields menu → "Sort by"); 'schema' = declared order.
|
|
873
|
-
var
|
|
874
|
-
var
|
|
956
|
+
var _16 = (0, react_2.useState)('schema'), compactSort = _16[0], setCompactSort = _16[1];
|
|
957
|
+
var _17 = (0, react_2.useState)(function () { return ({
|
|
875
958
|
fields: (0, exports.fixOptions)(value, options || {}, undefined, isRendererOnly),
|
|
876
959
|
meta: undefined,
|
|
877
|
-
}); }), localValue =
|
|
960
|
+
}); }), localValue = _17[0], setLocalValue = _17[1];
|
|
878
961
|
var originalValue = (0, react_2.useRef)();
|
|
879
962
|
// Track the last value we emitted via onChange so we can skip re-applying fixOptions
|
|
880
963
|
// when the parent echoes it back as the new value prop (controlled component loop prevention)
|
|
@@ -912,16 +995,52 @@ var FormEngineImpl = function (_a) {
|
|
|
912
995
|
* reset the form to it: the field under the cursor went back a step and the keys typed since were lost
|
|
913
996
|
* ("I have value" came out as "I he value" in a story under load).
|
|
914
997
|
*/
|
|
915
|
-
var inFlight = (0, emittedValues_1.useEmittedValues)(
|
|
916
|
-
|
|
917
|
-
|
|
998
|
+
var inFlight = (0, emittedValues_1.useEmittedValues)(sameReportedValue);
|
|
999
|
+
/**
|
|
1000
|
+
* The `value` (and `valueKey`) as of the last commit: what a new `value` is a change from. The sync-down
|
|
1001
|
+
* merges the host's change against it, and the emit effect tells by it that the host changed the value in
|
|
1002
|
+
* the very commit it runs in. Updated by the last effect of each commit (below the sync-down).
|
|
1003
|
+
*/
|
|
1004
|
+
var seenValue = (0, react_2.useRef)(value);
|
|
1005
|
+
var seenValueKey = (0, react_2.useRef)(valueKey);
|
|
1006
|
+
/** Whether `value` is the host's own change, made since the last commit: neither seen before nor a report of
|
|
1007
|
+
* this form's coming back. */
|
|
1008
|
+
var isHostsOwnChange = function () {
|
|
1009
|
+
return valueKey !== seenValueKey.current ||
|
|
1010
|
+
(!sameReportedValue(value, seenValue.current) &&
|
|
1011
|
+
!inFlight.includes(value) &&
|
|
1012
|
+
!sameReportedValue(value, lastEmittedValue.current));
|
|
1013
|
+
};
|
|
918
1014
|
if (originalValue.current === undefined && (0, size_1.default)(value)) {
|
|
919
1015
|
originalValue.current = localValue.fields;
|
|
920
1016
|
}
|
|
921
1017
|
var unavailableOptionsCount = (0, react_2.useRef)(0);
|
|
922
|
-
var
|
|
923
|
-
|
|
1018
|
+
var _18 = (0, useQorusTypes_1.useQorusTypes)(), compactValue = _18.compactValue, typesLoading = _18.loading;
|
|
1019
|
+
// an option's type in words, while the form shows field types (qorus#646: it said the type's code, `<string>`)
|
|
1020
|
+
var typeName = (0, typeSentenceForm_1.useTypeName)();
|
|
1021
|
+
var templates = (0, useTemplates_1.useTemplates)(allowTemplates, stringTemplates, interfaceContext);
|
|
924
1022
|
(0, react_2.useEffect)(function () {
|
|
1023
|
+
/* Nothing is emitted until the schema is in force (`schemaInForce`): read against the empty or earlier
|
|
1024
|
+
schema a host hands down while it loads its own, the value is no answer, and emitted it wiped a Qog
|
|
1025
|
+
state's stored options the moment the state was opened (qorus#646).
|
|
1026
|
+
|
|
1027
|
+
When it comes into force this check runs (it is a dependency). A host also shows the skeleton for other
|
|
1028
|
+
waits: qorus-ide shows it while the templates load, with the schema already there. The form completes the
|
|
1029
|
+
value meanwhile (a required field's default, e.g. the server's `created_by_user`), and nothing read it
|
|
1030
|
+
again when the skeleton cleared: the default was shown and never emitted, so never saved. A value that
|
|
1031
|
+
adds nothing still emits nothing. */
|
|
1032
|
+
if (!schemaInForce) {
|
|
1033
|
+
return;
|
|
1034
|
+
}
|
|
1035
|
+
/* The host changed the value in this same commit (effects run in order, and this one runs before the
|
|
1036
|
+
sync-down that takes the change in). The form's copy was made before that change: sent, it overwrote
|
|
1037
|
+
the host's change, the sync-down then took the host's value in, and the next commit sent that back -
|
|
1038
|
+
the form and the host traded places on every commit, forever (qorus#646: the Qorus IDE's OPC UA node
|
|
1039
|
+
editor, its namespace flipping between the old and the renamed one). The sync-down below merges the
|
|
1040
|
+
change with the form's own edits, and the next commit reports the result. */
|
|
1041
|
+
if (isHostsOwnChange()) {
|
|
1042
|
+
return;
|
|
1043
|
+
}
|
|
925
1044
|
if (!(0, exports.shouldEmitLocalValue)({
|
|
926
1045
|
localValue: localValue.fields,
|
|
927
1046
|
value: value,
|
|
@@ -936,15 +1055,15 @@ var FormEngineImpl = function (_a) {
|
|
|
936
1055
|
// Batched mode still emits every staged change (consumers may want to
|
|
937
1056
|
// live-validate), but flags it as a draft — persistence waits for Save.
|
|
938
1057
|
onChange === null || onChange === void 0 ? void 0 : onChange(name, toEmit, commitMode === 'batched' ? __assign(__assign({}, (meta || {})), { draft: true }) : meta);
|
|
939
|
-
}, [JSON.stringify(localValue)]);
|
|
1058
|
+
}, [JSON.stringify(localValue), schemaInForce]);
|
|
940
1059
|
(0, react_use_1.useUpdateEffect)(function () {
|
|
941
1060
|
// When a loader owns the schema, ignore controlled `options` syncs so a
|
|
942
1061
|
// late/undefined `options` prop can't clobber the loaded schema.
|
|
943
1062
|
if (optionsLoader) {
|
|
944
1063
|
return;
|
|
945
1064
|
}
|
|
946
|
-
setOptions(
|
|
947
|
-
}, [JSON.stringify(
|
|
1065
|
+
setOptions(optionsSchema);
|
|
1066
|
+
}, [JSON.stringify(optionsSchema)]);
|
|
948
1067
|
// Fetch the schema on mount and on loader identity change.
|
|
949
1068
|
(0, react_2.useEffect)(function () {
|
|
950
1069
|
if (!optionsLoader) {
|
|
@@ -1131,14 +1250,32 @@ var FormEngineImpl = function (_a) {
|
|
|
1131
1250
|
// change and re-fixes forever (e.g. byte-size / expression / ruled string fields).
|
|
1132
1251
|
// Note: compare fixedValue against value, not localValue.fields — localValue may have been
|
|
1133
1252
|
// updated by nested FormEngine emissions, so comparing against it would never skip.
|
|
1134
|
-
var normalizedValue = normalizeEmptyFieldValues(value);
|
|
1135
1253
|
/* What this rebuild lets us agree with the parent on — `undefined` when it
|
|
1136
1254
|
contributed something the parent has yet to learn. */
|
|
1137
1255
|
var agreed = (0, exports.agreementFromRebuild)(fixedValue, value);
|
|
1256
|
+
// a different record: nothing of the previous one is carried into it (see `valueKey`)
|
|
1257
|
+
var sameRecord = valueKey === seenValueKey.current;
|
|
1138
1258
|
// the echo of an emit still in flight - the last or an older one - is not the parent's change
|
|
1139
1259
|
var echo = inFlight.isEcho(value);
|
|
1140
|
-
if ((echo || (
|
|
1141
|
-
|
|
1260
|
+
if (sameRecord && (echo || sameReportedValue(value, lastEmittedValue.current))) {
|
|
1261
|
+
/* The form's own report coming back. Whatever the rebuild adds - a schema that changed in the same
|
|
1262
|
+
commit, a field the host does not store - is added to the form's copy, never by going back to the
|
|
1263
|
+
report: the report may be older than edits made since (an echo of "a" arriving after "ab" was
|
|
1264
|
+
reported lost the "b"). Nothing changes when the form's copy has it all already. */
|
|
1265
|
+
var rebuild_1 = function (fields) {
|
|
1266
|
+
return (0, exports.fixOptions)(fields, options || {}, undefined, isRendererOnly);
|
|
1267
|
+
};
|
|
1268
|
+
if (!(0, lodash_1.isEqual)(rebuild_1(localValue.fields), localValue.fields)) {
|
|
1269
|
+
// the parent has to learn what the rebuild added
|
|
1270
|
+
mirroredValue.current = undefined;
|
|
1271
|
+
}
|
|
1272
|
+
/* What the host changed beside a field's value is taken (its type, say): the report is recognised by its
|
|
1273
|
+
values (see `takeHostsAttributes`). */
|
|
1274
|
+
var base_1 = seenValue.current;
|
|
1275
|
+
setLocalValue(function (current) {
|
|
1276
|
+
var rebuilt = rebuild_1((0, exports.takeHostsAttributes)(value, current.fields, base_1));
|
|
1277
|
+
return (0, lodash_1.isEqual)(rebuilt, current.fields) ? current : { fields: rebuilt, meta: current.meta };
|
|
1278
|
+
});
|
|
1142
1279
|
return;
|
|
1143
1280
|
}
|
|
1144
1281
|
if (!originalValue.current && (0, size_1.default)(fixedValue)) {
|
|
@@ -1151,8 +1288,25 @@ var FormEngineImpl = function (_a) {
|
|
|
1151
1288
|
if (agreed !== undefined) {
|
|
1152
1289
|
lastEmittedValue.current = agreed;
|
|
1153
1290
|
}
|
|
1154
|
-
|
|
1155
|
-
|
|
1291
|
+
if (!sameRecord) {
|
|
1292
|
+
setLocalValue({ fields: fixedValue, meta: undefined });
|
|
1293
|
+
return;
|
|
1294
|
+
}
|
|
1295
|
+
// The host's change, with the form's own edits it did not touch kept (see `mergeOwnEdits`).
|
|
1296
|
+
var base = seenValue.current;
|
|
1297
|
+
setLocalValue(function (current) {
|
|
1298
|
+
var merged = (0, exports.mergeOwnEdits)(value, current.fields, base);
|
|
1299
|
+
return {
|
|
1300
|
+
fields: merged === value ? fixedValue : ((0, exports.fixOptions)(merged, options || {}, undefined, isRendererOnly)),
|
|
1301
|
+
meta: undefined,
|
|
1302
|
+
};
|
|
1303
|
+
});
|
|
1304
|
+
}, [JSON.stringify(options), JSON.stringify(value), isRendererOnly, valueKey]);
|
|
1305
|
+
// Last of the value effects: what the next commit's `value` is a change from.
|
|
1306
|
+
(0, react_2.useEffect)(function () {
|
|
1307
|
+
seenValue.current = value;
|
|
1308
|
+
seenValueKey.current = valueKey;
|
|
1309
|
+
});
|
|
1156
1310
|
var handleValueChange = (0, react_2.useCallback)(function (optionName, val, _type, isFunction) {
|
|
1157
1311
|
setLocalValue(function (_a) {
|
|
1158
1312
|
var _b, _c;
|
|
@@ -1349,8 +1503,11 @@ var FormEngineImpl = function (_a) {
|
|
|
1349
1503
|
var _a, _b;
|
|
1350
1504
|
var option = fixedValue[optionName];
|
|
1351
1505
|
if (!(options === null || options === void 0 ? void 0 : options[optionName])) {
|
|
1352
|
-
|
|
1353
|
-
|
|
1506
|
+
// not on this instance - unless the schema is not yet the one in force (see `schemaInForce`)
|
|
1507
|
+
if (schemaInForce) {
|
|
1508
|
+
unavailableOptionsCount.current += 1;
|
|
1509
|
+
removeSelectedOption(optionName);
|
|
1510
|
+
}
|
|
1354
1511
|
return newValue;
|
|
1355
1512
|
}
|
|
1356
1513
|
var rendererType = (0, exports.getType)((options[optionName].ui_type || options[optionName].type), operators, option === null || option === void 0 ? void 0 : option.op);
|
|
@@ -1370,6 +1527,7 @@ var FormEngineImpl = function (_a) {
|
|
|
1370
1527
|
unavailableOptionsCount.current,
|
|
1371
1528
|
JSON.stringify(operators),
|
|
1372
1529
|
showInvalidOptionsOnly,
|
|
1530
|
+
schemaInForce,
|
|
1373
1531
|
]);
|
|
1374
1532
|
// Per required-group: its member options, and which member (if any) already
|
|
1375
1533
|
// satisfies it — drives the "One of" chips and the "covered by" notes.
|
|
@@ -1499,12 +1657,15 @@ var FormEngineImpl = function (_a) {
|
|
|
1499
1657
|
}, [JSON.stringify(options), JSON.stringify(fixedValue), JSON.stringify(availableOptions)]);
|
|
1500
1658
|
var isOptionValid = (0, react_2.useCallback)(function (optionName, type, optionValue) {
|
|
1501
1659
|
var _a, _b, _c, _d;
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
// not
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1660
|
+
// the same "not set" the row's status reads: an empty list is no value
|
|
1661
|
+
var isEmpty = (0, readFirst_1.isOptionValueEmpty)(optionValue);
|
|
1662
|
+
// A field whose `depends_on` does not hold does not apply: it is hidden, and nothing in it can make the
|
|
1663
|
+
// form invalid - a value it holds is kept, and said in the form's note, valid or not (qorus#646).
|
|
1664
|
+
if (dependencyLockedNames.includes(optionName)) {
|
|
1665
|
+
return true;
|
|
1666
|
+
}
|
|
1667
|
+
// An empty field that is not required is not missing.
|
|
1668
|
+
if (isEmpty && !((_a = options === null || options === void 0 ? void 0 : options[optionName]) === null || _a === void 0 ? void 0 : _a.required) && !((_b = options === null || options === void 0 ? void 0 : options[optionName]) === null || _b === void 0 ? void 0 : _b.required_groups)) {
|
|
1508
1669
|
return true;
|
|
1509
1670
|
}
|
|
1510
1671
|
return (0, validations_1.validateField)((0, exports.getType)(type), optionValue, __assign(__assign({ has_to_have_value: true, optionSchema: options, options: availableOptions }, options === null || options === void 0 ? void 0 : options[optionName]), {
|
|
@@ -1523,28 +1684,41 @@ var FormEngineImpl = function (_a) {
|
|
|
1523
1684
|
]);
|
|
1524
1685
|
var getValidityData = (0, react_2.useCallback)(function () {
|
|
1525
1686
|
var fields = (0, reduce_1.default)(availableOptions, function (result, option, optionName) {
|
|
1526
|
-
var _a, _b, _c;
|
|
1687
|
+
var _a, _b, _c, _d;
|
|
1527
1688
|
var type = (0, exports.getOptionFieldStorageType)(optionName, option.type, options, operators, option.op, isRendererOnly, optionHoldsExpression(option));
|
|
1528
1689
|
var optionValue = option.value;
|
|
1529
1690
|
var isRequired = (_a = options === null || options === void 0 ? void 0 : options[optionName]) === null || _a === void 0 ? void 0 : _a.required;
|
|
1530
1691
|
var hasRequiredGroups = !!((_b = options === null || options === void 0 ? void 0 : options[optionName]) === null || _b === void 0 ? void 0 : _b.required_groups);
|
|
1531
|
-
|
|
1692
|
+
// the same "not set" the row's status reads: an empty list is no value
|
|
1693
|
+
var isEmpty = (0, readFirst_1.isOptionValueEmpty)(optionValue);
|
|
1532
1694
|
var validation;
|
|
1533
|
-
/* A
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
if (isEmpty &&
|
|
1541
|
-
((!isRequired && !hasRequiredGroups) || dependencyLockedNames.includes(optionName))) {
|
|
1542
|
-
validation = { isValid: true, reasons: [] };
|
|
1695
|
+
/* A field whose host gives its own reason (`invalid_reason`) is invalid while it does, whatever the
|
|
1696
|
+
field makes of its value: the host knows something the field cannot - that a field it names
|
|
1697
|
+
is not in the record, that text around a field is not a whole number - and says it in the field,
|
|
1698
|
+
in place of the field's own message (`getOptionFieldMessages`). */
|
|
1699
|
+
var hostReason = (_c = options === null || options === void 0 ? void 0 : options[optionName]) === null || _c === void 0 ? void 0 : _c.invalid_reason;
|
|
1700
|
+
if (hostReason) {
|
|
1701
|
+
validation = { isValid: false, reason: hostReason, reasons: [hostReason] };
|
|
1543
1702
|
}
|
|
1544
1703
|
else {
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1704
|
+
/* A required field locked by an unmet `depends_on` does not apply
|
|
1705
|
+
while it is locked: it is not in "Needs attention", and an empty one
|
|
1706
|
+
does not make the form incomplete either. Otherwise a check whose
|
|
1707
|
+
kind is Equals could never be saved, because Minimum — required for
|
|
1708
|
+
Between alone — is empty; and a form whose only gaps are fields
|
|
1709
|
+
nobody can fill in would say Incomplete with nothing to act on. A
|
|
1710
|
+
locked field that still HOLDS a value is validated as before. */
|
|
1711
|
+
if (dependencyLockedNames.includes(optionName) ||
|
|
1712
|
+
(isEmpty && !isRequired && !hasRequiredGroups)) {
|
|
1713
|
+
/* A field whose `depends_on` does not hold is hidden and does not apply: nothing in it makes the
|
|
1714
|
+
form invalid, empty or holding a value (kept, and said in the form's note - qorus#646). */
|
|
1715
|
+
validation = { isValid: true, reasons: [] };
|
|
1716
|
+
}
|
|
1717
|
+
else {
|
|
1718
|
+
validation = (0, validations_1.validateFieldWithResult)((0, exports.getType)(type), optionValue, __assign(__assign({ has_to_have_value: true, optionSchema: options, options: availableOptions }, options === null || options === void 0 ? void 0 : options[optionName]), {
|
|
1719
|
+
// The expression flag lives on the field value, not the schema.
|
|
1720
|
+
isFunction: option.is_expression, hasOwnEditor: isRendererOnly((_d = options === null || options === void 0 ? void 0 : options[optionName]) === null || _d === void 0 ? void 0 : _d.ui_type) }));
|
|
1721
|
+
}
|
|
1548
1722
|
}
|
|
1549
1723
|
result.push({
|
|
1550
1724
|
fieldName: optionName,
|
|
@@ -1573,23 +1747,25 @@ var FormEngineImpl = function (_a) {
|
|
|
1573
1747
|
(0, react_2.useEffect)(function () {
|
|
1574
1748
|
onValidityChange === null || onValidityChange === void 0 ? void 0 : onValidityChange(optionsAreValid, validityData);
|
|
1575
1749
|
}, [JSON.stringify(validityData)]);
|
|
1750
|
+
/* A field whose `depends_on` does not hold is not shown (qorus#646, David): it is not of use until it applies,
|
|
1751
|
+
so it is left out of the form - not shown waiting, locked - and appears once its dependency holds (and
|
|
1752
|
+
flashes - see `dependencyLockedNames`). Its value is kept; one it holds meanwhile is said in the form's
|
|
1753
|
+
note (`hiddenFieldsWithValues`). */
|
|
1576
1754
|
var shownOptions = (0, react_2.useMemo)(function () {
|
|
1577
1755
|
return (0, reduce_1.default)(availableOptions, function (newValue, option, optionName) {
|
|
1578
1756
|
var _a;
|
|
1757
|
+
if (dependencyLockedNames.includes(optionName)) {
|
|
1758
|
+
return newValue;
|
|
1759
|
+
}
|
|
1579
1760
|
if (showInvalidOptionsOnly &&
|
|
1580
|
-
// An open row stays while the reader is in it, as its box does
|
|
1581
|
-
// (`stableBucketOf`): the first character typed into an empty required
|
|
1582
|
-
// field makes it valid, and hiding it then would pull the field out
|
|
1583
|
-
// from under the caret mid-word.
|
|
1584
|
-
!expandedOptions.includes(optionName) &&
|
|
1585
1761
|
isOptionValid(optionName, (0, exports.getOptionFieldStorageType)(optionName, option.type, options, operators, option.op, isRendererOnly, optionHoldsExpression(option)), option.value)) {
|
|
1586
1762
|
return newValue;
|
|
1587
1763
|
}
|
|
1588
1764
|
return __assign(__assign({}, newValue), (_a = {}, _a[optionName] = option, _a));
|
|
1589
1765
|
}, {});
|
|
1590
1766
|
}, [
|
|
1767
|
+
dependencyLockedNames,
|
|
1591
1768
|
showInvalidOptionsOnly,
|
|
1592
|
-
expandedOptions,
|
|
1593
1769
|
isRendererOnly,
|
|
1594
1770
|
JSON.stringify(availableOptions),
|
|
1595
1771
|
JSON.stringify(options),
|
|
@@ -1602,7 +1778,7 @@ var FormEngineImpl = function (_a) {
|
|
|
1602
1778
|
var schemaMsgIntent = (0, react_2.useCallback)(function (name) {
|
|
1603
1779
|
var _a;
|
|
1604
1780
|
// Filtered, not raw: a message hidden by its own `when`/`unless` must not
|
|
1605
|
-
//
|
|
1781
|
+
// color the row or push the field into "Needs attention" — the whole point
|
|
1606
1782
|
// of a conditional warning is that it is absent while it does not apply.
|
|
1607
1783
|
var msgs = (0, OptionFieldMessages_1.getShownSchemaMessages)((_a = options === null || options === void 0 ? void 0 : options[name]) === null || _a === void 0 ? void 0 : _a.messages, availableOptions, options);
|
|
1608
1784
|
if (msgs.some(function (m) { return m.intent === 'danger'; }))
|
|
@@ -1645,11 +1821,8 @@ var FormEngineImpl = function (_a) {
|
|
|
1645
1821
|
covered: covered,
|
|
1646
1822
|
invalid: invalid,
|
|
1647
1823
|
warned: msgIntent === 'warning',
|
|
1648
|
-
visited: revealRequired || visitedOptions.includes(name),
|
|
1649
1824
|
});
|
|
1650
1825
|
}, [
|
|
1651
|
-
revealRequired,
|
|
1652
|
-
visitedOptions,
|
|
1653
1826
|
isRendererOnly,
|
|
1654
1827
|
JSON.stringify(options),
|
|
1655
1828
|
JSON.stringify(availableOptions),
|
|
@@ -1675,24 +1848,10 @@ var FormEngineImpl = function (_a) {
|
|
|
1675
1848
|
}, [JSON.stringify(options), requiredGroupsInfo, getOptionStatus, dependencyLockedNames]);
|
|
1676
1849
|
// How many fields are in the "Needs attention" box — drives the header link.
|
|
1677
1850
|
var readFirstAttentionCount = (0, react_2.useMemo)(function () {
|
|
1678
|
-
return Object.keys(availableOptions || {}).filter(
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
// on a new form, so its first box reads "To fill in" without amber.
|
|
1683
|
-
var readFirstAttentionFaultCount = (0, react_2.useMemo)(function () {
|
|
1684
|
-
return Object.keys(availableOptions || {}).filter(function (name) { return getOptionBucket(name) === 'attention' && getOptionStatus(name) !== 'pending'; }).length;
|
|
1685
|
-
}, [JSON.stringify(availableOptions), getOptionBucket, getOptionStatus]);
|
|
1686
|
-
// The same two numbers, to a host that draws its own submit control from them.
|
|
1687
|
-
var onAttentionChangeRef = (0, react_2.useRef)(onAttentionChange);
|
|
1688
|
-
onAttentionChangeRef.current = onAttentionChange;
|
|
1689
|
-
(0, react_2.useEffect)(function () {
|
|
1690
|
-
var _a;
|
|
1691
|
-
(_a = onAttentionChangeRef.current) === null || _a === void 0 ? void 0 : _a.call(onAttentionChangeRef, {
|
|
1692
|
-
count: readFirstAttentionCount,
|
|
1693
|
-
faults: readFirstAttentionFaultCount,
|
|
1694
|
-
});
|
|
1695
|
-
}, [readFirstAttentionCount, readFirstAttentionFaultCount]);
|
|
1851
|
+
return Object.keys(availableOptions || {}).filter(
|
|
1852
|
+
// a hidden field (its `depends_on` does not hold) is not in the form, nor in its counts
|
|
1853
|
+
function (name) { return !dependencyLockedNames.includes(name) && getOptionBucket(name) === 'attention'; }).length;
|
|
1854
|
+
}, [JSON.stringify(availableOptions), getOptionBucket, dependencyLockedNames]);
|
|
1696
1855
|
var getIntent = (0, react_2.useCallback)(
|
|
1697
1856
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1698
1857
|
function (optName, type, optValue, _op) {
|
|
@@ -1741,14 +1900,35 @@ var FormEngineImpl = function (_a) {
|
|
|
1741
1900
|
var handleOptionLabelClick = (0, react_2.useCallback)(function (optionName) {
|
|
1742
1901
|
setShowHelpForOption(optionName);
|
|
1743
1902
|
}, []);
|
|
1744
|
-
|
|
1903
|
+
/** Whether the first-required scan below has opened its row, or is spent by the user's first move (see it). Only a
|
|
1904
|
+
* remount arms it again. */
|
|
1905
|
+
var hasAutoFocusedRef = (0, react_2.useRef)(false);
|
|
1906
|
+
/** The fields the first-required scan has looked at: it opens a field that needs an answer when the field first
|
|
1907
|
+
* appears in the form, not when one already there comes to need one. */
|
|
1908
|
+
var scannedFieldsRef = (0, react_2.useRef)(new Set());
|
|
1909
|
+
/* A row is opened or closed by what the user did to the row as it was drawn, never by flipping whatever the
|
|
1910
|
+
state is by the time React applies the update. A toggle read the direction from the latest state: the
|
|
1911
|
+
first-required scan opens its row with an update of its own, and a click on that row, drawn closed, landed on
|
|
1912
|
+
top of it and closed the row the user had just opened (qorus#646: the Qorus IDE's Schema "Draft Is Saved").
|
|
1913
|
+
Each of these does nothing to a row already in its state.
|
|
1914
|
+
|
|
1915
|
+
A row the user opens or closes is where they have chosen to work: the first-required scan, if it is still
|
|
1916
|
+
waiting for the focus to be free, does not run after either (qorus#646). */
|
|
1917
|
+
var expandOption = (0, react_2.useCallback)(function (optionName) {
|
|
1918
|
+
hasAutoFocusedRef.current = true;
|
|
1745
1919
|
setExpandedOptions(function (prev) {
|
|
1746
|
-
return prev.includes(optionName) ? prev
|
|
1920
|
+
return prev.includes(optionName) ? prev
|
|
1747
1921
|
// single (default): opening a row collapses any other open one.
|
|
1748
1922
|
: expandMode === 'single' ? [optionName]
|
|
1749
1923
|
: __spreadArray(__spreadArray([], prev, true), [optionName], false);
|
|
1750
1924
|
});
|
|
1751
1925
|
}, [expandMode]);
|
|
1926
|
+
var collapseOption = (0, react_2.useCallback)(function (optionName) {
|
|
1927
|
+
hasAutoFocusedRef.current = true;
|
|
1928
|
+
setExpandedOptions(function (prev) {
|
|
1929
|
+
return prev.includes(optionName) ? prev.filter(function (name) { return name !== optionName; }) : prev;
|
|
1930
|
+
});
|
|
1931
|
+
}, []);
|
|
1752
1932
|
// --- Caller-named starting rows (opt-in) ----------------------------------
|
|
1753
1933
|
// `initialExpandedOptions` lets a consumer name the rows that must already
|
|
1754
1934
|
// be open when the form first paints — the case where the expanded row is
|
|
@@ -1780,6 +1960,41 @@ var FormEngineImpl = function (_a) {
|
|
|
1780
1960
|
setExpandedOptions(function (prev) { return __spreadArray(__spreadArray([], prev, true), toExpand.filter(function (name) { return !prev.includes(name); }), true); });
|
|
1781
1961
|
}, [initialExpandedOptions, compact, availableOptions]);
|
|
1782
1962
|
// --- First-attention-field autofocus (opt-in) -----------------------------
|
|
1963
|
+
/** The first row (of `names`, in order: every row by default) that needs an answer and can take one, if any: what
|
|
1964
|
+
* the first-required scan opens. */
|
|
1965
|
+
var firstAttentionRow = function (names) {
|
|
1966
|
+
if (names === void 0) { names = Object.keys(availableOptions); }
|
|
1967
|
+
return (0, readFirst_1.getFirstAttentionOptionName)(names, function (fieldName) {
|
|
1968
|
+
var schema = options === null || options === void 0 ? void 0 : options[fieldName];
|
|
1969
|
+
if (!schema) {
|
|
1970
|
+
return undefined;
|
|
1971
|
+
}
|
|
1972
|
+
return {
|
|
1973
|
+
focusable: !readOnly &&
|
|
1974
|
+
!schema.disabled &&
|
|
1975
|
+
!schema.readonly &&
|
|
1976
|
+
!dependencyLockedNames.includes(fieldName),
|
|
1977
|
+
// Single source of truth: the same bucket the read-first status boxes
|
|
1978
|
+
// show, so a filled-but-invalid required row is a target too.
|
|
1979
|
+
needsAttention: getOptionBucket(fieldName) === 'attention',
|
|
1980
|
+
};
|
|
1981
|
+
});
|
|
1982
|
+
};
|
|
1983
|
+
var openFirstAttentionRow = function (target) {
|
|
1984
|
+
if (target) {
|
|
1985
|
+
setExpandedOptions(function (prev) {
|
|
1986
|
+
return prev.includes(target) ? prev
|
|
1987
|
+
: expandMode === 'multi' ? __spreadArray(__spreadArray([], prev, true), [target], false)
|
|
1988
|
+
// `expandMode: 'single'` is a rule about what a CLICK does: opening a
|
|
1989
|
+
// row closes the one the reader last opened. It is not a licence to
|
|
1990
|
+
// close a row the HOST named through `initialExpandedOptions`. That
|
|
1991
|
+
// is an address — a statement about what the page is FOR, made before
|
|
1992
|
+
// the reader did anything — and this scan is a convenience layered on
|
|
1993
|
+
// top of it. Keep the named rows; replace only what a click could.
|
|
1994
|
+
: __spreadArray(__spreadArray([], prev.filter(function (name) { return initialExpandedOptions === null || initialExpandedOptions === void 0 ? void 0 : initialExpandedOptions.includes(name); }), true), [target], false);
|
|
1995
|
+
});
|
|
1996
|
+
}
|
|
1997
|
+
};
|
|
1783
1998
|
// With `autoFocusFirstRequired`, drop the user straight into the first field
|
|
1784
1999
|
// they must fix. We reuse the engine's own ordering (`availableOptions`), the
|
|
1785
2000
|
// very same `getOptionBucket` the status boxes use to decide "needs attention"
|
|
@@ -1789,38 +2004,17 @@ var FormEngineImpl = function (_a) {
|
|
|
1789
2004
|
// `expandedOptions` — the row's editor-focus effect does the rest. No DOM
|
|
1790
2005
|
// scraping, no synthetic clicks, no polling.
|
|
1791
2006
|
//
|
|
1792
|
-
//
|
|
1793
|
-
//
|
|
1794
|
-
//
|
|
1795
|
-
//
|
|
1796
|
-
// genuine remount (a fresh instance)
|
|
1797
|
-
//
|
|
1798
|
-
//
|
|
1799
|
-
//
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
return undefined;
|
|
1804
|
-
}
|
|
1805
|
-
return {
|
|
1806
|
-
focusable: !readOnly &&
|
|
1807
|
-
!schema.disabled &&
|
|
1808
|
-
!schema.readonly &&
|
|
1809
|
-
!dependencyLockedNames.includes(fieldName),
|
|
1810
|
-
// Single source of truth: the same bucket the read-first status boxes
|
|
1811
|
-
// show, so a filled-but-invalid required row is a target too.
|
|
1812
|
-
needsAttention: getOptionBucket(fieldName) === 'attention',
|
|
1813
|
-
};
|
|
1814
|
-
}, [options, readOnly, dependencyLockedNames, getOptionBucket]);
|
|
1815
|
-
// Opening a row by name: `expandMode: 'single'` replaces only what a click could
|
|
1816
|
-
// (see the note in the opener below), never a row the host named.
|
|
1817
|
-
var openOption = (0, react_2.useCallback)(function (target) {
|
|
1818
|
-
return setExpandedOptions(function (prev) {
|
|
1819
|
-
return prev.includes(target) ? prev
|
|
1820
|
-
: expandMode === 'multi' ? __spreadArray(__spreadArray([], prev, true), [target], false) : __spreadArray(__spreadArray([], prev.filter(function (name) { return initialExpandedOptions === null || initialExpandedOptions === void 0 ? void 0 : initialExpandedOptions.includes(name); }), true), [target], false);
|
|
1821
|
-
});
|
|
1822
|
-
}, [expandMode, initialExpandedOptions]);
|
|
1823
|
-
var hasAutoFocusedRef = (0, react_2.useRef)(false);
|
|
2007
|
+
// It opens one row for the life of this instance, keyed on a field's arrival: the first field that needs an
|
|
2008
|
+
// answer when it first appears in the form. A schema that arrives after the mount, or in pieces, is covered: the
|
|
2009
|
+
// fields of a later piece are looked at when they arrive, as long as the scan has opened nothing yet. A field
|
|
2010
|
+
// already in the form that comes to need an answer (a value edited, a server-driven update) is not a reason to
|
|
2011
|
+
// open it, nor to re-grab focus; only a genuine remount (a fresh instance) arms the scan again.
|
|
2012
|
+
//
|
|
2013
|
+
// It waits only for the user's first move. A form opened from a button mounts while that button holds the
|
|
2014
|
+
// focus, and the scan waits for it to be free - but the user does not wait: they open a row (which spends
|
|
2015
|
+
// the scan, `expandOption`) or come into the form from the keyboard (which runs it, below). Waiting
|
|
2016
|
+
// past that, the scan ran the first time the focus rested on nothing, which is the Done that closes the
|
|
2017
|
+
// user's row, and opened the next row that needed an answer by itself in the middle of their work.
|
|
1824
2018
|
(0, react_2.useEffect)(function () {
|
|
1825
2019
|
// Two decisions, one scan. Both open the row that needs attention;
|
|
1826
2020
|
// `autoFocusFirstRequired` additionally promises the caret lands in it, and
|
|
@@ -1829,14 +2023,25 @@ var FormEngineImpl = function (_a) {
|
|
|
1829
2023
|
// CompactRow's tap-to-edit rule, and it declines just as firmly to take one
|
|
1830
2024
|
// that is already somewhere outside the row.
|
|
1831
2025
|
var wantsFocus = !!autoFocusFirstRequired;
|
|
1832
|
-
|
|
2026
|
+
// the schema the form holds is the one in force: not one a skeleton stands for, nor one the host has replaced
|
|
2027
|
+
if ((!wantsFocus && !expandFirstRequired) || !compact || !options || !schemaInForce) {
|
|
1833
2028
|
return;
|
|
1834
2029
|
}
|
|
1835
2030
|
if (hasAutoFocusedRef.current) {
|
|
1836
2031
|
return;
|
|
1837
2032
|
}
|
|
1838
2033
|
var orderedNames = Object.keys(availableOptions);
|
|
1839
|
-
|
|
2034
|
+
// the fields that have appeared since the scan last looked: only they can be what it opens
|
|
2035
|
+
var arrived = orderedNames.filter(function (name) { return !scannedFieldsRef.current.has(name); });
|
|
2036
|
+
if (!arrived.length) {
|
|
2037
|
+
return;
|
|
2038
|
+
}
|
|
2039
|
+
/* Read on the form the schema makes: a required field the schema brings is added to the form's value by the
|
|
2040
|
+
sync-down, an effect, so the render after the schema arrives. Read before that, the form had no row for it:
|
|
2041
|
+
the scan found nothing to open and was spent, and the field's row stayed closed (qorus#646: the Qorus IDE's
|
|
2042
|
+
pipeline processor, whose required field mappings arrive with its schema). */
|
|
2043
|
+
var formTheSchemaMakes = (0, exports.fixOptions)(fixedValue, options, undefined, isRendererOnly);
|
|
2044
|
+
if (Object.keys(formTheSchemaMakes || {}).some(function (name) { return !(name in fixedValue); })) {
|
|
1840
2045
|
return;
|
|
1841
2046
|
}
|
|
1842
2047
|
// Never grab focus from a control the user is already in — including a field
|
|
@@ -1855,73 +2060,107 @@ var FormEngineImpl = function (_a) {
|
|
|
1855
2060
|
if (wantsFocus && active && active !== document.body) {
|
|
1856
2061
|
return;
|
|
1857
2062
|
}
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
// `expandMode: 'single'` is a rule about what a CLICK does: opening a row
|
|
1865
|
-
// closes the one the reader last opened. It is not a licence to close a row
|
|
1866
|
-
// the HOST named through `initialExpandedOptions`. That is an address — a
|
|
1867
|
-
// statement about what the page is FOR, made before the reader did anything
|
|
1868
|
-
// — and this scan is a convenience layered on top of it. `openOption` keeps
|
|
1869
|
-
// the named rows and replaces only what a click could.
|
|
1870
|
-
openOption(target);
|
|
2063
|
+
// Looked at: a field here now is not looked at again, whatever it comes to hold.
|
|
2064
|
+
orderedNames.forEach(function (name) { return scannedFieldsRef.current.add(name); });
|
|
2065
|
+
var target = firstAttentionRow(arrived);
|
|
2066
|
+
if (!target) {
|
|
2067
|
+
// nothing that arrived needs an answer: the scan waits for the fields still to come
|
|
2068
|
+
return;
|
|
1871
2069
|
}
|
|
2070
|
+
hasAutoFocusedRef.current = true;
|
|
2071
|
+
openFirstAttentionRow(target);
|
|
1872
2072
|
}, [
|
|
1873
2073
|
autoFocusFirstRequired,
|
|
1874
2074
|
expandFirstRequired,
|
|
1875
2075
|
compact,
|
|
1876
2076
|
options,
|
|
2077
|
+
schemaInForce,
|
|
1877
2078
|
availableOptions,
|
|
1878
|
-
|
|
1879
|
-
|
|
2079
|
+
isRendererOnly,
|
|
2080
|
+
readOnly,
|
|
2081
|
+
dependencyLockedNames,
|
|
2082
|
+
getOptionBucket,
|
|
2083
|
+
expandMode,
|
|
2084
|
+
initialExpandedOptions,
|
|
1880
2085
|
]);
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
2086
|
+
/* The two first moves a user makes in a form opened from a button, while the scan above waits for the
|
|
2087
|
+
focus to be free:
|
|
2088
|
+
- pointing into the form (a click on a row, a field, the toolbar) is choosing where to work, and spends
|
|
2089
|
+
the scan, as opening a row does (`expandOption`);
|
|
2090
|
+
- coming into it from the keyboard (Tab from the button) chooses nothing, and runs the scan now: the user
|
|
2091
|
+
is put in the first row that needs an answer, once. Coming straight into a control they can type in
|
|
2092
|
+
(a field already open, the search box) is theirs, and spends the scan without moving them.
|
|
2093
|
+
Only while the scan still waits; it never runs twice. */
|
|
2094
|
+
var keyboardEntry = (0, react_2.useRef)();
|
|
2095
|
+
keyboardEntry.current = function (event) {
|
|
2096
|
+
if (hasAutoFocusedRef.current || !options || !Object.keys(availableOptions).length) {
|
|
1890
2097
|
return;
|
|
1891
2098
|
}
|
|
1892
|
-
|
|
1893
|
-
if (
|
|
2099
|
+
var from = event.relatedTarget;
|
|
2100
|
+
if (from && (compactWrapNode === null || compactWrapNode === void 0 ? void 0 : compactWrapNode.contains(from))) {
|
|
1894
2101
|
return;
|
|
1895
2102
|
}
|
|
1896
|
-
|
|
1897
|
-
|
|
2103
|
+
hasAutoFocusedRef.current = true;
|
|
2104
|
+
var entered = event.target;
|
|
2105
|
+
if ((0, rowFocus_1.isTypingControl)(entered)) {
|
|
1898
2106
|
return;
|
|
1899
2107
|
}
|
|
1900
|
-
var
|
|
1901
|
-
|
|
1902
|
-
if (active && active !== document.body && !(wrap === null || wrap === void 0 ? void 0 : wrap.contains(active))) {
|
|
1903
|
-
active.blur();
|
|
1904
|
-
}
|
|
1905
|
-
if (!expandedOptions.includes(target)) {
|
|
1906
|
-
// The row's own open effect reveals it and takes the caret.
|
|
1907
|
-
openOption(target);
|
|
2108
|
+
var target = firstAttentionRow();
|
|
2109
|
+
if (!target) {
|
|
1908
2110
|
return;
|
|
1909
2111
|
}
|
|
1910
|
-
//
|
|
1911
|
-
//
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
2112
|
+
// A row takes the caret only from nothing - never from an element the reader is on (see CompactRow) - so
|
|
2113
|
+
// the element the Tab landed on lets it go: the scan is what the reader came in for.
|
|
2114
|
+
entered.blur();
|
|
2115
|
+
openFirstAttentionRow(target);
|
|
2116
|
+
};
|
|
2117
|
+
(0, react_2.useEffect)(function () {
|
|
2118
|
+
if (!autoFocusFirstRequired || !compact || !compactWrapNode) {
|
|
2119
|
+
return undefined;
|
|
1918
2120
|
}
|
|
1919
|
-
|
|
2121
|
+
var onPointerDown = function () {
|
|
2122
|
+
hasAutoFocusedRef.current = true;
|
|
2123
|
+
};
|
|
2124
|
+
var onFocusIn = function (event) { var _a; return (_a = keyboardEntry.current) === null || _a === void 0 ? void 0 : _a.call(keyboardEntry, event); };
|
|
2125
|
+
// capture: the pointer is the user's choice before anything in the form answers it
|
|
2126
|
+
compactWrapNode.addEventListener('pointerdown', onPointerDown, true);
|
|
2127
|
+
compactWrapNode.addEventListener('focusin', onFocusIn);
|
|
2128
|
+
return function () {
|
|
2129
|
+
compactWrapNode.removeEventListener('pointerdown', onPointerDown, true);
|
|
2130
|
+
compactWrapNode.removeEventListener('focusin', onFocusIn);
|
|
2131
|
+
};
|
|
2132
|
+
}, [autoFocusFirstRequired, compact, compactWrapNode]);
|
|
1920
2133
|
// Read-first completion summary (how many shown options have a value set),
|
|
1921
2134
|
// surfaced as a progress meter at the top of the compact form.
|
|
1922
2135
|
var readFirstCompletion = (0, react_2.useMemo)(function () {
|
|
1923
|
-
return (0, readFirst_1.getReadFirstCompletion)(
|
|
1924
|
-
|
|
2136
|
+
return (0, readFirst_1.getReadFirstCompletion)(
|
|
2137
|
+
// a hidden field (its `depends_on` does not hold) is not in the form, nor in its meter
|
|
2138
|
+
(0, lodash_1.omit)(availableOptions, dependencyLockedNames), function (name) { return getOptionBucket(name) === 'attention'; });
|
|
2139
|
+
}, [JSON.stringify(availableOptions), getOptionBucket, dependencyLockedNames]);
|
|
2140
|
+
/* The hidden fields (their `depends_on` does not hold) that hold a value: kept, not dropped silently, so the form
|
|
2141
|
+
says so in a note - and whether the value is valid, as no field shows it (qorus#646, David). */
|
|
2142
|
+
var hiddenFieldsWithValues = (0, react_2.useMemo)(function () {
|
|
2143
|
+
return dependencyLockedNames
|
|
2144
|
+
.filter(function (name) { var _a; return !(0, readFirst_1.isOptionValueEmpty)((_a = availableOptions === null || availableOptions === void 0 ? void 0 : availableOptions[name]) === null || _a === void 0 ? void 0 : _a.value); })
|
|
2145
|
+
.map(function (name) {
|
|
2146
|
+
var field = availableOptions[name];
|
|
2147
|
+
var schema = options === null || options === void 0 ? void 0 : options[name];
|
|
2148
|
+
var type = (0, exports.getOptionFieldStorageType)(name, field.type, options, operators, field.op, isRendererOnly, optionHoldsExpression(field));
|
|
2149
|
+
var validation = (0, validations_1.validateFieldWithResult)((0, exports.getType)(type), field.value, __assign(__assign({ has_to_have_value: true, optionSchema: options, options: availableOptions }, schema), { isFunction: field.is_expression, hasOwnEditor: isRendererOnly(schema === null || schema === void 0 ? void 0 : schema.ui_type) }));
|
|
2150
|
+
return {
|
|
2151
|
+
name: name,
|
|
2152
|
+
label: (schema === null || schema === void 0 ? void 0 : schema.display_name) || name,
|
|
2153
|
+
conditions: (0, OptionFieldMessages_1.describeDependencies)(((schema === null || schema === void 0 ? void 0 : schema.depends_on) || []), options || {}),
|
|
2154
|
+
invalidReason: validation.isValid ? undefined : validation.reason,
|
|
2155
|
+
};
|
|
2156
|
+
});
|
|
2157
|
+
}, [
|
|
2158
|
+
dependencyLockedNames,
|
|
2159
|
+
JSON.stringify(availableOptions),
|
|
2160
|
+
JSON.stringify(options),
|
|
2161
|
+
JSON.stringify(operators),
|
|
2162
|
+
isRendererOnly,
|
|
2163
|
+
]);
|
|
1925
2164
|
var optionalFields = (0, react_2.useMemo)(function () {
|
|
1926
2165
|
return Object.keys(filteredOptions).map(function (option) {
|
|
1927
2166
|
var _a, _b, _c, _d, _f, _g;
|
|
@@ -2091,7 +2330,7 @@ var FormEngineImpl = function (_a) {
|
|
|
2091
2330
|
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { disabled: readOnly, icon: 'DeleteBinLine', effect: NegativeColorEffect, fixed: true, onClick: function () { return handleRemoveOperator(optionName, fixedValue, index); } })
|
|
2092
2331
|
: null] }, index));
|
|
2093
2332
|
}) }), (0, jsx_runtime_1.jsx)(reqore_1.ReqoreVerticalSpacer, { height: 5 })] })
|
|
2094
|
-
: null, (0, react_1.createElement)(TemplateField_1.TemplateField, __assign({ fluid: true }, options === null || options === void 0 ? void 0 : options[optionName], resolveInheritProps((_c = options === null || options === void 0 ? void 0 : options[optionName]) === null || _c === void 0 ? void 0 : _c.inherit_props, availableOptions, inheritedFromParent), {
|
|
2333
|
+
: null, (0, react_1.createElement)(TemplateField_1.TemplateField, __assign({ fluid: true }, options === null || options === void 0 ? void 0 : options[optionName], (0, inheritProps_1.resolveInheritProps)((_c = options === null || options === void 0 ? void 0 : options[optionName]) === null || _c === void 0 ? void 0 : _c.inherit_props, availableOptions, inheritedFromParent), {
|
|
2095
2334
|
// qorus#347-followup (scope forwarding): merge accumulated
|
|
2096
2335
|
// inheritance (`inheritedFromParent`) with THIS field's freshly
|
|
2097
2336
|
// resolved inherit_props, and pass down as a single bag so any
|
|
@@ -2120,6 +2359,9 @@ var FormEngineImpl = function (_a) {
|
|
|
2120
2359
|
// reqraft: form-level expression fields get the Visual/Text shell
|
|
2121
2360
|
// (DPQL text mode); opt out per-form via `templateFieldProps`.
|
|
2122
2361
|
allowTextExpressions: true,
|
|
2362
|
+
// a form's options enter their value on tabs: Value · Expression · Visual, or Value · Template
|
|
2363
|
+
// where only templates are taken (qorus#646); opt out per-form via `templateFieldProps`
|
|
2364
|
+
valueTabs: true,
|
|
2123
2365
|
// A fixed allowed-value field still needs its selector even when
|
|
2124
2366
|
// arbitrary custom values are forbidden. TemplateField uses this
|
|
2125
2367
|
// flag to decide whether to mount AutoFormField at all; treating
|
|
@@ -2163,15 +2405,14 @@ var FormEngineImpl = function (_a) {
|
|
|
2163
2405
|
readOnly ||
|
|
2164
2406
|
!(0, validations_1.hasAllDependenciesFullfilled)((_v = options === null || options === void 0 ? void 0 : options[optionName]) === null || _v === void 0 ? void 0 : _v.depends_on, availableOptions, options || {}), readOnly: readOnly, size: editorSize || rest.size, menuItems: (0, typeChoices_1.offersTypeChoices)(options === null || options === void 0 ? void 0 : options[optionName], anyLikeUiTypes) ?
|
|
2165
2407
|
getCustomMenuTemplateItems(optionName)
|
|
2166
|
-
: 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, isRendererOnly: isRendererOnly,
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
: '' })] }) })] })
|
|
2408
|
+
: 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, isRendererOnly: isRendererOnly }), operators && (0, size_1.default)(operators) && (0, size_1.default)(other.op) ?
|
|
2409
|
+
(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', className: 'options-operator-summary', children: (0, operatorSummary_1.operatorSummary)({
|
|
2410
|
+
label: (optionSchema === null || optionSchema === void 0 ? void 0 : optionSchema.display_name) || optionName,
|
|
2411
|
+
operatorKeys: operatorParts,
|
|
2412
|
+
operators: operators,
|
|
2413
|
+
value: other.value,
|
|
2414
|
+
shown: (0, readFirst_1.formatOptionValue)(__assign({ type: resolvedType }, other), optionSchema),
|
|
2415
|
+
}) })] })
|
|
2175
2416
|
: null] }));
|
|
2176
2417
|
}, [
|
|
2177
2418
|
options,
|
|
@@ -2188,7 +2429,7 @@ var FormEngineImpl = function (_a) {
|
|
|
2188
2429
|
fixedValue,
|
|
2189
2430
|
// Depend on the specific `rest` values used, not the whole `rest` object
|
|
2190
2431
|
// (which is a fresh `{...rest}` every render and would defeat the memo).
|
|
2191
|
-
|
|
2432
|
+
optionsSchema,
|
|
2192
2433
|
rest === null || rest === void 0 ? void 0 : rest.size,
|
|
2193
2434
|
handleValueChange,
|
|
2194
2435
|
handleOperatorChange,
|
|
@@ -2198,15 +2439,13 @@ var FormEngineImpl = function (_a) {
|
|
|
2198
2439
|
getTypeForOption,
|
|
2199
2440
|
inheritedScopes,
|
|
2200
2441
|
inheritedFromParent,
|
|
2201
|
-
revealRequired,
|
|
2202
|
-
visitedOptions,
|
|
2203
2442
|
]);
|
|
2204
2443
|
// Compact (read-first) rendering.
|
|
2205
|
-
// Theme-derived
|
|
2444
|
+
// Theme-derived colors so the flat-row layout adapts to light/dark/custom themes.
|
|
2206
2445
|
var cText = ((_b = theme === null || theme === void 0 ? void 0 : theme.text) === null || _b === void 0 ? void 0 : _b.color) || '#f1f0ee';
|
|
2207
|
-
// Text emphasis tiers via reqore's readable-
|
|
2446
|
+
// Text emphasis tiers via reqore's readable-color helper (key = full readable
|
|
2208
2447
|
// text, muted = its dimmed variant, faint = the dimmed variant softened
|
|
2209
|
-
// further) instead of hand-rolled hex-alpha suffixes on the raw text
|
|
2448
|
+
// further) instead of hand-rolled hex-alpha suffixes on the raw text color.
|
|
2210
2449
|
var cKey = (0, colors_1.getReadableColor)(theme);
|
|
2211
2450
|
var cMuted = (0, colors_1.getReadableColor)(theme, undefined, undefined, true);
|
|
2212
2451
|
var cFaint = "".concat(cMuted, "99");
|
|
@@ -2216,16 +2455,21 @@ var FormEngineImpl = function (_a) {
|
|
|
2216
2455
|
var cWarning = ((_d = theme === null || theme === void 0 ? void 0 : theme.intents) === null || _d === void 0 ? void 0 : _d.warning) || '#ffdf34';
|
|
2217
2456
|
var cInfo = ((_f = theme === null || theme === void 0 ? void 0 : theme.intents) === null || _f === void 0 ? void 0 : _f.info) || '#3b8eea';
|
|
2218
2457
|
var cSuccess = ((_g = theme === null || theme === void 0 ? void 0 : theme.intents) === null || _g === void 0 ? void 0 : _g.success) || '#36b37e';
|
|
2458
|
+
// the rows' own words and marks, in colors that read on every surface a row is drawn on
|
|
2459
|
+
var rowInks = (0, react_2.useMemo)(function () { return (0, readFirstColors_1.getReadFirstInks)(theme); }, [theme]);
|
|
2460
|
+
// an option panel's short description, faint: as faint as it still reads in the theme
|
|
2461
|
+
var optionDescOpacity = (0, react_2.useMemo)(function () { return (0, readableColors_1.getReadableTextOpacity)(theme, 0.3); }, [theme]);
|
|
2462
|
+
/* an invalid option's mark in its panel's title: the danger, in the shade of it that stands out as reqore draws a
|
|
2463
|
+
title icon, at 70% (danger:lighten:5 was 2.9:1) */
|
|
2464
|
+
var invalidOptionIconColor = (0, react_2.useMemo)(function () {
|
|
2465
|
+
return (0, readableColors_1.getReadableShade)(cDanger, (0, readableColors_1.getThemeSurfaces)(theme), readableColors_1.READABLE_ICON, PANEL_TITLE_ICON_ALPHA);
|
|
2466
|
+
}, [theme, cDanger]);
|
|
2219
2467
|
var cBg = (theme === null || theme === void 0 ? void 0 : theme.main) || '#181818';
|
|
2220
2468
|
var cRowBg = (0, colors_1.changeDarkness)((0, colors_1.getMainBackgroundColor)(theme), 0.01);
|
|
2221
2469
|
var cGroupLine = "".concat(cText, "1f");
|
|
2222
2470
|
// The "N more fields" row's dashed edge. Well above the divider tint: this
|
|
2223
2471
|
// one is an affordance the reader has to notice, not a hairline between rows.
|
|
2224
2472
|
var cMoreBorder = "".concat(cText, "4d");
|
|
2225
|
-
// Calm: the section surface and its hairline, from the theme's panel (the
|
|
2226
|
-
// same surface and edge Reqore gives the section panels themselves).
|
|
2227
|
-
var cPanel = (0, formAppearance_1.getCalmPanelSurface)(theme);
|
|
2228
|
-
var cHairline = (0, formAppearance_1.getCalmPanelHairline)(theme);
|
|
2229
2473
|
// The closure surface the extracted CompactRow reads through context. Refs and
|
|
2230
2474
|
// setters are stable; the state/memo/handler fields change identity as they do
|
|
2231
2475
|
// today, so a row re-renders exactly when its inputs do.
|
|
@@ -2240,10 +2484,11 @@ var FormEngineImpl = function (_a) {
|
|
|
2240
2484
|
focusedEditing: focusedEditing,
|
|
2241
2485
|
showFieldTypes: showFieldTypes,
|
|
2242
2486
|
codePreviewRenderer: codePreviewRenderer,
|
|
2487
|
+
codeEditor: componentOverrides === null || componentOverrides === void 0 ? void 0 : componentOverrides['code-editor'],
|
|
2488
|
+
readSummaries: readSummaries,
|
|
2489
|
+
cardEditorTypes: cardEditorTypes,
|
|
2243
2490
|
showAllDescriptions: showAllDescriptions,
|
|
2244
2491
|
expandedOptions: expandedOptions,
|
|
2245
|
-
visitedOptions: visitedOptions,
|
|
2246
|
-
revealRequired: revealRequired,
|
|
2247
2492
|
highlightedOptions: highlightedOptions,
|
|
2248
2493
|
flashedOptions: flashedOptions,
|
|
2249
2494
|
infoPanelOverrides: infoPanelOverrides,
|
|
@@ -2256,7 +2501,8 @@ var FormEngineImpl = function (_a) {
|
|
|
2256
2501
|
requiredGroupsInfo: requiredGroupsInfo,
|
|
2257
2502
|
handleValueChange: handleValueChange,
|
|
2258
2503
|
handleAddOptionalFieldChange: handleAddOptionalFieldChange,
|
|
2259
|
-
|
|
2504
|
+
expandOption: expandOption,
|
|
2505
|
+
collapseOption: collapseOption,
|
|
2260
2506
|
flashOption: flashOption,
|
|
2261
2507
|
hasOptionChanged: hasOptionChanged,
|
|
2262
2508
|
handleOptionLabelClick: handleOptionLabelClick,
|
|
@@ -2279,6 +2525,7 @@ var FormEngineImpl = function (_a) {
|
|
|
2279
2525
|
cWarning: cWarning,
|
|
2280
2526
|
cInfo: cInfo,
|
|
2281
2527
|
cBg: cBg,
|
|
2528
|
+
rowInks: rowInks,
|
|
2282
2529
|
}); }, [
|
|
2283
2530
|
templates.value,
|
|
2284
2531
|
readOnly,
|
|
@@ -2289,10 +2536,11 @@ var FormEngineImpl = function (_a) {
|
|
|
2289
2536
|
focusedEditing,
|
|
2290
2537
|
showFieldTypes,
|
|
2291
2538
|
codePreviewRenderer,
|
|
2539
|
+
componentOverrides,
|
|
2540
|
+
readSummaries,
|
|
2541
|
+
cardEditorTypes,
|
|
2292
2542
|
showAllDescriptions,
|
|
2293
2543
|
expandedOptions,
|
|
2294
|
-
visitedOptions,
|
|
2295
|
-
revealRequired,
|
|
2296
2544
|
highlightedOptions,
|
|
2297
2545
|
flashedOptions,
|
|
2298
2546
|
infoPanelOverrides,
|
|
@@ -2305,7 +2553,8 @@ var FormEngineImpl = function (_a) {
|
|
|
2305
2553
|
requiredGroupsInfo,
|
|
2306
2554
|
handleValueChange,
|
|
2307
2555
|
handleAddOptionalFieldChange,
|
|
2308
|
-
|
|
2556
|
+
expandOption,
|
|
2557
|
+
collapseOption,
|
|
2309
2558
|
flashOption,
|
|
2310
2559
|
hasOptionChanged,
|
|
2311
2560
|
handleOptionLabelClick,
|
|
@@ -2328,6 +2577,7 @@ var FormEngineImpl = function (_a) {
|
|
|
2328
2577
|
cWarning,
|
|
2329
2578
|
cInfo,
|
|
2330
2579
|
cBg,
|
|
2580
|
+
rowInks,
|
|
2331
2581
|
]);
|
|
2332
2582
|
// `compactToolbar` resolved to a full object, so neither the context type nor
|
|
2333
2583
|
// the toolbar itself has to re-default anything. `null` means no toolbar.
|
|
@@ -2341,7 +2591,6 @@ var FormEngineImpl = function (_a) {
|
|
|
2341
2591
|
readOnly: readOnly,
|
|
2342
2592
|
invalidCount: (0, size_1.default)(validityData.invalidFields),
|
|
2343
2593
|
attentionCount: readFirstAttentionCount,
|
|
2344
|
-
attentionFaultCount: readFirstAttentionFaultCount,
|
|
2345
2594
|
completion: readFirstCompletion,
|
|
2346
2595
|
showInvalidOnly: showInvalidOptionsOnly,
|
|
2347
2596
|
onToggleInvalidOnly: handleToggleInvalidOnly,
|
|
@@ -2388,7 +2637,6 @@ var FormEngineImpl = function (_a) {
|
|
|
2388
2637
|
onReadOnlyActivate,
|
|
2389
2638
|
validityData,
|
|
2390
2639
|
readFirstAttentionCount,
|
|
2391
|
-
readFirstAttentionFaultCount,
|
|
2392
2640
|
readFirstCompletion,
|
|
2393
2641
|
showInvalidOptionsOnly,
|
|
2394
2642
|
handleToggleInvalidOnly,
|
|
@@ -2418,12 +2666,8 @@ var FormEngineImpl = function (_a) {
|
|
|
2418
2666
|
// removes it, and then the header carries just the consumer's own actions.
|
|
2419
2667
|
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]);
|
|
2420
2668
|
var renderCompact = function () {
|
|
2421
|
-
var _a, _b, _c, _d
|
|
2422
|
-
|
|
2423
|
-
// toolbar's glass is invisible until something scrolls under it.
|
|
2424
|
-
var headerBg = calm && compactHostColour ?
|
|
2425
|
-
"rgba(".concat(compactHostColour.join(', '), ", 0.88)")
|
|
2426
|
-
: "".concat(calm ? (0, colors_1.getMainBackgroundColor)(theme) : (0, colors_1.changeDarkness)((0, colors_1.getMainBackgroundColor)(theme), 0.02)).concat((0, colors_1.percentToHexAlpha)(88));
|
|
2669
|
+
var _a, _b, _c, _d;
|
|
2670
|
+
var headerBg = "".concat((0, colors_1.changeDarkness)((0, colors_1.getMainBackgroundColor)(theme), 0.02)).concat((0, colors_1.percentToHexAlpha)(88));
|
|
2427
2671
|
// Toolbar filters narrow the listed rows; the meter reflects the full set.
|
|
2428
2672
|
var query = compactQuery.trim().toLowerCase();
|
|
2429
2673
|
var matchesQuery = function (optionName) { var _a; return !query || (((_a = options === null || options === void 0 ? void 0 : options[optionName]) === null || _a === void 0 ? void 0 : _a.display_name) || optionName).toLowerCase().includes(query); };
|
|
@@ -2652,24 +2896,16 @@ var FormEngineImpl = function (_a) {
|
|
|
2652
2896
|
var stickyBoxHeaders = compactStickyBoxHeaders && !compactNested;
|
|
2653
2897
|
var boxStickyOffset = compactStickyOffset + compactToolbarHeight;
|
|
2654
2898
|
var STATUS_BOXES = [
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
icon: 'ErrorWarningLine',
|
|
2663
|
-
}
|
|
2664
|
-
: {
|
|
2665
|
-
key: 'attention',
|
|
2666
|
-
label: (_b = compactBoxLabels === null || compactBoxLabels === void 0 ? void 0 : compactBoxLabels.pending) !== null && _b !== void 0 ? _b : 'To fill in',
|
|
2667
|
-
icon: 'CheckboxBlankCircleLine',
|
|
2668
|
-
},
|
|
2669
|
-
{ key: 'set', label: (_c = compactBoxLabels === null || compactBoxLabels === void 0 ? void 0 : compactBoxLabels.set) !== null && _c !== void 0 ? _c : 'Set', intent: 'success', icon: 'CheckLine' },
|
|
2899
|
+
{
|
|
2900
|
+
key: 'attention',
|
|
2901
|
+
label: (_a = compactBoxLabels === null || compactBoxLabels === void 0 ? void 0 : compactBoxLabels.attention) !== null && _a !== void 0 ? _a : 'Needs attention',
|
|
2902
|
+
intent: 'warning',
|
|
2903
|
+
icon: 'ErrorWarningLine',
|
|
2904
|
+
},
|
|
2905
|
+
{ key: 'set', label: (_b = compactBoxLabels === null || compactBoxLabels === void 0 ? void 0 : compactBoxLabels.set) !== null && _b !== void 0 ? _b : 'Set', intent: 'success', icon: 'CheckLine' },
|
|
2670
2906
|
{
|
|
2671
2907
|
key: 'optional',
|
|
2672
|
-
label: (
|
|
2908
|
+
label: (_c = compactBoxLabels === null || compactBoxLabels === void 0 ? void 0 : compactBoxLabels.optional) !== null && _c !== void 0 ? _c : 'Optional',
|
|
2673
2909
|
icon: 'CheckboxBlankCircleLine',
|
|
2674
2910
|
},
|
|
2675
2911
|
];
|
|
@@ -2719,10 +2955,7 @@ var FormEngineImpl = function (_a) {
|
|
|
2719
2955
|
// "Covers"/"Covered by" chips already say which member satisfies it.
|
|
2720
2956
|
if (requiredGroupsInfo.satisfiedBy[grp])
|
|
2721
2957
|
return railed;
|
|
2722
|
-
|
|
2723
|
-
// then it is still to fill in, in the quiet colour, like its members.
|
|
2724
|
-
var clusterColor = memberEntries.some(function (e) { return getOptionStatus(e.name) !== 'pending'; }) ? cWarning : cMuted;
|
|
2725
|
-
return ((0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRequiredClusterBox, { className: 'options-readfirst-required-cluster', "$border": "".concat(clusterColor, "33"), "$tint": "".concat(clusterColor, "0d"), "$calm": calm, children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRequiredClusterHeader, { className: 'options-readfirst-required-cluster-header', "$color": clusterColor, "$calm": calm, children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: 'LinkM', size: calm ? '13px' : '11px', style: { color: clusterColor } }), "One of the below is required"] }), railed] }, grp));
|
|
2958
|
+
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": rowInks.warning, children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: 'LinkM', size: '11px', style: { color: rowInks.warning } }), "One of the below is required"] }), railed] }, grp));
|
|
2726
2959
|
});
|
|
2727
2960
|
};
|
|
2728
2961
|
// One schema group inside a status box: its thin sub-label, the group's
|
|
@@ -2741,35 +2974,24 @@ var FormEngineImpl = function (_a) {
|
|
|
2741
2974
|
return null;
|
|
2742
2975
|
}
|
|
2743
2976
|
return ((0, jsx_runtime_1.jsxs)(react_2.default.Fragment, { children: [showGroupSubLabel(groupName) ?
|
|
2744
|
-
(0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledStatusBoxGroupLabel, {
|
|
2977
|
+
(0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledStatusBoxGroupLabel, { children: (0, readFirst_1.getOptionGroupLabel)(groupName, groups) })
|
|
2745
2978
|
: null, showGroupSubLabel(groupName) && (groupConfig === null || groupConfig === void 0 ? void 0 : groupConfig.subtitle) ?
|
|
2746
|
-
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreP, {
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
:
|
|
2751
|
-
|
|
2752
|
-
marginBottom: 8,
|
|
2753
|
-
marginLeft: compactRowStyles_1.GROUP_INDENT,
|
|
2754
|
-
paddingRight: 10,
|
|
2755
|
-
}, children: groupConfig.subtitle })
|
|
2979
|
+
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreP, { size: 'small', effect: { opacity: 0.6 }, style: {
|
|
2980
|
+
marginTop: 2,
|
|
2981
|
+
marginBottom: 8,
|
|
2982
|
+
marginLeft: compactRowStyles_1.GROUP_INDENT,
|
|
2983
|
+
paddingRight: 10,
|
|
2984
|
+
}, children: groupConfig.subtitle })
|
|
2756
2985
|
: null, renderGroupRows(rows)] }, groupName));
|
|
2757
2986
|
};
|
|
2758
2987
|
return ((0, jsx_runtime_1.jsx)(optionsContext_1.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', "$ownScroll": compactScroll === 'own' && !compactNested, children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledCompactPanel
|
|
2759
2988
|
// Mirrors the toolbar's own search-row gate: when no search
|
|
2760
2989
|
// row renders, the header is a thin strip and sits tight to
|
|
2761
2990
|
// the first status box (see StyledCompactPanel).
|
|
2762
|
-
, __assign({ "$tightHeader": !((compactToolbarParts === null || compactToolbarParts === void 0 ? void 0 : compactToolbarParts.search) && (0, size_1.default)(options) > 1), "$headerBg": compactNested ? 'transparent' : headerBg, "$nested": compactNested, "$
|
|
2991
|
+
, __assign({ "$tightHeader": !((compactToolbarParts === null || compactToolbarParts === void 0 ? void 0 : compactToolbarParts.search) && (0, size_1.default)(options) > 1), "$headerBg": compactNested ? 'transparent' : headerBg, "$nested": compactNested, "$stickyBoxes": compactStickyBoxHeaders && !compactNested, "$stackHeader": compactNarrow &&
|
|
2763
2992
|
!!((compactPanelProps === null || compactPanelProps === void 0 ? void 0 : compactPanelProps.label) ||
|
|
2764
2993
|
(compactPanelProps === null || compactPanelProps === void 0 ? void 0 : compactPanelProps.icon) ||
|
|
2765
|
-
((
|
|
2766
|
-
// Calm: no surface and no lift at all. A theme that gives
|
|
2767
|
-
// panels a surface of their own (Reqore's `theme.panel`) would
|
|
2768
|
-
// otherwise paint this wrapper as a card around the section
|
|
2769
|
-
// cards inside it. Transparent and un-raised, Reqore also drops
|
|
2770
|
-
// the wrapper's horizontal padding, so the readiness line, the
|
|
2771
|
-
// search and the sections share one left edge with the host.
|
|
2772
|
-
raised: !calm, minimal: true, transparent: calm || undefined,
|
|
2994
|
+
((_d = compactPanelProps === null || compactPanelProps === void 0 ? void 0 : compactPanelProps.actions) === null || _d === void 0 ? void 0 : _d.length)), flat: true, raised: true, minimal: true,
|
|
2773
2995
|
// No panel background: the form sits transparently on whatever
|
|
2774
2996
|
// hosts it (page, drawer, or — for an arg_schema field — the
|
|
2775
2997
|
// parent's edit card) instead of stacking its own dark surface.
|
|
@@ -2817,13 +3039,13 @@ var FormEngineImpl = function (_a) {
|
|
|
2817
3039
|
visible` to `auto` unless the other axis is visible or
|
|
2818
3040
|
clip, which would put the scrollport straight back. `clip`
|
|
2819
3041
|
keeps the horizontal guard the row ellipsis relies on. */
|
|
2820
|
-
overflowY: 'visible', overflowX: 'clip' }, compactPanelProps === null || compactPanelProps === void 0 ? void 0 : compactPanelProps.contentStyle), children: [(0, size_1.default)(groupKeys) === 0 || (readOnly && !bucketCount('set')) ?
|
|
3042
|
+
overflowY: 'visible', overflowX: 'clip' }, compactPanelProps === null || compactPanelProps === void 0 ? void 0 : compactPanelProps.contentStyle), children: [(0, jsx_runtime_1.jsx)(HiddenFieldsNote_1.HiddenFieldsNote, { fields: hiddenFieldsWithValues }), (0, size_1.default)(groupKeys) === 0 || (readOnly && !bucketCount('set')) ?
|
|
2821
3043
|
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreMessage, { flat: true, opaque: false, size: 'small', children: readOnly && !query ?
|
|
2822
3044
|
'Nothing is set.'
|
|
2823
3045
|
: 'No fields match the current filters.' })
|
|
2824
3046
|
: null, readOnly ?
|
|
2825
3047
|
bucketCount('set') ?
|
|
2826
|
-
(0, jsx_runtime_1.jsx)("div", { className: 'options-readfirst-read', style: { padding:
|
|
3048
|
+
(0, jsx_runtime_1.jsx)("div", { className: 'options-readfirst-read', style: { padding: '4px 4px 6px' }, children: (0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledGroupBody, { "$divider": cDivider, "$hover": cHover, "$focus": cWarning, "$success": cSuccess, "$rowBg": cRowBg, "$lineColor": cGroupLine, "$moreBorder": cMoreBorder, className: compactNarrow ? 'readfirst-narrow' : undefined, children: bucketGroups.set.map(function (groupName) { return renderBoxGroup('set', groupName); }) }) })
|
|
2827
3049
|
: null
|
|
2828
3050
|
: STATUS_BOXES.map(function (box) {
|
|
2829
3051
|
var groupsInBox = bucketGroups[box.key];
|
|
@@ -2844,12 +3066,6 @@ var FormEngineImpl = function (_a) {
|
|
|
2844
3066
|
// Group order is preserved so the visible rows read in the
|
|
2845
3067
|
// same order they would if nothing were folded.
|
|
2846
3068
|
var orderedRows = groupsInBox.flatMap(function (groupName) { return buckets[box.key][groupName] || []; });
|
|
2847
|
-
// The number in the box's header counts the rows whose value
|
|
2848
|
-
// belongs in it NOW. A field being edited keeps its box until it
|
|
2849
|
-
// is left (so it does not jump away under the caret), and it used
|
|
2850
|
-
// to keep its count too: a box read "To fill in 1" while its last
|
|
2851
|
-
// field already had a value and the host's submit read ready.
|
|
2852
|
-
var headerCount = readOnly ? count : (orderedRows.filter(function (entry) { return getOptionBucket(entry.name, entry.hidden) === box.key; }).length);
|
|
2853
3069
|
// Optional's own rule first: a box opened solely to reveal
|
|
2854
3070
|
// preselected rows offers those, not an arbitrary first-N.
|
|
2855
3071
|
var candidateRows = splitForPreselected ? orderedRows.filter(isPreselectedRow) : orderedRows;
|
|
@@ -2874,32 +3090,23 @@ var FormEngineImpl = function (_a) {
|
|
|
2874
3090
|
return (buckets[box.key][groupName] || []).some(function (entry) { return !shownRowSet.has(entry.name); });
|
|
2875
3091
|
});
|
|
2876
3092
|
var moreOpen = Boolean(query) || expandedMoreBoxes.includes(box.key);
|
|
2877
|
-
var accent = box.key === 'attention'
|
|
3093
|
+
var accent = box.key === 'attention' ? cWarning
|
|
2878
3094
|
: box.key === 'set' ? cSuccess
|
|
2879
3095
|
: cMuted;
|
|
2880
3096
|
// The muted "Optional" box reads as a quieter, recessed
|
|
2881
3097
|
// surface — a touch darker than the page rather than the
|
|
2882
3098
|
// faint grey tint the accent would give.
|
|
2883
|
-
|
|
2884
|
-
var boxBg = box.key === 'optional' && !calm ?
|
|
3099
|
+
var boxBg = box.key === 'optional' ?
|
|
2885
3100
|
(0, colors_1.changeDarkness)((0, colors_1.getMainBackgroundColor)(theme), 0.06)
|
|
2886
3101
|
: undefined;
|
|
2887
|
-
return ((0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledStatusBox, { "$accent": accent, "$bg": boxBg, "$
|
|
2888
|
-
calm ? cPanel
|
|
2889
|
-
: (0, colors_1.getMainBackgroundColor)(theme)
|
|
2890
|
-
: undefined, ref: function (node) {
|
|
3102
|
+
return ((0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledStatusBox, { "$accent": accent, "$bg": boxBg, "$surface": stickyBoxHeaders ? (0, colors_1.getMainBackgroundColor)(theme) : undefined, ref: function (node) {
|
|
2891
3103
|
statusBoxRefs.current[box.key] = node;
|
|
2892
3104
|
},
|
|
2893
3105
|
// Opening arms the reveal; collapsing disarms it, so a
|
|
2894
3106
|
// close never scrolls.
|
|
2895
3107
|
onCollapseChange: function (collapsed) {
|
|
2896
3108
|
return setOpenedStatusBox(collapsed ? undefined : box.key);
|
|
2897
|
-
},
|
|
2898
|
-
// Calm: an ordinary panel — Reqore paints the theme's
|
|
2899
|
-
// panel surface and its hairline edge. The header stays
|
|
2900
|
-
// minimal (no surface or rule of its own); the first
|
|
2901
|
-
// row's hairline is the line under it.
|
|
2902
|
-
flat: !calm, minimal: true,
|
|
3109
|
+
}, flat: true, minimal: true,
|
|
2903
3110
|
/* The header stays on screen while its own box is
|
|
2904
3111
|
being read — see `compactStickyBoxHeaders`. Sticky
|
|
2905
3112
|
is bounded by its containing block, so the header
|
|
@@ -2931,17 +3138,7 @@ var FormEngineImpl = function (_a) {
|
|
|
2931
3138
|
// the box reveals the preselected fields without also
|
|
2932
3139
|
// dumping every not-yet-added optional field on the
|
|
2933
3140
|
// author.
|
|
2934
|
-
isCollapsed: wouldCollapse && !hasPreselectedRows, label:
|
|
2935
|
-
// One status dot and a word — and only where a
|
|
2936
|
-
// person is needed. The count is a quiet number.
|
|
2937
|
-
(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledGroupHeader, { "$calm": true, children: [box.key === 'attention' && readFirstAttentionFaultCount ?
|
|
2938
|
-
(0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledStatusDot, { className: 'options-readfirst-group-dot', "$color": cWarning, "aria-hidden": true })
|
|
2939
|
-
: null, (0, jsx_runtime_1.jsx)(reqore_1.ReqoreP, { effect: { weight: 'bold' }, size: 'normal', children: box.label }), headerCount ?
|
|
2940
|
-
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreSpan, { className: 'options-readfirst-group-count', size: 'small', effect: { opacity: 0.65 }, children: headerCount })
|
|
2941
|
-
: null] })
|
|
2942
|
-
: (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 }), headerCount ?
|
|
2943
|
-
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { size: 'small', minimal: true, compact: true, intent: box.intent, label: String(headerCount) })
|
|
2944
|
-
: null] }), icon: calm ? undefined : box.icon, className: 'options-readfirst-group', padded: false, contentStyle: { padding: calm ? 0 : '4px 4px 6px' }, children: (0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledGroupBody, { "$calm": calm, "$hairline": cHairline, "$divider": cDivider, "$hover": cHover, "$focus": cWarning, "$success": cSuccess, "$rowBg": cRowBg, "$lineColor": cGroupLine, "$moreBorder": cMoreBorder, className: compactNarrow ? 'readfirst-narrow' : undefined, children: [shownGroups.map(function (groupName) {
|
|
3141
|
+
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) {
|
|
2945
3142
|
return renderBoxGroup(box.key, groupName, shownRowSet);
|
|
2946
3143
|
}), deferredCount ?
|
|
2947
3144
|
(0, jsx_runtime_1.jsxs)("button", { type: 'button', className: 'readfirst-row readfirst-more-row options-readfirst-more', "aria-expanded": moreOpen, onClick: function () {
|
|
@@ -2959,7 +3156,7 @@ var FormEngineImpl = function (_a) {
|
|
|
2959
3156
|
})
|
|
2960
3157
|
: null] }) }, box.key));
|
|
2961
3158
|
})] })), commitMode === 'batched' && !readOnly && dirtyOptionNames.length ?
|
|
2962
|
-
(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 ?
|
|
3159
|
+
(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') }), validityData.isValid ? null : ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { size: 'tiny', minimal: true, flat: true, wrap: true, intent: 'danger', icon: 'ErrorWarningLine', className: 'options-readfirst-commit-blocked', label: (0, readFirst_1.describeBlockedSave)(validityData.invalidFields, options) })), (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 ?
|
|
2963
3160
|
'Apply the staged changes'
|
|
2964
3161
|
: 'Resolve the invalid fields before saving', onClick: handleCommitClick, children: "Save" }), (0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { size: 'small', minimal: true, flat: true, fixed: true, icon: 'HistoryLine', className: 'options-readfirst-discard', onClick: handleRevertChangesClick, children: "Discard" })] }) })
|
|
2965
3162
|
: null] }) })] }) }) }));
|
|
@@ -2967,7 +3164,10 @@ var FormEngineImpl = function (_a) {
|
|
|
2967
3164
|
/* Which of the seven waits is holding the form, in the order they are
|
|
2968
3165
|
tested. Rendered as `data-wait` on the placeholder so a page can be asked
|
|
2969
3166
|
what it is waiting FOR instead of only that it is waiting. */
|
|
2970
|
-
var waitReason = rest.skeleton ?
|
|
3167
|
+
var waitReason = rest.skeleton ?
|
|
3168
|
+
skeletonReason ?
|
|
3169
|
+
"host:".concat(skeletonReason)
|
|
3170
|
+
: 'host'
|
|
2971
3171
|
: templates.loading ? 'templates'
|
|
2972
3172
|
: typesLoading ? 'types'
|
|
2973
3173
|
: optionsLoading ? 'options'
|
|
@@ -3002,11 +3202,11 @@ var FormEngineImpl = function (_a) {
|
|
|
3002
3202
|
'Showing invalid fields only. Click here again to show all fields.'
|
|
3003
3203
|
: "".concat((0, size_1.default)(validityData.invalidFields) < 2 ? 'A field is not valid and requires' : "".concat((0, size_1.default)(validityData.invalidFields), " fields are not valid and require"), " attention. Click here to only show invalid fields.") })
|
|
3004
3204
|
: null, unavailableOptionsCount.current ?
|
|
3005
|
-
(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreMessage, { intent: 'warning', opaque: false, size: 'small', margin: 'bottom', children: "".concat(unavailableOptionsCount.current, "
|
|
3006
|
-
: null, children, (0, size_1.default)(filteredOptions) >= 1 && !readOnly ?
|
|
3205
|
+
(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreMessage, { intent: 'warning', opaque: false, size: 'small', margin: 'bottom', children: "".concat(unavailableOptionsCount.current, " ").concat(unavailableOptionsCount.current === 1 ? 'field' : 'fields', " hidden because they are not supported on the current instance") }), (0, jsx_runtime_1.jsx)(reqore_1.ReqoreVerticalSpacer, { height: 10 })] })
|
|
3206
|
+
: null, (0, jsx_runtime_1.jsx)(HiddenFieldsNote_1.HiddenFieldsNote, { fields: hiddenFieldsWithValues }), children, (0, size_1.default)(filteredOptions) >= 1 && !readOnly ?
|
|
3007
3207
|
(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreVerticalSpacer, { height: 10 }), (0, jsx_runtime_1.jsx)(Select_1.SelectFormField, { items: optionalFields, onChange: function (val) { return handleAddOptionalFieldChange('options', val); }, placeholder: placeholder || 'More Options Available', minimal: true, icon: 'ListView', showDescription: false, fluid: true, size: rest.size })] })
|
|
3008
3208
|
: null] })); }, sortButtonProps: { minimal: true }, showLayoutSwitch: false, style: { width: '100%' }, items: (0, map_1.default)(shownOptions, function (_a, optionName) {
|
|
3009
|
-
var _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
3209
|
+
var _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
3010
3210
|
var type = _a.type, other = __rest(_a, ["type"]);
|
|
3011
3211
|
return ({
|
|
3012
3212
|
label: ((_b = options[optionName]) === null || _b === void 0 ? void 0 : _b.display_name) || optionName,
|
|
@@ -3022,22 +3222,22 @@ var FormEngineImpl = function (_a) {
|
|
|
3022
3222
|
cursor: 'help',
|
|
3023
3223
|
}
|
|
3024
3224
|
: undefined,
|
|
3025
|
-
onClick: (0
|
|
3026
|
-
function () { return handleOptionLabelClick(optionName); }
|
|
3027
|
-
: undefined,
|
|
3225
|
+
onClick: ((_f = options[optionName]) === null || _f === void 0 ? void 0 : _f.desc) ? function () { return handleOptionLabelClick(optionName); } : undefined,
|
|
3028
3226
|
},
|
|
3029
|
-
showLabelTooltip: !!((
|
|
3227
|
+
showLabelTooltip: !!((_g = options[optionName]) === null || _g === void 0 ? void 0 : _g.short_desc),
|
|
3030
3228
|
customLabelTooltip: {
|
|
3031
3229
|
delay: 300,
|
|
3032
|
-
content: ((0, jsx_runtime_1.jsx)(Description_1.Description, { longDescription: "".concat((
|
|
3230
|
+
content: ((0, jsx_runtime_1.jsx)(Description_1.Description, { longDescription: "".concat((_h = options[optionName]) === null || _h === void 0 ? void 0 : _h.short_desc).concat(((_j = options[optionName]) === null || _j === void 0 ? void 0 : _j.desc) ? '. Click to learn more.' : ''), margin: 'none' })),
|
|
3033
3231
|
},
|
|
3034
3232
|
description: showFieldTypes ?
|
|
3035
|
-
|
|
3233
|
+
[(0, qorusTypeCatalogue_1.optionTypeWords)(options[optionName], typeName), options[optionName].short_desc]
|
|
3234
|
+
.filter(Boolean)
|
|
3235
|
+
.join(' · ')
|
|
3036
3236
|
: options[optionName].short_desc || '',
|
|
3037
3237
|
descriptionEffect: {
|
|
3038
3238
|
textSize: '11px',
|
|
3039
|
-
opacity:
|
|
3040
|
-
underline: (
|
|
3239
|
+
opacity: optionDescOpacity,
|
|
3240
|
+
underline: ((_k = options[optionName]) === null || _k === void 0 ? void 0 : _k.desc) ? 'underline dotted #878787' : undefined,
|
|
3041
3241
|
},
|
|
3042
3242
|
customTheme: {
|
|
3043
3243
|
main: 'main:darken:1',
|
|
@@ -3046,7 +3246,7 @@ var FormEngineImpl = function (_a) {
|
|
|
3046
3246
|
icon: !isOptionValid(optionName, type, other.value) ? 'SpamFill'
|
|
3047
3247
|
: undefined,
|
|
3048
3248
|
iconColor: !isOptionValid(optionName, type, other.value) ?
|
|
3049
|
-
|
|
3249
|
+
invalidOptionIconColor
|
|
3050
3250
|
: undefined,
|
|
3051
3251
|
transparent: false,
|
|
3052
3252
|
intent: getIntent(optionName, type, other.value, other.op),
|
|
@@ -3074,7 +3274,7 @@ var FormEngineImpl = function (_a) {
|
|
|
3074
3274
|
menu: [
|
|
3075
3275
|
!readOnly &&
|
|
3076
3276
|
type !== 'code-editor' &&
|
|
3077
|
-
(((
|
|
3277
|
+
(((_l = options[optionName]) === null || _l === void 0 ? void 0 : _l.ui_type) || ((_m = options[optionName]) === null || _m === void 0 ? void 0 : _m.type)) !==
|
|
3078
3278
|
'code-editor' && {
|
|
3079
3279
|
label: 'Focused editing',
|
|
3080
3280
|
icon: 'FullscreenLine',
|
|
@@ -3087,22 +3287,22 @@ var FormEngineImpl = function (_a) {
|
|
|
3087
3287
|
icon: 'HistoryLine',
|
|
3088
3288
|
className: 'options-item-revert',
|
|
3089
3289
|
onClick: function () {
|
|
3090
|
-
var _a
|
|
3091
|
-
handleValueChange(
|
|
3290
|
+
var _a;
|
|
3291
|
+
handleValueChange.apply(void 0, __spreadArray([optionName], (0, argumentPresence_1.restoredFieldChange)((_a = originalValue.current) === null || _a === void 0 ? void 0 : _a[optionName]), false));
|
|
3092
3292
|
},
|
|
3093
3293
|
},
|
|
3094
3294
|
!readOnly &&
|
|
3095
3295
|
other.value &&
|
|
3096
3296
|
!(0, lodash_1.isEqual)(other.value, (0, common_1.getDefaultValue)(options[optionName])) &&
|
|
3097
|
-
!(((
|
|
3297
|
+
!(((_o = options[optionName]) === null || _o === void 0 ? void 0 : _o.disabled) || ((_p = options[optionName]) === null || _p === void 0 ? void 0 : _p.readonly)) && {
|
|
3098
3298
|
label: 'Remove value',
|
|
3099
3299
|
icon: 'CloseLine',
|
|
3100
3300
|
className: 'options-item-remove',
|
|
3101
3301
|
onClick: function () { return handleValueChange(optionName, undefined); },
|
|
3102
3302
|
},
|
|
3103
3303
|
!readOnly &&
|
|
3104
|
-
!((
|
|
3105
|
-
!((
|
|
3304
|
+
!((_q = options[optionName]) === null || _q === void 0 ? void 0 : _q.preselected) &&
|
|
3305
|
+
!((_r = options[optionName]) === null || _r === void 0 ? void 0 : _r.required) && {
|
|
3106
3306
|
label: 'Remove option',
|
|
3107
3307
|
icon: 'DeleteBinLine',
|
|
3108
3308
|
intent: 'danger',
|
|
@@ -3118,8 +3318,8 @@ var FormEngineImpl = function (_a) {
|
|
|
3118
3318
|
},
|
|
3119
3319
|
],
|
|
3120
3320
|
}),
|
|
3121
|
-
content: ((0, jsx_runtime_1.jsxs)(FocusedEditing_1.FocusedEditing, { isFullscreen: focusedEditing === optionName, onClose: function () { return setFocusedEditing(undefined); }, description: (
|
|
3122
|
-
(0, jsx_runtime_1.jsx)(Description_1.Description, { longDescription: (
|
|
3321
|
+
content: ((0, jsx_runtime_1.jsxs)(FocusedEditing_1.FocusedEditing, { isFullscreen: focusedEditing === optionName, onClose: function () { return setFocusedEditing(undefined); }, description: (_s = options[optionName]) === null || _s === void 0 ? void 0 : _s.display_name, intent: getIntent(optionName, type, other.value, other.op), children: [focusedEditing === optionName ?
|
|
3322
|
+
(0, jsx_runtime_1.jsx)(Description_1.Description, { longDescription: (_t = options[optionName]) === null || _t === void 0 ? void 0 : _t.desc, shortDescription: (_u = options[optionName]) === null || _u === void 0 ? void 0 : _u.short_desc, longDescriptionShownByDefault: true })
|
|
3123
3323
|
: null, renderOption(optionName, __assign({ type: type }, other))] })),
|
|
3124
3324
|
});
|
|
3125
3325
|
}), defaultZoom: 1, zoomable: false, actions: __spreadArray(__spreadArray([], (rest.actions || []).map(function (action) { return (__assign(__assign({}, action), { minimal: true })); }), true), [
|
|
@@ -3157,15 +3357,12 @@ var FormEngineImpl = function (_a) {
|
|
|
3157
3357
|
* hand is how one of them gets missed.
|
|
3158
3358
|
*/
|
|
3159
3359
|
var FormEngine = function (props) {
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
// halfway down its parent.
|
|
3164
|
-
var inherited = (0, formAppearance_1.useFormAppearance)();
|
|
3165
|
-
var appearance = (_a = props.appearance) !== null && _a !== void 0 ? _a : inherited;
|
|
3166
|
-
return ((0, jsx_runtime_1.jsx)(markdownRendererContext_1.MarkdownRendererContext.Provider, { value: props.markdownRenderer, children: (0, jsx_runtime_1.jsx)(formAppearance_1.FormAppearanceProvider, { value: appearance, children: (0, jsx_runtime_1.jsx)(FormEngineImpl, __assign({}, props)) }) }));
|
|
3360
|
+
// what the host knows of references beyond the catalogue, for every chip the form draws (qorus#646)
|
|
3361
|
+
var referenceNames = (0, react_2.useMemo)(function () { var _a; return (_a = props.templateReferences) !== null && _a !== void 0 ? _a : NO_REFERENCE_NAMES; }, [props.templateReferences]);
|
|
3362
|
+
return ((0, jsx_runtime_1.jsx)(markdownRendererContext_1.MarkdownRendererContext.Provider, { value: props.markdownRenderer, children: (0, jsx_runtime_1.jsx)(typeSentenceForm_1.TypeSentenceFormProvider, { children: (0, jsx_runtime_1.jsx)(referenceNames_1.TemplateReferenceNamesProvider, { value: referenceNames, children: (0, jsx_runtime_1.jsx)(FormEngineImpl, __assign({}, props)) }) }) }));
|
|
3167
3363
|
};
|
|
3168
3364
|
exports.FormEngine = FormEngine;
|
|
3365
|
+
var NO_REFERENCE_NAMES = {};
|
|
3169
3366
|
exports.default = exports.FormEngine;
|
|
3170
3367
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
3171
3368
|
//# sourceMappingURL=FormEngine.js.map
|