@feugene/granularity 0.4.0 → 0.4.2
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/_plugin-vue_export-helper-BG_EqiDU.js +8 -0
- package/dist/chunks/adapter-K6zZTzBi.js +4 -0
- package/dist/chunks/adapter-K6zZTzBi.js.map +1 -0
- package/dist/chunks/arrow-up-DNXrMoAI.js +23 -0
- package/dist/chunks/arrow-up-DNXrMoAI.js.map +1 -0
- package/dist/chunks/classTokens-BPeBXNzu.js +6 -0
- package/dist/chunks/classTokens-BPeBXNzu.js.map +1 -0
- package/dist/chunks/config-1I95Zy4V.js +14 -0
- package/dist/chunks/config-1I95Zy4V.js.map +1 -0
- package/dist/chunks/config-2wgwWaAB.js +8 -0
- package/dist/chunks/config-2wgwWaAB.js.map +1 -0
- package/dist/chunks/config-BA0BWYzs.js +8 -0
- package/dist/chunks/config-BA0BWYzs.js.map +1 -0
- package/dist/chunks/config-BCPyma1I.js +8 -0
- package/dist/chunks/config-BCPyma1I.js.map +1 -0
- package/dist/chunks/config-BDlh6iNz.js +24 -0
- package/dist/chunks/config-BDlh6iNz.js.map +1 -0
- package/dist/chunks/config-BKRmlivc.js +8 -0
- package/dist/chunks/config-BKRmlivc.js.map +1 -0
- package/dist/chunks/config-BN-B2K4r.js +17 -0
- package/dist/chunks/config-BN-B2K4r.js.map +1 -0
- package/dist/chunks/config-BNOf_qjD.js +40 -0
- package/dist/chunks/config-BNOf_qjD.js.map +1 -0
- package/dist/chunks/config-BaMO9dQh.js +20 -0
- package/dist/chunks/config-BaMO9dQh.js.map +1 -0
- package/dist/chunks/config-Bv2G0OU6.js +8 -0
- package/dist/chunks/config-Bv2G0OU6.js.map +1 -0
- package/dist/chunks/config-BvuQUBtZ.js +21 -0
- package/dist/chunks/config-BvuQUBtZ.js.map +1 -0
- package/dist/chunks/config-BzZGpWsj.js +9 -0
- package/dist/chunks/config-BzZGpWsj.js.map +1 -0
- package/dist/chunks/config-C0j836dC.js +8 -0
- package/dist/chunks/config-C0j836dC.js.map +1 -0
- package/dist/chunks/config-C2iI7_QX.js +9 -0
- package/dist/chunks/config-C2iI7_QX.js.map +1 -0
- package/dist/chunks/config-C4AlNm912.js +13 -0
- package/dist/chunks/config-C4AlNm912.js.map +1 -0
- package/dist/chunks/config-C5SJXHQ4.js +9 -0
- package/dist/chunks/config-C5SJXHQ4.js.map +1 -0
- package/dist/chunks/config-C6SBJxcH.js +8 -0
- package/dist/chunks/config-C6SBJxcH.js.map +1 -0
- package/dist/chunks/config-CByfsV-z2.js +9 -0
- package/dist/chunks/config-CByfsV-z2.js.map +1 -0
- package/dist/chunks/config-CM7nbATU2.js +78 -0
- package/dist/chunks/config-CM7nbATU2.js.map +1 -0
- package/dist/chunks/config-CMZE2fu0.js +9 -0
- package/dist/chunks/config-CMZE2fu0.js.map +1 -0
- package/dist/chunks/config-CU_CBd0k.js +22 -0
- package/dist/chunks/config-CU_CBd0k.js.map +1 -0
- package/dist/chunks/config-CUgvsjZx.js +171 -0
- package/dist/chunks/config-CUgvsjZx.js.map +1 -0
- package/dist/chunks/config-CWvHiaqr2.js +23 -0
- package/dist/chunks/config-CWvHiaqr2.js.map +1 -0
- package/dist/chunks/config-Cf0J6wCX.js +58 -0
- package/dist/chunks/config-Cf0J6wCX.js.map +1 -0
- package/dist/chunks/config-CgAY2WP9.js +9 -0
- package/dist/chunks/config-CgAY2WP9.js.map +1 -0
- package/dist/chunks/config-Cgc-D1K4.js +9 -0
- package/dist/chunks/config-Cgc-D1K4.js.map +1 -0
- package/dist/chunks/config-D19pyP4D.js +35 -0
- package/dist/chunks/config-D19pyP4D.js.map +1 -0
- package/dist/chunks/config-DCQO6H6h.js +11 -0
- package/dist/chunks/config-DCQO6H6h.js.map +1 -0
- package/dist/chunks/config-DEv4m-ZP.js +58 -0
- package/dist/chunks/config-DEv4m-ZP.js.map +1 -0
- package/dist/chunks/config-DFRYOcrP.js +9 -0
- package/dist/chunks/config-DFRYOcrP.js.map +1 -0
- package/dist/chunks/config-DTpwUHgF.js +9 -0
- package/dist/chunks/config-DTpwUHgF.js.map +1 -0
- package/dist/chunks/config-DW_RqmUp.js +8 -0
- package/dist/chunks/config-DW_RqmUp.js.map +1 -0
- package/dist/chunks/config-Da90XGsi.js +38 -0
- package/dist/chunks/config-Da90XGsi.js.map +1 -0
- package/dist/chunks/config-DgRJlF00.js +53 -0
- package/dist/chunks/config-DgRJlF00.js.map +1 -0
- package/dist/chunks/config-Dkq0HeLe.js +9 -0
- package/dist/chunks/config-Dkq0HeLe.js.map +1 -0
- package/dist/chunks/config-DmI1IQvI2.js +8 -0
- package/dist/chunks/config-DmI1IQvI2.js.map +1 -0
- package/dist/chunks/config-Dnu4VuO0.js +8 -0
- package/dist/chunks/config-Dnu4VuO0.js.map +1 -0
- package/dist/chunks/config-DxqpV-KM.js +45 -0
- package/dist/chunks/config-DxqpV-KM.js.map +1 -0
- package/dist/chunks/config-TyzU6gLf.js +8 -0
- package/dist/chunks/config-TyzU6gLf.js.map +1 -0
- package/dist/chunks/config-XwI6t8cn.js +39 -0
- package/dist/chunks/config-XwI6t8cn.js.map +1 -0
- package/dist/chunks/config-bpQYM5O-.js +44 -0
- package/dist/chunks/config-bpQYM5O-.js.map +1 -0
- package/dist/chunks/config-etXh7Bsr2.js +9 -0
- package/dist/chunks/config-etXh7Bsr2.js.map +1 -0
- package/dist/chunks/config-fCcRwjIB.js +13 -0
- package/dist/chunks/config-fCcRwjIB.js.map +1 -0
- package/dist/chunks/config-nfOMJXVs.js +9 -0
- package/dist/chunks/config-nfOMJXVs.js.map +1 -0
- package/dist/chunks/config-qJXIIY1E.js +8 -0
- package/dist/chunks/config-qJXIIY1E.js.map +1 -0
- package/dist/chunks/config-r6hzn2Bn2.js +9 -0
- package/dist/chunks/config-r6hzn2Bn2.js.map +1 -0
- package/dist/chunks/config-rQlbnEKn.js +8 -0
- package/dist/chunks/config-rQlbnEKn.js.map +1 -0
- package/dist/chunks/dialogShared-BtXUk6Zc.js +32 -0
- package/dist/chunks/dialogShared-BtXUk6Zc.js.map +1 -0
- package/dist/chunks/en-BeJa78lP.js +48 -0
- package/dist/chunks/en-BeJa78lP.js.map +1 -0
- package/dist/chunks/es-BPqm7rLm.js +20 -0
- package/dist/chunks/es-BPqm7rLm.js.map +1 -0
- package/dist/chunks/es-axYOwwWD.js +48 -0
- package/dist/chunks/es-axYOwwWD.js.map +1 -0
- package/dist/chunks/fileValidation-CwJA8Vmn.js +219 -0
- package/dist/chunks/fileValidation-CwJA8Vmn.js.map +1 -0
- package/dist/chunks/{grBadgeStyles-Bu4H8bFc.js → grBadgeStyles-pqqbVgLk.js} +18 -13
- package/dist/chunks/grBadgeStyles-pqqbVgLk.js.map +1 -0
- package/dist/chunks/{grButtonStyles-C5k0bN2e.js → grButtonStyles-BxZW2x0-.js} +60 -52
- package/dist/chunks/grButtonStyles-BxZW2x0-.js.map +1 -0
- package/dist/chunks/{grDropdownStyles-149X1NeB.js → grDropdownStyles-DMp7RrI9.js} +10 -9
- package/dist/chunks/grDropdownStyles-DMp7RrI9.js.map +1 -0
- package/dist/chunks/grLoadingStyles-CrxZHFL0.js +17 -0
- package/dist/chunks/grLoadingStyles-CrxZHFL0.js.map +1 -0
- package/dist/chunks/{grModalStyles-Dmd4havY.js → grModalStyles-Dv2NXBKi.js} +20 -11
- package/dist/chunks/grModalStyles-Dv2NXBKi.js.map +1 -0
- package/dist/chunks/grSelectStyles-B7doeAQp.js +50 -0
- package/dist/chunks/grSelectStyles-B7doeAQp.js.map +1 -0
- package/dist/chunks/granularityI18n-GCqUz_lo.js +26 -0
- package/dist/chunks/granularityI18n-GCqUz_lo.js.map +1 -0
- package/dist/chunks/info-C0bHmdZq.js +26 -0
- package/dist/chunks/info-C0bHmdZq.js.map +1 -0
- package/dist/chunks/loader-circle-B2rWDk5u.js +23 -0
- package/dist/chunks/loader-circle-B2rWDk5u.js.map +1 -0
- package/dist/chunks/ru-Dqh-2C00.js +48 -0
- package/dist/chunks/ru-Dqh-2C00.js.map +1 -0
- package/dist/chunks/safelist-BF822K15.js +13 -0
- package/dist/chunks/safelist-BF822K15.js.map +1 -0
- package/dist/chunks/safelist-BY7z8fOl.js +24 -0
- package/dist/chunks/safelist-BY7z8fOl.js.map +1 -0
- package/dist/chunks/{shared-BqUqjuxn.js → shared-Cu5QkNmt.js} +149 -111
- package/dist/chunks/shared-Cu5QkNmt.js.map +1 -0
- package/dist/chunks/transition-mJ3PZCHH.js +1692 -0
- package/dist/chunks/transition-mJ3PZCHH.js.map +1 -0
- package/dist/chunks/x-Pa6C2hwi.js +23 -0
- package/dist/chunks/x-Pa6C2hwi.js.map +1 -0
- package/dist/chunks/x-circle-DQSlBLmX.js +67 -0
- package/dist/chunks/x-circle-DQSlBLmX.js.map +1 -0
- package/dist/components/GrAlert/chunks/GrAlert-BjerGcU8.js +146 -0
- package/dist/components/GrAlert/chunks/GrAlert-BjerGcU8.js.map +1 -0
- package/dist/components/GrAlert/index.js +3 -3
- package/dist/components/GrAvatar/chunks/GrAvatar-BjnPKNAL.js +41 -0
- package/dist/components/GrAvatar/chunks/GrAvatar-BjnPKNAL.js.map +1 -0
- package/dist/components/GrAvatar/index.js +3 -3
- package/dist/components/GrBadge/chunks/GrBadge-wuIb4_2K.js +32 -0
- package/dist/components/GrBadge/chunks/GrBadge-wuIb4_2K.js.map +1 -0
- package/dist/components/GrBadge/index.js +3 -3
- package/dist/components/GrBadgeWrap/chunks/GrBadgeWrap-CxtamOZ-.js +33 -0
- package/dist/components/GrBadgeWrap/chunks/GrBadgeWrap-CxtamOZ-.js.map +1 -0
- package/dist/components/GrBadgeWrap/index.js +3 -3
- package/dist/components/GrBottomNav/chunks/GrBottomNav-CsmQ7mTJ.js +31 -0
- package/dist/components/GrBottomNav/chunks/GrBottomNav-CsmQ7mTJ.js.map +1 -0
- package/dist/components/GrBottomNav/index.js +3 -3
- package/dist/components/GrButton/chunks/GrButton-BmGdp8-4.js +83 -0
- package/dist/components/GrButton/chunks/GrButton-BmGdp8-4.js.map +1 -0
- package/dist/components/GrButton/index.js +5 -5
- package/dist/components/GrButtonGroup/chunks/GrButtonGroup-CBj4tpms.js +21 -0
- package/dist/components/GrButtonGroup/chunks/GrButtonGroup-CBj4tpms.js.map +1 -0
- package/dist/components/GrButtonGroup/index.js +3 -3
- package/dist/components/GrCard/chunks/GrCard-xtDcXBr7.js +11 -0
- package/dist/components/GrCard/chunks/GrCard-xtDcXBr7.js.map +1 -0
- package/dist/components/GrCard/index.js +3 -3
- package/dist/components/GrCheckbox/chunks/GrCheckbox-Bt3d7ckE.js +134 -0
- package/dist/components/GrCheckbox/chunks/GrCheckbox-Bt3d7ckE.js.map +1 -0
- package/dist/components/GrCheckbox/index.js +3 -3
- package/dist/components/GrCollapse/chunks/GrCollapse-HU20VTVn.js +205 -0
- package/dist/components/GrCollapse/chunks/GrCollapse-HU20VTVn.js.map +1 -0
- package/dist/components/GrCollapse/index.js +3 -3
- package/dist/components/GrConfirmDialog/chunks/GrConfirmDialog-DjGOX9Hd.js +131 -0
- package/dist/components/GrConfirmDialog/chunks/GrConfirmDialog-DjGOX9Hd.js.map +1 -0
- package/dist/components/GrConfirmDialog/index.js +3 -3
- package/dist/components/GrDataTable/chunks/GrDataTable-QDOJWmdY.js +179 -0
- package/dist/components/GrDataTable/chunks/GrDataTable-QDOJWmdY.js.map +1 -0
- package/dist/components/GrDataTable/index.js +3 -3
- package/dist/components/GrDialog/chunks/GrDialog-gObmaVEl.js +221 -0
- package/dist/components/GrDialog/chunks/GrDialog-gObmaVEl.js.map +1 -0
- package/dist/components/GrDialog/index.js +4 -4
- package/dist/components/GrDrawer/chunks/GrDrawer-BJL_gTxI.js +156 -0
- package/dist/components/GrDrawer/chunks/GrDrawer-BJL_gTxI.js.map +1 -0
- package/dist/components/GrDrawer/index.js +3 -3
- package/dist/components/GrDropdown/chunks/GrDropdown-BkACCXdp.js +151 -0
- package/dist/components/GrDropdown/chunks/GrDropdown-BkACCXdp.js.map +1 -0
- package/dist/components/GrDropdown/index.js +3 -3
- package/dist/components/GrDropdownMenu/chunks/GrDropdownMenu-BEenXrJw.js +309 -0
- package/dist/components/GrDropdownMenu/chunks/GrDropdownMenu-BEenXrJw.js.map +1 -0
- package/dist/components/GrDropdownMenu/index.js +3 -3
- package/dist/components/GrEmptyState/chunks/GrEmptyState-BLbMJFW-.js +62 -0
- package/dist/components/GrEmptyState/chunks/GrEmptyState-BLbMJFW-.js.map +1 -0
- package/dist/components/GrEmptyState/index.js +3 -3
- package/dist/components/GrFileUpload/chunks/GrFileUpload-u01j9S0t.js +368 -0
- package/dist/components/GrFileUpload/chunks/GrFileUpload-u01j9S0t.js.map +1 -0
- package/dist/components/GrFileUpload/index.js +4 -4
- package/dist/components/GrFormField/chunks/GrFormField-C6PfAs4u.js +35 -0
- package/dist/components/GrFormField/chunks/GrFormField-C6PfAs4u.js.map +1 -0
- package/dist/components/GrFormField/index.js +3 -3
- package/dist/components/GrFormFile/chunks/GrFormFile-DdM8Bc2B.js +313 -0
- package/dist/components/GrFormFile/chunks/GrFormFile-DdM8Bc2B.js.map +1 -0
- package/dist/components/GrFormFile/index.js +3 -3
- package/dist/components/GrFormSection/chunks/GrFormSection-5djEaQZQ.js +35 -0
- package/dist/components/GrFormSection/chunks/GrFormSection-5djEaQZQ.js.map +1 -0
- package/dist/components/GrFormSection/index.js +3 -3
- package/dist/components/GrIcon/chunks/GrIcon-BV7RBU_0.js +32 -0
- package/dist/components/GrIcon/chunks/GrIcon-BV7RBU_0.js.map +1 -0
- package/dist/components/GrIcon/index.js +3 -3
- package/dist/components/GrImageViewer/chunks/GrImageViewer-CjSnohW7.js +397 -0
- package/dist/components/GrImageViewer/chunks/GrImageViewer-CjSnohW7.js.map +1 -0
- package/dist/components/GrImageViewer/index.js +3 -3
- package/dist/components/GrInput/chunks/GrInput-ghxaTf6d.js +211 -0
- package/dist/components/GrInput/chunks/GrInput-ghxaTf6d.js.map +1 -0
- package/dist/components/GrInput/index.js +3 -3
- package/dist/components/GrInputTag/chunks/GrInputTag-B0x4U0Yk.js +257 -0
- package/dist/components/GrInputTag/chunks/GrInputTag-B0x4U0Yk.js.map +1 -0
- package/dist/components/GrInputTag/index.js +3 -3
- package/dist/components/GrLink/chunks/GrLink-C7-Y1u88.js +80 -0
- package/dist/components/GrLink/chunks/GrLink-C7-Y1u88.js.map +1 -0
- package/dist/components/GrLink/index.js +3 -3
- package/dist/components/GrList/chunks/GrList--Ib4zLNw.js +77 -0
- package/dist/components/GrList/chunks/GrList--Ib4zLNw.js.map +1 -0
- package/dist/components/GrList/index.js +3 -3
- package/dist/components/GrLoading/chunks/GrLoading-C3QZKwE-.js +69 -0
- package/dist/components/GrLoading/chunks/GrLoading-C3QZKwE-.js.map +1 -0
- package/dist/components/GrLoading/index.js +3 -3
- package/dist/components/GrModal/chunks/GrModal-gvfvlp7k.js +168 -0
- package/dist/components/GrModal/chunks/GrModal-gvfvlp7k.js.map +1 -0
- package/dist/components/GrModal/index.js +4 -4
- package/dist/components/GrNavbar/chunks/GrNavbar-nIyuiVj1.js +75 -0
- package/dist/components/GrNavbar/chunks/GrNavbar-nIyuiVj1.js.map +1 -0
- package/dist/components/GrNavbar/index.js +3 -3
- package/dist/components/GrNumberInput/chunks/GrNumberInput-B0mPLjdv.js +397 -0
- package/dist/components/GrNumberInput/chunks/GrNumberInput-B0mPLjdv.js.map +1 -0
- package/dist/components/GrNumberInput/index.js +3 -3
- package/dist/components/GrPagination/chunks/GrPagination-BSTO6flk.js +114 -0
- package/dist/components/GrPagination/chunks/GrPagination-BSTO6flk.js.map +1 -0
- package/dist/components/GrPagination/index.js +3 -3
- package/dist/components/GrProgressBar/chunks/GrProgressBar-MvMnzsJl.js +39 -0
- package/dist/components/GrProgressBar/chunks/GrProgressBar-MvMnzsJl.js.map +1 -0
- package/dist/components/GrProgressBar/index.js +3 -3
- package/dist/components/GrPromptDialog/chunks/GrPromptDialog-DKhbN6ji.js +190 -0
- package/dist/components/GrPromptDialog/chunks/GrPromptDialog-DKhbN6ji.js.map +1 -0
- package/dist/components/GrPromptDialog/index.js +3 -3
- package/dist/components/GrRadio/chunks/GrRadio-BxBs3WHq.js +184 -0
- package/dist/components/GrRadio/chunks/GrRadio-BxBs3WHq.js.map +1 -0
- package/dist/components/GrRadio/index.js +3 -3
- package/dist/components/GrRadioGroup/chunks/GrRadioGroup-CEAfJQ6A.js +80 -0
- package/dist/components/GrRadioGroup/chunks/GrRadioGroup-CEAfJQ6A.js.map +1 -0
- package/dist/components/GrRadioGroup/index.js +3 -3
- package/dist/components/GrSegmented/chunks/GrSegmented-Bwn2qOY4.js +323 -0
- package/dist/components/GrSegmented/chunks/GrSegmented-Bwn2qOY4.js.map +1 -0
- package/dist/components/GrSegmented/index.js +3 -3
- package/dist/components/GrSelect/chunks/GrSelect-9wRWAu2R.js +443 -0
- package/dist/components/GrSelect/chunks/GrSelect-9wRWAu2R.js.map +1 -0
- package/dist/components/GrSelect/index.js +3 -3
- package/dist/components/GrSidebar/chunks/GrSidebar-CSZ3RpFB.js +44 -0
- package/dist/components/GrSidebar/chunks/GrSidebar-CSZ3RpFB.js.map +1 -0
- package/dist/components/GrSidebar/index.js +3 -3
- package/dist/components/GrSkeleton/chunks/GrSkeleton-DKXkqWDa.js +33 -0
- package/dist/components/GrSkeleton/chunks/GrSkeleton-DKXkqWDa.js.map +1 -0
- package/dist/components/GrSkeleton/index.js +3 -3
- package/dist/components/GrSwitch/chunks/GrSwitch-CdBxwV3k.js +79 -0
- package/dist/components/GrSwitch/chunks/GrSwitch-CdBxwV3k.js.map +1 -0
- package/dist/components/GrSwitch/index.js +3 -3
- package/dist/components/GrTable/chunks/GrTable-CyQ9uw8A.js +57 -0
- package/dist/components/GrTable/chunks/GrTable-CyQ9uw8A.js.map +1 -0
- package/dist/components/GrTable/index.js +3 -3
- package/dist/components/GrTabs/chunks/GrTabs-BpF8AAUz.js +118 -0
- package/dist/components/GrTabs/chunks/GrTabs-BpF8AAUz.js.map +1 -0
- package/dist/components/GrTabs/index.js +3 -3
- package/dist/components/GrTextarea/chunks/GrTextarea-DFS9ZkrA.js +71 -0
- package/dist/components/GrTextarea/chunks/GrTextarea-DFS9ZkrA.js.map +1 -0
- package/dist/components/GrTextarea/index.js +3 -3
- package/dist/components/GrToaster/chunks/GrToaster-3Mf0Moxt.js +171 -0
- package/dist/components/GrToaster/chunks/GrToaster-3Mf0Moxt.js.map +1 -0
- package/dist/components/GrToaster/index.js +3 -3
- package/dist/components/GrTooltip/chunks/GrTooltip-BvmsukLW.js +55 -0
- package/dist/components/GrTooltip/chunks/GrTooltip-BvmsukLW.js.map +1 -0
- package/dist/components/GrTooltip/index.js +3 -3
- package/dist/components/GrTree/chunks/GrTree-C2kN-O4Q.js +734 -0
- package/dist/components/GrTree/chunks/GrTree-C2kN-O4Q.js.map +1 -0
- package/dist/components/GrTree/index.js +3 -3
- package/dist/components/GrTreeSelect/chunks/GrTreeSelect-Da-CpRqm.js +454 -0
- package/dist/components/GrTreeSelect/chunks/GrTreeSelect-Da-CpRqm.js.map +1 -0
- package/dist/components/GrTreeSelect/index.js +3 -3
- package/dist/composables/useTheme.js +39 -30
- package/dist/composables/useTheme.js.map +1 -0
- package/dist/composables/useToast.js +41 -34
- package/dist/composables/useToast.js.map +1 -0
- package/dist/directives/autofocus.js +55 -0
- package/dist/directives/autofocus.js.map +1 -0
- package/dist/directives/autosize.js +117 -0
- package/dist/directives/autosize.js.map +1 -0
- package/dist/directives/clickOutside.js +96 -0
- package/dist/directives/clickOutside.js.map +1 -0
- package/dist/directives/dropzone.js +164 -0
- package/dist/directives/dropzone.js.map +1 -0
- package/dist/directives/hotkey.js +138 -0
- package/dist/directives/hotkey.js.map +1 -0
- package/dist/directives/index.js +7 -2
- package/dist/directives/loading.js +163 -0
- package/dist/directives/loading.js.map +1 -0
- package/dist/fileValidation/index.js +2 -2
- package/dist/granular-provider-node.js +23 -14
- package/dist/granular-provider-node.js.map +1 -0
- package/dist/granular-provider.js +3 -3
- package/dist/granular-provider.js.map +1 -0
- package/dist/i18n/all.js +6 -6
- package/dist/i18n/all.js.map +1 -0
- package/dist/i18n/index.js +3 -3
- package/dist/index.js +110 -105
- package/dist/vue/index.js +64 -26
- package/dist/vue/index.js.map +1 -0
- package/package.json +25 -1
- package/dist/chunks/_plugin-vue_export-helper-CHO2XVys.js +0 -8
- package/dist/chunks/adapter-D5uYoOZj.js +0 -4
- package/dist/chunks/arrow-up-Dv3dC3hu.js +0 -23
- package/dist/chunks/classTokens-CT1tqF2j.js +0 -6
- package/dist/chunks/config-B5JCvHys.js +0 -13
- package/dist/chunks/config-BDXa5Sna2.js +0 -9
- package/dist/chunks/config-BG5_FuZ-.js +0 -34
- package/dist/chunks/config-BMYKG1oB.js +0 -10
- package/dist/chunks/config-BQREEXFD.js +0 -8
- package/dist/chunks/config-BUZtbeTr.js +0 -40
- package/dist/chunks/config-BVXycfiO.js +0 -9
- package/dist/chunks/config-BZW-RL6E.js +0 -14
- package/dist/chunks/config-BhbfV-Is.js +0 -48
- package/dist/chunks/config-BmYFupZh.js +0 -8
- package/dist/chunks/config-BsZc_QQ-2.js +0 -20
- package/dist/chunks/config-C1Sn7mn-.js +0 -27
- package/dist/chunks/config-C4_REX-3.js +0 -9
- package/dist/chunks/config-CBFllZZ4.js +0 -9
- package/dist/chunks/config-CDyD_fCt.js +0 -8
- package/dist/chunks/config-CJeG727i.js +0 -149
- package/dist/chunks/config-CLawBqde.js +0 -21
- package/dist/chunks/config-CMz46RPG.js +0 -8
- package/dist/chunks/config-CO-7HRZd2.js +0 -8
- package/dist/chunks/config-CS7E7LME.js +0 -9
- package/dist/chunks/config-CVy124Xj.js +0 -8
- package/dist/chunks/config-CcixQGaN.js +0 -47
- package/dist/chunks/config-CiVXZxyQ.js +0 -9
- package/dist/chunks/config-CoMQmunP.js +0 -8
- package/dist/chunks/config-Cq6ufYtp.js +0 -9
- package/dist/chunks/config-D8CIEWcb.js +0 -8
- package/dist/chunks/config-D8hKc39m.js +0 -18
- package/dist/chunks/config-D9MxGwCJ.js +0 -8
- package/dist/chunks/config-DBXTZE36.js +0 -15
- package/dist/chunks/config-DK9C8O7L.js +0 -9
- package/dist/chunks/config-DTegOmx2.js +0 -8
- package/dist/chunks/config-DYI8XADo.js +0 -47
- package/dist/chunks/config-DlidGf7P.js +0 -8
- package/dist/chunks/config-DtNe7EIX.js +0 -35
- package/dist/chunks/config-EdWeK_ge.js +0 -17
- package/dist/chunks/config-FGAkxHFh.js +0 -8
- package/dist/chunks/config-M76gNxd2.js +0 -37
- package/dist/chunks/config-NuqoO_Of.js +0 -33
- package/dist/chunks/config-QsovJrku2.js +0 -66
- package/dist/chunks/config-R6F6zRJk.js +0 -9
- package/dist/chunks/config-SLwkDc4Q2.js +0 -9
- package/dist/chunks/config-aJ7sb62Y.js +0 -8
- package/dist/chunks/config-b9nc87Oc.js +0 -9
- package/dist/chunks/config-dSI8RttH2.js +0 -8
- package/dist/chunks/config-im2VHeSM.js +0 -9
- package/dist/chunks/config-vKeQ035f.js +0 -9
- package/dist/chunks/config-vMcxHlWi.js +0 -14
- package/dist/chunks/dialogShared-CONROtU2.js +0 -26
- package/dist/chunks/directives-Dr5NPOT8.js +0 -530
- package/dist/chunks/en-j3simI0h.js +0 -41
- package/dist/chunks/es-CIT9s_vo.js +0 -4
- package/dist/chunks/es-CLpJj7KP.js +0 -41
- package/dist/chunks/fileValidation-LFD-vwil.js +0 -193
- package/dist/chunks/grLoadingStyles-Bjo7ylmq.js +0 -15
- package/dist/chunks/grSelectStyles-C3QKIn1J.js +0 -40
- package/dist/chunks/granularityI18n-8_v1B11L.js +0 -24
- package/dist/chunks/info-CNJnuTYC.js +0 -26
- package/dist/chunks/loader-circle-C5vCCMfB.js +0 -23
- package/dist/chunks/ru-CiOZPnBu.js +0 -41
- package/dist/chunks/safelist-Bq32hAXc.js +0 -13
- package/dist/chunks/safelist-CLcTRYB-.js +0 -22
- package/dist/chunks/transition-BJXMi52x.js +0 -1617
- package/dist/chunks/x--kxrj3ez.js +0 -23
- package/dist/chunks/x-circle-ChJ87u1v.js +0 -61
- package/dist/components/GrAlert/chunks/GrAlert-DLHkusb-.js +0 -129
- package/dist/components/GrAvatar/chunks/GrAvatar-BFYH3HJw.js +0 -32
- package/dist/components/GrBadge/chunks/GrBadge-D_AoqGrn.js +0 -27
- package/dist/components/GrBadgeWrap/chunks/GrBadgeWrap-C_N0QJfA.js +0 -26
- package/dist/components/GrBottomNav/chunks/GrBottomNav-Chpu3SVd.js +0 -21
- package/dist/components/GrButton/chunks/GrButton-BXVVt6Od.js +0 -67
- package/dist/components/GrButtonGroup/chunks/GrButtonGroup-CmnYHVH7.js +0 -16
- package/dist/components/GrCard/chunks/GrCard-DEpN6Ptf.js +0 -10
- package/dist/components/GrCheckbox/chunks/GrCheckbox-DF3vJApB.js +0 -111
- package/dist/components/GrCollapse/chunks/GrCollapse-D7QYRqNa.js +0 -150
- package/dist/components/GrConfirmDialog/chunks/GrConfirmDialog-C7Eh8-Vn.js +0 -111
- package/dist/components/GrDataTable/chunks/GrDataTable-Dxsg1NMP.js +0 -142
- package/dist/components/GrDialog/chunks/GrDialog-BSd4-uP5.js +0 -169
- package/dist/components/GrDrawer/chunks/GrDrawer-DBBSwe1s.js +0 -135
- package/dist/components/GrDropdown/chunks/GrDropdown-BELyRP4A.js +0 -110
- package/dist/components/GrDropdownMenu/chunks/GrDropdownMenu-B8fuk7iP.js +0 -233
- package/dist/components/GrEmptyState/chunks/GrEmptyState-BPGoafJI.js +0 -49
- package/dist/components/GrFileUpload/chunks/GrFileUpload-BPzx3LEM.js +0 -294
- package/dist/components/GrFormField/chunks/GrFormField-Cn8g9eFP.js +0 -28
- package/dist/components/GrFormFile/chunks/GrFormFile-DfinD5Iv.js +0 -248
- package/dist/components/GrFormSection/chunks/GrFormSection-dKpQw-vh.js +0 -27
- package/dist/components/GrIcon/chunks/GrIcon-CXIHuG7L.js +0 -25
- package/dist/components/GrImageViewer/chunks/GrImageViewer-CQSNx-D7.js +0 -322
- package/dist/components/GrInput/chunks/GrInput-CLKX1inm.js +0 -158
- package/dist/components/GrInputTag/chunks/GrInputTag-BAtLody2.js +0 -214
- package/dist/components/GrLink/chunks/GrLink-BpXnly-Y.js +0 -59
- package/dist/components/GrList/chunks/GrList-BrFc7VdS.js +0 -55
- package/dist/components/GrLoading/chunks/GrLoading-dFuoryMY.js +0 -53
- package/dist/components/GrModal/chunks/GrModal-uaWXH08K.js +0 -136
- package/dist/components/GrNavbar/chunks/GrNavbar-KzLHgdjX.js +0 -62
- package/dist/components/GrNumberInput/chunks/GrNumberInput-rENn1802.js +0 -315
- package/dist/components/GrPagination/chunks/GrPagination-DP0x3rx6.js +0 -93
- package/dist/components/GrProgressBar/chunks/GrProgressBar-DpW93sOi.js +0 -29
- package/dist/components/GrPromptDialog/chunks/GrPromptDialog-ASfBwyzQ.js +0 -158
- package/dist/components/GrRadio/chunks/GrRadio-8BOo97XV.js +0 -147
- package/dist/components/GrRadioGroup/chunks/GrRadioGroup-BymbUmqI.js +0 -66
- package/dist/components/GrSegmented/chunks/GrSegmented-CK5C_lN7.js +0 -250
- package/dist/components/GrSelect/chunks/GrSelect-BMfc1-vs.js +0 -314
- package/dist/components/GrSidebar/chunks/GrSidebar-C4SXXhfO.js +0 -29
- package/dist/components/GrSkeleton/chunks/GrSkeleton-QlieOdpY.js +0 -25
- package/dist/components/GrSwitch/chunks/GrSwitch-Cefiutzu.js +0 -64
- package/dist/components/GrTable/chunks/GrTable-k_FUiJQk.js +0 -44
- package/dist/components/GrTabs/chunks/GrTabs-B46P-lUc.js +0 -98
- package/dist/components/GrTextarea/chunks/GrTextarea-BX7L1MJk.js +0 -57
- package/dist/components/GrToaster/chunks/GrToaster-C4l_BjOh.js +0 -139
- package/dist/components/GrTooltip/chunks/GrTooltip-BqRAzuLT.js +0 -37
- package/dist/components/GrTree/chunks/GrTree-C2CXR_vW.js +0 -614
- package/dist/components/GrTreeSelect/chunks/GrTreeSelect-DAAay-QB.js +0 -353
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import { t as x_default } from "../../../chunks/x-Pa6C2hwi.js";
|
|
2
|
+
import { t as GrButton_default } from "../../GrButton/chunks/GrButton-BmGdp8-4.js";
|
|
3
|
+
import { t as _plugin_vue_export_helper_default } from "../../../chunks/_plugin-vue_export-helper-BG_EqiDU.js";
|
|
4
|
+
import { t as GrIcon_default } from "../../GrIcon/chunks/GrIcon-BV7RBU_0.js";
|
|
5
|
+
import { l as runFileValidators, o as acceptValidator, u as FileValidationError } from "../../../chunks/fileValidation-CwJA8Vmn.js";
|
|
6
|
+
import { vDropzone } from "../../../directives/dropzone.js";
|
|
7
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, markRaw, nextTick, normalizeClass, openBlock, ref, renderList, renderSlot, toDisplayString, unref, watch, withCtx, withDirectives, withModifiers } from "vue";
|
|
8
|
+
import '../../../GrFormFile.css';//#region ~icons/lucide/upload
|
|
9
|
+
var _hoisted_1$1 = {
|
|
10
|
+
viewBox: "0 0 24 24",
|
|
11
|
+
width: "1.2em",
|
|
12
|
+
height: "1.2em"
|
|
13
|
+
};
|
|
14
|
+
function render$1(_ctx, _cache) {
|
|
15
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$1, [..._cache[0] || (_cache[0] = [createElementVNode("path", {
|
|
16
|
+
fill: "none",
|
|
17
|
+
stroke: "currentColor",
|
|
18
|
+
"stroke-linecap": "round",
|
|
19
|
+
"stroke-linejoin": "round",
|
|
20
|
+
"stroke-width": "2",
|
|
21
|
+
d: "M12 3v12m5-7l-5-5l-5 5m14 7v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"
|
|
22
|
+
}, null, -1)])]);
|
|
23
|
+
}
|
|
24
|
+
var upload_default = markRaw({
|
|
25
|
+
name: "lucide-upload",
|
|
26
|
+
render: render$1
|
|
27
|
+
});
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/components/GrFormFile/GrFormFile.vue?vue&type=script&setup=true&lang.ts
|
|
30
|
+
var _hoisted_1 = [
|
|
31
|
+
"multiple",
|
|
32
|
+
"accept",
|
|
33
|
+
"disabled"
|
|
34
|
+
];
|
|
35
|
+
var _hoisted_2 = { class: "flex flex-col gap-2" };
|
|
36
|
+
var _hoisted_3 = { class: "flex flex-wrap items-center gap-3" };
|
|
37
|
+
var _hoisted_4 = { class: "ml-2" };
|
|
38
|
+
var _hoisted_5 = { class: "ml-2" };
|
|
39
|
+
var _hoisted_6 = { class: "ml-2" };
|
|
40
|
+
var _hoisted_7 = ["title"];
|
|
41
|
+
var _hoisted_8 = {
|
|
42
|
+
key: 3,
|
|
43
|
+
class: "text-sm text-[var(--muted-fg)]",
|
|
44
|
+
"data-ds-form-file-placeholder": ""
|
|
45
|
+
};
|
|
46
|
+
var _hoisted_9 = {
|
|
47
|
+
key: 0,
|
|
48
|
+
class: "flex flex-col gap-2"
|
|
49
|
+
};
|
|
50
|
+
var _hoisted_10 = ["title"];
|
|
51
|
+
var _hoisted_11 = ["disabled", "onClick"];
|
|
52
|
+
var _hoisted_12 = {
|
|
53
|
+
key: 0,
|
|
54
|
+
class: "text-sm text-[var(--ds-danger)]",
|
|
55
|
+
"data-ds-form-file-errors": ""
|
|
56
|
+
};
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/components/GrFormFile/GrFormFile.vue
|
|
59
|
+
var GrFormFile_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
60
|
+
name: "GrFormFile",
|
|
61
|
+
__name: "GrFormFile",
|
|
62
|
+
props: {
|
|
63
|
+
modelValue: {},
|
|
64
|
+
multiple: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: false
|
|
67
|
+
},
|
|
68
|
+
disabled: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: false
|
|
71
|
+
},
|
|
72
|
+
accept: { default: void 0 },
|
|
73
|
+
validators: { default: void 0 },
|
|
74
|
+
uploadText: { default: "Upload file" },
|
|
75
|
+
changeText: { default: "Change file" },
|
|
76
|
+
removeText: { default: "Remove" },
|
|
77
|
+
clearAllText: { default: "Clear all" },
|
|
78
|
+
placeholder: { default: "No files selected" },
|
|
79
|
+
validate: {
|
|
80
|
+
type: Function,
|
|
81
|
+
default: void 0
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
emits: [
|
|
85
|
+
"update:modelValue",
|
|
86
|
+
"change",
|
|
87
|
+
"clear",
|
|
88
|
+
"validation",
|
|
89
|
+
"update:errors"
|
|
90
|
+
],
|
|
91
|
+
setup(__props, { emit: __emit }) {
|
|
92
|
+
const props = __props;
|
|
93
|
+
const emit = __emit;
|
|
94
|
+
const inputRef = ref(null);
|
|
95
|
+
const localErrors = ref([]);
|
|
96
|
+
const files = computed(() => {
|
|
97
|
+
if (props.multiple) return Array.isArray(props.modelValue) ? props.modelValue : [];
|
|
98
|
+
return props.modelValue instanceof File ? [props.modelValue] : [];
|
|
99
|
+
});
|
|
100
|
+
const hasFiles = computed(() => files.value.length > 0);
|
|
101
|
+
function clearInputValue() {
|
|
102
|
+
if (!inputRef.value) return;
|
|
103
|
+
inputRef.value.value = "";
|
|
104
|
+
}
|
|
105
|
+
function setErrors(next) {
|
|
106
|
+
localErrors.value = next;
|
|
107
|
+
emit("validation", next);
|
|
108
|
+
emit("update:errors", next);
|
|
109
|
+
}
|
|
110
|
+
function clearErrors() {
|
|
111
|
+
if (localErrors.value.length === 0) return;
|
|
112
|
+
setErrors([]);
|
|
113
|
+
}
|
|
114
|
+
function openDialog() {
|
|
115
|
+
if (props.disabled) return;
|
|
116
|
+
inputRef.value?.click();
|
|
117
|
+
}
|
|
118
|
+
function emitModel(nextFiles) {
|
|
119
|
+
const value = props.multiple ? nextFiles : nextFiles[0] ?? null;
|
|
120
|
+
emit("update:modelValue", value);
|
|
121
|
+
emit("change", value);
|
|
122
|
+
}
|
|
123
|
+
async function applyFiles(nextFiles) {
|
|
124
|
+
const isPromiseLike = (value) => {
|
|
125
|
+
return !!value && typeof value.then === "function";
|
|
126
|
+
};
|
|
127
|
+
const customValidator = props.validate ? async ({ files }) => await props.validate?.(files) ?? [] : void 0;
|
|
128
|
+
const res = runFileValidators(nextFiles, [
|
|
129
|
+
acceptValidator(props.accept),
|
|
130
|
+
...props.validators ?? [],
|
|
131
|
+
...customValidator ? [customValidator] : []
|
|
132
|
+
], {
|
|
133
|
+
source: "input",
|
|
134
|
+
multiple: props.multiple
|
|
135
|
+
});
|
|
136
|
+
const { files: picked, issues } = isPromiseLike(res) ? await res : res;
|
|
137
|
+
if (issues.length > 0) {
|
|
138
|
+
setErrors(issues);
|
|
139
|
+
clearInputValue();
|
|
140
|
+
await nextTick();
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
clearErrors();
|
|
144
|
+
emitModel(picked);
|
|
145
|
+
clearInputValue();
|
|
146
|
+
await nextTick();
|
|
147
|
+
}
|
|
148
|
+
async function onInputChange(event) {
|
|
149
|
+
if (props.disabled) return;
|
|
150
|
+
const target = event.target;
|
|
151
|
+
const nextFiles = target?.files ? Array.prototype.slice.call(target.files) : [];
|
|
152
|
+
if (target) target.value = "";
|
|
153
|
+
await nextTick();
|
|
154
|
+
await applyFiles(nextFiles);
|
|
155
|
+
}
|
|
156
|
+
function clearAll() {
|
|
157
|
+
if (props.disabled) return;
|
|
158
|
+
clearErrors();
|
|
159
|
+
clearInputValue();
|
|
160
|
+
emit("clear");
|
|
161
|
+
emit("update:modelValue", props.multiple ? [] : null);
|
|
162
|
+
emit("change", props.multiple ? [] : null);
|
|
163
|
+
}
|
|
164
|
+
function removeAt(index) {
|
|
165
|
+
if (props.disabled) return;
|
|
166
|
+
if (!props.multiple) {
|
|
167
|
+
clearAll();
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
const next = files.value.slice();
|
|
171
|
+
next.splice(index, 1);
|
|
172
|
+
emit("update:modelValue", next);
|
|
173
|
+
emit("change", next);
|
|
174
|
+
}
|
|
175
|
+
function issueMessage(issue) {
|
|
176
|
+
if (issue.fileName) return `${issue.fileName}: ${issue.message}`;
|
|
177
|
+
return issue.message;
|
|
178
|
+
}
|
|
179
|
+
const dropzone = computed(() => {
|
|
180
|
+
const customValidator = props.validate ? async ({ files }) => await props.validate?.(files) ?? [] : void 0;
|
|
181
|
+
const validators = [
|
|
182
|
+
acceptValidator(props.accept),
|
|
183
|
+
...props.validators ?? [],
|
|
184
|
+
...customValidator ? [customValidator] : []
|
|
185
|
+
];
|
|
186
|
+
return {
|
|
187
|
+
enabled: !props.disabled,
|
|
188
|
+
multiple: props.multiple,
|
|
189
|
+
validators,
|
|
190
|
+
onFiles: async (dropped) => {
|
|
191
|
+
clearErrors();
|
|
192
|
+
emitModel(dropped);
|
|
193
|
+
clearInputValue();
|
|
194
|
+
await nextTick();
|
|
195
|
+
},
|
|
196
|
+
onError: (error) => {
|
|
197
|
+
if (error instanceof FileValidationError) setErrors(error.issues);
|
|
198
|
+
else setErrors([{
|
|
199
|
+
code: "accept",
|
|
200
|
+
message: "Failed to validate dropped files"
|
|
201
|
+
}]);
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
});
|
|
205
|
+
watch(() => props.modelValue, (value) => {
|
|
206
|
+
if (!inputRef.value) return;
|
|
207
|
+
if (!value || Array.isArray(value) && value.length === 0) inputRef.value.value = "";
|
|
208
|
+
});
|
|
209
|
+
return (_ctx, _cache) => {
|
|
210
|
+
return withDirectives((openBlock(), createElementBlock("div", {
|
|
211
|
+
"data-ds-form-file": "",
|
|
212
|
+
class: normalizeClass(["rounded-[var(--ds-radius-md)]", __props.disabled ? "opacity-60 cursor-not-allowed" : ""])
|
|
213
|
+
}, [createElementVNode("input", {
|
|
214
|
+
ref_key: "inputRef",
|
|
215
|
+
ref: inputRef,
|
|
216
|
+
"data-ds-form-file-input": "",
|
|
217
|
+
type: "file",
|
|
218
|
+
tabindex: "-1",
|
|
219
|
+
"aria-hidden": "true",
|
|
220
|
+
class: "absolute opacity-0 w-px h-px pointer-events-none",
|
|
221
|
+
multiple: __props.multiple,
|
|
222
|
+
accept: __props.accept,
|
|
223
|
+
disabled: __props.disabled,
|
|
224
|
+
onChange: onInputChange
|
|
225
|
+
}, null, 40, _hoisted_1), createElementVNode("div", _hoisted_2, [
|
|
226
|
+
createElementVNode("div", _hoisted_3, [
|
|
227
|
+
createVNode(GrButton_default, {
|
|
228
|
+
variant: "secondary",
|
|
229
|
+
size: "sm",
|
|
230
|
+
"data-ds-form-file-upload-btn": "",
|
|
231
|
+
disabled: __props.disabled,
|
|
232
|
+
onClick: withModifiers(openDialog, ["prevent"])
|
|
233
|
+
}, {
|
|
234
|
+
default: withCtx(() => [createVNode(GrIcon_default, {
|
|
235
|
+
size: "sm",
|
|
236
|
+
"aria-hidden": "true"
|
|
237
|
+
}, {
|
|
238
|
+
default: withCtx(() => [createVNode(unref(upload_default))]),
|
|
239
|
+
_: 1
|
|
240
|
+
}), createElementVNode("span", _hoisted_4, toDisplayString(hasFiles.value ? __props.changeText : __props.uploadText), 1)]),
|
|
241
|
+
_: 1
|
|
242
|
+
}, 8, ["disabled"]),
|
|
243
|
+
hasFiles.value && !__props.multiple ? (openBlock(), createBlock(GrButton_default, {
|
|
244
|
+
key: 0,
|
|
245
|
+
variant: "secondary",
|
|
246
|
+
size: "sm",
|
|
247
|
+
"data-ds-form-file-clear-btn": "",
|
|
248
|
+
disabled: __props.disabled,
|
|
249
|
+
onClick: withModifiers(clearAll, ["prevent"])
|
|
250
|
+
}, {
|
|
251
|
+
default: withCtx(() => [createVNode(GrIcon_default, {
|
|
252
|
+
size: "sm",
|
|
253
|
+
"aria-hidden": "true"
|
|
254
|
+
}, {
|
|
255
|
+
default: withCtx(() => [createVNode(unref(x_default))]),
|
|
256
|
+
_: 1
|
|
257
|
+
}), createElementVNode("span", _hoisted_5, toDisplayString(__props.removeText), 1)]),
|
|
258
|
+
_: 1
|
|
259
|
+
}, 8, ["disabled"])) : createCommentVNode("", true),
|
|
260
|
+
__props.multiple && hasFiles.value ? (openBlock(), createBlock(GrButton_default, {
|
|
261
|
+
key: 1,
|
|
262
|
+
variant: "secondary",
|
|
263
|
+
size: "sm",
|
|
264
|
+
"data-ds-form-file-clear-all-btn": "",
|
|
265
|
+
disabled: __props.disabled,
|
|
266
|
+
onClick: withModifiers(clearAll, ["prevent"])
|
|
267
|
+
}, {
|
|
268
|
+
default: withCtx(() => [createVNode(GrIcon_default, {
|
|
269
|
+
size: "sm",
|
|
270
|
+
"aria-hidden": "true"
|
|
271
|
+
}, {
|
|
272
|
+
default: withCtx(() => [createVNode(unref(x_default))]),
|
|
273
|
+
_: 1
|
|
274
|
+
}), createElementVNode("span", _hoisted_6, toDisplayString(__props.clearAllText), 1)]),
|
|
275
|
+
_: 1
|
|
276
|
+
}, 8, ["disabled"])) : createCommentVNode("", true),
|
|
277
|
+
!__props.multiple && hasFiles.value ? (openBlock(), createElementBlock("span", {
|
|
278
|
+
key: 2,
|
|
279
|
+
class: "text-sm text-[var(--muted-fg)] truncate max-w-[240px]",
|
|
280
|
+
"data-ds-form-file-single-name": "",
|
|
281
|
+
title: files.value[0]?.name
|
|
282
|
+
}, toDisplayString(files.value[0]?.name), 9, _hoisted_7)) : createCommentVNode("", true),
|
|
283
|
+
!hasFiles.value ? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(__props.placeholder), 1)) : createCommentVNode("", true)
|
|
284
|
+
]),
|
|
285
|
+
__props.multiple && hasFiles.value ? (openBlock(), createElementBlock("div", _hoisted_9, [(openBlock(true), createElementBlock(Fragment, null, renderList(files.value, (file, index) => {
|
|
286
|
+
return openBlock(), createElementBlock("div", {
|
|
287
|
+
key: `${file.name}-${file.size}-${index}`,
|
|
288
|
+
class: "flex items-center gap-2",
|
|
289
|
+
"data-ds-form-file-item": ""
|
|
290
|
+
}, [createElementVNode("span", {
|
|
291
|
+
class: "text-sm text-[var(--muted-fg)] truncate max-w-[240px]",
|
|
292
|
+
title: file.name,
|
|
293
|
+
"data-ds-form-file-item-name": ""
|
|
294
|
+
}, toDisplayString(file.name), 9, _hoisted_10), createElementVNode("button", {
|
|
295
|
+
type: "button",
|
|
296
|
+
class: "text-xs text-[var(--muted-fg)] hover:text-[var(--fg)]",
|
|
297
|
+
"data-ds-form-file-item-remove": "",
|
|
298
|
+
disabled: __props.disabled,
|
|
299
|
+
onClick: withModifiers(($event) => removeAt(index), ["prevent"])
|
|
300
|
+
}, toDisplayString(__props.removeText), 9, _hoisted_11)]);
|
|
301
|
+
}), 128))])) : createCommentVNode("", true),
|
|
302
|
+
renderSlot(_ctx.$slots, "errors", { errors: localErrors.value }, () => [localErrors.value.length ? (openBlock(), createElementBlock("div", _hoisted_12, [(openBlock(true), createElementBlock(Fragment, null, renderList(localErrors.value, (e, i) => {
|
|
303
|
+
return openBlock(), createElementBlock("div", {
|
|
304
|
+
key: i,
|
|
305
|
+
"data-ds-form-file-error": ""
|
|
306
|
+
}, toDisplayString(issueMessage(e)), 1);
|
|
307
|
+
}), 128))])) : createCommentVNode("", true)], true)
|
|
308
|
+
])], 2)), [[unref(vDropzone), dropzone.value]]);
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
}), [["__scopeId", "data-v-a60cb9f7"]]);
|
|
312
|
+
//#endregion
|
|
313
|
+
export { GrFormFile_default as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GrFormFile-DdM8Bc2B.js","names":[],"sources":["../../../../src/components/GrFormFile/GrFormFile.vue","../../../../src/components/GrFormFile/GrFormFile.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, nextTick, ref, watch } from 'vue'\n\nimport IconUpload from '~icons/lucide/upload'\nimport IconX from '~icons/lucide/x'\n\nimport GrButton from '../GrButton/GrButton.vue'\nimport GrIcon from '../GrIcon/GrIcon.vue'\nimport { vDropzone } from '../../directives'\nimport { acceptValidator, FileValidationError, runFileValidators } from '../../fileValidation'\nimport type { FileValidationIssue, FileValidator } from '../../fileValidation'\n\ndefineOptions({\n name: 'GrFormFile',\n})\n\nexport type GrFormFileError = FileValidationIssue\n\n/**\n * Пропы `GrFormFile` — форма-поле для выбора файлов с встроенной валидацией,\n * drag&drop (через `v-dropzone`) и списком выбранных файлов.\n *\n * Все `*Text`/`placeholder` — i18n-friendly, принимают готовые строки локали.\n */\nexport interface GrFormFileProps {\n modelValue: File | File[] | null\n multiple?: boolean\n disabled?: boolean\n /** W3C `accept` для `<input type=\"file\">` + sugar к `acceptValidator(...)`. */\n accept?: string\n validators?: FileValidator[]\n uploadText?: string\n changeText?: string\n removeText?: string\n clearAllText?: string\n placeholder?: string\n /** Дополнительная (кастомная) валидация на стороне потребителя. */\n validate?: (files: File[]) => GrFormFileError[] | Promise<GrFormFileError[]>\n}\n\nconst props = withDefaults(\n defineProps<GrFormFileProps>(),\n {\n multiple: false,\n disabled: false,\n accept: undefined,\n uploadText: 'Upload file',\n changeText: 'Change file',\n removeText: 'Remove',\n clearAllText: 'Clear all',\n placeholder: 'No files selected',\n validators: undefined,\n validate: undefined,\n },\n)\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: File | File[] | null): void\n (e: 'change', value: File | File[] | null): void\n (e: 'clear'): void\n (e: 'validation', errors: GrFormFileError[]): void\n (e: 'update:errors', errors: GrFormFileError[]): void\n}>()\n\nconst inputRef = ref<HTMLInputElement | null>(null)\nconst localErrors = ref<GrFormFileError[]>([])\n\nconst files = computed<File[]>(() => {\n if (props.multiple) {\n return Array.isArray(props.modelValue) ? props.modelValue : []\n }\n\n return props.modelValue instanceof File ? [props.modelValue] : []\n})\n\nconst hasFiles = computed(() => files.value.length > 0)\n\nfunction clearInputValue() {\n if (!inputRef.value) return\n inputRef.value.value = ''\n}\n\nfunction setErrors(next: GrFormFileError[]) {\n localErrors.value = next\n emit('validation', next)\n emit('update:errors', next)\n}\n\nfunction clearErrors() {\n if (localErrors.value.length === 0) return\n setErrors([])\n}\n\nfunction openDialog() {\n if (props.disabled) return\n inputRef.value?.click()\n}\n\nfunction emitModel(nextFiles: File[]) {\n const value: File | File[] | null = props.multiple\n ? nextFiles\n : (nextFiles[0] ?? null)\n\n emit('update:modelValue', value)\n emit('change', value)\n}\n\nasync function applyFiles(nextFiles: File[]) {\n const isPromiseLike = (value: unknown): value is PromiseLike<any> => {\n return !!value && typeof (value as any).then === 'function'\n }\n\n const customValidator: FileValidator | undefined = props.validate\n ? async ({ files }) => (await props.validate?.(files)) ?? []\n : undefined\n\n const validators: FileValidator[] = [\n acceptValidator(props.accept),\n ...(props.validators ?? []),\n ...(customValidator ? [customValidator] : []),\n ]\n\n const res = runFileValidators(nextFiles, validators, {\n source: 'input',\n multiple: props.multiple,\n })\n\n const { files: picked, issues } = isPromiseLike(res) ? await res : res\n\n if (issues.length > 0) {\n setErrors(issues)\n clearInputValue()\n await nextTick()\n return\n }\n\n clearErrors()\n emitModel(picked)\n clearInputValue()\n await nextTick()\n}\n\nasync function onInputChange(event: Event) {\n if (props.disabled) return\n\n const target = event.target as HTMLInputElement | null\n const nextFiles = target?.files ? Array.prototype.slice.call(target.files) as File[] : []\n\n // Reset value so selecting the same file twice triggers change.\n if (target) target.value = ''\n await nextTick()\n\n await applyFiles(nextFiles)\n}\n\nfunction clearAll() {\n if (props.disabled) return\n clearErrors()\n clearInputValue()\n emit('clear')\n\n emit('update:modelValue', props.multiple ? [] : null)\n emit('change', props.multiple ? [] : null)\n}\n\nfunction removeAt(index: number) {\n if (props.disabled) return\n if (!props.multiple) {\n clearAll()\n return\n }\n\n const next = files.value.slice()\n next.splice(index, 1)\n\n emit('update:modelValue', next)\n emit('change', next)\n}\n\nfunction issueMessage(issue: GrFormFileError): string {\n if (issue.fileName) return `${issue.fileName}: ${issue.message}`\n return issue.message\n}\n\nconst dropzone = computed(() => {\n const customValidator: FileValidator | undefined = props.validate\n ? async ({ files }) => (await props.validate?.(files)) ?? []\n : undefined\n\n const validators: FileValidator[] = [\n acceptValidator(props.accept),\n ...(props.validators ?? []),\n ...(customValidator ? [customValidator] : []),\n ]\n\n return {\n enabled: !props.disabled,\n multiple: props.multiple,\n validators,\n onFiles: async (dropped: File[]) => {\n // `v-dropzone` уже выполнил валидаторы и нормализацию по `multiple`.\n clearErrors()\n emitModel(dropped)\n clearInputValue()\n await nextTick()\n },\n onError: (error: unknown) => {\n if (error instanceof FileValidationError) {\n setErrors(error.issues)\n }\n else {\n setErrors([\n {\n code: 'accept',\n message: 'Failed to validate dropped files',\n },\n ])\n }\n },\n }\n})\n\nwatch(\n () => props.modelValue,\n (value) => {\n if (!inputRef.value) return\n\n if (!value || (Array.isArray(value) && value.length === 0)) {\n // Позволяет выбрать тот же файл снова после внешнего сброса.\n inputRef.value.value = ''\n }\n },\n)\n</script>\n\n<template>\n <div\n v-dropzone=\"dropzone\"\n data-ds-form-file\n class=\"rounded-[var(--ds-radius-md)]\"\n :class=\"disabled ? 'opacity-60 cursor-not-allowed' : ''\"\n >\n <input\n ref=\"inputRef\"\n data-ds-form-file-input\n type=\"file\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n class=\"absolute opacity-0 w-px h-px pointer-events-none\"\n :multiple=\"multiple\"\n :accept=\"accept\"\n :disabled=\"disabled\"\n @change=\"onInputChange\"\n >\n\n <div class=\"flex flex-col gap-2\">\n <div class=\"flex flex-wrap items-center gap-3\">\n <GrButton\n variant=\"secondary\"\n size=\"sm\"\n data-ds-form-file-upload-btn\n :disabled=\"disabled\"\n @click.prevent=\"openDialog\"\n >\n <GrIcon size=\"sm\" aria-hidden=\"true\">\n <IconUpload />\n </GrIcon>\n <span class=\"ml-2\">{{ hasFiles ? changeText : uploadText }}</span>\n </GrButton>\n\n <GrButton\n v-if=\"hasFiles && !multiple\"\n variant=\"secondary\"\n size=\"sm\"\n data-ds-form-file-clear-btn\n :disabled=\"disabled\"\n @click.prevent=\"clearAll\"\n >\n <GrIcon size=\"sm\" aria-hidden=\"true\">\n <IconX />\n </GrIcon>\n <span class=\"ml-2\">{{ removeText }}</span>\n </GrButton>\n\n <GrButton\n v-if=\"multiple && hasFiles\"\n variant=\"secondary\"\n size=\"sm\"\n data-ds-form-file-clear-all-btn\n :disabled=\"disabled\"\n @click.prevent=\"clearAll\"\n >\n <GrIcon size=\"sm\" aria-hidden=\"true\">\n <IconX />\n </GrIcon>\n <span class=\"ml-2\">{{ clearAllText }}</span>\n </GrButton>\n\n <span\n v-if=\"!multiple && hasFiles\"\n class=\"text-sm text-[var(--muted-fg)] truncate max-w-[240px]\"\n data-ds-form-file-single-name\n :title=\"files[0]?.name\"\n >\n {{ files[0]?.name }}\n </span>\n\n <span\n v-if=\"!hasFiles\"\n class=\"text-sm text-[var(--muted-fg)]\"\n data-ds-form-file-placeholder\n >\n {{ placeholder }}\n </span>\n </div>\n\n <div v-if=\"multiple && hasFiles\" class=\"flex flex-col gap-2\">\n <div\n v-for=\"(file, index) in files\"\n :key=\"`${file.name}-${file.size}-${index}`\"\n class=\"flex items-center gap-2\"\n data-ds-form-file-item\n >\n <span\n class=\"text-sm text-[var(--muted-fg)] truncate max-w-[240px]\"\n :title=\"file.name\"\n data-ds-form-file-item-name\n >\n {{ file.name }}\n </span>\n\n <button\n type=\"button\"\n class=\"text-xs text-[var(--muted-fg)] hover:text-[var(--fg)]\"\n data-ds-form-file-item-remove\n :disabled=\"disabled\"\n @click.prevent=\"removeAt(index)\"\n >\n {{ removeText }}\n </button>\n </div>\n </div>\n\n <slot name=\"errors\" :errors=\"localErrors\">\n <div v-if=\"localErrors.length\" class=\"text-sm text-[var(--ds-danger)]\" data-ds-form-file-errors>\n <div v-for=\"(e, i) in localErrors\" :key=\"i\" data-ds-form-file-error>\n {{ issueMessage(e) }}\n </div>\n </div>\n </slot>\n </div>\n </div>\n</template>\n\n<style scoped>\n[data-ds-form-file].ds-dropzone--over {\n outline: 2px solid var(--ring);\n outline-offset: 2px;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, nextTick, ref, watch } from 'vue'\n\nimport IconUpload from '~icons/lucide/upload'\nimport IconX from '~icons/lucide/x'\n\nimport GrButton from '../GrButton/GrButton.vue'\nimport GrIcon from '../GrIcon/GrIcon.vue'\nimport { vDropzone } from '../../directives'\nimport { acceptValidator, FileValidationError, runFileValidators } from '../../fileValidation'\nimport type { FileValidationIssue, FileValidator } from '../../fileValidation'\n\ndefineOptions({\n name: 'GrFormFile',\n})\n\nexport type GrFormFileError = FileValidationIssue\n\n/**\n * Пропы `GrFormFile` — форма-поле для выбора файлов с встроенной валидацией,\n * drag&drop (через `v-dropzone`) и списком выбранных файлов.\n *\n * Все `*Text`/`placeholder` — i18n-friendly, принимают готовые строки локали.\n */\nexport interface GrFormFileProps {\n modelValue: File | File[] | null\n multiple?: boolean\n disabled?: boolean\n /** W3C `accept` для `<input type=\"file\">` + sugar к `acceptValidator(...)`. */\n accept?: string\n validators?: FileValidator[]\n uploadText?: string\n changeText?: string\n removeText?: string\n clearAllText?: string\n placeholder?: string\n /** Дополнительная (кастомная) валидация на стороне потребителя. */\n validate?: (files: File[]) => GrFormFileError[] | Promise<GrFormFileError[]>\n}\n\nconst props = withDefaults(\n defineProps<GrFormFileProps>(),\n {\n multiple: false,\n disabled: false,\n accept: undefined,\n uploadText: 'Upload file',\n changeText: 'Change file',\n removeText: 'Remove',\n clearAllText: 'Clear all',\n placeholder: 'No files selected',\n validators: undefined,\n validate: undefined,\n },\n)\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: File | File[] | null): void\n (e: 'change', value: File | File[] | null): void\n (e: 'clear'): void\n (e: 'validation', errors: GrFormFileError[]): void\n (e: 'update:errors', errors: GrFormFileError[]): void\n}>()\n\nconst inputRef = ref<HTMLInputElement | null>(null)\nconst localErrors = ref<GrFormFileError[]>([])\n\nconst files = computed<File[]>(() => {\n if (props.multiple) {\n return Array.isArray(props.modelValue) ? props.modelValue : []\n }\n\n return props.modelValue instanceof File ? [props.modelValue] : []\n})\n\nconst hasFiles = computed(() => files.value.length > 0)\n\nfunction clearInputValue() {\n if (!inputRef.value) return\n inputRef.value.value = ''\n}\n\nfunction setErrors(next: GrFormFileError[]) {\n localErrors.value = next\n emit('validation', next)\n emit('update:errors', next)\n}\n\nfunction clearErrors() {\n if (localErrors.value.length === 0) return\n setErrors([])\n}\n\nfunction openDialog() {\n if (props.disabled) return\n inputRef.value?.click()\n}\n\nfunction emitModel(nextFiles: File[]) {\n const value: File | File[] | null = props.multiple\n ? nextFiles\n : (nextFiles[0] ?? null)\n\n emit('update:modelValue', value)\n emit('change', value)\n}\n\nasync function applyFiles(nextFiles: File[]) {\n const isPromiseLike = (value: unknown): value is PromiseLike<any> => {\n return !!value && typeof (value as any).then === 'function'\n }\n\n const customValidator: FileValidator | undefined = props.validate\n ? async ({ files }) => (await props.validate?.(files)) ?? []\n : undefined\n\n const validators: FileValidator[] = [\n acceptValidator(props.accept),\n ...(props.validators ?? []),\n ...(customValidator ? [customValidator] : []),\n ]\n\n const res = runFileValidators(nextFiles, validators, {\n source: 'input',\n multiple: props.multiple,\n })\n\n const { files: picked, issues } = isPromiseLike(res) ? await res : res\n\n if (issues.length > 0) {\n setErrors(issues)\n clearInputValue()\n await nextTick()\n return\n }\n\n clearErrors()\n emitModel(picked)\n clearInputValue()\n await nextTick()\n}\n\nasync function onInputChange(event: Event) {\n if (props.disabled) return\n\n const target = event.target as HTMLInputElement | null\n const nextFiles = target?.files ? Array.prototype.slice.call(target.files) as File[] : []\n\n // Reset value so selecting the same file twice triggers change.\n if (target) target.value = ''\n await nextTick()\n\n await applyFiles(nextFiles)\n}\n\nfunction clearAll() {\n if (props.disabled) return\n clearErrors()\n clearInputValue()\n emit('clear')\n\n emit('update:modelValue', props.multiple ? [] : null)\n emit('change', props.multiple ? [] : null)\n}\n\nfunction removeAt(index: number) {\n if (props.disabled) return\n if (!props.multiple) {\n clearAll()\n return\n }\n\n const next = files.value.slice()\n next.splice(index, 1)\n\n emit('update:modelValue', next)\n emit('change', next)\n}\n\nfunction issueMessage(issue: GrFormFileError): string {\n if (issue.fileName) return `${issue.fileName}: ${issue.message}`\n return issue.message\n}\n\nconst dropzone = computed(() => {\n const customValidator: FileValidator | undefined = props.validate\n ? async ({ files }) => (await props.validate?.(files)) ?? []\n : undefined\n\n const validators: FileValidator[] = [\n acceptValidator(props.accept),\n ...(props.validators ?? []),\n ...(customValidator ? [customValidator] : []),\n ]\n\n return {\n enabled: !props.disabled,\n multiple: props.multiple,\n validators,\n onFiles: async (dropped: File[]) => {\n // `v-dropzone` уже выполнил валидаторы и нормализацию по `multiple`.\n clearErrors()\n emitModel(dropped)\n clearInputValue()\n await nextTick()\n },\n onError: (error: unknown) => {\n if (error instanceof FileValidationError) {\n setErrors(error.issues)\n }\n else {\n setErrors([\n {\n code: 'accept',\n message: 'Failed to validate dropped files',\n },\n ])\n }\n },\n }\n})\n\nwatch(\n () => props.modelValue,\n (value) => {\n if (!inputRef.value) return\n\n if (!value || (Array.isArray(value) && value.length === 0)) {\n // Позволяет выбрать тот же файл снова после внешнего сброса.\n inputRef.value.value = ''\n }\n },\n)\n</script>\n\n<template>\n <div\n v-dropzone=\"dropzone\"\n data-ds-form-file\n class=\"rounded-[var(--ds-radius-md)]\"\n :class=\"disabled ? 'opacity-60 cursor-not-allowed' : ''\"\n >\n <input\n ref=\"inputRef\"\n data-ds-form-file-input\n type=\"file\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n class=\"absolute opacity-0 w-px h-px pointer-events-none\"\n :multiple=\"multiple\"\n :accept=\"accept\"\n :disabled=\"disabled\"\n @change=\"onInputChange\"\n >\n\n <div class=\"flex flex-col gap-2\">\n <div class=\"flex flex-wrap items-center gap-3\">\n <GrButton\n variant=\"secondary\"\n size=\"sm\"\n data-ds-form-file-upload-btn\n :disabled=\"disabled\"\n @click.prevent=\"openDialog\"\n >\n <GrIcon size=\"sm\" aria-hidden=\"true\">\n <IconUpload />\n </GrIcon>\n <span class=\"ml-2\">{{ hasFiles ? changeText : uploadText }}</span>\n </GrButton>\n\n <GrButton\n v-if=\"hasFiles && !multiple\"\n variant=\"secondary\"\n size=\"sm\"\n data-ds-form-file-clear-btn\n :disabled=\"disabled\"\n @click.prevent=\"clearAll\"\n >\n <GrIcon size=\"sm\" aria-hidden=\"true\">\n <IconX />\n </GrIcon>\n <span class=\"ml-2\">{{ removeText }}</span>\n </GrButton>\n\n <GrButton\n v-if=\"multiple && hasFiles\"\n variant=\"secondary\"\n size=\"sm\"\n data-ds-form-file-clear-all-btn\n :disabled=\"disabled\"\n @click.prevent=\"clearAll\"\n >\n <GrIcon size=\"sm\" aria-hidden=\"true\">\n <IconX />\n </GrIcon>\n <span class=\"ml-2\">{{ clearAllText }}</span>\n </GrButton>\n\n <span\n v-if=\"!multiple && hasFiles\"\n class=\"text-sm text-[var(--muted-fg)] truncate max-w-[240px]\"\n data-ds-form-file-single-name\n :title=\"files[0]?.name\"\n >\n {{ files[0]?.name }}\n </span>\n\n <span\n v-if=\"!hasFiles\"\n class=\"text-sm text-[var(--muted-fg)]\"\n data-ds-form-file-placeholder\n >\n {{ placeholder }}\n </span>\n </div>\n\n <div v-if=\"multiple && hasFiles\" class=\"flex flex-col gap-2\">\n <div\n v-for=\"(file, index) in files\"\n :key=\"`${file.name}-${file.size}-${index}`\"\n class=\"flex items-center gap-2\"\n data-ds-form-file-item\n >\n <span\n class=\"text-sm text-[var(--muted-fg)] truncate max-w-[240px]\"\n :title=\"file.name\"\n data-ds-form-file-item-name\n >\n {{ file.name }}\n </span>\n\n <button\n type=\"button\"\n class=\"text-xs text-[var(--muted-fg)] hover:text-[var(--fg)]\"\n data-ds-form-file-item-remove\n :disabled=\"disabled\"\n @click.prevent=\"removeAt(index)\"\n >\n {{ removeText }}\n </button>\n </div>\n </div>\n\n <slot name=\"errors\" :errors=\"localErrors\">\n <div v-if=\"localErrors.length\" class=\"text-sm text-[var(--ds-danger)]\" data-ds-form-file-errors>\n <div v-for=\"(e, i) in localErrors\" :key=\"i\" data-ds-form-file-error>\n {{ issueMessage(e) }}\n </div>\n </div>\n </slot>\n </div>\n </div>\n</template>\n\n<style scoped>\n[data-ds-form-file].ds-dropzone--over {\n outline: 2px solid var(--ring);\n outline-offset: 2px;\n}\n</style>\n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AAK;MACL,OAAM;MACN,iCAAA;MACC,UAAU,QAAA;MACV,SAAK,eAAA,WAAU,SAAS,MAAK,EAAA,CAAA,UAAA,CAAA;wBAE3B,QAAA,WAAU,EAAA,GAAA,YAAA,CAAA,CAAA;;IAKnB,WAMO,KAAA,QAAA,UAAA,EANc,QAAQ,YAAA,OAAW,QAMjC,CALM,YAAA,MAAY,UAAA,WAAA,EAAvB,mBAIM,OAJN,aAIM,EAAA,UAAA,KAAA,EAHJ,mBAEM,UAAA,MAAA,WAFgB,YAAA,QAAT,GAAG,MAAC;yBAAjB,mBAEM,OAAA;MAF8B,KAAK;MAAG,2BAAA;wBACvC,aAAa,EAAC,CAAA,EAAA,EAAA;;iCA7Gb,SAAA,MAAQ,CAAA,CAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { t } from "../../chunks/config-
|
|
3
|
-
export {
|
|
1
|
+
import { t as GrFormFile_default } from "./chunks/GrFormFile-DdM8Bc2B.js";
|
|
2
|
+
import { t as grFormFileConfig } from "../../chunks/config-C5SJXHQ4.js";
|
|
3
|
+
export { GrFormFile_default as GrFormFile, GrFormFile_default as default, grFormFileConfig };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, openBlock, renderSlot, toDisplayString, unref, useId } from "vue";
|
|
2
|
+
//#region src/components/GrFormSection/GrFormSection.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var _hoisted_1 = ["aria-labelledby", "aria-describedby"];
|
|
4
|
+
var _hoisted_2 = ["id"];
|
|
5
|
+
var _hoisted_3 = ["id"];
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/components/GrFormSection/GrFormSection.vue
|
|
8
|
+
var GrFormSection_default = /* @__PURE__ */ defineComponent({
|
|
9
|
+
__name: "GrFormSection",
|
|
10
|
+
props: {
|
|
11
|
+
title: {},
|
|
12
|
+
description: { default: void 0 }
|
|
13
|
+
},
|
|
14
|
+
setup(__props) {
|
|
15
|
+
const titleId = useId();
|
|
16
|
+
const descriptionId = useId();
|
|
17
|
+
return (_ctx, _cache) => {
|
|
18
|
+
return openBlock(), createElementBlock("section", {
|
|
19
|
+
"data-ds-form-section": "",
|
|
20
|
+
class: "grid gap-4",
|
|
21
|
+
"aria-labelledby": unref(titleId),
|
|
22
|
+
"aria-describedby": __props.description ? unref(descriptionId) : void 0
|
|
23
|
+
}, [createElementVNode("div", null, [createElementVNode("div", {
|
|
24
|
+
id: unref(titleId),
|
|
25
|
+
class: "text-[14px] font-700"
|
|
26
|
+
}, toDisplayString(__props.title), 9, _hoisted_2), __props.description ? (openBlock(), createElementBlock("div", {
|
|
27
|
+
key: 0,
|
|
28
|
+
id: unref(descriptionId),
|
|
29
|
+
class: "mt-1 text-[13px] text-[var(--muted-fg)]"
|
|
30
|
+
}, toDisplayString(__props.description), 9, _hoisted_3)) : createCommentVNode("", true)]), renderSlot(_ctx.$slots, "default")], 8, _hoisted_1);
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
//#endregion
|
|
35
|
+
export { GrFormSection_default as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GrFormSection-5djEaQZQ.js","names":[],"sources":["../../../../src/components/GrFormSection/GrFormSection.vue","../../../../src/components/GrFormSection/GrFormSection.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useId } from 'vue'\n\n/**\n * GrFormSection — секция формы с заголовком, опциональным описанием и контентом.\n *\n * - `section` связан с заголовком через `aria-labelledby` и c описанием\n * (если есть) через `aria-describedby` — для a11y.\n */\nexport interface GrFormSectionProps {\n title: string\n description?: string\n}\n\nwithDefaults(defineProps<GrFormSectionProps>(), {\n description: undefined,\n})\n\nconst titleId = useId()\nconst descriptionId = useId()\n</script>\n\n<template>\n <section\n data-ds-form-section\n class=\"grid gap-4\"\n :aria-labelledby=\"titleId\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n >\n <div>\n <div :id=\"titleId\" class=\"text-[14px] font-700\">\n {{ title }}\n </div>\n <div\n v-if=\"description\"\n :id=\"descriptionId\"\n class=\"mt-1 text-[13px] text-[var(--muted-fg)]\"\n >\n {{ description }}\n </div>\n </div>\n <slot />\n </section>\n</template>\n","<script setup lang=\"ts\">\nimport { useId } from 'vue'\n\n/**\n * GrFormSection — секция формы с заголовком, опциональным описанием и контентом.\n *\n * - `section` связан с заголовком через `aria-labelledby` и c описанием\n * (если есть) через `aria-describedby` — для a11y.\n */\nexport interface GrFormSectionProps {\n title: string\n description?: string\n}\n\nwithDefaults(defineProps<GrFormSectionProps>(), {\n description: undefined,\n})\n\nconst titleId = useId()\nconst descriptionId = useId()\n</script>\n\n<template>\n <section\n data-ds-form-section\n class=\"grid gap-4\"\n :aria-labelledby=\"titleId\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n >\n <div>\n <div :id=\"titleId\" class=\"text-[14px] font-700\">\n {{ title }}\n </div>\n <div\n v-if=\"description\"\n :id=\"descriptionId\"\n class=\"mt-1 text-[13px] text-[var(--muted-fg)]\"\n >\n {{ description }}\n </div>\n </div>\n <slot />\n </section>\n</template>\n"],"mappings":";;;;;;;;;;;;;;EAkBA,MAAM,UAAU,OAAM;EACtB,MAAM,gBAAgB,OAAM;;uBAI1B,mBAmBU,WAAA;IAlBR,wBAAA;IACA,OAAM;IACL,mBAAiB,MAAA,QAAO;IACxB,oBAAkB,QAAA,cAAc,MAAA,cAAa,GAAG,KAAA;OAEjD,mBAWM,OAAA,MAAA,CAVJ,mBAEM,OAAA;IAFA,IAAI,MAAA,QAAO;IAAE,OAAM;sBACpB,QAAA,MAAK,EAAA,GAAA,WAAA,EAGF,QAAA,eAAA,WAAA,EADR,mBAMM,OAAA;;IAJH,IAAI,MAAA,cAAa;IAClB,OAAM;sBAEH,QAAA,YAAW,EAAA,GAAA,WAAA,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA,EAGlB,WAAQ,KAAA,QAAA,UAAA,CAAA,EAAA,GAAA,WAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { t } from "../../chunks/config-
|
|
3
|
-
export {
|
|
1
|
+
import { t as GrFormSection_default } from "./chunks/GrFormSection-5djEaQZQ.js";
|
|
2
|
+
import { t as grFormSectionConfig } from "../../chunks/config-BCPyma1I.js";
|
|
3
|
+
export { GrFormSection_default as GrFormSection, GrFormSection_default as default, grFormSectionConfig };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { computed, createElementBlock, defineComponent, normalizeStyle, openBlock, renderSlot } from "vue";
|
|
2
|
+
import '../../../GrIcon.css';//#endregion
|
|
3
|
+
//#region src/components/GrIcon/GrIcon.vue
|
|
4
|
+
var GrIcon_default = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "GrIcon",
|
|
6
|
+
props: { size: {} },
|
|
7
|
+
setup(__props) {
|
|
8
|
+
const GR_ICON_SIZE_MAP = {
|
|
9
|
+
sm: 16,
|
|
10
|
+
md: 18,
|
|
11
|
+
lg: 20
|
|
12
|
+
};
|
|
13
|
+
function resolveGrIconSizePx(size) {
|
|
14
|
+
if (typeof size === "number") return size;
|
|
15
|
+
return GR_ICON_SIZE_MAP[size];
|
|
16
|
+
}
|
|
17
|
+
const props = __props;
|
|
18
|
+
const resolvedSize = computed(() => props.size ?? "md");
|
|
19
|
+
const iconStyle = computed(() => {
|
|
20
|
+
return { "--ds-icon-size": `${resolveGrIconSizePx(resolvedSize.value)}px` };
|
|
21
|
+
});
|
|
22
|
+
return (_ctx, _cache) => {
|
|
23
|
+
return openBlock(), createElementBlock("span", {
|
|
24
|
+
"data-ds-icon": "",
|
|
25
|
+
class: "ds-icon inline-flex items-center justify-center align-middle",
|
|
26
|
+
style: normalizeStyle(iconStyle.value)
|
|
27
|
+
}, [renderSlot(_ctx.$slots, "default")], 4);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
//#endregion
|
|
32
|
+
export { GrIcon_default as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GrIcon-BV7RBU_0.js","names":[],"sources":["../../../../src/components/GrIcon/GrIcon.vue","../../../../src/components/GrIcon/GrIcon.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {computed} from 'vue'\n\nexport type GrIconSize = 'sm' | 'md' | 'lg'\n\nconst GR_ICON_SIZE_MAP: Record<GrIconSize, number> = {\n sm: 16,\n md: 18,\n lg: 20,\n}\n\nfunction resolveGrIconSizePx(size: GrIconSize | number): number {\n if (typeof size === 'number') return size\n return GR_ICON_SIZE_MAP[size]\n}\n\nconst props = defineProps<{\n size?: GrIconSize | number\n}>()\n\nconst resolvedSize = computed(() => props.size ?? 'md')\n\nconst iconStyle = computed(() => {\n return {\n '--ds-icon-size': `${resolveGrIconSizePx(resolvedSize.value)}px`,\n } as Record<string, string>\n})\n</script>\n\n<template>\n <span\n data-ds-icon\n class=\"ds-icon inline-flex items-center justify-center align-middle\"\n :style=\"iconStyle\"\n >\n <slot />\n </span>\n</template>\n<style>\n/*\n * GrIcon.\n *\n * This must be global because icons are usually passed via slots (SVG),\n * and we want consistent sizing without relying on SFC scoped + :deep.\n */\n:where(.ds-icon) {\n --ds-icon-size: 18px;\n width: var(--ds-icon-size);\n min-width: var(--ds-icon-size);\n height: var(--ds-icon-size);\n line-height: 0;\n flex: none;\n}\n\n:where(.ds-icon svg) {\n width: 100%;\n height: 100%;\n display: block;\n}\n</style>","<script setup lang=\"ts\">\nimport {computed} from 'vue'\n\nexport type GrIconSize = 'sm' | 'md' | 'lg'\n\nconst GR_ICON_SIZE_MAP: Record<GrIconSize, number> = {\n sm: 16,\n md: 18,\n lg: 20,\n}\n\nfunction resolveGrIconSizePx(size: GrIconSize | number): number {\n if (typeof size === 'number') return size\n return GR_ICON_SIZE_MAP[size]\n}\n\nconst props = defineProps<{\n size?: GrIconSize | number\n}>()\n\nconst resolvedSize = computed(() => props.size ?? 'md')\n\nconst iconStyle = computed(() => {\n return {\n '--ds-icon-size': `${resolveGrIconSizePx(resolvedSize.value)}px`,\n } as Record<string, string>\n})\n</script>\n\n<template>\n <span\n data-ds-icon\n class=\"ds-icon inline-flex items-center justify-center align-middle\"\n :style=\"iconStyle\"\n >\n <slot />\n </span>\n</template>\n<style>\n/*\n * GrIcon.\n *\n * This must be global because icons are usually passed via slots (SVG),\n * and we want consistent sizing without relying on SFC scoped + :deep.\n */\n:where(.ds-icon) {\n --ds-icon-size: 18px;\n width: var(--ds-icon-size);\n min-width: var(--ds-icon-size);\n height: var(--ds-icon-size);\n line-height: 0;\n flex: none;\n}\n\n:where(.ds-icon svg) {\n width: 100%;\n height: 100%;\n display: block;\n}\n</style>"],"mappings":";;;;;;;EAKA,MAAM,mBAA+C;GACnD,IAAI;GACJ,IAAI;GACJ,IAAI;GACN;EAEA,SAAS,oBAAoB,MAAmC;AAC9D,OAAI,OAAO,SAAS,SAAU,QAAO;AACrC,UAAO,iBAAiB;;EAG1B,MAAM,QAAQ;EAId,MAAM,eAAe,eAAe,MAAM,QAAQ,KAAI;EAEtD,MAAM,YAAY,eAAe;AAC/B,UAAO,EACL,kBAAkB,GAAG,oBAAoB,aAAa,MAAM,CAAC,KAC9D;IACF;;uBAIC,mBAMO,QAAA;IALH,gBAAA;IACA,OAAM;IACL,OAAK,eAAE,UAAA,MAAS;OAEnB,WAAQ,KAAA,QAAA,UAAA,CAAA,EAAA,EAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { t } from "../../chunks/config-
|
|
3
|
-
export {
|
|
1
|
+
import { t as GrIcon_default } from "./chunks/GrIcon-BV7RBU_0.js";
|
|
2
|
+
import { t as grIconConfig } from "../../chunks/config-2wgwWaAB.js";
|
|
3
|
+
export { GrIcon_default as GrIcon, GrIcon_default as default, grIconConfig };
|