@alexgorbatchev/shadcn 0.0.77 → 0.0.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-f7cczxya.js → chunk-0vr1f5fz.js} +3 -3
- package/dist/{chunk-2b5f37wj.js → chunk-1bs147rq.js} +1 -1
- package/dist/{chunk-fnqc1181.js → chunk-1ddvvmq7.js} +1 -1
- package/dist/{chunk-z15pn5a5.js → chunk-1fsk8f1v.js} +1 -1
- package/dist/{chunk-ghv4vcae.js → chunk-1qs5ngkg.js} +1 -1
- package/dist/{chunk-qrjxx1x9.js → chunk-22pzx7jn.js} +1 -1
- package/dist/{chunk-65xd5we6.js → chunk-25g7d9m7.js} +1 -1
- package/dist/{chunk-mc0788ah.js → chunk-25v1djy5.js} +1 -1
- package/dist/{chunk-q3jmy8bv.js → chunk-29xw11s7.js} +4 -4
- package/dist/{chunk-fp4dkem8.js → chunk-2sx5jnyv.js} +1 -1
- package/dist/{chunk-11m1mwv4.js → chunk-2v71wpyj.js} +1 -1
- package/dist/{chunk-bd09gygt.js → chunk-32t5kc0y.js} +1 -1
- package/dist/{chunk-y2dn791x.js → chunk-3b5v59mq.js} +3 -3
- package/dist/{chunk-a3n2jee5.js → chunk-3cm4n98p.js} +1 -1
- package/dist/{chunk-g5dzh9rr.js → chunk-3gvahjbe.js} +1 -1
- package/dist/{chunk-h7zgbreq.js → chunk-3hef9n5h.js} +1 -1
- package/dist/{chunk-nay3qsgw.js → chunk-3kspw545.js} +1 -1
- package/dist/{chunk-51t02gb9.js → chunk-3x6nhpgy.js} +1 -1
- package/dist/{chunk-sqz2901w.js → chunk-45zrx7ya.js} +1 -1
- package/dist/{chunk-v0bv70xv.js → chunk-4ak25cx4.js} +2 -2
- package/dist/{chunk-rxjxb4vy.js → chunk-4j3fsft3.js} +1 -1
- package/dist/{chunk-06ky09dc.js → chunk-4p4vggpr.js} +2 -2
- package/dist/{chunk-v2wx2fz4.js → chunk-4szrp20a.js} +1 -1
- package/dist/{chunk-vazxcmjt.js → chunk-5ct9625h.js} +1 -1
- package/dist/{chunk-424xrf3x.js → chunk-5gvjy8cn.js} +1 -1
- package/dist/{chunk-qybhnw0w.js → chunk-5jtbr6q4.js} +2 -2
- package/dist/{chunk-nt4jdzh2.js → chunk-5rzhnmv6.js} +2 -2
- package/dist/{chunk-hf4prmk6.js → chunk-67s02cfw.js} +1 -1
- package/dist/{chunk-nj1sgtss.js → chunk-6cz8cr21.js} +1 -1
- package/dist/{chunk-bv2bar22.js → chunk-6em6sp6y.js} +1 -1
- package/dist/{chunk-vrreeywg.js → chunk-6nhv1vq5.js} +1 -1
- package/dist/{chunk-9yjrw75r.js → chunk-77zbd22x.js} +8 -8
- package/dist/{chunk-yxwtpq9d.js → chunk-84ezpzmn.js} +1 -1
- package/dist/{chunk-yeht7bxz.js → chunk-85c1dxtm.js} +1 -1
- package/dist/{chunk-wh8gdhc7.js → chunk-8fk1cene.js} +1 -1
- package/dist/{chunk-m37eyydy.js → chunk-8yxf21e9.js} +1 -1
- package/dist/{chunk-2fxzw0xc.js → chunk-93ynz1wv.js} +1 -1
- package/dist/{chunk-x805mg9x.js → chunk-98jw2c75.js} +1 -1
- package/dist/{chunk-rpsf1cph.js → chunk-9zx5b34m.js} +1 -1
- package/dist/{chunk-c94nwxaf.js → chunk-a2mepxnb.js} +1 -1
- package/dist/{chunk-gg37cyfd.js → chunk-atxtdj7a.js} +1 -1
- package/dist/{chunk-0jz2mp48.js → chunk-b805vc70.js} +1 -1
- package/dist/{chunk-x0212x2e.js → chunk-bbzbnwz9.js} +1 -1
- package/dist/{chunk-70rxgqd7.js → chunk-bz0erpea.js} +2 -2
- package/dist/{chunk-50ykf6dc.js → chunk-c1yg3z68.js} +1 -1
- package/dist/{chunk-1k2g7rpj.js → chunk-c4ck7g88.js} +1 -1
- package/dist/{chunk-8b4gq4xb.js → chunk-cc3wzmev.js} +1 -1
- package/dist/{chunk-t5e0s8q6.js → chunk-cc59cf5a.js} +1 -1
- package/dist/{chunk-4zm4dn1a.js → chunk-cvg1bn5z.js} +1 -1
- package/dist/{chunk-5wk6h8rc.js → chunk-d1vxr8ek.js} +1 -1
- package/dist/{chunk-ps59anjd.js → chunk-e12mbz2h.js} +1 -1
- package/dist/{chunk-v2bbs7s8.js → chunk-f3r6gdhh.js} +1 -1
- package/dist/{chunk-vq9yw85z.js → chunk-fatsqayy.js} +1 -1
- package/dist/{chunk-1f6p05qh.js → chunk-fe33dx54.js} +1 -1
- package/dist/{chunk-3kw3nft7.js → chunk-fhjv1twk.js} +2 -2
- package/dist/{chunk-z0z9p92d.js → chunk-fpexqbj4.js} +2 -2
- package/dist/{chunk-nk53z990.js → chunk-gbn9rt3w.js} +1 -1
- package/dist/{chunk-zdp3bb9e.js → chunk-gc08g76v.js} +1 -1
- package/dist/{chunk-ga3h6738.js → chunk-gfrg1484.js} +1 -1
- package/dist/{chunk-8t11333k.js → chunk-ghfmc1t4.js} +1 -1
- package/dist/{chunk-336c0c3z.js → chunk-hn4se2j1.js} +3 -3
- package/dist/{chunk-jbrt06va.js → chunk-hypedq7q.js} +1 -1
- package/dist/{chunk-s3r5g3md.js → chunk-j3snybeg.js} +1 -1
- package/dist/{chunk-ee098znw.js → chunk-jet31v57.js} +1 -1
- package/dist/{chunk-s2f3zzbb.js → chunk-jhqb6z35.js} +1 -1
- package/dist/{chunk-3gxptxxs.js → chunk-jstcq6j1.js} +1 -1
- package/dist/{chunk-zmygyj8h.js → chunk-k1428vt3.js} +2 -2
- package/dist/{chunk-h9tjva8p.js → chunk-k82ncbmy.js} +1 -1
- package/dist/{chunk-31wptjv4.js → chunk-kmqx7c48.js} +2 -2
- package/dist/{chunk-y18e8eaz.js → chunk-kq3348h4.js} +2 -2
- package/dist/{chunk-kxvn3eae.js → chunk-kqtsvprx.js} +1 -1
- package/dist/{chunk-rzd306rr.js → chunk-kt1ra60a.js} +2 -2
- package/dist/{chunk-032fn19y.js → chunk-m43ybcxv.js} +2 -2
- package/dist/{chunk-zrgacdwr.js → chunk-m8ky82vb.js} +1 -1
- package/dist/{chunk-r6bwsyxy.js → chunk-mc8a4r50.js} +1 -1
- package/dist/{chunk-d1zj7xk2.js → chunk-nfffwr34.js} +1 -1
- package/dist/{chunk-2z53taz1.js → chunk-nkh5ghr0.js} +1 -1
- package/dist/{chunk-58cpjhsr.js → chunk-nqgpzqmk.js} +1 -1
- package/dist/{chunk-wzgnj3s7.js → chunk-nssz3p32.js} +3 -3
- package/dist/{chunk-tw8f1ew4.js → chunk-nttvd66y.js} +1 -1
- package/dist/{chunk-ya4v4p8k.js → chunk-nyq9y0bg.js} +1 -1
- package/dist/{chunk-zz072pjn.js → chunk-nz2exxhn.js} +1 -1
- package/dist/{chunk-an661kn2.js → chunk-p2df6hpx.js} +2 -2
- package/dist/{chunk-c3e28a4k.js → chunk-px6bcbj3.js} +1 -1
- package/dist/{chunk-ptdr68cq.js → chunk-q0qa9d0w.js} +2 -2
- package/dist/{chunk-hkqjfk9w.js → chunk-qa0j0v26.js} +2 -2
- package/dist/{chunk-6bsys2p8.js → chunk-qddmszcp.js} +1 -1
- package/dist/{chunk-bxzbrzbb.js → chunk-qf7zm619.js} +1 -1
- package/dist/{chunk-3rjm30tj.js → chunk-qhtbsdcg.js} +1 -1
- package/dist/{chunk-k1jr6r51.js → chunk-qq7brjez.js} +4 -4
- package/dist/{chunk-8w8mnk5h.js → chunk-r1qyx0ke.js} +1 -1
- package/dist/{chunk-rs5xh8wa.js → chunk-r73tntkx.js} +3 -3
- package/dist/{chunk-vxazk4y0.js → chunk-r9fz7vr5.js} +1 -1
- package/dist/{chunk-4143tbd7.js → chunk-rfvzwbja.js} +1 -1
- package/dist/{chunk-5pgk9qar.js → chunk-rjy17qmh.js} +1 -1
- package/dist/{chunk-nfbxyvht.js → chunk-rz1tcez4.js} +1 -1
- package/dist/{chunk-ha7g0gt2.js → chunk-sjy1347w.js} +1 -1
- package/dist/{chunk-k45r2rz0.js → chunk-t0t1c3a7.js} +1 -1
- package/dist/{chunk-t18hedpv.js → chunk-t3skf9ty.js} +1 -1
- package/dist/{chunk-4t23yhc0.js → chunk-t6gbcj27.js} +1 -1
- package/dist/{chunk-10bcpsft.js → chunk-t75anqyy.js} +1 -1
- package/dist/{chunk-6gmarxhb.js → chunk-tk0w0tf7.js} +1 -1
- package/dist/{chunk-d8vf8j23.js → chunk-tmt6rwg1.js} +5 -3
- package/dist/{chunk-cjx1ry29.js → chunk-vf5tw7dk.js} +2 -2
- package/dist/{chunk-mxcfz56p.js → chunk-vh5r4agk.js} +1 -1
- package/dist/{chunk-fvg6symh.js → chunk-vr6xc6zs.js} +1 -1
- package/dist/{chunk-8vw7ycbs.js → chunk-w8r9a9zd.js} +1 -1
- package/dist/{chunk-da67wbm4.js → chunk-wg3g8pyt.js} +1 -1
- package/dist/{chunk-78ntbpa4.js → chunk-wncennvw.js} +1 -1
- package/dist/{chunk-qnf643p0.js → chunk-wxw0v3pe.js} +2 -2
- package/dist/{chunk-7srpghny.js → chunk-x6ed6smh.js} +1 -1
- package/dist/{chunk-bgvjmnst.js → chunk-x9epw740.js} +1 -1
- package/dist/{chunk-6j8ksqt9.js → chunk-xe4hy1wj.js} +1 -1
- package/dist/{chunk-3gc5n7dc.js → chunk-xfz7r7dk.js} +1 -1
- package/dist/{chunk-05x7avd1.js → chunk-xhq6s4z7.js} +3 -3
- package/dist/{chunk-f63kp4af.js → chunk-xn9m76jt.js} +1 -1
- package/dist/{chunk-k53g3c99.js → chunk-ya14cv0r.js} +2 -2
- package/dist/{chunk-6eseyyv3.js → chunk-ybnwwsvj.js} +1 -1
- package/dist/{chunk-j2zxqzta.js → chunk-ybsr621k.js} +1 -1
- package/dist/{chunk-jswxzynj.js → chunk-ydz0pe6z.js} +2 -2
- package/dist/{chunk-074ehhx1.js → chunk-yeh4zh4b.js} +1 -1
- package/dist/{chunk-dq2s4vwc.js → chunk-yg5ft104.js} +1 -1
- package/dist/{chunk-bshdrjwh.js → chunk-ygmp2qax.js} +8 -8
- package/dist/{chunk-5tag5wg4.js → chunk-ygpagrh1.js} +2 -2
- package/dist/{chunk-1wrsg75m.js → chunk-yjxhbka1.js} +1 -1
- package/dist/{chunk-jhpeb72r.js → chunk-zd8553p5.js} +1 -1
- package/dist/{chunk-ab932mya.js → chunk-zg6fvfj4.js} +1 -1
- package/dist/{chunk-pv379mp6.js → chunk-zmddc9cd.js} +1 -1
- package/dist/components/assistant-ui/elements/AgentCard.js +2 -2
- package/dist/components/assistant-ui/elements/ApprovalCard.js +2 -2
- package/dist/components/assistant-ui/elements/ArtifactCard.js +2 -2
- package/dist/components/assistant-ui/elements/AudioPlayer.js +2 -2
- package/dist/components/assistant-ui/elements/BackgroundInbox.js +2 -2
- package/dist/components/assistant-ui/elements/CanvasSplit.js +2 -2
- package/dist/components/assistant-ui/elements/ChatPanel.js +3 -3
- package/dist/components/assistant-ui/elements/CheckpointHistory.js +2 -2
- package/dist/components/assistant-ui/elements/Citation.js +2 -2
- package/dist/components/assistant-ui/elements/CodeRunner.js +2 -2
- package/dist/components/assistant-ui/elements/CommandPalette.js +5 -5
- package/dist/components/assistant-ui/elements/ComposerAttachButton.js +2 -2
- package/dist/components/assistant-ui/elements/ComposerAttachmentChip.js +2 -2
- package/dist/components/assistant-ui/elements/ComposerAttachments.js +3 -3
- package/dist/components/assistant-ui/elements/ComposerBar.js +3 -3
- package/dist/components/assistant-ui/elements/ComposerCommandItem.js +3 -3
- package/dist/components/assistant-ui/elements/ComposerContext.js +2 -2
- package/dist/components/assistant-ui/elements/ComposerInput.js +3 -3
- package/dist/components/assistant-ui/elements/ComposerMenuItem.js +2 -2
- package/dist/components/assistant-ui/elements/ComposerModelItem.js +3 -3
- package/dist/components/assistant-ui/elements/ComposerModelTrigger.js +2 -2
- package/dist/components/assistant-ui/elements/ComposerPersonItem.js +3 -3
- package/dist/components/assistant-ui/elements/ComposerSend.js +2 -2
- package/dist/components/assistant-ui/elements/ComposerToolbar.js +3 -3
- package/dist/components/assistant-ui/elements/ComposerVoiceButton.js +2 -2
- package/dist/components/assistant-ui/elements/ConnectionState.js +2 -2
- package/dist/components/assistant-ui/elements/ConversationSearch.js +3 -3
- package/dist/components/assistant-ui/elements/DataTable.js +3 -3
- package/dist/components/assistant-ui/elements/Diagram.js +2 -2
- package/dist/components/assistant-ui/elements/DiffViewer.js +3 -3
- package/dist/components/assistant-ui/elements/DiffViewerHeader.js +2 -2
- package/dist/components/assistant-ui/elements/DocumentReference.js +2 -2
- package/dist/components/assistant-ui/elements/DraftRestore.js +2 -2
- package/dist/components/assistant-ui/elements/EditMessage.js +2 -2
- package/dist/components/assistant-ui/elements/ElicitationForm.js +2 -2
- package/dist/components/assistant-ui/elements/EmptyStateComposer.js +3 -3
- package/dist/components/assistant-ui/elements/EmptyStateSuggestion.js +2 -2
- package/dist/components/assistant-ui/elements/ErrorState.js +2 -2
- package/dist/components/assistant-ui/elements/EveAskQuestion.js +3 -3
- package/dist/components/assistant-ui/elements/FeedbackDialog.js +2 -2
- package/dist/components/assistant-ui/elements/File.js +3 -3
- package/dist/components/assistant-ui/elements/GenerativeUi.js +6 -6
- package/dist/components/assistant-ui/elements/GeoMap.js +2 -2
- package/dist/components/assistant-ui/elements/GuardrailNotice.js +2 -2
- package/dist/components/assistant-ui/elements/Image.js +3 -3
- package/dist/components/assistant-ui/elements/ImageGallery.js +3 -3
- package/dist/components/assistant-ui/elements/ImageGeneration.js +2 -2
- package/dist/components/assistant-ui/elements/JobProgress.js +2 -2
- package/dist/components/assistant-ui/elements/LauncherBubble.js +2 -2
- package/dist/components/assistant-ui/elements/MapAnswer.js +2 -2
- package/dist/components/assistant-ui/elements/MarkdownText.js +3 -3
- package/dist/components/assistant-ui/elements/McpServerPanel.js +2 -2
- package/dist/components/assistant-ui/elements/MemoryChips.js +2 -2
- package/dist/components/assistant-ui/elements/MermaidDiagram.js +4 -4
- package/dist/components/assistant-ui/elements/MermaidZoom.js +3 -3
- package/dist/components/assistant-ui/elements/MessageActions.js +2 -2
- package/dist/components/assistant-ui/elements/MessageAttachments.js +2 -2
- package/dist/components/assistant-ui/elements/MessageBranches.js +2 -2
- package/dist/components/assistant-ui/elements/MessagePair.js +2 -2
- package/dist/components/assistant-ui/elements/MessageQueue.js +2 -2
- package/dist/components/assistant-ui/elements/MobileComposer.js +3 -3
- package/dist/components/assistant-ui/elements/ModelSelector.js +11 -11
- package/dist/components/assistant-ui/elements/ModelSelectorContent.js +10 -10
- package/dist/components/assistant-ui/elements/ModelSelectorEmpty.js +5 -5
- package/dist/components/assistant-ui/elements/ModelSelectorFocusAnchor.js +5 -5
- package/dist/components/assistant-ui/elements/ModelSelectorGroup.js +5 -5
- package/dist/components/assistant-ui/elements/ModelSelectorItem.js +5 -5
- package/dist/components/assistant-ui/elements/ModelSelectorList.js +7 -7
- package/dist/components/assistant-ui/elements/ModelSelectorSearch.js +5 -5
- package/dist/components/assistant-ui/elements/ModelSelectorSeparator.js +5 -5
- package/dist/components/assistant-ui/elements/Onboarding.js +2 -2
- package/dist/components/assistant-ui/elements/OptionList.js +2 -2
- package/dist/components/assistant-ui/elements/PermissionGrant.js +2 -2
- package/dist/components/assistant-ui/elements/PromptLibrary.js +3 -3
- package/dist/components/assistant-ui/elements/QuestionFlow.js +3 -3
- package/dist/components/assistant-ui/elements/QuotaBanner.js +2 -2
- package/dist/components/assistant-ui/elements/QuoteReply.js +2 -2
- package/dist/components/assistant-ui/elements/ReadAloud.js +2 -2
- package/dist/components/assistant-ui/elements/RecommendationCard.js +2 -2
- package/dist/components/assistant-ui/elements/RegenerateMenu.js +2 -2
- package/dist/components/assistant-ui/elements/ReviewableDiff.js +2 -2
- package/dist/components/assistant-ui/elements/SettingsPanel.js +2 -2
- package/dist/components/assistant-ui/elements/SharedConversation.js +2 -2
- package/dist/components/assistant-ui/elements/StoppedRun.js +2 -2
- package/dist/components/assistant-ui/elements/Suggestions.js +2 -2
- package/dist/components/assistant-ui/elements/TaskCard.js +2 -2
- package/dist/components/assistant-ui/elements/TerminalBlock.js +2 -2
- package/dist/components/assistant-ui/elements/ThreadList.js +2 -2
- package/dist/components/assistant-ui/elements/ThreadSearch.js +3 -3
- package/dist/components/assistant-ui/elements/TodoList.js +2 -2
- package/dist/components/assistant-ui/elements/ToolError.js +2 -2
- package/dist/components/assistant-ui/elements/ToolGroup.js +2 -2
- package/dist/components/assistant-ui/elements/TooltipIconButton.js +2 -2
- package/dist/components/assistant-ui/elements/VoiceConversation.js +2 -2
- package/dist/components/assistant-ui/elements/WebPreview.js +2 -2
- package/dist/components/assistant-ui/eveAskQuestionToolkit.js +4 -4
- package/dist/components/assistant-ui/index.js +102 -102
- package/dist/components/assistant-ui/native/AssistantModal.js +13 -13
- package/dist/components/assistant-ui/native/AssistantSidebar.js +12 -12
- package/dist/components/assistant-ui/native/AttachmentPreview.js +4 -4
- package/dist/components/assistant-ui/native/McpConfigDialog.js +3 -3
- package/dist/components/assistant-ui/native/MermaidDiagram.js +5 -5
- package/dist/components/assistant-ui/native/ModelSelector.js +13 -13
- package/dist/components/assistant-ui/native/Reasoning.js +4 -4
- package/dist/components/assistant-ui/native/TaskCard.js +6 -6
- package/dist/components/assistant-ui/native/TaskGroup.js +7 -7
- package/dist/components/assistant-ui/native/Thread.js +11 -11
- package/dist/components/assistant-ui/native/ThreadList.js +2 -2
- package/dist/components/assistant-ui/native/ThreadListSidebar.js +4 -4
- package/dist/components/assistant-ui/native/ToolFallbackRoot.js +2 -2
- package/dist/components/assistant-ui/native/VoiceConnectButton.js +2 -2
- package/dist/components/assistant-ui/native/VoiceControl.js +6 -6
- package/dist/components/assistant-ui/native/VoiceConversation.js +3 -3
- package/dist/components/assistant-ui/native/VoiceDisconnectButton.js +3 -3
- package/dist/components/assistant-ui/native/VoiceMuteButton.js +3 -3
- package/dist/components/assistant-ui/native/index.js +40 -40
- package/dist/components/calendar/index.js +2 -2
- package/dist/components/carousel/index.js +2 -2
- package/dist/components/command/index.js +4 -4
- package/dist/components/data-grid/index.js +5 -5
- package/dist/components/editor/index.js +2 -2
- package/dist/components/event-calendar/index.js +1 -1
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/gantt/index.js +3 -3
- package/dist/components/image-viewer/index.js +1 -1
- package/dist/components/input-otp/index.js +1 -1
- package/dist/components/json-render/index.js +10 -10
- package/dist/components/message-scroller/index.js +1 -1
- package/dist/components/persian-calendar/index.js +2 -2
- package/dist/components/questionnaire/index.js +1 -1
- package/dist/components/sonner/index.js +1 -1
- package/dist/components/tree/index.js +1 -1
- package/dist/components/virtual-data-grid/VirtualDataGrid.d.ts +20 -3
- package/dist/components/virtual-data-grid/getDataGridCursorTarget.d.ts +6 -0
- package/dist/components/virtual-data-grid/getDataGridRowRange.d.ts +2 -0
- package/dist/components/virtual-data-grid/hooks/useDataGridRowCursor.d.ts +10 -0
- package/dist/components/virtual-data-grid/index.d.ts +3 -0
- package/dist/components/virtual-data-grid/index.js +233 -9
- package/dist/components/virtual-data-grid/types.d.ts +70 -0
- package/dist/components/virtual-table/VirtualTable.d.ts +6 -1
- package/dist/components/virtual-table/index.js +2 -2
- package/dist/index.js +9 -9
- package/dist/prototype.js +1 -1
- package/dist/theme.css +3 -0
- package/llms/components/actions/Button.md +11 -0
- package/llms/components/data-display/Table.md +6 -0
- package/llms/components/data-display/VirtualDataGrid.md +35 -0
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
DataGridColumnHeader2,
|
|
8
8
|
DataGridFilter2,
|
|
9
9
|
DataGridPagination2
|
|
10
|
-
} from "../../chunk-
|
|
10
|
+
} from "../../chunk-5jtbr6q4.js";
|
|
11
11
|
import"../../chunk-7ny0vyek.js";
|
|
12
12
|
import"../../chunk-8ssktt4b.js";
|
|
13
13
|
import"../../chunk-en44w1pn.js";
|
|
@@ -16,8 +16,8 @@ import"../../chunk-x90xmrba.js";
|
|
|
16
16
|
import"../../chunk-jpvw9xqy.js";
|
|
17
17
|
import {
|
|
18
18
|
Button2
|
|
19
|
-
} from "../../chunk-
|
|
20
|
-
import"../../chunk-
|
|
19
|
+
} from "../../chunk-32t5kc0y.js";
|
|
20
|
+
import"../../chunk-xhq6s4z7.js";
|
|
21
21
|
import"../../chunk-p6z2m3zp.js";
|
|
22
22
|
import"../../chunk-7jpsybag.js";
|
|
23
23
|
import"../../chunk-7vg045gd.js";
|
|
@@ -49,12 +49,12 @@ import {
|
|
|
49
49
|
NumberField2,
|
|
50
50
|
NumberFieldGroup2,
|
|
51
51
|
NumberFieldInput2
|
|
52
|
-
} from "../../chunk-
|
|
52
|
+
} from "../../chunk-kmqx7c48.js";
|
|
53
53
|
import {
|
|
54
54
|
Badge2
|
|
55
55
|
} from "../../chunk-9t530p75.js";
|
|
56
56
|
import"../../chunk-er6e5fj8.js";
|
|
57
|
-
import"../../chunk-
|
|
57
|
+
import"../../chunk-4j3fsft3.js";
|
|
58
58
|
import {
|
|
59
59
|
ScrollArea2
|
|
60
60
|
} from "../../chunk-f9sm5zpv.js";
|
|
@@ -9,13 +9,13 @@ import"../../chunk-en44w1pn.js";
|
|
|
9
9
|
import"../../chunk-e6hk39ev.js";
|
|
10
10
|
import"../../chunk-x90xmrba.js";
|
|
11
11
|
import"../../chunk-jpvw9xqy.js";
|
|
12
|
-
import"../../chunk-
|
|
12
|
+
import"../../chunk-32t5kc0y.js";
|
|
13
13
|
import {
|
|
14
14
|
Toolbar2,
|
|
15
15
|
ToolbarButton2,
|
|
16
16
|
ToolbarGroup2,
|
|
17
17
|
ToolbarSeparator2
|
|
18
|
-
} from "../../chunk-
|
|
18
|
+
} from "../../chunk-x6ed6smh.js";
|
|
19
19
|
import"../../chunk-5mydsjp3.js";
|
|
20
20
|
|
|
21
21
|
// src/components/editor/RichTextEditor.tsx
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
DragSource2,
|
|
8
8
|
DropTarget2,
|
|
9
9
|
Kanban2
|
|
10
|
-
} from "../../chunk-
|
|
10
|
+
} from "../../chunk-t0t1c3a7.js";
|
|
11
11
|
import"../../chunk-en44w1pn.js";
|
|
12
12
|
import"../../chunk-9t530p75.js";
|
|
13
13
|
import"../../chunk-7ny0vyek.js";
|
|
@@ -17,7 +17,7 @@ import"../../chunk-x90xmrba.js";
|
|
|
17
17
|
import"../../chunk-jpvw9xqy.js";
|
|
18
18
|
import {
|
|
19
19
|
Button2
|
|
20
|
-
} from "../../chunk-
|
|
20
|
+
} from "../../chunk-32t5kc0y.js";
|
|
21
21
|
import {
|
|
22
22
|
OptionSelect2
|
|
23
23
|
} from "../../chunk-p6z2m3zp.js";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
TableRow2,
|
|
29
29
|
TableHead2,
|
|
30
30
|
TableCell2
|
|
31
|
-
} from "../../chunk-
|
|
31
|
+
} from "../../chunk-xhq6s4z7.js";
|
|
32
32
|
import"../../chunk-5mydsjp3.js";
|
|
33
33
|
|
|
34
34
|
// src/components/gantt/Gantt.tsx
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
TooltipTrigger2,
|
|
13
13
|
TooltipContent2,
|
|
14
14
|
Button2
|
|
15
|
-
} from "../../chunk-
|
|
15
|
+
} from "../../chunk-32t5kc0y.js";
|
|
16
16
|
import {
|
|
17
17
|
ButtonLink2,
|
|
18
18
|
Accordion2,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
DrawerHeader2,
|
|
32
32
|
DrawerTitle2,
|
|
33
33
|
DrawerDescription2
|
|
34
|
-
} from "../../chunk-
|
|
34
|
+
} from "../../chunk-qq7brjez.js";
|
|
35
35
|
import {
|
|
36
36
|
MenuPopup,
|
|
37
37
|
MenuItem2,
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
DialogHeader2,
|
|
50
50
|
DialogTitle2,
|
|
51
51
|
DialogDescription2
|
|
52
|
-
} from "../../chunk-
|
|
52
|
+
} from "../../chunk-t6gbcj27.js";
|
|
53
53
|
import"../../chunk-f9sm5zpv.js";
|
|
54
54
|
import {
|
|
55
55
|
Popover2,
|
|
@@ -96,13 +96,13 @@ import {
|
|
|
96
96
|
CardDescription2,
|
|
97
97
|
CardContent2
|
|
98
98
|
} from "../../chunk-k1f35j55.js";
|
|
99
|
-
import"../../chunk-
|
|
100
|
-
import"../../chunk-
|
|
99
|
+
import"../../chunk-4j3fsft3.js";
|
|
100
|
+
import"../../chunk-kmqx7c48.js";
|
|
101
101
|
import {
|
|
102
102
|
Tabs2,
|
|
103
103
|
TabsList2,
|
|
104
104
|
TabsTrigger2
|
|
105
|
-
} from "../../chunk-
|
|
105
|
+
} from "../../chunk-t0t1c3a7.js";
|
|
106
106
|
import"../../chunk-4e96tpw0.js";
|
|
107
107
|
import {
|
|
108
108
|
Checkbox2
|
|
@@ -145,20 +145,20 @@ import {
|
|
|
145
145
|
TableHead2,
|
|
146
146
|
TableCell2,
|
|
147
147
|
TableCaption2
|
|
148
|
-
} from "../../chunk-
|
|
148
|
+
} from "../../chunk-xhq6s4z7.js";
|
|
149
149
|
import"../../chunk-7vnpp3ya.js";
|
|
150
150
|
import"../../chunk-m4geb1s5.js";
|
|
151
151
|
import"../../chunk-9ecf92s6.js";
|
|
152
|
-
import"../../chunk-
|
|
152
|
+
import"../../chunk-fe33dx54.js";
|
|
153
153
|
import"../../chunk-tcefvfr8.js";
|
|
154
|
-
import"../../chunk-
|
|
154
|
+
import"../../chunk-x6ed6smh.js";
|
|
155
155
|
import {
|
|
156
156
|
Carousel2,
|
|
157
157
|
CarouselContent2,
|
|
158
158
|
CarouselItem2,
|
|
159
159
|
CarouselPrevious2,
|
|
160
160
|
CarouselNext2
|
|
161
|
-
} from "../../chunk-
|
|
161
|
+
} from "../../chunk-xfz7r7dk.js";
|
|
162
162
|
import {
|
|
163
163
|
componentDefinitions2
|
|
164
164
|
} from "../../chunk-tch86q2w.js";
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
import"../../chunk-e6hk39ev.js";
|
|
7
7
|
import"../../chunk-x90xmrba.js";
|
|
8
8
|
import"../../chunk-jpvw9xqy.js";
|
|
9
|
-
import"../../chunk-
|
|
9
|
+
import"../../chunk-32t5kc0y.js";
|
|
10
10
|
import {
|
|
11
11
|
getCalendarClassNames,
|
|
12
12
|
CalendarDayButton2,
|
|
13
13
|
CalendarDropdown
|
|
14
|
-
} from "../../chunk-
|
|
14
|
+
} from "../../chunk-xe4hy1wj.js";
|
|
15
15
|
import"../../chunk-p6z2m3zp.js";
|
|
16
16
|
import {
|
|
17
17
|
useAnalyticsCallback
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import type { RowData } from "@tanstack/react-table";
|
|
2
|
-
import { type ReactElement, type ReactNode } from "react";
|
|
2
|
+
import { type FocusEvent, type KeyboardEvent, type MouseEvent, type ReactElement, type ReactNode } from "react";
|
|
3
3
|
import { type DataGridRow, type DataGridTable } from "../data-grid/DataGrid.js";
|
|
4
4
|
import { type IVirtualTableRowProps } from "../virtual-table/VirtualTable.js";
|
|
5
|
+
import type { IDataGridRowCursor } from "./types.js";
|
|
6
|
+
/** A row's props: spread them onto the row element. With a row cursor they also make the row its keyboard target. */
|
|
7
|
+
export interface IVirtualDataGridRowProps extends IVirtualTableRowProps {
|
|
8
|
+
tabIndex?: number;
|
|
9
|
+
"aria-selected"?: boolean;
|
|
10
|
+
"data-cursor"?: "";
|
|
11
|
+
"data-row-id"?: string;
|
|
12
|
+
onFocus?: (event: FocusEvent<HTMLTableRowElement>) => void;
|
|
13
|
+
onClick?: (event: MouseEvent<HTMLTableRowElement>) => void;
|
|
14
|
+
onKeyDown?: (event: KeyboardEvent<HTMLTableRowElement>) => void;
|
|
15
|
+
}
|
|
5
16
|
interface IVirtualDataGridProps<T extends RowData, TSelected> {
|
|
6
17
|
table: DataGridTable<T, TSelected>;
|
|
7
18
|
label: string;
|
|
@@ -23,11 +34,17 @@ interface IVirtualDataGridProps<T extends RowData, TSelected> {
|
|
|
23
34
|
onFitWidthChange?: (width: number) => void;
|
|
24
35
|
/** Row IDs that stay rendered while scrolled out of view, such as rows with an open editor. */
|
|
25
36
|
retainedRowIds?: readonly string[];
|
|
37
|
+
/**
|
|
38
|
+
* A row cursor from `useDataGridRowCursor`: the grid becomes one tab stop whose cursor row holds focus, rows set
|
|
39
|
+
* `aria-selected`, and clicks select with Finder's Shift and Mod gestures. Controls inside rows should leave the tab
|
|
40
|
+
* order, since each row is its own keyboard target.
|
|
41
|
+
*/
|
|
42
|
+
rowCursor?: IDataGridRowCursor;
|
|
26
43
|
/**
|
|
27
44
|
* Renders one row. Spread `props` onto the row element and render `DataGridCells` inside it; the default renders a
|
|
28
45
|
* plain `TableRow` marked selected while the row is selected.
|
|
29
46
|
*/
|
|
30
|
-
renderRow?: (row: DataGridRow<T>, props:
|
|
47
|
+
renderRow?: (row: DataGridRow<T>, props: IVirtualDataGridRowProps) => ReactNode;
|
|
31
48
|
}
|
|
32
49
|
/**
|
|
33
50
|
* A virtualized, fixed-layout data grid over every filtered and sorted row, without pagination. Columns marked
|
|
@@ -35,5 +52,5 @@ interface IVirtualDataGridProps<T extends RowData, TSelected> {
|
|
|
35
52
|
* Column widths change through CSS variables, so a `useTable` selector can leave out sizing state and resizing never
|
|
36
53
|
* renders rows again.
|
|
37
54
|
*/
|
|
38
|
-
export declare function VirtualDataGrid<T extends RowData, TSelected>({ table, label, maxHeight, height, estimateRowHeight, overscan, fitColumns, onFitWidthChange, retainedRowIds, renderRow, }: IVirtualDataGridProps<T, TSelected>): ReactElement;
|
|
55
|
+
export declare function VirtualDataGrid<T extends RowData, TSelected>({ table, label, maxHeight, height, estimateRowHeight, overscan, fitColumns, onFitWidthChange, retainedRowIds, rowCursor, renderRow, }: IVirtualDataGridProps<T, TSelected>): ReactElement;
|
|
39
56
|
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DataGridCursorMove } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* The row a cursor move lands on, in displayed order. Without a cursor, moving forward starts at the first row and
|
|
4
|
+
* moving back at the last; moves stop at either end.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getDataGridCursorTarget(rowIds: readonly string[], cursorRowId: string | undefined, move: DataGridCursorMove, pageSize: number): string | undefined;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RowData } from "@tanstack/react-table";
|
|
2
|
+
import type { DataGridTable } from "../../data-grid/DataGrid.js";
|
|
3
|
+
import type { IDataGridRowCursor, IDataGridRowCursorOptions } from "../types.js";
|
|
4
|
+
/**
|
|
5
|
+
* A row cursor with Finder-style selection for `VirtualDataGrid` (pass it as `rowCursor`). The grid becomes one tab
|
|
6
|
+
* stop whose cursor row holds focus; a click selects one row and sets the range anchor, Shift+click selects the
|
|
7
|
+
* displayed range from the anchor, Mod+click toggles a row and Mod+Shift+click adds a range. The cursor's methods run
|
|
8
|
+
* the keyboard gestures, which rows also handle themselves unless `keyboard` is off.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useDataGridRowCursor<T extends RowData, TSelected>(table: DataGridTable<T, TSelected>, options?: IDataGridRowCursorOptions): IDataGridRowCursor;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
export { VirtualDataGrid } from "./VirtualDataGrid.js";
|
|
2
|
+
export type { IVirtualDataGridRowProps } from "./VirtualDataGrid.js";
|
|
3
|
+
export { useDataGridRowCursor } from "./hooks/useDataGridRowCursor.js";
|
|
4
|
+
export type { DataGridCursorChangeHandler, DataGridCursorMove, DataGridCursorSelection, DataGridSelectionChangeHandler, DataGridSelectionGesture, IDataGridPointerModifiers, IDataGridRevealOptions, IDataGridRowCursor, IDataGridRowCursorOptions, IDataGridRowNavigation, IDataGridSelectionChange, } from "./types.js";
|
|
2
5
|
export type { IVirtualTableRowProps } from "../virtual-table/VirtualTable.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import"../../chunk-en44w1pn.js";
|
|
2
2
|
import {
|
|
3
3
|
TableRow2
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-xhq6s4z7.js";
|
|
5
5
|
import {
|
|
6
6
|
DataGridColumnFitContext,
|
|
7
7
|
getDataGridColumnFit,
|
|
@@ -10,23 +10,28 @@ import {
|
|
|
10
10
|
DataGridHeaderRows,
|
|
11
11
|
DataGridCells2,
|
|
12
12
|
DataGridColumns
|
|
13
|
-
} from "../../chunk-
|
|
13
|
+
} from "../../chunk-5jtbr6q4.js";
|
|
14
14
|
import"../../chunk-7ny0vyek.js";
|
|
15
15
|
import"../../chunk-8ssktt4b.js";
|
|
16
16
|
import"../../chunk-e6hk39ev.js";
|
|
17
17
|
import"../../chunk-x90xmrba.js";
|
|
18
18
|
import"../../chunk-jpvw9xqy.js";
|
|
19
|
-
import"../../chunk-
|
|
19
|
+
import"../../chunk-32t5kc0y.js";
|
|
20
20
|
import"../../chunk-p6z2m3zp.js";
|
|
21
21
|
import"../../chunk-7jpsybag.js";
|
|
22
22
|
import"../../chunk-7vg045gd.js";
|
|
23
23
|
import {
|
|
24
24
|
VirtualTable2
|
|
25
|
-
} from "../../chunk-
|
|
25
|
+
} from "../../chunk-tmt6rwg1.js";
|
|
26
26
|
import"../../chunk-5mydsjp3.js";
|
|
27
27
|
|
|
28
28
|
// src/components/virtual-data-grid/VirtualDataGrid.tsx
|
|
29
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
useEffect,
|
|
31
|
+
useMemo,
|
|
32
|
+
useRef,
|
|
33
|
+
useState as useState2
|
|
34
|
+
} from "react";
|
|
30
35
|
|
|
31
36
|
// src/components/data-grid/hooks/useDataGridColumnSizes.ts
|
|
32
37
|
import { useLayoutEffect } from "react";
|
|
@@ -81,6 +86,15 @@ function useDataGridColumnFit(table, scope, isEnabled, onWidthChange) {
|
|
|
81
86
|
|
|
82
87
|
// src/components/virtual-data-grid/VirtualDataGrid.tsx
|
|
83
88
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
89
|
+
var MOVES = {
|
|
90
|
+
ArrowDown: "next",
|
|
91
|
+
ArrowUp: "previous",
|
|
92
|
+
Home: "first",
|
|
93
|
+
End: "last",
|
|
94
|
+
PageDown: "next-page",
|
|
95
|
+
PageUp: "previous-page"
|
|
96
|
+
};
|
|
97
|
+
var ROW_CONTROLS = "button, a, input, select, textarea, label, [role='checkbox'], [role='radio'], [role='menuitem']";
|
|
84
98
|
function renderDefaultRow(row, props) {
|
|
85
99
|
return /* @__PURE__ */ jsx(TableRow2, {
|
|
86
100
|
...props,
|
|
@@ -90,6 +104,22 @@ function renderDefaultRow(row, props) {
|
|
|
90
104
|
})
|
|
91
105
|
}, row.id);
|
|
92
106
|
}
|
|
107
|
+
function handleRowKeys(cursor, event) {
|
|
108
|
+
if (event.target !== event.currentTarget || event.altKey)
|
|
109
|
+
return;
|
|
110
|
+
const isMod = event.metaKey || event.ctrlKey;
|
|
111
|
+
const move = MOVES[event.key];
|
|
112
|
+
if (move) {
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
cursor.move(move, event.shiftKey ? "extend" : isMod ? "keep" : "follow");
|
|
115
|
+
} else if (event.key === " " && event.shiftKey && !isMod) {
|
|
116
|
+
event.preventDefault();
|
|
117
|
+
cursor.toggle();
|
|
118
|
+
} else if (event.key.toLowerCase() === "a" && isMod && !event.shiftKey) {
|
|
119
|
+
event.preventDefault();
|
|
120
|
+
cursor.selectAll();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
93
123
|
function VirtualDataGrid({
|
|
94
124
|
table,
|
|
95
125
|
label,
|
|
@@ -100,12 +130,70 @@ function VirtualDataGrid({
|
|
|
100
130
|
fitColumns = false,
|
|
101
131
|
onFitWidthChange,
|
|
102
132
|
retainedRowIds,
|
|
133
|
+
rowCursor,
|
|
103
134
|
renderRow = renderDefaultRow
|
|
104
135
|
}) {
|
|
105
136
|
const scope = useRef(null);
|
|
106
137
|
useDataGridColumnSizes(table, scope);
|
|
107
138
|
const fit = useDataGridColumnFit(table, scope, fitColumns, onFitWidthChange);
|
|
108
139
|
const hiddenLabels = table.getVisibleLeafColumns().filter((column) => fit?.hiddenColumnIds.includes(column.id)).map(getDataGridColumnLabel);
|
|
140
|
+
const rows = table.getPrePaginatedRowModel().rows;
|
|
141
|
+
const cursorRowId = rowCursor?.cursorRowId;
|
|
142
|
+
const retained = useMemo(() => cursorRowId === undefined ? retainedRowIds : [...retainedRowIds ?? [], cursorRowId], [retainedRowIds, cursorRowId]);
|
|
143
|
+
const tabStop = rows.some((row) => row.id === cursorRowId) ? cursorRowId : rows[0]?.id;
|
|
144
|
+
const [reveal, setReveal] = useState2();
|
|
145
|
+
const latestRows = useRef(rows);
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
latestRows.current = rows;
|
|
148
|
+
});
|
|
149
|
+
useEffect(() => {
|
|
150
|
+
if (!rowCursor)
|
|
151
|
+
return;
|
|
152
|
+
rowCursor.attach({
|
|
153
|
+
rowIds: () => latestRows.current.map((row) => row.id),
|
|
154
|
+
pageSize: () => {
|
|
155
|
+
const viewport = scope.current?.querySelector("[data-testid='VirtualTable']");
|
|
156
|
+
const header = viewport?.querySelector("thead")?.getBoundingClientRect().height ?? 0;
|
|
157
|
+
const row = viewport?.querySelector("tr[data-row-id]")?.getBoundingClientRect().height;
|
|
158
|
+
return viewport && row ? Math.max(1, Math.floor((viewport.clientHeight - header) / row) - 1) : 10;
|
|
159
|
+
},
|
|
160
|
+
reveal: (rowId, focus) => setReveal({ rowId, focus })
|
|
161
|
+
});
|
|
162
|
+
return () => rowCursor.attach(null);
|
|
163
|
+
}, [rowCursor]);
|
|
164
|
+
useEffect(() => {
|
|
165
|
+
if (!reveal)
|
|
166
|
+
return;
|
|
167
|
+
const viewport = scope.current?.querySelector("[data-testid='VirtualTable']");
|
|
168
|
+
const row = viewport?.querySelector(`tr[data-row-id="${CSS.escape(reveal.rowId)}"]`);
|
|
169
|
+
if (!viewport || !row)
|
|
170
|
+
return;
|
|
171
|
+
const header = viewport.querySelector("thead")?.getBoundingClientRect().height ?? 0;
|
|
172
|
+
const view = viewport.getBoundingClientRect();
|
|
173
|
+
const bounds = row.getBoundingClientRect();
|
|
174
|
+
if (bounds.top < view.top + header)
|
|
175
|
+
viewport.scrollTop -= view.top + header - bounds.top;
|
|
176
|
+
else if (bounds.bottom > view.bottom)
|
|
177
|
+
viewport.scrollTop += bounds.bottom - view.bottom;
|
|
178
|
+
if (reveal.focus)
|
|
179
|
+
row.focus({ preventScroll: true });
|
|
180
|
+
}, [reveal]);
|
|
181
|
+
const cursorProps = (row) => rowCursor ? {
|
|
182
|
+
tabIndex: row.id === tabStop ? 0 : -1,
|
|
183
|
+
"aria-selected": row.getIsSelected(),
|
|
184
|
+
"data-cursor": row.id === cursorRowId ? "" : undefined,
|
|
185
|
+
"data-row-id": row.id,
|
|
186
|
+
onFocus: () => rowCursor.setCursor(row.id),
|
|
187
|
+
onClick: (event) => {
|
|
188
|
+
if (event.target instanceof Element && event.target.closest(ROW_CONTROLS))
|
|
189
|
+
return;
|
|
190
|
+
rowCursor.pointer(row.id, { shift: event.shiftKey, mod: event.metaKey || event.ctrlKey });
|
|
191
|
+
},
|
|
192
|
+
onKeyDown: (event) => {
|
|
193
|
+
if (rowCursor.keyboard)
|
|
194
|
+
handleRowKeys(rowCursor, event);
|
|
195
|
+
}
|
|
196
|
+
} : {};
|
|
109
197
|
return /* @__PURE__ */ jsx("div", {
|
|
110
198
|
ref: scope,
|
|
111
199
|
"data-testid": "VirtualDataGrid",
|
|
@@ -129,14 +217,15 @@ function VirtualDataGrid({
|
|
|
129
217
|
]
|
|
130
218
|
}),
|
|
131
219
|
/* @__PURE__ */ jsx(VirtualTable2, {
|
|
132
|
-
items:
|
|
220
|
+
items: rows,
|
|
133
221
|
getItemKey: (row) => row.id,
|
|
134
222
|
label,
|
|
135
223
|
maxHeight,
|
|
136
224
|
height,
|
|
137
225
|
estimateRowHeight,
|
|
138
226
|
overscan,
|
|
139
|
-
retainedKeys:
|
|
227
|
+
retainedKeys: retained,
|
|
228
|
+
isRowGrid: rowCursor !== undefined,
|
|
140
229
|
columns: /* @__PURE__ */ jsx(DataGridColumns, {
|
|
141
230
|
table
|
|
142
231
|
}),
|
|
@@ -144,12 +233,147 @@ function VirtualDataGrid({
|
|
|
144
233
|
table,
|
|
145
234
|
isResizable: true
|
|
146
235
|
}),
|
|
147
|
-
renderRow
|
|
236
|
+
renderRow: (row, props) => renderRow(row, { ...props, ...cursorProps(row) })
|
|
148
237
|
})
|
|
149
238
|
]
|
|
150
239
|
})
|
|
151
240
|
});
|
|
152
241
|
}
|
|
242
|
+
// src/components/virtual-data-grid/hooks/useDataGridRowCursor.ts
|
|
243
|
+
import { useLayoutEffect as useLayoutEffect3, useMemo as useMemo2, useRef as useRef2, useState as useState3 } from "react";
|
|
244
|
+
|
|
245
|
+
// src/components/virtual-data-grid/getDataGridCursorTarget.ts
|
|
246
|
+
function getDataGridCursorTarget(rowIds, cursorRowId, move, pageSize) {
|
|
247
|
+
if (rowIds.length === 0)
|
|
248
|
+
return;
|
|
249
|
+
const last = rowIds.length - 1;
|
|
250
|
+
const index = cursorRowId === undefined ? -1 : rowIds.indexOf(cursorRowId);
|
|
251
|
+
const page = Math.max(1, pageSize);
|
|
252
|
+
const target = (() => {
|
|
253
|
+
switch (move) {
|
|
254
|
+
case "first":
|
|
255
|
+
return 0;
|
|
256
|
+
case "last":
|
|
257
|
+
return last;
|
|
258
|
+
case "next":
|
|
259
|
+
return index < 0 ? 0 : index + 1;
|
|
260
|
+
case "previous":
|
|
261
|
+
return index < 0 ? last : index - 1;
|
|
262
|
+
case "next-page":
|
|
263
|
+
return index < 0 ? 0 : index + page;
|
|
264
|
+
case "previous-page":
|
|
265
|
+
return index < 0 ? last : index - page;
|
|
266
|
+
}
|
|
267
|
+
})();
|
|
268
|
+
return rowIds[Math.min(last, Math.max(0, target))];
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// src/components/virtual-data-grid/getDataGridRowRange.ts
|
|
272
|
+
function getDataGridRowRange(rowIds, fromRowId, toRowId) {
|
|
273
|
+
const to = rowIds.indexOf(toRowId);
|
|
274
|
+
if (to < 0)
|
|
275
|
+
return [];
|
|
276
|
+
const from = fromRowId === undefined ? -1 : rowIds.indexOf(fromRowId);
|
|
277
|
+
if (from < 0)
|
|
278
|
+
return [toRowId];
|
|
279
|
+
return rowIds.slice(Math.min(from, to), Math.max(from, to) + 1);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// src/components/virtual-data-grid/hooks/useDataGridRowCursor.ts
|
|
283
|
+
function selectedIds(selection) {
|
|
284
|
+
return Object.keys(selection).filter((id) => selection[id]);
|
|
285
|
+
}
|
|
286
|
+
function useDataGridRowCursor(table, options = {}) {
|
|
287
|
+
const [cursorRowId, setCursorRowId] = useState3();
|
|
288
|
+
const [ownAnchor, setOwnAnchor] = useState3();
|
|
289
|
+
const isOwned = options.onSelectionChange !== undefined;
|
|
290
|
+
const anchorRowId = isOwned ? options.anchorRowId : ownAnchor;
|
|
291
|
+
const navigation = useRef2(null);
|
|
292
|
+
const latest = useRef2({ table, options, cursorRowId, anchorRowId, isOwned });
|
|
293
|
+
useLayoutEffect3(() => {
|
|
294
|
+
latest.current = { table, options, cursorRowId, anchorRowId, isOwned };
|
|
295
|
+
});
|
|
296
|
+
const methods = useMemo2(() => {
|
|
297
|
+
const rowIds = () => navigation.current?.rowIds() ?? latest.current.table.getPrePaginatedRowModel().rows.map((row) => row.id);
|
|
298
|
+
const moveCursor = (rowId, focus) => {
|
|
299
|
+
latest.current.cursorRowId = rowId;
|
|
300
|
+
setCursorRowId(rowId);
|
|
301
|
+
latest.current.options.onCursorChange?.(rowId);
|
|
302
|
+
if (rowId !== undefined)
|
|
303
|
+
navigation.current?.reveal(rowId, focus);
|
|
304
|
+
};
|
|
305
|
+
const select = (ids, anchor, gesture) => {
|
|
306
|
+
const current = latest.current;
|
|
307
|
+
if (current.isOwned) {
|
|
308
|
+
current.options.onSelectionChange?.({ rowIds: ids, anchorRowId: anchor, gesture });
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
current.anchorRowId = anchor;
|
|
312
|
+
setOwnAnchor(anchor);
|
|
313
|
+
current.table.setRowSelection(Object.fromEntries(ids.map((id) => [id, true])));
|
|
314
|
+
};
|
|
315
|
+
const selection = () => selectedIds(latest.current.table.atoms.rowSelection.get());
|
|
316
|
+
return {
|
|
317
|
+
move: (move, mode = "follow") => {
|
|
318
|
+
const { cursorRowId: from, anchorRowId: anchor } = latest.current;
|
|
319
|
+
const target = getDataGridCursorTarget(rowIds(), from, move, navigation.current?.pageSize() ?? 10);
|
|
320
|
+
if (target === undefined)
|
|
321
|
+
return;
|
|
322
|
+
moveCursor(target, true);
|
|
323
|
+
if (mode === "follow" && selection().length <= 1)
|
|
324
|
+
select([target], target, "follow");
|
|
325
|
+
else if (mode === "extend") {
|
|
326
|
+
const start = anchor ?? from ?? target;
|
|
327
|
+
select(getDataGridRowRange(rowIds(), start, target), start, "extend");
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
toggle: () => {
|
|
331
|
+
const rowId = latest.current.cursorRowId;
|
|
332
|
+
if (rowId === undefined)
|
|
333
|
+
return;
|
|
334
|
+
const current = selection();
|
|
335
|
+
select(current.includes(rowId) ? current.filter((id) => id !== rowId) : [...current, rowId], rowId, "toggle");
|
|
336
|
+
},
|
|
337
|
+
selectAll: () => {
|
|
338
|
+
const visible = latest.current.table.getFilteredRowModel().flatRows.filter((row) => row.getCanSelect());
|
|
339
|
+
const ids = [...new Set([...selection(), ...visible.map((row) => row.id)])];
|
|
340
|
+
select(ids, latest.current.anchorRowId, "all");
|
|
341
|
+
},
|
|
342
|
+
clear: () => select([], undefined, "clear"),
|
|
343
|
+
pointer: (rowId, { shift, mod }) => {
|
|
344
|
+
const { cursorRowId: from, anchorRowId: anchor } = latest.current;
|
|
345
|
+
moveCursor(rowId, false);
|
|
346
|
+
if (shift) {
|
|
347
|
+
const start = anchor ?? from ?? rowIds()[0];
|
|
348
|
+
const range = getDataGridRowRange(rowIds(), start, rowId);
|
|
349
|
+
select(mod ? [...new Set([...selection(), ...range])] : range, start, mod ? "add-range" : "range");
|
|
350
|
+
} else if (mod) {
|
|
351
|
+
const current = selection();
|
|
352
|
+
select(current.includes(rowId) ? current.filter((id) => id !== rowId) : [...current, rowId], rowId, "toggle");
|
|
353
|
+
} else
|
|
354
|
+
select([rowId], rowId, "select");
|
|
355
|
+
},
|
|
356
|
+
setCursor: (rowId) => {
|
|
357
|
+
if (rowId === latest.current.cursorRowId)
|
|
358
|
+
return;
|
|
359
|
+
latest.current.cursorRowId = rowId;
|
|
360
|
+
setCursorRowId(rowId);
|
|
361
|
+
latest.current.options.onCursorChange?.(rowId);
|
|
362
|
+
},
|
|
363
|
+
reveal: ({ focus = true } = {}) => {
|
|
364
|
+
const rowId = latest.current.cursorRowId;
|
|
365
|
+
if (rowId !== undefined)
|
|
366
|
+
navigation.current?.reveal(rowId, focus);
|
|
367
|
+
},
|
|
368
|
+
attach: (next) => {
|
|
369
|
+
navigation.current = next;
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
}, []);
|
|
373
|
+
const keyboard = options.keyboard ?? true;
|
|
374
|
+
return useMemo2(() => ({ ...methods, cursorRowId, anchorRowId, keyboard }), [methods, cursorRowId, anchorRowId, keyboard]);
|
|
375
|
+
}
|
|
153
376
|
export {
|
|
154
|
-
VirtualDataGrid
|
|
377
|
+
VirtualDataGrid,
|
|
378
|
+
useDataGridRowCursor
|
|
155
379
|
};
|