@economic/taco 2.17.2 → 2.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. package/dist/components/Select2/Select2.d.ts +2 -0
  2. package/dist/components/Select2/components/Context.d.ts +2 -0
  3. package/dist/components/Select2/components/Group.d.ts +2 -0
  4. package/dist/components/Select2/components/Option.d.ts +3 -0
  5. package/dist/components/Select2/components/Search.d.ts +5 -1
  6. package/dist/components/Table3/Table3.d.ts +1 -1
  7. package/dist/components/Table3/components/toolbar/Filter/filters/components/FilterValue.d.ts +1 -1
  8. package/dist/components/Table3/components/toolbar/FontSize.d.ts +0 -4
  9. package/dist/components/Table3/hooks/useCssGrid.d.ts +2 -2
  10. package/dist/components/Table3/hooks/useCssVars.d.ts +3 -2
  11. package/dist/components/Table3/types.d.ts +5 -5
  12. package/dist/esm/index.css +12 -12
  13. package/dist/esm/packages/taco/src/components/Select2/Select2.js +23 -7
  14. package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
  15. package/dist/esm/packages/taco/src/components/Select2/components/Context.js.map +1 -1
  16. package/dist/esm/packages/taco/src/components/Select2/components/Group.js +4 -1
  17. package/dist/esm/packages/taco/src/components/Select2/components/Group.js.map +1 -1
  18. package/dist/esm/packages/taco/src/components/Select2/components/Option.js +8 -2
  19. package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
  20. package/dist/esm/packages/taco/src/components/Select2/components/Search.js +2 -1
  21. package/dist/esm/packages/taco/src/components/Select2/components/Search.js.map +1 -1
  22. package/dist/esm/packages/taco/src/components/Select2/hooks/useChildren.js +1 -1
  23. package/dist/esm/packages/taco/src/components/Select2/hooks/useChildren.js.map +1 -1
  24. package/dist/esm/packages/taco/src/components/Table3/Table3.js +4 -5
  25. package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
  26. package/dist/esm/packages/taco/src/components/Table3/components/alert/ErrorAlert.js +1 -1
  27. package/dist/esm/packages/taco/src/components/Table3/components/alert/ErrorAlert.js.map +1 -1
  28. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js +1 -0
  29. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/EditingControl.js.map +1 -1
  30. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js +1 -1
  31. package/dist/esm/packages/taco/src/components/Table3/components/columns/cell/controls/TextareaControl.js.map +1 -1
  32. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js +3 -3
  33. package/dist/esm/packages/taco/src/components/Table3/components/columns/internal/Actions.js.map +1 -1
  34. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Filter.js +11 -1
  35. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/Filter.js.map +1 -1
  36. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterValue.js +0 -2
  37. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Filter/filters/components/FilterValue.js.map +1 -1
  38. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/FontSize.js +5 -9
  39. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/FontSize.js.map +1 -1
  40. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/PrintButton/PrintIFrame.js +1 -1
  41. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/RowHeight.js +3 -3
  42. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/RowHeight.js.map +1 -1
  43. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Search.js +5 -2
  44. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Search.js.map +1 -1
  45. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Settings.js +1 -1
  46. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Toolbar.js +1 -1
  47. package/dist/esm/packages/taco/src/components/Table3/components/toolbar/Toolbar.js.map +1 -1
  48. package/dist/esm/packages/taco/src/components/Table3/hooks/useCssGrid.js.map +1 -1
  49. package/dist/esm/packages/taco/src/components/Table3/hooks/useCssVars.js +10 -10
  50. package/dist/esm/packages/taco/src/components/Table3/hooks/useCssVars.js.map +1 -1
  51. package/dist/esm/packages/taco/src/components/Table3/types.js.map +1 -1
  52. package/dist/esm/packages/taco/src/index.js +1 -1
  53. package/dist/esm/packages/taco/src/primitives/Listbox2/components/Option.js +4 -0
  54. package/dist/esm/packages/taco/src/primitives/Listbox2/components/Option.js.map +1 -1
  55. package/dist/esm/packages/taco/src/primitives/Table/useTable/features/useTableFontSize.js.map +1 -1
  56. package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableFontSizeListener.js +7 -7
  57. package/dist/esm/packages/taco/src/primitives/Table/useTable/listeners/useTableFontSizeListener.js.map +1 -1
  58. package/dist/esm/packages/taco/src/primitives/Table/useTable/util/columns.js +4 -4
  59. package/dist/esm/packages/taco/src/primitives/Table/useTable/util/columns.js.map +1 -1
  60. package/dist/esm/packages/taco/src/types.js +7 -1
  61. package/dist/esm/packages/taco/src/types.js.map +1 -1
  62. package/dist/esm/packages/taco/src/utils/dom.js +13 -1
  63. package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
  64. package/dist/index.css +12 -12
  65. package/dist/primitives/Table/types.d.ts +0 -6
  66. package/dist/primitives/Table/useTable/features/useTableFontSize.d.ts +2 -2
  67. package/dist/primitives/Table/useTable/util/columns.d.ts +2 -2
  68. package/dist/taco.cjs.development.js +123 -79
  69. package/dist/taco.cjs.development.js.map +1 -1
  70. package/dist/taco.cjs.production.min.js +1 -1
  71. package/dist/taco.cjs.production.min.js.map +1 -1
  72. package/dist/types.d.ts +6 -0
  73. package/dist/utils/dom.d.ts +1 -0
  74. package/package.json +2 -2
  75. package/types.json +10644 -10278
  76. package/dist/esm/packages/taco/src/primitives/Table/types.js +0 -10
  77. package/dist/esm/packages/taco/src/primitives/Table/types.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../../../../../src/components/Table3/types.ts"],"sourcesContent":["import { ColumnOrderState, ColumnSizingState, SortingState, VisibilityState, BuiltInSortingFn } from '@tanstack/react-table';\nimport { MenuProps } from '../Menu/Menu';\nimport { MenuItemProps } from '../Menu/components/Item';\nimport {\n TableColumnFilter,\n TableColumnSort,\n TableFilterHandler,\n TableFontSize,\n TableRef,\n TableRowClickHandler,\n TableRowGotoHandler,\n TableRowHeight,\n TableRowSelectHandler,\n TableServerLoadAllHandler,\n TableServerLoadPageHandler,\n TableSortHandler,\n} from '../../primitives/Table/types';\nimport { ValueOf } from '../../types';\n\nexport type Table3SortDirection = 'asc' | 'desc';\nexport type Table3SortFn<TType = unknown> =\n | ((rowA: TType, rowB: TType, columnId: string) => -1 | 0 | 1)\n | BuiltInSortingFn\n | 'auto';\n\n// columns\nexport type Table3ColumnRenderer<TValue = unknown, TType = unknown> = (\n value: TValue,\n row: TType\n) => JSX.Element | string | number | null;\nexport type Table3ColumnFooterRenderer<TValue = unknown> = (values: TValue[]) => JSX.Element | string | number | null;\nexport type Table3ColumnClassNameHandler<TType = unknown> = string | ((row: TType) => string | undefined);\nexport type Table3ColumnAlignment = 'left' | 'center' | 'right';\nexport type Table3ColumnDataType = 'auto' | 'number' | 'alphanumeric' | 'alphanumericCaseSensitive' | 'datetime' | 'boolean';\nexport type Table3ColumnHeaderMenu = (props: Partial<MenuProps>) => JSX.Element;\n\nexport type Table3ColumnControlProps = {\n className?: string;\n disabled?: boolean;\n invalid?: boolean;\n onBlur?: (value: any) => void;\n onFocus?: React.FocusEventHandler;\n readOnly?: boolean;\n ref: React.RefObject<HTMLElement> | ((instance: HTMLElement | null | undefined) => void);\n setValue: (value: any) => void;\n value: any;\n};\nexport type Table3ColumnControlRenderer<TType = unknown> =\n | ((props: Table3ColumnControlProps, row?: TType) => JSX.Element)\n | 'datepicker'\n | 'input'\n | 'switch'\n | 'textarea';\n\nexport type Table3ColumnProps<TType = unknown> = ValueOf<{\n [K in keyof TType]: {\n accessor: K;\n } & {\n align?: Table3ColumnAlignment;\n className?: Table3ColumnClassNameHandler<TType>;\n control?: Table3ColumnControlRenderer<TType>;\n dataType?: Table3ColumnDataType;\n defaultHidden?: boolean;\n defaultWidth?: number | 'grow';\n enableFiltering?: boolean;\n enableHiding?: boolean;\n enableOrdering?: boolean;\n enablePrinting?: boolean;\n enableResizing?: boolean;\n enableSearch?: boolean;\n enableSorting?: boolean;\n enableTruncate?: boolean;\n filters?: Table3FilterComparator[];\n footer?: Table3ColumnFooterRenderer;\n header: string;\n headerClassName?: string;\n menu?: Table3ColumnHeaderMenu;\n minWidth?: number;\n renderer?: Table3ColumnRenderer<TType[K], TType>;\n sort?: Table3SortDirection;\n sortFn?: Table3SortFn<TType>;\n tooltip?: string;\n };\n}>;\n\nexport type Table3GroupProps = {\n id: string;\n header: string;\n colSpan?: number;\n children: (JSX.Element | boolean | null | undefined)[];\n};\n\n// rows\nexport type DeprecatedRowDensity = 'compact' | 'normal' | 'comfortable' | 'spacious';\nexport type Table3RowHeight = TableRowHeight;\nexport type Table3FontSize = TableFontSize;\nexport type Table3RowClickHandler<TType = unknown> = TableRowClickHandler<TType>;\nexport type Table3RowDragHandler<TType = unknown> = (\n rows: TType[],\n showPlaceholder: (string) => void,\n setDataTransfer: (data: string) => void\n) => void;\nexport type Table3RowDropHandler<TType = any> = (event: React.DragEvent, row: TType) => void;\nexport type Table3RowExpansionRenderer<TType = unknown> = (row: TType) => (() => JSX.Element) | null;\nexport type Table3RowSelectionHandler<TType = unknown> = TableRowSelectHandler<TType>;\nexport type Table3RowActionRenderer<TType = unknown> = (row: TType) => JSX.Element | null;\n\n// table\nexport type Table3Preset = 'display' | 'editable';\nexport type Table3Settings = {\n columnFreezingIndex?: number;\n columnOrder?: ColumnOrderState;\n columnSizing?: ColumnSizingState;\n columnVisibility?: VisibilityState;\n excludeUnmatchedRecordsInSearch?: boolean;\n fontSize?: Table3FontSize;\n rowHeight?: Table3RowHeight;\n showWarningWhenPrintingLargeDataset?: boolean;\n sorting?: SortingState;\n};\nexport type Table3SettingsHandler = (settings: Table3Settings) => void | Promise<void>;\n\nexport enum Table3FilterComparator {\n Contains,\n DoesNotContain,\n IsEqualTo,\n IsNotEqualTo,\n IsGreaterThan,\n IsLessThan,\n IsBetween,\n IsEmpty,\n IsNotEmpty,\n IsLessThanOrEqualTo,\n IsGreaterThanOrEqualTo,\n HasAnyOf,\n HasAllOf,\n HasNoneOf,\n}\n\nexport type Table3FilterValue = {\n comparator: Table3FilterComparator;\n value: any;\n};\n\nexport type Table3Filter = { id: string | null; value: Table3FilterValue };\n\nexport type ColumnFilter = TableColumnFilter;\nexport type Table3FilterHandler = TableFilterHandler;\nexport type Table3LoadPageHandler = TableServerLoadPageHandler;\nexport type Table3LoadAllHandler = TableServerLoadAllHandler;\nexport type Table3RowGotoHandler = TableRowGotoHandler;\nexport type Table3ColumnSort = TableColumnSort;\nexport type Table3SortHandler = TableSortHandler;\nexport type RowErrors = Record<string, string>;\nexport type Table3CellValidationHandler<TType = unknown> = (\n cellValue: any,\n cellId: string,\n row: TType\n) => Promise<RowErrors | undefined | void>;\nexport type Table3RowValidationHandler<TType = unknown> = (row: TType) => Promise<RowErrors | undefined | void>;\nexport type TableStrategy = {\n renderBody: () => JSX.Element | JSX.Element[] | null;\n scrollToIndex: (index: number, options?: { align: 'start' | 'center' | 'end' | 'auto' }) => void;\n};\nexport type Table3ShortcutHandlerFn<TType = unknown> = (row: TType) => void;\nexport type Table3ShortcutHandlerObject<TType = unknown> = {\n handler: Table3ShortcutHandlerFn<TType>;\n meta?: boolean;\n shift?: boolean;\n};\nexport type Table3Shortcuts<TType = unknown> = Record<\n string,\n Table3ShortcutHandlerFn<TType> | Table3ShortcutHandlerObject<TType>\n>;\nexport type Table3SaveHandler<TType = unknown> = (data: TType) => Promise<void>;\n\nexport type Table3Options = {\n enableColumnFreezing: boolean;\n enableColumnHiding: boolean;\n enableColumnOrdering: boolean;\n enableColumnResizing: boolean;\n enableFontSize: boolean;\n enableFooter: boolean;\n enablePrinting: boolean;\n enableRowDrag: boolean;\n enableRowDrop: boolean;\n enableRowExpansion: boolean;\n enableRowGoto: boolean;\n enableRowHeight: boolean;\n enableRowSelection: boolean;\n enableRowSelectionSingle: boolean;\n enableEditing: boolean;\n enableFiltering: boolean;\n enableSearch: boolean;\n enableSorting: boolean;\n};\n\nexport type Table3CustomSettingRenderer = (props: Table3Settings) => React.ReactElement<MenuItemProps> | null;\n\nexport type Table3CommonProps<TType = unknown> = Partial<Table3Options> & {\n actionsForRow?: Table3RowActionRenderer<TType>[];\n actionsForRowLength?: number;\n autoFocus?: boolean;\n children: (JSX.Element | boolean | null | undefined)[];\n customSettings?: Table3CustomSettingRenderer[];\n data: TType[];\n defaultColumnFreezingIndex?: number;\n defaultCurrentRowIndex?: number;\n defaultSettings?: Table3Settings;\n emptyState?: () => JSX.Element | null;\n expandedRowRenderer?: Table3RowExpansionRenderer<TType>;\n id: string;\n onChangeSettings?: Table3SettingsHandler;\n onRowClick?: Table3RowClickHandler<TType>;\n onRowDrag?: Table3RowDragHandler<TType>;\n onRowDrop?: Table3RowDropHandler<TType>;\n onRowGoto?: Table3RowGotoHandler;\n onRowSelect?: Table3RowSelectionHandler<TType>;\n onFilter?: Table3FilterHandler;\n onSave?: Table3SaveHandler<TType>;\n onSort?: Table3SortHandler;\n onCellValidate?: Table3CellValidationHandler<TType>;\n onRowValidate?: Table3RowValidationHandler<TType>;\n preset?: Table3Preset;\n shortcuts?: Table3Shortcuts<TType>;\n toolbarLeft?: JSX.Element;\n toolbarRight?: JSX.Element;\n rowIdentifier?: string;\n};\n\ninterface Table3ClientProps<TType = unknown> extends Table3CommonProps<TType> {\n length?: never;\n loadPage?: never;\n loadAll?: never;\n pageSize?: never;\n}\n\ninterface Table3ServerProps<TType = unknown> extends Table3CommonProps<TType> {\n length: number | undefined;\n loadPage: Table3LoadPageHandler;\n loadAll: Table3LoadAllHandler;\n pageSize?: number;\n}\n\nexport type Table3Props<TType = unknown> = Table3ClientProps<TType> | Table3ServerProps<TType>;\n\nexport type Table3Ref = TableRef & {\n instance: {\n toggleEditing: (enabled: boolean | undefined) => void;\n };\n};\n\nexport type Table3Texts = {\n columns: {\n actions: {\n tooltip: string;\n };\n drag: {\n tooltip: string;\n };\n expansion: {\n collapse: string;\n collapseAll: string;\n expand: string;\n expandAll: string;\n };\n menu: {\n freezeFirstColumn: string;\n freezeUptoColumn: string;\n gotoRow: string;\n hideColumn: string;\n unfreezeColumns: string;\n sorting: string;\n sortingOrder: {\n ascending: string;\n descending: string;\n unsorted: string;\n };\n };\n resize: {\n tooltip: string;\n };\n select: {\n deselect: string;\n deselectAll: string;\n select: string;\n selectAll: string;\n };\n };\n columnSettings: {\n button: string;\n noResults: string;\n search: string;\n tooltip: string;\n };\n editing: {\n actions: {\n tooltip: string;\n save: string;\n clear: string;\n exit: string;\n };\n buttons: {\n edit: {\n tooltip: string;\n };\n };\n rowIndicator: {\n rowWillMove: string;\n rowWillBeHidden: string;\n rowWillMoveReasonSearch: string;\n rowWillMoveReasonFilter: string;\n rowWillMoveReasonSorting: string;\n };\n saving: {\n progress: string;\n complete: string;\n };\n clearChangesConfirmationDialog: {\n title: string;\n description: string;\n cancel: string;\n confirm: string;\n };\n };\n filters: {\n button: string;\n buttons: {\n addFilter: string;\n clearFilters: string;\n };\n comparators: {\n contains: string;\n doesNotContain: string;\n isEqualTo: string;\n isNotEqualTo: string;\n isGreaterThan: string;\n isLessThan: string;\n isBetween: string;\n isEmpty: string;\n isNotEmpty: string;\n isBefore: string;\n isAfter: string;\n isLessThanOrEqualTo: string;\n isGreaterThanOrEqualTo: string;\n isOnOrBefore: string;\n isOnOrAfter: string;\n hasAnyOf: string;\n hasAllOf: string;\n hasNoneOf: string;\n };\n conditions: {\n and: string;\n where: string;\n };\n emptyFilter: {\n condition: string;\n value: string;\n };\n hiddenColumn: string;\n tooltip: string;\n total: string;\n };\n fontSize: {\n tooltip: string;\n sizes: {\n small: string;\n medium: string;\n large: string;\n };\n };\n footer: {\n summary: {\n count: string;\n records: string;\n selected: string;\n };\n };\n print: {\n error: string;\n loading: string;\n tooltip: string;\n warningDialog: {\n title: string;\n description: string;\n checkboxVisibilityLabel: string;\n cancelButtonText: string;\n printButtonText: string;\n };\n };\n rowHeight: {\n tooltip: string;\n sizes: {\n short: string;\n medium: string;\n tall: string;\n extraTall: string;\n };\n };\n search: {\n excludeUnmatchedResults: string;\n placeholder: string;\n };\n otherOptions: {\n tooltip: string;\n };\n validation: {\n index: string;\n alert: {\n unsavedEntries: (count?: number) => string;\n incompleteAndHavntBeenSaved: (count?: number) => string;\n };\n resetFiltersDialog: {\n title: string;\n description: string;\n cancel: string;\n confirm: string;\n };\n };\n};\n"],"names":["Table3FilterComparator"],"mappings":"IA0HYA;AAAZ,WAAYA,sBAAsB;EAC9BA,2EAAQ;EACRA,uFAAc;EACdA,6EAAS;EACTA,mFAAY;EACZA,qFAAa;EACbA,+EAAU;EACVA,6EAAS;EACTA,yEAAO;EACPA,+EAAU;EACVA,iGAAmB;EACnBA,wGAAsB;EACtBA,4EAAQ;EACRA,4EAAQ;EACRA,8EAAS;AACb,CAAC,EAfWA,sBAAsB,KAAtBA,sBAAsB;;;;"}
