@pathscale/ui 0.0.88 → 0.0.90

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.
@@ -0,0 +1,11 @@
1
+ import { Component } from "solid-js";
2
+ import type { IComponentBaseProps } from "../types";
3
+ export interface BottomSheetProps extends IComponentBaseProps {
4
+ isOpen: boolean;
5
+ onClose: () => void;
6
+ children?: any;
7
+ closeOnOverlayClick?: boolean;
8
+ closeOnSwipeDown?: boolean;
9
+ }
10
+ declare const BottomSheet: Component<BottomSheetProps>;
11
+ export default BottomSheet;
@@ -0,0 +1,2 @@
1
+ export type { BottomSheetProps } from "./BottomSheet";
2
+ export { default } from "./BottomSheet";
@@ -1,4 +1,4 @@
1
- import { type JSX, type Accessor } from "solid-js";
1
+ import { type Accessor, type JSX } from "solid-js";
2
2
  import { type ColumnDef, type SortingState, type ColumnFiltersState, type PaginationState, type OnChangeFn } from "@tanstack/solid-table";
3
3
  import { type TableProps } from "./Table";
4
4
  export type EnhancedTableProps<TData> = Omit<TableProps, "children"> & {
@@ -10,6 +10,8 @@ export type EnhancedTableProps<TData> = Omit<TableProps, "children"> & {
10
10
  setColumnFilters?: OnChangeFn<ColumnFiltersState>;
11
11
  pagination?: Accessor<PaginationState>;
12
12
  setPagination?: OnChangeFn<PaginationState>;
13
+ globalFilter?: Accessor<string>;
14
+ setGlobalFilter?: OnChangeFn<string>;
13
15
  enableSorting?: boolean;
14
16
  enableFilters?: boolean;
15
17
  enablePagination?: boolean;
@@ -17,6 +19,8 @@ export type EnhancedTableProps<TData> = Omit<TableProps, "children"> & {
17
19
  row: any;
18
20
  }) => JSX.Element;
19
21
  renderEmpty?: () => JSX.Element;
22
+ loading?: boolean;
23
+ renderLoading?: () => JSX.Element;
20
24
  };
21
25
  declare function EnhancedTable<TData>(props: EnhancedTableProps<TData>): JSX.Element;
22
26
  export default EnhancedTable;
@@ -1,6 +1,5 @@
1
1
  import { type Component, type JSX } from "solid-js";
2
2
  import type { IComponentBaseProps, ComponentSize } from "../types";
3
- import EnhancedTable from "./EnhancedTable";
4
3
  export type TableProps = JSX.HTMLAttributes<HTMLTableElement> & IComponentBaseProps & {
5
4
  size?: ComponentSize;
6
5
  zebra?: boolean;
@@ -15,6 +14,5 @@ declare const _default: Component<TableProps> & {
15
14
  Footer: Component<import("./TableFooter").TableFooterProps>;
16
15
  Cell: Component<import("./TableCell").TableCellProps>;
17
16
  HeadCell: Component<import("./TableHeadCell").TableHeadCellProps>;
18
- Enhanced: typeof EnhancedTable;
19
17
  };
20
18
  export default _default;
@@ -1,3 +1,4 @@
1
1
  export { default } from "./Table";
2
2
  export type { TableProps } from "./Table";
3
+ export { default as EnhancedTable } from "./EnhancedTable";
3
4
  export type { EnhancedTableProps } from "./EnhancedTable";
package/dist/index.d.ts CHANGED
@@ -6,6 +6,8 @@ export { default as Background } from "./components/background";
6
6
  export { default as Badge } from "./components/badge";
7
7
  export { Breadcrumbs, BreadcrumbsItem } from "./components/breadcrumbs";
8
8
  export { default as BrowserMockup, type BrowserMockupProps, } from "./components/browsermockup";
9
+ export { default as BottomSheet } from "./components/bottom-sheet/BottomSheet";
10
+ export type { BottomSheetProps } from "./components/bottom-sheet/BottomSheet";
9
11
  export { default as Button } from "./components/button";
10
12
  export { default as Calendar, type CalendarProps } from "./components/calendar";
11
13
  export { default as Card } from "./components/card";
@@ -70,7 +72,7 @@ export type { StatusProps } from "./components/status";
70
72
  export { default as Steps } from "./components/steps";
71
73
  export { SvgBackground, type SvgBackgroundProps, } from "./components/svgbackground";
72
74
  export { default as Swap } from "./components/swap";
73
- export { default as Table } from "./components/table";
75
+ export { default as Table, EnhancedTable } from "./components/table";
74
76
  export type { TableProps } from "./components/table";
75
77
  export type { EnhancedTableProps } from "./components/table/EnhancedTable";
76
78
  export { default as Tabs } from "./components/tabs";
package/dist/index.js CHANGED
@@ -4119,6 +4119,110 @@ const BrowserMockup = (props)=>{
4119
4119
  })();
4120
4120
  };
4121
4121
  const browsermockup_BrowserMockup = BrowserMockup;
