@servicetitan/anvil2 1.48.0 → 1.49.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/CHANGELOG.md +42 -0
- package/dist/{Alert-Cz_w_cw0.js → Alert-aGBkujwE.js} +4 -4
- package/dist/{Alert-Cz_w_cw0.js.map → Alert-aGBkujwE.js.map} +1 -1
- package/dist/Alert.js +1 -1
- package/dist/{Announcement-C1xSJkl0.js → Announcement-BPwFNhYe.js} +4 -4
- package/dist/{Announcement-C1xSJkl0.js.map → Announcement-BPwFNhYe.js.map} +1 -1
- package/dist/Announcement.js +1 -1
- package/dist/{AnvilProvider-DDo8ZcIA.js → AnvilProvider-DBYMPYAO.js} +3 -3
- package/dist/{AnvilProvider-DDo8ZcIA.js.map → AnvilProvider-DBYMPYAO.js.map} +1 -1
- package/dist/AnvilProvider.js +1 -1
- package/dist/{Avatar-VQrimv28.js → Avatar-DeEV-v-b.js} +2 -2
- package/dist/{Avatar-VQrimv28.js.map → Avatar-DeEV-v-b.js.map} +1 -1
- package/dist/{Avatar-Bbwk2MCy.js → Avatar-gtxslf5v.js} +2 -2
- package/dist/{Avatar-Bbwk2MCy.js.map → Avatar-gtxslf5v.js.map} +1 -1
- package/dist/Avatar.js +2 -2
- package/dist/{Badge-DOnID5l5.js → Badge-DY5xJkqi.js} +2 -2
- package/dist/{Badge-DOnID5l5.js.map → Badge-DY5xJkqi.js.map} +1 -1
- package/dist/Badge.js +1 -1
- package/dist/{Breadcrumbs-DKqd8VRz.js → Breadcrumbs-DjR-2OEH.js} +5 -5
- package/dist/{Breadcrumbs-DKqd8VRz.js.map → Breadcrumbs-DjR-2OEH.js.map} +1 -1
- package/dist/Breadcrumbs.js +1 -1
- package/dist/{Button-DzcOa6iJ.js → Button-92_FKAyV.js} +3 -3
- package/dist/{Button-DzcOa6iJ.js.map → Button-92_FKAyV.js.map} +1 -1
- package/dist/Button.js +1 -1
- package/dist/{ButtonCompound-Dvr3Fres.js → ButtonCompound-COdSELhh.js} +2 -2
- package/dist/{ButtonCompound-Dvr3Fres.js.map → ButtonCompound-COdSELhh.js.map} +1 -1
- package/dist/ButtonCompound.js +1 -1
- package/dist/{ButtonLink-DGIRpyK6.js → ButtonLink-C0zR7Wnb.js} +3 -3
- package/dist/{ButtonLink-DGIRpyK6.js.map → ButtonLink-C0zR7Wnb.js.map} +1 -1
- package/dist/ButtonLink.js +1 -1
- package/dist/{ButtonToggle-Dv6VAm4W.js → ButtonToggle--sKvhBoA.js} +3 -3
- package/dist/{ButtonToggle-Dv6VAm4W.js.map → ButtonToggle--sKvhBoA.js.map} +1 -1
- package/dist/ButtonToggle.js +1 -1
- package/dist/{Calendar-Bv7N3SoB.js → Calendar-1MhJ03iy.js} +2 -2
- package/dist/{Calendar-Bv7N3SoB.js.map → Calendar-1MhJ03iy.js.map} +1 -1
- package/dist/{Calendar-BWETPlKE.js → Calendar-B7ypKGUn.js} +5 -5
- package/dist/{Calendar-BWETPlKE.js.map → Calendar-B7ypKGUn.js.map} +1 -1
- package/dist/Calendar.js +2 -2
- package/dist/{Card-Cyoz-LaD.js → Card-Ch3sMUo5.js} +2 -2
- package/dist/{Card-Cyoz-LaD.js.map → Card-Ch3sMUo5.js.map} +1 -1
- package/dist/Card.js +1 -1
- package/dist/{Checkbox-Bsa1FgoI.js → Checkbox-Bhjj-jM4.js} +5 -5
- package/dist/{Checkbox-Bsa1FgoI.js.map → Checkbox-Bhjj-jM4.js.map} +1 -1
- package/dist/{Checkbox-BJnt8TFk.js → Checkbox-C5Qjq_tU.js} +2 -2
- package/dist/{Checkbox-BJnt8TFk.js.map → Checkbox-C5Qjq_tU.js.map} +1 -1
- package/dist/Checkbox.js +2 -2
- package/dist/{Chip-BGa1Inb8.js → Chip-X2EwdZ97.js} +4 -4
- package/dist/{Chip-BGa1Inb8.js.map → Chip-X2EwdZ97.js.map} +1 -1
- package/dist/Chip.js +1 -1
- package/dist/{Combobox-BfqKpX1v.js → Combobox-C4COM7BZ.js} +13 -13
- package/dist/{Combobox-BfqKpX1v.js.map → Combobox-C4COM7BZ.js.map} +1 -1
- package/dist/Combobox.js +1 -1
- package/dist/{DataTable-BHI2ONJ-.js → DataTable-BkNCMaVu.js} +307 -133
- package/dist/DataTable-BkNCMaVu.js.map +1 -0
- package/dist/DataTable.css +86 -83
- package/dist/{DateField-HeK2wOzu.js → DateField-C5rA3USK.js} +6 -6
- package/dist/{DateField-HeK2wOzu.js.map → DateField-C5rA3USK.js.map} +1 -1
- package/dist/DateField.js +1 -1
- package/dist/{DateFieldRange-GNPGcfcD.js → DateFieldRange-BLfEH-oC.js} +7 -7
- package/dist/{DateFieldRange-GNPGcfcD.js.map → DateFieldRange-BLfEH-oC.js.map} +1 -1
- package/dist/DateFieldRange.js +1 -1
- package/dist/{DateFieldSingle-CvKdVIqR.js → DateFieldSingle-7Cx_FMtb.js} +7 -7
- package/dist/{DateFieldSingle-CvKdVIqR.js.map → DateFieldSingle-7Cx_FMtb.js.map} +1 -1
- package/dist/DateFieldSingle.js +1 -1
- package/dist/DateFieldYearless-D2uo-uqE.js +132 -0
- package/dist/DateFieldYearless-D2uo-uqE.js.map +1 -0
- package/dist/DateFieldYearless.js +1 -1
- package/dist/DateFieldYearlessRange-BivGidsU.js +178 -0
- package/dist/DateFieldYearlessRange-BivGidsU.js.map +1 -0
- package/dist/DateFieldYearlessRange.css +36 -0
- package/dist/DateFieldYearlessRange.d.ts +2 -0
- package/dist/DateFieldYearlessRange.js +2 -0
- package/dist/DateFieldYearlessRange.js.map +1 -0
- package/dist/{DaysOfTheWeek-BJErLzD2.js → DaysOfTheWeek-Dn6zHxpt.js} +9 -8
- package/dist/DaysOfTheWeek-Dn6zHxpt.js.map +1 -0
- package/dist/DaysOfTheWeek.js +1 -1
- package/dist/{Details-Bg7QzlOm.js → Details-CkaKTRvc.js} +3 -3
- package/dist/{Details-Bg7QzlOm.js.map → Details-CkaKTRvc.js.map} +1 -1
- package/dist/Details.js +1 -1
- package/dist/{Dialog-fJClGTI6.js → Dialog-CxH4Vnbb.js} +4 -4
- package/dist/{Dialog-fJClGTI6.js.map → Dialog-CxH4Vnbb.js.map} +1 -1
- package/dist/Dialog.js +1 -1
- package/dist/{Divider-DYZFKug1.js → Divider-Olv8yWXD.js} +2 -2
- package/dist/{Divider-DYZFKug1.js.map → Divider-Olv8yWXD.js.map} +1 -1
- package/dist/Divider.js +1 -1
- package/dist/Dnd.js +1 -1
- package/dist/DndSort.js +5 -5
- package/dist/{Drawer-DyHDRTR-.js → Drawer-BLfDJU-e.js} +4 -4
- package/dist/{Drawer-DyHDRTR-.js.map → Drawer-BLfDJU-e.js.map} +1 -1
- package/dist/Drawer.js +1 -1
- package/dist/{EditCard-LdyduHqX.js → EditCard-Ds1UXJIS.js} +6 -6
- package/dist/{EditCard-LdyduHqX.js.map → EditCard-Ds1UXJIS.js.map} +1 -1
- package/dist/EditCard.js +1 -1
- package/dist/{FieldLabel-DIlzcPIQ.js → FieldLabel-CHMCV9wX.js} +38 -19
- package/dist/FieldLabel-CHMCV9wX.js.map +1 -0
- package/dist/FieldLabel.css +22 -7
- package/dist/FieldLabel.js +1 -1
- package/dist/{FieldMessage-BbARBii0.js → FieldMessage-DWONT3dr.js} +2 -2
- package/dist/{FieldMessage-BbARBii0.js.map → FieldMessage-DWONT3dr.js.map} +1 -1
- package/dist/FieldMessage.js +1 -1
- package/dist/{Flex-GLF5XRJg.js → Flex-CjPHUTeq.js} +2 -2
- package/dist/{Flex-GLF5XRJg.js.map → Flex-CjPHUTeq.js.map} +1 -1
- package/dist/Flex.js +1 -1
- package/dist/{Grid-BpAt2zA7.js → Grid-DW2cAuHi.js} +2 -2
- package/dist/{Grid-BpAt2zA7.js.map → Grid-DW2cAuHi.js.map} +1 -1
- package/dist/Grid.js +1 -1
- package/dist/{Helper-DHoKHqxV.js → Helper-DjWotFtO.js} +2 -2
- package/dist/{Helper-DHoKHqxV.js.map → Helper-DjWotFtO.js.map} +1 -1
- package/dist/{Icon-TcJbUdTz.js → Icon-BSuTVNaa.js} +2 -2
- package/dist/{Icon-TcJbUdTz.js.map → Icon-BSuTVNaa.js.map} +1 -1
- package/dist/Icon.js +1 -1
- package/dist/{InputMask-BOkWmhsv.js → InputMask-fS5nqXdI.js} +2 -2
- package/dist/{InputMask-BOkWmhsv.js.map → InputMask-fS5nqXdI.js.map} +1 -1
- package/dist/InputMask.js +1 -1
- package/dist/{Link-Br_AJ7Af.js → Link-DuYh7Xl2.js} +3 -3
- package/dist/{Link-Br_AJ7Af.js.map → Link-DuYh7Xl2.js.map} +1 -1
- package/dist/Link.js +1 -1
- package/dist/{LinkButton-CwiVzaro.js → LinkButton-pIUNATNE.js} +2 -2
- package/dist/{LinkButton-CwiVzaro.js.map → LinkButton-pIUNATNE.js.map} +1 -1
- package/dist/LinkButton.js +1 -1
- package/dist/{ListView-kfwvU4Z-.js → ListView-CZ5T8bR1.js} +6 -4
- package/dist/ListView-CZ5T8bR1.js.map +1 -0
- package/dist/ListView.js +1 -1
- package/dist/{Listbox-gtZ2Ao_I.js → Listbox-C-n4IVVj.js} +5 -5
- package/dist/{Listbox-gtZ2Ao_I.js.map → Listbox-C-n4IVVj.js.map} +1 -1
- package/dist/Listbox.js +1 -1
- package/dist/{LocalizationProvider-Cqattc3O.js → LocalizationProvider-u6xdKCBi.js} +2 -2
- package/dist/{LocalizationProvider-Cqattc3O.js.map → LocalizationProvider-u6xdKCBi.js.map} +1 -1
- package/dist/LocalizationProvider.js +1 -1
- package/dist/{Menu-CBbUK_sX.js → Menu-DUAfSImY.js} +4 -4
- package/dist/{Menu-CBbUK_sX.js.map → Menu-DUAfSImY.js.map} +1 -1
- package/dist/Menu.js +1 -1
- package/dist/{NumberField-CjvsSokL.js → NumberField-C62E56_v.js} +10 -9
- package/dist/{NumberField-CjvsSokL.js.map → NumberField-C62E56_v.js.map} +1 -1
- package/dist/NumberField.js +1 -1
- package/dist/Overflow.js +2 -3
- package/dist/Overflow.js.map +1 -1
- package/dist/{Page-4VdFrCjy.js → Page-CGZQ-nsg.js} +15 -15
- package/dist/Page-CGZQ-nsg.js.map +1 -0
- package/dist/Page.js +1 -1
- package/dist/{Pagination-p734If5z.js → Pagination-BHEEnNas.js} +8 -7
- package/dist/{Pagination-p734If5z.js.map → Pagination-BHEEnNas.js.map} +1 -1
- package/dist/Pagination.js +1 -1
- package/dist/{Popover--c9PXAVi.js → Popover-CIPg_ZgX.js} +5 -4
- package/dist/Popover-CIPg_ZgX.js.map +1 -0
- package/dist/Popover.js +1 -1
- package/dist/{ProgressBar-CXMuhBQV.js → ProgressBar-CUpF9fFW.js} +6 -6
- package/dist/{ProgressBar-CXMuhBQV.js.map → ProgressBar-CUpF9fFW.js.map} +1 -1
- package/dist/ProgressBar.js +1 -1
- package/dist/{Radio-CLaDEpuU.js → Radio-CyCFna1X.js} +2 -2
- package/dist/{Radio-CLaDEpuU.js.map → Radio-CyCFna1X.js.map} +1 -1
- package/dist/Radio.js +2 -2
- package/dist/{RadioGroup-DMJqrF4q.js → RadioGroup-DRS2EjVH.js} +6 -6
- package/dist/RadioGroup-DRS2EjVH.js.map +1 -0
- package/dist/{SearchField-DLqva3o3.js → SearchField-DrgNbG3I.js} +3 -3
- package/dist/{SearchField-DLqva3o3.js.map → SearchField-DrgNbG3I.js.map} +1 -1
- package/dist/SearchField.js +1 -1
- package/dist/{SegmentedControl-1OzOQmCp.js → SegmentedControl-C-QOwO7q.js} +2 -2
- package/dist/{SegmentedControl-1OzOQmCp.js.map → SegmentedControl-C-QOwO7q.js.map} +1 -1
- package/dist/SegmentedControl.js +1 -1
- package/dist/{SelectCard-BORQF-zC.js → SelectCard-lBcnP5j5.js} +4 -4
- package/dist/{SelectCard-BORQF-zC.js.map → SelectCard-lBcnP5j5.js.map} +1 -1
- package/dist/SelectCard.js +1 -1
- package/dist/{SelectTrigger-BQNqyG3M.js → SelectTrigger-qvoGCkb1.js} +5 -5
- package/dist/{SelectTrigger-BQNqyG3M.js.map → SelectTrigger-qvoGCkb1.js.map} +1 -1
- package/dist/SelectTrigger.js +1 -1
- package/dist/{SelectTriggerBase-B-fxog4U.js → SelectTriggerBase-C4gebtca.js} +6 -6
- package/dist/{SelectTriggerBase-B-fxog4U.js.map → SelectTriggerBase-C4gebtca.js.map} +1 -1
- package/dist/{SideNav-COiPAIph.js → SideNav-B1sH17Uc.js} +3 -3
- package/dist/{SideNav-COiPAIph.js.map → SideNav-B1sH17Uc.js.map} +1 -1
- package/dist/SideNav.js +1 -1
- package/dist/Skeleton.js +1 -1
- package/dist/{Stepper-xcgOQzru.js → Stepper-B0U_YrbZ.js} +4 -4
- package/dist/{Stepper-xcgOQzru.js.map → Stepper-B0U_YrbZ.js.map} +1 -1
- package/dist/Stepper.js +1 -1
- package/dist/{Switch-mhyHJeex.js → Switch-DjL2CsQi.js} +5 -5
- package/dist/{Switch-mhyHJeex.js.map → Switch-DjL2CsQi.js.map} +1 -1
- package/dist/Switch.js +1 -1
- package/dist/{Tab-BISlFW_i.js → Tab-6UavokJJ.js} +3 -3
- package/dist/{Tab-BISlFW_i.js.map → Tab-6UavokJJ.js.map} +1 -1
- package/dist/Tab.js +1 -1
- package/dist/Table.js +1 -1
- package/dist/{Text-CDzLZl1O.js → Text-kPA-VzsB.js} +2 -2
- package/dist/{Text-CDzLZl1O.js.map → Text-kPA-VzsB.js.map} +1 -1
- package/dist/Text.js +1 -1
- package/dist/{TextField-3szrbqNi.js → TextField-DOSwy_gm.js} +2 -2
- package/dist/{TextField-3szrbqNi.js.map → TextField-DOSwy_gm.js.map} +1 -1
- package/dist/{TextField-DmddoTnj.js → TextField-DcyjojNg.js} +7 -6
- package/dist/TextField-DcyjojNg.js.map +1 -0
- package/dist/TextField.js +1 -1
- package/dist/{Textarea-CJG9i528.js → Textarea-DacevzmW.js} +7 -6
- package/dist/{Textarea-CJG9i528.js.map → Textarea-DacevzmW.js.map} +1 -1
- package/dist/Textarea.js +1 -1
- package/dist/{ThemeProvider-CUiXHn4p.js → ThemeProvider-Bmsz__5N.js} +2 -2
- package/dist/{ThemeProvider-CUiXHn4p.js.map → ThemeProvider-Bmsz__5N.js.map} +1 -1
- package/dist/ThemeProvider.js +1 -1
- package/dist/{TimeField-BfxAImzQ.js → TimeField-C4s8fjDG.js} +7 -7
- package/dist/{TimeField-BfxAImzQ.js.map → TimeField-C4s8fjDG.js.map} +1 -1
- package/dist/TimeField.js +1 -1
- package/dist/Toast.js +2 -2
- package/dist/{Toaster-C6iB4h0P.js → Toaster-BxbR-XcR.js} +2 -2
- package/dist/{Toaster-C6iB4h0P.js.map → Toaster-BxbR-XcR.js.map} +1 -1
- package/dist/{Toaster-D72xHdfH.js → Toaster-Dg7M4W4U.js} +4 -4
- package/dist/{Toaster-D72xHdfH.js.map → Toaster-Dg7M4W4U.js.map} +1 -1
- package/dist/{Toolbar-hhk9ZQ9l.js → Toolbar-BvFwcXOk.js} +20 -20
- package/dist/{Toolbar-hhk9ZQ9l.js.map → Toolbar-BvFwcXOk.js.map} +1 -1
- package/dist/Toolbar.js +1 -1
- package/dist/{Tooltip-BOfdwyTv.js → Tooltip-CZsoFe6C.js} +2 -2
- package/dist/{Tooltip-BOfdwyTv.js.map → Tooltip-CZsoFe6C.js.map} +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/YearlessDateInputWithPicker-MHLlAdrH.js +949 -0
- package/dist/YearlessDateInputWithPicker-MHLlAdrH.js.map +1 -0
- package/dist/YearlessDateInputWithPicker.css +199 -0
- package/dist/anvil-fonts.css +30 -0
- package/dist/beta/components/Table/DataTable/DataTable.d.ts +25 -4
- package/dist/beta/components/Table/DataTable/DataTable.test-data.d.ts +1 -0
- package/dist/beta/components/Table/DataTable/internal/DataTableContext.d.ts +1 -2
- package/dist/beta/components/Table/DataTable/internal/DataTablePagination.d.ts +3 -0
- package/dist/beta/components/Table/DataTable/internal/useAsyncData.d.ts +5 -0
- package/dist/beta/components/Table/DataTable/internal/useDataTableContext.d.ts +4 -0
- package/dist/beta/components/Table/DataTable/stories/DataTable.story-data.d.ts +1 -0
- package/dist/beta/components/Table/DataTable/types.d.ts +43 -0
- package/dist/beta/components/Table/createColumnHelper.d.ts +1 -2
- package/dist/beta/components/Table/index.d.ts +1 -0
- package/dist/beta.js +4 -4
- package/dist/components/DateFieldYearless/DateFieldYearless.d.ts +57 -3
- package/dist/components/DateFieldYearless/internal/PickerList.d.ts +61 -0
- package/dist/components/DateFieldYearless/internal/PickerListOption.d.ts +61 -0
- package/dist/components/DateFieldYearless/internal/YearlessDateInput.d.ts +51 -0
- package/dist/components/DateFieldYearless/internal/YearlessDateInputWithPicker.d.ts +134 -0
- package/dist/components/DateFieldYearless/internal/YearlessDateSelectionPopover.d.ts +27 -0
- package/dist/components/DateFieldYearless/internal/maskito/yearlessDatePlaceholderMask.d.ts +3 -1
- package/dist/components/DateFieldYearless/internal/maskito/yearlessDateSegmentsStepping.d.ts +12 -0
- package/dist/components/DateFieldYearless/internal/utils.d.ts +50 -1
- package/dist/components/DateFieldYearlessRange/DateFieldYearlessRange.d.ts +59 -0
- package/dist/components/DateFieldYearlessRange/index.d.ts +1 -0
- package/dist/components/FieldLabel/FieldLabel.d.ts +9 -48
- package/dist/components/FieldLabel/internal/FieldLabelMoreInfoIcon.d.ts +3 -1
- package/dist/components/Popover/Popover.d.ts +1 -0
- package/dist/components/Popover/PopoverContent.d.ts +8 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/{index-CUVkL0hr.js → index-B25zeBIC.js} +3 -3
- package/dist/{index-CUVkL0hr.js.map → index-B25zeBIC.js.map} +1 -1
- package/dist/{index.esm-BwMVvxTV.js → index.esm-C2ZhC_8d.js} +2 -2
- package/dist/{index.esm-BwMVvxTV.js.map → index.esm-C2ZhC_8d.js.map} +1 -1
- package/dist/index.js +70 -68
- package/dist/index.js.map +1 -1
- package/dist/index2.css +0 -30
- package/dist/{useLayoutPropsUtil-C7FVYB8F.js → useLayoutPropsUtil-BlIWftBb.js} +2 -2
- package/dist/{useLayoutPropsUtil-C7FVYB8F.js.map → useLayoutPropsUtil-BlIWftBb.js.map} +1 -1
- package/dist/{utils-ComsNTho.js → utils-B8bmyfFR.js} +2 -2
- package/dist/{utils-ComsNTho.js.map → utils-B8bmyfFR.js.map} +1 -1
- package/package.json +4 -3
- package/dist/DataTable-BHI2ONJ-.js.map +0 -1
- package/dist/DateFieldYearless-B801SnxH.js +0 -266
- package/dist/DateFieldYearless-B801SnxH.js.map +0 -1
- package/dist/DaysOfTheWeek-BJErLzD2.js.map +0 -1
- package/dist/FieldLabel-DIlzcPIQ.js.map +0 -1
- package/dist/ListView-kfwvU4Z-.js.map +0 -1
- package/dist/Page-4VdFrCjy.js.map +0 -1
- package/dist/Popover--c9PXAVi.js.map +0 -1
- package/dist/RadioGroup-DMJqrF4q.js.map +0 -1
- package/dist/TextField-DmddoTnj.js.map +0 -1
- package/dist/components/DateFieldYearless/internal/MaskedYearlessDateInput.d.ts +0 -35
|
@@ -2,6 +2,7 @@ import { ComponentPropsWithoutRef } from 'react';
|
|
|
2
2
|
import { LayoutUtilProps } from '../../../../types';
|
|
3
3
|
import { ColumnDef, CustomTableFooterCellProps, TableRow } from '../types';
|
|
4
4
|
import { TableContainerProps } from '../base/TableContainer';
|
|
5
|
+
import { DataTablePaginationConfig } from './types';
|
|
5
6
|
/**
|
|
6
7
|
* Represents a sorted column configuration for DataTable
|
|
7
8
|
*/
|
|
@@ -21,10 +22,6 @@ export type SortedColumn = {
|
|
|
21
22
|
* @extends ComponentPropsWithoutRef<"div">
|
|
22
23
|
*/
|
|
23
24
|
export type DataTableProps<T> = LayoutUtilProps & ComponentPropsWithoutRef<"div"> & {
|
|
24
|
-
/**
|
|
25
|
-
* The data for the table. Must be an array of objects with an `id` property.
|
|
26
|
-
*/
|
|
27
|
-
data: TableRow<T>[];
|
|
28
25
|
/**
|
|
29
26
|
* The columns for the table, created with the `createColumnHelper` factory function.
|
|
30
27
|
*/
|
|
@@ -38,6 +35,10 @@ export type DataTableProps<T> = LayoutUtilProps & ComponentPropsWithoutRef<"div"
|
|
|
38
35
|
* The custom footer content for the table. Will be overridden by the footer content of the columns.
|
|
39
36
|
*/
|
|
40
37
|
customFooter?: CustomTableFooterCellProps[][];
|
|
38
|
+
/**
|
|
39
|
+
* The data for the table. Must be an array of objects with an `id` property.
|
|
40
|
+
*/
|
|
41
|
+
data?: TableRow<T>[] | Promise<TableRow<T>[]>;
|
|
41
42
|
/**
|
|
42
43
|
* The default expanded row ids. Can be "all" to expand all rows, or an array of row ids to expand specific rows.
|
|
43
44
|
*/
|
|
@@ -71,6 +72,12 @@ export type DataTableProps<T> = LayoutUtilProps & ComponentPropsWithoutRef<"div"
|
|
|
71
72
|
* Called when the column sorting state changes. Passes the sorted column.
|
|
72
73
|
*/
|
|
73
74
|
onSort?: (sortedColumn: SortedColumn | undefined) => void;
|
|
75
|
+
/**
|
|
76
|
+
* Pagination configuration. When provided, enables pagination and filters data to show only the current page.
|
|
77
|
+
* When `true`, the default pagination configuration is used.
|
|
78
|
+
* When `false` or `undefined`, no pagination is applied and all data is shown.
|
|
79
|
+
*/
|
|
80
|
+
pagination?: boolean | DataTablePaginationConfig<T>;
|
|
74
81
|
/**
|
|
75
82
|
* The selected row ids.
|
|
76
83
|
*/
|
|
@@ -94,6 +101,7 @@ export type DataTableProps<T> = LayoutUtilProps & ComponentPropsWithoutRef<"div"
|
|
|
94
101
|
* - Row sub-component
|
|
95
102
|
* - Row sub-rows
|
|
96
103
|
* - Default and Strong backgrounds
|
|
104
|
+
* - Pagination support with configurable items per page
|
|
97
105
|
*
|
|
98
106
|
* @param props - The props for the DataTable component
|
|
99
107
|
* @param props.data - The data for the table. Must be an array of objects with an `id` property.
|
|
@@ -108,9 +116,22 @@ export type DataTableProps<T> = LayoutUtilProps & ComponentPropsWithoutRef<"div"
|
|
|
108
116
|
* @param props.onSelectRow - Called when the row selection state changes. Passes the selected row ids.
|
|
109
117
|
* @param props.onSort - Called when the column sorting state changes. Passes the sorted column.
|
|
110
118
|
* @param props.onExpandRow - Called when the row expansion state changes. Passes the expanded row ids.
|
|
119
|
+
* @param props.pagination - Pagination configuration. When provided, enables pagination and filters data to show only the current page. When undefined, all data is shown and no pagination controls are rendered.
|
|
111
120
|
* @param props.selectedRowIds - The selected row ids.
|
|
112
121
|
* @param props.sortedColumn - The sorted column.
|
|
113
122
|
* @param props.style - The style of the table container.
|
|
114
123
|
* @param props.rest - The rest of the props for the DataTable component, spread to the div surrounding the table.
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* <DataTable
|
|
127
|
+
* data={tableData}
|
|
128
|
+
* columns={columns}
|
|
129
|
+
* pagination={{
|
|
130
|
+
* itemsPerPage: 25,
|
|
131
|
+
* defaultPageIndex: 0,
|
|
132
|
+
* onPageChange: (pageIndex) => console.log('Page changed to:', pageIndex),
|
|
133
|
+
* showCount: true,
|
|
134
|
+
* }}
|
|
135
|
+
* />
|
|
115
136
|
*/
|
|
116
137
|
export declare function DataTable<T>(props: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,6 +7,7 @@ export type TableStoryData = {
|
|
|
7
7
|
status?: Status[];
|
|
8
8
|
};
|
|
9
9
|
export declare const data: TableRow<TableStoryData>[];
|
|
10
|
+
export declare const longData: TableRow<TableStoryData>[];
|
|
10
11
|
export declare const dataWithEmptyCells: TableRow<TableStoryData>[];
|
|
11
12
|
export declare const dataWithSubRow: TableRow<TableStoryData>[];
|
|
12
13
|
export declare const dataWithSubComponent: TableRow<TableStoryData>[];
|
|
@@ -3,7 +3,7 @@ import { RegisterCellProps } from '../../internal/focus-management/useFocusManag
|
|
|
3
3
|
/**
|
|
4
4
|
* The context type for the table
|
|
5
5
|
*/
|
|
6
|
-
interface DataTableContextType {
|
|
6
|
+
export interface DataTableContextType {
|
|
7
7
|
hoveredColumnId: string | null;
|
|
8
8
|
setHoveredColumnId: (columnId: string | null) => void;
|
|
9
9
|
isOffGridInteractionOccurring: boolean;
|
|
@@ -23,4 +23,3 @@ interface DataTableContextType {
|
|
|
23
23
|
* The context for the table context provider
|
|
24
24
|
*/
|
|
25
25
|
export declare const DataTableContext: import('react').Context<DataTableContextType | undefined>;
|
|
26
|
-
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PaginationProps } from '../../../../..';
|
|
2
|
+
export type DataTablePaginationProps = Pick<PaginationProps, "page" | "itemsPerPage" | "totalItemCount" | "showCount" | "onPageChange">;
|
|
3
|
+
export declare const DataTablePagination: ({ showCount, ...props }: DataTablePaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -15,6 +15,7 @@ export declare const expandedRowData: TableRow<TableStoryData>[];
|
|
|
15
15
|
export declare const subComponentsData: TableRow<TableStoryData>[];
|
|
16
16
|
export declare const primaryColumns: import('../..').ColumnDef<TableStoryData>[];
|
|
17
17
|
export declare const groupedColumns: import('../..').ColumnDef<TableStoryData>[];
|
|
18
|
+
export declare const columnsWithoutFooter: import('../..').ColumnDef<TableStoryData>[];
|
|
18
19
|
export type Category = "electronics" | "clothing" | "home" | "garden" | "other";
|
|
19
20
|
export type EditableTableStoryData = {
|
|
20
21
|
id: string;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { TableRow } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for pagination in DataTable
|
|
4
|
+
*/
|
|
5
|
+
export type DataTablePaginationConfig<T> = {
|
|
6
|
+
/**
|
|
7
|
+
* Number of rows displayed per page
|
|
8
|
+
* @default 25
|
|
9
|
+
*/
|
|
10
|
+
rowsPerPage?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Current page index (0-based)
|
|
13
|
+
*/
|
|
14
|
+
currentPageIndex?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Function to get the data for the current page. When used, the data displayed will be
|
|
17
|
+
* fully controlled by the implementor. This is useful for server-side pagination scenarios where
|
|
18
|
+
* the total number of rows may differ from the data array length.
|
|
19
|
+
*/
|
|
20
|
+
loadPageData?: ({ pageIndex, pageSize, }: {
|
|
21
|
+
pageIndex: number;
|
|
22
|
+
pageSize: number;
|
|
23
|
+
}) => TableRow<T>[] | Promise<TableRow<T>[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Default page index for uncontrolled mode (0-based)
|
|
26
|
+
* @default 0
|
|
27
|
+
*/
|
|
28
|
+
defaultPageIndex?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Callback when page changes. Receives the new page index (0-based)
|
|
31
|
+
*/
|
|
32
|
+
onPageChange?: (pageIndex: number) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Whether to display the item count information in pagination
|
|
35
|
+
* @default true
|
|
36
|
+
*/
|
|
37
|
+
showCount?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Total number of rows across all pages. Falls back to data.length if not provided.
|
|
40
|
+
* Useful for server-side pagination scenarios where totalRowCount may differ from data array length.
|
|
41
|
+
*/
|
|
42
|
+
totalRowCount?: number;
|
|
43
|
+
};
|
|
@@ -4,7 +4,7 @@ import { ColumnDef } from './types';
|
|
|
4
4
|
* Utility type that allows a value to be either the original type or,
|
|
5
5
|
* if it's an array, one of the elements in the array
|
|
6
6
|
*/
|
|
7
|
-
type ValueOrElement<V> = V extends (infer U)[] ? V | U : V;
|
|
7
|
+
export type ValueOrElement<V> = V extends (infer U)[] ? V | U : V;
|
|
8
8
|
/**
|
|
9
9
|
* Factory function to create column helper function for defining Table columns
|
|
10
10
|
*
|
|
@@ -22,4 +22,3 @@ export declare function createColumnHelper<T>(): <K extends keyof T>(id: K | {
|
|
|
22
22
|
label: string;
|
|
23
23
|
}[];
|
|
24
24
|
}) => ColumnDef<T>;
|
|
25
|
-
export {};
|
package/dist/beta.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { D as DataTable,
|
|
2
|
-
export { T as Toolbar, a as ToolbarButton, c as ToolbarButtonLink, b as ToolbarButtonToggle, e as ToolbarControlGroup, g as ToolbarElement, f as ToolbarSearchField, d as ToolbarSelect } from './Toolbar-
|
|
3
|
-
export { u as useCalendarBetaProps } from './Calendar-
|
|
4
|
-
export { C as Calendar } from './Calendar-
|
|
1
|
+
export { D as DataTable, a as chipsFormatter, c as createColumnHelper, b as currencyFormatter, p as percentFormatter } from './DataTable-BkNCMaVu.js';
|
|
2
|
+
export { T as Toolbar, a as ToolbarButton, c as ToolbarButtonLink, b as ToolbarButtonToggle, e as ToolbarControlGroup, g as ToolbarElement, f as ToolbarSearchField, d as ToolbarSelect } from './Toolbar-BvFwcXOk.js';
|
|
3
|
+
export { u as useCalendarBetaProps } from './Calendar-B7ypKGUn.js';
|
|
4
|
+
export { C as Calendar } from './Calendar-1MhJ03iy.js';
|
|
5
5
|
//# sourceMappingURL=beta.js.map
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { DataTrackingId } from '../../types';
|
|
1
|
+
import { DataTrackingId, LayoutUtilProps, Size } from '../../types';
|
|
2
2
|
import { YearlessDate, YearlessDateMode } from './types';
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { ReactElement, ReactNode, ComponentPropsWithoutRef } from 'react';
|
|
4
|
+
import { FieldLabelProps } from '../FieldLabel';
|
|
5
|
+
import { HelperProps } from '../../internal/components';
|
|
6
|
+
export type DateFieldYearlessProps = Omit<ComponentPropsWithoutRef<"input">, "onChange" | "value" | "defaultValue" | "ref" | "size" | "type" | "onFocus" | "onBlur"> & LayoutUtilProps & {
|
|
5
7
|
/**
|
|
6
8
|
* The controlled value of the date field
|
|
7
9
|
*/
|
|
@@ -39,6 +41,58 @@ export type DateFieldYearlessProps = Omit<MaskedYearlessDateInputProps, "onChang
|
|
|
39
41
|
*/
|
|
40
42
|
dates?: YearlessDate[];
|
|
41
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* Whether the picker is disabled
|
|
46
|
+
*/
|
|
47
|
+
disablePicker?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Error state or error message
|
|
50
|
+
*/
|
|
51
|
+
error?: ReactElement | string | boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Label for the field
|
|
54
|
+
*/
|
|
55
|
+
label?: FieldLabelProps["children"];
|
|
56
|
+
/**
|
|
57
|
+
* Props for the label component
|
|
58
|
+
*/
|
|
59
|
+
labelProps?: FieldLabelProps;
|
|
60
|
+
/**
|
|
61
|
+
* Description text for the field
|
|
62
|
+
*/
|
|
63
|
+
description?: HelperProps["description"];
|
|
64
|
+
/**
|
|
65
|
+
* Error aria-live setting
|
|
66
|
+
*/
|
|
67
|
+
errorAriaLive?: HelperProps["errorAriaLive"];
|
|
68
|
+
/**
|
|
69
|
+
* Size of the input
|
|
70
|
+
*/
|
|
71
|
+
size?: Extract<Size, "small" | "medium" | "large">;
|
|
72
|
+
/**
|
|
73
|
+
* Whether the field is disabled
|
|
74
|
+
*/
|
|
75
|
+
disabled?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Whether the field is in loading state
|
|
78
|
+
*/
|
|
79
|
+
loading?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Additional info content
|
|
82
|
+
*/
|
|
83
|
+
moreInfo?: ReactNode;
|
|
84
|
+
/**
|
|
85
|
+
* Whether to disable the format hint
|
|
86
|
+
*/
|
|
87
|
+
disableHint?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Function to call when the field is focused
|
|
90
|
+
*/
|
|
91
|
+
onFocus?: (event: React.FocusEvent) => void;
|
|
92
|
+
/**
|
|
93
|
+
* Function to call when the field is blurred
|
|
94
|
+
*/
|
|
95
|
+
onBlur?: (event: React.FocusEvent) => void;
|
|
42
96
|
} & DataTrackingId;
|
|
43
97
|
/**
|
|
44
98
|
* Represents a change event for the DateFieldYearless component
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { LayoutUtilProps } from '../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Represents an item in the picker list with a label and optional disabled state.
|
|
5
|
+
*/
|
|
6
|
+
export type PickerListItem = {
|
|
7
|
+
/** The display label for the item */
|
|
8
|
+
label: string;
|
|
9
|
+
/** The value of the item */
|
|
10
|
+
value: number;
|
|
11
|
+
/** Whether the item is disabled and cannot be selected */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Props for the PickerList component
|
|
16
|
+
* @extends ComponentPropsWithoutRef<"ul">
|
|
17
|
+
* @extends LayoutUtilProps
|
|
18
|
+
*/
|
|
19
|
+
export type PickerListProps = Omit<ComponentPropsWithoutRef<"ul">, "children"> & LayoutUtilProps & {
|
|
20
|
+
/** Array of items to render */
|
|
21
|
+
items: PickerListItem[];
|
|
22
|
+
/** Currently selected item (controlled) */
|
|
23
|
+
selected?: PickerListItem;
|
|
24
|
+
/** Callback when selection changes */
|
|
25
|
+
onSelectionChange?: (selected: PickerListItem | undefined) => void;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Ref methods exposed by PickerList
|
|
29
|
+
*/
|
|
30
|
+
export type PickerListRef = {
|
|
31
|
+
/** Scroll to a specific item by label */
|
|
32
|
+
scrollToItem: (label: string, behavior?: ScrollBehavior) => void;
|
|
33
|
+
/** Scroll to a specific item by value */
|
|
34
|
+
scrollToValue: (value: number, behavior?: ScrollBehavior) => void;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* PickerList component for selecting items from a list.
|
|
38
|
+
*
|
|
39
|
+
* Features:
|
|
40
|
+
* - Single selection mode only
|
|
41
|
+
* - Mouse click selection
|
|
42
|
+
* - Programmatic scrolling to specific items
|
|
43
|
+
* - Support for disabled items
|
|
44
|
+
* - Accessible with proper ARIA attributes
|
|
45
|
+
* - Visual consistency with Listbox component
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* <PickerList
|
|
49
|
+
* items={months}
|
|
50
|
+
* selected={selectedMonth}
|
|
51
|
+
* onSelectionChange={handleMonthChange}
|
|
52
|
+
* />
|
|
53
|
+
*/
|
|
54
|
+
export declare const PickerList: import('react').ForwardRefExoticComponent<Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref">, "children"> & LayoutUtilProps & {
|
|
55
|
+
/** Array of items to render */
|
|
56
|
+
items: PickerListItem[];
|
|
57
|
+
/** Currently selected item (controlled) */
|
|
58
|
+
selected?: PickerListItem;
|
|
59
|
+
/** Callback when selection changes */
|
|
60
|
+
onSelectionChange?: (selected: PickerListItem | undefined) => void;
|
|
61
|
+
} & import('react').RefAttributes<PickerListRef>>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { FlexProps } from '../../Flex';
|
|
3
|
+
import { DataTrackingId } from '../../../types';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the PickerListOption component
|
|
6
|
+
* @extends ComponentPropsWithoutRef<"li">
|
|
7
|
+
*/
|
|
8
|
+
export type PickerListOptionProps = ComponentPropsWithoutRef<"li"> & {
|
|
9
|
+
/** The item object containing label, value, and optional disabled state */
|
|
10
|
+
item: {
|
|
11
|
+
label: string;
|
|
12
|
+
value: number;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
};
|
|
15
|
+
/** Whether this option is currently selected */
|
|
16
|
+
isSelected: boolean;
|
|
17
|
+
/** Callback when this option is selected */
|
|
18
|
+
onSelectionChange: (selected: {
|
|
19
|
+
label: string;
|
|
20
|
+
value: number;
|
|
21
|
+
} | undefined) => void;
|
|
22
|
+
/** Flex alignment for items */
|
|
23
|
+
alignItems?: FlexProps["alignItems"];
|
|
24
|
+
/** Flex justification for items */
|
|
25
|
+
justifyItems?: FlexProps["justifyItems"];
|
|
26
|
+
/** Flex alignment for content */
|
|
27
|
+
alignContent?: FlexProps["alignContent"];
|
|
28
|
+
/** Flex justification for content */
|
|
29
|
+
justifyContent?: FlexProps["justifyContent"];
|
|
30
|
+
/** Flex place-items property */
|
|
31
|
+
placeItems?: FlexProps["placeItems"];
|
|
32
|
+
/** Flex place-content property */
|
|
33
|
+
placeContent?: FlexProps["placeContent"];
|
|
34
|
+
} & DataTrackingId;
|
|
35
|
+
export declare const PickerListOption: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
|
|
36
|
+
/** The item object containing label, value, and optional disabled state */
|
|
37
|
+
item: {
|
|
38
|
+
label: string;
|
|
39
|
+
value: number;
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
};
|
|
42
|
+
/** Whether this option is currently selected */
|
|
43
|
+
isSelected: boolean;
|
|
44
|
+
/** Callback when this option is selected */
|
|
45
|
+
onSelectionChange: (selected: {
|
|
46
|
+
label: string;
|
|
47
|
+
value: number;
|
|
48
|
+
} | undefined) => void;
|
|
49
|
+
/** Flex alignment for items */
|
|
50
|
+
alignItems?: FlexProps["alignItems"];
|
|
51
|
+
/** Flex justification for items */
|
|
52
|
+
justifyItems?: FlexProps["justifyItems"];
|
|
53
|
+
/** Flex alignment for content */
|
|
54
|
+
alignContent?: FlexProps["alignContent"];
|
|
55
|
+
/** Flex justification for content */
|
|
56
|
+
justifyContent?: FlexProps["justifyContent"];
|
|
57
|
+
/** Flex place-items property */
|
|
58
|
+
placeItems?: FlexProps["placeItems"];
|
|
59
|
+
/** Flex place-content property */
|
|
60
|
+
placeContent?: FlexProps["placeContent"];
|
|
61
|
+
} & DataTrackingId & import('react').RefAttributes<HTMLLIElement>>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
import { YearlessDateMode, YearlessDate } from '../types';
|
|
3
|
+
import { PassThroughPropsWithRef, Size } from '../../../types';
|
|
4
|
+
export type YearlessDateInputChange = {
|
|
5
|
+
event: React.ChangeEvent<HTMLInputElement> | null;
|
|
6
|
+
value: YearlessDate | null;
|
|
7
|
+
isInputValid: boolean;
|
|
8
|
+
isInputEmpty: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type YearlessDateInputChangeHandler = (change: YearlessDateInputChange) => void;
|
|
11
|
+
export type YearlessDateInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "ref" | "size"> & {
|
|
12
|
+
onChange: YearlessDateInputChangeHandler;
|
|
13
|
+
mode?: YearlessDateMode;
|
|
14
|
+
value?: YearlessDate | null;
|
|
15
|
+
error?: boolean;
|
|
16
|
+
size?: Extract<Size, "small" | "medium" | "large">;
|
|
17
|
+
wrapperProps?: PassThroughPropsWithRef<"div">;
|
|
18
|
+
rootProps?: PassThroughPropsWithRef<"div">;
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
enableStepping?: boolean;
|
|
21
|
+
};
|
|
22
|
+
export type YearlessDateInputRef = HTMLInputElement & {
|
|
23
|
+
setValue: (value: YearlessDate | null) => {
|
|
24
|
+
value: YearlessDate | null;
|
|
25
|
+
isInputValid: boolean;
|
|
26
|
+
isInputEmpty: boolean;
|
|
27
|
+
};
|
|
28
|
+
removePlaceholder: (value: string) => string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* A masked date input component that allows for the input of a date in a specific format.
|
|
32
|
+
*
|
|
33
|
+
* Provides a `setDate` method that can be used to set the date from outside the component (e.g from a calendar).
|
|
34
|
+
*
|
|
35
|
+
* @internal This component is not intended to be used directly in consumer code.
|
|
36
|
+
*
|
|
37
|
+
* @param props - The props for the MaskedDateInput component.
|
|
38
|
+
* @param props.onChange - The function to call when the date changes.
|
|
39
|
+
* @param props.mode - The mode of the date input.
|
|
40
|
+
*/
|
|
41
|
+
export declare const YearlessDateInput: import('react').ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "ref" | "value" | "onChange"> & {
|
|
42
|
+
onChange: YearlessDateInputChangeHandler;
|
|
43
|
+
mode?: YearlessDateMode;
|
|
44
|
+
value?: YearlessDate | null;
|
|
45
|
+
error?: boolean;
|
|
46
|
+
size?: Extract<Size, "small" | "medium" | "large">;
|
|
47
|
+
wrapperProps?: PassThroughPropsWithRef<"div">;
|
|
48
|
+
rootProps?: PassThroughPropsWithRef<"div">;
|
|
49
|
+
loading?: boolean;
|
|
50
|
+
enableStepping?: boolean;
|
|
51
|
+
} & import('react').RefAttributes<YearlessDateInputRef>>;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
import { YearlessDateMode, YearlessDate } from '../types';
|
|
3
|
+
import { DateFieldYearlessChangeHandler } from '../DateFieldYearless';
|
|
4
|
+
import { Size } from '../../../types';
|
|
5
|
+
export type YearlessDateInputWithPickerProps = Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "ref" | "size" | "defaultValue" | "onFocus" | "onBlur"> & {
|
|
6
|
+
/**
|
|
7
|
+
* The controlled value of the date field
|
|
8
|
+
*/
|
|
9
|
+
value?: YearlessDate | null;
|
|
10
|
+
/**
|
|
11
|
+
* The default value for uncontrolled usage
|
|
12
|
+
*/
|
|
13
|
+
defaultValue?: YearlessDate | null;
|
|
14
|
+
/**
|
|
15
|
+
* The function to call when the date value changes
|
|
16
|
+
*/
|
|
17
|
+
onChange?: DateFieldYearlessChangeHandler;
|
|
18
|
+
/**
|
|
19
|
+
* The date format mode (mm/dd or dd/mm)
|
|
20
|
+
*/
|
|
21
|
+
mode?: YearlessDateMode;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the field is required
|
|
24
|
+
*/
|
|
25
|
+
required?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The minimum allowed date
|
|
28
|
+
*/
|
|
29
|
+
minDate?: YearlessDate | null;
|
|
30
|
+
/**
|
|
31
|
+
* The maximum allowed date
|
|
32
|
+
*/
|
|
33
|
+
maxDate?: YearlessDate | null;
|
|
34
|
+
/**
|
|
35
|
+
* Configuration for unavailable dates
|
|
36
|
+
*/
|
|
37
|
+
unavailable?: {
|
|
38
|
+
/**
|
|
39
|
+
* Array of dates that are not selectable
|
|
40
|
+
*/
|
|
41
|
+
dates?: YearlessDate[];
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Whether the picker is disabled
|
|
45
|
+
*/
|
|
46
|
+
disablePicker?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* The size of the input
|
|
49
|
+
*/
|
|
50
|
+
size?: Extract<Size, "small" | "medium" | "large">;
|
|
51
|
+
/**
|
|
52
|
+
* Whether the input has an error
|
|
53
|
+
*/
|
|
54
|
+
error?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Whether the input is in loading state
|
|
57
|
+
*/
|
|
58
|
+
loading?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Function to call when the input is focused
|
|
61
|
+
*/
|
|
62
|
+
onFocus?: (event: React.FocusEvent) => void;
|
|
63
|
+
/**
|
|
64
|
+
* Function to call when the input is blurred
|
|
65
|
+
*/
|
|
66
|
+
onBlur?: (event: React.FocusEvent) => void;
|
|
67
|
+
};
|
|
68
|
+
export type YearlessDateInputWithPickerRef = {
|
|
69
|
+
focus: () => void;
|
|
70
|
+
setValue: (value: YearlessDate | null) => void;
|
|
71
|
+
};
|
|
72
|
+
export declare const YearlessDateInputWithPicker: import('react').ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "ref" | "value" | "onBlur" | "onFocus" | "onChange" | "defaultValue"> & {
|
|
73
|
+
/**
|
|
74
|
+
* The controlled value of the date field
|
|
75
|
+
*/
|
|
76
|
+
value?: YearlessDate | null;
|
|
77
|
+
/**
|
|
78
|
+
* The default value for uncontrolled usage
|
|
79
|
+
*/
|
|
80
|
+
defaultValue?: YearlessDate | null;
|
|
81
|
+
/**
|
|
82
|
+
* The function to call when the date value changes
|
|
83
|
+
*/
|
|
84
|
+
onChange?: DateFieldYearlessChangeHandler;
|
|
85
|
+
/**
|
|
86
|
+
* The date format mode (mm/dd or dd/mm)
|
|
87
|
+
*/
|
|
88
|
+
mode?: YearlessDateMode;
|
|
89
|
+
/**
|
|
90
|
+
* Whether the field is required
|
|
91
|
+
*/
|
|
92
|
+
required?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* The minimum allowed date
|
|
95
|
+
*/
|
|
96
|
+
minDate?: YearlessDate | null;
|
|
97
|
+
/**
|
|
98
|
+
* The maximum allowed date
|
|
99
|
+
*/
|
|
100
|
+
maxDate?: YearlessDate | null;
|
|
101
|
+
/**
|
|
102
|
+
* Configuration for unavailable dates
|
|
103
|
+
*/
|
|
104
|
+
unavailable?: {
|
|
105
|
+
/**
|
|
106
|
+
* Array of dates that are not selectable
|
|
107
|
+
*/
|
|
108
|
+
dates?: YearlessDate[];
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Whether the picker is disabled
|
|
112
|
+
*/
|
|
113
|
+
disablePicker?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* The size of the input
|
|
116
|
+
*/
|
|
117
|
+
size?: Extract<Size, "small" | "medium" | "large">;
|
|
118
|
+
/**
|
|
119
|
+
* Whether the input has an error
|
|
120
|
+
*/
|
|
121
|
+
error?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Whether the input is in loading state
|
|
124
|
+
*/
|
|
125
|
+
loading?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Function to call when the input is focused
|
|
128
|
+
*/
|
|
129
|
+
onFocus?: (event: React.FocusEvent) => void;
|
|
130
|
+
/**
|
|
131
|
+
* Function to call when the input is blurred
|
|
132
|
+
*/
|
|
133
|
+
onBlur?: (event: React.FocusEvent) => void;
|
|
134
|
+
} & import('react').RefAttributes<YearlessDateInputWithPickerRef>>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { YearlessDateMode } from '..';
|
|
3
|
+
import { PopoverTriggerProps } from '../../Popover/PopoverTrigger';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the YearlessDateSelectionPopover component
|
|
6
|
+
*/
|
|
7
|
+
export type YearlessDateSelectionPopoverProps = {
|
|
8
|
+
popoverRef: RefObject<{
|
|
9
|
+
openPopover: () => void;
|
|
10
|
+
closePopover: () => void;
|
|
11
|
+
}>;
|
|
12
|
+
popoverContentRef: RefObject<HTMLDivElement>;
|
|
13
|
+
month: number | null;
|
|
14
|
+
day: number | null;
|
|
15
|
+
onMonthChange: (month: number | null) => void;
|
|
16
|
+
onDayChange: (day: number | null) => void;
|
|
17
|
+
onClose: () => void;
|
|
18
|
+
mode: YearlessDateMode;
|
|
19
|
+
onFocus?: (event: React.FocusEvent) => void;
|
|
20
|
+
onBlur?: (event: React.FocusEvent) => void;
|
|
21
|
+
} & PopoverTriggerProps;
|
|
22
|
+
/**
|
|
23
|
+
* A yearless date selection tool built into a popover.
|
|
24
|
+
* @param param0
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
export declare function YearlessDateSelectionPopover({ children, popoverRef, popoverContentRef, month, day, onMonthChange, onDayChange, onClose, mode, onFocus, onBlur, }: YearlessDateSelectionPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { YearlessDateMode } from '../../types';
|
|
2
|
-
declare const yearlessDatePlaceholderMask: ({ mode, separator, placeholder, }: {
|
|
2
|
+
declare const yearlessDatePlaceholderMask: ({ mode, separator, placeholder, enableStepping, }: {
|
|
3
3
|
mode: YearlessDateMode;
|
|
4
|
+
enableStepping: boolean;
|
|
4
5
|
separator?: string;
|
|
5
6
|
placeholder: string;
|
|
6
7
|
}) => {
|
|
@@ -12,5 +13,6 @@ declare const yearlessDatePlaceholderMask: ({ mode, separator, placeholder, }: {
|
|
|
12
13
|
overwriteMode: "replace" | "shift" | ((elementState: import('@maskito/core/src/lib/types').ElementState) => "replace" | "shift");
|
|
13
14
|
};
|
|
14
15
|
removePlaceholder: (value: string) => string;
|
|
16
|
+
transform: (value: string) => string;
|
|
15
17
|
};
|
|
16
18
|
export default yearlessDatePlaceholderMask;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MaskitoPlugin } from '@maskito/core';
|
|
2
|
+
import { YearlessDateMode } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a Maskito plugin for yearless date segment stepping
|
|
5
|
+
* @param mode - The date format mode (mm/dd or dd/mm)
|
|
6
|
+
* @returns MaskitoPlugin that handles arrow key navigation
|
|
7
|
+
* @example
|
|
8
|
+
* const plugin = createYearlessDateSegmentsSteppingPlugin({ mode: "mm/dd" });
|
|
9
|
+
*/
|
|
10
|
+
export declare function createYearlessDateSegmentsSteppingPlugin({ mode, }: {
|
|
11
|
+
mode: YearlessDateMode;
|
|
12
|
+
}): MaskitoPlugin;
|