@feugene/granularity 0.16.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{config-Zc_bUvZY2.js → config-BDfTXHo12.js} +1 -1
- package/dist/chunks/{config-Zc_bUvZY2.js.map → config-BDfTXHo12.js.map} +1 -1
- package/dist/chunks/config-BE6n20np2.js.map +1 -0
- package/dist/chunks/{config-CpwwkFBO.js → config-Baj7Wvx-.js} +1 -1
- package/dist/chunks/{config-CpwwkFBO.js.map → config-Baj7Wvx-.js.map} +1 -1
- package/dist/chunks/config-BoNR7_PD2.js.map +1 -0
- package/dist/chunks/{config-DxCTVBfx.js → config-BsPDQ0dS.js} +2 -2
- package/dist/chunks/config-BsPDQ0dS.js.map +1 -0
- package/dist/chunks/config-CN2ULSQL.js.map +1 -0
- package/dist/chunks/{config-Cw6TDzWv2.js → config-COpuWGr_.js} +1 -1
- package/dist/chunks/config-COpuWGr_.js.map +1 -0
- package/dist/chunks/config-D2aNP7Es.js +70 -0
- package/dist/chunks/config-D2aNP7Es.js.map +1 -0
- package/dist/chunks/config-D94Z9po5.js.map +1 -0
- package/dist/chunks/{config-B-g6lT19.js → config-DA6SnEoy.js} +5 -2
- package/dist/chunks/config-DA6SnEoy.js.map +1 -0
- package/dist/chunks/config-DCFvmHEv2.js.map +1 -0
- package/dist/chunks/config-DEvsMTQE.js +150 -0
- package/dist/chunks/config-DEvsMTQE.js.map +1 -0
- package/dist/chunks/{config-CvC0sX8p.js → config-MRvhUl-O.js} +1 -1
- package/dist/chunks/{config-CvC0sX8p.js.map → config-MRvhUl-O.js.map} +1 -1
- package/dist/chunks/config-ScuvHw6k2.js +42 -0
- package/dist/chunks/config-ScuvHw6k2.js.map +1 -0
- package/dist/chunks/config-T3qdQBgU2.js.map +1 -0
- package/dist/chunks/config-eXB87DOi.js.map +1 -0
- package/dist/chunks/{config-D8tSR2uS.js → config-gvq_hWNM.js} +1 -1
- package/dist/chunks/{config-D8tSR2uS.js.map → config-gvq_hWNM.js.map} +1 -1
- package/dist/chunks/context-BSYR7RZs.js.map +1 -1
- package/dist/chunks/{en-B3xMeswz.js → en-COdzxgAX.js} +30 -5
- package/dist/chunks/en-COdzxgAX.js.map +1 -0
- package/dist/chunks/{es-CA-mkU--.js → es-ClqJ-4hr.js} +30 -5
- package/dist/chunks/es-ClqJ-4hr.js.map +1 -0
- package/dist/chunks/{es-Bv8vvqdT.js → es-DGMHwknJ.js} +3 -3
- package/dist/chunks/{es-Bv8vvqdT.js.map → es-DGMHwknJ.js.map} +1 -1
- package/dist/chunks/grKbdStyles-CeZhGQHr.js +43 -0
- package/dist/chunks/grKbdStyles-CeZhGQHr.js.map +1 -0
- package/dist/chunks/{grTextareaStyles-CWI2SqC8.js → grTextareaStyles-iOcHuVMM.js} +2 -2
- package/dist/chunks/{grTextareaStyles-CWI2SqC8.js.map → grTextareaStyles-iOcHuVMM.js.map} +1 -1
- package/dist/chunks/{granular-provider-CtrXGa7c.js → granular-provider-B9nXQCMu.js} +18 -16
- package/dist/chunks/granular-provider-B9nXQCMu.js.map +1 -0
- package/dist/chunks/{keyboard-zYvvyHd4.js → keyboard-DE2yhz_b.js} +10 -1
- package/dist/chunks/keyboard-DE2yhz_b.js.map +1 -0
- package/dist/chunks/{optionFilter-BVY988pC.js → optionFilter-DYw9XPPx.js} +1 -71
- package/dist/chunks/optionFilter-DYw9XPPx.js.map +1 -0
- package/dist/chunks/{useOverlayLayer-BupuP_hs.js → overlayStack-C8cfsqXa.js} +11 -61
- package/dist/chunks/overlayStack-C8cfsqXa.js.map +1 -0
- package/dist/chunks/{ru-COWxgh2A.js → ru-9z8ix45c.js} +30 -5
- package/dist/chunks/ru-9z8ix45c.js.map +1 -0
- package/dist/chunks/useDragSort-0l47h4yb.js +265 -0
- package/dist/chunks/useDragSort-0l47h4yb.js.map +1 -0
- package/dist/chunks/{useModalOverlay-DCM4d3yA.js → useModalOverlay-BTq-0ImG.js} +1 -1
- package/dist/chunks/{useModalOverlay-DCM4d3yA.js.map → useModalOverlay-BTq-0ImG.js.map} +1 -1
- package/dist/components/GrAutocomplete/chunks/{GrAutocomplete-CQ9T7Lly.js → GrAutocomplete-CPEQxmLZ.js} +4 -3
- package/dist/components/GrAutocomplete/chunks/GrAutocomplete-CPEQxmLZ.js.map +1 -0
- package/dist/components/GrAutocomplete/index.js +1 -1
- package/dist/components/GrAutocomplete/styles.css +1 -1
- package/dist/components/GrColorPicker/chunks/{GrColorPicker-bnYBRGk8.js → GrColorPicker-DAdQ-Gc3.js} +4 -4
- package/dist/components/GrColorPicker/chunks/{GrColorPicker-bnYBRGk8.js.map → GrColorPicker-DAdQ-Gc3.js.map} +1 -1
- package/dist/components/GrColorPicker/index.js +2 -2
- package/dist/components/GrCommandPalette/chunks/{GrCommandPalette-MWDYDPNC.js → GrCommandPalette-DMeSqkEv.js} +6 -7
- package/dist/components/GrCommandPalette/chunks/GrCommandPalette-DMeSqkEv.js.map +1 -0
- package/dist/components/GrCommandPalette/index.js +1 -1
- package/dist/components/GrCommandPalette/styles.css +1 -1
- package/dist/components/GrConfigProvider/index.js +2 -2
- package/dist/components/GrConfirmDialog/chunks/{GrConfirmDialog-DaQmlp1_.js → GrConfirmDialog-hUTi-GdJ.js} +1 -1
- package/dist/components/GrConfirmDialog/chunks/{GrConfirmDialog-DaQmlp1_.js.map → GrConfirmDialog-hUTi-GdJ.js.map} +1 -1
- package/dist/components/GrConfirmDialog/index.js +1 -1
- package/dist/components/GrDataTable/chunks/{GrDataTable-DVFho9Cj.js → GrDataTable-DzaGLG3A.js} +495 -47
- package/dist/components/GrDataTable/chunks/GrDataTable-DzaGLG3A.js.map +1 -0
- package/dist/components/GrDataTable/index.js +2 -2
- package/dist/components/GrDialog/chunks/{GrDialog-AE1gIZuz.js → GrDialog-MD9Fzy9C.js} +1 -1
- package/dist/components/GrDialog/chunks/{GrDialog-AE1gIZuz.js.map → GrDialog-MD9Fzy9C.js.map} +1 -1
- package/dist/components/GrDialog/index.js +1 -1
- package/dist/components/GrDialogService/chunks/{GrDialogService-B4DYWDkA.js → GrDialogService-DtgUijMj.js} +2 -2
- package/dist/components/GrDialogService/chunks/{GrDialogService-B4DYWDkA.js.map → GrDialogService-DtgUijMj.js.map} +1 -1
- package/dist/components/GrDialogService/index.js +1 -1
- package/dist/components/GrDrawer/chunks/{GrDrawer-DQwi6aRw.js → GrDrawer-DWHdZZzW.js} +2 -2
- package/dist/components/GrDrawer/chunks/{GrDrawer-DQwi6aRw.js.map → GrDrawer-DWHdZZzW.js.map} +1 -1
- package/dist/components/GrDrawer/index.js +2 -2
- package/dist/components/GrDropdown/chunks/{GrDropdown-BLng6V1m.js → GrDropdown-0tJK01Kq.js} +2 -2
- package/dist/components/GrDropdown/chunks/{GrDropdown-BLng6V1m.js.map → GrDropdown-0tJK01Kq.js.map} +1 -1
- package/dist/components/GrDropdown/index.js +1 -1
- package/dist/components/GrDropdownMenu/chunks/{GrDropdownMenu-BImk2Vs7.js → GrDropdownMenu-VPPrpCoA.js} +1 -1
- package/dist/components/GrDropdownMenu/chunks/{GrDropdownMenu-BImk2Vs7.js.map → GrDropdownMenu-VPPrpCoA.js.map} +1 -1
- package/dist/components/GrDropdownMenu/index.js +1 -1
- package/dist/components/GrFileUpload/chunks/{GrFileUpload-D0B-BEsd.js → GrFileUpload-DuDzC43S.js} +2 -2
- package/dist/components/GrFileUpload/chunks/{GrFileUpload-D0B-BEsd.js.map → GrFileUpload-DuDzC43S.js.map} +1 -1
- package/dist/components/GrFileUpload/index.js +1 -1
- package/dist/components/GrImageViewer/chunks/{GrImageViewer-BeCnE8XQ.js → GrImageViewer-DE7MBbF8.js} +46 -22
- package/dist/components/GrImageViewer/chunks/GrImageViewer-DE7MBbF8.js.map +1 -0
- package/dist/components/GrImageViewer/index.js +1 -1
- package/dist/components/GrInput/chunks/{GrInput-DD2gYdqS.js → GrInput-2wd7Crs0.js} +1 -1
- package/dist/components/GrInput/chunks/GrInput-2wd7Crs0.js.map +1 -0
- package/dist/components/GrInput/index.js +1 -1
- package/dist/components/GrInputTag/chunks/{GrInputTag-DmNunixz.js → GrInputTag-CyV2eY7Z.js} +20 -33
- package/dist/components/GrInputTag/chunks/GrInputTag-CyV2eY7Z.js.map +1 -0
- package/dist/components/GrInputTag/index.js +1 -1
- package/dist/components/GrKbd/chunks/{GrKbd-DRFPvW3G.js → GrKbd-DU2lBkRV.js} +218 -52
- package/dist/components/GrKbd/chunks/GrKbd-DU2lBkRV.js.map +1 -0
- package/dist/components/GrKbd/index.js +3 -3
- package/dist/components/GrModal/chunks/{GrModal-B8I78T0N.js → GrModal-BbhcsDQ8.js} +1 -1
- package/dist/components/GrModal/chunks/{GrModal-B8I78T0N.js.map → GrModal-BbhcsDQ8.js.map} +1 -1
- package/dist/components/GrModal/index.js +1 -1
- package/dist/components/GrPagination/chunks/{GrPagination-B6N0QZBf.js → GrPagination-waKhxBP7.js} +4 -4
- package/dist/components/GrPagination/chunks/GrPagination-waKhxBP7.js.map +1 -0
- package/dist/components/GrPagination/index.js +1 -1
- package/dist/components/GrPopover/chunks/{GrPopover-B1eRCOoO.js → GrPopover-DuqeoFaI.js} +1 -1
- package/dist/components/GrPopover/chunks/{GrPopover-B1eRCOoO.js.map → GrPopover-DuqeoFaI.js.map} +1 -1
- package/dist/components/GrPopover/index.js +1 -1
- package/dist/components/GrProgressBar/chunks/{GrProgressBar-BiHnaitu.js → GrProgressBar-xwbNM9QB.js} +1 -1
- package/dist/components/GrProgressBar/chunks/GrProgressBar-xwbNM9QB.js.map +1 -0
- package/dist/components/GrProgressBar/index.js +1 -1
- package/dist/components/GrProgressCircle/chunks/{GrProgressCircle-CTogjcHz.js → GrProgressCircle-B8olXRo5.js} +1 -1
- package/dist/components/GrProgressCircle/chunks/{GrProgressCircle-CTogjcHz.js.map → GrProgressCircle-B8olXRo5.js.map} +1 -1
- package/dist/components/GrProgressCircle/index.js +2 -2
- package/dist/components/GrPromptDialog/chunks/{GrPromptDialog-Ct174NVD.js → GrPromptDialog-JVVqBsPY.js} +3 -3
- package/dist/components/GrPromptDialog/chunks/{GrPromptDialog-Ct174NVD.js.map → GrPromptDialog-JVVqBsPY.js.map} +1 -1
- package/dist/components/GrPromptDialog/index.js +1 -1
- package/dist/components/GrRadio/chunks/{GrRadio-DksDro_U.js → GrRadio-DWiRaMzt.js} +8 -32
- package/dist/components/GrRadio/chunks/GrRadio-DWiRaMzt.js.map +1 -0
- package/dist/components/GrRadio/index.js +1 -1
- package/dist/components/GrRadioGroup/chunks/{GrRadioGroup-BOIhejE6.js → GrRadioGroup-DIuBw0wk.js} +34 -27
- package/dist/components/GrRadioGroup/chunks/GrRadioGroup-DIuBw0wk.js.map +1 -0
- package/dist/components/GrRadioGroup/index.js +1 -1
- package/dist/components/GrRating/chunks/{GrRating-JrHXz0Rv.js → GrRating-LarIiwJL.js} +2 -2
- package/dist/components/GrRating/chunks/GrRating-LarIiwJL.js.map +1 -0
- package/dist/components/GrRating/index.js +2 -2
- package/dist/components/GrSegmented/chunks/{GrSegmented-BQIlH5KI.js → GrSegmented-CQw3ijqa.js} +47 -65
- package/dist/components/GrSegmented/chunks/GrSegmented-CQw3ijqa.js.map +1 -0
- package/dist/components/GrSegmented/index.js +1 -1
- package/dist/components/GrSelect/chunks/{GrSelect-aqkPCqjd.js → GrSelect-DAdu044K.js} +4 -3
- package/dist/components/GrSelect/chunks/GrSelect-DAdu044K.js.map +1 -0
- package/dist/components/GrSelect/index.js +1 -1
- package/dist/components/GrSlider/chunks/{GrSlider-DkU9IQSX.js → GrSlider-CyhVsNKn.js} +21 -34
- package/dist/components/GrSlider/chunks/GrSlider-CyhVsNKn.js.map +1 -0
- package/dist/components/GrSlider/index.js +2 -2
- package/dist/components/GrSortableList/chunks/GrSortableList-BefVfWKh.js +276 -0
- package/dist/components/GrSortableList/chunks/GrSortableList-BefVfWKh.js.map +1 -0
- package/dist/components/GrSortableList/index.js +3 -0
- package/dist/components/GrSplitter/chunks/{GrSplitter-7To8jbJ8.js → GrSplitter-BzxVQwbY.js} +17 -37
- package/dist/components/GrSplitter/chunks/GrSplitter-BzxVQwbY.js.map +1 -0
- package/dist/components/GrSplitter/index.js +2 -2
- package/dist/components/GrStatistic/chunks/{GrStatistic-CttyoYPT.js → GrStatistic-J4qLs3TH.js} +1 -1
- package/dist/components/GrStatistic/chunks/{GrStatistic-CttyoYPT.js.map → GrStatistic-J4qLs3TH.js.map} +1 -1
- package/dist/components/GrStatistic/index.js +2 -2
- package/dist/components/GrSwitch/chunks/{GrSwitch-B9TYbiih.js → GrSwitch-DpyvVrZG.js} +1 -1
- package/dist/components/GrSwitch/chunks/{GrSwitch-B9TYbiih.js.map → GrSwitch-DpyvVrZG.js.map} +1 -1
- package/dist/components/GrSwitch/index.js +2 -2
- package/dist/components/GrTabPanels/index.js +1 -1
- package/dist/components/GrTable/chunks/{GrTable-BB-mI_NM.js → GrTable-BfqgwETQ.js} +7 -1
- package/dist/components/GrTable/chunks/GrTable-BfqgwETQ.js.map +1 -0
- package/dist/components/GrTable/index.js +1 -1
- package/dist/components/GrTabs/chunks/{GrTabs-B8CDq2D9.js → GrTabs-TeXaU5Uh.js} +50 -61
- package/dist/components/GrTabs/chunks/GrTabs-TeXaU5Uh.js.map +1 -0
- package/dist/components/GrTabs/index.js +1 -1
- package/dist/components/GrTextarea/chunks/{GrTextarea-DUh5Tlo4.js → GrTextarea-DSvd1nSy.js} +1 -1
- package/dist/components/GrTextarea/chunks/{GrTextarea-DUh5Tlo4.js.map → GrTextarea-DSvd1nSy.js.map} +1 -1
- package/dist/components/GrTextarea/index.js +2 -2
- package/dist/components/GrTimeline/chunks/{GrTimeline-CE9b3s18.js → GrTimeline-B-h2Yanw.js} +1 -1
- package/dist/components/GrTimeline/chunks/{GrTimeline-CE9b3s18.js.map → GrTimeline-B-h2Yanw.js.map} +1 -1
- package/dist/components/GrTimeline/index.js +2 -2
- package/dist/components/GrToaster/chunks/{GrToaster-BKQy3Srm.js → GrToaster-Ct-39hga.js} +113 -12
- package/dist/components/GrToaster/chunks/GrToaster-Ct-39hga.js.map +1 -0
- package/dist/components/GrToaster/index.js +2 -2
- package/dist/components/GrToaster/styles.css +1 -1
- package/dist/components/GrTooltip/chunks/{GrTooltip-DEbejfhA.js → GrTooltip-xAcqs0bP.js} +1 -1
- package/dist/components/GrTooltip/chunks/{GrTooltip-DEbejfhA.js.map → GrTooltip-xAcqs0bP.js.map} +1 -1
- package/dist/components/GrTooltip/index.js +2 -2
- package/dist/components/GrTree/chunks/{GrTree-wfdbvygw.js → GrTree-CaYK8dGZ.js} +124 -92
- package/dist/components/GrTree/chunks/GrTree-CaYK8dGZ.js.map +1 -0
- package/dist/components/GrTree/index.js +1 -1
- package/dist/components/GrTree/styles.css +1 -1
- package/dist/components/GrTreeSelect/chunks/{GrTreeSelect-lLWmAMtI.js → GrTreeSelect-DZp7CqqW.js} +4 -4
- package/dist/components/GrTreeSelect/chunks/{GrTreeSelect-lLWmAMtI.js.map → GrTreeSelect-DZp7CqqW.js.map} +1 -1
- package/dist/components/GrTreeSelect/index.js +2 -2
- package/dist/composables/useComboboxNavigation.js +71 -0
- package/dist/composables/useComboboxNavigation.js.map +1 -0
- package/dist/composables/useDismissible.js +1 -1
- package/dist/composables/useDragGesture.js +55 -0
- package/dist/composables/useDragGesture.js.map +1 -0
- package/dist/composables/useDragSort.js +2 -0
- package/dist/composables/useFloating.js +22 -1
- package/dist/composables/useFloating.js.map +1 -1
- package/dist/composables/useGrComponentConfig.js +2 -0
- package/dist/composables/useGranularityTranslations.js +2 -0
- package/dist/composables/useOverlayLayer.js +64 -1
- package/dist/composables/useOverlayLayer.js.map +1 -0
- package/dist/composables/useRovingFocus.js +150 -0
- package/dist/composables/useRovingFocus.js.map +1 -0
- package/dist/directives/hotkey.js +13 -7
- package/dist/directives/hotkey.js.map +1 -1
- package/dist/granular-provider-node.js +1 -1
- package/dist/granular-provider.js +1 -1
- package/dist/i18n/all.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/index.js +67 -58
- package/dist/tokens.js +84 -0
- package/dist/tokens.js.map +1 -1
- package/dist/types/src/components/GrAlert/defaults.d.ts +1 -1
- package/dist/types/src/components/GrAutocomplete/defaults.d.ts +1 -1
- package/dist/types/src/components/GrAvatar/defaults.d.ts +1 -1
- package/dist/types/src/components/GrBadge/defaults.d.ts +1 -1
- package/dist/types/src/components/GrBottomNav/defaults.d.ts +1 -1
- package/dist/types/src/components/GrBreadcrumbs/defaults.d.ts +1 -1
- package/dist/types/src/components/GrButton/defaults.d.ts +1 -1
- package/dist/types/src/components/GrCard/defaults.d.ts +1 -1
- package/dist/types/src/components/GrCheckbox/defaults.d.ts +1 -1
- package/dist/types/src/components/GrCheckboxGroup/defaults.d.ts +1 -1
- package/dist/types/src/components/GrCollapse/defaults.d.ts +1 -1
- package/dist/types/src/components/GrColorPicker/defaults.d.ts +1 -1
- package/dist/types/src/components/GrColorPicker/grColorPickerStyles.d.ts +2 -2
- package/dist/types/src/components/GrCommandPalette/defaults.d.ts +1 -1
- package/dist/types/src/components/GrConfigProvider/context.d.ts +6 -22
- package/dist/types/src/components/GrConfigProvider/index.d.ts +1 -1
- package/dist/types/src/components/GrConfirmDialog/defaults.d.ts +1 -1
- package/dist/types/src/components/GrDataTable/GrDataTable.vue.d.ts +53 -0
- package/dist/types/src/components/GrDataTable/defaults.d.ts +1 -1
- package/dist/types/src/components/GrDataTable/grDataTableStyles.d.ts +39 -0
- package/dist/types/src/components/GrDialog/defaults.d.ts +1 -1
- package/dist/types/src/components/GrDivider/defaults.d.ts +1 -1
- package/dist/types/src/components/GrDrawer/defaults.d.ts +1 -1
- package/dist/types/src/components/GrEmptyState/defaults.d.ts +1 -1
- package/dist/types/src/components/GrFileUpload/defaults.d.ts +1 -1
- package/dist/types/src/components/GrFormField/defaults.d.ts +1 -1
- package/dist/types/src/components/GrFormFile/defaults.d.ts +1 -1
- package/dist/types/src/components/GrFormSection/defaults.d.ts +1 -1
- package/dist/types/src/components/GrIcon/defaults.d.ts +1 -1
- package/dist/types/src/components/GrImageViewer/composables/usePointerGestures.d.ts +1 -0
- package/dist/types/src/components/GrImageViewer/composables/useZoomPan.d.ts +1 -2
- package/dist/types/src/components/GrInput/defaults.d.ts +1 -1
- package/dist/types/src/components/GrInputTag/defaults.d.ts +1 -1
- package/dist/types/src/components/GrKbd/GrKbd.vue.d.ts +18 -3
- package/dist/types/src/components/GrKbd/defaults.d.ts +1 -1
- package/dist/types/src/components/GrKbd/grKbdStyles.d.ts +20 -3
- package/dist/types/src/components/GrKbd/index.d.ts +6 -0
- package/dist/types/src/components/GrLink/defaults.d.ts +1 -1
- package/dist/types/src/components/GrModal/defaults.d.ts +1 -1
- package/dist/types/src/components/GrNumberInput/defaults.d.ts +1 -1
- package/dist/types/src/components/GrPagination/defaults.d.ts +1 -1
- package/dist/types/src/components/GrPopover/GrPopover.vue.d.ts +1 -1
- package/dist/types/src/components/GrPopover/defaults.d.ts +1 -1
- package/dist/types/src/components/GrProgressBar/defaults.d.ts +1 -1
- package/dist/types/src/components/GrProgressCircle/defaults.d.ts +1 -1
- package/dist/types/src/components/GrProgressCircle/grProgressCircleStyles.d.ts +1 -1
- package/dist/types/src/components/GrPromptDialog/defaults.d.ts +1 -1
- package/dist/types/src/components/GrRadio/defaults.d.ts +1 -1
- package/dist/types/src/components/GrRadio/grRadioGroupContext.d.ts +12 -4
- package/dist/types/src/components/GrRadioGroup/defaults.d.ts +1 -1
- package/dist/types/src/components/GrRating/defaults.d.ts +1 -1
- package/dist/types/src/components/GrSegmented/defaults.d.ts +1 -1
- package/dist/types/src/components/GrSelect/defaults.d.ts +1 -1
- package/dist/types/src/components/GrSlider/defaults.d.ts +1 -1
- package/dist/types/src/components/GrSortableList/GrSortableList.vue.d.ts +68 -0
- package/dist/types/src/components/GrSortableList/config.d.ts +1 -0
- package/dist/types/src/components/GrSortableList/grSortableListStyles.d.ts +38 -0
- package/dist/types/src/components/GrSortableList/index.d.ts +9 -0
- package/dist/types/src/components/GrSortableList/safelist.d.ts +1 -0
- package/dist/types/src/components/GrSplitter/defaults.d.ts +1 -1
- package/dist/types/src/components/GrStatistic/defaults.d.ts +1 -1
- package/dist/types/src/components/GrStatistic/grStatisticStyles.d.ts +1 -1
- package/dist/types/src/components/GrSwitch/defaults.d.ts +1 -1
- package/dist/types/src/components/GrTable/GrTable.vue.d.ts +13 -0
- package/dist/types/src/components/GrTable/defaults.d.ts +1 -1
- package/dist/types/src/components/GrTabs/defaults.d.ts +1 -1
- package/dist/types/src/components/GrTextarea/defaults.d.ts +1 -1
- package/dist/types/src/components/GrTextarea/grTextareaStyles.d.ts +2 -2
- package/dist/types/src/components/GrTimeline/defaults.d.ts +1 -1
- package/dist/types/src/components/GrTimeline/grTimelineStyles.d.ts +1 -1
- package/dist/types/src/components/GrToaster/GrToaster.vue.d.ts +8 -0
- package/dist/types/src/components/GrToaster/grToasterStyles.d.ts +27 -0
- package/dist/types/src/components/GrTooltip/defaults.d.ts +1 -1
- package/dist/types/src/components/GrTree/defaults.d.ts +1 -1
- package/dist/types/src/components/GrTree/grTreeInteractionContext.d.ts +0 -1
- package/dist/types/src/components/GrTreeSelect/defaults.d.ts +1 -1
- package/dist/types/src/components/shared/hotkey.d.ts +7 -15
- package/dist/types/src/components/shared/hotkeyTokens.d.ts +37 -0
- package/dist/types/src/composables/internal/dragSortGeometry.d.ts +59 -0
- package/dist/types/src/composables/internal/overlayStack.d.ts +11 -0
- package/dist/types/src/composables/useDragGesture.d.ts +63 -0
- package/dist/types/src/composables/useDragSort.d.ts +80 -0
- package/dist/types/src/composables/useFloating.d.ts +5 -1
- package/dist/types/src/composables/useGrComponentConfig.d.ts +41 -0
- package/dist/types/src/composables/useGranularityTranslations.d.ts +13 -0
- package/dist/types/src/composables/useRovingFocus.d.ts +108 -0
- package/dist/types/src/granular-provider/shared.d.ts +1 -0
- package/dist/types/src/i18n/messages/en.d.ts +48 -0
- package/dist/types/src/i18n/messages/es.d.ts +48 -0
- package/dist/types/src/i18n/messages/ru.d.ts +48 -0
- package/dist/types/src/index.d.ts +12 -0
- package/dist/types/src/internal/keyboard.d.ts +6 -0
- package/dist/web-types.json +201 -3
- package/package.json +31 -3
- package/dist/chunks/config-B-g6lT19.js.map +0 -1
- package/dist/chunks/config-BE6n20np.js.map +0 -1
- package/dist/chunks/config-BNfQwyL4.js +0 -97
- package/dist/chunks/config-BNfQwyL4.js.map +0 -1
- package/dist/chunks/config-BoNR7_PD.js.map +0 -1
- package/dist/chunks/config-CN2ULSQL2.js.map +0 -1
- package/dist/chunks/config-Cw6TDzWv2.js.map +0 -1
- package/dist/chunks/config-D94Z9po52.js.map +0 -1
- package/dist/chunks/config-DCFvmHEv.js.map +0 -1
- package/dist/chunks/config-DxCTVBfx.js.map +0 -1
- package/dist/chunks/config-LGrZIdaZ.js +0 -21
- package/dist/chunks/config-LGrZIdaZ.js.map +0 -1
- package/dist/chunks/config-T3qdQBgU.js.map +0 -1
- package/dist/chunks/config-eXB87DOi2.js.map +0 -1
- package/dist/chunks/en-B3xMeswz.js.map +0 -1
- package/dist/chunks/es-CA-mkU--.js.map +0 -1
- package/dist/chunks/grKbdStyles-DAoxiytu.js +0 -31
- package/dist/chunks/grKbdStyles-DAoxiytu.js.map +0 -1
- package/dist/chunks/granular-provider-CtrXGa7c.js.map +0 -1
- package/dist/chunks/keyboard-zYvvyHd4.js.map +0 -1
- package/dist/chunks/optionFilter-BVY988pC.js.map +0 -1
- package/dist/chunks/ru-COWxgh2A.js.map +0 -1
- package/dist/chunks/useOverlayLayer-BupuP_hs.js.map +0 -1
- package/dist/components/GrAutocomplete/chunks/GrAutocomplete-CQ9T7Lly.js.map +0 -1
- package/dist/components/GrCommandPalette/chunks/GrCommandPalette-MWDYDPNC.js.map +0 -1
- package/dist/components/GrDataTable/chunks/GrDataTable-DVFho9Cj.js.map +0 -1
- package/dist/components/GrImageViewer/chunks/GrImageViewer-BeCnE8XQ.js.map +0 -1
- package/dist/components/GrInput/chunks/GrInput-DD2gYdqS.js.map +0 -1
- package/dist/components/GrInputTag/chunks/GrInputTag-DmNunixz.js.map +0 -1
- package/dist/components/GrKbd/chunks/GrKbd-DRFPvW3G.js.map +0 -1
- package/dist/components/GrPagination/chunks/GrPagination-B6N0QZBf.js.map +0 -1
- package/dist/components/GrProgressBar/chunks/GrProgressBar-BiHnaitu.js.map +0 -1
- package/dist/components/GrRadio/chunks/GrRadio-DksDro_U.js.map +0 -1
- package/dist/components/GrRadioGroup/chunks/GrRadioGroup-BOIhejE6.js.map +0 -1
- package/dist/components/GrRating/chunks/GrRating-JrHXz0Rv.js.map +0 -1
- package/dist/components/GrSegmented/chunks/GrSegmented-BQIlH5KI.js.map +0 -1
- package/dist/components/GrSelect/chunks/GrSelect-aqkPCqjd.js.map +0 -1
- package/dist/components/GrSlider/chunks/GrSlider-DkU9IQSX.js.map +0 -1
- package/dist/components/GrSplitter/chunks/GrSplitter-7To8jbJ8.js.map +0 -1
- package/dist/components/GrTable/chunks/GrTable-BB-mI_NM.js.map +0 -1
- package/dist/components/GrTabs/chunks/GrTabs-B8CDq2D9.js.map +0 -1
- package/dist/components/GrToaster/chunks/GrToaster-BKQy3Srm.js.map +0 -1
- package/dist/components/GrTree/chunks/GrTree-wfdbvygw.js.map +0 -1
- /package/dist/chunks/{config-BE6n20np.js → config-BE6n20np2.js} +0 -0
- /package/dist/chunks/{config-BoNR7_PD.js → config-BoNR7_PD2.js} +0 -0
- /package/dist/chunks/{config-CN2ULSQL2.js → config-CN2ULSQL.js} +0 -0
- /package/dist/chunks/{config-D94Z9po52.js → config-D94Z9po5.js} +0 -0
- /package/dist/chunks/{config-DCFvmHEv.js → config-DCFvmHEv2.js} +0 -0
- /package/dist/chunks/{config-T3qdQBgU.js → config-T3qdQBgU2.js} +0 -0
- /package/dist/chunks/{config-eXB87DOi2.js → config-eXB87DOi.js} +0 -0
- /package/dist/types/src/composables/{internal/useComboboxNavigation.d.ts → useComboboxNavigation.d.ts} +0 -0
package/dist/components/GrDataTable/chunks/{GrDataTable-DVFho9Cj.js → GrDataTable-DzaGLG3A.js}
RENAMED
|
@@ -3,10 +3,14 @@ import { n as useGranularityTranslations } from "../../../chunks/granularityI18n
|
|
|
3
3
|
import { t as GrIcon_default } from "../../GrIcon/chunks/GrIcon-BvA2ZGXP.js";
|
|
4
4
|
import { useVirtualList } from "../../../composables/useVirtualList.js";
|
|
5
5
|
import { t as GrCheckbox_default } from "../../GrCheckbox/chunks/GrCheckbox-BLOp8452.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { useDragGesture } from "../../../composables/useDragGesture.js";
|
|
7
|
+
import { t as GrTable_default } from "../../GrTable/chunks/GrTable-BfqgwETQ.js";
|
|
8
|
+
import { useAnnouncer } from "../../../composables/useAnnouncer.js";
|
|
9
|
+
import { n as insertionIndex, r as moveItem, t as useDragSort } from "../../../chunks/useDragSort-0l47h4yb.js";
|
|
10
|
+
import { useRovingFocus } from "../../../composables/useRovingFocus.js";
|
|
11
|
+
import { C as selectColumnWidths, S as selectCheckboxSizes, T as spinnerSizes, _ as headerGaps, a as columnDropAfterClass, b as rowHeightEstimates, c as columnHandleClass, d as columnPinnedLeftEdgeClass, f as columnPinnedRightEdgeClass, g as columnResizerLineClass, h as columnResizerLineActiveClass, i as columnDraggingClass, l as columnHandleIconClass, m as columnResizerHoverClass, o as columnDropBeforeClass, p as columnResizerClass, r as cellPaddings, s as columnHandleActiveClass, u as columnPinnedClass, v as headerTextSizes, w as sortIconSizes, x as rowSelectedClass, y as placeholderPaddings } from "../../../chunks/config-DEvsMTQE.js";
|
|
8
12
|
import { t as arrow_up_default } from "../../../chunks/arrow-up-C_G4jg8M.js";
|
|
9
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, markRaw, mergeProps, nextTick, normalizeClass, normalizeStyle, onMounted, openBlock, ref, renderList, renderSlot, toDisplayString, unref, useId, withCtx, withModifiers } from "vue";
|
|
13
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, markRaw, mergeProps, nextTick, normalizeClass, normalizeStyle, onMounted, onUnmounted, openBlock, ref, renderList, renderSlot, toDisplayString, unref, useId, watch, withCtx, withModifiers } from "vue";
|
|
10
14
|
//#region src/components/GrDataTable/grDataTableSort.ts
|
|
11
15
|
/** Пустое значение ячейки: нечего сравнивать, место таким — в конце списка. */
|
|
12
16
|
function isEmptyCell(value) {
|
|
@@ -83,48 +87,77 @@ var arrow_down_default = markRaw({
|
|
|
83
87
|
//#region src/components/GrDataTable/GrDataTable.vue?vue&type=script&setup=true&lang.ts
|
|
84
88
|
var _hoisted_1 = ["id"];
|
|
85
89
|
var _hoisted_2 = ["aria-rowindex"];
|
|
86
|
-
var _hoisted_3 = ["aria-sort"];
|
|
87
|
-
var _hoisted_4 = [
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
var _hoisted_3 = ["data-column-key", "aria-sort"];
|
|
91
|
+
var _hoisted_4 = [
|
|
92
|
+
"tabindex",
|
|
93
|
+
"aria-label",
|
|
94
|
+
"disabled",
|
|
95
|
+
"onPointerdown",
|
|
96
|
+
"onKeydown",
|
|
97
|
+
"onFocus"
|
|
98
|
+
];
|
|
99
|
+
var _hoisted_5 = ["onClick"];
|
|
100
|
+
var _hoisted_6 = { class: "sr-only" };
|
|
101
|
+
var _hoisted_7 = {
|
|
90
102
|
class: "inline-flex",
|
|
91
103
|
"aria-hidden": "true"
|
|
92
104
|
};
|
|
93
|
-
var
|
|
94
|
-
key:
|
|
105
|
+
var _hoisted_8 = {
|
|
106
|
+
key: 2,
|
|
95
107
|
class: "text-[var(--gr-muted-fg)]"
|
|
96
108
|
};
|
|
97
|
-
var
|
|
109
|
+
var _hoisted_9 = [
|
|
110
|
+
"aria-label",
|
|
111
|
+
"aria-valuenow",
|
|
112
|
+
"aria-valuetext",
|
|
113
|
+
"onPointerdown",
|
|
114
|
+
"onKeydown",
|
|
115
|
+
"onDblclick"
|
|
116
|
+
];
|
|
117
|
+
var _hoisted_10 = {
|
|
98
118
|
key: 0,
|
|
99
119
|
"data-gr-datatable-loading": ""
|
|
100
120
|
};
|
|
101
|
-
var
|
|
102
|
-
var
|
|
103
|
-
var
|
|
121
|
+
var _hoisted_11 = ["colspan"];
|
|
122
|
+
var _hoisted_12 = { class: "inline-flex items-center gap-2" };
|
|
123
|
+
var _hoisted_13 = {
|
|
104
124
|
key: 1,
|
|
105
125
|
"data-gr-datatable-empty": ""
|
|
106
126
|
};
|
|
107
|
-
var
|
|
108
|
-
var
|
|
127
|
+
var _hoisted_14 = ["colspan"];
|
|
128
|
+
var _hoisted_15 = {
|
|
109
129
|
key: 0,
|
|
110
130
|
"aria-hidden": "true",
|
|
111
131
|
"data-gr-datatable-spacer": "before",
|
|
112
132
|
style: { pointerEvents: "none" }
|
|
113
133
|
};
|
|
114
|
-
var
|
|
115
|
-
var
|
|
134
|
+
var _hoisted_16 = ["colspan"];
|
|
135
|
+
var _hoisted_17 = [
|
|
116
136
|
"data-row-key",
|
|
117
137
|
"data-selected",
|
|
118
138
|
"aria-rowindex",
|
|
119
139
|
"onClick"
|
|
120
140
|
];
|
|
121
|
-
var
|
|
141
|
+
var _hoisted_18 = {
|
|
122
142
|
key: 1,
|
|
123
143
|
"aria-hidden": "true",
|
|
124
144
|
"data-gr-datatable-spacer": "after",
|
|
125
145
|
style: { pointerEvents: "none" }
|
|
126
146
|
};
|
|
127
|
-
var
|
|
147
|
+
var _hoisted_19 = ["colspan"];
|
|
148
|
+
/**
|
|
149
|
+
* `GrDataTable` — data-таблица поверх `GrTable` с сортировкой по клику
|
|
150
|
+
* на заголовок и scoped-слотами ячеек (`#cell-<key>`), `#header-<key>`,
|
|
151
|
+
* `#caption`, `#footer`, `#empty`, `#loading`.
|
|
152
|
+
*
|
|
153
|
+
* Сортировка, включая крайние случаи с пустыми и смешанными значениями, живёт
|
|
154
|
+
* в `grDataTableSort.ts` — см. `docs/components/GrDataTable.md`.
|
|
155
|
+
*/
|
|
156
|
+
var MIN_COLUMN_WIDTH = 48;
|
|
157
|
+
/** Шаг клавиатуры и крупный шаг — как у `GrSplitter`. */
|
|
158
|
+
var RESIZE_STEP = 16;
|
|
159
|
+
var RESIZE_BIG_STEP = 48;
|
|
160
|
+
var SELECT_COLUMN_KEY = "__select__";
|
|
128
161
|
//#endregion
|
|
129
162
|
//#region src/components/GrDataTable/GrDataTable.vue
|
|
130
163
|
var GrDataTable_default = /* @__PURE__ */ defineComponent({
|
|
@@ -181,19 +214,34 @@ var GrDataTable_default = /* @__PURE__ */ defineComponent({
|
|
|
181
214
|
type: Boolean,
|
|
182
215
|
default: false
|
|
183
216
|
},
|
|
184
|
-
maxHeight: { default: void 0 }
|
|
217
|
+
maxHeight: { default: void 0 },
|
|
218
|
+
reorderableColumns: {
|
|
219
|
+
type: Boolean,
|
|
220
|
+
default: false
|
|
221
|
+
},
|
|
222
|
+
columnOrder: { default: void 0 },
|
|
223
|
+
resizableColumns: {
|
|
224
|
+
type: Boolean,
|
|
225
|
+
default: false
|
|
226
|
+
},
|
|
227
|
+
columnWidths: { default: void 0 }
|
|
185
228
|
},
|
|
186
229
|
emits: [
|
|
187
230
|
"update:sortKey",
|
|
188
231
|
"update:sortDir",
|
|
189
232
|
"sortChange",
|
|
190
233
|
"update:selected",
|
|
191
|
-
"rowClick"
|
|
234
|
+
"rowClick",
|
|
235
|
+
"update:columnOrder",
|
|
236
|
+
"columnReorder",
|
|
237
|
+
"update:columnWidths",
|
|
238
|
+
"columnResize"
|
|
192
239
|
],
|
|
193
240
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
194
241
|
const props = __props;
|
|
195
242
|
const emit = __emit;
|
|
196
243
|
const { t, locale } = useGranularityTranslations();
|
|
244
|
+
const { announce } = useAnnouncer();
|
|
197
245
|
const resolvedLoadingText = computed(() => props.loadingText ?? t("gr.dataTable.loading", "Loading…"));
|
|
198
246
|
const resolvedEmptyText = computed(() => props.emptyText ?? t("gr.dataTable.empty", "No data"));
|
|
199
247
|
const internalSortKey = ref(props.initialSortKey ?? "");
|
|
@@ -305,6 +353,57 @@ var GrDataTable_default = /* @__PURE__ */ defineComponent({
|
|
|
305
353
|
function ariaRowIndex(index) {
|
|
306
354
|
return props.virtual ? index + 2 : void 0;
|
|
307
355
|
}
|
|
356
|
+
const isEmpty = computed(() => sortedRows.value.length === 0);
|
|
357
|
+
const totalColumns = computed(() => props.columns.length + (props.selectable ? 1 : 0));
|
|
358
|
+
/** Uncontrolled-состояние; в controlled-режиме перекрывается пропом `columnOrder`. */
|
|
359
|
+
const internalColumnOrder = ref(props.columns.map((col) => String(col.key)));
|
|
360
|
+
/**
|
|
361
|
+
* Колонки в пользовательском порядке.
|
|
362
|
+
*
|
|
363
|
+
* Состав задаёт `columns`, порядок — только порядок: ключ, которого в наборе
|
|
364
|
+
* нет, игнорируется, а колонка, которой нет в порядке (её только что добавили),
|
|
365
|
+
* встаёт в конец. Иначе правка `columns` теряла бы колонки молча.
|
|
366
|
+
*/
|
|
367
|
+
const orderedColumns = computed(() => {
|
|
368
|
+
const order = props.columnOrder ?? internalColumnOrder.value;
|
|
369
|
+
const remaining = new Map(props.columns.map((col) => [String(col.key), col]));
|
|
370
|
+
const ordered = [];
|
|
371
|
+
for (const key of order) {
|
|
372
|
+
const col = remaining.get(key);
|
|
373
|
+
if (!col) continue;
|
|
374
|
+
remaining.delete(key);
|
|
375
|
+
ordered.push(col);
|
|
376
|
+
}
|
|
377
|
+
for (const col of props.columns) if (remaining.has(String(col.key))) ordered.push(col);
|
|
378
|
+
return ordered.sort((a, b) => pinGroupOf(a) - pinGroupOf(b));
|
|
379
|
+
});
|
|
380
|
+
/** Группа закрепления: 0 — слева, 1 — обычная колонка, 2 — справа. */
|
|
381
|
+
function pinGroupOf(col) {
|
|
382
|
+
if (col.pinned === "left") return 0;
|
|
383
|
+
if (col.pinned === "right") return 2;
|
|
384
|
+
return 1;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Сумма заданных ширин — минимальная ширина таблицы.
|
|
388
|
+
*
|
|
389
|
+
* Без неё фиксированная раскладка вписывает таблицу в контейнер и делит место
|
|
390
|
+
* пропорционально: колонка, которую пользователь растянул, ужимается обратно, а
|
|
391
|
+
* горизонтальной прокрутки — той самой, ради которой закрепляют колонки, — не
|
|
392
|
+
* возникает. Считается, только когда ширина известна у **всех** колонок: с
|
|
393
|
+
* одной неизвестной сумма врала бы.
|
|
394
|
+
*/
|
|
395
|
+
const tableMinWidth = computed(() => {
|
|
396
|
+
const cols = orderedColumns.value;
|
|
397
|
+
if (cols.length === 0) return void 0;
|
|
398
|
+
let total = 0;
|
|
399
|
+
for (const col of cols) {
|
|
400
|
+
const width = widthOf(col);
|
|
401
|
+
if (typeof width !== "number") return void 0;
|
|
402
|
+
total += width;
|
|
403
|
+
}
|
|
404
|
+
return total;
|
|
405
|
+
});
|
|
406
|
+
const columnKeys = computed(() => orderedColumns.value.map((col) => String(col.key)));
|
|
308
407
|
const tableProps = computed(() => ({
|
|
309
408
|
size: resolvedSize.value,
|
|
310
409
|
ariaLabel: props.ariaLabel,
|
|
@@ -313,10 +412,289 @@ var GrDataTable_default = /* @__PURE__ */ defineComponent({
|
|
|
313
412
|
stickyHeader: props.stickyHeader,
|
|
314
413
|
maxHeight: props.maxHeight,
|
|
315
414
|
rowCount: ariaRowCount.value,
|
|
316
|
-
fixedLayout: props.virtual
|
|
415
|
+
fixedLayout: props.virtual || props.resizableColumns,
|
|
416
|
+
tableMinWidth: tableMinWidth.value
|
|
317
417
|
}));
|
|
318
|
-
|
|
319
|
-
|
|
418
|
+
function indexOfColumn(key) {
|
|
419
|
+
return columnKeys.value.indexOf(key);
|
|
420
|
+
}
|
|
421
|
+
const headerCellEls = /* @__PURE__ */ new Map();
|
|
422
|
+
const columnHandleEls = /* @__PURE__ */ new Map();
|
|
423
|
+
function registerEl(store, key, el) {
|
|
424
|
+
if (el instanceof HTMLElement) {
|
|
425
|
+
store.set(key, el);
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
const previous = store.get(key);
|
|
429
|
+
if (previous && !previous.isConnected) store.delete(key);
|
|
430
|
+
}
|
|
431
|
+
function applyColumnMove(from, to) {
|
|
432
|
+
const keys = columnKeys.value;
|
|
433
|
+
if (from < 0 || to < 0 || to >= keys.length || from === to) return;
|
|
434
|
+
if (!sameGroup(from, to)) return;
|
|
435
|
+
const key = keys[from];
|
|
436
|
+
const label = orderedColumns.value[from]?.label ?? key;
|
|
437
|
+
const next = moveItem(keys, from, to);
|
|
438
|
+
internalColumnOrder.value = next;
|
|
439
|
+
emit("update:columnOrder", next);
|
|
440
|
+
emit("columnReorder", {
|
|
441
|
+
key,
|
|
442
|
+
from,
|
|
443
|
+
to
|
|
444
|
+
});
|
|
445
|
+
announce(t("gr.dataTable.columnMoved", "Column {label} moved to position {position} of {count}", {
|
|
446
|
+
label,
|
|
447
|
+
position: to + 1,
|
|
448
|
+
count: keys.length
|
|
449
|
+
}));
|
|
450
|
+
}
|
|
451
|
+
const columnSort = useDragSort({
|
|
452
|
+
items: () => columnKeys.value,
|
|
453
|
+
elementFor: (key) => headerCellEls.get(key) ?? null,
|
|
454
|
+
orientation: () => "horizontal",
|
|
455
|
+
disabled: () => !props.reorderableColumns || props.loading,
|
|
456
|
+
resolveTarget: (hit, source) => {
|
|
457
|
+
const to = insertionIndex(hit, indexOfColumn(source), columnKeys.value.length);
|
|
458
|
+
return sameGroup(indexOfColumn(source), to) ? to : null;
|
|
459
|
+
},
|
|
460
|
+
onDrop: (source, to) => applyColumnMove(indexOfColumn(source), to)
|
|
461
|
+
});
|
|
462
|
+
function sameGroup(from, to) {
|
|
463
|
+
const cols = orderedColumns.value;
|
|
464
|
+
if (!cols[from] || !cols[to]) return false;
|
|
465
|
+
return pinGroupOf(cols[from]) === pinGroupOf(cols[to]);
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* Кольцо роверного фокуса по ручкам: одна остановка `Tab` на всю шапку.
|
|
469
|
+
* Иначе таблица из десяти колонок добавляла бы десять таб-стопов подряд.
|
|
470
|
+
*/
|
|
471
|
+
const columnRoving = useRovingFocus({
|
|
472
|
+
items: () => props.reorderableColumns ? columnKeys.value : [],
|
|
473
|
+
elementFor: (key) => columnHandleEls.get(key) ?? null,
|
|
474
|
+
orientation: () => "horizontal",
|
|
475
|
+
wrap: () => false
|
|
476
|
+
});
|
|
477
|
+
async function onColumnHandleKeydown(event, key) {
|
|
478
|
+
if (!props.reorderableColumns) return;
|
|
479
|
+
if (event.shiftKey && (event.key === "ArrowLeft" || event.key === "ArrowRight")) {
|
|
480
|
+
event.preventDefault();
|
|
481
|
+
const from = indexOfColumn(key);
|
|
482
|
+
applyColumnMove(from, event.key === "ArrowLeft" ? from - 1 : from + 1);
|
|
483
|
+
await nextTick();
|
|
484
|
+
await columnRoving.focusKey(key);
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
487
|
+
columnRoving.handleNavigationKeys(event);
|
|
488
|
+
}
|
|
489
|
+
const draggingColumnKey = computed(() => columnSort.mode.value === null ? null : columnSort.source.value);
|
|
490
|
+
/** Полоса места вставки — на колонке-соседе, со стороны движения. */
|
|
491
|
+
function columnDropClass(index) {
|
|
492
|
+
const target = columnSort.target.value;
|
|
493
|
+
if (!columnSort.isActive.value || target === null || target !== index) return "";
|
|
494
|
+
const active = columnSort.source.value === null ? -1 : indexOfColumn(columnSort.source.value);
|
|
495
|
+
if (index === active) return "";
|
|
496
|
+
return target < active ? columnDropBeforeClass : columnDropAfterClass;
|
|
497
|
+
}
|
|
498
|
+
const columnHandleLabel = (col) => t("gr.dataTable.moveColumn", "Move column {label}", { label: col.label });
|
|
499
|
+
/** Уже колонки не бывает: в неё перестаёт помещаться даже стрелка сортировки. */
|
|
500
|
+
const internalColumnWidths = ref({});
|
|
501
|
+
const columnWidths = computed(() => props.columnWidths ?? internalColumnWidths.value);
|
|
502
|
+
/** Фактические ширины шапки: заполняются замером, см. `measureLayout`. */
|
|
503
|
+
const measuredColumnWidths = ref({});
|
|
504
|
+
/** Ширина колонки: заданная пользователем сильнее объявленной в `columns`. */
|
|
505
|
+
function widthOf(col) {
|
|
506
|
+
return columnWidths.value[String(col.key)] ?? col.width;
|
|
507
|
+
}
|
|
508
|
+
const resizingKey = ref(null);
|
|
509
|
+
let pendingResizeKey = null;
|
|
510
|
+
let resizeStartX = 0;
|
|
511
|
+
let resizeStartWidth = 0;
|
|
512
|
+
let widthBeforeResize;
|
|
513
|
+
function setColumnWidth(key, width) {
|
|
514
|
+
const next = {
|
|
515
|
+
...columnWidths.value,
|
|
516
|
+
[key]: Math.max(MIN_COLUMN_WIDTH, Math.round(width))
|
|
517
|
+
};
|
|
518
|
+
internalColumnWidths.value = next;
|
|
519
|
+
emit("update:columnWidths", next);
|
|
520
|
+
}
|
|
521
|
+
function announceWidth(key) {
|
|
522
|
+
const col = orderedColumns.value.find((item) => String(item.key) === key);
|
|
523
|
+
if (!col) return;
|
|
524
|
+
announce(t("gr.dataTable.columnResized", "Column {label} is {width} pixels wide", {
|
|
525
|
+
label: col.label,
|
|
526
|
+
width: columnWidths.value[key] ?? 0
|
|
527
|
+
}));
|
|
528
|
+
}
|
|
529
|
+
const resizeGesture = useDragGesture({
|
|
530
|
+
disabled: () => !props.resizableColumns || props.loading,
|
|
531
|
+
onStart: (event) => {
|
|
532
|
+
const key = pendingResizeKey;
|
|
533
|
+
const el = key === null ? null : headerCellEls.get(key);
|
|
534
|
+
if (key === null || !el) return false;
|
|
535
|
+
resizeStartX = event.clientX;
|
|
536
|
+
resizeStartWidth = el.getBoundingClientRect().width;
|
|
537
|
+
widthBeforeResize = columnWidths.value[key];
|
|
538
|
+
resizingKey.value = key;
|
|
539
|
+
},
|
|
540
|
+
onMove: (event) => {
|
|
541
|
+
if (resizingKey.value === null) return;
|
|
542
|
+
event.preventDefault();
|
|
543
|
+
setColumnWidth(resizingKey.value, resizeStartWidth + (event.clientX - resizeStartX));
|
|
544
|
+
},
|
|
545
|
+
onEnd: () => {
|
|
546
|
+
const key = resizingKey.value;
|
|
547
|
+
resizingKey.value = null;
|
|
548
|
+
if (key === null) return;
|
|
549
|
+
emit("columnResize", {
|
|
550
|
+
key,
|
|
551
|
+
width: columnWidths.value[key] ?? Math.round(resizeStartWidth)
|
|
552
|
+
});
|
|
553
|
+
announceWidth(key);
|
|
554
|
+
},
|
|
555
|
+
onCancel: () => {
|
|
556
|
+
const key = resizingKey.value;
|
|
557
|
+
resizingKey.value = null;
|
|
558
|
+
if (key === null) return;
|
|
559
|
+
const next = { ...columnWidths.value };
|
|
560
|
+
if (widthBeforeResize === void 0) delete next[key];
|
|
561
|
+
else next[key] = widthBeforeResize;
|
|
562
|
+
internalColumnWidths.value = next;
|
|
563
|
+
emit("update:columnWidths", next);
|
|
564
|
+
}
|
|
565
|
+
});
|
|
566
|
+
function onResizerPointerDown(event, key) {
|
|
567
|
+
pendingResizeKey = key;
|
|
568
|
+
resizeGesture.start(event);
|
|
569
|
+
}
|
|
570
|
+
/** Сброс к авторазметке: колонка снова считается по содержимому. */
|
|
571
|
+
function resetColumnWidth(key) {
|
|
572
|
+
if (columnWidths.value[key] === void 0) return;
|
|
573
|
+
const next = { ...columnWidths.value };
|
|
574
|
+
delete next[key];
|
|
575
|
+
internalColumnWidths.value = next;
|
|
576
|
+
emit("update:columnWidths", next);
|
|
577
|
+
emit("columnResize", {
|
|
578
|
+
key,
|
|
579
|
+
width: 0
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
function resizeByKeyboard(key, delta) {
|
|
583
|
+
const measured = headerCellEls.get(key)?.getBoundingClientRect().width ?? MIN_COLUMN_WIDTH;
|
|
584
|
+
const current = columnWidths.value[key] ?? measured;
|
|
585
|
+
setColumnWidth(key, current + delta);
|
|
586
|
+
emit("columnResize", {
|
|
587
|
+
key,
|
|
588
|
+
width: columnWidths.value[key] ?? current
|
|
589
|
+
});
|
|
590
|
+
announceWidth(key);
|
|
591
|
+
}
|
|
592
|
+
function onResizerKeydown(event, key) {
|
|
593
|
+
if (!props.resizableColumns || props.loading) return;
|
|
594
|
+
const step = event.shiftKey ? RESIZE_BIG_STEP : RESIZE_STEP;
|
|
595
|
+
if (event.key === "ArrowLeft" || event.key === "ArrowRight") {
|
|
596
|
+
event.preventDefault();
|
|
597
|
+
resizeByKeyboard(key, event.key === "ArrowLeft" ? -step : step);
|
|
598
|
+
return;
|
|
599
|
+
}
|
|
600
|
+
if (event.key === "Enter") {
|
|
601
|
+
event.preventDefault();
|
|
602
|
+
resetColumnWidth(key);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
function resizerLabel(col) {
|
|
606
|
+
return t("gr.dataTable.resizeColumn", "Width of column {label}", { label: col.label });
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Ручка ресайза — фокусируемый `separator`, а значит обязана называть текущее
|
|
610
|
+
* значение с первого рендера, до всякого перетаскивания. Заданной ширины у
|
|
611
|
+
* колонки может не быть вовсе (авторазметка), поэтому за значением идём к
|
|
612
|
+
* измеренной; до замера остаётся объявленная в `columns`, а её тоже может не
|
|
613
|
+
* быть — тогда минимум.
|
|
614
|
+
*/
|
|
615
|
+
function resizerValue(col) {
|
|
616
|
+
const key = String(col.key);
|
|
617
|
+
const declared = typeof col.width === "number" ? col.width : void 0;
|
|
618
|
+
return columnWidths.value[key] ?? measuredColumnWidths.value[key] ?? declared ?? MIN_COLUMN_WIDTH;
|
|
619
|
+
}
|
|
620
|
+
/** Служебная колонка выбора в реестре ячеек: своего ключа у неё нет. */
|
|
621
|
+
const hasPinnedLeft = computed(() => orderedColumns.value.some((col) => col.pinned === "left"));
|
|
622
|
+
const pinnedOffsets = ref({});
|
|
623
|
+
/**
|
|
624
|
+
* Смещения липких колонок считаются по **измеренным** ширинам соседей: колонка
|
|
625
|
+
* может жить на авторазметке, и тогда взять смещение больше неоткуда. Отсюда же
|
|
626
|
+
* порядок: замер после отрисовки, а не в вычислении.
|
|
627
|
+
*/
|
|
628
|
+
function measurePinnedOffsets() {
|
|
629
|
+
const next = {};
|
|
630
|
+
const cols = orderedColumns.value;
|
|
631
|
+
let left = props.selectable && hasPinnedLeft.value ? headerCellEls.get(SELECT_COLUMN_KEY)?.getBoundingClientRect().width ?? 0 : 0;
|
|
632
|
+
for (const col of cols) {
|
|
633
|
+
if (col.pinned !== "left") continue;
|
|
634
|
+
next[String(col.key)] = left;
|
|
635
|
+
left += headerCellEls.get(String(col.key))?.getBoundingClientRect().width ?? 0;
|
|
636
|
+
}
|
|
637
|
+
let right = 0;
|
|
638
|
+
for (let index = cols.length - 1; index >= 0; index -= 1) {
|
|
639
|
+
const col = cols[index];
|
|
640
|
+
if (col.pinned !== "right") continue;
|
|
641
|
+
next[String(col.key)] = right;
|
|
642
|
+
right += headerCellEls.get(String(col.key))?.getBoundingClientRect().width ?? 0;
|
|
643
|
+
}
|
|
644
|
+
pinnedOffsets.value = next;
|
|
645
|
+
}
|
|
646
|
+
function measureColumnWidths() {
|
|
647
|
+
if (!props.resizableColumns) return;
|
|
648
|
+
const next = {};
|
|
649
|
+
for (const col of orderedColumns.value) {
|
|
650
|
+
const key = String(col.key);
|
|
651
|
+
const width = headerCellEls.get(key)?.getBoundingClientRect().width;
|
|
652
|
+
if (width) next[key] = Math.round(width);
|
|
653
|
+
}
|
|
654
|
+
measuredColumnWidths.value = next;
|
|
655
|
+
}
|
|
656
|
+
function measureLayout() {
|
|
657
|
+
measurePinnedOffsets();
|
|
658
|
+
measureColumnWidths();
|
|
659
|
+
}
|
|
660
|
+
function pinnedStyleOf(col) {
|
|
661
|
+
if (!col.pinned) return void 0;
|
|
662
|
+
const offset = pinnedOffsets.value[String(col.key)] ?? 0;
|
|
663
|
+
return col.pinned === "left" ? { left: `${offset}px` } : { right: `${offset}px` };
|
|
664
|
+
}
|
|
665
|
+
/** Тень рисует только крайняя колонка группы — иначе полос было бы столько же, сколько колонок. */
|
|
666
|
+
function pinnedEdgeClass(col, index) {
|
|
667
|
+
if (col.pinned === "left") return orderedColumns.value[index + 1]?.pinned === "left" ? "" : columnPinnedLeftEdgeClass;
|
|
668
|
+
if (col.pinned === "right") return orderedColumns.value[index - 1]?.pinned === "right" ? "" : columnPinnedRightEdgeClass;
|
|
669
|
+
return "";
|
|
670
|
+
}
|
|
671
|
+
function pinnedCellClass(col, index) {
|
|
672
|
+
if (!col.pinned) return [];
|
|
673
|
+
return [columnPinnedClass, pinnedEdgeClass(col, index)];
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* Ширину колонки меняет не только правка пропов: окно, шрифт и содержимое
|
|
677
|
+
* ячейки двигают её сами. `ResizeObserver` — единственный способ узнать об этом;
|
|
678
|
+
* в jsdom и на сервере его нет, там хватает пересчёта по изменению данных.
|
|
679
|
+
*/
|
|
680
|
+
let layoutObserver = null;
|
|
681
|
+
onMounted(() => {
|
|
682
|
+
measureLayout();
|
|
683
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
684
|
+
layoutObserver = new ResizeObserver(() => measureLayout());
|
|
685
|
+
const el = headerCellEls.get(SELECT_COLUMN_KEY) ?? headerCellEls.get(columnKeys.value[0]);
|
|
686
|
+
if (el?.parentElement) layoutObserver.observe(el.parentElement);
|
|
687
|
+
});
|
|
688
|
+
onUnmounted(() => {
|
|
689
|
+
layoutObserver?.disconnect();
|
|
690
|
+
layoutObserver = null;
|
|
691
|
+
});
|
|
692
|
+
watch(() => [
|
|
693
|
+
orderedColumns.value,
|
|
694
|
+
columnWidths.value,
|
|
695
|
+
props.loading,
|
|
696
|
+
props.rows.length
|
|
697
|
+
], () => void nextTick(measureLayout));
|
|
320
698
|
/**
|
|
321
699
|
* Живой регион существует с первого рендера и пуст, пока объявлять нечего.
|
|
322
700
|
* Регион, который появляется уже с текстом, часть AT не объявляет вовсе —
|
|
@@ -478,7 +856,13 @@ var GrDataTable_default = /* @__PURE__ */ defineComponent({
|
|
|
478
856
|
"aria-rowindex": __props.virtual ? 1 : void 0
|
|
479
857
|
}, [__props.selectable ? (openBlock(), createElementBlock("th", {
|
|
480
858
|
key: 0,
|
|
481
|
-
|
|
859
|
+
ref: (el) => registerEl(unref(headerCellEls), SELECT_COLUMN_KEY, el),
|
|
860
|
+
class: normalizeClass(["text-left", [
|
|
861
|
+
selectColumnClass.value,
|
|
862
|
+
cellClass.value,
|
|
863
|
+
hasPinnedLeft.value ? unref(columnPinnedClass) : ""
|
|
864
|
+
]]),
|
|
865
|
+
style: normalizeStyle(hasPinnedLeft.value ? { left: "0px" } : void 0),
|
|
482
866
|
scope: "col"
|
|
483
867
|
}, [createVNode(GrCheckbox_default, {
|
|
484
868
|
"data-gr-datatable-select-all": "",
|
|
@@ -494,27 +878,54 @@ var GrDataTable_default = /* @__PURE__ */ defineComponent({
|
|
|
494
878
|
"size",
|
|
495
879
|
"disabled",
|
|
496
880
|
"aria-label"
|
|
497
|
-
])],
|
|
881
|
+
])], 6)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(orderedColumns.value, (col, colIndex) => {
|
|
498
882
|
return openBlock(), createElementBlock("th", {
|
|
499
883
|
key: col.key,
|
|
884
|
+
ref_for: true,
|
|
885
|
+
ref: (el) => registerEl(unref(headerCellEls), String(col.key), el),
|
|
500
886
|
class: normalizeClass(["font-700", [
|
|
501
887
|
headerTextClass.value,
|
|
502
888
|
cellClass.value,
|
|
503
|
-
cellAlign(col)
|
|
889
|
+
cellAlign(col),
|
|
890
|
+
__props.reorderableColumns || __props.resizableColumns ? "group relative" : "",
|
|
891
|
+
draggingColumnKey.value === String(col.key) ? unref(columnDraggingClass) : "",
|
|
892
|
+
columnDropClass(colIndex),
|
|
893
|
+
...pinnedCellClass(col, colIndex)
|
|
504
894
|
]]),
|
|
505
|
-
|
|
895
|
+
"data-column-key": col.key,
|
|
896
|
+
style: normalizeStyle({
|
|
897
|
+
...columnWidthStyle(widthOf(col)),
|
|
898
|
+
...pinnedStyleOf(col)
|
|
899
|
+
}),
|
|
506
900
|
"aria-sort": ariaSortFor(col),
|
|
507
901
|
scope: "col"
|
|
508
|
-
}, [createElementVNode("div", { class: normalizeClass(["inline-flex items-center", headerGapClass.value]) }, [
|
|
902
|
+
}, [createElementVNode("div", { class: normalizeClass(["inline-flex items-center", headerGapClass.value]) }, [__props.reorderableColumns ? (openBlock(), createElementBlock("button", {
|
|
509
903
|
key: 0,
|
|
904
|
+
ref_for: true,
|
|
905
|
+
ref: (el) => registerEl(unref(columnHandleEls), String(col.key), el),
|
|
906
|
+
type: "button",
|
|
907
|
+
"data-gr-datatable-column-handle": "",
|
|
908
|
+
class: normalizeClass([unref(columnHandleClass), unref(columnSort).isActive.value ? unref(columnHandleActiveClass) : ""]),
|
|
909
|
+
tabindex: unref(columnRoving).tabindexFor(String(col.key)),
|
|
910
|
+
"aria-label": columnHandleLabel(col),
|
|
911
|
+
disabled: __props.loading,
|
|
912
|
+
onPointerdown: ($event) => unref(columnSort).startFrom(String(col.key))($event),
|
|
913
|
+
onKeydown: ($event) => onColumnHandleKeydown($event, String(col.key)),
|
|
914
|
+
onFocus: ($event) => unref(columnRoving).setActive(String(col.key)),
|
|
915
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(() => {}, ["stop"]))
|
|
916
|
+
}, [createElementVNode("span", {
|
|
917
|
+
class: normalizeClass(unref(columnHandleIconClass)),
|
|
918
|
+
"aria-hidden": "true"
|
|
919
|
+
}, null, 2)], 42, _hoisted_4)) : createCommentVNode("", true), col.sortable ? (openBlock(), createElementBlock("button", {
|
|
920
|
+
key: 1,
|
|
510
921
|
type: "button",
|
|
511
922
|
"data-gr-datatable-sort": "",
|
|
512
923
|
class: normalizeClass(["inline-flex items-center text-[var(--gr-muted-fg)] hover:text-[var(--gr-fg)] transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--gr-ring)] rounded-[var(--gr-radius-sm)]", headerGapClass.value]),
|
|
513
924
|
onClick: ($event) => toggleSort(col)
|
|
514
925
|
}, [
|
|
515
926
|
createElementVNode("span", null, [renderSlot(_ctx.$slots, `header-${col.key}`, { column: col }, () => [createTextVNode(toDisplayString(col.label), 1)])]),
|
|
516
|
-
createElementVNode("span",
|
|
517
|
-
createElementVNode("span",
|
|
927
|
+
createElementVNode("span", _hoisted_6, toDisplayString(sortHint(col)), 1),
|
|
928
|
+
createElementVNode("span", _hoisted_7, [currentSortKey.value === col.key && currentSortDir.value === "asc" ? (openBlock(), createBlock(GrIcon_default, {
|
|
518
929
|
key: 0,
|
|
519
930
|
size: sortIconSize.value
|
|
520
931
|
}, {
|
|
@@ -527,70 +938,107 @@ var GrDataTable_default = /* @__PURE__ */ defineComponent({
|
|
|
527
938
|
default: withCtx(() => [createVNode(unref(arrow_down_default))]),
|
|
528
939
|
_: 1
|
|
529
940
|
}, 8, ["size"])) : createCommentVNode("", true)])
|
|
530
|
-
], 10,
|
|
941
|
+
], 10, _hoisted_5)) : (openBlock(), createElementBlock("span", _hoisted_8, [renderSlot(_ctx.$slots, `header-${col.key}`, { column: col }, () => [createTextVNode(toDisplayString(col.label), 1)])]))], 2), __props.resizableColumns ? (openBlock(), createElementBlock("span", {
|
|
942
|
+
key: 0,
|
|
943
|
+
"data-gr-datatable-column-resizer": "",
|
|
944
|
+
role: "separator",
|
|
945
|
+
tabindex: "0",
|
|
946
|
+
"aria-orientation": "vertical",
|
|
947
|
+
class: normalizeClass(unref(columnResizerClass)),
|
|
948
|
+
"aria-label": resizerLabel(col),
|
|
949
|
+
"aria-valuenow": resizerValue(col),
|
|
950
|
+
"aria-valuemin": MIN_COLUMN_WIDTH,
|
|
951
|
+
"aria-valuetext": `${resizerValue(col)}px`,
|
|
952
|
+
onPointerdown: ($event) => onResizerPointerDown($event, String(col.key)),
|
|
953
|
+
onKeydown: ($event) => onResizerKeydown($event, String(col.key)),
|
|
954
|
+
onDblclick: ($event) => resetColumnWidth(String(col.key)),
|
|
955
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"]))
|
|
956
|
+
}, [createElementVNode("span", {
|
|
957
|
+
class: normalizeClass([
|
|
958
|
+
unref(columnResizerLineClass),
|
|
959
|
+
unref(columnResizerHoverClass),
|
|
960
|
+
resizingKey.value === String(col.key) ? unref(columnResizerLineActiveClass) : ""
|
|
961
|
+
]),
|
|
962
|
+
"aria-hidden": "true"
|
|
963
|
+
}, null, 2)], 42, _hoisted_9)) : createCommentVNode("", true)], 14, _hoisted_3);
|
|
531
964
|
}), 128))], 8, _hoisted_2)]),
|
|
532
|
-
default: withCtx(() => [__props.loading ? (openBlock(), createElementBlock("tr",
|
|
965
|
+
default: withCtx(() => [__props.loading ? (openBlock(), createElementBlock("tr", _hoisted_10, [createElementVNode("td", {
|
|
533
966
|
colspan: totalColumns.value,
|
|
534
967
|
class: normalizeClass(["text-center text-[var(--gr-muted-fg)]", placeholderClass.value])
|
|
535
|
-
}, [renderSlot(_ctx.$slots, "loading", {}, () => [createElementVNode("span",
|
|
968
|
+
}, [renderSlot(_ctx.$slots, "loading", {}, () => [createElementVNode("span", _hoisted_12, [createElementVNode("span", {
|
|
536
969
|
class: normalizeClass(["i-lucide-loader-circle block animate-spin", spinnerClass.value]),
|
|
537
970
|
"aria-hidden": "true"
|
|
538
|
-
}, null, 2), createElementVNode("span", null, toDisplayString(resolvedLoadingText.value), 1)])])], 10,
|
|
971
|
+
}, null, 2), createElementVNode("span", null, toDisplayString(resolvedLoadingText.value), 1)])])], 10, _hoisted_11)])) : isEmpty.value ? (openBlock(), createElementBlock("tr", _hoisted_13, [createElementVNode("td", {
|
|
539
972
|
colspan: totalColumns.value,
|
|
540
973
|
class: normalizeClass(["text-center text-[var(--gr-muted-fg)]", placeholderClass.value])
|
|
541
|
-
}, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(resolvedEmptyText.value), 1)])], 10,
|
|
542
|
-
__props.virtual && spacerBefore.value > 0 ? (openBlock(), createElementBlock("tr",
|
|
974
|
+
}, [renderSlot(_ctx.$slots, "empty", {}, () => [createTextVNode(toDisplayString(resolvedEmptyText.value), 1)])], 10, _hoisted_14)])) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
975
|
+
__props.virtual && spacerBefore.value > 0 ? (openBlock(), createElementBlock("tr", _hoisted_15, [createElementVNode("td", {
|
|
543
976
|
colspan: totalColumns.value,
|
|
544
977
|
style: normalizeStyle({
|
|
545
978
|
height: `${spacerBefore.value}px`,
|
|
546
979
|
padding: "0",
|
|
547
980
|
border: "0"
|
|
548
981
|
})
|
|
549
|
-
}, null, 12,
|
|
982
|
+
}, null, 12, _hoisted_16)])) : createCommentVNode("", true),
|
|
550
983
|
(openBlock(true), createElementBlock(Fragment, null, renderList(renderedRows.value, ({ row, index }) => {
|
|
551
984
|
return openBlock(), createElementBlock("tr", mergeProps({
|
|
552
985
|
key: rowKeyValue(row),
|
|
553
986
|
ref_for: true,
|
|
554
987
|
ref: (el) => __props.virtual && unref(virtualizer).measure(index, el),
|
|
555
|
-
class: ["border-t border-[var(--gr-brd)]", [isRowSelected(row) ?
|
|
988
|
+
class: ["border-t border-[var(--gr-brd)]", [isRowSelected(row) ? unref(rowSelectedClass) : "", rowClassName(row, index)]],
|
|
556
989
|
"data-gr-datatable-row": "",
|
|
557
990
|
"data-row-key": rowKeyValue(row),
|
|
558
991
|
"data-selected": __props.selectable && isRowSelected(row) ? "true" : void 0,
|
|
559
992
|
"aria-rowindex": ariaRowIndex(index)
|
|
560
993
|
}, { ref_for: true }, __props.rowProps?.(row, index), { onClick: ($event) => onRowClick(row, index, $event) }), [__props.selectable ? (openBlock(), createElementBlock("td", {
|
|
561
994
|
key: 0,
|
|
562
|
-
class: normalizeClass(["text-left", [
|
|
995
|
+
class: normalizeClass(["text-left", [
|
|
996
|
+
selectColumnClass.value,
|
|
997
|
+
cellClass.value,
|
|
998
|
+
hasPinnedLeft.value ? unref(columnPinnedClass) : "",
|
|
999
|
+
hasPinnedLeft.value && isRowSelected(row) ? unref(rowSelectedClass) : ""
|
|
1000
|
+
]]),
|
|
1001
|
+
style: normalizeStyle(hasPinnedLeft.value ? { left: "0px" } : void 0)
|
|
563
1002
|
}, [isRowSelectable(row) ? (openBlock(), createBlock(GrCheckbox_default, {
|
|
564
1003
|
key: 0,
|
|
565
1004
|
"data-gr-datatable-select-row": "",
|
|
566
1005
|
"model-value": isRowSelected(row),
|
|
567
1006
|
size: checkboxSize.value,
|
|
568
1007
|
"aria-label": unref(t)("gr.dataTable.selectRow", "Select row"),
|
|
569
|
-
onClick: _cache[
|
|
1008
|
+
onClick: _cache[2] || (_cache[2] = withModifiers(() => {}, ["stop"])),
|
|
570
1009
|
"onUpdate:modelValue": ($event) => toggleRow(row)
|
|
571
1010
|
}, null, 8, [
|
|
572
1011
|
"model-value",
|
|
573
1012
|
"size",
|
|
574
1013
|
"aria-label",
|
|
575
1014
|
"onUpdate:modelValue"
|
|
576
|
-
])) : createCommentVNode("", true)],
|
|
1015
|
+
])) : createCommentVNode("", true)], 6)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(orderedColumns.value, (col, colIndex) => {
|
|
577
1016
|
return openBlock(), createElementBlock("td", {
|
|
578
1017
|
key: col.key,
|
|
579
|
-
class: normalizeClass([
|
|
1018
|
+
class: normalizeClass([
|
|
1019
|
+
cellClass.value,
|
|
1020
|
+
cellAlign(col),
|
|
1021
|
+
...pinnedCellClass(col, colIndex),
|
|
1022
|
+
col.pinned && isRowSelected(row) ? unref(rowSelectedClass) : ""
|
|
1023
|
+
]),
|
|
1024
|
+
style: normalizeStyle({
|
|
1025
|
+
...columnWidthStyle(widthOf(col)),
|
|
1026
|
+
...pinnedStyleOf(col)
|
|
1027
|
+
})
|
|
580
1028
|
}, [renderSlot(_ctx.$slots, `cell-${col.key}`, {
|
|
581
1029
|
row,
|
|
582
1030
|
index
|
|
583
|
-
}, () => [createElementVNode("span", null, toDisplayString(cellValue(row, col.key)), 1)])],
|
|
584
|
-
}), 128))], 16,
|
|
1031
|
+
}, () => [createElementVNode("span", null, toDisplayString(cellValue(row, col.key)), 1)])], 6);
|
|
1032
|
+
}), 128))], 16, _hoisted_17);
|
|
585
1033
|
}), 128)),
|
|
586
|
-
__props.virtual && spacerAfter.value > 0 ? (openBlock(), createElementBlock("tr",
|
|
1034
|
+
__props.virtual && spacerAfter.value > 0 ? (openBlock(), createElementBlock("tr", _hoisted_18, [createElementVNode("td", {
|
|
587
1035
|
colspan: totalColumns.value,
|
|
588
1036
|
style: normalizeStyle({
|
|
589
1037
|
height: `${spacerAfter.value}px`,
|
|
590
1038
|
padding: "0",
|
|
591
1039
|
border: "0"
|
|
592
1040
|
})
|
|
593
|
-
}, null, 12,
|
|
1041
|
+
}, null, 12, _hoisted_19)])) : createCommentVNode("", true)
|
|
594
1042
|
], 64))]),
|
|
595
1043
|
_: 2
|
|
596
1044
|
}, [_ctx.$slots.footer ? {
|