4122
+ var BottomSheet_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div>"), BottomSheet_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div><div class=p-4><div class="w-12 h-1 bg-base-content/30 rounded-full mx-auto mb-4">');
4123
+ const BottomSheet = (props)=>{
4124
+ const merged = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.mergeProps)({
4125
+ closeOnOverlayClick: true,
4126
+ closeOnSwipeDown: true
4127
+ }, props);
4128
+ const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(merged, [
4129
+ "isOpen",
4130
+ "onClose",
4131
+ "children",
4132
+ "dataTheme",
4133
+ "class",
4134
+ "className",
4135
+ "style",
4136
+ "closeOnOverlayClick",
4137
+ "closeOnSwipeDown"
4138
+ ]);
4139
+ const [isDragging, setIsDragging] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(false);
4140
+ const [startY, setStartY] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(0);
4141
+ const [currentY, setCurrentY] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(0);
4142
+ let sheetRef;
4143
+ let overlayRef;
4144
+ const handleTouchStart = (e)=>{
4145
+ if (!local.closeOnSwipeDown) return;
4146
+ const touchY = e.touches[0].clientY;
4147
+ const sheetTop = sheetRef?.getBoundingClientRect().top || 0;
4148
+ if (touchY - sheetTop < 50) {
4149
+ setIsDragging(true);
4150
+ setStartY(touchY);
4151
+ setCurrentY(touchY);
4152
+ }
4153
+ };
4154
+ const handleTouchMove = (e)=>{
4155
+ if (!isDragging()) return;
4156
+ const deltaY = e.touches[0].clientY - startY();
4157
+ const newY = Math.max(0, deltaY);
4158
+ setCurrentY(e.touches[0].clientY);
4159
+ if (sheetRef) sheetRef.style.transform = `translateY(${newY}px)`;
4160
+ e.preventDefault();
4161
+ };
4162
+ const handleTouchEnd = ()=>{
4163
+ if (!isDragging()) return;
4164
+ setIsDragging(false);
4165
+ const deltaY = currentY() - startY();
4166
+ if (deltaY > 100) local.onClose();
4167
+ else if (sheetRef) sheetRef.style.transform = "translateY(0)";
4168
+ };
4169
+ const handleOverlayClick = (e)=>{
4170
+ if (local.closeOnOverlayClick && e.target === overlayRef) local.onClose();
4171
+ };
4172
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onMount)(()=>{
4173
+ if (sheetRef && local.closeOnSwipeDown) {
4174
+ sheetRef.addEventListener("touchstart", handleTouchStart, {
4175
+ passive: true
4176
+ });
4177
+ sheetRef.addEventListener("touchmove", handleTouchMove, {
4178
+ passive: false
4179
+ });
4180
+ sheetRef.addEventListener("touchend", handleTouchEnd, {
4181
+ passive: true
4182
+ });
4183
+ }
4184
+ });
4185
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onCleanup)(()=>{
4186
+ if (sheetRef) {
4187
+ sheetRef.removeEventListener("touchstart", handleTouchStart);
4188
+ sheetRef.removeEventListener("touchmove", handleTouchMove);
4189
+ sheetRef.removeEventListener("touchend", handleTouchEnd);
4190
+ }
4191
+ });
4192
+ return [
4193
+ (()=>{
4194
+ var _el$ = BottomSheet_tmpl$();
4195
+ _el$.$$click = handleOverlayClick;
4196
+ var _ref$ = overlayRef;
4197
+ "function" == typeof _ref$ ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)(_ref$, _el$) : overlayRef = _el$;
4198
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)(()=>(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$, clsx("fixed inset-0 bg-base-100 bg-opacity-60 z-40 transition-opacity duration-200", local.isOpen ? "opacity-100" : "opacity-0 pointer-events-none")));
4199
+ return _el$;
4200
+ })(),
4201
+ (()=>{
4202
+ var _el$2 = BottomSheet_tmpl$2(), _el$3 = _el$2.firstChild;
4203
+ _el$3.firstChild;
4204
+ var _ref$2 = sheetRef;
4205
+ "function" == typeof _ref$2 ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)(_ref$2, _el$2) : sheetRef = _el$2;
4206
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$2, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
4207
+ get ["class"] () {
4208
+ return clsx("bg-base-300 text-base-content fixed bottom-0 left-0 right-0 rounded-t-2xl shadow-lg z-50 transition-transform duration-300 ease-out", local.isOpen ? "translate-y-0" : "translate-y-full");
4209
+ },
4210
+ get style () {
4211
+ return {
4212
+ transform: isDragging() ? `translateY(${Math.max(0, currentY() - startY())}px)` : void 0,
4213
+ ...local.style
4214
+ };
4215
+ }
4216
+ }, others), false, true);
4217
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$3, ()=>local.children, null);
4218
+ return _el$2;
4219
+ })()
4220
+ ];
4221
+ };
4222
+ const bottom_sheet_BottomSheet = BottomSheet;
4223
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.delegateEvents)([
4224
+ "click"
4225
+ ]);
4122
4226
  var Loading_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<span>");
4123
4227
  const Loading = (props)=>{
4124
4228
  const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
@@ -4263,7 +4367,8 @@ const Button = (props)=>{
4263
4367
  "btn-xs sm:btn-sm md:btn-md lg:btn-lg": local.responsive,
4264
4368
  "no-animation": !local.animation,
4265
4369
  "btn-active": local.active,
4266
- "btn-disabled": local.disabled
4370
+ "btn-disabled": local.disabled,
4371
+ "cursor-not-allowed": local.disabled
4267
4372
  }), local.class, local.className);
4268
4373
  const Tag = local.as || "button";
4269
4374
  if (Button_VoidElementList.includes(Tag)) return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.Dynamic, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
@@ -4892,11 +4997,11 @@ const Re = Ht("host", {
4892
4997
  } : t.key = n, Ht(e, t)), I = p, Wt = H`*,*:before,*:after{box-sizing:border-box}button{padding:0;touch-action:manipulation;cursor:pointer;user-select:none}`, Jt = H`.vh{position:absolute;transform:scale(0)}`;
4893
4998
  function lt() {
4894
4999
  const e = /* @__PURE__ */ new Date();
4895
- return new v(e.getFullYear(), e.getMonth() + 1, e.getDate());
5000
+ return new cally_v(e.getFullYear(), e.getMonth() + 1, e.getDate());
4896
5001
  }
