@invopop/popui 0.1.41 → 0.1.42

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.
@@ -3,7 +3,7 @@
3
3
  import type { TableSortBy, DrawerOption, BaseTableHeaderOrderByProps } from './types.js'
4
4
  import DrawerContext from './DrawerContext.svelte'
5
5
 
6
- let { isActive = false, sortDirection, onOrderBy, onHide, onFilter, onFreeze, isFrozen = false, showSortOptions = true, showFilterOption = true }: BaseTableHeaderOrderByProps = $props()
6
+ let { isActive = false, sortDirection, onOrderBy, onHide, onFilter, onFreeze, isFrozen = false, showSortOptions = true, showFilterOption = true, showHideOption = true }: BaseTableHeaderOrderByProps = $props()
7
7
 
8
8
  let items = $derived([
9
9
  ...(showSortOptions ? [
@@ -26,8 +26,10 @@
26
26
  { label: '', value: 'sep-2', separator: true }
27
27
  ] : []),
28
28
  { icon: Lock, label: isFrozen ? 'Unfreeze column' : 'Freeze column', value: 'freeze' },
29
- { label: '', value: 'sep-3', separator: true },
30
- { icon: Preview, label: 'Hide column', value: 'hide' }
29
+ ...(showHideOption ? [
30
+ { label: '', value: 'sep-3', separator: true },
31
+ { icon: Preview, label: 'Hide column', value: 'hide' }
32
+ ] : [])
31
33
  ] as DrawerOption[])
32
34
  </script>
33
35
 
@@ -126,6 +126,7 @@
126
126
  isFrozen={frozenColumns.has(column.id)}
127
127
  showSortOptions={column.getCanSort()}
128
128
  showFilterOption={!column.columnDef.meta?.disableColumnFilter}
129
+ showHideOption={column.getCanHide()}
129
130
  onOrderBy={(direction) => {
130
131
  column.toggleSorting(direction === 'desc')
131
132
  if (onSortingChange) {
package/dist/types.d.ts CHANGED
@@ -240,6 +240,7 @@ export interface BaseTableHeaderOrderByProps {
240
240
  isFrozen?: boolean;
241
241
  showSortOptions?: boolean;
242
242
  showFilterOption?: boolean;
243
+ showHideOption?: boolean;
243
244
  }
244
245
  export interface BreadcrumbProps {
245
246
  breadcrumb: Breadcrumb;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@invopop/popui",
3
3
  "license": "MIT",
4
- "version": "0.1.41",
4
+ "version": "0.1.42",
5
5
  "repository": {
6
6
  "url": "https://github.com/invopop/popui"
7
7
  },