@pathscale/ui 0.0.94 → 0.0.96

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.
@@ -36,6 +36,10 @@ export type EnhancedTableProps<TData> = Omit<TableProps, "children"> & {
36
36
  collapseIcon?: JSX.Element;
37
37
  filterPanelClass?: string;
38
38
  paginationPosition?: "bottomLeft" | "bottomCenter" | "bottomRight";
39
+ firstPageIcon?: JSX.Element;
40
+ prevPageIcon?: JSX.Element;
41
+ nextPageIcon?: JSX.Element;
42
+ lastPageIcon?: JSX.Element;
39
43
  };
40
44
  declare function EnhancedTable<TData>(props: EnhancedTableProps<TData>): JSX.Element;
41
45
  export default EnhancedTable;
package/dist/index.js CHANGED
@@ -11285,7 +11285,7 @@ const table_Table = Object.assign(Table, {
11285
11285
  Cell: TableCell,
11286
11286
  HeadCell: table_TableHeadCell
11287
11287
  });
11288
- var EnhancedTable_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<span class="cursor-pointer ml-auto">'), EnhancedTable_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div><div class=mb-2></div><div class="flex gap-2 justify-end">'), EnhancedTable_tmpl$3 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<option value=10>10"), EnhancedTable_tmpl$4 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<option value=25>25"), EnhancedTable_tmpl$5 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<option value=50>50"), EnhancedTable_tmpl$6 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<option value=100>100"), EnhancedTable_tmpl$7 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div><div class="flex items-center gap-2"><span class=opacity-70>Rows per page</span></div><div class="flex items-center gap-3 ml-4"><span class=opacity-70>Page <!> of</span><div class=join>'), EnhancedTable_tmpl$8 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div class="flex items-center gap-2"><div class=truncate></div><div class=grow>'), EnhancedTable_tmpl$9 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div class="flex gap-2">'), EnhancedTable_tmpl$0 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<option value>All"), EnhancedTable_tmpl$1 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<option>");
11288
+ var EnhancedTable_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<span class="cursor-pointer ml-auto">'), EnhancedTable_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div><div class=mb-2></div><div class="flex gap-2 justify-end">'), EnhancedTable_tmpl$3 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div><div class="flex items-center gap-2"><span class=opacity-70>Rows per page</span></div><div class="flex items-center gap-3 ml-4"><span class=opacity-70>Page <!> of </span><div class=join>'), EnhancedTable_tmpl$4 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div class="flex items-center gap-2"><div class=truncate></div><div class=grow>'), EnhancedTable_tmpl$5 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div class="flex gap-2">');
11289
11289
  function EnhancedTable_EnhancedTable(props) {
11290
11290
  const [local, tableProps] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
11291
11291
  "data",
@@ -11317,7 +11317,11 @@ function EnhancedTable_EnhancedTable(props) {
11317
11317
  "expandIcon",
11318
11318
  "collapseIcon",
11319
11319
  "filterPanelClass",
11320
- "paginationPosition"
11320
+ "paginationPosition",
11321
+ "firstPageIcon",
11322
+ "prevPageIcon",
11323
+ "nextPageIcon",
11324
+ "lastPageIcon"
11321
11325
  ]);
11322
11326
  const [openFilterFor, setOpenFilterFor] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(null);
11323
11327
  const table = (0, __WEBPACK_EXTERNAL_MODULE__tanstack_solid_table_1239d047__.createSolidTable)({
@@ -11374,6 +11378,13 @@ function EnhancedTable_EnhancedTable(props) {
11374
11378
  if (0 === rows.length && local.renderEmpty) return [];
11375
11379
  return rows;
11376
11380
  });
11381
+ const shouldShowPagination = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>{
11382
+ if (!local.enablePagination) return false;
11383
+ const pageCount = table.getPageCount();
11384
+ const pageSize = table.getState().pagination.pageSize;
11385
+ const totalRows = table.getCoreRowModel().rows.length;
11386
+ return pageCount > 1 || totalRows > pageSize;
11387
+ });
11377
11388
  const headerGroups = ()=>table.getHeaderGroups();