4897
5002
  function ut(e, t = 0) {
4898
5003
  const n = w(e), s = n.getUTCDay(), r = (s < t ? 7 : 0) + s - t;
4899
- return n.setUTCDate(n.getUTCDate() - r), v.from(n);
5004
+ return n.setUTCDate(n.getUTCDate() - r), cally_v.from(n);
4900
5005
  }
4901
5006
  function Zt(e, t = 0) {
4902
5007
  return ut(e, t).add({
@@ -4904,10 +5009,10 @@ function Zt(e, t = 0) {
4904
5009
  });
4905
5010
  }
4906
5011
  function Xt(e) {
4907
- return v.from(new Date(Date.UTC(e.year, e.month, 0)));
5012
+ return cally_v.from(new Date(Date.UTC(e.year, e.month, 0)));
4908
5013
  }
4909
5014
  function K(e, t, n) {
4910
- return t && v.compare(e, t) < 0 ? t : n && v.compare(e, n) > 0 ? n : e;
5015
+ return t && cally_v.compare(e, t) < 0 ? t : n && cally_v.compare(e, n) > 0 ? n : e;
4911
5016
  }
4912
5017
  const _e = {
4913
5018
  days: 1
@@ -4915,7 +5020,7 @@ const _e = {
4915
5020
  function je(e, t = 0) {
4916
5021
  let n = ut(e.toPlainDate(), t);
4917
5022
  const s = Zt(Xt(e), t), r = [];
4918
- for(; v.compare(n, s) < 0;){
5023
+ for(; cally_v.compare(n, s) < 0;){
4919
5024
  const o = [];
4920
5025
  for(let a = 0; a < 7; a++)o.push(n), n = n.add(_e);
4921
5026
  r.push(o);
@@ -4926,21 +5031,21 @@ function w(e) {
4926
5031
  return new Date(Date.UTC(e.year, e.month - 1, e.day ?? 1));
4927
5032
  }
4928
5033
  const Ye = /^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[0-1])$/, Q = (e, t)=>e.toString().padStart(t, "0");
4929
- class v {
5034
+ class cally_v {
4930
5035
  constructor(t, n, s){
4931
5036
  this.year = t, this.month = n, this.day = s;
4932
5037
  }
4933
5038
  add(t) {
4934
5039
  const n = w(this);
4935
- if ("days" in t) return n.setUTCDate(this.day + t.days), v.from(n);
5040
+ if ("days" in t) return n.setUTCDate(this.day + t.days), cally_v.from(n);
4936
5041
  let { year: s, month: r } = this;
4937
5042
  "months" in t ? (r = this.month + t.months, n.setUTCMonth(r - 1)) : (s = this.year + t.years, n.setUTCFullYear(s));
4938
- const o = v.from(w({
5043
+ const o = cally_v.from(w({
4939
5044
  year: s,
4940
5045
  month: r,
4941
5046
  day: 1
4942
5047
  }));
4943
- return K(v.from(n), o, Xt(o));
5048
+ return K(cally_v.from(n), o, Xt(o));
4944
5049
  }
4945
5050
  toString() {
4946
5051
  return `${Q(this.year, 4)}-${Q(this.month, 2)}-${Q(this.day, 2)}`;
@@ -4949,7 +5054,7 @@ class v {
4949
5054
  return new W(this.year, this.month);
4950
5055
  }
4951
5056
  equals(t) {
4952
- return 0 === v.compare(this, t);
5057
+ return 0 === cally_v.compare(this, t);
4953
5058
  }
4954
5059
  static compare(t, n) {
4955
5060
  return t.year < n.year ? -1 : t.year > n.year ? 1 : t.month < n.month ? -1 : t.month > n.month ? 1 : t.day < n.day ? -1 : t.day > n.day ? 1 : 0;
@@ -4959,9 +5064,9 @@ class v {
4959
5064
  const n = t.match(Ye);
4960
5065
  if (!n) throw new TypeError(t);
4961
5066
  const [, s, r, o] = n;
4962
- return new v(parseInt(s, 10), parseInt(r, 10), parseInt(o, 10));
5067
+ return new cally_v(parseInt(s, 10), parseInt(r, 10), parseInt(o, 10));
4963
5068
  }
4964
- return new v(t.getUTCFullYear(), t.getUTCMonth() + 1, t.getUTCDate());
5069
+ return new cally_v(t.getUTCFullYear(), t.getUTCMonth() + 1, t.getUTCDate());
4965
5070
  }
4966
5071
  }
4967
5072
  class W {
@@ -4976,7 +5081,7 @@ class W {
4976
5081
  return this.year === t.year && this.month === t.month;
4977
5082
  }
4978
5083
  toPlainDate() {
4979
- return new v(this.year, this.month, 1);
5084
+ return new cally_v(this.year, this.month, 1);
4980
5085
  }
4981
5086
  }
4982
5087
  function z(e, t) {
@@ -4987,7 +5092,7 @@ function z(e, t) {
4987
5092
  function N(e) {
4988
5093
  const [t, n] = it(e);
4989
5094
  return [
4990
- C(()=>z(v, t), [
5095
+ C(()=>z(cally_v, t), [
4991
5096
  t
4992
5097
  ]),
4993
5098
  (o)=>n(o?.toString())
@@ -4997,7 +5102,7 @@ function Be(e) {
4997
5102
  const [t = "", n] = it(e);
4998
5103
  return [
4999
5104
  C(()=>{
5000
- const [o, a] = t.split("/"), u = z(v, o), i = z(v, a);
5105
+ const [o, a] = t.split("/"), u = z(cally_v, o), i = z(cally_v, a);
5001
5106
  return u && i ? [
5002
5107
  u,
5003
5108
  i
@@ -5014,7 +5119,7 @@ function qe(e) {
5014
5119
  C(()=>{
5015
5120
  const o = [];
5016
5121
  for (const a of t.trim().split(/\s+/)){
5017
- const u = z(v, a);
5122
+ const u = z(cally_v, a);
5018
5123
  u && o.push(u);
5019
5124
  }
5020
5125
  return o;
@@ -5464,7 +5569,7 @@ const Qe = cally_j((e)=>{
5464
5569
  styles: mt
5465
5570
  });
5466
5571
  customElements.define("calendar-date", Qe);
5467
- const Mt = (e, t)=>v.compare(e, t) < 0 ? [
5572
+ const Mt = (e, t)=>cally_v.compare(e, t) < 0 ? [
5468
5573
  e,
5469
5574
  t
5470
5575
  ] : [
@@ -10943,7 +11048,7 @@ function Swap(props) {
10943
11048
  (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.delegateEvents)([
10944
11049
  "click"
10945
11050
  ]);
10946
- var TableHead_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<thead><tr>");
11051
+ var TableHead_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<thead>"), TableHead_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<tr>");
10947
11052
  const TableHead_TableHead = (props)=>{
10948
11053
  const [local, rest] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
10949
11054
  "children",
@@ -10955,7 +11060,7 @@ const TableHead_TableHead = (props)=>{
10955
11060
  const classes = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>twMerge(dist_clsx(local.class, local.className)));
10956
11061
  const resolved = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.children)(()=>local.children);
10957
11062
  return (()=>{
10958
- var _el$ = TableHead_tmpl$(), _el$2 = _el$.firstChild;
11063
+ var _el$ = TableHead_tmpl$();
10959
11064
  (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
10960
11065
  get ["class"] () {
10961
11066
  return classes();
@@ -10964,7 +11069,21 @@ const TableHead_TableHead = (props)=>{
10964
11069
  return local.dataTheme;
10965
11070
  }
10966
11071
  }, rest), false, true);
10967
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$2, resolved);
11072
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
11073
+ get when () {
11074
+ return local.noCell;
11075
+ },
11076
+ get fallback () {
11077
+ return (()=>{
11078
+ var _el$2 = TableHead_tmpl$2();
11079
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$2, resolved);
11080
+ return _el$2;
11081
+ })();
11082
+ },
11083
+ get children () {
11084
+ return resolved();
11085
+ }
11086
+ }));
10968
11087
  return _el$;
10969
11088
  })();
10970
11089
  };
@@ -11126,7 +11245,52 @@ const TableFooter = (props)=>{
11126
11245
  })();
11127
11246
  };
11128
11247
  const table_TableFooter = TableFooter;
11129
- var EnhancedTable_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div class="flex items-center gap-2">'), EnhancedTable_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)(`<span>\u{2191}`), EnhancedTable_tmpl$3 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)(`<span>\u{2193}`);
11248
+ var Table_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<table>");
11249
+ const Table = (props)=>{
11250
+ const [local, rest] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
11251
+ "children",
11252
+ "size",
11253
+ "zebra",
11254
+ "pinRows",
11255
+ "pinCols",
11256
+ "hover",
11257
+ "dataTheme",
11258
+ "class"
11259
+ ]);
11260
+ const classes = ()=>twMerge("table", local.class, dist_clsx({
11261
+ "table-zebra": local.zebra,
11262
+ "table-hover": local.hover,
11263
+ "table-xl": "xl" === local.size,
11264
+ "table-lg": "lg" === local.size,
11265
+ "table-md": "md" === local.size,
11266
+ "table-sm": "sm" === local.size,
11267
+ "table-xs": "xs" === local.size,
11268
+ "table-pin-rows": local.pinRows,
11269
+ "table-pin-cols": local.pinCols
11270
+ }));
11271
+ return (()=>{
11272
+ var _el$ = Table_tmpl$();
11273
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
11274
+ get ["data-theme"] () {
11275
+ return local.dataTheme;
11276
+ },
11277
+ get ["class"] () {
11278
+ return classes();
11279
+ }
11280
+ }, rest), false, true);
11281
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, ()=>local.children);
11282
+ return _el$;
11283
+ })();
11284
+ };
11285
+ const table_Table = Object.assign(Table, {
11286
+ Head: TableHead,
11287
+ Body: table_TableBody,
11288
+ Row: table_TableRow,
11289
+ Footer: table_TableFooter,
11290
+ Cell: TableCell,
11291
+ HeadCell: table_TableHeadCell
11292
+ });
11293
+ var EnhancedTable_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<caption class="mb-3 text-left"><div class="flex items-center gap-2"><div class=join>'), EnhancedTable_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<tr>"), 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 class="flex items-center justify-between w-full"><div class="flex items-center gap-2"><span class=opacity-70>Rows per page</span></div><div class="flex items-center gap-3"><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">'), EnhancedTable_tmpl$9 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)(`<span>\u{2191}`), EnhancedTable_tmpl$0 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)(`<span>\u{2193}`), EnhancedTable_tmpl$1 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div class="flex gap-1">'), EnhancedTable_tmpl$10 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<option value>All"), _tmpl$11 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<option>");
11130
11294
  function EnhancedTable_EnhancedTable(props) {
11131
11295
  const [local, tableProps] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
11132
11296
  "data",
@@ -11137,11 +11301,15 @@ function EnhancedTable_EnhancedTable(props) {
11137
11301
  "setColumnFilters",
11138
11302
  "pagination",
11139
11303
  "setPagination",
11304
+ "globalFilter",
11305
+ "setGlobalFilter",
11140
11306
  "enableSorting",
11141
11307
  "enableFilters",
11142
11308
  "enablePagination",
11143
11309
  "renderRowSubComponent",
11144
- "renderEmpty"
11310
+ "renderEmpty",
11311
+ "loading",
11312
+ "renderLoading"
11145
11313
  ]);
11146
11314
  const table = (0, __WEBPACK_EXTERNAL_MODULE__tanstack_solid_table_1239d047__.createSolidTable)({
11147
11315
  get data () {
@@ -11162,11 +11330,15 @@ function EnhancedTable_EnhancedTable(props) {
11162
11330
  pageIndex: 0,
11163
11331
  pageSize: 10
11164
11332
  };
11333
+ },
11334
+ get globalFilter () {
11335
+ return local.globalFilter?.() || "";
11165
11336
  }
11166
11337
  },
11167
11338
  onSortingChange: local.setSorting,
11168
11339
  onColumnFiltersChange: local.setColumnFilters,
11169
11340
  onPaginationChange: local.setPagination,
11341
+ onGlobalFilterChange: local.setGlobalFilter,
11170
11342
  getCoreRowModel: (0, __WEBPACK_EXTERNAL_MODULE__tanstack_solid_table_1239d047__.getCoreRowModel)(),
11171
11343
  getSortedRowModel: (0, __WEBPACK_EXTERNAL_MODULE__tanstack_solid_table_1239d047__.getSortedRowModel)(),
11172
11344
  getFilteredRowModel: (0, __WEBPACK_EXTERNAL_MODULE__tanstack_solid_table_1239d047__.getFilteredRowModel)(),
@@ -11176,51 +11348,122 @@ function EnhancedTable_EnhancedTable(props) {
11176
11348
  manualPagination: !local.enablePagination
11177
11349
  });
11178
11350
  const tableRows = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createMemo)(()=>{
11351
+ if (local.loading) return [];
11179
11352
  const rows = table.getRowModel().rows;
11180
11353
  if (0 === rows.length && local.renderEmpty) return [];
11181
11354
  return rows;
11182
11355
  });
11356
+ const headerGroups = ()=>table.getHeaderGroups();
11357
+ const leafHeaders = ()=>headerGroups().length > 0 ? headerGroups()[headerGroups().length - 1].headers : [];
11183
11358
  return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(tableProps, {
11184
11359
  get children () {
11185
11360
  return [
11361
+ (()=>{
11362
+ var _el$ = EnhancedTable_tmpl$(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
11363
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$3, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(input_Input, {
11364
+ size: "sm",
11365
+ placeholder: "Search\u2026",
11366
+ get value () {
11367
+ return table.getState().globalFilter ?? "";
11368
+ },
11369
+ onInput: (e)=>{
11370
+ const val = e.currentTarget.value;
11371
+ clearTimeout(window.__t);
11372
+ window.__t = setTimeout(()=>table.setGlobalFilter(val), 300);
11373
+ }
11374
+ }), null);
11375
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$3, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(button_Button, {
11376
+ size: "sm",
11377
+ color: "neutral",
11378
+ onClick: ()=>table.setGlobalFilter(""),
11379
+ children: "Clear"
11380
+ }), null);
11381
+ return _el$;
11382
+ })(),
11186
11383
  (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table.Head, {
11384
+ noCell: true,
11187
11385
  get children () {
11188
- return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.For, {
11189
- get each () {
11190
- return table.getHeaderGroups();
11191
- },
11192
- children: (headerGroup)=>(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.For, {
11193
- get each () {
11194
- return headerGroup.headers;
11195
- },
11196
- children: (header)=>(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table.HeadCell, {
11197
- get ["class"] () {
11198
- return header.column.getCanSort() ? "cursor-pointer select-none" : "";
11199
- },
11200
- get onClick () {
11201
- return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.memo)(()=>!!header.column.getCanSort())() ? header.column.getToggleSortingHandler() : void 0;
11386
+ return [
11387
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.For, {
11388
+ get each () {
11389
+ return headerGroups();
11390
+ },
11391
+ children: (hg)=>(()=>{
11392
+ var _el$17 = EnhancedTable_tmpl$2();
11393
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$17, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.For, {
11394
+ get each () {
11395
+ return hg.headers;
11202
11396
  },
11203
- get children () {
11204
- var _el$ = EnhancedTable_tmpl$();
11205
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, ()=>(0, __WEBPACK_EXTERNAL_MODULE__tanstack_solid_table_1239d047__.flexRender)(header.column.columnDef.header, header.getContext()), null);
11206
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, (()=>{
11207
- var _c$ = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.memo)(()=>"asc" === header.column.getIsSorted());
11208
- return ()=>_c$() && EnhancedTable_tmpl$2();
11209
- })(), null);
11210
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, (()=>{
11211
- var _c$2 = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.memo)(()=>"desc" === header.column.getIsSorted());
11212
- return ()=>_c$2() && EnhancedTable_tmpl$3();
11213
- })(), null);
11214
- return _el$;
11215
- }
11216
- })
11217
- })
11218
- });
11397
+ children: (header)=>(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table.HeadCell, {
11398
+ get ["class"] () {
11399
+ return header.column.getCanSort() ? "cursor-pointer select-none" : "";
11400
+ },
11401
+ get onClick () {
11402
+ return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.memo)(()=>!!header.column.getCanSort())() ? header.column.getToggleSortingHandler() : void 0;
11403
+ },
11404
+ get children () {
11405
+ var _el$18 = EnhancedTable_tmpl$8();
11406
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$18, ()=>(0, __WEBPACK_EXTERNAL_MODULE__tanstack_solid_table_1239d047__.flexRender)(header.column.columnDef.header, header.getContext()), null);
11407
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$18, (()=>{
11408
+ var _c$ = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.memo)(()=>"asc" === header.column.getIsSorted());
11409
+ return ()=>_c$() && EnhancedTable_tmpl$9();
11410
+ })(), null);
11411
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$18, (()=>{
11412
+ var _c$2 = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.memo)(()=>"desc" === header.column.getIsSorted());
11413
+ return ()=>_c$2() && EnhancedTable_tmpl$0();
11414
+ })(), null);
11415
+ return _el$18;
11416
+ }
11417
+ })
11418
+ }));
11419
+ return _el$17;
11420
+ })()
11421
+ }),
11422
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
11423
+ get when () {
11424
+ return local.enableFilters;
11425
+ },
11426
+ get children () {
11427
+ var _el$4 = EnhancedTable_tmpl$2();
11428
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$4, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.For, {
11429
+ get each () {
11430
+ return leafHeaders();
11431
+ },
11432
+ children: (header)=>(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table.HeadCell, {
11433
+ get children () {
11434
+ return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.memo)(()=>!!(header.isPlaceholder || !header.column.getCanFilter()))() ? null : (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(ColumnFilter, {
11435
+ get column () {
11436
+ return header.column;
11437
+ }
11438
+ });
11439
+ }
11440
+ })
11441
+ }));
11442
+ return _el$4;
11443
+ }
11444
+ })
11445
+ ];
11219
11446
  }
