datocms-react-ui 3.1.0-next.5 → 3.1.0-next.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/DateInput.d.ts +2 -0
- package/dist/DateInput.js +2 -0
- package/dist/DateTimeInput.d.ts +2 -0
- package/dist/DateTimeInput.js +2 -0
- package/dist/DateTimeRangeInput.d.ts +2 -0
- package/dist/DateTimeRangeInput.js +2 -0
- package/dist/FieldTypeAvatar.d.ts +2 -0
- package/dist/FieldTypeAvatar.js +2 -0
- package/dist/FieldTypeName.d.ts +2 -0
- package/dist/FieldTypeName.js +2 -0
- package/dist/FilterBuilder.d.ts +2 -0
- package/dist/FilterBuilder.js +2 -0
- package/dist/LICENSE-lucide.txt +43 -0
- package/dist/RecordRow.d.ts +2 -0
- package/dist/RecordRow.js +2 -0
- package/dist/UploadCard.js +2 -2
- package/dist/UploadPreview.d.ts +2 -2
- package/dist/UploadPreview.js +1 -1
- package/dist/UserRow.d.ts +2 -0
- package/dist/UserRow.js +2 -0
- package/dist/react-ui/src/Canvas.d.ts +7 -1
- package/dist/react-ui/src/Canvas.js +26 -4
- package/dist/react-ui/src/ctxAnswer.js +21 -0
- package/dist/react-ui/src/ctxDateSettings.js +7 -5
- package/dist/react-ui/src/ctxRecordPresentation.js +34 -0
- package/dist/react-ui/src/ctxUploads.js +23 -0
- package/dist/styles.css +669 -63
- package/dist/ui-public/icons/index.js +313 -379
- package/dist/ui-public/icons/lucide/app-window.js +33 -0
- package/dist/ui-public/icons/lucide/arrow-big-down.js +22 -0
- package/dist/ui-public/icons/lucide/arrow-down-a-z.js +28 -0
- package/dist/ui-public/icons/lucide/arrow-down-from-line.js +26 -0
- package/dist/ui-public/icons/lucide/arrow-down.js +22 -0
- package/dist/ui-public/icons/lucide/arrow-left.js +22 -0
- package/dist/ui-public/icons/lucide/arrow-right-left.js +27 -0
- package/dist/ui-public/icons/lucide/arrow-right.js +22 -0
- package/dist/ui-public/icons/lucide/arrow-up-down.js +27 -0
- package/dist/ui-public/icons/lucide/arrow-up-from-line.js +26 -0
- package/dist/ui-public/icons/lucide/arrow-up.js +22 -0
- package/dist/ui-public/icons/lucide/ban.js +26 -0
- package/dist/ui-public/icons/lucide/book.js +22 -0
- package/dist/ui-public/icons/lucide/bookmark.js +22 -0
- package/dist/ui-public/icons/lucide/braces.js +22 -0
- package/dist/ui-public/icons/lucide/calendar.js +33 -0
- package/dist/ui-public/icons/{regular → lucide}/check.js +9 -3
- package/dist/ui-public/icons/{regular → lucide}/chevron-down.js +9 -3
- package/dist/ui-public/icons/{regular → lucide}/chevron-left.js +9 -3
- package/dist/ui-public/icons/{regular → lucide}/chevron-right.js +9 -3
- package/dist/ui-public/icons/lucide/chevrons-down.js +22 -0
- package/dist/ui-public/icons/lucide/chevrons-left.js +22 -0
- package/dist/ui-public/icons/lucide/chevrons-right.js +22 -0
- package/dist/ui-public/icons/lucide/circle-arrow-up.js +30 -0
- package/dist/ui-public/icons/lucide/circle-check.js +26 -0
- package/dist/ui-public/icons/lucide/circle-dot.js +30 -0
- package/dist/ui-public/icons/lucide/circle-exclamation-point.js +40 -0
- package/dist/ui-public/icons/lucide/circle-question-mark.js +30 -0
- package/dist/ui-public/icons/lucide/clock.js +26 -0
- package/dist/ui-public/icons/lucide/code.js +22 -0
- package/dist/ui-public/icons/lucide/command.js +22 -0
- package/dist/ui-public/icons/lucide/copy-plus.js +44 -0
- package/dist/ui-public/icons/lucide/copy.js +29 -0
- package/dist/ui-public/icons/lucide/corner-left-up.js +22 -0
- package/dist/ui-public/icons/lucide/database.js +31 -0
- package/dist/ui-public/icons/lucide/download.js +26 -0
- package/dist/ui-public/icons/lucide/earth.js +31 -0
- package/dist/ui-public/icons/lucide/ellipsis-vertical.js +38 -0
- package/dist/ui-public/icons/lucide/ellipsis.js +38 -0
- package/dist/ui-public/icons/lucide/external-link.js +26 -0
- package/dist/ui-public/icons/lucide/eye-off.js +27 -0
- package/dist/ui-public/icons/lucide/eye.js +26 -0
- package/dist/ui-public/icons/lucide/file-code.js +27 -0
- package/dist/ui-public/icons/lucide/file-output.js +27 -0
- package/dist/ui-public/icons/lucide/flask-conical.js +26 -0
- package/dist/ui-public/icons/lucide/fold-vertical.js +31 -0
- package/dist/ui-public/icons/lucide/folder-open.js +22 -0
- package/dist/ui-public/icons/lucide/folder-plus.js +26 -0
- package/dist/ui-public/icons/lucide/folder.js +22 -0
- package/dist/ui-public/icons/lucide/folders.js +22 -0
- package/dist/ui-public/icons/lucide/funnel.js +22 -0
- package/dist/ui-public/icons/lucide/gift.js +33 -0
- package/dist/ui-public/icons/lucide/git-branch.js +34 -0
- package/dist/ui-public/icons/lucide/git-fork.js +40 -0
- package/dist/ui-public/icons/lucide/globe.js +30 -0
- package/dist/ui-public/icons/lucide/grip-vertical.js +53 -0
- package/dist/ui-public/icons/lucide/hand.js +27 -0
- package/dist/ui-public/icons/lucide/hard-hat.js +33 -0
- package/dist/ui-public/icons/lucide/hash.js +47 -0
- package/dist/ui-public/icons/lucide/heading-1.js +27 -0
- package/dist/ui-public/icons/lucide/heading-2.js +27 -0
- package/dist/ui-public/icons/lucide/heading-3.js +28 -0
- package/dist/ui-public/icons/lucide/heading-4.js +28 -0
- package/dist/ui-public/icons/lucide/heading-5.js +28 -0
- package/dist/ui-public/icons/lucide/heading-6.js +32 -0
- package/dist/ui-public/icons/lucide/highlighter.js +22 -0
- package/dist/ui-public/icons/lucide/hourglass.js +27 -0
- package/dist/ui-public/icons/lucide/house.js +22 -0
- package/dist/ui-public/icons/lucide/image.js +37 -0
- package/dist/ui-public/icons/lucide/images.js +38 -0
- package/dist/ui-public/icons/lucide/info.js +30 -0
- package/dist/ui-public/icons/lucide/italic.js +41 -0
- package/dist/ui-public/icons/lucide/keyboard.js +38 -0
- package/dist/ui-public/icons/lucide/languages.js +29 -0
- package/dist/ui-public/icons/lucide/layers.js +26 -0
- package/dist/ui-public/icons/lucide/layout-grid.js +51 -0
- package/dist/ui-public/icons/lucide/letter-b.js +22 -0
- package/dist/ui-public/icons/lucide/letter-text.js +28 -0
- package/dist/ui-public/icons/lucide/life-buoy.js +37 -0
- package/dist/ui-public/icons/lucide/link.js +22 -0
- package/dist/ui-public/icons/lucide/list-indent-decrease.js +27 -0
- package/dist/ui-public/icons/lucide/list-indent-increase.js +27 -0
- package/dist/ui-public/icons/lucide/list-ordered.js +29 -0
- package/dist/ui-public/icons/lucide/list-tree.js +28 -0
- package/dist/ui-public/icons/lucide/list.js +29 -0
- package/dist/ui-public/icons/lucide/log-out.js +26 -0
- package/dist/ui-public/icons/lucide/mail.js +28 -0
- package/dist/ui-public/icons/lucide/map-pin.js +26 -0
- package/dist/ui-public/icons/lucide/map-pinned.js +30 -0
- package/dist/ui-public/icons/lucide/maximize.js +27 -0
- package/dist/ui-public/icons/lucide/menu.js +26 -0
- package/dist/ui-public/icons/lucide/messages-square.js +22 -0
- package/dist/ui-public/icons/lucide/minimize.js +27 -0
- package/dist/ui-public/icons/lucide/minus.js +22 -0
- package/dist/ui-public/icons/lucide/notepad-text.js +36 -0
- package/dist/ui-public/icons/lucide/octagon-exclamation-point.js +26 -0
- package/dist/ui-public/icons/lucide/palette.js +48 -0
- package/dist/ui-public/icons/lucide/panel-left.js +28 -0
- package/dist/ui-public/icons/lucide/panel-right.js +28 -0
- package/dist/ui-public/icons/lucide/pause.js +34 -0
- package/dist/ui-public/icons/lucide/pen.js +22 -0
- package/dist/ui-public/icons/lucide/pilcrow.js +26 -0
- package/dist/ui-public/icons/lucide/pipette.js +26 -0
- package/dist/ui-public/icons/lucide/play.js +22 -0
- package/dist/ui-public/icons/lucide/plus.js +22 -0
- package/dist/ui-public/icons/lucide/quote.js +22 -0
- package/dist/ui-public/icons/lucide/redo-2.js +22 -0
- package/dist/ui-public/icons/lucide/refresh-cw.js +27 -0
- package/dist/ui-public/icons/lucide/rotate-ccw-clock.js +26 -0
- package/dist/ui-public/icons/lucide/rotate-ccw.js +22 -0
- package/dist/ui-public/icons/lucide/rows-3.js +32 -0
- package/dist/ui-public/icons/lucide/search.js +26 -0
- package/dist/ui-public/icons/lucide/send.js +22 -0
- package/dist/ui-public/icons/lucide/settings-2.js +35 -0
- package/dist/ui-public/icons/lucide/settings.js +26 -0
- package/dist/ui-public/icons/lucide/sliders-horizontal.js +32 -0
- package/dist/ui-public/icons/lucide/smartphone.js +29 -0
- package/dist/ui-public/icons/lucide/square-arrow-left.js +32 -0
- package/dist/ui-public/icons/lucide/square-arrow-up-right.js +32 -0
- package/dist/ui-public/icons/lucide/square-code.js +32 -0
- package/dist/ui-public/icons/lucide/square-dashed.js +35 -0
- package/dist/ui-public/icons/lucide/square-pen.js +22 -0
- package/dist/ui-public/icons/lucide/square-plus.js +32 -0
- package/dist/ui-public/icons/lucide/square-terminal.js +33 -0
- package/dist/ui-public/icons/lucide/store.js +26 -0
- package/dist/ui-public/icons/lucide/strikethrough.js +31 -0
- package/dist/ui-public/icons/lucide/table.js +33 -0
- package/dist/ui-public/icons/lucide/tag.js +27 -0
- package/dist/ui-public/icons/lucide/text-align-center.js +26 -0
- package/dist/ui-public/icons/lucide/text-align-end.js +26 -0
- package/dist/ui-public/icons/lucide/text-align-justify.js +26 -0
- package/dist/ui-public/icons/lucide/text-align-start.js +26 -0
- package/dist/ui-public/icons/lucide/toggle-right.js +32 -0
- package/dist/ui-public/icons/lucide/toolbox.js +28 -0
- package/dist/ui-public/icons/lucide/trash.js +28 -0
- package/dist/ui-public/icons/lucide/triangle-exclamation-point.js +26 -0
- package/dist/ui-public/icons/lucide/underline.js +27 -0
- package/dist/ui-public/icons/lucide/undo-2.js +22 -0
- package/dist/ui-public/icons/lucide/unfold-vertical.js +31 -0
- package/dist/ui-public/icons/lucide/user-lock.js +37 -0
- package/dist/ui-public/icons/lucide/user-minus.js +35 -0
- package/dist/ui-public/icons/lucide/user-round-arrow-left.js +31 -0
- package/dist/ui-public/icons/lucide/user.js +26 -0
- package/dist/ui-public/icons/lucide/x.js +22 -0
- package/dist/ui-public/locales/en.js +76 -5
- package/dist/ui-public/src/Message.d.ts +3 -4
- package/dist/ui-public/src/UiTextKey.d.ts +1 -1
- package/dist/ui-public/src/actions/Actions/ActionTooltip.js +1 -1
- package/dist/ui-public/src/actions/Actions/registry.d.ts +2 -2
- package/dist/ui-public/src/actions/Actions/registry.js +2 -2
- package/dist/ui-public/src/actions/Button.d.ts +16 -11
- package/dist/ui-public/src/actions/Button.js +7 -1
- package/dist/ui-public/src/actions/Dropdown/Menu.d.ts +2 -2
- package/dist/ui-public/src/actions/Dropdown/Option.d.ts +7 -7
- package/dist/ui-public/src/actions/Dropdown/index.d.ts +1 -1
- package/dist/ui-public/src/actions/Dropdown/triggers/ButtonTrigger.d.ts +5 -5
- package/dist/ui-public/src/actions/Dropdown/triggers/DropdownTriggerButton.d.ts +2 -2
- package/dist/ui-public/src/actions/Dropdown/triggers/IconTrigger.d.ts +6 -6
- package/dist/ui-public/src/actions/Dropdown/triggers/IconTrigger.js +1 -1
- package/dist/ui-public/src/actions/EditorToolbar/Button.d.ts +1 -1
- package/dist/ui-public/src/actions/MultipleSelectionActionBar.d.ts +1 -1
- package/dist/ui-public/src/actions/SplitButton/Caret.js +2 -2
- package/dist/ui-public/src/actions/SplitButton/Halves.js +1 -1
- package/dist/ui-public/src/actions/SplitButton/index.d.ts +3 -3
- package/dist/ui-public/src/actions/disabledReason.d.ts +4 -4
- package/dist/ui-public/src/actions/disabledReason.js +1 -1
- package/dist/ui-public/src/content/Avatar.d.ts +3 -3
- package/dist/ui-public/src/content/Avatar.js +2 -2
- package/dist/ui-public/src/content/CodeSnippet.d.ts +1 -1
- package/dist/ui-public/src/content/CopyableValue.d.ts +1 -1
- package/dist/ui-public/src/content/EnvironmentPill.d.ts +1 -1
- package/dist/ui-public/src/content/EnvironmentPill.js +1 -1
- package/dist/ui-public/src/content/FieldTypeAvatar.d.ts +22 -0
- package/dist/ui-public/src/content/FieldTypeAvatar.js +35 -0
- package/dist/ui-public/src/content/FieldTypeName.d.ts +19 -0
- package/dist/ui-public/src/content/FieldTypeName.js +25 -0
- package/dist/ui-public/src/content/IconAvatar.d.ts +3 -2
- package/dist/ui-public/src/content/ItemStatus.d.ts +1 -1
- package/dist/ui-public/src/content/Pill.d.ts +1 -1
- package/dist/ui-public/src/content/SmartDate.d.ts +1 -1
- package/dist/ui-public/src/content/UploadPreview/asset.js +200 -0
- package/dist/ui-public/src/content/UploadPreview/audio.js +120 -0
- package/dist/ui-public/src/content/{UploadPreview.d.ts → UploadPreview/box.d.ts} +10 -10
- package/dist/ui-public/src/content/{UploadPreview.js → UploadPreview/box.js} +7 -7
- package/dist/ui-public/src/content/{uploadPreviewFit.d.ts → UploadPreview/fit.d.ts} +2 -2
- package/dist/ui-public/src/content/{uploadPreviewFit.js → UploadPreview/fit.js} +3 -3
- package/dist/ui-public/src/content/UploadPreview/index.d.ts +61 -0
- package/dist/ui-public/src/content/UploadPreview/index.js +36 -0
- package/dist/ui-public/src/content/UploadPreview/presentation.js +63 -0
- package/dist/ui-public/src/content/UploadPreview/thumbhash.js +91 -0
- package/dist/ui-public/src/content/UploadPreview/upload.d.ts +104 -0
- package/dist/ui-public/src/content/UploadPreview/upload.js +112 -0
- package/dist/ui-public/src/content/UploadThreatTriangle.js +1 -1
- package/dist/ui-public/src/content/UsageMeter.d.ts +1 -1
- package/dist/ui-public/src/content/ValidityTriangles.d.ts +1 -1
- package/dist/ui-public/src/content/ValidityTriangles.js +1 -1
- package/dist/ui-public/src/feedback/BlankSlate.d.ts +5 -5
- package/dist/ui-public/src/feedback/Callout.d.ts +5 -5
- package/dist/ui-public/src/feedback/Callout.js +1 -1
- package/dist/ui-public/src/feedback/ProgressBar.d.ts +4 -4
- package/dist/ui-public/src/feedback/Spinner.d.ts +6 -6
- package/dist/ui-public/src/feedback/Spinner.js +1 -1
- package/dist/ui-public/src/form/DateInput.d.ts +13 -0
- package/dist/ui-public/src/form/DateInput.js +16 -0
- package/dist/ui-public/src/form/DateTimeInput/Base.d.ts +89 -0
- package/dist/ui-public/src/form/DateTimeInput/Base.js +330 -0
- package/dist/ui-public/src/form/DateTimeInput/CalendarGrid.d.ts +29 -0
- package/dist/ui-public/src/form/DateTimeInput/CalendarGrid.js +195 -0
- package/dist/ui-public/src/form/DateTimeInput/dateText.js +38 -0
- package/dist/ui-public/src/form/DateTimeInput/index.d.ts +10 -0
- package/dist/ui-public/src/form/DateTimeInput/index.js +18 -0
- package/dist/ui-public/src/form/DateTimeInput/value.js +31 -0
- package/dist/ui-public/src/form/DateTimeRangeInput/Panel.js +167 -0
- package/dist/ui-public/src/form/DateTimeRangeInput/index.d.ts +123 -0
- package/dist/ui-public/src/form/DateTimeRangeInput/index.js +186 -0
- package/dist/ui-public/src/form/DateTimeRangeInput/rangeLabel.js +46 -0
- package/dist/ui-public/src/form/FieldHint.d.ts +2 -2
- package/dist/ui-public/src/form/FieldWrapper.d.ts +9 -9
- package/dist/ui-public/src/form/FieldWrapper.js +3 -3
- package/dist/ui-public/src/form/FilterBuilder/Editor.js +123 -0
- package/dist/ui-public/src/form/FilterBuilder/index.d.ts +9 -0
- package/dist/ui-public/src/form/FilterBuilder/index.js +294 -0
- package/dist/ui-public/src/form/FilterBuilder/types.d.ts +188 -0
- package/dist/ui-public/src/form/FilterBuilder/values.js +86 -0
- package/dist/ui-public/src/form/InputGroup.d.ts +2 -2
- package/dist/ui-public/src/form/InputGroup.js +1 -1
- package/dist/ui-public/src/form/KeyValueList.d.ts +1 -1
- package/dist/ui-public/src/form/Label.d.ts +2 -2
- package/dist/ui-public/src/form/PasswordInput.js +1 -9
- package/dist/ui-public/src/form/RadioGroupInput.d.ts +2 -2
- package/dist/ui-public/src/form/RadioGroupInput.js +1 -1
- package/dist/ui-public/src/form/SelectInput/SelectMenu.d.ts +2 -2
- package/dist/ui-public/src/form/SelectInput/index.d.ts +3 -3
- package/dist/ui-public/src/form/SwitchInput.d.ts +2 -2
- package/dist/ui-public/src/form/SwitchList.d.ts +1 -1
- package/dist/ui-public/src/form/SwitchList.js +1 -1
- package/dist/ui-public/src/form/TableList.d.ts +2 -2
- package/dist/ui-public/src/form/TextareaInput.js +1 -1
- package/dist/ui-public/src/form/inputProps.d.ts +6 -6
- package/dist/ui-public/src/hooks/useAsyncSelectOptions.d.ts +1 -1
- package/dist/ui-public/src/hooks/useSmartRowClick.d.ts +1 -1
- package/dist/ui-public/src/hooks/useSmartRowClick.js +1 -1
- package/dist/ui-public/src/layout/Page/PageGroup.d.ts +2 -2
- package/dist/ui-public/src/layout/Page/PageGroup.js +1 -1
- package/dist/ui-public/src/layout/Pane/FormHeader.d.ts +1 -1
- package/dist/ui-public/src/layout/Pane/FormHeader.js +1 -1
- package/dist/ui-public/src/layout/Pane/ListFilter.d.ts +1 -1
- package/dist/ui-public/src/layout/Pane/ListPresets.d.ts +1 -1
- package/dist/ui-public/src/layout/Pane/PaneHeader.d.ts +1 -1
- package/dist/ui-public/src/layout/Pane/index.d.ts +8 -8
- package/dist/ui-public/src/layout/Pane/index.js +17 -8
- package/dist/ui-public/src/layout/SidebarPanel.d.ts +1 -1
- package/dist/ui-public/src/layout/SplitPane/Rail.js +1 -1
- package/dist/ui-public/src/layout/SplitPane/index.d.ts +6 -6
- package/dist/ui-public/src/layout/SplitPane/index.js +16 -2
- package/dist/ui-public/src/layout/Toolbar/AddNewButton.d.ts +2 -2
- package/dist/ui-public/src/layout/Toolbar/FilterToggle.d.ts +1 -1
- package/dist/ui-public/src/layout/Toolbar/FilterToggle.js +12 -4
- package/dist/ui-public/src/layout/Toolbar/Help.d.ts +3 -3
- package/dist/ui-public/src/layout/Toolbar/Help.js +2 -2
- package/dist/ui-public/src/layout/Toolbar/Note.d.ts +1 -1
- package/dist/ui-public/src/layout/Toolbar/Note.js +1 -1
- package/dist/ui-public/src/layout/Toolbar/Pagination.d.ts +1 -1
- package/dist/ui-public/src/layout/Toolbar/Pagination.js +1 -1
- package/dist/ui-public/src/layout/Toolbar/PresetsTitle.d.ts +3 -3
- package/dist/ui-public/src/layout/Toolbar/PresetsTitle.js +2 -2
- package/dist/ui-public/src/layout/Toolbar/PrimaryButton.d.ts +3 -3
- package/dist/ui-public/src/layout/Toolbar/Root.d.ts +1 -1
- package/dist/ui-public/src/layout/Toolbar/Root.js +4 -1
- package/dist/ui-public/src/layout/Toolbar/ToolbarTitleTrigger.js +1 -1
- package/dist/ui-public/src/lists/CardList.d.ts +3 -3
- package/dist/ui-public/src/lists/EmptySlot.d.ts +1 -1
- package/dist/ui-public/src/lists/InfoList/User.d.ts +1 -1
- package/dist/ui-public/src/lists/InfoList/Value.d.ts +1 -1
- package/dist/ui-public/src/lists/InfoList/Value.js +1 -1
- package/dist/ui-public/src/lists/InfoList/index.d.ts +3 -3
- package/dist/ui-public/src/lists/InfoList/index.js +1 -1
- package/dist/ui-public/src/lists/MediaCard.d.ts +7 -7
- package/dist/ui-public/src/lists/RecordRow/Image.d.ts +24 -0
- package/dist/ui-public/src/lists/RecordRow/Image.js +22 -0
- package/dist/ui-public/src/lists/RecordRow/List.d.ts +26 -0
- package/dist/ui-public/src/lists/RecordRow/List.js +30 -0
- package/dist/ui-public/src/lists/RecordRow/context.js +31 -0
- package/dist/ui-public/src/lists/RecordRow/index.d.ts +94 -0
- package/dist/ui-public/src/lists/RecordRow/index.js +122 -0
- package/dist/ui-public/src/lists/RecordRow/presentation.js +73 -0
- package/dist/ui-public/src/lists/RecordRow/types.d.ts +58 -0
- package/dist/ui-public/src/lists/RowList.d.ts +5 -5
- package/dist/ui-public/src/lists/SettingsList.d.ts +3 -3
- package/dist/ui-public/src/lists/SettingsList.js +2 -2
- package/dist/ui-public/src/lists/Table/Row.d.ts +5 -5
- package/dist/ui-public/src/lists/Table/Table.d.ts +3 -3
- package/dist/ui-public/src/lists/Table/TreeToggle.d.ts +2 -2
- package/dist/ui-public/src/lists/Table/TreeToggle.js +5 -4
- package/dist/ui-public/src/lists/Table/cells/LinkCell.d.ts +1 -1
- package/dist/ui-public/src/lists/TreeRow/Action.d.ts +1 -1
- package/dist/ui-public/src/lists/TreeRow/Action.js +1 -1
- package/dist/ui-public/src/lists/TreeRow/Link.d.ts +1 -1
- package/dist/ui-public/src/lists/TreeRow/Link.js +1 -1
- package/dist/ui-public/src/lists/UploadCard.d.ts +66 -3
- package/dist/ui-public/src/lists/UploadCard.js +116 -7
- package/dist/ui-public/src/lists/UserRow.d.ts +122 -0
- package/dist/ui-public/src/lists/UserRow.js +104 -0
- package/dist/ui-public/src/lists/dnd/DragHandle.d.ts +2 -2
- package/dist/ui-public/src/lists/dnd/SortableList.d.ts +1 -1
- package/dist/ui-public/src/lists/dnd/dropTargetClassName.d.ts +1 -1
- package/dist/ui-public/src/lists/dnd/tree/SortableTree.d.ts +2 -2
- package/dist/ui-public/src/navigation/Chevron.d.ts +4 -4
- package/dist/ui-public/src/navigation/Chevron.js +1 -1
- package/dist/ui-public/src/navigation/Link.d.ts +5 -5
- package/dist/ui-public/src/navigation/Link.js +1 -1
- package/dist/ui-public/src/navigation/NavList.d.ts +1 -1
- package/dist/ui-public/src/navigation/NavList.js +1 -1
- package/dist/ui-public/src/navigation/NavigationProvider.d.ts +1 -1
- package/dist/ui-public/src/navigation/SegmentedControl.d.ts +2 -2
- package/dist/ui-public/src/navigation/SettingsMenu.d.ts +8 -8
- package/dist/ui-public/src/navigation/SettingsMenu.js +1 -1
- package/dist/ui-public/src/navigation/SidebarTree/SidebarTreeNode.d.ts +4 -4
- package/dist/ui-public/src/navigation/SidebarTree/SidebarTreeNodeActions.d.ts +3 -0
- package/dist/ui-public/src/navigation/SidebarTree/SidebarTreeNodeActions.js +2 -1
- package/dist/ui-public/src/overlays/FullscreenModal/TitleContext.d.ts +1 -1
- package/dist/ui-public/src/overlays/FullscreenModal/TitleContext.js +1 -1
- package/dist/ui-public/src/overlays/HoverCard/index.js +1 -1
- package/dist/ui-public/src/overlays/NewZIndex.d.ts +1 -1
- package/dist/ui-public/src/overlays/NewZIndex.js +1 -1
- package/dist/ui-public/src/overlays/Popover.d.ts +1 -1
- package/dist/ui-public/src/overlays/PortalWrapper.js +1 -1
- package/dist/ui-public/src/overlays/useModalClose.js +3 -3
- package/dist/ui-public/src/patterns/ListDetail/FloatingDetail.js +71 -0
- package/dist/ui-public/src/patterns/ListDetail/Overview.js +2 -2
- package/dist/ui-public/src/patterns/ListDetail/Page.d.ts +8 -9
- package/dist/ui-public/src/patterns/ListDetail/Page.js +12 -9
- package/dist/ui-public/src/patterns/ListDetail/Panel.d.ts +2 -2
- package/dist/ui-public/src/patterns/ListDetail/Panel.js +12 -11
- package/dist/ui-public/src/patterns/ListDetail/Split.d.ts +25 -11
- package/dist/ui-public/src/patterns/ListDetail/Split.js +99 -115
- package/dist/ui-public/src/patterns/ListDetail/index.d.ts +4 -3
- package/dist/ui-public/src/patterns/ListDetail/useDetailWidthDrag.js +43 -0
- package/dist/ui-public/src/patterns/ListFormPage.d.ts +3 -3
- package/dist/ui-public/src/patterns/ListFormPage.js +1 -1
- package/dist/ui-public/src/semantic/Heading.d.ts +1 -1
- package/dist/ui-public/src/semantic/Heading.js +1 -1
- package/dist/ui-public/src/semantic/Image.js +1 -1
- package/dist/ui-public/src/semantic/Nav.d.ts +3 -3
- package/dist/ui-public/src/semantic/Nav.js +3 -3
- package/dist/ui-public/src/semantic/RawButton.d.ts +3 -3
- package/dist/ui-public/src/semantic/RawButton.js +1 -1
- package/dist/ui-public/src/semantic/Search.d.ts +1 -1
- package/dist/ui-public/src/semantic/Search.js +1 -1
- package/dist/ui-public/src/utils/fieldTypes.d.ts +29 -0
- package/dist/ui-public/src/utils/fieldTypes.js +94 -0
- package/dist/ui-public/src/utils/format.d.ts +21 -0
- package/dist/ui-public/src/utils/format.js +20 -0
- package/dist/ui-public/src/utils/formatDate.d.ts +10 -2
- package/dist/ui-public/src/utils/formatDate.js +4 -4
- package/dist/ui-public/src/utils/tickBatcher.js +44 -0
- package/dist/ui-public/src/utils/timezones.js +277 -0
- package/dist/ui-public/src/utils/weekStartForLocale.js +25 -0
- package/dist/utils/fieldTypes.d.ts +1 -0
- package/dist/utils/fieldTypes.js +2 -0
- package/dist/utils/format.d.ts +1 -0
- package/dist/utils/format.js +2 -0
- package/package.json +3 -3
- package/dist/ui-public/icons/brands/gitlab.js +0 -15
- package/dist/ui-public/icons/brands/markdown.js +0 -15
- package/dist/ui-public/icons/custom/fieldgroup-boolean.js +0 -18
- package/dist/ui-public/icons/custom/fieldgroup-color.js +0 -18
- package/dist/ui-public/icons/custom/fieldgroup-datetime.js +0 -49
- package/dist/ui-public/icons/custom/fieldgroup-json.js +0 -18
- package/dist/ui-public/icons/custom/fieldgroup-location.js +0 -19
- package/dist/ui-public/icons/custom/fieldgroup-media.js +0 -18
- package/dist/ui-public/icons/custom/fieldgroup-number.js +0 -18
- package/dist/ui-public/icons/custom/fieldgroup-reference.js +0 -18
- package/dist/ui-public/icons/custom/fieldgroup-rich_text.js +0 -18
- package/dist/ui-public/icons/custom/fieldgroup-seo.js +0 -22
- package/dist/ui-public/icons/custom/fieldgroup-structured_text.js +0 -61
- package/dist/ui-public/icons/custom/language.js +0 -16
- package/dist/ui-public/icons/custom/masonry.js +0 -21
- package/dist/ui-public/icons/light/eye-slash.js +0 -16
- package/dist/ui-public/icons/light/eye.js +0 -16
- package/dist/ui-public/icons/regular/align-left.js +0 -15
- package/dist/ui-public/icons/regular/arrow-down-a-z.js +0 -16
- package/dist/ui-public/icons/regular/arrow-down-from-line.js +0 -16
- package/dist/ui-public/icons/regular/arrow-down-to-line.js +0 -15
- package/dist/ui-public/icons/regular/arrow-down.js +0 -16
- package/dist/ui-public/icons/regular/arrow-left.js +0 -16
- package/dist/ui-public/icons/regular/arrow-right-arrow-left.js +0 -16
- package/dist/ui-public/icons/regular/arrow-right-from-bracket.js +0 -16
- package/dist/ui-public/icons/regular/arrow-right.js +0 -16
- package/dist/ui-public/icons/regular/arrow-rotate-left.js +0 -15
- package/dist/ui-public/icons/regular/arrow-rotate-right.js +0 -16
- package/dist/ui-public/icons/regular/arrow-turn-up.js +0 -16
- package/dist/ui-public/icons/regular/arrow-up-arrow-down.js +0 -16
- package/dist/ui-public/icons/regular/arrow-up-from-line.js +0 -16
- package/dist/ui-public/icons/regular/arrow-up-right-from-square.js +0 -16
- package/dist/ui-public/icons/regular/arrow-up-to-line.js +0 -15
- package/dist/ui-public/icons/regular/arrow-up.js +0 -16
- package/dist/ui-public/icons/regular/arrows-from-line.js +0 -16
- package/dist/ui-public/icons/regular/arrows-rotate.js +0 -16
- package/dist/ui-public/icons/regular/arrows-to-line.js +0 -16
- package/dist/ui-public/icons/regular/arrows-turn-to-dots.js +0 -15
- package/dist/ui-public/icons/regular/badge-check.js +0 -15
- package/dist/ui-public/icons/regular/ballot-check.js +0 -15
- package/dist/ui-public/icons/regular/ban.js +0 -16
- package/dist/ui-public/icons/regular/bars.js +0 -16
- package/dist/ui-public/icons/regular/bold.js +0 -15
- package/dist/ui-public/icons/regular/bolt.js +0 -15
- package/dist/ui-public/icons/regular/book.js +0 -16
- package/dist/ui-public/icons/regular/bookmark.js +0 -16
- package/dist/ui-public/icons/regular/brackets-curly.js +0 -15
- package/dist/ui-public/icons/regular/browser.js +0 -16
- package/dist/ui-public/icons/regular/calendar-clock.js +0 -15
- package/dist/ui-public/icons/regular/calendar.js +0 -16
- package/dist/ui-public/icons/regular/chart-area.js +0 -15
- package/dist/ui-public/icons/regular/chevrons-down.js +0 -16
- package/dist/ui-public/icons/regular/chevrons-left.js +0 -16
- package/dist/ui-public/icons/regular/chevrons-right.js +0 -16
- package/dist/ui-public/icons/regular/circle-arrow-up.js +0 -16
- package/dist/ui-public/icons/regular/circle-check.js +0 -16
- package/dist/ui-public/icons/regular/circle-dot.js +0 -16
- package/dist/ui-public/icons/regular/circle-exclamation.js +0 -16
- package/dist/ui-public/icons/regular/circle-info.js +0 -16
- package/dist/ui-public/icons/regular/circle-question.js +0 -16
- package/dist/ui-public/icons/regular/clapperboard-play.js +0 -15
- package/dist/ui-public/icons/regular/clipboard.js +0 -15
- package/dist/ui-public/icons/regular/clock-rotate-left.js +0 -16
- package/dist/ui-public/icons/regular/clock.js +0 -16
- package/dist/ui-public/icons/regular/clone.js +0 -16
- package/dist/ui-public/icons/regular/cloud-arrow-down.js +0 -15
- package/dist/ui-public/icons/regular/code-branch.js +0 -16
- package/dist/ui-public/icons/regular/code-fork.js +0 -16
- package/dist/ui-public/icons/regular/command.js +0 -16
- package/dist/ui-public/icons/regular/comments.js +0 -16
- package/dist/ui-public/icons/regular/copy.js +0 -16
- package/dist/ui-public/icons/regular/cube.js +0 -15
- package/dist/ui-public/icons/regular/cubes.js +0 -15
- package/dist/ui-public/icons/regular/dash.js +0 -16
- package/dist/ui-public/icons/regular/database.js +0 -16
- package/dist/ui-public/icons/regular/diamond.js +0 -15
- package/dist/ui-public/icons/regular/down.js +0 -16
- package/dist/ui-public/icons/regular/download.js +0 -16
- package/dist/ui-public/icons/regular/earth-europe.js +0 -16
- package/dist/ui-public/icons/regular/ellipsis-vertical.js +0 -16
- package/dist/ui-public/icons/regular/ellipsis.js +0 -16
- package/dist/ui-public/icons/regular/envelope.js +0 -16
- package/dist/ui-public/icons/regular/expand.js +0 -16
- package/dist/ui-public/icons/regular/eye-dropper.js +0 -16
- package/dist/ui-public/icons/regular/eye.js +0 -16
- package/dist/ui-public/icons/regular/file-export.js +0 -16
- package/dist/ui-public/icons/regular/file-lines.js +0 -15
- package/dist/ui-public/icons/regular/file-shield.js +0 -15
- package/dist/ui-public/icons/regular/file.js +0 -15
- package/dist/ui-public/icons/regular/filter.js +0 -16
- package/dist/ui-public/icons/regular/fire-flame-curved.js +0 -15
- package/dist/ui-public/icons/regular/flask-gear.js +0 -16
- package/dist/ui-public/icons/regular/flask.js +0 -16
- package/dist/ui-public/icons/regular/folder-gear.js +0 -15
- package/dist/ui-public/icons/regular/folder-magnifying-glass.js +0 -15
- package/dist/ui-public/icons/regular/folder-open.js +0 -16
- package/dist/ui-public/icons/regular/folder-plus.js +0 -16
- package/dist/ui-public/icons/regular/folder.js +0 -16
- package/dist/ui-public/icons/regular/folders.js +0 -16
- package/dist/ui-public/icons/regular/gear.js +0 -16
- package/dist/ui-public/icons/regular/gift.js +0 -16
- package/dist/ui-public/icons/regular/globe.js +0 -16
- package/dist/ui-public/icons/regular/grid-2.js +0 -16
- package/dist/ui-public/icons/regular/grip-dots-vertical.js +0 -16
- package/dist/ui-public/icons/regular/hand.js +0 -16
- package/dist/ui-public/icons/regular/hourglass-clock.js +0 -16
- package/dist/ui-public/icons/regular/house.js +0 -16
- package/dist/ui-public/icons/regular/images.js +0 -16
- package/dist/ui-public/icons/regular/input-numeric.js +0 -15
- package/dist/ui-public/icons/regular/input-text.js +0 -15
- package/dist/ui-public/icons/regular/keyboard.js +0 -16
- package/dist/ui-public/icons/regular/layer-group.js +0 -16
- package/dist/ui-public/icons/regular/life-ring.js +0 -16
- package/dist/ui-public/icons/regular/link-simple.js +0 -15
- package/dist/ui-public/icons/regular/link.js +0 -16
- package/dist/ui-public/icons/regular/list-tree.js +0 -16
- package/dist/ui-public/icons/regular/list.js +0 -16
- package/dist/ui-public/icons/regular/magnifying-glass-chart.js +0 -15
- package/dist/ui-public/icons/regular/magnifying-glass.js +0 -16
- package/dist/ui-public/icons/regular/map-location-dot.js +0 -16
- package/dist/ui-public/icons/regular/memo.js +0 -16
- package/dist/ui-public/icons/regular/mobile-screen-button.js +0 -16
- package/dist/ui-public/icons/regular/octagon-exclamation.js +0 -16
- package/dist/ui-public/icons/regular/palette.js +0 -16
- package/dist/ui-public/icons/regular/paper-plane.js +0 -16
- package/dist/ui-public/icons/regular/paragraph.js +0 -15
- package/dist/ui-public/icons/regular/paste.js +0 -15
- package/dist/ui-public/icons/regular/pause.js +0 -16
- package/dist/ui-public/icons/regular/pen-paintbrush.js +0 -15
- package/dist/ui-public/icons/regular/pen-to-square.js +0 -16
- package/dist/ui-public/icons/regular/pen.js +0 -16
- package/dist/ui-public/icons/regular/people-arrows.js +0 -16
- package/dist/ui-public/icons/regular/photo-film.js +0 -15
- package/dist/ui-public/icons/regular/play.js +0 -16
- package/dist/ui-public/icons/regular/puzzle-piece.js +0 -15
- package/dist/ui-public/icons/regular/receipt.js +0 -16
- package/dist/ui-public/icons/regular/rectangle-barcode.js +0 -15
- package/dist/ui-public/icons/regular/rectangle-list.js +0 -15
- package/dist/ui-public/icons/regular/right-left.js +0 -15
- package/dist/ui-public/icons/regular/rotate-left.js +0 -16
- package/dist/ui-public/icons/regular/shield.js +0 -15
- package/dist/ui-public/icons/regular/sidebar-flip.js +0 -16
- package/dist/ui-public/icons/regular/sidebar.js +0 -16
- package/dist/ui-public/icons/regular/sliders.js +0 -16
- package/dist/ui-public/icons/regular/sparkles.js +0 -15
- package/dist/ui-public/icons/regular/square-caret-down.js +0 -15
- package/dist/ui-public/icons/regular/square-check.js +0 -15
- package/dist/ui-public/icons/regular/square-dashed.js +0 -15
- package/dist/ui-public/icons/regular/square-left.js +0 -16
- package/dist/ui-public/icons/regular/square-terminal.js +0 -16
- package/dist/ui-public/icons/regular/square-up-right.js +0 -16
- package/dist/ui-public/icons/regular/store.js +0 -16
- package/dist/ui-public/icons/regular/swap-arrows.js +0 -15
- package/dist/ui-public/icons/regular/table.js +0 -16
- package/dist/ui-public/icons/regular/tag.js +0 -16
- package/dist/ui-public/icons/regular/toggle-on.js +0 -15
- package/dist/ui-public/icons/regular/toolbox.js +0 -16
- package/dist/ui-public/icons/regular/trash-undo.js +0 -15
- package/dist/ui-public/icons/regular/trash.js +0 -16
- package/dist/ui-public/icons/regular/triangle-exclamation.js +0 -16
- package/dist/ui-public/icons/regular/turn-up.js +0 -16
- package/dist/ui-public/icons/regular/user-group.js +0 -15
- package/dist/ui-public/icons/regular/user-helmet-safety.js +0 -16
- package/dist/ui-public/icons/regular/user-lock.js +0 -16
- package/dist/ui-public/icons/regular/user-minus.js +0 -16
- package/dist/ui-public/icons/regular/user-tie.js +0 -15
- package/dist/ui-public/icons/regular/user.js +0 -16
- package/dist/ui-public/icons/regular/users.js +0 -15
- package/dist/ui-public/icons/regular/video.js +0 -15
- package/dist/ui-public/icons/regular/webhook.js +0 -15
- package/dist/ui-public/icons/regular/wrench.js +0 -15
- package/dist/ui-public/icons/regular/xmark.js +0 -16
- package/dist/ui-public/icons/solid/align-center.js +0 -16
- package/dist/ui-public/icons/solid/align-justify.js +0 -16
- package/dist/ui-public/icons/solid/align-left.js +0 -16
- package/dist/ui-public/icons/solid/align-right.js +0 -16
- package/dist/ui-public/icons/solid/arrow-rotate-left.js +0 -16
- package/dist/ui-public/icons/solid/arrow-rotate-right.js +0 -16
- package/dist/ui-public/icons/solid/bold.js +0 -16
- package/dist/ui-public/icons/solid/circle-exclamation.js +0 -16
- package/dist/ui-public/icons/solid/closed-captioning.js +0 -15
- package/dist/ui-public/icons/solid/code.js +0 -16
- package/dist/ui-public/icons/solid/compress.js +0 -16
- package/dist/ui-public/icons/solid/download.js +0 -15
- package/dist/ui-public/icons/solid/expand.js +0 -16
- package/dist/ui-public/icons/solid/file-arrow-down.js +0 -15
- package/dist/ui-public/icons/solid/file-code.js +0 -16
- package/dist/ui-public/icons/solid/grid-2.js +0 -16
- package/dist/ui-public/icons/solid/h1.js +0 -16
- package/dist/ui-public/icons/solid/h2.js +0 -16
- package/dist/ui-public/icons/solid/h3.js +0 -16
- package/dist/ui-public/icons/solid/h4.js +0 -16
- package/dist/ui-public/icons/solid/h5.js +0 -16
- package/dist/ui-public/icons/solid/h6.js +0 -16
- package/dist/ui-public/icons/solid/highlighter.js +0 -16
- package/dist/ui-public/icons/solid/horizontal-rule.js +0 -16
- package/dist/ui-public/icons/solid/image.js +0 -16
- package/dist/ui-public/icons/solid/indent.js +0 -16
- package/dist/ui-public/icons/solid/italic.js +0 -16
- package/dist/ui-public/icons/solid/link.js +0 -16
- package/dist/ui-public/icons/solid/list-ol.js +0 -16
- package/dist/ui-public/icons/solid/list-ul.js +0 -16
- package/dist/ui-public/icons/solid/location-dot.js +0 -16
- package/dist/ui-public/icons/solid/music.js +0 -15
- package/dist/ui-public/icons/solid/outdent.js +0 -16
- package/dist/ui-public/icons/solid/paragraph.js +0 -16
- package/dist/ui-public/icons/solid/plus.js +0 -16
- package/dist/ui-public/icons/solid/quote-right.js +0 -16
- package/dist/ui-public/icons/solid/rectangle-code.js +0 -16
- package/dist/ui-public/icons/solid/square-plus.js +0 -16
- package/dist/ui-public/icons/solid/strikethrough.js +0 -16
- package/dist/ui-public/icons/solid/subtitles.js +0 -15
- package/dist/ui-public/icons/solid/table.js +0 -16
- package/dist/ui-public/icons/solid/triangle-exclamation.js +0 -16
- package/dist/ui-public/icons/solid/underline.js +0 -16
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
//#region ../ui-public/src/form/FilterBuilder/values.ts
|
|
2
|
+
/**
|
|
3
|
+
* The value of a new condition, and the value after a change of operator
|
|
4
|
+
* that cannot keep the old value
|
|
5
|
+
*/
|
|
6
|
+
function defaultValueOf(editor) {
|
|
7
|
+
switch (editor.type) {
|
|
8
|
+
case "none":
|
|
9
|
+
case "number": return null;
|
|
10
|
+
case "text": return "";
|
|
11
|
+
case "list": return [];
|
|
12
|
+
case "select": return editor.defaultValue ?? (editor.multiple ? [] : null);
|
|
13
|
+
case "group": return Object.fromEntries(editor.arguments.map((argument) => [argument.id, defaultValueOf(argument.editor)]));
|
|
14
|
+
case "custom": return editor.defaultValue;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function isEmpty(value) {
|
|
18
|
+
return value === void 0 || value === null || value === "";
|
|
19
|
+
}
|
|
20
|
+
function changeArity(value, wasMultiple, isMultiple, keep, fallback) {
|
|
21
|
+
if (wasMultiple && isMultiple) return Array.isArray(value) ? value.filter(keep) : fallback;
|
|
22
|
+
if (isMultiple) return isEmpty(value) || !keep(value) ? fallback : [value];
|
|
23
|
+
if (wasMultiple) {
|
|
24
|
+
const first = Array.isArray(value) ? value.find(keep) : void 0;
|
|
25
|
+
return first === void 0 ? fallback : first;
|
|
26
|
+
}
|
|
27
|
+
return isEmpty(value) || !keep(value) ? fallback : value;
|
|
28
|
+
}
|
|
29
|
+
function offeredBy(editor) {
|
|
30
|
+
return (candidate) => typeof candidate === "string" && editor.options.some((option) => option.value === candidate);
|
|
31
|
+
}
|
|
32
|
+
function anyValue() {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
function sameArguments(prev, next) {
|
|
36
|
+
return prev.arguments.length === next.arguments.length && next.arguments.every((argument) => prev.arguments.some((other) => other.id === argument.id));
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The value that a condition keeps when the user changes its operator. The
|
|
40
|
+
* operator changes how the field matches, not what it matches. Thus the
|
|
41
|
+
* value stays when the two editors take the same kind of value. When they do
|
|
42
|
+
* not, the value is the default value of the new editor.
|
|
43
|
+
*/
|
|
44
|
+
function carriedValue(prev, next, value) {
|
|
45
|
+
const fallback = defaultValueOf(next);
|
|
46
|
+
if (prev.type === "group" || next.type === "group") {
|
|
47
|
+
if (prev.type !== "group" || next.type !== "group") return fallback;
|
|
48
|
+
if (!sameArguments(prev, next)) return fallback;
|
|
49
|
+
const source = typeof value === "object" && value !== null ? value : {};
|
|
50
|
+
return Object.fromEntries(next.arguments.map((argument) => {
|
|
51
|
+
const prevArgument = prev.arguments.find((other) => other.id === argument.id);
|
|
52
|
+
return [argument.id, prevArgument ? carriedValue(prevArgument.editor, argument.editor, source[argument.id]) : defaultValueOf(argument.editor)];
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
if (prev.type === "select" && next.type === "select") return changeArity(value, Boolean(prev.multiple), Boolean(next.multiple), offeredBy(next), fallback);
|
|
56
|
+
if (prev.type === "custom" && next.type === "custom") {
|
|
57
|
+
if (prev.kind !== next.kind) return fallback;
|
|
58
|
+
return changeArity(value, Boolean(prev.multiple), Boolean(next.multiple), anyValue, fallback);
|
|
59
|
+
}
|
|
60
|
+
const textTypes = ["text", "list"];
|
|
61
|
+
if (textTypes.includes(prev.type) && textTypes.includes(next.type)) return changeArity(value, prev.type === "list", next.type === "list", (candidate) => typeof candidate === "string", fallback);
|
|
62
|
+
if (prev.type === "number" && next.type === "number") return typeof value === "number" ? value : fallback;
|
|
63
|
+
return fallback;
|
|
64
|
+
}
|
|
65
|
+
function conflicts(condition, field, operator, uniqueness) {
|
|
66
|
+
return condition.field === field && (uniqueness === "field" || condition.operator === operator);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The operators of a field that a new condition can take: not deprecated,
|
|
70
|
+
* and not used by one of the `others` conditions.
|
|
71
|
+
*/
|
|
72
|
+
function freeOperators(field, others, uniqueness) {
|
|
73
|
+
return field.operators.filter((operator) => !operator.deprecated && !others.some((other) => conflicts(other, field.id, operator.id, uniqueness)));
|
|
74
|
+
}
|
|
75
|
+
/** A new condition on a field, or `undefined` when the field is not free */
|
|
76
|
+
function newCondition(field, others, uniqueness) {
|
|
77
|
+
const [operator] = freeOperators(field, others, uniqueness);
|
|
78
|
+
if (!operator) return void 0;
|
|
79
|
+
return {
|
|
80
|
+
field: field.id,
|
|
81
|
+
operator: operator.id,
|
|
82
|
+
value: defaultValueOf(operator.editor)
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
export { carriedValue, defaultValueOf, freeOperators, newCondition };
|
|
@@ -4,7 +4,7 @@ import { StringInputProps } from './StringInput.js';
|
|
|
4
4
|
type DistributiveOmit<U, K extends PropertyKey> = U extends unknown ? Omit<U, K> : never;
|
|
5
5
|
/**
|
|
6
6
|
* The props of `InputGroup`: the props of `StringInput` and the addons. The
|
|
7
|
-
* package draws the box,
|
|
7
|
+
* package draws the box, so `InputGroup` takes no class. Put a class for
|
|
8
8
|
* the layout on the field (`container.className` of `FieldWrapper`).
|
|
9
9
|
*/
|
|
10
10
|
export type InputGroupProps = DistributiveOmit<StringInputProps, 'className'> & {
|
|
@@ -64,7 +64,7 @@ declare function Input({ ariaLabel, code, ...other }: InputGroupInputProps): Rea
|
|
|
64
64
|
/**
|
|
65
65
|
* A fixed text in an `InputGroup.Root`. A click on it does nothing, because
|
|
66
66
|
* the box can have more inputs. A screen reader does not read it: the names
|
|
67
|
-
* of the group and of the inputs
|
|
67
|
+
* of the group and of the inputs say the unit.
|
|
68
68
|
*/
|
|
69
69
|
declare function Addon({ children }: InputGroupAddonProps): React.JSX.Element;
|
|
70
70
|
declare function InputGroup({ pre, post, code, ...other }: InputGroupProps): React.JSX.Element;
|
|
@@ -39,7 +39,7 @@ function Input({ ariaLabel, code, ...other }) {
|
|
|
39
39
|
/**
|
|
40
40
|
* A fixed text in an `InputGroup.Root`. A click on it does nothing, because
|
|
41
41
|
* the box can have more inputs. A screen reader does not read it: the names
|
|
42
|
-
* of the group and of the inputs
|
|
42
|
+
* of the group and of the inputs say the unit.
|
|
43
43
|
*/
|
|
44
44
|
function Addon({ children }) {
|
|
45
45
|
return /* @__PURE__ */ jsx("span", {
|
|
@@ -36,7 +36,7 @@ export type KeyValueListTexts = {
|
|
|
36
36
|
};
|
|
37
37
|
/** The props of a `KeyValueList` that are not its value and its state. */
|
|
38
38
|
export type KeyValueListOptions = {
|
|
39
|
-
/** The texts of the list. Give a constant,
|
|
39
|
+
/** The texts of the list. Give a constant, so the columns stay the same. */
|
|
40
40
|
texts: KeyValueListTexts;
|
|
41
41
|
/**
|
|
42
42
|
* The language of the values, as a locale code, for example "it". The
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { type Message } from '../Message.js';
|
|
3
|
-
/** A required label shows an asterisk,
|
|
3
|
+
/** A required label shows an asterisk, so it cannot also show "(optional)" */
|
|
4
4
|
type LabelRequirementProps =
|
|
5
5
|
/** The label of a field that is not required, with "(optional)" */
|
|
6
6
|
{
|
|
@@ -26,7 +26,7 @@ export type LabelProps = LabelRequirementProps & {
|
|
|
26
26
|
label: Message;
|
|
27
27
|
/** Hides the label from the eye. A screen reader still reads it. */
|
|
28
28
|
hidden?: boolean;
|
|
29
|
-
/** Adds the icon that
|
|
29
|
+
/** Adds the icon that says that the value is different for each locale. */
|
|
30
30
|
localized?: boolean;
|
|
31
31
|
/**
|
|
32
32
|
* Renders a menu at the end of the label. It renders only when the label
|
|
@@ -6,14 +6,6 @@ import { useTextInputHandlers } from "./useTextInputHandlers.js";
|
|
|
6
6
|
import React, { useState } from "react";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
//#region ../ui-public/src/form/PasswordInput.tsx
|
|
9
|
-
var ShowPasswordIcon = (props) => /* @__PURE__ */ jsx(Authentication.ShowPasswordIcon, {
|
|
10
|
-
...props,
|
|
11
|
-
viewBox: "0 0 640 512"
|
|
12
|
-
});
|
|
13
|
-
var HidePasswordIcon = (props) => /* @__PURE__ */ jsx(Authentication.HidePasswordIcon, {
|
|
14
|
-
...props,
|
|
15
|
-
viewBox: "0 0 640 512"
|
|
16
|
-
});
|
|
17
9
|
/**
|
|
18
10
|
* A password input with a button that shows or hides the password. It passes
|
|
19
11
|
* the attributes of an `input` element to the `input`.
|
|
@@ -41,7 +33,7 @@ var PasswordInput = ({ value, onChange, onBlur, onFocus, placeholder, ...inputPr
|
|
|
41
33
|
tone: "ghost",
|
|
42
34
|
size: "micro",
|
|
43
35
|
iconOnly: true,
|
|
44
|
-
icon: showPassword ? HidePasswordIcon : ShowPasswordIcon,
|
|
36
|
+
icon: showPassword ? Authentication.HidePasswordIcon : Authentication.ShowPasswordIcon,
|
|
45
37
|
label: { id: showPassword ? "form.password.hide" : "form.password.show" },
|
|
46
38
|
className: "PasswordInput__toggle",
|
|
47
39
|
onClick: () => setShowPassword((visible) => !visible)
|
|
@@ -21,7 +21,7 @@ export type RadioGroupOption<T extends string = string> = {
|
|
|
21
21
|
*/
|
|
22
22
|
icon?: React.ReactNode;
|
|
23
23
|
/**
|
|
24
|
-
* An extra class for a mark of
|
|
24
|
+
* An extra class for a mark of your own on this option, for example the
|
|
25
25
|
* diff of two versions marks the options that changed
|
|
26
26
|
*/
|
|
27
27
|
className?: string;
|
|
@@ -35,7 +35,7 @@ export type RadioGroupInputProps<T extends string = string> = BaseInputComponent
|
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
37
37
|
* A choice of one value from a list of options, all visible, each with a
|
|
38
|
-
* label and an optional hint. For a boolean value,
|
|
38
|
+
* label and an optional hint. For a boolean value, you map `true`
|
|
39
39
|
* and `false` to two string values.
|
|
40
40
|
*/
|
|
41
41
|
declare function RadioGroupInput<T extends string>(props: RadioGroupInputProps<T>): React.JSX.Element;
|
|
@@ -9,7 +9,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
9
9
|
//#region ../ui-public/src/form/RadioGroupInput.tsx
|
|
10
10
|
/**
|
|
11
11
|
* A choice of one value from a list of options, all visible, each with a
|
|
12
|
-
* label and an optional hint. For a boolean value,
|
|
12
|
+
* label and an optional hint. For a boolean value, you map `true`
|
|
13
13
|
* and `false` to two string values.
|
|
14
14
|
*/
|
|
15
15
|
function RadioGroupInput(props) {
|
|
@@ -3,7 +3,7 @@ import { GroupBase, MenuProps } from 'react-select';
|
|
|
3
3
|
import { type Message } from '../../Message.js';
|
|
4
4
|
import { BaseSelectOption } from './index.js';
|
|
5
5
|
/**
|
|
6
|
-
* The list that an action of the footer shows
|
|
6
|
+
* The list that an action of the footer shows instead of the options.
|
|
7
7
|
* `SelectInput` holds it: the keys, the Tab key and the close of the menu
|
|
8
8
|
* must know about it.
|
|
9
9
|
*/
|
|
@@ -34,7 +34,7 @@ export type SelectMenuActionProps = {
|
|
|
34
34
|
list?: never;
|
|
35
35
|
} | {
|
|
36
36
|
/**
|
|
37
|
-
* The action opens this list of actions
|
|
37
|
+
* The action opens this list of actions instead of the options.
|
|
38
38
|
* The select shows the label of the action as the title of the list,
|
|
39
39
|
* which goes back to the options. Escape and the close of the menu go
|
|
40
40
|
* back too.
|
|
@@ -33,7 +33,7 @@ export type SelectSearch = {
|
|
|
33
33
|
/**
|
|
34
34
|
* Called with the text in the input each time it changes. The select
|
|
35
35
|
* empties the input when the user picks an option, leaves the select or
|
|
36
|
-
* closes the menu: the query is then an empty string,
|
|
36
|
+
* closes the menu: the query is then an empty string, so the next open
|
|
37
37
|
* starts from the full list.
|
|
38
38
|
*/
|
|
39
39
|
onQueryChange: (query: string) => void;
|
|
@@ -46,7 +46,7 @@ export default function SelectInput<O extends BaseSelectOption, G extends GroupB
|
|
|
46
46
|
type CommonProps<O extends BaseSelectOption> = {
|
|
47
47
|
/**
|
|
48
48
|
* The options load: the control shows a spinner, and the open menu shows
|
|
49
|
-
* the loading text
|
|
49
|
+
* the loading text instead of the options
|
|
50
50
|
*/
|
|
51
51
|
loading?: boolean;
|
|
52
52
|
/**
|
|
@@ -84,7 +84,7 @@ type CommonProps<O extends BaseSelectOption> = {
|
|
|
84
84
|
/**
|
|
85
85
|
* Actions below the options of the menu, for example "Create new". Build
|
|
86
86
|
* them with `SelectMenuAction`: an action with `list` opens a second list
|
|
87
|
-
*
|
|
87
|
+
* instead of the options. Close the menu with `closeSelectMenu`.
|
|
88
88
|
*/
|
|
89
89
|
menuFooter?: ReactNode;
|
|
90
90
|
};
|
|
@@ -6,7 +6,7 @@ export type SwitchInputProps = BaseInputComponentPropsFieldWithReadOnly<boolean
|
|
|
6
6
|
/**
|
|
7
7
|
* The text next to the switch. It is the name of the switch, and a click
|
|
8
8
|
* on it flips the switch. An element shows as it is: it must be a `Label`
|
|
9
|
-
* that points to the `id` of the switch
|
|
9
|
+
* that points to the `id` of the switch.
|
|
10
10
|
* Do not give a `label` to a `FieldWrapper` around the switch.
|
|
11
11
|
*/
|
|
12
12
|
label: Message;
|
|
@@ -20,7 +20,7 @@ export type SwitchInputProps = BaseInputComponentPropsFieldWithReadOnly<boolean
|
|
|
20
20
|
/** Why the value is on, for example "The role Editor gives it" */
|
|
21
21
|
reason: Message;
|
|
22
22
|
};
|
|
23
|
-
/** The `id` of the text of the label.
|
|
23
|
+
/** The `id` of the text of the label. */
|
|
24
24
|
'aria-labelledby'?: string;
|
|
25
25
|
/** Set when the value has an error. A `FieldWrapper` gives it. */
|
|
26
26
|
'aria-invalid'?: boolean;
|
|
@@ -9,7 +9,7 @@ export type SwitchListProps = {
|
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* A list of related switches, for example the permissions of a role. Each
|
|
12
|
-
* switch is an inset row: the label
|
|
12
|
+
* switch is an inset row: the label on the left, the switch on the right,
|
|
13
13
|
* and a box that shows on hover. Put one list in a `Page.Group` for each topic.
|
|
14
14
|
*/
|
|
15
15
|
export declare function SwitchList({ children, className }: SwitchListProps): React.JSX.Element;
|
|
@@ -9,7 +9,7 @@ function useInSwitchList() {
|
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* A list of related switches, for example the permissions of a role. Each
|
|
12
|
-
* switch is an inset row: the label
|
|
12
|
+
* switch is an inset row: the label on the left, the switch on the right,
|
|
13
13
|
* and a box that shows on hover. Put one list in a `Page.Group` for each topic.
|
|
14
14
|
*/
|
|
15
15
|
function SwitchList({ children, className }) {
|
|
@@ -126,7 +126,7 @@ type TableListAddMenu<Item> = {
|
|
|
126
126
|
export type TableListLocked<Item> = {
|
|
127
127
|
/** Tells if a row is locked */
|
|
128
128
|
isLocked: (item: Item) => boolean;
|
|
129
|
-
/** The tooltip of the disabled trash of a locked row
|
|
129
|
+
/** The tooltip of the disabled trash of a locked row. It says why */
|
|
130
130
|
reason: TextMessage;
|
|
131
131
|
};
|
|
132
132
|
/** How the user adds a row: at once, or with a menu */
|
|
@@ -155,7 +155,7 @@ export type ListInputValueProps<Item> = {
|
|
|
155
155
|
value: Item[];
|
|
156
156
|
/**
|
|
157
157
|
* Called with the new rows when the user adds, removes, moves or changes a
|
|
158
|
-
* row. The second argument
|
|
158
|
+
* row. The second argument says what changed.
|
|
159
159
|
*/
|
|
160
160
|
onChange: (items: Item[], change: TableListChange) => void;
|
|
161
161
|
/**
|
|
@@ -7,7 +7,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
7
7
|
//#region ../ui-public/src/form/TextareaInput.tsx
|
|
8
8
|
/**
|
|
9
9
|
* Sets the height of the textarea from its text. The height goes to `auto`
|
|
10
|
-
* first
|
|
10
|
+
* first, so `scrollHeight` gives the height of the text, even when the
|
|
11
11
|
* text becomes shorter. The `rows` of the element keep the smallest height.
|
|
12
12
|
*/
|
|
13
13
|
function useAutosize(ref, text, maxRows) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** The props of an input that is disabled: it needs no name and no handlers. */
|
|
2
2
|
export type BaseInputComponentPropsFieldDisabled<Value = unknown> = {
|
|
3
|
-
/** The `id` that
|
|
3
|
+
/** The `id` that the field gives, for the `label` to point to. */
|
|
4
4
|
id?: string;
|
|
5
5
|
/** The value of the field in the form. */
|
|
6
6
|
value: Value;
|
|
@@ -15,7 +15,7 @@ export type BaseInputComponentPropsFieldDisabled<Value = unknown> = {
|
|
|
15
15
|
};
|
|
16
16
|
/** The props of an input that the user can change. */
|
|
17
17
|
export type BaseInputComponentPropsFieldEnabled<Value = unknown> = {
|
|
18
|
-
/** The `id` that
|
|
18
|
+
/** The `id` that the field gives, for the `label` to point to. */
|
|
19
19
|
id?: string;
|
|
20
20
|
/** The value of the field in the form. */
|
|
21
21
|
value: Value;
|
|
@@ -46,7 +46,7 @@ export type FieldInputStatics = {
|
|
|
46
46
|
fieldLabel?: 'inside';
|
|
47
47
|
};
|
|
48
48
|
/**
|
|
49
|
-
* The `aria-labelledby` that
|
|
49
|
+
* The `aria-labelledby` that the field gives: the `id` of the text of its label.
|
|
50
50
|
* A group input (a radio group) puts it on its group element, because the
|
|
51
51
|
* `htmlFor` of the label cannot point to a group.
|
|
52
52
|
*/
|
|
@@ -66,7 +66,7 @@ export type BaseInputComponentPropsField<Value = unknown> = BaseInputComponentPr
|
|
|
66
66
|
* or read-only. It needs no name and no handlers.
|
|
67
67
|
*/
|
|
68
68
|
export type BaseInputComponentPropsFieldWithReadOnlyNonEditable<Value = unknown, ChangeDetail extends unknown[] = []> = {
|
|
69
|
-
/** The `id` that
|
|
69
|
+
/** The `id` that the field gives, for the `label` to point to. */
|
|
70
70
|
id?: string;
|
|
71
71
|
/** The value of the field in the form. */
|
|
72
72
|
value: Value;
|
|
@@ -88,7 +88,7 @@ export type BaseInputComponentPropsFieldWithReadOnlyNonEditable<Value = unknown,
|
|
|
88
88
|
});
|
|
89
89
|
/** The props of an input with a read-only mode, when the user can change it. */
|
|
90
90
|
export type BaseInputComponentPropsFieldWithReadOnlyEditable<Value = unknown, ChangeDetail extends unknown[] = []> = {
|
|
91
|
-
/** The `id` that
|
|
91
|
+
/** The `id` that the field gives, for the `label` to point to. */
|
|
92
92
|
id?: string;
|
|
93
93
|
/** The value of the field in the form. */
|
|
94
94
|
value: Value;
|
|
@@ -114,6 +114,6 @@ export type BaseInputComponentPropsFieldWithReadOnlyEditable<Value = unknown, Ch
|
|
|
114
114
|
* `BaseInputComponentPropsFieldWithReadOnlyEditable` and
|
|
115
115
|
* `BaseInputComponentPropsFieldWithReadOnlyNonEditable`. `ChangeDetail` is
|
|
116
116
|
* the list of the arguments that `onChange` gets after the value. It is empty
|
|
117
|
-
* by default,
|
|
117
|
+
* by default, so a handler with one parameter always fits.
|
|
118
118
|
*/
|
|
119
119
|
export type BaseInputComponentPropsFieldWithReadOnly<Value = unknown, ChangeDetail extends unknown[] = []> = BaseInputComponentPropsFieldWithReadOnlyEditable<Value, ChangeDetail> | BaseInputComponentPropsFieldWithReadOnlyNonEditable<Value, ChangeDetail>;
|
|
@@ -2,7 +2,7 @@ import type { BaseSelectOption, SelectSearch } from '../form/SelectInput/index.j
|
|
|
2
2
|
export type UseAsyncSelectOptionsConfig<O extends BaseSelectOption> = {
|
|
3
3
|
/**
|
|
4
4
|
* Gives the options that match the query. The hook calls it with an empty
|
|
5
|
-
* query at mount,
|
|
5
|
+
* query at mount, so the menu is full when the user opens it. The signal
|
|
6
6
|
* aborts when a newer query starts or when the component unmounts: give it
|
|
7
7
|
* to `fetch`.
|
|
8
8
|
*/
|
|
@@ -10,7 +10,7 @@ import React from 'react';
|
|
|
10
10
|
* does its own action.
|
|
11
11
|
* - A click that ends a text selection (for example, to copy a value).
|
|
12
12
|
*
|
|
13
|
-
* When `enabled` is false, the hook returns `undefined`,
|
|
13
|
+
* When `enabled` is false, the hook returns `undefined`, so the row has no
|
|
14
14
|
* click handler. The handler is stable: it always calls the latest `handler`.
|
|
15
15
|
*/
|
|
16
16
|
export declare function useSmartRowClick<T extends HTMLElement = HTMLElement>(handler: () => void, enabled?: boolean): React.MouseEventHandler<T> | undefined;
|
|
@@ -12,7 +12,7 @@ var INTERACTIVE_SELECTOR = "button, a, input, select, textarea, [role=\"button\"
|
|
|
12
12
|
* does its own action.
|
|
13
13
|
* - A click that ends a text selection (for example, to copy a value).
|
|
14
14
|
*
|
|
15
|
-
* When `enabled` is false, the hook returns `undefined`,
|
|
15
|
+
* When `enabled` is false, the hook returns `undefined`, so the row has no
|
|
16
16
|
* click handler. The handler is stable: it always calls the latest `handler`.
|
|
17
17
|
*/
|
|
18
18
|
function useSmartRowClick(handler, enabled = true) {
|
|
@@ -31,7 +31,7 @@ export type PageGroupProps = {
|
|
|
31
31
|
*/
|
|
32
32
|
tone?: 'danger' | 'warning';
|
|
33
33
|
/**
|
|
34
|
-
* A short status
|
|
34
|
+
* A short status on the right of the title. Put a Pill here, in the color
|
|
35
35
|
* of the tone (for example `<Pill tone="danger">Unpaid</Pill>`). Use it
|
|
36
36
|
* for a problem that the user must fix, not for the "Danger zone". A group
|
|
37
37
|
* without a tone can show its state (for example a `success` pill for a
|
|
@@ -62,7 +62,7 @@ export type PageGroupProps = {
|
|
|
62
62
|
};
|
|
63
63
|
/**
|
|
64
64
|
* A group of related content in a card, with its own title. Use it in a
|
|
65
|
-
* Page.Content
|
|
65
|
+
* Page.Content instead of a Page.Section when the content of the group has
|
|
66
66
|
* more than one part (for example a summary and a chart), so the parts read
|
|
67
67
|
* as one thing. The parts inside the card have no card of their own.
|
|
68
68
|
*/
|
|
@@ -8,7 +8,7 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
|
8
8
|
//#region ../ui-public/src/layout/Page/PageGroup.tsx
|
|
9
9
|
/**
|
|
10
10
|
* A group of related content in a card, with its own title. Use it in a
|
|
11
|
-
* Page.Content
|
|
11
|
+
* Page.Content instead of a Page.Section when the content of the group has
|
|
12
12
|
* more than one part (for example a summary and a chart), so the parts read
|
|
13
13
|
* as one thing. The parts inside the card have no card of their own.
|
|
14
14
|
*/
|
|
@@ -36,7 +36,7 @@ declare function Submit(_props: FormHeaderSubmitProps): null;
|
|
|
36
36
|
* The title bar of an edit pane: a pane that is the form of one thing (a
|
|
37
37
|
* settings form, the form of a role or of a webhook). A view pane (a list, a
|
|
38
38
|
* sidebar, a page to read) uses Pane.Header. The rules of this bar are here,
|
|
39
|
-
*
|
|
39
|
+
* so all the forms have the same bar. The record editor has its own bar.
|
|
40
40
|
*
|
|
41
41
|
* Rules:
|
|
42
42
|
* - Pane.FormHeader renders the parts in a fixed order: title, details,
|
|
@@ -21,7 +21,7 @@ function findPart(children, type) {
|
|
|
21
21
|
* The title bar of an edit pane: a pane that is the form of one thing (a
|
|
22
22
|
* settings form, the form of a role or of a webhook). A view pane (a list, a
|
|
23
23
|
* sidebar, a page to read) uses Pane.Header. The rules of this bar are here,
|
|
24
|
-
*
|
|
24
|
+
* so all the forms have the same bar. The record editor has its own bar.
|
|
25
25
|
*
|
|
26
26
|
* Rules:
|
|
27
27
|
* - Pane.FormHeader renders the parts in a fixed order: title, details,
|
|
@@ -11,7 +11,7 @@ type ListFilterState = {
|
|
|
11
11
|
open: boolean;
|
|
12
12
|
/**
|
|
13
13
|
* Runs with the new state. `true` opens the row and moves the focus to the
|
|
14
|
-
* input,
|
|
14
|
+
* input, even when the row is open. `false` closes the row and clears a
|
|
15
15
|
* filter with a value.
|
|
16
16
|
*/
|
|
17
17
|
onToggle: (open: boolean) => void;
|
|
@@ -6,7 +6,7 @@ import type { Message } from '../../Message.js';
|
|
|
6
6
|
*/
|
|
7
7
|
export type ListPreset<T> = {
|
|
8
8
|
id: string;
|
|
9
|
-
/** The name in the menu: it
|
|
9
|
+
/** The name in the menu: it says exactly what the preset keeps */
|
|
10
10
|
label: Message;
|
|
11
11
|
/**
|
|
12
12
|
* The name after the title while the preset is active ("API tokens ·
|
|
@@ -19,7 +19,7 @@ export type PaneHeaderTitleProps = {
|
|
|
19
19
|
* The level of the title as a heading. Give it only to a pane inside
|
|
20
20
|
* <main> or inside a dialog that has content: the title of a detail pane
|
|
21
21
|
* is level 2. Without it, the title is not a heading (for example the
|
|
22
|
-
* title of a list
|
|
22
|
+
* title of a list on the left).
|
|
23
23
|
*/
|
|
24
24
|
level?: HeadingLevel;
|
|
25
25
|
/** The help of the page (a Toolbar.Help element) */
|
|
@@ -33,7 +33,7 @@ export type PaneProps = PropsWithChildren<{
|
|
|
33
33
|
/**
|
|
34
34
|
* Puts the pane in a mode (for example the reorder mode of a sidebar).
|
|
35
35
|
* While the prop is set, the pane draws a primary frame around its
|
|
36
|
-
* content, under the title bar.
|
|
36
|
+
* content, under the title bar. So the user sees that the pane is in
|
|
37
37
|
* that mode. The title in the header is the name of the mode.
|
|
38
38
|
*
|
|
39
39
|
* For a screen reader, the content is then a group with the title as its
|
|
@@ -43,9 +43,9 @@ export type PaneProps = PropsWithChildren<{
|
|
|
43
43
|
*/
|
|
44
44
|
mode?: {
|
|
45
45
|
/**
|
|
46
|
-
* Stops the mode. It runs when the user
|
|
47
|
-
*
|
|
48
|
-
*
|
|
46
|
+
* Stops the mode. It runs when the user clicks on the page out of the
|
|
47
|
+
* pane. Menus and dialogs are not in the page: a click there does not
|
|
48
|
+
* run it.
|
|
49
49
|
*/
|
|
50
50
|
onExit: () => void;
|
|
51
51
|
};
|
|
@@ -99,7 +99,7 @@ declare const _default: React.NamedExoticComponent<{
|
|
|
99
99
|
/**
|
|
100
100
|
* Puts the pane in a mode (for example the reorder mode of a sidebar).
|
|
101
101
|
* While the prop is set, the pane draws a primary frame around its
|
|
102
|
-
* content, under the title bar.
|
|
102
|
+
* content, under the title bar. So the user sees that the pane is in
|
|
103
103
|
* that mode. The title in the header is the name of the mode.
|
|
104
104
|
*
|
|
105
105
|
* For a screen reader, the content is then a group with the title as its
|
|
@@ -109,9 +109,9 @@ declare const _default: React.NamedExoticComponent<{
|
|
|
109
109
|
*/
|
|
110
110
|
mode?: {
|
|
111
111
|
/**
|
|
112
|
-
* Stops the mode. It runs when the user
|
|
113
|
-
*
|
|
114
|
-
*
|
|
112
|
+
* Stops the mode. It runs when the user clicks on the page out of the
|
|
113
|
+
* pane. Menus and dialogs are not in the page: a click there does not
|
|
114
|
+
* run it.
|
|
115
115
|
*/
|
|
116
116
|
onExit: () => void;
|
|
117
117
|
};
|
|
@@ -38,20 +38,23 @@ function Pane({ children, ariaLabel, className, busy, header, mode, slideUpToolb
|
|
|
38
38
|
}, [inMode]);
|
|
39
39
|
useEffect(() => {
|
|
40
40
|
if (!onExit) return;
|
|
41
|
+
let pressedOnPage = false;
|
|
41
42
|
const handlePointerDown = (event) => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (
|
|
43
|
+
pressedOnPage = isOnPageOutOfPane(ref.current, event.target);
|
|
44
|
+
};
|
|
45
|
+
const handleClick = (event) => {
|
|
46
|
+
const clickedOnPage = pressedOnPage && isOnPageOutOfPane(ref.current, event.target);
|
|
47
|
+
pressedOnPage = false;
|
|
48
|
+
if (clickedOnPage) {
|
|
48
49
|
exitedByClickOutside.current = true;
|
|
49
50
|
onExit();
|
|
50
51
|
}
|
|
51
52
|
};
|
|
52
|
-
document.addEventListener("pointerdown", handlePointerDown);
|
|
53
|
+
document.addEventListener("pointerdown", handlePointerDown, true);
|
|
54
|
+
document.addEventListener("click", handleClick, true);
|
|
53
55
|
return () => {
|
|
54
|
-
document.removeEventListener("pointerdown", handlePointerDown);
|
|
56
|
+
document.removeEventListener("pointerdown", handlePointerDown, true);
|
|
57
|
+
document.removeEventListener("click", handleClick, true);
|
|
55
58
|
};
|
|
56
59
|
}, [onExit]);
|
|
57
60
|
return /* @__PURE__ */ jsx(PaneAriaLabelProvider, {
|
|
@@ -95,6 +98,12 @@ function Pane({ children, ariaLabel, className, busy, header, mode, slideUpToolb
|
|
|
95
98
|
})
|
|
96
99
|
});
|
|
97
100
|
}
|
|
101
|
+
function isOnPageOutOfPane(pane, target) {
|
|
102
|
+
if (!pane || !(target instanceof Node) || pane.contains(target)) return false;
|
|
103
|
+
let page = pane;
|
|
104
|
+
while (page.parentElement && page.parentElement !== document.body) page = page.parentElement;
|
|
105
|
+
return page.contains(target);
|
|
106
|
+
}
|
|
98
107
|
var Pane_default = Object.assign(React.memo(Pane), {
|
|
99
108
|
Header: PaneHeader_default,
|
|
100
109
|
FormHeader: FormHeader_default,
|
|
@@ -47,7 +47,7 @@ export type SidebarPanelUncontrolled = {
|
|
|
47
47
|
collapse?: never;
|
|
48
48
|
};
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
50
|
+
* You keep the open state, for example with
|
|
51
51
|
* `useLocalStorageSidebarPanelOpen`.
|
|
52
52
|
*/
|
|
53
53
|
export type SidebarPanelControlled = {
|
|
@@ -15,7 +15,7 @@ var LABELS = {
|
|
|
15
15
|
/**
|
|
16
16
|
* The rail of a collapsed secondary pane: a narrow button that opens the
|
|
17
17
|
* pane. `SplitPane` renders it. The product scenes render it alone, as the
|
|
18
|
-
* picture at rest of a collapsed pane (`
|
|
18
|
+
* picture at rest of a collapsed pane (`SplitPane/Rail`).
|
|
19
19
|
*/
|
|
20
20
|
var Rail = React.forwardRef(function Rail({ side, state = "collapsed", wrapIcon, onClick, onPointerDown, onHoverChange }, ref) {
|
|
21
21
|
const { t } = useTranslation();
|
|
@@ -3,8 +3,8 @@ export { TOGGLE_LEFT_SIDEBAR_ACTION_ID, TOGGLE_RIGHT_SIDEBAR_ACTION_ID, } from '
|
|
|
3
3
|
export type SplitPaneProps = {
|
|
4
4
|
/**
|
|
5
5
|
* "split" puts the two panes side by side. "overlay" shows the secondary
|
|
6
|
-
* pane over the page, for example on a small viewport.
|
|
7
|
-
*
|
|
6
|
+
* pane over the page, for example on a small viewport. You
|
|
7
|
+
* compute it, because its own controls use the same breakpoint.
|
|
8
8
|
* @default "split"
|
|
9
9
|
*/
|
|
10
10
|
mode?: 'overlay' | 'split';
|
|
@@ -43,7 +43,7 @@ export type SplitPaneProps = {
|
|
|
43
43
|
*/
|
|
44
44
|
export type SplitPaneSize = number | `${number}%`;
|
|
45
45
|
export type SplitPaneCollapse = {
|
|
46
|
-
/**
|
|
46
|
+
/** Says if the secondary pane is open. */
|
|
47
47
|
open: boolean;
|
|
48
48
|
/**
|
|
49
49
|
* Runs with the new state: `true` when the pane opens, `false` when it
|
|
@@ -51,7 +51,7 @@ export type SplitPaneCollapse = {
|
|
|
51
51
|
*/
|
|
52
52
|
onToggle: (open: boolean) => void;
|
|
53
53
|
/**
|
|
54
|
-
* Hides the rail of the collapsed pane. Use it when
|
|
54
|
+
* Hides the rail of the collapsed pane. Use it when you give another
|
|
55
55
|
* control that opens the pane, for example the menu button of the mobile
|
|
56
56
|
* header.
|
|
57
57
|
* @default false
|
|
@@ -59,8 +59,8 @@ export type SplitPaneCollapse = {
|
|
|
59
59
|
hideRail?: boolean;
|
|
60
60
|
/**
|
|
61
61
|
* Puts the toggle (the button on the sash or the icon of the rail) in an
|
|
62
|
-
* element of
|
|
63
|
-
*
|
|
62
|
+
* element of yours, for example a spotlight that explains the toggle to the
|
|
63
|
+
* user.
|
|
64
64
|
*/
|
|
65
65
|
wrapToggle?: (toggle: React.ReactElement) => React.ReactNode;
|
|
66
66
|
};
|