@qoretechnologies/reqraft 0.10.25 → 0.10.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/CLAUDE.md +52 -23
- package/design/COMPACT_ENGINE_REDESIGN.md +156 -0
- package/design/FORM_ENGINE_COMPACT_UX_PLAN.md +353 -0
- package/dist/components/FocusedEditing/index.d.ts +9 -1
- package/dist/components/FocusedEditing/index.d.ts.map +1 -1
- package/dist/components/FocusedEditing/index.js +2 -2
- package/dist/components/FocusedEditing/index.js.map +1 -1
- package/dist/components/composer/Composer.d.ts +108 -0
- package/dist/components/composer/Composer.d.ts.map +1 -0
- package/dist/components/composer/Composer.js +238 -0
- package/dist/components/composer/Composer.js.map +1 -0
- package/dist/components/composer/helpers.d.ts +21 -0
- package/dist/components/composer/helpers.d.ts.map +1 -0
- package/dist/components/composer/helpers.js +75 -0
- package/dist/components/composer/helpers.js.map +1 -0
- package/dist/components/composer/index.d.ts +3 -0
- package/dist/components/composer/index.d.ts.map +1 -0
- package/dist/components/composer/index.js +19 -0
- package/dist/components/composer/index.js.map +1 -0
- package/dist/components/form/engine/CompactRow.d.ts.map +1 -1
- package/dist/components/form/engine/CompactRow.js +307 -110
- 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 +123 -106
- package/dist/components/form/engine/CompactToolbar.js.map +1 -1
- package/dist/components/form/engine/FormEngine.d.ts +107 -11
- package/dist/components/form/engine/FormEngine.d.ts.map +1 -1
- package/dist/components/form/engine/FormEngine.js +618 -179
- package/dist/components/form/engine/FormEngine.js.map +1 -1
- package/dist/components/form/engine/compactRowContext.d.ts +9 -0
- 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 +7 -3
- package/dist/components/form/engine/compactRowStyles.d.ts.map +1 -1
- package/dist/components/form/engine/compactRowStyles.js +88 -51
- package/dist/components/form/engine/compactRowStyles.js.map +1 -1
- package/dist/components/form/engine/compactToolbarContext.d.ts +1 -0
- package/dist/components/form/engine/compactToolbarContext.d.ts.map +1 -1
- package/dist/components/form/engine/compactToolbarContext.js.map +1 -1
- package/dist/components/form/engine/optionActions.d.ts +28 -0
- package/dist/components/form/engine/optionActions.d.ts.map +1 -0
- package/dist/components/form/engine/optionActions.js +18 -0
- package/dist/components/form/engine/optionActions.js.map +1 -0
- package/dist/components/form/engine/readFirst.d.ts +63 -2
- package/dist/components/form/engine/readFirst.d.ts.map +1 -1
- package/dist/components/form/engine/readFirst.js +121 -6
- package/dist/components/form/engine/readFirst.js.map +1 -1
- package/dist/components/form/engine/rendererTypes.d.ts +35 -0
- package/dist/components/form/engine/rendererTypes.d.ts.map +1 -0
- package/dist/components/form/engine/rendererTypes.js +63 -0
- package/dist/components/form/engine/rendererTypes.js.map +1 -0
- package/dist/components/form/engine/variants/VariantCalmTable.d.ts +6 -0
- package/dist/components/form/engine/variants/VariantCalmTable.d.ts.map +1 -0
- package/dist/components/form/engine/variants/VariantCalmTable.js +94 -0
- package/dist/components/form/engine/variants/VariantCalmTable.js.map +1 -0
- package/dist/components/form/engine/variants/VariantCards.d.ts +6 -0
- package/dist/components/form/engine/variants/VariantCards.d.ts.map +1 -0
- package/dist/components/form/engine/variants/VariantCards.js +80 -0
- package/dist/components/form/engine/variants/VariantCards.js.map +1 -0
- package/dist/components/form/engine/variants/VariantFocus.d.ts +7 -0
- package/dist/components/form/engine/variants/VariantFocus.d.ts.map +1 -0
- package/dist/components/form/engine/variants/VariantFocus.js +138 -0
- package/dist/components/form/engine/variants/VariantFocus.js.map +1 -0
- package/dist/components/form/engine/variants/VariantMinimal.d.ts +6 -0
- package/dist/components/form/engine/variants/VariantMinimal.d.ts.map +1 -0
- package/dist/components/form/engine/variants/VariantMinimal.js +73 -0
- package/dist/components/form/engine/variants/VariantMinimal.js.map +1 -0
- package/dist/components/form/engine/variants/focusDemo.d.ts +13 -0
- package/dist/components/form/engine/variants/focusDemo.d.ts.map +1 -0
- package/dist/components/form/engine/variants/focusDemo.js +139 -0
- package/dist/components/form/engine/variants/focusDemo.js.map +1 -0
- package/dist/components/form/engine/variants/variantModel.d.ts +70 -0
- package/dist/components/form/engine/variants/variantModel.d.ts.map +1 -0
- package/dist/components/form/engine/variants/variantModel.js +133 -0
- package/dist/components/form/engine/variants/variantModel.js.map +1 -0
- package/dist/components/form/engine/variants/variantParts.d.ts +79 -0
- package/dist/components/form/engine/variants/variantParts.d.ts.map +1 -0
- package/dist/components/form/engine/variants/variantParts.js +191 -0
- package/dist/components/form/engine/variants/variantParts.js.map +1 -0
- package/dist/components/form/expressions/builder/index.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/index.js +13 -2
- package/dist/components/form/expressions/builder/index.js.map +1 -1
- package/dist/components/form/expressions/useExpressions.d.ts.map +1 -1
- package/dist/components/form/expressions/useExpressions.js +4 -1
- package/dist/components/form/expressions/useExpressions.js.map +1 -1
- package/dist/components/form/fields/Field.d.ts.map +1 -1
- package/dist/components/form/fields/Field.js +5 -3
- package/dist/components/form/fields/Field.js.map +1 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.d.ts +2 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.d.ts.map +1 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.js +8 -26
- package/dist/components/form/fields/allowed-values/AllowedValues.js.map +1 -1
- package/dist/components/form/fields/auto/AutoFormField.d.ts +3 -0
- package/dist/components/form/fields/auto/AutoFormField.d.ts.map +1 -1
- package/dist/components/form/fields/auto/AutoFormField.js +42 -8
- package/dist/components/form/fields/auto/AutoFormField.js.map +1 -1
- package/dist/components/form/fields/binary/Binary.d.ts +15 -0
- package/dist/components/form/fields/binary/Binary.d.ts.map +1 -0
- package/dist/components/form/fields/binary/Binary.js +74 -0
- package/dist/components/form/fields/binary/Binary.js.map +1 -0
- package/dist/components/form/fields/boolean/Boolean.js +1 -1
- package/dist/components/form/fields/boolean/Boolean.js.map +1 -1
- package/dist/components/form/fields/multi-select/MultiSelectFormField.d.ts.map +1 -1
- package/dist/components/form/fields/multi-select/MultiSelectFormField.js +5 -4
- package/dist/components/form/fields/multi-select/MultiSelectFormField.js.map +1 -1
- package/dist/components/form/fields/select/Select.d.ts.map +1 -1
- package/dist/components/form/fields/select/Select.js +29 -12
- package/dist/components/form/fields/select/Select.js.map +1 -1
- package/dist/components/form/fields/select/SelectCollection.d.ts +8 -2
- package/dist/components/form/fields/select/SelectCollection.d.ts.map +1 -1
- package/dist/components/form/fields/select/SelectCollection.js +52 -16
- package/dist/components/form/fields/select/SelectCollection.js.map +1 -1
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/index.js +2 -0
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/imageLightbox/ImageLightbox.d.ts +21 -0
- package/dist/components/imageLightbox/ImageLightbox.d.ts.map +1 -0
- package/dist/components/imageLightbox/ImageLightbox.js +169 -0
- package/dist/components/imageLightbox/ImageLightbox.js.map +1 -0
- package/dist/components/imageLightbox/index.d.ts +2 -0
- package/dist/components/imageLightbox/index.d.ts.map +1 -0
- package/dist/components/imageLightbox/index.js +18 -0
- package/dist/components/imageLightbox/index.js.map +1 -0
- package/dist/components/searchFilterBar/SearchFilterBar.d.ts +33 -0
- package/dist/components/searchFilterBar/SearchFilterBar.d.ts.map +1 -0
- package/dist/components/searchFilterBar/SearchFilterBar.js +76 -0
- package/dist/components/searchFilterBar/SearchFilterBar.js.map +1 -0
- package/dist/components/searchFilterBar/index.d.ts +2 -0
- package/dist/components/searchFilterBar/index.d.ts.map +1 -0
- package/dist/components/searchFilterBar/index.js +18 -0
- package/dist/components/searchFilterBar/index.js.map +1 -0
- package/dist/components/supportTicket/AttachmentChips.d.ts +10 -0
- package/dist/components/supportTicket/AttachmentChips.d.ts.map +1 -0
- package/dist/components/supportTicket/AttachmentChips.js +122 -0
- package/dist/components/supportTicket/AttachmentChips.js.map +1 -0
- package/dist/components/supportTicket/InterfaceReferenceTags.d.ts +43 -0
- package/dist/components/supportTicket/InterfaceReferenceTags.d.ts.map +1 -0
- package/dist/components/supportTicket/InterfaceReferenceTags.js +31 -0
- package/dist/components/supportTicket/InterfaceReferenceTags.js.map +1 -0
- package/dist/components/supportTicket/ReferencePicker.d.ts +87 -0
- package/dist/components/supportTicket/ReferencePicker.d.ts.map +1 -0
- package/dist/components/supportTicket/ReferencePicker.js +295 -0
- package/dist/components/supportTicket/ReferencePicker.js.map +1 -0
- package/dist/components/supportTicket/TicketHeader.d.ts +86 -0
- package/dist/components/supportTicket/TicketHeader.d.ts.map +1 -0
- package/dist/components/supportTicket/TicketHeader.js +149 -0
- package/dist/components/supportTicket/TicketHeader.js.map +1 -0
- package/dist/components/supportTicket/TicketMetaTags.d.ts +32 -0
- package/dist/components/supportTicket/TicketMetaTags.d.ts.map +1 -0
- package/dist/components/supportTicket/TicketMetaTags.js +21 -0
- package/dist/components/supportTicket/TicketMetaTags.js.map +1 -0
- package/dist/components/supportTicket/TicketReplyBox.d.ts +63 -0
- package/dist/components/supportTicket/TicketReplyBox.d.ts.map +1 -0
- package/dist/components/supportTicket/TicketReplyBox.js +115 -0
- package/dist/components/supportTicket/TicketReplyBox.js.map +1 -0
- package/dist/components/supportTicket/attachmentAccess.d.ts +37 -0
- package/dist/components/supportTicket/attachmentAccess.d.ts.map +1 -0
- package/dist/components/supportTicket/attachmentAccess.js +132 -0
- package/dist/components/supportTicket/attachmentAccess.js.map +1 -0
- package/dist/components/supportTicket/fileToAttachment.d.ts +9 -0
- package/dist/components/supportTicket/fileToAttachment.d.ts.map +1 -0
- package/dist/components/supportTicket/fileToAttachment.js +28 -0
- package/dist/components/supportTicket/fileToAttachment.js.map +1 -0
- package/dist/components/supportTicket/index.d.ts +11 -0
- package/dist/components/supportTicket/index.d.ts.map +1 -0
- package/dist/components/supportTicket/index.js +27 -0
- package/dist/components/supportTicket/index.js.map +1 -0
- package/dist/components/supportTicket/meta.d.ts +71 -0
- package/dist/components/supportTicket/meta.d.ts.map +1 -0
- package/dist/components/supportTicket/meta.js +115 -0
- package/dist/components/supportTicket/meta.js.map +1 -0
- package/dist/components/supportTicket/ticketModel.d.ts +102 -0
- package/dist/components/supportTicket/ticketModel.d.ts.map +1 -0
- package/dist/components/supportTicket/ticketModel.js +3 -0
- package/dist/components/supportTicket/ticketModel.js.map +1 -0
- package/dist/components/ticketReferences/TicketReferences.d.ts +52 -0
- package/dist/components/ticketReferences/TicketReferences.d.ts.map +1 -0
- package/dist/components/ticketReferences/TicketReferences.js +492 -0
- package/dist/components/ticketReferences/TicketReferences.js.map +1 -0
- package/dist/components/ticketReferences/index.d.ts +3 -0
- package/dist/components/ticketReferences/index.d.ts.map +1 -0
- package/dist/components/ticketReferences/index.js +6 -0
- package/dist/components/ticketReferences/index.js.map +1 -0
- package/dist/components/ticketThread/TicketThread.d.ts +57 -0
- package/dist/components/ticketThread/TicketThread.d.ts.map +1 -0
- package/dist/components/ticketThread/TicketThread.js +299 -0
- package/dist/components/ticketThread/TicketThread.js.map +1 -0
- package/dist/components/ticketThread/index.d.ts +3 -0
- package/dist/components/ticketThread/index.d.ts.map +1 -0
- package/dist/components/ticketThread/index.js +7 -0
- package/dist/components/ticketThread/index.js.map +1 -0
- package/dist/helpers/common.d.ts +5 -0
- package/dist/helpers/common.d.ts.map +1 -1
- package/dist/helpers/common.js +20 -1
- package/dist/helpers/common.js.map +1 -1
- package/dist/helpers/scrollbar.d.ts +2 -0
- package/dist/helpers/scrollbar.d.ts.map +1 -0
- package/dist/helpers/scrollbar.js +25 -0
- package/dist/helpers/scrollbar.js.map +1 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/providers/StorageProvider.d.ts +13 -0
- package/dist/providers/StorageProvider.d.ts.map +1 -1
- package/dist/providers/StorageProvider.js +29 -5
- package/dist/providers/StorageProvider.js.map +1 -1
- package/package.json +6 -5
- package/src/components/FocusedEditing/index.tsx +17 -2
- package/src/components/composer/Composer.stories.tsx +238 -0
- package/src/components/composer/Composer.tsx +545 -0
- package/src/components/composer/helpers.ts +74 -0
- package/src/components/composer/index.ts +2 -0
- package/src/components/dpqlEditor/DpqlEditor.stories.tsx +74 -2
- package/src/components/form/engine/CompactRow.tsx +561 -283
- package/src/components/form/engine/CompactToolbar.tsx +216 -182
- package/src/components/form/engine/FormEngine.stories.tsx +1736 -162
- package/src/components/form/engine/FormEngine.tsx +886 -170
- package/src/components/form/engine/FormEngineRemote.stories.tsx +377 -0
- package/src/components/form/engine/_structuredData/StructuredDataView.stories.tsx +8 -0
- package/src/components/form/engine/compactRowContext.ts +14 -0
- package/src/components/form/engine/compactRowStyles.ts +273 -146
- package/src/components/form/engine/compactToolbarContext.ts +1 -0
- package/src/components/form/engine/optionActions.ts +40 -0
- package/src/components/form/engine/readFirst.ts +169 -10
- package/src/components/form/engine/rendererTypes.ts +55 -0
- package/src/components/form/engine/variants/FormEngineVariants.stories.tsx +159 -0
- package/src/components/form/engine/variants/VariantCalmTable.tsx +242 -0
- package/src/components/form/engine/variants/VariantCards.tsx +212 -0
- package/src/components/form/engine/variants/VariantFocus.tsx +382 -0
- package/src/components/form/engine/variants/VariantMinimal.tsx +170 -0
- package/src/components/form/engine/variants/focusDemo.ts +145 -0
- package/src/components/form/engine/variants/variantModel.ts +216 -0
- package/src/components/form/engine/variants/variantParts.tsx +313 -0
- package/src/components/form/expressions/ExpressionField.stories.tsx +84 -2
- package/src/components/form/expressions/builder/ExpressionBuilder.stories.tsx +213 -19
- package/src/components/form/expressions/builder/index.tsx +12 -1
- package/src/components/form/expressions/useExpressions.ts +4 -1
- package/src/components/form/fields/Field.stories.tsx +40 -0
- package/src/components/form/fields/Field.tsx +10 -1
- package/src/components/form/fields/allowed-values/AllowedValues.tsx +13 -36
- package/src/components/form/fields/array/ArrayAutoField.stories.tsx +64 -0
- package/src/components/form/fields/auto/AutoFormField.stories.tsx +146 -2
- package/src/components/form/fields/auto/AutoFormField.tsx +42 -1
- package/src/components/form/fields/binary/Binary.stories.tsx +122 -0
- package/src/components/form/fields/binary/Binary.tsx +81 -0
- package/src/components/form/fields/boolean/Boolean.stories.tsx +58 -0
- package/src/components/form/fields/boolean/Boolean.tsx +1 -1
- package/src/components/form/fields/byte-size/ByteSize.stories.tsx +24 -0
- package/src/components/form/fields/color/Color.stories.tsx +30 -0
- package/src/components/form/fields/cron/Cron.stories.tsx +8 -0
- package/src/components/form/fields/date/Date.stories.tsx +22 -0
- package/src/components/form/fields/file/File.stories.tsx +48 -0
- package/src/components/form/fields/long-string/LongString.stories.tsx +24 -0
- package/src/components/form/fields/markdown/Markdown.stories.tsx +8 -0
- package/src/components/form/fields/multi-select/MultiSelectFormField.tsx +14 -10
- package/src/components/form/fields/number/Number.stories.tsx +31 -0
- package/src/components/form/fields/object/Object.stories.tsx +88 -0
- package/src/components/form/fields/radio-group/RadioGroup.stories.tsx +24 -0
- package/src/components/form/fields/rich-text/RichText.stories.tsx +23 -0
- package/src/components/form/fields/schema-definition/SchemaDefinitionField.stories.tsx +72 -0
- package/src/components/form/fields/select/Select.stories.tsx +108 -0
- package/src/components/form/fields/select/Select.tsx +38 -12
- package/src/components/form/fields/select/SelectCollection.tsx +78 -17
- package/src/components/form/fields/string/String.stories.tsx +16 -0
- package/src/components/form/fields/template/TemplateField.stories.tsx +160 -0
- package/src/components/form/fields/url/Url.stories.tsx +24 -0
- package/src/components/form/index.tsx +2 -0
- package/src/components/imageLightbox/ImageLightbox.stories.tsx +238 -0
- package/src/components/imageLightbox/ImageLightbox.tsx +236 -0
- package/src/components/imageLightbox/index.ts +1 -0
- package/src/components/log/Log.stories.tsx +96 -0
- package/src/components/menu/Menu.stories.tsx +54 -0
- package/src/components/qonsoleSmartInput/QonsoleSmartInput.stories.tsx +83 -37
- package/src/components/searchFilterBar/SearchFilterBar.tsx +131 -0
- package/src/components/searchFilterBar/index.ts +1 -0
- package/src/components/smartEditor/SmartEditor.stories.tsx +32 -0
- package/src/components/supportTicket/AttachmentChips.stories.tsx +171 -0
- package/src/components/supportTicket/AttachmentChips.tsx +147 -0
- package/src/components/supportTicket/InterfaceReferenceTags.stories.tsx +171 -0
- package/src/components/supportTicket/InterfaceReferenceTags.tsx +96 -0
- package/src/components/supportTicket/ReferencePicker.stories.tsx +519 -0
- package/src/components/supportTicket/ReferencePicker.tsx +563 -0
- package/src/components/supportTicket/TicketConversation.stories.tsx +121 -0
- package/src/components/supportTicket/TicketHeader.stories.tsx +183 -0
- package/src/components/supportTicket/TicketHeader.tsx +247 -0
- package/src/components/supportTicket/TicketMetaTags.stories.tsx +103 -0
- package/src/components/supportTicket/TicketMetaTags.tsx +85 -0
- package/src/components/supportTicket/TicketReplyBox.stories.tsx +351 -0
- package/src/components/supportTicket/TicketReplyBox.tsx +146 -0
- package/src/components/supportTicket/attachmentAccess.ts +97 -0
- package/src/components/supportTicket/fileToAttachment.ts +24 -0
- package/src/components/supportTicket/index.ts +10 -0
- package/src/components/supportTicket/meta.ts +185 -0
- package/src/components/supportTicket/ticketModel.ts +131 -0
- package/src/components/ticketReferences/TicketReferences.stories.tsx +315 -0
- package/src/components/ticketReferences/TicketReferences.tsx +886 -0
- package/src/components/ticketReferences/index.ts +2 -0
- package/src/components/ticketThread/TicketThread.stories.tsx +828 -0
- package/src/components/ticketThread/TicketThread.tsx +704 -0
- package/src/components/ticketThread/index.ts +6 -0
- package/src/helpers/common.ts +19 -0
- package/src/helpers/scrollbar.ts +32 -0
- package/src/hooks/useFetch/useFetch.stories.tsx +30 -0
- package/src/hooks/useStorage/useStorage.stories.tsx +82 -0
- package/src/hooks/useWebSocket/useWebsocket.stories.tsx +127 -1
- package/src/index.tsx +8 -1
- package/src/providers/StorageProvider.tsx +30 -4
- package/src/stores/currentUser/currentUser.stories.tsx +49 -0
|
@@ -10,6 +10,29 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
13
36
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
37
|
var t = {};
|
|
15
38
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -37,9 +60,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
37
60
|
exports.CompactRow = void 0;
|
|
38
61
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
62
|
var reqore_1 = require("@qoretechnologies/reqore");
|
|
63
|
+
var optionActions_1 = require("./optionActions");
|
|
40
64
|
var flatten_1 = __importDefault(require("lodash/flatten"));
|
|
41
65
|
var size_1 = __importDefault(require("lodash/size"));
|
|
42
|
-
var react_1 = require("react");
|
|
66
|
+
var react_1 = __importStar(require("react"));
|
|
43
67
|
var use_context_selector_1 = require("use-context-selector");
|
|
44
68
|
var validations_1 = require("../../../helpers/validations");
|
|
45
69
|
var templates_1 = require("../../../helpers/templates");
|
|
@@ -82,7 +106,7 @@ var COMPACT_COMPLEX_TYPES = new Set([
|
|
|
82
106
|
]);
|
|
83
107
|
// Card editors that hold a SINGLE value through one text-bearing input — their
|
|
84
108
|
// built-in ReqoreInput clear duplicates the card's own "Clear value" action, so
|
|
85
|
-
// we suppress it (the card
|
|
109
|
+
// we suppress it (the card trash action is the single source). Structural/multi-input
|
|
86
110
|
// editors (hash, list, schema…) and polymorphic ones (auto/any) are NOT listed:
|
|
87
111
|
// their per-sub-field clears are distinct affordances and must stay, while the
|
|
88
112
|
// card ✕ clears the whole value. (Operators force a card on a scalar value, so
|
|
@@ -95,6 +119,11 @@ var COMPACT_SINGLE_VALUE_TYPES = new Set([
|
|
|
95
119
|
'byte-size',
|
|
96
120
|
'method-name',
|
|
97
121
|
]);
|
|
122
|
+
// How many consumer-injected actions may sit inline in a row before the rest
|
|
123
|
+
// overflow into the row's menu. A row's action slot shares space with the
|
|
124
|
+
// value; an unbounded button strip would squeeze the value out, and the
|
|
125
|
+
// consumer controls how many actions it injects.
|
|
126
|
+
var MAX_INLINE_OPTION_ACTIONS = 2;
|
|
98
127
|
// One read-first row: label | value | action collapsed; the real editor (the
|
|
99
128
|
// classic renderOption) expanded. `hidden` = search-surfaced optional —
|
|
100
129
|
// activating the row adds the field first.
|
|
@@ -112,22 +141,20 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
112
141
|
var isExpanded = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) {
|
|
113
142
|
return v.expandedOptions.includes(optionName);
|
|
114
143
|
});
|
|
144
|
+
var autoFocusNameRef = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.autoFocusNameRef; });
|
|
115
145
|
var isHighlighted = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) {
|
|
116
146
|
return v.highlightedOptions.includes(optionName);
|
|
117
147
|
});
|
|
118
148
|
var isFlashed = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) {
|
|
119
149
|
return v.flashedOptions.includes(optionName);
|
|
120
150
|
});
|
|
121
|
-
var infoPanelOverride = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.infoPanelOverrides[optionName]; });
|
|
122
151
|
var setHighlightedOptions = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.setHighlightedOptions; });
|
|
123
|
-
var setInfoPanelOverrides = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.setInfoPanelOverrides; });
|
|
124
152
|
var setFocusedEditing = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.setFocusedEditing; });
|
|
125
153
|
var readRowHeights = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.readRowHeights; });
|
|
126
154
|
var originalValue = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.originalValue; });
|
|
127
155
|
var availableOptions = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.availableOptions; });
|
|
128
156
|
var requiredGroupsInfo = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.requiredGroupsInfo; });
|
|
129
157
|
var handleValueChange = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.handleValueChange; });
|
|
130
|
-
var handleAddOptionalFieldChange = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.handleAddOptionalFieldChange; });
|
|
131
158
|
var toggleExpandedOption = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.toggleExpandedOption; });
|
|
132
159
|
var flashOption = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.flashOption; });
|
|
133
160
|
var hasOptionChanged = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.hasOptionChanged; });
|
|
@@ -135,18 +162,18 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
135
162
|
var removeSelectedOption = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.removeSelectedOption; });
|
|
136
163
|
var getTypeForOption = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.getTypeForOption; });
|
|
137
164
|
var confirmAction = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.confirmAction; });
|
|
165
|
+
var optionActions = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.optionActions; });
|
|
166
|
+
var collapseOptionActions = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.collapseOptionActions; });
|
|
138
167
|
var renderOption = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.renderOption; });
|
|
139
168
|
var theme = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.theme; });
|
|
140
169
|
var cMuted = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.cMuted; });
|
|
141
170
|
var templates = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.templates; });
|
|
142
|
-
var cFaint = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.cFaint; });
|
|
143
171
|
var cKey = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.cKey; });
|
|
144
172
|
var cDivider = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.cDivider; });
|
|
145
173
|
var cHover = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.cHover; });
|
|
146
174
|
var cDanger = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.cDanger; });
|
|
147
175
|
var cWarning = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.cWarning; });
|
|
148
176
|
var cInfo = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.cInfo; });
|
|
149
|
-
var cBg = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.cBg; });
|
|
150
177
|
// Value-cell content: colour adds a swatch, file an icon + size; hash keeps
|
|
151
178
|
// its "N fields" summary (sub-fields reveal beneath the row).
|
|
152
179
|
var renderReadFirstValue = function (field, schema, formatted) {
|
|
@@ -179,6 +206,16 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
179
206
|
var truthy = (field === null || field === void 0 ? void 0 : field.value) === true || (field === null || field === void 0 ? void 0 : field.value) === 'true';
|
|
180
207
|
return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { size: 'small', minimal: true, intent: truthy ? 'success' : 'danger', label: formatted }));
|
|
181
208
|
}
|
|
209
|
+
// Code-editor read summary: replace the truncated string with a chip
|
|
210
|
+
// showing line count + character count. The actual code renders below
|
|
211
|
+
// the row as a monospace `<pre>` inside a `ReqoreCollapsibleContent` —
|
|
212
|
+
// see `showCodePreview` below. Keeps the row height fixed while making
|
|
213
|
+
// multi-line source readable without opening the full editor.
|
|
214
|
+
if (valueType === 'code-editor' && typeof (field === null || field === void 0 ? void 0 : field.value) === 'string') {
|
|
215
|
+
var lines = field.value.split('\n').length;
|
|
216
|
+
var chars = field.value.length;
|
|
217
|
+
return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { size: 'small', minimal: true, intent: 'info', icon: 'CodeLine', label: "".concat(lines, " ").concat(lines === 1 ? 'line' : 'lines'), labelKey: "".concat(chars, " ").concat(chars === 1 ? 'char' : 'chars') }));
|
|
218
|
+
}
|
|
182
219
|
// Selected allowed-value / enum item with a logo (e.g. language images):
|
|
183
220
|
// render it beside the value, where it belongs — not as the field's icon.
|
|
184
221
|
var allowedImage = (0, readFirst_1.getAllowedValueImage)(field === null || field === void 0 ? void 0 : field.value, schema);
|
|
@@ -213,6 +250,64 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
213
250
|
};
|
|
214
251
|
var schema = options === null || options === void 0 ? void 0 : options[optionName];
|
|
215
252
|
var label = (schema === null || schema === void 0 ? void 0 : schema.display_name) || optionName;
|
|
253
|
+
var injectedOptionActions = react_1.default.useMemo(function () {
|
|
254
|
+
return schema ?
|
|
255
|
+
(0, optionActions_1.resolveOptionActions)(optionActions, {
|
|
256
|
+
name: optionName,
|
|
257
|
+
schema: schema,
|
|
258
|
+
value: availableOptions === null || availableOptions === void 0 ? void 0 : availableOptions[optionName],
|
|
259
|
+
}).filter(function (action) { return action.show !== false; })
|
|
260
|
+
: [];
|
|
261
|
+
}, [availableOptions === null || availableOptions === void 0 ? void 0 : availableOptions[optionName], optionActions, optionName, schema]);
|
|
262
|
+
// Which injected actions stay as inline buttons, and which move into the
|
|
263
|
+
// overflow menu. Everything collapses on touch / narrow viewports — a
|
|
264
|
+
// hover-gated button is unreachable without a hover — and anything past the
|
|
265
|
+
// inline cap overflows regardless, so a consumer injecting ten actions can
|
|
266
|
+
// never push the row's value out of view.
|
|
267
|
+
var _p = react_1.default.useMemo(function () {
|
|
268
|
+
return collapseOptionActions ?
|
|
269
|
+
[[], injectedOptionActions]
|
|
270
|
+
: [
|
|
271
|
+
injectedOptionActions.slice(0, MAX_INLINE_OPTION_ACTIONS),
|
|
272
|
+
injectedOptionActions.slice(MAX_INLINE_OPTION_ACTIONS),
|
|
273
|
+
];
|
|
274
|
+
}, [collapseOptionActions, injectedOptionActions]), inlineOptionActions = _p[0], menuOptionActions = _p[1];
|
|
275
|
+
var injectedOptionActionMenuItems = react_1.default.useMemo(function () {
|
|
276
|
+
return menuOptionActions.map(function (action, index) {
|
|
277
|
+
var _a, _b;
|
|
278
|
+
return ({
|
|
279
|
+
// A panel action labels itself with `label`, but an icon-only one
|
|
280
|
+
// (the IDE's AI-assist button) carries its name in the tooltip —
|
|
281
|
+
// a menu row has no hover affordance to fall back on.
|
|
282
|
+
label: (_b = (_a = action.label) !== null && _a !== void 0 ? _a : action.tooltip) !== null && _b !== void 0 ? _b : "Action ".concat(index + 1),
|
|
283
|
+
icon: action.icon,
|
|
284
|
+
intent: action.intent,
|
|
285
|
+
disabled: action.disabled,
|
|
286
|
+
onClick: function () { var _a; return (_a = action.onClick) === null || _a === void 0 ? void 0 : _a.call(action); },
|
|
287
|
+
});
|
|
288
|
+
});
|
|
289
|
+
}, [menuOptionActions]);
|
|
290
|
+
var renderInjectedOptionAction = function (action, index, size) {
|
|
291
|
+
if (size === void 0) { size = 'small'; }
|
|
292
|
+
// `show` drives visibility here instead of reaching the DOM. The classic
|
|
293
|
+
// path hands these to ReqorePanel, which honours `show: 'hover'` itself;
|
|
294
|
+
// the compact slots render plain buttons, so 'hover' becomes a CSS gate on
|
|
295
|
+
// the containing row/card (see compactRowStyles) — same config, same
|
|
296
|
+
// behaviour in both modes.
|
|
297
|
+
// `size` is destructured out and deliberately NOT honoured: the row owns
|
|
298
|
+
// its action strip's rhythm, and a consumer-supplied size made the
|
|
299
|
+
// injected button visibly smaller than the revert / more / confirm
|
|
300
|
+
// buttons beside it. The contextual `size` argument is the row's own
|
|
301
|
+
// (small when editing or in a card, tiny on a read row), so injected
|
|
302
|
+
// actions always match their neighbours.
|
|
303
|
+
var actionLabel = action.label, onClick = action.onClick, show = action.show,
|
|
304
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
305
|
+
_ignoredSize = action.size, className = action.className, actionProps = __rest(action, ["label", "onClick", "show", "size", "className"]);
|
|
306
|
+
return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, __assign({ size: size, minimal: true, flat: true, fixed: true }, actionProps, { className: "".concat(className ? "".concat(className, " ") : '', "options-injected-action").concat(show === 'hover' ? ' options-injected-action-hover' : ''), onClick: function (event) {
|
|
307
|
+
event.stopPropagation();
|
|
308
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
309
|
+
}, children: actionLabel }), "".concat(optionName, "-injected-action-").concat(index)));
|
|
310
|
+
};
|
|
216
311
|
var required = !!((schema === null || schema === void 0 ? void 0 : schema.required) || (schema === null || schema === void 0 ? void 0 : schema.required_groups));
|
|
217
312
|
var removable = !readOnly && !(schema === null || schema === void 0 ? void 0 : schema.preselected) && !(schema === null || schema === void 0 ? void 0 : schema.required) && !(schema === null || schema === void 0 ? void 0 : schema.required_groups);
|
|
218
313
|
var changed = !hidden && !readOnly && hasOptionChanged(optionField === null || optionField === void 0 ? void 0 : optionField.value, optionName);
|
|
@@ -256,7 +351,10 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
256
351
|
});
|
|
257
352
|
}), true); }) }) })
|
|
258
353
|
: null;
|
|
259
|
-
var
|
|
354
|
+
var fixedAllowedValueOption = (0, readFirst_1.isFixedCompactAllowedValueOption)(schema);
|
|
355
|
+
var editType = (_d = (fixedAllowedValueOption
|
|
356
|
+
? (schema === null || schema === void 0 ? void 0 : schema.type) || (schema === null || schema === void 0 ? void 0 : schema.ui_type)
|
|
357
|
+
: (schema === null || schema === void 0 ? void 0 : schema.ui_type) || (schema === null || schema === void 0 ? void 0 : schema.type))) !== null && _d !== void 0 ? _d : '';
|
|
260
358
|
// Scalars edit in place inside the row; complex fields (tall or nested
|
|
261
359
|
// editors) still open the expanded card below.
|
|
262
360
|
var inlineEditable = !readOnly &&
|
|
@@ -267,6 +365,22 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
267
365
|
// A choice with per-option logos (e.g. language) reads better collapsed.
|
|
268
366
|
!(0, readFirst_1.optionHasImages)(schema) &&
|
|
269
367
|
!COMPACT_COMPLEX_TYPES.has(editType);
|
|
368
|
+
// Auto-focus the editor's first input when a field is opened, so you can type
|
|
369
|
+
// straight away (matches the prototype's tap-to-edit feel).
|
|
370
|
+
var editorRef = react_1.default.useRef(null);
|
|
371
|
+
react_1.default.useEffect(function () {
|
|
372
|
+
if (!isExpanded)
|
|
373
|
+
return undefined;
|
|
374
|
+
var id = window.setTimeout(function () {
|
|
375
|
+
var _a;
|
|
376
|
+
var el = (_a = editorRef.current) === null || _a === void 0 ? void 0 : _a.querySelector('input:not([type="hidden"]):not([disabled]), textarea, [contenteditable="true"]');
|
|
377
|
+
// A user-driven expand scrolls the just-opened editor into view; the
|
|
378
|
+
// programmatic `autoFocusFirstRequired` expand must NOT — otherwise an
|
|
379
|
+
// off-screen / below-the-fold form scrolls itself into view on mount.
|
|
380
|
+
el === null || el === void 0 ? void 0 : el.focus((autoFocusNameRef === null || autoFocusNameRef === void 0 ? void 0 : autoFocusNameRef.current) === optionName ? { preventScroll: true } : undefined);
|
|
381
|
+
}, 60);
|
|
382
|
+
return function () { return window.clearTimeout(id); };
|
|
383
|
+
}, [isExpanded, optionName, autoFocusNameRef]);
|
|
270
384
|
var revertButton = changed ?
|
|
271
385
|
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { className: 'options-readfirst-revert', size: 'small', flat: true, minimal: true, icon: 'HistoryLine', tooltip: 'Revert changes', onClick: function (e) {
|
|
272
386
|
var _a, _b, _c, _d;
|
|
@@ -278,8 +392,9 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
278
392
|
// — distinct from the read-row "Remove field" (which deletes an optional
|
|
279
393
|
// field entirely). Once cleared, `changed` flips on and `hasValue` off, so
|
|
280
394
|
// this button gives way to `revertButton` in the same slot — the morph the
|
|
281
|
-
// edit row's actions are designed around.
|
|
282
|
-
//
|
|
395
|
+
// edit row's actions are designed around. Clearing is destructive even
|
|
396
|
+
// though it can be reverted before saving, so both the trigger and its
|
|
397
|
+
// confirmation use danger intent.
|
|
283
398
|
//
|
|
284
399
|
// Only editors with NO built-in clear of their own get this button —
|
|
285
400
|
// toggles and fixed-choice pickers. The text/number/date inputs already
|
|
@@ -291,17 +406,27 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
291
406
|
// CREATABLE one still renders the raw input (with its own ✕), so it keeps
|
|
292
407
|
// its clear — matching the dispatch in AutoFormField/TemplateField.
|
|
293
408
|
(!!(0, size_1.default)(schema === null || schema === void 0 ? void 0 : schema.allowed_values) && !(schema === null || schema === void 0 ? void 0 : schema.allowed_values_creatable));
|
|
409
|
+
var confirmClearValue = function (event) {
|
|
410
|
+
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
|
411
|
+
confirmAction({
|
|
412
|
+
title: 'Clear value',
|
|
413
|
+
description: "Clear the current value of \"".concat(label, "\"?"),
|
|
414
|
+
confirmLabel: 'Clear value',
|
|
415
|
+
confirmButtonIntent: 'danger',
|
|
416
|
+
intent: 'danger',
|
|
417
|
+
onConfirm: function () { return handleValueChange(optionName, undefined); },
|
|
418
|
+
});
|
|
419
|
+
};
|
|
294
420
|
var clearValueButton = hasValue && !readOnly && editorLacksOwnClear ?
|
|
295
|
-
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { className: 'options-readfirst-clear', size: 'small', flat: true, minimal: true, icon: '
|
|
296
|
-
e.stopPropagation();
|
|
297
|
-
handleValueChange(optionName, undefined);
|
|
298
|
-
} })
|
|
421
|
+
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { className: 'options-readfirst-clear', size: 'small', flat: true, minimal: true, icon: 'DeleteBinLine', intent: 'danger', "aria-label": 'Clear value', tooltip: 'Clear value', onClick: confirmClearValue })
|
|
299
422
|
: null;
|
|
300
423
|
// Batched commit: a changed row is a draft until Save — mark it with the
|
|
301
424
|
// product's Draft chip (always visible, unlike the hover-revealed revert).
|
|
302
425
|
var draftChip = commitMode === 'batched' && changed ?
|
|
303
426
|
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { className: 'options-readfirst-draft', label: 'Draft', intent: 'warning', icon: 'EditLine', size: 'tiny', minimal: true, fixed: true, flat: true, compact: true, effect: { uppercase: true, spaced: 1 } })
|
|
304
427
|
: null;
|
|
428
|
+
var isPassiveCloseAction = fixedAllowedValueOption || readOnly;
|
|
429
|
+
var closeExpandedFieldButton = ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { className: 'options-readfirst-done', size: 'small', intent: !isPassiveCloseAction ? 'success' : undefined, flat: isPassiveCloseAction, minimal: isPassiveCloseAction, fixed: true, icon: isPassiveCloseAction ? 'CloseLine' : 'CheckLine', "aria-label": isPassiveCloseAction ? 'Close field' : 'Done', tooltip: isPassiveCloseAction ? 'Close field' : 'Done', onClick: function () { return toggleExpandedOption(optionName); } }));
|
|
305
430
|
// Info tiers: Tier 1 (danger/warning + dependency hints) must be visible
|
|
306
431
|
// without interaction; Tier 2 (info/success, default notes) sits behind ⓘ.
|
|
307
432
|
var infoActive = !hidden;
|
|
@@ -325,45 +450,50 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
325
450
|
.filter(function (m) { return m.label !== 'This field is required'; })
|
|
326
451
|
.map(function (m) { return ({ intent: m.intent, content: String(m.label) }); })
|
|
327
452
|
: [];
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
453
|
+
// TWO display channels, matching the Focus prototype:
|
|
454
|
+
// • dedicated schema `messages` → prominent coloured PANELS below the row;
|
|
455
|
+
// • everything else (validation reasons, the unmet-dependency hint, the
|
|
456
|
+
// default-value note) → a compact INLINE reason strip — not a panel.
|
|
457
|
+
var panelMessages = schemaMessages;
|
|
458
|
+
var inlineMessages = __spreadArray(__spreadArray([], fieldMessages, true), (infoActive && (schema === null || schema === void 0 ? void 0 : schema.default_value_desc) ?
|
|
331
459
|
[
|
|
332
460
|
{
|
|
333
461
|
content: "Default: ".concat(schema.default_value_display_name || '', " \u2014 ").concat(schema.default_value_desc).trim(),
|
|
334
462
|
},
|
|
335
463
|
]
|
|
336
464
|
: []), true);
|
|
337
|
-
var
|
|
338
|
-
|
|
465
|
+
var allMsgs = __spreadArray(__spreadArray([], panelMessages, true), inlineMessages, true);
|
|
466
|
+
var worstIntent = allMsgs.some(function (m) { return m.intent === 'danger'; }) ? 'danger'
|
|
467
|
+
: allMsgs.some(function (m) { return m.intent === 'warning'; }) ? 'warning'
|
|
339
468
|
: undefined;
|
|
340
469
|
var intentColor = worstIntent === 'danger' ? cDanger
|
|
341
470
|
: worstIntent === 'warning' ? cWarning
|
|
342
471
|
: undefined;
|
|
343
472
|
var showStripe = infoActive && !!intentColor;
|
|
344
|
-
// The short_desc renders UNDER the field name (revealed by the ⓘ toggle); the
|
|
345
|
-
// value-side panel carries only the messages (tier1/tier2).
|
|
346
473
|
var labelShortDesc = schema === null || schema === void 0 ? void 0 : schema.short_desc;
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
//
|
|
351
|
-
//
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
var
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
setInfoPanelOverrides(function (prev) {
|
|
359
|
-
var _a;
|
|
360
|
-
return (__assign(__assign({}, prev), (_a = {}, _a[optionName] = !infoPanelOpen, _a)));
|
|
361
|
-
});
|
|
474
|
+
// The per-row ⓘ is gone: short_desc shows under the name only when the global
|
|
475
|
+
// "descriptions" toggle is engaged (and inside the editor when expanded).
|
|
476
|
+
var showLabelDesc = !!labelShortDesc && showAllDescriptions === true;
|
|
477
|
+
// The `?` that opens the long-form help dialog. Shared by the read row AND
|
|
478
|
+
// the inline editor: opening a field used to drop it, leaving an editing row
|
|
479
|
+
// with no route to the field's description at all. Stops propagation because
|
|
480
|
+
// both labels are click targets themselves (the row expands / collapses).
|
|
481
|
+
var helpIcon = (schema === null || schema === void 0 ? void 0 : schema.desc) ?
|
|
482
|
+
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: 'QuestionLine', size: '12px', effect: { opacity: 0.55 }, margin: 'left', marginSize: 'tiny', role: 'button', tabIndex: -1, "aria-label": 'Help', className: 'options-readfirst-help', style: { cursor: 'help' }, onClick: function (event) {
|
|
483
|
+
event.stopPropagation();
|
|
484
|
+
handleOptionLabelClick(optionName);
|
|
362
485
|
} })
|
|
363
486
|
: null;
|
|
364
|
-
var
|
|
365
|
-
|
|
366
|
-
|
|
487
|
+
var renderInfoStrip = function (m, index) { return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreMessage, { size: 'small', opaque: false, flat: true, intent: m.intent, title: m.title, children: m.content }, "".concat(m.content, "-").concat(index))); };
|
|
488
|
+
var reasonColor = function (intent) {
|
|
489
|
+
var _a;
|
|
490
|
+
return intent === 'danger' ? cDanger
|
|
491
|
+
: intent === 'warning' ? cWarning
|
|
492
|
+
: intent === 'success' ?
|
|
493
|
+
((_a = theme === null || theme === void 0 ? void 0 : theme.intents) === null || _a === void 0 ? void 0 : _a.success) || cInfo
|
|
494
|
+
: "".concat(cMuted, "cc");
|
|
495
|
+
};
|
|
496
|
+
var infoToggle = null;
|
|
367
497
|
// Cluster (required-group connection) — shared by the read row, its block
|
|
368
498
|
// wrapper AND the inline editor, so the rail/node/highlight persist across
|
|
369
499
|
// view↔edit. The node is opaque (it masks the rail behind it); hovering any
|
|
@@ -376,41 +506,68 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
376
506
|
var clusterBlockClass = clustered ?
|
|
377
507
|
"readfirst-cluster-rail".concat(clusterFirst ? ' readfirst-cluster-first' : '').concat(clusterLast ? ' readfirst-cluster-last' : '').concat(clusterSatisfied ? ' readfirst-cluster-satisfied' : '')
|
|
378
508
|
: '';
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
((_f = theme === null || theme === void 0 ? void 0 : theme.intents) === null || _f === void 0 ? void 0 : _f.success) || cInfo
|
|
383
|
-
: "".concat(cWarning, "99"), "$bg": cBg })
|
|
384
|
-
: null;
|
|
509
|
+
// The connection rail + status nodes are gone — the "One of the below is
|
|
510
|
+
// required" box (and the Covers / Covered-by chips) carry the grouping now.
|
|
511
|
+
var clusterNode = null;
|
|
385
512
|
var clusterHoverProps = clustered && clusterMembers.length ?
|
|
386
513
|
{
|
|
387
514
|
onMouseEnter: function () { return setHighlightedOptions(clusterMembers); },
|
|
388
515
|
onMouseLeave: function () { return setHighlightedOptions([]); },
|
|
389
516
|
}
|
|
390
517
|
: {};
|
|
518
|
+
// Secondary edit actions tuck into a "More" (⋮) menu so the card header stays
|
|
519
|
+
// calm: Fullscreen always, plus Remove field for a removable option. Rendered
|
|
520
|
+
// just before the Done ✓ in both expanded layouts.
|
|
521
|
+
var moreMenu = ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreDropdown, { className: 'options-readfirst-more', icon: 'More2Fill', flat: true, minimal: true, fixed: true, size: 'small', tooltip: 'More actions', items: __spreadArray(__spreadArray([
|
|
522
|
+
{
|
|
523
|
+
label: 'Edit fullscreen',
|
|
524
|
+
icon: 'FullscreenLine',
|
|
525
|
+
onClick: function () { return setFocusedEditing(optionName); },
|
|
526
|
+
}
|
|
527
|
+
], (removable && !hidden ?
|
|
528
|
+
[
|
|
529
|
+
{
|
|
530
|
+
label: 'Remove field',
|
|
531
|
+
icon: 'DeleteBinLine',
|
|
532
|
+
intent: 'danger',
|
|
533
|
+
onClick: function () {
|
|
534
|
+
return confirmAction({
|
|
535
|
+
title: 'Remove field',
|
|
536
|
+
onConfirm: function () { return removeSelectedOption(optionName); },
|
|
537
|
+
});
|
|
538
|
+
},
|
|
539
|
+
},
|
|
540
|
+
]
|
|
541
|
+
: []), true), injectedOptionActionMenuItems, true) }));
|
|
391
542
|
if (isExpanded) {
|
|
392
543
|
if (inlineEditable) {
|
|
393
544
|
var collapse_1 = function () { return toggleExpandedOption(optionName); };
|
|
394
545
|
var editingRow = ((0, jsx_runtime_1.jsxs)("div", __assign({ "data-field": optionName, className: 'readfirst-row readfirst-row-editing options-readfirst-inline options-readfirst-value', style: readRowHeights.current[optionName] ?
|
|
395
546
|
{ minHeight: readRowHeights.current[optionName] }
|
|
396
|
-
: undefined }, clusterHoverProps, { children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRowLabel, { role: 'button', tabIndex: 0, "aria-label": "Collapse ".concat(label), title: (schema === null || schema === void 0 ? void 0 : schema.short_desc) || undefined, "$color": cKey, "$pointer": true, onClick: collapse_1, onKeyDown: function (event) {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
547
|
+
: undefined }, clusterHoverProps, { children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledLabelBlock, { children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRowLabel, { role: 'button', tabIndex: 0, "aria-label": "Collapse ".concat(label), title: (schema === null || schema === void 0 ? void 0 : schema.short_desc) || undefined, "$color": cKey, "$pointer": true, onClick: collapse_1, onKeyDown: function (event) {
|
|
548
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
549
|
+
event.preventDefault();
|
|
550
|
+
collapse_1();
|
|
551
|
+
}
|
|
552
|
+
}, children: [label, required ? (0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: 'Asterisk', color: 'danger', size: '10px' }) : null, helpIcon] }), labelShortDesc ?
|
|
553
|
+
(0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledLabelDesc, { className: 'options-readfirst-label-desc', size: 'small', effect: { opacity: 0.55 }, children: labelShortDesc })
|
|
554
|
+
: null] }), (0, jsx_runtime_1.jsx)("div", { ref: editorRef, style: { minWidth: 0 }, onKeyDown: function (event) {
|
|
402
555
|
if (event.key === 'Escape') {
|
|
403
556
|
event.stopPropagation();
|
|
404
557
|
collapse_1();
|
|
405
558
|
}
|
|
406
|
-
}, children: renderOption(optionName, optionField, 'small', true) }), (0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRowActions, { children: [draftChip, revertButton, clearValueButton, (
|
|
559
|
+
}, children: renderOption(optionName, optionField, 'small', true) }), (0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRowActions, { children: [draftChip, revertButton, clearValueButton, inlineOptionActions.map(function (action, index) {
|
|
560
|
+
return renderInjectedOptionAction(action, index);
|
|
561
|
+
}), moreMenu, closeExpandedFieldButton] }), clusterNode] }), optionName));
|
|
407
562
|
// ALWAYS wrap the editing row in the same StyledColumn so its parent stays
|
|
408
563
|
// stable (the editor must not remount and lose focus mid-type). The
|
|
409
564
|
// message panel is NOT rendered here: the editor's own OptionFieldMessages
|
|
410
565
|
// strip already shows the field's messages, so a panel would duplicate
|
|
411
566
|
// them. The wrapper carries the cluster rail class so the connection
|
|
412
567
|
// persists while a member is being edited.
|
|
413
|
-
return ((0, jsx_runtime_1.
|
|
568
|
+
return ((0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledColumn, { "data-field": optionName, className: clusterBlockClass || undefined, children: [editingRow, focusedEditing === optionName ?
|
|
569
|
+
(0, jsx_runtime_1.jsxs)(FocusedEditing_1.FocusedEditing, { isFullscreen: true, modalOnly: true, onClose: function () { return setFocusedEditing(undefined); }, description: (schema === null || schema === void 0 ? void 0 : schema.display_name) || optionName, children: [(0, jsx_runtime_1.jsx)(Description_1.Description, { longDescription: schema === null || schema === void 0 ? void 0 : schema.desc, shortDescription: schema === null || schema === void 0 ? void 0 : schema.short_desc, longDescriptionShownByDefault: true }), renderOption(optionName, optionField)] })
|
|
570
|
+
: null] }, optionName));
|
|
414
571
|
}
|
|
415
572
|
// Card chrome: badge / actions / tags render here — the row only fits
|
|
416
573
|
// icon/image + the intent stripe.
|
|
@@ -418,10 +575,10 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
418
575
|
var cardBadges = schemaBadge !== undefined && schemaBadge !== null ?
|
|
419
576
|
(Array.isArray(schemaBadge) ? schemaBadge : [schemaBadge])
|
|
420
577
|
: [];
|
|
421
|
-
var cardActions = ((
|
|
578
|
+
var cardActions = ((_f = schema === null || schema === void 0 ? void 0 : schema.actions) === null || _f === void 0 ? void 0 : _f.filter(function (action) { return !!action && typeof action === 'object'; })) || [];
|
|
422
579
|
var cardTags = ((schema === null || schema === void 0 ? void 0 : schema.tags) || []);
|
|
423
580
|
var schemaIntentColor = (schema === null || schema === void 0 ? void 0 : schema.intent) ?
|
|
424
|
-
(
|
|
581
|
+
(_g = theme === null || theme === void 0 ? void 0 : theme.intents) === null || _g === void 0 ? void 0 : _g[schema.intent]
|
|
425
582
|
: undefined;
|
|
426
583
|
return ((0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledEditCard, { "data-field": optionName, className: COMPACT_SINGLE_VALUE_TYPES.has(editType) ?
|
|
427
584
|
'options-readfirst-card options-readfirst-card-single'
|
|
@@ -430,7 +587,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
430
587
|
alignItems: 'flex-start',
|
|
431
588
|
justifyContent: 'space-between',
|
|
432
589
|
gap: 12,
|
|
433
|
-
}, children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledCardHeading, { children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledCardLabel, { "$color":
|
|
590
|
+
}, children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledCardHeading, { children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledCardLabel, { "$color": cKey, children: [(schema === null || schema === void 0 ? void 0 : schema.icon) || (schema === null || schema === void 0 ? void 0 : schema.image) ?
|
|
434
591
|
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: schema === null || schema === void 0 ? void 0 : schema.icon, image: schema === null || schema === void 0 ? void 0 : schema.image, size: '14px' })
|
|
435
592
|
: null, (0, jsx_runtime_1.jsxs)("span", { children: [label, required ? (0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: 'Asterisk', color: 'danger', size: '10px' }) : null] }), cardBadges.map(function (badge, index) {
|
|
436
593
|
return typeof badge === 'object' ?
|
|
@@ -443,14 +600,22 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
443
600
|
: null] }), (0, jsx_runtime_1.jsxs)(reqore_1.ReqoreControlGroup, { fixed: true, verticalAlign: 'center', children: [cardActions.map(function (action, index) {
|
|
444
601
|
var _a = action, actionLabel = _a.label, actionProps = __rest(_a, ["label"]);
|
|
445
602
|
return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, __assign({ size: 'small', minimal: true, flat: true, fixed: true, className: 'options-readfirst-card-action' }, actionProps, { children: actionLabel }), index));
|
|
446
|
-
}), (
|
|
447
|
-
|
|
448
|
-
|
|
603
|
+
}), inlineOptionActions.map(function (action, index) {
|
|
604
|
+
return renderInjectedOptionAction(action, index);
|
|
605
|
+
}), hasValue && !readOnly ?
|
|
606
|
+
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { size: 'small', icon: 'DeleteBinLine', minimal: true, flat: true, fixed: true, intent: 'danger', className: 'options-readfirst-clear', "aria-label": 'Clear value', tooltip: 'Clear value', onClick: confirmClearValue })
|
|
607
|
+
: null, moreMenu, closeExpandedFieldButton] })] }), (0, jsx_runtime_1.jsxs)(FocusedEditing_1.FocusedEditing, { isFullscreen: focusedEditing === optionName, onClose: function () { return setFocusedEditing(undefined); }, description: (schema === null || schema === void 0 ? void 0 : schema.display_name) || optionName, children: [focusedEditing === optionName ?
|
|
449
608
|
(0, jsx_runtime_1.jsx)(Description_1.Description, { longDescription: schema === null || schema === void 0 ? void 0 : schema.desc, shortDescription: schema === null || schema === void 0 ? void 0 : schema.short_desc, longDescriptionShownByDefault: true })
|
|
450
609
|
: null, renderOption(optionName, optionField)] })] }, optionName));
|
|
451
610
|
}
|
|
452
611
|
var formatted = (0, readFirst_1.formatOptionValue)(optionField, schema);
|
|
453
612
|
var empty = formatted === '';
|
|
613
|
+
// Inline reasons shown on the value line: validation / dependency / one-of /
|
|
614
|
+
// default-value hints, plus a read-only covered-by note (editable covered rows
|
|
615
|
+
// carry that in their chip instead).
|
|
616
|
+
var valueReasons = __spreadArray(__spreadArray([], inlineMessages, true), (empty && coveredByLabel ?
|
|
617
|
+
[{ content: "Covered by \u201C".concat(coveredByLabel, "\u201D"), intent: 'success' }]
|
|
618
|
+
: []), true);
|
|
454
619
|
// A hash row reveals its sub-fields as read-only sub-rows under a "view
|
|
455
620
|
// more" disclosure; the row itself still expands the real editor on click.
|
|
456
621
|
var valueType = (0, readFirst_1.getValueType)(optionField, schema);
|
|
@@ -459,6 +624,30 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
459
624
|
(schema === null || schema === void 0 ? void 0 : schema.ui_type) !== 'schema-definition' ?
|
|
460
625
|
(0, readFirst_1.getHashEntries)(optionField, schema)
|
|
461
626
|
: [];
|
|
627
|
+
// A LIST OF HASHES/objects gets the same expandable structured preview a hash
|
|
628
|
+
// does — the flat "N items" summary can't convey object contents (and must
|
|
629
|
+
// never print "[object Object]"). StructuredDataView unwraps each item's
|
|
630
|
+
// {type,value} envelope. Plain scalar lists keep just their joined summary.
|
|
631
|
+
var isHashList = !hidden &&
|
|
632
|
+
(valueType === 'list' || valueType === 'free-list' || valueType === 'array') &&
|
|
633
|
+
Array.isArray(optionField === null || optionField === void 0 ? void 0 : optionField.value) &&
|
|
634
|
+
optionField.value.length > 0 &&
|
|
635
|
+
optionField.value.some(function (item) {
|
|
636
|
+
var inner = item && typeof item === 'object' && 'value' in item ?
|
|
637
|
+
item.value
|
|
638
|
+
: item;
|
|
639
|
+
return inner !== null && typeof inner === 'object';
|
|
640
|
+
});
|
|
641
|
+
var showStructuredPreview = hashEntries.length > 0 || isHashList;
|
|
642
|
+
// Multi-line code preview: a `code-editor` field with a non-empty string
|
|
643
|
+
// value gets a `<pre>`-based code block under the row, capped by a
|
|
644
|
+
// `ReqoreCollapsibleContent` so the collapsed height stays row-sized and
|
|
645
|
+
// "Show more" reveals the rest. Sits in the same inset the hash/list
|
|
646
|
+
// preview uses — mutually exclusive with `showStructuredPreview`.
|
|
647
|
+
var showCodePreview = !hidden &&
|
|
648
|
+
valueType === 'code-editor' &&
|
|
649
|
+
typeof (optionField === null || optionField === void 0 ? void 0 : optionField.value) === 'string' &&
|
|
650
|
+
optionField.value.length > 0;
|
|
462
651
|
var typeLabel = showFieldTypes ?
|
|
463
652
|
"<".concat((schema === null || schema === void 0 ? void 0 : schema.ui_type) || (schema === null || schema === void 0 ? void 0 : schema.type) || 'auto').concat((schema === null || schema === void 0 ? void 0 : schema.ui_element_type) ? "[".concat(schema.ui_element_type, "]") : '', ">")
|
|
464
653
|
: null;
|
|
@@ -497,7 +686,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
497
686
|
// "Depends on" dropdown whose items are the blocking fields (an "any of:"
|
|
498
687
|
// divider for OR-groups), each clickable to flash/locate the blocker.
|
|
499
688
|
var dependsOnChip = fieldDisabled && dependencyEntries.length ?
|
|
500
|
-
(0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, role: 'presentation', onClick: function (e) { return e.stopPropagation(); }, onKeyDown: function (e) { return e.stopPropagation(); }, onMouseEnter: function () { return setHighlightedOptions(depHighlightNames); }, onMouseLeave: function () { return setHighlightedOptions([]); }, children: (0, jsx_runtime_1.jsx)(reqore_1.ReqoreDropdown, { className: 'options-readfirst-lock-deps', size: 'tiny', minimal: true, flat: true, compact: true, icon: 'LockLine',
|
|
689
|
+
(0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, role: 'presentation', onClick: function (e) { return e.stopPropagation(); }, onKeyDown: function (e) { return e.stopPropagation(); }, onMouseEnter: function () { return setHighlightedOptions(depHighlightNames); }, onMouseLeave: function () { return setHighlightedOptions([]); }, children: (0, jsx_runtime_1.jsx)(reqore_1.ReqoreDropdown, { className: 'options-readfirst-lock-deps', size: 'tiny', minimal: true, flat: true, compact: true, icon: 'LockLine', tooltip: 'Disabled \u2014 depends on other fields. Click to locate them.', items: __spreadArray([
|
|
501
690
|
{ divider: true, label: 'Unlocked by:', dividerAlign: 'left' }
|
|
502
691
|
], dependencyEntries.flatMap(function (entry) { return __spreadArray(__spreadArray([], (Array.isArray(entry) ?
|
|
503
692
|
[{ divider: true, label: 'any of:', dividerAlign: 'left' }]
|
|
@@ -524,9 +713,10 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
524
713
|
if ((_a = target === null || target === void 0 ? void 0 : target.classList) === null || _a === void 0 ? void 0 : _a.contains('readfirst-row')) {
|
|
525
714
|
readRowHeights.current[optionName] = Math.round(target.getBoundingClientRect().height);
|
|
526
715
|
}
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
716
|
+
// Optional fields aren't "added" — every one is editable in place. Opening a
|
|
717
|
+
// not-yet-set field just expands its editor (with an empty value); it joins
|
|
718
|
+
// the form's output the moment a value is set (and moves to Set / Needs
|
|
719
|
+
// attention), and drops back to Optional when cleared. No explicit add step.
|
|
530
720
|
toggleExpandedOption(optionName);
|
|
531
721
|
};
|
|
532
722
|
// Row chrome: icon/image before the label; schema `intent` as the edge
|
|
@@ -535,7 +725,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
535
725
|
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: schema === null || schema === void 0 ? void 0 : schema.icon, image: schema === null || schema === void 0 ? void 0 : schema.image, size: '14px', className: 'options-readfirst-row-icon' })
|
|
536
726
|
: null;
|
|
537
727
|
var rowSchemaIntentColor = (schema === null || schema === void 0 ? void 0 : schema.intent) ?
|
|
538
|
-
(
|
|
728
|
+
(_h = theme === null || theme === void 0 ? void 0 : theme.intents) === null || _h === void 0 ? void 0 : _h[schema.intent]
|
|
539
729
|
: undefined;
|
|
540
730
|
var rowStripeColor = (showStripe ? intentColor : undefined) || rowSchemaIntentColor;
|
|
541
731
|
// Intent stripe on the block ROOT so it spans the field's whole territory:
|
|
@@ -545,60 +735,67 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
545
735
|
var stripeStyle = rowStripeColor ?
|
|
546
736
|
(_b = {}, _b['--readfirst-stripe'] = rowStripeColor, _b)
|
|
547
737
|
: undefined;
|
|
548
|
-
|
|
549
|
-
|
|
738
|
+
// "Focus" trailing status dot, derived from the SHARED status helper (the
|
|
739
|
+
// same one FormEngine uses to bucket rows into the Needs-attention/Set/Optional
|
|
740
|
+
// boxes — so the dot and the box can never disagree). Hidden (not-yet-added)
|
|
741
|
+
// and dependency-locked rows show no dot (the add/lock affordance speaks for
|
|
742
|
+
// them). worstIntent already folds in schema + validation messages.
|
|
743
|
+
var cSuccess = (_j = theme === null || theme === void 0 ? void 0 : theme.intents) === null || _j === void 0 ? void 0 : _j.success;
|
|
744
|
+
var rowStatus = (0, readFirst_1.getReadFirstStatus)({
|
|
745
|
+
empty: empty,
|
|
746
|
+
required: required,
|
|
747
|
+
covered: !!coveredByLabel || groupResolved,
|
|
748
|
+
invalid: worstIntent === 'danger',
|
|
749
|
+
warned: worstIntent === 'warning',
|
|
750
|
+
});
|
|
751
|
+
var dotStatus = hidden || fieldDisabled ? undefined : rowStatus;
|
|
752
|
+
var dotColor = dotStatus === 'invalid' ? cDanger
|
|
753
|
+
: dotStatus === 'todo' ? cWarning
|
|
754
|
+
: dotStatus === 'set' ? cSuccess || cInfo
|
|
755
|
+
: undefined;
|
|
756
|
+
var row = ((0, jsx_runtime_1.jsxs)("div", __assign({ "data-field": optionName, role: 'button', tabIndex: 0, "aria-label": label, className: "readfirst-row options-readfirst-value".concat(hidden ? ' readfirst-row-hidden' : '').concat(fieldDisabled ? ' readfirst-row-disabled' : '').concat(isHighlighted ? ' readfirst-row-group-highlight' : '').concat(isFlashed ? ' readfirst-row-flash' : '').concat(showLabelDesc ? ' readfirst-row-info-open' : '').concat(panelMessages.length || showStructuredPreview || showCodePreview ? ' readfirst-row-tall' : '').concat(clusterBlockClass ? ' ' + clusterBlockClass : ''), "aria-disabled": fieldDisabled || undefined, style: stripeStyle, onClick: activate, onKeyDown: function (event) {
|
|
550
757
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
551
758
|
event.preventDefault();
|
|
552
759
|
activate(event);
|
|
553
760
|
}
|
|
554
|
-
} }, clusterHoverProps, { children: [clusterNode, (0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledLabelBlock, { children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRowLabel, { title: (schema === null || schema === void 0 ? void 0 : schema.short_desc) || undefined, "$color": cKey, children: [rowChromeIcon,
|
|
761
|
+
} }, clusterHoverProps, { children: [clusterNode, (0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledLabelBlock, { children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRowLabel, { title: (schema === null || schema === void 0 ? void 0 : schema.short_desc) || undefined, "$color": cKey, children: [rowChromeIcon, (0, jsx_runtime_1.jsxs)("span", { className: 'options-readfirst-label-text', style: { minWidth: 0 }, children: [label, required ?
|
|
762
|
+
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: 'Asterisk', color: 'danger', size: '10px', margin: 'left', marginSize: 'tiny' })
|
|
763
|
+
: null, helpIcon] }), typeLabel ?
|
|
555
764
|
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { size: 'tiny', minimal: true, label: typeLabel, labelEffect: { opacity: 0.55 } })
|
|
556
|
-
: null,
|
|
557
|
-
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: 'QuestionLine', size: '12px', effect: { opacity: 0.55 }, margin: 'left', marginSize: 5, role: 'button', tabIndex: -1, "aria-label": 'Help', className: 'options-readfirst-help', style: { cursor: 'help' }, onClick: function (event) {
|
|
558
|
-
event.stopPropagation();
|
|
559
|
-
handleOptionLabelClick(optionName);
|
|
560
|
-
} })
|
|
561
|
-
: null] }), labelShortDesc && infoPanelOpen ?
|
|
765
|
+
: null] }), showLabelDesc ?
|
|
562
766
|
(0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledLabelDesc, { className: 'options-readfirst-label-desc', size: 'small', effect: { opacity: 0.55 }, children: labelShortDesc })
|
|
563
|
-
: null] }), (0, jsx_runtime_1.
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
: renderReadFirstValue(optionField, schema, formatted) }), (0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRowActions, { children: [!hidden && !fieldDisabled && (!clustered || !!coveredByLabel) ? requiredGroupChip : null, !hidden ? dependsOnChip : null, draftChip, changed ?
|
|
576
|
-
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { className: 'options-readfirst-revert', size: 'tiny', flat: true, minimal: true, compact: true, icon: 'HistoryLine', tooltip: 'Revert changes', onClick: function (e) {
|
|
577
|
-
var _a, _b, _c, _d;
|
|
578
|
-
e.stopPropagation();
|
|
579
|
-
handleValueChange(optionName, (_b = (_a = originalValue.current) === null || _a === void 0 ? void 0 : _a[optionName]) === null || _b === void 0 ? void 0 : _b.value, (_d = (_c = originalValue.current) === null || _c === void 0 ? void 0 : _c[optionName]) === null || _d === void 0 ? void 0 : _d.type);
|
|
580
|
-
} })
|
|
581
|
-
: null, removable && !hidden ?
|
|
582
|
-
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { className: 'readfirst-action', size: 'small', flat: true, minimal: true, intent: 'danger', icon: 'DeleteBinLine', tooltip: 'Remove field', onClick: function (e) {
|
|
583
|
-
e.stopPropagation();
|
|
584
|
-
confirmAction({
|
|
585
|
-
title: 'Remove field',
|
|
586
|
-
onConfirm: function () { return removeSelectedOption(optionName); },
|
|
587
|
-
});
|
|
588
|
-
} })
|
|
589
|
-
: null, hidden || (fieldDisabled && !dependencyEntries.length) ?
|
|
590
|
-
(0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledActionSlot, { className: 'options-readfirst-trailing-slot', "$width": 18, children: hidden ?
|
|
591
|
-
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: 'AddLine', intent: 'info', size: '14px' })
|
|
592
|
-
: (0, jsx_runtime_1.jsx)("span", { title: fieldDisabledReason, style: { display: 'inline-flex', opacity: 0.45 }, children: (0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { className: 'options-readfirst-locked', icon: 'LockLine', size: '14px' }) }) })
|
|
767
|
+
: null] }), (0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRowValue, { title: !empty && !hidden && typeof formatted === 'string' ? formatted : undefined, "$color": empty || hidden ? "".concat(cMuted, "66") : cKey, "$empty": empty || hidden, children: [(0, jsx_runtime_1.jsx)("span", { className: 'options-readfirst-valuetext', children: hidden || empty ? '—' : renderReadFirstValue(optionField, schema, formatted) }), valueReasons.map(function (m, i) { return ((0, jsx_runtime_1.jsx)("span", { className: 'options-readfirst-reason', style: { color: reasonColor(m.intent) }, children: m.content }, "".concat(m.content, "-").concat(i))); }), panelMessages.length ?
|
|
768
|
+
(0, jsx_runtime_1.jsx)("div", { className: 'options-readfirst-info-panel', children: panelMessages.map(renderInfoStrip) })
|
|
769
|
+
: null, showStructuredPreview ?
|
|
770
|
+
// The inset lives inside the row now, so a click on a value chip would
|
|
771
|
+
// bubble to the row's onClick and fire activate() a SECOND time (the
|
|
772
|
+
// chip's onItemClick already calls it) — toggling the editor shut again.
|
|
773
|
+
// Stop the bubble here; the chip's own handler still opens the editor.
|
|
774
|
+
(0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledRowInset, { className: 'options-readfirst-inset', onClick: function (e) { return e.stopPropagation(); }, children: (0, jsx_runtime_1.jsx)(reqore_1.ReqoreCollapsibleContent, { maxCollapsedHeight: 96, buttonProps: { className: 'options-readfirst-viewmore' }, children: (0, jsx_runtime_1.jsx)("div", { className: 'options-readfirst-structured', children: (0, jsx_runtime_1.jsx)(StructuredDataView_1.StructuredDataView, { value: optionField === null || optionField === void 0 ? void 0 : optionField.value, collapsibleRoot: false, showTypes: showFieldTypes, defaultExpandDepth: 2, onItemClick: function () { return activate(); } }) }) }) })
|
|
775
|
+
: null, showCodePreview ?
|
|
776
|
+
(0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledRowInset, { className: 'options-readfirst-inset options-readfirst-code-inset', onClick: function (e) { return e.stopPropagation(); }, children: (0, jsx_runtime_1.jsx)(reqore_1.ReqoreCollapsibleContent, { maxCollapsedHeight: 96, buttonProps: { className: 'options-readfirst-viewmore' }, children: (0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledCodePreview, { className: 'options-readfirst-code', "$bg": cHover, "$border": "".concat(cDivider, "88"), "$fg": cKey, children: optionField.value }) }) })
|
|
777
|
+
: null] }), (0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRowActions, { children: [!hidden && !fieldDisabled && !clustered && !coveredByLabel ? requiredGroupChip : null, !hidden ? dependsOnChip : null, draftChip, fieldDisabled && !dependencyEntries.length ?
|
|
778
|
+
(0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledActionSlot, { className: 'options-readfirst-trailing-slot', "$width": 18, children: (0, jsx_runtime_1.jsx)("span", { title: fieldDisabledReason, style: { display: 'inline-flex', opacity: 0.45 }, children: (0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { className: 'options-readfirst-locked', icon: 'LockLine', size: '14px' }) }) })
|
|
593
779
|
: null, infoToggle ?
|
|
594
780
|
(0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledActionSlot, { className: 'options-readfirst-info-slot', "$width": 26, children: infoToggle })
|
|
595
|
-
: null
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
781
|
+
: null, inlineOptionActions.map(function (action, index) {
|
|
782
|
+
return renderInjectedOptionAction(action, index, 'tiny');
|
|
783
|
+
}), injectedOptionActionMenuItems.length ?
|
|
784
|
+
(0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledActionSlot, { className: 'options-readfirst-actions-slot', "$width": 26,
|
|
785
|
+
// The read row opens the editor when clicked. Without this the tap
|
|
786
|
+
// that opens this menu also expands the row, which unmounts the
|
|
787
|
+
// menu — on touch that made the collapsed actions unreachable,
|
|
788
|
+
// the exact problem the collapse exists to solve.
|
|
789
|
+
onClick: function (event) { return event.stopPropagation(); }, children: (0, jsx_runtime_1.jsx)(reqore_1.ReqoreDropdown, { className: 'options-injected-actions-menu', icon: 'MoreFill', flat: true, minimal: true, fixed: true, size: 'tiny', tooltip: 'Field actions', items: injectedOptionActionMenuItems }) })
|
|
790
|
+
: null, (0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledActionSlot, { className: 'options-readfirst-statusdot-slot', "$width": 12, children: changed && !readOnly && !hidden ?
|
|
791
|
+
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { className: 'options-readfirst-revert', size: 'tiny', flat: true, minimal: true, compact: true, icon: 'HistoryLine', tooltip: 'Revert changes', onClick: function (e) {
|
|
792
|
+
var _a, _b, _c, _d;
|
|
793
|
+
e.stopPropagation();
|
|
794
|
+
handleValueChange(optionName, (_b = (_a = originalValue.current) === null || _a === void 0 ? void 0 : _a[optionName]) === null || _b === void 0 ? void 0 : _b.value, (_d = (_c = originalValue.current) === null || _c === void 0 ? void 0 : _c[optionName]) === null || _d === void 0 ? void 0 : _d.type);
|
|
795
|
+
} })
|
|
796
|
+
: dotColor ?
|
|
797
|
+
(0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledStatusDot, { "$color": dotColor, "$ring": dotStatus !== 'set', "aria-hidden": true })
|
|
798
|
+
: null })] })] }), optionName));
|
|
602
799
|
return row;
|
|
603
800
|
});
|
|
604
801
|
exports.CompactRow.displayName = 'CompactRow';
|