@povio/ui 5.0.0-rc.2 → 5.0.0-rc.3
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/.rulesync/rules/ui-buttons-and-content.md +3 -1
- package/README.md +45 -6
- package/dist/{Accordion-CzFKi8Bp.js → Accordion-BzwO4_ml.js} +20 -136
- package/dist/{Alert-T25LY8ZL.js → Alert-CnvEb1D_.js} +16 -12
- package/dist/{Alert-f1dG-4Uy.d.ts → Alert-DfiJbKH0.d.ts} +2 -1
- package/dist/{AlertDialog-B6R2MbNg.d.ts → AlertDialog-OWTbR4km.d.ts} +3 -3
- package/dist/{Autocomplete-CQ63Cynd.d.ts → Autocomplete-BwNHp8fy.d.ts} +1 -1
- package/dist/{Badge-YKlKz-Jy.d.ts → Badge-CBNpj823.d.ts} +8 -5
- package/dist/BadgeButton-Ccgt3oGO.d.ts +15 -0
- package/dist/{BottomSheet-DvqBvth_.js → BottomSheet-BXLE3161.js} +7 -6
- package/dist/{BottomSheet-xaymO7aQ.d.ts → BottomSheet-DbQuzfAB.d.ts} +1 -1
- package/dist/{BottomSheet.lazy-CGBRPve_.d.ts → BottomSheet.lazy-D9LCEo7s.d.ts} +1 -1
- package/dist/{Breadcrumbs-DyriI-Bi.d.ts → Breadcrumbs-CUV6CU8Q.d.ts} +1 -1
- package/dist/{Breadcrumbs-DiIYJAWf.js → Breadcrumbs-CbKzAq1v.js} +24 -38
- package/dist/Button-C5rv4Cr2.js +506 -0
- package/dist/{Button-BZ3is6IU.d.ts → Button-D-4qb0IR.d.ts} +3 -3
- package/dist/{ButtonContent-B2_dZ6vA.js → ButtonContent-c7lJayVQ.js} +10 -8
- package/dist/{Calendar-DzQApBCy.js → Calendar-CVSQH-rC.js} +22 -15
- package/dist/{CheckContent-DZ7Gk8GS.js → CheckContent-D7sZPmzx.js} +2 -2
- package/dist/{Checkbox-BepzfVfK.js → Checkbox-BU0d702K.js} +6 -6
- package/dist/{Checkbox-CHpgW3fI.d.ts → Checkbox-DVTWaMKa.d.ts} +1 -1
- package/dist/{CheckboxCheckmark-B3lnOjsU.js → CheckboxCheckmark-usHsolNj.js} +10 -10
- package/dist/{CheckboxGroup-CXrR3A-c.d.ts → CheckboxGroup-DGF12cmB.d.ts} +3 -3
- package/dist/ComponentGallery-DIFeJqGx.js +2528 -0
- package/dist/{DatePicker-B3l9TEjW.d.ts → DatePicker-8xSs_jNd.d.ts} +3 -3
- package/dist/{DatePicker-CI87jC4_.js → DatePicker-D95gDPhg.js} +12 -11
- package/dist/{DatePickerInput-UBZcTmdv.js → DatePickerInput-CX6NYim4.js} +12 -23
- package/dist/{DatePickerInput-CZTEsrS0.d.ts → DatePickerInput-D81ZJ3fT.d.ts} +3 -3
- package/dist/{DateRangePicker-DKkc2B3n.d.ts → DateRangePicker-Bfq-yDm7.d.ts} +3 -3
- package/dist/{DateRangePicker-BX2O5zA8.js → DateRangePicker-_uTQk_ae.js} +16 -15
- package/dist/{DateTimePicker-CVfkp45w.js → DateTimePicker-BB058Z34.js} +11 -10
- package/dist/{DateTimePicker-IHr-wPq8.d.ts → DateTimePicker-D4lHyf6P.d.ts} +3 -3
- package/dist/{Dialog-DdRP4YFC.js → Dialog-9manOgMA.js} +4 -4
- package/dist/{Dialog-CXoVeIkU.js → Dialog-CKLkS00H.js} +10 -2
- package/dist/{Dialog-DEbI_9S-.d.ts → Dialog-CW93T9X1.d.ts} +3 -2
- package/dist/{DropdownMenu-zrodtd44.js → DropdownMenu-5jmtgLXd.js} +8 -6
- package/dist/{DropdownMenu-CWDhk3XA.d.ts → DropdownMenu-JNpYT4-3.d.ts} +3 -2
- package/dist/{DropdownMenuDesktop-CGYxsavQ.js → DropdownMenuDesktop-Cl9gZVq0.js} +9 -38
- package/dist/{FileInput-Dz1eESr_.js → FileInput-C0-6bw4w.js} +8 -8
- package/dist/{FileInput-BQbn77bE.d.ts → FileInput-C4CE5kuP.d.ts} +5 -4
- package/dist/{FileUpload-qySCMcLn.d.ts → FileUpload-CR7bZxV1.d.ts} +1 -1
- package/dist/{FileUpload-D3Io7Is5.js → FileUpload-DDpYMn8f.js} +51 -139
- package/dist/{FileUploadContainer-qOyGvb5J.d.ts → FileUploadContainer-042ztsaL.d.ts} +1 -1
- package/dist/{Form-u_N_6mwo.d.ts → Form-BJ12MjE-.d.ts} +1 -1
- package/dist/{FormField-B0miX3gu.d.ts → FormField-Byiehm9y.d.ts} +1 -1
- package/dist/{FormField-CHD4OJOt.js → FormField-U_-d4V_g.js} +9 -9
- package/dist/{FormFieldError-QRAFHUTt.js → FormFieldError-DeOHHLo2.js} +1 -1
- package/dist/FormFieldHeaderTooltip-DXbuu88v.js +17 -0
- package/dist/{IconButton-KXecZgYX.d.ts → IconButton-D4thBurp.d.ts} +2 -2
- package/dist/IconSlot-DSK7qNxc.js +79 -0
- package/dist/{InlineIconButton-CbKZ2U_a.d.ts → InlineIconButton-BeJCjl-q.d.ts} +2 -2
- package/dist/{InlineTooltipWrapper-g5yoeH1B.js → InlineTooltipWrapper-Bpmd--e7.js} +3 -3
- package/dist/{Input-efmPwk8f.d.ts → Input-DOanwj3l.d.ts} +3 -3
- package/dist/{InputContent-DuBa9FuI.d.ts → InputContent-CXuP1ghQ.d.ts} +3 -3
- package/dist/{InputItem-2zf6QI5L.js → InputItem-D-KuiNSc.js} +11 -11
- package/dist/{Inputs-C-w03Q_F.d.ts → Inputs-DA73LmLc.d.ts} +1 -1
- package/dist/{Inputs-BceDTmdT.js → Inputs-j3JmcLWR.js} +1 -1
- package/dist/{Link-QYpprkN1.d.ts → Link-Ow9H7kNv.d.ts} +3 -2
- package/dist/{ListBox-B7DW1S7n.js → ListBox-CL8Ar4Q_.js} +5 -4
- package/dist/{MenuItem--Mjd_yK8.d.ts → MenuItem-DHyqOqln.d.ts} +1 -1
- package/dist/{Modal-CoFt5PGP.js → Modal-w60dVQcb.js} +1 -1
- package/dist/{NumberField-z2JatYK0.d.ts → NumberField-Cb9Gf6QJ.d.ts} +3 -3
- package/dist/{NumberRangeInput-Chai3iEi.d.ts → NumberRangeInput-BfbJQqzn.d.ts} +2 -2
- package/dist/{NumberRangeInput-BxVrHq8R.js → NumberRangeInput-C-8U05wF.js} +6 -6
- package/dist/{Pagination-CXtIDclf.d.ts → Pagination-CwQu5Py8.d.ts} +1 -1
- package/dist/{PaginationList-CXG4jWFD.d.ts → PaginationList-DMRUGtf8.d.ts} +1 -1
- package/dist/{PaginationList-0bAmvXC0.js → PaginationList-DtvuP63b.js} +2 -2
- package/dist/{PasswordInput-ub2TQxef.d.ts → PasswordInput-CLwFUgl0.d.ts} +1 -1
- package/dist/{Popover-DUKH0q9u.d.ts → Popover-BTHPteIh.d.ts} +2 -2
- package/dist/{Progress-DQWiFP0L.js → Progress-B3mY9rIP.js} +2 -2
- package/dist/{Progress-Dho39FDs.d.ts → Progress-CjWOR38H.d.ts} +2 -1
- package/dist/{QuerySelect-Bo1K6gi_.d.ts → QuerySelect-BGxb6Y0K.d.ts} +2 -2
- package/dist/{RadioGroup-SSZYch-J.js → RadioGroup-B7_pNwn9.js} +13 -13
- package/dist/{RadioGroup-B_zJdn4y.d.ts → RadioGroup-CZg2kIMk.d.ts} +3 -3
- package/dist/{RichTextEditor-D6RewmRj.js → RichTextEditor-D9-B1Cze.js} +52 -133
- package/dist/{RichTextEditor-B_JX3nor.d.ts → RichTextEditor-YxuRUlI7.d.ts} +1 -1
- package/dist/{Select-CuZDkeQs.js → Select-CkujlTjm.js} +5 -4
- package/dist/{Select-DeapZMYx.d.ts → Select-pHbyJdZJ.d.ts} +1 -1
- package/dist/{SelectBase-7SE9Za2r.d.ts → SelectBase-Omiq2D3M.d.ts} +3 -3
- package/dist/{Slider-DJ9K_a-x.js → Slider-BHPl0OPy.js} +11 -11
- package/dist/{Slider-BFViQmM3.d.ts → Slider-EYlGCLWe.d.ts} +1 -1
- package/dist/{Spinner-BEYBu85B.js → Spinner-BeVTUzzx.js} +1 -1
- package/dist/{Spinner-BbcI6IOb.d.ts → Spinner-DbXeDOa2.d.ts} +2 -1
- package/dist/{SplitButton-lL87EcBL.d.ts → SplitButton-D9ngY1rJ.d.ts} +3 -3
- package/dist/{Stepper-C1YPgTBG.js → Stepper-Cp5vbL5g.js} +4 -117
- package/dist/{Stepper-hlhViuaK.d.ts → Stepper-TATlHZhQ.d.ts} +9 -8
- package/dist/{Switch-JxRmH1dX.js → Switch-CqnGEdeD.js} +11 -11
- package/dist/{Switch-DPftmB1b.d.ts → Switch-s_EPn0Jz.d.ts} +1 -1
- package/dist/Table-BDNSuEWc.js +689 -0
- package/dist/Tag-AHfV_XSf.d.ts +44 -0
- package/dist/{Tag-HiDH438e.js → Tag-DPg5sL1Z.js} +22 -21
- package/dist/{TextArea-gikUKKDl.js → TextArea-DqHDiRGJ.js} +6 -6
- package/dist/{TextArea-BhrCBGbq.d.ts → TextArea-l_keyLK7.d.ts} +2 -2
- package/dist/{TextButton-DnXRykhF.d.ts → TextButton-XUhV_1s0.d.ts} +4 -4
- package/dist/{TimePicker-CmT89X7v.d.ts → TimePicker-B1POvGWs.d.ts} +2 -2
- package/dist/{TimePicker-DtNTOOGr.js → TimePicker-DQ6JCkGB.js} +10 -10
- package/dist/Toast-DtG3pA61.js +53 -0
- package/dist/{Toast-B4cXs2rj.d.ts → Toast-ruXqONDA.d.ts} +1 -1
- package/dist/{ToastContainer-BbsMIwtC.js → ToastContainer-qgpzMFD4.js} +4 -3
- package/dist/{ToggleButton-BGuzPJDO.d.ts → ToggleButton-7aP8Jb11.d.ts} +2 -2
- package/dist/{ToggleGroup-D9CFdM5-.d.ts → ToggleGroup-CRFDIPGZ.d.ts} +1 -1
- package/dist/{ToggleGroup-Cl0NS3fe.js → ToggleGroup-DX0VYXwP.js} +25 -58
- package/dist/{Tooltip-aE1Vswxz.js → Tooltip-B9DKcYvr.js} +6 -47
- package/dist/{Tooltip-D7dNwGy9.d.ts → Tooltip-DHv6vAqW.d.ts} +6 -5
- package/dist/{TooltipWrapper-CRf-JFeo.js → TooltipWrapper-DznDgVJB.js} +4 -4
- package/dist/{Typography-B0Gp1lpc.js → Typography-LU4z2pR1.js} +2 -2
- package/dist/{Typography-BiuidzDC.d.ts → Typography-XljT9s02.d.ts} +1 -1
- package/dist/accordion.cva-CL1bVscW.js +129 -0
- package/dist/{autocomplete-BJ7rqWa4.d.ts → autocomplete-DeERHN8W.d.ts} +2 -2
- package/dist/badgeButton.cva-B2bgCQP6.d.ts +41 -0
- package/dist/badgeButton.cva-CvN4CTx5.js +300 -0
- package/dist/breadcrumbs.cva-7zzdDhVR.js +27 -0
- package/dist/{button.cva-BvRI-3Gn.d.ts → button.cva-C7kEhgoA.d.ts} +7 -6
- package/dist/{buttonContent.cva-BDT_CReI.d.ts → buttonContent.cva-DPIlROA9.d.ts} +2 -2
- package/dist/{checkbox-BfcE8J5P.d.ts → checkbox-DxIPDTK5.d.ts} +1 -1
- package/dist/{checkbox-group-CHs2wFHS.d.ts → checkbox-group-B3BOVshI.d.ts} +1 -1
- package/dist/{checkbox.cva-gv87kr1W.d.ts → checkbox.cva-t1Ox50hy.d.ts} +4 -3
- package/dist/components/accordion.js +1 -1
- package/dist/components/alert-dialog.d.ts +1 -1
- package/dist/components/alert-dialog.js +4 -4
- package/dist/components/alert.d.ts +1 -1
- package/dist/components/alert.js +1 -1
- package/dist/components/autocomplete.d.ts +1 -1
- package/dist/components/autocomplete.js +5 -4
- package/dist/components/badge-button.d.ts +2 -0
- package/dist/components/{pill-button.js → badge-button.js} +13 -12
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/badge.js +56 -37
- package/dist/components/bottom-sheet.d.ts +2 -2
- package/dist/components/bottom-sheet.js +2 -2
- package/dist/components/breadcrumbs.d.ts +1 -1
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/button.d.ts +2 -2
- package/dist/components/button.js +1 -1
- package/dist/components/checkbox-group.d.ts +1 -1
- package/dist/components/checkbox-group.js +6 -6
- package/dist/components/checkbox.d.ts +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/date-picker.d.ts +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/date-range-picker.d.ts +1 -1
- package/dist/components/date-range-picker.js +1 -1
- package/dist/components/date-time-picker.d.ts +1 -1
- package/dist/components/date-time-picker.js +1 -1
- package/dist/components/dialog.d.ts +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer.js +3 -3
- package/dist/components/dropdown-menu.d.ts +2 -2
- package/dist/components/dropdown-menu.js +2 -2
- package/dist/components/file-input.d.ts +1 -1
- package/dist/components/file-input.js +1 -1
- package/dist/components/file-upload-container.d.ts +2 -2
- package/dist/components/file-upload-container.js +1 -1
- package/dist/components/file-upload.d.ts +2 -2
- package/dist/components/file-upload.js +1 -1
- package/dist/components/form-field.d.ts +1 -1
- package/dist/components/form-field.js +1 -1
- package/dist/components/icon-button.d.ts +1 -1
- package/dist/components/icon-button.js +2 -2
- package/dist/components/icon-slot.d.ts +2 -0
- package/dist/components/icon-slot.js +2 -0
- package/dist/components/inline-icon-button.d.ts +1 -1
- package/dist/components/inline-icon-button.js +1 -1
- package/dist/components/input.d.ts +1 -1
- package/dist/components/input.js +7 -7
- package/dist/components/link.d.ts +1 -1
- package/dist/components/link.js +32 -1
- package/dist/components/number-field.d.ts +1 -1
- package/dist/components/number-field.js +7 -7
- package/dist/components/number-range-input.d.ts +1 -1
- package/dist/components/number-range-input.js +1 -1
- package/dist/components/pagination-list.d.ts +1 -1
- package/dist/components/pagination-list.js +1 -1
- package/dist/components/pagination.d.ts +1 -1
- package/dist/components/pagination.js +2 -2
- package/dist/components/password-input.d.ts +1 -1
- package/dist/components/popover.d.ts +1 -1
- package/dist/components/popover.js +6 -5
- package/dist/components/progress.d.ts +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/query-autocomplete.d.ts +2 -2
- package/dist/components/query-autocomplete.js +2 -2
- package/dist/components/query-select.d.ts +1 -1
- package/dist/components/query-select.js +3 -3
- package/dist/components/radio-group.d.ts +1 -1
- package/dist/components/radio-group.js +1 -1
- package/dist/components/select.d.ts +2 -2
- package/dist/components/select.js +1 -1
- package/dist/components/slider.d.ts +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/spinner.d.ts +1 -1
- package/dist/components/spinner.js +1 -1
- package/dist/components/split-button.d.ts +1 -1
- package/dist/components/split-button.js +3 -3
- package/dist/components/stepper.d.ts +1 -1
- package/dist/components/stepper.js +1 -1
- package/dist/components/switch.d.ts +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/tag.d.ts +1 -1
- package/dist/components/tag.js +1 -1
- package/dist/components/text-area.d.ts +1 -1
- package/dist/components/text-area.js +1 -1
- package/dist/components/text-button.d.ts +1 -1
- package/dist/components/text-button.js +1 -1
- package/dist/components/time-picker.d.ts +1 -1
- package/dist/components/time-picker.js +1 -1
- package/dist/components/toast.d.ts +2 -2
- package/dist/components/toast.js +2 -2
- package/dist/components/toggle-button.d.ts +1 -1
- package/dist/components/toggle-button.js +1 -1
- package/dist/components/toggle-group.d.ts +2 -2
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/tooltip-ellipsis.js +1 -1
- package/dist/components/tooltip.d.ts +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/components/typography.d.ts +2 -2
- package/dist/components/typography.js +1 -1
- package/dist/components/use-toast.d.ts +1 -1
- package/dist/components/use-toast.js +2 -2
- package/dist/config/confirmation.d.ts +1 -1
- package/dist/config/link-context.d.ts +2 -2
- package/dist/config/ui-config.d.ts +2 -2
- package/dist/config/ui-config.js +1 -1
- package/dist/config/ui-configurator-theme.d.ts +2 -0
- package/dist/config/ui-configurator-theme.js +2 -0
- package/dist/config/ui-configurator-vite.d.ts +10 -0
- package/dist/config/ui-configurator-vite.js +174 -0
- package/dist/config/ui-configurator.d.ts +934 -0
- package/dist/config/ui-configurator.js +3731 -0
- package/dist/config/ui-overrides.d.ts +1 -1
- package/dist/config/ui-overrides.js +1 -1
- package/dist/{confirmation.context-DPAKsLYl.d.ts → confirmation.context-BOeEVczb.d.ts} +1 -1
- package/dist/{date-picker-BYFWSbN8.d.ts → date-picker-DnxDmlOW.d.ts} +1 -1
- package/dist/{date-range-picker-BaaXOObm.d.ts → date-range-picker-DHDOSvHN.d.ts} +1 -1
- package/dist/{date-time-picker-D42cTCgx.d.ts → date-time-picker-UkTa0OJ8.d.ts} +1 -1
- package/dist/datePickerInput.cva-Cd7UUN61.js +14 -0
- package/dist/{datePickerValue.utils-CFCY-fRJ.js → datePickerValue.utils-CUzkWie8.js} +5 -5
- package/dist/{dialog.cva---xiOXMQ.js → dialog.cva-COhDZaVl.js} +4 -4
- package/dist/{dist-B8h0VT0E.js → dist-CAdwxJbe.js} +1 -208
- package/dist/{dom.utils-DjuRTR6U.js → dom.utils-D1AopHx9.js} +1 -1
- package/dist/dropdownMenu.cva-DvEmX0bs.js +34 -0
- package/dist/{dynamicInputs-wEEikYeg.d.ts → dynamicInputs-iP39lVKf.d.ts} +102 -100
- package/dist/{fieldAdapter-C0lCFmf0.js → fieldAdapter-DjYls12j.js} +1 -1
- package/dist/{file-input-C56GXRwz.d.ts → file-input-DkbkdI7l.d.ts} +1 -1
- package/dist/{file-upload-Bx0X534g.d.ts → file-upload-CTsPhxJk.d.ts} +2 -2
- package/dist/fileUpload.cva-ujmStxB1.js +42 -0
- package/dist/{fileUpload.types-DWuQKA2l.d.ts → fileUpload.types-n5FxK_F-.d.ts} +2 -2
- package/dist/iconSlot.cva-CnpFzAOR.d.ts +21 -0
- package/dist/icons.d.ts +2 -1
- package/dist/icons.js +2 -1
- package/dist/index.d.ts +87 -86
- package/dist/index.js +55 -44
- package/dist/info-iUmX3uDk.js +32 -0
- package/dist/{input-D2kGX0hW.d.ts → input-CdQNCPgH.d.ts} +1 -1
- package/dist/{input.cva-BhDJxc7r.d.ts → input.cva-BsHgYa-L.d.ts} +3 -2
- package/dist/{input.cva-BcXyC1vZ.js → input.cva-DJA8ovm_.js} +9 -9
- package/dist/{link.context-CDZn6oL2.d.ts → link.context-D5qyz9Rf.d.ts} +1 -1
- package/dist/link.cva-DMTHZiJG.js +12 -0
- package/dist/{number-field-Bw2GKr0s.d.ts → number-field-CUDbenNV.d.ts} +1 -1
- package/dist/{number-range-input-Dqe6x2dR.d.ts → number-range-input-DZGrcvjL.d.ts} +1 -1
- package/dist/{password-input-DepKyhh3.d.ts → password-input-fYN20cQO.d.ts} +1 -1
- package/dist/{popover.cva-BJSkLndY.js → popover.cva-Bhud1wnp.js} +1 -1
- package/dist/popoverAnimation-DEZSvKP8.js +4 -0
- package/dist/{query-autocomplete-BSpHin_R.d.ts → query-autocomplete-CfuQeiYG.d.ts} +2 -2
- package/dist/{query-select-m1DCp4UF.d.ts → query-select-CuT_sE6a.d.ts} +2 -2
- package/dist/{queryAutocomplete.types-CrbVUmvl.d.ts → queryAutocomplete.types-tl3r6iaY.d.ts} +2 -2
- package/dist/{radio-group-Civ3Fb70.d.ts → radio-group-B3ccPf0p.d.ts} +1 -1
- package/dist/{radio.cva-BlOrmxzf.d.ts → radio.cva-DN9VQ3Kb.d.ts} +4 -3
- package/dist/rhf/autocomplete.d.ts +2 -2
- package/dist/rhf/autocomplete.js +1 -1
- package/dist/rhf/checkbox-group.d.ts +2 -2
- package/dist/rhf/checkbox-group.js +1 -1
- package/dist/rhf/checkbox.d.ts +2 -2
- package/dist/rhf/checkbox.js +2 -2
- package/dist/rhf/date-picker.d.ts +2 -2
- package/dist/rhf/date-picker.js +2 -2
- package/dist/rhf/date-range-picker.d.ts +2 -2
- package/dist/rhf/date-range-picker.js +2 -2
- package/dist/rhf/date-time-picker.d.ts +2 -2
- package/dist/rhf/date-time-picker.js +2 -2
- package/dist/rhf/file-input.d.ts +2 -2
- package/dist/rhf/file-input.js +2 -2
- package/dist/rhf/file-upload.d.ts +2 -2
- package/dist/rhf/file-upload.js +2 -2
- package/dist/rhf/input.d.ts +2 -2
- package/dist/rhf/input.js +1 -1
- package/dist/rhf/inputs.d.ts +2 -2
- package/dist/rhf/number-field.d.ts +2 -2
- package/dist/rhf/number-field.js +1 -1
- package/dist/rhf/number-range-input.d.ts +2 -2
- package/dist/rhf/number-range-input.js +2 -2
- package/dist/rhf/password-input.d.ts +2 -2
- package/dist/rhf/password-input.js +1 -1
- package/dist/rhf/query-autocomplete.d.ts +1 -1
- package/dist/rhf/query-autocomplete.js +1 -1
- package/dist/rhf/query-select.d.ts +1 -1
- package/dist/rhf/query-select.js +1 -1
- package/dist/rhf/radio-group.d.ts +2 -2
- package/dist/rhf/radio-group.js +2 -2
- package/dist/rhf/rich-text-editor.d.ts +2 -2
- package/dist/rhf/rich-text-editor.js +2 -2
- package/dist/rhf/select.d.ts +2 -2
- package/dist/rhf/select.js +2 -2
- package/dist/rhf/slider.d.ts +2 -2
- package/dist/rhf/slider.js +2 -2
- package/dist/rhf/switch.d.ts +2 -2
- package/dist/rhf/switch.js +2 -2
- package/dist/rhf/text-area.d.ts +2 -2
- package/dist/rhf/text-area.js +2 -2
- package/dist/rhf/time-picker.d.ts +2 -2
- package/dist/rhf/time-picker.js +2 -2
- package/dist/rhf/toggle-group.d.ts +2 -2
- package/dist/rhf/toggle-group.js +2 -2
- package/dist/{rhf-D8B7mLO1.js → rhf-t348TCCL.js} +1 -1
- package/dist/rhf.d.ts +87 -86
- package/dist/rhf.js +55 -44
- package/dist/{rich-text-editor-DvNEOIux.d.ts → rich-text-editor-B-Onl7T8.d.ts} +1 -1
- package/dist/rich-text-editor.d.ts +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/{select-DY5QtwqI.d.ts → select-B4a52eWW.d.ts} +2 -2
- package/dist/selectDesktop.cva-CHAMxhfO.js +69 -0
- package/dist/{slider-CrB-Gkcv.d.ts → slider-dNj9jruO.d.ts} +1 -1
- package/dist/{staticDateTimeSegments-DR8bJw-F.js → staticDateTimeSegments-CsCE9Buo.js} +26 -27
- package/dist/{staticSelect.utils-Cm7MoDVG.js → staticSelect.utils-BemUyaaA.js} +31 -90
- package/dist/stepper.cva-CZ0Kj-s7.js +116 -0
- package/dist/style-merge.util-zLimKwt6.d.ts +40 -0
- package/dist/styles/color-utilities.css +13 -25
- package/dist/styles/configurator.css +1852 -0
- package/dist/styles/input.d.ts +1 -1
- package/dist/{switch-8WzXfTS8.d.ts → switch-C--iWnY8.d.ts} +1 -1
- package/dist/switch.cva-CWNzmdRc.d.ts +16 -0
- package/dist/table.cva-BikE8qJH.js +49 -0
- package/dist/tanstack/autocomplete.d.ts +1 -1
- package/dist/tanstack/checkbox-group.d.ts +1 -1
- package/dist/tanstack/checkbox.d.ts +1 -1
- package/dist/tanstack/checkbox.js +1 -1
- package/dist/tanstack/date-picker.d.ts +1 -1
- package/dist/tanstack/date-picker.js +1 -1
- package/dist/tanstack/date-range-picker.d.ts +1 -1
- package/dist/tanstack/date-range-picker.js +1 -1
- package/dist/tanstack/date-time-picker.d.ts +1 -1
- package/dist/tanstack/date-time-picker.js +1 -1
- package/dist/tanstack/file-input.d.ts +1 -1
- package/dist/tanstack/file-input.js +1 -1
- package/dist/tanstack/file-upload.d.ts +2 -2
- package/dist/tanstack/file-upload.js +1 -1
- package/dist/tanstack/form.d.ts +1 -1
- package/dist/tanstack/form.js +1 -1
- package/dist/tanstack/input.d.ts +1 -1
- package/dist/tanstack/inputs.d.ts +3 -3
- package/dist/tanstack/inputs.js +1 -1
- package/dist/tanstack/number-field.d.ts +1 -1
- package/dist/tanstack/number-range-input.d.ts +1 -1
- package/dist/tanstack/number-range-input.js +1 -1
- package/dist/tanstack/password-input.d.ts +1 -1
- package/dist/tanstack/query-select.d.ts +1 -1
- package/dist/tanstack/radio-group.d.ts +1 -1
- package/dist/tanstack/radio-group.js +1 -1
- package/dist/tanstack/rich-text-editor.d.ts +1 -1
- package/dist/tanstack/rich-text-editor.js +1 -1
- package/dist/tanstack/select.d.ts +1 -1
- package/dist/tanstack/select.js +1 -1
- package/dist/tanstack/slider.d.ts +1 -1
- package/dist/tanstack/slider.js +1 -1
- package/dist/tanstack/switch.d.ts +1 -1
- package/dist/tanstack/switch.js +1 -1
- package/dist/tanstack/table.d.ts +1 -1
- package/dist/tanstack/table.js +2 -1
- package/dist/tanstack/text-area.d.ts +1 -1
- package/dist/tanstack/text-area.js +1 -1
- package/dist/tanstack/time-picker.d.ts +1 -1
- package/dist/tanstack/time-picker.js +1 -1
- package/dist/tanstack/toggle-group.d.ts +2 -2
- package/dist/tanstack/toggle-group.js +1 -1
- package/dist/tanstack.d.ts +71 -70
- package/dist/tanstack.js +66 -53
- package/dist/{text-area-CqnKRWKq.d.ts → text-area-DQAtpOQp.d.ts} +1 -1
- package/dist/theme-model-C-QMCksE.js +136 -0
- package/dist/theme-model-T1zIdBg8.d.ts +12 -0
- package/dist/{time-picker-Cz1GIzpF.d.ts → time-picker-DoGfbil6.d.ts} +1 -1
- package/dist/{toast.cva-Cj6o2Rmu.d.ts → toast.cva-By5lvAfr.d.ts} +3 -2
- package/dist/toast.cva-C_L_RffH.js +163 -0
- package/dist/{toast.runtime-CIKvmkjo.js → toast.runtime-cxex9e4E.js} +2 -1
- package/dist/{toggle-group-CPkKHm1t.d.ts → toggle-group-C1nMDOwz.d.ts} +1 -1
- package/dist/toggleGroup.cva-MbpaEBg1.js +35 -0
- package/dist/{toggleGroup.types-DD6uRI5G.d.ts → toggleGroup.types-Bp43zbSQ.d.ts} +2 -1
- package/dist/tooltip.cva-BIzlOXHH.js +48 -0
- package/dist/{tooltipWrapper.cva-CUu8pI-a.js → tooltipWrapper.cva-BBQ4ic3D.js} +1 -1
- package/dist/{typography.cva-jtp6WWUH.d.ts → typography.cva-D1JOEYl-.d.ts} +2 -1
- package/dist/{typography.cva-CJZZSGXW.js → typography.cva-iD15k56p.js} +1 -1
- package/dist/{uiConfig.context-D2eUIPHn.js → uiConfig.context-BS3r_kTS.js} +1 -1
- package/dist/{uiConfig.context-aoarCLYX.d.ts → uiConfig.context-DeBX2beU.d.ts} +8 -8
- package/dist/{uiOverrides.context-Bfm2n-n8.js → uiOverrides.context-BTCH9y5a.js} +2 -2
- package/dist/{uiOverrides.context-C3xb4Ttq.d.ts → uiOverrides.context-DEp139He.d.ts} +11 -44
- package/dist/underline-66hmELxa.js +81 -0
- package/dist/{useBreakpoint-BOA-MyoT.js → useBreakpoint-DQoMN-BG.js} +1 -1
- package/dist/{useFieldAccessibility-D2_Qm26-.js → useFieldAccessibility-B4MVL6fz.js} +15 -8
- package/dist/{useFormAutosave-BYFn3LH8.js → useFormAutosave-Mg-tdwMh.js} +2 -2
- package/dist/{useStaticInputHandoff-DB9PgioW.js → useStaticInputHandoff-CvSBPUB3.js} +13 -10
- package/dist/useTableColumnConfig-gfVame8v.js +892 -0
- package/dist/{useTableNav-D9mICzNW.d.ts → useTableNav-Ckj5PBRk.d.ts} +3 -2
- package/dist/{useToast-DMSm59Y6.d.ts → useToast-yreVCUer.d.ts} +1 -1
- package/package.json +31 -5
- package/src/configurator/README.md +71 -0
- package/dist/Button-sn52l1Yv.js +0 -506
- package/dist/FormFieldHeaderTooltip-Dl24v4_j.js +0 -45
- package/dist/Link-Btxj2gzg.js +0 -42
- package/dist/PillButton-DASBXLFB.d.ts +0 -15
- package/dist/Tag-Cch_68QO.d.ts +0 -43
- package/dist/components/pill-button.d.ts +0 -2
- package/dist/pillButton.cva-BEWuu0qm.d.ts +0 -34
- package/dist/pillButton.cva-DlP5tOT5.js +0 -197
- package/dist/switch.cva-8T0fw31t.d.ts +0 -15
- package/dist/useTableColumnConfig-CcJxu14U.js +0 -1625
|
@@ -0,0 +1,892 @@
|
|
|
1
|
+
import { t as Table } from "./Table-BDNSuEWc.js";
|
|
2
|
+
import { t as Checkbox } from "./Checkbox-BU0d702K.js";
|
|
3
|
+
import { t as Typography } from "./Typography-LU4z2pR1.js";
|
|
4
|
+
import { t as Spinner } from "./Spinner-BeVTUzzx.js";
|
|
5
|
+
import "./i18n-CX2EjhJI.js";
|
|
6
|
+
import { t as useIntersectionObserver } from "./useIntersectionObserver-DYfHnGGU.js";
|
|
7
|
+
import { t as IntlUtils } from "./intl.utils-zwAFoZ0U.js";
|
|
8
|
+
import { t as DateUtils } from "./date.utils-B8_QF9y6.js";
|
|
9
|
+
import { t as StringUtils } from "./string.utils-BPgv6QwA.js";
|
|
10
|
+
import { t as ZodUtils } from "./zod.utils-DrrPDT9v.js";
|
|
11
|
+
import { t as Dialog } from "./Dialog-9manOgMA.js";
|
|
12
|
+
import { Pagination } from "./components/pagination.js";
|
|
13
|
+
import { t as useTranslationMemo } from "./useTranslationMemo-CrZbeyBv.js";
|
|
14
|
+
import { t as UIRouter } from "./router.context-B0jTMtE0.js";
|
|
15
|
+
import { t as RoutingUtils } from "./routing.utils-UTQonIhB.js";
|
|
16
|
+
import { useEffect, useState } from "react";
|
|
17
|
+
import { c } from "react/compiler-runtime";
|
|
18
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
+
import { useTranslation } from "react-i18next";
|
|
20
|
+
import { z } from "zod";
|
|
21
|
+
import i18next from "i18next";
|
|
22
|
+
//#region src/components/table/ColumnConfig.tsx
|
|
23
|
+
const VisibilityCell = (t0) => {
|
|
24
|
+
const $ = c(7);
|
|
25
|
+
const { original, onToggle } = t0;
|
|
26
|
+
let t1;
|
|
27
|
+
if ($[0] !== onToggle || $[1] !== original.id) {
|
|
28
|
+
t1 = () => onToggle(original.id);
|
|
29
|
+
$[0] = onToggle;
|
|
30
|
+
$[1] = original.id;
|
|
31
|
+
$[2] = t1;
|
|
32
|
+
} else t1 = $[2];
|
|
33
|
+
const t2 = original.label;
|
|
34
|
+
let t3;
|
|
35
|
+
if ($[3] !== original.visible || $[4] !== t1 || $[5] !== t2) {
|
|
36
|
+
t3 = /* @__PURE__ */ jsx(Checkbox, {
|
|
37
|
+
isSelected: original.visible,
|
|
38
|
+
onChange: t1,
|
|
39
|
+
hideLabel: true,
|
|
40
|
+
children: t2
|
|
41
|
+
});
|
|
42
|
+
$[3] = original.visible;
|
|
43
|
+
$[4] = t1;
|
|
44
|
+
$[5] = t2;
|
|
45
|
+
$[6] = t3;
|
|
46
|
+
} else t3 = $[6];
|
|
47
|
+
return t3;
|
|
48
|
+
};
|
|
49
|
+
const getColumns = (t, handleToggleVisibility) => [{
|
|
50
|
+
id: "name",
|
|
51
|
+
header: t(($) => $.ui.table.column, { ns: "ui" }),
|
|
52
|
+
meta: { width: "flex-1" },
|
|
53
|
+
accessorKey: "label"
|
|
54
|
+
}, {
|
|
55
|
+
id: "visible",
|
|
56
|
+
header: t(($) => $.ui.table.show, { ns: "ui" }),
|
|
57
|
+
meta: { width: "w-20" },
|
|
58
|
+
cell: ({ original }) => /* @__PURE__ */ jsx(VisibilityCell, {
|
|
59
|
+
original,
|
|
60
|
+
onToggle: handleToggleVisibility
|
|
61
|
+
})
|
|
62
|
+
}];
|
|
63
|
+
function ColumnConfigModal(t0) {
|
|
64
|
+
const $ = c(27);
|
|
65
|
+
const { isOpen, onClose, configColumns, visibleColumns, onVisibilityChange, onOrderChange } = t0;
|
|
66
|
+
const { t } = useTranslation("ui");
|
|
67
|
+
let t1;
|
|
68
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
69
|
+
t1 = [];
|
|
70
|
+
$[0] = t1;
|
|
71
|
+
} else t1 = $[0];
|
|
72
|
+
const [data, setData] = useState(t1);
|
|
73
|
+
let t2;
|
|
74
|
+
let t3;
|
|
75
|
+
if ($[1] !== configColumns || $[2] !== visibleColumns) {
|
|
76
|
+
t2 = () => {
|
|
77
|
+
setData(configColumns.map((column) => {
|
|
78
|
+
const columnId = column.id ?? column.accessorKey;
|
|
79
|
+
return {
|
|
80
|
+
id: columnId,
|
|
81
|
+
label: column.header,
|
|
82
|
+
visible: visibleColumns?.[columnId] ?? true
|
|
83
|
+
};
|
|
84
|
+
}));
|
|
85
|
+
};
|
|
86
|
+
t3 = [configColumns, visibleColumns];
|
|
87
|
+
$[1] = configColumns;
|
|
88
|
+
$[2] = visibleColumns;
|
|
89
|
+
$[3] = t2;
|
|
90
|
+
$[4] = t3;
|
|
91
|
+
} else {
|
|
92
|
+
t2 = $[3];
|
|
93
|
+
t3 = $[4];
|
|
94
|
+
}
|
|
95
|
+
useEffect(t2, t3);
|
|
96
|
+
let t4;
|
|
97
|
+
if ($[5] !== onVisibilityChange || $[6] !== visibleColumns) {
|
|
98
|
+
t4 = (columnId_0) => {
|
|
99
|
+
const newVisible = {
|
|
100
|
+
...visibleColumns,
|
|
101
|
+
[columnId_0]: !visibleColumns[columnId_0]
|
|
102
|
+
};
|
|
103
|
+
onVisibilityChange(newVisible);
|
|
104
|
+
};
|
|
105
|
+
$[5] = onVisibilityChange;
|
|
106
|
+
$[6] = visibleColumns;
|
|
107
|
+
$[7] = t4;
|
|
108
|
+
} else t4 = $[7];
|
|
109
|
+
const handleToggleVisibility = t4;
|
|
110
|
+
let t5;
|
|
111
|
+
if ($[8] !== handleToggleVisibility) {
|
|
112
|
+
t5 = (translateFn) => getColumns(translateFn, handleToggleVisibility);
|
|
113
|
+
$[8] = handleToggleVisibility;
|
|
114
|
+
$[9] = t5;
|
|
115
|
+
} else t5 = $[9];
|
|
116
|
+
const columns = useTranslationMemo(t5);
|
|
117
|
+
let t6;
|
|
118
|
+
if ($[10] !== onOrderChange) {
|
|
119
|
+
t6 = (reorderedItems) => {
|
|
120
|
+
setData(reorderedItems);
|
|
121
|
+
onOrderChange(reorderedItems.map(_temp$2));
|
|
122
|
+
};
|
|
123
|
+
$[10] = onOrderChange;
|
|
124
|
+
$[11] = t6;
|
|
125
|
+
} else t6 = $[11];
|
|
126
|
+
const handleReorder = t6;
|
|
127
|
+
if (!isOpen) return null;
|
|
128
|
+
let t7;
|
|
129
|
+
if ($[12] !== t) {
|
|
130
|
+
t7 = t(_temp2$2);
|
|
131
|
+
$[12] = t;
|
|
132
|
+
$[13] = t7;
|
|
133
|
+
} else t7 = $[13];
|
|
134
|
+
let t8;
|
|
135
|
+
if ($[14] !== t7) {
|
|
136
|
+
t8 = /* @__PURE__ */ jsx(Typography, {
|
|
137
|
+
as: "h2",
|
|
138
|
+
className: "font-bold",
|
|
139
|
+
size: "lead",
|
|
140
|
+
children: t7
|
|
141
|
+
});
|
|
142
|
+
$[14] = t7;
|
|
143
|
+
$[15] = t8;
|
|
144
|
+
} else t8 = $[15];
|
|
145
|
+
let t9;
|
|
146
|
+
if ($[16] !== columns || $[17] !== data || $[18] !== handleReorder) {
|
|
147
|
+
t9 = /* @__PURE__ */ jsx("div", {
|
|
148
|
+
className: "max-h-96 overflow-y-auto",
|
|
149
|
+
children: /* @__PURE__ */ jsx(Table, {
|
|
150
|
+
items: data,
|
|
151
|
+
columns,
|
|
152
|
+
showCellBorder: true,
|
|
153
|
+
className: "w-full",
|
|
154
|
+
enableDragDrop: true,
|
|
155
|
+
getRowId: _temp3,
|
|
156
|
+
onReorder: handleReorder
|
|
157
|
+
})
|
|
158
|
+
});
|
|
159
|
+
$[16] = columns;
|
|
160
|
+
$[17] = data;
|
|
161
|
+
$[18] = handleReorder;
|
|
162
|
+
$[19] = t9;
|
|
163
|
+
} else t9 = $[19];
|
|
164
|
+
let t10;
|
|
165
|
+
if ($[20] !== t8 || $[21] !== t9) {
|
|
166
|
+
t10 = /* @__PURE__ */ jsxs("div", {
|
|
167
|
+
className: "flex flex-col gap-2 p-4",
|
|
168
|
+
children: [t8, t9]
|
|
169
|
+
});
|
|
170
|
+
$[20] = t8;
|
|
171
|
+
$[21] = t9;
|
|
172
|
+
$[22] = t10;
|
|
173
|
+
} else t10 = $[22];
|
|
174
|
+
let t11;
|
|
175
|
+
if ($[23] !== isOpen || $[24] !== onClose || $[25] !== t10) {
|
|
176
|
+
t11 = /* @__PURE__ */ jsx(Dialog, {
|
|
177
|
+
isOpen,
|
|
178
|
+
onClose,
|
|
179
|
+
showCloseIcon: true,
|
|
180
|
+
children: t10
|
|
181
|
+
});
|
|
182
|
+
$[23] = isOpen;
|
|
183
|
+
$[24] = onClose;
|
|
184
|
+
$[25] = t10;
|
|
185
|
+
$[26] = t11;
|
|
186
|
+
} else t11 = $[26];
|
|
187
|
+
return t11;
|
|
188
|
+
}
|
|
189
|
+
function _temp3(row) {
|
|
190
|
+
return row.id;
|
|
191
|
+
}
|
|
192
|
+
function _temp2$2($) {
|
|
193
|
+
return $.ui.table.configureColumns;
|
|
194
|
+
}
|
|
195
|
+
function _temp$2(item) {
|
|
196
|
+
return item.id;
|
|
197
|
+
}
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region src/components/table/InfiniteTable.tsx
|
|
200
|
+
const InfiniteTable = (t0) => {
|
|
201
|
+
const $ = c(20);
|
|
202
|
+
let fetchNextPage;
|
|
203
|
+
let hasNextPage;
|
|
204
|
+
let rest;
|
|
205
|
+
let t1;
|
|
206
|
+
if ($[0] !== t0) {
|
|
207
|
+
({hasNextPage, isFetchingNextPage: t1, fetchNextPage, ...rest} = t0);
|
|
208
|
+
$[0] = t0;
|
|
209
|
+
$[1] = fetchNextPage;
|
|
210
|
+
$[2] = hasNextPage;
|
|
211
|
+
$[3] = rest;
|
|
212
|
+
$[4] = t1;
|
|
213
|
+
} else {
|
|
214
|
+
fetchNextPage = $[1];
|
|
215
|
+
hasNextPage = $[2];
|
|
216
|
+
rest = $[3];
|
|
217
|
+
t1 = $[4];
|
|
218
|
+
}
|
|
219
|
+
const isFetchingNextPage = t1 === void 0 ? false : t1;
|
|
220
|
+
let t2;
|
|
221
|
+
if ($[5] !== fetchNextPage || $[6] !== hasNextPage || $[7] !== isFetchingNextPage) {
|
|
222
|
+
t2 = () => {
|
|
223
|
+
if (!isFetchingNextPage && hasNextPage) fetchNextPage();
|
|
224
|
+
};
|
|
225
|
+
$[5] = fetchNextPage;
|
|
226
|
+
$[6] = hasNextPage;
|
|
227
|
+
$[7] = isFetchingNextPage;
|
|
228
|
+
$[8] = t2;
|
|
229
|
+
} else t2 = $[8];
|
|
230
|
+
const handleLoadMore = t2;
|
|
231
|
+
let t3;
|
|
232
|
+
if ($[9] !== handleLoadMore) {
|
|
233
|
+
t3 = {
|
|
234
|
+
onIntersection: handleLoadMore,
|
|
235
|
+
rootMargin: "100px"
|
|
236
|
+
};
|
|
237
|
+
$[9] = handleLoadMore;
|
|
238
|
+
$[10] = t3;
|
|
239
|
+
} else t3 = $[10];
|
|
240
|
+
const { ref } = useIntersectionObserver(t3);
|
|
241
|
+
let t4;
|
|
242
|
+
if ($[11] !== rest) {
|
|
243
|
+
t4 = /* @__PURE__ */ jsx(Table, { ...rest });
|
|
244
|
+
$[11] = rest;
|
|
245
|
+
$[12] = t4;
|
|
246
|
+
} else t4 = $[12];
|
|
247
|
+
let t5;
|
|
248
|
+
if ($[13] !== hasNextPage || $[14] !== isFetchingNextPage || $[15] !== ref) {
|
|
249
|
+
t5 = (hasNextPage || isFetchingNextPage) && /* @__PURE__ */ jsx("div", {
|
|
250
|
+
ref,
|
|
251
|
+
className: "flex justify-center py-4",
|
|
252
|
+
children: /* @__PURE__ */ jsx(Spinner, {})
|
|
253
|
+
});
|
|
254
|
+
$[13] = hasNextPage;
|
|
255
|
+
$[14] = isFetchingNextPage;
|
|
256
|
+
$[15] = ref;
|
|
257
|
+
$[16] = t5;
|
|
258
|
+
} else t5 = $[16];
|
|
259
|
+
let t6;
|
|
260
|
+
if ($[17] !== t4 || $[18] !== t5) {
|
|
261
|
+
t6 = /* @__PURE__ */ jsxs("div", {
|
|
262
|
+
className: "flex flex-col",
|
|
263
|
+
children: [t4, t5]
|
|
264
|
+
});
|
|
265
|
+
$[17] = t4;
|
|
266
|
+
$[18] = t5;
|
|
267
|
+
$[19] = t6;
|
|
268
|
+
} else t6 = $[19];
|
|
269
|
+
return t6;
|
|
270
|
+
};
|
|
271
|
+
//#endregion
|
|
272
|
+
//#region src/components/table/PaginatedTable.tsx
|
|
273
|
+
const PaginatedTable = (t0) => {
|
|
274
|
+
const $ = c(24);
|
|
275
|
+
let items;
|
|
276
|
+
let pagination;
|
|
277
|
+
let rest;
|
|
278
|
+
let setPagination;
|
|
279
|
+
let totalItems;
|
|
280
|
+
if ($[0] !== t0) {
|
|
281
|
+
({pagination, setPagination, items, totalItems, ...rest} = t0);
|
|
282
|
+
$[0] = t0;
|
|
283
|
+
$[1] = items;
|
|
284
|
+
$[2] = pagination;
|
|
285
|
+
$[3] = rest;
|
|
286
|
+
$[4] = setPagination;
|
|
287
|
+
$[5] = totalItems;
|
|
288
|
+
} else {
|
|
289
|
+
items = $[1];
|
|
290
|
+
pagination = $[2];
|
|
291
|
+
rest = $[3];
|
|
292
|
+
setPagination = $[4];
|
|
293
|
+
totalItems = $[5];
|
|
294
|
+
}
|
|
295
|
+
let t1;
|
|
296
|
+
if ($[6] !== items) {
|
|
297
|
+
t1 = items ?? [];
|
|
298
|
+
$[6] = items;
|
|
299
|
+
$[7] = t1;
|
|
300
|
+
} else t1 = $[7];
|
|
301
|
+
let t2;
|
|
302
|
+
if ($[8] !== rest || $[9] !== t1) {
|
|
303
|
+
t2 = /* @__PURE__ */ jsx(Table, {
|
|
304
|
+
...rest,
|
|
305
|
+
items: t1
|
|
306
|
+
});
|
|
307
|
+
$[8] = rest;
|
|
308
|
+
$[9] = t1;
|
|
309
|
+
$[10] = t2;
|
|
310
|
+
} else t2 = $[10];
|
|
311
|
+
const t3 = totalItems ?? 0;
|
|
312
|
+
let t4;
|
|
313
|
+
let t5;
|
|
314
|
+
if ($[11] !== pagination || $[12] !== setPagination) {
|
|
315
|
+
t4 = (page) => setPagination({
|
|
316
|
+
...pagination,
|
|
317
|
+
pageIndex: page
|
|
318
|
+
});
|
|
319
|
+
t5 = (pageSize) => setPagination({
|
|
320
|
+
...pagination,
|
|
321
|
+
pageSize,
|
|
322
|
+
pageIndex: 1
|
|
323
|
+
});
|
|
324
|
+
$[11] = pagination;
|
|
325
|
+
$[12] = setPagination;
|
|
326
|
+
$[13] = t4;
|
|
327
|
+
$[14] = t5;
|
|
328
|
+
} else {
|
|
329
|
+
t4 = $[13];
|
|
330
|
+
t5 = $[14];
|
|
331
|
+
}
|
|
332
|
+
let t6;
|
|
333
|
+
if ($[15] !== pagination.pageIndex || $[16] !== pagination.pageSize || $[17] !== t3 || $[18] !== t4 || $[19] !== t5) {
|
|
334
|
+
t6 = /* @__PURE__ */ jsx(Pagination, {
|
|
335
|
+
page: pagination.pageIndex,
|
|
336
|
+
pageSize: pagination.pageSize,
|
|
337
|
+
totalItems: t3,
|
|
338
|
+
onPageChange: t4,
|
|
339
|
+
onPageSizeChange: t5
|
|
340
|
+
});
|
|
341
|
+
$[15] = pagination.pageIndex;
|
|
342
|
+
$[16] = pagination.pageSize;
|
|
343
|
+
$[17] = t3;
|
|
344
|
+
$[18] = t4;
|
|
345
|
+
$[19] = t5;
|
|
346
|
+
$[20] = t6;
|
|
347
|
+
} else t6 = $[20];
|
|
348
|
+
let t7;
|
|
349
|
+
if ($[21] !== t2 || $[22] !== t6) {
|
|
350
|
+
t7 = /* @__PURE__ */ jsxs("div", {
|
|
351
|
+
className: "flex flex-col gap-4",
|
|
352
|
+
children: [t2, t6]
|
|
353
|
+
});
|
|
354
|
+
$[21] = t2;
|
|
355
|
+
$[22] = t6;
|
|
356
|
+
$[23] = t7;
|
|
357
|
+
} else t7 = $[23];
|
|
358
|
+
return t7;
|
|
359
|
+
};
|
|
360
|
+
//#endregion
|
|
361
|
+
//#region src/helpers/dynamicColumns.ts
|
|
362
|
+
const DEFAULT_NAMESPACE = "dynamicColumns";
|
|
363
|
+
const FORMAT_MAP = {
|
|
364
|
+
datetime: (value) => DateUtils.formatDate(new Date(value)),
|
|
365
|
+
dateRange: (value) => {
|
|
366
|
+
return `${DateUtils.formatDate(new Date(value.start))} - ${DateUtils.formatDate(new Date(value.end))}`;
|
|
367
|
+
},
|
|
368
|
+
enum: (value) => StringUtils.capitalize(value),
|
|
369
|
+
number: (value) => IntlUtils.getNumberFormatter(i18next.language).format(value),
|
|
370
|
+
string: (value) => String(value),
|
|
371
|
+
boolean: (value) => {
|
|
372
|
+
const key = `${DEFAULT_NAMESPACE}.${value ? "yes" : "no"}`;
|
|
373
|
+
if (i18next.exists(key)) return String(i18next.t(key));
|
|
374
|
+
return value ? "Yes" : "No";
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
const ZOD_TYPE_FORMAT_MAP = [
|
|
378
|
+
[z.ZodEnum, FORMAT_MAP.enum],
|
|
379
|
+
[z.ZodNumber, FORMAT_MAP.number],
|
|
380
|
+
[z.ZodString, FORMAT_MAP.string],
|
|
381
|
+
[z.ZodBoolean, FORMAT_MAP.boolean],
|
|
382
|
+
[z.ZodISODateTime, FORMAT_MAP.datetime]
|
|
383
|
+
];
|
|
384
|
+
const configValueToColumnDef = (value) => {
|
|
385
|
+
if (typeof value === "function" || typeof value === "string") return { cell: value };
|
|
386
|
+
if (typeof value === "boolean" || value === void 0) return {};
|
|
387
|
+
return value;
|
|
388
|
+
};
|
|
389
|
+
const convertEntriesToColumnDefs = (entries) => {
|
|
390
|
+
return entries.map(([key, value]) => [key, configValueToColumnDef(value)]);
|
|
391
|
+
};
|
|
392
|
+
const customConfigValueToColumnDef = (value) => {
|
|
393
|
+
if (typeof value === "string") return {
|
|
394
|
+
accessorKey: value,
|
|
395
|
+
cell: value
|
|
396
|
+
};
|
|
397
|
+
if (typeof value === "function") return { cell: value };
|
|
398
|
+
return value;
|
|
399
|
+
};
|
|
400
|
+
const convertCustomEntriesToColumnDefs = (entries) => {
|
|
401
|
+
return entries.map(([key, value]) => [key, customConfigValueToColumnDef(value)]);
|
|
402
|
+
};
|
|
403
|
+
const excludeEntries = (entries) => {
|
|
404
|
+
return entries.filter(([, value]) => value !== false && value !== void 0);
|
|
405
|
+
};
|
|
406
|
+
const sortColumns = (columns, orderKeys) => {
|
|
407
|
+
if (!orderKeys) return columns;
|
|
408
|
+
const wildcardIndex = orderKeys.indexOf("*");
|
|
409
|
+
if (wildcardIndex === -1) return columns.sort((columnA, columnB) => {
|
|
410
|
+
const idA = columnA.id;
|
|
411
|
+
const idB = columnB.id;
|
|
412
|
+
const orderMap = new Map(orderKeys.map((key, index) => [String(key), index]));
|
|
413
|
+
const orderA = orderMap.get(String(idA));
|
|
414
|
+
const orderB = orderMap.get(String(idB));
|
|
415
|
+
if (orderA !== void 0 && orderB !== void 0) return orderA - orderB;
|
|
416
|
+
if (orderA !== void 0 && orderB === void 0) return -1;
|
|
417
|
+
if (orderA === void 0 && orderB !== void 0) return 1;
|
|
418
|
+
return 0;
|
|
419
|
+
});
|
|
420
|
+
const beforeWildcard = orderKeys.slice(0, wildcardIndex);
|
|
421
|
+
const afterWildcard = orderKeys.slice(wildcardIndex + 1);
|
|
422
|
+
const beforeMap = new Map(beforeWildcard.map((key, index) => [String(key), index]));
|
|
423
|
+
const afterMap = new Map(afterWildcard.map((key, index) => [String(key), index]));
|
|
424
|
+
const before = [];
|
|
425
|
+
const middle = [];
|
|
426
|
+
const after = [];
|
|
427
|
+
columns.forEach((column) => {
|
|
428
|
+
const id = String(column.id);
|
|
429
|
+
if (beforeMap.has(id)) before.push(column);
|
|
430
|
+
else if (afterMap.has(id)) after.push(column);
|
|
431
|
+
else middle.push(column);
|
|
432
|
+
});
|
|
433
|
+
before.sort((a, b) => beforeMap.get(String(a.id)) - beforeMap.get(String(b.id)));
|
|
434
|
+
after.sort((a, b) => afterMap.get(String(a.id)) - afterMap.get(String(b.id)));
|
|
435
|
+
return [
|
|
436
|
+
...before,
|
|
437
|
+
...middle,
|
|
438
|
+
...after
|
|
439
|
+
];
|
|
440
|
+
};
|
|
441
|
+
const formatValueByType = (value, schemaType) => {
|
|
442
|
+
if (value === null || value === void 0) return null;
|
|
443
|
+
if (ZodUtils.isDateRange(schemaType)) return FORMAT_MAP.dateRange(value);
|
|
444
|
+
const unwrappedType = ZodUtils.unwrapZodType(schemaType);
|
|
445
|
+
if (unwrappedType instanceof z.ZodArray) {
|
|
446
|
+
if (!Array.isArray(value)) return null;
|
|
447
|
+
const elementType = unwrappedType.element;
|
|
448
|
+
return value.map((element) => formatValueByType(element, elementType)).join(", ");
|
|
449
|
+
}
|
|
450
|
+
const formatFunction = ZOD_TYPE_FORMAT_MAP.find(([zodType]) => unwrappedType instanceof zodType)?.[1];
|
|
451
|
+
if (formatFunction) return formatFunction(value);
|
|
452
|
+
return String(value);
|
|
453
|
+
};
|
|
454
|
+
const getNestedValue = (obj, path) => {
|
|
455
|
+
return path.split(".").reduce((current, key) => {
|
|
456
|
+
return current && typeof current === "object" ? current[key] : void 0;
|
|
457
|
+
}, obj);
|
|
458
|
+
};
|
|
459
|
+
const getKeyType = (schema, key) => {
|
|
460
|
+
const pathParts = key.split(".");
|
|
461
|
+
let currentType = schema.shape[pathParts[0]];
|
|
462
|
+
for (let i = 1; i < pathParts.length; i++) if (currentType instanceof z.ZodObject) currentType = currentType.shape[pathParts[i]];
|
|
463
|
+
else {
|
|
464
|
+
currentType = schema.shape[key];
|
|
465
|
+
break;
|
|
466
|
+
}
|
|
467
|
+
return currentType;
|
|
468
|
+
};
|
|
469
|
+
const getCellFunction = (schema, schemaKey, columnDef, options) => {
|
|
470
|
+
const { cell } = columnDef;
|
|
471
|
+
if (typeof cell === "function") return cell;
|
|
472
|
+
return ({ data }) => {
|
|
473
|
+
const key = typeof cell === "string" ? cell : schemaKey;
|
|
474
|
+
const value = getNestedValue(data, key);
|
|
475
|
+
const keyType = getKeyType(schema, key);
|
|
476
|
+
let finalValue = !options.disableFormatting?.includes(key) ? formatValueByType(value, keyType) : value;
|
|
477
|
+
if (options.emptyValue && !finalValue) finalValue = options.emptyValue;
|
|
478
|
+
if (options.globalWrapper) return options.globalWrapper(finalValue);
|
|
479
|
+
return finalValue;
|
|
480
|
+
};
|
|
481
|
+
};
|
|
482
|
+
const normalizeSortable = (sortable) => {
|
|
483
|
+
if (!sortable) return;
|
|
484
|
+
if (Array.isArray(sortable)) return sortable;
|
|
485
|
+
if (sortable instanceof z.ZodEnum) return Object.values(sortable.enum);
|
|
486
|
+
};
|
|
487
|
+
const getDefaultColumnHeader = (key, options) => {
|
|
488
|
+
const localeKey = `${options.namespace ?? DEFAULT_NAMESPACE}.${key}`;
|
|
489
|
+
if (i18next.exists(localeKey)) return String(i18next.t(localeKey));
|
|
490
|
+
return StringUtils.capitalize(key);
|
|
491
|
+
};
|
|
492
|
+
const overridePresetColumnsHeaders = (presetColumns, options) => {
|
|
493
|
+
const namespace = options.namespace ?? DEFAULT_NAMESPACE;
|
|
494
|
+
return presetColumns.map((columnDef) => {
|
|
495
|
+
const localeKey = `${namespace}.${columnDef.id}`;
|
|
496
|
+
const header = i18next.exists(localeKey) ? i18next.t(localeKey) : columnDef.header;
|
|
497
|
+
return {
|
|
498
|
+
...columnDef,
|
|
499
|
+
header: typeof header === "string" ? header : columnDef.header
|
|
500
|
+
};
|
|
501
|
+
});
|
|
502
|
+
};
|
|
503
|
+
const populateColumnDef = (schema, key, columnDef, options, sortableKeys) => {
|
|
504
|
+
const id = columnDef.id ?? key;
|
|
505
|
+
const enableSorting = columnDef.enableSorting ?? sortableKeys?.includes(id) ?? false;
|
|
506
|
+
const header = columnDef.header ?? getDefaultColumnHeader(key, options);
|
|
507
|
+
const cell = getCellFunction(schema, key, columnDef, options);
|
|
508
|
+
return {
|
|
509
|
+
...columnDef,
|
|
510
|
+
id,
|
|
511
|
+
accessorKey: key,
|
|
512
|
+
meta: {
|
|
513
|
+
width: "flex-1",
|
|
514
|
+
...options.globalMeta,
|
|
515
|
+
...columnDef.meta
|
|
516
|
+
},
|
|
517
|
+
header,
|
|
518
|
+
enableSorting,
|
|
519
|
+
cell
|
|
520
|
+
};
|
|
521
|
+
};
|
|
522
|
+
const populateCustomColumnDef = (schema, key, columnDef, options, sortableKeys) => {
|
|
523
|
+
const id = columnDef.id ?? key;
|
|
524
|
+
const accessorKey = columnDef.accessorKey ?? id;
|
|
525
|
+
const enableSorting = columnDef.enableSorting ?? sortableKeys?.includes(id) ?? false;
|
|
526
|
+
const header = columnDef.header ?? getDefaultColumnHeader(key, options);
|
|
527
|
+
const cell = getCellFunction(schema, key, columnDef, options);
|
|
528
|
+
return {
|
|
529
|
+
...columnDef,
|
|
530
|
+
id,
|
|
531
|
+
accessorKey,
|
|
532
|
+
meta: {
|
|
533
|
+
width: "flex-1",
|
|
534
|
+
...options.globalMeta,
|
|
535
|
+
...columnDef.meta
|
|
536
|
+
},
|
|
537
|
+
header,
|
|
538
|
+
enableSorting,
|
|
539
|
+
cell
|
|
540
|
+
};
|
|
541
|
+
};
|
|
542
|
+
const addMissingSchemaFields = (schema, existingColumns, options, sortableKeys) => {
|
|
543
|
+
const schemaFields = getAllSchemaKeys(schema);
|
|
544
|
+
const definedFields = new Set(existingColumns.map((col) => col.id));
|
|
545
|
+
const additionalColumns = schemaFields.filter((field) => !definedFields.has(field)).map((field) => {
|
|
546
|
+
return populateColumnDef(schema, field, {}, options, sortableKeys);
|
|
547
|
+
});
|
|
548
|
+
return [...existingColumns, ...additionalColumns];
|
|
549
|
+
};
|
|
550
|
+
const removeOverriddenPresetColumns = (presetColumns, options) => {
|
|
551
|
+
if (presetColumns.length === 0) return presetColumns;
|
|
552
|
+
const usedColumnsIds = Object.entries(options.columns ?? {}).map(([key, value]) => {
|
|
553
|
+
return value.id ?? key;
|
|
554
|
+
});
|
|
555
|
+
const usedCustomColumnsIds = Object.entries(options.customColumns ?? {}).map(([key, value]) => {
|
|
556
|
+
return value.id ?? key;
|
|
557
|
+
});
|
|
558
|
+
const usedIds = /* @__PURE__ */ new Set([...usedColumnsIds, ...usedCustomColumnsIds]);
|
|
559
|
+
return presetColumns.filter((column) => {
|
|
560
|
+
if (!column.id) return true;
|
|
561
|
+
return !usedIds.has(column.id);
|
|
562
|
+
});
|
|
563
|
+
};
|
|
564
|
+
const getAllSchemaKeys = (schema) => {
|
|
565
|
+
const keys = [];
|
|
566
|
+
const { shape } = schema;
|
|
567
|
+
const traverse = (obj, prefix = "") => {
|
|
568
|
+
Object.entries(obj).forEach(([key, value]) => {
|
|
569
|
+
const currentPath = prefix ? `${prefix}.${key}` : key;
|
|
570
|
+
keys.push(currentPath);
|
|
571
|
+
if (value instanceof z.ZodObject) traverse(value.shape, currentPath);
|
|
572
|
+
});
|
|
573
|
+
};
|
|
574
|
+
traverse(shape);
|
|
575
|
+
return keys;
|
|
576
|
+
};
|
|
577
|
+
const validateCustomColumnKeys = (schema, customColumnKeys) => {
|
|
578
|
+
const schemaKeys = getAllSchemaKeys(schema);
|
|
579
|
+
const invalidCustomColumnKeys = customColumnKeys.filter((key) => schemaKeys.includes(key));
|
|
580
|
+
if (invalidCustomColumnKeys.length > 0) throw new Error(`Invalid custom column keys: [${invalidCustomColumnKeys.join(", ")}]. Custom column keys cannot be part of the schema. Define these columns in the "columns" property instead.`);
|
|
581
|
+
};
|
|
582
|
+
const validateOptionKeyArray = (usedKeys, optionKeys, optionName) => {
|
|
583
|
+
if (!optionKeys) return;
|
|
584
|
+
const extraUnusedKeys = optionKeys.filter((key) => !usedKeys.has(key));
|
|
585
|
+
if (extraUnusedKeys.length > 0) throw new Error(`Found unnecessary keys in "${optionName}": [${extraUnusedKeys.join(", ")}].\n\nAll available options are: [${Array.from(usedKeys).join(", ")}].`);
|
|
586
|
+
};
|
|
587
|
+
const validateParams = (schema, presetColumns, options) => {
|
|
588
|
+
const { columns, customColumns, sortable, order, disableFormatting, includeAll } = options;
|
|
589
|
+
const columnKeys = Object.keys(columns ?? {});
|
|
590
|
+
const customColumnKeys = customColumns ? Object.keys(customColumns) : [];
|
|
591
|
+
const usedKeys = /* @__PURE__ */ new Set([...columnKeys, ...customColumnKeys]);
|
|
592
|
+
const presetKeys = presetColumns.map((column) => column.id).filter((id) => id !== void 0);
|
|
593
|
+
const schemaKeys = includeAll ? getAllSchemaKeys(schema) : [];
|
|
594
|
+
const allKeys = /* @__PURE__ */ new Set([
|
|
595
|
+
...presetKeys,
|
|
596
|
+
...usedKeys,
|
|
597
|
+
...schemaKeys,
|
|
598
|
+
"*"
|
|
599
|
+
]);
|
|
600
|
+
if (customColumns) validateCustomColumnKeys(schema, customColumnKeys);
|
|
601
|
+
if (Array.isArray(sortable)) validateOptionKeyArray(usedKeys, sortable, "sortable");
|
|
602
|
+
validateOptionKeyArray(allKeys, order, "order");
|
|
603
|
+
validateOptionKeyArray(usedKeys, disableFormatting, "disableFormatting");
|
|
604
|
+
};
|
|
605
|
+
const dynamicColumns = ({ schema, preset = [], options }) => {
|
|
606
|
+
validateParams(schema, preset, options);
|
|
607
|
+
const sortableKeys = normalizeSortable(options.sortable);
|
|
608
|
+
let entries = Object.entries(options.columns ?? {});
|
|
609
|
+
entries = excludeEntries(entries);
|
|
610
|
+
entries = convertEntriesToColumnDefs(entries);
|
|
611
|
+
const columns = entries.map(([key, value]) => {
|
|
612
|
+
return populateColumnDef(schema, key, value, options, sortableKeys);
|
|
613
|
+
});
|
|
614
|
+
let customEntries = Object.entries(options.customColumns ?? {});
|
|
615
|
+
customEntries = convertCustomEntriesToColumnDefs(customEntries);
|
|
616
|
+
const customColumns = customEntries.map(([key, value]) => {
|
|
617
|
+
return populateCustomColumnDef(schema, key, value, options, sortableKeys);
|
|
618
|
+
});
|
|
619
|
+
let presetColumns = removeOverriddenPresetColumns(preset, options);
|
|
620
|
+
if (options.overridePresetLocales) presetColumns = overridePresetColumnsHeaders(presetColumns, options);
|
|
621
|
+
const mergedColumns = [
|
|
622
|
+
...presetColumns,
|
|
623
|
+
...columns,
|
|
624
|
+
...customColumns
|
|
625
|
+
];
|
|
626
|
+
const allColumns = options.includeAll ? addMissingSchemaFields(schema, mergedColumns, options, sortableKeys) : mergedColumns;
|
|
627
|
+
return sortColumns(allColumns, options.order);
|
|
628
|
+
};
|
|
629
|
+
//#endregion
|
|
630
|
+
//#region src/hooks/usePagination.ts
|
|
631
|
+
const DEFAULT_STATE = {
|
|
632
|
+
pageIndex: 1,
|
|
633
|
+
pageSize: 20
|
|
634
|
+
};
|
|
635
|
+
function usePagination(defaultPagination) {
|
|
636
|
+
const $ = c(12);
|
|
637
|
+
const { replace, searchParams } = UIRouter.useUIRouter();
|
|
638
|
+
let t0;
|
|
639
|
+
if ($[0] !== defaultPagination || $[1] !== searchParams) {
|
|
640
|
+
t0 = defaultPagination ?? {
|
|
641
|
+
pageIndex: searchParams.has("page") ? Number.parseInt(searchParams.get("page") ?? "", 10) : DEFAULT_STATE.pageIndex,
|
|
642
|
+
pageSize: searchParams.has("size") ? Number.parseInt(searchParams.get("size") ?? "", 10) : DEFAULT_STATE.pageSize
|
|
643
|
+
};
|
|
644
|
+
$[0] = defaultPagination;
|
|
645
|
+
$[1] = searchParams;
|
|
646
|
+
$[2] = t0;
|
|
647
|
+
} else t0 = $[2];
|
|
648
|
+
const [pagination, setPagination] = useState(t0);
|
|
649
|
+
let t1;
|
|
650
|
+
if ($[3] !== pagination.pageIndex || $[4] !== pagination.pageSize || $[5] !== replace || $[6] !== searchParams) {
|
|
651
|
+
t1 = () => {
|
|
652
|
+
const params = new URLSearchParams(searchParams);
|
|
653
|
+
params.delete("size");
|
|
654
|
+
params.delete("page");
|
|
655
|
+
if (pagination.pageSize !== DEFAULT_STATE.pageSize) params.set("size", pagination.pageSize.toString());
|
|
656
|
+
if (pagination.pageIndex !== DEFAULT_STATE.pageIndex) params.set("page", pagination.pageIndex.toString());
|
|
657
|
+
if (params.toString() === searchParams.toString()) return;
|
|
658
|
+
replace(".", RoutingUtils.toRouterSearch(params));
|
|
659
|
+
};
|
|
660
|
+
$[3] = pagination.pageIndex;
|
|
661
|
+
$[4] = pagination.pageSize;
|
|
662
|
+
$[5] = replace;
|
|
663
|
+
$[6] = searchParams;
|
|
664
|
+
$[7] = t1;
|
|
665
|
+
} else t1 = $[7];
|
|
666
|
+
let t2;
|
|
667
|
+
if ($[8] !== pagination) {
|
|
668
|
+
t2 = [pagination];
|
|
669
|
+
$[8] = pagination;
|
|
670
|
+
$[9] = t2;
|
|
671
|
+
} else t2 = $[9];
|
|
672
|
+
useEffect(t1, t2);
|
|
673
|
+
let t3;
|
|
674
|
+
if ($[10] !== pagination) {
|
|
675
|
+
t3 = {
|
|
676
|
+
pagination,
|
|
677
|
+
setPagination,
|
|
678
|
+
pageIndex: pagination.pageIndex,
|
|
679
|
+
pageSize: pagination.pageSize
|
|
680
|
+
};
|
|
681
|
+
$[10] = pagination;
|
|
682
|
+
$[11] = t3;
|
|
683
|
+
} else t3 = $[11];
|
|
684
|
+
return t3;
|
|
685
|
+
}
|
|
686
|
+
//#endregion
|
|
687
|
+
//#region src/hooks/useSorting.ts
|
|
688
|
+
function useSorting(defaultSorting, t0) {
|
|
689
|
+
const $ = c(16);
|
|
690
|
+
const prefix = t0 === void 0 ? "" : t0;
|
|
691
|
+
const { replace, searchParams } = UIRouter.useUIRouter();
|
|
692
|
+
let t1;
|
|
693
|
+
if ($[0] !== defaultSorting || $[1] !== prefix || $[2] !== searchParams) {
|
|
694
|
+
t1 = defaultSorting ?? searchParams.get(`order${prefix && `-${prefix}`}`)?.split(",").map(_temp$1) ?? [];
|
|
695
|
+
$[0] = defaultSorting;
|
|
696
|
+
$[1] = prefix;
|
|
697
|
+
$[2] = searchParams;
|
|
698
|
+
$[3] = t1;
|
|
699
|
+
} else t1 = $[3];
|
|
700
|
+
const [sorting, setSorting] = useState(t1);
|
|
701
|
+
let t2;
|
|
702
|
+
if ($[4] !== sorting) {
|
|
703
|
+
t2 = sorting.map(_temp2$1).join(",");
|
|
704
|
+
$[4] = sorting;
|
|
705
|
+
$[5] = t2;
|
|
706
|
+
} else t2 = $[5];
|
|
707
|
+
const order = t2;
|
|
708
|
+
let t3;
|
|
709
|
+
if ($[6] !== order || $[7] !== prefix || $[8] !== replace || $[9] !== searchParams) {
|
|
710
|
+
t3 = () => {
|
|
711
|
+
const params = new URLSearchParams(searchParams);
|
|
712
|
+
const orderKey = prefix ? `order-${prefix}` : "order";
|
|
713
|
+
params.delete(orderKey);
|
|
714
|
+
if (order) params.set(orderKey, order);
|
|
715
|
+
if (params.toString() === searchParams.toString()) return;
|
|
716
|
+
replace(".", RoutingUtils.toRouterSearch(params));
|
|
717
|
+
};
|
|
718
|
+
$[6] = order;
|
|
719
|
+
$[7] = prefix;
|
|
720
|
+
$[8] = replace;
|
|
721
|
+
$[9] = searchParams;
|
|
722
|
+
$[10] = t3;
|
|
723
|
+
} else t3 = $[10];
|
|
724
|
+
let t4;
|
|
725
|
+
if ($[11] !== order) {
|
|
726
|
+
t4 = [order];
|
|
727
|
+
$[11] = order;
|
|
728
|
+
$[12] = t4;
|
|
729
|
+
} else t4 = $[12];
|
|
730
|
+
useEffect(t3, t4);
|
|
731
|
+
let t5;
|
|
732
|
+
if ($[13] !== order || $[14] !== sorting) {
|
|
733
|
+
t5 = {
|
|
734
|
+
sorting,
|
|
735
|
+
setSorting,
|
|
736
|
+
order
|
|
737
|
+
};
|
|
738
|
+
$[13] = order;
|
|
739
|
+
$[14] = sorting;
|
|
740
|
+
$[15] = t5;
|
|
741
|
+
} else t5 = $[15];
|
|
742
|
+
return t5;
|
|
743
|
+
}
|
|
744
|
+
function _temp2$1(field) {
|
|
745
|
+
return `${field.desc ? "-" : "+"}${field.id}`;
|
|
746
|
+
}
|
|
747
|
+
function _temp$1(item) {
|
|
748
|
+
if (item.startsWith("-")) return {
|
|
749
|
+
id: item.slice(1),
|
|
750
|
+
desc: true
|
|
751
|
+
};
|
|
752
|
+
if (item.startsWith("+")) return {
|
|
753
|
+
id: item.slice(1),
|
|
754
|
+
desc: false
|
|
755
|
+
};
|
|
756
|
+
return {
|
|
757
|
+
id: item,
|
|
758
|
+
desc: false
|
|
759
|
+
};
|
|
760
|
+
}
|
|
761
|
+
//#endregion
|
|
762
|
+
//#region src/hooks/useTableColumnConfig.ts
|
|
763
|
+
function sortByKeyOrder(data, orderedKeys = []) {
|
|
764
|
+
return [...data].sort((a, b) => {
|
|
765
|
+
return orderedKeys.findIndex((key) => key === (a.id ?? a.accessorKey)) - orderedKeys.findIndex((key) => key === (b.id ?? b.accessorKey));
|
|
766
|
+
});
|
|
767
|
+
}
|
|
768
|
+
function useTableColumnConfig(defaultColumns, t0) {
|
|
769
|
+
const $ = c(31);
|
|
770
|
+
let t1;
|
|
771
|
+
if ($[0] !== t0) {
|
|
772
|
+
t1 = t0 === void 0 ? {} : t0;
|
|
773
|
+
$[0] = t0;
|
|
774
|
+
$[1] = t1;
|
|
775
|
+
} else t1 = $[1];
|
|
776
|
+
const options = t1;
|
|
777
|
+
let t2;
|
|
778
|
+
if ($[2] !== defaultColumns) {
|
|
779
|
+
t2 = () => defaultColumns.reduce(_temp, {});
|
|
780
|
+
$[2] = defaultColumns;
|
|
781
|
+
$[3] = t2;
|
|
782
|
+
} else t2 = $[3];
|
|
783
|
+
const [internalVisibleColumns, setInternalVisibleColumns] = useState(t2);
|
|
784
|
+
let t3;
|
|
785
|
+
if ($[4] !== defaultColumns) {
|
|
786
|
+
t3 = () => defaultColumns.map(_temp2);
|
|
787
|
+
$[4] = defaultColumns;
|
|
788
|
+
$[5] = t3;
|
|
789
|
+
} else t3 = $[5];
|
|
790
|
+
const [internalColumnOrder, setInternalColumnOrder] = useState(t3);
|
|
791
|
+
let t4;
|
|
792
|
+
let t5;
|
|
793
|
+
if ($[6] !== options.visibleColumns) {
|
|
794
|
+
t4 = () => {
|
|
795
|
+
if (options.visibleColumns) setInternalVisibleColumns(options.visibleColumns);
|
|
796
|
+
};
|
|
797
|
+
t5 = [options.visibleColumns];
|
|
798
|
+
$[6] = options.visibleColumns;
|
|
799
|
+
$[7] = t4;
|
|
800
|
+
$[8] = t5;
|
|
801
|
+
} else {
|
|
802
|
+
t4 = $[7];
|
|
803
|
+
t5 = $[8];
|
|
804
|
+
}
|
|
805
|
+
useEffect(t4, t5);
|
|
806
|
+
let t6;
|
|
807
|
+
let t7;
|
|
808
|
+
if ($[9] !== options.columnOrder) {
|
|
809
|
+
t6 = () => {
|
|
810
|
+
if (options.columnOrder) setInternalColumnOrder(options.columnOrder);
|
|
811
|
+
};
|
|
812
|
+
t7 = [options.columnOrder];
|
|
813
|
+
$[9] = options.columnOrder;
|
|
814
|
+
$[10] = t6;
|
|
815
|
+
$[11] = t7;
|
|
816
|
+
} else {
|
|
817
|
+
t6 = $[10];
|
|
818
|
+
t7 = $[11];
|
|
819
|
+
}
|
|
820
|
+
useEffect(t6, t7);
|
|
821
|
+
let t8;
|
|
822
|
+
if ($[12] !== options) {
|
|
823
|
+
t8 = (value) => {
|
|
824
|
+
setInternalVisibleColumns(value);
|
|
825
|
+
options?.onVisibilityChange?.(value);
|
|
826
|
+
};
|
|
827
|
+
$[12] = options;
|
|
828
|
+
$[13] = t8;
|
|
829
|
+
} else t8 = $[13];
|
|
830
|
+
const handleVisibilityChange = t8;
|
|
831
|
+
let t9;
|
|
832
|
+
if ($[14] !== options) {
|
|
833
|
+
t9 = (value_0) => {
|
|
834
|
+
setInternalColumnOrder(value_0);
|
|
835
|
+
options?.onOrderChange?.(value_0);
|
|
836
|
+
};
|
|
837
|
+
$[14] = options;
|
|
838
|
+
$[15] = t9;
|
|
839
|
+
} else t9 = $[15];
|
|
840
|
+
const handleOrderChange = t9;
|
|
841
|
+
let t10;
|
|
842
|
+
if ($[16] !== defaultColumns || $[17] !== internalColumnOrder) {
|
|
843
|
+
t10 = sortByKeyOrder(defaultColumns, internalColumnOrder);
|
|
844
|
+
$[16] = defaultColumns;
|
|
845
|
+
$[17] = internalColumnOrder;
|
|
846
|
+
$[18] = t10;
|
|
847
|
+
} else t10 = $[18];
|
|
848
|
+
const configColumns = t10;
|
|
849
|
+
let t11;
|
|
850
|
+
if ($[19] !== configColumns || $[20] !== internalVisibleColumns) {
|
|
851
|
+
let t12;
|
|
852
|
+
if ($[22] !== internalVisibleColumns) {
|
|
853
|
+
t12 = (col_1) => internalVisibleColumns?.[col_1.id ?? col_1.accessorKey] ?? true;
|
|
854
|
+
$[22] = internalVisibleColumns;
|
|
855
|
+
$[23] = t12;
|
|
856
|
+
} else t12 = $[23];
|
|
857
|
+
t11 = configColumns.filter(t12);
|
|
858
|
+
$[19] = configColumns;
|
|
859
|
+
$[20] = internalVisibleColumns;
|
|
860
|
+
$[21] = t11;
|
|
861
|
+
} else t11 = $[21];
|
|
862
|
+
const columns = t11;
|
|
863
|
+
let t12;
|
|
864
|
+
if ($[24] !== columns || $[25] !== configColumns || $[26] !== handleOrderChange || $[27] !== handleVisibilityChange || $[28] !== internalColumnOrder || $[29] !== internalVisibleColumns) {
|
|
865
|
+
t12 = {
|
|
866
|
+
configColumns,
|
|
867
|
+
columns,
|
|
868
|
+
visibleColumns: internalVisibleColumns,
|
|
869
|
+
columnOrder: internalColumnOrder,
|
|
870
|
+
onVisibilityChange: handleVisibilityChange,
|
|
871
|
+
onOrderChange: handleOrderChange
|
|
872
|
+
};
|
|
873
|
+
$[24] = columns;
|
|
874
|
+
$[25] = configColumns;
|
|
875
|
+
$[26] = handleOrderChange;
|
|
876
|
+
$[27] = handleVisibilityChange;
|
|
877
|
+
$[28] = internalColumnOrder;
|
|
878
|
+
$[29] = internalVisibleColumns;
|
|
879
|
+
$[30] = t12;
|
|
880
|
+
} else t12 = $[30];
|
|
881
|
+
return t12;
|
|
882
|
+
}
|
|
883
|
+
function _temp2(col_0) {
|
|
884
|
+
return col_0.id ?? col_0.accessorKey;
|
|
885
|
+
}
|
|
886
|
+
function _temp(acc, col) {
|
|
887
|
+
const key = col.id ?? col.accessorKey;
|
|
888
|
+
acc[key] = true;
|
|
889
|
+
return acc;
|
|
890
|
+
}
|
|
891
|
+
//#endregion
|
|
892
|
+
export { PaginatedTable as a, dynamicColumns as i, useSorting as n, InfiniteTable as o, usePagination as r, ColumnConfigModal as s, useTableColumnConfig as t };
|