11220
11447
  }),
11221
11448
  (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table.Body, {
11222
11449
  get children () {
11223
- return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.memo)(()=>!!(0 === tableRows().length && local.renderEmpty))() ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table.Row, {
11450
+ return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.memo)(()=>!!local.loading)() ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table.Row, {
11451
+ get children () {
11452
+ return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table.Cell, {
11453
+ get colSpan () {
11454
+ return table.getAllColumns().length;
11455
+ },
11456
+ class: "text-center py-6",
11457
+ get children () {
11458
+ return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.memo)(()=>!!local.renderLoading)() ? local.renderLoading() : (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(loading_Loading, {
11459
+ variant: "spinner",
11460
+ size: "lg",
11461
+ color: "primary"
11462
+ });
11463
+ }
11464
+ });
11465
+ }
11466
+ }) : (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.memo)(()=>!!(0 === tableRows().length && local.renderEmpty))() ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table.Row, {
11224
11467
  get children () {
11225
11468
  return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table.Cell, {
11226
11469
  get colSpan () {
@@ -11236,93 +11479,157 @@ function EnhancedTable_EnhancedTable(props) {
11236
11479
  get each () {
11237
11480
  return tableRows();
11238
11481
  },
11239
- children: (row)=>[
11240
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table.Row, {
11241
- get ["class"] () {
11242
- return row.getIsExpanded() ? "bg-base-200" : "";
11243
- },
11244
- get children () {
11245
- return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.For, {
11246
- get each () {
11247
- return row.getVisibleCells();
11248
- },
11249
- children: (cell)=>(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table.Cell, {
11250
- get children () {
11251
- return (0, __WEBPACK_EXTERNAL_MODULE__tanstack_solid_table_1239d047__.flexRender)(cell.column.columnDef.cell, cell.getContext());
11252
- }
11253
- })
11254
- });
11255
- }
11256
- }),
11257
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.memo)(()=>(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.memo)(()=>!!(row.getIsExpanded() && local.renderRowSubComponent))() && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table.Row, {
11258
- get children () {
11259
- return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table.Cell, {
11260
- get colSpan () {
11261
- return row.getVisibleCells().length;
11262
- },
11482
+ children: (row)=>(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table.Row, {
11483
+ get children () {
11484
+ return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.For, {
11485
+ get each () {
11486
+ return row.getVisibleCells();
11487
+ },
11488
+ children: (cell)=>(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table.Cell, {
11263
11489
  get children () {
11264
- return local.renderRowSubComponent({
11265
- row
11266
- });
11490
+ return (0, __WEBPACK_EXTERNAL_MODULE__tanstack_solid_table_1239d047__.flexRender)(cell.column.columnDef.cell, cell.getContext());
11267
11491
  }
11268
- });
11269
- }
11270
- }))
11271
- ]
11492
+ })
11493
+ });
11494
+ }
11495
+ })
11272
11496
  });
