@tensor_1/react 2.30.0 → 2.32.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/README.md +430 -0
- package/dist/attachment-labels.d.ts +16 -0
- package/dist/attachment-labels.js +9 -0
- package/dist/calendar-model.d.ts +141 -1
- package/dist/calendar-model.js +200 -11
- package/dist/chart-preset.cjs +127 -7
- package/dist/chart-preset.d.cts +2 -2
- package/dist/chart-preset.d.ts +1 -0
- package/dist/chart-preset.js +6 -1
- package/dist/chart-theme-Cl0IrkKQ.d.cts +112 -0
- package/dist/chart-theme.d.ts +51 -0
- package/dist/chart-theme.js +99 -0
- package/dist/chart.cjs +127 -7
- package/dist/chart.d.cts +2 -2
- package/dist/chart.d.ts +1 -0
- package/dist/chart.js +6 -2
- package/dist/components/Alert.d.ts +17 -1
- package/dist/components/Alert.js +9 -4
- package/dist/components/AlertDismiss.d.ts +14 -0
- package/dist/components/AlertDismiss.js +11 -0
- package/dist/components/Attachment.d.ts +58 -0
- package/dist/components/Attachment.js +69 -0
- package/dist/components/AttachmentParts.d.ts +24 -0
- package/dist/components/AttachmentParts.js +20 -0
- package/dist/components/Chart.d.ts +1 -0
- package/dist/components/Chart.js +6 -1
- package/dist/components/ChartCore.d.ts +6 -1
- package/dist/components/ChartCore.js +23 -5
- package/dist/components/Chip.d.ts +17 -2
- package/dist/components/Chip.js +35 -11
- package/dist/components/ChipRemove.d.ts +17 -0
- package/dist/components/ChipRemove.js +13 -0
- package/dist/components/CollapsibleParts.d.ts +29 -0
- package/dist/components/CollapsibleParts.js +20 -0
- package/dist/components/CollapsibleSection.d.ts +30 -3
- package/dist/components/CollapsibleSection.js +7 -11
- package/dist/components/CollapsibleSectionState.d.ts +1 -1
- package/dist/components/CollapsibleSectionState.js +54 -27
- package/dist/components/DashboardGrid.d.ts +60 -0
- package/dist/components/DashboardGrid.js +40 -0
- package/dist/components/DateRangePicker.d.ts +7 -1
- package/dist/components/DateRangePicker.js +5 -1
- package/dist/components/DescriptionList.d.ts +12 -1
- package/dist/components/DescriptionList.js +5 -5
- package/dist/components/Dialogs.d.ts +24 -3
- package/dist/components/Dialogs.js +74 -16
- package/dist/components/EntityPicker.d.ts +56 -0
- package/dist/components/EntityPicker.js +168 -0
- package/dist/components/FileIcon.d.ts +9 -0
- package/dist/components/FileIcon.js +17 -0
- package/dist/components/FileUpload.d.ts +95 -0
- package/dist/components/FileUpload.js +145 -0
- package/dist/components/FilterEditor.d.ts +55 -0
- package/dist/components/FilterEditor.js +186 -0
- package/dist/components/Heartbeat.d.ts +31 -0
- package/dist/components/Heartbeat.js +28 -0
- package/dist/components/Lightbox.d.ts +45 -0
- package/dist/components/Lightbox.js +102 -0
- package/dist/components/Menu.d.ts +53 -5
- package/dist/components/Menu.js +104 -4
- package/dist/components/Meter.d.ts +7 -3
- package/dist/components/Meter.js +2 -1
- package/dist/components/Popover.d.ts +21 -2
- package/dist/components/Popover.js +94 -17
- package/dist/components/Prose.d.ts +6 -2
- package/dist/components/Prose.js +1 -1
- package/dist/components/RuleBuilder.d.ts +52 -4
- package/dist/components/RuleBuilder.js +109 -24
- package/dist/components/SchedulingCalendar.d.ts +142 -11
- package/dist/components/SchedulingCalendar.js +234 -57
- package/dist/components/SchedulingTimeline.d.ts +1 -0
- package/dist/components/SearchSuggest.d.ts +6 -2
- package/dist/components/SearchSuggest.js +4 -0
- package/dist/components/Segmented.d.ts +17 -3
- package/dist/components/Segmented.js +59 -5
- package/dist/components/Select.d.ts +66 -2
- package/dist/components/Select.js +800 -10
- package/dist/components/Spinner.d.ts +2 -1
- package/dist/components/Spinner.js +1 -1
- package/dist/components/StatusPill.d.ts +8 -2
- package/dist/components/StatusPill.js +2 -2
- package/dist/components/Steps.d.ts +28 -4
- package/dist/components/Steps.js +46 -16
- package/dist/components/TableControls.js +4 -3
- package/dist/components/Tabs.d.ts +7 -2
- package/dist/components/Tabs.js +14 -1
- package/dist/components/TextDiff.d.ts +49 -0
- package/dist/components/TextDiff.js +124 -0
- package/dist/{emoji-image-6mPZ15Zy.d.cts → emoji-image-DjCKpdwE.d.cts} +1 -1
- package/dist/emoji.cjs +169 -27
- package/dist/emoji.d.cts +3 -3
- package/dist/file-model.d.ts +56 -0
- package/dist/file-model.js +52 -0
- package/dist/filter-model.d.ts +112 -0
- package/dist/filter-model.js +103 -0
- package/dist/hooks/useAnchoredPosition.d.ts +24 -1
- package/dist/hooks/useAnchoredPosition.js +58 -8
- package/dist/hooks/useVirtualRows.d.ts +17 -2
- package/dist/hooks/useVirtualRows.js +6 -5
- package/dist/icons/Icon.d.ts +14 -14
- package/dist/index.cjs +4938 -1631
- package/dist/index.d.cts +1622 -178
- package/dist/index.d.ts +20 -6
- package/dist/index.js +88 -4
- package/dist/labels-context.d.ts +28 -0
- package/dist/{overlay-position-Cjv5E7mn.d.cts → overlay-position-2Afke51l.d.cts} +20 -0
- package/dist/overlay-position.d.ts +20 -0
- package/dist/overlay-position.js +17 -2
- package/dist/rich-text.cjs +169 -27
- package/dist/rich-text.d.cts +3 -3
- package/dist/rule-builder-model.d.ts +34 -2
- package/dist/rule-builder-model.js +48 -12
- package/dist/scheduling-calendar-model.d.ts +66 -0
- package/dist/scheduling-calendar-model.js +82 -0
- package/dist/select-model.d.ts +80 -0
- package/dist/select-model.js +109 -0
- package/dist/table-engine.d.ts +7 -0
- package/dist/table-engine.js +2 -1
- package/dist/text-diff-model.d.ts +71 -0
- package/dist/text-diff-model.js +261 -0
- package/package.json +1 -1
- package/dist/ChartCore-DzWe10bN.d.cts +0 -59
package/dist/index.d.ts
CHANGED
|
@@ -11,9 +11,10 @@ export { Input, InputGroup, InputGroupProps, InputProps } from './components/Inp
|
|
|
11
11
|
export { Combobox, ComboboxProps } from './components/Combobox.js';
|
|
12
12
|
export { ComboboxOption, filterComboboxOptions } from './combobox-model.js';
|
|
13
13
|
export { SearchSuggest, SearchSuggestAction, SearchSuggestOption, SearchSuggestProps } from './components/SearchSuggest.js';
|
|
14
|
+
export { DEFAULT_ENTITY_PICKER_LABELS, EntityPicker, EntityPickerLabels, EntityPickerProps } from './components/EntityPicker.js';
|
|
14
15
|
export { FoldedText, SearchSegment, foldForSearch, searchSegments } from './search-suggest-model.js';
|
|
15
16
|
export { Textarea, TextareaProps } from './components/Textarea.js';
|
|
16
|
-
export { Select, SelectProps } from './components/Select.js';
|
|
17
|
+
export { Select, SelectLabels, SelectProps } from './components/Select.js';
|
|
17
18
|
export { Checkbox, CheckboxProps } from './components/Checkbox.js';
|
|
18
19
|
export { Radio, RadioGroup, RadioGroupProps, RadioProps } from './components/Radio.js';
|
|
19
20
|
export { Switch, SwitchProps } from './components/Switch.js';
|
|
@@ -22,7 +23,9 @@ export { Modal, ModalProps } from './components/Modal.js';
|
|
|
22
23
|
export { ConfirmDialog, ConfirmDialogProps, Popconfirm, PopconfirmProps, PromptDialog, PromptDialogProps } from './components/Dialogs.js';
|
|
23
24
|
export { Drawer, DrawerProps } from './components/Drawer.js';
|
|
24
25
|
export { Peek, PeekProps } from './components/Peek.js';
|
|
26
|
+
export { DEFAULT_LIGHTBOX_LABELS, Lightbox, LightboxItem, LightboxLabels, LightboxProps } from './components/Lightbox.js';
|
|
25
27
|
export { Card, CardLink, CardLinkProps, CardProps } from './components/Card.js';
|
|
28
|
+
export { DashboardGrid, DashboardGridBreakpoint, DashboardGridColumnCount, DashboardGridColumns, DashboardGridGap, DashboardGridItem, DashboardGridItemProps, DashboardGridProps, DashboardGridSpan, dashboardGridClassName, dashboardGridItemClassName } from './components/DashboardGrid.js';
|
|
26
29
|
export { BreadcrumbItem, Breadcrumbs, BreadcrumbsProps } from './components/Breadcrumbs.js';
|
|
27
30
|
export { PageHeader, PageHeaderProps } from './components/PageHeader.js';
|
|
28
31
|
export { DetailLayout, DetailLayoutProps } from './components/DetailLayout.js';
|
|
@@ -38,14 +41,18 @@ export { NavGroup, NavGroupProps, NavItem, NavItemProps, Sidebar, SidebarProps,
|
|
|
38
41
|
export { StarButton, StarButtonProps } from './components/StarButton.js';
|
|
39
42
|
export { CopyButton, CopyButtonProps } from './components/CopyButton.js';
|
|
40
43
|
export { NavFavouriteItem, NavFavourites, NavFavouritesLabels, NavFavouritesProps } from './components/NavFavourites.js';
|
|
44
|
+
export { DEFAULT_FILE_UPLOAD_LABELS, FileUpload, FileUploadItem, FileUploadLabels, FileUploadProps, FileUploadStatus } from './components/FileUpload.js';
|
|
45
|
+
export { Attachment, AttachmentList, AttachmentListProps, AttachmentProps } from './components/Attachment.js';
|
|
46
|
+
export { FileRejection, FileRejectionReason, FileSizeFormatter, FileSizeOptions, fileKind, fileMatchesAccept, formatFileSize, partitionFiles } from './file-model.js';
|
|
41
47
|
export { Alert, AlertProps, AlertTone } from './components/Alert.js';
|
|
42
48
|
export { Spinner, SpinnerProps } from './components/Spinner.js';
|
|
49
|
+
export { Heartbeat, HeartbeatProps, HeartbeatState, LiveIndicator, LiveIndicatorProps } from './components/Heartbeat.js';
|
|
43
50
|
export { Toast, ToastProps, ToastTone, Toaster, ToasterProps } from './components/Toast.js';
|
|
44
51
|
export { TOAST_LEAVE_MS, ToastAction, ToastApi, ToastDismissReason, ToastKind, ToastOptions, ToastPromiseMessages, ToastRecord, ToastStore, UndoableToastOptions, createToastApi, createToastStore, toast } from './toast-store.js';
|
|
45
52
|
export { BulkBar, BulkBarProps, CellStrong, CellSub, ExpandToggle, ExpandToggleProps, Highlighted, HighlightedProps, Mark, MarkProps, RowAction, RowActionProps, RowActions, RowActionsProps, SortDirection, Table, TableDensity, TableProps, TableWrap, TableWrapProps, Td, TdProps, Th, ThProps, Tr, TrProps } from './components/Table.js';
|
|
46
53
|
export { ColumnFilter, FilterKind, FilterOp, Primitive, Row, Segment, SelectAllState, SortDir, SortKey, ViewState, VirtualWindow, applyFilters, clampWidth, highlightSegments, matchFilter, mergePinned, multiSort, nextSortDir, parseView, reorder, searchRows, selectAllState, serializeView, shouldVirtualize, toggleId, togglePage, toggleSort, virtualWindow } from './table-engine.js';
|
|
47
54
|
export { DEFAULT_PAGINATION_LABELS, Pagination, PaginationLabels, PaginationProps } from './components/Pagination.js';
|
|
48
|
-
export { PillTone, PillTreatment, StatusPill, StatusPillProps } from './components/StatusPill.js';
|
|
55
|
+
export { PillSize, PillTone, PillTreatment, StatusPill, StatusPillProps } from './components/StatusPill.js';
|
|
49
56
|
export { Progress, ProgressProps } from './components/Progress.js';
|
|
50
57
|
export { Meter, MeterProps, MeterTone } from './components/Meter.js';
|
|
51
58
|
export { Stat, StatProps, StatTrend } from './components/Stat.js';
|
|
@@ -65,12 +72,14 @@ export { DEFAULT_SAVE_STATUS_LABELS, SaveStatus, SaveStatusLabels, SaveStatusPro
|
|
|
65
72
|
export { Composer, ComposerBar, ComposerBarProps, ComposerProps } from './components/Composer.js';
|
|
66
73
|
export { Segmented, SegmentedOption, SegmentedOptionProps, SegmentedProps } from './components/Segmented.js';
|
|
67
74
|
export { FilterOption, FilterPopover, FilterPopoverProps, SavedViewItem, SavedViewMenu, SavedViewMenuProps, SavedViewSection, ViewMenu, ViewMenuColumn, ViewMenuColumnLabels, ViewMenuProps } from './components/TableControls.js';
|
|
75
|
+
export { DEFAULT_FILTER_EDITOR_LABELS, FilterEditor, FilterEditorLabels, FilterEditorProps } from './components/FilterEditor.js';
|
|
76
|
+
export { DEFAULT_FILTER_SUMMARY_LABELS, FilterChoice, FilterField, FilterPreset, FilterSummaryLabels, FilterValue, FilterValueKind, NUMBER_FILTER_OPERATORS, NumberFilterOperator, SummarizeFilterOptions, TEXT_FILTER_OPERATORS, TextFilterOperator, emptyFilterValue, isFilterEmpty, matchFilterPreset, summarizeFilter } from './filter-model.js';
|
|
68
77
|
export { Timeline, TimelineItem, TimelineItemProps, TimelineProps } from './components/Timeline.js';
|
|
69
78
|
export { Pipeline, PipelineProps, PipelineStage, PipelineStageProps, PipelineStageState } from './components/Pipeline.js';
|
|
70
79
|
export { Flow, FlowNode, FlowNodeProps, FlowNodeState, FlowProps, FlowVariant } from './components/Flow.js';
|
|
71
80
|
export { Note, NoteProps, NoteTone, Prose, ProseProps } from './components/Prose.js';
|
|
72
81
|
export { Popover, PopoverProps } from './components/Popover.js';
|
|
73
|
-
export { Menu, MenuGroup, MenuGroupProps, MenuItem, MenuItemProps, MenuProps, MenuSeparator } from './components/Menu.js';
|
|
82
|
+
export { Menu, MenuGroup, MenuGroupProps, MenuItem, MenuItemAttributes, MenuItemCheckbox, MenuItemCheckboxProps, MenuItemProps, MenuItemRadio, MenuItemRadioProps, MenuProps, MenuRadioGroup, MenuRadioGroupProps, MenuSeparator } from './components/Menu.js';
|
|
74
83
|
export { CommandGroup, CommandGroupProps, CommandItem, CommandItemProps, CommandPalette, CommandPaletteProps } from './components/CommandPalette.js';
|
|
75
84
|
export { Inbox, InboxDetail, InboxDetailProps, InboxItem, InboxItemProps, InboxList, InboxListProps, InboxProps } from './components/Inbox.js';
|
|
76
85
|
export { Kanban, KanbanCard, KanbanCardProps, KanbanColumn, KanbanColumnProps, KanbanMoveDirection, KanbanProps } from './components/Kanban.js';
|
|
@@ -79,13 +88,14 @@ export { FlatNode, TreeLike, TreeNavAction, flattenTree, treeNav } from './tree-
|
|
|
79
88
|
export { ContentList, ContentListItem, ContentListItemProps, ContentListProps, EventRow, EventRowProps, FeaturedRundown, FeaturedRundownItem, FeaturedRundownItemProps, FeaturedRundownProps, FeaturedStage, FeaturedStageProps, NewsLead, NewsLeadProps, NoticeQueue, NoticeQueueProps, PageIntro, PageIntroProps, ResourceGrid, ResourceGridProps, SectionHead, SectionHeadProps, StatLine, StatLineItem, StatLineProps, StatusRow, StatusRowProps } from './components/EditorialHome.js';
|
|
80
89
|
export { JsonPrimitive, JsonValue } from './json-value.js';
|
|
81
90
|
export { DEFAULT_RULE_BUILDER_LABELS, RuleActionDefinition, RuleBuilder, RuleBuilderLabels, RuleBuilderProps, RuleFieldDefinition, RuleOperatorDefinition, RuleValueEditorProps } from './components/RuleBuilder.js';
|
|
82
|
-
export { RuleAction, RuleCondition, RuleDefinition, RuleGroup, RuleValidationIssue, appendRuleNode, findRuleNodeDepth, isRuleGroup, mapRuleGroup, moveRuleNode, removeRuleNode, ruleDepth, summarizeRule, validateRuleDefinition } from './rule-builder-model.js';
|
|
91
|
+
export { DEFAULT_RULE_SUMMARY_WORDS, DEFAULT_RULE_VALIDATION_MESSAGES, RuleAction, RuleCheck, RuleCondition, RuleDefinition, RuleGroup, RuleSummaryWords, RuleValidationIssue, RuleValidationOptions, appendRuleNode, findRuleNodeDepth, isRuleGroup, mapRuleGroup, moveRuleNode, removeRuleNode, ruleDepth, setRuleCombinator, summarizeRule, validateRuleDefinition } from './rule-builder-model.js';
|
|
83
92
|
export { BuilderCanvas, BuilderCanvasItem, BuilderCanvasLabels, BuilderCanvasProps, BuilderPaletteItem, DEFAULT_BUILDER_CANVAS_LABELS } from './components/BuilderCanvas.js';
|
|
84
|
-
export { DEFAULT_SCHEDULING_CALENDAR_LABELS, SchedulingCalendar, SchedulingCalendarEntry, SchedulingCalendarLabels, SchedulingCalendarOverlay, SchedulingCalendarProps, SchedulingCalendarView, SchedulingDatePart, SchedulingEntryState, SchedulingOverlayKind } from './components/SchedulingCalendar.js';
|
|
93
|
+
export { DEFAULT_SCHEDULING_CALENDAR_LABELS, SchedulingBand, SchedulingCalendar, SchedulingCalendarDay, SchedulingCalendarEntry, SchedulingCalendarLabels, SchedulingCalendarOverlay, SchedulingCalendarProps, SchedulingCalendarView, SchedulingDatePart, SchedulingEntryState, SchedulingLegendItem, SchedulingMarker, SchedulingMarkerEmphasis, SchedulingOverlayKind, SchedulingOverlayPattern, SchedulingStatus } from './components/SchedulingCalendar.js';
|
|
94
|
+
export { LayoutMonthSpansOptions, MonthSpanGroup, MonthSpanInput, MonthSpanLayout, PlacedMonthSpan, itemDaySpan, layoutMonthSpans, schedulingGridDays } from './scheduling-calendar-model.js';
|
|
85
95
|
export { DEFAULT_SCHEDULING_TIMELINE_LABELS, SchedulingTimeline, SchedulingTimelineItem, SchedulingTimelineLabels, SchedulingTimelineLane, SchedulingTimelineMarker, SchedulingTimelineOverlay, SchedulingTimelineOverlayKind, SchedulingTimelineProps } from './components/SchedulingTimeline.js';
|
|
86
96
|
export { DAY, HOUR, PlacedSpan, TimelineRange, TimelineScale, TimelineSpan, TimelineTick, defaultTimelineStep, layoutLane, pixelsToMs, placeSpan, shiftSpan, snapToStep, timelineTicks } from './scheduling-timeline-model.js';
|
|
87
97
|
export { DEFAULT_DATE_RANGE_PICKER_LABELS, DateRangePicker, DateRangePickerLabels, DateRangePickerProps } from './components/DateRangePicker.js';
|
|
88
|
-
export { CalendarDay, CalendarWeekday, DateRangeValue, ZonedDateSpan, addCalendarDays, addCalendarMonths, buildMonthGrid, enumerateDateSpan, isDateInRange, isDateUnavailable, selectRangeDate, startOfMonth, toDateKey, zonedDateKey, zonedDateSpan } from './calendar-model.js';
|
|
98
|
+
export { CalendarDay, CalendarWeekday, DateRangeValue, LaneCluster, LaneInterval, LanePlacement, PackLanesOptions, PackedLanes, ZonedDateSpan, ZonedDayBounds, ZonedDayShift, ZonedDaySpan, ZonedHourSlot, addCalendarDays, addCalendarMonths, addZonedDays, buildMonthGrid, cachedDateTimeFormat, enumerateDateKeys, enumerateDateSpan, isDateInRange, isDateUnavailable, packLanes, rankOverflow, selectRangeDate, startOfMonth, toDateKey, zonedDateKey, zonedDateSpan, zonedDayBounds, zonedDaySpan, zonedHourSlots, zonedTimeOfDay } from './calendar-model.js';
|
|
89
99
|
export { DEFAULT_RELATIONSHIP_GRAPH_LABELS, RelationshipGraph, RelationshipGraphLabels, RelationshipGraphLegendItem, RelationshipGraphProps } from './components/RelationshipGraph.js';
|
|
90
100
|
export { BoundedRelationshipGraph, LayeredColumn, LayeredEdgeClassification, LayeredEdgeKind, LayeredItem, LayeredLayout, LayeredLayoutOptions, LayeredNavigationKey, PositionedRelationshipNode, RelationshipGraphArrow, RelationshipGraphCluster, RelationshipGraphEdge, RelationshipGraphNode, RoutedEdge, boundRelationshipGraph, classifyLayeredEdges, clusterIdFor, layeredNeighbor, layoutLayeredGraph, layoutRelationshipGraph, relationshipNeighbors, traverseRelationshipNode, wrapEdgeLabel } from './relationship-graph-model.js';
|
|
91
101
|
export { DEFAULT_MATCH_REVIEW_LABELS, MatchBulkResult, MatchReview, MatchReviewAction, MatchReviewCandidate, MatchReviewField, MatchReviewLabels, MatchReviewProps } from './components/MatchReview.js';
|
|
@@ -95,6 +105,10 @@ export { LicensePositionBar, LicensePositionBarProps } from './components/Licens
|
|
|
95
105
|
export { AppliedBrandProfileSnapshot, BrandProfile, BrandProfileEditor, BrandProfileEditorLabels, BrandProfileEditorProps, BrandProfileLogo, BrandProfileTypography, BrandProfiles, DEFAULT_BRAND_PROFILE_EDITOR_LABELS, applyBrandProfile, restoreBrandProfile } from './components/BrandProfiles.js';
|
|
96
106
|
export { DEFAULT_DIFF_VIEWER_LABELS, DiffViewer, DiffViewerLabels, DiffViewerProps } from './components/DiffViewer.js';
|
|
97
107
|
export { DiffEntry, DiffKind, DiffResolution, DiffSummary, buildThreeWayDiff, summarizeDiff } from './diff-model.js';
|
|
108
|
+
export { DEFAULT_TEXT_DIFF_LABELS, TextDiff, TextDiffLabels, TextDiffProps } from './components/TextDiff.js';
|
|
109
|
+
export { TextDiffGranularity, TextDiffLine, TextDiffOp, TextDiffOptions, TextDiffResult, TextDiffRow, TextDiffSegment, diffText, diffTokens, textDiffRows, tokenizeText } from './text-diff-model.js';
|
|
98
110
|
export { ColorPicker, ColorPickerLabels, ColorPickerProps, DEFAULT_COLOR_PICKER_LABELS } from './components/ColorPicker.js';
|
|
99
111
|
export { HsvColor, RgbColor, contrastRatio, hexToRgb, hsvToHex, hsvToRgb, meetsContrast, normalizeHex, rgbToHex, rgbToHsv } from './color-model.js';
|
|
112
|
+
export { AttachmentLabels, DEFAULT_ATTACHMENT_LABELS } from './attachment-labels.js';
|
|
113
|
+
export { SelectGroup, SelectOption } from './select-model.js';
|
|
100
114
|
import 'react';
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import { Input, InputGroup } from "./components/Input.js";
|
|
|
11
11
|
import { Combobox } from "./components/Combobox.js";
|
|
12
12
|
import { filterComboboxOptions } from "./combobox-model.js";
|
|
13
13
|
import { SearchSuggest } from "./components/SearchSuggest.js";
|
|
14
|
+
import { EntityPicker, DEFAULT_ENTITY_PICKER_LABELS } from "./components/EntityPicker.js";
|
|
14
15
|
import { searchSegments, foldForSearch } from "./search-suggest-model.js";
|
|
15
16
|
import { Textarea } from "./components/Textarea.js";
|
|
16
17
|
import { Select } from "./components/Select.js";
|
|
@@ -22,7 +23,9 @@ import { Modal } from "./components/Modal.js";
|
|
|
22
23
|
import { ConfirmDialog, Popconfirm, PromptDialog } from "./components/Dialogs.js";
|
|
23
24
|
import { Drawer } from "./components/Drawer.js";
|
|
24
25
|
import { Peek } from "./components/Peek.js";
|
|
26
|
+
import { Lightbox, DEFAULT_LIGHTBOX_LABELS } from "./components/Lightbox.js";
|
|
25
27
|
import { Card, CardLink } from "./components/Card.js";
|
|
28
|
+
import { DashboardGrid, DashboardGridItem, dashboardGridClassName, dashboardGridItemClassName } from "./components/DashboardGrid.js";
|
|
26
29
|
import { Breadcrumbs } from "./components/Breadcrumbs.js";
|
|
27
30
|
import { PageHeader } from "./components/PageHeader.js";
|
|
28
31
|
import { DetailLayout } from "./components/DetailLayout.js";
|
|
@@ -38,8 +41,12 @@ import { Sidebar, SidebarSection, NavItem, NavGroup, SubNavItem } from "./compon
|
|
|
38
41
|
import { StarButton } from "./components/StarButton.js";
|
|
39
42
|
import { CopyButton } from "./components/CopyButton.js";
|
|
40
43
|
import { NavFavourites } from "./components/NavFavourites.js";
|
|
44
|
+
import { FileUpload, DEFAULT_FILE_UPLOAD_LABELS } from "./components/FileUpload.js";
|
|
45
|
+
import { Attachment, AttachmentList, DEFAULT_ATTACHMENT_LABELS } from "./components/Attachment.js";
|
|
46
|
+
import { fileKind, fileMatchesAccept, formatFileSize, partitionFiles } from "./file-model.js";
|
|
41
47
|
import { Alert } from "./components/Alert.js";
|
|
42
48
|
import { Spinner } from "./components/Spinner.js";
|
|
49
|
+
import { Heartbeat, LiveIndicator } from "./components/Heartbeat.js";
|
|
43
50
|
import { Toast, Toaster } from "./components/Toast.js";
|
|
44
51
|
import { toast, createToastStore, createToastApi, TOAST_LEAVE_MS } from "./toast-store.js";
|
|
45
52
|
import {
|
|
@@ -79,12 +86,22 @@ import { SaveStatus, DEFAULT_SAVE_STATUS_LABELS } from "./components/SaveStatus.
|
|
|
79
86
|
import { Composer, ComposerBar } from "./components/Composer.js";
|
|
80
87
|
import { Segmented, SegmentedOption } from "./components/Segmented.js";
|
|
81
88
|
import { ViewMenu, FilterPopover, SavedViewMenu } from "./components/TableControls.js";
|
|
89
|
+
import { FilterEditor, DEFAULT_FILTER_EDITOR_LABELS } from "./components/FilterEditor.js";
|
|
90
|
+
import {
|
|
91
|
+
DEFAULT_FILTER_SUMMARY_LABELS,
|
|
92
|
+
NUMBER_FILTER_OPERATORS,
|
|
93
|
+
TEXT_FILTER_OPERATORS,
|
|
94
|
+
emptyFilterValue,
|
|
95
|
+
isFilterEmpty,
|
|
96
|
+
matchFilterPreset,
|
|
97
|
+
summarizeFilter
|
|
98
|
+
} from "./filter-model.js";
|
|
82
99
|
import { Timeline, TimelineItem } from "./components/Timeline.js";
|
|
83
100
|
import { Pipeline, PipelineStage } from "./components/Pipeline.js";
|
|
84
101
|
import { Flow, FlowNode } from "./components/Flow.js";
|
|
85
102
|
import { Prose, Note } from "./components/Prose.js";
|
|
86
103
|
import { Popover } from "./components/Popover.js";
|
|
87
|
-
import { Menu, MenuItem, MenuGroup, MenuSeparator } from "./components/Menu.js";
|
|
104
|
+
import { Menu, MenuItem, MenuItemRadio, MenuItemCheckbox, MenuRadioGroup, MenuGroup, MenuSeparator } from "./components/Menu.js";
|
|
88
105
|
import { CommandPalette, CommandGroup, CommandItem } from "./components/CommandPalette.js";
|
|
89
106
|
import { Inbox, InboxList, InboxItem, InboxDetail } from "./components/Inbox.js";
|
|
90
107
|
import { Kanban, KanbanColumn, KanbanCard } from "./components/Kanban.js";
|
|
@@ -114,11 +131,15 @@ import {
|
|
|
114
131
|
moveRuleNode,
|
|
115
132
|
removeRuleNode,
|
|
116
133
|
ruleDepth,
|
|
134
|
+
setRuleCombinator,
|
|
117
135
|
summarizeRule,
|
|
118
|
-
validateRuleDefinition
|
|
136
|
+
validateRuleDefinition,
|
|
137
|
+
DEFAULT_RULE_VALIDATION_MESSAGES,
|
|
138
|
+
DEFAULT_RULE_SUMMARY_WORDS
|
|
119
139
|
} from "./rule-builder-model.js";
|
|
120
140
|
import { BuilderCanvas, DEFAULT_BUILDER_CANVAS_LABELS } from "./components/BuilderCanvas.js";
|
|
121
141
|
import { DEFAULT_SCHEDULING_CALENDAR_LABELS, SchedulingCalendar } from "./components/SchedulingCalendar.js";
|
|
142
|
+
import { itemDaySpan, layoutMonthSpans, schedulingGridDays } from "./scheduling-calendar-model.js";
|
|
122
143
|
import { DEFAULT_SCHEDULING_TIMELINE_LABELS, SchedulingTimeline } from "./components/SchedulingTimeline.js";
|
|
123
144
|
import {
|
|
124
145
|
DAY,
|
|
@@ -135,15 +156,24 @@ import { DateRangePicker, DEFAULT_DATE_RANGE_PICKER_LABELS } from "./components/
|
|
|
135
156
|
import {
|
|
136
157
|
addCalendarDays,
|
|
137
158
|
addCalendarMonths,
|
|
159
|
+
addZonedDays,
|
|
138
160
|
buildMonthGrid,
|
|
161
|
+
cachedDateTimeFormat,
|
|
162
|
+
enumerateDateKeys,
|
|
139
163
|
enumerateDateSpan,
|
|
140
164
|
isDateInRange,
|
|
141
165
|
isDateUnavailable,
|
|
166
|
+
packLanes,
|
|
167
|
+
rankOverflow,
|
|
142
168
|
selectRangeDate,
|
|
143
169
|
startOfMonth,
|
|
144
170
|
toDateKey,
|
|
145
171
|
zonedDateKey,
|
|
146
|
-
zonedDateSpan
|
|
172
|
+
zonedDateSpan,
|
|
173
|
+
zonedDayBounds,
|
|
174
|
+
zonedDaySpan,
|
|
175
|
+
zonedHourSlots,
|
|
176
|
+
zonedTimeOfDay
|
|
147
177
|
} from "./calendar-model.js";
|
|
148
178
|
import { RelationshipGraph, DEFAULT_RELATIONSHIP_GRAPH_LABELS } from "./components/RelationshipGraph.js";
|
|
149
179
|
import { boundRelationshipGraph, layoutRelationshipGraph, relationshipNeighbors, traverseRelationshipNode, classifyLayeredEdges, clusterIdFor, layeredNeighbor, layoutLayeredGraph, wrapEdgeLabel } from "./relationship-graph-model.js";
|
|
@@ -154,12 +184,16 @@ import { LicensePositionBar } from "./components/LicensePositionBar.js";
|
|
|
154
184
|
import { BrandProfiles, BrandProfileEditor, DEFAULT_BRAND_PROFILE_EDITOR_LABELS, applyBrandProfile, restoreBrandProfile } from "./components/BrandProfiles.js";
|
|
155
185
|
import { DEFAULT_DIFF_VIEWER_LABELS, DiffViewer } from "./components/DiffViewer.js";
|
|
156
186
|
import { buildThreeWayDiff, summarizeDiff } from "./diff-model.js";
|
|
187
|
+
import { DEFAULT_TEXT_DIFF_LABELS, TextDiff } from "./components/TextDiff.js";
|
|
188
|
+
import { diffText, diffTokens, textDiffRows, tokenizeText } from "./text-diff-model.js";
|
|
157
189
|
import { ColorPicker, DEFAULT_COLOR_PICKER_LABELS } from "./components/ColorPicker.js";
|
|
158
190
|
import { contrastRatio, hexToRgb, hsvToHex, hsvToRgb, meetsContrast, normalizeHex, rgbToHex, rgbToHsv } from "./color-model.js";
|
|
159
191
|
export {
|
|
160
192
|
Alert,
|
|
161
193
|
AppShell,
|
|
162
194
|
AsyncOperationStatus,
|
|
195
|
+
Attachment,
|
|
196
|
+
AttachmentList,
|
|
163
197
|
Avatar,
|
|
164
198
|
AvatarGroup,
|
|
165
199
|
BrandProfileEditor,
|
|
@@ -192,19 +226,30 @@ export {
|
|
|
192
226
|
ContentListItem,
|
|
193
227
|
CopyButton,
|
|
194
228
|
DAY,
|
|
229
|
+
DEFAULT_ATTACHMENT_LABELS,
|
|
195
230
|
DEFAULT_BRAND_PROFILE_EDITOR_LABELS,
|
|
196
231
|
DEFAULT_BUILDER_CANVAS_LABELS,
|
|
197
232
|
DEFAULT_COLOR_PICKER_LABELS,
|
|
198
233
|
DEFAULT_DATE_RANGE_PICKER_LABELS,
|
|
199
234
|
DEFAULT_DIFF_VIEWER_LABELS,
|
|
235
|
+
DEFAULT_ENTITY_PICKER_LABELS,
|
|
236
|
+
DEFAULT_FILE_UPLOAD_LABELS,
|
|
237
|
+
DEFAULT_FILTER_EDITOR_LABELS,
|
|
238
|
+
DEFAULT_FILTER_SUMMARY_LABELS,
|
|
239
|
+
DEFAULT_LIGHTBOX_LABELS,
|
|
200
240
|
DEFAULT_MATCH_REVIEW_LABELS,
|
|
201
241
|
DEFAULT_PAGINATION_LABELS,
|
|
202
242
|
DEFAULT_RELATIONSHIP_GRAPH_LABELS,
|
|
203
243
|
DEFAULT_RULE_BUILDER_LABELS,
|
|
244
|
+
DEFAULT_RULE_SUMMARY_WORDS,
|
|
245
|
+
DEFAULT_RULE_VALIDATION_MESSAGES,
|
|
204
246
|
DEFAULT_SAVE_STATUS_LABELS,
|
|
205
247
|
DEFAULT_SCHEDULING_CALENDAR_LABELS,
|
|
206
248
|
DEFAULT_SCHEDULING_TIMELINE_LABELS,
|
|
207
249
|
DEFAULT_STEP_STATE_LABELS,
|
|
250
|
+
DEFAULT_TEXT_DIFF_LABELS,
|
|
251
|
+
DashboardGrid,
|
|
252
|
+
DashboardGridItem,
|
|
208
253
|
DateRangePicker,
|
|
209
254
|
DescriptionItem,
|
|
210
255
|
DescriptionList,
|
|
@@ -213,6 +258,7 @@ export {
|
|
|
213
258
|
DiffViewer,
|
|
214
259
|
Drawer,
|
|
215
260
|
EmptyState,
|
|
261
|
+
EntityPicker,
|
|
216
262
|
ErrorState,
|
|
217
263
|
EventRow,
|
|
218
264
|
ExpandToggle,
|
|
@@ -220,12 +266,15 @@ export {
|
|
|
220
266
|
FeaturedRundownItem,
|
|
221
267
|
FeaturedStage,
|
|
222
268
|
Field,
|
|
269
|
+
FileUpload,
|
|
270
|
+
FilterEditor,
|
|
223
271
|
FilterPopover,
|
|
224
272
|
FilteredEmptyState,
|
|
225
273
|
Flow,
|
|
226
274
|
FlowNode,
|
|
227
275
|
ForbiddenState,
|
|
228
276
|
HOUR,
|
|
277
|
+
Heartbeat,
|
|
229
278
|
Highlighted,
|
|
230
279
|
Inbox,
|
|
231
280
|
InboxDetail,
|
|
@@ -241,18 +290,24 @@ export {
|
|
|
241
290
|
KbdCombo,
|
|
242
291
|
Label,
|
|
243
292
|
LicensePositionBar,
|
|
293
|
+
Lightbox,
|
|
244
294
|
List,
|
|
245
295
|
ListItem,
|
|
296
|
+
LiveIndicator,
|
|
246
297
|
LoadingState,
|
|
247
298
|
Mark,
|
|
248
299
|
MatchReview,
|
|
249
300
|
Menu,
|
|
250
301
|
MenuGroup,
|
|
251
302
|
MenuItem,
|
|
303
|
+
MenuItemCheckbox,
|
|
304
|
+
MenuItemRadio,
|
|
305
|
+
MenuRadioGroup,
|
|
252
306
|
MenuSeparator,
|
|
253
307
|
Meter,
|
|
254
308
|
MetricInput,
|
|
255
309
|
Modal,
|
|
310
|
+
NUMBER_FILTER_OPERATORS,
|
|
256
311
|
NavFavourites,
|
|
257
312
|
NavGroup,
|
|
258
313
|
NavItem,
|
|
@@ -302,6 +357,7 @@ export {
|
|
|
302
357
|
Steps,
|
|
303
358
|
SubNavItem,
|
|
304
359
|
Switch,
|
|
360
|
+
TEXT_FILTER_OPERATORS,
|
|
305
361
|
TOAST_LEAVE_MS,
|
|
306
362
|
Tab,
|
|
307
363
|
TabPanel,
|
|
@@ -309,6 +365,7 @@ export {
|
|
|
309
365
|
TableWrap,
|
|
310
366
|
Tabs,
|
|
311
367
|
Td,
|
|
368
|
+
TextDiff,
|
|
312
369
|
Textarea,
|
|
313
370
|
Th,
|
|
314
371
|
Timeline,
|
|
@@ -324,11 +381,13 @@ export {
|
|
|
324
381
|
ViewMenu,
|
|
325
382
|
addCalendarDays,
|
|
326
383
|
addCalendarMonths,
|
|
384
|
+
addZonedDays,
|
|
327
385
|
appendRuleNode,
|
|
328
386
|
applyBrandProfile,
|
|
329
387
|
boundRelationshipGraph,
|
|
330
388
|
buildMonthGrid,
|
|
331
389
|
buildThreeWayDiff,
|
|
390
|
+
cachedDateTimeFormat,
|
|
332
391
|
clampMetricValue,
|
|
333
392
|
classifyLayeredEdges,
|
|
334
393
|
clusterIdFor,
|
|
@@ -337,30 +396,46 @@ export {
|
|
|
337
396
|
createToastApi,
|
|
338
397
|
createToastStore,
|
|
339
398
|
cx,
|
|
399
|
+
dashboardGridClassName,
|
|
400
|
+
dashboardGridItemClassName,
|
|
340
401
|
defaultTimelineStep,
|
|
402
|
+
diffText,
|
|
403
|
+
diffTokens,
|
|
404
|
+
emptyFilterValue,
|
|
405
|
+
enumerateDateKeys,
|
|
341
406
|
enumerateDateSpan,
|
|
407
|
+
fileKind,
|
|
408
|
+
fileMatchesAccept,
|
|
342
409
|
filterComboboxOptions,
|
|
343
410
|
findRuleNodeDepth,
|
|
344
411
|
flattenTree,
|
|
345
412
|
foldForSearch,
|
|
413
|
+
formatFileSize,
|
|
346
414
|
hexToRgb,
|
|
347
415
|
hsvToHex,
|
|
348
416
|
hsvToRgb,
|
|
349
417
|
isDateInRange,
|
|
350
418
|
isDateUnavailable,
|
|
419
|
+
isFilterEmpty,
|
|
351
420
|
isRuleGroup,
|
|
421
|
+
itemDaySpan,
|
|
352
422
|
layeredNeighbor,
|
|
353
423
|
layoutLane,
|
|
354
424
|
layoutLayeredGraph,
|
|
425
|
+
layoutMonthSpans,
|
|
355
426
|
layoutRelationshipGraph,
|
|
356
427
|
mapRuleGroup,
|
|
428
|
+
matchFilterPreset,
|
|
357
429
|
meetsContrast,
|
|
358
430
|
moveRuleNode,
|
|
359
431
|
normalizeHex,
|
|
432
|
+
packLanes,
|
|
360
433
|
parseDateValue,
|
|
361
434
|
parseMetricValue,
|
|
435
|
+
partitionFiles,
|
|
362
436
|
pixelsToMs,
|
|
363
437
|
placeSpan,
|
|
438
|
+
rankOverflow,
|
|
364
439
|
relationshipNeighbors,
|
|
365
440
|
relativeTimeValue,
|
|
366
441
|
removeRuleNode,
|
|
@@ -369,17 +444,22 @@ export {
|
|
|
369
444
|
rgbToHex,
|
|
370
445
|
rgbToHsv,
|
|
371
446
|
ruleDepth,
|
|
447
|
+
schedulingGridDays,
|
|
372
448
|
searchSegments,
|
|
373
449
|
selectRangeDate,
|
|
450
|
+
setRuleCombinator,
|
|
374
451
|
shiftSpan,
|
|
375
452
|
snapToStep,
|
|
376
453
|
startOfMonth,
|
|
377
454
|
stepMetricValue,
|
|
378
455
|
summarizeDiff,
|
|
456
|
+
summarizeFilter,
|
|
379
457
|
summarizeRule,
|
|
458
|
+
textDiffRows,
|
|
380
459
|
timelineTicks,
|
|
381
460
|
toDateKey,
|
|
382
461
|
toast,
|
|
462
|
+
tokenizeText,
|
|
383
463
|
traverseRelationshipNode,
|
|
384
464
|
treeNav,
|
|
385
465
|
useAnchoredPosition,
|
|
@@ -390,5 +470,9 @@ export {
|
|
|
390
470
|
validateRuleDefinition,
|
|
391
471
|
wrapEdgeLabel,
|
|
392
472
|
zonedDateKey,
|
|
393
|
-
zonedDateSpan
|
|
473
|
+
zonedDateSpan,
|
|
474
|
+
zonedDayBounds,
|
|
475
|
+
zonedDaySpan,
|
|
476
|
+
zonedHourSlots,
|
|
477
|
+
zonedTimeOfDay
|
|
394
478
|
};
|
package/dist/labels-context.d.ts
CHANGED
|
@@ -4,9 +4,23 @@ import { PaginationLabels } from './components/Pagination.js';
|
|
|
4
4
|
import { SchedulingCalendarLabels } from './components/SchedulingCalendar.js';
|
|
5
5
|
import { DateRangePickerLabels } from './components/DateRangePicker.js';
|
|
6
6
|
import { SchedulingTimelineLabels } from './components/SchedulingTimeline.js';
|
|
7
|
+
import { TextDiffLabels } from './components/TextDiff.js';
|
|
8
|
+
import { FilterEditorLabels } from './components/FilterEditor.js';
|
|
9
|
+
import { SelectLabels } from './components/Select.js';
|
|
10
|
+
import { RuleBuilderLabels } from './components/RuleBuilder.js';
|
|
11
|
+
import { FileUploadLabels } from './components/FileUpload.js';
|
|
12
|
+
import { AttachmentLabels } from './attachment-labels.js';
|
|
7
13
|
import './link.js';
|
|
8
14
|
import './calendar-model.js';
|
|
15
|
+
import './scheduling-calendar-model.js';
|
|
9
16
|
import './scheduling-timeline-model.js';
|
|
17
|
+
import './text-diff-model.js';
|
|
18
|
+
import './filter-model.js';
|
|
19
|
+
import './overlay-position.js';
|
|
20
|
+
import './select-model.js';
|
|
21
|
+
import './json-value.js';
|
|
22
|
+
import './rule-builder-model.js';
|
|
23
|
+
import './file-model.js';
|
|
10
24
|
|
|
11
25
|
/**
|
|
12
26
|
* Kit chrome strings by component (HAR-1358; TENSOR C20, MOTUS executive summary #3).
|
|
@@ -56,6 +70,20 @@ interface UixLabels {
|
|
|
56
70
|
schedulingCalendar?: Partial<SchedulingCalendarLabels>;
|
|
57
71
|
dateRangePicker?: Partial<DateRangePickerLabels>;
|
|
58
72
|
schedulingTimeline?: Partial<SchedulingTimelineLabels>;
|
|
73
|
+
textDiff?: Partial<TextDiffLabels>;
|
|
74
|
+
filterEditor?: Partial<FilterEditorLabels>;
|
|
75
|
+
select?: Partial<SelectLabels>;
|
|
76
|
+
ruleBuilder?: Partial<RuleBuilderLabels>;
|
|
77
|
+
fileUpload?: Partial<FileUploadLabels>;
|
|
78
|
+
attachment?: Partial<AttachmentLabels>;
|
|
79
|
+
/** `remove`: the name of a removable chip's × button; `{label}` is the chip text. */
|
|
80
|
+
chip?: {
|
|
81
|
+
remove?: string;
|
|
82
|
+
};
|
|
83
|
+
/** `dismiss`: the name of a dismissible alert's × button. */
|
|
84
|
+
alert?: {
|
|
85
|
+
dismiss?: string;
|
|
86
|
+
};
|
|
59
87
|
/** Read by `useUixLabels()` callers; `Pagination` itself is server-safe and takes `labels`. */
|
|
60
88
|
pagination?: Partial<PaginationLabels>;
|
|
61
89
|
/** Read by `useUixLabels()` callers; `BulkBar` itself is server-safe and takes `label`. */
|
|
@@ -39,6 +39,13 @@ interface PositionOptions {
|
|
|
39
39
|
flip?: boolean;
|
|
40
40
|
/** Slide along the cross axis to stay on-screen. Default true. */
|
|
41
41
|
shift?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Also keep the element inside the viewport on the main axis (the side it hangs off) when it
|
|
44
|
+
* fits on neither side; it then covers part of the anchor instead of leaving the viewport.
|
|
45
|
+
* Not applied once the anchor itself is outside the viewport on that axis: the element then
|
|
46
|
+
* follows its anchor out, as an element that fits does. Default true.
|
|
47
|
+
*/
|
|
48
|
+
shiftMainAxis?: boolean;
|
|
42
49
|
/**
|
|
43
50
|
* The side the element is already on, while it stays open. It is kept unless it no longer
|
|
44
51
|
* fits AND the opposite side does, so a size change or a small scroll never flips an open
|
|
@@ -56,6 +63,19 @@ interface PositionResult {
|
|
|
56
63
|
placement: Placement;
|
|
57
64
|
side: Side;
|
|
58
65
|
align: Align;
|
|
66
|
+
/**
|
|
67
|
+
* The main-axis coordinate (`y` for top/bottom, `x` for left/right) before the main-axis
|
|
68
|
+
* shift: flush against the anchor. Equal to `y` / `x` when nothing was shifted.
|
|
69
|
+
*/
|
|
70
|
+
mainAxisNatural: number;
|
|
71
|
+
/**
|
|
72
|
+
* The `[min, max]` the main-axis coordinate is kept in, or `null` when the main-axis shift is
|
|
73
|
+
* off or the anchor has left the viewport. `min === max` for an element larger than the
|
|
74
|
+
* viewport: it starts at the padding and has to be capped or scrolled.
|
|
75
|
+
*/
|
|
76
|
+
mainAxisRange: [number, number] | null;
|
|
77
|
+
/** Largest size that fits the viewport inside the padding: the cap for an oversized element. */
|
|
78
|
+
available: Size;
|
|
59
79
|
}
|
|
60
80
|
/**
|
|
61
81
|
* Compute the floating element's viewport-space position anchored to `anchor`.
|
|
@@ -39,6 +39,13 @@ interface PositionOptions {
|
|
|
39
39
|
flip?: boolean;
|
|
40
40
|
/** Slide along the cross axis to stay on-screen. Default true. */
|
|
41
41
|
shift?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Also keep the element inside the viewport on the main axis (the side it hangs off) when it
|
|
44
|
+
* fits on neither side; it then covers part of the anchor instead of leaving the viewport.
|
|
45
|
+
* Not applied once the anchor itself is outside the viewport on that axis: the element then
|
|
46
|
+
* follows its anchor out, as an element that fits does. Default true.
|
|
47
|
+
*/
|
|
48
|
+
shiftMainAxis?: boolean;
|
|
42
49
|
/**
|
|
43
50
|
* The side the element is already on, while it stays open. It is kept unless it no longer
|
|
44
51
|
* fits AND the opposite side does, so a size change or a small scroll never flips an open
|
|
@@ -56,6 +63,19 @@ interface PositionResult {
|
|
|
56
63
|
placement: Placement;
|
|
57
64
|
side: Side;
|
|
58
65
|
align: Align;
|
|
66
|
+
/**
|
|
67
|
+
* The main-axis coordinate (`y` for top/bottom, `x` for left/right) before the main-axis
|
|
68
|
+
* shift: flush against the anchor. Equal to `y` / `x` when nothing was shifted.
|
|
69
|
+
*/
|
|
70
|
+
mainAxisNatural: number;
|
|
71
|
+
/**
|
|
72
|
+
* The `[min, max]` the main-axis coordinate is kept in, or `null` when the main-axis shift is
|
|
73
|
+
* off or the anchor has left the viewport. `min === max` for an element larger than the
|
|
74
|
+
* viewport: it starts at the padding and has to be capped or scrolled.
|
|
75
|
+
*/
|
|
76
|
+
mainAxisRange: [number, number] | null;
|
|
77
|
+
/** Largest size that fits the viewport inside the padding: the cap for an oversized element. */
|
|
78
|
+
available: Size;
|
|
59
79
|
}
|
|
60
80
|
/**
|
|
61
81
|
* Compute the floating element's viewport-space position anchored to `anchor`.
|
package/dist/overlay-position.js
CHANGED
|
@@ -21,7 +21,7 @@ function fitsOn(side, a, f, vp, offset, padding) {
|
|
|
21
21
|
return spaceOn(side, a, vp, offset) >= need + padding;
|
|
22
22
|
}
|
|
23
23
|
function computePosition(anchor, floating, viewport, options = {}) {
|
|
24
|
-
const { placement = "bottom-start", offset = 6, padding = 8, flip = true, shift = true, stickySide } = options;
|
|
24
|
+
const { placement = "bottom-start", offset = 6, padding = 8, flip = true, shift = true, shiftMainAxis = true, stickySide } = options;
|
|
25
25
|
const { side: preferred, align } = parsePlacement(placement);
|
|
26
26
|
let side = preferred;
|
|
27
27
|
const sticky = stickySide === preferred || stickySide === OPPOSITE[preferred] ? stickySide : void 0;
|
|
@@ -54,12 +54,27 @@ function computePosition(anchor, floating, viewport, options = {}) {
|
|
|
54
54
|
y = align === "start" ? start : align === "end" ? end : center;
|
|
55
55
|
if (shift) y = clamp(y, padding, Math.max(padding, viewport.height - floating.height - padding));
|
|
56
56
|
}
|
|
57
|
+
const mainAxisNatural = horizontal ? y : x;
|
|
58
|
+
const anchorInView = horizontal ? anchor.y + anchor.height > 0 && anchor.y < viewport.height : anchor.x + anchor.width > 0 && anchor.x < viewport.width;
|
|
59
|
+
let mainAxisRange = null;
|
|
60
|
+
if (shiftMainAxis && anchorInView) {
|
|
61
|
+
const extent = horizontal ? viewport.height - floating.height : viewport.width - floating.width;
|
|
62
|
+
mainAxisRange = [padding, Math.max(padding, extent - padding)];
|
|
63
|
+
if (horizontal) y = clamp(y, mainAxisRange[0], mainAxisRange[1]);
|
|
64
|
+
else x = clamp(x, mainAxisRange[0], mainAxisRange[1]);
|
|
65
|
+
}
|
|
57
66
|
return {
|
|
58
67
|
x,
|
|
59
68
|
y,
|
|
60
69
|
placement: align === "center" ? side : `${side}-${align}`,
|
|
61
70
|
side,
|
|
62
|
-
align
|
|
71
|
+
align,
|
|
72
|
+
mainAxisNatural,
|
|
73
|
+
mainAxisRange,
|
|
74
|
+
available: {
|
|
75
|
+
width: Math.max(0, viewport.width - 2 * padding),
|
|
76
|
+
height: Math.max(0, viewport.height - 2 * padding)
|
|
77
|
+
}
|
|
63
78
|
};
|
|
64
79
|
}
|
|
65
80
|
export {
|