@apple-pie/slice 0.1.41 → 0.1.43
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/cjs/chunks/{AudioBubble-DhizGVwQ.js → AudioBubble-DVv8x7ei.js} +4 -4
- package/dist/cjs/chunks/{Avatar-CgvyXwxk.js → Avatar-C_RcdMan.js} +1 -1
- package/dist/cjs/chunks/{AvatarGroup-LvWJF9cx.js → AvatarGroup-BJ5FA1xz.js} +1 -1
- package/dist/cjs/chunks/{Badge-D9Aklg3q.js → Badge-CcJjIIq3.js} +1 -1
- package/dist/cjs/chunks/{Button-BlAS1lxF.js → Button-C8_--WPm.js} +1 -1
- package/dist/cjs/chunks/{ButtonBar-3ieuz_vS.js → ButtonBar-DrF6u8kP.js} +1 -1
- package/dist/cjs/chunks/{Camera-C9imyJB2.js → Camera-DLDdaks3.js} +5 -5
- package/dist/cjs/chunks/{CheckBox-BSM_N6-k.js → CheckBox-cBC2ogLO.js} +1 -1
- package/dist/cjs/chunks/{Chip-_miOwLKO.js → Chip-NEJWWZe1.js} +1 -1
- package/dist/cjs/chunks/{DivInput-CLvw20QR.js → DivInput-CoCYWefH.js} +1 -1
- package/dist/cjs/chunks/{Dot-ChpyMY0A.js → Dot-PUjIvbKa.js} +1 -1
- package/dist/cjs/chunks/{DrggablePanel-Bh4w-C2o.js → DrggablePanel-Vq4bAKu1.js} +4 -4
- package/dist/cjs/chunks/{DropDown-BBEsxo6E.js → DropDown-JInjqB5Y.js} +1 -1
- package/dist/cjs/chunks/{ErrorSummary-Bh5g3g1Y.js → ErrorSummary-AVYbEF_g.js} +4 -4
- package/dist/cjs/chunks/{FileIcon-mAzQ42GJ.js → FileIcon-BPAzaXAt.js} +4 -4
- package/dist/cjs/chunks/{FileList-C85_jfbe.js → FileList-CQhbZHbY.js} +1 -1
- package/dist/cjs/chunks/{FlexDiv-C8h28Y08.js → FlexDiv-Dql7iTFb.js} +1 -1
- package/dist/cjs/chunks/{Grouper-BwGMkFXw.js → Grouper-DnWExqjo.js} +4 -4
- package/dist/cjs/chunks/{Icon-C_9-AnkK.js → Icon-8QuM6PRf.js} +4 -4
- package/dist/cjs/chunks/{IconButton-Bft4uEdc.js → IconButton-BfvKRPF0.js} +1 -1
- package/dist/cjs/chunks/{IndexedDB-D6BQTwAU.js → IndexedDB-Bje9-zII.js} +1 -1
- package/dist/cjs/chunks/{Label-gUTFSuwS.js → Label-Cj7pPrQE.js} +1 -1
- package/dist/cjs/chunks/{Level-BiXP-ftE.js → Level-BQroVfP-.js} +1 -1
- package/dist/cjs/chunks/{Modal-40onSUtS.js → Modal-B1zBYZNA.js} +1 -1
- package/dist/cjs/chunks/{ModalController-DZ1SV20-.js → ModalController-QKGEcYWI.js} +3 -3
- package/dist/cjs/chunks/{Overlay-BVKrZfr_.js → Overlay-CWb4rAdA.js} +1 -1
- package/dist/cjs/chunks/{Pager-AIPFkb0G.js → Pager-zWKzABAT.js} +1 -1
- package/dist/cjs/chunks/{ProgressIndicator-DQFn0gwg.js → ProgressIndicator-C9bvLrck.js} +4 -4
- package/dist/cjs/chunks/{PromptInput-BVgv7ynL.js → PromptInput-C93NLI6t.js} +5 -5
- package/dist/cjs/chunks/{RadioButton-CB7fDv7u.js → RadioButton-68n0J1td.js} +1 -1
- package/dist/cjs/chunks/{RadioButtonList-Dn2BkyfG.js → RadioButtonList-BhikIgcw.js} +1 -1
- package/dist/cjs/chunks/{Slider-CoxZoIhC.js → Slider-UDlSHjiR.js} +4 -4
- package/dist/cjs/chunks/{Spacer-D7UgAVhd.js → Spacer-C-jTTNMg.js} +1 -1
- package/dist/cjs/chunks/{Switch-ivA8u7nX.js → Switch-BGr505Fu.js} +1 -1
- package/dist/cjs/chunks/{TabBar--_DR7Mg1.js → TabBar-BfxEzaa4.js} +5 -5
- package/dist/cjs/chunks/{TextArea-DzCHugsI.js → TextArea-BX5K4g86.js} +1 -1
- package/dist/cjs/chunks/{TextField-BNNieT7B.js → TextField-CcQD_y3l.js} +5 -5
- package/dist/cjs/chunks/{Tip-BvVfzDFb.js → Tip-CgCUNWWg.js} +1 -1
- package/dist/cjs/chunks/{Toast-CjrVLdRd.js → Toast-5l4r8cdV.js} +5 -5
- package/dist/cjs/chunks/{ToggleButton-auDgzPuS.js → ToggleButton-C0ZYea67.js} +1 -1
- package/dist/cjs/chunks/{UploadArea-D308XeFd.js → UploadArea-DrsgfDME.js} +1 -1
- package/dist/cjs/chunks/{Video-BiQIvpFr.js → Video-_nIf0Wt-.js} +1 -1
- package/dist/cjs/chunks/{VideoController-BUuzXsbv.js → VideoController-CV2tnTh0.js} +4 -4
- package/dist/cjs/chunks/{WSConnection-DiWYhP4h.js → WSConnection-EjlOlufP.js} +1 -1
- package/dist/cjs/chunks/{WebRTCConnection-eVRKHsuy.js → WebRTCConnection-72YFnMm3.js} +1 -1
- package/dist/cjs/chunks/{localDBStore-BvgdNFzE.js → localDBStore-BHHiMyZH.js} +1 -1
- package/dist/cjs/chunks/{microphoneStore-CSk6jaja.js → microphoneStore-BdACzgmA.js} +1 -1
- package/dist/cjs/chunks/{misc-BMPaUWuY.js → misc-BD1HRncd.js} +1 -1
- package/dist/cjs/chunks/{sseStore-BegTn0ky.js → sseStore-m-W_RKIO.js} +2 -2
- package/dist/cjs/chunks/{uploads-worker-Cvvdbnpc.js → uploads-worker-CS_q2jkr.js} +1 -1
- package/dist/cjs/chunks/{uploadsStore-BV1775q_.js → uploadsStore-B9vUKZH5.js} +2 -2
- package/dist/cjs/chunks/viewState-DmgjHoOp.js +332 -0
- package/dist/cjs/chunks/{volumeStore-cwkrbgdk.js → volumeStore-uuVL43b7.js} +1 -1
- package/dist/cjs/chunks/{webRTCStore-BLkbbMXQ.js → webRTCStore-B-E2J01f.js} +1 -1
- package/dist/cjs/chunks/{windowStore-BbI62dhr.js → windowStore-CQhMrEf5.js} +1 -1
- package/dist/cjs/components/AudioBubble/index.js +6 -6
- package/dist/cjs/components/Avatar/index.js +3 -3
- package/dist/cjs/components/AvatarGroup/index.js +3 -3
- package/dist/cjs/components/Badge/index.js +2 -2
- package/dist/cjs/components/Button/index.js +9 -9
- package/dist/cjs/components/ButtonBar/index.js +6 -6
- package/dist/cjs/components/Camera/index.js +7 -7
- package/dist/cjs/components/CheckBox/index.js +6 -6
- package/dist/cjs/components/Chip/index.js +7 -7
- package/dist/cjs/components/DataTable/index.js +12 -5
- package/dist/cjs/components/DivInput/index.js +3 -3
- package/dist/cjs/components/Dot/index.js +2 -2
- package/dist/cjs/components/DraggablePanel/index.js +5 -5
- package/dist/cjs/components/DropDown/index.js +6 -6
- package/dist/cjs/components/ErrorSummary/index.js +5 -5
- package/dist/cjs/components/FileIcon/index.js +5 -5
- package/dist/cjs/components/FileList/index.js +7 -7
- package/dist/cjs/components/FlexDiv/index.js +2 -2
- package/dist/cjs/components/Grouper/index.js +7 -7
- package/dist/cjs/components/Icon/index.js +5 -5
- package/dist/cjs/components/IconButton/index.js +8 -8
- package/dist/cjs/components/Label/index.js +3 -3
- package/dist/cjs/components/Level/index.js +3 -3
- package/dist/cjs/components/Modal/index.js +10 -10
- package/dist/cjs/components/ModalController/index.js +5 -5
- package/dist/cjs/components/Overlay/index.js +2 -2
- package/dist/cjs/components/Pager/index.js +3 -3
- package/dist/cjs/components/Progress/index.js +5 -5
- package/dist/cjs/components/PromptInput/index.js +9 -9
- package/dist/cjs/components/RadioButton/index.js +6 -6
- package/dist/cjs/components/RadioButtonList/index.js +7 -7
- package/dist/cjs/components/Slider/index.js +5 -5
- package/dist/cjs/components/Spacer/index.js +2 -2
- package/dist/cjs/components/Switch/index.js +2 -2
- package/dist/cjs/components/TabBar/index.js +8 -8
- package/dist/cjs/components/TextArea/index.js +9 -9
- package/dist/cjs/components/Textfield/index.js +9 -9
- package/dist/cjs/components/Tip/index.js +3 -3
- package/dist/cjs/components/Toast/index.js +6 -6
- package/dist/cjs/components/ToggleButton/index.js +9 -9
- package/dist/cjs/components/UploadArea/index.js +8 -8
- package/dist/cjs/components/Video/index.js +11 -11
- package/dist/cjs/components/VideoController/index.js +9 -9
- package/dist/cjs/hooks/useAudioRecorder.js +1 -1
- package/dist/cjs/hooks/useBindWebRTC.js +2 -2
- package/dist/cjs/hooks/useMdStreamBuffer.js +1 -1
- package/dist/cjs/hooks/useMicrophone.js +1 -1
- package/dist/cjs/hooks/useTrackRenders.js +2 -2
- package/dist/cjs/hooks.js +3 -3
- package/dist/cjs/index.js +11 -10
- package/dist/cjs/stores/LocalDB.js +3 -3
- package/dist/cjs/stores/SSE.js +2 -2
- package/dist/cjs/stores/WS.js +2 -2
- package/dist/cjs/stores/WebRTC.js +2 -2
- package/dist/cjs/stores/microphone.js +2 -2
- package/dist/cjs/stores/modal.js +1 -1
- package/dist/cjs/stores/tip.js +1 -1
- package/dist/cjs/stores/toast.js +1 -1
- package/dist/cjs/stores/uploads.js +2 -2
- package/dist/cjs/stores/video.js +1 -1
- package/dist/cjs/stores/volume.js +2 -2
- package/dist/cjs/stores/window.js +2 -2
- package/dist/cjs/stores.js +4 -4
- package/dist/cjs/utils/index.js +2 -2
- package/dist/cjs/utils/objects/index.js +2 -2
- package/dist/cjs/workers/uploads/uploads.js +2 -2
- package/dist/esm/chunks/{AudioBubble-BUy4D4rN.mjs → AudioBubble-BRFQseqk.mjs} +6 -6
- package/dist/esm/chunks/{Avatar-Bdcl8-Nf.mjs → Avatar-Dt-n9rrn.mjs} +2 -2
- package/dist/esm/chunks/{AvatarGroup-B-4GGdPS.mjs → AvatarGroup-JrdUh_a7.mjs} +2 -2
- package/dist/esm/chunks/{Badge-B1QAa8tc.mjs → Badge-BW2WxvHN.mjs} +1 -1
- package/dist/esm/chunks/{Button-DanlQxTR.mjs → Button-BZytiaR4.mjs} +6 -6
- package/dist/esm/chunks/{ButtonBar-DC8aN4QC.mjs → ButtonBar-CEzCaqZt.mjs} +3 -3
- package/dist/esm/chunks/{Camera-B3IB3IOi.mjs → Camera-BN_0XAyY.mjs} +8 -8
- package/dist/esm/chunks/{CheckBox-Df50BNHk.mjs → CheckBox-BOdyteu-.mjs} +3 -3
- package/dist/esm/chunks/{Chip-CwDXxAua.mjs → Chip-DWeMn4tL.mjs} +4 -4
- package/dist/esm/chunks/{DivInput-Cv-eeWBP.mjs → DivInput-6L3RHNX_.mjs} +2 -2
- package/dist/esm/chunks/{Dot-DOKFQo0B.mjs → Dot-fbFT4OcE.mjs} +1 -1
- package/dist/esm/chunks/{DrggablePanel-BEXY5M9q.mjs → DrggablePanel-D19CBxPI.mjs} +5 -5
- package/dist/esm/chunks/{DropDown-DG01hr2F.mjs → DropDown-Brh1fgQU.mjs} +3 -3
- package/dist/esm/chunks/{ErrorSummary-oi5G6wC8.mjs → ErrorSummary-MdyM8CA2.mjs} +5 -5
- package/dist/esm/chunks/{FileIcon-enLJYEUf.mjs → FileIcon-BfFmvS11.mjs} +5 -5
- package/dist/esm/chunks/{FileList-Bzdgyxx-.mjs → FileList-e8S9kUTk.mjs} +5 -5
- package/dist/esm/chunks/{FlexDiv-DknkNy_U.mjs → FlexDiv-CE6OmTvi.mjs} +1 -1
- package/dist/esm/chunks/{Grouper-Dt4Dde2r.mjs → Grouper-HI6jgRE5.mjs} +6 -6
- package/dist/esm/chunks/{Icon-BOU_SmIc.mjs → Icon-qVUjH6UY.mjs} +5 -5
- package/dist/esm/chunks/{IconButton-Dtzc9KOm.mjs → IconButton-Ryf6VCg4.mjs} +5 -5
- package/dist/esm/chunks/{IndexedDB-CMyig7VA.mjs → IndexedDB-Vmrc6oKn.mjs} +1 -1
- package/dist/esm/chunks/{Label-Dv2i58Zw.mjs → Label-CZZymU3Q.mjs} +2 -2
- package/dist/esm/chunks/{Level-DIhFiktF.mjs → Level-BP2OOuaF.mjs} +3 -3
- package/dist/esm/chunks/{Modal-9m9mnVHg.mjs → Modal-BrzyEfxf.mjs} +5 -5
- package/dist/esm/chunks/{ModalController-B_dDx154.mjs → ModalController-aDZJe3BJ.mjs} +5 -5
- package/dist/esm/chunks/{Overlay-D99175pC.mjs → Overlay-Dc6fkzIf.mjs} +1 -1
- package/dist/esm/chunks/{Pager-DmiLccjC.mjs → Pager-DosqPH_L.mjs} +2 -2
- package/dist/esm/chunks/{ProgressIndicator-Ch3G17Mt.mjs → ProgressIndicator-BxIb1MFB.mjs} +5 -5
- package/dist/esm/chunks/{PromptInput-DO4qEupV.mjs → PromptInput-d8Lvl_Ba.mjs} +7 -7
- package/dist/esm/chunks/{RadioButton-CJR7Xt-k.mjs → RadioButton-DFMeH18g.mjs} +3 -3
- package/dist/esm/chunks/{RadioButtonList-C94nUpWA.mjs → RadioButtonList-BiAwI9SI.mjs} +3 -3
- package/dist/esm/chunks/{Slider-SseVlmbl.mjs → Slider-BrTR3O9N.mjs} +6 -6
- package/dist/esm/chunks/{Spacer-BZv85Dxl.mjs → Spacer-DrahdD7A.mjs} +1 -1
- package/dist/esm/chunks/{Switch-DWbt6jA7.mjs → Switch-Nwc1qX9C.mjs} +1 -1
- package/dist/esm/chunks/{TabBar-DsEyyBiY.mjs → TabBar-BxgRxUnA.mjs} +9 -9
- package/dist/esm/chunks/{TextArea-CKYtQKHj.mjs → TextArea-By89U19b.mjs} +2 -2
- package/dist/esm/chunks/{TextField-CEc95_UF.mjs → TextField-Bgi7vOIQ.mjs} +8 -8
- package/dist/esm/chunks/{Tip-joe5AXj-.mjs → Tip-B_EP7Vmk.mjs} +2 -2
- package/dist/esm/chunks/{Toast-CZqRqr-l.mjs → Toast-kgJ0O4Oy.mjs} +7 -7
- package/dist/esm/chunks/{ToggleButton-BEASCBHE.mjs → ToggleButton-fGSG0TE1.mjs} +2 -2
- package/dist/esm/chunks/{UploadArea-BCzgf_yA.mjs → UploadArea-CiB2qjtR.mjs} +4 -4
- package/dist/esm/chunks/{Video-BJbqZjL2.mjs → Video-D-Idnpcz.mjs} +5 -5
- package/dist/esm/chunks/{VideoController-UU97YVMu.mjs → VideoController-BKW28ojb.mjs} +8 -8
- package/dist/esm/chunks/{WSConnection-IvbyrJH5.mjs → WSConnection-zS21YO-b.mjs} +1 -1
- package/dist/esm/chunks/{WebRTCConnection-CMISrbkj.mjs → WebRTCConnection-YLZJFmHZ.mjs} +1 -1
- package/dist/esm/chunks/{localDBStore-BaMrWZ7c.mjs → localDBStore-BCBsWmHs.mjs} +2 -2
- package/dist/esm/chunks/{microphoneStore-CAbCtIQb.mjs → microphoneStore-B1Dtf36s.mjs} +1 -1
- package/dist/esm/chunks/{misc-DrBZJBmZ.mjs → misc--ZyHIQmL.mjs} +1 -1
- package/dist/esm/chunks/{sseStore-CGTH5JjI.mjs → sseStore-BZTuP42L.mjs} +2 -2
- package/dist/esm/chunks/{uploads-worker-CgeRABUG.mjs → uploads-worker-BYZjIzhr.mjs} +1 -1
- package/dist/esm/chunks/{uploadsStore-DARU8ZLF.mjs → uploadsStore-C-G39tsH.mjs} +1 -1
- package/dist/esm/chunks/viewState-94AhBeDg.mjs +350 -0
- package/dist/esm/chunks/{volumeStore-Bh8R2WVg.mjs → volumeStore-B5cIgXFy.mjs} +1 -1
- package/dist/esm/chunks/{webRTCStore-EN1TQcjW.mjs → webRTCStore-Dms1MoDQ.mjs} +2 -2
- package/dist/esm/chunks/{windowStore-AfHJTRDP.mjs → windowStore-DYGMzncy.mjs} +1 -1
- package/dist/esm/components/AudioBubble/index.mjs +8 -8
- package/dist/esm/components/Avatar/index.mjs +3 -3
- package/dist/esm/components/AvatarGroup/index.mjs +4 -4
- package/dist/esm/components/Badge/index.mjs +2 -2
- package/dist/esm/components/Button/index.mjs +12 -12
- package/dist/esm/components/ButtonBar/index.mjs +8 -8
- package/dist/esm/components/Camera/index.mjs +10 -10
- package/dist/esm/components/CheckBox/index.mjs +8 -8
- package/dist/esm/components/Chip/index.mjs +9 -9
- package/dist/esm/components/DataTable/index.mjs +35 -3
- package/dist/esm/components/DivInput/index.mjs +3 -3
- package/dist/esm/components/Dot/index.mjs +2 -2
- package/dist/esm/components/DraggablePanel/index.mjs +7 -7
- package/dist/esm/components/DropDown/index.mjs +8 -8
- package/dist/esm/components/ErrorSummary/index.mjs +7 -7
- package/dist/esm/components/FileIcon/index.mjs +7 -7
- package/dist/esm/components/FileList/index.mjs +10 -10
- package/dist/esm/components/FlexDiv/index.mjs +2 -2
- package/dist/esm/components/Grouper/index.mjs +9 -9
- package/dist/esm/components/Icon/index.mjs +8 -8
- package/dist/esm/components/IconButton/index.mjs +11 -11
- package/dist/esm/components/Label/index.mjs +3 -3
- package/dist/esm/components/Level/index.mjs +4 -4
- package/dist/esm/components/Modal/index.mjs +14 -14
- package/dist/esm/components/ModalController/index.mjs +8 -8
- package/dist/esm/components/Overlay/index.mjs +2 -2
- package/dist/esm/components/Pager/index.mjs +3 -3
- package/dist/esm/components/Progress/index.mjs +8 -8
- package/dist/esm/components/PromptInput/index.mjs +15 -15
- package/dist/esm/components/RadioButton/index.mjs +8 -8
- package/dist/esm/components/RadioButtonList/index.mjs +9 -9
- package/dist/esm/components/Slider/index.mjs +8 -8
- package/dist/esm/components/Spacer/index.mjs +2 -2
- package/dist/esm/components/Switch/index.mjs +2 -2
- package/dist/esm/components/TabBar/index.mjs +12 -12
- package/dist/esm/components/TextArea/index.mjs +13 -13
- package/dist/esm/components/Textfield/index.mjs +14 -14
- package/dist/esm/components/Tip/index.mjs +3 -3
- package/dist/esm/components/Toast/index.mjs +9 -9
- package/dist/esm/components/ToggleButton/index.mjs +13 -13
- package/dist/esm/components/UploadArea/index.mjs +11 -11
- package/dist/esm/components/Video/index.mjs +16 -16
- package/dist/esm/components/VideoController/index.mjs +14 -14
- package/dist/esm/hooks/useAudioRecorder.mjs +1 -1
- package/dist/esm/hooks/useBindWebRTC.mjs +5 -5
- package/dist/esm/hooks/useMdStreamBuffer.mjs +2 -2
- package/dist/esm/hooks/useMicrophone.mjs +1 -1
- package/dist/esm/hooks/useTrackRenders.mjs +2 -2
- package/dist/esm/hooks.mjs +6 -6
- package/dist/esm/index.mjs +57 -57
- package/dist/esm/stores/LocalDB.mjs +3 -3
- package/dist/esm/stores/SSE.mjs +3 -3
- package/dist/esm/stores/WS.mjs +2 -2
- package/dist/esm/stores/WebRTC.mjs +3 -3
- package/dist/esm/stores/microphone.mjs +2 -2
- package/dist/esm/stores/modal.mjs +1 -1
- package/dist/esm/stores/tip.mjs +1 -1
- package/dist/esm/stores/toast.mjs +1 -1
- package/dist/esm/stores/uploads.mjs +3 -3
- package/dist/esm/stores/video.mjs +1 -1
- package/dist/esm/stores/volume.mjs +2 -2
- package/dist/esm/stores/window.mjs +2 -2
- package/dist/esm/stores.mjs +16 -16
- package/dist/esm/utils/index.mjs +10 -10
- package/dist/esm/utils/objects/index.mjs +7 -7
- package/dist/esm/workers/uploads/uploads.mjs +2 -2
- package/dist/styles.css +33 -7
- package/dist/types/components/DataTable/DataTable.d.ts +7 -1
- package/dist/types/components/DataTable/_data.d.ts +2 -4
- package/dist/types/components/DataTable/_types.d.ts +11 -0
- package/dist/types/components/DataTable/_useDragColumn.d.ts +14 -0
- package/dist/types/components/DataTable/columnHelper.d.ts +5 -0
- package/dist/types/components/DataTable/index.d.ts +2 -2
- package/dist/types/components/DataTable/viewState.d.ts +7 -1
- package/dist/types/index.d.ts +2 -2
- package/package.json +1 -1
- package/dist/cjs/chunks/viewState-BXZkYXcb.js +0 -160
- package/dist/esm/chunks/viewState-BhDVDWPZ.mjs +0 -172
- /package/dist/cjs/chunks/{MdStreamBuffer-Beqhwp6W.js → MdStreamBuffer-lmh4kxgB.js} +0 -0
- /package/dist/cjs/chunks/{SSEConnection-BXI8k_ln.js → SSEConnection-CV7OvpUR.js} +0 -0
- /package/dist/cjs/chunks/{_types-B5g4Xcj2.js → _types-BYTz9zqz.js} +0 -0
- /package/dist/cjs/chunks/{audioVisualizer-DoLnZmy2.js → audioVisualizer-D8KXW3Vw.js} +0 -0
- /package/dist/cjs/chunks/{colors-tr9QhAvR.js → colors-CZopyRJo.js} +0 -0
- /package/dist/cjs/chunks/{debounce-Cegf7-v6.js → debounce-BzxHYGvJ.js} +0 -0
- /package/dist/cjs/chunks/{modalStore-C0YXUa7W.js → modalStore-BYGXd9_f.js} +0 -0
- /package/dist/cjs/chunks/{sharedTypes-DarRT_Xu.js → sharedTypes-DNjkrmLh.js} +0 -0
- /package/dist/cjs/chunks/{tipStore-BR0fGs0U.js → tipStore-BRQZT8Pj.js} +0 -0
- /package/dist/cjs/chunks/{toastStore-BQjpdKCD.js → toastStore-GXggV-O_.js} +0 -0
- /package/dist/cjs/chunks/{tslib.es6-C-Jd---0.js → tslib.es6-CY7UXVzV.js} +0 -0
- /package/dist/cjs/chunks/{videoStore-Brwoikta.js → videoStore-B43SSkDF.js} +0 -0
- /package/dist/esm/chunks/{MdStreamBuffer-BtGh2HQC.mjs → MdStreamBuffer-C3z6-LpW.mjs} +0 -0
- /package/dist/esm/chunks/{SSEConnection-S7LXth1M.mjs → SSEConnection-BtDJoiup.mjs} +0 -0
- /package/dist/esm/chunks/{_types-gAOuZiQG.mjs → _types-CBHVqX6q.mjs} +0 -0
- /package/dist/esm/chunks/{audioVisualizer-Dw9F2-fb.mjs → audioVisualizer-CXLuOPl4.mjs} +0 -0
- /package/dist/esm/chunks/{colors-D1Rpfngc.mjs → colors-70dW0TWM.mjs} +0 -0
- /package/dist/esm/chunks/{debounce-COjcxIqP.mjs → debounce-Dr96LW_R.mjs} +0 -0
- /package/dist/esm/chunks/{modalStore-DEtRKydt.mjs → modalStore-llQRAaUx.mjs} +0 -0
- /package/dist/esm/chunks/{sharedTypes-BZILPfY0.mjs → sharedTypes-C_JoMrsd.mjs} +0 -0
- /package/dist/esm/chunks/{tipStore-CaqkhOSU.mjs → tipStore-BUNXJpGv.mjs} +0 -0
- /package/dist/esm/chunks/{toastStore-BBQBzlws.mjs → toastStore-CHi4PnhN.mjs} +0 -0
- /package/dist/esm/chunks/{tslib.es6-SLveycHb.mjs → tslib.es6-BdBaT9_q.mjs} +0 -0
- /package/dist/esm/chunks/{videoStore-BPWPeEyt.mjs → videoStore-BHPpyl3e.mjs} +0 -0
|
@@ -6,6 +6,7 @@ export type CellContext<T, V> = {
|
|
|
6
6
|
};
|
|
7
7
|
export type HeaderContext<T, V> = {
|
|
8
8
|
column: ColumnDefinition<T, V>;
|
|
9
|
+
sortKey?: SortKey<T>;
|
|
9
10
|
};
|
|
10
11
|
export type ColumnDefinition<T, V = unknown> = {
|
|
11
12
|
id: string;
|
|
@@ -15,6 +16,7 @@ export type ColumnDefinition<T, V = unknown> = {
|
|
|
15
16
|
align?: 'start' | 'center' | 'end';
|
|
16
17
|
padding?: number | string;
|
|
17
18
|
nowrap?: boolean;
|
|
19
|
+
sort?: keyof T;
|
|
18
20
|
accessor: (row: T) => V;
|
|
19
21
|
renderHeader?: (ctx: HeaderContext<T, V>) => ReactNode;
|
|
20
22
|
renderCell?: (ctx: CellContext<T, V>) => ReactNode;
|
|
@@ -29,15 +31,24 @@ export interface DataTableProps<T> {
|
|
|
29
31
|
freezeColumnBackgroundColor?: string;
|
|
30
32
|
headerBackgroundColor?: string;
|
|
31
33
|
candyStripeBackgroundColor?: string;
|
|
34
|
+
handleHoverColor?: string;
|
|
32
35
|
borderStyle?: 'box' | 'row' | 'none';
|
|
33
36
|
borderColor?: string;
|
|
34
37
|
tableData?: T[];
|
|
38
|
+
colResize?: boolean;
|
|
39
|
+
onColumnResize?: (columnId: string, width: number) => void;
|
|
35
40
|
columnDefinitions: ColumnDefinition<T, any>[];
|
|
36
41
|
getRowId?: (row: T, index: number) => string | number;
|
|
37
42
|
filter?: (row: T, index: number, array: T[]) => boolean;
|
|
43
|
+
sort?: SortKey<T>;
|
|
44
|
+
onSortChange?: (sort: SortKey<T>) => void;
|
|
38
45
|
caption?: string;
|
|
39
46
|
onClick?: (col: ColumnDefinition<T>, colId: number, row: T, rowIndex: number) => void;
|
|
40
47
|
onDoubleClick?: (col: ColumnDefinition<T>, colId: number, row: T, rowIndex: number) => void;
|
|
41
48
|
onMouseOver?: (col: ColumnDefinition<T>, colId: number, row: T, rowIndex: number) => void;
|
|
42
49
|
onMouseOut?: (col: ColumnDefinition<T>, colId: number, row: T, rowIndex: number) => void;
|
|
43
50
|
}
|
|
51
|
+
export type SortKey<T> = {
|
|
52
|
+
key?: keyof T;
|
|
53
|
+
dir: 'asc' | 'desc';
|
|
54
|
+
} | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type DragColumnElement = {
|
|
2
|
+
id: string;
|
|
3
|
+
cell: HTMLElement;
|
|
4
|
+
col: HTMLTableColElement;
|
|
5
|
+
handle?: HTMLDivElement | null;
|
|
6
|
+
parent?: HTMLDivElement | null;
|
|
7
|
+
};
|
|
8
|
+
export declare function useDragColumn(element: DragColumnElement | null, onResizeEnd?: (id: string, width: number) => void): {
|
|
9
|
+
client: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
} | null;
|
|
13
|
+
dragging: boolean;
|
|
14
|
+
};
|
|
@@ -3,3 +3,8 @@ export declare function createColumnHelper<T>(): {
|
|
|
3
3
|
accessor<V>(accessor: (row: T) => V, def: Omit<ColumnDefinition<T, V>, "accessor">): ColumnDefinition<T, V>;
|
|
4
4
|
};
|
|
5
5
|
export declare const resolveAlignValue: (value?: "start" | "center" | "end") => "center" | "flex-end" | "flex-start";
|
|
6
|
+
export declare const resolveDragHandleXPos: (elements: {
|
|
7
|
+
cell?: HTMLElement | null;
|
|
8
|
+
handle?: HTMLDivElement | null;
|
|
9
|
+
parent?: HTMLDivElement | null;
|
|
10
|
+
}) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { DataTable } from './DataTable';
|
|
2
|
-
export type { DataTableProps, ColumnDefinition, CellContext, HeaderContext, } from './_types';
|
|
2
|
+
export type { DataTableProps, ColumnDefinition, CellContext, HeaderContext, SortKey, } from './_types';
|
|
3
3
|
export { createColumnHelper } from './columnHelper';
|
|
4
4
|
export type { DataTableViewState } from './viewState';
|
|
5
|
-
export { applyDataTableViewState, createDefaultViewState } from './viewState';
|
|
5
|
+
export { applyDataTableViewState, createDefaultViewState, resolveSortFromViewState, captureSortToViewState, } from './viewState';
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import type { ColumnDefinition } from './_types';
|
|
1
|
+
import type { ColumnDefinition, SortKey } from './_types';
|
|
2
2
|
export type DataTableViewState = {
|
|
3
3
|
columnOrder: string[];
|
|
4
4
|
hiddenColumns?: string[];
|
|
5
5
|
columnWidths?: Record<string, number | string>;
|
|
6
|
+
sort?: {
|
|
7
|
+
columnId: string;
|
|
8
|
+
dir: 'asc' | 'desc';
|
|
9
|
+
};
|
|
6
10
|
};
|
|
7
11
|
export declare function createDefaultViewState<T>(columns: ColumnDefinition<T, any>[]): DataTableViewState;
|
|
8
12
|
export declare function applyDataTableViewState<T>(columns: ColumnDefinition<T, any>[], state?: DataTableViewState | null): ColumnDefinition<T, any>[];
|
|
13
|
+
export declare function resolveSortFromViewState<T>(columns: ColumnDefinition<T, any>[], state?: DataTableViewState | null): SortKey<T>;
|
|
14
|
+
export declare function captureSortToViewState<T>(columns: ColumnDefinition<T, any>[], sort: SortKey<T>): DataTableViewState['sort'];
|
package/dist/types/index.d.ts
CHANGED
|
@@ -89,6 +89,6 @@ export type { CustomVideoControls, PlayState, VideoElement, VideoProps, } from '
|
|
|
89
89
|
export { VideoController } from './components/VideoController';
|
|
90
90
|
export type { VideoControllerProps } from './components/VideoController';
|
|
91
91
|
export { DataTable } from './components/DataTable';
|
|
92
|
-
export type { DataTableProps, ColumnDefinition, CellContext, HeaderContext, } from './components/DataTable';
|
|
93
|
-
export { createColumnHelper, applyDataTableViewState, createDefaultViewState, } from './components/DataTable';
|
|
92
|
+
export type { DataTableProps, ColumnDefinition, CellContext, HeaderContext, SortKey, } from './components/DataTable';
|
|
93
|
+
export { createColumnHelper, applyDataTableViewState, createDefaultViewState, resolveSortFromViewState, captureSortToViewState, } from './components/DataTable';
|
|
94
94
|
export type { DataTableViewState } from './components/DataTable';
|
package/package.json
CHANGED
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require("react/jsx-runtime"), React = require("react"), misc = require("./misc-BMPaUWuY.js"), styles = {
|
|
4
|
-
tableWrapper: "DataTable-module_tableWrapper__BzoJE",
|
|
5
|
-
table: "DataTable-module_table__oL4Dz",
|
|
6
|
-
baseCell: "DataTable-module_baseCell__DQl-z",
|
|
7
|
-
baseCellWrapper: "DataTable-module_baseCellWrapper__WMgNm",
|
|
8
|
-
headerCellWrapper: "DataTable-module_headerCellWrapper__ytVYY",
|
|
9
|
-
m: "DataTable-module_m__G9QOp type-module_body-m-regular__LuQBA",
|
|
10
|
-
scroll: "DataTable-module_scroll__grEU0 scrollBars-module_scrollbars__c-ZPl"
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const resolveAlignValue = value => {
|
|
14
|
-
switch (value) {
|
|
15
|
-
case "start":
|
|
16
|
-
return "flex-start";
|
|
17
|
-
|
|
18
|
-
case "center":
|
|
19
|
-
default:
|
|
20
|
-
return "center";
|
|
21
|
-
|
|
22
|
-
case "end":
|
|
23
|
-
return "flex-end";
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
exports.DataTable = function(props) {
|
|
28
|
-
const {backgroundColor: backgroundColor = "var(--core-surface-primary)", headerBackgroundColor: headerBackgroundColor = "var(--core-surface-secondary)", candyStripeBackgroundColor: candyStripeBackgroundColor = "var(--core-surface-primary-tint)", backgroundColorHoverRow: backgroundColorHoverRow = "var(--core-surface-primary-tint)", freezeColumn: freezeColumn = !1, headerSticky: headerSticky = !0, height: height = "auto", width: width = "100%", borderColor: borderColor = "var(--core-outline-primary)", borderStyle: borderStyle = "box", columnDefinitions: columnDefinitions = [], tableData: tableData = [], getRowId: getRowId, filter: filter, caption: caption = "Data Table", onDoubleClick: onDoubleClick, onClick: onClick, onMouseOut: onMouseOut, onMouseOver: onMouseOver} = props, [hScroll, setHScroll] = React.useState(!1), [vScroll, setVScroll] = React.useState(!1), [hoveredRow, setHoveredRow] = React.useState(null), wrapperRef = React.useRef(null), cornerBoxShadow = React.useCallback(() => {
|
|
29
|
-
const shadows = [];
|
|
30
|
-
return hScroll && freezeColumn && shadows.push("1px 0 0 var(--core-outline-primary)", "5px 0 0 rgba(0,0,0,0.1)"),
|
|
31
|
-
vScroll && headerSticky && shadows.push("0 1px 0 var(--core-outline-primary)"),
|
|
32
|
-
vScroll && headerSticky && !hScroll && shadows.push("0 5px 0 rgba(0,0,0,0.1)"),
|
|
33
|
-
shadows.length > 0 ? shadows.join(",") : "none";
|
|
34
|
-
}, [ hScroll, vScroll, freezeColumn, headerSticky ]), columnBoxShadow = React.useMemo(() => {
|
|
35
|
-
const shadows = [];
|
|
36
|
-
return hScroll && freezeColumn && shadows.push("1px 0 0 var(--core-outline-primary)", "5px 0 0 rgba(0,0,0,0.1)"),
|
|
37
|
-
shadows.length > 0 ? shadows.join(",") : "none";
|
|
38
|
-
}, [ hScroll, freezeColumn ]), headerBoxShadow = React.useMemo(() => {
|
|
39
|
-
const shadows = [];
|
|
40
|
-
return vScroll && headerSticky && shadows.push("0 1px 0 var(--core-outline-primary)", "0 5px 0 rgba(0,0,0,0.1)"),
|
|
41
|
-
shadows.length > 0 ? shadows.join(",") : "none";
|
|
42
|
-
}, [ vScroll, headerSticky ]), cssVars = React.useMemo(() => ({
|
|
43
|
-
"--table-width": misc.setStyle(width),
|
|
44
|
-
"--table-height": misc.setStyle(height),
|
|
45
|
-
"--table-background-color": backgroundColor,
|
|
46
|
-
"--table-column-box-shadow": columnBoxShadow,
|
|
47
|
-
"--table-header-box-shadow": headerBoxShadow,
|
|
48
|
-
"--table-corner-box-shadow": cornerBoxShadow,
|
|
49
|
-
"--table-header-background-color": headerBackgroundColor,
|
|
50
|
-
"--table-candy-stripe-background-color": candyStripeBackgroundColor,
|
|
51
|
-
"--table-freeze-column-position": freezeColumn ? "sticky" : "relative",
|
|
52
|
-
"--table-header-sticky-position": headerSticky ? "sticky" : "relative",
|
|
53
|
-
"--table-border-color": borderColor,
|
|
54
|
-
"--table-corner-position": freezeColumn || headerSticky ? "sticky" : "relative",
|
|
55
|
-
"--table-corner-left": freezeColumn ? "0px" : "unset",
|
|
56
|
-
"--table-border-width": "none" === borderStyle ? "0" : "1px",
|
|
57
|
-
"--table-border-sides": "box" === borderStyle ? "1px" : "0"
|
|
58
|
-
}), [ backgroundColor, headerBackgroundColor, candyStripeBackgroundColor, cornerBoxShadow, columnBoxShadow, headerBoxShadow, freezeColumn, headerSticky, width, height, borderColor, borderStyle ]), handleScroll = React.useCallback(() => {
|
|
59
|
-
var _a, _b, _c, _d;
|
|
60
|
-
const hScrollAmount = null !== (_b = null === (_a = wrapperRef.current) || void 0 === _a ? void 0 : _a.scrollLeft) && void 0 !== _b ? _b : 0, vScrollAmount = null !== (_d = null === (_c = wrapperRef.current) || void 0 === _c ? void 0 : _c.scrollTop) && void 0 !== _d ? _d : 0;
|
|
61
|
-
setHScroll(hScrollAmount > 0), setVScroll(vScrollAmount > 0);
|
|
62
|
-
}, []), rows = React.useMemo(() => filter ? tableData.filter((row, index, array) => filter(row, index, array)) : tableData, [ tableData, filter ]), handleCellHover = React.useCallback((col, colId, row, rowId, over) => {
|
|
63
|
-
over ? (setHoveredRow(rowId), onMouseOver && onMouseOver(col, colId, row, rowId)) : (setHoveredRow(prev => prev === rowId ? null : prev),
|
|
64
|
-
onMouseOut && onMouseOut(col, colId, row, rowId));
|
|
65
|
-
}, [ onMouseOut, onMouseOver ]), handleClick = React.useCallback((col, colId, row, rowId, dbl) => {
|
|
66
|
-
dbl && onDoubleClick ? onDoubleClick(col, colId, row, rowId) : onClick && onClick(col, colId, row, rowId);
|
|
67
|
-
}, [ onDoubleClick, onClick ]), resolveCellBG = React.useCallback(rowId => backgroundColorHoverRow && hoveredRow === rowId ? backgroundColorHoverRow : !!candyStripeBackgroundColor && rowId % 2 != 0 ? candyStripeBackgroundColor : backgroundColor, [ hoveredRow, backgroundColorHoverRow, candyStripeBackgroundColor, backgroundColor ]);
|
|
68
|
-
return jsxRuntime.jsx("div", {
|
|
69
|
-
ref: wrapperRef,
|
|
70
|
-
className: `${styles.tableWrapper} ${styles.scroll}`,
|
|
71
|
-
style: cssVars,
|
|
72
|
-
onScroll: handleScroll,
|
|
73
|
-
children: jsxRuntime.jsxs("table", {
|
|
74
|
-
className: styles.table,
|
|
75
|
-
children: [ jsxRuntime.jsx("caption", {
|
|
76
|
-
children: caption
|
|
77
|
-
}), jsxRuntime.jsx("thead", {
|
|
78
|
-
children: jsxRuntime.jsx("tr", {
|
|
79
|
-
children: columnDefinitions.map(column => {
|
|
80
|
-
const padding = misc.setStyle(column.padding, 16);
|
|
81
|
-
return jsxRuntime.jsx("th", {
|
|
82
|
-
"data-column-id": column.id,
|
|
83
|
-
className: `${styles.baseCell} ${styles.headerCell} ${styles.m}`,
|
|
84
|
-
children: jsxRuntime.jsx("div", {
|
|
85
|
-
className: styles.headerCellWrapper,
|
|
86
|
-
style: {
|
|
87
|
-
padding: padding
|
|
88
|
-
},
|
|
89
|
-
children: column.renderHeader ? column.renderHeader({
|
|
90
|
-
column: column
|
|
91
|
-
}) : column.title
|
|
92
|
-
})
|
|
93
|
-
}, column.id);
|
|
94
|
-
})
|
|
95
|
-
})
|
|
96
|
-
}), jsxRuntime.jsx("tbody", {
|
|
97
|
-
children: rows.map((row, rowIndex) => jsxRuntime.jsx("tr", {
|
|
98
|
-
children: columnDefinitions.map((col, colIndex) => {
|
|
99
|
-
var _a;
|
|
100
|
-
const value = col.accessor(row), justifyContent = resolveAlignValue(col.justify), alignItems = resolveAlignValue(col.align), padding = misc.setStyle(col.padding, 16), whiteSpace = col.nowrap ? "nowrap" : "", background = resolveCellBG(rowIndex);
|
|
101
|
-
return jsxRuntime.jsx("td", {
|
|
102
|
-
"data-column-id": `${col.id}.${rowIndex}`,
|
|
103
|
-
className: `${styles.baseCell} ${styles.m}`,
|
|
104
|
-
onClick: () => handleClick(col, colIndex, row, rowIndex, !1),
|
|
105
|
-
onDoubleClick: () => handleClick(col, colIndex, row, rowIndex, !0),
|
|
106
|
-
onKeyDown: e => misc.accessibleKeyDown(e, () => handleClick(col, colIndex, row, rowIndex, !1)),
|
|
107
|
-
onMouseOver: () => handleCellHover(col, colIndex, row, rowIndex, !0),
|
|
108
|
-
onFocus: () => handleCellHover(col, colIndex, row, rowIndex, !0),
|
|
109
|
-
onMouseOut: () => handleCellHover(col, colIndex, row, rowIndex, !1),
|
|
110
|
-
onBlur: () => handleCellHover(col, colIndex, row, rowIndex, !1),
|
|
111
|
-
style: {
|
|
112
|
-
background: background
|
|
113
|
-
},
|
|
114
|
-
children: jsxRuntime.jsx("div", {
|
|
115
|
-
className: styles.baseCellWrapper,
|
|
116
|
-
style: {
|
|
117
|
-
justifyContent: justifyContent,
|
|
118
|
-
alignItems: alignItems,
|
|
119
|
-
padding: padding,
|
|
120
|
-
whiteSpace: whiteSpace
|
|
121
|
-
},
|
|
122
|
-
children: col.renderCell ? col.renderCell({
|
|
123
|
-
row: row,
|
|
124
|
-
value: value,
|
|
125
|
-
rowIndex: rowIndex
|
|
126
|
-
}) : null !== (_a = null == value ? void 0 : value.toString()) && void 0 !== _a ? _a : ""
|
|
127
|
-
})
|
|
128
|
-
}, col.id);
|
|
129
|
-
})
|
|
130
|
-
}, getRowId ? getRowId(row, rowIndex) : rowIndex))
|
|
131
|
-
}) ]
|
|
132
|
-
})
|
|
133
|
-
});
|
|
134
|
-
}, exports.applyDataTableViewState = function(columns, state) {
|
|
135
|
-
var _a;
|
|
136
|
-
if (!state) return columns;
|
|
137
|
-
const byId = new Map(columns.map(column => [ column.id, column ])), hidden = new Set(null !== (_a = state.hiddenColumns) && void 0 !== _a ? _a : []), seen = new Set, ordered = [];
|
|
138
|
-
for (const id of state.columnOrder) {
|
|
139
|
-
if (seen.has(id) || hidden.has(id)) continue;
|
|
140
|
-
const column = byId.get(id);
|
|
141
|
-
column && (seen.add(id), ordered.push(column));
|
|
142
|
-
}
|
|
143
|
-
for (const column of columns) seen.has(column.id) || hidden.has(column.id) || (seen.add(column.id),
|
|
144
|
-
ordered.push(column));
|
|
145
|
-
if (!state.columnWidths) return ordered;
|
|
146
|
-
const widths = state.columnWidths;
|
|
147
|
-
return ordered.map(column => column.id in widths ? Object.assign(Object.assign({}, column), {
|
|
148
|
-
width: widths[column.id]
|
|
149
|
-
}) : column);
|
|
150
|
-
}, exports.createColumnHelper = function() {
|
|
151
|
-
return {
|
|
152
|
-
accessor: (accessor, def) => Object.assign({
|
|
153
|
-
accessor: accessor
|
|
154
|
-
}, def)
|
|
155
|
-
};
|
|
156
|
-
}, exports.createDefaultViewState = function(columns) {
|
|
157
|
-
return {
|
|
158
|
-
columnOrder: columns.map(column => column.id)
|
|
159
|
-
};
|
|
160
|
-
};
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
import React, { useState, useCallback, useMemo } from "react";
|
|
4
|
-
|
|
5
|
-
import { s as setStyle, a as accessibleKeyDown } from "./misc-DrBZJBmZ.mjs";
|
|
6
|
-
|
|
7
|
-
var styles = {
|
|
8
|
-
tableWrapper: "DataTable-module_tableWrapper__BzoJE",
|
|
9
|
-
table: "DataTable-module_table__oL4Dz",
|
|
10
|
-
baseCell: "DataTable-module_baseCell__DQl-z",
|
|
11
|
-
baseCellWrapper: "DataTable-module_baseCellWrapper__WMgNm",
|
|
12
|
-
headerCellWrapper: "DataTable-module_headerCellWrapper__ytVYY",
|
|
13
|
-
m: "DataTable-module_m__G9QOp type-module_body-m-regular__LuQBA",
|
|
14
|
-
scroll: "DataTable-module_scroll__grEU0 scrollBars-module_scrollbars__c-ZPl"
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
function createColumnHelper() {
|
|
18
|
-
return {
|
|
19
|
-
accessor: (accessor, def) => Object.assign({
|
|
20
|
-
accessor: accessor
|
|
21
|
-
}, def)
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const resolveAlignValue = value => {
|
|
26
|
-
switch (value) {
|
|
27
|
-
case "start":
|
|
28
|
-
return "flex-start";
|
|
29
|
-
|
|
30
|
-
case "center":
|
|
31
|
-
default:
|
|
32
|
-
return "center";
|
|
33
|
-
|
|
34
|
-
case "end":
|
|
35
|
-
return "flex-end";
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
function DataTable(props) {
|
|
40
|
-
const {backgroundColor: backgroundColor = "var(--core-surface-primary)", headerBackgroundColor: headerBackgroundColor = "var(--core-surface-secondary)", candyStripeBackgroundColor: candyStripeBackgroundColor = "var(--core-surface-primary-tint)", backgroundColorHoverRow: backgroundColorHoverRow = "var(--core-surface-primary-tint)", freezeColumn: freezeColumn = !1, headerSticky: headerSticky = !0, height: height = "auto", width: width = "100%", borderColor: borderColor = "var(--core-outline-primary)", borderStyle: borderStyle = "box", columnDefinitions: columnDefinitions = [], tableData: tableData = [], getRowId: getRowId, filter: filter, caption: caption = "Data Table", onDoubleClick: onDoubleClick, onClick: onClick, onMouseOut: onMouseOut, onMouseOver: onMouseOver} = props, [hScroll, setHScroll] = useState(!1), [vScroll, setVScroll] = useState(!1), [hoveredRow, setHoveredRow] = useState(null), wrapperRef = React.useRef(null), cornerBoxShadow = useCallback(() => {
|
|
41
|
-
const shadows = [];
|
|
42
|
-
return hScroll && freezeColumn && shadows.push("1px 0 0 var(--core-outline-primary)", "5px 0 0 rgba(0,0,0,0.1)"),
|
|
43
|
-
vScroll && headerSticky && shadows.push("0 1px 0 var(--core-outline-primary)"),
|
|
44
|
-
vScroll && headerSticky && !hScroll && shadows.push("0 5px 0 rgba(0,0,0,0.1)"),
|
|
45
|
-
shadows.length > 0 ? shadows.join(",") : "none";
|
|
46
|
-
}, [ hScroll, vScroll, freezeColumn, headerSticky ]), columnBoxShadow = useMemo(() => {
|
|
47
|
-
const shadows = [];
|
|
48
|
-
return hScroll && freezeColumn && shadows.push("1px 0 0 var(--core-outline-primary)", "5px 0 0 rgba(0,0,0,0.1)"),
|
|
49
|
-
shadows.length > 0 ? shadows.join(",") : "none";
|
|
50
|
-
}, [ hScroll, freezeColumn ]), headerBoxShadow = useMemo(() => {
|
|
51
|
-
const shadows = [];
|
|
52
|
-
return vScroll && headerSticky && shadows.push("0 1px 0 var(--core-outline-primary)", "0 5px 0 rgba(0,0,0,0.1)"),
|
|
53
|
-
shadows.length > 0 ? shadows.join(",") : "none";
|
|
54
|
-
}, [ vScroll, headerSticky ]), cssVars = useMemo(() => ({
|
|
55
|
-
"--table-width": setStyle(width),
|
|
56
|
-
"--table-height": setStyle(height),
|
|
57
|
-
"--table-background-color": backgroundColor,
|
|
58
|
-
"--table-column-box-shadow": columnBoxShadow,
|
|
59
|
-
"--table-header-box-shadow": headerBoxShadow,
|
|
60
|
-
"--table-corner-box-shadow": cornerBoxShadow,
|
|
61
|
-
"--table-header-background-color": headerBackgroundColor,
|
|
62
|
-
"--table-candy-stripe-background-color": candyStripeBackgroundColor,
|
|
63
|
-
"--table-freeze-column-position": freezeColumn ? "sticky" : "relative",
|
|
64
|
-
"--table-header-sticky-position": headerSticky ? "sticky" : "relative",
|
|
65
|
-
"--table-border-color": borderColor,
|
|
66
|
-
"--table-corner-position": freezeColumn || headerSticky ? "sticky" : "relative",
|
|
67
|
-
"--table-corner-left": freezeColumn ? "0px" : "unset",
|
|
68
|
-
"--table-border-width": "none" === borderStyle ? "0" : "1px",
|
|
69
|
-
"--table-border-sides": "box" === borderStyle ? "1px" : "0"
|
|
70
|
-
}), [ backgroundColor, headerBackgroundColor, candyStripeBackgroundColor, cornerBoxShadow, columnBoxShadow, headerBoxShadow, freezeColumn, headerSticky, width, height, borderColor, borderStyle ]), handleScroll = useCallback(() => {
|
|
71
|
-
var _a, _b, _c, _d;
|
|
72
|
-
const hScrollAmount = null !== (_b = null === (_a = wrapperRef.current) || void 0 === _a ? void 0 : _a.scrollLeft) && void 0 !== _b ? _b : 0, vScrollAmount = null !== (_d = null === (_c = wrapperRef.current) || void 0 === _c ? void 0 : _c.scrollTop) && void 0 !== _d ? _d : 0;
|
|
73
|
-
setHScroll(hScrollAmount > 0), setVScroll(vScrollAmount > 0);
|
|
74
|
-
}, []), rows = useMemo(() => filter ? tableData.filter((row, index, array) => filter(row, index, array)) : tableData, [ tableData, filter ]), handleCellHover = useCallback((col, colId, row, rowId, over) => {
|
|
75
|
-
over ? (setHoveredRow(rowId), onMouseOver && onMouseOver(col, colId, row, rowId)) : (setHoveredRow(prev => prev === rowId ? null : prev),
|
|
76
|
-
onMouseOut && onMouseOut(col, colId, row, rowId));
|
|
77
|
-
}, [ onMouseOut, onMouseOver ]), handleClick = useCallback((col, colId, row, rowId, dbl) => {
|
|
78
|
-
dbl && onDoubleClick ? onDoubleClick(col, colId, row, rowId) : onClick && onClick(col, colId, row, rowId);
|
|
79
|
-
}, [ onDoubleClick, onClick ]), resolveCellBG = useCallback(rowId => backgroundColorHoverRow && hoveredRow === rowId ? backgroundColorHoverRow : !!candyStripeBackgroundColor && rowId % 2 != 0 ? candyStripeBackgroundColor : backgroundColor, [ hoveredRow, backgroundColorHoverRow, candyStripeBackgroundColor, backgroundColor ]);
|
|
80
|
-
return jsx("div", {
|
|
81
|
-
ref: wrapperRef,
|
|
82
|
-
className: `${styles.tableWrapper} ${styles.scroll}`,
|
|
83
|
-
style: cssVars,
|
|
84
|
-
onScroll: handleScroll,
|
|
85
|
-
children: jsxs("table", {
|
|
86
|
-
className: styles.table,
|
|
87
|
-
children: [ jsx("caption", {
|
|
88
|
-
children: caption
|
|
89
|
-
}), jsx("thead", {
|
|
90
|
-
children: jsx("tr", {
|
|
91
|
-
children: columnDefinitions.map(column => {
|
|
92
|
-
const padding = setStyle(column.padding, 16);
|
|
93
|
-
return jsx("th", {
|
|
94
|
-
"data-column-id": column.id,
|
|
95
|
-
className: `${styles.baseCell} ${styles.headerCell} ${styles.m}`,
|
|
96
|
-
children: jsx("div", {
|
|
97
|
-
className: styles.headerCellWrapper,
|
|
98
|
-
style: {
|
|
99
|
-
padding: padding
|
|
100
|
-
},
|
|
101
|
-
children: column.renderHeader ? column.renderHeader({
|
|
102
|
-
column: column
|
|
103
|
-
}) : column.title
|
|
104
|
-
})
|
|
105
|
-
}, column.id);
|
|
106
|
-
})
|
|
107
|
-
})
|
|
108
|
-
}), jsx("tbody", {
|
|
109
|
-
children: rows.map((row, rowIndex) => jsx("tr", {
|
|
110
|
-
children: columnDefinitions.map((col, colIndex) => {
|
|
111
|
-
var _a;
|
|
112
|
-
const value = col.accessor(row), justifyContent = resolveAlignValue(col.justify), alignItems = resolveAlignValue(col.align), padding = setStyle(col.padding, 16), whiteSpace = col.nowrap ? "nowrap" : "", background = resolveCellBG(rowIndex);
|
|
113
|
-
return jsx("td", {
|
|
114
|
-
"data-column-id": `${col.id}.${rowIndex}`,
|
|
115
|
-
className: `${styles.baseCell} ${styles.m}`,
|
|
116
|
-
onClick: () => handleClick(col, colIndex, row, rowIndex, !1),
|
|
117
|
-
onDoubleClick: () => handleClick(col, colIndex, row, rowIndex, !0),
|
|
118
|
-
onKeyDown: e => accessibleKeyDown(e, () => handleClick(col, colIndex, row, rowIndex, !1)),
|
|
119
|
-
onMouseOver: () => handleCellHover(col, colIndex, row, rowIndex, !0),
|
|
120
|
-
onFocus: () => handleCellHover(col, colIndex, row, rowIndex, !0),
|
|
121
|
-
onMouseOut: () => handleCellHover(col, colIndex, row, rowIndex, !1),
|
|
122
|
-
onBlur: () => handleCellHover(col, colIndex, row, rowIndex, !1),
|
|
123
|
-
style: {
|
|
124
|
-
background: background
|
|
125
|
-
},
|
|
126
|
-
children: jsx("div", {
|
|
127
|
-
className: styles.baseCellWrapper,
|
|
128
|
-
style: {
|
|
129
|
-
justifyContent: justifyContent,
|
|
130
|
-
alignItems: alignItems,
|
|
131
|
-
padding: padding,
|
|
132
|
-
whiteSpace: whiteSpace
|
|
133
|
-
},
|
|
134
|
-
children: col.renderCell ? col.renderCell({
|
|
135
|
-
row: row,
|
|
136
|
-
value: value,
|
|
137
|
-
rowIndex: rowIndex
|
|
138
|
-
}) : null !== (_a = null == value ? void 0 : value.toString()) && void 0 !== _a ? _a : ""
|
|
139
|
-
})
|
|
140
|
-
}, col.id);
|
|
141
|
-
})
|
|
142
|
-
}, getRowId ? getRowId(row, rowIndex) : rowIndex))
|
|
143
|
-
}) ]
|
|
144
|
-
})
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
function createDefaultViewState(columns) {
|
|
149
|
-
return {
|
|
150
|
-
columnOrder: columns.map(column => column.id)
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
function applyDataTableViewState(columns, state) {
|
|
155
|
-
var _a;
|
|
156
|
-
if (!state) return columns;
|
|
157
|
-
const byId = new Map(columns.map(column => [ column.id, column ])), hidden = new Set(null !== (_a = state.hiddenColumns) && void 0 !== _a ? _a : []), seen = new Set, ordered = [];
|
|
158
|
-
for (const id of state.columnOrder) {
|
|
159
|
-
if (seen.has(id) || hidden.has(id)) continue;
|
|
160
|
-
const column = byId.get(id);
|
|
161
|
-
column && (seen.add(id), ordered.push(column));
|
|
162
|
-
}
|
|
163
|
-
for (const column of columns) seen.has(column.id) || hidden.has(column.id) || (seen.add(column.id),
|
|
164
|
-
ordered.push(column));
|
|
165
|
-
if (!state.columnWidths) return ordered;
|
|
166
|
-
const widths = state.columnWidths;
|
|
167
|
-
return ordered.map(column => column.id in widths ? Object.assign(Object.assign({}, column), {
|
|
168
|
-
width: widths[column.id]
|
|
169
|
-
}) : column);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
export { DataTable as D, applyDataTableViewState as a, createDefaultViewState as b, createColumnHelper as c };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|