11273
11497
  }
11498
+ }),
11499
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(table_Table.Footer, {
11500
+ noCell: true,
11501
+ get children () {
11502
+ 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$15 = _el$12.nextSibling, _el$16 = (_el$15.nextSibling, _el$11.nextSibling);
11503
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$6, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(select_Select, {
11504
+ size: "sm",
11505
+ get value () {
11506
+ return String(table.getState().pagination.pageSize);
11507
+ },
11508
+ onChange: (e)=>table.setPageSize(Number(e.currentTarget.value)),
11509
+ get children () {
11510
+ return [
11511
+ EnhancedTable_tmpl$3(),
11512
+ EnhancedTable_tmpl$4(),
11513
+ EnhancedTable_tmpl$5(),
11514
+ EnhancedTable_tmpl$6()
11515
+ ];
11516
+ }
11517
+ }), null);
11518
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$11, ()=>table.getState().pagination.pageIndex + 1, _el$15);
11519
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$11, ()=>table.getPageCount() || 1, null);
11520
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$16, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(button_Button, {
11521
+ size: "sm",
11522
+ get disabled () {
11523
+ return !table.getCanPreviousPage();
11524
+ },
11525
+ onClick: ()=>table.setPageIndex(0),
11526
+ children: "|\u27EA"
11527
+ }), null);
11528
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$16, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(button_Button, {
11529
+ size: "sm",
11530
+ get disabled () {
11531
+ return !table.getCanPreviousPage();
11532
+ },
11533
+ onClick: ()=>table.previousPage(),
11534
+ children: "Prev"
11535
+ }), null);
11536
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$16, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(button_Button, {
11537
+ size: "sm",
11538
+ get disabled () {
11539
+ return !table.getCanNextPage();
11540
+ },
11541
+ onClick: ()=>table.nextPage(),
11542
+ children: "Next"
11543
+ }), null);
11544
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$16, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(button_Button, {
11545
+ size: "sm",
11546
+ get disabled () {
11547
+ return !table.getCanNextPage();
11548
+ },
11549
+ onClick: ()=>table.setPageIndex(table.getPageCount() - 1),
11550
+ children: "\u27EB|"
11551
+ }), null);
11552
+ return _el$5;
11553
+ }
11274
11554
  })
