dgz-ui-shared 1.1.49 → 1.2.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/Actions-Bi_vjY5M.es.js +30 -0
- package/dist/chunks/Actions-Bi_vjY5M.es.js.map +1 -0
- package/dist/chunks/Actions-CXOiCjx0.cjs.js +2 -0
- package/dist/chunks/Actions-CXOiCjx0.cjs.js.map +1 -0
- package/dist/chunks/DateRangePicker-DQoK4BQV.es.js +178 -0
- package/dist/chunks/DateRangePicker-DQoK4BQV.es.js.map +1 -0
- package/dist/chunks/DateRangePicker-H-_fkN-r.cjs.js +2 -0
- package/dist/chunks/DateRangePicker-H-_fkN-r.cjs.js.map +1 -0
- package/dist/chunks/Empty-BReVQKje.es.js +25 -0
- package/dist/chunks/Empty-BReVQKje.es.js.map +1 -0
- package/dist/chunks/Empty-BYOOFAab.cjs.js +2 -0
- package/dist/chunks/Empty-BYOOFAab.cjs.js.map +1 -0
- package/dist/chunks/ExportData-CHPKm-ZY.es.js +32 -0
- package/dist/chunks/ExportData-CHPKm-ZY.es.js.map +1 -0
- package/dist/chunks/ExportData-CrB0H1Ts.cjs.js +2 -0
- package/dist/chunks/ExportData-CrB0H1Ts.cjs.js.map +1 -0
- package/dist/{Keyboard-CJVAJWdO.js → chunks/Keyboard-CJVAJWdO.es.js} +1 -0
- package/dist/chunks/Keyboard-CJVAJWdO.es.js.map +1 -0
- package/dist/{Keyboard-kyPAAQWP.cjs → chunks/Keyboard-kyPAAQWP.cjs.js} +1 -0
- package/dist/chunks/Keyboard-kyPAAQWP.cjs.js.map +1 -0
- package/dist/chunks/Loader-D_jX_Wgx.cjs.js +2 -0
- package/dist/chunks/Loader-D_jX_Wgx.cjs.js.map +1 -0
- package/dist/chunks/Loader-zvzAi0F6.es.js +14 -0
- package/dist/chunks/Loader-zvzAi0F6.es.js.map +1 -0
- package/dist/chunks/MyInput-C9PNyYby.cjs.js +2 -0
- package/dist/chunks/MyInput-C9PNyYby.cjs.js.map +1 -0
- package/dist/chunks/MyInput-Wb0DSWo_.es.js +51 -0
- package/dist/chunks/MyInput-Wb0DSWo_.es.js.map +1 -0
- package/dist/chunks/MyPagination-B0czoGZK.es.js +142 -0
- package/dist/chunks/MyPagination-B0czoGZK.es.js.map +1 -0
- package/dist/chunks/MyPagination-CnF3468f.cjs.js +2 -0
- package/dist/chunks/MyPagination-CnF3468f.cjs.js.map +1 -0
- package/dist/chunks/MySelect-D8ML7nhM.es.js +56 -0
- package/dist/chunks/MySelect-D8ML7nhM.es.js.map +1 -0
- package/dist/chunks/MySelect-Ovb1pK5c.cjs.js +2 -0
- package/dist/chunks/MySelect-Ovb1pK5c.cjs.js.map +1 -0
- package/dist/chunks/PasswordConfirm-15FLlQ8Y.es.js +3270 -0
- package/dist/chunks/PasswordConfirm-15FLlQ8Y.es.js.map +1 -0
- package/dist/chunks/PasswordConfirm-maMQqARK.cjs.js +2 -0
- package/dist/chunks/PasswordConfirm-maMQqARK.cjs.js.map +1 -0
- package/dist/chunks/Search-BFtfbppg.cjs.js +2 -0
- package/dist/chunks/Search-BFtfbppg.cjs.js.map +1 -0
- package/dist/chunks/Search-C1r74Jxy.es.js +154 -0
- package/dist/chunks/Search-C1r74Jxy.es.js.map +1 -0
- package/dist/{SortOrder-81BrXp3i.cjs → chunks/SortOrder-81BrXp3i.cjs.js} +1 -0
- package/dist/chunks/SortOrder-81BrXp3i.cjs.js.map +1 -0
- package/dist/{SortOrder-CwuehjY1.js → chunks/SortOrder-CwuehjY1.es.js} +1 -0
- package/dist/chunks/SortOrder-CwuehjY1.es.js.map +1 -0
- package/dist/chunks/Spin-DUK1prd9.cjs.js +2 -0
- package/dist/chunks/Spin-DUK1prd9.cjs.js.map +1 -0
- package/dist/{Spin-DVrrnwvF.js → chunks/Spin-DtW_edOq.es.js} +8 -7
- package/dist/chunks/Spin-DtW_edOq.es.js.map +1 -0
- package/dist/{ThemeMode-BO6tit_Z.cjs → chunks/ThemeMode-BO6tit_Z.cjs.js} +1 -0
- package/dist/chunks/ThemeMode-BO6tit_Z.cjs.js.map +1 -0
- package/dist/{ThemeMode-CqURAYDL.js → chunks/ThemeMode-CqURAYDL.es.js} +1 -0
- package/dist/chunks/ThemeMode-CqURAYDL.es.js.map +1 -0
- package/dist/{ThemeProviderContext-DGw2_Ad5.js → chunks/ThemeProviderContext-CDiIvEe7.es.js} +2 -1
- package/dist/chunks/ThemeProviderContext-CDiIvEe7.es.js.map +1 -0
- package/dist/chunks/ThemeProviderContext-rq2okb30.cjs.js +2 -0
- package/dist/chunks/ThemeProviderContext-rq2okb30.cjs.js.map +1 -0
- package/dist/chunks/index-ClQFzqcq.cjs.js +2 -0
- package/dist/chunks/index-ClQFzqcq.cjs.js.map +1 -0
- package/dist/{index-BrQ82Wyu.js → chunks/index-E1NtSoNr.es.js} +2 -1
- package/dist/chunks/index-E1NtSoNr.es.js.map +1 -0
- package/dist/{lodash-BjH0kD7j.cjs → chunks/lodash-BjH0kD7j.cjs.js} +1 -0
- package/dist/chunks/lodash-BjH0kD7j.cjs.js.map +1 -0
- package/dist/{lodash-CRDOWzbs.js → chunks/lodash-CRDOWzbs.es.js} +1 -0
- package/dist/chunks/lodash-CRDOWzbs.es.js.map +1 -0
- package/dist/chunks/useColumnsStore-BGpED5bu.cjs.js +2 -0
- package/dist/chunks/useColumnsStore-BGpED5bu.cjs.js.map +1 -0
- package/dist/{useColumnsStore-DmpJsxUu.js → chunks/useColumnsStore-DmpJsxUu.es.js} +1 -0
- package/dist/chunks/useColumnsStore-DmpJsxUu.es.js.map +1 -0
- package/dist/{useFilter-BlarabMs.js → chunks/useFilter-C_K_3fQu.es.js} +2 -1
- package/dist/chunks/useFilter-C_K_3fQu.es.js.map +1 -0
- package/dist/chunks/useFilter-CsOF1_hM.cjs.js +2 -0
- package/dist/chunks/useFilter-CsOF1_hM.cjs.js.map +1 -0
- package/dist/chunks/useSortable-D1iGfsy3.cjs.js +2 -0
- package/dist/chunks/useSortable-D1iGfsy3.cjs.js.map +1 -0
- package/dist/{useSortable-DXK9JgDz.js → chunks/useSortable-DHdn9snJ.es.js} +4 -3
- package/dist/chunks/useSortable-DHdn9snJ.es.js.map +1 -0
- package/dist/chunks/useTheme-hjEZ-FC3.cjs.js +2 -0
- package/dist/chunks/useTheme-hjEZ-FC3.cjs.js.map +1 -0
- package/dist/{useTheme-B5ZHXyfv.js → chunks/useTheme-iKF3BEvj.es.js} +2 -1
- package/dist/chunks/useTheme-iKF3BEvj.es.js.map +1 -0
- package/dist/components/actions/index.cjs.js +2 -1
- package/dist/components/actions/index.cjs.js.map +1 -0
- package/dist/components/actions/index.es.js +2 -1
- package/dist/components/actions/index.es.js.map +1 -0
- package/dist/components/confirm/index.cjs.js +2 -1
- package/dist/components/confirm/index.cjs.js.map +1 -0
- package/dist/components/confirm/index.es.js +2 -1
- package/dist/components/confirm/index.es.js.map +1 -0
- package/dist/components/datatable/index.cjs.js +2 -1
- package/dist/components/datatable/index.cjs.js.map +1 -0
- package/dist/components/datatable/index.es.js +198 -273
- package/dist/components/datatable/index.es.js.map +1 -0
- package/dist/components/datepicker/index.cjs.js +2 -1
- package/dist/components/datepicker/index.cjs.js.map +1 -0
- package/dist/components/datepicker/index.es.js +2 -1
- package/dist/components/datepicker/index.es.js.map +1 -0
- package/dist/components/empty/index.cjs.js +2 -1
- package/dist/components/empty/index.cjs.js.map +1 -0
- package/dist/components/empty/index.es.js +2 -1
- package/dist/components/empty/index.es.js.map +1 -0
- package/dist/components/export/index.cjs.js +2 -1
- package/dist/components/export/index.cjs.js.map +1 -0
- package/dist/components/export/index.es.js +2 -1
- package/dist/components/export/index.es.js.map +1 -0
- package/dist/components/filters/index.cjs.js +2 -1
- package/dist/components/filters/index.cjs.js.map +1 -0
- package/dist/components/filters/index.es.js +25 -24
- package/dist/components/filters/index.es.js.map +1 -0
- package/dist/components/form/index.cjs.js +2 -1
- package/dist/components/form/index.cjs.js.map +1 -0
- package/dist/components/form/index.es.js +219 -248
- package/dist/components/form/index.es.js.map +1 -0
- package/dist/components/gallery/index.cjs.js +2 -1
- package/dist/components/gallery/index.cjs.js.map +1 -0
- package/dist/components/gallery/index.es.js +102 -101
- package/dist/components/gallery/index.es.js.map +1 -0
- package/dist/components/loader/index.cjs.js +2 -1
- package/dist/components/loader/index.cjs.js.map +1 -0
- package/dist/components/loader/index.es.js +3 -2
- package/dist/components/loader/index.es.js.map +1 -0
- package/dist/components/modal/index.cjs.js +2 -1
- package/dist/components/modal/index.cjs.js.map +1 -0
- package/dist/components/modal/index.es.js +34 -119
- package/dist/components/modal/index.es.js.map +1 -0
- package/dist/components/pagination/index.cjs.js +2 -1
- package/dist/components/pagination/index.cjs.js.map +1 -0
- package/dist/components/pagination/index.es.js +2 -1
- package/dist/components/pagination/index.es.js.map +1 -0
- package/dist/components/scroll/index.cjs.js +2 -1
- package/dist/components/scroll/index.cjs.js.map +1 -0
- package/dist/components/scroll/index.es.js +5 -4
- package/dist/components/scroll/index.es.js.map +1 -0
- package/dist/components/theme/index.cjs.js +2 -1
- package/dist/components/theme/index.cjs.js.map +1 -0
- package/dist/components/theme/index.es.js +19 -18
- package/dist/components/theme/index.es.js.map +1 -0
- package/dist/components/tooltip/index.cjs.js +2 -1
- package/dist/components/tooltip/index.cjs.js.map +1 -0
- package/dist/components/tooltip/index.es.js +15 -339
- package/dist/components/tooltip/index.es.js.map +1 -0
- package/dist/dgz-ui-shared.css +1 -7
- package/dist/enums/index.cjs.js +2 -1
- package/dist/enums/index.cjs.js.map +1 -0
- package/dist/enums/index.es.js +4 -3
- package/dist/enums/index.es.js.map +1 -0
- package/dist/hooks/index.cjs.js +6 -5
- package/dist/hooks/index.cjs.js.map +1 -0
- package/dist/hooks/index.es.js +261 -260
- package/dist/hooks/index.es.js.map +1 -0
- package/dist/index.cjs.js +2 -1
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.es.js +2 -1
- package/dist/index.es.js.map +1 -0
- package/dist/providers/index.cjs.js +2 -1
- package/dist/providers/index.cjs.js.map +1 -0
- package/dist/providers/index.es.js +15 -16
- package/dist/providers/index.es.js.map +1 -0
- package/dist/stores/index.cjs.js +2 -1
- package/dist/stores/index.cjs.js.map +1 -0
- package/dist/stores/index.es.js +3 -2
- package/dist/stores/index.es.js.map +1 -0
- package/dist/types/index.cjs.js +1 -0
- package/dist/types/index.cjs.js.map +1 -0
- package/dist/types/index.es.js +1 -0
- package/dist/types/index.es.js.map +1 -0
- package/package.json +36 -12
- package/dist/Actions-BtBlxk8a.js +0 -29
- package/dist/Actions-CiveP3aI.cjs +0 -1
- package/dist/DateRangePicker-DQVxdL5r.cjs +0 -1
- package/dist/DateRangePicker-JPOrQMvr.js +0 -3204
- package/dist/Empty-BW6_eQzF.js +0 -24
- package/dist/Empty-C5I6iZl6.cjs +0 -1
- package/dist/ExportData-B5W60-Rr.js +0 -31
- package/dist/ExportData-kp6Uog0F.cjs +0 -1
- package/dist/Loader-7ioafqVF.js +0 -13
- package/dist/Loader-Wetk48cU.cjs +0 -1
- package/dist/MyInput-bKTcidW6.cjs +0 -1
- package/dist/MyInput-sx836zT9.js +0 -50
- package/dist/MyPagination-euPOLVfs.cjs +0 -1
- package/dist/MyPagination-wChl3oNe.js +0 -214
- package/dist/MySelect-BqGcgDzd.js +0 -55
- package/dist/MySelect-DMoQgRvX.cjs +0 -1
- package/dist/PasswordConfirm--b0gdo5X.cjs +0 -7
- package/dist/PasswordConfirm-D7SDgA7l.js +0 -3455
- package/dist/Search-BfEuKbqQ.cjs +0 -1
- package/dist/Search-JItUqnkw.js +0 -153
- package/dist/Spin-pAMxbw70.cjs +0 -1
- package/dist/ThemeProviderContext-3ysAf7lU.cjs +0 -1
- package/dist/dropdown-menu-DjvS5UZW-B--3i9Qx.cjs +0 -1
- package/dist/dropdown-menu-DjvS5UZW-C0gi-4gc.js +0 -873
- package/dist/index-1abu5A4A-CQi6ibYT.cjs +0 -41
- package/dist/index-1abu5A4A-yGlP_PgW.js +0 -682
- package/dist/index-BL59b1Bz-DTsLEPg_.js +0 -730
- package/dist/index-BL59b1Bz-Hqq4FR2z.cjs +0 -22
- package/dist/index-BaI3vCxs-BjodBdHJ.js +0 -241
- package/dist/index-BaI3vCxs-ChCgfumY.cjs +0 -5
- package/dist/index-CGv7FLNy.cjs +0 -1
- package/dist/index-CbK6da4c-7AxqeBaf.cjs +0 -1
- package/dist/index-CbK6da4c-SbqlAWUL.js +0 -30
- package/dist/index-Cths1nBq-By8X1_Xs.js +0 -296
- package/dist/index-Cths1nBq-CSzVHLk0.cjs +0 -1
- package/dist/index-ZsCkaYy6-CvHzH1TD.js +0 -1558
- package/dist/index-ZsCkaYy6-DUFuyxdT.cjs +0 -1
- package/dist/jsx-runtime-BzflLqGi.js +0 -282
- package/dist/jsx-runtime-CjZh_XyQ.cjs +0 -22
- package/dist/popover-7x4m0vtH-4ZPteOIQ.js +0 -236
- package/dist/popover-7x4m0vtH-CssTZsJf.cjs +0 -1
- package/dist/textarea-CiiExbDs-DWpkB9cy.cjs +0 -199
- package/dist/textarea-CiiExbDs-SCifCVTO.js +0 -18439
- package/dist/types/App.d.ts +0 -3
- package/dist/types/App.d.ts.map +0 -1
- package/dist/types/components/actions/Actions.d.ts +0 -28
- package/dist/types/components/actions/Actions.d.ts.map +0 -1
- package/dist/types/components/actions/index.d.ts +0 -2
- package/dist/types/components/actions/index.d.ts.map +0 -1
- package/dist/types/components/confirm/Confirm.d.ts +0 -22
- package/dist/types/components/confirm/Confirm.d.ts.map +0 -1
- package/dist/types/components/confirm/PasswordConfirm.d.ts +0 -16
- package/dist/types/components/confirm/PasswordConfirm.d.ts.map +0 -1
- package/dist/types/components/confirm/index.d.ts +0 -4
- package/dist/types/components/confirm/index.d.ts.map +0 -1
- package/dist/types/components/datatable/DataTable.d.ts +0 -194
- package/dist/types/components/datatable/DataTable.d.ts.map +0 -1
- package/dist/types/components/datatable/MyTable.d.ts +0 -44
- package/dist/types/components/datatable/MyTable.d.ts.map +0 -1
- package/dist/types/components/datatable/index.d.ts +0 -3
- package/dist/types/components/datatable/index.d.ts.map +0 -1
- package/dist/types/components/datepicker/DateRangePicker.d.ts +0 -37
- package/dist/types/components/datepicker/DateRangePicker.d.ts.map +0 -1
- package/dist/types/components/datepicker/index.d.ts +0 -2
- package/dist/types/components/datepicker/index.d.ts.map +0 -1
- package/dist/types/components/empty/Empty.d.ts +0 -19
- package/dist/types/components/empty/Empty.d.ts.map +0 -1
- package/dist/types/components/empty/index.d.ts +0 -2
- package/dist/types/components/empty/index.d.ts.map +0 -1
- package/dist/types/components/export/ExportData.d.ts +0 -44
- package/dist/types/components/export/ExportData.d.ts.map +0 -1
- package/dist/types/components/export/index.d.ts +0 -2
- package/dist/types/components/export/index.d.ts.map +0 -1
- package/dist/types/components/filters/FilterWrapper.d.ts +0 -56
- package/dist/types/components/filters/FilterWrapper.d.ts.map +0 -1
- package/dist/types/components/filters/Search.d.ts +0 -23
- package/dist/types/components/filters/Search.d.ts.map +0 -1
- package/dist/types/components/filters/SearchWithCtrl.d.ts +0 -20
- package/dist/types/components/filters/SearchWithCtrl.d.ts.map +0 -1
- package/dist/types/components/filters/index.d.ts +0 -4
- package/dist/types/components/filters/index.d.ts.map +0 -1
- package/dist/types/components/form/MyCheckbox.d.ts +0 -20
- package/dist/types/components/form/MyCheckbox.d.ts.map +0 -1
- package/dist/types/components/form/MyDatePicker.d.ts +0 -35
- package/dist/types/components/form/MyDatePicker.d.ts.map +0 -1
- package/dist/types/components/form/MyDateRangePicker.d.ts +0 -26
- package/dist/types/components/form/MyDateRangePicker.d.ts.map +0 -1
- package/dist/types/components/form/MyHtmlEditor.d.ts +0 -26
- package/dist/types/components/form/MyHtmlEditor.d.ts.map +0 -1
- package/dist/types/components/form/MyInput.d.ts +0 -23
- package/dist/types/components/form/MyInput.d.ts.map +0 -1
- package/dist/types/components/form/MyMaskInput.d.ts +0 -28
- package/dist/types/components/form/MyMaskInput.d.ts.map +0 -1
- package/dist/types/components/form/MyRadio.d.ts +0 -25
- package/dist/types/components/form/MyRadio.d.ts.map +0 -1
- package/dist/types/components/form/MySelect.d.ts +0 -29
- package/dist/types/components/form/MySelect.d.ts.map +0 -1
- package/dist/types/components/form/MySwitch.d.ts +0 -19
- package/dist/types/components/form/MySwitch.d.ts.map +0 -1
- package/dist/types/components/form/MyTextarea.d.ts +0 -24
- package/dist/types/components/form/MyTextarea.d.ts.map +0 -1
- package/dist/types/components/form/MyTimePicker.d.ts +0 -29
- package/dist/types/components/form/MyTimePicker.d.ts.map +0 -1
- package/dist/types/components/form/index.d.ts +0 -13
- package/dist/types/components/form/index.d.ts.map +0 -1
- package/dist/types/components/gallery/MyGallery.d.ts +0 -47
- package/dist/types/components/gallery/MyGallery.d.ts.map +0 -1
- package/dist/types/components/gallery/index.d.ts +0 -2
- package/dist/types/components/gallery/index.d.ts.map +0 -1
- package/dist/types/components/index.d.ts +0 -15
- package/dist/types/components/index.d.ts.map +0 -1
- package/dist/types/components/loader/Loader.d.ts +0 -9
- package/dist/types/components/loader/Loader.d.ts.map +0 -1
- package/dist/types/components/loader/Spin.d.ts +0 -14
- package/dist/types/components/loader/Spin.d.ts.map +0 -1
- package/dist/types/components/loader/index.d.ts +0 -4
- package/dist/types/components/loader/index.d.ts.map +0 -1
- package/dist/types/components/modal/MyModal.d.ts +0 -51
- package/dist/types/components/modal/MyModal.d.ts.map +0 -1
- package/dist/types/components/modal/index.d.ts +0 -2
- package/dist/types/components/modal/index.d.ts.map +0 -1
- package/dist/types/components/pagination/MyLimitSelect.d.ts +0 -24
- package/dist/types/components/pagination/MyLimitSelect.d.ts.map +0 -1
- package/dist/types/components/pagination/MyPagination.d.ts +0 -39
- package/dist/types/components/pagination/MyPagination.d.ts.map +0 -1
- package/dist/types/components/pagination/index.d.ts +0 -4
- package/dist/types/components/pagination/index.d.ts.map +0 -1
- package/dist/types/components/scroll/ScrollArea.d.ts +0 -8
- package/dist/types/components/scroll/ScrollArea.d.ts.map +0 -1
- package/dist/types/components/scroll/index.d.ts +0 -2
- package/dist/types/components/scroll/index.d.ts.map +0 -1
- package/dist/types/components/theme/index.d.ts +0 -2
- package/dist/types/components/theme/index.d.ts.map +0 -1
- package/dist/types/components/theme/theme-toggle.d.ts +0 -15
- package/dist/types/components/theme/theme-toggle.d.ts.map +0 -1
- package/dist/types/components/tooltip/MyTooltip.d.ts +0 -24
- package/dist/types/components/tooltip/MyTooltip.d.ts.map +0 -1
- package/dist/types/components/tooltip/index.d.ts +0 -3
- package/dist/types/components/tooltip/index.d.ts.map +0 -1
- package/dist/types/contexts/ThemeProviderContext.d.ts +0 -18
- package/dist/types/contexts/ThemeProviderContext.d.ts.map +0 -1
- package/dist/types/contexts/index.d.ts +0 -2
- package/dist/types/contexts/index.d.ts.map +0 -1
- package/dist/types/enums/Keyboard.d.ts +0 -7
- package/dist/types/enums/Keyboard.d.ts.map +0 -1
- package/dist/types/enums/SortOrder.d.ts +0 -8
- package/dist/types/enums/SortOrder.d.ts.map +0 -1
- package/dist/types/enums/ThemeMode.d.ts +0 -9
- package/dist/types/enums/ThemeMode.d.ts.map +0 -1
- package/dist/types/enums/index.d.ts +0 -4
- package/dist/types/enums/index.d.ts.map +0 -1
- package/dist/types/hooks/index.d.ts +0 -9
- package/dist/types/hooks/index.d.ts.map +0 -1
- package/dist/types/hooks/useColumns.d.ts +0 -27
- package/dist/types/hooks/useColumns.d.ts.map +0 -1
- package/dist/types/hooks/useConfirm.d.ts +0 -16
- package/dist/types/hooks/useConfirm.d.ts.map +0 -1
- package/dist/types/hooks/useDataTable.d.ts +0 -27
- package/dist/types/hooks/useDataTable.d.ts.map +0 -1
- package/dist/types/hooks/useDocumentTitle.d.ts +0 -8
- package/dist/types/hooks/useDocumentTitle.d.ts.map +0 -1
- package/dist/types/hooks/useFilter.d.ts +0 -19
- package/dist/types/hooks/useFilter.d.ts.map +0 -1
- package/dist/types/hooks/useMediaQuerySizes.d.ts +0 -15
- package/dist/types/hooks/useMediaQuerySizes.d.ts.map +0 -1
- package/dist/types/hooks/useSortable.d.ts +0 -23
- package/dist/types/hooks/useSortable.d.ts.map +0 -1
- package/dist/types/hooks/useTheme.d.ts +0 -9
- package/dist/types/hooks/useTheme.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -3
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/main.d.ts +0 -3
- package/dist/types/main.d.ts.map +0 -1
- package/dist/types/providers/ThemeProvider.d.ts +0 -23
- package/dist/types/providers/ThemeProvider.d.ts.map +0 -1
- package/dist/types/providers/index.d.ts +0 -2
- package/dist/types/providers/index.d.ts.map +0 -1
- package/dist/types/schemas/createConfirmPasswordSchema.d.ts +0 -20
- package/dist/types/schemas/createConfirmPasswordSchema.d.ts.map +0 -1
- package/dist/types/schemas/index.d.ts +0 -2
- package/dist/types/schemas/index.d.ts.map +0 -1
- package/dist/types/setupTests.d.ts +0 -2
- package/dist/types/setupTests.d.ts.map +0 -1
- package/dist/types/stores/index.d.ts +0 -3
- package/dist/types/stores/index.d.ts.map +0 -1
- package/dist/types/stores/useColumnsStore.d.ts +0 -26
- package/dist/types/stores/useColumnsStore.d.ts.map +0 -1
- package/dist/types/stores/useDateRangeStore.d.ts +0 -27
- package/dist/types/stores/useDateRangeStore.d.ts.map +0 -1
- package/dist/types/types/column.type.d.ts +0 -31
- package/dist/types/types/column.type.d.ts.map +0 -1
- package/dist/types/types/index.d.ts +0 -3
- package/dist/types/types/index.d.ts.map +0 -1
- package/dist/types/types/translation-args.type.d.ts +0 -10
- package/dist/types/types/translation-args.type.d.ts.map +0 -1
- package/dist/types/utils/day.d.ts +0 -7
- package/dist/types/utils/day.d.ts.map +0 -1
- package/dist/useColumnsStore-CX75fiLd.cjs +0 -1
- package/dist/useFilter-Cla-8ZPF.cjs +0 -1
- package/dist/useSortable-BmzwYs5E.cjs +0 -1
- package/dist/useTheme-DSAqyhTz.cjs +0 -1
- package/dist/utils-D6dQK9i--GOs1I_EP.js +0 -2777
- package/dist/utils-D6dQK9i--_YSyWSye.cjs +0 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsxs as e, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { W as t, f as a } from "./index-E1NtSoNr.es.js";
|
|
3
|
+
import { Button as m } from "dgz-ui/button";
|
|
4
|
+
import { DropdownMenu as c, DropdownMenuTrigger as p, DropdownMenuContent as u, DropdownMenuItem as h } from "dgz-ui/dropdown";
|
|
5
|
+
const C = ({
|
|
6
|
+
actions: o,
|
|
7
|
+
triggerProps: i,
|
|
8
|
+
contentProps: l,
|
|
9
|
+
title: s
|
|
10
|
+
}) => /* @__PURE__ */ e(c, { children: [
|
|
11
|
+
/* @__PURE__ */ n(p, { asChild: !0, ...i, children: /* @__PURE__ */ e(
|
|
12
|
+
m,
|
|
13
|
+
{
|
|
14
|
+
variant: "secondary",
|
|
15
|
+
size: "sm",
|
|
16
|
+
className: "ml-auto rounded-lg px-3",
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ n(t, {}),
|
|
19
|
+
" ",
|
|
20
|
+
/* @__PURE__ */ n("span", { className: "hidden lg:!inline", children: s || "Actions" }),
|
|
21
|
+
/* @__PURE__ */ n(a, {})
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
) }),
|
|
25
|
+
/* @__PURE__ */ n(u, { align: "end", ...l, children: o.map((r, d) => /* @__PURE__ */ n(h, { onClick: () => r.onClick(), children: r.label }, d)) })
|
|
26
|
+
] });
|
|
27
|
+
export {
|
|
28
|
+
C as A
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=Actions-Bi_vjY5M.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Actions-Bi_vjY5M.es.js","sources":["../../src/components/actions/Actions.tsx"],"sourcesContent":["import { RiArrowDownSLine, RiPlayList2Line } from '@remixicon/react';\nimport { Button } from 'dgz-ui/button';\nimport {\n type DropdownContainerProps,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from 'dgz-ui/dropdown';\nimport type { ReactNode } from 'react';\n\n/**\n * Interface representing a single action item.\n */\nexport interface ActionInterface {\n /** The content to display for the action item. */\n label: ReactNode;\n /** Callback function to execute when the action is clicked. */\n onClick: () => void;\n}\n\n/**\n * Props for the Actions component.\n */\nexport interface ActionsProps extends DropdownContainerProps {\n /** Array of action items to be displayed in the dropdown. */\n actions: ActionInterface[];\n /** Title for the actions button. */\n title?: ReactNode;\n}\n\n/**\n * Actions renders a dropdown menu with a list of action items.\n *\n * @param props.actions - Array of actions with label and onClick handler.\n * @returns React element rendering the actions dropdown.\n */\nexport const Actions = ({\n actions,\n triggerProps,\n contentProps,\n title,\n}: ActionsProps) => {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild {...triggerProps}>\n <Button\n variant=\"secondary\"\n size={'sm'}\n className={'ml-auto rounded-lg px-3'}\n >\n <RiPlayList2Line />{' '}\n <span className={'hidden lg:!inline'}>{title || 'Actions'}</span>\n <RiArrowDownSLine />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" {...contentProps}>\n {actions.map((action, index) => {\n return (\n <DropdownMenuItem key={index} onClick={() => action.onClick()}>\n {action.label}\n </DropdownMenuItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n};\n"],"names":["Actions","actions","triggerProps","contentProps","title","DropdownMenu","jsx","DropdownMenuTrigger","jsxs","Button","RiPlayList2Line","RiArrowDownSLine","DropdownMenuContent","action","index","DropdownMenuItem"],"mappings":";;;;AAqCO,MAAMA,IAAU,CAAC;AAAA,EACtB,SAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAC;AACF,wBAEKC,GAAA,EACC,UAAA;AAAA,EAAA,gBAAAC,EAACC,GAAA,EAAoB,SAAO,IAAE,GAAGL,GAC/B,UAAA,gBAAAM;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAAQ;AAAA,MACR,MAAM;AAAA,MACN,WAAW;AAAA,MAEX,UAAA;AAAA,QAAA,gBAAAH,EAACI,GAAA,EAAgB;AAAA,QAAG;AAAA,QACpB,gBAAAJ,EAAC,QAAA,EAAK,WAAW,qBAAsB,eAAS,WAAU;AAAA,0BACzDK,GAAA,CAAA,CAAiB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAEtB;AAAA,EACA,gBAAAL,EAACM,GAAA,EAAoB,OAAM,OAAO,GAAGT,GAClC,UAAAF,EAAQ,IAAI,CAACY,GAAQC,MAElB,gBAAAR,EAACS,KAA6B,SAAS,MAAMF,EAAO,QAAA,GACjD,UAAAA,EAAO,MAAA,GADaC,CAEvB,CAEH,EAAA,CACH;AAAA,GACF;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),s=require("./index-ClQFzqcq.cjs.js"),l=require("dgz-ui/button"),e=require("dgz-ui/dropdown"),u=({actions:i,triggerProps:o,contentProps:t,title:d})=>n.jsxs(e.DropdownMenu,{children:[n.jsx(e.DropdownMenuTrigger,{asChild:!0,...o,children:n.jsxs(l.Button,{variant:"secondary",size:"sm",className:"ml-auto rounded-lg px-3",children:[n.jsx(s.Wg,{})," ",n.jsx("span",{className:"hidden lg:!inline",children:d||"Actions"}),n.jsx(s.f1,{})]})}),n.jsx(e.DropdownMenuContent,{align:"end",...t,children:i.map((r,c)=>n.jsx(e.DropdownMenuItem,{onClick:()=>r.onClick(),children:r.label},c))})]});exports.Actions=u;
|
|
2
|
+
//# sourceMappingURL=Actions-CXOiCjx0.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Actions-CXOiCjx0.cjs.js","sources":["../../src/components/actions/Actions.tsx"],"sourcesContent":["import { RiArrowDownSLine, RiPlayList2Line } from '@remixicon/react';\nimport { Button } from 'dgz-ui/button';\nimport {\n type DropdownContainerProps,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from 'dgz-ui/dropdown';\nimport type { ReactNode } from 'react';\n\n/**\n * Interface representing a single action item.\n */\nexport interface ActionInterface {\n /** The content to display for the action item. */\n label: ReactNode;\n /** Callback function to execute when the action is clicked. */\n onClick: () => void;\n}\n\n/**\n * Props for the Actions component.\n */\nexport interface ActionsProps extends DropdownContainerProps {\n /** Array of action items to be displayed in the dropdown. */\n actions: ActionInterface[];\n /** Title for the actions button. */\n title?: ReactNode;\n}\n\n/**\n * Actions renders a dropdown menu with a list of action items.\n *\n * @param props.actions - Array of actions with label and onClick handler.\n * @returns React element rendering the actions dropdown.\n */\nexport const Actions = ({\n actions,\n triggerProps,\n contentProps,\n title,\n}: ActionsProps) => {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild {...triggerProps}>\n <Button\n variant=\"secondary\"\n size={'sm'}\n className={'ml-auto rounded-lg px-3'}\n >\n <RiPlayList2Line />{' '}\n <span className={'hidden lg:!inline'}>{title || 'Actions'}</span>\n <RiArrowDownSLine />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" {...contentProps}>\n {actions.map((action, index) => {\n return (\n <DropdownMenuItem key={index} onClick={() => action.onClick()}>\n {action.label}\n </DropdownMenuItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n};\n"],"names":["Actions","actions","triggerProps","contentProps","title","DropdownMenu","jsx","DropdownMenuTrigger","jsxs","Button","RiPlayList2Line","RiArrowDownSLine","DropdownMenuContent","action","index","DropdownMenuItem"],"mappings":"+IAqCaA,EAAU,CAAC,CACtB,QAAAC,EACA,aAAAC,EACA,aAAAC,EACA,MAAAC,CACF,WAEKC,eAAA,CACC,SAAA,CAAAC,EAAAA,IAACC,EAAAA,oBAAA,CAAoB,QAAO,GAAE,GAAGL,EAC/B,SAAAM,EAAAA,KAACC,EAAAA,OAAA,CACC,QAAQ,YACR,KAAM,KACN,UAAW,0BAEX,SAAA,CAAAH,EAAAA,IAACI,EAAAA,GAAA,EAAgB,EAAG,IACpBJ,EAAAA,IAAC,OAAA,CAAK,UAAW,oBAAsB,YAAS,UAAU,QACzDK,EAAAA,GAAA,CAAA,CAAiB,CAAA,CAAA,CAAA,EAEtB,EACAL,EAAAA,IAACM,EAAAA,oBAAA,CAAoB,MAAM,MAAO,GAAGT,EAClC,SAAAF,EAAQ,IAAI,CAACY,EAAQC,IAElBR,MAACS,EAAAA,kBAA6B,QAAS,IAAMF,EAAO,QAAA,EACjD,SAAAA,EAAO,KAAA,EADaC,CAEvB,CAEH,CAAA,CACH,CAAA,EACF"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import l from "dayjs";
|
|
3
|
+
import { Button as j } from "dgz-ui/button";
|
|
4
|
+
import { DATE as w, Calendar as O } from "dgz-ui/calendar";
|
|
5
|
+
import { Input as P } from "dgz-ui/form";
|
|
6
|
+
import { Popover as A, PopoverTrigger as M, PopoverContent as z } from "dgz-ui/popover";
|
|
7
|
+
import { cn as h } from "dgz-ui/utils";
|
|
8
|
+
import { XIcon as E, Calendar1 as F } from "lucide-react";
|
|
9
|
+
import { useState as d, useEffect as I, useMemo as Z } from "react";
|
|
10
|
+
import { useTranslation as $ } from "react-i18next";
|
|
11
|
+
const V = ({
|
|
12
|
+
className: T,
|
|
13
|
+
format: n = w,
|
|
14
|
+
selected: r,
|
|
15
|
+
timezone: p,
|
|
16
|
+
onRangeSelected: m = () => {
|
|
17
|
+
},
|
|
18
|
+
placeholder: x,
|
|
19
|
+
disabled: i,
|
|
20
|
+
error: N,
|
|
21
|
+
inputProps: C,
|
|
22
|
+
...u
|
|
23
|
+
}) => {
|
|
24
|
+
const { t: a } = $(), [k, D] = d(!1), [o, f] = d();
|
|
25
|
+
I(() => {
|
|
26
|
+
f(r);
|
|
27
|
+
}, [r]);
|
|
28
|
+
const L = Z(() => {
|
|
29
|
+
const t = l().endOf("day");
|
|
30
|
+
return [
|
|
31
|
+
{
|
|
32
|
+
from: t.startOf("week").toDate(),
|
|
33
|
+
to: t.endOf("week").toDate(),
|
|
34
|
+
label: a("This week")
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
from: t.startOf("month").toDate(),
|
|
38
|
+
to: t.endOf("month").toDate(),
|
|
39
|
+
label: a("This month")
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
from: t.startOf("year").toDate(),
|
|
43
|
+
to: t.endOf("year").toDate(),
|
|
44
|
+
label: a("This year")
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
from: t.subtract(7, "day").startOf("day").toDate(),
|
|
48
|
+
to: t.toDate(),
|
|
49
|
+
label: a("Last 7 days")
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
from: t.subtract(30, "day").startOf("day").toDate(),
|
|
53
|
+
to: t.toDate(),
|
|
54
|
+
label: a("Last 30 days")
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
from: t.subtract(3, "month").startOf("day").toDate(),
|
|
58
|
+
to: t.toDate(),
|
|
59
|
+
label: a("Last 3 months")
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
from: t.subtract(6, "month").startOf("day").toDate(),
|
|
63
|
+
to: t.toDate(),
|
|
64
|
+
label: a("Last 6 months")
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
from: t.subtract(12, "month").startOf("day").toDate(),
|
|
68
|
+
to: t.toDate(),
|
|
69
|
+
label: a("Last 12 months")
|
|
70
|
+
}
|
|
71
|
+
].map((s) => {
|
|
72
|
+
var y, v;
|
|
73
|
+
return {
|
|
74
|
+
...s,
|
|
75
|
+
isActive: ((y = r == null ? void 0 : r.from) == null ? void 0 : y.getTime()) === s.from.getTime() && ((v = r == null ? void 0 : r.to) == null ? void 0 : v.getTime()) === s.to.getTime()
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
}, [a, r]), b = (t) => {
|
|
79
|
+
f(t), t != null && t.from && (t != null && t.to) && (m(t), D(!1));
|
|
80
|
+
};
|
|
81
|
+
return /* @__PURE__ */ c(A, { open: k, onOpenChange: D, children: [
|
|
82
|
+
/* @__PURE__ */ e(M, { asChild: !0, className: "m-0!", disabled: i, children: /* @__PURE__ */ c("div", { className: "relative", children: [
|
|
83
|
+
/* @__PURE__ */ e(
|
|
84
|
+
P,
|
|
85
|
+
{
|
|
86
|
+
variant: N ? "failure" : "default",
|
|
87
|
+
...C,
|
|
88
|
+
readOnly: !0,
|
|
89
|
+
value: o != null && o.from ? o.to ? `${l(o.from).format(n)}-${l(o.to).format(n)}` : l(o.from).format(n) : "",
|
|
90
|
+
placeholder: x,
|
|
91
|
+
disabled: i,
|
|
92
|
+
className: h(T)
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
o && /* @__PURE__ */ e(
|
|
96
|
+
E,
|
|
97
|
+
{
|
|
98
|
+
onClick: () => {
|
|
99
|
+
f(void 0), m == null || m(void 0);
|
|
100
|
+
},
|
|
101
|
+
className: h(
|
|
102
|
+
"text-secondary absolute top-3 right-8 size-4 cursor-pointer",
|
|
103
|
+
i && "pointer-events-none opacity-50"
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
),
|
|
107
|
+
/* @__PURE__ */ e(
|
|
108
|
+
F,
|
|
109
|
+
{
|
|
110
|
+
className: h(
|
|
111
|
+
"text-secondary absolute top-2.5 right-2 size-5",
|
|
112
|
+
i && "pointer-events-none opacity-50"
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
] }) }),
|
|
117
|
+
/* @__PURE__ */ c(z, { className: "flex w-auto p-0", align: "end", side: "bottom", children: [
|
|
118
|
+
/* @__PURE__ */ e(
|
|
119
|
+
"div",
|
|
120
|
+
{
|
|
121
|
+
className: "border-border-alpha-light flex flex-col space-y-1 border-e p-2",
|
|
122
|
+
children: L.map((t, s) => /* @__PURE__ */ e(
|
|
123
|
+
j,
|
|
124
|
+
{
|
|
125
|
+
size: "xs",
|
|
126
|
+
variant: t.isActive ? "default" : "ghost",
|
|
127
|
+
className: "justify-start",
|
|
128
|
+
onClick: () => b(t),
|
|
129
|
+
children: t.label
|
|
130
|
+
},
|
|
131
|
+
s
|
|
132
|
+
))
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
/* @__PURE__ */ e(
|
|
136
|
+
O,
|
|
137
|
+
{
|
|
138
|
+
...u,
|
|
139
|
+
className: "border-border-alpha-light border-e",
|
|
140
|
+
mode: "single",
|
|
141
|
+
endMonth: o == null ? void 0 : o.to,
|
|
142
|
+
selected: o == null ? void 0 : o.from,
|
|
143
|
+
selectedToDate: o == null ? void 0 : o.to,
|
|
144
|
+
selectedFromDate: o == null ? void 0 : o.from,
|
|
145
|
+
timeZone: p,
|
|
146
|
+
disabled: o != null && o.to ? {
|
|
147
|
+
after: o.to
|
|
148
|
+
} : void 0,
|
|
149
|
+
onSelect: (t) => {
|
|
150
|
+
f({ ...o, from: t });
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
),
|
|
154
|
+
/* @__PURE__ */ e(
|
|
155
|
+
O,
|
|
156
|
+
{
|
|
157
|
+
...u,
|
|
158
|
+
mode: "single",
|
|
159
|
+
startMonth: o == null ? void 0 : o.from,
|
|
160
|
+
selected: o == null ? void 0 : o.to,
|
|
161
|
+
timeZone: p,
|
|
162
|
+
disabled: o != null && o.from ? {
|
|
163
|
+
before: o.from
|
|
164
|
+
} : void 0,
|
|
165
|
+
selectedToDate: o == null ? void 0 : o.to,
|
|
166
|
+
selectedFromDate: o == null ? void 0 : o.from,
|
|
167
|
+
onSelect: (t) => {
|
|
168
|
+
o && b({ ...o, to: t });
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
)
|
|
172
|
+
] })
|
|
173
|
+
] });
|
|
174
|
+
};
|
|
175
|
+
export {
|
|
176
|
+
V as D
|
|
177
|
+
};
|
|
178
|
+
//# sourceMappingURL=DateRangePicker-DQoK4BQV.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateRangePicker-DQoK4BQV.es.js","sources":["../../src/components/datepicker/DateRangePicker.tsx"],"sourcesContent":["import dayjs from 'dayjs';\nimport { Button } from 'dgz-ui/button';\nimport { Calendar, type CalendarProps, DATE } from 'dgz-ui/calendar';\nimport { Input, type InputProps } from 'dgz-ui/form';\nimport { Popover, PopoverContent, PopoverTrigger } from 'dgz-ui/popover';\nimport { cn } from 'dgz-ui/utils';\nimport { Calendar1, XIcon } from 'lucide-react';\nimport { type ReactNode, useEffect, useMemo, useState } from 'react';\nimport { type DateRange } from 'react-day-picker';\nimport { useTranslation } from 'react-i18next';\n\n/**\n * Props for the DateRangePicker component.\n */\nexport type DateRangePickerProps = Omit<\n CalendarProps,\n 'mode' | 'disabled' | 'selected'\n> & {\n /** The date format string (e.g., 'YYYY-MM-DD'). */\n format?: string;\n /** Placeholder text when no date is selected. */\n placeholder?: string;\n /** The currently selected date range. */\n selected?: DateRange;\n /** Timezone for date calculations. */\n timezone?: string;\n /** Error message to display (modifies styling). */\n error?: string;\n /** Callback function when a date range is selected. */\n onRangeSelected?: (value?: DateRange) => void;\n inputProps?: InputProps;\n disabled?: boolean;\n};\n\n/**\n * Type definition for a date range preset configuration.\n */\ntype PresetType = DateRange & {\n /** Label for the preset (e.g., \"Last 7 days\"). */\n label: ReactNode;\n isActive?: boolean;\n};\n\n/**\n * DateRangePicker displays a two-month range picker with helpful presets.\n *\n * @param props.format - Display date format.\n * @param props.selected - Currently selected date range.\n * @param props.timezone - Time zone for date calculations.\n * @param props.onRangeSelected - Callback when a full range is selected.\n * @param props.placeholder - Placeholder when no date selected.\n * @param props.error - Optional error message that adjusts styling.\n * @param props.inputProps - Props passed to the underlying Input component.\n * @param props.disabled - Whether the date range picker is disabled.\n * @returns A date range picker component.\n */\nexport const DateRangePicker = ({\n className,\n format = DATE,\n selected,\n timezone,\n onRangeSelected = () => {},\n placeholder,\n disabled,\n error,\n inputProps,\n ...props\n}: DateRangePickerProps) => {\n const { t } = useTranslation();\n const [open, setOpen] = useState(false);\n const [date, setDate] = useState<DateRange | undefined>();\n\n useEffect(() => {\n setDate(selected);\n }, [selected]);\n\n const presets: PresetType[] = useMemo(() => {\n const today = dayjs().endOf('day');\n return [\n {\n from: today.startOf('week').toDate(),\n to: today.endOf('week').toDate(),\n label: t('This week'),\n },\n {\n from: today.startOf('month').toDate(),\n to: today.endOf('month').toDate(),\n label: t('This month'),\n },\n {\n from: today.startOf('year').toDate(),\n to: today.endOf('year').toDate(),\n label: t('This year'),\n },\n {\n from: today.subtract(7, 'day').startOf('day').toDate(),\n to: today.toDate(),\n label: t('Last 7 days'),\n },\n {\n from: today.subtract(30, 'day').startOf('day').toDate(),\n to: today.toDate(),\n label: t('Last 30 days'),\n },\n {\n from: today.subtract(3, 'month').startOf('day').toDate(),\n to: today.toDate(),\n label: t('Last 3 months'),\n },\n {\n from: today.subtract(6, 'month').startOf('day').toDate(),\n to: today.toDate(),\n label: t('Last 6 months'),\n },\n {\n from: today.subtract(12, 'month').startOf('day').toDate(),\n to: today.toDate(),\n label: t('Last 12 months'),\n },\n ].map((item) => ({\n ...item,\n isActive:\n selected?.from?.getTime() === item.from.getTime() &&\n selected?.to?.getTime() === item.to.getTime(),\n }));\n }, [t, selected]);\n\n const handleRangeSelect = (range: DateRange) => {\n setDate(range);\n if (range?.from && range?.to) {\n onRangeSelected(range);\n setOpen(false);\n }\n };\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild className={'m-0!'} disabled={disabled}>\n <div className={'relative'}>\n <Input\n variant={error ? 'failure' : 'default'}\n {...inputProps}\n readOnly\n value={\n date?.from\n ? date.to\n ? `${dayjs(date.from).format(format)}-${dayjs(date.to).format(format)}`\n : dayjs(date.from).format(format)\n : ''\n }\n placeholder={placeholder}\n disabled={disabled}\n className={cn(className)}\n />\n {date && (\n <XIcon\n onClick={() => {\n setDate(undefined);\n onRangeSelected?.(undefined);\n }}\n className={cn(\n 'text-secondary absolute top-3 right-8 size-4 cursor-pointer',\n disabled && 'pointer-events-none opacity-50'\n )}\n />\n )}\n <Calendar1\n className={cn(\n 'text-secondary absolute top-2.5 right-2 size-5',\n disabled && 'pointer-events-none opacity-50'\n )}\n />\n </div>\n </PopoverTrigger>\n <PopoverContent className=\"flex w-auto p-0\" align=\"end\" side={'bottom'}>\n <div\n className={\n 'border-border-alpha-light flex flex-col space-y-1 border-e p-2'\n }\n >\n {presets.map((preset, index) => (\n <Button\n size={'xs'}\n key={index}\n variant={preset.isActive ? 'default' : 'ghost'}\n className={'justify-start'}\n onClick={() => handleRangeSelect(preset)}\n >\n {preset.label}\n </Button>\n ))}\n </div>\n <Calendar\n {...props}\n className={'border-border-alpha-light border-e'}\n mode=\"single\"\n endMonth={date?.to}\n selected={date?.from}\n selectedToDate={date?.to}\n selectedFromDate={date?.from}\n timeZone={timezone}\n disabled={\n date?.to\n ? {\n after: date.to,\n }\n : undefined\n }\n onSelect={(from) => {\n setDate({ ...date, from: from as Date | undefined });\n }}\n />\n <Calendar\n {...props}\n mode=\"single\"\n startMonth={date?.from}\n selected={date?.to}\n timeZone={timezone}\n disabled={\n date?.from\n ? {\n before: date.from,\n }\n : undefined\n }\n selectedToDate={date?.to}\n selectedFromDate={date?.from}\n onSelect={(to) => {\n if (date) {\n handleRangeSelect({ ...date, to: to as Date | undefined });\n }\n }}\n />\n </PopoverContent>\n </Popover>\n );\n};\n"],"names":["DateRangePicker","className","format","DATE","selected","timezone","onRangeSelected","placeholder","disabled","error","inputProps","props","t","useTranslation","open","setOpen","useState","date","setDate","useEffect","presets","useMemo","today","dayjs","item","_a","_b","handleRangeSelect","range","jsxs","Popover","jsx","PopoverTrigger","Input","cn","XIcon","Calendar1","PopoverContent","preset","index","Button","Calendar","from","to"],"mappings":";;;;;;;;;;AAwDO,MAAMA,IAAkB,CAAC;AAAA,EAC9B,WAAAC;AAAA,EACA,QAAAC,IAASC;AAAA,EACT,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,iBAAAC,IAAkB,MAAM;AAAA,EAAC;AAAA,EACzB,aAAAC;AAAA,EACA,UAAAC;A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,UAAUA,KAAA,gBAAAA,EAAM;AAAA,UAChB,gBAAgBA,KAAA,gBAAAA,EAAM;AAAA,UACtB,kBAAkBA,KAAA,gBAAAA,EAAM;AAAA,UACxB,UAAUZ;AAAA,UACV,UACEY,KAAA,QAAAA,EAAM,KACF;AAAA,YACE,OAAOA,EAAK;AAAA,UAAA,IAEd;AAAA,UAEN,UAAU,CAACyB,MAAS;AAClB,YAAAxB,EAAQ,EAAE,GAAGD,GAAM,MAAAyB,GAAgC;AAAA,UACrD;AAAA,QAAA;AAAA,MAAA;AAAA,MAEF,gBAAAX;AAAA,QAACU;AAAA,QAAA;AAAA,UACE,GAAG9B;AAAA,UACJ,MAAK;AAAA,UACL,YAAYM,KAAA,gBAAAA,EAAM;AAAA,UAClB,UAAUA,KAAA,gBAAAA,EAAM;AAAA,UAChB,UAAUZ;AAAA,UACV,UACEY,KAAA,QAAAA,EAAM,OACF;AAAA,YACE,QAAQA,EAAK;AAAA,UAAA,IAEf;AAAA,UAEN,gBAAgBA,KAAA,gBAAAA,EAAM;AAAA,UACtB,kBAAkBA,KAAA,gBAAAA,EAAM;AAAA,UACxB,UAAU,CAAC0B,MAAO;AAChB,YAAI1B,KACFU,EAAkB,EAAE,GAAGV,GAAM,IAAA0B,GAA4B;AAAA,UAE7D;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),L=require("dayjs"),P=require("dgz-ui/button"),h=require("dgz-ui/calendar"),_=require("dgz-ui/form"),d=require("dgz-ui/popover"),D=require("dgz-ui/utils"),O=require("lucide-react"),c=require("react"),w=require("react-i18next"),M=a=>a&&a.__esModule?a:{default:a},m=M(L),A=({className:a,format:u=h.DATE,selected:s,timezone:b,onRangeSelected:i=()=>{},placeholder:T,disabled:l,error:q,inputProps:N,...y})=>{const{t:r}=w.useTranslation(),[C,p]=c.useState(!1),[t,f]=c.useState();c.useEffect(()=>{f(s)},[s]);const k=c.useMemo(()=>{const o=m.default().endOf("day");return[{from:o.startOf("week").toDate(),to:o.endOf("week").toDate(),label:r("This week")},{from:o.startOf("month").toDate(),to:o.endOf("month").toDate(),label:r("This month")},{from:o.startOf("year").toDate(),to:o.endOf("year").toDate(),label:r("This year")},{from:o.subtract(7,"day").startOf("day").toDate(),to:o.toDate(),label:r("Last 7 days")},{from:o.subtract(30,"day").startOf("day").toDate(),to:o.toDate(),label:r("Last 30 days")},{from:o.subtract(3,"month").startOf("day").toDate(),to:o.toDate(),label:r("Last 3 months")},{from:o.subtract(6,"month").startOf("day").toDate(),to:o.toDate(),label:r("Last 6 months")},{from:o.subtract(12,"month").startOf("day").toDate(),to:o.toDate(),label:r("Last 12 months")}].map(n=>{var v,j;return{...n,isActive:((v=s==null?void 0:s.from)==null?void 0:v.getTime())===n.from.getTime()&&((j=s==null?void 0:s.to)==null?void 0:j.getTime())===n.to.getTime()}})},[r,s]),x=o=>{f(o),o!=null&&o.from&&(o!=null&&o.to)&&(i(o),p(!1))};return e.jsxs(d.Popover,{open:C,onOpenChange:p,children:[e.jsx(d.PopoverTrigger,{asChild:!0,className:"m-0!",disabled:l,children:e.jsxs("div",{className:"relative",children:[e.jsx(_.Input,{variant:q?"failure":"default",...N,readOnly:!0,value:t!=null&&t.from?t.to?`${m.default(t.from).format(u)}-${m.default(t.to).format(u)}`:m.default(t.from).format(u):"",placeholder:T,disabled:l,className:D.cn(a)}),t&&e.jsx(O.XIcon,{onClick:()=>{f(void 0),i==null||i(void 0)},className:D.cn("text-secondary absolute top-3 right-8 size-4 cursor-pointer",l&&"pointer-events-none opacity-50")}),e.jsx(O.Calendar1,{className:D.cn("text-secondary absolute top-2.5 right-2 size-5",l&&"pointer-events-none opacity-50")})]})}),e.jsxs(d.PopoverContent,{className:"flex w-auto p-0",align:"end",side:"bottom",children:[e.jsx("div",{className:"border-border-alpha-light flex flex-col space-y-1 border-e p-2",children:k.map((o,n)=>e.jsx(P.Button,{size:"xs",variant:o.isActive?"default":"ghost",className:"justify-start",onClick:()=>x(o),children:o.label},n))}),e.jsx(h.Calendar,{...y,className:"border-border-alpha-light border-e",mode:"single",endMonth:t==null?void 0:t.to,selected:t==null?void 0:t.from,selectedToDate:t==null?void 0:t.to,selectedFromDate:t==null?void 0:t.from,timeZone:b,disabled:t!=null&&t.to?{after:t.to}:void 0,onSelect:o=>{f({...t,from:o})}}),e.jsx(h.Calendar,{...y,mode:"single",startMonth:t==null?void 0:t.from,selected:t==null?void 0:t.to,timeZone:b,disabled:t!=null&&t.from?{before:t.from}:void 0,selectedToDate:t==null?void 0:t.to,selectedFromDate:t==null?void 0:t.from,onSelect:o=>{t&&x({...t,to:o})}})]})]})};exports.DateRangePicker=A;
|
|
2
|
+
//# sourceMappingURL=DateRangePicker-H-_fkN-r.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateRangePicker-H-_fkN-r.cjs.js","sources":["../../src/components/datepicker/DateRangePicker.tsx"],"sourcesContent":["import dayjs from 'dayjs';\nimport { Button } from 'dgz-ui/button';\nimport { Calendar, type CalendarProps, DATE } from 'dgz-ui/calendar';\nimport { Input, type InputProps } from 'dgz-ui/form';\nimport { Popover, PopoverContent, PopoverTrigger } from 'dgz-ui/popover';\nimport { cn } from 'dgz-ui/utils';\nimport { Calendar1, XIcon } from 'lucide-react';\nimport { type ReactNode, useEffect, useMemo, useState } from 'react';\nimport { type DateRange } from 'react-day-picker';\nimport { useTranslation } from 'react-i18next';\n\n/**\n * Props for the DateRangePicker component.\n */\nexport type DateRangePickerProps = Omit<\n CalendarProps,\n 'mode' | 'disabled' | 'selected'\n> & {\n /** The date format string (e.g., 'YYYY-MM-DD'). */\n format?: string;\n /** Placeholder text when no date is selected. */\n placeholder?: string;\n /** The currently selected date range. */\n selected?: DateRange;\n /** Timezone for date calculations. */\n timezone?: string;\n /** Error message to display (modifies styling). */\n error?: string;\n /** Callback function when a date range is selected. */\n onRangeSelected?: (value?: DateRange) => void;\n inputProps?: InputProps;\n disabled?: boolean;\n};\n\n/**\n * Type definition for a date range preset configuration.\n */\ntype PresetType = DateRange & {\n /** Label for the preset (e.g., \"Last 7 days\"). */\n label: ReactNode;\n isActive?: boolean;\n};\n\n/**\n * DateRangePicker displays a two-month range picker with helpful presets.\n *\n * @param props.format - Display date format.\n * @param props.selected - Currently selected date range.\n * @param props.timezone - Time zone for date calculations.\n * @param props.onRangeSelected - Callback when a full range is selected.\n * @param props.placeholder - Placeholder when no date selected.\n * @param props.error - Optional error message that adjusts styling.\n * @param props.inputProps - Props passed to the underlying Input component.\n * @param props.disabled - Whether the date range picker is disabled.\n * @returns A date range picker component.\n */\nexport const DateRangePicker = ({\n className,\n format = DATE,\n selected,\n timezone,\n onRangeSelected = () => {},\n placeholder,\n disabled,\n error,\n inputProps,\n ...props\n}: DateRangePickerProps) => {\n const { t } = useTranslation();\n const [open, setOpen] = useState(false);\n const [date, setDate] = useState<DateRange | undefined>();\n\n useEffect(() => {\n setDate(selected);\n }, [selected]);\n\n const presets: PresetType[] = useMemo(() => {\n const today = dayjs().endOf('day');\n return [\n {\n from: today.startOf('week').toDate(),\n to: today.endOf('week').toDate(),\n label: t('This week'),\n },\n {\n from: today.startOf('month').toDate(),\n to: today.endOf('month').toDate(),\n label: t('This month'),\n },\n {\n from: today.startOf('year').toDate(),\n to: today.endOf('year').toDate(),\n label: t('This year'),\n },\n {\n from: today.subtract(7, 'day').startOf('day').toDate(),\n to: today.toDate(),\n label: t('Last 7 days'),\n },\n {\n from: today.subtract(30, 'day').startOf('day').toDate(),\n to: today.toDate(),\n label: t('Last 30 days'),\n },\n {\n from: today.subtract(3, 'month').startOf('day').toDate(),\n to: today.toDate(),\n label: t('Last 3 months'),\n },\n {\n from: today.subtract(6, 'month').startOf('day').toDate(),\n to: today.toDate(),\n label: t('Last 6 months'),\n },\n {\n from: today.subtract(12, 'month').startOf('day').toDate(),\n to: today.toDate(),\n label: t('Last 12 months'),\n },\n ].map((item) => ({\n ...item,\n isActive:\n selected?.from?.getTime() === item.from.getTime() &&\n selected?.to?.getTime() === item.to.getTime(),\n }));\n }, [t, selected]);\n\n const handleRangeSelect = (range: DateRange) => {\n setDate(range);\n if (range?.from && range?.to) {\n onRangeSelected(range);\n setOpen(false);\n }\n };\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild className={'m-0!'} disabled={disabled}>\n <div className={'relative'}>\n <Input\n variant={error ? 'failure' : 'default'}\n {...inputProps}\n readOnly\n value={\n date?.from\n ? date.to\n ? `${dayjs(date.from).format(format)}-${dayjs(date.to).format(format)}`\n : dayjs(date.from).format(format)\n : ''\n }\n placeholder={placeholder}\n disabled={disabled}\n className={cn(className)}\n />\n {date && (\n <XIcon\n onClick={() => {\n setDate(undefined);\n onRangeSelected?.(undefined);\n }}\n className={cn(\n 'text-secondary absolute top-3 right-8 size-4 cursor-pointer',\n disabled && 'pointer-events-none opacity-50'\n )}\n />\n )}\n <Calendar1\n className={cn(\n 'text-secondary absolute top-2.5 right-2 size-5',\n disabled && 'pointer-events-none opacity-50'\n )}\n />\n </div>\n </PopoverTrigger>\n <PopoverContent className=\"flex w-auto p-0\" align=\"end\" side={'bottom'}>\n <div\n className={\n 'border-border-alpha-light flex flex-col space-y-1 border-e p-2'\n }\n >\n {presets.map((preset, index) => (\n <Button\n size={'xs'}\n key={index}\n variant={preset.isActive ? 'default' : 'ghost'}\n className={'justify-start'}\n onClick={() => handleRangeSelect(preset)}\n >\n {preset.label}\n </Button>\n ))}\n </div>\n <Calendar\n {...props}\n className={'border-border-alpha-light border-e'}\n mode=\"single\"\n endMonth={date?.to}\n selected={date?.from}\n selectedToDate={date?.to}\n selectedFromDate={date?.from}\n timeZone={timezone}\n disabled={\n date?.to\n ? {\n after: date.to,\n }\n : undefined\n }\n onSelect={(from) => {\n setDate({ ...date, from: from as Date | undefined });\n }}\n />\n <Calendar\n {...props}\n mode=\"single\"\n startMonth={date?.from}\n selected={date?.to}\n timeZone={timezone}\n disabled={\n date?.from\n ? {\n before: date.from,\n }\n : undefined\n }\n selectedToDate={date?.to}\n selectedFromDate={date?.from}\n onSelect={(to) => {\n if (date) {\n handleRangeSelect({ ...date, to: to as Date | undefined });\n }\n }}\n />\n </PopoverContent>\n </Popover>\n );\n};\n"],"names":["DateRangePicker","className","format","DATE","selected","timezone","onRangeSelected","placeholder","disabled","error","inputProps","props","t","useTranslation","open","setOpen","useState","date","setDate","useEffect","presets","useMemo","today","dayjs","item","_a","_b","handleRangeSelect","range","jsxs","Popover","jsx","PopoverTrigger","Input","cn","XIcon","Calendar1","PopoverContent","preset","index","Button","Calendar","from","to"],"mappings":"8TAwDaA,EAAkB,CAAC,CAC9B,UAAAC,EACA,OAAAC,EAASC,EAAAA,KACT,SAAAC,EACA,SAAAC,EACA,gBAAAC,EAAkB,IAAM,CAAC,EACzB,YAAAC,EACA,SAAAC,EACA,MAAAC,EACA,WAAAC,EACA,GAAGC,CACL,IAA4B,CAC1B,KAAM,CAAA,EAAEC,CAAA,EAAMC,iBAAA,EACR,CAACC,EAAMC,CAAO,EAAIC,EAAAA,SAAS,EAAK,EAChC,CAACC,EAAMC,CAAO,EAAIF,WAAA,EAExBG,EAAAA,UAAU,IAAM,CACdD,EAAQd,CAAQ,CAClB,EAAG,CAACA,CAAQ,CAAC,EAEb,MAAMgB,EAAwBC,EAAAA,QAAQ,IAAM,CAC1C,MAAMC,EAAQC,EAAAA,UAAQ,MAAM,KAAK,EACjC,MAAO,CACL,CACE,KAAMD,EAAM,QAAQ,MAAM,EAAE,OAAA,EAC5B,GAAIA,EAAM,MAAM,MAAM,EAAE,OAAA,EACxB,MAAOV,EAAE,WAAW,CAAA,EAEtB,CACE,KAAMU,EAAM,QAAQ,OAAO,EAAE,OAAA,EAC7B,GAAIA,EAAM,MAAM,OAAO,EAAE,OAAA,EACzB,MAAOV,EAAE,YAAY,CAAA,EAEvB,CACE,KAAMU,EAAM,QAAQ,MAAM,EAAE,OA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AAM,KAChB,eAAgBA,GAAA,YAAAA,EAAM,GACtB,iBAAkBA,GAAA,YAAAA,EAAM,KACxB,SAAUZ,EACV,SACEY,GAAA,MAAAA,EAAM,GACF,CACE,MAAOA,EAAK,EAAA,EAEd,OAEN,SAAWyB,GAAS,CAClBxB,EAAQ,CAAE,GAAGD,EAAM,KAAAyB,EAAgC,CACrD,CAAA,CAAA,EAEFX,EAAAA,IAACU,EAAAA,SAAA,CACE,GAAG9B,EACJ,KAAK,SACL,WAAYM,GAAA,YAAAA,EAAM,KAClB,SAAUA,GAAA,YAAAA,EAAM,GAChB,SAAUZ,EACV,SACEY,GAAA,MAAAA,EAAM,KACF,CACE,OAAQA,EAAK,IAAA,EAEf,OAEN,eAAgBA,GAAA,YAAAA,EAAM,GACtB,iBAAkBA,GAAA,YAAAA,EAAM,KACxB,SAAW0B,GAAO,CACZ1B,GACFU,EAAkB,CAAE,GAAGV,EAAM,GAAA0B,EAA4B,CAE7D,CAAA,CAAA,CACF,CAAA,CACF,CAAA,EACF,CAEJ"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsxs as i, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { cn as n } from "dgz-ui/utils";
|
|
3
|
+
import { FolderOpen as c } from "lucide-react";
|
|
4
|
+
import { useTranslation as l } from "react-i18next";
|
|
5
|
+
const d = ({ children: t, icon: e, className: r, ...s }) => {
|
|
6
|
+
const { t: o } = l();
|
|
7
|
+
return /* @__PURE__ */ i(
|
|
8
|
+
"div",
|
|
9
|
+
{
|
|
10
|
+
...s,
|
|
11
|
+
className: n(
|
|
12
|
+
"flex h-16 flex-col items-center justify-center text-center text-base",
|
|
13
|
+
r
|
|
14
|
+
),
|
|
15
|
+
children: [
|
|
16
|
+
e || /* @__PURE__ */ m(c, { size: 48, strokeWidth: 1 }),
|
|
17
|
+
t || o("No results")
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
d as E
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=Empty-BReVQKje.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Empty-BReVQKje.es.js","sources":["../../src/components/empty/Empty.tsx"],"sourcesContent":["import { cn } from 'dgz-ui/utils';\nimport { FolderOpen } from 'lucide-react';\nimport type { HTMLAttributes, ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\n\n/**\n * Props for the Empty component.\n */\nexport interface EmptyProps extends HTMLAttributes<HTMLDivElement> {\n /** Optional custom icon. Defaults to a folder icon. */\n icon?: ReactNode;\n}\n\n/**\n * Empty displays a simple empty state with an optional icon and message.\n *\n * @param children - Optional custom message/content.\n * @param icon - Optional custom icon. Defaults to a folder icon.\n * @param className - Additional CSS classes.\n * @param props - Additional HTML attributes for the container.\n * @returns A centered empty state component.\n */\nexport const Empty = ({ children, icon, className, ...props }: EmptyProps) => {\n const { t } = useTranslation();\n\n return (\n <div\n {...props}\n className={cn(\n 'flex h-16 flex-col items-center justify-center text-center text-base',\n className\n )}\n >\n {icon || <FolderOpen size={48} strokeWidth={1} />}\n {children || t('No results')}\n </div>\n );\n};\n"],"names":["Empty","children","icon","className","props","t","useTranslation","jsxs","cn","jsx","FolderOpen"],"mappings":";;;;AAsBO,MAAMA,IAAQ,CAAC,EAAE,UAAAC,GAAU,MAAAC,GAAM,WAAAC,GAAW,GAAGC,QAAwB;AAC5E,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA;AAEd,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGH;AAAA,MACJ,WAAWI;AAAA,QACT;AAAA,QACAL;AAAA,MAAA;AAAA,MAGD,UAAA;AAAA,QAAAD,KAAQ,gBAAAO,EAACC,GAAA,EAAW,MAAM,IAAI,aAAa,GAAG;AAAA,QAC9CT,KAAYI,EAAE,YAAY;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGjC;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),i=require("dgz-ui/utils"),u=require("lucide-react"),o=require("react-i18next"),l=({children:t,icon:s,className:r,...c})=>{const{t:n}=o.useTranslation();return e.jsxs("div",{...c,className:i.cn("flex h-16 flex-col items-center justify-center text-center text-base",r),children:[s||e.jsx(u.FolderOpen,{size:48,strokeWidth:1}),t||n("No results")]})};exports.Empty=l;
|
|
2
|
+
//# sourceMappingURL=Empty-BYOOFAab.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Empty-BYOOFAab.cjs.js","sources":["../../src/components/empty/Empty.tsx"],"sourcesContent":["import { cn } from 'dgz-ui/utils';\nimport { FolderOpen } from 'lucide-react';\nimport type { HTMLAttributes, ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\n\n/**\n * Props for the Empty component.\n */\nexport interface EmptyProps extends HTMLAttributes<HTMLDivElement> {\n /** Optional custom icon. Defaults to a folder icon. */\n icon?: ReactNode;\n}\n\n/**\n * Empty displays a simple empty state with an optional icon and message.\n *\n * @param children - Optional custom message/content.\n * @param icon - Optional custom icon. Defaults to a folder icon.\n * @param className - Additional CSS classes.\n * @param props - Additional HTML attributes for the container.\n * @returns A centered empty state component.\n */\nexport const Empty = ({ children, icon, className, ...props }: EmptyProps) => {\n const { t } = useTranslation();\n\n return (\n <div\n {...props}\n className={cn(\n 'flex h-16 flex-col items-center justify-center text-center text-base',\n className\n )}\n >\n {icon || <FolderOpen size={48} strokeWidth={1} />}\n {children || t('No results')}\n </div>\n );\n};\n"],"names":["Empty","children","icon","className","props","t","useTranslation","jsxs","cn","jsx","FolderOpen"],"mappings":"iIAsBaA,EAAQ,CAAC,CAAE,SAAAC,EAAU,KAAAC,EAAM,UAAAC,EAAW,GAAGC,KAAwB,CAC5E,KAAM,CAAE,EAAAC,CAAA,EAAMC,iBAAA,EAEd,OACEC,EAAAA,KAAC,MAAA,CACE,GAAGH,EACJ,UAAWI,EAAAA,GACT,uEACAL,CAAA,EAGD,SAAA,CAAAD,GAAQO,EAAAA,IAACC,aAAA,CAAW,KAAM,GAAI,YAAa,EAAG,EAC9CT,GAAYI,EAAE,YAAY,CAAA,CAAA,CAAA,CAGjC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsxs as e, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Z as d, f as m } from "./index-E1NtSoNr.es.js";
|
|
3
|
+
import { Button as p } from "dgz-ui/button";
|
|
4
|
+
import { DropdownMenu as c, DropdownMenuTrigger as u, DropdownMenuContent as f, DropdownMenuItem as h } from "dgz-ui/dropdown";
|
|
5
|
+
import { S as x } from "./Spin-DtW_edOq.es.js";
|
|
6
|
+
const E = ({
|
|
7
|
+
options: o,
|
|
8
|
+
loading: i = !1,
|
|
9
|
+
triggerProps: a,
|
|
10
|
+
contentProps: l,
|
|
11
|
+
title: t
|
|
12
|
+
}) => /* @__PURE__ */ e(c, { children: [
|
|
13
|
+
/* @__PURE__ */ r(u, { asChild: !0, ...a, children: /* @__PURE__ */ e(
|
|
14
|
+
p,
|
|
15
|
+
{
|
|
16
|
+
variant: "secondary",
|
|
17
|
+
size: "sm",
|
|
18
|
+
className: "ml-auto rounded-lg px-3",
|
|
19
|
+
children: [
|
|
20
|
+
i ? /* @__PURE__ */ r(x, {}) : /* @__PURE__ */ r(d, {}),
|
|
21
|
+
" ",
|
|
22
|
+
/* @__PURE__ */ r("span", { className: "hidden lg:!inline", children: t || "Export" }),
|
|
23
|
+
/* @__PURE__ */ r(m, {})
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
) }),
|
|
27
|
+
/* @__PURE__ */ r(f, { align: "end", ...l, children: o.map((n, s) => /* @__PURE__ */ r(h, { onClick: () => n.onClick(), children: n.label }, s)) })
|
|
28
|
+
] });
|
|
29
|
+
export {
|
|
30
|
+
E
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=ExportData-CHPKm-ZY.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExportData-CHPKm-ZY.es.js","sources":["../../src/components/export/ExportData.tsx"],"sourcesContent":["import { RiArrowDownSLine, RiFileChartLine } from '@remixicon/react';\nimport { Button } from 'dgz-ui/button';\nimport {\n type DropdownContainerProps,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from 'dgz-ui/dropdown';\nimport type { ReactNode } from 'react';\nimport { Spin } from '../loader';\n\n/**\n * Describes a single export option in the ExportData dropdown.\n *\n * - Use `label` to render the visible option content (text or any React node).\n * - Provide `onClick` to trigger the export logic (CSV/XLS/PDF, etc.).\n */\nexport interface ExportDataInterface {\n /** Visible content for the dropdown item (text, icon, etc.). */\n label: ReactNode;\n /** Callback executed when the export option is selected. */\n onClick: () => void;\n}\n\n/**\n * Props for the `ExportData` component.\n *\n * - `options` — A list of export actions displayed in the dropdown.\n * - `loading` — When `true`, shows a small spinner in the button to indicate an export is in progress.\n */\nexport interface ExportDataProps extends DropdownContainerProps {\n /** Export actions displayed in the dropdown. */\n options: ExportDataInterface[];\n /** If `true`, renders a spinner icon in the button. */\n loading?: boolean;\n /** Title for the export button. */\n title?: ReactNode;\n}\n\n/**\n * ExportData renders a compact dropdown button for exporting data in various formats.\n *\n * Behavior\n * - Shows a button with an export icon and localized \"Export\" label.\n * - Clicking opens a dropdown with the provided `options` list.\n * - Each option calls its `onClick` handler when selected.\n *\n * Accessibility\n * - Uses the shared Dropdown primitives and Button which provide keyboard and ARIA support.\n *\n * Internationalization\n * - The button label is translated via `react-i18next` using the `Export` key.\n */\nexport const ExportData = ({\n options,\n loading = false,\n triggerProps,\n contentProps,\n title,\n}: ExportDataProps) => {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild {...triggerProps}>\n <Button\n variant=\"secondary\"\n size={'sm'}\n className={'ml-auto rounded-lg px-3'}\n >\n {loading ? <Spin /> : <RiFileChartLine />}{' '}\n <span className={'hidden lg:!inline'}>{title || 'Export'}</span>\n <RiArrowDownSLine />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" {...contentProps}>\n {options.map((option, index) => {\n return (\n <DropdownMenuItem key={index} onClick={() => option.onClick()}>\n {option.label}\n </DropdownMenuItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n};\n"],"names":["ExportData","options","loading","triggerProps","contentProps","title","DropdownMenu","jsx","DropdownMenuTrigger","jsxs","Button","Spin","RiFileChartLine","RiArrowDownSLine","DropdownMenuContent","option","index","DropdownMenuItem"],"mappings":";;;;;AAsDO,MAAMA,IAAa,CAAC;AAAA,EACzB,SAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAC;AACF,wBAEKC,GAAA,EACC,UAAA;AAAA,EAAA,gBAAAC,EAACC,GAAA,EAAoB,SAAO,IAAE,GAAGL,GAC/B,UAAA,gBAAAM;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAAQ;AAAA,MACR,MAAM;AAAA,MACN,WAAW;AAAA,MAEV,UAAA;AAAA,QAAAR,IAAU,gBAAAK,EAACI,GAAA,CAAA,CAAK,IAAK,gBAAAJ,EAACK,GAAA,EAAgB;AAAA,QAAI;AAAA,QAC3C,gBAAAL,EAAC,QAAA,EAAK,WAAW,qBAAsB,eAAS,UAAS;AAAA,0BACxDM,GAAA,CAAA,CAAiB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAEtB;AAAA,EACA,gBAAAN,EAACO,GAAA,EAAoB,OAAM,OAAO,GAAGV,GAClC,UAAAH,EAAQ,IAAI,CAACc,GAAQC,MAElB,gBAAAT,EAACU,KAA6B,SAAS,MAAMF,EAAO,QAAA,GACjD,UAAAA,EAAO,MAAA,GADaC,CAEvB,CAEH,EAAA,CACH;AAAA,GACF;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),s=require("./index-ClQFzqcq.cjs.js"),c=require("dgz-ui/button"),e=require("dgz-ui/dropdown"),u=require("./Spin-DUK1prd9.cjs.js"),x=({options:i,loading:o=!1,triggerProps:t,contentProps:d,title:l})=>n.jsxs(e.DropdownMenu,{children:[n.jsx(e.DropdownMenuTrigger,{asChild:!0,...t,children:n.jsxs(c.Button,{variant:"secondary",size:"sm",className:"ml-auto rounded-lg px-3",children:[o?n.jsx(u.Spin,{}):n.jsx(s.ZC,{})," ",n.jsx("span",{className:"hidden lg:!inline",children:l||"Export"}),n.jsx(s.f1,{})]})}),n.jsx(e.DropdownMenuContent,{align:"end",...d,children:i.map((r,a)=>n.jsx(e.DropdownMenuItem,{onClick:()=>r.onClick(),children:r.label},a))})]});exports.ExportData=x;
|
|
2
|
+
//# sourceMappingURL=ExportData-CrB0H1Ts.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExportData-CrB0H1Ts.cjs.js","sources":["../../src/components/export/ExportData.tsx"],"sourcesContent":["import { RiArrowDownSLine, RiFileChartLine } from '@remixicon/react';\nimport { Button } from 'dgz-ui/button';\nimport {\n type DropdownContainerProps,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from 'dgz-ui/dropdown';\nimport type { ReactNode } from 'react';\nimport { Spin } from '../loader';\n\n/**\n * Describes a single export option in the ExportData dropdown.\n *\n * - Use `label` to render the visible option content (text or any React node).\n * - Provide `onClick` to trigger the export logic (CSV/XLS/PDF, etc.).\n */\nexport interface ExportDataInterface {\n /** Visible content for the dropdown item (text, icon, etc.). */\n label: ReactNode;\n /** Callback executed when the export option is selected. */\n onClick: () => void;\n}\n\n/**\n * Props for the `ExportData` component.\n *\n * - `options` — A list of export actions displayed in the dropdown.\n * - `loading` — When `true`, shows a small spinner in the button to indicate an export is in progress.\n */\nexport interface ExportDataProps extends DropdownContainerProps {\n /** Export actions displayed in the dropdown. */\n options: ExportDataInterface[];\n /** If `true`, renders a spinner icon in the button. */\n loading?: boolean;\n /** Title for the export button. */\n title?: ReactNode;\n}\n\n/**\n * ExportData renders a compact dropdown button for exporting data in various formats.\n *\n * Behavior\n * - Shows a button with an export icon and localized \"Export\" label.\n * - Clicking opens a dropdown with the provided `options` list.\n * - Each option calls its `onClick` handler when selected.\n *\n * Accessibility\n * - Uses the shared Dropdown primitives and Button which provide keyboard and ARIA support.\n *\n * Internationalization\n * - The button label is translated via `react-i18next` using the `Export` key.\n */\nexport const ExportData = ({\n options,\n loading = false,\n triggerProps,\n contentProps,\n title,\n}: ExportDataProps) => {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild {...triggerProps}>\n <Button\n variant=\"secondary\"\n size={'sm'}\n className={'ml-auto rounded-lg px-3'}\n >\n {loading ? <Spin /> : <RiFileChartLine />}{' '}\n <span className={'hidden lg:!inline'}>{title || 'Export'}</span>\n <RiArrowDownSLine />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" {...contentProps}>\n {options.map((option, index) => {\n return (\n <DropdownMenuItem key={index} onClick={() => option.onClick()}>\n {option.label}\n </DropdownMenuItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n};\n"],"names":["ExportData","options","loading","triggerProps","contentProps","title","DropdownMenu","jsx","DropdownMenuTrigger","jsxs","Button","Spin","RiFileChartLine","RiArrowDownSLine","DropdownMenuContent","option","index","DropdownMenuItem"],"mappings":"mLAsDaA,EAAa,CAAC,CACzB,QAAAC,EACA,QAAAC,EAAU,GACV,aAAAC,EACA,aAAAC,EACA,MAAAC,CACF,WAEKC,eAAA,CACC,SAAA,CAAAC,EAAAA,IAACC,EAAAA,oBAAA,CAAoB,QAAO,GAAE,GAAGL,EAC/B,SAAAM,EAAAA,KAACC,EAAAA,OAAA,CACC,QAAQ,YACR,KAAM,KACN,UAAW,0BAEV,SAAA,CAAAR,EAAUK,EAAAA,IAACI,OAAA,CAAA,CAAK,EAAKJ,EAAAA,IAACK,EAAAA,GAAA,EAAgB,EAAI,IAC3CL,EAAAA,IAAC,OAAA,CAAK,UAAW,oBAAsB,YAAS,SAAS,QACxDM,EAAAA,GAAA,CAAA,CAAiB,CAAA,CAAA,CAAA,EAEtB,EACAN,EAAAA,IAACO,EAAAA,oBAAA,CAAoB,MAAM,MAAO,GAAGV,EAClC,SAAAH,EAAQ,IAAI,CAACc,EAAQC,IAElBT,MAACU,EAAAA,kBAA6B,QAAS,IAAMF,EAAO,QAAA,EACjD,SAAAA,EAAO,KAAA,EADaC,CAEvB,CAEH,CAAA,CACH,CAAA,EACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Keyboard-CJVAJWdO.es.js","sources":["../../src/enums/Keyboard.ts"],"sourcesContent":["/**\n * Keyboard enum listing commonly used keyboard keys.\n */\nexport enum Keyboard {\n ENTER = 'Enter',\n}\n"],"names":["Keyboard"],"mappings":"AAGO,IAAKA,sBAAAA,OACVA,EAAA,QAAQ,SADEA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Keyboard-kyPAAQWP.cjs.js","sources":["../../src/enums/Keyboard.ts"],"sourcesContent":["/**\n * Keyboard enum listing commonly used keyboard keys.\n */\nexport enum Keyboard {\n ENTER = 'Enter',\n}\n"],"names":["Keyboard"],"mappings":"aAGO,IAAKA,GAAAA,IACVA,EAAA,MAAQ,QADEA,IAAAA,GAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),r=require("./Spin-DUK1prd9.cjs.js"),i=t=>e.jsx("div",{className:"text-item-primary mx-auto flex w-full items-center justify-center p-4",...t,children:e.jsx(r.Spin,{className:"text-item-primary size-6"})});exports.Loader=i;
|
|
2
|
+
//# sourceMappingURL=Loader-D_jX_Wgx.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Loader-D_jX_Wgx.cjs.js","sources":["../../src/components/loader/Loader.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\nimport Spin from './Spin.tsx';\n\n/**\n * Loader shows a centered spinning indicator inside a container.\n *\n * @param props - Optional div HTML attributes.\n */\nconst Loader = (props?: HTMLAttributes<HTMLDivElement>) => {\n return (\n <div\n className=\"text-item-primary mx-auto flex w-full items-center justify-center p-4\"\n {...props}\n >\n <Spin className=\"text-item-primary size-6\" />\n </div>\n );\n};\n\nexport default Loader;\n"],"names":["Loader","props","jsx","Spin"],"mappings":"sFAQMA,EAAUC,GAEZC,EAAAA,IAAC,MAAA,CACC,UAAU,wEACT,GAAGD,EAEJ,SAAAC,EAAAA,IAACC,EAAAA,KAAA,CAAK,UAAU,0BAAA,CAA2B,CAAA,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { S as r } from "./Spin-DtW_edOq.es.js";
|
|
3
|
+
const s = (t) => /* @__PURE__ */ e(
|
|
4
|
+
"div",
|
|
5
|
+
{
|
|
6
|
+
className: "text-item-primary mx-auto flex w-full items-center justify-center p-4",
|
|
7
|
+
...t,
|
|
8
|
+
children: /* @__PURE__ */ e(r, { className: "text-item-primary size-6" })
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
export {
|
|
12
|
+
s as L
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=Loader-zvzAi0F6.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Loader-zvzAi0F6.es.js","sources":["../../src/components/loader/Loader.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\nimport Spin from './Spin.tsx';\n\n/**\n * Loader shows a centered spinning indicator inside a container.\n *\n * @param props - Optional div HTML attributes.\n */\nconst Loader = (props?: HTMLAttributes<HTMLDivElement>) => {\n return (\n <div\n className=\"text-item-primary mx-auto flex w-full items-center justify-center p-4\"\n {...props}\n >\n <Spin className=\"text-item-primary size-6\" />\n </div>\n );\n};\n\nexport default Loader;\n"],"names":["Loader","props","jsx","Spin"],"mappings":";;AAQA,MAAMA,IAAS,CAACC,MAEZ,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACT,GAAGD;AAAA,IAEJ,UAAA,gBAAAC,EAACC,GAAA,EAAK,WAAU,2BAAA,CAA2B;AAAA,EAAA;AAAA;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),s=require("dgz-ui/form"),a=require("dgz-ui/utils"),j=require("./lodash-BjH0kD7j.cjs.js"),g=({control:o,name:r,label:c,required:m,className:i,rules:x,floatingError:u,...l})=>r&&o&&e.jsx(s.FormField,{control:o,name:r,rules:x,render:({field:n,formState:d})=>e.jsxs(s.FormItem,{className:a.cn(u&&"space-y-0"),children:[c&&e.jsxs(s.FormLabel,{className:"block",children:[c," ",m&&e.jsx("span",{className:"text-red-600",children:"*"})]}),e.jsx(s.FormControl,{children:e.jsx(s.Input,{variant:j.lodashExports.get(d.errors,`${r}.message`)?"failure":"default",...l,...n,onChange:h=>{const t=h.target.value;l.type==="number"?n.onChange(t?Number(t):void 0):n.onChange(t)},className:a.cn(i)})}),e.jsx(s.FormMessage,{className:a.cn(u&&"absolute -bottom-5")})]})})||null;exports.MyInput=g;
|
|
2
|
+
//# sourceMappingURL=MyInput-C9PNyYby.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MyInput-C9PNyYby.cjs.js","sources":["../../src/components/form/MyInput.tsx"],"sourcesContent":["import {\n FormControl,\n FormField,\n FormItem,\n type FormItemProps,\n FormLabel,\n FormMessage,\n Input,\n type InputProps,\n} from 'dgz-ui/form';\nimport { cn } from 'dgz-ui/utils';\nimport { get } from 'lodash';\nimport type { FieldPath, FieldValues } from 'react-hook-form';\n\n/**\n * Props for the MyInput component.\n * @template TFieldValues - The type of the form values.\n */\nexport type MyInputProps<TFieldValues extends FieldValues> =\n FormItemProps<TFieldValues> & InputProps;\n\n/**\n * MyInput is a form-aware input field that integrates with react-hook-form.\n * Works in both controlled (with control/name) and uncontrolled modes.\n *\n * @template TFieldValues - Form values type used by react-hook-form.\n * @param control - The `react-hook-form` control object.\n * @param name - The name of the field in `react-hook-form`.\n * @param label - The label to display for the input.\n * @param required - Whether the field is required.\n * @param className - Custom CSS class name.\n * @param rules - The `react-hook-form` validation rules.\n * @param floatingError - Whether to show the error message in a floating container.\n * @param props - Input and form item props.\n */\nexport const MyInput = <TFieldValues extends FieldValues>({\n control,\n name,\n label,\n required,\n className,\n rules,\n floatingError,\n ...props\n}: MyInputProps<TFieldValues>) => {\n return (\n (name && control && (\n <FormField<TFieldValues, FieldPath<TFieldValues>>\n control={control}\n name={name}\n rules={rules}\n render={({ field, formState }) => (\n <FormItem className={cn(floatingError && 'space-y-0')}>\n {label && (\n <FormLabel className={'block'}>\n {label} {required && <span className={'text-red-600'}>*</span>}\n </FormLabel>\n )}\n <FormControl>\n <Input\n variant={\n get(formState.errors, `${name}.message`)\n ? 'failure'\n : 'default'\n }\n {...props}\n {...field}\n onChange={(event) => {\n const value = event.target.value;\n if (props.type === 'number') {\n field.onChange(value ? Number(value) : undefined);\n } else {\n field.onChange(value);\n }\n }}\n className={cn(className)}\n />\n </FormControl>\n <FormMessage\n className={cn(floatingError && 'absolute -bottom-5')}\n />\n </FormItem>\n )}\n />\n )) ||\n null\n );\n};\n"],"names":["MyInput","control","name","label","required","className","rules","floatingError","props","jsx","FormField","field","formState","jsxs","FormItem","cn","FormLabel","FormControl","Input","get","event","value","FormMessage"],"mappings":"2IAmCaA,EAAU,CAAmC,CACxD,QAAAC,EACA,KAAAC,EACA,MAAAC,EACA,SAAAC,EACA,UAAAC,EACA,MAAAC,EACA,cAAAC,EACA,GAAGC,CACL,IAEKN,GAAQD,GACPQ,EAAAA,IAACC,EAAAA,UAAA,CACC,QAAAT,EACA,KAAAC,EACA,MAAAI,EACA,OAAQ,CAAC,CAAE,MAAAK,EAAO,UAAAC,CAAA,IAChBC,EAAAA,KAACC,EAAAA,SAAA,CAAS,UAAWC,EAAAA,GAAGR,GAAiB,WAAW,EACjD,SAAA,CAAAJ,GACCU,EAAAA,KAACG,EAAAA,UAAA,CAAU,UAAW,QACnB,SAAA,CAAAb,EAAM,IAAEC,GAAYK,EAAAA,IAAC,OAAA,CAAK,UAAW,eAAgB,SAAA,GAAA,CAAC,CAAA,EACzD,QAEDQ,EAAAA,YAAA,CACC,SAAAR,EAAAA,IAACS,EAAAA,MAAA,CACC,QACEC,EAAAA,cAAAA,IAAIP,EAAU,OAAQ,GAAGV,CAAI,UAAU,EACnC,UACA,UAEL,GAAGM,EACH,GAAGG,EACJ,SAAWS,GAAU,CACnB,MAAMC,EAAQD,EAAM,OAAO,MACvBZ,EAAM,OAAS,SACjBG,EAAM,SAASU,EAAQ,OAAOA,CAAK,EAAI,MAAS,EAEhDV,EAAM,SAASU,CAAK,CAExB,EACA,UAAWN,EAAAA,GAAGV,CAAS,CAAA,CAAA,EAE3B,EACAI,EAAAA,IAACa,EAAAA,YAAA,CACC,UAAWP,EAAAA,GAAGR,GAAiB,oBAAoB,CAAA,CAAA,CACrD,CAAA,CACF,CAAA,CAAA,GAIN"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { FormField as g, FormItem as F, FormLabel as N, FormControl as b, Input as x, FormMessage as f } from "dgz-ui/form";
|
|
3
|
+
import { cn as o } from "dgz-ui/utils";
|
|
4
|
+
import { l as v } from "./lodash-CRDOWzbs.es.js";
|
|
5
|
+
const j = ({
|
|
6
|
+
control: t,
|
|
7
|
+
name: r,
|
|
8
|
+
label: m,
|
|
9
|
+
required: u,
|
|
10
|
+
className: i,
|
|
11
|
+
rules: p,
|
|
12
|
+
floatingError: n,
|
|
13
|
+
...l
|
|
14
|
+
}) => r && t && /* @__PURE__ */ e(
|
|
15
|
+
g,
|
|
16
|
+
{
|
|
17
|
+
control: t,
|
|
18
|
+
name: r,
|
|
19
|
+
rules: p,
|
|
20
|
+
render: ({ field: s, formState: d }) => /* @__PURE__ */ c(F, { className: o(n && "space-y-0"), children: [
|
|
21
|
+
m && /* @__PURE__ */ c(N, { className: "block", children: [
|
|
22
|
+
m,
|
|
23
|
+
" ",
|
|
24
|
+
u && /* @__PURE__ */ e("span", { className: "text-red-600", children: "*" })
|
|
25
|
+
] }),
|
|
26
|
+
/* @__PURE__ */ e(b, { children: /* @__PURE__ */ e(
|
|
27
|
+
x,
|
|
28
|
+
{
|
|
29
|
+
variant: v.get(d.errors, `${r}.message`) ? "failure" : "default",
|
|
30
|
+
...l,
|
|
31
|
+
...s,
|
|
32
|
+
onChange: (h) => {
|
|
33
|
+
const a = h.target.value;
|
|
34
|
+
l.type === "number" ? s.onChange(a ? Number(a) : void 0) : s.onChange(a);
|
|
35
|
+
},
|
|
36
|
+
className: o(i)
|
|
37
|
+
}
|
|
38
|
+
) }),
|
|
39
|
+
/* @__PURE__ */ e(
|
|
40
|
+
f,
|
|
41
|
+
{
|
|
42
|
+
className: o(n && "absolute -bottom-5")
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
] })
|
|
46
|
+
}
|
|
47
|
+
) || null;
|
|
48
|
+
export {
|
|
49
|
+
j as M
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=MyInput-Wb0DSWo_.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MyInput-Wb0DSWo_.es.js","sources":["../../src/components/form/MyInput.tsx"],"sourcesContent":["import {\n FormControl,\n FormField,\n FormItem,\n type FormItemProps,\n FormLabel,\n FormMessage,\n Input,\n type InputProps,\n} from 'dgz-ui/form';\nimport { cn } from 'dgz-ui/utils';\nimport { get } from 'lodash';\nimport type { FieldPath, FieldValues } from 'react-hook-form';\n\n/**\n * Props for the MyInput component.\n * @template TFieldValues - The type of the form values.\n */\nexport type MyInputProps<TFieldValues extends FieldValues> =\n FormItemProps<TFieldValues> & InputProps;\n\n/**\n * MyInput is a form-aware input field that integrates with react-hook-form.\n * Works in both controlled (with control/name) and uncontrolled modes.\n *\n * @template TFieldValues - Form values type used by react-hook-form.\n * @param control - The `react-hook-form` control object.\n * @param name - The name of the field in `react-hook-form`.\n * @param label - The label to display for the input.\n * @param required - Whether the field is required.\n * @param className - Custom CSS class name.\n * @param rules - The `react-hook-form` validation rules.\n * @param floatingError - Whether to show the error message in a floating container.\n * @param props - Input and form item props.\n */\nexport const MyInput = <TFieldValues extends FieldValues>({\n control,\n name,\n label,\n required,\n className,\n rules,\n floatingError,\n ...props\n}: MyInputProps<TFieldValues>) => {\n return (\n (name && control && (\n <FormField<TFieldValues, FieldPath<TFieldValues>>\n control={control}\n name={name}\n rules={rules}\n render={({ field, formState }) => (\n <FormItem className={cn(floatingError && 'space-y-0')}>\n {label && (\n <FormLabel className={'block'}>\n {label} {required && <span className={'text-red-600'}>*</span>}\n </FormLabel>\n )}\n <FormControl>\n <Input\n variant={\n get(formState.errors, `${name}.message`)\n ? 'failure'\n : 'default'\n }\n {...props}\n {...field}\n onChange={(event) => {\n const value = event.target.value;\n if (props.type === 'number') {\n field.onChange(value ? Number(value) : undefined);\n } else {\n field.onChange(value);\n }\n }}\n className={cn(className)}\n />\n </FormControl>\n <FormMessage\n className={cn(floatingError && 'absolute -bottom-5')}\n />\n </FormItem>\n )}\n />\n )) ||\n null\n );\n};\n"],"names":["MyInput","control","name","label","required","className","rules","floatingError","props","jsx","FormField","field","formState","jsxs","FormItem","cn","FormLabel","FormControl","Input","get","event","value","FormMessage"],"mappings":";;;;AAmCO,MAAMA,IAAU,CAAmC;AAAA,EACxD,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC;AAAA,EACA,GAAGC;AACL,MAEKN,KAAQD,KACP,gBAAAQ;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,SAAAT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