11378
11389
  const FilterIconTrigger = (props)=>(()=>{
11379
11390
  var _el$ = EnhancedTable_tmpl$();
@@ -11486,33 +11497,33 @@ function EnhancedTable_EnhancedTable(props) {
11486
11497
  return canSort ? header.column.getToggleSortingHandler() : void 0;
11487
11498
  },
11488
11499
  get children () {
11489
- var _el$16 = EnhancedTable_tmpl$8(), _el$17 = _el$16.firstChild, _el$18 = _el$17.nextSibling;
11490
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$17, ()=>(0, __WEBPACK_EXTERNAL_MODULE__tanstack_solid_table_1239d047__.flexRender)(header.column.columnDef.header, header.getContext()));
11491
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$16, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
11500
+ var _el$13 = EnhancedTable_tmpl$4(), _el$14 = _el$13.firstChild, _el$15 = _el$14.nextSibling;
11501
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$14, ()=>(0, __WEBPACK_EXTERNAL_MODULE__tanstack_solid_table_1239d047__.flexRender)(header.column.columnDef.header, header.getContext()));
11502
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$13, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
11492
11503
  get when () {
11493
11504
  return "asc" === header.column.getIsSorted();
11494
11505
  },
11495
11506
  get children () {
11496
11507
  return local.sortAscIcon;
11497
11508
  }
11498
- }), _el$18);
11499
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$16, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
11509
+ }), _el$15);
11510
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$13, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
11500
11511
  get when () {
11501
11512
  return "desc" === header.column.getIsSorted();
11502
11513
  },
11503
11514
  get children () {
11504
11515
  return local.sortDescIcon;
11505
11516
  }
11506
- }), _el$18);
11507
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$16, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
11517
+ }), _el$15);
11518
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$13, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
11508
11519
  get when () {
11509
11520
  return canSort && false === header.column.getIsSorted() && local.sortNeutralIcon;
11510
11521
  },
11511
11522
  get children () {
11512
11523
  return local.sortNeutralIcon;
11513
11524
  }
11514
- }), _el$18);
11515
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$16, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
11525
+ }), _el$15);
11526
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$13, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
11516
11527
  when: canFilter,
11517
11528
  get children () {
11518
11529
  return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(FilterIconTrigger, {
@@ -11520,7 +11531,7 @@ function EnhancedTable_EnhancedTable(props) {
11520
11531
  });
11521
11532
  }
11522
11533
  }), null);
11523
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$16, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
11534
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$13, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
11524
11535
  when: canFilter,
11525
11536
  get children () {
11526
11537
  return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(FilterPanel, {
@@ -11530,7 +11541,7 @@ function EnhancedTable_EnhancedTable(props) {
11530
11541
  });
11531
11542
  }
11532
11543
  }), null);
11533
- return _el$16;
11544
+ return _el$13;
11534
11545
  }
11535
11546
  });
11536
11547
  }
@@ -11660,66 +11671,128 @@ function EnhancedTable_EnhancedTable(props) {
11660
11671
  });
11661
11672
  }
11662
11673
  }),
