@mongodb-js/compass-components 1.67.1 → 1.69.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion.js +0 -1
- package/dist/components/actions/action-glyph.js +0 -1
- package/dist/components/actions/constants.js +0 -1
- package/dist/components/actions/dropdown-menu-button.js +0 -1
- package/dist/components/actions/item-action-button.js +0 -1
- package/dist/components/actions/item-action-controls.js +0 -1
- package/dist/components/actions/item-action-group.js +0 -1
- package/dist/components/actions/item-action-menu.js +0 -1
- package/dist/components/actions/small-icon-button.js +0 -1
- package/dist/components/actions/types.js +0 -1
- package/dist/components/actions/utils.js +0 -1
- package/dist/components/breadcrumb.js +0 -1
- package/dist/components/bson-value.d.ts +23 -12
- package/dist/components/bson-value.d.ts.map +1 -1
- package/dist/components/bson-value.js +53 -65
- package/dist/components/chevron-collapse-icon.js +0 -1
- package/dist/components/collapsible-field-set.js +1 -4
- package/dist/components/combobox-with-custom-option.js +0 -1
- package/dist/components/compass-components-provider.d.ts +6 -8
- package/dist/components/compass-components-provider.d.ts.map +1 -1
- package/dist/components/compass-components-provider.js +5 -6
- package/dist/components/context-menu.d.ts +1 -2
- package/dist/components/context-menu.d.ts.map +1 -1
- package/dist/components/context-menu.js +5 -3
- package/dist/components/document-list/auto-focus-context.js +0 -1
- package/dist/components/document-list/bson-display-options-context.d.ts +13 -0
- package/dist/components/document-list/bson-display-options-context.d.ts.map +1 -0
- package/dist/components/document-list/bson-display-options-context.js +56 -0
- package/dist/components/document-list/bson-utils.d.ts +10 -0
- package/dist/components/document-list/bson-utils.d.ts.map +1 -0
- package/dist/components/document-list/bson-utils.js +63 -0
- package/dist/components/document-list/date-time-picker.d.ts +6 -0
- package/dist/components/document-list/date-time-picker.d.ts.map +1 -0
- package/dist/components/document-list/date-time-picker.js +112 -0
- package/dist/components/document-list/date-with-timezone-hint.d.ts +11 -0
- package/dist/components/document-list/date-with-timezone-hint.d.ts.map +1 -0
- package/dist/components/document-list/date-with-timezone-hint.js +95 -0
- package/dist/components/document-list/document-actions-group.js +0 -1
- package/dist/components/document-list/document-edit-actions-footer.d.ts +1 -0
- package/dist/components/document-list/document-edit-actions-footer.d.ts.map +1 -1
- package/dist/components/document-list/document-edit-actions-footer.js +2 -6
- package/dist/components/document-list/document.d.ts.map +1 -1
- package/dist/components/document-list/document.js +8 -1
- package/dist/components/document-list/editors/date-editor.d.ts +4 -0
- package/dist/components/document-list/editors/date-editor.d.ts.map +1 -0
- package/dist/components/document-list/editors/date-editor.js +135 -0
- package/dist/components/document-list/editors/default-editor.d.ts +4 -0
- package/dist/components/document-list/editors/default-editor.d.ts.map +1 -0
- package/dist/components/document-list/editors/default-editor.js +46 -0
- package/dist/components/document-list/editors/editor-with-label.d.ts +7 -0
- package/dist/components/document-list/editors/editor-with-label.d.ts.map +1 -0
- package/dist/components/document-list/editors/editor-with-label.js +28 -0
- package/dist/components/document-list/editors/input-editor.d.ts +4 -0
- package/dist/components/document-list/editors/input-editor.d.ts.map +1 -0
- package/dist/components/document-list/editors/input-editor.js +24 -0
- package/dist/components/document-list/editors/shared.d.ts +16 -0
- package/dist/components/document-list/editors/shared.d.ts.map +1 -0
- package/dist/components/document-list/editors/shared.js +34 -0
- package/dist/components/document-list/editors/text-editor.d.ts +4 -0
- package/dist/components/document-list/editors/text-editor.d.ts.map +1 -0
- package/dist/components/document-list/editors/text-editor.js +85 -0
- package/dist/components/document-list/editors/uuid-editor.d.ts +4 -0
- package/dist/components/document-list/editors/uuid-editor.d.ts.map +1 -0
- package/dist/components/document-list/editors/uuid-editor.js +54 -0
- package/dist/components/document-list/element-actions.d.ts.map +1 -1
- package/dist/components/document-list/element-actions.js +11 -11
- package/dist/components/document-list/element-editors.d.ts +1 -1
- package/dist/components/document-list/element-editors.d.ts.map +1 -1
- package/dist/components/document-list/element-editors.js +56 -141
- package/dist/components/document-list/element.d.ts.map +1 -1
- package/dist/components/document-list/element.js +104 -41
- package/dist/components/document-list/index.d.ts +1 -1
- package/dist/components/document-list/index.d.ts.map +1 -1
- package/dist/components/document-list/index.js +4 -4
- package/dist/components/document-list/typography.js +0 -1
- package/dist/components/document-list/use-force-update.js +0 -1
- package/dist/components/document-list/visible-field-toggle.d.ts.map +1 -1
- package/dist/components/document-list/visible-field-toggle.js +2 -1
- package/dist/components/drawer-portal.d.ts +4 -2
- package/dist/components/drawer-portal.d.ts.map +1 -1
- package/dist/components/drawer-portal.js +0 -1
- package/dist/components/empty-content.js +0 -1
- package/dist/components/error-boundary.d.ts +1 -0
- package/dist/components/error-boundary.d.ts.map +1 -1
- package/dist/components/error-boundary.js +0 -1
- package/dist/components/error-warning-summary.js +0 -1
- package/dist/components/feedback-popover.js +0 -1
- package/dist/components/file-picker-dialog.d.ts +1 -0
- package/dist/components/file-picker-dialog.d.ts.map +1 -1
- package/dist/components/file-picker-dialog.js +0 -1
- package/dist/components/file-selector.js +0 -1
- package/dist/components/form-field-container.js +0 -1
- package/dist/components/guide-cue/guide-cue-exceptions.js +0 -1
- package/dist/components/guide-cue/guide-cue-groups.js +0 -1
- package/dist/components/guide-cue/guide-cue-service.js +0 -1
- package/dist/components/guide-cue/guide-cue-storage.js +0 -1
- package/dist/components/guide-cue/guide-cue.d.ts +2 -1
- package/dist/components/guide-cue/guide-cue.d.ts.map +1 -1
- package/dist/components/guide-cue/guide-cue.js +10 -1
- package/dist/components/horizontal-rule.js +0 -1
- package/dist/components/icons/document-icon.js +0 -1
- package/dist/components/icons/favorite-icon.js +0 -1
- package/dist/components/icons/logo-icon.js +0 -1
- package/dist/components/icons/no-saved-items-icon.js +0 -1
- package/dist/components/icons/png-icon.js +0 -1
- package/dist/components/icons/server-icon.js +0 -1
- package/dist/components/index-icon.js +0 -1
- package/dist/components/index-keys-badge.js +0 -1
- package/dist/components/inline-definition.js +2 -3
- package/dist/components/inline-info-link.js +0 -1
- package/dist/components/insights-chip.js +0 -1
- package/dist/components/interactive-popover.js +0 -1
- package/dist/components/keyline-card.js +0 -1
- package/dist/components/leafygreen.d.ts +1 -35
- package/dist/components/leafygreen.d.ts.map +1 -1
- package/dist/components/leafygreen.js +0 -1
- package/dist/components/links/link.d.ts +1 -1
- package/dist/components/links/link.d.ts.map +1 -1
- package/dist/components/links/link.js +0 -1
- package/dist/components/list-editor.js +0 -1
- package/dist/components/loader.js +0 -1
- package/dist/components/modals/confirmation-modal.js +0 -1
- package/dist/components/modals/form-modal.d.ts +2 -1
- package/dist/components/modals/form-modal.d.ts.map +1 -1
- package/dist/components/modals/form-modal.js +2 -3
- package/dist/components/modals/info-modal.js +0 -1
- package/dist/components/modals/marketing-modal.js +0 -1
- package/dist/components/modals/modal-body.d.ts.map +1 -1
- package/dist/components/modals/modal-body.js +7 -1
- package/dist/components/modals/modal-header.js +0 -1
- package/dist/components/modals/modal.js +0 -1
- package/dist/components/options-toggle.js +0 -1
- package/dist/components/placeholder.js +0 -1
- package/dist/components/radio-box-group.js +0 -1
- package/dist/components/resize-handle.d.ts.map +1 -1
- package/dist/components/resize-handle.js +5 -9
- package/dist/components/resizeable-sidebar.js +0 -1
- package/dist/components/select-list.d.ts.map +1 -1
- package/dist/components/select-list.js +2 -3
- package/dist/components/signal-popover.d.ts +1 -1
- package/dist/components/signal-popover.d.ts.map +1 -1
- package/dist/components/signal-popover.js +2 -4
- package/dist/components/signals.js +0 -1
- package/dist/components/tab-nav-bar.js +0 -1
- package/dist/components/toast-body.js +0 -1
- package/dist/components/virtual-grid.js +0 -1
- package/dist/components/virtual-list.js +1 -7
- package/dist/components/workspace-container.d.ts +2 -2
- package/dist/components/workspace-container.d.ts.map +1 -1
- package/dist/components/workspace-container.js +0 -1
- package/dist/components/workspace-tabs/tab.js +0 -1
- package/dist/components/workspace-tabs/use-tab-theme.js +0 -1
- package/dist/components/workspace-tabs/workspace-tabs.d.ts.map +1 -1
- package/dist/components/workspace-tabs/workspace-tabs.js +1 -2
- package/dist/force-emotion-speedy.js +0 -1
- package/dist/hooks/use-confirmation.d.ts +3 -1
- package/dist/hooks/use-confirmation.d.ts.map +1 -1
- package/dist/hooks/use-confirmation.js +2 -3
- package/dist/hooks/use-copy-paste-context-menu.d.ts +1 -1
- package/dist/hooks/use-copy-paste-context-menu.d.ts.map +1 -1
- package/dist/hooks/use-copy-paste-context-menu.js +0 -1
- package/dist/hooks/use-current-value-ref.js +0 -1
- package/dist/hooks/use-default-action.js +0 -1
- package/dist/hooks/use-dom-rect.js +0 -1
- package/dist/hooks/use-effect-on-change.js +0 -1
- package/dist/hooks/use-error-details.js +0 -1
- package/dist/hooks/use-focus-hover.js +0 -1
- package/dist/hooks/use-focus-ring.js +0 -1
- package/dist/hooks/use-formatted-date.js +0 -1
- package/dist/hooks/use-hotkeys.js +0 -1
- package/dist/hooks/use-initial-value.js +0 -1
- package/dist/hooks/use-persisted-state.js +0 -1
- package/dist/hooks/use-scrollbars.js +0 -1
- package/dist/hooks/use-sort.js +0 -1
- package/dist/hooks/use-stacked-component.d.ts.map +1 -1
- package/dist/hooks/use-stacked-component.js +0 -1
- package/dist/hooks/use-sync-state-on-prop-change.js +0 -1
- package/dist/hooks/use-theme.d.ts.map +1 -1
- package/dist/hooks/use-theme.js +0 -1
- package/dist/hooks/use-throttled-props.js +0 -1
- package/dist/hooks/use-toast.d.ts +3 -1
- package/dist/hooks/use-toast.d.ts.map +1 -1
- package/dist/hooks/use-toast.js +0 -1
- package/dist/hooks/use-virtual-grid.js +0 -1
- package/dist/hooks/use-virtual-list-item-observer.js +0 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -5
- package/dist/utils/format-date.d.ts +17 -0
- package/dist/utils/format-date.d.ts.map +1 -1
- package/dist/utils/format-date.js +33 -3
- package/dist/utils/format.js +0 -1
- package/dist/utils/merge-props.js +0 -1
- package/dist/utils/rafraf.js +0 -1
- package/dist/utils/reset-global-css.js +0 -1
- package/package.json +19 -19
- package/dist/components/accordion.js.map +0 -1
- package/dist/components/actions/action-glyph.js.map +0 -1
- package/dist/components/actions/constants.js.map +0 -1
- package/dist/components/actions/dropdown-menu-button.js.map +0 -1
- package/dist/components/actions/item-action-button.js.map +0 -1
- package/dist/components/actions/item-action-controls.js.map +0 -1
- package/dist/components/actions/item-action-group.js.map +0 -1
- package/dist/components/actions/item-action-menu.js.map +0 -1
- package/dist/components/actions/small-icon-button.js.map +0 -1
- package/dist/components/actions/types.js.map +0 -1
- package/dist/components/actions/utils.js.map +0 -1
- package/dist/components/breadcrumb.js.map +0 -1
- package/dist/components/bson-value.js.map +0 -1
- package/dist/components/chevron-collapse-icon.js.map +0 -1
- package/dist/components/collapsible-field-set.js.map +0 -1
- package/dist/components/combobox-with-custom-option.js.map +0 -1
- package/dist/components/compass-components-provider.js.map +0 -1
- package/dist/components/context-menu.js.map +0 -1
- package/dist/components/document-list/auto-focus-context.js.map +0 -1
- package/dist/components/document-list/document-actions-group.js.map +0 -1
- package/dist/components/document-list/document-edit-actions-footer.js.map +0 -1
- package/dist/components/document-list/document.js.map +0 -1
- package/dist/components/document-list/element-actions.js.map +0 -1
- package/dist/components/document-list/element-editors.js.map +0 -1
- package/dist/components/document-list/element.js.map +0 -1
- package/dist/components/document-list/index.js.map +0 -1
- package/dist/components/document-list/legacy-uuid-format-context.d.ts +0 -4
- package/dist/components/document-list/legacy-uuid-format-context.d.ts.map +0 -1
- package/dist/components/document-list/legacy-uuid-format-context.js +0 -10
- package/dist/components/document-list/legacy-uuid-format-context.js.map +0 -1
- package/dist/components/document-list/typography.js.map +0 -1
- package/dist/components/document-list/use-force-update.js.map +0 -1
- package/dist/components/document-list/visible-field-toggle.js.map +0 -1
- package/dist/components/drawer-portal.js.map +0 -1
- package/dist/components/empty-content.js.map +0 -1
- package/dist/components/error-boundary.js.map +0 -1
- package/dist/components/error-warning-summary.js.map +0 -1
- package/dist/components/feedback-popover.js.map +0 -1
- package/dist/components/file-picker-dialog.js.map +0 -1
- package/dist/components/file-selector.js.map +0 -1
- package/dist/components/form-field-container.js.map +0 -1
- package/dist/components/guide-cue/guide-cue-exceptions.js.map +0 -1
- package/dist/components/guide-cue/guide-cue-groups.js.map +0 -1
- package/dist/components/guide-cue/guide-cue-service.js.map +0 -1
- package/dist/components/guide-cue/guide-cue-storage.js.map +0 -1
- package/dist/components/guide-cue/guide-cue.js.map +0 -1
- package/dist/components/horizontal-rule.js.map +0 -1
- package/dist/components/icons/document-icon.js.map +0 -1
- package/dist/components/icons/favorite-icon.js.map +0 -1
- package/dist/components/icons/logo-icon.js.map +0 -1
- package/dist/components/icons/no-saved-items-icon.js.map +0 -1
- package/dist/components/icons/png-icon.js.map +0 -1
- package/dist/components/icons/server-icon.js.map +0 -1
- package/dist/components/index-icon.js.map +0 -1
- package/dist/components/index-keys-badge.js.map +0 -1
- package/dist/components/inline-definition.js.map +0 -1
- package/dist/components/inline-info-link.js.map +0 -1
- package/dist/components/insights-chip.js.map +0 -1
- package/dist/components/interactive-popover.js.map +0 -1
- package/dist/components/keyline-card.js.map +0 -1
- package/dist/components/leafygreen.js.map +0 -1
- package/dist/components/links/link.js.map +0 -1
- package/dist/components/list-editor.js.map +0 -1
- package/dist/components/loader.js.map +0 -1
- package/dist/components/modals/confirmation-modal.js.map +0 -1
- package/dist/components/modals/form-modal.js.map +0 -1
- package/dist/components/modals/info-modal.js.map +0 -1
- package/dist/components/modals/marketing-modal.js.map +0 -1
- package/dist/components/modals/modal-body.js.map +0 -1
- package/dist/components/modals/modal-header.js.map +0 -1
- package/dist/components/modals/modal.js.map +0 -1
- package/dist/components/options-toggle.js.map +0 -1
- package/dist/components/placeholder.js.map +0 -1
- package/dist/components/radio-box-group.js.map +0 -1
- package/dist/components/resize-handle.js.map +0 -1
- package/dist/components/resizeable-sidebar.js.map +0 -1
- package/dist/components/select-list.js.map +0 -1
- package/dist/components/signal-popover.js.map +0 -1
- package/dist/components/signals.js.map +0 -1
- package/dist/components/tab-nav-bar.js.map +0 -1
- package/dist/components/toast-body.js.map +0 -1
- package/dist/components/virtual-grid.js.map +0 -1
- package/dist/components/virtual-list.js.map +0 -1
- package/dist/components/workspace-container.js.map +0 -1
- package/dist/components/workspace-tabs/tab.js.map +0 -1
- package/dist/components/workspace-tabs/use-tab-theme.js.map +0 -1
- package/dist/components/workspace-tabs/workspace-tabs.js.map +0 -1
- package/dist/force-emotion-speedy.js.map +0 -1
- package/dist/hooks/use-confirmation.js.map +0 -1
- package/dist/hooks/use-copy-paste-context-menu.js.map +0 -1
- package/dist/hooks/use-current-value-ref.js.map +0 -1
- package/dist/hooks/use-default-action.js.map +0 -1
- package/dist/hooks/use-dom-rect.js.map +0 -1
- package/dist/hooks/use-effect-on-change.js.map +0 -1
- package/dist/hooks/use-error-details.js.map +0 -1
- package/dist/hooks/use-focus-hover.js.map +0 -1
- package/dist/hooks/use-focus-ring.js.map +0 -1
- package/dist/hooks/use-formatted-date.js.map +0 -1
- package/dist/hooks/use-hotkeys.js.map +0 -1
- package/dist/hooks/use-initial-value.js.map +0 -1
- package/dist/hooks/use-persisted-state.js.map +0 -1
- package/dist/hooks/use-scrollbars.js.map +0 -1
- package/dist/hooks/use-sort.js.map +0 -1
- package/dist/hooks/use-stacked-component.js.map +0 -1
- package/dist/hooks/use-sync-state-on-prop-change.js.map +0 -1
- package/dist/hooks/use-theme.js.map +0 -1
- package/dist/hooks/use-throttled-props.js.map +0 -1
- package/dist/hooks/use-toast.js.map +0 -1
- package/dist/hooks/use-virtual-grid.js.map +0 -1
- package/dist/hooks/use-virtual-list-item-observer.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/utils/format-date.js.map +0 -1
- package/dist/utils/format.js.map +0 -1
- package/dist/utils/merge-props.js.map +0 -1
- package/dist/utils/rafraf.js.map +0 -1
- package/dist/utils/reset-global-css.js.map +0 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.DefaultEditor = DefaultEditor;
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
const input_editor_1 = require("./input-editor");
|
|
39
|
+
const editor_with_label_1 = require("./editor-with-label");
|
|
40
|
+
function DefaultEditor({ value, type, ...props }) {
|
|
41
|
+
const inputStyle = (0, react_1.useMemo)(() => {
|
|
42
|
+
return { width: `${Math.max(value.length, 1)}ch` };
|
|
43
|
+
}, [value]);
|
|
44
|
+
return (react_1.default.createElement(editor_with_label_1.EditorWithLabel, { type: type },
|
|
45
|
+
react_1.default.createElement(input_editor_1.InputEditor, { value: value, ...props, style: inputStyle })));
|
|
46
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TypeCastMap } from 'hadron-type-checker';
|
|
3
|
+
export declare function EditorWithLabel({ type, children, }: {
|
|
4
|
+
type: keyof TypeCastMap;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}): React.JSX.Element;
|
|
7
|
+
//# sourceMappingURL=editor-with-label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-with-label.d.ts","sourceRoot":"","sources":["../../../../src/components/document-list/editors/editor-with-label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAcvD,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,MAAM,WAAW,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,qBAUA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.EditorWithLabel = EditorWithLabel;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
9
|
+
const bson_utils_1 = require("../bson-utils");
|
|
10
|
+
const containerStyles = (0, emotion_1.css)({
|
|
11
|
+
display: 'inline-flex',
|
|
12
|
+
alignItems: 'center',
|
|
13
|
+
maxWidth: '100%',
|
|
14
|
+
});
|
|
15
|
+
const labelStyles = (0, emotion_1.css)({
|
|
16
|
+
userSelect: 'none',
|
|
17
|
+
whiteSpace: 'nowrap',
|
|
18
|
+
});
|
|
19
|
+
function EditorWithLabel({ type, children, }) {
|
|
20
|
+
const label = bson_utils_1.BSON_TYPE_LABEL[type];
|
|
21
|
+
const bsonStyles = (0, bson_utils_1.useBsonThemeStyles)(type);
|
|
22
|
+
return (react_1.default.createElement("div", { className: containerStyles, style: bsonStyles },
|
|
23
|
+
label && react_1.default.createElement("span", { className: labelStyles },
|
|
24
|
+
label,
|
|
25
|
+
"('"),
|
|
26
|
+
children,
|
|
27
|
+
label && react_1.default.createElement("span", { className: labelStyles }, "')")));
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-editor.d.ts","sourceRoot":"","sources":["../../../../src/components/document-list/editors/input-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAK5C,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,KAAK,EACL,QAAQ,EACR,SAAS,EACT,MAAM,EACN,SAAS,EACT,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,qBA4B3B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InputEditor = InputEditor;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
9
|
+
const shared_1 = require("./shared");
|
|
10
|
+
const use_theme_1 = require("../../../hooks/use-theme");
|
|
11
|
+
// Base single-line editor shared by the default, date and UUID editors. Callers
|
|
12
|
+
// only need to provide the value handling and their own width / placeholder.
|
|
13
|
+
function InputEditor({ value, valid, onChange, autoFocus, onBlur, className, ...props }) {
|
|
14
|
+
const darkMode = (0, use_theme_1.useDarkMode)();
|
|
15
|
+
return (react_1.default.createElement("input", { ...props, type: "text", "data-testid": "hadron-document-value-editor", value: value, onChange: (evt) => {
|
|
16
|
+
onChange(evt.currentTarget.value);
|
|
17
|
+
}, onBlur: onBlur,
|
|
18
|
+
// See ../element.tsx
|
|
19
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
20
|
+
autoFocus: autoFocus, className: (0, emotion_1.cx)(shared_1.editorStyles, !valid && shared_1.editorInvalidStyles, !valid &&
|
|
21
|
+
(darkMode
|
|
22
|
+
? shared_1.editorInvalidDarkModeStyles
|
|
23
|
+
: shared_1.editorInvalidLightModeStyles), className), spellCheck: "false" }));
|
|
24
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { TypeCastMap } from 'hadron-type-checker';
|
|
3
|
+
export declare const editorStyles: string;
|
|
4
|
+
export declare const editorInvalidStyles: string;
|
|
5
|
+
export declare const editorInvalidLightModeStyles: string;
|
|
6
|
+
export declare const editorInvalidDarkModeStyles: string;
|
|
7
|
+
export type EditorInputProps = Omit<React.HTMLProps<HTMLInputElement>, 'value' | 'onChange' | 'onBlur' | 'autoFocus'>;
|
|
8
|
+
export type EditorProps = {
|
|
9
|
+
autoFocus?: boolean;
|
|
10
|
+
value: string;
|
|
11
|
+
valid: boolean;
|
|
12
|
+
onChange(newValue: string): void;
|
|
13
|
+
onBlur(): void;
|
|
14
|
+
type: keyof TypeCastMap;
|
|
15
|
+
} & EditorInputProps;
|
|
16
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/components/document-list/editors/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAmBvD,eAAO,MAAM,YAAY,QAAiC,CAAC;AAE3D,eAAO,MAAM,mBAAmB,QAI9B,CAAC;AAEH,eAAO,MAAM,4BAA4B,QAGvC,CAAC;AAEH,eAAO,MAAM,2BAA2B,QAGtC,CAAC;AAIH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,EACjC,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,CAC9C,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,MAAM,IAAI,IAAI,CAAC;IACf,IAAI,EAAE,MAAM,WAAW,CAAC;CACzB,GAAG,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.editorInvalidDarkModeStyles = exports.editorInvalidLightModeStyles = exports.editorInvalidStyles = exports.editorStyles = void 0;
|
|
4
|
+
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
5
|
+
const palette_1 = require("@leafygreen-ui/palette");
|
|
6
|
+
const editorReset = (0, emotion_1.css)({
|
|
7
|
+
padding: 0,
|
|
8
|
+
margin: 0,
|
|
9
|
+
border: 'none',
|
|
10
|
+
boxShadow: 'none',
|
|
11
|
+
outline: 'none',
|
|
12
|
+
backgroundColor: 'transparent',
|
|
13
|
+
maxWidth: '100%',
|
|
14
|
+
});
|
|
15
|
+
const editorOutline = (0, emotion_1.css)({
|
|
16
|
+
'&:focus, &:active': {
|
|
17
|
+
borderRadius: `2px`,
|
|
18
|
+
boxShadow: `0 0 0 2px ${palette_1.palette.blue.light1}`,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
exports.editorStyles = (0, emotion_1.cx)(editorReset, editorOutline);
|
|
22
|
+
exports.editorInvalidStyles = (0, emotion_1.css)({
|
|
23
|
+
'&:focus, &:active': {
|
|
24
|
+
boxShadow: `0 0 0 2px ${palette_1.palette.red.dark2}`,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
exports.editorInvalidLightModeStyles = (0, emotion_1.css)({
|
|
28
|
+
backgroundColor: palette_1.palette.red.light2,
|
|
29
|
+
color: palette_1.palette.red.dark2,
|
|
30
|
+
});
|
|
31
|
+
exports.editorInvalidDarkModeStyles = (0, emotion_1.css)({
|
|
32
|
+
backgroundColor: palette_1.palette.red.dark2,
|
|
33
|
+
color: palette_1.palette.red.light2,
|
|
34
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-editor.d.ts","sourceRoot":"","sources":["../../../../src/components/document-list/editors/text-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAKvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAqB5C,wBAAgB,UAAU,CAAC,EACzB,KAAK,EAAE,GAAG,EACV,KAAK,EACL,QAAQ,EACR,SAAS,EACT,MAAM,EACN,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,qBA+C3B"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.TextEditor = TextEditor;
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
39
|
+
const bson_value_1 = require("../../bson-value");
|
|
40
|
+
const typography_1 = require("../typography");
|
|
41
|
+
const shared_1 = require("./shared");
|
|
42
|
+
const textareaContainer = (0, emotion_1.css)({
|
|
43
|
+
width: '100%',
|
|
44
|
+
maxWidth: '100%',
|
|
45
|
+
'&::before, &::after': {
|
|
46
|
+
content: "'\"'",
|
|
47
|
+
userSelect: 'none',
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
const editorTextarea = (0, emotion_1.css)({
|
|
51
|
+
display: 'inline-block',
|
|
52
|
+
whiteSpace: 'nowrap',
|
|
53
|
+
minWidth: '5ch',
|
|
54
|
+
// 2ch for `"` around the textarea
|
|
55
|
+
maxWidth: 'calc(100% - 2ch)',
|
|
56
|
+
verticalAlign: 'top',
|
|
57
|
+
color: 'inherit',
|
|
58
|
+
});
|
|
59
|
+
function TextEditor({ value: val, valid, onChange, autoFocus, onBlur, ...props }) {
|
|
60
|
+
const inputStyle = (0, react_1.useMemo)(() => {
|
|
61
|
+
const lines = val.split('\n');
|
|
62
|
+
let longestLineCharLength = 0;
|
|
63
|
+
for (const line of lines) {
|
|
64
|
+
const length = line.length;
|
|
65
|
+
if (length > longestLineCharLength) {
|
|
66
|
+
longestLineCharLength = length;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const width = `${Math.min(
|
|
70
|
+
// Adding one to account for a textarea resize icon button thingie
|
|
71
|
+
longestLineCharLength + 1, 70)}ch`;
|
|
72
|
+
const minLines = Math.max(lines.length, longestLineCharLength > 70 ? 2 : 1);
|
|
73
|
+
const maxLines = Math.min(minLines, 10);
|
|
74
|
+
const minHeight = typography_1.documentTypography.lineHeight * Math.min(minLines, maxLines);
|
|
75
|
+
const height = typography_1.documentTypography.lineHeight * maxLines;
|
|
76
|
+
return { width, minHeight, height };
|
|
77
|
+
}, [val]);
|
|
78
|
+
return (react_1.default.createElement(bson_value_1.BSONValueContainer, { type: "String", className: (0, emotion_1.cx)(textareaContainer) },
|
|
79
|
+
react_1.default.createElement("textarea", { "data-testid": "hadron-document-value-editor", value: val, onChange: (evt) => {
|
|
80
|
+
onChange(evt.currentTarget.value);
|
|
81
|
+
}, onBlur: onBlur,
|
|
82
|
+
// See ../element.tsx
|
|
83
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
84
|
+
autoFocus: autoFocus, className: (0, emotion_1.cx)(shared_1.editorStyles, editorTextarea, !valid && shared_1.editorInvalidStyles), spellCheck: "false", style: inputStyle, ...props })));
|
|
85
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uuid-editor.d.ts","sourceRoot":"","sources":["../../../../src/components/document-list/editors/uuid-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAW5C,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,qBAiBhE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.UUIDEditor = UUIDEditor;
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
39
|
+
const editor_with_label_1 = require("./editor-with-label");
|
|
40
|
+
const input_editor_1 = require("./input-editor");
|
|
41
|
+
const uuidEditorInput = (0, emotion_1.css)({
|
|
42
|
+
display: 'inline-block',
|
|
43
|
+
whiteSpace: 'nowrap',
|
|
44
|
+
verticalAlign: 'top',
|
|
45
|
+
color: 'inherit',
|
|
46
|
+
});
|
|
47
|
+
function UUIDEditor({ value, type, ...props }) {
|
|
48
|
+
const inputStyle = (0, react_1.useMemo)(() => {
|
|
49
|
+
// UUID format is 36 characters (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
|
|
50
|
+
return { width: `${Math.max(value.length, 36)}ch` };
|
|
51
|
+
}, [value]);
|
|
52
|
+
return (react_1.default.createElement(editor_with_label_1.EditorWithLabel, { type: type },
|
|
53
|
+
react_1.default.createElement(input_editor_1.InputEditor, { value: value, placeholder: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", ...props, className: uuidEditorInput, style: inputStyle })));
|
|
54
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element-actions.d.ts","sourceRoot":"","sources":["../../../src/components/document-list/element-actions.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"element-actions.d.ts","sourceRoot":"","sources":["../../../src/components/document-list/element-actions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAqBzD,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAChD,QAAQ,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CA2CA,CAAC;AA6CF,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACpD,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,sBAAsB,EAAE,MAAM,IAAI,CAAC;CACpC,CAqEA,CAAC"}
|
|
@@ -35,10 +35,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.AddFieldActions = exports.EditActions = void 0;
|
|
37
37
|
const react_1 = __importStar(require("react"));
|
|
38
|
-
const
|
|
38
|
+
const leafygreen_1 = require("../leafygreen");
|
|
39
39
|
const emotion_1 = require("@leafygreen-ui/emotion");
|
|
40
40
|
const tokens_1 = require("@leafygreen-ui/tokens");
|
|
41
|
-
const
|
|
41
|
+
const leafygreen_2 = require("../leafygreen");
|
|
42
42
|
const typography_1 = require("./typography");
|
|
43
43
|
const buttonReset = (0, emotion_1.css)({
|
|
44
44
|
margin: 0,
|
|
@@ -58,11 +58,11 @@ const EditActions = ({ editing, onRemove, onRevert }) => {
|
|
|
58
58
|
evt.stopPropagation();
|
|
59
59
|
onRevert();
|
|
60
60
|
} },
|
|
61
|
-
react_1.default.createElement(
|
|
61
|
+
react_1.default.createElement(leafygreen_2.Icon, { size: "xsmall", className: editActionIconStyle, glyph: "Undo" }))) : onRemove ? (react_1.default.createElement("button", { type: "button", "data-testid": "hadron-document-remove", className: buttonReset, title: "Remove field", "aria-label": "Remove field", onClick: (evt) => {
|
|
62
62
|
evt.stopPropagation();
|
|
63
63
|
onRemove();
|
|
64
64
|
} },
|
|
65
|
-
react_1.default.createElement(
|
|
65
|
+
react_1.default.createElement(leafygreen_2.Icon, { size: "xsmall", glyph: "Trash", className: editActionIconStyle }))) : null)));
|
|
66
66
|
};
|
|
67
67
|
exports.EditActions = EditActions;
|
|
68
68
|
const addFieldButton = (0, emotion_1.css)({
|
|
@@ -91,30 +91,31 @@ const AddFieldButton = (0, react_1.forwardRef)(function AddFieldButton({ onClick
|
|
|
91
91
|
});
|
|
92
92
|
const AddFieldActions = ({ editing, type, parentType, keyName, onAddFieldToElement, onAddFieldAfterElement, }) => {
|
|
93
93
|
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
94
|
+
const menuTriggerRef = (0, react_1.useRef)(null);
|
|
94
95
|
if (!editing) {
|
|
95
96
|
return null;
|
|
96
97
|
}
|
|
97
98
|
if (onAddFieldAfterElement && !onAddFieldToElement) {
|
|
98
99
|
return react_1.default.createElement(AddFieldButton, { onClick: onAddFieldAfterElement });
|
|
99
100
|
}
|
|
100
|
-
return (react_1.default.createElement(
|
|
101
|
+
return (react_1.default.createElement(leafygreen_1.Menu, { open: isOpen, setOpen: setIsOpen, align: "bottom", justify: "start", className: menu, refEl: menuTriggerRef, trigger: ({ children, ...props }) => {
|
|
101
102
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
102
|
-
react_1.default.createElement(AddFieldButton, {
|
|
103
|
+
react_1.default.createElement(AddFieldButton, { ...props, ref: menuTriggerRef }),
|
|
103
104
|
children));
|
|
104
105
|
} },
|
|
105
|
-
onAddFieldToElement && (react_1.default.createElement(
|
|
106
|
+
onAddFieldToElement && (react_1.default.createElement(leafygreen_1.MenuItem, { "data-testid": "hadron-document-add-child", onClick: () => {
|
|
106
107
|
setIsOpen(false);
|
|
107
108
|
onAddFieldToElement();
|
|
108
|
-
}, glyph: react_1.default.createElement(
|
|
109
|
+
}, glyph: react_1.default.createElement(leafygreen_2.Icon, { glyph: "Relationship" }), className: menuItem },
|
|
109
110
|
react_1.default.createElement("div", null,
|
|
110
111
|
"Add ",
|
|
111
112
|
type === 'Array' ? 'item' : 'field',
|
|
112
113
|
" to ",
|
|
113
114
|
react_1.default.createElement("b", null, keyName)))),
|
|
114
|
-
react_1.default.createElement(
|
|
115
|
+
react_1.default.createElement(leafygreen_1.MenuItem, { "data-testid": "hadron-document-add-sibling", onClick: () => {
|
|
115
116
|
setIsOpen(false);
|
|
116
117
|
onAddFieldAfterElement();
|
|
117
|
-
}, glyph: react_1.default.createElement(
|
|
118
|
+
}, glyph: react_1.default.createElement(leafygreen_2.Icon, { glyph: "PlusWithCircle" }), className: menuItem },
|
|
118
119
|
react_1.default.createElement("div", null,
|
|
119
120
|
"Add ",
|
|
120
121
|
parentType === 'Array' ? 'item' : 'field',
|
|
@@ -122,4 +123,3 @@ const AddFieldActions = ({ editing, type, parentType, keyName, onAddFieldToEleme
|
|
|
122
123
|
react_1.default.createElement("b", null, keyName)))));
|
|
123
124
|
};
|
|
124
125
|
exports.AddFieldActions = AddFieldActions;
|
|
125
|
-
//# sourceMappingURL=element-actions.js.map
|
|
@@ -13,7 +13,7 @@ export declare const KeyEditor: React.FunctionComponent<{
|
|
|
13
13
|
export declare const ValueEditor: React.FunctionComponent<{
|
|
14
14
|
editing?: boolean;
|
|
15
15
|
onEditStart(): void;
|
|
16
|
-
type:
|
|
16
|
+
type: keyof TypeCastMap;
|
|
17
17
|
value: string;
|
|
18
18
|
valid: boolean;
|
|
19
19
|
validationMessage: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element-editors.d.ts","sourceRoot":"","sources":["../../../src/components/document-list/element-editors.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"element-editors.d.ts","sourceRoot":"","sources":["../../../src/components/document-list/element-editors.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AA8CvD,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,IAAI,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CA6EA,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAChD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,IAAI,IAAI,CAAC;IACpB,IAAI,EAAE,MAAM,WAAW,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,aAAa,EAAE,WAAW,CAAC,MAAM,WAAW,CAAC,CAAC;IAC9C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,OAAO,IAAI,IAAI,CAAC;IAChB,MAAM,IAAI,IAAI,CAAC;CAChB,CA0EA,CAAC;AA8CF,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAClD,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAkDA,CAAC"}
|