11275
11555
  ];
11276
11556
  }
11277
11557
  }));
11278
11558
  }
11279
- const EnhancedTable = EnhancedTable_EnhancedTable;
11280
- var Table_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<table>");
11281
- const Table = (props)=>{
11282
- const [local, rest] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
11283
- "children",
11284
- "size",
11285
- "zebra",
11286
- "pinRows",
11287
- "pinCols",
11288
- "hover",
11289
- "dataTheme",
11290
- "class"
11291
- ]);
11292
- const classes = ()=>twMerge("table", local.class, dist_clsx({
11293
- "table-zebra": local.zebra,
11294
- "table-hover": local.hover,
11295
- "table-xl": "xl" === local.size,
11296
- "table-lg": "lg" === local.size,
11297
- "table-md": "md" === local.size,
11298
- "table-sm": "sm" === local.size,
11299
- "table-xs": "xs" === local.size,
11300
- "table-pin-rows": local.pinRows,
11301
- "table-pin-cols": local.pinCols
11302
- }));
11303
- return (()=>{
11304
- var _el$ = Table_tmpl$();
11305
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
11306
- get ["data-theme"] () {
11307
- return local.dataTheme;
11559
+ function ColumnFilter(props) {
11560
+ const col = props.column;
11561
+ const value = ()=>col.getFilterValue();
11562
+ const type = col.columnDef.meta?.filterType ?? "text";
11563
+ if ("text" === type) return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(input_Input, {
11564
+ size: "xs",
11565
+ placeholder: "Filter\u2026",
11566
+ get value () {
11567
+ return value() ?? "";
11568
+ },
11569
+ onInput: (e)=>col.setFilterValue(e.currentTarget.value || void 0)
11570
+ });
11571
+ if ("numberRange" === type) {
11572
+ const v = value() ?? [
11573
+ void 0,
11574
+ void 0
11575
+ ];
11576
+ const setRange = (min, max)=>{
11577
+ if (!min && !max) return col.setFilterValue(void 0);
11578
+ col.setFilterValue([
11579
+ min || void 0,
11580
+ max || void 0
11581
+ ]);
11582
+ };
11583
+ return (()=>{
11584
+ var _el$21 = EnhancedTable_tmpl$1();
11585
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$21, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(input_Input, {
11586
+ size: "xs",
11587
+ type: "number",
11588
+ placeholder: "Min",
11589
+ get value () {
11590
+ return v[0] ?? "";
11591
+ },
11592
+ onInput: (e)=>setRange(e.currentTarget.value, v[1])
11593
+ }), null);
11594
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$21, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(input_Input, {
11595
+ size: "xs",
11596
+ type: "number",
11597
+ placeholder: "Max",
11598
+ get value () {
11599
+ return v[1] ?? "";
11600
+ },
11601
+ onInput: (e)=>setRange(v[0], e.currentTarget.value)
11602
+ }), null);
11603
+ return _el$21;
11604
+ })();
11605
+ }
11606
+ if ("select" === type) {
11607
+ const options = col.columnDef.meta?.options ?? [];
11608
+ return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(select_Select, {
11609
+ size: "xs",
11610
+ get value () {
11611
+ return value() ?? "";
11308
11612
  },
11309
- get ["class"] () {
11310
- return classes();
11613
+ onChange: (e)=>col.setFilterValue(e.currentTarget.value || void 0),
11614
+ get children () {
11615
+ return [
11616
+ EnhancedTable_tmpl$10(),
11617
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.For, {
11618
+ each: options,
11619
+ children: (o)=>(()=>{
11620
+ var _el$23 = _tmpl$11();
11621
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$23, ()=>o.label);
11622
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)(()=>_el$23.value = o.value);
11623
+ return _el$23;
11624
+ })()
11625
+ })
11626
+ ];
11311
11627
  }
11312
- }, rest), false, true);
11313
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, ()=>local.children);
11314
- return _el$;
11315
- })();
11316
- };
11317
- const table_Table = Object.assign(Table, {
11318
- Head: TableHead,
11319
- Body: table_TableBody,
11320
- Row: table_TableRow,
11321
- Footer: table_TableFooter,
11322
- Cell: TableCell,
11323
- HeadCell: table_TableHeadCell,
11324
- Enhanced: EnhancedTable
11325
- });
11628
+ });
11629
+ }
11630
+ return null;
11631
+ }
11632
+ const EnhancedTable = EnhancedTable_EnhancedTable;
11326
11633
  var Tab_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<a role=tab>");