11663
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table.Footer, {
11664
- noCell: true,
11674
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
11675
+ get when () {
11676
+ return shouldShowPagination();
11677
+ },
11665
11678
  get children () {
11666
- return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table.Row, {
11679
+ return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table.Footer, {
11680
+ noCell: true,
11667
11681
  get children () {
11668
- return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table.Cell, {
11669
- colSpan: totalColumns,
11682
+ return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table.Row, {
11670
11683
  get children () {
11671
- var _el$5 = EnhancedTable_tmpl$7(), _el$6 = _el$5.firstChild, _el$10 = (_el$6.firstChild, _el$6.nextSibling), _el$11 = _el$10.firstChild, _el$12 = _el$11.firstChild, _el$14 = _el$12.nextSibling, _el$15 = (_el$14.nextSibling, _el$11.nextSibling);
11672
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$6, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(select_Select, {
11673
- size: "sm",
11674
- get value () {
11675
- return String(table.getState().pagination.pageSize);
11676
- },
11677
- onChange: (e)=>table.setPageSize(Number(e.currentTarget.value)),
11684
+ return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table.Cell, {
11685
+ colSpan: totalColumns,
11678
11686
  get children () {
11679
- return [
11680
- EnhancedTable_tmpl$3(),
11681
- EnhancedTable_tmpl$4(),
11682
- EnhancedTable_tmpl$5(),
11683
- EnhancedTable_tmpl$6()
11684
- ];
11687
+ var _el$5 = EnhancedTable_tmpl$3(), _el$6 = _el$5.firstChild, _el$8 = (_el$6.firstChild, _el$6.nextSibling), _el$9 = _el$8.firstChild, _el$0 = _el$9.firstChild, _el$11 = _el$0.nextSibling, _el$12 = (_el$11.nextSibling, _el$9.nextSibling);
11688
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$6, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(dropdown_Dropdown, {
11689
+ class: "dropdown-end",
11690
+ get children () {
11691
+ return [
11692
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(dropdown_Dropdown.Toggle, {
11693
+ button: true,
11694
+ size: "sm",
11695
+ color: "neutral",
11696
+ get children () {
11697
+ return table.getState().pagination.pageSize;
11698
+ }
11699
+ }),
11700
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(dropdown_Dropdown.Menu, {
11701
+ class: "w-24",
11702
+ get children () {
11703
+ return [
11704
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(dropdown_Dropdown.Item, {
11705
+ onClick: ()=>table.setPageSize(10),
11706
+ get ["aria-selected"] () {
11707
+ return 10 === table.getState().pagination.pageSize;
11708
+ },
11709
+ get ["class"] () {
11710
+ return dist_clsx(10 === table.getState().pagination.pageSize && "active");
11711
+ },
11712
+ children: "10"
11713
+ }),
11714
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(dropdown_Dropdown.Item, {
11715
+ onClick: ()=>table.setPageSize(25),
11716
+ get ["aria-selected"] () {
11717
+ return 25 === table.getState().pagination.pageSize;
11718
+ },
11719
+ get ["class"] () {
11720
+ return dist_clsx(25 === table.getState().pagination.pageSize && "active");
11721
+ },
11722
+ children: "25"
11723
+ }),
11724
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(dropdown_Dropdown.Item, {
11725
+ onClick: ()=>table.setPageSize(50),
11726
+ get ["aria-selected"] () {
11727
+ return 50 === table.getState().pagination.pageSize;
11728
+ },
11729
+ get ["class"] () {
11730
+ return dist_clsx(50 === table.getState().pagination.pageSize && "active");
11731
+ },
11732
+ children: "50"
11733
+ }),
11734
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(dropdown_Dropdown.Item, {
11735
+ onClick: ()=>table.setPageSize(100),
11736
+ get ["aria-selected"] () {
11737
+ return 100 === table.getState().pagination.pageSize;
11738
+ },
11739
+ get ["class"] () {
11740
+ return dist_clsx(100 === table.getState().pagination.pageSize && "active");
11741
+ },
11742
+ children: "100"
11743
+ })
11744
+ ];
11745
+ }
11746
+ })
11747
+ ];
11748
+ }
11749
+ }), null);
11750
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$9, ()=>table.getState().pagination.pageIndex + 1, _el$11);
11751
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$9, ()=>table.getPageCount() || 1, null);
11752
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$12, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(button_Button, {
11753
+ size: "sm",
11754
+ get disabled () {
11755
+ return !table.getCanPreviousPage();
11756
+ },
11757
+ onClick: ()=>table.setPageIndex(0),
11758
+ get children () {
11759
+ return local.firstPageIcon ?? "|<<";
11760
+ }
11761
+ }), null);
11762
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$12, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(button_Button, {
11763
+ size: "sm",
11764
+ get disabled () {
11765
+ return !table.getCanPreviousPage();
11766
+ },
11767
+ onClick: ()=>table.previousPage(),
11768
+ get children () {
11769
+ return local.prevPageIcon ?? "<<";
11770
+ }
11771
+ }), null);
11772
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$12, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(button_Button, {
11773
+ size: "sm",
11774
+ get disabled () {
11775
+ return !table.getCanNextPage();
11776
+ },
11777
+ onClick: ()=>table.nextPage(),
11778
+ get children () {
11779
+ return local.nextPageIcon ?? ">>";
11780
+ }
11781
+ }), null);
11782
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$12, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(button_Button, {
11783
+ size: "sm",
11784
+ get disabled () {
11785
+ return !table.getCanNextPage();
11786
+ },
11787
+ onClick: ()=>table.setPageIndex(table.getPageCount() - 1),
11788
+ get children () {
11789
+ return local.lastPageIcon ?? ">>|";
11790
+ }
11791
+ }), null);
11792
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)(()=>(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$5, dist_clsx("flex items-center w-full", "bottomLeft" === local.paginationPosition && "justify-start", "bottomCenter" === local.paginationPosition && "justify-center", "bottomRight" === local.paginationPosition && "justify-end")));
11793
+ return _el$5;
11685
11794
  }
11686
- }), null);
11687
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$11, ()=>table.getState().pagination.pageIndex + 1, _el$14);
11688
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$11, ()=>table.getPageCount() || 1, null);
11689
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$15, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(button_Button, {
11690
- size: "sm",
11691
- get disabled () {
11692
- return !table.getCanPreviousPage();
11693
- },
11694
- onClick: ()=>table.setPageIndex(0),
11695
- children: "|<<"
11696
- }), null);
11697
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$15, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(button_Button, {
11698
- size: "sm",
11699
- get disabled () {
11700
- return !table.getCanPreviousPage();
11701
- },
11702
- onClick: ()=>table.previousPage(),
11703
- children: "Prev"
11704
- }), null);
11705
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$15, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(button_Button, {
11706
- size: "sm",
11707
- get disabled () {
11708
- return !table.getCanNextPage();
11709
- },
11710
- onClick: ()=>table.nextPage(),
11711
- children: "Next"
11712
- }), null);
11713
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$15, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(button_Button, {
11714
- size: "sm",
11715
- get disabled () {
11716
- return !table.getCanNextPage();
11717
- },
11718
- onClick: ()=>table.setPageIndex(table.getPageCount() - 1),
11719
- children: ">>|"
11720
- }), null);
11721
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)(()=>(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$5, dist_clsx("flex items-center w-full", "bottomLeft" === local.paginationPosition && "justify-start", "bottomCenter" === local.paginationPosition && "justify-center", "bottomRight" === local.paginationPosition && "justify-end")));
11722
- return _el$5;
11795
+ });
11723
11796
  }