1
+ {"version":3,"file":"types.js","sources":["../../../../../../../src/components/Table3/types.ts"],"sourcesContent":["import { ColumnOrderState, ColumnSizingState, SortingState, VisibilityState, BuiltInSortingFn } from '@tanstack/react-table';\nimport { MenuProps } from '../Menu/Menu';\nimport { MenuItemProps } from '../Menu/components/Item';\nimport {\n TableColumnFilter,\n TableColumnSort,\n TableFilterHandler,\n TableRef,\n TableRowClickHandler,\n TableRowGotoHandler,\n TableRowHeight,\n TableRowSelectHandler,\n TableServerLoadAllHandler,\n TableServerLoadPageHandler,\n TableSortHandler,\n} from '../../primitives/Table/types';\nimport { FontSize, ValueOf } from '../../types';\n\nexport type Table3SortDirection = 'asc' | 'desc';\nexport type Table3SortFn<TType = unknown> =\n | ((rowA: TType, rowB: TType, columnId: string) => -1 | 0 | 1)\n | BuiltInSortingFn\n | 'auto';\n\n// columns\nexport type Table3ColumnRenderer<TValue = unknown, TType = unknown> = (\n value: TValue,\n row: TType\n) => JSX.Element | string | number | null;\nexport type Table3ColumnFooterRenderer<TValue = unknown> = (values: TValue[]) => JSX.Element | string | number | null;\nexport type Table3ColumnClassNameHandler<TType = unknown> = string | ((row: TType) => string | undefined);\nexport type Table3ColumnAlignment = 'left' | 'center' | 'right';\nexport type Table3ColumnDataType = 'auto' | 'number' | 'alphanumeric' | 'alphanumericCaseSensitive' | 'datetime' | 'boolean';\nexport type Table3ColumnHeaderMenu = (props: Partial<MenuProps>) => JSX.Element;\n\nexport type Table3ColumnControlProps = {\n className?: string;\n disabled?: boolean;\n invalid?: boolean;\n onBlur?: (value: any) => void;\n onFocus?: React.FocusEventHandler;\n readOnly?: boolean;\n ref: React.RefObject<HTMLElement> | ((instance: HTMLElement | null | undefined) => void);\n setValue: (value: any) => void;\n value: any;\n fontSize?: FontSize;\n};\nexport type Table3ColumnControlRenderer<TType = unknown> =\n | ((props: Table3ColumnControlProps, row?: TType) => JSX.Element)\n | 'datepicker'\n | 'input'\n | 'switch'\n | 'textarea';\n\nexport type Table3ColumnProps<TType = unknown> = ValueOf<{\n [K in keyof TType]: {\n accessor: K;\n } & {\n align?: Table3ColumnAlignment;\n className?: Table3ColumnClassNameHandler<TType>;\n control?: Table3ColumnControlRenderer<TType>;\n dataType?: Table3ColumnDataType;\n defaultHidden?: boolean;\n defaultWidth?: number | 'grow';\n enableFiltering?: boolean;\n enableHiding?: boolean;\n enableOrdering?: boolean;\n enablePrinting?: boolean;\n enableResizing?: boolean;\n enableSearch?: boolean;\n enableSorting?: boolean;\n enableTruncate?: boolean;\n filters?: Table3FilterComparator[];\n footer?: Table3ColumnFooterRenderer;\n header: string;\n headerClassName?: string;\n menu?: Table3ColumnHeaderMenu;\n minWidth?: number;\n renderer?: Table3ColumnRenderer<TType[K], TType>;\n sort?: Table3SortDirection;\n sortFn?: Table3SortFn<TType>;\n tooltip?: string;\n };\n}>;\n\nexport type Table3GroupProps = {\n id: string;\n header: string;\n colSpan?: number;\n children: (JSX.Element | boolean | null | undefined)[];\n};\n\n// rows\nexport type DeprecatedRowDensity = 'compact' | 'normal' | 'comfortable' | 'spacious';\nexport type Table3RowHeight = TableRowHeight;\nexport type Table3RowClickHandler<TType = unknown> = TableRowClickHandler<TType>;\nexport type Table3RowDragHandler<TType = unknown> = (\n rows: TType[],\n showPlaceholder: (string) => void,\n setDataTransfer: (data: string) => void\n) => void;\nexport type Table3RowDropHandler<TType = any> = (event: React.DragEvent, row: TType) => void;\nexport type Table3RowExpansionRenderer<TType = unknown> = (row: TType) => (() => JSX.Element) | null;\nexport type Table3RowSelectionHandler<TType = unknown> = TableRowSelectHandler<TType>;\nexport type Table3RowActionRenderer<TType = unknown> = (row: TType) => JSX.Element | null;\n\n// table\nexport type Table3Preset = 'display' | 'editable';\nexport type Table3Settings = {\n columnFreezingIndex?: number;\n columnOrder?: ColumnOrderState;\n columnSizing?: ColumnSizingState;\n columnVisibility?: VisibilityState;\n excludeUnmatchedRecordsInSearch?: boolean;\n fontSize?: FontSize;\n rowHeight?: Table3RowHeight;\n showWarningWhenPrintingLargeDataset?: boolean;\n sorting?: SortingState;\n};\nexport type Table3SettingsHandler = (settings: Table3Settings) => void | Promise<void>;\n\nexport enum Table3FilterComparator {\n Contains,\n DoesNotContain,\n IsEqualTo,\n IsNotEqualTo,\n IsGreaterThan,\n IsLessThan,\n IsBetween,\n IsEmpty,\n IsNotEmpty,\n IsLessThanOrEqualTo,\n IsGreaterThanOrEqualTo,\n HasAnyOf,\n HasAllOf,\n HasNoneOf,\n}\n\nexport type Table3FilterValue = {\n comparator: Table3FilterComparator | null;\n value: any;\n};\n\nexport type Table3Filter = { id: string | null; value: Table3FilterValue };\n\nexport type ColumnFilter = TableColumnFilter;\nexport type Table3FilterHandler = TableFilterHandler;\nexport type Table3LoadPageHandler = TableServerLoadPageHandler;\nexport type Table3LoadAllHandler = TableServerLoadAllHandler;\nexport type Table3RowGotoHandler = TableRowGotoHandler;\nexport type Table3ColumnSort = TableColumnSort;\nexport type Table3SortHandler = TableSortHandler;\nexport type RowErrors = Record<string, string>;\nexport type Table3CellValidationHandler<TType = unknown> = (\n cellValue: any,\n cellId: string,\n row: TType\n) => Promise<RowErrors | undefined | void>;\nexport type Table3RowValidationHandler<TType = unknown> = (row: TType) => Promise<RowErrors | undefined | void>;\nexport type TableStrategy = {\n renderBody: () => JSX.Element | JSX.Element[] | null;\n scrollToIndex: (index: number, options?: { align: 'start' | 'center' | 'end' | 'auto' }) => void;\n};\nexport type Table3ShortcutHandlerFn<TType = unknown> = (row: TType) => void;\nexport type Table3ShortcutHandlerObject<TType = unknown> = {\n handler: Table3ShortcutHandlerFn<TType>;\n meta?: boolean;\n shift?: boolean;\n};\nexport type Table3Shortcuts<TType = unknown> = Record<\n string,\n Table3ShortcutHandlerFn<TType> | Table3ShortcutHandlerObject<TType>\n>;\nexport type Table3SaveHandler<TType = unknown> = (data: TType) => Promise<void>;\n\nexport type Table3Options = {\n enableColumnFreezing: boolean;\n enableColumnHiding: boolean;\n enableColumnOrdering: boolean;\n enableColumnResizing: boolean;\n enableFontSize: boolean;\n enableFooter: boolean;\n enablePrinting: boolean;\n enableRowDrag: boolean;\n enableRowDrop: boolean;\n enableRowExpansion: boolean;\n enableRowGoto: boolean;\n enableRowHeight: boolean;\n enableRowSelection: boolean;\n enableRowSelectionSingle: boolean;\n enableEditing: boolean;\n enableFiltering: boolean;\n enableSearch: boolean;\n enableSorting: boolean;\n};\n\nexport type Table3CustomSettingRenderer = (props: Table3Settings) => React.ReactElement<MenuItemProps> | null;\n\nexport type Table3CommonProps<TType = unknown> = Partial<Table3Options> & {\n actionsForRow?: Table3RowActionRenderer<TType>[];\n actionsForRowLength?: number;\n autoFocus?: boolean;\n children: (JSX.Element | boolean | null | undefined)[];\n customSettings?: Table3CustomSettingRenderer[];\n data: TType[];\n defaultColumnFreezingIndex?: number;\n defaultCurrentRowIndex?: number;\n defaultSettings?: Table3Settings;\n emptyState?: () => JSX.Element | null;\n expandedRowRenderer?: Table3RowExpansionRenderer<TType>;\n id: string;\n onChangeSettings?: Table3SettingsHandler;\n onRowClick?: Table3RowClickHandler<TType>;\n onRowDrag?: Table3RowDragHandler<TType>;\n onRowDrop?: Table3RowDropHandler<TType>;\n onRowGoto?: Table3RowGotoHandler;\n onRowSelect?: Table3RowSelectionHandler<TType>;\n onFilter?: Table3FilterHandler;\n onSave?: Table3SaveHandler<TType>;\n onSort?: Table3SortHandler;\n onCellValidate?: Table3CellValidationHandler<TType>;\n onRowValidate?: Table3RowValidationHandler<TType>;\n preset?: Table3Preset;\n shortcuts?: Table3Shortcuts<TType>;\n toolbarLeft?: JSX.Element;\n toolbarRight?: JSX.Element;\n rowIdentifier?: string;\n};\n\ninterface Table3ClientProps<TType = unknown> extends Table3CommonProps<TType> {\n length?: never;\n loadPage?: never;\n loadAll?: never;\n pageSize?: never;\n}\n\ninterface Table3ServerProps<TType = unknown> extends Table3CommonProps<TType> {\n length: number | undefined;\n loadPage: Table3LoadPageHandler;\n loadAll: Table3LoadAllHandler;\n pageSize?: number;\n}\n\nexport type Table3Props<TType = unknown> = Table3ClientProps<TType> | Table3ServerProps<TType>;\n\nexport type Table3Ref = TableRef & {\n instance: {\n toggleEditing: (enabled: boolean | undefined) => void;\n };\n};\n\nexport type Table3Texts = {\n columns: {\n actions: {\n tooltip: string;\n };\n drag: {\n tooltip: string;\n };\n expansion: {\n collapse: string;\n collapseAll: string;\n expand: string;\n expandAll: string;\n };\n menu: {\n freezeFirstColumn: string;\n freezeUptoColumn: string;\n gotoRow: string;\n hideColumn: string;\n unfreezeColumns: string;\n sorting: string;\n sortingOrder: {\n ascending: string;\n descending: string;\n unsorted: string;\n };\n };\n resize: {\n tooltip: string;\n };\n select: {\n deselect: string;\n deselectAll: string;\n select: string;\n selectAll: string;\n };\n };\n columnSettings: {\n button: string;\n noResults: string;\n search: string;\n tooltip: string;\n };\n editing: {\n actions: {\n tooltip: string;\n save: string;\n clear: string;\n exit: string;\n };\n buttons: {\n edit: {\n tooltip: string;\n };\n };\n rowIndicator: {\n rowWillMove: string;\n rowWillBeHidden: string;\n rowWillMoveReasonSearch: string;\n rowWillMoveReasonFilter: string;\n rowWillMoveReasonSorting: string;\n };\n saving: {\n progress: string;\n complete: string;\n };\n clearChangesConfirmationDialog: {\n title: string;\n description: string;\n cancel: string;\n confirm: string;\n };\n };\n filters: {\n button: string;\n buttons: {\n addFilter: string;\n clearFilters: string;\n };\n comparators: {\n contains: string;\n doesNotContain: string;\n isEqualTo: string;\n isNotEqualTo: string;\n isGreaterThan: string;\n isLessThan: string;\n isBetween: string;\n isEmpty: string;\n isNotEmpty: string;\n isBefore: string;\n isAfter: string;\n isLessThanOrEqualTo: string;\n isGreaterThanOrEqualTo: string;\n isOnOrBefore: string;\n isOnOrAfter: string;\n hasAnyOf: string;\n hasAllOf: string;\n hasNoneOf: string;\n };\n conditions: {\n and: string;\n where: string;\n };\n emptyFilter: {\n condition: string;\n value: string;\n };\n hiddenColumn: string;\n tooltip: string;\n total: string;\n };\n fontSize: {\n tooltip: string;\n sizes: {\n small: string;\n medium: string;\n large: string;\n };\n };\n footer: {\n summary: {\n count: string;\n records: string;\n selected: string;\n };\n };\n print: {\n error: string;\n loading: string;\n tooltip: string;\n warningDialog: {\n title: string;\n description: string;\n checkboxVisibilityLabel: string;\n cancelButtonText: string;\n printButtonText: string;\n };\n };\n rowHeight: {\n tooltip: string;\n sizes: {\n short: string;\n medium: string;\n tall: string;\n extraTall: string;\n };\n };\n search: {\n excludeUnmatchedResults: string;\n placeholder: string;\n };\n otherOptions: {\n tooltip: string;\n };\n validation: {\n index: string;\n alert: {\n unsavedEntries: (count?: number) => string;\n incompleteAndHavntBeenSaved: (count?: number) => string;\n };\n resetFiltersDialog: {\n title: string;\n description: string;\n cancel: string;\n confirm: string;\n };\n };\n};\n"],"names":["Table3FilterComparator"],"mappings":"IAyHYA;AAAZ,WAAYA,sBAAsB;EAC9BA,2EAAQ;EACRA,uFAAc;EACdA,6EAAS;EACTA,mFAAY;EACZA,qFAAa;EACbA,+EAAU;EACVA,6EAAS;EACTA,yEAAO;EACPA,+EAAU;EACVA,iGAAmB;EACnBA,wGAAsB;EACtBA,4EAAQ;EACRA,4EAAQ;EACRA,8EAAS;AACb,CAAC,EAfWA,sBAAsB,KAAtBA,sBAAsB;;;;"}
@@ -55,6 +55,7 @@ export { SearchInput2 } from './components/SearchInput2/SearchInput2.js';
55
55
  import * as Collection from './primitives/Collection/Collection.js';