11327
11634
  const Tab = (props)=>{
11328
11635
  const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
@@ -11915,4 +12222,4 @@ const WindowMockup = (props)=>{
11915
12222
  })();
11916
12223
  };
11917
12224
  const windowmockup_WindowMockup = WindowMockup;
11918
- export { accordion_Accordion as Accordion, alert_Alert as Alert, artboard_Artboard as Artboard, avatar as Avatar, background_Background as Background, Badge, Breadcrumbs, breadcrumbs_BreadcrumbsItem as BreadcrumbsItem, browsermockup_BrowserMockup as BrowserMockup, button_Button as Button, Calendar, card_Card as Card, carousel_Carousel as Carousel, chatbubble_ChatBubble as ChatBubble, checkbox_Checkbox as Checkbox, codemockup_CodeMockup as CodeMockup, CodeMockupLine, collapse_Collapse as Collapse, CollapseContent, CollapseDetails, CollapseTitle, connectionstatus_ConnectionStatus as ConnectionStatus, CopyButton, countdown_Countdown as Countdown, diff_Diff as Diff, divider as Divider, dock as Dock, Drawer, dropdown as Dropdown, FileInput, flex_Flex as Flex, footer_Footer as Footer, form_Form as Form, Grid, hero_Hero as Hero, icon_Icon as Icon, indicator_Indicator as Indicator, input as Input, join_Join as Join, kbd_Kbd as Kbd, link_Link as Link, loading_Loading as Loading, mask as Mask, menu_Menu as Menu, modal_Modal as Modal, navbar_Navbar as Navbar, pagination_Pagination as Pagination, phonemockup_PhoneMockup as PhoneMockup, Progress, props_table_PropsTable as PropsTable, radialprogress_RadialProgress as RadialProgress, radio_Radio as Radio, range_Range as Range, Rating, select_Select as Select, showcase_ShowcaseBlock as ShowcaseBlock, showcase_section_ShowcaseSection as ShowcaseSection, sidenav_Sidenav as Sidenav, sidenav_SidenavButton as SidenavButton, sidenav_SidenavGroup as SidenavGroup, sidenav_SidenavItem as SidenavItem, sidenav_SidenavLink as SidenavLink, sidenav_SidenavMenu as SidenavMenu, skeleton_Skeleton as Skeleton, Stack, stat_card_StatCard as StatCard, stats_Stats as Stats, status_Status as Status, steps as Steps, Summary, SvgBackground, Swap, table_Table as Table, tabs_Tabs as Tabs, textarea_Textarea as Textarea, Timeline, timeline_TimelineEnd as TimelineEnd, timeline_TimelineItem as TimelineItem, timeline_TimelineMiddle as TimelineMiddle, timeline_TimelineStart as TimelineStart, toast_Toast as Toast, ToastContainer, toggle_Toggle as Toggle, tooltip_Tooltip as Tooltip, windowmockup_WindowMockup as WindowMockup, connectionstatus_ConnectionStatus as default, toastStore, useDesktop, useFormValidation };
12225
+ export { accordion_Accordion as Accordion, alert_Alert as Alert, artboard_Artboard as Artboard, avatar as Avatar, background_Background as Background, Badge, bottom_sheet_BottomSheet as BottomSheet, Breadcrumbs, breadcrumbs_BreadcrumbsItem as BreadcrumbsItem, browsermockup_BrowserMockup as BrowserMockup, button_Button as Button, Calendar, card_Card as Card, carousel_Carousel as Carousel, chatbubble_ChatBubble as ChatBubble, checkbox_Checkbox as Checkbox, codemockup_CodeMockup as CodeMockup, CodeMockupLine, collapse_Collapse as Collapse, CollapseContent, CollapseDetails, CollapseTitle, connectionstatus_ConnectionStatus as ConnectionStatus, CopyButton, countdown_Countdown as Countdown, diff_Diff as Diff, divider as Divider, dock as Dock, Drawer, dropdown as Dropdown, EnhancedTable, FileInput, flex_Flex as Flex, footer_Footer as Footer, form_Form as Form, Grid, hero_Hero as Hero, icon_Icon as Icon, indicator_Indicator as Indicator, input as Input, join_Join as Join, kbd_Kbd as Kbd, link_Link as Link, loading_Loading as Loading, mask as Mask, menu_Menu as Menu, modal_Modal as Modal, navbar_Navbar as Navbar, pagination_Pagination as Pagination, phonemockup_PhoneMockup as PhoneMockup, Progress, props_table_PropsTable as PropsTable, radialprogress_RadialProgress as RadialProgress, radio_Radio as Radio, range_Range as Range, Rating, select_Select as Select, showcase_ShowcaseBlock as ShowcaseBlock, showcase_section_ShowcaseSection as ShowcaseSection, sidenav_Sidenav as Sidenav, sidenav_SidenavButton as SidenavButton, sidenav_SidenavGroup as SidenavGroup, sidenav_SidenavItem as SidenavItem, sidenav_SidenavLink as SidenavLink, sidenav_SidenavMenu as SidenavMenu, skeleton_Skeleton as Skeleton, Stack, stat_card_StatCard as StatCard, stats_Stats as Stats, status_Status as Status, steps as Steps, Summary, SvgBackground, Swap, table_Table as Table, tabs_Tabs as Tabs, textarea_Textarea as Textarea, Timeline, timeline_TimelineEnd as TimelineEnd, timeline_TimelineItem as TimelineItem, timeline_TimelineMiddle as TimelineMiddle, timeline_TimelineStart as TimelineStart, toast_Toast as Toast, ToastContainer, toggle_Toggle as Toggle, tooltip_Tooltip as Tooltip, windowmockup_WindowMockup as WindowMockup, connectionstatus_ConnectionStatus as default, toastStore, useDesktop, useFormValidation };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pathscale/ui",
3
- "version": "0.0.88",
3
+ "version": "0.0.90",
4
4
  "author": "pathscale",
5
5
  "repository": {
6
6
  "type": "git",