11724
11797
  });
11725
11798
  }
@@ -11755,8 +11828,8 @@ function ColumnFilter(props) {
11755
11828
  ]);
11756
11829
  };
11757
11830
  return (()=>{
11758
- var _el$19 = EnhancedTable_tmpl$9();
11759
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$19, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(input_Input, {
11831
+ var _el$16 = EnhancedTable_tmpl$5();
11832
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$16, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(input_Input, {
11760
11833
  size: "sm",
11761
11834
  type: "number",
11762
11835
  placeholder: "Min",
@@ -11765,7 +11838,7 @@ function ColumnFilter(props) {
11765
11838
  },
11766
11839
  onInput: (e)=>setRange(e.currentTarget.value, v[1])
11767
11840
  }), null);
11768
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$19, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(input_Input, {
11841
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$16, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(input_Input, {
11769
11842
  size: "sm",
11770
11843
  type: "number",
11771
11844
  placeholder: "Max",
@@ -11774,28 +11847,62 @@ function ColumnFilter(props) {
11774
11847
  },
11775
11848
  onInput: (e)=>setRange(v[0], e.currentTarget.value)
11776
11849
  }), null);
11777
- return _el$19;
11850
+ return _el$16;
11778
11851
  })();
11779
11852
  }
11780
11853
  if ("select" === type) {
11781
11854
  const options = col.columnDef.meta?.options ?? [];
11782
- return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(select_Select, {
11783
- size: "sm",
11784
- get value () {
11785
- return value() ?? "";
11786
- },
11787
- onChange: (e)=>col.setFilterValue(e.currentTarget.value || void 0),
11855
+ const currentValue = ()=>value() ?? "";
11856
+ const currentLabel = ()=>{
11857
+ if (!currentValue()) return "All";
11858
+ return options.find((o)=>o.value === currentValue())?.label ?? "All";
11859
+ };
11860
+ const handleSelect = (val)=>{
11861
+ col.setFilterValue(val || void 0);
11862
+ };
11863
+ return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(dropdown_Dropdown, {
11864
+ class: "w-full",
11788
11865
  get children () {
11789
11866
  return [
11790
- EnhancedTable_tmpl$0(),
11791
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.For, {
11792
- each: options,
11793
- children: (o)=>(()=>{
11794
- var _el$21 = EnhancedTable_tmpl$1();
11795
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$21, ()=>o.label);
11796
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)(()=>_el$21.value = o.value);
11797
- return _el$21;
11798
- })()
11867
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(dropdown_Dropdown.Toggle, {
11868
+ button: true,
11869
+ size: "sm",
11870
+ color: "neutral",
11871
+ class: "w-full justify-between",
11872
+ get children () {
11873
+ return currentLabel();
11874
+ }
11875
+ }),
11876
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(dropdown_Dropdown.Menu, {
11877
+ get children () {
11878
+ return [
11879
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(dropdown_Dropdown.Item, {
11880
+ onClick: ()=>handleSelect(""),
11881
+ get ["aria-selected"] () {
11882
+ return !currentValue();
11883
+ },
11884
+ get ["class"] () {
11885
+ return dist_clsx(!currentValue() && "active");
11886
+ },
11887
+ children: "All"
11888
+ }),
11889
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.For, {
11890
+ each: options,
11891
+ children: (o)=>(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(dropdown_Dropdown.Item, {
11892
+ onClick: ()=>handleSelect(o.value),
11893
+ get ["aria-selected"] () {
11894
+ return currentValue() === o.value;
11895
+ },
11896
+ get ["class"] () {
11897
+ return dist_clsx(currentValue() === o.value && "active");
11898
+ },
11899
+ get children () {
11900
+ return o.label;
11901
+ }
11902
+ })
11903
+ })
11904
+ ];
11905
+ }
11799
11906
  })
11800
11907
  ];
11801
11908
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pathscale/ui",
3
- "version": "0.0.94",
3
+ "version": "0.0.96",
4
4
  "author": "pathscale",
5
5
  "repository": {
6
6
  "type": "git",