56
56
  export { Collection as CollectionPrimitive };
57
57
  export { Tag } from './components/Tag/Tag.js';
58
+ export { FontSizes, fixedForwardRef } from './types.js';
58
59
  export { Select2 } from './components/Select2/Select2.js';
59
60
  export { Switch } from './components/Switch/Switch.js';
60
61
  export { Table } from './components/Table/components/Table.js';
@@ -66,7 +67,6 @@ export { useLazyEffect } from './hooks/useLazyEffect.js';
66
67
  export { Textarea } from './components/Textarea/Textarea.js';
67
68
  export { useMatchMedia } from './hooks/useMatchMedia.js';
68
69
  export { useIsLargeScreen } from './hooks/useIsLargeScreen.js';
69
- export { fixedForwardRef } from './types.js';
70
70
  export { useTable3DataLoader } from './components/Table3/hooks/useTableDataLoader.js';
71
71
  export { Table3 } from './components/Table3/Table3.js';
72
72
  export { Tabs } from './components/Tabs/Tabs.js';
@@ -36,6 +36,10 @@ const Option = /*#__PURE__*/React__default.forwardRef(function Listbox2Option(pr
36
36
  if (disabled || listboxDisabled || listboxReadOnly) {
37
37
  event.stopPropagation();
38
38
  return;
39
+ }
40
+ // UX requirement: if tab key is pressed and the current option is selected then keydown event is ignored
41
+ else if (event.key === 'Tab' && selected) {
42
+ return;
39
43
  } else if (isAriaSelectionKey(event)) {
40
44
  setValue(value);
41
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Option.js","sources":["../../../../../../../../src/primitives/Listbox2/components/Option.tsx"],"sourcesContent":["import React from 'react';\nimport { useId } from '../../../hooks/useId';\nimport { isAriaSelectionKey } from '../../../utils/aria';\nimport { Listbox2OptionValue } from '../types';\nimport { useListbox2Context } from './Context';\n\nexport type Listbox2OptionProps = React.HTMLAttributes<HTMLDivElement> & {\n disabled?: boolean;\n value: Listbox2OptionValue;\n};\n\nexport const Option = React.forwardRef<HTMLDivElement, Listbox2OptionProps>(function Listbox2Option(props, ref) {\n const { disabled, id: nativeId, title, value, ...otherProps } = props;\n const { disabled: listboxDisabled, readOnly: listboxReadOnly, setValue, value: currentValue } = useListbox2Context();\n // The id name cannot start with a number, otherwise unit tests will fail when trying to querry element with such id.\n // That's why adding prefix.\n const id = 'option-' + useId(nativeId);\n const selected = Array.isArray(currentValue) ? currentValue.includes(value) : currentValue === value;\n\n const handleClick = (event: React.MouseEvent<HTMLDivElement>) => {\n if (disabled || listboxDisabled || listboxReadOnly) {\n event.stopPropagation();\n return;\n } else {\n setValue(value);\n }\n\n if (typeof props.onClick === 'function') {\n props.onClick(event);\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (disabled || listboxDisabled || listboxReadOnly) {\n event.stopPropagation();\n return;\n } else if (isAriaSelectionKey(event)) {\n setValue(value);\n }\n\n if (typeof props.onKeyDown === 'function') {\n props.onKeyDown(event);\n }\n };\n\n return (\n <div\n {...otherProps}\n aria-disabled={listboxDisabled || disabled ? 'true' : undefined}\n aria-selected={selected ? 'true' : undefined}\n id={id}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n ref={ref}\n role=\"option\"\n />\n );\n});\n"],"names":["Option","React","forwardRef","Listbox2Option","props","ref","disabled","id","nativeId","title","value","otherProps","listboxDisabled","readOnly","listboxReadOnly","setValue","currentValue","useListbox2Context","useId","selected","Array","isArray","includes","handleClick","event","stopPropagation","onClick","handleKeyDown","isAriaSelectionKey","onKeyDown","undefined","role"],"mappings":";;;;;MAWaA,MAAM,gBAAGC,cAAK,CAACC,UAAU,CAAsC,SAASC,cAAcA,CAACC,KAAK,EAAEC,GAAG;EAC1G,MAAM;IAAEC,QAAQ;IAAEC,EAAE,EAAEC,QAAQ;IAAEC,KAA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;KACP;AAEV,CAAC;;;;"}
1
+ {"version":3,"file":"Option.js","sources":["../../../../../../../../src/primitives/Listbox2/components/Option.tsx"],"sourcesContent":["import React from 'react';\nimport { useId } from '../../../hooks/useId';\nimport { isAriaSelectionKey } from '../../../utils/aria';\nimport { Listbox2OptionValue } from '../types';\nimport { useListbox2Context } from './Context';\n\nexport type Listbox2OptionProps = React.HTMLAttributes<HTMLDivElement> & {\n disabled?: boolean;\n value: Listbox2OptionValue;\n};\n\nexport const Option = React.forwardRef<HTMLDivElement, Listbox2OptionProps>(function Listbox2Option(props, ref) {\n const { disabled, id: nativeId, title, value, ...otherProps } = props;\n const { disabled: listboxDisabled, readOnly: listboxReadOnly, setValue, value: currentValue } = useListbox2Context();\n // The id name cannot start with a number, otherwise unit tests will fail when trying to querry element with such id.\n // That's why adding prefix.\n const id = 'option-' + useId(nativeId);\n const selected = Array.isArray(currentValue) ? currentValue.includes(value) : currentValue === value;\n\n const handleClick = (event: React.MouseEvent<HTMLDivElement>) => {\n if (disabled || listboxDisabled || listboxReadOnly) {\n event.stopPropagation();\n return;\n } else {\n setValue(value);\n }\n\n if (typeof props.onClick === 'function') {\n props.onClick(event);\n }\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (disabled || listboxDisabled || listboxReadOnly) {\n event.stopPropagation();\n return;\n }\n // UX requirement: if tab key is pressed and the current option is selected then keydown event is ignored\n else if (event.key === 'Tab' && selected) {\n return;\n } else if (isAriaSelectionKey(event)) {\n setValue(value);\n }\n\n if (typeof props.onKeyDown === 'function') {\n props.onKeyDown(event);\n }\n };\n\n return (\n <div\n {...otherProps}\n aria-disabled={listboxDisabled || disabled ? 'true' : undefined}\n aria-selected={selected ? 'true' : undefined}\n id={id}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n ref={ref}\n role=\"option\"\n />\n );\n});\n"],"names":["Option","React","forwardRef","Listbox2Option","props","ref","disabled","id","nativeId","title","value","otherProps","listboxDisabled","readOnly","listboxReadOnly","setValue","currentValue","useListbox2Context","useId","selected","Array","isArray","includes","handleClick","event","stopPropagation","onClick","handleKeyDown","key","isAriaSelectionKey","onKeyDown","undefined","role"],"mappings":";;;;;MAWaA,MAAM,gBAAGC,cAAK,CAACC,UAAU,CAAsC,SAASC,cAAcA,CAACC,KAAK,EAAEC,GAAG;EAC1G,MAAM;IAAEC,QAAQ;IAAEC,EAAE,EAAEC,QAAQ;IAAEC,KAAK;IAAEC,KAAK;IAAE,GAAGC;GAAY,GAAGP,KAAK;EACrE,MAAM;IAAEE,QAAQ,EAAEM,eAAe;IAAEC,QAAQ,EAAEC,eAAe;IAAEC,QAAQ;IAAEL,KAAK,EAAEM;GAAc,GAAGC,kBAAkB,EAAE;;;EAGpH,MAAMV,EAAE,GAAG,SAAS,GAAGW,KAAK,CAACV,QAAQ,CAAC;EACtC,MAAMW,QAAQ,GAAGC,KAAK,CAACC,OAAO,CAACL,YAAY,CAAC,GAAGA,YAAY,CAACM,QAAQ,CAACZ,KAAK,CAAC,GAAGM,YAAY,KAAKN,KAAK;EAEpG,MAAMa,WAAW,GAAIC,KAAuC;IACxD,IAAIlB,QAAQ,IAAIM,eAAe,IAAIE,eAAe,EAAE;MAChDU,KAAK,CAACC,eAAe,EAAE;MACvB;KACH,MAAM;MACHV,QAAQ,CAACL,KAAK,CAAC;;IAGnB,IAAI,OAAON,KAAK,CAACsB,OAAO,KAAK,UAAU,EAAE;MACrCtB,KAAK,CAACsB,OAAO,CAACF,KAAK,CAAC;;GAE3B;EAED,MAAMG,aAAa,GAAIH,KAA0C;IAC7D,IAAIlB,QAAQ,IAAIM,eAAe,IAAIE,eAAe,EAAE;MAChDU,KAAK,CAACC,eAAe,EAAE;MACvB;;;SAGC,IAAID,KAAK,CAACI,GAAG,KAAK,KAAK,IAAIT,QAAQ,EAAE;MACtC;KACH,MAAM,IAAIU,kBAAkB,CAACL,KAAK,CAAC,EAAE;MAClCT,QAAQ,CAACL,KAAK,CAAC;;IAGnB,IAAI,OAAON,KAAK,CAAC0B,SAAS,KAAK,UAAU,EAAE;MACvC1B,KAAK,CAAC0B,SAAS,CAACN,KAAK,CAAC;;GAE7B;EAED,oBACIvB,sDACQU,UAAU;qBACCC,eAAe,IAAIN,QAAQ,GAAG,MAAM,GAAGyB,SAAS;qBAChDZ,QAAQ,GAAG,MAAM,GAAGY,SAAS;IAC5CxB,EAAE,EAAEA,EAAE;IACNmB,OAAO,EAAEH,WAAW;IACpBO,SAAS,EAAEH,aAAa;IACxBtB,GAAG,EAAEA,GAAG;IACR2B,IAAI,EAAC;KACP;AAEV,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useTableFontSize.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableFontSize.ts"],"sourcesContent":["import React from 'react';\nimport { TableFontSize } from '../../types';\n\nexport function useTableFontSize(isEnabled = false, defaultFontSize: TableFontSize = 'medium') {\n const [size, setSize] = React.useState<TableFontSize>(defaultFontSize);\n\n return {\n isEnabled,\n size,\n setSize: isEnabled ? setSize : () => undefined,\n };\n}\n"],"names":["useTableFontSize","isEnabled","defaultFontSize","size","setSize","React","useState","undefined"],"mappings":";;SAGgBA,gBAAgBA,CAACC,SAAS,GAAG,KAAK,EAAEC,kBAAiC,QAAQ;EACzF,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAAgBJ,eAAe,CAAC;EAEtE,OAAO;IACHD,SAAS;IACTE,IAAI;IACJC,OAAO,EAAEH,SAAS,GAAGG,OAAO,GAAG,MAAMG;GACxC;AACL;;;;"}
1
+ {"version":3,"file":"useTableFontSize.js","sources":["../../../../../../../../../src/primitives/Table/useTable/features/useTableFontSize.ts"],"sourcesContent":["import React from 'react';\nimport { FontSize } from '../../../../types';\n\nexport function useTableFontSize(isEnabled = false, defaultFontSize: FontSize = 'medium') {\n const [size, setSize] = React.useState<FontSize>(defaultFontSize);\n\n return {\n isEnabled,\n size,\n setSize: isEnabled ? setSize : () => undefined,\n };\n}\n"],"names":["useTableFontSize","isEnabled","defaultFontSize","size","setSize","React","useState","undefined"],"mappings":";;SAGgBA,gBAAgBA,CAACC,SAAS,GAAG,KAAK,EAAEC,kBAA4B,QAAQ;EACpF,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAAWJ,eAAe,CAAC;EAEjE,OAAO;IACHD,SAAS;IACTE,IAAI;IACJC,OAAO,EAAEH,SAAS,GAAGG,OAAO,GAAG,MAAMG;GACxC;AACL;;;;"}
@@ -1,5 +1,5 @@
1
1
  import React__default from 'react';
2
- import { TableFontSizes } from '../../types.js';
2
+ import { FontSizes } from '../../../../types.js';
3
3
  import { getCellMinWidth } from '../util/columns.js';
4
4
  import { useLazyEffect } from '../../../../hooks/useLazyEffect.js';
5
5
 
@@ -21,15 +21,15 @@ function useTableFontSizeListener(table) {
21
21
  }
22
22
  function getCellWidthDifference(fontSizeKey) {
23
23
  switch (fontSizeKey) {
24
- case `${TableFontSizes.small}-${TableFontSizes.medium}`:
25
- case `${TableFontSizes.medium}-${TableFontSizes.large}`:
24
+ case `${FontSizes.small}-${FontSizes.medium}`:
25
+ case `${FontSizes.medium}-${FontSizes.large}`:
26
26
  return 8;
27
- case `${TableFontSizes.medium}-${TableFontSizes.small}`:
28
- case `${TableFontSizes.large}-${TableFontSizes.medium}`:
27
+ case `${FontSizes.medium}-${FontSizes.small}`:
28
+ case `${FontSizes.large}-${FontSizes.medium}`:
29
29
  return -8;
30
- case `${TableFontSizes.small}-${TableFontSizes.large}`:
30
+ case `${FontSizes.small}-${FontSizes.large}`:
31
31
  return 16;
32
- case `${TableFontSizes.large}-${TableFontSizes.small}`:
32
+ case `${FontSizes.large}-${FontSizes.small}`:
33
33
  return -16;
34
34
  default:
35
35
  return 0;
@@ -1 +1 @@
1
- {"version":3,"file":"useTableFontSizeListener.js","sources":["../../../../../../../../../src/primitives/Table/useTable/listeners/useTableFontSizeListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { TableFontSizes } from '../../types';\nimport { getCellMinWidth } from '../util/columns';\n\nexport function useTableFontSizeListener<TType = unknown>(table: ReactTable<TType>) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n const previousFontSizeRef = React.useRef(meta.fontSize.size);\n\n useLazyEffect(() => {\n const cellWidthDifference = getCellWidthDifference(`${previousFontSizeRef.current}-${meta.fontSize.size}`);\n\n table.setColumnSizing(sizes => {\n const minColumnSize = getCellMinWidth(meta.fontSize.size);\n\n return Object.fromEntries(\n Object.entries(sizes).map(([columnName, prevColumnSize]) => {\n // Prevents width value in the setting to go below the minColumnSize\n const newSize = Math.max(minColumnSize, prevColumnSize + cellWidthDifference);\n return [columnName, newSize];\n })\n );\n });\n previousFontSizeRef.current = meta.fontSize.size;\n }, [meta.fontSize.size]);\n}\n\nfunction getCellWidthDifference(fontSizeKey: string) {\n switch (fontSizeKey) {\n case `${TableFontSizes.small}-${TableFontSizes.medium}`:\n case `${TableFontSizes.medium}-${TableFontSizes.large}`:\n return 8;\n\n case `${TableFontSizes.medium}-${TableFontSizes.small}`:\n case `${TableFontSizes.large}-${TableFontSizes.medium}`:\n return -8;\n\n case `${TableFontSizes.small}-${TableFontSizes.large}`:\n return 16;\n\n case `${TableFontSizes.large}-${TableFontSizes.small}`:\n return -16;\n\n default:\n return 0;\n }\n}\n"],"names":["useTableFontSizeListener","table","meta","options","previousFontSizeRef","React","useRef","fontSize","size","useLazyEffect","cellWidthDifference","getCellWidthDifference","current","setColumnSizing","sizes","minColumnSize","getCellMinWidth","Object","fromEntries","entries","map","columnName","prevColumnSize","newSize","Math","max","fontSizeKey","TableFontSizes","small","medium","large"],"mappings":";;;;;SAMgBA,wBAAwBA,CAAkBC,KAAwB;EAC9E,MAAMC,IAAI,GAAGD,KAAK,CAACE,OAAO,CAACD,IAA6B;EACxD,MAAME,mBAAmB,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":3,"file":"useTableFontSizeListener.js","sources":["../../../../../../../../../src/primitives/Table/useTable/listeners/useTableFontSizeListener.ts"],"sourcesContent":["import React from 'react';\nimport { Table as ReactTable, TableMeta as ReactTableMeta } from '@tanstack/react-table';\nimport { useLazyEffect } from '../../../../hooks/useLazyEffect';\nimport { FontSizes } from '../../../../types';\nimport { getCellMinWidth } from '../util/columns';\n\nexport function useTableFontSizeListener<TType = unknown>(table: ReactTable<TType>) {\n const meta = table.options.meta as ReactTableMeta<TType>;\n const previousFontSizeRef = React.useRef(meta.fontSize.size);\n\n useLazyEffect(() => {\n const cellWidthDifference = getCellWidthDifference(`${previousFontSizeRef.current}-${meta.fontSize.size}`);\n\n table.setColumnSizing(sizes => {\n const minColumnSize = getCellMinWidth(meta.fontSize.size);\n\n return Object.fromEntries(\n Object.entries(sizes).map(([columnName, prevColumnSize]) => {\n // Prevents width value in the setting to go below the minColumnSize\n const newSize = Math.max(minColumnSize, prevColumnSize + cellWidthDifference);\n return [columnName, newSize];\n })\n );\n });\n previousFontSizeRef.current = meta.fontSize.size;\n }, [meta.fontSize.size]);\n}\n\nfunction getCellWidthDifference(fontSizeKey: string) {\n switch (fontSizeKey) {\n case `${FontSizes.small}-${FontSizes.medium}`:\n case `${FontSizes.medium}-${FontSizes.large}`:\n return 8;\n\n case `${FontSizes.medium}-${FontSizes.small}`:\n case `${FontSizes.large}-${FontSizes.medium}`:\n return -8;\n\n case `${FontSizes.small}-${FontSizes.large}`:\n return 16;\n\n case `${FontSizes.large}-${FontSizes.small}`:\n return -16;\n\n default:\n return 0;\n }\n}\n"],"names":["useTableFontSizeListener","table","meta","options","previousFontSizeRef","React","useRef","fontSize","size","useLazyEffect","cellWidthDifference","getCellWidthDifference","current","setColumnSizing","sizes","minColumnSize","getCellMinWidth","Object","fromEntries","entries","map","columnName","prevColumnSize","newSize","Math","max","fontSizeKey","FontSizes","small","medium","large"],"mappings":";;;;;SAMgBA,wBAAwBA,CAAkBC,KAAwB;EAC9E,MAAMC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xC,OAAO,CAAC,EAAE;IAEd;MACI,OAAO,CAAC;;AAEpB;;;;"}
@@ -1,14 +1,14 @@
1
- import { TableFontSizes } from '../../types.js';
1
+ import { FontSizes } from '../../../../types.js';
2
2
 
3
3
  // column widths
4
4
  const getCellMinWidth = (fontSize = 'medium') => {
5
5
  switch (fontSize) {
6
- case TableFontSizes.small:
6
+ case FontSizes.small:
7
7
  return 57;
8
- case TableFontSizes.large:
8
+ case FontSizes.large:
9
9
  return 83;
10
10
  default:
11
- case TableFontSizes.medium:
11
+ case FontSizes.medium:
12
12
  return 72;
13
13
  }
14
14
  };
@@ -1 +1 @@
1
- {"version":3,"file":"columns.js","sources":["../../../../../../../../../src/primitives/Table/useTable/util/columns.ts"],"sourcesContent":["import { ColumnDef as ReactTableColumnDef } from '@tanstack/react-table';\nimport { TableFontSize, TableFontSizes } from '../../types';\n\n// column widths\nexport const getCellMinWidth = (fontSize: TableFontSize = 'medium') => {\n switch (fontSize) {\n case TableFontSizes.small:\n return 57;\n\n case TableFontSizes.large:\n return 83;\n\n default:\n case TableFontSizes.medium:\n return 72;\n }\n};\n\n// ordering\nexport function ensureOrdering<TType = unknown>(\n columns: ReactTableColumnDef<TType>[],\n internalColumnsPinnedToTheRight: string[],\n settingsOrder: string[] | undefined\n): string[] {\n // internal columns come with a defined order\n const internalColumns = columns\n .filter(column => column.id?.startsWith('__') && !internalColumnsPinnedToTheRight.includes(column.id))\n .map(column => column.id) as string[];\n\n // columns with ordering disabled should be moved to the front\n const orderingDisabled: string[] = [];\n const orderingEnabled: string[] = [];\n\n let orderedColumns = columns;\n\n // if settings is defined, make sure the columns that are actual children are sorted by it\n if (Array.isArray(settingsOrder)) {\n orderedColumns = columns.slice().sort(\n // the magic >>> 0 here ensures that columns that aren't found in settings, but are children, are pushed to the end\n (a, b) => (settingsOrder.indexOf(a.id as string) >>> 0) - (settingsOrder.indexOf(b.id as string) >>> 0)\n );\n }\n\n orderedColumns.forEach(column => {\n if (column.id?.startsWith('__')) {\n return;\n }\n\n if (column.meta?.enableOrdering) {\n orderingEnabled.push(column.id as string);\n } else {\n orderingDisabled.push(column.id as string);\n }\n });\n\n const order = [...internalColumns, ...orderingDisabled, ...orderingEnabled];\n\n // actions should always be last, enforce that\n internalColumnsPinnedToTheRight.forEach(id => {\n if (columns.findIndex(column => column.id === id) > -1) {\n order.push(id);\n }\n });\n\n return order;\n}\n"],"names":["getCellMinWidth","fontSize","TableFontSizes","small","large","medium","ensureOrdering","columns","internalColumnsPinnedToTheRight","settingsOrder","internalColumns","filter","column","_column$id","id","startsWith","includes","map","orderingDisabled","orderingEnabled","orderedColumns","Array","isArray","slice","sort","a","b","indexOf","forEach","_column$id2","_column$meta","meta","enableOrdering","push","order","findIndex"],"mappings":";;AAGA;MACaA,eAAe,GAAGA,CAACC,WAA0B,QAAQ;EAC9D,QAAQA,QAAQ;IACZ,KAAKC,cAAc,CAACC,KAAK;MACrB,OAAO,EAAE;IAEb,KAAKD,cAAc,CAACE,KAAK;MACrB,OAAO,EAAE;IAEb;IACA,KAAKF,cAAc,CAACG,MAAM;MACtB,OAAO,EAAE;;AAErB;AAEA;SACgBC,cAAcA,CAC1BC,OAAqC,EACrCC,+BAAyC,EACzCC,aAAmC;;EAGnC,MAAMC,eAAe,GAAGH,OAAO,CAC1BI,MAAM,CAACC,MAAM;IAAA,IAAAC,UAAA;IAAA,OAAI,EAAAA,UAAA,GAAAD,MAAM,CAACE,EAAE,cAAAD,UAAA,uBAATA,UAAA,CAAWE,UAAU,CAAC,IAAI,CAAC,KAAI,CAACP,+BAA+B,CAACQ,QAAQ,CAACJ,MAAM,CAACE,EAAE,CAAC;IAAC,CACrGG,GAAG,CAACL,MAAM,IAAIA,MAAM,CAACE,EAAE,CAAa;;EAGzC,MAAMI,gBAAgB,GAAa,EAAE;EACrC,MAAMC,eAAe,GAAa,EAAE;EAEpC,IAAIC,cAAc,GAAGb,OAAO;;EAG5B,IAAIc,KAAK,CAACC,OAAO,CAACb,aAAa,CAAC,EAAE;IAC9BW,cAAc,GAAGb,OAAO,CAACgB,KAAK,EAAE,CAACC,IAAI;;IAEjC,CAACC,CAAC,EAAEC,CAAC,KAAK,CAACjB,aAAa,CAACkB,OAAO,CAACF,CAAC,CAACX,EAAY,CAAC,KAAK,CAAC,KAAKL,aAAa,CAACkB,OAAO,CAACD,CAAC,CAACZ,EAAY,CAAC,KAAK,CAAC,CAAC,CAC1G;;EAGLM,cAAc,CAACQ,OAAO,CAAChB,MAAM;;IACzB,KAAAiB,WAAA,GAAIjB,MAAM,CAACE,EAAE,cAAAe,WAAA,eAATA,WAAA,CAAWd,UAAU,CAAC,IAAI,CAAC,EAAE;MAC7B;;IAGJ,KAAAe,YAAA,GAAIlB,MAAM,CAACmB,IAAI,cAAAD,YAAA,eAAXA,YAAA,CAAaE,cAAc,EAAE;MAC7Bb,eAAe,CAACc,IAAI,CAACrB,MAAM,CAACE,EAAY,CAAC;KAC5C,MAAM;MACHI,gBAAgB,CAACe,IAAI,CAACrB,MAAM,CAACE,EAAY,CAAC;;GAEjD,CAAC;EAEF,MAAMoB,KAAK,GAAG,CAAC,GAAGxB,eAAe,EAAE,GAAGQ,gBAAgB,EAAE,GAAGC,eAAe,CAAC;;EAG3EX,+BAA+B,CAACoB,OAAO,CAACd,EAAE;IACtC,IAAIP,OAAO,CAAC4B,SAAS,CAACvB,MAAM,IAAIA,MAAM,CAACE,EAAE,KAAKA,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE;MACpDoB,KAAK,CAACD,IAAI,CAACnB,EAAE,CAAC;;GAErB,CAAC;EAEF,OAAOoB,KAAK;AAChB;;;;"}
1
+ {"version":3,"file":"columns.js","sources":["../../../../../../../../../src/primitives/Table/useTable/util/columns.ts"],"sourcesContent":["import { ColumnDef as ReactTableColumnDef } from '@tanstack/react-table';\nimport { FontSize, FontSizes } from '../../../../types';\n\n// column widths\nexport const getCellMinWidth = (fontSize: FontSize = 'medium') => {\n switch (fontSize) {\n case FontSizes.small:\n return 57;\n\n case FontSizes.large:\n return 83;\n\n default:\n case FontSizes.medium:\n return 72;\n }\n};\n\n// ordering\nexport function ensureOrdering<TType = unknown>(\n columns: ReactTableColumnDef<TType>[],\n internalColumnsPinnedToTheRight: string[],\n settingsOrder: string[] | undefined\n): string[] {\n // internal columns come with a defined order\n const internalColumns = columns\n .filter(column => column.id?.startsWith('__') && !internalColumnsPinnedToTheRight.includes(column.id))\n .map(column => column.id) as string[];\n\n // columns with ordering disabled should be moved to the front\n const orderingDisabled: string[] = [];\n const orderingEnabled: string[] = [];\n\n let orderedColumns = columns;\n\n // if settings is defined, make sure the columns that are actual children are sorted by it\n if (Array.isArray(settingsOrder)) {\n orderedColumns = columns.slice().sort(\n // the magic >>> 0 here ensures that columns that aren't found in settings, but are children, are pushed to the end\n (a, b) => (settingsOrder.indexOf(a.id as string) >>> 0) - (settingsOrder.indexOf(b.id as string) >>> 0)\n );\n }\n\n orderedColumns.forEach(column => {\n if (column.id?.startsWith('__')) {\n return;\n }\n\n if (column.meta?.enableOrdering) {\n orderingEnabled.push(column.id as string);\n } else {\n orderingDisabled.push(column.id as string);\n }\n });\n\n const order = [...internalColumns, ...orderingDisabled, ...orderingEnabled];\n\n // actions should always be last, enforce that\n internalColumnsPinnedToTheRight.forEach(id => {\n if (columns.findIndex(column => column.id === id) > -1) {\n order.push(id);\n }\n });\n\n return order;\n}\n"],"names":["getCellMinWidth","fontSize","FontSizes","small","large","medium","ensureOrdering","columns","internalColumnsPinnedToTheRight","settingsOrder","internalColumns","filter","column","_column$id","id","startsWith","includes","map","orderingDisabled","orderingEnabled","orderedColumns","Array","isArray","slice","sort","a","b","indexOf","forEach","_column$id2","_column$meta","meta","enableOrdering","push","order","findIndex"],"mappings":";;AAGA;MACaA,eAAe,GAAGA,CAACC,WAAqB,QAAQ;EACzD,QAAQA,QAAQ;IACZ,KAAKC,SAAS,CAACC,KAAK;MAChB,OAAO,EAAE;IAEb,KAAKD,SAAS,CAACE,KAAK;MAChB,OAAO,EAAE;IAEb;IAC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AEjD,CAAC;EAEF,MAAMoB,KAAK,GAAG,CAAC,GAAGxB,eAAe,EAAE,GAAGQ,gBAAgB,EAAE,GAAGC,eAAe,CAAC;;EAG3EX,+BAA+B,CAACoB,OAAO,CAACd,EAAE;IACtC,IAAIP,OAAO,CAAC4B,SAAS,CAACvB,MAAM,IAAIA,MAAM,CAACE,EAAE,KAAKA,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE;MACpDoB,KAAK,CAACD,IAAI,CAACnB,EAAE,CAAC;;GAErB,CAAC;EAEF,OAAOoB,KAAK;AAChB;;;;"}
@@ -1,6 +1,12 @@
1
1
  import React__default from 'react';
2
2
 
3
+ var FontSizes;
4
+ (function (FontSizes) {
5
+ FontSizes["small"] = "small";
6
+ FontSizes["medium"] = "medium";
7
+ FontSizes["large"] = "large";
8
+ })(FontSizes || (FontSizes = {}));
3
9
  const fixedForwardRef = React__default.forwardRef;
4
10
 
5
- export { fixedForwardRef };
11
+ export { FontSizes, fixedForwardRef };
6
12
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../../../src/types.ts"],"sourcesContent":["import React from 'react';\nimport { AVAILABLE_COLORS } from './utils/tailwind';\n\nexport type Appearance = 'default' | 'primary' | 'danger' | 'ghost' | 'discrete' | 'transparent';\nexport type State = 'default' | 'success' | 'error' | 'warning' | 'information';\nexport type Locale = 'en-GB' | 'da-DK' | 'sv-SE' | 'no-NO';\nexport type Orientation = 'horizontal' | 'vertical';\nexport type Align = 'start' | 'center' | 'end';\nexport type Placement = 'right' | 'left' | 'top' | 'bottom';\nexport type Color = (typeof AVAILABLE_COLORS)[number];\n\n// helpers\ntype FixedForwardRef = <T, P = {}>(\n render: (props: P, ref: React.Ref<T>) => JSX.Element\n) => (props: P & React.RefAttributes<T>) => JSX.Element;\n\nexport const fixedForwardRef = React.forwardRef as FixedForwardRef;\n\nexport type ValueOf<T> = T[keyof T];\n"],"names":["fixedForwardRef","React","forwardRef"],"mappings":";;MAgBaA,eAAe,GAAGC,cAAK,CAACC;;;;"}
1
+ {"version":3,"file":"types.js","sources":["../../../../../src/types.ts"],"sourcesContent":["import React from 'react';\nimport { AVAILABLE_COLORS } from './utils/tailwind';\n\nexport type Appearance = 'default' | 'primary' | 'danger' | 'ghost' | 'discrete' | 'transparent';\nexport type State = 'default' | 'success' | 'error' | 'warning' | 'information';\nexport type Locale = 'en-GB' | 'da-DK' | 'sv-SE' | 'no-NO';\nexport type Orientation = 'horizontal' | 'vertical';\nexport type Align = 'start' | 'center' | 'end';\nexport type Placement = 'right' | 'left' | 'top' | 'bottom';\nexport type Color = (typeof AVAILABLE_COLORS)[number];\n\nexport enum FontSizes {\n small = 'small',\n medium = 'medium',\n large = 'large',\n}\nexport type FontSize = keyof typeof FontSizes;\n\n// helpers\ntype FixedForwardRef = <T, P = {}>(\n render: (props: P, ref: React.Ref<T>) => JSX.Element\n) => (props: P & React.RefAttributes<T>) => JSX.Element;\n\nexport const fixedForwardRef = React.forwardRef as FixedForwardRef;\n\nexport type ValueOf<T> = T[keyof T];\n"],"names":["FontSizes","fixedForwardRef","React","forwardRef"],"mappings":";;IAWYA;AAAZ,WAAYA,SAAS;EACjBA,4BAAe;EACfA,8BAAiB;EACjBA,4BAAe;AACnB,CAAC,EAJWA,SAAS,KAATA,SAAS;MAYRC,eAAe,GAAGC,cAAK,CAACC;;;;"}
@@ -13,6 +13,18 @@ const getIndexOfFirstChildOverflowingParent = (element, overscan = 0) => {
13
13
  }
14
14
  return boundaryChildIndex;
15
15
  };
16
+ const getNextFocussableElement = currentElement => {
17
+ if (!currentElement) {
18
+ return null;
19
+ }
20
+ const focussableElements = [...document.querySelectorAll('button:not([disabled]), [href]:not(link):not(script), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)')];
21
+ const currentElementIndex = focussableElements.indexOf(currentElement);
22
+ // If the currentElement is not in the focussable elements list or it is the last element
23
+ if (currentElementIndex !== -1 && currentElementIndex === focussableElements.length - 1) {
24
+ return null;
25
+ }
26
+ return focussableElements[currentElementIndex + 1];
27
+ };
16
28
 
17
- export { getIndexOfFirstChildOverflowingParent };
29
+ export { getIndexOfFirstChildOverflowingParent, getNextFocussableElement };
18
30
  //# sourceMappingURL=dom.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dom.js","sources":["../../../../../../src/utils/dom.ts"],"sourcesContent":["export const isOverflowing = (element: HTMLElement | null) =>\n element !== null ? element.scrollWidth > element.offsetWidth : false;\n\nexport const getIndexOfFirstChildOverflowingParent = (element: HTMLElement, overscan = 0) => {\n let index = 0;\n let boundaryChildIndex: number | null = null;\n const clientRect = element.getBoundingClientRect();\n\n for (const child of Array.from(element.children)) {\n const right = child.getBoundingClientRect().right - clientRect.left;\n const width = clientRect.width - overscan;\n\n if (right > width) {\n boundaryChildIndex = index;\n break;\n }\n index++;\n }\n\n return boundaryChildIndex;\n};\n"],"names":["getIndexOfFirstChildOverflowingParent","element","overscan","index","boundaryChildIndex","clientRect","getBoundingClientRect","child","Array","from","children","right","left","width"],"mappings":"MAGaA,qCAAqC,GAAGA,CAACC,OAAoB,EAAEC,QAAQ,GAAG,CAAC;EACpF,IAAIC,KAAK,GAAG,CAAC;EACb,IAAIC,kBAAkB,GAAkB,IAAI;EAC5C,MAAMC,UAAU,GAAGJ,OAAO,CAACK,qBAAqB,EAAE;EAElD,KAAK,MAAMC,KAAK,IAAIC,KAAK,CAACC,IAAI,CAACR,OAAO,CAACS,QAAQ,CAAC,EAAE;IAC9C,MAAMC,KAAK,GAAGJ,KAAK,CAACD,qBAAqB,EAAE,CAACK,KAAK,GAAGN,UAAU,CAACO,IAAI;IACnE,MAAMC,KAAK,GAAGR,UAAU,CAACQ,KAAK,GAAGX,QAAQ;IAEzC,IAAIS,KAAK,GAAGE,KAAK,EAAE;MACfT,kBAAkB,GAAGD,KAAK;MAC1B;;IAEJA,KAAK,EAAE;;EAGX,OAAOC,kBAAkB;AAC7B;;;;"}
1
+ {"version":3,"file":"dom.js","sources":["../../../../../../src/utils/dom.ts"],"sourcesContent":["export const isOverflowing = (element: HTMLElement | null) =>\n element !== null ? element.scrollWidth > element.offsetWidth : false;\n\nexport const getIndexOfFirstChildOverflowingParent = (element: HTMLElement, overscan = 0) => {\n let index = 0;\n let boundaryChildIndex: number | null = null;\n const clientRect = element.getBoundingClientRect();\n\n for (const child of Array.from(element.children)) {\n const right = child.getBoundingClientRect().right - clientRect.left;\n const width = clientRect.width - overscan;\n\n if (right > width) {\n boundaryChildIndex = index;\n break;\n }\n index++;\n }\n\n return boundaryChildIndex;\n};\n\nexport const getNextFocussableElement = (currentElement: HTMLElement | null) => {\n if (!currentElement) {\n return null;\n }\n\n const focussableElements = [\n ...document.querySelectorAll<HTMLElement>(\n 'button:not([disabled]), [href]:not(link):not(script), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"]):not([disabled]), details:not([disabled]), summary:not(:disabled)'\n ),\n ];\n const currentElementIndex = focussableElements.indexOf(currentElement);\n\n // If the currentElement is not in the focussable elements list or it is the last element\n if (currentElementIndex !== -1 && currentElementIndex === focussableElements.length - 1) {\n return null;\n }\n\n return focussableElements[currentElementIndex + 1];\n};\n"],"names":["getIndexOfFirstChildOverflowingParent","element","overscan","index","boundaryChildIndex","clientRect","getBoundingClientRect","child","Array","from","children","right","left","width","getNextFocussableElement","currentElement","focussableElements","document","querySelectorAll","currentElementIndex","indexOf","length"],"mappings":"MAGaA,qCAAqC,GAAGA,CAACC,OAAoB,EAAEC,QAAQ,GAAG,CAAC;EACpF,IAAIC,KAAK,GAAG,CAAC;EACb,IAAIC,kBAAkB,GAAkB,IAAI;EAC5C,MAAMC,UAAU,GAAGJ,OAAO,CAACK,qBAAqB,EAAE;EAElD,KAAK,MAAMC,KAAK,IAAIC,KAAK,CAACC,IAAI,CAACR,OAAO,CAACS,QAAQ,CAAC,EAAE;IAC9C,MAAMC,KAAK,GAAGJ,KAAK,CAACD,qBAAqB,EAAE,CAACK,KAAK,GAAGN,UAAU,CAACO,IAAI;IACnE,MAAMC,KAAK,GAAGR,UAAU,CAACQ,KAAK,GAAGX,QAAQ;IAEzC,IAAIS,KAAK,GAAGE,KAAK,EAAE;MACfT,kBAAkB,GAAGD,KAAK;MAC1B;;IAEJA,KAAK,EAAE;;EAGX,OAAOC,kBAAkB;AAC7B;MAEaU,wBAAwB,GAAIC,cAAkC;EACvE,IAAI,CAACA,cAAc,EAAE;IACjB,OAAO,IAAI;;EAGf,MAAMC,kBAAkB,GAAG,CACvB,GAAGC,QAAQ,CAACC,gBAAgB,CACxB,iOAAiO,CACpO,CACJ;EACD,MAAMC,mBAAmB,GAAGH,kBAAkB,CAACI,OAAO,CAACL,cAAc,CAAC;;EAGtE,IAAII,mBAAmB,KAAK,CAAC,CAAC,IAAIA,mBAAmB,KAAKH,kBAAkB,CAACK,MAAM,GAAG,CAAC,EAAE;IACrF,OAAO,IAAI;;EAGf,OAAOL,kBAAkB,CAACG,mBAAmB,GAAG,CAAC,CAAC;AACtD;;;;"}
package/dist/index.css CHANGED
@@ -895,17 +895,17 @@
895
895
  @apply !my-0;
896
896
  }
897
897
 
898
- /* When cell is editable, but not highlighted, then we apply cell padding to a cell itself */
898
+ /* When cell is editable, but not highlighted, then we apply cell padding to a cell itself and remove 1px border-width */
899
899
 
900
900
  [data-font-size='small'] [role='cell'][data-editable]:not([data-highlighted='true']) {
901
- @apply px-[calc(var(--table3-cell-padding-x)_-_6px)];
901
+ @apply px-[calc(var(--table3-cell-padding-x)_-_6px_-_1px)];
902
902
  }
903
903
 
904
- /* When cell is editable and highlighted, the padding should apply to highlight wrapper,
904
+ /* When cell is editable and highlighted, the padding should apply to highlight wrapper and remove 1px border-width,
905
905
  because it should take all the available space in the cell */
906
906
 
907
907
  [data-font-size='small'] [role='cell'][data-editable][data-highlighted='true'] [data-taco='highlight'] {
908
- @apply px-[calc(var(--table3-cell-padding-x)_-_6px)];
908
+ @apply px-[calc(var(--table3-cell-padding-x)_-_6px_-_1px)];
909
909
  }
910
910
 
911
911
  [data-font-size='small'] [role='cell'][data-editable] [data-taco='checkbox'],
@@ -934,17 +934,17 @@
934
934
  @apply !-my-[5px];
935
935
  }
936
936
 
937
- /* When cell is editable, but not highlighted, then we apply cell padding to a cell itself */
937
+ /* When cell is editable, but not highlighted, then we apply cell padding to a cell itself and remove 1px border-width */
938
938
 
939
939
  [data-font-size='medium'] [role='cell'][data-editable]:not([data-highlighted='true']) {
940
- @apply px-[calc(var(--table3-cell-padding-x)_-_8px)];
940
+ @apply px-[calc(var(--table3-cell-padding-x)_-_8px_-_1px)];
941
941
  }
942
942
 
943
- /* When cell is editable and highlighted, the padding should apply to highlight wrapper,
943
+ /* When cell is editable and highlighted, the padding should apply to highlight wrapper and remove 1px border-width,
944
944
  because it should take all the available space in the cell */
945
945
 
946
946
  [data-font-size='medium'] [role='cell'][data-editable][data-highlighted='true'] [data-taco='highlight'] {
947
- @apply px-[calc(var(--table3-cell-padding-x)_-_8px)];
947
+ @apply px-[calc(var(--table3-cell-padding-x)_-_8px_-_1px)];
948
948
  }
949
949
 
950
950
  [data-font-size='medium'] [role='cell'][data-editable] [data-taco='checkbox'],
@@ -1003,17 +1003,17 @@
1003
1003
  @apply !h-6 !w-6;
1004
1004
  }
1005
1005
 
1006
- /* When cell is editable, but not highlighted, then we apply cell padding to a cell itself */
1006
+ /* When cell is editable, but not highlighted, then we apply cell padding to a cell itself and remove 1px border-width */
1007
1007
 
1008
1008
  [data-font-size='large'] [role='cell'][data-editable]:not([data-highlighted='true']) {
1009
- @apply px-[calc(var(--table3-cell-padding-x)_-_10px)];
1009
+ @apply px-[calc(var(--table3-cell-padding-x)_-_10px_-_1px)];
1010
1010
  }
1011
1011
 
1012
- /* When cell is editable and highlighted, the padding should apply to highlight wrapper,
1012
+ /* When cell is editable and highlighted, the padding should apply to highlight wrapper and remove 1px border-width,
1013
1013
  because it should take all the available space in the cell */
1014
1014
 
1015
1015
  [data-font-size='large'] [role='cell'][data-editable][data-highlighted='true'] [data-taco='highlight'] {
1016
- @apply px-[calc(var(--table3-cell-padding-x)_-_10px)];
1016
+ @apply px-[calc(var(--table3-cell-padding-x)_-_10px_-_1px)];
1017
1017
  }
1018
1018
 
1019
1019
  [data-font-size='large'] [role='cell'][data-editable] [data-taco='checkbox'],
@@ -7,12 +7,6 @@ export declare type TableRef = HTMLDivElement & {
7
7
  resetSorting: () => void;
8
8
  };
9
9
  };
10
- export declare enum TableFontSizes {
11
- small = "small",
12
- medium = "medium",
13
- large = "large"
14
- }
15
- export declare type TableFontSize = keyof typeof TableFontSizes;
16
10
  export declare type TableColumnFilter = ReactTableColumnFilter;
17
11
  export declare type TableColumnSort = ReactTableColumnSort;
18
12
  export declare type TableRowClickHandler<TType = unknown> = (row: TType) => void;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { TableFontSize } from '../../types';
3
- export declare function useTableFontSize(isEnabled?: boolean, defaultFontSize?: TableFontSize): {
2
+ import { FontSize } from '../../../../types';
3
+ export declare function useTableFontSize(isEnabled?: boolean, defaultFontSize?: FontSize): {
4
4
  isEnabled: boolean;
5
5
  size: "small" | "medium" | "large";
6
6
  setSize: React.Dispatch<React.SetStateAction<"small" | "medium" | "large">>;
@@ -1,4 +1,4 @@
1
1
  import { ColumnDef as ReactTableColumnDef } from '@tanstack/react-table';
2
- import { TableFontSize } from '../../types';
3
- export declare const getCellMinWidth: (fontSize?: TableFontSize) => 57 | 83 | 72;
2
+ import { FontSize } from '../../../../types';
3
+ export declare const getCellMinWidth: (fontSize?: FontSize) => 57 | 83 | 72;
4
4
  export declare function ensureOrdering<TType = unknown>(columns: ReactTableColumnDef<TType>[], internalColumnsPinnedToTheRight: string[], settingsOrder: string[] | undefined): string[];